diff --git a/.prettierrc b/.prettierrc index 7c65a9764..d097b0bb0 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,13 +1,14 @@ { "bracketSameLine": false, + "plugins": ["prettier-plugin-svelte"], "printWidth": 80, "semi": true, "singleQuote": false, - "tabWidth": 2, - "trailingComma": "all", - "useTabs": false, "svelteAllowShorthand": true, "svelteIndentScriptAndStyle": true, - "svelteSortOrder": "options-scripts-styles-markup", - "svelteStrictMode": false + "svelteSortOrder": "options-scripts-markup-styles", + "svelteStrictMode": false, + "tabWidth": 2, + "trailingComma": "all", + "useTabs": false } diff --git a/package-lock.json b/package-lock.json index 75b9887a7..4b3d07256 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,7 +77,8 @@ "msw-storybook-addon": "^1.10.0", "netlify-plugin-playwright-cache": "^0.0.1", "playwright": "^1.39.0", - "prettier": "^3.0.2", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", "react": "^18.2.0", "react-dom": "^18.2.0", "serve": "^14.2.0", @@ -18106,9 +18107,9 @@ } }, "node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -18120,6 +18121,16 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-svelte": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.1.2.tgz", + "integrity": "sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==", + "dev": true, + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" + } + }, "node_modules/pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", diff --git a/package.json b/package.json index 3ffa7bdf9..1a69099a8 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,8 @@ "msw-storybook-addon": "^1.10.0", "netlify-plugin-playwright-cache": "^0.0.1", "playwright": "^1.39.0", - "prettier": "^3.0.2", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", "react": "^18.2.0", "react-dom": "^18.2.0", "serve": "^14.2.0", @@ -90,6 +91,8 @@ "dev": "concurrently \"npm:dev-app\" \"npm:dev-embed\"", "dev-app": "cross-env NODE_ENV=development SUPPRESS_WARNINGS=1 webpack serve --config webpack.app.config.js", "dev-embed": "cross-env NODE_ENV=development webpack --config webpack.embed.config.js", + "format": "prettier --write src", + "format:check": "prettier --check src", "serve": "serve public -l 80 --single", "storybook": "storybook dev -p 6006", "test": "NODE_OPTIONS=--experimental-vm-modules jest", diff --git a/src/addons/Drawer.svelte b/src/addons/Drawer.svelte index 79439412a..be5281b79 100644 --- a/src/addons/Drawer.svelte +++ b/src/addons/Drawer.svelte @@ -56,6 +56,33 @@ } + + +{#if visible} + +{/if} + - - - -{#if visible} - -{/if} diff --git a/src/addons/Paginator.svelte b/src/addons/Paginator.svelte index 0691e5260..ce41c18c7 100644 --- a/src/addons/Paginator.svelte +++ b/src/addons/Paginator.svelte @@ -17,15 +17,6 @@ } - -
+ + diff --git a/src/addons/Popularity.svelte b/src/addons/Popularity.svelte index 15bfe4ebb..cec0ca520 100644 --- a/src/addons/Popularity.svelte +++ b/src/addons/Popularity.svelte @@ -5,20 +5,6 @@ export let useCount: number; - -
@@ -33,3 +19,17 @@ {nFormatter(useCount, 1)}
+ + diff --git a/src/addons/browser/AddOnList.svelte b/src/addons/browser/AddOnList.svelte index 42cee3188..b4ee58bf3 100644 --- a/src/addons/browser/AddOnList.svelte +++ b/src/addons/browser/AddOnList.svelte @@ -25,6 +25,31 @@ $: empty = !(items && items.length > 0); +
+ {#if loading} + + +

{$_("addonBrowserDialog.loading")}

+ {:else if error} + +
+

{error}

+ {#if reload}{/if} + {:else if empty} + +
+

{$_("addonBrowserDialog.empty")}

+ {:else} +
    + {#each items as addon (addon.id)} +
  • + {/each} +
+ {/if} +
+ - -
- {#if loading} - - -

{$_("addonBrowserDialog.loading")}

- {:else if error} - -
-

{error}

- {#if reload}{/if} - {:else if empty} - -
-

{$_("addonBrowserDialog.empty")}

- {:else} -
    - {#each items as addon (addon.id)} -
  • - {/each} -
- {/if} -
diff --git a/src/addons/browser/AddOnListItem.svelte b/src/addons/browser/AddOnListItem.svelte index ae5e57be3..40284d260 100644 --- a/src/addons/browser/AddOnListItem.svelte +++ b/src/addons/browser/AddOnListItem.svelte @@ -15,6 +15,48 @@ $: isPremium = addon?.parameters?.categories?.includes("premium") ?? false; + +
+
+
+ +
+
+

{addon.name}

+
+
+
+ {#if description} +
{@html description}
+ {/if} +
+ + - - -
-
-
- -
-
-

{addon.name}

-
-
-
- {#if description} -
{@html description}
- {/if} -
- diff --git a/src/addons/browser/Browser.svelte b/src/addons/browser/Browser.svelte index 36a1de2fe..a975fdea8 100644 --- a/src/addons/browser/Browser.svelte +++ b/src/addons/browser/Browser.svelte @@ -109,6 +109,48 @@ } + +
+
+

{$_("addonBrowserDialog.title")}

+

{$_("addonBrowserDialog.subtitle")}

+
+ +
+
+ {#if $filter === "active"} + + {:else if $filter === "featured"} + + {:else if $filter === "premium"} + + {/if} + +
+ +
+
+
+ - - -
-
-

{$_("addonBrowserDialog.title")}

-

{$_("addonBrowserDialog.subtitle")}

-
- -
-
- {#if $filter === "active"} - - {:else if $filter === "featured"} - - {:else if $filter === "premium"} - - {/if} - -
- -
-
-
diff --git a/src/addons/browser/Filter.svelte b/src/addons/browser/Filter.svelte index 5469d5304..487c1338c 100644 --- a/src/addons/browser/Filter.svelte +++ b/src/addons/browser/Filter.svelte @@ -3,6 +3,12 @@ export let selected: boolean; + + - - diff --git a/src/addons/browser/Filters.svelte b/src/addons/browser/Filters.svelte index fa74f660d..fcef773df 100644 --- a/src/addons/browser/Filters.svelte +++ b/src/addons/browser/Filters.svelte @@ -30,43 +30,6 @@ import Credit from "../../common/icons/Credit.svelte"; - - + + diff --git a/src/addons/browser/SearchInput.svelte b/src/addons/browser/SearchInput.svelte index 25fa1fa38..e580b9ab8 100644 --- a/src/addons/browser/SearchInput.svelte +++ b/src/addons/browser/SearchInput.svelte @@ -9,6 +9,16 @@ import Search from "../../common/icons/Search.svelte"; + + - - diff --git a/src/addons/browser/stories/AddOnListItem.stories.svelte b/src/addons/browser/stories/AddOnListItem.stories.svelte index 5f2700708..3fc1804bf 100644 --- a/src/addons/browser/stories/AddOnListItem.stories.svelte +++ b/src/addons/browser/stories/AddOnListItem.stories.svelte @@ -23,13 +23,6 @@ }; - -