Skip to content

Commit

Permalink
Merge branch 'master' into feature/open-in-new-tab-option
Browse files Browse the repository at this point in the history
  • Loading branch information
sibiraj-s authored Apr 3, 2024
2 parents 4d1e336 + 35838ba commit 0d752ca
Show file tree
Hide file tree
Showing 8 changed files with 1,397 additions and 1,344 deletions.
2,722 changes: 1,385 additions & 1,337 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"lint-staged": "^15.2.2",
"nanoid": "^5.0.6",
"ng-packagr": "^17.1.0",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
Expand Down
1 change: 0 additions & 1 deletion projects/ngx-editor/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"prosemirror-commands",
"prosemirror-history",
"prosemirror-inputrules",
"nanoid",
"@floating-ui/core",
"@floating-ui/dom",
"@types/trusted-types"
Expand Down
1 change: 0 additions & 1 deletion projects/ngx-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@floating-ui/core": "1.6.0",
"@floating-ui/dom": "1.6.3",
"@types/trusted-types": "~2.0.7",
"nanoid": "^5.0.6",
"prosemirror-commands": "1.5.2",
"prosemirror-history": "1.3.2",
"prosemirror-inputrules":"1.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/fo
import { NodeSelection } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import { Observable, Subscription } from 'rxjs';
import { nanoid } from 'nanoid';
import { uniq } from 'ngx-editor/utils';

import { NgxEditorService } from '../../../editor.service';
import { MenuService } from '../menu.service';
Expand All @@ -21,7 +21,7 @@ import { HTML } from '../../../trustedTypesUtil';
export class ImageComponent implements OnInit, OnDestroy {
showPopup = false;
isActive = false;
private componentId = nanoid();
private componentId = uniq();
private updateSubscription: Subscription;

form = new FormGroup({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
import { EditorView } from 'prosemirror-view';
import { Observable, Subscription } from 'rxjs';
import { uniq } from 'ngx-editor/utils';

import { NgxEditorService } from '../../../editor.service';
import { MenuService } from '../menu.service';
import { Link as LinkCommand } from '../MenuCommands';
import { HTML } from '../../../trustedTypesUtil';
import { nanoid } from 'nanoid';

@Component({
selector: 'ngx-link',
Expand All @@ -24,7 +24,7 @@ export class LinkComponent implements OnInit, OnDestroy {
showPopup = false;
isActive = false;
canExecute = true;
private componentId = nanoid();
private componentId = uniq();
form: FormGroup;

private editorView: EditorView;
Expand Down
1 change: 1 addition & 0 deletions projects/ngx-editor/utils/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as isNil } from './isNil';
export { default as toStyleString } from './toStyleString';
export { default as NgxEditorError } from './error';
export { default as uniq } from './uniq';
7 changes: 7 additions & 0 deletions projects/ngx-editor/utils/uniq.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const uniq = (): string => {
const timeStamp = Date.now().toString(36);
const random = Math.random().toString(36).substring(2, 7);
return `${timeStamp}${random}`;
};

export default uniq;

0 comments on commit 0d752ca

Please sign in to comment.