@fieldia/map 0.14.1 → 0.16.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.
Files changed (108) hide show
  1. package/README.md +103 -10
  2. package/package.json +5 -4
  3. package/src/index.d.mts +5 -1
  4. package/src/index.d.ts +5 -1
  5. package/src/index.js +7 -1
  6. package/src/index.js.map +1 -1
  7. package/src/index.mjs +3 -0
  8. package/src/index.mjs.map +1 -1
  9. package/src/lib/answers.d.mts +17 -0
  10. package/src/lib/answers.d.ts +17 -0
  11. package/src/lib/answers.js +27 -0
  12. package/src/lib/answers.js.map +1 -0
  13. package/src/lib/answers.mjs +21 -0
  14. package/src/lib/answers.mjs.map +1 -0
  15. package/src/lib/area.js +29 -246
  16. package/src/lib/area.js.map +1 -1
  17. package/src/lib/area.mjs +29 -246
  18. package/src/lib/area.mjs.map +1 -1
  19. package/src/lib/card.d.mts +53 -0
  20. package/src/lib/card.d.ts +53 -0
  21. package/src/lib/card.js +98 -0
  22. package/src/lib/card.js.map +1 -0
  23. package/src/lib/card.mjs +94 -0
  24. package/src/lib/card.mjs.map +1 -0
  25. package/src/lib/cluster.d.mts +12 -0
  26. package/src/lib/cluster.d.ts +12 -0
  27. package/src/lib/cluster.js +60 -0
  28. package/src/lib/cluster.js.map +1 -0
  29. package/src/lib/cluster.mjs +57 -0
  30. package/src/lib/cluster.mjs.map +1 -0
  31. package/src/lib/drawing.d.mts +36 -0
  32. package/src/lib/drawing.d.ts +36 -0
  33. package/src/lib/drawing.js +267 -0
  34. package/src/lib/drawing.js.map +1 -0
  35. package/src/lib/drawing.mjs +263 -0
  36. package/src/lib/drawing.mjs.map +1 -0
  37. package/src/lib/form-map.d.mts +16 -0
  38. package/src/lib/form-map.d.ts +16 -0
  39. package/src/lib/form-map.js +525 -0
  40. package/src/lib/form-map.js.map +1 -0
  41. package/src/lib/form-map.mjs +522 -0
  42. package/src/lib/form-map.mjs.map +1 -0
  43. package/src/lib/kinds.js +9 -2
  44. package/src/lib/kinds.js.map +1 -1
  45. package/src/lib/kinds.mjs +9 -2
  46. package/src/lib/kinds.mjs.map +1 -1
  47. package/src/lib/labels.d.mts +41 -0
  48. package/src/lib/labels.d.ts +41 -0
  49. package/src/lib/labels.js +87 -1
  50. package/src/lib/labels.js.map +1 -1
  51. package/src/lib/labels.mjs +84 -0
  52. package/src/lib/labels.mjs.map +1 -1
  53. package/src/lib/list-view.d.mts +13 -0
  54. package/src/lib/list-view.d.ts +13 -0
  55. package/src/lib/list-view.js +464 -0
  56. package/src/lib/list-view.js.map +1 -0
  57. package/src/lib/list-view.mjs +461 -0
  58. package/src/lib/list-view.mjs.map +1 -0
  59. package/src/lib/map-core.d.mts +2 -2
  60. package/src/lib/map-core.d.ts +2 -2
  61. package/src/lib/map-core.js +23 -3
  62. package/src/lib/map-core.js.map +1 -1
  63. package/src/lib/map-core.mjs +23 -3
  64. package/src/lib/map-core.mjs.map +1 -1
  65. package/src/lib/map-icons.d.mts +8 -0
  66. package/src/lib/map-icons.d.ts +8 -0
  67. package/src/lib/map-icons.js +21 -0
  68. package/src/lib/map-icons.js.map +1 -0
  69. package/src/lib/map-icons.mjs +18 -0
  70. package/src/lib/map-icons.mjs.map +1 -0
  71. package/src/lib/marks.d.mts +34 -0
  72. package/src/lib/marks.d.ts +34 -0
  73. package/src/lib/marks.js +56 -0
  74. package/src/lib/marks.js.map +1 -0
  75. package/src/lib/marks.mjs +49 -0
  76. package/src/lib/marks.mjs.map +1 -0
  77. package/src/lib/pins.d.mts +58 -0
  78. package/src/lib/pins.d.ts +58 -0
  79. package/src/lib/pins.js +165 -0
  80. package/src/lib/pins.js.map +1 -0
  81. package/src/lib/pins.mjs +156 -0
  82. package/src/lib/pins.mjs.map +1 -0
  83. package/src/lib/providers.d.mts +27 -3
  84. package/src/lib/providers.d.ts +27 -3
  85. package/src/lib/providers.js +69 -67
  86. package/src/lib/providers.js.map +1 -1
  87. package/src/lib/providers.mjs +17 -15
  88. package/src/lib/providers.mjs.map +1 -1
  89. package/src/lib/route-line.d.mts +34 -0
  90. package/src/lib/route-line.d.ts +34 -0
  91. package/src/lib/route-line.js +53 -0
  92. package/src/lib/route-line.js.map +1 -0
  93. package/src/lib/route-line.mjs +47 -0
  94. package/src/lib/route-line.mjs.map +1 -0
  95. package/src/lib/routes.d.mts +28 -0
  96. package/src/lib/routes.d.ts +28 -0
  97. package/src/lib/routes.js +112 -0
  98. package/src/lib/routes.js.map +1 -0
  99. package/src/lib/routes.mjs +105 -0
  100. package/src/lib/routes.mjs.map +1 -0
  101. package/src/lib/settings.d.mts +8 -3
  102. package/src/lib/settings.d.ts +8 -3
  103. package/src/lib/styles.d.mts +16 -0
  104. package/src/lib/styles.d.ts +16 -0
  105. package/src/lib/styles.js +181 -1
  106. package/src/lib/styles.js.map +1 -1
  107. package/src/lib/styles.mjs +178 -0
  108. package/src/lib/styles.mjs.map +1 -1
@@ -1,7 +1,8 @@
1
1
  import type { Locale } from '@fieldia/core';
2
2
  import type { LatLng } from './geo.mjs';
3
- import type { MapLabels } from './labels.mjs';
4
- import type { AddressSearch, MapProvider, ReverseSearch } from './providers.mjs';
3
+ import type { FormMapLabels, ListMapLabels, MapLabels } from './labels.mjs';
4
+ import type { PinDrawer } from './pins.mjs';
5
+ import type { AddressSearch, MapProvider, ReverseSearch, RouteFinder } from './providers.mjs';
5
6
  /** What every map of an app shares: given once to `mapWidgets`. */
