Skip to content

Commit

Permalink
refactor: Loosen node and version types
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Dec 4, 2023
1 parent c76072a commit 2f96355
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 23 deletions.
8 changes: 4 additions & 4 deletions docs/development-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ The tests run in headless mode in the background.
### Running locally from CLI

- Start the playground demo
- <code>pnpm -C demos/playground dev</code>
- `pnpm -C demos/playground dev`
- Move into the project directory
- <code>cd demos/playground</code>
- `cd demos/playground`
- Run tests
- All tests (chromium, firefox and safari): <code>pnpm playwright test</code>
- Just chromium browser: <code>pnpm test-e2e:chromium</code>
- All tests (chromium, firefox and safari): `pnpm playwright test`
- Just chromium browser: `pnpm test-e2e:chromium`

The tests run in headless mode in the background.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ import type {
import {createCommand, DecoratorNode, $applyNodeReplacement} from 'lexical';
import HorizontalRuleComponent from './HorizontalRuleComponent.svelte';

export type SerializedHorizontalRuleNode = SerializedLexicalNode & {
type: 'horizontalrule';
version: 1;
};
export type SerializedHorizontalRuleNode = SerializedLexicalNode;

export const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void> =
createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
Expand Down
2 changes: 0 additions & 2 deletions packages/svelte-lexical/src/core/plugins/Image/ImageNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ export type SerializedImageNode = Spread<
showCaption: boolean;
src: string;
width?: number;
type: 'image';
version: 1;
},
SerializedLexicalNode
>;
Expand Down
15 changes: 2 additions & 13 deletions packages/svelte-lexical/src/core/plugins/KeywordNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,11 @@
*
*/

import type {
EditorConfig,
LexicalNode,
SerializedTextNode,
Spread,
} from 'lexical';
import type {EditorConfig, LexicalNode, SerializedTextNode} from 'lexical';

import {TextNode} from 'lexical';

export type SerializedKeywordNode = Spread<
{
type: 'keyword';
version: 1;
},
SerializedTextNode
>;
export type SerializedKeywordNode = SerializedTextNode;

export class KeywordNode extends TextNode {
static getType(): string {
Expand Down

0 comments on commit 2f96355

Please sign in to comment.