roamjs-components 0.77.22 → 0.77.23
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
package/writes/createBlock.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputTextNode, ActionParams } from "../types";
|
|
2
|
-
export declare const gatherActions: ({ node: { text, children, uid, heading, viewType, textAlign, open, }, parentUid, order, }: {
|
|
2
|
+
export declare const gatherActions: ({ node: { text, children, uid, heading, viewType, textAlign, open, props, }, parentUid, order, }: {
|
|
3
3
|
node: InputTextNode;
|
|
4
4
|
parentUid: string;
|
|
5
5
|
order?: number | undefined;
|
package/writes/createBlock.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.gatherActions = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const submitActions_1 = tslib_1.__importDefault(require("./submitActions"));
|
|
6
|
-
const gatherActions = ({ node: { text, children = [], uid = window.roamAlphaAPI.util.generateUID(), heading, viewType, textAlign, open = true, }, parentUid, order = 0, }) => {
|
|
6
|
+
const gatherActions = ({ node: { text, children = [], uid = window.roamAlphaAPI.util.generateUID(), heading, viewType, textAlign, open = true, props, }, parentUid, order = 0, }) => {
|
|
7
7
|
return [
|
|
8
8
|
{
|
|
9
9
|
location: { "parent-uid": parentUid, order },
|
|
@@ -14,6 +14,7 @@ const gatherActions = ({ node: { text, children = [], uid = window.roamAlphaAPI.
|
|
|
14
14
|
"text-align": textAlign,
|
|
15
15
|
"children-view-type": viewType,
|
|
16
16
|
open,
|
|
17
|
+
props,
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
20
|
...children.flatMap((node, order) => (0, exports.gatherActions)({ node, parentUid: uid, order })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBlock.js","sourceRoot":"","sources":["../../src/writes/createBlock.ts"],"names":[],"mappings":";;;;A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MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC,CAC3D,CAAC,IAAI,CAAC,GAAG,EAAE,WAAC,OAAA,CAAA,MAAA,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,0CAAE,GAAG,KAAI,EAAE,CAAA,EAAA,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import type { InputTextNode, ActionParams } from \"../types\";\nimport submitActions from \"./submitActions\";\n\nexport const gatherActions = ({\n node: {\n text,\n children = [],\n uid = window.roamAlphaAPI.util.generateUID(),\n heading,\n viewType,\n textAlign,\n open = true,\n props,\n },\n parentUid,\n order = 0,\n}: {\n node: InputTextNode;\n parentUid: string;\n order?: number;\n}): ActionParams[] => {\n return [\n {\n location: { \"parent-uid\": parentUid, order },\n block: {\n uid,\n string: text,\n heading,\n \"text-align\": textAlign,\n \"children-view-type\": viewType,\n open,\n props,\n },\n },\n ...children.flatMap((node, order) =>\n gatherActions({ node, parentUid: uid, order })\n ),\n ];\n};\n\nconst createBlock = (\n params: Parameters<typeof gatherActions>[0]\n): Promise<string> => {\n const actions = gatherActions(params);\n return submitActions(\n actions.map((params) => ({ params, type: \"createBlock\" }))\n ).then(() => actions[0].block?.uid || \"\");\n};\n\nexport default createBlock;\n"]}
|