From b6b0e25503f768f831b800a6d2760b2ccbfab727 Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Tue, 20 Sep 2022 19:45:46 -0400
Subject: updated homepage view
---
src/client/views/global/globalCssVariables.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'src/client/views/global')
diff --git a/src/client/views/global/globalCssVariables.scss b/src/client/views/global/globalCssVariables.scss
index c5968d9a7..8a75aeef8 100644
--- a/src/client/views/global/globalCssVariables.scss
+++ b/src/client/views/global/globalCssVariables.scss
@@ -39,7 +39,7 @@ $small-text: 9px;
// misc values
$border-radius: 0.3em;
$search-thumnail-size: 130;
-$topbar-height: 32px;
+$topbar-height: 37px;
$antimodemenu-height: 36px;
// dragged items
--
cgit v1.2.3-70-g09d2
From 37be2477782b0b372c16d46df3f9634ebf3677fe Mon Sep 17 00:00:00 2001
From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>
Date: Wed, 21 Sep 2022 01:43:03 -0400
Subject: restyled document decorations
and changed novice mode to exclude `data` in treeView
---
src/client/views/DocumentButtonBar.tsx | 2 +-
src/client/views/DocumentDecorations.scss | 189 ++++++++++++++-------
src/client/views/DocumentDecorations.tsx | 13 +-
src/client/views/_nodeModuleOverrides.scss | 4 +-
.../views/collections/CollectionDockingView.scss | 8 +
.../views/collections/CollectionTreeView.scss | 1 +
src/client/views/collections/TabDocView.tsx | 4 +-
src/client/views/collections/TreeView.scss | 20 ++-
src/client/views/collections/TreeView.tsx | 4 +-
src/client/views/global/globalCssVariables.scss | 4 +
src/client/views/nodes/button/FontIconBox.tsx | 2 +-
src/client/views/nodes/trails/PresBox.tsx | 16 +-
src/client/views/topbar/TopBar.tsx | 2 +-
13 files changed, 178 insertions(+), 91 deletions(-)
(limited to 'src/client/views/global')
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 35c0b9a7d..0bfe6e87a 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -434,7 +434,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
) : null}
-
diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss
index b490278c3..2e8d31478 100644
--- a/src/client/views/DocumentDecorations.scss
+++ b/src/client/views/DocumentDecorations.scss
@@ -22,6 +22,129 @@ $resizeHandler: 8px;
grid-template-columns: $resizeHandler 1fr $resizeHandler;
pointer-events: none;
+ .documentDecorations-topbar {
+ display: flex;
+ grid-column-start: 1;
+ grid-column-end: 4;
+ flex-direction: row;
+ gap: 2px;
+
+
+ .documentDecorations-openButton {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #3ce312;
+ border: solid 1.5px #0a620a;
+ color: #3ce312;
+ transition: 0.1s ease;
+ font-size: 11px;
+ opacity: 1;
+ pointer-events: all;
+ width: 20px;
+ height: 20px;
+ min-width: 20px;
+ border-radius: 100%;
+ cursor: pointer;
+
+ &:hover {
+ color: #02600d;
+ }
+ }
+
+ .documentDecorations-closeButton {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #fb9d75;
+ border: solid 1.5px #a94442;
+ color: #fb9d75;
+ transition: 0.1s ease;
+ opacity: 1;
+ pointer-events: all;
+ width: 20px;
+ height: 20px;
+ min-width: 20px;
+ border-radius: 100%;
+ cursor: pointer;
+
+ &:hover {
+ color: #a94442;
+ }
+
+ > svg {
+ margin: 0;
+ }
+ }
+
+ .documentDecorations-minimizeButton {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: #ffdd00;
+ border: solid 1.5px #a94442;
+ color: #ffdd00;
+ transition: 0.1s ease;
+ font-size: 11px;
+ opacity: 1;
+ grid-column: 2;
+ pointer-events: all;
+ width: 20px;
+ height: 20px;
+ min-width: 20px;
+ border-radius: 100%;
+ cursor: pointer;
+
+ &:hover {
+ color: #a94442;
+ }
+
+ > svg {
+ margin: 0;
+ }
+ }
+
+ .documentDecorations-title-Dark,
+ .documentDecorations-title {
+ opacity: 1;
+ width: calc(100% - 60px); // = margin-left + margin-right
+ grid-column: 3;
+ pointer-events: auto;
+ overflow: hidden;
+ text-align: center;
+ display: flex;
+ height: 20px;
+ border-radius: 8px;
+ outline: none;
+ border: none;
+
+ .documentDecorations-titleSpan,
+ .documentDecorations-titleSpan-Dark {
+ width: 100%;
+ border-radius: 8px;
+ background: $light-gray;
+ display: inline-block;
+ cursor: move;
+ }
+ .documentDecorations-titleSpan-Dark {
+ background: hsla(0, 0%, 0%, 0.412);
+ }
+ }
+
+ .documentDecorations-title-Dark {
+ color: white;
+ background: black;
+ }
+
+ .documentDecorations-titleBackground {
+ background: $light-gray;
+ border-radius: 8px;
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ }
+ }
+
.documentDecorations-centerCont {
grid-column: 2;
background: none;
@@ -225,76 +348,12 @@ $resizeHandler: 8px;
cursor: ew-resize;
}
- .documentDecorations-title-Dark,
- .documentDecorations-title {
- opacity: 1;
- width: calc(100% - 8px); // = margin-left + margin-right
- grid-column: 2;
- grid-column-end: 2;
- pointer-events: auto;
- overflow: hidden;
- text-align: center;
- display: flex;
- margin-left: 6px; // closeButton width (14) - leftColumn width (8)
- margin-right: 2px;
- height: 20px;
- position: absolute;
- border-radius: 8px;
- background: rgba(159, 159, 159, 0.1);
-
- .documentDecorations-titleSpan,
- .documentDecorations-titleSpan-Dark {
- width: 100%;
- border-radius: 8px;
- background: #ffffffa0;
- position: absolute;
- display: inline-block;
- cursor: move;
- }
- .documentDecorations-titleSpan-Dark {
- background: hsla(0, 0%, 0%, 0.412);
- }
- }
- .documentDecorations-title-Dark {
- color: white;
- background: black;
- }
-
- .documentDecorations-titleBackground {
- background: #ffffffcf;
- border-radius: 8px;
- width: 100%;
- height: 100%;
- position: absolute;
- }
-
.focus-visible {
margin-left: 0px;
}
}
-.documentDecorations-openButton {
- display: flex;
- align-items: center;
- opacity: 1;
- grid-column-start: 3;
- pointer-events: all;
- cursor: pointer;
-}
-.documentDecorations-closeButton {
- display: flex;
- align-items: center;
- opacity: 1;
- grid-column: 1;
- pointer-events: all;
- width: 14px;
- cursor: pointer;
-
- > svg {
- margin: 0;
- }
-}
.documentDecorations-background {
background: lightblue;
@@ -329,7 +388,7 @@ $resizeHandler: 8px;
justify-content: center;
align-items: center;
gap: 5px;
- background: $medium-gray;
+ background: $light-gray;
}
.linkButtonWrapper {
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 0fc33bdea..95025bf70 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -719,9 +719,12 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
width: bounds.r - bounds.x + this._resizeBorderWidth + 'px',
height: bounds.b - bounds.y + this._resizeBorderWidth + this._titleHeight + 'px',
}}>
- {hideDeleteButton ?
: topBtn('close', this.hasIcons ? 'times' : 'window-maximize', undefined, e => this.onCloseClick(this.hasIcons ? true : undefined), 'Close')}
- {titleArea}
- {hideOpenButton ? null : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Tab (ctrl: as alias, shift: in new collection)')}
+
+ {hideDeleteButton ?
: topBtn('close', 'times', undefined, e => this.onCloseClick(true), 'Close')}
+ {hideDeleteButton ?
: topBtn('minimize', 'window-maximize', undefined, e => this.onCloseClick(undefined), 'Minimize')}
+ {titleArea}
+ {hideOpenButton ? null : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Tab (ctrl: as alias, shift: in new collection)')}
+
{hideResizers ? null : (
<>
e.preventDefault()} />
@@ -738,9 +741,9 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
>
)}
-
e.preventDefault()}>
+ {!Doc.noviceMode &&
e.preventDefault()}>
{'⟲'}
-
+
}
{useRounding && (
li {
+ height: 27px !important;
opacity: 1;
transform: scale(1);
}
diff --git a/src/client/views/collections/CollectionTreeView.scss b/src/client/views/collections/CollectionTreeView.scss
index c0561e42c..a182a72c5 100644
--- a/src/client/views/collections/CollectionTreeView.scss
+++ b/src/client/views/collections/CollectionTreeView.scss
@@ -104,6 +104,7 @@
text-overflow: ellipsis;
white-space: pre-wrap;
min-width: 10px;
+ grid-column: 2;
}
.docContainer-system {
font-variant: all-small-caps;
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index a82bd2dc8..98121f423 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -56,7 +56,9 @@ export class TabDocView extends React.Component
{
return this._document && Doc.Layout(this._document);
}
@computed get tabColor() {
- return StrCast(this._document?._backgroundColor, StrCast(this._document?.backgroundColor, DefaultStyleProvider(this._document, undefined, StyleProp.BackgroundColor)));
+ let tabColor = StrCast(this._document?._backgroundColor, StrCast(this._document?.backgroundColor, DefaultStyleProvider(this._document, undefined, StyleProp.BackgroundColor)));
+ if (tabColor === 'transparent') return 'black';
+ return tabColor;
}
@computed get tabTextColor() {
return this._document?.type === DocumentType.PRES ? 'black' : StrCast(this._document?._color, StrCast(this._document?.color, DefaultStyleProvider(this._document, undefined, StyleProp.Color)));
diff --git a/src/client/views/collections/TreeView.scss b/src/client/views/collections/TreeView.scss
index ce87e6f89..cfb97709b 100644
--- a/src/client/views/collections/TreeView.scss
+++ b/src/client/views/collections/TreeView.scss
@@ -53,13 +53,16 @@
}
.bullet {
+ grid-column: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
position: relative;
width: $TREE_BULLET_WIDTH;
+ min-height: 20px;
color: $medium-gray;
- margin-top: 3px;
- // transform: scale(1.3, 1.3); // bcz: why was this here? It makes displaying images in the treeView for documents that have icons harder.
border: #80808030 1px solid;
- border-radius: 4px;
+ border-radius: 5px;
}
}
@@ -113,7 +116,15 @@
.treeView-header-editing,
.treeView-header {
border: transparent 1px solid;
- display: flex;
+ display: grid;
+ align-items: center;
+ grid-auto-columns: 22px auto 22px;
+ width: 100%;
+ border-radius: 5px;
+
+ &:hover {
+ background-color: #bdddf5;
+ }
//align-items: center;
::-webkit-scrollbar {
@@ -140,6 +151,7 @@
.treeView-rightButtons {
display: flex;
+ grid-column: 3;
align-items: center;
margin-left: 0.25rem;
opacity: 0.75;
diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx
index 833e364b3..b489b5214 100644
--- a/src/client/views/collections/TreeView.tsx
+++ b/src/client/views/collections/TreeView.tsx
@@ -736,7 +736,7 @@ export class TreeView extends React.Component {
}}
/>
)}
- {this.doc.treeViewExpandedViewLock || Doc.IsSystem(this.doc) ? null : (
+ {Doc.noviceMode ? null : this.doc.treeViewExpandedViewLock || Doc.IsSystem(this.doc) ? null : (
{this.treeViewExpandedView}
@@ -953,7 +953,7 @@ export class TreeView extends React.Component {
() {
icon = 'globe-asia';
text = 'User Default';
}
- noviceList = [CollectionViewType.Freeform, CollectionViewType.Schema, CollectionViewType.Stacking];
+ noviceList = [CollectionViewType.Freeform, CollectionViewType.Schema, CollectionViewType.Stacking, CollectionViewType.NoteTaking];
} else if (script?.script.originalScript.startsWith('setFont')) {
const editorView = RichTextMenu.Instance?.TextView?.EditorView;
text = StrCast((editorView ? RichTextMenu.Instance : Doc.UserDoc()).fontFamily);
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index ab59e6112..7f0f13437 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -2321,8 +2321,8 @@ export class PresBox extends ViewBoxBaseComponent
() {
const mode = StrCast(this.rootDoc._viewType) as CollectionViewType;
const isMini: boolean = this.toolbarWidth <= 100;
return (
-
- {isMini ? null : (
+
+ {isMini || Doc.noviceMode ? null : (
e.stopPropagation()} onChange={this.viewChanged} value={mode}>
List
@@ -2330,11 +2330,9 @@ export class PresBox extends ViewBoxBaseComponent() {
Tree
- {Doc.noviceMode ? null : (
-
- 3D Carousel
-
- )}
+
+ 3D Carousel
+
)}
@@ -2653,14 +2651,14 @@ export class PresBox extends ViewBoxBaseComponent() {
) : null}
- {
+ {/* {
// if the document type is a presentation, then the collection stacking view has a "+ new slide" button at the bottom of the stack
{'Click on document to pin to presentaiton or make a marquee selection to pin your desired view'} }>
+ NEW SLIDE
- }
+ } */}
);
diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx
index bbdb4621e..2fe0c6e79 100644
--- a/src/client/views/topbar/TopBar.tsx
+++ b/src/client/views/topbar/TopBar.tsx
@@ -52,7 +52,7 @@ export class TopBar extends React.Component {
brown dash
}
- {Doc.ActiveDashboard &&
Date: Thu, 22 Sep 2022 11:32:38 -0400
Subject: fixed presenting backward in presBox. fixed context menu to appear
above other widgets
---
src/client/views/ContextMenu.scss | 2 +-
src/client/views/DocumentDecorations.tsx | 25 +++++++++++++++----------
src/client/views/global/globalCssVariables.scss | 2 +-
src/client/views/nodes/trails/PresBox.tsx | 25 +++++++++++++++----------
4 files changed, 32 insertions(+), 22 deletions(-)
(limited to 'src/client/views/global')
diff --git a/src/client/views/ContextMenu.scss b/src/client/views/ContextMenu.scss
index 1e6a377de..cbe14060a 100644
--- a/src/client/views/ContextMenu.scss
+++ b/src/client/views/ContextMenu.scss
@@ -3,7 +3,7 @@
.contextMenu-cont {
position: absolute;
display: flex;
- z-index: 100000;
+ z-index: $contextMenu-zindex;
box-shadow: 0px 3px 4px rgba(0, 0, 0, 30%);
flex-direction: column;
background: whitesmoke;
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 797730c10..4675571c2 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -31,6 +31,7 @@ import { ImageBox } from './nodes/ImageBox';
import React = require('react');
import { IconButton } from 'browndash-components';
import { FaUndo } from 'react-icons/fa';
+import { VideoBox } from './nodes/VideoBox';
@observer
export class DocumentDecorations extends React.Component<{ PanelWidth: number; PanelHeight: number; boundsLeft: number; boundsTop: number }, { value: string }> {
@@ -678,7 +679,7 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
bounds.b = Math.max(bounds.y, Math.max(topBounds, Math.min(window.innerHeight, bounds.b + this._resizeBorderWidth / 2 + this._linkBoxHeight) - this._resizeBorderWidth / 2 - this._linkBoxHeight));
// Rotation constants: Only allow rotation on ink and images
- const useRotation = seldoc.ComponentView instanceof InkingStroke || seldoc.ComponentView instanceof ImageBox;
+ const useRotation = seldoc.ComponentView instanceof InkingStroke || seldoc.ComponentView instanceof ImageBox || seldoc.ComponentView instanceof VideoBox;
const rotation = NumCast(seldoc.rootDoc._jitterRotation);
const resizerScheme = colorScheme ? 'documentDecorations-resizer' + colorScheme : '';
@@ -721,12 +722,14 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
width: bounds.r - bounds.x + this._resizeBorderWidth + 'px',
height: bounds.b - bounds.y + this._resizeBorderWidth + this._titleHeight + 'px',
}}>
- {hideResizers ? null : (
- {hideDeleteButton ?
: topBtn('close', 'times', undefined, e => this.onCloseClick(true), 'Close')}
- {hideDeleteButton ?
: topBtn('minimize', 'window-maximize', undefined, e => this.onCloseClick(undefined), 'Minimize')}
- {titleArea}
- {hideOpenButton ? null : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Tab (ctrl: as alias, shift: in new collection)')}
-
)}
+ {hideResizers ? null : (
+
+ {hideDeleteButton ?
: topBtn('close', 'times', undefined, e => this.onCloseClick(true), 'Close')}
+ {hideDeleteButton ?
: topBtn('minimize', 'window-maximize', undefined, e => this.onCloseClick(undefined), 'Minimize')}
+ {titleArea}
+ {hideOpenButton ? null : topBtn('open', 'external-link-alt', this.onMaximizeDown, undefined, 'Open in Tab (ctrl: as alias, shift: in new collection)')}
+
+ )}
{hideResizers ? null : (
<>
e.preventDefault()} />
@@ -743,9 +746,11 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number; P
>
)}
- {useRotation &&
e.preventDefault()}>
- } isCircle={true} hoverStyle={"lighten"} backgroundColor={Colors.DARK_GRAY} color={Colors.LIGHT_GRAY}/>
-
}
+ {useRotation && (
+
e.preventDefault()}>
+ } isCircle={true} hoverStyle={'lighten'} backgroundColor={Colors.DARK_GRAY} color={Colors.LIGHT_GRAY} />
+
+ )}
{useRounding && (
() {
//TODO: al: it seems currently that tempMedia doesn't stop onslidechange after clicking the button; the time the tempmedia stop depends on the start & end time
// TODO: to handle child slides (entering into subtrail and exiting), also the next() and back() functions
// No more frames in current doc and next slide is defined, therefore move to next slide
- nextSlide = (activeNext: Doc) => {
- let nextSelected = this.itemIndex + 1;
+ nextSlide = (slideNum?: number) => {
+ let nextSelected = slideNum ?? this.itemIndex + 1;
this.gotoDocument(nextSelected, this.activeItem);
for (nextSelected = nextSelected + 1; nextSelected < this.childDocs.length; nextSelected++) {
if (this.childDocs[nextSelected].groupWithUp) {
@@ -261,10 +261,12 @@ export class PresBox extends ViewBoxBaseComponent
() {
this.nextInternalFrame(targetDoc, activeItem);
} else if (this.childDocs[this.itemIndex + 1] !== undefined) {
// Case 2: No more frames in current doc and next slide is defined, therefore move to next slide
- this.nextSlide(activeNext);
+ const slides = DocListCast(this.rootDoc[StrCast(this.presFieldKey, 'data')]);
+ const curLast = this.selectedArray.size ? Math.max(...Array.from(this.selectedArray).map(d => slides.indexOf(DocCast(d)))) : this.itemIndex;
+ this.nextSlide(curLast + 1);
} else if (this.childDocs[this.itemIndex + 1] === undefined && (this.layoutDoc.presLoop || this.layoutDoc.presStatus === PresStatus.Edit)) {
// Case 3: Last slide and presLoop is toggled ON or it is in Edit mode
- this.gotoDocument(0, this.activeItem);
+ this.nextSlide(0);
}
};
@@ -280,8 +282,8 @@ export class PresBox extends ViewBoxBaseComponent() {
let prevSelected = this.itemIndex;
// Functionality for group with up
let didZoom = activeItem.presMovement;
- for (; !didZoom && prevSelected > 0 && this.childDocs[prevSelected].groupButton; prevSelected--) {
- didZoom = this.childDocs[prevSelected].presMovement;
+ for (; prevSelected > 0 && this.childDocs[Math.max(0, prevSelected - 1)].groupWithUp; prevSelected--) {
+ didZoom = didZoom === 'none' ? this.childDocs[prevSelected].presMovement : didZoom;
}
if (lastFrame !== undefined && curFrame >= 1) {
// Case 1: There are still other frames and should go through all frames before going to previous slide
@@ -289,7 +291,8 @@ export class PresBox extends ViewBoxBaseComponent() {
} else if (activeItem && this.childDocs[this.itemIndex - 1] !== undefined) {
// Case 2: There are no other frames so it should go to the previous slide
prevSelected = Math.max(0, prevSelected - 1);
- this.gotoDocument(prevSelected, activeItem);
+ this.nextSlide(prevSelected);
+ this.rootDoc._itemIndex = prevSelected;
if (NumCast(prevTargetDoc.lastFrame) > 0) prevTargetDoc._currentFrame = NumCast(prevTargetDoc.lastFrame);
} else if (this.childDocs[this.itemIndex - 1] === undefined && this.layoutDoc.presLoop) {
// Case 3: Pres loop is on so it should go to the last slide
@@ -2458,12 +2461,13 @@ export class PresBox extends ViewBoxBaseComponent() {
{
+ onClick={e => {
this.back();
if (this._presTimer) {
clearTimeout(this._presTimer);
this.layoutDoc.presStatus = PresStatus.Manual;
}
+ e.stopPropagation();
}}>
@@ -2475,18 +2479,19 @@ export class PresBox extends ViewBoxBaseComponent() {
{
+ onClick={e => {
this.next();
if (this._presTimer) {
clearTimeout(this._presTimer);
this.layoutDoc.presStatus = PresStatus.Manual;
}
+ e.stopPropagation();
}}>
{'Click to return to 1st slide'} }>
-
this.gotoDocument(0, this.activeItem)}>
+
this.nextSlide(0)}>
1
--
cgit v1.2.3-70-g09d2