1.0.71 • Published 3 years ago

marx-editor v1.0.71

Weekly downloads
1,156
License
MIT
Repository
github
Last release
3 years ago

Marx

Marx was created in the memory of late Karl Heinrich Marx (1818 - 1883). This is a small tribute to honour his writings including the legendary book "The Communist Manifesto". A wysiwyg editor with blend in styles, formatting, font families and everything needed to make your rich text edit experience euphoric

Usage

Add the package as a dependency to your project using:

npm i marx-editor

Add the module to your app.module imports:

import { MarxEditorModule } from 'marx-editor';
...

@NgModule({
    imports: [ MarxEditorModule ],
    ...
}) 

Simply include the marx-editor within your component template file

<marx-editor></marx-editor>

Optional Configurations

<marx-editor 
    [editorConfig]="<configuration object>" 
    [(ngModel)]="<two way binding variable>"
    (comment)="<function which will receive the editor data as event>"
    (sendSavedFiles)="<function which will receive the files uploaded (array of files) as event>">
</marx-editor>

The editor operates in two modes i.e 'basic' and 'prime'. The prime mode contains all the text formatting options like font-color, text-background color, font-size, text-alignment, font-style like h1, h2, h3 and paragraph tags, and font-families like verdana, arial, georgia, impact, courier new, tahoma

Configuration Options

The following optional configuration items can be used.

OptionDescription
editorConfigObject containing the configurations for the marx-editor.
ngModelMarx-editor is two way bindable and can be used with ngModel

Keys within the editorConfig object

The following optional keys can be used

OptionTypeDescription
mode'basic' or 'prime'Optional field that specifies the mode of the editor you want to use, by default the editor runs in basic mode
linkbooleanOptional field to enable or disable adding link in the editor
urlValuestringOptional field that acts as a label for url value in Add Link popup
urlTextstringOptional field that acts as a label for url value in Add Link popup
urlTitlestringOptional field that acts as a label for url value in Add Link popup
validUrlMessagestringOptional field that displays error message for invalid url value in Add Link popup
urlPlaceHolderstringOptional field that acts as a placeholder for url value in Add Link popup
textPlaceholderstringOptional field that acts as a placeholder for url text in Add Link popup
titlePlaceholderstringOptional field that acts as a placeholder for url title in Add Link popup
configFontStylebooleanOptional field that enables or disables font-style option in editor i.e H1, H2, H3 & P tags
filebooleanOptional field to enable or disable file upload option inside the editor.
idstringOptional field to add a unique id for each instance of editor, by default each instance of editor created has a unique id
zIndexnumberOptional field to set zIndex of the add link or add files popup , default is 100000
maxHeightstringOptional field to set max-height of editor after which scrollbar appears inside the editor
placeholderstringOptional field to display a message when editor is empty.
toolbarPlacement'top' or 'bottom'Optional field to diplay the toolbar at the top or bottom, by default the toolbar is placed at the bottom
colorPalettebooleanOptional field to enable or disable font and text-background color options in toolbar.
buttonNamestringOptional field to display a submit button in the editor toolbar that emits all the editor html data on click
buttonDisabledbooleanOptional field to enable or disable the submit button that is present in the toolbar
mentionedNamesArray i.e {id: 8, name: 'Alec'},...Optional field to add name tribute inside the editor and trigger a list of names with @ button in toolbar or keyboard @ button
mentionedDatesArray i.e '12/1/2020', '11/2/2021',....Optional field to add date tribute inside the editor and trigger a list of date strings with # button in the toolbar or keyboard # button

Output Events

The following output events can be used.

OutputDescription
@Output() comment EventEmitter<string>Emitted whenever the user clicks on the submit button and it clears the editor and emits whatever data that was present in the editor
@Output() sendSavedFiles EventEmitter<any[]>Emitted when the user uploads a list of files through the editor.
1.0.71

3 years ago

1.0.66

3 years ago

1.0.69

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.70

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.51

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.48

3 years ago

1.0.47

3 years ago

1.0.50

3 years ago

1.0.33

3 years ago

1.0.32

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.40

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.46

3 years ago

1.0.45

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.30

3 years ago

1.0.27

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago