@geogirafe/lib-geoportal 1.2.0-dev.2829121016 → 1.2.0-dev.2829525740
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/buildtools/tools.js +38 -0
- package/components/print/component.d.ts +3 -3
- package/components/print/component.js +4 -4
- package/decorators.d.ts +5 -0
- package/decorators.js +7 -0
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/drawing/cesiumDrawing.js +13 -2
- package/tools/main.d.ts +0 -1
- package/tools/main.js +0 -1
package/buildtools/tools.js
CHANGED
|
@@ -348,6 +348,44 @@ export function extractNotDefaultExportValueNames(code) {
|
|
|
348
348
|
return exportNames;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
export function haslazyLoadedInLibDecorator(code, exportName) {
|
|
352
|
+
// Check if a specific exported class/function is decorated with @lazyLoadedInLib
|
|
353
|
+
// Split code into lines and look for @lazyLoadedInLib decorator immediately followed by export
|
|
354
|
+
|
|
355
|
+
const lines = code.split('\n');
|
|
356
|
+
|
|
357
|
+
for (let i = 0; i < lines.length; i++) {
|
|
358
|
+
const line = lines[i];
|
|
359
|
+
const trimmedLine = line.trim();
|
|
360
|
+
|
|
361
|
+
// Check if this line has an export of the named item
|
|
362
|
+
// Look for: export default class ExportName OR export class ExportName
|
|
363
|
+
const exportKeywordIndex = trimmedLine.indexOf('export');
|
|
364
|
+
if (exportKeywordIndex !== -1) {
|
|
365
|
+
// Check if this export line contains our exportName
|
|
366
|
+
const classMatch = trimmedLine.match(
|
|
367
|
+
/export\s+(?:default\s+)?(?:async\s+)?(?:abstract\s+)?(class|function|const)\s+(\w+)/i
|
|
368
|
+
);
|
|
369
|
+
if (classMatch && classMatch[2] === exportName) {
|
|
370
|
+
// Check if the previous line has @lazyLoadedInLib
|
|
371
|
+
if (i > 0 && lines[i - 1].includes('@lazyLoadedInLib')) {
|
|
372
|
+
return true;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Check if the same line has @lazyLoadedInLib before the export keyword
|
|
376
|
+
if (trimmedLine.includes('@lazyLoadedInLib')) {
|
|
377
|
+
const index = trimmedLine.indexOf('@lazyLoadedInLib');
|
|
378
|
+
if (index >= 0 && index < exportKeywordIndex) {
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
|
|
351
389
|
export function appendImportExtension(code, extension) {
|
|
352
390
|
if (!extension.startsWith('.')) {
|
|
353
391
|
extension = `.${extension}`;
|
|
@@ -61,10 +61,10 @@ declare class PrintComponent extends GirafeHTMLElement implements IGirafePanel {
|
|
|
61
61
|
*/
|
|
62
62
|
onScaleChanged(event: KeyboardEvent): void;
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
64
|
+
* Take the value from the input and set the selected scale
|
|
65
|
+
* in the state and update the mask.
|
|
66
66
|
*/
|
|
67
|
-
onCustomScaleTyped(evt:
|
|
67
|
+
onCustomScaleTyped(evt: Event): void;
|
|
68
68
|
/**
|
|
69
69
|
* @Returns the current print scale.
|
|
70
70
|
*/
|
|
@@ -29,7 +29,7 @@ class PrintComponent extends GirafeHTMLElement {
|
|
|
29
29
|
#panel{min-width:20rem;height:100%;overflow:auto}#content{background:var(--bkg-color);color:var(--text-color);margin:0;padding:1.5rem}#content .message{text-align:center;width:100%}#content .message *{margin:.25rem}.option{margin-top:.5rem;display:flex}.option label{width:40%}.option label:after{content:" :"}.option input,.option select,.option textarea{flex-grow:1}.option input.gg-checkbox{flex-grow:0}.rotation{flex-grow:1;gap:.5rem;display:flex}#rotationSlider{width:0}#rotationNumber{flex-grow:0;width:4rem}#content #export-pdf{float:right;margin-top:1rem}#content button{background-color:var(--bkg-color);color:var(--text-color);border:solid 1px var(--text-color);cursor:pointer;border-radius:3px;outline:0}#content button:hover{background-color:var(--bkg-color-grad2)}#content #print-list{margin-top:5rem}#print-list .print-item{border:solid 1px var(--text-color);color:var(--text-color);margin-top:.5rem;padding:.5rem;position:relative}#print-list .print-item .container{text-align:unset;border:none;width:100%;display:inline}#print-list .print-item .cancel{cursor:pointer;color:var(--text-color-grad1);background-color:#0000;border:none;position:absolute;top:.5rem;right:.5rem}.print-item .cancel i:before{content:"uf00d"}.print-item .cancel:hover{border-color:var(--text-color);color:var(--text-color)}.print-item i.status{float:left;text-align:center;width:3rem;margin-right:1rem}.print-item:has(.success):hover{background-color:var(--bkg-color-grad2);cursor:pointer}.print-item i.status:before{line-height:3rem;display:block}.print-item p{line-height:1.3rem}.print-item p.time{margin-right:.5rem;position:absolute;bottom:0;right:0}#custom-scale{color:var(--text-color);flex-flow:wrap;justify-content:flex-start;align-items:center;display:flex}#custom-scale .svg-info{margin-left:.5rem}#custom-scale>div{align-items:center;width:100%;display:flex}.gg-custom-scale{justify-content:flex-end}.warning{border-top:1px solid #333;border-bottom:1px solid #333;margin-top:1rem;margin-bottom:1rem;padding:.5rem}.warning h3{margin:0 0 1rem;font-size:1rem}.warning span{display:block}
|
|
30
30
|
</style>
|
|
31
31
|
<style>${this.customStyle}</style>
|
|
32
|
-
<div id="panel"><div id="content"><div class="${this.getRenderState() === 'loading' ? '' : 'hidden'}"><div class="message"><div i18n="Connecting to the print server, please wait."></div><img alt="loading-icon" src="icons/loading.svg" class="gg-spin"></div></div><div class="${this.getRenderState() === 'error' ? '' : 'hidden'}"><div class="message" i18n="The print server is unavailable. Please, try later."></div></div><div class="${this.getRenderState() === 'setup' ? '' : 'hidden'}"><div class="option"><label for="layout" i18n="Layout" class="gg-label">Layout</label> <select id="layout" class="gg-select" onchange="${(evt) => this.onLayoutChanged(evt)}">${this.layouts.map((layout) => uHtml `<option i18n="${layout.name}" ?selected="${this.selectedLayout?.name === layout.name}" value="${layout.name}">${layout.name}</option>`)}</select></div><div class="option gg-custom-scale"><label for="scale" i18n="Scale" class="gg-label">Scale</label> <select id="scale" class="gg-select" onchange="${(evt) => this.onScaleChanged(evt)}">${this.scales.map((scale) => uHtml `<option ?selected="${this.getSelectedScale() === scale}" value="${scale}"><span>1 : </span><span i18n="${scale}" i18nfn="formatNumber">${scale}</span></option>`)}<option i18n="Manual entry" class="${this.context.configManager.Config.print?.customScale === true ? '' : 'hidden'}" value="custom">Manual entry</select></div><div class="${this.showCustomScale === true ? 'option' : 'hidden'}"><div id="custom-scale"><label for="scale" i18n="Custom scale" class="gg-label">Custom scale</label><div><span>1 : </span><input class="gg-input" type="number" min="10"
|
|
32
|
+
<div id="panel"><div id="content"><div class="${this.getRenderState() === 'loading' ? '' : 'hidden'}"><div class="message"><div i18n="Connecting to the print server, please wait."></div><img alt="loading-icon" src="icons/loading.svg" class="gg-spin"></div></div><div class="${this.getRenderState() === 'error' ? '' : 'hidden'}"><div class="message" i18n="The print server is unavailable. Please, try later."></div></div><div class="${this.getRenderState() === 'setup' ? '' : 'hidden'}"><div class="option"><label for="layout" i18n="Layout" class="gg-label">Layout</label> <select id="layout" class="gg-select" onchange="${(evt) => this.onLayoutChanged(evt)}">${this.layouts.map((layout) => uHtml `<option i18n="${layout.name}" ?selected="${this.selectedLayout?.name === layout.name}" value="${layout.name}">${layout.name}</option>`)}</select></div><div class="option gg-custom-scale"><label for="scale" i18n="Scale" class="gg-label">Scale</label> <select id="scale" class="gg-select" onchange="${(evt) => this.onScaleChanged(evt)}">${this.scales.map((scale) => uHtml `<option ?selected="${this.getSelectedScale() === scale}" value="${scale}"><span>1 : </span><span i18n="${scale}" i18nfn="formatNumber">${scale}</span></option>`)}<option i18n="Manual entry" class="${this.context.configManager.Config.print?.customScale === true ? '' : 'hidden'}" value="custom">Manual entry</select></div><div class="${this.showCustomScale === true ? 'option' : 'hidden'}"><div id="custom-scale"><label for="scale" i18n="Custom scale" class="gg-label">Custom scale</label><div><span>1 : </span><input class="gg-input" type="number" min="10" oninput="${(evt) => this.onCustomScaleTyped(evt)}"></div></div></div><div class="option"><label for="format" i18n="Format" class="gg-label">Format</label> <select id="format" class="gg-select" onchange="${(evt) => this.onFormatChanged(evt)}">${this.printFormats.map((format) => uHtml `<option ?selected="${this.getSelectedFormat() === format}" value="${format}">${format.toUpperCase()}</option>`)}</select></div>${uHtml `<div class="option"><label for="dpi" class="gg-label">DPI</label> <select id="dpi" class="gg-select" onchange="${(evt) => this.onDpiChanged(evt)}">${this.dpis.map((dpi) => uHtml `<option ?selected="${this.getSelectedDpi() === dpi}" value="${dpi}">${dpi}</option>`)}</select></div>`}<div class="option"><label for="rotationSlider" i18n="Rotation" class="gg-label">Rotation</label><div class="rotation"><input id="rotationSlider" class="gg-range" type="range" min="-180" max="180" step="1" value="${this.getRotation()}" oninput="${(evt) => this.onInputRotationChanged(evt)}"> <input id="rotationNumber" class="gg-input" type="number" min="-180" max="180" step="1" value="${this.getRotation()}" oninput="${(evt) => this.onInputRotationChanged(evt)}"></div></div>${this.attributeNames.map((attrName) => { if (this.getAttributeInputType(attrName) === 'number') {
|
|
33
33
|
return uHtml `<div class="option"><label for="${attrName}" i18n="${this.attrNameForI18n(attrName)}" class="gg-label">${attrName}</label> <input id="${attrName}" type="number" class="gg-input" value="${this.getCapabilitiesAttribute(attrName)?.default}"></div>`;
|
|
34
34
|
} if (this.getAttributeInputType(attrName) === 'checkbox') {
|
|
35
35
|
return uHtml `<div class="option"><label for="${attrName}" i18n="${this.attrNameForI18n(attrName)}" class="gg-label">${attrName}</label> <input id="${attrName}" type="checkbox" class="gg-checkbox" ?checked="${this.getCapabilitiesAttribute(attrName)?.default}"></div>`;
|
|
@@ -129,12 +129,12 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
129
129
|
this.printMaskManager?.zoomToScale(this.state.print.scale);
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
132
|
+
* Take the value from the input and set the selected scale
|
|
133
|
+
* in the state and update the mask.
|
|
134
134
|
*/
|
|
135
135
|
onCustomScaleTyped(evt) {
|
|
136
136
|
const value = parseInt(evt.target?.value);
|
|
137
|
-
if (
|
|
137
|
+
if (!value) {
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
this.state.print.scale = value;
|
package/decorators.d.ts
CHANGED
|
@@ -3,3 +3,8 @@
|
|
|
3
3
|
* @constructor
|
|
4
4
|
*/
|
|
5
5
|
export declare function UsedInTemplateOnly(_reason?: string): (_target: object, _propertyKey: string, _descriptor: PropertyDescriptor) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Use this Decorator to mark a class that should not be exported in the library main files.
|
|
8
|
+
* @constructor
|
|
9
|
+
*/
|
|
10
|
+
export declare function lazyLoadedInLib(): (_target: Function) => void;
|
package/decorators.js
CHANGED
|
@@ -6,3 +6,10 @@
|
|
|
6
6
|
export function UsedInTemplateOnly(_reason = 'Method is used in HTML Template') {
|
|
7
7
|
return function (_target, _propertyKey, _descriptor) { };
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Use this Decorator to mark a class that should not be exported in the library main files.
|
|
11
|
+
* @constructor
|
|
12
|
+
*/
|
|
13
|
+
export function lazyLoadedInLib() {
|
|
14
|
+
return function (_target) { };
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.2.0-dev.
|
|
1
|
+
{"version":"1.2.0-dev.2829525740", "build":"2829525740", "date":"08/09/2026"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
8
|
import * as Cesium from 'cesium';
|
|
3
9
|
import { CallbackProperty, Cartesian2, Cartesian3, Cartographic, Color, EllipsoidGeodesic, Entity, ScreenSpaceEventType, PolygonHierarchy } from 'cesium';
|
|
4
10
|
import { KML, GeoJSON } from 'ol/format.js';
|
|
5
11
|
import DrawingFeature, { DrawingShape } from './drawingFeature.js';
|
|
6
12
|
import proj4 from 'proj4';
|
|
13
|
+
import { lazyLoadedInLib } from '../../decorators.js';
|
|
7
14
|
const CLAMP_TO_GROUND = Cesium.HeightReference.CLAMP_TO_GROUND;
|
|
8
|
-
|
|
15
|
+
let CesiumDrawing = class CesiumDrawing {
|
|
9
16
|
// Writes drawn features into the specified location in the extended state
|
|
10
17
|
stateLocation;
|
|
11
18
|
activeShapePoints = [];
|
|
@@ -407,4 +414,8 @@ export default class CesiumDrawing {
|
|
|
407
414
|
}
|
|
408
415
|
});
|
|
409
416
|
}
|
|
410
|
-
}
|
|
417
|
+
};
|
|
418
|
+
CesiumDrawing = __decorate([
|
|
419
|
+
lazyLoadedInLib()
|
|
420
|
+
], CesiumDrawing);
|
|
421
|
+
export default CesiumDrawing;
|
package/tools/main.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export { default as GirafeConfig } from './configuration/girafeconfig.js';
|
|
|
14
14
|
export { defaultNewsSanitizeConfig, defaultPermalinkSanitizeConfig, defaultQuerySanitizeConfig } from './configuration/sanitizeconfig-defaults.js';
|
|
15
15
|
export { default as GirafeContext } from './context/context.js';
|
|
16
16
|
export type { default as IGirafeContext } from './context/icontext.js';
|
|
17
|
-
export { default as CesiumDrawing } from './drawing/cesiumDrawing.js';
|
|
18
17
|
export type { DrawingShape, ArrowStyle, ArrowPosition, LineStroke, MeasureInformation, SerializedFeature } from './drawing/drawingFeature.js';
|
|
19
18
|
export { default as DrawingFeature } from './drawing/drawingFeature.js';
|
|
20
19
|
export { default as DrawingSerializer } from './drawing/drawingSerializer.js';
|
package/tools/main.js
CHANGED
|
@@ -12,7 +12,6 @@ export { default as ConfigManager } from './configuration/configmanager.js';
|
|
|
12
12
|
export { default as GirafeConfig } from './configuration/girafeconfig.js';
|
|
13
13
|
export { defaultNewsSanitizeConfig, defaultPermalinkSanitizeConfig, defaultQuerySanitizeConfig } from './configuration/sanitizeconfig-defaults.js';
|
|
14
14
|
export { default as GirafeContext } from './context/context.js';
|
|
15
|
-
export { default as CesiumDrawing } from './drawing/cesiumDrawing.js';
|
|
16
15
|
export { default as DrawingFeature } from './drawing/drawingFeature.js';
|
|
17
16
|
export { default as DrawingSerializer } from './drawing/drawingSerializer.js';
|
|
18
17
|
export { default as DrawingState } from './drawing/drawingState.js';
|