roamjs-components 0.76.0 → 0.76.2

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 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.0",
4
+ "version": "0.76.2",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -10,7 +10,6 @@
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
14
  "prestart:new": "node scripts/build.js",
16
15
  "start:new": "http-server -p 8000 build",
@@ -46,6 +45,8 @@
46
45
  "tslib": "2.2.0"
47
46
  },
48
47
  "dependencies": {
48
+ "@samepage/scripts": "^0.56.7",
49
+ "@testing-library/react": "^12.1.5",
49
50
  "aws-sdk-plus": "^0.5.3",
50
51
  "color": "^4.0.1",
51
52
  "date-fns": "^2.27.0",
@@ -53,13 +54,10 @@
53
54
  "fuzzy": "^0.1.3",
54
55
  "hast-util-to-html": "^7.1.3",
55
56
  "refractor": "^3.3.1",
56
- "roamjs-scripts": "^0.26.23",
57
57
  "xregexp": "^5.0.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@esbuild-plugins/node-modules-polyfill": "^0.1.4",
61
- "@testing-library/react": "^11.2.7",
62
- "@testing-library/user-event": "^13.1.9",
63
61
  "@types/aws-lambda": "^8.10.89",
64
62
  "@types/color": "^3.0.2",
65
63
  "@types/mime-types": "^2.1.1",
package/scripts/index.js CHANGED
@@ -23,6 +23,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  __setModuleDefault(result, mod);
24
24
  return result;
25
25
  };
26
- process.argv.push("--labs");
27
- Promise.resolve().then(() => __importStar(require("roamjs-scripts")));
26
+ Promise.resolve().then(() => __importStar(require("@samepage/scripts/cli")));
28
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scripts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC5B,kDAAO,gBAAgB,IAAE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scripts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAO,uBAAuB,IAAE"}
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AddPullWatch, PullBlock, SidebarAction, SidebarWindow, SidebarWindowInput, WriteAction } from "./native";
2
- import { RegisterSelection, ParseQuery, FireQuery, ConditionToDatalog, RegisterDatalogTranslator, ResultsViewComponent, QueryEditorComponent, ExportDialogComponent, QueryPageComponent, RunQuery, ListActiveQueries } from "./query-builder";
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
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AA0BA,mDAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAiBA,mDAAyB"}
@@ -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 {};
@@ -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;
package/util/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Some developers may use roamjs-components without roamjs-scripts, in which case
2
+ // Some developers may use roamjs-components without RoamJS scripting, in which case
3
3
  // envs wont be interpolated. best way to deal with that afaik is to try to get the value
4
4
  // catch defaulting to a known value
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
package/util/env.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/util/env.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAClF,yFAAyF;AACzF,oCAAoC;;;AAEpC,wFAAwF;AACxF,0BAA0B;AAEnB,MAAM,UAAU,GAAG,CAAC,YAAY,GAAG,YAAY,EAAE,EAAE;IACxD,IAAI;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,YAAY,CAAC;KAC7C;IAAC,WAAM;QACN,OAAO,YAAY,CAAC;KACrB;AACH,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEK,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,IAAI;QACF,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAA,kBAAU,EAAC,EAAE,CAAC,CAAC;KAC5E;IAAC,WAAM;QACN,OAAO,IAAA,kBAAU,EAAC,EAAE,CAAC,CAAC;KACvB;AACH,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,MAAM,YAAY,GAChB,IAAA,kBAAU,GAAE,KAAK,YAAY;QAC3B,CAAC,CAAC,2BAA2B;QAC7B,CAAC,CAAC,uBAAuB,CAAC;IAC9B,IAAI;QAC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