mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2025-03-18 17:16:21 +03:00
chore: Fix issues
This commit is contained in:
@@ -4,6 +4,6 @@
|
||||
"bracketSameLine": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 100,
|
||||
"tailwindConfig": "./tailwind.config.cjs",
|
||||
"tailwindConfig": "./tailwind.config.cjs",
|
||||
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"]
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ export const typeInEditor = (
|
||||
) => {
|
||||
cy.window().should('have.property', 'editorLoaded', true);
|
||||
cy.get('#editor').click();
|
||||
cy.get('#editor').within(($editor) => {
|
||||
cy.get('#editor').within(() => {
|
||||
if (bottom) {
|
||||
cy.get('textarea').type('{pageDown}', { force: true });
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@tailwind utilities;
|
||||
|
||||
.input {
|
||||
@apply flex-1 border-primary border-solid border-2 rounded;
|
||||
@apply flex-1 rounded border-2 border-solid border-primary;
|
||||
}
|
||||
.action-btn {
|
||||
@apply btn btn-primary;
|
||||
|
||||
@@ -109,7 +109,7 @@ export const loadGistData = async (gistURL: string): Promise<State> => {
|
||||
throw new Error('Invalid gist provided');
|
||||
}
|
||||
gistHistory.reverse();
|
||||
const entry = gistHistory.slice(-1).pop();
|
||||
const entry = gistHistory.at(-1);
|
||||
if (!entry) {
|
||||
throw new Error('Invalid gist provided');
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ function getBrowserStorage(
|
||||
disconnect();
|
||||
}
|
||||
},
|
||||
getValue(key: string): any | null {
|
||||
getValue(key: string): any {
|
||||
const value = browserStorage.getItem(key);
|
||||
return deserialize(value);
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ export const detectType = (text: string): string | undefined => {
|
||||
'mindmap'
|
||||
];
|
||||
const firstLine = text
|
||||
.replace(/^\s*%%.*\n/g, '\n')
|
||||
.replaceAll(/^\s*%%.*\n/g, '\n')
|
||||
.trimStart()
|
||||
.split(' ')[0]
|
||||
.toLowerCase();
|
||||
@@ -57,22 +57,22 @@ export const saveStatistics = (graph: string): void => {
|
||||
length < 10
|
||||
? '0-10'
|
||||
: length < 25
|
||||
? '10-25'
|
||||
: length < 50
|
||||
? '25-50'
|
||||
: length < 100
|
||||
? '50-100'
|
||||
: length < 200
|
||||
? '100-200'
|
||||
: length < 500
|
||||
? '200-500'
|
||||
: length < 700
|
||||
? '500-700'
|
||||
: length < 1000
|
||||
? '700-1000'
|
||||
: length < 1500
|
||||
? '1000-1500'
|
||||
: '1500+';
|
||||
? '10-25'
|
||||
: length < 50
|
||||
? '25-50'
|
||||
: length < 100
|
||||
? '50-100'
|
||||
: length < 200
|
||||
? '100-200'
|
||||
: length < 500
|
||||
? '200-500'
|
||||
: length < 700
|
||||
? '500-700'
|
||||
: length < 1000
|
||||
? '700-1000'
|
||||
: length < 1500
|
||||
? '1000-1500'
|
||||
: '1500+';
|
||||
logEvent('render', { graphType, length, lengthBucket });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user