roamjs-components 0.82.7 → 0.82.9

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.82.7",
4
+ "version": "0.82.9",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const getPageUidByPageTitle = (title) => {
4
4
  var _a;
5
- return ((_a = window.roamAlphaAPI.pull("[:block/uid]", [":node/title", title])) === null || _a === void 0 ? void 0 : _a[":block/uid"]) || "";
5
+ if (!title)
6
+ return "";
7
+ return (((_a = window.roamAlphaAPI.pull("[:block/uid]", [":node/title", title])) === null || _a === void 0 ? void 0 : _a[":block/uid"]) || "");
6
8
  };
7
9
  exports.default = getPageUidByPageTitle;
8
10
  //# sourceMappingURL=getPageUidByPageTitle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPageUidByPageTitle.js","sourceRoot":"","sources":["../../src/queries/getPageUidByPageTitle.ts"],"names":[],"mappings":";;AAAA,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAU,EAAE;;IACtD,OAAA,CAAA,MAAA,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,0CAC9D,YAAY,CACb,KAAI,EAAE,CAAA;CAAA,CAAC;AAEV,kBAAe,qBAAqB,CAAC","sourcesContent":["const getPageUidByPageTitle = (title: string): string =>\n window.roamAlphaAPI.pull(\"[:block/uid]\", [\":node/title\", title])?.[\n \":block/uid\"\n ] || \"\";\n\nexport default getPageUidByPageTitle;\n"]}
1
+ {"version":3,"file":"getPageUidByPageTitle.js","sourceRoot":"","sources":["../../src/queries/getPageUidByPageTitle.ts"],"names":[],"mappings":";;AAAA,MAAM,qBAAqB,GAAG,CAAC,KAAa,EAAU,EAAE;;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,CACL,CAAA,MAAA,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,0CAC9D,YAAY,CACb,KAAI,EAAE,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,qBAAqB,CAAC","sourcesContent":["const getPageUidByPageTitle = (title: string): string => {\n if (!title) return \"\";\n return (\n window.roamAlphaAPI.pull(\"[:block/uid]\", [\":node/title\", title])?.[\n \":block/uid\"\n ] || \"\"\n );\n};\n\nexport default getPageUidByPageTitle;\n"]}
@@ -0,0 +1,3 @@
1
+ import { InputTextNode, RoamBasicNode } from "../types";
2
+ declare const stripUid: (n: RoamBasicNode[]) => InputTextNode[];
3
+ export default stripUid;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const stripUid = (n) => {
5
+ return n.map((_a) => {
6
+ var { uid: _uid, children } = _a, c = tslib_1.__rest(_a, ["uid", "children"]);
7
+ return (Object.assign(Object.assign({}, c), { children: stripUid(children) }));
8
+ });
9
+ };
10
+ exports.default = stripUid;
11
+ //# sourceMappingURL=stripUid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripUid.js","sourceRoot":"","sources":["../../src/util/stripUid.ts"],"names":[],"mappings":";;;AAEA,MAAM,QAAQ,GAAG,CAAC,CAAkB,EAAmB,EAAE;IACvD,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,EAA6B,EAAE,EAAE;YAAjC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,OAAQ,EAAH,CAAC,sBAA3B,mBAA6B,CAAF;QAAO,OAAA,iCAC3C,CAAC,KACJ,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAC5B,CAAA;KAAA,CAAC,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC","sourcesContent":["import { InputTextNode, RoamBasicNode } from \"../types\";\n\nconst stripUid = (n: RoamBasicNode[]): InputTextNode[] => {\n return n.map(({ uid: _uid, children, ...c }) => ({\n ...c,\n children: stripUid(children),\n }));\n};\n\nexport default stripUid;\n"]}