roamjs-components 0.63.0 → 0.63.1

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.
@@ -1,3 +1,3 @@
1
- import { FieldPanel, CustomField } from "./types";
1
+ import type { FieldPanel, CustomField } from "./types";
2
2
  declare const CustomPanel: FieldPanel<CustomField>;
3
3
  export default CustomPanel;
@@ -3,20 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const core_1 = require("@blueprintjs/core");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
- const util_1 = require("../../util");
7
- const writes_1 = require("../../writes");
6
+ const idToTitle_1 = tslib_1.__importDefault(require("../../util/idToTitle"));
7
+ const createBlock_1 = tslib_1.__importDefault(require("../../writes/createBlock"));
8
8
  const Description_1 = tslib_1.__importDefault(require("../Description"));
9
9
  const CustomPanel = ({ description, title, uid: inputUid, options: { component: Component }, parentUid, defaultValue = [], order, }) => {
10
10
  const uid = (0, react_1.useMemo)(() => {
11
11
  if (inputUid)
12
12
  return inputUid;
13
13
  const newUid = window.roamAlphaAPI.util.generateUID();
14
- (0, writes_1.createBlock)({ node: { text: title, uid: newUid }, parentUid, order });
14
+ (0, createBlock_1.default)({ node: { text: title, uid: newUid }, parentUid, order });
15
15
  return newUid;
16
16
  }, [inputUid]);
17
17
  return (react_1.default.createElement(react_1.default.Fragment, null,
18
18
  react_1.default.createElement(core_1.Label, null,
19
- (0, util_1.idToTitle)(title),
19
+ (0, idToTitle_1.default)(title),
20
20
  react_1.default.createElement(Description_1.default, { description: description })),
21
21
  react_1.default.createElement(Component, { uid: uid, parentUid: parentUid, title: title, defaultValue: defaultValue })));
22
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CustomPanel.js","sourceRoot":"","sources":["../../src/components/ConfigPanels/CustomPanel.tsx"],"names":[],"mappings":";;;AAAA,4CAA0C;AAC1C,uDAAuC;AACvC,qCAAuC;AACvC,yCAA2C;AA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,EAAE,EACjC,SAAS,EACT,YAAY,GAAG,EAAE,EACjB,KAAK,GACN,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QACvB,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QACtD,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QACtE,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,CACL;QACE,8BAAC,YAAK;YACH,IAAA,mBAAS,EAAC,KAAK,CAAC;YACjB,8BAAC,qBAAW,IAAC,WAAW,EAAE,WAAW,GAAI,CACnC;QACR,8BAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,GAC1B,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,IAAI,GAAG,QAAQ,CAAC;AAE5B,kBAAe,WAAW,CAAC"}
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.63.0",
4
+ "version": "0.63.1",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -54,8 +54,8 @@
54
54
  "date-fns": "^2.27.0",
55
55
  "fuzzy": "^0.1.3",
56
56
  "hast-util-to-html": "^7.1.3",
57
- "mobile-device-detect": "^0.4.3",
58
57
  "refractor": "^3.3.1",
58
+ "ua-parser-js": "^1.0.2",
59
59
  "xregexp": "^5.0.1"
60
60
  },
61
61
  "devDependencies": {
@@ -73,6 +73,7 @@
73
73
  "@types/react": "^17.0.9",
74
74
  "@types/react-dom": "^17.0.6",
75
75
  "@types/refractor": "^3.0.2",
76
+ "@types/ua-parser-js": "^0.7.36",
76
77
  "@typescript-eslint/eslint-plugin": "^5.27.1",
77
78
  "@typescript-eslint/parser": "^5.27.1",
78
79
  "@vercel/ncc": "^0.28.6",
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require(".");
4
- const getFirstChildUidByBlockUid = (blockUid) => (0, _1.getNthChildUidByBlockUid)({ blockUid, order: 0 });
3
+ const tslib_1 = require("tslib");
4
+ const getNthChildUidByBlockUid_1 = tslib_1.__importDefault(require("./getNthChildUidByBlockUid"));
5
+ const getFirstChildUidByBlockUid = (blockUid) => (0, getNthChildUidByBlockUid_1.default)({ blockUid, order: 0 });
5
6
  exports.default = getFirstChildUidByBlockUid;
6
7
  //# sourceMappingURL=getFirstChildUidByBlockUid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFirstChildUidByBlockUid.js","sourceRoot":"","sources":["../src/queries/getFirstChildUidByBlockUid.ts"],"names":[],"mappings":";;AAAA,wBAA6C;AAE7C,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC9D,IAAA,2BAAwB,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AAEnD,kBAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"getFirstChildUidByBlockUid.js","sourceRoot":"","sources":["../src/queries/getFirstChildUidByBlockUid.ts"],"names":[],"mappings":";;;AAAA,kGAAkE;AAElE,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC9D,IAAA,kCAAwB,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AAEnD,kBAAe,0BAA0B,CAAC"}
package/util/isControl.js CHANGED
@@ -1,7 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const mobile_device_detect_1 = require("mobile-device-detect");
4
- const isApple = mobile_device_detect_1.isIOS || mobile_device_detect_1.isMacOs;
3
+ const tslib_1 = require("tslib");
4
+ const ua_parser_js_1 = tslib_1.__importDefault(require("ua-parser-js"));
5
+ const UA = new ua_parser_js_1.default();
6
+ const os = UA.getOS();
7
+ const getNavigatorInstance = () => {
8
+ if (typeof window !== "undefined") {
9
+ if (window.navigator || navigator) {
10
+ return window.navigator || navigator;
11
+ }
12
+ }
13
+ return false;
14
+ };
15
+ const isIOS13Check = () => {
16
+ const type = "iPad";
17
+ const nav = getNavigatorInstance();
18
+ return (nav &&
19
+ nav.platform &&
20
+ (nav.platform.indexOf(type) !== -1 ||
21
+ (nav.platform === "MacIntel" && nav.maxTouchPoints > 1)));
22
+ };
23
+ const isIOS = os.name === "iOS" || isIOS13Check();
24
+ const isMacOs = os.name === "Mac OS";
25
+ const isApple = isIOS || isMacOs;
5
26
  const isControl = (e) => (e.ctrlKey && !isApple) || (e.metaKey && isApple);
6
27
  exports.default = isControl;
7
28
  //# sourceMappingURL=isControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isControl.js","sourceRoot":"","sources":["../src/util/isControl.ts"],"names":[],"mappings":";;AAAA,+DAAsD;AAEtD,MAAM,OAAO,GAAG,4BAAK,IAAI,8BAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,CAAC,CAA6B,EAAW,EAAE,CAC3D,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;AAEpD,kBAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"isControl.js","sourceRoot":"","sources":["../src/util/isControl.ts"],"names":[],"mappings":";;;AAAA,wEAAkC;AAElC,MAAM,EAAE,GAAG,IAAI,sBAAM,EAAE,CAAC;AACxB,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC;AAEtB,MAAM,o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