diff options
author | bobzel <zzzman@gmail.com> | 2025-04-30 14:43:29 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-04-30 14:43:29 -0400 |
commit | 0317a667a5d4a0f298522eeddb8afa96e7b7ecfc (patch) | |
tree | 2d66c3caa5c102a3ca78837b87e61c16fd07fc01 /src/client/documents/Documents.ts | |
parent | 9ec7df6af508eccdfda3a195a69c8bb1f86c41ea (diff) | |
parent | 2296c314be710f983d595de37c9d8039d73568a6 (diff) |
Merge branch 'master' into task_nodes_aarav
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 112a73e46..217967c52 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -536,6 +536,15 @@ export class DocumentOptions { allDay?: BoolInfo | boolean = new BoolInfo('all-day task', /*filterable*/ false); /** Whether the task is completed */ completed?: BoolInfo | boolean = new BoolInfo('whether the task is completed', /*filterable*/ false); + /** + * JSONāstringified slot configuration for ScrapbookBox + */ + scrapbookConfig?: string; + + /** + * The list of embedded Doc instances in each Scrapbook slot + */ + scrapbookContents?: List<Doc>; } export const DocOptions = new DocumentOptions(); @@ -941,6 +950,25 @@ export namespace Docs { return InstanceFromProto(Prototypes.get(DocumentType.RTF), field, options, undefined, fieldKey); } + export function ScrapbookDocument(items: Doc[] = [], options: DocumentOptions = {}, fieldKey: string = 'items') { + return InstanceFromProto( + Prototypes.get(DocumentType.SCRAPBOOK), + new List<Doc>(items), + { + title: + options.title ?? + new Date().toLocaleDateString(undefined, { + year: 'numeric', + month: 'short', + day: 'numeric', + }), + ...options, + }, + undefined, + fieldKey + ); + } + // AARAV ADD // export function DailyJournalDocument(text: string | RichTextField, options: DocumentOptions = {}, fieldKey: string = 'text') { |