@trops/dash-core 0.1.567 → 0.1.568
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 +387 -111
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +95 -72
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +94 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28866,11 +28866,6 @@ var WorkspaceModel = function WorkspaceModel(workspaceItem) {
|
|
|
28866
28866
|
return sanitizeWorkspaceObject(workspace);
|
|
28867
28867
|
};
|
|
28868
28868
|
|
|
28869
|
-
/**
|
|
28870
|
-
* ThemeModel
|
|
28871
|
-
*
|
|
28872
|
-
*/
|
|
28873
|
-
|
|
28874
28869
|
/**
|
|
28875
28870
|
* getNextLevel
|
|
28876
28871
|
* Need to generate the levels for tailwind
|
|
@@ -28883,6 +28878,32 @@ function getNextLevel(currentLevel) {
|
|
|
28883
28878
|
function invert(shade) {
|
|
28884
28879
|
return 900 - parseInt(shade, 10);
|
|
28885
28880
|
}
|
|
28881
|
+
|
|
28882
|
+
/**
|
|
28883
|
+
* Build a tailwind class string for the given prefix + type + numeric
|
|
28884
|
+
* shade. Routes to the arbitrary-value syntax (`bg-[var(--type-shade)]`)
|
|
28885
|
+
* when the channel's value is a hex.
|
|
28886
|
+
*
|
|
28887
|
+
* @param {"bg"|"text"|"border"} prefix
|
|
28888
|
+
* @param {string} type channel name (primary | secondary | …)
|
|
28889
|
+
* @param {number} shade tailwind shade (100..950)
|
|
28890
|
+
* @param {string} channelValue either a tailwind color name or a hex
|
|
28891
|
+
* @param {boolean} hover emit a `hover:` variant
|
|
28892
|
+
*/
|
|
28893
|
+
function classFor(prefix, type, shade, channelValue) {
|
|
28894
|
+
var hover = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
28895
|
+
var h = hover ? "hover:" : "";
|
|
28896
|
+
if (DashReact.isHexColor(channelValue)) {
|
|
28897
|
+
return "".concat(h).concat(prefix, "-[var(--").concat(type, "-").concat(shade, ")]");
|
|
28898
|
+
}
|
|
28899
|
+
return "".concat(h).concat(prefix, "-").concat(channelValue, "-").concat(shade);
|
|
28900
|
+
}
|
|
28901
|
+
function gradientFor(direction, type, fromShade, viaShade, toShade, channelValue) {
|
|
28902
|
+
if (DashReact.isHexColor(channelValue)) {
|
|
28903
|
+
return "bg-gradient-to-".concat(direction, " from-[var(--").concat(type, "-").concat(fromShade, ")] via-[var(--").concat(type, "-").concat(viaShade, ")] to-[var(--").concat(type, "-").concat(toShade, ")]");
|
|
28904
|
+
}
|
|
28905
|
+
return "bg-gradient-to-".concat(direction, " from-").concat(channelValue, "-").concat(fromShade, " via-").concat(channelValue, "-").concat(viaShade, " to-").concat(channelValue, "-").concat(toShade);
|
|
28906
|
+
}
|
|
28886
28907
|
var ThemeModel = function ThemeModel() {
|
|
28887
28908
|
var themeItem = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28888
28909
|
try {
|
|
@@ -28934,80 +28955,53 @@ var ThemeModel = function ThemeModel() {
|
|
|
28934
28955
|
// iterate over each color type "primary, secondary, tertiary ..."
|
|
28935
28956
|
// and generate the colors necessary (shades) based on tailwind
|
|
28936
28957
|
DashReact.colorTypes.forEach(function (type) {
|
|
28958
|
+
var channelValue = theme[type];
|
|
28937
28959
|
Object.keys(variants).forEach(function (variant) {
|
|
28938
28960
|
if (variant in theme === false) {
|
|
28939
28961
|
theme[variant] = {};
|
|
28940
28962
|
}
|
|
28941
28963
|
Object.keys(variants[variant]).forEach(function (shade) {
|
|
28942
|
-
|
|
28943
|
-
|
|
28944
|
-
|
|
28945
|
-
theme[variant]["
|
|
28964
|
+
var numShade = variants[variant][shade];
|
|
28965
|
+
var hoverShade = getNextLevel(numShade);
|
|
28966
|
+
var textShade = invert(numShade);
|
|
28967
|
+
theme[variant]["bg-".concat(type, "-").concat(shade)] = classFor("bg", type, numShade, channelValue);
|
|
28968
|
+
theme[variant]["hover-bg-".concat(type, "-").concat(shade)] = classFor("bg", type, hoverShade, channelValue, true);
|
|
28969
|
+
theme[variant]["hover-border-".concat(type, "-").concat(shade)] = classFor("border", type, hoverShade, channelValue, true);
|
|
28970
|
+
theme[variant]["border-".concat(type, "-").concat(shade)] = classFor("border", type, numShade, channelValue);
|
|
28946
28971
|
// we should be "flipping" these so dark text on light and light on dark...
|
|
28947
|
-
theme[variant]["text-".concat(type, "-").concat(shade)] = "text
|
|
28948
|
-
theme[variant]["hover-text-".concat(type, "-").concat(shade)] = "
|
|
28972
|
+
theme[variant]["text-".concat(type, "-").concat(shade)] = classFor("text", type, textShade, channelValue);
|
|
28973
|
+
theme[variant]["hover-text-".concat(type, "-").concat(shade)] = classFor("text", type, textShade, channelValue, true);
|
|
28949
28974
|
});
|
|
28950
28975
|
});
|
|
28951
28976
|
});
|
|
28952
28977
|
|
|
28953
|
-
//
|
|
28954
|
-
|
|
28955
|
-
//
|
|
28956
|
-
|
|
28957
|
-
|
|
28958
|
-
|
|
28959
|
-
|
|
28960
|
-
|
|
28961
|
-
|
|
28962
|
-
|
|
28963
|
-
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
28967
|
-
|
|
28968
|
-
|
|
28969
|
-
|
|
28970
|
-
|
|
28971
|
-
|
|
28972
|
-
|
|
28973
|
-
|
|
28974
|
-
|
|
28975
|
-
|
|
28976
|
-
|
|
28977
|
-
|
|
28978
|
-
|
|
28979
|
-
|
|
28980
|
-
theme["dark"]["bg-secondary-gradient-left"] = "bg-gradient-to-l from-".concat(theme.secondary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["dark"]["dark"]);
|
|
28981
|
-
theme["dark"]["bg-secondary-gradient-top"] = "bg-gradient-to-t from-".concat(theme.secondary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["dark"]["dark"]);
|
|
28982
|
-
theme["dark"]["bg-secondary-gradient-top-right"] = "bg-gradient-to-tr from-".concat(theme.secondary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["dark"]["dark"]);
|
|
28983
|
-
theme["dark"]["bg-secondary-gradient-top-left"] = "bg-gradient-to-tl from-".concat(theme.secondary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["dark"]["dark"]);
|
|
28984
|
-
theme["light"]["bg-secondary-gradient-right"] = "bg-gradient-to-r from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28985
|
-
theme["light"]["bg-secondary-gradient-bottom"] = "bg-gradient-to-b from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28986
|
-
theme["light"]["bg-secondary-gradient-left"] = "bg-gradient-to-l from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28987
|
-
theme["light"]["bg-secondary-gradient-top"] = "bg-gradient-to-t from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28988
|
-
theme["light"]["bg-secondary-gradient-top-right"] = "bg-gradient-to-tr from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28989
|
-
theme["light"]["bg-secondary-gradient-bottom-right"] = "bg-gradient-to-br from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28990
|
-
theme["light"]["bg-secondary-gradient-top-left"] = "bg-gradient-to-tl from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28991
|
-
theme["light"]["bg-secondary-gradient-bottom-left"] = "bg-gradient-to-bl from-".concat(theme.secondary, "-").concat(variants["light"]["medium"], " via-").concat(theme.secondary, "-").concat(variants["light"]["medium"], " to-").concat(theme.secondary, "-").concat(variants["light"]["dark"]);
|
|
28992
|
-
|
|
28993
|
-
// Tertiary
|
|
28994
|
-
|
|
28995
|
-
theme["dark"]["bg-tertiary-gradient-right"] = "bg-gradient-to-r from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
28996
|
-
theme["dark"]["bg-tertiary-gradient-bottom"] = "bg-gradient-to-b from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
28997
|
-
theme["dark"]["bg-tertiary-gradient-bottom-right"] = "bg-gradient-to-br from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
28998
|
-
theme["dark"]["bg-tertiary-gradient-bottom-left"] = "bg-gradient-to-bl from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
28999
|
-
theme["dark"]["bg-tertiary-gradient-left"] = "bg-gradient-to-l from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
29000
|
-
theme["dark"]["bg-tertiary-gradient-top"] = "bg-gradient-to-t from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
29001
|
-
theme["dark"]["bg-tertiary-gradient-top-right"] = "bg-gradient-to-tr from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
29002
|
-
theme["dark"]["bg-tertiary-gradient-top-left"] = "bg-gradient-to-tl from-".concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["dark"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["dark"]["dark"]);
|
|
29003
|
-
theme["light"]["bg-tertiary-gradient-right"] = "bg-gradient-to-r from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29004
|
-
theme["light"]["bg-tertiary-gradient-bottom"] = "bg-gradient-to-b from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29005
|
-
theme["light"]["bg-tertiary-gradient-left"] = "bg-gradient-to-l from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29006
|
-
theme["light"]["bg-tertiary-gradient-top"] = "bg-gradient-to-t from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29007
|
-
theme["light"]["bg-tertiary-gradient-top-right"] = "bg-gradient-to-tr from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29008
|
-
theme["light"]["bg-tertiary-gradient-bottom-right"] = "bg-gradient-to-br from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29009
|
-
theme["light"]["bg-tertiary-gradient-top-left"] = "bg-gradient-to-tl from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
29010
|
-
theme["light"]["bg-tertiary-gradient-bottom-left"] = "bg-gradient-to-bl from-".concat(theme.tertiary, "-").concat(variants["light"]["medium"], " via-").concat(theme.tertiary, "-").concat(variants["light"]["medium"], " to-").concat(theme.tertiary, "-").concat(variants["light"]["dark"]);
|
|
28978
|
+
// Gradients — primary/secondary/tertiary, 8 directions × 2 variants.
|
|
28979
|
+
// Each gradient goes from the variant's medium shade via medium to dark.
|
|
28980
|
+
// For hex channels, the gradient stops use `from-[var(--type-shade)]` etc.
|
|
28981
|
+
var gradientDirs = {
|
|
28982
|
+
right: "r",
|
|
28983
|
+
bottom: "b",
|
|
28984
|
+
"bottom-right": "br",
|
|
28985
|
+
"bottom-left": "bl",
|
|
28986
|
+
left: "l",
|
|
28987
|
+
top: "t",
|
|
28988
|
+
"top-right": "tr",
|
|
28989
|
+
"top-left": "tl"
|
|
28990
|
+
};
|
|
28991
|
+
["primary", "secondary", "tertiary"].forEach(function (type) {
|
|
28992
|
+
var channelValue = theme[type];
|
|
28993
|
+
Object.keys(variants).forEach(function (variant) {
|
|
28994
|
+
var fromShade = variants[variant]["medium"];
|
|
28995
|
+
var viaShade = variants[variant]["medium"];
|
|
28996
|
+
var toShade = variants[variant]["dark"];
|
|
28997
|
+
Object.entries(gradientDirs).forEach(function (_ref) {
|
|
28998
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
28999
|
+
suffix = _ref2[0],
|
|
29000
|
+
dirCode = _ref2[1];
|
|
29001
|
+
theme[variant]["bg-".concat(type, "-gradient-").concat(suffix)] = gradientFor(dirCode, type, fromShade, viaShade, toShade, channelValue);
|
|
29002
|
+
});
|
|
29003
|
+
});
|
|
29004
|
+
});
|
|
29011
29005
|
|
|
29012
29006
|
// now for the overrides!
|
|
29013
29007
|
if (overrideDark !== null) {
|
|
@@ -29041,9 +29035,38 @@ var ThemeModel = function ThemeModel() {
|
|
|
29041
29035
|
// Added outside the variant loop to avoid generating invalid text/border
|
|
29042
29036
|
// classes (invert(950) would be negative).
|
|
29043
29037
|
DashReact.colorTypes.forEach(function (type) {
|
|
29044
|
-
|
|
29045
|
-
theme["
|
|
29038
|
+
var channelValue = theme[type];
|
|
29039
|
+
theme["dark"]["bg-".concat(type, "-darkest")] = classFor("bg", type, 950, channelValue);
|
|
29040
|
+
theme["light"]["bg-".concat(type, "-darkest")] = classFor("bg", type, 50, channelValue);
|
|
29041
|
+
});
|
|
29042
|
+
|
|
29043
|
+
// Accumulate CSS custom properties for any hex-color channels.
|
|
29044
|
+
// ThemePreviewProvider reads `currentTheme.cssVars` and writes
|
|
29045
|
+
// these to `document.documentElement.style` on theme activation
|
|
29046
|
+
// (PRD `arbitrary-color-themes.md` FR-003).
|
|
29047
|
+
var cssVarsAll = {};
|
|
29048
|
+
var hasAnyHex = false;
|
|
29049
|
+
DashReact.colorTypes.forEach(function (type) {
|
|
29050
|
+
var channelValue = theme[type];
|
|
29051
|
+
if (DashReact.isHexColor(channelValue)) {
|
|
29052
|
+
hasAnyHex = true;
|
|
29053
|
+
var shades = DashReact.deriveShades(channelValue);
|
|
29054
|
+
if (shades) {
|
|
29055
|
+
for (var _i = 0, _Object$entries = Object.entries(shades); _i < _Object$entries.length; _i++) {
|
|
29056
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
29057
|
+
shade = _Object$entries$_i[0],
|
|
29058
|
+
hex = _Object$entries$_i[1];
|
|
29059
|
+
cssVarsAll["--".concat(type, "-").concat(shade)] = hex;
|
|
29060
|
+
}
|
|
29061
|
+
}
|
|
29062
|
+
}
|
|
29046
29063
|
});
|
|
29064
|
+
if (hasAnyHex) {
|
|
29065
|
+
// Attach to both variants so whichever is active on theme switch
|
|
29066
|
+
// delivers the same CSS variable set to :root.
|
|
29067
|
+
theme["dark"].cssVars = cssVarsAll;
|
|
29068
|
+
theme["light"].cssVars = cssVarsAll;
|
|
29069
|
+
}
|
|
29047
29070
|
|
|
29048
29071
|
// transparent colors
|
|
29049
29072
|
theme["dark"]["bg-none"] = "bg-transparent";
|