brew-js-react 0.7.0 → 0.7.2

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/dialog.d.ts CHANGED
@@ -14,7 +14,7 @@ export type DialogBaseProps<T, V = T> = Omit<DialogOptions<T, V | undefined>, 'o
14
14
  /** @deprecated */
15
15
  export type DialogRenderComponentProps<T, V = T> = DialogOptions<T, V | undefined> & DialogContext<V | undefined>;
16
16
 
17
- export type DialogControllerOptions = Omit<DialogOptions<any>, 'onRender' | 'onCommit' | 'onOpen' | 'onClose' | 'controller'>;
17
+ export type DialogControllerOptions = Omit<DialogOptions<any>, 'signal' | 'onRender' | 'onCommit' | 'onOpen' | 'onClose' | 'controller'>;
18
18
 
19
19
  export interface DialogControllerAdvancedOptions extends DialogControllerOptions, Pick<DialogOptions<any>, 'onClose' | 'onOpen' | 'preventLeave' | 'preventNavigation'> {
20
20
  /**
@@ -143,6 +143,16 @@ export interface DialogOptions<T, V = T | undefined> {
143
143
  * which is useful for reusable layout for dialogs.
144
144
  */
145
145
  wrapper?: React.FC<DialogContext<V> & this & React.PropsWithChildren<{}>>;
146
+ /**
147
+ * An optional signal object to dismiss the dialog.
148
+ *
149
+ * When signal is received, the dialog will be closed without invoking {@link DialogOptions.onCommit}.
150
+ * If the signal is already aborted before the dialog is open, the dialog will cease to be opened.
151
+ *
152
+ * In either case, the promise returned from {@link DialogState.open} will always resolve to `undefined`
153
+ * without the abort reason being propagated.
154
+ */
155
+ signal?: AbortSignal;
146
156
  }
147
157
 
