@octostar/map-component 0.1.31 → 0.1.33
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/README.md +13 -0
- package/dist/index.cjs +48 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +48 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/map-editor-canvas.d.ts.map +1 -1
- package/dist/types/components/properties-panel.d.ts +21 -1
- package/dist/types/components/properties-panel.d.ts.map +1 -1
- package/dist/types/lib/map-editor-api.d.ts +13 -0
- package/dist/types/lib/map-editor-api.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,19 @@ A powerful MapLibre-based map editor component for React applications. Provides
|
|
|
4
4
|
|
|
5
5
|
> **⚠️ Proprietary Software**: This package is proprietary to Octostar Limited. Unauthorized use is prohibited.
|
|
6
6
|
|
|
7
|
+
## Versioning & Releases
|
|
8
|
+
|
|
9
|
+
Versioning is driven by [GitVersion 6](https://gitversion.net/) (`GitVersion.yml`, `GitHubFlow/v1`). Every push to `main` (outside `*.md`/`docs/**`) computes the next semantic version, pushes the matching `v<version>` git tag, publishes the package to npm, and creates a GitHub release with generated notes.
|
|
10
|
+
|
|
11
|
+
The default increment is **patch** — each merge to `main` bumps the patch version (e.g. `0.1.32` → `0.1.33`). Override the bump from a commit/PR message:
|
|
12
|
+
|
|
13
|
+
| Directive | Effect |
|
|
14
|
+
|--------------------|---------------------------------|
|
|
15
|
+
| `+semver: major` | Bump the major version |
|
|
16
|
+
| `+semver: minor` | Bump the minor version |
|
|
17
|
+
| `+semver: patch` | Bump the patch version (default)|
|
|
18
|
+
| `+semver: none` | No version bump |
|
|
19
|
+
|
|
7
20
|
## Prerequisites
|
|
8
21
|
|
|
9
22
|
- Node.js 20+ (see `.nvmrc`)
|
package/dist/index.cjs
CHANGED
|
@@ -2973,7 +2973,7 @@ function RecordFieldsSection({ feature }) {
|
|
|
2973
2973
|
);
|
|
2974
2974
|
}
|
|
2975
2975
|
let persistedTabPreference = "properties";
|
|
2976
|
-
function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometry, onClose, isEditMode = true, isReadOnlyLayer = false, layerName, layerId, autoFocusLabel = false, entityCardProvider, typePickerProvider, featureSaveProvider, featureRefreshProvider, onFeatureSaved, onDeleteFeatures, onOpenInNewTab, onEntityContextMenu, layers, onMoveFeaturesToLayer, onCopyFeaturesToLayer, onCreateLayerAndMoveFeatures, onCreateLayerAndCopyFeatures, getFeatureColor, anchorEl }) {
|
|
2976
|
+
function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometry, onClose, isEditMode = true, isReadOnlyLayer = false, layerName, layerId, autoFocusLabel = false, entityCardProvider, entityCardPlacement = "tab", inlineEntityCardLabel = "Point Detail", typePickerProvider, featureSaveProvider, featureRefreshProvider, onFeatureSaved, onDeleteFeatures, onOpenInNewTab, onEntityContextMenu, layers, onMoveFeaturesToLayer, onCopyFeaturesToLayer, onCreateLayerAndMoveFeatures, onCreateLayerAndCopyFeatures, getFeatureColor, anchorEl }) {
|
|
2977
2977
|
var _a, _b, _c, _d, _e;
|
|
2978
2978
|
const feature = selectedFeatures[0];
|
|
2979
2979
|
const { toast } = useToast();
|
|
@@ -4105,6 +4105,35 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
4105
4105
|
] }, key)) })
|
|
4106
4106
|
] })
|
|
4107
4107
|
] }),
|
|
4108
|
+
entityCardPlacement === "inline-above" && entityCardProvider && !hasMultipleSelection && (() => {
|
|
4109
|
+
const inlineCard = entityCardProvider({
|
|
4110
|
+
type: "Feature",
|
|
4111
|
+
id: feature.id,
|
|
4112
|
+
geometry: feature.geometry,
|
|
4113
|
+
properties: feature.properties
|
|
4114
|
+
});
|
|
4115
|
+
if (!inlineCard) return null;
|
|
4116
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4117
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Divider, { className: "!my-1.5" }),
|
|
4118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4119
|
+
antd.Collapse,
|
|
4120
|
+
{
|
|
4121
|
+
size: "small",
|
|
4122
|
+
defaultActiveKey: ["inline-entity-card"],
|
|
4123
|
+
ghost: true,
|
|
4124
|
+
className: "[&_.ant-collapse-header]:!px-0 [&_.ant-collapse-header]:!py-1 [&_.ant-collapse-content-box]:!px-0 [&_.ant-collapse-content-box]:!py-1",
|
|
4125
|
+
items: [{
|
|
4126
|
+
key: "inline-entity-card",
|
|
4127
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
4128
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.MapPin, { className: "w-3 h-3 text-foreground" }),
|
|
4129
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-bold uppercase tracking-wide text-foreground", children: inlineEntityCardLabel })
|
|
4130
|
+
] }),
|
|
4131
|
+
children: inlineCard
|
|
4132
|
+
}]
|
|
4133
|
+
}
|
|
4134
|
+
)
|
|
4135
|
+
] });
|
|
4136
|
+
})(),
|
|
4108
4137
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Divider, { className: "!my-1.5" }),
|
|
4109
4138
|
/* @__PURE__ */ jsxRuntime.jsx(RecordFieldsSection, { feature }),
|
|
4110
4139
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Divider, { className: "!my-1.5" }),
|
|
@@ -4147,7 +4176,7 @@ function PropertiesPanel({ selectedFeatures, onUpdateProperties, onUpdateGeometr
|
|
|
4147
4176
|
};
|
|
4148
4177
|
};
|
|
4149
4178
|
const portalIfAnchored = (jsx2) => anchorEl ? reactDom.createPortal(jsx2, document.body) : jsx2;
|
|
4150
|
-
if (entityCardProvider) {
|
|
4179
|
+
if (entityCardProvider && (entityCardPlacement !== "inline-above" || hasMultipleSelection)) {
|
|
4151
4180
|
const cardsPositioned = computePanelPosition(320, "w-80");
|
|
4152
4181
|
const cardsPanel = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4153
4182
|
"div",
|
|
@@ -5805,6 +5834,8 @@ const MapEditorCanvas = react.forwardRef(function MapEditorCanvas2({
|
|
|
5805
5834
|
onMapStateLoaded,
|
|
5806
5835
|
interceptGeoJSONFileLoad,
|
|
5807
5836
|
entityCardProvider,
|
|
5837
|
+
entityCardPlacement,
|
|
5838
|
+
inlineEntityCardLabel,
|
|
5808
5839
|
typePickerProvider,
|
|
5809
5840
|
contextMenuProvider,
|
|
5810
5841
|
featureSaveProvider,
|
|
@@ -7885,6 +7916,7 @@ const MapEditorCanvas = react.forwardRef(function MapEditorCanvas2({
|
|
|
7885
7916
|
}
|
|
7886
7917
|
});
|
|
7887
7918
|
setSelectedFeatureIds(ids);
|
|
7919
|
+
selectedFeatureIdsRef.current = ids;
|
|
7888
7920
|
setShowProperties(ids.length > 0);
|
|
7889
7921
|
syncRef.current();
|
|
7890
7922
|
onFeatureSelect == null ? void 0 : onFeatureSelect(e.features);
|
|
@@ -9328,13 +9360,22 @@ const MapEditorCanvas = react.forwardRef(function MapEditorCanvas2({
|
|
|
9328
9360
|
} else {
|
|
9329
9361
|
let updatedFeature;
|
|
9330
9362
|
readOnlyFeatures.current.forEach((features, layerId) => {
|
|
9331
|
-
var _a2;
|
|
9363
|
+
var _a2, _b2;
|
|
9332
9364
|
const idx = features.findIndex((f) => String(f.id) === featureId);
|
|
9333
9365
|
if (idx !== -1) {
|
|
9334
9366
|
const f = features[idx];
|
|
9367
|
+
let hasRealChange = false;
|
|
9368
|
+
Object.entries(normalizedProperties).forEach(([key, value]) => {
|
|
9369
|
+
var _a3;
|
|
9370
|
+
const oldVal = (_a3 = f.properties) == null ? void 0 : _a3[key];
|
|
9371
|
+
if (JSON.stringify(oldVal) !== JSON.stringify(value)) hasRealChange = true;
|
|
9372
|
+
});
|
|
9373
|
+
const currentUnsaved = (_a2 = f.properties) == null ? void 0 : _a2._unsaved;
|
|
9335
9374
|
f.properties = { ...f.properties, ...normalizedProperties };
|
|
9336
|
-
if (!externalPersistence
|
|
9337
|
-
|
|
9375
|
+
if (!externalPersistence && hasRealChange && currentUnsaved !== false) {
|
|
9376
|
+
f.properties._unsaved = true;
|
|
9377
|
+
}
|
|
9378
|
+
if (properties.kind === "text" || ((_b2 = f.properties) == null ? void 0 : _b2.kind) === "text") {
|
|
9338
9379
|
delete f.properties.text;
|
|
9339
9380
|
}
|
|
9340
9381
|
layerTemporalCacheRef.current.delete(layerId);
|
|
@@ -12548,6 +12589,8 @@ const MapEditorCanvas = react.forwardRef(function MapEditorCanvas2({
|
|
|
12548
12589
|
layerId,
|
|
12549
12590
|
autoFocusLabel,
|
|
12550
12591
|
entityCardProvider,
|
|
12592
|
+
entityCardPlacement,
|
|
12593
|
+
inlineEntityCardLabel,
|
|
12551
12594
|
typePickerProvider,
|
|
12552
12595
|
featureSaveProvider,
|
|
12553
12596
|
featureRefreshProvider,
|