@classic-homes/maps-core 0.1.5 → 0.2.2
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/index.cjs +168 -39
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +116 -1
- package/package.json +7 -1
- package/src/styles/bundled.css +820 -0
- package/src/styles/css.d.ts +66 -0
- package/src/styles/index.css +41 -0
- package/src/styles/maplibre-fixes.css +145 -0
- package/src/styles/utilities.css +703 -0
package/dist/index.d.ts
CHANGED
|
@@ -1605,4 +1605,107 @@ declare function isAnyLayerLoading(states: Map<string, OverlayLayerState>): bool
|
|
|
1605
1605
|
*/
|
|
1606
1606
|
declare function getLayersWithErrors(states: Map<string, OverlayLayerState>): OverlayLayerState[];
|
|
1607
1607
|
|
|
1608
|
-
|
|
1608
|
+
/**
|
|
1609
|
+
* Real Estate Domain Colors
|
|
1610
|
+
* Colors for visualizing lot and inventory data on maps.
|
|
1611
|
+
*/
|
|
1612
|
+
/**
|
|
1613
|
+
* Lot availability status colors
|
|
1614
|
+
*/
|
|
1615
|
+
declare const lotAvailabilityColors: {
|
|
1616
|
+
readonly Available: "#4caf50";
|
|
1617
|
+
readonly Future: "#795548";
|
|
1618
|
+
readonly Spec: "#FFEB3B";
|
|
1619
|
+
readonly Model: "#CE93D8";
|
|
1620
|
+
readonly 'Under Contract': "#81D4FA";
|
|
1621
|
+
readonly Sold: "#f44336";
|
|
1622
|
+
readonly Unavailable: "#757575";
|
|
1623
|
+
readonly Unknown: "#757575";
|
|
1624
|
+
};
|
|
1625
|
+
type LotAvailability = keyof typeof lotAvailabilityColors;
|
|
1626
|
+
/**
|
|
1627
|
+
* Inventory home status colors
|
|
1628
|
+
*/
|
|
1629
|
+
declare const inventoryStatusColors: {
|
|
1630
|
+
readonly 'Ready Now': "#2E7D32";
|
|
1631
|
+
readonly Upcoming: "#ED6C02";
|
|
1632
|
+
readonly default: "#757575";
|
|
1633
|
+
};
|
|
1634
|
+
type InventoryStatus = keyof typeof inventoryStatusColors;
|
|
1635
|
+
/**
|
|
1636
|
+
* Lot size category colors
|
|
1637
|
+
*/
|
|
1638
|
+
declare const lotSizeColors: {
|
|
1639
|
+
readonly Small: "#2196f3";
|
|
1640
|
+
readonly Medium: "#4caf50";
|
|
1641
|
+
readonly Large: "#ff9800";
|
|
1642
|
+
readonly 'Extra Large': "#f44336";
|
|
1643
|
+
readonly Unknown: "#757575";
|
|
1644
|
+
};
|
|
1645
|
+
type LotSize = keyof typeof lotSizeColors;
|
|
1646
|
+
/**
|
|
1647
|
+
* Get contrast text color for WCAG accessibility
|
|
1648
|
+
*/
|
|
1649
|
+
declare function getContrastTextColor(backgroundColor: string): string;
|
|
1650
|
+
declare function getAvailabilityColor(availability: string): string;
|
|
1651
|
+
declare function getSizeColor(size: string): string;
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* Map Feature Colors
|
|
1655
|
+
* Colors for common map visualization features.
|
|
1656
|
+
*/
|
|
1657
|
+
/**
|
|
1658
|
+
* Cluster visualization colors (using brand tokens)
|
|
1659
|
+
*/
|
|
1660
|
+
declare const clusterColors: {
|
|
1661
|
+
readonly small: "#3ba4a7";
|
|
1662
|
+
readonly medium: "#002e3f";
|
|
1663
|
+
readonly large: "#5e2c41";
|
|
1664
|
+
readonly stroke: "#ffffff";
|
|
1665
|
+
readonly text: "#ffffff";
|
|
1666
|
+
};
|
|
1667
|
+
/**
|
|
1668
|
+
* Community/region boundary colors
|
|
1669
|
+
*/
|
|
1670
|
+
declare const boundaryColors: {
|
|
1671
|
+
readonly fill: "#C50F22";
|
|
1672
|
+
readonly line: "#C50F22";
|
|
1673
|
+
readonly hoverFill: "#1976d2";
|
|
1674
|
+
readonly defaultFill: "#4A90E2";
|
|
1675
|
+
readonly hoverLine: "#1565c0";
|
|
1676
|
+
readonly defaultLine: "#4A90E2";
|
|
1677
|
+
};
|
|
1678
|
+
/**
|
|
1679
|
+
* Sales office marker color
|
|
1680
|
+
*/
|
|
1681
|
+
declare const salesOfficeColor = "#C50F22";
|
|
1682
|
+
/**
|
|
1683
|
+
* Color for non-matched/de-emphasized features
|
|
1684
|
+
*/
|
|
1685
|
+
declare const nonMatchedColor = "#9e9e9e";
|
|
1686
|
+
|
|
1687
|
+
/**
|
|
1688
|
+
* Pre-built MapLibre Expressions
|
|
1689
|
+
*/
|
|
1690
|
+
/**
|
|
1691
|
+
* Color expression for lot availability (property: 'availability')
|
|
1692
|
+
*/
|
|
1693
|
+
declare const lotAvailabilityColorExpression: unknown[];
|
|
1694
|
+
/**
|
|
1695
|
+
* Color expression for inventory home status (property: 'status')
|
|
1696
|
+
*/
|
|
1697
|
+
declare const inventoryStatusColorExpression: unknown[];
|
|
1698
|
+
/**
|
|
1699
|
+
* Color expression for lot size (property: 'sizeCategory')
|
|
1700
|
+
*/
|
|
1701
|
+
declare const lotSizeColorExpression: unknown[];
|
|
1702
|
+
/**
|
|
1703
|
+
* Cluster color expression based on point_count
|
|
1704
|
+
*/
|
|
1705
|
+
declare const clusterColorExpression: unknown[];
|
|
1706
|
+
/**
|
|
1707
|
+
* Create matched/non-matched color expression
|
|
1708
|
+
*/
|
|
1709
|
+
declare function createMatchedColorExpression(baseColorExpression: unknown[], matchedProperty?: string): unknown[];
|
|
1710
|
+
|
|
1711
|
+
export { BASE_OFFSET, BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, BasemapApiKeys, BasemapDefinition, BoundsArray, CATEGORY_META, CITY_LIMITS, CLASSIC_DARK, CLASSIC_LIGHT, type ClusterExpandOptions, type ClusterExpansionResult, type ClusterFeatureProperties, type ColorExpression, ControlPosition, DEFAULT_SIMPLIFICATION_THRESHOLDS, type DynamicLODOptions, type DynamicLODState, type ExtrusionHeightOptions, FLOOD_ZONES, FREE_BASEMAPS, type FeatureGroup, type FilterExpression, type GenerateLODOptions, GeoJSONFeature, GeoJSONFeatureCollection, type GeoJSONFingerprint, GeoJSONPolygon, type GroupFeaturesOptions, type InventoryStatus, KEYBOARD_CONTROLS, type LODData, type LODDataWithSimplification, type LayerManagerProps, LngLat, type LoadGeoJSONOptions, type LoadGeoJSONResult, type LotAvailability, type LotFillStyleOptions, type LotOutlineStyleOptions, type LotSize, MAPTILER_BASIC, MAPTILER_OUTDOOR, MAPTILER_SATELLITE, MAPTILER_STREETS, MARKER_PROTECTION_CLASS, MapBounds, MapTheme, MarkerData, type NumberExpression, OFFSET_CLASSES, OSM_STANDARD, type OverlayApiKeys, type OverlayDataSource, type OverlayLayerCategory, type OverlayLayerCategoryMeta, type OverlayLayerDefinition, type OverlayLayerLegend, type OverlayLayerState, type OverlayLayerStyle, type OverlayLegendItem, PARKS, POSITION_CLASSES, type PaintProps, type PaintPropsDiff, SCHOOL_DISTRICTS, SPORTS_FACILITIES, STADIA_ALIDADE_DARK, STADIA_ALIDADE_SMOOTH, STADIA_STAMEN_TERRAIN, STADIA_STAMEN_TONER, STADIA_STAMEN_WATERCOLOR, type SimplificationStats, type SimplificationThreshold, TRAILS, TRANSIT_ROUTES, type ValidationResult, WATERSHEDS, ZONING_DISTRICTS, applyMarkerChildProtection, applyMarkerProtection, boundaryColors, boundsToPolygon, calculateBounds, calculateCentroid, calculateZoomThresholds, clusterColorExpression, clusterColors, combineBounds, computePositionClasses, computeVerticalOffsetStyle, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createInitialLayerStates, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createMatchedColorExpression, createSelectionExpression, createStatusColorExpression, createZoomExpression, decimalToDMS, deepEqual, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getAvailabilityColor, getAvailableBasemaps, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getContrastTextColor, getHighlightStyle, getLayerCategories, getLayerStatesArray, getLayerStyleForTheme, getLayersByCategory, getLayersWithErrors, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, getSizeColor, getVisibleLayerIds, groupFeaturesByProperty, groupLayersByCategory, hideAllLayers, inventoryStatusColorExpression, inventoryStatusColors, isAnyLayerLoading, isClusterFeature, isValidBounds, loadGeoJSON, lotAvailabilityColorExpression, lotAvailabilityColors, lotSizeColorExpression, lotSizeColors, nonMatchedColor, paintPropsEqual, removeMarkerProtection, reorderLayers, resolveBasemapStyle, resolveBasemapThumbnail, resolveLayerSourceUrl, salesOfficeColor, searchLayers, serializeFilter, setLayerError, setLayerLoading, setLayerOpacity, showAllLayers, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, toggleLayerVisibility, updateLayerState, validateGeoJSON, zoomToScale };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { lightBasicStyle, darkBasicStyle, lightTheme } from './chunk-2NISJ7WE.js';
|
|
2
2
|
export { THEME_DARK, THEME_LIGHT, darkBasicStyle, darkTheme, generateBasicStyle, generateDarkColors, generateDarkDataColors, generateDarkTheme, generateLightColors, generateLightDataColors, generateLightTheme, generateVectorStyle, getBasicStyle, getTheme, getTypography, lightBasicStyle, lightTheme } from './chunk-2NISJ7WE.js';
|
|
3
3
|
import RBush from 'rbush';
|
|
4
|
+
import { colors } from '@classic-homes/theme-tokens';
|
|
4
5
|
|
|
5
6
|
// src/utils/accessibility.ts
|
|
6
7
|
var KEYBOARD_CONTROLS = {
|
|
@@ -3319,4 +3320,118 @@ function getLayersWithErrors(states) {
|
|
|
3319
3320
|
return Array.from(states.values()).filter((state) => state.error !== null);
|
|
3320
3321
|
}
|
|
3321
3322
|
|
|
3322
|
-
|
|
3323
|
+
// src/colors/realEstate.ts
|
|
3324
|
+
var lotAvailabilityColors = {
|
|
3325
|
+
Available: "#4caf50",
|
|
3326
|
+
// Green - ready for sale
|
|
3327
|
+
Future: "#795548",
|
|
3328
|
+
// Brown - coming soon
|
|
3329
|
+
Spec: "#FFEB3B",
|
|
3330
|
+
// Yellow - spec home
|
|
3331
|
+
Model: "#CE93D8",
|
|
3332
|
+
// Lavender - model home
|
|
3333
|
+
"Under Contract": "#81D4FA",
|
|
3334
|
+
// Light Blue - pending sale
|
|
3335
|
+
Sold: "#f44336",
|
|
3336
|
+
// Red - sold
|
|
3337
|
+
Unavailable: "#757575",
|
|
3338
|
+
// Gray - not available
|
|
3339
|
+
Unknown: "#757575"
|
|
3340
|
+
// Gray - default fallback
|
|
3341
|
+
};
|
|
3342
|
+
var inventoryStatusColors = {
|
|
3343
|
+
"Ready Now": "#2E7D32",
|
|
3344
|
+
// Green - available immediately
|
|
3345
|
+
Upcoming: "#ED6C02",
|
|
3346
|
+
// Orange - coming soon
|
|
3347
|
+
default: "#757575"
|
|
3348
|
+
// Gray - unknown status
|
|
3349
|
+
};
|
|
3350
|
+
var lotSizeColors = {
|
|
3351
|
+
Small: "#2196f3",
|
|
3352
|
+
// Blue
|
|
3353
|
+
Medium: "#4caf50",
|
|
3354
|
+
// Green
|
|
3355
|
+
Large: "#ff9800",
|
|
3356
|
+
// Orange
|
|
3357
|
+
"Extra Large": "#f44336",
|
|
3358
|
+
// Red
|
|
3359
|
+
Unknown: "#757575"
|
|
3360
|
+
// Gray
|
|
3361
|
+
};
|
|
3362
|
+
function getContrastTextColor(backgroundColor) {
|
|
3363
|
+
const hex = backgroundColor.replace("#", "");
|
|
3364
|
+
const rgb = hex.match(/.{2}/g).map((c) => {
|
|
3365
|
+
const val = parseInt(c, 16) / 255;
|
|
3366
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
3367
|
+
});
|
|
3368
|
+
const luminance = 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2];
|
|
3369
|
+
return luminance > 0.179 ? "rgba(0, 0, 0, 0.87)" : "#ffffff";
|
|
3370
|
+
}
|
|
3371
|
+
function getAvailabilityColor(availability) {
|
|
3372
|
+
return lotAvailabilityColors[availability] ?? lotAvailabilityColors.Unknown;
|
|
3373
|
+
}
|
|
3374
|
+
function getSizeColor(size) {
|
|
3375
|
+
return lotSizeColors[size] ?? lotSizeColors.Unknown;
|
|
3376
|
+
}
|
|
3377
|
+
var clusterColors = {
|
|
3378
|
+
small: colors.teal[500],
|
|
3379
|
+
// #3ba4a7 - < 10 points
|
|
3380
|
+
medium: colors.navy[700],
|
|
3381
|
+
// #002e3f - 10-50 points
|
|
3382
|
+
large: colors.plum[700],
|
|
3383
|
+
// #5e2c41 - 50+ points
|
|
3384
|
+
stroke: colors.white,
|
|
3385
|
+
text: colors.white
|
|
3386
|
+
};
|
|
3387
|
+
var boundaryColors = {
|
|
3388
|
+
fill: "#C50F22",
|
|
3389
|
+
// Brand red
|
|
3390
|
+
line: "#C50F22",
|
|
3391
|
+
hoverFill: "#1976d2",
|
|
3392
|
+
defaultFill: "#4A90E2",
|
|
3393
|
+
hoverLine: "#1565c0",
|
|
3394
|
+
defaultLine: "#4A90E2"
|
|
3395
|
+
};
|
|
3396
|
+
var salesOfficeColor = "#C50F22";
|
|
3397
|
+
var nonMatchedColor = "#9e9e9e";
|
|
3398
|
+
|
|
3399
|
+
// src/colors/expressions.ts
|
|
3400
|
+
var lotAvailabilityColorExpression = createCategoricalColorExpression(
|
|
3401
|
+
"availability",
|
|
3402
|
+
lotAvailabilityColors,
|
|
3403
|
+
lotAvailabilityColors.Unknown
|
|
3404
|
+
);
|
|
3405
|
+
var inventoryStatusColorExpression = [
|
|
3406
|
+
"match",
|
|
3407
|
+
["get", "status"],
|
|
3408
|
+
"Ready Now",
|
|
3409
|
+
inventoryStatusColors["Ready Now"],
|
|
3410
|
+
"Upcoming",
|
|
3411
|
+
inventoryStatusColors["Upcoming"],
|
|
3412
|
+
inventoryStatusColors.default
|
|
3413
|
+
];
|
|
3414
|
+
var lotSizeColorExpression = createCategoricalColorExpression(
|
|
3415
|
+
"sizeCategory",
|
|
3416
|
+
lotSizeColors,
|
|
3417
|
+
lotSizeColors.Unknown
|
|
3418
|
+
);
|
|
3419
|
+
var clusterColorExpression = [
|
|
3420
|
+
"step",
|
|
3421
|
+
["get", "point_count"],
|
|
3422
|
+
clusterColors.small,
|
|
3423
|
+
10,
|
|
3424
|
+
clusterColors.medium,
|
|
3425
|
+
50,
|
|
3426
|
+
clusterColors.large
|
|
3427
|
+
];
|
|
3428
|
+
function createMatchedColorExpression(baseColorExpression, matchedProperty = "matched") {
|
|
3429
|
+
return [
|
|
3430
|
+
"case",
|
|
3431
|
+
["coalesce", ["get", matchedProperty], true],
|
|
3432
|
+
baseColorExpression,
|
|
3433
|
+
nonMatchedColor
|
|
3434
|
+
];
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
export { BASE_OFFSET, BIKE_LANES, BUILTIN_BASEMAPS, BUILTIN_OVERLAY_LAYERS, CATEGORY_META, CITY_LIMITS, CLASSIC_DARK, CLASSIC_LIGHT, DEFAULT_SIMPLIFICATION_THRESHOLDS, FLOOD_ZONES, FREE_BASEMAPS, KEYBOARD_CONTROLS, MAPTILER_BASIC, MAPTILER_OUTDOOR, MAPTILER_SATELLITE, MAPTILER_STREETS, MARKER_PROTECTION_CLASS, OFFSET_CLASSES, OSM_STANDARD, PARKS, POSITION_CLASSES, SCHOOL_DISTRICTS, SPORTS_FACILITIES, STADIA_ALIDADE_DARK, STADIA_ALIDADE_SMOOTH, STADIA_STAMEN_TERRAIN, STADIA_STAMEN_TONER, STADIA_STAMEN_WATERCOLOR, TRAILS, TRANSIT_ROUTES, WATERSHEDS, ZONING_DISTRICTS, applyMarkerChildProtection, applyMarkerProtection, boundaryColors, boundsToPolygon, buildRTreeIndex, buildSpatialIndex, calculateBounds, calculateCentroid, calculateZoomThresholds, clusterColorExpression, clusterColors, combineBounds, computePositionClasses, computeVerticalOffsetStyle, countFeaturesByType, createCategoricalColorExpression, createCircleStyle, createContinuousColorExpression, createDynamicLODManager, createExtrusionHeightExpression, createExtrusionStyle, createFillStyle, createGeoJSONFingerprint, createHeatmapStyle, createHoverExpression, createIdleViewportManager, createInitialLayerStates, createInteractiveExpression, createInteractiveStatusColorExpression, createLineStyle, createLotFillStyle, createLotOutlineStyle, createMatchedColorExpression, createPredictiveViewportManager, createRTreeViewportManager, createSelectionExpression, createStatusColorExpression, createViewportManager, createViewportQuery, createZoomExpression, decimalToDMS, deepEqual, expandCluster, expandClusterToBounds, extendBounds, filterByGeometryType, filterEqual, fingerprintEqual, formatArea, formatBearing, formatBounds, formatCoordinates, formatDistance, formatFeatureProperties, formatLabel, formatPitch, formatPropertyValue, formatScale, formatZoom, generateBoundingPolygon, generateConvexHull, generateFeatureCollectionDescription, generateFeatureTable, generateKeyboardControlsDescription, generateLODData, generateLODDataWithSimplification, generateMapDescription, generateMarkerList, generateMarkersDescription, generateMoveAnnouncement, geoJSONEqual, getAvailabilityColor, getAvailableBasemaps, getChangedPaintProps, getClusterBounds, getClusterChildren, getClusterExpansionZoom, getClusterLeaves, getContrastTextColor, getHighlightStyle, getLayerCategories, getLayerStatesArray, getLayerStyleForTheme, getLayersByCategory, getLayersWithErrors, getSelectionStyle, getSimplificationToleranceForZoom, getSimplifiedFeaturesForZoom, getSizeColor, getVisibleLayerIds, groupFeaturesByProperty, groupLayersByCategory, hideAllLayers, inventoryStatusColorExpression, inventoryStatusColors, isAnyLayerLoading, isClusterFeature, isValidBounds, loadGeoJSON, lotAvailabilityColorExpression, lotAvailabilityColors, lotSizeColorExpression, lotSizeColors, nonMatchedColor, paintPropsEqual, queryByBounds, queryByBoundsWithStats, queryRTreeByBounds, queryRTreeByBoundsWithStats, removeMarkerProtection, reorderLayers, resolveBasemapStyle, resolveBasemapThumbnail, resolveLayerSourceUrl, salesOfficeColor, searchLayers, serializeFilter, setLayerError, setLayerLoading, setLayerOpacity, showAllLayers, simplifyFeature, simplifyFeatureCollection, simplifyFeatureCollectionWithStats, simplifyPolygon, toggleLayerVisibility, updateLayerState, validateGeoJSON, zoomToScale };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classic-homes/maps-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Core utilities and theme for Classic Theme maps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"maps",
|
|
@@ -42,6 +42,12 @@
|
|
|
42
42
|
"./workers/spatial.worker": {
|
|
43
43
|
"import": "./dist/workers/spatial.worker.js"
|
|
44
44
|
},
|
|
45
|
+
"./styles": "./src/styles/index.css",
|
|
46
|
+
"./styles/index.css": "./src/styles/index.css",
|
|
47
|
+
"./styles/bundled.css": "./src/styles/bundled.css",
|
|
48
|
+
"./styles/utilities.css": "./src/styles/utilities.css",
|
|
49
|
+
"./styles/maplibre-fixes.css": "./src/styles/maplibre-fixes.css",
|
|
50
|
+
"./styles/css.d.ts": "./src/styles/css.d.ts",
|
|
45
51
|
"./styles/controls.css": "./src/styles/controls.css",
|
|
46
52
|
"./styles/popup.css": "./src/styles/popup.css",
|
|
47
53
|
"./styles/marker.css": "./src/styles/marker.css",
|