@dartcom/ui-kit 10.1.10 → 10.1.12
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/dist/components/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts +3 -3
- package/dist/components/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts.map +1 -1
- package/dist/index.cjs +31 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,14 +6,14 @@ export declare const useGetLeafletLayer: ({ eventHandlers, }: {
|
|
|
6
6
|
layer: Nullable<TangramLeafletLayer>;
|
|
7
7
|
scene: import("..").TangramScene | null;
|
|
8
8
|
config: Nullable<TangramEventConfig>;
|
|
9
|
-
addSource: (
|
|
9
|
+
addSource: (sourceName: TangramSourceNames) => void;
|
|
10
10
|
getSource: (sourceName: TangramSourceConfig["name"]) => {
|
|
11
11
|
tile_size: number;
|
|
12
12
|
type: string;
|
|
13
13
|
url: string;
|
|
14
14
|
} | undefined;
|
|
15
|
-
updateSource: (sourceName: TangramSourceConfig["name"], newUrl: TangramSourceConfig["url"]) =>
|
|
16
|
-
reloadSource: (sourceName: TangramSourceNames) =>
|
|
15
|
+
updateSource: (sourceName: TangramSourceConfig["name"], newUrl: TangramSourceConfig["url"]) => void;
|
|
16
|
+
reloadSource: (sourceName: TangramSourceNames) => void;
|
|
17
17
|
addLayer: (layer: TangramCustomLayer) => string[] | undefined;
|
|
18
18
|
removeLayer: (layer: TangramCustomLayer) => string[] | undefined;
|
|
19
19
|
addStyle: ({ name, style }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetLeafletLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layers/leaflet/lib/hooks/useGetLeafletLayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,kBAAkB,GAAI,oBAEhC;IACD,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C;;;;
|
|
1
|
+
{"version":3,"file":"useGetLeafletLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layers/leaflet/lib/hooks/useGetLeafletLayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,kBAAkB,GAAI,oBAEhC;IACD,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C;;;;4BAmEgB,kBAAkB;4BAsDlB,mBAAmB,CAAC,MAAM,CAAC;;;;;+BAiB1B,mBAAmB,CAAC,MAAM,CAAC,UAC/B,mBAAmB,CAAC,KAAK,CAAC;+BAyBvB,kBAAkB;sBASvB,kBAAkB;yBAyDlB,kBAAkB;gCA+BR;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;gCAyBzC,kBAAkB;gDAkBL;QAAE,KAAK,EAAE,kBAAkB,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE;;;;CAiIvE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -30347,7 +30347,7 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30347
30347
|
}
|
|
30348
30348
|
});
|
|
30349
30349
|
}, [eventHandlers]);
|
|
30350
|
-
const addSource = React__namespace.useCallback((
|
|
30350
|
+
const addSource = React__namespace.useCallback((sourceName) => {
|
|
30351
30351
|
if (!scene) {
|
|
30352
30352
|
loggerService.warn({
|
|
30353
30353
|
message: 'Scene не инициализирована',
|
|
@@ -30360,10 +30360,29 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30360
30360
|
});
|
|
30361
30361
|
return;
|
|
30362
30362
|
}
|
|
30363
|
-
const
|
|
30364
|
-
config.sources[
|
|
30363
|
+
const url = sourceUrl[sourceName];
|
|
30364
|
+
config.sources[sourceName] = {
|
|
30365
|
+
tile_size,
|
|
30366
|
+
url,
|
|
30367
|
+
type: 'MVT',
|
|
30368
|
+
};
|
|
30369
|
+
scene.updateConfig({ rebuild: true });
|
|
30370
|
+
}, [scene, config]);
|
|
30371
|
+
const deleteSource = React__namespace.useCallback((sourceName) => {
|
|
30372
|
+
if (!scene) {
|
|
30373
|
+
loggerService.warn({
|
|
30374
|
+
message: 'Scene не инициализирована',
|
|
30375
|
+
});
|
|
30376
|
+
return;
|
|
30377
|
+
}
|
|
30378
|
+
if (!config) {
|
|
30379
|
+
loggerService.warn({
|
|
30380
|
+
message: 'Config не инициализирована',
|
|
30381
|
+
});
|
|
30382
|
+
return;
|
|
30383
|
+
}
|
|
30384
|
+
delete config.sources[sourceName];
|
|
30365
30385
|
scene.updateConfig({ rebuild: true });
|
|
30366
|
-
return getSources();
|
|
30367
30386
|
}, [scene, config]);
|
|
30368
30387
|
const getSource = React__namespace.useCallback((sourceName) => {
|
|
30369
30388
|
if (!config) {
|
|
@@ -30372,7 +30391,8 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30372
30391
|
});
|
|
30373
30392
|
return;
|
|
30374
30393
|
}
|
|
30375
|
-
|
|
30394
|
+
const source = structuredClone(config.sources[sourceName]);
|
|
30395
|
+
return source;
|
|
30376
30396
|
}, [config]);
|
|
30377
30397
|
const updateSource = React__namespace.useCallback((sourceName, newUrl) => {
|
|
30378
30398
|
if (!scene) {
|
|
@@ -30387,15 +30407,12 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30387
30407
|
});
|
|
30388
30408
|
return;
|
|
30389
30409
|
}
|
|
30390
|
-
config.sources[sourceName].url = '';
|
|
30391
|
-
scene.updateConfig();
|
|
30392
30410
|
config.sources[sourceName].url = newUrl;
|
|
30393
30411
|
scene.updateConfig({ rebuild: true });
|
|
30394
|
-
return getSources();
|
|
30395
30412
|
}, [config, scene]);
|
|
30396
30413
|
const reloadSource = React__namespace.useCallback((sourceName) => {
|
|
30397
|
-
|
|
30398
|
-
|
|
30414
|
+
deleteSource(sourceName);
|
|
30415
|
+
addSource(sourceName);
|
|
30399
30416
|
}, [updateSource]);
|
|
30400
30417
|
const addLayer = React__namespace.useCallback((layer) => {
|
|
30401
30418
|
if (!scene) {
|
|
@@ -30566,15 +30583,7 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30566
30583
|
},
|
|
30567
30584
|
},
|
|
30568
30585
|
});
|
|
30569
|
-
Object.values(exports.TangramSourceNames).forEach(
|
|
30570
|
-
const url = sourceUrl[name];
|
|
30571
|
-
addSource({
|
|
30572
|
-
tile_size,
|
|
30573
|
-
name,
|
|
30574
|
-
url,
|
|
30575
|
-
type: 'MVT',
|
|
30576
|
-
});
|
|
30577
|
-
});
|
|
30586
|
+
Object.values(exports.TangramSourceNames).forEach(addSource);
|
|
30578
30587
|
}, [addStyle, addSource]);
|
|
30579
30588
|
return {
|
|
30580
30589
|
layer,
|
|
@@ -30744,10 +30753,12 @@ const CustomModal = ({ name, children, onClose, onOpen, }) => {
|
|
|
30744
30753
|
if (open) {
|
|
30745
30754
|
onOpen?.({ name });
|
|
30746
30755
|
}
|
|
30756
|
+
else {
|
|
30757
|
+
onClose?.({ name });
|
|
30758
|
+
}
|
|
30747
30759
|
}, [open]);
|
|
30748
30760
|
return (jsxRuntime.jsx(Modal, { open: open, onClose: () => {
|
|
30749
30761
|
modalStore.closeModal(name);
|
|
30750
|
-
onClose?.({ name });
|
|
30751
30762
|
}, "aria-labelledby": `modal-${modalId}-title`, "aria-describedby": `modal-${modalId}-description`, children: jsxRuntime.jsx(Box, { sx: ({ breakpoints }) => {
|
|
30752
30763
|
return {
|
|
30753
30764
|
...modalStyle,
|