roamjs-components 0.85.4 → 0.86.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +29 -29
  3. package/components/AutocompleteInput.d.ts +4 -4
  4. package/components/AutocompleteInput.js.map +1 -1
  5. package/components/BlockErrorBoundary.d.ts +2 -2
  6. package/components/BlockErrorBoundary.js.map +1 -1
  7. package/components/BlockInput.d.ts +5 -5
  8. package/components/BlockInput.js.map +1 -1
  9. package/components/ComponentContainer.js.map +1 -1
  10. package/components/ConfigPage.d.ts +4 -4
  11. package/components/ConfigPage.js +1 -1
  12. package/components/ConfigPage.js.map +1 -1
  13. package/components/ConfigPanels/BlockPanel.js.map +1 -1
  14. package/components/ConfigPanels/BlocksPanel.js.map +1 -1
  15. package/components/ConfigPanels/FlagPanel.js.map +1 -1
  16. package/components/ConfigPanels/MultiChildPanel.js.map +1 -1
  17. package/components/ConfigPanels/OauthPanel.js.map +1 -1
  18. package/components/ConfigPanels/getBrandColors.d.ts +1 -1
  19. package/components/ConfigPanels/getBrandColors.js.map +1 -1
  20. package/components/ConfigPanels/types.d.ts +15 -15
  21. package/components/ConfigPanels/types.js.map +1 -1
  22. package/components/ConfigPanels/useSingleChildValue.d.ts +1 -1
  23. package/components/ConfigPanels/useSingleChildValue.js.map +1 -1
  24. package/components/CursorMenu.d.ts +1 -1
  25. package/components/CursorMenu.js.map +1 -1
  26. package/components/ExternalLogin.d.ts +3 -3
  27. package/components/ExternalLogin.js +2 -2
  28. package/components/ExternalLogin.js.map +1 -1
  29. package/components/Filter.d.ts +6 -6
  30. package/components/FormDialog.d.ts +1 -1
  31. package/components/FormDialog.js +6 -6
  32. package/components/FormDialog.js.map +1 -1
  33. package/components/Loading.d.ts +0 -1
  34. package/components/Loading.js.map +1 -1
  35. package/components/MenuItemSelect.d.ts +5 -5
  36. package/components/OauthPanel.d.ts +0 -1
  37. package/components/PageInput.d.ts +2 -2
  38. package/components/PageLink.d.ts +1 -1
  39. package/components/PageLink.js.map +1 -1
  40. package/components/ProgressDialog.d.ts +1 -2
  41. package/components/ProgressDialog.js.map +1 -1
  42. package/components/SimpleAlert.d.ts +1 -1
  43. package/components/Toast.d.ts +2 -2
  44. package/components/Toast.js.map +1 -1
  45. package/components/index.js +2 -2
  46. package/components/index.js.map +1 -1
  47. package/components.js.map +1 -1
  48. package/date/constants.js.map +1 -1
  49. package/date/index.js.map +1 -1
  50. package/date/parseNlpDate.js.map +1 -1
  51. package/date/parseRoamDateUid.js.map +1 -1
  52. package/dom/addBlockCommand.js.map +1 -1
  53. package/dom/addKeyboardTriggers.js.map +1 -1
  54. package/dom/addOldRoamJSDependency.js.map +1 -1
  55. package/dom/addRoamJSDependency.js.map +1 -1
  56. package/dom/addScriptAsDependency.js.map +1 -1
  57. package/dom/addStyle.js.map +1 -1
  58. package/dom/constants.js.map +1 -1
  59. package/dom/createBlockObserver.d.ts +6 -6
  60. package/dom/createBlockObserver.js.map +1 -1
  61. package/dom/createButtonObserver.d.ts +1 -1
  62. package/dom/createButtonObserver.js.map +1 -1
  63. package/dom/createDivObserver.js.map +1 -1
  64. package/dom/createHTMLObserver.d.ts +2 -2
  65. package/dom/createHTMLObserver.js.map +1 -1
  66. package/dom/createHashtagObserver.js.map +1 -1
  67. package/dom/createIconButton.js.map +1 -1
  68. package/dom/createObserver.js.map +1 -1
  69. package/dom/createOverlayObserver.js.map +1 -1
  70. package/dom/createPageObserver.js.map +1 -1
  71. package/dom/createPageTitleObserver.d.ts +1 -1
  72. package/dom/createPageTitleObserver.js.map +1 -1
  73. package/dom/elToTitle.js.map +1 -1
  74. package/dom/genericError.js.map +1 -1
  75. package/dom/getActiveUids.js.map +1 -1
  76. package/dom/getBlockUidFromTarget.js.map +1 -1
  77. package/dom/getCurrentPageUid.js.map +1 -1
  78. package/dom/getDomRefs.js.map +1 -1
  79. package/dom/getDropUidOffset.js.map +1 -1
  80. package/dom/getMutatedNodes.js.map +1 -1
  81. package/dom/getPageTitleByHtmlElement.js.map +1 -1
  82. package/dom/getPageTitleValueByHtmlElement.js.map +1 -1
  83. package/dom/getReferenceBlockUid.js.map +1 -1
  84. package/dom/getRoamUrl.js.map +1 -1
  85. package/dom/getRoamUrlByPage.js.map +1 -1
  86. package/dom/getUids.js.map +1 -1
  87. package/dom/getUidsFromButton.js.map +1 -1
  88. package/dom/getUidsFromId.js.map +1 -1
  89. package/dom/index.js.map +1 -1
  90. package/dom/parseRoamBlocksToHtml.js.map +1 -1
  91. package/dom/resolveRefs.js.map +1 -1
  92. package/events/index.js +2 -4
  93. package/events/index.js.map +1 -1
  94. package/events/watchOnce.js.map +1 -1
  95. package/hooks/index.js +3 -5
  96. package/hooks/index.js.map +1 -1
  97. package/hooks/useArrowKeyDown.js.map +1 -1
  98. package/hooks/useSubTree.js.map +1 -1
  99. package/marked/index.d.ts +4 -4
  100. package/marked/index.js +25 -25
  101. package/marked/index.js.map +1 -1
  102. package/package.json +114 -116
  103. package/queries/compileDatalog.js.map +1 -1
  104. package/queries/getAllBlockUids.js.map +1 -1
  105. package/queries/getAllBlockUidsAndTexts.js.map +1 -1
  106. package/queries/getAllPageNames.js.map +1 -1
  107. package/queries/getAttributeValueByBlockAndName.js.map +1 -1
  108. package/queries/getBasicTreeByParentUid.js.map +1 -1
  109. package/queries/getBlockUidAndTextIncludingText.js.map +1 -1
  110. package/queries/getBlockUidByTextOnPage.js.map +1 -1
  111. package/queries/getBlockUidsAndTextsReferencingPage.js.map +1 -1
  112. package/queries/getBlockUidsByPageTitle.js.map +1 -1
  113. package/queries/getBlockUidsReferencingBlock.js.map +1 -1
  114. package/queries/getBlockUidsReferencingPage.js.map +1 -1
  115. package/queries/getBlockUidsWithParentUid.js.map +1 -1
  116. package/queries/getChildrenLengthByPageUid.js.map +1 -1
  117. package/queries/getChildrenLengthByParentUid.js.map +1 -1
  118. package/queries/getCreateTimeByBlockUid.js.map +1 -1
  119. package/queries/getCurrentUser.js.map +1 -1
  120. package/queries/getCurrentUserDisplayName.js.map +1 -1
  121. package/queries/getCurrentUserEmail.js.map +1 -1
  122. package/queries/getCurrentUserUid.js.map +1 -1
  123. package/queries/getDisplayNameByEmail.js.map +1 -1
  124. package/queries/getDisplayNameByUid.js.map +1 -1
  125. package/queries/getEditTimeByBlockUid.js.map +1 -1
  126. package/queries/getEditedUserEmailByBlockUid.js.map +1 -1
  127. package/queries/getFirstChildTextByBlockUid.js.map +1 -1
  128. package/queries/getFirstChildUidByBlockUid.js.map +1 -1
  129. package/queries/getFullTreeByParentUid.js +13 -13
  130. package/queries/getFullTreeByParentUid.js.map +1 -1
  131. package/queries/getLinkedPageTitlesUnderUid.js.map +1 -1
  132. package/queries/getNthChildUidByBlockUid.js.map +1 -1
  133. package/queries/getOrderByBlockUid.js.map +1 -1
  134. package/queries/getPageTitleByBlockUid.js.map +1 -1
  135. package/queries/getPageTitleByPageUid.js.map +1 -1
  136. package/queries/getPageTitleReferencesByPageTitle.js.map +1 -1
  137. package/queries/getPageTitlesAndBlockUidsReferencingPage.js.map +1 -1
  138. package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js.map +1 -1
  139. package/queries/getPageTitlesReferencingBlockUid.js.map +1 -1
  140. package/queries/getPageTitlesStartingWithPrefix.js.map +1 -1
  141. package/queries/getPageUidByBlockUid.js.map +1 -1
  142. package/queries/getPageUidByPageTitle.js.map +1 -1
  143. package/queries/getPageViewType.js.map +1 -1
  144. package/queries/getParentTextByBlockUid.js.map +1 -1
  145. package/queries/getParentTextByBlockUidAndTag.js.map +1 -1
  146. package/queries/getParentUidByBlockUid.js.map +1 -1
  147. package/queries/getParentUidsOfBlockUid.js.map +1 -1
  148. package/queries/getSettingsByEmail.js.map +1 -1
  149. package/queries/getShallowTreeByParentUid.js.map +1 -1
  150. package/queries/getTextByBlockUid.js.map +1 -1
  151. package/queries/index.js +2 -2
  152. package/queries/index.js.map +1 -1
  153. package/queries/isLiveBlock.js.map +1 -1
  154. package/queries/isTagOnPage.js.map +1 -1
  155. package/queries/normalizePageTitle.js.map +1 -1
  156. package/scripts/index.js +17 -7
  157. package/scripts/index.js.map +1 -1
  158. package/scripts/publishToRoamDepot.d.ts +4 -4
  159. package/scripts/publishToRoamDepot.js +1 -1
  160. package/scripts/publishToRoamDepot.js.map +1 -1
  161. package/testing/mockRoamEnvironment.js.map +1 -1
  162. package/types/index.d.ts +1 -1
  163. package/types/index.js.map +1 -1
  164. package/types/native.d.ts +64 -64
  165. package/types/native.js.map +1 -1
  166. package/types/query-builder.d.ts +5 -5
  167. package/types/query-builder.js.map +1 -1
  168. package/types/smartblocks.d.ts +5 -5
  169. package/types/smartblocks.js.map +1 -1
  170. package/util/addInputSetting.d.ts +1 -1
  171. package/util/addInputSetting.js.map +1 -1
  172. package/util/apiDelete.d.ts +1 -1
  173. package/util/apiDelete.js.map +1 -1
  174. package/util/apiGet.d.ts +1 -1
  175. package/util/apiGet.js.map +1 -1
  176. package/util/apiPost.d.ts +1 -1
  177. package/util/apiPost.js.map +1 -1
  178. package/util/apiPut.d.ts +1 -1
  179. package/util/apiPut.js.map +1 -1
  180. package/util/createOverlayRender.js.map +1 -1
  181. package/util/createTagRegex.js.map +1 -1
  182. package/util/dispatchToRegistry.js.map +1 -1
  183. package/util/env.js.map +1 -1
  184. package/util/extensionApiContext.js.map +1 -1
  185. package/util/extensionDeprecatedWarning.js +5 -5
  186. package/util/extensionDeprecatedWarning.js.map +1 -1
  187. package/util/extractRef.js.map +1 -1
  188. package/util/extractTag.js.map +1 -1
  189. package/util/focusMainWindowBlock.js.map +1 -1
  190. package/util/getAuthorizationHeader.js.map +1 -1
  191. package/util/getLocalStorageKey.js.map +1 -1
  192. package/util/getOauth.js.map +1 -1
  193. package/util/getOauthAccounts.js.map +1 -1
  194. package/util/getRenderRoot.js.map +1 -1
  195. package/util/getSettingIntFromTree.d.ts +1 -1
  196. package/util/getSettingIntFromTree.js.map +1 -1
  197. package/util/getSettingValueFromTree.d.ts +3 -3
  198. package/util/getSettingValueFromTree.js.map +1 -1
  199. package/util/getSettingValuesFromTree.d.ts +1 -1
  200. package/util/getSettingValuesFromTree.js.map +1 -1
  201. package/util/getSubTree.d.ts +3 -3
  202. package/util/getSubTree.js.map +1 -1
  203. package/util/getToken.js.map +1 -1
  204. package/util/getTokenFromTree.js.map +1 -1
  205. package/util/getWorkerClient.d.ts +1 -1
  206. package/util/getWorkerClient.js.map +1 -1
  207. package/util/handleBodyFetch.d.ts +1 -1
  208. package/util/handleBodyFetch.js.map +1 -1
  209. package/util/handleFetch.d.ts +2 -2
  210. package/util/handleFetch.js.map +1 -1
  211. package/util/handleUrlFetch.d.ts +1 -1
  212. package/util/handleUrlFetch.js.map +1 -1
  213. package/util/idToTitle.js.map +1 -1
  214. package/util/index.js +25 -27
  215. package/util/index.js.map +1 -1
  216. package/util/isControl.js.map +1 -1
  217. package/util/localStorageGet.js.map +1 -1
  218. package/util/localStorageRemove.js.map +1 -1
  219. package/util/localStorageSet.js.map +1 -1
  220. package/util/registerExperimentalMode.d.ts +1 -1
  221. package/util/registerExperimentalMode.js +2 -2
  222. package/util/registerExperimentalMode.js.map +1 -1
  223. package/util/registerSmartBlocksCommand.js.map +1 -1
  224. package/util/removeFromRegistry.js.map +1 -1
  225. package/util/renderOverlay.d.ts +5 -5
  226. package/util/renderOverlay.js.map +1 -1
  227. package/util/renderWithUnmount.js.map +1 -1
  228. package/util/runExtension.d.ts +2 -2
  229. package/util/runExtension.js +2 -2
  230. package/util/runExtension.js.map +1 -1
  231. package/util/setInputSetting.d.ts +1 -1
  232. package/util/setInputSetting.js.map +1 -1
  233. package/util/setInputSettings.d.ts +1 -1
  234. package/util/setInputSettings.js.map +1 -1
  235. package/util/stripUid.js.map +1 -1
  236. package/util/toConfigPageName.js.map +1 -1
  237. package/util/toFlexRegex.js.map +1 -1
  238. package/writes/clearBlockById.js.map +1 -1
  239. package/writes/clearBlockByUid.js.map +1 -1
  240. package/writes/createBlock.d.ts +1 -1
  241. package/writes/createBlock.js.map +1 -1
  242. package/writes/createPage.d.ts +2 -2
  243. package/writes/createPage.js.map +1 -1
  244. package/writes/deleteBlock.js.map +1 -1
  245. package/writes/index.js +9 -11
  246. package/writes/index.js.map +1 -1
  247. package/writes/openBlockInSidebar.js.map +1 -1
  248. package/writes/submitActions.js.map +1 -1
  249. package/writes/updateActiveBlock.js.map +1 -1
  250. package/writes/updateBlock.js.map +1 -1
