pxt-core 13.2.1 → 13.2.2

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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/built/pxt.js +61 -60
  3. package/built/pxtlib.js +61 -60
  4. package/built/react-common/components/controls/DropdownModal.d.ts +6 -0
  5. package/built/react-common/components/controls/Input.d.ts +1 -1
  6. package/built/target.js +1 -1
  7. package/built/targetlight.js +1 -1
  8. package/built/tests/thumb-test/asmchecks.d.ts +51 -0
  9. package/built/tests/thumb-test/thumbrunner.d.ts +3 -0
  10. package/built/web/main.js +30 -30
  11. package/built/web/pxtapp.js +1 -1
  12. package/built/web/pxtasseteditor.js +20 -20
  13. package/built/web/pxtembed.js +4 -4
  14. package/built/web/pxtlib.js +1 -1
  15. package/built/web/pxtworker.js +1 -1
  16. package/built/web/react-common-authcode.css +1 -1
  17. package/built/web/react-common-multiplayer.css +1 -1
  18. package/built/web/react-common-skillmap.css +1 -1
  19. package/built/web/rtlreact-common-authcode.css +1 -1
  20. package/built/web/rtlreact-common-multiplayer.css +1 -1
  21. package/built/web/rtlreact-common-skillmap.css +1 -1
  22. package/built/web/rtlsemantic.css +2 -2
  23. package/built/web/runnerembed.js +5 -5
  24. package/built/web/semantic.css +2 -2
  25. package/common-docs/blocks-embed.md +2 -2
  26. package/common-docs/github/commit.md +1 -1
  27. package/common-docs/github/private-assignments.md +1 -1
  28. package/common-docs/github/test-extension.md +1 -1
  29. package/common-docs/online-learning.md +2 -2
  30. package/common-docs/reference/arrays/pick-random.md +1 -1
  31. package/common-docs/reference/text/char-code-at.md +1 -1
  32. package/common-docs/share.md +2 -2
  33. package/common-docs/types/function/define.md +1 -1
  34. package/localtypings/pxtarget.d.ts +1 -1
  35. package/package.json +3 -2
  36. package/react-common/components/controls/DropdownModal.tsx +66 -0
  37. package/react-common/components/controls/Input.tsx +1 -1
  38. package/react-common/styles/controls/DropdownModal.less +17 -0
  39. package/react-common/styles/react-common.less +1 -0
  40. package/react-common/styles/theming/ThemePickerModal.less +5 -0
  41. package/theme/monaco.less +2 -0
  42. package/theme/music-editor/gallery.less +10 -1
  43. package/theme/piano-roll/piano-roll.less +33 -2
  44. package/theme/pxtjson.less +0 -12
@@ -90,7 +90,7 @@ export interface RenderBlocksRequestMessage extends SimulatorMessage {
90
90
  }
91
91
  ```
92
92
 
93
- * ``id``: The identifer of the snippet element. This is used to match the document element of the snippet with the rendered blocks returned later.
93
+ * ``id``: The identifier of the snippet element. This is used to match the document element of the snippet with the rendered blocks returned later.
94
94
  * ``code``: The text of the code snippet to send, compile, and render. The snippet may be JavaScript or the Blockly XML payload.
95
95
  * ``packageId``: the identifier of a project shared in the editor (without the ``https://makecode.com/`` prefix)
96
96
 
@@ -113,7 +113,7 @@ export interface RenderBlocksResponseMessage extends SimulatorMessage {
113
113
  }
114
114
  ```
115
115
 
116
- * ``id``: The identifer of the snippet element. This is used to replace the document element of the snippet with the rendered blocks or to associate the rendered blocks if the snippet is to be retained in the document.
116
+ * ``id``: The identifier of the snippet element. This is used to replace the document element of the snippet with the rendered blocks or to associate the rendered blocks if the snippet is to be retained in the document.
117
117
  * ``svg``: The SVG image element.
