Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
e11sy committed Aug 29, 2024
1 parent a2d5e30 commit 1adf8c5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/entities/InlineTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export interface InlineTool extends Omit<InlineToolVersion2, 'save' | 'checkStat
getAction(index: TextRange, fragments: InlineFragment[]): FormattingActionWithRange;

/**
* Method for rendering the tool
* Method for creating wrapper element of the tool
*/
create(): HTMLElement;
createWrapper(): HTMLElement;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class BoldInlineTool implements InlineTool {
* Renders wrapper for tool without actual content
* @returns Created html element
*/
public create(): HTMLElement {
public createWrapper(): HTMLElement {
return make('b');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class ItalicInlineTool implements InlineTool {
* Renders wrapper for tool without actual content
* @returns Created html element
*/
public create(): HTMLElement {
public createWrapper(): HTMLElement {
return make('i');
}

Expand Down
4 changes: 1 addition & 3 deletions packages/dom-adapters/src/InlineToolsAdapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class InlineToolsAdapter {
if (selection) {
const range = selection.getRangeAt(0);

const inlineElement = tool.create();
const inlineElement = tool.createWrapper();

/**
* Insert contents from range to new inline element and put created element in range
Expand Down Expand Up @@ -135,8 +135,6 @@ export class InlineToolsAdapter {

const { action, range } = tool.getAction(textRange, fragments);

console.log('tool get action in adapter');

switch (action) {
case FormattingAction.Format:
this.#model.format(blockIndex, dataKey, toolName, ...range, data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export enum IntersectType {
/**
* If two fragments of one tool intersect - treat them as two different fragments
*/
LeaveBoth = 'LeaveBoth'
LeaveBoth = 'leave-both'
}

0 comments on commit 1adf8c5

Please sign in to comment.