@wipco/sdui 0.3.0 → 0.4.0
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/{chunk-YJMD6MOE.js → chunk-FGRR3ROJ.js} +95 -2
- package/dist/index.d.ts +114 -4
- package/dist/index.js +142 -89
- package/dist/meta.d.ts +180 -2
- package/dist/meta.js +1607 -1
- package/dist/rich.js +18 -4
- package/package.json +1 -1
package/dist/rich.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HoistedStyle } from './chunk-
|
|
2
|
-
export { DatePicker, DateRangePicker } from './chunk-
|
|
1
|
+
import { useSduiAssetResolver, HoistedStyle } from './chunk-FGRR3ROJ.js';
|
|
2
|
+
export { DatePicker, DateRangePicker } from './chunk-FGRR3ROJ.js';
|
|
3
3
|
import { Spinner, EmptyState } from './chunk-ZUCI34QY.js';
|
|
4
4
|
import { useRef, useCallback, useMemo, useState, useEffect, useLayoutEffect } from 'react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -490,6 +490,7 @@ function MapPreview({
|
|
|
490
490
|
const [ready, setReady] = useState(false);
|
|
491
491
|
const ol = useOptionalModule(loadOl);
|
|
492
492
|
const olModule = ol.status === "ready" ? ol.module : null;
|
|
493
|
+
const resolveAsset = useSduiAssetResolver();
|
|
493
494
|
const markersKey = useMemo(() => JSON.stringify(Array.isArray(markers) ? markers : []), [markers]);
|
|
494
495
|
const centerLat = center?.lat;
|
|
495
496
|
const centerLng = center?.lng;
|
|
@@ -536,7 +537,20 @@ function MapPreview({
|
|
|
536
537
|
});
|
|
537
538
|
const map = new OlMap({
|
|
538
539
|
target: container,
|
|
539
|
-
layers: [
|
|
540
|
+
layers: [
|
|
541
|
+
new TileLayer({
|
|
542
|
+
source: new OSM({
|
|
543
|
+
// OL 기본 구현과 같되 URL만 관문에 태운다. `null`이면 src를 아예 안 넣는다 —
|
|
544
|
+
// 빈 문자열을 넣으면 브라우저가 현재 문서 URL로 요청을 한 번 더 낸다.
|
|
545
|
+
tileLoadFunction: (tile, src) => {
|
|
546
|
+
const next = resolveAsset(src, { component: "MapPreview", prop: "src", kind: "attribute" });
|
|
547
|
+
if (next === null) return;
|
|
548
|
+
tile.getImage().src = next;
|
|
549
|
+
}
|
|
550
|
+
})
|
|
551
|
+
}),
|
|
552
|
+
new VectorLayer({ source: new VectorSource({ features }) })
|
|
553
|
+
],
|
|
540
554
|
// OSM 라이선스상 저작자 표기(Attribution)는 항상 유지한다.
|
|
541
555
|
controls: defaultControls({ attribution: true, rotate: false, zoom: interactive }),
|
|
542
556
|
interactions: interactive ? defaultInteractions() : defaultInteractions({
|
|
@@ -598,7 +612,7 @@ function MapPreview({
|
|
|
598
612
|
map.setTarget(void 0);
|
|
599
613
|
setReady(false);
|
|
600
614
|
};
|
|
601
|
-
}, [olModule, markersKey, centerLat, centerLng, zoom, interactive]);
|
|
615
|
+
}, [olModule, markersKey, centerLat, centerLng, zoom, interactive, resolveAsset]);
|
|
602
616
|
if (ol.status !== "ready") {
|
|
603
617
|
return /* @__PURE__ */ jsx(
|
|
604
618
|
DependencyPlaceholder,
|