docusaurus-live-brython 3.0.0-beta.21 → 3.0.0-beta.23

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 (133) hide show
  1. package/.prettierignore +17 -0
  2. package/.prettierrc +9 -8
  3. package/README.md +2 -2
  4. package/lib/index.d.ts.map +1 -1
  5. package/lib/index.js +17 -14
  6. package/lib/options.d.ts.map +1 -1
  7. package/lib/options.js +2 -2
  8. package/lib/theme/CodeBlock/index.d.ts +1 -1
  9. package/lib/theme/CodeBlock/index.d.ts.map +1 -1
  10. package/lib/theme/CodeBlock/index.jsx +13 -5
  11. package/lib/theme/CodeEditor/Actions/DownloadCode.d.ts.map +1 -1
  12. package/lib/theme/CodeEditor/Actions/DownloadCode.jsx +2 -2
  13. package/lib/theme/CodeEditor/Actions/Reset.d.ts.map +1 -1
  14. package/lib/theme/CodeEditor/Actions/Reset.jsx +1 -1
  15. package/lib/theme/CodeEditor/Actions/RunCode.d.ts.map +1 -1
  16. package/lib/theme/CodeEditor/Actions/ShowRaw.d.ts.map +1 -1
  17. package/lib/theme/CodeEditor/Actions/ShowRaw.jsx +8 -2
  18. package/lib/theme/CodeEditor/Actions/ShowSyncStatus.d.ts.map +1 -1
  19. package/lib/theme/CodeEditor/Actions/ShowSyncStatus.jsx +4 -4
  20. package/lib/theme/CodeEditor/Actions/styles.module.css +2 -3
  21. package/lib/theme/CodeEditor/BrythonCommunicator.d.ts +1 -1
  22. package/lib/theme/CodeEditor/BrythonCommunicator.d.ts.map +1 -1
  23. package/lib/theme/CodeEditor/BrythonCommunicator.jsx +10 -6
  24. package/lib/theme/CodeEditor/Button/index.d.ts.map +1 -1
  25. package/lib/theme/CodeEditor/Button/styles.module.css +1 -1
  26. package/lib/theme/CodeEditor/CodeHistory/index.d.ts.map +1 -1
  27. package/lib/theme/CodeEditor/CodeHistory/index.jsx +20 -9
  28. package/lib/theme/CodeEditor/CodeHistory/styles.module.css +31 -31
  29. package/lib/theme/CodeEditor/ContextEditor/index.d.ts.map +1 -1
  30. package/lib/theme/CodeEditor/ContextEditor/index.jsx +1 -1
  31. package/lib/theme/CodeEditor/Editor/EditorAce.jsx +4 -4
  32. package/lib/theme/CodeEditor/Editor/Header/index.d.ts.map +1 -1
  33. package/lib/theme/CodeEditor/Editor/Header/index.jsx +3 -3
  34. package/lib/theme/CodeEditor/Editor/Header/styles.module.css +7 -7
  35. package/lib/theme/CodeEditor/Editor/HiddenCode/index.d.ts.map +1 -1
  36. package/lib/theme/CodeEditor/Editor/HiddenCode/index.jsx +5 -2
  37. package/lib/theme/CodeEditor/Editor/HiddenCode/styles.module.css +4 -8
  38. package/lib/theme/CodeEditor/Editor/Result/Graphics/Canvas.d.ts.map +1 -1
  39. package/lib/theme/CodeEditor/Editor/Result/Graphics/Canvas.jsx +2 -2
  40. package/lib/theme/CodeEditor/Editor/Result/Graphics/Turtle.d.ts.map +1 -1
  41. package/lib/theme/CodeEditor/Editor/Result/Graphics/Turtle.jsx +3 -3
  42. package/lib/theme/CodeEditor/Editor/Result/Graphics/index.d.ts.map +1 -1
  43. package/lib/theme/CodeEditor/Editor/Result/Graphics/index.jsx +1 -1
  44. package/lib/theme/CodeEditor/Editor/Result/Graphics/styles.module.css +2 -2
  45. package/lib/theme/CodeEditor/Editor/Result/index.d.ts.map +1 -1
  46. package/lib/theme/CodeEditor/Editor/Result/index.jsx +1 -3
  47. package/lib/theme/CodeEditor/Editor/Result/styles.module.css +10 -10
  48. package/lib/theme/CodeEditor/Editor/index.d.ts +1 -1
  49. package/lib/theme/CodeEditor/Editor/index.d.ts.map +1 -1
  50. package/lib/theme/CodeEditor/Editor/index.jsx +25 -26
  51. package/lib/theme/CodeEditor/Editor/styles.module.css +11 -11
  52. package/lib/theme/CodeEditor/Editor/utils/checkForButtonClick.d.ts.map +1 -1
  53. package/lib/theme/CodeEditor/Editor/utils/saveSvg.d.ts.map +1 -1
  54. package/lib/theme/CodeEditor/Editor/utils/saveSvg.js +19 -8
  55. package/lib/theme/CodeEditor/Editor/utils/svgWithoutAnimations.d.ts.map +1 -1
  56. package/lib/theme/CodeEditor/Editor/utils/svgWithoutAnimations.js +43 -49
  57. package/lib/theme/CodeEditor/Icon/icons.d.ts.map +1 -1
  58. package/lib/theme/CodeEditor/Icon/index.d.ts.map +1 -1
  59. package/lib/theme/CodeEditor/Icon/index.jsx +9 -2
  60. package/lib/theme/CodeEditor/Icon/styles.module.css +1 -1
  61. package/lib/theme/CodeEditor/WithScript/ScriptContext.d.ts +2 -2
  62. package/lib/theme/CodeEditor/WithScript/ScriptContext.d.ts.map +1 -1
  63. package/lib/theme/CodeEditor/WithScript/ScriptContext.jsx +5 -7
  64. package/lib/theme/CodeEditor/WithScript/Storage.d.ts +1 -1
  65. package/lib/theme/CodeEditor/WithScript/Storage.d.ts.map +1 -1
  66. package/lib/theme/CodeEditor/WithScript/Types.d.ts +1 -1
  67. package/lib/theme/CodeEditor/WithScript/Types.d.ts.map +1 -1
  68. package/lib/theme/CodeEditor/WithScript/bryRunner.d.ts +1 -1
  69. package/lib/theme/CodeEditor/WithScript/bryRunner.d.ts.map +1 -1
  70. package/lib/theme/CodeEditor/WithScript/bryRunner.js +6 -3
  71. package/lib/theme/CodeEditor/WithScript/createStore.d.ts +1 -1
  72. package/lib/theme/CodeEditor/WithScript/createStore.d.ts.map +1 -1
  73. package/lib/theme/CodeEditor/WithScript/createStore.js +36 -11
  74. package/lib/theme/CodeEditor/WithScript/helpers.d.ts.map +1 -1
  75. package/lib/theme/CodeEditor/WithScript/helpers.js +4 -1
  76. package/lib/theme/CodeEditor/constants.d.ts.map +1 -1
  77. package/lib/theme/CodeEditor/hooks/index.d.ts.map +1 -1
  78. package/lib/theme/CodeEditor/hooks/useScript.d.ts +1 -1
  79. package/lib/theme/CodeEditor/hooks/useScript.d.ts.map +1 -1
  80. package/lib/theme/CodeEditor/hooks/useScript.js +1 -1
  81. package/lib/theme/CodeEditor/hooks/useStore.d.ts +1 -1
  82. package/lib/theme/CodeEditor/hooks/useStore.d.ts.map +1 -1
  83. package/lib/theme/CodeEditor/hooks/useStore.js +3 -3
  84. package/lib/theme/CodeEditor/index.d.ts.map +1 -1
  85. package/lib/theme/CodeEditor/index.jsx +6 -6
  86. package/lib/theme/CodeEditor/styles.module.css +28 -30
  87. package/package.json +5 -3
  88. package/src/index.ts +40 -38
  89. package/src/options.ts +12 -12
  90. package/src/theme/CodeBlock/index.tsx +32 -28
  91. package/src/theme/CodeEditor/Actions/DownloadCode.tsx +17 -16
  92. package/src/theme/CodeEditor/Actions/Reset.tsx +10 -8
  93. package/src/theme/CodeEditor/Actions/RunCode.tsx +9 -6
  94. package/src/theme/CodeEditor/Actions/ShowRaw.tsx +12 -6
  95. package/src/theme/CodeEditor/Actions/ShowSyncStatus.tsx +8 -16
  96. package/src/theme/CodeEditor/Actions/styles.module.css +2 -3
  97. package/src/theme/CodeEditor/BrythonCommunicator.tsx +12 -15
  98. package/src/theme/CodeEditor/Button/index.tsx +14 -10
  99. package/src/theme/CodeEditor/Button/styles.module.css +1 -1
  100. package/src/theme/CodeEditor/CodeHistory/index.tsx +25 -13
  101. package/src/theme/CodeEditor/CodeHistory/styles.module.css +31 -31
  102. package/src/theme/CodeEditor/ContextEditor/index.tsx +6 -8
  103. package/src/theme/CodeEditor/Editor/EditorAce.tsx +6 -6
  104. package/src/theme/CodeEditor/Editor/Header/index.tsx +3 -9
  105. package/src/theme/CodeEditor/Editor/Header/styles.module.css +7 -7
  106. package/src/theme/CodeEditor/Editor/HiddenCode/index.tsx +14 -4
  107. package/src/theme/CodeEditor/Editor/HiddenCode/styles.module.css +4 -8
  108. package/src/theme/CodeEditor/Editor/Result/Graphics/Canvas.tsx +19 -15
  109. package/src/theme/CodeEditor/Editor/Result/Graphics/Turtle.tsx +15 -11
  110. package/src/theme/CodeEditor/Editor/Result/Graphics/index.tsx +4 -11
  111. package/src/theme/CodeEditor/Editor/Result/Graphics/styles.module.css +2 -2
  112. package/src/theme/CodeEditor/Editor/Result/index.tsx +2 -4
  113. package/src/theme/CodeEditor/Editor/Result/styles.module.css +10 -10
  114. package/src/theme/CodeEditor/Editor/index.tsx +61 -69
  115. package/src/theme/CodeEditor/Editor/styles.module.css +11 -11
  116. package/src/theme/CodeEditor/Editor/utils/checkForButtonClick.ts +5 -5
  117. package/src/theme/CodeEditor/Editor/utils/saveSvg.ts +63 -53
  118. package/src/theme/CodeEditor/Editor/utils/svgWithoutAnimations.ts +182 -201
  119. package/src/theme/CodeEditor/Icon/icons.ts +23 -13
  120. package/src/theme/CodeEditor/Icon/index.tsx +28 -9
  121. package/src/theme/CodeEditor/Icon/styles.module.css +1 -1
  122. package/src/theme/CodeEditor/WithScript/ScriptContext.tsx +13 -14
  123. package/src/theme/CodeEditor/WithScript/Storage.ts +3 -3
  124. package/src/theme/CodeEditor/WithScript/Types.ts +7 -8
  125. package/src/theme/CodeEditor/WithScript/bryRunner.ts +13 -13
  126. package/src/theme/CodeEditor/WithScript/createStore.ts +102 -69
  127. package/src/theme/CodeEditor/WithScript/helpers.ts +16 -12
  128. package/src/theme/CodeEditor/constants.ts +9 -11
  129. package/src/theme/CodeEditor/hooks/index.ts +2 -2
  130. package/src/theme/CodeEditor/hooks/useScript.ts +3 -3
  131. package/src/theme/CodeEditor/hooks/useStore.ts +9 -9
  132. package/src/theme/CodeEditor/index.tsx +16 -21
  133. package/src/theme/CodeEditor/styles.module.css +28 -30
