dara-core 1.24.3__py3-none-any.whl → 1.25.1__py3-none-any.whl
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.
- dara/core/_assets/auto_js/dara.core.umd.cjs +1060 -311
- dara/core/interactivity/__init__.py +5 -0
- dara/core/interactivity/derived_variable.py +20 -3
- dara/core/interactivity/plain_variable.py +20 -5
- dara/core/interactivity/stream_event.py +321 -0
- dara/core/interactivity/stream_utils.py +69 -0
- dara/core/interactivity/stream_variable.py +354 -0
- dara/core/internal/dependency_resolution.py +18 -6
- dara/core/internal/normalization.py +17 -3
- dara/core/internal/registries.py +4 -0
- dara/core/internal/registry.py +1 -0
- dara/core/internal/routing.py +55 -0
- dara/core/main.py +2 -0
- dara/core/router/dependency_graph.py +18 -0
- {dara_core-1.24.3.dist-info → dara_core-1.25.1.dist-info}/METADATA +10 -10
- {dara_core-1.24.3.dist-info → dara_core-1.25.1.dist-info}/RECORD +19 -16
- {dara_core-1.24.3.dist-info → dara_core-1.25.1.dist-info}/LICENSE +0 -0
- {dara_core-1.24.3.dist-info → dara_core-1.25.1.dist-info}/WHEEL +0 -0
- {dara_core-1.24.3.dist-info → dara_core-1.25.1.dist-info}/entry_points.txt +0 -0
|
@@ -4227,7 +4227,7 @@
|
|
|
4227
4227
|
let recoilValue = null;
|
|
4228
4228
|
const {
|
|
4229
4229
|
key,
|
|
4230
|
-
get,
|
|
4230
|
+
get: get2,
|
|
4231
4231
|
cachePolicy_UNSTABLE: cachePolicy
|
|
4232
4232
|
} = options;
|
|
4233
4233
|
const set2 = options.set != null ? options.set : void 0;
|
|
@@ -4423,7 +4423,7 @@
|
|
|
4423
4423
|
};
|
|
4424
4424
|
};
|
|
4425
4425
|
try {
|
|
4426
|
-
result =
|
|
4426
|
+
result = get2({
|
|
4427
4427
|
get: getRecoilValue,
|
|
4428
4428
|
getCallback
|
|
4429
4429
|
});
|
|
@@ -5028,9 +5028,9 @@
|
|
|
5028
5028
|
const sel = Recoil_selector({
|
|
5029
5029
|
key: `${options.key}__withFallback`,
|
|
5030
5030
|
get: ({
|
|
5031
|
-
get
|
|
5031
|
+
get: get2
|
|
5032
5032
|
}) => {
|
|
5033
|
-
const baseValue =
|
|
5033
|
+
const baseValue = get2(base);
|
|
5034
5034
|
return baseValue instanceof DefaultValue$2$1 ? options.default : baseValue;
|
|
5035
5035
|
},
|
|
5036
5036
|
// $FlowFixMe[incompatible-call]
|
|
@@ -5312,10 +5312,10 @@
|
|
|
5312
5312
|
Recoil_selectorFamily({
|
|
5313
5313
|
key: "__waitForNone",
|
|
5314
5314
|
get: (dependencies) => ({
|
|
5315
|
-
get
|
|
5315
|
+
get: get2
|
|
5316
5316
|
}) => {
|
|
5317
5317
|
const deps = unwrapDependencies(dependencies);
|
|
5318
|
-
const [results, exceptions] = concurrentRequests(
|
|
5318
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5319
5319
|
return wrapLoadables(dependencies, results, exceptions);
|
|
5320
5320
|
},
|
|
5321
5321
|
dangerouslyAllowMutability: true
|
|
@@ -5323,10 +5323,10 @@
|
|
|
5323
5323
|
Recoil_selectorFamily({
|
|
5324
5324
|
key: "__waitForAny",
|
|
5325
5325
|
get: (dependencies) => ({
|
|
5326
|
-
get
|
|
5326
|
+
get: get2
|
|
5327
5327
|
}) => {
|
|
5328
5328
|
const deps = unwrapDependencies(dependencies);
|
|
5329
|
-
const [results, exceptions] = concurrentRequests(
|
|
5329
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5330
5330
|
if (exceptions.some((exp) => !Recoil_isPromise(exp))) {
|
|
5331
5331
|
return wrapLoadables(dependencies, results, exceptions);
|
|
5332
5332
|
}
|
|
@@ -5350,10 +5350,10 @@
|
|
|
5350
5350
|
Recoil_selectorFamily({
|
|
5351
5351
|
key: "__waitForAll",
|
|
5352
5352
|
get: (dependencies) => ({
|
|
5353
|
-
get
|
|
5353
|
+
get: get2
|
|
5354
5354
|
}) => {
|
|
5355
5355
|
const deps = unwrapDependencies(dependencies);
|
|
5356
|
-
const [results, exceptions] = concurrentRequests(
|
|
5356
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5357
5357
|
if (exceptions.every((exp) => exp == null)) {
|
|
5358
5358
|
return wrapResults(dependencies, results);
|
|
5359
5359
|
}
|
|
@@ -5368,10 +5368,10 @@
|
|
|
5368
5368
|
Recoil_selectorFamily({
|
|
5369
5369
|
key: "__waitForAllSettled",
|
|
5370
5370
|
get: (dependencies) => ({
|
|
5371
|
-
get
|
|
5371
|
+
get: get2
|
|
5372
5372
|
}) => {
|
|
5373
5373
|
const deps = unwrapDependencies(dependencies);
|
|
5374
|
-
const [results, exceptions] = concurrentRequests(
|
|
5374
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5375
5375
|
if (exceptions.every((exp) => !Recoil_isPromise(exp))) {
|
|
5376
5376
|
return wrapLoadables(dependencies, results, exceptions);
|
|
5377
5377
|
}
|
|
@@ -5388,10 +5388,10 @@
|
|
|
5388
5388
|
Recoil_selectorFamily({
|
|
5389
5389
|
key: "__noWait",
|
|
5390
5390
|
get: (dependency) => ({
|
|
5391
|
-
get
|
|
5391
|
+
get: get2
|
|
5392
5392
|
}) => {
|
|
5393
5393
|
try {
|
|
5394
|
-
return Recoil_selector.value(loadableWithValue$4(
|
|
5394
|
+
return Recoil_selector.value(loadableWithValue$4(get2(dependency)));
|
|
5395
5395
|
} catch (exception) {
|
|
5396
5396
|
return Recoil_selector.value(Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception));
|
|
5397
5397
|
}
|
|
@@ -6651,7 +6651,7 @@
|
|
|
6651
6651
|
return cb(config$2);
|
|
6652
6652
|
});
|
|
6653
6653
|
},
|
|
6654
|
-
get: function
|
|
6654
|
+
get: function get2() {
|
|
6655
6655
|
return _config.cssPrefix;
|
|
6656
6656
|
}
|
|
6657
6657
|
});
|
|
@@ -13387,11 +13387,11 @@
|
|
|
13387
13387
|
if (hasRequiredGet) return get_1;
|
|
13388
13388
|
hasRequiredGet = 1;
|
|
13389
13389
|
var baseGet = require_baseGet();
|
|
13390
|
-
function
|
|
13390
|
+
function get2(object2, path, defaultValue) {
|
|
13391
13391
|
var result = object2 == null ? void 0 : baseGet(object2, path);
|
|
13392
13392
|
return result === void 0 ? defaultValue : result;
|
|
13393
13393
|
}
|
|
13394
|
-
get_1 =
|
|
13394
|
+
get_1 = get2;
|
|
13395
13395
|
return get_1;
|
|
13396
13396
|
}
|
|
13397
13397
|
var _baseHasIn;
|
|
@@ -13447,14 +13447,14 @@
|
|
|
13447
13447
|
function require_baseMatchesProperty() {
|
|
13448
13448
|
if (hasRequired_baseMatchesProperty) return _baseMatchesProperty;
|
|
13449
13449
|
hasRequired_baseMatchesProperty = 1;
|
|
13450
|
-
var baseIsEqual = require_baseIsEqual(),
|
|
13450
|
+
var baseIsEqual = require_baseIsEqual(), get2 = requireGet(), hasIn = requireHasIn(), isKey = require_isKey(), isStrictComparable = require_isStrictComparable(), matchesStrictComparable = require_matchesStrictComparable(), toKey = require_toKey();
|
|
13451
13451
|
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
13452
13452
|
function baseMatchesProperty(path, srcValue) {
|
|
13453
13453
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
13454
13454
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
13455
13455
|
}
|
|
13456
13456
|
return function(object2) {
|
|
13457
|
-
var objValue =
|
|
13457
|
+
var objValue = get2(object2, path);
|
|
13458
13458
|
return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
13459
13459
|
};
|
|
13460
13460
|
}
|
|
@@ -18062,7 +18062,7 @@
|
|
|
18062
18062
|
var _a;
|
|
18063
18063
|
return jsxRuntimeExports.jsxs(Wrapper$8, { className: props.className, style: props.style, children: [jsxRuntimeExports.jsxs(Loader, { color: props.color, size: props.size, children: [jsxRuntimeExports.jsx("div", { className: "sk-chase-dot" }), jsxRuntimeExports.jsx("div", { className: "sk-chase-dot" }), jsxRuntimeExports.jsx("div", { className: "sk-chase-dot" }), jsxRuntimeExports.jsx("div", { className: "sk-chase-dot" }), jsxRuntimeExports.jsx("div", { className: "sk-chase-dot" }), jsxRuntimeExports.jsx("div", { className: "sk-chase-dot" })] }), (props.showText || props.text) && jsxRuntimeExports.jsx(LoadingText, { color: props.color, children: (_a = props.text) !== null && _a !== void 0 ? _a : "LOADING" })] });
|
|
18064
18064
|
}
|
|
18065
|
-
var __rest$
|
|
18065
|
+
var __rest$9 = function(s, e2) {
|
|
18066
18066
|
var t2 = {};
|
|
18067
18067
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
18068
18068
|
t2[p2] = s[p2];
|
|
@@ -18171,7 +18171,7 @@
|
|
|
18171
18171
|
secondary: SecondaryButton
|
|
18172
18172
|
};
|
|
18173
18173
|
function Button(_a, ref) {
|
|
18174
|
-
var { autoFocus, children, className, disabled: disabled2, download, href: href2, loading, id, onClick, outline = false, style, styling = "primary", type = "button" } = _a, props = __rest$
|
|
18174
|
+
var { autoFocus, children, className, disabled: disabled2, download, href: href2, loading, id, onClick, outline = false, style, styling = "primary", type = "button" } = _a, props = __rest$9(_a, ["autoFocus", "children", "className", "disabled", "download", "href", "loading", "id", "onClick", "outline", "style", "styling", "type"]);
|
|
18175
18175
|
const currentTheme = useClTheme();
|
|
18176
18176
|
const Component = stylingMap[styling];
|
|
18177
18177
|
const content = loading ? jsxRuntimeExports.jsx(StyledLoading, { color: outline ? currentTheme.colors.grey2 : currentTheme.colors.blue1 }) : children;
|
|
@@ -25347,7 +25347,7 @@
|
|
|
25347
25347
|
return jsxRuntimeExports.jsx(CheckboxWrapper, { "aria-disabled": props.disabled, children: jsxRuntimeExports.jsx(Checkbox, { id: index2, disabled: isSelectPermitted ? props.disabled : ((_a = checkedState.find((option) => option.value === item.value)) === null || _a === void 0 ? void 0 : _a.state) === false, isListStyle: props.isListStyle, label: item.label ? item.label : item.value, onChange: (checked, e2) => onChangeValue(e2), selected: (_b = checkedState.find((option) => option.value === item.value)) === null || _b === void 0 ? void 0 : _b.state }) }, `item-${index2}`);
|
|
25348
25348
|
})] });
|
|
25349
25349
|
}
|
|
25350
|
-
var __rest$
|
|
25350
|
+
var __rest$8 = function(s, e2) {
|
|
25351
25351
|
var t2 = {};
|
|
25352
25352
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
25353
25353
|
t2[p2] = s[p2];
|
|
@@ -25402,7 +25402,7 @@
|
|
|
25402
25402
|
color: ${(props) => props.theme.colors.error};
|
|
25403
25403
|
`;
|
|
25404
25404
|
const Input$1 = React$1.forwardRef((_a, ref) => {
|
|
25405
|
-
var { type = "text", onChange: onChange2, onKeyDown, keydownFilter, onComplete, maxValue, minValue, errorMsg, className, style, initialValue } = _a, rest = __rest$
|
|
25405
|
+
var { type = "text", onChange: onChange2, onKeyDown, keydownFilter, onComplete, maxValue, minValue, errorMsg, className, style, initialValue } = _a, rest = __rest$8(_a, ["type", "onChange", "onKeyDown", "keydownFilter", "onComplete", "maxValue", "minValue", "errorMsg", "className", "style", "initialValue"]);
|
|
25406
25406
|
const handleChange = (e2) => {
|
|
25407
25407
|
const target = e2.target;
|
|
25408
25408
|
if (onChange2) {
|
|
@@ -27456,7 +27456,7 @@
|
|
|
27456
27456
|
stateReducer: defaultProps$3.stateReducer,
|
|
27457
27457
|
environment: defaultProps$3.environment
|
|
27458
27458
|
});
|
|
27459
|
-
var __rest$
|
|
27459
|
+
var __rest$7 = function(s, e2) {
|
|
27460
27460
|
var t2 = {};
|
|
27461
27461
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
27462
27462
|
t2[p2] = s[p2];
|
|
@@ -27476,7 +27476,7 @@
|
|
|
27476
27476
|
background-color: transparent !important;
|
|
27477
27477
|
`;
|
|
27478
27478
|
const ChevronButton = (_a) => {
|
|
27479
|
-
var { getToggleButtonProps, disabled: disabled2, isOpen } = _a, props = __rest$
|
|
27479
|
+
var { getToggleButtonProps, disabled: disabled2, isOpen } = _a, props = __rest$7(_a, ["getToggleButtonProps", "disabled", "isOpen"]);
|
|
27480
27480
|
return jsxRuntimeExports.jsx(StyledChevronButton, Object.assign({}, getToggleButtonProps(), props, { children: jsxRuntimeExports.jsx(Chevron$2, { disabled: disabled2, isOpen }) }));
|
|
27481
27481
|
};
|
|
27482
27482
|
const ChevronButton$1 = React$1.memo(ChevronButton);
|
|
@@ -27515,7 +27515,7 @@
|
|
|
27515
27515
|
}
|
|
27516
27516
|
var isEmptyExports = requireIsEmpty();
|
|
27517
27517
|
const isEmpty = /* @__PURE__ */ getDefaultExportFromCjs(isEmptyExports);
|
|
27518
|
-
var __rest$
|
|
27518
|
+
var __rest$6 = function(s, e2) {
|
|
27519
27519
|
var t2 = {};
|
|
27520
27520
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
27521
27521
|
t2[p2] = s[p2];
|
|
@@ -27570,7 +27570,7 @@
|
|
|
27570
27570
|
}
|
|
27571
27571
|
`;
|
|
27572
27572
|
const ListItem = ({ size: size2, title, item, index: index2, getItemProps, itemClass, children, isHighlighted, isSelected }) => {
|
|
27573
|
-
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$
|
|
27573
|
+
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$6(_a, ["itemClassName"]);
|
|
27574
27574
|
return jsxRuntimeExports.jsx(StyledListItem, Object.assign({}, itemProps, { className: itemClass ? `${itemClassName} ${itemClass}` : itemClassName, title, size: size2, item, isHighlighted, isSelected, children }));
|
|
27575
27575
|
};
|
|
27576
27576
|
ListItem.displayName = "ListItem";
|
|
@@ -27789,9 +27789,11 @@
|
|
|
27789
27789
|
`;
|
|
27790
27790
|
styled.div`
|
|
27791
27791
|
display: flex;
|
|
27792
|
-
align-items: center;
|
|
27793
27792
|
gap: 0.5rem;
|
|
27793
|
+
align-items: center;
|
|
27794
|
+
|
|
27794
27795
|
width: 100%;
|
|
27796
|
+
|
|
27795
27797
|
line-height: 1;
|
|
27796
27798
|
`;
|
|
27797
27799
|
styled.div`
|
|
@@ -28019,7 +28021,7 @@
|
|
|
28019
28021
|
}
|
|
28020
28022
|
var passive2 = false;
|
|
28021
28023
|
var options = Object.defineProperty({}, "passive", {
|
|
28022
|
-
get: function
|
|
28024
|
+
get: function get2() {
|
|
28023
28025
|
passive2 = true;
|
|
28024
28026
|
}
|
|
28025
28027
|
});
|
|
@@ -31314,7 +31316,7 @@
|
|
|
31314
31316
|
}, focusSelectedMonth: false, showPopperArrow: true, excludeScrollbar: true, customTimeInput: null, calendarStartDay: void 0 };
|
|
31315
31317
|
} }]), a2;
|
|
31316
31318
|
})(), jt = "input", Ht = "navigate";
|
|
31317
|
-
var __rest$
|
|
31319
|
+
var __rest$5 = function(s, e2) {
|
|
31318
31320
|
var t2 = {};
|
|
31319
31321
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
31320
31322
|
t2[p2] = s[p2];
|
|
@@ -31445,7 +31447,7 @@
|
|
|
31445
31447
|
}
|
|
31446
31448
|
`;
|
|
31447
31449
|
const DatepickerListItem = React__namespace.memo(({ item, index: index2, getItemProps, isSelected, size: size2, isHighlighted }) => {
|
|
31448
|
-
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$
|
|
31450
|
+
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$5(_a, ["itemClassName"]);
|
|
31449
31451
|
return jsxRuntimeExports.jsx(StyledDatepickerListItem, Object.assign({}, itemProps, { isSelected, title: item.label, item, index: index2, size: size2, isHighlighted, children: item.label }));
|
|
31450
31452
|
});
|
|
31451
31453
|
const StyledDropdownList = React__namespace.memo(styled(DropdownList$1)`
|
|
@@ -33482,6 +33484,7 @@
|
|
|
33482
33484
|
overflow: hidden;
|
|
33483
33485
|
text-overflow: ellipsis;
|
|
33484
33486
|
white-space: nowrap;
|
|
33487
|
+
font-size: ${(props) => props.size ? `${props.size}rem` : "1rem"};
|
|
33485
33488
|
`;
|
|
33486
33489
|
const SelectedItem = styled.div`
|
|
33487
33490
|
overflow: hidden;
|
|
@@ -33753,7 +33756,7 @@
|
|
|
33753
33756
|
const stepDown = () => step(amountToStep * -1);
|
|
33754
33757
|
return jsxRuntimeExports.jsxs(StepperWrapper, { disabled: disabled2, children: [jsxRuntimeExports.jsx(StepperButton, { disabled: disabled2, onClick: stepUp, styling: "ghost", tabIndex: -1, children: jsxRuntimeExports.jsx(ChevronUp, {}) }), jsxRuntimeExports.jsx(StepperButton, { disabled: disabled2, onClick: stepDown, styling: "ghost", tabIndex: -1, children: jsxRuntimeExports.jsx(ChevronDown, {}) })] });
|
|
33755
33758
|
};
|
|
33756
|
-
var __rest$
|
|
33759
|
+
var __rest$4 = function(s, e2) {
|
|
33757
33760
|
var t2 = {};
|
|
33758
33761
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
33759
33762
|
t2[p2] = s[p2];
|
|
@@ -33856,7 +33859,7 @@
|
|
|
33856
33859
|
return "";
|
|
33857
33860
|
};
|
|
33858
33861
|
React__namespace.forwardRef((_a, ref) => {
|
|
33859
|
-
var { value, onChange: onChange2, initialValue } = _a, props = __rest$
|
|
33862
|
+
var { value, onChange: onChange2, initialValue } = _a, props = __rest$4(_a, ["value", "onChange", "initialValue"]);
|
|
33860
33863
|
const keydownFilter = React$1.useMemo(() => numericFilter(props.integerOnly), [props.integerOnly]);
|
|
33861
33864
|
const [input, setInput] = React$1.useState(() => getInitialValue(value, initialValue));
|
|
33862
33865
|
const step = (v) => {
|
|
@@ -34493,7 +34496,7 @@
|
|
|
34493
34496
|
display: none;
|
|
34494
34497
|
}
|
|
34495
34498
|
`;
|
|
34496
|
-
var __rest$
|
|
34499
|
+
var __rest$3 = function(s, e2) {
|
|
34497
34500
|
var t2 = {};
|
|
34498
34501
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
34499
34502
|
t2[p2] = s[p2];
|
|
@@ -34527,6 +34530,7 @@
|
|
|
34527
34530
|
|
|
34528
34531
|
font-weight: ${(props) => (props === null || props === void 0 ? void 0 : props.heading) ? "bold" : "normal"};
|
|
34529
34532
|
color: ${(props) => getTextColor(props === null || props === void 0 ? void 0 : props.heading, props.isSelected, props.theme)};
|
|
34533
|
+
font-size: ${(props) => props.size ? `${props.size}rem` : "1rem"};
|
|
34530
34534
|
|
|
34531
34535
|
${(props) => {
|
|
34532
34536
|
if (props.heading) {
|
|
@@ -34552,13 +34556,13 @@
|
|
|
34552
34556
|
return [...acc, item];
|
|
34553
34557
|
}, []);
|
|
34554
34558
|
}
|
|
34555
|
-
const SectionedListItem = ({ item, index: index2, getItemProps, isSelected, isHighlighted }) => {
|
|
34559
|
+
const SectionedListItem = ({ item, index: index2, getItemProps, isSelected, isHighlighted, size: size2 }) => {
|
|
34556
34560
|
const theme2 = useClTheme();
|
|
34557
|
-
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$
|
|
34561
|
+
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$3(_a, ["itemClassName"]);
|
|
34558
34562
|
if (item.heading) {
|
|
34559
34563
|
delete itemProps.onClick;
|
|
34560
34564
|
}
|
|
34561
|
-
return jsxRuntimeExports.jsxs(ListItemSpan, Object.assign({}, itemProps, { heading: item.heading, section: item.section, isSelected, title: item.label, item, index: index2, isHighlighted, children: [item.label || item.section, item.badge && jsxRuntimeExports.jsx(Badge, { color: item.badge.color || theme2.colors.primary, children: item.badge.label })] }));
|
|
34565
|
+
return jsxRuntimeExports.jsxs(ListItemSpan, Object.assign({}, itemProps, { heading: item.heading, section: item.section, isSelected, title: item.label, item, index: index2, size: size2, isHighlighted, children: [item.label || item.section, item.badge && jsxRuntimeExports.jsx(Badge, { color: item.badge.color || theme2.colors.primary, children: item.badge.label })] }));
|
|
34562
34566
|
};
|
|
34563
34567
|
function SectionedList(props) {
|
|
34564
34568
|
var _a, _b, _c;
|
|
@@ -34650,8 +34654,8 @@
|
|
|
34650
34654
|
const role = useRole(context, { role: "listbox" });
|
|
34651
34655
|
const { getReferenceProps, getFloatingProps } = useInteractions([role]);
|
|
34652
34656
|
const dropdownStyle = React$1.useMemo(() => Object.assign(Object.assign({}, floatingStyles), { marginLeft: -1 }), [floatingStyles]);
|
|
34653
|
-
const renderListItem = React$1.useCallback((item, index2) => jsxRuntimeExports.jsx(SectionedListItem, { item, index: index2, getItemProps, isSelected: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === item.value, isHighlighted: isOpen && kbdHighlightIdx !== void 0 && kbdHighlightIdx === index2 }, `item-${index2}-${isOpen && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) === item.label}`), [getItemProps, selectedItem, isOpen, kbdHighlightIdx]);
|
|
34654
|
-
return jsxRuntimeExports.jsxs(Wrapper$6, { className: props.className, isDisabled: props.disabled, isErrored: false, isOpen, style: props.style, id: props.id, children: [jsxRuntimeExports.jsxs(InputWrapper$2, { disabled: props.disabled, isOpen, ref: refs.setReference, children: [jsxRuntimeExports.jsx(Input, Object.assign({}, getInputProps({ value: inputValue }), getReferenceProps())), jsxRuntimeExports.jsx(ChevronButton$1, { disabled: props.disabled, isOpen, getToggleButtonProps })] }), ReactDOM.createPortal(jsxRuntimeExports.jsx(DropdownList$1, { items, getItemProps, getFloatingProps, style: dropdownStyle, isOpen, getMenuProps, ref: refs.setFloating, kbdHighlightIdx, children: renderListItem }), document.body)] });
|
|
34657
|
+
const renderListItem = React$1.useCallback((item, index2) => jsxRuntimeExports.jsx(SectionedListItem, { item, index: index2, getItemProps, size: props.size, isSelected: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === item.value, isHighlighted: isOpen && kbdHighlightIdx !== void 0 && kbdHighlightIdx === index2 }, `item-${index2}-${isOpen && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) === item.label}`), [getItemProps, selectedItem, isOpen, kbdHighlightIdx, props.size]);
|
|
34658
|
+
return jsxRuntimeExports.jsxs(Wrapper$6, { className: props.className, isDisabled: props.disabled, isErrored: false, isOpen, style: props.style, id: props.id, children: [jsxRuntimeExports.jsxs(InputWrapper$2, { disabled: props.disabled, isOpen, ref: refs.setReference, children: [jsxRuntimeExports.jsx(Input, Object.assign({}, getInputProps({ value: inputValue }), getReferenceProps(), { size: props.size })), jsxRuntimeExports.jsx(ChevronButton$1, { disabled: props.disabled, isOpen, getToggleButtonProps })] }), ReactDOM.createPortal(jsxRuntimeExports.jsx(DropdownList$1, { items, getItemProps, getFloatingProps, style: dropdownStyle, isOpen, size: props.size, getMenuProps, ref: refs.setFloating, kbdHighlightIdx, children: renderListItem }), document.body)] });
|
|
34655
34659
|
}
|
|
34656
34660
|
var toInteger_1;
|
|
34657
34661
|
var hasRequiredToInteger;
|
|
@@ -39079,7 +39083,9 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39079
39083
|
style: Object.assign(Object.assign(Object.assign({}, floatingStyles), { maxHeight: 800, minWidth: 150, zIndex: 9999 }), style)
|
|
39080
39084
|
}), { isOpen, children: jsxRuntimeExports.jsx(SectionedList, { items: allowColumnHiding ? [resetFunctions, columnToggles] : [resetFunctions], onSelect: onOptionSelect }, isOpen ? "open" : "closed") })), document.body)] });
|
|
39081
39085
|
};
|
|
39082
|
-
|
|
39086
|
+
const { fontSize } = window.getComputedStyle(document.documentElement);
|
|
39087
|
+
const DEFAULT_ROW_HEIGHT = parseFloat(fontSize) * 2.5;
|
|
39088
|
+
var __rest$2 = function(s, e2) {
|
|
39083
39089
|
var t2 = {};
|
|
39084
39090
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
39085
39091
|
t2[p2] = s[p2];
|
|
@@ -39090,8 +39096,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39090
39096
|
}
|
|
39091
39097
|
return t2;
|
|
39092
39098
|
};
|
|
39093
|
-
const { fontSize } = window.getComputedStyle(document.documentElement);
|
|
39094
|
-
const ROW_HEIGHT = parseFloat(fontSize) * 2.5;
|
|
39095
39099
|
const shouldForwardProp$2 = (prop) => !["isSorted", "onClickRow"].includes(prop);
|
|
39096
39100
|
const Row = styled.div.withConfig({ shouldForwardProp: shouldForwardProp$2 })`
|
|
39097
39101
|
cursor: ${(props) => props.onClickRow ? "pointer" : "default"};
|
|
@@ -39147,7 +39151,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39147
39151
|
align-items: center;
|
|
39148
39152
|
|
|
39149
39153
|
min-width: 80px;
|
|
39150
|
-
height: ${() => `${
|
|
39154
|
+
height: ${({ rowHeight }) => `${rowHeight}px`};
|
|
39151
39155
|
|
|
39152
39156
|
color: ${(props) => props.theme.colors.grey6};
|
|
39153
39157
|
|
|
@@ -39159,19 +39163,19 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39159
39163
|
}
|
|
39160
39164
|
`;
|
|
39161
39165
|
const CellContent = styled.span`
|
|
39162
|
-
overflow: hidden;
|
|
39166
|
+
overflow: ${({ hasRowHeight }) => hasRowHeight ? "unset" : "hidden"};
|
|
39163
39167
|
|
|
39164
39168
|
width: 100%;
|
|
39165
39169
|
padding: 0 1rem;
|
|
39166
39170
|
|
|
39167
|
-
text-overflow: ellipsis;
|
|
39168
|
-
white-space: nowrap;
|
|
39171
|
+
text-overflow: ${({ hasRowHeight }) => hasRowHeight ? "unset" : "ellipsis"};
|
|
39172
|
+
white-space: ${({ hasRowHeight }) => hasRowHeight ? "normal" : "nowrap"};
|
|
39169
39173
|
`;
|
|
39170
39174
|
const arePropsEqual = (prevProps, nextProps) => {
|
|
39171
39175
|
var _a;
|
|
39172
39176
|
return areEqual(prevProps, nextProps) && !(((_a = nextProps.data) === null || _a === void 0 ? void 0 : _a.headerGroups) || []).some((headerGroup) => ((headerGroup === null || headerGroup === void 0 ? void 0 : headerGroup.headers) || []).some((header) => header.isResizing));
|
|
39173
39177
|
};
|
|
39174
|
-
const RenderRow = React__namespace.memo(({ data: { width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns }, index: index2, style: renderRowStyle }) => {
|
|
39178
|
+
const RenderRow = React__namespace.memo(({ data: { width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns, rowHeight }, index: index2, style: renderRowStyle }) => {
|
|
39175
39179
|
let row = rows[index2];
|
|
39176
39180
|
if (getItem) {
|
|
39177
39181
|
const value = getItem(index2);
|
|
@@ -39184,8 +39188,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39184
39188
|
}
|
|
39185
39189
|
if (!row) {
|
|
39186
39190
|
return jsxRuntimeExports.jsx("div", { children: headerGroups.map((headerGroup, gidx) => jsxRuntimeExports.jsx(RowPlaceholder, { style: {
|
|
39187
|
-
height:
|
|
39188
|
-
top: (index2 + 1) *
|
|
39191
|
+
height: rowHeight,
|
|
39192
|
+
top: (index2 + 1) * rowHeight,
|
|
39189
39193
|
width: totalColumnsWidth > width ? totalColumnsWidth : "100%"
|
|
39190
39194
|
}, children: headerGroup === null || headerGroup === void 0 ? void 0 : headerGroup.headers.map((col, cidx) => {
|
|
39191
39195
|
const headerProps = col.getHeaderProps();
|
|
@@ -39202,17 +39206,25 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39202
39206
|
throttledClickRow(row.original);
|
|
39203
39207
|
}
|
|
39204
39208
|
};
|
|
39205
|
-
const _a = row.getRowProps({ style: renderRowStyle }), { style: rowStyle } = _a, restRow = __rest$
|
|
39206
|
-
return React$1.createElement(Row, Object.assign({}, restRow, { key: `row-${index2}`, onClick, onClickRow, style: Object.assign(Object.assign({}, rowStyle), {
|
|
39207
|
-
|
|
39209
|
+
const _a = row.getRowProps({ style: renderRowStyle }), { style: rowStyle } = _a, restRow = __rest$2(_a, ["style"]);
|
|
39210
|
+
return React$1.createElement(Row, Object.assign({}, restRow, { key: `row-${index2}`, onClick, onClickRow, style: Object.assign(Object.assign({}, rowStyle), {
|
|
39211
|
+
// The first row is the header row which is not controlled by this rowHeight prop so it needs to be part of the calculation.
|
|
39212
|
+
top: index2 === 0 ? DEFAULT_ROW_HEIGHT : index2 * rowHeight + DEFAULT_ROW_HEIGHT,
|
|
39213
|
+
width: totalColumnsWidth > width ? totalColumnsWidth : "100%"
|
|
39214
|
+
}) }), row.cells.map((cell, colIdx) => {
|
|
39215
|
+
var _a2, _b, _c, _d, _e2;
|
|
39208
39216
|
const cellProps = cell.getCellProps();
|
|
39209
39217
|
return React$1.createElement(
|
|
39210
39218
|
Cell,
|
|
39211
|
-
Object.assign({}, cellProps, { key: `cell-${index2}-${colIdx}`, style: Object.assign(Object.assign({}, cellProps.style), { backgroundColor, justifyContent: mappedColumns[colIdx].align, maxWidth: (_a2 = cell.column) === null || _a2 === void 0 ? void 0 : _a2.maxWidth, width: (
|
|
39219
|
+
Object.assign({}, cellProps, { rowHeight, key: `cell-${index2}-${colIdx}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, cellProps.style), { backgroundColor, justifyContent: mappedColumns[colIdx].align, maxWidth: (_a2 = cell.column) === null || _a2 === void 0 ? void 0 : _a2.maxWidth, width: (
|
|
39212
39220
|
// If width calc has messed up then use the raw width from the column
|
|
39213
39221
|
cellProps.style.width === "NaNpx" ? mappedColumns[colIdx].width : cellProps.style.width
|
|
39214
|
-
) })
|
|
39215
|
-
|
|
39222
|
+
) }), ((_b = mappedColumns[colIdx]) === null || _b === void 0 ? void 0 : _b.sticky) === "left" && typeof ((_c = mappedColumns[colIdx]) === null || _c === void 0 ? void 0 : _c.stickyOffset) === "number" ? {
|
|
39223
|
+
left: `${mappedColumns[colIdx].stickyOffset}px`
|
|
39224
|
+
} : {}), ((_d = mappedColumns[colIdx]) === null || _d === void 0 ? void 0 : _d.sticky) === "right" && typeof ((_e2 = mappedColumns[colIdx]) === null || _e2 === void 0 ? void 0 : _e2.stickyOffset) === "number" ? {
|
|
39225
|
+
right: `${mappedColumns[colIdx].stickyOffset}px`
|
|
39226
|
+
} : {}) }),
|
|
39227
|
+
jsxRuntimeExports.jsx(CellContent, { hasRowHeight: rowHeight !== DEFAULT_ROW_HEIGHT, children: cell.render("Cell", {
|
|
39216
39228
|
colIdx,
|
|
39217
39229
|
currentEditCell,
|
|
39218
39230
|
rowIdx: index2
|
|
@@ -39220,7 +39232,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39220
39232
|
);
|
|
39221
39233
|
}));
|
|
39222
39234
|
}, arePropsEqual);
|
|
39223
|
-
var __rest = function(s, e2) {
|
|
39235
|
+
var __rest$1 = function(s, e2) {
|
|
39224
39236
|
var t2 = {};
|
|
39225
39237
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
39226
39238
|
t2[p2] = s[p2];
|
|
@@ -39292,7 +39304,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39292
39304
|
justify-content: space-between;
|
|
39293
39305
|
|
|
39294
39306
|
min-width: 80px;
|
|
39295
|
-
height: ${
|
|
39307
|
+
height: ${DEFAULT_ROW_HEIGHT}px;
|
|
39296
39308
|
|
|
39297
39309
|
color: ${(props) => props.theme.colors.text};
|
|
39298
39310
|
|
|
@@ -39377,6 +39389,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39377
39389
|
});
|
|
39378
39390
|
return [...leftStickyCols, ...nonStickyCols, ...rightStickyCols];
|
|
39379
39391
|
};
|
|
39392
|
+
const appendStickyOffsets = (columns) => {
|
|
39393
|
+
let leftOffset = 0;
|
|
39394
|
+
let rightOffset = 0;
|
|
39395
|
+
const rightStickyColumnWidths = columns.filter((col) => col.sticky === "right").slice(1).map((col) => parseInt(col.width) || 150);
|
|
39396
|
+
return columns.map((col) => {
|
|
39397
|
+
if (col.sticky === "left") {
|
|
39398
|
+
const nextCol = Object.assign(Object.assign({}, col), { stickyOffset: leftOffset });
|
|
39399
|
+
const width = parseInt(col.width) || 150;
|
|
39400
|
+
leftOffset += width;
|
|
39401
|
+
return nextCol;
|
|
39402
|
+
}
|
|
39403
|
+
if (col.sticky === "right") {
|
|
39404
|
+
rightOffset = rightStickyColumnWidths.reduce((acc, width) => acc + width, 0);
|
|
39405
|
+
const nextCol = Object.assign(Object.assign({}, col), { stickyOffset: rightOffset });
|
|
39406
|
+
rightStickyColumnWidths.shift();
|
|
39407
|
+
return nextCol;
|
|
39408
|
+
}
|
|
39409
|
+
return col;
|
|
39410
|
+
});
|
|
39411
|
+
};
|
|
39380
39412
|
const filterComponentMap = {
|
|
39381
39413
|
categorical: CategoricalFilter,
|
|
39382
39414
|
datetime: DatetimeFilter,
|
|
@@ -39394,12 +39426,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39394
39426
|
return Object.assign(Object.assign({}, col), { Filter: filterComponentMap[col.filter] });
|
|
39395
39427
|
});
|
|
39396
39428
|
};
|
|
39429
|
+
const createActionColumn = (actions, accessor, sticky, disableSelectAll = false) => {
|
|
39430
|
+
const width = actions.includes(Actions.SELECT) ? 52 : actions.length * 24 + 24;
|
|
39431
|
+
return {
|
|
39432
|
+
Cell: ActionCell,
|
|
39433
|
+
Header: actions.includes(Actions.SELECT) && !disableSelectAll ? SelectHeader : "",
|
|
39434
|
+
accessor: accessor || "actions",
|
|
39435
|
+
actions,
|
|
39436
|
+
disableSortBy: true,
|
|
39437
|
+
maxWidth: width,
|
|
39438
|
+
minWidth: actions.includes(Actions.SELECT) ? 52 : 48,
|
|
39439
|
+
sticky: sticky || null,
|
|
39440
|
+
width
|
|
39441
|
+
};
|
|
39442
|
+
};
|
|
39397
39443
|
const cells = {
|
|
39398
39444
|
DATETIME: DatetimeCell,
|
|
39399
39445
|
EDIT_INPUT: EditInputCell,
|
|
39400
39446
|
EDIT_SELECT: EditSelectCell
|
|
39401
39447
|
};
|
|
39402
|
-
const createItemData$1 = memoizeOne$1((width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns) => ({
|
|
39448
|
+
const createItemData$1 = memoizeOne$1((width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns, rowHeight) => ({
|
|
39403
39449
|
backgroundColor,
|
|
39404
39450
|
currentEditCell,
|
|
39405
39451
|
getItem,
|
|
@@ -39408,12 +39454,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39408
39454
|
onClickRow,
|
|
39409
39455
|
prepareRow,
|
|
39410
39456
|
rows,
|
|
39457
|
+
rowHeight,
|
|
39411
39458
|
throttledClickRow,
|
|
39412
39459
|
totalColumnsWidth,
|
|
39413
39460
|
width
|
|
39414
39461
|
}));
|
|
39415
|
-
const Table = React$1.forwardRef(({ allowHiding, backgroundColor, className, columns, data: data2, getItem, initialSort = [], itemCount, maxRows, onAction, onChange: onChange2, onClickRow, onItemsRendered, onFilter, onSort, showTableOptions, style, tableOptionsStyle }, ref) => {
|
|
39462
|
+
const Table = React$1.forwardRef(({ allowHiding, actions, backgroundColor, className, columns, data: data2, getItem, initialSort = [], itemCount, maxRows, onAction, onChange: onChange2, onClickRow, onItemsRendered, onFilter, onSort, rowHeight, showTableOptions, style, tableOptionsStyle }, ref) => {
|
|
39416
39463
|
const [currentSortBy, setCurrentSortBy] = React$1.useState(initialSort);
|
|
39464
|
+
const tableRowHeight = rowHeight || DEFAULT_ROW_HEIGHT;
|
|
39417
39465
|
React$1.useEffect(
|
|
39418
39466
|
() => {
|
|
39419
39467
|
setCurrentSortBy(initialSort);
|
|
@@ -39443,7 +39491,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39443
39491
|
throttledSetEditCell([Number(cell[0]), cell[1]]);
|
|
39444
39492
|
};
|
|
39445
39493
|
const infiniteData = React$1.useMemo(() => Array(itemCount).fill(0), [itemCount]);
|
|
39446
|
-
const mappedColumns = React$1.useMemo(() =>
|
|
39494
|
+
const mappedColumns = React$1.useMemo(() => {
|
|
39495
|
+
let processedColumns = columns;
|
|
39496
|
+
if (actions && actions.length > 0) {
|
|
39497
|
+
const actionColumn = createActionColumn(actions);
|
|
39498
|
+
processedColumns = [...columns, actionColumn];
|
|
39499
|
+
}
|
|
39500
|
+
return appendStickyOffsets(appendFilterComponents(orderStickyCols(processedColumns)));
|
|
39501
|
+
}, [columns, actions]);
|
|
39447
39502
|
const hasFixedColumns = React$1.useMemo(() => mappedColumns.some((column) => "sticky" in column), [mappedColumns]);
|
|
39448
39503
|
const totalColumnsWidth = React$1.useMemo(() => mappedColumns.reduce((acc, column) => acc + (parseInt(column.width) || 150), 0), [mappedColumns]);
|
|
39449
39504
|
const filterTypes = React$1.useMemo(() => ({
|
|
@@ -39486,7 +39541,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39486
39541
|
const tableProps = getTableBodyProps();
|
|
39487
39542
|
const renderTable = React$1.useCallback(
|
|
39488
39543
|
(_a) => {
|
|
39489
|
-
var { children, style: tableStyle } = _a, rest = __rest(_a, ["children", "style"]);
|
|
39544
|
+
var { children, style: tableStyle } = _a, rest = __rest$1(_a, ["children", "style"]);
|
|
39490
39545
|
return jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsx(Header, { style: { width: `max(${totalColumnsWidth}px, 100%)` }, children: headerGroups.map((headerGroup, gidx) => React$1.createElement(HeaderRow, Object.assign({}, headerGroup.getHeaderGroupProps(), { key: `group-${gidx}` }), headerGroup.headers.map((col, cidx) => {
|
|
39491
39546
|
const headerProps = col.getHeaderProps();
|
|
39492
39547
|
const sortProps = col.getSortByToggleProps();
|
|
@@ -39499,11 +39554,15 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39499
39554
|
const showHeaderCellButtonContainer = showSort || showFilter || showOptions;
|
|
39500
39555
|
return React$1.createElement(
|
|
39501
39556
|
HeaderCell,
|
|
39502
|
-
Object.assign({}, headerProps, { key: `col-${gidx}-${cidx}`, style: Object.assign(Object.assign({}, headerProps.style), {
|
|
39557
|
+
Object.assign({}, headerProps, { key: `col-${gidx}-${cidx}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, headerProps.style), {
|
|
39503
39558
|
maxWidth: col.maxWidth,
|
|
39504
39559
|
// If width calc has messed up then use the raw width from the column
|
|
39505
39560
|
width: headerProps.style.width === "NaNpx" ? mappedColumns[cidx].width : headerProps.style.width
|
|
39506
|
-
})
|
|
39561
|
+
}), col.sticky === "left" && typeof col.stickyOffset === "number" ? {
|
|
39562
|
+
left: `${col.stickyOffset}px`
|
|
39563
|
+
} : {}), col.sticky === "right" && typeof col.stickyOffset === "number" ? {
|
|
39564
|
+
right: `${col.stickyOffset}px`
|
|
39565
|
+
} : {}) }),
|
|
39507
39566
|
jsxRuntimeExports.jsxs(HeaderTooltipContainer, { isPrimitiveHeader: typeof headerContent === "string", children: [jsxRuntimeExports.jsx(HeaderContentWrapper, Object.assign({}, sortProps, { isPrimitiveHeader: typeof headerContent === "string", title: typeof headerContent === "string" ? headerContent : "", children: headerContent })), col.tooltip && jsxRuntimeExports.jsx(Tooltip, { content: col.tooltip, children: jsxRuntimeExports.jsx(TooltipIcon, { icon: faCircleQuestion }) })] }),
|
|
39508
39567
|
showHeaderCellButtonContainer && jsxRuntimeExports.jsxs(HeaderCellButtonContainer, { children: [jsxRuntimeExports.jsxs(HeaderIconsWrapper, { children: [showSort && jsxRuntimeExports.jsx(HeaderIconWrapper, { children: jsxRuntimeExports.jsx(SortIcon, Object.assign({}, sortProps, { className: "tableSortArrow", icon: getSortIcon(col.isSorted, col.isSortedDesc), isSorted: col.isSorted })) }), showFilter ? jsxRuntimeExports.jsx(FilterContainer, { col }) : null, showOptions && jsxRuntimeExports.jsx(OptionsMenu, { allColumns, allowColumnHiding: allowHiding, numVisibleColumns, resetResizing, setAllFilters, style: tableOptionsStyle })] }), jsxRuntimeExports.jsx(ResizeBorder, Object.assign({}, resizerProps))] })
|
|
39509
39568
|
);
|
|
@@ -39512,28 +39571,15 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39512
39571
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39513
39572
|
useDeepCompare([tableProps, totalColumnsWidth, headerGroups])
|
|
39514
39573
|
);
|
|
39515
|
-
return jsxRuntimeExports.jsx(Wrapper$2, Object.assign({}, getTableProps(), { "$hasMaxRows": !!maxRows, className: `${className} ${hasFixedColumns ? "sticky" : ""}`, style: Object.assign({ height: maxRows ? (Math.min(rows.length, maxRows) + 1) *
|
|
39516
|
-
return jsxRuntimeExports.jsx(StyledFixedSizeList, { height, innerElementType: renderTable, itemCount: itemCount || rows.length, itemData: createItemData$1(width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns), itemSize:
|
|
39574
|
+
return jsxRuntimeExports.jsx(Wrapper$2, Object.assign({}, getTableProps(), { "$hasMaxRows": !!maxRows, className: `${className} ${hasFixedColumns ? "sticky" : ""}`, style: Object.assign({ height: maxRows ? (Math.min(rows.length, maxRows) + 1) * tableRowHeight : "100%" }, style), children: jsxRuntimeExports.jsx(AutoSizer, { children: ({ height, width }) => {
|
|
39575
|
+
return jsxRuntimeExports.jsx(StyledFixedSizeList, { height, innerElementType: renderTable, itemCount: itemCount || rows.length, itemData: createItemData$1(width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns, tableRowHeight), itemSize: tableRowHeight, onItemsRendered, style: {
|
|
39517
39576
|
overflowX: width < totalColumnsWidth ? "auto" : "hidden",
|
|
39518
|
-
overflowY: height < (rows.length + 1) *
|
|
39577
|
+
overflowY: height < (rows.length + 1) * tableRowHeight ? "auto" : "hidden"
|
|
39519
39578
|
}, width, children: RenderRow }, "table-list");
|
|
39520
39579
|
} }) }));
|
|
39521
39580
|
});
|
|
39522
39581
|
Table.displayName = "Table";
|
|
39523
|
-
Table.ActionColumn =
|
|
39524
|
-
const width = actions.includes(Actions.SELECT) ? 52 : actions.length * 24 + 24;
|
|
39525
|
-
return {
|
|
39526
|
-
Cell: ActionCell,
|
|
39527
|
-
Header: actions.includes(Actions.SELECT) && !disableSelectAll ? SelectHeader : "",
|
|
39528
|
-
accessor: accessor || "actions",
|
|
39529
|
-
actions,
|
|
39530
|
-
disableSortBy: true,
|
|
39531
|
-
maxWidth: width,
|
|
39532
|
-
minWidth: actions.includes(Actions.SELECT) ? 52 : 48,
|
|
39533
|
-
sticky: sticky || null,
|
|
39534
|
-
width
|
|
39535
|
-
};
|
|
39536
|
-
};
|
|
39582
|
+
Table.ActionColumn = createActionColumn;
|
|
39537
39583
|
Table.Actions = Actions;
|
|
39538
39584
|
Table.cells = cells;
|
|
39539
39585
|
styled.div`
|
|
@@ -45169,7 +45215,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
45169
45215
|
function baseAt(object2, paths) {
|
|
45170
45216
|
var index2 = -1, length = paths.length, result2 = Array2(length), skip = object2 == null;
|
|
45171
45217
|
while (++index2 < length) {
|
|
45172
|
-
result2[index2] = skip ? undefined$1 :
|
|
45218
|
+
result2[index2] = skip ? undefined$1 : get2(object2, paths[index2]);
|
|
45173
45219
|
}
|
|
45174
45220
|
return result2;
|
|
45175
45221
|
}
|
|
@@ -45614,7 +45660,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
45614
45660
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
45615
45661
|
}
|
|
45616
45662
|
return function(object2) {
|
|
45617
|
-
var objValue =
|
|
45663
|
+
var objValue = get2(object2, path);
|
|
45618
45664
|
return objValue === undefined$1 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
45619
45665
|
};
|
|
45620
45666
|
}
|
|
@@ -47208,7 +47254,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
47208
47254
|
}
|
|
47209
47255
|
return result2;
|
|
47210
47256
|
}
|
|
47211
|
-
function
|
|
47257
|
+
function concat2() {
|
|
47212
47258
|
var length = arguments.length;
|
|
47213
47259
|
if (!length) {
|
|
47214
47260
|
return [];
|
|
@@ -48369,7 +48415,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
48369
48415
|
function functionsIn(object2) {
|
|
48370
48416
|
return object2 == null ? [] : baseFunctions(object2, keysIn(object2));
|
|
48371
48417
|
}
|
|
48372
|
-
function
|
|
48418
|
+
function get2(object2, path, defaultValue) {
|
|
48373
48419
|
var result2 = object2 == null ? undefined$1 : baseGet(object2, path);
|
|
48374
48420
|
return result2 === undefined$1 ? defaultValue : result2;
|
|
48375
48421
|
}
|
|
@@ -49056,7 +49102,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
49056
49102
|
lodash2.chain = chain;
|
|
49057
49103
|
lodash2.chunk = chunk;
|
|
49058
49104
|
lodash2.compact = compact;
|
|
49059
|
-
lodash2.concat =
|
|
49105
|
+
lodash2.concat = concat2;
|
|
49060
49106
|
lodash2.cond = cond;
|
|
49061
49107
|
lodash2.conforms = conforms;
|
|
49062
49108
|
lodash2.constant = constant;
|
|
@@ -49227,7 +49273,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
49227
49273
|
lodash2.forInRight = forInRight;
|
|
49228
49274
|
lodash2.forOwn = forOwn;
|
|
49229
49275
|
lodash2.forOwnRight = forOwnRight;
|
|
49230
|
-
lodash2.get =
|
|
49276
|
+
lodash2.get = get2;
|
|
49231
49277
|
lodash2.gt = gt2;
|
|
49232
49278
|
lodash2.gte = gte;
|
|
49233
49279
|
lodash2.has = has;
|
|
@@ -50776,6 +50822,9 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
50776
50822
|
function isStateVariable(variable) {
|
|
50777
50823
|
return isVariable(variable) && variable.__typename === "StateVariable";
|
|
50778
50824
|
}
|
|
50825
|
+
function isStreamVariable(variable) {
|
|
50826
|
+
return isVariable(variable) && variable.__typename === "StreamVariable";
|
|
50827
|
+
}
|
|
50779
50828
|
function isResolvedDerivedVariable(value) {
|
|
50780
50829
|
return value && typeof value === "object" && "values" in value && "type" in value && value.type === "derived" && "uid" in value;
|
|
50781
50830
|
}
|
|
@@ -50925,12 +50974,22 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
50925
50974
|
await validateResponse(res, `Failed to cancel task with id: ${taskId}`);
|
|
50926
50975
|
return true;
|
|
50927
50976
|
}
|
|
50977
|
+
function serializeNestedKey$1(key) {
|
|
50978
|
+
if (typeof key === "string") {
|
|
50979
|
+
return key;
|
|
50980
|
+
}
|
|
50981
|
+
if (isLoopVariable(key)) {
|
|
50982
|
+
const loopNested = key.nested.join(",");
|
|
50983
|
+
return `LoopVar:${key.uid}:${loopNested}`;
|
|
50984
|
+
}
|
|
50985
|
+
return String(key);
|
|
50986
|
+
}
|
|
50928
50987
|
function getUniqueIdentifier(variable, opts = {
|
|
50929
50988
|
useNested: true
|
|
50930
50989
|
}) {
|
|
50931
50990
|
let identifier = variable.uid;
|
|
50932
50991
|
if (opts.useNested && "nested" in variable) {
|
|
50933
|
-
identifier += variable.nested.join(",");
|
|
50992
|
+
identifier += variable.nested.map(serializeNestedKey$1).join(",");
|
|
50934
50993
|
}
|
|
50935
50994
|
return identifier;
|
|
50936
50995
|
}
|
|
@@ -50940,6 +50999,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
50940
50999
|
const selectorRegistry = /* @__PURE__ */ new Map();
|
|
50941
51000
|
const selectorFamilyRegistry = /* @__PURE__ */ new Map();
|
|
50942
51001
|
const selectorFamilyMembersRegistry = /* @__PURE__ */ new Map();
|
|
51002
|
+
const streamAtomRegistry = /* @__PURE__ */ new Map();
|
|
50943
51003
|
const depsRegistry = /* @__PURE__ */ new Map();
|
|
50944
51004
|
const SHARED_KEY_TYPES = ["result-selector", "derived-selector"];
|
|
50945
51005
|
function getRegistryKey(variable, type) {
|
|
@@ -50958,7 +51018,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
50958
51018
|
selectorRegistry,
|
|
50959
51019
|
depsRegistry,
|
|
50960
51020
|
selectorFamilyRegistry,
|
|
50961
|
-
selectorFamilyMembersRegistry
|
|
51021
|
+
selectorFamilyMembersRegistry,
|
|
51022
|
+
streamAtomRegistry
|
|
50962
51023
|
]) {
|
|
50963
51024
|
registry2.clear();
|
|
50964
51025
|
}
|
|
@@ -50983,6 +51044,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
50983
51044
|
const key = getRegistryKey(variable, "selector-nested");
|
|
50984
51045
|
return selectorFamilyRegistry.has(key);
|
|
50985
51046
|
}
|
|
51047
|
+
case "StreamVariable": {
|
|
51048
|
+
for (const atomKey of streamAtomRegistry.keys()) {
|
|
51049
|
+
if (atomKey.includes(`"uid":"${variable.uid}"`)) {
|
|
51050
|
+
return true;
|
|
51051
|
+
}
|
|
51052
|
+
}
|
|
51053
|
+
return false;
|
|
51054
|
+
}
|
|
50986
51055
|
default:
|
|
50987
51056
|
return false;
|
|
50988
51057
|
}
|
|
@@ -64509,22 +64578,15 @@ ${String(error)}`;
|
|
|
64509
64578
|
selectorFamilyRegistry.set(
|
|
64510
64579
|
key,
|
|
64511
64580
|
Recoil_index_11({
|
|
64512
|
-
get: (currentExtras) => ({ get }) => {
|
|
64513
|
-
const variableValue =
|
|
64514
|
-
return resolveNested(
|
|
64515
|
-
variableValue,
|
|
64516
|
-
variable.nested.map((n2) => String(n2))
|
|
64517
|
-
);
|
|
64581
|
+
get: (currentExtras) => ({ get: get2 }) => {
|
|
64582
|
+
const variableValue = get2(family(currentExtras));
|
|
64583
|
+
return resolveNested(variableValue, variable.nested);
|
|
64518
64584
|
},
|
|
64519
64585
|
key,
|
|
64520
64586
|
set: (currentExtras) => ({ set: set2 }, newValue) => {
|
|
64521
64587
|
set2(
|
|
64522
64588
|
family(currentExtras),
|
|
64523
|
-
(v) => setNested(
|
|
64524
|
-
v,
|
|
64525
|
-
variable.nested.map((n2) => String(n2)),
|
|
64526
|
-
newValue
|
|
64527
|
-
)
|
|
64589
|
+
(v) => setNested(v, variable.nested, newValue)
|
|
64528
64590
|
);
|
|
64529
64591
|
}
|
|
64530
64592
|
})
|
|
@@ -64555,10 +64617,20 @@ ${String(error)}`;
|
|
|
64555
64617
|
function isPlaceholder(value) {
|
|
64556
64618
|
return typeof value === "object" && "__ref" in value;
|
|
64557
64619
|
}
|
|
64620
|
+
function serializeNestedKey(key) {
|
|
64621
|
+
if (typeof key === "string") {
|
|
64622
|
+
return key;
|
|
64623
|
+
}
|
|
64624
|
+
if (isLoopVariable(key)) {
|
|
64625
|
+
const loopNested = key.nested.join(",");
|
|
64626
|
+
return `LoopVar:${key.uid}:${loopNested}`;
|
|
64627
|
+
}
|
|
64628
|
+
return String(key);
|
|
64629
|
+
}
|
|
64558
64630
|
function getIdentifier$1(variable) {
|
|
64559
64631
|
let id = `${variable.__typename}:${variable.uid}`;
|
|
64560
64632
|
if ("nested" in variable && variable.nested.length > 0) {
|
|
64561
|
-
id += `:${variable.nested.join(",")}`;
|
|
64633
|
+
id += `:${variable.nested.map(serializeNestedKey).join(",")}`;
|
|
64562
64634
|
}
|
|
64563
64635
|
return id;
|
|
64564
64636
|
}
|
|
@@ -64576,6 +64648,9 @@ ${String(error)}`;
|
|
|
64576
64648
|
const referrable = lookup[obj.__ref];
|
|
64577
64649
|
return denormalize(referrable, lookup);
|
|
64578
64650
|
}
|
|
64651
|
+
if (typeof obj !== "object") {
|
|
64652
|
+
return obj;
|
|
64653
|
+
}
|
|
64579
64654
|
const output = Array.isArray(obj) ? [] : {};
|
|
64580
64655
|
for (const [key, val] of getEntries(obj)) {
|
|
64581
64656
|
if (val !== null && typeof val === "object") {
|
|
@@ -69807,26 +69882,26 @@ ${String(error)}`;
|
|
|
69807
69882
|
cachePolicy_UNSTABLE: {
|
|
69808
69883
|
eviction: "most-recent"
|
|
69809
69884
|
},
|
|
69810
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
69885
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
69811
69886
|
const resolvedVariables = await Promise.all(
|
|
69812
69887
|
variable.variables.map(async (v) => {
|
|
69813
69888
|
if (!isVariable(v)) {
|
|
69814
69889
|
return Promise.resolve(v);
|
|
69815
69890
|
}
|
|
69816
|
-
return resolveVariable(v, wsClient, taskContext,
|
|
69891
|
+
return resolveVariable(v, wsClient, taskContext, extrasSerializable.extras);
|
|
69817
69892
|
})
|
|
69818
69893
|
);
|
|
69819
|
-
const selfTrigger =
|
|
69894
|
+
const selfTrigger = get2(getOrRegisterTrigger(variable));
|
|
69820
69895
|
const selectorKey = key + extrasSerializable.toJSON();
|
|
69821
69896
|
const triggerList = buildTriggerList(variable.variables);
|
|
69822
|
-
const triggers = registerChildTriggers(triggerList,
|
|
69897
|
+
const triggers = registerChildTriggers(triggerList, get2);
|
|
69823
69898
|
triggers.unshift(selfTrigger);
|
|
69824
69899
|
const derivedResult = resolveDerivedValue({
|
|
69825
69900
|
key: selectorKey,
|
|
69826
69901
|
variables: variable.variables,
|
|
69827
69902
|
deps: variable.deps,
|
|
69828
69903
|
resolvedVariables,
|
|
69829
|
-
resolutionStrategy: { name: "get", get },
|
|
69904
|
+
resolutionStrategy: { name: "get", get: get2 },
|
|
69830
69905
|
triggerList,
|
|
69831
69906
|
triggers
|
|
69832
69907
|
});
|
|
@@ -69856,7 +69931,7 @@ ${String(error)}`;
|
|
|
69856
69931
|
cachePolicy_UNSTABLE: {
|
|
69857
69932
|
eviction: "most-recent"
|
|
69858
69933
|
},
|
|
69859
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
69934
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
69860
69935
|
const selectorKey = key + extrasSerializable.toJSON();
|
|
69861
69936
|
const throwError = (error) => {
|
|
69862
69937
|
error.selectorId = key;
|
|
@@ -69876,7 +69951,7 @@ ${String(error)}`;
|
|
|
69876
69951
|
taskContext,
|
|
69877
69952
|
extrasSerializable.extras
|
|
69878
69953
|
);
|
|
69879
|
-
let derivedResult =
|
|
69954
|
+
let derivedResult = get2(dvResultSelector);
|
|
69880
69955
|
if (derivedResult.type === "previous") {
|
|
69881
69956
|
return derivedResult.entry.result;
|
|
69882
69957
|
}
|
|
@@ -69973,14 +70048,14 @@ ${String(error)}`;
|
|
|
69973
70048
|
selectorFamilyRegistry.set(
|
|
69974
70049
|
key,
|
|
69975
70050
|
Recoil_index_11({
|
|
69976
|
-
get: (extrasSerializable) => ({ get }) => {
|
|
70051
|
+
get: (extrasSerializable) => ({ get: get2 }) => {
|
|
69977
70052
|
const dvSelector = getOrRegisterDerivedVariableValue(
|
|
69978
70053
|
variable,
|
|
69979
70054
|
wsClient,
|
|
69980
70055
|
taskContext,
|
|
69981
70056
|
extrasSerializable.extras
|
|
69982
70057
|
);
|
|
69983
|
-
const value =
|
|
70058
|
+
const value = get2(dvSelector);
|
|
69984
70059
|
return "nested" in variable ? resolveNested(value, variable.nested) : value;
|
|
69985
70060
|
},
|
|
69986
70061
|
key: nanoid$1()
|
|
@@ -70047,168 +70122,193 @@ ${String(error)}`;
|
|
|
70047
70122
|
useInterval(trigger, variable.polling_interval);
|
|
70048
70123
|
return dvSelector;
|
|
70049
70124
|
}
|
|
70050
|
-
|
|
70051
|
-
|
|
70052
|
-
|
|
70053
|
-
|
|
70054
|
-
|
|
70055
|
-
var baseClone = require_baseClone();
|
|
70056
|
-
var CLONE_SYMBOLS_FLAG = 4;
|
|
70057
|
-
function clone2(value) {
|
|
70058
|
-
return baseClone(value, CLONE_SYMBOLS_FLAG);
|
|
70125
|
+
async function getBytes(stream, onChunk) {
|
|
70126
|
+
const reader = stream.getReader();
|
|
70127
|
+
let result;
|
|
70128
|
+
while (!(result = await reader.read()).done) {
|
|
70129
|
+
onChunk(result.value);
|
|
70059
70130
|
}
|
|
70060
|
-
clone_1 = clone2;
|
|
70061
|
-
return clone_1;
|
|
70062
70131
|
}
|
|
70063
|
-
|
|
70064
|
-
|
|
70065
|
-
|
|
70066
|
-
|
|
70067
|
-
|
|
70068
|
-
|
|
70069
|
-
|
|
70070
|
-
|
|
70071
|
-
|
|
70072
|
-
|
|
70073
|
-
|
|
70074
|
-
|
|
70075
|
-
return null;
|
|
70132
|
+
function getLines(onLine) {
|
|
70133
|
+
let buffer;
|
|
70134
|
+
let position;
|
|
70135
|
+
let fieldLength;
|
|
70136
|
+
let discardTrailingNewline = false;
|
|
70137
|
+
return function onChunk(arr) {
|
|
70138
|
+
if (buffer === void 0) {
|
|
70139
|
+
buffer = arr;
|
|
70140
|
+
position = 0;
|
|
70141
|
+
fieldLength = -1;
|
|
70142
|
+
} else {
|
|
70143
|
+
buffer = concat(buffer, arr);
|
|
70076
70144
|
}
|
|
70077
|
-
|
|
70078
|
-
|
|
70079
|
-
|
|
70080
|
-
|
|
70081
|
-
|
|
70082
|
-
|
|
70083
|
-
|
|
70084
|
-
|
|
70085
|
-
|
|
70086
|
-
|
|
70087
|
-
|
|
70088
|
-
|
|
70089
|
-
|
|
70090
|
-
|
|
70091
|
-
|
|
70092
|
-
|
|
70093
|
-
|
|
70094
|
-
|
|
70095
|
-
|
|
70096
|
-
|
|
70097
|
-
|
|
70098
|
-
|
|
70099
|
-
|
|
70100
|
-
|
|
70101
|
-
|
|
70102
|
-
|
|
70103
|
-
|
|
70104
|
-
|
|
70105
|
-
|
|
70106
|
-
|
|
70107
|
-
values,
|
|
70108
|
-
nested: variable.nested
|
|
70109
|
-
};
|
|
70110
|
-
}
|
|
70111
|
-
if (isServerVariable(variable)) {
|
|
70112
|
-
getOrRegisterServerVariable(variable, extras);
|
|
70113
|
-
return resolveServerVariable(variable, extras, resolver);
|
|
70114
|
-
}
|
|
70115
|
-
if (isSwitchVariable(variable)) {
|
|
70116
|
-
let resolvedValue = isVariable(variable.value) ? await resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
|
|
70117
|
-
if (isCondition(resolvedValue)) {
|
|
70118
|
-
resolvedValue = {
|
|
70119
|
-
...resolvedValue,
|
|
70120
|
-
variable: await resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
|
|
70121
|
-
};
|
|
70145
|
+
const bufLength = buffer.length;
|
|
70146
|
+
let lineStart = 0;
|
|
70147
|
+
while (position < bufLength) {
|
|
70148
|
+
if (discardTrailingNewline) {
|
|
70149
|
+
if (buffer[position] === 10) {
|
|
70150
|
+
lineStart = ++position;
|
|
70151
|
+
}
|
|
70152
|
+
discardTrailingNewline = false;
|
|
70153
|
+
}
|
|
70154
|
+
let lineEnd = -1;
|
|
70155
|
+
for (; position < bufLength && lineEnd === -1; ++position) {
|
|
70156
|
+
switch (buffer[position]) {
|
|
70157
|
+
case 58:
|
|
70158
|
+
if (fieldLength === -1) {
|
|
70159
|
+
fieldLength = position - lineStart;
|
|
70160
|
+
}
|
|
70161
|
+
break;
|
|
70162
|
+
case 13:
|
|
70163
|
+
discardTrailingNewline = true;
|
|
70164
|
+
case 10:
|
|
70165
|
+
lineEnd = position;
|
|
70166
|
+
break;
|
|
70167
|
+
}
|
|
70168
|
+
}
|
|
70169
|
+
if (lineEnd === -1) {
|
|
70170
|
+
break;
|
|
70171
|
+
}
|
|
70172
|
+
onLine(buffer.subarray(lineStart, lineEnd), fieldLength);
|
|
70173
|
+
lineStart = position;
|
|
70174
|
+
fieldLength = -1;
|
|
70122
70175
|
}
|
|
70123
|
-
|
|
70124
|
-
|
|
70125
|
-
|
|
70126
|
-
|
|
70127
|
-
|
|
70128
|
-
|
|
70129
|
-
|
|
70130
|
-
default: resolvedDefault
|
|
70131
|
-
};
|
|
70132
|
-
}
|
|
70133
|
-
if (isStateVariable(variable)) {
|
|
70134
|
-
throw new Error("StateVariable should not be resolved - it should be handled by useVariable hook");
|
|
70135
|
-
}
|
|
70136
|
-
return resolver(getOrRegisterPlainVariable(variable, client2, taskContext, extras));
|
|
70176
|
+
if (lineStart === bufLength) {
|
|
70177
|
+
buffer = void 0;
|
|
70178
|
+
} else if (lineStart !== 0) {
|
|
70179
|
+
buffer = buffer.subarray(lineStart);
|
|
70180
|
+
position -= lineStart;
|
|
70181
|
+
}
|
|
70182
|
+
};
|
|
70137
70183
|
}
|
|
70138
|
-
function
|
|
70139
|
-
|
|
70140
|
-
|
|
70141
|
-
|
|
70142
|
-
|
|
70143
|
-
|
|
70144
|
-
|
|
70145
|
-
|
|
70146
|
-
|
|
70147
|
-
|
|
70148
|
-
|
|
70149
|
-
|
|
70150
|
-
|
|
70151
|
-
|
|
70152
|
-
|
|
70153
|
-
|
|
70154
|
-
|
|
70155
|
-
|
|
70156
|
-
|
|
70157
|
-
|
|
70158
|
-
|
|
70159
|
-
|
|
70184
|
+
function getMessages(onId, onRetry, onMessage) {
|
|
70185
|
+
let message = newMessage();
|
|
70186
|
+
const decoder = new TextDecoder();
|
|
70187
|
+
return function onLine(line, fieldLength) {
|
|
70188
|
+
if (line.length === 0) {
|
|
70189
|
+
onMessage === null || onMessage === void 0 ? void 0 : onMessage(message);
|
|
70190
|
+
message = newMessage();
|
|
70191
|
+
} else if (fieldLength > 0) {
|
|
70192
|
+
const field = decoder.decode(line.subarray(0, fieldLength));
|
|
70193
|
+
const valueOffset = fieldLength + (line[fieldLength + 1] === 32 ? 2 : 1);
|
|
70194
|
+
const value = decoder.decode(line.subarray(valueOffset));
|
|
70195
|
+
switch (field) {
|
|
70196
|
+
case "data":
|
|
70197
|
+
message.data = message.data ? message.data + "\n" + value : value;
|
|
70198
|
+
break;
|
|
70199
|
+
case "event":
|
|
70200
|
+
message.event = value;
|
|
70201
|
+
break;
|
|
70202
|
+
case "id":
|
|
70203
|
+
onId(message.id = value);
|
|
70204
|
+
break;
|
|
70205
|
+
case "retry":
|
|
70206
|
+
const retry = parseInt(value, 10);
|
|
70207
|
+
if (!isNaN(retry)) {
|
|
70208
|
+
onRetry(message.retry = retry);
|
|
70209
|
+
}
|
|
70210
|
+
break;
|
|
70211
|
+
}
|
|
70160
70212
|
}
|
|
70161
|
-
|
|
70162
|
-
const resolvedDefault = isVariable(variable.default) ? resolveVariableStatic(variable.default, snapshot, params) : variable.default;
|
|
70163
|
-
return {
|
|
70164
|
-
type: "switch",
|
|
70165
|
-
uid: variable.uid,
|
|
70166
|
-
value: resolvedValue,
|
|
70167
|
-
value_map: resolvedValueMap,
|
|
70168
|
-
default: resolvedDefault
|
|
70169
|
-
};
|
|
70170
|
-
}
|
|
70171
|
-
if (isStateVariable(variable)) {
|
|
70172
|
-
throw new Error("StateVariable should not be resolved - it should be handled by useVariable hook");
|
|
70173
|
-
}
|
|
70174
|
-
let result = resolvePlainVariableStatic(variable, snapshot, params);
|
|
70175
|
-
while (isDerivedVariable(result)) {
|
|
70176
|
-
result = resolveVariableStatic(result, snapshot, params);
|
|
70177
|
-
}
|
|
70178
|
-
return result;
|
|
70213
|
+
};
|
|
70179
70214
|
}
|
|
70180
|
-
function
|
|
70181
|
-
|
|
70182
|
-
|
|
70183
|
-
|
|
70184
|
-
|
|
70185
|
-
...rest,
|
|
70186
|
-
// Use override if provided, otherwise use the embedded force_key from the resolved variable
|
|
70187
|
-
force_key: forceKeyOverride ?? (value.force_key || null),
|
|
70188
|
-
values: cleanedValues
|
|
70189
|
-
};
|
|
70190
|
-
}
|
|
70191
|
-
if (isResolvedSwitchVariable(value)) {
|
|
70192
|
-
return {
|
|
70193
|
-
...value,
|
|
70194
|
-
value: cleanValue(value.value, forceKeyOverride),
|
|
70195
|
-
value_map: cleanValue(value.value_map, forceKeyOverride),
|
|
70196
|
-
default: cleanValue(value.default, forceKeyOverride)
|
|
70197
|
-
};
|
|
70198
|
-
}
|
|
70199
|
-
return value;
|
|
70215
|
+
function concat(a2, b2) {
|
|
70216
|
+
const res = new Uint8Array(a2.length + b2.length);
|
|
70217
|
+
res.set(a2);
|
|
70218
|
+
res.set(b2, a2.length);
|
|
70219
|
+
return res;
|
|
70200
70220
|
}
|
|
70201
|
-
function
|
|
70202
|
-
return
|
|
70203
|
-
|
|
70204
|
-
|
|
70205
|
-
|
|
70206
|
-
|
|
70207
|
-
|
|
70208
|
-
);
|
|
70221
|
+
function newMessage() {
|
|
70222
|
+
return {
|
|
70223
|
+
data: "",
|
|
70224
|
+
event: "",
|
|
70225
|
+
id: "",
|
|
70226
|
+
retry: void 0
|
|
70227
|
+
};
|
|
70209
70228
|
}
|
|
70210
|
-
function
|
|
70211
|
-
|
|
70229
|
+
var __rest = function(s, e2) {
|
|
70230
|
+
var t2 = {};
|
|
70231
|
+
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
70232
|
+
t2[p2] = s[p2];
|
|
70233
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
70234
|
+
for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s); i2 < p2.length; i2++) {
|
|
70235
|
+
if (e2.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i2]))
|
|
70236
|
+
t2[p2[i2]] = s[p2[i2]];
|
|
70237
|
+
}
|
|
70238
|
+
return t2;
|
|
70239
|
+
};
|
|
70240
|
+
const EventStreamContentType = "text/event-stream";
|
|
70241
|
+
const DefaultRetryInterval = 1e3;
|
|
70242
|
+
const LastEventId = "last-event-id";
|
|
70243
|
+
function fetchEventSource(input, _a) {
|
|
70244
|
+
var { signal: inputSignal, headers: inputHeaders, onopen: inputOnOpen, onmessage, onclose, onerror, openWhenHidden, fetch: inputFetch } = _a, rest = __rest(_a, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
70245
|
+
return new Promise((resolve, reject) => {
|
|
70246
|
+
const headers = Object.assign({}, inputHeaders);
|
|
70247
|
+
if (!headers.accept) {
|
|
70248
|
+
headers.accept = EventStreamContentType;
|
|
70249
|
+
}
|
|
70250
|
+
let curRequestController;
|
|
70251
|
+
function onVisibilityChange() {
|
|
70252
|
+
curRequestController.abort();
|
|
70253
|
+
if (!document.hidden) {
|
|
70254
|
+
create();
|
|
70255
|
+
}
|
|
70256
|
+
}
|
|
70257
|
+
if (!openWhenHidden) {
|
|
70258
|
+
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
70259
|
+
}
|
|
70260
|
+
let retryInterval = DefaultRetryInterval;
|
|
70261
|
+
let retryTimer = 0;
|
|
70262
|
+
function dispose() {
|
|
70263
|
+
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
70264
|
+
window.clearTimeout(retryTimer);
|
|
70265
|
+
curRequestController.abort();
|
|
70266
|
+
}
|
|
70267
|
+
inputSignal === null || inputSignal === void 0 ? void 0 : inputSignal.addEventListener("abort", () => {
|
|
70268
|
+
dispose();
|
|
70269
|
+
resolve();
|
|
70270
|
+
});
|
|
70271
|
+
const fetch2 = inputFetch !== null && inputFetch !== void 0 ? inputFetch : window.fetch;
|
|
70272
|
+
const onopen = inputOnOpen !== null && inputOnOpen !== void 0 ? inputOnOpen : defaultOnOpen;
|
|
70273
|
+
async function create() {
|
|
70274
|
+
var _a2;
|
|
70275
|
+
curRequestController = new AbortController();
|
|
70276
|
+
try {
|
|
70277
|
+
const response = await fetch2(input, Object.assign(Object.assign({}, rest), { headers, signal: curRequestController.signal }));
|
|
70278
|
+
await onopen(response);
|
|
70279
|
+
await getBytes(response.body, getLines(getMessages((id) => {
|
|
70280
|
+
if (id) {
|
|
70281
|
+
headers[LastEventId] = id;
|
|
70282
|
+
} else {
|
|
70283
|
+
delete headers[LastEventId];
|
|
70284
|
+
}
|
|
70285
|
+
}, (retry) => {
|
|
70286
|
+
retryInterval = retry;
|
|
70287
|
+
}, onmessage)));
|
|
70288
|
+
onclose === null || onclose === void 0 ? void 0 : onclose();
|
|
70289
|
+
dispose();
|
|
70290
|
+
resolve();
|
|
70291
|
+
} catch (err2) {
|
|
70292
|
+
if (!curRequestController.signal.aborted) {
|
|
70293
|
+
try {
|
|
70294
|
+
const interval = (_a2 = onerror === null || onerror === void 0 ? void 0 : onerror(err2)) !== null && _a2 !== void 0 ? _a2 : retryInterval;
|
|
70295
|
+
window.clearTimeout(retryTimer);
|
|
70296
|
+
retryTimer = window.setTimeout(create, interval);
|
|
70297
|
+
} catch (innerErr) {
|
|
70298
|
+
dispose();
|
|
70299
|
+
reject(innerErr);
|
|
70300
|
+
}
|
|
70301
|
+
}
|
|
70302
|
+
}
|
|
70303
|
+
}
|
|
70304
|
+
create();
|
|
70305
|
+
});
|
|
70306
|
+
}
|
|
70307
|
+
function defaultOnOpen(response) {
|
|
70308
|
+
const contentType = response.headers.get("content-type");
|
|
70309
|
+
if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith(EventStreamContentType))) {
|
|
70310
|
+
throw new Error(`Expected content-type to be ${EventStreamContentType}, Actual: ${contentType}`);
|
|
70311
|
+
}
|
|
70212
70312
|
}
|
|
70213
70313
|
/*!
|
|
70214
70314
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
@@ -70846,6 +70946,584 @@ ${String(error)}`;
|
|
|
70846
70946
|
escapePathComponent,
|
|
70847
70947
|
unescapePathComponent
|
|
70848
70948
|
});
|
|
70949
|
+
var getExports = requireGet();
|
|
70950
|
+
const get = /* @__PURE__ */ getDefaultExportFromCjs(getExports);
|
|
70951
|
+
function extractKey(item, keyAccessor) {
|
|
70952
|
+
if (item === null || item === void 0) {
|
|
70953
|
+
return void 0;
|
|
70954
|
+
}
|
|
70955
|
+
const key = get(item, keyAccessor);
|
|
70956
|
+
if (typeof key === "string" || typeof key === "number") {
|
|
70957
|
+
return key;
|
|
70958
|
+
}
|
|
70959
|
+
return void 0;
|
|
70960
|
+
}
|
|
70961
|
+
function applyStreamEvent(currentState, event, keyAccessor) {
|
|
70962
|
+
switch (event.type) {
|
|
70963
|
+
// === Keyed mode events ===
|
|
70964
|
+
case "add": {
|
|
70965
|
+
if (keyAccessor === null) {
|
|
70966
|
+
console.warn(
|
|
70967
|
+
"StreamVariable: add() event received but no key_accessor is set. Use json_snapshot/json_patch instead."
|
|
70968
|
+
);
|
|
70969
|
+
return currentState;
|
|
70970
|
+
}
|
|
70971
|
+
const items = Array.isArray(event.data) ? event.data : [event.data];
|
|
70972
|
+
let newData = currentState.data ?? {};
|
|
70973
|
+
for (const item of items) {
|
|
70974
|
+
const key = extractKey(item, keyAccessor);
|
|
70975
|
+
if (key === void 0) {
|
|
70976
|
+
console.warn(
|
|
70977
|
+
`StreamVariable: Could not extract key using accessor '${keyAccessor}' from item:`,
|
|
70978
|
+
item
|
|
70979
|
+
);
|
|
70980
|
+
continue;
|
|
70981
|
+
}
|
|
70982
|
+
newData = { ...newData, [key]: item };
|
|
70983
|
+
}
|
|
70984
|
+
return {
|
|
70985
|
+
...currentState,
|
|
70986
|
+
data: newData,
|
|
70987
|
+
status: "connected",
|
|
70988
|
+
error: void 0
|
|
70989
|
+
};
|
|
70990
|
+
}
|
|
70991
|
+
case "remove": {
|
|
70992
|
+
if (keyAccessor === null) {
|
|
70993
|
+
console.warn(
|
|
70994
|
+
"StreamVariable: remove() event received but no key_accessor is set. Use json_snapshot/json_patch instead."
|
|
70995
|
+
);
|
|
70996
|
+
return currentState;
|
|
70997
|
+
}
|
|
70998
|
+
const keys = Array.isArray(event.data) ? event.data : [event.data];
|
|
70999
|
+
const currentData = currentState.data ?? {};
|
|
71000
|
+
const newData = { ...currentData };
|
|
71001
|
+
for (const key of keys) {
|
|
71002
|
+
if (typeof key === "string" || typeof key === "number") {
|
|
71003
|
+
delete newData[key];
|
|
71004
|
+
}
|
|
71005
|
+
}
|
|
71006
|
+
return {
|
|
71007
|
+
...currentState,
|
|
71008
|
+
data: newData,
|
|
71009
|
+
status: "connected",
|
|
71010
|
+
error: void 0
|
|
71011
|
+
};
|
|
71012
|
+
}
|
|
71013
|
+
case "clear": {
|
|
71014
|
+
return {
|
|
71015
|
+
...currentState,
|
|
71016
|
+
data: {},
|
|
71017
|
+
status: "connected",
|
|
71018
|
+
error: void 0
|
|
71019
|
+
};
|
|
71020
|
+
}
|
|
71021
|
+
case "replace": {
|
|
71022
|
+
if (keyAccessor === null) {
|
|
71023
|
+
console.warn(
|
|
71024
|
+
"StreamVariable: replace() event received but no key_accessor is set. Use json_snapshot instead."
|
|
71025
|
+
);
|
|
71026
|
+
return currentState;
|
|
71027
|
+
}
|
|
71028
|
+
const items = Array.isArray(event.data) ? event.data : [];
|
|
71029
|
+
const newData = {};
|
|
71030
|
+
for (const item of items) {
|
|
71031
|
+
const key = extractKey(item, keyAccessor);
|
|
71032
|
+
if (key === void 0) {
|
|
71033
|
+
console.warn(
|
|
71034
|
+
`StreamVariable: Could not extract key using accessor '${keyAccessor}' from item:`,
|
|
71035
|
+
item
|
|
71036
|
+
);
|
|
71037
|
+
continue;
|
|
71038
|
+
}
|
|
71039
|
+
newData[key] = item;
|
|
71040
|
+
}
|
|
71041
|
+
return {
|
|
71042
|
+
...currentState,
|
|
71043
|
+
data: newData,
|
|
71044
|
+
status: "connected",
|
|
71045
|
+
error: void 0
|
|
71046
|
+
};
|
|
71047
|
+
}
|
|
71048
|
+
// === Custom state mode events ===
|
|
71049
|
+
case "json_snapshot":
|
|
71050
|
+
return {
|
|
71051
|
+
...currentState,
|
|
71052
|
+
data: event.data,
|
|
71053
|
+
status: "connected",
|
|
71054
|
+
error: void 0
|
|
71055
|
+
};
|
|
71056
|
+
case "json_patch": {
|
|
71057
|
+
if (currentState.data === void 0 || currentState.data === null) {
|
|
71058
|
+
console.warn(
|
|
71059
|
+
"StreamVariable: json_patch event received but no state exists. Send a json_snapshot first."
|
|
71060
|
+
);
|
|
71061
|
+
return currentState;
|
|
71062
|
+
}
|
|
71063
|
+
try {
|
|
71064
|
+
const operations = event.data;
|
|
71065
|
+
const { newDocument } = applyPatch(currentState.data, operations, true, false);
|
|
71066
|
+
return {
|
|
71067
|
+
...currentState,
|
|
71068
|
+
data: newDocument,
|
|
71069
|
+
status: "connected",
|
|
71070
|
+
error: void 0
|
|
71071
|
+
};
|
|
71072
|
+
} catch (e2) {
|
|
71073
|
+
console.error("StreamVariable: Failed to apply json_patch:", e2);
|
|
71074
|
+
return {
|
|
71075
|
+
...currentState,
|
|
71076
|
+
status: "error",
|
|
71077
|
+
error: `Patch failed: ${String(e2)}`
|
|
71078
|
+
};
|
|
71079
|
+
}
|
|
71080
|
+
}
|
|
71081
|
+
// === Control events ===
|
|
71082
|
+
case "reconnect":
|
|
71083
|
+
return {
|
|
71084
|
+
...currentState,
|
|
71085
|
+
status: "reconnecting"
|
|
71086
|
+
};
|
|
71087
|
+
case "error":
|
|
71088
|
+
return {
|
|
71089
|
+
...currentState,
|
|
71090
|
+
status: "error",
|
|
71091
|
+
error: typeof event.data === "string" ? event.data : "Unknown error"
|
|
71092
|
+
};
|
|
71093
|
+
default:
|
|
71094
|
+
console.warn(`StreamVariable: Unknown event type: ${event.type}`);
|
|
71095
|
+
return currentState;
|
|
71096
|
+
}
|
|
71097
|
+
}
|
|
71098
|
+
function getStreamValue(state, keyAccessor) {
|
|
71099
|
+
if (keyAccessor !== null && state.data !== null && typeof state.data === "object" && !Array.isArray(state.data)) {
|
|
71100
|
+
return Object.values(state.data);
|
|
71101
|
+
}
|
|
71102
|
+
return state.data;
|
|
71103
|
+
}
|
|
71104
|
+
const MAX_RETRIES = 5;
|
|
71105
|
+
const BASE_DELAY_MS = 1e3;
|
|
71106
|
+
const MAX_DELAY_MS = 3e4;
|
|
71107
|
+
function getBackoffDelay(retryCount) {
|
|
71108
|
+
return Math.min(BASE_DELAY_MS * 2 ** retryCount, MAX_DELAY_MS);
|
|
71109
|
+
}
|
|
71110
|
+
function serializeAtomParams(params) {
|
|
71111
|
+
return JSON.stringify(params);
|
|
71112
|
+
}
|
|
71113
|
+
function deserializeAtomParams(key) {
|
|
71114
|
+
return JSON.parse(key);
|
|
71115
|
+
}
|
|
71116
|
+
const activeConnections = /* @__PURE__ */ new Map();
|
|
71117
|
+
const INITIAL_CONNECTED_STATE = {
|
|
71118
|
+
data: void 0,
|
|
71119
|
+
status: "connected"
|
|
71120
|
+
};
|
|
71121
|
+
function startStreamConnection(params, callbacks) {
|
|
71122
|
+
const connectionKey = serializeAtomParams(params);
|
|
71123
|
+
const existingController = activeConnections.get(connectionKey);
|
|
71124
|
+
if (existingController) {
|
|
71125
|
+
existingController.abort();
|
|
71126
|
+
}
|
|
71127
|
+
const controller = new AbortController();
|
|
71128
|
+
activeConnections.set(connectionKey, controller);
|
|
71129
|
+
let retryCount = 0;
|
|
71130
|
+
let isFirstMessage = true;
|
|
71131
|
+
let currentState = INITIAL_CONNECTED_STATE;
|
|
71132
|
+
const normalizedValues = normalizeRequest(params.resolvedValues, params.variables);
|
|
71133
|
+
fetchEventSource(`/api/core/stream/${params.uid}`, {
|
|
71134
|
+
method: HTTP_METHOD.POST,
|
|
71135
|
+
body: JSON.stringify({ values: normalizedValues }),
|
|
71136
|
+
signal: controller.signal,
|
|
71137
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
71138
|
+
onopen: async (response) => {
|
|
71139
|
+
if (response.ok) {
|
|
71140
|
+
retryCount = 0;
|
|
71141
|
+
return;
|
|
71142
|
+
}
|
|
71143
|
+
const error = new Error(`Stream request failed: ${response.status} ${response.statusText}`);
|
|
71144
|
+
throw error;
|
|
71145
|
+
},
|
|
71146
|
+
onmessage: (msg) => {
|
|
71147
|
+
let event;
|
|
71148
|
+
try {
|
|
71149
|
+
event = JSON.parse(msg.data);
|
|
71150
|
+
} catch (parseError) {
|
|
71151
|
+
console.error("Failed to parse SSE event:", parseError, msg.data);
|
|
71152
|
+
return;
|
|
71153
|
+
}
|
|
71154
|
+
if (event.type === "reconnect") {
|
|
71155
|
+
console.info("StreamVariable: Server requested reconnect, reconnecting...");
|
|
71156
|
+
throw new Error("Server requested reconnect");
|
|
71157
|
+
}
|
|
71158
|
+
currentState = applyStreamEvent(currentState, event, params.keyAccessor);
|
|
71159
|
+
if (isFirstMessage) {
|
|
71160
|
+
isFirstMessage = false;
|
|
71161
|
+
callbacks.onFirstData(currentState);
|
|
71162
|
+
} else {
|
|
71163
|
+
callbacks.onUpdate(currentState);
|
|
71164
|
+
}
|
|
71165
|
+
},
|
|
71166
|
+
onerror: (err2) => {
|
|
71167
|
+
if (controller.signal.aborted) {
|
|
71168
|
+
return;
|
|
71169
|
+
}
|
|
71170
|
+
retryCount++;
|
|
71171
|
+
if (retryCount > MAX_RETRIES) {
|
|
71172
|
+
callbacks.onError(err2 instanceof Error ? err2.message : String(err2));
|
|
71173
|
+
return;
|
|
71174
|
+
}
|
|
71175
|
+
const delay2 = getBackoffDelay(retryCount - 1);
|
|
71176
|
+
console.warn(`Stream connection failed, retrying in ${delay2}ms (attempt ${retryCount}/${MAX_RETRIES})...`);
|
|
71177
|
+
return delay2;
|
|
71178
|
+
},
|
|
71179
|
+
onclose: () => {
|
|
71180
|
+
},
|
|
71181
|
+
// Use our request wrapper for auth headers
|
|
71182
|
+
// @ts-expect-error - fetch signature differs slightly but works
|
|
71183
|
+
fetch: request,
|
|
71184
|
+
// Pass through extras (headers, etc.)
|
|
71185
|
+
...params.extras,
|
|
71186
|
+
// @ts-expect-error - Headers type doesn't match exactly
|
|
71187
|
+
headers: params.extras.headers
|
|
71188
|
+
});
|
|
71189
|
+
return () => {
|
|
71190
|
+
controller.abort();
|
|
71191
|
+
activeConnections.delete(connectionKey);
|
|
71192
|
+
};
|
|
71193
|
+
}
|
|
71194
|
+
function streamConnectionEffect(atomKey) {
|
|
71195
|
+
return ({ setSelf }) => {
|
|
71196
|
+
const params = deserializeAtomParams(atomKey);
|
|
71197
|
+
let resolveInitialData = null;
|
|
71198
|
+
let rejectInitialData = null;
|
|
71199
|
+
const initialDataPromise = new Promise((resolve, reject) => {
|
|
71200
|
+
resolveInitialData = resolve;
|
|
71201
|
+
rejectInitialData = reject;
|
|
71202
|
+
});
|
|
71203
|
+
setSelf(initialDataPromise);
|
|
71204
|
+
const cleanup = startStreamConnection(params, {
|
|
71205
|
+
onFirstData: (state) => {
|
|
71206
|
+
if (resolveInitialData) {
|
|
71207
|
+
resolveInitialData(state);
|
|
71208
|
+
resolveInitialData = null;
|
|
71209
|
+
rejectInitialData = null;
|
|
71210
|
+
}
|
|
71211
|
+
setSelf(state);
|
|
71212
|
+
},
|
|
71213
|
+
onUpdate: (state) => {
|
|
71214
|
+
setSelf(state);
|
|
71215
|
+
},
|
|
71216
|
+
onError: (error) => {
|
|
71217
|
+
if (rejectInitialData) {
|
|
71218
|
+
rejectInitialData(new Error(error));
|
|
71219
|
+
resolveInitialData = null;
|
|
71220
|
+
rejectInitialData = null;
|
|
71221
|
+
} else {
|
|
71222
|
+
setSelf({
|
|
71223
|
+
data: void 0,
|
|
71224
|
+
status: "error",
|
|
71225
|
+
error
|
|
71226
|
+
});
|
|
71227
|
+
}
|
|
71228
|
+
}
|
|
71229
|
+
});
|
|
71230
|
+
return cleanup;
|
|
71231
|
+
};
|
|
71232
|
+
}
|
|
71233
|
+
const streamAtomFamily = Recoil_index_10({
|
|
71234
|
+
key: "StreamVariable/state",
|
|
71235
|
+
effects: (atomKey) => [streamConnectionEffect(atomKey)]
|
|
71236
|
+
});
|
|
71237
|
+
function getStreamRegistryKey(variable, suffix) {
|
|
71238
|
+
return `StreamVariable:${getUniqueIdentifier(variable, { useNested: false })}:${suffix}`;
|
|
71239
|
+
}
|
|
71240
|
+
function getOrRegisterStreamVariableParams(variable, client2, taskContext, extras) {
|
|
71241
|
+
const key = getStreamRegistryKey(variable, "params-selector");
|
|
71242
|
+
if (!selectorFamilyRegistry.has(key)) {
|
|
71243
|
+
selectorFamilyRegistry.set(
|
|
71244
|
+
key,
|
|
71245
|
+
Recoil_index_11({
|
|
71246
|
+
key: nanoid$1(),
|
|
71247
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
71248
|
+
const resolvedVariables = await Promise.all(
|
|
71249
|
+
variable.variables.map(async (v) => {
|
|
71250
|
+
if (!isVariable(v)) {
|
|
71251
|
+
return v;
|
|
71252
|
+
}
|
|
71253
|
+
return resolveVariable(v, client2, taskContext, extrasSerializable.extras);
|
|
71254
|
+
})
|
|
71255
|
+
);
|
|
71256
|
+
const triggerList = buildTriggerList(variable.variables);
|
|
71257
|
+
registerChildTriggers(triggerList, get2);
|
|
71258
|
+
const resolvedValues = resolvedVariables.map((v) => resolveValue(v, get2));
|
|
71259
|
+
const params = {
|
|
71260
|
+
uid: variable.uid,
|
|
71261
|
+
resolvedValues,
|
|
71262
|
+
variables: variable.variables,
|
|
71263
|
+
keyAccessor: variable.key_accessor,
|
|
71264
|
+
extras: extrasSerializable.extras
|
|
71265
|
+
};
|
|
71266
|
+
return serializeAtomParams(params);
|
|
71267
|
+
}
|
|
71268
|
+
})
|
|
71269
|
+
);
|
|
71270
|
+
}
|
|
71271
|
+
const family = selectorFamilyRegistry.get(key);
|
|
71272
|
+
const serializableExtras = new RequestExtrasSerializable(extras);
|
|
71273
|
+
const selectorInstance = family(serializableExtras);
|
|
71274
|
+
if (!selectorFamilyMembersRegistry.has(family)) {
|
|
71275
|
+
selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
|
|
71276
|
+
}
|
|
71277
|
+
selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
|
|
71278
|
+
return selectorInstance;
|
|
71279
|
+
}
|
|
71280
|
+
function getOrRegisterStreamVariableValue(variable, client2, taskContext, extras) {
|
|
71281
|
+
const key = getStreamRegistryKey(variable, "value-selector");
|
|
71282
|
+
if (!selectorFamilyRegistry.has(key)) {
|
|
71283
|
+
selectorFamilyRegistry.set(
|
|
71284
|
+
key,
|
|
71285
|
+
Recoil_index_11({
|
|
71286
|
+
key: nanoid$1(),
|
|
71287
|
+
get: (extrasSerializable) => ({ get: get2 }) => {
|
|
71288
|
+
const paramsSelector = getOrRegisterStreamVariableParams(
|
|
71289
|
+
variable,
|
|
71290
|
+
client2,
|
|
71291
|
+
taskContext,
|
|
71292
|
+
extrasSerializable.extras
|
|
71293
|
+
);
|
|
71294
|
+
const atomKey = get2(paramsSelector);
|
|
71295
|
+
const atom2 = streamAtomFamily(atomKey);
|
|
71296
|
+
if (!streamAtomRegistry.has(atomKey)) {
|
|
71297
|
+
streamAtomRegistry.set(atomKey, atom2);
|
|
71298
|
+
}
|
|
71299
|
+
const streamState = get2(atom2);
|
|
71300
|
+
return getStreamValue(streamState, variable.key_accessor);
|
|
71301
|
+
}
|
|
71302
|
+
})
|
|
71303
|
+
);
|
|
71304
|
+
}
|
|
71305
|
+
const family = selectorFamilyRegistry.get(key);
|
|
71306
|
+
const serializableExtras = new RequestExtrasSerializable(extras);
|
|
71307
|
+
const selectorInstance = family(serializableExtras);
|
|
71308
|
+
if (!selectorFamilyMembersRegistry.has(family)) {
|
|
71309
|
+
selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
|
|
71310
|
+
}
|
|
71311
|
+
selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
|
|
71312
|
+
return selectorInstance;
|
|
71313
|
+
}
|
|
71314
|
+
function getOrRegisterStreamVariable(variable, client2, taskContext, extras) {
|
|
71315
|
+
const key = `StreamVariable:${getUniqueIdentifier(variable, { useNested: true })}:nested-selector`;
|
|
71316
|
+
if (!selectorFamilyRegistry.has(key)) {
|
|
71317
|
+
selectorFamilyRegistry.set(
|
|
71318
|
+
key,
|
|
71319
|
+
Recoil_index_11({
|
|
71320
|
+
key: nanoid$1(),
|
|
71321
|
+
get: (extrasSerializable) => ({ get: get2 }) => {
|
|
71322
|
+
const valueSelector = getOrRegisterStreamVariableValue(
|
|
71323
|
+
variable,
|
|
71324
|
+
client2,
|
|
71325
|
+
taskContext,
|
|
71326
|
+
extrasSerializable.extras
|
|
71327
|
+
);
|
|
71328
|
+
const value = get2(valueSelector);
|
|
71329
|
+
return "nested" in variable ? resolveNested(value, variable.nested) : value;
|
|
71330
|
+
}
|
|
71331
|
+
})
|
|
71332
|
+
);
|
|
71333
|
+
}
|
|
71334
|
+
const family = selectorFamilyRegistry.get(key);
|
|
71335
|
+
const serializableExtras = new RequestExtrasSerializable(extras);
|
|
71336
|
+
const selectorInstance = family(serializableExtras);
|
|
71337
|
+
if (!selectorFamilyMembersRegistry.has(family)) {
|
|
71338
|
+
selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
|
|
71339
|
+
}
|
|
71340
|
+
selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
|
|
71341
|
+
return selectorInstance;
|
|
71342
|
+
}
|
|
71343
|
+
var clone_1;
|
|
71344
|
+
var hasRequiredClone;
|
|
71345
|
+
function requireClone() {
|
|
71346
|
+
if (hasRequiredClone) return clone_1;
|
|
71347
|
+
hasRequiredClone = 1;
|
|
71348
|
+
var baseClone = require_baseClone();
|
|
71349
|
+
var CLONE_SYMBOLS_FLAG = 4;
|
|
71350
|
+
function clone2(value) {
|
|
71351
|
+
return baseClone(value, CLONE_SYMBOLS_FLAG);
|
|
71352
|
+
}
|
|
71353
|
+
clone_1 = clone2;
|
|
71354
|
+
return clone_1;
|
|
71355
|
+
}
|
|
71356
|
+
var cloneExports = requireClone();
|
|
71357
|
+
const clone = /* @__PURE__ */ getDefaultExportFromCjs(cloneExports);
|
|
71358
|
+
function resolveNested(obj, nested) {
|
|
71359
|
+
if (!nested || nested.length === 0) {
|
|
71360
|
+
return obj;
|
|
71361
|
+
}
|
|
71362
|
+
if (!obj || !(typeof obj === "object" && !Array.isArray(obj))) {
|
|
71363
|
+
return obj;
|
|
71364
|
+
}
|
|
71365
|
+
let returnVal = obj;
|
|
71366
|
+
for (const key of nested) {
|
|
71367
|
+
const stringKey = key;
|
|
71368
|
+
if (!Object.keys(returnVal).includes(stringKey)) {
|
|
71369
|
+
return null;
|
|
71370
|
+
}
|
|
71371
|
+
returnVal = returnVal[stringKey];
|
|
71372
|
+
}
|
|
71373
|
+
return returnVal;
|
|
71374
|
+
}
|
|
71375
|
+
function setNested(obj, nested, newValue) {
|
|
71376
|
+
if (!nested || nested.length === 0) {
|
|
71377
|
+
return copy(obj);
|
|
71378
|
+
}
|
|
71379
|
+
if (!obj || !(typeof obj === "object" && !Array.isArray(obj))) {
|
|
71380
|
+
return copy(obj);
|
|
71381
|
+
}
|
|
71382
|
+
const cloned = clone(obj);
|
|
71383
|
+
const key = nested[0];
|
|
71384
|
+
if (!Object.keys(obj).includes(key)) {
|
|
71385
|
+
cloned[key] = {};
|
|
71386
|
+
}
|
|
71387
|
+
cloned[key] = nested.length === 1 ? newValue : setNested(cloned[key], nested.slice(1), newValue);
|
|
71388
|
+
return cloned;
|
|
71389
|
+
}
|
|
71390
|
+
class PreloadSkipError extends Error {
|
|
71391
|
+
constructor(message) {
|
|
71392
|
+
super(message);
|
|
71393
|
+
this.name = "PreloadSkipError";
|
|
71394
|
+
}
|
|
71395
|
+
}
|
|
71396
|
+
async function resolveVariable(variable, client2, taskContext, extras, resolver = (state) => Promise.resolve(state)) {
|
|
71397
|
+
if (isDerivedVariable(variable)) {
|
|
71398
|
+
getOrRegisterDerivedVariable(variable, client2, taskContext, extras);
|
|
71399
|
+
const values = await Promise.all(
|
|
71400
|
+
variable.variables.map((v) => resolveVariable(v, client2, taskContext, extras, resolver))
|
|
71401
|
+
);
|
|
71402
|
+
const deps = variable.deps.map((dep) => variable.variables.findIndex((v) => v.uid === dep.uid));
|
|
71403
|
+
return {
|
|
71404
|
+
deps,
|
|
71405
|
+
type: "derived",
|
|
71406
|
+
uid: variable.uid,
|
|
71407
|
+
values,
|
|
71408
|
+
// After templating, nested should be all strings
|
|
71409
|
+
nested: variable.nested
|
|
71410
|
+
};
|
|
71411
|
+
}
|
|
71412
|
+
if (isServerVariable(variable)) {
|
|
71413
|
+
getOrRegisterServerVariable(variable, extras);
|
|
71414
|
+
return resolveServerVariable(variable, extras, resolver);
|
|
71415
|
+
}
|
|
71416
|
+
if (isSwitchVariable(variable)) {
|
|
71417
|
+
let resolvedValue = isVariable(variable.value) ? await resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
|
|
71418
|
+
if (isCondition(resolvedValue)) {
|
|
71419
|
+
resolvedValue = {
|
|
71420
|
+
...resolvedValue,
|
|
71421
|
+
variable: await resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
|
|
71422
|
+
};
|
|
71423
|
+
}
|
|
71424
|
+
const resolvedValueMap = isVariable(variable.value_map) ? await resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
|
|
71425
|
+
const resolvedDefault = isVariable(variable.default) ? await resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
|
|
71426
|
+
return {
|
|
71427
|
+
type: "switch",
|
|
71428
|
+
uid: variable.uid,
|
|
71429
|
+
value: resolvedValue,
|
|
71430
|
+
value_map: resolvedValueMap,
|
|
71431
|
+
default: resolvedDefault
|
|
71432
|
+
};
|
|
71433
|
+
}
|
|
71434
|
+
if (isStateVariable(variable)) {
|
|
71435
|
+
throw new Error("StateVariable should not be resolved - it should be handled by useVariable hook");
|
|
71436
|
+
}
|
|
71437
|
+
if (isStreamVariable(variable)) {
|
|
71438
|
+
return resolver(
|
|
71439
|
+
getOrRegisterStreamVariable(variable, client2, taskContext, extras)
|
|
71440
|
+
);
|
|
71441
|
+
}
|
|
71442
|
+
return resolver(getOrRegisterPlainVariable(variable, client2, taskContext, extras));
|
|
71443
|
+
}
|
|
71444
|
+
function resolveVariableStatic(variable, snapshot, params) {
|
|
71445
|
+
if (isDerivedVariable(variable)) {
|
|
71446
|
+
const values = variable.variables.map((v) => resolveVariableStatic(v, snapshot, params));
|
|
71447
|
+
const deps = variable.deps.map((dep) => variable.variables.findIndex((v) => v.uid === dep.uid));
|
|
71448
|
+
return {
|
|
71449
|
+
deps,
|
|
71450
|
+
type: "derived",
|
|
71451
|
+
uid: variable.uid,
|
|
71452
|
+
values,
|
|
71453
|
+
// After templating, nested should be all strings
|
|
71454
|
+
nested: variable.nested
|
|
71455
|
+
};
|
|
71456
|
+
}
|
|
71457
|
+
if (isServerVariable(variable)) {
|
|
71458
|
+
return resolveServerVariableStatic(variable, snapshot);
|
|
71459
|
+
}
|
|
71460
|
+
if (isSwitchVariable(variable)) {
|
|
71461
|
+
let resolvedValue = isVariable(variable.value) ? resolveVariableStatic(variable.value, snapshot, params) : variable.value;
|
|
71462
|
+
if (isCondition(resolvedValue)) {
|
|
71463
|
+
resolvedValue = {
|
|
71464
|
+
...resolvedValue,
|
|
71465
|
+
variable: resolveVariableStatic(resolvedValue.variable, snapshot, params)
|
|
71466
|
+
};
|
|
71467
|
+
}
|
|
71468
|
+
const resolvedValueMap = isVariable(variable.value_map) ? resolveVariableStatic(variable.value_map, snapshot, params) : variable.value_map;
|
|
71469
|
+
const resolvedDefault = isVariable(variable.default) ? resolveVariableStatic(variable.default, snapshot, params) : variable.default;
|
|
71470
|
+
return {
|
|
71471
|
+
type: "switch",
|
|
71472
|
+
uid: variable.uid,
|
|
71473
|
+
value: resolvedValue,
|
|
71474
|
+
value_map: resolvedValueMap,
|
|
71475
|
+
default: resolvedDefault
|
|
71476
|
+
};
|
|
71477
|
+
}
|
|
71478
|
+
if (isStateVariable(variable)) {
|
|
71479
|
+
throw new PreloadSkipError(
|
|
71480
|
+
"StateVariable cannot be used in on_load actions or preloaded. StateVariables track DerivedVariable loading/error state and are only available at runtime."
|
|
71481
|
+
);
|
|
71482
|
+
}
|
|
71483
|
+
if (isStreamVariable(variable)) {
|
|
71484
|
+
throw new PreloadSkipError(
|
|
71485
|
+
"StreamVariable cannot be used in on_load actions or preloaded. StreamVariables receive data via server-sent events and are only available at runtime."
|
|
71486
|
+
);
|
|
71487
|
+
}
|
|
71488
|
+
let result = resolvePlainVariableStatic(variable, snapshot, params);
|
|
71489
|
+
while (isDerivedVariable(result)) {
|
|
71490
|
+
result = resolveVariableStatic(result, snapshot, params);
|
|
71491
|
+
}
|
|
71492
|
+
return result;
|
|
71493
|
+
}
|
|
71494
|
+
function cleanValue(value, forceKeyOverride) {
|
|
71495
|
+
if (isResolvedDerivedVariable(value)) {
|
|
71496
|
+
const { deps, ...rest } = value;
|
|
71497
|
+
const cleanedValues = value.values.map((v) => cleanValue(v));
|
|
71498
|
+
return {
|
|
71499
|
+
...rest,
|
|
71500
|
+
// Use override if provided, otherwise use the embedded force_key from the resolved variable
|
|
71501
|
+
force_key: forceKeyOverride ?? (value.force_key || null),
|
|
71502
|
+
values: cleanedValues
|
|
71503
|
+
};
|
|
71504
|
+
}
|
|
71505
|
+
if (isResolvedSwitchVariable(value)) {
|
|
71506
|
+
return {
|
|
71507
|
+
...value,
|
|
71508
|
+
value: cleanValue(value.value, forceKeyOverride),
|
|
71509
|
+
value_map: cleanValue(value.value_map, forceKeyOverride),
|
|
71510
|
+
default: cleanValue(value.default, forceKeyOverride)
|
|
71511
|
+
};
|
|
71512
|
+
}
|
|
71513
|
+
return value;
|
|
71514
|
+
}
|
|
71515
|
+
function cleanKwargs(kwargs, forceKeyOverride) {
|
|
71516
|
+
return Object.keys(kwargs).reduce(
|
|
71517
|
+
(acc, k) => {
|
|
71518
|
+
acc[k] = cleanValue(kwargs[k], forceKeyOverride);
|
|
71519
|
+
return acc;
|
|
71520
|
+
},
|
|
71521
|
+
{}
|
|
71522
|
+
);
|
|
71523
|
+
}
|
|
71524
|
+
function cleanArgs(values, forceKeyOverride) {
|
|
71525
|
+
return values.map((val) => cleanValue(val, forceKeyOverride));
|
|
71526
|
+
}
|
|
70849
71527
|
function cleanSessionCache(sessionToken) {
|
|
70850
71528
|
for (const storage of [sessionStorage, localStorage]) {
|
|
70851
71529
|
const keys = Object.keys(storage);
|
|
@@ -71826,7 +72504,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
71826
72504
|
cachePolicy_UNSTABLE: {
|
|
71827
72505
|
eviction: "most-recent"
|
|
71828
72506
|
},
|
|
71829
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
72507
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
71830
72508
|
const throwError = (error) => {
|
|
71831
72509
|
error.selectorId = key;
|
|
71832
72510
|
error.selectorExtras = extrasSerializable.toJSON();
|
|
@@ -71848,9 +72526,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
71848
72526
|
const resolvedKwargsList = Object.values(resolvedKwargs);
|
|
71849
72527
|
const kwargsList = Object.values(dynamicKwargs);
|
|
71850
72528
|
const triggerAtom = getOrRegisterComponentTrigger(uid2, loop_instance_uid);
|
|
71851
|
-
const selfTrigger =
|
|
72529
|
+
const selfTrigger = get2(triggerAtom);
|
|
71852
72530
|
const triggerList = buildTriggerList(kwargsList);
|
|
71853
|
-
const triggers = registerChildTriggers(triggerList,
|
|
72531
|
+
const triggers = registerChildTriggers(triggerList, get2);
|
|
71854
72532
|
triggers.unshift(selfTrigger);
|
|
71855
72533
|
const { extras } = extrasSerializable;
|
|
71856
72534
|
let derivedResult = resolveDerivedValue({
|
|
@@ -71858,7 +72536,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
71858
72536
|
variables: kwargsList,
|
|
71859
72537
|
deps: kwargsList,
|
|
71860
72538
|
resolvedVariables: resolvedKwargsList,
|
|
71861
|
-
resolutionStrategy: { name: "get", get },
|
|
72539
|
+
resolutionStrategy: { name: "get", get: get2 },
|
|
71862
72540
|
triggerList,
|
|
71863
72541
|
triggers
|
|
71864
72542
|
});
|
|
@@ -72150,6 +72828,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
72150
72828
|
}
|
|
72151
72829
|
var isPlainObjectExports = requireIsPlainObject();
|
|
72152
72830
|
const isPlainObject = /* @__PURE__ */ getDefaultExportFromCjs(isPlainObjectExports);
|
|
72831
|
+
function isVariableWithNested(value) {
|
|
72832
|
+
return value && typeof value === "object" && "__typename" in value && typeof value.__typename === "string" && value.__typename.includes("Variable") && "nested" in value && Array.isArray(value.nested);
|
|
72833
|
+
}
|
|
72153
72834
|
function createMarkers(scope, loopInstanceUid) {
|
|
72154
72835
|
const markers = [];
|
|
72155
72836
|
if (scope.action) {
|
|
@@ -72189,6 +72870,33 @@ Inferred class string: "${iconClasses}."`
|
|
|
72189
72870
|
);
|
|
72190
72871
|
continue;
|
|
72191
72872
|
}
|
|
72873
|
+
if (isVariableWithNested(value) && !isLoopVariable(value)) {
|
|
72874
|
+
for (let i2 = 0; i2 < value.nested.length; i2++) {
|
|
72875
|
+
const nestedKey = value.nested[i2];
|
|
72876
|
+
if (isLoopVariable(nestedKey)) {
|
|
72877
|
+
markers.push({
|
|
72878
|
+
type: "nested_loop_var",
|
|
72879
|
+
path: dotPath,
|
|
72880
|
+
nestedIndex: i2,
|
|
72881
|
+
loopVarNested: nestedKey.nested
|
|
72882
|
+
});
|
|
72883
|
+
if (isDerivedVariable(value)) {
|
|
72884
|
+
markers.push({
|
|
72885
|
+
type: "derived_var",
|
|
72886
|
+
path: dotPath,
|
|
72887
|
+
loopInstanceUid: nestedKey.uid
|
|
72888
|
+
});
|
|
72889
|
+
}
|
|
72890
|
+
if (isPyComponent(value)) {
|
|
72891
|
+
markers.push({
|
|
72892
|
+
type: "server_component",
|
|
72893
|
+
path: dotPath,
|
|
72894
|
+
loopInstanceUid: nestedKey.uid
|
|
72895
|
+
});
|
|
72896
|
+
}
|
|
72897
|
+
}
|
|
72898
|
+
}
|
|
72899
|
+
}
|
|
72192
72900
|
if (isPlainObject(value) || Array.isArray(value)) {
|
|
72193
72901
|
const newScope = updateScope(scope, value, dotPath);
|
|
72194
72902
|
walk(value, [...pathSegments, key], newScope);
|
|
@@ -72229,6 +72937,14 @@ Inferred class string: "${iconClasses}."`
|
|
|
72229
72937
|
set(clonedRenderer, marker.path, value);
|
|
72230
72938
|
break;
|
|
72231
72939
|
}
|
|
72940
|
+
case "nested_loop_var": {
|
|
72941
|
+
const resolvedKey = resolveNested(loopValue, marker.loopVarNested);
|
|
72942
|
+
const variable = get(clonedRenderer, marker.path);
|
|
72943
|
+
if (variable && Array.isArray(variable.nested)) {
|
|
72944
|
+
variable.nested[marker.nestedIndex] = String(resolvedKey);
|
|
72945
|
+
}
|
|
72946
|
+
break;
|
|
72947
|
+
}
|
|
72232
72948
|
case "action": {
|
|
72233
72949
|
set(clonedRenderer, `${marker.path}.loading.uid`, nanoid$1());
|
|
72234
72950
|
break;
|
|
@@ -73423,57 +74139,80 @@ Inferred class string: "${iconClasses}."`
|
|
|
73423
74139
|
actions = [route.on_load];
|
|
73424
74140
|
}
|
|
73425
74141
|
const actionPayloads = actions.filter(isAnnotatedAction).map((a2) => {
|
|
73426
|
-
|
|
73427
|
-
|
|
73428
|
-
Object.
|
|
73429
|
-
|
|
73430
|
-
|
|
73431
|
-
|
|
73432
|
-
|
|
73433
|
-
|
|
73434
|
-
|
|
73435
|
-
|
|
73436
|
-
|
|
73437
|
-
|
|
73438
|
-
|
|
74142
|
+
try {
|
|
74143
|
+
const kwargs = cleanKwargs(
|
|
74144
|
+
Object.fromEntries(
|
|
74145
|
+
Object.entries(a2.dynamic_kwargs).map(([k, v]) => {
|
|
74146
|
+
return [k, resolveVariableStatic(v, snapshot, params)];
|
|
74147
|
+
})
|
|
74148
|
+
),
|
|
74149
|
+
null
|
|
74150
|
+
);
|
|
74151
|
+
return {
|
|
74152
|
+
uid: a2.uid,
|
|
74153
|
+
definition_uid: a2.definition_uid,
|
|
74154
|
+
values: normalizeRequest(kwargs, a2.dynamic_kwargs)
|
|
74155
|
+
};
|
|
74156
|
+
} catch (e2) {
|
|
74157
|
+
if (e2 instanceof PreloadSkipError) {
|
|
74158
|
+
throw new UserError(
|
|
74159
|
+
`on_load action cannot use StreamVariable or StateVariable. These variables are only available at runtime after the page has loaded. Consider using a regular action triggered by user interaction instead.`
|
|
74160
|
+
);
|
|
74161
|
+
}
|
|
74162
|
+
throw e2;
|
|
74163
|
+
}
|
|
73439
74164
|
});
|
|
73440
74165
|
const dvHandles = Object.values(route.dependency_graph?.derived_variables ?? {}).flatMap((dv) => {
|
|
73441
|
-
|
|
73442
|
-
|
|
73443
|
-
|
|
73444
|
-
|
|
73445
|
-
return {
|
|
73446
|
-
...handle,
|
|
73447
|
-
dv,
|
|
73448
|
-
payload: {
|
|
73449
|
-
values: normalizeRequest(cleanArgs(handle.result.values, null), dv.variables),
|
|
73450
|
-
uid: dv.uid
|
|
74166
|
+
try {
|
|
74167
|
+
const handle = preloadDerivedVariable(dv, snapshot, params);
|
|
74168
|
+
if (!handle) {
|
|
74169
|
+
return [];
|
|
73451
74170
|
}
|
|
73452
|
-
|
|
74171
|
+
return {
|
|
74172
|
+
...handle,
|
|
74173
|
+
dv,
|
|
74174
|
+
payload: {
|
|
74175
|
+
values: normalizeRequest(cleanArgs(handle.result.values, null), dv.variables),
|
|
74176
|
+
uid: dv.uid
|
|
74177
|
+
}
|
|
74178
|
+
};
|
|
74179
|
+
} catch (e2) {
|
|
74180
|
+
if (e2 instanceof PreloadSkipError) {
|
|
74181
|
+
return [];
|
|
74182
|
+
}
|
|
74183
|
+
throw e2;
|
|
74184
|
+
}
|
|
73453
74185
|
});
|
|
73454
74186
|
const pyHandles = Object.values(route.dependency_graph?.py_components ?? {}).flatMap((py) => {
|
|
73455
|
-
|
|
73456
|
-
|
|
73457
|
-
|
|
73458
|
-
|
|
73459
|
-
const kwargValues = cleanKwargs(
|
|
73460
|
-
Object.keys(py.props.dynamic_kwargs).reduce(
|
|
73461
|
-
(acc, k, idx) => {
|
|
73462
|
-
acc[k] = handle.result.values[idx];
|
|
73463
|
-
return acc;
|
|
73464
|
-
},
|
|
73465
|
-
{}
|
|
73466
|
-
)
|
|
73467
|
-
);
|
|
73468
|
-
return {
|
|
73469
|
-
...handle,
|
|
73470
|
-
py,
|
|
73471
|
-
payload: {
|
|
73472
|
-
uid: py.uid,
|
|
73473
|
-
name: py.name,
|
|
73474
|
-
values: normalizeRequest(kwargValues, py.props.dynamic_kwargs)
|
|
74187
|
+
try {
|
|
74188
|
+
const handle = preloadServerComponent(py, snapshot, params);
|
|
74189
|
+
if (!handle) {
|
|
74190
|
+
return [];
|
|
73475
74191
|
}
|
|
73476
|
-
|
|
74192
|
+
const kwargValues = cleanKwargs(
|
|
74193
|
+
Object.keys(py.props.dynamic_kwargs).reduce(
|
|
74194
|
+
(acc, k, idx) => {
|
|
74195
|
+
acc[k] = handle.result.values[idx];
|
|
74196
|
+
return acc;
|
|
74197
|
+
},
|
|
74198
|
+
{}
|
|
74199
|
+
)
|
|
74200
|
+
);
|
|
74201
|
+
return {
|
|
74202
|
+
...handle,
|
|
74203
|
+
py,
|
|
74204
|
+
payload: {
|
|
74205
|
+
uid: py.uid,
|
|
74206
|
+
name: py.name,
|
|
74207
|
+
values: normalizeRequest(kwargValues, py.props.dynamic_kwargs)
|
|
74208
|
+
}
|
|
74209
|
+
};
|
|
74210
|
+
} catch (e2) {
|
|
74211
|
+
if (e2 instanceof PreloadSkipError) {
|
|
74212
|
+
return [];
|
|
74213
|
+
}
|
|
74214
|
+
throw e2;
|
|
74215
|
+
}
|
|
73477
74216
|
});
|
|
73478
74217
|
const dvHandlesByUid = dvHandles.reduce(
|
|
73479
74218
|
(acc, h) => ({ ...acc, [h.dv.uid]: h }),
|
|
@@ -74048,6 +74787,12 @@ Inferred class string: "${iconClasses}."`
|
|
|
74048
74787
|
});
|
|
74049
74788
|
return [data2?.[0] ?? null, warnUpdateOnDerivedState];
|
|
74050
74789
|
}
|
|
74790
|
+
if (isStreamVariable(variable)) {
|
|
74791
|
+
const selector2 = getOrRegisterStreamVariable(variable, wsClient, taskContext, extras);
|
|
74792
|
+
const selectorLoadable = Recoil_index_21(selector2);
|
|
74793
|
+
const deferred22 = useDeferLoadable(selectorLoadable, opts.suspend);
|
|
74794
|
+
return [deferred22, warnUpdateOnDerivedState];
|
|
74795
|
+
}
|
|
74051
74796
|
const recoilState = getOrRegisterPlainVariable(variable, wsClient, taskContext, extras);
|
|
74052
74797
|
if (!isDerivedVariable(variable.default)) {
|
|
74053
74798
|
const [value, setValue] = Recoil_index_22(recoilState);
|
|
@@ -75093,6 +75838,7 @@ body,
|
|
|
75093
75838
|
} else if (isSwitchVariable(variable)) ;
|
|
75094
75839
|
else if (isStateVariable(variable)) ;
|
|
75095
75840
|
else if (isServerVariable(variable)) ;
|
|
75841
|
+
else if (isStreamVariable(variable)) ;
|
|
75096
75842
|
else {
|
|
75097
75843
|
const plainAtom = getOrRegisterPlainVariable(variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
|
|
75098
75844
|
if (variable.store?.__typename === "QueryParamStore") {
|
|
@@ -99151,6 +99897,7 @@ body,
|
|
|
99151
99897
|
exports.isServerVariable = isServerVariable;
|
|
99152
99898
|
exports.isSingleVariable = isSingleVariable;
|
|
99153
99899
|
exports.isStateVariable = isStateVariable;
|
|
99900
|
+
exports.isStreamVariable = isStreamVariable;
|
|
99154
99901
|
exports.isSwitchVariable = isSwitchVariable;
|
|
99155
99902
|
exports.isTaskResponse = isTaskResponse$1;
|
|
99156
99903
|
exports.isVariable = isVariable;
|
|
@@ -99169,6 +99916,7 @@ body,
|
|
|
99169
99916
|
exports.resolveServerVariable = resolveServerVariable;
|
|
99170
99917
|
exports.resolveServerVariableStatic = resolveServerVariableStatic;
|
|
99171
99918
|
exports.resolveTheme = resolveTheme;
|
|
99919
|
+
exports.resolveValue = resolveValue;
|
|
99172
99920
|
exports.revokeSession = revokeSession;
|
|
99173
99921
|
exports.selectorFamilyMembersRegistry = selectorFamilyMembersRegistry;
|
|
99174
99922
|
exports.selectorFamilyRegistry = selectorFamilyRegistry;
|
|
@@ -99176,6 +99924,7 @@ body,
|
|
|
99176
99924
|
exports.setNested = setNested;
|
|
99177
99925
|
exports.setSessionToken = setSessionToken;
|
|
99178
99926
|
exports.setupWebsocket = setupWebsocket;
|
|
99927
|
+
exports.streamAtomRegistry = streamAtomRegistry;
|
|
99179
99928
|
exports.useAction = useAction;
|
|
99180
99929
|
exports.useActionIsLoading = useActionIsLoading;
|
|
99181
99930
|
exports.useComponentStyles = useComponentStyles;
|