@trops/dash-core 0.1.566 → 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 +195 -178
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +194 -177
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
2
2
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
4
4
|
import * as DashReact from '@trops/dash-react';
|
|
5
|
-
import { isObject, ThemeContext, Modal, FontAwesomeIcon, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, MenuItem, Tag2, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, CodeEditorInline, Icon2, AlgoliaSearchBox, CommandPalette, useSidebar, Divider, Caption2, Caption, Caption3, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
5
|
+
import { isObject, ThemeContext, Modal, FontAwesomeIcon, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, DragComponent, ConfirmationModal, DropComponent, getStyleName, capitalizeFirstLetter, colorTypes, isHexColor, deriveShades, getCSSStyleForClassname, Panel2, Heading2, SubHeading, Paragraph2, Paragraph3, MenuItem, Tag2, ButtonIcon3, DashPanel, colorNames, shades, themeVariants, Tabs3, DataList, Checkbox, StatCard, Card, Tabs, Accordion, Alert, Toast, ProgressBar, Toggle, Breadcrumbs, Tabs2, Accordion2, Alert2, Toast2, ProgressBar2, Toggle2, Breadcrumbs2, Accordion3, Alert3, Toast3, ProgressBar3, Toggle3, Breadcrumbs3, ThemeFromUrlPane, TextArea, CodeEditorInline, Icon2, AlgoliaSearchBox, CommandPalette, useSidebar, Divider, Caption2, Caption, Caption3, EmptyState, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
|
|
6
6
|
export * from '@trops/dash-react';
|
|
7
7
|
export { ThemeContext } from '@trops/dash-react';
|
|
8
8
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
@@ -28848,11 +28848,6 @@ var WorkspaceModel = function WorkspaceModel(workspaceItem) {
|
|
|
28848
28848
|
return sanitizeWorkspaceObject(workspace);
|
|
28849
28849
|
};
|
|
28850
28850
|
|
|
28851
|
-
/**
|
|
28852
|
-
* ThemeModel
|
|
28853
|
-
*
|
|
28854
|
-
*/
|
|
28855
|
-
|
|
28856
28851
|
/**
|
|
28857
28852
|
* getNextLevel
|
|
28858
28853
|
* Need to generate the levels for tailwind
|
|
@@ -28865,6 +28860,32 @@ function getNextLevel(currentLevel) {
|
|
|
28865
28860
|
function invert(shade) {
|
|
28866
28861
|
return 900 - parseInt(shade, 10);
|
|
28867
28862
|
}
|
|
28863
|
+
|
|
28864
|
+
/**
|
|
28865
|
+
* Build a tailwind class string for the given prefix + type + numeric
|
|
28866
|
+
* shade. Routes to the arbitrary-value syntax (`bg-[var(--type-shade)]`)
|
|
28867
|
+
* when the channel's value is a hex.
|
|
28868
|
+
*
|
|
28869
|
+
* @param {"bg"|"text"|"border"} prefix
|
|
28870
|
+
* @param {string} type channel name (primary | secondary | …)
|
|
28871
|
+
* @param {number} shade tailwind shade (100..950)
|
|
28872
|
+
* @param {string} channelValue either a tailwind color name or a hex
|
|
28873
|
+
* @param {boolean} hover emit a `hover:` variant
|
|
28874
|
+
*/
|
|
28875
|
+
function classFor(prefix, type, shade, channelValue) {
|
|
28876
|
+
var hover = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
28877
|
+
var h = hover ? "hover:" : "";
|
|
28878
|
+
if (isHexColor(channelValue)) {
|
|
28879
|
+
return "".concat(h).concat(prefix, "-[var(--").concat(type, "-").concat(shade, ")]");
|
|
28880
|
+
}
|
|
28881
|
+
return "".concat(h).concat(prefix, "-").concat(channelValue, "-").concat(shade);
|
|
28882
|
+
}
|
|
28883
|
+
function gradientFor(direction, type, fromShade, viaShade, toShade, channelValue) {
|
|
28884
|
+
if (isHexColor(channelValue)) {
|
|
28885
|
+
return "bg-gradient-to-".concat(direction, " from-[var(--").concat(type, "-").concat(fromShade, ")] via-[var(--").concat(type, "-").concat(viaShade, ")] to-[var(--").concat(type, "-").concat(toShade, ")]");
|
|
28886
|
+
}
|
|
28887
|
+
return "bg-gradient-to-".concat(direction, " from-").concat(channelValue, "-").concat(fromShade, " via-").concat(channelValue, "-").concat(viaShade, " to-").concat(channelValue, "-").concat(toShade);
|
|
28888
|
+
}
|
|
28868
28889
|
var ThemeModel = function ThemeModel() {
|
|
28869
28890
|
var themeItem = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28870
28891
|
try {
|
|
@@ -28916,80 +28937,53 @@ var ThemeModel = function ThemeModel() {
|
|
|
28916
28937
|
// iterate over each color type "primary, secondary, tertiary ..."
|
|
28917
28938
|
// and generate the colors necessary (shades) based on tailwind
|
|
28918
28939
|
colorTypes.forEach(function (type) {
|
|
28940
|
+
var channelValue = theme[type];
|
|
28919
28941
|
Object.keys(variants).forEach(function (variant) {
|
|
28920
28942
|
if (variant in theme === false) {
|
|
28921
28943
|
theme[variant] = {};
|
|
28922
28944
|
}
|
|
28923
28945
|
Object.keys(variants[variant]).forEach(function (shade) {
|
|
28924
|
-
|
|
28925
|
-
|
|
28926
|
-
|
|
28927
|
-
theme[variant]["
|
|
28946
|
+
var numShade = variants[variant][shade];
|
|
28947
|
+
var hoverShade = getNextLevel(numShade);
|
|
28948
|
+
var textShade = invert(numShade);
|
|
28949
|
+
theme[variant]["bg-".concat(type, "-").concat(shade)] = classFor("bg", type, numShade, channelValue);
|
|
28950
|
+
theme[variant]["hover-bg-".concat(type, "-").concat(shade)] = classFor("bg", type, hoverShade, channelValue, true);
|
|
28951
|
+
theme[variant]["hover-border-".concat(type, "-").concat(shade)] = classFor("border", type, hoverShade, channelValue, true);
|
|
28952
|
+
theme[variant]["border-".concat(type, "-").concat(shade)] = classFor("border", type, numShade, channelValue);
|
|
28928
28953
|
// we should be "flipping" these so dark text on light and light on dark...
|
|
28929
|
-
theme[variant]["text-".concat(type, "-").concat(shade)] = "text
|
|
28930
|
-
theme[variant]["hover-text-".concat(type, "-").concat(shade)] = "
|
|
28954
|
+
theme[variant]["text-".concat(type, "-").concat(shade)] = classFor("text", type, textShade, channelValue);
|
|
28955
|
+
theme[variant]["hover-text-".concat(type, "-").concat(shade)] = classFor("text", type, textShade, channelValue, true);
|
|
28931
28956
|
});
|
|
28932
28957
|
});
|
|
28933
28958
|
});
|
|
28934
28959
|
|
|
28935
|
-
//
|
|
28936
|
-
|
|
28937
|
-
//
|
|
28938
|
-
|
|
28939
|
-
|
|
28940
|
-
|
|
28941
|
-
|
|
28942
|
-
|
|
28943
|
-
|
|
28944
|
-
|
|
28945
|
-
|
|
28946
|
-
|
|
28947
|
-
|
|
28948
|
-
|
|
28949
|
-
|
|
28950
|
-
|
|
28951
|
-
|
|
28952
|
-
|
|
28953
|
-
|
|
28954
|
-
|
|
28955
|
-
|
|
28956
|
-
|
|
28957
|
-
|
|
28958
|
-
|
|
28959
|
-
|
|
28960
|
-
|
|
28961
|
-
|
|
28962
|
-
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"]);
|
|
28963
|
-
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"]);
|
|
28964
|
-
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"]);
|
|
28965
|
-
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"]);
|
|
28966
|
-
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"]);
|
|
28967
|
-
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"]);
|
|
28968
|
-
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"]);
|
|
28969
|
-
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"]);
|
|
28970
|
-
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"]);
|
|
28971
|
-
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"]);
|
|
28972
|
-
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"]);
|
|
28973
|
-
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"]);
|
|
28974
|
-
|
|
28975
|
-
// Tertiary
|
|
28976
|
-
|
|
28977
|
-
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"]);
|
|
28978
|
-
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"]);
|
|
28979
|
-
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"]);
|
|
28980
|
-
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"]);
|
|
28981
|
-
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"]);
|
|
28982
|
-
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"]);
|
|
28983
|
-
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"]);
|
|
28984
|
-
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"]);
|
|
28985
|
-
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"]);
|
|
28986
|
-
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"]);
|
|
28987
|
-
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"]);
|
|
28988
|
-
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"]);
|
|
28989
|
-
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"]);
|
|
28990
|
-
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"]);
|
|
28991
|
-
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"]);
|
|
28992
|
-
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"]);
|
|
28960
|
+
// Gradients — primary/secondary/tertiary, 8 directions × 2 variants.
|
|
28961
|
+
// Each gradient goes from the variant's medium shade via medium to dark.
|
|
28962
|
+
// For hex channels, the gradient stops use `from-[var(--type-shade)]` etc.
|
|
28963
|
+
var gradientDirs = {
|
|
28964
|
+
right: "r",
|
|
28965
|
+
bottom: "b",
|
|
28966
|
+
"bottom-right": "br",
|
|
28967
|
+
"bottom-left": "bl",
|
|
28968
|
+
left: "l",
|
|
28969
|
+
top: "t",
|
|
28970
|
+
"top-right": "tr",
|
|
28971
|
+
"top-left": "tl"
|
|
28972
|
+
};
|
|
28973
|
+
["primary", "secondary", "tertiary"].forEach(function (type) {
|
|
28974
|
+
var channelValue = theme[type];
|
|
28975
|
+
Object.keys(variants).forEach(function (variant) {
|
|
28976
|
+
var fromShade = variants[variant]["medium"];
|
|
28977
|
+
var viaShade = variants[variant]["medium"];
|
|
28978
|
+
var toShade = variants[variant]["dark"];
|
|
28979
|
+
Object.entries(gradientDirs).forEach(function (_ref) {
|
|
28980
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
28981
|
+
suffix = _ref2[0],
|
|
28982
|
+
dirCode = _ref2[1];
|
|
28983
|
+
theme[variant]["bg-".concat(type, "-gradient-").concat(suffix)] = gradientFor(dirCode, type, fromShade, viaShade, toShade, channelValue);
|
|
28984
|
+
});
|
|
28985
|
+
});
|
|
28986
|
+
});
|
|
28993
28987
|
|
|
28994
28988
|
// now for the overrides!
|
|
28995
28989
|
if (overrideDark !== null) {
|
|
@@ -29023,10 +29017,39 @@ var ThemeModel = function ThemeModel() {
|
|
|
29023
29017
|
// Added outside the variant loop to avoid generating invalid text/border
|
|
29024
29018
|
// classes (invert(950) would be negative).
|
|
29025
29019
|
colorTypes.forEach(function (type) {
|
|
29026
|
-
|
|
29027
|
-
theme["
|
|
29020
|
+
var channelValue = theme[type];
|
|
29021
|
+
theme["dark"]["bg-".concat(type, "-darkest")] = classFor("bg", type, 950, channelValue);
|
|
29022
|
+
theme["light"]["bg-".concat(type, "-darkest")] = classFor("bg", type, 50, channelValue);
|
|
29028
29023
|
});
|
|
29029
29024
|
|
|
29025
|
+
// Accumulate CSS custom properties for any hex-color channels.
|
|
29026
|
+
// ThemePreviewProvider reads `currentTheme.cssVars` and writes
|
|
29027
|
+
// these to `document.documentElement.style` on theme activation
|
|
29028
|
+
// (PRD `arbitrary-color-themes.md` FR-003).
|
|
29029
|
+
var cssVarsAll = {};
|
|
29030
|
+
var hasAnyHex = false;
|
|
29031
|
+
colorTypes.forEach(function (type) {
|
|
29032
|
+
var channelValue = theme[type];
|
|
29033
|
+
if (isHexColor(channelValue)) {
|
|
29034
|
+
hasAnyHex = true;
|
|
29035
|
+
var shades = deriveShades(channelValue);
|
|
29036
|
+
if (shades) {
|
|
29037
|
+
for (var _i = 0, _Object$entries = Object.entries(shades); _i < _Object$entries.length; _i++) {
|
|
29038
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
29039
|
+
shade = _Object$entries$_i[0],
|
|
29040
|
+
hex = _Object$entries$_i[1];
|
|
29041
|
+
cssVarsAll["--".concat(type, "-").concat(shade)] = hex;
|
|
29042
|
+
}
|
|
29043
|
+
}
|
|
29044
|
+
}
|
|
29045
|
+
});
|
|
29046
|
+
if (hasAnyHex) {
|
|
29047
|
+
// Attach to both variants so whichever is active on theme switch
|
|
29048
|
+
// delivers the same CSS variable set to :root.
|
|
29049
|
+
theme["dark"].cssVars = cssVarsAll;
|
|
29050
|
+
theme["light"].cssVars = cssVarsAll;
|
|
29051
|
+
}
|
|
29052
|
+
|
|
29030
29053
|
// transparent colors
|
|
29031
29054
|
theme["dark"]["bg-none"] = "bg-transparent";
|
|
29032
29055
|
theme["dark"]["border-none"] = "border-transparent";
|
|
@@ -59997,10 +60020,7 @@ function ListenersTab(_ref0) {
|
|
|
59997
60020
|
className: "flex flex-col gap-3 h-full min-h-0",
|
|
59998
60021
|
children: /*#__PURE__*/jsxs("div", {
|
|
59999
60022
|
className: "flex flex-row gap-3 flex-1 min-h-0",
|
|
60000
|
-
children: [/*#__PURE__*/jsxs(
|
|
60001
|
-
padding: "",
|
|
60002
|
-
shadow: "",
|
|
60003
|
-
rounded: "rounded-lg",
|
|
60023
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
60004
60024
|
className: "w-56 flex-shrink-0 overflow-hidden flex flex-col",
|
|
60005
60025
|
children: [/*#__PURE__*/jsx("div", {
|
|
60006
60026
|
className: "px-3 py-2 text-xs font-semibold opacity-50 uppercase tracking-wider",
|
|
@@ -60045,10 +60065,7 @@ function ListenersTab(_ref0) {
|
|
|
60045
60065
|
onAdd: onAdd,
|
|
60046
60066
|
onRemove: onRemove
|
|
60047
60067
|
})]
|
|
60048
|
-
}) : /*#__PURE__*/jsx(
|
|
60049
|
-
padding: "",
|
|
60050
|
-
shadow: "",
|
|
60051
|
-
rounded: "rounded-lg",
|
|
60068
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
60052
60069
|
className: "flex-1 min-w-0 flex items-center justify-center text-sm opacity-60",
|
|
60053
60070
|
children: "Pick a widget on the left to wire its handlers."
|
|
60054
60071
|
})]
|
|
@@ -60083,45 +60100,47 @@ function HandlersColumn(_ref10) {
|
|
|
60083
60100
|
}
|
|
60084
60101
|
return m;
|
|
60085
60102
|
}, [myWiring]);
|
|
60086
|
-
return
|
|
60087
|
-
|
|
60088
|
-
|
|
60089
|
-
|
|
60090
|
-
|
|
60091
|
-
|
|
60092
|
-
|
|
60093
|
-
|
|
60094
|
-
|
|
60095
|
-
|
|
60096
|
-
|
|
60097
|
-
|
|
60098
|
-
|
|
60099
|
-
|
|
60100
|
-
|
|
60101
|
-
|
|
60102
|
-
|
|
60103
|
-
|
|
60104
|
-
|
|
60105
|
-
|
|
60106
|
-
|
|
60107
|
-
|
|
60108
|
-
|
|
60109
|
-
|
|
60110
|
-
|
|
60111
|
-
|
|
60112
|
-
|
|
60113
|
-
|
|
60114
|
-
|
|
60115
|
-
|
|
60103
|
+
return (
|
|
60104
|
+
/*#__PURE__*/
|
|
60105
|
+
// Plain <div> wrapper — Card2 reads as washed-out against the
|
|
60106
|
+
// modal's dark chrome. See ListenersTab + ProvidersTab fix.
|
|
60107
|
+
jsxs("div", {
|
|
60108
|
+
className: "w-56 flex-shrink-0 overflow-hidden flex flex-col",
|
|
60109
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
60110
|
+
className: "px-3 py-2 text-xs font-semibold opacity-50 uppercase tracking-wider",
|
|
60111
|
+
children: "Event Handlers"
|
|
60112
|
+
}), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx("div", {
|
|
60113
|
+
className: "overflow-y-auto flex-1",
|
|
60114
|
+
children: receiver.eventHandlers.length === 0 ? /*#__PURE__*/jsx("div", {
|
|
60115
|
+
className: "text-xs opacity-50 text-center py-6 px-3",
|
|
60116
|
+
children: "This widget declares no event handlers."
|
|
60117
|
+
}) : receiver.eventHandlers.map(function (h) {
|
|
60118
|
+
var isActive = h === selectedHandler;
|
|
60119
|
+
var count = countsByHandler.get(h) || 0;
|
|
60120
|
+
return /*#__PURE__*/jsxs("button", {
|
|
60121
|
+
type: "button",
|
|
60122
|
+
onClick: function onClick() {
|
|
60123
|
+
return onSelectHandler(h);
|
|
60124
|
+
},
|
|
60125
|
+
className: "w-full text-left px-3 py-2 text-sm flex items-center justify-between gap-2 border-l-2 ".concat(isActive ? "bg-indigo-900/30 border-indigo-400" : "border-transparent hover:bg-white/5"),
|
|
60126
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
60127
|
+
className: "flex items-center gap-2 min-w-0",
|
|
60128
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
60129
|
+
icon: "bolt",
|
|
60130
|
+
className: "h-3 w-3 opacity-60 flex-shrink-0"
|
|
60131
|
+
}), /*#__PURE__*/jsx("code", {
|
|
60132
|
+
className: "truncate",
|
|
60133
|
+
children: h
|
|
60134
|
+
})]
|
|
60135
|
+
}), /*#__PURE__*/jsx("span", {
|
|
60136
|
+
className: "text-xs opacity-60 flex-shrink-0",
|
|
60137
|
+
children: count
|
|
60116
60138
|
})]
|
|
60117
|
-
}
|
|
60118
|
-
|
|
60119
|
-
|
|
60120
|
-
|
|
60121
|
-
|
|
60122
|
-
})
|
|
60123
|
-
})]
|
|
60124
|
-
});
|
|
60139
|
+
}, h);
|
|
60140
|
+
})
|
|
60141
|
+
})]
|
|
60142
|
+
})
|
|
60143
|
+
);
|
|
60125
60144
|
}
|
|
60126
60145
|
|
|
60127
60146
|
/**
|
|
@@ -60172,10 +60191,7 @@ function EventsColumn(_ref11) {
|
|
|
60172
60191
|
return w.isOrphan;
|
|
60173
60192
|
});
|
|
60174
60193
|
if (!handlerName) {
|
|
60175
|
-
return /*#__PURE__*/jsx(
|
|
60176
|
-
padding: "",
|
|
60177
|
-
shadow: "",
|
|
60178
|
-
rounded: "rounded-lg",
|
|
60194
|
+
return /*#__PURE__*/jsx("div", {
|
|
60179
60195
|
className: "flex-1 min-w-0 flex items-center justify-center text-sm opacity-60",
|
|
60180
60196
|
children: "Select a handler to view available events."
|
|
60181
60197
|
});
|
|
@@ -60204,63 +60220,64 @@ function EventsColumn(_ref11) {
|
|
|
60204
60220
|
var emittersForList = emitters.filter(function (e) {
|
|
60205
60221
|
return !(e.component === receiver.component && String(e.itemId) === String(receiver.itemId));
|
|
60206
60222
|
});
|
|
60207
|
-
return
|
|
60208
|
-
|
|
60209
|
-
|
|
60210
|
-
|
|
60211
|
-
|
|
60212
|
-
|
|
60213
|
-
|
|
60214
|
-
|
|
60215
|
-
|
|
60216
|
-
|
|
60217
|
-
|
|
60218
|
-
|
|
60219
|
-
|
|
60220
|
-
|
|
60221
|
-
|
|
60222
|
-
|
|
60223
|
-
|
|
60224
|
-
|
|
60225
|
-
|
|
60226
|
-
|
|
60227
|
-
|
|
60228
|
-
|
|
60229
|
-
|
|
60230
|
-
|
|
60231
|
-
|
|
60232
|
-
|
|
60233
|
-
|
|
60234
|
-
|
|
60235
|
-
|
|
60236
|
-
|
|
60237
|
-
|
|
60238
|
-
})]
|
|
60239
|
-
}), e.events.map(function (eventName) {
|
|
60240
|
-
var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
|
|
60241
|
-
var selected = wiredKeys.has(key);
|
|
60242
|
-
return /*#__PURE__*/jsxs("label", {
|
|
60243
|
-
className: "flex items-center gap-3 px-3 py-1.5 rounded-md cursor-pointer text-sm ".concat(selected ? "opacity-100" : "opacity-70 hover:opacity-100"),
|
|
60244
|
-
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
60245
|
-
icon: selected ? "square-check" : "square",
|
|
60246
|
-
className: "h-4 w-4 flex-shrink-0",
|
|
60247
|
-
onClick: function onClick(ev) {
|
|
60248
|
-
ev.preventDefault();
|
|
60249
|
-
toggle({
|
|
60250
|
-
sourceComponent: e.component,
|
|
60251
|
-
sourceItemId: e.itemId,
|
|
60252
|
-
eventName: eventName
|
|
60253
|
-
});
|
|
60254
|
-
}
|
|
60255
|
-
}), /*#__PURE__*/jsx("span", {
|
|
60256
|
-
children: eventName
|
|
60223
|
+
return (
|
|
60224
|
+
/*#__PURE__*/
|
|
60225
|
+
// Plain <div> — Card2's washed-out fill clashes with the modal chrome.
|
|
60226
|
+
jsxs("div", {
|
|
60227
|
+
className: "flex-1 min-w-0 overflow-hidden flex flex-col",
|
|
60228
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
60229
|
+
className: "flex-shrink-0 px-4 py-2 text-xs opacity-60",
|
|
60230
|
+
children: ["Check an event to fire ", /*#__PURE__*/jsx("code", {
|
|
60231
|
+
className: "text-xs",
|
|
60232
|
+
children: handlerName
|
|
60233
|
+
}), " on", " ", /*#__PURE__*/jsx("span", {
|
|
60234
|
+
className: "font-medium",
|
|
60235
|
+
children: receiver.label
|
|
60236
|
+
}), "."]
|
|
60237
|
+
}), /*#__PURE__*/jsx(Divider, {}), /*#__PURE__*/jsx("div", {
|
|
60238
|
+
className: "flex-1 overflow-y-auto p-4 space-y-5",
|
|
60239
|
+
children: emittersForList.length === 0 ? /*#__PURE__*/jsx("div", {
|
|
60240
|
+
className: "text-sm opacity-60",
|
|
60241
|
+
children: "No other widgets in this dashboard emit events."
|
|
60242
|
+
}) : emittersForList.map(function (e) {
|
|
60243
|
+
return /*#__PURE__*/jsxs("div", {
|
|
60244
|
+
className: "space-y-1",
|
|
60245
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
60246
|
+
className: "flex flex-col gap-0.5 mb-1",
|
|
60247
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
60248
|
+
className: "text-sm font-semibold",
|
|
60249
|
+
children: e.label
|
|
60250
|
+
}), (e.widgetRef || e.component) && /*#__PURE__*/jsx(Caption, {
|
|
60251
|
+
block: true,
|
|
60252
|
+
className: "font-mono truncate",
|
|
60253
|
+
children: (e.widgetRef || e.component) + (e.itemId != null ? "[".concat(e.itemId, "]") : "")
|
|
60257
60254
|
})]
|
|
60258
|
-
},
|
|
60259
|
-
|
|
60260
|
-
|
|
60261
|
-
|
|
60262
|
-
|
|
60263
|
-
|
|
60255
|
+
}), e.events.map(function (eventName) {
|
|
60256
|
+
var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
|
|
60257
|
+
var selected = wiredKeys.has(key);
|
|
60258
|
+
return /*#__PURE__*/jsxs("label", {
|
|
60259
|
+
className: "flex items-center gap-3 px-3 py-1.5 rounded-md cursor-pointer text-sm ".concat(selected ? "opacity-100" : "opacity-70 hover:opacity-100"),
|
|
60260
|
+
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
60261
|
+
icon: selected ? "square-check" : "square",
|
|
60262
|
+
className: "h-4 w-4 flex-shrink-0",
|
|
60263
|
+
onClick: function onClick(ev) {
|
|
60264
|
+
ev.preventDefault();
|
|
60265
|
+
toggle({
|
|
60266
|
+
sourceComponent: e.component,
|
|
60267
|
+
sourceItemId: e.itemId,
|
|
60268
|
+
eventName: eventName
|
|
60269
|
+
});
|
|
60270
|
+
}
|
|
60271
|
+
}), /*#__PURE__*/jsx("span", {
|
|
60272
|
+
children: eventName
|
|
60273
|
+
})]
|
|
60274
|
+
}, key);
|
|
60275
|
+
})]
|
|
60276
|
+
}, e.key || "".concat(e.component, "|").concat(e.itemId));
|
|
60277
|
+
})
|
|
60278
|
+
})]
|
|
60279
|
+
})
|
|
60280
|
+
);
|
|
60264
60281
|
}
|
|
60265
60282
|
|
|
60266
60283
|
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|