@@ -0,0 +1,17 @@
1
+ dist
2
+ node_modules
3
+ .yarn
4
+ build
5
+ coverage
6
+ .docusaurus
7
+ .github
8
+ .drone.yml
9
+
10
+ docs
11
+ static
12
+
13
+ *.md
14
+ *.json
15
+ *.js
16
+ *.compose.yml
17
+ i18n
package/.prettierrc CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
- "arrowParens": "always",
3
- "bracketSpacing": false,
4
- "bracketSameLine": true,
5
- "printWidth": 80,
6
- "proseWrap": "never",
7
- "singleQuote": true,
8
- "trailingComma": "all"
9
- }
2
+ "arrowParens": "always",
3
+ "bracketSpacing": true,
4
+ "bracketSameLine": false,
5
+ "printWidth": 110,
6
+ "proseWrap": "never",
7
+ "singleQuote": true,
8
+ "trailingComma": "none",
9
+ "tabWidth": 4
10
+ }
package/README.md CHANGED
@@ -41,8 +41,8 @@ module.exports = {
41
41
  + themes: [
42
42
  + ['docusaurus-live-brython'],
43
43
  + {
44
- + brython_src: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython.min.js', // default
45
- + brython_stdlib_src: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython_stdlib.js' // default
44
+ + brythonSrc: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython.min.js', // default
45
+ + brythonStdlibSrc: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython_stdlib.js' // default
46
46
  + }
47
47
  presets: ['@docusaurus/preset-classic']
48
48
  ...
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMvE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAmB,MAAM,WAAW,CAAC;AAG7E,eAAO,MAAM,IAAI,2BAAqC,CAAC;AACvD,eAAO,MAAM,eAAe,YAAsB,CAAC;AAiBnD,QAAA,MAAM,KAAK,EAAE,MAAM,CAAC;IAAE,cAAc,EAAE,QAAQ,EAAE,CAAA;CAAE,CA+HjD,CAAA;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAC,mBAAmB,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAE,OAAO,EAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMvE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAmB,MAAM,WAAW,CAAC;AAG7E,eAAO,MAAM,IAAI,2BAAqC,CAAC;AACvD,eAAO,MAAM,eAAe,YAAsB,CAAC;AAiBnD,QAAA,MAAM,KAAK,EAAE,MAAM,CAAC;IAAE,cAAc,EAAE,QAAQ,EAAE,CAAA;CAAE,CAkIjD,CAAC;AAEF,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC"}
package/lib/index.js CHANGED
@@ -36,7 +36,7 @@ const extractImports = (script) => {
36
36
  return imports;
37
37
  };
38
38
  const theme = (context, options) => {
39
- const { i18n: { currentLocale }, } = context;
39
+ const { i18n: { currentLocale } } = context;
40
40
  const libDir = options.libDir || DEFAULT_LIB_DIR;
41
41
  const isRemote = /https?:\/\//.test(libDir);
42
42
  const isHashRouter = context.siteConfig.future?.experimental_router === 'hash';
@@ -72,12 +72,15 @@ const theme = (context, options) => {
72
72
  for (const libName of libNames) {
73
73
  const libContent = libraries[libName];
74
74
  const imports = extractImports(libContent);
75
- const injectAt = Math.max(...bryModules.map((lib, idx) => imports.includes(lib.name) ? idx : -1), -1);
75
+ const injectAt = Math.max(...bryModules.map((lib, idx) => (imports.includes(lib.name) ? idx : -1)), -1);
76
76
  if (injectAt < 0) {
77
77
  bryModules.splice(0, 0, { name: libName, content: libContent });
78
78
  }
79
79
  else if (injectAt + 1 < bryModules.length) {
80
- bryModules.splice(injectAt + 1, 0, { name: libName, content: libContent });
80
+ bryModules.splice(injectAt + 1, 0, {
81
+ name: libName,
82
+ content: libContent
83
+ });
81
84
  }
82
85
  else {
83
86
  bryModules.push({ name: libName, content: libContent });
@@ -92,7 +95,7 @@ const theme = (context, options) => {
92
95
  getDefaultCodeTranslationMessages() {
93
96
  return readDefaultCodeTranslationMessages({
94
97
  locale: currentLocale,
95
- name: NAME,
98
+ name: NAME
96
99
  });
97
100
  },
98
101
  async contentLoaded({ content, actions }) {
@@ -110,9 +113,9 @@ const theme = (context, options) => {
110
113
  {
111
114
  test: /\.raw\.*/,
112
115
  type: 'asset/source'
113
- },
114
- ],
115
- },
116
+ }
117
+ ]
118
+ }
116
119
  };
117
120
  },
118
121
  getThemePath() {
@@ -128,20 +131,20 @@ const theme = (context, options) => {
128
131
  tagName: 'script',
129
132
  attributes: {
130
133
  src: options.brythonSrc || DEFAULT_OPTIONS.brythonSrc,
131
- crossorigin: "anonymous",
132
- referrerpolicy: "no-referrer",
134
+ crossorigin: 'anonymous',
135
+ referrerpolicy: 'no-referrer',
133
136
  defer: 'defer'
134
- },
137
+ }
135
138
  },
136
139
  {
137
140
  tagName: 'script',
138
141
  attributes: {
139
142
  src: options.brythonStdlibSrc || DEFAULT_OPTIONS.brythonStdlibSrc,
140
- crossorigin: "anonymous",
141
- referrerpolicy: "no-referrer",
143
+ crossorigin: 'anonymous',
144
+ referrerpolicy: 'no-referrer',
142
145
  defer: 'defer'
143
- },
144
- },
146
+ }
147
+ }
145
148
  ],
