@opengeoweb/workspace 8.3.0 → 8.3.1

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.
Files changed (2) hide show
  1. package/index.esm.js +192 -135
  2. package/package.json +16 -16
package/index.esm.js CHANGED
@@ -383,6 +383,39 @@ function isPlainObject$1(value) {
383
383
  }
384
384
  return proto === baseProto;
385
385
  }
386
+ // src/createAction.ts
387
+ function createAction(type, prepareAction) {
388
+ function actionCreator() {
389
+ var args = [];
390
+ for (var _i = 0; _i < arguments.length; _i++) {
391
+ args[_i] = arguments[_i];
392
+ }
393
+ if (prepareAction) {
394
+ var prepared = prepareAction.apply(void 0, args);
395
+ if (!prepared) {
396
+ throw new Error("prepareAction did not return an object");
397
+ }
398
+ return __spreadValues(__spreadValues({
399
+ type: type,
400
+ payload: prepared.payload
401
+ }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
402
+ }
403
+ return { type: type, payload: args[0] };
404
+ }
405
+ actionCreator.toString = function () { return "" + type; };
406
+ actionCreator.type = type;
407
+ actionCreator.match = function (action) { return action.type === type; };
408
+ return actionCreator;
409
+ }
410
+ function isAction(action) {
411
+ return isPlainObject$1(action) && "type" in action;
412
+ }
413
+ function isFSA(action) {
414
+ return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
415
+ }
416
+ function isValidKey(key) {
417
+ return ["type", "payload", "error", "meta"].indexOf(key) > -1;
418
+ }
386
419
  /** @class */ ((function (_super) {
387
420
  __extends(MiddlewareArray, _super);
388
421
  function MiddlewareArray() {
@@ -465,39 +498,6 @@ function freezeDraftable(val) {
465
498
  process.env.NODE_ENV === "production";
466
499
  // src/configureStore.ts
467
500
  process.env.NODE_ENV === "production";
468
- // src/createAction.ts
469
- function createAction(type, prepareAction) {
470
- function actionCreator() {
471
- var args = [];
472
- for (var _i = 0; _i < arguments.length; _i++) {
473
- args[_i] = arguments[_i];
474
- }
475
- if (prepareAction) {
476
- var prepared = prepareAction.apply(void 0, args);
477
- if (!prepared) {
478
- throw new Error("prepareAction did not return an object");
479
- }
480
- return __spreadValues(__spreadValues({
481
- type: type,
482
- payload: prepared.payload
483
- }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
484
- }
485
- return { type: type, payload: args[0] };
486
- }
487
- actionCreator.toString = function () { return "" + type; };
488
- actionCreator.type = type;
489
- actionCreator.match = function (action) { return action.type === type; };
490
- return actionCreator;
491
- }
492
- function isAction(action) {
493
- return isPlainObject$1(action) && "type" in action;
494
- }
495
- function isFSA(action) {
496
- return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
497
- }
498
- function isValidKey(key) {
499
- return ["type", "payload", "error", "meta"].indexOf(key) > -1;
500
- }
501
501
  // src/mapBuilders.ts
502
502
  function executeReducerBuilderCallback(builderCallback) {
503
503
  var actionsMap = {};
@@ -514,8 +514,11 @@ function executeReducerBuilderCallback(builderCallback) {
514
514
  }
515
515
  }
516
516
  var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
517
+ if (!type) {
518
+ throw new Error("`builder.addCase` cannot be called with an empty action type");
519
+ }
517
520
  if (type in actionsMap) {
518
- throw new Error("addCase cannot be called with two reducers for the same action type");
521
+ throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
519
522
  }
520
523
  actionsMap[type] = reducer;
521
524
  return builder;
@@ -24681,12 +24684,12 @@ function getContext() {
24681
24684
 
24682
24685
  const ReactReduxContext = /*#__PURE__*/getContext();
24683
24686
 
24684
- /**
24685
- * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
24686
- * hook that you should usually not need to call directly.
24687
- *
24688
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
24689
- * @returns {Function} A `useReduxContext` hook bound to the specified context.
24687
+ /**
24688
+ * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
24689
+ * hook that you should usually not need to call directly.
24690
+ *
24691
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
24692
+ * @returns {Function} A `useReduxContext` hook bound to the specified context.
24690
24693
  */
24691
24694
  function createReduxContextHook(context = ReactReduxContext) {
24692
24695
  return function useReduxContext() {
@@ -24699,21 +24702,21 @@ function createReduxContextHook(context = ReactReduxContext) {
24699
24702
  return contextValue;
24700
24703
  };
24701
24704
  }
24702
- /**
24703
- * A hook to access the value of the `ReactReduxContext`. This is a low-level
24704
- * hook that you should usually not need to call directly.
24705
- *
24706
- * @returns {any} the value of the `ReactReduxContext`
24707
- *
24708
- * @example
24709
- *
24710
- * import React from 'react'
24711
- * import { useReduxContext } from 'react-redux'
24712
- *
24713
- * export const CounterComponent = () => {
24714
- * const { store } = useReduxContext()
24715
- * return <div>{store.getState()}</div>
24716
- * }
24705
+ /**
24706
+ * A hook to access the value of the `ReactReduxContext`. This is a low-level
24707
+ * hook that you should usually not need to call directly.
24708
+ *
24709
+ * @returns {any} the value of the `ReactReduxContext`
24710
+ *
24711
+ * @example
24712
+ *
24713
+ * import React from 'react'
24714
+ * import { useReduxContext } from 'react-redux'
24715
+ *
24716
+ * export const CounterComponent = () => {
24717
+ * const { store } = useReduxContext()
24718
+ * return <div>{store.getState()}</div>
24719
+ * }
24717
24720
  */
24718
24721
 
24719
24722
  const useReduxContext = /*#__PURE__*/createReduxContextHook();
@@ -24728,11 +24731,11 @@ const initializeUseSelector = fn => {
24728
24731
  };
24729
24732
 
24730
24733
  const refEquality = (a, b) => a === b;
24731
- /**
24732
- * Hook factory, which creates a `useSelector` hook bound to a given context.
24733
- *
24734
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
24735
- * @returns {Function} A `useSelector` hook bound to the specified context.
24734
+ /**
24735
+ * Hook factory, which creates a `useSelector` hook bound to a given context.
24736
+ *
24737
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
24738
+ * @returns {Function} A `useSelector` hook bound to the specified context.
24736
24739
  */
24737
24740
 
24738
24741
 
@@ -24780,10 +24783,21 @@ function createSelectorHook(context = ReactReduxContext) {
24780
24783
  const toCompare = selector(state);
24781
24784
 
24782
24785
  if (!equalityFn(selected, toCompare)) {
24786
+ let stack = undefined;
24787
+
24788
+ try {
24789
+ throw new Error();
24790
+ } catch (e) {
24791
+ ({
24792
+ stack
24793
+ } = e);
24794
+ }
24795
+
24783
24796
  console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {
24784
24797
  state,
24785
24798
  selected,
24786
- selected2: toCompare
24799
+ selected2: toCompare,
24800
+ stack
24787
24801
  });
24788
24802
  }
24789
24803
  }
@@ -24793,7 +24807,19 @@ function createSelectorHook(context = ReactReduxContext) {
24793
24807
  if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {
24794
24808
  // @ts-ignore
24795
24809
  if (selected === state) {
24796
- console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.');
24810
+ let stack = undefined;
24811
+
24812
+ try {
24813
+ throw new Error();
24814
+ } catch (e) {
24815
+ ({
24816
+ stack
24817
+ } = e);
24818
+ }
24819
+
24820
+ console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {
24821
+ stack
24822
+ });
24797
24823
  }
24798
24824
  }
24799
24825
 
@@ -24809,28 +24835,28 @@ function createSelectorHook(context = ReactReduxContext) {
24809
24835
  return selectedState;
24810
24836
  };
24811
24837
  }
24812
- /**
24813
- * A hook to access the redux store's state. This hook takes a selector function
24814
- * as an argument. The selector is called with the store state.
24815
- *
24816
- * This hook takes an optional equality comparison function as the second parameter
24817
- * that allows you to customize the way the selected state is compared to determine
24818
- * whether the component needs to be re-rendered.
24819
- *
24820
- * @param {Function} selector the selector function
24821
- * @param {Function=} equalityFn the function that will be used to determine equality
24822
- *
24823
- * @returns {any} the selected state
24824
- *
24825
- * @example
24826
- *
24827
- * import React from 'react'
24828
- * import { useSelector } from 'react-redux'
24829
- *
24830
- * export const CounterComponent = () => {
24831
- * const counter = useSelector(state => state.counter)
24832
- * return <div>{counter}</div>
24833
- * }
24838
+ /**
24839
+ * A hook to access the redux store's state. This hook takes a selector function
24840
+ * as an argument. The selector is called with the store state.
24841
+ *
24842
+ * This hook takes an optional equality comparison function as the second parameter
24843
+ * that allows you to customize the way the selected state is compared to determine
24844
+ * whether the component needs to be re-rendered.
24845
+ *
24846
+ * @param {Function} selector the selector function
24847
+ * @param {Function=} equalityFn the function that will be used to determine equality
24848
+ *
24849
+ * @returns {any} the selected state
24850
+ *
24851
+ * @example
24852
+ *
24853
+ * import React from 'react'
24854
+ * import { useSelector } from 'react-redux'
24855
+ *
24856
+ * export const CounterComponent = () => {
24857
+ * const counter = useSelector(state => state.counter)
24858
+ * return <div>{counter}</div>
24859
+ * }
24834
24860
  */
24835
24861
 
24836
24862
  const useSelector = /*#__PURE__*/createSelectorHook();
@@ -25392,11 +25418,24 @@ const nullListeners = {
25392
25418
  };
25393
25419
  function createSubscription(store, parentSub) {
25394
25420
  let unsubscribe;
25395
- let listeners = nullListeners;
25421
+ let listeners = nullListeners; // Reasons to keep the subscription active
25422
+
25423
+ let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?)
25424
+
25425
+ let selfSubscribed = false;
25396
25426
 
25397
25427
  function addNestedSub(listener) {
25398
25428
  trySubscribe();
25399
- return listeners.subscribe(listener);
25429
+ const cleanupListener = listeners.subscribe(listener); // cleanup nested sub
25430
+
25431
+ let removed = false;
25432
+ return () => {
25433
+ if (!removed) {
25434
+ removed = true;
25435
+ cleanupListener();
25436
+ tryUnsubscribe();
25437
+ }
25438
+ };
25400
25439
  }
25401
25440
 
25402
25441
  function notifyNestedSubs() {
@@ -25410,10 +25449,12 @@ function createSubscription(store, parentSub) {
25410
25449
  }
25411
25450
 
25412
25451
  function isSubscribed() {
25413
- return Boolean(unsubscribe);
25452
+ return selfSubscribed;
25414
25453
  }
25415
25454
 
25416
25455
  function trySubscribe() {
25456
+ subscriptionsAmount++;
25457
+
25417
25458
  if (!unsubscribe) {
25418
25459
  unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);
25419
25460
  listeners = createListenerCollection();
@@ -25421,7 +25462,9 @@ function createSubscription(store, parentSub) {
25421
25462
  }
25422
25463
 
25423
25464
  function tryUnsubscribe() {
25424
- if (unsubscribe) {
25465
+ subscriptionsAmount--;
25466
+
25467
+ if (unsubscribe && subscriptionsAmount === 0) {
25425
25468
  unsubscribe();
25426
25469
  unsubscribe = undefined;
25427
25470
  listeners.clear();
@@ -25429,13 +25472,27 @@ function createSubscription(store, parentSub) {
25429
25472
  }
25430
25473
  }
25431
25474
 
25475
+ function trySubscribeSelf() {
25476
+ if (!selfSubscribed) {
25477
+ selfSubscribed = true;
25478
+ trySubscribe();
25479
+ }
25480
+ }
25481
+
25482
+ function tryUnsubscribeSelf() {
25483
+ if (selfSubscribed) {
25484
+ selfSubscribed = false;
25485
+ tryUnsubscribe();
25486
+ }
25487
+ }
25488
+
25432
25489
  const subscription = {
25433
25490
  addNestedSub,
25434
25491
  notifyNestedSubs,
25435
25492
  handleChangeWrapper,
25436
25493
  isSubscribed,
25437
- trySubscribe,
25438
- tryUnsubscribe,
25494
+ trySubscribe: trySubscribeSelf,
25495
+ tryUnsubscribe: tryUnsubscribeSelf,
25439
25496
  getListeners: () => listeners
25440
25497
  };
25441
25498
  return subscription;
@@ -25495,11 +25552,11 @@ function Provider({
25495
25552
  }, children);
25496
25553
  }
25497
25554
 
25498
- /**
25499
- * Hook factory, which creates a `useStore` hook bound to a given context.
25500
- *
25501
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
25502
- * @returns {Function} A `useStore` hook bound to the specified context.
25555
+ /**
25556
+ * Hook factory, which creates a `useStore` hook bound to a given context.
25557
+ *
25558
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
25559
+ * @returns {Function} A `useStore` hook bound to the specified context.
25503
25560
  */
25504
25561
 
25505
25562
  function createStoreHook(context = ReactReduxContext) {
@@ -25514,29 +25571,29 @@ function createStoreHook(context = ReactReduxContext) {
25514
25571
  return store;
25515
25572
  };
25516
25573
  }
25517
- /**
25518
- * A hook to access the redux store.
25519
- *
25520
- * @returns {any} the redux store
25521
- *
25522
- * @example
25523
- *
25524
- * import React from 'react'
25525
- * import { useStore } from 'react-redux'
25526
- *
25527
- * export const ExampleComponent = () => {
25528
- * const store = useStore()
25529
- * return <div>{store.getState()}</div>
25530
- * }
25574
+ /**
25575
+ * A hook to access the redux store.
25576
+ *
25577
+ * @returns {any} the redux store
25578
+ *
25579
+ * @example
25580
+ *
25581
+ * import React from 'react'
25582
+ * import { useStore } from 'react-redux'
25583
+ *
25584
+ * export const ExampleComponent = () => {
25585
+ * const store = useStore()
25586
+ * return <div>{store.getState()}</div>
25587
+ * }
25531
25588
  */
25532
25589
 
25533
25590
  const useStore = /*#__PURE__*/createStoreHook();
25534
25591
 
25535
- /**
25536
- * Hook factory, which creates a `useDispatch` hook bound to a given context.
25537
- *
25538
- * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
25539
- * @returns {Function} A `useDispatch` hook bound to the specified context.
25592
+ /**
25593
+ * Hook factory, which creates a `useDispatch` hook bound to a given context.
25594
+ *
25595
+ * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
25596
+ * @returns {Function} A `useDispatch` hook bound to the specified context.
25540
25597
  */
25541
25598
 
25542
25599
  function createDispatchHook(context = ReactReduxContext) {
@@ -25548,26 +25605,26 @@ function createDispatchHook(context = ReactReduxContext) {
25548
25605
  return store.dispatch;
25549
25606
  };
25550
25607
  }
25551
- /**
25552
- * A hook to access the redux `dispatch` function.
25553
- *
25554
- * @returns {any|function} redux store's `dispatch` function
25555
- *
25556
- * @example
25557
- *
25558
- * import React, { useCallback } from 'react'
25559
- * import { useDispatch } from 'react-redux'
25560
- *
25561
- * export const CounterComponent = ({ value }) => {
25562
- * const dispatch = useDispatch()
25563
- * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
25564
- * return (
25565
- * <div>
25566
- * <span>{value}</span>
25567
- * <button onClick={increaseCounter}>Increase counter</button>
25568
- * </div>
25569
- * )
25570
- * }
25608
+ /**
25609
+ * A hook to access the redux `dispatch` function.
25610
+ *
25611
+ * @returns {any|function} redux store's `dispatch` function
25612
+ *
25613
+ * @example
25614
+ *
25615
+ * import React, { useCallback } from 'react'
25616
+ * import { useDispatch } from 'react-redux'
25617
+ *
25618
+ * export const CounterComponent = ({ value }) => {
25619
+ * const dispatch = useDispatch()
25620
+ * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
25621
+ * return (
25622
+ * <div>
25623
+ * <span>{value}</span>
25624
+ * <button onClick={increaseCounter}>Increase counter</button>
25625
+ * </div>
25626
+ * )
25627
+ * }
25571
25628
  */
25572
25629
 
25573
25630
  const useDispatch = /*#__PURE__*/createDispatchHook();
@@ -31569,7 +31626,7 @@ tags.forEach(function (tagName) {
31569
31626
  });
31570
31627
 
31571
31628
  /**
31572
- * @mui/styled-engine v5.14.10
31629
+ * @mui/styled-engine v5.14.14
31573
31630
  *
31574
31631
  * @license MIT
31575
31632
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/workspace",
3
- "version": "8.3.0",
3
+ "version": "8.3.1",
4
4
  "description": "GeoWeb Workspace library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,29 +14,29 @@
14
14
  "peerDependencies": {
15
15
  "@emotion/react": "11.11.1",
16
16
  "@mui/material": "5.12.0",
17
- "@mui/system": "5.14.10",
18
- "@opengeoweb/api": "8.3.0",
19
- "@opengeoweb/authentication": "8.3.0",
20
- "@opengeoweb/core": "8.3.0",
21
- "@opengeoweb/form-fields": "8.3.0",
22
- "@opengeoweb/shared": "8.3.0",
23
- "@opengeoweb/sigmet-airmet": "8.3.0",
24
- "@opengeoweb/store": "8.3.0",
25
- "@opengeoweb/taf": "8.3.0",
26
- "@opengeoweb/theme": "8.3.0",
27
- "@opengeoweb/timeseries": "8.3.0",
28
- "@opengeoweb/webmap": "8.3.0",
17
+ "@mui/system": "5.14.14",
18
+ "@opengeoweb/api": "8.3.1",
19
+ "@opengeoweb/authentication": "8.3.1",
20
+ "@opengeoweb/core": "8.3.1",
21
+ "@opengeoweb/form-fields": "8.3.1",
22
+ "@opengeoweb/shared": "8.3.1",
23
+ "@opengeoweb/sigmet-airmet": "8.3.1",
24
+ "@opengeoweb/store": "8.3.1",
25
+ "@opengeoweb/taf": "8.3.1",
26
+ "@opengeoweb/theme": "8.3.1",
27
+ "@opengeoweb/timeseries": "8.3.1",
28
+ "@opengeoweb/webmap": "8.3.1",
29
29
  "@redux-eggs/core": "2.2.0",
30
30
  "@redux-eggs/redux-toolkit": "2.2.0",
31
31
  "@redux-eggs/saga-extension": "2.2.0",
32
- "@reduxjs/toolkit": "1.9.5",
32
+ "@reduxjs/toolkit": "1.9.7",
33
33
  "axios": "1.5.0",
34
34
  "immer": "9.0.21",
35
35
  "lodash": "4.17.21",
36
36
  "react": "18.2.0",
37
- "react-hook-form": "7.46.2",
37
+ "react-hook-form": "7.47.0",
38
38
  "react-mosaic-component": "6.1.0",
39
- "react-redux": "8.1.2",
39
+ "react-redux": "8.1.3",
40
40
  "react-window": "1.8.9",
41
41
  "redux-saga": "1.2.3"
42
42
  }