diff options
| author | bobzel <zzzman@gmail.com> | 2025-06-19 15:30:54 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-06-19 15:30:54 -0400 |
| commit | abdfe5b109f42cd5da4aceef1bd667c8e1f6cbbd (patch) | |
| tree | 26c0d1b4d4034a98003f97ecdc771066a0e04804 /src/client/documents | |
| parent | 562d6591a5e4feb7d44135445fd16056e0f8943f (diff) | |
| parent | c0daf8b6aff92b71662d9791aeaa4bb63076dd02 (diff) | |
Merge branch 'lanyi-branch'
Diffstat (limited to 'src/client/documents')
| -rw-r--r-- | src/client/documents/DocUtils.ts | 9 | ||||
| -rw-r--r-- | src/client/documents/Documents.ts | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/client/documents/DocUtils.ts b/src/client/documents/DocUtils.ts index dee929c89..9704867d5 100644 --- a/src/client/documents/DocUtils.ts +++ b/src/client/documents/DocUtils.ts @@ -587,6 +587,15 @@ export namespace DocUtils { doc.onClick = FollowLinkScript(); } + /** + * iterate through all items and their children and return a flat list of leaf placeholder content Docs + * @param items + * @returns list of placeholder content Docs + */ + export function unwrapPlaceholders(items: Doc[]): Doc[] { + return items.flatMap(d => (d.$type === DocumentType.COL ? unwrapPlaceholders(DocListCast(d[Doc.LayoutDataKey(d)])) : [d])); + } + export function LeavePushpin(doc: Doc, annotationField: string) { if (doc.followLinkToggle) return undefined; const context = Cast(doc.embedContainer, Doc, null) ?? Cast(doc.annotationOn, Doc, null); diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 4ad9c9bd8..aea636040 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -331,6 +331,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>; |