146
149
  postBodyTags: content.bryModules.map((module) => {
147
150
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAC,4BAA4B,EAAC,MAAM,mBAAmB,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B,CAAA;AAGD,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,YAM7B,CAAC;AAUF,wBAAgB,mBAAmB,CAC/B,EAAC,WAAW,EAAE,QAAQ,EAAC,EAAE,4BAA4B,CAAC,OAAO,EAAE,YAAY,CAAC,GAC7E,YAAY,CAGd"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG;IACvB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE5C,eAAO,MAAM,eAAe,EAAE,YAM7B,CAAC;AAUF,wBAAgB,mBAAmB,CAAC,EAChC,WAAW,EACX,QAAQ,EACX,EAAE,4BAA4B,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,YAAY,CAGpE"}
package/lib/options.js CHANGED
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { Joi } from '@docusaurus/utils-validation';
8
8
  export const DEFAULT_OPTIONS = {
9
- brythonSrc: 'https://raw.githack.com/brython-dev/brython/master/www/src/brython.js',
10
- brythonStdlibSrc: 'https://raw.githack.com/brython-dev/brython/master/www/src/brython_stdlib.js',
9
+ brythonSrc: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython.min.js',
10
+ brythonStdlibSrc: 'https://cdn.jsdelivr.net/npm/brython@3.12.4/brython_stdlib.js',
11
11
  libDir: '/bry-libs/',
12
12
  skipCopyAssetsToLibDir: false,
13
13
  syncMaxOnceEvery: 1000
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  /// <reference types="@docusaurus/module-type-aliases" />
2
+ /// <reference types="react" />
3
3
  import { type Props as CodeBlockType } from '@theme-init/CodeBlock';
4
4
  import type { WrapperProps } from '@docusaurus/types';
5
5
  type Props = WrapperProps<typeof CodeBlockType>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/CodeBlock/index.tsx"],"names":[],"mappings":";;AACA,OAAkB,EAAC,KAAK,KAAK,IAAI,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQtD,KAAK,KAAK,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AA2BhD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA4BlE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/CodeBlock/index.tsx"],"names":[],"mappings":";;AACA,OAAkB,EAAE,KAAK,KAAK,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOtD,KAAK,KAAK,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAsChD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAsBlE"}
@@ -6,7 +6,12 @@ const sanitizedTitle = (id) => {
6
6
  if (!id) {
7
7
  return;
8
8
  }
9
- return id.replace(/--/g, '<<HYPHEN>>').replace(/__/g, '<<UNDERSCORE>>').replace(/[-_]/g, ' ').replace(/<<UNDERSCORE>>/g, '_').replace(/<<HYPHEN>>/g, '-');
9
+ return id
10
+ .replace(/--/g, '<<HYPHEN>>')
11
+ .replace(/__/g, '<<UNDERSCORE>>')
12
+ .replace(/[-_]/g, ' ')
13
+ .replace(/<<UNDERSCORE>>/g, '_')
14
+ .replace(/<<HYPHEN>>/g, '-');
10
15
  };
11
16
  const extractMetaProps = (props) => {
12
17
  const metaString = (props?.metastring || '').replace(/\s*=\s*/g, '='); // remove spaces around =
@@ -16,9 +21,12 @@ const extractMetaProps = (props) => {
16
21
  return acc;
17
22
  }
18
23
  /** casts to booleans and numbers. When no value was provided, true is used */
19
- const val = value === 'true' ? true
20
- : value === 'false' ? false
21
- : !Number.isNaN(Number(value)) ? Number(value)
24
+ const val = value === 'true'
25
+ ? true
26
+ : value === 'false'
27
+ ? false
28
+ : !Number.isNaN(Number(value))
29
+ ? Number(value)
22
30
  : value || true;
23
31
  acc[key] = val;
24
32
  return acc;
@@ -42,5 +50,5 @@ export default function CodeBlockWrapper(props) {
42
50
  {props.children}
43
51
  </ContextEditor>);
44
52
  }
45
- return (<CodeBlock {...props}/>);
53
+ return <CodeBlock {...props}/>;
46
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadCode.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/DownloadCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,YAAY,UAAW;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,sBA6B3C,CAAA;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"DownloadCode.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/DownloadCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,YAAY,UAAW;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,sBA+B7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -7,8 +7,8 @@ const DownloadCode = (props) => {
7
7
  const code = useScript(store, 'code');
8
8
  const lang = useScript(store, 'lang');
9
9
  const id = useScript(store, 'id');
10
- return (<Button icon='Download' onClick={() => {
11
- const downloadLink = document.createElement("a");
10
+ return (<Button icon="Download" onClick={() => {
11
+ const downloadLink = document.createElement('a');
12
12
  const file = new Blob([code], { type: 'text/plain;charset=utf-8' });
13
13
  downloadLink.href = URL.createObjectURL(file);
14
14
  const fExt = lang === 'python' ? '.py' : `.${lang}`;
@@ -1 +1 @@
1
- {"version":3,"file":"Reset.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/Reset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,KAAK,yBAuBV,CAAA;AAED,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Reset.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/Reset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,KAAK,yBAyBV,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -16,7 +16,7 @@ const Reset = () => {
16
16
  return (<Button onClick={onReset} title={translate({
17
17
  message: 'Discard Changes',
18
18
  description: 'Reset the code to its original state',
19
- id: 'theme.CodeEditor.Header.reset',
19
+ id: 'theme.CodeEditor.Header.reset'
20
20
  })} icon="Reset"/>);
21
21
  };
22
22
  export default Reset;
@@ -1 +1 @@
1
- {"version":3,"file":"RunCode.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/RunCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,KAAK;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,OAAO,UAAW,KAAK,sBAmB5B,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"RunCode.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/RunCode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,WAAW,KAAK;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,OAAO,UAAW,KAAK,sBAsB5B,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ShowRaw.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/ShowRaw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,OAAO,yBAgBZ,CAAA;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"ShowRaw.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/ShowRaw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,OAAO,yBAsBZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -6,7 +6,13 @@ const ShowRaw = () => {
6
6
  const store = useStore();
7
7
  const showRaw = useScript(store, 'showRaw');
8
8
  return (<Button icon={showRaw ? 'EditCode' : 'Code'} onClick={() => store.setShowRaw(!showRaw)} color={showRaw ? Color.Primary : Color.Secondary} title={showRaw
9
- ? translate({ message: 'Show edited Code', id: 'theme.CodeEditor.Actions.ShowCode.showEdited' })
10
- : translate({ message: 'Show initial code', id: 'theme.CodeEditor.Actions.ShowCode.showRaw' })}/>);
9
+ ? translate({
10
+ message: 'Show edited Code',
11
+ id: 'theme.CodeEditor.Actions.ShowCode.showEdited'
12
+ })
13
+ : translate({
14
+ message: 'Show initial code',
15
+ id: 'theme.CodeEditor.Actions.ShowCode.showRaw'
16
+ })}/>);
11
17
  };
12
18
  export default ShowRaw;
@@ -1 +1 @@
1
- {"version":3,"file":"ShowSyncStatus.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/ShowSyncStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,cAAc,yBAiCnB,CAAA;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ShowSyncStatus.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Actions/ShowSyncStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,cAAc,yBAyBnB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -15,12 +15,12 @@ const ShowSyncStatus = () => {
15
15
  }
16
16
  }, [status, store]);
17
17
  return (<>
18
- {!isLoaded && (<Icon icon='Sync' spin size={'1.2em'} color={Color.Primary}/>)}
18
+ {!isLoaded && <Icon icon="Sync" spin size={'1.2em'} color={Color.Primary}/>}
19
19
  <div style={{ flexGrow: 1, flexShrink: 1, flexBasis: 0 }}></div>
20
20
  <span style={{ minWidth: '1em' }}>
21
- {status === Status.SYNCING && (<Icon icon='Sync' spin size={'1.2em'} color={Color.Primary}/>)}
22
- {status === Status.SUCCESS && (<Icon icon='Check' size={'1.2em'} color={Color.Success}/>)}
23
- {status === Status.ERROR && (<Icon icon='Close' size={'1.2em'} color={Color.Danger}/>)}
21
+ {status === Status.SYNCING && <Icon icon="Sync" spin size={'1.2em'} color={Color.Primary}/>}
22
+ {status === Status.SUCCESS && <Icon icon="Check" size={'1.2em'} color={Color.Success}/>}
23
+ {status === Status.ERROR && <Icon icon="Close" size={'1.2em'} color={Color.Danger}/>}
24
24
  </span>
25
25
  </>);
26
26
  };
@@ -9,6 +9,5 @@
9
9
  }
10
10
 
11
11
  html[data-theme='dark'] .runCode {
12
- color: white
13
- }
14
-
12
+ color: white;
13
+ }
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import * as React from 'react';
2
2
  declare const BrythonCommunicator: () => React.JSX.Element;
3
3
  export default BrythonCommunicator;
4
4
  //# sourceMappingURL=BrythonCommunicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrythonCommunicator.d.ts","sourceRoot":"","sources":["../../../src/theme/CodeEditor/BrythonCommunicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,mBAAmB,yBAyCxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"BrythonCommunicator.d.ts","sourceRoot":"","sources":["../../../src/theme/CodeEditor/BrythonCommunicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,mBAAmB,yBAsCxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import { BRYTHON_NOTIFICATION_EVENT, DOM_ELEMENT_IDS } from "@theme/CodeEditor/constants";
1
+ import * as React from 'react';
2
+ import { BRYTHON_NOTIFICATION_EVENT, DOM_ELEMENT_IDS } from '@theme/CodeEditor/constants';
3
3
  import { useStore, useScript } from '@theme/CodeEditor/hooks';
4
4
  const BrythonCommunicator = () => {
5
5
  const store = useStore();
@@ -14,15 +14,19 @@ const BrythonCommunicator = () => {
14
14
  if (event.detail) {
15
15
  const data = event.detail;
16
16
  switch (data.type) {
17
- case "start":
17
+ case 'start':
18
18
  store.clearLogMessages();
19
19
  store.setExecuting(true);
20
20
  break;
21
- case "done":
21
+ case 'done':
22
22
  store.setExecuting(false);
23
23
  break;
24
24
  default:
25
- store.addLogMessage({ type: data.type, output: data.output, timeStamp: data.timeStamp });
25
+ store.addLogMessage({
26
+ type: data.type,
27
+ output: data.output,
28
+ timeStamp: data.timeStamp
29
+ });
26
30
  break;
27
31
  }
28
32
  }
@@ -32,6 +36,6 @@ const BrythonCommunicator = () => {
32
36
  current.removeEventListener(BRYTHON_NOTIFICATION_EVENT, onBryNotify);
33
37
  };
34
38
  }, [ref, store]);
35
- return (<div id={DOM_ELEMENT_IDS.communicator(codeId)} ref={ref}></div>);
39
+ return <div id={DOM_ELEMENT_IDS.communicator(codeId)} ref={ref}></div>;
36
40
  };
