From a0086c3a313eb67fa85bf31ba9dd9b078b07738c Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Tue, 12 Dec 2023 12:34:03 -0500 Subject: [PATCH] Format all the files --- .prettierrc | 11 +- package-lock.json | 19 +- package.json | 5 +- src/addons/Drawer.svelte | 54 +-- src/addons/Paginator.svelte | 18 +- src/addons/Popularity.svelte | 28 +- src/addons/browser/AddOnList.svelte | 50 +- src/addons/browser/AddOnListItem.svelte | 84 ++-- src/addons/browser/Browser.svelte | 84 ++-- src/addons/browser/Filter.svelte | 12 +- src/addons/browser/Filters.svelte | 74 +-- src/addons/browser/SearchInput.svelte | 20 +- .../stories/AddOnListItem.stories.svelte | 14 +- src/addons/dispatch/Dispatch.svelte | 40 +- src/addons/dispatch/Form.svelte | 46 +- src/addons/dispatch/Header.svelte | 130 +++--- src/addons/dispatch/Premium.svelte | 148 +++--- src/addons/dispatch/ScheduledInset.svelte | 32 +- src/addons/dispatch/Selection.svelte | 74 +-- src/addons/dispatch/fields/ArrayField.svelte | 58 +-- src/addons/dispatch/fields/Checkbox.svelte | 8 +- src/addons/dispatch/fields/Field.svelte | 24 +- src/addons/dispatch/fields/Number.svelte | 12 +- src/addons/dispatch/fields/Text.svelte | 14 +- .../dispatch/stories/Header.stories.svelte | 14 +- src/addons/progress/AddonRun.svelte | 116 ++--- src/addons/progress/AddonStatus.svelte | 18 +- src/addons/runs/History.svelte | 76 ++-- src/addons/runs/HistoryEvent.svelte | 86 ++-- src/addons/runs/Runs.svelte | 18 +- src/addons/runs/Scheduled.svelte | 72 +-- src/addons/runs/ScheduledEvent.svelte | 58 +-- src/addons/sidebar/AddonListItem.svelte | 8 +- src/addons/sidebar/ListItem.svelte | 10 +- src/addons/sidebar/Sidebar.svelte | 32 +- .../sidebar/stories/ListItem.stories.svelte | 20 +- .../sidebar/stories/Sidebar.stories.svelte | 12 +- src/addons/stories/Drawer.stories.svelte | 16 +- src/addons/stories/Paginator.stories.svelte | 16 +- src/api/languages.js | 4 +- src/common/AccessIcon.svelte | 34 +- src/common/AccessToggle.svelte | 100 ++-- src/common/AppearanceCustomizer.svelte | 48 +- src/common/AppearanceDimension.svelte | 46 +- src/common/AppearanceToggle.svelte | 30 +- src/common/Autocomplete.svelte | 60 +-- src/common/Badge.svelte | 16 +- src/common/Button.svelte | 92 ++-- src/common/Calendar.svelte | 118 ++--- src/common/Checkbox.svelte | 42 +- src/common/Draggable.svelte | 22 +- src/common/DropZone.svelte | 16 +- src/common/Dropdown.svelte | 74 +-- src/common/Dropdown2.svelte | 62 +-- src/common/ErrorData.svelte | 62 +-- src/common/FilePicker.svelte | 28 +- src/common/Hamburger.svelte | 12 +- src/common/HtmlEditor.svelte | 31 +- src/common/HtmlField.svelte | 21 +- src/common/Image.svelte | 92 ++-- src/common/Loader.svelte | 28 +- src/common/Logo.svelte | 26 +- src/common/Menu.svelte | 8 +- src/common/MenuInsert.svelte | 8 +- src/common/MenuItem.svelte | 38 +- src/common/MenuTitle.svelte | 12 +- src/common/Modal.svelte | 52 +-- src/common/Pin.svelte | 16 +- src/common/Progress.svelte | 30 +- src/common/ProgressiveImage.svelte | 16 +- src/common/Select.svelte | 28 +- src/common/ShareOptions.svelte | 184 ++++---- src/common/SpecialMessage.svelte | 34 +- src/common/TextPage.svelte | 20 +- src/common/Title.svelte | 10 +- src/common/Toast.svelte | 20 +- src/common/Toasts.svelte | 12 +- src/common/Tooltip.svelte | 44 +- src/common/UploadOptions.svelte | 50 +- src/common/VariableChunk.svelte | 8 +- src/common/dialog/AccessDialog.svelte | 204 ++++----- src/common/dialog/CollaboratorDialog.svelte | 144 +++--- src/common/dialog/DataDialog.svelte | 134 +++--- src/common/dialog/DiagnosticDialog.svelte | 52 +-- src/common/dialog/DocumentEmbedDialog.svelte | 12 +- .../dialog/DocumentInformationDialog.svelte | 40 +- src/common/dialog/DocumentPickerDialog.svelte | 12 +- src/common/dialog/EditSectionsDialog.svelte | 178 ++++---- src/common/dialog/EmbedDialog.svelte | 220 ++++----- src/common/dialog/MetaFieldDialog.svelte | 12 +- src/common/dialog/OwnerDialog.svelte | 58 +-- src/common/dialog/PageEmbedDialog.svelte | 12 +- src/common/dialog/ProjectAccessDialog.svelte | 58 +-- src/common/dialog/ProjectDialog.svelte | 36 +- src/common/dialog/ProjectEmbedDialog.svelte | 6 +- src/common/dialog/ReprocessDialog.svelte | 6 +- src/common/dialog/SearchTipsDialog.svelte | 118 ++--- src/common/dialog/UploadEmailDialog.svelte | 20 +- src/common/dialog/metaDialogs.js | 4 +- src/common/icons/Credit.svelte | 14 +- src/common/icons/Hashtag.svelte | 12 +- src/common/icons/Help.svelte | 12 +- src/common/icons/Language.svelte | 16 +- src/common/icons/Pin.svelte | 14 +- src/common/icons/Star.svelte | 12 +- src/common/stories/Dropdown.stories.svelte | 20 +- src/langs/json/en.json | 2 +- src/main.html | 2 +- src/pages/FlatPage.svelte | 58 +-- src/pages/NotFound.svelte | 18 +- src/pages/app/ActionBar.svelte | 126 ++--- src/pages/app/Anonymous.svelte | 98 ++-- src/pages/app/AuthSection.svelte | 50 +- src/pages/app/Document.svelte | 360 +++++++-------- src/pages/app/DocumentThumbnail.svelte | 118 ++--- src/pages/app/Documents.svelte | 182 ++++---- src/pages/app/EmbedFooter.svelte | 24 +- src/pages/app/File.svelte | 62 +-- src/pages/app/MainContainer.svelte | 66 +-- src/pages/app/NoDocuments.svelte | 86 ++-- src/pages/app/Paginator.svelte | 62 +-- src/pages/app/ProcessingBar.svelte | 40 +- src/pages/app/SearchBar.svelte | 50 +- src/pages/app/SearchInput.svelte | 200 ++++---- src/pages/app/SearchLink.svelte | 16 +- src/pages/app/UploadDialog.svelte | 86 ++-- .../app/accounts/AccountNavigation.svelte | 30 +- src/pages/app/accounts/HelpMenu.svelte | 20 +- src/pages/app/accounts/LanguageMenu.svelte | 20 +- src/pages/app/accounts/OrgMemberList.svelte | 82 ++-- src/pages/app/accounts/OrgMenu.svelte | 48 +- src/pages/app/accounts/OrgPicker.svelte | 52 +-- src/pages/app/accounts/PremiumMenu.svelte | 52 +-- src/pages/app/accounts/UserMenu.svelte | 30 +- src/pages/app/menus/AddonsMenu.svelte | 24 +- src/pages/app/menus/EditMenu.svelte | 20 +- src/pages/app/menus/ProjectMenuItem.svelte | 16 +- src/pages/app/menus/ProjectsMenu.svelte | 16 +- src/pages/app/sidebar/Project.svelte | 28 +- src/pages/app/sidebar/ProjectFilters.svelte | 46 +- src/pages/app/sidebar/Projects.svelte | 40 +- src/pages/app/sidebar/Sidebar.svelte | 34 +- src/pages/embed/note/Note.svelte | 231 +++++----- src/pages/embed/page/Annotation.svelte | 26 +- src/pages/embed/page/Note.svelte | 24 +- src/pages/embed/page/Page.svelte | 88 ++-- src/pages/entities/Entities.svelte | 218 ++++----- src/pages/home/HomeTemplate.svelte | 162 +++---- src/pages/viewer/AllText.svelte | 36 +- src/pages/viewer/Annotation.svelte | 430 +++++++++--------- src/pages/viewer/Body.svelte | 46 +- src/pages/viewer/ContentItem.svelte | 146 +++--- src/pages/viewer/ExtraPageContent.svelte | 8 +- src/pages/viewer/Footer.svelte | 42 +- src/pages/viewer/Header.svelte | 88 ++-- src/pages/viewer/InternalPage.svelte | 240 +++++----- src/pages/viewer/ModifyImage.svelte | 12 +- src/pages/viewer/NoteBody.svelte | 32 +- src/pages/viewer/Page.svelte | 6 +- src/pages/viewer/PageNoteInsert.svelte | 88 ++-- src/pages/viewer/SearchResults.svelte | 82 ++-- src/pages/viewer/SelectableWord.svelte | 78 ++-- src/pages/viewer/Sidebar.svelte | 160 +++---- src/pages/viewer/SidebarAction.svelte | 10 +- src/pages/viewer/SimpleBody.svelte | 30 +- src/pages/viewer/TableOfContents.svelte | 12 +- src/pages/viewer/ThumbnailBody.svelte | 142 +++--- src/pages/viewer/controls/FullScreen.svelte | 24 +- src/pages/viewer/controls/Hamburger.svelte | 14 +- src/pages/viewer/controls/Paginator.svelte | 86 ++-- src/pages/viewer/controls/Search.svelte | 72 +-- src/pages/viewer/controls/Zoom.svelte | 56 +-- src/pages/viewer/pane/ActionPane.svelte | 60 +-- src/pages/viewer/pane/ModifyPane.svelte | 66 +-- src/pages/viewer/pane/SearchPane.svelte | 12 +- src/premium-credits/CreditMeter.svelte | 40 +- src/premium-credits/Price.svelte | 10 +- src/premium-credits/UpgradePrompt.svelte | 24 +- src/router/Link.svelte | 36 +- src/style/fonts.scss | 93 ++-- src/style/variables.css | 2 +- src/viewer/modification/Modification.svelte | 8 +- src/viewer/modification/modifySpec.test.js | 26 +- 183 files changed, 5039 insertions(+), 5002 deletions(-) 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"; - -
  • @@ -110,3 +73,40 @@ {/each}
+ + 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 @@ }; - -