Skip to content

Commit

Permalink
upgrade simplemde to easymde
Browse files Browse the repository at this point in the history
Signed-off-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
jma committed Oct 6, 2022
1 parent a749e9f commit b51b1fc
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 113 deletions.
214 changes: 117 additions & 97 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@
"@ngx-formly/core": "^5.12.4",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@types/marked": "^4.0.7",
"bootstrap": "^4.6.0",
"crypto-js": "^3.3.0",
"dot-prop": "^6.0.1",
"easymde": "^2.18.0",
"elliptic": ">=6.5.4",
"font-awesome": "^4.7.0",
"handlebars": "^4.7.7",
"hosted-git-info": ">=2.8.9",
"http-proxy": ">=1.18.1",
"kind-of": "^6.0",
"lodash": "^4.17.21",
"lodash-es": "4.17.14",
"lodash-es": "^4.17.21",
"marked": "^4.1.1",
"minimist": ">=0.2.1",
"moment": "^2.29.1",
"ngx-bootstrap": "^9.0.0",
Expand All @@ -50,7 +53,6 @@
"postcss": ">=8.2.10",
"rxjs": "^6.6.7",
"serialize-javascript": "^5.0.1",
"simplemde": "^1.11.2",
"socket.io": "^3.1.2",
"ssri": ">=8.0.1",
"tree-kill": ">=1.2.2",
Expand All @@ -67,10 +69,8 @@
"@angular/language-service": "^14.2.5",
"@ngx-formly/schematics": "^5.12.4",
"@types/jasmine": "^3.6.9",
"@types/marked": "^2.0.3",
"@types/node": "^12.20.7",
"@types/simplemde": "^1.11.7",
"codelyzer": "^6.0.0",
"codelyzer": "^6.0.2",
"husky": "^4.3.8",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/ng-core-tester/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $fa-font-path: "~font-awesome/fonts";
@import "~ngx-toastr/toastr-bs4-alert";

// Styles for markdown editor
@import "~simplemde/dist/simplemde.min.css";
@import "~easymde/dist/easymde.min";
.CodeMirror, .CodeMirror-scroll {
min-height: 120px;
}
2 changes: 1 addition & 1 deletion projects/rero/ng-core/src/lib/pipe/markdown.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import marked from 'marked';
import { marked } from 'marked';

/**
* Pipe to transform markdown to html.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
import { FormlyFieldTextArea } from '@ngx-formly/bootstrap';
import SimpleMDE from 'simplemde';
import EasyMDE from 'easymde';

/**
* Component to display textarea as a markdown editor.
Expand All @@ -41,7 +41,7 @@ export class MarkdownFieldComponent extends FormlyFieldTextArea implements After
* value.
*/
ngAfterViewInit(): void {
const simplemde = new SimpleMDE({
const simplemde = new EasyMDE({
spellChecker: false,
promptURLs: true,
initialValue: this.formControl.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
import { TypeaheadMatch } from 'ngx-bootstrap/typeahead/public_api';
import { Observable, of, Subscriber } from 'rxjs';
import { first, map, mergeMap } from 'rxjs/operators';
import { EditorComponent } from '../../editor.component';

/**
* For big editor add the possiblity to display
Expand All @@ -48,7 +47,8 @@ export class AddFieldEditorComponent implements OnInit {
essentialFields$: Observable<Array<FormlyFieldConfig>>;

/** Instance of EditorComponent */
private editorComponentInstance: EditorComponent;
//TODO: add type
private editorComponentInstance;

/***
* Constructor
Expand All @@ -70,7 +70,7 @@ export class AddFieldEditorComponent implements OnInit {
);

this.hiddenFields$ = this.editorComponentInstance.hiddenFields$.pipe(
map(fields => fields.sort(
map((fields: any[]) => fields.sort(
(field1, field2) => this.sortFieldsByLabel(field1, field2)
)
)
Expand Down
3 changes: 1 addition & 2 deletions projects/rero/ng-core/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
Expand All @@ -25,4 +24,4 @@
"typeRoots": [
"./typings.d.ts"
]
}
}
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ display_success_message "Building library..."
ng build --configuration production @rero/ng-core

display_success_message "Building test application..."
ng build ng-core-tester --prod
ng build ng-core-tester --configuration production

display_success_message "Linting the projects..."
ng lint
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"node_modules/@types"
],
"lib": [
"es2018",
"es2020",
"dom"
],
"paths": {
Expand Down

0 comments on commit b51b1fc

Please sign in to comment.