@phosart/common 0.4.56 → 0.4.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Image.svelte CHANGED
@@ -15,6 +15,7 @@
15
15
  loading?: boolean;
16
16
  transformSrc?: (src: string) => string;
17
17
  nsfw?: boolean;
18
+ lqipFit?: 'cover' | 'contain';
18
19
  }
19
20
 
20
21
  let {
@@ -26,7 +27,8 @@
26
27
  controls = false,
27
28
  nolqip = false,
28
29
  loading = $bindable(true),
29
- transformSrc: userTransformSrc
30
+ transformSrc: userTransformSrc,
31
+ lqipFit = 'contain'
30
32
  }: Props = $props();
31
33
 
32
34
  const config = useLibraryConfig();
@@ -43,7 +45,9 @@
43
45
  let src = $derived(highRes ? onlyHighRes(picture) : no4K(picture));
44
46
 
45
47
  let background = $derived(
46
- !nolqip && src.lqip && showBackground ? `url(${src.lqip.src}) no-repeat center/contain` : 'none'
48
+ !nolqip && src.lqip && showBackground
49
+ ? `url(${src.lqip.src}) no-repeat center/${lqipFit}`
50
+ : 'none'
47
51
  );
48
52
 
49
53
  $effect(() => {
@@ -9,6 +9,7 @@ interface Props {
9
9
  loading?: boolean;
10
10
  transformSrc?: (src: string) => string;
11
11
  nsfw?: boolean;
12
+ lqipFit?: 'cover' | 'contain';
12
13
  }
13
14
  declare const Image: import("svelte").Component<Props, {}, "loading">;
14
15
  type Image = ReturnType<typeof Image>;
@@ -1 +1 @@
1
- {"version":3,"file":"Image.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Image.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,KAAK,IAAI,UAAU,EAAQ,MAAM,eAAe,CAAC;AAO3E,UAAU,KAAK;IACd,OAAO,EAAE,UAAU,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAyHF,QAAA,MAAM,KAAK,kDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Image.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Image.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,KAAK,IAAI,UAAU,EAAQ,MAAM,eAAe,CAAC;AAO3E,UAAU,KAAK;IACd,OAAO,EAAE,UAAU,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B;AA4HF,QAAA,MAAM,KAAK,kDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -186,7 +186,7 @@
186
186
  {/snippet}
187
187
  </ImageView>
188
188
  </div>
189
- {#if piece.alts && piece.alts.length > 0}
189
+ {#if piece.alts && piece.alts.length > 0 && !isComic}
190
190
  <div
191
191
  bind:clientWidth={altWidth}
192
192
  style="background-color: transparent; width:75px; position: relative"
@@ -290,6 +290,9 @@
290
290
  .nav-container.nav-container {
291
291
  width: 0;
292
292
  }
293
+ .main-container.main-container {
294
+ max-width: 90vw;
295
+ }
293
296
  }
294
297
 
295
298
  .image-section {
@@ -331,6 +334,7 @@
331
334
  justify-content: center;
332
335
  align-items: center;
333
336
  overflow: hidden;
337
+ max-width: 80vw;
334
338
  }
335
339
 
336
340
  .bounding-div {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phosart/common",
3
- "version": "0.4.56",
3
+ "version": "0.4.58",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",
@@ -62,7 +62,7 @@
62
62
  "tailwindcss": "^4.1.17",
63
63
  "typescript": "^5.9.3",
64
64
  "typescript-eslint": "^8.48.1",
65
- "vite": "^7.3.2",
65
+ "vite": "^7.3.5",
66
66
  "vitest": "^4.0.15",
67
67
  "vitest-browser-svelte": "^2.0.1"
68
68
  },
@@ -15,6 +15,7 @@
15
15
  loading?: boolean;
16
16
  transformSrc?: (src: string) => string;
17
17
  nsfw?: boolean;
18
+ lqipFit?: 'cover' | 'contain';
18
19
  }
19
20
 
20
21
  let {
@@ -26,7 +27,8 @@
26
27
  controls = false,
27
28
  nolqip = false,
28
29
  loading = $bindable(true),
29
- transformSrc: userTransformSrc
30
+ transformSrc: userTransformSrc,
31
+ lqipFit = 'contain'
30
32
  }: Props = $props();
31
33
 
32
34
  const config = useLibraryConfig();
@@ -43,7 +45,9 @@
43
45
  let src = $derived(highRes ? onlyHighRes(picture) : no4K(picture));
44
46
 
45
47
  let background = $derived(
46
- !nolqip && src.lqip && showBackground ? `url(${src.lqip.src}) no-repeat center/contain` : 'none'
48
+ !nolqip && src.lqip && showBackground
49
+ ? `url(${src.lqip.src}) no-repeat center/${lqipFit}`
50
+ : 'none'
47
51
  );
48
52
 
49
53
  $effect(() => {
@@ -186,7 +186,7 @@
186
186
  {/snippet}
187
187
  </ImageView>
188
188
  </div>
189
- {#if piece.alts && piece.alts.length > 0}
189
+ {#if piece.alts && piece.alts.length > 0 && !isComic}
190
190
  <div
191
191
  bind:clientWidth={altWidth}
192
192
  style="background-color: transparent; width:75px; position: relative"
@@ -290,6 +290,9 @@
290
290
  .nav-container.nav-container {
291
291
  width: 0;
292
292
  }
293
+ .main-container.main-container {
294
+ max-width: 90vw;
295
+ }
293
296
  }
294
297
 
295
298
  .image-section {
@@ -331,6 +334,7 @@
331
334
  justify-content: center;
332
335
  align-items: center;
333
336
  overflow: hidden;
337
+ max-width: 80vw;
334
338
  }
335
339
 
336
340
  .bounding-div {