pxt-core 13.1.8 → 13.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-core",
3
- "version": "13.1.8",
3
+ "version": "13.1.9",
4
4
  "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
5
5
  "keywords": [
6
6
  "TypeScript",
@@ -5,7 +5,7 @@ export interface CardProps extends ContainerProps {
5
5
  onClick?: () => void;
6
6
  tabIndex?: number;
7
7
  ariaLabelledBy?: string;
8
- label?: string;
8
+ label?: React.ReactNode;
9
9
  labelClass?: string;
10
10
  }
11
11
 
@@ -173,6 +173,7 @@ export const TreeItem = (props: TreeItemProps) => {
173
173
  onClick,
174
174
  label,
175
175
  labelClassName,
176
+ leftIcon,
176
177
  rightIcon,
177
178
  title
178
179
  } = props;
@@ -208,6 +209,7 @@ export const TreeItem = (props: TreeItemProps) => {
208
209
  tabIndex={isSelected ? 0 : -1}
209
210
  onKeyDown={handleKeydown(dispatch)}
210
211
  aria-expanded={hasSubtree ? expanded : undefined}
212
+ aria-selected={isSelected}
211
213
  >
212
214
  <div className={classList("common-treeitem", hasSubtree && "has-subtree")}>
213
215
  <ButtonBody
@@ -215,7 +217,7 @@ export const TreeItem = (props: TreeItemProps) => {
215
217
  title={title}
216
218
  labelClassName={labelClassName}
217
219
  rightIcon={rightIcon}
218
- leftIcon={hasSubtree ? (expanded ? "fas fa-chevron-down" : "fas fa-chevron-right") : undefined}
220
+ leftIcon={hasSubtree ? (expanded ? "fas fa-chevron-down" : "fas fa-chevron-right") : leftIcon}
219
221
  />
220
222
  </div>
221
223
  {hasSubtree &&
@@ -38,10 +38,13 @@ export const ExtensionCard = <U,>(props: ExtensionCardProps<U>) => {
38
38
  }
39
39
 
40
40
  const id = pxt.Util.guidGen();
41
- const cardLabel = installed ? lf("Installed") : label;
41
+ const cardLabel = installed
42
+ ? <><i className="fas fa-cog" aria-hidden={true} /> {lf("Installed")}</>
43
+ : label;
44
+ const cardLabelText = installed ? lf("Installed") : label;
42
45
  const cardLabelClass = installed ? classList("installed", labelClass) : labelClass;
43
46
  const descriptionId = id + "-description";
44
- const statusId = cardLabel ? id + "-status" : undefined;
47
+ const statusId = cardLabelText ? id + "-status" : undefined;
45
48
 
46
49
  return <>
47
50
  <Card
@@ -63,7 +66,7 @@ export const ExtensionCard = <U,>(props: ExtensionCardProps<U>) => {
63
66
  {description}
64
67
  </div>
65
68
  </div>
66
- {cardLabel && <div id={statusId} className="sr-only">{cardLabel}</div>}
69
+ {cardLabelText && <div id={statusId} className="sr-only">{cardLabelText}</div>}
67
70
  {(showDisclaimer || learnMoreUrl) &&
68
71
  <div className="common-extension-card-extra-content">
69
72
  {showDisclaimer && lf("User-provided extension, not endorsed by Microsoft.")}
@@ -62,6 +62,9 @@
62
62
  color: var(--pxt-colors-green-foreground);
63
63
  background-color: var(--pxt-colors-green-background);
64
64
  border-color: var(--pxt-colors-green-hover);
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 0.35rem;
65
68
  }
66
69
 
67
70
  a.link-button {
@@ -7,6 +7,7 @@
7
7
  @import "Track";
8
8
  @import "TrackSelector";
9
9
  @import "Workspace";
10
+ @import "gallery";
10
11
 
11
12
  @music-editor-header-color: #e30fc0; // Matches block color
12
13
  @music-editor-header-border-color: #c10da3; // Matches block color
@@ -0,0 +1,97 @@
1
+ .image-editor-gallery.song {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-content: center;
5
+ justify-content: unset;
6
+ padding: 0.5rem;
7
+
8
+ gap: 0.5rem;
9
+ }
10
+
11
+ .song-gallery-item {
12
+ display: flex;
13
+ flex-direction: row;
14
+ align-items: center;
15
+ padding: 0.5rem;
16
+ width: 100%;
17
+ height: 4rem;
18
+
19
+ background-color: var(--pxt-neutral-background1);
20
+ color: var(--pxt-neutral-foreground1);
21
+ border-radius: 0.25rem;
22
+ max-width: 500px;
23
+ gap: 1rem;
24
+
25
+ .song-gallery-item-name {
26
+ flex-shrink: 0;
27
+ width: 7rem;
28
+ font-weight: 600;
29
+ font-size: 18px;
30
+
31
+ overflow-x: hidden;
32
+ overflow-y: hidden;
33
+ text-overflow: ellipsis;
34
+
35
+ height: 3rem;
36
+ line-height: 3rem;
37
+ }
38
+
39
+ .song-gallery-item-preview {
40
+ flex-grow: 1;
41
+ flex-shrink: 1;
42
+ position: relative;
43
+ overflow-x: hidden;
44
+ overflow-y: hidden;
45
+ height: 3rem;
46
+
47
+ img {
48
+ image-rendering: pixelated;
49
+ width: 100%;
50
+ height: 3rem;
51
+ object-fit: fill;
52
+ }
53
+ }
54
+
55
+ .common-button.play-button {
56
+ flex-shrink: 0;
57
+ width: 3rem;
58
+ height: 3rem;
59
+ padding: 0;
60
+ border-radius: 2rem;
61
+ background-color: var(--pxt-neutral-foreground2);
62
+ color: var(--pxt-neutral-background2);
63
+
64
+ .fas.fa-play, .fas.fa-stop {
65
+ margin: 0 0 0 0.25rem;
66
+ color: var(--pxt-neutral-background2);
67
+ }
68
+
69
+ .fas.fa-stop {
70
+ margin: 0;
71
+ }
72
+
73
+ &:focus-visible:after {
74
+ outline: solid var(--pxt-focus-border) 3px;
75
+ outline-offset: 5px;
76
+ }
77
+ }
78
+
79
+ .common-button.song-gallery-item-button {
80
+ flex-grow: 1;
81
+ height: 3rem;
82
+ padding: 0;
83
+ background-color: var(--pxt-neutral-background1);
84
+
85
+ .common-button-label {
86
+ display: flex;
87
+ flex-direction: row;
88
+ height: 3rem;
89
+ align-items: center;
90
+ }
91
+
92
+ &:focus-visible:after {
93
+ outline: solid var(--pxt-focus-border) 3px;
94
+ outline-offset: 5px;
95
+ }
96
+ }
97
+ }
@@ -197,7 +197,7 @@
197
197
  }
198
198
  }
199
199
 
200
- .selection {
200
+ .piano-roll .selection {
201
201
  position: absolute;
202
202
  top: 0;
203
203
  height: 100%;
@@ -117,6 +117,36 @@
117
117
  filter: grayscale(.15) brightness(.85) contrast(1.3);
118
118
  }
119
119
 
120
+ .common-treeitem-container.extension-event {
121
+ min-width: 0;
122
+ max-width: 100%;
123
+
124
+ .common-treeitem {
125
+ box-sizing: border-box;
126
+ min-width: 0;
127
+ width: 100%;
128
+ }
129
+
130
+ .common-button-flex {
131
+ display: flex;
132
+ align-items: center;
133
+ min-width: 0;
134
+ width: 100%;
135
+ }
136
+
137
+ .common-button-label {
138
+ min-width: 0;
139
+ overflow: hidden;
140
+ text-overflow: ellipsis;
141
+ white-space: nowrap;
142
+ }
143
+
144
+ i {
145
+ flex-shrink: 0;
146
+ margin-right: 0.5rem;
147
+ }
148
+ }
149
+
120
150
  .time-machine-tree-container {
121
151
  flex-grow: 1;
122
152
  overflow-y: auto;
@@ -159,7 +189,7 @@
159
189
  height: @mobileMenuHeight;
160
190
  }
161
191
 
162
- button.common-button.square-on-mobile {
192
+ .common-button.square-on-mobile {
163
193
  width: 3rem;
164
194
  height: 3rem;
165
195
  padding: 0;