148
158
  export interface DialogContext<V> {
package/dialog.js CHANGED
@@ -3,7 +3,7 @@ import ReactDOM from "react-dom";
3
3
  import ReactDOMClient from "@misonou/react-dom-client";
4
4
  import { createAsyncScope } from "zeta-dom-react";
5
5
  import { always, arrRemove, combineFn, createPrivateStore, defineObservableProperty, either, exclude, extend, noop, pick, resolve, setImmediate } from "zeta-dom/util";
6
- import { containsOrEquals, removeNode } from "zeta-dom/domUtil";
6
+ import { bind, containsOrEquals, removeNode } from "zeta-dom/domUtil";
7
7
  import dom from "zeta-dom/dom";
8
8
  import { runAsync, subscribeAsync } from "zeta-dom/domLock";
9
9
  import { closeFlyout, isFlyoutOpen, openFlyout } from "brew-js/domAction";
@@ -70,6 +70,15 @@ export function createDialog(props) {
70
70
  var closeDialog = shared ? noop : closeFlyout.bind(0, root);
71
71
 
72
72
  function render(closeDialog, props, container) {
73
+ var signal = props.signal;
74
+ if (signal) {
75
+ if (signal.aborted) {
76
+ return resolve();
77
+ }
78
+ closeDialog = combineFn(closeDialog, bind(signal, 'abort', function () {
79
+ closeDialog();
80
+ }));
81
+ }
73
82
  var commitDialog = props.onCommit ? function (value) {
74
83
  return runAsync(dom.activeElement, props.onCommit.bind(this, value)).then(closeDialog);
75
84
  } : closeDialog;
@@ -1,4 +1,4 @@
1
- /*! brew-js-react v0.7.0 | (c) misonou | https://misonou.github.io */
1
+ /*! brew-js-react v0.7.2 | (c) misonou | https://misonou.github.io */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("zeta-dom"), require("brew-js"), require("react"), require("react-dom"), require("zeta-dom-react"), require("waterpipe"), require("jquery"));
@@ -12,64 +12,64 @@
12
12
  return /******/ (() => { // webpackBootstrap
13
13
  /******/ var __webpack_modules__ = ({
14
14
 
15
- /***/ 87:
16
- /***/ ((module) => {
15
+ /***/ 87
16
+ (module) {
17
17
 
18
18
  "use strict";
19
19
  module.exports = __WEBPACK_EXTERNAL_MODULE__87__;
20
20
 
21
- /***/ }),
21
+ /***/ },
22
22
 
23
- /***/ 760:
24
- /***/ ((module) => {
23
+ /***/ 760
24
+ (module) {
25
25
 
26
26
  "use strict";
27
27
  module.exports = __WEBPACK_EXTERNAL_MODULE__760__;
28
28
 
29
- /***/ }),
29
+ /***/ },
30
30
 
31
- /***/ 914:
32
- /***/ ((module) => {
31
+ /***/ 914
32
+ (module) {
33
33
 
34
34
  "use strict";
35
35
  module.exports = __WEBPACK_EXTERNAL_MODULE__914__;
36
36
 
37
- /***/ }),
37
+ /***/ },
38
38
 
39
- /***/ 12:
40
- /***/ ((module) => {
39
+ /***/ 12
40
+ (module) {
41
41
 
42
42
  "use strict";
43
43
  module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
44
44
 
45
- /***/ }),
45
+ /***/ },
46
46
 
47
- /***/ 33:
48
- /***/ ((module) => {
47
+ /***/ 33
48
+ (module) {
49
49
 
50
50
  "use strict";
51
51
  module.exports = __WEBPACK_EXTERNAL_MODULE__33__;
52
52
 
53
- /***/ }),
53
+ /***/ },
54
54
 
55
- /***/ 231:
56
- /***/ ((module) => {
55
+ /***/ 231
56
+ (module) {
57
57
 
58
58
  "use strict";
59
59
  module.exports = __WEBPACK_EXTERNAL_MODULE__231__;
60
60
 
61
- /***/ }),
61
+ /***/ },
62
62
 
63
- /***/ 402:
64
- /***/ ((module) => {
63
+ /***/ 402
64
+ (module) {
65
65
 
66
66
  "use strict";
67
67
  module.exports = __WEBPACK_EXTERNAL_MODULE__402__;
68
68
 
69
- /***/ }),
69
+ /***/ },
70
70
 
71
- /***/ 621:
72
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
71
+ /***/ 621
72
+ (module, __unused_webpack_exports, __webpack_require__) {
73
73
 
74
74
  var ReactDOM = __webpack_require__(33);
75
75
  var ReactDOMClient;
@@ -99,7 +99,7 @@ if (ReactDOM.createRoot) {
99
99
  module.exports = ReactDOMClient;
100
100
 
101
101
 
102
- /***/ })
102
+ /***/ }
103
103
 
104
104
  /******/ });
105
105
  /************************************************************************/
@@ -158,7 +158,7 @@ module.exports = ReactDOMClient;
158
158
  /******/
159
159
  /************************************************************************/
160
160
  var __webpack_exports__ = {};
161
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
161
+ // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
162
162
  (() => {
163
163
  "use strict";
164
164
  // ESM COMPAT FLAG
@@ -197,11 +197,13 @@ __webpack_require__.d(__webpack_exports__, {
197
197
  registerErrorView: () => (/* reexport */ registerErrorView),
198
198
  registerView: () => (/* reexport */ registerView),
199
199
  renderView: () => (/* reexport */ renderView),
200
+ resetAllViews: () => (/* reexport */ resetAllViews),
200
201
  resolvePath: () => (/* reexport */ resolvePath),
201
202
  useAnimateMixin: () => (/* reexport */ useAnimateMixin),
202
203
  useAnimateSequenceMixin: () => (/* reexport */ useAnimateSequenceMixin),
203
204
  useAppReady: () => (/* reexport */ useAppReady),
204
205
  useAppReadyState: () => (/* reexport */ useAppReadyState),
206
+ useAppSessionState: () => (/* reexport */ useAppSessionState),
205
207
  useClassNameToggleMixin: () => (/* reexport */ useClassNameToggleMixin),
206
208
  useFlyoutMixin: () => (/* reexport */ useFlyoutMixin),
207
209
  useFocusStateMixin: () => (/* reexport */ useFocusStateMixin),
@@ -221,7 +223,7 @@ __webpack_require__.d(__webpack_exports__, {
221
223
 
222
224
  // EXTERNAL MODULE: external {"commonjs":"zeta-dom","commonjs2":"zeta-dom","amd":"zeta-dom","root":"zeta"}
223
225
  var external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_ = __webpack_require__(231);
224
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom/util.js
226
+ ;// ./|umd|/zeta-dom/util.js
225
227
 
226
228
  var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
227
229
  always = _lib$util.always,
@@ -260,6 +262,7 @@ var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_
260
262
  pick = _lib$util.pick,
261
263
  randomId = _lib$util.randomId,
262
264
  resolve = _lib$util.resolve,
265
+ sameValue = _lib$util.sameValue,
263
266
  setImmediate = _lib$util.setImmediate,
264
267
  setImmediateOnce = _lib$util.setImmediateOnce,
265
268
  single = _lib$util.single,
@@ -270,17 +273,18 @@ var _lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_
270
273
 
271
274
  // EXTERNAL MODULE: external {"commonjs":"brew-js","commonjs2":"brew-js","amd":"brew-js","root":"brew"}
272
275
  var external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_ = __webpack_require__(760);
273
- ;// CONCATENATED MODULE: ./|umd|/brew-js/app.js
276
+ ;// ./|umd|/brew-js/app.js
277
+ /* unused harmony import specifier */ var lib;
274
278
 
275
279
  /* harmony default export */ const app = ((/* unused pure expression or super */ null && (lib)));
276
280
  var addExtension = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.addExtension,
277
281
  install = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.install;
278
282
 
279
- ;// CONCATENATED MODULE: ./|umd|/brew-js/defaults.js
283
+ ;// ./|umd|/brew-js/defaults.js
280
284
 
281
285
  var defaults = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.defaults;
282
286
  /* harmony default export */ const brew_js_defaults = (defaults);
283
- ;// CONCATENATED MODULE: ./src/app.js
287
+ ;// ./src/app.js
284
288
 
285
289
 
286
290
 
@@ -303,7 +307,7 @@ install('react', extension);
303
307
  brew_js_defaults.react = true;
304
308
  // EXTERNAL MODULE: external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"}
305
309
  var external_commonjs_react_commonjs2_react_amd_react_root_React_ = __webpack_require__(12);
306
- ;// CONCATENATED MODULE: ./|umd|/react.js
310
+ ;// ./|umd|/react.js
307
311
 
308
312
  var Component = external_commonjs_react_commonjs2_react_amd_react_root_React_.Component,
309
313
  StrictMode = external_commonjs_react_commonjs2_react_amd_react_root_React_.StrictMode,
@@ -322,47 +326,49 @@ var external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_
322
326
  var fallback = __webpack_require__(621);
323
327
  // EXTERNAL MODULE: external {"commonjs":"zeta-dom-react","commonjs2":"zeta-dom-react","amd":"zeta-dom-react","root":["zeta","react"]}
324
328
  var external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_ = __webpack_require__(402);
325
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom-react.js
329
+ ;// ./|umd|/zeta-dom-react.js
326
330
 
327
331
  var ViewStateProvider = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.ViewStateProvider,
328
332
  classNames = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.classNames,
329
333
  createAsyncScope = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.createAsyncScope,
330
334
  useAsync = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useAsync,
335
+ useEagerReducer = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useEagerReducer,
331
336
  useEagerState = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useEagerState,
332
337
  useMemoizedFunction = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useMemoizedFunction,
333
338
  useObservableProperty = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useObservableProperty,
334
339
  useSingleton = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useSingleton,
335
340
  useValueTrigger = external_commonjs_zeta_dom_react_commonjs2_zeta_dom_react_amd_zeta_dom_react_root_zeta_react_.useValueTrigger;
336
341
 
337
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom/domUtil.js
342
+ ;// ./|umd|/zeta-dom/domUtil.js
338
343
 
339
344
  var domUtil_lib$util = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.util,
345
+ bind = domUtil_lib$util.bind,
340
346
  containsOrEquals = domUtil_lib$util.containsOrEquals,
341
347
  getClass = domUtil_lib$util.getClass,
342
348
  removeNode = domUtil_lib$util.removeNode,
343
349
  scrollIntoView = domUtil_lib$util.scrollIntoView,
344
350
  setClass = domUtil_lib$util.setClass;
345
351
 
346
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom/dom.js
352
+ ;// ./|umd|/zeta-dom/dom.js
347
353
 
348
354
  var dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom;
349
355
  /* harmony default export */ const zeta_dom_dom = (dom);
350
356
  var reportError = dom.reportError;
351
357
 
352
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom/domLock.js
358
+ ;// ./|umd|/zeta-dom/domLock.js
353
359
 
354
360
  var _lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
355
361
  runAsync = _lib$dom.runAsync,
356
362
  subscribeAsync = _lib$dom.subscribeAsync;
357
363
 
358
- ;// CONCATENATED MODULE: ./|umd|/brew-js/domAction.js
364
+ ;// ./|umd|/brew-js/domAction.js
359
365
 
360
366
  var closeFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.closeFlyout,
361
367
  isFlyoutOpen = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.isFlyoutOpen,
362
368
  openFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.openFlyout,
363
369
  toggleFlyout = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toggleFlyout;
364
370
 
365
- ;// CONCATENATED MODULE: ./src/dialog.js
371
+ ;// ./src/dialog.js
366
372
 
367
373
 
368
374
 
@@ -429,6 +435,15 @@ function createDialog(props) {
429
435
  var scope = state.scope || (state.scope = createAsyncScope(root));
430
436
  var closeDialog = shared ? noop : closeFlyout.bind(0, root);
431
437
  function render(closeDialog, props, container) {
438
+ var signal = props.signal;
439
+ if (signal) {
440
+ if (signal.aborted) {
441
+ return resolve();
442
+ }
443
+ closeDialog = combineFn(closeDialog, bind(signal, 'abort', function () {
444
+ closeDialog();
445
+ }));
446
+ }
432
447
  var commitDialog = props.onCommit ? function (value) {
433
448
  return runAsync(zeta_dom_dom.activeElement, props.onCommit.bind(this, value)).then(closeDialog);
434
449
  } : closeDialog;
@@ -556,27 +571,27 @@ function Dialog(props) {
556
571
  }, []);
557
572
  return /*#__PURE__*/external_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_root_ReactDOM_.createPortal(props.children, element);
558
573
  }
559
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom/events.js
574
+ ;// ./|umd|/zeta-dom/events.js
560
575
 
561
576
  var EventContainer = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.EventContainer;
562
577
 
563
- ;// CONCATENATED MODULE: ./|umd|/brew-js/util/common.js
578
+ ;// ./|umd|/brew-js/util/common.js
564
579
 
565
580
  var getQueryParam = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.getQueryParam,
566
581
  setQueryParam = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.setQueryParam,
567
582
  toQueryString = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.toQueryString;
568
583
 
569
- ;// CONCATENATED MODULE: ./|umd|/brew-js/util/path.js
584
+ ;// ./|umd|/brew-js/util/path.js
570
585
 
571
586
  var parsePath = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.parsePath,
572
587
  removeQueryAndHash = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.removeQueryAndHash;
573
588
 
574
- ;// CONCATENATED MODULE: ./|umd|/brew-js/anim.js
589
+ ;// ./|umd|/brew-js/anim.js
575
590
 
576
591
  var animateIn = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateIn,
577
592
  animateOut = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.animateOut;
578
593
 
579
- ;// CONCATENATED MODULE: ./src/view.js
594
+ ;// ./src/view.js
580
595
 
581
596
 
582
597
 
@@ -653,6 +668,16 @@ definePrototype(ViewContext, {
653
668
  errorView: errorView
654
669
  });
655
670
  },
671
+ resetView: function resetView() {
672
+ var self = this;
673
+ each(self.parent ? [self] : self.getChildren(), function (i, v) {
674
+ var wrapper = view_(v).wrapper;
675
+ wrapper.setState({
676
+ key: (wrapper.state.key || 0) + 1,
677
+ errorView: null
678
+ });
679
+ });
680
+ },
656
681
  on: function on(event, handler) {
657
682
  return emitter.add(this, event, handler);
658
683
  }
@@ -687,13 +712,15 @@ definePrototype(ErrorBoundary, Component, {
687
712
  var context = self.props.context;
688
713
  if (!context.container) {
689
714
  setImmediate(function () {
690
- extend(self, createAsyncScope(context.container));
691
- zeta_dom_dom.on(context.container, 'error', function (e) {
692
- return emitter.emit(e, context, {
693
- error: e.error
694
- }, false);
695
- });
696
- self.forceUpdate();
715
+ if (!self.errorHandler) {
716
+ extend(self, createAsyncScope(context.container));
717
+ zeta_dom_dom.on(context.container, 'error', function (e) {
718
+ return emitter.emit(e, context, {
719
+ error: e.error
720
+ }, false);
721
+ });
722
+ self.forceUpdate();
723
+ }
697
724
  });
698
725
  return null;
699
726
  }
@@ -707,6 +734,7 @@ definePrototype(ErrorBoundary, Component, {
707
734
  }));
708
735
  }
709
736
  var onError = self.componentDidCatch.bind(self);
737
+ var key = self.state.key || 0;
710
738
  var viewProps = {
711
739
  errorHandler: self.errorHandler,
712
740
  navigationType: view_event.navigationType,
@@ -714,6 +742,7 @@ definePrototype(ErrorBoundary, Component, {
714
742
  viewData: context.page.data || {}
715
743
  };
716
744
  return /*#__PURE__*/createElement(self.Provider, null, /*#__PURE__*/createElement(context.view, extend({
745
+ key: key,
717
746
  viewProps: viewProps,
718
747
  onError: onError
719
748
  }, self.props)));
@@ -910,7 +939,7 @@ function createViewComponent(factory) {
910
939
  }
911
940
  return function fn(props) {
912
941
  var children = promise || factory(props.viewProps);
913
- if (isThenable(children)) {
942
+ if (promise || isThenable(children)) {
914
943
  promise = children;
915
944
  catchAsync(promise);
916
945
  } else {
@@ -918,8 +947,8 @@ function createViewComponent(factory) {
918
947
  return children;
919
948
  }
920
949
  var component = useAsync(function () {
921
- return promise.then(null, function (error) {
922
- promise = null;
950
+ promise = true;
951
+ return (isThenable(children) || factory()).then(null, function (error) {
923
952
  props.onError(error);
924
953
  });
925
954
  })[0];
@@ -991,6 +1020,9 @@ function renderView() {
991
1020
  defaultView: defaultView
992
1021
  });
993
1022
  }
1023
+ function resetAllViews() {
1024
+ rootContext.resetView();
1025
+ }
994
1026
  function resolvePath(view, params) {
995
1027
  var suffix = '';
996
1028
  if (isArray(params)) {
@@ -1009,7 +1041,7 @@ function redirectTo(view, params, data) {
1009
1041
  return navigateTo(view, params, data, true);
1010
1042
  }
1011
1043
 
1012
- ;// CONCATENATED MODULE: ./src/hooks.js
1044
+ ;// ./src/hooks.js
1013
1045
 
1014
1046
 
1015
1047
 
@@ -1074,6 +1106,19 @@ function useViewContextWithEffect(callback, deps) {
1074
1106
  }, deps);
1075
1107
  return container;
1076
1108
  }
1109
+ function usePersistedState(storage, key, defaultValue) {
1110
+ var state = useEagerReducer(function (prevState, value) {
1111
+ value = isFunction(value) ? value(prevState[1]) : value;
1112
+ return sameValue(value, prevState[1]) ? prevState : [prevState[0], value];
1113
+ }, []);
1114
+ var cur = state[0];
1115
+ useMemo(function () {
1116
+ if (cur[0] !== key) {
1117
+ cur.splice(0, 2, key, storage && storage.has(key) ? storage.get(key) : isFunction(defaultValue) ? defaultValue() : defaultValue);
1118
+ }
1119
+ }, [storage, key]);
1120
+ return [cur[1], state[1]];
1121
+ }
1077
1122
  function useAppReady() {
1078
1123
  return useAppReadyState().ready;
1079
1124
  }
@@ -1104,7 +1149,7 @@ function useRouteParam(name, defaultValue) {
1104
1149
  }
1105
1150
  function useRouteState(key, defaultValue, snapshotOnUpdate) {
1106
1151
  var cur = getCurrentStates();
1107
- var state = useEagerState(cur && cur.has(key) ? cur.get(key) : defaultValue);
1152
+ var state = usePersistedState(cur, key, defaultValue);
1108
1153
  var container = useViewContextWithEffect(function (cur) {
1109
1154
  state[1](function (oldValue) {
1110
1155
  return cur.has(key) ? cur.get(key) : (cur.set(key, oldValue), oldValue);
@@ -1118,6 +1163,12 @@ function useRouteState(key, defaultValue, snapshotOnUpdate) {
1118
1163
  }
1119
1164
  return state;
1120
1165
  }
1166
+ function useAppSessionState(key, defaultValue) {
1167
+ var cur = app_app.sessionStorage;
1168
+ var state = usePersistedState(cur, key, defaultValue);
1169
+ updatePersistedValue(cur, key, state[0]);
1170
+ return state;
1171
+ }
1121
1172
  function useQueryParam(key, value, snapshotOnUpdate) {
1122
1173
  if (isPlainObject(key)) {
1123
1174
  snapshotOnUpdate = value;
@@ -1194,7 +1245,7 @@ function ViewStateContainer(props) {
1194
1245
  }
1195
1246
  // EXTERNAL MODULE: external "waterpipe"
1196
1247
  var external_waterpipe_ = __webpack_require__(87);
1197
- ;// CONCATENATED MODULE: ./src/i18n.js
1248
+ ;// ./src/i18n.js
1198
1249
 
1199
1250
 
1200
1251
 
@@ -1280,7 +1331,7 @@ function makeTranslation(resources, defaultLang) {
1280
1331
  }
1281
1332
  };
1282
1333
  }
1283
- ;// CONCATENATED MODULE: ./src/mixins/StaticAttributeMixin.js
1334
+ ;// ./src/mixins/StaticAttributeMixin.js
1284
1335
 
1285
1336
 
1286
1337
  function StaticAttributeMixin(name, value) {
@@ -1292,7 +1343,7 @@ definePrototype(StaticAttributeMixin, Mixin, {
1292
1343
  return extend({}, this.attributes);
1293
1344
  }
1294
1345
  });
1295
- ;// CONCATENATED MODULE: ./src/mixins/Mixin.js
1346
+ ;// ./src/mixins/Mixin.js
1296
1347
 
1297
1348
 
1298
1349
 
@@ -1350,13 +1401,13 @@ util_define(Mixin, {
1350
1401
  });
1351
1402
  }
1352
1403
  });
1353
- ;// CONCATENATED MODULE: ./|umd|/zeta-dom/observe.js
1404
+ ;// ./|umd|/zeta-dom/observe.js
1354
1405
 
1355
1406
  var observe_lib$dom = external_commonjs_zeta_dom_commonjs2_zeta_dom_amd_zeta_dom_root_zeta_.dom,
1356
1407
  watchElements = observe_lib$dom.watchElements,
1357
1408
  watchOwnAttributes = observe_lib$dom.watchOwnAttributes;
1358
1409
 
1359
- ;// CONCATENATED MODULE: ./src/mixins/StatefulMixin.js
1410
+ ;// ./src/mixins/StatefulMixin.js
1360
1411
 
1361
1412
 
1362
1413
  var StatefulMixin_ = createPrivateStore();
@@ -1466,7 +1517,7 @@ definePrototype(StatefulMixin, Mixin, {
1466
1517
  state.pending = {};
1467
1518
  }
1468
1519
  });
1469
- ;// CONCATENATED MODULE: ./src/mixins/ClassNameMixin.js
1520
+ ;// ./src/mixins/ClassNameMixin.js
1470
1521
 
1471
1522
 
1472
1523
 
@@ -1503,7 +1554,7 @@ definePrototype(ClassNameMixin, StatefulMixin, {
1503
1554
  },
1504
1555
  onClassNameUpdated: function onClassNameUpdated(element, prevState, state) {}
1505
1556
  });
1506
- ;// CONCATENATED MODULE: ./src/mixins/AnimateMixin.js
1557
+ ;// ./src/mixins/AnimateMixin.js
1507
1558
 
1508
1559
 
1509
1560
  var AnimateMixinSuper = ClassNameMixin.prototype;
@@ -1535,7 +1586,7 @@ definePrototype(AnimateMixin, ClassNameMixin, {
1535
1586
  });
1536
1587
  }
1537
1588
  });
1538
- ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceItemMixin.js
1589
+ ;// ./src/mixins/AnimateSequenceItemMixin.js
1539
1590
 
1540
1591
 
1541
1592
  var AnimateSequenceItemMixinSuper = ClassNameMixin.prototype;
@@ -1555,7 +1606,7 @@ definePrototype(AnimateSequenceItemMixin, ClassNameMixin, {
1555
1606
  });
1556
1607
  // EXTERNAL MODULE: external {"commonjs":"jquery","commonjs2":"jquery","amd":"jquery","root":"jQuery"}
1557
1608
  var external_commonjs_jquery_commonjs2_jquery_amd_jquery_root_jQuery_ = __webpack_require__(914);
1558
- ;// CONCATENATED MODULE: ./src/mixins/AnimateSequenceMixin.js
1609
+ ;// ./src/mixins/AnimateSequenceMixin.js
1559
1610
 
1560
1611
 
1561
1612
 
@@ -1592,7 +1643,7 @@ definePrototype(AnimateSequenceMixin, AnimateMixin, {
1592
1643
  }
1593
1644
  }
1594
1645
  });
1595
- ;// CONCATENATED MODULE: ./src/mixins/ClassNameToggleMixin.js
1646
+ ;// ./src/mixins/ClassNameToggleMixin.js
1596
1647
 
1597
1648
 
1598
1649
 
@@ -1614,7 +1665,7 @@ definePrototype(ClassNameToggleMixin, StatefulMixin, {
1614
1665
  extend(this.classes, value);
1615
1666
  }
1616
1667
  });
1617
- ;// CONCATENATED MODULE: ./src/mixins/FlyoutToggleMixin.js
1668
+ ;// ./src/mixins/FlyoutToggleMixin.js
1618
1669
 
1619
1670
 
1620
1671
 
@@ -1658,7 +1709,7 @@ definePrototype(FlyoutToggleMixin, ClassNameMixin, {
1658
1709
  }));
1659
1710
  }
1660
1711
  });
1661
- ;// CONCATENATED MODULE: ./src/mixins/FlyoutMixin.js
1712
+ ;// ./src/mixins/FlyoutMixin.js
1662
1713
 
1663
1714
 
1664
1715
 
@@ -1784,7 +1835,7 @@ definePrototype(FlyoutMixin, ClassNameMixin, {
1784
1835
  }, true));
1785
1836
  }
