Skip to content

Commit 3959139

Browse files
committed
refactor: added some comments
1 parent 98e1fd6 commit 3959139

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,19 @@ export default class Paragraph implements BlockTool {
4343
*/
4444
private readonly element: HTMLDivElement;
4545

46+
/**
47+
* CSS class names
48+
*/
4649
private readonly CSS: ParagraphToolCSS;
4750

4851
/**
4952
* Placeholder for paragraph if it is first Block
5053
*/
5154
private readonly placeholder: string;
5255

56+
/**
57+
* Will save empty paragraphs if set to true
58+
*/
5359
private readonly preserveBlank: boolean;
5460

5561
/**

src/types/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export interface ParagraphToolData extends BlockToolData {
1010
text?: string;
1111
}
1212

13+
/**
14+
* Public features for configuring the tool
15+
*/
1316
export interface ParagraphToolConfig extends ToolConfig {
1417
/**
1518
* Placeholder for the empty paragraph
@@ -22,6 +25,9 @@ export interface ParagraphToolConfig extends ToolConfig {
2225
preserveBlank?: boolean;
2326
}
2427

28+
/**
29+
* CSS class names for elements created by the plugin
30+
*/
2531
export interface ParagraphToolCSS {
2632
/**
2733
* Block CSS class name
@@ -34,10 +40,16 @@ export interface ParagraphToolCSS {
3440
wrapper: string;
3541
}
3642

43+
/**
44+
* Used by Editor paste handling API
45+
*/
3746
export interface PasteConfig {
3847
tags: string[];
3948
}
4049

50+
/**
51+
* Used by Editor API to display the module in the toolbox
52+
*/
4153
export interface Toolbox {
4254
icon: string;
4355
title: string;

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default defineConfig({
1919
build: {
2020
lib: {
2121
entry: path.resolve(__dirname, 'src', 'index.ts'),
22-
name: 'paragraph',
22+
name: 'Paragraph',
2323
formats: ['umd', 'es'],
2424
fileName: 'paragraph',
2525
},

0 commit comments

Comments
 (0)