@codecademy/codebytes 0.7.4-alpha.f1d7dd.0 → 0.7.5-alpha.01206f619.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.
- package/dist/MonacoEditor/colorsDark.d.ts +7 -7
- package/dist/MonacoEditor/index.d.ts +2 -1
- package/dist/MonacoEditor/types.js +1 -0
- package/dist/api.js +5 -3
- package/dist/codeByteEditor.js +4 -3
- package/dist/drawers.js +1 -1
- package/dist/editor.js +10 -8
- package/dist/helpers/index.js +2 -2
- package/dist/theme.d.ts +1 -0
- package/dist/types.js +1 -0
- package/package.json +25 -48
- package/CHANGELOG.md +0 -243
- package/dist/__tests__/codebyte-test.d.ts +0 -1
- package/dist/__tests__/codebyte-test.js +0 -155
- package/dist/__tests__/editor-test.d.ts +0 -1
- package/dist/__tests__/editor-test.js +0 -133
- package/dist/__tests__/helpers-test.d.ts +0 -1
- package/dist/__tests__/helpers-test.js +0 -36
- package/dist/__tests__/language-selection-test.d.ts +0 -1
- package/dist/__tests__/language-selection-test.js +0 -15
- package/dist/__tests__/mocks.d.ts +0 -0
- package/dist/__tests__/mocks.js +0 -13
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export declare const syntax: {
|
|
2
2
|
attribute: "#b4d353";
|
|
3
|
-
annotation: "#
|
|
3
|
+
annotation: "#ea6c8b";
|
|
4
4
|
atom: "#cc7bc2";
|
|
5
5
|
basic: "#ffffff";
|
|
6
6
|
comment: "#939598";
|
|
7
7
|
constant: "#ff8973";
|
|
8
|
-
decoration: "#
|
|
9
|
-
invalid: "#
|
|
8
|
+
decoration: "#ea6c8b";
|
|
9
|
+
invalid: "#ea6c8b";
|
|
10
10
|
key: "#83fff5";
|
|
11
11
|
keyword: "#b3ccff";
|
|
12
|
-
number: "#
|
|
13
|
-
operator: "#
|
|
12
|
+
number: "#ea6c8b";
|
|
13
|
+
operator: "#ea6c8b";
|
|
14
14
|
predefined: "#ffffff";
|
|
15
|
-
property: "#
|
|
15
|
+
property: "#ea6c8b";
|
|
16
16
|
regexp: "#b4d353";
|
|
17
17
|
string: "#ffe083";
|
|
18
|
-
tag: "#
|
|
18
|
+
tag: "#ea6c8b";
|
|
19
19
|
text: "#ff8973";
|
|
20
20
|
value: "#ffe083";
|
|
21
21
|
variable: "#b4d353";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { EditorProps } from '@monaco-editor/react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
export declare type SimpleMonacoEditorProps = {
|
|
3
4
|
value: string;
|
|
4
5
|
language: string;
|
|
5
|
-
onChange?:
|
|
6
|
+
onChange?: EditorProps['onChange'];
|
|
6
7
|
};
|
|
7
8
|
export declare const SimpleMonacoEditor: React.FC<SimpleMonacoEditorProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/api.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
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; }
|
|
2
4
|
|
|
3
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); } }
|
|
4
6
|
|
|
5
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); }); }; }
|
|
6
8
|
|
|
7
9
|
export var postSnippet = /*#__PURE__*/function () {
|
|
8
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data, snippetsBaseUrl) {
|
|
10
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, snippetsBaseUrl) {
|
|
9
11
|
var snippetsEndpoint, response;
|
|
10
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
12
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11
13
|
while (1) {
|
|
12
14
|
switch (_context.prev = _context.next) {
|
|
13
15
|
case 0:
|
package/dist/codeByteEditor.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
|
+
var _excluded = ["text", "language", "hideCopyButton", "snippetsBaseUrl", "onEdit", "onLanguageChange", "copyFormatter", "trackingData", "trackFirstEdit"];
|
|
2
3
|
|
|
3
|
-
function _extends() { _extends = Object.assign
|
|
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); }
|
|
4
5
|
|
|
5
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
7
|
|
|
@@ -10,7 +11,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
11
|
|
|
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; }
|
|
12
13
|
|
|
13
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
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; }
|
|
14
15
|
|
|
15
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
17
|
|
|
@@ -52,7 +53,7 @@ export var CodeByteEditor = function CodeByteEditor(_ref) {
|
|
|
52
53
|
trackingData = _ref.trackingData,
|
|
53
54
|
_ref$trackFirstEdit = _ref.trackFirstEdit,
|
|
54
55
|
trackFirstEdit = _ref$trackFirstEdit === void 0 ? false : _ref$trackFirstEdit,
|
|
55
|
-
rest = _objectWithoutProperties(_ref,
|
|
56
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
56
57
|
|
|
57
58
|
var getInitialText = function getInitialText() {
|
|
58
59
|
if (initialText !== undefined) return initialText;
|
package/dist/drawers.js
CHANGED
|
@@ -8,7 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
|
|
9
9
|
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; }
|
|
10
10
|
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
11
|
+
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; }
|
|
12
12
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
|
package/dist/editor.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
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
|
+
|
|
2
3
|
import _styled from "@emotion/styled/base";
|
|
3
4
|
|
|
5
|
+
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; }
|
|
6
|
+
|
|
4
7
|
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); } }
|
|
5
8
|
|
|
6
9
|
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); }); }; }
|
|
@@ -13,7 +16,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
13
16
|
|
|
14
17
|
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; }
|
|
15
18
|
|
|
16
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
19
|
+
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; }
|
|
17
20
|
|
|
18
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
22
|
|
|
@@ -34,7 +37,7 @@ var Output = _styled("pre", {
|
|
|
34
37
|
var hasError = _ref.hasError,
|
|
35
38
|
theme = _ref.theme;
|
|
36
39
|
return "\n color: ".concat(hasError ? theme.colors.orange : theme.colors.text, ";\n background-color: ").concat(theme.colors['navy-900'], ";\n");
|
|
37
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9lZGl0b3IudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1CZ0QiLCJmaWxlIjoiLi4vc3JjL2VkaXRvci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBGaWxsQnV0dG9uLFxuICBGbGV4Qm94LFxuICBTcGlubmVyLFxuICBUZXh0QnV0dG9uLFxuICB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ODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9lZGl0b3IudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1CZ0QiLCJmaWxlIjoiLi4vc3JjL2VkaXRvci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBGaWxsQnV0dG9uLFxuICBGbGV4Qm94LFxuICBTcGlubmVyLFxuICBUZXh0QnV0dG9uLFxuICBUb29sVGlwLFxufSBmcm9tICdAY29kZWNhZGVteS9nYW11dCc7XG5pbXBvcnQgeyBDb3B5SWNvbiB9IGZyb20gJ0Bjb2RlY2FkZW15L2dhbXV0LWljb25zJztcbmltcG9ydCB7IFVzZXJDbGlja0RhdGEgfSBmcm9tICdAY29kZWNhZGVteS90cmFja2luZyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgUmVhY3QsIHsgdXNlU3RhdGUgfSBmcm9tICdyZWFjdCc7XG5cbmltcG9ydCB7IHBvc3RTbmlwcGV0IH0gZnJvbSAnLi9hcGknO1xuaW1wb3J0IHR5cGUgeyBMYW5ndWFnZU9wdGlvbiB9IGZyb20gJy4vY29uc3RzJztcbmltcG9ydCB7IERyYXdlcnMgfSBmcm9tICcuL2RyYXdlcnMnO1xuaW1wb3J0IHsgdHJhY2tDbGljayB9IGZyb20gJy4vaGVscGVycyc7XG5pbXBvcnQgeyBTaW1wbGVNb25hY29FZGl0b3IgfSBmcm9tICcuL01vbmFjb0VkaXRvcic7XG5pbXBvcnQgeyBDb2RlYnl0ZXNDb3B5Rm9ybWF0dGVyIH0gZnJvbSAnLi90eXBlcyc7XG5cbmNvbnN0IE91dHB1dCA9IHN0eWxlZC5wcmU8eyBoYXNFcnJvcjogYm9vbGVhbiB9PmBcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogMTAwJTt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ICAgICAgICA8L1RleHRCdXR0b24+XG4gICAgICAgICAgICB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2lzQ29kZUJ5dGVDb3BpZWQgPyAoXG4gICAgICAgICAgICAgIDxzcGFuIGRhdGEtdGVzdGlkPVwiY29weS1jb25maXJtYXRpb24tdG9vbHRpcFwiIHJvbGU9XCJhbGVydFwiPlxuICAgICAgICAgICAgICAgIENvcGllZCFcbiAgICAgICAgICAgICAgPC9zcGFuPlxuICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgPHNwYW4gZGF0YS10ZXN0aWQ9XCJjb3B5LXByb21wdC10b29sdGlwXCI+XG4gICAgICAgICAgICAgICAgQ29weSB0byB5b3VyIGNsaXBib2FyZFxuICAgICAgICAgICAgICA8L3NwYW4+XG4gICAgICAgICAgICApfVxuICAgICAgICAgIDwvVG9vbFRpcD5cbiAgICAgICAgKSA6IG51bGx9XG4gICAgICAgIDxGaWxsQnV0dG9uIG9uQ2xpY2s9e2hhbmRsZVN1Ym1pdH0+XG4gICAgICAgICAge3N0YXR1cyA9PT0gJ3dhaXRpbmcnID8gPFNwaW5uZXIgLz4gOiAnUnVuJ31cbiAgICAgICAgPC9GaWxsQnV0dG9uPlxuICAgICAgPC9GbGV4Qm94PlxuICAgIDwvPlxuICApO1xufTtcbiJdfQ== */"));
|
|
38
41
|
|
|
39
42
|
var CopyIconStyled = /*#__PURE__*/_styled(CopyIcon, {
|
|
40
43
|
target: "e1lzxy8e0",
|
|
@@ -45,7 +48,7 @@ var CopyIconStyled = /*#__PURE__*/_styled(CopyIcon, {
|
|
|
45
48
|
} : {
|
|
46
49
|
name: "u7ytkp",
|
|
47
50
|
styles: "margin-right:0.5rem",
|
|
48
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9lZGl0b3IudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWlDdUMiLCJ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gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8Q29weUljb25TdHlsZWQgYXJpYS1oaWRkZW49XCJ0cnVlXCIgLz4gQ29weSBDb2RlYnl0ZVxuICAgICAgICAgICAgICA8L1RleHRCdXR0b24+XG4gICAgICAgICAgICB9XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2lzQ29kZUJ5dGVDb3BpZWQgPyAoXG4gICAgICAgICAgICAgIDxzcGFuIGRhdGEtdGVzdGlkPVwiY29weS1jb25maXJtYXRpb24tdG9vbHRpcFwiIHJvbGU9XCJhbGVydFwiPlxuICAgICAgICAgICAgICAgIENvcGllZCFcbiAgICAgICAgICAgICAgPC9zcGFuPlxuICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgPHNwYW4gZGF0YS10ZXN0aWQ9XCJjb3B5LXByb21wdC10b29sdGlwXCI+XG4gICAgICAgICAgICAgICAgQ29weSB0byB5b3VyIGNsaXBib2FyZFxuICAgICAgICAgICAgICA8L3NwYW4+XG4gICAgICAgICAgICApfVxuICAgICAgICAgIDwvVG9vbFRpcD5cbiAgICAgICAgKSA6IG51bGx9XG4gICAgICAgIDxGaWxsQnV0dG9uIG9uQ2xpY2s9e2hhbmRsZVN1Ym1pdH0+XG4gICAgICAgICAge3N0YXR1cyA9PT0gJ3dhaXRpbmcnID8gPFNwaW5uZXIgLz4gOiAnUnVuJ31cbiAgICAgICAgPC9GaWxsQnV0dG9uPlxuICAgICAgPC9GbGV4Qm94PlxuICAgIDwvPlxuICApO1xufTtcbiJdfQ== */",
|
|
49
52
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
50
53
|
});
|
|
51
54
|
|
|
@@ -80,7 +83,7 @@ export var Editor = function Editor(_ref2) {
|
|
|
80
83
|
text: text,
|
|
81
84
|
language: language
|
|
82
85
|
}) : text) // eslint-disable-next-line no-console
|
|
83
|
-
|
|
86
|
+
.catch(function () {
|
|
84
87
|
return console.error('Failed to copy');
|
|
85
88
|
});
|
|
86
89
|
setIsCodeByteCopied(true);
|
|
@@ -94,9 +97,9 @@ export var Editor = function Editor(_ref2) {
|
|
|
94
97
|
};
|
|
95
98
|
|
|
96
99
|
var handleSubmit = /*#__PURE__*/function () {
|
|
97
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
100
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
98
101
|
var data, response;
|
|
99
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
102
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
100
103
|
while (1) {
|
|
101
104
|
switch (_context.prev = _context.next) {
|
|
102
105
|
case 0:
|
|
@@ -170,7 +173,6 @@ export var Editor = function Editor(_ref2) {
|
|
|
170
173
|
}, !hideCopyButton ? /*#__PURE__*/React.createElement(ToolTip, {
|
|
171
174
|
id: "codebyte-copied",
|
|
172
175
|
alignment: "top-right",
|
|
173
|
-
mode: "dark",
|
|
174
176
|
target: /*#__PURE__*/React.createElement(TextButton, {
|
|
175
177
|
variant: "secondary",
|
|
176
178
|
onClick: onCopyClick,
|
package/dist/helpers/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
2
|
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
package/dist/theme.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,68 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/codebytes",
|
|
3
3
|
"description": "Codebytes Code Editor",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.5-alpha.01206f619.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"**/*.css",
|
|
8
|
-
"**/*.scss",
|
|
9
|
-
"dist/**/[A-Z]**/[A-Z]*.js",
|
|
10
|
-
"dist/**/[A-Z]**/index.js"
|
|
11
|
-
],
|
|
12
|
-
"module": "./dist/index.js",
|
|
13
|
-
"main": "./dist/index.js",
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git@github.com:Codecademy/client-modules.git"
|
|
17
|
-
},
|
|
18
|
-
"peerDependencies": {
|
|
19
|
-
"@codecademy/gamut": "*",
|
|
20
|
-
"@codecademy/gamut-icons": "*",
|
|
21
|
-
"@codecademy/gamut-styles": "*",
|
|
22
|
-
"@codecademy/tracking": ">=0.17.0",
|
|
23
|
-
"@codecademy/variance": "*",
|
|
24
|
-
"react": ">=16.8.1",
|
|
25
|
-
"react-dom": ">=16.8.1"
|
|
26
|
-
},
|
|
27
6
|
"dependencies": {
|
|
28
|
-
"@emotion/react": "
|
|
29
|
-
"@emotion/styled": "
|
|
30
|
-
"@monaco-editor/react": "4.
|
|
7
|
+
"@emotion/react": "11.10.0",
|
|
8
|
+
"@emotion/styled": "11.10.0",
|
|
9
|
+
"@monaco-editor/react": "^4.4.5",
|
|
31
10
|
"js-base64": "^3.6.0",
|
|
32
11
|
"jsuri": "^1.3.1",
|
|
33
|
-
"monaco-editor": ">= 0.25.0 < 1",
|
|
34
12
|
"react-resize-observer": "^1.1.1"
|
|
35
13
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"build:clean": "rm -rf dist",
|
|
40
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
41
|
-
"build": "yarn build:clean && yarn build:compile && yarn build:types",
|
|
42
|
-
"build:watch": "yarn build && onchange ./src -- yarn build:compile && yarn build:types"
|
|
43
|
-
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/**"
|
|
16
|
+
],
|
|
44
17
|
"license": "MIT",
|
|
45
|
-
"
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"module": "./dist/index.js",
|
|
20
|
+
"peerDependencies": {
|
|
46
21
|
"@codecademy/gamut": "*",
|
|
47
22
|
"@codecademy/gamut-icons": "*",
|
|
48
23
|
"@codecademy/gamut-styles": "*",
|
|
49
|
-
"@codecademy/
|
|
50
|
-
"@codecademy/tracking": "0.25.1-alpha.f1d7dd.0",
|
|
24
|
+
"@codecademy/tracking": "^0.26.0",
|
|
51
25
|
"@codecademy/variance": "*",
|
|
52
|
-
"@emotion/
|
|
53
|
-
"@
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"@testing-library/user-event": "13.1.1",
|
|
57
|
-
"@types/jsuri": "^1.3.30",
|
|
58
|
-
"@types/loadable__component": "^5.13.2",
|
|
59
|
-
"monaco-editor-webpack-plugin": "1.9.1"
|
|
26
|
+
"@emotion/react": "^11.7.1",
|
|
27
|
+
"@emotion/styled": "11.3.0",
|
|
28
|
+
"react": ">=16.8.1",
|
|
29
|
+
"react-dom": ">=16.8.1"
|
|
60
30
|
},
|
|
61
31
|
"publishConfig": {
|
|
62
32
|
"access": "public"
|
|
63
33
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
34
|
+
"repository": "git@github.com:Codecademy/client-modules.git",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build:watch": "yarn build:clean && yarn build:compile && yarn build:types && onchange ./src -- yarn build:compile && yarn build:types"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": [
|
|
39
|
+
"**/*.css",
|
|
40
|
+
"**/*.scss",
|
|
41
|
+
"dist/**/[A-Z]**/[A-Z]*.js",
|
|
42
|
+
"dist/**/[A-Z]**/index.js"
|
|
66
43
|
],
|
|
67
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "8123297aab156a0335f126c6775cfd89c625b2a9"
|
|
68
45
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
### [0.7.4-alpha.f1d7dd.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.7.3...@codecademy/codebytes@0.7.4-alpha.f1d7dd.0) (2022-10-27)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### [0.7.3](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.7.2...@codecademy/codebytes@0.7.3) (2022-09-16)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### [0.7.2](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.7.1...@codecademy/codebytes@0.7.2) (2022-08-24)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### [0.7.1](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.7.0...@codecademy/codebytes@0.7.1) (2022-05-24)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## [0.7.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.16...@codecademy/codebytes@0.7.0) (2022-05-19)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### ⚠ BREAKING CHANGES
|
|
42
|
-
|
|
43
|
-
* **CodeByteEditor:** Add copyFormatter prop (#51)
|
|
44
|
-
|
|
45
|
-
### Features
|
|
46
|
-
|
|
47
|
-
* **CodeByteEditor:** Add copyFormatter prop ([#51](https://github.com/Codecademy/client-modules/issues/51)) ([39b5229](https://github.com/Codecademy/client-modules/commit/39b52291c3db6307203100bb216b852e7e07bc9e))
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### [0.6.16](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.15...@codecademy/codebytes@0.6.16) (2022-05-16)
|
|
52
|
-
|
|
53
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### [0.6.15](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.14...@codecademy/codebytes@0.6.15) (2022-05-13)
|
|
60
|
-
|
|
61
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### [0.6.14](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.13...@codecademy/codebytes@0.6.14) (2022-05-13)
|
|
68
|
-
|
|
69
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
### [0.6.13](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.12...@codecademy/codebytes@0.6.13) (2022-04-11)
|
|
76
|
-
|
|
77
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
### [0.6.12](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.11...@codecademy/codebytes@0.6.12) (2022-03-10)
|
|
84
|
-
|
|
85
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### [0.6.11](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.10...@codecademy/codebytes@0.6.11) (2022-03-07)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
### Bug Fixes
|
|
95
|
-
|
|
96
|
-
* fixes a monaco editor display bug for lines below 14-17 ([9780410](https://github.com/Codecademy/client-modules/commit/97804100dea13fe92b6e4d58bfbec4667af5d96c))
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
### [0.6.10](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.9...@codecademy/codebytes@0.6.10) (2022-02-09)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
### Bug Fixes
|
|
104
|
-
|
|
105
|
-
* remove get options from client modules ([6bf7b94](https://github.com/Codecademy/client-modules/commit/6bf7b94876f1c6c1e15b0da2b5393bc1f8151535))
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
### [0.6.9](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.8...@codecademy/codebytes@0.6.9) (2022-02-07)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
### Bug Fixes
|
|
113
|
-
|
|
114
|
-
* **codebytes:** style tweaks ([#33](https://github.com/Codecademy/client-modules/issues/33)) ([6722a8a](https://github.com/Codecademy/client-modules/commit/6722a8accb9dcf88b7508903fdec1f155b010d96))
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### [0.6.8](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.7...@codecademy/codebytes@0.6.8) (2022-02-05)
|
|
119
|
-
|
|
120
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### [0.6.7](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.6...@codecademy/codebytes@0.6.7) (2022-02-05)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
### Bug Fixes
|
|
130
|
-
|
|
131
|
-
* **codebytes:** semantic text color ([8c5e59b](https://github.com/Codecademy/client-modules/commit/8c5e59b25af3e7f92e4bf3f6bb9de198eec5a3e0))
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
### [0.6.6](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.5...@codecademy/codebytes@0.6.6) (2022-02-03)
|
|
136
|
-
|
|
137
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
### [0.6.5](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.4...@codecademy/codebytes@0.6.5) (2022-02-03)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
### Bug Fixes
|
|
147
|
-
|
|
148
|
-
* **Codebytes:** tracking tweaks for monolith ([#31](https://github.com/Codecademy/client-modules/issues/31)) ([4d309d0](https://github.com/Codecademy/client-modules/commit/4d309d0f57c7c30bf672d8ed02193e9d5b2a27a9))
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
### [0.6.4](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.3...@codecademy/codebytes@0.6.4) (2022-02-02)
|
|
153
|
-
|
|
154
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
### [0.6.3](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.2...@codecademy/codebytes@0.6.3) (2022-02-02)
|
|
161
|
-
|
|
162
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
### [0.6.2](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.1...@codecademy/codebytes@0.6.2) (2022-02-02)
|
|
169
|
-
|
|
170
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
### [0.6.1](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.6.0...@codecademy/codebytes@0.6.1) (2022-02-01)
|
|
177
|
-
|
|
178
|
-
**Note:** Version bump only for package @codecademy/codebytes
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
## [0.6.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.5.1...@codecademy/codebytes@0.6.0) (2022-01-31)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
### Features
|
|
188
|
-
|
|
189
|
-
* **Codebytes:** add tests for codebytes package disc 399 ([#21](https://github.com/Codecademy/client-modules/issues/21)) ([df3f780](https://github.com/Codecademy/client-modules/commit/df3f780237cbe31b620f7d88870612e1109ffb5b))
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
### [0.5.1](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.5.0...@codecademy/codebytes@0.5.1) (2022-01-29)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
### Reverts
|
|
197
|
-
|
|
198
|
-
* Revert "add yarn build task for codebytes (#23)" (#24) ([209a493](https://github.com/Codecademy/client-modules/commit/209a4935066ed1cf7e6932281218338c67ab088b)), closes [#23](https://github.com/Codecademy/client-modules/issues/23) [#24](https://github.com/Codecademy/client-modules/issues/24)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
## [0.5.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.4.0...@codecademy/codebytes@0.5.0) (2022-01-27)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
### Features
|
|
206
|
-
|
|
207
|
-
* **Codebytes:** Refactor tracking in Codebytes ([#19](https://github.com/Codecademy/client-modules/issues/19)) ([494a944](https://github.com/Codecademy/client-modules/commit/494a94441cfbc1ea563f997607821131a7f1e007))
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
## [0.4.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.3.0...@codecademy/codebytes@0.4.0) (2022-01-21)
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
### Features
|
|
215
|
-
|
|
216
|
-
* **Codebytes:** move language selection component disc 354 ([#17](https://github.com/Codecademy/client-modules/issues/17)) ([040553d](https://github.com/Codecademy/client-modules/commit/040553dcc7867b6e331712365bcc19ea2df306d5))
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
## [0.3.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.2.0...@codecademy/codebytes@0.3.0) (2022-01-12)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
### Features
|
|
224
|
-
|
|
225
|
-
* **Codebytes:** add simple monaco editor disc 353 ([#16](https://github.com/Codecademy/client-modules/issues/16)) ([eec98ba](https://github.com/Codecademy/client-modules/commit/eec98ba9aad45f07fb5f3417e3da1e1935985deb))
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
## [0.2.0](https://github.com/Codecademy/client-modules/compare/@codecademy/codebytes@0.1.0...@codecademy/codebytes@0.2.0) (2022-01-04)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
### Features
|
|
233
|
-
|
|
234
|
-
* **Codebytes:** add editor and drawers disc 351 ([#14](https://github.com/Codecademy/client-modules/issues/14)) ([e84e265](https://github.com/Codecademy/client-modules/commit/e84e265e4cf4bf8360830ebf2dbea930ab503c9c))
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
## 0.1.0 (2021-12-17)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
### Features
|
|
242
|
-
|
|
243
|
-
* **Codebytes:** move codebytes parent disc 351 ([#11](https://github.com/Codecademy/client-modules/issues/11)) ([30edd2b](https://github.com/Codecademy/client-modules/commit/30edd2b7a0e50c27d3adcf231b56441b8e8f6b81))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './mocks';
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import './mocks';
|
|
2
|
-
import { setupRtl } from '@codecademy/gamut-tests';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { CodeByteEditor } from '..';
|
|
6
|
-
import { helloWorld, validLanguages } from '../consts';
|
|
7
|
-
import { trackClick } from '../helpers';
|
|
8
|
-
import { trackUserImpression } from '../libs/eventTracking';
|
|
9
|
-
var mockEditorTestId = 'mock-editor-test-id'; // This is a super simplified mock capable of render value and trigger onChange.
|
|
10
|
-
|
|
11
|
-
jest.mock('../MonacoEditor', function () {
|
|
12
|
-
return {
|
|
13
|
-
SimpleMonacoEditor: function SimpleMonacoEditor(_ref) {
|
|
14
|
-
var value = _ref.value,
|
|
15
|
-
_onChange = _ref.onChange;
|
|
16
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, value, /*#__PURE__*/React.createElement("input", {
|
|
17
|
-
"data-testid": mockEditorTestId,
|
|
18
|
-
type: "text",
|
|
19
|
-
onChange: function onChange(e) {
|
|
20
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(e.target.value);
|
|
21
|
-
},
|
|
22
|
-
value: value
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
var renderWrapper = setupRtl(CodeByteEditor, {});
|
|
28
|
-
describe('CodeBytes', function () {
|
|
29
|
-
var initialUrl = window.location.href;
|
|
30
|
-
afterEach(function () {
|
|
31
|
-
window.history.replaceState(null, '', initialUrl);
|
|
32
|
-
trackClick.mockReset();
|
|
33
|
-
trackUserImpression.mockReset();
|
|
34
|
-
});
|
|
35
|
-
it('has a language-specific "hello world" program defined for each language', function () {
|
|
36
|
-
validLanguages.forEach(function (language) {
|
|
37
|
-
expect(helloWorld[language]).toBeDefined();
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
it('initializes with a language-specific "hello world" program when there is no language prop', function () {
|
|
41
|
-
var _renderWrapper = renderWrapper(),
|
|
42
|
-
view = _renderWrapper.view;
|
|
43
|
-
|
|
44
|
-
var selectedLanguage = view.getByRole('combobox');
|
|
45
|
-
userEvent.selectOptions(selectedLanguage, ['javascript']);
|
|
46
|
-
view.getByText(helloWorld.javascript);
|
|
47
|
-
});
|
|
48
|
-
it('initializes with a language-specific "hello world" program when there is a language prop but no text prop', function () {
|
|
49
|
-
var _renderWrapper2 = renderWrapper({
|
|
50
|
-
language: 'javascript'
|
|
51
|
-
}),
|
|
52
|
-
view = _renderWrapper2.view;
|
|
53
|
-
|
|
54
|
-
view.getByText(helloWorld.javascript);
|
|
55
|
-
});
|
|
56
|
-
it('initializes with deserialized text when there is a text prop but no language prop', function () {
|
|
57
|
-
var testString = 'yes hello';
|
|
58
|
-
|
|
59
|
-
var _renderWrapper3 = renderWrapper({
|
|
60
|
-
text: testString
|
|
61
|
-
}),
|
|
62
|
-
view = _renderWrapper3.view;
|
|
63
|
-
|
|
64
|
-
var selectedLanguage = view.getByRole('combobox');
|
|
65
|
-
userEvent.selectOptions(selectedLanguage, ['javascript']);
|
|
66
|
-
view.getByText(testString);
|
|
67
|
-
});
|
|
68
|
-
it('initializes with deserialized text when there is both a language and text prop', function () {
|
|
69
|
-
var testString = 'yes hello';
|
|
70
|
-
|
|
71
|
-
var _renderWrapper4 = renderWrapper({
|
|
72
|
-
text: testString,
|
|
73
|
-
language: 'javascript'
|
|
74
|
-
}),
|
|
75
|
-
view = _renderWrapper4.view;
|
|
76
|
-
|
|
77
|
-
view.getByText(testString);
|
|
78
|
-
});
|
|
79
|
-
describe('Change Handlers', function () {
|
|
80
|
-
it('triggers onEdit on text edit', function () {
|
|
81
|
-
var onEdit = jest.fn();
|
|
82
|
-
|
|
83
|
-
var _renderWrapper5 = renderWrapper({
|
|
84
|
-
text: '',
|
|
85
|
-
language: 'javascript',
|
|
86
|
-
onEdit: onEdit
|
|
87
|
-
}),
|
|
88
|
-
view = _renderWrapper5.view;
|
|
89
|
-
|
|
90
|
-
var editor = view.getByTestId(mockEditorTestId);
|
|
91
|
-
userEvent.type(editor, 'dog');
|
|
92
|
-
expect(onEdit).toHaveBeenCalledTimes(3);
|
|
93
|
-
expect(onEdit).toHaveBeenLastCalledWith('dog', 'javascript');
|
|
94
|
-
});
|
|
95
|
-
it('triggers onLanguageChange on language selection', function () {
|
|
96
|
-
var onLanguageChange = jest.fn();
|
|
97
|
-
|
|
98
|
-
var _renderWrapper6 = renderWrapper({
|
|
99
|
-
onLanguageChange: onLanguageChange
|
|
100
|
-
}),
|
|
101
|
-
view = _renderWrapper6.view;
|
|
102
|
-
|
|
103
|
-
var selectedLanguage = view.getByRole('combobox');
|
|
104
|
-
userEvent.selectOptions(selectedLanguage, ['javascript']);
|
|
105
|
-
expect(onLanguageChange).toHaveBeenCalledWith("console.log('Hello world!');", 'javascript');
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
describe('Tracking', function () {
|
|
109
|
-
it('triggers trackClick on clicking the logo', function () {
|
|
110
|
-
var _renderWrapper7 = renderWrapper({}),
|
|
111
|
-
view = _renderWrapper7.view;
|
|
112
|
-
|
|
113
|
-
var logo = view.getByLabelText('visit codecademy.com');
|
|
114
|
-
userEvent.click(logo);
|
|
115
|
-
expect(trackClick).toHaveBeenCalledWith('logo', undefined);
|
|
116
|
-
});
|
|
117
|
-
it('triggers trackClick on language selection', function () {
|
|
118
|
-
var _renderWrapper8 = renderWrapper(),
|
|
119
|
-
view = _renderWrapper8.view;
|
|
120
|
-
|
|
121
|
-
var selectedLanguage = view.getByRole('combobox');
|
|
122
|
-
userEvent.selectOptions(selectedLanguage, ['javascript']);
|
|
123
|
-
expect(trackClick).toHaveBeenCalledWith('lang_select', undefined);
|
|
124
|
-
});
|
|
125
|
-
it('triggers trackClick for the first edit', function () {
|
|
126
|
-
var testString = 'original-value';
|
|
127
|
-
|
|
128
|
-
var _renderWrapper9 = renderWrapper({
|
|
129
|
-
text: testString,
|
|
130
|
-
language: 'javascript',
|
|
131
|
-
trackFirstEdit: true
|
|
132
|
-
}),
|
|
133
|
-
view = _renderWrapper9.view;
|
|
134
|
-
|
|
135
|
-
var editor = view.getByTestId(mockEditorTestId);
|
|
136
|
-
userEvent.type(editor, 'd');
|
|
137
|
-
expect(trackClick).toHaveBeenCalledWith('edit', undefined);
|
|
138
|
-
});
|
|
139
|
-
it('triggers trackUserImpression', function () {
|
|
140
|
-
renderWrapper({
|
|
141
|
-
text: 'some-value',
|
|
142
|
-
language: 'javascript',
|
|
143
|
-
trackingData: {
|
|
144
|
-
page_name: 'forum_compose',
|
|
145
|
-
context: 'https://discuss.codecademy.com/some-interesting/post'
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
expect(trackUserImpression).toHaveBeenCalledWith({
|
|
149
|
-
page_name: 'forum_compose',
|
|
150
|
-
context: 'https://discuss.codecademy.com/some-interesting/post',
|
|
151
|
-
target: 'codebyte'
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './mocks';
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
-
|
|
3
|
-
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); } }
|
|
4
|
-
|
|
5
|
-
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); }); }; }
|
|
6
|
-
|
|
7
|
-
import './mocks';
|
|
8
|
-
import { setupRtl } from '@codecademy/gamut-tests';
|
|
9
|
-
import { act } from '@testing-library/react';
|
|
10
|
-
import userEvent from '@testing-library/user-event';
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { Editor } from '../editor';
|
|
13
|
-
import { trackClick } from '../helpers';
|
|
14
|
-
jest.mock('../MonacoEditor', function () {
|
|
15
|
-
return {
|
|
16
|
-
SimpleMonacoEditor: function SimpleMonacoEditor(_ref) {
|
|
17
|
-
var value = _ref.value;
|
|
18
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, value);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
var renderWrapper = setupRtl(Editor, {
|
|
23
|
-
hideCopyButton: false,
|
|
24
|
-
language: 'javascript',
|
|
25
|
-
text: 'hello world',
|
|
26
|
-
onChange: jest.fn(),
|
|
27
|
-
snippetsBaseUrl: ''
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(navigator, 'clipboard', {
|
|
30
|
-
value: {
|
|
31
|
-
writeText: jest.fn().mockImplementation(function () {
|
|
32
|
-
return Promise.resolve();
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
describe('Editor', function () {
|
|
37
|
-
global.fetch = jest.fn();
|
|
38
|
-
afterEach(function () {
|
|
39
|
-
global.fetch.mockClear();
|
|
40
|
-
});
|
|
41
|
-
it('shows a prompt tooltip when the CodeByte has __not__ been copied via the button', function () {
|
|
42
|
-
var _renderWrapper = renderWrapper(),
|
|
43
|
-
view = _renderWrapper.view;
|
|
44
|
-
|
|
45
|
-
expect(view.queryByTestId('copy-confirmation-tooltip')).toBeFalsy();
|
|
46
|
-
view.getByTestId('copy-prompt-tooltip');
|
|
47
|
-
});
|
|
48
|
-
it('shows a confirmation tooltip when the CodeByte has been copied via the button', function () {
|
|
49
|
-
var _renderWrapper2 = renderWrapper(),
|
|
50
|
-
view = _renderWrapper2.view;
|
|
51
|
-
|
|
52
|
-
var copyBtn = view.getByTestId('copy-codebyte-btn');
|
|
53
|
-
userEvent.click(copyBtn);
|
|
54
|
-
expect(view.queryByTestId('copy-prompt-tooltip')).toBeFalsy();
|
|
55
|
-
view.getByTestId('copy-confirmation-tooltip');
|
|
56
|
-
});
|
|
57
|
-
it('hides the copy codebyte button if hideCopyButton prop is true"', function () {
|
|
58
|
-
var _renderWrapper3 = renderWrapper({
|
|
59
|
-
hideCopyButton: true
|
|
60
|
-
}),
|
|
61
|
-
view = _renderWrapper3.view;
|
|
62
|
-
|
|
63
|
-
expect(view.queryByTestId('copy-codebyte-btn')).toBeNull();
|
|
64
|
-
});
|
|
65
|
-
it('shows the copy codebyte button if hideCopyButton prop is not set', function () {
|
|
66
|
-
var _renderWrapper4 = renderWrapper(),
|
|
67
|
-
view = _renderWrapper4.view;
|
|
68
|
-
|
|
69
|
-
view.getByTestId('copy-codebyte-btn');
|
|
70
|
-
});
|
|
71
|
-
describe('Tracking', function () {
|
|
72
|
-
it('tracks clicks on the run button', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
73
|
-
var _renderWrapper5, view, runButton;
|
|
74
|
-
|
|
75
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
76
|
-
while (1) {
|
|
77
|
-
switch (_context2.prev = _context2.next) {
|
|
78
|
-
case 0:
|
|
79
|
-
global.fetch.mockResolvedValue({
|
|
80
|
-
json: function json() {
|
|
81
|
-
return Promise.resolve({
|
|
82
|
-
stderr: [],
|
|
83
|
-
exit_code: 0,
|
|
84
|
-
stdout: ''
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
_renderWrapper5 = renderWrapper({
|
|
89
|
-
onChange: jest.fn(),
|
|
90
|
-
text: 'test',
|
|
91
|
-
language: 'javascript'
|
|
92
|
-
}), view = _renderWrapper5.view;
|
|
93
|
-
runButton = view.getByText('Run');
|
|
94
|
-
_context2.next = 5;
|
|
95
|
-
return act( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
96
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
97
|
-
while (1) {
|
|
98
|
-
switch (_context.prev = _context.next) {
|
|
99
|
-
case 0:
|
|
100
|
-
userEvent.click(runButton);
|
|
101
|
-
|
|
102
|
-
case 1:
|
|
103
|
-
case "end":
|
|
104
|
-
return _context.stop();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}, _callee);
|
|
108
|
-
})));
|
|
109
|
-
|
|
110
|
-
case 5:
|
|
111
|
-
expect(trackClick).toHaveBeenCalledWith('run', undefined);
|
|
112
|
-
|
|
113
|
-
case 6:
|
|
114
|
-
case "end":
|
|
115
|
-
return _context2.stop();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}, _callee2);
|
|
119
|
-
})));
|
|
120
|
-
it('tracks clicks on the copy codebyte button', function () {
|
|
121
|
-
var _renderWrapper6 = renderWrapper({
|
|
122
|
-
onChange: jest.fn(),
|
|
123
|
-
text: 'test',
|
|
124
|
-
language: 'javascript'
|
|
125
|
-
}),
|
|
126
|
-
view = _renderWrapper6.view;
|
|
127
|
-
|
|
128
|
-
var copyButton = view.getByTestId('copy-codebyte-btn');
|
|
129
|
-
userEvent.click(copyButton);
|
|
130
|
-
expect(trackClick).toHaveBeenCalledWith('copy', undefined);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { trackClick } from '../helpers';
|
|
2
|
-
import { trackUserClick } from '../libs/eventTracking';
|
|
3
|
-
jest.mock('../libs/eventTracking');
|
|
4
|
-
var initialUrl = window.location.href;
|
|
5
|
-
|
|
6
|
-
var resetCodebytesParams = function resetCodebytesParams() {
|
|
7
|
-
return window.history.replaceState(null, '', initialUrl);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
describe('trackClick', function () {
|
|
11
|
-
afterEach(function () {
|
|
12
|
-
resetCodebytesParams();
|
|
13
|
-
trackUserClick.mockReset();
|
|
14
|
-
});
|
|
15
|
-
it('tracks user click when tracking data is provided', function () {
|
|
16
|
-
var target = 'foobar';
|
|
17
|
-
var trackingData = {
|
|
18
|
-
page_name: 'forum',
|
|
19
|
-
context: 'https://discuss.codecademy.com/some-interesting/post',
|
|
20
|
-
target: target
|
|
21
|
-
};
|
|
22
|
-
trackClick(target, trackingData);
|
|
23
|
-
expect(trackUserClick).toHaveBeenCalledWith({
|
|
24
|
-
page_name: 'forum',
|
|
25
|
-
context: 'https://discuss.codecademy.com/some-interesting/post',
|
|
26
|
-
target: target
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
it('tracks user click when tracking data is not provided', function () {
|
|
30
|
-
var target = 'foobar';
|
|
31
|
-
trackClick(target);
|
|
32
|
-
expect(trackUserClick).toHaveBeenCalledWith({
|
|
33
|
-
target: target
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { setupRtl } from '@codecademy/gamut-tests';
|
|
2
|
-
import { LanguageSelection } from '../languageSelection';
|
|
3
|
-
var renderWrapper = setupRtl(LanguageSelection, {
|
|
4
|
-
onChange: function onChange() {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
});
|
|
8
|
-
describe('LanguageSelection', function () {
|
|
9
|
-
it('has placeholder text', function () {
|
|
10
|
-
var _renderWrapper = renderWrapper(),
|
|
11
|
-
view = _renderWrapper.view;
|
|
12
|
-
|
|
13
|
-
view.getByText('Which language do you want to code in?');
|
|
14
|
-
});
|
|
15
|
-
});
|
|
File without changes
|
package/dist/__tests__/mocks.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
|
-
jest.mock('react-resize-observer');
|
|
8
|
-
jest.mock('../libs/eventTracking');
|
|
9
|
-
jest.mock('../helpers', function () {
|
|
10
|
-
return _objectSpread(_objectSpread({}, jest.requireActual('../helpers')), {}, {
|
|
11
|
-
trackClick: jest.fn()
|
|
12
|
-
});
|
|
13
|
-
});
|