118
118
  * ``uri``: The data source of the blocks image.
119
119
  * ``width``: The width of the SVG blocks image.
@@ -12,7 +12,7 @@ If the changes look correct, click on **commit & push changes** to create a **co
12
12
 
13
13
  ## Review & revert
14
14
 
15
- It's good practice to **review** your **local** changes before commiting; just like you review your answer sheet before turning in a test. If you find some changes that are incorrect, you can decide to fix them right away, **revert** the entire file, or even just **commit** them so you can make any fixes later.
15
+ It's good practice to **review** your **local** changes before committing; just like you review your answer sheet before turning in a test. If you find some changes that are incorrect, you can decide to fix them right away, **revert** the entire file, or even just **commit** them so you can make any fixes later.
16
16
 
17
17
  ## See Also
18
18
 
@@ -12,7 +12,7 @@ This collaboration method is quite similar to the way professional developers us
12
12
  #### Public repositories
13
13
 
14
14
  Using **public** repositories simplifies a lot the configuration phase for the assignments.
15
- If it is acceptable for the code to be publically available on [GitHub](https://github.com),
15
+ If it is acceptable for the code to be publicly available on [GitHub](https://github.com),
16
16
  we recommend using the [public assignments](/github/public-assignments).
17
17
 
18
18
  ### ~
@@ -1,6 +1,6 @@
1
1
  # Testing an Extension
2
2
 
3
- Both the extension and a test project are open in separate editor tabs in the browser. You can work on both simultanously as you add and modify your extension code. As you switch between them, each will reload automatically.
3
+ Both the extension and a test project are open in separate editor tabs in the browser. You can work on both simultaneously as you add and modify your extension code. As you switch between them, each will reload automatically.
4
4
 
5
5
  ## API Tests
6
6
 
@@ -16,7 +16,7 @@ https://youtu.be/oBarPukXXXQ
16
16
 
17
17
  ## [Google Classroom](https://classroom.google.com) #googleclassroom
18
18
 
19
- You can use shared urls or download files from the MakeCode editor to create assigments in Google Classroom. See the tutorial video below.
19
+ You can use shared urls or download files from the MakeCode editor to create assignments in Google Classroom. See the tutorial video below.
20
20
 
21
21
  ### #youtubegoogleclassroom
22
22
 
@@ -24,7 +24,7 @@ https://youtu.be/vDISKdJ3ynA
24
24
 
25
25
  ## [Canvas](https://www.canvas.net/) #canvas
26
26
 
27
- You can use shared urls or download files from the MakeCode editor to create assigments in Canvas. See the tutorial video below.
27
+ You can use shared urls or download files from the MakeCode editor to create assignments in Canvas. See the tutorial video below.
28
28
 
29
29
  ### #youtubecanvas
30
30
 
@@ -23,7 +23,7 @@ let item = list[Math.randomRange(0, list.length - 1)]
23
23
 
24
24
  ## Returns
25
25
 
26
- * An item from the array that is ramdomly selected.
26
+ * An item from the array that is randomly selected.
27
27
 
28
28
  ## Example #example
29
29
 
@@ -6,7 +6,7 @@ Get the code for a character (letter, number, or symbol) from a place in a text
6
6
  "".charCodeAt(0)
7
7
  ```
8
8
 
9
- Like the position of a character in the an alphabet, or the traditional order of characters in a language, characters are assigned a code in a character set when used with computers. If a character set used only the 5 characters of "ABCDE", then 'A', as the first character, would have a character code of `0` and 'D' would have a charcter code of `3`.
9
+ Like the position of a character in the an alphabet, or the traditional order of characters in a language, characters are assigned a code in a character set when used with computers. If a character set used only the 5 characters of "ABCDE", then 'A', as the first character, would have a character code of `0` and 'D' would have a character code of `3`.
10
10
 
11
11
  You can find the code of a character in a text string by selecting it from it's position in a string.
12
12
 
@@ -14,7 +14,7 @@ Give your project a Title and optionally, you can create a thumbnail image or an
14
14
 
15
15
  Clicking "Share Project" will create a link to your project.
16
16
 
17
- ![Share project anonomously](/static/share/anon-share-link.png)
17
+ ![Share project anonymously](/static/share/anon-share-link.png)
18
18
 
19
19
  This link is not published anywhere else and it is not tied to a specific user (it’s an "anonymous link"). If you lose the link, then there’s no way to get it back - you will have to share your project again to create a new link. These links are snapshots in time of a project, so if you make any subsequent changes to your project, you will have to Share your project again to create a new link with the changes. There is also no way to remove or "unpublish" an anonymous share link, except through the "Report Abuse" function (see below for more information).
20
20
 
@@ -58,7 +58,7 @@ By default, all shared projects in MakeCode can be copied and edited. There is n
58
58
 
59
59
  ## Asset Packs #asset-packs
60
60
 
61
- Certain editors (such as [MakeCode Arcade](https://arcade.makecode.com)) can include resource files inside of projects. The resources, or _assets_, might contain byte respresentations of images, animations, sounds, tilemaps, etc. An **Asset Pack** is a resource only project where just the assets are shared and no code is loaded from the shared project.
61
+ Certain editors (such as [MakeCode Arcade](https://arcade.makecode.com)) can include resource files inside of projects. The resources, or _assets_, might contain byte representations of images, animations, sounds, tilemaps, etc. An **Asset Pack** is a resource only project where just the assets are shared and no code is loaded from the shared project.
62
62
 
63
63
  If this feature is supported by your editor, you can set a project as an asset pack by going to the **Settings** (⚙️) menu and selecting 'Project Settings'. Enable the 'Import as asset pack' setting. Watch this video to see how it's done:
64
64
 
@@ -80,7 +80,7 @@ function addStrings(stringA: string, stringB: string, first: boolean) {
80
80
 
81
81
  #### Pull down the parameter
82
82
 
83
- In blocks, you can pull a parmeter from the function block and drag it down and place it as a variable in the code inside the function.
83
+ In blocks, you can pull a parameter from the function block and drag it down and place it as a variable in the code inside the function.
84
84
 
85
85
  Pull the ``||variables:message||`` parameter from the **repeat** function.
86
86
 
@@ -628,7 +628,7 @@ declare namespace pxt {
628
628
  interface PxtJsonOption {
629
629
  label: string;
630
630
  property: string;
631
- type: "checkbox";
631
+ type: "checkbox" | "input";
632
632
  }
633
633
 
634
634
  interface AssetConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-core",
3
- "version": "13.2.1",
3
+ "version": "13.2.2",
4
4
  "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
5
5
  "keywords": [
6
6
  "TypeScript",
@@ -183,6 +183,7 @@
183
183
  "update": "gulp update",
184
184
  "watch-streamer": "cd docs/static/streamer && tsc -t es6 --watch",
185
185
  "prepare": "node ./scripts/npm-prepare.js",
186
- "compile-aw": "gh aw compile --strict"
186
+ "compile-aw": "gh aw compile --strict",
187
+ "hwab": "node tests/hw-ab/hwab.js"
187
188
  }
188
189
  }
@@ -0,0 +1,66 @@
1
+ import * as React from "react";
2
+ import { classList, ControlProps } from "../util";
3
+ import { Button, ButtonViewProps } from "./Button";
4
+ import { DropdownProps } from "./Dropdown";
5
+ import { FocusList } from "./FocusList";
6
+ import { Modal } from "./Modal";
7
+
8
+ interface DropdownModalProps extends DropdownProps {
9
+ onClose: () => void;
10
+ }
11
+
12
+ export const DropdownModal = (props: DropdownModalProps) => {
13
+ const {
14
+ className,
15
+ ariaLabel,
16
+ items,
17
+ selectedId,
18
+ onItemSelected,
19
+ onClose
20
+ } = props;
21
+
22
+ const focusableItems = React.useRef<{[k: string]: HTMLButtonElement}>({});
23
+
24
+ React.useEffect(() => {
25
+ if (Object.keys(focusableItems.current).length) {
26
+ focusableItems.current[selectedId ?? 0].focus();
27
+ }
28
+ }, [selectedId]);
29
+
30
+
31
+ return (
32
+ <Modal
33
+ className={classList("common-dropdown-modal", className)}
34
+ title={ariaLabel}
35
+ hideTitle={true}
36
+ onClose={onClose}
37
+ hideDismissButton={true}
38
+ >
39
+ <FocusList
40
+ role="listbox"
41
+ className="common-menu-dropdown-pane common-dropdown-shadow"
42
+ childTabStopId={selectedId}
43
+ useUpAndDownArrowKeys={true}
44
+ onClose={onClose}
45
+ >
46
+ <ul role="presentation">
47
+ { items.map(item =>
48
+ <li key={item.id} role="presentation">
49
+ <Button
50
+ {...item}
51
+ buttonRef={ref => focusableItems.current[item.id] = (ref as HTMLButtonElement)}
52
+ className={classList("common-dropdown-item", item.className)}
53
+ onClick={() => {
54
+ onItemSelected(item.id);
55
+ onClose();
56
+ }}
57
+ ariaSelected={item.id === selectedId}
58
+ leftIcon={classList("fas fa-check", selectedId !== item.id && "transparent")}
59
+ role="option"/>
60
+ </li>
61
+ )}
62
+ </ul>
63
+ </FocusList>
64
+ </Modal>
65
+ )
66
+ }
@@ -8,7 +8,7 @@ export interface InputProps extends ControlProps {
8
8
  inputClassName?: string;
9
9
  groupClassName?: string;
10
10
  initialValue?: string;
11
- label?: string;
11
+ label?: string | JSX.Element;
12
12
  title?: string;
13
13
  placeholder?: string;
14
14
  icon?: string;
@@ -0,0 +1,17 @@
1
+ .common-dropdown-modal .common-modal {
2
+ .common-modal-header {
3
+ display: none;
4
+ }
5
+ .common-modal-body {
6
+ background: none;
7
+ }
8
+
9
+ .common-menu-dropdown-pane {
10
+ position: relative;
11
+ right: unset;
12
+ }
13
+
14
+ .common-dropdown-item .fas.fa-check.transparent {
15
+ opacity: 0;
16
+ }
17
+ }
@@ -11,6 +11,7 @@
11
11
  @import "controls/Checkbox.less";
12
12
  @import "controls/DraggableGraph.less";
13
13
  @import "controls/Dropdown.less";
14
+ @import "controls/DropdownModal.less";
14
15
  @import "controls/EditorToggle.less";
15
16
  @import "controls/Icon.less";
16
17
  @import "controls/Input.less";
@@ -369,3 +369,8 @@
369
369
  }
370
370
  }
371
371
  }
372
+
373
+ .hc .theme-picker .theme-card.selected {
374
+ border-color: @highContrastTextColor;
375
+ box-shadow: inset 0 0 0 2px @highContrastTextColor;
376
+ }
package/theme/monaco.less CHANGED
@@ -19,6 +19,8 @@
19
19
 
20
20
  .monacoToolboxDiv {
21
21
  height: 100%;
22
+ /* Prevent large category lists from expanding the page scroll bounds. */
23
+ contain: paint;
22
24
  }
23
25
 
24
26
  .monacoEditorRightArea {
@@ -1,6 +1,8 @@
1
1
  .image-editor-gallery.song {
2
2
  display: flex;
3
3
  flex-direction: column;
4
+ flex-wrap: balance;
5
+ align-items: center;
4
6
  align-content: center;
5
7
  justify-content: unset;
6
8
  padding: 0.5rem;
@@ -15,11 +17,12 @@
15
17
  padding: 0.5rem;
16
18
  width: 100%;
17
19
  height: 4rem;
20
+ flex-shrink: 0;
18
21
 
19
22
  background-color: var(--pxt-neutral-background1);
20
23
  color: var(--pxt-neutral-foreground1);
21
24
  border-radius: 0.25rem;
22
- max-width: 500px;
25
+ max-width: 440px;
23
26
  gap: 1rem;
24
27
 
25
28
  .song-gallery-item-name {
@@ -94,4 +97,10 @@
94
97
  outline-offset: 5px;
95
98
  }
96
99
  }
100
+ }
101
+
102
+ @media @tabletAndBelow {
103
+ .image-editor-gallery.song {
104
+ flex-wrap: nowrap;
105
+ }
97
106
  }
@@ -12,7 +12,6 @@
12
12
  --note-event-text-color-hover: #ffffff;
13
13
  --note-event-border-hover: 2px solid #ffffff;
14
14
 
15
- --header-text-color: black;
16
15
 
17
16
  --white-key-color: white;
18
17
  --black-key-color: black;
@@ -28,7 +27,9 @@
28
27
 
29
28
  --velocity-slider-color: var(--note-event-color);
30
29
 
31
- --header-background: #f0f0f0;
30
+ --header-background: var(--pxt-neutral-background1);
31
+ --header-text-color: var(--pxt-neutral-foreground1);
32
+
32
33
  --piano-roll-border-color: var(--workspace-grid-line-color);
33
34
  }
34
35
 
@@ -64,6 +65,13 @@
64
65
  .piano-roll .header-container {
65
66
  height: var(--header-height);
66
67
  flex-shrink: 0;
68
+
69
+ .header > .common-dropdown .common-menu-dropdown-pane {
70
+ max-height: 15rem;
71
+ overflow-y: auto;
72
+ overflow-x: hidden;
73
+ z-index: 2;
74
+ }
67
75
  }
68
76
 
69
77
  .piano-roll .header,
@@ -128,6 +136,10 @@
128
136
  &>.common-dropdown #snap-select {
129
137
  min-width: 4.75rem;
130
138
  }
139
+
140
+ .common-button.menu-button {
141
+ color: var(--header-text-color);
142
+ }
131
143
  }
132
144
 
133
145
  .scrollbar.horizontal {
@@ -260,6 +272,9 @@
260
272
  padding-right: 0.25rem;
261
273
  background-color: var(--white-key-color);
262
274
  color: var(--key-text-color);
275
+ white-space: nowrap;
276
+ text-overflow: ellipsis;
277
+ overflow-x: hidden;
263
278
 
264
279
  &.active,
265
280
  &.playing {
@@ -340,6 +355,16 @@
340
355
  background-color: var(--playhead-color);
341
356
  }
342
357
 
358
+ .piano-roll .header .velocity-editor-toggle {
359
+ overflow-x: hidden;
360
+
361
+ label {
362
+ white-space: nowrap;
363
+ text-overflow: ellipsis;
364
+ overflow: hidden;
365
+ }
366
+ }
367
+
343
368
  .velocity-editor {
344
369
  position: relative;
345
370
  display: flex;
@@ -421,4 +446,10 @@
421
446
  .music-editor-edit-controls .common-button.green {
422
447
  display: none;
423
448
  }
449
+ }
450
+
451
+ @media @tabletAndBelow {
452
+ .common-dropdown > .common-button {
453
+ min-width: 8rem;
454
+ }
424
455
  }
@@ -2,16 +2,4 @@
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 0.5rem;
5
- }
6
-
7
- .pxt-json-simulator-theme {
8
- display: flex;
9
- flex-direction: column;
10
- align-items: flex-start;
11
- gap: 0.3rem;
12
-
13
- label {
14
- font-size: 14px;
15
- font-weight: 600;
16
- }
17
5
  }