qwc2 2025.7.1 → 2025.7.2
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/package.json +1 -1
- package/reducers/windows.js +1 -1
package/package.json
CHANGED
package/reducers/windows.js
CHANGED
|
@@ -4,4 +4,4 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the BSD-style license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/import{SHOW_IFRAME_DIALOG,SHOW_NOTIFICATION,CLOSE_WINDOW,CLOSE_ALL_WINDOWS,REGISTER_WINDOW,UNREGISTER_WINDOW,RAISE_WINDOW,SET_SPLIT_SCREEN,SET_MENU_MARGIN,SET_TOPBAR_HEIGHT,SET_BOTTOMBAR_HEIGHT}from"../actions/windows";var defaultState={stacking:[],splitScreen:{},mapMargins:{left:0,top:0,right:0,bottom:0},windowMargins:{left:0,top:0,right:0,bottom:0},menuMargins:{left:0,right:0},topbarHeight:0,bottombarHeight:0,entries:{}};function computeMapMargins(windowMargins,menuMargins){return{left:windowMargins.left+menuMargins.left,top:windowMargins.top,right:windowMargins.right+menuMargins.right,bottom:windowMargins.bottom,splitTopAndBottomBar:windowMargins.splitTopAndBottomBar}}export default function windows(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case SHOW_IFRAME_DIALOG:{return _objectSpread(_objectSpread({},state),{},{entries:_objectSpread(_objectSpread({},state.entries),{},_defineProperty({},action.name,{type:"iframedialog",url:action.url,options:action.options||{}}))})}case SHOW_NOTIFICATION:{return _objectSpread(_objectSpread({},state),{},{entries:_objectSpread(_objectSpread({},state.entries),{},_defineProperty({},action.name,{type:"notification",text:action.text,notificationType:action.notificationType,sticky:action.sticky}))})}case CLOSE_WINDOW:{var newState=_objectSpread(_objectSpread({},state),{},{entries:_objectSpread({},state.entries)});delete newState.entries[action.name];return newState}case CLOSE_ALL_WINDOWS:{return _objectSpread(_objectSpread({},state),{},{entries:Object.entries(state.entries).reduce(function(res,_ref){var _ref2=_slicedToArray(_ref,2),name=_ref2[0],entry=_ref2[1];if(entry.sticky){res[name]=entry}return res},{})})}case REGISTER_WINDOW:{return _objectSpread(_objectSpread({},state),{},{stacking:[].concat(_toConsumableArray(state.stacking),[action.id])})}case UNREGISTER_WINDOW:{return _objectSpread(_objectSpread({},state),{},{stacking:state.stacking.filter(function(x){return x!==action.id})})}case RAISE_WINDOW:{return _objectSpread(_objectSpread({},state),{},{stacking:[].concat(_toConsumableArray(state.stacking.filter(function(x){return x!==action.id})),[action.id])})}case SET_SPLIT_SCREEN:{var newSplitScreen=_objectSpread({},state.splitScreen);if(action.side===null){delete newSplitScreen[action.windowId]}else{newSplitScreen[action.windowId]={side:action.side,size:action.size,splitTopAndBottomBar:action.splitTopAndBottomBar}}var splitWindows=Object.values(newSplitScreen);var windowMargins={right:splitWindows.filter(function(entry){return entry.side==="right"}).reduce(function(res,e){return Math.max(e.size,res)},0),bottom:splitWindows.filter(function(entry){return entry.side==="bottom"}).reduce(function(res,e){return Math.max(e.size,res)},0),left:splitWindows.filter(function(entry){return entry.side==="left"}).reduce(function(res,e){return Math.max(e.size,res)},0),top:splitWindows.filter(function(entry){return entry.side==="top"}).reduce(function(res,e){return Math.max(e.size,res)},0),splitTopAndBottomBar:splitWindows.find(function(x){return x.splitTopAndBottomBar===true})!==undefined};return _objectSpread(_objectSpread({},state),{},{splitScreen:newSplitScreen,windowMargins:windowMargins,mapMargins:computeMapMargins(windowMargins,state.menuMargins)})}case SET_MENU_MARGIN:{var menuMargins={right:action.right,left:action.left};return _objectSpread(_objectSpread({},state),{},{menuMargins:menuMargins,mapMargins:computeMapMargins(state.windowMargins,menuMargins)})}case SET_TOPBAR_HEIGHT:{
|
|
7
|
+
*/import{SHOW_IFRAME_DIALOG,SHOW_NOTIFICATION,CLOSE_WINDOW,CLOSE_ALL_WINDOWS,REGISTER_WINDOW,UNREGISTER_WINDOW,RAISE_WINDOW,SET_SPLIT_SCREEN,SET_MENU_MARGIN,SET_TOPBAR_HEIGHT,SET_BOTTOMBAR_HEIGHT}from"../actions/windows";var defaultState={stacking:[],splitScreen:{},mapMargins:{left:0,top:0,right:0,bottom:0},windowMargins:{left:0,top:0,right:0,bottom:0},menuMargins:{left:0,right:0},topbarHeight:0,bottombarHeight:0,entries:{}};function computeMapMargins(windowMargins,menuMargins){return{left:windowMargins.left+menuMargins.left,top:windowMargins.top,right:windowMargins.right+menuMargins.right,bottom:windowMargins.bottom,splitTopAndBottomBar:windowMargins.splitTopAndBottomBar}}export default function windows(){var state=arguments.length>0&&arguments[0]!==undefined?arguments[0]:defaultState;var action=arguments.length>1?arguments[1]:undefined;switch(action.type){case SHOW_IFRAME_DIALOG:{return _objectSpread(_objectSpread({},state),{},{entries:_objectSpread(_objectSpread({},state.entries),{},_defineProperty({},action.name,{type:"iframedialog",url:action.url,options:action.options||{}}))})}case SHOW_NOTIFICATION:{return _objectSpread(_objectSpread({},state),{},{entries:_objectSpread(_objectSpread({},state.entries),{},_defineProperty({},action.name,{type:"notification",text:action.text,notificationType:action.notificationType,sticky:action.sticky}))})}case CLOSE_WINDOW:{var newState=_objectSpread(_objectSpread({},state),{},{entries:_objectSpread({},state.entries)});delete newState.entries[action.name];return newState}case CLOSE_ALL_WINDOWS:{return _objectSpread(_objectSpread({},state),{},{entries:Object.entries(state.entries).reduce(function(res,_ref){var _ref2=_slicedToArray(_ref,2),name=_ref2[0],entry=_ref2[1];if(entry.sticky){res[name]=entry}return res},{})})}case REGISTER_WINDOW:{return _objectSpread(_objectSpread({},state),{},{stacking:[].concat(_toConsumableArray(state.stacking),[action.id])})}case UNREGISTER_WINDOW:{return _objectSpread(_objectSpread({},state),{},{stacking:state.stacking.filter(function(x){return x!==action.id})})}case RAISE_WINDOW:{return _objectSpread(_objectSpread({},state),{},{stacking:[].concat(_toConsumableArray(state.stacking.filter(function(x){return x!==action.id})),[action.id])})}case SET_SPLIT_SCREEN:{var newSplitScreen=_objectSpread({},state.splitScreen);if(action.side===null){delete newSplitScreen[action.windowId]}else{newSplitScreen[action.windowId]={side:action.side,size:action.size,splitTopAndBottomBar:action.splitTopAndBottomBar}}var splitWindows=Object.values(newSplitScreen);var windowMargins={right:splitWindows.filter(function(entry){return entry.side==="right"}).reduce(function(res,e){return Math.max(e.size,res)},0),bottom:splitWindows.filter(function(entry){return entry.side==="bottom"}).reduce(function(res,e){return Math.max(e.size,res)},0),left:splitWindows.filter(function(entry){return entry.side==="left"}).reduce(function(res,e){return Math.max(e.size,res)},0),top:splitWindows.filter(function(entry){return entry.side==="top"}).reduce(function(res,e){return Math.max(e.size,res)},0),splitTopAndBottomBar:splitWindows.find(function(x){return x.splitTopAndBottomBar===true})!==undefined};return _objectSpread(_objectSpread({},state),{},{splitScreen:newSplitScreen,windowMargins:windowMargins,mapMargins:computeMapMargins(windowMargins,state.menuMargins)})}case SET_MENU_MARGIN:{var menuMargins={right:action.right,left:action.left};return _objectSpread(_objectSpread({},state),{},{menuMargins:menuMargins,mapMargins:computeMapMargins(state.windowMargins,menuMargins)})}case SET_TOPBAR_HEIGHT:{document.querySelector(":root").style.setProperty("--topbar-height",action.height+"px");if(action.height<=0){return state}return _objectSpread(_objectSpread({},state),{},{topbarHeight:action.height})}case SET_BOTTOMBAR_HEIGHT:{document.querySelector(":root").style.setProperty("--bottombar-height",action.height+"px");if(action.height<=0){return state}return _objectSpread(_objectSpread({},state),{},{bottombarHeight:action.height})}default:return state}}
|