roamjs-components 0.66.12 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/types/index.d.ts +2 -10
- package/types/index.js.map +1 -1
- package/types/query-builder.d.ts +10 -0
- 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;AAc1B,MAAM,iBAAiB,GAAG,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,OAAO,GAAG,EAAE,EACZ,WAAW,GAAG,aAAa,EAC3B,SAAS,EACT,SAAS,GACc,EAAsB,EAAE;IAC/C,MAAM,C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AC;AAEF,kBAAe,iBAAiB,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,G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AW;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.0",
|
|
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
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AddPullWatch, DatalogClause, PullBlock, RoamBasicNode, SidebarAction, SidebarWindow, SidebarWindowInput, WriteAction } from "./native";
|
|
3
|
-
import { Condition as QueryBuilderCondition, Selection as QueryBuilderSelection, Result as QueryBuilderResult, ExportTypes, QBResultsView } from "./query-builder";
|
|
3
|
+
import { Condition as QueryBuilderCondition, Selection as QueryBuilderSelection, Result as QueryBuilderResult, ExportTypes, QBResultsView, RegisterSelection } 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";
|
|
@@ -228,15 +228,7 @@ declare global {
|
|
|
228
228
|
unregisterDatalogTranslator: (args: {
|
|
229
229
|
key: string;
|
|
230
230
|
}) => void;
|
|
231
|
-
registerSelection:
|
|
232
|
-
test: RegExp;
|
|
233
|
-
pull: (a: {
|
|
234
|
-
returnNode: string;
|
|
235
|
-
match: RegExpExecArray;
|
|
236
|
-
where: DatalogClause[];
|
|
237
|
-
}) => string;
|
|
238
|
-
mapper: (r: PullBlock, key: string) => QueryBuilderResult[string] | Record<string, QueryBuilderResult[string]> | Promise<QueryBuilderResult[string] | Record<string, QueryBuilderResult[string]>>;
|
|
239
|
-
}) => void;
|
|
231
|
+
registerSelection: RegisterSelection;
|
|
240
232
|
};
|
|
241
233
|
versioning?: {
|
|
242
234
|
switch: (args: {
|
package/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":";;;AAsBA,mDAAyB"}
|
package/types/query-builder.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DatalogClause, PullBlock } from "./native";
|
|
2
3
|
declare type QBBase = {
|
|
3
4
|
uid: string;
|
|
4
5
|
};
|
|
@@ -43,6 +44,15 @@ export declare type ExportTypes = {
|
|
|
43
44
|
content: string;
|
|
44
45
|
}[]>;
|
|
45
46
|
}[];
|
|
47
|
+
export declare type RegisterSelection = (args: {
|
|
48
|
+
test: RegExp;
|
|
49
|
+
pull: (a: {
|
|
50
|
+
returnNode: string;
|
|
51
|
+
match: RegExpExecArray;
|
|
52
|
+
where: DatalogClause[];
|
|
53
|
+
}) => string;
|
|
54
|
+
mapper: (r: PullBlock, key: string, result: Result) => Result[string] | Record<string, Result[string]> | Promise<Result[string] | Record<string, Result[string]>>;
|
|
55
|
+
}) => void;
|
|
46
56
|
export declare type QBResultsView = (props: {
|
|
47
57
|
parentUid: string;
|
|
48
58
|
header?: React.ReactNode;
|
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,OAAO,CAAC,OAAO,EACG,EAAE;IACvD,MAAM,WAAW,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IACvE,MAAM,GAAG,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;IACvD,MAAM,eAAe,GACnB,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,CAAC,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,MAAM,CAAC;IACtE,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CA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