Skip to content

Commit

Permalink
build: apply prettier formatting to playground
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed Apr 6, 2024
1 parent e88cbb6 commit e53ced3
Show file tree
Hide file tree
Showing 34 changed files with 2,822 additions and 2,735 deletions.
3 changes: 1 addition & 2 deletions demos/playground/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Rich Text Editor

A sample Rich Text Editor using svelte-lexical
A sample Rich Text Editor using svelte-lexical
2 changes: 1 addition & 1 deletion demos/playground/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 3 additions & 1 deletion demos/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build-dev": "vite build",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings",
"lint": "eslint .",
"lint": "prettier --check . --ignore-path ../../.gitignore && eslint .",
"size": "pnpm build && size-limit",
"collab": "cross-env HOST=localhost PORT=1234 npx y-websocket-server",
"prepare-ci": "pnpm run build-dev",
Expand Down Expand Up @@ -73,10 +73,12 @@
"concurrently": "^8.0.1",
"cross-env": "^7.0.3",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-svelte": "^2.35.1",
"prettier": "^3.2.5",
"prettier-plugin-organize-attributes": "^1.0.0",
"prettier-plugin-svelte": "^3.2.2",
"serve": "^14.2.0",
"size-limit": "^8.2.6",
"start-server-and-test": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion demos/playground/split/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
8 changes: 4 additions & 4 deletions demos/playground/src/RichTextComposer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
$: placeholderText = $settings.isCollab
? 'Enter some collaborative rich text...'
: $settings.isRichText
? 'Enter some rich text...'
: 'Enter some plain text...';
? 'Enter some rich text...'
: 'Enter some plain text...';
let isSmallWidthViewport = false;
Expand All @@ -67,8 +67,8 @@
editorState: $settings.isCollab
? null
: $settings.emptyEditor
? undefined
: prepopulatedRichText,
? undefined
: prepopulatedRichText,
namespace: 'Playground',
nodes: [
HeadingNode,
Expand Down
71 changes: 37 additions & 34 deletions demos/playground/src/__tests__/e2e/AutoLinks.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,42 +156,45 @@ test.describe('Auto Links', () => {
);
});

test.fixme('Does not create redundant auto-link', async ({page, isPlainText}) => {
test.skip(isPlainText);
await focusEditor(page);
await page.keyboard.type('hm');
test.fixme(
'Does not create redundant auto-link',
async ({page, isPlainText}) => {
test.skip(isPlainText);
await focusEditor(page);
await page.keyboard.type('hm');

await selectAll(page);
await click(page, '.link');
await selectAll(page);
await click(page, '.link');

await assertHTML(
page,
html`
<p dir="ltr">
<a href="https://" dir="ltr" rel="noopener">
<span data-lexical-text="true">hm</span>
</a>
</p>
`,
undefined,
{ignoreClasses: true},
);
await moveLeft(page, 1);
await moveRight(page, 1);
await page.keyboard.type('ttps://facebook.co');
await assertHTML(
page,
html`
<p dir="ltr">
<a href="https://" dir="ltr" rel="noopener">
<span data-lexical-text="true">https://facebook.com</span>
</a>
</p>
`,
undefined,
{ignoreClasses: true},
);
});
await assertHTML(
page,
html`
<p dir="ltr">
<a href="https://" dir="ltr" rel="noopener">
<span data-lexical-text="true">hm</span>
</a>
</p>
`,
undefined,
{ignoreClasses: true},
);
await moveLeft(page, 1);
await moveRight(page, 1);
await page.keyboard.type('ttps://facebook.co');
await assertHTML(
page,
html`
<p dir="ltr">
<a href="https://" dir="ltr" rel="noopener">
<span data-lexical-text="true">https://facebook.com</span>
</a>
</p>
`,
undefined,
{ignoreClasses: true},
);
},
);

test('Can create links when pasting text with multiple autolinks in a row separated by non-alphanumeric characters, but not whitespaces', async ({
page,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
*/

import { selectAll } from '../keyboardShortcuts/index.mjs';
import {selectAll} from '../keyboardShortcuts/index.mjs';
import {
assertHTML,
focusEditor,
Expand All @@ -20,7 +20,7 @@ import {
const TEST_URL = 'https://www.youtube-nocookie.com/embed/jNQXAC9IVRw';
test.describe('BlockWithAlignableContents', () => {
test.fixme();
test.beforeEach(({ isCollab, page }) => initialize({ isCollab, page }));
test.beforeEach(({isCollab, page}) => initialize({isCollab, page}));

test('Can create full width blocks for YouTube videos', async ({
page,
Expand Down Expand Up @@ -126,7 +126,7 @@ test.describe('BlockWithAlignableContents', () => {
</p>
`,
undefined,
{ ignoreClasses: true },
{ignoreClasses: true},
);
});
});
6 changes: 3 additions & 3 deletions demos/playground/src/__tests__/e2e/ClearFormatting.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import {

test.describe('Clear All Formatting', () => {
test.fixme();
test.beforeEach(({ isPlainText, isCollab, page }) => {
test.beforeEach(({isPlainText, isCollab, page}) => {
test.skip(isPlainText);
initialize({ isCollab, page });
initialize({isCollab, page});
});
test(`Can clear BIU formatting`, async ({ page }) => {
test(`Can clear BIU formatting`, async ({page}) => {
await focusEditor(page);

await page.keyboard.type('Hello');
Expand Down
Loading

0 comments on commit e53ced3

Please sign in to comment.