pxt-core 12.3.26 → 13.0.1

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 (30) hide show
  1. package/built/pxtlib.d.ts +1 -0
  2. package/built/react-common/components/controls/Input.d.ts +1 -0
  3. package/built/react-common/components/extensions/ExtensionCard.d.ts +2 -0
  4. package/built/target.js +1 -1
  5. package/built/targetlight.js +1 -1
  6. package/built/tests/blocksrunner.js +8 -11
  7. package/built/tests/blockssetup.js +8 -11
  8. package/built/web/main.js +2 -2
  9. package/built/web/multiplayer/js/{main.6c837cec.js → main.58655f23.js} +2 -2
  10. package/built/web/pxtasseteditor.js +2 -2
  11. package/built/web/pxtembed.js +2 -2
  12. package/built/web/react-common-authcode.css +1 -1
  13. package/built/web/react-common-multiplayer.css +1 -1
  14. package/built/web/react-common-skillmap.css +1 -1
  15. package/built/web/rtlreact-common-authcode.css +1 -1
  16. package/built/web/rtlreact-common-multiplayer.css +1 -1
  17. package/built/web/rtlreact-common-skillmap.css +1 -1
  18. package/built/web/rtlsemantic.css +1 -1
  19. package/built/web/runnerembed.js +2 -2
  20. package/built/web/semantic.css +1 -1
  21. package/built/web/skillmap/js/{main.80271a2e.js → main.e779c5ca.js} +2 -2
  22. package/built/web/teachertool/js/{main.ed470286.js → main.3e785c99.js} +2 -2
  23. package/package.json +4 -4
  24. package/react-common/components/controls/Input.tsx +15 -3
  25. package/react-common/components/extensions/ExtensionCard.tsx +14 -4
  26. package/react-common/styles/extensions/ExtensionCard.less +20 -0
  27. package/theme/home.less +1 -1
  28. package/webapp/public/multiplayer.html +1 -1
  29. package/webapp/public/skillmap.html +1 -1
  30. package/webapp/public/teachertool.html +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-core",
3
- "version": "12.3.26",
3
+ "version": "13.0.1",
4
4
  "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
5
5
  "keywords": [
6
6
  "TypeScript",
@@ -71,7 +71,7 @@
71
71
  "@zip.js/zip.js": "2.4.20",
72
72
  "adm-zip": "^0.5.12",
73
73
  "axios": "^1.12.2",
74
- "blockly": "13.1.0",
74
+ "blockly": "13.1.1",
75
75
  "browserify": "17.0.0",
76
76
  "chai": "^3.5.0",
77
77
  "chalk": "^4.1.2",
@@ -151,10 +151,10 @@
151
151
  },
