sloncek-blockly 1.0.17 → 1.0.19

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/dist/index.css CHANGED
@@ -1,4 +1,8 @@
1
1
  @import "tailwindcss";
2
+ /* The bundled code editor ships its own stylesheet. Pulling it in here puts it into
3
+ output.css, the file consumers import - without it the highlighted <pre> loses
4
+ `white-space: inherit`, renders the solution as one long line and stretches the page. */
5
+ @import "@uiw/react-textarea-code-editor/dist.css";
2
6
 
3
7
  :root {
4
8
  --background: #ffffff;
@@ -86,6 +90,9 @@
86
90
  }
87
91
 
88
92
 
93
+ .blocklyEditing > text {
94
+ display: none;
95
+ }
89
96
 
90
97
  /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
91
98
  @layer properties;
@@ -124,8 +131,6 @@
124
131
  --text-xl--line-height: calc(1.75 / 1.25);
125
132
  --text-2xl: 1.5rem;
126
133
  --text-2xl--line-height: calc(2 / 1.5);
127
- --text-3xl: 1.875rem;
128
- --text-3xl--line-height: calc(2.25 / 1.875);
129
134
  --text-5xl: 3rem;
130
135
  --text-5xl--line-height: 1;
131
136
  --font-weight-semibold: 600;
@@ -133,7 +138,6 @@
133
138
  --radius-sm: 0.25rem;
134
139
  --radius-md: 0.375rem;
135
140
  --radius-lg: 0.5rem;
136
- --radius-xl: 0.75rem;
137
141
  --radius-3xl: 1.5rem;
138
142
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
139
143
  --default-transition-duration: 150ms;
@@ -329,15 +333,9 @@
329
333
  .top-1 {
330
334
  top: var(--spacing);
331
335
  }
332
- .top-2 {
333
- top: calc(var(--spacing) * 2);
334
- }
335
336
  .top-full {
336
337
  top: 100%;
337
338
  }
338
- .right-0 {
339
- right: 0px;
340
- }
341
339
  .right-2 {
342
340
  right: calc(var(--spacing) * 2);
343
341
  }
@@ -410,9 +408,6 @@
410
408
  .mr-2 {
411
409
  margin-right: calc(var(--spacing) * 2);
412
410
  }
413
- .mr-56 {
414
- margin-right: calc(var(--spacing) * 56);
415
- }
416
411
  .mb-0 {
417
412
  margin-bottom: 0px;
418
413
  }
@@ -428,9 +423,6 @@
428
423
  .ml-6 {
429
424
  margin-left: calc(var(--spacing) * 6);
430
425
  }
431
- .ml-auto {
432
- margin-left: auto;
433
- }
434
426
  .block {
435
427
  display: block;
436
428
  }
@@ -545,9 +537,6 @@
545
537
  .w-8 {
546
538
  width: calc(var(--spacing) * 8);
547
539
  }
548
- .w-9 {
549
- width: calc(var(--spacing) * 9);
550
- }
551
540
  .w-10 {
552
541
  width: calc(var(--spacing) * 10);
553
542
  }
@@ -563,9 +552,6 @@
563
552
  .w-40 {
564
553
  width: calc(var(--spacing) * 40);
565
554
  }
566
- .w-56 {
567
- width: calc(var(--spacing) * 56);
568
- }
569
555
  .w-full {
570
556
  width: 100%;
571
557
  }
@@ -636,6 +622,9 @@
636
622
  .items-center {
637
623
  align-items: center;
638
624
  }
625
+ .items-end {
626
+ align-items: flex-end;
627
+ }
639
628
  .justify-between {
640
629
  justify-content: space-between;
641
630
  }
@@ -670,9 +659,6 @@
670
659
  margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
671
660
  margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
672
661
  }
673
- .gap-x-1 {
674
- column-gap: var(--spacing);
675
- }
676
662
  .gap-x-2 {
677
663
  column-gap: calc(var(--spacing) * 2);
678
664
  }
@@ -731,17 +717,6 @@
731
717
  .rounded-sm {
732
718
  border-radius: var(--radius-sm);
733
719
  }
