@element-editor/ui 0.0.0-stage → 0.2.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/AGENTS.md +65 -0
- package/LICENSE +21 -0
- package/README.md +46 -2
- package/dist/BooleanOperations-WXcmW9Vy.cjs +1 -0
- package/dist/BooleanOperations-oF0WybQP.js +111 -0
- package/dist/DataTable-CNfB01y2.cjs +2 -0
- package/dist/DataTable-DNmjUwka.js +510 -0
- package/dist/DataTablePanel-BknCxC1K.cjs +1 -0
- package/dist/DataTablePanel-rWdaQubk.js +208 -0
- package/dist/EditToolbarBtn-SZIsnIn3.js +378 -0
- package/dist/EditToolbarBtn-dpCmKnzk.cjs +3 -0
- package/dist/FeatureEditModal-BF-fGhVD.js +77 -0
- package/dist/FeatureEditModal-CM6BObUO.cjs +1 -0
- package/dist/FeatureList-CQb2kTrV.js +520 -0
- package/dist/FeatureList-Csr-anLA.cjs +1 -0
- package/dist/FeatureRowContextMenu-BLt7VlUU.js +130 -0
- package/dist/FeatureRowContextMenu-Gwq3OMEA.cjs +1 -0
- package/dist/GeoJSONModal-BPFWeaLZ.js +886 -0
- package/dist/GeoJSONModal-iwUcvrg7.cjs +9 -0
- package/dist/SchemaEditor-BEsKUe2p.js +293 -0
- package/dist/SchemaEditor-qkoYMg0C.cjs +1 -0
- package/dist/SchemaModal-9nNrgorr.js +95 -0
- package/dist/SchemaModal-GrtgA7cH.cjs +1 -0
- package/dist/SettingsModal-6_qmRyCi.cjs +1 -0
- package/dist/SettingsModal-DTP0Xx_Z.js +237 -0
- package/dist/ShortcutsModal-CdyQlrqK.cjs +1 -0
- package/dist/ShortcutsModal-DwxZu71W.js +299 -0
- package/dist/components/ActiveDrawingToolbar.d.cts +1 -0
- package/dist/components/ActiveDrawingToolbar.d.ts +1 -0
- package/dist/components/BasemapPicker.d.cts +26 -0
- package/dist/components/BasemapPicker.d.ts +26 -0
- package/dist/components/BooleanOperations.d.cts +1 -0
- package/dist/components/BooleanOperations.d.ts +1 -0
- package/dist/components/BufferPanel.d.cts +1 -0
- package/dist/components/BufferPanel.d.ts +1 -0
- package/dist/components/DataTable.d.cts +9 -0
- package/dist/components/DataTable.d.ts +9 -0
- package/dist/components/DataTablePanel.d.cts +10 -0
- package/dist/components/DataTablePanel.d.ts +10 -0
- package/dist/components/EditingToolbar.d.cts +1 -0
- package/dist/components/EditingToolbar.d.ts +1 -0
- package/dist/components/ElementEditorErrorBoundary.d.cts +28 -0
- package/dist/components/ElementEditorErrorBoundary.d.ts +28 -0
- package/dist/components/ElementEditorUIProvider.d.cts +50 -0
- package/dist/components/ElementEditorUIProvider.d.ts +50 -0
- package/dist/components/FeatureMapContextMenu.d.cts +23 -0
- package/dist/components/FeatureMapContextMenu.d.ts +23 -0
- package/dist/components/FitBoundsButton.d.cts +6 -0
- package/dist/components/FitBoundsButton.d.ts +6 -0
- package/dist/components/FloatingToolbar.d.cts +3 -0
- package/dist/components/FloatingToolbar.d.ts +3 -0
- package/dist/components/LocateButton.d.cts +11 -0
- package/dist/components/LocateButton.d.ts +11 -0
- package/dist/components/ReadonlyBanner.d.cts +1 -0
- package/dist/components/ReadonlyBanner.d.ts +1 -0
- package/dist/components/ShortcutsModal.d.cts +1 -0
- package/dist/components/ShortcutsModal.d.ts +1 -0
- package/dist/components/SimplifyPanel.d.cts +1 -0
- package/dist/components/SimplifyPanel.d.ts +1 -0
- package/dist/components/SmoothPanel.d.cts +1 -0
- package/dist/components/SmoothPanel.d.ts +1 -0
- package/dist/components/UndoRedoToolbar.d.cts +20 -0
- package/dist/components/UndoRedoToolbar.d.ts +20 -0
- package/dist/components/VertexSelectionBar.d.cts +12 -0
- package/dist/components/VertexSelectionBar.d.ts +12 -0
- package/dist/components/ZoomIndicator.d.cts +15 -0
- package/dist/components/ZoomIndicator.d.ts +15 -0
- package/dist/components/dialogs/DynamicFieldRenderer.d.cts +11 -0
- package/dist/components/dialogs/DynamicFieldRenderer.d.ts +11 -0
- package/dist/components/dialogs/SettingsModal.d.cts +1 -0
- package/dist/components/dialogs/SettingsModal.d.ts +1 -0
- package/dist/components/lazyParts.d.cts +12 -0
- package/dist/components/lazyParts.d.ts +12 -0
- package/dist/components/sidebar/FeatureEditModal.d.cts +6 -0
- package/dist/components/sidebar/FeatureEditModal.d.ts +6 -0
- package/dist/components/sidebar/FeatureList.d.cts +4 -0
- package/dist/components/sidebar/FeatureList.d.ts +4 -0
- package/dist/components/sidebar/FeatureRow.d.cts +38 -0
- package/dist/components/sidebar/FeatureRow.d.ts +38 -0
- package/dist/components/sidebar/FeatureRowContextMenu.d.cts +12 -0
- package/dist/components/sidebar/FeatureRowContextMenu.d.ts +12 -0
- package/dist/components/sidebar/FeatureSidePanel.d.cts +8 -0
- package/dist/components/sidebar/FeatureSidePanel.d.ts +8 -0
- package/dist/components/sidebar/GeoJSONModal.d.cts +5 -0
- package/dist/components/sidebar/GeoJSONModal.d.ts +5 -0
- package/dist/components/sidebar/GroupRow.d.cts +21 -0
- package/dist/components/sidebar/GroupRow.d.ts +21 -0
- package/dist/components/sidebar/HideLayersToggle.d.cts +2 -0
- package/dist/components/sidebar/HideLayersToggle.d.ts +2 -0
- package/dist/components/sidebar/LayersPanel.d.cts +5 -0
- package/dist/components/sidebar/LayersPanel.d.ts +5 -0
- package/dist/components/sidebar/PartSubRow.d.cts +9 -0
- package/dist/components/sidebar/PartSubRow.d.ts +9 -0
- package/dist/components/sidebar/SchemaEditor.d.cts +4 -0
- package/dist/components/sidebar/SchemaEditor.d.ts +4 -0
- package/dist/components/sidebar/SchemaModal.d.cts +5 -0
- package/dist/components/sidebar/SchemaModal.d.ts +5 -0
- package/dist/components/sidebar/codeDock.d.cts +21 -0
- package/dist/components/sidebar/codeDock.d.ts +21 -0
- package/dist/components/ui/Button.d.cts +9 -0
- package/dist/components/ui/Button.d.ts +9 -0
- package/dist/components/ui/CloseButton.d.cts +6 -0
- package/dist/components/ui/CloseButton.d.ts +6 -0
- package/dist/components/ui/ContextMenu.d.cts +28 -0
- package/dist/components/ui/ContextMenu.d.ts +28 -0
- package/dist/components/ui/EditToolbarBtn.d.cts +13 -0
- package/dist/components/ui/EditToolbarBtn.d.ts +13 -0
- package/dist/components/ui/ElementToaster.d.cts +3 -0
- package/dist/components/ui/ElementToaster.d.ts +3 -0
- package/dist/components/ui/GeometryTypeIcon.d.cts +7 -0
- package/dist/components/ui/GeometryTypeIcon.d.ts +7 -0
- package/dist/components/ui/IconButton.d.cts +28 -0
- package/dist/components/ui/IconButton.d.ts +28 -0
- package/dist/components/ui/Input.d.cts +14 -0
- package/dist/components/ui/Input.d.ts +14 -0
- package/dist/components/ui/JsonCode.d.cts +4 -0
- package/dist/components/ui/JsonCode.d.ts +4 -0
- package/dist/components/ui/Kbd.d.cts +16 -0
- package/dist/components/ui/Kbd.d.ts +16 -0
- package/dist/components/ui/NoFeaturesEmptyState.d.cts +1 -0
- package/dist/components/ui/NoFeaturesEmptyState.d.ts +1 -0
- package/dist/components/ui/SearchDropdown.d.cts +28 -0
- package/dist/components/ui/SearchDropdown.d.ts +28 -0
- package/dist/components/ui/ToolButton.d.cts +19 -0
- package/dist/components/ui/ToolButton.d.ts +19 -0
- package/dist/components/ui/Tooltip.d.cts +12 -0
- package/dist/components/ui/Tooltip.d.ts +12 -0
- package/dist/components/ui/panelHeader.d.cts +2 -0
- package/dist/components/ui/panelHeader.d.ts +2 -0
- package/dist/components/ui/resizeEdge.d.cts +4 -0
- package/dist/components/ui/resizeEdge.d.ts +4 -0
- package/dist/contexts/ElementEditorConfigContext.d.cts +351 -0
- package/dist/contexts/ElementEditorConfigContext.d.ts +351 -0
- package/dist/contexts/EventContext.d.cts +69 -0
- package/dist/contexts/EventContext.d.ts +69 -0
- package/dist/contexts/MapControllerContext.d.cts +24 -0
- package/dist/contexts/MapControllerContext.d.ts +24 -0
- package/dist/contexts/ShortcutConfigContext.d.cts +16 -0
- package/dist/contexts/ShortcutConfigContext.d.ts +16 -0
- package/dist/contexts/ThemeContext.d.cts +12 -0
- package/dist/contexts/ThemeContext.d.ts +12 -0
- package/dist/element-editor-ui.cjs +1 -0
- package/dist/element-editor-ui.es.js +102 -0
- package/dist/geometryWorker-CCwg4tNC.cjs +1 -0
- package/dist/geometryWorker-DgQCFSmD.js +25 -0
- package/dist/hooks/dragShield.d.cts +7 -0
- package/dist/hooks/dragShield.d.ts +7 -0
- package/dist/hooks/themeInputs.d.cts +14 -0
- package/dist/hooks/themeInputs.d.ts +14 -0
- package/dist/hooks/useAccentPalette.d.cts +15 -0
- package/dist/hooks/useAccentPalette.d.ts +15 -0
- package/dist/hooks/useAccentStyle.d.cts +39 -0
- package/dist/hooks/useAccentStyle.d.ts +39 -0
- package/dist/hooks/useAdapterControls.d.cts +280 -0
- package/dist/hooks/useAdapterControls.d.ts +280 -0
- package/dist/hooks/useBalancedWrap.d.cts +8 -0
- package/dist/hooks/useBalancedWrap.d.ts +8 -0
- package/dist/hooks/useContextMenu.d.cts +11 -0
- package/dist/hooks/useContextMenu.d.ts +11 -0
- package/dist/hooks/useDataChangeSubscription.d.cts +9 -0
- package/dist/hooks/useDataChangeSubscription.d.ts +9 -0
- package/dist/hooks/useDragWindow.d.cts +9 -0
- package/dist/hooks/useDragWindow.d.ts +9 -0
- package/dist/hooks/useFocusTrap.d.cts +7 -0
- package/dist/hooks/useFocusTrap.d.ts +7 -0
- package/dist/hooks/useGeoJSONDrop.d.cts +40 -0
- package/dist/hooks/useGeoJSONDrop.d.ts +40 -0
- package/dist/hooks/useGeoJSONExport.d.cts +69 -0
- package/dist/hooks/useGeoJSONExport.d.ts +69 -0
- package/dist/hooks/useGeoJSONFileImport.d.cts +24 -0
- package/dist/hooks/useGeoJSONFileImport.d.ts +24 -0
- package/dist/hooks/useInlineRename.d.cts +26 -0
- package/dist/hooks/useInlineRename.d.ts +26 -0
- package/dist/hooks/useJumpToFeature.d.cts +3 -0
- package/dist/hooks/useJumpToFeature.d.ts +3 -0
- package/dist/hooks/useKeyboardShortcuts.d.cts +9 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +9 -0
- package/dist/hooks/useNominatim.d.cts +24 -0
- package/dist/hooks/useNominatim.d.ts +24 -0
- package/dist/hooks/usePanelOffset.d.cts +14 -0
- package/dist/hooks/usePanelOffset.d.ts +14 -0
- package/dist/hooks/useResizablePanel.d.cts +4 -0
- package/dist/hooks/useResizablePanel.d.ts +4 -0
- package/dist/hooks/useRootTokens.d.cts +27 -0
- package/dist/hooks/useRootTokens.d.ts +27 -0
- package/dist/hooks/useSearchState.d.cts +23 -0
- package/dist/hooks/useSearchState.d.ts +23 -0
- package/dist/hooks/useServiceAttribution.d.cts +13 -0
- package/dist/hooks/useServiceAttribution.d.ts +13 -0
- package/dist/hooks/useWindowEscape.d.cts +25 -0
- package/dist/hooks/useWindowEscape.d.ts +25 -0
- package/dist/hooks/useWindowFocus.d.cts +4 -0
- package/dist/hooks/useWindowFocus.d.ts +4 -0
- package/dist/hooks/useWorkerGeometryPreview.d.cts +22 -0
- package/dist/hooks/useWorkerGeometryPreview.d.ts +22 -0
- package/dist/index-BKdDZ4Y9.cjs +1 -0
- package/dist/index-CtZterPc.js +3165 -0
- package/dist/index.d.cts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/internal.cjs +1 -0
- package/dist/internal.d.cts +16 -0
- package/dist/internal.d.ts +16 -0
- package/dist/internal.es.js +42 -0
- package/dist/primitives.cjs +1 -0
- package/dist/primitives.d.cts +19 -0
- package/dist/primitives.d.ts +19 -0
- package/dist/primitives.es.js +17 -0
- package/dist/store/StoreContext.d.cts +17 -0
- package/dist/store/StoreContext.d.ts +17 -0
- package/dist/types/events.d.cts +95 -0
- package/dist/types/events.d.ts +95 -0
- package/dist/useAccentStyle-CPo2XqAn.js +412 -0
- package/dist/useAccentStyle-hsGvyHZc.cjs +1 -0
- package/dist/useAdapterControls-BBObhzVX.cjs +1 -0
- package/dist/useAdapterControls-DVjkwRZ_.js +691 -0
- package/dist/useContextMenu-DJ2Cti85.js +10 -0
- package/dist/useContextMenu-DbxMvb1s.cjs +1 -0
- package/dist/useFocusTrap-BBjPCfDR.cjs +1 -0
- package/dist/useFocusTrap-CKxKT8De.js +25 -0
- package/dist/useJumpToFeature-Bdz2hqOC.js +16 -0
- package/dist/useJumpToFeature-LwjxGzfy.cjs +1 -0
- package/dist/useWindowFocus-D-_yEm_V.cjs +1 -0
- package/dist/useWindowFocus-DGAWA1au.js +80 -0
- package/dist/utils/booleanValue.d.cts +4 -0
- package/dist/utils/booleanValue.d.ts +4 -0
- package/dist/utils/clipboardError.d.cts +3 -0
- package/dist/utils/clipboardError.d.ts +3 -0
- package/dist/utils/download.d.cts +42 -0
- package/dist/utils/download.d.ts +42 -0
- package/dist/utils/geojsonDocument.d.cts +168 -0
- package/dist/utils/geojsonDocument.d.ts +168 -0
- package/dist/utils/geometryWorkerClient.d.cts +6 -0
- package/dist/utils/geometryWorkerClient.d.ts +6 -0
- package/dist/utils/layerOrder.d.cts +9 -0
- package/dist/utils/layerOrder.d.ts +9 -0
- package/dist/utils/lazyWithPreload.d.cts +24 -0
- package/dist/utils/lazyWithPreload.d.ts +24 -0
- package/dist/utils/lineSmooth.d.cts +7 -0
- package/dist/utils/lineSmooth.d.ts +7 -0
- package/dist/utils/platform.d.cts +2 -0
- package/dist/utils/platform.d.ts +2 -0
- package/dist/workers/geometryWorker.d.cts +1 -0
- package/dist/workers/geometryWorker.d.ts +1 -0
- package/package.json +133 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as G, useState as X, useCallback as J } from "react";
|
|
3
|
+
import { u as P, i as S, W as Z, s as K } from "./index-CtZterPc.js";
|
|
4
|
+
import { u as V } from "./useAccentStyle-CPo2XqAn.js";
|
|
5
|
+
import { readStorage as q, writeStorage as Q } from "@element-editor/core";
|
|
6
|
+
import { Sun as ee, Moon as re, Desktop as te, Monitor as se, GlobeHemisphereWest as ae } from "@phosphor-icons/react";
|
|
7
|
+
import { u as s, f as M, d as oe } from "./useAdapterControls-DVjkwRZ_.js";
|
|
8
|
+
import { u as le, a as ne, C as ie } from "./useWindowFocus-DGAWA1au.js";
|
|
9
|
+
const E = "elm_settings_win_size", D = 320, C = 320, $ = { w: 384, h: 560 };
|
|
10
|
+
function xe() {
|
|
11
|
+
const i = s((e) => e.settingsModalOpen), x = s((e) => e.setSettingsModalOpen), a = M((e) => e.geometryMode), p = M((e) => e.setGeometryMode), W = s((e) => e.setShowMeasurements), c = s((e) => e.showMeasurements), d = s((e) => e.showFeatureNameOnHover), H = s((e) => e.setShowFeatureNameOnHover), m = s((e) => e.topoEditEnabled), _ = s((e) => e.setTopoEditEnabled), h = s((e) => e.autoExitAfterDraw), z = s((e) => e.setAutoExitAfterDraw), u = s((e) => e.snapEnabled), T = s((e) => e.setSnapEnabled), v = s((e) => e.userTheme), I = s((e) => e.setUserTheme), A = oe(), { pos: y, onHandleMouseDown: O } = le("elm_settings_win", { x: 80, y: 80 }), g = V(), { zIndex: w, focus: j } = ne(i), b = G(null);
|
|
12
|
+
P(b, i, () => x(!1), w);
|
|
13
|
+
const [n, L] = X(() => {
|
|
14
|
+
try {
|
|
15
|
+
const e = q(E, g);
|
|
16
|
+
return e ? JSON.parse(e) : $;
|
|
17
|
+
} catch {
|
|
18
|
+
return $;
|
|
19
|
+
}
|
|
20
|
+
}), F = J((e, l) => {
|
|
21
|
+
Q(E, JSON.stringify({ w: e, h: l }), g);
|
|
22
|
+
}, [g]);
|
|
23
|
+
function R(e) {
|
|
24
|
+
e.preventDefault(), e.stopPropagation();
|
|
25
|
+
const l = e.clientX, f = e.clientY, U = n.w, B = n.h, Y = K("se-resize");
|
|
26
|
+
function k(o) {
|
|
27
|
+
L({
|
|
28
|
+
w: Math.max(D, Math.min(window.innerWidth * 0.9, U + o.clientX - l)),
|
|
29
|
+
h: Math.max(C, Math.min(window.innerHeight * 0.85, B + o.clientY - f))
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function N() {
|
|
33
|
+
Y(), document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", N);
|
|
34
|
+
const o = b.current;
|
|
35
|
+
o && F(o.offsetWidth, o.offsetHeight);
|
|
36
|
+
}
|
|
37
|
+
document.addEventListener("mousemove", k), document.addEventListener("mouseup", N);
|
|
38
|
+
}
|
|
39
|
+
return i ? /* @__PURE__ */ t(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref: b,
|
|
43
|
+
[Z]: "",
|
|
44
|
+
role: "dialog",
|
|
45
|
+
"aria-label": "Settings",
|
|
46
|
+
onMouseDownCapture: j,
|
|
47
|
+
className: "fixed flex flex-col bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm-raised rounded-elm-window overflow-hidden",
|
|
48
|
+
"data-elm-theme": A,
|
|
49
|
+
style: {
|
|
50
|
+
left: y.x,
|
|
51
|
+
top: y.y,
|
|
52
|
+
zIndex: w,
|
|
53
|
+
minWidth: D,
|
|
54
|
+
minHeight: C,
|
|
55
|
+
width: n.w,
|
|
56
|
+
height: n.h,
|
|
57
|
+
maxWidth: "90vw",
|
|
58
|
+
maxHeight: "85vh"
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
onMouseDown: O,
|
|
65
|
+
className: "flex items-center justify-between px-4 py-3 border-b border-elm-border flex-shrink-0 select-none",
|
|
66
|
+
style: { cursor: "grab" },
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-900)) dark:text-(--elm-text,var(--color-gray-100))", children: "Settings" }),
|
|
69
|
+
/* @__PURE__ */ r(ie, { onClick: () => x(!1), label: "Close settings" })
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto p-5 space-y-6 min-h-0", children: [
|
|
74
|
+
/* @__PURE__ */ t("div", { className: "space-y-2", children: [
|
|
75
|
+
/* @__PURE__ */ r("h3", { className: "text-sm font-medium text-elm-text-secondary", children: "Appearance" }),
|
|
76
|
+
/* @__PURE__ */ r("div", { className: "flex rounded-elm border border-elm-border overflow-hidden", children: [
|
|
77
|
+
{ value: "light", label: "Light", Icon: ee },
|
|
78
|
+
{ value: "dark", label: "Dark", Icon: re },
|
|
79
|
+
{ value: "system", label: "Auto", Icon: te }
|
|
80
|
+
].map(({ value: e, label: l, Icon: f }) => /* @__PURE__ */ t(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
onClick: () => I(e),
|
|
84
|
+
className: `flex-1 flex items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors ${v === e ? "bg-primary-500 hover:bg-primary-600 text-white" : "text-elm-text-muted hover:bg-elm-surface-hover hover:text-(--elm-text-secondary,var(--color-gray-700)) dark:hover:text-(--elm-text-secondary,var(--color-gray-200))"}`,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ r(f, { size: 14, weight: v === e ? "fill" : "regular" }),
|
|
87
|
+
l
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
e
|
|
91
|
+
)) })
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ t("div", { className: "space-y-3", children: [
|
|
94
|
+
/* @__PURE__ */ r("h3", { className: "text-sm font-medium text-elm-text-secondary", children: "Drawing mode" }),
|
|
95
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
96
|
+
/* @__PURE__ */ t(
|
|
97
|
+
"button",
|
|
98
|
+
{
|
|
99
|
+
onClick: () => p("visual"),
|
|
100
|
+
className: `p-3 text-center rounded-elm border text-sm transition-colors ${a === "visual" ? "border-primary-500 bg-primary-50 dark:bg-white/5 hover:bg-primary-100 dark:hover:bg-white/10 ring-1 ring-primary-500/20" : "border-(--elm-border,var(--color-gray-200)) dark:border-(--elm-border,var(--color-gray-600)) bg-elm-surface-raised hover:border-(--elm-border-strong,var(--color-gray-300)) dark:hover:border-(--elm-border-strong,var(--color-gray-500)) hover:bg-(--elm-surface-hover,var(--color-gray-50)) dark:hover:bg-(--elm-surface-hover,color-mix(in_oklab,var(--color-gray-700)_50%,transparent))"}`,
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ r(se, { size: 32, weight: a === "visual" ? "fill" : "regular", className: `mx-auto mb-2 ${a === "visual" ? "text-primary-600" : "text-elm-text-muted"}` }),
|
|
103
|
+
/* @__PURE__ */ r("span", { className: `block mb-1 font-semibold ${a === "visual" ? "text-primary-800 dark:text-primary-300" : "text-(--elm-text-secondary,var(--color-gray-700)) dark:text-(--elm-text-secondary,var(--color-gray-200))"}`, children: "Visual" }),
|
|
104
|
+
/* @__PURE__ */ r("p", { className: "text-xs leading-relaxed text-elm-text-muted", children: "Shapes keep their proportions on screen. Best for sketching and layouts." })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ t(
|
|
109
|
+
"button",
|
|
110
|
+
{
|
|
111
|
+
onClick: () => p("spatial"),
|
|
112
|
+
className: `p-3 text-center rounded-elm border text-sm transition-colors ${a === "spatial" ? "border-primary-500 bg-primary-50 dark:bg-white/5 hover:bg-primary-100 dark:hover:bg-white/10 ring-1 ring-primary-500/20" : "border-(--elm-border,var(--color-gray-200)) dark:border-(--elm-border,var(--color-gray-600)) bg-elm-surface-raised hover:border-(--elm-border-strong,var(--color-gray-300)) dark:hover:border-(--elm-border-strong,var(--color-gray-500)) hover:bg-(--elm-surface-hover,var(--color-gray-50)) dark:hover:bg-(--elm-surface-hover,color-mix(in_oklab,var(--color-gray-700)_50%,transparent))"}`,
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ r(ae, { size: 32, weight: a === "spatial" ? "fill" : "regular", className: `mx-auto mb-2 ${a === "spatial" ? "text-primary-600" : "text-elm-text-muted"}` }),
|
|
115
|
+
/* @__PURE__ */ r("span", { className: `block mb-1 font-semibold ${a === "spatial" ? "text-primary-800 dark:text-primary-300" : "text-(--elm-text-secondary,var(--color-gray-700)) dark:text-(--elm-text-secondary,var(--color-gray-200))"}`, children: "Spatial" }),
|
|
116
|
+
/* @__PURE__ */ r("p", { className: "text-xs leading-relaxed text-elm-text-muted", children: "Shapes keep their true size on the ground. Best for exact areas and distances." })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ r("div", { className: "pt-4 border-t border-elm-border-subtle", children: /* @__PURE__ */ t("label", { className: "flex items-center justify-between cursor-pointer group", children: [
|
|
123
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 pr-4", children: [
|
|
124
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-800)) dark:text-(--elm-text,var(--color-gray-100))", children: "Show measurements" }),
|
|
125
|
+
/* @__PURE__ */ r("span", { className: "text-xs text-elm-text-muted", children: "Display live dimensions and coordinates at the cursor while drawing shapes." })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ t("div", { className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-elm-focus-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-elm-surface ${c ? "bg-primary-500" : "bg-(--elm-border-strong,var(--color-gray-200)) dark:bg-(--elm-border-strong,var(--color-gray-600))"}`, children: [
|
|
128
|
+
/* @__PURE__ */ r("span", { className: `${c ? "translate-x-6" : "translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform` }),
|
|
129
|
+
/* @__PURE__ */ r(
|
|
130
|
+
"input",
|
|
131
|
+
{
|
|
132
|
+
type: "checkbox",
|
|
133
|
+
className: "sr-only",
|
|
134
|
+
checked: c,
|
|
135
|
+
onChange: (e) => W(e.target.checked)
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
] })
|
|
139
|
+
] }) }),
|
|
140
|
+
/* @__PURE__ */ r("div", { className: "pt-4 border-t border-elm-border-subtle", children: /* @__PURE__ */ t("label", { className: "flex items-center justify-between cursor-pointer group", children: [
|
|
141
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 pr-4", children: [
|
|
142
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-800)) dark:text-(--elm-text,var(--color-gray-100))", children: "Show name on hover" }),
|
|
143
|
+
/* @__PURE__ */ r("span", { className: "text-xs text-elm-text-muted", children: "Display the feature name when hovering over shapes on the map." })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ t("div", { className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-elm-focus-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-elm-surface ${d ? "bg-primary-500" : "bg-(--elm-border-strong,var(--color-gray-200)) dark:bg-(--elm-border-strong,var(--color-gray-600))"}`, children: [
|
|
146
|
+
/* @__PURE__ */ r("span", { className: `${d ? "translate-x-6" : "translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform` }),
|
|
147
|
+
/* @__PURE__ */ r(
|
|
148
|
+
"input",
|
|
149
|
+
{
|
|
150
|
+
type: "checkbox",
|
|
151
|
+
className: "sr-only",
|
|
152
|
+
checked: d,
|
|
153
|
+
onChange: (e) => H(e.target.checked)
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] })
|
|
157
|
+
] }) }),
|
|
158
|
+
/* @__PURE__ */ r("div", { className: "pt-4 border-t border-elm-border-subtle", children: /* @__PURE__ */ t("label", { className: "flex items-center justify-between cursor-pointer group", children: [
|
|
159
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 pr-4", children: [
|
|
160
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-800)) dark:text-(--elm-text,var(--color-gray-100))", children: "Topological editing" }),
|
|
161
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-elm-text-muted", children: [
|
|
162
|
+
"When editing points, shared borders between areas update together. Hold ",
|
|
163
|
+
S() ? "⌘ Cmd" : "Ctrl",
|
|
164
|
+
" to temporarily disable."
|
|
165
|
+
] })
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ t("div", { className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-elm-focus-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-elm-surface ${m ? "bg-primary-500" : "bg-(--elm-border-strong,var(--color-gray-200)) dark:bg-(--elm-border-strong,var(--color-gray-600))"}`, children: [
|
|
168
|
+
/* @__PURE__ */ r("span", { className: `${m ? "translate-x-6" : "translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform` }),
|
|
169
|
+
/* @__PURE__ */ r(
|
|
170
|
+
"input",
|
|
171
|
+
{
|
|
172
|
+
type: "checkbox",
|
|
173
|
+
className: "sr-only",
|
|
174
|
+
checked: m,
|
|
175
|
+
onChange: (e) => _(e.target.checked)
|
|
176
|
+
}
|
|
177
|
+
)
|
|
178
|
+
] })
|
|
179
|
+
] }) }),
|
|
180
|
+
/* @__PURE__ */ r("div", { className: "pt-4 border-t border-elm-border-subtle", children: /* @__PURE__ */ t("label", { className: "flex items-center justify-between cursor-pointer group", children: [
|
|
181
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 pr-4", children: [
|
|
182
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-800)) dark:text-(--elm-text,var(--color-gray-100))", children: "Snapping" }),
|
|
183
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-elm-text-muted", children: [
|
|
184
|
+
"Snap to nearby points and edges while drawing. Hold ",
|
|
185
|
+
S() ? "⌘ Cmd" : "Ctrl",
|
|
186
|
+
" to temporarily disable."
|
|
187
|
+
] })
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ t("div", { className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-elm-focus-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-elm-surface ${u ? "bg-primary-500" : "bg-(--elm-border-strong,var(--color-gray-200)) dark:bg-(--elm-border-strong,var(--color-gray-600))"}`, children: [
|
|
190
|
+
/* @__PURE__ */ r("span", { className: `${u ? "translate-x-6" : "translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform` }),
|
|
191
|
+
/* @__PURE__ */ r(
|
|
192
|
+
"input",
|
|
193
|
+
{
|
|
194
|
+
type: "checkbox",
|
|
195
|
+
className: "sr-only",
|
|
196
|
+
checked: u,
|
|
197
|
+
onChange: (e) => T(e.target.checked)
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] })
|
|
201
|
+
] }) }),
|
|
202
|
+
/* @__PURE__ */ r("div", { className: "pt-4 border-t border-elm-border-subtle", children: /* @__PURE__ */ t("label", { className: "flex items-center justify-between cursor-pointer group", children: [
|
|
203
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col gap-0.5 pr-4", children: [
|
|
204
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-800)) dark:text-(--elm-text,var(--color-gray-100))", children: "Return to select after each shape" }),
|
|
205
|
+
/* @__PURE__ */ r("span", { className: "text-xs text-elm-text-muted", children: "Drawing tools deactivate after every shape, so you go back to selection. Turn off to keep the tool active and draw multiple shapes in a row." })
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ t("div", { className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-elm-focus-ring has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-elm-surface ${h ? "bg-primary-500" : "bg-(--elm-border-strong,var(--color-gray-200)) dark:bg-(--elm-border-strong,var(--color-gray-600))"}`, children: [
|
|
208
|
+
/* @__PURE__ */ r("span", { className: `${h ? "translate-x-6" : "translate-x-1"} inline-block h-4 w-4 transform rounded-full bg-white transition-transform` }),
|
|
209
|
+
/* @__PURE__ */ r(
|
|
210
|
+
"input",
|
|
211
|
+
{
|
|
212
|
+
type: "checkbox",
|
|
213
|
+
className: "sr-only",
|
|
214
|
+
checked: h,
|
|
215
|
+
onChange: (e) => z(e.target.checked)
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
] })
|
|
219
|
+
] }) })
|
|
220
|
+
] }),
|
|
221
|
+
/* @__PURE__ */ r(
|
|
222
|
+
"div",
|
|
223
|
+
{
|
|
224
|
+
onMouseDown: R,
|
|
225
|
+
className: "absolute bottom-0 right-0 w-4 h-4 cursor-se-resize select-none",
|
|
226
|
+
style: { zIndex: 10 },
|
|
227
|
+
"aria-hidden": !0,
|
|
228
|
+
children: /* @__PURE__ */ r("svg", { width: "10", height: "10", viewBox: "0 0 10 10", className: "absolute bottom-1 right-1 text-elm-text-disabled", children: /* @__PURE__ */ r("path", { d: "M9 1L1 9M9 5L5 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
) : null;
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
xe as default
|
|
237
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("react"),v=require("./index-BKdDZ4Y9.cjs"),$=require("@phosphor-icons/react"),S=require("./useAdapterControls-BBObhzVX.cjs"),J=require("./useAccentStyle-hsGvyHZc.cjs"),b=require("@element-editor/core"),m=require("@element-editor/core/internal"),de=require("./EditToolbarBtn-dpCmKnzk.cjs"),D=require("./useWindowFocus-D-_yEm_V.cjs"),ue={"place-point":"point","draw-line":"line","draw-polygon":"polygon","draw-route":"route","draw-circle":"circle","draw-rect":"rectangle","draw-freehand":"freehand",picker:"picker"};function me({current:n,onCapture:s,onCancel:i}){const a=d.useRef(null);return d.useEffect(()=>{var r,l;(r=a.current)==null||r.focus(),(l=a.current)==null||l.select()},[]),t.jsx("input",{ref:a,readOnly:!0,value:n.toUpperCase(),size:1,onFocus:r=>r.currentTarget.select(),onKeyDown:r=>{if(r.preventDefault(),r.stopPropagation(),r.key==="Escape"){i();return}r.key.length===1&&!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key!==" "&&s(r.key.toLowerCase())},onBlur:i,"aria-label":"Press a key to rebind",className:"inline-block w-6 h-5 text-[11px] font-medium font-elm rounded-elm-chip border border-primary-400 bg-primary-50 text-primary-700 text-center p-0 outline-none caret-transparent selection:bg-primary-500 selection:text-white"})}function he(){const n=S.useUIStore(e=>e.shortcutsModalOpen),s=S.useUIStore(e=>e.closeShortcutsModal),i=S.useUIStore(e=>e.readonly),a=S.useUIStore(e=>e.unavailableTools),{tools:r,ui:l,toolbar:j}=J.useElementEditorConfig(),k=j.direction==="vertical",x=r==="all"?null:new Set(r);function p(e){if(e==="toggle-table")return l.dataTable;if(e==="toggle-geojson")return l.geojsonEditor;if(e==="toggle-schema")return l.schemaEditor;if(e==="toggle-sidebar")return l.layerList;if(e==="set-zoom")return l.zoomIndicator;const o=ue[e];return o&&a.includes(o)?!1:o&&x?x.has(o):!0}const{custom:g,getKey:G,setKey:Q,resetKey:ee,resetAll:te}=v.useShortcutConfig(),[E,T]=d.useState(null),[c,u]=d.useState(null),{pos:L,onHandleMouseDown:re}=D.useDragWindow("elm_shortcuts_win",{x:24,y:120}),N=J.useElementEditorConfig(),{zIndex:z,focus:oe}=D.useWindowFocus(n),H="elm_shortcuts_win_size",K=250,F=260,M=d.useRef(null);v.useWindowEscape(M,n,s,z);const[y,ne]=d.useState(()=>{try{const e=b.readStorage(H,N);return e?JSON.parse(e):{w:440,h:560}}catch{return{w:440,h:560}}}),se=d.useCallback((e,o)=>{b.writeStorage(H,JSON.stringify({w:e,h:o}),N)},[N]);function le(e){e.preventDefault(),e.stopPropagation();const o=e.clientX,f=e.clientY,w=y.w,O=y.h,R=v.startDragShield("se-resize");function V(h){ne({w:Math.max(K,Math.min(window.innerWidth*.9,w+h.clientX-o)),h:Math.max(F,Math.min(window.innerHeight*.85,O+h.clientY-f))})}function Y(){R(),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",Y);const h=M.current;h&&se(h.offsetWidth,h.offsetHeight)}document.addEventListener("mousemove",V),document.addEventListener("mouseup",Y)}if(d.useEffect(()=>{if(!n||E===null)return;function e(o){o.key==="Escape"&&(W(),o.stopPropagation())}return window.addEventListener("keydown",e,{capture:!0}),()=>window.removeEventListener("keydown",e,{capture:!0})},[n,E]),!n)return null;function ie(e,o){var w;const f=Q(e,o);if(f){const O=((w=m.CUSTOMIZABLE_SHORTCUTS.find(R=>R.id===f))==null?void 0:w.label)??f;u({id:e,msg:`"${o.toUpperCase()}" is already used by "${O}"`,attemptedKey:o});return}u(null),T(null)}function W(){T(null),u(null)}function ae(e){T(e),u(null)}function _(e){return{label:e.label,isChanged:g[e.id]!==void 0,isCapturing:E===e.id,keyDisplay:G(e.id),onStartCapture:()=>ae(e.id),onCapture:o=>ie(e.id,o),onCancelCapture:W,onReset:()=>{ee(e.id),u(null)},conflictMsg:(c==null?void 0:c.id)===e.id?c.msg:void 0,onDismissConflict:()=>u(null),captureDisplay:(c==null?void 0:c.id)===e.id?c.attemptedKey:void 0}}const A=m.CUSTOMIZABLE_SHORTCUTS.filter(e=>e.category==="drawing"&&!i&&p(e.id)),q=m.CUSTOMIZABLE_SHORTCUTS.filter(e=>e.category==="view"&&p(e.id)),B=m.CUSTOMIZABLE_SHORTCUTS.filter(e=>e.category==="editing"&&!i&&p(e.id)),P=m.FIXED_SHORTCUTS.filter(e=>e.category==="view"&&!(k&&e.label==="Search places")),X=i?[]:m.FIXED_SHORTCUTS.filter(e=>e.category==="editing"),Z=i?[]:m.FIXED_SHORTCUTS.filter(e=>e.category==="drawing"),ce=Object.keys(g).length>0;return t.jsxs("div",{ref:M,[v.WINDOW_ATTR]:"",role:"dialog","aria-label":"Keyboard shortcuts",onMouseDownCapture:oe,className:"fixed flex flex-col bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm-raised rounded-elm-window overflow-hidden",style:{left:L.x,top:L.y,zIndex:z,minWidth:K,minHeight:F,width:y.w,height:y.h,maxWidth:"90vw",maxHeight:"85vh"},children:[t.jsxs("div",{onMouseDown:re,className:"flex items-center justify-between px-4 py-3 border-b border-elm-border flex-shrink-0 select-none",style:{cursor:"grab"},children:[t.jsx("span",{className:"text-sm font-semibold text-(--elm-text,var(--color-gray-900)) dark:text-(--elm-text,var(--color-gray-100))",children:"Keyboard shortcuts"}),t.jsx(D.CloseButton,{onClick:s,label:"Close keyboard shortcuts"})]}),t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pt-3 pb-2 space-y-4 min-h-0",children:[A.length>0&&t.jsx(C,{title:"Drawing tools",children:A.map(e=>t.jsx(U,{..._(e)},e.id))}),(q.length>0||P.length>0)&&t.jsxs(C,{title:"View",children:[q.map(e=>t.jsx(U,{..._(e)},e.id)),P.map(e=>t.jsx(I,{label:e.label,display:b.getFixedShortcutFullDisplay(e.id)},e.id))]}),(B.length>0||X.length>0)&&t.jsxs(C,{title:"Editing",children:[B.map(e=>t.jsx(U,{..._(e)},e.id)),X.map(e=>t.jsx(I,{label:e.label,display:b.getFixedShortcutFullDisplay(e.id)},e.id))]}),Z.length>0&&t.jsx(C,{title:"While drawing",children:Z.map(e=>t.jsx(I,{label:e.label,display:b.getFixedShortcutFullDisplay(e.id)},e.id))})]}),t.jsxs("div",{className:"flex-shrink-0 border-t border-elm-border-subtle px-6 py-2.5 flex items-center justify-between gap-3",children:[t.jsx("p",{className:"text-xs text-elm-text-subtle flex-1",children:"Click a key badge to rebind it"}),ce&&t.jsxs("button",{onClick:()=>{te(),u(null)},className:"flex items-center gap-1 text-xs text-elm-text-subtle hover:text-(--elm-text-secondary,var(--color-gray-700)) dark:hover:text-(--elm-text-secondary,var(--color-gray-300)) hover:bg-elm-surface-hover rounded-elm-chip px-1.5 py-0.5 -mr-1.5 transition-colors flex-shrink-0",children:[t.jsx($.ArrowCounterClockwise,{size:11}),"Reset all"]})]}),t.jsx("div",{onMouseDown:le,className:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize select-none",style:{zIndex:10},"aria-hidden":!0,children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",className:"absolute bottom-1 right-1 text-elm-text-disabled",children:t.jsx("path",{d:"M9 1L1 9M9 5L5 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}function C({title:n,children:s}){return t.jsxs("section",{children:[t.jsx("h3",{className:"text-[10px] font-semibold text-elm-text-subtle uppercase tracking-wider mb-1.5 px-2",children:n}),t.jsx("div",{className:"space-y-0.5",children:s})]})}function U({label:n,isChanged:s,isCapturing:i,keyDisplay:a,onStartCapture:r,onCapture:l,onCancelCapture:j,onReset:k,conflictMsg:x,onDismissConflict:p,captureDisplay:g}){return t.jsxs("div",{className:"flex items-center justify-between py-1 px-2 rounded-elm-card hover:bg-(--elm-surface-hover,var(--color-gray-50)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-800)) group",children:[t.jsx("span",{className:"text-sm text-elm-text-secondary",children:n}),t.jsxs("div",{className:"flex items-center gap-1.5 relative",children:[x&&t.jsxs("button",{type:"button",onClick:p,className:"absolute right-full mr-2 top-1/2 -translate-y-1/2 whitespace-nowrap bg-rose-500/95 text-white text-xs px-2.5 py-1.5 rounded-elm-card shadow-elm backdrop-blur-sm hover:bg-rose-600/95 transition-colors","aria-label":"Dismiss conflict message",children:[x,t.jsx("span",{"aria-hidden":!0,className:"absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-rose-500/95"})]}),s&&t.jsx("button",{onClick:k,className:"p-0.5 rounded-elm-chip text-elm-text hover:bg-(--elm-surface-hover,var(--color-gray-200)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700)) transition-colors","aria-label":"Reset to default",title:"Reset to default",children:t.jsx($.ArrowCounterClockwise,{size:14,weight:"bold"})}),i?t.jsx(me,{current:g??a,onCapture:l,onCancel:j},g??a):t.jsx("button",{onClick:r,title:"Click to rebind",className:"inline-flex items-center justify-center min-w-[1.5rem] h-5 px-1.5 text-[11px] font-medium font-elm rounded-elm-chip transition-colors border border-elm-border-strong bg-(--elm-surface-hover,var(--color-gray-100)) dark:bg-(--elm-surface-hover,var(--color-gray-700)) text-elm-text-muted shadow-[0_1px_0_0_rgba(0,0,0,0.15)] hover:bg-(--elm-control-hover,var(--color-gray-200)) dark:hover:bg-(--elm-control-hover,var(--color-gray-600)) hover:border-(--elm-border-strong,var(--color-gray-400)) dark:hover:border-(--elm-border-strong,var(--color-gray-500))",children:a.toUpperCase()})]})]})}function I({label:n,display:s}){return t.jsxs("div",{className:"flex items-center justify-between py-1 px-2 rounded-elm-card",children:[t.jsx("span",{className:"text-sm text-elm-text-secondary",children:n}),t.jsx(de.Kbd,{children:s})]})}exports.ShortcutsModal=he;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useRef as q, useCallback as me, useEffect as G } from "react";
|
|
3
|
+
import { b as he, u as pe, W as fe, s as ge } from "./index-CtZterPc.js";
|
|
4
|
+
import { ArrowCounterClockwise as Q } from "@phosphor-icons/react";
|
|
5
|
+
import { u as y } from "./useAdapterControls-DVjkwRZ_.js";
|
|
6
|
+
import { u as $ } from "./useAccentStyle-CPo2XqAn.js";
|
|
7
|
+
import { readStorage as be, writeStorage as xe, getFixedShortcutFullDisplay as T } from "@element-editor/core";
|
|
8
|
+
import { CUSTOMIZABLE_SHORTCUTS as w, FIXED_SHORTCUTS as W } from "@element-editor/core/internal";
|
|
9
|
+
import { K as ye } from "./EditToolbarBtn-SZIsnIn3.js";
|
|
10
|
+
import { u as we, a as ve, C as Ce } from "./useWindowFocus-DGAWA1au.js";
|
|
11
|
+
const ke = {
|
|
12
|
+
"place-point": "point",
|
|
13
|
+
"draw-line": "line",
|
|
14
|
+
"draw-polygon": "polygon",
|
|
15
|
+
"draw-route": "route",
|
|
16
|
+
"draw-circle": "circle",
|
|
17
|
+
"draw-rect": "rectangle",
|
|
18
|
+
"draw-freehand": "freehand",
|
|
19
|
+
picker: "picker"
|
|
20
|
+
};
|
|
21
|
+
function Se({
|
|
22
|
+
current: n,
|
|
23
|
+
onCapture: a,
|
|
24
|
+
onCancel: s
|
|
25
|
+
}) {
|
|
26
|
+
const c = q(null);
|
|
27
|
+
return G(() => {
|
|
28
|
+
var r, i;
|
|
29
|
+
(r = c.current) == null || r.focus(), (i = c.current) == null || i.select();
|
|
30
|
+
}, []), /* @__PURE__ */ t(
|
|
31
|
+
"input",
|
|
32
|
+
{
|
|
33
|
+
ref: c,
|
|
34
|
+
readOnly: !0,
|
|
35
|
+
value: n.toUpperCase(),
|
|
36
|
+
size: 1,
|
|
37
|
+
onFocus: (r) => r.currentTarget.select(),
|
|
38
|
+
onKeyDown: (r) => {
|
|
39
|
+
if (r.preventDefault(), r.stopPropagation(), r.key === "Escape") {
|
|
40
|
+
s();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
r.key.length === 1 && !r.metaKey && !r.ctrlKey && !r.altKey && r.key !== " " && a(r.key.toLowerCase());
|
|
44
|
+
},
|
|
45
|
+
onBlur: s,
|
|
46
|
+
"aria-label": "Press a key to rebind",
|
|
47
|
+
className: "inline-block w-6 h-5 text-[11px] font-medium font-elm rounded-elm-chip border border-primary-400 bg-primary-50 text-primary-700 text-center p-0 outline-none caret-transparent selection:bg-primary-500 selection:text-white"
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function Re() {
|
|
52
|
+
const n = y((e) => e.shortcutsModalOpen), a = y((e) => e.closeShortcutsModal), s = y((e) => e.readonly), c = y((e) => e.unavailableTools), { tools: r, ui: i, toolbar: C } = $(), k = C.direction === "vertical", h = r === "all" ? null : new Set(r);
|
|
53
|
+
function p(e) {
|
|
54
|
+
if (e === "toggle-table") return i.dataTable;
|
|
55
|
+
if (e === "toggle-geojson") return i.geojsonEditor;
|
|
56
|
+
if (e === "toggle-schema") return i.schemaEditor;
|
|
57
|
+
if (e === "toggle-sidebar") return i.layerList;
|
|
58
|
+
if (e === "set-zoom") return i.zoomIndicator;
|
|
59
|
+
const o = ke[e];
|
|
60
|
+
return o && c.includes(o) ? !1 : o && h ? h.has(o) : !0;
|
|
61
|
+
}
|
|
62
|
+
const { custom: f, getKey: ee, setKey: te, resetKey: re, resetAll: oe } = he(), [S, N] = z(null), [d, u] = z(null), { pos: O, onHandleMouseDown: ne } = we("elm_shortcuts_win", { x: 24, y: 120 }), E = $(), { zIndex: I, focus: le } = ve(n), j = "elm_shortcuts_win_size", H = 250, U = 260, M = q(null);
|
|
63
|
+
pe(M, n, a, I);
|
|
64
|
+
const [b, ae] = z(() => {
|
|
65
|
+
try {
|
|
66
|
+
const e = be(j, E);
|
|
67
|
+
return e ? JSON.parse(e) : { w: 440, h: 560 };
|
|
68
|
+
} catch {
|
|
69
|
+
return { w: 440, h: 560 };
|
|
70
|
+
}
|
|
71
|
+
}), ie = me((e, o) => {
|
|
72
|
+
xe(j, JSON.stringify({ w: e, h: o }), E);
|
|
73
|
+
}, [E]);
|
|
74
|
+
function se(e) {
|
|
75
|
+
e.preventDefault(), e.stopPropagation();
|
|
76
|
+
const o = e.clientX, g = e.clientY, x = b.w, D = b.h, K = ge("se-resize");
|
|
77
|
+
function J(m) {
|
|
78
|
+
ae({
|
|
79
|
+
w: Math.max(H, Math.min(window.innerWidth * 0.9, x + m.clientX - o)),
|
|
80
|
+
h: Math.max(U, Math.min(window.innerHeight * 0.85, D + m.clientY - g))
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function Z() {
|
|
84
|
+
K(), document.removeEventListener("mousemove", J), document.removeEventListener("mouseup", Z);
|
|
85
|
+
const m = M.current;
|
|
86
|
+
m && ie(m.offsetWidth, m.offsetHeight);
|
|
87
|
+
}
|
|
88
|
+
document.addEventListener("mousemove", J), document.addEventListener("mouseup", Z);
|
|
89
|
+
}
|
|
90
|
+
if (G(() => {
|
|
91
|
+
if (!n || S === null) return;
|
|
92
|
+
function e(o) {
|
|
93
|
+
o.key === "Escape" && (F(), o.stopPropagation());
|
|
94
|
+
}
|
|
95
|
+
return window.addEventListener("keydown", e, { capture: !0 }), () => window.removeEventListener("keydown", e, { capture: !0 });
|
|
96
|
+
}, [n, S]), !n) return null;
|
|
97
|
+
function ce(e, o) {
|
|
98
|
+
var x;
|
|
99
|
+
const g = te(e, o);
|
|
100
|
+
if (g) {
|
|
101
|
+
const D = ((x = w.find((K) => K.id === g)) == null ? void 0 : x.label) ?? g;
|
|
102
|
+
u({ id: e, msg: `"${o.toUpperCase()}" is already used by "${D}"`, attemptedKey: o });
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
u(null), N(null);
|
|
106
|
+
}
|
|
107
|
+
function F() {
|
|
108
|
+
N(null), u(null);
|
|
109
|
+
}
|
|
110
|
+
function de(e) {
|
|
111
|
+
N(e), u(null);
|
|
112
|
+
}
|
|
113
|
+
function _(e) {
|
|
114
|
+
return {
|
|
115
|
+
label: e.label,
|
|
116
|
+
isChanged: f[e.id] !== void 0,
|
|
117
|
+
isCapturing: S === e.id,
|
|
118
|
+
keyDisplay: ee(e.id),
|
|
119
|
+
onStartCapture: () => de(e.id),
|
|
120
|
+
onCapture: (o) => ce(e.id, o),
|
|
121
|
+
onCancelCapture: F,
|
|
122
|
+
onReset: () => {
|
|
123
|
+
re(e.id), u(null);
|
|
124
|
+
},
|
|
125
|
+
conflictMsg: (d == null ? void 0 : d.id) === e.id ? d.msg : void 0,
|
|
126
|
+
onDismissConflict: () => u(null),
|
|
127
|
+
captureDisplay: (d == null ? void 0 : d.id) === e.id ? d.attemptedKey : void 0
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const P = w.filter((e) => e.category === "drawing" && !s && p(e.id)), A = w.filter((e) => e.category === "view" && p(e.id)), B = w.filter((e) => e.category === "editing" && !s && p(e.id)), V = W.filter((e) => e.category === "view" && !(k && e.label === "Search places")), X = s ? [] : W.filter((e) => e.category === "editing"), Y = s ? [] : W.filter((e) => e.category === "drawing"), ue = Object.keys(f).length > 0;
|
|
131
|
+
return /* @__PURE__ */ l(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
ref: M,
|
|
135
|
+
[fe]: "",
|
|
136
|
+
role: "dialog",
|
|
137
|
+
"aria-label": "Keyboard shortcuts",
|
|
138
|
+
onMouseDownCapture: le,
|
|
139
|
+
className: "fixed flex flex-col bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm-raised rounded-elm-window overflow-hidden",
|
|
140
|
+
style: {
|
|
141
|
+
left: O.x,
|
|
142
|
+
top: O.y,
|
|
143
|
+
zIndex: I,
|
|
144
|
+
minWidth: H,
|
|
145
|
+
minHeight: U,
|
|
146
|
+
width: b.w,
|
|
147
|
+
height: b.h,
|
|
148
|
+
maxWidth: "90vw",
|
|
149
|
+
maxHeight: "85vh"
|
|
150
|
+
},
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ l(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
onMouseDown: ne,
|
|
156
|
+
className: "flex items-center justify-between px-4 py-3 border-b border-elm-border flex-shrink-0 select-none",
|
|
157
|
+
style: { cursor: "grab" },
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-semibold text-(--elm-text,var(--color-gray-900)) dark:text-(--elm-text,var(--color-gray-100))", children: "Keyboard shortcuts" }),
|
|
160
|
+
/* @__PURE__ */ t(Ce, { onClick: a, label: "Close keyboard shortcuts" })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto px-4 pt-3 pb-2 space-y-4 min-h-0", children: [
|
|
165
|
+
P.length > 0 && /* @__PURE__ */ t(v, { title: "Drawing tools", children: P.map((e) => /* @__PURE__ */ t(L, { ..._(e) }, e.id)) }),
|
|
166
|
+
(A.length > 0 || V.length > 0) && /* @__PURE__ */ l(v, { title: "View", children: [
|
|
167
|
+
A.map((e) => /* @__PURE__ */ t(L, { ..._(e) }, e.id)),
|
|
168
|
+
V.map((e) => /* @__PURE__ */ t(R, { label: e.label, display: T(e.id) }, e.id))
|
|
169
|
+
] }),
|
|
170
|
+
(B.length > 0 || X.length > 0) && /* @__PURE__ */ l(v, { title: "Editing", children: [
|
|
171
|
+
B.map((e) => /* @__PURE__ */ t(L, { ..._(e) }, e.id)),
|
|
172
|
+
X.map((e) => /* @__PURE__ */ t(R, { label: e.label, display: T(e.id) }, e.id))
|
|
173
|
+
] }),
|
|
174
|
+
Y.length > 0 && /* @__PURE__ */ t(v, { title: "While drawing", children: Y.map((e) => /* @__PURE__ */ t(R, { label: e.label, display: T(e.id) }, e.id)) })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ l("div", { className: "flex-shrink-0 border-t border-elm-border-subtle px-6 py-2.5 flex items-center justify-between gap-3", children: [
|
|
177
|
+
/* @__PURE__ */ t("p", { className: "text-xs text-elm-text-subtle flex-1", children: "Click a key badge to rebind it" }),
|
|
178
|
+
ue && /* @__PURE__ */ l(
|
|
179
|
+
"button",
|
|
180
|
+
{
|
|
181
|
+
onClick: () => {
|
|
182
|
+
oe(), u(null);
|
|
183
|
+
},
|
|
184
|
+
className: "flex items-center gap-1 text-xs text-elm-text-subtle hover:text-(--elm-text-secondary,var(--color-gray-700)) dark:hover:text-(--elm-text-secondary,var(--color-gray-300)) hover:bg-elm-surface-hover rounded-elm-chip px-1.5 py-0.5 -mr-1.5 transition-colors flex-shrink-0",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ t(Q, { size: 11 }),
|
|
187
|
+
"Reset all"
|
|
188
|
+
]
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ t(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
onMouseDown: se,
|
|
196
|
+
className: "absolute bottom-0 right-0 w-4 h-4 cursor-se-resize select-none",
|
|
197
|
+
style: { zIndex: 10 },
|
|
198
|
+
"aria-hidden": !0,
|
|
199
|
+
children: /* @__PURE__ */ t("svg", { width: "10", height: "10", viewBox: "0 0 10 10", className: "absolute bottom-1 right-1 text-elm-text-disabled", children: /* @__PURE__ */ t("path", { d: "M9 1L1 9M9 5L5 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
function v({ title: n, children: a }) {
|
|
207
|
+
return /* @__PURE__ */ l("section", { children: [
|
|
208
|
+
/* @__PURE__ */ t("h3", { className: "text-[10px] font-semibold text-elm-text-subtle uppercase tracking-wider mb-1.5 px-2", children: n }),
|
|
209
|
+
/* @__PURE__ */ t("div", { className: "space-y-0.5", children: a })
|
|
210
|
+
] });
|
|
211
|
+
}
|
|
212
|
+
function L({
|
|
213
|
+
label: n,
|
|
214
|
+
isChanged: a,
|
|
215
|
+
isCapturing: s,
|
|
216
|
+
keyDisplay: c,
|
|
217
|
+
onStartCapture: r,
|
|
218
|
+
onCapture: i,
|
|
219
|
+
onCancelCapture: C,
|
|
220
|
+
onReset: k,
|
|
221
|
+
conflictMsg: h,
|
|
222
|
+
onDismissConflict: p,
|
|
223
|
+
captureDisplay: f
|
|
224
|
+
}) {
|
|
225
|
+
return /* @__PURE__ */ l("div", { className: "flex items-center justify-between py-1 px-2 rounded-elm-card hover:bg-(--elm-surface-hover,var(--color-gray-50)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-800)) group", children: [
|
|
226
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-elm-text-secondary", children: n }),
|
|
227
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5 relative", children: [
|
|
228
|
+
h && // Inline conflict popover — mirrors the project Tooltip's shape
|
|
229
|
+
// (px-2.5 py-1.5, rounded-lg, shadow-xl, backdrop-blur, 4px arrow)
|
|
230
|
+
// but in rose so it reads as an error. Click to dismiss.
|
|
231
|
+
/* @__PURE__ */ l(
|
|
232
|
+
"button",
|
|
233
|
+
{
|
|
234
|
+
type: "button",
|
|
235
|
+
onClick: p,
|
|
236
|
+
className: "absolute right-full mr-2 top-1/2 -translate-y-1/2 whitespace-nowrap bg-rose-500/95 text-white text-xs px-2.5 py-1.5 rounded-elm-card shadow-elm backdrop-blur-sm hover:bg-rose-600/95 transition-colors",
|
|
237
|
+
"aria-label": "Dismiss conflict message",
|
|
238
|
+
children: [
|
|
239
|
+
h,
|
|
240
|
+
/* @__PURE__ */ t(
|
|
241
|
+
"span",
|
|
242
|
+
{
|
|
243
|
+
"aria-hidden": !0,
|
|
244
|
+
className: "absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-rose-500/95"
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
a && // Always visible when the binding has been customized — used to live
|
|
251
|
+
// behind a hover gate, which made it discoverable only after pointing
|
|
252
|
+
// at the row. The customized state is now communicated by the
|
|
253
|
+
// presence of this icon alone (the key badge keeps its default
|
|
254
|
+
// styling) so the reset affordance can't be missed.
|
|
255
|
+
/* @__PURE__ */ t(
|
|
256
|
+
"button",
|
|
257
|
+
{
|
|
258
|
+
onClick: k,
|
|
259
|
+
className: "p-0.5 rounded-elm-chip text-elm-text hover:bg-(--elm-surface-hover,var(--color-gray-200)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700)) transition-colors",
|
|
260
|
+
"aria-label": "Reset to default",
|
|
261
|
+
title: "Reset to default",
|
|
262
|
+
children: /* @__PURE__ */ t(Q, { size: 14, weight: "bold" })
|
|
263
|
+
}
|
|
264
|
+
),
|
|
265
|
+
s ? (
|
|
266
|
+
// `key` forces a remount (fresh focus+select useEffect) whenever
|
|
267
|
+
// the displayed value flips between the stored key and a failed
|
|
268
|
+
// attempt — without it the selection wouldn't re-happen after a
|
|
269
|
+
// conflict and the user would see an unselected caret.
|
|
270
|
+
/* @__PURE__ */ t(
|
|
271
|
+
Se,
|
|
272
|
+
{
|
|
273
|
+
current: f ?? c,
|
|
274
|
+
onCapture: i,
|
|
275
|
+
onCancel: C
|
|
276
|
+
},
|
|
277
|
+
f ?? c
|
|
278
|
+
)
|
|
279
|
+
) : /* @__PURE__ */ t(
|
|
280
|
+
"button",
|
|
281
|
+
{
|
|
282
|
+
onClick: r,
|
|
283
|
+
title: "Click to rebind",
|
|
284
|
+
className: "inline-flex items-center justify-center min-w-[1.5rem] h-5 px-1.5 text-[11px] font-medium font-elm rounded-elm-chip transition-colors border border-elm-border-strong bg-(--elm-surface-hover,var(--color-gray-100)) dark:bg-(--elm-surface-hover,var(--color-gray-700)) text-elm-text-muted shadow-[0_1px_0_0_rgba(0,0,0,0.15)] hover:bg-(--elm-control-hover,var(--color-gray-200)) dark:hover:bg-(--elm-control-hover,var(--color-gray-600)) hover:border-(--elm-border-strong,var(--color-gray-400)) dark:hover:border-(--elm-border-strong,var(--color-gray-500))",
|
|
285
|
+
children: c.toUpperCase()
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
] })
|
|
289
|
+
] });
|
|
290
|
+
}
|
|
291
|
+
function R({ label: n, display: a }) {
|
|
292
|
+
return /* @__PURE__ */ l("div", { className: "flex items-center justify-between py-1 px-2 rounded-elm-card", children: [
|
|
293
|
+
/* @__PURE__ */ t("span", { className: "text-sm text-elm-text-secondary", children: n }),
|
|
294
|
+
/* @__PURE__ */ t(ye, { children: a })
|
|
295
|
+
] });
|
|
296
|
+
}
|
|
297
|
+
export {
|
|
298
|
+
Re as ShortcutsModal
|
|
299
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ActiveDrawingToolbar(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ActiveDrawingToolbar(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IconButtonSize } from './ui/IconButton.cjs';
|
|
2
|
+
import { TooltipSide } from './ui/Tooltip.cjs';
|
|
3
|
+
export interface BasemapPickerOption {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Image URL, or two (shown side by side, e.g. light + dark for a theme-following option). */
|
|
7
|
+
thumbnail?: string | [string, string];
|
|
8
|
+
}
|
|
9
|
+
export interface BasemapPickerProps {
|
|
10
|
+
options: BasemapPickerOption[];
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (id: string) => void;
|
|
13
|
+
/** Button label and the panel's accessible name. Default: 'Basemap'. */
|
|
14
|
+
label?: string;
|
|
15
|
+
size?: IconButtonSize;
|
|
16
|
+
tooltipSide?: TooltipSide;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Basemap switcher: an icon button that opens a panel of thumbnail tiles.
|
|
20
|
+
* Engine-neutral: it applies nothing, the host reacts to `onChange`.
|
|
21
|
+
* The panel opens away from the screen edge the button sits on and stays open until the user
|
|
22
|
+
* closes it (the button again, or Escape); picking a basemap or using the map keeps it open.
|
|
23
|
+
* Opening focuses the active tile (the panel is portalled to the end of <body>); Escape
|
|
24
|
+
* returns focus to the button.
|
|
25
|
+
*/
|
|
26
|
+
export declare function BasemapPicker({ options, value, onChange, label, size, tooltipSide }: BasemapPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IconButtonSize } from './ui/IconButton.js';
|
|
2
|
+
import { TooltipSide } from './ui/Tooltip.js';
|
|
3
|
+
export interface BasemapPickerOption {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Image URL, or two (shown side by side, e.g. light + dark for a theme-following option). */
|
|
7
|
+
thumbnail?: string | [string, string];
|
|
8
|
+
}
|
|
9
|
+
export interface BasemapPickerProps {
|
|
10
|
+
options: BasemapPickerOption[];
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (id: string) => void;
|
|
13
|
+
/** Button label and the panel's accessible name. Default: 'Basemap'. */
|
|
14
|
+
label?: string;
|
|
15
|
+
size?: IconButtonSize;
|
|
16
|
+
tooltipSide?: TooltipSide;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Basemap switcher: an icon button that opens a panel of thumbnail tiles.
|
|
20
|
+
* Engine-neutral: it applies nothing, the host reacts to `onChange`.
|
|
21
|
+
* The panel opens away from the screen edge the button sits on and stays open until the user
|
|
22
|
+
* closes it (the button again, or Escape); picking a basemap or using the map keeps it open.
|
|
23
|
+
* Opening focuses the active tile (the panel is portalled to the end of <body>); Escape
|
|
24
|
+
* returns focus to the button.
|
|
25
|
+
*/
|
|
26
|
+
export declare function BasemapPicker({ options, value, onChange, label, size, tooltipSide }: BasemapPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BooleanOperations(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BooleanOperations(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BufferPanel(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function BufferPanel(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
schemaFilter: string;
|
|
3
|
+
focusRowId?: string | null;
|
|
4
|
+
onFocusRowHandled?: () => void;
|
|
5
|
+
selectedRows: ReadonlySet<string>;
|
|
6
|
+
onSelectedRowsChange: (ids: ReadonlySet<string>) => void;
|
|
7
|
+
}
|
|
8
|
+
export default function DataTable({ schemaFilter, focusRowId, onFocusRowHandled, selectedRows, onSelectedRowsChange }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|