ode-explorer 1.4.2-develop-pedago.202404181500 → 1.4.2-develop-pedago.202404181532
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +151 -182
- package/dist/version.txt +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
34
34
|
__accessCheck(obj, member, "access private method");
|
|
35
35
|
return method;
|
|
36
36
|
};
|
|
37
|
-
var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _retryer, _observers, _defaultOptions, _abortSignalConsumed, _dispatch, dispatch_fn, _d, _queries, _e, _observers2, _defaultOptions2, _mutationCache, _retryer2, _dispatch2, dispatch_fn2, _f, _mutations, _mutationId, _resuming, _g, _queryCache, _mutationCache2, _defaultOptions3, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h, _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _executeFetch, executeFetch_fn, _updateStaleTimeout, updateStaleTimeout_fn, _computeRefetchInterval, computeRefetchInterval_fn, _updateRefetchInterval, updateRefetchInterval_fn, _updateTimers, updateTimers_fn, _clearStaleTimeout, clearStaleTimeout_fn, _clearRefetchInterval, clearRefetchInterval_fn, _updateQuery, updateQuery_fn, _notify, notify_fn, _i, _client2, _currentResult2, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify2, notify_fn2, _j;
|
|
37
|
+
var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _promise, _retryer, _observers, _defaultOptions, _abortSignalConsumed, _setOptions, setOptions_fn, _dispatch, dispatch_fn, _d, _queries, _e, _observers2, _defaultOptions2, _mutationCache, _retryer2, _dispatch2, dispatch_fn2, _f, _mutations, _mutationId, _resuming, _g, _queryCache, _mutationCache2, _defaultOptions3, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h, _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _executeFetch, executeFetch_fn, _updateStaleTimeout, updateStaleTimeout_fn, _computeRefetchInterval, computeRefetchInterval_fn, _updateRefetchInterval, updateRefetchInterval_fn, _updateTimers, updateTimers_fn, _clearStaleTimeout, clearStaleTimeout_fn, _clearRefetchInterval, clearRefetchInterval_fn, _updateQuery, updateQuery_fn, _notify, notify_fn, _i, _client2, _currentResult2, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify2, notify_fn2, _j;
|
|
38
38
|
import { odeServices, FOLDER, SORT_ORDER, ACTION } from "/assets/js/edifice-ts-client/index.js";
|
|
39
39
|
function _mergeNamespaces(n2, m2) {
|
|
40
40
|
for (var i2 = 0; i2 < m2.length; i2++) {
|
|
@@ -4270,7 +4270,7 @@ var Subscribable = class {
|
|
|
4270
4270
|
onUnsubscribe() {
|
|
4271
4271
|
}
|
|
4272
4272
|
};
|
|
4273
|
-
var isServer = typeof window === "undefined" || "Deno" in
|
|
4273
|
+
var isServer = typeof window === "undefined" || "Deno" in window;
|
|
4274
4274
|
function noop$2() {
|
|
4275
4275
|
return void 0;
|
|
4276
4276
|
}
|
|
@@ -4313,7 +4313,7 @@ function matchQuery(filters2, query) {
|
|
|
4313
4313
|
if (typeof stale === "boolean" && query.isStale() !== stale) {
|
|
4314
4314
|
return false;
|
|
4315
4315
|
}
|
|
4316
|
-
if (fetchStatus && fetchStatus !== query.state.fetchStatus) {
|
|
4316
|
+
if (typeof fetchStatus !== "undefined" && fetchStatus !== query.state.fetchStatus) {
|
|
4317
4317
|
return false;
|
|
4318
4318
|
}
|
|
4319
4319
|
if (predicate && !predicate(query)) {
|
|
@@ -4374,22 +4374,16 @@ function replaceEqualDeep(a2, b2) {
|
|
|
4374
4374
|
}
|
|
4375
4375
|
const array = isPlainArray(a2) && isPlainArray(b2);
|
|
4376
4376
|
if (array || isPlainObject$1(a2) && isPlainObject$1(b2)) {
|
|
4377
|
-
const
|
|
4378
|
-
const aSize = aItems.length;
|
|
4377
|
+
const aSize = array ? a2.length : Object.keys(a2).length;
|
|
4379
4378
|
const bItems = array ? b2 : Object.keys(b2);
|
|
4380
4379
|
const bSize = bItems.length;
|
|
4381
4380
|
const copy2 = array ? [] : {};
|
|
4382
4381
|
let equalItems = 0;
|
|
4383
4382
|
for (let i2 = 0; i2 < bSize; i2++) {
|
|
4384
4383
|
const key = array ? i2 : bItems[i2];
|
|
4385
|
-
|
|
4386
|
-
|
|
4384
|
+
copy2[key] = replaceEqualDeep(a2[key], b2[key]);
|
|
4385
|
+
if (copy2[key] === a2[key]) {
|
|
4387
4386
|
equalItems++;
|
|
4388
|
-
} else {
|
|
4389
|
-
copy2[key] = replaceEqualDeep(a2[key], b2[key]);
|
|
4390
|
-
if (copy2[key] === a2[key] && a2[key] !== void 0) {
|
|
4391
|
-
equalItems++;
|
|
4392
|
-
}
|
|
4393
4387
|
}
|
|
4394
4388
|
}
|
|
4395
4389
|
return aSize === bSize && equalItems === aSize ? a2 : copy2;
|
|
@@ -4397,7 +4391,7 @@ function replaceEqualDeep(a2, b2) {
|
|
|
4397
4391
|
return b2;
|
|
4398
4392
|
}
|
|
4399
4393
|
function shallowEqualObjects(a2, b2) {
|
|
4400
|
-
if (!b2 ||
|
|
4394
|
+
if (a2 && !b2 || b2 && !a2) {
|
|
4401
4395
|
return false;
|
|
4402
4396
|
}
|
|
4403
4397
|
for (const key in a2) {
|
|
@@ -4415,7 +4409,7 @@ function isPlainObject$1(o2) {
|
|
|
4415
4409
|
return false;
|
|
4416
4410
|
}
|
|
4417
4411
|
const ctor = o2.constructor;
|
|
4418
|
-
if (ctor ===
|
|
4412
|
+
if (typeof ctor === "undefined") {
|
|
4419
4413
|
return true;
|
|
4420
4414
|
}
|
|
4421
4415
|
const prot = ctor.prototype;
|
|
@@ -4435,6 +4429,9 @@ function sleep(ms) {
|
|
|
4435
4429
|
setTimeout(resolve, ms);
|
|
4436
4430
|
});
|
|
4437
4431
|
}
|
|
4432
|
+
function scheduleMicrotask(callback) {
|
|
4433
|
+
sleep(0).then(callback);
|
|
4434
|
+
}
|
|
4438
4435
|
function replaceData(prevData, data, options) {
|
|
4439
4436
|
if (typeof options.structuralSharing === "function") {
|
|
4440
4437
|
return options.structuralSharing(prevData, data);
|
|
@@ -4451,7 +4448,6 @@ function addToStart(items, item, max2 = 0) {
|
|
|
4451
4448
|
const newItems = [item, ...items];
|
|
4452
4449
|
return max2 && newItems.length > max2 ? newItems.slice(0, -1) : newItems;
|
|
4453
4450
|
}
|
|
4454
|
-
var skipToken = Symbol();
|
|
4455
4451
|
var FocusManager = (_a = class extends Subscribable {
|
|
4456
4452
|
constructor() {
|
|
4457
4453
|
super();
|
|
@@ -4501,9 +4497,8 @@ var FocusManager = (_a = class extends Subscribable {
|
|
|
4501
4497
|
}
|
|
4502
4498
|
}
|
|
4503
4499
|
onFocus() {
|
|
4504
|
-
const isFocused = this.isFocused();
|
|
4505
4500
|
this.listeners.forEach((listener) => {
|
|
4506
|
-
listener(
|
|
4501
|
+
listener();
|
|
4507
4502
|
});
|
|
4508
4503
|
}
|
|
4509
4504
|
isFocused() {
|
|
@@ -4708,10 +4703,6 @@ function createNotifyManager() {
|
|
|
4708
4703
|
let batchNotifyFn = (callback) => {
|
|
4709
4704
|
callback();
|
|
4710
4705
|
};
|
|
4711
|
-
let scheduleFn = (cb2) => setTimeout(cb2, 0);
|
|
4712
|
-
const setScheduler = (fn2) => {
|
|
4713
|
-
scheduleFn = fn2;
|
|
4714
|
-
};
|
|
4715
4706
|
const batch = (callback) => {
|
|
4716
4707
|
let result;
|
|
4717
4708
|
transactions++;
|
|
@@ -4729,7 +4720,7 @@ function createNotifyManager() {
|
|
|
4729
4720
|
if (transactions) {
|
|
4730
4721
|
queue.push(callback);
|
|
4731
4722
|
} else {
|
|
4732
|
-
|
|
4723
|
+
scheduleMicrotask(() => {
|
|
4733
4724
|
notifyFn(callback);
|
|
4734
4725
|
});
|
|
4735
4726
|
}
|
|
@@ -4745,7 +4736,7 @@ function createNotifyManager() {
|
|
|
4745
4736
|
const originalQueue = queue;
|
|
4746
4737
|
queue = [];
|
|
4747
4738
|
if (originalQueue.length) {
|
|
4748
|
-
|
|
4739
|
+
scheduleMicrotask(() => {
|
|
4749
4740
|
batchNotifyFn(() => {
|
|
4750
4741
|
originalQueue.forEach((callback) => {
|
|
4751
4742
|
notifyFn(callback);
|
|
@@ -4765,8 +4756,7 @@ function createNotifyManager() {
|
|
|
4765
4756
|
batchCalls,
|
|
4766
4757
|
schedule: schedule2,
|
|
4767
4758
|
setNotifyFunction,
|
|
4768
|
-
setBatchNotifyFunction
|
|
4769
|
-
setScheduler
|
|
4759
|
+
setBatchNotifyFunction
|
|
4770
4760
|
};
|
|
4771
4761
|
}
|
|
4772
4762
|
var notifyManager = createNotifyManager();
|
|
@@ -4801,17 +4791,19 @@ var Removable = (_c = class {
|
|
|
4801
4791
|
var Query = (_d = class extends Removable {
|
|
4802
4792
|
constructor(config2) {
|
|
4803
4793
|
super();
|
|
4794
|
+
__privateAdd(this, _setOptions);
|
|
4804
4795
|
__privateAdd(this, _dispatch);
|
|
4805
4796
|
__privateAdd(this, _initialState, void 0);
|
|
4806
4797
|
__privateAdd(this, _revertState, void 0);
|
|
4807
4798
|
__privateAdd(this, _cache, void 0);
|
|
4799
|
+
__privateAdd(this, _promise, void 0);
|
|
4808
4800
|
__privateAdd(this, _retryer, void 0);
|
|
4809
4801
|
__privateAdd(this, _observers, void 0);
|
|
4810
4802
|
__privateAdd(this, _defaultOptions, void 0);
|
|
4811
4803
|
__privateAdd(this, _abortSignalConsumed, void 0);
|
|
4812
4804
|
__privateSet(this, _abortSignalConsumed, false);
|
|
4813
4805
|
__privateSet(this, _defaultOptions, config2.defaultOptions);
|
|
4814
|
-
this.
|
|
4806
|
+
__privateMethod(this, _setOptions, setOptions_fn).call(this, config2.options);
|
|
4815
4807
|
__privateSet(this, _observers, []);
|
|
4816
4808
|
__privateSet(this, _cache, config2.cache);
|
|
4817
4809
|
this.queryKey = config2.queryKey;
|
|
@@ -4823,10 +4815,6 @@ var Query = (_d = class extends Removable {
|
|
|
4823
4815
|
get meta() {
|
|
4824
4816
|
return this.options.meta;
|
|
4825
4817
|
}
|
|
4826
|
-
setOptions(options) {
|
|
4827
|
-
this.options = { ...__privateGet(this, _defaultOptions), ...options };
|
|
4828
|
-
this.updateGcTime(this.options.gcTime);
|
|
4829
|
-
}
|
|
4830
4818
|
optionalRemove() {
|
|
4831
4819
|
if (!__privateGet(this, _observers).length && this.state.fetchStatus === "idle") {
|
|
4832
4820
|
__privateGet(this, _cache).remove(this);
|
|
@@ -4846,9 +4834,9 @@ var Query = (_d = class extends Removable {
|
|
|
4846
4834
|
__privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "setState", state, setStateOptions });
|
|
4847
4835
|
}
|
|
4848
4836
|
cancel(options) {
|
|
4849
|
-
var _a2
|
|
4850
|
-
const promise2 =
|
|
4851
|
-
(
|
|
4837
|
+
var _a2;
|
|
4838
|
+
const promise2 = __privateGet(this, _promise);
|
|
4839
|
+
(_a2 = __privateGet(this, _retryer)) == null ? void 0 : _a2.cancel(options);
|
|
4852
4840
|
return promise2 ? promise2.then(noop$2).catch(noop$2) : Promise.resolve();
|
|
4853
4841
|
}
|
|
4854
4842
|
destroy() {
|
|
@@ -4868,18 +4856,10 @@ var Query = (_d = class extends Removable {
|
|
|
4868
4856
|
return this.getObserversCount() > 0 && !this.isActive();
|
|
4869
4857
|
}
|
|
4870
4858
|
isStale() {
|
|
4871
|
-
|
|
4872
|
-
return true;
|
|
4873
|
-
}
|
|
4874
|
-
if (this.getObserversCount() > 0) {
|
|
4875
|
-
return __privateGet(this, _observers).some(
|
|
4876
|
-
(observer) => observer.getCurrentResult().isStale
|
|
4877
|
-
);
|
|
4878
|
-
}
|
|
4879
|
-
return this.state.data === void 0;
|
|
4859
|
+
return this.state.isInvalidated || !this.state.dataUpdatedAt || __privateGet(this, _observers).some((observer) => observer.getCurrentResult().isStale);
|
|
4880
4860
|
}
|
|
4881
4861
|
isStaleByTime(staleTime = 0) {
|
|
4882
|
-
return this.state.isInvalidated || this.state.
|
|
4862
|
+
return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime);
|
|
4883
4863
|
}
|
|
4884
4864
|
onFocus() {
|
|
4885
4865
|
var _a2;
|
|
@@ -4925,22 +4905,22 @@ var Query = (_d = class extends Removable {
|
|
|
4925
4905
|
}
|
|
4926
4906
|
}
|
|
4927
4907
|
fetch(options, fetchOptions) {
|
|
4928
|
-
var _a2, _b2, _c2;
|
|
4908
|
+
var _a2, _b2, _c2, _d2;
|
|
4929
4909
|
if (this.state.fetchStatus !== "idle") {
|
|
4930
|
-
if (this.state.
|
|
4910
|
+
if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) {
|
|
4931
4911
|
this.cancel({ silent: true });
|
|
4932
|
-
} else if (__privateGet(this,
|
|
4933
|
-
__privateGet(this, _retryer).continueRetry();
|
|
4934
|
-
return __privateGet(this,
|
|
4912
|
+
} else if (__privateGet(this, _promise)) {
|
|
4913
|
+
(_a2 = __privateGet(this, _retryer)) == null ? void 0 : _a2.continueRetry();
|
|
4914
|
+
return __privateGet(this, _promise);
|
|
4935
4915
|
}
|
|
4936
4916
|
}
|
|
4937
4917
|
if (options) {
|
|
4938
|
-
this.
|
|
4918
|
+
__privateMethod(this, _setOptions, setOptions_fn).call(this, options);
|
|
4939
4919
|
}
|
|
4940
4920
|
if (!this.options.queryFn) {
|
|
4941
4921
|
const observer = __privateGet(this, _observers).find((x2) => x2.options.queryFn);
|
|
4942
4922
|
if (observer) {
|
|
4943
|
-
this.
|
|
4923
|
+
__privateMethod(this, _setOptions, setOptions_fn).call(this, observer.options);
|
|
4944
4924
|
}
|
|
4945
4925
|
}
|
|
4946
4926
|
const abortController = new AbortController();
|
|
@@ -4959,7 +4939,7 @@ var Query = (_d = class extends Removable {
|
|
|
4959
4939
|
};
|
|
4960
4940
|
addSignalProperty(queryFnContext);
|
|
4961
4941
|
const fetchFn = () => {
|
|
4962
|
-
if (!this.options.queryFn
|
|
4942
|
+
if (!this.options.queryFn) {
|
|
4963
4943
|
return Promise.reject(
|
|
4964
4944
|
new Error(`Missing queryFn: '${this.options.queryHash}'`)
|
|
4965
4945
|
);
|
|
@@ -4984,16 +4964,16 @@ var Query = (_d = class extends Removable {
|
|
|
4984
4964
|
fetchFn
|
|
4985
4965
|
};
|
|
4986
4966
|
addSignalProperty(context2);
|
|
4987
|
-
(
|
|
4967
|
+
(_b2 = this.options.behavior) == null ? void 0 : _b2.onFetch(
|
|
4988
4968
|
context2,
|
|
4989
4969
|
this
|
|
4990
4970
|
);
|
|
4991
4971
|
__privateSet(this, _revertState, this.state);
|
|
4992
|
-
if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((
|
|
4993
|
-
__privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "fetch", meta: (
|
|
4972
|
+
if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((_c2 = context2.fetchOptions) == null ? void 0 : _c2.meta)) {
|
|
4973
|
+
__privateMethod(this, _dispatch, dispatch_fn).call(this, { type: "fetch", meta: (_d2 = context2.fetchOptions) == null ? void 0 : _d2.meta });
|
|
4994
4974
|
}
|
|
4995
4975
|
const onError = (error) => {
|
|
4996
|
-
var _a3, _b3, _c3,
|
|
4976
|
+
var _a3, _b3, _c3, _d3;
|
|
4997
4977
|
if (!(isCancelledError(error) && error.silent)) {
|
|
4998
4978
|
__privateMethod(this, _dispatch, dispatch_fn).call(this, {
|
|
4999
4979
|
type: "error",
|
|
@@ -5006,7 +4986,7 @@ var Query = (_d = class extends Removable {
|
|
|
5006
4986
|
error,
|
|
5007
4987
|
this
|
|
5008
4988
|
);
|
|
5009
|
-
(
|
|
4989
|
+
(_d3 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d3.call(
|
|
5010
4990
|
_c3,
|
|
5011
4991
|
this.state.data,
|
|
5012
4992
|
error,
|
|
@@ -5022,14 +5002,14 @@ var Query = (_d = class extends Removable {
|
|
|
5022
5002
|
fn: context2.fetchFn,
|
|
5023
5003
|
abort: abortController.abort.bind(abortController),
|
|
5024
5004
|
onSuccess: (data) => {
|
|
5025
|
-
var _a3, _b3, _c3,
|
|
5026
|
-
if (data ===
|
|
5005
|
+
var _a3, _b3, _c3, _d3;
|
|
5006
|
+
if (typeof data === "undefined") {
|
|
5027
5007
|
onError(new Error(`${this.queryHash} data is undefined`));
|
|
5028
5008
|
return;
|
|
5029
5009
|
}
|
|
5030
5010
|
this.setData(data);
|
|
5031
5011
|
(_b3 = (_a3 = __privateGet(this, _cache).config).onSuccess) == null ? void 0 : _b3.call(_a3, data, this);
|
|
5032
|
-
(
|
|
5012
|
+
(_d3 = (_c3 = __privateGet(this, _cache).config).onSettled) == null ? void 0 : _d3.call(
|
|
5033
5013
|
_c3,
|
|
5034
5014
|
data,
|
|
5035
5015
|
this.state.error,
|
|
@@ -5054,9 +5034,13 @@ var Query = (_d = class extends Removable {
|
|
|
5054
5034
|
retryDelay: context2.options.retryDelay,
|
|
5055
5035
|
networkMode: context2.options.networkMode
|
|
5056
5036
|
}));
|
|
5057
|
-
|
|
5037
|
+
__privateSet(this, _promise, __privateGet(this, _retryer).promise);
|
|
5038
|
+
return __privateGet(this, _promise);
|
|
5058
5039
|
}
|
|
5059
|
-
}, _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _retryer = new WeakMap(), _observers = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(),
|
|
5040
|
+
}, _initialState = new WeakMap(), _revertState = new WeakMap(), _cache = new WeakMap(), _promise = new WeakMap(), _retryer = new WeakMap(), _observers = new WeakMap(), _defaultOptions = new WeakMap(), _abortSignalConsumed = new WeakMap(), _setOptions = new WeakSet(), setOptions_fn = function(options) {
|
|
5041
|
+
this.options = { ...__privateGet(this, _defaultOptions), ...options };
|
|
5042
|
+
this.updateGcTime(this.options.gcTime);
|
|
5043
|
+
}, _dispatch = new WeakSet(), dispatch_fn = function(action) {
|
|
5060
5044
|
const reducer2 = (state) => {
|
|
5061
5045
|
switch (action.type) {
|
|
5062
5046
|
case "failed":
|
|
@@ -5078,8 +5062,14 @@ var Query = (_d = class extends Removable {
|
|
|
5078
5062
|
case "fetch":
|
|
5079
5063
|
return {
|
|
5080
5064
|
...state,
|
|
5081
|
-
|
|
5082
|
-
|
|
5065
|
+
fetchFailureCount: 0,
|
|
5066
|
+
fetchFailureReason: null,
|
|
5067
|
+
fetchMeta: action.meta ?? null,
|
|
5068
|
+
fetchStatus: canFetch(this.options.networkMode) ? "fetching" : "paused",
|
|
5069
|
+
...!state.dataUpdatedAt && {
|
|
5070
|
+
error: null,
|
|
5071
|
+
status: "pending"
|
|
5072
|
+
}
|
|
5083
5073
|
};
|
|
5084
5074
|
case "success":
|
|
5085
5075
|
return {
|
|
@@ -5131,20 +5121,9 @@ var Query = (_d = class extends Removable {
|
|
|
5131
5121
|
__privateGet(this, _cache).notify({ query: this, type: "updated", action });
|
|
5132
5122
|
});
|
|
5133
5123
|
}, _d);
|
|
5134
|
-
function fetchState(data, options) {
|
|
5135
|
-
return {
|
|
5136
|
-
fetchFailureCount: 0,
|
|
5137
|
-
fetchFailureReason: null,
|
|
5138
|
-
fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused",
|
|
5139
|
-
...data === void 0 && {
|
|
5140
|
-
error: null,
|
|
5141
|
-
status: "pending"
|
|
5142
|
-
}
|
|
5143
|
-
};
|
|
5144
|
-
}
|
|
5145
5124
|
function getDefaultState$1(options) {
|
|
5146
5125
|
const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
|
|
5147
|
-
const hasData = data !==
|
|
5126
|
+
const hasData = typeof data !== "undefined";
|
|
5148
5127
|
const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;
|
|
5149
5128
|
return {
|
|
5150
5129
|
data,
|
|
@@ -5581,11 +5560,9 @@ function infiniteQueryBehavior(pages) {
|
|
|
5581
5560
|
}
|
|
5582
5561
|
});
|
|
5583
5562
|
};
|
|
5584
|
-
const queryFn = context2.options.queryFn
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
);
|
|
5588
|
-
};
|
|
5563
|
+
const queryFn = context2.options.queryFn || (() => Promise.reject(
|
|
5564
|
+
new Error(`Missing queryFn: '${context2.options.queryHash}'`)
|
|
5565
|
+
));
|
|
5589
5566
|
const fetchPage = async (data, param, previous) => {
|
|
5590
5567
|
if (cancelled) {
|
|
5591
5568
|
return Promise.reject();
|
|
@@ -5703,15 +5680,15 @@ var QueryClient = (_h = class {
|
|
|
5703
5680
|
__privateWrapper(this, _mountCount)._++;
|
|
5704
5681
|
if (__privateGet(this, _mountCount) !== 1)
|
|
5705
5682
|
return;
|
|
5706
|
-
__privateSet(this, _unsubscribeFocus, focusManager.subscribe(
|
|
5707
|
-
if (
|
|
5708
|
-
|
|
5683
|
+
__privateSet(this, _unsubscribeFocus, focusManager.subscribe(() => {
|
|
5684
|
+
if (focusManager.isFocused()) {
|
|
5685
|
+
this.resumePausedMutations();
|
|
5709
5686
|
__privateGet(this, _queryCache).onFocus();
|
|
5710
5687
|
}
|
|
5711
5688
|
}));
|
|
5712
|
-
__privateSet(this, _unsubscribeOnline, onlineManager.subscribe(
|
|
5713
|
-
if (
|
|
5714
|
-
|
|
5689
|
+
__privateSet(this, _unsubscribeOnline, onlineManager.subscribe(() => {
|
|
5690
|
+
if (onlineManager.isOnline()) {
|
|
5691
|
+
this.resumePausedMutations();
|
|
5715
5692
|
__privateGet(this, _queryCache).onOnline();
|
|
5716
5693
|
}
|
|
5717
5694
|
}));
|
|
@@ -5734,21 +5711,11 @@ var QueryClient = (_h = class {
|
|
|
5734
5711
|
}
|
|
5735
5712
|
getQueryData(queryKey) {
|
|
5736
5713
|
var _a2;
|
|
5737
|
-
|
|
5738
|
-
return (_a2 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a2.state.data;
|
|
5714
|
+
return (_a2 = __privateGet(this, _queryCache).find({ queryKey })) == null ? void 0 : _a2.state.data;
|
|
5739
5715
|
}
|
|
5740
5716
|
ensureQueryData(options) {
|
|
5741
5717
|
const cachedData = this.getQueryData(options.queryKey);
|
|
5742
|
-
|
|
5743
|
-
return this.fetchQuery(options);
|
|
5744
|
-
else {
|
|
5745
|
-
const defaultedOptions = this.defaultQueryOptions(options);
|
|
5746
|
-
const query = __privateGet(this, _queryCache).build(this, defaultedOptions);
|
|
5747
|
-
if (options.revalidateIfStale && query.isStaleByTime(defaultedOptions.staleTime)) {
|
|
5748
|
-
void this.prefetchQuery(defaultedOptions);
|
|
5749
|
-
}
|
|
5750
|
-
return Promise.resolve(cachedData);
|
|
5751
|
-
}
|
|
5718
|
+
return cachedData !== void 0 ? Promise.resolve(cachedData) : this.fetchQuery(options);
|
|
5752
5719
|
}
|
|
5753
5720
|
getQueriesData(filters2) {
|
|
5754
5721
|
return this.getQueryCache().findAll(filters2).map(({ queryKey, state }) => {
|
|
@@ -5757,15 +5724,13 @@ var QueryClient = (_h = class {
|
|
|
5757
5724
|
});
|
|
5758
5725
|
}
|
|
5759
5726
|
setQueryData(queryKey, updater, options) {
|
|
5760
|
-
const
|
|
5761
|
-
const query = __privateGet(this, _queryCache).get(
|
|
5762
|
-
defaultedOptions.queryHash
|
|
5763
|
-
);
|
|
5727
|
+
const query = __privateGet(this, _queryCache).find({ queryKey });
|
|
5764
5728
|
const prevData = query == null ? void 0 : query.state.data;
|
|
5765
5729
|
const data = functionalUpdate(updater, prevData);
|
|
5766
|
-
if (data ===
|
|
5730
|
+
if (typeof data === "undefined") {
|
|
5767
5731
|
return void 0;
|
|
5768
5732
|
}
|
|
5733
|
+
const defaultedOptions = this.defaultQueryOptions({ queryKey });
|
|
5769
5734
|
return __privateGet(this, _queryCache).build(this, defaultedOptions).setData(data, { ...options, manual: true });
|
|
5770
5735
|
}
|
|
5771
5736
|
setQueriesData(filters2, updater, options) {
|
|
@@ -5778,8 +5743,7 @@ var QueryClient = (_h = class {
|
|
|
5778
5743
|
}
|
|
5779
5744
|
getQueryState(queryKey) {
|
|
5780
5745
|
var _a2;
|
|
5781
|
-
|
|
5782
|
-
return (_a2 = __privateGet(this, _queryCache).get(options.queryHash)) == null ? void 0 : _a2.state;
|
|
5746
|
+
return (_a2 = __privateGet(this, _queryCache).find({ queryKey })) == null ? void 0 : _a2.state;
|
|
5783
5747
|
}
|
|
5784
5748
|
removeQueries(filters2) {
|
|
5785
5749
|
const queryCache = __privateGet(this, _queryCache);
|
|
@@ -5842,7 +5806,7 @@ var QueryClient = (_h = class {
|
|
|
5842
5806
|
}
|
|
5843
5807
|
fetchQuery(options) {
|
|
5844
5808
|
const defaultedOptions = this.defaultQueryOptions(options);
|
|
5845
|
-
if (defaultedOptions.retry ===
|
|
5809
|
+
if (typeof defaultedOptions.retry === "undefined") {
|
|
5846
5810
|
defaultedOptions.retry = false;
|
|
5847
5811
|
}
|
|
5848
5812
|
const query = __privateGet(this, _queryCache).build(this, defaultedOptions);
|
|
@@ -5859,10 +5823,7 @@ var QueryClient = (_h = class {
|
|
|
5859
5823
|
return this.fetchInfiniteQuery(options).then(noop$2).catch(noop$2);
|
|
5860
5824
|
}
|
|
5861
5825
|
resumePausedMutations() {
|
|
5862
|
-
|
|
5863
|
-
return __privateGet(this, _mutationCache2).resumePausedMutations();
|
|
5864
|
-
}
|
|
5865
|
-
return Promise.resolve();
|
|
5826
|
+
return __privateGet(this, _mutationCache2).resumePausedMutations();
|
|
5866
5827
|
}
|
|
5867
5828
|
getQueryCache() {
|
|
5868
5829
|
return __privateGet(this, _queryCache);
|
|
@@ -5909,12 +5870,12 @@ var QueryClient = (_h = class {
|
|
|
5909
5870
|
return result;
|
|
5910
5871
|
}
|
|
5911
5872
|
defaultQueryOptions(options) {
|
|
5912
|
-
if (options._defaulted) {
|
|
5873
|
+
if (options == null ? void 0 : options._defaulted) {
|
|
5913
5874
|
return options;
|
|
5914
5875
|
}
|
|
5915
5876
|
const defaultedOptions = {
|
|
5916
5877
|
...__privateGet(this, _defaultOptions3).queries,
|
|
5917
|
-
...this.getQueryDefaults(options.queryKey),
|
|
5878
|
+
...(options == null ? void 0 : options.queryKey) && this.getQueryDefaults(options.queryKey),
|
|
5918
5879
|
...options,
|
|
5919
5880
|
_defaulted: true
|
|
5920
5881
|
};
|
|
@@ -5924,18 +5885,15 @@ var QueryClient = (_h = class {
|
|
|
5924
5885
|
defaultedOptions
|
|
5925
5886
|
);
|
|
5926
5887
|
}
|
|
5927
|
-
if (defaultedOptions.refetchOnReconnect ===
|
|
5888
|
+
if (typeof defaultedOptions.refetchOnReconnect === "undefined") {
|
|
5928
5889
|
defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always";
|
|
5929
5890
|
}
|
|
5930
|
-
if (defaultedOptions.throwOnError ===
|
|
5891
|
+
if (typeof defaultedOptions.throwOnError === "undefined") {
|
|
5931
5892
|
defaultedOptions.throwOnError = !!defaultedOptions.suspense;
|
|
5932
5893
|
}
|
|
5933
|
-
if (
|
|
5894
|
+
if (typeof defaultedOptions.networkMode === "undefined" && defaultedOptions.persister) {
|
|
5934
5895
|
defaultedOptions.networkMode = "offlineFirst";
|
|
5935
5896
|
}
|
|
5936
|
-
if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {
|
|
5937
|
-
defaultedOptions.enabled = false;
|
|
5938
|
-
}
|
|
5939
5897
|
return defaultedOptions;
|
|
5940
5898
|
}
|
|
5941
5899
|
defaultMutationOptions(options) {
|
|
@@ -5981,9 +5939,13 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
5981
5939
|
__privateAdd(this, _staleTimeoutId, void 0);
|
|
5982
5940
|
__privateAdd(this, _refetchIntervalId, void 0);
|
|
5983
5941
|
__privateAdd(this, _currentRefetchInterval, void 0);
|
|
5984
|
-
__privateAdd(this, _trackedProps,
|
|
5985
|
-
this
|
|
5942
|
+
__privateAdd(this, _trackedProps, void 0);
|
|
5943
|
+
__privateSet(this, _currentQuery, void 0);
|
|
5944
|
+
__privateSet(this, _currentQueryInitialState, void 0);
|
|
5945
|
+
__privateSet(this, _currentResult, void 0);
|
|
5946
|
+
__privateSet(this, _trackedProps, /* @__PURE__ */ new Set());
|
|
5986
5947
|
__privateSet(this, _client, client);
|
|
5948
|
+
this.options = options;
|
|
5987
5949
|
__privateSet(this, _selectError, null);
|
|
5988
5950
|
this.bindMethods();
|
|
5989
5951
|
this.setOptions(options);
|
|
@@ -6031,18 +5993,20 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6031
5993
|
const prevOptions = this.options;
|
|
6032
5994
|
const prevQuery = __privateGet(this, _currentQuery);
|
|
6033
5995
|
this.options = __privateGet(this, _client).defaultQueryOptions(options);
|
|
6034
|
-
if (
|
|
6035
|
-
throw new Error("Expected enabled to be a boolean");
|
|
6036
|
-
}
|
|
6037
|
-
__privateMethod(this, _updateQuery, updateQuery_fn).call(this);
|
|
6038
|
-
__privateGet(this, _currentQuery).setOptions(this.options);
|
|
6039
|
-
if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {
|
|
5996
|
+
if (!shallowEqualObjects(prevOptions, this.options)) {
|
|
6040
5997
|
__privateGet(this, _client).getQueryCache().notify({
|
|
6041
5998
|
type: "observerOptionsUpdated",
|
|
6042
5999
|
query: __privateGet(this, _currentQuery),
|
|
6043
6000
|
observer: this
|
|
6044
6001
|
});
|
|
6045
6002
|
}
|
|
6003
|
+
if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") {
|
|
6004
|
+
throw new Error("Expected enabled to be a boolean");
|
|
6005
|
+
}
|
|
6006
|
+
if (!this.options.queryKey) {
|
|
6007
|
+
this.options.queryKey = prevOptions.queryKey;
|
|
6008
|
+
}
|
|
6009
|
+
__privateMethod(this, _updateQuery, updateQuery_fn).call(this);
|
|
6046
6010
|
const mounted = this.hasListeners();
|
|
6047
6011
|
if (mounted && shouldFetchOptionally(
|
|
6048
6012
|
__privateGet(this, _currentQuery),
|
|
@@ -6074,24 +6038,20 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6074
6038
|
getCurrentResult() {
|
|
6075
6039
|
return __privateGet(this, _currentResult);
|
|
6076
6040
|
}
|
|
6077
|
-
trackResult(result
|
|
6041
|
+
trackResult(result) {
|
|
6078
6042
|
const trackedResult = {};
|
|
6079
6043
|
Object.keys(result).forEach((key) => {
|
|
6080
6044
|
Object.defineProperty(trackedResult, key, {
|
|
6081
6045
|
configurable: false,
|
|
6082
6046
|
enumerable: true,
|
|
6083
6047
|
get: () => {
|
|
6084
|
-
this.
|
|
6085
|
-
onPropTracked == null ? void 0 : onPropTracked(key);
|
|
6048
|
+
__privateGet(this, _trackedProps).add(key);
|
|
6086
6049
|
return result[key];
|
|
6087
6050
|
}
|
|
6088
6051
|
});
|
|
6089
6052
|
});
|
|
6090
6053
|
return trackedResult;
|
|
6091
6054
|
}
|
|
6092
|
-
trackProp(key) {
|
|
6093
|
-
__privateGet(this, _trackedProps).add(key);
|
|
6094
|
-
}
|
|
6095
6055
|
getCurrentQuery() {
|
|
6096
6056
|
return __privateGet(this, _currentQuery);
|
|
6097
6057
|
}
|
|
@@ -6125,7 +6085,7 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6125
6085
|
const queryChange = query !== prevQuery;
|
|
6126
6086
|
const queryInitialState = queryChange ? query.state : __privateGet(this, _currentQueryInitialState);
|
|
6127
6087
|
const { state } = query;
|
|
6128
|
-
let
|
|
6088
|
+
let { error, errorUpdatedAt, fetchStatus, status } = state;
|
|
6129
6089
|
let isPlaceholderData = false;
|
|
6130
6090
|
let data;
|
|
6131
6091
|
if (options._optimisticResults) {
|
|
@@ -6133,23 +6093,22 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6133
6093
|
const fetchOnMount = !mounted && shouldFetchOnMount(query, options);
|
|
6134
6094
|
const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);
|
|
6135
6095
|
if (fetchOnMount || fetchOptionally) {
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
}
|
|
6096
|
+
fetchStatus = canFetch(query.options.networkMode) ? "fetching" : "paused";
|
|
6097
|
+
if (!state.dataUpdatedAt) {
|
|
6098
|
+
status = "pending";
|
|
6099
|
+
}
|
|
6140
6100
|
}
|
|
6141
6101
|
if (options._optimisticResults === "isRestoring") {
|
|
6142
|
-
|
|
6102
|
+
fetchStatus = "idle";
|
|
6143
6103
|
}
|
|
6144
6104
|
}
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
if (prevResult && newState.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) {
|
|
6105
|
+
if (options.select && typeof state.data !== "undefined") {
|
|
6106
|
+
if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === __privateGet(this, _selectFn)) {
|
|
6148
6107
|
data = __privateGet(this, _selectResult);
|
|
6149
6108
|
} else {
|
|
6150
6109
|
try {
|
|
6151
6110
|
__privateSet(this, _selectFn, options.select);
|
|
6152
|
-
data = options.select(
|
|
6111
|
+
data = options.select(state.data);
|
|
6153
6112
|
data = replaceData(prevResult == null ? void 0 : prevResult.data, data, options);
|
|
6154
6113
|
__privateSet(this, _selectResult, data);
|
|
6155
6114
|
__privateSet(this, _selectError, null);
|
|
@@ -6158,9 +6117,9 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6158
6117
|
}
|
|
6159
6118
|
}
|
|
6160
6119
|
} else {
|
|
6161
|
-
data =
|
|
6120
|
+
data = state.data;
|
|
6162
6121
|
}
|
|
6163
|
-
if (options.placeholderData !==
|
|
6122
|
+
if (typeof options.placeholderData !== "undefined" && typeof data === "undefined" && status === "pending") {
|
|
6164
6123
|
let placeholderData;
|
|
6165
6124
|
if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {
|
|
6166
6125
|
placeholderData = prevResult.data;
|
|
@@ -6169,7 +6128,7 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6169
6128
|
(_a2 = __privateGet(this, _lastQueryWithDefinedData)) == null ? void 0 : _a2.state.data,
|
|
6170
6129
|
__privateGet(this, _lastQueryWithDefinedData)
|
|
6171
6130
|
) : options.placeholderData;
|
|
6172
|
-
if (options.select && placeholderData !==
|
|
6131
|
+
if (options.select && typeof placeholderData !== "undefined") {
|
|
6173
6132
|
try {
|
|
6174
6133
|
placeholderData = options.select(placeholderData);
|
|
6175
6134
|
__privateSet(this, _selectError, null);
|
|
@@ -6178,7 +6137,7 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6178
6137
|
}
|
|
6179
6138
|
}
|
|
6180
6139
|
}
|
|
6181
|
-
if (placeholderData !==
|
|
6140
|
+
if (typeof placeholderData !== "undefined") {
|
|
6182
6141
|
status = "success";
|
|
6183
6142
|
data = replaceData(
|
|
6184
6143
|
prevResult == null ? void 0 : prevResult.data,
|
|
@@ -6194,34 +6153,33 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6194
6153
|
errorUpdatedAt = Date.now();
|
|
6195
6154
|
status = "error";
|
|
6196
6155
|
}
|
|
6197
|
-
const isFetching =
|
|
6156
|
+
const isFetching = fetchStatus === "fetching";
|
|
6198
6157
|
const isPending = status === "pending";
|
|
6199
6158
|
const isError2 = status === "error";
|
|
6200
6159
|
const isLoading = isPending && isFetching;
|
|
6201
|
-
const hasData = data !== void 0;
|
|
6202
6160
|
const result = {
|
|
6203
6161
|
status,
|
|
6204
|
-
fetchStatus
|
|
6162
|
+
fetchStatus,
|
|
6205
6163
|
isPending,
|
|
6206
6164
|
isSuccess: status === "success",
|
|
6207
6165
|
isError: isError2,
|
|
6208
6166
|
isInitialLoading: isLoading,
|
|
6209
6167
|
isLoading,
|
|
6210
6168
|
data,
|
|
6211
|
-
dataUpdatedAt:
|
|
6169
|
+
dataUpdatedAt: state.dataUpdatedAt,
|
|
6212
6170
|
error,
|
|
6213
6171
|
errorUpdatedAt,
|
|
6214
|
-
failureCount:
|
|
6215
|
-
failureReason:
|
|
6216
|
-
errorUpdateCount:
|
|
6217
|
-
isFetched:
|
|
6218
|
-
isFetchedAfterMount:
|
|
6172
|
+
failureCount: state.fetchFailureCount,
|
|
6173
|
+
failureReason: state.fetchFailureReason,
|
|
6174
|
+
errorUpdateCount: state.errorUpdateCount,
|
|
6175
|
+
isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,
|
|
6176
|
+
isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,
|
|
6219
6177
|
isFetching,
|
|
6220
6178
|
isRefetching: isFetching && !isPending,
|
|
6221
|
-
isLoadingError: isError2 &&
|
|
6222
|
-
isPaused:
|
|
6179
|
+
isLoadingError: isError2 && state.dataUpdatedAt === 0,
|
|
6180
|
+
isPaused: fetchStatus === "paused",
|
|
6223
6181
|
isPlaceholderData,
|
|
6224
|
-
isRefetchError: isError2 &&
|
|
6182
|
+
isRefetchError: isError2 && state.dataUpdatedAt !== 0,
|
|
6225
6183
|
isStale: isStale(query, options),
|
|
6226
6184
|
refetch: this.refetch
|
|
6227
6185
|
};
|
|
@@ -6349,10 +6307,10 @@ var QueryObserver = (_i = class extends Subscribable {
|
|
|
6349
6307
|
});
|
|
6350
6308
|
}, _i);
|
|
6351
6309
|
function shouldLoadOnMount(query, options) {
|
|
6352
|
-
return options.enabled !== false && query.state.
|
|
6310
|
+
return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === "error" && options.retryOnMount === false);
|
|
6353
6311
|
}
|
|
6354
6312
|
function shouldFetchOnMount(query, options) {
|
|
6355
|
-
return shouldLoadOnMount(query, options) || query.state.
|
|
6313
|
+
return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount);
|
|
6356
6314
|
}
|
|
6357
6315
|
function shouldFetchOn(query, options, field) {
|
|
6358
6316
|
if (options.enabled !== false) {
|
|
@@ -6362,10 +6320,10 @@ function shouldFetchOn(query, options, field) {
|
|
|
6362
6320
|
return false;
|
|
6363
6321
|
}
|
|
6364
6322
|
function shouldFetchOptionally(query, prevQuery, options, prevOptions) {
|
|
6365
|
-
return (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
|
|
6323
|
+
return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options);
|
|
6366
6324
|
}
|
|
6367
6325
|
function isStale(query, options) {
|
|
6368
|
-
return
|
|
6326
|
+
return query.isStaleByTime(options.staleTime);
|
|
6369
6327
|
}
|
|
6370
6328
|
function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
|
|
6371
6329
|
if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {
|
|
@@ -6374,6 +6332,7 @@ function shouldAssignObserverCurrentProperties(observer, optimisticResult) {
|
|
|
6374
6332
|
return false;
|
|
6375
6333
|
}
|
|
6376
6334
|
var InfiniteQueryObserver = class extends QueryObserver {
|
|
6335
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
6377
6336
|
constructor(client, options) {
|
|
6378
6337
|
super(client, options);
|
|
6379
6338
|
}
|
|
@@ -6439,6 +6398,7 @@ var MutationObserver$1 = (_j = class extends Subscribable {
|
|
|
6439
6398
|
__privateAdd(this, _currentResult2, void 0);
|
|
6440
6399
|
__privateAdd(this, _currentMutation, void 0);
|
|
6441
6400
|
__privateAdd(this, _mutateOptions, void 0);
|
|
6401
|
+
__privateSet(this, _currentResult2, void 0);
|
|
6442
6402
|
__privateSet(this, _client2, client);
|
|
6443
6403
|
this.setOptions(options);
|
|
6444
6404
|
this.bindMethods();
|
|
@@ -6452,18 +6412,14 @@ var MutationObserver$1 = (_j = class extends Subscribable {
|
|
|
6452
6412
|
var _a2;
|
|
6453
6413
|
const prevOptions = this.options;
|
|
6454
6414
|
this.options = __privateGet(this, _client2).defaultMutationOptions(options);
|
|
6455
|
-
if (!shallowEqualObjects(this.options
|
|
6415
|
+
if (!shallowEqualObjects(prevOptions, this.options)) {
|
|
6456
6416
|
__privateGet(this, _client2).getMutationCache().notify({
|
|
6457
6417
|
type: "observerOptionsUpdated",
|
|
6458
6418
|
mutation: __privateGet(this, _currentMutation),
|
|
6459
6419
|
observer: this
|
|
6460
6420
|
});
|
|
6461
6421
|
}
|
|
6462
|
-
|
|
6463
|
-
this.reset();
|
|
6464
|
-
} else if (((_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.state.status) === "pending") {
|
|
6465
|
-
__privateGet(this, _currentMutation).setOptions(this.options);
|
|
6466
|
-
}
|
|
6422
|
+
(_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.setOptions(this.options);
|
|
6467
6423
|
}
|
|
6468
6424
|
onUnsubscribe() {
|
|
6469
6425
|
var _a2;
|
|
@@ -6479,8 +6435,6 @@ var MutationObserver$1 = (_j = class extends Subscribable {
|
|
|
6479
6435
|
return __privateGet(this, _currentResult2);
|
|
6480
6436
|
}
|
|
6481
6437
|
reset() {
|
|
6482
|
-
var _a2;
|
|
6483
|
-
(_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.removeObserver(this);
|
|
6484
6438
|
__privateSet(this, _currentMutation, void 0);
|
|
6485
6439
|
__privateMethod(this, _updateResult, updateResult_fn).call(this);
|
|
6486
6440
|
__privateMethod(this, _notify2, notify_fn2).call(this);
|
|
@@ -6509,19 +6463,33 @@ var MutationObserver$1 = (_j = class extends Subscribable {
|
|
|
6509
6463
|
notifyManager.batch(() => {
|
|
6510
6464
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
6511
6465
|
if (__privateGet(this, _mutateOptions) && this.hasListeners()) {
|
|
6512
|
-
const variables = __privateGet(this, _currentResult2).variables;
|
|
6513
|
-
const context2 = __privateGet(this, _currentResult2).context;
|
|
6514
6466
|
if ((action == null ? void 0 : action.type) === "success") {
|
|
6515
|
-
(_b2 = (_a2 = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b2.call(
|
|
6516
|
-
|
|
6467
|
+
(_b2 = (_a2 = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b2.call(
|
|
6468
|
+
_a2,
|
|
6469
|
+
action.data,
|
|
6470
|
+
__privateGet(this, _currentResult2).variables,
|
|
6471
|
+
__privateGet(this, _currentResult2).context
|
|
6472
|
+
);
|
|
6473
|
+
(_d2 = (_c2 = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d2.call(
|
|
6474
|
+
_c2,
|
|
6475
|
+
action.data,
|
|
6476
|
+
null,
|
|
6477
|
+
__privateGet(this, _currentResult2).variables,
|
|
6478
|
+
__privateGet(this, _currentResult2).context
|
|
6479
|
+
);
|
|
6517
6480
|
} else if ((action == null ? void 0 : action.type) === "error") {
|
|
6518
|
-
(_f2 = (_e2 = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f2.call(
|
|
6481
|
+
(_f2 = (_e2 = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f2.call(
|
|
6482
|
+
_e2,
|
|
6483
|
+
action.error,
|
|
6484
|
+
__privateGet(this, _currentResult2).variables,
|
|
6485
|
+
__privateGet(this, _currentResult2).context
|
|
6486
|
+
);
|
|
6519
6487
|
(_h2 = (_g2 = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h2.call(
|
|
6520
6488
|
_g2,
|
|
6521
6489
|
void 0,
|
|
6522
6490
|
action.error,
|
|
6523
|
-
variables,
|
|
6524
|
-
|
|
6491
|
+
__privateGet(this, _currentResult2).variables,
|
|
6492
|
+
__privateGet(this, _currentResult2).context
|
|
6525
6493
|
);
|
|
6526
6494
|
}
|
|
6527
6495
|
}
|
|
@@ -6553,7 +6521,7 @@ var QueryClientProvider = ({
|
|
|
6553
6521
|
client.unmount();
|
|
6554
6522
|
};
|
|
6555
6523
|
}, [client]);
|
|
6556
|
-
return /* @__PURE__ */
|
|
6524
|
+
return /* @__PURE__ */ reactExports.createElement(QueryClientContext.Provider, { value: client }, children);
|
|
6557
6525
|
};
|
|
6558
6526
|
var IsRestoringContext = reactExports.createContext(false);
|
|
6559
6527
|
var useIsRestoring = () => reactExports.useContext(IsRestoringContext);
|
|
@@ -6580,8 +6548,6 @@ function shouldThrowError(throwError, params) {
|
|
|
6580
6548
|
}
|
|
6581
6549
|
return !!throwError;
|
|
6582
6550
|
}
|
|
6583
|
-
function noop$1() {
|
|
6584
|
-
}
|
|
6585
6551
|
var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {
|
|
6586
6552
|
if (options.suspense || options.throwOnError) {
|
|
6587
6553
|
if (!errorResetBoundary.isReset()) {
|
|
@@ -6600,7 +6566,7 @@ var getHasError = ({
|
|
|
6600
6566
|
throwOnError,
|
|
6601
6567
|
query
|
|
6602
6568
|
}) => {
|
|
6603
|
-
return result.isError && !errorResetBoundary.isReset() && !result.isFetching &&
|
|
6569
|
+
return result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(throwOnError, [result.error, query]);
|
|
6604
6570
|
};
|
|
6605
6571
|
var ensureStaleTime = (defaultedOptions) => {
|
|
6606
6572
|
if (defaultedOptions.suspense) {
|
|
@@ -6651,7 +6617,7 @@ function useBaseQuery(options, Observer2, queryClient2) {
|
|
|
6651
6617
|
result,
|
|
6652
6618
|
errorResetBoundary,
|
|
6653
6619
|
throwOnError: defaultedOptions.throwOnError,
|
|
6654
|
-
query:
|
|
6620
|
+
query: observer.getCurrentQuery()
|
|
6655
6621
|
})) {
|
|
6656
6622
|
throw result.error;
|
|
6657
6623
|
}
|
|
@@ -6690,9 +6656,12 @@ function useMutation(options, queryClient2) {
|
|
|
6690
6656
|
}
|
|
6691
6657
|
return { ...result, mutate, mutateAsync: result.mutate };
|
|
6692
6658
|
}
|
|
6659
|
+
function noop$1() {
|
|
6660
|
+
}
|
|
6693
6661
|
function useInfiniteQuery(options, queryClient2) {
|
|
6694
6662
|
return useBaseQuery(
|
|
6695
6663
|
options,
|
|
6664
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
6696
6665
|
InfiniteQueryObserver,
|
|
6697
6666
|
queryClient2
|
|
6698
6667
|
);
|
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=1.0-b2school-SNAPSHOT 18/04/2024 15:
|
|
1
|
+
ode-explorer=1.0-b2school-SNAPSHOT 18/04/2024 15:32:42
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ode-explorer",
|
|
3
|
-
"version": "1.4.2-develop-pedago.
|
|
3
|
+
"version": "1.4.2-develop-pedago.202404181532",
|
|
4
4
|
"description": "Edifice Explorer",
|
|
5
5
|
"homepage": "https://github.com/edificeio/explorer#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@edifice-ui/icons": "develop-pedago",
|
|
40
40
|
"@edifice-ui/react": "develop-pedago",
|
|
41
41
|
"@react-spring/web": "9.7.3",
|
|
42
|
-
"@tanstack/react-query": "5.
|
|
42
|
+
"@tanstack/react-query": "5.8.4",
|
|
43
43
|
"clsx": "2.1.0",
|
|
44
44
|
"dayjs": "1.11.10",
|
|
45
45
|
"i18next": "23.8.1",
|