roamjs-components 0.76.1 → 0.76.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +32 -6
- package/types/index.d.ts +1 -14
- package/types/index.js.map +1 -1
- package/types/query-builder.d.ts +0 -120
- package/types/smartblocks.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "roamjs-components",
|
|
3
3
|
"description": "Expansive toolset, utilities, & components for developing RoamJS extensions.",
|
|
4
|
-
"version": "0.76.
|
|
4
|
+
"version": "0.76.3",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -10,11 +10,8 @@
|
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"preversion": "npm run lint",
|
|
12
12
|
"version": "npm run format && git add -A src",
|
|
13
|
-
"postversion": "git push origin main && git push --tags",
|
|
14
13
|
"test": "playwright test",
|
|
15
|
-
"
|
|
16
|
-
"start:new": "http-server -p 8000 build",
|
|
17
|
-
"start": "roamjs-scripts dev --depot"
|
|
14
|
+
"start": "samepage dev"
|
|
18
15
|
},
|
|
19
16
|
"sideEffects": false,
|
|
20
17
|
"license": "MIT",
|
|
@@ -46,7 +43,7 @@
|
|
|
46
43
|
"tslib": "2.2.0"
|
|
47
44
|
},
|
|
48
45
|
"dependencies": {
|
|
49
|
-
"@samepage/scripts": "^0.
|
|
46
|
+
"@samepage/scripts": "^0.62.3",
|
|
50
47
|
"@testing-library/react": "^12.1.5",
|
|
51
48
|
"aws-sdk-plus": "^0.5.3",
|
|
52
49
|
"color": "^4.0.1",
|
|
@@ -77,5 +74,34 @@
|
|
|
77
74
|
},
|
|
78
75
|
"bin": {
|
|
79
76
|
"roamjs": "./scripts/index.js"
|
|
77
|
+
},
|
|
78
|
+
"samepage": {
|
|
79
|
+
"external": [
|
|
80
|
+
"react-dom/client",
|
|
81
|
+
"@blueprintjs/core=window.Blueprint.Core",
|
|
82
|
+
"@blueprintjs/datetime=window.Blueprint.DateTime",
|
|
83
|
+
"@blueprintjs/select=window.Blueprint.Select",
|
|
84
|
+
"chrono-node=window.ChronoNode",
|
|
85
|
+
"crypto-js=window.CryptoJS",
|
|
86
|
+
"cytoscape=window.RoamLazy.Cytoscape",
|
|
87
|
+
"file-saver=window.FileSaver",
|
|
88
|
+
"jszip=window.RoamLazy.JSZip",
|
|
89
|
+
"idb=window.idb",
|
|
90
|
+
"insect=window.RoamLazy.Insect",
|
|
91
|
+
"marked=window.RoamLazy.Marked",
|
|
92
|
+
"marked-react=window.RoamLazy.MarkedReact",
|
|
93
|
+
"nanoid=window.Nanoid",
|
|
94
|
+
"react=window.React",
|
|
95
|
+
"react-dom=window.ReactDOM",
|
|
96
|
+
"react-youtube=window.ReactYoutube",
|
|
97
|
+
"tslib=window.TSLib"
|
|
98
|
+
],
|
|
99
|
+
"include": [
|
|
100
|
+
"package.json",
|
|
101
|
+
"README.md"
|
|
102
|
+
],
|
|
103
|
+
"out": "extension",
|
|
104
|
+
"mirror": ".",
|
|
105
|
+
"format": "esm"
|
|
80
106
|
}
|
|
81
107
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AddPullWatch, PullBlock, SidebarAction, SidebarWindow, SidebarWindowInput, WriteAction } from "./native";
|
|
2
|
-
import {
|
|
2
|
+
import { RunQuery, ListActiveQueries } from "./query-builder";
|
|
3
3
|
import { RegisterCommand, UnregisterCommand } from "./smartblocks";
|
|
4
4
|
import type marked from "marked";
|
|
5
5
|
import type Markdown from "marked-react";
|
|
@@ -205,19 +205,6 @@ declare global {
|
|
|
205
205
|
loaded: Set<string>;
|
|
206
206
|
extension: {
|
|
207
207
|
queryBuilder?: {
|
|
208
|
-
ExportDialog: ExportDialogComponent;
|
|
209
|
-
QueryEditor: QueryEditorComponent;
|
|
210
|
-
QueryPage: QueryPageComponent;
|
|
211
|
-
ResultsView: ResultsViewComponent;
|
|
212
|
-
fireQuery: FireQuery;
|
|
213
|
-
parseQuery: ParseQuery;
|
|
214
|
-
conditionToDatalog: ConditionToDatalog;
|
|
215
|
-
getConditionLabels: () => string[];
|
|
216
|
-
registerDatalogTranslator: RegisterDatalogTranslator;
|
|
217
|
-
unregisterDatalogTranslator: (args: {
|
|
218
|
-
key: string;
|
|
219
|
-
}) => void;
|
|
220
|
-
registerSelection: RegisterSelection;
|
|
221
208
|
runQuery: RunQuery;
|
|
222
209
|
listActiveQueries: ListActiveQueries;
|
|
223
210
|
};
|
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":";;;AAiBA,mDAAyB"}
|
package/types/query-builder.d.ts
CHANGED
|
@@ -1,122 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { DatalogClause, PullBlock, RoamBasicNode } from "./native";
|
|
3
|
-
import type { Filters } from "../components/Filter";
|
|
4
|
-
declare type QBBase = {
|
|
5
|
-
uid: string;
|
|
6
|
-
};
|
|
7
|
-
export declare type QBClauseData = {
|
|
8
|
-
relation: string;
|
|
9
|
-
source: string;
|
|
10
|
-
target: string;
|
|
11
|
-
not?: boolean;
|
|
12
|
-
} & QBBase;
|
|
13
|
-
export declare type QBNestedData = {
|
|
14
|
-
conditions: Condition[][];
|
|
15
|
-
} & QBBase;
|
|
16
|
-
export declare type QBClause = QBClauseData & {
|
|
17
|
-
type: "clause";
|
|
18
|
-
};
|
|
19
|
-
export declare type QBNot = QBClauseData & {
|
|
20
|
-
type: "not";
|
|
21
|
-
};
|
|
22
|
-
export declare type QBOr = QBNestedData & {
|
|
23
|
-
type: "or";
|
|
24
|
-
};
|
|
25
|
-
export declare type QBNor = QBNestedData & {
|
|
26
|
-
type: "not or";
|
|
27
|
-
};
|
|
28
|
-
export declare type Condition = QBClause | QBNot | QBOr | QBNor;
|
|
29
|
-
export declare type Selection = {
|
|
30
|
-
text: string;
|
|
31
|
-
label: string;
|
|
32
|
-
uid: string;
|
|
33
|
-
};
|
|
34
|
-
export declare type ExportTypes = {
|
|
35
|
-
name: string;
|
|
36
|
-
callback: (args: {
|
|
37
|
-
filename: string;
|
|
38
|
-
graph: string;
|
|
39
|
-
isBackendEnabled: boolean;
|
|
40
|
-
}) => Promise<{
|
|
41
|
-
title: string;
|
|
42
|
-
content: string;
|
|
43
|
-
}[]>;
|
|
44
|
-
}[];
|
|
45
|
-
export declare type RegisterSelection = (args: {
|
|
46
|
-
test: RegExp;
|
|
47
|
-
pull: (a: {
|
|
48
|
-
returnNode: string;
|
|
49
|
-
match: RegExpExecArray;
|
|
50
|
-
where: DatalogClause[];
|
|
51
|
-
}) => string;
|
|
52
|
-
mapper: (r: PullBlock, key: string, result: Result) => Result[string] | Record<string, Result[string]> | Promise<Result[string] | Record<string, Result[string]>>;
|
|
53
|
-
}) => void;
|
|
54
|
-
export declare type ResultsViewComponent = (props: {
|
|
55
|
-
parentUid: string;
|
|
56
|
-
header?: React.ReactNode;
|
|
57
|
-
results: Result[];
|
|
58
|
-
hideResults?: boolean;
|
|
59
|
-
resultFilter?: (r: Result) => boolean;
|
|
60
|
-
ctrlClick?: (e: Result) => void;
|
|
61
|
-
preventSavingSettings?: boolean;
|
|
62
|
-
preventExport?: boolean;
|
|
63
|
-
onEdit?: () => void;
|
|
64
|
-
onRefresh?: () => void;
|
|
65
|
-
getExportTypes?: (r: Result[]) => ExportTypes;
|
|
66
|
-
onResultsInViewChange?: (r: Result[]) => void;
|
|
67
|
-
globalFiltersData?: Record<string, Filters>;
|
|
68
|
-
globalPageSize?: number;
|
|
69
|
-
}) => JSX.Element;
|
|
70
|
-
export declare type ExportDialogComponent = (props: {
|
|
71
|
-
onClose: () => void;
|
|
72
|
-
isOpen: boolean;
|
|
73
|
-
exportTypes: ExportTypes;
|
|
74
|
-
results: Result[] | ((isBackendEnabled: boolean) => Promise<Result[]>);
|
|
75
|
-
}) => JSX.Element;
|
|
76
|
-
export declare type QueryEditorComponent = (props: {
|
|
77
|
-
parentUid: string;
|
|
78
|
-
onQuery?: () => void;
|
|
79
|
-
defaultReturnNode?: string;
|
|
80
|
-
}) => JSX.Element;
|
|
81
|
-
export declare type QueryPageComponent = (props: {
|
|
82
|
-
pageUid: string;
|
|
83
|
-
configUid?: string;
|
|
84
|
-
defaultReturnNode?: string;
|
|
85
|
-
getExportTypes?: (r: Result[]) => ExportTypes;
|
|
86
|
-
globalFiltersData?: Record<string, Filters>;
|
|
87
|
-
globalPageSize?: number;
|
|
88
|
-
hideMetadata?: boolean;
|
|
89
|
-
}) => JSX.Element;
|
|
90
|
-
export declare type ParseQuery = (q: RoamBasicNode | string) => {
|
|
91
|
-
returnNode: string;
|
|
92
|
-
conditions: Condition[];
|
|
93
|
-
selections: Selection[];
|
|
94
|
-
customNode: string;
|
|
95
|
-
returnNodeUid: string;
|
|
96
|
-
conditionsNodesUid: string;
|
|
97
|
-
selectionsNodesUid: string;
|
|
98
|
-
customNodeUid: string;
|
|
99
|
-
isCustomEnabled: boolean;
|
|
100
|
-
isBackendEnabled: boolean;
|
|
101
|
-
};
|
|
102
|
-
export declare type FireQuery = (query: {
|
|
103
|
-
returnNode: string;
|
|
104
|
-
conditions: Condition[];
|
|
105
|
-
selections: Selection[];
|
|
106
|
-
isBackendEnabled: boolean;
|
|
107
|
-
}) => Promise<Result[]>;
|
|
108
|
-
export declare type ConditionToDatalog = (condition: Condition) => DatalogClause[];
|
|
109
|
-
export declare type RegisterDatalogTranslator = (args: {
|
|
110
|
-
key: string;
|
|
111
|
-
callback: (args: {
|
|
112
|
-
source: string;
|
|
113
|
-
target: string;
|
|
114
|
-
uid: string;
|
|
115
|
-
}) => DatalogClause[];
|
|
116
|
-
targetOptions?: string[] | ((source: string) => string[]);
|
|
117
|
-
placeholder?: string;
|
|
118
|
-
isVariable?: true;
|
|
119
|
-
}) => void;
|
|
120
1
|
export declare type Result = {
|
|
121
2
|
text: string;
|
|
122
3
|
uid: string;
|
|
@@ -125,4 +6,3 @@ export declare type RunQuery = (parentUid: string) => Promise<Result[]>;
|
|
|
125
6
|
export declare type ListActiveQueries = () => {
|
|
126
7
|
uid: string;
|
|
127
8
|
}[];
|
|
128
|
-
export {};
|
package/types/smartblocks.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare type RegisterCommand = (args: {
|
|
|
27
27
|
help?: string;
|
|
28
28
|
handler: (c: Pick<SmartBlocksContext, "targetUid" | "variables"> & {
|
|
29
29
|
proccessBlockText: (s: string) => Promise<InputTextNode[]>;
|
|
30
|
+
processBlock: (s: InputTextNode) => Promise<InputTextNode[]>;
|
|
30
31
|
}) => CommandHandler;
|
|
31
32
|
delayArgs?: true;
|
|
32
33
|
}) => () => void;
|