roamjs-components 0.77.18 → 0.77.20
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/types/native.d.ts
CHANGED
|
@@ -146,11 +146,13 @@ export declare type PullBlock = {
|
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
+
[k: `:roamjs-${string}`]: Record<string, unknown>;
|
|
149
150
|
};
|
|
150
151
|
":block/refs"?: {
|
|
151
152
|
":db/id": number;
|
|
152
153
|
}[];
|
|
153
154
|
":block/string"?: string;
|
|
155
|
+
":block/view-type"?: `:${BlockViewType}`;
|
|
154
156
|
":block/text-align"?: TextAlignment;
|
|
155
157
|
":block/uid"?: string;
|
|
156
158
|
":children/view-type"?: `:${ViewType}`;
|
|
@@ -185,6 +187,7 @@ export declare type PullBlock = {
|
|
|
185
187
|
};
|
|
186
188
|
export declare type RoamPullResult = RoamPull | null;
|
|
187
189
|
export declare type ViewType = "document" | "bullet" | "numbered";
|
|
190
|
+
export declare type BlockViewType = "tabs" | "outline" | "horizontal" | "popout" | "comment" | "side" | "vertical";
|
|
188
191
|
export declare type TextAlignment = "left" | "center" | "right" | "justify";
|
|
189
192
|
export declare type RoamBlock = {
|
|
190
193
|
attrs?: {
|
|
@@ -243,6 +246,7 @@ export declare type InputTextNode = {
|
|
|
243
246
|
textAlign?: TextAlignment;
|
|
244
247
|
viewType?: ViewType;
|
|
245
248
|
open?: boolean;
|
|
249
|
+
props?: Record<string, unknown>;
|
|
246
250
|
};
|
|
247
251
|
declare type PlusType = [number, string];
|
|
248
252
|
export declare type RoamNode = {
|
|
@@ -276,6 +280,7 @@ export declare type ActionParams = {
|
|
|
276
280
|
heading?: number;
|
|
277
281
|
"text-align"?: TextAlignment;
|
|
278
282
|
"children-view-type"?: ViewType;
|
|
283
|
+
props?: Record<string, unknown>;
|
|
279
284
|
};
|
|
280
285
|
page?: {
|
|
281
286
|
title?: string;
|
package/types/native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/types/native.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,4EAA4E","sourcesContent":["// emulating Datalog Grammar\n// https://docs.datomic.com/cloud/query/query-data-reference.html#or-clauses\n\nimport { ChangeEvent } from \"react\";\n\nexport type DatalogSrcVar = {\n type: \"src-var\";\n value: string;\n};\n\nexport type DatalogVariable = {\n type: \"variable\";\n value: string;\n};\n\nexport type DatalogAndClause = {\n type: \"and-clause\";\n clauses: DatalogClause[];\n};\n\nexport type DatalogExpressionClause =\n | DatalogDataPattern\n | DatalogPredExpr\n | DatalogFnExpr\n | DatalogRuleExpr;\n\nexport type DatalogRuleExpr = {\n type: \"rule-expr\";\n srcVar?: DatalogSrcVar;\n ruleName: DatalogRuleName;\n arguments: DatalogArgument[];\n};\n\nexport type DatalogNotClause = {\n type: \"not-clause\";\n srcVar?: DatalogSrcVar;\n clauses: DatalogClause[];\n};\n\nexport type DatalogNotJoinClause = {\n type: \"not-join-clause\";\n srcVar?: DatalogSrcVar;\n variables: DatalogVariable[];\n clauses: DatalogClause[];\n};\n\nexport type DatalogOrClause = {\n type: \"or-clause\";\n srcVar?: DatalogSrcVar;\n clauses: DatalogClause[];\n};\n\nexport type DatalogOrJoinClause = {\n type: \"or-join-clause\";\n srcVar?: DatalogSrcVar;\n variables: DatalogVariable[];\n clauses: DatalogClause[];\n};\n\nexport type DatalogClause =\n | DatalogNotClause\n | DatalogOrJoinClause\n | DatalogExpressionClause\n | DatalogOrClause\n | DatalogNotJoinClause\n | DatalogAndClause;\n\nexport type DatalogDataPattern = {\n type: \"data-pattern\";\n srcVar?: DatalogSrcVar;\n arguments: DatalogArgument[];\n};\n\nexport type DatalogArgument =\n | DatalogSrcVar\n | DatalogVariable\n | DatalogConstant\n | DatalogUnderscore;\n\nexport type DatalogConstant = {\n type: \"constant\";\n value: string;\n};\n\nexport type DatalogPredExpr = {\n type: \"pred-expr\";\n pred:\n | \"<\"\n | \">\"\n | \"re-matches\"\n | \"re-find\"\n | \"clojure.string/includes?\"\n | \"clojure.string/ends-with?\"\n | \"clojure.string/starts-with?\";\n arguments: DatalogArgument[];\n};\n\nexport type DatalogFnExpr = {\n type: \"fn-expr\";\n fn: \"re-pattern\";\n arguments: DatalogArgument[];\n binding: DatalogBinding;\n};\n\nexport type DatalogBinding =\n | DatalogBindScalar\n | DatalogBindTuple\n | DatalogBindColl\n | DatalogBindRel;\n\nexport type DatalogBindScalar = {\n type: \"bind-scalar\";\n variable: DatalogVariable;\n};\nexport type DatalogBindTuple = {\n type: \"bind-tuple\";\n args: (DatalogVariable | DatalogUnderscore)[];\n};\nexport type DatalogBindColl = {\n type: \"bind-col\";\n variable: DatalogVariable;\n};\n\nexport type DatalogBindRel = {\n type: \"bind-rel\";\n args: (DatalogVariable | DatalogUnderscore)[];\n};\n\nexport type DatalogUnderscore = {\n type: \"underscore\";\n value: \"_\";\n};\n\nexport type DatalogRuleName = {\n type: \"rulename\";\n value: string;\n};\n\nexport type RoamBasicBlock = {\n string: string;\n uid: string;\n};\n\nexport type RoamBasicPage = { title: string; uid: string };\n\nexport type RoamBasicNode = {\n text: string;\n uid: string;\n children: RoamBasicNode[];\n};\n\nexport type RoamPull = {\n \"block/children\"?: RoamNode[];\n \"block/heading\"?: number;\n \"block/open\"?: boolean;\n \"block/order\"?: number;\n \"block/page\"?: RoamNode;\n \"block/parents\"?: RoamNode[];\n \"block/refs\"?: RoamNode[];\n \"block/string\"?: string;\n \"block/uid\"?: string;\n \"children/view-type\"?: `:${ViewType}`;\n \"create/time\"?: number;\n \"create/user\"?: RoamNode;\n \"edit/time\"?: number;\n \"edit/user\"?: RoamNode;\n \"log/id\"?: number;\n \"node/title\"?: string;\n} & RoamNode;\n\nexport type PullBlock = {\n \":block/children\"?: ({ \":db/id\": number } | PullBlock)[];\n \":block/heading\"?: number;\n \":block/open\"?: boolean;\n \":block/order\"?: number;\n \":block/page\"?: { \":db/id\": number };\n \":block/parents\"?: { \":db/id\": number }[];\n \":block/props\"?: {\n \":image-size\"?: {\n [p: string]: {\n \":height\": number;\n \":width\": number;\n };\n };\n \":iframe\"?: {\n [p: string]: {\n \":size\": {\n \":height\": number;\n \":width\": number;\n };\n };\n };\n };\n \":block/refs\"?: { \":db/id\": number }[];\n \":block/string\"?: string;\n \":block/text-align\"?: TextAlignment;\n \":block/uid\"?: string;\n \":children/view-type\"?: `:${ViewType}`;\n \":create/time\"?: number;\n \":create/user\"?: { \":db/id\": number };\n \":edit/time\"?: number;\n \":edit/user\"?: { \":db/id\": number };\n \":db/id\"?: number;\n \":log/id\"?: number;\n \":node/title\"?: string;\n \":user/display-name\"?: string;\n \":user/display-page\"?: { \":db/id\": number };\n \":user/settings\"?: {\n \":namespace-options\": [\":none\", \":partial\", \":full\"];\n \":link-brackets?\": boolean;\n \":showing-inline-references?\": boolean;\n \":right-sidebar-pinned\": {\n [uuid: string]: SidebarWindow;\n };\n \":showing-own-icons?\": boolean;\n \":showing-user-icons?\": boolean;\n \":first-day-of-week\"?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n };\n \":user/uid\"?: string;\n \":user/email\"?: string;\n};\n\nexport type RoamPullResult = RoamPull | null;\n\nexport type ViewType = \"document\" | \"bullet\" | \"numbered\";\n\nexport type TextAlignment = \"left\" | \"center\" | \"right\" | \"justify\";\n\nexport type RoamBlock = {\n attrs?: { source: string[] }[][];\n children?: { id: number }[];\n id?: number;\n string?: string;\n title?: string;\n time?: number;\n uid?: string;\n order?: number;\n \"view-type\"?: ViewType;\n};\n\nexport type RoamError = {\n raw: string;\n \"status-code\": number;\n};\n\nexport type TreeNode = {\n text: string;\n order: number;\n children: TreeNode[];\n parents: number[];\n uid: string;\n heading: number;\n open: boolean;\n viewType: ViewType;\n editTime: Date;\n textAlign: TextAlignment;\n props: {\n imageResize: {\n [link: string]: {\n height: number;\n width: number;\n };\n };\n iframe: {\n [link: string]: {\n height: number;\n width: number;\n };\n };\n };\n};\n\nexport type TextNode = {\n text: string;\n children: TextNode[];\n};\n\nexport type InputTextNode = {\n text: string;\n children?: InputTextNode[];\n uid?: string;\n heading?: number;\n textAlign?: TextAlignment;\n viewType?: ViewType;\n open?: boolean;\n};\n\ntype PlusType = [number, string];\n\nexport type RoamNode = { \"db/id\": number };\n\nexport type RoamQuery = RoamPull & {\n \"block/graph\"?: RoamNode;\n \"node/graph+title\"?: PlusType;\n \"block/graph+uid\"?: PlusType;\n \"node/graph\"?: RoamNode;\n \"edit/email\"?: string;\n \"entity/graph\"?: RoamNode;\n};\n\nexport type RoamQueryResult = number & RoamQuery;\n\nexport type ClientParams = {\n action:\n | \"pull\"\n | \"q\"\n | \"create-block\"\n | \"update-block\"\n | \"create-page\"\n | \"move-block\"\n | \"delete-block\"\n | \"delete-page\"\n | \"update-page\";\n selector?: string;\n uid?: string;\n query?: string;\n inputs?: string[];\n} & ActionParams;\n\nexport type ActionParams = {\n location?: {\n \"parent-uid\": string;\n order: number;\n };\n block?: {\n string?: string;\n uid?: string;\n open?: boolean;\n heading?: number;\n \"text-align\"?: TextAlignment;\n \"children-view-type\"?: ViewType;\n };\n page?: {\n title?: string;\n uid?: string;\n };\n};\n\nexport type WriteAction = (a: ActionParams) => Promise<void>;\n\nexport type UserSettings = {\n \"global-filters\": {\n includes: string[];\n removes: string[];\n };\n};\n\ntype SidebarWindowType =\n | SidebarBlockWindow\n | SidebarMentionsWindow\n | SidebarGraphWindow\n | SidebarOutlineWindow;\n\nexport type SidebarWindowInput = {\n \"block-uid\": string;\n type: SidebarWindowType[\"type\"];\n};\n\ntype SidebarBlockWindow = {\n type: \"block\";\n \"block-uid\": string;\n};\n\ntype SidebarOutlineWindow = {\n type: \"outline\";\n \"page-uid\": string;\n};\n\ntype SidebarMentionsWindow = {\n type: \"mentions\";\n \"mentions-uid\": string;\n};\n\ntype SidebarGraphWindow = {\n type: \"graph\";\n // \"page-uid\": string; Currently not working despite documentation\n \"block-uid\": string;\n};\n\nexport type SidebarAction = (action: {\n window: SidebarWindowInput;\n}) => Promise<void>;\n\nexport type SidebarWindow = {\n \"collapsed?\": boolean;\n order: number;\n \"pinned?\": boolean;\n \"window-id\": string;\n} & SidebarWindowType;\n\nexport type AddPullWatch = (\n pullPattern: string,\n entityId: string,\n callback: (before: PullBlock | null, after: PullBlock | null) => void\n) => boolean;\n\ntype ButtonAction = {\n type: \"button\";\n onClick?: (e: MouseEvent) => void;\n content: string;\n};\n\ntype SwitchAction = {\n type: \"switch\";\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype InputAction = {\n type: \"input\";\n placeholder: string;\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype SelectAction = {\n type: \"select\";\n items: string[];\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype CustomAction = {\n type: \"reactComponent\";\n component: React.FC;\n};\n\nexport type Action =\n | ButtonAction\n | SwitchAction\n | InputAction\n | SelectAction\n | CustomAction;\n\ntype PanelConfig = {\n tabTitle: string;\n settings: {\n id: string;\n name: string;\n description: string;\n action: Action;\n }[];\n};\n\nexport type AddCommandOptions = {\n label: string;\n callback: () => void;\n disableHotkey?: boolean;\n defaultHotkey?: string | string[];\n};\n\ntype RemoveCommandOptions = {\n label: string;\n};\n\nexport type OnloadArgs = {\n extensionAPI: {\n settings: {\n get: (k: string) => unknown;\n getAll: () => Record<string, unknown>;\n panel: {\n create: (c: PanelConfig) => void;\n };\n set: (k: string, v: unknown) => Promise<void>;\n };\n ui: {\n commandPalette: {\n addCommand: (c: AddCommandOptions) => Promise<void>;\n removeCommand: (c: RemoveCommandOptions) => Promise<void>;\n };\n };\n };\n extension: {\n version: string;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../src/types/native.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,4EAA4E","sourcesContent":["// emulating Datalog Grammar\n// https://docs.datomic.com/cloud/query/query-data-reference.html#or-clauses\n\nimport { ChangeEvent } from \"react\";\n\nexport type DatalogSrcVar = {\n type: \"src-var\";\n value: string;\n};\n\nexport type DatalogVariable = {\n type: \"variable\";\n value: string;\n};\n\nexport type DatalogAndClause = {\n type: \"and-clause\";\n clauses: DatalogClause[];\n};\n\nexport type DatalogExpressionClause =\n | DatalogDataPattern\n | DatalogPredExpr\n | DatalogFnExpr\n | DatalogRuleExpr;\n\nexport type DatalogRuleExpr = {\n type: \"rule-expr\";\n srcVar?: DatalogSrcVar;\n ruleName: DatalogRuleName;\n arguments: DatalogArgument[];\n};\n\nexport type DatalogNotClause = {\n type: \"not-clause\";\n srcVar?: DatalogSrcVar;\n clauses: DatalogClause[];\n};\n\nexport type DatalogNotJoinClause = {\n type: \"not-join-clause\";\n srcVar?: DatalogSrcVar;\n variables: DatalogVariable[];\n clauses: DatalogClause[];\n};\n\nexport type DatalogOrClause = {\n type: \"or-clause\";\n srcVar?: DatalogSrcVar;\n clauses: DatalogClause[];\n};\n\nexport type DatalogOrJoinClause = {\n type: \"or-join-clause\";\n srcVar?: DatalogSrcVar;\n variables: DatalogVariable[];\n clauses: DatalogClause[];\n};\n\nexport type DatalogClause =\n | DatalogNotClause\n | DatalogOrJoinClause\n | DatalogExpressionClause\n | DatalogOrClause\n | DatalogNotJoinClause\n | DatalogAndClause;\n\nexport type DatalogDataPattern = {\n type: \"data-pattern\";\n srcVar?: DatalogSrcVar;\n arguments: DatalogArgument[];\n};\n\nexport type DatalogArgument =\n | DatalogSrcVar\n | DatalogVariable\n | DatalogConstant\n | DatalogUnderscore;\n\nexport type DatalogConstant = {\n type: \"constant\";\n value: string;\n};\n\nexport type DatalogPredExpr = {\n type: \"pred-expr\";\n pred:\n | \"<\"\n | \">\"\n | \"re-matches\"\n | \"re-find\"\n | \"clojure.string/includes?\"\n | \"clojure.string/ends-with?\"\n | \"clojure.string/starts-with?\";\n arguments: DatalogArgument[];\n};\n\nexport type DatalogFnExpr = {\n type: \"fn-expr\";\n fn: \"re-pattern\";\n arguments: DatalogArgument[];\n binding: DatalogBinding;\n};\n\nexport type DatalogBinding =\n | DatalogBindScalar\n | DatalogBindTuple\n | DatalogBindColl\n | DatalogBindRel;\n\nexport type DatalogBindScalar = {\n type: \"bind-scalar\";\n variable: DatalogVariable;\n};\nexport type DatalogBindTuple = {\n type: \"bind-tuple\";\n args: (DatalogVariable | DatalogUnderscore)[];\n};\nexport type DatalogBindColl = {\n type: \"bind-col\";\n variable: DatalogVariable;\n};\n\nexport type DatalogBindRel = {\n type: \"bind-rel\";\n args: (DatalogVariable | DatalogUnderscore)[];\n};\n\nexport type DatalogUnderscore = {\n type: \"underscore\";\n value: \"_\";\n};\n\nexport type DatalogRuleName = {\n type: \"rulename\";\n value: string;\n};\n\nexport type RoamBasicBlock = {\n string: string;\n uid: string;\n};\n\nexport type RoamBasicPage = { title: string; uid: string };\n\nexport type RoamBasicNode = {\n text: string;\n uid: string;\n children: RoamBasicNode[];\n};\n\nexport type RoamPull = {\n \"block/children\"?: RoamNode[];\n \"block/heading\"?: number;\n \"block/open\"?: boolean;\n \"block/order\"?: number;\n \"block/page\"?: RoamNode;\n \"block/parents\"?: RoamNode[];\n \"block/refs\"?: RoamNode[];\n \"block/string\"?: string;\n \"block/uid\"?: string;\n \"children/view-type\"?: `:${ViewType}`;\n \"create/time\"?: number;\n \"create/user\"?: RoamNode;\n \"edit/time\"?: number;\n \"edit/user\"?: RoamNode;\n \"log/id\"?: number;\n \"node/title\"?: string;\n} & RoamNode;\n\nexport type PullBlock = {\n \":block/children\"?: ({ \":db/id\": number } | PullBlock)[];\n \":block/heading\"?: number;\n \":block/open\"?: boolean;\n \":block/order\"?: number;\n \":block/page\"?: { \":db/id\": number };\n \":block/parents\"?: { \":db/id\": number }[];\n \":block/props\"?: {\n \":image-size\"?: {\n [p: string]: {\n \":height\": number;\n \":width\": number;\n };\n };\n \":iframe\"?: {\n [p: string]: {\n \":size\": {\n \":height\": number;\n \":width\": number;\n };\n };\n };\n [k: `:roamjs-${string}`]: Record<string, unknown>;\n };\n \":block/refs\"?: { \":db/id\": number }[];\n \":block/string\"?: string;\n \":block/view-type\"?: `:${BlockViewType}`;\n \":block/text-align\"?: TextAlignment;\n \":block/uid\"?: string;\n \":children/view-type\"?: `:${ViewType}`;\n \":create/time\"?: number;\n \":create/user\"?: { \":db/id\": number };\n \":edit/time\"?: number;\n \":edit/user\"?: { \":db/id\": number };\n \":db/id\"?: number;\n \":log/id\"?: number;\n \":node/title\"?: string;\n \":user/display-name\"?: string;\n \":user/display-page\"?: { \":db/id\": number };\n \":user/settings\"?: {\n \":namespace-options\": [\":none\", \":partial\", \":full\"];\n \":link-brackets?\": boolean;\n \":showing-inline-references?\": boolean;\n \":right-sidebar-pinned\": {\n [uuid: string]: SidebarWindow;\n };\n \":showing-own-icons?\": boolean;\n \":showing-user-icons?\": boolean;\n \":first-day-of-week\"?: 0 | 1 | 2 | 3 | 4 | 5 | 6;\n };\n \":user/uid\"?: string;\n \":user/email\"?: string;\n};\n\nexport type RoamPullResult = RoamPull | null;\n\nexport type ViewType = \"document\" | \"bullet\" | \"numbered\";\n\nexport type BlockViewType =\n | \"tabs\"\n | \"outline\"\n | \"horizontal\"\n | \"popout\"\n | \"comment\"\n | \"side\"\n | \"vertical\";\n\nexport type TextAlignment = \"left\" | \"center\" | \"right\" | \"justify\";\n\nexport type RoamBlock = {\n attrs?: { source: string[] }[][];\n children?: { id: number }[];\n id?: number;\n string?: string;\n title?: string;\n time?: number;\n uid?: string;\n order?: number;\n \"view-type\"?: ViewType;\n};\n\nexport type RoamError = {\n raw: string;\n \"status-code\": number;\n};\n\nexport type TreeNode = {\n text: string;\n order: number;\n children: TreeNode[];\n parents: number[];\n uid: string;\n heading: number;\n open: boolean;\n viewType: ViewType;\n editTime: Date;\n textAlign: TextAlignment;\n props: {\n imageResize: {\n [link: string]: {\n height: number;\n width: number;\n };\n };\n iframe: {\n [link: string]: {\n height: number;\n width: number;\n };\n };\n };\n};\n\nexport type TextNode = {\n text: string;\n children: TextNode[];\n};\n\nexport type InputTextNode = {\n text: string;\n children?: InputTextNode[];\n uid?: string;\n heading?: number;\n textAlign?: TextAlignment;\n viewType?: ViewType;\n open?: boolean;\n props?: Record<string, unknown>;\n};\n\ntype PlusType = [number, string];\n\nexport type RoamNode = { \"db/id\": number };\n\nexport type RoamQuery = RoamPull & {\n \"block/graph\"?: RoamNode;\n \"node/graph+title\"?: PlusType;\n \"block/graph+uid\"?: PlusType;\n \"node/graph\"?: RoamNode;\n \"edit/email\"?: string;\n \"entity/graph\"?: RoamNode;\n};\n\nexport type RoamQueryResult = number & RoamQuery;\n\nexport type ClientParams = {\n action:\n | \"pull\"\n | \"q\"\n | \"create-block\"\n | \"update-block\"\n | \"create-page\"\n | \"move-block\"\n | \"delete-block\"\n | \"delete-page\"\n | \"update-page\";\n selector?: string;\n uid?: string;\n query?: string;\n inputs?: string[];\n} & ActionParams;\n\nexport type ActionParams = {\n location?: {\n \"parent-uid\": string;\n order: number;\n };\n block?: {\n string?: string;\n uid?: string;\n open?: boolean;\n heading?: number;\n \"text-align\"?: TextAlignment;\n \"children-view-type\"?: ViewType;\n props?: Record<string, unknown>;\n };\n page?: {\n title?: string;\n uid?: string;\n };\n};\n\nexport type WriteAction = (a: ActionParams) => Promise<void>;\n\nexport type UserSettings = {\n \"global-filters\": {\n includes: string[];\n removes: string[];\n };\n};\n\ntype SidebarWindowType =\n | SidebarBlockWindow\n | SidebarMentionsWindow\n | SidebarGraphWindow\n | SidebarOutlineWindow;\n\nexport type SidebarWindowInput = {\n \"block-uid\": string;\n type: SidebarWindowType[\"type\"];\n};\n\ntype SidebarBlockWindow = {\n type: \"block\";\n \"block-uid\": string;\n};\n\ntype SidebarOutlineWindow = {\n type: \"outline\";\n \"page-uid\": string;\n};\n\ntype SidebarMentionsWindow = {\n type: \"mentions\";\n \"mentions-uid\": string;\n};\n\ntype SidebarGraphWindow = {\n type: \"graph\";\n // \"page-uid\": string; Currently not working despite documentation\n \"block-uid\": string;\n};\n\nexport type SidebarAction = (action: {\n window: SidebarWindowInput;\n}) => Promise<void>;\n\nexport type SidebarWindow = {\n \"collapsed?\": boolean;\n order: number;\n \"pinned?\": boolean;\n \"window-id\": string;\n} & SidebarWindowType;\n\nexport type AddPullWatch = (\n pullPattern: string,\n entityId: string,\n callback: (before: PullBlock | null, after: PullBlock | null) => void\n) => boolean;\n\ntype ButtonAction = {\n type: \"button\";\n onClick?: (e: MouseEvent) => void;\n content: string;\n};\n\ntype SwitchAction = {\n type: \"switch\";\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype InputAction = {\n type: \"input\";\n placeholder: string;\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype SelectAction = {\n type: \"select\";\n items: string[];\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n};\n\ntype CustomAction = {\n type: \"reactComponent\";\n component: React.FC;\n};\n\nexport type Action =\n | ButtonAction\n | SwitchAction\n | InputAction\n | SelectAction\n | CustomAction;\n\ntype PanelConfig = {\n tabTitle: string;\n settings: {\n id: string;\n name: string;\n description: string;\n action: Action;\n }[];\n};\n\nexport type AddCommandOptions = {\n label: string;\n callback: () => void;\n disableHotkey?: boolean;\n defaultHotkey?: string | string[];\n};\n\ntype RemoveCommandOptions = {\n label: string;\n};\n\nexport type OnloadArgs = {\n extensionAPI: {\n settings: {\n get: (k: string) => unknown;\n getAll: () => Record<string, unknown>;\n panel: {\n create: (c: PanelConfig) => void;\n };\n set: (k: string, v: unknown) => Promise<void>;\n };\n ui: {\n commandPalette: {\n addCommand: (c: AddCommandOptions) => Promise<void>;\n removeCommand: (c: RemoveCommandOptions) => Promise<void>;\n };\n };\n };\n extension: {\n version: string;\n };\n};\n"]}
|
package/writes/updateBlock.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InputTextNode } from "../types";
|
|
2
|
-
declare const updateBlock: ({ text, uid, heading, textAlign, viewType, open, }: {
|
|
2
|
+
declare const updateBlock: ({ text, uid, heading, textAlign, viewType, open, props, }: {
|
|
3
3
|
uid: string;
|
|
4
4
|
} & Partial<Omit<InputTextNode, "children">>) => Promise<string>;
|
|
5
5
|
export default updateBlock;
|
package/writes/updateBlock.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const submitActions_1 = tslib_1.__importDefault(require("./submitActions"));
|
|
5
|
-
const updateBlock = ({ text, uid, heading, textAlign, viewType, open, }) => {
|
|
5
|
+
const updateBlock = ({ text, uid, heading, textAlign, viewType, open, props, }) => {
|
|
6
6
|
return (0, submitActions_1.default)([
|
|
7
7
|
{
|
|
8
8
|
type: "updateBlock",
|
|
@@ -14,6 +14,7 @@ const updateBlock = ({ text, uid, heading, textAlign, viewType, open, }) => {
|
|
|
14
14
|
"text-align": textAlign,
|
|
15
15
|
"children-view-type": viewType,
|
|
16
16
|
open,
|
|
17
|
+
props,
|
|
17
18
|
},
|
|
18
19
|
},
|
|
19
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBlock.js","sourceRoot":"","sources":["../../src/writes/updateBlock.ts"],"names":[],"mappings":";;;AACA,4EAA4C;AAE5C,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,GAAG,EACH,OAAO,EACP,SAAS,EACT,QAAQ,EACR,IAAI,
|
|
1
|
+
{"version":3,"file":"updateBlock.js","sourceRoot":"","sources":["../../src/writes/updateBlock.ts"],"names":[],"mappings":";;;AACA,4EAA4C;AAE5C,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,GAAG,EACH,OAAO,EACP,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,KAAK,GAGN,EAAmB,EAAE;IACpB,OAAO,IAAA,uBAAa,EAAC;QACnB;YACE,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE;gBACN,KAAK,EAAE;oBACL,MAAM,EAAE,IAAI;oBACZ,GAAG;oBACH,OAAO;oBACP,YAAY,EAAE,SAAS;oBACvB,oBAAoB,EAAE,QAAQ;oBAC9B,IAAI;oBACJ,KAAK;iBACN;aACF;SACF;KACF,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import type { InputTextNode } from \"../types\";\nimport submitActions from \"./submitActions\";\n\nconst updateBlock = ({\n text,\n uid,\n heading,\n textAlign,\n viewType,\n open,\n props,\n}: { uid: string } & Partial<\n Omit<InputTextNode, \"children\">\n>): Promise<string> => {\n return submitActions([\n {\n type: \"updateBlock\",\n params: {\n block: {\n string: text,\n uid,\n heading,\n \"text-align\": textAlign,\n \"children-view-type\": viewType,\n open,\n props,\n },\n },\n },\n ]).then(() => uid);\n};\n\nexport default updateBlock;\n"]}
|