roamjs-components 0.49.6 → 0.50.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "roamjs-components",
3
3
  "description": "Description for roamjs-components",
4
- "version": "0.49.6",
4
+ "version": "0.50.0",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -0,0 +1,5 @@
1
+ declare const getAttributeValueByBlockAndName: ({ name, uid, }: {
2
+ name: string;
3
+ uid: string;
4
+ }) => any;
5
+ export default getAttributeValueByBlockAndName;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
+ const getAttributeValueByBlockAndName = ({ name, uid, }) => {
6
+ var _a, _b, _c;
7
+ return (((_c = (_b = (_a = window.roamAlphaAPI.q(`[:find (pull ?b [:block/string]) :where [?a :node/title "${(0, normalizePageTitle_1.default)(name)}"] [?p :block/uid "${uid}"] [?b :block/refs ?a] [?b :block/page ?p]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.string) || "")
8
+ .slice(name.length + 2)
9
+ .trim();
10
+ };
11
+ exports.default = getAttributeValueByBlockAndName;
12
+ //# sourceMappingURL=getAttributeValueByBlockAndName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAttributeValueByBlockAndName.js","sourceRoot":"","sources":["../src/queries/getAttributeValueByBlockAndName.ts"],"names":[],"mappings":";;;AAAA,2FAAsD;AAEtD,MAAM,+BAA+B,GAAG,CAAC,EACvC,IAAI,EACJ,GAAG,GAIJ,EAAE,EAAE;;IACH,OAAA,CACE,CAAA,MAAA,MAAA,MAAA,MAAM,CAAC,YAAY,CAAC,CAAC,CACnB,4DAA4D,IAAA,4BAAkB,EAC5E,IAAI,CACL,sBAAsB,GAAG,6CAA6C,CACxE,0CAAG,CAAC,CAAC,0CAAG,CAAC,CAAC,0CAAE,MAAM,KAAI,EAAE,CAC1B;SACE,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;SACtB,IAAI,EAAE,CAAA;CAAA,CAAC;AAEZ,kBAAe,+BAA+B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { default as getAllBlockUids } from "./getAllBlockUids";
2
2
  export { default as getAllBlockUidsAndTexts } from "./getAllBlockUidsAndTexts";
3
3
  export { default as getAllPageNames } from "./getAllPageNames";
4
+ export { default as getAttributeValueByBlockAndName } from "./getAttributeValueByBlockAndName";
4
5
  export { default as getBasicTreeByParentUid } from "./getBasicTreeByParentUid";
5
6
  export { default as getBlockUidAndTextIncludingText } from "./getBlockUidAndTextIncludingText";
6
7
  export { default as getBlockUidByTextOnPage } from "./getBlockUidByTextOnPage";
package/queries/index.js CHANGED
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.normalizePageTitle = exports.isTagOnPage = exports.getTextByBlockUid = exports.getShallowTreeByParentUid = exports.getSettingsByEmail = exports.getParentUidsOfBlockUid = exports.getParentUidByBlockUid = exports.getParentTextByBlockUidAndTag = exports.getParentTextByBlockUid = exports.getPageViewType = exports.getPageUidByPageTitle = exports.getPageTitleByPageUid = exports.getPageTitlesStartingWithPrefix = exports.getPageTitlesReferencingBlockUid = exports.getPageTitleReferencesByPageTitle = exports.getPageTitlesAndUidsDirectlyReferencingPage = exports.getPageTitlesAndBlockUidsReferencingPage = exports.getPageTitleByBlockUid = exports.getOrderByBlockUid = exports.getNthChildUidByBlockUid = exports.getLinkedPageTitlesUnderUid = exports.getFullTreeByParentUid = exports.getEditedUserEmailByBlockUid = exports.getEditTimeByBlockUid = exports.getDisplayNameByUid = exports.getDisplayNameByEmail = exports.getCreateTimeByBlockUid = exports.getFirstChildUidByBlockUid = exports.getFirstChildTextByBlockUid = exports.getCurrentUserUid = exports.getCurrentUserEmail = exports.getCurrentUserDisplayName = exports.getChildrenLengthByPageUid = exports.getBlockUidsWithParentUid = exports.getBlockUidsReferencingPage = exports.getBlockUidsReferencingBlock = exports.getBlockUidsByPageTitle = exports.getBlockUidsAndTextsReferencingPage = exports.getBlockUidByTextOnPage = exports.getBlockUidAndTextIncludingText = exports.getBasicTreeByParentUid = exports.getAllPageNames = exports.getAllBlockUidsAndTexts = exports.getAllBlockUids = void 0;
6
+ exports.normalizePageTitle = exports.isTagOnPage = exports.getTextByBlockUid = exports.getShallowTreeByParentUid = exports.getSettingsByEmail = exports.getParentUidsOfBlockUid = exports.getParentUidByBlockUid = exports.getParentTextByBlockUidAndTag = exports.getParentTextByBlockUid = exports.getPageViewType = exports.getPageUidByPageTitle = exports.getPageTitleByPageUid = exports.getPageTitlesStartingWithPrefix = exports.getPageTitlesReferencingBlockUid = exports.getPageTitleReferencesByPageTitle = exports.getPageTitlesAndUidsDirectlyReferencingPage = exports.getPageTitlesAndBlockUidsReferencingPage = exports.getPageTitleByBlockUid = exports.getOrderByBlockUid = exports.getNthChildUidByBlockUid = exports.getLinkedPageTitlesUnderUid = exports.getFullTreeByParentUid = exports.getEditedUserEmailByBlockUid = exports.getEditTimeByBlockUid = exports.getDisplayNameByUid = exports.getDisplayNameByEmail = exports.getCreateTimeByBlockUid = exports.getFirstChildUidByBlockUid = exports.getFirstChildTextByBlockUid = exports.getCurrentUserUid = exports.getCurrentUserEmail = exports.getCurrentUserDisplayName = exports.getChildrenLengthByPageUid = exports.getBlockUidsWithParentUid = exports.getBlockUidsReferencingPage = exports.getBlockUidsReferencingBlock = exports.getBlockUidsByPageTitle = exports.getBlockUidsAndTextsReferencingPage = exports.getBlockUidByTextOnPage = exports.getBlockUidAndTextIncludingText = exports.getBasicTreeByParentUid = exports.getAttributeValueByBlockAndName = exports.getAllPageNames = exports.getAllBlockUidsAndTexts = exports.getAllBlockUids = void 0;
7
7
  var getAllBlockUids_1 = require("./getAllBlockUids");
8
8
  Object.defineProperty(exports, "getAllBlockUids", { enumerable: true, get: function () { return __importDefault(getAllBlockUids_1).default; } });
9
9
  var getAllBlockUidsAndTexts_1 = require("./getAllBlockUidsAndTexts");
10
10
  Object.defineProperty(exports, "getAllBlockUidsAndTexts", { enumerable: true, get: function () { return __importDefault(getAllBlockUidsAndTexts_1).default; } });
11
11
  var getAllPageNames_1 = require("./getAllPageNames");
12
12
  Object.defineProperty(exports, "getAllPageNames", { enumerable: true, get: function () { return __importDefault(getAllPageNames_1).default; } });
13
+ var getAttributeValueByBlockAndName_1 = require("./getAttributeValueByBlockAndName");
14
+ Object.defineProperty(exports, "getAttributeValueByBlockAndName", { enumerable: true, get: function () { return __importDefault(getAttributeValueByBlockAndName_1).default; } });
13
15
  var getBasicTreeByParentUid_1 = require("./getBasicTreeByParentUid");
14
16
  Object.defineProperty(exports, "getBasicTreeByParentUid", { enumerable: true, get: function () { return __importDefault(getBasicTreeByParentUid_1).default; } });
15
17
  var getBlockUidAndTextIncludingText_1 = require("./getBlockUidAndTextIncludingText");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/queries/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,qDAA+D;AAAtD,mIAAA,OAAO,OAAmB;AACnC,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,qFAA+F;AAAtF,mKAAA,OAAO,OAAmC;AACnD,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,6FAAuG;AAA9F,2KAAA,OAAO,OAAuC;AACvD,qEAA+E;AAAtE,mJAAA,OAAO,OAA2B;AAC3C,+EAAyF;AAAhF,6JAAA,OAAO,OAA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