@ndla/image-search 11.0.124-alpha.0 → 11.0.126-alpha.0

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/es/ImageMeta.mjs CHANGED
@@ -5,11 +5,9 @@ import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/ImageMeta.tsx
7
7
  const ImageMeta = ({ contentType, fileSize, imageDimensions, locale }) => {
8
- const prettySize = useMemo(() => {
8
+ return /* @__PURE__ */ jsx(Text, { children: `${contentType} - ${useMemo(() => {
9
9
  return humanFileSize(fileSize, locale);
10
- }, [fileSize, locale]);
11
- const dimensions = imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : "";
12
- return /* @__PURE__ */ jsx(Text, { children: `${contentType} - ${prettySize}${dimensions}` });
10
+ }, [fileSize, locale])}${imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : ""}` });
13
11
  };
14
12
 
15
13
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ImageMeta.mjs","names":[],"sources":["../src/ImageMeta.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useMemo } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport type { IImageDimensionsDTO } from \"@ndla/types-backend/image-api\";\nimport { humanFileSize } from \"@ndla/util\";\n\ninterface Props {\n contentType: string;\n fileSize: number;\n imageDimensions?: IImageDimensionsDTO;\n locale: string;\n}\n\nexport const ImageMeta = ({ contentType, fileSize, imageDimensions, locale }: Props) => {\n const prettySize = useMemo(() => {\n return humanFileSize(fileSize, locale);\n }, [fileSize, locale]);\n\n const dimensions = imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : \"\";\n return <Text>{`${contentType} - ${prettySize}${dimensions}`}</Text>;\n};\n"],"mappings":";;;;;;AAoBA,MAAa,aAAa,EAAE,aAAa,UAAU,iBAAiB,aAAoB;CACtF,MAAM,aAAa,cAAc;AAC/B,SAAO,cAAc,UAAU,OAAO;IACrC,CAAC,UAAU,OAAO,CAAC;CAEtB,MAAM,aAAa,kBAAkB,MAAM,gBAAgB,MAAM,GAAG,gBAAgB,OAAO,OAAO;AAClG,QAAO,oBAAC,kBAAM,GAAG,YAAY,KAAK,aAAa,eAAoB"}
1
+ {"version":3,"file":"ImageMeta.mjs","names":[],"sources":["../src/ImageMeta.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useMemo } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport type { IImageDimensionsDTO } from \"@ndla/types-backend/image-api\";\nimport { humanFileSize } from \"@ndla/util\";\n\ninterface Props {\n contentType: string;\n fileSize: number;\n imageDimensions?: IImageDimensionsDTO;\n locale: string;\n}\n\nexport const ImageMeta = ({ contentType, fileSize, imageDimensions, locale }: Props) => {\n const prettySize = useMemo(() => {\n return humanFileSize(fileSize, locale);\n }, [fileSize, locale]);\n\n const dimensions = imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : \"\";\n return <Text>{`${contentType} - ${prettySize}${dimensions}`}</Text>;\n};\n"],"mappings":";;;;;;AAoBA,MAAa,aAAa,EAAE,aAAa,UAAU,iBAAiB,aAAoB;AAMtF,QAAO,oBAAC,kBAAM,GAAG,YAAY,KALV,cAAc;AAC/B,SAAO,cAAc,UAAU,OAAO;IACrC,CAAC,UAAU,OAAO,CAAC,GAEH,kBAAkB,MAAM,gBAAgB,MAAM,GAAG,gBAAgB,OAAO,OAAO,OAC/B"}
package/lib/ImageMeta.js CHANGED
@@ -10,11 +10,9 @@ react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
10
10
 
11
11
  //#region src/ImageMeta.tsx