package/types/native.d.ts CHANGED
@@ -1,106 +1,106 @@
1
1
  import { ChangeEvent } from "react";
2
- export declare type DatalogSrcVar = {
2
+ export type DatalogSrcVar = {
3
3
  type: "src-var";
4
4
  value: string;
5
5
  };
6
- export declare type DatalogVariable = {
6
+ export type DatalogVariable = {
7
7
  type: "variable";
8
8
  value: string;
9
9
  };
10
- export declare type DatalogAndClause = {
10
+ export type DatalogAndClause = {
11
11
  type: "and-clause";
12
12
  clauses: DatalogClause[];
13
13
  };
14
- export declare type DatalogExpressionClause = DatalogDataPattern | DatalogPredExpr | DatalogFnExpr | DatalogRuleExpr;
15
- export declare type DatalogRuleExpr = {
14
+ export type DatalogExpressionClause = DatalogDataPattern | DatalogPredExpr | DatalogFnExpr | DatalogRuleExpr;
15
+ export type DatalogRuleExpr = {
16
16
  type: "rule-expr";
17
17
  srcVar?: DatalogSrcVar;
18
18
  ruleName: DatalogRuleName;
19
19
  arguments: DatalogArgument[];
20
20
  };
21
- export declare type DatalogNotClause = {
21
+ export type DatalogNotClause = {
22
22
  type: "not-clause";
23
23
  srcVar?: DatalogSrcVar;
24
24
  clauses: DatalogClause[];
25
25
  };
26
- export declare type DatalogNotJoinClause = {
26
+ export type DatalogNotJoinClause = {
27
27
  type: "not-join-clause";
28
28
  srcVar?: DatalogSrcVar;
29
29
  variables: DatalogVariable[];
30
30
  clauses: DatalogClause[];
31
31
  };
32
- export declare type DatalogOrClause = {
32
+ export type DatalogOrClause = {
33
33
  type: "or-clause";
34
34
  srcVar?: DatalogSrcVar;
35
35
  clauses: DatalogClause[];
36
36
  };
37
- export declare type DatalogOrJoinClause = {
37
+ export type DatalogOrJoinClause = {
38
38
  type: "or-join-clause";
39
39
  srcVar?: DatalogSrcVar;
40
40
  variables: DatalogVariable[];
41
41
  clauses: DatalogClause[];
42
42
  };
43
- export declare type DatalogClause = DatalogNotClause | DatalogOrJoinClause | DatalogExpressionClause | DatalogOrClause | DatalogNotJoinClause | DatalogAndClause;
44
- export declare type DatalogDataPattern = {
43
+ export type DatalogClause = DatalogNotClause | DatalogOrJoinClause | DatalogExpressionClause | DatalogOrClause | DatalogNotJoinClause | DatalogAndClause;
44
+ export type DatalogDataPattern = {
45
45
  type: "data-pattern";
46
46
  srcVar?: DatalogSrcVar;
47
47
  arguments: DatalogArgument[];
48
48
  };
49
- export declare type DatalogArgument = DatalogSrcVar | DatalogVariable | DatalogConstant | DatalogUnderscore;
50
- export declare type DatalogConstant = {
49
+ export type DatalogArgument = DatalogSrcVar | DatalogVariable | DatalogConstant | DatalogUnderscore;
50
+ export type DatalogConstant = {
51
51
  type: "constant";
52
52
  value: string;
53
53
  };
54
- export declare type DatalogPredExpr = {
54
+ export type DatalogPredExpr = {
55
55
  type: "pred-expr";
56
56
  pred: "<" | ">" | "re-matches" | "re-find" | "clojure.string/includes?" | "clojure.string/ends-with?" | "clojure.string/starts-with?";
57
57
  arguments: DatalogArgument[];
58
58
  };
59
- export declare type DatalogFnExpr = {
59
+ export type DatalogFnExpr = {
60
60
  type: "fn-expr";
61
61
  fn: "re-pattern" | "get";
62
62
  arguments: DatalogArgument[];
63
63
  binding: DatalogBinding;
64
64
  };
65
- export declare type DatalogBinding = DatalogBindScalar | DatalogBindTuple | DatalogBindColl | DatalogBindRel;
66
- export declare type DatalogBindScalar = {
65
+ export type DatalogBinding = DatalogBindScalar | DatalogBindTuple | DatalogBindColl | DatalogBindRel;
66
+ export type DatalogBindScalar = {
67
67
  type: "bind-scalar";
68
68
  variable: DatalogVariable;
69
69
  };
70
- export declare type DatalogBindTuple = {
70
+ export type DatalogBindTuple = {
71
71
  type: "bind-tuple";
72
72
  args: (DatalogVariable | DatalogUnderscore)[];
73
73
  };
74
- export declare type DatalogBindColl = {
74
+ export type DatalogBindColl = {
75
75
  type: "bind-col";
76
76
  variable: DatalogVariable;
77
77
  };
78
- export declare type DatalogBindRel = {
78
+ export type DatalogBindRel = {
79
79
  type: "bind-rel";
80
80
  args: (DatalogVariable | DatalogUnderscore)[];
81
81
  };
82
- export declare type DatalogUnderscore = {
82
+ export type DatalogUnderscore = {
83
83
  type: "underscore";
84
84
  value: "_";
85
85
  };
86
- export declare type DatalogRuleName = {
86
+ export type DatalogRuleName = {
87
87
  type: "rulename";
88
88
  value: string;
89
89
  };
90
- export declare type RoamBasicBlock = {
90
+ export type RoamBasicBlock = {
91
91
  string: string;
92
92
  uid: string;
93
93
  };
94
- export declare type RoamBasicPage = {
94
+ export type RoamBasicPage = {
95
95
  title: string;
96
96
  uid: string;
97
97
  };
98
- export declare type RoamBasicNode = {
98
+ export type RoamBasicNode = {
99
99
  text: string;
100
100
  uid: string;
101
101
  children: RoamBasicNode[];
102
102
  };
103
- export declare type RoamPull = {
103
+ export type RoamPull = {
104
104
  "block/children"?: RoamNode[];
105
105
  "block/heading"?: number;
106
106
  "block/open"?: boolean;
@@ -118,7 +118,7 @@ export declare type RoamPull = {
118
118
  "log/id"?: number;
119
119
  "node/title"?: string;
120
120
  } & RoamNode;
121
- export declare type PullBlock = {
121
+ export type PullBlock = {
122
122
  ":attrs/lookup"?: PullBlock[];
123
123
  ":entity/attrs"?: [
124
124
  {
@@ -196,11 +196,11 @@ export declare type PullBlock = {
196
196
  ":user/uid"?: string;
197
197
  ":user/email"?: string;
198
198
  };
199
- export declare type RoamPullResult = RoamPull | null;
200
- export declare type ViewType = "document" | "bullet" | "numbered";
201
- export declare type BlockViewType = "tabs" | "outline" | "horizontal" | "popout" | "comment" | "side" | "vertical";
202
- export declare type TextAlignment = "left" | "center" | "right" | "justify";
203
- export declare type RoamBlock = {
199
+ export type RoamPullResult = RoamPull | null;
200
+ export type ViewType = "document" | "bullet" | "numbered";
201
+ export type BlockViewType = "tabs" | "outline" | "horizontal" | "popout" | "comment" | "side" | "vertical";
202
+ export type TextAlignment = "left" | "center" | "right" | "justify";
203
+ export type RoamBlock = {
204
204
  attrs?: {
205
205
  source: string[];
206
206
  }[][];
@@ -215,11 +215,11 @@ export declare type RoamBlock = {
215
215
  order?: number;
216
216
  "view-type"?: ViewType;
217
217
  };
218
- export declare type RoamError = {
218
+ export type RoamError = {
219
219
  raw: string;
220
220
  "status-code": number;
221
221
  };
222
- export declare type TreeNode = {
222
+ export type TreeNode = {
223
223
  text: string;
224
224
  order: number;
225
225
  children: TreeNode[];
@@ -245,11 +245,11 @@ export declare type TreeNode = {
245
245
  };
246
246
  };
247
247
  };
248
- export declare type TextNode = {
248
+ export type TextNode = {
249
249
  text: string;
250
250
  children: TextNode[];
251
251
  };
252
- export declare type InputTextNode = {
252
+ export type InputTextNode = {
253
253
  text: string;
254
254
  children?: InputTextNode[];
255
255
  uid?: string;
@@ -259,11 +259,11 @@ export declare type InputTextNode = {
259
259
  open?: boolean;
260
260
  props?: Record<string, unknown>;
261
261
  };
262
- declare type PlusType = [number, string];
263
- export declare type RoamNode = {
262
+ type PlusType = [number, string];
263
+ export type RoamNode = {
264
264
  "db/id": number;
265
265
  };
266
- export declare type RoamQuery = RoamPull & {
266
+ export type RoamQuery = RoamPull & {
267
267
  "block/graph"?: RoamNode;
268
268
  "node/graph+title"?: PlusType;
269
269
  "block/graph+uid"?: PlusType;
@@ -271,15 +271,15 @@ export declare type RoamQuery = RoamPull & {
271
271
  "edit/email"?: string;
272
272
  "entity/graph"?: RoamNode;
273
273
  };
274
- export declare type RoamQueryResult = number & RoamQuery;
275
- export declare type ClientParams = {
274
+ export type RoamQueryResult = number & RoamQuery;
275
+ export type ClientParams = {
276
276
  action: "pull" | "q" | "create-block" | "update-block" | "create-page" | "move-block" | "delete-block" | "delete-page" | "update-page";
277
277
  selector?: string;
278
278
  uid?: string;
279
279
  query?: string;
280
280
  inputs?: string[];
281
281
  } & ActionParams;
282
- export declare type ActionParams = {
282
+ export type ActionParams = {
283
283
  location?: {
284
284
  "parent-uid": string;
285
285
  order: number | "last";
@@ -298,72 +298,72 @@ export declare type ActionParams = {
298
298
  uid?: string;
299
299
  };
300
300
  };
301
- export declare type WriteAction = (a: ActionParams) => Promise<void>;
302
- export declare type UserSettings = {
301
+ export type WriteAction = (a: ActionParams) => Promise<void>;
302
+ export type UserSettings = {
303
303
  "global-filters": {
304
304
  includes: string[];
305
305
  removes: string[];
306
306
  };
307
307
  };
308
- declare type SidebarWindowType = SidebarBlockWindow | SidebarMentionsWindow | SidebarGraphWindow | SidebarOutlineWindow | SidebarSearchQueryWindow;
309
- export declare type SidebarWindowInput = SidebarWindowType & {
308
+ type SidebarWindowType = SidebarBlockWindow | SidebarMentionsWindow | SidebarGraphWindow | SidebarOutlineWindow | SidebarSearchQueryWindow;
309
+ export type SidebarWindowInput = SidebarWindowType & {
310
310
  order?: number;
311
311
  };
312
- declare type SidebarBlockWindow = {
312
+ type SidebarBlockWindow = {
313
313
  type: "block";
314
314
  "block-uid": string;
315
315
  };
316
- declare type SidebarOutlineWindow = {
316
+ type SidebarOutlineWindow = {
317
317
  type: "outline";
318
318
  "page-uid": string;
319
319
  };
320
- declare type SidebarMentionsWindow = {
320
+ type SidebarMentionsWindow = {
321
321
  type: "mentions";
322
322
  "mentions-uid": string;
323
323
  };
324
- declare type SidebarGraphWindow = {
324
+ type SidebarGraphWindow = {
325
325
  type: "graph";
326
326
  "block-uid": string;
327
327
  };
328
- declare type SidebarSearchQueryWindow = {
328
+ type SidebarSearchQueryWindow = {
329
329
  type: "search-query";
330
330
  "search-query-uid": string;
331
331
  };
332
- export declare type SidebarAction = (action: {
332
+ export type SidebarAction = (action: {
333
333
  window: SidebarWindowInput;
334
334
  }) => Promise<void>;
335
- export declare type SidebarWindow = {
335
+ export type SidebarWindow = {
336
336
  "collapsed?": boolean;
337
337
  order: number;
338
338
  "pinned?": boolean;
339
339
  "window-id": string;
340
340
  } & SidebarWindowType;
341
- export declare type AddPullWatch = (pullPattern: string, entityId: string, callback: (before: PullBlock | null, after: PullBlock | null) => void) => boolean;
342
- declare type ButtonAction = {
341
+ export type AddPullWatch = (pullPattern: string, entityId: string, callback: (before: PullBlock | null, after: PullBlock | null) => void) => boolean;
342
+ type ButtonAction = {
343
343
  type: "button";
344
344
  onClick?: (e: MouseEvent) => void;
345
345
  content: string;
346
346
  };
347
- declare type SwitchAction = {
347
+ type SwitchAction = {
348
348
  type: "switch";
349
349
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
350
350
  };
351
- declare type InputAction = {
351
+ type InputAction = {
352
352
  type: "input";
353
353
  placeholder: string;
354
354
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
355
355
  };
356
- declare type SelectAction = {
356
+ type SelectAction = {
357
357
  type: "select";
358
358
  items: string[];
359
359
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
360
360
  };
361
- declare type CustomAction = {
361
+ type CustomAction = {
362
362
  type: "reactComponent";
363
363
  component: React.FC;
364
364
  };
365
- export declare type Action = ButtonAction | SwitchAction | InputAction | SelectAction | CustomAction;
366
- declare type PanelConfig = {
365
+ export type Action = ButtonAction | SwitchAction | InputAction | SelectAction | CustomAction;
366
+ type PanelConfig = {
367
367
  tabTitle: string;
368
368
  settings: {
369
369
  id: string;
@@ -372,16 +372,16 @@ declare type PanelConfig = {
372
372
  action: Action;
373
373
  }[];
374
374
  };
375
- export declare type AddCommandOptions = {
375
+ export type AddCommandOptions = {
376
376
  label: string;
377
377
  callback: () => void;
378
378
  disableHotkey?: boolean;
379
379
  defaultHotkey?: string | string[];
380
380
  };
381
- declare type RemoveCommandOptions = {
381
+ type RemoveCommandOptions = {
382
382
  label: string;
383
383
  };
384
- export declare type OnloadArgs = {
384
+ export type OnloadArgs = {
385
385
  extensionAPI: {
386
386
  settings: {
387
387
  get: (k: string) => unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/types/native.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,4EAA4E","sourcesContent":["// emulating Datalog Grammar\n// https://docs.datomic.com/cloud/query/query-data-reference.html#or-clauses\n\nimport { ChangeEvent } from \"react\";\n\nexport type DatalogSrcVar = {\n type: \"src-var\";\n value: string;\n};\n\nexport type DatalogVariable = {\n type: \"variable\";\n value: string;\n};\n\nexport type DatalogAndClause = {\n type: \"and-clause\";\n clauses: DatalogClause[];\n};\n\nexport type DatalogExpressionClause =\n | DatalogDataPattern\n | DatalogPredExpr\n | DatalogFnExpr\n | DatalogRuleExpr;\n\nexport type DatalogRuleExpr = {\n type: \"rule-expr\";\n srcVar?: DatalogSrcVar;\n ruleName: DatalogRuleName;\n arguments: DatalogArgument[];\n};\n\nexport type DatalogNotClause = {\n type: \"not-clause\";\n srcVar?: DatalogSrcVar;\n clauses: DatalogClause[];\n};\n\nexport type DatalogNotJoinClause = {\n type: \"not-join-clause\";\n srcVar?: DatalogSrcVar;\n variables: DatalogVariable[];\n clauses: DatalogClause[];\n};\n\nexport type DatalogOrClause = {\n type: \"or-clause\";\n srcVar?: DatalogSrcVar;\n clauses: DatalogClause[];\n};\n\nexport type DatalogOrJoinClause = {\n type: \"or-join-clause\";\n srcVar?: DatalogSrcVar;\n variables: DatalogVariable[];\n clauses: DatalogClause[];\n};\n\nexport type DatalogClause =\n | DatalogNotClause\n | DatalogOrJoinClause\n | DatalogExpressionClause\n | DatalogOrClause\n | DatalogNotJoinClause\n | DatalogAndClause;\n\nexport type DatalogDataPattern = {\n type: \"data-pattern\";\n srcVar?: DatalogSrcVar;\n arguments: DatalogArgument[];\n};\n\nexport type DatalogArgument =\n | DatalogSrcVar\n | DatalogVariable\n | DatalogConstant\n | DatalogUnderscore;\n\nexport type DatalogConstant = {\n type: \"constant\";\n value: string;\n};\n\nexport type DatalogPredExpr = {\n type: \"pred-expr\";\n pred:\n | \"<\"\n | \">\"\n | \"re-matches\"\n | \"re-find\"\n | \"clojure.string/includes?\"\n | \"clojure.string/ends-with?\"\n | \"clojure.string/starts-with?\";\n arguments: DatalogArgument[];\n};\n\nexport type DatalogFnExpr = {\n type: \"fn-expr\";\n fn: \"re-pattern\" | \"get\";\n arguments: DatalogArgument[];\n binding: DatalogBinding;\n};\n\nexport type DatalogBinding =\n | DatalogBindScalar\n | DatalogBindTuple\n | DatalogBindColl\n | DatalogBindRel;\n\nexport type DatalogBindScalar = {\n type: \"bind-scalar\";\n variable: DatalogVariable;\n};\nexport type DatalogBindTuple = {\n type: \"bind-tuple\";\n args: (DatalogVariable | DatalogUnderscore)[];\n};\nexport type DatalogBindColl = {\n type: \"bind-col\";\n variable: DatalogVariable;\n};\n\nexport type DatalogBindRel = {\n type: \"bind-rel\";\n args: (DatalogVariable | DatalogUnderscore)[];\n};\n\nexport type DatalogUnderscore = {\n type: \"underscore\";\n value: \"_\";\n};\n\nexport type DatalogRuleName = {\n type: \"rulename\";\n value: string;\n};\n\nexport type RoamBasicBlock = {\n string: string;\n uid: string;\n};\n\nexport type RoamBasicPage = { title: string; uid: string };\n\nexport type RoamBasicNode = {\n text: string;\n uid: string;\n children: RoamBasicNode[];\n};\n\nexport type RoamPull = {\n \"block/children\"?: RoamNode[];\n \"block/heading\"?: number;\n \"block/open\"?: boolean;\n \"block/order\"?: number;\n \"block/page\"?: RoamNode;\n \"block/parents\"?: RoamNode[];\n \"block/refs\"?: RoamNode[];\n \"block/string\"?: string;\n \"block/uid\"?: string;\n \"children/view-type\"?: `:${ViewType}`;\n \"create/time\"?: number;\n \"create/user\"?: RoamNode;\n \"edit/time\"?: number;\n \"edit/user\"?: RoamNode;\n \"log/id\"?: number;\n \"node/title\"?: string;\n} & RoamNode;\n\nexport type PullBlock = {\n \":attrs/lookup\"?: PullBlock[];\n \":entity/attrs\"?: [\n { \":source\": [\":block/uid\", string]; \":value\": [\":block/uid\", string] },\n { \":source\": [\":block/uid\", string]; \":value\": [\":block/uid\", string] },\n {\n \":source\": [\":block/uid\", string];\n \":value\": string | [\":block/uid\", string];\n }\n ][];\n \":block/children\"?: PullBlock[];\n \":block/heading\"?: number;\n \":block/open\"?: boolean;\n \":block/order\"?: number;\n \":block/page\"?: { \":db/id\": number };\n \":block/parents\"?: PullBlock[];\n \":block/props\"?: {\n \":image-size\"?: {\n [p: string]: {\n \":height\": number;\n \":width\": number;\n };\n };\n \":iframe\"?: {\n [p: string]: {\n \":size\": {\n \":height\": number;\n \":width\": number;\n };\n };\n };\n [k: `:roamjs-${string}`]: Record<string, unknown>;\n };\n \":block/refs\"?: { \":db/id\": number }[];\n \":block/string\"?: string;\n \":block/view-type\"?: `:${BlockViewType}`;\n \":block/text-align\"?: TextAlignment;\n \":block/uid\"?: string;\n \":children/view-type\"?: `:${ViewType}`;\n \":create/time\"?: number;\n \":create/user\"?: { \":db/id\": number };\n \":edit/time\"?: number;\n \":edit/user\"?: { \":db/id\": number };\n \":db/id\"?: number;\n \":log/id\"?: number;\n \":node/title\"?: string;\n \":user/display-name\"?: string;\n \":user/display-page\"?: { \":db/id\": number };\n \":user/settings\"?: {\n \":namespace-options\": [\":none\", \":partial\", \":full\"];\n \":link-brackets?\": boolean;\n \":showing-inline-references?\": boolean;\n \":right-sidebar-pinned\": {\n [uuid: string]: SidebarWindow;\n };\n \":showing-own-icons?\": boolean;\n \":showing-user-icons?\": boolean;\n \":first-day-of-week\"?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n };\n \":user/uid\"?: string;\n \":user/email\"?: string;\n};\n\nexport type RoamPullResult = RoamPull | null;\n\nexport type ViewType = \"document\" | \"bullet\" | \"numbered\";\n\nexport type BlockViewType =\n | \"tabs\"\n | \"outline\"\n | \"horizontal\"\n | \"popout\"\n | \"comment\"\n | \"side\"\n | \"vertical\";\n\nexport type TextAlignment = \"left\" | \"center\" | \"right\" | \"justify\";\n\nexport type RoamBlock = {\n attrs?: { source: string[] }[][];\n children?: { id: number }[];\n id?: number;\n string?: string;\n title?: string;\n time?: number;\n uid?: string;\n order?: number;\n \"view-type\"?: ViewType;\n};\n\nexport type RoamError = {\n raw: string;\n \"status-code\": number;\n};\n\nexport type TreeNode = {\n text: string;\n order: number;\n children: TreeNode[];\n parents: number[];\n uid: string;\n heading: number;\n open: boolean;\n viewType: ViewType;\n editTime: Date;\n textAlign: TextAlignment;\n props: {\n imageResize: {\n [link: string]: {\n height: number;\n width: number;\n };\n };\n iframe: {\n [link: string]: {\n height: number;\n width: number;\n };\n };\n };\n};\n\nexport type TextNode = {\n text: string;\n children: TextNode[];\n};\n\nexport type InputTextNode = {\n text: string;\n children?: InputTextNode[];\n uid?: string;\n heading?: number;\n textAlign?: TextAlignment;\n viewType?: ViewType;\n open?: boolean;\n props?: Record<string, unknown>;\n};\n\ntype PlusType = [number, string];\n\nexport type RoamNode = { \"db/id\": number };\n\nexport type RoamQuery = RoamPull & {\n \"block/graph\"?: RoamNode;\n \"node/graph+title\"?: PlusType;\n \"block/graph+uid\"?: PlusType;\n \"node/graph\"?: RoamNode;\n \"edit/email\"?: string;\n \"entity/graph\"?: RoamNode;\n};\n\nexport type RoamQueryResult = number & RoamQuery;\n\nexport type ClientParams = {\n action:\n | \"pull\"\n | \"q\"\n | \"create-block\"\n | \"update-block\"\n | \"create-page\"\n | \"move-block\"\n | \"delete-block\"\n | \"delete-page\"\n | \"update-page\";\n selector?: string;\n uid?: string;\n query?: string;\n inputs?: string[];\n} & ActionParams;\n\nexport type ActionParams = {\n location?: {\n \"parent-uid\": string;\n order: number | \"last\";\n };\n block?: {\n string?: string;\n uid?: string;\n open?: boolean;\n heading?: number;\n \"text-align\"?: TextAlignment;\n \"children-view-type\"?: ViewType;\n props?: Record<string, unknown>;\n };\n page?: {\n title?: string;\n uid?: string;\n };\n};\n\nexport type WriteAction = (a: ActionParams) => Promise<void>;\n\nexport type UserSettings = {\n \"global-filters\": {\n includes: string[];\n removes: string[];\n };\n};\n\ntype SidebarWindowType =\n | SidebarBlockWindow\n | SidebarMentionsWindow\n | SidebarGraphWindow\n | SidebarOutlineWindow\n | SidebarSearchQueryWindow;\n\nexport type SidebarWindowInput = SidebarWindowType & {\n order?: number;\n};\n\ntype SidebarBlockWindow = {\n type: \"block\";\n \"block-uid\": string;\n};\n\ntype SidebarOutlineWindow = {\n type: \"outline\";\n \"page-uid\": string;\n};\n\ntype SidebarMentionsWindow = {\n type: \"mentions\";\n \"mentions-uid\": string;\n};\n\ntype SidebarGraphWindow = {\n type: \"graph\";\n // \"page-uid\": string; Currently not working despite documentation\n \"block-uid\": string;\n};\n\ntype SidebarSearchQueryWindow = {\n type: \"search-query\";\n \"search-query-uid\": string;\n};\n\nexport type SidebarAction = (action: {\n window: SidebarWindowInput;\n}) => Promise<void>;\n\nexport type SidebarWindow = {\n \"collapsed?\": boolean;\n order: number;\n \"pinned?\": boolean;\n \"window-id\": string;\n} & SidebarWindowType;\n\nexport type AddPullWatch = (\n pullPattern: string,\n entityId: string,\n callback: (before: PullBlock | null, after: PullBlock | null) => void\n) => boolean;\n\ntype ButtonAction = {\n type: \"button\";\n onClick?: (e: MouseEvent) => void;\n content: string;\n};\n\ntype SwitchAction = {\n type: \"switch\";\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype InputAction = {\n type: \"input\";\n placeholder: string;\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype SelectAction = {\n type: \"select\";\n items: string[];\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype CustomAction = {\n type: \"reactComponent\";\n component: React.FC;\n};\n\nexport type Action =\n | ButtonAction\n | SwitchAction\n | InputAction\n | SelectAction\n | CustomAction;\n\ntype PanelConfig = {\n tabTitle: string;\n settings: {\n id: string;\n name: string;\n description: string;\n action: Action;\n }[];\n};\n\nexport type AddCommandOptions = {\n label: string;\n callback: () => void;\n disableHotkey?: boolean;\n defaultHotkey?: string | string[];\n};\n\ntype RemoveCommandOptions = {\n label: string;\n};\n\nexport type OnloadArgs = {\n extensionAPI: {\n settings: {\n get: (k: string) => unknown;\n getAll: () => Record<string, unknown>;\n panel: {\n create: (c: PanelConfig) => void;\n };\n set: (k: string, v: unknown) => Promise<void>;\n };\n ui: {\n commandPalette: {\n addCommand: (c: AddCommandOptions) => Promise<void>;\n removeCommand: (c: RemoveCommandOptions) => Promise<void>;\n };\n };\n };\n extension: {\n version: string;\n };\n};\n"]}
1
+ {"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/types/native.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,4EAA4E","sourcesContent":["// emulating Datalog Grammar\r\n// https://docs.datomic.com/cloud/query/query-data-reference.html#or-clauses\r\n\r\nimport { ChangeEvent } from \"react\";\r\n\r\nexport type DatalogSrcVar = {\r\n type: \"src-var\";\r\n value: string;\r\n};\r\n\r\nexport type DatalogVariable = {\r\n type: \"variable\";\r\n value: string;\r\n};\r\n\r\nexport type DatalogAndClause = {\r\n type: \"and-clause\";\r\n clauses: DatalogClause[];\r\n};\r\n\r\nexport type DatalogExpressionClause =\r\n | DatalogDataPattern\r\n | DatalogPredExpr\r\n | DatalogFnExpr\r\n | DatalogRuleExpr;\r\n\r\nexport type DatalogRuleExpr = {\r\n type: \"rule-expr\";\r\n srcVar?: DatalogSrcVar;\r\n ruleName: DatalogRuleName;\r\n arguments: DatalogArgument[];\r\n};\r\n\r\nexport type DatalogNotClause = {\r\n type: \"not-clause\";\r\n srcVar?: DatalogSrcVar;\r\n clauses: DatalogClause[];\r\n};\r\n\r\nexport type DatalogNotJoinClause = {\r\n type: \"not-join-clause\";\r\n srcVar?: DatalogSrcVar;\r\n variables: DatalogVariable[];\r\n clauses: DatalogClause[];\r\n};\r\n\r\nexport type DatalogOrClause = {\r\n type: \"or-clause\";\r\n srcVar?: DatalogSrcVar;\r\n clauses: DatalogClause[];\r\n};\r\n\r\nexport type DatalogOrJoinClause = {\r\n type: \"or-join-clause\";\r\n srcVar?: DatalogSrcVar;\r\n variables: DatalogVariable[];\r\n clauses: DatalogClause[];\r\n};\r\n\r\nexport type DatalogClause =\r\n | DatalogNotClause\r\n | DatalogOrJoinClause\r\n | DatalogExpressionClause\r\n | DatalogOrClause\r\n | DatalogNotJoinClause\r\n | DatalogAndClause;\r\n\r\nexport type DatalogDataPattern = {\r\n type: \"data-pattern\";\r\n srcVar?: DatalogSrcVar;\r\n arguments: DatalogArgument[];\r\n};\r\n\r\nexport type DatalogArgument =\r\n | DatalogSrcVar\r\n | DatalogVariable\r\n | DatalogConstant\r\n | DatalogUnderscore;\r\n\r\nexport type DatalogConstant = {\r\n type: \"constant\";\r\n value: string;\r\n};\r\n\r\nexport type DatalogPredExpr = {\r\n type: \"pred-expr\";\r\n pred:\r\n | \"<\"\r\n | \">\"\r\n | \"re-matches\"\r\n | \"re-find\"\r\n | \"clojure.string/includes?\"\r\n | \"clojure.string/ends-with?\"\r\n | \"clojure.string/starts-with?\";\r\n arguments: DatalogArgument[];\r\n};\r\n\r\nexport type DatalogFnExpr = {\r\n type: \"fn-expr\";\r\n fn: \"re-pattern\" | \"get\";\r\n arguments: DatalogArgument[];\r\n binding: DatalogBinding;\r\n};\r\n\r\nexport type DatalogBinding =\r\n | DatalogBindScalar\r\n | DatalogBindTuple\r\n | DatalogBindColl\r\n | DatalogBindRel;\r\n\r\nexport type DatalogBindScalar = {\r\n type: \"bind-scalar\";\r\n variable: DatalogVariable;\r\n};\r\nexport type DatalogBindTuple = {\r\n type: \"bind-tuple\";\r\n args: (DatalogVariable | DatalogUnderscore)[];\r\n};\r\nexport type DatalogBindColl = {\r\n type: \"bind-col\";\r\n variable: DatalogVariable;\r\n};\r\n\r\nexport type DatalogBindRel = {\r\n type: \"bind-rel\";\r\n args: (DatalogVariable | DatalogUnderscore)[];\r\n};\r\n\r\nexport type DatalogUnderscore = {\r\n type: \"underscore\";\r\n value: \"_\";\r\n};\r\n\r\nexport type DatalogRuleName = {\r\n type: \"rulename\";\r\n value: string;\r\n};\r\n\r\nexport type RoamBasicBlock = {\r\n string: string;\r\n uid: string;\r\n};\r\n\r\nexport type RoamBasicPage = { title: string; uid: string };\r\n\r\nexport type RoamBasicNode = {\r\n text: string;\r\n uid: string;\r\n children: RoamBasicNode[];\r\n};\r\n\r\nexport type RoamPull = {\r\n \"block/children\"?: RoamNode[];\r\n \"block/heading\"?: number;\r\n \"block/open\"?: boolean;\r\n \"block/order\"?: number;\r\n \"block/page\"?: RoamNode;\r\n \"block/parents\"?: RoamNode[];\r\n \"block/refs\"?: RoamNode[];\r\n \"block/string\"?: string;\r\n \"block/uid\"?: string;\r\n \"children/view-type\"?: `:${ViewType}`;\r\n \"create/time\"?: number;\r\n \"create/user\"?: RoamNode;\r\n \"edit/time\"?: number;\r\n \"edit/user\"?: RoamNode;\r\n \"log/id\"?: number;\r\n \"node/title\"?: string;\r\n} & RoamNode;\r\n\r\nexport type PullBlock = {\r\n \":attrs/lookup\"?: PullBlock[];\r\n \":entity/attrs\"?: [\r\n { \":source\": [\":block/uid\", string]; \":value\": [\":block/uid\", string] },\r\n { \":source\": [\":block/uid\", string]; \":value\": [\":block/uid\", string] },\r\n {\r\n \":source\": [\":block/uid\", string];\r\n \":value\": string | [\":block/uid\", string];\r\n }\r\n ][];\r\n \":block/children\"?: PullBlock[];\r\n \":block/heading\"?: number;\r\n \":block/open\"?: boolean;\r\n \":block/order\"?: number;\r\n \":block/page\"?: { \":db/id\": number };\r\n \":block/parents\"?: PullBlock[];\r\n \":block/props\"?: {\r\n \":image-size\"?: {\r\n [p: string]: {\r\n \":height\": number;\r\n \":width\": number;\r\n };\r\n };\r\n \":iframe\"?: {\r\n [p: string]: {\r\n \":size\": {\r\n \":height\": number;\r\n \":width\": number;\r\n };\r\n };\r\n };\r\n [k: `:roamjs-${string}`]: Record<string, unknown>;\r\n };\r\n \":block/refs\"?: { \":db/id\": number }[];\r\n \":block/string\"?: string;\r\n \":block/view-type\"?: `:${BlockViewType}`;\r\n \":block/text-align\"?: TextAlignment;\r\n \":block/uid\"?: string;\r\n \":children/view-type\"?: `:${ViewType}`;\r\n \":create/time\"?: number;\r\n \":create/user\"?: { \":db/id\": number };\r\n \":edit/time\"?: number;\r\n \":edit/user\"?: { \":db/id\": number };\r\n \":db/id\"?: number;\r\n \":log/id\"?: number;\r\n \":node/title\"?: string;\r\n \":user/display-name\"?: string;\r\n \":user/display-page\"?: { \":db/id\": number };\r\n \":user/settings\"?: {\r\n \":namespace-options\": [\":none\", \":partial\", \":full\"];\r\n \":link-brackets?\": boolean;\r\n \":showing-inline-references?\": boolean;\r\n \":right-sidebar-pinned\": {\r\n [uuid: string]: SidebarWindow;\r\n };\r\n \":showing-own-icons?\": boolean;\r\n \":showing-user-icons?\": boolean;\r\n \":first-day-of-week\"?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\r\n };\r\n \":user/uid\"?: string;\r\n \":user/email\"?: string;\r\n};\r\n\r\nexport type RoamPullResult = RoamPull | null;\r\n\r\nexport type ViewType = \"document\" | \"bullet\" | \"numbered\";\r\n\r\nexport type BlockViewType =\r\n | \"tabs\"\r\n | \"outline\"\r\n | \"horizontal\"\r\n | \"popout\"\r\n | \"comment\"\r\n | \"side\"\r\n | \"vertical\";\r\n\r\nexport type TextAlignment = \"left\" | \"center\" | \"right\" | \"justify\";\r\n\r\nexport type RoamBlock = {\r\n attrs?: { source: string[] }[][];\r\n children?: { id: number }[];\r\n id?: number;\r\n string?: string;\r\n title?: string;\r\n time?: number;\r\n uid?: string;\r\n order?: number;\r\n \"view-type\"?: ViewType;\r\n};\r\n\r\nexport type RoamError = {\r\n raw: string;\r\n \"status-code\": number;\r\n};\r\n\r\nexport type TreeNode = {\r\n text: string;\r\n order: number;\r\n children: TreeNode[];\r\n parents: number[];\r\n uid: string;\r\n heading: number;\r\n open: boolean;\r\n viewType: ViewType;\r\n editTime: Date;\r\n textAlign: TextAlignment;\r\n props: {\r\n imageResize: {\r\n [link: string]: {\r\n height: number;\r\n width: number;\r\n };\r\n };\r\n iframe: {\r\n [link: string]: {\r\n height: number;\r\n width: number;\r\n };\r\n };\r\n };\r\n};\r\n\r\nexport type TextNode = {\r\n text: string;\r\n children: TextNode[];\r\n};\r\n\r\nexport type InputTextNode = {\r\n text: string;\r\n children?: InputTextNode[];\r\n uid?: string;\r\n heading?: number;\r\n textAlign?: TextAlignment;\r\n viewType?: ViewType;\r\n open?: boolean;\r\n props?: Record<string, unknown>;\r\n};\r\n\r\ntype PlusType = [number, string];\r\n\r\nexport type RoamNode = { \"db/id\": number };\r\n\r\nexport type RoamQuery = RoamPull & {\r\n \"block/graph\"?: RoamNode;\r\n \"node/graph+title\"?: PlusType;\r\n \"block/graph+uid\"?: PlusType;\r\n \"node/graph\"?: RoamNode;\r\n \"edit/email\"?: string;\r\n \"entity/graph\"?: RoamNode;\r\n};\r\n\r\nexport type RoamQueryResult = number & RoamQuery;\r\n\r\nexport type ClientParams = {\r\n action:\r\n | \"pull\"\r\n | \"q\"\r\n | \"create-block\"\r\n | \"update-block\"\r\n | \"create-page\"\r\n | \"move-block\"\r\n | \"delete-block\"\r\n | \"delete-page\"\r\n | \"update-page\";\r\n selector?: string;\r\n uid?: string;\r\n query?: string;\r\n inputs?: string[];\r\n} & ActionParams;\r\n\r\nexport type ActionParams = {\r\n location?: {\r\n \"parent-uid\": string;\r\n order: number | \"last\";\r\n };\r\n block?: {\r\n string?: string;\r\n uid?: string;\r\n open?: boolean;\r\n heading?: number;\r\n \"text-align\"?: TextAlignment;\r\n \"children-view-type\"?: ViewType;\r\n props?: Record<string, unknown>;\r\n };\r\n page?: {\r\n title?: string;\r\n uid?: string;\r\n };\r\n};\r\n\r\nexport type WriteAction = (a: ActionParams) => Promise<void>;\r\n\r\nexport type UserSettings = {\r\n \"global-filters\": {\r\n includes: string[];\r\n removes: string[];\r\n };\r\n};\r\n\r\ntype SidebarWindowType =\r\n | SidebarBlockWindow\r\n | SidebarMentionsWindow\r\n | SidebarGraphWindow\r\n | SidebarOutlineWindow\r\n | SidebarSearchQueryWindow;\r\n\r\nexport type SidebarWindowInput = SidebarWindowType & {\r\n order?: number;\r\n};\r\n\r\ntype SidebarBlockWindow = {\r\n type: \"block\";\r\n \"block-uid\": string;\r\n};\r\n\r\ntype SidebarOutlineWindow = {\r\n type: \"outline\";\r\n \"page-uid\": string;\r\n};\r\n\r\ntype SidebarMentionsWindow = {\r\n type: \"mentions\";\r\n \"mentions-uid\": string;\r\n};\r\n\r\ntype SidebarGraphWindow = {\r\n type: \"graph\";\r\n // \"page-uid\": string; Currently not working despite documentation\r\n \"block-uid\": string;\r\n};\r\n\r\ntype SidebarSearchQueryWindow = {\r\n type: \"search-query\";\r\n \"search-query-uid\": string;\r\n};\r\n\r\nexport type SidebarAction = (action: {\r\n window: SidebarWindowInput;\r\n}) => Promise<void>;\r\n\r\nexport type SidebarWindow = {\r\n \"collapsed?\": boolean;\r\n order: number;\r\n \"pinned?\": boolean;\r\n \"window-id\": string;\r\n} & SidebarWindowType;\r\n\r\nexport type AddPullWatch = (\r\n pullPattern: string,\r\n entityId: string,\r\n callback: (before: PullBlock | null, after: PullBlock | null) => void\r\n) => boolean;\r\n\r\ntype ButtonAction = {\r\n type: \"button\";\r\n onClick?: (e: MouseEvent) => void;\r\n content: string;\r\n};\r\n\r\ntype SwitchAction = {\r\n type: \"switch\";\r\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\r\n};\r\n\r\ntype InputAction = {\r\n type: \"input\";\r\n placeholder: string;\r\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\r\n};\r\n\r\ntype SelectAction = {\r\n type: \"select\";\r\n items: string[];\r\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\r\n};\r\n\r\ntype CustomAction = {\r\n type: \"reactComponent\";\r\n component: React.FC;\r\n};\r\n\r\nexport type Action =\r\n | ButtonAction\r\n | SwitchAction\r\n | InputAction\r\n | SelectAction\r\n | CustomAction;\r\n\r\ntype PanelConfig = {\r\n tabTitle: string;\r\n settings: {\r\n id: string;\r\n name: string;\r\n description: string;\r\n action: Action;\r\n }[];\r\n};\r\n\r\nexport type AddCommandOptions = {\r\n label: string;\r\n callback: () => void;\r\n disableHotkey?: boolean;\r\n defaultHotkey?: string | string[];\r\n};\r\n\r\ntype RemoveCommandOptions = {\r\n label: string;\r\n};\r\n\r\nexport type OnloadArgs = {\r\n extensionAPI: {\r\n settings: {\r\n get: (k: string) => unknown;\r\n getAll: () => Record<string, unknown>;\r\n panel: {\r\n create: (c: PanelConfig) => void;\r\n };\r\n set: (k: string, v: unknown) => Promise<void>;\r\n };\r\n ui: {\r\n commandPalette: {\r\n addCommand: (c: AddCommandOptions) => Promise<void>;\r\n removeCommand: (c: RemoveCommandOptions) => Promise<void>;\r\n };\r\n };\r\n };\r\n extension: {\r\n version: string;\r\n };\r\n};\r\n"]}
@@ -1,10 +1,10 @@
1
- export declare type Result = {
1
+ export type Result = {
2
2
  text: string;
3
3
  uid: string;
4
4
  } & Record<`${string}-uid`, string> & Record<string, string | number | Date>;
5
- export declare type RunQuery = (parentUid: string) => Promise<Result[]>;
6
- export declare type RunQuerySync = (parentUid: string) => Result[];
7
- export declare type ListActiveQueries = () => {
5
+ export type RunQuery = (parentUid: string) => Promise<Result[]>;
6
+ export type RunQuerySync = (parentUid: string) => Result[];
7
+ export type ListActiveQueries = () => {
8
8
  uid: string;
9
9
  }[];
10
- export declare type IsDiscourseNode = (uid: string) => boolean;
10
+ export type IsDiscourseNode = (uid: string) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"query-builder.js","sourceRoot":"","sources":["../../src/types/query-builder.ts"],"names":[],"mappings":"","sourcesContent":["export type Result = { text: string; uid: string } & Record<\n `${string}-uid`,\n string\n> &\n Record<string, string | number | Date>;\n\nexport type RunQuery = (parentUid: string) => Promise<Result[]>;\nexport type RunQuerySync = (parentUid: string) => Result[];\nexport type ListActiveQueries = () => { uid: string }[];\nexport type IsDiscourseNode = (uid: string) => boolean;\n"]}
1
+ {"version":3,"file":"query-builder.js","sourceRoot":"","sources":["../../src/types/query-builder.ts"],"names":[],"mappings":"","sourcesContent":["export type Result = { text: string; uid: string } & Record<\r\n `${string}-uid`,\r\n string\r\n> &\r\n Record<string, string | number | Date>;\r\n\r\nexport type RunQuery = (parentUid: string) => Promise<Result[]>;\r\nexport type RunQuerySync = (parentUid: string) => Result[];\r\nexport type ListActiveQueries = () => { uid: string }[];\r\nexport type IsDiscourseNode = (uid: string) => boolean;\r\n"]}
@@ -1,7 +1,7 @@
1
1
  import { InputTextNode } from "./native";
2
- declare type CommandOutput = string | string[] | InputTextNode[];
3
- export declare type CommandHandler = (...args: string[]) => CommandOutput | Promise<CommandOutput>;
4
- export declare type SmartBlocksContext = {
2
+ type CommandOutput = string | string[] | InputTextNode[];
3
+ export type CommandHandler = (...args: string[]) => CommandOutput | Promise<CommandOutput>;
4
+ export type SmartBlocksContext = {
5
5
  onBlockExit: CommandHandler;
6
6
  targetUid: string;
7
7
  triggerUid: string;
@@ -22,7 +22,7 @@ export declare type SmartBlocksContext = {
22
22
  refMapping: Record<string, string>;
23
23
  afterWorkflowMethods: (() => void | Promise<void>)[];
24
24
  };
25
- export declare type RegisterCommand = (args: {
25
+ export type RegisterCommand = (args: {
26
26
  text: string;
27
27
  help?: string;
28
28
  handler: (c: Pick<SmartBlocksContext, "targetUid" | "variables"> & {
@@ -31,5 +31,5 @@ export declare type RegisterCommand = (args: {
31
31
  }) => CommandHandler;
32
32
  delayArgs?: true;
33
33
  }) => () => void;
34
- export declare type UnregisterCommand = (t: string) => void;
34
+ export type UnregisterCommand = (t: string) => void;
35
35
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"smartblocks.js","sourceRoot":"","sources":["../../src/types/smartblocks.ts"],"names":[],"mappings":"","sourcesContent":["import { InputTextNode } from \"./native\";\n\ntype CommandOutput = string | string[] | InputTextNode[];\nexport type CommandHandler = (\n ...args: string[]\n) => CommandOutput | Promise<CommandOutput>;\n\nexport type SmartBlocksContext = {\n onBlockExit: CommandHandler;\n targetUid: string;\n triggerUid: string;\n ifCommand?: boolean;\n exitBlock: \"yes\" | \"no\" | \"end\" | \"empty\" | \"childless\";\n exitWorkflow: boolean;\n variables: Record<string, string>;\n cursorPosition?: { uid: string; selection: number };\n currentUid?: string;\n currentContent: string;\n indent: Set<string>;\n unindent: Set<string>;\n focusOnBlock?: string;\n dateBasisMethod?: string;\n refMapping: Record<string, string>;\n afterWorkflowMethods: (() => void | Promise<void>)[];\n};\n\nexport type RegisterCommand = (args: {\n text: string;\n help?: string;\n handler: (\n c: Pick<SmartBlocksContext, \"targetUid\" | \"variables\"> & {\n proccessBlockText: (s: string) => Promise<InputTextNode[]>;\n processBlock: (s: InputTextNode) => Promise<InputTextNode[]>;\n }\n ) => CommandHandler;\n delayArgs?: true;\n}) => () => void;\n\nexport type UnregisterCommand = (t: string) => void;\n"]}
1
+ {"version":3,"file":"smartblocks.js","sourceRoot":"","sources":["../../src/types/smartblocks.ts"],"names":[],"mappings":"","sourcesContent":["import { InputTextNode } from \"./native\";\r\n\r\ntype CommandOutput = string | string[] | InputTextNode[];\r\nexport type CommandHandler = (\r\n ...args: string[]\r\n) => CommandOutput | Promise<CommandOutput>;\r\n\r\nexport type SmartBlocksContext = {\r\n onBlockExit: CommandHandler;\r\n targetUid: string;\r\n triggerUid: string;\r\n ifCommand?: boolean;\r\n exitBlock: \"yes\" | \"no\" | \"end\" | \"empty\" | \"childless\";\r\n exitWorkflow: boolean;\r\n variables: Record<string, string>;\r\n cursorPosition?: { uid: string; selection: number };\r\n currentUid?: string;\r\n currentContent: string;\r\n indent: Set<string>;\r\n unindent: Set<string>;\r\n focusOnBlock?: string;\r\n dateBasisMethod?: string;\r\n refMapping: Record<string, string>;\r\n afterWorkflowMethods: (() => void | Promise<void>)[];\r\n};\r\n\r\nexport type RegisterCommand = (args: {\r\n text: string;\r\n help?: string;\r\n handler: (\r\n c: Pick<SmartBlocksContext, \"targetUid\" | \"variables\"> & {\r\n proccessBlockText: (s: string) => Promise<InputTextNode[]>;\r\n processBlock: (s: InputTextNode) => Promise<InputTextNode[]>;\r\n }\r\n ) => CommandHandler;\r\n delayArgs?: true;\r\n}) => () => void;\r\n\r\nexport type UnregisterCommand = (t: string) => void;\r\n"]}
@@ -2,6 +2,6 @@ declare const addInputSetting: ({ blockUid, value, key, index, }: {
2
2
  blockUid: string;
3
3
  value: string;
4
4
  key: string;
5
- index?: number | undefined;
5
+ index?: number;
6
6
  }) => Promise<string>;
7
7
  export default addInputSetting;
@@ -1 +1 @@
1
- {"version":3,"file":"addInputSetting.js","sourceRoot":"","sources":["../../src/util/addInputSetting.ts"],"names":[],"mappings":";;;AAAA,yGAAyE;AACzE,gFAAgD;AAChD,wEAAwC;AAExC,MAAM,eAAe,GAAG,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,GAAG,EACH,KAAK,GAAG,CAAC,GAMV,EAAmB,EAAE;IACpB,MAAM,IAAI,GAAG,IAAA,iCAAuB,EAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAW,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,IAAI,OAAO,EAAE;QACX,OAAO,IAAA,qBAAW,EAAC;YACjB,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YACrB,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM;YAC9B,SAAS,EAAE,OAAO,CAAC,GAAG;SACvB,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,IAAA,qBAAW,EAAC;YACjB,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;SACjD,CAAC,CAAC;KACJ;AACH,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import getBasicTreeByParentUid from \"../queries/getBasicTreeByParentUid\";\nimport createBlock from \"../writes/createBlock\";\nimport toFlexRegex from \"./toFlexRegex\";\n\nconst addInputSetting = ({\n blockUid,\n value,\n key,\n index = 0,\n}: {\n blockUid: string;\n value: string;\n key: string;\n index?: number;\n}): Promise<string> => {\n const tree = getBasicTreeByParentUid(blockUid);\n const keyNode = tree.find((t) => toFlexRegex(key).test(t.text));\n if (keyNode) {\n return createBlock({\n node: { text: value },\n order: keyNode.children.length,\n parentUid: keyNode.uid,\n });\n } else {\n return createBlock({\n parentUid: blockUid,\n order: index,\n node: { text: key, children: [{ text: value }] },\n });\n }\n};\n\nexport default addInputSetting;\n"]}
1
+ {"version":3,"file":"addInputSetting.js","sourceRoot":"","sources":["../../src/util/addInputSetting.ts"],"names":[],"mappings":";;;AAAA,yGAAyE;AACzE,gFAAgD;AAChD,wEAAwC;AAExC,MAAM,eAAe,GAAG,CAAC,EACvB,QAAQ,EACR,KAAK,EACL,GAAG,EACH,KAAK,GAAG,CAAC,GAMV,EAAmB,EAAE;IACpB,MAAM,IAAI,GAAG,IAAA,iCAAuB,EAAC,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAW,EAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAChE,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,IAAA,qBAAW,EAAC;YACjB,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YACrB,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM;YAC9B,SAAS,EAAE,OAAO,CAAC,GAAG;SACvB,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,OAAO,IAAA,qBAAW,EAAC;YACjB,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE;SACjD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import getBasicTreeByParentUid from \"../queries/getBasicTreeByParentUid\";\r\nimport createBlock from \"../writes/createBlock\";\r\nimport toFlexRegex from \"./toFlexRegex\";\r\n\r\nconst addInputSetting = ({\r\n blockUid,\r\n value,\r\n key,\r\n index = 0,\r\n}: {\r\n blockUid: string;\r\n value: string;\r\n key: string;\r\n index?: number;\r\n}): Promise<string> => {\r\n const tree = getBasicTreeByParentUid(blockUid);\r\n const keyNode = tree.find((t) => toFlexRegex(key).test(t.text));\r\n if (keyNode) {\r\n return createBlock({\r\n node: { text: value },\r\n order: keyNode.children.length,\r\n parentUid: keyNode.uid,\r\n });\r\n } else {\r\n return createBlock({\r\n parentUid: blockUid,\r\n order: index,\r\n node: { text: key, children: [{ text: value }] },\r\n });\r\n }\r\n};\r\n\r\nexport default addInputSetting;\r\n"]}
@@ -1,2 +1,2 @@
1
- declare const apiDelete: <T extends ArrayBuffer | Record<string, unknown> = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown> | undefined) => Promise<T>;
1
+ declare const apiDelete: <T extends Record<string, unknown> | ArrayBuffer = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown>) => Promise<T>;
2
2
  export default apiDelete;
@@ -1 +1 @@
1
- {"version":3,"file":"apiDelete.js","sourceRoot":"","sources":["../../src/util/apiDelete.ts"],"names":[],"mappings":";;;AAAA,8EAA8C;AAE9C,MAAM,SAAS,GAAG,IAAA,wBAAc,EAAC,QAAQ,CAAC,CAAC;AAE3C,kBAAe,SAAS,CAAC","sourcesContent":["import handleUrlFetch from \"./handleUrlFetch\";\n\nconst apiDelete = handleUrlFetch(\"DELETE\");\n\nexport default apiDelete;\n"]}
1
+ {"version":3,"file":"apiDelete.js","sourceRoot":"","sources":["../../src/util/apiDelete.ts"],"names":[],"mappings":";;;AAAA,8EAA8C;AAE9C,MAAM,SAAS,GAAG,IAAA,wBAAc,EAAC,QAAQ,CAAC,CAAC;AAE3C,kBAAe,SAAS,CAAC","sourcesContent":["import handleUrlFetch from \"./handleUrlFetch\";\r\n\r\nconst apiDelete = handleUrlFetch(\"DELETE\");\r\n\r\nexport default apiDelete;\r\n"]}
package/util/apiGet.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const apiGet: <T extends ArrayBuffer | Record<string, unknown> = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown> | undefined) => Promise<T>;
1
+ declare const apiGet: <T extends Record<string, unknown> | ArrayBuffer = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown>) => Promise<T>;
2
2
  export default apiGet;
@@ -1 +1 @@
1
- {"version":3,"file":"apiGet.js","sourceRoot":"","sources":["../../src/util/apiGet.ts"],"names":[],"mappings":";;;AAAA,8EAA8C;AAE9C,MAAM,MAAM,GAAG,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAC;AAErC,kBAAe,MAAM,CAAC","sourcesContent":["import handleUrlFetch from \"./handleUrlFetch\";\n\nconst apiGet = handleUrlFetch(\"GET\");\n\nexport default apiGet;\n"]}
1
+ {"version":3,"file":"apiGet.js","sourceRoot":"","sources":["../../src/util/apiGet.ts"],"names":[],"mappings":";;;AAAA,8EAA8C;AAE9C,MAAM,MAAM,GAAG,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAC;AAErC,kBAAe,MAAM,CAAC","sourcesContent":["import handleUrlFetch from \"./handleUrlFetch\";\r\n\r\nconst apiGet = handleUrlFetch(\"GET\");\r\n\r\nexport default apiGet;\r\n"]}
package/util/apiPost.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const apiPost: <T extends ArrayBuffer | Record<string, unknown> = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown> | undefined) => Promise<T>;
1
+ declare const apiPost: <T extends Record<string, unknown> | ArrayBuffer = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown>) => Promise<T>;
2
2
  export default apiPost;
@@ -1 +1 @@
1
- {"version":3,"file":"apiPost.js","sourceRoot":"","sources":["../../src/util/apiPost.ts"],"names":[],"mappings":";;;AAAA,gFAAgD;AAEhD,MAAM,OAAO,GAAG,IAAA,yBAAe,EAAC,MAAM,CAAC,CAAC;AAExC,kBAAe,OAAO,CAAC","sourcesContent":["import handleBodyFetch from \"./handleBodyFetch\";\n\nconst apiPost = handleBodyFetch(\"POST\");\n\nexport default apiPost;\n"]}
1
+ {"version":3,"file":"apiPost.js","sourceRoot":"","sources":["../../src/util/apiPost.ts"],"names":[],"mappings":";;;AAAA,gFAAgD;AAEhD,MAAM,OAAO,GAAG,IAAA,yBAAe,EAAC,MAAM,CAAC,CAAC;AAExC,kBAAe,OAAO,CAAC","sourcesContent":["import handleBodyFetch from \"./handleBodyFetch\";\r\n\r\nconst apiPost = handleBodyFetch(\"POST\");\r\n\r\nexport default apiPost;\r\n"]}
package/util/apiPut.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const apiPut: <T extends ArrayBuffer | Record<string, unknown> = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown> | undefined) => Promise<T>;
1
+ declare const apiPut: <T extends Record<string, unknown> | ArrayBuffer = Record<string, never>>(args: string | import("./handleFetch").HandleFetchArgs, _data?: Record<string, unknown>) => Promise<T>;
2
2
  export default apiPut;
@@ -1 +1 @@
1
- {"version":3,"file":"apiPut.js","sourceRoot":"","sources":["../../src/util/apiPut.ts"],"names":[],"mappings":";;;AAAA,gFAAgD;AAEhD,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAA;AAErC,kBAAe,MAAM,CAAC","sourcesContent":["import handleBodyFetch from \"./handleBodyFetch\";\n\nconst apiPut = handleBodyFetch(\"PUT\")\n\nexport default apiPut;\n"]}
1
+ {"version":3,"file":"apiPut.js","sourceRoot":"","sources":["../../src/util/apiPut.ts"],"names":[],"mappings":";;;AAAA,gFAAgD;AAEhD,MAAM,MAAM,GAAG,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAA;AAErC,kBAAe,MAAM,CAAC","sourcesContent":["import handleBodyFetch from \"./handleBodyFetch\";\r\n\r\nconst apiPut = handleBodyFetch(\"PUT\")\r\n\r\nexport default apiPut;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createOverlayRender.js","sourceRoot":"","sources":["../../src/util/createOverlayRender.ts"],"names":[],"mappings":";;;AACA,4EAAkE;AAElE,MAAM,mBAAmB,GACvB,CACE,EAAU,EACV,OAA2D,EAC3D,EAAE,CACJ,CAAC,KAAQ,EAAE,EAAE,CACX,IAAA,uBAAa,EAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAE7C,kBAAe,mBAAmB,CAAC","sourcesContent":["import React from \"react\";\nimport renderOverlay, { RoamOverlayProps } from \"./renderOverlay\";\n\nconst createOverlayRender =\n <T extends Record<string, unknown>>(\n id: string,\n Overlay: (props: RoamOverlayProps<T>) => React.ReactElement\n ) =>\n (props: T) =>\n renderOverlay<T>({ id, Overlay, props });\n\nexport default createOverlayRender;\n"]}
1
+ {"version":3,"file":"createOverlayRender.js","sourceRoot":"","sources":["../../src/util/createOverlayRender.ts"],"names":[],"mappings":";;;AACA,4EAAkE;AAElE,MAAM,mBAAmB,GACvB,CACE,EAAU,EACV,OAA2D,EAC3D,EAAE,CACJ,CAAC,KAAQ,EAAE,EAAE,CACX,IAAA,uBAAa,EAAI,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAE7C,kBAAe,mBAAmB,CAAC","sourcesContent":["import React from \"react\";\r\nimport renderOverlay, { RoamOverlayProps } from \"./renderOverlay\";\r\n\r\nconst createOverlayRender =\r\n <T extends Record<string, unknown>>(\r\n id: string,\r\n Overlay: (props: RoamOverlayProps<T>) => React.ReactElement\r\n ) =>\r\n (props: T) =>\r\n renderOverlay<T>({ id, Overlay, props });\r\n\r\nexport default createOverlayRender;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"createTagRegex.js","sourceRoot":"","sources":["../../src/util/createTagRegex.ts"],"names":[],"mappings":";;AAAA,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAClE,OAAO,IAAI,MAAM,CACf,aAAa,YAAY,WAAW,YAAY,iBAAiB,YAAY,SAAS,CACvF,CAAC;AACJ,CAAC,CAAC;AACF,kBAAe,cAAc,CAAC","sourcesContent":["const createTagRegex = (title: string): RegExp => {\n const escapedTitle = title.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n return new RegExp(\n `(?:#\\\\[\\\\[${escapedTitle}\\\\]\\\\]|#${escapedTitle}(?!\\\\w)|\\\\[\\\\[${escapedTitle}\\\\]\\\\])`\n );\n};\nexport default createTagRegex;\n"]}
1
+ {"version":3,"file":"createTagRegex.js","sourceRoot":"","sources":["../../src/util/createTagRegex.ts"],"names":[],"mappings":";;AAAA,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC/C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAClE,OAAO,IAAI,MAAM,CACf,aAAa,YAAY,WAAW,YAAY,iBAAiB,YAAY,SAAS,CACvF,CAAC;AACJ,CAAC,CAAC;AACF,kBAAe,cAAc,CAAC","sourcesContent":["const createTagRegex = (title: string): RegExp => {\r\n const escapedTitle = title.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n return new RegExp(\r\n `(?:#\\\\[\\\\[${escapedTitle}\\\\]\\\\]|#${escapedTitle}(?!\\\\w)|\\\\[\\\\[${escapedTitle}\\\\]\\\\])`\r\n );\r\n};\r\nexport default createTagRegex;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dispatchToRegistry.js","sourceRoot":"","sources":["../../src/util/dispatchToRegistry.ts"],"names":[],"mappings":";;AACA,+BAAgD;AAEhD,MAAM,kBAAkB,GAAG,CAAC,MAAyB,EAAE,EAAE,CACvD,QAAQ,CAAC,IAAI,CAAC,aAAa,CACzB,IAAI,WAAW,CAAC,UAAU,IAAA,6BAAuB,GAAE,WAAW,EAAE;IAC9D,MAAM;CACP,CAAC,CACH,CAAC;AAEJ,kBAAe,kBAAkB,CAAC","sourcesContent":["import { Registry } from \"../types\";\nimport { getRoamJSExtensionIdEnv } from \"./env\";\n\nconst dispatchToRegistry = (detail: Partial<Registry>) =>\n document.body.dispatchEvent(\n new CustomEvent(`roamjs:${getRoamJSExtensionIdEnv()}:register`, {\n detail,\n })\n );\n\nexport default dispatchToRegistry;\n"]}
1
+ {"version":3,"file":"dispatchToRegistry.js","sourceRoot":"","sources":["../../src/util/dispatchToRegistry.ts"],"names":[],"mappings":";;AACA,+BAAgD;AAEhD,MAAM,kBAAkB,GAAG,CAAC,MAAyB,EAAE,EAAE,CACvD,QAAQ,CAAC,IAAI,CAAC,aAAa,CACzB,IAAI,WAAW,CAAC,UAAU,IAAA,6BAAuB,GAAE,WAAW,EAAE;IAC9D,MAAM;CACP,CAAC,CACH,CAAC;AAEJ,kBAAe,kBAAkB,CAAC","sourcesContent":["import { Registry } from \"../types\";\r\nimport { getRoamJSExtensionIdEnv } from \"./env\";\r\n\r\nconst dispatchToRegistry = (detail: Partial<Registry>) =>\r\n document.body.dispatchEvent(\r\n new CustomEvent(`roamjs:${getRoamJSExtensionIdEnv()}:register`, {\r\n detail,\r\n })\r\n );\r\n\r\nexport default dispatchToRegistry;\r\n"]}
package/util/env.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/util/env.ts"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,yFAAyF;AACzF,oCAAoC;;;AAEpC,wFAAwF;AACxF,0BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,YAAY,GAAG,YAAY,EAAE,EAAE;IACxD,IAAI;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;KAC7C;IAAC,WAAM;QACN,OAAO,YAAY,CAAC;KACrB;AACH,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEK,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,IAAI;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAA,kBAAU,EAAC,EAAE,CAAC,CAAC;KAC5E;IAAC,WAAM;QACN,OAAO,IAAA,kBAAU,EAAC,EAAE,CAAC,CAAC;KACvB;AACH,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,YAAY,GAChB,IAAA,kBAAU,GAAE,KAAK,YAAY;QAC3B,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,uBAAuB,CAAC;IAC9B,IAAI;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,YAAY,CAAC;KAC5C;IAAC,WAAM;QACN,OAAO,YAAY,CAAC;KACrB;AACH,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB;AAEK,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,IAAI;QACF,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,QAAQ,CACrC,CAAC;KACH;IAAC,WAAM;QACN,OAAO,QAAQ,CAAC;KACjB;AACH,CAAC,CAAC;AARW,QAAA,uBAAuB,2BAQlC","sourcesContent":["// Some developers may use roamjs-components without RoamJS scripting, in which case\n// envs wont be interpolated. best way to deal with that afaik is to try to get the value\n// catch defaulting to a known value\n\n// Cannot do a DRY approach either because bundlers need the full `process.env.VAR` text\n// outlined to be replaced\n\nexport const getNodeEnv = (defaultValue = \"production\") => {\n try {\n return process.env.NODE_ENV || defaultValue;\n } catch {\n return defaultValue;\n }\n};\n\nexport const getRoamJSVersionEnv = () => {\n try {\n return process.env.ROAMJS_VERSION || process.env.VERSION || getNodeEnv(\"\");\n } catch {\n return getNodeEnv(\"\");\n }\n};\n\nexport const getApiUrlEnv = () => {\n const defaultValue =\n getNodeEnv() === \"production\"\n ? \"https://lambda.roamjs.com\"\n : \"http://localhost:3003\";\n try {\n return process.env.API_URL || defaultValue;\n } catch {\n return defaultValue;\n }\n};\n\nexport const getRoamJSExtensionIdEnv = () => {\n try {\n return (\n process.env.PACKAGE_NAME || \"roamjs\"\n );\n } catch {\n return \"roamjs\";\n }\n};\n"]}
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/util/env.ts"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,yFAAyF;AACzF,oCAAoC;;;AAEpC,wFAAwF;AACxF,0BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,YAAY,GAAG,YAAY,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;IAC9C,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEK,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAA,kBAAU,EAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAA,kBAAU,EAAC,EAAE,CAAC,CAAC;IACxB,CAAC;AACH,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,YAAY,GAChB,IAAA,kBAAU,GAAE,KAAK,YAAY;QAC3B,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,uBAAuB,CAAC;IAC9B,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,YAAY,CAAC;IAC7C,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB;AAEK,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,IAAI,CAAC;QACH,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,QAAQ,CACrC,CAAC;IACJ,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AARW,QAAA,uBAAuB,2BAQlC","sourcesContent":["// Some developers may use roamjs-components without RoamJS scripting, in which case\r\n// envs wont be interpolated. best way to deal with that afaik is to try to get the value\r\n// catch defaulting to a known value\r\n\r\n// Cannot do a DRY approach either because bundlers need the full `process.env.VAR` text\r\n// outlined to be replaced\r\n\r\nexport const getNodeEnv = (defaultValue = \"production\") => {\r\n try {\r\n return process.env.NODE_ENV || defaultValue;\r\n } catch {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nexport const getRoamJSVersionEnv = () => {\r\n try {\r\n return process.env.ROAMJS_VERSION || process.env.VERSION || getNodeEnv(\"\");\r\n } catch {\r\n return getNodeEnv(\"\");\r\n }\r\n};\r\n\r\nexport const getApiUrlEnv = () => {\r\n const defaultValue =\r\n getNodeEnv() === \"production\"\r\n ? \"https://lambda.roamjs.com\"\r\n : \"http://localhost:3003\";\r\n try {\r\n return process.env.API_URL || defaultValue;\r\n } catch {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nexport const getRoamJSExtensionIdEnv = () => {\r\n try {\r\n return (\r\n process.env.PACKAGE_NAME || \"roamjs\"\r\n );\r\n } catch {\r\n return \"roamjs\";\r\n }\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extensionApiContext.js","sourceRoot":"","sources":["../../src/util/extensionApiContext.ts"],"names":[],"mappings":";;;AAEA,IAAI,YAAY,GAAsC,IAAI,CAAC;AAEpD,MAAM,mBAAmB,GAAG,CAAC,GAA+B,EAAE,EAAE;IACrE,IAAI,YAAY,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;KACnD;IACD,YAAY,GAAG,GAAG,CAAC;AACrB,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,YAAY;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACjE,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import { OnloadArgs } from \"../types\";\n\nlet extensionApi: OnloadArgs[\"extensionAPI\"] | null = null;\n\nexport const provideExtensionApi = (api: OnloadArgs[\"extensionAPI\"]) => {\n if (extensionApi) {\n throw new Error(\"Extension API already provided\");\n }\n extensionApi = api;\n};\n\nconst getExtensionApi = () => {\n if (!extensionApi) throw new Error(\"Extension API not provided\");\n return extensionApi;\n};\n\nexport default getExtensionApi;\n"]}
1
+ {"version":3,"file":"extensionApiContext.js","sourceRoot":"","sources":["../../src/util/extensionApiContext.ts"],"names":[],"mappings":";;;AAEA,IAAI,YAAY,GAAsC,IAAI,CAAC;AAEpD,MAAM,mBAAmB,GAAG,CAAC,GAA+B,EAAE,EAAE;IACrE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,YAAY,GAAG,GAAG,CAAC;AACrB,CAAC,CAAC;AALW,QAAA,mBAAmB,uBAK9B;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,CAAC,YAAY;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACjE,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC","sourcesContent":["import { OnloadArgs } from \"../types\";\r\n\r\nlet extensionApi: OnloadArgs[\"extensionAPI\"] | null = null;\r\n\r\nexport const provideExtensionApi = (api: OnloadArgs[\"extensionAPI\"]) => {\r\n if (extensionApi) {\r\n throw new Error(\"Extension API already provided\");\r\n }\r\n extensionApi = api;\r\n};\r\n\r\nconst getExtensionApi = () => {\r\n if (!extensionApi) throw new Error(\"Extension API not provided\");\r\n return extensionApi;\r\n};\r\n\r\nexport default getExtensionApi;\r\n"]}
@@ -9,7 +9,7 @@ const Toast_1 = require("../components/Toast");
9
9
  const getBasicTreeByParentUid_1 = tslib_1.__importDefault(require("../queries/getBasicTreeByParentUid"));
10
10
  const getPageUidByPageTitle_1 = tslib_1.__importDefault(require("../queries/getPageUidByPageTitle"));
11
11
  const getSubTree_1 = tslib_1.__importDefault(require("./getSubTree"));
12
- const extensionDeprecatedWarning = ({ extensionId, reason, }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
12
+ const extensionDeprecatedWarning = (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ extensionId, reason, }) {
13
13
  const configUid = (0, getPageUidByPageTitle_1.default)(extensionId);
14
14
  const config = (0, getBasicTreeByParentUid_1.default)(configUid);
15
15
  const donotShowAgainUid = (0, getSubTree_1.default)({
@@ -19,10 +19,10 @@ const extensionDeprecatedWarning = ({ extensionId, reason, }) => tslib_1.__await
19
19
  if (!donotShowAgainUid) {
20
20
  const blocks = window.roamAlphaAPI.data.fast.q(`[:find (pull ?roamjs [:block/uid]) :where [?block :block/string ?contents] [(clojure.string/includes? ?contents "https://roamjs.com/${extensionId}")] [?roamjs :block/children ?block]]`).map(([block]) => block[":block/uid"] || "");
21
21
  (0, SimpleAlert_1.render)({
22
- content: `RoamJS will soon be deprecating and then removing the ${(0, idToTitle_1.default)(extensionId)} extension.
23
-
24
- ${reason}
25
-
22
+ content: `RoamJS will soon be deprecating and then removing the ${(0, idToTitle_1.default)(extensionId)} extension.
23
+
24
+ ${reason}
25
+
26
26
  If you no longer use this extension, feel free to uninstall it${blocks.length
27
27
  ? ` by removing the block from [here](${(0, getRoamUrl_1.default)(blocks[0])}) or by clicking confirm`
28
28
  : ""}. If this will be an issue for any reason, please reach out to support@roamjs.com.`,
@@ -1 +1 @@
1
- {"version":3,"file":"extensionDeprecatedWarning.js","sourceRoot":"","sources":["../../src/util/extensionDeprecatedWarning.ts"],"names":[],"mappings":";;;AAAA,oEAAoC;AACpC,2DAAwE;AACxE,2EAA2C;AAC3C,gFAAgD;AAChD,+CAA4D;AAC5D,yGAAyE;AACzE,qGAAqE;AACrE,sEAAsC;AAGtC,MAAM,0BAA0B,GAAG,CAAO,EACxC,WAAW,EACX,MAAM,GAIP,EAAiB,EAAE;IAClB,MAAM,SAAS,GAAG,IAAA,+BAAqB,EAAC,WAAW,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAA,iCAAuB,EAAC,SAAS,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAA,oBAAU,EAAC;QACnC,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,mBAAmB;KACzB,CAAC,CAAC,GAAG,CAAC;IACP,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,MAAM,GACV,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAC7B,wIAAwI,WAAW,uCAAuC,CAE7L,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9C,IAAA,oBAAiB,EAAC;YAChB,OAAO,EAAE,yDAAyD,IAAA,mBAAS,EACzE,WAAW,CACZ;;EAEL,MAAM;;gEAGA,MAAM,CAAC,MAAM;gBACX,CAAC,CAAC,sCAAsC,IAAA,oBAAU,EAC9C,MAAM,CAAC,CAAC,CAAC,CACV,0BAA0B;gBAC7B,CAAC,CAAC,EACN,oFAAoF;YACpF,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAW,EAAC,CAAC,CAAC,CAAC;YAClD,QAAQ,EAAE,GAAG,EAAE,CACb,IAAA,cAAW,EAAC;gBACV,OAAO,EACL,yEAAyE;gBAC3E,EAAE,EAAE,cAAc,WAAW,EAAE;aAChC,CAAC;YACJ,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;SACzB,CAAC,CAAC;KACJ;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,0BAA0B,CAAC","sourcesContent":["import idToTitle from \"./idToTitle\";\nimport { render as renderSimpleAlert } from \"../components/SimpleAlert\";\nimport getRoamUrl from \"../dom/getRoamUrl\";\nimport deleteBlock from \"../writes/deleteBlock\";\nimport { render as renderToast } from \"../components/Toast\";\nimport getBasicTreeByParentUid from \"../queries/getBasicTreeByParentUid\";\nimport getPageUidByPageTitle from \"../queries/getPageUidByPageTitle\";\nimport getSubTree from \"./getSubTree\";\nimport { PullBlock } from \"../types\";\n\nconst extensionDeprecatedWarning = async ({\n extensionId,\n reason,\n}: {\n extensionId: string;\n reason: string;\n}): Promise<void> => {\n const configUid = getPageUidByPageTitle(extensionId);\n const config = getBasicTreeByParentUid(configUid);\n const donotShowAgainUid = getSubTree({\n tree: config,\n key: \"Do not show again\",\n }).uid;\n if (!donotShowAgainUid) {\n const blocks = (\n window.roamAlphaAPI.data.fast.q(\n `[:find (pull ?roamjs [:block/uid]) :where [?block :block/string ?contents] [(clojure.string/includes? ?contents \"https://roamjs.com/${extensionId}\")] [?roamjs :block/children ?block]]`\n ) as [PullBlock][]\n ).map(([block]) => block[\":block/uid\"] || \"\");\n renderSimpleAlert({\n content: `RoamJS will soon be deprecating and then removing the ${idToTitle(\n extensionId\n )} extension.\n\n${reason}\n\nIf you no longer use this extension, feel free to uninstall it${\n blocks.length\n ? ` by removing the block from [here](${getRoamUrl(\n blocks[0]\n )}) or by clicking confirm`\n : \"\"\n }. If this will be an issue for any reason, please reach out to support@roamjs.com.`,\n onConfirm: () => blocks.map((b) => deleteBlock(b)),\n onCancel: () =>\n renderToast({\n content:\n \"Reach out to supprt@roamjs.com if you would like to keep the extension.\",\n id: `deprecated-${extensionId}`,\n }),\n confirmText: \"Confirm\",\n dontShowAgain: configUid,\n });\n }\n};\n\nexport default extensionDeprecatedWarning;\n"]}
1
+ {"version":3,"file":"extensionDeprecatedWarning.js","sourceRoot":"","sources":["../../src/util/extensionDeprecatedWarning.ts"],"names":[],"mappings":";;;AAAA,oEAAoC;AACpC,2DAAwE;AACxE,2EAA2C;AAC3C,gFAAgD;AAChD,+CAA4D;AAC5D,yGAAyE;AACzE,qGAAqE;AACrE,sEAAsC;AAGtC,MAAM,0BAA0B,GAAG,KAMjB,EAAE,oDANsB,EACxC,WAAW,EACX,MAAM,GAIP;IACC,MAAM,SAAS,GAAG,IAAA,+BAAqB,EAAC,WAAW,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,IAAA,iCAAuB,EAAC,SAAS,CAAC,CAAC;IAClD,MAAM,iBAAiB,GAAG,IAAA,oBAAU,EAAC;QACnC,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,mBAAmB;KACzB,CAAC,CAAC,GAAG,CAAC;IACP,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,MAAM,GACV,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAC7B,wIAAwI,WAAW,uCAAuC,CAE7L,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9C,IAAA,oBAAiB,EAAC;YAChB,OAAO,EAAE,yDAAyD,IAAA,mBAAS,EACzE,WAAW,CACZ;;EAEL,MAAM;;gEAGA,MAAM,CAAC,MAAM;gBACX,CAAC,CAAC,sCAAsC,IAAA,oBAAU,EAC9C,MAAM,CAAC,CAAC,CAAC,CACV,0BAA0B;gBAC7B,CAAC,CAAC,EACN,oFAAoF;YACpF,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAW,EAAC,CAAC,CAAC,CAAC;YAClD,QAAQ,EAAE,GAAG,EAAE,CACb,IAAA,cAAW,EAAC;gBACV,OAAO,EACL,yEAAyE;gBAC3E,EAAE,EAAE,cAAc,WAAW,EAAE;aAChC,CAAC;YACJ,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,SAAS;SACzB,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,0BAA0B,CAAC","sourcesContent":["import idToTitle from \"./idToTitle\";\r\nimport { render as renderSimpleAlert } from \"../components/SimpleAlert\";\r\nimport getRoamUrl from \"../dom/getRoamUrl\";\r\nimport deleteBlock from \"../writes/deleteBlock\";\r\nimport { render as renderToast } from \"../components/Toast\";\r\nimport getBasicTreeByParentUid from \"../queries/getBasicTreeByParentUid\";\r\nimport getPageUidByPageTitle from \"../queries/getPageUidByPageTitle\";\r\nimport getSubTree from \"./getSubTree\";\r\nimport { PullBlock } from \"../types\";\r\n\r\nconst extensionDeprecatedWarning = async ({\r\n extensionId,\r\n reason,\r\n}: {\r\n extensionId: string;\r\n reason: string;\r\n}): Promise<void> => {\r\n const configUid = getPageUidByPageTitle(extensionId);\r\n const config = getBasicTreeByParentUid(configUid);\r\n const donotShowAgainUid = getSubTree({\r\n tree: config,\r\n key: \"Do not show again\",\r\n }).uid;\r\n if (!donotShowAgainUid) {\r\n const blocks = (\r\n window.roamAlphaAPI.data.fast.q(\r\n `[:find (pull ?roamjs [:block/uid]) :where [?block :block/string ?contents] [(clojure.string/includes? ?contents \"https://roamjs.com/${extensionId}\")] [?roamjs :block/children ?block]]`\r\n ) as [PullBlock][]\r\n ).map(([block]) => block[\":block/uid\"] || \"\");\r\n renderSimpleAlert({\r\n content: `RoamJS will soon be deprecating and then removing the ${idToTitle(\r\n extensionId\r\n )} extension.\r\n\r\n${reason}\r\n\r\nIf you no longer use this extension, feel free to uninstall it${\r\n blocks.length\r\n ? ` by removing the block from [here](${getRoamUrl(\r\n blocks[0]\r\n )}) or by clicking confirm`\r\n : \"\"\r\n }. If this will be an issue for any reason, please reach out to support@roamjs.com.`,\r\n onConfirm: () => blocks.map((b) => deleteBlock(b)),\r\n onCancel: () =>\r\n renderToast({\r\n content:\r\n \"Reach out to supprt@roamjs.com if you would like to keep the extension.\",\r\n id: `deprecated-${extensionId}`,\r\n }),\r\n confirmText: \"Confirm\",\r\n dontShowAgain: configUid,\r\n });\r\n }\r\n};\r\n\r\nexport default extensionDeprecatedWarning;\r\n"]}