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')
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 &&