@depict-ai/portal-components 2.8.1 → 2.8.3

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/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { SearchFilter } from "@depict-ai/types/api/SearchResponse";
4
4
  import { Locale } from "@depict-ai/react-ui/locales/latest";
5
5
  import { ReactNode } from "react";
6
6
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
7
- export const version = "2.8.1";
7
+ export const version = "2.8.3";
8
8
  type TextOptions = {
9
9
  /** Enabled */
10
10
  enabled: boolean;
package/dist/main.js CHANGED
@@ -20,7 +20,7 @@ $parcel$export(module.exports, "ExpandingSection", () => $2214dc111b9e2866$expor
20
20
  $parcel$export(module.exports, "ReactLookCard", () => $35bab9ff48bfe404$export$48787da2a5568bc);
21
21
  $parcel$export(module.exports, "version", () => $0a017be3a74fcc94$export$83d89fbfd8236492);
22
22
  /*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
23
- const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.8.1";
23
+ const $0a017be3a74fcc94$export$83d89fbfd8236492 = "2.8.3";
24
24
 
25
25
 
26
26
 
@@ -960,7 +960,6 @@ function $3375ddd88f77967d$var$Video(props) {
960
960
  return _el$20;
961
961
  })();
962
962
  }
963
- // ChatGPT written
964
963
  function $3375ddd88f77967d$var$sortVideoUrlsByQuality(urls) {
965
964
  // Function to extract resolution from a URL, assuming format consistency
966
965
  function getResolution(url) {
@@ -1062,14 +1061,13 @@ function $3375ddd88f77967d$var$isLightColor(anyCssColor) {
1062
1061
  const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709, apparently between 0 and 255
1063
1062
  return luma > 200;
1064
1063
  }
1065
- // Mostly written by chatGPT
1066
1064
  function $3375ddd88f77967d$var$sortSizes(sizesToSort) {
1067
1065
  const sizeEntries = sizesToSort.map((size)=>{
1068
1066
  const numericMatch = size.match(/^(\d+)(?:\/\d+)?$/);
1069
1067
  if (numericMatch) // It's a numeric size or a range like "44/46", we sort by the first number.
1070
1068
  return {
1071
1069
  size: size,
1072
- numericValue: parseInt(numericMatch[1], 10)
1070
+ numericValue_: parseInt(numericMatch[1], 10)
1073
1071
  };
1074
1072
  return {
1075
1073
  size: size
@@ -1081,9 +1079,9 @@ function $3375ddd88f77967d$var$sortSizes(sizesToSort) {
1081
1079
  // Both sizes are in the predefined list
1082
1080
  if (indexA !== -1 && indexB !== -1) return indexA - indexB;
1083
1081
  // Handle numeric and mixed sorting
1084
- if (a.numericValue != null && b.numericValue != null) return a.numericValue - b.numericValue;
1085
- if (a.numericValue != null && indexB === -1) return -1; // numeric values come before unknown text
1086
- if (b.numericValue != null && indexA === -1) return 1; // numeric values come before unknown text
1082
+ if (a.numericValue_ != null && b.numericValue_ != null) return a.numericValue_ - b.numericValue_;
1083
+ if (a.numericValue_ != null && indexB === -1) return -1; // numeric values come before unknown text
1084
+ if (b.numericValue_ != null && indexA === -1) return 1; // numeric values come before unknown text
1087
1085
  // Fallback if both are unrecognized, sort alphabetically
1088
1086
  return a.size.localeCompare(b.size);
1089
1087
  });
package/dist/module.js CHANGED
@@ -7,7 +7,7 @@ import {createContext as $2MCgq$createContext, createMemo as $2MCgq$createMemo,
7
7
  import {createPortal as $2MCgq$createPortal} from "react-dom";
8
8
 
9
9
  /*! Depict.ai portal components */ // This is where the actual source of your React stuff should live
10
- const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.8.1";
10
+ const $91c11b750e80ede3$export$83d89fbfd8236492 = "2.8.3";
11
11
 
12
12
 
13
13
 
@@ -947,7 +947,6 @@ function $29535f590238371c$var$Video(props) {
947
947
  return _el$20;
948
948
  })();
949
949
  }
