qwc2 2025.10.9 → 2025.10.14
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/actions/display.js +30 -1
- package/actions/editing.js +22 -1
- package/actions/layerinfo.js +13 -1
- package/actions/layers.js +213 -3
- package/actions/localConfig.js +58 -1
- package/actions/locale.js +21 -1
- package/actions/locate.js +26 -1
- package/actions/logging.js +10 -1
- package/actions/map.js +105 -2
- package/actions/measurement.js +12 -1
- package/actions/processNotifications.js +37 -1
- package/actions/redlining.js +18 -1
- package/actions/redliningPick.js +12 -1
- package/actions/search.js +12 -1
- package/actions/serviceinfo.js +12 -1
- package/actions/task.js +55 -3
- package/actions/theme.js +339 -19
- package/actions/windows.js +164 -5
- package/components/AppMenu.js +435 -3
- package/components/AttributeForm.js +928 -32
- package/components/AttributeTableWidget.js +1105 -13
- package/components/AutoEditForm.js +189 -3
- package/components/CoordinateDisplayer.js +78 -2
- package/components/EditComboField.js +190 -6
- package/components/EditUploadField.js +315 -3
- package/components/ExportSelection.js +203 -2
- package/components/FullscreenSwitcher.js +90 -3
- package/components/Icon.js +81 -2
- package/components/IdentifyViewer.js +1161 -6
- package/components/ImportLayer.js +718 -20
- package/components/LayerInfoWindow.js +145 -2
- package/components/LinkFeatureForm.js +246 -5
- package/components/MapButton.js +88 -2
- package/components/MapSelection.js +287 -8
- package/components/MessageBar.js +68 -2
- package/components/NumericInputWindow.js +359 -2
- package/components/PickFeature.js +266 -2
- package/components/PluginsContainer.js +227 -8
- package/components/PrintSelection.js +620 -49
- package/components/ProcessNotifications.js +104 -2
- package/components/QtDesignerForm.js +1137 -18
- package/components/ResizeableWindow.js +591 -8
- package/components/SearchBox.js +1307 -20
- package/components/ServiceInfoWindow.js +107 -2
- package/components/SideBar.js +204 -4
- package/components/StandardApp.js +381 -20
- package/components/Swipeable.js +15 -1
- package/components/TaskBar.js +85 -2
- package/components/ThemeLayersListWindow.js +216 -4
- package/components/ThemeList.js +381 -7
- package/components/Toolbar.js +106 -2
- package/components/WindowManager.js +178 -2
- package/components/map/OlLayer.js +257 -6
- package/components/map/OlMap.js +405 -5
- package/components/map/layers/BingLayer.js +31 -2
- package/components/map/layers/GoogleLayer.js +222 -19
- package/components/map/layers/GraticuleLayer.js +21 -1
- package/components/map/layers/ImageLayer.js +15 -1
- package/components/map/layers/MVTLayer.js +52 -2
- package/components/map/layers/OSMLayer.js +24 -2
- package/components/map/layers/OverlayLayer.js +55 -3
- package/components/map/layers/VectorLayer.js +173 -8
- package/components/map/layers/WFSLayer.js +220 -6
- package/components/map/layers/WMSLayer.js +180 -6
- package/components/map/layers/WMTSLayer.js +67 -3
- package/components/map/layers/XYZLayer.js +24 -2
- package/components/map/layers/index.js +28 -1
- package/components/map3d/EditDataset3D.js +190 -3
- package/components/map3d/HeightProfile3D.js +402 -3
- package/components/map3d/ImportObjects3D.js +162 -2
- package/components/map3d/Map3D.js +1304 -38
- package/components/map3d/MapControls3D.js +392 -7
- package/components/map3d/SearchField3D.js +183 -11
- package/components/map3d/View3DSwitcher.js +98 -2
- package/components/map3d/drawtool/CreateTool3D.js +174 -4
- package/components/map3d/drawtool/EditTool3D.js +590 -6
- package/components/map3d/drawtool/NumericInput3D.js +336 -4
- package/components/map3d/layers/GeoTIFFLayer3D.js +15 -1
- package/components/map3d/layers/VectorLayer3D.js +53 -2
- package/components/map3d/layers/WFSLayer3D.js +109 -3
- package/components/map3d/layers/WMSLayer3D.js +70 -2
- package/components/map3d/layers/WMTSLayer3D.js +27 -3
- package/components/map3d/layers/index.js +14 -1
- package/components/map3d/utils/FirstPersonControls3D.js +423 -16
- package/components/map3d/utils/MiscUtils3D.js +221 -13
- package/components/map3d/utils/OrbitControls3D.js +176 -5
- package/components/map3d/utils/Tiles3DStyle.js +238 -9
- package/components/share/ShareLink.js +54 -2
- package/components/share/ShareQRCode.js +62 -2
- package/components/share/ShareSocials.js +125 -3
- package/components/timeline/FixedTimeline.js +236 -5
- package/components/timeline/InfiniteTimeline.js +347 -8
- package/components/timeline/TimelineFeaturesSlider.js +439 -5
- package/components/widgets/AccordeonWidget.js +96 -2
- package/components/widgets/ButtonBar.js +124 -2
- package/components/widgets/ColorButton.js +201 -3
- package/components/widgets/ComboBox.js +166 -2
- package/components/widgets/CopyButton.js +110 -2
- package/components/widgets/DateTimeInput.js +100 -3
- package/components/widgets/EditableSelect.js +230 -3
- package/components/widgets/FileSelector.js +128 -4
- package/components/widgets/Input.js +124 -2
- package/components/widgets/InputContainer.js +96 -2
- package/components/widgets/LayerCatalogWidget.js +219 -3
- package/components/widgets/MenuButton.js +157 -1
- package/components/widgets/ModalDialog.js +64 -2
- package/components/widgets/NavBar.js +119 -2
- package/components/widgets/NumberInput.js +226 -4
- package/components/widgets/PopupMenu.js +72 -1
- package/components/widgets/Primitives.js +6 -1
- package/components/widgets/ReCaptchaWidget.js +55 -1
- package/components/widgets/SearchWidget.js +255 -2
- package/components/widgets/Spinner.js +44 -2
- package/components/widgets/SuggestionInput.js +77 -2
- package/components/widgets/TextInput.js +308 -2
- package/components/widgets/ToggleSwitch.js +85 -2
- package/components/widgets/VectorLayerPicker.js +85 -3
- package/libs/openlayers.js +225 -5
- package/package.json +1 -1
- package/plugins/API.js +358 -15
- package/plugins/AttributeTable.js +109 -3
- package/plugins/Authentication.js +130 -5
- package/plugins/BackgroundSwitcher.js +218 -4
- package/plugins/Bookmark.js +289 -3
- package/plugins/BottomBar.js +298 -4
- package/plugins/CookiePopup.js +67 -3
- package/plugins/Cyclomedia.js +442 -5
- package/plugins/Editing.js +497 -9
- package/plugins/FeatureForm.js +366 -4
- package/plugins/FeatureSearch.js +458 -3
- package/plugins/GeometryDigitizer.js +664 -7
- package/plugins/HeightProfile.js +763 -15
- package/plugins/Help.js +102 -3
- package/plugins/HomeButton.js +80 -3
- package/plugins/Identify.js +543 -5
- package/plugins/LayerCatalog.js +215 -4
- package/plugins/LayerTree.js +1194 -6
- package/plugins/LocateButton.js +94 -3
- package/plugins/Map.js +320 -16
- package/plugins/MapCompare.js +94 -3
- package/plugins/MapCopyright.js +127 -5
- package/plugins/MapExport.js +613 -20
- package/plugins/MapFilter.js +868 -12
- package/plugins/MapInfoTooltip.js +277 -3
- package/plugins/MapLegend.js +253 -4
- package/plugins/MapTip.js +290 -4
- package/plugins/Measure.js +220 -4
- package/plugins/NewsPopup.js +137 -3
- package/plugins/OverviewMap.js +167 -7
- package/plugins/Panoramax.js +340 -2
- package/plugins/Portal.js +199 -4
- package/plugins/Print.js +1231 -15
- package/plugins/Redlining.js +750 -6
- package/plugins/Reports.js +332 -3
- package/plugins/Routing.js +1278 -15
- package/plugins/ScratchDrawing.js +173 -5
- package/plugins/Settings.js +241 -4
- package/plugins/Share.js +198 -3
- package/plugins/StartupMarker.js +84 -4
- package/plugins/TaskButton.js +88 -3
- package/plugins/ThemeSwitcher.js +164 -4
- package/plugins/TimeManager.js +971 -10
- package/plugins/TopBar.js +300 -7
- package/plugins/TourGuide.js +213 -2
- package/plugins/ValueTool.js +419 -4
- package/plugins/View3D.js +519 -14
- package/plugins/ZoomButtons.js +165 -3
- package/plugins/map/EditingSupport.js +199 -7
- package/plugins/map/LocateSupport.js +260 -4
- package/plugins/map/MeasurementSupport.js +216 -8
- package/plugins/map/RedliningPickSupport.js +201 -7
- package/plugins/map/RedliningSupport.js +726 -17
- package/plugins/map/SnapInteraction.js +101 -1
- package/plugins/map/SnapSupport.js +210 -2
- package/plugins/map/SnappingSupport.js +356 -17
- package/plugins/map3d/BackgroundSwitcher3D.js +44 -3
- package/plugins/map3d/BottomBar3D.js +118 -3
- package/plugins/map3d/Compare3D.js +422 -8
- package/plugins/map3d/Draw3D.js +353 -6
- package/plugins/map3d/ExportObjects3D.js +393 -18
- package/plugins/map3d/HideObjects3D.js +313 -12
- package/plugins/map3d/Identify3D.js +283 -12
- package/plugins/map3d/LayerTree3D.js +323 -3
- package/plugins/map3d/MapCopyright3D.js +128 -5
- package/plugins/map3d/MapExport3D.js +590 -10
- package/plugins/map3d/MapLight3D.js +553 -6
- package/plugins/map3d/Measure3D.js +571 -20
- package/plugins/map3d/OverviewMap3D.js +169 -3
- package/plugins/map3d/Settings3D.js +73 -3
- package/plugins/map3d/TopBar3D.js +207 -9
- package/plugins/redlining/RedliningBufferSupport.js +206 -3
- package/reducers/display.js +34 -2
- package/reducers/editing.js +68 -3
- package/reducers/index.js +9 -1
- package/reducers/layerinfo.js +26 -2
- package/reducers/layers.js +456 -9
- package/reducers/localConfig.js +122 -2
- package/reducers/locale.js +38 -2
- package/reducers/locate.js +40 -2
- package/reducers/map.js +176 -5
- package/reducers/measurement.js +42 -2
- package/reducers/processNotifications.js +49 -2
- package/reducers/redlining.js +50 -2
- package/reducers/redliningPick.js +27 -2
- package/reducers/search.js +20 -1
- package/reducers/serviceinfo.js +25 -2
- package/reducers/task.js +45 -2
- package/reducers/theme.js +51 -2
- package/reducers/windows.js +203 -2
- package/scripts/dist.sh +1 -1
- package/scripts/gen-plugin-docs.js +152 -2
- package/scripts/makeIconkit.js +85 -6
- package/scripts/themesConfig.js +742 -40
- package/scripts/updateTranslations.js +251 -10
- package/selectors/searchproviders.js +44 -2
- package/stores/StandardStore.js +42 -2
- package/utils/ConfigUtils.js +84 -3
- package/utils/CoordinatesUtils.js +234 -23
- package/utils/DxfUtils.js +237 -11
- package/utils/EditingInterface.js +421 -87
- package/utils/EditingUtils.js +357 -13
- package/utils/ElevationInterface.js +83 -22
- package/utils/FeatureStyles.js +429 -5
- package/utils/IdentifyUtils.js +443 -7
- package/utils/ImageEditor.js +79 -9
- package/utils/LayerUtils.js +1516 -50
- package/utils/LocaleUtils.js +117 -7
- package/utils/MapUtils.js +241 -59
- package/utils/MeasureUtils.js +323 -2
- package/utils/MiscUtils.js +189 -11
- package/utils/PermaLinkUtils.js +429 -6
- package/utils/PluginStore.js +27 -1
- package/utils/ResourceRegistry.js +15 -1
- package/utils/RoutingInterface.js +307 -7
- package/utils/SearchProviders.js +722 -19
- package/utils/ServiceLayerUtils.js +669 -14
- package/utils/Signal.js +32 -2
- package/utils/ThemeUtils.js +341 -7
- package/utils/VectorLayerUtils.js +589 -15
- package/utils/expr_grammar/grammar.js +2239 -2
- package/utils/expr_grammar/test.js +65 -3
package/reducers/task.js
CHANGED
|
@@ -1,7 +1,50 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
2
8
|
* Copyright 2016-2024 Sourcepole AG
|
|
3
9
|
* All rights reserved.
|
|
4
10
|
*
|
|
5
11
|
* This source code is licensed under the BSD-style license found in the
|
|
6
12
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { SET_CURRENT_TASK, SET_CURRENT_TASK_BLOCKED } from '../actions/task';
|
|
16
|
+
var defaultState = {
|
|
17
|
+
id: null,
|
|
18
|
+
mode: null,
|
|
19
|
+
data: null,
|
|
20
|
+
blocked: false,
|
|
21
|
+
unsetOnMapClick: false,
|
|
22
|
+
identifyEnabled: true
|
|
23
|
+
};
|
|
24
|
+
export default function task() {
|
|
25
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
|
|
26
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
27
|
+
switch (action.type) {
|
|
28
|
+
case SET_CURRENT_TASK:
|
|
29
|
+
{
|
|
30
|
+
if (state.blocked) {
|
|
31
|
+
return state;
|
|
32
|
+
}
|
|
33
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
34
|
+
id: action.id,
|
|
35
|
+
mode: action.mode,
|
|
36
|
+
data: action.data,
|
|
37
|
+
unsetOnMapClick: action.unsetOnMapClick,
|
|
38
|
+
identifyEnabled: action.identifyEnabled
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
case SET_CURRENT_TASK_BLOCKED:
|
|
42
|
+
{
|
|
43
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
44
|
+
blocked: action.blocked
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
default:
|
|
48
|
+
return state;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/reducers/theme.js
CHANGED
|
@@ -1,7 +1,56 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
2
8
|
* Copyright 2016-2024 Sourcepole AG
|
|
3
9
|
* All rights reserved.
|
|
4
10
|
*
|
|
5
11
|
* This source code is licensed under the BSD-style license found in the
|
|
6
12
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { THEMES_LOADED, SET_THEME_LAYERS_LIST, SET_CURRENT_THEME, SWITCHING_THEME } from '../actions/theme';
|
|
16
|
+
import { UrlParams } from '../utils/PermaLinkUtils';
|
|
17
|
+
var defaultState = {
|
|
18
|
+
current: null,
|
|
19
|
+
themelist: null,
|
|
20
|
+
switching: false
|
|
21
|
+
};
|
|
22
|
+
export default function theme() {
|
|
23
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
|
|
24
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
25
|
+
switch (action.type) {
|
|
26
|
+
case SWITCHING_THEME:
|
|
27
|
+
{
|
|
28
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
29
|
+
switching: action.switching
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
case THEMES_LOADED:
|
|
33
|
+
{
|
|
34
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
35
|
+
themes: action.themes
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
case SET_THEME_LAYERS_LIST:
|
|
39
|
+
{
|
|
40
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
41
|
+
themelist: action.themelist
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
case SET_CURRENT_THEME:
|
|
45
|
+
{
|
|
46
|
+
UrlParams.updateParams({
|
|
47
|
+
t: action.theme.id
|
|
48
|
+
});
|
|
49
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
50
|
+
current: action.theme
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
default:
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
}
|
package/reducers/windows.js
CHANGED
|
@@ -1,7 +1,208 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
7
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
/**
|
|
2
18
|
* Copyright 2020-2024 Sourcepole AG
|
|
3
19
|
* All rights reserved.
|
|
4
20
|
*
|
|
5
21
|
* This source code is licensed under the BSD-style license found in the
|
|
6
22
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
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';
|
|
26
|
+
var defaultState = {
|
|
27
|
+
stacking: [],
|
|
28
|
+
splitScreen: {},
|
|
29
|
+
mapMargins: {
|
|
30
|
+
left: 0,
|
|
31
|
+
outerLeft: 0,
|
|
32
|
+
top: 0,
|
|
33
|
+
right: 0,
|
|
34
|
+
outerRight: 0,
|
|
35
|
+
bottom: 0
|
|
36
|
+
},
|
|
37
|
+
menuMargins: {
|
|
38
|
+
left: 0,
|
|
39
|
+
right: 0
|
|
40
|
+
},
|
|
41
|
+
topbarHeight: 0,
|
|
42
|
+
bottombarHeight: 0,
|
|
43
|
+
entries: {}
|
|
44
|
+
};
|
|
45
|
+
function computeMapMargins(splitScreen, menuMargins) {
|
|
46
|
+
var splitWindows = Object.values(splitScreen);
|
|
47
|
+
var innerSplitWindows = splitWindows.filter(function (entry) {
|
|
48
|
+
return entry.splitTopAndBottomBar !== true;
|
|
49
|
+
});
|
|
50
|
+
var outerSplitWindows = splitWindows.filter(function (entry) {
|
|
51
|
+
return entry.splitTopAndBottomBar === true;
|
|
52
|
+
});
|
|
53
|
+
var mapMargins = {
|
|
54
|
+
right: innerSplitWindows.filter(function (entry) {
|
|
55
|
+
return entry.side === 'right';
|
|
56
|
+
}).reduce(function (res, e) {
|
|
57
|
+
return Math.max(e.size, res);
|
|
58
|
+
}, 0) + menuMargins.right,
|
|
59
|
+
outerRight: outerSplitWindows.filter(function (entry) {
|
|
60
|
+
return entry.side === 'right';
|
|
61
|
+
}).reduce(function (res, e) {
|
|
62
|
+
return Math.max(e.size, res);
|
|
63
|
+
}, 0),
|
|
64
|
+
bottom: splitWindows.filter(function (entry) {
|
|
65
|
+
return entry.side === 'bottom';
|
|
66
|
+
}).reduce(function (res, e) {
|
|
67
|
+
return Math.max(e.size, res);
|
|
68
|
+
}, 0),
|
|
69
|
+
left: innerSplitWindows.filter(function (entry) {
|
|
70
|
+
return entry.side === 'left';
|
|
71
|
+
}).reduce(function (res, e) {
|
|
72
|
+
return Math.max(e.size, res);
|
|
73
|
+
}, 0) + menuMargins.left,
|
|
74
|
+
outerLeft: outerSplitWindows.filter(function (entry) {
|
|
75
|
+
return entry.side === 'left';
|
|
76
|
+
}).reduce(function (res, e) {
|
|
77
|
+
return Math.max(e.size, res);
|
|
78
|
+
}, 0),
|
|
79
|
+
top: splitWindows.filter(function (entry) {
|
|
80
|
+
return entry.side === 'top';
|
|
81
|
+
}).reduce(function (res, e) {
|
|
82
|
+
return Math.max(e.size, res);
|
|
83
|
+
}, 0)
|
|
84
|
+
};
|
|
85
|
+
return {
|
|
86
|
+
mapMargins: mapMargins,
|
|
87
|
+
splitTopAndBottomBar: outerSplitWindows.length > 0
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export default function windows() {
|
|
91
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
|
|
92
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
93
|
+
switch (action.type) {
|
|
94
|
+
case SHOW_IFRAME_DIALOG:
|
|
95
|
+
{
|
|
96
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
97
|
+
entries: _objectSpread(_objectSpread({}, state.entries), {}, _defineProperty({}, action.name, {
|
|
98
|
+
type: 'iframedialog',
|
|
99
|
+
url: action.url,
|
|
100
|
+
options: action.options || {}
|
|
101
|
+
}))
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
case SHOW_NOTIFICATION:
|
|
105
|
+
{
|
|
106
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
107
|
+
entries: _objectSpread(_objectSpread({}, state.entries), {}, _defineProperty({}, action.name, {
|
|
108
|
+
type: 'notification',
|
|
109
|
+
text: action.text,
|
|
110
|
+
notificationType: action.notificationType,
|
|
111
|
+
sticky: action.sticky
|
|
112
|
+
}))
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
case CLOSE_WINDOW:
|
|
116
|
+
{
|
|
117
|
+
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
118
|
+
entries: _objectSpread({}, state.entries)
|
|
119
|
+
});
|
|
120
|
+
delete newState.entries[action.name];
|
|
121
|
+
return newState;
|
|
122
|
+
}
|
|
123
|
+
case CLOSE_ALL_WINDOWS:
|
|
124
|
+
{
|
|
125
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
126
|
+
entries: Object.entries(state.entries).reduce(function (res, _ref) {
|
|
127
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
128
|
+
name = _ref2[0],
|
|
129
|
+
entry = _ref2[1];
|
|
130
|
+
if (entry.sticky) {
|
|
131
|
+
res[name] = entry;
|
|
132
|
+
}
|
|
133
|
+
return res;
|
|
134
|
+
}, {})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
case REGISTER_WINDOW:
|
|
138
|
+
{
|
|
139
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
140
|
+
stacking: [].concat(_toConsumableArray(state.stacking), [action.id])
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
case UNREGISTER_WINDOW:
|
|
144
|
+
{
|
|
145
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
146
|
+
stacking: state.stacking.filter(function (x) {
|
|
147
|
+
return x !== action.id;
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
case RAISE_WINDOW:
|
|
152
|
+
{
|
|
153
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
154
|
+
stacking: [].concat(_toConsumableArray(state.stacking.filter(function (x) {
|
|
155
|
+
return x !== action.id;
|
|
156
|
+
})), [action.id])
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
case SET_SPLIT_SCREEN:
|
|
160
|
+
{
|
|
161
|
+
var newSplitScreen = _objectSpread({}, state.splitScreen);
|
|
162
|
+
if (action.side === null) {
|
|
163
|
+
delete newSplitScreen[action.windowId];
|
|
164
|
+
} else {
|
|
165
|
+
newSplitScreen[action.windowId] = {
|
|
166
|
+
side: action.side,
|
|
167
|
+
size: action.size,
|
|
168
|
+
splitTopAndBottomBar: action.splitTopAndBottomBar
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
172
|
+
splitScreen: newSplitScreen
|
|
173
|
+
}, computeMapMargins(newSplitScreen, state.menuMargins));
|
|
174
|
+
}
|
|
175
|
+
case SET_MENU_MARGIN:
|
|
176
|
+
{
|
|
177
|
+
var menuMargins = {
|
|
178
|
+
right: action.right,
|
|
179
|
+
left: action.left
|
|
180
|
+
};
|
|
181
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
182
|
+
menuMargins: menuMargins
|
|
183
|
+
}, computeMapMargins(state.splitScreen, menuMargins));
|
|
184
|
+
}
|
|
185
|
+
case SET_TOPBAR_HEIGHT:
|
|
186
|
+
{
|
|
187
|
+
document.querySelector(':root').style.setProperty('--topbar-height', action.height + 'px');
|
|
188
|
+
if (action.height <= 0) {
|
|
189
|
+
return state;
|
|
190
|
+
}
|
|
191
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
192
|
+
topbarHeight: action.height
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
case SET_BOTTOMBAR_HEIGHT:
|
|
196
|
+
{
|
|
197
|
+
document.querySelector(':root').style.setProperty('--bottombar-height', action.height + 'px');
|
|
198
|
+
if (action.height <= 0) {
|
|
199
|
+
return state;
|
|
200
|
+
}
|
|
201
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
202
|
+
bottombarHeight: action.height
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
default:
|
|
206
|
+
return state;
|
|
207
|
+
}
|
|
208
|
+
}
|
package/scripts/dist.sh
CHANGED
|
@@ -5,7 +5,7 @@ rm -rf dist
|
|
|
5
5
|
for dir in actions components libs plugins reducers scripts selectors stores utils;
|
|
6
6
|
do
|
|
7
7
|
mkdir -p dist/$dir
|
|
8
|
-
npx babel $dir --copy-files --out-dir dist/$dir --extensions ".js,.jsx"
|
|
8
|
+
npx babel $dir --copy-files --out-dir dist/$dir --extensions ".js,.jsx"
|
|
9
9
|
done
|
|
10
10
|
mkdir -p dist/static/translations
|
|
11
11
|
mkdir -p dist/icons
|
|
@@ -1,9 +1,159 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Copyright 2024 Sourcepole AG
|
|
4
5
|
* All rights reserved.
|
|
5
6
|
*
|
|
6
7
|
* This source code is licensed under the BSD-style license found in the
|
|
7
8
|
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
|
|
9
|
+
*/
|
|
10
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
|
+
var fs = require("fs");
|
|
17
|
+
var path = require("path");
|
|
18
|
+
var reactDocs = require("react-docgen");
|
|
19
|
+
var qwcPluginDir = __dirname + '/../plugins';
|
|
20
|
+
var pluginData = [];
|
|
21
|
+
fs.readdirSync(qwcPluginDir).forEach(function (entry) {
|
|
22
|
+
if (entry.endsWith(".jsx")) {
|
|
23
|
+
var file = path.resolve(qwcPluginDir, entry);
|
|
24
|
+
var contents = fs.readFileSync(file);
|
|
25
|
+
pluginData.push(reactDocs.parse(contents, reactDocs.resolver.findAllComponentDefinitions));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
pluginData = pluginData.flat();
|
|
29
|
+
var mapToolPluginData = [];
|
|
30
|
+
fs.readdirSync(qwcPluginDir + "/map").forEach(function (entry) {
|
|
31
|
+
if (entry.endsWith(".jsx")) {
|
|
32
|
+
var file = path.resolve(qwcPluginDir, "map", entry);
|
|
33
|
+
var contents = fs.readFileSync(file);
|
|
34
|
+
mapToolPluginData.push(reactDocs.parse(contents, reactDocs.resolver.findAllComponentDefinitions));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
mapToolPluginData = mapToolPluginData.flat();
|
|
38
|
+
var plugin3dData = [];
|
|
39
|
+
fs.readdirSync(qwcPluginDir + "/map3d").forEach(function (entry) {
|
|
40
|
+
if (entry.endsWith(".jsx")) {
|
|
41
|
+
var file = path.resolve(qwcPluginDir, "map3d", entry);
|
|
42
|
+
var contents = fs.readFileSync(file);
|
|
43
|
+
plugin3dData.push(reactDocs.parse(contents, reactDocs.resolver.findAllComponentDefinitions));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
plugin3dData = plugin3dData.flat();
|
|
47
|
+
function parsePropType(type) {
|
|
48
|
+
if (type.name === 'shape') {
|
|
49
|
+
return '{\n' + Object.entries(type.value).map(function (_ref) {
|
|
50
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
51
|
+
key = _ref2[0],
|
|
52
|
+
value = _ref2[1];
|
|
53
|
+
return ' ' + key + ": " + parsePropType(value) + ',\n';
|
|
54
|
+
}).join('') + '}';
|
|
55
|
+
} else if (type.name === 'arrayOf') {
|
|
56
|
+
return '[' + parsePropType(type.value) + "]";
|
|
57
|
+
} else if (type.name === 'union') {
|
|
58
|
+
return '{' + type.value.map(function (entry) {
|
|
59
|
+
return parsePropType(entry);
|
|
60
|
+
}).join(", ") + '}';
|
|
61
|
+
} else {
|
|
62
|
+
return type.name;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function genPluginDoc(plugin) {
|
|
66
|
+
var output = "";
|
|
67
|
+
if (!plugin.description) {
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
output += "".concat(plugin.displayName, "<a name=\"").concat(plugin.displayName.toLowerCase(), "\"></a>\n");
|
|
71
|
+
output += "----------------------------------------------------------------\n";
|
|
72
|
+
output += plugin.description + "\n\n";
|
|
73
|
+
var props = Object.entries(plugin.props || {}).filter(function (entry) {
|
|
74
|
+
return entry[1].description;
|
|
75
|
+
});
|
|
76
|
+
if (props.length > 0) {
|
|
77
|
+
output += "| Property | Type | Description | Default value |\n";
|
|
78
|
+
output += "|----------|------|-------------|---------------|\n";
|
|
79
|
+
props.forEach(function (_ref3) {
|
|
80
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
81
|
+
name = _ref4[0],
|
|
82
|
+
prop = _ref4[1];
|
|
83
|
+
if (!prop.description) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
var defaultValue = prop.defaultValue ? prop.defaultValue.value.split("\n").map(function (x) {
|
|
87
|
+
return '`' + x.replace(' ', ' ') + '`';
|
|
88
|
+
}).join("<br />") : "`undefined`";
|
|
89
|
+
var type = "`" + parsePropType(prop.type).replaceAll(' ', ' ').replaceAll("\n", "`<br />`") + "`";
|
|
90
|
+
output += "| ".concat(name, " | ").concat(type, " | ").concat(prop.description.replaceAll("\n", "<br />"), " | ").concat(defaultValue, " |\n");
|
|
91
|
+
});
|
|
92
|
+
output += "\n";
|
|
93
|
+
}
|
|
94
|
+
plugin.methods.forEach(function (method) {
|
|
95
|
+
if (method.docblock) {
|
|
96
|
+
var params = method.params.map(function (param) {
|
|
97
|
+
return param.name;
|
|
98
|
+
}).join(",");
|
|
99
|
+
output += "**".concat(method.name, "(").concat(params, ")**\n\n");
|
|
100
|
+
output += (method.docblock || "") + "\n";
|
|
101
|
+
output += "\n";
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return output;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Write markdown output
|
|
108
|
+
var output = "";
|
|
109
|
+
output += "Plugin reference\n";
|
|
110
|
+
output += "================\n";
|
|
111
|
+
output += "\n";
|
|
112
|
+
pluginData.forEach(function (plugin) {
|
|
113
|
+
if (!plugin.description) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
output += "* [".concat(plugin.displayName, "](#").concat(plugin.displayName.toLowerCase(), ")\n");
|
|
117
|
+
});
|
|
118
|
+
output += "\n";
|
|
119
|
+
output += "Map support plugins\n";
|
|
120
|
+
output += "\n";
|
|
121
|
+
mapToolPluginData.forEach(function (plugin) {
|
|
122
|
+
if (!plugin.description) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
output += "* [".concat(plugin.displayName, "](#").concat(plugin.displayName.toLowerCase(), ")\n");
|
|
126
|
+
});
|
|
127
|
+
output += "\n";
|
|
128
|
+
output += "3D Plugins\n";
|
|
129
|
+
output += "\n";
|
|
130
|
+
plugin3dData.forEach(function (plugin) {
|
|
131
|
+
if (!plugin.description) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
output += "* [".concat(plugin.displayName, "](#").concat(plugin.displayName.toLowerCase(), ")\n");
|
|
135
|
+
});
|
|
136
|
+
output += "\n";
|
|
137
|
+
output += "---\n";
|
|
138
|
+
pluginData.forEach(function (plugin) {
|
|
139
|
+
output += genPluginDoc(plugin);
|
|
140
|
+
});
|
|
141
|
+
output += "---\n";
|
|
142
|
+
output += "# Map support plugins<a name=\"mapSupportPlugins\"></a>\n";
|
|
143
|
+
output += "\n";
|
|
144
|
+
output += "These plugins must be listed as children of the [Map](#map) plugin.";
|
|
145
|
+
output += "\n";
|
|
146
|
+
mapToolPluginData.forEach(function (plugin) {
|
|
147
|
+
output += genPluginDoc(plugin);
|
|
148
|
+
});
|
|
149
|
+
output += "---\n";
|
|
150
|
+
output += "# 3D Plugins<a name=\"plugins3d\"></a>\n";
|
|
151
|
+
output += "\n";
|
|
152
|
+
output += "These plugins must be listed as children of the [View3D](#view3d) plugin.";
|
|
153
|
+
output += "\n";
|
|
154
|
+
plugin3dData.forEach(function (plugin) {
|
|
155
|
+
output += genPluginDoc(plugin);
|
|
156
|
+
});
|
|
157
|
+
fs.writeFileSync(__dirname + '/../doc/plugins.md', output);
|
|
158
|
+
/* eslint-disable-next-line */
|
|
159
|
+
console.log("Plugin documentation written to doc/plugins.md!");
|
package/scripts/makeIconkit.js
CHANGED
|
@@ -1,7 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var _packageJson$dependen;
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var _packageJson$dependen;
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
var webfontsGenerator = require('@furkot/webfonts-generator');
|
|
7
|
+
var glob = require('glob');
|
|
8
|
+
var mkdirp = require('mkdirp');
|
|
9
|
+
var fs = require('fs');
|
|
10
|
+
var path = require('path');
|
|
11
|
+
var readJSON = function readJSON(filename) {
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(fs.readFileSync(process.cwd() + filename, "utf8"));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Determine workspaces / dependencies
|
|
20
|
+
var packageJson = readJSON('/package.json');
|
|
21
|
+
var workspaces = packageJson.workspaces || [];
|
|
22
|
+
var qwcDeps = Object.keys((_packageJson$dependen = packageJson.dependencies) !== null && _packageJson$dependen !== void 0 ? _packageJson$dependen : {
|
|
23
|
+
qwc2: "0"
|
|
24
|
+
}).filter(function (dep) {
|
|
25
|
+
return dep.startsWith("qwc");
|
|
26
|
+
});
|
|
27
|
+
var icons = [];
|
|
28
|
+
var _iterator = _createForOfIteratorHelper(workspaces),
|
|
29
|
+
_step;
|
|
30
|
+
try {
|
|
31
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
32
|
+
var workspace = _step.value;
|
|
33
|
+
icons = icons.concat(glob.sync(workspace + "/icons/*.svg"));
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
_iterator.e(err);
|
|
37
|
+
} finally {
|
|
38
|
+
_iterator.f();
|
|
39
|
+
}
|
|
40
|
+
var _iterator2 = _createForOfIteratorHelper(qwcDeps),
|
|
41
|
+
_step2;
|
|
42
|
+
try {
|
|
43
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
44
|
+
var qwcDep = _step2.value;
|
|
45
|
+
icons = icons.concat(glob.sync('node_modules/' + qwcDep + '/icons/*.svg'));
|
|
46
|
+
}
|
|
47
|
+
} catch (err) {
|
|
48
|
+
_iterator2.e(err);
|
|
49
|
+
} finally {
|
|
50
|
+
_iterator2.f();
|
|
51
|
+
}
|
|
52
|
+
icons = icons.concat(glob.sync("icons/*.svg"));
|
|
53
|
+
|
|
54
|
+
// Filter duplicate icons (user icons can override submodule icons, hence reverse)
|
|
55
|
+
icons.reverse();
|
|
56
|
+
var uniqueIcons = new Set();
|
|
57
|
+
icons = icons.filter(function (icon) {
|
|
58
|
+
var iconName = path.basename(icon);
|
|
59
|
+
if (uniqueIcons.has(iconName)) {
|
|
60
|
+
// eslint-disable-next-line
|
|
61
|
+
console.log("* " + icon + " was overriden");
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
uniqueIcons.add(iconName);
|
|
65
|
+
return true;
|
|
66
|
+
});
|
|
67
|
+
mkdirp.sync('icons/build');
|
|
68
|
+
webfontsGenerator({
|
|
69
|
+
files: icons,
|
|
70
|
+
dest: 'icons/build',
|
|
71
|
+
fontName: 'qwc2-icons',
|
|
72
|
+
templateOptions: {
|
|
73
|
+
classPrefix: 'icon-',
|
|
74
|
+
baseSelector: '.icon'
|
|
75
|
+
},
|
|
76
|
+
types: ['woff'],
|
|
77
|
+
fontHeight: 1000
|
|
78
|
+
}, function (error) {
|
|
79
|
+
if (error) {
|
|
80
|
+
// eslint-disable-next-line
|
|
81
|
+
console.log('Fail!', error);
|
|
82
|
+
} else {
|
|
83
|
+
// eslint-disable-next-line
|
|
84
|
+
console.log('Done!');
|
|
85
|
+
}
|
|
86
|
+
});
|