@geogirafe/lib-geoportal 1.2.0-dev.2829479244 → 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/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}`;
|
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';
|