1786
1837
  });
1787
- ;// CONCATENATED MODULE: ./src/mixins/FocusStateMixin.js
1838
+ ;// ./src/mixins/FocusStateMixin.js
1788
1839
 
1789
1840
 
1790
1841
 
@@ -1826,11 +1877,11 @@ definePrototype(FocusStateMixin, StatefulMixin, {
1826
1877
  setClass(element, 'focused', state.focused);
1827
1878
  }
1828
1879
  });
1829
- ;// CONCATENATED MODULE: ./|umd|/brew-js/directive.js
1880
+ ;// ./|umd|/brew-js/directive.js
1830
1881
 
1831
1882
  var getDirectiveComponent = external_commonjs_brew_js_commonjs2_brew_js_amd_brew_js_root_brew_.getDirectiveComponent;
1832
1883
 
1833
- ;// CONCATENATED MODULE: ./src/mixins/LoadingStateMixin.js
1884
+ ;// ./src/mixins/LoadingStateMixin.js
1834
1885
 
1835
1886
 
1836
1887
 
@@ -1853,7 +1904,7 @@ definePrototype(LoadingStateMixin, ClassNameMixin, {
1853
1904
  }));
1854
1905
  }
1855
1906
  });
1856
- ;// CONCATENATED MODULE: ./src/mixins/ScrollableMixin.js
1907
+ ;// ./src/mixins/ScrollableMixin.js
1857
1908
 