37
41
  export default BrythonCommunicator;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,8BAA8B,CAAC;AAKtD,oBAAY,KAAK;IACb,OAAO,oBAAoB;IAC3B,SAAS,sBAAsB;IAC/B,OAAO,oBAAoB;IAC3B,IAAI,iBAAiB;IACrB,OAAO,oBAAoB;IAC3B,MAAM,mBAAmB;IACzB,IAAI,iBAAiB;CACxB;AACD,oBAAY,IAAI;IACZ,KAAK,eAAe;IACpB,KAAK,eAAe;CACvB;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,OAAO,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,QAAA,MAAM,MAAM,UAAW,KAAK,sBAgB3B,CAAA;AAED,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,8BAA8B,CAAC;AAKtD,oBAAY,KAAK;IACb,OAAO,oBAAoB;IAC3B,SAAS,sBAAsB;IAC/B,OAAO,oBAAoB;IAC3B,IAAI,iBAAiB;IACrB,OAAO,oBAAoB;IAC3B,MAAM,mBAAmB;IACzB,IAAI,iBAAiB;CACxB;AACD,oBAAY,IAAI;IACZ,KAAK,eAAe;IACpB,KAAK,eAAe;CACvB;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,OAAO,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,UAAW,KAAK,sBAqB3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -6,4 +6,4 @@
