ui-layout-manager-dev 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LayoutManager/Components/HandleBar/HandleBar.jsx +16 -2
- package/src/index.js +3 -1
- package/src/stories/layouts/vsCode/workbench.json +155 -13
package/dist/cjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react"),n=require("react/jsx-runtime"),t=require("@dnd-kit/core"),r="undefined"!=typeof document?document.currentScript:null;function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,a={exports:{}},s={exports:{}},l={};var c,u,f,d,p,v,y,h,b,g,m,x,w,S,j,
|
|
1
|
+
"use strict";var e=require("react"),n=require("react/jsx-runtime"),t=require("@dnd-kit/core"),r="undefined"!=typeof document?document.currentScript:null;function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,a={exports:{}},s={exports:{}},l={};var c,u,f,d,p,v,y,h,b,g,m,x,w,S,j,E={};
|
|
2
2
|
/** @license React v16.13.1
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
@@ -6,10 +6,10 @@
|
|
|
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 C(){return u||(u=1,"production"===process.env.NODE_ENV?s.exports=function(){if(i)return l;i=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,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var i=e.$$typeof;switch(i){case n:switch(e=e.type){case u:case f:case r:case a:case o:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case h:case y:case s:return e;default:return i}}case t:return i}}}function S(e){return w(e)===f}return l.AsyncMode=u,l.ConcurrentMode=f,l.ContextConsumer=c,l.ContextProvider=s,l.Element=n,l.ForwardRef=d,l.Fragment=r,l.Lazy=h,l.Memo=y,l.Portal=t,l.Profiler=a,l.StrictMode=o,l.Suspense=p,l.isAsyncMode=function(e){return S(e)||w(e)===u},l.isConcurrentMode=S,l.isContextConsumer=function(e){return w(e)===c},l.isContextProvider=function(e){return w(e)===s},l.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},l.isForwardRef=function(e){return w(e)===d},l.isFragment=function(e){return w(e)===r},l.isLazy=function(e){return w(e)===h},l.isMemo=function(e){return w(e)===y},l.isPortal=function(e){return w(e)===t},l.isProfiler=function(e){return w(e)===a},l.isStrictMode=function(e){return w(e)===o},l.isSuspense=function(e){return w(e)===p},l.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===f||e===a||e===o||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===m||e.$$typeof===x||e.$$typeof===b)},l.typeOf=w,l}():s.exports=(c||(c=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,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=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 l:case c:case r:case i:case o:case f:return y;default:var h=y&&y.$$typeof;switch(h){case s:case u:case v:case p:case a:return h;default:return d}}case t:return d}}}var x=l,w=c,S=s,j=a,C=n,
|
|
9
|
+
*/function C(){return u||(u=1,"production"===process.env.NODE_ENV?s.exports=function(){if(i)return l;i=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,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,f=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var i=e.$$typeof;switch(i){case n:switch(e=e.type){case u:case f:case r:case a:case o:case p:return e;default:switch(e=e&&e.$$typeof){case c:case d:case h:case y:case s:return e;default:return i}}case t:return i}}}function S(e){return w(e)===f}return l.AsyncMode=u,l.ConcurrentMode=f,l.ContextConsumer=c,l.ContextProvider=s,l.Element=n,l.ForwardRef=d,l.Fragment=r,l.Lazy=h,l.Memo=y,l.Portal=t,l.Profiler=a,l.StrictMode=o,l.Suspense=p,l.isAsyncMode=function(e){return S(e)||w(e)===u},l.isConcurrentMode=S,l.isContextConsumer=function(e){return w(e)===c},l.isContextProvider=function(e){return w(e)===s},l.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},l.isForwardRef=function(e){return w(e)===d},l.isFragment=function(e){return w(e)===r},l.isLazy=function(e){return w(e)===h},l.isMemo=function(e){return w(e)===y},l.isPortal=function(e){return w(e)===t},l.isProfiler=function(e){return w(e)===a},l.isStrictMode=function(e){return w(e)===o},l.isSuspense=function(e){return w(e)===p},l.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===f||e===a||e===o||e===p||e===v||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===y||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===m||e.$$typeof===x||e.$$typeof===b)},l.typeOf=w,l}():s.exports=(c||(c=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,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=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 l:case c:case r:case i:case o:case f:return y;default:var h=y&&y.$$typeof;switch(h){case s:case u:case v:case p:case a:return h;default:return d}}case t:return d}}}var x=l,w=c,S=s,j=a,C=n,O=u,k=r,R=v,T=p,I=t,N=i,P=o,L=f,z=!1;function D(e){return m(e)===c}E.AsyncMode=x,E.ConcurrentMode=w,E.ContextConsumer=S,E.ContextProvider=j,E.Element=C,E.ForwardRef=O,E.Fragment=k,E.Lazy=R,E.Memo=T,E.Portal=I,E.Profiler=N,E.StrictMode=P,E.Suspense=L,E.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)===l},E.isConcurrentMode=D,E.isContextConsumer=function(e){return m(e)===s},E.isContextProvider=function(e){return m(e)===a},E.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},E.isForwardRef=function(e){return m(e)===u},E.isFragment=function(e){return m(e)===r},E.isLazy=function(e){return m(e)===v},E.isMemo=function(e){return m(e)===p},E.isPortal=function(e){return m(e)===t},E.isProfiler=function(e){return m(e)===i},E.isStrictMode=function(e){return m(e)===o},E.isSuspense=function(e){return m(e)===f},E.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===f||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===p||e.$$typeof===a||e.$$typeof===s||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===g||e.$$typeof===y)},E.typeOf=m}()),E)),s.exports}
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/function E(){if(d)return f;d=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return f=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,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),l=1;l<arguments.length;l++){for(var c in i=Object(arguments[l]))n.call(i,c)&&(s[c]=i[c]);if(e){a=e(i);for(var u=0;u<a.length;u++)t.call(i,a[u])&&(s[a[u]]=i[a[u]])}}return s},f}function k(){if(v)return p;v=1;return p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function T(){return h?y:(h=1,y=Function.call.bind(Object.prototype.hasOwnProperty))}function R(){if(g)return b;g=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=k(),t={},r=T();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,s,l){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var u;try{if("function"!=typeof o[c]){var f=Error((s||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=o[c](i,c,s,a,null,n)}catch(e){u=e}if(!u||u instanceof Error||e((s||"React class")+": type specification of "+a+" `"+c+"` 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=l?l():"";e("Failed "+a+" type: "+u.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},b=o}function I(){if(x)return m;x=1;var e=C(),n=E(),t=k(),r=T(),o=R(),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){}}),m=function(s,l){var c="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 s=n[r];if(!Array.isArray(s))return new p("Invalid "+i+" `"+a+"` of type `"+g(s)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<s.length;l++){var c=e(s,l,o,i,a+"["+l+"]",t);if(c instanceof Error)return c}return null})},element:v(function(e,n,t,r,o){var i=e[n];return s(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 `"+(((s=n[t]).constructor&&s.constructor.name?s.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var s;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,s){if("function"!=typeof e)return new p("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=n[o],c=g(l);if("object"!==c)return new p("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+i+"`, expected an object.");for(var u in l)if(r(l,u)){var f=e(l,u,i,a,s+"."+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],s=0;s<e.length;s++)if(d(a,e[s]))return null;var l=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 "+l+".")})},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 "+x(o)+" at index "+n+"."),a}return v(function(n,o,i,a,s){for(var l=[],c=0;c<e.length;c++){var u=(0,e[c])(n,o,i,a,s,t);if(null==u)return null;u.data&&r(u.data,"expectedType")&&l.push(u.data.expectedType)}return new p("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return v(function(n,r,o,i,a){var s=n[r],l=g(s);if("object"!==l)return new p("Invalid "+i+" `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return h(o,i,a,c,m(u));var f=u(s,c,o,i,a+"."+c,t);if(f)return f}return null})},exact:function(e){return v(function(o,i,a,s,l){var c=o[i],u=g(c);if("object"!==u)return new p("Invalid "+s+" `"+l+"` 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,s,l,d,m(v));if(!v)return new p("Invalid "+s+" `"+l+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=v(c,d,a,s,l+"."+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,s,c,f,d,v){if(c=c||u,d=d||s,v!==t){if(l){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=c+":"+s;!n[h]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. 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[s]?o?null===a[s]?new p("The "+f+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+f+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,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 s=n[t];return g(s)!==e?new p("Invalid "+o+" `"+i+"` of type `"+m(s)+"` 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||s(e))return!0;var n=function(e){var n=e&&(c&&e[c]||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 x(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},m}function N(){if(S)return w;S=1;var e=k();function n(){}function t(){}return t.resetWarningCache=n,w=function(){function r(n,t,r,o,i,a){if(a!==e){var s=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 s.name="Invariant Violation",s}}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 P(){if(j)return a.exports;if(j=1,"production"!==process.env.NODE_ENV){var e=C();a.exports=I()(e.isElement,true)}else a.exports=N()();return a.exports}var z=o(P());function D(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 L(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function A(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,M(r.key),r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=V(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,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw i}}}}function _(e,n,t){return(n=M(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function B(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,s=[],l=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n);else for(;!(l=(r=i.call(t)).done)&&(s.push(r.value),s.length!==n);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,n)||V(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 M(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 V(e,n){if(e){if("string"==typeof e)return D(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)?D(e,n):void 0}}var W={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6,INVOKE_ACTION:7},F=W=Object.freeze(W),H={UPDATE_SIZE:1},U=H=Object.freeze(H),q=function(){return A(function e(n){L(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","undefined"==typeof document?require("url").pathToFileURL(__filename).href:r&&"SCRIPT"===r.tagName.toUpperCase()&&r.src||new URL("index.js",document.baseURI).href),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(F.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(F.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(F.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(F.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var t=this;requestAnimationFrame(function(){var r,o=$(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;switch(i.type){case U.UPDATE_SIZE:t.containers[i.id].current.updateStyles(i.args.style);break;case U.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 F.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case F.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case F.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(F.INVOKE_ACTION,{id:n,action:t,args:r})}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),Y=e.createContext(null);function X(t){var r=t.layout,o=t.children,i=e.useMemo(function(){return new q(r)},[r]);return e.useEffect(function(){return function(){i.destroy()}},[i]),n.jsx(Y.Provider,{value:i,children:o})}function Z(){var n=e.useContext(Y);if(!n)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return n}function K(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))}}X.propTypes={layout:z.object.isRequired,children:z.node.isRequired};K(".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 J=function(t){var r=t.orientation,o=t.parent,i=t.sibling1,a=t.sibling2,s=Z(),l=e.useRef(null),c=e.useRef(null),u=e.useRef(null),f=function(e){var n,t,u;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",p),"horizontal"===r?(n="clientY",t="height",u="handleBarHorizontalHover"):"vertical"===r&&(n="clientX",t="width",u="handleBarVerticalHover");for(var f,v,y=s.containerRefs[o],h=s.containerRefs[i],b=s.containerRefs[a],g=s.ldf.containers[o],m=0;m<g.children.length;m++)g.children[m].containerId===i?f=g.children[m].size:g.children[m].containerId===a&&(v=g.children[m].size);l.current={downValueY:e[n],hoverClass:u,downKey:n,propKey:t,parentSize:y.getBoundingClientRect()[t],parentRef:y,sibling1Ref:h,sibling2Ref:b,sibling1LayoutConfig:f,sibling2LayoutConfig:v,sibling1Size:h.getBoundingClientRect()[t],sibling2Size:b.getBoundingClientRect()[t]},c.current.classList.add(u)};var d=function(e){if(l.current){e.preventDefault(),e.stopPropagation();var n=l.current,t=e[n.downKey]-n.downValueY,r=n.sibling1Size+t,c=n.sibling2Size-t;clearTimeout(u.current),u.current=setTimeout(function(){var t,r,l;s.moveHandleBar({handle:(t=e,r=n.parentRef,l=r.getBoundingClientRect(),{x:t.clientX-l.left,y:t.clientY-l.top}),parent:o,sibling1:i,sibling2:a})},4);var f=Object.keys(n.sibling1LayoutConfig);if(!(f.includes("min")&&r<=n.sibling1LayoutConfig.min.value||f.includes("max")&&r>=n.sibling1LayoutConfig.max.value)){var d=Object.keys(n.sibling2LayoutConfig);d.includes("min")&&c<=n.sibling2LayoutConfig.min.value||d.includes("max")&&c>=n.sibling2LayoutConfig.max.value||r<50||c<50||(s.containerRefs[i].style[n.propKey]=r+"px",s.containerRefs[a].style[n.propKey]=c+"px")}}},p=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),clearTimeout(u.current),c.current&&l.current&&c.current.classList.remove(l.current.hoverClass),l.current=null};return e.useEffect(function(){return function(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),u.current&&(clearTimeout(u.current),u.current=null)}},[]),n.jsx(e.Fragment,{children:"horizontal"===r?n.jsx("div",{onMouseDown:function(e){return f(e)},className:"handleBarHorizontalContainer",children:n.jsx("div",{ref:c,className:"handleBarHorizontal"})}):"vertical"===r?n.jsx("div",{onMouseDown:function(e){return f(e)},className:"handleBarVerticalContainer",children:n.jsx("div",{ref:c,className:"handleBarVertical"})}):null})};J.propTypes={orientation:z.string,sibling1:z.string,sibling2:z.string,parent:z.string};K(".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 G=e.createContext({});G.displayName="ComponentRegistryContext";K(".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 Q=["color","size","title","className"];function ee(){return ee=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},ee.apply(null,arguments)}var ne=e.forwardRef(function(n,t){var r=n.color,o=void 0===r?"currentColor":r,i=n.size,a=void 0===i?"1em":i,s=n.title,l=void 0===s?null:s,c=n.className,u=void 0===c?"":c,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,Q);return e.createElement("svg",ee({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),l?e.createElement("title",null,l):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"}))});ne.propTypes={color:z.string,size:z.oneOfType([z.string,z.number]),title:z.string,className:z.string};var te=function(e){var t,r,o=e.node,i=Z();return n.jsxs("div",{className:"titleContainer",children:[n.jsx("div",{className:"title",children:null==o||null===(t=o.menuBar)||void 0===t?void 0:t.title}),(null==o||null===(r=o.menuBar)||void 0===r?void 0:r.showClose)&&n.jsx("div",{onClick:function(){var e;i.invokeAction({id:null==o||null===(e=o.menuBar)||void 0===e?void 0:e.closeContainerId,action:"close",args:{}})},className:"close",children:n.jsx(ne,{})})]})};te.propTypes={node:z.object};K(".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 re=function(e){var t,r,o=e.node,i=e.onTabClick,a=Z();return n.jsxs("div",{className:"container-tabs-row",children:[n.jsx("div",{className:"container-tabs",children:null==o||null===(t=o.tabsBar)||void 0===t||null===(t=t.tabs)||void 0===t?void 0:t.map(function(e,t){return n.jsx("div",{style:{borderBottom:e.selected?"solid 1px white":"none"},onClick:function(n){return i(e)},className:"container-tab",children:e.name},e.name+String(t))})}),(null==o||null===(r=o.tabsBar)||void 0===r?void 0:r.showClose)&&n.jsx("div",{className:"container-close",children:n.jsx(ne,{onClick:function(){var e;a.invokeAction({id:null==o||null===(e=o.tabsBar)||void 0===e?void 0:e.closeContainerId,action:"close",args:{}})}})})]})};re.propTypes={node:z.array,onTabsClick:z.func};K("/** \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 oe=function(t){var r=t.node,o=e.useContext(G),i=B(e.useState(!1),2),a=i[0],s=i[1],l=B(e.useState(!1),2),c=l[0],u=l[1],f=B(e.useState(0),2),d=f[0],p=f[1],v=B(e.useState(0),2),y=v[0],h=v[1],b=B(e.useState(""),2),g=b[0],m=b[1],x=e.useMemo(function(){if(o&&g in o)return e.lazy(o[g])},[o,g]);e.useEffect(function(){var e=0,n=0;"menuBar"in r&&(s(!0),n+=35,e+=35),"tabsBar"in r?(u(!0),e+=35,w(r.tabsBar.tabs[0])):m(r.component),p(e),h(n)},[r]);var w=function(e){r.tabsBar.tabs.forEach(function(n){n===e?(n.selected=!0,m(n.component)):n.selected=!1})};return n.jsx("div",{className:"absoluteContainer",children:n.jsxs("div",{className:"contentContainer",children:[a&&n.jsx("div",{className:"menuContainer",children:n.jsx(te,{node:r})}),c&&n.jsx("div",{className:"tabsContainer",style:{top:"".concat(y,"px")},children:n.jsx(re,{node:r,onTabClick:w})}),n.jsx("div",{className:"lazycontainer",style:{top:"".concat(d,"px")},children:n.jsx(e.Suspense,{fallback:n.jsx("div",{children:"Loading..."}),children:x&&n.jsx(x,{})})})]})})};oe.propTypes={content:z.object};var ie=function(t){var r=t.node,o=Z(),i=e.useRef(null),a=e.useRef(null),s=B(e.useState(null),2),l=s[0],c=s[1],u=e.useCallback(function(e){for(var t=[],r=0;r<e.children.length;r++){var i=e.children[r];if("container"===i.type){var a=o.ldf.containers[e.children[r].containerId];a.parent=e,t.push(n.jsx(ie,{meta:e.children[r],id:a.id,node:a},r))}else"handleBar"===i.type&&("horizontal"===e.orientation?t.push(n.jsx(J,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)):"vertical"===e.orientation&&t.push(n.jsx(J,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)))}return t},[o]),f=e.useRef({});return f.current={updateStyles:function(e){var n="hiding-"+a.current;for(var t in e)if("display"===t&&"none"===e[t]){if(i.current.classList.contains(n))return;i.current.classList.add(n)}else if("display"===t&&"flex"===e[t]){if(!i.current.classList.contains(n))return;i.current.classList.remove(n)}else i.current.style[t]=e[t]}},e.useLayoutEffect(function(){if(r&&o&&i.current){a.current=r.parent.orientation;var e=r.children&&r.children.length>0;return e?"horizontal"===r.orientation?(i.current.style.display="flex",i.current.style.flexDirection="row",i.current.style.width="100%"):"vertical"===r.orientation?(i.current.style.display="flex",i.current.style.flexDirection="column",i.current.style.height="100%"):console.warn("Unknown orientation:",r.orientation):r.background?i.current.style.background=r.background:i.current.style.background="transparent",c(e?u(r):n.jsx(oe,{node:r})),o.registerContainer(r.id,f,i.current),function(){o.unregisterContainer(r.id)}}},[r,o,u]),n.jsx("div",{ref:i,className:"relative-container",children:l})};ie.propTypes={node:z.object};var ae=function(){return A(function e(){L(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=$(n);try{for(r.s();!(t=r.n()).done;){(0,t.value)(e)}}catch(e){r.e(e)}finally{r.f()}}}}])}(),se=e.createContext(null);function le(t){var r=t.children,o=e.useMemo(function(){return new ae},[]);return n.jsx(se.Provider,{value:o,children:r})}var ce=A(function e(n){var t=this,r=n.publish;L(this,e),_(this,"resetDragState",function(){t.dragState={activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}}),_(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}}),_(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}),_(this,"onDragEnd",function(e){var n,r,o,i,a,s,l,c;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===(s=e.over)||void 0===s?void 0:s.id)&&void 0!==a?a:null,overData:null!==(l=null===(c=e.over)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.current)&&void 0!==l?l:null},source:"drag-provider"}),t.resetDragState()}),_(this,"onDragCancel",function(e){t.resetDragState()}),_(this,"isDragging",function(){return t.dragState.isDragging}),_(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()}),ue=function(){var n=function(){var n=e.useContext(se);if(!n)throw new Error("useLayoutPublisher must be used within LayoutEventProvider");return n.publish.bind(n)}();return e.useMemo(function(){return new ce({publish:n})},[n])};K('.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 fe=function(){var r=Z(),o=ue(),i=e.useRef(null),a=e.useRef(null),s=e.useRef(!1),l=e.useRef({});l.current={};var c=B(e.useState(null),2),u=c[0],f=c[1],d=e.useCallback(function(e){for(var t=[],o=0;o<e.children.length;o++){var i=e.children[o];if("container"===i.type){var a=r.ldf.containers[e.children[o].containerId];a.parent=e,t.push(n.jsx(ie,{meta:e.children[o],id:a.id,node:a},o))}else"handleBar"===i.type&&("horizontal"===e.orientation?t.push(n.jsx(J,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},o)):"vertical"===e.orientation&&t.push(n.jsx(J,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},o)))}return t},[r]);e.useLayoutEffect(function(){if(r){var e=r.ldf.containers[r.ldf.layoutRoot],n=e.children&&e.children.length>0;r.registerContainer(e.id,l,i.current),n&&("horizontal"===e.orientation?i.current.style.flexDirection="row":"vertical"===e.orientation&&(i.current.style.flexDirection="column")),f(n?d(e):null);var t=new ResizeObserver(function(e){s.current||(s.current=!0);var n,t=$(e);try{var o=function(){var e=n.value.contentRect,t=e.width,o=e.height;clearTimeout(a.current),a.current=setTimeout(function(){s.current=!1,r.handleRootResize(t,o)},1)};for(t.s();!(n=t.n()).done;)o()}catch(e){t.e(e)}finally{t.f()}});return t.observe(i.current),function(){r.unregisterContainer(r.ldf.layoutRoot),t.disconnect()}}},[r]);var p=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:8}})),v=B(e.useState({left:0,top:0}),2),y=v[0],h=v[1];return e.useEffect(function(){if(o.isDragging()){var e=function(e){h({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[o.isDragging()]),n.jsxs(t.DndContext,{sensors:p,collisionDetection:t.closestCenter,onDragStart:o.onDragStart,onDragOver:o.onDragOver,onDragEnd:o.onDragEnd,onDragCancel:o.onDragCancel,children:[n.jsx("div",{className:"root-container",children:n.jsx("div",{ref:i,className:"relative-container",children:u})}),o.isDragging()&&n.jsx("div",{className:"drag-overlay",style:y,children:o.getDragPreview()})]})};K("");var de=function(e){var t=e.ldf,r=e.registry;return n.jsx(X,{layout:t,children:n.jsx(le,{children:n.jsx(G.Provider,{value:r,children:n.jsx(fe,{})})})})};de.propTypes={ldf:z.object,registry:z.object},exports.LayoutManager=de;
|
|
14
|
+
*/function O(){if(d)return f;d=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;return f=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,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),l=1;l<arguments.length;l++){for(var c in i=Object(arguments[l]))n.call(i,c)&&(s[c]=i[c]);if(e){a=e(i);for(var u=0;u<a.length;u++)t.call(i,a[u])&&(s[a[u]]=i[a[u]])}}return s},f}function k(){if(v)return p;v=1;return p="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function R(){return h?y:(h=1,y=Function.call.bind(Object.prototype.hasOwnProperty))}function T(){if(g)return b;g=1;var e=function(){};if("production"!==process.env.NODE_ENV){var n=k(),t={},r=R();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,s,l){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var u;try{if("function"!=typeof o[c]){var f=Error((s||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=o[c](i,c,s,a,null,n)}catch(e){u=e}if(!u||u instanceof Error||e((s||"React class")+": type specification of "+a+" `"+c+"` 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=l?l():"";e("Failed "+a+" type: "+u.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(t={})},b=o}function I(){if(x)return m;x=1;var e=C(),n=O(),t=k(),r=R(),o=T(),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){}}),m=function(s,l){var c="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 s=n[r];if(!Array.isArray(s))return new p("Invalid "+i+" `"+a+"` of type `"+g(s)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<s.length;l++){var c=e(s,l,o,i,a+"["+l+"]",t);if(c instanceof Error)return c}return null})},element:v(function(e,n,t,r,o){var i=e[n];return s(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 `"+(((s=n[t]).constructor&&s.constructor.name?s.constructor.name:u)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var s;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,s){if("function"!=typeof e)return new p("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=n[o],c=g(l);if("object"!==c)return new p("Invalid "+a+" `"+s+"` of type `"+c+"` supplied to `"+i+"`, expected an object.");for(var u in l)if(r(l,u)){var f=e(l,u,i,a,s+"."+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],s=0;s<e.length;s++)if(d(a,e[s]))return null;var l=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 "+l+".")})},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 "+x(o)+" at index "+n+"."),a}return v(function(n,o,i,a,s){for(var l=[],c=0;c<e.length;c++){var u=(0,e[c])(n,o,i,a,s,t);if(null==u)return null;u.data&&r(u.data,"expectedType")&&l.push(u.data.expectedType)}return new p("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return v(function(n,r,o,i,a){var s=n[r],l=g(s);if("object"!==l)return new p("Invalid "+i+" `"+a+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return h(o,i,a,c,m(u));var f=u(s,c,o,i,a+"."+c,t);if(f)return f}return null})},exact:function(e){return v(function(o,i,a,s,l){var c=o[i],u=g(c);if("object"!==u)return new p("Invalid "+s+" `"+l+"` 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,s,l,d,m(v));if(!v)return new p("Invalid "+s+" `"+l+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var y=v(c,d,a,s,l+"."+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,s,c,f,d,v){if(c=c||u,d=d||s,v!==t){if(l){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=c+":"+s;!n[h]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. 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[s]?o?null===a[s]?new p("The "+f+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+f+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(a,s,c,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 s=n[t];return g(s)!==e?new p("Invalid "+o+" `"+i+"` of type `"+m(s)+"` 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||s(e))return!0;var n=function(e){var n=e&&(c&&e[c]||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 x(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},m}function N(){if(S)return w;S=1;var e=k();function n(){}function t(){}return t.resetWarningCache=n,w=function(){function r(n,t,r,o,i,a){if(a!==e){var s=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 s.name="Invariant Violation",s}}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 P(){if(j)return a.exports;if(j=1,"production"!==process.env.NODE_ENV){var e=C();a.exports=I()(e.isElement,true)}else a.exports=N()();return a.exports}var L=o(P());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 D(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function A(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,M(r.key),r)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=V(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,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw i}}}}function _(e,n,t){return(n=M(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function B(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,s=[],l=!0,c=!1;try{if(i=(t=t.call(e)).next,0===n);else for(;!(l=(r=i.call(t)).done)&&(s.push(r.value),s.length!==n);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,n)||V(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 M(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 V(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 W={INITIALIZE:1,INITIALIZE_FLEXBOX:2,APPLY_SIZES:3,ERROR:4,TRANSFORMATIONS:5,MOVE_HANDLE_BAR:6,INVOKE_ACTION:7},F=W=Object.freeze(W),H={UPDATE_SIZE:1},U=H=Object.freeze(H),q=function(){return A(function e(n){D(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","undefined"==typeof document?require("url").pathToFileURL(__filename).href:r&&"SCRIPT"===r.tagName.toUpperCase()&&r.src||new URL("index.js",document.baseURI).href),{type:"module"}),this.worker.onmessage=this.handleWorkerMessage.bind(this),this.worker.onerror=function(e){return console.error("Worker error:",e)},this.sendToWorker(F.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(F.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(F.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(F.MOVE_HANDLE_BAR,{metadata:e}),this.handleRootResize()}},{key:"applyTransformations",value:function(e,n){var t=this;requestAnimationFrame(function(){var r,o=$(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;switch(i.type){case U.UPDATE_SIZE:t.containers[i.id].current.updateStyles(i.args.style);break;case U.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 F.INITIALIZE_FLEXBOX:n=e.data.data,this.applyTransformations(n,!0);break;case F.TRANSFORMATIONS:n=e.data.data,this.applyTransformations(n,!1);break;case F.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(F.INVOKE_ACTION,{id:n,action:t,args:r})}},{key:"destroy",value:function(){this.worker&&(this.worker.terminate(),this.worker=null)}}])}(),Y=e.createContext(null);function X(t){var r=t.layout,o=t.children,i=e.useMemo(function(){return new q(r)},[r]);return e.useEffect(function(){return function(){i.destroy()}},[i]),n.jsx(Y.Provider,{value:i,children:o})}function K(){var n=e.useContext(Y);if(!n)throw new Error("useLayoutController must be used within a LayoutControllerProvider");return n}function Z(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))}}X.propTypes={layout:L.object.isRequired,children:L.node.isRequired};Z(".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 J=function(t){var r=t.orientation,o=t.parent,i=t.sibling1,a=t.sibling2,s=K(),l=e.useRef(null),c=e.useRef(null),u=e.useRef(null),f=function(e){var n,t,u;e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",p),"horizontal"===r?(n="clientY",t="height",u="handleBarHorizontalHover"):"vertical"===r&&(n="clientX",t="width",u="handleBarVerticalHover");for(var f,v,y=s.containerRefs[o],h=s.containerRefs[i],b=s.containerRefs[a],g=s.ldf.containers[o],m=0;m<g.children.length;m++)g.children[m].containerId===i?f=g.children[m].size:g.children[m].containerId===a&&(v=g.children[m].size);l.current={downValueY:e[n],hoverClass:u,downKey:n,propKey:t,parentSize:y.getBoundingClientRect()[t],parentRef:y,sibling1Ref:h,sibling2Ref:b,sibling1LayoutConfig:f,sibling2LayoutConfig:v,sibling1Size:h.getBoundingClientRect()[t],sibling2Size:b.getBoundingClientRect()[t]},c.current.classList.add(u)};var d=function(e){if(l.current){e.preventDefault(),e.stopPropagation();var n=l.current,t=e[n.downKey]-n.downValueY,r=n.sibling1Size+t,c=n.sibling2Size-t;clearTimeout(u.current),u.current=setTimeout(function(){var t,r,l;s.moveHandleBar({handle:(t=e,r=n.parentRef,l=r.getBoundingClientRect(),{x:t.clientX-l.left,y:t.clientY-l.top}),parent:o,sibling1:i,sibling2:a})},4);var f=Object.keys(n.sibling1LayoutConfig);if(!(f.includes("min")&&r<=n.sibling1LayoutConfig.min.value||f.includes("max")&&r>=n.sibling1LayoutConfig.max.value)){var d=Object.keys(n.sibling2LayoutConfig);if(!(d.includes("min")&&c<=n.sibling2LayoutConfig.min.value||d.includes("max")&&c>=n.sibling2LayoutConfig.max.value||r<50||c<50)){var p=n.sibling1LayoutConfig.initial.type,v=n.sibling2LayoutConfig.initial.type;if("fill"===p&&"fill"===v)return s.containerRefs[i].style[n.propKey]=r+"px",void(s.containerRefs[a].style[n.propKey]=c+"px");"fill"!==p&&(s.containerRefs[i].style[n.propKey]=r+"px"),"fill"!==v&&(s.containerRefs[a].style[n.propKey]=c+"px")}}}},p=function(e){e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),clearTimeout(u.current),c.current&&l.current&&c.current.classList.remove(l.current.hoverClass),l.current=null};return e.useEffect(function(){return function(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",p),u.current&&(clearTimeout(u.current),u.current=null)}},[]),n.jsx(e.Fragment,{children:"horizontal"===r?n.jsx("div",{onMouseDown:function(e){return f(e)},className:"handleBarHorizontalContainer",children:n.jsx("div",{ref:c,className:"handleBarHorizontal"})}):"vertical"===r?n.jsx("div",{onMouseDown:function(e){return f(e)},className:"handleBarVerticalContainer",children:n.jsx("div",{ref:c,className:"handleBarVertical"})}):null})};J.propTypes={orientation:L.string,sibling1:L.string,sibling2:L.string,parent:L.string};Z(".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 G=e.createContext({});G.displayName="ComponentRegistryContext";Z(".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 Q=["color","size","title","className"];function ee(){return ee=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},ee.apply(null,arguments)}var ne=e.forwardRef(function(n,t){var r=n.color,o=void 0===r?"currentColor":r,i=n.size,a=void 0===i?"1em":i,s=n.title,l=void 0===s?null:s,c=n.className,u=void 0===c?"":c,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,Q);return e.createElement("svg",ee({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),l?e.createElement("title",null,l):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"}))});ne.propTypes={color:L.string,size:L.oneOfType([L.string,L.number]),title:L.string,className:L.string};var te=function(e){var t,r,o=e.node,i=K();return n.jsxs("div",{className:"titleContainer",children:[n.jsx("div",{className:"title",children:null==o||null===(t=o.menuBar)||void 0===t?void 0:t.title}),(null==o||null===(r=o.menuBar)||void 0===r?void 0:r.showClose)&&n.jsx("div",{onClick:function(){var e;i.invokeAction({id:null==o||null===(e=o.menuBar)||void 0===e?void 0:e.closeContainerId,action:"close",args:{}})},className:"close",children:n.jsx(ne,{})})]})};te.propTypes={node:L.object};Z(".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 re=function(e){var t,r,o=e.node,i=e.onTabClick,a=K();return n.jsxs("div",{className:"container-tabs-row",children:[n.jsx("div",{className:"container-tabs",children:null==o||null===(t=o.tabsBar)||void 0===t||null===(t=t.tabs)||void 0===t?void 0:t.map(function(e,t){return n.jsx("div",{style:{borderBottom:e.selected?"solid 1px white":"none"},onClick:function(n){return i(e)},className:"container-tab",children:e.name},e.name+String(t))})}),(null==o||null===(r=o.tabsBar)||void 0===r?void 0:r.showClose)&&n.jsx("div",{className:"container-close",children:n.jsx(ne,{onClick:function(){var e;a.invokeAction({id:null==o||null===(e=o.tabsBar)||void 0===e?void 0:e.closeContainerId,action:"close",args:{}})}})})]})};re.propTypes={node:L.array,onTabsClick:L.func};Z("/** \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 oe=function(t){var r=t.node,o=e.useContext(G),i=B(e.useState(!1),2),a=i[0],s=i[1],l=B(e.useState(!1),2),c=l[0],u=l[1],f=B(e.useState(0),2),d=f[0],p=f[1],v=B(e.useState(0),2),y=v[0],h=v[1],b=B(e.useState(""),2),g=b[0],m=b[1],x=e.useMemo(function(){if(o&&g in o)return e.lazy(o[g])},[o,g]);e.useEffect(function(){var e=0,n=0;"menuBar"in r&&(s(!0),n+=35,e+=35),"tabsBar"in r?(u(!0),e+=35,w(r.tabsBar.tabs[0])):m(r.component),p(e),h(n)},[r]);var w=function(e){r.tabsBar.tabs.forEach(function(n){n===e?(n.selected=!0,m(n.component)):n.selected=!1})};return n.jsx("div",{className:"absoluteContainer",children:n.jsxs("div",{className:"contentContainer",children:[a&&n.jsx("div",{className:"menuContainer",children:n.jsx(te,{node:r})}),c&&n.jsx("div",{className:"tabsContainer",style:{top:"".concat(y,"px")},children:n.jsx(re,{node:r,onTabClick:w})}),n.jsx("div",{className:"lazycontainer",style:{top:"".concat(d,"px")},children:n.jsx(e.Suspense,{fallback:n.jsx("div",{children:"Loading..."}),children:x&&n.jsx(x,{})})})]})})};oe.propTypes={content:L.object};var ie=function(t){var r=t.node,o=K(),i=e.useRef(null),a=e.useRef(null),s=B(e.useState(null),2),l=s[0],c=s[1],u=e.useCallback(function(e){for(var t=[],r=0;r<e.children.length;r++){var i=e.children[r];if("container"===i.type){var a=o.ldf.containers[e.children[r].containerId];a.parent=e,t.push(n.jsx(ie,{meta:e.children[r],id:a.id,node:a},r))}else"handleBar"===i.type&&("horizontal"===e.orientation?t.push(n.jsx(J,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)):"vertical"===e.orientation&&t.push(n.jsx(J,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)))}return t},[o]),f=e.useRef({});return f.current={updateStyles:function(e){var n="hiding-"+a.current;for(var t in e)if("display"===t&&"none"===e[t]){if(i.current.classList.contains(n))return;i.current.classList.add(n)}else if("display"===t&&"flex"===e[t]){if(!i.current.classList.contains(n))return;i.current.classList.remove(n)}else i.current.style[t]=e[t]}},e.useLayoutEffect(function(){if(r&&o&&i.current){a.current=r.parent.orientation;var e=r.children&&r.children.length>0;return e?"horizontal"===r.orientation?(i.current.style.display="flex",i.current.style.flexDirection="row",i.current.style.width="100%"):"vertical"===r.orientation?(i.current.style.display="flex",i.current.style.flexDirection="column",i.current.style.height="100%"):console.warn("Unknown orientation:",r.orientation):r.background?i.current.style.background=r.background:i.current.style.background="transparent",c(e?u(r):n.jsx(oe,{node:r})),o.registerContainer(r.id,f,i.current),function(){o.unregisterContainer(r.id)}}},[r,o,u]),n.jsx("div",{ref:i,className:"relative-container",children:l})};ie.propTypes={node:L.object};var ae=function(){return A(function e(){D(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=$(n);try{for(r.s();!(t=r.n()).done;){(0,t.value)(e)}}catch(e){r.e(e)}finally{r.f()}}}}])}(),se=e.createContext(null);function le(t){var r=t.children,o=e.useMemo(function(){return new ae},[]);return n.jsx(se.Provider,{value:o,children:r})}function ce(){var n=e.useContext(se);if(!n)throw new Error("useLayoutPublisher must be used within LayoutEventProvider");return n.publish.bind(n)}var ue=A(function e(n){var t=this,r=n.publish;D(this,e),_(this,"resetDragState",function(){t.dragState={activeId:null,activeData:null,overId:null,overData:null,isDragging:!1}}),_(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}}),_(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}),_(this,"onDragEnd",function(e){var n,r,o,i,a,s,l,c;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===(s=e.over)||void 0===s?void 0:s.id)&&void 0!==a?a:null,overData:null!==(l=null===(c=e.over)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.current)&&void 0!==l?l:null},source:"drag-provider"}),t.resetDragState()}),_(this,"onDragCancel",function(e){t.resetDragState()}),_(this,"isDragging",function(){return t.dragState.isDragging}),_(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()});Z('.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 fe=function(){var r,o=K(),i=(r=ce(),e.useMemo(function(){return new ue({publish:r})},[r])),a=e.useRef(null),s=e.useRef(null),l=e.useRef(!1),c=e.useRef({});c.current={};var u=B(e.useState(null),2),f=u[0],d=u[1],p=e.useCallback(function(e){for(var t=[],r=0;r<e.children.length;r++){var i=e.children[r];if("container"===i.type){var a=o.ldf.containers[e.children[r].containerId];a.parent=e,t.push(n.jsx(ie,{meta:e.children[r],id:a.id,node:a},r))}else"handleBar"===i.type&&("horizontal"===e.orientation?t.push(n.jsx(J,{orientation:"vertical",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)):"vertical"===e.orientation&&t.push(n.jsx(J,{orientation:"horizontal",parent:e.id,sibling1:i.sibling1,sibling2:i.sibling2},r)))}return t},[o]);e.useLayoutEffect(function(){if(o){var e=o.ldf.containers[o.ldf.layoutRoot],n=e.children&&e.children.length>0;o.registerContainer(e.id,c,a.current),n&&("horizontal"===e.orientation?a.current.style.flexDirection="row":"vertical"===e.orientation&&(a.current.style.flexDirection="column")),d(n?p(e):null);var t=new ResizeObserver(function(e){l.current||(l.current=!0);var n,t=$(e);try{var r=function(){var e=n.value.contentRect,t=e.width,r=e.height;clearTimeout(s.current),s.current=setTimeout(function(){l.current=!1,o.handleRootResize(t,r)},1)};for(t.s();!(n=t.n()).done;)r()}catch(e){t.e(e)}finally{t.f()}});return t.observe(a.current),function(){o.unregisterContainer(o.ldf.layoutRoot),t.disconnect()}}},[o]);var v=t.useSensors(t.useSensor(t.PointerSensor,{activationConstraint:{distance:8}})),y=B(e.useState({left:0,top:0}),2),h=y[0],b=y[1];return e.useEffect(function(){if(i.isDragging()){var e=function(e){b({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[i.isDragging()]),n.jsxs(t.DndContext,{sensors:v,collisionDetection:t.closestCenter,onDragStart:i.onDragStart,onDragOver:i.onDragOver,onDragEnd:i.onDragEnd,onDragCancel:i.onDragCancel,children:[n.jsx("div",{className:"root-container",children:n.jsx("div",{ref:a,className:"relative-container",children:f})}),i.isDragging()&&n.jsx("div",{className:"drag-overlay",style:h,children:i.getDragPreview()})]})};Z("");var de=function(e){var t=e.ldf,r=e.registry;return n.jsx(X,{layout:t,children:n.jsx(le,{children:n.jsx(G.Provider,{value:r,children:n.jsx(fe,{})})})})};de.propTypes={ldf:L.object,registry:L.object},exports.LayoutManager=de,exports.useLayoutEventPublisher=ce,exports.useLayoutEventSubscription=function(n,t){var r=e.useContext(se),o=e.useRef(t);o.current=t,e.useEffect(function(){if(!r)throw new Error("useLayoutSubscription must be used within LayoutEventProvider");return r.subscribe(n,function(e){o.current(e)})},[r,n])};
|
|
15
15
|
//# sourceMappingURL=index.js.map
|