@codecademy/codebytes 1.0.3-alpha.9ea661470.0 → 1.0.4-alpha.37044bcdd.0

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.
@@ -1,6 +1,6 @@
1
- import React from 'react';
2
- import type { LanguageOption } from './consts';
3
- export declare type LanguageSelectionProps = {
4
- onChange: (newLanguage: LanguageOption) => void;
5
- };
6
- export declare const LanguageSelection: React.FC<LanguageSelectionProps>;
1
+ import React from 'react';
2
+ import type { LanguageOption } from './consts';
3
+ export declare type LanguageSelectionProps = {
4
+ onChange: (newLanguage: LanguageOption) => void;
5
+ };
6
+ export declare const LanguageSelection: React.FC<LanguageSelectionProps>;
@@ -1 +1 @@
1
- export declare const trackUserClick: (data: import("@codecademy/tracking").UserClickData) => void, trackUserVisit: (data: import("@codecademy/tracking").UserVisitData) => void, trackUserImpression: (data: import("@codecademy/tracking").UserImpressionData) => void;
1
+ export declare const trackUserClick: (data: import("@codecademy/tracking").UserClickData) => void, trackUserVisit: (data: import("@codecademy/tracking").UserVisitData) => void, trackUserImpression: (data: import("@codecademy/tracking").UserImpressionData) => void;
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@codecademy/codebytes",
3
+ "description": "Codebytes Editor",
4
+ "version": "1.0.3",
5
+ "author": "Codecademy Engineering <dev@codecademy.com>",
6
+ "dependencies": {
7
+ "@codecademy/tracking": "^1.0.2",
8
+ "@monaco-editor/react": "^4.4.5",
9
+ "js-base64": "^3.6.0",
10
+ "jsuri": "^1.3.1",
11
+ "react-resize-observer": "^1.1.1"
12
+ },
13
+ "files": [
14
+ "dist/**"
15
+ ],
16
+ "license": "MIT",
17
+ "main": "./index.cjs",
18
+ "module": "./index.js",
19
+ "peerDependencies": {
20
+ "@codecademy/gamut": "*",
21
+ "@codecademy/gamut-icons": "*",
22
+ "@codecademy/gamut-styles": "*",
23
+ "@codecademy/variance": "*",
24
+ "@emotion/react": "^11.7.1",
25
+ "@emotion/styled": "^11.3.0",
26
+ "react": ">=16.8.1",
27
+ "react-dom": ">=16.8.1"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "repository": "git@github.com:codecademy-engineering/mono.git",
33
+ "scripts": {
34
+ "build:watch": "yarn build:clean && yarn build:compile && yarn build:types && onchange ./src -- yarn build:compile && yarn build:types"
35
+ },
36
+ "sideEffects": [
37
+ "**/*.css",
38
+ "**/*.scss",
39
+ "dist/**/[A-Z]**/[A-Z]*.js",
40
+ "dist/**/[A-Z]**/index.js"
41
+ ],
42
+ "type": "module",
43
+ "types": "./index.d.ts"
44
+ }
package/dist/types.d.ts CHANGED
@@ -1,22 +1,22 @@
1
- import { BackgroundProps } from '@codecademy/gamut-styles';
2
- import { UserClickData } from '@codecademy/tracking';
3
- import { LanguageOption } from './consts';
4
- export interface CodebytesChangeHandler {
5
- (text: string, language: LanguageOption): void;
6
- }
7
- export interface CodebytesCopyFormatterParams {
8
- text: string;
9
- language: LanguageOption;
10
- }
11
- export declare type CodebytesCopyFormatter = ({ text, language, }: CodebytesCopyFormatterParams) => string;
12
- export interface CodeByteEditorProps extends Omit<BackgroundProps, 'bg'> {
13
- text?: string;
14
- language?: LanguageOption;
15
- hideCopyButton?: boolean;
16
- copyFormatter?: CodebytesCopyFormatter;
17
- snippetsBaseUrl?: string;
18
- onEdit?: CodebytesChangeHandler;
19
- onLanguageChange?: CodebytesChangeHandler;
20
- trackingData?: Omit<UserClickData, 'target'>;
21
- trackFirstEdit?: boolean;
22
- }
1
+ import { BackgroundProps } from '@codecademy/gamut-styles';
2
+ import { UserClickData } from '@codecademy/tracking';
3
+ import { LanguageOption } from './consts';
4
+ export interface CodebytesChangeHandler {
5
+ (text: string, language: LanguageOption): void;
6
+ }
7
+ export interface CodebytesCopyFormatterParams {
8
+ text: string;
9
+ language: LanguageOption;
10
+ }
11
+ export declare type CodebytesCopyFormatter = ({ text, language, }: CodebytesCopyFormatterParams) => string;
12
+ export interface CodeByteEditorProps extends Omit<BackgroundProps, 'bg'> {
13
+ text?: string;
14
+ language?: LanguageOption;
15
+ hideCopyButton?: boolean;
16
+ copyFormatter?: CodebytesCopyFormatter;
17
+ snippetsBaseUrl?: string;
18
+ onEdit?: CodebytesChangeHandler;
19
+ onLanguageChange?: CodebytesChangeHandler;
20
+ trackingData?: Omit<UserClickData, 'target'>;
21
+ trackFirstEdit?: boolean;
22
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@codecademy/codebytes",
3
3
  "description": "Codebytes Editor",
4
- "version": "1.0.3-alpha.9ea661470.0",
4
+ "version": "1.0.4-alpha.37044bcdd.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
- "@codecademy/tracking": "^1.0.2",
7
+ "@codecademy/tracking": "1.0.3-alpha.37044bcdd.0",
8
8
  "@monaco-editor/react": "^4.4.5",
9
9
  "js-base64": "^3.6.0",
10
10
  "jsuri": "^1.3.1",
@@ -39,5 +39,5 @@
39
39
  "dist/**/[A-Z]**/[A-Z]*.js",
40
40
  "dist/**/[A-Z]**/index.js"
41
41
  ],
