From d6131dbdb72fe220af1857e8090b0ca67db8b22d Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Tue, 13 Oct 2020 17:37:14 +0800 Subject: updates before merge --- src/client/views/nodes/PresBox.scss | 1 - 1 file changed, 1 deletion(-) (limited to 'src/client/views/nodes/PresBox.scss') diff --git a/src/client/views/nodes/PresBox.scss b/src/client/views/nodes/PresBox.scss index 7bc6c1dfd..ad2e7122f 100644 --- a/src/client/views/nodes/PresBox.scss +++ b/src/client/views/nodes/PresBox.scss @@ -22,7 +22,6 @@ $light-background: #ececec; position: relative; height: calc(100% - 67px); width: 100%; - margin-top: 3px; } .presBox-toolbar-dropdown { -- cgit v1.2.3-70-g09d2 From 474f117df2551ff5d3be83d6cc92c34644a6fbed Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Thu, 15 Oct 2020 10:24:17 +0800 Subject: fixed changing transition undo bug :unlock: #864 --- src/client/views/nodes/PresBox.scss | 49 +++++++++++++++++ src/client/views/nodes/PresBox.tsx | 105 ++++++++++++++++++++++++++---------- 2 files changed, 126 insertions(+), 28 deletions(-) (limited to 'src/client/views/nodes/PresBox.scss') diff --git a/src/client/views/nodes/PresBox.scss b/src/client/views/nodes/PresBox.scss index ad2e7122f..033e1e030 100644 --- a/src/client/views/nodes/PresBox.scss +++ b/src/client/views/nodes/PresBox.scss @@ -411,6 +411,53 @@ $light-background: #ececec; transform: scale(1.05); transition: all 0.4s; } + + .ribbon-frameList { + width: calc(100% - 5px); + height: 50px; + background-color: #ececec; + border: 1px solid #9f9f9f; + grid-template-rows: max-content; + + .frameList-header { + display: grid; + width: 100%; + height: 20px; + background-color: #9f9f9f; + + .frameList-headerButtons { + display: flex; + grid-column: 7; + width: 60px; + justify-self: right; + justify-content: flex-end; + + .headerButton { + cursor: pointer; + position: relative; + border-radius: 100%; + z-index: 300; + width: 15px; + height: 15px; + display: flex; + font-size: 10px; + justify-self: center; + align-self: center; + background-color: rgba(0, 0, 0, 0.5); + color: white; + justify-content: center; + align-items: center; + transition: 0.2s; + margin-right: 3px; + } + + .headerButton:hover { + background-color: rgba(0, 0, 0, 1); + transform: scale(1.15); + } + } + } + } } .selectedList { @@ -1007,6 +1054,8 @@ $light-background: #ececec; .presPanel-button-text:hover { background-color: #5a5a5a; } + + } // .miniPres { diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 8e2884968..dd7eba0b2 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -821,6 +821,7 @@ export class PresBox extends ViewBoxBaseComponent } // Converts seconds to ms and updates presTransition + @undoBatch setTransitionTime = (number: String, change?: number) => { let timeInMS = Number(number) * 1000; if (change) timeInMS += change; @@ -830,6 +831,7 @@ export class PresBox extends ViewBoxBaseComponent } // Converts seconds to ms and updates presDuration + @undoBatch setDurationTime = (number: String, change?: number) => { let timeInMS = Number(number) * 1000; if (change) timeInMS += change; @@ -1250,10 +1252,10 @@ export class PresBox extends ViewBoxBaseComponent const currentFrame = Cast(tagDoc._currentFrame, "number", null); if (currentFrame === undefined) { tagDoc._currentFrame = 0; - CollectionFreeFormDocumentView.setupScroll(tagDoc, 0); - CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0); + // CollectionFreeFormDocumentView.setupScroll(tagDoc, 0); + // CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0); } - if (tagDoc.editScrollProgressivize) CollectionFreeFormDocumentView.updateScrollframe(tagDoc, currentFrame); + // if (tagDoc.editScrollProgressivize) CollectionFreeFormDocumentView.updateScrollframe(tagDoc, currentFrame); CollectionFreeFormDocumentView.updateKeyframe(childDocs, currentFrame || 0, tagDoc); tagDoc._currentFrame = Math.max(0, (currentFrame || 0) + 1); tagDoc.lastFrame = Math.max(NumCast(tagDoc._currentFrame), NumCast(tagDoc.lastFrame)); @@ -1266,7 +1268,7 @@ export class PresBox extends ViewBoxBaseComponent const currentFrame = Cast(tagDoc._currentFrame, "number", null); if (currentFrame === undefined) { tagDoc._currentFrame = 0; - CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0); + // CollectionFreeFormDocumentView.setupKeyframes(childDocs, 0); } CollectionFreeFormDocumentView.gotoKeyframe(childDocs.slice()); tagDoc._currentFrame = Math.max(0, (currentFrame || 0) - 1); @@ -1308,13 +1310,13 @@ export class PresBox extends ViewBoxBaseComponent return (
e.stopPropagation()} onPointerUp={e => e.stopPropagation()} onPointerDown={e => e.stopPropagation()}> -
+ {/*
{this.stringType} selected
Contents
Edit
- {/*
+
Active text color
{ this.openActiveColorPicker = !this.openActiveColorPicker; })}>
@@ -1325,17 +1327,17 @@ export class PresBox extends ViewBoxBaseComponent
this.openViewedColorPicker = !this.openViewedColorPicker)}>
- {this.viewedColorPicker} */} - {/*
+ {this.viewedColorPicker} +
Zoom
Edit
-
*/} +
Scroll
Edit
-
-
+
*/} +
Frames
@@ -1353,12 +1355,8 @@ export class PresBox extends ViewBoxBaseComponent
{"Last frame"}
}>
{NumCast(targetDoc.lastFrame)}
-
- -
-
- {this.frameList} -
+ {this.frameListHeader} + {this.frameList}
console.log(" TODO: play frames")}>Play
@@ -1462,7 +1460,7 @@ export class PresBox extends ViewBoxBaseComponent activeItem.scrollProgressivize = !activeItem.scrollProgressivize; const targetDoc: Doc = this.targetDoc; targetDoc.scrollProgressivize = !targetDoc.scrollProgressivize; - CollectionFreeFormDocumentView.setupScroll(targetDoc, NumCast(targetDoc._currentFrame)); + // CollectionFreeFormDocumentView.setupScroll(targetDoc, NumCast(targetDoc._currentFrame)); if (targetDoc.editScrollProgressivize) { targetDoc.editScrollProgressivize = false; targetDoc._currentFrame = 0; @@ -1723,19 +1721,70 @@ export class PresBox extends ViewBoxBaseComponent ); } - @computed get frameList() { + @action + getList = (list: any): List => { + const x: List = list; + return x; + } + + @action + updateList = (list: any): List => { + const targetDoc: Doc = this.targetDoc; + const x: List = list; + x.length + 1; + x[x.length - 1] = NumCast(targetDoc._scrollY); + return x; + } + + @action + newFrame = () => { const activeItem: Doc = this.activeItem; const targetDoc: Doc = this.targetDoc; - const frameList: number[] = []; - frameList.length = NumCast(targetDoc.lastFrame); - const frameItems = frameList.map((value) => { -
+ const type: string = StrCast(targetDoc.type); + if (!activeItem.frameList) activeItem.frameList = new List(); + switch (type) { + case (DocumentType.PDF || DocumentType.RTF || DocumentType.WEB): + this.updateList(activeItem.frameList); + break; + case DocumentType.COL: + break; + default: + break; + } + } + @computed get frameListHeader() { + return (
+ Frames +
+
{"Add frame by example"}
}>
{ e.stopPropagation(); this.newFrame(); }}> + e.stopPropagation()} /> +
+
{"Edit in collection"}
}>
{ e.stopPropagation(); console.log('New frame'); }}> + e.stopPropagation()} /> +
- }) - return
- {frameItems} -
; +
); + } + + @computed get frameList() { + const activeItem: Doc = this.activeItem; + const targetDoc: Doc = this.targetDoc; + const frameList: List = this.getList(activeItem.frameList); + if (frameList) { + const frameItems = frameList.map((value) => +
+ +
+ ); + return ( + +
+ {frameItems} +
+ ); + } else return (null); + } @computed get playButtonFrames() { @@ -1798,7 +1847,7 @@ export class PresBox extends ViewBoxBaseComponent {this.playButtonFrames}
-
EXIT
+
{ this.updateMinimize; this.layoutDoc.presStatus = "edit"; clearTimeout(this._presTimer); }}>EXIT
: -- cgit v1.2.3-70-g09d2 From f75b69dc91191636842c794d878572a143347b54 Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Thu, 15 Oct 2020 19:29:04 +0800 Subject: Fixes for 3D Carousel --- src/client/views/nodes/PresBox.scss | 2 +- src/client/views/nodes/PresBox.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client/views/nodes/PresBox.scss') diff --git a/src/client/views/nodes/PresBox.scss b/src/client/views/nodes/PresBox.scss index 033e1e030..9a8b861ba 100644 --- a/src/client/views/nodes/PresBox.scss +++ b/src/client/views/nodes/PresBox.scss @@ -666,7 +666,7 @@ $light-background: #ececec; position: relative; align-self: flex-start; justify-self: flex-start; - width: 80%; + width: 100%; height: 100%; display: flex; align-items: center; diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index 5c6f7095a..0792be1da 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -1661,7 +1661,8 @@ export class PresBox extends ViewBoxBaseComponent @computed get toolbar() { const propIcon = CurrentUserUtils.propertiesWidth > 0 ? "angle-double-right" : "angle-double-left"; const propTitle = CurrentUserUtils.propertiesWidth > 0 ? "Close Presentation Panel" : "Open Presentation Panel"; - return ( + const mode = StrCast(this.rootDoc._viewType) as CollectionViewType; + return (mode === CollectionViewType.Carousel3D) ? (null) : (
{/*
{"Add new slide"}
}>
this.newDocumentTools = !this.newDocumentTools)}> @@ -1712,13 +1713,13 @@ export class PresBox extends ViewBoxBaseComponent
200 ? "inline-flex" : "none" }}>  Present
-
{ if (this.childDocs.length > 0) this.presentTools = !this.presentTools; }))}> {this.presentDropdown} -
+
} {this.playButtons}
-- cgit v1.2.3-70-g09d2