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

PEMDAS (and making DocumentThumbnail stateless) #415

Merged
merged 4 commits into from
Jan 26, 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
1,154 changes: 617 additions & 537 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
},
"devDependencies": {
"@playwright/test": "^1.39.0",
"@storybook/addon-essentials": "^7.6.4",
"@storybook/addon-interactions": "^7.6.4",
"@storybook/addon-links": "^7.6.4",
"@storybook/addon-svelte-csf": "^4.0.13",
"@storybook/blocks": "^7.6.4",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-svelte-csf": "^4.1.0",
"@storybook/blocks": "^7.6.10",
"@storybook/jest": "^0.2.3",
"@storybook/svelte": "^7.6.4",
"@storybook/svelte-webpack5": "^7.6.4",
"@storybook/svelte": "^7.6.10",
"@storybook/svelte-webpack5": "^7.6.10",
"@storybook/testing-library": "^0.2.2",
"@types/lucene": "^2.1.7",
"chromatic": "^9.1.0",
Expand All @@ -79,7 +79,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"serve": "^14.2.0",
"storybook": "7.6.4",
"storybook": "7.6.10",
"storybook-mock-date-decorator": "^1.0.1",
"svelte-jester": "^3.0.0",
"tape": "^5.7.2",
Expand Down
11 changes: 7 additions & 4 deletions src/common/Loader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
z-index: var(--spinnerZ, 8);
opacity: 0;
}

.spinner.big {
border: var(--bigBordersize, 7px) solid transparent;
border-top: var(--bigBordersize, 7px) solid var(--gray, rgba(0, 0, 0, 0.53));
Expand All @@ -95,16 +96,18 @@

.spinner.center {
top: calc(
50% - var(--smallSpinsize, 10px) / 2 + var(--smallBordersize, 4px)
50% - (var(--smallSpinsize, 10px) / 2 + var(--smallBordersize, 4px))
);
left: calc(
50% - var(--smallSpinsize, 10px) / 2 + var(--smallBordersize, 4px)
50% - (var(--smallSpinsize, 10px) / 2 + var(--smallBordersize, 4px))
);
}

.spinner.center.big {
top: calc(50% - var(--bigSpinsize, 17px) / 2 + var(--bigBordersize, 7px));
left: calc(50% - var(--bigSpinsize, 17px) / 2 + var(--bigBordersize, 7px));
top: calc(50% - (var(--bigSpinsize, 17px) / 2 + var(--bigBordersize, 7px)));
left: calc(
50% - (var(--bigSpinsize, 17px) / 2 + var(--bigBordersize, 7px))
);
}

.loader .spinner {
Expand Down
60 changes: 60 additions & 0 deletions src/common/stories/Loader.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<script context="module">
import { Story, Template } from "@storybook/addon-svelte-csf";
import Loader from "../Loader.svelte";

const args = {
active: true,
};

export const meta = {
title: "Common / Loader",
component: Loader,
tags: ["autodocs"],
parameters: {
layout: "centered",
},
};

/*
export const Active: Story = { args };
export const Centered: Story = { args: { ...args, center: true } };
export const Big: Story = { args: { ...args, big: true } };
export const Inline: Story = { args: { ...args, inline: true } };
export const Transparent: Story = { args: { ...args, transparent: true } };
export const Padded: Story = { args: { ...args, pad: true } };
*/
</script>

<Template let:args>
<div class="container">

Check warning on line 29 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
<Loader {...args}>
<p>Loaded content</p>

Check warning on line 31 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
</Loader>

Check warning on line 32 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
</div>
</Template>

<Story name="default" {args} />

Check warning on line 36 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

<Story name="centered" args={{ ...args, centered: true }} />

<Story name="big" args={{ ...args, big: true }}></Story>

Check warning on line 40 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

Check warning on line 41 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
<Story name="inline" args={{ ...args, inline: true }}></Story>

Check warning on line 42 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 43 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
<Story name="transparent" args={{ ...args, transparent: true }}></Story>

Check warning on line 44 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

<Story name="padded" args={{ ...args, padded: true }}></Story>

Check warning on line 46 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function

Check warning on line 47 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
<style>
.container {
border: 1px solid gray;

Check warning on line 50 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🕹️ Function is not covered

Warning! Not covered function
height: 120px;
width: 80px;

Check warning on line 52 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
}

Check warning on line 53 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 53 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

.container p {

Check warning on line 55 in src/common/stories/Loader.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
margin: 50% auto;
position: relative;
text-align: center;
}
</style>
50 changes: 0 additions & 50 deletions src/common/stories/Loader.stories.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/pages/FlatPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,22 @@
document.documentElement.style.scrollBehavior = "auto";
});
</script>

<svelte:head>
<title>{title} | DocumentCloud</title>
</svelte:head>

<div class="page">
<header>
<div class="logo">
{#if inIframe()}
<a href={APP_URL} target="_blank" rel="noreferrer noopener"
>{@html mastLogoSvg}</a
>
{:else}
<Link to="app">
<a href={APP_URL}>

Check warning on line 185 in src/pages/FlatPage.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
{@html mastLogoSvg}
</Link>
</a>

Check warning on line 187 in src/pages/FlatPage.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
{/if}
</div>
</header>
Expand Down
Loading
Loading