roamjs-components 0.34.1 → 0.35.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.34.1",
4
+ "version": "0.35.0",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  import type { InputTextNode } from "../types";
2
- declare const createPage: ({ title, tree, }: {
2
+ declare const createPage: ({ title, tree, uid, }: {
3
3
  title: string;
4
4
  tree?: InputTextNode[] | undefined;
5
+ uid?: string | undefined;
5
6
  }) => string;
6
7
  export default createPage;
@@ -2,10 +2,9 @@ import createBlock from "./createBlock";
2
2
  import { DAILY_NOTE_PAGE_TITLE_REGEX } from "../date";
3
3
  import toRoamDateUid from "../date/toRoamDateUid";
4
4
  import parseRoamDate from "../date/parseRoamDate";
5
- const createPage = ({ title, tree = [], }) => {
6
- const uid = DAILY_NOTE_PAGE_TITLE_REGEX.test(title)
7
- ? toRoamDateUid(parseRoamDate(title))
8
- : window.roamAlphaAPI.util.generateUID();
5
+ const createPage = ({ title, tree = [], uid = DAILY_NOTE_PAGE_TITLE_REGEX.test(title)
6
+ ? toRoamDateUid(parseRoamDate(title))
7
+ : window.roamAlphaAPI.util.generateUID(), }) => {
9
8
  window.roamAlphaAPI.createPage({ page: { title, uid } });
10
9
  tree.forEach((node, order) => createBlock({ node, parentUid: uid, order }));
11
10
  return uid;
@@ -1 +1 @@
1
- {"version":3,"file":"createPage.js","sourceRoot":"","sources":["../src/writes/createPage.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAClD,OAAO,aAAa,MAAM,uBAAuB,CAAC;AAElD,MAAM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