Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical-markdown] Breaking Change: rename 'multilineElement' to 'multiline-element' #6617

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/lexical-markdown/flow/LexicalMarkdown.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export type MultilineElementTransformer = {
linesInBetween: Array<string> | null,
isImport: boolean,
) => boolean | void;
type: 'multilineElement';
type: 'multiline-element';
};

export type TextFormatTransformer = $ReadOnly<{
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-markdown/src/MarkdownShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export function registerMarkdownShortcuts(
if (
type === 'element' ||
type === 'text-match' ||
type === 'multilineElement'
type === 'multiline-element'
) {
const dependencies = transformer.dependencies;
for (const node of dependencies) {
Expand Down
4 changes: 2 additions & 2 deletions packages/lexical-markdown/src/MarkdownTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export type MultilineElementTransformer = {
*/
isImport: boolean,
) => boolean | void;
type: 'multilineElement';
type: 'multiline-element';
};

export type TextFormatTransformer = Readonly<{
Expand Down Expand Up @@ -391,7 +391,7 @@ export const CODE: MultilineElementTransformer = {
})(rootNode, children, startMatch, isImport);
}
},
type: 'multilineElement',
type: 'multiline-element',
};

export const UNORDERED_LIST: ElementTransformer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const MDX_HTML_TRANSFORMER: MultilineElementTransformer = {
}
return false; // Run next transformer
},
type: 'multilineElement',
type: 'multiline-element',
};

describe('Markdown', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-markdown/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export function transformersByType(transformers: Array<Transformer>): Readonly<{

return {
element: (byType.element || []) as Array<ElementTransformer>,
multilineElement: (byType.multilineElement ||
multilineElement: (byType['multiline-element'] ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure of the historical reason why kebab case was originally chosen as the type name convention.

im open to switching everything to lowerCamelCase if theres a compelling reason

[]) as Array<MultilineElementTransformer>,
textFormat: (byType['text-format'] || []) as Array<TextFormatTransformer>,
textMatch: (byType['text-match'] || []) as Array<TextMatchTransformer>,
Expand Down
Loading