@plurid/plurid-react 0.0.0-3 → 0.0.0-32
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 +32 -20
- package/distribution/components/links/Link/components/Preview/index.d.ts +6 -3
- package/distribution/components/links/Link/components/Preview/styled.d.ts +1 -1
- package/distribution/components/links/Link/index.d.ts +14 -8
- package/distribution/components/links/RouterLink/index.d.ts +4 -0
- package/distribution/components/links/RouterLink/styled.d.ts +6 -2
- package/distribution/components/planes/ExternalPlane/index.d.ts +3 -2
- package/distribution/components/planes/IframePlane/index.d.ts +3 -2
- package/distribution/components/structural/Plane/components/PlaneBridge/index.d.ts +2 -1
- package/distribution/components/structural/Plane/components/PlaneBridge/styled.d.ts +2 -0
- package/distribution/components/structural/Plane/components/PlaneContent/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/components/ControlIsolate/index.d.ts +9 -0
- package/distribution/components/structural/Plane/components/PlaneControls/components/ControlRefresh/index.d.ts +9 -0
- package/distribution/components/structural/Plane/components/PlaneControls/components/SearchItem/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/components/SearchList/index.d.ts +1 -1
- package/distribution/components/structural/Plane/components/PlaneControls/index.d.ts +15 -5
- package/distribution/components/structural/Plane/components/PlaneControls/styled.d.ts +1 -0
- package/distribution/components/structural/Plane/components/PlaneDebugger/index.d.ts +1 -1
- package/distribution/components/structural/Plane/index.d.ts +10 -6
- package/distribution/components/structural/Plane/styled.d.ts +1 -0
- package/distribution/components/structural/Root/index.d.ts +2 -1
- package/distribution/components/structural/Roots/index.d.ts +5 -11
- package/distribution/components/structural/Roots/styled.d.ts +0 -7
- package/distribution/components/structural/Space/components/SpaceDebugger/index.d.ts +1 -1
- package/distribution/components/structural/Space/index.d.ts +2 -1
- package/distribution/components/utilities/ApplicationConfigurator/index.d.ts +4 -3
- package/distribution/components/utilities/ErrorBoundary/index.d.ts +3 -2
- package/distribution/components/utilities/NotFound/index.d.ts +1 -1
- package/distribution/components/utilities/Origin/index.d.ts +15 -0
- package/distribution/components/utilities/Origin/styled.d.ts +7 -0
- package/distribution/components/utilities/PlaneConfigurator/index.d.ts +1 -1
- package/distribution/components/utilities/Portal/index.d.ts +2 -0
- package/distribution/components/utilities/Toolbar/General/components/Drawer/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Global/index.d.ts +8 -7
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Shortcuts/index.d.ts +1 -1
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Space/index.d.ts +8 -7
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Technical/index.d.ts +4 -3
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Toolbar/index.d.ts +8 -7
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Transform/index.d.ts +6 -5
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/components/Viewcube/index.d.ts +7 -6
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/data.d.ts +2 -0
- package/distribution/components/utilities/Toolbar/General/components/MenuMore/index.d.ts +11 -8
- package/distribution/components/utilities/Toolbar/General/components/MenuUniverses/index.d.ts +4 -3
- package/distribution/components/utilities/Toolbar/General/components/ToolbarRotate/index.d.ts +7 -6
- package/distribution/components/utilities/Toolbar/General/components/ToolbarScale/index.d.ts +5 -4
- package/distribution/components/utilities/Toolbar/General/components/ToolbarTranslate/index.d.ts +9 -6
- package/distribution/components/utilities/Toolbar/General/components/TransformArrow/data.d.ts +7 -0
- package/distribution/components/utilities/Toolbar/General/components/TransformArrow/index.d.ts +4 -2
- package/distribution/components/utilities/Toolbar/General/components/TransformArrow/styled.d.ts +6 -1
- package/distribution/components/utilities/Toolbar/General/index.d.ts +6 -6
- package/distribution/components/utilities/Toolbar/General/styled.d.ts +1 -1
- package/distribution/components/utilities/UniverseExplorer/index.d.ts +2 -2
- package/distribution/components/utilities/Viewcube/components/ViewcubeFace/data.d.ts +391 -0
- package/distribution/components/utilities/Viewcube/components/ViewcubeFace/index.d.ts +6 -5
- package/distribution/components/utilities/Viewcube/components/ViewcubeModel/index.d.ts +1 -1
- package/distribution/components/utilities/Viewcube/components/ViewcubeTransformAreas/TransformArea/data.d.ts +5 -0
- package/distribution/components/utilities/Viewcube/components/ViewcubeTransformAreas/TransformArea/index.d.ts +11 -0
- package/distribution/components/utilities/Viewcube/components/ViewcubeTransformAreas/TransformArea/styled.d.ts +17 -0
- package/distribution/components/utilities/Viewcube/components/ViewcubeTransformAreas/index.d.ts +13 -0
- package/distribution/components/utilities/Viewcube/components/ViewcubeTransformAreas/styled.d.ts +13 -0
- package/distribution/components/utilities/Viewcube/index.d.ts +8 -7
- package/distribution/components/virtuals/List/index.d.ts +2 -2
- package/distribution/containers/Application/View/Container/index.d.ts +5 -0
- package/distribution/containers/Application/View/index.d.ts +39 -33
- package/distribution/containers/Application/View/styled.d.ts +6 -1
- package/distribution/containers/Application/index.d.ts +3 -1
- package/distribution/containers/RouterBrowser/FadeIn/index.d.ts +6 -0
- package/distribution/containers/RouterBrowser/FadeIn/styled.d.ts +3 -0
- package/distribution/containers/RouterBrowser/index.d.ts +5 -2
- package/distribution/containers/RouterBrowser/styled.d.ts +1 -0
- package/distribution/containers/RouterStatic/index.d.ts +5 -3
- package/distribution/data/constants/index.d.ts +1 -1
- package/distribution/data/interfaces/index.d.ts +8 -4
- package/distribution/data/interfaces/utility.d.ts +3 -0
- package/distribution/index.d.ts +74 -36
- package/distribution/index.es.js +6525 -0
- package/distribution/index.es.js.map +1 -0
- package/distribution/index.js +2377 -2566
- package/distribution/index.js.map +1 -1
- package/distribution/index.min.js +145 -113
- package/distribution/index.min.js.map +1 -0
- package/distribution/services/context/index.d.ts +2 -2
- package/distribution/services/engine/index.d.ts +22 -0
- package/distribution/services/hooks/index.d.ts +2 -2
- package/distribution/services/logic/animation/index.d.ts +16 -0
- package/distribution/services/logic/computing/index.d.ts +15 -8
- package/distribution/services/logic/router/index.d.ts +14 -25
- package/distribution/services/logic/server/index.d.ts +2 -3
- package/distribution/services/logic/shortcuts/index.d.ts +14 -9
- package/distribution/services/logic/shortcuts/logic.d.ts +6 -0
- package/distribution/services/logic/state/index.d.ts +3 -0
- package/distribution/services/logic/transform/index.d.ts +3 -0
- package/distribution/services/state/actions/index.d.ts +249 -6
- package/distribution/services/state/hooks/index.d.ts +4 -0
- package/distribution/services/state/modules/configuration/index.d.ts +66 -7
- package/distribution/services/state/modules/general/index.d.ts +10 -7
- package/distribution/services/state/modules/index.d.ts +7 -6
- package/distribution/services/state/modules/shortcuts/index.d.ts +16 -7
- package/distribution/services/state/modules/space/index.d.ts +151 -7
- package/distribution/services/state/modules/space/selectors.d.ts +23 -0
- package/distribution/services/state/modules/space/types.d.ts +41 -0
- package/distribution/services/state/modules/themes/index.d.ts +22 -7
- package/distribution/services/state/modules/ui/index.d.ts +16 -7
- package/distribution/services/state/selectors/index.d.ts +47 -174
- package/distribution/services/state/store/development/index.d.ts +3 -3
- package/distribution/services/state/store/index.d.ts +22 -18
- package/distribution/services/state/store/production/index.d.ts +3 -3
- package/distribution/services/state/store/reducer/index.d.ts +10 -0
- package/distribution/services/styled/index.d.ts +1 -1
- package/distribution/services/utilities/react/index.d.ts +3 -0
- package/package.json +54 -55
- package/distribution/containers/Application/View/ErrorView/index.d.ts +0 -6
- package/distribution/containers/Application/View/ErrorView/styled.d.ts +0 -1
- package/distribution/containers/Application/View/PlanesView/index.d.ts +0 -12
- package/distribution/containers/Application/View/index-old.d.ts +0 -1
- package/distribution/containers/Application/View/logic.d.ts +0 -3
- package/distribution/services/state/global/index.d.ts +0 -6
- package/distribution/services/state/modules/configuration/actions/index.d.ts +0 -28
- package/distribution/services/state/modules/configuration/initial/index.d.ts +0 -3
- package/distribution/services/state/modules/configuration/reducer/index.d.ts +0 -3
- package/distribution/services/state/modules/configuration/resolvers/index.d.ts +0 -27
- package/distribution/services/state/modules/configuration/selectors/index.d.ts +0 -11
- package/distribution/services/state/modules/configuration/types/index.d.ts +0 -136
- package/distribution/services/state/modules/general/actions/index.d.ts +0 -2
- package/distribution/services/state/modules/general/initial/index.d.ts +0 -3
- package/distribution/services/state/modules/general/reducer/index.d.ts +0 -3
- package/distribution/services/state/modules/general/resolvers/index.d.ts +0 -1
- package/distribution/services/state/modules/general/selectors/index.d.ts +0 -2
- package/distribution/services/state/modules/general/types/index.d.ts +0 -3
- package/distribution/services/state/modules/shortcuts/actions/index.d.ts +0 -3
- package/distribution/services/state/modules/shortcuts/initial/index.d.ts +0 -3
- package/distribution/services/state/modules/shortcuts/reducer/index.d.ts +0 -3
- package/distribution/services/state/modules/shortcuts/resolvers/index.d.ts +0 -3
- package/distribution/services/state/modules/shortcuts/selectors/index.d.ts +0 -11
- package/distribution/services/state/modules/shortcuts/types/index.d.ts +0 -13
- package/distribution/services/state/modules/space/actions/index.d.ts +0 -46
- package/distribution/services/state/modules/space/initial/index.d.ts +0 -3
- package/distribution/services/state/modules/space/reducer/index.d.ts +0 -3
- package/distribution/services/state/modules/space/resolvers/index.d.ts +0 -45
- package/distribution/services/state/modules/space/selectors/index.d.ts +0 -139
- package/distribution/services/state/modules/space/types/index.d.ts +0 -242
- package/distribution/services/state/modules/themes/actions/index.d.ts +0 -4
- package/distribution/services/state/modules/themes/initial/index.d.ts +0 -3
- package/distribution/services/state/modules/themes/reducer/index.d.ts +0 -3
- package/distribution/services/state/modules/themes/resolvers/index.d.ts +0 -3
- package/distribution/services/state/modules/themes/selectors/index.d.ts +0 -19
- package/distribution/services/state/modules/themes/types/index.d.ts +0 -17
- package/distribution/services/state/modules/ui/actions/index.d.ts +0 -2
- package/distribution/services/state/modules/ui/initial/index.d.ts +0 -3
- package/distribution/services/state/modules/ui/reducer/index.d.ts +0 -3
- package/distribution/services/state/modules/ui/resolvers/index.d.ts +0 -2
- package/distribution/services/state/modules/ui/selectors/index.d.ts +0 -11
- package/distribution/services/state/modules/ui/types/index.d.ts +0 -10
- package/distribution/services/state/store/reducers/index.d.ts +0 -9
- package/distribution/services/state/types/space.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@plurid/plurid-data"),t=require("@plurid/plurid-engine"),a=require("@plurid/plurid-pubsub"),n=require("react"),r=require("react-redux"),o=require("redux"),i=require("redux-thunk"),l=require("@plurid/plurid-functions"),s=require("@plurid/plurid-themes"),c=require("styled-components"),u=require("@plurid/plurid-ui-components-react"),d=require("@plurid/plurid-icons-react"),T=require("@plurid/plurid-functions-react"),p=require("react-dom"),f=require("cross-fetch"),E=require("@plurid/elementql-client-react");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=m(a),_=m(n),O=m(i),h=m(s),S=m(c),R=m(f);const A=_.default.createContext(void 0);var I=Object.freeze({__proto__:null,SET_CONFIGURATION:"SET_CONFIGURATION",SET_CONFIGURATION_MICRO:"SET_CONFIGURATION_MICRO",SET_CONFIGURATION_PLANE_CONTROLS:"SET_CONFIGURATION_PLANE_CONTROLS",SET_CONFIGURATION_PLANE_OPACITY:"SET_CONFIGURATION_PLANE_OPACITY",SET_CONFIGURATION_THEME_GENERAL:"SET_CONFIGURATION_THEME_GENERAL",SET_CONFIGURATION_THEME_INTERACTION:"SET_CONFIGURATION_THEME_INTERACTION",SET_CONFIGURATION_LANGUAGE:"SET_CONFIGURATION_LANGUAGE",TOGGLE_CONFIGURATION_VIEWCUBE_HIDE:"TOGGLE_CONFIGURATION_VIEWCUBE_HIDE",TOGGLE_CONFIGURATION_VIEWCUBE_BUTTONS:"TOGGLE_CONFIGURATION_VIEWCUBE_BUTTONS",TOGGLE_CONFIGURATION_VIEWCUBE_OPAQUE:"TOGGLE_CONFIGURATION_VIEWCUBE_OPAQUE",TOGGLE_CONFIGURATION_VIEWCUBE_CONCEAL:"TOGGLE_CONFIGURATION_VIEWCUBE_CONCEAL",TOGGLE_CONFIGURATION_TOOLBAR_CONCEAL:"TOGGLE_CONFIGURATION_TOOLBAR_CONCEAL",TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_ICONS:"TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_ICONS",TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_BUTTONS:"TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_BUTTONS",TOGGLE_CONFIGURATION_TOOLBAR_OPAQUE:"TOGGLE_CONFIGURATION_TOOLBAR_OPAQUE",TOGGLE_CONFIGURATION_TOOLBAR_TOGGLE_DRAWER:"TOGGLE_CONFIGURATION_TOOLBAR_TOGGLE_DRAWER",TOGGLE_CONFIGURATION_SPACE_TRANSPARENT_UI:"TOGGLE_CONFIGURATION_SPACE_TRANSPARENT_UI",TOGGLE_CONFIGURATION_SPACE_SHOW_TRANSFORM_ORIGIN:"TOGGLE_CONFIGURATION_SPACE_SHOW_TRANSFORM_ORIGIN",SET_CONFIGURATION_SPACE_TRANSFORM_ORIGIN_SIZE:"SET_CONFIGURATION_SPACE_TRANSFORM_ORIGIN_SIZE",SET_CONFIGURATION_SPACE_TRANSFORM_MODE:"SET_CONFIGURATION_SPACE_TRANSFORM_MODE",TOGGLE_CONFIGURATION_SPACE_TRANSFORM_MULTIMODE:"TOGGLE_CONFIGURATION_SPACE_TRANSFORM_MULTIMODE",SET_CONFIGURATION_SPACE_TRANSFORM_TOUCH:"SET_CONFIGURATION_SPACE_TRANSFORM_TOUCH",TOGGLE_CONFIGURATION_SPACE_FIRST_PERSON:"TOGGLE_CONFIGURATION_SPACE_FIRST_PERSON",SET_CONFIGURATION_SPACE_TRANSFORM_LOCKS:"SET_CONFIGURATION_SPACE_TRANSFORM_LOCKS",SET_CONFIGURATION_SPACE_LAYOUT_TYPE:"SET_CONFIGURATION_SPACE_LAYOUT_TYPE",SET_CONFIGURATION_SPACE_CULLING_DISTANCE:"SET_CONFIGURATION_SPACE_CULLING_DISTANCE"});var C=Object.freeze({__proto__:null,setConfiguration:e=>({type:"SET_CONFIGURATION",payload:e}),setConfigurationMicro:()=>({type:"SET_CONFIGURATION_MICRO"}),setConfigurationPlaneControls:e=>({type:"SET_CONFIGURATION_PLANE_CONTROLS",payload:e}),setConfigurationPlaneOpacity:e=>({type:"SET_CONFIGURATION_PLANE_OPACITY",payload:e}),setConfigurationThemeGeneralAction:e=>({type:"SET_CONFIGURATION_THEME_GENERAL",payload:e}),setConfigurationThemeInteractionAction:e=>({type:"SET_CONFIGURATION_THEME_INTERACTION",payload:e}),setConfigurationLanguageAction:e=>({type:"SET_CONFIGURATION_LANGUAGE",payload:e}),toggleConfigurationViewcubeHide:e=>({type:"TOGGLE_CONFIGURATION_VIEWCUBE_HIDE",payload:e}),toggleConfigurationViewcubeButtons:e=>({type:"TOGGLE_CONFIGURATION_VIEWCUBE_BUTTONS",payload:e}),toggleConfigurationViewcubeOpaque:e=>({type:"TOGGLE_CONFIGURATION_VIEWCUBE_OPAQUE",payload:e}),toggleConfigurationViewcubeConceal:()=>({type:"TOGGLE_CONFIGURATION_VIEWCUBE_CONCEAL"}),toggleConfigurationToolbarConceal:()=>({type:"TOGGLE_CONFIGURATION_TOOLBAR_CONCEAL"}),toggleConfigurationToolbarTransformIcons:()=>({type:"TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_ICONS"}),toggleConfigurationToolbarTransformButtons:()=>({type:"TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_BUTTONS"}),toggleConfigurationSpaceTransparentUI:()=>({type:"TOGGLE_CONFIGURATION_SPACE_TRANSPARENT_UI"}),toggleConfigurationSpaceShowTransformOrigin:()=>({type:"TOGGLE_CONFIGURATION_SPACE_SHOW_TRANSFORM_ORIGIN"}),toggleConfigurationToolbarOpaque:()=>({type:"TOGGLE_CONFIGURATION_TOOLBAR_OPAQUE"}),toggleConfigurationToolbarToggleDrawer:e=>({type:"TOGGLE_CONFIGURATION_TOOLBAR_TOGGLE_DRAWER",payload:e}),setConfigurationSpaceTransformOriginSize:e=>({type:"SET_CONFIGURATION_SPACE_TRANSFORM_ORIGIN_SIZE",payload:e}),setConfigurationSpaceTransformMode:e=>({type:"SET_CONFIGURATION_SPACE_TRANSFORM_MODE",payload:e}),toggleConfigurationSpaceTransformMultimode:e=>({type:"TOGGLE_CONFIGURATION_SPACE_TRANSFORM_MULTIMODE",payload:e}),setConfigurationSpaceTransformTouch:e=>({type:"SET_CONFIGURATION_SPACE_TRANSFORM_TOUCH",payload:e}),toggleConfigurationSpaceFirstPerson:()=>({type:"TOGGLE_CONFIGURATION_SPACE_FIRST_PERSON"}),setConfigurationSpaceTransformLocks:e=>({type:"SET_CONFIGURATION_SPACE_TRANSFORM_LOCKS",payload:e}),setConfigurationSpaceLayoutType:e=>({type:"SET_CONFIGURATION_SPACE_LAYOUT_TYPE",payload:e}),setConfigurationSpaceCullingDistance:e=>({type:"SET_CONFIGURATION_SPACE_CULLING_DISTANCE",payload:e})});const b=Object.assign({},e.defaultConfiguration),L=(e,t)=>Object.assign(Object.assign({},e),t.payload),N=e=>{const t=Object.assign({},e);return t.elements.toolbar.show=!1,t.elements.plane.controls.show=!1,t.elements.viewcube.show=!1,Object.assign({},t)},U=(e,t)=>{const a=Object.assign({},e);return a.elements.plane.controls.show=t.payload,Object.assign({},a)},v=(e,t)=>{const a=Object.assign({},e);return a.elements.plane.opacity=t.payload,Object.assign({},a)},P=(e,t)=>{const a=Object.assign({},e),n={general:t.payload,interaction:"object"==typeof a.global.theme?a.global.theme.interaction:"plurid"};return Object.assign(Object.assign({},a),{global:Object.assign(Object.assign({},a.global),{theme:n})})},y=(e,t)=>{const a=Object.assign({},e),n={general:"object"==typeof a.global.theme?a.global.theme.general:"plurid",interaction:t.payload};return Object.assign(Object.assign({},a),{global:Object.assign(Object.assign({},a.global),{theme:n})})},w=(e,t)=>Object.assign(Object.assign({},e),{global:Object.assign(Object.assign({},e.global),{language:t.payload})}),D=(e,t)=>{const a=Object.assign({},e);return a.elements.viewcube.show=t.payload,Object.assign({},a)},M=(e,t)=>{const a=Object.assign({},e);return a.elements.viewcube.buttons=t.payload,Object.assign({},a)},x=(e,t)=>{const a=Object.assign({},e);return a.elements.viewcube.opaque=t.payload,Object.assign({},a)},F=e=>{const{conceal:t}=e.elements.viewcube,a=Object.assign({},e);return a.elements.viewcube.conceal=!t,Object.assign({},a)},G=e=>{const{conceal:t}=e.elements.toolbar,a=Object.assign({},e);return a.elements.toolbar.conceal=!t,Object.assign({},a)},j=e=>{const{transformIcons:t}=e.elements.toolbar,a=Object.assign({},e);return a.elements.toolbar.transformIcons=!t,Object.assign({},a)},V=e=>{const{transformButtons:t}=e.elements.toolbar,a=Object.assign({},e);return a.elements.toolbar.transformButtons=!t,Object.assign({},a)},k=e=>{const{show:t}=e.space.transformOrigin,a=Object.assign({},e);return a.space.transformOrigin.show=!t,Object.assign({},a)},Y=e=>{const{opaque:t}=e.elements.toolbar,a=Object.assign({},e);return a.elements.toolbar.opaque=!t,Object.assign({},a)},W=e=>{const t=Object.assign({},e);return t.global.transparentUI=!e.global.transparentUI,Object.assign({},t)},B=(e,t)=>{const a=Object.assign({},e);return a.space.transformOrigin.size=t.payload,Object.assign({},a)},$=(t,a)=>{const n=Object.assign({},t);return n.space.transformMode!==a.payload?n.space.transformMode=a.payload:n.space.transformMode=e.TRANSFORM_MODES.ALL,Object.assign({},n)},H=(e,t)=>{const a=Object.assign({},e);return a.space.transformMultimode=t.payload,Object.assign({},a)},X=(e,t)=>{const a=Object.assign({},e);return a.space.transformTouch=t.payload,Object.assign({},a)},z=e=>{const{firstPerson:t}=e.space,a=Object.assign({},e);return a.space.firstPerson=!t,Object.assign({},a)},Z=(e,t)=>{const{toggledDrawers:a}=e.elements.toolbar,n=Object.assign({},e);if(a.includes(t.payload)){const e=a.filter((e=>e!==t.payload));n.elements.toolbar.toggledDrawers=[...e]}else n.elements.toolbar.toggledDrawers=[...a,t.payload];return Object.assign({},n)},K=(e,t)=>{const{transformLocks:a}=e.space,n=Object.assign({},e),r=Object.assign({},a);return r[t.payload]=!a[t.payload],n.space.transformLocks=Object.assign({},r),Object.assign({},n)},q=(t,a)=>{const n=Object.assign({},t),r={type:e.LAYOUT_TYPES[a.payload]};return n.space.layout=Object.assign({},r),Object.assign({},n)},Q=(e,t)=>{const a=Object.assign({},e);return a.space.cullingDistance=t.payload,Object.assign({},a)};var J=Object.freeze({__proto__:null,setConfiguration:L,setConfigurationMicro:N,setConfigurationPlaneControls:U,setConfigurationPlaneOpacity:v,setConfigurationThemeGeneral:P,setConfigurationThemeInteraction:y,setConfigurationLanguage:w,toggleConfigurationViewcubeHide:D,toggleConfigurationViewcubeButtons:M,toggleConfigurationViewcubeOpaque:x,toggleConfigurationViewcubeConceal:F,toggleConfigurationToolbarConceal:G,toggleConfigurationToolbarTransformIcons:j,toggleConfigurationToolbarTransformButtons:V,toggleConfigurationShowTransformOrigin:k,toggleConfigurationToolbarOpaque:Y,toggleConfigurationSpaceTransparentUI:W,setConfigurationSpaceTransformOriginSize:B,setConfigurationSpaceTransformMode:$,toggleConfigurationSpaceTransformMultimode:H,setConfigurationSpaceTransformTouch:X,toggleConfigurationSpaceFirstPerson:z,toggleConfigurationToolbarToggleDrawer:Z,setConfigurationSpaceTransformLocks:K,setConfigurationSpaceLayout:q,setConfigurationSpaceCullingDistance:Q});var ee={getConfiguration:e=>e.configuration},te=Object.freeze({__proto__:null,actions:C,initialState:b,reducer:(e=b,t)=>{switch(t.type){case"SET_STATE":return Object.assign(Object.assign({},e),t.payload.configuration);case"SET_CONFIGURATION":return L(e,t);case"SET_CONFIGURATION_MICRO":return N(e);case"SET_CONFIGURATION_PLANE_CONTROLS":return U(e,t);case"SET_CONFIGURATION_PLANE_OPACITY":return v(e,t);case"SET_CONFIGURATION_THEME_GENERAL":return P(e,t);case"SET_CONFIGURATION_THEME_INTERACTION":return y(e,t);case"SET_CONFIGURATION_LANGUAGE":return w(e,t);case"TOGGLE_CONFIGURATION_VIEWCUBE_HIDE":return D(e,t);case"TOGGLE_CONFIGURATION_VIEWCUBE_BUTTONS":return M(e,t);case"TOGGLE_CONFIGURATION_VIEWCUBE_OPAQUE":return x(e,t);case"TOGGLE_CONFIGURATION_VIEWCUBE_CONCEAL":return F(e);case"TOGGLE_CONFIGURATION_TOOLBAR_CONCEAL":return G(e);case"TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_ICONS":return j(e);case"TOGGLE_CONFIGURATION_TOOLBAR_TRANSFORM_BUTTONS":return V(e);case"TOGGLE_CONFIGURATION_TOOLBAR_TOGGLE_DRAWER":return Z(e,t);case"TOGGLE_CONFIGURATION_TOOLBAR_OPAQUE":return Y(e);case"TOGGLE_CONFIGURATION_SPACE_TRANSPARENT_UI":return W(e);case"TOGGLE_CONFIGURATION_SPACE_SHOW_TRANSFORM_ORIGIN":return k(e);case"SET_CONFIGURATION_SPACE_TRANSFORM_ORIGIN_SIZE":return B(e,t);case"SET_CONFIGURATION_SPACE_TRANSFORM_MODE":return $(e,t);case"TOGGLE_CONFIGURATION_SPACE_TRANSFORM_MULTIMODE":return H(e,t);case"SET_CONFIGURATION_SPACE_TRANSFORM_TOUCH":return X(e,t);case"TOGGLE_CONFIGURATION_SPACE_FIRST_PERSON":return z(e);case"SET_CONFIGURATION_SPACE_TRANSFORM_LOCKS":return K(e,t);case"SET_CONFIGURATION_SPACE_LAYOUT_TYPE":return q(e,t);case"SET_CONFIGURATION_SPACE_CULLING_DISTANCE":return Q(e,t);default:return Object.assign({},e)}},resolvers:J,selectors:ee,Types:I}),ae=Object.freeze({__proto__:null,default:{}});const ne={};var re=Object.freeze({__proto__:null}),oe=Object.freeze({__proto__:null}),ie=Object.freeze({__proto__:null,actions:ae,initialState:ne,reducer:(e=ne,t)=>Object.assign({},e),resolvers:re,selectors:{},Types:oe});var le=Object.freeze({__proto__:null,SHORTCUTS_SET_GLOBAL_SHORTCUTS:"SHORTCUTS_SET_GLOBAL_SHORTCUTS",SHORTCUTS_UNSET_GLOBAL_SHORTCUTS:"SHORTCUTS_UNSET_GLOBAL_SHORTCUTS"});var se=Object.freeze({__proto__:null,setGlobalShortcuts:()=>({type:"SHORTCUTS_SET_GLOBAL_SHORTCUTS"}),unsetGlobalShortcuts:()=>({type:"SHORTCUTS_UNSET_GLOBAL_SHORTCUTS"})});const ce={global:!0},ue=e=>Object.assign(Object.assign({},e),{global:!0}),de=e=>Object.assign(Object.assign({},e),{global:!1});var Te=Object.freeze({__proto__:null,setGlobalShortcuts:ue,unsetGlobalShortcuts:de});var pe={getGlobal:e=>e.shortcuts.global},fe=Object.freeze({__proto__:null,actions:se,initialState:ce,reducer:(e=ce,t)=>{switch(t.type){case"SET_STATE":return Object.assign(Object.assign({},e),t.payload.shortcuts);case"SHORTCUTS_SET_GLOBAL_SHORTCUTS":return ue(e);case"SHORTCUTS_UNSET_GLOBAL_SHORTCUTS":return de(e);default:return Object.assign({},e)}},resolvers:Te,selectors:pe,Types:le});var Ee=Object.freeze({__proto__:null,SET_SPACE_LOADING:"SET_SPACE_LOADING",SET_ANIMATED_TRANSFORM:"SET_ANIMATED_TRANSFORM",SET_TRANSFORM_TIME:"SET_TRANSFORM_TIME",SET_SPACE_LOCATION:"SET_SPACE_LOCATION",VIEW_CAMERA_MOVE_FORWARD:"VIEW_CAMERA_MOVE_FORWARD",VIEW_CAMERA_MOVE_BACKWARD:"VIEW_CAMERA_MOVE_BACKWARD",VIEW_CAMERA_MOVE_LEFT:"VIEW_CAMERA_MOVE_LEFT",VIEW_CAMERA_MOVE_RIGHT:"VIEW_CAMERA_MOVE_RIGHT",VIEW_CAMERA_MOVE_UP:"VIEW_CAMERA_MOVE_UP",VIEW_CAMERA_MOVE_DOWN:"VIEW_CAMERA_MOVE_DOWN",VIEW_CAMERA_TURN_UP:"VIEW_CAMERA_TURN_UP",VIEW_CAMERA_TURN_DOWN:"VIEW_CAMERA_TURN_DOWN",VIEW_CAMERA_TURN_LEFT:"VIEW_CAMERA_TURN_LEFT",VIEW_CAMERA_TURN_RIGHT:"VIEW_CAMERA_TURN_RIGHT",ROTATE_UP:"ROTATE_UP",ROTATE_DOWN:"ROTATE_DOWN",ROTATE_LEFT:"ROTATE_LEFT",ROTATE_X:"ROTATE_X",ROTATE_X_WITH:"ROTATE_X_WITH",ROTATE_RIGHT:"ROTATE_RIGHT",ROTATE_Y:"ROTATE_Y",ROTATE_Y_WITH:"ROTATE_Y_WITH",TRANSLATE_UP:"TRANSLATE_UP",TRANSLATE_DOWN:"TRANSLATE_DOWN",TRANSLATE_LEFT:"TRANSLATE_LEFT",TRANSLATE_RIGHT:"TRANSLATE_RIGHT",TRANSLATE_IN:"TRANSLATE_IN",TRANSLATE_OUT:"TRANSLATE_OUT",TRANSLATE_X_WITH:"TRANSLATE_X_WITH",TRANSLATE_Y_WITH:"TRANSLATE_Y_WITH",SCALE_UP:"SCALE_UP",SCALE_DOWN:"SCALE_DOWN",SCALE_UP_WITH:"SCALE_UP_WITH",SCALE_DOWN_WITH:"SCALE_DOWN_WITH",SET_INITIAL_TREE:"SET_INITIAL_TREE",SET_TREE:"SET_TREE",SET_ACTIVE_UNIVERSE:"SET_ACTIVE_UNIVERSE",SPACE_RESET_TRANSFORM:"SPACE_RESET_TRANSFORM",SET_VIEW_SIZE:"SET_VIEW_SIZE",SET_SPACE_SIZE:"SET_SPACE_SIZE",UPDATE_SPACE_TREE_PLANE:"UPDATE_SPACE_TREE_PLANE",UPDATE_SPACE_LINK_COORDINATES:"UPDATE_SPACE_LINK_COORDINATES",SPACE_SET_VIEW:"SPACE_SET_VIEW",SPACE_SET_CULLED_VIEW:"SPACE_SET_CULLED_VIEW"});var me=Object.freeze({__proto__:null,setSpaceLoading:e=>({type:"SET_SPACE_LOADING",payload:e}),setAnimatedTransform:e=>({type:"SET_ANIMATED_TRANSFORM",payload:e}),setTransformTime:e=>({type:"SET_TRANSFORM_TIME",payload:e}),setSpaceLocation:e=>({type:"SET_SPACE_LOCATION",payload:e}),viewCameraMoveForward:()=>({type:"VIEW_CAMERA_MOVE_FORWARD"}),viewCameraMoveBackward:()=>({type:"VIEW_CAMERA_MOVE_BACKWARD"}),viewCameraMoveLeft:()=>({type:"VIEW_CAMERA_MOVE_LEFT"}),viewCameraMoveRight:()=>({type:"VIEW_CAMERA_MOVE_RIGHT"}),viewCameraMoveUp:()=>({type:"VIEW_CAMERA_MOVE_UP"}),viewCameraMoveDown:()=>({type:"VIEW_CAMERA_MOVE_DOWN"}),viewCameraTurnUp:()=>({type:"VIEW_CAMERA_TURN_UP"}),viewCameraTurnDown:()=>({type:"VIEW_CAMERA_TURN_DOWN"}),viewCameraTurnLeft:()=>({type:"VIEW_CAMERA_TURN_LEFT"}),viewCameraTurnRight:()=>({type:"VIEW_CAMERA_TURN_RIGHT"}),rotateUp:()=>({type:"ROTATE_UP"}),rotateDown:()=>({type:"ROTATE_DOWN"}),rotateX:e=>({type:"ROTATE_X",payload:e}),rotateXWith:e=>({type:"ROTATE_X_WITH",payload:e}),rotateLeft:()=>({type:"ROTATE_LEFT"}),rotateRight:()=>({type:"ROTATE_RIGHT"}),rotateY:e=>({type:"ROTATE_Y",payload:e}),rotateYWith:e=>({type:"ROTATE_Y_WITH",payload:e}),translateUp:()=>({type:"TRANSLATE_UP"}),translateDown:()=>({type:"TRANSLATE_DOWN"}),translateLeft:()=>({type:"TRANSLATE_LEFT"}),translateRight:()=>({type:"TRANSLATE_RIGHT"}),translateIn:()=>({type:"TRANSLATE_IN"}),translateOut:()=>({type:"TRANSLATE_OUT"}),translateXWith:e=>({type:"TRANSLATE_X_WITH",payload:e}),translateYWith:e=>({type:"TRANSLATE_Y_WITH",payload:e}),scaleUp:()=>({type:"SCALE_UP"}),scaleDown:()=>({type:"SCALE_DOWN"}),scaleUpWith:e=>({type:"SCALE_UP_WITH",payload:e}),scaleDownWith:e=>({type:"SCALE_DOWN_WITH",payload:e}),setInitialTree:e=>({type:"SET_INITIAL_TREE",payload:e}),setTree:e=>({type:"SET_TREE",payload:e}),setActiveUniverse:e=>({type:"SET_ACTIVE_UNIVERSE",payload:e}),spaceResetTransform:()=>({type:"SPACE_RESET_TRANSFORM"}),setViewSize:e=>({type:"SET_VIEW_SIZE",payload:e}),setSpaceSize:e=>({type:"SET_SPACE_SIZE",payload:e}),updateSpaceTreePlane:e=>({type:"UPDATE_SPACE_TREE_PLANE",payload:e}),updateSpaceLinkCoordinates:e=>({type:"UPDATE_SPACE_LINK_COORDINATES",payload:e}),spaceSetView:e=>({type:"SPACE_SET_VIEW",payload:e}),spaceSetCulledView:e=>({type:"SPACE_SET_CULLED_VIEW",payload:e})});const ge={loading:!0,animatedTransform:!1,transformTime:450,scale:1,rotationX:0,rotationY:0,translationX:0,translationY:0,translationZ:0,initialTree:[],tree:[],activeUniverseID:"",camera:{x:0,y:0,z:0},viewSize:{width:"undefined"==typeof window?1440:window.innerWidth,height:"undefined"==typeof window?821:window.innerHeight},spaceSize:{width:"undefined"==typeof window?1440:window.innerWidth,height:"undefined"==typeof window?821:window.innerHeight,depth:0,topCorner:{x:0,y:0,z:0}},view:[],culledView:[]},{toRadians:_e}=l.mathematics.geometry,Oe=(e,t)=>Object.assign(Object.assign({},e),{loading:t.payload}),he=(e,t)=>Object.assign(Object.assign({},e),{animatedTransform:t.payload}),Se=(e,t)=>Object.assign(Object.assign({},e),{transformTime:t.payload}),Re=(e,t)=>Object.assign(Object.assign({},e),t.payload),Ae=t=>{const a=t.translationZ+6*e.TRANSLATION_STEP*Math.cos(_e(-t.rotationY)),n=t.translationX+6*e.TRANSLATION_STEP*Math.sin(_e(-t.rotationY));return Object.assign(Object.assign({},t),{translationX:n,translationZ:a})},Ie=t=>{const a=t.translationZ-6*e.TRANSLATION_STEP*Math.cos(_e(-t.rotationY)),n=t.translationX-6*e.TRANSLATION_STEP*Math.sin(_e(-t.rotationY));return Object.assign(Object.assign({},t),{translationX:n,translationZ:a})},Ce=t=>{const a=t.translationX+3*e.TRANSLATION_STEP*Math.cos(_e(t.rotationY)),n=t.translationZ+3*e.TRANSLATION_STEP*Math.sin(_e(t.rotationY));return Object.assign(Object.assign({},t),{translationX:a,translationZ:n})},be=t=>{const a=t.translationX-3*e.TRANSLATION_STEP*Math.cos(_e(t.rotationY)),n=t.translationZ-3*e.TRANSLATION_STEP*Math.sin(_e(t.rotationY));return Object.assign(Object.assign({},t),{translationX:a,translationZ:n})},Le=t=>{const a=t.translationY+3*e.TRANSLATION_STEP;return Object.assign(Object.assign({},t),{translationY:a})},Ne=t=>{const a=t.translationY-3*e.TRANSLATION_STEP;return Object.assign(Object.assign({},t),{translationY:a})},Ue=t=>{const a=(t.rotationX+e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationX:a})},ve=t=>{const a=(t.rotationX-e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationX:a})},Pe=t=>{const a=(t.rotationY-e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationY:a})},ye=t=>{const a=(t.rotationY+e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationY:a})},we=t=>{const a=(t.rotationX+e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationX:a})},De=t=>{const a=(t.rotationX-e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationX:a})},Me=(e,t)=>Object.assign(Object.assign({},e),{rotationX:t.payload}),xe=(e,t)=>{const a=e.rotationX+t.payload;return Object.assign(Object.assign({},e),{rotationX:a})},Fe=t=>{const a=(t.rotationY+e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationY:a})},Ge=t=>{const a=(t.rotationY-e.ROTATION_STEP)%360;return Object.assign(Object.assign({},t),{rotationY:a})},je=(e,t)=>Object.assign(Object.assign({},e),{rotationY:t.payload}),Ve=(e,t)=>{const a=e.rotationY+t.payload;return Object.assign(Object.assign({},e),{rotationY:a})},ke=t=>{const a=t.translationY-e.TRANSLATION_STEP;return Object.assign(Object.assign({},t),{translationY:a})},Ye=t=>{const a=t.translationY+e.TRANSLATION_STEP;return Object.assign(Object.assign({},t),{translationY:a})},We=t=>{const a=t.translationX-e.TRANSLATION_STEP*Math.cos(_e(t.rotationY)),n=t.translationZ-e.TRANSLATION_STEP*Math.sin(_e(t.rotationY));return Object.assign(Object.assign({},t),{translationX:a,translationZ:n})},Be=t=>{const a=t.translationX+e.TRANSLATION_STEP*Math.cos(_e(t.rotationY)),n=t.translationZ+e.TRANSLATION_STEP*Math.sin(_e(t.rotationY));return Object.assign(Object.assign({},t),{translationX:a,translationZ:n})},$e=t=>{const a=t.translationZ-3*e.TRANSLATION_STEP*Math.cos(_e(-t.rotationY)),n=t.translationX-3*e.TRANSLATION_STEP*Math.sin(_e(-t.rotationY));return Object.assign(Object.assign({},t),{translationX:n,translationZ:a})},He=t=>{const a=t.translationZ+3*e.TRANSLATION_STEP*Math.cos(_e(-t.rotationY)),n=t.translationX+3*e.TRANSLATION_STEP*Math.sin(_e(-t.rotationY));return Object.assign(Object.assign({},t),{translationX:n,translationZ:a})},Xe=(e,t)=>{const a=e.translationX+t.payload*Math.cos(_e(e.rotationY)),n=e.translationZ+t.payload*Math.sin(_e(e.rotationY));return Object.assign(Object.assign({},e),{translationX:a,translationZ:n})},ze=(e,t)=>{const a=e.translationY+t.payload;return Object.assign(Object.assign({},e),{translationY:a})},Ze=t=>{const a=t.scale+e.SCALE_STEP,n=a<e.SCALE_UPPER_LIMIT?a:e.SCALE_UPPER_LIMIT;return Object.assign(Object.assign({},t),{scale:n})},Ke=t=>{const a=t.scale-e.SCALE_STEP,n=a>e.SCALE_LOWER_LIMIT?a:e.SCALE_LOWER_LIMIT;return Object.assign(Object.assign({},t),{scale:n})},qe=(t,a)=>{const n=t.scale+Math.abs(a.payload),r=n<e.SCALE_UPPER_LIMIT?n:e.SCALE_UPPER_LIMIT;return Object.assign(Object.assign({},t),{scale:r})},Qe=(t,a)=>{const n=t.scale-Math.abs(a.payload),r=n>e.SCALE_LOWER_LIMIT?n:e.SCALE_LOWER_LIMIT;return Object.assign(Object.assign({},t),{scale:r})},Je=(e,t)=>Object.assign(Object.assign({},e),{initialTree:[...t.payload]}),et=(e,t)=>Object.assign(Object.assign({},e),{tree:[...t.payload]}),tt=(e,t)=>Object.assign(Object.assign({},e),{activeUniverseID:t.payload}),at=e=>Object.assign(Object.assign({},e),{scale:1,rotationX:0,rotationY:0,translationX:0,translationY:0,translationZ:0}),nt=(e,t)=>Object.assign(Object.assign({},e),{viewSize:Object.assign({},t.payload)}),rt=(e,t)=>Object.assign(Object.assign({},e),{spaceSize:Object.assign({},t.payload)}),ot=(e,a)=>{const n=t.general.tree.updateTreePlane(e.tree,a.payload);return Object.assign(Object.assign({},e),{tree:n})},it=(e,a)=>{const{planeID:n,linkCoordinates:r}=a.payload,o=t.general.tree.updateTreeByPlaneIDWithLinkCoordinates(e.tree,n,r);return Object.assign(Object.assign({},e),{tree:o})},lt=(e,t)=>Object.assign(Object.assign({},e),{view:t.payload}),st=(e,t)=>Object.assign(Object.assign({},e),{culledView:t.payload});var ct=Object.freeze({__proto__:null,setSpaceLoading:Oe,setAnimatedTransform:he,setTransformTime:Se,setSpaceLocation:Re,viewCameraMoveForward:Ae,viewCameraMoveBackward:Ie,viewCameraMoveLeft:Ce,viewCameraMoveRight:be,viewCameraMoveUp:Le,viewCameraMoveDown:Ne,viewCameraTurnUp:Ue,viewCameraTurnDown:ve,viewCameraTurnLeft:Pe,viewCameraTurnRight:ye,rotateUp:we,rotateDown:De,rotateX:Me,rotateXWith:xe,rotateLeft:Fe,rotateRight:Ge,rotateY:je,rotateYWith:Ve,translateUp:ke,translateDown:Ye,translateLeft:We,translateRight:Be,translateIn:$e,translateOut:He,translateXWith:Xe,translateYWith:ze,scaleUp:Ze,scaleDown:Ke,scaleUpWith:qe,scaleDownWith:Qe,setInitialTree:Je,setTree:et,setActiveUniverse:tt,spaceResetTransform:at,setViewSize:nt,setSpaceSize:rt,updateSpaceTreePlane:ot,updateSpaceLinkCoordinates:it,spaceSetView:lt,spaceSetCulledView:st});var ut={getLoading:e=>e.space.loading,getAnimatedTransform:e=>e.space.animatedTransform,getTransformTime:e=>e.space.transformTime,getRotationX:e=>e.space.rotationX,getRotationY:e=>e.space.rotationY,getTranslationX:e=>e.space.translationX,getTranslationY:e=>e.space.translationY,getTranslationZ:e=>e.space.translationZ,getScale:e=>e.space.scale,getTransform:e=>({rotationX:e.space.rotationX,rotationY:e.space.rotationY,translationX:e.space.translationX,translationY:e.space.translationY,translationZ:e.space.translationZ,scale:e.space.scale}),getInitialTree:e=>e.space.initialTree,getTree:e=>e.space.tree,getActiveUniverseID:e=>e.space.activeUniverseID,getView:e=>e.space.view,getViewSize:e=>e.space.viewSize,getCulledView:e=>e.space.culledView},dt=Object.freeze({__proto__:null,actions:me,initialState:ge,reducer:(e=ge,t)=>{switch(t.type){case"SET_STATE":return Object.assign(Object.assign({},e),t.payload.space);case"SET_SPACE_LOADING":return Oe(e,t);case"SET_ANIMATED_TRANSFORM":return he(e,t);case"SET_TRANSFORM_TIME":return Se(e,t);case"SET_SPACE_LOCATION":return Re(e,t);case"VIEW_CAMERA_MOVE_FORWARD":return Ae(e);case"VIEW_CAMERA_MOVE_BACKWARD":return Ie(e);case"VIEW_CAMERA_MOVE_LEFT":return Ce(e);case"VIEW_CAMERA_MOVE_RIGHT":return be(e);case"VIEW_CAMERA_MOVE_UP":return Le(e);case"VIEW_CAMERA_MOVE_DOWN":return Ne(e);case"VIEW_CAMERA_TURN_UP":return Ue(e);case"VIEW_CAMERA_TURN_DOWN":return ve(e);case"VIEW_CAMERA_TURN_LEFT":return Pe(e);case"VIEW_CAMERA_TURN_RIGHT":return ye(e);case"ROTATE_UP":return we(e);case"ROTATE_DOWN":return De(e);case"ROTATE_X":return Me(e,t);case"ROTATE_X_WITH":return xe(e,t);case"ROTATE_LEFT":return Fe(e);case"ROTATE_RIGHT":return Ge(e);case"ROTATE_Y":return je(e,t);case"ROTATE_Y_WITH":return Ve(e,t);case"TRANSLATE_UP":return ke(e);case"TRANSLATE_DOWN":return Ye(e);case"TRANSLATE_LEFT":return We(e);case"TRANSLATE_RIGHT":return Be(e);case"TRANSLATE_IN":return $e(e);case"TRANSLATE_OUT":return He(e);case"TRANSLATE_X_WITH":return Xe(e,t);case"TRANSLATE_Y_WITH":return ze(e,t);case"SCALE_UP":return Ze(e);case"SCALE_DOWN":return Ke(e);case"SCALE_UP_WITH":return qe(e,t);case"SCALE_DOWN_WITH":return Qe(e,t);case"SET_INITIAL_TREE":return Je(e,t);case"SET_TREE":return et(e,t);case"SET_ACTIVE_UNIVERSE":return tt(e,t);case"SPACE_RESET_TRANSFORM":return at(e);case"SET_VIEW_SIZE":return nt(e,t);case"SET_SPACE_SIZE":return rt(e,t);case"UPDATE_SPACE_TREE_PLANE":return ot(e,t);case"UPDATE_SPACE_LINK_COORDINATES":return it(e,t);case"SPACE_SET_VIEW":return lt(e,t);case"SPACE_SET_CULLED_VIEW":return st(e,t);default:return Object.assign({},e)}},resolvers:ct,selectors:ut,Types:Ee});var Tt=Object.freeze({__proto__:null,THEMES_SET_GENERAL_THEME:"THEMES_SET_GENERAL_THEME",THEMES_SET_INTERACTION_THEME:"THEMES_SET_INTERACTION_THEME"});var pt=Object.freeze({__proto__:null,setGeneralTheme:e=>({type:"THEMES_SET_GENERAL_THEME",payload:e}),setInteractionTheme:e=>({type:"THEMES_SET_INTERACTION_THEME",payload:e})});const ft={general:s.plurid,interaction:s.plurid},Et=(e,t)=>Object.assign(Object.assign({},e),{general:Object.assign({},t.payload)}),mt=(e,t)=>Object.assign(Object.assign({},e),{interaction:Object.assign({},t.payload)});var gt=Object.freeze({__proto__:null,setGeneralTheme:Et,setInteractionTheme:mt});var _t={getGeneralTheme:e=>e.themes.general,getInteractionTheme:e=>e.themes.interaction},Ot=Object.freeze({__proto__:null,actions:pt,initialState:ft,reducer:(e=ft,t)=>{switch(t.type){case"SET_STATE":return Object.assign(Object.assign({},e),t.payload.themes);case"THEMES_SET_GENERAL_THEME":return Et(e,t);case"THEMES_SET_INTERACTION_THEME":return mt(e,t);default:return Object.assign({},e)}},resolvers:gt,selectors:_t,Types:Tt});var ht=Object.freeze({__proto__:null,SET_UI_TOOLBAR_SCROLL_POSITION:"SET_UI_TOOLBAR_SCROLL_POSITION"});var St=Object.freeze({__proto__:null,setUIToolbarScrollPosition:e=>({type:"SET_UI_TOOLBAR_SCROLL_POSITION",payload:e})});const Rt={toolbarScrollPosition:0},At=(e,t)=>Object.assign(Object.assign({},e),{toolbarScrollPosition:t.payload});var It=Object.freeze({__proto__:null,setUIToolbarScrollPosition:At});var Ct={getToolbarScrollPosition:e=>e.ui.toolbarScrollPosition},bt={configuration:te,general:ie,shortcuts:fe,space:dt,themes:Ot,ui:Object.freeze({__proto__:null,actions:St,initialState:Rt,reducer:(e=Rt,t)=>{switch(t.type){case"SET_STATE":return Object.assign(Object.assign({},e),t.payload.ui);case"SET_UI_TOOLBAR_SCROLL_POSITION":return At(e,t);default:return Object.assign({},e)}},resolvers:It,selectors:Ct,Types:ht})};const Lt=o.combineReducers({configuration:bt.configuration.reducer,general:bt.general.reducer,shortcuts:bt.shortcuts.reducer,space:bt.space.reducer,themes:bt.themes.reducer,ui:bt.ui.reducer}),Nt=e=>o.createStore(Lt,e,o.applyMiddleware(O.default)),Ut=_.default.createContext({});function vt(e,t,a,n){return new(a||(a=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(i,l)}s((n=n.apply(e,t||[])).next())}))}const Pt=_.default.createContext(null);var yt={configuration:bt.configuration.actions,general:bt.general.actions,shortcuts:bt.shortcuts.actions,space:bt.space.actions,themes:bt.themes.actions,ui:bt.ui.actions};const{direction:wt}=t.interaction,Dt=()=>vt(void 0,void 0,void 0,(function*(){return yield Promise.resolve().then((function(){return function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}(require("hammerjs"))}))}));var Mt={configuration:bt.configuration.selectors,general:bt.general.selectors,shortcuts:bt.shortcuts.selectors,space:bt.space.selectors,themes:bt.themes.selectors,ui:bt.ui.selectors};!function(e,t){void 0===t&&(t={});var a=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===a&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("@import url('https://fonts.googleapis.com/css?family=Ubuntu&display=swap');\n");const xt=c.createGlobalStyle`
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@plurid/plurid-data"),t=require("@plurid/plurid-engine"),a=require("@plurid/plurid-pubsub"),n=require("react"),r=require("react-redux"),o=require("@reduxjs/toolkit"),i=require("@plurid/plurid-functions"),l=require("@plurid/plurid-themes"),s=require("styled-components"),c=require("@plurid/plurid-functions-react"),u=require("@plurid/plurid-icons-react"),d=require("@plurid/plurid-ui-components-react"),f=require("react-dom"),p=require("cross-fetch"),m=require("@plurid/elementql-client-react"),g=require("hammerjs");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var T=h(e),E=h(t),v=h(a),S=h(n),P=h(r),b=h(o),R=h(i),I=h(l),C=h(s),w=h(c),O=h(u),y=h(d),_=h(f),L=h(p),A=h(m),U=h(g);var D={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=T.default,a=E.default,n=v.default,r=S.default,o=P.default,i=b.default,l=R.default,s=I.default,c=C.default,u=w.default,d=O.default,f=y.default,p=_.default,m=L.default,g=A.default;function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var D=h(n),x=h(r),N=h(s),M=h(c),k=h(m);const F=x.default.createContext(void 0),B=Object.assign({},t.defaultConfiguration),Y=i.createSlice({name:"configuration",initialState:B,reducers:{setConfiguration:(e,t)=>{e=Object.assign(Object.assign({},e),t.payload)},setConfigurationMicro:e=>{e.elements.toolbar.show=!1,e.elements.plane.controls.show=!1,e.elements.viewcube.show=!1},setConfigurationPlaneControls:(e,t)=>{e.elements.plane.controls.show=t.payload},setConfigurationPlaneOpacity:(e,t)=>{e.elements.plane.opacity=t.payload},setConfigurationThemeGeneral:(e,t)=>{const a={general:t.payload,interaction:"object"==typeof e.global.theme?e.global.theme.interaction:"plurid"};e.global.theme=a},setConfigurationThemeInteraction:(e,t)=>{const a={general:"object"==typeof e.global.theme?e.global.theme.general:"plurid",interaction:t.payload};e.global.theme=a},setConfigurationLanguage:(e,t)=>{e.global.language=t.payload},toggleConfigurationViewcubeHide:(e,t)=>{e.elements.viewcube.show=t.payload},toggleConfigurationViewcubeButtons:(e,t)=>{e.elements.viewcube.buttons=t.payload},toggleConfigurationViewcubeOpaque:(e,t)=>{e.elements.viewcube.opaque=t.payload},toggleConfigurationViewcubeConceal:e=>{const{conceal:t}=e.elements.viewcube;e.elements.viewcube.conceal=!t},toggleConfigurationToolbarConceal:e=>{const{conceal:t}=e.elements.toolbar;e.elements.toolbar.conceal=!t},toggleConfigurationToolbarTransformIcons:e=>{const{transformIcons:t}=e.elements.toolbar;e.elements.toolbar.transformIcons=!t},toggleConfigurationToolbarTransformButtons:e=>{const{transformButtons:t}=e.elements.toolbar;e.elements.toolbar.transformButtons=!t},toggleConfigurationShowTransformOrigin:e=>{const{show:t}=e.space.transformOrigin;e.space.transformOrigin.show=!t},toggleConfigurationToolbarOpaque:e=>{const{opaque:t}=e.elements.toolbar;e.elements.toolbar.opaque=!t},toggleConfigurationSpaceTransparentUI:e=>{e.global.transparentUI=!e.global.transparentUI},setConfigurationSpaceTransformOriginSize:(e,t)=>{e.space.transformOrigin.size=t.payload},setConfigurationSpaceTransformMode:(e,a)=>{e.space.transformMode!==a.payload?e.space.transformMode=a.payload:e.space.transformMode=t.TRANSFORM_MODES.ALL},toggleConfigurationSpaceTransformMultimode:(e,t)=>{e.space.transformMultimode=t.payload},setConfigurationSpaceTransformTouch:(e,t)=>{e.space.transformTouch=t.payload},toggleConfigurationSpaceFirstPerson:e=>{const{firstPerson:t}=e.space;e.space.firstPerson=!t},toggleConfigurationToolbarToggleDrawer:(e,t)=>{const{toggledDrawers:a}=e.elements.toolbar;if(a.includes(t.payload)){const n=a.filter((e=>e!==t.payload));e.elements.toolbar.toggledDrawers=[...n]}else e.elements.toolbar.toggledDrawers=[...a,t.payload]},setConfigurationSpaceTransformLocks:(e,t)=>{const{transformLocks:a}=e.space,n=Object.assign({},a);n[t.payload]=!a[t.payload],e.space.transformLocks=Object.assign({},n)},setConfigurationSpaceLayout:(e,a)=>{const n={type:t.LAYOUT_TYPES[a.payload]};e.space.layout=Object.assign({},n)},setConfigurationSpaceCullingDistance:(e,t)=>{e.space.cullingDistance=t.payload}}}),$=Y.actions,X=e=>e.configuration,V={getConfiguration:X},z=Y.reducer;var K=Object.freeze({__proto__:null,configuration:Y,actions:$,getConfiguration:X,selectors:V,reducer:z});const Z=i.createSlice({name:"general",initialState:{},reducers:{}}),j=Z.actions,G=e=>e.general,W={getGeneral:G},H=Z.reducer;var q=Object.freeze({__proto__:null,general:Z,actions:j,getGeneral:G,selectors:W,reducer:H});const J=i.createSlice({name:"shortcuts",initialState:{global:!0},reducers:{setGlobalShortcuts:(e,t)=>{e.global=t.payload}}}),Q=J.actions,ee=e=>e.shortcuts.global,te={getGlobal:ee},ae=J.reducer;var ne=Object.freeze({__proto__:null,shortcuts:J,actions:Q,getGlobal:ee,selectors:te,reducer:ae});const{registerPlanes:re,getRegisteredPlanes:oe,getPlanesRegistrar:ie,getPluridPlaneIDByData:le,getRegisteredPlane:se,resolvePluridRoutePlaneData:ce,resolvePluridPlaneData:ue,Registrar:de}=a.planes,{IsoMatcher:fe,resolveRoute:pe,computePlaneAddress:me}=a.routing,{quaternion:ge,matrix:he}=a.interaction,{degToRad:Te}=ge,{matrixArrayToCSSMatrix:Ee,rotateMatrix:ve,multiplyArrayOfMatrices:Se,scaleMatrix:Pe,translateMatrix:be}=he,Re=e=>{const{translationX:t,translationY:a,translationZ:n,rotationX:r,rotationY:o,scale:i}=e,l=-1*t+("undefined"==typeof window?720:window.innerWidth/2),s=-1*a+("undefined"==typeof window?400:window.innerHeight/2),c=-1*n,u=ve(Te(-r),Te(-o)),d=be(t,a,n),f=Pe(i),p=Se([d,be(l,s,c),u,be(-l,-s,-c),f]);return Ee(p)};var Ie=Object.freeze({__proto__:null,getSpace:e=>e.space,getLoading:e=>e.space.loading,getResolvedLayout:e=>e.space.resolvedLayout,getTransformMatrix:e=>e.space.transform,getAnimatedTransform:e=>e.space.animatedTransform,getTransformTime:e=>e.space.transformTime,getRotationX:e=>e.space.rotationX,getRotationY:e=>e.space.rotationY,getTranslationX:e=>e.space.translationX,getTranslationY:e=>e.space.translationY,getTranslationZ:e=>e.space.translationZ,getScale:e=>e.space.scale,getTree:e=>e.space.tree,getTransform:e=>({rotationX:e.space.rotationX,rotationY:e.space.rotationY,translationX:e.space.translationX,translationY:e.space.translationY,translationZ:e.space.translationZ,scale:e.space.scale}),getActiveUniverseID:e=>e.space.activeUniverseID,getView:e=>e.space.view,getViewSize:e=>e.space.viewSize,getCulledView:e=>e.space.culledView,getActivePlaneID:e=>e.space.activePlaneID,getIsolatePlane:e=>e.space.isolatePlane,getLastClosedPlane:e=>e.space.lastClosedPlane});const{toRadians:Ce}=l.mathematics.geometry,we={loading:!0,resolvedLayout:!1,transform:"matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",animatedTransform:!1,transformTime:450,scale:1,rotationX:0,rotationY:0,translationX:0,translationY:0,translationZ:0,tree:[],activeUniverseID:"",camera:{x:0,y:0,z:0},viewSize:{width:"undefined"==typeof window?1440:window.innerWidth,height:"undefined"==typeof window?821:window.innerHeight},spaceSize:{width:"undefined"==typeof window?1440:window.innerWidth,height:"undefined"==typeof window?821:window.innerHeight,depth:0,topCorner:{x:0,y:0,z:0}},view:[],culledView:[],activePlaneID:"",isolatePlane:"",lastClosedPlane:""},Oe="space",ye=i.createSlice({name:Oe,initialState:we,reducers:{setSpaceField:(e,t)=>{const{field:a,value:n}=t.payload;e[a]=n},setSpaceLoading:(e,t)=>{e.loading=t.payload},changeTransform:(e,t)=>{},setTransform:(e,t)=>{const{translationX:a,translationY:n,translationZ:r,rotationX:o,rotationY:i,scale:l}=t.payload,s=null!=a?a:e.translationX,c=null!=n?n:e.translationY,u=null!=r?r:e.translationZ,d=null!=o?o:e.rotationX,f=null!=i?i:e.rotationY,p=null!=l?l:e.scale;e.translationX=s,e.translationY=c,e.translationZ=u,e.rotationX=d,e.rotationY=f,e.scale=p},setAnimatedTransform:(e,t)=>{e.animatedTransform=t.payload},setTransformTime:(e,t)=>{e.transformTime=t.payload},setSpaceLocation:(e,t)=>{const a=Object.assign(Object.assign({},e),t.payload),n=Re(a);return Object.assign(Object.assign({},a),{transform:n})},viewCameraMoveForward:e=>{e.translationZ=e.translationZ+6*t.TRANSLATION_STEP*Math.cos(Ce(-e.rotationY)),e.translationX=e.translationX+6*t.TRANSLATION_STEP*Math.sin(Ce(-e.rotationY)),e.transform=Re(e)},viewCameraMoveBackward:e=>{e.translationZ=e.translationZ-6*t.TRANSLATION_STEP*Math.cos(Ce(-e.rotationY)),e.translationX=e.translationX-6*t.TRANSLATION_STEP*Math.sin(Ce(-e.rotationY)),e.transform=Re(e)},viewCameraMoveLeft:e=>{e.translationX=e.translationX+3*t.TRANSLATION_STEP*Math.cos(Ce(e.rotationY)),e.translationZ=e.translationZ+3*t.TRANSLATION_STEP*Math.sin(Ce(e.rotationY)),e.transform=Re(e)},viewCameraMoveRight:e=>{e.translationX=e.translationX-3*t.TRANSLATION_STEP*Math.cos(Ce(e.rotationY)),e.translationZ=e.translationZ-3*t.TRANSLATION_STEP*Math.sin(Ce(e.rotationY)),e.transform=Re(e)},viewCameraMoveUp:e=>{e.translationY=e.translationY+3*t.TRANSLATION_STEP,e.transform=Re(e)},viewCameraMoveDown:e=>{e.translationY=e.translationY-3*t.TRANSLATION_STEP,e.transform=Re(e)},viewCameraTurnUp:e=>{e.rotationX=(e.rotationX+t.ROTATION_STEP)%360,e.transform=Re(e)},viewCameraTurnDown:e=>{e.rotationX=(e.rotationX-t.ROTATION_STEP)%360,e.transform=Re(e)},viewCameraTurnLeft:e=>{e.rotationY=(e.rotationY-t.ROTATION_STEP)%360,e.transform=Re(e)},viewCameraTurnRight:e=>{e.rotationY=(e.rotationY+t.ROTATION_STEP)%360,e.transform=Re(e)},rotateUp:e=>{e.rotationX=(e.rotationX+t.ROTATION_STEP)%360,e.transform=Re(e)},rotateDown:e=>{e.rotationX=(e.rotationX-t.ROTATION_STEP)%360,e.transform=Re(e)},rotateX:(e,t)=>{e.rotationX=t.payload,e.transform=Re(e)},rotateXWith:(e,t)=>{e.rotationX=e.rotationX+t.payload,e.transform=Re(e)},rotateLeft:e=>{e.rotationY=(e.rotationY+t.ROTATION_STEP)%360,e.transform=Re(e)},rotateRight:e=>{e.rotationY=(e.rotationY-t.ROTATION_STEP)%360,e.transform=Re(e)},rotateY:(e,t)=>{e.rotationY=t.payload,e.transform=Re(e)},rotateYWith:(e,t)=>{e.rotationY=e.rotationY+t.payload,e.transform=Re(e)},translateUp:e=>{e.translationY=e.translationY-t.TRANSLATION_STEP,e.transform=Re(e)},translateDown:e=>{e.translationY=e.translationY+t.TRANSLATION_STEP,e.transform=Re(e)},translateLeft:e=>{e.translationX=e.translationX-t.TRANSLATION_STEP*Math.cos(Ce(e.rotationY)),e.translationZ=e.translationZ-t.TRANSLATION_STEP*Math.sin(Ce(e.rotationY)),e.transform=Re(e)},translateRight:e=>{e.translationX=e.translationX+t.TRANSLATION_STEP*Math.cos(Ce(e.rotationY)),e.translationZ=e.translationZ+t.TRANSLATION_STEP*Math.sin(Ce(e.rotationY)),e.transform=Re(e)},translateIn:e=>{e.translationZ=e.translationZ-3*t.TRANSLATION_STEP*Math.cos(Ce(-e.rotationY)),e.translationX=e.translationX-3*t.TRANSLATION_STEP*Math.sin(Ce(-e.rotationY)),e.transform=Re(e)},translateOut:e=>{e.translationZ=e.translationZ+3*t.TRANSLATION_STEP*Math.cos(Ce(-e.rotationY)),e.translationX=e.translationX+3*t.TRANSLATION_STEP*Math.sin(Ce(-e.rotationY)),e.transform=Re(e)},translateXWith:(e,t)=>{e.translationX=e.translationX+t.payload*Math.cos(Ce(e.rotationY)),e.translationZ=e.translationZ+t.payload*Math.sin(Ce(e.rotationY)),e.transform=Re(e)},translateYWith:(e,t)=>{e.translationY=e.translationY+t.payload,e.transform=Re(e)},translateZWith:(e,t)=>{e.translationZ=e.translationZ+t.payload,e.transform=Re(e)},scaleUp:e=>{const a=e.scale+t.SCALE_STEP,n=a<t.SCALE_UPPER_LIMIT?a:t.SCALE_UPPER_LIMIT;e.scale=n,e.transform=Re(e)},scaleDown:e=>{const a=e.scale-t.SCALE_STEP,n=a>t.SCALE_LOWER_LIMIT?a:t.SCALE_LOWER_LIMIT;e.scale=n,e.transform=Re(e)},scaleUpWith:(e,a)=>{const n=e.scale+Math.abs(a.payload),r=n<t.SCALE_UPPER_LIMIT?n:t.SCALE_UPPER_LIMIT;e.scale=r,e.transform=Re(e)},scaleDownWith:(e,a)=>{const n=e.scale-Math.abs(a.payload),r=n>t.SCALE_LOWER_LIMIT?n:t.SCALE_LOWER_LIMIT;e.scale=r,e.transform=Re(e)},setTree:(e,t)=>{e.tree=[...t.payload]},setActiveUniverse:(e,t)=>{e.activeUniverseID=t.payload},spaceResetTransform:e=>{e.scale=1,e.rotationX=0,e.rotationY=0,e.translationX=0,e.translationY=0,e.translationZ=0,e.transform=Re(e)},setViewSize:(e,t)=>{e.viewSize=t.payload},setSpaceSize:(e,t)=>{e.spaceSize=t.payload},updateSpaceTreePlane:(e,t)=>{const n=a.general.tree.updateTreePlane(e.tree,t.payload);e.tree=n},updateSpaceLinkCoordinates:(e,t)=>{const{planeID:n,linkCoordinates:r}=t.payload,o=a.general.tree.updateTreeByPlaneIDWithLinkCoordinates(e.tree,n,r);e.tree=o},spaceSetView:(e,t)=>{e.view=t.payload},spaceSetCulledView:(e,t)=>{e.culledView=t.payload},removePlane:(e,t)=>{const n=a.space.tree.logic.removePlaneFromTree(l.objects.clone(e.tree),t.payload);e.tree=n}}}),_e=ye.actions,Le=ye.reducer;var Ae=Object.freeze({__proto__:null,name:Oe,space:ye,actions:_e,selectors:Ie,reducer:Le});const Ue={general:s.plurid,interaction:s.plurid},De=i.createSlice({name:"themes",initialState:Ue,reducers:{setGeneralTheme:(e,t)=>{e.general=t.payload},setInteractionTheme:(e,t)=>{e.interaction=t.payload}}}),xe=De.actions,Ne=e=>e.themes.general,Me=e=>e.themes.general,ke={getGeneralTheme:Ne,getInteractionTheme:Me},Fe=De.reducer;var Be=Object.freeze({__proto__:null,themes:De,actions:xe,getGeneralTheme:Ne,getInteractionTheme:Me,selectors:ke,reducer:Fe});const Ye=i.createSlice({name:"ui",initialState:{toolbarScrollPosition:0},reducers:{setUIToolbarScrollPosition:(e,t)=>{e.toolbarScrollPosition=t.payload}}}),$e=Ye.actions,Xe=e=>e.ui.toolbarScrollPosition,Ve={getToolbarScrollPosition:Xe},ze=Ye.reducer;var Ke={configuration:K,general:q,shortcuts:ne,space:Ae,themes:Be,ui:Object.freeze({__proto__:null,ui:Ye,actions:$e,getToolbarScrollPosition:Xe,selectors:Ve,reducer:ze})};const Ze=i.combineReducers({configuration:Ke.configuration.reducer,general:Ke.general.reducer,shortcuts:Ke.shortcuts.reducer,space:Ke.space.reducer,themes:Ke.themes.reducer,ui:Ke.ui.reducer}),je=e=>i.configureStore({preloadedState:e,reducer:Ze,devTools:!1}),Ge=x.default.createContext({});function We(e,t,a,n){return new(a||(a=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(i,l)}s((n=n.apply(e,t||[])).next())}))}const He=x.default.createContext(null);var qe={configuration:Ke.configuration.actions,general:Ke.general.actions,shortcuts:Ke.shortcuts.actions,space:Ke.space.actions,themes:Ke.themes.actions,ui:Ke.ui.actions};const{quaternion:Je,transform:Qe,matrix:et}=a.interaction,{degToRad:tt,radToDeg:at}=Je,{multiplyMatricesArray:nt,translateMatrix:rt,rotateYMatrix:ot,matrixToCSSMatrix:it,arrayToMatrix:lt,inverseMatrix:st}=Qe.general,{getTransformRotate:ct,getTransformTranslate:ut,getTransformScale:dt}=Qe.matrix3d,{rotateMatrix:ft,translateMatrix:pt,scaleMatrix:mt,multiplyArrayOfMatrices:gt}=et,ht=(e,t,n,r="origin")=>{const o=a.general.configuration.merge(t),i=n||[],l=[];for(const e of i)if("string"==typeof e){const t=a.routing.resolveRoute(e);if(!t)continue;l.push(t.route)}const s=new de(e,r).getAll();return{computedTree:new a.space.tree.Tree({planes:s,configuration:o,view:l},r).compute(),appConfiguration:o}},Tt=(()=>{let e;return a=>{const n=e=>a(qe.space.setAnimatedTransform(e));n(!0),e&&clearTimeout(e),e=setTimeout((()=>{n(!1)}),t.PLURID_DEFAULT_ANIMATED_TRANSFORM_TIMEOUT)}})(),Et=(e,a,n,r=!0)=>{if(n&&(n.ctrlKey||n.metaKey))return;if(!a)return;const o=t=>e(qe.space.setSpaceField(t)),{matrix3d:i,transform:l}=(e=>{const{location:t}=e,{translateX:a,translateY:n,translateZ:r,rotateY:o}=t;return{transform:(()=>{const e="undefined"==typeof window?720:window.innerWidth/2,t="undefined"==typeof window?400:window.innerHeight/2,i=-1*a+e,l=-1*n+t,s=-1*r,c=ft(0,tt(o)),u=pt(a,n,r),d=mt(1),f=gt([u,pt(i,l,s),c,pt(-i,-l,-s),d]),p=st(lt(f)),m=it(p),g=ct(m),h=ut(m),T=dt(m);return{translationX:h.translateX,translationY:h.translateY,translationZ:h.translateZ,rotationX:at(g.rotateX),rotationY:at(g.rotateY),scale:T.scale}})(),matrix3d:(()=>{const t=o<100?1:-1,i=o<100?-1:1,l=o<100&&e.parentPlaneID?200:0,s=nt([rt(-a,-n,t*r),ot(tt(o)),rt(a,n,i*r),rt(-(a+l),-n,t*r)]);return it(s)})()}})(a);var s;Tt(e),o({field:"transform",value:i}),s=Object.assign({},l),e(qe.space.setTransform(s)),r&&o({field:"isolatePlane",value:""}),setTimeout((()=>{(e=>{const a=`[id='${e+t.FOCUS_ANCHOR_SUFFIX}']`,n=document.querySelector(a);n&&n.focus()})(a.planeID),o({field:"activePlaneID",value:a.planeID})}),t.PLURID_DEFAULT_ANIMATED_TRANSFORM_TIMEOUT)},vt=e=>{const{activePlaneID:t,tree:n}=e.space;if(!t)return;return a.space.tree.logic.getTreePlaneByID(n,t)},St=(e,t,a)=>{for(const[n,r]of e.entries()){if(r.planeID===t)return null!=a?a:n;if(r.children){const e=St(r.children,t,n);if("number"==typeof e)return e}}},Pt=(e,t,a)=>{const{activePlaneID:n,tree:r}=t.space,o=St(r,n);if("number"!=typeof o)return;let i=r["previous"===a?o-1||0:o+1];(i||(i="previous"===a?r[r.length-1]:r[0],i))&&Et(e,i,void 0,!0)},bt=(e,t)=>{Pt(e,t,"previous")},Rt=(e,t)=>{Pt(e,t,"next")},It=(e,t,a)=>{const{tree:n}=t.space,r=n[a];r&&Et(e,r,void 0,!0)},Ct=(e,n,r,o,i,s)=>{if(o.defaultPrevented)return;if(l.dom.verifyPathInputElement(l.dom.getEventPath(o)))return;const c=!(o.shiftKey||o.altKey||o.ctrlKey||o.metaKey),u=()=>{o.preventDefault()};if("KeyF"===o.code&&c)return u(),e(qe.configuration.toggleConfigurationSpaceFirstPerson());if(i){if("KeyW"===o.code&&c&&s.translationZ)return u(),e(qe.space.viewCameraMoveForward());if("KeyS"===o.code&&c&&s.translationZ)return u(),e(qe.space.viewCameraMoveBackward());if("KeyA"===o.code&&c&&s.translationX)return u(),e(qe.space.viewCameraMoveLeft());if("KeyA"===o.code&&o.shiftKey&&s.rotationY)return u(),e(qe.space.viewCameraTurnLeft());if("KeyD"===o.code&&c&&s.translationX)return u(),e(qe.space.viewCameraMoveRight());if("KeyD"===o.code&&o.shiftKey&&s.rotationY)return u(),e(qe.space.viewCameraTurnRight());if("KeyQ"===o.code&&c&&s.rotationX)return u(),e(qe.space.viewCameraTurnUp());if("KeyZ"===o.code&&c&&s.rotationX)return u(),e(qe.space.viewCameraTurnDown());if("KeyE"===o.code&&c&&s.translationY)return u(),e(qe.space.viewCameraMoveUp());if("KeyC"===o.code&&c&&s.translationY)return u(),e(qe.space.viewCameraMoveDown())}if("KeyR"===o.code&&c)return u(),e(qe.configuration.setConfigurationSpaceTransformMode(t.TRANSFORM_MODES.ROTATION));if("KeyT"===o.code&&c)return u(),e(qe.configuration.setConfigurationSpaceTransformMode(t.TRANSFORM_MODES.TRANSLATION));if("KeyS"===o.code&&c&&!i)return u(),e(qe.configuration.setConfigurationSpaceTransformMode(t.TRANSFORM_MODES.SCALE));if("ArrowRight"===o.key){if(o.shiftKey&&s.rotationY)return u(),e(qe.space.rotateLeft());if(o.altKey&&s.translationX)return u(),e(qe.space.translateRight())}if("ArrowLeft"===o.key){if(o.shiftKey&&s.rotationY)return u(),e(qe.space.rotateRight());if(o.altKey&&s.translationX)return u(),e(qe.space.translateLeft())}if("ArrowUp"===o.key){if(o.shiftKey&&o.altKey&&s.translationZ)return u(),e(qe.space.translateIn());if(o.shiftKey&&!o.altKey&&s.rotationX)return u(),e(qe.space.rotateUp());if(o.altKey&&!o.shiftKey&&s.translationY)return u(),e(qe.space.translateUp());if(o.metaKey||o.ctrlKey&&s.scale)return u(),e(qe.space.scaleUp())}if("ArrowDown"===o.key){if(o.shiftKey&&o.altKey&&s.translationZ)return u(),e(qe.space.translateOut());if(o.shiftKey&&!o.altKey&&s.rotationX)return u(),e(qe.space.rotateDown());if(o.altKey&&!o.shiftKey&&s.translationY)return u(),e(qe.space.translateDown());if(o.metaKey||o.ctrlKey&&s.scale)return u(),e(qe.space.scaleDown())}if(o.altKey&&"KeyF"===o.code)return u(),void((e,t)=>{const a=vt(t);if(!a)return;Et(e,a,void 0,!1)})(e,n);if(o.altKey&&"KeyB"===o.code)return u(),void((e,t)=>{const n=vt(t);if(!n||!n.parentPlaneID)return;const r=a.space.tree.logic.getTreePlaneByID(t.space.tree,n.parentPlaneID);r&&Et(e,r)})(e,n);if(o.altKey&&"KeyR"===o.code)return u(),void((e,a)=>{const{activePlaneID:n}=e.space;n&&a.publish({topic:t.PLURID_PUBSUB_TOPIC.REFRESH_PLANE,data:{id:n}})})(n,r);if(o.altKey&&"KeyE"===o.code)return u(),void((e,a)=>{const{activePlaneID:n,isolatePlane:r}=e.space;r?a.publish({topic:t.PLURID_PUBSUB_TOPIC.ISOLATE_PLANE,data:{id:""}}):n&&a.publish({topic:t.PLURID_PUBSUB_TOPIC.ISOLATE_PLANE,data:{id:n}})})(n,r);if(o.altKey&&o.shiftKey&&"KeyT"===o.code)return u(),void(e=>{e.publish({topic:t.PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE})})(r);if(o.altKey&&"KeyW"===o.code)return u(),void((e,a)=>{const{activePlaneID:n}=e.space;n&&a.publish({topic:t.PLURID_PUBSUB_TOPIC.CLOSE_PLANE,data:{id:n}})})(n,r);if(o.altKey&&"KeyA"===o.code)return u(),void bt(e,n);if(o.altKey&&"KeyD"===o.code)return u(),void Rt(e,n);if(o.altKey&&"Tab"===o.code)return u(),void(o.shiftKey?bt(e,n):Rt(e,n));if(o.altKey&&o.code.startsWith("Digit")){u();const t=parseInt(o.code.replace("Digit",""))-1;It(e,n,t)}else;},wt=()=>We(void 0,void 0,void 0,(function*(){return yield Promise.resolve().then((function(){return function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}(U.default)}))}));var Ot={configuration:Ke.configuration.selectors,general:Ke.general.selectors,shortcuts:Ke.shortcuts.selectors,space:Ke.space.selectors,themes:Ke.themes.selectors,ui:Ke.ui.selectors};const yt=c.createGlobalStyle`
|
|
2
2
|
*,
|
|
3
3
|
*:after,
|
|
4
4
|
*:before {
|
|
@@ -11,25 +11,16 @@
|
|
|
11
11
|
margin: 0;
|
|
12
12
|
height: 100%;
|
|
13
13
|
width: 100%;
|
|
14
|
+
overscroll-behavior-x: ${({preventOverscroll:e})=>e?"none":"auto"};
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
html {
|
|
17
18
|
overflow: hidden;
|
|
18
19
|
background: black;
|
|
19
20
|
color: white;
|
|
20
|
-
font-family:
|
|
21
|
-
'Open Sans', 'Helvetica Neue', 'Lucida Sans', sans-serif;
|
|
22
|
-
|
|
23
|
-
/*
|
|
24
|
-
* HACK
|
|
25
|
-
* Prevents Chrome from going backward/forward in page history on wheel event.
|
|
26
|
-
*
|
|
27
|
-
* TODO
|
|
28
|
-
* Apply it dinamically.
|
|
29
|
-
*/
|
|
30
|
-
overscroll-behavior-x: contain;
|
|
21
|
+
font-family: ${({theme:e})=>e.fontFamilySansSerif}
|
|
31
22
|
}
|
|
32
|
-
`,
|
|
23
|
+
`,_t=M.default.div`
|
|
33
24
|
height: 100%;
|
|
34
25
|
min-height: ${e=>e.fullHeight?"100vh":"100%"};
|
|
35
26
|
min-height: ${e=>e.fullHeight?"-webkit-fill-available":"100%"};
|
|
@@ -40,15 +31,15 @@
|
|
|
40
31
|
outline: none;
|
|
41
32
|
overflow: hidden;
|
|
42
33
|
|
|
43
|
-
cursor: ${
|
|
34
|
+
cursor: ${e=>e.transformMode===t.TRANSFORM_MODES.TRANSLATION||e.transformMode===t.TRANSFORM_MODES.ROTATION?"all-scroll":e.transformMode===t.TRANSFORM_MODES.SCALE?"ns-resize":"initial"};
|
|
44
35
|
user-select: ${e=>"ALL"!==e.transformMode?"none":"initial !important"};
|
|
45
36
|
touch-action: ${e=>"ALL"!==e.transformMode?"none !important":"initial !important"};
|
|
46
37
|
-webkit-user-drag: ${e=>"ALL"!==e.transformMode?"none":"initial !important"};
|
|
47
38
|
-webkit-tap-highlight-color: ${e=>"ALL"!==e.transformMode?"rgba(0, 0, 0, 0)":"initial !important"};
|
|
48
|
-
`;
|
|
39
|
+
`;M.default.div`
|
|
49
40
|
outline: none;
|
|
50
41
|
background: ${e=>{if(e.opaque){return`radial-gradient(\n ellipse at center,\n ${"dark"===e.theme.type?e.theme.backgroundColorTertiary:e.theme.backgroundColorPrimary} 0%,\n ${"dark"===e.theme.type?e.theme.backgroundColorPrimary:e.theme.backgroundColorTertiary} 100%)\n `}return"transparent"}};
|
|
51
|
-
`;class
|
|
42
|
+
`;class Lt extends x.default.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){}render(){return this.state.hasError?this.props.renderError?this.props.renderError:x.default.createElement("h1",null,"Something went wrong."):this.props.children}}const At=M.default.div`
|
|
52
43
|
background-color: ${({transparentUI:e,mouseOver:t,theme:a,planeOpacity:n})=>{if(e&&!t)return a.backgroundColorPrimaryAlpha;if(1!==n){const e=s.decomposeColor(a.backgroundColorPrimary);if(e){return`hsla(${e.hue}, ${e.saturation}%, ${e.lightness}%, ${n})`}return"transparent"}return a.backgroundColorPrimary}};
|
|
53
44
|
box-shadow: ${({planeOpacity:e,theme:t})=>0===e?"none":t.boxShadowUmbra};
|
|
54
45
|
color: ${({theme:e})=>e.colorPrimary};
|
|
@@ -59,8 +50,7 @@
|
|
|
59
50
|
height: auto;
|
|
60
51
|
width: 100%;
|
|
61
52
|
font-size: 0.9rem;
|
|
62
|
-
font-family:
|
|
63
|
-
'Open Sans', 'Helvetica Neue', 'Lucida Sans', sans-serif;
|
|
53
|
+
font-family: ${({theme:e})=>e.fontFamilySansSerif};
|
|
64
54
|
transition: background-color 300ms linear;
|
|
65
55
|
|
|
66
56
|
display: grid;
|
|
@@ -68,8 +58,16 @@
|
|
|
68
58
|
grid-template-rows: ${({planeControls:e})=>e?"56px auto":"auto"};
|
|
69
59
|
|
|
70
60
|
transform-origin: 0 0 0;
|
|
71
|
-
`,
|
|
72
|
-
|
|
61
|
+
`,Ut=M.default.a`
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 0;
|
|
64
|
+
left: 0;
|
|
65
|
+
height: 0;
|
|
66
|
+
width: 0;
|
|
67
|
+
pointer-events: none;
|
|
68
|
+
user-select: none;
|
|
69
|
+
`,Dt=M.default.div`
|
|
70
|
+
background-color: ${({theme:e,planeControls:t,planeOpacity:a,transparentUI:n,mouseOver:r})=>n&&!r?e.backgroundColorPrimaryAlpha:0===a?"transparent":t?e.backgroundColorDark:e.backgroundColorPrimary};
|
|
73
71
|
|
|
74
72
|
position: absolute;
|
|
75
73
|
top: 0;
|
|
@@ -77,7 +75,11 @@
|
|
|
77
75
|
height: 30px;
|
|
78
76
|
width: 100px;
|
|
79
77
|
opacity: 0.5;
|
|
80
|
-
|
|
78
|
+
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
`,xt=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateConfiguration:Ot.configuration.getConfiguration(e)})),(e=>({})),null,{context:Ge})((e=>{const{mouseOver:a,stateGeneralTheme:n,stateConfiguration:r}=e,{controls:o,opacity:i}=r.elements.plane,{transparentUI:l}=r.global;return x.default.createElement(Dt,{theme:n,planeControls:o.show,planeOpacity:i,transparentUI:l,mouseOver:a,"data-plurid-entity":t.PLURID_ENTITY_PLANE_BRIDGE})})),Nt=e=>{const{theme:t,refreshing:a,refreshPlane:n}=e;return x.default.createElement(d.PluridIconReset,{atClick:()=>{n()},theme:t,title:"refresh",style:{opacity:a?"0":"1",pointerEvents:a?"none":void 0}})},Mt=e=>{const{theme:t,isolated:a,isolatePlane:n}=e,r=a?"isolated":"isolate",o=!!a;return x.default.createElement(d.PluridIconRectangle,{atClick:()=>{n()},theme:t,title:r,fill:o})},kt=M.default.div`
|
|
81
83
|
background-color: ${({transparentUI:e,mouseOver:t,theme:a})=>e&&!t?"transparent":a.backgroundColorDark};
|
|
82
84
|
box-shadow: ${({theme:e})=>e.boxShadowUmbraInset};
|
|
83
85
|
|
|
@@ -92,35 +94,54 @@
|
|
|
92
94
|
@media (max-width: 800px) {
|
|
93
95
|
grid-template-columns: 1fr 3fr 1fr;
|
|
94
96
|
}
|
|
95
|
-
`,
|
|
96
|
-
|
|
97
|
+
`,Ft=c.css`
|
|
98
|
+
margin: 0 1rem;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 1rem;
|
|
102
|
+
`,Bt=M.default.div`
|
|
103
|
+
${Ft}
|
|
104
|
+
`,Yt=M.default.div`
|
|
97
105
|
width: 100%;
|
|
98
|
-
height: 38px;
|
|
99
106
|
position: relative;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
word-break: break-all;
|
|
111
|
+
`,$t=M.default.div`
|
|
112
|
+
${Ft}
|
|
113
|
+
justify-content: right;
|
|
114
|
+
`,Xt=o.connect((e=>({configuration:Ot.configuration.getConfiguration(e),stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e),stateIsolatePlane:Ot.space.getIsolatePlane(e)})),(e=>({dispatch:e})),null,{context:Ge})((e=>{const{plane:a,treePlane:n,parentTreePlane:o,mouseOver:i,refreshing:l,refreshPlane:s,isolatePlane:c,closePlane:u,configuration:f,stateGeneralTheme:p,stateIsolatePlane:m,dispatch:g}=e,{global:h,elements:T}=f,{transparentUI:E}=h,{title:v,pathbar:S}=T.plane.controls,{planeID:P,route:b,routeDivisions:R}=n,{protocol:I,host:C}=R;C.value,encodeURIComponent(b);const w=m===P,[O,y]=r.useState(n.route);return r.useState(!1),r.useState(!1),x.default.createElement(kt,{theme:p,mouseOver:i,transparentUI:E,"data-plurid-entity":t.PLURID_ENTITY_PLANE_CONTROLS},x.default.createElement(Bt,null,o&&x.default.createElement(d.PluridIconArrowLeft,{atClick:e=>{Et(g,o,e)},theme:p,title:"back"}),x.default.createElement(d.PluridIconFrame,{atClick:e=>{Et(g,n,e,!1)},theme:p,title:"focus"}),x.default.createElement(Nt,{theme:p,refreshing:l,refreshPlane:s}),x.default.createElement(Mt,{theme:p,isolated:w,isolatePlane:c})),x.default.createElement(Yt,null,v&&x.default.createElement(x.default.Fragment,null,O)),x.default.createElement($t,null,x.default.createElement(d.PluridIconDelete,{atClick:()=>{u()},theme:p,title:"close"})))})),Vt=M.default.div`
|
|
105
115
|
position: relative;
|
|
106
|
-
|
|
107
|
-
font-size: initial !important;
|
|
108
|
-
`,Zt=t=>{const{children:a}=t,r=n.useRef(null);return _.default.createElement(zt,{ref:r,"data-plurid-entity":e.PLURID_ENTITY_PLANE_CONTENT},a)},Kt=r.connect((e=>({stateViewSize:Mt.space.getViewSize(e),stateGeneralTheme:Mt.themes.getGeneralTheme(e),stateConfiguration:Mt.configuration.getConfiguration(e)})),(e=>({dispatchUpdateSpaceTreePlane:t=>e(yt.space.updateSpaceTreePlane(t))})),null,{context:Ut})((a=>{const{planeID:r,plane:o,treePlane:i,children:s,stateViewSize:c,stateGeneralTheme:u,stateConfiguration:d,dispatchUpdateSpaceTreePlane:T}=a,{global:p,elements:f}=d,{transparentUI:E}=p,{controls:m,width:g,opacity:O}=f.plane,h=m.show;l.mathematics.numbers.checkIntegerNonUnit(g)||c.width;const S=n.useContext(Pt);if(!S)return _.default.createElement(_.default.Fragment,null);const{planeRenderError:R}=S,[A,I]=n.useState(!1),C={};return _.default.createElement(jt,{suppressHydrationWarning:!0,theme:u,planeControls:h,planeOpacity:O,show:i.show,id:r,style:{width:"100%",transform:t.cleanTemplate(`\n translateX(${i.location.translateX}px)\n translateY(${i.location.translateY}px)\n translateZ(${i.location.translateZ}px)\n rotateX(${i.location.rotateX}deg)\n rotateY(${i.location.rotateY}deg)\n `)},onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),transparentUI:E,mouseOver:A,"data-plurid-plane":r,"data-plurid-entity":e.PLURID_ENTITY_PLANE},i.show&&_.default.createElement(_.default.Fragment,null,i.parentPlaneID&&_.default.createElement(kt,null),h&&_.default.createElement(Xt,{plane:o,treePlane:i,mouseOver:A}),R?_.default.createElement(Gt,{renderError:"boolean"!=typeof R?R:void 0},_.default.createElement(Zt,Object.assign({},C),s)):_.default.createElement(Zt,Object.assign({},C),s)))})),qt=S.default.div`
|
|
116
|
+
`,zt=e=>{const{children:a}=e,n=r.useRef(null);return x.default.createElement(Vt,{ref:n,"data-plurid-entity":t.PLURID_ENTITY_PLANE_CONTENT},a)},Kt=o.connect((e=>({stateTree:Ot.space.getTree(e),stateViewSize:Ot.space.getViewSize(e),stateActivePlaneID:Ot.space.getActivePlaneID(e),stateIsolatePlane:Ot.space.getIsolatePlane(e),stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateConfiguration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchSetSpaceField:t=>e(qe.space.setSpaceField(t)),dispatchUpdateSpaceTreePlane:t=>e(qe.space.updateSpaceTreePlane(t))})),null,{context:Ge})((e=>{const n=r.useContext(He);if(!n)return x.default.createElement(x.default.Fragment,null);const{planeRenderError:o,defaultPubSub:i}=n,{planeID:s,plane:c,treePlane:d,children:f,stateTree:p,stateViewSize:m,stateActivePlaneID:g,stateIsolatePlane:h,stateGeneralTheme:T,stateConfiguration:E,dispatchSetSpaceField:v,dispatchUpdateSpaceTreePlane:S}=e,{global:P,elements:b}=E,{transparentUI:R}=P,{controls:I,width:C,opacity:w}=b.plane,O=I.show;l.mathematics.numbers.checkIntegerNonUnit(C)||m.width;const y=a.space.tree.logic.getTreePlaneByID(p,d.parentPlaneID),_=r.useRef(null),[L,A]=r.useState(0),[U,D]=r.useState(!1),[N,M]=r.useState(!1),k=()=>{D(!0),setTimeout((()=>{A((e=>++e)),D(!1)}),250)},F=u.useDebouncedCallback((()=>{if(g===s)return;v({field:"activePlaneID",value:s})}),500);r.useEffect((()=>{v({field:"activePlaneID",value:N?s:""})}),[s,N]),r.useEffect((()=>{const e=i.subscribe({topic:t.PLURID_PUBSUB_TOPIC.REFRESH_PLANE,callback:e=>{const{id:t}=e;t===s&&k()}});return()=>{i.unsubscribe(e)}}),[L,s]);const B=s+"-"+L,Y=s+t.FOCUS_ANCHOR_SUFFIX,$=(()=>{if(d.show&&h)return h===s?"1":"0"})(),X=(()=>{if(d.show&&h&&h!==s)return"none"})(),V=a.cleanTemplate(`\n translateX(${d.location.translateX}px)\n translateY(${d.location.translateY}px)\n translateZ(${d.location.translateZ}px)\n rotateX(${d.location.rotateX}deg)\n rotateY(${d.location.rotateY}deg)\n `),z={};return x.default.createElement(At,{key:B,ref:_,theme:T,planeControls:O,planeOpacity:w,show:d.show,id:s,style:{width:"100%",transform:V,opacity:$,pointerEvents:X},onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),onMouseOver:()=>F(),onMouseMove:()=>F(),transparentUI:R,mouseOver:N,"data-plurid-plane":s,"data-plurid-entity":t.PLURID_ENTITY_PLANE},x.default.createElement(Ut,{tabIndex:0,id:Y}),d.show&&x.default.createElement(x.default.Fragment,null,d.parentPlaneID&&x.default.createElement(xt,{mouseOver:N}),O&&x.default.createElement(Xt,{plane:c,treePlane:d,parentTreePlane:y,mouseOver:N,refreshing:U,refreshPlane:k,isolatePlane:()=>{const e=h!==s?s:"";i.publish({topic:t.PLURID_PUBSUB_TOPIC.ISOLATE_PLANE,data:{id:e}})},closePlane:()=>{i.publish({topic:t.PLURID_PUBSUB_TOPIC.CLOSE_PLANE,data:{id:s}})}}),o?x.default.createElement(Lt,{renderError:"boolean"!=typeof o?o:void 0},x.default.createElement(zt,Object.assign({},z),f)):x.default.createElement(zt,Object.assign({},z),f)))})),Zt=e=>!!e&&("string"!=typeof e&&!e.url),jt=M.default.div`
|
|
109
117
|
transform-style: preserve-3d;
|
|
110
|
-
`,
|
|
118
|
+
`,Gt=o.connect((e=>({stateTree:Ot.space.getTree(e)})),(e=>({})),null,{context:Ge})((e=>{const{plane:a,stateTree:n}=e,{location:o}=a,i=r.useContext(He);if(!i)return x.default.createElement(x.default.Fragment,null);const{planesRegistrar:l,planeContext:s,planeContextValue:c,customPlane:u,matchedRoute:d,defaultPubSub:f}=i,p=u,m=e=>{if(!e.children||0===e.children.length)return[];const t=[],a=ie(l);return e.children.forEach((e=>{if(!a)return;const n=e.sourceID,r=a.get(n);if(r){const a=()=>{const t=r.component,a={plane:{value:r.route.absolute,planeID:e.planeID,parentPlaneID:e.parentPlaneID,fragments:r.route.fragments,parameters:r.route.parameters,query:r.route.query},route:{value:(null==d?void 0:d.match.value)||"",parameters:(null==d?void 0:d.match.parameters)||{},query:(null==d?void 0:d.match.query)||{}},pubSub:f},n={plurid:Object.assign({},a),key:"plurid-plane-"+e.planeID},o=Zt(t),i=Zt(p),l={key:"plurid-plane-child-"+e.planeID,plane:r,treePlane:e,planeID:e.planeID,location:e.location};return p&&i?x.default.createElement(p,Object.assign({},l)):o?x.default.createElement(Kt,Object.assign({},l),s?x.default.createElement(s.Provider,{value:c},x.default.createElement(t,Object.assign({},n))):x.default.createElement(t,Object.assign({},n))):x.default.createElement(x.default.Fragment,null)},n=a();t.push(n)}if(e.children){const a=m(e);a&&t.push(...a)}})),t},g=r.useMemo((()=>m(a)),[JSON.stringify(a),JSON.stringify(n)]),h=a.sourceID;if(!h)return x.default.createElement(x.default.Fragment,null);const T=se(h,l);if(!T)return x.default.createElement(x.default.Fragment,null);const E=T.component,v={plane:{value:T.route.absolute,planeID:a.planeID,parentPlaneID:a.parentPlaneID,fragments:T.route.fragments,parameters:T.route.parameters,query:T.route.query},route:{value:(null==d?void 0:d.match.value)||"",parameters:(null==d?void 0:d.match.parameters)||{},query:(null==d?void 0:d.match.query)||{}},pubSub:f},S={plurid:Object.assign({},v),key:"plurid-plane-"+a.planeID};return p?"function"!=typeof p?x.default.createElement(x.default.Fragment,null):x.default.createElement(jt,{"data-plurid-entity":t.PLURID_ENTITY_ROOT},x.default.createElement(p,{plane:T,treePlane:a,planeID:a.planeID,location:o}),g):x.default.createElement(jt,{"data-plurid-entity":t.PLURID_ENTITY_ROOT},x.default.createElement(Kt,{plane:T,treePlane:a,planeID:a.planeID,location:o},s?x.default.createElement(s.Provider,{value:c},x.default.createElement(E,Object.assign({},S))):x.default.createElement(E,Object.assign({},S))),g)})),Wt=M.default.div`
|
|
111
119
|
transform-style: preserve-3d;
|
|
112
|
-
|
|
120
|
+
transform-origin: 0 0 0;
|
|
121
|
+
`,Ht=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e),spaceTransformMatrix:Ot.space.getTransformMatrix(e),spaceAnimatedTransform:Ot.space.getAnimatedTransform(e),spaceTransformTime:Ot.space.getTransformTime(e),stateTree:Ot.space.getTree(e),stateResolvedLayout:Ot.space.getResolvedLayout(e)})),(e=>({})),null,{context:Ge})((e=>{const{spaceTransformMatrix:a,spaceAnimatedTransform:n,spaceTransformTime:r,stateTree:o,stateResolvedLayout:i}=e,l=i?window.innerHeight+"px":0,s=n?`transform ${r}ms ease-in-out`:"initial";return x.default.createElement(Wt,{style:{width:"100%",height:l,transition:s,transform:a},"data-plurid-entity":t.PLURID_ENTITY_ROOTS},o.map((e=>x.default.createElement(Gt,{key:e.planeID,plane:e}))))})),qt=M.default.div`
|
|
122
|
+
position: relative;
|
|
123
|
+
height: 100%;
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
perspective: 2000px;
|
|
126
|
+
outline: none;
|
|
127
|
+
transition: opacity ${({fadeInTime:e})=>e}ms linear;
|
|
128
|
+
|
|
129
|
+
background: ${({opaque:e,theme:t})=>{if(e){return`radial-gradient(\n ellipse at center,\n ${"dark"===t.type?t.backgroundColorTertiary:t.backgroundColorPrimary} 0%,\n ${"dark"===t.type?t.backgroundColorPrimary:t.backgroundColorTertiary} 100%)\n `}return"transparent"}};
|
|
130
|
+
`,Jt=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e),stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateResolvedLayout:Ot.space.getResolvedLayout(e)})),(e=>({})),null,{context:Ge})((e=>{const{stateConfiguration:a,stateGeneralTheme:n,stateResolvedLayout:o}=e,{space:i}=a,{opaque:l,fadeInTime:s}=i,[c,u]=r.useState(!1);return r.useEffect((()=>{u(!0)}),[]),x.default.createElement(qt,{theme:n,opaque:l,isMounted:c,fadeInTime:s,"data-plurid-entity":t.PLURID_ENTITY_SPACE,style:{opacity:o?1:0}},x.default.createElement(Ht,null))})),Qt=({size:e})=>{switch(e){case t.SIZES.SMALL:return"5px";case t.SIZES.NORMAL:return"10px";case t.SIZES.LARGE:return"15px";default:return"10px"}},ea=M.default.div`
|
|
113
131
|
background-color: ${({theme:e})=>e.backgroundColorTertiaryAlpha};
|
|
114
|
-
height: ${
|
|
115
|
-
width: ${
|
|
132
|
+
height: ${Qt};
|
|
133
|
+
width: ${Qt};
|
|
116
134
|
|
|
117
135
|
position: absolute;
|
|
118
|
-
|
|
136
|
+
top: 50%;
|
|
137
|
+
left: 50%;
|
|
138
|
+
transform: translateX(-50%) translateY(-50%);
|
|
139
|
+
z-index: 99999;
|
|
119
140
|
border-radius: 100px;
|
|
120
141
|
user-select: none;
|
|
121
142
|
pointer-events: none;
|
|
122
143
|
touch-action: none;
|
|
123
|
-
`,
|
|
144
|
+
`,ta=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e),stateConfiguration:Ot.configuration.getConfiguration(e)})),(e=>({})),null,{context:Ge})((e=>{const{stateGeneralTheme:a,stateConfiguration:n}=e,{space:r}=n,{transformOrigin:o}=r,{show:i,size:l}=o;return i?x.default.createElement(ea,{theme:a,size:l,"data-plurid-entity":t.PLURID_ENTITY_TRANSFORM_ORIGIN}):x.default.createElement(x.default.Fragment,null)})),aa=c.keyframes`
|
|
124
145
|
from {
|
|
125
146
|
opacity: 0%;
|
|
126
147
|
}
|
|
@@ -128,23 +149,11 @@
|
|
|
128
149
|
to {
|
|
129
150
|
opacity: 100%;
|
|
130
151
|
}
|
|
131
|
-
`,
|
|
132
|
-
position: relative;
|
|
133
|
-
height: 100%;
|
|
134
|
-
overflow: hidden;
|
|
135
|
-
perspective: 2000px;
|
|
136
|
-
outline: none;
|
|
137
|
-
|
|
138
|
-
background: ${({opaque:e,theme:t})=>{if(e){return`radial-gradient(\n ellipse at center,\n ${"dark"===t.type?t.backgroundColorTertiary:t.backgroundColorPrimary} 0%,\n ${"dark"===t.type?t.backgroundColorPrimary:t.backgroundColorTertiary} 100%)\n `}return"transparent"}};
|
|
139
|
-
|
|
140
|
-
/* TOFIX */
|
|
141
|
-
/* opacity: ${({fadeInTime:e})=>e?"0":"1"};
|
|
142
|
-
animation: ${({isMounted:e,fadeInTime:t})=>e&&t?oa(t):""}; */
|
|
143
|
-
`,la=r.connect((e=>({stateConfiguration:Mt.configuration.getConfiguration(e),stateGeneralTheme:Mt.themes.getGeneralTheme(e)})),(e=>({})),null,{context:Ut})((t=>{const{stateConfiguration:a,stateGeneralTheme:r}=t,{space:o}=a,{opaque:i,fadeInTime:l}=o,[s,c]=n.useState(!1);return n.useEffect((()=>{c(!0)}),[]),_.default.createElement(ia,{theme:r,opaque:i,isMounted:s,fadeInTime:l,"data-plurid-entity":e.PLURID_ENTITY_SPACE},_.default.createElement(na,null))}));var sa;!function(e){e.NONE="NONE",e.UNIVERSES="UNIVERSES",e.MORE="MORE"}(sa||(sa={}));const ca=S.default.div`
|
|
152
|
+
`,na=e=>c.css`${aa} ${e}ms linear 100ms forwards`;var ra;!function(e){e.NONE="NONE",e.UNIVERSES="UNIVERSES",e.MORE="MORE"}(ra||(ra={}));const oa=M.default.div`
|
|
144
153
|
bottom: ${({conceal:e,mouseIn:t})=>e?t?"-5px":"-55px":"-5px"};
|
|
145
|
-
pointer-events: ${({showMenu:e})=>e!==
|
|
154
|
+
pointer-events: ${({showMenu:e})=>e!==ra.NONE?"all":"none"};
|
|
146
155
|
opacity: ${({fadeInTime:e})=>e?"0":"1"};
|
|
147
|
-
animation: ${({fadeInTime:e,isMounted:t})=>t&&e?
|
|
156
|
+
animation: ${({fadeInTime:e,isMounted:t})=>t&&e?na(e):""};
|
|
148
157
|
|
|
149
158
|
display: grid;
|
|
150
159
|
position: absolute;
|
|
@@ -153,7 +162,7 @@
|
|
|
153
162
|
height: 75px;
|
|
154
163
|
z-index: 9999;
|
|
155
164
|
transition: bottom 300ms ease-in-out;
|
|
156
|
-
`,
|
|
165
|
+
`,ia=M.default.div`
|
|
157
166
|
color: ${({theme:e})=>e.colorPrimary};
|
|
158
167
|
background-color: ${({theme:e,transparentUI:t})=>t?e.backgroundColorPrimaryAlpha:e.backgroundColorSecondary};
|
|
159
168
|
box-shadow: ${({theme:e})=>e.boxShadowUmbra};
|
|
@@ -182,11 +191,17 @@
|
|
|
182
191
|
content: '';
|
|
183
192
|
position: absolute;
|
|
184
193
|
top: 55px;
|
|
185
|
-
left: 0;
|
|
186
|
-
right: 0;
|
|
187
194
|
height: 20px;
|
|
195
|
+
left: 0;
|
|
196
|
+
right: 20%;
|
|
188
197
|
}
|
|
189
|
-
|
|
198
|
+
|
|
199
|
+
@media (max-width: 900px) {
|
|
200
|
+
:after {
|
|
201
|
+
right: 0;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
`,la=M.default.div`
|
|
190
205
|
padding: ${({button:e,showIcons:t,showTransformButtons:a})=>e||t&&!a?"0":"0 7px"};
|
|
191
206
|
background-color: ${({active:e,theme:t})=>e?t.backgroundColorTertiary:"transparent"};
|
|
192
207
|
min-width: ${({button:e})=>e?"40px":"70px"};
|
|
@@ -198,10 +213,12 @@
|
|
|
198
213
|
cursor: pointer;
|
|
199
214
|
user-select: none;
|
|
200
215
|
|
|
201
|
-
:hover {
|
|
202
|
-
|
|
216
|
+
@media (hover: hover) {
|
|
217
|
+
:hover {
|
|
218
|
+
background: ${({theme:e})=>e.backgroundColorTertiary};
|
|
219
|
+
}
|
|
203
220
|
}
|
|
204
|
-
`,
|
|
221
|
+
`,sa=M.default.div`
|
|
205
222
|
width: 40px;
|
|
206
223
|
display: grid;
|
|
207
224
|
place-content: center;
|
|
@@ -211,7 +228,7 @@
|
|
|
211
228
|
width: 15px;
|
|
212
229
|
fill: white;
|
|
213
230
|
} */
|
|
214
|
-
`,
|
|
231
|
+
`,ca=M.default.div`
|
|
215
232
|
position: absolute;
|
|
216
233
|
bottom: 75px;
|
|
217
234
|
max-height: 250px;
|
|
@@ -230,7 +247,7 @@
|
|
|
230
247
|
padding: 0;
|
|
231
248
|
list-style: none;
|
|
232
249
|
}
|
|
233
|
-
`;
|
|
250
|
+
`;M.default.div`
|
|
234
251
|
display: flex;
|
|
235
252
|
justify-content: space-between;
|
|
236
253
|
align-items: center;
|
|
@@ -239,7 +256,7 @@
|
|
|
239
256
|
margin-bottom: ${e=>e.afterline?"30px":"10px"};
|
|
240
257
|
|
|
241
258
|
${e=>e.afterline?"\n ::after {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n bottom: -15px;\n height: 1px;\n background-color: white;\n }\n ":""};
|
|
242
|
-
`;const
|
|
259
|
+
`;const ua=M.default.div`
|
|
243
260
|
max-height: 210px;
|
|
244
261
|
overflow: scroll;
|
|
245
262
|
padding: 0 5px;
|
|
@@ -254,7 +271,7 @@
|
|
|
254
271
|
h5::first-child {
|
|
255
272
|
margin-top: 0;
|
|
256
273
|
}
|
|
257
|
-
`;
|
|
274
|
+
`;M.default.li`
|
|
258
275
|
margin: 10px 0;
|
|
259
276
|
padding: 10px 20px;
|
|
260
277
|
border-radius: 100px;
|
|
@@ -267,7 +284,7 @@
|
|
|
267
284
|
background-color: ${e=>e.theme.backgroundColorTertiary};
|
|
268
285
|
box-shadow: ${e=>e.active?"inset 0px -1px 6px 0px "+e.theme.boxShadowUmbraColor:e.theme.boxShadowUmbra};
|
|
269
286
|
}
|
|
270
|
-
`;const
|
|
287
|
+
`;const da=o.connect((e=>({interactionTheme:Ot.themes.getInteractionTheme(e),activeUniverseID:Ot.space.getActiveUniverseID(e)})),(e=>({dispatchSetActiveUniverse:t=>e(qe.space.setActiveUniverse(t))})),null,{context:Ge})((e=>{const{interactionTheme:t,activeUniverseID:a,dispatchSetActiveUniverse:n}=e;return x.default.createElement(ca,{theme:t},x.default.createElement(ua,null))})),fa=M.default.div`
|
|
271
288
|
h5 {
|
|
272
289
|
font-size: 1rem;
|
|
273
290
|
margin: 0;
|
|
@@ -281,7 +298,7 @@
|
|
|
281
298
|
background-color: ${e=>e.transparentUI&&e.mouseOver?e.theme.backgroundColorSecondary:"transparent"};
|
|
282
299
|
box-shadow: ${e=>e.transparentUI&&e.mouseOver?e.theme.boxShadowUmbra:"none"};
|
|
283
300
|
color: ${e=>e.theme.colorPrimary};
|
|
284
|
-
`,
|
|
301
|
+
`,pa=M.default.div`
|
|
285
302
|
user-select: none;
|
|
286
303
|
cursor: pointer;
|
|
287
304
|
padding: 0.5rem;
|
|
@@ -292,8 +309,8 @@
|
|
|
292
309
|
:hover {
|
|
293
310
|
border-bottom: 1px solid ${e=>e.theme.colorPrimary};
|
|
294
311
|
}
|
|
295
|
-
`,
|
|
296
|
-
`,{typography:{Heading:
|
|
312
|
+
`,ma=M.default.div`
|
|
313
|
+
`,{typography:{Heading:ga}}=f.universal,ha=o.connect((e=>({interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({})),null,{context:Ge})((e=>{const{heading:t,items:a,toggled:n,toggle:o,interactionTheme:i,configuration:l}=e,{global:s}=l,{transparentUI:c}=s,[u,d]=r.useState(!1);return x.default.createElement(fa,{theme:i,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),transparentUI:c,mouseOver:u,toggled:n},x.default.createElement(pa,{theme:i,onClick:()=>o()},x.default.createElement(ga,{theme:i,type:"h5"},t)),n&&x.default.createElement(ma,null,a))})),Ta=M.default.div`
|
|
297
314
|
position: absolute;
|
|
298
315
|
bottom: 75px;
|
|
299
316
|
height: 280px;
|
|
@@ -307,7 +324,7 @@
|
|
|
307
324
|
|
|
308
325
|
background-color: ${e=>e.transparentUI?e.theme.backgroundColorPrimaryAlpha:e.theme.backgroundColorSecondary};
|
|
309
326
|
box-shadow: ${e=>e.theme.boxShadowUmbra};
|
|
310
|
-
`,
|
|
327
|
+
`,Ea=M.default.div`
|
|
311
328
|
display: flex;
|
|
312
329
|
justify-content: space-between;
|
|
313
330
|
align-items: center;
|
|
@@ -318,7 +335,7 @@
|
|
|
318
335
|
margin-bottom: ${e=>e.last?"0":e.afterline?"30px":"10px"};
|
|
319
336
|
|
|
320
337
|
${e=>e.afterline?`\n ::after {\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n bottom: -15px;\n height: 1px;\n background-color: ${e.theme?e.theme.colorPrimary:"white"};\n }\n `:""};
|
|
321
|
-
`,
|
|
338
|
+
`,va=M.default.div`
|
|
322
339
|
height: 240px;
|
|
323
340
|
overflow: scroll;
|
|
324
341
|
padding: 0 5px;
|
|
@@ -333,12 +350,12 @@
|
|
|
333
350
|
h5::first-child {
|
|
334
351
|
margin-top: 0;
|
|
335
352
|
}
|
|
336
|
-
`,{inputs:{Dropdown:Ia}}=u.universal,Ca=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e)})),(e=>({dispatchSetConfigurationThemeGeneralAction:t=>e(yt.configuration.setConfigurationThemeGeneralAction(t)),dispatchSetConfigurationThemeInteractionAction:t=>e(yt.configuration.setConfigurationThemeInteractionAction(t)),dispatchSetConfigurationLanguage:t=>e(yt.configuration.setConfigurationLanguageAction(t)),dispatchSetGeneralTheme:t=>e(yt.themes.setGeneralTheme(t)),dispatchSetInteractionTheme:t=>e(yt.themes.setInteractionTheme(t))})),null,{context:Ut})((a=>{const{stateLanguage:r,interactionTheme:o,configuration:i,dispatchSetGeneralTheme:l,dispatchSetInteractionTheme:s,dispatchSetConfigurationThemeGeneralAction:c,dispatchSetConfigurationThemeInteractionAction:u,dispatchSetConfigurationLanguage:d}=a,T=i.global.theme,[p,f]=n.useState("object"==typeof T?T.general:T),[E,m]=n.useState("object"==typeof T?T.interaction:T);return n.useEffect((()=>{"object"==typeof T?(f(T.general),m(T.interaction)):(f(T),m(T))}),[T]),_.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerGlobalGeneralTheme),_.default.createElement(Ia,{selectables:Object.keys(h.default),selected:"string"==typeof p?p:"",atSelect:e=>(e=>{l(h.default[e]),c(e)})(e),theme:o,filterable:!0,heightItems:3,width:90,style:{fontSize:"0.8rem"}})),_.default.createElement(Ra,null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerGlobalInteractionTheme),_.default.createElement(Ia,{selectables:Object.keys(h.default),selected:"string"==typeof E?E:"",atSelect:e=>(e=>{s(h.default[e]),u(e)})(e),theme:o,heightItems:3,filterable:!0,width:90,style:{fontSize:"0.8rem"}})),_.default.createElement(Ra,{last:!0},t.internatiolate(r,e.internationalization.fields.toolbarDrawerGlobalLanguage),_.default.createElement(Ia,{selectables:e.internationalization.languages,selected:r,atSelect:e=>{d(e)},theme:o,heightItems:3,width:90,style:{fontSize:"0.8rem"}})))})),{inputs:{Switch:ba}}=u.universal,La=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e)})),(e=>({dispatchToggleConfigurationSpaceTransformMultimode:t=>e(yt.configuration.toggleConfigurationSpaceTransformMultimode(t)),dispatchSetConfigurationSpaceTransformTouch:t=>e(yt.configuration.setConfigurationSpaceTransformTouch(t)),dispatchSetConfigurationSpaceTransformLocks:t=>e(yt.configuration.setConfigurationSpaceTransformLocks(t))})),null,{context:Ut})((a=>{const{stateLanguage:n,interactionTheme:r,configuration:o,dispatchToggleConfigurationSpaceTransformMultimode:i,dispatchSetConfigurationSpaceTransformTouch:l,dispatchSetConfigurationSpaceTransformLocks:s}=a,{transformMultimode:c,transformLocks:u,transformTouch:d}=o.space;return _.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformMultiModeTransform)),_.default.createElement(ba,{theme:r,checked:c,atChange:()=>i(!c),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformAllowRotationX)),_.default.createElement(ba,{theme:r,checked:u.rotationX,atChange:()=>s("rotationX"),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformAllowRotationY)),_.default.createElement(ba,{theme:r,checked:u.rotationY,atChange:()=>s("rotationY"),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformAllowTranslationX)),_.default.createElement(ba,{theme:r,checked:u.translationX,atChange:()=>s("translationX"),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformAllowTranslationY)),_.default.createElement(ba,{theme:r,checked:u.translationY,atChange:()=>s("translationY"),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformAllowTranslationZ)),_.default.createElement(ba,{theme:r,checked:u.translationZ,atChange:()=>s("translationZ"),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformAllowScale)),_.default.createElement(ba,{theme:r,checked:u.scale,atChange:()=>s("scale"),exclusive:!0,level:2})),_.default.createElement(Ra,{last:!0},_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerTransformTouchTransform),": ",d===e.TRANSFORM_TOUCHES.PAN?"pan":"swipe"),_.default.createElement(ba,{theme:r,checked:d===e.TRANSFORM_TOUCHES.PAN,atChange:()=>d===e.TRANSFORM_TOUCHES.PAN?l(e.TRANSFORM_TOUCHES.SWIPE):l(e.TRANSFORM_TOUCHES.PAN),level:2})))})),{inputs:{Dropdown:Na,Switch:Ua,Slider:va}}=u.universal,Pa=r.connect((e=>({interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e)})),(e=>({dispatchSetConfigurationPlaneOpacity:t=>e(yt.configuration.setConfigurationPlaneOpacity(t)),dispatchToggleConfigurationSpaceTransparentUI:()=>e(yt.configuration.toggleConfigurationSpaceTransparentUI()),dispatchToggleConfigurationSpaceShowTransformOrigin:()=>e(yt.configuration.toggleConfigurationSpaceShowTransformOrigin()),dispatchSetConfigurationSpaceTransformOriginSize:t=>e(yt.configuration.setConfigurationSpaceTransformOriginSize(t)),dispatchSetConfigurationSpaceLayoutType:t=>e(yt.configuration.setConfigurationSpaceLayoutType(t))})),null,{context:Ut})((a=>{const{interactionTheme:n,configuration:r,dispatchSetConfigurationPlaneOpacity:o,dispatchToggleConfigurationSpaceTransparentUI:i,dispatchToggleConfigurationSpaceShowTransformOrigin:l,dispatchSetConfigurationSpaceTransformOriginSize:s,dispatchSetConfigurationSpaceLayoutType:c}=a,{global:u,space:d,elements:T}=r,{transparentUI:p,language:f}=u,{layout:E,transformOrigin:m}=d,g=e.layoutNames[E.type],{show:O,size:h}=m,S=T.plane.opacity;return _.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,null,t.internatiolate(f,e.internationalization.fields.toolbarDrawerSpaceTransparentUserInterface),_.default.createElement(Ua,{checked:p,atChange:()=>i(),exclusive:!0,level:2,theme:n})),_.default.createElement(Ra,null,t.internatiolate(f,e.internationalization.fields.toolbarDrawerSpaceShowTransformOrigin),_.default.createElement(Ua,{checked:O,atChange:()=>l(),exclusive:!0,level:2,theme:n})),_.default.createElement(Ra,null,t.internatiolate(f,e.internationalization.fields.toolbarDrawerSpaceTransformOriginSize),_.default.createElement(Na,{selectables:["small","normal","large"],selected:h.toLowerCase(),atSelect:t=>{const a=t.toUpperCase();a!==e.SIZES.SMALL&&a!==e.SIZES.NORMAL&&a!==e.SIZES.LARGE||s(a)},heightItems:3,theme:n})),_.default.createElement(Ra,null,t.internatiolate(f,e.internationalization.fields.toolbarDrawerSpacePlaneOpacity),_.default.createElement(va,{value:S,max:1,min:0,step:.1,defaultValue:100,atChange:e=>o(e),thumbSize:"large",level:2,theme:n})),_.default.createElement(Ra,{last:!0},t.internatiolate(f,e.internationalization.fields.toolbarDrawerSpaceLayoutType),_.default.createElement(Na,{selectables:[...Object.values(e.layoutNames)],selected:g,atSelect:e=>{const t=e.toUpperCase().replace(/\s/g,"_");c(t)},heightItems:3,theme:n,width:100})))})),{inputs:{Switch:ya}}=u.universal,wa=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e),viewSize:Mt.space.getViewSize(e)})),(e=>({dispatchToggleConfigurationToolbarConceal:()=>e(yt.configuration.toggleConfigurationToolbarConceal()),dispatchToggleConfigurationToolbarTransformIcons:()=>e(yt.configuration.toggleConfigurationToolbarTransformIcons()),dispatchToggleConfigurationToolbarTransformButtons:()=>e(yt.configuration.toggleConfigurationToolbarTransformButtons()),dispatchToggleConfigurationToolbarOpaque:()=>e(yt.configuration.toggleConfigurationToolbarOpaque())})),null,{context:Ut})((a=>{const{stateLanguage:r,interactionTheme:o,configuration:i,viewSize:l,dispatchToggleConfigurationToolbarConceal:s,dispatchToggleConfigurationToolbarTransformIcons:c,dispatchToggleConfigurationToolbarTransformButtons:u,dispatchToggleConfigurationToolbarOpaque:d}=a,{toolbar:T}=i.elements,{conceal:p,opaque:f,transformIcons:E,transformButtons:m}=T,[g,O]=n.useState(!1);return n.useEffect((()=>{l.width<800?O(!0):O(!1)}),[l.width]),_.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerToolbarAlwaysOpaque)),_.default.createElement(ya,{theme:o,checked:f,atChange:()=>d(),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerToolbarShowTransformIcons)),_.default.createElement(ya,{theme:o,checked:E,atChange:()=>c(),exclusive:!0,level:2})),!g&&_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerToolbarShowTransformArrows)),_.default.createElement(ya,{theme:o,checked:m,atChange:()=>u(),exclusive:!0,level:2})),_.default.createElement(Ra,{last:!0},_.default.createElement("div",null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerToolbarConcealToolbar)),_.default.createElement(ya,{theme:o,checked:p,atChange:()=>s(),exclusive:!0,level:2})))})),{inputs:{Switch:Da}}=u.universal,Ma=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e)})),(e=>({dispatchToggleConfigurationViewcubeHide:t=>e(yt.configuration.toggleConfigurationViewcubeHide(t)),dispatchToggleConfigurationViewcubeButtons:t=>e(yt.configuration.toggleConfigurationViewcubeButtons(t)),dispatchToggleConfigurationViewcubeOpaque:t=>e(yt.configuration.toggleConfigurationViewcubeOpaque(t)),dispatchToggleConfigurationViewcubeConceal:()=>e(yt.configuration.toggleConfigurationViewcubeConceal())})),null,{context:Ut})((a=>{const{stateLanguage:n,interactionTheme:r,configuration:o,dispatchToggleConfigurationViewcubeHide:i,dispatchToggleConfigurationViewcubeButtons:l,dispatchToggleConfigurationViewcubeOpaque:s,dispatchToggleConfigurationViewcubeConceal:c}=a,{viewcube:u}=o.elements,{show:d,buttons:T,opaque:p,conceal:f}=u;return _.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,{last:!d},_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerViewcubeShowViewcube)),_.default.createElement(Da,{theme:r,checked:d,atChange:()=>i(!d),exclusive:!0,level:2})),d&&_.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerViewcubeShowTransformButtons)),_.default.createElement(Da,{theme:r,checked:T,atChange:()=>l(!T),exclusive:!0,level:2})),_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerViewcubeAlwaysOpaque)),_.default.createElement(Da,{theme:r,checked:p,atChange:()=>s(!p),exclusive:!0,level:2})),_.default.createElement(Ra,{last:!0},_.default.createElement("div",null,t.internatiolate(n,e.internationalization.fields.toolbarDrawerViewcubeConcealViewcube)),_.default.createElement(Da,{theme:r,checked:f,atChange:()=>c(),exclusive:!0,level:2}))))})),{inputs:{Slider:xa}}=u.universal,Fa=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,stateConfiguration:Mt.configuration.getConfiguration(e),stateInteractionTheme:Mt.themes.getInteractionTheme(e)})),(e=>({dispatchSetConfigurationSpaceCullingDistance:t=>e(yt.configuration.setConfigurationSpaceCullingDistance(t))})),null,{context:Ut})((a=>{const{stateLanguage:r,stateConfiguration:o,stateInteractionTheme:i,dispatchSetConfigurationSpaceCullingDistance:l}=a,{cullingDistance:s}=o.space,[c,u]=n.useState(s),d=T.useDebouncedCallback((e=>{l(e)}),300);return _.default.createElement(_.default.Fragment,null,_.default.createElement(Ra,null,_.default.createElement("div",null,t.internatiolate(r,e.internationalization.fields.toolbarDrawerTechnicalCullingDistance)),_.default.createElement(xa,{theme:i,value:c,atChange:e=>{u(e),d(e)},min:1e3,max:5e3,defaultValue:1500})))})),Ga=r.connect((e=>({interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e)})),(e=>({})),null,{context:Ut})((a=>{const{interactionTheme:n,configuration:r}=a,{global:o}=r,{language:i}=o;return _.default.createElement(_.default.Fragment,null,e.defaultShortcuts.map(((a,r)=>{const{type:o}=a,l=e.shortcutsNames[o],{name:s,internationalizedKey:c,key:u,modifier:d}=l,T=Array.isArray(d)?d.reduce(((e,t)=>e+" + "+t))+" +":"string"==typeof d?d+" +":"",p=t.internatiolate(i,s),f=u,E=c?t.internatiolate(i,f):u;return _.default.createElement(Ra,{key:s,theme:n,afterline:"TURN_DOWN"===o||"TOGGLE_ROTATE"===o||"TOGGLE_TRANSLATE"===o,last:r===e.defaultShortcuts.length-1},_.default.createElement("div",null,p),_.default.createElement("div",null,T," ",E))})))})),ja=[{name:e.internationalization.fields.toolbarDrawerGlobalTitle,drawer:e.TOOLBAR_DRAWERS.GLOBAL,component:_.default.createElement(Ca,null)},{name:e.internationalization.fields.toolbarDrawerTransformTitle,drawer:e.TOOLBAR_DRAWERS.TRANSFORM,component:_.default.createElement(La,null)},{name:e.internationalization.fields.toolbarDrawerSpaceTitle,drawer:e.TOOLBAR_DRAWERS.SPACE,component:_.default.createElement(Pa,null)},{name:e.internationalization.fields.toolbarDrawerToolbarTitle,drawer:e.TOOLBAR_DRAWERS.TOOLBAR,component:_.default.createElement(wa,null)},{name:e.internationalization.fields.toolbarDrawerViewcubeTitle,drawer:e.TOOLBAR_DRAWERS.VIEWCUBE,component:_.default.createElement(Ma,null)},{name:e.internationalization.fields.toolbarDrawerTechnicalTitle,drawer:e.TOOLBAR_DRAWERS.TECHNICAL,component:_.default.createElement(Fa,null)},{name:e.internationalization.fields.toolbarDrawerShortcutsTitle,drawer:e.TOOLBAR_DRAWERS.SHORTCUTS,component:_.default.createElement(Ga,null)}],Va=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,interactionTheme:Mt.themes.getInteractionTheme(e),configuration:Mt.configuration.getConfiguration(e),toolbarMenuScrollPosition:Mt.ui.getToolbarScrollPosition(e)})),(e=>({dispatchToggleConfigurationToolbarToggleDrawer:t=>e(yt.configuration.toggleConfigurationToolbarToggleDrawer(t)),dispatchSetUIToolbarScrollPosition:t=>e(yt.ui.setUIToolbarScrollPosition(t))})),null,{context:Ut})((e=>{const{stateLanguage:a,interactionTheme:r,configuration:o,toolbarMenuScrollPosition:i,dispatchToggleConfigurationToolbarToggleDrawer:l,dispatchSetUIToolbarScrollPosition:s}=e,{global:c,elements:u}=o,{transparentUI:d}=c,{toolbar:p}=u,{toggledDrawers:f}=p,E=n.useRef(null),m=T.useDebouncedCallback((e=>{if(E.current){const e=E.current.scrollTop;s(e)}}),100);return n.useEffect((()=>(E.current&&E.current.addEventListener("wheel",m),()=>{E.current&&E.current.removeEventListener("wheel",m)})),[E.current]),n.useEffect((()=>{E.current&&(E.current.scrollTop=i)}),[i,E.current]),_.default.createElement(Sa,{theme:r,transparentUI:d},_.default.createElement(Aa,{ref:E},ja.map((e=>{const{name:n,drawer:r,component:o}=e,i=t.internatiolate(a,n);return _.default.createElement(ha,{key:n,heading:i,items:_.default.createElement(_.default.Fragment,null,o),toggled:f.includes(r),toggle:()=>l(r)})}))))})),ka=S.default.div`
|
|
353
|
+
`,{inputs:{Dropdown:Sa}}=f.universal,Pa=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchSetConfigurationThemeGeneralAction:t=>e(qe.configuration.setConfigurationThemeGeneral(t)),dispatchSetConfigurationThemeInteractionAction:t=>e(qe.configuration.setConfigurationThemeInteraction(t)),dispatchSetConfigurationLanguage:t=>e(qe.configuration.setConfigurationLanguage(t)),dispatchSetGeneralTheme:t=>e(qe.themes.setGeneralTheme(t)),dispatchSetInteractionTheme:t=>e(qe.themes.setInteractionTheme(t))})),null,{context:Ge})((e=>{const{stateLanguage:n,interactionTheme:o,configuration:i,dispatchSetGeneralTheme:l,dispatchSetInteractionTheme:s,dispatchSetConfigurationThemeGeneralAction:c,dispatchSetConfigurationThemeInteractionAction:u,dispatchSetConfigurationLanguage:d}=e,f=i.global.theme,[p,m]=r.useState("object"==typeof f?f.general:f),[g,h]=r.useState("object"==typeof f?f.interaction:f);return r.useEffect((()=>{"object"==typeof f?(m(f.general),h(f.interaction)):(m(f),h(f))}),[f]),x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerGlobalGeneralTheme),x.default.createElement(Sa,{selectables:Object.keys(N.default),selected:"string"==typeof p?p:"",atSelect:e=>(e=>{l(N.default[e]),c(e)})(e),theme:o,filterable:!0,heightItems:3,width:90,style:{fontSize:"0.8rem"}})),x.default.createElement(Ea,null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerGlobalInteractionTheme),x.default.createElement(Sa,{selectables:Object.keys(N.default),selected:"string"==typeof g?g:"",atSelect:e=>(e=>{s(N.default[e]),u(e)})(e),theme:o,heightItems:3,filterable:!0,width:90,style:{fontSize:"0.8rem"}})),x.default.createElement(Ea,{last:!0},a.internatiolate(n,t.internationalization.fields.toolbarDrawerGlobalLanguage),x.default.createElement(Sa,{selectables:t.internationalization.languages,selected:n,atSelect:e=>{d(e)},theme:o,heightItems:3,width:90,style:{fontSize:"0.8rem"}})))})),{inputs:{Switch:ba}}=f.universal,Ra=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchToggleConfigurationSpaceTransformMultimode:t=>e(qe.configuration.toggleConfigurationSpaceTransformMultimode(t)),dispatchSetConfigurationSpaceTransformTouch:t=>e(qe.configuration.setConfigurationSpaceTransformTouch(t)),dispatchSetConfigurationSpaceTransformLocks:t=>e(qe.configuration.setConfigurationSpaceTransformLocks(t))})),null,{context:Ge})((e=>{const{stateLanguage:n,interactionTheme:r,configuration:o,dispatchToggleConfigurationSpaceTransformMultimode:i,dispatchSetConfigurationSpaceTransformTouch:l,dispatchSetConfigurationSpaceTransformLocks:s}=e,{transformMultimode:c,transformLocks:u,transformTouch:d}=o.space;return x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformMultiModeTransform)),x.default.createElement(ba,{theme:r,checked:c,atChange:()=>i(!c),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformAllowRotationX)),x.default.createElement(ba,{theme:r,checked:u.rotationX,atChange:()=>s("rotationX"),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformAllowRotationY)),x.default.createElement(ba,{theme:r,checked:u.rotationY,atChange:()=>s("rotationY"),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformAllowTranslationX)),x.default.createElement(ba,{theme:r,checked:u.translationX,atChange:()=>s("translationX"),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformAllowTranslationY)),x.default.createElement(ba,{theme:r,checked:u.translationY,atChange:()=>s("translationY"),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformAllowTranslationZ)),x.default.createElement(ba,{theme:r,checked:u.translationZ,atChange:()=>s("translationZ"),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformAllowScale)),x.default.createElement(ba,{theme:r,checked:u.scale,atChange:()=>s("scale"),exclusive:!0,level:2})),x.default.createElement(Ea,{last:!0},x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTransformTouchTransform),": ",d===t.TRANSFORM_TOUCHES.PAN?"pan":"swipe"),x.default.createElement(ba,{theme:r,checked:d===t.TRANSFORM_TOUCHES.PAN,atChange:()=>d===t.TRANSFORM_TOUCHES.PAN?l(t.TRANSFORM_TOUCHES.SWIPE):l(t.TRANSFORM_TOUCHES.PAN),level:2})))})),{inputs:{Dropdown:Ia,Switch:Ca,Slider:wa}}=f.universal,Oa=o.connect((e=>({interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchSetConfigurationPlaneOpacity:t=>e(qe.configuration.setConfigurationPlaneOpacity(t)),dispatchToggleConfigurationSpaceTransparentUI:()=>e(qe.configuration.toggleConfigurationSpaceTransparentUI()),dispatchToggleConfigurationSpaceShowTransformOrigin:()=>e(qe.configuration.toggleConfigurationShowTransformOrigin()),dispatchSetConfigurationSpaceTransformOriginSize:t=>e(qe.configuration.setConfigurationSpaceTransformOriginSize(t)),dispatchSetConfigurationSpaceLayoutType:t=>e(qe.configuration.setConfigurationSpaceLayout(t))})),null,{context:Ge})((e=>{const{interactionTheme:n,configuration:r,dispatchSetConfigurationPlaneOpacity:o,dispatchToggleConfigurationSpaceTransparentUI:i,dispatchToggleConfigurationSpaceShowTransformOrigin:l,dispatchSetConfigurationSpaceTransformOriginSize:s,dispatchSetConfigurationSpaceLayoutType:c}=e,{global:u,space:d,elements:f}=r,{transparentUI:p,language:m}=u,{layout:g,transformOrigin:h}=d,T=t.layoutNames[g.type],{show:E,size:v}=h,S=f.plane.opacity;return x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,null,a.internatiolate(m,t.internationalization.fields.toolbarDrawerSpaceTransparentUserInterface),x.default.createElement(Ca,{checked:p,atChange:()=>i(),exclusive:!0,level:2,theme:n})),x.default.createElement(Ea,null,a.internatiolate(m,t.internationalization.fields.toolbarDrawerSpaceShowTransformOrigin),x.default.createElement(Ca,{checked:E,atChange:()=>l(),exclusive:!0,level:2,theme:n})),x.default.createElement(Ea,null,a.internatiolate(m,t.internationalization.fields.toolbarDrawerSpaceTransformOriginSize),x.default.createElement(Ia,{selectables:["small","normal","large"],selected:v.toLowerCase(),atSelect:e=>{const a=e.toUpperCase();a!==t.SIZES.SMALL&&a!==t.SIZES.NORMAL&&a!==t.SIZES.LARGE||s(a)},heightItems:3,theme:n})),x.default.createElement(Ea,null,a.internatiolate(m,t.internationalization.fields.toolbarDrawerSpacePlaneOpacity),x.default.createElement(wa,{value:S,max:1,min:0,step:.1,defaultValue:100,atChange:e=>o(e),thumbSize:"large",level:2,theme:n})),x.default.createElement(Ea,{last:!0},a.internatiolate(m,t.internationalization.fields.toolbarDrawerSpaceLayoutType),x.default.createElement(Ia,{selectables:[...Object.values(t.layoutNames)],selected:T,atSelect:e=>{const t=e.toUpperCase().replace(/\s/g,"_");c(t)},heightItems:3,theme:n,width:100})))})),{inputs:{Switch:ya}}=f.universal,_a=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e),viewSize:Ot.space.getViewSize(e)})),(e=>({dispatchToggleConfigurationToolbarConceal:()=>e(qe.configuration.toggleConfigurationToolbarConceal()),dispatchToggleConfigurationToolbarTransformIcons:()=>e(qe.configuration.toggleConfigurationToolbarTransformIcons()),dispatchToggleConfigurationToolbarTransformButtons:()=>e(qe.configuration.toggleConfigurationToolbarTransformButtons()),dispatchToggleConfigurationToolbarOpaque:()=>e(qe.configuration.toggleConfigurationToolbarOpaque())})),null,{context:Ge})((e=>{const{stateLanguage:n,interactionTheme:o,configuration:i,viewSize:l,dispatchToggleConfigurationToolbarConceal:s,dispatchToggleConfigurationToolbarTransformIcons:c,dispatchToggleConfigurationToolbarTransformButtons:u,dispatchToggleConfigurationToolbarOpaque:d}=e,{toolbar:f}=i.elements,{conceal:p,opaque:m,transformIcons:g,transformButtons:h}=f,[T,E]=r.useState(!1);return r.useEffect((()=>{l.width<800?E(!0):E(!1)}),[l.width]),x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerToolbarAlwaysOpaque)),x.default.createElement(ya,{theme:o,checked:m,atChange:()=>d(),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerToolbarShowTransformIcons)),x.default.createElement(ya,{theme:o,checked:g,atChange:()=>c(),exclusive:!0,level:2})),!T&&x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerToolbarShowTransformArrows)),x.default.createElement(ya,{theme:o,checked:h,atChange:()=>u(),exclusive:!0,level:2})),x.default.createElement(Ea,{last:!0},x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerToolbarConcealToolbar)),x.default.createElement(ya,{theme:o,checked:p,atChange:()=>s(),exclusive:!0,level:2})))})),{inputs:{Switch:La}}=f.universal,Aa=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchToggleConfigurationViewcubeHide:t=>e(qe.configuration.toggleConfigurationViewcubeHide(t)),dispatchToggleConfigurationViewcubeButtons:t=>e(qe.configuration.toggleConfigurationViewcubeButtons(t)),dispatchToggleConfigurationViewcubeOpaque:t=>e(qe.configuration.toggleConfigurationViewcubeOpaque(t)),dispatchToggleConfigurationViewcubeConceal:()=>e(qe.configuration.toggleConfigurationViewcubeConceal())})),null,{context:Ge})((e=>{const{stateLanguage:n,interactionTheme:r,configuration:o,dispatchToggleConfigurationViewcubeHide:i,dispatchToggleConfigurationViewcubeButtons:l,dispatchToggleConfigurationViewcubeOpaque:s,dispatchToggleConfigurationViewcubeConceal:c}=e,{viewcube:u}=o.elements,{show:d,buttons:f,opaque:p,conceal:m}=u;return x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,{last:!d},x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerViewcubeShowViewcube)),x.default.createElement(La,{theme:r,checked:d,atChange:()=>i(!d),exclusive:!0,level:2})),d&&x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerViewcubeShowTransformButtons)),x.default.createElement(La,{theme:r,checked:f,atChange:()=>l(!f),exclusive:!0,level:2})),x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerViewcubeAlwaysOpaque)),x.default.createElement(La,{theme:r,checked:p,atChange:()=>s(!p),exclusive:!0,level:2})),x.default.createElement(Ea,{last:!0},x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerViewcubeConcealViewcube)),x.default.createElement(La,{theme:r,checked:m,atChange:()=>c(),exclusive:!0,level:2}))))})),{inputs:{Slider:Ua}}=f.universal,Da=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,stateConfiguration:Ot.configuration.getConfiguration(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({dispatchSetConfigurationSpaceCullingDistance:t=>e(qe.configuration.setConfigurationSpaceCullingDistance(t))})),null,{context:Ge})((e=>{const{stateLanguage:n,stateConfiguration:o,stateInteractionTheme:i,dispatchSetConfigurationSpaceCullingDistance:l}=e,{cullingDistance:s}=o.space,[c,d]=r.useState(s),f=u.useDebouncedCallback((e=>{l(e)}),300);return x.default.createElement(x.default.Fragment,null,x.default.createElement(Ea,null,x.default.createElement("div",null,a.internatiolate(n,t.internationalization.fields.toolbarDrawerTechnicalCullingDistance)),x.default.createElement(Ua,{theme:i,value:c,atChange:e=>{d(e),f(e)},min:1e3,max:5e3,defaultValue:1500})))})),xa=o.connect((e=>({interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({})),null,{context:Ge})((e=>{const{interactionTheme:n,configuration:r}=e,{global:o}=r,{language:i}=o;return x.default.createElement(x.default.Fragment,null,t.defaultShortcuts.map(((e,r)=>{const{type:o}=e,l=t.shortcutsNames[o],{name:s,internationalizedKey:c,key:u,modifier:d}=l,f=Array.isArray(d)?d.reduce(((e,t)=>e+" + "+t))+" +":"string"==typeof d?d+" +":"",p=a.internatiolate(i,s),m=u,g=c?a.internatiolate(i,m):u,h="TURN_DOWN"===o||"TOGGLE_ROTATE"===o||"TOGGLE_TRANSLATE"===o||"TOGGLE_SCALE"===o;return x.default.createElement(Ea,{key:s,theme:n,afterline:h,last:r===t.defaultShortcuts.length-1},x.default.createElement("div",null,p),x.default.createElement("div",null,f," ",g))})))})),Na={GLOBAL:{name:t.internationalization.fields.toolbarDrawerGlobalTitle,drawer:t.TOOLBAR_DRAWERS.GLOBAL,component:x.default.createElement(Pa,null)},TRANSFORM:{name:t.internationalization.fields.toolbarDrawerTransformTitle,drawer:t.TOOLBAR_DRAWERS.TRANSFORM,component:x.default.createElement(Ra,null)},SPACE:{name:t.internationalization.fields.toolbarDrawerSpaceTitle,drawer:t.TOOLBAR_DRAWERS.SPACE,component:x.default.createElement(Oa,null)},TOOLBAR:{name:t.internationalization.fields.toolbarDrawerToolbarTitle,drawer:t.TOOLBAR_DRAWERS.TOOLBAR,component:x.default.createElement(_a,null)},VIEWCUBE:{name:t.internationalization.fields.toolbarDrawerViewcubeTitle,drawer:t.TOOLBAR_DRAWERS.VIEWCUBE,component:x.default.createElement(Aa,null)},TECHNICAL:{name:t.internationalization.fields.toolbarDrawerTechnicalTitle,drawer:t.TOOLBAR_DRAWERS.TECHNICAL,component:x.default.createElement(Da,null)},SHORTCUTS:{name:t.internationalization.fields.toolbarDrawerShortcutsTitle,drawer:t.TOOLBAR_DRAWERS.SHORTCUTS,component:x.default.createElement(xa,null)}},Ma=Object.values(Na),ka=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,stateInteractionTheme:Ot.themes.getInteractionTheme(e),stateConfiguration:Ot.configuration.getConfiguration(e),stateToolbarMenuScrollPosition:Ot.ui.getToolbarScrollPosition(e)})),(e=>({dispatchToggleConfigurationToolbarToggleDrawer:t=>e(qe.configuration.toggleConfigurationToolbarToggleDrawer(t)),dispatchSetUIToolbarScrollPosition:t=>e(qe.ui.setUIToolbarScrollPosition(t))})),null,{context:Ge})((e=>{const{stateLanguage:t,stateInteractionTheme:n,stateConfiguration:o,stateToolbarMenuScrollPosition:i,dispatchToggleConfigurationToolbarToggleDrawer:l,dispatchSetUIToolbarScrollPosition:s}=e,{global:c,elements:d}=o,{transparentUI:f}=c,{toolbar:p}=d,{drawers:m,toggledDrawers:g}=p,h=(e=>{if(0===e.length||e.includes("ALL"))return Ma;const t=[];for(const a of e){const e=Na[a];t.push(e)}return t})(m),T=r.useRef(null),E=u.useDebouncedCallback((e=>{if(T.current){const e=T.current.scrollTop;s(e)}}),100);return r.useEffect((()=>(T.current&&T.current.addEventListener("wheel",E),()=>{T.current&&T.current.removeEventListener("wheel",E)})),[T.current]),r.useEffect((()=>{T.current&&(T.current.scrollTop=i)}),[i,T.current]),x.default.createElement(Ta,{theme:n,transparentUI:f},x.default.createElement(va,{ref:T},h.map((e=>{const{name:n,drawer:r,component:o}=e,i=a.internatiolate(t,n);return x.default.createElement(ha,{key:n,heading:i,items:x.default.createElement(x.default.Fragment,null,o),toggled:g.includes("ALL")||g.includes(r),toggle:()=>l(r)})}))))})),Fa=M.default.div`
|
|
337
354
|
display: grid;
|
|
338
355
|
align-items: center;
|
|
339
356
|
justify-items: center;
|
|
340
357
|
grid-template-columns: ${e=>e.showTransformButtons?"30px 30px 60px 30px 30px":"1fr"};
|
|
341
|
-
`,
|
|
358
|
+
`,Ba=M.default.div`
|
|
342
359
|
user-select: none;
|
|
343
360
|
cursor: pointer;
|
|
344
361
|
border-radius: 50px;
|
|
@@ -347,22 +364,23 @@
|
|
|
347
364
|
display: grid;
|
|
348
365
|
place-content: center;
|
|
349
366
|
padding: 2px;
|
|
350
|
-
|
|
367
|
+
|
|
368
|
+
background-color: ${({pressed:e,theme:t})=>e?t.backgroundColorTertiary:"initial"};
|
|
351
369
|
|
|
352
370
|
:hover {
|
|
353
|
-
background-color: ${e=>e.
|
|
371
|
+
background-color: ${({theme:e})=>e.backgroundColorTertiary};
|
|
354
372
|
}
|
|
355
|
-
`,
|
|
373
|
+
`,Ya={left:"◀",right:"▶",up:"▲",down:"▼"},$a="tap press pressup",Xa=o.connect((e=>({interactionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{direction:t,transform:a,interactionTheme:n}=e,o=Ya[t]||"",i=r.useRef(null),l=r.useRef(null),[s,c]=r.useState(!1),u=e=>{const t={altKey:e.srcEvent.altKey};switch(e.type){case"tap":a(t),i.current&&(c(!1),clearInterval(i.current));break;case"press":c(!0),i.current=setInterval((()=>{a(t)}),30);break;case"pressup":c(!1),i.current&&clearInterval(i.current)}};return r.useEffect((()=>{if("undefined"==typeof window)return;let e;return We(void 0,void 0,void 0,(function*(){const t=(yield wt()).default;e=new t(l.current),e.on($a,u)})),()=>{e&&e.off($a,u)}}),[l.current]),x.default.createElement(Ba,{ref:l,theme:n,pressed:s,onMouseLeave:()=>{i.current&&(c(!1),clearInterval(i.current))}},o)})),Va=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({rotateUp:()=>e(qe.space.rotateUp()),rotateDown:()=>e(qe.space.rotateDown()),rotateLeft:()=>e(qe.space.rotateLeft()),rotateRight:()=>e(qe.space.rotateRight())})),null,{context:Ge})((e=>{const{showTransformButtons:n,showIcons:r,transformMode:o,toggleTransform:i,stateLanguage:l,interactionTheme:s,rotateUp:c,rotateDown:u,rotateLeft:f,rotateRight:p}=e;return x.default.createElement(Fa,{showTransformButtons:n},n&&x.default.createElement(x.default.Fragment,null,x.default.createElement(Xa,{direction:"left",transform:()=>p()}),x.default.createElement(Xa,{direction:"up",transform:()=>c()})),x.default.createElement(la,{theme:s,onClick:()=>i(t.TRANSFORM_MODES.ROTATION),active:o===t.TRANSFORM_MODES.ROTATION,showIcons:r,showTransformButtons:n,button:r},r?x.default.createElement(sa,null,x.default.createElement(d.PluridIconRotate,null)):x.default.createElement(x.default.Fragment,null,a.internatiolate(l,t.internationalization.fields.toolbarTransformRotate))),n&&x.default.createElement(x.default.Fragment,null,x.default.createElement(Xa,{direction:"down",transform:()=>u()}),x.default.createElement(Xa,{direction:"right",transform:()=>f()})))})),za=M.default.div`
|
|
356
374
|
display: grid;
|
|
357
375
|
align-items: center;
|
|
358
376
|
justify-items: center;
|
|
359
377
|
grid-template-columns: ${e=>e.showTransformButtons?"30px 60px 30px":"1fr"};
|
|
360
|
-
`,
|
|
378
|
+
`,Ka=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({scaleUp:()=>e(qe.space.scaleUp()),scaleDown:()=>e(qe.space.scaleDown())})),null,{context:Ge})((e=>{const{showTransformButtons:n,showIcons:r,transformMode:o,toggleTransform:i,stateLanguage:l,interactionTheme:s,scaleUp:c,scaleDown:u}=e;return x.default.createElement(za,{showTransformButtons:n},n&&x.default.createElement(Xa,{direction:"up",transform:()=>c()}),x.default.createElement(la,{theme:s,onClick:()=>i(t.TRANSFORM_MODES.SCALE),active:o===t.TRANSFORM_MODES.SCALE,showIcons:r,showTransformButtons:n,button:r},r?x.default.createElement(sa,null,x.default.createElement(d.PluridIconScale,null)):x.default.createElement(x.default.Fragment,null,a.internatiolate(l,t.internationalization.fields.toolbarTransformScale))),n&&x.default.createElement(Xa,{direction:"down",transform:()=>u()}))})),Za=M.default.div`
|
|
361
379
|
display: grid;
|
|
362
380
|
align-items: center;
|
|
363
381
|
justify-items: center;
|
|
364
382
|
grid-template-columns: ${e=>e.showTransformButtons?"30px 30px 60px 30px 30px":"1fr"};
|
|
365
|
-
`,
|
|
383
|
+
`,ja=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,interactionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({translateUp:()=>e(qe.space.translateUp()),translateDown:()=>e(qe.space.translateDown()),translateLeft:()=>e(qe.space.translateLeft()),translateRight:()=>e(qe.space.translateRight()),translateIn:()=>e(qe.space.translateIn()),translateOut:()=>e(qe.space.translateOut())})),null,{context:Ge})((e=>{const{showTransformButtons:n,showIcons:r,transformMode:o,toggleTransform:i,stateLanguage:l,interactionTheme:s,translateUp:c,translateDown:u,translateLeft:f,translateRight:p,translateIn:m,translateOut:g}=e;return x.default.createElement(Za,{showTransformButtons:n},n&&x.default.createElement(x.default.Fragment,null,x.default.createElement(Xa,{direction:"left",transform:()=>f()}),x.default.createElement(Xa,{direction:"up",transform:e=>{e.altKey?g():c()}})),x.default.createElement(la,{theme:s,onClick:()=>i(t.TRANSFORM_MODES.TRANSLATION),active:o===t.TRANSFORM_MODES.TRANSLATION,showIcons:r,showTransformButtons:n,button:r},r?x.default.createElement(sa,null,x.default.createElement(d.PluridIconTranslate,null)):x.default.createElement(x.default.Fragment,null,a.internatiolate(l,t.internationalization.fields.toolbarTransformTranslate))),n&&x.default.createElement(x.default.Fragment,null,x.default.createElement(Xa,{direction:"down",transform:e=>{e.altKey?m():u()}}),x.default.createElement(Xa,{direction:"right",transform:()=>p()})))})),Ga=o.connect((e=>({configuration:Ot.configuration.getConfiguration(e),theme:Ot.themes.getInteractionTheme(e),viewSize:Ot.space.getViewSize(e)})),(e=>({dispatchToggleConfigurationSpaceFirstPerson:()=>e(qe.configuration.toggleConfigurationSpaceFirstPerson()),dispatchSetConfigurationSpaceTransformMode:t=>e(qe.configuration.setConfigurationSpaceTransformMode(t))})),null,{context:Ge})((e=>{const{theme:a,configuration:n,viewSize:o,dispatchToggleConfigurationSpaceFirstPerson:i,dispatchSetConfigurationSpaceTransformMode:l}=e,{global:s,elements:c,space:u}=n,{transparentUI:f}=s,{firstPerson:p,transformMode:m,fadeInTime:g}=u,{toolbar:h}=c,{conceal:T,opaque:E,transformIcons:v,transformButtons:S}=h,P=h.show,b=r.useRef(null),[R,I]=r.useState(!1),[C,w]=r.useState(ra.NONE),[O,y]=r.useState(v),[_,L]=r.useState(S),[A,U]=r.useState(!1),D=e=>{C!==ra.NONE&&w(ra.NONE),l(e)};return r.useEffect((()=>{U(!0)}),[]),r.useEffect((()=>{o.width<800&&S&&L(!1),o.width>800&&L(S)}),[o.width]),r.useEffect((()=>{y(v),L(S)}),[v,S]),r.useEffect((()=>(R&&b.current&&clearTimeout(b.current),R||(b.current=setTimeout((()=>{w(ra.NONE)}),400)),()=>{b.current&&clearTimeout(b.current)})),[R]),P?x.default.createElement(oa,{onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),mouseIn:R,conceal:T,showMenu:C,isMounted:A,fadeInTime:g,"data-plurid-entity":t.PLURID_ENTITY_TOOLBAR},x.default.createElement(ia,{theme:a,showIcons:O,showTransformButtons:_,documentsBased:!1,mouseIn:R,opaque:E,transparentUI:f},x.default.createElement(la,{theme:a,onClick:()=>i(void 0),active:p,button:!0,showIcons:O,showTransformButtons:_},x.default.createElement(sa,null,x.default.createElement(d.PluridIconFirstPerson,null))),x.default.createElement(Va,{showTransformButtons:_,showIcons:O,transformMode:m,toggleTransform:D}),x.default.createElement(Ka,{showTransformButtons:_,showIcons:O,transformMode:m,toggleTransform:D}),x.default.createElement(ja,{showTransformButtons:_,showIcons:O,transformMode:m,toggleTransform:D}),x.default.createElement(la,{theme:a,onClick:()=>{return e=ra.MORE,void(C===e?w(ra.NONE):(l(t.TRANSFORM_MODES.ALL),w(e)));var e},active:C===ra.MORE,button:!0,showIcons:O,showTransformButtons:_},x.default.createElement(sa,null,x.default.createElement(d.PluridIconMore,null)))),C===ra.UNIVERSES&&x.default.createElement(da,null),C===ra.MORE&&x.default.createElement(ka,null)):x.default.createElement(x.default.Fragment,null)})),Wa=M.default.div`
|
|
366
384
|
position: absolute;
|
|
367
385
|
@media (max-width: 800px) {
|
|
368
386
|
top: ${({conceal:e,mouseOver:t})=>e&&!t?"-90px":"0"};
|
|
@@ -373,23 +391,23 @@
|
|
|
373
391
|
user-select: none;
|
|
374
392
|
transition: all 300ms ease-in-out;
|
|
375
393
|
z-index: 9998;
|
|
376
|
-
height:
|
|
394
|
+
height: 175px;
|
|
377
395
|
display: grid;
|
|
378
396
|
grid-template-areas: "PVScale PVScale PVScale PVScale"
|
|
379
397
|
"PVEmptyOne PVRotateUp PVEmptyTwo PVTranslateY"
|
|
380
398
|
"PVRotateLeft PVModel PVRotateRight PVTranslateY"
|
|
381
399
|
"PVEmptyThree PVRotateDown PVFitview PVTranslateY"
|
|
382
400
|
"PVTranslateX PVTranslateX PVTranslateX PVTranslateX";
|
|
383
|
-
grid-template-rows: 20px 15px
|
|
384
|
-
grid-template-columns: 15px
|
|
401
|
+
grid-template-rows: 20px 15px 105px 15px 20px;
|
|
402
|
+
grid-template-columns: 15px 100px 15px 20px;
|
|
385
403
|
|
|
386
404
|
opacity: ${({fadeInTime:e})=>e?"0":"1"};
|
|
387
|
-
animation: ${({fadeInTime:e,isMounted:t})=>t&&e?
|
|
405
|
+
animation: ${({fadeInTime:e,isMounted:t})=>t&&e?na(e):""};
|
|
388
406
|
|
|
389
407
|
:hover {
|
|
390
408
|
opacity: 1;
|
|
391
409
|
}
|
|
392
|
-
`,
|
|
410
|
+
`,Ha=M.default.div`
|
|
393
411
|
display: grid;
|
|
394
412
|
place-content: center;
|
|
395
413
|
|
|
@@ -397,7 +415,7 @@
|
|
|
397
415
|
* Themed color
|
|
398
416
|
*/
|
|
399
417
|
color: white;
|
|
400
|
-
`,
|
|
418
|
+
`,qa=M.default.div`
|
|
401
419
|
user-select: none;
|
|
402
420
|
font-size: 0.6rem;
|
|
403
421
|
width: 1.2rem;
|
|
@@ -410,7 +428,7 @@
|
|
|
410
428
|
:hover {
|
|
411
429
|
background-color: ${({theme:e})=>e.backgroundColorTertiary};
|
|
412
430
|
}
|
|
413
|
-
`,Ja=
|
|
431
|
+
`,Ja=M.default.div`
|
|
414
432
|
grid-area: PVFitview;
|
|
415
433
|
display: grid;
|
|
416
434
|
place-content: center;
|
|
@@ -422,7 +440,7 @@
|
|
|
422
440
|
width: 0.8rem;
|
|
423
441
|
fill: white;
|
|
424
442
|
}
|
|
425
|
-
`,
|
|
443
|
+
`,Qa=M.default.div`
|
|
426
444
|
font-size: 0.6rem;
|
|
427
445
|
position: absolute;
|
|
428
446
|
height: 50px;
|
|
@@ -442,7 +460,7 @@
|
|
|
442
460
|
box-shadow: ${({face:e,theme:t})=>"base"===e?"0px 0px 12px 2px "+t.boxShadowPenumbraColor:""};
|
|
443
461
|
opacity: ${({opaque:e,mouseOver:t})=>{if(!e){if(t)return"0.8";if(!t)return"0.4"}return"1"}};
|
|
444
462
|
transform: ${({face:e})=>{switch(e){case"front":return"translateZ(25px) rotateY(0deg)";case"back":return"translateZ(-25px) rotateY(-180deg)";case"left":return"translateX(-25px) rotateY(-90deg)";case"right":return"translateX(25px) rotateY(90deg)";case"top":return"translateY(-25px) rotateX(90deg)";case"base":return"translateY(25px) rotateX(-90deg)"}return""}};
|
|
445
|
-
`,
|
|
463
|
+
`,en=M.default.div`
|
|
446
464
|
display: grid;
|
|
447
465
|
place-content: center;
|
|
448
466
|
cursor: pointer;
|
|
@@ -456,28 +474,18 @@
|
|
|
456
474
|
:hover {
|
|
457
475
|
background-color: ${({theme:e})=>e.backgroundColorTertiary};
|
|
458
476
|
}
|
|
459
|
-
`,
|
|
477
|
+
`,tn="TopLeft",an="TopCenter",nn="TopRight",rn="MiddleLeft",on="MiddleCenter",ln="MiddleRight",sn="BottomLeft",cn="BottomCenter",un="BottomRight",dn={frontTopLeft:"A1",frontTopCenter:"A2",frontTopRight:"A3",frontMiddleLeft:"B1",frontMiddleCenter:"B2",frontMiddleRight:"B3",frontBottomLeft:"C1",frontBottomCenter:"C2",frontBottomRight:"C3",rightTopLeft:"A3",rightTopCenter:"A4",rightTopRight:"A5",rightMiddleLeft:"B3",rightMiddleCenter:"B4",rightMiddleRight:"B5",rightBottomLeft:"C3",rightBottomCenter:"C4",rightBottomRight:"C5",backTopLeft:"A5",backTopCenter:"A6",backTopRight:"A7",backMiddleLeft:"B5",backMiddleCenter:"B6",backMiddleRight:"B7",backBottomLeft:"C5",backBottomCenter:"C6",backBottomRight:"C7",leftTopLeft:"A7",leftTopCenter:"A8",leftTopRight:"A1",leftMiddleLeft:"B7",leftMiddleCenter:"B8",leftMiddleRight:"B1",leftBottomLeft:"C7",leftBottomCenter:"C8",leftBottomRight:"C1",topTopLeft:"A7",topTopCenter:"A6",topTopRight:"A5",topMiddleLeft:"A8",topMiddleCenter:"D1",topMiddleRight:"A4",topBottomLeft:"A1",topBottomCenter:"A2",topBottomRight:"A3",baseTopLeft:"C1",baseTopCenter:"C2",baseTopRight:"C3",baseMiddleLeft:"C8",baseMiddleCenter:"E1",baseMiddleRight:"C4",baseBottomLeft:"C7",baseBottomCenter:"C6",baseBottomRight:"C5"},fn={A1:{rotateX:-45,rotateY:45},A2:{rotateX:-45,rotateY:0},A3:{rotateX:-45,rotateY:-45},B1:{rotateX:0,rotateY:45},B2:{rotateX:0,rotateY:0},B3:{rotateX:0,rotateY:-45},C1:{rotateX:45,rotateY:45},C2:{rotateX:45,rotateY:0},C3:{rotateX:45,rotateY:-45},A4:{rotateX:-45,rotateY:270.1},A5:{rotateX:-45,rotateY:225},B4:{rotateX:0,rotateY:270.1},B5:{rotateX:0,rotateY:225},C4:{rotateX:45,rotateY:270.1},C5:{rotateX:45,rotateY:225},A6:{rotateX:-45,rotateY:180},A7:{rotateX:-45,rotateY:135},B6:{rotateX:0,rotateY:180.1},B7:{rotateX:0,rotateY:135},C6:{rotateX:45,rotateY:180.1},C7:{rotateX:45,rotateY:135},A8:{rotateX:-45,rotateY:90.1},B8:{rotateX:0,rotateY:90.1},C8:{rotateX:45,rotateY:90.1},D1:{rotateX:-90.1,rotateY:0},E1:{rotateX:90.1,rotateY:0}},pn=o.connect((e=>({generalTheme:Ot.themes.getGeneralTheme(e),interactionTheme:Ot.themes.getInteractionTheme(e),configuration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchRotateX:t=>e(qe.space.rotateX(t)),dispatchRotateY:t=>e(qe.space.rotateY(t)),dispatchSetAnimatedTransform:t=>e(qe.space.setAnimatedTransform(t))})),null,{context:Ge})((e=>{const{face:t,faceText:a,mouseOver:n,hoveredZone:r,setHoveredZone:o,activeZone:i,setActiveZone:l,generalTheme:s,interactionTheme:c,configuration:u,dispatchRotateX:d,dispatchRotateY:f,dispatchSetAnimatedTransform:p}=e,{global:m,elements:g}=u,{transparentUI:h}=m,T=g.viewcube.opaque,E=e=>{const a=dn[`${t}${e}`],n=fn[a];l(a),p(!0),d(n.rotateX),f(n.rotateY),setTimeout((()=>{p(!1)}),450)};return x.default.createElement(Qa,{theme:s,face:t,opaque:T,mouseOver:n},x.default.createElement(en,{theme:c,type:tn,active:i===dn[`${t}${tn}`],hovered:r===dn[`${t}${tn}`],onClick:()=>E(tn),onMouseEnter:()=>o(dn[`${t}${tn}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:an,active:i===dn[`${t}${an}`],hovered:r===dn[`${t}${an}`],onClick:()=>E(an),onMouseEnter:()=>o(dn[`${t}${an}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:nn,active:i===dn[`${t}${nn}`],hovered:r===dn[`${t}${nn}`],onClick:()=>E(nn),onMouseEnter:()=>o(dn[`${t}${nn}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:rn,active:i===dn[`${t}${rn}`],hovered:r===dn[`${t}${rn}`],onClick:()=>E(rn),onMouseEnter:()=>o(dn[`${t}${rn}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:on,active:i===dn[`${t}${on}`],hovered:r===dn[`${t}${on}`],onClick:()=>E(on),onMouseEnter:()=>o(dn[`${t}${on}`]),transparentUI:h},a),x.default.createElement(en,{theme:c,type:ln,active:i===dn[`${t}${ln}`],hovered:r===dn[`${t}${ln}`],onClick:()=>E(ln),onMouseEnter:()=>o(dn[`${t}${ln}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:sn,active:i===dn[`${t}${sn}`],hovered:r===dn[`${t}${sn}`],onClick:()=>E(sn),onMouseEnter:()=>o(dn[`${t}${sn}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:cn,active:i===dn[`${t}${cn}`],hovered:r===dn[`${t}${cn}`],onClick:()=>E(cn),onMouseEnter:()=>o(dn[`${t}${cn}`]),transparentUI:h}),x.default.createElement(en,{theme:c,type:un,active:i===dn[`${t}${un}`],hovered:r===dn[`${t}${un}`],onClick:()=>E(un),onMouseEnter:()=>o(dn[`${t}${un}`]),transparentUI:h}))})),mn=M.default.div`
|
|
460
478
|
grid-area: PVModel;
|
|
461
|
-
|
|
479
|
+
margin-left: -7px;
|
|
480
|
+
margin-top: 5px;
|
|
481
|
+
`,gn=M.default.div`
|
|
462
482
|
perspective: 2000px;
|
|
463
483
|
perspective-origin: 50% 50%;
|
|
464
|
-
`,
|
|
484
|
+
`,hn=M.default.div`
|
|
465
485
|
transform-style: preserve-3d;
|
|
466
486
|
width: 50px;
|
|
467
487
|
height: 50px;
|
|
468
|
-
`,_n=r.connect((e=>({stateLanguage:Mt.configuration.getConfiguration(e).global.language,spaceRotationX:Mt.space.getRotationX(e),spaceRotationY:Mt.space.getRotationY(e),stateAnimatedTransform:Mt.space.getAnimatedTransform(e),stateTransformTime:Mt.space.getTransformTime(e)})),(e=>({})),null,{context:Ut})((a=>{const{mouseOver:r,stateLanguage:o,spaceRotationX:i,spaceRotationY:l,stateAnimatedTransform:s,stateTransformTime:c}=a,[u,d]=n.useState(""),[T,p]=n.useState("");return n.useEffect((()=>{u||p("")}),[i,l]),_.default.createElement(En,null,_.default.createElement(mn,null,_.default.createElement(gn,{suppressHydrationWarning:!0,style:{transform:`\n translateX(32px)\n translateY(23px)\n rotateX(${i}deg)\n rotateY(${l}deg)\n `,transition:r||s?`transform ${c}ms ease-in-out`:""},onMouseLeave:()=>{d("")}},_.default.createElement(fn,{face:"front",faceText:t.internatiolate(o,e.internationalization.fields.viewcubeFront),mouseOver:r,hoveredZone:u,setHoveredZone:d,activeZone:T,setActiveZone:p}),_.default.createElement(fn,{face:"back",faceText:t.internatiolate(o,e.internationalization.fields.viewcubeBack),mouseOver:r,hoveredZone:u,setHoveredZone:d,activeZone:T,setActiveZone:p}),_.default.createElement(fn,{face:"left",faceText:t.internatiolate(o,e.internationalization.fields.viewcubeLeft),mouseOver:r,hoveredZone:u,setHoveredZone:d,activeZone:T,setActiveZone:p}),_.default.createElement(fn,{face:"right",faceText:t.internatiolate(o,e.internationalization.fields.viewcubeRight),mouseOver:r,hoveredZone:u,setHoveredZone:d,activeZone:T,setActiveZone:p}),_.default.createElement(fn,{face:"top",faceText:t.internatiolate(o,e.internationalization.fields.viewcubeTop),mouseOver:r,hoveredZone:u,setHoveredZone:d,activeZone:T,setActiveZone:p}),_.default.createElement(fn,{face:"base",faceText:t.internatiolate(o,e.internationalization.fields.viewcubeBase),mouseOver:r,hoveredZone:u,setHoveredZone:d,activeZone:T,setActiveZone:p}))))})),On=r.connect((e=>({stateConfiguration:Mt.configuration.getConfiguration(e),stateInteractionTheme:Mt.themes.getInteractionTheme(e),stateTransformTime:Mt.space.getTransformTime(e)})),(e=>({dispatchRotateXWith:t=>e(yt.space.rotateXWith(t)),dispatchRotateYWith:t=>e(yt.space.rotateYWith(t)),dispatchSetAnimatedTransform:t=>e(yt.space.setAnimatedTransform(t)),dispatchSpaceResetTransform:()=>e(yt.space.spaceResetTransform())})),null,{context:Ut})((t=>{const{stateConfiguration:a,stateInteractionTheme:r,stateTransformTime:o,dispatchRotateXWith:i,dispatchRotateYWith:l,dispatchSetAnimatedTransform:s,dispatchSpaceResetTransform:c}=t,{elements:u,space:T}=a,{viewcube:p}=u,{buttons:f,conceal:E}=p,{fadeInTime:m}=T,[g,O]=n.useState(!1),[h,S]=n.useState(!1),R=(e,t)=>{switch(s(!0),e){case"rotateX":i(t);break;case"rotateY":l(t)}setTimeout((()=>{s(!1)}),o)};return n.useEffect((()=>{S(!0)}),[]),_.default.createElement(Ka,{onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),onMouseMove:()=>g?null:O(!0),conceal:E,mouseOver:g,isMounted:h,fadeInTime:m,"data-plurid-entity":e.PLURID_ENTITY_VIEWCUBE},_.default.createElement(_n,{mouseOver:g}),g&&f&&_.default.createElement(_.default.Fragment,null,_.default.createElement(qa,{style:{gridArea:"PVRotateUp"}},_.default.createElement(Qa,{theme:r,onClick:()=>R("rotateX",-90.1)},"▲")),_.default.createElement(qa,{theme:r,style:{gridArea:"PVRotateDown"}},_.default.createElement(Qa,{theme:r,onClick:()=>R("rotateX",90.1)},"▼")),_.default.createElement(qa,{theme:r,style:{gridArea:"PVRotateLeft"}},_.default.createElement(Qa,{theme:r,onClick:()=>R("rotateY",90.1)},"◀")),_.default.createElement(qa,{theme:r,style:{gridArea:"PVRotateRight"}},_.default.createElement(Qa,{theme:r,onClick:()=>R("rotateY",-90.1)},"▶")),_.default.createElement(Ja,{onClick:e=>{e.ctrlKey||e.metaKey||(s(!0),c(),setTimeout((()=>{s(!1)}),o))}},_.default.createElement(d.PluridIconGlobal,null))))})),hn=r.connect((e=>({stateConfiguration:Mt.configuration.getConfiguration(e)})),(e=>({})),null,{context:Ut})((e=>{const{stateConfiguration:t}=e,{elements:a}=t,{toolbar:n,viewcube:r}=a,o=n.show,i=r.show;return _.default.createElement(_.default.Fragment,null,_.default.createElement(la,null),o&&_.default.createElement(Za,null),i&&_.default.createElement(On,null))})),Sn=S.default.div`
|
|
469
|
-
position: absolute;
|
|
470
|
-
top: 50%;
|
|
471
|
-
left: 50%;
|
|
472
|
-
transform: translateX(-50%) translateY(-50%);
|
|
473
|
-
background: black;
|
|
474
|
-
color: white;
|
|
475
|
-
padding: 40px;
|
|
476
|
-
max-width: 500px;
|
|
477
|
-
width: 100%;
|
|
478
|
-
font-family: Ubuntu, -apple-system, BlinkMacSystemFont, Roboto,
|
|
479
|
-
'Open Sans', 'Helvetica Neue', 'Lucida Sans', sans-serif;
|
|
480
|
-
`,Rn=e=>{const{error:t}=e;return _.default.createElement(Sn,null,t)},{getRegisteredPlanes:An}=t.planes,In=r.connect((e=>({stateConfiguration:Mt.configuration.getConfiguration(e),stateTransform:Mt.space.getTransform(e),stateSpaceLoading:Mt.space.getLoading(e),stateSpaceView:Mt.space.getView(e)})),(e=>({dispatch:e,dispatchSetConfiguration:t=>e(yt.configuration.setConfiguration(t)),dispatchSetConfigurationMicro:()=>e(yt.configuration.setConfigurationMicro()),dispatchSpaceSetViewSize:t=>e(yt.space.setViewSize(t)),dispatchSetSpaceLoading:t=>e(yt.space.setSpaceLoading(t)),dispatchSetAnimatedTransform:t=>e(yt.space.setAnimatedTransform(t)),dispatchSetTransformTime:t=>e(yt.space.setTransformTime(t)),dispatchSetSpaceLocation:t=>e(yt.space.setSpaceLocation(t)),dispatchSetInitialTree:t=>e(yt.space.setInitialTree(t)),dispatchSetTree:t=>e(yt.space.setTree(t)),dispatchSetGeneralTheme:t=>e(yt.themes.setGeneralTheme(t)),dispatchSetInteractionTheme:t=>e(yt.themes.setInteractionTheme(t)),dispatchRotateX:t=>e(yt.space.rotateX(t)),dispatchRotateXWith:t=>e(yt.space.rotateXWith(t)),dispatchRotateY:t=>e(yt.space.rotateY(t)),dispatchRotateYWith:t=>e(yt.space.rotateYWith(t)),dispatchTranslateXWith:t=>e(yt.space.translateXWith(t)),dispatchTranslateYWith:t=>e(yt.space.translateYWith(t)),dispatchScaleUpWith:t=>e(yt.space.scaleUpWith(t)),dispatchScaleDownWith:t=>e(yt.space.scaleDownWith(t)),dispatchSpaceSetView:t=>e(yt.space.spaceSetView(t))})),null,{context:Ut})((a=>{const{planesRegistrar:r,customPlane:o,planeContext:i,planeContextValue:s,pubsub:c,planeNotFound:u,planeRenderError:d,stateConfiguration:T,stateTransform:p,stateSpaceView:f,dispatch:E,dispatchSetSpaceLocation:m,dispatchSetAnimatedTransform:g,dispatchSetTransformTime:O,dispatchSetTree:h,dispatchRotateXWith:S,dispatchRotateX:R,dispatchRotateYWith:A,dispatchRotateY:I,dispatchTranslateXWith:C,dispatchTranslateYWith:b,dispatchScaleUpWith:L,dispatchScaleDownWith:N,dispatchSpaceSetViewSize:U,dispatchSpaceSetView:v}=a,P=n.useRef(null),[y,w]=n.useState(c?[c]:[]),D=n.useCallback((t=>{const{transformLocks:a}=T.space;((t,a,n,r)=>{if(l.dom.verifyPathInputElement(a.path))return;const o=!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey);if("KeyF"===a.code&&o)return t(yt.configuration.toggleConfigurationSpaceFirstPerson());if(n){if("KeyW"===a.code&&o&&r.translationZ)return t(yt.space.viewCameraMoveForward());if("KeyS"===a.code&&o&&r.translationZ)return t(yt.space.viewCameraMoveBackward());if("KeyA"===a.code&&o&&r.translationX)return t(yt.space.viewCameraMoveLeft());if("KeyA"===a.code&&a.shiftKey&&r.rotationY)return t(yt.space.viewCameraTurnLeft());if("KeyD"===a.code&&o&&r.translationX)return t(yt.space.viewCameraMoveRight());if("KeyD"===a.code&&a.shiftKey&&r.rotationY)return t(yt.space.viewCameraTurnRight());if("KeyQ"===a.code&&o&&r.rotationX)return t(yt.space.viewCameraTurnUp());if("KeyZ"===a.code&&o&&r.rotationX)return t(yt.space.viewCameraTurnDown());if("KeyE"===a.code&&o&&r.translationY)return t(yt.space.viewCameraMoveUp());if("KeyC"===a.code&&o&&r.translationY)return t(yt.space.viewCameraMoveDown())}if("KeyR"===a.code&&o)return t(yt.configuration.setConfigurationSpaceTransformMode(e.TRANSFORM_MODES.ROTATION));if("KeyT"===a.code&&o)return t(yt.configuration.setConfigurationSpaceTransformMode(e.TRANSFORM_MODES.TRANSLATION));if("KeyS"===a.code&&o&&!n)return t(yt.configuration.setConfigurationSpaceTransformMode(e.TRANSFORM_MODES.SCALE));if("ArrowRight"===a.key){if(a.shiftKey&&r.rotationY)return t(yt.space.rotateLeft());if(a.altKey&&r.translationX)return t(yt.space.translateRight())}if("ArrowLeft"===a.key){if(a.shiftKey&&r.rotationY)return t(yt.space.rotateRight());if(a.altKey&&r.translationX)return t(yt.space.translateLeft())}if("ArrowUp"===a.key){if(a.shiftKey&&a.altKey&&r.translationZ)return t(yt.space.translateIn());if(a.shiftKey&&!a.altKey&&r.rotationX)return t(yt.space.rotateUp());if(a.altKey&&!a.shiftKey&&r.translationY)return t(yt.space.translateUp());if(a.metaKey||a.ctrlKey&&r.scale)return t(yt.space.scaleUp())}if("ArrowDown"===a.key){if(a.shiftKey&&a.altKey&&r.translationZ)return t(yt.space.translateOut());if(a.shiftKey&&!a.altKey&&r.rotationX)return t(yt.space.rotateDown());if(a.altKey&&!a.shiftKey&&r.translationY)return t(yt.space.translateDown());if(a.metaKey||a.ctrlKey&&r.scale)t(yt.space.scaleDown())}})(E,t,T.space.firstPerson,a)}),[T.space.firstPerson,T.space.transformLocks,E]),M=n.useCallback((t=>{const{transformMode:a,transformLocks:n}=T.space,r={rotation:a===e.TRANSFORM_MODES.ROTATION,translation:a===e.TRANSFORM_MODES.TRANSLATION,scale:a===e.TRANSFORM_MODES.SCALE};((e,t,a,n)=>{(t.shiftKey||t.metaKey||t.altKey||t.ctrlKey||a.rotation||a.translation||a.scale)&&t.preventDefault();const r={deltaX:t.deltaX,deltaY:t.deltaY},o=wt.getWheelDirection(r);a.rotation&&("left"===o&&n.rotationY&&e(yt.space.rotateLeft()),"right"===o&&n.rotationY&&e(yt.space.rotateRight()),"up"===o&&n.rotationX&&e(yt.space.rotateUp()),"down"===o&&n.rotationX&&e(yt.space.rotateDown())),t.shiftKey&&!t.altKey&&("up"===o&&n.rotationX&&e(yt.space.rotateUp()),"down"===o&&n.rotationX&&e(yt.space.rotateDown()),"left"===o&&n.rotationY&&e(yt.space.rotateLeft()),"right"===o&&n.rotationY&&e(yt.space.rotateRight())),a.translation&&("up"===o&&n.translationY&&e(yt.space.translateDown()),"down"===o&&n.translationY&&e(yt.space.translateUp()),"left"===o&&n.translationX&&e(yt.space.translateRight()),"right"===o&&n.translationX&&e(yt.space.translateLeft())),t.altKey&&t.shiftKey&&("up"===o&&n.translationZ&&e(yt.space.translateIn()),"down"===o&&n.translationZ&&e(yt.space.translateOut())),t.altKey&&!t.shiftKey&&("up"===o&&n.translationY&&e(yt.space.translateDown()),"down"===o&&n.translationY&&e(yt.space.translateUp()),"left"===o&&n.translationX&&e(yt.space.translateRight()),"right"===o&&n.translationX&&e(yt.space.translateLeft())),a.scale&&("down"===o&&n.scale&&e(yt.space.scaleUp()),"up"===o&&n.scale&&e(yt.space.scaleDown())),(t.metaKey||t.ctrlKey)&&("down"===o&&n.scale&&e(yt.space.scaleUp()),"up"===o&&n.scale&&e(yt.space.scaleDown()))})(E,t,r,n)}),[E,T.space.transformMode,T.space.transformLocks]),x=n.useCallback((()=>{const e=An(r),a=new t.space.tree.Tree({planes:e,configuration:T,view:f}).compute();h(a)}),[f,T]),F=t=>{t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_TRANSFORM,callback:e=>{const{value:t,internal:a}=e;a||m(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_ANIMATED_TRANSFORM,callback:e=>{const{value:t}=e;g(t.active),t.time?O(t.time):O(450)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_X_WITH,callback:e=>{const{value:t}=e;S(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_X_TO,callback:e=>{const{value:t}=e;R(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_Y_WITH,callback:e=>{const{value:t}=e;A(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_Y_TO,callback:e=>{const{value:t}=e;I(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_X_WITH,callback:e=>{const{value:t}=e;C(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_Y_WITH,callback:e=>{const{value:t}=e;b(t)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.VIEW_ADD_PLANE,callback:e=>{const{plane:t}=e,a=[...f,t];v(a)}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.VIEW_SET_PLANES,callback:e=>{const{view:t}=e;v([...t])}}),t.subscribe({topic:e.PLURID_PUBSUB_TOPIC.VIEW_REMOVE_PLANE,callback:e=>{const{plane:t}=e,a=f.filter((e=>"string"!=typeof e||e===t));v(a)}})},G=t=>{const a={value:Object.assign({},p),internal:!0};t.publish({topic:e.PLURID_PUBSUB_TOPIC.SPACE_TRANSFORM,data:a}),t.publish({topic:e.PLURID_PUBSUB_TOPIC.CONFIGURATION,data:T})},j=t=>{const{transformMode:a}=T.space,{velocity:n,distance:r,direction:o}=t;if(a===e.TRANSFORM_MODES.ALL)return;const i=a===e.TRANSFORM_MODES.ROTATION,l=a===e.TRANSFORM_MODES.TRANSLATION,s=a===e.TRANSFORM_MODES.SCALE;switch(g(!0),o){case 2:i&&A(60*n),l&&C(-1*r);break;case 4:i&&A(60*n),l&&C(r);break;case 8:i&&S(60*n),l&&b(-1*r),s&&L(n);break;case 16:i&&S(60*n),l&&b(r),s&&N(n)}setTimeout((()=>{g(!1)}),450)},V=t=>{const{transformMode:a}=T.space,{velocity:n,distance:r,direction:o}=t;if(a===e.TRANSFORM_MODES.ALL)return;const i=a===e.TRANSFORM_MODES.ROTATION,l=a===e.TRANSFORM_MODES.TRANSLATION,s=a===e.TRANSFORM_MODES.SCALE,c=20*n,u=r/5,d=n/4;switch(o){case 2:i&&A(c),l&&C(-1*u);break;case 4:i&&A(c),l&&C(u);break;case 8:i&&S(c),l&&b(-1*u),s&&L(d);break;case 16:i&&S(c),l&&b(u),s&&N(d)}};n.useEffect((()=>(P.current&&(P.current.addEventListener("keydown",D,{passive:!1}),P.current.addEventListener("wheel",M,{passive:!1})),()=>{P.current&&(P.current.removeEventListener("keydown",D),P.current.removeEventListener("wheel",M))})),[P.current,T.space.transformMode,T.space.firstPerson]),n.useEffect((()=>{const e=l.meta.debounce((()=>{if(P&&P.current){const e=P.current.offsetWidth,t=P.current.offsetHeight;U({width:e,height:t})}}),150);return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>(window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)})),[f,T]),n.useEffect((()=>{if("undefined"==typeof window)return;let t;return vt(void 0,void 0,void 0,(function*(){const a=(yield Dt()).default,{transformTouch:n}=T.space;delete a.defaults.cssProps.userSelect,delete a.defaults.cssProps.userDrag,delete a.defaults.cssProps.tapHighlightColor,delete a.defaults.cssProps.touchSelect,P.current&&(t=new a(P.current),t.get("pan").set({direction:a.DIRECTION_ALL}),t.get("swipe").set({direction:a.DIRECTION_ALL}),n===e.TRANSFORM_TOUCHES.PAN?t.on("pan",V):t.on("swipe",j))})),()=>{const{transformTouch:a}=T.space;a===e.TRANSFORM_TOUCHES.PAN?t&&t.off("pan",V):t&&t.off("swipe",j)}}),[P.current,T.space.transformTouch]),n.useEffect((()=>{const e=e=>{navigator.getGamepads()[e.gamepad.index]},t=e=>{navigator.getGamepads()[e.gamepad.index]};return window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),()=>{window.removeEventListener("gamepadconnected",e),window.removeEventListener("gamepaddisconnected",t)}}),[]),n.useEffect((()=>{for(const e of y)F(e)}),[y.length]),n.useEffect((()=>{for(const e of y)G(e)}),[y.length,T,p]),n.useEffect((()=>{x()}),[f]);const k={planesRegistrar:r,planeContext:i,planeContextValue:s,customPlane:o,planeNotFound:u,planeRenderError:d,registerPubSub:e=>{const t=[...y,e];w(t)}},Y=f.length>0?_.default.createElement(hn,null):_.default.createElement(Rn,{error:"the plurid' application must contain a view"});return _.default.createElement(Ft,{ref:P,tabIndex:0,transformMode:T.space.transformMode,"data-plurid-entity":e.PLURID_ENTITY_VIEW},_.default.createElement(xt,null),_.default.createElement(Pt.Provider,{value:k},Y))})),{registerPlanes:Cn}=t.planes;class bn extends n.Component{constructor(e,t){super(e),this.storeID=e.id||"default",this.context=t;const a=this.computeStore();this.store=Nt(a),this.subscribeStore()}componentDidUpdate(){const e=this.computeStore();this.store.dispatch({type:"SET_STATE",payload:e})}componentWillUnmount(){this.storeUnubscriber&&this.storeUnubscriber()}render(){return _.default.createElement(r.Provider,{store:this.store,context:Ut},_.default.createElement(In,Object.assign({},this.props)))}computeStore(){const{view:e,planes:a,configuration:n,precomputedState:r,planesRegistrar:o,id:i,useLocalStorage:l}=this.props;Cn(a,o);const s=this.store?this.store.getState():void 0,c=t.state.local.load(this.storeID,l),u=i&&this.context&&this.context.states[i]?this.context.states[i]:void 0;return t.state.compute(e,n,o,s,c,r,u)}subscribeStore(){this.store&&"undefined"!=typeof localStorage&&this.props.useLocalStorage&&(this.storeUnubscriber=this.store.subscribe((()=>{const e=this.store.getState(),t=JSON.stringify(e);localStorage.setItem("pluridState-"+this.storeID,t)})))}}bn.contextType=A;const Ln=S.default.div`
|
|
488
|
+
`,{matrixArrayToCSSMatrix:Tn,rotateMatrix:En,multiplyArrayOfMatrices:vn,scaleMatrix:Sn,translateMatrix:Pn}=a.interaction.matrix,{degToRad:bn}=a.interaction.quaternion,Rn=o.connect((e=>({stateLanguage:Ot.configuration.getConfiguration(e).global.language,spaceRotationX:Ot.space.getRotationX(e),spaceRotationY:Ot.space.getRotationY(e),stateAnimatedTransform:Ot.space.getAnimatedTransform(e),stateTransformTime:Ot.space.getTransformTime(e)})),(e=>({})),null,{context:Ge})((e=>{const{mouseOver:n,stateLanguage:o,spaceRotationX:i,spaceRotationY:l,stateAnimatedTransform:s,stateTransformTime:c}=e,[u,d]=r.useState(""),[f,p]=r.useState("");r.useEffect((()=>{u||p("")}),[i,l]);const m=(()=>{const e=32,t=23,a=0,n=0,r=0,o=0,s=En(bn(-i),bn(-l)),c=Pn(e,t,a),u=Sn(1),d=vn([c,vn([Pn(n,r,o),s,Pn(-n,-r,-o)]),u]);return Tn(d)})();return x.default.createElement(mn,null,x.default.createElement(gn,null,x.default.createElement(hn,{suppressHydrationWarning:!0,style:{transform:m,transition:n||s?`transform ${c}ms ease-in-out`:""},onMouseLeave:()=>{d("")}},x.default.createElement(pn,{face:"front",faceText:a.internatiolate(o,t.internationalization.fields.viewcubeFront),mouseOver:n,hoveredZone:u,setHoveredZone:d,activeZone:f,setActiveZone:p}),x.default.createElement(pn,{face:"back",faceText:a.internatiolate(o,t.internationalization.fields.viewcubeBack),mouseOver:n,hoveredZone:u,setHoveredZone:d,activeZone:f,setActiveZone:p}),x.default.createElement(pn,{face:"left",faceText:a.internatiolate(o,t.internationalization.fields.viewcubeLeft),mouseOver:n,hoveredZone:u,setHoveredZone:d,activeZone:f,setActiveZone:p}),x.default.createElement(pn,{face:"right",faceText:a.internatiolate(o,t.internationalization.fields.viewcubeRight),mouseOver:n,hoveredZone:u,setHoveredZone:d,activeZone:f,setActiveZone:p}),x.default.createElement(pn,{face:"top",faceText:a.internatiolate(o,t.internationalization.fields.viewcubeTop),mouseOver:n,hoveredZone:u,setHoveredZone:d,activeZone:f,setActiveZone:p}),x.default.createElement(pn,{face:"base",faceText:a.internatiolate(o,t.internationalization.fields.viewcubeBase),mouseOver:n,hoveredZone:u,setHoveredZone:d,activeZone:f,setActiveZone:p}))))})),In=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e),stateTransformTime:Ot.space.getTransformTime(e)})),(e=>({dispatchRotateXWith:t=>e(qe.space.rotateXWith(t)),dispatchRotateYWith:t=>e(qe.space.rotateYWith(t)),dispatchSetAnimatedTransform:t=>e(qe.space.setAnimatedTransform(t)),dispatchSpaceResetTransform:()=>e(qe.space.spaceResetTransform())})),null,{context:Ge})((e=>{const{stateConfiguration:a,stateInteractionTheme:n,stateTransformTime:o,dispatchRotateXWith:i,dispatchRotateYWith:l,dispatchSetAnimatedTransform:s,dispatchSpaceResetTransform:c}=e,{elements:u,space:f}=a,{viewcube:p}=u,{buttons:m,conceal:g}=p,{fadeInTime:h}=f,T=p.show,[E,v]=r.useState(!1),[S,P]=r.useState(!1),b=(e,t)=>{switch(s(!0),e){case"rotateX":i(t);break;case"rotateY":l(t)}setTimeout((()=>{s(!1)}),o)};return r.useEffect((()=>{P(!0)}),[]),T?x.default.createElement(Wa,{onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onMouseMove:()=>E?null:v(!0),conceal:g,mouseOver:E,isMounted:S,fadeInTime:h,"data-plurid-entity":t.PLURID_ENTITY_VIEWCUBE},x.default.createElement(Rn,{mouseOver:E}),E&&m&&x.default.createElement(x.default.Fragment,null,x.default.createElement(Ha,{style:{gridArea:"PVRotateUp"}},x.default.createElement(qa,{theme:n,onClick:()=>b("rotateX",-90.1)},"▲")),x.default.createElement(Ha,{theme:n,style:{gridArea:"PVRotateDown"}},x.default.createElement(qa,{theme:n,onClick:()=>b("rotateX",90.1)},"▼")),x.default.createElement(Ha,{theme:n,style:{gridArea:"PVRotateLeft"}},x.default.createElement(qa,{theme:n,onClick:()=>b("rotateY",90.1)},"◀")),x.default.createElement(Ha,{theme:n,style:{gridArea:"PVRotateRight"}},x.default.createElement(qa,{theme:n,onClick:()=>b("rotateY",-90.1)},"▶")),x.default.createElement(Ja,{onClick:e=>{e.ctrlKey||e.metaKey||(s(!0),c(),setTimeout((()=>{s(!1)}),o))}},x.default.createElement(d.PluridIconGlobal,null)))):x.default.createElement(x.default.Fragment,null)})),Cn=e=>x.default.createElement(x.default.Fragment,null,x.default.createElement(Jt,null),x.default.createElement(ta,null),x.default.createElement(Ga,null),x.default.createElement(In,null)),wn=o.connect((e=>({state:e,stateConfiguration:Ot.configuration.getConfiguration(e),stateTransform:Ot.space.getTransform(e),stateResolvedLayout:Ot.space.getResolvedLayout(e),stateTree:Ot.space.getTree(e),stateSpaceLoading:Ot.space.getLoading(e),stateSpaceView:Ot.space.getView(e),stateGeneralTheme:Ot.themes.getGeneralTheme(e)})),(e=>({dispatch:e,dispatchSetConfiguration:t=>e(qe.configuration.setConfiguration(t)),dispatchSetConfigurationMicro:()=>e(qe.configuration.setConfigurationMicro()),dispatchSetSpaceField:t=>e(qe.space.setSpaceField(t)),dispatchSpaceSetViewSize:t=>e(qe.space.setViewSize(t)),dispatchSetSpaceLoading:t=>e(qe.space.setSpaceLoading(t)),dispatchSetAnimatedTransform:t=>e(qe.space.setAnimatedTransform(t)),dispatchSetTransformTime:t=>e(qe.space.setTransformTime(t)),dispatchSetSpaceLocation:t=>e(qe.space.setSpaceLocation(t)),dispatchSetTree:t=>e(qe.space.setTree(t)),dispatchSetGeneralTheme:t=>e(qe.themes.setGeneralTheme(t)),dispatchSetInteractionTheme:t=>e(qe.themes.setInteractionTheme(t)),dispatchRotateX:t=>e(qe.space.rotateX(t)),dispatchRotateXWith:t=>e(qe.space.rotateXWith(t)),dispatchRotateY:t=>e(qe.space.rotateY(t)),dispatchRotateYWith:t=>e(qe.space.rotateYWith(t)),dispatchTranslateXWith:t=>e(qe.space.translateXWith(t)),dispatchTranslateYWith:t=>e(qe.space.translateYWith(t)),dispatchTranslateZWith:t=>e(qe.space.translateZWith(t)),dispatchScaleUpWith:t=>e(qe.space.scaleUpWith(t)),dispatchScaleDownWith:t=>e(qe.space.scaleDownWith(t)),dispatchSpaceSetView:t=>e(qe.space.spaceSetView(t))})),null,{context:Ge})((e=>{const{planesRegistrar:n,customPlane:o,planeContext:i,planeContextValue:s,pubsub:c,planeNotFound:u,planeRenderError:d,matchedRoute:f,hostname:p,state:m,stateConfiguration:g,stateResolvedLayout:h,stateTransform:T,stateSpaceView:E,stateTree:v,stateGeneralTheme:S,dispatch:P,dispatchSetConfiguration:b,dispatchSetGeneralTheme:R,dispatchSetInteractionTheme:I,dispatchSetSpaceField:C,dispatchSetSpaceLocation:w,dispatchSetAnimatedTransform:O,dispatchSetTransformTime:y,dispatchSetTree:_,dispatchRotateXWith:L,dispatchRotateX:A,dispatchRotateYWith:U,dispatchRotateY:M,dispatchTranslateXWith:k,dispatchTranslateYWith:F,dispatchTranslateZWith:B,dispatchScaleUpWith:Y,dispatchScaleDownWith:$,dispatchSpaceSetViewSize:X,dispatchSpaceSetView:V}=e,z=r.useRef(null),K=r.useRef(),[Z,j]=r.useState(c?[c]:[new D.default]),[G,W]=r.useState(!1),H=r.useCallback((e=>{const{transformLocks:t}=g.space;Ct(P,m,Z[0],e,g.space.firstPerson,t)}),[JSON.stringify(m),g.space.firstPerson,g.space.transformLocks,P]),q=r.useCallback((e=>{(e=>{(e.shiftKey||e.altKey||e.metaKey||e.ctrlKey)&&W(!0),clearTimeout(K.current),K.current=setTimeout((()=>{W(!1)}),t.PLURID_DEFAULT_PREVENT_OVERSCROLL_TIMEOUT)})(e);const{transformMode:n,transformLocks:r}=g.space,o={rotation:n===t.TRANSFORM_MODES.ROTATION,translation:n===t.TRANSFORM_MODES.TRANSLATION,scale:n===t.TRANSFORM_MODES.SCALE};((e,n,r,o)=>{(n.shiftKey||n.metaKey||n.altKey||n.ctrlKey||r.rotation||r.translation||r.scale)&&n.preventDefault();const i={deltaX:n.deltaX,deltaY:n.deltaY},l=a.interaction.direction.getWheelDirection(i,100);if(r.rotation){if(l===t.directions.left&&o.rotationY)return e(qe.space.rotateLeft());if(l===t.directions.right&&o.rotationY)return e(qe.space.rotateRight());if(l===t.directions.up&&o.rotationX)return e(qe.space.rotateUp());if(l===t.directions.down&&o.rotationX)return e(qe.space.rotateDown())}if(n.shiftKey&&!n.altKey){if(l===t.directions.up&&o.rotationX)return e(qe.space.rotateUp());if(l===t.directions.down&&o.rotationX)return e(qe.space.rotateDown());if(l===t.directions.left&&o.rotationY)return e(qe.space.rotateLeft());if(l===t.directions.right&&o.rotationY)return e(qe.space.rotateRight())}if(r.translation){if(n.metaKey||n.ctrlKey)return l===t.directions.up?e(qe.space.translateDown()):l===t.directions.down?e(qe.space.translateUp()):void 0;if(n.altKey){if(l===t.directions.up&&o.translationZ)return e(qe.space.translateIn());if(l===t.directions.down&&o.translationZ)return e(qe.space.translateOut())}if(l===t.directions.up&&o.translationY)return e(qe.space.translateDown());if(l===t.directions.down&&o.translationY)return e(qe.space.translateUp());if(l===t.directions.left&&o.translationX)return e(qe.space.translateRight());if(l===t.directions.right&&o.translationX)return e(qe.space.translateLeft())}if(n.altKey&&n.shiftKey){if(l===t.directions.up&&o.translationZ)return e(qe.space.translateIn());if(l===t.directions.down&&o.translationZ)return e(qe.space.translateOut())}if(n.altKey&&!n.shiftKey){if(n.metaKey||n.ctrlKey)return l===t.directions.up?e(qe.space.translateDown()):l===t.directions.down?e(qe.space.translateUp()):void 0;if(l===t.directions.up&&o.translationY)return e(qe.space.translateDown());if(l===t.directions.down&&o.translationY)return e(qe.space.translateUp());if(l===t.directions.left&&o.translationX)return e(qe.space.translateRight());if(l===t.directions.right&&o.translationX)return e(qe.space.translateLeft())}if(r.scale){if(l===t.directions.down&&o.scale)return e(qe.space.scaleUp());if(l===t.directions.up&&o.scale)return e(qe.space.scaleDown())}if(n.metaKey||n.ctrlKey){if(l===t.directions.down&&o.scale)return e(qe.space.scaleUp());if(l===t.directions.up&&o.scale)e(qe.space.scaleDown())}})(P,e,o,r)}),[P,g.space.transformMode,g.space.transformLocks]),J=(e,t=g,r)=>{const o=oe(n),i=new a.space.tree.Tree({planes:o,configuration:t,view:e,layout:r},p).compute();for(const e of v)for(const[t,a]of i.entries())e.route===a.route&&l.objects.equals(e.location,a.location)&&(a.planeID=e.planeID,e.children&&(i[t].children=e.children));_(i)},Q=r.useCallback((()=>{J(E,g)}),[p,E,g,JSON.stringify(v)]),ee=e=>{const n=[{topic:t.PLURID_PUBSUB_TOPIC.CONFIGURATION,callback:e=>{if(e.internal)return;const t=a.general.configuration.merge(e,g);"object"==typeof t.global.theme?("string"==typeof t.global.theme.general?R(N.default[t.global.theme.general]):R(t.global.theme.general),"string"==typeof t.global.theme.interaction?I(N.default[t.global.theme.interaction]):I(t.global.theme.interaction)):"string"==typeof t.global.theme&&(R(N.default[t.global.theme]),I(N.default[t.global.theme])),b(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSFORM,callback:e=>{const{value:t,internal:a}=e;a||w(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_ANIMATED_TRANSFORM,callback:e=>{const{value:t}=e;O(t.active),t.time?y(t.time):y(450)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_X_WITH,callback:e=>{const{value:t}=e;L(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_X_TO,callback:e=>{const{value:t}=e;A(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_Y_WITH,callback:e=>{const{value:t}=e;U(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_ROTATE_Y_TO,callback:e=>{const{value:t}=e;M(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_X_WITH,callback:e=>{const{value:t}=e;k(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_X_TO,callback:e=>{}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_Y_WITH,callback:e=>{const{value:t}=e;F(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_Y_TO,callback:e=>{}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_Z_WITH,callback:e=>{const{value:t}=e;B(t)}},{topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSLATE_Z_TO,callback:e=>{}},{topic:t.PLURID_PUBSUB_TOPIC.VIEW_ADD_PLANE,callback:e=>{const{plane:t}=e,a=[...E,t];V(a),J(a)}},{topic:t.PLURID_PUBSUB_TOPIC.VIEW_SET_PLANES,callback:e=>{const{view:t}=e;V([...t]),J(t)}},{topic:t.PLURID_PUBSUB_TOPIC.VIEW_REMOVE_PLANE,callback:e=>{const{plane:t}=e,a=E.filter((e=>"string"!=typeof e||e===t));V(a),J(a)}},{topic:t.PLURID_PUBSUB_TOPIC.NAVIGATE_TO_PLANE,callback:e=>{const{id:t}=e,n=a.space.tree.logic.getTreePlaneByID(v,t);Et(P,n)}},{topic:t.PLURID_PUBSUB_TOPIC.ISOLATE_PLANE,callback:e=>{const{id:t}=e;"string"==typeof t&&C({field:"isolatePlane",value:t})}},{topic:t.PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE,callback:()=>{const e=v.find((e=>e.planeID===m.space.lastClosedPlane));if(e){const t=!0,{updatedTree:n}=a.space.tree.logic.togglePlaneFromTree(v,e.planeID,t);_(n),C({field:"lastClosedPlane",value:""})}}},{topic:t.PLURID_PUBSUB_TOPIC.CLOSE_PLANE,callback:e=>{const{id:t}=e,n=v.find((e=>e.planeID===t));if(n){const e=!1,{updatedTree:r}=a.space.tree.logic.togglePlaneFromTree(v,n.planeID,e);_(r),setTimeout((()=>{_(r)}),50),C({field:"lastClosedPlane",value:t})}}},{topic:t.PLURID_PUBSUB_TOPIC.PREVIOUS_ROOT,callback:()=>{bt(P,m)}},{topic:t.PLURID_PUBSUB_TOPIC.NEXT_ROOT,callback:()=>{Rt(P,m)}},{topic:t.PLURID_PUBSUB_TOPIC.NAVIGATE_TO_ROOT,callback:e=>{const t=e.index;if(void 0!==t)return void It(P,m,t);const a=e.id;((e,t,a)=>{const{tree:n}=t.space,r=n.find((e=>e.planeID===a));r&&Et(e,r,void 0,!0)})(P,m,a)}}],r=[];for(const t of n){const a=e.subscribe(t);r.push(a)}return()=>{for(const t of r)e.unsubscribe(t)}},te=e=>{const a={value:Object.assign({},T),internal:!0};e.publish({topic:t.PLURID_PUBSUB_TOPIC.SPACE_TRANSFORM,data:a}),e.publish({topic:t.PLURID_PUBSUB_TOPIC.CONFIGURATION,data:Object.assign(Object.assign({},g),{internal:!0})})},ae=e=>{const{transformMode:a}=g.space;if(a===t.TRANSFORM_MODES.ALL)return;const{velocity:n,distance:r,direction:o}=e,{altKey:i}=e.srcEvent,l=a===t.TRANSFORM_MODES.ROTATION,s=a===t.TRANSFORM_MODES.TRANSLATION,c=a===t.TRANSFORM_MODES.SCALE;switch(Tt(P),o){case 2:l&&U(60*n),s&&k(-1*r);break;case 4:l&&U(60*n),s&&k(r);break;case 8:l&&L(60*n),s&&(i?B(-1*r):F(-1*r)),c&&Y(n);break;case 16:l&&L(60*n),s&&(i?B(r):F(r)),c&&$(n)}},ne=e=>{const{transformMode:a}=g.space;if(a===t.TRANSFORM_MODES.ALL)return;const{velocity:n,distance:r,direction:o}=e,{altKey:i}=e.srcEvent,l=a===t.TRANSFORM_MODES.ROTATION,s=a===t.TRANSFORM_MODES.TRANSLATION,c=a===t.TRANSFORM_MODES.SCALE,u=20*n,d=r/5,f=n/4;switch(o){case 2:l&&U(u),s&&k(-1*d);break;case 4:l&&U(u),s&&k(d);break;case 8:l&&L(u),s&&(i?B(-1*d):F(-1*d)),c&&Y(f);break;case 16:l&&L(u),s&&(i?B(d):F(d)),c&&$(f)}},re=(e,t)=>{const{transformMode:a}=g.space;if("TRANSLATION"!==a)return;B(20*("in"===t?1:-1))},ie=e=>{re(0,"in")},le=e=>{re(0,"out")};r.useEffect((()=>(z.current&&(z.current.addEventListener("keydown",H,{passive:!1}),z.current.addEventListener("wheel",q,{passive:!1})),()=>{z.current&&(z.current.removeEventListener("keydown",H),z.current.removeEventListener("wheel",q))})),[JSON.stringify(m),z.current,g.space.transformMode,g.space.firstPerson]),r.useEffect((()=>{const e=l.meta.debounce((()=>{if(z&&z.current){const e=z.current.offsetWidth,t=z.current.offsetHeight;X({width:e,height:t})}}),t.PLURID_DEFAULT_RESIZE_DEBOUNCE_TIME);return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),r.useEffect((()=>(window.addEventListener("resize",Q),()=>{window.removeEventListener("resize",Q)})),[E,g,JSON.stringify(v)]),r.useEffect((()=>{if("undefined"==typeof window)return;let e;return We(void 0,void 0,void 0,(function*(){const a=(yield wt()).default,{transformTouch:n}=g.space;delete a.defaults.cssProps.userSelect,delete a.defaults.cssProps.userDrag,delete a.defaults.cssProps.tapHighlightColor,delete a.defaults.cssProps.touchSelect,z.current&&(e=new a(z.current),e.get("pan").set({direction:a.DIRECTION_ALL}),e.get("swipe").set({direction:a.DIRECTION_ALL}),e.get("pinch").set({enable:!0}),n===t.TRANSFORM_TOUCHES.PAN?e.on("pan",ne):e.on("swipe",ae),e.on("pinchin",ie),e.on("pinchout",le))})),()=>{if(!e)return;const{transformTouch:a}=g.space;a===t.TRANSFORM_TOUCHES.PAN?e.off("pan",ne):e.off("swipe",ae),e.off("pinchin",ie),e.off("pinchout",le)}}),[z.current,g.space.transformTouch,g.space.transformMode]),r.useEffect((()=>{const e=e=>{navigator.getGamepads()[e.gamepad.index]},t=e=>{navigator.getGamepads()[e.gamepad.index]};return window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",t),()=>{window.removeEventListener("gamepadconnected",e),window.removeEventListener("gamepaddisconnected",t)}}),[]),r.useEffect((()=>{const e=[];for(const t of Z){const a=ee(t);e.push(a)}return()=>{for(const t of e)t()}}),[m.space.lastClosedPlane,Z.length,JSON.stringify(v)]),r.useEffect((()=>{for(const e of Z)te(e)}),[Z.length,g,T]),r.useEffect((()=>{Q()}),[]),r.useEffect((()=>{h||(J(E,g,!0),C({field:"resolvedLayout",value:!0}))}),[h]);const se={planesRegistrar:n,planeContext:i,planeContextValue:s,customPlane:o,planeNotFound:u,planeRenderError:d,matchedRoute:f,hostname:p,defaultPubSub:Z[0],registerPubSub:e=>{const t=[...Z,e];j(t)}};return x.default.createElement(_t,{ref:z,tabIndex:0,transformMode:g.space.transformMode,"data-plurid-entity":t.PLURID_ENTITY_VIEW},x.default.createElement(yt,{theme:S,preventOverscroll:G}),x.default.createElement(He.Provider,{value:se},0!==E.length?x.default.createElement(Cn,null):x.default.createElement(x.default.Fragment,null)))}));class On extends r.Component{constructor(e,t){super(e),this.storeID=e.id||"default",this.context=t,this.prepare(),this.store=je(this.computeStore()),this.subscribeStore()}componentDidUpdate(){const e=this.computeStore();this.store.dispatch({type:"SET_STATE",payload:e})}componentWillUnmount(){this.storeUnubscriber&&this.storeUnubscriber()}render(){return x.default.createElement(o.Provider,{store:this.store,context:Ge},x.default.createElement(wn,Object.assign({},this.props,{planesRegistrar:this.planesRegistrar})))}prepare(){this.planesRegistrar="undefined"!=typeof window||this.props.planesRegistrar?this.props.planesRegistrar:new de(this.props.planes,this.props.hostname)}computeStore(){const{view:e,planes:t,configuration:n,precomputedState:r,useLocalStorage:o,hostname:i,space:l}=this.props;re(t,this.planesRegistrar,i);const s=this.store?this.store.getState():void 0,c=a.state.local.load(this.storeID,o);return a.state.compute(e,n,this.planesRegistrar,s,c,r,undefined,i)}subscribeStore(){this.store&&"undefined"!=typeof localStorage&&this.props.useLocalStorage&&(this.storeUnubscriber=this.store.subscribe((()=>{const e=this.store.getState(),t=JSON.stringify(e);localStorage.setItem("pluridState-"+this.storeID,t)})))}}On.contextType=F;const yn=M.default.div`
|
|
481
489
|
scroll-snap-type: ${e=>{const{alignment:t,snapType:a}=e;return"none"===a?"none":t+" "+a}};
|
|
482
490
|
|
|
483
491
|
flex-direction: ${e=>{const{alignment:t}=e;return"x"===t?"row":"column"}};
|
|
@@ -488,7 +496,19 @@
|
|
|
488
496
|
height: 100vh;
|
|
489
497
|
height: -webkit-fill-available;
|
|
490
498
|
width: 100vw;
|
|
491
|
-
`,
|
|
499
|
+
`,_n=(e,n,r,o,i="origin")=>{if(o||"RoutePlane"===(null==e?void 0:e.kind)){const t=o||e;if(!t)return()=>()=>x.default.createElement(x.default.Fragment,null);return Ln(t,n,i)}if(!e){const e=r.match("/not-found","route");if(e&&"Route"===e.kind){return _n(e,n,r,void 0,i)}return()=>()=>x.default.createElement(x.default.Fragment,null)}const{exterior:s,view:c,planes:u,spaces:d,defaultConfiguration:f,slotted:p,resolver:m}=e.data;m&&m(void 0);const g={value:e.match.value,parameters:e.match.parameters,query:e.match.query};let h;return Zt(s)&&(h=s,h&&(h.displayName="PluridRouteExterior")),!s||!h||c||u||d?c?()=>{const t=new D.default,a=e.data.value,r=x.default.createElement(On,{view:c,planesRegistrar:n,configuration:f,pubsub:t,matchedRoute:e,hostname:i,space:a});return()=>x.default.createElement(x.default.Fragment,null,h&&x.default.createElement(h,{plurid:g,pubsub:t,spaces:p?[r]:void 0}),!p&&x.default.createElement(x.default.Fragment,null,r))}:((e,n="origin")=>{var r,o,i,s,c,u;if("Route"!==e.kind)return()=>()=>x.default.createElement(x.default.Fragment,null);const d="http",f=n,{match:p,data:m}=e,{parameters:g,query:h}=p,T={value:p.value,parameters:g,query:h},{exterior:E,planes:v,spaces:S,slotted:P}=e.data,b=(null===(r=m.multispace)||void 0===r?void 0:r.alignment)||"y",R=(null===(o=m.multispace)||void 0===o?void 0:o.snapType)||"mandatory";let I=()=>x.default.createElement(x.default.Fragment,null);Zt(E)&&(I=E);let C=()=>x.default.createElement(x.default.Fragment,null);const w=[];if(S)for(const e of S){const r=[],o=[];if(e.planes)for(const n of e.planes){const i=ce(n),{component:l}=i,s=[d,f,m.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(m.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),t.PLURID_ROUTE_DEFAULT_UNIVERSE,t.PLURID_ROUTE_DEFAULT_CLUSTER,a.utilities.cleanPathElement(i.value)].join(t.PLURID_ROUTE_SEPARATOR),c={component:l,route:s};r.push(c),o.push(s)}if(e.universes)for(const n of e.universes)if(n.planes)for(const i of n.planes){const l=ce(i),{component:s}=l,c=[d,f,m.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(m.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),n.value===t.PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE?t.PLURID_ROUTE_DEFAULT_UNIVERSE:a.utilities.cleanPathElement(n.value),t.PLURID_ROUTE_DEFAULT_CLUSTER,a.utilities.cleanPathElement(l.value)].join(t.PLURID_ROUTE_SEPARATOR),u={component:s,route:c};r.push(u),o.push(c)}const i=new de([],"localhost:63000"),s=x.default.createElement(On,{key:l.uuid.generate(),id:m.value,planes:r,view:o,configuration:e.configuration,planesRegistrar:i,hostname:n});w.push(s)}if(v){const e=[],r=[];for(const n of v){const o=ce(n),{component:i}=o,l=[d,f,m.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(m.value),t.PLURID_ROUTE_DEFAULT_SPACE,t.PLURID_ROUTE_DEFAULT_UNIVERSE,t.PLURID_ROUTE_DEFAULT_CLUSTER,a.utilities.cleanPathElement(o.value)].join(t.PLURID_ROUTE_SEPARATOR),s={component:i,route:l};e.push(s),m.view?m.view.includes(o.value)&&r.push(l):r.push(l)}const o=x.default.createElement(On,{key:l.uuid.generate(),id:m.value,planes:e,view:r,configuration:m.defaultConfiguration,hostname:n});w.push(o)}let O,y;return Zt(null===(i=m.multispace)||void 0===i?void 0:i.header)&&(O=null===(s=m.multispace)||void 0===s?void 0:s.header),Zt(null===(c=m.multispace)||void 0===c?void 0:c.footer)&&(y=null===(u=m.multispace)||void 0===u?void 0:u.footer),C=()=>x.default.createElement(yn,{alignment:b,snapType:R,"data-plurid-entity":t.PLURID_ENTITY_MULTISPACE},O&&x.default.createElement(O,{plurid:T}),w,y&&x.default.createElement(y,{plurid:T})),()=>()=>x.default.createElement(x.default.Fragment,null,E&&x.default.createElement(I,{spaces:P?w:void 0,plurid:T}),(S||v)&&!P&&x.default.createElement(C,null))})(e):()=>()=>x.default.createElement(x.default.Fragment,null,h&&x.default.createElement(h,{plurid:g}))},Ln=(e,t,a="origin")=>{if(e.match.query.flat){const a=e.match.query.flat.toLowerCase();if("true"===a||"1"===a){const a=t.get(e.match.value);if(a){const e=a.component;if("function"!=typeof e)return()=>()=>x.default.createElement(x.default.Fragment,null);return()=>()=>x.default.createElement(x.default.Fragment,null,x.default.createElement(e,null))}}}const{defaultConfiguration:n}=null==e?void 0:e.data;return()=>()=>x.default.createElement(x.default.Fragment,null,x.default.createElement(On,{view:[e.match.value],planesRegistrar:t,configuration:n,hostname:a}))},An=M.default.div`
|
|
500
|
+
height: 0;
|
|
501
|
+
width: 0;
|
|
502
|
+
`,Un=M.default.div`
|
|
503
|
+
position: absolute;
|
|
504
|
+
top: 0;
|
|
505
|
+
left: 0;
|
|
506
|
+
right: 0;
|
|
507
|
+
bottom: 0;
|
|
508
|
+
background-color: black;
|
|
509
|
+
pointer-events: none;
|
|
510
|
+
z-index: 999999;
|
|
511
|
+
`,Dn=e=>{const{time:t}=e,[a,n]=r.useState(!1);return r.useEffect((()=>{t>0&&setTimeout((()=>{n(!0)}),t)}),[]),a||0===t?x.default.createElement(x.default.Fragment,null):x.default.createElement(Un,null)},xn=e=>{const{routes:a,planes:n,exterior:o,shell:i,hostname:s,scrollToTop:c,fadeIn:d,static:f,view:p,cleanNavigation:m,notFoundPath:g}=e,h=g||"/not-found",T=null!=d?d:10,E=((e,t)=>{const a=[];for(const t of e){if(t.planes)for(const e of t.planes){const n=ce(e),r={route:n.link?n.link:n.value.startsWith("/")?n.value:t.value+"/"+n.value,component:n.component};a.push(r)}t.spaces}if(t)for(const e of t){const t=ce(e),n={route:t.value,component:t.component};a.push(n)}return a})(a,n),v=r.useRef(null),S=r.useRef(new de(E,s)),P=r.useRef(new fe({routes:a,routePlanes:n},s)),b=u.useMounted(),[R,I]=r.useState((e=>e?e.path:"undefined"!=typeof window?window.location.pathname+window.location.search:"/")(f)),[C,w]=r.useState(P.current.match(R,"route")),[O,y]=r.useState(_n(C,S.current,P.current,f&&f.directPlane?P.current.match(f.directPlane,"route"):void 0,s)),_=e=>{let t;e&&e.detail&&e.detail.path&&!t&&(t=e.detail.path),m&&p&&!t&&(t=p);const a=window.location.pathname;t||(t=a+window.location.search),I(t),(()=>{if(!v.current||!1===c)return;const e=void 0===c||!0===c||"smooth"===c?"smooth":"auto";v.current.scrollIntoView({behavior:e})})()};let L;r.useEffect((()=>(window.addEventListener("popstate",_),window.addEventListener(t.PLURID_ROUTER_LOCATION_CHANGED,_),()=>{window.removeEventListener("popstate",_),window.removeEventListener(t.PLURID_ROUTER_LOCATION_CHANGED,_)})),[]),r.useEffect((()=>{if(!b)return;m||location.pathname!==R&&history.pushState(null,"",R);let e=P.current.match(R,"route");if(e&&"RoutePlane"===e.kind){const t=Ln(e,S.current,s);return w(e),void y(t)}e||(e=P.current.match(h,"route")),w(e),y(_n(e,S.current,P.current,void 0,s))}),[b,R]),r.useEffect((()=>{if(!C)return;if("Route"!==C.kind)return;const e=C.match.value;l.storage.saveState(e,t.PLURID_ROUTER_STORAGE);const a=new CustomEvent(t.PLURID_ROUTER_LOCATION_STORED,{detail:{path:e}});window.dispatchEvent(a)}),[m,C]),Zt(o)&&(L=o,L&&(L.displayName="PluridRouterExterior"));let A=({children:e})=>x.default.createElement(x.default.Fragment,null,e);return Zt(i)&&(A=i,A&&(A.displayName="PluridRouterShell")),x.default.createElement(x.default.Fragment,null,x.default.createElement(Dn,{time:T}),x.default.createElement(An,{ref:v}),L&&x.default.createElement(L,{matchedRoute:C}),x.default.createElement(A,{matchedRoute:C},x.default.createElement(O,null)))},Nn=e=>{const{path:t,directPlane:a,routes:n,planes:r,exterior:o,shell:i,protocol:l,hostname:s,gateway:c,gatewayQuery:u,gatewayEndpoint:d,routerProperties:f}=e,p=l||"http",m=s||"origin";return x.default.createElement(xn,Object.assign({routes:n,planes:r,exterior:o,shell:i,static:{path:t,directPlane:a},protocol:p,hostname:m},f))};class Mn extends r.Component{constructor(e){super(e),this.properties=e}render(){const{metastate:e,children:t}=this.properties;return x.default.createElement(F.Provider,{value:e},t)}}Mn.displayName="PluridProvider";const kn={x:0,y:0},Fn=e=>{const{elementID:t,rootID:a,children:n}=e,r=u.usePortal(t,a);return p.createPortal(n,r)},Bn=M.default.div`
|
|
492
512
|
position: absolute;
|
|
493
513
|
min-width: 600px;
|
|
494
514
|
min-height: 300px;
|
|
@@ -498,7 +518,7 @@
|
|
|
498
518
|
left: ${({linkCoordinates:e})=>e.x+5+"px"};
|
|
499
519
|
background-color: ${({theme:e})=>e.backgroundColorSecondary};
|
|
500
520
|
box-shadow: ${({theme:e})=>e.boxShadowUmbra};
|
|
501
|
-
`,
|
|
521
|
+
`,Yn=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{planeRoute:t,linkCoordinates:a,previewComponent:n,previewOffsetX:o,previewOffsetY:i,stateGeneralTheme:l}=e,s={x:a.x+(null!=o?o:0),y:a.y+(null!=i?i:0)},c=r.useContext(He);if(!c)return x.default.createElement(x.default.Fragment,null);const{planesRegistrar:u}=c,d=ie(u);if(!d)return x.default.createElement(x.default.Fragment,null);const f=d.get(t);if(!f)return x.default.createElement(x.default.Fragment,null);const p=null!=n?n:f.component;return"function"!=typeof p?x.default.createElement(x.default.Fragment,null):x.default.createElement(Bn,{theme:l,linkCoordinates:s},x.default.createElement(p,null))})),$n=M.default.a`
|
|
502
522
|
/**
|
|
503
523
|
* Forces element to go to the second row if inlined.
|
|
504
524
|
*/
|
|
@@ -514,23 +534,35 @@
|
|
|
514
534
|
::after {
|
|
515
535
|
content: "${({devisible:e,suffix:t})=>e?"":t||"'"}";
|
|
516
536
|
}
|
|
517
|
-
`,
|
|
518
|
-
|
|
537
|
+
`,Xn=o.connect((e=>({stateTree:Ot.space.getTree(e),stateLastClosedPlane:Ot.space.getLastClosedPlane(e),stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateConfiguration:Ot.configuration.getConfiguration(e),stateViewSize:Ot.space.getViewSize(e)})),(e=>({dispatch:e,dispatchSetTree:t=>e(qe.space.setTree(t)),dispatchSetSpaceField:t=>e(qe.space.setSpaceField(t)),dispatchUpdateSpaceLinkCoordinates:t=>e(qe.space.updateSpaceLinkCoordinates(t)),dispatchRemovePlane:t=>e(qe.space.removePlane(t))})),null,{context:Ge})((e=>{const n=r.useContext(He);if(!n)return x.default.createElement(x.default.Fragment,null,e.children);const{hostname:o,planesRegistrar:i,defaultPubSub:s}=n,c=ie(i);if(!c)return x.default.createElement(x.default.Fragment,null,e.children);const{children:d,route:f,devisible:p,suffix:m,atClick:g,style:h,className:T,preview:E,previewComponent:v,previewFadeIn:S,previewFadeOut:P,previewOffsetX:b,previewOffsetY:R,stateTree:I,stateLastClosedPlane:C,stateGeneralTheme:w,stateConfiguration:O,stateViewSize:y,dispatch:_,dispatchSetTree:L,dispatchSetSpaceField:A,dispatchUpdateSpaceLinkCoordinates:U,dispatchRemovePlane:D}=e,N=O.elements.plane.controls.show,M=S||t.PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_IN,k=P||t.PLURID_DEFAULT_CONFIGURATION_LINK_PREVIEW_FADE_OUT,F=me(f),B=pe(F,O.network.protocol,o||O.network.host),Y=null!=m?m:t.PLURID_DEFAULT_CONFIGURATION_LINK_SUFFIX,$=null!=p&&p,X=r.useRef(null),V=r.useRef(null),z=r.useRef(null),[K,Z]=r.useState(!1),[j,G]=r.useState(!1),[W,H]=r.useState(!1),[q,J]=r.useState(""),[Q,ee]=r.useState(le(X.current)),[te,ae]=r.useState(kn),ne=()=>{const e=X.current;if(!e)return Object.assign({},kn);let t=0,a=0,n=!1,r=e,o=!0,i=0,l=0;for(;o;)if("static"!==window.getComputedStyle(r).position||n||(t+=r.offsetTop,a+=r.offsetLeft,n=!0),"relative"===window.getComputedStyle(r).position&&(i+=t,l+=a,t=0,a=0,n=!1),r.scrollLeft&&(l+=-r.scrollLeft),r.scrollTop&&(i+=-r.scrollTop),r.parentElement){"PluridPlane"===r.parentElement.dataset.pluridEntity&&(o=!1),r=r.parentElement}else o=!1;const s=N?56:0;return{x:l+e.offsetWidth,y:i+s}},re=u.useDebouncedCallback((()=>{(()=>{const e=ne();U({planeID:q,linkCoordinates:e});const t=a.space.tree.logic.updatePlaneLocation(l.objects.clone(I),Q,q,l.objects.clone(e));L(t)})()}),t.PLURID_DEFAULT_RESIZE_DEBOUNCE_TIME),oe=e=>{const{updatedTree:t,updatedPlane:n}=a.space.tree.logic.togglePlaneFromTree(l.objects.clone(I),q,e);return L(t),H((e=>!e)),G(!1),{updatedPlane:n}},se=(e,t)=>{t&&(W||(A({field:"isolatePlane",value:""}),Et(_,t,e)))},ce=e=>{if(e.altKey&&W&&q){const t=a.space.tree.logic.getTreePlaneByID(I,q);Et(_,t,e)}else W||q?(e=>{const{updatedPlane:t}=oe();se(e,t)})(e):(e=>{if(!Q||!B)return;const{route:t}=B,n=ne(),{pluridPlaneID:r,updatedTree:i,updatedTreePlane:s}=a.space.tree.logic.updateTreeWithNewPlane(t,Q,n,l.objects.clone(I),c.getAll(),O,o);r&&(se(e,s),L(i),H(!0),J(r))})(e)},ue=()=>{X.current&&X.current.blur()},de=r.useCallback((e=>{e.preventDefault(),void 0!==g&&g(e),ce(e),ue()}),[Q,JSON.stringify(I),X.current]);return r.useEffect((()=>{const e=le(X.current);ee(e);const t=ne();ae(t);((e,t)=>{if(e&&e.children)for(const a of e.children)if(a.linkCoordinates&&(a.linkCoordinates.x===t.x||a.linkCoordinates.y===t.y)){if(q===a.planeID)continue;H(!0),J(a.planeID)}})(a.space.tree.logic.getTreePlaneByID(I,e),t)}),[]),r.useEffect((()=>{W&&re()}),[W,JSON.stringify(y),JSON.stringify(I)]),r.useEffect((()=>{if(E)return K&&z.current&&(V.current=setTimeout((()=>{G(!0)}),M),clearTimeout(z.current)),K||(z.current=setTimeout((()=>{G(!1),V.current&&clearTimeout(V.current)}),k)),()=>{z.current&&clearTimeout(z.current),V.current&&clearTimeout(V.current)}}),[E,K]),r.useEffect((()=>{const e=s.subscribe({topic:t.PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE,callback:()=>{C===q&&(oe(),A({field:"lastClosedPlane",value:""}))}});return()=>{s.unsubscribe(e)}}),[W,q,JSON.stringify(I)]),r.useEffect((()=>{const e=s.subscribe({topic:t.PLURID_PUBSUB_TOPIC.CLOSE_PLANE,callback:e=>{const{id:t}=e;if(t===q&&W){oe(!1),A({field:"lastClosedPlane",value:t})}}});return()=>{s.unsubscribe(e)}}),[W,q,JSON.stringify(I)]),r.useEffect((()=>()=>{setTimeout((()=>{q&&W&&null===X.current&&document.getElementById(q)&&(D(q),H(!1),G(!1))}),10)}),[W,j,q,Q,JSON.stringify(I)]),x.default.createElement($n,{ref:X,onClick:e=>de(e),onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),onKeyUp:e=>(e=>{if("Enter"===e.code)return de(e),void ue()})(e),theme:w,suffix:Y,devisible:$,style:Object.assign({},h),className:T,"data-plurid-entity":t.PLURID_ENTITY_LINK,tabIndex:0},d,j&&!W&&x.default.createElement(Fn,{elementID:`preview-${Q}`,rootID:Q},x.default.createElement(Yn,{planeRoute:F,linkCoordinates:te,previewComponent:v,previewOffsetX:b,previewOffsetY:R})))})),Vn=c.css`
|
|
538
|
+
color: ${({theme:e})=>e.colorTertiary};
|
|
539
|
+
|
|
540
|
+
@media (hover:hover) {
|
|
541
|
+
:hover {
|
|
542
|
+
color: ${({theme:e})=>e.colorPrimary};
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
`,zn=M.default.a`
|
|
546
|
+
${Vn}
|
|
547
|
+
`,Kn=M.default.div`
|
|
519
548
|
cursor: pointer;
|
|
520
|
-
|
|
549
|
+
|
|
550
|
+
${Vn}
|
|
551
|
+
`,Zn=e=>{const{route:t,children:n,asAnchor:r,target:o,theme:i,style:l,className:c,atClick:u}=e,d=null==r||r,f=i||s.plurid,p=e=>{if(u){if(u(e))return}e.preventDefault(),"_blank"!==o?a.pluridRouterNavigate(t):window.open(t)},m={tabIndex:0,theme:f,style:l,className:c,onClick:p,onKeyUp:e=>{"Enter"!==e.code||p(e)}};return d?x.default.createElement(zn,Object.assign({href:t},m),n):x.default.createElement(Kn,Object.assign({},m),n)},jn=M.default.div`
|
|
521
552
|
position: absolute;
|
|
522
553
|
height: 0;
|
|
523
554
|
width: 0;
|
|
524
555
|
user-select: none;
|
|
525
556
|
pointer-events: none;
|
|
526
|
-
`,
|
|
557
|
+
`,Gn=o.connect((e=>({stateConfiguration:Ot.configuration.getConfiguration(e)})),(e=>({dispatchSetConfiguration:t=>e(qe.configuration.setConfiguration(t))})),null,{context:Ge})((e=>{const n=r.useContext(He);if(!n)return x.default.createElement(x.default.Fragment,null);const{registerPubSub:o}=n,{configuration:i,pubsub:l,stateConfiguration:s,dispatchSetConfiguration:c}=e,u=r.useRef(null);return r.useEffect((()=>{const e=a.general.configuration.merge(i,s);c(e)}),[i]),r.useEffect((()=>{l&&o(l)}),[l]),x.default.createElement(jn,{ref:u,"data-plurid-entity":t.PLURID_ENTITY_APPLICATION_CONFIGURATOR})})),Wn=M.default.div`
|
|
527
558
|
position: absolute;
|
|
528
559
|
height: 0;
|
|
529
560
|
width: 0;
|
|
530
561
|
user-select: none;
|
|
531
562
|
pointer-events: none;
|
|
532
|
-
`,{getPluridPlaneIDByData:
|
|
533
|
-
`,
|
|
534
|
-
`,
|
|
535
|
-
`,
|
|
536
|
-
`,
|
|
563
|
+
`,{getPluridPlaneIDByData:Hn}=a.planes,qn=o.connect((e=>({})),(e=>({})),null,{context:Ge})((e=>{const a=r.useRef(null),[n,o]=r.useState("");return r.useEffect((()=>{const e=Hn(a.current);o(e)}),[]),x.default.createElement(Wn,{ref:a,"data-plurid-entity":t.PLURID_ENTITY_PLANE_CONFIGURATOR})})),Jn=M.default.div`
|
|
564
|
+
`,Qn=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{plurid:t}=e,a=t.value,n=r.useRef(!1),[o,i]=r.useState();return r.useEffect((()=>(n.current=!0,()=>{n.current=!1}))),r.useEffect((()=>{let e=!1;We(void 0,void 0,void 0,(function*(){if(!e){e=!0;try{const{domain:e,url:t}=(e=>{const t=e.match(/^pttp:\/\/(\w+(\.|:)\w+)\/?/);if(!t)return{domain:"",url:""};const a=t[1];return{domain:a,url:`http://${a}/pttp`}})(a),r=((e,t)=>{if(e)return t.replace(`pttp://${e}`,"")})(e,a);if(!t||!r)return;const o=yield((e,t)=>We(void 0,void 0,void 0,(function*(){try{const a=yield k.default(e,{method:"post",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({path:t}),credentials:"include"}),n=yield a.json();if(!n.element)return;const{element:r}=n,o=new g.ElementQLClient({url:r.url}),{status:i,Elements:l}=yield o.get(r.json,"json");if(!i)return;const s=l[r.name];return()=>s}catch(e){return}})))(t,r);if(!n.current)return;o&&i(o)}catch(e){return}}}))}),[]),x.default.createElement(Jn,null,o&&x.default.createElement(o,null))})),er=M.default.div`
|
|
565
|
+
`,tr=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>{const{plurid:t}=e,a=t.value;return x.default.createElement(er,null,x.default.createElement("iframe",{src:a}))})),ar=e=>{const{top:t,index:a,element:n,setHeight:o}=e,i=r.useRef(null);return r.useEffect((()=>{i.current&&o(i.current.offsetHeight,a)}),[i.current]),x.default.createElement("div",{ref:i,style:{position:"absolute",top:t+"px"}},n)},{markers:{Spinner:nr}}=f.universal,rr=o.connect((e=>({translationY:Ot.space.getTranslationY(e),viewSize:Ot.space.getViewSize(e)})),(e=>({})),null,{context:Ge})((e=>{const{items:t,generalHeight:a,translationY:n,viewSize:o}=e,i=a||100,s=r.useRef(null),c=r.useRef([]),u=r.useRef(Array(t.length).fill(i)),[d,f]=r.useState(0),[p,m]=r.useState(Math.floor(1e3/i)),[g,h]=r.useState(i*(p-d)),[T,E]=r.useState(!1),v=(e,t)=>{u.current[t]=e};return r.useEffect((()=>{if(u.current){const e=l.mathematics.arithmetic.sum(u.current,u.current.length);h(e)}}),[d,p,u.current]),r.useEffect((()=>{let e=0;for(const[t,a]of u.current.entries())e+=a,n<0?(e<Math.abs(n)&&f(t),e>Math.abs(n)+o.height&&e<Math.abs(n)+o.height+400&&m(t)):(f(0),m(10))}),[o.height,n]),r.useEffect((()=>{E(!0),setTimeout((()=>{const e=l.mathematics.arithmetic.sum(u.current,u.current.length);h(e),E(!1)}),400)}),[o]),x.default.createElement("div",{style:{height:g},ref:s},T&&x.default.createElement(x.default.Fragment,null,x.default.createElement(nr,null)),!T&&x.default.createElement(x.default.Fragment,null,(()=>{c.current=[];for(let e=d;e<=p;e++){const a=t[e];c.current.push(x.default.createElement(ar,{key:e+Math.random(),index:e,top:l.mathematics.arithmetic.sum(u.current,e),element:a,setHeight:v}))}return c.current})()))})),or=M.default.div`
|
|
566
|
+
`,ir=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>x.default.createElement(or,null,"PluridPlaneDebugger"))),lr=M.default.div`
|
|
567
|
+
`,sr=o.connect((e=>({stateGeneralTheme:Ot.themes.getGeneralTheme(e),stateInteractionTheme:Ot.themes.getInteractionTheme(e)})),(e=>({})),null,{context:Ge})((e=>x.default.createElement(lr,null,"PluridSpaceDebugger"))),cr=(e,n,r,o="origin")=>We(void 0,void 0,void 0,(function*(){const n=yield((e,n,r,o)=>We(void 0,void 0,void 0,(function*(){const n={planes:[],spaces:[],view:[],value:""};let r;if("Route"===e.kind){let t=e.data;r=t.defaultConfiguration,e.data.resolver&&(t=yield e.data.resolver(o)),n.planes=t.planes||[],n.spaces=t.spaces||[],n.view=t.view||[],n.value=e.data.value||""}const{planes:i,spaces:l,view:s}=n,c=[];if(l)for(const e of l){const o=[],i=[];if(e.planes)for(const r of e.planes){const o=ce(r);n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),a.utilities.cleanPathElement(o.value)}if(e.universes)for(const r of e.universes){if(r.clusters)for(const o of r.clusters)for(const i of o.planes){const l=ce(i);n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),r.value===t.PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE?t.PLURID_ROUTE_DEFAULT_UNIVERSE:a.utilities.cleanPathElement(r.value),o.value===t.PLURID_ROUTE_DEFAULT_CLUSTER_VALUE?t.PLURID_ROUTE_DEFAULT_CLUSTER:a.utilities.cleanPathElement(o.value),a.utilities.cleanPathElement(l.value)}if(r.planes)for(const o of r.planes){const i=ce(o);n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),e.value===t.PLURID_ROUTE_DEFAULT_SPACE_VALUE?t.PLURID_ROUTE_DEFAULT_SPACE:a.utilities.cleanPathElement(e.value),r.value===t.PLURID_ROUTE_DEFAULT_UNIVERSE_VALUE?t.PLURID_ROUTE_DEFAULT_UNIVERSE:a.utilities.cleanPathElement(r.value),a.utilities.cleanPathElement(i.value)}}const l={planes:o,view:i,configuration:r};c.push(l)}if(i){const e=[];for(const r of i){const o=ce(r),{value:i,component:l}=o;n.value===t.PLURID_ROUTE_DEFAULT_PATH_VALUE?t.PLURID_ROUTE_DEFAULT_PATH:a.utilities.cleanPathElement(n.value),a.utilities.cleanPathElement(o.value);const s={component:l,route:i};e.push(s)}const o={planes:e,view:s,configuration:r};c.push(o)}return c})))(e,0,0,r),i={};for(const t of n){const{planes:a,view:n,configuration:r}=t,{computedTree:l,appConfiguration:s}=ht(a,e.data.defaultConfiguration,n,o),c={configuration:Object.assign({},s),shortcuts:{global:!0},themes:{general:N.default.plurid,interaction:N.default.plurid},ui:{toolbarScrollPosition:50},space:{loading:!1,resolvedLayout:!1,animatedTransform:!1,transform:"matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)",scale:1,rotationX:0,rotationY:0,translationX:0,translationY:0,translationZ:0,tree:l,activeUniverseID:"",camera:{x:0,y:0,z:0},viewSize:{width:1440,height:821},spaceSize:{width:1440,height:821,depth:0,topCorner:{x:0,y:0,z:0}},view:n,culledView:[]}};i[e.data.value]=c}return{states:i}})),{IsoMatcher:ur,RouteParser:dr}=a.routing,fr={PluridPlaneBridge:xt,PluridPlaneContent:zt,PluridPlaneControls:Xt,PluridPlaneDebugger:ir,PluridSpaceDebugger:sr},pr={Application:On,RouterStatic:Nn,RouterBrowser:xn,Provider:Mn,Link:Xn,RouterLink:Zn,ApplicationConfigurator:Gn,PlaneConfigurator:qn,ExternalPlane:Qn,IframePlane:tr,VirtualList:rr,SPACE_LAYOUT:t.LAYOUT_TYPES,SIZES:t.SIZES,TRANSFORM_MODES:t.TRANSFORM_MODES,TRANSFORM_TOUCHES:t.TRANSFORM_TOUCHES,PubSub:D.default,PUBSUB_TOPIC:t.PLURID_PUBSUB_TOPIC,serverComputeMetastate:cr,IsoMatcher:ur,routerNavigate:a.pluridRouterNavigate,internals:fr};Object.defineProperty(e,"PLURID_PUBSUB_TOPIC",{enumerable:!0,get:function(){return t.PLURID_PUBSUB_TOPIC}}),Object.defineProperty(e,"PLURID_ROUTER_LOCATION_CHANGED",{enumerable:!0,get:function(){return t.PLURID_ROUTER_LOCATION_CHANGED}}),Object.defineProperty(e,"PLURID_ROUTER_LOCATION_STORED",{enumerable:!0,get:function(){return t.PLURID_ROUTER_LOCATION_STORED}}),Object.defineProperty(e,"SIZES",{enumerable:!0,get:function(){return t.SIZES}}),Object.defineProperty(e,"SPACE_LAYOUT",{enumerable:!0,get:function(){return t.LAYOUT_TYPES}}),Object.defineProperty(e,"TRANSFORM_MODES",{enumerable:!0,get:function(){return t.TRANSFORM_MODES}}),Object.defineProperty(e,"TRANSFORM_TOUCHES",{enumerable:!0,get:function(){return t.TRANSFORM_TOUCHES}}),Object.defineProperty(e,"pluridRouterNavigate",{enumerable:!0,get:function(){return a.pluridRouterNavigate}}),Object.defineProperty(e,"PluridPubSub",{enumerable:!0,get:function(){return D.default}}),e.PluridApplication=On,e.PluridApplicationConfigurator=Gn,e.PluridExternalPlane=Qn,e.PluridIframePlane=tr,e.PluridIsoMatcher=ur,e.PluridLink=Xn,e.PluridPlaneConfigurator=qn,e.PluridProvider=Mn,e.PluridRouteParser=dr,e.PluridRouterBrowser=xn,e.PluridRouterLink=Zn,e.PluridRouterStatic=Nn,e.PluridVirtualList=rr,e.default=pr,e.getDirectPlaneMatch=(e,t,a)=>{let n,r,o;for(const a of t){if(a.planes)for(const t of a.planes){const n=ce(t),i="/"===a.value?n.value:a.value+n.value;if(o=i,e===i){r=t;break}}if(r){n=a;break}}if(a)for(const t of a){if(e===ce(t).value){r=t;break}}return{matchRoute:n,matchPlane:r,matchPath:o}},e.internals=fr,e.pluridStateModules=Ke,e.serverComputeMetastate=cr,e.usePluridRouter=()=>{const[e,a]=r.useState("");return r.useEffect((()=>{const e=()=>{const e=l.storage.loadState(t.PLURID_ROUTER_STORAGE);e&&a(e)};return e(),window.addEventListener(t.PLURID_ROUTER_LOCATION_STORED,e),()=>{window.removeEventListener(t.PLURID_ROUTER_LOCATION_STORED,e)}}),[]),e}}(D);var x,N=(x=D)&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x;exports.default=N;
|
|
568
|
+
//# sourceMappingURL=index.min.js.map
|