1858
1909
 
1859
1910
 
@@ -1918,7 +1969,7 @@ each('destroy enable disable setOptions setStickyPosition refresh scrollPadding
1918
1969
  return obj.scrollable[v].apply(null, arguments);
1919
1970
  });
1920
1971
  });
1921
- ;// CONCATENATED MODULE: ./src/mixins/ScrollIntoViewMixin.js
1972
+ ;// ./src/mixins/ScrollIntoViewMixin.js
1922
1973
 
1923
1974
 
1924
1975
 
@@ -1942,7 +1993,7 @@ definePrototype(ScrollIntoViewMixin, StatefulMixin, {
1942
1993
  extend(state, newState);
1943
1994
  }
1944
1995
  });
1945
- ;// CONCATENATED MODULE: ./src/mixins/UnmanagedClassNameMixin.js
1996
+ ;// ./src/mixins/UnmanagedClassNameMixin.js
1946
1997
 
1947
1998
 
1948
1999
  function UnmanagedClassNameMixin() {
@@ -1954,7 +2005,7 @@ definePrototype(UnmanagedClassNameMixin, ClassNameMixin, {
1954
2005
  return this;
1955
2006
  }
1956
2007
  });
1957
- ;// CONCATENATED MODULE: ./src/mixin.js
2008
+ ;// ./src/mixin.js
1958
2009
 
1959
2010
 
1960
2011
 
@@ -1998,16 +2049,17 @@ function useMixinRef(mixin) {
1998
2049
  return mixin && mixin.getMixin().reset();
1999
2050
  }
2000
2051
 
2001
- ;// CONCATENATED MODULE: ./src/index.js
2052
+ ;// ./src/index.js
2053
+ /* unused harmony import specifier */ var src_brew;
2002
2054
 
2003
2055
 
2004
- /* harmony default export */ const src = ((/* unused pure expression or super */ null && (brew)));
2056
+ /* harmony default export */ const src = ((/* unused pure expression or super */ null && (src_brew)));
2005
2057
 
2006
2058
 
2007
2059
 
2008
2060
 
2009
2061
 
2010
- ;// CONCATENATED MODULE: ./src/entry.js
2062
+ ;// ./src/entry.js
2011
2063
 
2012
2064
  defineGetterProperty(window, 'brew-js-react', function () {
2013
2065
  console.warn('window["brew-js-react"] is deprecated, access brew.react instead.');