@iwsdk/vite-plugin-dev 0.4.1 → 0.5.0
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/README.md +11 -18
- package/client.d.ts +12 -0
- package/dist/editor/editor-runtime-source.d.ts +365 -0
- package/dist/editor/editor-shell-styles.d.ts +7 -0
- package/dist/editor/editor-workspace.d.ts +67 -0
- package/dist/editor/editor-workspace.js +802 -0
- package/dist/editor/editor-workspace.js.map +1 -0
- package/dist/editor/scene-editor-session.d.ts +227 -0
- package/dist/editor/scene-editor-session.js +1700 -0
- package/dist/editor/scene-editor-session.js.map +1 -0
- package/dist/headless-browser.d.ts +99 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +53554 -1516
- package/dist/index.js.map +1 -1
- package/dist/injection-bundle.js +651 -398
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/ws-client.d.ts +23 -1
- package/dist/mcp-relay.d.ts +19 -0
- package/dist/patch-BVc5fBs4.js +4567 -0
- package/dist/patch-BVc5fBs4.js.map +1 -0
- package/dist/project-config.d.ts +17 -0
- package/dist/review-workflow-store.d.ts +97 -0
- package/dist/runtime-proof-parity.d.ts +90 -0
- package/dist/signals-core-BRx7ThPn.js +4 -0
- package/dist/signals-core-BRx7ThPn.js.map +1 -0
- package/dist/types.d.ts +102 -6
- package/package.json +46 -20
- package/LICENSE +0 -21
- /package/dist/{hzdb-telemetry.d.ts → metavr-telemetry.d.ts} +0 -0
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
import { d as d$2 } from '../signals-core-BRx7ThPn.js';
|
|
2
|
+
|
|
3
|
+
var n,l$1,u$2,i$1,r$1,o$1,e$1,f$2,c$1,a$1,s$1,h$1,p$1,v$1,d$1={},w$1=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function m$1(n,l){for(var u in l)n[u]=l[u];return n}function b(n){n&&n.parentNode&&n.parentNode.removeChild(n);}function k$1(l,u,t){var i,r,o,e={};for(o in u)"key"==o?i=u[o]:"ref"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps) void 0===e[o]&&(e[o]=l.defaultProps[o]);return x(l,e,i,r,null)}function x(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u$2:o,__i:-1,__u:0};return null==o&&null!=l$1.vnode&&l$1.vnode(e),e}function S(n){return n.children}function C$1(n,l){this.props=n,this.context=l;}function $(n,l){if(null==l)return n.__?$(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?$(n):null}function I(n){if(n.__P&&n.__d){var u=n.__v,t=u.__e,i=[],r=[],o=m$1({},u);o.__v=u.__v+1,l$1.vnode&&l$1.vnode(o),q(n.__P,o,u,n.__n,n.__P.namespaceURI,32&u.__u?[t]:null,i,null==t?$(u):t,!!(32&u.__u),r),o.__v=u.__v,o.__.__k[o.__i]=o,D$1(i,o,r),u.__e=u.__=null,o.__e!=t&&P(o);}}function P(n){if(null!=(n=n.__)&&null!=n.__c)return n.__e=n.__c.base=null,n.__k.some(function(l){if(null!=l&&null!=l.__e)return n.__e=n.__c.base=l.__e}),P(n)}function A(n){(!n.__d&&(n.__d=true)&&i$1.push(n)&&!H.__r++||r$1!=l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$1)(H);}function H(){try{for(var n,l=1;i$1.length;)i$1.length>l&&i$1.sort(e$1),n=i$1.shift(),l=i$1.length,I(n);}finally{i$1.length=H.__r=0;}}function L(n,l,u,t,i,r,o,e,f,c,a){var s,h,p,v,y,_,g,m=t&&t.__k||w$1,b=l.length;for(f=T$1(u,l,m,f,b),s=0;s<b;s++)null!=(p=u.__k[s])&&(h=-1!=p.__i&&m[p.__i]||d$1,p.__i=s,_=q(n,p,h,i,r,o,e,f,c,a),v=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&J(h.ref,null,p),a.push(p.ref,p.__c||v,p)),null==y&&null!=v&&(y=v),(g=!!(4&p.__u))||h.__k===p.__k?(f=j$1(p,f,n,g),g&&h.__e&&(h.__e=null)):"function"==typeof p.type&&void 0!==_?f=_:v&&(f=v.nextSibling),p.__u&=-7);return u.__e=y,f}function T$1(n,l,u,t,i){var r,o,e,f,c,a=u.length,s=a,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(o=l[r])&&"boolean"!=typeof o&&"function"!=typeof o?("string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?o=n.__k[r]=x(null,o,null,null,null):g(o)?o=n.__k[r]=x(S,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?o=n.__k[r]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=O(o,u,f,s))&&(s--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>a?h--:i<a&&h++),"function"!=typeof o.type&&(o.__u|=4)):c!=f&&(c==f-1?h--:c==f+1?h++:(c>f?h--:h++,o.__u|=4))):n.__k[r]=null;if(s)for(r=0;r<a;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=$(e)),K(e,e));return t}function j$1(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=j$1(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=$(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function O(n,l,u,t){var i,r,o,e=n.key,f=n.type,c=l[u],a=null!=c&&0==(2&c.__u);if(null===c&&null==e||a&&e==c.key&&f==c.type)return u;if(t>(a?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[o=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return -1}function z$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||_.test(l)?u:u+"px";}function N(n,l,u,t,i){var r,o;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||z$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||z$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(s$1,"$1")),o=l.toLowerCase(),l=o in n||"onFocusOut"==l||"onFocusIn"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u[a$1]=t[a$1]:(u[a$1]=h$1,n.addEventListener(l,r?v$1:p$1,r)):n.removeEventListener(l,r?v$1:p$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function V(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u[c$1])u[c$1]=h$1++;else if(u[c$1]<t[a$1])return;return t(l$1.event?l$1.event(u):u)}}}function q(n,u,t,i,r,o,e,f,c,a){var s,h,p,v,y,d,_,k,x,M,$,I,P,A,H,T,j=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),o=[f=u.__e=t.__e]),(s=l$1.__b)&&s(u);n:if("function"==typeof j){h=e.length;try{if(x=u.props,M=j.prototype&&j.prototype.render,$=(s=j.contextType)&&i[s.__c],I=s?$?$.props.value:s.__:i,t.__c?k=(p=u.__c=t.__c).__=p.__E:(M?u.__c=p=new j(x,I):(u.__c=p=new C$1(x,I),p.constructor=j,p.render=Q),$&&$.sub(p),p.state||(p.state={}),p.__n=i,v=p.__d=!0,p.__h=[],p._sb=[]),M&&null==p.__s&&(p.__s=p.state),M&&null!=j.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=m$1({},p.__s)),m$1(p.__s,j.getDerivedStateFromProps(x,p.__s))),y=p.props,d=p.state,p.__v=u,v)M&&null==j.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),M&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else {if(M&&null==j.getDerivedStateFromProps&&x!==y&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(x,I),u.__v==t.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(x,p.__s,I)){u.__v!=t.__v&&(p.props=x,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),w$1.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&e.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(x,p.__s,I),M&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(y,d,_);});}if(p.context=I,p.props=x,p.__P=n,p.__e=!1,P=l$1.__r,A=0,M)p.state=p.__s,p.__d=!1,P&&P(u),s=p.render(p.props,p.state,p.context),w$1.push.apply(p.__h,p._sb),p._sb=[];else do{p.__d=!1,P&&P(u),s=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=m$1(m$1({},i),p.getChildContext())),M&&!v&&null!=p.getSnapshotBeforeUpdate&&(_=p.getSnapshotBeforeUpdate(y,d)),H=null!=s&&s.type===S&&null==s.key?E(s.props.children):s,f=L(n,g(H)?H:[H],u,t,i,r,o,e,f,c,a),p.base=u.__e,u.__u&=-161,p.__h.length&&e.push(p),k&&(p.__E=p.__=null);}catch(n){if(e.length=h,u.__v=null,c||null!=o){if(n.then){for(u.__u|=c?160:128;f&&8==f.nodeType&&f.nextSibling;)f=f.nextSibling;null!=o&&(o[o.indexOf(f)]=null),u.__e=f;}else if(null!=o)for(T=o.length;T--;)b(o[T]);}else u.__e=t.__e;null==u.__k&&(u.__k=t.__k||[]),n.then||B$1(u),l$1.__e(n,u,t);}}else null==o&&u.__v==t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=G(t.__e,u,t,i,r,o,e,c,a);return (s=l$1.diffed)&&s(u),128&u.__u?void 0:f}function B$1(n){n&&(n.__c&&(n.__c.__e=true),n.__k&&n.__k.some(B$1));}function D$1(n,u,t){for(var i=0;i<t.length;i++)J(t[i],t[++i],t[++i]);l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function E(n){return "object"!=typeof n||null==n||n.__b>0?n:g(n)?n.map(E):void 0!==n.constructor?null:m$1({},n)}function G(u,t,i,r,o,e,f,c,a){var s,h,p,v,y,w,_,m=i.props||d$1,k=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=e)for(s=0;s<e.length;s++)if((y=e[s])&&"setAttribute"in y==!!x&&(x?y.localName==x:3==y.nodeType)){u=y,e[s]=null;break}if(null==u){if(null==x)return document.createTextNode(k);u=document.createElementNS(o,x,k.is&&k),c&&(l$1.__m&&l$1.__m(t,e),c=false),e=null;}if(null==x)m===k||c&&u.data==k||(u.data=k);else {if(e="textarea"==x&&null!=k.defaultValue?null:e&&n.call(u.childNodes),!c&&null!=e)for(m={},s=0;s<u.attributes.length;s++)m[(y=u.attributes[s]).name]=y.value;for(s in m)y=m[s],"dangerouslySetInnerHTML"==s?p=y:"children"==s||s in k||"value"==s&&"defaultValue"in k||"checked"==s&&"defaultChecked"in k||N(u,s,null,y,o);for(s in k)y=k[s],"children"==s?v=y:"dangerouslySetInnerHTML"==s?h=y:"value"==s?w=y:"checked"==s?_=y:c&&"function"!=typeof y||m[s]===y||N(u,s,y,m[s],o);if(h)c||p&&(h.__html==p.__html||h.__html==u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(p&&(u.innerHTML=""),L("template"==t.type?u.content:u,g(v)?v:[v],t,i,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,e,f,e?e[0]:i.__k&&$(i,0),c,a),null!=e)for(s=e.length;s--;)b(e[s]);c&&"textarea"!=x||(s="value","progress"==x&&null==w?u.removeAttribute("value"):null!=w&&(w!==u[s]||"progress"==x&&!w||"option"==x&&w!=m[s])&&N(u,s,w,m[s],o),s="checked",null!=_&&_!=u[s]&&N(u,s,_,m[s],o));}return u}function J(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u));}else n.current=u;}catch(n){l$1.__e(n,t);}}function K(n,u,t){var i,r;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!=n.__e||J(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=i.__n=null;}if(i=n.__k)for(r=0;r<i.length;r++)i[r]&&K(i[r],u,t||"function"!=typeof n.type);t||b(n.__e),n.__c=n.__=n.__e=void 0;}function Q(n,l,u){return this.constructor(n,u)}function R(u,t,i){var r,o,e,f;t==document&&(t=document.documentElement),l$1.__&&l$1.__(u,t),o=(r="function"=="undefined")?null:t.__k,e=[],f=[],q(t,u=(t).__k=k$1(S,null,[u]),o||d$1,d$1,t.namespaceURI,o?null:t.firstChild?n.call(t.childNodes):null,e,o?o.__e:t.firstChild,r,f),D$1(e,u,f),u.props.children=null;}n=w$1.slice,l$1={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l;}throw n}},u$2=0,C$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=m$1({},this.state),"function"==typeof n&&(n=n(m$1({},u),this.props)),n&&m$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),A(this));},C$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=true,n&&this.__h.push(n),A(this));},C$1.prototype.render=S,i$1=[],o$1="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e$1=function(n,l){return n.__v.__b-l.__v.__b},H.__r=0,f$2=Math.random().toString(8),c$1="__d"+f$2,a$1="__a"+f$2,s$1=/(PointerCapture)$|Capture$/i,h$1=0,p$1=V(false),v$1=V(true);
|
|
4
|
+
|
|
5
|
+
var f$1=0;function u$1(e,t,n,o,i,u){t||(t={});var a,c,p=t;if("ref"in p)for(c in p={},t)"ref"==c?a=t[c]:p[c]=t[c];var l={type:e,props:p,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f$1,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(a=e.defaultProps))for(c in a) void 0===p[c]&&(p[c]=a[c]);return l$1.vnode&&l$1.vnode(l),l}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license lucide v0.468.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const defaultAttributes = {
|
|
15
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
16
|
+
width: 24,
|
|
17
|
+
height: 24,
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
fill: "none",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
"stroke-width": 2,
|
|
22
|
+
"stroke-linecap": "round",
|
|
23
|
+
"stroke-linejoin": "round"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @license lucide v0.468.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const Box = [
|
|
35
|
+
"svg",
|
|
36
|
+
defaultAttributes,
|
|
37
|
+
[
|
|
38
|
+
[
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
["path", { d: "m3.3 7 8.7 5 8.7-5" }],
|
|
45
|
+
["path", { d: "M12 22V12" }]
|
|
46
|
+
]
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @license lucide v0.468.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const Boxes = [
|
|
58
|
+
"svg",
|
|
59
|
+
defaultAttributes,
|
|
60
|
+
[
|
|
61
|
+
[
|
|
62
|
+
"path",
|
|
63
|
+
{
|
|
64
|
+
d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
["path", { d: "m7 16.5-4.74-2.85" }],
|
|
68
|
+
["path", { d: "m7 16.5 5-3" }],
|
|
69
|
+
["path", { d: "M7 16.5v5.17" }],
|
|
70
|
+
[
|
|
71
|
+
"path",
|
|
72
|
+
{
|
|
73
|
+
d: "M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
["path", { d: "m17 16.5-5-3" }],
|
|
77
|
+
["path", { d: "m17 16.5 4.74-2.85" }],
|
|
78
|
+
["path", { d: "M17 16.5v5.17" }],
|
|
79
|
+
[
|
|
80
|
+
"path",
|
|
81
|
+
{
|
|
82
|
+
d: "M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
["path", { d: "M12 8 7.26 5.15" }],
|
|
86
|
+
["path", { d: "m12 8 4.74-2.85" }],
|
|
87
|
+
["path", { d: "M12 13.5V8" }]
|
|
88
|
+
]
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @license lucide v0.468.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
const Camera = [
|
|
100
|
+
"svg",
|
|
101
|
+
defaultAttributes,
|
|
102
|
+
[
|
|
103
|
+
[
|
|
104
|
+
"path",
|
|
105
|
+
{
|
|
106
|
+
d: "M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
["circle", { cx: "12", cy: "13", r: "3" }]
|
|
110
|
+
]
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @license lucide v0.468.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
const ChevronDown = ["svg", defaultAttributes, [["path", { d: "m6 9 6 6 6-6" }]]];
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @license lucide v0.468.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
const ChevronRight = ["svg", defaultAttributes, [["path", { d: "m9 18 6-6-6-6" }]]];
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @license lucide v0.468.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
const Crosshair = [
|
|
142
|
+
"svg",
|
|
143
|
+
defaultAttributes,
|
|
144
|
+
[
|
|
145
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
146
|
+
["line", { x1: "22", x2: "18", y1: "12", y2: "12" }],
|
|
147
|
+
["line", { x1: "6", x2: "2", y1: "12", y2: "12" }],
|
|
148
|
+
["line", { x1: "12", x2: "12", y1: "6", y2: "2" }],
|
|
149
|
+
["line", { x1: "12", x2: "12", y1: "22", y2: "18" }]
|
|
150
|
+
]
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @license lucide v0.468.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
const Earth = [
|
|
162
|
+
"svg",
|
|
163
|
+
defaultAttributes,
|
|
164
|
+
[
|
|
165
|
+
["path", { d: "M21.54 15H17a2 2 0 0 0-2 2v4.54" }],
|
|
166
|
+
[
|
|
167
|
+
"path",
|
|
168
|
+
{ d: "M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17" }
|
|
169
|
+
],
|
|
170
|
+
["path", { d: "M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05" }],
|
|
171
|
+
["circle", { cx: "12", cy: "12", r: "10" }]
|
|
172
|
+
]
|
|
173
|
+
];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @license lucide v0.468.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
const EyeOff = [
|
|
184
|
+
"svg",
|
|
185
|
+
defaultAttributes,
|
|
186
|
+
[
|
|
187
|
+
[
|
|
188
|
+
"path",
|
|
189
|
+
{
|
|
190
|
+
d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }],
|
|
194
|
+
[
|
|
195
|
+
"path",
|
|
196
|
+
{
|
|
197
|
+
d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
["path", { d: "m2 2 20 20" }]
|
|
201
|
+
]
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @license lucide v0.468.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
const Eye = [
|
|
213
|
+
"svg",
|
|
214
|
+
defaultAttributes,
|
|
215
|
+
[
|
|
216
|
+
[
|
|
217
|
+
"path",
|
|
218
|
+
{
|
|
219
|
+
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
["circle", { cx: "12", cy: "12", r: "3" }]
|
|
223
|
+
]
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @license lucide v0.468.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
const Focus = [
|
|
235
|
+
"svg",
|
|
236
|
+
defaultAttributes,
|
|
237
|
+
[
|
|
238
|
+
["circle", { cx: "12", cy: "12", r: "3" }],
|
|
239
|
+
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }],
|
|
240
|
+
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }],
|
|
241
|
+
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }],
|
|
242
|
+
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }]
|
|
243
|
+
]
|
|
244
|
+
];
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @license lucide v0.468.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
const Gamepad2 = [
|
|
255
|
+
"svg",
|
|
256
|
+
defaultAttributes,
|
|
257
|
+
[
|
|
258
|
+
["line", { x1: "6", x2: "10", y1: "11", y2: "11" }],
|
|
259
|
+
["line", { x1: "8", x2: "8", y1: "9", y2: "13" }],
|
|
260
|
+
["line", { x1: "15", x2: "15.01", y1: "12", y2: "12" }],
|
|
261
|
+
["line", { x1: "18", x2: "18.01", y1: "10", y2: "10" }],
|
|
262
|
+
[
|
|
263
|
+
"path",
|
|
264
|
+
{
|
|
265
|
+
d: "M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z"
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
]
|
|
269
|
+
];
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @license lucide v0.468.0 - ISC
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the ISC license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
const Lock = [
|
|
280
|
+
"svg",
|
|
281
|
+
defaultAttributes,
|
|
282
|
+
[
|
|
283
|
+
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }],
|
|
284
|
+
["path", { d: "M7 11V7a5 5 0 0 1 10 0v4" }]
|
|
285
|
+
]
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @license lucide v0.468.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
const Magnet = [
|
|
297
|
+
"svg",
|
|
298
|
+
defaultAttributes,
|
|
299
|
+
[
|
|
300
|
+
[
|
|
301
|
+
"path",
|
|
302
|
+
{
|
|
303
|
+
d: "m6 15-4-4 6.75-6.77a7.79 7.79 0 0 1 11 11L13 22l-4-4 6.39-6.36a2.14 2.14 0 0 0-3-3L6 15"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
["path", { d: "m5 8 4 4" }],
|
|
307
|
+
["path", { d: "m12 15 4 4" }]
|
|
308
|
+
]
|
|
309
|
+
];
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @license lucide v0.468.0 - ISC
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the ISC license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
const Move3d = [
|
|
320
|
+
"svg",
|
|
321
|
+
defaultAttributes,
|
|
322
|
+
[
|
|
323
|
+
["path", { d: "M5 3v16h16" }],
|
|
324
|
+
["path", { d: "m5 19 6-6" }],
|
|
325
|
+
["path", { d: "m2 6 3-3 3 3" }],
|
|
326
|
+
["path", { d: "m18 16 3 3-3 3" }]
|
|
327
|
+
]
|
|
328
|
+
];
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @license lucide v0.468.0 - ISC
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the ISC license.
|
|
334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
+
*/
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
const PanelTop = [
|
|
339
|
+
"svg",
|
|
340
|
+
defaultAttributes,
|
|
341
|
+
[
|
|
342
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }],
|
|
343
|
+
["path", { d: "M3 9h18" }]
|
|
344
|
+
]
|
|
345
|
+
];
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @license lucide v0.468.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
const PersonStanding = [
|
|
356
|
+
"svg",
|
|
357
|
+
defaultAttributes,
|
|
358
|
+
[
|
|
359
|
+
["circle", { cx: "12", cy: "5", r: "1" }],
|
|
360
|
+
["path", { d: "m9 20 3-6 3 6" }],
|
|
361
|
+
["path", { d: "m6 8 6 2 6-2" }],
|
|
362
|
+
["path", { d: "M12 10v4" }]
|
|
363
|
+
]
|
|
364
|
+
];
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @license lucide v0.468.0 - ISC
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the ISC license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
const Plus = [
|
|
375
|
+
"svg",
|
|
376
|
+
defaultAttributes,
|
|
377
|
+
[
|
|
378
|
+
["path", { d: "M5 12h14" }],
|
|
379
|
+
["path", { d: "M12 5v14" }]
|
|
380
|
+
]
|
|
381
|
+
];
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @license lucide v0.468.0 - ISC
|
|
385
|
+
*
|
|
386
|
+
* This source code is licensed under the ISC license.
|
|
387
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
388
|
+
*/
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
const Redo2 = [
|
|
392
|
+
"svg",
|
|
393
|
+
defaultAttributes,
|
|
394
|
+
[
|
|
395
|
+
["path", { d: "m15 14 5-5-5-5" }],
|
|
396
|
+
["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" }]
|
|
397
|
+
]
|
|
398
|
+
];
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* @license lucide v0.468.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
const RefreshCw = [
|
|
409
|
+
"svg",
|
|
410
|
+
defaultAttributes,
|
|
411
|
+
[
|
|
412
|
+
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }],
|
|
413
|
+
["path", { d: "M21 3v5h-5" }],
|
|
414
|
+
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }],
|
|
415
|
+
["path", { d: "M8 16H3v5" }]
|
|
416
|
+
]
|
|
417
|
+
];
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* @license lucide v0.468.0 - ISC
|
|
421
|
+
*
|
|
422
|
+
* This source code is licensed under the ISC license.
|
|
423
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
424
|
+
*/
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
const Rotate3d = [
|
|
428
|
+
"svg",
|
|
429
|
+
defaultAttributes,
|
|
430
|
+
[
|
|
431
|
+
[
|
|
432
|
+
"path",
|
|
433
|
+
{
|
|
434
|
+
d: "M16.466 7.5C15.643 4.237 13.952 2 12 2 9.239 2 7 6.477 7 12s2.239 10 5 10c.342 0 .677-.069 1-.2"
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
["path", { d: "m15.194 13.707 3.814 1.86-1.86 3.814" }],
|
|
438
|
+
[
|
|
439
|
+
"path",
|
|
440
|
+
{
|
|
441
|
+
d: "M19 15.57c-1.804.885-4.274 1.43-7 1.43-5.523 0-10-2.239-10-5s4.477-5 10-5c4.838 0 8.873 1.718 9.8 4"
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
]
|
|
445
|
+
];
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* @license lucide v0.468.0 - ISC
|
|
449
|
+
*
|
|
450
|
+
* This source code is licensed under the ISC license.
|
|
451
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
+
*/
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
const Scale3d = [
|
|
456
|
+
"svg",
|
|
457
|
+
defaultAttributes,
|
|
458
|
+
[
|
|
459
|
+
["path", { d: "M5 7v11a1 1 0 0 0 1 1h11" }],
|
|
460
|
+
["path", { d: "M5.293 18.707 11 13" }],
|
|
461
|
+
["circle", { cx: "19", cy: "19", r: "2" }],
|
|
462
|
+
["circle", { cx: "5", cy: "5", r: "2" }]
|
|
463
|
+
]
|
|
464
|
+
];
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @license lucide v0.468.0 - ISC
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the ISC license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
const Undo2 = [
|
|
475
|
+
"svg",
|
|
476
|
+
defaultAttributes,
|
|
477
|
+
[
|
|
478
|
+
["path", { d: "M9 14 4 9l5-5" }],
|
|
479
|
+
["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" }]
|
|
480
|
+
]
|
|
481
|
+
];
|
|
482
|
+
|
|
483
|
+
var t,r,u,i,o=0,f=[],c=l$1,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,p=c.__;function s(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,y(D,n)}function y(n,u,i){var o=s(t++,2);if(o.t=n,!o.__c&&(o.__=[D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return true;var u=false,i=o.__c.props!==n;if(o.__c.__H.__.some(function(n){if(n.__N){u=true;var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=true);}}),c){var f=c.call(this,n,t,r);return u?f||i:f}return !u||i};r.__f=true;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r.shouldComponentUpdate=f;}return o.__N||o.__}function h(n,u){var i=s(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i));}function T(n,r){var u=s(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[];}catch(r){t.__h=[],c.__e(r,n.__v);}}}c.__b=function(n){r=null,e&&e(n);},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t);},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r;},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0);})),u=r=null;},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return !n.__||B(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],c.__e(r,n.__v);}}),l&&l(n,t);},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n);}catch(n){t=n;}}),r.__H=void 0,t&&c.__e(t,r.__v));};var k="function"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function z(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function B(n){var t=r;n.__c=n.__(),r=t;}function C(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return "function"==typeof t?t(n):t}
|
|
484
|
+
|
|
485
|
+
const ENTITY_REFERENCE_MIME = 'application/x-iwsdk-entity-reference';
|
|
486
|
+
const DEFAULT_SNAPSHOT = {
|
|
487
|
+
assetCount: 0,
|
|
488
|
+
builtInSelection: null,
|
|
489
|
+
dirty: false,
|
|
490
|
+
dirtyStatus: 'Saved',
|
|
491
|
+
ghostedNodeIds: [],
|
|
492
|
+
hiddenNodeIds: [],
|
|
493
|
+
lockedNodeIds: [],
|
|
494
|
+
loading: true,
|
|
495
|
+
loadingProgress: 8,
|
|
496
|
+
loadingStatus: 'Starting editor…',
|
|
497
|
+
nodeCount: 0,
|
|
498
|
+
nodes: [],
|
|
499
|
+
rootSelected: false,
|
|
500
|
+
sceneAssets: [],
|
|
501
|
+
scenePath: null,
|
|
502
|
+
selectedNodeIds: [],
|
|
503
|
+
soloNodeId: null,
|
|
504
|
+
statusStrip: 'Scene loading...',
|
|
505
|
+
transformMode: 'translate',
|
|
506
|
+
transformSnapEnabled: false,
|
|
507
|
+
transformSpace: 'local',
|
|
508
|
+
view: 'runtime',
|
|
509
|
+
};
|
|
510
|
+
const ICONS = {
|
|
511
|
+
Box,
|
|
512
|
+
Boxes,
|
|
513
|
+
Camera,
|
|
514
|
+
ChevronDown,
|
|
515
|
+
ChevronRight,
|
|
516
|
+
Crosshair,
|
|
517
|
+
Eye,
|
|
518
|
+
EyeOff,
|
|
519
|
+
Focus,
|
|
520
|
+
Gamepad2,
|
|
521
|
+
Globe2: Earth,
|
|
522
|
+
Lock,
|
|
523
|
+
Magnet,
|
|
524
|
+
Move3D: Move3d,
|
|
525
|
+
PanelTop,
|
|
526
|
+
PersonStanding,
|
|
527
|
+
Plus,
|
|
528
|
+
Redo2,
|
|
529
|
+
RefreshCw,
|
|
530
|
+
Rotate3D: Rotate3d,
|
|
531
|
+
Scale3D: Scale3d,
|
|
532
|
+
Undo2,
|
|
533
|
+
};
|
|
534
|
+
function mountEditorWorkspace(root, controller, initial = {}) {
|
|
535
|
+
const state = d$2({ ...DEFAULT_SNAPSHOT, ...initial });
|
|
536
|
+
R(u$1(EditorWorkspace, { state: state, controller: controller }), root);
|
|
537
|
+
return {
|
|
538
|
+
state,
|
|
539
|
+
unmount() {
|
|
540
|
+
R(null, root);
|
|
541
|
+
},
|
|
542
|
+
update(patch) {
|
|
543
|
+
state.value = { ...state.value, ...patch };
|
|
544
|
+
},
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function EditorWorkspace({ controller, state, }) {
|
|
548
|
+
const snapshot = useSignalValue(state);
|
|
549
|
+
return (u$1("main", { class: "workspace-shell", "data-workspace-shell": true, children: [u$1(WorkspaceViewSwitcher, { snapshot: snapshot, controller: controller }), u$1("iframe", { id: "workspace-runtime-frame", class: "workspace-runtime-frame", "data-workspace-runtime-src": "/", title: "IWSDK runtime app" }), u$1("section", { class: "workspace-editor-pane", "data-workspace-editor-pane": true, children: [u$1("main", { class: "editor-shell", children: [u$1("div", { class: "editor-state-readouts", "aria-hidden": "true", children: [u$1("span", { id: "scene-status", children: [snapshot.nodeCount, " nodes, ", snapshot.assetCount, " assets"] }), u$1("span", { id: "dirty-status", "data-state": snapshot.dirty ? 'dirty' : 'saved', children: snapshot.dirtyStatus })] }), u$1(EditorViewport, { snapshot: snapshot, controller: controller }), u$1(EditorLeftPanel, { snapshot: snapshot, controller: controller }), u$1(EditorInspector, { snapshot: snapshot, controller: controller })] }), snapshot.loading ? (u$1(EditorLoadingState, { overlay: true, progress: snapshot.loadingProgress, status: snapshot.loadingStatus })) : null] })] }));
|
|
550
|
+
}
|
|
551
|
+
function EditorLoadingState({ overlay = false, progress, status, }) {
|
|
552
|
+
const normalizedProgress = Math.min(100, Math.max(0, progress));
|
|
553
|
+
return (u$1("main", { class: `editor-loading${overlay ? ' editor-loading-overlay' : ''}`, role: "status", "aria-live": "polite", children: u$1("div", { class: "editor-loading-content", children: [u$1("div", { class: "editor-loading-spinner", "aria-hidden": "true" }), u$1("h1", { children: "IWSDK Scene Editor" }), u$1("p", { children: status }), u$1("div", { class: "editor-loading-track", role: "progressbar", "aria-label": "Editor startup", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": normalizedProgress, children: u$1("span", { class: "editor-loading-progress", style: { width: `${normalizedProgress}%` } }) })] }) }));
|
|
554
|
+
}
|
|
555
|
+
function useSignalValue(state) {
|
|
556
|
+
const [value, setValue] = d(() => state.peek());
|
|
557
|
+
h(() => state.subscribe(setValue), [state]);
|
|
558
|
+
return value;
|
|
559
|
+
}
|
|
560
|
+
function WorkspaceViewSwitcher({ controller, snapshot, }) {
|
|
561
|
+
return (u$1("div", { class: "workspace-view-switcher", "aria-label": "Workspace view", children: [['runtime', 'editor'].map((view) => (u$1("button", { "data-active": snapshot.view === view || undefined, "data-workspace-view-button": view, onClick: () => controller.setView?.(view), children: view === 'runtime' ? 'Runtime' : 'Editor' }, view))), u$1("button", { type: "button", class: "workspace-reload-button", "data-workspace-reload-button": true, title: "Reload page", "aria-label": "Reload page", onClick: () => controller.reloadPage?.(), children: u$1(Icon, { name: "RefreshCw" }) })] }));
|
|
562
|
+
}
|
|
563
|
+
function EditorViewport({ controller, snapshot, }) {
|
|
564
|
+
return (u$1("section", { class: "editor-viewport", children: [u$1(EditorToolbar, { snapshot: snapshot, controller: controller }), u$1("div", { id: "scene-viewport", children: [u$1("div", { id: "orientation-gizmo", "aria-label": "Interactive orientation gizmo" }), u$1("div", { class: "editor-slot viewport-overlay-slot", "data-editor-slot": "viewport.overlay" })] }), u$1("section", { id: "editor-bottom-panel", class: "editor-bottom-panel", "aria-label": "Scene diagnostics", children: [u$1("div", { class: "bottom-panel-tabs", role: "tablist", children: [u$1("button", { "data-bottom-tab": "assets", "data-active": true, children: "Assets" }), u$1("button", { "data-bottom-tab": "console", children: "Console" }), u$1("button", { "data-bottom-tab": "validation", children: "Validation" })] }), u$1(AssetBrowser, { snapshot: snapshot, controller: controller }), u$1("div", { id: "bottom-panel-content", class: "bottom-panel-content" })] }), u$1("div", { id: "editor-status-strip", "aria-live": "polite", "data-state": snapshot.dirty ? 'dirty' : 'saved', children: snapshot.statusStrip })] }));
|
|
565
|
+
}
|
|
566
|
+
function EditorToolbar({ controller, snapshot, }) {
|
|
567
|
+
return (u$1("div", { class: "editor-toolbar", "aria-label": "Scene editor tools", children: [u$1("div", { class: "editor-slot toolbar-slot", "data-editor-slot": "toolbar.left" }), u$1("div", { id: "transform-toolbar", class: "toolbar-group", "aria-label": "Transform controls", children: [u$1(IconButton, { active: snapshot.transformMode === 'translate', icon: "Move3D", label: "Move", data: { 'data-transform-mode': 'translate' }, onClick: () => controller.setTransformMode?.('translate') }), u$1(IconButton, { active: snapshot.transformMode === 'rotate', icon: "Rotate3D", label: "Rotate", data: { 'data-transform-mode': 'rotate' }, onClick: () => controller.setTransformMode?.('rotate') }), u$1(IconButton, { active: snapshot.transformMode === 'scale', icon: "Scale3D", label: "Scale", data: { 'data-transform-mode': 'scale' }, onClick: () => controller.setTransformMode?.('scale') })] }), u$1("div", { class: "editor-slot toolbar-slot", "data-editor-slot": "toolbar.center" }), u$1("div", { class: "toolbar-group", "aria-label": "Transform settings", children: [u$1(IconButton, { active: snapshot.transformSpace === 'local', icon: "Box", label: "Local space", data: { 'data-transform-space': 'local' }, onClick: () => controller.setTransformSpace?.('local') }), u$1(IconButton, { active: snapshot.transformSpace === 'world', icon: "Globe2", label: "World space", data: { 'data-transform-space': 'world' }, onClick: () => controller.setTransformSpace?.('world') }), u$1(IconButton, { active: snapshot.transformSnapEnabled, icon: "Magnet", label: "Snap", data: { 'data-transform-snap': '' }, onClick: () => controller.toggleTransformSnap?.() })] }), u$1("div", { class: "toolbar-group", "aria-label": "Document history", children: [u$1(IconButton, { icon: "Undo2", label: "Undo", id: "undo", onClick: () => controller.undo?.() }), u$1(IconButton, { icon: "Redo2", label: "Redo", id: "redo", onClick: () => controller.redo?.() })] }), u$1("div", { class: "editor-slot toolbar-slot", "data-editor-slot": "toolbar.right" })] }));
|
|
568
|
+
}
|
|
569
|
+
function IconButton({ active = false, data = {}, disabled = false, icon, id, label, onClick, }) {
|
|
570
|
+
return (u$1("button", { ...data, id: id, class: "icon-button", "data-active": active || undefined, disabled: disabled, title: label, "aria-label": label, onClick: onClick, children: u$1(Icon, { name: icon }) }));
|
|
571
|
+
}
|
|
572
|
+
function EditorLeftPanel({ controller, snapshot, }) {
|
|
573
|
+
return (u$1("section", { class: "editor-panel editor-panel-left", "data-editor-panel": "composition", children: [u$1("div", { class: "editor-slot sidebar-slot", "data-editor-slot": "sidebar.top" }), u$1(SceneGraph, { snapshot: snapshot, controller: controller }), u$1("div", { class: "editor-slot sidebar-slot", "data-editor-slot": "sidebar.bottom" }), u$1("div", { id: "scene-graph-context-menu", class: "scene-graph-context-menu", hidden: true })] }));
|
|
574
|
+
}
|
|
575
|
+
function SceneGraph({ controller, snapshot, }) {
|
|
576
|
+
const [query, setQuery] = d('');
|
|
577
|
+
const filteredNodes = T(() => sortSceneNodesById(filterSceneNodes(snapshot.nodes, query.trim().toLowerCase())), [snapshot.nodes, query]);
|
|
578
|
+
const levelNodes = filteredNodes.filter((node) => node.parent == null);
|
|
579
|
+
const playerNodes = (target) => filteredNodes.filter((node) => node.parent?.type === 'player-space' && node.parent.target === target);
|
|
580
|
+
const renderNodes = (nodes, depth) => nodes.map((node) => (u$1(SceneNodeRow, { node: node, depth: depth, query: query, snapshot: snapshot, controller: controller }, node.id)));
|
|
581
|
+
return (u$1("div", { class: "panel-section scene-graph-section", children: [u$1("div", { class: "panel-section-header", children: u$1("h2", { children: "Scene Graph" }) }), u$1("div", { class: "panel-control-row", children: u$1("input", { id: "scene-graph-filter", type: "search", placeholder: "Filter nodes", "aria-label": "Filter scene graph nodes", value: query, onInput: (event) => setQuery(event.currentTarget.value) }) }), u$1(BuiltinSceneRow, { id: "player", label: "Player Space", icon: "PersonStanding", entityReference: { type: 'player-space', target: 'player' }, selected: snapshot.builtInSelection === 'player', onSelect: () => controller.selectBuiltin?.('player'), dropTarget: { type: 'player-space', target: 'player' }, controller: controller, children: [u$1(BuiltinSceneRow, { collapsible: true, id: "camera", label: "Camera", icon: "Camera", entityReference: { type: 'player-space', target: 'camera' }, selected: snapshot.builtInSelection === 'camera', onSelect: () => controller.selectBuiltin?.('camera'), dropTarget: { type: 'player-space', target: 'camera' }, controller: controller, children: renderNodes(playerNodes('camera'), 1) }), u$1(BuiltinSceneRow, { collapsible: true, id: "head", label: "Head", icon: "Focus", entityReference: { type: 'player-space', target: 'head' }, selected: snapshot.builtInSelection === 'head', onSelect: () => controller.selectBuiltin?.('head'), dropTarget: { type: 'player-space', target: 'head' }, controller: controller, children: renderNodes(playerNodes('head'), 1) }), u$1(BuiltinSceneRow, { collapsible: true, id: "left-target-ray", label: "Left Target Ray", icon: "Crosshair", entityReference: { type: 'player-space', target: 'left-target-ray' }, selected: snapshot.builtInSelection === 'left-target-ray', onSelect: () => controller.selectBuiltin?.('left-target-ray'), dropTarget: { type: 'player-space', target: 'left-target-ray' }, controller: controller, children: renderNodes(playerNodes('left-target-ray'), 1) }), u$1(BuiltinSceneRow, { collapsible: true, id: "left-grip", label: "Left Grip", icon: "Gamepad2", entityReference: { type: 'player-space', target: 'left-grip' }, selected: snapshot.builtInSelection === 'left-grip', onSelect: () => controller.selectBuiltin?.('left-grip'), dropTarget: { type: 'player-space', target: 'left-grip' }, controller: controller, children: renderNodes(playerNodes('left-grip'), 1) }), u$1(BuiltinSceneRow, { collapsible: true, id: "right-target-ray", label: "Right Target Ray", icon: "Crosshair", entityReference: { type: 'player-space', target: 'right-target-ray' }, selected: snapshot.builtInSelection === 'right-target-ray', onSelect: () => controller.selectBuiltin?.('right-target-ray'), dropTarget: { type: 'player-space', target: 'right-target-ray' }, controller: controller, children: renderNodes(playerNodes('right-target-ray'), 1) }), u$1(BuiltinSceneRow, { collapsible: true, id: "right-grip", label: "Right Grip", icon: "Gamepad2", entityReference: { type: 'player-space', target: 'right-grip' }, selected: snapshot.builtInSelection === 'right-grip', onSelect: () => controller.selectBuiltin?.('right-grip'), dropTarget: { type: 'player-space', target: 'right-grip' }, controller: controller, children: renderNodes(playerNodes('right-grip'), 1) }), renderNodes(playerNodes('player'), 0)] }), u$1(BuiltinSceneRow, { id: "level-root", label: "Level Root", icon: "Move3D", entityReference: { type: 'level-root' }, selected: snapshot.rootSelected, onSelect: () => controller.selectRoot?.(), dropTarget: null, controller: controller, children: u$1("div", { id: "outliner", role: "tree", children: levelNodes.length ? (renderNodes(levelNodes, 0)) : (u$1("div", { class: "empty-state", "data-empty-outliner": true, children: "No matching nodes" })) }) }), u$1("div", { class: "scene-graph-footer", children: u$1("button", { id: "add-entity", class: "component-add-button scene-add-entity-button", type: "button", onClick: () => controller.addEntity?.(), children: [u$1(Icon, { name: "Plus" }), u$1("span", { children: "Add Entity" })] }) })] }));
|
|
582
|
+
}
|
|
583
|
+
function BuiltinSceneRow({ children, collapsible = false, controller, depth = 0, dropTarget, entityReference, icon, id, label, onSelect, selected, }) {
|
|
584
|
+
const [expanded, setExpanded] = d(true);
|
|
585
|
+
const acceptsDrop = dropTarget !== undefined;
|
|
586
|
+
const hasChildren = Array.isArray(children)
|
|
587
|
+
? children.length > 0
|
|
588
|
+
: children != null && children !== false;
|
|
589
|
+
const hasDisclosure = collapsible && hasChildren;
|
|
590
|
+
const toggleExpanded = () => {
|
|
591
|
+
if (hasDisclosure) {
|
|
592
|
+
setExpanded((value) => !value);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
return (u$1(S, { children: [u$1("button", { id: dropTarget === null ? 'scene-root-drop-target' : undefined, class: "scene-root-drop-target node-row builtin-node-row", "data-active": selected || undefined, "data-builtin-node": id, "data-scene-root-drop": dropTarget === null || undefined, "data-scene-builtin-drop": dropTarget && dropTarget.type === 'player-space'
|
|
596
|
+
? dropTarget.target
|
|
597
|
+
: undefined, draggable: true, type: "button", "aria-expanded": hasDisclosure ? expanded : undefined, style: { '--depth': depth }, onClick: onSelect, onKeyDown: (event) => {
|
|
598
|
+
if (!hasDisclosure ||
|
|
599
|
+
!['ArrowLeft', 'ArrowRight'].includes(event.key)) {
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
const shouldExpand = event.key === 'ArrowRight';
|
|
603
|
+
if (shouldExpand === expanded) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
event.preventDefault();
|
|
607
|
+
event.stopPropagation();
|
|
608
|
+
setExpanded(shouldExpand);
|
|
609
|
+
}, onDragStart: (event) => {
|
|
610
|
+
const transfer = event.dataTransfer;
|
|
611
|
+
transfer?.setData(ENTITY_REFERENCE_MIME, JSON.stringify(entityReference));
|
|
612
|
+
if (transfer) {
|
|
613
|
+
transfer.effectAllowed = 'copy';
|
|
614
|
+
}
|
|
615
|
+
}, onDragOver: acceptsDrop
|
|
616
|
+
? (event) => {
|
|
617
|
+
const transfer = event.dataTransfer;
|
|
618
|
+
if (transfer?.types.includes('text/plain')) {
|
|
619
|
+
event.preventDefault();
|
|
620
|
+
transfer.dropEffect = 'move';
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
: undefined, onDrop: acceptsDrop
|
|
624
|
+
? (event) => {
|
|
625
|
+
event.preventDefault();
|
|
626
|
+
const nodeId = event.dataTransfer?.getData('text/plain');
|
|
627
|
+
if (nodeId) {
|
|
628
|
+
controller?.moveNode?.(nodeId, null, dropTarget ?? undefined);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
: undefined, children: [collapsible ? (u$1("span", { class: "node-row-caret", "data-outliner-disclosure": hasDisclosure || undefined, title: hasDisclosure
|
|
632
|
+
? `${expanded ? 'Collapse' : 'Expand'} ${label}`
|
|
633
|
+
: undefined, onClick: (event) => {
|
|
634
|
+
if (!hasDisclosure) {
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
event.preventDefault();
|
|
638
|
+
event.stopPropagation();
|
|
639
|
+
toggleExpanded();
|
|
640
|
+
}, children: hasDisclosure ? (u$1(Icon, { name: expanded ? 'ChevronDown' : 'ChevronRight' })) : null })) : null, u$1("span", { class: "node-row-icon", children: u$1(Icon, { name: icon }) }), u$1("span", { class: "node-row-main", children: u$1("span", { class: "node-row-id", children: label }) }), u$1("span", { class: "node-row-built-in", children: "Built-in" })] }), !collapsible || expanded ? children : null] }));
|
|
641
|
+
}
|
|
642
|
+
function SceneNodeRow({ controller, depth, node, query, snapshot, }) {
|
|
643
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
644
|
+
const expanded = children.length > 0 && (Boolean(query) || node.expanded !== false);
|
|
645
|
+
const selected = snapshot.selectedNodeIds.includes(node.id);
|
|
646
|
+
const hidden = snapshot.hiddenNodeIds.includes(node.id);
|
|
647
|
+
const locked = snapshot.lockedNodeIds.includes(node.id);
|
|
648
|
+
const ghosted = snapshot.ghostedNodeIds.includes(node.id);
|
|
649
|
+
const solo = snapshot.soloNodeId === node.id;
|
|
650
|
+
const kind = sceneNodeKind(node);
|
|
651
|
+
const icon = sceneNodeHasPanelUI(node)
|
|
652
|
+
? 'PanelTop'
|
|
653
|
+
: kind === 'group'
|
|
654
|
+
? 'Boxes'
|
|
655
|
+
: 'Box';
|
|
656
|
+
return (u$1(S, { children: [u$1("button", { class: "node-row", "data-node-id": node.id, "data-outliner-parent": children.length > 0 || undefined, "data-active": selected || undefined, "data-preview-hidden": hidden || undefined, "data-preview-locked": locked || undefined, draggable: true, "aria-expanded": children.length > 0 ? expanded : undefined, style: { '--depth': depth }, onClick: (event) => controller.selectNode?.(node.id, {
|
|
657
|
+
ctrlKey: event.ctrlKey,
|
|
658
|
+
metaKey: event.metaKey,
|
|
659
|
+
shiftKey: event.shiftKey,
|
|
660
|
+
}), onContextMenu: (event) => {
|
|
661
|
+
event.preventDefault();
|
|
662
|
+
controller.openNodeContextMenu?.(node.id, {
|
|
663
|
+
x: event.clientX,
|
|
664
|
+
y: event.clientY,
|
|
665
|
+
});
|
|
666
|
+
}, onKeyDown: (event) => {
|
|
667
|
+
if (!children.length ||
|
|
668
|
+
!['ArrowLeft', 'ArrowRight'].includes(event.key)) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
const shouldExpand = event.key === 'ArrowRight';
|
|
672
|
+
if (shouldExpand === expanded) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
event.preventDefault();
|
|
676
|
+
event.stopPropagation();
|
|
677
|
+
controller.toggleNodeExpanded?.(node.id);
|
|
678
|
+
}, onDragStart: (event) => {
|
|
679
|
+
const transfer = event.dataTransfer;
|
|
680
|
+
transfer?.setData('text/plain', node.id);
|
|
681
|
+
transfer?.setData(ENTITY_REFERENCE_MIME, JSON.stringify({ type: 'node', id: node.id }));
|
|
682
|
+
if (transfer) {
|
|
683
|
+
transfer.effectAllowed = 'copyMove';
|
|
684
|
+
}
|
|
685
|
+
}, onDragOver: (event) => {
|
|
686
|
+
const transfer = event.dataTransfer;
|
|
687
|
+
const dragged = transfer?.getData('text/plain');
|
|
688
|
+
if (dragged !== node.id) {
|
|
689
|
+
event.preventDefault();
|
|
690
|
+
if (transfer) {
|
|
691
|
+
transfer.dropEffect = 'move';
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}, onDrop: (event) => {
|
|
695
|
+
event.preventDefault();
|
|
696
|
+
event.stopPropagation();
|
|
697
|
+
const dragged = event.dataTransfer?.getData('text/plain');
|
|
698
|
+
if (dragged && dragged !== node.id) {
|
|
699
|
+
controller.moveNode?.(dragged, node.id);
|
|
700
|
+
}
|
|
701
|
+
}, children: [u$1("span", { class: "node-row-caret", "data-outliner-disclosure": children.length > 0 || undefined, title: children.length > 0
|
|
702
|
+
? `${expanded ? 'Collapse' : 'Expand'} ${node.id}`
|
|
703
|
+
: undefined, onClick: (event) => {
|
|
704
|
+
if (!children.length) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
event.preventDefault();
|
|
708
|
+
event.stopPropagation();
|
|
709
|
+
controller.toggleNodeExpanded?.(node.id);
|
|
710
|
+
}, children: children.length > 0 ? (u$1(Icon, { name: expanded ? 'ChevronDown' : 'ChevronRight' })) : null }), u$1("span", { class: "node-row-icon", "data-node-icon": icon, children: u$1(Icon, { name: icon }) }), u$1("span", { class: "node-row-main", children: [u$1("span", { class: "node-row-id", children: node.id }), u$1("span", { class: "node-row-subtitle", children: sceneNodeSubtitle(node) })] }), u$1("span", { class: "node-row-visibility", "data-preview-visibility-toggle": true, role: "button", title: hidden ? 'Show in editor' : 'Hide in editor', "aria-label": hidden ? 'Show in editor' : 'Hide in editor', onClick: (event) => {
|
|
711
|
+
event.preventDefault();
|
|
712
|
+
event.stopPropagation();
|
|
713
|
+
controller.toggleNodeVisibility?.(node.id);
|
|
714
|
+
}, children: u$1(Icon, { name: hidden ? 'EyeOff' : 'Eye' }) }), solo || ghosted || locked ? (u$1("span", { class: "node-row-preview-state", "aria-hidden": "true", children: [solo ? u$1(Icon, { name: "Focus" }) : null, ghosted ? u$1(Icon, { name: "Eye" }) : null, locked ? u$1(Icon, { name: "Lock" }) : null] })) : null, children.length > 0 ? (u$1("span", { class: "node-row-meta", children: children.length })) : null] }), expanded
|
|
715
|
+
? children.map((child) => (u$1(SceneNodeRow, { node: child, depth: depth + 1, query: query, snapshot: snapshot, controller: controller }, child.id)))
|
|
716
|
+
: null] }));
|
|
717
|
+
}
|
|
718
|
+
function filterSceneNodes(nodes, query) {
|
|
719
|
+
if (!query) {
|
|
720
|
+
return nodes;
|
|
721
|
+
}
|
|
722
|
+
return nodes.flatMap((node) => {
|
|
723
|
+
const children = filterSceneNodes(node.children || [], query);
|
|
724
|
+
const values = [
|
|
725
|
+
node.id,
|
|
726
|
+
node.name,
|
|
727
|
+
node.content?.asset,
|
|
728
|
+
node.content?.geometry?.type,
|
|
729
|
+
sceneNodeKind(node),
|
|
730
|
+
];
|
|
731
|
+
const matches = values.some((value) => typeof value === 'string' && value.toLowerCase().includes(query));
|
|
732
|
+
return matches || children.length ? [{ ...node, children }] : [];
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function sortSceneNodesById(nodes) {
|
|
736
|
+
return [...nodes]
|
|
737
|
+
.sort((left, right) => String(left.id).localeCompare(String(right.id), undefined, {
|
|
738
|
+
numeric: true,
|
|
739
|
+
sensitivity: 'base',
|
|
740
|
+
}))
|
|
741
|
+
.map((node) => ({
|
|
742
|
+
...node,
|
|
743
|
+
children: sortSceneNodesById(node.children || []),
|
|
744
|
+
}));
|
|
745
|
+
}
|
|
746
|
+
function sceneNodeKind(node) {
|
|
747
|
+
return node.content?.type || (node.children?.length ? 'group' : 'group');
|
|
748
|
+
}
|
|
749
|
+
function sceneNodeHasPanelUI(node) {
|
|
750
|
+
const components = node.components || {};
|
|
751
|
+
return Boolean(node.assetKind === 'uikitml' ||
|
|
752
|
+
components.PanelUI ||
|
|
753
|
+
components['com.iwsdk.components.PanelUI']);
|
|
754
|
+
}
|
|
755
|
+
function sceneNodeSubtitle(node) {
|
|
756
|
+
return (node.content?.asset ||
|
|
757
|
+
node.content?.geometry?.type ||
|
|
758
|
+
node.content?.type ||
|
|
759
|
+
'group');
|
|
760
|
+
}
|
|
761
|
+
function AssetBrowser({ controller, snapshot, }) {
|
|
762
|
+
const [query, setQuery] = d('');
|
|
763
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
764
|
+
const assets = snapshot.sceneAssets.filter((asset) => normalizedQuery.length === 0
|
|
765
|
+
? true
|
|
766
|
+
: `${asset.id} ${asset.name || ''} ${asset.kind || ''}`
|
|
767
|
+
.toLowerCase()
|
|
768
|
+
.includes(normalizedQuery));
|
|
769
|
+
return (u$1("div", { id: "assets-panel", class: "asset-library-section", "data-assets-panel": true, children: u$1("div", { class: "asset-library-project", children: [u$1("div", { class: "panel-control-row asset-browser-controls", children: u$1("input", { id: "asset-filter", type: "search", placeholder: "Search assets", "aria-label": "Search assets", value: query, onInput: (event) => {
|
|
770
|
+
const value = event.currentTarget.value;
|
|
771
|
+
setQuery(value);
|
|
772
|
+
} }) }), u$1("div", { id: "asset-catalog", "aria-live": "polite", children: assets.length ? (assets.map((asset) => (u$1(AssetRow, { name: asset.id, meta: assetCatalogMeta(asset), thumbnailUrl: asset.thumbnailUrl, actionLabel: `Add ${asset.id}`, actionIcon: "Plus", actionData: { 'data-add-asset': asset.id }, rowData: {
|
|
773
|
+
'data-asset-id': asset.id,
|
|
774
|
+
'data-asset-kind': asset.kind || 'asset',
|
|
775
|
+
}, onAction: () => controller.addAsset?.(asset.id) }, asset.id)))) : (u$1("div", { class: "empty-state", children: "No assets found" })) })] }) }));
|
|
776
|
+
}
|
|
777
|
+
function AssetRow({ actionData, actionIcon, actionLabel, meta, name, onAction, rowData, thumbnailUrl, }) {
|
|
778
|
+
return (u$1("div", { class: "asset-catalog-row", ...rowData, children: [u$1("span", { class: "asset-catalog-thumb", "aria-hidden": "true", children: thumbnailUrl ? u$1("img", { src: thumbnailUrl, alt: "" }) : u$1(Icon, { name: "Box" }) }), u$1("span", { class: "asset-catalog-main", children: [u$1("span", { class: "asset-catalog-name", children: name }), u$1("span", { class: "asset-catalog-meta", children: meta })] }), u$1("button", { ...actionData, class: "asset-add-button icon-button", title: actionLabel, "aria-label": actionLabel, onClick: onAction, children: u$1(Icon, { name: actionIcon }) })] }));
|
|
779
|
+
}
|
|
780
|
+
function assetCatalogMeta(asset) {
|
|
781
|
+
const kind = asset.kind || 'asset';
|
|
782
|
+
const name = typeof asset.name === 'string' ? asset.name.trim() : '';
|
|
783
|
+
if (!name ||
|
|
784
|
+
name === asset.id ||
|
|
785
|
+
/^(root|scene|group|object3d|procedural|mesh)$/i.test(name)) {
|
|
786
|
+
return kind;
|
|
787
|
+
}
|
|
788
|
+
return `${kind} - ${name}`;
|
|
789
|
+
}
|
|
790
|
+
function EditorInspector({ controller: _controller, snapshot: _snapshot, }) {
|
|
791
|
+
return (u$1("section", { class: "editor-panel editor-panel-right", "data-editor-panel": "inspector", children: u$1("div", { class: "panel-section", children: [u$1("div", { class: "panel-section-header", children: u$1("h2", { children: "Inspector" }) }), u$1("div", { id: "inspector" })] }) }));
|
|
792
|
+
}
|
|
793
|
+
function Icon({ name }) {
|
|
794
|
+
return renderIconNode(ICONS[name], true);
|
|
795
|
+
}
|
|
796
|
+
function renderIconNode(node, root = false, key = 0) {
|
|
797
|
+
const [tag, attributes, children = []] = node;
|
|
798
|
+
return k$1(tag, { ...attributes, ...(root ? { class: 'lucide-icon' } : {}), key }, children.map((child, index) => renderIconNode(child, false, index)));
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
export { mountEditorWorkspace };
|
|
802
|
+
//# sourceMappingURL=editor-workspace.js.map
|