6
7
  export interface MapSettings {
7
8
  provider: MapProvider;
@@ -14,6 +15,10 @@ export interface MapSettings {
14
15
  /** Where an empty map opens, and how close. */
15
16
  center?: LatLng;
16
17
  zoom?: number;
18
+ /** The app's own routes, instead of the provider's. */
19
+ route?: RouteFinder;
20
+ /** The app's own pins for a list's map, by the name a page's `pin.widget` gives. */
21
+ pins?: Record<string, PinDrawer>;
17
22
  /** The app's own words over the maps', by language. */
18
- labels?: Partial<Record<Locale, Partial<MapLabels>>>;
23
+ labels?: Partial<Record<Locale, Partial<MapLabels & ListMapLabels & FormMapLabels>>>;
19
24
  }
@@ -1,7 +1,8 @@
1
1
  import type { Locale } from '@fieldia/core';
2
2
  import type { LatLng } from './geo';
3
- import type { MapLabels } from './labels';
4
- import type { AddressSearch, MapProvider, ReverseSearch } from './providers';
3
+ import type { FormMapLabels, ListMapLabels, MapLabels } from './labels';
4
+ import type { PinDrawer } from './pins';
5
+ import type { AddressSearch, MapProvider, ReverseSearch, RouteFinder } from './providers';
5
6
  /** What every map of an app shares: given once to `mapWidgets`. */
6
7
  export interface MapSettings {
7
8
  provider: MapProvider;
@@ -14,6 +15,10 @@ export interface MapSettings {
14
15
  /** Where an empty map opens, and how close. */
15
16
  center?: LatLng;
16
17
  zoom?: number;
18
+ /** The app's own routes, instead of the provider's. */
19
+ route?: RouteFinder;
20
+ /** The app's own pins for a list's map, by the name a page's `pin.widget` gives. */
21
+ pins?: Record<string, PinDrawer>;
17
22
  /** The app's own words over the maps', by language. */
18
- labels?: Partial<Record<Locale, Partial<MapLabels>>>;
23
+ labels?: Partial<Record<Locale, Partial<MapLabels & ListMapLabels & FormMapLabels>>>;
19
24
  }
@@ -9,3 +9,19 @@ export declare const MAP_CSS = "\n.fd-map-field { display: grid; gap: 8px; min-w
9
9
  export declare function installMapStyles(doc: Document): void;
10
10
  /** Leaflet's stylesheet, once per document, before the maps' own (which add to it): it comes with Leaflet. */
11
11
  export declare function installLeafletStyles(doc: Document, css: string): void;
12
+ /**
13
+ * A list's map, on top of the maps' own: each record's pin in its look and
14
+ * tone, bubbles of pins that crowd, the card a pin opens, "Search this area".
15
+ * Its own stylesheet, so a form with only a place or an area never carries it.
16
+ */
17
+ export declare const LIST_MAP_CSS = "\n.fd-map-list { min-width: 0; }\n.fd-map-mark { overflow: visible; }\n.fd-map-mark:focus { outline: none; }\n/* Each mark is as large as its face, stood on its point by its foot, its middle, or the tip of a label's tail. */\n.fd-map-mark.fd-map-foot { translate: -50% -100%; }\n.fd-map-mark.fd-map-middle { translate: -50% -50%; }\n.fd-map-mark.fd-map-tail { translate: -50% calc(-100% - 6px); }\n.fd-map-face {\n --fd-map-tone: var(--fd-accent); --fd-map-on: var(--fd-accent-text);\n position: relative; box-sizing: border-box; cursor: pointer; transition: scale 0.12s;\n}\n.fd-map-face[data-tone] { --fd-map-on: var(--fd-surface); }\n.fd-map-face[data-tone=\"info\"] { --fd-map-tone: var(--fd-info); }\n.fd-map-face[data-tone=\"success\"] { --fd-map-tone: var(--fd-success); }\n.fd-map-face[data-tone=\"warning\"] { --fd-map-tone: var(--fd-warning); }\n.fd-map-face[data-tone=\"danger\"] { --fd-map-tone: var(--fd-error); }\n.fd-map-face[data-tone=\"muted\"] { --fd-map-tone: var(--fd-muted); }\n.fd-map-face[data-stands=\"foot\"] { transform-origin: 50% 100%; }\n.fd-map-face[data-stands=\"middle\"] { transform-origin: 50% 50%; }\n.fd-map-face[data-hot], .fd-map-mark:hover .fd-map-face, .fd-map-bubble[data-hot], .fd-map-mark:hover .fd-map-bubble { scale: 1.12; }\n.fd-map-mark:focus-visible .fd-map-face, .fd-map-mark:focus-visible .fd-map-bubble { outline: 2px solid var(--fd-focus); outline-offset: 3px; }\n.fd-map-face-icon { display: block; }\n.fd-map-face-icon svg { display: block; width: 100%; height: 100%; }\n.fd-map-face[data-look=\"label\"] {\n padding: 4px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1.25; font-variant-numeric: tabular-nums;\n background: var(--fd-surface); color: var(--fd-text); border: 1.5px solid color-mix(in srgb, var(--fd-text) 20%, transparent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);\n}\n.fd-map-face[data-look=\"label\"][data-tone] { color: var(--fd-map-tone); border-color: var(--fd-map-tone); }\n.fd-map-face[data-look=\"label\"]::after {\n content: \"\"; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg);\n background: inherit; border: inherit; border-top: 0; border-left: 0;\n}\n.fd-map-face[data-look=\"label\"]:is([data-hot], [data-chosen]), .fd-map-mark:hover .fd-map-face[data-look=\"label\"] { background: var(--fd-map-tone); color: var(--fd-map-on); border-color: var(--fd-map-tone); }\n.fd-map-face-text { display: block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.fd-map-face[data-look=\"pin\"] { width: 30px; height: 40px; }\n.fd-map-face[data-look=\"pin\"] > svg { display: block; width: 30px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }\n.fd-map-face-body { fill: var(--fd-map-tone); stroke: var(--fd-surface); stroke-width: 1.5; }\n.fd-map-face[data-look=\"pin\"] .fd-map-face-icon { position: absolute; left: 7px; top: 6px; width: 16px; height: 16px; color: var(--fd-map-on); }\n.fd-map-face[data-look=\"pin\"] .fd-map-face-icon:empty { left: 10px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--fd-map-on); }\n.fd-map-face[data-look=\"icon\"] {\n width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;\n background: var(--fd-map-tone); color: var(--fd-map-on); border: 2px solid var(--fd-surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);\n}\n.fd-map-face[data-look=\"icon\"] .fd-map-face-icon { width: 20px; height: 20px; }\n.fd-map-face-turn { position: absolute; inset: -9px; pointer-events: none; }\n.fd-map-face-turn::before { content: \"\"; position: absolute; left: 50%; top: 0; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 7px solid var(--fd-map-tone); }\n.fd-map-face-photo {\n display: grid; place-items: center; width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%; object-fit: cover;\n border: 3px solid var(--fd-map-tone); background: var(--fd-fill); color: var(--fd-muted); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);\n}\nspan.fd-map-face-photo svg { width: 22px; height: 22px; }\n.fd-map-face[data-look=\"photo\"] .fd-map-face-text {\n position: absolute; top: calc(100% + 2px); left: 50%; translate: -50% 0; max-width: 14ch; padding: 1px 6px; border-radius: 999px;\n font-size: 12px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n}\n.fd-map-face[data-look=\"dot\"] { width: 16px; height: 16px; border-radius: 50%; background: var(--fd-map-tone); border: 2px solid var(--fd-surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }\n.fd-map-face:is([data-look=\"icon\"], [data-look=\"dot\"])[data-chosen], .fd-map-face[data-chosen] .fd-map-face-photo { box-shadow: 0 0 0 2px var(--fd-surface), 0 0 0 4px var(--fd-map-tone); }\n.fd-map-face[data-chosen]::before, .fd-map-bubble[data-chosen]::before {\n content: \"\u2713\"; position: absolute; top: -7px; right: -7px; z-index: 1; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;\n display: grid; place-items: center; font: 700 10px/1 system-ui, sans-serif; background: var(--fd-accent); color: var(--fd-accent-text); border: 1.5px solid var(--fd-surface);\n}\n.fd-map-bubble {\n position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;\n background: var(--fd-accent); color: var(--fd-accent-text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; transition: scale 0.12s;\n box-shadow: 0 0 0 5px color-mix(in srgb, var(--fd-accent) 30%, transparent), 0 1px 4px rgba(0, 0, 0, 0.3);\n}\n.fd-map-bubble[data-size=\"m\"] { width: 40px; height: 40px; }\n.fd-map-bubble[data-size=\"l\"] { width: 48px; height: 48px; }\n.fd-map-card-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 10px; overflow: hidden; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24); }\n.fd-map-card-popup .leaflet-popup-content { margin: 0; font: inherit; font-size: 14px; line-height: 1.4; }\n.fd-map-card-popup .leaflet-popup-tip { background: var(--fd-surface); }\n.fd-map-card { display: grid; }\n.fd-map-card-image { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--fd-fill); }\n.fd-map-card-body { display: grid; gap: 8px; padding: 10px 12px 12px; }\n.fd-map-card-head { display: flex; align-items: flex-start; gap: 8px; }\n.fd-map-card-title { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }\n.fd-map-card-close {\n flex: none; width: 28px; height: 28px; margin: -4px -6px -4px 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;\n background: transparent; color: var(--fd-muted); font: 400 20px/1 system-ui, sans-serif; cursor: pointer;\n}\n.fd-map-card[dir=\"rtl\"] .fd-map-card-close { margin: -4px 0 -4px -6px; }\n.fd-map-card-close:hover { background: var(--fd-fill); color: var(--fd-text); }\n.fd-map-card-fields { margin: 0; display: grid; gap: 3px; font-size: 13px; }\n.fd-map-card-fields div { display: flex; justify-content: space-between; gap: 10px; }\n.fd-map-card-fields dt { color: var(--fd-muted); }\n.fd-map-card-fields dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }\n.fd-map-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }\n.fd-map-card-choose { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; margin-inline-end: auto; }\n.fd-map-card-choose input { width: 16px; height: 16px; margin: 0; accent-color: var(--fd-accent); }\n.fd-map-card .fd-button { min-height: 30px; padding-inline: 14px; }\n.fd-map-card :focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }\n.fd-map-crowd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 220px; overflow: auto; }\n.fd-map-crowd-item { width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; text-align: start; background: transparent; color: var(--fd-text); font: inherit; font-size: 13px; cursor: pointer; }\n.fd-map-crowd-item:hover { background: var(--fd-accent-soft); }\n.fd-map-here {\n position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 1000; padding: 7px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer;\n border: 1px solid var(--fd-border); background: var(--fd-surface); color: var(--fd-text); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n}\n.fd-map-here:hover { color: var(--fd-accent); border-color: var(--fd-accent); }\n.fd-map-here:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 2px; }\n/* The map over the table when the list is too narrow for both side by side: shorter, so the table is in reach. */\n@container fd-list (max-width: 860px) { .fd-list[data-view=\"both\"] .fd-map-list .fd-map-box { height: clamp(260px, 46vh, 420px); } }\n.fd-map-ghost .fd-map-face { pointer-events: none; }\n/* The tools that draw an area to search in: at the map's start, the zoom at its end. */\n.fd-map-draw { position: absolute; top: 8px; left: 8px; z-index: 1000; display: grid; gap: 4px; }\n.fd-map-box[data-side=\"left\"] .fd-map-draw { left: auto; right: 8px; }\n.fd-map-draw button {\n width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;\n background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n}\n.fd-map-draw button svg { width: 18px; height: 18px; }\n.fd-map-draw button:hover, .fd-map-draw button[aria-pressed=\"true\"] { color: var(--fd-accent); border-color: var(--fd-accent); }\n.fd-map-draw button[aria-pressed=\"true\"] { background: var(--fd-accent-soft); }\n.fd-map-draw button:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }\n/* While an area is drawn, the pins let every press through to the map. */\n.fd-map-box[data-drawing] .fd-map-mark { pointer-events: none; }\n/* The drawing's bar starts after the tools. */\n.fd-map-list .fd-map-hint { left: 48px; }\n.fd-map-list .fd-map-box[data-side=\"left\"] .fd-map-hint { left: 52px; right: 48px; }\n.fd-map-list-note {\n position: absolute; left: 8px; bottom: 28px; z-index: 1000; max-width: calc(100% - 64px); margin: 0; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; line-height: 1.4;\n background: color-mix(in srgb, var(--fd-surface) 92%, transparent); color: var(--fd-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);\n}\n";
18
+ /** The list map's stylesheet, once per document, after the maps' own. */
19
+ export declare function installListMapStyles(doc: Document): void;
20
+ /**
21
+ * A form's map, on top of a list map's pins and cards: its label, a route
22
+ * (the part travelled faded), a place whose news is old, the Follow button,
23
+ * and the reader's own place with its button.
24
+ */
25
+ export declare const FORM_MAP_CSS = "\n.fd-map-form { display: grid; gap: 6px; min-width: 0; }\n.fd-map-form-label { margin: 0; font-weight: 600; color: var(--fd-text); }\npath.fd-map-route { stroke: var(--fd-accent); stroke-width: 5; stroke-opacity: 0.85; fill: none; stroke-linecap: round; stroke-linejoin: round; }\npath.fd-map-route-done { stroke: var(--fd-muted); stroke-width: 4; stroke-opacity: 0.55; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; }\n.fd-map-face[data-stale] { filter: grayscale(1); opacity: 0.75; }\n.fd-map-face-stale {\n position: absolute; top: calc(100% + 4px); left: 50%; translate: -50% 0; z-index: 1; padding: 1px 6px; border-radius: 999px; white-space: nowrap;\n font-size: 11.5px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n}\n.fd-map-face[data-look=\"photo\"] .fd-map-face-stale { top: calc(100% + 26px); }\n.fd-map-here.fd-map-follow { top: auto; bottom: 28px; }\n.fd-map-locate {\n position: absolute; top: 8px; left: 8px; z-index: 1000; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;\n background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n}\n.fd-map-box[data-side=\"left\"] .fd-map-locate { left: auto; right: 8px; }\n.fd-map-locate svg { width: 18px; height: 18px; }\n.fd-map-locate:hover, .fd-map-locate[aria-pressed=\"true\"] { color: var(--fd-accent); border-color: var(--fd-accent); }\n.fd-map-locate[aria-pressed=\"true\"] { background: var(--fd-accent-soft); }\n.fd-map-locate:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }\n.fd-map-me { box-sizing: border-box; border-radius: 50%; background: var(--fd-info); border: 3px solid var(--fd-surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3); }\n";
26
+ /** A form's map's stylesheet, once per document, after a list map's. */
27
+ export declare function installFormMapStyles(doc: Document): void;
@@ -9,3 +9,19 @@ export declare const MAP_CSS = "\n.fd-map-field { display: grid; gap: 8px; min-w
9
9
  export declare function installMapStyles(doc: Document): void;
10
10
  /** Leaflet's stylesheet, once per document, before the maps' own (which add to it): it comes with Leaflet. */
11
11
  export declare function installLeafletStyles(doc: Document, css: string): void;
12
+ /**
13
+ * A list's map, on top of the maps' own: each record's pin in its look and
14
+ * tone, bubbles of pins that crowd, the card a pin opens, "Search this area".
15
+ * Its own stylesheet, so a form with only a place or an area never carries it.
16
+ */
17
+ export declare const LIST_MAP_CSS = "\n.fd-map-list { min-width: 0; }\n.fd-map-mark { overflow: visible; }\n.fd-map-mark:focus { outline: none; }\n/* Each mark is as large as its face, stood on its point by its foot, its middle, or the tip of a label's tail. */\n.fd-map-mark.fd-map-foot { translate: -50% -100%; }\n.fd-map-mark.fd-map-middle { translate: -50% -50%; }\n.fd-map-mark.fd-map-tail { translate: -50% calc(-100% - 6px); }\n.fd-map-face {\n --fd-map-tone: var(--fd-accent); --fd-map-on: var(--fd-accent-text);\n position: relative; box-sizing: border-box; cursor: pointer; transition: scale 0.12s;\n}\n.fd-map-face[data-tone] { --fd-map-on: var(--fd-surface); }\n.fd-map-face[data-tone=\"info\"] { --fd-map-tone: var(--fd-info); }\n.fd-map-face[data-tone=\"success\"] { --fd-map-tone: var(--fd-success); }\n.fd-map-face[data-tone=\"warning\"] { --fd-map-tone: var(--fd-warning); }\n.fd-map-face[data-tone=\"danger\"] { --fd-map-tone: var(--fd-error); }\n.fd-map-face[data-tone=\"muted\"] { --fd-map-tone: var(--fd-muted); }\n.fd-map-face[data-stands=\"foot\"] { transform-origin: 50% 100%; }\n.fd-map-face[data-stands=\"middle\"] { transform-origin: 50% 50%; }\n.fd-map-face[data-hot], .fd-map-mark:hover .fd-map-face, .fd-map-bubble[data-hot], .fd-map-mark:hover .fd-map-bubble { scale: 1.12; }\n.fd-map-mark:focus-visible .fd-map-face, .fd-map-mark:focus-visible .fd-map-bubble { outline: 2px solid var(--fd-focus); outline-offset: 3px; }\n.fd-map-face-icon { display: block; }\n.fd-map-face-icon svg { display: block; width: 100%; height: 100%; }\n.fd-map-face[data-look=\"label\"] {\n padding: 4px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1.25; font-variant-numeric: tabular-nums;\n background: var(--fd-surface); color: var(--fd-text); border: 1.5px solid color-mix(in srgb, var(--fd-text) 20%, transparent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);\n}\n.fd-map-face[data-look=\"label\"][data-tone] { color: var(--fd-map-tone); border-color: var(--fd-map-tone); }\n.fd-map-face[data-look=\"label\"]::after {\n content: \"\"; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg);\n background: inherit; border: inherit; border-top: 0; border-left: 0;\n}\n.fd-map-face[data-look=\"label\"]:is([data-hot], [data-chosen]), .fd-map-mark:hover .fd-map-face[data-look=\"label\"] { background: var(--fd-map-tone); color: var(--fd-map-on); border-color: var(--fd-map-tone); }\n.fd-map-face-text { display: block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.fd-map-face[data-look=\"pin\"] { width: 30px; height: 40px; }\n.fd-map-face[data-look=\"pin\"] > svg { display: block; width: 30px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }\n.fd-map-face-body { fill: var(--fd-map-tone); stroke: var(--fd-surface); stroke-width: 1.5; }\n.fd-map-face[data-look=\"pin\"] .fd-map-face-icon { position: absolute; left: 7px; top: 6px; width: 16px; height: 16px; color: var(--fd-map-on); }\n.fd-map-face[data-look=\"pin\"] .fd-map-face-icon:empty { left: 10px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--fd-map-on); }\n.fd-map-face[data-look=\"icon\"] {\n width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;\n background: var(--fd-map-tone); color: var(--fd-map-on); border: 2px solid var(--fd-surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);\n}\n.fd-map-face[data-look=\"icon\"] .fd-map-face-icon { width: 20px; height: 20px; }\n.fd-map-face-turn { position: absolute; inset: -9px; pointer-events: none; }\n.fd-map-face-turn::before { content: \"\"; position: absolute; left: 50%; top: 0; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 7px solid var(--fd-map-tone); }\n.fd-map-face-photo {\n display: grid; place-items: center; width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%; object-fit: cover;\n border: 3px solid var(--fd-map-tone); background: var(--fd-fill); color: var(--fd-muted); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);\n}\nspan.fd-map-face-photo svg { width: 22px; height: 22px; }\n.fd-map-face[data-look=\"photo\"] .fd-map-face-text {\n position: absolute; top: calc(100% + 2px); left: 50%; translate: -50% 0; max-width: 14ch; padding: 1px 6px; border-radius: 999px;\n font-size: 12px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n}\n.fd-map-face[data-look=\"dot\"] { width: 16px; height: 16px; border-radius: 50%; background: var(--fd-map-tone); border: 2px solid var(--fd-surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }\n.fd-map-face:is([data-look=\"icon\"], [data-look=\"dot\"])[data-chosen], .fd-map-face[data-chosen] .fd-map-face-photo { box-shadow: 0 0 0 2px var(--fd-surface), 0 0 0 4px var(--fd-map-tone); }\n.fd-map-face[data-chosen]::before, .fd-map-bubble[data-chosen]::before {\n content: \"\u2713\"; position: absolute; top: -7px; right: -7px; z-index: 1; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;\n display: grid; place-items: center; font: 700 10px/1 system-ui, sans-serif; background: var(--fd-accent); color: var(--fd-accent-text); border: 1.5px solid var(--fd-surface);\n}\n.fd-map-bubble {\n position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;\n background: var(--fd-accent); color: var(--fd-accent-text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; transition: scale 0.12s;\n box-shadow: 0 0 0 5px color-mix(in srgb, var(--fd-accent) 30%, transparent), 0 1px 4px rgba(0, 0, 0, 0.3);\n}\n.fd-map-bubble[data-size=\"m\"] { width: 40px; height: 40px; }\n.fd-map-bubble[data-size=\"l\"] { width: 48px; height: 48px; }\n.fd-map-card-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 10px; overflow: hidden; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24); }\n.fd-map-card-popup .leaflet-popup-content { margin: 0; font: inherit; font-size: 14px; line-height: 1.4; }\n.fd-map-card-popup .leaflet-popup-tip { background: var(--fd-surface); }\n.fd-map-card { display: grid; }\n.fd-map-card-image { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--fd-fill); }\n.fd-map-card-body { display: grid; gap: 8px; padding: 10px 12px 12px; }\n.fd-map-card-head { display: flex; align-items: flex-start; gap: 8px; }\n.fd-map-card-title { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }\n.fd-map-card-close {\n flex: none; width: 28px; height: 28px; margin: -4px -6px -4px 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;\n background: transparent; color: var(--fd-muted); font: 400 20px/1 system-ui, sans-serif; cursor: pointer;\n}\n.fd-map-card[dir=\"rtl\"] .fd-map-card-close { margin: -4px 0 -4px -6px; }\n.fd-map-card-close:hover { background: var(--fd-fill); color: var(--fd-text); }\n.fd-map-card-fields { margin: 0; display: grid; gap: 3px; font-size: 13px; }\n.fd-map-card-fields div { display: flex; justify-content: space-between; gap: 10px; }\n.fd-map-card-fields dt { color: var(--fd-muted); }\n.fd-map-card-fields dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }\n.fd-map-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }\n.fd-map-card-choose { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; margin-inline-end: auto; }\n.fd-map-card-choose input { width: 16px; height: 16px; margin: 0; accent-color: var(--fd-accent); }\n.fd-map-card .fd-button { min-height: 30px; padding-inline: 14px; }\n.fd-map-card :focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }\n.fd-map-crowd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 220px; overflow: auto; }\n.fd-map-crowd-item { width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; text-align: start; background: transparent; color: var(--fd-text); font: inherit; font-size: 13px; cursor: pointer; }\n.fd-map-crowd-item:hover { background: var(--fd-accent-soft); }\n.fd-map-here {\n position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 1000; padding: 7px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer;\n border: 1px solid var(--fd-border); background: var(--fd-surface); color: var(--fd-text); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n}\n.fd-map-here:hover { color: var(--fd-accent); border-color: var(--fd-accent); }\n.fd-map-here:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 2px; }\n/* The map over the table when the list is too narrow for both side by side: shorter, so the table is in reach. */\n@container fd-list (max-width: 860px) { .fd-list[data-view=\"both\"] .fd-map-list .fd-map-box { height: clamp(260px, 46vh, 420px); } }\n.fd-map-ghost .fd-map-face { pointer-events: none; }\n/* The tools that draw an area to search in: at the map's start, the zoom at its end. */\n.fd-map-draw { position: absolute; top: 8px; left: 8px; z-index: 1000; display: grid; gap: 4px; }\n.fd-map-box[data-side=\"left\"] .fd-map-draw { left: auto; right: 8px; }\n.fd-map-draw button {\n width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;\n background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n}\n.fd-map-draw button svg { width: 18px; height: 18px; }\n.fd-map-draw button:hover, .fd-map-draw button[aria-pressed=\"true\"] { color: var(--fd-accent); border-color: var(--fd-accent); }\n.fd-map-draw button[aria-pressed=\"true\"] { background: var(--fd-accent-soft); }\n.fd-map-draw button:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }\n/* While an area is drawn, the pins let every press through to the map. */\n.fd-map-box[data-drawing] .fd-map-mark { pointer-events: none; }\n/* The drawing's bar starts after the tools. */\n.fd-map-list .fd-map-hint { left: 48px; }\n.fd-map-list .fd-map-box[data-side=\"left\"] .fd-map-hint { left: 52px; right: 48px; }\n.fd-map-list-note {\n position: absolute; left: 8px; bottom: 28px; z-index: 1000; max-width: calc(100% - 64px); margin: 0; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; line-height: 1.4;\n background: color-mix(in srgb, var(--fd-surface) 92%, transparent); color: var(--fd-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);\n}\n";
18
+ /** The list map's stylesheet, once per document, after the maps' own. */
19
+ export declare function installListMapStyles(doc: Document): void;
20
+ /**
21
+ * A form's map, on top of a list map's pins and cards: its label, a route
22
+ * (the part travelled faded), a place whose news is old, the Follow button,
23
+ * and the reader's own place with its button.
24
+ */
25
+ export declare const FORM_MAP_CSS = "\n.fd-map-form { display: grid; gap: 6px; min-width: 0; }\n.fd-map-form-label { margin: 0; font-weight: 600; color: var(--fd-text); }\npath.fd-map-route { stroke: var(--fd-accent); stroke-width: 5; stroke-opacity: 0.85; fill: none; stroke-linecap: round; stroke-linejoin: round; }\npath.fd-map-route-done { stroke: var(--fd-muted); stroke-width: 4; stroke-opacity: 0.55; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; }\n.fd-map-face[data-stale] { filter: grayscale(1); opacity: 0.75; }\n.fd-map-face-stale {\n position: absolute; top: calc(100% + 4px); left: 50%; translate: -50% 0; z-index: 1; padding: 1px 6px; border-radius: 999px; white-space: nowrap;\n font-size: 11.5px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);\n}\n.fd-map-face[data-look=\"photo\"] .fd-map-face-stale { top: calc(100% + 26px); }\n.fd-map-here.fd-map-follow { top: auto; bottom: 28px; }\n.fd-map-locate {\n position: absolute; top: 8px; left: 8px; z-index: 1000; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;\n background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n}\n.fd-map-box[data-side=\"left\"] .fd-map-locate { left: auto; right: 8px; }\n.fd-map-locate svg { width: 18px; height: 18px; }\n.fd-map-locate:hover, .fd-map-locate[aria-pressed=\"true\"] { color: var(--fd-accent); border-color: var(--fd-accent); }\n.fd-map-locate[aria-pressed=\"true\"] { background: var(--fd-accent-soft); }\n.fd-map-locate:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }\n.fd-map-me { box-sizing: border-box; border-radius: 50%; background: var(--fd-info); border: 3px solid var(--fd-surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3); }\n";
26
+ /** A form's map's stylesheet, once per document, after a list map's. */
27
+ export declare function installFormMapStyles(doc: Document): void;
package/src/lib/styles.js CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MAP_CSS = void 0;
3
+ exports.FORM_MAP_CSS = exports.LIST_MAP_CSS = exports.MAP_CSS = void 0;
4
4
  exports.installMapStyles = installMapStyles;
5
5
  exports.installLeafletStyles = installLeafletStyles;
6
+ exports.installListMapStyles = installListMapStyles;
7
+ exports.installFormMapStyles = installFormMapStyles;
6
8
  /**
7
9
  * The maps in Fieldia's colours: every colour a token, so a theme, a host's
8
10
  * tokens and the dark scheme reach the map's buttons, search, shapes and
@@ -127,4 +129,182 @@ function installLeafletStyles(doc, css) {
127
129
  else
128
130
  doc.head.prepend(leaflet);
129
131
  }
132
+ /**
133
+ * A list's map, on top of the maps' own: each record's pin in its look and
134
+ * tone, bubbles of pins that crowd, the card a pin opens, "Search this area".
135
+ * Its own stylesheet, so a form with only a place or an area never carries it.
136
+ */
137
+ exports.LIST_MAP_CSS = `
138
+ .fd-map-list { min-width: 0; }
139
+ .fd-map-mark { overflow: visible; }
140
+ .fd-map-mark:focus { outline: none; }
141
+ /* Each mark is as large as its face, stood on its point by its foot, its middle, or the tip of a label's tail. */
142
+ .fd-map-mark.fd-map-foot { translate: -50% -100%; }
143
+ .fd-map-mark.fd-map-middle { translate: -50% -50%; }
144
+ .fd-map-mark.fd-map-tail { translate: -50% calc(-100% - 6px); }
145
+ .fd-map-face {
146
+ --fd-map-tone: var(--fd-accent); --fd-map-on: var(--fd-accent-text);
147
+ position: relative; box-sizing: border-box; cursor: pointer; transition: scale 0.12s;
148
+ }
149
+ .fd-map-face[data-tone] { --fd-map-on: var(--fd-surface); }
150
+ .fd-map-face[data-tone="info"] { --fd-map-tone: var(--fd-info); }
151
+ .fd-map-face[data-tone="success"] { --fd-map-tone: var(--fd-success); }
152
+ .fd-map-face[data-tone="warning"] { --fd-map-tone: var(--fd-warning); }
153
+ .fd-map-face[data-tone="danger"] { --fd-map-tone: var(--fd-error); }
154
+ .fd-map-face[data-tone="muted"] { --fd-map-tone: var(--fd-muted); }
155
+ .fd-map-face[data-stands="foot"] { transform-origin: 50% 100%; }
156
+ .fd-map-face[data-stands="middle"] { transform-origin: 50% 50%; }
157
+ .fd-map-face[data-hot], .fd-map-mark:hover .fd-map-face, .fd-map-bubble[data-hot], .fd-map-mark:hover .fd-map-bubble { scale: 1.12; }
158
+ .fd-map-mark:focus-visible .fd-map-face, .fd-map-mark:focus-visible .fd-map-bubble { outline: 2px solid var(--fd-focus); outline-offset: 3px; }
159
+ .fd-map-face-icon { display: block; }
160
+ .fd-map-face-icon svg { display: block; width: 100%; height: 100%; }
161
+ .fd-map-face[data-look="label"] {
162
+ padding: 4px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1.25; font-variant-numeric: tabular-nums;
163
+ background: var(--fd-surface); color: var(--fd-text); border: 1.5px solid color-mix(in srgb, var(--fd-text) 20%, transparent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
164
+ }
165
+ .fd-map-face[data-look="label"][data-tone] { color: var(--fd-map-tone); border-color: var(--fd-map-tone); }
166
+ .fd-map-face[data-look="label"]::after {
167
+ content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg);
168
+ background: inherit; border: inherit; border-top: 0; border-left: 0;
169
+ }
170
+ .fd-map-face[data-look="label"]:is([data-hot], [data-chosen]), .fd-map-mark:hover .fd-map-face[data-look="label"] { background: var(--fd-map-tone); color: var(--fd-map-on); border-color: var(--fd-map-tone); }
171
+ .fd-map-face-text { display: block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
172
+ .fd-map-face[data-look="pin"] { width: 30px; height: 40px; }
173
+ .fd-map-face[data-look="pin"] > svg { display: block; width: 30px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
174
+ .fd-map-face-body { fill: var(--fd-map-tone); stroke: var(--fd-surface); stroke-width: 1.5; }
175
+ .fd-map-face[data-look="pin"] .fd-map-face-icon { position: absolute; left: 7px; top: 6px; width: 16px; height: 16px; color: var(--fd-map-on); }
176
+ .fd-map-face[data-look="pin"] .fd-map-face-icon:empty { left: 10px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--fd-map-on); }
177
+ .fd-map-face[data-look="icon"] {
178
+ width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
179
+ background: var(--fd-map-tone); color: var(--fd-map-on); border: 2px solid var(--fd-surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
180
+ }
181
+ .fd-map-face[data-look="icon"] .fd-map-face-icon { width: 20px; height: 20px; }
182
+ .fd-map-face-turn { position: absolute; inset: -9px; pointer-events: none; }
183
+ .fd-map-face-turn::before { content: ""; position: absolute; left: 50%; top: 0; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 7px solid var(--fd-map-tone); }
184
+ .fd-map-face-photo {
185
+ display: grid; place-items: center; width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%; object-fit: cover;
186
+ border: 3px solid var(--fd-map-tone); background: var(--fd-fill); color: var(--fd-muted); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
187
+ }
188
+ span.fd-map-face-photo svg { width: 22px; height: 22px; }
189
+ .fd-map-face[data-look="photo"] .fd-map-face-text {
190
+ position: absolute; top: calc(100% + 2px); left: 50%; translate: -50% 0; max-width: 14ch; padding: 1px 6px; border-radius: 999px;
191
+ font-size: 12px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
192
+ }
193
+ .fd-map-face[data-look="dot"] { width: 16px; height: 16px; border-radius: 50%; background: var(--fd-map-tone); border: 2px solid var(--fd-surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
194
+ .fd-map-face:is([data-look="icon"], [data-look="dot"])[data-chosen], .fd-map-face[data-chosen] .fd-map-face-photo { box-shadow: 0 0 0 2px var(--fd-surface), 0 0 0 4px var(--fd-map-tone); }
195
+ .fd-map-face[data-chosen]::before, .fd-map-bubble[data-chosen]::before {
196
+ content: "✓"; position: absolute; top: -7px; right: -7px; z-index: 1; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
197
+ display: grid; place-items: center; font: 700 10px/1 system-ui, sans-serif; background: var(--fd-accent); color: var(--fd-accent-text); border: 1.5px solid var(--fd-surface);
198
+ }
199
+ .fd-map-bubble {
200
+ position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
201
+ background: var(--fd-accent); color: var(--fd-accent-text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; transition: scale 0.12s;
202
+ box-shadow: 0 0 0 5px color-mix(in srgb, var(--fd-accent) 30%, transparent), 0 1px 4px rgba(0, 0, 0, 0.3);
203
+ }
204
+ .fd-map-bubble[data-size="m"] { width: 40px; height: 40px; }
205
+ .fd-map-bubble[data-size="l"] { width: 48px; height: 48px; }
206
+ .fd-map-card-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 10px; overflow: hidden; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24); }
207
+ .fd-map-card-popup .leaflet-popup-content { margin: 0; font: inherit; font-size: 14px; line-height: 1.4; }
208
+ .fd-map-card-popup .leaflet-popup-tip { background: var(--fd-surface); }
209
+ .fd-map-card { display: grid; }
210
+ .fd-map-card-image { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--fd-fill); }
211
+ .fd-map-card-body { display: grid; gap: 8px; padding: 10px 12px 12px; }
212
+ .fd-map-card-head { display: flex; align-items: flex-start; gap: 8px; }
213
+ .fd-map-card-title { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
214
+ .fd-map-card-close {
215
+ flex: none; width: 28px; height: 28px; margin: -4px -6px -4px 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
216
+ background: transparent; color: var(--fd-muted); font: 400 20px/1 system-ui, sans-serif; cursor: pointer;
217
+ }
218
+ .fd-map-card[dir="rtl"] .fd-map-card-close { margin: -4px 0 -4px -6px; }
219
+ .fd-map-card-close:hover { background: var(--fd-fill); color: var(--fd-text); }
220
+ .fd-map-card-fields { margin: 0; display: grid; gap: 3px; font-size: 13px; }
221
+ .fd-map-card-fields div { display: flex; justify-content: space-between; gap: 10px; }
222
+ .fd-map-card-fields dt { color: var(--fd-muted); }
223
+ .fd-map-card-fields dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
224
+ .fd-map-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
225
+ .fd-map-card-choose { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; margin-inline-end: auto; }
226
+ .fd-map-card-choose input { width: 16px; height: 16px; margin: 0; accent-color: var(--fd-accent); }
227
+ .fd-map-card .fd-button { min-height: 30px; padding-inline: 14px; }
228
+ .fd-map-card :focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }
229
+ .fd-map-crowd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 220px; overflow: auto; }
230
+ .fd-map-crowd-item { width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; text-align: start; background: transparent; color: var(--fd-text); font: inherit; font-size: 13px; cursor: pointer; }
231
+ .fd-map-crowd-item:hover { background: var(--fd-accent-soft); }
232
+ .fd-map-here {
233
+ position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 1000; padding: 7px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer;
234
+ border: 1px solid var(--fd-border); background: var(--fd-surface); color: var(--fd-text); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
235
+ }
236
+ .fd-map-here:hover { color: var(--fd-accent); border-color: var(--fd-accent); }
237
+ .fd-map-here:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 2px; }
238
+ /* The map over the table when the list is too narrow for both side by side: shorter, so the table is in reach. */
239
+ @container fd-list (max-width: 860px) { .fd-list[data-view="both"] .fd-map-list .fd-map-box { height: clamp(260px, 46vh, 420px); } }
240
+ .fd-map-ghost .fd-map-face { pointer-events: none; }
241
+ /* The tools that draw an area to search in: at the map's start, the zoom at its end. */
242
+ .fd-map-draw { position: absolute; top: 8px; left: 8px; z-index: 1000; display: grid; gap: 4px; }
243
+ .fd-map-box[data-side="left"] .fd-map-draw { left: auto; right: 8px; }
244
+ .fd-map-draw button {
245
+ width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;
246
+ background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
247
+ }
248
+ .fd-map-draw button svg { width: 18px; height: 18px; }
249
+ .fd-map-draw button:hover, .fd-map-draw button[aria-pressed="true"] { color: var(--fd-accent); border-color: var(--fd-accent); }
250
+ .fd-map-draw button[aria-pressed="true"] { background: var(--fd-accent-soft); }
251
+ .fd-map-draw button:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }
252
+ /* While an area is drawn, the pins let every press through to the map. */
253
+ .fd-map-box[data-drawing] .fd-map-mark { pointer-events: none; }
254
+ /* The drawing's bar starts after the tools. */
255
+ .fd-map-list .fd-map-hint { left: 48px; }
256
+ .fd-map-list .fd-map-box[data-side="left"] .fd-map-hint { left: 52px; right: 48px; }
257
+ .fd-map-list-note {
258
+ position: absolute; left: 8px; bottom: 28px; z-index: 1000; max-width: calc(100% - 64px); margin: 0; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; line-height: 1.4;
259
+ background: color-mix(in srgb, var(--fd-surface) 92%, transparent); color: var(--fd-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
260
+ }
261
+ `;
262
+ /** The list map's stylesheet, once per document, after the maps' own. */
263
+ function installListMapStyles(doc) {
264
+ installMapStyles(doc);
265
+ if (doc.getElementById('fieldia-list-map-styles'))
266
+ return;
267
+ const own = doc.createElement('style');
268
+ own.id = 'fieldia-list-map-styles';
269
+ own.textContent = exports.LIST_MAP_CSS;
270
+ doc.getElementById('fieldia-map-styles')?.after(own);
271
+ }
272
+ /**
273
+ * A form's map, on top of a list map's pins and cards: its label, a route
274
+ * (the part travelled faded), a place whose news is old, the Follow button,
275
+ * and the reader's own place with its button.
276
+ */
277
+ exports.FORM_MAP_CSS = `
278
+ .fd-map-form { display: grid; gap: 6px; min-width: 0; }
279
+ .fd-map-form-label { margin: 0; font-weight: 600; color: var(--fd-text); }
280
+ path.fd-map-route { stroke: var(--fd-accent); stroke-width: 5; stroke-opacity: 0.85; fill: none; stroke-linecap: round; stroke-linejoin: round; }
281
+ path.fd-map-route-done { stroke: var(--fd-muted); stroke-width: 4; stroke-opacity: 0.55; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; }
282
+ .fd-map-face[data-stale] { filter: grayscale(1); opacity: 0.75; }
283
+ .fd-map-face-stale {
284
+ position: absolute; top: calc(100% + 4px); left: 50%; translate: -50% 0; z-index: 1; padding: 1px 6px; border-radius: 999px; white-space: nowrap;
285
+ font-size: 11.5px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
286
+ }
287
+ .fd-map-face[data-look="photo"] .fd-map-face-stale { top: calc(100% + 26px); }
288
+ .fd-map-here.fd-map-follow { top: auto; bottom: 28px; }
289
+ .fd-map-locate {
290
+ position: absolute; top: 8px; left: 8px; z-index: 1000; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;
291
+ background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
292
+ }
293
+ .fd-map-box[data-side="left"] .fd-map-locate { left: auto; right: 8px; }
294
+ .fd-map-locate svg { width: 18px; height: 18px; }
295
+ .fd-map-locate:hover, .fd-map-locate[aria-pressed="true"] { color: var(--fd-accent); border-color: var(--fd-accent); }
296
+ .fd-map-locate[aria-pressed="true"] { background: var(--fd-accent-soft); }
297
+ .fd-map-locate:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }
298
+ .fd-map-me { box-sizing: border-box; border-radius: 50%; background: var(--fd-info); border: 3px solid var(--fd-surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3); }
299
+ `;
300
+ /** A form's map's stylesheet, once per document, after a list map's. */
301
+ function installFormMapStyles(doc) {
302
+ installListMapStyles(doc);
303
+ if (doc.getElementById('fieldia-form-map-styles'))
304
+ return;
305
+ const own = doc.createElement('style');
306
+ own.id = 'fieldia-form-map-styles';
307
+ own.textContent = exports.FORM_MAP_CSS;
308
+ doc.getElementById('fieldia-list-map-styles')?.after(own);
309
+ }
130
310
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../libs/map/src/lib/styles.ts"],"names":[],"mappings":";;;AAuGA,4CAOC;AAGD,oDAQC;AAzHD;;;;;GAKG;AACU,QAAA,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FtB,CAAC;AAEF,0HAA0H;AAC1H,SAAgB,gBAAgB,CAAC,GAAa;IAC5C,IAAI,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC;QAAE,OAAO;IACrD,MAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,GAAG,oBAAoB,CAAC;IAC9B,GAAG,CAAC,WAAW,GAAG,eAAO,CAAC;IAC1B,4EAA4E;IAC5E,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,8GAA8G;AAC9G,SAAgB,oBAAoB,CAAC,GAAa,EAAE,GAAW;IAC7D,IAAI,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC;QAAE,OAAO;IACzD,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAA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C,cAAc,CAAC,yBAAyB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AAC5D,CAAC"}
@@ -122,4 +122,182 @@ export function installLeafletStyles(doc, css) {
122
122
  else
123
123
  doc.head.prepend(leaflet);
124
124
  }
125
+ /**
126
+ * A list's map, on top of the maps' own: each record's pin in its look and
127
+ * tone, bubbles of pins that crowd, the card a pin opens, "Search this area".
128
+ * Its own stylesheet, so a form with only a place or an area never carries it.
129
+ */
130
+ export const LIST_MAP_CSS = `
131
+ .fd-map-list { min-width: 0; }
132
+ .fd-map-mark { overflow: visible; }
133
+ .fd-map-mark:focus { outline: none; }
134
+ /* Each mark is as large as its face, stood on its point by its foot, its middle, or the tip of a label's tail. */
135
+ .fd-map-mark.fd-map-foot { translate: -50% -100%; }
136
+ .fd-map-mark.fd-map-middle { translate: -50% -50%; }
137
+ .fd-map-mark.fd-map-tail { translate: -50% calc(-100% - 6px); }
138
+ .fd-map-face {
139
+ --fd-map-tone: var(--fd-accent); --fd-map-on: var(--fd-accent-text);
140
+ position: relative; box-sizing: border-box; cursor: pointer; transition: scale 0.12s;
141
+ }
142
+ .fd-map-face[data-tone] { --fd-map-on: var(--fd-surface); }
143
+ .fd-map-face[data-tone="info"] { --fd-map-tone: var(--fd-info); }
144
+ .fd-map-face[data-tone="success"] { --fd-map-tone: var(--fd-success); }
145
+ .fd-map-face[data-tone="warning"] { --fd-map-tone: var(--fd-warning); }
146
+ .fd-map-face[data-tone="danger"] { --fd-map-tone: var(--fd-error); }
147
+ .fd-map-face[data-tone="muted"] { --fd-map-tone: var(--fd-muted); }
148
+ .fd-map-face[data-stands="foot"] { transform-origin: 50% 100%; }
149
+ .fd-map-face[data-stands="middle"] { transform-origin: 50% 50%; }
150
+ .fd-map-face[data-hot], .fd-map-mark:hover .fd-map-face, .fd-map-bubble[data-hot], .fd-map-mark:hover .fd-map-bubble { scale: 1.12; }
151
+ .fd-map-mark:focus-visible .fd-map-face, .fd-map-mark:focus-visible .fd-map-bubble { outline: 2px solid var(--fd-focus); outline-offset: 3px; }
152
+ .fd-map-face-icon { display: block; }
153
+ .fd-map-face-icon svg { display: block; width: 100%; height: 100%; }
154
+ .fd-map-face[data-look="label"] {
155
+ padding: 4px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; line-height: 1.25; font-variant-numeric: tabular-nums;
156
+ background: var(--fd-surface); color: var(--fd-text); border: 1.5px solid color-mix(in srgb, var(--fd-text) 20%, transparent); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
157
+ }
158
+ .fd-map-face[data-look="label"][data-tone] { color: var(--fd-map-tone); border-color: var(--fd-map-tone); }
159
+ .fd-map-face[data-look="label"]::after {
160
+ content: ""; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg);
161
+ background: inherit; border: inherit; border-top: 0; border-left: 0;
162
+ }
163
+ .fd-map-face[data-look="label"]:is([data-hot], [data-chosen]), .fd-map-mark:hover .fd-map-face[data-look="label"] { background: var(--fd-map-tone); color: var(--fd-map-on); border-color: var(--fd-map-tone); }
164
+ .fd-map-face-text { display: block; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
165
+ .fd-map-face[data-look="pin"] { width: 30px; height: 40px; }
166
+ .fd-map-face[data-look="pin"] > svg { display: block; width: 30px; height: 40px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3)); }
167
+ .fd-map-face-body { fill: var(--fd-map-tone); stroke: var(--fd-surface); stroke-width: 1.5; }
168
+ .fd-map-face[data-look="pin"] .fd-map-face-icon { position: absolute; left: 7px; top: 6px; width: 16px; height: 16px; color: var(--fd-map-on); }
169
+ .fd-map-face[data-look="pin"] .fd-map-face-icon:empty { left: 10px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--fd-map-on); }
170
+ .fd-map-face[data-look="icon"] {
171
+ width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
172
+ background: var(--fd-map-tone); color: var(--fd-map-on); border: 2px solid var(--fd-surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
173
+ }
174
+ .fd-map-face[data-look="icon"] .fd-map-face-icon { width: 20px; height: 20px; }
175
+ .fd-map-face-turn { position: absolute; inset: -9px; pointer-events: none; }
176
+ .fd-map-face-turn::before { content: ""; position: absolute; left: 50%; top: 0; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 7px solid var(--fd-map-tone); }
177
+ .fd-map-face-photo {
178
+ display: grid; place-items: center; width: 40px; height: 40px; box-sizing: border-box; border-radius: 50%; object-fit: cover;
179
+ border: 3px solid var(--fd-map-tone); background: var(--fd-fill); color: var(--fd-muted); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
180
+ }
181
+ span.fd-map-face-photo svg { width: 22px; height: 22px; }
182
+ .fd-map-face[data-look="photo"] .fd-map-face-text {
183
+ position: absolute; top: calc(100% + 2px); left: 50%; translate: -50% 0; max-width: 14ch; padding: 1px 6px; border-radius: 999px;
184
+ font-size: 12px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
185
+ }
186
+ .fd-map-face[data-look="dot"] { width: 16px; height: 16px; border-radius: 50%; background: var(--fd-map-tone); border: 2px solid var(--fd-surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
187
+ .fd-map-face:is([data-look="icon"], [data-look="dot"])[data-chosen], .fd-map-face[data-chosen] .fd-map-face-photo { box-shadow: 0 0 0 2px var(--fd-surface), 0 0 0 4px var(--fd-map-tone); }
188
+ .fd-map-face[data-chosen]::before, .fd-map-bubble[data-chosen]::before {
189
+ content: "✓"; position: absolute; top: -7px; right: -7px; z-index: 1; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
190
+ display: grid; place-items: center; font: 700 10px/1 system-ui, sans-serif; background: var(--fd-accent); color: var(--fd-accent-text); border: 1.5px solid var(--fd-surface);
191
+ }
192
+ .fd-map-bubble {
193
+ position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
194
+ background: var(--fd-accent); color: var(--fd-accent-text); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; transition: scale 0.12s;
195
+ box-shadow: 0 0 0 5px color-mix(in srgb, var(--fd-accent) 30%, transparent), 0 1px 4px rgba(0, 0, 0, 0.3);
196
+ }
197
+ .fd-map-bubble[data-size="m"] { width: 40px; height: 40px; }
198
+ .fd-map-bubble[data-size="l"] { width: 48px; height: 48px; }
199
+ .fd-map-card-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 10px; overflow: hidden; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.24); }
200
+ .fd-map-card-popup .leaflet-popup-content { margin: 0; font: inherit; font-size: 14px; line-height: 1.4; }
201
+ .fd-map-card-popup .leaflet-popup-tip { background: var(--fd-surface); }
202
+ .fd-map-card { display: grid; }
203
+ .fd-map-card-image { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--fd-fill); }
204
+ .fd-map-card-body { display: grid; gap: 8px; padding: 10px 12px 12px; }
205
+ .fd-map-card-head { display: flex; align-items: flex-start; gap: 8px; }
206
+ .fd-map-card-title { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
207
+ .fd-map-card-close {
208
+ flex: none; width: 28px; height: 28px; margin: -4px -6px -4px 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
209
+ background: transparent; color: var(--fd-muted); font: 400 20px/1 system-ui, sans-serif; cursor: pointer;
210
+ }
211
+ .fd-map-card[dir="rtl"] .fd-map-card-close { margin: -4px 0 -4px -6px; }
212
+ .fd-map-card-close:hover { background: var(--fd-fill); color: var(--fd-text); }
213
+ .fd-map-card-fields { margin: 0; display: grid; gap: 3px; font-size: 13px; }
214
+ .fd-map-card-fields div { display: flex; justify-content: space-between; gap: 10px; }
215
+ .fd-map-card-fields dt { color: var(--fd-muted); }
216
+ .fd-map-card-fields dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
217
+ .fd-map-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
218
+ .fd-map-card-choose { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; margin-inline-end: auto; }
219
+ .fd-map-card-choose input { width: 16px; height: 16px; margin: 0; accent-color: var(--fd-accent); }
220
+ .fd-map-card .fd-button { min-height: 30px; padding-inline: 14px; }
221
+ .fd-map-card :focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }
222
+ .fd-map-crowd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 220px; overflow: auto; }
223
+ .fd-map-crowd-item { width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; text-align: start; background: transparent; color: var(--fd-text); font: inherit; font-size: 13px; cursor: pointer; }
224
+ .fd-map-crowd-item:hover { background: var(--fd-accent-soft); }
225
+ .fd-map-here {
226
+ position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 1000; padding: 7px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer;
227
+ border: 1px solid var(--fd-border); background: var(--fd-surface); color: var(--fd-text); font: inherit; font-size: 13.5px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
228
+ }
229
+ .fd-map-here:hover { color: var(--fd-accent); border-color: var(--fd-accent); }
230
+ .fd-map-here:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 2px; }
231
+ /* The map over the table when the list is too narrow for both side by side: shorter, so the table is in reach. */
232
+ @container fd-list (max-width: 860px) { .fd-list[data-view="both"] .fd-map-list .fd-map-box { height: clamp(260px, 46vh, 420px); } }
233
+ .fd-map-ghost .fd-map-face { pointer-events: none; }
234
+ /* The tools that draw an area to search in: at the map's start, the zoom at its end. */
235
+ .fd-map-draw { position: absolute; top: 8px; left: 8px; z-index: 1000; display: grid; gap: 4px; }
236
+ .fd-map-box[data-side="left"] .fd-map-draw { left: auto; right: 8px; }
237
+ .fd-map-draw button {
238
+ width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;
239
+ background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
240
+ }
241
+ .fd-map-draw button svg { width: 18px; height: 18px; }
242
+ .fd-map-draw button:hover, .fd-map-draw button[aria-pressed="true"] { color: var(--fd-accent); border-color: var(--fd-accent); }
243
+ .fd-map-draw button[aria-pressed="true"] { background: var(--fd-accent-soft); }
244
+ .fd-map-draw button:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }
245
+ /* While an area is drawn, the pins let every press through to the map. */
246
+ .fd-map-box[data-drawing] .fd-map-mark { pointer-events: none; }
247
+ /* The drawing's bar starts after the tools. */
248
+ .fd-map-list .fd-map-hint { left: 48px; }
249
+ .fd-map-list .fd-map-box[data-side="left"] .fd-map-hint { left: 52px; right: 48px; }
250
+ .fd-map-list-note {
251
+ position: absolute; left: 8px; bottom: 28px; z-index: 1000; max-width: calc(100% - 64px); margin: 0; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; line-height: 1.4;
252
+ background: color-mix(in srgb, var(--fd-surface) 92%, transparent); color: var(--fd-text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
253
+ }
254
+ `;
255
+ /** The list map's stylesheet, once per document, after the maps' own. */
256
+ export function installListMapStyles(doc) {
257
+ installMapStyles(doc);
258
+ if (doc.getElementById('fieldia-list-map-styles'))
259
+ return;
260
+ const own = doc.createElement('style');
261
+ own.id = 'fieldia-list-map-styles';
262
+ own.textContent = LIST_MAP_CSS;
263
+ doc.getElementById('fieldia-map-styles')?.after(own);
264
+ }
265
+ /**
266
+ * A form's map, on top of a list map's pins and cards: its label, a route
267
+ * (the part travelled faded), a place whose news is old, the Follow button,
268
+ * and the reader's own place with its button.
269
+ */
270
+ export const FORM_MAP_CSS = `
271
+ .fd-map-form { display: grid; gap: 6px; min-width: 0; }
272
+ .fd-map-form-label { margin: 0; font-weight: 600; color: var(--fd-text); }
273
+ path.fd-map-route { stroke: var(--fd-accent); stroke-width: 5; stroke-opacity: 0.85; fill: none; stroke-linecap: round; stroke-linejoin: round; }
274
+ path.fd-map-route-done { stroke: var(--fd-muted); stroke-width: 4; stroke-opacity: 0.55; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; }
275
+ .fd-map-face[data-stale] { filter: grayscale(1); opacity: 0.75; }
276
+ .fd-map-face-stale {
277
+ position: absolute; top: calc(100% + 4px); left: 50%; translate: -50% 0; z-index: 1; padding: 1px 6px; border-radius: 999px; white-space: nowrap;
278
+ font-size: 11.5px; font-weight: 600; background: var(--fd-surface); color: var(--fd-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
279
+ }
280
+ .fd-map-face[data-look="photo"] .fd-map-face-stale { top: calc(100% + 26px); }
281
+ .fd-map-here.fd-map-follow { top: auto; bottom: 28px; }
282
+ .fd-map-locate {
283
+ position: absolute; top: 8px; left: 8px; z-index: 1000; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer;
284
+ background: var(--fd-surface); color: var(--fd-text); border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
285
+ }
286
+ .fd-map-box[data-side="left"] .fd-map-locate { left: auto; right: 8px; }
287
+ .fd-map-locate svg { width: 18px; height: 18px; }
288
+ .fd-map-locate:hover, .fd-map-locate[aria-pressed="true"] { color: var(--fd-accent); border-color: var(--fd-accent); }
289
+ .fd-map-locate[aria-pressed="true"] { background: var(--fd-accent-soft); }
290
+ .fd-map-locate:focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 1px; }
291
+ .fd-map-me { box-sizing: border-box; border-radius: 50%; background: var(--fd-info); border: 3px solid var(--fd-surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.3); }
292
+ `;
293
+ /** A form's map's stylesheet, once per document, after a list map's. */
294
+ export function installFormMapStyles(doc) {
295
+ installListMapStyles(doc);
296
+ if (doc.getElementById('fieldia-form-map-styles'))
297
+ return;
298
+ const own = doc.createElement('style');
299
+ own.id = 'fieldia-form-map-styles';
300
+ own.textContent = FORM_MAP_CSS;
301
+ doc.getElementById('fieldia-list-map-styles')?.after(own);
302
+ }
125
303
  //# sourceMappingURL=styles.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.mjs","sourceRoot":"","sources":["../../../../../libs/map/src/lib/styles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FtB,CAAC;AAEF,0HAA0H;AAC1H,MAAM,UAAU,gBAAgB,CAAC,GAAa;IAC5C,IAAI,GAAG,CAAC,cAAc,CAAC,oBAAoB,CAAC;QAAE,OAAO;IACrD,MAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACvC,GAAG,CAAC,EAAE,GAAG,oBAAoB,CAAC;IAC9B,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC;IAC1B,4EAA4E;IAC5E,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,oBAAoB,CAAC,GAAa,EAAE,GAAW;IAC7D,IAAI,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC;QAAE,OAAO;IACzD,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,GAAG,wBAAwB,CAAC;IACtC,OAAO,CAAC,WAAW,GAAG,GAAG,CAAC;IAC1B,MA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