@trops/dash-core 0.1.166 → 0.1.167

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.
@@ -45862,6 +45862,104 @@ const extractionCacheController$1 = { get, has, clear, invalidate, stats };
45862
45862
 
45863
45863
  var extractionCacheController_1 = extractionCacheController$1;
45864
45864
 
45865
+ /**
45866
+ * themeFromUrlErrors.js
45867
+ *
45868
+ * Typed error classes for the Theme from URL extraction pipeline.
45869
+ * Used across dash-core (controller), dash-electron (IPC handler),
45870
+ * and dash-react (UI error mapping).
45871
+ */
45872
+
45873
+ const ERROR_TYPES = {
45874
+ URL_UNREACHABLE: "URL_UNREACHABLE",
45875
+ URL_TIMEOUT: "URL_TIMEOUT",
45876
+ EXTRACTION_FAILED: "EXTRACTION_FAILED",
45877
+ NO_COLORS_FOUND: "NO_COLORS_FOUND",
45878
+ FAVICON_FETCH_FAILED: "FAVICON_FETCH_FAILED",
45879
+ };
45880
+
45881
+ class ThemeExtractionError extends Error {
45882
+ /**
45883
+ * @param {string} message - Developer-facing error message
45884
+ * @param {Object} options
45885
+ * @param {string} options.type - Machine-readable error type (from ERROR_TYPES)
45886
+ * @param {string} options.userMessage - User-facing message for UI display
45887
+ * @param {Error} [options.cause] - Original error that triggered this one
45888
+ */
45889
+ constructor(message, { type, userMessage, cause } = {}) {
45890
+ super(message);
45891
+ this.name = "ThemeExtractionError";
45892
+ this.type = type;
45893
+ this.userMessage = userMessage || "Something went wrong extracting colors.";
45894
+ this.cause = cause || null;
45895
+ }
45896
+ }
45897
+
45898
+ class UrlUnreachableError extends ThemeExtractionError {
45899
+ constructor(message, { cause } = {}) {
45900
+ super(message || "URL is unreachable", {
45901
+ type: ERROR_TYPES.URL_UNREACHABLE,
45902
+ userMessage: "Couldn't reach that URL. Check the address.",
45903
+ cause,
45904
+ });
45905
+ this.name = "UrlUnreachableError";
45906
+ }
45907
+ }
45908
+
45909
+ class UrlTimeoutError extends ThemeExtractionError {
45910
+ constructor(message, { cause } = {}) {
45911
+ super(message || "URL load timed out", {
45912
+ type: ERROR_TYPES.URL_TIMEOUT,
45913
+ userMessage: "The site took too long to load. Try a simpler page.",
45914
+ cause,
45915
+ });
45916
+ this.name = "UrlTimeoutError";
45917
+ }
45918
+ }
45919
+
45920
+ class ExtractionFailedError extends ThemeExtractionError {
45921
+ constructor(message, { cause } = {}) {
45922
+ super(message || "Color extraction failed", {
45923
+ type: ERROR_TYPES.EXTRACTION_FAILED,
45924
+ userMessage: "Failed to extract colors from this site.",
45925
+ cause,
45926
+ });
45927
+ this.name = "ExtractionFailedError";
45928
+ }
45929
+ }
45930
+
45931
+ class NoColorsFoundError extends ThemeExtractionError {
45932
+ constructor(message, { cause } = {}) {
45933
+ super(message || "No usable colors found", {
45934
+ type: ERROR_TYPES.NO_COLORS_FOUND,
45935
+ userMessage: "No usable colors found. Try a more styled page.",
45936
+ cause,
45937
+ });
45938
+ this.name = "NoColorsFoundError";
45939
+ }
45940
+ }
45941
+
45942
+ class FaviconFetchError extends ThemeExtractionError {
45943
+ constructor(message, { cause } = {}) {
45944
+ super(message || "Favicon fetch failed", {
45945
+ type: ERROR_TYPES.FAVICON_FETCH_FAILED,
45946
+ userMessage: "Couldn't fetch the site's favicon.",
45947
+ cause,
45948
+ });
45949
+ this.name = "FaviconFetchError";
45950
+ }
45951
+ }
45952
+
45953
+ var themeFromUrlErrors$1 = {
45954
+ ERROR_TYPES,
45955
+ ThemeExtractionError,
45956
+ UrlUnreachableError,
45957
+ UrlTimeoutError,
45958
+ ExtractionFailedError,
45959
+ NoColorsFoundError,
45960
+ FaviconFetchError,
45961
+ };
45962
+
45865
45963
  /**
45866
45964
  * clientFactories.js
45867
45965
  *
@@ -48615,6 +48713,9 @@ const paletteToThemeMapper = paletteToThemeMapper_1;
48615
48713
  const webSocketController = webSocketController_1;
48616
48714
  const extractionCacheController = extractionCacheController_1;
48617
48715
 
48716
+ // --- Errors ---
48717
+ const themeFromUrlErrors = themeFromUrlErrors$1;
48718
+
48618
48719
  // --- Utils ---
48619
48720
  const clientCache = requireClientCache();
48620
48721
  // auto-register built-in factories
@@ -48736,6 +48837,9 @@ var electron = {
48736
48837
  clientCache,
48737
48838
  responseCache,
48738
48839
 
48840
+ // Errors
48841
+ themeFromUrlErrors,
48842
+
48739
48843
  // Schema
48740
48844
  dashboardConfigValidator,
48741
48845
  dashboardConfigUtils,