roamjs-components 0.74.20 → 0.74.21
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,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const sortBasicNodes = (c) => c
|
|
5
|
-
.sort((
|
|
6
|
-
.map((
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
.sort((a, b) => (a[":block/order"] || 0) - (b[":block/order"] || 0))
|
|
5
|
+
.map((node) => ({
|
|
6
|
+
children: sortBasicNodes(node[":block/children"] || []),
|
|
7
|
+
uid: node[":block/uid"] || "",
|
|
8
|
+
text: node[":block/string"] || "",
|
|
9
|
+
}));
|
|
10
|
+
const getBasicTreeByParentUid = (uid) => sortBasicNodes(window.roamAlphaAPI.data.fast
|
|
11
|
+
.q(`[:find (pull ?c [:block/string :block/uid :block/order {:block/children ...}]) :where [?b :block/uid "${uid}"] [?b :block/children ?c]]`)
|
|
12
12
|
.map((a) => a[0]));
|
|
13
13
|
exports.default = getBasicTreeByParentUid;
|
|
14
14
|
//# sourceMappingURL=getBasicTreeByParentUid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBasicTreeByParentUid.js","sourceRoot":"","sources":["../../src/queries/getBasicTreeByParentUid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBasicTreeByParentUid.js","sourceRoot":"","sources":["../../src/queries/getBasicTreeByParentUid.ts"],"names":[],"mappings":";;AAEA,MAAM,cAAc,GAAG,CAAC,CAAc,EAAmB,EAAE,CACzD,CAAC;KACE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;KACnE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;IACvD,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IAC7B,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;CAClC,CAAC,CAAC,CAAC;AAER,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAmB,EAAE,CAC/D,cAAc,CACZ,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI;KAC1B,CAAC,CACA,yGAAyG,GAAG,6BAA6B,CAC1I;KACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAc,CAAC,CACjC,CAAC;AAEJ,kBAAe,uBAAuB,CAAC"}
|
package/types/native.d.ts
CHANGED
|
@@ -100,12 +100,6 @@ export declare type RoamBasicNode = {
|
|
|
100
100
|
uid: string;
|
|
101
101
|
children: RoamBasicNode[];
|
|
102
102
|
};
|
|
103
|
-
export declare type RoamUnorderedBasicNode = {
|
|
104
|
-
text: string;
|
|
105
|
-
uid: string;
|
|
106
|
-
order: number;
|
|
107
|
-
children?: RoamUnorderedBasicNode[];
|
|
108
|
-
};
|
|
109
103
|
export declare type RoamPull = {
|
|
110
104
|
"block/children"?: RoamNode[];
|
|
111
105
|
"block/heading"?: number;
|
|
@@ -125,9 +119,9 @@ export declare type RoamPull = {
|
|
|
125
119
|
"node/title"?: string;
|
|
126
120
|
} & RoamNode;
|
|
127
121
|
export declare type PullBlock = {
|
|
128
|
-
":block/children"?: {
|
|
122
|
+
":block/children"?: ({
|
|
129
123
|
":db/id": number;
|
|
130
|
-
}[];
|
|
124
|
+
} | PullBlock)[];
|
|
131
125
|
":block/heading"?: number;
|
|
132
126
|
":block/open"?: boolean;
|
|
133
127
|
":block/order"?: number;
|