@next-core/brick-kit 2.103.0 → 2.103.4
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.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createBrowserHistory, locationsAreEqual, createPath } from 'history';
|
|
1
|
+
import { parsePath, createBrowserHistory, locationsAreEqual, createPath } from 'history';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
|
|
@@ -3110,12 +3110,12 @@ function standaloneHistoryOverridden(browserHistory) {
|
|
|
3110
3110
|
var pathIsString = typeof path === "string";
|
|
3111
3111
|
|
|
3112
3112
|
if (pathIsString) {
|
|
3113
|
-
pathname = path;
|
|
3113
|
+
pathname = parsePath(path).pathname;
|
|
3114
3114
|
} else {
|
|
3115
3115
|
pathname = path.pathname;
|
|
3116
3116
|
}
|
|
3117
3117
|
|
|
3118
|
-
if (_internalApiHasMatchedApp(pathname)) {
|
|
3118
|
+
if (pathname === "" || _internalApiHasMatchedApp(pathname)) {
|
|
3119
3119
|
return (method === "push" ? originalPush : originalReplace)(path, state);
|
|
3120
3120
|
} // Going to outside apps.
|
|
3121
3121
|
|
|
@@ -7053,7 +7053,7 @@ presetPalettes.magenta;
|
|
|
7053
7053
|
presetPalettes.grey;
|
|
7054
7054
|
|
|
7055
7055
|
function getStyleByBaseColors(theme, baseColors, backgroundColor) {
|
|
7056
|
-
return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor)));
|
|
7056
|
+
return (theme === "dark" ? getDarkStyle : getLightStyle)("".concat(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor)), "\n").concat(getMigratedCssVariableDefinitions(theme, baseColors, backgroundColor)));
|
|
7057
7057
|
}
|
|
7058
7058
|
function getStyleByBrandColor(theme, brandColor) {
|
|
7059
7059
|
return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByBrand(brandColor));
|
|
@@ -7117,6 +7117,33 @@ function ensureBaseColorName(name) {
|
|
|
7117
7117
|
}
|
|
7118
7118
|
}
|
|
7119
7119
|
|
|
7120
|
+
function getMigratedCssVariableDefinitions(theme, baseColors, backgroundColor) {
|
|
7121
|
+
var migrateMap = {
|
|
7122
|
+
green: "green",
|
|
7123
|
+
red: "red",
|
|
7124
|
+
blue: "blue",
|
|
7125
|
+
orange: "orange",
|
|
7126
|
+
cyan: "cyan",
|
|
7127
|
+
purple: "purple",
|
|
7128
|
+
geekblue: "indigo"
|
|
7129
|
+
};
|
|
7130
|
+
return Object.entries(migrateMap).flatMap(_ref4 => {
|
|
7131
|
+
var [legacyColorName, newColorName] = _ref4;
|
|
7132
|
+
return [" --theme-".concat(legacyColorName, "-color-rgb-channel: ").concat(getRgbChannel(getActualBaseColor(baseColors[newColorName], theme, backgroundColor)), ";"), ...(theme === "dark" ? [] : [" --theme-".concat(legacyColorName, "-color: var(--palette-").concat(newColorName, "-6);"), " --theme-".concat(legacyColorName, "-border-color: var(--palette-").concat(newColorName, "-3);")]), " --theme-".concat(legacyColorName, "-background: var(--palette-").concat(newColorName, "-").concat(theme === "dark" ? 2 : 1, ");"), ""];
|
|
7133
|
+
}).join("\n");
|
|
7134
|
+
}
|
|
7135
|
+
|
|
7136
|
+
function getRgbChannel(color) {
|
|
7137
|
+
return color.match(/[0-9a-fA-F]{2}/g).map(hex => parseInt(hex, 16)).join(", ");
|
|
7138
|
+
}
|
|
7139
|
+
|
|
7140
|
+
function getActualBaseColor(baseColor, theme, backgroundColor) {
|
|
7141
|
+
return theme === "dark" ? generate(baseColor, {
|
|
7142
|
+
theme,
|
|
7143
|
+
backgroundColor
|
|
7144
|
+
})[5] : baseColor;
|
|
7145
|
+
}
|
|
7146
|
+
|
|
7120
7147
|
function applyColorTheme(options) {
|
|
7121
7148
|
var style = [];
|
|
7122
7149
|
var themes = ["light", "dark"];
|