6
6
  cursor: pointer;
7
7
  margin: 0px 2px;
8
8
  padding: 4px 10px;
9
- }
9
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/CodeHistory/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,4BAA4B,CAAC;AAoBpC,QAAA,MAAM,WAAW,yBA+FhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/CodeHistory/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,4BAA4B,CAAC;AAoBpC,QAAA,MAAM,WAAW,yBA2GhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -14,7 +14,7 @@ const highlightSyntax = (str) => {
14
14
  return;
15
15
  }
16
16
  return (<span dangerouslySetInnerHTML={{
17
- __html: Prism.highlight(str, Prism.languages.python, 'python'),
17
+ __html: Prism.highlight(str, Prism.languages.python, 'python')
18
18
  }}/>);
19
19
  };
20
20
  const CodeHistory = () => {
@@ -30,11 +30,20 @@ const CodeHistory = () => {
30
30
  <div className={clsx(styles.summary)}>
31
31
  <span className="badge badge--secondary">
32
32
  {versionsLoaded
33
- ? translate({ message: '{n} Versions', id: 'CodeHistory.nVersions.text' }, { n: versions.length })
34
- : translate({ message: 'Load Versions', id: 'CodeHistory.LoadVersions.text' })}
33
+ ? translate({
34
+ message: '{n} Versions',
35
+ id: 'CodeHistory.nVersions.text'
36
+ }, { n: versions.length })
37
+ : translate({
38
+ message: 'Load Versions',
39
+ id: 'CodeHistory.LoadVersions.text'
40
+ })}
35
41
  </span>
36
42
  <span className={clsx(styles.spacer)}></span>
37
- <Button icon='Sync' title={translate({ message: 'Sync Versions', id: 'CodeHistory.LoadVersions.text' })} onClick={(e) => {
43
+ <Button icon="Sync" title={translate({
44
+ message: 'Sync Versions',
45
+ id: 'CodeHistory.LoadVersions.text'
46
+ })} onClick={(e) => {
38
47
  e.preventDefault();
39
48
  e.stopPropagation();
40
49
  store.loadVersions();
@@ -52,20 +61,22 @@ const CodeHistory = () => {
52
61
  }
53
62
  setVersion(c);
54
63
  }} min={1} max={versions.length - 1} dots={versions.length < 50}/>
55
- <span className="badge badge--primary">
56
- V{version}
57
- </span>
64
+ <span className="badge badge--primary">V{version}</span>
58
65
  </div>
59
66
  <div className={clsx(styles.diffViewer)}>
60
67
  {versions.length > 1 && (<DiffViewer splitView oldValue={versions[version - 1].code} newValue={versions[version].code} leftTitle={<div className={clsx(styles.diffHeader)}>
61
68
  {`V${version}`}
62
69
  {versions[version].pasted && (<span className={clsx('badge', 'badge--danger')}>
63
- <Translate id="CodeHistory.PastedBadge.Text">Pasted</Translate>
70
+ <Translate id="CodeHistory.PastedBadge.Text">
71
+ Pasted
72
+ </Translate>
64
73
  </span>)}
65
74
  </div>} rightTitle={<div className={clsx(styles.diffHeader)}>
66
75
  {`V${version}`}
67
76
  {versions[version].pasted && (<span className={clsx('badge', 'badge--danger')}>
68
- <Translate id="CodeHistory.PastedBadge.Text">Pasted</Translate>
77
+ <Translate id="CodeHistory.PastedBadge.Text">
78
+ Pasted
79
+ </Translate>
69
80
  </span>)}
70
81
  </div>} renderContent={highlightSyntax}/>)}
71
82
  </div>
@@ -1,54 +1,54 @@
1
- .codeHistory>.historyDetails {
2
- cursor: pointer;
3
- margin-bottom: 0;
4
- border-top-left-radius: 0;
5
- border-top-right-radius: 0;
1
+ .codeHistory > .historyDetails {
2
+ cursor: pointer;
3
+ margin-bottom: 0;
4
+ border-top-left-radius: 0;
5
+ border-top-right-radius: 0;
6
6
  }
7
7
  .summary {
8
- display: flex;
9
- align-items: center;
8
+ display: flex;
9
+ align-items: center;
10
10
  }
11
11
  .spacer {
12
- flex-grow: 1;
13
- flex-shrink: 1;
14
- flex-basis: 0;
15
- }
12
+ flex-grow: 1;
13
+ flex-shrink: 1;
14
+ flex-basis: 0;
15
+ }
16
16
 
17
17
  .versionControl {
18
- padding: 1em 2em;
19
- box-shadow: var(--ifm-global-shadow-lw);
20
- border-radius: var(--ifm-global-radius);
18
+ padding: 1em 2em;
19
+ box-shadow: var(--ifm-global-shadow-lw);
20
+ border-radius: var(--ifm-global-radius);
21
21
  }
22
22
 
23
23
  .faButton {
24
- margin-left: 1em;
24
+ margin-left: 1em;
25
25
  }
26
26
 
27
27
  .faButton:hover {
28
- transform: scale(1.2);
28
+ transform: scale(1.2);
29
29
  }
30
30
 
31
31
  .diffViewer {
32
- --ifm-pre-background: rgba(255, 255, 255, 0);
33
- --ifm-alert-background-color: rgba(255, 255, 255, 0);
34
- --ifm-alert-background-color-highlight: rgba(255, 255, 255, 0);
35
- --ifm-table-stripe-background: rgba(255, 255, 255, 0);
36
- font-family: monospace;
37
- overflow: auto;
32
+ --ifm-pre-background: rgba(255, 255, 255, 0);
33
+ --ifm-alert-background-color: rgba(255, 255, 255, 0);
34
+ --ifm-alert-background-color-highlight: rgba(255, 255, 255, 0);
35
+ --ifm-table-stripe-background: rgba(255, 255, 255, 0);
36
+ font-family: monospace;
37
+ overflow: auto;
38
38
  }
39
39
 
40
40
  .diffViewer table tbody tr td {
41
- padding-top: 0;
42
- padding-bottom: 0;
41
+ padding-top: 0;
42
+ padding-bottom: 0;
43
43
  }
44
44
 
45
45
  .diffViewer table tbody tr td pre {
46
- white-space: nowrap;
47
- padding-top: 0;
48
- padding-bottom: 0;
49
- line-height: 18px;
46
+ white-space: nowrap;
47
+ padding-top: 0;
48
+ padding-bottom: 0;
49
+ line-height: 18px;
50
50
  }
51
51
  .diffHeader {
52
- display: flex;
53
- justify-content: space-between;
54
- }
52
+ display: flex;
53
+ justify-content: space-between;
54
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/ContextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI/D,UAAU,KAAM,SAAQ,SAAS;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACtC;AAYD;;;;;GAKG;AACH,QAAA,MAAM,aAAa,UAAW,KAAK,sBA2ClC,CAAA;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/CodeEditor/ContextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAI/D,UAAU,KAAM,SAAQ,SAAS;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;CACtC;AAYD;;;;;GAKG;AACH,QAAA,MAAM,aAAa,UAAW,KAAK,sBAyClC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -31,6 +31,6 @@ const ContextEditor = (props) => {
31
31
  <CodeEditor code={code} lang={lang} preCode={pre} postCode={post} maxLines={props.maxLines && Number.parseInt(props.maxLines, 10)} readonly={!!props.readonly} resettable={!props.noReset} download={!props.versioned && !props.noDownload} slim={!!props.slim} showLineNumbers={!(!!props.slim && !/\n/.test(code))} versioned={!!props.versioned} noHistory={!!props.noHistory} noCompare={!!props.noCompare} title={title} className={props.className}/>
32
32
  </ScriptContext>);
33
33
  }
34
- return (<CodeBlock {...props}/>);
34
+ return <CodeBlock {...props}/>;
35
35
  };
36
36
  export default ContextEditor;
@@ -12,7 +12,7 @@ import 'ace-builds/src-noconflict/ext-language_tools';
12
12
  import 'ace-builds/webpack-resolver';
13
13
  import { useStore, useScript } from '@theme/CodeEditor/hooks';
14
14
  const ALIAS_LANG_MAP_ACE = {
15
- mpy: 'python',
15
+ mpy: 'python'
16
16
  };
17
17
  const EditorAce = (props) => {
18
18
  const eRef = React.useRef(null);
@@ -30,7 +30,7 @@ const EditorAce = (props) => {
30
30
  // commands is array of key bindings.
31
31
  name: 'execute',
32
32
  bindKey: { win: 'Ctrl-Enter', mac: 'Command-Enter' },
33
- exec: () => store.execScript(),
33
+ exec: () => store.execScript()
34
34
  });
35
35
  }
