aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx73
1 files changed, 37 insertions, 36 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 5af9a9f9a..b0e992cb6 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -10,7 +10,7 @@ import 'normalize.css';
import * as React from 'react';
import { Doc, DocListCast, Opt } from '../../fields/Doc';
import { ScriptField } from '../../fields/ScriptField';
-import { StrCast } from '../../fields/Types';
+import { DocCast, StrCast } from '../../fields/Types';
import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnTrue, returnZero, setupMoveUpEvents, Utils } from '../../Utils';
import { GoogleAuthenticationManager } from '../apis/GoogleAuthenticationManager';
import { DocServer } from '../DocServer';
@@ -81,7 +81,7 @@ export class MainView extends React.Component {
@observable private _sidebarContent: any = Doc.MyLeftSidebarPanel;
@observable private _leftMenuFlyoutWidth: number = 0;
@computed get _hideUI() {
- return this.mainDoc && this.mainDoc._viewType !== CollectionViewType.Docking;
+ return this.mainDoc && this.mainDoc._type_collection !== CollectionViewType.Docking;
}
@computed private get dashboardTabHeight() {
@@ -157,27 +157,28 @@ export class MainView extends React.Component {
'dataTransition',
'viewTransition',
'treeViewOpen',
- 'showSidebar',
+ 'layout_showSidebar',
+ 'carousel_index',
'itemIndex', // for changing slides in presentations
- 'sidebarWidthPercent',
- 'currentTimecode',
- 'timelineHeightPercent',
+ 'layout_sidebarWidthPercent',
+ 'layout_currentTimecode',
+ 'layout_timelineHeightPercent',
'presStatus',
- 'panX',
- 'panY',
+ 'freeform_panX',
+ 'freeform_panY',
'overlayX',
'overlayY',
- 'fitWidth',
+ 'layout_fitWidth',
'nativeWidth',
'nativeHeight',
- 'text-scrollHeight',
- 'text-height',
- 'hideMinimap',
- 'viewScale',
- 'scrollTop',
+ 'text_scrollHeight',
+ 'text_height',
+ 'layout_hideMinimap',
+ 'freeform_scale',
+ 'layout_scrollTop',
'hidden',
- 'curPage',
- 'viewType',
+ 'layout_curPage',
+ 'type_collection',
'chromeHidden',
'currentFrame',
'width',
@@ -236,7 +237,7 @@ export class MainView extends React.Component {
if (pathname.length > 1 && pathname[0] === 'doc') {
DocServer.GetRefField(pathname[1]).then(
action(field => {
- if (field instanceof Doc && field._viewType !== CollectionViewType.Docking) {
+ if (field instanceof Doc && field._type_collection !== CollectionViewType.Docking) {
Doc.GuestTarget = field;
}
})
@@ -607,8 +608,8 @@ export class MainView extends React.Component {
focus={emptyFunction}
whenChildContentsActiveChanged={emptyFunction}
bringToFront={emptyFunction}
- docFilters={returnEmptyFilter}
- docRangeFilters={returnEmptyFilter}
+ childFilters={returnEmptyFilter}
+ childFiltersByRanges={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
/>
</div>
@@ -636,8 +637,8 @@ export class MainView extends React.Component {
focus={emptyFunction}
whenChildContentsActiveChanged={emptyFunction}
bringToFront={emptyFunction}
- docFilters={returnEmptyFilter}
- docRangeFilters={returnEmptyFilter}
+ childFilters={returnEmptyFilter}
+ childFiltersByRanges={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
suppressSetHeight={true}
renderDepth={this._hideUI ? 0 : -1}
@@ -693,7 +694,7 @@ export class MainView extends React.Component {
sidebarScreenToLocal = () => new Transform(0, -this.topOfSidebarDoc, 1);
mainContainerXf = () => this.sidebarScreenToLocal().translate(-this.leftScreenOffsetOfMainDocView, 0);
static addDocTabFunc_impl = (doc: Doc, location: OpenWhere): boolean => {
- const whereFields = doc._viewType === CollectionViewType.Docking ? [OpenWhere.dashboard] : location.split(':');
+ const whereFields = doc._type_collection === CollectionViewType.Docking ? [OpenWhere.dashboard] : location.split(':');
const keyValue = whereFields[1]?.includes('KeyValue');
const whereMods: OpenWhereMod = whereFields.length > 1 ? (whereFields[1].replace('KeyValue', '') as OpenWhereMod) : OpenWhereMod.none;
if (doc.dockingConfig) return DashboardView.openDashboard(doc);
@@ -735,8 +736,8 @@ export class MainView extends React.Component {
focus={emptyFunction}
whenChildContentsActiveChanged={emptyFunction}
bringToFront={emptyFunction}
- docFilters={returnEmptyFilter}
- docRangeFilters={returnEmptyFilter}
+ childFilters={returnEmptyFilter}
+ childFiltersByRanges={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
/>
</div>
@@ -766,8 +767,8 @@ export class MainView extends React.Component {
isContentActive={returnTrue}
whenChildContentsActiveChanged={emptyFunction}
bringToFront={emptyFunction}
- docFilters={returnEmptyFilter}
- docRangeFilters={returnEmptyFilter}
+ childFilters={returnEmptyFilter}
+ childFiltersByRanges={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
scriptContext={this}
/>
@@ -853,7 +854,7 @@ export class MainView extends React.Component {
this._leftMenuFlyoutWidth = this._leftMenuFlyoutWidth || 250;
//setTimeout(action(() => (this._leftMenuFlyoutWidth += 0.5)));
- this._sidebarContent.proto = button.target as any;
+ this._sidebarContent.proto = DocCast(button.target);
this.LastButton = button;
});
@@ -880,8 +881,8 @@ export class MainView extends React.Component {
<CollectionLinearView
Document={Doc.MyDockedBtns}
DataDoc={undefined}
- fieldKey={'data'}
- dropAction={'alias'}
+ fieldKey="data"
+ dropAction="embed"
setHeight={returnFalse}
styleProvider={DefaultStyleProvider}
rootSelected={returnTrue}
@@ -902,8 +903,8 @@ export class MainView extends React.Component {
renderDepth={0}
focus={emptyFunction}
whenChildContentsActiveChanged={emptyFunction}
- docFilters={returnEmptyFilter}
- docRangeFilters={returnEmptyFilter}
+ childFilters={returnEmptyFilter}
+ childFiltersByRanges={returnEmptyFilter}
searchFilterDocs={returnEmptyDoclist}
/>
{['watching', 'recording'].includes(String(this.userDoc?.presentationMode) ?? '') ? <div style={{ border: '.5rem solid green', padding: '5px' }}>{StrCast(this.userDoc?.presentationMode)}</div> : <></>}
@@ -911,14 +912,14 @@ export class MainView extends React.Component {
);
}
@computed get snapLines() {
- return !SelectionManager.Views().some(dv => dv.rootDoc.showSnapLines) ? null : (
+ return !SelectionManager.Views().some(dv => dv.rootDoc.freeform_snapLines) ? null : (
<div className="mainView-snapLines">
<svg style={{ width: '100%', height: '100%' }}>
- {SnappingManager.horizSnapLines().map(l => (
- <line x1="0" y1={l} x2="2000" y2={l} stroke="black" opacity={0.3} strokeWidth={0.5} strokeDasharray={'1 1'} />
+ {SnappingManager.horizSnapLines().map((l, i) => (
+ <line key={i} x1="0" y1={l} x2="2000" y2={l} stroke="black" opacity={0.3} strokeWidth={0.5} strokeDasharray={'1 1'} />
))}
- {SnappingManager.vertSnapLines().map(l => (
- <line y1="0" x1={l} y2="2000" x2={l} stroke="black" opacity={0.3} strokeWidth={0.5} strokeDasharray={'1 1'} />
+ {SnappingManager.vertSnapLines().map((l, i) => (
+ <line key={i} y1="0" x1={l} y2="2000" x2={l} stroke="black" opacity={0.3} strokeWidth={0.5} strokeDasharray={'1 1'} />
))}
</svg>
</div>