Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 096ea72

Browse files
feat(#680): order and small devices
Signed-off-by: peterpeterparker <[email protected]>
1 parent 9a2ac51 commit 096ea72

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

studio/src/app/components/editor/actions/element/app-actions-element/app-actions-element.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class AppActionsElement {
5555
private align: TextAlign | undefined;
5656

5757
@State()
58-
private list: SlotType;
58+
private list: SlotType | undefined;
5959

6060
@Event() private blockSlide: EventEmitter<boolean>;
6161

@@ -971,6 +971,8 @@ export class AppActionsElement {
971971
componentProps: {
972972
notes: this.slide,
973973
copy: this.slide || this.shape,
974+
reveal: !this.hideReveal(),
975+
list: this.list !== undefined,
974976
},
975977
event: $event,
976978
mode: 'ios',
@@ -984,22 +986,30 @@ export class AppActionsElement {
984986
await this.clone();
985987
} else if (detail.data.action === MoreAction.DELETE) {
986988
await this.confirmDeleteElement($event);
989+
} else if (detail.data.action === MoreAction.REVEAL) {
990+
await this.openSingleAction($event, 'app-reveal');
991+
} else if (detail.data.action === MoreAction.LIST) {
992+
await this.toggleList();
987993
}
988994
}
989995
});
990996

991997
await popover.present();
992998
}
993999

1000+
private hideReveal(): boolean {
1001+
return this.slide || this.code || this.shape || this.slideNodeName === 'deckgo-slide-youtube';
1002+
}
1003+
9941004
render() {
9951005
return (
9961006
<ion-toolbar>
9971007
<ion-buttons slot="start">
9981008
{this.renderEdit()}
9991009
{this.renderShapes()}
1010+
{this.renderColor()}
10001011
{this.renderReveal()}
10011012
{this.renderAlign()}
1002-
{this.renderColor()}
10031013
{this.renderList()}
10041014
{this.renderImages()}
10051015
{this.renderCodeOptions()}
@@ -1122,7 +1132,7 @@ export class AppActionsElement {
11221132
}
11231133

11241134
private renderReveal() {
1125-
const classReveal: string | undefined = this.slide || this.code || this.shape || this.slideNodeName === 'deckgo-slide-youtube' ? 'hidden' : undefined;
1135+
const classReveal: string | undefined = this.hideReveal() ? 'hidden wider-devices' : 'wider-devices';
11261136

11271137
return (
11281138
<ion-tab-button
@@ -1154,8 +1164,8 @@ export class AppActionsElement {
11541164
}
11551165

11561166
private renderList() {
1157-
const classListOL: string | undefined = this.list === SlotType.OL ? undefined : 'hidden';
1158-
const classListUL: string | undefined = this.list === SlotType.UL ? undefined : 'hidden';
1167+
const classListOL: string | undefined = this.list === SlotType.OL ? 'wider-devices' : 'wider-devices hidden';
1168+
const classListUL: string | undefined = this.list === SlotType.UL ? 'wider-devices' : 'wider-devices hidden';
11591169

11601170
return [
11611171
<ion-tab-button onClick={() => this.toggleList()} aria-label="Toggle to an unordered list" color="primary" mode="md" class={classListUL}>

studio/src/app/popovers/editor/actions/app-more-element-actions/app-more-element-actions.tsx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {MoreAction} from '../../../../utils/editor/more-action';
33

44
@Component({
55
tag: 'app-more-element-actions',
6-
styleUrl: 'app-more-element-actions.scss'
6+
styleUrl: 'app-more-element-actions.scss',
77
})
88
export class AppMoreElementActions {
99
@Element() el: HTMLElement;
@@ -14,9 +14,15 @@ export class AppMoreElementActions {
1414
@Prop()
1515
copy: boolean = false;
1616

17+
@Prop()
18+
reveal: boolean = false;
19+
20+
@Prop()
21+
list: boolean = false;
22+
1723
private async closePopover(action: MoreAction) {
1824
await (this.el.closest('ion-popover') as HTMLIonPopoverElement).dismiss({
19-
action: action
25+
action: action,
2026
});
2127
}
2228

@@ -25,6 +31,8 @@ export class AppMoreElementActions {
2531
<div class="ion-padding">
2632
{this.renderNotes()}
2733
{this.renderCopy()}
34+
{this.renderReveal()}
35+
{this.renderList()}
2836
{this.renderDelete()}
2937
</div>
3038
);
@@ -54,6 +62,30 @@ export class AppMoreElementActions {
5462
);
5563
}
5664

65+
private renderList() {
66+
if (!this.list) {
67+
return undefined;
68+
}
69+
70+
return (
71+
<a onClick={() => this.closePopover(MoreAction.LIST)} aria-label="List">
72+
<p>List</p>
73+
</a>
74+
);
75+
}
76+
77+
private renderReveal() {
78+
if (!this.reveal) {
79+
return undefined;
80+
}
81+
82+
return (
83+
<a onClick={() => this.closePopover(MoreAction.REVEAL)} aria-label="Animation">
84+
<p>Animation</p>
85+
</a>
86+
);
87+
}
88+
5789
private renderDelete() {
5890
return (
5991
<a onClick={() => this.closePopover(MoreAction.DELETE)} aria-label="Delete">

studio/src/app/utils/editor/more-action.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ export enum MoreAction {
99
NOTES,
1010
DELETE,
1111
HELP,
12-
OFFLINE
12+
OFFLINE,
13+
LIST,
14+
REVEAL,
1315
}

studio/src/components.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ export namespace Components {
229229
}
230230
interface AppMoreElementActions {
231231
'copy': boolean;
232+
'list': boolean;
232233
'notes': boolean;
234+
'reveal': boolean;
233235
}
234236
interface AppMoreShareOptions {}
235237
interface AppNavigation {
@@ -1238,7 +1240,9 @@ declare namespace LocalJSX {
12381240
}
12391241
interface AppMoreElementActions {
12401242
'copy'?: boolean;
1243+
'list'?: boolean;
12411244
'notes'?: boolean;
1245+
'reveal'?: boolean;
12421246
}
12431247
interface AppMoreShareOptions {}
12441248
interface AppNavigation {

0 commit comments

Comments
 (0)