├── README.md ├── bundles ├── covalent-code-editor.umd.js ├── covalent-code-editor.umd.js.map ├── covalent-code-editor.umd.min.js └── covalent-code-editor.umd.min.js.map ├── code-editor.component.d.ts ├── code-editor.component.scss ├── code-editor.module.d.ts ├── covalent-code-editor.d.ts ├── covalent-code-editor.metadata.json ├── esm2015 ├── code-editor.component.js ├── code-editor.module.js ├── covalent-code-editor.js ├── index.js └── public-api.js ├── fesm2015 ├── covalent-code-editor.js └── covalent-code-editor.js.map ├── index.d.ts ├── package.json └── public-api.d.ts /README.md: -------------------------------------------------------------------------------- 1 | ## TdCodeEditorComponent: td-code-editor 2 | 3 | `` is component for code editing based on Covalent and Monaco Editor. The component can run in both Electron and Web Browsers. 4 | 5 | ## API Summary 6 | 7 | #### Inputs 8 | 9 | + value?: string 10 | + value of the code editor instance 11 | + language?: string 12 | + language used for syntax in the editor instance 13 | + registerLanguage?: function() 14 | + registers a custom Language within the editor 15 | + editorStyle?: string 16 | + Additional Styling applied to Editor Container 17 | + theme?: string 18 | + Theme used to style the Editor 19 | + editorOptions?: object 20 | + Editor Options Object of valid Configurations listed here: https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html 21 | + layout?: function() 22 | + Instructs the editor to remeasure its container 23 | 24 | #### Properties 25 | 26 | + isFullScreen?: boolean 27 | + Is the editor currently in Full Screen mode 28 | + fullScreenKeyBinding?: number 29 | + Sets the KeyCode for shortcutting to Fullscreen. Options listed see here: https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html 30 | 31 | #### Events 32 | 33 | + editorInitialized?: function($event) 34 | + Emitted when Editor is finished initializing. Event passes a reference to the actual editor instance that can be used to call additional operations outside of the Angular component. 35 | + editorConfigurationChanged?: function($event) 36 | + Emitted when configuration of the Editor changes 37 | + editorLanguageChanged?: function($event) 38 | + Emitted when the language of the Editor changes 39 | 40 | 41 | ## Installation 42 | 43 | This component can be installed as npm package. 44 | 45 | ```bash 46 | npm install @covalent/code-editor 47 | ``` 48 | 49 | ## Setup 50 | 51 | Due to an known issue in Monaco Editor version 0.20.0 https://github.com/microsoft/monaco-editor/issues/1842 regarding errors arising when quickly disposing editor instances, utilize the 0.17.1 version of monaco-editor. 52 | 53 | We utilize the ESM build of the Monaco Editor. To include this build, you must utilize custom webpack. See https://github.com/Microsoft/monaco-editor/blob/master/docs/integrate-esm.md for more information. 54 | 55 | Install the webpack custom builder. 56 | 57 | ```bash 58 | npm install --save-dev @angular-builders/custom-webpack 59 | ``` 60 | 61 | Install the Monaco Editor webpack extension plugin. 62 | 63 | ```bash 64 | npm install --save-dev monaco-editor-webpack-plugin 65 | ``` 66 | 67 | Create a webpack config file utilizing the Monaco Editor webpack plugin. Languages and features can be included/excluded to control the resulting image size. 68 | 69 | ```javascript 70 | const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); 71 | 72 | module.exports = { 73 | // target should only be specified when including component in Electron app 74 | target: 'electron-renderer', 75 | module: { 76 | rules: [ 77 | { 78 | test: /\.css$/, 79 | use: ['style-loader'], 80 | }, 81 | { 82 | test: /\.ttf$/, 83 | use: ['file-loader'], 84 | }, 85 | ], 86 | }, 87 | plugins: [ 88 | new MonacoWebpackPlugin({ 89 | languages: ['css','html','javascript','sql','typescript'], 90 | features: ['contextmenu','clipboard','find'], 91 | }), 92 | ], 93 | }; 94 | ``` 95 | Note: If you are including this component in an Electron application, define the electron-renderer target. See Electron example here: 96 | [https://github.com/Teradata/covalent-electron/blob/develop/monaco-webpack.config.js](https://github.com/Teradata/covalent-electron/blob/develop/monaco-webpack.config.js) 97 | 98 | 99 | Reference the webpack file in your angular.json build config. 100 | 101 | ```json 102 | ... 103 | "build": { 104 | "builder": "@angular-builders/custom-webpack:browser", 105 | "options": { 106 | "customWebpackConfig": { 107 | "path": "./monaco-webpack.config.js", 108 | "mergeStrategies": { 109 | "module.rules": "prepend" 110 | } 111 | }, 112 | ... 113 | ``` 114 | 115 | Import the **CovalentCodeEditorModule** in your NgModule: 116 | 117 | ```typescript 118 | import { CovalentCodeEditorModule } from '@covalent/code-editor'; 119 | @NgModule({ 120 | imports: [ 121 | CovalentCodeEditorModule, 122 | ... 123 | ], 124 | ... 125 | }) 126 | export class MyModule {} 127 | ``` 128 | 129 | ## Example 130 | 131 | ```html 132 | 141 | 142 | ``` 143 | -------------------------------------------------------------------------------- /bundles/covalent-code-editor.umd.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('rxjs'), require('rxjs/operators'), require('monaco-editor/esm/vs/editor/editor.api'), require('@angular/common')) : 3 | typeof define === 'function' && define.amd ? define('@covalent/code-editor', ['exports', '@angular/core', '@angular/forms', 'rxjs', 'rxjs/operators', 'monaco-editor/esm/vs/editor/editor.api', '@angular/common'], factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.covalent = global.covalent || {}, global.covalent['code-editor'] = {}), global.ng.core, global.ng.forms, global.rxjs, global.rxjs.operators, global.monaco, global.ng.common)); 5 | }(this, (function (exports, core, forms, rxjs, operators, monaco, common) { 'use strict'; 6 | 7 | /*! ***************************************************************************** 8 | Copyright (c) Microsoft Corporation. 9 | 10 | Permission to use, copy, modify, and/or distribute this software for any 11 | purpose with or without fee is hereby granted. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 14 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 15 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 16 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 17 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 18 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 19 | PERFORMANCE OF THIS SOFTWARE. 20 | ***************************************************************************** */ 21 | /* global Reflect, Promise */ 22 | var extendStatics = function (d, b) { 23 | extendStatics = Object.setPrototypeOf || 24 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 25 | function (d, b) { for (var p in b) 26 | if (Object.prototype.hasOwnProperty.call(b, p)) 27 | d[p] = b[p]; }; 28 | return extendStatics(d, b); 29 | }; 30 | function __extends(d, b) { 31 | extendStatics(d, b); 32 | function __() { this.constructor = d; } 33 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 34 | } 35 | var __assign = function () { 36 | __assign = Object.assign || function __assign(t) { 37 | for (var s, i = 1, n = arguments.length; i < n; i++) { 38 | s = arguments[i]; 39 | for (var p in s) 40 | if (Object.prototype.hasOwnProperty.call(s, p)) 41 | t[p] = s[p]; 42 | } 43 | return t; 44 | }; 45 | return __assign.apply(this, arguments); 46 | }; 47 | function __rest(s, e) { 48 | var t = {}; 49 | for (var p in s) 50 | if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 51 | t[p] = s[p]; 52 | if (s != null && typeof Object.getOwnPropertySymbols === "function") 53 | for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 54 | if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 55 | t[p[i]] = s[p[i]]; 56 | } 57 | return t; 58 | } 59 | function __decorate(decorators, target, key, desc) { 60 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 61 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") 62 | r = Reflect.decorate(decorators, target, key, desc); 63 | else 64 | for (var i = decorators.length - 1; i >= 0; i--) 65 | if (d = decorators[i]) 66 | r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 67 | return c > 3 && r && Object.defineProperty(target, key, r), r; 68 | } 69 | function __param(paramIndex, decorator) { 70 | return function (target, key) { decorator(target, key, paramIndex); }; 71 | } 72 | function __metadata(metadataKey, metadataValue) { 73 | if (typeof Reflect === "object" && typeof Reflect.metadata === "function") 74 | return Reflect.metadata(metadataKey, metadataValue); 75 | } 76 | function __awaiter(thisArg, _arguments, P, generator) { 77 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 78 | return new (P || (P = Promise))(function (resolve, reject) { 79 | function fulfilled(value) { try { 80 | step(generator.next(value)); 81 | } 82 | catch (e) { 83 | reject(e); 84 | } } 85 | function rejected(value) { try { 86 | step(generator["throw"](value)); 87 | } 88 | catch (e) { 89 | reject(e); 90 | } } 91 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 92 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 93 | }); 94 | } 95 | function __generator(thisArg, body) { 96 | var _ = { label: 0, sent: function () { if (t[0] & 1) 97 | throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 98 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g; 99 | function verb(n) { return function (v) { return step([n, v]); }; } 100 | function step(op) { 101 | if (f) 102 | throw new TypeError("Generator is already executing."); 103 | while (_) 104 | try { 105 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) 106 | return t; 107 | if (y = 0, t) 108 | op = [op[0] & 2, t.value]; 109 | switch (op[0]) { 110 | case 0: 111 | case 1: 112 | t = op; 113 | break; 114 | case 4: 115 | _.label++; 116 | return { value: op[1], done: false }; 117 | case 5: 118 | _.label++; 119 | y = op[1]; 120 | op = [0]; 121 | continue; 122 | case 7: 123 | op = _.ops.pop(); 124 | _.trys.pop(); 125 | continue; 126 | default: 127 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { 128 | _ = 0; 129 | continue; 130 | } 131 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { 132 | _.label = op[1]; 133 | break; 134 | } 135 | if (op[0] === 6 && _.label < t[1]) { 136 | _.label = t[1]; 137 | t = op; 138 | break; 139 | } 140 | if (t && _.label < t[2]) { 141 | _.label = t[2]; 142 | _.ops.push(op); 143 | break; 144 | } 145 | if (t[2]) 146 | _.ops.pop(); 147 | _.trys.pop(); 148 | continue; 149 | } 150 | op = body.call(thisArg, _); 151 | } 152 | catch (e) { 153 | op = [6, e]; 154 | y = 0; 155 | } 156 | finally { 157 | f = t = 0; 158 | } 159 | if (op[0] & 5) 160 | throw op[1]; 161 | return { value: op[0] ? op[1] : void 0, done: true }; 162 | } 163 | } 164 | var __createBinding = Object.create ? (function (o, m, k, k2) { 165 | if (k2 === undefined) 166 | k2 = k; 167 | Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } }); 168 | }) : (function (o, m, k, k2) { 169 | if (k2 === undefined) 170 | k2 = k; 171 | o[k2] = m[k]; 172 | }); 173 | function __exportStar(m, o) { 174 | for (var p in m) 175 | if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) 176 | __createBinding(o, m, p); 177 | } 178 | function __values(o) { 179 | var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 180 | if (m) 181 | return m.call(o); 182 | if (o && typeof o.length === "number") 183 | return { 184 | next: function () { 185 | if (o && i >= o.length) 186 | o = void 0; 187 | return { value: o && o[i++], done: !o }; 188 | } 189 | }; 190 | throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 191 | } 192 | function __read(o, n) { 193 | var m = typeof Symbol === "function" && o[Symbol.iterator]; 194 | if (!m) 195 | return o; 196 | var i = m.call(o), r, ar = [], e; 197 | try { 198 | while ((n === void 0 || n-- > 0) && !(r = i.next()).done) 199 | ar.push(r.value); 200 | } 201 | catch (error) { 202 | e = { error: error }; 203 | } 204 | finally { 205 | try { 206 | if (r && !r.done && (m = i["return"])) 207 | m.call(i); 208 | } 209 | finally { 210 | if (e) 211 | throw e.error; 212 | } 213 | } 214 | return ar; 215 | } 216 | function __spread() { 217 | for (var ar = [], i = 0; i < arguments.length; i++) 218 | ar = ar.concat(__read(arguments[i])); 219 | return ar; 220 | } 221 | function __spreadArrays() { 222 | for (var s = 0, i = 0, il = arguments.length; i < il; i++) 223 | s += arguments[i].length; 224 | for (var r = Array(s), k = 0, i = 0; i < il; i++) 225 | for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 226 | r[k] = a[j]; 227 | return r; 228 | } 229 | ; 230 | function __await(v) { 231 | return this instanceof __await ? (this.v = v, this) : new __await(v); 232 | } 233 | function __asyncGenerator(thisArg, _arguments, generator) { 234 | if (!Symbol.asyncIterator) 235 | throw new TypeError("Symbol.asyncIterator is not defined."); 236 | var g = generator.apply(thisArg, _arguments || []), i, q = []; 237 | return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; 238 | function verb(n) { if (g[n]) 239 | i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } 240 | function resume(n, v) { try { 241 | step(g[n](v)); 242 | } 243 | catch (e) { 244 | settle(q[0][3], e); 245 | } } 246 | function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 247 | function fulfill(value) { resume("next", value); } 248 | function reject(value) { resume("throw", value); } 249 | function settle(f, v) { if (f(v), q.shift(), q.length) 250 | resume(q[0][0], q[0][1]); } 251 | } 252 | function __asyncDelegator(o) { 253 | var i, p; 254 | return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 255 | function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } 256 | } 257 | function __asyncValues(o) { 258 | if (!Symbol.asyncIterator) 259 | throw new TypeError("Symbol.asyncIterator is not defined."); 260 | var m = o[Symbol.asyncIterator], i; 261 | return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 262 | function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 263 | function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } 264 | } 265 | function __makeTemplateObject(cooked, raw) { 266 | if (Object.defineProperty) { 267 | Object.defineProperty(cooked, "raw", { value: raw }); 268 | } 269 | else { 270 | cooked.raw = raw; 271 | } 272 | return cooked; 273 | } 274 | ; 275 | var __setModuleDefault = Object.create ? (function (o, v) { 276 | Object.defineProperty(o, "default", { enumerable: true, value: v }); 277 | }) : function (o, v) { 278 | o["default"] = v; 279 | }; 280 | function __importStar(mod) { 281 | if (mod && mod.__esModule) 282 | return mod; 283 | var result = {}; 284 | if (mod != null) 285 | for (var k in mod) 286 | if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) 287 | __createBinding(result, mod, k); 288 | __setModuleDefault(result, mod); 289 | return result; 290 | } 291 | function __importDefault(mod) { 292 | return (mod && mod.__esModule) ? mod : { default: mod }; 293 | } 294 | function __classPrivateFieldGet(receiver, privateMap) { 295 | if (!privateMap.has(receiver)) { 296 | throw new TypeError("attempted to get private field on non-instance"); 297 | } 298 | return privateMap.get(receiver); 299 | } 300 | function __classPrivateFieldSet(receiver, privateMap, value) { 301 | if (!privateMap.has(receiver)) { 302 | throw new TypeError("attempted to set private field on non-instance"); 303 | } 304 | privateMap.set(receiver, value); 305 | return value; 306 | } 307 | 308 | /** @type {?} */ 309 | var noop = ( /** 310 | * @return {?} 311 | */function () { 312 | // empty method 313 | }); 314 | var ɵ0 = noop; 315 | // counter for ids to allow for multiple editors on one page 316 | /** @type {?} */ 317 | var uniqueCounter = 0; 318 | var TdCodeEditorComponent = /** @class */ (function () { 319 | // tslint:disable-next-line:member-ordering 320 | /** 321 | * @param {?} zone 322 | * @param {?} _changeDetectorRef 323 | * @param {?} _elementRef 324 | */ 325 | function TdCodeEditorComponent(zone, _changeDetectorRef, _elementRef) { 326 | this.zone = zone; 327 | this._changeDetectorRef = _changeDetectorRef; 328 | this._elementRef = _elementRef; 329 | this._destroy = new rxjs.Subject(); 330 | this._widthSubject = new rxjs.Subject(); 331 | this._heightSubject = new rxjs.Subject(); 332 | this._editorStyle = 'width:100%;height:100%;border:1px solid grey;'; 333 | this._value = ''; 334 | this._theme = 'vs'; 335 | this._language = 'javascript'; 336 | this._subject = new rxjs.Subject(); 337 | this._editorInnerContainer = 'editorInnerContainer' + uniqueCounter++; 338 | this._fromEditor = false; 339 | this._componentInitialized = false; 340 | this._editorOptions = {}; 341 | this._isFullScreen = false; 342 | this._registeredLanguagesStyles = []; 343 | /** 344 | * editorInitialized: function($event) 345 | * Event emitted when editor is first initialized 346 | */ 347 | this.editorInitialized = new core.EventEmitter(); 348 | /** 349 | * editorConfigurationChanged: function($event) 350 | * Event emitted when editor's configuration changes 351 | */ 352 | this.editorConfigurationChanged = new core.EventEmitter(); 353 | /** 354 | * editorLanguageChanged: function($event) 355 | * Event emitted when editor's Language changes 356 | */ 357 | this.editorLanguageChanged = new core.EventEmitter(); 358 | /** 359 | * editorValueChange: function($event) 360 | * Event emitted any time something changes the editor value 361 | */ 362 | this.editorValueChange = new core.EventEmitter(); 363 | /** 364 | * The change event notifies you about a change happening in an input field. 365 | * Since the component is not a native Angular component have to specifiy the event emitter ourself 366 | */ 367 | this.change = new core.EventEmitter(); 368 | /* tslint:disable-next-line */ 369 | this.propagateChange = ( /** 370 | * @param {?} _ 371 | * @return {?} 372 | */function (_) { }); 373 | this.onTouched = ( /** 374 | * @return {?} 375 | */function () { return noop; }); 376 | } 377 | Object.defineProperty(TdCodeEditorComponent.prototype, "value", { 378 | /** 379 | * @return {?} 380 | */ 381 | get: function () { 382 | return this._value; 383 | }, 384 | /** 385 | * value?: string 386 | * @param {?} value 387 | * @return {?} 388 | */ 389 | set: function (value) { 390 | if (value === this._value) { 391 | return; 392 | } 393 | this._value = value; 394 | if (this._componentInitialized) { 395 | this.applyValue(); 396 | } 397 | }, 398 | enumerable: false, 399 | configurable: true 400 | }); 401 | /** 402 | * @return {?} 403 | */ 404 | TdCodeEditorComponent.prototype.applyValue = function () { 405 | if (!this._fromEditor) { 406 | this._editor.setValue(this._value); 407 | } 408 | this._fromEditor = false; 409 | this.propagateChange(this._value); 410 | this.change.emit(); 411 | this.editorValueChange.emit(); 412 | }; 413 | /** 414 | * Implemented as part of ControlValueAccessor. 415 | * @param {?} value 416 | * @return {?} 417 | */ 418 | TdCodeEditorComponent.prototype.writeValue = function (value) { 419 | // do not write if null or undefined 420 | // tslint:disable-next-line 421 | if (value != undefined) { 422 | this.value = value; 423 | } 424 | }; 425 | /** 426 | * @param {?} fn 427 | * @return {?} 428 | */ 429 | TdCodeEditorComponent.prototype.registerOnChange = function (fn) { 430 | this.propagateChange = fn; 431 | }; 432 | /** 433 | * @param {?} fn 434 | * @return {?} 435 | */ 436 | TdCodeEditorComponent.prototype.registerOnTouched = function (fn) { 437 | this.onTouched = fn; 438 | }; 439 | /** 440 | * getEditorContent?: function 441 | * Returns the content within the editor 442 | * @return {?} 443 | */ 444 | TdCodeEditorComponent.prototype.getValue = function () { 445 | var _this = this; 446 | if (this._componentInitialized) { 447 | setTimeout(( /** 448 | * @return {?} 449 | */function () { 450 | _this._subject.next(_this._value); 451 | _this._subject.complete(); 452 | _this._subject = new rxjs.Subject(); 453 | })); 454 | return this._subject.asObservable(); 455 | } 456 | }; 457 | Object.defineProperty(TdCodeEditorComponent.prototype, "language", { 458 | /** 459 | * @return {?} 460 | */ 461 | get: function () { 462 | return this._language; 463 | }, 464 | /** 465 | * language?: string 466 | * language used in editor 467 | * @param {?} language 468 | * @return {?} 469 | */ 470 | set: function (language) { 471 | this._language = language; 472 | if (this._componentInitialized) { 473 | this.applyLanguage(); 474 | } 475 | }, 476 | enumerable: false, 477 | configurable: true 478 | }); 479 | /** 480 | * @return {?} 481 | */ 482 | TdCodeEditorComponent.prototype.applyLanguage = function () { 483 | if (this._language) { 484 | monaco.editor.setModelLanguage(this._editor.getModel(), this._language); 485 | this.editorLanguageChanged.emit(); 486 | } 487 | }; 488 | /** 489 | * registerLanguage?: function 490 | * Registers a custom Language within the editor 491 | * @param {?} language 492 | * @return {?} 493 | */ 494 | TdCodeEditorComponent.prototype.registerLanguage = function (language) { 495 | var e_1, _a, e_2, _b; 496 | if (this._componentInitialized) { 497 | try { 498 | for (var _c = __values(language.completionItemProvider), _d = _c.next(); !_d.done; _d = _c.next()) { 499 | var provider = _d.value; 500 | /* tslint:disable-next-line */ 501 | provider.kind = eval(provider.kind); 502 | } 503 | } 504 | catch (e_1_1) { e_1 = { error: e_1_1 }; } 505 | finally { 506 | try { 507 | if (_d && !_d.done && (_a = _c.return)) _a.call(_c); 508 | } 509 | finally { if (e_1) throw e_1.error; } 510 | } 511 | try { 512 | for (var _e = __values(language.monarchTokensProvider), _f = _e.next(); !_f.done; _f = _e.next()) { 513 | var monarchTokens = _f.value; 514 | /* tslint:disable-next-line */ 515 | monarchTokens[0] = eval(monarchTokens[0]); 516 | } 517 | } 518 | catch (e_2_1) { e_2 = { error: e_2_1 }; } 519 | finally { 520 | try { 521 | if (_f && !_f.done && (_b = _e.return)) _b.call(_e); 522 | } 523 | finally { if (e_2) throw e_2.error; } 524 | } 525 | monaco.languages.register({ id: language.id }); 526 | monaco.languages.setMonarchTokensProvider(language.id, { 527 | tokenizer: { 528 | root: language.monarchTokensProvider, 529 | }, 530 | }); 531 | // Define a new theme that constains only rules that match this language 532 | monaco.editor.defineTheme(language.customTheme.id, language.customTheme.theme); 533 | this._theme = language.customTheme.id; 534 | monaco.languages.registerCompletionItemProvider(language.id, { 535 | provideCompletionItems: ( /** 536 | * @return {?} 537 | */function () { 538 | return language.completionItemProvider; 539 | }), 540 | }); 541 | /** @type {?} */ 542 | var css = document.createElement('style'); 543 | css.type = 'text/css'; 544 | css.innerHTML = language.monarchTokensProviderCSS; 545 | document.body.appendChild(css); 546 | this.editorConfigurationChanged.emit(); 547 | this._registeredLanguagesStyles = __spread(this._registeredLanguagesStyles, [css]); 548 | } 549 | }; 550 | Object.defineProperty(TdCodeEditorComponent.prototype, "editorStyle", { 551 | /** 552 | * @return {?} 553 | */ 554 | get: function () { 555 | return this._editorStyle; 556 | }, 557 | /** 558 | * style?: string 559 | * css style of the editor on the page 560 | * @param {?} editorStyle 561 | * @return {?} 562 | */ 563 | set: function (editorStyle) { 564 | this._editorStyle = editorStyle; 565 | if (this._componentInitialized) { 566 | this.applyStyle(); 567 | } 568 | }, 569 | enumerable: false, 570 | configurable: true 571 | }); 572 | /** 573 | * @return {?} 574 | */ 575 | TdCodeEditorComponent.prototype.applyStyle = function () { 576 | if (this._editorStyle) { 577 | /** @type {?} */ 578 | var containerDiv = this._editorContainer.nativeElement; 579 | containerDiv.setAttribute('style', this._editorStyle); 580 | } 581 | }; 582 | Object.defineProperty(TdCodeEditorComponent.prototype, "theme", { 583 | /** 584 | * @return {?} 585 | */ 586 | get: function () { 587 | return this._theme; 588 | }, 589 | /** 590 | * theme?: string 591 | * Theme to be applied to editor 592 | * @param {?} theme 593 | * @return {?} 594 | */ 595 | set: function (theme) { 596 | this._theme = theme; 597 | if (this._componentInitialized) { 598 | this._editor.updateOptions({ theme: theme }); 599 | this.editorConfigurationChanged.emit(); 600 | } 601 | }, 602 | enumerable: false, 603 | configurable: true 604 | }); 605 | Object.defineProperty(TdCodeEditorComponent.prototype, "fullScreenKeyBinding", { 606 | /** 607 | * @return {?} 608 | */ 609 | get: function () { 610 | return this._keycode; 611 | }, 612 | /** 613 | * fullScreenKeyBinding?: number 614 | * See here for key bindings https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html 615 | * Sets the KeyCode for shortcutting to Fullscreen mode 616 | * @param {?} keycode 617 | * @return {?} 618 | */ 619 | set: function (keycode) { 620 | this._keycode = keycode; 621 | }, 622 | enumerable: false, 623 | configurable: true 624 | }); 625 | Object.defineProperty(TdCodeEditorComponent.prototype, "editorOptions", { 626 | /** 627 | * @return {?} 628 | */ 629 | get: function () { 630 | return this._editorOptions; 631 | }, 632 | /** 633 | * editorOptions?: object 634 | * Options used on editor instantiation. Available options listed here: 635 | * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html 636 | * @param {?} editorOptions 637 | * @return {?} 638 | */ 639 | set: function (editorOptions) { 640 | this._editorOptions = editorOptions; 641 | if (this._componentInitialized) { 642 | this._editor.updateOptions(editorOptions); 643 | this.editorConfigurationChanged.emit(); 644 | } 645 | }, 646 | enumerable: false, 647 | configurable: true 648 | }); 649 | /** 650 | * layout method that calls layout method of editor and instructs the editor to remeasure its container 651 | * @return {?} 652 | */ 653 | TdCodeEditorComponent.prototype.layout = function () { 654 | if (this._componentInitialized) { 655 | this._editor.layout(); 656 | } 657 | }; 658 | Object.defineProperty(TdCodeEditorComponent.prototype, "isFullScreen", { 659 | /** 660 | * Returns if in Full Screen Mode or not 661 | * @return {?} 662 | */ 663 | get: function () { 664 | return this._isFullScreen; 665 | }, 666 | enumerable: false, 667 | configurable: true 668 | }); 669 | /** 670 | * @return {?} 671 | */ 672 | TdCodeEditorComponent.prototype.ngOnInit = function () { 673 | var _this = this; 674 | /** @type {?} */ 675 | var containerDiv = this._editorContainer.nativeElement; 676 | containerDiv.id = this._editorInnerContainer; 677 | this._editor = monaco.editor.create(containerDiv, Object.assign({ 678 | value: this._value, 679 | language: this.language, 680 | theme: this._theme, 681 | }, this.editorOptions)); 682 | this._componentInitialized = true; 683 | setTimeout(( /** 684 | * @return {?} 685 | */function () { 686 | _this.applyLanguage(); 687 | _this._fromEditor = true; 688 | _this.applyValue(); 689 | _this.applyStyle(); 690 | _this.editorInitialized.emit(_this._editor); 691 | _this.editorConfigurationChanged.emit(); 692 | })); 693 | this._editor.getModel().onDidChangeContent(( /** 694 | * @param {?} e 695 | * @return {?} 696 | */function (e) { 697 | _this._fromEditor = true; 698 | _this.writeValue(_this._editor.getValue()); 699 | _this.layout(); 700 | })); 701 | this.addFullScreenModeCommand(); 702 | rxjs.merge(rxjs.fromEvent(window, 'resize').pipe(operators.debounceTime(100)), this._widthSubject.asObservable().pipe(operators.distinctUntilChanged()), this._heightSubject.asObservable().pipe(operators.distinctUntilChanged())) 703 | .pipe(operators.takeUntil(this._destroy), operators.debounceTime(100)) 704 | .subscribe(( /** 705 | * @return {?} 706 | */function () { 707 | _this.layout(); 708 | _this._changeDetectorRef.markForCheck(); 709 | })); 710 | rxjs.timer(500, 250) 711 | .pipe(operators.takeUntil(this._destroy)) 712 | .subscribe(( /** 713 | * @return {?} 714 | */function () { 715 | if (_this._elementRef && _this._elementRef.nativeElement) { 716 | _this._widthSubject.next((( /** @type {?} */(_this._elementRef.nativeElement))).getBoundingClientRect().width); 717 | _this._heightSubject.next((( /** @type {?} */(_this._elementRef.nativeElement))).getBoundingClientRect().height); 718 | } 719 | })); 720 | }; 721 | /** 722 | * @return {?} 723 | */ 724 | TdCodeEditorComponent.prototype.ngOnDestroy = function () { 725 | this._changeDetectorRef.detach(); 726 | this._registeredLanguagesStyles.forEach(( /** 727 | * @param {?} style 728 | * @return {?} 729 | */function (style) { return style.remove(); })); 730 | if (this._editor) { 731 | this._editor.dispose(); 732 | } 733 | this._destroy.next(true); 734 | this._destroy.unsubscribe(); 735 | }; 736 | /** 737 | * showFullScreenEditor request for full screen of Code Editor based on its browser type. 738 | * @return {?} 739 | */ 740 | TdCodeEditorComponent.prototype.showFullScreenEditor = function () { 741 | var e_3, _a; 742 | if (this._componentInitialized) { 743 | /** @type {?} */ 744 | var codeEditorElement_1 = ( /** @type {?} */(this._editorContainer.nativeElement)); 745 | /** @type {?} */ 746 | var fullScreenMap = { 747 | // Chrome 748 | requestFullscreen: ( /** 749 | * @return {?} 750 | */function () { return codeEditorElement_1.requestFullscreen(); }), 751 | // Safari 752 | webkitRequestFullscreen: ( /** 753 | * @return {?} 754 | */function () { return (( /** @type {?} */(codeEditorElement_1))).webkitRequestFullscreen(); }), 755 | // IE 756 | msRequestFullscreen: ( /** 757 | * @return {?} 758 | */function () { return (( /** @type {?} */(codeEditorElement_1))).msRequestFullscreen(); }), 759 | // Firefox 760 | mozRequestFullScreen: ( /** 761 | * @return {?} 762 | */function () { return (( /** @type {?} */(codeEditorElement_1))).mozRequestFullScreen(); }), 763 | }; 764 | try { 765 | for (var _b = __values(Object.keys(fullScreenMap)), _c = _b.next(); !_c.done; _c = _b.next()) { 766 | var handler = _c.value; 767 | if (codeEditorElement_1[handler]) { 768 | fullScreenMap[handler](); 769 | } 770 | } 771 | } 772 | catch (e_3_1) { e_3 = { error: e_3_1 }; } 773 | finally { 774 | try { 775 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b); 776 | } 777 | finally { if (e_3) throw e_3.error; } 778 | } 779 | } 780 | this._isFullScreen = true; 781 | }; 782 | /** 783 | * exitFullScreenEditor request to exit full screen of Code Editor based on its browser type. 784 | * @return {?} 785 | */ 786 | TdCodeEditorComponent.prototype.exitFullScreenEditor = function () { 787 | var e_4, _a; 788 | if (this._componentInitialized) { 789 | /** @type {?} */ 790 | var exitFullScreenMap = { 791 | // Chrome 792 | exitFullscreen: ( /** 793 | * @return {?} 794 | */function () { return document.exitFullscreen(); }), 795 | // Safari 796 | webkitExitFullscreen: ( /** 797 | * @return {?} 798 | */function () { return (( /** @type {?} */(document))).webkitExitFullscreen(); }), 799 | // Firefox 800 | mozCancelFullScreen: ( /** 801 | * @return {?} 802 | */function () { return (( /** @type {?} */(document))).mozCancelFullScreen(); }), 803 | // IE 804 | msExitFullscreen: ( /** 805 | * @return {?} 806 | */function () { return (( /** @type {?} */(document))).msExitFullscreen(); }), 807 | }; 808 | try { 809 | for (var _b = __values(Object.keys(exitFullScreenMap)), _c = _b.next(); !_c.done; _c = _b.next()) { 810 | var handler = _c.value; 811 | if (document[handler]) { 812 | exitFullScreenMap[handler](); 813 | } 814 | } 815 | } 816 | catch (e_4_1) { e_4 = { error: e_4_1 }; } 817 | finally { 818 | try { 819 | if (_c && !_c.done && (_a = _b.return)) _a.call(_b); 820 | } 821 | finally { if (e_4) throw e_4.error; } 822 | } 823 | } 824 | this._isFullScreen = false; 825 | }; 826 | /** 827 | * addFullScreenModeCommand used to add the fullscreen option to the context menu 828 | * @private 829 | * @return {?} 830 | */ 831 | TdCodeEditorComponent.prototype.addFullScreenModeCommand = function () { 832 | var _this = this; 833 | this._editor.addAction({ 834 | // An unique identifier of the contributed action. 835 | id: 'fullScreen', 836 | // A label of the action that will be presented to the user. 837 | label: 'Full Screen', 838 | // An optional array of keybindings for the action. 839 | contextMenuGroupId: 'navigation', 840 | keybindings: this._keycode, 841 | contextMenuOrder: 1.5, 842 | // Method that will be executed when the action is triggered. 843 | // @param editor The editor instance is passed in as a convinience 844 | run: ( /** 845 | * @param {?} ed 846 | * @return {?} 847 | */function (ed) { 848 | _this.showFullScreenEditor(); 849 | }), 850 | }); 851 | }; 852 | return TdCodeEditorComponent; 853 | }()); 854 | TdCodeEditorComponent.decorators = [ 855 | { type: core.Component, args: [{ 856 | selector: 'td-code-editor', 857 | template: "
\n", 858 | providers: [ 859 | { 860 | provide: forms.NG_VALUE_ACCESSOR, 861 | useExisting: core.forwardRef(( /** 862 | * @return {?} 863 | */function () { return TdCodeEditorComponent; })), 864 | multi: true, 865 | }, 866 | ], 867 | styles: [":host{display:block;position:relative}:host .editorContainer{bottom:0;left:0;position:absolute;right:0;top:0}::ng-deep .monaco-aria-container{display:none}"] 868 | }] } 869 | ]; 870 | /** @nocollapse */ 871 | TdCodeEditorComponent.ctorParameters = function () { return [ 872 | { type: core.NgZone }, 873 | { type: core.ChangeDetectorRef }, 874 | { type: core.ElementRef } 875 | ]; }; 876 | TdCodeEditorComponent.propDecorators = { 877 | _editorContainer: [{ type: core.ViewChild, args: ['editorContainer', { static: true },] }], 878 | editorInitialized: [{ type: core.Output }], 879 | editorConfigurationChanged: [{ type: core.Output }], 880 | editorLanguageChanged: [{ type: core.Output }], 881 | editorValueChange: [{ type: core.Output }], 882 | change: [{ type: core.Output }], 883 | value: [{ type: core.Input, args: ['value',] }], 884 | language: [{ type: core.Input, args: ['language',] }], 885 | editorStyle: [{ type: core.Input, args: ['editorStyle',] }], 886 | theme: [{ type: core.Input, args: ['theme',] }], 887 | fullScreenKeyBinding: [{ type: core.Input, args: ['fullScreenKeyBinding',] }], 888 | editorOptions: [{ type: core.Input, args: ['editorOptions',] }] 889 | }; 890 | if (false) { 891 | /** 892 | * @type {?} 893 | * @private 894 | */ 895 | TdCodeEditorComponent.prototype._destroy; 896 | /** 897 | * @type {?} 898 | * @private 899 | */ 900 | TdCodeEditorComponent.prototype._widthSubject; 901 | /** 902 | * @type {?} 903 | * @private 904 | */ 905 | TdCodeEditorComponent.prototype._heightSubject; 906 | /** 907 | * @type {?} 908 | * @private 909 | */ 910 | TdCodeEditorComponent.prototype._editorStyle; 911 | /** 912 | * @type {?} 913 | * @private 914 | */ 915 | TdCodeEditorComponent.prototype._value; 916 | /** 917 | * @type {?} 918 | * @private 919 | */ 920 | TdCodeEditorComponent.prototype._theme; 921 | /** 922 | * @type {?} 923 | * @private 924 | */ 925 | TdCodeEditorComponent.prototype._language; 926 | /** 927 | * @type {?} 928 | * @private 929 | */ 930 | TdCodeEditorComponent.prototype._subject; 931 | /** 932 | * @type {?} 933 | * @private 934 | */ 935 | TdCodeEditorComponent.prototype._editorInnerContainer; 936 | /** 937 | * @type {?} 938 | * @private 939 | */ 940 | TdCodeEditorComponent.prototype._editor; 941 | /** 942 | * @type {?} 943 | * @private 944 | */ 945 | TdCodeEditorComponent.prototype._fromEditor; 946 | /** 947 | * @type {?} 948 | * @private 949 | */ 950 | TdCodeEditorComponent.prototype._componentInitialized; 951 | /** 952 | * @type {?} 953 | * @private 954 | */ 955 | TdCodeEditorComponent.prototype._editorOptions; 956 | /** 957 | * @type {?} 958 | * @private 959 | */ 960 | TdCodeEditorComponent.prototype._isFullScreen; 961 | /** 962 | * @type {?} 963 | * @private 964 | */ 965 | TdCodeEditorComponent.prototype._keycode; 966 | /** 967 | * @type {?} 968 | * @private 969 | */ 970 | TdCodeEditorComponent.prototype._registeredLanguagesStyles; 971 | /** @type {?} */ 972 | TdCodeEditorComponent.prototype._editorContainer; 973 | /** 974 | * editorInitialized: function($event) 975 | * Event emitted when editor is first initialized 976 | * @type {?} 977 | */ 978 | TdCodeEditorComponent.prototype.editorInitialized; 979 | /** 980 | * editorConfigurationChanged: function($event) 981 | * Event emitted when editor's configuration changes 982 | * @type {?} 983 | */ 984 | TdCodeEditorComponent.prototype.editorConfigurationChanged; 985 | /** 986 | * editorLanguageChanged: function($event) 987 | * Event emitted when editor's Language changes 988 | * @type {?} 989 | */ 990 | TdCodeEditorComponent.prototype.editorLanguageChanged; 991 | /** 992 | * editorValueChange: function($event) 993 | * Event emitted any time something changes the editor value 994 | * @type {?} 995 | */ 996 | TdCodeEditorComponent.prototype.editorValueChange; 997 | /** 998 | * The change event notifies you about a change happening in an input field. 999 | * Since the component is not a native Angular component have to specifiy the event emitter ourself 1000 | * @type {?} 1001 | */ 1002 | TdCodeEditorComponent.prototype.change; 1003 | /** @type {?} */ 1004 | TdCodeEditorComponent.prototype.propagateChange; 1005 | /** @type {?} */ 1006 | TdCodeEditorComponent.prototype.onTouched; 1007 | /** 1008 | * @type {?} 1009 | * @private 1010 | */ 1011 | TdCodeEditorComponent.prototype.zone; 1012 | /** 1013 | * @type {?} 1014 | * @private 1015 | */ 1016 | TdCodeEditorComponent.prototype._changeDetectorRef; 1017 | /** 1018 | * @type {?} 1019 | * @private 1020 | */ 1021 | TdCodeEditorComponent.prototype._elementRef; 1022 | } 1023 | 1024 | /** 1025 | * @fileoverview added by tsickle 1026 | * Generated from: code-editor.module.ts 1027 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 1028 | */ 1029 | var CovalentCodeEditorModule = /** @class */ (function () { 1030 | function CovalentCodeEditorModule() { 1031 | } 1032 | return CovalentCodeEditorModule; 1033 | }()); 1034 | CovalentCodeEditorModule.decorators = [ 1035 | { type: core.NgModule, args: [{ 1036 | imports: [common.CommonModule], 1037 | declarations: [TdCodeEditorComponent], 1038 | exports: [TdCodeEditorComponent], 1039 | bootstrap: [TdCodeEditorComponent], 1040 | },] } 1041 | ]; 1042 | 1043 | /** 1044 | * @fileoverview added by tsickle 1045 | * Generated from: public-api.ts 1046 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 1047 | */ 1048 | 1049 | /** 1050 | * @fileoverview added by tsickle 1051 | * Generated from: index.ts 1052 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 1053 | */ 1054 | 1055 | /** 1056 | * @fileoverview added by tsickle 1057 | * Generated from: covalent-code-editor.ts 1058 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 1059 | */ 1060 | 1061 | exports.CovalentCodeEditorModule = CovalentCodeEditorModule; 1062 | exports.TdCodeEditorComponent = TdCodeEditorComponent; 1063 | 1064 | Object.defineProperty(exports, '__esModule', { value: true }); 1065 | 1066 | }))); 1067 | //# sourceMappingURL=covalent-code-editor.umd.js.map 1068 | -------------------------------------------------------------------------------- /bundles/covalent-code-editor.umd.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"covalent-code-editor.umd.js","sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../src/platform/code-editor/code-editor.component.ts","../../../../src/platform/code-editor/code-editor.module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {\n Component,\n Input,\n Output,\n EventEmitter,\n OnInit,\n ViewChild,\n ElementRef,\n forwardRef,\n NgZone,\n ChangeDetectorRef,\n OnDestroy,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { Observable, Subject } from 'rxjs';\nimport { fromEvent, merge, timer } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\n// Use esm version to support shipping subset of languages and features\nimport * as monaco from 'monaco-editor/esm/vs/editor/editor.api';\n\nconst noop: any = () => {\n // empty method\n};\n\n// counter for ids to allow for multiple editors on one page\nlet uniqueCounter: number = 0;\n\n@Component({\n selector: 'td-code-editor',\n templateUrl: './code-editor.component.html',\n styleUrls: ['./code-editor.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdCodeEditorComponent),\n multi: true,\n },\n ],\n})\nexport class TdCodeEditorComponent implements OnInit, ControlValueAccessor, OnDestroy {\n private _destroy: Subject = new Subject();\n private _widthSubject: Subject = new Subject();\n private _heightSubject: Subject = new Subject();\n\n private _editorStyle: string = 'width:100%;height:100%;border:1px solid grey;';\n private _value: string = '';\n private _theme: string = 'vs';\n private _language: string = 'javascript';\n private _subject: Subject = new Subject();\n private _editorInnerContainer: string = 'editorInnerContainer' + uniqueCounter++;\n private _editor: any;\n private _fromEditor: boolean = false;\n private _componentInitialized: boolean = false;\n private _editorOptions: any = {};\n private _isFullScreen: boolean = false;\n private _keycode: any;\n private _registeredLanguagesStyles: HTMLStyleElement[] = [];\n\n @ViewChild('editorContainer', { static: true }) _editorContainer: ElementRef;\n\n /**\n * editorInitialized: function($event)\n * Event emitted when editor is first initialized\n */\n @Output() editorInitialized: EventEmitter = new EventEmitter();\n\n /**\n * editorConfigurationChanged: function($event)\n * Event emitted when editor's configuration changes\n */\n @Output() editorConfigurationChanged: EventEmitter = new EventEmitter();\n\n /**\n * editorLanguageChanged: function($event)\n * Event emitted when editor's Language changes\n */\n @Output() editorLanguageChanged: EventEmitter = new EventEmitter();\n\n /**\n * editorValueChange: function($event)\n * Event emitted any time something changes the editor value\n */\n @Output() editorValueChange: EventEmitter = new EventEmitter();\n\n /**\n * The change event notifies you about a change happening in an input field.\n * Since the component is not a native Angular component have to specifiy the event emitter ourself\n */\n @Output() change: EventEmitter = new EventEmitter();\n /* tslint:disable-next-line */\n propagateChange = (_: any) => {};\n onTouched = () => noop;\n\n /**\n * value?: string\n */\n @Input('value')\n set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value;\n if (this._componentInitialized) {\n this.applyValue();\n }\n }\n\n get value(): string {\n return this._value;\n }\n\n applyValue(): void {\n if (!this._fromEditor) {\n this._editor.setValue(this._value);\n }\n this._fromEditor = false;\n this.propagateChange(this._value);\n this.change.emit();\n this.editorValueChange.emit();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n writeValue(value: any): void {\n // do not write if null or undefined\n // tslint:disable-next-line\n if (value != undefined) {\n this.value = value;\n }\n }\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * getEditorContent?: function\n * Returns the content within the editor\n */\n getValue(): Observable {\n if (this._componentInitialized) {\n setTimeout(() => {\n this._subject.next(this._value);\n this._subject.complete();\n this._subject = new Subject();\n });\n return this._subject.asObservable();\n }\n }\n\n /**\n * language?: string\n * language used in editor\n */\n @Input('language')\n set language(language: string) {\n this._language = language;\n if (this._componentInitialized) {\n this.applyLanguage();\n }\n }\n\n get language(): string {\n return this._language;\n }\n\n applyLanguage(): void {\n if (this._language) {\n monaco.editor.setModelLanguage(this._editor.getModel(), this._language);\n this.editorLanguageChanged.emit();\n }\n }\n\n /**\n * registerLanguage?: function\n * Registers a custom Language within the editor\n */\n registerLanguage(language: any): void {\n if (this._componentInitialized) {\n for (const provider of language.completionItemProvider) {\n /* tslint:disable-next-line */\n provider.kind = eval(provider.kind);\n }\n for (const monarchTokens of language.monarchTokensProvider) {\n /* tslint:disable-next-line */\n monarchTokens[0] = eval(monarchTokens[0]);\n }\n monaco.languages.register({ id: language.id });\n\n monaco.languages.setMonarchTokensProvider(language.id, {\n tokenizer: {\n root: language.monarchTokensProvider,\n },\n });\n\n // Define a new theme that constains only rules that match this language\n monaco.editor.defineTheme(language.customTheme.id, language.customTheme.theme);\n this._theme = language.customTheme.id;\n\n monaco.languages.registerCompletionItemProvider(language.id, {\n provideCompletionItems: () => {\n return language.completionItemProvider;\n },\n });\n\n const css: HTMLStyleElement = document.createElement('style');\n css.type = 'text/css';\n css.innerHTML = language.monarchTokensProviderCSS;\n document.body.appendChild(css);\n this.editorConfigurationChanged.emit();\n this._registeredLanguagesStyles = [...this._registeredLanguagesStyles, css];\n }\n }\n\n /**\n * style?: string\n * css style of the editor on the page\n */\n @Input('editorStyle')\n set editorStyle(editorStyle: string) {\n this._editorStyle = editorStyle;\n if (this._componentInitialized) {\n this.applyStyle();\n }\n }\n\n get editorStyle(): string {\n return this._editorStyle;\n }\n\n applyStyle(): void {\n if (this._editorStyle) {\n const containerDiv: HTMLDivElement = this._editorContainer.nativeElement;\n containerDiv.setAttribute('style', this._editorStyle);\n }\n }\n\n /**\n * theme?: string\n * Theme to be applied to editor\n */\n @Input('theme')\n set theme(theme: string) {\n this._theme = theme;\n if (this._componentInitialized) {\n this._editor.updateOptions({ theme });\n this.editorConfigurationChanged.emit();\n }\n }\n get theme(): string {\n return this._theme;\n }\n\n /**\n * fullScreenKeyBinding?: number\n * See here for key bindings https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html\n * Sets the KeyCode for shortcutting to Fullscreen mode\n */\n @Input('fullScreenKeyBinding')\n set fullScreenKeyBinding(keycode: number[]) {\n this._keycode = keycode;\n }\n get fullScreenKeyBinding(): number[] {\n return this._keycode;\n }\n\n /**\n * editorOptions?: object\n * Options used on editor instantiation. Available options listed here:\n * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html\n */\n @Input('editorOptions')\n set editorOptions(editorOptions: any) {\n this._editorOptions = editorOptions;\n if (this._componentInitialized) {\n this._editor.updateOptions(editorOptions);\n this.editorConfigurationChanged.emit();\n }\n }\n get editorOptions(): any {\n return this._editorOptions;\n }\n\n /**\n * layout method that calls layout method of editor and instructs the editor to remeasure its container\n */\n layout(): void {\n if (this._componentInitialized) {\n this._editor.layout();\n }\n }\n\n /**\n * Returns if in Full Screen Mode or not\n */\n get isFullScreen(): boolean {\n return this._isFullScreen;\n }\n\n // tslint:disable-next-line:member-ordering\n constructor(private zone: NgZone, private _changeDetectorRef: ChangeDetectorRef, private _elementRef: ElementRef) {}\n\n ngOnInit(): void {\n const containerDiv: HTMLDivElement = this._editorContainer.nativeElement;\n containerDiv.id = this._editorInnerContainer;\n\n this._editor = monaco.editor.create(\n containerDiv,\n Object.assign(\n {\n value: this._value,\n language: this.language,\n theme: this._theme,\n },\n this.editorOptions,\n ),\n );\n this._componentInitialized = true;\n setTimeout(() => {\n this.applyLanguage();\n this._fromEditor = true;\n this.applyValue();\n this.applyStyle();\n this.editorInitialized.emit(this._editor);\n this.editorConfigurationChanged.emit();\n });\n this._editor.getModel().onDidChangeContent((e: any) => {\n this._fromEditor = true;\n this.writeValue(this._editor.getValue());\n this.layout();\n });\n this.addFullScreenModeCommand();\n\n merge(\n fromEvent(window, 'resize').pipe(debounceTime(100)),\n this._widthSubject.asObservable().pipe(distinctUntilChanged()),\n this._heightSubject.asObservable().pipe(distinctUntilChanged()),\n )\n .pipe(takeUntil(this._destroy), debounceTime(100))\n .subscribe(() => {\n this.layout();\n this._changeDetectorRef.markForCheck();\n });\n timer(500, 250)\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n if (this._elementRef && this._elementRef.nativeElement) {\n this._widthSubject.next((this._elementRef.nativeElement).getBoundingClientRect().width);\n this._heightSubject.next((this._elementRef.nativeElement).getBoundingClientRect().height);\n }\n });\n }\n\n ngOnDestroy(): void {\n this._changeDetectorRef.detach();\n this._registeredLanguagesStyles.forEach((style: HTMLStyleElement) => style.remove());\n if (this._editor) {\n this._editor.dispose();\n }\n this._destroy.next(true);\n this._destroy.unsubscribe();\n }\n\n /**\n * showFullScreenEditor request for full screen of Code Editor based on its browser type.\n */\n public showFullScreenEditor(): void {\n if (this._componentInitialized) {\n const codeEditorElement: HTMLDivElement = this._editorContainer.nativeElement as HTMLDivElement;\n const fullScreenMap: object = {\n // Chrome\n requestFullscreen: () => codeEditorElement.requestFullscreen(),\n // Safari\n webkitRequestFullscreen: () => (codeEditorElement).webkitRequestFullscreen(),\n // IE\n msRequestFullscreen: () => (codeEditorElement).msRequestFullscreen(),\n // Firefox\n mozRequestFullScreen: () => (codeEditorElement).mozRequestFullScreen(),\n };\n\n for (const handler of Object.keys(fullScreenMap)) {\n if (codeEditorElement[handler]) {\n fullScreenMap[handler]();\n }\n }\n }\n this._isFullScreen = true;\n }\n\n /**\n * exitFullScreenEditor request to exit full screen of Code Editor based on its browser type.\n */\n public exitFullScreenEditor(): void {\n if (this._componentInitialized) {\n const exitFullScreenMap: object = {\n // Chrome\n exitFullscreen: () => document.exitFullscreen(),\n // Safari\n webkitExitFullscreen: () => (document).webkitExitFullscreen(),\n // Firefox\n mozCancelFullScreen: () => (document).mozCancelFullScreen(),\n // IE\n msExitFullscreen: () => (document).msExitFullscreen(),\n };\n\n for (const handler of Object.keys(exitFullScreenMap)) {\n if (document[handler]) {\n exitFullScreenMap[handler]();\n }\n }\n }\n this._isFullScreen = false;\n }\n\n /**\n * addFullScreenModeCommand used to add the fullscreen option to the context menu\n */\n private addFullScreenModeCommand(): void {\n this._editor.addAction({\n // An unique identifier of the contributed action.\n id: 'fullScreen',\n // A label of the action that will be presented to the user.\n label: 'Full Screen',\n // An optional array of keybindings for the action.\n contextMenuGroupId: 'navigation',\n keybindings: this._keycode,\n contextMenuOrder: 1.5,\n // Method that will be executed when the action is triggered.\n // @param editor The editor instance is passed in as a convinience\n run: (ed: any) => {\n this.showFullScreenEditor();\n },\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\n\nimport { TdCodeEditorComponent } from './code-editor.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TdCodeEditorComponent],\n exports: [TdCodeEditorComponent],\n bootstrap: [TdCodeEditorComponent],\n})\nexport class CovalentCodeEditorModule {}\n"],"names":["Subject","EventEmitter","monaco.editor","monaco.languages","merge","fromEvent","debounceTime","distinctUntilChanged","takeUntil","timer","Component","NG_VALUE_ACCESSOR","forwardRef","NgZone","ChangeDetectorRef","ElementRef","ViewChild","Output","Input","NgModule","CommonModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;IAcA;IAEA,IAAI,aAAa,GAAG,UAAS,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,MAAM,CAAC,cAAc;aAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;YAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;oBAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtG,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;aAEc,SAAS,CAAC,CAAC,EAAE,CAAC;QAC1B,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpB,SAAS,EAAE,KAAK,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;QACvC,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC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AC,OAAO;uCAiBbA,UAAK,SAAC,sBAAsB;gCAa5BA,UAAK,SAAC,eAAe;;;;;;;QA1OtB,yCAA4D;;;;;QAC5D,8CAA+D;;;;;QAC/D,+CAAgE;;;;;QAEhE,6CAA+E;;;;;QAC/E,uCAA4B;;;;;QAC5B,uCAA8B;;;;;QAC9B,0CAAyC;;;;;QACzC,yCAAkD;;;;;QAClD,sDAAiF;;;;;QACjF,wCAAqB;;;;;QACrB,4CAAqC;;;;;QACrC,sDAA+C;;;;;QAC/C,+CAAiC;;;;;QACjC,8CAAuC;;;;;QACvC,yCAAsB;;;;;QACtB,2DAA4D;;QAE5D,iDAA6E;;;;;;QAM7E,kDAA2E;;;;;;QAM3E,2DAAoF;;;;;;QAMpF,sDAA+E;;;;;;QAM/E,kDAA2E;;;;;;QAM3E,uCAAgE;;QAEhE,gDAAiC;;QACjC,0CAAuB;;;;;QAoNX,qCAAoB;;;;;QAAE,mDAA6C;;;;;QAAE,4CAA+B;;;;;;;;;QCpSlH;;;;;gBANCC,aAAQ,SAAC;oBACR,OAAO,EAAE,CAACC,mBAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,qBAAqB,CAAC;oBACrC,OAAO,EAAE,CAAC,qBAAqB,CAAC;oBAChC,SAAS,EAAE,CAAC,qBAAqB,CAAC;iBACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} -------------------------------------------------------------------------------- /bundles/covalent-code-editor.umd.min.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("rxjs"),require("rxjs/operators"),require("monaco-editor/esm/vs/editor/editor.api"),require("@angular/common")):"function"==typeof define&&define.amd?define("@covalent/code-editor",["exports","@angular/core","@angular/forms","rxjs","rxjs/operators","monaco-editor/esm/vs/editor/editor.api","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).covalent=e.covalent||{},e.covalent["code-editor"]={}),e.ng.core,e.ng.forms,e.rxjs,e.rxjs.operators,e.monaco,e.ng.common)}(this,(function(exports,core,forms,rxjs,operators,monaco,common){"use strict"; 2 | /*! ***************************************************************************** 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14 | PERFORMANCE OF THIS SOFTWARE. 15 | ***************************************************************************** */var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=0;u--)(r=e[u])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function __param(e,t){return function(n,o){t(n,o,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function u(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((o=o.apply(e,t||[])).next())}))}function __generator(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function __spread(){for(var e=[],t=0;t1||u(e,t)}))})}function u(e,t){try{(n=r[e](t)).value instanceof __await?Promise.resolve(n.value.v).then(c,l):s(i[0][2],n)}catch(e){s(i[0][3],e)}var n}function c(e){u("next",e)}function l(e){u("throw",e)}function s(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function __asyncDelegator(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:__await(e[o](t)),done:"return"===o}:r?r(t):t}:r}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var __setModuleDefault=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&__createBinding(t,e,n);return __setModuleDefault(t,e),t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}var noop=function(){},ɵ0=noop,uniqueCounter=0,TdCodeEditorComponent=function(){function TdCodeEditorComponent(e,t,n){this.zone=e,this._changeDetectorRef=t,this._elementRef=n,this._destroy=new rxjs.Subject,this._widthSubject=new rxjs.Subject,this._heightSubject=new rxjs.Subject,this._editorStyle="width:100%;height:100%;border:1px solid grey;",this._value="",this._theme="vs",this._language="javascript",this._subject=new rxjs.Subject,this._editorInnerContainer="editorInnerContainer"+uniqueCounter++,this._fromEditor=!1,this._componentInitialized=!1,this._editorOptions={},this._isFullScreen=!1,this._registeredLanguagesStyles=[],this.editorInitialized=new core.EventEmitter,this.editorConfigurationChanged=new core.EventEmitter,this.editorLanguageChanged=new core.EventEmitter,this.editorValueChange=new core.EventEmitter,this.change=new core.EventEmitter,this.propagateChange=function(e){},this.onTouched=function(){return noop}}return Object.defineProperty(TdCodeEditorComponent.prototype,"value",{get:function(){return this._value},set:function(e){e!==this._value&&(this._value=e,this._componentInitialized&&this.applyValue())},enumerable:!1,configurable:!0}),TdCodeEditorComponent.prototype.applyValue=function(){this._fromEditor||this._editor.setValue(this._value),this._fromEditor=!1,this.propagateChange(this._value),this.change.emit(),this.editorValueChange.emit()},TdCodeEditorComponent.prototype.writeValue=function(e){null!=e&&(this.value=e)},TdCodeEditorComponent.prototype.registerOnChange=function(e){this.propagateChange=e},TdCodeEditorComponent.prototype.registerOnTouched=function(e){this.onTouched=e},TdCodeEditorComponent.prototype.getValue=function(){var e=this;if(this._componentInitialized)return setTimeout((function(){e._subject.next(e._value),e._subject.complete(),e._subject=new rxjs.Subject})),this._subject.asObservable()},Object.defineProperty(TdCodeEditorComponent.prototype,"language",{get:function(){return this._language},set:function(e){this._language=e,this._componentInitialized&&this.applyLanguage()},enumerable:!1,configurable:!0}),TdCodeEditorComponent.prototype.applyLanguage=function(){this._language&&(monaco.editor.setModelLanguage(this._editor.getModel(),this._language),this.editorLanguageChanged.emit())},TdCodeEditorComponent.prototype.registerLanguage=function(language){var e_1,_a,e_2,_b;if(this._componentInitialized){try{for(var _c=__values(language.completionItemProvider),_d=_c.next();!_d.done;_d=_c.next()){var provider=_d.value;provider.kind=eval(provider.kind)}}catch(e){e_1={error:e}}finally{try{_d&&!_d.done&&(_a=_c.return)&&_a.call(_c)}finally{if(e_1)throw e_1.error}}try{for(var _e=__values(language.monarchTokensProvider),_f=_e.next();!_f.done;_f=_e.next()){var monarchTokens=_f.value;monarchTokens[0]=eval(monarchTokens[0])}}catch(e){e_2={error:e}}finally{try{_f&&!_f.done&&(_b=_e.return)&&_b.call(_e)}finally{if(e_2)throw e_2.error}}monaco.languages.register({id:language.id}),monaco.languages.setMonarchTokensProvider(language.id,{tokenizer:{root:language.monarchTokensProvider}}),monaco.editor.defineTheme(language.customTheme.id,language.customTheme.theme),this._theme=language.customTheme.id,monaco.languages.registerCompletionItemProvider(language.id,{provideCompletionItems:function(){return language.completionItemProvider}});var css=document.createElement("style");css.type="text/css",css.innerHTML=language.monarchTokensProviderCSS,document.body.appendChild(css),this.editorConfigurationChanged.emit(),this._registeredLanguagesStyles=__spread(this._registeredLanguagesStyles,[css])}},Object.defineProperty(TdCodeEditorComponent.prototype,"editorStyle",{get:function(){return this._editorStyle},set:function(e){this._editorStyle=e,this._componentInitialized&&this.applyStyle()},enumerable:!1,configurable:!0}),TdCodeEditorComponent.prototype.applyStyle=function(){this._editorStyle&&this._editorContainer.nativeElement.setAttribute("style",this._editorStyle)},Object.defineProperty(TdCodeEditorComponent.prototype,"theme",{get:function(){return this._theme},set:function(e){this._theme=e,this._componentInitialized&&(this._editor.updateOptions({theme:e}),this.editorConfigurationChanged.emit())},enumerable:!1,configurable:!0}),Object.defineProperty(TdCodeEditorComponent.prototype,"fullScreenKeyBinding",{get:function(){return this._keycode},set:function(e){this._keycode=e},enumerable:!1,configurable:!0}),Object.defineProperty(TdCodeEditorComponent.prototype,"editorOptions",{get:function(){return this._editorOptions},set:function(e){this._editorOptions=e,this._componentInitialized&&(this._editor.updateOptions(e),this.editorConfigurationChanged.emit())},enumerable:!1,configurable:!0}),TdCodeEditorComponent.prototype.layout=function(){this._componentInitialized&&this._editor.layout()},Object.defineProperty(TdCodeEditorComponent.prototype,"isFullScreen",{get:function(){return this._isFullScreen},enumerable:!1,configurable:!0}),TdCodeEditorComponent.prototype.ngOnInit=function(){var e=this,t=this._editorContainer.nativeElement;t.id=this._editorInnerContainer,this._editor=monaco.editor.create(t,Object.assign({value:this._value,language:this.language,theme:this._theme},this.editorOptions)),this._componentInitialized=!0,setTimeout((function(){e.applyLanguage(),e._fromEditor=!0,e.applyValue(),e.applyStyle(),e.editorInitialized.emit(e._editor),e.editorConfigurationChanged.emit()})),this._editor.getModel().onDidChangeContent((function(t){e._fromEditor=!0,e.writeValue(e._editor.getValue()),e.layout()})),this.addFullScreenModeCommand(),rxjs.merge(rxjs.fromEvent(window,"resize").pipe(operators.debounceTime(100)),this._widthSubject.asObservable().pipe(operators.distinctUntilChanged()),this._heightSubject.asObservable().pipe(operators.distinctUntilChanged())).pipe(operators.takeUntil(this._destroy),operators.debounceTime(100)).subscribe((function(){e.layout(),e._changeDetectorRef.markForCheck()})),rxjs.timer(500,250).pipe(operators.takeUntil(this._destroy)).subscribe((function(){e._elementRef&&e._elementRef.nativeElement&&(e._widthSubject.next(e._elementRef.nativeElement.getBoundingClientRect().width),e._heightSubject.next(e._elementRef.nativeElement.getBoundingClientRect().height))}))},TdCodeEditorComponent.prototype.ngOnDestroy=function(){this._changeDetectorRef.detach(),this._registeredLanguagesStyles.forEach((function(e){return e.remove()})),this._editor&&this._editor.dispose(),this._destroy.next(!0),this._destroy.unsubscribe()},TdCodeEditorComponent.prototype.showFullScreenEditor=function(){var e,t;if(this._componentInitialized){var n=this._editorContainer.nativeElement,o={requestFullscreen:function(){return n.requestFullscreen()},webkitRequestFullscreen:function(){return n.webkitRequestFullscreen()},msRequestFullscreen:function(){return n.msRequestFullscreen()},mozRequestFullScreen:function(){return n.mozRequestFullScreen()}};try{for(var r=__values(Object.keys(o)),i=r.next();!i.done;i=r.next()){var a=i.value;n[a]&&o[a]()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}}this._isFullScreen=!0},TdCodeEditorComponent.prototype.exitFullScreenEditor=function(){var e,t;if(this._componentInitialized){var n={exitFullscreen:function(){return document.exitFullscreen()},webkitExitFullscreen:function(){return document.webkitExitFullscreen()},mozCancelFullScreen:function(){return document.mozCancelFullScreen()},msExitFullscreen:function(){return document.msExitFullscreen()}};try{for(var o=__values(Object.keys(n)),r=o.next();!r.done;r=o.next()){var i=r.value;document[i]&&n[i]()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}this._isFullScreen=!1},TdCodeEditorComponent.prototype.addFullScreenModeCommand=function(){var e=this;this._editor.addAction({id:"fullScreen",label:"Full Screen",contextMenuGroupId:"navigation",keybindings:this._keycode,contextMenuOrder:1.5,run:function(t){e.showFullScreenEditor()}})},TdCodeEditorComponent}();TdCodeEditorComponent.decorators=[{type:core.Component,args:[{selector:"td-code-editor",template:'
\n',providers:[{provide:forms.NG_VALUE_ACCESSOR,useExisting:core.forwardRef((function(){return TdCodeEditorComponent})),multi:!0}],styles:[":host{display:block;position:relative}:host .editorContainer{bottom:0;left:0;position:absolute;right:0;top:0}::ng-deep .monaco-aria-container{display:none}"]}]}],TdCodeEditorComponent.ctorParameters=function(){return[{type:core.NgZone},{type:core.ChangeDetectorRef},{type:core.ElementRef}]},TdCodeEditorComponent.propDecorators={_editorContainer:[{type:core.ViewChild,args:["editorContainer",{static:!0}]}],editorInitialized:[{type:core.Output}],editorConfigurationChanged:[{type:core.Output}],editorLanguageChanged:[{type:core.Output}],editorValueChange:[{type:core.Output}],change:[{type:core.Output}],value:[{type:core.Input,args:["value"]}],language:[{type:core.Input,args:["language"]}],editorStyle:[{type:core.Input,args:["editorStyle"]}],theme:[{type:core.Input,args:["theme"]}],fullScreenKeyBinding:[{type:core.Input,args:["fullScreenKeyBinding"]}],editorOptions:[{type:core.Input,args:["editorOptions"]}]};var CovalentCodeEditorModule=function(){};CovalentCodeEditorModule.decorators=[{type:core.NgModule,args:[{imports:[common.CommonModule],declarations:[TdCodeEditorComponent],exports:[TdCodeEditorComponent],bootstrap:[TdCodeEditorComponent]}]}],exports.CovalentCodeEditorModule=CovalentCodeEditorModule,exports.TdCodeEditorComponent=TdCodeEditorComponent,Object.defineProperty(exports,"__esModule",{value:!0})})); 16 | //# sourceMappingURL=covalent-code-editor.umd.min.js.map -------------------------------------------------------------------------------- /bundles/covalent-code-editor.umd.min.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../../../node_modules/tslib/tslib.es6.js","../../../../src/platform/code-editor/code-editor.component.ts","../../../../src/platform/code-editor/code-editor.module.ts"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","key","desc","c","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__createBinding","o","m","k","k2","undefined","enumerable","get","__exportStar","__values","__read","ar","error","__spread","concat","__spreadArrays","il","a","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__setModuleDefault","__importStar","mod","__esModule","__importDefault","default","__classPrivateFieldGet","receiver","privateMap","has","__classPrivateFieldSet","set","noop","uniqueCounter","TdCodeEditorComponent","zone","_changeDetectorRef","_elementRef","_destroy","Subject","_widthSubject","_heightSubject","_editorStyle","_value","_theme","_language","_subject","_editorInnerContainer","_fromEditor","_componentInitialized","_editorOptions","_isFullScreen","_registeredLanguagesStyles","editorInitialized","EventEmitter","editorConfigurationChanged","editorLanguageChanged","editorValueChange","change","propagateChange","onTouched","applyValue","_editor","setValue","emit","writeValue","registerOnChange","fn","registerOnTouched","getValue","_this","setTimeout","complete","asObservable","language","applyLanguage","monaco.editor","setModelLanguage","getModel","registerLanguage","_c","completionItemProvider","_d","provider","kind","eval","_e","monarchTokensProvider","_f","monarchTokens","monaco.languages","register","id","setMonarchTokensProvider","tokenizer","root","defineTheme","customTheme","theme","registerCompletionItemProvider","provideCompletionItems","css","document","createElement","type","innerHTML","monarchTokensProviderCSS","appendChild","editorStyle","applyStyle","_editorContainer","nativeElement","setAttribute","updateOptions","_keycode","keycode","editorOptions","layout","ngOnInit","containerDiv","onDidChangeContent","addFullScreenModeCommand","merge","fromEvent","window","pipe","debounceTime","distinctUntilChanged","takeUntil","subscribe","markForCheck","timer","getBoundingClientRect","width","height","ngOnDestroy","detach","forEach","style","remove","dispose","unsubscribe","showFullScreenEditor","codeEditorElement_1","fullScreenMap","requestFullscreen","webkitRequestFullscreen","msRequestFullscreen","mozRequestFullScreen","_b","keys","handler","exitFullScreenEditor","exitFullScreenMap","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","addAction","contextMenuGroupId","keybindings","contextMenuOrder","run","ed","Component","args","selector","template","providers","provide","NG_VALUE_ACCESSOR","useExisting","forwardRef","multi","NgZone","ChangeDetectorRef","ElementRef","ViewChild","static","Output","Input","NgModule","imports","CommonModule","declarations","exports","bootstrap"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,cAAgB,SAASC,EAAGC,GAI5B,OAHAF,cAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAKL,EAAEK,MAC3EN,EAAGC,aAGZS,UAAUV,EAAGC,GAEzB,SAASU,IAAOC,KAAKC,YAAcb,EADnCD,cAAcC,EAAGC,GAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOY,OAAOb,IAAMU,EAAGJ,UAAYN,EAAEM,UAAW,IAAII,GAG5E,IAAII,SAAW,WAQlB,OAPAA,SAAWb,OAAOc,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGC,EAAI,EAAGC,EAAIC,UAAUC,OAAQH,EAAIC,EAAGD,IAE5C,IAAK,IAAIb,KADTY,EAAIG,UAAUF,GACOjB,OAAOK,UAAUC,eAAeC,KAAKS,EAAGZ,KAAIW,EAAEX,GAAKY,EAAEZ,IAE9E,OAAOW,IAEKM,MAAMX,KAAMS,qBAGhBG,OAAON,EAAGO,GACt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O,4OA3BXC,KAAAA,cACAC,KAAAA,yBAHAC,KAAAA,4EAoDCC,KAAAA,UAASZ,KAAA,CAAC,kBAAmB,CAAEa,QAAQ,+BAMvCC,KAAAA,2CAMAA,KAAAA,sCAMAA,KAAAA,kCAMAA,KAAAA,uBAMAA,KAAAA,sBAQAC,KAAAA,MAAKf,KAAA,CAAC,2BA6DNe,KAAAA,MAAKf,KAAA,CAAC,iCAgENe,KAAAA,MAAKf,KAAA,CAAC,8BAuBNe,KAAAA,MAAKf,KAAA,CAAC,uCAiBNe,KAAAA,MAAKf,KAAA,CAAC,+CAaNe,KAAAA,MAAKf,KAAA,CAAC,iDCvQT,wDANCgB,KAAAA,SAAQhB,KAAA,CAAC,CACRiB,QAAS,CAACC,OAAAA,cACVC,aAAc,CAACtJ,uBACfuJ,QAAS,CAACvJ,uBACVwJ,UAAW,CAACxJ","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import {\n Component,\n Input,\n Output,\n EventEmitter,\n OnInit,\n ViewChild,\n ElementRef,\n forwardRef,\n NgZone,\n ChangeDetectorRef,\n OnDestroy,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { Observable, Subject } from 'rxjs';\nimport { fromEvent, merge, timer } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\n// Use esm version to support shipping subset of languages and features\nimport * as monaco from 'monaco-editor/esm/vs/editor/editor.api';\n\nconst noop: any = () => {\n // empty method\n};\n\n// counter for ids to allow for multiple editors on one page\nlet uniqueCounter: number = 0;\n\n@Component({\n selector: 'td-code-editor',\n templateUrl: './code-editor.component.html',\n styleUrls: ['./code-editor.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdCodeEditorComponent),\n multi: true,\n },\n ],\n})\nexport class TdCodeEditorComponent implements OnInit, ControlValueAccessor, OnDestroy {\n private _destroy: Subject = new Subject();\n private _widthSubject: Subject = new Subject();\n private _heightSubject: Subject = new Subject();\n\n private _editorStyle: string = 'width:100%;height:100%;border:1px solid grey;';\n private _value: string = '';\n private _theme: string = 'vs';\n private _language: string = 'javascript';\n private _subject: Subject = new Subject();\n private _editorInnerContainer: string = 'editorInnerContainer' + uniqueCounter++;\n private _editor: any;\n private _fromEditor: boolean = false;\n private _componentInitialized: boolean = false;\n private _editorOptions: any = {};\n private _isFullScreen: boolean = false;\n private _keycode: any;\n private _registeredLanguagesStyles: HTMLStyleElement[] = [];\n\n @ViewChild('editorContainer', { static: true }) _editorContainer: ElementRef;\n\n /**\n * editorInitialized: function($event)\n * Event emitted when editor is first initialized\n */\n @Output() editorInitialized: EventEmitter = new EventEmitter();\n\n /**\n * editorConfigurationChanged: function($event)\n * Event emitted when editor's configuration changes\n */\n @Output() editorConfigurationChanged: EventEmitter = new EventEmitter();\n\n /**\n * editorLanguageChanged: function($event)\n * Event emitted when editor's Language changes\n */\n @Output() editorLanguageChanged: EventEmitter = new EventEmitter();\n\n /**\n * editorValueChange: function($event)\n * Event emitted any time something changes the editor value\n */\n @Output() editorValueChange: EventEmitter = new EventEmitter();\n\n /**\n * The change event notifies you about a change happening in an input field.\n * Since the component is not a native Angular component have to specifiy the event emitter ourself\n */\n @Output() change: EventEmitter = new EventEmitter();\n /* tslint:disable-next-line */\n propagateChange = (_: any) => {};\n onTouched = () => noop;\n\n /**\n * value?: string\n */\n @Input('value')\n set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value;\n if (this._componentInitialized) {\n this.applyValue();\n }\n }\n\n get value(): string {\n return this._value;\n }\n\n applyValue(): void {\n if (!this._fromEditor) {\n this._editor.setValue(this._value);\n }\n this._fromEditor = false;\n this.propagateChange(this._value);\n this.change.emit();\n this.editorValueChange.emit();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n writeValue(value: any): void {\n // do not write if null or undefined\n // tslint:disable-next-line\n if (value != undefined) {\n this.value = value;\n }\n }\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * getEditorContent?: function\n * Returns the content within the editor\n */\n getValue(): Observable {\n if (this._componentInitialized) {\n setTimeout(() => {\n this._subject.next(this._value);\n this._subject.complete();\n this._subject = new Subject();\n });\n return this._subject.asObservable();\n }\n }\n\n /**\n * language?: string\n * language used in editor\n */\n @Input('language')\n set language(language: string) {\n this._language = language;\n if (this._componentInitialized) {\n this.applyLanguage();\n }\n }\n\n get language(): string {\n return this._language;\n }\n\n applyLanguage(): void {\n if (this._language) {\n monaco.editor.setModelLanguage(this._editor.getModel(), this._language);\n this.editorLanguageChanged.emit();\n }\n }\n\n /**\n * registerLanguage?: function\n * Registers a custom Language within the editor\n */\n registerLanguage(language: any): void {\n if (this._componentInitialized) {\n for (const provider of language.completionItemProvider) {\n /* tslint:disable-next-line */\n provider.kind = eval(provider.kind);\n }\n for (const monarchTokens of language.monarchTokensProvider) {\n /* tslint:disable-next-line */\n monarchTokens[0] = eval(monarchTokens[0]);\n }\n monaco.languages.register({ id: language.id });\n\n monaco.languages.setMonarchTokensProvider(language.id, {\n tokenizer: {\n root: language.monarchTokensProvider,\n },\n });\n\n // Define a new theme that constains only rules that match this language\n monaco.editor.defineTheme(language.customTheme.id, language.customTheme.theme);\n this._theme = language.customTheme.id;\n\n monaco.languages.registerCompletionItemProvider(language.id, {\n provideCompletionItems: () => {\n return language.completionItemProvider;\n },\n });\n\n const css: HTMLStyleElement = document.createElement('style');\n css.type = 'text/css';\n css.innerHTML = language.monarchTokensProviderCSS;\n document.body.appendChild(css);\n this.editorConfigurationChanged.emit();\n this._registeredLanguagesStyles = [...this._registeredLanguagesStyles, css];\n }\n }\n\n /**\n * style?: string\n * css style of the editor on the page\n */\n @Input('editorStyle')\n set editorStyle(editorStyle: string) {\n this._editorStyle = editorStyle;\n if (this._componentInitialized) {\n this.applyStyle();\n }\n }\n\n get editorStyle(): string {\n return this._editorStyle;\n }\n\n applyStyle(): void {\n if (this._editorStyle) {\n const containerDiv: HTMLDivElement = this._editorContainer.nativeElement;\n containerDiv.setAttribute('style', this._editorStyle);\n }\n }\n\n /**\n * theme?: string\n * Theme to be applied to editor\n */\n @Input('theme')\n set theme(theme: string) {\n this._theme = theme;\n if (this._componentInitialized) {\n this._editor.updateOptions({ theme });\n this.editorConfigurationChanged.emit();\n }\n }\n get theme(): string {\n return this._theme;\n }\n\n /**\n * fullScreenKeyBinding?: number\n * See here for key bindings https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html\n * Sets the KeyCode for shortcutting to Fullscreen mode\n */\n @Input('fullScreenKeyBinding')\n set fullScreenKeyBinding(keycode: number[]) {\n this._keycode = keycode;\n }\n get fullScreenKeyBinding(): number[] {\n return this._keycode;\n }\n\n /**\n * editorOptions?: object\n * Options used on editor instantiation. Available options listed here:\n * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html\n */\n @Input('editorOptions')\n set editorOptions(editorOptions: any) {\n this._editorOptions = editorOptions;\n if (this._componentInitialized) {\n this._editor.updateOptions(editorOptions);\n this.editorConfigurationChanged.emit();\n }\n }\n get editorOptions(): any {\n return this._editorOptions;\n }\n\n /**\n * layout method that calls layout method of editor and instructs the editor to remeasure its container\n */\n layout(): void {\n if (this._componentInitialized) {\n this._editor.layout();\n }\n }\n\n /**\n * Returns if in Full Screen Mode or not\n */\n get isFullScreen(): boolean {\n return this._isFullScreen;\n }\n\n // tslint:disable-next-line:member-ordering\n constructor(private zone: NgZone, private _changeDetectorRef: ChangeDetectorRef, private _elementRef: ElementRef) {}\n\n ngOnInit(): void {\n const containerDiv: HTMLDivElement = this._editorContainer.nativeElement;\n containerDiv.id = this._editorInnerContainer;\n\n this._editor = monaco.editor.create(\n containerDiv,\n Object.assign(\n {\n value: this._value,\n language: this.language,\n theme: this._theme,\n },\n this.editorOptions,\n ),\n );\n this._componentInitialized = true;\n setTimeout(() => {\n this.applyLanguage();\n this._fromEditor = true;\n this.applyValue();\n this.applyStyle();\n this.editorInitialized.emit(this._editor);\n this.editorConfigurationChanged.emit();\n });\n this._editor.getModel().onDidChangeContent((e: any) => {\n this._fromEditor = true;\n this.writeValue(this._editor.getValue());\n this.layout();\n });\n this.addFullScreenModeCommand();\n\n merge(\n fromEvent(window, 'resize').pipe(debounceTime(100)),\n this._widthSubject.asObservable().pipe(distinctUntilChanged()),\n this._heightSubject.asObservable().pipe(distinctUntilChanged()),\n )\n .pipe(takeUntil(this._destroy), debounceTime(100))\n .subscribe(() => {\n this.layout();\n this._changeDetectorRef.markForCheck();\n });\n timer(500, 250)\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n if (this._elementRef && this._elementRef.nativeElement) {\n this._widthSubject.next((this._elementRef.nativeElement).getBoundingClientRect().width);\n this._heightSubject.next((this._elementRef.nativeElement).getBoundingClientRect().height);\n }\n });\n }\n\n ngOnDestroy(): void {\n this._changeDetectorRef.detach();\n this._registeredLanguagesStyles.forEach((style: HTMLStyleElement) => style.remove());\n if (this._editor) {\n this._editor.dispose();\n }\n this._destroy.next(true);\n this._destroy.unsubscribe();\n }\n\n /**\n * showFullScreenEditor request for full screen of Code Editor based on its browser type.\n */\n public showFullScreenEditor(): void {\n if (this._componentInitialized) {\n const codeEditorElement: HTMLDivElement = this._editorContainer.nativeElement as HTMLDivElement;\n const fullScreenMap: object = {\n // Chrome\n requestFullscreen: () => codeEditorElement.requestFullscreen(),\n // Safari\n webkitRequestFullscreen: () => (codeEditorElement).webkitRequestFullscreen(),\n // IE\n msRequestFullscreen: () => (codeEditorElement).msRequestFullscreen(),\n // Firefox\n mozRequestFullScreen: () => (codeEditorElement).mozRequestFullScreen(),\n };\n\n for (const handler of Object.keys(fullScreenMap)) {\n if (codeEditorElement[handler]) {\n fullScreenMap[handler]();\n }\n }\n }\n this._isFullScreen = true;\n }\n\n /**\n * exitFullScreenEditor request to exit full screen of Code Editor based on its browser type.\n */\n public exitFullScreenEditor(): void {\n if (this._componentInitialized) {\n const exitFullScreenMap: object = {\n // Chrome\n exitFullscreen: () => document.exitFullscreen(),\n // Safari\n webkitExitFullscreen: () => (document).webkitExitFullscreen(),\n // Firefox\n mozCancelFullScreen: () => (document).mozCancelFullScreen(),\n // IE\n msExitFullscreen: () => (document).msExitFullscreen(),\n };\n\n for (const handler of Object.keys(exitFullScreenMap)) {\n if (document[handler]) {\n exitFullScreenMap[handler]();\n }\n }\n }\n this._isFullScreen = false;\n }\n\n /**\n * addFullScreenModeCommand used to add the fullscreen option to the context menu\n */\n private addFullScreenModeCommand(): void {\n this._editor.addAction({\n // An unique identifier of the contributed action.\n id: 'fullScreen',\n // A label of the action that will be presented to the user.\n label: 'Full Screen',\n // An optional array of keybindings for the action.\n contextMenuGroupId: 'navigation',\n keybindings: this._keycode,\n contextMenuOrder: 1.5,\n // Method that will be executed when the action is triggered.\n // @param editor The editor instance is passed in as a convinience\n run: (ed: any) => {\n this.showFullScreenEditor();\n },\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\n\nimport { TdCodeEditorComponent } from './code-editor.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TdCodeEditorComponent],\n exports: [TdCodeEditorComponent],\n bootstrap: [TdCodeEditorComponent],\n})\nexport class CovalentCodeEditorModule {}\n"]} -------------------------------------------------------------------------------- /code-editor.component.d.ts: -------------------------------------------------------------------------------- 1 | import { EventEmitter, OnInit, ElementRef, NgZone, ChangeDetectorRef, OnDestroy } from '@angular/core'; 2 | import { ControlValueAccessor } from '@angular/forms'; 3 | import { Observable } from 'rxjs'; 4 | export declare class TdCodeEditorComponent implements OnInit, ControlValueAccessor, OnDestroy { 5 | private zone; 6 | private _changeDetectorRef; 7 | private _elementRef; 8 | private _destroy; 9 | private _widthSubject; 10 | private _heightSubject; 11 | private _editorStyle; 12 | private _value; 13 | private _theme; 14 | private _language; 15 | private _subject; 16 | private _editorInnerContainer; 17 | private _editor; 18 | private _fromEditor; 19 | private _componentInitialized; 20 | private _editorOptions; 21 | private _isFullScreen; 22 | private _keycode; 23 | private _registeredLanguagesStyles; 24 | _editorContainer: ElementRef; 25 | /** 26 | * editorInitialized: function($event) 27 | * Event emitted when editor is first initialized 28 | */ 29 | editorInitialized: EventEmitter; 30 | /** 31 | * editorConfigurationChanged: function($event) 32 | * Event emitted when editor's configuration changes 33 | */ 34 | editorConfigurationChanged: EventEmitter; 35 | /** 36 | * editorLanguageChanged: function($event) 37 | * Event emitted when editor's Language changes 38 | */ 39 | editorLanguageChanged: EventEmitter; 40 | /** 41 | * editorValueChange: function($event) 42 | * Event emitted any time something changes the editor value 43 | */ 44 | editorValueChange: EventEmitter; 45 | /** 46 | * The change event notifies you about a change happening in an input field. 47 | * Since the component is not a native Angular component have to specifiy the event emitter ourself 48 | */ 49 | change: EventEmitter; 50 | propagateChange: (_: any) => void; 51 | onTouched: () => any; 52 | /** 53 | * value?: string 54 | */ 55 | set value(value: string); 56 | get value(): string; 57 | applyValue(): void; 58 | /** 59 | * Implemented as part of ControlValueAccessor. 60 | */ 61 | writeValue(value: any): void; 62 | registerOnChange(fn: any): void; 63 | registerOnTouched(fn: any): void; 64 | /** 65 | * getEditorContent?: function 66 | * Returns the content within the editor 67 | */ 68 | getValue(): Observable; 69 | /** 70 | * language?: string 71 | * language used in editor 72 | */ 73 | set language(language: string); 74 | get language(): string; 75 | applyLanguage(): void; 76 | /** 77 | * registerLanguage?: function 78 | * Registers a custom Language within the editor 79 | */ 80 | registerLanguage(language: any): void; 81 | /** 82 | * style?: string 83 | * css style of the editor on the page 84 | */ 85 | set editorStyle(editorStyle: string); 86 | get editorStyle(): string; 87 | applyStyle(): void; 88 | /** 89 | * theme?: string 90 | * Theme to be applied to editor 91 | */ 92 | set theme(theme: string); 93 | get theme(): string; 94 | /** 95 | * fullScreenKeyBinding?: number 96 | * See here for key bindings https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html 97 | * Sets the KeyCode for shortcutting to Fullscreen mode 98 | */ 99 | set fullScreenKeyBinding(keycode: number[]); 100 | get fullScreenKeyBinding(): number[]; 101 | /** 102 | * editorOptions?: object 103 | * Options used on editor instantiation. Available options listed here: 104 | * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html 105 | */ 106 | set editorOptions(editorOptions: any); 107 | get editorOptions(): any; 108 | /** 109 | * layout method that calls layout method of editor and instructs the editor to remeasure its container 110 | */ 111 | layout(): void; 112 | /** 113 | * Returns if in Full Screen Mode or not 114 | */ 115 | get isFullScreen(): boolean; 116 | constructor(zone: NgZone, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef); 117 | ngOnInit(): void; 118 | ngOnDestroy(): void; 119 | /** 120 | * showFullScreenEditor request for full screen of Code Editor based on its browser type. 121 | */ 122 | showFullScreenEditor(): void; 123 | /** 124 | * exitFullScreenEditor request to exit full screen of Code Editor based on its browser type. 125 | */ 126 | exitFullScreenEditor(): void; 127 | /** 128 | * addFullScreenModeCommand used to add the fullscreen option to the context menu 129 | */ 130 | private addFullScreenModeCommand; 131 | } 132 | -------------------------------------------------------------------------------- /code-editor.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | position: relative; 4 | .editorContainer { 5 | position: absolute; 6 | top: 0; 7 | bottom: 0; 8 | left: 0; 9 | right: 0; 10 | } 11 | } 12 | 13 | ::ng-deep { 14 | // hide this part of monaco so it doesnt add height 15 | .monaco-aria-container { 16 | display: none; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /code-editor.module.d.ts: -------------------------------------------------------------------------------- 1 | export declare class CovalentCodeEditorModule { 2 | } 3 | -------------------------------------------------------------------------------- /covalent-code-editor.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Generated bundle index. Do not edit. 3 | */ 4 | export * from './index'; 5 | -------------------------------------------------------------------------------- /covalent-code-editor.metadata.json: -------------------------------------------------------------------------------- 1 | {"__symbolic":"module","version":4,"metadata":{"TdCodeEditorComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":28,"character":1},"arguments":[{"selector":"td-code-editor","providers":[{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR","line":34,"character":15},"useExisting":{"__symbolic":"reference","name":"TdCodeEditorComponent"},"multi":true}],"template":"
\n","styles":[":host{display:block;position:relative}:host .editorContainer{bottom:0;left:0;position:absolute;right:0;top:0}::ng-deep .monaco-aria-container{display:none}"]}]}],"members":{"_editorContainer":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":59,"character":3},"arguments":["editorContainer",{"static":true}]}]}],"editorInitialized":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":65,"character":3}}]}],"editorConfigurationChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":71,"character":3}}]}],"editorLanguageChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":77,"character":3}}]}],"editorValueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":83,"character":3}}]}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":89,"character":3}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":3},"arguments":["value"]}]}],"applyValue":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"getValue":[{"__symbolic":"method"}],"language":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":158,"character":3},"arguments":["language"]}]}],"applyLanguage":[{"__symbolic":"method"}],"registerLanguage":[{"__symbolic":"method"}],"editorStyle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":222,"character":3},"arguments":["editorStyle"]}]}],"applyStyle":[{"__symbolic":"method"}],"theme":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":245,"character":3},"arguments":["theme"]}]}],"fullScreenKeyBinding":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":262,"character":3},"arguments":["fullScreenKeyBinding"]}]}],"editorOptions":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":275,"character":3},"arguments":["editorOptions"]}]}],"layout":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":304,"character":28},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":304,"character":64},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":304,"character":104}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"showFullScreenEditor":[{"__symbolic":"method"}],"exitFullScreenEditor":[{"__symbolic":"method"}],"addFullScreenModeCommand":[{"__symbolic":"method"}]}},"CovalentCodeEditorModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":6,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":12}],"declarations":[{"__symbolic":"reference","name":"TdCodeEditorComponent"}],"exports":[{"__symbolic":"reference","name":"TdCodeEditorComponent"}],"bootstrap":[{"__symbolic":"reference","name":"TdCodeEditorComponent"}]}]}],"members":{}}},"origins":{"TdCodeEditorComponent":"./code-editor.component","CovalentCodeEditorModule":"./code-editor.module"},"importAs":"@covalent/code-editor"} -------------------------------------------------------------------------------- /esm2015/code-editor.module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * Generated from: code-editor.module.ts 4 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 5 | */ 6 | import { NgModule } from '@angular/core'; 7 | import { CommonModule } from '@angular/common'; 8 | import { TdCodeEditorComponent } from './code-editor.component'; 9 | export class CovalentCodeEditorModule { 10 | } 11 | CovalentCodeEditorModule.decorators = [ 12 | { type: NgModule, args: [{ 13 | imports: [CommonModule], 14 | declarations: [TdCodeEditorComponent], 15 | exports: [TdCodeEditorComponent], 16 | bootstrap: [TdCodeEditorComponent], 17 | },] } 18 | ]; 19 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29kZS1lZGl0b3IubW9kdWxlLmpzIiwic291cmNlUm9vdCI6Ii4uLy4uLy4uLy4uL3NyYy9wbGF0Zm9ybS9jb2RlLWVkaXRvci8iLCJzb3VyY2VzIjpbImNvZGUtZWRpdG9yLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRS9DLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBUWhFLE1BQU0sT0FBTyx3QkFBd0I7OztZQU5wQyxRQUFRLFNBQUM7Z0JBQ1IsT0FBTyxFQUFFLENBQUMsWUFBWSxDQUFDO2dCQUN2QixZQUFZLEVBQUUsQ0FBQyxxQkFBcUIsQ0FBQztnQkFDckMsT0FBTyxFQUFFLENBQUMscUJBQXFCLENBQUM7Z0JBQ2hDLFNBQVMsRUFBRSxDQUFDLHFCQUFxQixDQUFDO2FBQ25DIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTmdNb2R1bGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuaW1wb3J0IHsgQ29tbW9uTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29tbW9uJztcblxuaW1wb3J0IHsgVGRDb2RlRWRpdG9yQ29tcG9uZW50IH0gZnJvbSAnLi9jb2RlLWVkaXRvci5jb21wb25lbnQnO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbQ29tbW9uTW9kdWxlXSxcbiAgZGVjbGFyYXRpb25zOiBbVGRDb2RlRWRpdG9yQ29tcG9uZW50XSxcbiAgZXhwb3J0czogW1RkQ29kZUVkaXRvckNvbXBvbmVudF0sXG4gIGJvb3RzdHJhcDogW1RkQ29kZUVkaXRvckNvbXBvbmVudF0sXG59KVxuZXhwb3J0IGNsYXNzIENvdmFsZW50Q29kZUVkaXRvck1vZHVsZSB7fVxuIl19 -------------------------------------------------------------------------------- /esm2015/covalent-code-editor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * Generated from: covalent-code-editor.ts 4 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 5 | */ 6 | /** 7 | * Generated bundle index. Do not edit. 8 | */ 9 | export { TdCodeEditorComponent, CovalentCodeEditorModule } from './index'; 10 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY292YWxlbnQtY29kZS1lZGl0b3IuanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vc3JjL3BsYXRmb3JtL2NvZGUtZWRpdG9yLyIsInNvdXJjZXMiOlsiY292YWxlbnQtY29kZS1lZGl0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFJQSxnRUFBYyxTQUFTLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vaW5kZXgnO1xuIl19 -------------------------------------------------------------------------------- /esm2015/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * Generated from: index.ts 4 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 5 | */ 6 | export { TdCodeEditorComponent, CovalentCodeEditorModule } from './public-api'; 7 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLi4vLi4vLi4vLi4vc3JjL3BsYXRmb3JtL2NvZGUtZWRpdG9yLyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxnRUFBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19 -------------------------------------------------------------------------------- /esm2015/public-api.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @fileoverview added by tsickle 3 | * Generated from: public-api.ts 4 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 5 | */ 6 | export { TdCodeEditorComponent } from './code-editor.component'; 7 | export { CovalentCodeEditorModule } from './code-editor.module'; 8 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLi8uLi8uLi9zcmMvcGxhdGZvcm0vY29kZS1lZGl0b3IvIiwic291cmNlcyI6WyJwdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sc0JBQXNCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBUZENvZGVFZGl0b3JDb21wb25lbnQgfSBmcm9tICcuL2NvZGUtZWRpdG9yLmNvbXBvbmVudCc7XG5leHBvcnQgeyBDb3ZhbGVudENvZGVFZGl0b3JNb2R1bGUgfSBmcm9tICcuL2NvZGUtZWRpdG9yLm1vZHVsZSc7XG4iXX0= -------------------------------------------------------------------------------- /fesm2015/covalent-code-editor.js: -------------------------------------------------------------------------------- 1 | import { EventEmitter, Component, forwardRef, NgZone, ChangeDetectorRef, ElementRef, ViewChild, Output, Input, NgModule } from '@angular/core'; 2 | import { NG_VALUE_ACCESSOR } from '@angular/forms'; 3 | import { Subject, merge, fromEvent, timer } from 'rxjs'; 4 | import { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators'; 5 | import { editor, languages } from 'monaco-editor/esm/vs/editor/editor.api'; 6 | import { CommonModule } from '@angular/common'; 7 | 8 | /** 9 | * @fileoverview added by tsickle 10 | * Generated from: code-editor.component.ts 11 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 12 | */ 13 | /** @type {?} */ 14 | const noop = (/** 15 | * @return {?} 16 | */ 17 | () => { 18 | // empty method 19 | }); 20 | const ɵ0 = noop; 21 | // counter for ids to allow for multiple editors on one page 22 | /** @type {?} */ 23 | let uniqueCounter = 0; 24 | class TdCodeEditorComponent { 25 | // tslint:disable-next-line:member-ordering 26 | /** 27 | * @param {?} zone 28 | * @param {?} _changeDetectorRef 29 | * @param {?} _elementRef 30 | */ 31 | constructor(zone, _changeDetectorRef, _elementRef) { 32 | this.zone = zone; 33 | this._changeDetectorRef = _changeDetectorRef; 34 | this._elementRef = _elementRef; 35 | this._destroy = new Subject(); 36 | this._widthSubject = new Subject(); 37 | this._heightSubject = new Subject(); 38 | this._editorStyle = 'width:100%;height:100%;border:1px solid grey;'; 39 | this._value = ''; 40 | this._theme = 'vs'; 41 | this._language = 'javascript'; 42 | this._subject = new Subject(); 43 | this._editorInnerContainer = 'editorInnerContainer' + uniqueCounter++; 44 | this._fromEditor = false; 45 | this._componentInitialized = false; 46 | this._editorOptions = {}; 47 | this._isFullScreen = false; 48 | this._registeredLanguagesStyles = []; 49 | /** 50 | * editorInitialized: function($event) 51 | * Event emitted when editor is first initialized 52 | */ 53 | this.editorInitialized = new EventEmitter(); 54 | /** 55 | * editorConfigurationChanged: function($event) 56 | * Event emitted when editor's configuration changes 57 | */ 58 | this.editorConfigurationChanged = new EventEmitter(); 59 | /** 60 | * editorLanguageChanged: function($event) 61 | * Event emitted when editor's Language changes 62 | */ 63 | this.editorLanguageChanged = new EventEmitter(); 64 | /** 65 | * editorValueChange: function($event) 66 | * Event emitted any time something changes the editor value 67 | */ 68 | this.editorValueChange = new EventEmitter(); 69 | /** 70 | * The change event notifies you about a change happening in an input field. 71 | * Since the component is not a native Angular component have to specifiy the event emitter ourself 72 | */ 73 | this.change = new EventEmitter(); 74 | /* tslint:disable-next-line */ 75 | this.propagateChange = (/** 76 | * @param {?} _ 77 | * @return {?} 78 | */ 79 | (_) => { }); 80 | this.onTouched = (/** 81 | * @return {?} 82 | */ 83 | () => noop); 84 | } 85 | /** 86 | * value?: string 87 | * @param {?} value 88 | * @return {?} 89 | */ 90 | set value(value) { 91 | if (value === this._value) { 92 | return; 93 | } 94 | this._value = value; 95 | if (this._componentInitialized) { 96 | this.applyValue(); 97 | } 98 | } 99 | /** 100 | * @return {?} 101 | */ 102 | get value() { 103 | return this._value; 104 | } 105 | /** 106 | * @return {?} 107 | */ 108 | applyValue() { 109 | if (!this._fromEditor) { 110 | this._editor.setValue(this._value); 111 | } 112 | this._fromEditor = false; 113 | this.propagateChange(this._value); 114 | this.change.emit(); 115 | this.editorValueChange.emit(); 116 | } 117 | /** 118 | * Implemented as part of ControlValueAccessor. 119 | * @param {?} value 120 | * @return {?} 121 | */ 122 | writeValue(value) { 123 | // do not write if null or undefined 124 | // tslint:disable-next-line 125 | if (value != undefined) { 126 | this.value = value; 127 | } 128 | } 129 | /** 130 | * @param {?} fn 131 | * @return {?} 132 | */ 133 | registerOnChange(fn) { 134 | this.propagateChange = fn; 135 | } 136 | /** 137 | * @param {?} fn 138 | * @return {?} 139 | */ 140 | registerOnTouched(fn) { 141 | this.onTouched = fn; 142 | } 143 | /** 144 | * getEditorContent?: function 145 | * Returns the content within the editor 146 | * @return {?} 147 | */ 148 | getValue() { 149 | if (this._componentInitialized) { 150 | setTimeout((/** 151 | * @return {?} 152 | */ 153 | () => { 154 | this._subject.next(this._value); 155 | this._subject.complete(); 156 | this._subject = new Subject(); 157 | })); 158 | return this._subject.asObservable(); 159 | } 160 | } 161 | /** 162 | * language?: string 163 | * language used in editor 164 | * @param {?} language 165 | * @return {?} 166 | */ 167 | set language(language) { 168 | this._language = language; 169 | if (this._componentInitialized) { 170 | this.applyLanguage(); 171 | } 172 | } 173 | /** 174 | * @return {?} 175 | */ 176 | get language() { 177 | return this._language; 178 | } 179 | /** 180 | * @return {?} 181 | */ 182 | applyLanguage() { 183 | if (this._language) { 184 | editor.setModelLanguage(this._editor.getModel(), this._language); 185 | this.editorLanguageChanged.emit(); 186 | } 187 | } 188 | /** 189 | * registerLanguage?: function 190 | * Registers a custom Language within the editor 191 | * @param {?} language 192 | * @return {?} 193 | */ 194 | registerLanguage(language) { 195 | if (this._componentInitialized) { 196 | for (const provider of language.completionItemProvider) { 197 | /* tslint:disable-next-line */ 198 | provider.kind = eval(provider.kind); 199 | } 200 | for (const monarchTokens of language.monarchTokensProvider) { 201 | /* tslint:disable-next-line */ 202 | monarchTokens[0] = eval(monarchTokens[0]); 203 | } 204 | languages.register({ id: language.id }); 205 | languages.setMonarchTokensProvider(language.id, { 206 | tokenizer: { 207 | root: language.monarchTokensProvider, 208 | }, 209 | }); 210 | // Define a new theme that constains only rules that match this language 211 | editor.defineTheme(language.customTheme.id, language.customTheme.theme); 212 | this._theme = language.customTheme.id; 213 | languages.registerCompletionItemProvider(language.id, { 214 | provideCompletionItems: (/** 215 | * @return {?} 216 | */ 217 | () => { 218 | return language.completionItemProvider; 219 | }), 220 | }); 221 | /** @type {?} */ 222 | const css = document.createElement('style'); 223 | css.type = 'text/css'; 224 | css.innerHTML = language.monarchTokensProviderCSS; 225 | document.body.appendChild(css); 226 | this.editorConfigurationChanged.emit(); 227 | this._registeredLanguagesStyles = [...this._registeredLanguagesStyles, css]; 228 | } 229 | } 230 | /** 231 | * style?: string 232 | * css style of the editor on the page 233 | * @param {?} editorStyle 234 | * @return {?} 235 | */ 236 | set editorStyle(editorStyle) { 237 | this._editorStyle = editorStyle; 238 | if (this._componentInitialized) { 239 | this.applyStyle(); 240 | } 241 | } 242 | /** 243 | * @return {?} 244 | */ 245 | get editorStyle() { 246 | return this._editorStyle; 247 | } 248 | /** 249 | * @return {?} 250 | */ 251 | applyStyle() { 252 | if (this._editorStyle) { 253 | /** @type {?} */ 254 | const containerDiv = this._editorContainer.nativeElement; 255 | containerDiv.setAttribute('style', this._editorStyle); 256 | } 257 | } 258 | /** 259 | * theme?: string 260 | * Theme to be applied to editor 261 | * @param {?} theme 262 | * @return {?} 263 | */ 264 | set theme(theme) { 265 | this._theme = theme; 266 | if (this._componentInitialized) { 267 | this._editor.updateOptions({ theme }); 268 | this.editorConfigurationChanged.emit(); 269 | } 270 | } 271 | /** 272 | * @return {?} 273 | */ 274 | get theme() { 275 | return this._theme; 276 | } 277 | /** 278 | * fullScreenKeyBinding?: number 279 | * See here for key bindings https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html 280 | * Sets the KeyCode for shortcutting to Fullscreen mode 281 | * @param {?} keycode 282 | * @return {?} 283 | */ 284 | set fullScreenKeyBinding(keycode) { 285 | this._keycode = keycode; 286 | } 287 | /** 288 | * @return {?} 289 | */ 290 | get fullScreenKeyBinding() { 291 | return this._keycode; 292 | } 293 | /** 294 | * editorOptions?: object 295 | * Options used on editor instantiation. Available options listed here: 296 | * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html 297 | * @param {?} editorOptions 298 | * @return {?} 299 | */ 300 | set editorOptions(editorOptions) { 301 | this._editorOptions = editorOptions; 302 | if (this._componentInitialized) { 303 | this._editor.updateOptions(editorOptions); 304 | this.editorConfigurationChanged.emit(); 305 | } 306 | } 307 | /** 308 | * @return {?} 309 | */ 310 | get editorOptions() { 311 | return this._editorOptions; 312 | } 313 | /** 314 | * layout method that calls layout method of editor and instructs the editor to remeasure its container 315 | * @return {?} 316 | */ 317 | layout() { 318 | if (this._componentInitialized) { 319 | this._editor.layout(); 320 | } 321 | } 322 | /** 323 | * Returns if in Full Screen Mode or not 324 | * @return {?} 325 | */ 326 | get isFullScreen() { 327 | return this._isFullScreen; 328 | } 329 | /** 330 | * @return {?} 331 | */ 332 | ngOnInit() { 333 | /** @type {?} */ 334 | const containerDiv = this._editorContainer.nativeElement; 335 | containerDiv.id = this._editorInnerContainer; 336 | this._editor = editor.create(containerDiv, Object.assign({ 337 | value: this._value, 338 | language: this.language, 339 | theme: this._theme, 340 | }, this.editorOptions)); 341 | this._componentInitialized = true; 342 | setTimeout((/** 343 | * @return {?} 344 | */ 345 | () => { 346 | this.applyLanguage(); 347 | this._fromEditor = true; 348 | this.applyValue(); 349 | this.applyStyle(); 350 | this.editorInitialized.emit(this._editor); 351 | this.editorConfigurationChanged.emit(); 352 | })); 353 | this._editor.getModel().onDidChangeContent((/** 354 | * @param {?} e 355 | * @return {?} 356 | */ 357 | (e) => { 358 | this._fromEditor = true; 359 | this.writeValue(this._editor.getValue()); 360 | this.layout(); 361 | })); 362 | this.addFullScreenModeCommand(); 363 | merge(fromEvent(window, 'resize').pipe(debounceTime(100)), this._widthSubject.asObservable().pipe(distinctUntilChanged()), this._heightSubject.asObservable().pipe(distinctUntilChanged())) 364 | .pipe(takeUntil(this._destroy), debounceTime(100)) 365 | .subscribe((/** 366 | * @return {?} 367 | */ 368 | () => { 369 | this.layout(); 370 | this._changeDetectorRef.markForCheck(); 371 | })); 372 | timer(500, 250) 373 | .pipe(takeUntil(this._destroy)) 374 | .subscribe((/** 375 | * @return {?} 376 | */ 377 | () => { 378 | if (this._elementRef && this._elementRef.nativeElement) { 379 | this._widthSubject.next(((/** @type {?} */ (this._elementRef.nativeElement))).getBoundingClientRect().width); 380 | this._heightSubject.next(((/** @type {?} */ (this._elementRef.nativeElement))).getBoundingClientRect().height); 381 | } 382 | })); 383 | } 384 | /** 385 | * @return {?} 386 | */ 387 | ngOnDestroy() { 388 | this._changeDetectorRef.detach(); 389 | this._registeredLanguagesStyles.forEach((/** 390 | * @param {?} style 391 | * @return {?} 392 | */ 393 | (style) => style.remove())); 394 | if (this._editor) { 395 | this._editor.dispose(); 396 | } 397 | this._destroy.next(true); 398 | this._destroy.unsubscribe(); 399 | } 400 | /** 401 | * showFullScreenEditor request for full screen of Code Editor based on its browser type. 402 | * @return {?} 403 | */ 404 | showFullScreenEditor() { 405 | if (this._componentInitialized) { 406 | /** @type {?} */ 407 | const codeEditorElement = (/** @type {?} */ (this._editorContainer.nativeElement)); 408 | /** @type {?} */ 409 | const fullScreenMap = { 410 | // Chrome 411 | requestFullscreen: (/** 412 | * @return {?} 413 | */ 414 | () => codeEditorElement.requestFullscreen()), 415 | // Safari 416 | webkitRequestFullscreen: (/** 417 | * @return {?} 418 | */ 419 | () => ((/** @type {?} */ (codeEditorElement))).webkitRequestFullscreen()), 420 | // IE 421 | msRequestFullscreen: (/** 422 | * @return {?} 423 | */ 424 | () => ((/** @type {?} */ (codeEditorElement))).msRequestFullscreen()), 425 | // Firefox 426 | mozRequestFullScreen: (/** 427 | * @return {?} 428 | */ 429 | () => ((/** @type {?} */ (codeEditorElement))).mozRequestFullScreen()), 430 | }; 431 | for (const handler of Object.keys(fullScreenMap)) { 432 | if (codeEditorElement[handler]) { 433 | fullScreenMap[handler](); 434 | } 435 | } 436 | } 437 | this._isFullScreen = true; 438 | } 439 | /** 440 | * exitFullScreenEditor request to exit full screen of Code Editor based on its browser type. 441 | * @return {?} 442 | */ 443 | exitFullScreenEditor() { 444 | if (this._componentInitialized) { 445 | /** @type {?} */ 446 | const exitFullScreenMap = { 447 | // Chrome 448 | exitFullscreen: (/** 449 | * @return {?} 450 | */ 451 | () => document.exitFullscreen()), 452 | // Safari 453 | webkitExitFullscreen: (/** 454 | * @return {?} 455 | */ 456 | () => ((/** @type {?} */ (document))).webkitExitFullscreen()), 457 | // Firefox 458 | mozCancelFullScreen: (/** 459 | * @return {?} 460 | */ 461 | () => ((/** @type {?} */ (document))).mozCancelFullScreen()), 462 | // IE 463 | msExitFullscreen: (/** 464 | * @return {?} 465 | */ 466 | () => ((/** @type {?} */ (document))).msExitFullscreen()), 467 | }; 468 | for (const handler of Object.keys(exitFullScreenMap)) { 469 | if (document[handler]) { 470 | exitFullScreenMap[handler](); 471 | } 472 | } 473 | } 474 | this._isFullScreen = false; 475 | } 476 | /** 477 | * addFullScreenModeCommand used to add the fullscreen option to the context menu 478 | * @private 479 | * @return {?} 480 | */ 481 | addFullScreenModeCommand() { 482 | this._editor.addAction({ 483 | // An unique identifier of the contributed action. 484 | id: 'fullScreen', 485 | // A label of the action that will be presented to the user. 486 | label: 'Full Screen', 487 | // An optional array of keybindings for the action. 488 | contextMenuGroupId: 'navigation', 489 | keybindings: this._keycode, 490 | contextMenuOrder: 1.5, 491 | // Method that will be executed when the action is triggered. 492 | // @param editor The editor instance is passed in as a convinience 493 | run: (/** 494 | * @param {?} ed 495 | * @return {?} 496 | */ 497 | (ed) => { 498 | this.showFullScreenEditor(); 499 | }), 500 | }); 501 | } 502 | } 503 | TdCodeEditorComponent.decorators = [ 504 | { type: Component, args: [{ 505 | selector: 'td-code-editor', 506 | template: "
\n", 507 | providers: [ 508 | { 509 | provide: NG_VALUE_ACCESSOR, 510 | useExisting: forwardRef((/** 511 | * @return {?} 512 | */ 513 | () => TdCodeEditorComponent)), 514 | multi: true, 515 | }, 516 | ], 517 | styles: [":host{display:block;position:relative}:host .editorContainer{bottom:0;left:0;position:absolute;right:0;top:0}::ng-deep .monaco-aria-container{display:none}"] 518 | }] } 519 | ]; 520 | /** @nocollapse */ 521 | TdCodeEditorComponent.ctorParameters = () => [ 522 | { type: NgZone }, 523 | { type: ChangeDetectorRef }, 524 | { type: ElementRef } 525 | ]; 526 | TdCodeEditorComponent.propDecorators = { 527 | _editorContainer: [{ type: ViewChild, args: ['editorContainer', { static: true },] }], 528 | editorInitialized: [{ type: Output }], 529 | editorConfigurationChanged: [{ type: Output }], 530 | editorLanguageChanged: [{ type: Output }], 531 | editorValueChange: [{ type: Output }], 532 | change: [{ type: Output }], 533 | value: [{ type: Input, args: ['value',] }], 534 | language: [{ type: Input, args: ['language',] }], 535 | editorStyle: [{ type: Input, args: ['editorStyle',] }], 536 | theme: [{ type: Input, args: ['theme',] }], 537 | fullScreenKeyBinding: [{ type: Input, args: ['fullScreenKeyBinding',] }], 538 | editorOptions: [{ type: Input, args: ['editorOptions',] }] 539 | }; 540 | if (false) { 541 | /** 542 | * @type {?} 543 | * @private 544 | */ 545 | TdCodeEditorComponent.prototype._destroy; 546 | /** 547 | * @type {?} 548 | * @private 549 | */ 550 | TdCodeEditorComponent.prototype._widthSubject; 551 | /** 552 | * @type {?} 553 | * @private 554 | */ 555 | TdCodeEditorComponent.prototype._heightSubject; 556 | /** 557 | * @type {?} 558 | * @private 559 | */ 560 | TdCodeEditorComponent.prototype._editorStyle; 561 | /** 562 | * @type {?} 563 | * @private 564 | */ 565 | TdCodeEditorComponent.prototype._value; 566 | /** 567 | * @type {?} 568 | * @private 569 | */ 570 | TdCodeEditorComponent.prototype._theme; 571 | /** 572 | * @type {?} 573 | * @private 574 | */ 575 | TdCodeEditorComponent.prototype._language; 576 | /** 577 | * @type {?} 578 | * @private 579 | */ 580 | TdCodeEditorComponent.prototype._subject; 581 | /** 582 | * @type {?} 583 | * @private 584 | */ 585 | TdCodeEditorComponent.prototype._editorInnerContainer; 586 | /** 587 | * @type {?} 588 | * @private 589 | */ 590 | TdCodeEditorComponent.prototype._editor; 591 | /** 592 | * @type {?} 593 | * @private 594 | */ 595 | TdCodeEditorComponent.prototype._fromEditor; 596 | /** 597 | * @type {?} 598 | * @private 599 | */ 600 | TdCodeEditorComponent.prototype._componentInitialized; 601 | /** 602 | * @type {?} 603 | * @private 604 | */ 605 | TdCodeEditorComponent.prototype._editorOptions; 606 | /** 607 | * @type {?} 608 | * @private 609 | */ 610 | TdCodeEditorComponent.prototype._isFullScreen; 611 | /** 612 | * @type {?} 613 | * @private 614 | */ 615 | TdCodeEditorComponent.prototype._keycode; 616 | /** 617 | * @type {?} 618 | * @private 619 | */ 620 | TdCodeEditorComponent.prototype._registeredLanguagesStyles; 621 | /** @type {?} */ 622 | TdCodeEditorComponent.prototype._editorContainer; 623 | /** 624 | * editorInitialized: function($event) 625 | * Event emitted when editor is first initialized 626 | * @type {?} 627 | */ 628 | TdCodeEditorComponent.prototype.editorInitialized; 629 | /** 630 | * editorConfigurationChanged: function($event) 631 | * Event emitted when editor's configuration changes 632 | * @type {?} 633 | */ 634 | TdCodeEditorComponent.prototype.editorConfigurationChanged; 635 | /** 636 | * editorLanguageChanged: function($event) 637 | * Event emitted when editor's Language changes 638 | * @type {?} 639 | */ 640 | TdCodeEditorComponent.prototype.editorLanguageChanged; 641 | /** 642 | * editorValueChange: function($event) 643 | * Event emitted any time something changes the editor value 644 | * @type {?} 645 | */ 646 | TdCodeEditorComponent.prototype.editorValueChange; 647 | /** 648 | * The change event notifies you about a change happening in an input field. 649 | * Since the component is not a native Angular component have to specifiy the event emitter ourself 650 | * @type {?} 651 | */ 652 | TdCodeEditorComponent.prototype.change; 653 | /** @type {?} */ 654 | TdCodeEditorComponent.prototype.propagateChange; 655 | /** @type {?} */ 656 | TdCodeEditorComponent.prototype.onTouched; 657 | /** 658 | * @type {?} 659 | * @private 660 | */ 661 | TdCodeEditorComponent.prototype.zone; 662 | /** 663 | * @type {?} 664 | * @private 665 | */ 666 | TdCodeEditorComponent.prototype._changeDetectorRef; 667 | /** 668 | * @type {?} 669 | * @private 670 | */ 671 | TdCodeEditorComponent.prototype._elementRef; 672 | } 673 | 674 | /** 675 | * @fileoverview added by tsickle 676 | * Generated from: code-editor.module.ts 677 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 678 | */ 679 | class CovalentCodeEditorModule { 680 | } 681 | CovalentCodeEditorModule.decorators = [ 682 | { type: NgModule, args: [{ 683 | imports: [CommonModule], 684 | declarations: [TdCodeEditorComponent], 685 | exports: [TdCodeEditorComponent], 686 | bootstrap: [TdCodeEditorComponent], 687 | },] } 688 | ]; 689 | 690 | /** 691 | * @fileoverview added by tsickle 692 | * Generated from: public-api.ts 693 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 694 | */ 695 | 696 | /** 697 | * @fileoverview added by tsickle 698 | * Generated from: index.ts 699 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 700 | */ 701 | 702 | /** 703 | * @fileoverview added by tsickle 704 | * Generated from: covalent-code-editor.ts 705 | * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc 706 | */ 707 | 708 | export { CovalentCodeEditorModule, TdCodeEditorComponent }; 709 | //# sourceMappingURL=covalent-code-editor.js.map 710 | -------------------------------------------------------------------------------- /fesm2015/covalent-code-editor.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"covalent-code-editor.js","sources":["../../../../src/platform/code-editor/code-editor.component.ts","../../../../src/platform/code-editor/code-editor.module.ts"],"sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n OnInit,\n ViewChild,\n ElementRef,\n forwardRef,\n NgZone,\n ChangeDetectorRef,\n OnDestroy,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { Observable, Subject } from 'rxjs';\nimport { fromEvent, merge, timer } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\n// Use esm version to support shipping subset of languages and features\nimport * as monaco from 'monaco-editor/esm/vs/editor/editor.api';\n\nconst noop: any = () => {\n // empty method\n};\n\n// counter for ids to allow for multiple editors on one page\nlet uniqueCounter: number = 0;\n\n@Component({\n selector: 'td-code-editor',\n templateUrl: './code-editor.component.html',\n styleUrls: ['./code-editor.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => TdCodeEditorComponent),\n multi: true,\n },\n ],\n})\nexport class TdCodeEditorComponent implements OnInit, ControlValueAccessor, OnDestroy {\n private _destroy: Subject = new Subject();\n private _widthSubject: Subject = new Subject();\n private _heightSubject: Subject = new Subject();\n\n private _editorStyle: string = 'width:100%;height:100%;border:1px solid grey;';\n private _value: string = '';\n private _theme: string = 'vs';\n private _language: string = 'javascript';\n private _subject: Subject = new Subject();\n private _editorInnerContainer: string = 'editorInnerContainer' + uniqueCounter++;\n private _editor: any;\n private _fromEditor: boolean = false;\n private _componentInitialized: boolean = false;\n private _editorOptions: any = {};\n private _isFullScreen: boolean = false;\n private _keycode: any;\n private _registeredLanguagesStyles: HTMLStyleElement[] = [];\n\n @ViewChild('editorContainer', { static: true }) _editorContainer: ElementRef;\n\n /**\n * editorInitialized: function($event)\n * Event emitted when editor is first initialized\n */\n @Output() editorInitialized: EventEmitter = new EventEmitter();\n\n /**\n * editorConfigurationChanged: function($event)\n * Event emitted when editor's configuration changes\n */\n @Output() editorConfigurationChanged: EventEmitter = new EventEmitter();\n\n /**\n * editorLanguageChanged: function($event)\n * Event emitted when editor's Language changes\n */\n @Output() editorLanguageChanged: EventEmitter = new EventEmitter();\n\n /**\n * editorValueChange: function($event)\n * Event emitted any time something changes the editor value\n */\n @Output() editorValueChange: EventEmitter = new EventEmitter();\n\n /**\n * The change event notifies you about a change happening in an input field.\n * Since the component is not a native Angular component have to specifiy the event emitter ourself\n */\n @Output() change: EventEmitter = new EventEmitter();\n /* tslint:disable-next-line */\n propagateChange = (_: any) => {};\n onTouched = () => noop;\n\n /**\n * value?: string\n */\n @Input('value')\n set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value;\n if (this._componentInitialized) {\n this.applyValue();\n }\n }\n\n get value(): string {\n return this._value;\n }\n\n applyValue(): void {\n if (!this._fromEditor) {\n this._editor.setValue(this._value);\n }\n this._fromEditor = false;\n this.propagateChange(this._value);\n this.change.emit();\n this.editorValueChange.emit();\n }\n\n /**\n * Implemented as part of ControlValueAccessor.\n */\n writeValue(value: any): void {\n // do not write if null or undefined\n // tslint:disable-next-line\n if (value != undefined) {\n this.value = value;\n }\n }\n registerOnChange(fn: any): void {\n this.propagateChange = fn;\n }\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /**\n * getEditorContent?: function\n * Returns the content within the editor\n */\n getValue(): Observable {\n if (this._componentInitialized) {\n setTimeout(() => {\n this._subject.next(this._value);\n this._subject.complete();\n this._subject = new Subject();\n });\n return this._subject.asObservable();\n }\n }\n\n /**\n * language?: string\n * language used in editor\n */\n @Input('language')\n set language(language: string) {\n this._language = language;\n if (this._componentInitialized) {\n this.applyLanguage();\n }\n }\n\n get language(): string {\n return this._language;\n }\n\n applyLanguage(): void {\n if (this._language) {\n monaco.editor.setModelLanguage(this._editor.getModel(), this._language);\n this.editorLanguageChanged.emit();\n }\n }\n\n /**\n * registerLanguage?: function\n * Registers a custom Language within the editor\n */\n registerLanguage(language: any): void {\n if (this._componentInitialized) {\n for (const provider of language.completionItemProvider) {\n /* tslint:disable-next-line */\n provider.kind = eval(provider.kind);\n }\n for (const monarchTokens of language.monarchTokensProvider) {\n /* tslint:disable-next-line */\n monarchTokens[0] = eval(monarchTokens[0]);\n }\n monaco.languages.register({ id: language.id });\n\n monaco.languages.setMonarchTokensProvider(language.id, {\n tokenizer: {\n root: language.monarchTokensProvider,\n },\n });\n\n // Define a new theme that constains only rules that match this language\n monaco.editor.defineTheme(language.customTheme.id, language.customTheme.theme);\n this._theme = language.customTheme.id;\n\n monaco.languages.registerCompletionItemProvider(language.id, {\n provideCompletionItems: () => {\n return language.completionItemProvider;\n },\n });\n\n const css: HTMLStyleElement = document.createElement('style');\n css.type = 'text/css';\n css.innerHTML = language.monarchTokensProviderCSS;\n document.body.appendChild(css);\n this.editorConfigurationChanged.emit();\n this._registeredLanguagesStyles = [...this._registeredLanguagesStyles, css];\n }\n }\n\n /**\n * style?: string\n * css style of the editor on the page\n */\n @Input('editorStyle')\n set editorStyle(editorStyle: string) {\n this._editorStyle = editorStyle;\n if (this._componentInitialized) {\n this.applyStyle();\n }\n }\n\n get editorStyle(): string {\n return this._editorStyle;\n }\n\n applyStyle(): void {\n if (this._editorStyle) {\n const containerDiv: HTMLDivElement = this._editorContainer.nativeElement;\n containerDiv.setAttribute('style', this._editorStyle);\n }\n }\n\n /**\n * theme?: string\n * Theme to be applied to editor\n */\n @Input('theme')\n set theme(theme: string) {\n this._theme = theme;\n if (this._componentInitialized) {\n this._editor.updateOptions({ theme });\n this.editorConfigurationChanged.emit();\n }\n }\n get theme(): string {\n return this._theme;\n }\n\n /**\n * fullScreenKeyBinding?: number\n * See here for key bindings https://microsoft.github.io/monaco-editor/api/enums/monaco.keycode.html\n * Sets the KeyCode for shortcutting to Fullscreen mode\n */\n @Input('fullScreenKeyBinding')\n set fullScreenKeyBinding(keycode: number[]) {\n this._keycode = keycode;\n }\n get fullScreenKeyBinding(): number[] {\n return this._keycode;\n }\n\n /**\n * editorOptions?: object\n * Options used on editor instantiation. Available options listed here:\n * https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.ieditoroptions.html\n */\n @Input('editorOptions')\n set editorOptions(editorOptions: any) {\n this._editorOptions = editorOptions;\n if (this._componentInitialized) {\n this._editor.updateOptions(editorOptions);\n this.editorConfigurationChanged.emit();\n }\n }\n get editorOptions(): any {\n return this._editorOptions;\n }\n\n /**\n * layout method that calls layout method of editor and instructs the editor to remeasure its container\n */\n layout(): void {\n if (this._componentInitialized) {\n this._editor.layout();\n }\n }\n\n /**\n * Returns if in Full Screen Mode or not\n */\n get isFullScreen(): boolean {\n return this._isFullScreen;\n }\n\n // tslint:disable-next-line:member-ordering\n constructor(private zone: NgZone, private _changeDetectorRef: ChangeDetectorRef, private _elementRef: ElementRef) {}\n\n ngOnInit(): void {\n const containerDiv: HTMLDivElement = this._editorContainer.nativeElement;\n containerDiv.id = this._editorInnerContainer;\n\n this._editor = monaco.editor.create(\n containerDiv,\n Object.assign(\n {\n value: this._value,\n language: this.language,\n theme: this._theme,\n },\n this.editorOptions,\n ),\n );\n this._componentInitialized = true;\n setTimeout(() => {\n this.applyLanguage();\n this._fromEditor = true;\n this.applyValue();\n this.applyStyle();\n this.editorInitialized.emit(this._editor);\n this.editorConfigurationChanged.emit();\n });\n this._editor.getModel().onDidChangeContent((e: any) => {\n this._fromEditor = true;\n this.writeValue(this._editor.getValue());\n this.layout();\n });\n this.addFullScreenModeCommand();\n\n merge(\n fromEvent(window, 'resize').pipe(debounceTime(100)),\n this._widthSubject.asObservable().pipe(distinctUntilChanged()),\n this._heightSubject.asObservable().pipe(distinctUntilChanged()),\n )\n .pipe(takeUntil(this._destroy), debounceTime(100))\n .subscribe(() => {\n this.layout();\n this._changeDetectorRef.markForCheck();\n });\n timer(500, 250)\n .pipe(takeUntil(this._destroy))\n .subscribe(() => {\n if (this._elementRef && this._elementRef.nativeElement) {\n this._widthSubject.next((this._elementRef.nativeElement).getBoundingClientRect().width);\n this._heightSubject.next((this._elementRef.nativeElement).getBoundingClientRect().height);\n }\n });\n }\n\n ngOnDestroy(): void {\n this._changeDetectorRef.detach();\n this._registeredLanguagesStyles.forEach((style: HTMLStyleElement) => style.remove());\n if (this._editor) {\n this._editor.dispose();\n }\n this._destroy.next(true);\n this._destroy.unsubscribe();\n }\n\n /**\n * showFullScreenEditor request for full screen of Code Editor based on its browser type.\n */\n public showFullScreenEditor(): void {\n if (this._componentInitialized) {\n const codeEditorElement: HTMLDivElement = this._editorContainer.nativeElement as HTMLDivElement;\n const fullScreenMap: object = {\n // Chrome\n requestFullscreen: () => codeEditorElement.requestFullscreen(),\n // Safari\n webkitRequestFullscreen: () => (codeEditorElement).webkitRequestFullscreen(),\n // IE\n msRequestFullscreen: () => (codeEditorElement).msRequestFullscreen(),\n // Firefox\n mozRequestFullScreen: () => (codeEditorElement).mozRequestFullScreen(),\n };\n\n for (const handler of Object.keys(fullScreenMap)) {\n if (codeEditorElement[handler]) {\n fullScreenMap[handler]();\n }\n }\n }\n this._isFullScreen = true;\n }\n\n /**\n * exitFullScreenEditor request to exit full screen of Code Editor based on its browser type.\n */\n public exitFullScreenEditor(): void {\n if (this._componentInitialized) {\n const exitFullScreenMap: object = {\n // Chrome\n exitFullscreen: () => document.exitFullscreen(),\n // Safari\n webkitExitFullscreen: () => (document).webkitExitFullscreen(),\n // Firefox\n mozCancelFullScreen: () => (document).mozCancelFullScreen(),\n // IE\n msExitFullscreen: () => (document).msExitFullscreen(),\n };\n\n for (const handler of Object.keys(exitFullScreenMap)) {\n if (document[handler]) {\n exitFullScreenMap[handler]();\n }\n }\n }\n this._isFullScreen = false;\n }\n\n /**\n * addFullScreenModeCommand used to add the fullscreen option to the context menu\n */\n private addFullScreenModeCommand(): void {\n this._editor.addAction({\n // An unique identifier of the contributed action.\n id: 'fullScreen',\n // A label of the action that will be presented to the user.\n label: 'Full Screen',\n // An optional array of keybindings for the action.\n contextMenuGroupId: 'navigation',\n keybindings: this._keycode,\n contextMenuOrder: 1.5,\n // Method that will be executed when the action is triggered.\n // @param editor The editor instance is passed in as a convinience\n run: (ed: any) => {\n this.showFullScreenEditor();\n },\n });\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\n\nimport { TdCodeEditorComponent } from './code-editor.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [TdCodeEditorComponent],\n exports: [TdCodeEditorComponent],\n bootstrap: [TdCodeEditorComponent],\n})\nexport class CovalentCodeEditorModule {}\n"],"names":["monaco.editor","monaco.languages"],"mappings":";;;;;;;;;;;;;MAqBM,IAAI;;;AAAQ;;AAElB,CAAC,CAAA;;;;IAGG,aAAa,GAAW,CAAC;MAchB,qBAAqB;;;;;;;IAwQhC,YAAoB,IAAY,EAAU,kBAAqC,EAAU,WAAuB;QAA5F,SAAI,GAAJ,IAAI,CAAQ;QAAU,uBAAkB,GAAlB,kBAAkB,CAAmB;QAAU,gBAAW,GAAX,WAAW,CAAY;QAvQxG,aAAQ,GAAqB,IAAI,OAAO,EAAW,CAAC;QACpD,kBAAa,GAAoB,IAAI,OAAO,EAAU,CAAC;QACvD,mBAAc,GAAoB,IAAI,OAAO,EAAU,CAAC;QAExD,iBAAY,GAAW,+CAA+C,CAAC;QACvE,WAAM,GAAW,EAAE,CAAC;QACpB,WAAM,GAAW,IAAI,CAAC;QACtB,cAAS,GAAW,YAAY,CAAC;QACjC,aAAQ,GAAoB,IAAI,OAAO,EAAE,CAAC;QAC1C,0BAAqB,GAAW,sBAAsB,GAAG,aAAa,EAAE,CAAC;QAEzE,gBAAW,GAAY,KAAK,CAAC;QAC7B,0BAAqB,GAAY,KAAK,CAAC;QACvC,mBAAc,GAAQ,EAAE,CAAC;QACzB,kBAAa,GAAY,KAAK,CAAC;QAE/B,+BAA0B,GAAuB,EAAE,CAAC;;;;;QAQlD,sBAAiB,GAAuB,IAAI,YAAY,EAAQ,CAAC;;;;;QAMjE,+BAA0B,GAAuB,IAAI,YAAY,EAAQ,CAAC;;;;;QAM1E,0BAAqB,GAAuB,IAAI,YAAY,EAAQ,CAAC;;;;;QAMrE,sBAAiB,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} -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | export * from './public-api'; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@covalent/code-editor", 3 | "version": "3.1.1-beta.1", 4 | "description": "Teradata UI Platform Code Editor Module", 5 | "keywords": [ 6 | "angular", 7 | "covalent", 8 | "monaco", 9 | "monaco-editor", 10 | "code", 11 | "editor", 12 | "electron", 13 | "reusable" 14 | ], 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/teradata/covalent.git" 18 | }, 19 | "bugs": { 20 | "url": "https://github.com/Teradata/covalent/issues" 21 | }, 22 | "license": "MIT", 23 | "author": "Teradata UX", 24 | "contributors": [ 25 | "Kyle Ledbetter ", 26 | "Richa Vyas ", 27 | "Ed Morales ", 28 | "Jason Weaver ", 29 | "Jeremy Wilken ", 30 | "Jeremy Smartt ", 31 | "Steven Ov " 32 | ], 33 | "dependencies": { 34 | "monaco-editor": "^0.22.0", 35 | "tslib": "^2.0.0" 36 | }, 37 | "peerDependencies": { 38 | "@angular/common": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0", 39 | "@angular/core": "^9.0.0 || ^10.0.0-0 || ^11.0.0-0" 40 | }, 41 | "main": "bundles/covalent-code-editor.umd.js", 42 | "module": "fesm2015/covalent-code-editor.js", 43 | "es2015": "fesm2015/covalent-code-editor.js", 44 | "esm2015": "esm2015/covalent-code-editor.js", 45 | "fesm2015": "fesm2015/covalent-code-editor.js", 46 | "typings": "covalent-code-editor.d.ts", 47 | "metadata": "covalent-code-editor.metadata.json", 48 | "sideEffects": false 49 | } 50 | -------------------------------------------------------------------------------- /public-api.d.ts: -------------------------------------------------------------------------------- 1 | export { TdCodeEditorComponent } from './code-editor.component'; 2 | export { CovalentCodeEditorModule } from './code-editor.module'; 3 | --------------------------------------------------------------------------------