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/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,
|
|
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,R,j,N,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 t,createContext as r,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 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,
|
|
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,R=t,j=i,N=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=R,_.Profiler=j,_.StrictMode=N,_.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 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};
|
|
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(R)return I;R=1;return I="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function F(){return N?j:(N=1,j=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 K(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 Z(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 K(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)?K(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){Z(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);if(!(d.includes("min")&&i<=n.sibling2LayoutConfig.min.value||d.includes("max")&&i>=n.sibling2LayoutConfig.max.value||r<50||i<50)){var p=n.sibling1LayoutConfig.initial.type,v=n.sibling2LayoutConfig.initial.type;if("fill"===p&&"fill"===v)return c.containerRefs[a].style[n.propKey]=r+"px",void(c.containerRefs[l].style[n.propKey]=i+"px");"fill"!==p&&(c.containerRefs[a].style[n.propKey]=r+"px"),"fill"!==v&&(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(){Z(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})}function Ee(){var e=o(Se);if(!e)throw new Error("useLayoutPublisher must be used within LayoutEventProvider");return e.publish.bind(e)}function Ce(e,n){var r=o(Se),a=i(n);a.current=n,t(function(){if(!r)throw new Error("useLayoutSubscription must be used within LayoutEventProvider");return r.subscribe(e,function(e){a.current(e)})},[r,e])}var ke=J(function e(n){var t=this,r=n.publish;Z(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()});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 Te=function(){var e,r=ue(),o=(e=Ee(),n(function(){return new ke({publish:e})},[e])),a=i(null),c=i(null),s=i(!1),m=i({});m.current={};var w=ee(l(null),2),x=w[0],S=w[1],O=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(d(we,{meta:e.children[t],id:i.id,node:i},t))}else"handleBar"===o.type&&("horizontal"===e.orientation?n.push(d(de,{orientation:"vertical",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)):"vertical"===e.orientation&&n.push(d(de,{orientation:"horizontal",parent:e.id,sibling1:o.sibling1,sibling2:o.sibling2},t)))}return n},[r]);f(function(){if(r){var e=r.ldf.containers[r.ldf.layoutRoot],n=e.children&&e.children.length>0;r.registerContainer(e.id,m,a.current),n&&("horizontal"===e.orientation?a.current.style.flexDirection="row":"vertical"===e.orientation&&(a.current.style.flexDirection="column")),S(n?O(e):null);var t=new ResizeObserver(function(e){s.current||(s.current=!0);var n,t=G(e);try{var o=function(){var e=n.value.contentRect,t=e.width,o=e.height;clearTimeout(c.current),c.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(a.current),function(){r.unregisterContainer(r.ldf.layoutRoot),t.disconnect()}}},[r]);var E=v(y(h,{activationConstraint:{distance:8}})),C=ee(l({left:0,top:0}),2),k=C[0],T=C[1];return t(function(){if(o.isDragging()){var e=function(e){T({left:e.clientX,top:e.clientY})};return window.addEventListener("pointermove",e),function(){window.removeEventListener("pointermove",e)}}},[o.isDragging()]),p(b,{sensors:E,collisionDetection:g,onDragStart:o.onDragStart,onDragOver:o.onDragOver,onDragEnd:o.onDragEnd,onDragCancel:o.onDragCancel,children:[d("div",{className:"root-container",children:d("div",{ref:a,className:"relative-container",children:x})}),o.isDragging()&&d("div",{className:"drag-overlay",style:k,children:o.getDragPreview()})]})};fe("");var Ie=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(Te,{})})})})};Ie.propTypes={ldf:X.object,registry:X.object};export{Ie as LayoutManager,Ee as useLayoutEventPublisher,Ce as useLayoutEventSubscription};
|
|
15
15
|
//# sourceMappingURL=index.js.map
|