152
152
  "overrides": {
153
153
  "@blockly/field-grid-dropdown": {
154
- "blockly": "13.1.0"
154
+ "blockly": "13.1.1"
155
155
  },
156
156
  "@blockly/plugin-workspace-search": {
157
- "blockly": "13.1.0"
157
+ "blockly": "13.1.1"
158
158
  },
159
159
  "combine-source-map": {
160
160
  "source-map": "0.4.4"
@@ -25,6 +25,7 @@ export interface InputProps extends ControlProps {
25
25
  options?: pxt.Map<string>;
26
26
  filter?: string;
27
27
 
28
+ validator?: (value: string, prevValue: string) => string;
28
29
  onChange?: (newValue: string) => void;
29
30
  onEnterKey?: (value: string) => void;
30
31
  onIconClick?: (value: string) => void;
@@ -71,7 +72,8 @@ export const Input = (props: InputProps) => {
71
72
  onOptionSelected,
72
73
  handleInputRef,
73
74
  preserveValueOnBlur = true,
74
- options
75
+ options,
76
+ validator,
75
77
  } = props;
76
78
 
77
79
  const [value, setValue] = React.useState(initialValue || "");
@@ -116,9 +118,14 @@ export const Input = (props: InputProps) => {
116
118
  const keyDownHandler = (e: React.KeyboardEvent) => {
117
119
  const charCode = (typeof e.which == "number") ? e.which : e.keyCode;
118
120
  if (charCode === /*enter*/13 || props.treatSpaceAsEnter && charCode === /*space*/32) {
121
+ let validatedValue = value;
122
+ if (validator) {
123
+ validatedValue = validator(value, initialValue || "");
124
+ setValue(validatedValue);
125
+ }
119
126
  if (onEnterKey) {
120
127
  e.preventDefault();
121
- onEnterKey(value);
128
+ onEnterKey(validatedValue);
122
129
  }
123
130
  } else if (options && e.key === "ArrowDown") {
124
131
  if (expanded) {
@@ -164,8 +171,13 @@ export const Input = (props: InputProps) => {
164
171
  }
165
172
 
166
173
  const blurHandler = () => {
174
+ let validatedValue = value;
175
+ if (validator) {
176
+ validatedValue = validator(value, initialValue || "");
177
+ setValue(validatedValue);
178
+ }
167
179
  if (onBlur) {
168
- onBlur(value);
180
+ onBlur(validatedValue);
169
181
  }
170
182
  if (!preserveValueOnBlur) {
171
183
  setValue("");
@@ -10,9 +10,11 @@ export interface ExtensionCardProps<U> {
10
10
  imageUrl?: string;
11
11
  learnMoreUrl?: string;
12
12
  label?: string;
13
+ labelClass?: string;
13
14
  onClick?: (value: U) => void;
14
15
  extension?: U;
15
16
  loading?: boolean;
17
+ installed?: boolean;
16
18
  showDisclaimer?: boolean
17
19
  }
18
20
 
@@ -23,9 +25,11 @@ export const ExtensionCard = <U,>(props: ExtensionCardProps<U>) => {
23
25
  imageUrl,
24
26
  learnMoreUrl,
25
27
  label,
28
+ labelClass,
26
29
  onClick,
27
30
  extension,
28
31
  loading,
32
+ installed,
29
33
  showDisclaimer
30
34
  } = props;
31
35
 
@@ -34,15 +38,20 @@ export const ExtensionCard = <U,>(props: ExtensionCardProps<U>) => {
34
38
  }
35
39
 
36
40
  const id = pxt.Util.guidGen();
41
+ const cardLabel = installed ? lf("Installed") : label;
42
+ const cardLabelClass = installed ? classList("installed", labelClass) : labelClass;
43
+ const descriptionId = id + "-description";
44
+ const statusId = cardLabel ? id + "-status" : undefined;
37
45
 
38
46
  return <>
39
47
  <Card
40
- className={classList("common-extension-card", loading && "loading")}
48
+ className={classList("common-extension-card", loading && "loading", installed && "installed")}
41
49
  onClick={onCardClick}
42
50
  ariaLabelledBy={id + "-title"}
43
- ariaDescribedBy={id + "-description"}
51
+ ariaDescribedBy={classList(descriptionId, statusId)}
44
52
  tabIndex={onClick && 0}
45
- label={label}>
53
+ label={cardLabel}
54
+ labelClass={cardLabelClass}>
46
55
  <div className="common-extension-card-contents">
47
56
  {!loading && <>
48
57
  {imageUrl && <LazyImage src={imageUrl} alt={title} />}
@@ -50,10 +59,11 @@ export const ExtensionCard = <U,>(props: ExtensionCardProps<U>) => {
50
59
  {title}
51
60
  </div>
52
61
  <div className="common-extension-card-description">
53
- <div id={id + "-description"}>
62
+ <div id={descriptionId}>
54
63
  {description}
55
64
  </div>
56
65
  </div>
66
+ {cardLabel && <div id={statusId} className="sr-only">{cardLabel}</div>}
57
67
  {(showDisclaimer || learnMoreUrl) &&
58
68
  <div className="common-extension-card-extra-content">
59
69
  {showDisclaimer && lf("User-provided extension, not endorsed by Microsoft.")}
@@ -58,6 +58,12 @@
58
58
  border-bottom-right-radius: 0.5rem;
59
59
  }
60
60
 
61
+ .common-card-label.installed {
62
+ color: var(--pxt-colors-green-foreground);
63
+ background-color: var(--pxt-colors-green-background);
64
+ border-color: var(--pxt-colors-green-hover);
65
+ }
66
+
61
67
  a.link-button {
62
68
  float: right;
63
69
  position: relative;
@@ -94,6 +100,14 @@
94
100
  }
95
101
  }
96
102
 
103
+ .common-extension-card.installed {
104
+ overflow: visible;
105
+
106
+ .common-card-body {
107
+ overflow: hidden;
108
+ }
109
+ }
110
+
97
111
  /****************************************************
98
112
  * High Contrast *
99
113
  ****************************************************/
@@ -102,5 +116,11 @@
102
116
  .common-extension-card {
103
117
  border-color: @highContrastTextColor;
104
118
  background-color: @highContrastBackgroundColor;
119
+
120
+ .common-card-label.installed {
121
+ color: @highContrastBackgroundColor;
122
+ background-color: @highContrastTextColor;
123
+ border-color: @highContrastTextColor;
124
+ }
105
125
  }
106
126
  }
package/theme/home.less CHANGED
@@ -663,7 +663,7 @@
663
663
  }
664
664
  }
665
665
 
666
- .projectsdialog, .project-row-name {
666
+ .projectsdialog, .project-row-name, .scriptmanager {
667
667
  .tutorial-progress.not-finished {
668
668
  background-color: var(--pxt-primary-background) !important;
669
669
  color: var(--pxt-primary-foreground) !important;
@@ -9,7 +9,7 @@
9
9
  <link rel="stylesheet" data-rtl="/blb/rtlsemantic.css" href="/blb/semantic.css">
10
10
  <link rel="stylesheet" href="/blb/icons.css">
11
11
  <link rel="stylesheet" href="/blb/react-common-multiplayer.css">
12
- <script defer="defer" src="/blb/multiplayer/js/main.6c837cec.js"></script><link href="/blb/multiplayer/css/main.40f89d37.css" rel="stylesheet"></head>
12
+ <script defer="defer" src="/blb/multiplayer/js/main.58655f23.js"></script><link href="/blb/multiplayer/css/main.40f89d37.css" rel="stylesheet"></head>
13
13
  <body class="pxt-theme-root">
14
14
  <noscript>You need to enable JavaScript to run this app.</noscript>
15
15
 
@@ -7,7 +7,7 @@
7
7
  <link rel="stylesheet" data-rtl="/blb/rtlsemantic.css" href="/blb/semantic.css">
8
8
  <link rel="stylesheet" href="/blb/icons.css">
9
9
  <link rel="stylesheet" href="/blb/react-common-skillmap.css">
10
- <script defer="defer" src="/blb/skillmap/js/main.80271a2e.js"></script><link href="/blb/skillmap/css/main.450cb46e.css" rel="stylesheet"></head>
10
+ <script defer="defer" src="/blb/skillmap/js/main.e779c5ca.js"></script><link href="/blb/skillmap/css/main.450cb46e.css" rel="stylesheet"></head>
11
11
  <body class="pxt-theme-root">
12
12
  <noscript>You need to enable JavaScript to run this app.</noscript>
13
13
 
@@ -18,7 +18,7 @@
18
18
  <!-- <link rel="manifest" href="/teachertool-data/manifest.json" /> -->
19
19
  <title>MakeCode Code Evaluation</title>
20
20
  <script>var pxtConfig=null</script>
21
- <script defer="defer" src="/blb/teachertool/js/main.ed470286.js"></script><link href="/blb/teachertool/css/main.8ef9c91e.css" rel="stylesheet"></head>
21
+ <script defer="defer" src="/blb/teachertool/js/main.3e785c99.js"></script><link href="/blb/teachertool/css/main.8ef9c91e.css" rel="stylesheet"></head>
22
22
  <body class="pxt-theme-root">
23
23
  <noscript>You need to enable JavaScript to run this app.</noscript>
24
24