36
36
  node.editor.commands.addCommand({
@@ -39,7 +39,7 @@ const EditorAce = (props) => {
39
39
  bindKey: { win: 'Ctrl-s', mac: 'Command-s' },
40
40
  exec: () => {
41
41
  store.saveNow();
42
- },
42
+ }
43
43
  });
44
44
  return () => {
45
45
  if (node && node.editor) {
@@ -73,7 +73,7 @@ const EditorAce = (props) => {
73
73
  }} readOnly={showRaw} value={showRaw ? pristineCode : code} defaultValue={code || '\n'} name={DOM_ELEMENT_IDS.aceEditor(codeId)} editorProps={{ $blockScrolling: true }} setOptions={{
74
74
  displayIndentGuides: true,
75
75
  vScrollBarAlwaysVisible: false,
76
- highlightGutterLine: false,
76
+ highlightGutterLine: false
77
77
  }} showPrintMargin={false} highlightActiveLine={false} enableBasicAutocompletion enableLiveAutocompletion={false} enableSnippets={false} showGutter={props.showLineNumbers}/>
78
78
  </div>);
79
79
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/CodeEditor/Editor/Header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,UAAW,KAAK,sBAyB3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/CodeEditor/Editor/Header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,MAAM,UAAW,KAAK,sBAmB3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -15,9 +15,9 @@ const Header = (props) => {
15
15
  {!props.slim && (<React.Fragment>
16
16
  <div className={styles.title}>{props.title}</div>
17
17
  <ShowSyncStatus />
18
- {hasEdits && props.resettable && (<Reset />)}
19
- {props.download && (<DownloadCode title={props.title}/>)}
20
- {hasEdits && !props.noCompare && (<ShowRaw />)}
18
+ {hasEdits && props.resettable && <Reset />}
19
+ {props.download && <DownloadCode title={props.title}/>}
20
+ {hasEdits && !props.noCompare && <ShowRaw />}
21
21
  </React.Fragment>)}
22
22
  {lang === 'python' && <RunCode title={props.title} slim={props.slim}/>}
23
23
  </div>);
@@ -3,7 +3,7 @@
3
3
  display: flex;
4
4
  align-items: center;
5
5
  letter-spacing: 0.08em;
6
-
6
+
7
7
  z-index: calc(var(--ifm-z-index-fixed) - 2);
8
8
  padding: 0.2em;
9
9
  padding-left: 0.5em;
@@ -15,13 +15,13 @@
15
15
  }
16
16
 
17
17
  .controls > .title {
18
- flex-shrink: 1;
19
- flex-grow: 1;
20
- overflow-x: hidden;
21
- text-overflow: ellipsis;
22
- white-space: nowrap;
18
+ flex-shrink: 1;
19
+ flex-grow: 1;
20
+ overflow-x: hidden;
21
+ text-overflow: ellipsis;
22
+ white-space: nowrap;
23
23
  }
24
24
 
25
25
  .controls.slim {
26
26
  padding: 0;
27
- }
27
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/CodeEditor/Editor/HiddenCode/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,KAAK;IACX,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,UAAU,UAAW,KAAK,sBAwB/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/CodeEditor/Editor/HiddenCode/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,KAAK;IACX,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,UAAU,UAAW,KAAK,sBAkC/B,CAAC;AAEF,eAAe,UAAU,CAAC"}