aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-05-09 16:33:50 -0400
committerbobzel <zzzman@gmail.com>2023-05-09 16:33:50 -0400
commit719da9462f02fd3afda9b0b65de19de9405ab4fc (patch)
tree37197f1f5ce8e7e5c858402e0a6b3f67d23afe57 /src/client/documents/Documents.ts
parentdbd531233ea7c10130976127361f84281026a308 (diff)
fixed exporting to work with collections that have no assets, and with ink documents. cleaned up some unused fields. added more explicit support for flashcards.
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 2187f8231..5a7894c08 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -10,8 +10,8 @@ import { List } from '../../fields/List';
import { RichTextField } from '../../fields/RichTextField';
import { SchemaHeaderField } from '../../fields/SchemaHeaderField';
import { ComputedField, ScriptField } from '../../fields/ScriptField';
-import { Cast, DocCast, FieldValue, NumCast, ScriptCast, StrCast } from '../../fields/Types';
-import { AudioField, CsvField, ImageField, MapField, PdfField, RecordingField, VideoField, WebField, YoutubeField } from '../../fields/URLField';
+import { BoolCast, Cast, DocCast, FieldValue, NumCast, ScriptCast, StrCast } from '../../fields/Types';
+import { AudioField, CsvField, ImageField, PdfField, VideoField, WebField, YoutubeField } from '../../fields/URLField';
import { inheritParentAcls, SharingPermissions } from '../../fields/util';
import { Upload } from '../../server/SharedMediaTypes';
import { aggregateBounds, OmitKeys, Utils } from '../../Utils';
@@ -37,7 +37,7 @@ import { FontIconBox } from '../views/nodes/button/FontIconBox';
import { ColorBox } from '../views/nodes/ColorBox';
import { ComparisonBox } from '../views/nodes/ComparisonBox';
import { DataVizBox } from '../views/nodes/DataVizBox/DataVizBox';
-import { DocFocusOptions, OpenWhere, OpenWhereMod } from '../views/nodes/DocumentView';
+import { OpenWhereMod } from '../views/nodes/DocumentView';
import { EquationBox } from '../views/nodes/EquationBox';
import { FieldViewProps } from '../views/nodes/FieldView';
import { FormattedTextBox } from '../views/nodes/formattedText/FormattedTextBox';
@@ -173,6 +173,7 @@ export class DocumentOptions {
_lockedTransform?: boolean; // lock the panx,pany and scale parameters of the document so that it be panned/zoomed
_followLinkToggle?: boolean; // whether document, when clicked, toggles display of its link target
_showTitle?: string; // field name to display in header (:hover is an optional suffix)
+ _showAltContentUI?: boolean; // whether to show alternate content button
_isLightbox?: boolean; // whether a collection acts as a lightbox by opening lightbox links by hiding all other documents in collection besides link target
_showCaption?: string; // which field to display in the caption area. leave empty to have no caption
_scrollTop?: number; // scroll location for pdfs
@@ -1441,18 +1442,12 @@ export namespace DocUtils {
} else if (field instanceof AudioField) {
created = Docs.Create.AudioDocument(field.url.href, resolved);
created.layout = AudioBox.LayoutString(fieldKey);
- } else if (field instanceof RecordingField) {
- created = Docs.Create.RecordingDocument(field.url.href, resolved);
- created.layout = RecordingBox.LayoutString(fieldKey);
} else if (field instanceof InkField) {
created = Docs.Create.InkDocument(ActiveInkColor(), Doc.ActiveTool, ActiveInkWidth(), ActiveInkBezierApprox(), ActiveFillColor(), ActiveArrowStart(), ActiveArrowEnd(), ActiveDash(), field.inkData, ActiveIsInkMask(), resolved);
created.layout = InkingStroke.LayoutString(fieldKey);
} else if (field instanceof List && field[0] instanceof Doc) {
created = Docs.Create.StackingDocument(DocListCast(field), resolved);
created.layout = CollectionView.LayoutString(fieldKey);
- } else if (field instanceof MapField) {
- created = Docs.Create.MapDocument(DocListCast(field), resolved);
- created.layout = MapBox.LayoutString(fieldKey);
} else {
created = Docs.Create.TextDocument('', { ...{ _width: 200, _height: 25, _autoHeight: true }, ...resolved });
created.layout = FormattedTextBox.LayoutString(fieldKey);
@@ -1800,6 +1795,7 @@ export namespace DocUtils {
y: y,
_fitWidth: true,
_autoHeight: true,
+ _showAltContentUI: BoolCast(Doc.UserDoc().defaultToFlashcards),
title,
});
const template = Doc.UserDoc().defaultTextLayout;