12
12
  const ImageMeta = ({ contentType, fileSize, imageDimensions, locale }) => {
13
- const prettySize = (0, react.useMemo)(() => {
13
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, { children: `${contentType} - ${(0, react.useMemo)(() => {
14
14
  return (0, __ndla_util.humanFileSize)(fileSize, locale);
15
- }, [fileSize, locale]);
16
- const dimensions = imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : "";
17
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, { children: `${contentType} - ${prettySize}${dimensions}` });
15
+ }, [fileSize, locale])}${imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : ""}` });
18
16
  };
19
17
 
20
18
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ImageMeta.js","names":["Text"],"sources":["../src/ImageMeta.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useMemo } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport type { IImageDimensionsDTO } from \"@ndla/types-backend/image-api\";\nimport { humanFileSize } from \"@ndla/util\";\n\ninterface Props {\n contentType: string;\n fileSize: number;\n imageDimensions?: IImageDimensionsDTO;\n locale: string;\n}\n\nexport const ImageMeta = ({ contentType, fileSize, imageDimensions, locale }: Props) => {\n const prettySize = useMemo(() => {\n return humanFileSize(fileSize, locale);\n }, [fileSize, locale]);\n\n const dimensions = imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : \"\";\n return <Text>{`${contentType} - ${prettySize}${dimensions}`}</Text>;\n};\n"],"mappings":";;;;;;;;;;;AAoBA,MAAa,aAAa,EAAE,aAAa,UAAU,iBAAiB,aAAoB;CACtF,MAAM,sCAA2B;AAC/B,wCAAqB,UAAU,OAAO;IACrC,CAAC,UAAU,OAAO,CAAC;CAEtB,MAAM,aAAa,kBAAkB,MAAM,gBAAgB,MAAM,GAAG,gBAAgB,OAAO,OAAO;AAClG,QAAO,2CAACA,oCAAM,GAAG,YAAY,KAAK,aAAa,eAAoB"}
1
+ {"version":3,"file":"ImageMeta.js","names":["Text"],"sources":["../src/ImageMeta.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useMemo } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport type { IImageDimensionsDTO } from \"@ndla/types-backend/image-api\";\nimport { humanFileSize } from \"@ndla/util\";\n\ninterface Props {\n contentType: string;\n fileSize: number;\n imageDimensions?: IImageDimensionsDTO;\n locale: string;\n}\n\nexport const ImageMeta = ({ contentType, fileSize, imageDimensions, locale }: Props) => {\n const prettySize = useMemo(() => {\n return humanFileSize(fileSize, locale);\n }, [fileSize, locale]);\n\n const dimensions = imageDimensions ? ` - ${imageDimensions.width}x${imageDimensions.height} px` : \"\";\n return <Text>{`${contentType} - ${prettySize}${dimensions}`}</Text>;\n};\n"],"mappings":";;;;;;;;;;;AAoBA,MAAa,aAAa,EAAE,aAAa,UAAU,iBAAiB,aAAoB;AAMtF,QAAO,2CAACA,oCAAM,GAAG,YAAY,8BALI;AAC/B,wCAAqB,UAAU,OAAO;IACrC,CAAC,UAAU,OAAO,CAAC,GAEH,kBAAkB,MAAM,gBAAgB,MAAM,GAAG,gBAAgB,OAAO,OAAO,OAC/B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ndla/image-search",
3
3
  "type": "module",
4
- "version": "11.0.124-alpha.0",
4
+ "version": "11.0.126-alpha.0",
5
5
  "description": "A simple library for searching images from NDLA",
6
6
  "license": "GPL-3.0",
7
7
  "exports": {
@@ -30,14 +30,14 @@
30
30
  "es"
31
31
  ],
32
32
  "dependencies": {
33
- "@ndla/icons": "^8.0.70-alpha.0",
33
+ "@ndla/icons": "^8.0.71-alpha.0",
34
34
  "@ndla/licenses": "^10.0.2-alpha.0",
35
- "@ndla/primitives": "^1.0.106-alpha.0",
36
- "@ndla/styled-system": "^0.0.41",
35
+ "@ndla/primitives": "^1.0.108-alpha.0",
36
+ "@ndla/styled-system": "^0.0.42",
37
37
  "@ndla/util": "^5.0.14-alpha.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@ndla/preset-panda": "^0.0.63",
40
+ "@ndla/preset-panda": "^0.0.64",
41
41
  "@ndla/types-backend": "^1.0.50",
42
42
  "@pandacss/dev": "^1.3.1"
43
43
  },
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "791c43b6a37887e9de7cbc734991ede5b5522656"
51
+ "gitHead": "f1af586f4915ff8e7283214ea6173274d82b8357"
52
52
  }