Skip to content

Commit

Permalink
Feature/prt 1750 (#27)
Browse files Browse the repository at this point in the history
* build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 (#5)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add new toolbar

* feat: add new configs toolbar

* fix: remove unusual component

* fix: remove unusual functions

* fix: remove unusual

* feat: add verify to see toolbar config

* fix: add document to selection

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
ItalloDornelas and dependabot[bot] authored Nov 16, 2023
1 parent 44beb16 commit 4a0d1e5
Show file tree
Hide file tree
Showing 3 changed files with 396 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 40 additions & 5 deletions src/syncfusion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
import { EditorAdapter } from "../editor";
import { IaraInference } from "../speech";
import { IaraEditorInferenceFormatter } from "../editor/formatter";
import { toolBarSettings, toolbarButtonClick } from "./toolbarConfig";

interface SelectionOffsets {
end: string;
Expand All @@ -17,25 +18,37 @@ export class IaraSyncfusionAdapter
implements EditorAdapter
{
private _initialUndoStackSize = 0;

private _inferenceFormatter: IaraEditorInferenceFormatter;

public savingReportSpan = document.createElement("span");
public timeoutToSave: any;
private _inferenceFormatter: IaraEditorInferenceFormatter;

private get _toolBar() {
return this._editor.toolbarModule.toolbar;
}

private get _editorAPI(): Editor {
return this._editor.editor;
return this._editor.documentEditor.editor;
}
private get _editorHistory(): EditorHistory {
return this._editor.editorHistory;
return this._editor.documentEditor.editorHistory;
}

private get _editorSelection(): Selection {
return this._editor.selection;
return this._editor.documentEditor.selection;
}

constructor(protected _editor: any, protected _recognition: any) {
constructor(
protected _editor: any,
protected _recognition: any,
replaceToolbar: boolean = true
) {
super(_editor, _recognition);
this._editor.contentChange = this._onContentChange.bind(this);
this._editor.destroyed = this._onEditorDestroy.bind(this);
this._editor.enableLocalPaste = true;
if (replaceToolbar) this.initToolbarConfigs();
this._inferenceFormatter = new IaraEditorInferenceFormatter();
}

Expand Down Expand Up @@ -156,6 +169,28 @@ export class IaraSyncfusionAdapter
});
}

initToolbarConfigs() {
const toolbarItems = toolBarSettings(this._editor);
this._toolBar.addItems(toolbarItems, 5);
this._editor.toolbarClick = this.onClickToolbar.bind(this);
this.removePropertiesPane();
}

onClickToolbar(arg: { item: any }) {
toolbarButtonClick(arg, this._editorAPI, this._editor);
}

removePropertiesPane() {
this._editor.showPropertiesPane = false;
const paneButton = document.querySelector(
".e-de-ctnr-properties-pane-btn"
) as HTMLElement;
paneButton.remove();
//remove wrapper button
const wrapper = document.querySelector(".e-de-tlbr-wrapper") as HTMLElement;
wrapper.style.width = "100%";
}

private async _onEditorDestroy() {
this.finishReport();
}
Expand Down
Loading

0 comments on commit 4a0d1e5

Please sign in to comment.