@atlaskit/navigation-system 11.3.0 → 11.3.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +76 -37
  3. package/dist/cjs/ui/page-layout/chat-panel.js +6 -3
  4. package/dist/cjs/ui/page-layout/layout-area-sizing-context.js +2 -2
  5. package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +243 -247
  6. package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +468 -0
  7. package/dist/cjs/ui/page-layout/main/main.js +1 -1
  8. package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +239 -99
  9. package/dist/cjs/ui/page-layout/panel-splitter/provider.js +3 -1
  10. package/dist/cjs/ui/page-layout/root.compiled.css +14 -3
  11. package/dist/cjs/ui/page-layout/root.js +43 -17
  12. package/dist/cjs/ui/page-layout/side-nav/side-nav.js +14 -3
  13. package/dist/cjs/ui/page-layout/use-css-layout-area-states.js +117 -0
  14. package/dist/cjs/ui/page-layout/use-layout-area-sizing.js +3 -1
  15. package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +51 -17
  16. package/dist/es2019/ui/page-layout/chat-panel.js +29 -5
  17. package/dist/es2019/ui/page-layout/layout-area-sizing-context.js +2 -2
  18. package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +171 -241
  19. package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +419 -0
  20. package/dist/es2019/ui/page-layout/main/main.js +2 -2
  21. package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +60 -10
  22. package/dist/es2019/ui/page-layout/panel-splitter/provider.js +3 -1
  23. package/dist/es2019/ui/page-layout/root.compiled.css +14 -3
  24. package/dist/es2019/ui/page-layout/root.js +30 -3
  25. package/dist/es2019/ui/page-layout/side-nav/side-nav.js +23 -3
  26. package/dist/es2019/ui/page-layout/use-css-layout-area-states.js +73 -0
  27. package/dist/es2019/ui/page-layout/use-layout-area-sizing.js +3 -1
  28. package/dist/esm/ui/page-layout/calculate-layout-area-states.js +75 -37
  29. package/dist/esm/ui/page-layout/chat-panel.js +7 -4
  30. package/dist/esm/ui/page-layout/layout-area-sizing-context.js +2 -2
  31. package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +243 -248
  32. package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +459 -0
  33. package/dist/esm/ui/page-layout/main/main.js +2 -2
  34. package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +238 -98
  35. package/dist/esm/ui/page-layout/panel-splitter/provider.js +3 -1
  36. package/dist/esm/ui/page-layout/root.compiled.css +14 -3
  37. package/dist/esm/ui/page-layout/root.js +42 -16
  38. package/dist/esm/ui/page-layout/side-nav/side-nav.js +14 -3
  39. package/dist/esm/ui/page-layout/use-css-layout-area-states.js +110 -0
  40. package/dist/esm/ui/page-layout/use-layout-area-sizing.js +3 -1
  41. package/dist/types/ui/page-layout/calculate-layout-area-states.d.ts +7 -2
  42. package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +10 -3
  43. package/dist/types/ui/page-layout/layout-area-sizing-provider.d.ts +6 -0
  44. package/dist/types/ui/page-layout/layout-area-sizing-runtime.d.ts +8 -0
  45. package/dist/types/ui/page-layout/panel-splitter/panel-splitter-context.d.ts +4 -0
  46. package/dist/types/ui/page-layout/panel-splitter/provider.d.ts +1 -1
  47. package/dist/types/ui/page-layout/root.d.ts +2 -0
  48. package/dist/types/ui/page-layout/use-css-layout-area-states.d.ts +8 -0
  49. package/dist/types/ui/page-layout/use-layout-area-sizing.d.ts +2 -0
  50. package/package.json +12 -6
@@ -1,279 +1,209 @@
1
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
- import { bind } from 'bind-event-listener';
3
- import { calculateLayoutAreaStates } from './calculate-layout-area-states';
1
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
+ import { bind, bindAll } from 'bind-event-listener';
4
3
  import { LayoutAreaSizingContext } from './layout-area-sizing-context';
5
4
  import { layoutAreaStateContexts } from './layout-area-state-contexts';
