pxt-core 8.5.13 → 8.5.14

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.
@@ -531,6 +531,7 @@ declare namespace pxt {
531
531
  hash?: string;
532
532
  usedBlocks: Map<number>;
533
533
  snippetBlocks: Map<Map<number>>;
534
+ highlightBlocks: Map<Map<number>>;
534
535
  }
535
536
 
536
537
  interface PackageApiInfo {
@@ -635,6 +636,10 @@ declare namespace pxt.editor {
635
636
  NoPython = "no-python",
636
637
  NoJavaScript = "no-javascript"
637
638
  }
639
+
640
+ // Placeholder for IProjectView defined in pxteditor.d.ts
641
+ interface IProjectView {
642
+ }
638
643
  }
639
644
 
640
645
  declare namespace ts.pxtc {
@@ -1102,6 +1107,7 @@ declare namespace pxt.tutorial {
1102
1107
  customTs?: string; // custom typescript code loaded in a separate file for the tutorial
1103
1108
  tutorialValidationRules?: pxt.Map<boolean>; //a map of rules used in a tutorial and if the rules are activated
1104
1109
  globalBlockConfig?: TutorialBlockConfig; // concatenated `blockconfig.global` sections. Contains block configs applicable to all tutorial steps
1110
+ globalValidationConfig?: CodeValidationConfig; // concatenated 'validation.global' sections. Contains validation config applicable to all steps
1105
1111
  }
1106
1112
 
1107
1113
  interface TutorialMetadata {
@@ -1137,6 +1143,31 @@ declare namespace pxt.tutorial {
1137
1143
  blocks?: TutorialBlockConfigEntry[]; // markdown fragment can contain multiple block definitions
1138
1144
  }
1139
1145
 
1146
+ interface CodeValidationResult {
1147
+ isValid: Boolean;
1148
+ hint: any;
1149
+ }
1150
+
1151
+ interface CodeValidationExecuteOptions {
1152
+ parent: pxt.editor.IProjectView;
1153
+ tutorialOptions: TutorialOptions;
1154
+ }
1155
+
1156
+ interface CodeValidator {
1157
+ enabled: boolean;
1158
+ execute(options: CodeValidationExecuteOptions): Promise<CodeValidationResult>;
1159
+ }
1160
+
1161
+ interface CodeValidatorMetadata {
1162
+ validatorType: string;
1163
+ properties: pxt.Map<string>;
1164
+ }
1165
+
1166
+ interface CodeValidationConfig {
1167
+ validatorsMetadata: CodeValidatorMetadata[];
1168
+ validators: pxt.Map<CodeValidator>; // A cache of the parsed validatorsMetadata. Key = validator type, Value = validator.
1169
+ }
1170
+
1140
1171
  interface TutorialStepInfo {
1141
1172
  // Step metadata
1142
1173
  showHint?: boolean; // automatically displays hint
@@ -1161,6 +1192,9 @@ declare namespace pxt.tutorial {
1161
1192
 
1162
1193
  // concatenated `blockconfig.local` sections. Contains block configs applicable to the current step only
1163
1194
  localBlockConfig?: pxt.tutorial.TutorialBlockConfig;
1195
+
1196
+ // concatenated 'validation.local' sections. Contains config applicable to this step only.
1197
+ localValidationConfig?: pxt.tutorial.CodeValidationConfig;
1164
1198
  }
1165
1199
 
1166
1200
  interface TutorialActivityInfo {
@@ -1193,6 +1227,7 @@ declare namespace pxt.tutorial {
1193
1227
  tutorialValidationRules?: pxt.Map<boolean>; //a map of rules used in a tutorial and if the rules are activated
1194
1228
  templateLoaded?: boolean; // if the template code has been loaded once, we skip
1195
1229
  globalBlockConfig?: TutorialBlockConfig; // concatenated `blockconfig.global` sections. Contains block configs applicable to all tutorial steps
1230
+ globalValidationConfig?: CodeValidationConfig // concatenated 'validation.global' sections. Contains validation config applicable to all steps
1196
1231
  }
1197
1232
  interface TutorialCompletionInfo {
1198
1233
  // id of the tutorial
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pxt-core",
3
- "version": "8.5.13",
3
+ "version": "8.5.14",
4
4
  "description": "Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors",
5
5
  "keywords": [
6
6
  "TypeScript",
@@ -555,6 +555,68 @@
555
555
  }
556
556
  }
557
557
 
558
+ /*********************************
559
+ Validation
560
+ *********************************/
561
+ .tutorial-validation-error-container {
562
+ position: fixed;
563
+ top: unset;
564
+ right: unset;
565
+ bottom: 5.5rem;
566
+ left: 23rem;
567
+ max-width: 60%;
568
+ min-width: 18.75rem;
569
+ background: @white;
570
+ box-shadow: 0 0rem 0.5rem;
571
+ border-radius: 0.5rem;
572
+ z-index: 40;
573
+ }
574
+
575
+ .tutorial-validation-error-body {
576
+ display: flex;
577
+ flex-direction: row;
578
+ padding: 2rem 2rem 2rem 0.5rem;
579
+ }
580
+
581
+ .tutorial-validation-error-hint {
582
+ padding: 1.5rem;
583
+ }
584
+
585
+ .tutorial-validation-error-inner {
586
+ display: flex;
587
+ flex-direction: column;
588
+ }
589
+
590
+ .tutorial-validation-error-emoji {
591
+ font-size: 3rem;
592
+ padding-top: 1rem;
593
+ padding-right: 0.2rem;
594
+ }
595
+
596
+ .tutorial-validation-error-controls {
597
+ display: flex;
598
+ justify-content: right;
599
+ margin: 0;
600
+ margin-top: 0.5rem;
601
+
602
+ > .common-button {
603
+ width: unset;
604
+ }
605
+ }
606
+
607
+ .tutorial-validation-error-close.common-button {
608
+ position: absolute;
609
+ right: 0.6rem;
610
+ top: 0.8rem;
611
+ padding: 0 !important;
612
+
613
+ i.right {
614
+ opacity: 1;
615
+ font-size: 1.3rem;
616
+ margin: 0 !important;
617
+ }
618
+ }
619
+
558
620
  /*******************************
559
621
  Media Adjustments
560
622
  *******************************/
@@ -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.3008f5a9.js"></script><link href="/blb/skillmap/css/main.06a18ee8.css" rel="stylesheet"></head>
10
+ <script defer="defer" src="/blb/skillmap/js/main.ae646473.js"></script><link href="/blb/skillmap/css/main.06a18ee8.css" rel="stylesheet"></head>
11
11
  <body>
12
12
  <noscript>You need to enable JavaScript to run this app.</noscript>
13
13