ui-layout-manager-dev 0.0.18 → 0.0.20

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 (34) hide show
  1. package/dist/cjs/index.js +3 -3
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/Worker/LayoutWorker.js +38 -1
  4. package/dist/esm/index.js +3 -3
  5. package/dist/esm/index.js.map +1 -1
  6. package/package.json +3 -3
  7. package/src/components/LayoutManager/Components/Container/Container.jsx +1 -1
  8. package/src/components/LayoutManager/Components/HandleBar/HandleBar.jsx +6 -16
  9. package/src/components/LayoutManager/Components/LazyLoader/LazyLoader.js +74 -9
  10. package/src/components/LayoutManager/Components/LazyLoader/LazyLoader.scss +38 -1
  11. package/src/components/LayoutManager/Components/LazyLoader/MenuBar/MenuBar.js +40 -0
  12. package/src/components/LayoutManager/Components/LazyLoader/MenuBar/MenuBar.scss +22 -0
  13. package/src/components/LayoutManager/Components/LazyLoader/Tabs/Tabs.js +51 -0
  14. package/src/components/LayoutManager/Components/LazyLoader/Tabs/Tabs.scss +34 -0
  15. package/src/components/LayoutManager/Components/RootContainer/DragController.js +79 -0
  16. package/src/components/LayoutManager/Components/RootContainer/RootContainer.jsx +21 -21
  17. package/src/components/LayoutManager/Components/RootContainer/RootContainer.scss +1 -0
  18. package/src/components/LayoutManager/Controller/LAYOUT_WORKER_PROTOCOL.js +2 -1
  19. package/src/components/LayoutManager/Controller/LayoutController.js +14 -0
  20. package/src/components/LayoutManager/Controller/LayoutEventController.js +55 -0
  21. package/src/components/LayoutManager/Controller/Worker/HandleRulesEnforcer.js +4 -0
  22. package/src/components/LayoutManager/Controller/Worker/LayoutEditor.js +29 -0
  23. package/src/components/LayoutManager/Controller/Worker/LayoutWorker.js +3 -0
  24. package/src/components/LayoutManager/LayoutManager.jsx +5 -5
  25. package/src/components/LayoutManager/Providers/LayoutEventProvider.js +55 -0
  26. package/src/components/LayoutManager/index.js +1 -2
  27. package/src/stories/LayoutManager.stories.js +17 -0
  28. package/src/stories/layouts/vsCode/workbench.json +22 -5
  29. package/src/stories/layouts/vsCode/workbench2.json +176 -0
  30. package/src/stories/layouts/vsCode/workbench3.json +176 -0
  31. package/src/stories/sample_components/fileeditor/FileEditor.jsx +45 -21
  32. package/src/stories/sample_components/fileeditor/helper.js +22 -0
  33. package/src/stories/sample_components/filetree/FileTree.jsx +11 -5
  34. package/src/components/LayoutManager/Providers/DragProvider.js +0 -87
@@ -4,7 +4,8 @@ let LAYOUT_WORKER_PROTOCOL = {
4
4
  APPLY_SIZES: 3,
5
5
  ERROR: 4,
6
6
  TRANSFORMATIONS: 5,
7
- MOVE_HANDLE_BAR: 6
7
+ MOVE_HANDLE_BAR: 6,
8
+ INVOKE_ACTION: 7,
8
9
  };
9
10
  LAYOUT_WORKER_PROTOCOL = Object.freeze(LAYOUT_WORKER_PROTOCOL);
10
11
 
