LinkDocPreview.LinkInfo = undefined)}
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 96ae1dc2b..0b27cd03c 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -920,7 +920,7 @@ export class DocumentView extends DocComponent
(Docu
return this.isSelected(outsideReaction) || (this.props.Document.rootDocument && this.props.rootSelected?.(outsideReaction)) || false;
}
childScaling = () => (this.layoutDoc._fitWidth ? this.props.PanelWidth() / this.nativeWidth : this.props.ContentScaling());
- @computed.struct get linkOffset() { return this.topMost ? [0, undefined, undefined, 10] : [-15, undefined, undefined, undefined]; }
+ @computed.struct get linkOffset() { return this.topMost ? [0, undefined, undefined, 10] : [-15, undefined, undefined, -20]; }
@computed get contents() {
TraceMobx();
return (
--
cgit v1.2.3-70-g09d2
From ee1f52496d44baa8566b03a05eb24d67fe80a89a Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Tue, 27 Oct 2020 12:43:00 +0800
Subject: Performance updates for up/down arrows
Only calls resetSelection when necessary
---
src/client/util/DocumentManager.ts | 11 +---
src/client/views/collections/CollectionMenu.tsx | 5 +-
src/client/views/collections/TabDocView.tsx | 7 ++-
.../collections/collectionFreeForm/MarqueeView.tsx | 7 ++-
src/client/views/nodes/PresBox.tsx | 65 +++++++++-------------
5 files changed, 45 insertions(+), 50 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 805e0e897..14aaeaec0 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -128,14 +128,9 @@ export class DocumentManager {
}
- static addView = (doc: Doc, finished?: () => void, presCollection?: Doc) => {
- if (presCollection) {
- const collectionDocView = DocumentManager.Instance.getDocumentView(presCollection);
- if (collectionDocView) collectionDocView.props.addDocTab(doc, "replace");
- } else {
- CollectionDockingView.AddSplit(doc, "right");
- finished?.();
- }
+ static addView = (doc: Doc, finished?: () => void) => {
+ CollectionDockingView.AddSplit(doc, "right");
+ finished?.();
}
public jumpToDocument = async (
targetDoc: Doc, // document to display
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index 34a1c0697..338b067fa 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -400,7 +400,10 @@ export class CollectionViewBaseChrome extends React.Component) => {
if (targetDoc) {
TabDocView.PinDoc(targetDoc, false);
- const activeDoc = PresBox.Instance?.childDocs[PresBox.Instance?.childDocs.length - 1];
+ const presArray: Doc[] = PresBox.Instance?.sortArray();
+ const size: number = PresBox.Instance?._selectedArray.size;
+ const presSelected: Doc | undefined = presArray && size ? presArray[size - 1] : undefined;
+ const activeDoc = presSelected ? PresBox.Instance?.childDocs[PresBox.Instance?.childDocs.indexOf(presSelected) + 1] : PresBox.Instance?.childDocs[PresBox.Instance?.childDocs.length - 1];
if (targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.RTF || targetDoc.type === DocumentType.WEB || targetDoc._viewType === CollectionViewType.Stacking) {
const scroll = targetDoc._scrollTop;
activeDoc.presPinView = true;
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index dcd94a7e6..82530c26d 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -134,7 +134,10 @@ export class TabDocView extends React.Component {
pinDoc.title = doc.title + " - Slide";
pinDoc.presMovement = PresMovement.Zoom;
pinDoc.context = curPres;
- Doc.AddDocToList(curPres, "data", pinDoc);
+ const presArray: Doc[] = PresBox.Instance?.sortArray();
+ const size: number = PresBox.Instance?._selectedArray.size;
+ const presSelected: Doc | undefined = presArray && size ? presArray[size - 1] : undefined;
+ Doc.AddDocToList(curPres, "data", pinDoc, presSelected);
if (pinDoc.type === "audio" && !audioRange) {
pinDoc.presStartTime = 0;
pinDoc.presEndTime = doc.duration;
@@ -149,6 +152,8 @@ export class TabDocView extends React.Component {
tabdocs?.push(curPres); // bcz: Argh! this is annoying. if multiple documents are pinned, this will get called multiple times before the presentation view is drawn. Thus it won't be in the tabdocs list and it will get created multple times. so need to explicilty add the presbox to the list of open tabs
CollectionDockingView.AddSplit(curPres, "right");
}
+ PresBox.Instance?._selectedArray.clear();
+ pinDoc && PresBox.Instance?._selectedArray.set(pinDoc, undefined); //Update selected array
DocumentManager.Instance.jumpToDocument(doc, false, undefined);
batch.end();
}
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index c6d1c9da2..efbe85f1a 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -25,7 +25,7 @@ import "./MarqueeView.scss";
import React = require("react");
import { Id } from "../../../../fields/FieldSymbols";
import { CurrentUserUtils } from "../../../util/CurrentUserUtils";
-import { PresMovement } from "../../nodes/PresBox";
+import { PresBox, PresMovement } from "../../nodes/PresBox";
interface MarqueeViewProps {
getContainerTransform: () => Transform;
@@ -399,7 +399,10 @@ export class MarqueeView extends React.Component
this.layoutDoc.presStatus = PresStatus.Edit;
this.layoutDoc._gridGap = 0;
this.layoutDoc._yMargin = 0;
- document.removeEventListener("keydown", PresBox.keyEventsWrapper, true);
- document.addEventListener("keydown", PresBox.keyEventsWrapper, true);
- this._presKeyEventsActive = true;
this.turnOffEdit(true);
DocListCastAsync((Doc.UserDoc().myPresentations as Doc).data).then(pres =>
!pres?.includes(this.rootDoc) && Doc.AddDocToList(Doc.UserDoc().myPresentations as Doc, "data", this.rootDoc));
@@ -172,6 +169,7 @@ export class PresBox extends ViewBoxBaseComponent
else Doc.UserDoc().activePresentation = this.rootDoc;
document.removeEventListener("keydown", PresBox.keyEventsWrapper, true);
document.addEventListener("keydown", PresBox.keyEventsWrapper, true);
+ this._presKeyEventsActive = true;
PresBox.Instance = this;
}
@@ -264,17 +262,7 @@ export class PresBox extends ViewBoxBaseComponent
this.rootDoc._itemIndex = index;
const activeItem: Doc = this.activeItem;
const presTargetDoc = Cast(this.childDocs[this.itemIndex].presentationTargetDoc, Doc, null);
- if (activeItem.presPinView) {
- const bestTarget = DocumentManager.Instance.getFirstDocumentView(presTargetDoc)?.props.Document;
- bestTarget && runInAction(() => {
- if (activeItem.presMovement === PresMovement.Jump) {
- bestTarget._viewTransition = '0s';
- } else {
- bestTarget._viewTransition = activeItem.presTransition ? `transform ${activeItem.presTransition}ms` : 'all 1s';
- setTimeout(() => bestTarget._viewTransition = undefined, activeItem.presTransition ? NumCast(activeItem.presTransition) + 10 : 1010);
- }
- });
- } else if (presTargetDoc) {
+ if (presTargetDoc) {
presTargetDoc && runInAction(() => {
if (activeItem.presMovement === PresMovement.Jump) presTargetDoc.focusSpeed = 0;
else presTargetDoc.focusSpeed = activeItem.presTransition ? activeItem.presTransition : 500;
@@ -291,11 +279,13 @@ export class PresBox extends ViewBoxBaseComponent
}
});
-
+ _navTimer!: NodeJS.Timeout;
navigateToView = (targetDoc: Doc, activeItem: Doc) => {
+ clearTimeout(this._navTimer);
const bestTarget = DocumentManager.Instance.getFirstDocumentView(targetDoc)?.props.Document;
bestTarget && runInAction(() => {
if (bestTarget.type === DocumentType.PDF || bestTarget.type === DocumentType.WEB || bestTarget.type === DocumentType.RTF || bestTarget._viewType === CollectionViewType.Stacking) {
+ bestTarget._viewTransition = activeItem.presTransition ? `transform ${activeItem.presTransition}ms` : 'all 0.5s';
bestTarget._scrollY = activeItem.presPinViewScroll;
} else if (bestTarget.type === DocumentType.COMPARISON) {
bestTarget._clipWidth = activeItem.presPinClipWidth;
@@ -307,8 +297,8 @@ export class PresBox extends ViewBoxBaseComponent
bestTarget._panY = activeItem.presPinViewY;
bestTarget._viewScale = activeItem.presPinViewScale;
}
+ this._navTimer = setTimeout(() => bestTarget._viewTransition = undefined, activeItem.presTransition ? NumCast(activeItem.presTransition) + 10 : 510);
});
- setTimeout(() => targetDoc._viewTransition = undefined, 1010);
}
/**
@@ -325,14 +315,11 @@ export class PresBox extends ViewBoxBaseComponent
const srcContext = await DocCastAsync(targetDoc?.context);
const presCollection = Cast(this.layoutDoc.presCollection, Doc, null);
const collectionDocView = presCollection ? DocumentManager.Instance.getDocumentView(presCollection) : undefined;
+ const includesDoc: boolean = DocListCast(presCollection?.data).includes(targetDoc);
this.turnOffEdit();
- if (this.itemIndex >= 0) {
- if (srcContext && targetDoc) {
- this.layoutDoc.presCollection = srcContext;
- } else if (targetDoc) this.layoutDoc.presCollection = targetDoc;
- }
- const docToJump = curDoc;
- const willZoom = false;
+ if (includesDoc) {
+ this.layoutDoc.presCollection = srcContext;
+ } else if (targetDoc) this.layoutDoc.presCollection = targetDoc;
const presStatus = this.rootDoc.presStatus;
const selViewCache = Array.from(this._selectedArray.keys());
const dragViewCache = Array.from(this._dragArray);
@@ -356,19 +343,11 @@ export class PresBox extends ViewBoxBaseComponent
// If openDocument is selected then it should open the document for the user
if (activeItem.openDocument) {
openInTab();
- } else {
- if (docToJump === curDoc) {
- //checking if curDoc has navigation open
- if (curDoc.presMovement === PresMovement.Pan && targetDoc) {
- await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext); // documents open in new tab instead of on right
- } else if ((curDoc.presMovement === PresMovement.Zoom || curDoc.presMovement === PresMovement.Jump) && targetDoc) {
- //awaiting jump so that new scale can be found, since jumping is async
- await DocumentManager.Instance.jumpToDocument(targetDoc, true, openInTab, srcContext, undefined, undefined, undefined, resetSelection); // documents open in new tab instead of on right
- }
- } else {
- //awaiting jump so that new scale can be found, since jumping is async
- targetDoc && await DocumentManager.Instance.jumpToDocument(targetDoc, willZoom, undefined, srcContext);
- }
+ } else if (curDoc.presMovement === PresMovement.Pan && targetDoc) {
+ await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc ? undefined : resetSelection); // documents open in new tab instead of on right
+ } else if ((curDoc.presMovement === PresMovement.Zoom || curDoc.presMovement === PresMovement.Jump) && targetDoc) {
+ //awaiting jump so that new scale can be found, since jumping is async
+ await DocumentManager.Instance.jumpToDocument(targetDoc, true, openInTab, srcContext, undefined, undefined, undefined, includesDoc ? undefined : resetSelection); // documents open in new tab instead of on right
}
// After navigating to the document, if it is added as a presPinView then it will
// adjust the pan and scale to that of the pinView when it was added.
@@ -688,10 +667,20 @@ export class PresBox extends ViewBoxBaseComponent
this._selectedArray.set(doc, undefined);
this._eleArray.push(ref);
this._dragArray.push(drag);
+ } else {
+ this._selectedArray.delete(doc);
+ this.removeFromArray(this._eleArray, doc);
+ this.removeFromArray(this._dragArray, doc);
}
this.selectPres();
}
+ removeFromArray = (arr: any[], val: any) => {
+ const index: number = arr.indexOf(val);
+ const ret: any[] = arr.splice(index, 1);
+ arr = ret;
+ }
+
//Shift click
@action
shiftSelect = (doc: Doc, ref: HTMLElement, drag: HTMLElement) => {
@@ -1614,12 +1603,12 @@ export class PresBox extends ViewBoxBaseComponent
@action
turnOffEdit = (paths?: boolean) => {
+ // Turn off paths
if (paths) {
- // Turn off paths
const srcContext = Cast(this.rootDoc.presCollection, Doc, null);
if (srcContext) this.togglePath(srcContext, true);
}
- // Turn off the progressivize editors for each
+ // Turn off the progressivize editors for each document
this.childDocs.forEach((doc) => {
doc.editSnapZoomProgressivize = false;
doc.editZoomProgressivize = false;
--
cgit v1.2.3-70-g09d2
From 09dae896673d08d7030b71fb2c3f52924726f58e Mon Sep 17 00:00:00 2001
From: bobzel
Date: Wed, 28 Oct 2020 09:19:26 -0400
Subject: fixed up dark schema a bit.
---
src/client/views/MainView.scss | 1 -
src/client/views/MainView.tsx | 23 ++++++++++++----------
.../views/collections/CollectionDockingView.scss | 2 +-
src/client/views/globalCssVariables.scss | 2 +-
.../nodes/formattedText/FormattedTextBox.scss | 2 +-
.../views/presentationview/PresElementBox.tsx | 2 +-
6 files changed, 17 insertions(+), 15 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss
index b608eceb1..d571a0428 100644
--- a/src/client/views/MainView.scss
+++ b/src/client/views/MainView.scss
@@ -334,7 +334,6 @@
position: relative;
z-index: 41; // lm_maximised has a z-index of 40 and this needs to be above that
touch-action: none;
- background-color: lightgrey;
cursor: grab;
display: flex;
align-items: center;
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 1730007a5..b3d198bd1 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -229,25 +229,28 @@ export class MainView extends React.Component {
getContentsHeight = () => this._panelHeight - Number(SEARCH_PANEL_HEIGHT.replace("px", ""));
defaultBackgroundColors = (doc: Opt, renderDepth: number) => {
- if (doc?.type === DocumentType.COL) {
- return Doc.IsSystem(doc) ? "lightgrey" : StrCast(renderDepth > 0 ? Doc.UserDoc().activeCollectionNestedBackground : Doc.UserDoc().activeCollectionBackground);
- }
if (this.darkScheme) {
switch (doc?.type) {
- case DocumentType.FONTICON: return "white";
+ case DocumentType.PRESELEMENT: return "dimgrey";
+ case DocumentType.FONTICON: return "black";
case DocumentType.RTF || DocumentType.LABEL || DocumentType.BUTTON: return "#2d2d2d";
case DocumentType.LINK:
- case DocumentType.COL: if (doc._viewType !== CollectionViewType.Freeform && doc._viewType !== CollectionViewType.Time) return "rgb(62,62,62)";
+ case DocumentType.COL:
+ return Doc.IsSystem(doc) ? "rgb(62,62,62)" : StrCast(renderDepth > 0 ? Doc.UserDoc().activeCollectionNestedBackground : Doc.UserDoc().activeCollectionBackground);
+ //if (doc._viewType !== CollectionViewType.Freeform && doc._viewType !== CollectionViewType.Time) return "rgb(62,62,62)";
default: return "black";
}
} else {
switch (doc?.type) {
+ case DocumentType.PRESELEMENT: return "";
case DocumentType.FONTICON: return "black";
case DocumentType.RTF: return "#f1efeb";
case DocumentType.BUTTON:
case DocumentType.LABEL: return "lightgray";
case DocumentType.LINK:
- case DocumentType.COL: if (doc._viewType !== CollectionViewType.Freeform && doc._viewType !== CollectionViewType.Time) return "lightgray";
+ case DocumentType.COL:
+ return Doc.IsSystem(doc) ? "lightgrey" : StrCast(renderDepth > 0 ? Doc.UserDoc().activeCollectionNestedBackground : Doc.UserDoc().activeCollectionBackground);
+ //if (doc._viewType !== CollectionViewType.Freeform && doc._viewType !== CollectionViewType.Time) return "lightgray";
default: return "white";
}
}
@@ -345,7 +348,7 @@ export class MainView extends React.Component {
ContainingCollectionView={undefined}
ContainingCollectionDoc={undefined}
relative={true}
- forcedBackgroundColor={() => "lightgrey"}
+ forcedBackgroundColor={() => this.darkScheme ? "rgb(62,62,62)" : "lightgrey"}
/>
{this.docButtons}
@@ -413,8 +416,8 @@ export class MainView extends React.Component {
{this.menuPanel}
{this.flyout}
-
-
+
+
{this.dockingContent}
@@ -443,7 +446,7 @@ export class MainView extends React.Component {
expandFlyout = action((button: Doc) => {
this._flyoutWidth = (this._flyoutWidth || 250);
this._sidebarContent.proto = button.target as any;
- button._backgroundColor = "lightgrey";
+ button._backgroundColor = this.darkScheme ? "dimgrey" : "lightgrey";
button.color = "black";
this._lastButton = button;
});
diff --git a/src/client/views/collections/CollectionDockingView.scss b/src/client/views/collections/CollectionDockingView.scss
index 8b1594b21..f4736eb29 100644
--- a/src/client/views/collections/CollectionDockingView.scss
+++ b/src/client/views/collections/CollectionDockingView.scss
@@ -4,7 +4,7 @@
.lm_title {
margin-top: 3px;
border-radius: 5px;
- border: solid 1px dimgray;
+ border: solid 0px dimgray;
border-width: 2px 2px 0px;
height: 20px;
transform: translate(0px, -3px);
diff --git a/src/client/views/globalCssVariables.scss b/src/client/views/globalCssVariables.scss
index 1e0b023d7..b2ea87c06 100644
--- a/src/client/views/globalCssVariables.scss
+++ b/src/client/views/globalCssVariables.scss
@@ -33,7 +33,7 @@ $searchpanel-height: 32px;
$mainTextInput-zindex: 999; // then text input overlay so that it's context menu will appear over decorations, etc
$docDecorations-zindex: 998; // then doc decorations appear over everything else
$remoteCursors-zindex: 997; // ... not sure what level the remote cursors should go -- is this right?
-$COLLECTION_BORDER_WIDTH: 1;
+$COLLECTION_BORDER_WIDTH: 0;
$SCHEMA_DIVIDER_WIDTH: 4;
$MINIMIZED_ICON_SIZE:25;
$MAX_ROW_HEIGHT: 44px;
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.scss b/src/client/views/nodes/formattedText/FormattedTextBox.scss
index 9307f1649..b75cc230f 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.scss
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.scss
@@ -22,7 +22,7 @@
border-style: solid;
overflow-y: auto;
overflow-x: hidden;
- color: initial;
+ color: inherit;
display: flex;
flex-direction: row;
transition: opacity 1s;
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index 8017468c3..7a28f8bff 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -311,7 +311,7 @@ export class PresElementBox extends ViewBoxBaseComponent
{`${this.indexInPres + 1}.`}
}
- {miniView ? (null) :
+ {miniView ? (null) :
Date: Wed, 28 Oct 2020 14:48:04 -0400
Subject: fixed dark scheme mode for menu, properties view, and minimap
button.
---
src/client/views/ContextMenu.scss | 4 ---
src/client/views/MainView.scss | 39 +++++++++++++++++++++++++++-
src/client/views/MainView.tsx | 9 ++++---
src/client/views/PropertiesView.scss | 8 ++----
src/client/views/PropertiesView.tsx | 16 ++++++------
src/client/views/collections/TabDocView.scss | 1 -
src/client/views/collections/TabDocView.tsx | 3 ++-
src/client/views/nodes/ColorBox.tsx | 4 +--
8 files changed, 57 insertions(+), 27 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/ContextMenu.scss b/src/client/views/ContextMenu.scss
index 7467bc043..b514de5f2 100644
--- a/src/client/views/ContextMenu.scss
+++ b/src/client/views/ContextMenu.scss
@@ -43,7 +43,6 @@
.contextMenu-item {
// width: 11vw; //10vw
height: 25px; //2vh
- background: whitesmoke;
display: flex; //comment out to allow search icon to be inline with search text
justify-content: left;
align-items: center;
@@ -58,7 +57,6 @@
// padding: 10px 0px 10px 0px;
white-space: nowrap;
font-size: 13px;
- color: grey;
letter-spacing: 2px;
text-transform: uppercase;
padding-right: 30px;
@@ -75,7 +73,6 @@
.contextMenu-description {
// width: 11vw; //10vw
- background: whitesmoke;
display: flex; //comment out to allow search icon to be inline with search text
justify-content: left;
-webkit-touch-callout: none;
@@ -89,7 +86,6 @@
// padding: 10px 0px 10px 0px;
white-space: nowrap;
font-size: 10px;
- color: grey;
letter-spacing: 1px;
text-transform: uppercase;
padding-right: 30px;
diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss
index d571a0428..b49990433 100644
--- a/src/client/views/MainView.scss
+++ b/src/client/views/MainView.scss
@@ -153,7 +153,7 @@
cursor: auto;
}
-.mainView-innerContent {
+.mainView-innerContent, .mainView-innerContent-dark {
display: contents;
flex-direction: row;
position: relative;
@@ -174,6 +174,43 @@
right: 0;
position: absolute;
z-index: 2;
+ background-color: rgb(159, 159, 159);
+ .editable-title {
+ background-color: lightgrey;
+ }
+ }
+
+}
+.mainView-innerContent-dark
+{
+ .propertiesView {
+ background-color: #252525;
+ input {
+ background-color: dimgrey;
+ }
+ .propertiesView-sharingTable
+ {
+ background-color: dimgrey;
+ }
+ .editable-title {
+ background-color: dimgrey;
+ }
+ .propertiesView-field {
+ background-color: dimgrey;
+ }
+ }
+ .mainView-propertiesDragger,
+ .mainView-libraryHandle {
+ background: #353535;
+ }
+}
+.mainView-container-dark {
+ .contextMenu-cont {
+ background: dimgrey;
+ color: white;
+ input::placeholder {
+ color:white;
+ }
}
}
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index b3d198bd1..3a3dbc68f 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -232,6 +232,7 @@ export class MainView extends React.Component {
if (this.darkScheme) {
switch (doc?.type) {
case DocumentType.PRESELEMENT: return "dimgrey";
+ case DocumentType.PRES: return "#3e3e3e";
case DocumentType.FONTICON: return "black";
case DocumentType.RTF || DocumentType.LABEL || DocumentType.BUTTON: return "#2d2d2d";
case DocumentType.LINK:
@@ -414,18 +415,18 @@ export class MainView extends React.Component {
@computed get mainInnerContent() {
return <>
{this.menuPanel}
-
+
{this.flyout}
-
+ < div className="mainView-libraryHandle" style={{ display: !this._flyoutWidth ? "none" : undefined, }} onPointerDown={this.onFlyoutPointerDown} >
{this.dockingContent}
-
+
- {this.propertiesWidth() < 10 ? (null) :
}
+ {this.propertiesWidth() < 10 ? (null) :
}
>;
}
diff --git a/src/client/views/PropertiesView.scss b/src/client/views/PropertiesView.scss
index ce2a87733..1365725cb 100644
--- a/src/client/views/PropertiesView.scss
+++ b/src/client/views/PropertiesView.scss
@@ -1,6 +1,4 @@
.propertiesView {
-
- background-color: rgb(205, 205, 205);
height: 100%;
font-family: "Noto Sans";
cursor: auto;
@@ -9,7 +7,6 @@
overflow-y: auto;
.propertiesView-title {
- background-color: rgb(159, 159, 159);
text-align: center;
padding-top: 12px;
padding-bottom: 12px;
@@ -335,7 +332,6 @@
}
}
}
-
.propertiesView-fields {
//border-bottom: 1px solid black;
//padding: 8.5px;
@@ -390,7 +386,7 @@
}
}
- .field {
+ .propertiesView-field {
display: flex;
font-size: 7px;
background-color: #e8e8e8;
@@ -400,7 +396,7 @@
padding-left: 3px;
}
- .uneditable-field {
+ .propertiesView-uneditable-field {
display: flex;
overflow-y: visible;
margin-bottom: 2px;
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 4dea0ddaa..2a13ab937 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -5,7 +5,7 @@ import { intersection } from "lodash";
import { action, computed, observable } from "mobx";
import { observer } from "mobx-react";
import { ColorState, SketchPicker } from "react-color";
-import { AclAddonly, AclAdmin, AclEdit, AclPrivate, AclReadonly, AclSym, AclUnset, DataSym, Doc, Field, HeightSym, WidthSym } from "../../fields/Doc";
+import { AclAddonly, AclAdmin, AclEdit, AclPrivate, AclReadonly, AclSym, AclUnset, DataSym, Doc, Field, HeightSym, WidthSym, Opt } from "../../fields/Doc";
import { Id } from "../../fields/FieldSymbols";
import { InkField } from "../../fields/InkField";
import { ComputedField } from "../../fields/ScriptField";
@@ -36,6 +36,7 @@ const _global = (window /* browser */ || global /* node */) as any;
interface PropertiesViewProps {
width: number;
height: number;
+ backgroundColor: (doc: Opt
, renderDepth: number) => Opt;
}
@observer
@@ -144,7 +145,7 @@ export class PropertiesView extends React.Component {
);
}
}
- rows.push(
+ rows.push(
{
docs.forEach(doc => docvals.add(doc[key]));
const contents = Array.from(docvals.keys()).length > 1 ? "-multiple" : docs[0][key];
if (key[0] === "#") {
- rows.push(
+ rows.push(
{key}
);
} else if (contents !== undefined) {
const value = Field.toString(contents as Field);
if (noviceReqFields.includes(key) || key.indexOf("lastModified") !== -1) {
- rows.push(
+ rows.push(
);
@@ -200,7 +201,7 @@ export class PropertiesView extends React.Component
{
}
}
}
- rows.push(
+ rows.push(
{
return !this.selectedDoc ? (null) : CollectionDockingView.AddSplit(doc, "right")} />;
}
- previewBackground = () => "lightgrey";
@computed get layoutPreview() {
if (SelectionManager.SelectedDocuments().length > 1) {
return "-- multiple selected --";
@@ -270,7 +270,7 @@ export class PropertiesView extends React.Component {
renderDepth={1}
rootSelected={returnFalse}
treeViewDoc={undefined}
- backgroundColor={this.previewBackground}
+ backgroundColor={this.props.backgroundColor}
fitToBox={true}
FreezeDimensions={true}
dontCenter={true}
@@ -856,7 +856,7 @@ export class PropertiesView extends React.Component {
if (this.selectedDoc && !this.isPres) {
return
diff --git a/src/client/views/collections/TabDocView.scss b/src/client/views/collections/TabDocView.scss
index edf556c9f..9acbc4f85 100644
--- a/src/client/views/collections/TabDocView.scss
+++ b/src/client/views/collections/TabDocView.scss
@@ -43,7 +43,6 @@ input.lm_title {
right: 0;
width: 45px;
height: 45px;
- background: white;
transform: translate(20px, 20px) rotate(45deg);
border-radius: 30px;
padding: 2px;
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 82530c26d..38b9b399d 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -336,7 +336,8 @@ export class TabDocView extends React.Component {
{"toggle minimap"} }>
- e.stopPropagation()} onClick={action(e => { e.stopPropagation(); this._document!.hideMinimap = !this._document!.hideMinimap; })} >
+
e.stopPropagation()} onClick={action(e => { e.stopPropagation(); this._document!.hideMinimap = !this._document!.hideMinimap; })}
+ style={{ background: CollectionDockingView.Instance.props.backgroundColor?.(this._document, 0) }} >
diff --git a/src/client/views/nodes/ColorBox.tsx b/src/client/views/nodes/ColorBox.tsx
index fcc9e50f5..4fb350b55 100644
--- a/src/client/views/nodes/ColorBox.tsx
+++ b/src/client/views/nodes/ColorBox.tsx
@@ -69,11 +69,11 @@ export class ColorBox extends ViewBoxBaseComponent
StrCast(i.rootDoc.type) === DocumentType.INK).map(i => i.rootDoc.strokeWidth = Number(e.target.value));
}} />
- {ActiveInkBezierApprox() ?? 2}
+ {/* {ActiveInkBezierApprox() ?? 2}
) => {
SetActiveBezierApprox(e.target.value);
SelectionManager.SelectedDocuments().filter(i => StrCast(i.rootDoc.type) === DocumentType.INK).map(i => i.rootDoc.strokeBezier = e.target.value);
- }} />
+ }} /> */}
--
cgit v1.2.3-70-g09d2
From e65c32301dc99268a4f0746581ef70fef0077a0a Mon Sep 17 00:00:00 2001
From: bobzel
Date: Fri, 30 Oct 2020 13:02:34 -0400
Subject: fixed bookmarked views to not break when there's no current frame.
(caused the bug with the large bookmark icon after having created and invoked
a previous bookmark icon)
---
src/client/views/collections/CollectionMenu.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index 338b067fa..b44b85183 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -1324,5 +1324,5 @@ Scripting.addGlobal(function gotoFrame(doc: any, newFrame: any) {
CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0);
}
CollectionFreeFormDocumentView.updateKeyframe(childDocs, currentFrame || 0);
- doc._currentFrame = Math.max(0, newFrame);
+ doc._currentFrame = newFrame === undefined ? 0 : Math.max(0, newFrame);
});
--
cgit v1.2.3-70-g09d2
From 6c6da53ef18ed6d28c507115571fcdb980ec260c Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Sun, 1 Nov 2020 18:04:08 +0800
Subject: pinWithView works with view paths
+ removed Pan options and Scroll options
---
src/client/views/DocumentButtonBar.tsx | 6 ++-
src/client/views/PropertiesView.tsx | 4 +-
.../collectionFreeForm/CollectionFreeFormView.scss | 9 ++++-
src/client/views/nodes/PresBox.tsx | 43 +++++++++++++++++-----
.../views/presentationview/PresElementBox.tsx | 4 +-
5 files changed, 49 insertions(+), 17 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 3b22cf51c..fa0b9a238 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -201,13 +201,15 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
if (targetDoc) {
TabDocView.PinDoc(targetDoc, false);
const activeDoc = PresBox.Instance.childDocs[PresBox.Instance.childDocs.length - 1];
- if (targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.RTF || targetDoc.type === DocumentType.WEB || targetDoc._viewType === CollectionViewType.Stacking) {
+ const scrollable: boolean = (targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.RTF || targetDoc.type === DocumentType.WEB || targetDoc._viewType === CollectionViewType.Stacking);
+ const pannable: boolean = ((targetDoc.type === DocumentType.COL && targetDoc._viewType === CollectionViewType.Freeform) || targetDoc.type === DocumentType.IMG);
+ if (scrollable) {
const scroll = targetDoc._scrollTop;
activeDoc.presPinView = true;
activeDoc.presPinViewScroll = scroll;
} else if (targetDoc.type === DocumentType.VID) {
activeDoc.presPinTimecode = targetDoc._currentTimecode;
- } else if ((targetDoc.type === DocumentType.COL && targetDoc._viewType === CollectionViewType.Freeform) || targetDoc.type === DocumentType.IMG) {
+ } else if (pannable) {
const x = targetDoc._panX;
const y = targetDoc._panY;
const scale = targetDoc._viewScale;
diff --git a/src/client/views/PropertiesView.tsx b/src/client/views/PropertiesView.tsx
index 4dea0ddaa..9b77e2736 100644
--- a/src/client/views/PropertiesView.tsx
+++ b/src/client/views/PropertiesView.tsx
@@ -1029,7 +1029,7 @@ export class PropertiesView extends React.Component {
{PresBox.Instance.progressivizeDropdown}
: null}
} */}
- {!selectedItem || (!scrollable && !pannable) ? (null) :
+ {/* {!selectedItem || (!scrollable && !pannable) ? (null) :
{ this.openSlideOptions = !this.openSlideOptions; })}
style={{ backgroundColor: this.openSlideOptions ? "black" : "" }}>
@@ -1041,7 +1041,7 @@ export class PropertiesView extends React.Component
{
{this.openSlideOptions ?
{PresBox.Instance.optionsDropdown}
: null}
- }
+
} */}
{/*
{ this.openAddSlide = !this.openAddSlide; })}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss
index 75cbc20ca..e92100c50 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss
@@ -57,7 +57,7 @@
min-height: 15px;
text-align: center;
background-color: #69a6db;
- border-radius: 5px;
+ border-radius: 10%;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
font-family: Roboto;
font-weight: 500;
@@ -65,6 +65,13 @@
}
}
+.pathOrder-presPinView {
+ position: absolute;
+ z-index: 190000;
+ border-style: dashed;
+ border-color: #69a5db;
+}
+
.progressivizeButton {
position: absolute;
display: grid;
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index f8f794a4b..d7f15166f 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -808,6 +808,8 @@ export class PresBox extends ViewBoxBaseComponent
@computed get order() {
const order: JSX.Element[] = [];
const docs: Doc[] = [];
+ const presCollection = Cast(this.rootDoc.presCollection, Doc, null);
+ const dv = DocumentManager.Instance.getDocumentView(presCollection);
this.childDocs.filter(doc => Cast(doc.presentationTargetDoc, Doc, null)).forEach((doc, index) => {
const tagDoc = Cast(doc.presentationTargetDoc, Doc, null);
const srcContext = Cast(tagDoc.context, Doc, null);
@@ -816,8 +818,9 @@ export class PresBox extends ViewBoxBaseComponent
const edge = Math.max(width, height);
const fontSize = edge * 0.8;
const gap = 2;
- // Case A: Document is contained within the collection
- if (this.rootDoc.presCollection === srcContext) {
+ if (presCollection === srcContext) {
+ // Case A: Document is contained within the collection
+ console.log(`-------Case A: ${index}-------`);
if (docs.includes(tagDoc)) {
const prevOccurances: number = this.getAllIndexes(docs, tagDoc).length;
docs.push(tagDoc);
@@ -838,15 +841,33 @@ export class PresBox extends ViewBoxBaseComponent
{index + 1}
);
}
+ } else if (doc.presPinView && presCollection === tagDoc && dv) {
// Case B: Document is presPinView and is presCollection
- } else if (doc.pinWithView && this.layoutDoc.presCollection === tagDoc) {
+ console.log(`-------Case B: ${index}-------`);
+ const scale: number = 1 / NumCast(doc.presPinViewScale);
+ const height: number = dv.props.PanelHeight() * scale;
+ const width: number = dv.props.PanelWidth() * scale;
+ const indWidth = width / 10;
+ const indHeight = Math.max(height / 10, 15);
+ const indEdge = Math.max(indWidth, indHeight);
+ const indFontSize = indEdge * 0.8;
+ const xLoc: number = NumCast(doc.presPinViewX) - (width / 2);
+ const yLoc: number = NumCast(doc.presPinViewY) - (height / 2);
docs.push(tagDoc);
order.push(
-
);
- // Case C: Document is not contained within presCollection
+ <>
+
this.selectElement(doc)}
+ >
+
{index + 1}
+
+
+ >);
} else {
+ // Case C: Document is not contained within presCollection
+ console.log(`-------Case C: ${index}-------`);
docs.push(tagDoc);
order.push(
@@ -875,9 +896,11 @@ export class PresBox extends ViewBoxBaseComponent
const n1y = NumCast(tagDoc.y) + (NumCast(tagDoc._height) / 2);
if (index = 0) pathPoints = n1x + "," + n1y;
else pathPoints = pathPoints + " " + n1x + "," + n1y;
- } else {
- if (index = 0) pathPoints = 0 + "," + 0;
- else pathPoints = pathPoints + " " + 0 + "," + 0;
+ } else if (doc.presPinView) {
+ const n1x = NumCast(doc.presPinViewX);
+ const n1y = NumCast(doc.presPinViewY);
+ if (index = 0) pathPoints = n1x + "," + n1y;
+ else pathPoints = pathPoints + " " + n1x + "," + n1y;
}
});
return ( = React.createRef();
--
cgit v1.2.3-70-g09d2
From d000fe7a7f89cb7252c8a23e0f88a61775ba2933 Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Sun, 1 Nov 2020 21:07:31 +0800
Subject: Remove any attempt at auto playing audio
---
src/client/views/collections/CollectionMenu.tsx | 2 +-
.../collectionFreeForm/CollectionFreeFormView.tsx | 62 ++++++++++++++++------
.../collectionFreeForm/MarqueeOptionsMenu.tsx | 2 +-
src/client/views/nodes/PresBox.tsx | 33 ++++++------
4 files changed, 65 insertions(+), 34 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index 338b067fa..38817a601 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -432,7 +432,7 @@ export class CollectionViewBaseChrome extends React.Component;
const targetDoc = this.selectedDoc;
{/* return (!targetDoc || (targetDoc._viewType !== CollectionViewType.Freeform && targetDoc.type !== DocumentType.IMG)) ? (null) : {"Pin to presentation trail with current view"}
>} placement="top"> */ }
- return (targetDoc && targetDoc.type !== DocumentType.PRES && (targetDoc._viewType === CollectionViewType.Freeform || targetDoc._viewType === CollectionViewType.Stacking || targetDoc.type === DocumentType.VID || targetDoc.type === DocumentType.IMG || targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.WEB || targetDoc.type === DocumentType.VID || targetDoc.type === DocumentType.RTF || targetDoc.type === DocumentType.COMPARISON)) ? {"Pin to presentation trail with current view"}
>} placement="top">
+ return (targetDoc && targetDoc.type !== DocumentType.PRES && (targetDoc._viewType === CollectionViewType.Freeform || targetDoc._viewType === CollectionViewType.Stacking || targetDoc.type === DocumentType.VID || targetDoc.type === DocumentType.IMG || targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.WEB || targetDoc.type === DocumentType.VID || targetDoc.type === DocumentType.RTF || targetDoc.type === DocumentType.COMPARISON)) ? {"Pin with current view"}
>} placement="top">
;
+ return (
+ <>
+
{
+ const target = e.target as any;
+ if (getComputedStyle(target)?.overflow === "visible") { // if collection is visible, then scrolling will mess things up since there are no scroll bars
+ target.scrollTop = target.scrollLeft = 0;
+ }
+ }}
+ style={{
+ transform: `translate(${cenx}px, ${ceny}px) scale(${zoom}) translate(${panx}px, ${pany}px)`,
+ transition: this.props.transition,
+ //willChange: "transform"
+ }}>
+ {this.props.children()}
+ {this.presPaths}
+ {this.progressivize}
+ {this.zoomProgressivize}
+
+ {/*
{this.presPathsOutsideCollection}
*/}
+ >);
}
}
\ No newline at end of file
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
index d8e44e781..cedeb1112 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeOptionsMenu.tsx
@@ -54,7 +54,7 @@ export class MarqueeOptionsMenu extends AntimodeMenu
{
,
- Pin the selected region to presentation
>} placement="bottom">
+ Pin with selected region
>} placement="bottom">
>);
- } else {
- // Case C: Document is not contained within presCollection
- console.log(`-------Case C: ${index}-------`);
- docs.push(tagDoc);
- order.push(
-
);
}
});
return order;
@@ -891,15 +880,16 @@ export class PresBox extends ViewBoxBaseComponent
*/
@computed get paths() {
let pathPoints = "";
+ const presCollection = Cast(this.rootDoc.presCollection, Doc, null);
this.childDocs.forEach((doc, index) => {
const tagDoc = Cast(doc.presentationTargetDoc, Doc, null);
const srcContext = Cast(tagDoc?.context, Doc, null);
- if (tagDoc && this.rootDoc.presCollection === srcContext) {
+ if (tagDoc && presCollection === srcContext) {
const n1x = NumCast(tagDoc.x) + (NumCast(tagDoc._width) / 2);
const n1y = NumCast(tagDoc.y) + (NumCast(tagDoc._height) / 2);
if (index = 0) pathPoints = n1x + "," + n1y;
else pathPoints = pathPoints + " " + n1x + "," + n1y;
- } else if (doc.presPinView) {
+ } else if (doc.presPinView && presCollection === tagDoc) {
const n1x = NumCast(doc.presPinViewX);
const n1y = NumCast(doc.presPinViewY);
if (index = 0) pathPoints = n1x + "," + n1y;
@@ -2040,7 +2030,10 @@ export class PresBox extends ViewBoxBaseComponent
{this.layoutDoc.presStatus === PresStatus.Autoplay ? "Pause" : "Autoplay"}
>}>
{ this.next(); if (this._presTimer) { clearTimeout(this._presTimer); this.layoutDoc.presStatus = PresStatus.Manual; } }}>
- 250 ? "inline-flex" : "none" }}>
+
this.gotoDocument(0)}
+ style={{ display: this.props.PanelWidth() > 250 ? "inline-flex" : "none" }}>
Slide {this.itemIndex + 1} / {this.childDocs.length}
{this.playButtonFrames}
@@ -2074,7 +2067,7 @@ export class PresBox extends ViewBoxBaseComponent
{this.layoutDoc.presStatus === PresStatus.Autoplay ? "Pause" : "Autoplay"}
>}>
{ this.next(); if (this._presTimer) { clearTimeout(this._presTimer); this.layoutDoc.presStatus = PresStatus.Manual; } }}>
-
+
this.gotoDocument(0)}>
Slide {this.itemIndex + 1} / {this.childDocs.length}
{this.playButtonFrames}
--
cgit v1.2.3-70-g09d2
From 35de050c423edba2be6833492438a5e02f45f938 Mon Sep 17 00:00:00 2001
From: bobzel
Date: Sun, 1 Nov 2020 10:31:31 -0500
Subject: minor cleanup
---
.../collectionFreeForm/CollectionFreeFormView.tsx | 37 ++++++++++------------
1 file changed, 17 insertions(+), 20 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index eb278681d..fdcfb00d8 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1665,25 +1665,22 @@ class CollectionFreeFormViewPannableContents extends React.Component
- {
- const target = e.target as any;
- if (getComputedStyle(target)?.overflow === "visible") { // if collection is visible, then scrolling will mess things up since there are no scroll bars
- target.scrollTop = target.scrollLeft = 0;
- }
- }}
- style={{
- transform: `translate(${cenx}px, ${ceny}px) scale(${zoom}) translate(${panx}px, ${pany}px)`,
- transition: this.props.transition,
- //willChange: "transform"
- }}>
- {this.props.children()}
- {this.presPaths}
- {this.progressivize}
- {this.zoomProgressivize}
-
- >);
+ return {
+ const target = e.target as any;
+ if (getComputedStyle(target)?.overflow === "visible") { // if collection is visible, then scrolling will mess things up since there are no scroll bars
+ target.scrollTop = target.scrollLeft = 0;
+ }
+ }}
+ style={{
+ transform: `translate(${cenx}px, ${ceny}px) scale(${zoom}) translate(${panx}px, ${pany}px)`,
+ transition: this.props.transition,
+ //willChange: "transform"
+ }}>
+ {this.props.children()}
+ {this.presPaths}
+ {this.progressivize}
+ {this.zoomProgressivize}
+
;
}
}
\ No newline at end of file
--
cgit v1.2.3-70-g09d2
From 0ddd75da0f0b42cf3e1692e1cb1761c0e70ed551 Mon Sep 17 00:00:00 2001
From: bobzel
Date: Mon, 2 Nov 2020 14:11:25 -0500
Subject: fixed up dropping documents into a collection that doesn't have an
activeFrame set so that they can be resized
---
.../collections/collectionFreeForm/CollectionFreeFormView.tsx | 9 +++++++++
1 file changed, 9 insertions(+)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index fdcfb00d8..58a9c4974 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -169,14 +169,23 @@ export class CollectionFreeFormView extends CollectionSubView
Date: Mon, 2 Nov 2020 20:19:25 -0500
Subject: fixed display of text controls for nested text boxes like captions.
---
src/client/views/collections/CollectionMenu.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index 1dbafbd61..cf94a93d3 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -551,7 +551,7 @@ export class CollectionFreeFormViewChrome extends React.Component
Date: Wed, 4 Nov 2020 02:47:49 +0800
Subject: reset old width
because default width for doc is 400 so max does not work
---
src/client/views/EditableView.tsx | 3 ++-
src/client/views/collections/CollectionSubView.tsx | 2 +-
src/client/views/nodes/PresBox.tsx | 6 ++----
src/client/views/presentationview/PresElementBox.scss | 2 +-
src/client/views/presentationview/PresElementBox.tsx | 13 ++++++++-----
5 files changed, 14 insertions(+), 12 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx
index 9606b5a91..ed7a8265f 100644
--- a/src/client/views/EditableView.tsx
+++ b/src/client/views/EditableView.tsx
@@ -35,6 +35,7 @@ export interface EditableProps {
sizeToContent?: boolean;
maxHeight?: number;
display?: string;
+ overflow?: string;
autosuggestProps?: {
resetValue: () => void;
value: string,
@@ -227,7 +228,7 @@ export class EditableView extends React.Component {
setTimeout(() => this.props.autosuggestProps?.resetValue(), 0);
return this.props.contents instanceof ObjectField ? (null) :
{
this.props.contents ? this.props.contents?.valueOf() : this.props.placeholder?.valueOf()}
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index f88ebd9ac..b27f64ff0 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -483,7 +483,7 @@ export function CollectionSubView(schemaCtor: (doc: Doc) => T, moreProps?:
if (text && !text.includes("https://")) {
UndoManager.RunInBatch(() => this.addDocument(Docs.Create.TextDocument(text, { ...options, title: text.substring(0, 20), _width: 400, _height: 315 })), "drop");
} else {
- alert("Document updloaded failed - possibly an unsupported file type.");
+ alert("Document upload failed - possibly an unsupported file type.");
}
}
disposer();
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index 04eda8b90..190af34b9 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -322,10 +322,8 @@ export class PresBox extends ViewBoxBaseComponent
// Handles the setting of presCollection
if (includesDoc) {
//Case 1: Pres collection should not change as it is already the same
- console.log(1);
} else if (tab !== undefined) {
// Case 2: Pres collection should update
- console.log(2);
this.layoutDoc.presCollection = srcContext;
}
const presStatus = this.rootDoc.presStatus;
@@ -352,10 +350,10 @@ export class PresBox extends ViewBoxBaseComponent
if (activeItem.openDocument) {
openInTab();
} else if (curDoc.presMovement === PresMovement.Pan && targetDoc) {
- await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc ? undefined : resetSelection); // documents open in new tab instead of on right
+ await DocumentManager.Instance.jumpToDocument(targetDoc, false, openInTab, srcContext, undefined, undefined, undefined, includesDoc || tab ? undefined : resetSelection); // documents open in new tab instead of on right
} else if ((curDoc.presMovement === PresMovement.Zoom || curDoc.presMovement === PresMovement.Jump) && targetDoc) {
//awaiting jump so that new scale can be found, since jumping is async
- await DocumentManager.Instance.jumpToDocument(targetDoc, true, openInTab, srcContext, undefined, undefined, undefined, includesDoc ? undefined : resetSelection); // documents open in new tab instead of on right
+ await DocumentManager.Instance.jumpToDocument(targetDoc, true, openInTab, srcContext, undefined, undefined, undefined, includesDoc || tab ? undefined : resetSelection); // documents open in new tab instead of on right
}
// After navigating to the document, if it is added as a presPinView then it will
// adjust the pan and scale to that of the pinView when it was added.
diff --git a/src/client/views/presentationview/PresElementBox.scss b/src/client/views/presentationview/PresElementBox.scss
index df5e346e1..73a08b6de 100644
--- a/src/client/views/presentationview/PresElementBox.scss
+++ b/src/client/views/presentationview/PresElementBox.scss
@@ -42,7 +42,7 @@ $slide-active: #5B9FDD;
background-color: #d5dce2;
border-radius: 5px;
height: calc(100% - 7px);
- width: calc(100% - 5px);
+ width: calc(100% - 15px);
display: grid;
grid-template-rows: 16px 10px auto;
grid-template-columns: max-content max-content max-content max-content auto;
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx
index 0e10cce47..7b4afeb69 100644
--- a/src/client/views/presentationview/PresElementBox.tsx
+++ b/src/client/views/presentationview/PresElementBox.tsx
@@ -273,15 +273,17 @@ export class PresElementBox extends ViewBoxBaseComponent= 300;
- const miniView: boolean = this.toolbarWidth <= 100;
+ const miniView: boolean = this.toolbarWidth <= 110;
const targetDoc: Doc = this.targetDoc;
const activeItem: Doc = this.rootDoc;
return (
@@ -311,11 +313,12 @@ export class PresElementBox extends ViewBoxBaseComponent}
{miniView ? (null) :
-
+
StrCast(activeItem.title)}
SetValue={this.onSetValue}
/>
@@ -344,7 +347,7 @@ export class PresElementBox extends ViewBoxBaseComponent e.stopPropagation()} />
-
{activeItem.presPinView ? (<>View of {targetDoc.title}>) : targetDoc.title}
+
{activeItem.presPinView ? (<>View of {targetDoc.title}>) : targetDoc.title}
{this.renderEmbeddedInline}
}
);
--
cgit v1.2.3-70-g09d2
From eacb4733e85ada91520fe401f5c1351f7bbc38d4 Mon Sep 17 00:00:00 2001
From: bobzel
Date: Tue, 3 Nov 2020 14:26:19 -0500
Subject: added undo's for icon/deiconifying pile docs and icon docs. added a
zoom hack to focus on stacking documents. stopped autoscroll on nested
collections.
---
src/client/views/collections/CollectionPileView.tsx | 14 ++++++++------
src/client/views/collections/CollectionStackingView.tsx | 2 +-
.../collectionFreeForm/CollectionFreeFormView.tsx | 2 +-
src/client/views/nodes/DocumentView.tsx | 2 +-
4 files changed, 11 insertions(+), 9 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/CollectionPileView.tsx b/src/client/views/collections/CollectionPileView.tsx
index 5b4730848..2636b98e5 100644
--- a/src/client/views/collections/CollectionPileView.tsx
+++ b/src/client/views/collections/CollectionPileView.tsx
@@ -6,7 +6,7 @@ import { emptyFunction, setupMoveUpEvents } from "../../../Utils";
import { DocUtils } from "../../documents/Documents";
import { SelectionManager } from "../../util/SelectionManager";
import { SnappingManager } from "../../util/SnappingManager";
-import { UndoManager } from "../../util/UndoManager";
+import { UndoManager, undoBatch } from "../../util/UndoManager";
import { CollectionFreeFormView } from "./collectionFreeForm/CollectionFreeFormView";
import "./CollectionPileView.scss";
import { CollectionSubView } from "./CollectionSubView";
@@ -34,14 +34,14 @@ export class CollectionPileView extends CollectionSubView(doc => doc) {
const draggingSelf = this.props.isSelected();
return
{
+ addDocument={undoBatch((doc: Doc | Doc[]) => {
(doc instanceof Doc ? [doc] : doc).map((d) => DocUtils.iconify(d));
return this.props.addDocument(doc);
- }}
- moveDocument={(doc: Doc | Doc[], targetCollection: Doc | undefined, addDoc: (doc: Doc | Doc[]) => boolean) => {
- (doc instanceof Doc ? [doc] : doc).map((d) => Doc.deiconifyView(d));
+ })}
+ moveDocument={undoBatch((doc: Doc | Doc[], targetCollection: Doc | undefined, addDoc: (doc: Doc | Doc[]) => boolean) => {
+ (doc instanceof Doc ? [doc] : doc).map(undoBatch((d) => Doc.deiconifyView(d)));
return this.props.moveDocument(doc, targetCollection, addDoc);
- }} />
+ })} />
;
}
@@ -107,6 +107,8 @@ export class CollectionPileView extends CollectionSubView(doc => doc) {
}
// onClick for toggling the pileup view
+ @undoBatch
+ @action
onClick = (e: React.MouseEvent) => {
if (e.button === 0) {
SelectionManager.DeselectAll();
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 4880d342c..7a3257525 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -172,7 +172,7 @@ export class CollectionStackingView extends CollectionSubView boolean) => {
Doc.BrushDoc(doc);
- this.props.focus(doc);
+ this.props.focus(this.props.Document, true); // bcz: HACK ARgh.. need to update all focus() functions to take parameters about how to focus. in this case, we want to zoom so we pass true and hope an ancestor is a collection view
Doc.linkFollowHighlight(doc);
const found = this._mainCont && Array.from(this._mainCont.getElementsByClassName("documentView-node")).find((node: any) => node.id === doc[Id]);
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 58a9c4974..703776e72 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1218,7 +1218,7 @@ export class CollectionFreeFormView extends CollectionSubView(Docu
thisContainer: this.props.ContainingCollectionDoc,
shiftKey: e.shiftKey
}, console.log);
- func();
+ undoBatch(func)();
} else if (!Doc.IsSystem(this.props.Document)) {
if (this.props.Document.type === DocumentType.INK) {
InkStrokeProperties.Instance && (InkStrokeProperties.Instance._controlBtn = true);
--
cgit v1.2.3-70-g09d2
From a43c3c014c3e7bbdfbee8bf234a5812d1601b945 Mon Sep 17 00:00:00 2001
From: bobzel
Date: Tue, 3 Nov 2020 17:28:37 -0500
Subject: fixed masonry view to not create empty documents
---
src/client/views/collections/CollectionMasonryViewFieldRow.tsx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
index 7014966c7..b35644c6b 100644
--- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
+++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
@@ -138,7 +138,8 @@ export class CollectionMasonryViewFieldRow extends React.Component {
+ addDocument = (value: string, shiftDown?: boolean, forceEmptyNote?: boolean) => {
+ if (!value && !forceEmptyNote) return false;
this._createAliasSelected = false;
const key = StrCast(this.props.parent.props.Document._pivotField);
const newDoc = Docs.Create.TextDocument(value, { _autoHeight: true, _width: 200, title: value });
@@ -239,6 +240,10 @@ export class CollectionMasonryViewFieldRow extends React.Component
);
}
+ @action
+ textCallback = (char: string) => {
+ return this.addDocument("", false);
+ }
@computed get contentLayout() {
const rows = Math.max(1, Math.min(this.props.docList.length, Math.floor((this.props.parent.props.PanelWidth() - 2 * this.props.parent.xMargin) / (this.props.parent.columnWidth + this.props.parent.gridGap))));
@@ -247,6 +252,7 @@ export class CollectionMasonryViewFieldRow extends React.Component "",
SetValue: this.addDocument,
+ textCallback: this.textCallback,
contents: "+ NEW",
HeadingObject: this.props.headingObject,
toggle: this.toggleVisibility,
--
cgit v1.2.3-70-g09d2
From 14132f488b29641302fe10711a938b1bbdecc4fa Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Wed, 4 Nov 2020 21:56:23 +0800
Subject: select item in trail after marquee select
---
src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index efbe85f1a..7040b5e56 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -407,6 +407,10 @@ export class MarqueeView extends React.Component
Date: Thu, 5 Nov 2020 11:27:43 -0500
Subject: fixed color of libraryHandle. changed opening a prensetation that is
alrady open and minimzed to do nothing.
---
src/client/views/MainView.scss | 3 +++
src/client/views/collections/CollectionDockingView.tsx | 2 ++
2 files changed, 5 insertions(+)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss
index b49990433..33bd7e77e 100644
--- a/src/client/views/MainView.scss
+++ b/src/client/views/MainView.scss
@@ -181,6 +181,9 @@
}
}
+.mainView-libraryHandle {
+ background-color: lightgrey;
+}
.mainView-innerContent-dark
{
.propertiesView {
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index d2c065417..e43f188e7 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -22,6 +22,7 @@ import { CollectionViewType } from './CollectionView';
import { TabDocView } from './TabDocView';
import React = require("react");
import { stat } from 'fs';
+import { DocumentType } from '../../documents/DocumentTypes';
const _global = (window /* browser */ || global /* node */) as any;
@observer
@@ -143,6 +144,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
@undoBatch
@action
public static AddSplit(document: Doc, pullSide: string, stack?: any, panelName?: string) {
+ if (document.type === DocumentType.PRES && DocListCast(Cast(Doc.UserDoc().myOverlayDocs, Doc, null).data).includes(document)) return false;
if (document._viewType === CollectionViewType.Docking) return CurrentUserUtils.openDashboard(Doc.UserDoc(), document);
const tab = Array.from(CollectionDockingView.Instance.tabMap).find(tab => tab.DashDoc === document);
--
cgit v1.2.3-70-g09d2
From d3e15778ae7d878f8bbd71a81d5ed77f641a3a1b Mon Sep 17 00:00:00 2001
From: bobzel
Date: Thu, 5 Nov 2020 12:06:23 -0500
Subject: changed opening a presentation that is open in minimized mode to move
the minimized version to the a right split
---
src/client/views/collections/CollectionDockingView.tsx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index e43f188e7..abe8477e4 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -23,6 +23,7 @@ import { TabDocView } from './TabDocView';
import React = require("react");
import { stat } from 'fs';
import { DocumentType } from '../../documents/DocumentTypes';
+import { listSpec } from '../../../fields/Schema';
const _global = (window /* browser */ || global /* node */) as any;
@observer
@@ -144,7 +145,12 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
@undoBatch
@action
public static AddSplit(document: Doc, pullSide: string, stack?: any, panelName?: string) {
- if (document.type === DocumentType.PRES && DocListCast(Cast(Doc.UserDoc().myOverlayDocs, Doc, null).data).includes(document)) return false;
+ if (document.type === DocumentType.PRES) {
+ const docs = Cast(Cast(Doc.UserDoc().myOverlayDocs, Doc, null).data, listSpec(Doc), []);
+ if (docs.includes(document)) {
+ docs.splice(docs.indexOf(document), 1);
+ }
+ }
if (document._viewType === CollectionViewType.Docking) return CurrentUserUtils.openDashboard(Doc.UserDoc(), document);
const tab = Array.from(CollectionDockingView.Instance.tabMap).find(tab => tab.DashDoc === document);
--
cgit v1.2.3-70-g09d2
From 24d2da070fbac9d950bae0eff6cdf4137d9b5305 Mon Sep 17 00:00:00 2001
From: bobzel
Date: Fri, 6 Nov 2020 15:26:17 -0500
Subject: fixed web pages to scroll and update scrollTop when in annotation
mode. fixed pointer events on custom text view headers.
---
src/client/documents/Documents.ts | 1 +
src/client/util/CurrentUserUtils.ts | 2 +-
.../views/collections/CollectionStackingView.tsx | 5 +-
src/client/views/nodes/WebBox.tsx | 82 +++++++++++-----------
4 files changed, 47 insertions(+), 43 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index d7af88b72..2d8a897a5 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -61,6 +61,7 @@ export interface DocumentOptions {
_autoHeight?: boolean;
_headerHeight?: number; // height of header of custom notes
_headerFontSize?: number; // font size of header of custom notes
+ _headerPointerEvents?: string; // types of events the header of a custom text document can consume
_panX?: number;
_panY?: number;
_width?: number;
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 5886aa13f..4f054269f 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -405,7 +405,7 @@ export class CurrentUserUtils {
selection: { type: "text", anchor: 1, head: 1 },
storedMarks: []
};
- const headerTemplate = Docs.Create.RTFDocument(new RichTextField(JSON.stringify(json), ""), { title: "header", version: headerViewVersion, target: doc, _height: 70, _headerHeight: 12, _headerFontSize: 9, _autoHeight: true, system: true, cloneFieldFilter: new List(["system"]) }, "header"); // text needs to be a space to allow templateText to be created
+ const headerTemplate = Docs.Create.RTFDocument(new RichTextField(JSON.stringify(json), ""), { title: "header", version: headerViewVersion, target: doc, _height: 70, _headerPointerEvents: "all", _headerHeight: 12, _headerFontSize: 9, _autoHeight: true, system: true, cloneFieldFilter: new List(["system"]) }, "header"); // text needs to be a space to allow templateText to be created
headerTemplate[DataSym].layout =
"" +
"
" +
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 7a3257525..2285bcb8f 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -289,8 +289,11 @@ export class CollectionStackingView extends CollectionSubView
(pos[axis] + pos1[axis]) / 2 ? 1 : 0;
}
});
+ const oldDocs = this.childDocs.length;
if (super.onInternalDrop(e, de)) {
- const newDocs = de.complete.docDragData.droppedDocuments;
+ const newDocs = this.childDocs.slice().filter((d: Doc, ind: number) => ind >= oldDocs);
+
+ //de.complete.docDragData.droppedDocuments;
const docs = this.childDocList;
DragManager.docsBeingDragged = [];
if (docs && newDocs.length) {
diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx
index 1e5e8133d..80e2d3ce2 100644
--- a/src/client/views/nodes/WebBox.tsx
+++ b/src/client/views/nodes/WebBox.tsx
@@ -43,21 +43,19 @@ export class WebBox extends ViewBoxAnnotatableComponent = React.createRef();
static _annotationStyle: any = addStyleSheet();
+ public static LayoutString(fieldKey: string) { return FieldView.LayoutString(WebBox, fieldKey); }
private _mainCont: React.RefObject = React.createRef();
private _startX: number = 0;
private _startY: number = 0;
- private _scrollTarget: any = undefined;
@observable private _marqueeX: number = 0;
@observable private _marqueeY: number = 0;
@observable private _marqueeWidth: number = 0;
@observable private _marqueeHeight: number = 0;
@observable private _marqueeing: boolean = false;
- public static LayoutString(fieldKey: string) { return FieldView.LayoutString(WebBox, fieldKey); }
- get _collapsed() { return StrCast(this.layoutDoc._chromeStatus) !== "enabled"; }
- set _collapsed(value) { this.layoutDoc._chromeStatus = !value ? "enabled" : "disabled"; }
@observable private _url: string = "hello";
@observable private _pressX: number = 0;
@observable private _pressY: number = 0;
+ @observable private _iframe: HTMLIFrameElement | null = null;
@observable private _savedAnnotations: Dictionary = new Dictionary();
private _selectionReactionDisposer?: IReactionDisposer;
private _scrollReactionDisposer?: IReactionDisposer;
@@ -65,10 +63,13 @@ export class WebBox extends ViewBoxAnnotatableComponent();
- private _iframeRef = React.createRef();
private _iframeIndicatorRef = React.createRef();
private _iframeDragRef = React.createRef();
private _setPreviewCursor: undefined | ((x: number, y: number, drag: boolean) => void);
+ get scrollHeight() { return this.webpage?.scrollHeight || 1000; }
+ get _collapsed() { return StrCast(this.layoutDoc._chromeStatus) !== "enabled"; }
+ set _collapsed(value) { this.layoutDoc._chromeStatus = !value ? "enabled" : "disabled"; }
+ get webpage() { return this._iframe?.contentDocument?.children[0]; }
constructor(props: any) {
super(props);
@@ -79,8 +80,8 @@ export class WebBox extends ViewBoxAnnotatableComponent {
- const iframe = this._iframeRef.current;
- if (iframe && iframe.contentDocument) {
+ const iframe = this._iframe;
+ if (iframe?.contentDocument) {
iframe.setAttribute("enable-annotation", "true");
iframe.contentDocument.addEventListener("click", undoBatch(action(e => {
let href = "";
@@ -93,10 +94,10 @@ export class WebBox extends ViewBoxAnnotatableComponent ({ scrollY: this.layoutDoc._scrollY, scrollX: this.layoutDoc._scrollX }),
@@ -121,7 +122,7 @@ export class WebBox extends ViewBoxAnnotatableComponent {
const durationStr = StrCast(this.Document._viewTransition).match(/([0-9]*)ms/);
const duration = durationStr ? Number(durationStr[1]) : 1000;
- if (scrollTop !== undefined && this._forceSmoothScrollUpdate) {
+ if (scrollTop !== this._outerRef.current?.scrollTop && scrollTop !== undefined && this._forceSmoothScrollUpdate) {
this._outerRef.current && smoothScroll(duration, this._outerRef.current, Math.abs(scrollTop || 0), () => this._forceSmoothScrollUpdate = true);
} else this._forceSmoothScrollUpdate = true;
},
@@ -144,10 +145,10 @@ export class WebBox extends ViewBoxAnnotatableComponent void) => this._setPreviewCursor = func;
iframeWheel = (e: any) => {
if (this._forceSmoothScrollUpdate && e.target?.children) {
- this._scrollTarget && setTimeout(action(() => {
- this._scrollTarget.scrollLeft = 0;
- const scrollTop = this._scrollTarget.scrollTop;
- const scrollLeft = this._scrollTarget.scrollLeft;
+ this.webpage && setTimeout(action(() => {
+ this.webpage!.scrollLeft = 0;
+ const scrollTop = this.webpage!.scrollTop;
+ const scrollLeft = this.webpage!.scrollLeft;
this._outerRef.current!.scrollTop = scrollTop;
this._outerRef.current!.scrollLeft = scrollLeft;
if (this.layoutDoc._scrollTop !== scrollTop) {
@@ -161,9 +162,6 @@ export class WebBox extends ViewBoxAnnotatableComponent {
- this._scrollTarget = e.target.children[0];
- }
async componentDidMount() {
const urlField = Cast(this.dataDoc[this.props.fieldKey], WebField);
runInAction(() => this._url = urlField?.url.toString() || "");
@@ -210,8 +208,7 @@ export class WebBox extends ViewBoxAnnotatableComponent {
@@ -330,9 +327,9 @@ export class WebBox extends ViewBoxAnnotatableComponent { e.currentTarget.before((e.currentTarget.contentDocument?.body || e.currentTarget.contentDocument)?.children[0]!); e.currentTarget.remove(); }}
- view = } placement="top">
+
+ ;
+ }
render() {
return (
@@ -513,6 +519,7 @@ export class CollectionViewBaseChrome extends React.Component
}
{this.notACollection ? (null) : this.lightboxButton}
+ {this.notACollection ? (null) : this.gridbackgroundButton}
{this.aliasButton}
{/* {this.pinButton} */}
{this.pinWithViewButton}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss
index e92100c50..a50b41198 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.scss
@@ -12,6 +12,13 @@
border-radius: inherit;
}
+.collectionfreeformview-grid {
+ transform-origin: top left;
+ position: absolute;
+ top: 0;
+ left: 0;
+}
+
.collectionfreeformview-viewdef {
>.collectionFreeFormDocumentView-container {
pointer-events: none;
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 703776e72..8a4ce826f 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1434,6 +1434,38 @@ export class CollectionFreeFormView extends CollectionSubView {
+ const ctx = el?.getContext('2d');
+ if (ctx) {
+ const Cx = (cx / this.zoomScaling()) % gridSpace - 0;
+ const Cy = (cy / this.zoomScaling()) % gridSpace - 0;
+ ctx.clearRect(0, 0, w, h);
+ if (ctx) {
+ ctx.strokeStyle = "rgba(0, 0, 0, 0.5)";
+ ctx.lineWidth = Math.min(1, Math.max(0.5, 0.5 / this.zoomScaling()));
+ ctx.beginPath();
+ for (let x = Cx; x <= -Cx + w; x += gridSpace) {
+ ctx.moveTo(x, Cy - h);
+ ctx.lineTo(x, Cy + h);
+ }
+ for (let y = Cy; y <= -Cy + h; y += gridSpace) {
+ ctx.moveTo(Cx - w, y);
+ ctx.lineTo(Cx + w, y);
+ }
+ ctx.stroke();
+ }
+ }
+ }} />;
+ }
@computed get marqueeView() {
return
+ {this.layoutDoc["_backgroundGrid-show"] ? this.grid : (null)}
;
}
+
@computed get contentScaling() {
if (this.props.annotationsKey && !this.props.forceScaling) return 0;
const nw = returnVal(this.props.NativeWidth?.(), Doc.NativeWidth(this.Document));
@@ -1635,7 +1669,7 @@ class CollectionFreeFormViewPannableContents extends React.Component;
}
+
render() {
// trace();
const freeformclass = "collectionfreeformview" + (this.props.viewDefDivClick ? "-viewDef" : "-none");
diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx
index 52e09a469..683cb938a 100644
--- a/src/client/views/nodes/PresBox.tsx
+++ b/src/client/views/nodes/PresBox.tsx
@@ -426,7 +426,7 @@ export class PresBox extends ViewBoxBaseComponent
if (tagDoc) tagDoc.opacity = 1;
const itemIndexes: number[] = this.getAllIndexes(this.tagDocs, tagDoc);
const curInd: number = itemIndexes.indexOf(index);
- if (tagDoc === this.layoutDoc.presCollection) { tagDoc.opacity = 1 }
+ if (tagDoc === this.layoutDoc.presCollection) { tagDoc.opacity = 1; }
else {
if (itemIndexes.length > 1 && curDoc.presHideBefore && curInd !== 0) { }
else if (curDoc.presHideBefore) {
@@ -1210,7 +1210,7 @@ export class PresBox extends ViewBoxBaseComponent
const targetDoc: Doc = this.targetDoc;
this.updateMovement(activeItem.presMovement, true);
this.updateEffect(targetDoc.presEffect, true);
- this.updateEffectDirection(targetDoc.presEffectDirection, true)
+ this.updateEffectDirection(targetDoc.presEffectDirection, true);
array.forEach((doc) => {
const curDoc = Cast(doc, Doc, null);
const tagDoc = Cast(curDoc.presentationTargetDoc, Doc, null);
--
cgit v1.2.3-70-g09d2
From ce5512a3fdd451ad47263f896a9e855229133eaf Mon Sep 17 00:00:00 2001
From: bobzel
Date: Mon, 9 Nov 2020 15:04:28 -0500
Subject: added fullScreen alias option for opening documents so that opened
document can have different scale than original. fixed pushpins to not toggle
target if something must be panned/zoomed to show the target. fixed drag
drop to ignore the document being dragged properly when dropping (which
prevented a document over a collection from being dropped on the colelction
when move slightly).
---
src/client/util/DocumentManager.ts | 10 ++---
src/client/util/DragManager.ts | 18 +++++----
src/client/views/DocumentDecorations.tsx | 10 ++---
.../views/collections/CollectionStackingView.tsx | 5 ++-
src/client/views/collections/TabDocView.tsx | 6 +--
.../collectionFreeForm/CollectionFreeFormView.tsx | 45 ++++++++++++++--------
src/client/views/nodes/DocumentView.tsx | 13 +++----
src/client/views/nodes/FieldView.tsx | 3 +-
src/fields/documentSchemas.ts | 1 +
9 files changed, 62 insertions(+), 49 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 14aaeaec0..a6816c7f9 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -163,21 +163,19 @@ export class DocumentManager {
if (docView) { // we have a docView already and aren't forced to create a new one ... just focus on the document. TODO move into view if necessary otherwise just highlight?
const sameContext = annotatedDoc && annotatedDoc === originatingDoc?.context;
if (originatingDoc?.isPushpin) {
- const hide = !docView.props.Document.hidden;
- docView.props.focus(docView.props.Document, willZoom, undefined, (notfocused: boolean) => { // bcz: Argh! TODO: Need to add a notFocused argument to the after finish callback function that indicates whether the window had to scroll to show the target
- if (notfocused || docView.props.Document.hidden) {
+ docView.props.focus(docView.props.Document, willZoom, undefined, (didFocus: boolean) => {
+ if (!didFocus || docView.props.Document.hidden) {
docView.props.Document.hidden = !docView.props.Document.hidden;
}
return focusAndFinish();
- // @ts-ignore bcz: Argh TODO: Need to add a parameter to focus() everywhere for whether focus should center the target's container in the view or not. // here we don't want to focus the container if the source and target are in the same container
- }, sameContext);
+ }, sameContext, false);// don't want to focus the container if the source and target are in the same container, so pass 'sameContext' for dontCenter parameter
//finished?.();
}
else {
docView.select(false);
docView.props.Document.hidden && (docView.props.Document.hidden = undefined);
// @ts-ignore
- docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish, sameContext);
+ docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish, sameContext, false);
}
highlight();
} else {
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index 9e91b4f55..86e2d339e 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -416,7 +416,13 @@ export namespace DragManager {
});
const hideSource = options?.hideSource ? true : false;
- eles.map(ele => ele.parentElement && ele.parentElement?.className === dragData.dragDivName ? (ele.parentElement.hidden = hideSource) : (ele.hidden = hideSource));
+ eles.forEach(ele => {
+ if (ele.parentElement && ele.parentElement?.className === dragData.dragDivName) {
+ ele.parentElement.hidden = hideSource;
+ } else {
+ ele.hidden = hideSource;
+ }
+ });
SnappingManager.SetIsDragging(true);
let lastX = downX;
@@ -514,27 +520,25 @@ export namespace DragManager {
const hideDragShowOriginalElements = () => {
dragLabel.style.display = "none";
dragElements.map(dragElement => dragElement.parentNode === dragDiv && dragDiv.removeChild(dragElement));
- eles.map(ele => ele.parentElement && ele.parentElement?.className === dragData.dragDivName ? (ele.parentElement.hidden = false) : (ele.hidden = false));
+ eles.map(ele => ele.parentElement && ele.parentElement?.className === dragData.dragDivName ? (ele.hidden = ele.parentElement.hidden = false) : (ele.hidden = false));
};
const endDrag = action(() => {
+ hideDragShowOriginalElements();
document.removeEventListener("pointermove", moveHandler, true);
document.removeEventListener("pointerup", upHandler);
+ SnappingManager.SetIsDragging(false);
SnappingManager.clearSnapLines();
batch.end();
});
AbortDrag = () => {
- hideDragShowOriginalElements();
- SnappingManager.SetIsDragging(false);
options?.dragComplete?.(new DragCompleteEvent(true, dragData));
endDrag();
};
const upHandler = (e: PointerEvent) => {
- hideDragShowOriginalElements();
dispatchDrag(eles, e, dragData, xFromLeft, yFromTop, xFromRight, yFromBottom, options, finishDrag);
- SnappingManager.SetIsDragging(false);
- endDrag();
options?.dragComplete?.(new DragCompleteEvent(false, dragData));
+ endDrag();
};
document.addEventListener("pointermove", moveHandler, true);
document.addEventListener("pointerup", upHandler);
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 4dcae8e60..63b99cd85 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -177,19 +177,17 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
const selectedDocs = SelectionManager.SelectedDocuments();
if (selectedDocs.length) {
if (e.ctrlKey) { // open an alias in a new tab with Ctrl Key
- const alias = Doc.MakeAlias(selectedDocs[0].props.Document);
- alias.context = undefined;
- //CollectionDockingView.Instance?.OpenFullScreen(selectedDocs[0]);
- CollectionDockingView.AddSplit(alias, "right");
+ selectedDocs[0].props.Document._fullScreenView = Doc.MakeAlias(selectedDocs[0].props.Document);
+ (selectedDocs[0].props.Document._fullScreenView as Doc).context = undefined;
+ CollectionDockingView.AddSplit(selectedDocs[0].props.Document._fullScreenView as Doc, "right");
} else if (e.shiftKey) { // open centered in a new workspace with Shift Key
const alias = Doc.MakeAlias(selectedDocs[0].props.Document);
alias.context = undefined;
alias.x = -alias[WidthSym]() / 2;
alias.y = -alias[HeightSym]() / 2;
- //CollectionDockingView.Instance?.OpenFullScreen(selectedDocs[0]);
CollectionDockingView.AddSplit(Docs.Create.FreeformDocument([alias], { title: "Tab for " + alias.title }), "right");
} else { // open same document in new tab
- CollectionDockingView.ToggleSplit(selectedDocs[0].props.Document, "right");
+ CollectionDockingView.ToggleSplit(Cast(selectedDocs[0].props.Document._fullScreenView, Doc, null) || selectedDocs[0].props.Document, "right");
}
}
}
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 2285bcb8f..62f733058 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -28,6 +28,7 @@ import { CollectionViewType } from "./CollectionView";
import { SnappingManager } from "../../util/SnappingManager";
import { CollectionFreeFormDocumentView } from "../nodes/CollectionFreeFormDocumentView";
import { DocUtils } from "../../documents/Documents";
+import { DocAfterFocusFunc } from "../nodes/DocumentView";
const _global = (window /* browser */ || global /* node */) as any;
type StackingDocument = makeInterface<[typeof collectionSchema, typeof documentSchema]>;
@@ -170,9 +171,9 @@ export class CollectionStackingView extends CollectionSubView boolean) => {
+ focusDocument = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc, dontCenter?: boolean, didFocus?: boolean) => {
Doc.BrushDoc(doc);
- this.props.focus(this.props.Document, true); // bcz: HACK ARgh.. need to update all focus() functions to take parameters about how to focus. in this case, we want to zoom so we pass true and hope an ancestor is a collection view
+ this.props.focus(this.props.Document, true); // bcz: want our containing collection to zoom
Doc.linkFollowHighlight(doc);
const found = this._mainCont && Array.from(this._mainCont.getElementsByClassName("documentView-node")).find((node: any) => node.id === doc[Id]);
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 38b9b399d..530595cd0 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -21,7 +21,7 @@ import { SelectionManager } from '../../util/SelectionManager';
import { SnappingManager } from '../../util/SnappingManager';
import { Transform } from '../../util/Transform';
import { undoBatch, UndoManager } from "../../util/UndoManager";
-import { DocumentView } from "../nodes/DocumentView";
+import { DocumentView, DocAfterFocusFunc } from "../nodes/DocumentView";
import { PresBox, PresMovement } from '../nodes/PresBox';
import { CollectionDockingView } from './CollectionDockingView';
import { CollectionDockingViewMenu } from './CollectionDockingViewMenu';
@@ -343,11 +343,11 @@ export class TabDocView extends React.Component {
>;
}
- focusFunc = (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: () => void) => {
+ focusFunc = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc, dontCenter?: boolean, notFocused?: boolean) => {
if (!this.tab.header.parent._activeContentItem || this.tab.header.parent._activeContentItem !== this.tab.contentItem) {
this.tab.header.parent.setActiveContentItem(this.tab.contentItem); // glr: Panning does not work when this is set - (this line is for trying to make a tab that is not topmost become topmost)
}
- afterFocus?.();
+ afterFocus?.(false);
}
setView = action((view: DocumentView) => this._view = view);
active = () => this._isActive;
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 8a4ce826f..4541716f3 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -33,7 +33,7 @@ import { ContextMenu } from "../../ContextMenu";
import { ActiveArrowEnd, ActiveArrowStart, ActiveDash, ActiveFillColor, ActiveInkBezierApprox, ActiveInkColor, ActiveInkWidth } from "../../InkingStroke";
import { CollectionFreeFormDocumentView } from "../../nodes/CollectionFreeFormDocumentView";
import { DocumentLinksButton } from "../../nodes/DocumentLinksButton";
-import { DocumentViewProps } from "../../nodes/DocumentView";
+import { DocumentViewProps, DocAfterFocusFunc } from "../../nodes/DocumentView";
import { FormattedTextBox } from "../../nodes/formattedText/FormattedTextBox";
import { pageSchema } from "../../nodes/ImageBox";
import { PresBox } from "../../nodes/PresBox";
@@ -887,7 +887,7 @@ export class CollectionFreeFormView extends CollectionSubView boolean, dontCenter?: boolean) => {
+ focusDocument = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc, dontCenter?: boolean, didFocus?: boolean) => {
const state = HistoryUtil.getState();
// TODO This technically isn't correct if type !== "doc", as
@@ -927,7 +927,7 @@ export class CollectionFreeFormView extends CollectionSubView {
- // @ts-ignore
- if (afterFocus?.(notFocused)) { // bcz: TODO Aragh -- need to add a parameter to afterFocus() functions to indicate whether the focus function didn't need to scroll
- this.Document._panX = savedState.px;
- this.Document._panY = savedState.py;
- this.Document[this.scaleFieldKey] = savedState.s;
- this.Document._viewTransition = savedState.pt;
- }
- }, notFocused ? 0 : 500);
+ const newDidFocus = didFocus || (newPanX !== savedState.px || newPanY !== savedState.py);
+
+ const newAfterFocus = (didFocus: boolean) => {
+ afterFocus && setTimeout(() => {
+ // @ts-ignore
+ if (afterFocus?.(didFocus || (newPanX !== savedState.px || newPanY !== savedState.py))) {
+ this.Document._panX = savedState.px;
+ this.Document._panY = savedState.py;
+ this.Document[this.scaleFieldKey] = savedState.s;
+ this.Document._viewTransition = savedState.pt;
+ }
+ }, newPanX !== savedState.px || newPanY !== savedState.py ? 500 : 0);
+ return false;
+ };
+ this.props.focus(this.props.Document, undefined, undefined, newAfterFocus, undefined, newDidFocus);
+ Doc.linkFollowHighlight(doc);
}
}
@@ -1434,8 +1438,15 @@ export class CollectionFreeFormView extends CollectionSubView {
+ const w = this.props.PanelWidth() / this.zoomScaling() + 3 * start;
+ if (w / start > 60) return this.chooseGridSpace(start * 10);
+ return start;
+ }
+
@computed get grid() {
- const gridSpace = NumCast(this.layoutDoc["_backgroundGrid-space"], 50);
+ const gridSpace = this.chooseGridSpace(NumCast(this.layoutDoc["_backgroundGrid-space"], 50));
const shiftX = this.props.isAnnotationOverlay ? 0 : -(this.panX()) % gridSpace - gridSpace;
const shiftY = this.props.isAnnotationOverlay ? 0 : -(this.panY()) % gridSpace - gridSpace;
const cx = this.centeringShiftX();
@@ -1448,6 +1459,8 @@ export class CollectionFreeFormView extends CollectionSubView 50 ? 3 : 1);
+ ctx.setLineDash(gridSpace > 50 ? [3, 3] : [1, 5]);
ctx.clearRect(0, 0, w, h);
if (ctx) {
ctx.strokeStyle = "rgba(0, 0, 0, 0.5)";
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 4efa5d67f..77f63b457 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -42,7 +42,8 @@ import { RadialMenu } from './RadialMenu';
import { TaskCompletionBox } from './TaskCompletedBox';
import React = require("react");
-export type DocFocusFunc = () => boolean;
+export type DocAfterFocusFunc = (notFocused: boolean) => boolean;
+export type DocFocusFunc = (doc: Doc, willZoom?: boolean, scale?: number, afterFocus?: DocAfterFocusFunc, dontCenter?: boolean, focused?: boolean) => void;
export interface DocumentViewProps {
ContainingCollectionView: Opt;
@@ -82,7 +83,7 @@ export interface DocumentViewProps {
PanelHeight: () => number;
pointerEvents?: string;
contentsPointerEvents?: string;
- focus: (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: DocFocusFunc) => void;
+ focus: DocFocusFunc;
parentActive: (outsideReaction: boolean) => boolean;
whenActiveChanged: (isActive: boolean) => void;
bringToFront: (doc: Doc, sendToBack?: boolean) => void;
@@ -331,11 +332,7 @@ export class DocumentView extends DocComponent(Docu
InkStrokeProperties.Instance && (InkStrokeProperties.Instance._controlBtn = true);
} else {
UndoManager.RunInBatch(() => {
- let fullScreenDoc = this.props.Document;
- if (StrCast(this.props.Document.layoutKey) !== "layout_fullScreen" && this.props.Document.layout_fullScreen) {
- fullScreenDoc = Doc.MakeAlias(this.props.Document);
- fullScreenDoc.layoutKey = "layout_fullScreen";
- }
+ const fullScreenDoc = Cast(this.props.Document._fullScreenView, Doc, null) || this.props.Document;
this.props.addDocTab(fullScreenDoc, "add");
}, "double tap");
SelectionManager.DeselectAll();
@@ -385,7 +382,7 @@ export class DocumentView extends DocComponent(Docu
// if the target isn't onscreen, then it will open up the target in a tab, on the right, or in place
// depending on the followLinkLocation property of the source (or the link itself as a fallback);
public static followLinkClick = async (linkDoc: Opt, sourceDoc: Doc, docView: {
- focus: (doc: Doc, willZoom: boolean, scale?: number, afterFocus?: DocFocusFunc) => void,
+ focus: DocFocusFunc,
addDocTab: (doc: Doc, where: string, libraryPath?: Doc[]) => boolean,
ContainingCollectionDoc?: Doc
}, shiftKey: boolean, altKey: boolean) => {
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index 3a5b27b21..79947c023 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -11,6 +11,7 @@ import { CollectionView } from "../collections/CollectionView";
import { AudioBox } from "./AudioBox";
import { VideoBox } from "./VideoBox";
import { dropActionType } from "../../util/DragManager";
+import { DocAfterFocusFunc, DocFocusFunc } from "./DocumentView";
//
// these properties get assigned through the render() method of the DocumentView when it creates this node.
@@ -47,7 +48,7 @@ export interface FieldViewProps {
whenActiveChanged: (isActive: boolean) => void;
LayoutTemplateString?: string;
dontRegisterView?: boolean;
- focus: (doc: Doc) => void;
+ focus: DocFocusFunc;
presMultiSelect?: (doc: Doc) => void; //added for selecting multiple documents in a presentation
ignoreAutoHeight?: boolean;
PanelWidth: () => number;
diff --git a/src/fields/documentSchemas.ts b/src/fields/documentSchemas.ts
index 311aaa769..6e58f7f13 100644
--- a/src/fields/documentSchemas.ts
+++ b/src/fields/documentSchemas.ts
@@ -15,6 +15,7 @@ export const documentSchema = createSchema({
// "Location" properties in a very general sense
_curPage: "number", // current page of a page based document
_currentFrame: "number", // current frame of a frame based collection (e.g., a progressive slide)
+ _fullScreenView: Doc, // alias to display when double-clicking to open document in a full-screen view
lastFrame: "number", // last frame of a frame based collection (e.g., a progressive slide)
activeFrame: "number", // the active frame of a frame based animated document
_currentTimecode: "number", // current play back time of a temporal document (video / audio)
--
cgit v1.2.3-70-g09d2
From 83d3756537cfcd8a2248c4b8a2a6f75f77154602 Mon Sep 17 00:00:00 2001
From: bobzel
Date: Mon, 9 Nov 2020 21:40:59 -0500
Subject: fixed autoHeight for formattedTextSidebars when the text document has
been scaled. cleaned up link groups. fixed pushpins that don't focus on
target (e.g., a si m ple pushpin on a PDF).
---
src/client/util/LinkManager.ts | 9 +----
.../views/collections/CollectionStackingView.tsx | 10 +++--
.../collectionFreeForm/CollectionFreeFormView.tsx | 3 +-
src/client/views/linking/LinkMenu.tsx | 29 ++++++---------
src/client/views/linking/LinkMenuGroup.tsx | 43 +++-------------------
src/client/views/nodes/LinkDocPreview.tsx | 17 ++++-----
.../views/nodes/formattedText/FormattedTextBox.tsx | 20 +++++-----
7 files changed, 42 insertions(+), 89 deletions(-)
(limited to 'src/client/views/collections')
diff --git a/src/client/util/LinkManager.ts b/src/client/util/LinkManager.ts
index 3a0c0e3eb..802b8ae7b 100644
--- a/src/client/util/LinkManager.ts
+++ b/src/client/util/LinkManager.ts
@@ -35,7 +35,7 @@ export class LinkManager {
allLinks = computedFn(function allLinks(this: any): Doc[] {
const lset = new Set(DocListCast(Doc.LinkDBDoc().data));
- SharingManager.Instance.users.forEach(user => DocListCast(user.linkDatabase?.data).map(doc => lset.add(doc)));
+ SharingManager.Instance.users.forEach(user => DocListCast(user.linkDatabase?.data).forEach(doc => lset.add(doc)));
return Array.from(lset);
}, true);
@@ -69,13 +69,6 @@ export class LinkManager {
return anchorGroups;
}
- // returns a list of all metadata docs associated with the given group type
- public getAllMetadataDocsInGroup(groupType: string): Array {
- const md: Doc[] = [];
- LinkManager.Instance.allLinks().forEach(linkDoc => StrCast(linkDoc.linkRelationship).toUpperCase() === groupType.toUpperCase() && md.push(linkDoc));
- return md;
- }
-
// checks if a link with the given anchors exists
public doesLinkExist(anchor1: Doc, anchor2: Doc): boolean {
return -1 !== LinkManager.Instance.allLinks().findIndex(linkDoc =>
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 62f733058..97eacaeab 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -352,8 +352,12 @@ export class CollectionStackingView extends CollectionSubView {
if (this.layoutDoc._autoHeight && ref && this.refList.length && !SnappingManager.GetIsDragging()) {
- const height = Math.min(NumCast(this.layoutDoc._maxHeight, Number.MAX_SAFE_INTEGER), Math.max(...this.refList.map(r => Number(getComputedStyle(r).height.replace("px", "")))));
- Doc.Layout(doc)._height = Math.max(height, NumCast(doc[this.props.fieldKey + "-height"]));
+ const height = Math.min(NumCast(this.layoutDoc._maxHeight, Number.MAX_SAFE_INTEGER), Math.max(...this.refList.map(r => NumCast(Doc.Layout(doc)._viewScale, 1) * Number(getComputedStyle(r).height.replace("px", "")))));
+ if (this.props.annotationsKey) {
+ doc[this.props.annotationsKey + "-height"] = height;
+ } else {
+ Doc.Layout(doc)._height = height * NumCast(Doc.Layout(doc)._viewScale, 1);
+ }
}
}));
this.observer.observe(ref);
@@ -406,7 +410,7 @@ export class CollectionStackingView extends CollectionSubView {
if (this.layoutDoc._autoHeight && ref && this.refList.length && !SnappingManager.GetIsDragging()) {
const height = this.refList.reduce((p, r) => p + Number(getComputedStyle(r).height.replace("px", "")), 0);
- Doc.Layout(doc)._height = Math.max(height, NumCast(doc[this.props.fieldKey + "-height"]));
+ Doc.Layout(doc)._height = Math.max(height * NumCast(doc[this.props.fieldKey + "-height"]), NumCast(doc[this.props.fieldKey + "-height"]));
}
}));
this.observer.observe(ref);
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 4541716f3..21e653e02 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -926,8 +926,7 @@ export class CollectionFreeFormView extends CollectionSubView {
}
renderAllGroups = (groups: Map>): Array => {
- const linkItems: Array = [];
- groups.forEach((group, groupType) => {
- linkItems.push(
- this._editingLink = linkDoc)}
- addDocTab={this.props.addDocTab} />
- );
- });
-
- // if source doc has no links push message
- if (linkItems.length === 0) linkItems.push(No links have been created yet. Drag the linking button onto another document to create a link.
);
-
- return linkItems;
+ const linkItems = Array.from(groups.entries()).map(group =>
+ this._editingLink = linkDoc)}
+ addDocTab={this.props.addDocTab} />);
+
+ return linkItems.length ? linkItems : [No links have been created yet. Drag the linking button onto another document to create a link.
];
}
@computed
diff --git a/src/client/views/linking/LinkMenuGroup.tsx b/src/client/views/linking/LinkMenuGroup.tsx
index e76227ccf..e53655fd3 100644
--- a/src/client/views/linking/LinkMenuGroup.tsx
+++ b/src/client/views/linking/LinkMenuGroup.tsx
@@ -1,17 +1,12 @@
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { action } from "mobx";
import { observer } from "mobx-react";
import { Doc } from "../../../fields/Doc";
import { Id } from "../../../fields/FieldSymbols";
-import { SchemaHeaderField } from "../../../fields/SchemaHeaderField";
-import { Docs } from "../../documents/Documents";
-import { DragManager, SetupDrag } from "../../util/DragManager";
+import { Cast } from "../../../fields/Types";
import { LinkManager } from "../../util/LinkManager";
import { DocumentView } from "../nodes/DocumentView";
import './LinkMenu.scss';
-import { LinkMenuItem, StartLinkTargetsDrag } from "./LinkMenuItem";
+import { LinkMenuItem } from "./LinkMenuItem";
import React = require("react");
-import { Cast } from "../../../fields/Types";
interface LinkMenuGroupProps {
sourceDoc: Doc;
@@ -26,34 +21,8 @@ interface LinkMenuGroupProps {
export class LinkMenuGroup extends React.Component {
private _drag = React.createRef();
- private _table = React.createRef();
private _menuRef = React.createRef();
- onLinkButtonDown = (e: React.PointerEvent): void => {
- e.stopPropagation();
- document.removeEventListener("pointermove", this.onLinkButtonMoved);
- document.addEventListener("pointermove", this.onLinkButtonMoved);
- document.removeEventListener("pointerup", this.onLinkButtonUp);
- document.addEventListener("pointerup", this.onLinkButtonUp);
- }
-
- onLinkButtonUp = (e: PointerEvent): void => {
- document.removeEventListener("pointermove", this.onLinkButtonMoved);
- document.removeEventListener("pointerup", this.onLinkButtonUp);
- e.stopPropagation();
- }
-
- onLinkButtonMoved = async (e: PointerEvent) => {
- if (this._drag.current && (e.movementX > 1 || e.movementY > 1)) {
- document.removeEventListener("pointermove", this.onLinkButtonMoved);
- document.removeEventListener("pointerup", this.onLinkButtonUp);
-
- const targets = this.props.group.map(l => LinkManager.getOppositeAnchor(l, this.props.sourceDoc)).filter(d => d) as Doc[];
- StartLinkTargetsDrag(this._drag.current, this.props.docView, e.x, e.y, this.props.sourceDoc, targets);
- }
- e.stopPropagation();
- }
-
render() {
const set = new Set(this.props.group);
const groupItems = Array.from(set.keys()).map(linkDoc => {
@@ -75,11 +44,9 @@ export class LinkMenuGroup extends React.Component {
return (
- {/*