aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts70
1 files changed, 30 insertions, 40 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index bf9cc5bd4..1b0c422da 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -11,7 +11,7 @@ import { List } from '../../fields/List';
import { RichTextField } from '../../fields/RichTextField';
import { SchemaHeaderField } from '../../fields/SchemaHeaderField';
import { ComputedField, ScriptField } from '../../fields/ScriptField';
-import { ScriptCast, StrCast } from '../../fields/Types';
+import { DocCast, ScriptCast, StrCast } from '../../fields/Types';
import { AudioField, CsvField, ImageField, PdfField, VideoField, WebField } from '../../fields/URLField';
import { SharingPermissions } from '../../fields/util';
import { PointData } from '../../pen-gestures/GestureTypes';
@@ -525,6 +525,17 @@ export class DocumentOptions {
ai?: string; // to mark items as ai generated
ai_firefly_seed?: number;
ai_firefly_prompt?: string;
+
+ // AARAV ADD DOC OPTIONS -- TASK MANAGER
+
+ /** Task start date/time picker (metadata and default) */
+ startTime?: DateInfo | DateField = new DateInfo('start date and time', /*filterable*/ false);
+
+ /** Task end date/time picker (metadata and default) */
+ endTime?: DateInfo | DateField = new DateInfo('end date and time', /*filterable*/ false);
+
+ /** Treat this as an all-day task (metadata and default) */
+ allDay?: BoolInfo | boolean = new BoolInfo('all-day task', /*filterable*/ false);
}
export const DocOptions = new DocumentOptions();
@@ -586,6 +597,17 @@ export namespace Docs {
},
},
],
+
+ [
+ DocumentType.TASK,
+ {
+ layout: { view: EmptyBox, dataField: 'text' },
+ options: {
+ title: 'Task',
+ acl_Guest: SharingPermissions.View,
+ },
+ },
+ ],
// AARAV ADD //
]);
@@ -922,31 +944,6 @@ export namespace Docs {
// AARAV ADD //
export function DailyJournalDocument(text: string | RichTextField, options: DocumentOptions = {}, fieldKey: string = 'text') {
- // const getFormattedDate = () => {
- // const date = new Date().toLocaleDateString(undefined, {
- // weekday: 'long',
- // year: 'numeric',
- // month: 'long',
- // day: 'numeric',
- // });
- // return date;
- // };
-
- // const getDailyText = () => {
- // const placeholderText = 'Start writing here...';
- // const dateText = `${getFormattedDate()}`;
-
- // return RichTextField.textToRtfFormat(
- // [
- // { text: 'Journal Entry:', styles: { bold: true, color: 'black', fontSize: 20 } },
- // { text: dateText, styles: { italic: true, color: 'gray', fontSize: 15 } },
- // { text: placeholderText, styles: { fontSize: 14, color: 'gray' } },
- // ],
- // undefined,
- // placeholderText.length
- // );
- // };
-
return InstanceFromProto(
Prototypes.get(DocumentType.JOURNAL),
'',
@@ -959,24 +956,17 @@ export namespace Docs {
);
}
- // AARAV ADD //
-
- export function LinkDocument(source: Doc, target: Doc, options: DocumentOptions = {}, id?: string) {
- const linkDoc = InstanceFromProto(
- Prototypes.get(DocumentType.LINK),
- undefined,
+ export function TaskDocument(text = '', options: DocumentOptions = {}, fieldKey = 'text') {
+ return InstanceFromProto(
+ Prototypes.get(DocumentType.TASK),
+ '',
{
- link_anchor_1: source,
- link_anchor_2: target,
+ title: '',
...options,
},
- id,
- 'link'
+ undefined,
+ fieldKey
);
-
- Doc.AddLink(linkDoc);
-
- return linkDoc;
}
export function InkDocument(points: PointData[], options: DocumentOptions = {}, strokeWidth: number, color: string, strokeBezier: string, fillColor: string, arrowStart: string, arrowEnd: string, dash: string, isInkMask: boolean) {