0.2.15 • Published 2 months ago

@recruitler/rte v0.2.15

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

RichTextEditor

Here's how we're using the editor for Recruitler.com's social media posting system

<!-- hashtag search dropdown -->
<ng-template #hashtagItemTemplate let-value let-active="active">
  <div class="suggestion-item" [class.selected]="active">
    <p>{{ value.name }}</p>
  </div>
</ng-template>

<!-- inline hashtags component -->
<ng-template #hashtagTemplate let-value="value">
  <lib-hashtag
    [hashtag]="value"
    contenteditable="false" />
</ng-template>

<div class="compose__editable">
  <recruitler-rte #editor
    [formControl]="content"
    [hashtagItemTemplate]="hashtagItemTemplate"
    [hashtagTemplate]="hashtagTemplate"
    [hashtagResults]="hashtagResults"
    [uploadImageResult]="uploadImageResult"
    (hashtagRequest)="hashtagSearch($event)"
    (uploadImageRequest)="onUpload($event)"
    placeholder="What's your experience?"
    (focus)="onFocus()"
    (blur)="onBlur()" />
    <p class="count" [ngClass]="{ 'warning': count < 10,  'error': count < 0 }">{{ count }}</p>
</div>

Hashtag format

Our hashtag string format:

-##-{"id":"xxxx", "content":"existing"}-##-

A hashtag that does not reflect a database counterpart.

#nonexisting

Parsing

When creating or editing existing RTE content during (POST or PATCH) your backend parser should:

  • ignore hashtags already saved in the RTE hashtag-format -##-{...}-##-
  • identify unidentified hashtags like #something these should be formatted like above
  • check your hashtag data storage for this hashtag and create a new hashtag from #something
  • replace #something in the content with the new formatted hashtag in the hashtag data format

We need help!

If you're using this Rich Text Editor package you likely need a code syntax highlighter. We're working to bring Ace into the RTE package and could use some expertise!

https://github.com/Recruitler/Rich-Text-Editor/issues/1

Code scaffolding

Run ng generate component component-name --project rich-text-editor to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project rich-text-editor.

Note: Don't forget to add --project rich-text-editor or else it will be added to the default project in your angular.json file.

Build

Run ng build rich-text-editor to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build rich-text-editor, go to the dist folder cd dist/rich-text-editor and run npm publish.

Running unit tests

Run ng test rich-text-editor to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

0.2.15

2 months ago

0.2.14

2 months ago

0.2.13

2 months ago

0.2.12

2 months ago

0.2.11

2 months ago

0.2.10

3 months ago

0.2.9

3 months ago

0.2.8

3 months ago

0.2.7

4 months ago

0.2.6

4 months ago

0.2.3

4 months ago

0.2.2

4 months ago

0.2.5

4 months ago

0.2.4

4 months ago

0.1.11

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.10

5 months ago

0.1.2

5 months ago

0.1.8

5 months ago

0.1.7

5 months ago

0.1.9

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.1.1

5 months ago

0.0.10

5 months ago

0.0.9

5 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

8 months ago