@trops/dash-core 0.1.136 → 0.1.138
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/electron/index.js +107 -0
- package/dist/electron/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -8667,6 +8667,43 @@ function checkDashboardCompatibility(
|
|
|
8667
8667
|
};
|
|
8668
8668
|
}
|
|
8669
8669
|
|
|
8670
|
+
// Tailwind color family name → representative hex (500 shade)
|
|
8671
|
+
const TAILWIND_COLORS$1 = {
|
|
8672
|
+
slate: "#64748b",
|
|
8673
|
+
gray: "#6b7280",
|
|
8674
|
+
zinc: "#71717a",
|
|
8675
|
+
neutral: "#737373",
|
|
8676
|
+
stone: "#78716c",
|
|
8677
|
+
red: "#ef4444",
|
|
8678
|
+
orange: "#f97316",
|
|
8679
|
+
amber: "#f59e0b",
|
|
8680
|
+
yellow: "#eab308",
|
|
8681
|
+
lime: "#84cc16",
|
|
8682
|
+
green: "#22c55e",
|
|
8683
|
+
emerald: "#10b981",
|
|
8684
|
+
teal: "#14b8a6",
|
|
8685
|
+
cyan: "#06b6d4",
|
|
8686
|
+
sky: "#0ea5e9",
|
|
8687
|
+
blue: "#3b82f6",
|
|
8688
|
+
indigo: "#6366f1",
|
|
8689
|
+
violet: "#8b5cf6",
|
|
8690
|
+
purple: "#a855f7",
|
|
8691
|
+
fuchsia: "#d946ef",
|
|
8692
|
+
pink: "#ec4899",
|
|
8693
|
+
rose: "#f43f5e",
|
|
8694
|
+
};
|
|
8695
|
+
|
|
8696
|
+
/**
|
|
8697
|
+
* Convert a color value to a CSS-usable color.
|
|
8698
|
+
* If it's a Tailwind family name, map to its hex 500 shade.
|
|
8699
|
+
*/
|
|
8700
|
+
function toDisplayColor$1(value) {
|
|
8701
|
+
if (!value) return "";
|
|
8702
|
+
const lower = value.toLowerCase().trim();
|
|
8703
|
+
if (TAILWIND_COLORS$1[lower]) return TAILWIND_COLORS$1[lower];
|
|
8704
|
+
return value;
|
|
8705
|
+
}
|
|
8706
|
+
|
|
8670
8707
|
/**
|
|
8671
8708
|
* Generate a registry manifest from a dashboard config.
|
|
8672
8709
|
* Converts the internal .dashboard.json format into the registry
|
|
@@ -8719,6 +8756,31 @@ function generateRegistryManifest(dashboardConfig, options = {}) {
|
|
|
8719
8756
|
manifest.appOrigin = options.appOrigin || dashboardConfig.appOrigin;
|
|
8720
8757
|
}
|
|
8721
8758
|
|
|
8759
|
+
// Include theme metadata if dashboard bundles a theme
|
|
8760
|
+
if (dashboardConfig.theme) {
|
|
8761
|
+
manifest.theme = {
|
|
8762
|
+
key: dashboardConfig.theme.key || "",
|
|
8763
|
+
name: dashboardConfig.theme.data?.name || dashboardConfig.theme.key || "",
|
|
8764
|
+
};
|
|
8765
|
+
if (dashboardConfig.theme.registryPackage) {
|
|
8766
|
+
manifest.theme.registryPackage = dashboardConfig.theme.registryPackage;
|
|
8767
|
+
}
|
|
8768
|
+
// Extract color values for display (convert Tailwind names to hex)
|
|
8769
|
+
const td = dashboardConfig.theme.data;
|
|
8770
|
+
if (td) {
|
|
8771
|
+
const colors = {};
|
|
8772
|
+
if (td.primary || td.colors?.primary)
|
|
8773
|
+
colors.primary = toDisplayColor$1(td.primary || td.colors.primary);
|
|
8774
|
+
if (td.secondary || td.colors?.secondary)
|
|
8775
|
+
colors.secondary = toDisplayColor$1(td.secondary || td.colors.secondary);
|
|
8776
|
+
if (td.tertiary || td.colors?.tertiary)
|
|
8777
|
+
colors.tertiary = toDisplayColor$1(td.tertiary || td.colors.tertiary);
|
|
8778
|
+
if (Object.keys(colors).length > 0) {
|
|
8779
|
+
manifest.theme.colors = colors;
|
|
8780
|
+
}
|
|
8781
|
+
}
|
|
8782
|
+
}
|
|
8783
|
+
|
|
8722
8784
|
return manifest;
|
|
8723
8785
|
}
|
|
8724
8786
|
|
|
@@ -10777,9 +10839,48 @@ function generateThemeRegistryManifest(themeData, themeKey, options = {}) {
|
|
|
10777
10839
|
};
|
|
10778
10840
|
}
|
|
10779
10841
|
|
|
10842
|
+
// Tailwind color family name → representative hex (500 shade)
|
|
10843
|
+
const TAILWIND_COLORS = {
|
|
10844
|
+
slate: "#64748b",
|
|
10845
|
+
gray: "#6b7280",
|
|
10846
|
+
zinc: "#71717a",
|
|
10847
|
+
neutral: "#737373",
|
|
10848
|
+
stone: "#78716c",
|
|
10849
|
+
red: "#ef4444",
|
|
10850
|
+
orange: "#f97316",
|
|
10851
|
+
amber: "#f59e0b",
|
|
10852
|
+
yellow: "#eab308",
|
|
10853
|
+
lime: "#84cc16",
|
|
10854
|
+
green: "#22c55e",
|
|
10855
|
+
emerald: "#10b981",
|
|
10856
|
+
teal: "#14b8a6",
|
|
10857
|
+
cyan: "#06b6d4",
|
|
10858
|
+
sky: "#0ea5e9",
|
|
10859
|
+
blue: "#3b82f6",
|
|
10860
|
+
indigo: "#6366f1",
|
|
10861
|
+
violet: "#8b5cf6",
|
|
10862
|
+
purple: "#a855f7",
|
|
10863
|
+
fuchsia: "#d946ef",
|
|
10864
|
+
pink: "#ec4899",
|
|
10865
|
+
rose: "#f43f5e",
|
|
10866
|
+
};
|
|
10867
|
+
|
|
10868
|
+
/**
|
|
10869
|
+
* Convert a color value to a CSS-usable color.
|
|
10870
|
+
* If it's a Tailwind family name, map to its hex 500 shade.
|
|
10871
|
+
* If it already looks like a hex/rgb/hsl value, return as-is.
|
|
10872
|
+
*/
|
|
10873
|
+
function toDisplayColor(value) {
|
|
10874
|
+
if (!value) return "";
|
|
10875
|
+
const lower = value.toLowerCase().trim();
|
|
10876
|
+
if (TAILWIND_COLORS[lower]) return TAILWIND_COLORS[lower];
|
|
10877
|
+
return value;
|
|
10878
|
+
}
|
|
10879
|
+
|
|
10780
10880
|
/**
|
|
10781
10881
|
* Extract primary/secondary/tertiary/neutral colors from a theme object.
|
|
10782
10882
|
* Theme objects store colors in various structures; this normalizes them.
|
|
10883
|
+
* Converts Tailwind color family names to hex values for display.
|
|
10783
10884
|
*/
|
|
10784
10885
|
function extractColors(themeData) {
|
|
10785
10886
|
const colors = {
|
|
@@ -10806,6 +10907,12 @@ function extractColors(themeData) {
|
|
|
10806
10907
|
if (themeData.colors.neutral) colors.neutral = themeData.colors.neutral;
|
|
10807
10908
|
}
|
|
10808
10909
|
|
|
10910
|
+
// Convert Tailwind names to hex
|
|
10911
|
+
colors.primary = toDisplayColor(colors.primary);
|
|
10912
|
+
colors.secondary = toDisplayColor(colors.secondary);
|
|
10913
|
+
colors.tertiary = toDisplayColor(colors.tertiary);
|
|
10914
|
+
colors.neutral = toDisplayColor(colors.neutral);
|
|
10915
|
+
|
|
10809
10916
|
return colors;
|
|
10810
10917
|
}
|
|
10811
10918
|
|