Skip to content

Commit 1bbab99

Browse files
committed
Some changes and use monaco for text viewable files
1 parent 7d4b700 commit 1bbab99

File tree

8 files changed

+630
-54
lines changed

8 files changed

+630
-54
lines changed

package-lock.json

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"lodash.defaultsdeep": "4.6.1",
6464
"lodash.omit": "4.5.0",
6565
"lodash.throttle": "4.0.1",
66+
"monaco-editor": "^0.28.1",
6667
"omggif": "1.0.9",
6768
"papaparse": "5.3.0",
6869
"postcss-import": "^12.0.0",
@@ -78,6 +79,7 @@
7879
"react-ga": "2.5.3",
7980
"react-intl": "2.9.0",
8081
"react-modal": "3.9.1",
82+
"react-monaco-editor": "^0.28.0",
8183
"react-popover": "0.5.10",
8284
"react-redux": "5.0.7",
8385
"react-responsive": "5.0.0",
@@ -129,6 +131,7 @@
129131
"jest": "^29.7.0",
130132
"jest-junit": "7.0.0",
131133
"mkdirp": "1.0.3",
134+
"monaco-editor-webpack-plugin": "^4.2.0",
132135
"raf": "3.4.1",
133136
"react-test-renderer": "16.14.0",
134137
"redux-mock-store": "1.5.3",

src/components/asset-viewer/asset-viewer.css

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import "../../css/colors.css";
12
@import "../../css/units.css";
23

34
.viewer-container {
@@ -21,4 +22,119 @@
2122
max-height: calc(50 * $space);
2223
border-radius: 0.25rem;
2324
margin: 1rem
25+
}
26+
27+
.editor-header-row {
28+
display: flex;
29+
align-items: center;
30+
width: 100%;
31+
}
32+
33+
.editor-surface {
34+
width: 100%;
35+
height: 24rem;
36+
margin-top: calc(2 * $space);
37+
border: 1px solid $ui-black-transparent;
38+
border-radius: 0.25rem;
39+
overflow: hidden;
40+
}
41+
42+
.info-row {
43+
margin-top: $space;
44+
width: 100%;
45+
display: flex;
46+
justify-content: flex-start;
47+
}
48+
49+
[dir="ltr"] .info-row .attribute + .attribute {
50+
margin-left: calc(2 * $space);
51+
}
52+
53+
[dir="rtl"] .info-row .attribute + .attribute {
54+
margin-right: calc(2 * $space);
55+
}
56+
57+
.input-group {
58+
display: flex;
59+
align-items: center;
60+
}
61+
62+
.name-input {
63+
min-width: 20rem;
64+
}
65+
66+
[dir="ltr"] .button-group {
67+
margin-left: 1rem;
68+
}
69+
70+
[dir="rtl"] .button-group {
71+
margin-right: 1rem;
72+
}
73+
74+
.button-group {
75+
display: flex;
76+
}
77+
78+
.button {
79+
height: 2rem;
80+
padding: 0.35rem;
81+
outline: none;
82+
background: $ui-white;
83+
border-radius: 0;
84+
border: 1px solid $ui-black-transparent;
85+
cursor: pointer;
86+
font-size: 0.85rem;
87+
user-select: none;
88+
margin: 0;
89+
position: relative;
90+
}
91+
92+
.button:not(:last-child) {
93+
border-right: none;
94+
}
95+
96+
[dir="rtl"] .button:not(:last-child) {
97+
border-left: none;
98+
border-right: 1px solid $ui-black-transparent;
99+
}
100+
101+
.button-group .button:first-child,
102+
[dir="rtl"] .button-group .button:last-child {
103+
border-radius: $form-radius 0 0 $form-radius;
104+
}
105+
106+
.button-group .button:last-child,
107+
[dir="rtl"] .button-group .button:first-child {
108+
border-radius: 0 $form-radius $form-radius 0;
109+
}
110+
111+
.button:active {
112+
background: $looks-transparent;
113+
}
114+
115+
.button:focus::before {
116+
content: "";
117+
position: absolute;
118+
top: -1px;
119+
right: -1px;
120+
bottom: -1px;
121+
left: -1px;
122+
border: 1px solid $looks-secondary;
123+
z-index: 1;
124+
}
125+
126+
.button > img {
127+
flex-grow: 1;
128+
max-width: 100%;
129+
max-height: 100%;
130+
min-width: 1.25rem;
131+
}
132+
133+
[dir="rtl"] .undo-icon,
134+
[dir="rtl"] .redo-icon {
135+
transform: scaleX(-1);
136+
}
137+
138+
.button:disabled > img {
139+
opacity: 0.25;
24140
}

0 commit comments

Comments
 (0)