734
- .rounded-xl {
735
- border-radius: var(--radius-xl);
736
- }
737
- .rounded-l-xl {
738
- border-top-left-radius: var(--radius-xl);
739
- border-bottom-left-radius: var(--radius-xl);
740
- }
741
- .rounded-r-lg {
742
- border-top-right-radius: var(--radius-lg);
743
- border-bottom-right-radius: var(--radius-lg);
744
- }
745
720
  .border {
746
721
  border-style: var(--tw-border-style);
747
722
  border-width: 1px;
@@ -902,10 +877,6 @@
902
877
  font-size: var(--text-2xl);
903
878
  line-height: var(--tw-leading, var(--text-2xl--line-height));
904
879
  }
905
- .text-3xl {
906
- font-size: var(--text-3xl);
907
- line-height: var(--tw-leading, var(--text-3xl--line-height));
908
- }
909
880
  .text-5xl {
910
881
  font-size: var(--text-5xl);
911
882
  line-height: var(--tw-leading, var(--text-5xl--line-height));
@@ -988,6 +959,11 @@
988
959
  .filter {
989
960
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
990
961
  }
962
+ .transition {
963
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
964
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
965
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
966
+ }
991
967
  .transition-all {
992
968
  transition-property: all;
993
969
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -1056,6 +1032,9 @@
1056
1032
  .hover\:cursor-pointer:hover {
1057
1033
  cursor: pointer;
1058
1034
  }
1035
+ .hover\:border-red-500:hover {
1036
+ border-color: var(--color-red-500);
1037
+ }
1059
1038
  .hover\:bg-accent-dark:hover {
1060
1039
  background-color: var(--color-accent-dark);
1061
1040
  }
@@ -1083,6 +1062,116 @@
1083
1062
  outline-color: var(--color-accent-dark);
1084
1063
  }
1085
1064
  }
