Skip to content

Commit

Permalink
refactor: added some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekaN2 committed Mar 2, 2023
1 parent 98e1fd6 commit 3959139
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,19 @@ export default class Paragraph implements BlockTool {
*/
private readonly element: HTMLDivElement;

/**
* CSS class names
*/
private readonly CSS: ParagraphToolCSS;

/**
* Placeholder for paragraph if it is first Block
*/
private readonly placeholder: string;

/**
* Will save empty paragraphs if set to true
*/
private readonly preserveBlank: boolean;

/**
Expand Down
12 changes: 12 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export interface ParagraphToolData extends BlockToolData {
text?: string;
}

/**
* Public features for configuring the tool
*/
export interface ParagraphToolConfig extends ToolConfig {
/**
* Placeholder for the empty paragraph
Expand All @@ -22,6 +25,9 @@ export interface ParagraphToolConfig extends ToolConfig {
preserveBlank?: boolean;
}

/**
* CSS class names for elements created by the plugin
*/
export interface ParagraphToolCSS {
/**
* Block CSS class name
Expand All @@ -34,10 +40,16 @@ export interface ParagraphToolCSS {
wrapper: string;
}

/**
* Used by Editor paste handling API
*/
export interface PasteConfig {
tags: string[];
}

/**
* Used by Editor API to display the module in the toolbox
*/
export interface Toolbox {
icon: string;
title: string;
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src', 'index.ts'),
name: 'paragraph',
name: 'Paragraph',
formats: ['umd', 'es'],
fileName: 'paragraph',
},
Expand Down

0 comments on commit 3959139

Please sign in to comment.