950
- // ChatGPT written
951
950
  function $29535f590238371c$var$sortVideoUrlsByQuality(urls) {
952
951
  // Function to extract resolution from a URL, assuming format consistency
953
952
  function getResolution(url) {
@@ -1049,14 +1048,13 @@ function $29535f590238371c$var$isLightColor(anyCssColor) {
1049
1048
  const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709, apparently between 0 and 255
1050
1049
  return luma > 200;
1051
1050
  }
1052
- // Mostly written by chatGPT
1053
1051
  function $29535f590238371c$var$sortSizes(sizesToSort) {
1054
1052
  const sizeEntries = sizesToSort.map((size)=>{
1055
1053
  const numericMatch = size.match(/^(\d+)(?:\/\d+)?$/);
1056
1054
  if (numericMatch) // It's a numeric size or a range like "44/46", we sort by the first number.
1057
1055
  return {
1058
1056
  size: size,
1059
- numericValue: parseInt(numericMatch[1], 10)
1057
+ numericValue_: parseInt(numericMatch[1], 10)
1060
1058
  };
1061
1059
  return {
1062
1060
  size: size
@@ -1068,9 +1066,9 @@ function $29535f590238371c$var$sortSizes(sizesToSort) {
1068
1066
  // Both sizes are in the predefined list
1069
1067
  if (indexA !== -1 && indexB !== -1) return indexA - indexB;
1070
1068
  // Handle numeric and mixed sorting
1071
- if (a.numericValue != null && b.numericValue != null) return a.numericValue - b.numericValue;
1072
- if (a.numericValue != null && indexB === -1) return -1; // numeric values come before unknown text
1073
- if (b.numericValue != null && indexA === -1) return 1; // numeric values come before unknown text
1069
+ if (a.numericValue_ != null && b.numericValue_ != null) return a.numericValue_ - b.numericValue_;
1070
+ if (a.numericValue_ != null && indexB === -1) return -1; // numeric values come before unknown text
1071
+ if (b.numericValue_ != null && indexA === -1) return 1; // numeric values come before unknown text
1074
1072
  // Fallback if both are unrecognized, sort alphabetically
1075
1073
  return a.size.localeCompare(b.size);
1076
1074
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/portal-components",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "packageManager": "yarn@3.2.2",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",
@@ -103,9 +103,9 @@
103
103
  "@babel/runtime": "latest",
104
104
  "@babel/runtime-corejs3": "^7.22.6",
105
105
  "@depict-ai/plp-styling": "^4.5.1",
106
- "@depict-ai/react-ui": "^4.9.3",
106
+ "@depict-ai/react-ui": "^4.9.4",
107
107
  "@depict-ai/types": "^5.5.1",
108
- "@depict-ai/ui": "^4.9.1",
108
+ "@depict-ai/ui": "^4.9.2",
109
109
  "@depict-ai/utilishared": "^2.5.1",
110
110
  "parcel": "^2.10.3",
111
111
  "solid-js": "^1.8.16"
@@ -946,7 +946,6 @@ function Video(props: {
946
946
  );
947
947
  }
948
948
 
949
- // ChatGPT written
950
949
  function sortVideoUrlsByQuality(urls: string[]): string[] {
951
950
  // Function to extract resolution from a URL, assuming format consistency
952
951
  function getResolution(url: string): number {
@@ -1039,16 +1038,15 @@ function isLightColor(anyCssColor: string) {
1039
1038
  return luma > 200;
1040
1039
  }
1041
1040
 
1042
- // Mostly written by chatGPT
1043
1041
  function sortSizes(sizesToSort: string[]): string[] {
1044
1042
  const sizeEntries: {
1045
1043
  size: string;
1046
- numericValue?: number;
1044
+ numericValue_?: number;
1047
1045
  }[] = sizesToSort.map(size => {
1048
1046
  const numericMatch = size.match(/^(\d+)(?:\/\d+)?$/);
1049
1047
  if (numericMatch) {
1050
1048
  // It's a numeric size or a range like "44/46", we sort by the first number.
1051
- return { size, numericValue: parseInt(numericMatch[1], 10) };
1049
+ return { size, numericValue_: parseInt(numericMatch[1], 10) };
1052
1050
  }
1053
1051
  return { size };
1054
1052
  });
@@ -1062,13 +1060,13 @@ function sortSizes(sizesToSort: string[]): string[] {
1062
1060
  return indexA - indexB;
1063
1061
  }
1064
1062
  // Handle numeric and mixed sorting
1065
- if (a.numericValue != null && b.numericValue != null) {
1066
- return a.numericValue - b.numericValue;
1063
+ if (a.numericValue_ != null && b.numericValue_ != null) {
1064
+ return a.numericValue_ - b.numericValue_;
1067
1065
  }
1068
- if (a.numericValue != null && indexB === -1) {
1066
+ if (a.numericValue_ != null && indexB === -1) {
1069
1067
  return -1; // numeric values come before unknown text
1070
1068
  }
1071
- if (b.numericValue != null && indexA === -1) {
1069
+ if (b.numericValue_ != null && indexA === -1) {
1072
1070
  return 1; // numeric values come before unknown text
1073
1071
  }
1074
1072
  // Fallback if both are unrecognized, sort alphabetically