@@ -180,6 +181,7 @@ class HandleRulesEnforcer {
180
181
  const sibling = this.getSiblingProps(this.sibling1.id);
181
182
  if ("min" in sibling.size) {
182
183
  this.args.style["min-width"] = sibling.size.min.value + sibling.size.min.unit;
184
+ this.args.style["width"] = sibling.size.min.value + sibling.size.min.unit;
183
185
  }
184
186
  this.sibling1.hidden = false;
185
187
  this.activeSibling = this.sibling1.id;
@@ -196,6 +198,7 @@ class HandleRulesEnforcer {
196
198
  const sibling = this.getSiblingProps(this.sibling2.id);
197
199
  if ("min" in sibling.size) {
198
200
  this.args.style["min-width"] = sibling.size.min.value + sibling.size.min.unit;
201
+ this.args.style["width"] = sibling.size.min.value + sibling.size.min.unit;
199
202
  }
200
203
  this.sibling2.hidden = false;
201
204
  this.activeSibling = this.sibling2.id;
@@ -228,6 +231,7 @@ class HandleRulesEnforcer {
228
231
  const sibling = this.getSiblingProps(this.sibling1.id);
229
232
  if ("min" in sibling.size) {
230
233
  this.args.style["min-height"] = sibling.size.min.value + sibling.size.min.unit;
234
+ this.args.style["height"] = sibling.size.min.value + sibling.size.min.unit;
231
235
  }
232
236
  this.sibling1.hidden = false;
233
237
  this.activeSibling = this.sibling1.id;
@@ -245,6 +249,7 @@ class HandleRulesEnforcer {
245
249
  const sibling = this.getSiblingProps(this.sibling2.id);
246
250
  if ("min" in sibling.size) {
247
251
  this.args.style["min-height"] = sibling.size.min.value + sibling.size.min.unit;
252
+ this.args.style["height"] = sibling.size.min.value + sibling.size.min.unit;
248
253
  }
249
254
  this.sibling2.hidden = false;
250
255
  this.activeSibling = this.sibling2.id;
@@ -463,6 +468,35 @@ class LayoutEditor {
463
468
  }
464
469
  }
465
470
  }
471
+
472
+ /**
473
+ * Invoke a specific action on the given id.
474
+ * @param {Object} args
475
+ */
476
+ invokeAction({id, action, args}) {
477
+ const props = this.getProps(this.ldf.containers[id].parent);
478
+
479
+ const style = {};
480
+ if (action === "close") {
481
+ style["min-" + props["dynamic"]] = 0;
482
+ style["display"] = "none";
483
+ } else if (action === "open") {
484
+ style["display"] = "flex";
485
+ }
486
+
487
+ this.transformations.push(
488
+ {
489
+ id: id,
490
+ type: TRANSFORMATION_TYPES$1.UPDATE_SIZE,
491
+ args: {style: style}
492
+ }
493
+ );
494
+ postMessage({
495
+ type: LAYOUT_WORKER_PROTOCOL$1.TRANSFORMATIONS,
496
+ data: this.transformations
497
+ });
498
+ this.transformations = [];
499
+ }
466
500
  }
467
501
 
468
502
  /**
@@ -489,6 +523,9 @@ self.onmessage = function (e) {
489
523
  case LAYOUT_WORKER_PROTOCOL$1.MOVE_HANDLE_BAR:
490
524
  editor.moveHandleBar(args.metadata);
491
525
  break;
526
+ case LAYOUT_WORKER_PROTOCOL$1.INVOKE_ACTION:
527
+ editor.invokeAction(args);
528
+ break;
492
529
  default:
493
530
  break;
494
531
  }
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useMemo as n,useEffect as r,createContext as t,useContext as o,useRef as i,lazy as a,Suspense as l,useState as c,useCallback as u,useLayoutEffect as s}from"react";import{jsx as f,jsxs as d}from"react/jsx-runtime";import{useSensors as p,useSensor as y,PointerSensor as v,DndContext as h}from"@dnd-kit/core";function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g,b={exports:{}},w={exports:{}},O={};var S,x,E,k,j,C,T,R,I,P,D,N,z,L,$,A={};
1
+ import e,{useMemo as n,useEffect as t,createContext as r,useContext as o,useRef as i,forwardRef as a,useState as l,lazy as c,Suspense as s,useCallback as u,useLayoutEffect as f}from"react";import{jsx as d,jsxs as p}from"react/jsx-runtime";import{useSensors as v,useSensor as y,PointerSensor as h,DndContext as b,closestCenter as g}from"@dnd-kit/core";function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,x={exports:{}},S={exports:{}},O={};var E,C,k,T,I,j,N,R,P,z,D,L,A,$,B,_={};
2
2
  /** @license React v16.13.1
3
3
  * react-is.development.js
4
4
  *
@@ -6,10 +6,10 @@ import e,{useMemo as n,useEffect as r,createContext as t,useContext as o,useRef
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */function _(){return x||(x=1,"production"===process.env.NODE_ENV?w.exports=function(){if(g)return O;g=1;var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case n:switch(e=e.type){case c:case u:case t:case i:case o:case f:return e;default:switch(e=e&&e.$$typeof){case l:case s:case y:case p:case a:return e;default:return d}}case r:return d}}}function S(e){return w(e)===u}return O.AsyncMode=c,O.ConcurrentMode=u,O.ContextConsumer=l,O.ContextProvider=a,O.Element=n,O.ForwardRef=s,O.Fragment=t,O.Lazy=y,O.Memo=p,O.Portal=r,O.Profiler=i,O.StrictMode=o,O.Suspense=f,O.isAsyncMode=function(e){return S(e)||w(e)===c},O.isConcurrentMode=S,O.isContextConsumer=function(e){return w(e)===l},O.isContextProvider=function(e){return w(e)===a},O.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},O.isForwardRef=function(e){return w(e)===s},O.isFragment=function(e){return w(e)===t},O.isLazy=function(e){return w(e)===y},O.isMemo=function(e){return w(e)===p},O.isPortal=function(e){return w(e)===r},O.isProfiler=function(e){return w(e)===i},O.isStrictMode=function(e){return w(e)===o},O.isSuspense=function(e){return w(e)===f},O.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===t||e===u||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===s||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},O.typeOf=w,O}():w.exports=(S||(S=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case n:var v=e.type;switch(v){case c:case u:case t:case i:case o:case f:return v;default:var h=v&&v.$$typeof;switch(h){case l:case s:case y:case p:case a:return h;default:return d}}case r:return d}}}var w=c,O=u,S=l,x=a,E=n,k=s,j=t,C=y,T=p,R=r,I=i,P=o,D=f,N=!1;function z(e){return b(e)===u}A.AsyncMode=w,A.ConcurrentMode=O,A.ContextConsumer=S,A.ContextProvider=x,A.Element=E,A.ForwardRef=k,A.Fragment=j,A.Lazy=C,A.Memo=T,A.Portal=R,A.Profiler=I,A.StrictMode=P,A.Suspense=D,A.isAsyncMode=function(e){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),z(e)||b(e)===c},A.isConcurrentMode=z,A.isContextConsumer=function(e){return b(e)===l},A.isContextProvider=function(e){return b(e)===a},A.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},A.isForwardRef=function(e){return b(e)===s},A.isFragment=function(e){return b(e)===t},A.isLazy=function(e){return b(e)===y},A.isMemo=function(e){return b(e)===p},A.isPortal=function(e){return b(e)===r},A.isProfiler=function(e){return b(e)===i},A.isStrictMode=function(e){return b(e)===o},A.isSuspense=function(e){return b(e)===f},A.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===t||e===u||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===s||e.$$typeof===h||e.$$typeof===m||e.$$typeof===g||e.$$typeof===v)},A.typeOf=b}()),A)),w.exports}
9
+ */function M(){return C||(C=1,"production"===process.env.NODE_ENV?S.exports=function(){if(w)return O;w=1;var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function m(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case n:switch(e=e.type){case c:case s:case r:case i:case o:case f:return e;default:switch(e=e&&e.$$typeof){case l:case u:case v:case p:case a:return e;default:return d}}case t:return d}}}function x(e){return m(e)===s}return O.AsyncMode=c,O.ConcurrentMode=s,O.ContextConsumer=l,O.ContextProvider=a,O.Element=n,O.ForwardRef=u,O.Fragment=r,O.Lazy=v,O.Memo=p,O.Portal=t,O.Profiler=i,O.StrictMode=o,O.Suspense=f,O.isAsyncMode=function(e){return x(e)||m(e)===c},O.isConcurrentMode=x,O.isContextConsumer=function(e){return m(e)===l},O.isContextProvider=function(e){return m(e)===a},O.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},O.isForwardRef=function(e){return m(e)===u},O.isFragment=function(e){return m(e)===r},O.isLazy=function(e){return m(e)===v},O.isMemo=function(e){return m(e)===p},O.isPortal=function(e){return m(e)===t},O.isProfiler=function(e){return m(e)===i},O.isStrictMode=function(e){return m(e)===o},O.isSuspense=function(e){return m(e)===f},O.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===g||e.$$typeof===y)},O.typeOf=m,O}():S.exports=(E||(E=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,t=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,s=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function m(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case n:var y=e.type;switch(y){case c:case s:case r:case i:case o:case f:return y;default:var h=y&&y.$$typeof;switch(h){case l:case u:case v:case p:case a:return h;default:return d}}case t:return d}}}var w=c,x=s,S=l,O=a,E=n,C=u,k=r,T=v,I=p,j=t,N=i,R=o,P=f,z=!1;function D(e){return m(e)===s}_.AsyncMode=w,_.ConcurrentMode=x,_.ContextConsumer=S,_.ContextProvider=O,_.Element=E,_.ForwardRef=C,_.Fragment=k,_.Lazy=T,_.Memo=I,_.Portal=j,_.Profiler=N,_.StrictMode=R,_.Suspense=P,_.isAsyncMode=function(e){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||m(e)===c},_.isConcurrentMode=D,_.isContextConsumer=function(e){return m(e)===l},_.isContextProvider=function(e){return m(e)===a},_.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},_.isForwardRef=function(e){return m(e)===u},_.isFragment=function(e){return m(e)===r},_.isLazy=function(e){return m(e)===v},_.isMemo=function(e){return m(e)===p},_.isPortal=function(e){return m(e)===t},_.isProfiler=function(e){return m(e)===i},_.isStrictMode=function(e){return m(e)===o},_.isSuspense=function(e){return m(e)===f},_.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===s||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===p||e.$$typeof===a||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===g||e.$$typeof===y)},_.typeOf=m}()),_)),S.exports}
10
10
  /*
11
11
  object-assign
12
12
  (c) Sindre Sorhus
13
13
  @license MIT
14
- */function B(){if(k)return E;k=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return E=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},r=0;r<10;r++)n["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},t)).join("")}catch(e){return!1}}()?Object.assign:function(t,o){for(var i,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(t),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))n.call(i,u)&&(l[u]=i[u]);if(e){a=e(i);for(var s=0;s<a.length;s++)r.call(i,a[s])&&(l[a[s]]=i[a[s]])}}return l},E}function M(){if(C)return j;C=1;return j="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function V(){return R?T:(R=1,T=Function.call.bind(Object.prototype.hasOwnProperty))}function W(){if(P)return I;P=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=M(),r={},t=V();e=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}}function o(o,i,a,l,c){if("production"!==process.env.NODE_ENV)for(var u in o)if(t(o,u)){var s;try{if("function"!=typeof o[u]){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}s=o[u](i,u,l,a,null,n)}catch(e){s=e}if(!s||s instanceof Error||e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in r)){r[s.message]=!0;var d=c?c():"";e("Failed "+a+" type: "+s.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},I=o}function F(){if(N)return D;N=1;var e=_(),n=B(),r=M(),t=V(),o=W(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),D=function(l,c){var u="function"==typeof Symbol&&Symbol.iterator;var s="<<anonymous>>",f={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(a),arrayOf:function(e){return y(function(n,t,o,i,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=n[t];if(!Array.isArray(l))return new p("Invalid "+i+" `"+a+"` of type `"+g(l)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,o,i,a+"["+c+"]",r);if(u instanceof Error)return u}return null})},element:y(function(e,n,r,t,o){var i=e[n];return l(i)?null:new p("Invalid "+t+" `"+o+"` of type `"+g(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:y(function(n,r,t,o,i){var a=n[r];return e.isValidElementType(a)?null:new p("Invalid "+o+" `"+i+"` of type `"+g(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return y(function(n,r,t,o,i){if(!(n[r]instanceof e)){var a=e.name||s;return new p("Invalid "+o+" `"+i+"` of type `"+(((l=n[r]).constructor&&l.constructor.name?l.constructor.name:s)+"` supplied to `")+t+"`, expected instance of `"+a+"`.")}var l;return null})},node:y(function(e,n,r,t,o){return m(e[n])?null:new p("Invalid "+t+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return y(function(n,o,i,a,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var c=n[o],u=g(c);if("object"!==u)return new p("Invalid "+a+" `"+l+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var s in c)if(t(c,s)){var f=e(c,s,i,a,l+"."+s,r);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return y(function(n,r,t,o,i){for(var a=n[r],l=0;l<e.length;l++)if(d(a,e[l]))return null;var c=JSON.stringify(e,function(e,n){return"symbol"===b(n)?String(n):n});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+t+"`, expected one of "+c+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+n+"."),a}return y(function(n,o,i,a,l){for(var c=[],u=0;u<e.length;u++){var s=(0,e[u])(n,o,i,a,l,r);if(null==s)return null;s.data&&t(s.data,"expectedType")&&c.push(s.data.expectedType)}return new p("Invalid "+a+" `"+l+"` supplied to `"+i+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return y(function(n,t,o,i,a){var l=n[t],c=g(l);if("object"!==c)return new p("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var s=e[u];if("function"!=typeof s)return h(o,i,a,u,b(s));var f=s(l,u,o,i,a+"."+u,r);if(f)return f}return null})},exact:function(e){return y(function(o,i,a,l,c){var u=o[i],s=g(u);if("object"!==s)return new p("Invalid "+l+" `"+c+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var f=n({},o[i],e);for(var d in f){var y=e[d];if(t(e,d)&&"function"!=typeof y)return h(a,l,c,d,b(y));if(!y)return new p("Invalid "+l+" `"+c+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=y(u,d,a,l,c+"."+d,r);if(v)return v}return null})}};function d(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function p(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var n={},t=0;function o(o,a,l,u,f,d,y){if(u=u||s,d=d||l,y!==r){if(c){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+l;!n[h]&&t<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[h]=!0,t++)}}return null==a[l]?o?null===a[l]?new p("The "+f+" `"+d+"` is marked as required in `"+u+"`, but its value is `null`."):new p("The "+f+" `"+d+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(a,l,u,f,d)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function v(e){return y(function(n,r,t,o,i,a){var l=n[r];return g(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+t+"`, expected `"+e+"`.",{expectedType:e}):null})}function h(e,n,r,t,o){return new p((e||"React class")+": "+n+" type `"+r+"."+t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||l(e))return!0;var n=function(e){var n=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof n)return n}(e);if(!n)return!1;var r,t=n.call(e);if(n!==e.entries){for(;!(r=t.next()).done;)if(!m(r.value))return!1}else for(;!(r=t.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function b(e){if(null==e)return""+e;var n=g(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function w(e){var n=b(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return p.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},D}function H(){if(L)return z;L=1;var e=M();function n(){}function r(){}return r.resetWarningCache=n,z=function(){function t(n,r,t,o,i,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return t}t.isRequired=t;var i={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:o,element:t,elementType:t,instanceOf:o,node:t,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return i.PropTypes=i,i}}function Y(){if($)return b.exports;if($=1,"production"!==process.env.NODE_ENV){var e=_();b.exports=F()(e.isElement,true)}else b.exports=H()();return b.exports}var q=m(Y());function U(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function X(e,n,r){return n&&function(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,ee(t.key),t)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ne(e))||n){r&&(e=r);var t=0,o=function(){};return{s:o,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw i}}}}function K(e,n,r){return(n=ee(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function J(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,t)}return r}function G(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?J(Object(r),!0).forEach(function(n){K(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,o,i,a,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,0===n);else for(;!(c=(t=i.call(r)).done)&&(l.push(t.value),l.length!==n);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(e,n)||ne(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ee(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,n);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}function ne(e,n){if(e){if("string"==typeof e)return U(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(e,n):void 0}}var re={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6},te=re=Object.freeze(re),oe={UPDATE_SIZE:1},ie=oe=Object.freeze(oe),ae=function(){return X(function e(n){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.containers={},this.containerRefs={},this.ldf=n,this.numberOfContainers=0,this.registeredContainers=0,this.layoutLoaded=!1,this.numberOfContainers=this.ldf.containers?Object.keys(this.ldf.containers).length:0,this.worker=null},[{key:"startWorker",value:function(){try{this.worker=new Worker(new URL("./Worker/LayoutWorker.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(te.INITIALIZE,{ldf:this.ldf})}catch(e){console.error("Failed to create worker:",e)}}},{key:"sendToWorker",value:function(e,n){this.worker||this.startWorker(),this.worker.postMessage({code:e,args:n})}},{key:"registerContainer",value:function(e,n,r){e in this.containers||(this.registeredContainers+=1),this.containers[e]=n,this.containerRefs[e]=r,console.log("Registered container with id: ".concat(e," ")),this.registeredContainers!==this.numberOfContainers||this.layoutLoaded||(console.log("All containers registered, layout is ready."),this.sendToWorker(te.INITIALIZE_FLEXBOX))}},{key:"unregisterContainer",value:function(e){delete this.containers[e]}},{key:"handleRootResize",value:function(){if(this.layoutLoaded){var e={};for(var n in this.containerRefs)if(this.containerRefs.hasOwnProperty(n)){var r=this.containerRefs[n].getBoundingClientRect();e[n]={width:r.width,height:r.height}}this.sendToWorker(te.APPLY_SIZES,{sizes:e})}}},{key:"moveHandleBar",value:function(e){for(var n={},r=0,t=[e.parent,e.sibling1,e.sibling2];r<t.length;r++){var o=t[r],i=this.containerRefs[o].getBoundingClientRect();n[o]={width:i.width,height:i.height}}e.sizes=n,this.sendToWorker(te.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var r=this;requestAnimationFrame(function(){var t,o=Z(e);try{for(o.s();!(t=o.n()).done;){var i=t.value;switch(i.type){case ie.UPDATE_SIZE:r.containers[i.id].current.updateStyles(i.args.style);break;case ie.REMOVE_NODE:break;default:console.warn("Unknown transformation was requested.")}}}catch(e){o.e(e)}finally{o.f()}n&&(r.layoutLoaded=!0)})}},{key:"handleWorkerMessage",value:function(e){var n;switch(e.data.type){case te.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case te.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case te.ERROR:console.error("Error from worker:",e.data)}}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),le=t(null);function ce(e){var t=e.layout,o=e.children,i=n(function(){return new ae(t)},[t]);return r(function(){return function(){i.destroy()}},[i]),f(le.Provider,{value:i,children:o})}function ue(){var e=o(le);if(!e)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return e}function se(e,n){void 0===n&&(n={});var r=n.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}ce.propTypes={layout:q.object.isRequired,children:q.node.isRequired};se(".handleBarHorizontalContainer {\n position: relative;\n width: 100%;\n height: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarHorizontal {\n position: absolute;\n top: 50%;\n height: 1px;\n left: 0;\n right: 0;\n transform: translateY(-50%);\n transition: all 0.2s ease;\n}\n\n.handleBarHorizontal:hover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarHorizontalHover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalContainer {\n position: relative;\n height: 100%;\n width: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarVertical {\n position: absolute;\n top: 0;\n width: 1px;\n left: 50%;\n bottom: 0;\n transform: translateX(-50%);\n transition: all 0.3s ease;\n}\n\n.handleBarVertical:hover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalHover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}");var fe=function(n){var t=n.orientation,o=n.parent,a=n.sibling1,l=n.sibling2,c=ue(),u=i(null),s=i(null),d=i(null),p=function(e){var n,r,i;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",y),document.addEventListener("mouseup",v),"horizontal"===t?(n="clientY",r="height",i="handleBarHorizontalHover"):"vertical"===t&&(n="clientX",r="width",i="handleBarVerticalHover");for(var f,d,p=c.containerRefs[o],h=c.containerRefs[a],m=c.containerRefs[l],g=c.ldf.containers[o],b=0;b<g.children.length;b++)g.children[b].containerId===a?f=g.children[b].size:g.children[b].containerId===l&&(d=g.children[b].size);u.current={downValueY:e[n],hoverClass:i,downKey:n,propKey:r,parentSize:p.getBoundingClientRect()[r],parentRef:p,sibling1Ref:h,sibling2Ref:m,sibling1LayoutConfig:f,sibling2LayoutConfig:d,sibling1Size:h.getBoundingClientRect()[r],sibling2Size:m.getBoundingClientRect()[r]},s.current.classList.add(i)};var y=function(e){if(u.current){e.preventDefault(),e.stopPropagation();var n=u.current,r=e[n.downKey]-n.downValueY,t=n.sibling1Size+r,i=n.sibling2Size-r;clearTimeout(d.current),d.current=setTimeout(function(){var r,t,i;c.moveHandleBar({handle:(r=e,t=n.parentRef,i=t.getBoundingClientRect(),{x:r.clientX-i.left,y:r.clientY-i.top}),parent:o,sibling1:a,sibling2:l})},4);var s=Object.keys(n.sibling1LayoutConfig);if(!(s.includes("min")&&t<=n.sibling1LayoutConfig.min.value||s.includes("max")&&t>=n.sibling1LayoutConfig.max.value)){var f=Object.keys(n.sibling2LayoutConfig);if(!(f.includes("min")&&i<=n.sibling2LayoutConfig.min.value||f.includes("max")&&i>=n.sibling2LayoutConfig.max.value)){var p=n.sibling1LayoutConfig.initial.type,y=n.sibling2LayoutConfig.initial.type;if("fill"===p&&"fill"===y&&t>50&&i>50)return c.containerRefs[a].style[n.propKey]=t+"px",void(c.containerRefs[l].style[n.propKey]=i+"px");"fill"!==p&&(c.containerRefs[a].style[n.propKey]=t+"px"),"fill"!==y&&(c.containerRefs[l].style[n.propKey]=i+"px")}}}},v=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v),clearTimeout(d.current),s.current&&u.current&&s.current.classList.remove(u.current.hoverClass),u.current=null};return r(function(){return function(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v),d.current&&(clearTimeout(d.current),d.current=null)}},[]),f(e.Fragment,{children:"horizontal"===t?f("div",{onMouseDown:function(e){return p(e)},className:"handleBarHorizontalContainer",children:f("div",{ref:s,className:"handleBarHorizontal"})}):"vertical"===t?f("div",{onMouseDown:function(e){return p(e)},className:"handleBarVerticalContainer",children:f("div",{ref:s,className:"handleBarVertical"})}):null})};fe.propTypes={orientation:q.string,sibling1:q.string,sibling2:q.string,parent:q.string};se(".relative-container {\n position: relative;\n}\n\n.relative-container.hiding-horizontal {\n width: 0px !important;\n}\n\n.relative-container.hiding-vertical {\n height: 0px !important;\n}");var de=t({});de.displayName="ComponentRegistryContext";se(".lazyContainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}");var pe=function(e){var r=e.content,t=o(de),i=n(function(){if(t&&r&&"component"in r&&r.component in t)return a(t[r.component])},[t,r]);return f("div",{className:"lazyContainer",children:f(l,{fallback:f("div",{children:"Loading..."}),children:i&&f(i,{})})})};pe.propTypes={content:q.object};var ye=function(e){var n=e.node,r=ue(),t=i(null),o=i(null),a=Q(c(null),2),l=a[0],d=a[1],p=u(function(e){for(var n=[],t=0;t<e.children.length;t++){var o=e.children[t];if("container"===o.type){var i=r.ldf.containers[e.children[t].containerId];i.parent=e,n.push(f(ye,{meta:e.children[t],id:i.id,node:i},t))}else"handleBar"===o.type&&("horizontal"===e.orientation?n.push(f(fe,{orientation:"vertical",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)):"vertical"===e.orientation&&n.push(f(fe,{orientation:"horizontal",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)))}return n},[r]),y=i({});return y.current={updateStyles:function(e){var n="hiding-"+o.current;for(var r in e)if("display"===r&&"none"===e[r]){if(t.current.classList.contains(n))return;t.current.classList.add(n)}else if("display"===r&&"flex"===e[r]){if(!t.current.classList.contains(n))return;t.current.classList.remove(n)}else t.current.style[r]=e[r]}},s(function(){if(n&&r&&t.current){o.current=n.parent.orientation;var e=n.children&&n.children.length>0;return e?"horizontal"===n.orientation?(t.current.style.display="flex",t.current.style.flexDirection="row",t.current.style.width="100%"):"vertical"===n.orientation?(t.current.style.display="flex",t.current.style.flexDirection="column",t.current.style.height="100%"):console.warn("Unknown orientation:",n.orientation):n.background?t.current.style.background=n.background:t.current.style.background="transparent",d(e?p(n):f(pe,{content:n})),r.registerContainer(n.id,y,t.current),function(){r.unregisterContainer(n.id)}}},[n,r,p]),f("div",{ref:t,className:"relative-container",children:l})};ye.propTypes={node:q.object};var ve=t(null),he=function(e){var r=e.children,t=Q(c({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}),2),o=t[0],i=t[1],a=Q(c(null),2),l=a[0],s=a[1],d=u(function(e){var n,r,t,o;i({activeId:null!==(n=null===(r=e.active)||void 0===r?void 0:r.id)&&void 0!==n?n:null,activeData:null!==(t=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==t?t:null,overId:null,overData:null,isDragging:!0})},[]),p=u(function(e){i(function(n){var r,t,o,i;return G(G({},n),{},{overId:null!==(r=null===(t=e.over)||void 0===t?void 0:t.id)&&void 0!==r?r:null,overData:null!==(o=null===(i=e.over)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null})})},[]),y=u(function(e){var n,r,t,o,a,l,c,u;s({activeId:null!==(n=null===(r=e.active)||void 0===r?void 0:r.id)&&void 0!==n?n:null,activeData:null!==(t=null===(o=e.active)||void 0===o||null===(o=o.data)||void 0===o?void 0:o.current)&&void 0!==t?t:null,overId:null!==(a=null===(l=e.over)||void 0===l?void 0:l.id)&&void 0!==a?a:null,overData:null!==(c=null===(u=e.over)||void 0===u||null===(u=u.data)||void 0===u?void 0:u.current)&&void 0!==c?c:null}),i({activeId:null,activeData:null,overId:null,overData:null,isDragging:!1})},[]),v=n(function(){return{dragState:o,drop:l,handleDragStart:d,handleDragOver:p,clearDrag:y}},[o,l,d,p,y]);return f(ve.Provider,{value:v,children:r})},me=function(){var n=e.useContext(ve);if(!n)throw new Error("useDragState must be used inside DragProvider");return n};se(".root-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.relative-container {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.drag-overlay {\n position: fixed;\n pointer-events: none;\n z-index: 9999;\n}");var ge=function(){var e,n=ue(),t=me(),o=t.dragState,a=t.handleDragStart,l=t.handleDragOver,m=t.clearDrag,g=i(null),b=i(null),w=i(!1),O=i({});O.current={};var S=Q(c(null),2),x=S[0],E=S[1],k=u(function(e){for(var r=[],t=0;t<e.children.length;t++){var o=e.children[t];if("container"===o.type){var i=n.ldf.containers[e.children[t].containerId];i.parent=e,r.push(f(ye,{meta:e.children[t],id:i.id,node:i},t))}else"handleBar"===o.type&&("horizontal"===e.orientation?r.push(f(fe,{orientation:"vertical",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)):"vertical"===e.orientation&&r.push(f(fe,{orientation:"horizontal",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)))}return r},[n]);s(function(){if(n){var e=n.ldf.containers[n.ldf.layoutRoot],r=e.children&&e.children.length>0;n.registerContainer(e.id,O,g.current),r&&("horizontal"===e.orientation?g.current.style.flexDirection="row":"vertical"===e.orientation&&(g.current.style.flexDirection="column")),E(r?k(e):null);var t=new ResizeObserver(function(e){w.current||(w.current=!0);var r,t=Z(e);try{var o=function(){var e=r.value.contentRect,t=e.width,o=e.height;clearTimeout(b.current),b.current=setTimeout(function(){w.current=!1,n.handleRootResize(t,o)},1)};for(t.s();!(r=t.n()).done;)o()}catch(e){t.e(e)}finally{t.f()}});return t.observe(g.current),function(){n.unregisterContainer(n.ldf.layoutRoot),t.disconnect()}}},[n]);var j=p(y(v,{activationConstraint:{distance:8}})),C=Q(c({left:0,top:0}),2),T=C[0],R=C[1];return r(function(){if(o.isDragging){var e=function(e){R({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[o.isDragging]),d(h,{sensors:j,onDragStart:a,onDragOver:l,onDragEnd:m,onDragCancel:m,children:[f("div",{className:"root-container",children:f("div",{ref:g,className:"relative-container",children:x})}),o.isDragging&&f("div",{className:"drag-overlay",style:T,children:null==o||null===(e=o.activeData)||void 0===e?void 0:e.preview})]})};se("");var be=function(e){var n=e.ldf,r=e.registry;return f(he,{children:f(ce,{layout:n,children:f(de.Provider,{value:r,children:f(ge,{})})})})};be.propTypes={ldf:q.object,registry:q.object};export{be as LayoutManager,me as useDragState};
14
+ */function V(){if(T)return k;T=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return k=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(e){return n[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var i,a,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),c=1;c<arguments.length;c++){for(var s in i=Object(arguments[c]))n.call(i,s)&&(l[s]=i[s]);if(e){a=e(i);for(var u=0;u<a.length;u++)t.call(i,a[u])&&(l[a[u]]=i[a[u]])}}return l},k}function W(){if(j)return I;j=1;return I="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function F(){return R?N:(R=1,N=Function.call.bind(Object.prototype.hasOwnProperty))}function H(){if(z)return P;z=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=W(),t={},r=F();e=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}}function o(o,i,a,l,c){if("production"!==process.env.NODE_ENV)for(var s in o)if(r(o,s)){var u;try{if("function"!=typeof o[s]){var f=Error((l||"React class")+": "+a+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=o[s](i,s,l,a,null,n)}catch(e){u=e}if(!u||u instanceof Error||e((l||"React class")+": type specification of "+a+" `"+s+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var d=c?c():"";e("Failed "+a+" type: "+u.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},P=o}function U(){if(L)return D;L=1;var e=M(),n=V(),t=W(),r=F(),o=H(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),D=function(l,c){var s="function"==typeof Symbol&&Symbol.iterator;var u="<<anonymous>>",f={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(a),arrayOf:function(e){return v(function(n,r,o,i,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=n[r];if(!Array.isArray(l))return new p("Invalid "+i+" `"+a+"` of type `"+g(l)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<l.length;c++){var s=e(l,c,o,i,a+"["+c+"]",t);if(s instanceof Error)return s}return null})},element:v(function(e,n,t,r,o){var i=e[n];return l(i)?null:new p("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+t+"`, expected a single ReactElement.")}),elementType:v(function(n,t,r,o,i){var a=n[t];return e.isValidElementType(a)?null:new p("Invalid "+o+" `"+i+"` of type `"+g(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return v(function(n,t,r,o,i){if(!(n[t]instanceof e)){var a=e.name||u;return new p("Invalid "+o+" `"+i+"` of type `"+(((l=n[t]).constructor&&l.constructor.name?l.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var l;return null})},node:v(function(e,n,t,r,o){return b(e[n])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return v(function(n,o,i,a,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var c=n[o],s=g(c);if("object"!==s)return new p("Invalid "+a+" `"+l+"` of type `"+s+"` supplied to `"+i+"`, expected an object.");for(var u in c)if(r(c,u)){var f=e(c,u,i,a,l+"."+u,t);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return v(function(n,t,r,o,i){for(var a=n[t],l=0;l<e.length;l++)if(d(a,e[l]))return null;var c=JSON.stringify(e,function(e,n){return"symbol"===m(n)?String(n):n});return new p("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+c+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+n+"."),a}return v(function(n,o,i,a,l){for(var c=[],s=0;s<e.length;s++){var u=(0,e[s])(n,o,i,a,l,t);if(null==u)return null;u.data&&r(u.data,"expectedType")&&c.push(u.data.expectedType)}return new p("Invalid "+a+" `"+l+"` supplied to `"+i+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")})},shape:function(e){return v(function(n,r,o,i,a){var l=n[r],c=g(l);if("object"!==c)return new p("Invalid "+i+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var s in e){var u=e[s];if("function"!=typeof u)return h(o,i,a,s,m(u));var f=u(l,s,o,i,a+"."+s,t);if(f)return f}return null})},exact:function(e){return v(function(o,i,a,l,c){var s=o[i],u=g(s);if("object"!==u)return new p("Invalid "+l+" `"+c+"` of type `"+u+"` supplied to `"+a+"`, expected `object`.");var f=n({},o[i],e);for(var d in f){var v=e[d];if(r(e,d)&&"function"!=typeof v)return h(a,l,c,d,m(v));if(!v)return new p("Invalid "+l+" `"+c+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=v(s,d,a,l,c+"."+d,t);if(y)return y}return null})}};function d(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function p(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var n={},r=0;function o(o,a,l,s,f,d,v){if(s=s||u,d=d||l,v!==t){if(c){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=s+":"+l;!n[h]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+s+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[h]=!0,r++)}}return null==a[l]?o?null===a[l]?new p("The "+f+" `"+d+"` is marked as required in `"+s+"`, but its value is `null`."):new p("The "+f+" `"+d+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(a,l,s,f,d)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function y(e){return v(function(n,t,r,o,i,a){var l=n[t];return g(l)!==e?new p("Invalid "+o+" `"+i+"` of type `"+m(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function h(e,n,t,r,o){return new p((e||"React class")+": "+n+" type `"+t+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function b(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(b);if(null===e||l(e))return!0;var n=function(e){var n=e&&(s&&e[s]||e["@@iterator"]);if("function"==typeof n)return n}(e);if(!n)return!1;var t,r=n.call(e);if(n!==e.entries){for(;!(t=r.next()).done;)if(!b(t.value))return!1}else for(;!(t=r.next()).done;){var o=t.value;if(o&&!b(o[1]))return!1}return!0;default:return!1}}function g(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function m(e){if(null==e)return""+e;var n=g(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function w(e){var n=m(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return p.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},D}function Y(){if($)return A;$=1;var e=W();function n(){}function t(){}return t.resetWarningCache=n,A=function(){function r(n,t,r,o,i,a){if(a!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:t,resetWarningCache:n};return i.PropTypes=i,i}}function q(){if(B)return x.exports;if(B=1,"production"!==process.env.NODE_ENV){var e=M();x.exports=U()(e.isElement,true)}else x.exports=Y()();return x.exports}var X=m(q());function Z(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function K(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function J(e,n,t){return n&&function(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ne(r.key),r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function G(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=te(e))||n){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(l)throw i}}}}function Q(e,n,t){return(n=ne(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function ee(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(t=t.call(e)).next,0===n);else for(;!(c=(r=i.call(t)).done)&&(l.push(r.value),l.length!==n);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(e,n)||te(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,n);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}function te(e,n){if(e){if("string"==typeof e)return Z(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Z(e,n):void 0}}var re={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6,INVOKE_ACTION:7},oe=re=Object.freeze(re),ie={UPDATE_SIZE:1},ae=ie=Object.freeze(ie),le=function(){return J(function e(n){K(this,e),this.containers={},this.containerRefs={},this.ldf=n,this.numberOfContainers=0,this.registeredContainers=0,this.layoutLoaded=!1,this.numberOfContainers=this.ldf.containers?Object.keys(this.ldf.containers).length:0,this.worker=null},[{key:"startWorker",value:function(){try{this.worker=new Worker(new URL("./Worker/LayoutWorker.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(oe.INITIALIZE,{ldf:this.ldf})}catch(e){console.error("Failed to create worker:",e)}}},{key:"sendToWorker",value:function(e,n){this.worker||this.startWorker(),this.worker.postMessage({code:e,args:n})}},{key:"registerContainer",value:function(e,n,t){e in this.containers||(this.registeredContainers+=1),this.containers[e]=n,this.containerRefs[e]=t,console.log("Registered container with id: ".concat(e," ")),this.registeredContainers!==this.numberOfContainers||this.layoutLoaded||(console.log("All containers registered, layout is ready."),this.sendToWorker(oe.INITIALIZE_FLEXBOX))}},{key:"unregisterContainer",value:function(e){delete this.containers[e]}},{key:"handleRootResize",value:function(){if(this.layoutLoaded){var e={};for(var n in this.containerRefs)if(this.containerRefs.hasOwnProperty(n)){var t=this.containerRefs[n].getBoundingClientRect();e[n]={width:t.width,height:t.height}}this.sendToWorker(oe.APPLY_SIZES,{sizes:e})}}},{key:"moveHandleBar",value:function(e){for(var n={},t=0,r=[e.parent,e.sibling1,e.sibling2];t<r.length;t++){var o=r[t],i=this.containerRefs[o].getBoundingClientRect();n[o]={width:i.width,height:i.height}}e.sizes=n,this.sendToWorker(oe.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var t=this;requestAnimationFrame(function(){var r,o=G(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;switch(i.type){case ae.UPDATE_SIZE:t.containers[i.id].current.updateStyles(i.args.style);break;case ae.REMOVE_NODE:break;default:console.warn("Unknown transformation was requested.")}}}catch(e){o.e(e)}finally{o.f()}n&&(t.layoutLoaded=!0)})}},{key:"handleWorkerMessage",value:function(e){var n;switch(e.data.type){case oe.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case oe.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case oe.ERROR:console.error("Error from worker:",e.data)}}},{key:"invokeAction",value:function(e){var n=e.id,t=e.action,r=e.args;this.sendToWorker(oe.INVOKE_ACTION,{id:n,action:t,args:r})}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),ce=r(null);function se(e){var r=e.layout,o=e.children,i=n(function(){return new le(r)},[r]);return t(function(){return function(){i.destroy()}},[i]),d(ce.Provider,{value:i,children:o})}function ue(){var e=o(ce);if(!e)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return e}function fe(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}se.propTypes={layout:X.object.isRequired,children:X.node.isRequired};fe(".handleBarHorizontalContainer {\n position: relative;\n width: 100%;\n height: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarHorizontal {\n position: absolute;\n top: 50%;\n height: 1px;\n left: 0;\n right: 0;\n transform: translateY(-50%);\n transition: all 0.2s ease;\n}\n\n.handleBarHorizontal:hover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarHorizontalHover {\n background-color: #007acc;\n cursor: ns-resize;\n height: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalContainer {\n position: relative;\n height: 100%;\n width: 1px;\n background-color: #414141;\n z-index: 1;\n}\n\n.handleBarVertical {\n position: absolute;\n top: 0;\n width: 1px;\n left: 50%;\n bottom: 0;\n transform: translateX(-50%);\n transition: all 0.3s ease;\n}\n\n.handleBarVertical:hover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}\n\n.handleBarVerticalHover {\n background-color: #007acc;\n cursor: ew-resize;\n width: 5px;\n z-index: 10;\n}");var de=function(n){var r=n.orientation,o=n.parent,a=n.sibling1,l=n.sibling2,c=ue(),s=i(null),u=i(null),f=i(null),p=function(e){var n,t,i;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",v),document.addEventListener("mouseup",y),"horizontal"===r?(n="clientY",t="height",i="handleBarHorizontalHover"):"vertical"===r&&(n="clientX",t="width",i="handleBarVerticalHover");for(var f,d,p=c.containerRefs[o],h=c.containerRefs[a],b=c.containerRefs[l],g=c.ldf.containers[o],m=0;m<g.children.length;m++)g.children[m].containerId===a?f=g.children[m].size:g.children[m].containerId===l&&(d=g.children[m].size);s.current={downValueY:e[n],hoverClass:i,downKey:n,propKey:t,parentSize:p.getBoundingClientRect()[t],parentRef:p,sibling1Ref:h,sibling2Ref:b,sibling1LayoutConfig:f,sibling2LayoutConfig:d,sibling1Size:h.getBoundingClientRect()[t],sibling2Size:b.getBoundingClientRect()[t]},u.current.classList.add(i)};var v=function(e){if(s.current){e.preventDefault(),e.stopPropagation();var n=s.current,t=e[n.downKey]-n.downValueY,r=n.sibling1Size+t,i=n.sibling2Size-t;clearTimeout(f.current),f.current=setTimeout(function(){var t,r,i;c.moveHandleBar({handle:(t=e,r=n.parentRef,i=r.getBoundingClientRect(),{x:t.clientX-i.left,y:t.clientY-i.top}),parent:o,sibling1:a,sibling2:l})},4);var u=Object.keys(n.sibling1LayoutConfig);if(!(u.includes("min")&&r<=n.sibling1LayoutConfig.min.value||u.includes("max")&&r>=n.sibling1LayoutConfig.max.value)){var d=Object.keys(n.sibling2LayoutConfig);d.includes("min")&&i<=n.sibling2LayoutConfig.min.value||d.includes("max")&&i>=n.sibling2LayoutConfig.max.value||r<50||i<50||(c.containerRefs[a].style[n.propKey]=r+"px",c.containerRefs[l].style[n.propKey]=i+"px")}}},y=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",y),clearTimeout(f.current),u.current&&s.current&&u.current.classList.remove(s.current.hoverClass),s.current=null};return t(function(){return function(){document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",y),f.current&&(clearTimeout(f.current),f.current=null)}},[]),d(e.Fragment,{children:"horizontal"===r?d("div",{onMouseDown:function(e){return p(e)},className:"handleBarHorizontalContainer",children:d("div",{ref:u,className:"handleBarHorizontal"})}):"vertical"===r?d("div",{onMouseDown:function(e){return p(e)},className:"handleBarVerticalContainer",children:d("div",{ref:u,className:"handleBarVertical"})}):null})};de.propTypes={orientation:X.string,sibling1:X.string,sibling2:X.string,parent:X.string};fe(".relative-container {\n position: relative;\n}\n\n.relative-container.hiding-horizontal {\n width: 0px !important;\n}\n\n.relative-container.hiding-vertical {\n height: 0px !important;\n}");var pe=r({});pe.displayName="ComponentRegistryContext";fe(".titleContainer {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 1px;\n display: flex;\n align-items: center;\n color: #bbbbbb;\n justify-content: space-between;\n background: #222425;\n}\n\n.titleContainer > .title {\n padding-left: 30px;\n font-size: 11px;\n}\n\n.titleContainer > .close {\n padding-right: 15px;\n font-size: 11px;\n cursor: pointer;\n}");var ve=["color","size","title","className"];function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},ye.apply(null,arguments)}var he=a(function(n,t){var r=n.color,o=void 0===r?"currentColor":r,i=n.size,a=void 0===i?"1em":i,l=n.title,c=void 0===l?null:l,s=n.className,u=void 0===s?"":s,f=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],-1===n.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(n,ve);return e.createElement("svg",ye({ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:a,height:a,fill:o,className:["bi","bi-x-lg",u].filter(Boolean).join(" ")},f),c?e.createElement("title",null,c):null,e.createElement("path",{d:"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"}))});he.propTypes={color:X.string,size:X.oneOfType([X.string,X.number]),title:X.string,className:X.string};var be=function(e){var n,t,r=e.node,o=ue();return p("div",{className:"titleContainer",children:[d("div",{className:"title",children:null==r||null===(n=r.menuBar)||void 0===n?void 0:n.title}),(null==r||null===(t=r.menuBar)||void 0===t?void 0:t.showClose)&&d("div",{onClick:function(){var e;o.invokeAction({id:null==r||null===(e=r.menuBar)||void 0===e?void 0:e.closeContainerId,action:"close",args:{}})},className:"close",children:d(he,{})})]})};be.propTypes={node:X.object};fe(".container-tabs-row {\n position: relative;\n width: 100%;\n height: 100%;\n background: #222425;\n display: flex;\n justify-content: space-between;\n}\n\n.container-tabs-row > .container-tabs {\n display: flex;\n flex-direction: row;\n gap: 5px;\n margin-left: 20px;\n}\n\n.container-tabs-row > .container-tabs > .container-tab {\n display: flex;\n align-items: center;\n cursor: pointer;\n padding: 0 10px;\n height: 28px;\n font-size: 13px;\n color: #bbbbbb;\n}\n\n.container-tabs-row > .container-close {\n display: flex;\n align-items: center;\n cursor: pointer;\n color: white;\n font-size: 11px;\n margin-right: 10px;\n}");var ge=function(e){var n,t,r=e.node,o=e.onTabClick,i=ue();return p("div",{className:"container-tabs-row",children:[d("div",{className:"container-tabs",children:null==r||null===(n=r.tabsBar)||void 0===n||null===(n=n.tabs)||void 0===n?void 0:n.map(function(e,n){return d("div",{style:{borderBottom:e.selected?"solid 1px white":"none"},onClick:function(n){return o(e)},className:"container-tab",children:e.name},e.name+String(n))})}),(null==r||null===(t=r.tabsBar)||void 0===t?void 0:t.showClose)&&d("div",{className:"container-close",children:d(he,{onClick:function(){var e;i.invokeAction({id:null==r||null===(e=r.tabsBar)||void 0===e?void 0:e.closeContainerId,action:"close",args:{}})}})})]})};ge.propTypes={node:X.array,onTabsClick:X.func};fe("/** \nTODO: I agree that it is convoluted to use absolute, then relative and then absolute.\nHowever, the reason I am doing it is, it makes the layout of the monaco editor trivial\nand avoids resize observer loops when the container sizes change. I haven't thought\nabout this enough and I will revisit it later.\n*/\n.absoluteContainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}\n\n.contentContainer {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.menuContainer {\n position: absolute;\n top: 0px;\n height: 35px;\n left: 0px;\n right: 0px;\n}\n\n.tabsContainer {\n position: absolute;\n top: 0px;\n height: 35px;\n left: 0px;\n right: 0px;\n}\n\n.lazycontainer {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n}");var me=function(e){var r=e.node,i=o(pe),a=ee(l(!1),2),u=a[0],f=a[1],v=ee(l(!1),2),y=v[0],h=v[1],b=ee(l(0),2),g=b[0],m=b[1],w=ee(l(0),2),x=w[0],S=w[1],O=ee(l(""),2),E=O[0],C=O[1],k=n(function(){if(i&&E in i)return c(i[E])},[i,E]);t(function(){var e=0,n=0;"menuBar"in r&&(f(!0),n+=35,e+=35),"tabsBar"in r?(h(!0),e+=35,T(r.tabsBar.tabs[0])):C(r.component),m(e),S(n)},[r]);var T=function(e){r.tabsBar.tabs.forEach(function(n){n===e?(n.selected=!0,C(n.component)):n.selected=!1})};return d("div",{className:"absoluteContainer",children:p("div",{className:"contentContainer",children:[u&&d("div",{className:"menuContainer",children:d(be,{node:r})}),y&&d("div",{className:"tabsContainer",style:{top:"".concat(x,"px")},children:d(ge,{node:r,onTabClick:T})}),d("div",{className:"lazycontainer",style:{top:"".concat(g,"px")},children:d(s,{fallback:d("div",{children:"Loading..."}),children:k&&d(k,{})})})]})})};me.propTypes={content:X.object};var we=function(e){var n=e.node,t=ue(),r=i(null),o=i(null),a=ee(l(null),2),c=a[0],s=a[1],p=u(function(e){for(var n=[],r=0;r<e.children.length;r++){var o=e.children[r];if("container"===o.type){var i=t.ldf.containers[e.children[r].containerId];i.parent=e,n.push(d(we,{meta:e.children[r],id:i.id,node:i},r))}else"handleBar"===o.type&&("horizontal"===e.orientation?n.push(d(de,{orientation:"vertical",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},r)):"vertical"===e.orientation&&n.push(d(de,{orientation:"horizontal",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},r)))}return n},[t]),v=i({});return v.current={updateStyles:function(e){var n="hiding-"+o.current;for(var t in e)if("display"===t&&"none"===e[t]){if(r.current.classList.contains(n))return;r.current.classList.add(n)}else if("display"===t&&"flex"===e[t]){if(!r.current.classList.contains(n))return;r.current.classList.remove(n)}else r.current.style[t]=e[t]}},f(function(){if(n&&t&&r.current){o.current=n.parent.orientation;var e=n.children&&n.children.length>0;return e?"horizontal"===n.orientation?(r.current.style.display="flex",r.current.style.flexDirection="row",r.current.style.width="100%"):"vertical"===n.orientation?(r.current.style.display="flex",r.current.style.flexDirection="column",r.current.style.height="100%"):console.warn("Unknown orientation:",n.orientation):n.background?r.current.style.background=n.background:r.current.style.background="transparent",s(e?p(n):d(me,{node:n})),t.registerContainer(n.id,v,r.current),function(){t.unregisterContainer(n.id)}}},[n,t,p]),d("div",{ref:r,className:"relative-container",children:c})};we.propTypes={node:X.object};var xe=function(){return J(function e(){K(this,e),this.subscribers=new Map},[{key:"subscribe",value:function(e,n){var t=this;this.subscribers.has(e)||this.subscribers.set(e,new Set);var r=this.subscribers.get(e);r.add(n);return function(){r.delete(n),0===r.size&&t.subscribers.delete(e)}}},{key:"publish",value:function(e){var n=this.subscribers.get(e.type);if(n){var t,r=G(n);try{for(r.s();!(t=r.n()).done;){(0,t.value)(e)}}catch(e){r.e(e)}finally{r.f()}}}}])}(),Se=r(null);function Oe(e){var t=e.children,r=n(function(){return new xe},[]);return d(Se.Provider,{value:r,children:t})}var Ee=J(function e(n){var t=this,r=n.publish;K(this,e),Q(this,"resetDragState",function(){t.dragState={activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}}),Q(this,"onDragStart",function(e){var n,r,o,i;t.dragState={activeId:null!==(n=null===(r=e.active)||void 0===r?void 0:r.id)&&void 0!==n?n:null,activeData:null!==(o=null===(i=e.active)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null,overId:null,overData:null,isDragging:!0}}),Q(this,"onDragOver",function(e){var n,r,o,i;t.dragState.overId=null!==(n=null===(r=e.over)||void 0===r?void 0:r.id)&&void 0!==n?n:null,t.dragState.overData=null!==(o=null===(i=e.over)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null}),Q(this,"onDragEnd",function(e){var n,r,o,i,a,l,c,s;t.publish({type:"drag:drop",payload:{activeId:null!==(n=null===(r=e.active)||void 0===r?void 0:r.id)&&void 0!==n?n:null,activeData:null!==(o=null===(i=e.active)||void 0===i||null===(i=i.data)||void 0===i?void 0:i.current)&&void 0!==o?o:null,overId:null!==(a=null===(l=e.over)||void 0===l?void 0:l.id)&&void 0!==a?a:null,overData:null!==(c=null===(s=e.over)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.current)&&void 0!==c?c:null},source:"drag-provider"}),t.resetDragState()}),Q(this,"onDragCancel",function(e){t.resetDragState()}),Q(this,"isDragging",function(){return t.dragState.isDragging}),Q(this,"getDragPreview",function(){var e;return null===(e=t.dragState)||void 0===e||null===(e=e.activeData)||void 0===e?void 0:e.preview}),this.publish=r,this.resetDragState()}),Ce=function(){var e=function(){var e=o(Se);if(!e)throw new Error("useLayoutPublisher must be used within LayoutEventProvider");return e.publish.bind(e)}();return n(function(){return new Ee({publish:e})},[e])};fe('.root-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n}\n\n.relative-container {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.drag-overlay {\n position: fixed;\n pointer-events: none;\n z-index: 9999;\n}');var ke=function(){var e=ue(),n=Ce(),r=i(null),o=i(null),a=i(!1),c=i({});c.current={};var s=ee(l(null),2),m=s[0],w=s[1],x=u(function(n){for(var t=[],r=0;r<n.children.length;r++){var o=n.children[r];if("container"===o.type){var i=e.ldf.containers[n.children[r].containerId];i.parent=n,t.push(d(we,{meta:n.children[r],id:i.id,node:i},r))}else"handleBar"===o.type&&("horizontal"===n.orientation?t.push(d(de,{orientation:"vertical",parent:n.id,sibling1:o.sibling1,sibling2:o.sibling2},r)):"vertical"===n.orientation&&t.push(d(de,{orientation:"horizontal",parent:n.id,sibling1:o.sibling1,sibling2:o.sibling2},r)))}return t},[e]);f(function(){if(e){var n=e.ldf.containers[e.ldf.layoutRoot],t=n.children&&n.children.length>0;e.registerContainer(n.id,c,r.current),t&&("horizontal"===n.orientation?r.current.style.flexDirection="row":"vertical"===n.orientation&&(r.current.style.flexDirection="column")),w(t?x(n):null);var i=new ResizeObserver(function(n){a.current||(a.current=!0);var t,r=G(n);try{var i=function(){var n=t.value.contentRect,r=n.width,i=n.height;clearTimeout(o.current),o.current=setTimeout(function(){a.current=!1,e.handleRootResize(r,i)},1)};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}});return i.observe(r.current),function(){e.unregisterContainer(e.ldf.layoutRoot),i.disconnect()}}},[e]);var S=v(y(h,{activationConstraint:{distance:8}})),O=ee(l({left:0,top:0}),2),E=O[0],C=O[1];return t(function(){if(n.isDragging()){var e=function(e){C({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[n.isDragging()]),p(b,{sensors:S,collisionDetection:g,onDragStart:n.onDragStart,onDragOver:n.onDragOver,onDragEnd:n.onDragEnd,onDragCancel:n.onDragCancel,children:[d("div",{className:"root-container",children:d("div",{ref:r,className:"relative-container",children:m})}),n.isDragging()&&d("div",{className:"drag-overlay",style:E,children:n.getDragPreview()})]})};fe("");var Te=function(e){var n=e.ldf,t=e.registry;return d(se,{layout:n,children:d(Oe,{children:d(pe.Provider,{value:t,children:d(ke,{})})})})};Te.propTypes={ldf:X.object,registry:X.object};export{Te as LayoutManager};
15
15
  //# sourceMappingURL=index.js.map