1065
+ @media (prefers-color-scheme: dark) {
1066
+ .w-tc-editor {
1067
+ --color-fg-default: #c9d1d9;
1068
+ --color-canvas-subtle: #161b22;
1069
+ --color-prettylights-syntax-comment: #8b949e;
1070
+ --color-prettylights-syntax-entity-tag: #7ee787;
1071
+ --color-prettylights-syntax-entity: #d2a8ff;
1072
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
1073
+ --color-prettylights-syntax-constant: #79c0ff;
1074
+ --color-prettylights-syntax-string: #a5d6ff;
1075
+ --color-prettylights-syntax-keyword: #ff7b72;
1076
+ --color-prettylights-syntax-markup-bold: #c9d1d9;
1077
+ }
1078
+ }
1079
+ @media (prefers-color-scheme: light) {
1080
+ .w-tc-editor {
1081
+ --color-fg-default: #24292f;
1082
+ --color-canvas-subtle: #f6f8fa;
1083
+ --color-prettylights-syntax-comment: #6e7781;
1084
+ --color-prettylights-syntax-entity-tag: #116329;
1085
+ --color-prettylights-syntax-entity: #8250df;
1086
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
1087
+ --color-prettylights-syntax-constant: #0550ae;
1088
+ --color-prettylights-syntax-string: #0a3069;
1089
+ --color-prettylights-syntax-keyword: #cf222e;
1090
+ --color-prettylights-syntax-markup-bold: #24292f;
1091
+ }
1092
+ }
1093
+ .w-tc-editor[data-color-mode*='dark'], [data-color-mode*='dark'] .w-tc-editor, [data-color-mode*='dark'] .w-tc-editor-var, body[data-color-mode*='dark'] {
1094
+ --color-fg-default: #c9d1d9;
1095
+ --color-canvas-subtle: #161b22;
1096
+ --color-prettylights-syntax-comment: #8b949e;
1097
+ --color-prettylights-syntax-entity-tag: #7ee787;
1098
+ --color-prettylights-syntax-entity: #d2a8ff;
1099
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
1100
+ --color-prettylights-syntax-constant: #79c0ff;
1101
+ --color-prettylights-syntax-string: #a5d6ff;
1102
+ --color-prettylights-syntax-keyword: #ff7b72;
1103
+ --color-prettylights-syntax-markup-bold: #c9d1d9;
1104
+ }
1105
+ .w-tc-editor[data-color-mode*='light'], [data-color-mode*='light'] .w-tc-editor, [data-color-mode*='light'] .w-tc-editor-var, body[data-color-mode*='light'] {
1106
+ --color-fg-default: #24292f;
1107
+ --color-canvas-subtle: #f6f8fa;
1108
+ --color-prettylights-syntax-comment: #6e7781;
1109
+ --color-prettylights-syntax-entity-tag: #116329;
1110
+ --color-prettylights-syntax-entity: #8250df;
1111
+ --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f;
1112
+ --color-prettylights-syntax-constant: #0550ae;
1113
+ --color-prettylights-syntax-string: #0a3069;
1114
+ --color-prettylights-syntax-keyword: #cf222e;
1115
+ --color-prettylights-syntax-markup-bold: #24292f;
1116
+ }
1117
+ .w-tc-editor {
1118
+ font-family: inherit;
1119
+ font-size: 12px;
1120
+ background-color: var(--color-canvas-subtle);
1121
+ color: var(--color-fg-default);
1122
+ }
1123
+ .w-tc-editor-text, .w-tc-editor-preview {
1124
+ min-height: 16px;
1125
+ }
1126
+ .w-tc-editor-preview pre {
1127
+ margin: 0;
1128
+ padding: 0;
1129
+ white-space: inherit;
1130
+ font-family: inherit;
1131
+ font-size: inherit;
1132
+ }
1133
+ .w-tc-editor-preview pre code {
1134
+ font-family: inherit;
1135
+ }
1136
+ .w-tc-editor code[class*='language-'] .token.cdata, .w-tc-editor pre[class*='language-'] .token.cdata, .w-tc-editor code[class*='language-'] .token.comment, .w-tc-editor pre[class*='language-'] .token.comment, .w-tc-editor code[class*='language-'] .token.doctype, .w-tc-editor pre[class*='language-'] .token.doctype, .w-tc-editor code[class*='language-'] .token.prolog, .w-tc-editor pre[class*='language-'] .token.prolog {
1137
+ color: var(--color-prettylights-syntax-comment);
1138
+ }
1139
+ .w-tc-editor code[class*='language-'] .token.punctuation, .w-tc-editor pre[class*='language-'] .token.punctuation {
1140
+ color: var(--color-prettylights-syntax-sublimelinter-gutter-mark);
1141
+ }
1142
+ .w-tc-editor code[class*='language-'] .namespace, .w-tc-editor pre[class*='language-'] .namespace {
1143
+ opacity: 0.7;
1144
+ }
1145
+ .w-tc-editor code[class*='language-'] .token.boolean, .w-tc-editor pre[class*='language-'] .token.boolean, .w-tc-editor code[class*='language-'] .token.constant, .w-tc-editor pre[class*='language-'] .token.constant, .w-tc-editor code[class*='language-'] .token.deleted, .w-tc-editor pre[class*='language-'] .token.deleted, .w-tc-editor code[class*='language-'] .token.number, .w-tc-editor pre[class*='language-'] .token.number, .w-tc-editor code[class*='language-'] .token.symbol, .w-tc-editor pre[class*='language-'] .token.symbol {
1146
+ color: var(--color-prettylights-syntax-entity-tag);
1147
+ }
1148
+ .w-tc-editor code[class*='language-'] .token.builtin, .w-tc-editor pre[class*='language-'] .token.builtin, .w-tc-editor code[class*='language-'] .token.char, .w-tc-editor pre[class*='language-'] .token.char, .w-tc-editor code[class*='language-'] .token.inserted, .w-tc-editor pre[class*='language-'] .token.inserted, .w-tc-editor code[class*='language-'] .token.selector, .w-tc-editor pre[class*='language-'] .token.selector, .w-tc-editor code[class*='language-'] .token.string, .w-tc-editor pre[class*='language-'] .token.string {
1149
+ color: var(--color-prettylights-syntax-constant);
1150
+ }
1151
+ .w-tc-editor code[class*='language-'] .style .token.string, .w-tc-editor pre[class*='language-'] .style .token.string, .w-tc-editor code[class*='language-'] .token.entity, .w-tc-editor pre[class*='language-'] .token.entity, .w-tc-editor code[class*='language-'] .token.property, .w-tc-editor pre[class*='language-'] .token.property, .w-tc-editor code[class*='language-'] .token.operator, .w-tc-editor pre[class*='language-'] .token.operator, .w-tc-editor code[class*='language-'] .token.url, .w-tc-editor pre[class*='language-'] .token.url {
1152
+ color: var(--color-prettylights-syntax-constant);
1153
+ }
1154
+ .w-tc-editor code[class*='language-'] .token.atrule, .w-tc-editor pre[class*='language-'] .token.atrule, .w-tc-editor code[class*='language-'] .token.property-access .token.method, .w-tc-editor pre[class*='language-'] .token.property-access .token.method, .w-tc-editor code[class*='language-'] .token.keyword, .w-tc-editor pre[class*='language-'] .token.keyword {
1155
+ color: var(--color-prettylights-syntax-keyword);
1156
+ }
1157
+ .w-tc-editor code[class*='language-'] .token.function, .w-tc-editor pre[class*='language-'] .token.function {
1158
+ color: var(--color-prettylights-syntax-string);
1159
+ }
1160
+ .w-tc-editor code[class*='language-'] .token.important, .w-tc-editor pre[class*='language-'] .token.important, .w-tc-editor code[class*='language-'] .token.regex, .w-tc-editor pre[class*='language-'] .token.regex, .w-tc-editor code[class*='language-'] .token.variable, .w-tc-editor pre[class*='language-'] .token.variable {
1161
+ color: var(--color-prettylights-syntax-string-regexp);
1162
+ }
1163
+ .w-tc-editor code[class*='language-'] .token.bold, .w-tc-editor pre[class*='language-'] .token.bold, .w-tc-editor code[class*='language-'] .token.important, .w-tc-editor pre[class*='language-'] .token.important {
1164
+ color: var(--color-prettylights-syntax-markup-bold);
1165
+ }
1166
+ .w-tc-editor code[class*='language-'] .token.tag, .w-tc-editor pre[class*='language-'] .token.tag {
1167
+ color: var(--color-prettylights-syntax-entity-tag);
1168
+ }
1169
+ .w-tc-editor code[class*='language-'] .token.attr-value, .w-tc-editor pre[class*='language-'] .token.attr-value, .w-tc-editor code[class*='language-'] .token.attr-name, .w-tc-editor pre[class*='language-'] .token.attr-name {
1170
+ color: var(--color-prettylights-syntax-constant);
1171
+ }
1172
+ .w-tc-editor code[class*='language-'] .token.selector .class, .w-tc-editor pre[class*='language-'] .token.selector .class, .w-tc-editor code[class*='language-'] .token.class-name, .w-tc-editor pre[class*='language-'] .token.class-name {
1173
+ color: var(--color-prettylights-syntax-entity);
1174
+ }
1086
1175
  :root {
1087
1176
  --background: #ffffff;
1088
1177
  --foreground: #171717;
@@ -1125,6 +1214,9 @@
1125
1214
  .blocklyFlyoutScrollbar[display="none"] {
1126
1215
  display: none;
1127
1216
  }
1217
+ .blocklyEditing > text {
1218
+ display: none;
1219
+ }
1128
1220
  @property --tw-translate-x {
1129
1221
  syntax: "*";
1130
1222
  inherits: false;
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ interface GeneratorProps {
25
25
  modeProp?: "board" | "console" | "drawing";
26
26
  problem?: string;
27
27
  answer?: string;
28
+ initial?: string;
28
29
  canRun?: boolean;
29
30
  supportInstructions?: boolean;
30
31
  fastForward?: boolean;
@@ -37,8 +38,12 @@ type GeneratorHandle = {
37
38
  getData: () => {
38
39
  problem: JSON | null;
39
40
  answer: JSON | null;
41
+ initial: JSON;
40
42
  };
43
+ runFastForward: () => Promise<void>;
41
44
  };
42
45
  declare const Generator: React.ForwardRefExoticComponent<GeneratorProps & React.RefAttributes<GeneratorHandle>>;
46
+ declare function validate(problem: JSON, answer: JSON, initial?: JSON | null): Promise<number>;
43
47
 
44
- export { Generator as default };
48
+ export { Generator as default, validate };
49
+ export type { GeneratorHandle };