42
- "gitHead": "c3fb5df00daaebd41db55f19e036f66484820606"
42
+ "gitHead": "3b2cea99b429eb7bd9c9aa663e95441b2b16d0af"
43
43
  }
@@ -1,46 +0,0 @@
1
- // DO NOT CHANGE ANYTHING HERE
2
- // This file is part of the Codebytes MVP and only includes basic configuration around theming for the SimpleMonacoEditor component
3
- // We are working on a monaco package in client-modules that has more configuration around themes and languages
4
- // Monaco as a shared package RFC https://www.notion.so/codecademy/Monaco-editor-as-a-shared-package-1f4484db165b4abc8394c3556451ef6a
5
- import { colors, editorColors } from '@codecademy/gamut-styles';
6
- var darkTheme = {
7
- blue: editorColors.blue,
8
- deepPurple: editorColors.deepPurple,
9
- gray: editorColors.gray,
10
- green: editorColors.green,
11
- orange: editorColors.orange,
12
- purple: editorColors.purple,
13
- red: editorColors.red,
14
- white: colors.white,
15
- yellow: editorColors.yellow
16
- };
17
- export var syntax = {
18
- attribute: darkTheme.green,
19
- annotation: darkTheme.red,
20
- atom: darkTheme.deepPurple,
21
- basic: darkTheme.white,
22
- comment: darkTheme.gray,
23
- constant: darkTheme.orange,
24
- decoration: darkTheme.red,
25
- invalid: darkTheme.red,
26
- key: darkTheme.blue,
27
- keyword: darkTheme.purple,
28
- number: darkTheme.red,
29
- operator: darkTheme.red,
30
- predefined: darkTheme.white,
31
- property: darkTheme.red,
32
- regexp: darkTheme.green,
33
- string: darkTheme.yellow,
34
- tag: darkTheme.red,
35
- text: darkTheme.orange,
36
- value: darkTheme.yellow,
37
- variable: darkTheme.green
38
- };
39
- export var ui = {
40
- background: '#211E2F',
41
- text: darkTheme.white,
42
- indent: {
43
- active: '#393b41',
44
- inactive: '#494b51'
45
- }
46
- };
@@ -1,42 +0,0 @@
1
- // DO NOT CHANGE ANYTHING HERE
2
- // This component is part of the Codebytes MVP and only includes basic configuration around theming
3
- // We are working on a monaco package in client-modules that has more configuration around themes and languages
4
- // Monaco as a shared package RFC https://www.notion.so/codecademy/Monaco-editor-as-a-shared-package-1f4484db165b4abc8394c3556451ef6a
5
- import ReactMonacoEditor from '@monaco-editor/react';
6
- import React, { useCallback, useRef } from 'react';
7
- import ResizeObserver from 'react-resize-observer';
8
- import { dark } from './theme';
9
- export var SimpleMonacoEditor = function SimpleMonacoEditor(_ref) {
10
- var value = _ref.value,
11
- language = _ref.language,
12
- onChange = _ref.onChange;
13
- var editorRef = useRef(null);
14
- var editorWillMount = useCallback(function (editor, monaco) {
15
- editorRef.current = editor;
16
- monaco.editor.defineTheme('dark', dark);
17
- monaco.editor.setTheme('dark');
18
- }, []);
19
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizeObserver, {
20
- onResize: function onResize(_ref2) {
21
- var _editorRef$current;
22
-
23
- var height = _ref2.height,
24
- width = _ref2.width;
25
- (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.layout({
26
- height: height,
27
- width: width
28
- });
29
- }
30
- }), /*#__PURE__*/React.createElement(ReactMonacoEditor, {
31
- onMount: editorWillMount,
32
- onChange: onChange,
33
- options: {
34
- minimap: {
35
- enabled: false
36
- }
37
- },
38
- theme: "vs-dark",
39
- value: value,
40
- language: language
41
- }));
42
- };
@@ -1,123 +0,0 @@
1
- // DO NOT CHANGE ANYTHING HERE
2
- // This file is part of the Codebytes MVP and only includes basic configuration around theming for the SimpleMonacoEditor component
3
- // We are working on a monaco package in client-modules that has more configuration around themes and languages
4
- // Monaco as a shared package RFC https://www.notion.so/codecademy/Monaco-editor-as-a-shared-package-1f4484db165b4abc8394c3556451ef6a
5
- import * as darkColors from './colorsDark';
6
-
7
- var c = function c(color) {
8
- return color.substr(1);
9
- };
10
-
11
- var theme = function theme(_ref) {
12
- var ui = _ref.ui,
13
- syntax = _ref.syntax;
14
- return {
15
- base: 'vs-dark',
16
- inherit: true,
17
- rules: [// Base
18
- {
19
- token: '',
20
- foreground: c(syntax.basic)
21
- }, {
22
- token: 'regexp',
23
- foreground: c(syntax.regexp)
24
- }, {
25
- token: 'annotation',
26
- foreground: c(syntax.annotation)
27
- }, {
28
- token: 'type',
29
- foreground: c(syntax.annotation)
30
- }, {
31
- token: 'doctype',
32
- foreground: c(syntax.comment)
33
- }, {
34
- token: 'delimiter',
35
- foreground: c(syntax.decoration)
36
- }, {
37
- token: 'invalid',
38
- foreground: c(syntax.invalid)
39
- }, {
40
- token: 'emphasis',
41
- fontStyle: 'italic'
42
- }, {
43
- token: 'strong',
44
- fontStyle: 'bold'
45
- }, {
46
- token: 'variable',
47
- foreground: c(syntax.variable)
48
- }, {
49
- token: 'variable.predefined',
50
- foreground: c(syntax.variable)
51
- }, {
52
- token: 'constant',
53
- foreground: c(syntax.constant)
54
- }, {
55
- token: 'comment',
56
- foreground: c(syntax.comment)
57
- }, {
58
- token: 'number',
59
- foreground: c(syntax.number)
60
- }, {
61
- token: 'number.hex',
62
- foreground: c(syntax.number)
63
- }, {
64
- token: 'keyword.directive',
65
- foreground: c(syntax.comment)
66
- }, {
67
- token: 'include',
68
- foreground: c(syntax.comment)
69
- }, {
70
- token: 'key',
71
- foreground: c(syntax.property)
72
- }, {
73
- token: 'attribute.name',
74
- foreground: c(syntax.attribute)
75
- }, {
76
- token: 'attribute.name-numeric',
77
- foreground: c(syntax.string)
78
- }, {
79
- token: 'attribute.value',
80
- foreground: c(syntax.property)
81
- }, {
82
- token: 'attribute.value.number',
83
- foreground: c(syntax.number)
84
- }, {
85
- token: 'string',
86
- foreground: c(syntax.string)
87
- }, {
88
- token: 'string.yaml',
89
- foreground: c(syntax.string)
90
- }, {
91
- token: 'tag',
92
- foreground: c(syntax.tag)
93
- }, {
94
- token: 'tag.id.jade',
95
- foreground: c(syntax.tag)
96
- }, {
97
- token: 'tag.class.jade',
98
- foreground: c(syntax.tag)
99
- }, {
100
- token: 'metatag',
101
- foreground: c(syntax.comment)
102
- }, {
103
- token: 'attribute.value.unit',
104
- foreground: c(syntax.string)
105
- }, {
106
- token: 'keyword',
107
- foreground: c(syntax.keyword)
108
- }, {
109
- token: 'keyword.flow',
110
- foreground: c(syntax.keyword)
111
- }],
112
- colors: {
113
- 'editor.background': ui.background,
114
- 'editor.foreground': ui.text,
115
- 'editorIndentGuide.background': ui.indent.inactive,
116
- 'editorIndentGuide.activeBackground': ui.indent.active,
117
- 'editorWhitespace.foreground': syntax.comment,
118
- 'editorLineNumber.foreground': '#9FA2AC'
119
- }
120
- };
121
- };
122
-
123
- export var dark = theme(darkColors);
@@ -1 +0,0 @@
1
- export {};
package/dist/api.js DELETED
@@ -1,41 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
-
3
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
-
5
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
6
-
7
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
8
-
9
- export var postSnippet = /*#__PURE__*/function () {
10
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, snippetsBaseUrl) {
11
- var snippetsEndpoint, response;
12
- return _regeneratorRuntime().wrap(function _callee$(_context) {
13
- while (1) {
14
- switch (_context.prev = _context.next) {
15
- case 0:
16
- snippetsEndpoint = "https://".concat(snippetsBaseUrl, "/snippets");
17
- _context.next = 3;
18
- return fetch(snippetsEndpoint, {
19
- method: 'POST',
20
- body: JSON.stringify(data),
21
- headers: {
22
- 'x-codecademy-user-id': 'codebytes-anon-user'
23
- }
24
- });
25
-
26
- case 3:
27
- response = _context.sent;
28
- return _context.abrupt("return", response.json());
29
-
30
- case 5:
31
- case "end":
32
- return _context.stop();
33
- }
34
- }
35
- }, _callee);
36
- }));
37
-
38
- return function postSnippet(_x, _x2) {
39
- return _ref.apply(this, arguments);
40
- };
41
- }();
@@ -1,141 +0,0 @@
1
- import _styled from "@emotion/styled/base";
2
- var _excluded = ["text", "language", "hideCopyButton", "snippetsBaseUrl", "onEdit", "onLanguageChange", "copyFormatter", "trackingData", "trackFirstEdit"];
3
-
4
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
-
6
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
-
8
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
-
10
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
-
12
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
-
14
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
15
-
16
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
-
18
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
19
-
20
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
21
-
22
- import { Box, IconButton } from '@codecademy/gamut';
23
- import { FaviconIcon } from '@codecademy/gamut-icons';
24
- import { Background, system } from '@codecademy/gamut-styles';
25
- import React, { useEffect, useState } from 'react';
26
- import { helloWorld } from './consts';
27
- import { Editor } from './editor';
28
- import { trackClick } from './helpers';
29
- import { useEverInView } from './helpers/useEverInView';
30
- import { LanguageSelection } from './languageSelection';
31
- import { trackUserImpression } from './libs/eventTracking';
32
- var editorBaseStyles = system.css({
33
- border: 1,
34
- borderColor: 'gray-900',
35
- display: 'flex',
36
- flexDirection: 'column',
37
- minHeight: '25rem'
38
- });
39
-
40
- var EditorContainer = /*#__PURE__*/_styled(Background, {
41
- target: "e1epka4g0",
42
- label: "EditorContainer"
43
- })(editorBaseStyles, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb2RlQnl0ZUVkaXRvci50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJ3QiIsImZpbGUiOiIuLi9zcmMvY29kZUJ5dGVFZGl0b3IudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQm94LCBJY29uQnV0dG9uIH0gZnJvbSAnQGNvZGVjYWRlbXkvZ2FtdXQnO1xuaW1wb3J0IHsgRmF2aWNvbkljb24gfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1pY29ucyc7XG5pbXBvcnQgeyBCYWNrZ3JvdW5kLCBzeXN0ZW0gfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1zdHlsZXMnO1xuaW1wb3J0IHsgU3R5bGVQcm9wcyB9IGZyb20gJ0Bjb2RlY2FkZW15L3ZhcmlhbmNlJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCBSZWFjdCwgeyB1c2VFZmZlY3QsIHVzZVN0YXRlIH0gZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgeyBoZWxsb1dvcmxkLCBMYW5ndWFnZU9wdGlvbiB9IGZyb20gJy4vY29uc3RzJztcbmltcG9ydCB7IEVkaXRvciB9IGZyb20gJy4vZWRpdG9yJztcbmltcG9ydCB7IHRyYWNrQ2xpY2sgfSBmcm9tICcuL2hlbHBlcnMnO1xuaW1wb3J0IHsgdXNlRXZlckluVmlldyB9IGZyb20gJy4vaGVscGVycy91c2VFdmVySW5WaWV3JztcbmltcG9ydCB7IExhbmd1YWdlU2VsZWN0aW9uIH0gZnJvbSAnLi9sYW5ndWFnZVNlbGVjdGlvbic7XG5pbXBvcnQgeyB0cmFja1VzZXJJbXByZXNzaW9uIH0gZnJvbSAnLi9saWJzL2V2ZW50VHJhY2tpbmcnO1xuaW1wb3J0IHsgQ29kZUJ5dGVFZGl0b3JQcm9wcyB9IGZyb20gJy4vdHlwZXMnO1xuXG5jb25zdCBlZGl0b3JCYXNlU3R5bGVzID0gc3lzdGVtLmNzcyh7XG4gIGJvcmRlcjogMSxcbiAgYm9yZGVyQ29sb3I6ICdncmF5LTkwMCcsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgZmxleERpcmVjdGlvbjogJ2NvbHVtbicsXG4gIG1pbkhlaWdodDogJzI1cmVtJyxcbn0pO1xuXG5jb25zdCBFZGl0b3JDb250YWluZXIgPSBzdHlsZWQoQmFja2dyb3VuZCk8U3R5bGVQcm9wczx0eXBlb2YgZWRpdG9yQmFzZVN0eWxlcz4+KFxuICBlZGl0b3JCYXNlU3R5bGVzXG4pO1xuXG5leHBvcnQgY29uc3QgQ29kZUJ5dGVFZGl0b3I6IFJlYWN0LkZDPENvZGVCeXRlRWRpdG9yUHJvcHM+ID0gKHtcbiAgdGV4dDogaW5pdGlhbFRleHQsXG4gIGxhbmd1YWdlOiBpbml0aWFsTGFuZ3VhZ2UsXG4gIGhpZGVDb3B5QnV0dG9uID0gZmFsc2UsXG4gIHNuaXBwZXRzQmFzZVVybCxcbiAgb25FZGl0LFxuICBvbkxhbmd1YWdlQ2hhbmdlLFxuICBjb3B5Rm9ybWF0dGVyLFxuICB0cmFja2luZ0RhdGEsXG4gIHRyYWNrRmlyc3RFZGl0ID0gZmFsc2UsXG4gIC4uLnJlc3Rcbn0pID0+IHtcbiAgY29uc3QgeyBldmVySW5WaWV3LCByZWYgfSA9IHVzZUV2ZXJJblZpZXcoKTtcblxuICBjb25zdCBnZXRJbml0aWFsVGV4dCA9ICgpID0+IHtcbiAgICBpZiAoaW5pdGlhbFRleHQgIT09IHVuZGVmaW5lZCkgcmV0dXJuIGluaXRpYWxUZXh0O1xuICAgIHJldHVybiBpbml0aWFsTGFuZ3VhZ2UgPyBoZWxsb1dvcmxkW2luaXRpYWxMYW5ndWFnZV0gOiAnJztcbiAgfTtcblxuICBjb25zdCBbdGV4dCwgc2V0VGV4dF0gPSB1c2VTdGF0ZTxzdHJpbmc+KGdldEluaXRpYWxUZXh0KCkpO1xuICBjb25zdCBbbGFuZ3VhZ2UsIHNldExhbmd1YWdlXSA9IHVzZVN0YXRlPExhbmd1YWdlT3B0aW9uPihcbiAgICBpbml0aWFsTGFuZ3VhZ2UgPz8gJydcbiAgKTtcbiAgY29uc3QgW2hhc0JlZW5FZGl0ZWQsIHNldEhhc0JlZW5FZGl0ZWRdID0gdXNlU3RhdGUoZmFsc2UpO1xuXG4gIHVzZUVmZmVjdCgoKSA9PiB7XG4gICAgaWYgKGV2ZXJJblZpZXcpIHtcbiAgICAgIHRyYWNrVXNlckltcHJlc3Npb24oe1xuICAgICAgICBwYWdlX25hbWU6IHRyYWNraW5nRGF0YT8ucGFnZV9uYW1lID8/ICdVbmtub3duJyxcbiAgICAgICAgY29udGV4dDogdHJhY2tpbmdEYXRhPy5jb250ZXh0ID8/IGRvY3VtZW50LnJlZmVycmVyLFxuICAgICAgICB0YXJnZXQ6ICdjb2RlYnl0ZScsXG4gICAgICB9KTtcbiAgICB9XG4gIH0sIFtldmVySW5WaWV3LCB0cmFja2luZ0RhdGFdKTtcblxuICByZXR1cm4gKFxuICAgIDxFZGl0b3JDb250YWluZXJcbiAgICAgIGJnPVwiYmxhY2tcIlxuICAgICAgbWF4V2lkdGg9XCI0M3JlbVwiXG4gICAgICB7Li4ucmVzdH1cbiAgICAgIG92ZXJmbG93PVwiaGlkZGVuXCJcbiAgICAgIHJlZj17cmVmfVxuICAgID5cbiAgICAgIDxCb3ggYm9yZGVyQm90dG9tPXsxfSBib3JkZXJDb2xvcj1cImdyYXktOTAwXCIgcHk9ezR9IHBsPXs4fT5cbiAgICAgICAgPEljb25CdXR0b25cbiAgICAgICAgICBpY29uPXtGYXZpY29uSWNvbn1cbiAgICAgICAgICB2YXJpYW50PVwic2Vjb25kYXJ5XCJcbiAgICAgICAgICBocmVmPVwiaHR0cHM6Ly93d3cuY29kZWNhZGVteS5jb20vXCJcbiAgICAgICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgICAgIHJlbD1cIm5vcmVmZXJyZXJcIlxuICAgICAgICAgIGFyaWEtbGFiZWw9XCJ2aXNpdCBjb2RlY2FkZW15LmNvbVwiXG4gICAgICAgICAgb25DbGljaz17KCkgPT4gdHJhY2tDbGljaygnbG9nbycsIHRyYWNraW5nRGF0YSl9XG4gICAgICAgIC8+XG4gICAgICA8L0JveD5cbiAgICAgIHtsYW5ndWFnZSA/IChcbiAgICAgICAgPEVkaXRvclxuICAgICAgICAgIGxhbmd1YWdlPXtsYW5ndWFnZX1cbiAgICAgICAgICB0ZXh0PXt0ZXh0fVxuICAgICAgICAgIGhpZGVDb3B5QnV0dG9uPXtoaWRlQ29weUJ1dHRvbn1cbiAgICAgICAgICBvbkNoYW5nZT17KG5ld1RleHQ6IHN0cmluZykgPT4ge1xuICAgICAgICAgICAgc2V0VGV4dChuZXdUZXh0KTtcbiAgICAgICAgICAgIG9uRWRpdD8uKG5ld1RleHQsIGxhbmd1YWdlKTtcbiAgICAgICAgICAgIGlmICh0cmFja0ZpcnN0RWRpdCAmJiBoYXNCZWVuRWRpdGVkID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICBzZXRIYXNCZWVuRWRpdGVkKHRydWUpO1xuICAgICAgICAgICAgICB0cmFja0NsaWNrKCdlZGl0JywgdHJhY2tpbmdEYXRhKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9fVxuICAgICAgICAgIHNuaXBwZXRzQmFzZVVybD17c25pcHBldHNCYXNlVXJsfVxuICAgICAgICAgIGNvcHlGb3JtYXR0ZXI9e2NvcHlGb3JtYXR0ZXJ9XG4gICAgICAgICAgdHJhY2tpbmdEYXRhPXt0cmFja2luZ0RhdGF9XG4gICAgICAgIC8+XG4gICAgICApIDogKFxuICAgICAgICA8TGFuZ3VhZ2VTZWxlY3Rpb25cbiAgICAgICAgICBvbkNoYW5nZT17KG5ld0xhbmd1YWdlKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBuZXdUZXh0OiBzdHJpbmcgPVxuICAgICAgICAgICAgICB0ZXh0IHx8IChuZXdMYW5ndWFnZSA/IGhlbGxvV29ybGRbbmV3TGFuZ3VhZ2VdIDogJycpO1xuICAgICAgICAgICAgc2V0TGFuZ3VhZ2UobmV3TGFuZ3VhZ2UpO1xuICAgICAgICAgICAgc2V0VGV4dChuZXdUZXh0KTtcbiAgICAgICAgICAgIHRyYWNrQ2xpY2soJ2xhbmdfc2VsZWN0JywgdHJhY2tpbmdEYXRhKTtcbiAgICAgICAgICAgIG9uTGFuZ3VhZ2VDaGFuZ2U/LihuZXdUZXh0LCBuZXdMYW5ndWFnZSk7XG4gICAgICAgICAgfX1cbiAgICAgICAgLz5cbiAgICAgICl9XG4gICAgPC9FZGl0b3JDb250YWluZXI+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBDb2RlQnl0ZUVkaXRvcjtcbiJdfQ== */");
44
-
45
- export var CodeByteEditor = function CodeByteEditor(_ref) {
46
- var initialText = _ref.text,
47
- initialLanguage = _ref.language,
48
- _ref$hideCopyButton = _ref.hideCopyButton,
49
- hideCopyButton = _ref$hideCopyButton === void 0 ? false : _ref$hideCopyButton,
50
- snippetsBaseUrl = _ref.snippetsBaseUrl,
51
- onEdit = _ref.onEdit,
52
- onLanguageChange = _ref.onLanguageChange,
53
- copyFormatter = _ref.copyFormatter,
54
- trackingData = _ref.trackingData,
55
- _ref$trackFirstEdit = _ref.trackFirstEdit,
56
- trackFirstEdit = _ref$trackFirstEdit === void 0 ? false : _ref$trackFirstEdit,
57
- rest = _objectWithoutProperties(_ref, _excluded);
58
-
59
- var _useEverInView = useEverInView(),
60
- everInView = _useEverInView.everInView,
61
- ref = _useEverInView.ref;
62
-
63
- var getInitialText = function getInitialText() {
64
- if (initialText !== undefined) return initialText;
65
- return initialLanguage ? helloWorld[initialLanguage] : '';
66
- };
67
-
68
- var _useState = useState(getInitialText()),
69
- _useState2 = _slicedToArray(_useState, 2),
70
- text = _useState2[0],
71
- setText = _useState2[1];
72
-
73
- var _useState3 = useState(initialLanguage !== null && initialLanguage !== void 0 ? initialLanguage : ''),
74
- _useState4 = _slicedToArray(_useState3, 2),
75
- language = _useState4[0],
76
- setLanguage = _useState4[1];
77
-
78
- var _useState5 = useState(false),
79
- _useState6 = _slicedToArray(_useState5, 2),
80
- hasBeenEdited = _useState6[0],
81
- setHasBeenEdited = _useState6[1];
82
-
83
- useEffect(function () {
84
- if (everInView) {
85
- var _trackingData$page_na, _trackingData$context;
86
-
87
- trackUserImpression({
88
- page_name: (_trackingData$page_na = trackingData === null || trackingData === void 0 ? void 0 : trackingData.page_name) !== null && _trackingData$page_na !== void 0 ? _trackingData$page_na : 'Unknown',
89
- context: (_trackingData$context = trackingData === null || trackingData === void 0 ? void 0 : trackingData.context) !== null && _trackingData$context !== void 0 ? _trackingData$context : document.referrer,
90
- target: 'codebyte'
91
- });
92
- }
93
- }, [everInView, trackingData]);
94
- return /*#__PURE__*/React.createElement(EditorContainer, _extends({
95
- bg: "black",
96
- maxWidth: "43rem"
97
- }, rest, {
98
- overflow: "hidden",
99
- ref: ref
100
- }), /*#__PURE__*/React.createElement(Box, {
101
- borderBottom: 1,
102
- borderColor: "gray-900",
103
- py: 4,
104
- pl: 8
105
- }, /*#__PURE__*/React.createElement(IconButton, {
106
- icon: FaviconIcon,
107
- variant: "secondary",
108
- href: "https://www.codecademy.com/",
109
- target: "_blank",
110
- rel: "noreferrer",
111
- "aria-label": "visit codecademy.com",
112
- onClick: function onClick() {
113
- return trackClick('logo', trackingData);
114
- }
115
- })), language ? /*#__PURE__*/React.createElement(Editor, {
116
- language: language,
117
- text: text,
118
- hideCopyButton: hideCopyButton,
119
- onChange: function onChange(newText) {
120
- setText(newText);
121
- onEdit === null || onEdit === void 0 ? void 0 : onEdit(newText, language);
122
-
123
- if (trackFirstEdit && hasBeenEdited === false) {
124
- setHasBeenEdited(true);
125
- trackClick('edit', trackingData);
126
- }
127
- },
128
- snippetsBaseUrl: snippetsBaseUrl,
129
- copyFormatter: copyFormatter,
130
- trackingData: trackingData
131
- }) : /*#__PURE__*/React.createElement(LanguageSelection, {
132
- onChange: function onChange(newLanguage) {
133
- var newText = text || (newLanguage ? helloWorld[newLanguage] : '');
134
- setLanguage(newLanguage);
135
- setText(newText);
136
- trackClick('lang_select', trackingData);
137
- onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(newText, newLanguage);
138
- }
139
- }));
140
- };
141
- export default CodeByteEditor;
package/dist/consts.js DELETED
@@ -1,34 +0,0 @@
1
- // key = language param to send to snippets service
2
- // val = label in language selection drop down
3
- export var LanguageOptions = {
4
- '': 'Select a language',
5
- cpp: 'C++',
6
- csharp: 'C#',
7
- golang: 'Go',
8
- javascript: 'JavaScript',
9
- php: 'PHP',
10
- python: 'Python 3',
11
- ruby: 'Ruby',
12
- scheme: 'Scheme'
13
- };
14
- export var validLanguages = Object.keys(LanguageOptions).filter(function (option) {
15
- return !!option;
16
- });
17
- var cpp = "#include <iostream>\nint main() {\n std::cout << \"Hello world!\";\n return 0;\n}";
18
- var csharp = "namespace HelloWorld {\n class Hello {\n static void Main(string[] args) {\n System.Console.WriteLine(\"Hello world!\");\n }\n }\n}";
19
- var golang = "package main\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello world!\")\n}";
20
- var javascript = "console.log('Hello world!');";
21
- var php = "<?php\n echo \"Hello world!\";\n?>";
22
- var python = "print('Hello world!')";
23
- var ruby = 'puts "Hello world!"';
24
- var scheme = "(begin\n (display \"Hello world!\")\n (newline))";
25
- export var helloWorld = {
26
- cpp: cpp,
27
- csharp: csharp,
28
- golang: golang,
29
- javascript: javascript,
30
- php: php,
31
- python: python,
32
- ruby: ruby,
33
- scheme: scheme
34
- };