roamjs-components 0.66.13 → 0.67.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.
- package/README.md +2 -30
- package/backend/emailCatch.js +15 -5
- package/backend/emailCatch.js.map +1 -1
- package/components/AutocompleteInput.d.ts +10 -7
- package/components/AutocompleteInput.js +5 -4
- package/components/AutocompleteInput.js.map +1 -1
- package/components/ConfigPanels/BlocksPanel.js +11 -3
- package/components/ConfigPanels/BlocksPanel.js.map +1 -1
- package/components/PageInput.d.ts +3 -7
- package/components/PageInput.js +5 -63
- package/components/PageInput.js.map +1 -1
- package/components/index.d.ts +0 -16
- package/components/index.js +3 -57
- package/components/index.js.map +1 -1
- package/hooks/useArrowKeyDown.d.ts +1 -1
- package/hooks/useArrowKeyDown.js.map +1 -1
- package/package.json +10 -3
- package/queries/compileDatalog.d.ts +1 -1
- package/queries/compileDatalog.js +26 -14
- package/queries/compileDatalog.js.map +1 -1
- package/queries/index.d.ts +0 -46
- package/queries/index.js +3 -97
- package/queries/index.js.map +1 -1
- package/types/index.d.ts +6 -25
- package/types/query-builder.d.ts +24 -1
- package/util/runExtension.js +6 -5
- package/util/runExtension.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
# roamjs-components
|
|
2
2
|
|
|
3
|
-
This is a collection of common UI components used by RoamJS extensions
|
|
3
|
+
This is a collection of common UI components used by RoamJS extensions made available to make development easier for other Roam developers.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This package takes a modular approach - each function exposed in its own file in an effort to limit the bundle sizes of consumers. It has the following directories:
|
|
8
|
-
- `components` - React components used in Roam
|
|
9
|
-
- `date` - Utilities made to make interacting with Roam dates easier
|
|
10
|
-
- `dom` - Utilities that interact with Roam's DOM structure
|
|
11
|
-
- `events` - Utilities that interact with Roam's event system
|
|
12
|
-
- `hooks` - React hooks commonly used in Roam extensions
|
|
13
|
-
- `marked` - RoamJS' official Roam-flavored markdown to HTML processor
|
|
14
|
-
- `queries` - Helpers that abstract datalog into common, easy-to-invoke, typed queries
|
|
15
|
-
- `types` - Common typescript types used when interacting with these methods
|
|
16
|
-
- `util` - All other utilities not found in the other directories
|
|
17
|
-
- `writes` - Helpers that abstract Roam's write API into common, easy-to-invoke, typed actions
|
|
18
|
-
|
|
19
|
-
We recommend using modular imports for using any methods found in these libraries. For example,
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
import getTextByBlockUid from "roam-client/queries/getTextByBlockUid";
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
instead of
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import { getTextByBlockUid } from "roam-client/queries";
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
though, the latter is still available for convenience.
|
|
32
|
-
|
|
33
|
-
The rest of this README is not exhaustive, and will soon live in https://roamjs.com/extensions/developer.
|
|
5
|
+
All documentation lives on https://roamjs.com/extensions/developer.
|
|
34
6
|
|
|
35
7
|
## Util
|
|
36
8
|
|
package/backend/emailCatch.js
CHANGED
|
@@ -3,10 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const emailError_1 = tslib_1.__importDefault(require("./emailError"));
|
|
5
5
|
const headers_1 = tslib_1.__importDefault(require("./headers"));
|
|
6
|
-
const emailCatch = (subject) => (e) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const emailCatch = (subject) => (e) => {
|
|
7
|
+
const errorCode = Number(e.name);
|
|
8
|
+
if (errorCode >= 400 && errorCode < 500) {
|
|
9
|
+
return Promise.resolve({
|
|
10
|
+
statusCode: errorCode,
|
|
11
|
+
body: e.message,
|
|
12
|
+
headers: headers_1.default,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return (0, emailError_1.default)(subject, e).then((id) => ({
|
|
16
|
+
statusCode: 500,
|
|
17
|
+
body: `Unknown error - Message Id ${id}`,
|
|
18
|
+
headers: headers_1.default,
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
11
21
|
exports.default = emailCatch;
|
|
12
22
|
//# sourceMappingURL=emailCatch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emailCatch.js","sourceRoot":"","sources":["../src/backend/emailCatch.ts"],"names":[],"mappings":";;;AACA,sEAAsC;AACtC,gEAAgC;AAEhC,MAAM,UAAU,GACd,CAAC,OAAe,EAAE,EAAE,CACpB,CAAC,CAAQ,EAAkC,EAAE,
|
|
1
|
+
{"version":3,"file":"emailCatch.js","sourceRoot":"","sources":["../src/backend/emailCatch.ts"],"names":[],"mappings":";;;AACA,sEAAsC;AACtC,gEAAgC;AAEhC,MAAM,UAAU,GACd,CAAC,OAAe,EAAE,EAAE,CACpB,CAAC,CAAQ,EAAkC,EAAE;IAC3C,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,SAAS,IAAI,GAAG,IAAI,SAAS,GAAG,GAAG,EAAE;QACvC,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,UAAU,EAAE,SAAS;YACrB,IAAI,EAAE,CAAC,CAAC,OAAO;YACf,OAAO,EAAP,iBAAO;SACR,CAAC,CAAC;KACJ;IACD,OAAO,IAAA,oBAAU,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1C,UAAU,EAAE,GAAG;QACf,IAAI,EAAE,8BAA8B,EAAE,EAAE;QACxC,OAAO,EAAP,iBAAO;KACR,CAAC,CAAC,CAAC;AACN,CAAC,CAAC;AAEJ,kBAAe,UAAU,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare
|
|
2
|
+
export declare type AutocompleteInputProps = {
|
|
3
3
|
value: string;
|
|
4
4
|
setValue: (q: string) => void;
|
|
5
|
-
showButton?: boolean
|
|
6
|
-
onBlur?: (
|
|
7
|
-
onConfirm?: (
|
|
8
|
-
options?: string[]
|
|
9
|
-
placeholder?: string
|
|
10
|
-
|
|
5
|
+
showButton?: boolean;
|
|
6
|
+
onBlur?: (v: string) => void;
|
|
7
|
+
onConfirm?: () => void;
|
|
8
|
+
options?: string[];
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
autoFocus?: boolean;
|
|
11
|
+
multiline?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const AutocompleteInput: ({ value, setValue, onBlur, onConfirm, showButton, options, placeholder, autoFocus, multiline, }: AutocompleteInputProps) => React.ReactElement;
|
|
11
14
|
export default AutocompleteInput;
|
|
@@ -5,7 +5,7 @@ const core_1 = require("@blueprintjs/core");
|
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const useArrowKeyDown_1 = tslib_1.__importDefault(require("../hooks/useArrowKeyDown"));
|
|
7
7
|
const fuzzy_1 = tslib_1.__importDefault(require("fuzzy"));
|
|
8
|
-
const AutocompleteInput = ({ value, setValue, onBlur, onConfirm, showButton, options = [], placeholder = "Enter value", }) => {
|
|
8
|
+
const AutocompleteInput = ({ value, setValue, onBlur, onConfirm, showButton, options = [], placeholder = "Enter value", autoFocus, multiline, }) => {
|
|
9
9
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
10
10
|
const open = (0, react_1.useCallback)(() => setIsOpen(true), [setIsOpen]);
|
|
11
11
|
const close = (0, react_1.useCallback)(() => setIsOpen(false), [setIsOpen]);
|
|
@@ -15,7 +15,7 @@ const AutocompleteInput = ({ value, setValue, onBlur, onConfirm, showButton, opt
|
|
|
15
15
|
.filter(value, options)
|
|
16
16
|
.slice(0, 9)
|
|
17
17
|
.map((e) => e.string)
|
|
18
|
-
: options, [value, options]);
|
|
18
|
+
: options.slice(0, 9), [value, options]);
|
|
19
19
|
const menuRef = (0, react_1.useRef)(null);
|
|
20
20
|
const inputRef = (0, react_1.useRef)(null);
|
|
21
21
|
const onEnter = (0, react_1.useCallback)((value) => {
|
|
@@ -41,6 +41,7 @@ const AutocompleteInput = ({ value, setValue, onBlur, onConfirm, showButton, opt
|
|
|
41
41
|
else
|
|
42
42
|
open();
|
|
43
43
|
}, [items, close, open, isTyping]);
|
|
44
|
+
const Input = (0, react_1.useMemo)(() => (multiline ? core_1.TextArea : core_1.InputGroup), [multiline]);
|
|
44
45
|
return (react_1.default.createElement(core_1.Popover, { portalClassName: "roamjs-autocomplete-input", targetClassName: "roamjs-autocomplete-input-target", captureDismiss: true, isOpen: isOpen, onOpened: open, minimal: true, autoFocus: false, enforceFocus: false, position: core_1.PopoverPosition.BOTTOM_LEFT, modifiers: {
|
|
45
46
|
flip: { enabled: false },
|
|
46
47
|
preventOverflow: { enabled: false },
|
|
@@ -49,10 +50,10 @@ const AutocompleteInput = ({ value, setValue, onBlur, onConfirm, showButton, opt
|
|
|
49
50
|
setIsTyping(false);
|
|
50
51
|
setValue(t);
|
|
51
52
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
52
|
-
} })))), target: react_1.default.createElement(
|
|
53
|
+
} })))), target: react_1.default.createElement(Input, Object.assign({ value: value || "", onChange: (e) => {
|
|
53
54
|
setIsTyping(true);
|
|
54
55
|
setValue(e.target.value);
|
|
55
|
-
},
|
|
56
|
+
}, autoFocus: autoFocus, placeholder: placeholder, onKeyDown: (e) => {
|
|
56
57
|
if (e.key === "Escape") {
|
|
57
58
|
e.stopPropagation();
|
|
58
59
|
close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteInput.js","sourceRoot":"","sources":["../src/components/AutocompleteInput.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"AutocompleteInput.js","sourceRoot":"","sources":["../src/components/AutocompleteInput.tsx"],"names":[],"mappings":";;;AAAA,4CAQ2B;AAC3B,uDAMe;AACf,uFAAuD;AACvD,0DAA0B;AAc1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U;YACb,CAAC,CAAC;gBACE,YAAY,EAAE,8BAAC,aAAM,IAAC,IAAI,EAAE,KAAK,EAAE,OAAO,QAAC,OAAO,EAAE,OAAO,GAAI;aAChE;YACH,CAAC,CAAC,EAAE,CAAC,EACP,GAEJ,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,iBAAiB,CAAC"}
|
|
@@ -9,12 +9,16 @@ const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"
|
|
|
9
9
|
const Description_1 = tslib_1.__importDefault(require("../Description"));
|
|
10
10
|
const BlocksPanel = ({ uid: initialUid, parentUid, title, defaultValue, description, }) => {
|
|
11
11
|
const containerRef = (0, react_1.useRef)(null);
|
|
12
|
+
const [navUid, setNavUid] = (0, react_1.useState)(initialUid || parentUid);
|
|
12
13
|
(0, react_1.useEffect)(() => {
|
|
13
14
|
if (containerRef.current) {
|
|
14
15
|
const el = containerRef.current;
|
|
15
16
|
(initialUid
|
|
16
17
|
? Promise.resolve(initialUid)
|
|
17
|
-
: (0, createBlock_1.default)({ node: { text: title, children: [] }, parentUid }))
|
|
18
|
+
: (0, createBlock_1.default)({ node: { text: title, children: [] }, parentUid }).then((uid) => {
|
|
19
|
+
setNavUid(uid);
|
|
20
|
+
return uid;
|
|
21
|
+
}))
|
|
18
22
|
.then((formatUid) => (0, getFirstChildUidByBlockUid_1.default)(formatUid)
|
|
19
23
|
? formatUid
|
|
20
24
|
: ((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length)
|
|
@@ -34,11 +38,15 @@ const BlocksPanel = ({ uid: initialUid, parentUid, title, defaultValue, descript
|
|
|
34
38
|
});
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
|
-
}, [containerRef, defaultValue]);
|
|
41
|
+
}, [containerRef, defaultValue, setNavUid]);
|
|
38
42
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
39
43
|
react_1.default.createElement(core_1.Label, null,
|
|
40
44
|
(0, idToTitle_1.default)(title),
|
|
41
|
-
react_1.default.createElement(Description_1.default, { description: description })
|
|
45
|
+
react_1.default.createElement(Description_1.default, { description: description }),
|
|
46
|
+
react_1.default.createElement(core_1.Tooltip, { content: "Click here to edit these blocks directly" },
|
|
47
|
+
react_1.default.createElement(core_1.Button, { icon: "link", minimal: true, onClick: () => window.roamAlphaAPI.ui.mainWindow.openBlock({
|
|
48
|
+
block: { uid: navUid },
|
|
49
|
+
}) }))),
|
|
42
50
|
react_1.default.createElement("style", null, `.roamjs-config-blocks > div > .rm-block-main {
|
|
43
51
|
display: none;
|
|
44
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlocksPanel.js","sourceRoot":"","sources":["../../src/components/ConfigPanels/BlocksPanel.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"BlocksPanel.js","sourceRoot":"","sources":["../../src/components/ConfigPanels/BlocksPanel.tsx"],"names":[],"mappings":";;;AAAA,4CAA2D;AAC3D,uDAA2D;AAC3D,kHAAkF;AAClF,6EAA6C;AAC7C,mFAAmD;AACnD,yEAAyC;AAGzC,MAAM,WAAW,GAA4B,CAAC,EAC5C,GAAG,EAAE,UAAU,EACf,SAAS,EACT,KAAK,EACL,YAAY,EACZ,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAClC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IAC9D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,OAAO,EAAE;YACxB,MAAM,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC;YAChC,CAAC,UAAU;gBACT,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC7B,CAAC,CAAC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QA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,GAAG,EAAE,CACZ,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;wBAC1C,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;qBACvB,CAAC,GAEJ,CACM,CACJ;QACR,6CAAQ;;;;;;;;;;IAUV,CAAS;QACP,uCACE,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE;gBACL,MAAM,EAAE,qBAAqB;gBAC7B,OAAO,EAAE,OAAO;gBAChB,YAAY,EAAE,CAAC;aAChB,EACD,SAAS,EAAE,sBAAsB,GAC5B,CACN,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC;AAE5B,kBAAe,WAAW,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
setValue: (q: string) => void;
|
|
5
|
-
showButton?: boolean | undefined;
|
|
6
|
-
onBlur?: ((v: string) => void) | undefined;
|
|
7
|
-
onConfirm?: (() => void) | undefined;
|
|
2
|
+
import { AutocompleteInputProps } from "./AutocompleteInput";
|
|
3
|
+
declare const PageInput: ({ extra, ...rest }: {
|
|
8
4
|
extra?: string[] | undefined;
|
|
9
|
-
}) => React.ReactElement;
|
|
5
|
+
} & Omit<AutocompleteInputProps, "options">) => React.ReactElement;
|
|
10
6
|
export default PageInput;
|
package/components/PageInput.js
CHANGED
|
@@ -1,72 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const core_1 = require("@blueprintjs/core");
|
|
5
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
5
|
const getAllPageNames_1 = tslib_1.__importDefault(require("../queries/getAllPageNames"));
|
|
7
|
-
const
|
|
8
|
-
const fuzzy_1 = tslib_1.__importDefault(require("fuzzy"));
|
|
6
|
+
const AutocompleteInput_1 = tslib_1.__importDefault(require("./AutocompleteInput"));
|
|
9
7
|
const DEFAULT_EXTRA = [];
|
|
10
|
-
const PageInput = (
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const allPages = (0, react_1.useMemo)(() => [...(0, getAllPageNames_1.default)(), ...extra], [extra]);
|
|
15
|
-
const items = (0, react_1.useMemo)(() => value && isOpen
|
|
16
|
-
? fuzzy_1.default
|
|
17
|
-
.filter(value, allPages)
|
|
18
|
-
.slice(0, 9)
|
|
19
|
-
.map((e) => e.string)
|
|
20
|
-
: [], [value, allPages]);
|
|
21
|
-
const menuRef = (0, react_1.useRef)(null);
|
|
22
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
23
|
-
const onEnter = (0, react_1.useCallback)((value) => {
|
|
24
|
-
if (isOpen) {
|
|
25
|
-
setValue(value);
|
|
26
|
-
close();
|
|
27
|
-
}
|
|
28
|
-
else if (onConfirm) {
|
|
29
|
-
onConfirm();
|
|
30
|
-
}
|
|
31
|
-
}, [setValue, close, onConfirm, isOpen]);
|
|
32
|
-
const { activeIndex, onKeyDown } = (0, useArrowKeyDown_1.default)({
|
|
33
|
-
onEnter,
|
|
34
|
-
results: items,
|
|
35
|
-
menuRef,
|
|
36
|
-
});
|
|
37
|
-
return (react_1.default.createElement(core_1.Popover, { portalClassName: "roamjs-page-input", targetClassName: "roamjs-page-input-target", captureDismiss: true, isOpen: isOpen, onOpened: open, minimal: true, autoFocus: false, enforceFocus: false, position: core_1.PopoverPosition.BOTTOM_LEFT, modifiers: {
|
|
38
|
-
flip: { enabled: false },
|
|
39
|
-
preventOverflow: { enabled: false },
|
|
40
|
-
}, content: react_1.default.createElement(core_1.Menu, { className: "max-h-64 overflow-auto max-w-md", ulRef: menuRef }, items.map((t, i) => (react_1.default.createElement(core_1.MenuItem, { text: t, active: activeIndex === i, key: i, multiline: true, onClick: () => {
|
|
41
|
-
var _a;
|
|
42
|
-
setValue(items[i]);
|
|
43
|
-
close();
|
|
44
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
45
|
-
} })))), target: react_1.default.createElement(core_1.InputGroup, Object.assign({ value: value || "", onChange: (e) => {
|
|
46
|
-
setValue(e.target.value);
|
|
47
|
-
setIsOpen(!!e.target.value);
|
|
48
|
-
}, placeholder: "Search for a page", autoFocus: true, onKeyDown: (e) => {
|
|
49
|
-
if (e.key === "Escape") {
|
|
50
|
-
e.stopPropagation();
|
|
51
|
-
close();
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
onKeyDown(e);
|
|
55
|
-
}
|
|
56
|
-
}, onBlur: (e) => {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
if (e.relatedTarget &&
|
|
59
|
-
!((_b = (_a = e.relatedTarget).closest) === null || _b === void 0 ? void 0 : _b.call(_a, ".roamjs-page-input"))) {
|
|
60
|
-
close();
|
|
61
|
-
}
|
|
62
|
-
if (onBlur) {
|
|
63
|
-
onBlur(e.target.value);
|
|
64
|
-
}
|
|
65
|
-
}, inputRef: inputRef }, (showButton
|
|
66
|
-
? {
|
|
67
|
-
rightElement: react_1.default.createElement(core_1.Button, { icon: "add", minimal: true, onClick: onEnter }),
|
|
68
|
-
}
|
|
69
|
-
: {}))) }));
|
|
8
|
+
const PageInput = (_a) => {
|
|
9
|
+
var { extra = DEFAULT_EXTRA } = _a, rest = tslib_1.__rest(_a, ["extra"]);
|
|
10
|
+
const options = (0, react_1.useMemo)(() => [...(0, getAllPageNames_1.default)(), ...extra], [extra]);
|
|
11
|
+
return react_1.default.createElement(AutocompleteInput_1.default, Object.assign({}, rest, { options: options }));
|
|
70
12
|
};
|
|
71
13
|
exports.default = PageInput;
|
|
72
14
|
//# sourceMappingURL=PageInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageInput.js","sourceRoot":"","sources":["../src/components/PageInput.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"PageInput.js","sourceRoot":"","sources":["../src/components/PageInput.tsx"],"names":[],"mappings":";;;AAAA,uDAAuC;AACvC,yFAAyD;AACzD,oFAAgF;AAEhF,MAAM,aAAa,GAAa,EAAE,CAAC;AAEnC,MAAM,SAAS,GAAG,CAAC,EAKwB,EAAsB,EAAE;QALhD,EACjB,KAAK,GAAG,aAAa,OAIoB,EAHtC,IAAI,sBAFU,SAGlB,CADQ;IAIP,MAAM,OAAO,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,GAAG,IAAA,yBAAe,GAAE,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,OAAO,8BAAC,2BAAiB,oBAAK,IAAI,IAAE,OAAO,EAAE,OAAO,IAAI,CAAC;AAC3D,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC"}
|
package/components/index.d.ts
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export { default as AutocompleteInput } from "./AutocompleteInput";
|
|
2
|
-
export { default as BlockInput } from "./BlockInput";
|
|
3
|
-
export { default as BlockErrorBoundary } from "./BlockErrorBoundary";
|
|
4
|
-
export { default as ComponentContainer, createComponentRender, } from "./ComponentContainer";
|
|
5
|
-
export { default as ConfigPage, createConfigObserver } from "./ConfigPage";
|
|
6
|
-
export { default as CursorMenu, render as renderCursorMenu, getCoordsFromTextarea, } from "./CursorMenu";
|
|
7
|
-
export { default as Description } from "./Description";
|
|
8
|
-
export { default as Filter } from "./Filter";
|
|
9
|
-
export { default as Loading, renderLoading } from "./Loading";
|
|
10
|
-
export { default as MenuItemSelect } from "./MenuItemSelect";
|
|
11
|
-
export { useOauthAccounts } from "./OauthSelect";
|
|
12
|
-
export { default as PageInput } from "./PageInput";
|
|
13
|
-
export { TOKEN_STAGE as SERVICE_TOKEN_STAGE, SERVICE_GUIDE_HIGHLIGHT, MainStage as WrapServiceMainStage, runService, ServiceDashboard, StageContent, StageProps, useNextStage as useServiceNextStage, usePageUid as useServicePageUid, useField as useServiceField, useFieldVals as useServiceFieldVals, useIsFieldSet as useServiceIsFieldSet, NextButton as ServiceNextButton, useSetMetadata as useServiceSetMetadata, useGetMetadata as useServiceGetMetadata, } from "./ServiceComponents";
|
|
14
|
-
export { default as SimpleAlert, render as renderSimpleAlert, } from "./SimpleAlert";
|
|
15
|
-
export { default as renderToast } from "./Toast";
|
|
16
|
-
export { default as TokenDialog, render as renderTokenDialog, addTokenDialogCommand, } from "./TokenDialog";
|
package/components/index.js
CHANGED
|
@@ -1,59 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addTokenDialogCommand = exports.renderTokenDialog = exports.TokenDialog = exports.renderToast = exports.renderSimpleAlert = exports.SimpleAlert = exports.useServiceGetMetadata = exports.useServiceSetMetadata = exports.ServiceNextButton = exports.useServiceIsFieldSet = exports.useServiceFieldVals = exports.useServiceField = exports.useServicePageUid = exports.useServiceNextStage = exports.ServiceDashboard = exports.runService = exports.WrapServiceMainStage = exports.SERVICE_GUIDE_HIGHLIGHT = exports.SERVICE_TOKEN_STAGE = exports.PageInput = exports.useOauthAccounts = exports.MenuItemSelect = exports.renderLoading = exports.Loading = exports.Filter = exports.Description = exports.getCoordsFromTextarea = exports.renderCursorMenu = exports.CursorMenu = exports.createConfigObserver = exports.ConfigPage = exports.createComponentRender = exports.ComponentContainer = exports.BlockErrorBoundary = exports.BlockInput = exports.AutocompleteInput = void 0;
|
|
7
|
-
var AutocompleteInput_1 = require("./AutocompleteInput");
|
|
8
|
-
Object.defineProperty(exports, "AutocompleteInput", { enumerable: true, get: function () { return __importDefault(AutocompleteInput_1).default; } });
|
|
9
|
-
var BlockInput_1 = require("./BlockInput");
|
|
10
|
-
Object.defineProperty(exports, "BlockInput", { enumerable: true, get: function () { return __importDefault(BlockInput_1).default; } });
|
|
11
|
-
var BlockErrorBoundary_1 = require("./BlockErrorBoundary");
|
|
12
|
-
Object.defineProperty(exports, "BlockErrorBoundary", { enumerable: true, get: function () { return __importDefault(BlockErrorBoundary_1).default; } });
|
|
13
|
-
var ComponentContainer_1 = require("./ComponentContainer");
|
|
14
|
-
Object.defineProperty(exports, "ComponentContainer", { enumerable: true, get: function () { return __importDefault(ComponentContainer_1).default; } });
|
|
15
|
-
Object.defineProperty(exports, "createComponentRender", { enumerable: true, get: function () { return ComponentContainer_1.createComponentRender; } });
|
|
16
|
-
var ConfigPage_1 = require("./ConfigPage");
|
|
17
|
-
Object.defineProperty(exports, "ConfigPage", { enumerable: true, get: function () { return __importDefault(ConfigPage_1).default; } });
|
|
18
|
-
Object.defineProperty(exports, "createConfigObserver", { enumerable: true, get: function () { return ConfigPage_1.createConfigObserver; } });
|
|
19
|
-
var CursorMenu_1 = require("./CursorMenu");
|
|
20
|
-
Object.defineProperty(exports, "CursorMenu", { enumerable: true, get: function () { return __importDefault(CursorMenu_1).default; } });
|
|
21
|
-
Object.defineProperty(exports, "renderCursorMenu", { enumerable: true, get: function () { return CursorMenu_1.render; } });
|
|
22
|
-
Object.defineProperty(exports, "getCoordsFromTextarea", { enumerable: true, get: function () { return CursorMenu_1.getCoordsFromTextarea; } });
|
|
23
|
-
var Description_1 = require("./Description");
|
|
24
|
-
Object.defineProperty(exports, "Description", { enumerable: true, get: function () { return __importDefault(Description_1).default; } });
|
|
25
|
-
var Filter_1 = require("./Filter");
|
|
26
|
-
Object.defineProperty(exports, "Filter", { enumerable: true, get: function () { return __importDefault(Filter_1).default; } });
|
|
27
|
-
var Loading_1 = require("./Loading");
|
|
28
|
-
Object.defineProperty(exports, "Loading", { enumerable: true, get: function () { return __importDefault(Loading_1).default; } });
|
|
29
|
-
Object.defineProperty(exports, "renderLoading", { enumerable: true, get: function () { return Loading_1.renderLoading; } });
|
|
30
|
-
var MenuItemSelect_1 = require("./MenuItemSelect");
|
|
31
|
-
Object.defineProperty(exports, "MenuItemSelect", { enumerable: true, get: function () { return __importDefault(MenuItemSelect_1).default; } });
|
|
32
|
-
var OauthSelect_1 = require("./OauthSelect");
|
|
33
|
-
Object.defineProperty(exports, "useOauthAccounts", { enumerable: true, get: function () { return OauthSelect_1.useOauthAccounts; } });
|
|
34
|
-
var PageInput_1 = require("./PageInput");
|
|
35
|
-
Object.defineProperty(exports, "PageInput", { enumerable: true, get: function () { return __importDefault(PageInput_1).default; } });
|
|
36
|
-
var ServiceComponents_1 = require("./ServiceComponents");
|
|
37
|
-
Object.defineProperty(exports, "SERVICE_TOKEN_STAGE", { enumerable: true, get: function () { return ServiceComponents_1.TOKEN_STAGE; } });
|
|
38
|
-
Object.defineProperty(exports, "SERVICE_GUIDE_HIGHLIGHT", { enumerable: true, get: function () { return ServiceComponents_1.SERVICE_GUIDE_HIGHLIGHT; } });
|
|
39
|
-
Object.defineProperty(exports, "WrapServiceMainStage", { enumerable: true, get: function () { return ServiceComponents_1.MainStage; } });
|
|
40
|
-
Object.defineProperty(exports, "runService", { enumerable: true, get: function () { return ServiceComponents_1.runService; } });
|
|
41
|
-
Object.defineProperty(exports, "ServiceDashboard", { enumerable: true, get: function () { return ServiceComponents_1.ServiceDashboard; } });
|
|
42
|
-
Object.defineProperty(exports, "useServiceNextStage", { enumerable: true, get: function () { return ServiceComponents_1.useNextStage; } });
|
|
43
|
-
Object.defineProperty(exports, "useServicePageUid", { enumerable: true, get: function () { return ServiceComponents_1.usePageUid; } });
|
|
44
|
-
Object.defineProperty(exports, "useServiceField", { enumerable: true, get: function () { return ServiceComponents_1.useField; } });
|
|
45
|
-
Object.defineProperty(exports, "useServiceFieldVals", { enumerable: true, get: function () { return ServiceComponents_1.useFieldVals; } });
|
|
46
|
-
Object.defineProperty(exports, "useServiceIsFieldSet", { enumerable: true, get: function () { return ServiceComponents_1.useIsFieldSet; } });
|
|
47
|
-
Object.defineProperty(exports, "ServiceNextButton", { enumerable: true, get: function () { return ServiceComponents_1.NextButton; } });
|
|
48
|
-
Object.defineProperty(exports, "useServiceSetMetadata", { enumerable: true, get: function () { return ServiceComponents_1.useSetMetadata; } });
|
|
49
|
-
Object.defineProperty(exports, "useServiceGetMetadata", { enumerable: true, get: function () { return ServiceComponents_1.useGetMetadata; } });
|
|
50
|
-
var SimpleAlert_1 = require("./SimpleAlert");
|
|
51
|
-
Object.defineProperty(exports, "SimpleAlert", { enumerable: true, get: function () { return __importDefault(SimpleAlert_1).default; } });
|
|
52
|
-
Object.defineProperty(exports, "renderSimpleAlert", { enumerable: true, get: function () { return SimpleAlert_1.render; } });
|
|
53
|
-
var Toast_1 = require("./Toast");
|
|
54
|
-
Object.defineProperty(exports, "renderToast", { enumerable: true, get: function () { return __importDefault(Toast_1).default; } });
|
|
55
|
-
var TokenDialog_1 = require("./TokenDialog");
|
|
56
|
-
Object.defineProperty(exports, "TokenDialog", { enumerable: true, get: function () { return __importDefault(TokenDialog_1).default; } });
|
|
57
|
-
Object.defineProperty(exports, "renderTokenDialog", { enumerable: true, get: function () { return TokenDialog_1.render; } });
|
|
58
|
-
Object.defineProperty(exports, "addTokenDialogCommand", { enumerable: true, get: function () { return TokenDialog_1.addTokenDialogCommand; } });
|
|
2
|
+
throw new Error(`Do not import from roamjs-components/components directly. Instead import the *component* you need directly. For example:
|
|
3
|
+
|
|
4
|
+
import AutocompleteInput from "roamjs-components/util/AutocompleteInput;"`);
|
|
59
5
|
//# sourceMappingURL=index.js.map
|
package/components/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/components/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/components/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CACb;;0EAEwE,CACzE,CAAC"}
|
|
@@ -5,6 +5,6 @@ declare const useArrowKeyDown: <T>({ results, onEnter, menuRef, }: {
|
|
|
5
5
|
menuRef: React.RefObject<HTMLUListElement>;
|
|
6
6
|
}) => {
|
|
7
7
|
activeIndex: number;
|
|
8
|
-
onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
8
|
+
onKeyDown: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
9
9
|
};
|
|
10
10
|
export default useArrowKeyDown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArrowKeyDown.js","sourceRoot":"","sources":["../src/hooks/useArrowKeyDown.ts"],"names":[],"mappings":";;AAAA,iCAAqD;AAErD,MAAM,UAAU,GAAG,CAAC,EAAe,EAAE,EAAe,EAAE,EAAE;IACtD,MAAM,YAAY,GAAG,EAAE,CAAC,SAAS,CAAC;IAClC,MAAM,eAAe,GAAG,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC;IAEvD,MAAM,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IAC7B,MAAM,UAAU,GAAG,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC;IAE7C,OAAO,UAAU,IAAI,eAAe,IAAI,OAAO,IAAI,YAAY,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAI,EAC1B,OAAO,EACP,OAAO,EACP,OAAO,GAKR,
|
|
1
|
+
{"version":3,"file":"useArrowKeyDown.js","sourceRoot":"","sources":["../src/hooks/useArrowKeyDown.ts"],"names":[],"mappings":";;AAAA,iCAAqD;AAErD,MAAM,UAAU,GAAG,CAAC,EAAe,EAAE,EAAe,EAAE,EAAE;IACtD,MAAM,YAAY,GAAG,EAAE,CAAC,SAAS,CAAC;IAClC,MAAM,eAAe,GAAG,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC;IAEvD,MAAM,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IAC7B,MAAM,UAAU,GAAG,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC;IAE7C,OAAO,UAAU,IAAI,eAAe,IAAI,OAAO,IAAI,YAAY,CAAC;AAClE,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAI,EAC1B,OA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C,IAAI,CAAC,CAAC;qBACzB;iBACF;gBACD,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,CAAC,CAAC,eAAe,EAAE,CAAC;aACrB;SACF;QACD,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;YACrB,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;YAC9B,cAAc,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;SACrB;IACH,CAAC,EACD,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,CAChD,CAAC;IACF,OAAO;QACL,WAAW;QACX,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roamjs-components",
|
|
3
3
|
"description": "Description for roamjs-components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.67.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
"version": "npm run format && git add -A src",
|
|
15
15
|
"postversion": "git push origin main && git push --tags",
|
|
16
16
|
"jest": "jest --config jestconfig.json",
|
|
17
|
-
"test": "npm run jest"
|
|
17
|
+
"test": "npm run jest",
|
|
18
|
+
"prestart": "node scripts/build.js",
|
|
19
|
+
"start": "http-server -p 8000 build"
|
|
18
20
|
},
|
|
19
21
|
"sideEffects": false,
|
|
20
22
|
"license": "MIT",
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
"@blueprintjs/select": "3.18.6",
|
|
40
42
|
"@types/crypto-js": "4.1.1",
|
|
41
43
|
"@types/file-saver": "2.0.5",
|
|
44
|
+
"@types/marked": "^4.0.3",
|
|
42
45
|
"@types/nanoid": "2.0.0",
|
|
43
46
|
"@types/react": "17.0.39",
|
|
44
47
|
"@types/react-dom": "17.0.13",
|
|
@@ -71,16 +74,20 @@
|
|
|
71
74
|
"@types/aws-lambda": "^8.10.89",
|
|
72
75
|
"@types/color": "^3.0.2",
|
|
73
76
|
"@types/jest": "^26.0.23",
|
|
74
|
-
"@types/marked": "^4.0.3",
|
|
75
77
|
"@types/refractor": "^3.0.2",
|
|
76
78
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
77
79
|
"@typescript-eslint/parser": "^5.27.1",
|
|
78
80
|
"eslint": "^8.4.0",
|
|
81
|
+
"http-server": "^14.1.1",
|
|
79
82
|
"jest": "^26.6.3",
|
|
80
83
|
"prettier": "^2.3.1",
|
|
81
84
|
"roamjs-scripts": "^0.18.15",
|
|
82
85
|
"ts-jest": "^26.5.6",
|
|
83
86
|
"tslint-config-prettier": "^1.18.0",
|
|
84
87
|
"tslint-react-hooks": "^2.2.2"
|
|
88
|
+
},
|
|
89
|
+
"engines": {
|
|
90
|
+
"npm": ">=7.0.0",
|
|
91
|
+
"node": ">=16.0.0"
|
|
85
92
|
}
|
|
86
93
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DatalogAndClause, DatalogArgument, DatalogBinding, DatalogClause, DatalogFnArg } from "../types";
|
|
2
|
-
declare const compileDatalog: (d: DatalogClause | DatalogAndClause | DatalogArgument | DatalogFnArg | DatalogBinding
|
|
2
|
+
declare const compileDatalog: (d: Partial<DatalogClause> | Partial<DatalogAndClause> | Partial<DatalogArgument> | Partial<DatalogFnArg> | Partial<DatalogBinding>, level: number) => string;
|
|
3
3
|
export default compileDatalog;
|
|
@@ -3,45 +3,57 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const compileDatalog = (d, level) => {
|
|
4
4
|
switch (d.type) {
|
|
5
5
|
case "data-pattern":
|
|
6
|
-
return `[${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}${d.arguments
|
|
6
|
+
return `[${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}${(d.arguments || [])
|
|
7
|
+
.map((a) => compileDatalog(a, level))
|
|
8
|
+
.join(" ")}]`;
|
|
7
9
|
case "src-var":
|
|
8
|
-
return `$${d.value.replace(/[\s,{}]/g, "")}`;
|
|
10
|
+
return `$${(d.value || "undefined").replace(/[\s,{}]/g, "")}`;
|
|
9
11
|
case "constant":
|
|
10
12
|
case "underscore":
|
|
11
|
-
return d.value;
|
|
13
|
+
return d.value || "_";
|
|
12
14
|
case "variable":
|
|
13
|
-
return `?${d.value.replace(/[\s,{}]/g, "")}`;
|
|
15
|
+
return `?${(d.value || "undefined").replace(/[\s,{}]/g, "")}`;
|
|
14
16
|
case "fn-expr":
|
|
15
|
-
|
|
17
|
+
if (!d.binding)
|
|
18
|
+
return "";
|
|
19
|
+
return `[(${d.fn} ${(d.arguments || [])
|
|
16
20
|
.map((a) => compileDatalog(a, level))
|
|
17
21
|
.join(" ")}) ${compileDatalog(d.binding, level)}]`;
|
|
18
22
|
case "pred-expr":
|
|
19
|
-
return `[(${d.pred} ${d.arguments
|
|
23
|
+
return `[(${d.pred} ${(d.arguments || [])
|
|
20
24
|
.map((a) => compileDatalog(a, level))
|
|
21
25
|
.join(" ")})]`;
|
|
22
26
|
case "rule-expr":
|
|
23
|
-
return `[${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}${d.arguments
|
|
27
|
+
return `[${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}${(d.arguments || [])
|
|
28
|
+
.map((a) => compileDatalog(a, level))
|
|
29
|
+
.join(" ")}]`;
|
|
24
30
|
case "not-clause":
|
|
25
|
-
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}not ${d.clauses
|
|
31
|
+
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}not ${(d.clauses || [])
|
|
32
|
+
.map((a) => compileDatalog(a, level + 1))
|
|
33
|
+
.join(" ")})`;
|
|
26
34
|
case "or-clause":
|
|
27
|
-
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}or ${d.clauses
|
|
35
|
+
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}or ${(d.clauses || [])
|
|
36
|
+
.map((a) => compileDatalog(a, level + 1))
|
|
37
|
+
.join("\n")})`;
|
|
28
38
|
case "and-clause":
|
|
29
|
-
return `${"".padStart(level * 2, " ")}(and\n${d.clauses
|
|
39
|
+
return `${"".padStart(level * 2, " ")}(and\n${(d.clauses || [])
|
|
30
40
|
.map((c) => compileDatalog(c, level + 1))
|
|
31
41
|
.join("\n")}\n${"".padStart(level * 2, " ")})`;
|
|
32
42
|
case "not-join-clause":
|
|
33
|
-
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}not-join [${d.variables
|
|
43
|
+
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}not-join [${(d.variables || [])
|
|
34
44
|
.map((v) => compileDatalog(v, level))
|
|
35
|
-
.join(" ")}] ${d.clauses
|
|
45
|
+
.join(" ")}] ${(d.clauses || [])
|
|
36
46
|
.map((a) => compileDatalog(a, level + 1))
|
|
37
47
|
.join(" ")})`;
|
|
38
48
|
case "or-join-clause":
|
|
39
|
-
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}or-join [${d.variables
|
|
49
|
+
return `(${d.srcVar ? `${compileDatalog(d.srcVar, level)} ` : ""}or-join [${(d.variables || [])
|
|
40
50
|
.map((v) => compileDatalog(v, level))
|
|
41
|
-
.join(" ")}]\n${d.clauses
|
|
51
|
+
.join(" ")}]\n${(d.clauses || [])
|
|
42
52
|
.map((a) => compileDatalog(a, level + 1))
|
|
43
53
|
.join("\n")})`;
|
|
44
54
|
case "bind-scalar":
|
|
55
|
+
if (!d.variable)
|
|
56
|
+
return "";
|
|
45
57
|
return compileDatalog(d.variable, level);
|
|
46
58
|
default:
|
|
47
59
|
return "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileDatalog.js","sourceRoot":"","sources":["../src/queries/compileDatalog.ts"],"names":[],"mappings":";;AAQA,MAAM,cAAc,GAAG,CACrB,
|
|
1
|
+
{"version":3,"file":"compileDatalog.js","sourceRoot":"","sources":["../src/queries/compileDatalog.ts"],"names":[],"mappings":";;AAQA,MAAM,cAAc,GAAG,CACrB,CAK2B,EAC3B,KAAa,EACL,EAAE;IACV,QAAQ,CAAC,CAAC,IAAI,EAAE;QACd,KAAK,cAAc;YACjB,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CACjE,CAAC,CAAC,SAAS,IAAI,EAAE,CAClB;iBACE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;iBACpC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC;QAChE,KAAK,UAAU,CAAC;QAChB,KAAK,YAAY;YACf,OAAO,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC;QACxB,KAAK,UAAU;YACb,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC;QAChE,KAAK,SAAS;YACZ,IAAI,CAAC,CAAC,CAAC,OAAO;gBAAE,OAAO,EAAE,CAAC;YAC1B,OAAO,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;iBACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;iBAC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GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;iBACpC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;iBAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;iBACxC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACnB,KAAK,aAAa;YAChB,IAAI,CAAC,CAAC,CAAC,QAAQ;gBAAE,OAAO,EAAE,CAAC;YAC3B,OAAO,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC3C;YACE,OAAO,EAAE,CAAC;KACb;AACH,CAAC,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
package/queries/index.d.ts
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export { default as compileDatalog } from "./compileDatalog";
|
|
2
|
-
export { default as getAllBlockUids } from "./getAllBlockUids";
|
|
3
|
-
export { default as getAllBlockUidsAndTexts } from "./getAllBlockUidsAndTexts";
|
|
4
|
-
export { default as getAllPageNames } from "./getAllPageNames";
|
|
5
|
-
export { default as getAttributeValueByBlockAndName } from "./getAttributeValueByBlockAndName";
|
|
6
|
-
export { default as getBasicTreeByParentUid } from "./getBasicTreeByParentUid";
|
|
7
|
-
export { default as getBlockUidAndTextIncludingText } from "./getBlockUidAndTextIncludingText";
|
|
8
|
-
export { default as getBlockUidByTextOnPage } from "./getBlockUidByTextOnPage";
|
|
9
|
-
export { default as getBlockUidsAndTextsReferencingPage } from "./getBlockUidsAndTextsReferencingPage";
|
|
10
|
-
export { default as getBlockUidsByPageTitle } from "./getBlockUidsByPageTitle";
|
|
11
|
-
export { default as getBlockUidsReferencingBlock } from "./getBlockUidsReferencingBlock";
|
|
12
|
-
export { default as getBlockUidsReferencingPage } from "./getBlockUidsReferencingPage";
|
|
13
|
-
export { default as getBlockUidsWithParentUid } from "./getBlockUidsWithParentUid";
|
|
14
|
-
export { default as getChildrenLengthByPageUid } from "./getChildrenLengthByPageUid";
|
|
15
|
-
export { default as getCurrentUserDisplayName } from "./getCurrentUserDisplayName";
|
|
16
|
-
export { default as getCurrentUserEmail } from "./getCurrentUserEmail";
|
|
17
|
-
export { default as getCurrentUserUid } from "./getCurrentUserUid";
|
|
18
|
-
export { default as getFirstChildTextByBlockUid } from "./getFirstChildTextByBlockUid";
|
|
19
|
-
export { default as getFirstChildUidByBlockUid } from "./getFirstChildUidByBlockUid";
|
|
20
|
-
export { default as getCreateTimeByBlockUid } from "./getCreateTimeByBlockUid";
|
|
21
|
-
export { default as getDisplayNameByEmail } from "./getDisplayNameByEmail";
|
|
22
|
-
export { default as getDisplayNameByUid } from "./getDisplayNameByUid";
|
|
23
|
-
export { default as getEditTimeByBlockUid } from "./getEditTimeByBlockUid";
|
|
24
|
-
export { default as getEditedUserEmailByBlockUid } from "./getEditedUserEmailByBlockUid";
|
|
25
|
-
export { default as getFullTreeByParentUid } from "./getFullTreeByParentUid";
|
|
26
|
-
export { default as getLinkedPageTitlesUnderUid } from "./getLinkedPageTitlesUnderUid";
|
|
27
|
-
export { default as getNthChildUidByBlockUid } from "./getNthChildUidByBlockUid";
|
|
28
|
-
export { default as getOrderByBlockUid } from "./getOrderByBlockUid";
|
|
29
|
-
export { default as getPageTitleByBlockUid } from "./getPageTitleByBlockUid";
|
|
30
|
-
export { default as getPageTitlesAndBlockUidsReferencingPage } from "./getPageTitlesAndBlockUidsReferencingPage";
|
|
31
|
-
export { default as getPageTitlesAndUidsDirectlyReferencingPage } from "./getPageTitlesAndUidsDirectlyReferencingPage";
|
|
32
|
-
export { default as getPageTitleReferencesByPageTitle } from "./getPageTitleReferencesByPageTitle";
|
|
33
|
-
export { default as getPageTitlesReferencingBlockUid } from "./getPageTitlesReferencingBlockUid";
|
|
34
|
-
export { default as getPageTitlesStartingWithPrefix } from "./getPageTitlesStartingWithPrefix";
|
|
35
|
-
export { default as getPageTitleByPageUid } from "./getPageTitleByPageUid";
|
|
36
|
-
export { default as getPageUidByPageTitle } from "./getPageUidByPageTitle";
|
|
37
|
-
export { default as getPageViewType } from "./getPageViewType";
|
|
38
|
-
export { default as getParentTextByBlockUid } from "./getParentTextByBlockUid";
|
|
39
|
-
export { default as getParentTextByBlockUidAndTag } from "./getParentTextByBlockUidAndTag";
|
|
40
|
-
export { default as getParentUidByBlockUid } from "./getParentUidByBlockUid";
|
|
41
|
-
export { default as getParentUidsOfBlockUid } from "./getParentUidsOfBlockUid";
|
|
42
|
-
export { default as getSettingsByEmail } from "./getSettingsByEmail";
|
|
43
|
-
export { default as getShallowTreeByParentUid } from "./getShallowTreeByParentUid";
|
|
44
|
-
export { default as getTextByBlockUid } from "./getTextByBlockUid";
|
|
45
|
-
export { default as isTagOnPage } from "./isTagOnPage";
|
|
46
|
-
export { default as normalizePageTitle } from "./normalizePageTitle";
|
package/queries/index.js
CHANGED
|
@@ -1,99 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.normalizePageTitle = exports.isTagOnPage = exports.getTextByBlockUid = exports.getShallowTreeByParentUid = exports.getSettingsByEmail = exports.getParentUidsOfBlockUid = exports.getParentUidByBlockUid = exports.getParentTextByBlockUidAndTag = exports.getParentTextByBlockUid = exports.getPageViewType = exports.getPageUidByPageTitle = exports.getPageTitleByPageUid = exports.getPageTitlesStartingWithPrefix = exports.getPageTitlesReferencingBlockUid = exports.getPageTitleReferencesByPageTitle = exports.getPageTitlesAndUidsDirectlyReferencingPage = exports.getPageTitlesAndBlockUidsReferencingPage = exports.getPageTitleByBlockUid = exports.getOrderByBlockUid = exports.getNthChildUidByBlockUid = exports.getLinkedPageTitlesUnderUid = exports.getFullTreeByParentUid = exports.getEditedUserEmailByBlockUid = exports.getEditTimeByBlockUid = exports.getDisplayNameByUid = exports.getDisplayNameByEmail = exports.getCreateTimeByBlockUid = exports.getFirstChildUidByBlockUid = exports.getFirstChildTextByBlockUid = exports.getCurrentUserUid = exports.getCurrentUserEmail = exports.getCurrentUserDisplayName = exports.getChildrenLengthByPageUid = exports.getBlockUidsWithParentUid = exports.getBlockUidsReferencingPage = exports.getBlockUidsReferencingBlock = exports.getBlockUidsByPageTitle = exports.getBlockUidsAndTextsReferencingPage = exports.getBlockUidByTextOnPage = exports.getBlockUidAndTextIncludingText = exports.getBasicTreeByParentUid = exports.getAttributeValueByBlockAndName = exports.getAllPageNames = exports.getAllBlockUidsAndTexts = exports.getAllBlockUids = exports.compileDatalog = void 0;
|
|
7
|
-
var compileDatalog_1 = require("./compileDatalog");
|
|
8
|
-
Object.defineProperty(exports, "compileDatalog", { enumerable: true, get: function () { return __importDefault(compileDatalog_1).default; } });
|
|
9
|
-
var getAllBlockUids_1 = require("./getAllBlockUids");
|
|
10
|
-
Object.defineProperty(exports, "getAllBlockUids", { enumerable: true, get: function () { return __importDefault(getAllBlockUids_1).default; } });
|
|
11
|
-
var getAllBlockUidsAndTexts_1 = require("./getAllBlockUidsAndTexts");
|
|
12
|
-
Object.defineProperty(exports, "getAllBlockUidsAndTexts", { enumerable: true, get: function () { return __importDefault(getAllBlockUidsAndTexts_1).default; } });
|
|
13
|
-
var getAllPageNames_1 = require("./getAllPageNames");
|
|
14
|
-
Object.defineProperty(exports, "getAllPageNames", { enumerable: true, get: function () { return __importDefault(getAllPageNames_1).default; } });
|
|
15
|
-
var getAttributeValueByBlockAndName_1 = require("./getAttributeValueByBlockAndName");
|
|
16
|
-
Object.defineProperty(exports, "getAttributeValueByBlockAndName", { enumerable: true, get: function () { return __importDefault(getAttributeValueByBlockAndName_1).default; } });
|
|
17
|
-
var getBasicTreeByParentUid_1 = require("./getBasicTreeByParentUid");
|
|
18
|
-
Object.defineProperty(exports, "getBasicTreeByParentUid", { enumerable: true, get: function () { return __importDefault(getBasicTreeByParentUid_1).default; } });
|
|
19
|
-
var getBlockUidAndTextIncludingText_1 = require("./getBlockUidAndTextIncludingText");
|
|
20
|
-
Object.defineProperty(exports, "getBlockUidAndTextIncludingText", { enumerable: true, get: function () { return __importDefault(getBlockUidAndTextIncludingText_1).default; } });
|
|
21
|
-
var getBlockUidByTextOnPage_1 = require("./getBlockUidByTextOnPage");
|
|
22
|
-
Object.defineProperty(exports, "getBlockUidByTextOnPage", { enumerable: true, get: function () { return __importDefault(getBlockUidByTextOnPage_1).default; } });
|
|
23
|
-
var getBlockUidsAndTextsReferencingPage_1 = require("./getBlockUidsAndTextsReferencingPage");
|
|
24
|
-
Object.defineProperty(exports, "getBlockUidsAndTextsReferencingPage", { enumerable: true, get: function () { return __importDefault(getBlockUidsAndTextsReferencingPage_1).default; } });
|
|
25
|
-
var getBlockUidsByPageTitle_1 = require("./getBlockUidsByPageTitle");
|
|
26
|
-
Object.defineProperty(exports, "getBlockUidsByPageTitle", { enumerable: true, get: function () { return __importDefault(getBlockUidsByPageTitle_1).default; } });
|
|
27
|
-
var getBlockUidsReferencingBlock_1 = require("./getBlockUidsReferencingBlock");
|
|
28
|
-
Object.defineProperty(exports, "getBlockUidsReferencingBlock", { enumerable: true, get: function () { return __importDefault(getBlockUidsReferencingBlock_1).default; } });
|
|
29
|
-
var getBlockUidsReferencingPage_1 = require("./getBlockUidsReferencingPage");
|
|
30
|
-
Object.defineProperty(exports, "getBlockUidsReferencingPage", { enumerable: true, get: function () { return __importDefault(getBlockUidsReferencingPage_1).default; } });
|
|
31
|
-
var getBlockUidsWithParentUid_1 = require("./getBlockUidsWithParentUid");
|
|
32
|
-
Object.defineProperty(exports, "getBlockUidsWithParentUid", { enumerable: true, get: function () { return __importDefault(getBlockUidsWithParentUid_1).default; } });
|
|
33
|
-
var getChildrenLengthByPageUid_1 = require("./getChildrenLengthByPageUid");
|
|
34
|
-
Object.defineProperty(exports, "getChildrenLengthByPageUid", { enumerable: true, get: function () { return __importDefault(getChildrenLengthByPageUid_1).default; } });
|
|
35
|
-
var getCurrentUserDisplayName_1 = require("./getCurrentUserDisplayName");
|
|
36
|
-
Object.defineProperty(exports, "getCurrentUserDisplayName", { enumerable: true, get: function () { return __importDefault(getCurrentUserDisplayName_1).default; } });
|
|
37
|
-
var getCurrentUserEmail_1 = require("./getCurrentUserEmail");
|
|
38
|
-
Object.defineProperty(exports, "getCurrentUserEmail", { enumerable: true, get: function () { return __importDefault(getCurrentUserEmail_1).default; } });
|
|
39
|
-
var getCurrentUserUid_1 = require("./getCurrentUserUid");
|
|
40
|
-
Object.defineProperty(exports, "getCurrentUserUid", { enumerable: true, get: function () { return __importDefault(getCurrentUserUid_1).default; } });
|
|
41
|
-
var getFirstChildTextByBlockUid_1 = require("./getFirstChildTextByBlockUid");
|
|
42
|
-
Object.defineProperty(exports, "getFirstChildTextByBlockUid", { enumerable: true, get: function () { return __importDefault(getFirstChildTextByBlockUid_1).default; } });
|
|
43
|
-
var getFirstChildUidByBlockUid_1 = require("./getFirstChildUidByBlockUid");
|
|
44
|
-
Object.defineProperty(exports, "getFirstChildUidByBlockUid", { enumerable: true, get: function () { return __importDefault(getFirstChildUidByBlockUid_1).default; } });
|
|
45
|
-
var getCreateTimeByBlockUid_1 = require("./getCreateTimeByBlockUid");
|
|
46
|
-
Object.defineProperty(exports, "getCreateTimeByBlockUid", { enumerable: true, get: function () { return __importDefault(getCreateTimeByBlockUid_1).default; } });
|
|
47
|
-
var getDisplayNameByEmail_1 = require("./getDisplayNameByEmail");
|
|
48
|
-
Object.defineProperty(exports, "getDisplayNameByEmail", { enumerable: true, get: function () { return __importDefault(getDisplayNameByEmail_1).default; } });
|
|
49
|
-
var getDisplayNameByUid_1 = require("./getDisplayNameByUid");
|
|
50
|
-
Object.defineProperty(exports, "getDisplayNameByUid", { enumerable: true, get: function () { return __importDefault(getDisplayNameByUid_1).default; } });
|
|
51
|
-
var getEditTimeByBlockUid_1 = require("./getEditTimeByBlockUid");
|
|
52
|
-
Object.defineProperty(exports, "getEditTimeByBlockUid", { enumerable: true, get: function () { return __importDefault(getEditTimeByBlockUid_1).default; } });
|
|
53
|
-
var getEditedUserEmailByBlockUid_1 = require("./getEditedUserEmailByBlockUid");
|
|
54
|
-
Object.defineProperty(exports, "getEditedUserEmailByBlockUid", { enumerable: true, get: function () { return __importDefault(getEditedUserEmailByBlockUid_1).default; } });
|
|
55
|
-
var getFullTreeByParentUid_1 = require("./getFullTreeByParentUid");
|
|
56
|
-
Object.defineProperty(exports, "getFullTreeByParentUid", { enumerable: true, get: function () { return __importDefault(getFullTreeByParentUid_1).default; } });
|
|
57
|
-
var getLinkedPageTitlesUnderUid_1 = require("./getLinkedPageTitlesUnderUid");
|
|
58
|
-
Object.defineProperty(exports, "getLinkedPageTitlesUnderUid", { enumerable: true, get: function () { return __importDefault(getLinkedPageTitlesUnderUid_1).default; } });
|
|
59
|
-
var getNthChildUidByBlockUid_1 = require("./getNthChildUidByBlockUid");
|
|
60
|
-
Object.defineProperty(exports, "getNthChildUidByBlockUid", { enumerable: true, get: function () { return __importDefault(getNthChildUidByBlockUid_1).default; } });
|
|
61
|
-
var getOrderByBlockUid_1 = require("./getOrderByBlockUid");
|
|
62
|
-
Object.defineProperty(exports, "getOrderByBlockUid", { enumerable: true, get: function () { return __importDefault(getOrderByBlockUid_1).default; } });
|
|
63
|
-
var getPageTitleByBlockUid_1 = require("./getPageTitleByBlockUid");
|
|
64
|
-
Object.defineProperty(exports, "getPageTitleByBlockUid", { enumerable: true, get: function () { return __importDefault(getPageTitleByBlockUid_1).default; } });
|
|
65
|
-
var getPageTitlesAndBlockUidsReferencingPage_1 = require("./getPageTitlesAndBlockUidsReferencingPage");
|
|
66
|
-
Object.defineProperty(exports, "getPageTitlesAndBlockUidsReferencingPage", { enumerable: true, get: function () { return __importDefault(getPageTitlesAndBlockUidsReferencingPage_1).default; } });
|
|
67
|
-
var getPageTitlesAndUidsDirectlyReferencingPage_1 = require("./getPageTitlesAndUidsDirectlyReferencingPage");
|
|
68
|
-
Object.defineProperty(exports, "getPageTitlesAndUidsDirectlyReferencingPage", { enumerable: true, get: function () { return __importDefault(getPageTitlesAndUidsDirectlyReferencingPage_1).default; } });
|
|
69
|
-
var getPageTitleReferencesByPageTitle_1 = require("./getPageTitleReferencesByPageTitle");
|
|
70
|
-
Object.defineProperty(exports, "getPageTitleReferencesByPageTitle", { enumerable: true, get: function () { return __importDefault(getPageTitleReferencesByPageTitle_1).default; } });
|
|
71
|
-
var getPageTitlesReferencingBlockUid_1 = require("./getPageTitlesReferencingBlockUid");
|
|
72
|
-
Object.defineProperty(exports, "getPageTitlesReferencingBlockUid", { enumerable: true, get: function () { return __importDefault(getPageTitlesReferencingBlockUid_1).default; } });
|
|
73
|
-
var getPageTitlesStartingWithPrefix_1 = require("./getPageTitlesStartingWithPrefix");
|
|
74
|
-
Object.defineProperty(exports, "getPageTitlesStartingWithPrefix", { enumerable: true, get: function () { return __importDefault(getPageTitlesStartingWithPrefix_1).default; } });
|
|
75
|
-
var getPageTitleByPageUid_1 = require("./getPageTitleByPageUid");
|
|
76
|
-
Object.defineProperty(exports, "getPageTitleByPageUid", { enumerable: true, get: function () { return __importDefault(getPageTitleByPageUid_1).default; } });
|
|
77
|
-
var getPageUidByPageTitle_1 = require("./getPageUidByPageTitle");
|
|
78
|
-
Object.defineProperty(exports, "getPageUidByPageTitle", { enumerable: true, get: function () { return __importDefault(getPageUidByPageTitle_1).default; } });
|
|
79
|
-
var getPageViewType_1 = require("./getPageViewType");
|
|
80
|
-
Object.defineProperty(exports, "getPageViewType", { enumerable: true, get: function () { return __importDefault(getPageViewType_1).default; } });
|
|
81
|
-
var getParentTextByBlockUid_1 = require("./getParentTextByBlockUid");
|
|
82
|
-
Object.defineProperty(exports, "getParentTextByBlockUid", { enumerable: true, get: function () { return __importDefault(getParentTextByBlockUid_1).default; } });
|
|
83
|
-
var getParentTextByBlockUidAndTag_1 = require("./getParentTextByBlockUidAndTag");
|
|
84
|
-
Object.defineProperty(exports, "getParentTextByBlockUidAndTag", { enumerable: true, get: function () { return __importDefault(getParentTextByBlockUidAndTag_1).default; } });
|
|
85
|
-
var getParentUidByBlockUid_1 = require("./getParentUidByBlockUid");
|
|
86
|
-
Object.defineProperty(exports, "getParentUidByBlockUid", { enumerable: true, get: function () { return __importDefault(getParentUidByBlockUid_1).default; } });
|
|
87
|
-
var getParentUidsOfBlockUid_1 = require("./getParentUidsOfBlockUid");
|
|
88
|
-
Object.defineProperty(exports, "getParentUidsOfBlockUid", { enumerable: true, get: function () { return __importDefault(getParentUidsOfBlockUid_1).default; } });
|
|
89
|
-
var getSettingsByEmail_1 = require("./getSettingsByEmail");
|
|
90
|
-
Object.defineProperty(exports, "getSettingsByEmail", { enumerable: true, get: function () { return __importDefault(getSettingsByEmail_1).default; } });
|
|
91
|
-
var getShallowTreeByParentUid_1 = require("./getShallowTreeByParentUid");
|
|
92
|
-
Object.defineProperty(exports, "getShallowTreeByParentUid", { enumerable: true, get: function () { return __importDefault(getShallowTreeByParentUid_1).default; } });
|
|
93
|
-
var getTextByBlockUid_1 = require("./getTextByBlockUid");
|
|
94
|
-
Object.defineProperty(exports, "getTextByBlockUid", { enumerable: true, get: function () { return __importDefault(getTextByBlockUid_1).default; } });
|
|
95
|
-
var isTagOnPage_1 = require("./isTagOnPage");
|
|
96
|
-
Object.defineProperty(exports, "isTagOnPage", { enumerable: true, get: function () { return __importDefault(isTagOnPage_1).default; } });
|
|
97
|
-
var normalizePageTitle_1 = require("./normalizePageTitle");
|
|
98
|
-
Object.defineProperty(exports, "normalizePageTitle", { enumerable: true, get: function () { return __importDefault(normalizePageTitle_1).default; } });
|
|
2
|
+
throw new Error(`Do not import from roamjs-components/queries directly. Instead import the *query* you need directly. For example:
|
|
3
|
+
|
|
4
|
+
import getTextByBlockUid from "roamjs-components/queries/getTextByBlockUid;"`);
|
|
99
5
|
//# sourceMappingURL=index.js.map
|
package/queries/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/queries/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/queries/index.ts"],"names":[],"mappings":";AAAA,MAAM,IAAI,KAAK,CACb;;+EAE6E,CAC9E,CAAC"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AddPullWatch,
|
|
3
|
-
import {
|
|
2
|
+
import { AddPullWatch, PullBlock, SidebarAction, SidebarWindow, SidebarWindowInput, WriteAction } from "./native";
|
|
3
|
+
import { Result as QueryBuilderResult, ExportTypes, QBResultsView, RegisterSelection, ParseQuery, FireQuery, ConditionToDatalog, RegisterDatalogTranslator } from "./query-builder";
|
|
4
4
|
import { RegisterCommand, UnregisterCommand } from "./smartblocks";
|
|
5
5
|
import type marked from "marked";
|
|
6
6
|
import type Markdown from "marked-react";
|
|
@@ -201,30 +201,11 @@ declare global {
|
|
|
201
201
|
getExportTypes?: (r: QueryBuilderResult[]) => ExportTypes;
|
|
202
202
|
}) => JSX.Element;
|
|
203
203
|
ResultsView: QBResultsView;
|
|
204
|
-
fireQuery:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
selections: QueryBuilderSelection[];
|
|
208
|
-
}) => Promise<QueryBuilderResult[]>;
|
|
209
|
-
parseQuery: (q: RoamBasicNode) => {
|
|
210
|
-
returnNode: string;
|
|
211
|
-
conditions: QueryBuilderCondition[];
|
|
212
|
-
selections: QueryBuilderSelection[];
|
|
213
|
-
returnNodeUid: string;
|
|
214
|
-
conditionsNodesUid: string;
|
|
215
|
-
selectionsNodesUid: string;
|
|
216
|
-
};
|
|
217
|
-
conditionToDatalog: (condition: QueryBuilderCondition) => DatalogClause[];
|
|
204
|
+
fireQuery: FireQuery;
|
|
205
|
+
parseQuery: ParseQuery;
|
|
206
|
+
conditionToDatalog: ConditionToDatalog;
|
|
218
207
|
getConditionLabels: () => string[];
|
|
219
|
-
registerDatalogTranslator:
|
|
220
|
-
key: string;
|
|
221
|
-
callback: (args: {
|
|
222
|
-
source: string;
|
|
223
|
-
target: string;
|
|
224
|
-
uid: string;
|
|
225
|
-
}) => DatalogClause[];
|
|
226
|
-
targetOptions?: string[] | ((source: string) => string[]);
|
|
227
|
-
}) => void;
|
|
208
|
+
registerDatalogTranslator: RegisterDatalogTranslator;
|
|
228
209
|
unregisterDatalogTranslator: (args: {
|
|
229
210
|
key: string;
|
|
230
211
|
}) => void;
|
package/types/query-builder.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DatalogClause, PullBlock } from "./native";
|
|
2
|
+
import { DatalogClause, PullBlock, RoamBasicNode } from "./native";
|
|
3
3
|
declare type QBBase = {
|
|
4
4
|
uid: string;
|
|
5
5
|
};
|
|
@@ -67,4 +67,27 @@ export declare type QBResultsView = (props: {
|
|
|
67
67
|
getExportTypes?: (r: Result[]) => ExportTypes;
|
|
68
68
|
onResultsInViewChange?: (r: Result[]) => void;
|
|
69
69
|
}) => JSX.Element;
|
|
70
|
+
export declare type ParseQuery = (q: RoamBasicNode | string) => {
|
|
71
|
+
returnNode: string;
|
|
72
|
+
conditions: Condition[];
|
|
73
|
+
selections: Selection[];
|
|
74
|
+
returnNodeUid: string;
|
|
75
|
+
conditionsNodesUid: string;
|
|
76
|
+
selectionsNodesUid: string;
|
|
77
|
+
};
|
|
78
|
+
export declare type FireQuery = (query: {
|
|
79
|
+
returnNode: string;
|
|
80
|
+
conditions: Condition[];
|
|
81
|
+
selections: Selection[];
|
|
82
|
+
}) => Promise<Result[]>;
|
|
83
|
+
export declare type ConditionToDatalog = (condition: Condition) => DatalogClause[];
|
|
84
|
+
export declare type RegisterDatalogTranslator = (args: {
|
|
85
|
+
key: string;
|
|
86
|
+
callback: (args: {
|
|
87
|
+
source: string;
|
|
88
|
+
target: string;
|
|
89
|
+
uid: string;
|
|
90
|
+
}) => DatalogClause[];
|
|
91
|
+
targetOptions?: string[] | ((source: string) => string[]);
|
|
92
|
+
}) => void;
|
|
70
93
|
export {};
|
package/util/runExtension.js
CHANGED
|
@@ -39,7 +39,7 @@ _run = Promise.resolve) => {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
const onunload = () => {
|
|
42
|
-
var _a, _b, _c, _d;
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
43
|
unload === null || unload === void 0 ? void 0 : unload();
|
|
44
44
|
if (loaded) {
|
|
45
45
|
(loaded.elements || []).forEach((e) => e.remove());
|
|
@@ -48,10 +48,11 @@ _run = Promise.resolve) => {
|
|
|
48
48
|
(loaded.commands || []).forEach((label) => window.roamAlphaAPI.ui.commandPalette.removeCommand({ label }));
|
|
49
49
|
(loaded.timeouts || []).forEach((e) => window.clearTimeout(e.timeout));
|
|
50
50
|
}
|
|
51
|
-
(_a = window.roamjs) === null || _a === void 0 ? true : delete _a.
|
|
52
|
-
(_b = window.roamjs) === null || _b === void 0 ?
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
(_a = window.roamjs) === null || _a === void 0 ? true : delete _a.extension[extensionId];
|
|
52
|
+
(_b = window.roamjs) === null || _b === void 0 ? true : delete _b.version[extensionId];
|
|
53
|
+
(_c = window.roamjs) === null || _c === void 0 ? void 0 : _c.loaded.delete(extensionId);
|
|
54
|
+
if (!((_d = window.roamjs) === null || _d === void 0 ? void 0 : _d.loaded.size)) {
|
|
55
|
+
(_e = document.getElementById("roamjs-default")) === null || _e === void 0 ? void 0 : _e.remove();
|
|
55
56
|
}
|
|
56
57
|
// how to handle adding RoamJS token command? it's own extension depending on dependency management?
|
|
57
58
|
};
|
package/util/runExtension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runExtension.js","sourceRoot":"","sources":["../src/util/runExtension.ts"],"names":[],"mappings":";;;AAAA,uEAAuC;AAmCvC,MAAM,YAAY,GAAG,CACnB,IAOK;AAEL,wBAAwB;AACxB,OAAmC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