6
- import { useOccupiedLayoutWidth } from './use-occupied-layout-width';
7
- const defaultMainMinWidth = 320;
8
- function useStableAreaState(state) {
9
- const {
10
- mode,
11
- width,
12
- minWidth
13
- } = state !== null && state !== void 0 ? state : {};
14
- return useMemo(() => mode !== undefined && width !== undefined && minWidth !== undefined ? {
15
- mode,
16
- width,
17
- minWidth
18
- } : undefined, [mode, width, minWidth]);
19
- }
5
+ import { useCssLayoutAreaStates } from './use-css-layout-area-states';
6
+
7
+ /**
8
+ * Stable, synchronous boundary for SSR content. The drag/cascade implementation
9
+ * is a sibling, not a replacement wrapper, so loading it cannot remount the app.
10
+ * CSS handles initial and responsive geometry; only splitter interaction requests
11
+ * the asynchronous chunk. The eager observer reads modes without changing widths.
12
+ */
20
13
  export function LayoutAreaSizingProvider({
21
14
  children,
22
15
  layoutRef
23
16
  }) {
24
- const occupiedWidth = useOccupiedLayoutWidth(layoutRef);
25
- const [dimensions, setDimensions] = useState(null);
26
- const [mainMinWidth, setMainMinWidth] = useState(defaultMainMinWidth);
27
- const [areas, setAreas] = useState({});
28
- const [resizeSession, setResizeSession] = useState(null);
29
- const areaStatesRef = React.useRef({});
30
- const configsRef = React.useRef({});
31
- const openSequence = React.useRef(0);
32
- useEffect(() => {
33
- setResizeSession(null);
34
- }, [mainMinWidth, occupiedWidth]);
17
+ var _states$sideNav$mode, _states$sideNav, _states$chatPanel$mo, _states$chatPanel;
18
+ const [Runtime, setRuntime] = useState(null);
19
+ const [states, setStates] = useState({});
20
+ const actions = useRef(null);
21
+ const configs = useRef({});
22
+ const [lastOpenedOverlay, setLastOpenedOverlay] = useState(null);
23
+ const [configRevision, setConfigRevision] = useState(0);
24
+ const cssModes = useCssLayoutAreaStates(layoutRef, configRevision, Runtime === null);
25
+ const sideNavMode = (_states$sideNav$mode = (_states$sideNav = states['side-nav']) === null || _states$sideNav === void 0 ? void 0 : _states$sideNav.mode) !== null && _states$sideNav$mode !== void 0 ? _states$sideNav$mode : cssModes['side-nav'];
26
+ const chatPanelMode = (_states$chatPanel$mo = (_states$chatPanel = states['chat-panel']) === null || _states$chatPanel === void 0 ? void 0 : _states$chatPanel.mode) !== null && _states$chatPanel$mo !== void 0 ? _states$chatPanel$mo : cssModes['chat-panel'];
27
+
28
+ // Overlay dismissal is available before the sizing chunk loads. Keep the open
29
+ // order here too: replaying registrations into the runtime loses that order.
35
30
  useEffect(() => {
36
- const root = layoutRef === null || layoutRef === void 0 ? void 0 : layoutRef.current;
37
- let previous = null;
38
- // Match the actual rem-based grid breakpoint, including browser font settings.
39
31
  const inlineChatQuery = window.matchMedia('(min-width: 40rem)');
40
- const inlineSideNavQuery = window.matchMedia('(min-width: 64rem)');
41
- const updateDimensions = contentWidth => {
42
- var _style$paddingLeft, _style$paddingRight, _previous;
43
- const style = root && contentWidth === undefined ? getComputedStyle(root) : null;
44
- const layoutWidth = contentWidth !== null && contentWidth !== void 0 ? contentWidth : root ? Math.max(0, root.clientWidth - (parseFloat((_style$paddingLeft = style === null || style === void 0 ? void 0 : style.paddingLeft) !== null && _style$paddingLeft !== void 0 ? _style$paddingLeft : '') || 0) - (parseFloat((_style$paddingRight = style === null || style === void 0 ? void 0 : style.paddingRight) !== null && _style$paddingRight !== void 0 ? _style$paddingRight : '') || 0)) : window.innerWidth;
45
- const next = {
46
- viewportWidth: window.innerWidth,
47
- layoutWidth,
48
- isChatPanelOverlay: !inlineChatQuery.matches,
49
- isSideNavOverlay: !inlineSideNavQuery.matches
50
- };
51
- if (((_previous = previous) === null || _previous === void 0 ? void 0 : _previous.viewportWidth) === next.viewportWidth && previous.layoutWidth === next.layoutWidth && previous.isChatPanelOverlay === next.isChatPanelOverlay && previous.isSideNavOverlay === next.isSideNavOverlay) {
32
+ const dismissOlderOverlay = () => {
33
+ var _olderOverlay$onReque;
34
+ const sideNav = configs.current['side-nav'];
35
+ const chatPanel = configs.current['chat-panel'];
36
+ if (!(sideNav !== null && sideNav !== void 0 && sideNav.isOpen) || !(chatPanel !== null && chatPanel !== void 0 && chatPanel.isOpen) || !lastOpenedOverlay) {
52
37
  return;
53
38
  }
54
- previous = next;
55
- setDimensions(next);
56
- setResizeSession(null);
57
- };
58
- updateDimensions();
59
- const observer = new ResizeObserver(entries => {
60
- const entry = entries.find(entry => entry.target === root);
61
- if (entry) {
62
- updateDimensions(entry.contentRect.width);
39
+ // Before allocation, CSS puts both areas in overlay below 40rem. Once
40
+ // sizing is active, also honour overlays caused by custom widths/slots.
41
+ if (inlineChatQuery.matches && (sideNavMode !== 'overlay' || chatPanelMode !== 'overlay')) {
42
+ return;
63
43
  }
64
- });
65
- if (root) {
66
- observer.observe(root);
67
- }
68
- const unbindResize = bind(window, {
69
- type: 'resize',
70
- listener: () => updateDimensions()
71
- });
72
- const unbindQuery = bind(inlineChatQuery, {
73
- type: 'change',
74
- listener: () => updateDimensions()
75
- });
76
- const unbindSideNavQuery = bind(inlineSideNavQuery, {
77
- type: 'change',
78
- listener: () => updateDimensions()
79
- });
80
- return () => {
81
- observer.disconnect();
82
- unbindResize();
83
- unbindQuery();
84
- unbindSideNavQuery();
44
+ const olderOverlay = lastOpenedOverlay === 'side-nav' ? chatPanel : sideNav;
45
+ (_olderOverlay$onReque = olderOverlay.onRequestClose) === null || _olderOverlay$onReque === void 0 ? void 0 : _olderOverlay$onReque.call(olderOverlay);
85
46
  };
86
- }, [layoutRef]);
87
- const registerArea = useCallback((area, config) => {
88
- const previous = configsRef.current[area];
89
- configsRef.current[area] = config;
90
- setResizeSession(current => {
91
- // A changed layout/configuration needs a fresh allocation. A controlled
92
- // acknowledgement for the resized area keeps its siblings fixed.
93
- return (previous === null || previous === void 0 ? void 0 : previous.isOpen) === config.isOpen && previous.minWidth === config.minWidth && previous.maxWidth === config.maxWidth && previous.defaultWidth === config.defaultWidth && previous.compactDefaultWidth === config.compactDefaultWidth && (previous.requestedWidth === config.requestedWidth || (current === null || current === void 0 ? void 0 : current.area) === area) ? current : null;
94
- });
95
- // Allocate once per registration, outside the updater React may replay. Gaps are
96
- // harmless: only relative ordering of closed-to-open transitions is significant.
97
- const openedAt = ++openSequence.current;
98
- setAreas(current => {
99
- const existing = current[area];
100
- return {
101
- ...current,
102
- [area]: {
103
- ...existing,
104
- ...config,
105
- liveResize: config.isOpen ? existing === null || existing === void 0 ? void 0 : existing.liveResize : undefined,
106
- openedAt: config.isOpen && !(existing !== null && existing !== void 0 && existing.isOpen) ? openedAt : existing === null || existing === void 0 ? void 0 : existing.openedAt
107
- }
108
- };
109
- });
110
- }, []);
111
- const unregisterArea = useCallback(area => {
112
- delete configsRef.current[area];
113
- setResizeSession(null);
114
- setAreas(current => {
115
- if (!current[area]) {
116
- return current;
117
- }
118
- // Closing uses isOpen: false and retains preferences. Unregistering means
119
- // the owning component unmounted; a replacement must start with its own defaults.
120
- const next = {
121
- ...current
122
- };
123
- delete next[area];
124
- return next;
47
+ dismissOlderOverlay();
48
+ return bind(inlineChatQuery, {
49
+ type: 'change',
50
+ listener: dismissOlderOverlay
125
51
  });
126
- }, []);
127
- const freezeSiblingWidths = useCallback(area => {
128
- const baselineWidths = {};
129
- for (const areaName of ['side-nav', 'panel', 'chat-panel']) {
130
- const state = areaStatesRef.current[areaName];
131
- if ((state === null || state === void 0 ? void 0 : state.mode) === 'inline') {
132
- baselineWidths[areaName] = state.width;
133
- }
52
+ }, [chatPanelMode, lastOpenedOverlay, sideNavMode]);
53
+ const mainMinWidth = useRef(320);
54
+ const loadRef = useRef(() => {});
55
+ const ready = useRef(false);
56
+ const waiting = useRef([]);
57
+ const pending = useRef([]);
58
+ const prepareResize = useCallback(() => {
59
+ if (ready.current) {
60
+ return Promise.resolve(true);
134
61
  }
135
- // Keep the same siblings fixed after completion, including while a controlled
136
- // consumer rejects or asynchronously accepts the requested width.
137
- setResizeSession({
138
- area,
139
- baselineWidths
62
+ return new Promise(resolve => {
63
+ waiting.current.push(resolve);
64
+ loadRef.current();
140
65
  });
141
66
  }, []);
142
- const startResize = useCallback((area, mode) => {
143
- if (mode !== 'inline') {
67
+ useEffect(() => {
68
+ const root = layoutRef === null || layoutRef === void 0 ? void 0 : layoutRef.current;
69
+ if (!root) {
144
70
  return;
145
71
  }
146
- freezeSiblingWidths(area);
147
-
148
- // Start from the effective width, which may already be compressed below the preferred width.
149
- // Reapplying the preferred width here would move the splitter away from the pointer.
150
- const renderedState = areaStatesRef.current[area];
151
- if ((renderedState === null || renderedState === void 0 ? void 0 : renderedState.mode) === 'inline') {
152
- setAreas(current => {
153
- const existing = current[area];
154
- return existing ? {
155
- ...current,
156
- [area]: {
157
- ...existing,
158
- liveResize: {
159
- mode,
160
- width: renderedState.width
161
- }
162
- }
163
- } : current;
164
- });
165
- }
166
- }, [freezeSiblingWidths]);
167
- const resize = useCallback((area, mode, width) => {
168
- setAreas(current => {
169
- var _existing$liveResize;
170
- const existing = current[area];
171
- if ((existing === null || existing === void 0 ? void 0 : (_existing$liveResize = existing.liveResize) === null || _existing$liveResize === void 0 ? void 0 : _existing$liveResize.mode) === mode && existing.liveResize.width === width) {
172
- return current;
72
+ let cancelled = false;
73
+ let loading = false;
74
+ const waitingForRuntime = waiting.current;
75
+ const load = () => {
76
+ if (loading) {
77
+ return;
173
78
  }
174
- return existing ? {
175
- ...current,
176
- [area]: {
177
- ...existing,
178
- liveResize: {
179
- mode,
180
- width
181
- }
79
+ loading = true;
80
+ void import( /* webpackChunkName: "@atlaskit-internal_navigation-layout-sizing" */'./layout-area-sizing-runtime').then(({
81
+ LayoutAreaSizingRuntime
82
+ }) => {
83
+ if (!cancelled) {
84
+ setRuntime(() => LayoutAreaSizingRuntime);
182
85
  }
183
- } : current;
184
- });
185
- }, []);
186
- const completeResize = useCallback((area, mode, width) => {
187
- if (mode === 'inline') {
188
- // Keyboard resizing completes without a preceding pointer-drag session.
189
- freezeSiblingWidths(area);
190
- }
191
- setAreas(current => {
192
- const existing = current[area];
193
- if (!existing) {
194
- return current;
86
+ }, () => {
87
+ loading = false;
88
+ pending.current = [];
89
+ for (const resolve of waitingForRuntime.splice(0)) {
90
+ resolve(false);
91
+ }
92
+ });
93
+ };
94
+ loadRef.current = load;
95
+ const loadForSplitter = event => {
96
+ if (event.target instanceof Element && event.target.closest('[data-panel-splitter]')) {
97
+ load();
98
+ }
99
+ };
100
+ const unbindRoot = bindAll(root, [{
101
+ type: 'pointerover',
102
+ listener: loadForSplitter,
103
+ options: {
104
+ passive: true
195
105
  }
196
- if (mode === 'overlay') {
197
- return {
198
- ...current,
199
- [area]: {
200
- ...existing,
201
- liveResize: undefined,
202
- preferredOverlayWidth: width
203
- }
204
- };
106
+ }, {
107
+ type: 'focusin',
108
+ listener: loadForSplitter
109
+ }, {
110
+ type: 'pointerdown',
111
+ listener: loadForSplitter,
112
+ options: {
113
+ passive: true
205
114
  }
206
- return {
207
- ...current,
208
- [area]: {
209
- ...existing,
210
- liveResize: undefined,
211
- preferredInlineWidth: width
115
+ }]);
116
+ return () => {
117
+ cancelled = true;
118
+ ready.current = false;
119
+ pending.current = [];
120
+ for (const resolve of waitingForRuntime.splice(0)) {
121
+ resolve(false);
122
+ }
123
+ loadRef.current = () => {};
124
+ unbindRoot();
125
+ };
126
+ }, [layoutRef]);
127
+ const onReady = useCallback(runtime => {
128
+ actions.current = runtime;
129
+ if (runtime) {
130
+ runtime.setMainMinWidth(mainMinWidth.current);
131
+ for (const area of ['side-nav', 'panel', 'chat-panel']) {
132
+ const config = configs.current[area];
133
+ if (config) {
134
+ runtime.registerArea(area, config);
212
135
  }
213
- };
214
- });
215
- }, [freezeSiblingWidths]);
216
- const areaStates = useMemo(() => dimensions === null ? {} : calculateLayoutAreaStates({
217
- ...dimensions,
218
- occupiedWidth,
219
- mainMinWidth,
220
- areas,
221
- resizeSession
222
- }), [areas, mainMinWidth, resizeSession, dimensions, occupiedWidth]);
223
- useEffect(() => {
224
- areaStatesRef.current = areaStates;
225
- }, [areaStates]);
226
- useEffect(() => {
227
- var _areaStates$sideNav, _areaStates$chatPane, _sideNav$openedAt, _chatPanel$openedAt;
228
- if (((_areaStates$sideNav = areaStates['side-nav']) === null || _areaStates$sideNav === void 0 ? void 0 : _areaStates$sideNav.mode) !== 'overlay' || ((_areaStates$chatPane = areaStates['chat-panel']) === null || _areaStates$chatPane === void 0 ? void 0 : _areaStates$chatPane.mode) !== 'overlay') {
229
- return;
136
+ }
230
137
  }
231
- const sideNav = areas['side-nav'];
232
- const chatPanel = areas['chat-panel'];
233
- if (!(sideNav !== null && sideNav !== void 0 && sideNav.isOpen) || !(chatPanel !== null && chatPanel !== void 0 && chatPanel.isOpen)) {
234
- return;
138
+ }, []);
139
+ const onUpdate = useCallback(next => {
140
+ setStates(next);
141
+ const runtime = actions.current;
142
+ if (runtime && Object.values(next).some(Boolean)) {
143
+ ready.current = true;
144
+ for (const action of pending.current.splice(0)) {
145
+ action(runtime);
146
+ }
147
+ for (const resolve of waiting.current.splice(0)) {
148
+ resolve(true);
149
+ }
235
150
  }
236
- if (((_sideNav$openedAt = sideNav.openedAt) !== null && _sideNav$openedAt !== void 0 ? _sideNav$openedAt : 0) > ((_chatPanel$openedAt = chatPanel.openedAt) !== null && _chatPanel$openedAt !== void 0 ? _chatPanel$openedAt : 0)) {
237
- var _chatPanel$onRequestC;
238
- (_chatPanel$onRequestC = chatPanel.onRequestClose) === null || _chatPanel$onRequestC === void 0 ? void 0 : _chatPanel$onRequestC.call(chatPanel);
151
+ }, []);
152
+ const dispatch = useCallback(action => {
153
+ if (ready.current && actions.current) {
154
+ action(actions.current);
239
155
  } else {
240
- var _sideNav$onRequestClo;
241
- (_sideNav$onRequestClo = sideNav.onRequestClose) === null || _sideNav$onRequestClo === void 0 ? void 0 : _sideNav$onRequestClo.call(sideNav);
156
+ pending.current.push(action);
157
+ loadRef.current();
242
158
  }
243
- }, [areas, areaStates]);
244
-
245
- // Read bounds lazily: changing a sibling's capacity must not publish new render
246
- // state or recreate drag listeners for a region whose own width did not change.
247
- const getResizeBounds = useCallback(area => {
248
- var _areaStatesRef$curren;
249
- const bounds = (_areaStatesRef$curren = areaStatesRef.current[area]) === null || _areaStatesRef$curren === void 0 ? void 0 : _areaStatesRef$curren.resizeBounds;
250
- return bounds ? {
251
- min: `${bounds.min}px`,
252
- max: `${bounds.max}px`
253
- } : undefined;
254
159
  }, []);
255
160
  const value = useMemo(() => ({
256
- getResizeBounds,
257
- registerArea,
258
- unregisterArea,
259
- startResize,
260
- resize,
261
- completeResize,
262
- setMainMinWidth
263
- }), [completeResize, getResizeBounds, registerArea, resize, startResize, unregisterArea]);
264
- const sideNavState = useStableAreaState(areaStates['side-nav']);
265
- const panelState = useStableAreaState(areaStates.panel);
266
- const chatPanelState = useStableAreaState(areaStates['chat-panel']);
161
+ prepareResize,
162
+ registerArea: (area, config) => {
163
+ var _configs$current$area, _actions$current;
164
+ if (area !== 'panel' && config.isOpen && !((_configs$current$area = configs.current[area]) !== null && _configs$current$area !== void 0 && _configs$current$area.isOpen)) {
165
+ setLastOpenedOverlay(area);
166
+ }
167
+ configs.current[area] = config;
168
+ setConfigRevision(revision => revision + 1);
169
+ (_actions$current = actions.current) === null || _actions$current === void 0 ? void 0 : _actions$current.registerArea(area, config);
170
+ },
171
+ unregisterArea: area => {
172
+ var _actions$current2;
173
+ delete configs.current[area];
174
+ setConfigRevision(revision => revision + 1);
175
+ (_actions$current2 = actions.current) === null || _actions$current2 === void 0 ? void 0 : _actions$current2.unregisterArea(area);
176
+ },
177
+ setMainMinWidth: width => {
178
+ var _actions$current3;
179
+ if (mainMinWidth.current !== width) {
180
+ setConfigRevision(revision => revision + 1);
181
+ }
182
+ mainMinWidth.current = width;
183
+ (_actions$current3 = actions.current) === null || _actions$current3 === void 0 ? void 0 : _actions$current3.setMainMinWidth(width);
184
+ },
185
+ getResizeBounds: area => {
186
+ var _actions$current4;
187
+ return (_actions$current4 = actions.current) === null || _actions$current4 === void 0 ? void 0 : _actions$current4.getResizeBounds(area);
188
+ },
189
+ startResize: (area, mode) => dispatch(runtime => runtime.startResize(area, mode)),
190
+ resize: (area, mode, width) => dispatch(runtime => runtime.resize(area, mode, width)),
191
+ completeResize: (area, mode, width) => dispatch(runtime => runtime.completeResize(area, mode, width))
192
+ }), [dispatch, prepareResize]);
267
193
  const SideNavStateProvider = layoutAreaStateContexts['side-nav'].Provider;
268
194
  const PanelStateProvider = layoutAreaStateContexts.panel.Provider;
269
195
  const ChatPanelStateProvider = layoutAreaStateContexts['chat-panel'].Provider;
270
196
  return /*#__PURE__*/React.createElement(LayoutAreaSizingContext.Provider, {
271
197
  value: value
272
198
  }, /*#__PURE__*/React.createElement(SideNavStateProvider, {
273
- value: sideNavState
199
+ value: states['side-nav']
274
200
  }, /*#__PURE__*/React.createElement(PanelStateProvider, {
275
- value: panelState
201
+ value: states.panel
276
202
  }, /*#__PURE__*/React.createElement(ChatPanelStateProvider, {
277
- value: chatPanelState
278
- }, children))));
203
+ value: states['chat-panel']
204
+ }, children))), Runtime && /*#__PURE__*/React.createElement(Runtime, {
205
+ layoutRef: layoutRef,
206
+ onReady: onReady,
207
+ onUpdate: onUpdate
208
+ }));
279
209
  }