diff options
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 6371c4e9d..e0c7bce82 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -182,8 +182,6 @@ export class DocumentOptions { identifier?: STRt = new StrInfo('documentIcon displayed for each doc as "d[x]"', false); _rotation?: NUMt = new NumInfo('Amount of rotation on a document in degrees', false); - date_range?: STRt = new StrInfo('date range for calendar', false); - chat?: STRt = new StrInfo('fields related to chatBox', false); chat_history?: STRt = new StrInfo('chat history for chatbox', false); chat_thread_id?: STRt = new StrInfo('thread id for chatbox', false); @@ -290,6 +288,7 @@ export class DocumentOptions { _layout_showSidebar?: BOOLt = new BoolInfo('whether an annotationsidebar should be displayed for text docuemnts'); _layout_showCaption?: string; // which field to display in the caption area. leave empty to have no caption _layout_showTags?: BOOLt = new BoolInfo('whether to show the list of document tags at the bottom of a DocView'); + _layout_hideScroll?: BOOLt = new BoolInfo('whether to hide scroll bars on the document'); _chromeHidden?: BOOLt = new BoolInfo('whether the editing chrome for a document is hidden'); hideClickBehaviors?: BOOLt = new BoolInfo('whether to hide click behaviors in context menu'); @@ -333,6 +332,9 @@ export class DocumentOptions { toolType?: string; // type of pen tool expertMode?: BOOLt = new BoolInfo('something available only in expert (not novice) mode'); + placeholder_docType?: STRt = new StrInfo('type of document that this document accepts as a child', false, false, Array.from(Object.keys(DocumentType))); + placeholder_acceptTags?: List<string>; + contextMenuFilters?: List<ScriptField>; contextMenuScripts?: List<ScriptField>; contextMenuLabels?: List<string>; @@ -362,7 +364,6 @@ export class DocumentOptions { isBaseProto?: BOOLt = new BoolInfo('is doc a base level prototype for data documents as opposed to data documents which are prototypes for layout documents. base protos are not cloned during a deep'); isTemplateForField?: string; // the field key for which the containing document is a rendering template isTemplateDoc?: BOOLt = new BoolInfo('is the document a template for creating other documents'); - isGroup?: BOOLt = new BoolInfo('should collection use a grouping UI behavior'); isFolder?: BOOLt = new BoolInfo('is document a tree view folder'); _isTimelineLabel?: BOOLt = new BoolInfo('is document a timeline label'); isLightbox?: BOOLt = new BoolInfo('whether a collection acts as a lightbox by opening lightbox links by hiding all other documents in collection besides link target'); @@ -402,6 +403,7 @@ export class DocumentOptions { // freeform properties freeform?: STRt = new StrInfo(''); + freeform_isGroup?: BOOLt = new BoolInfo('should collection use a grouping UI behavior'); _freeform_backgroundGrid?: BOOLt = new BoolInfo('whether background grid is shown on freeform collections'); _freeform_scale_min?: NUMt = new NumInfo('how far out a view can zoom (used by image/videoBoxes that are clipped'); _freeform_scale_max?: NUMt = new NumInfo('how far in a view can zoom (used by sidebar freeform views'); @@ -524,6 +526,19 @@ export class DocumentOptions { ai_prompt?: STRt = new StrInfo('input prompt to GAI engine'); ai_generatedDocs?: List<Doc>; // list of documents generated by GAI engine + // TASK MANAGER + $task_dateRange?: STRt = new StrInfo('date range for calendar', false); + $task_startTime?: DateInfo | DateField = new DateInfo('start date and time', /*filterable*/ false); + $task_endTime?: DateInfo | DateField = new DateInfo('end date and time', /*filterable*/ false); + $task_allDay?: BoolInfo | boolean = new BoolInfo('whether task is all-day or not', /*filterable*/ false); + $task_completed?: BoolInfo | boolean = new BoolInfo('whether the task is completed', /*filterable*/ false); + $googleTaskId?: STRt = new StrInfo('Google Task ID for syncing'); + $task_lastSyncedAt?: STRt = new StrInfo('last update time for task node'); + $task_deleted?: BoolInfo | boolean = new BoolInfo('whether task is deleted or not', /*filterable*/ false); + + _calendar_date?: DateInfo | DateField = new DateInfo('current selected date of a calendar', /*filterable*/ false); + _calendar_dateRange?: STRt = new StrInfo('date range shown on a calendar', false); + /** * JSONāstringified slot configuration for ScrapbookBox */ @@ -936,31 +951,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), '', @@ -973,7 +963,19 @@ export namespace Docs { ); } - // AARAV ADD // + // eslint-disable-next-line @typescript-eslint/no-unused-vars + export function TaskDocument(text = '', options: DocumentOptions = {}, fieldKey = 'text') { + return InstanceFromProto( + Prototypes.get(DocumentType.TASK), + '', + { + title: '', + ...options, + }, + undefined, + fieldKey + ); + } export function LinkDocument(source: Doc, target: Doc, options: DocumentOptions = {}, id?: string) { const linkDoc = InstanceFromProto( @@ -1054,6 +1056,7 @@ export namespace Docs { _layout_nativeDimEditable: true, _layout_reflowHorizontal: true, _layout_reflowVertical: true, + calendar: '', ...options, _type_collection: CollectionViewType.Calendar, }); |