@7365admin1/layer-common 4.35.1-staging.407 → 4.35.1-staging.408

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.
@@ -829,6 +829,8 @@
829
829
  .hero-me { position: absolute; width: 0; height: 0; }
830
830
  .hero-me__tag { position: absolute; left: 14px; top: -26px; white-space: nowrap; font-size: 11px; font-weight: 800; padding: 2px 6px; background: var(--hero-text); color: var(--hero-bg); line-height: 1.45; }
831
831
  .hero-me__tag > span { font-weight: 400; opacity: 0.75; }
832
+ .hero-me__tag--left { left: auto; right: 14px; }
833
+ .hero-me__tag--below { top: 14px; }
832
834
  .hero-me__radar {
833
835
  position: absolute;
834
836
  left: -36px;
@@ -1009,6 +1011,8 @@
1009
1011
  box-shadow: var(--hero-shadow-sm);
1010
1012
  cursor: pointer;
1011
1013
  }
1014
+ /* Near the plan's right edge the name sits to the pin's left (nameTagSide) - never clipped. */
1015
+ .hero .hero-bmap__name--left { left: auto; right: 6px; transform-origin: 100% 0; border-left: 0; border-right: 3px solid var(--hero-bot); }
1012
1016
  .hero-bmap__floorlabel { position: absolute; left: -14px; top: 50%; transform-origin: 0 0; font-size: 12px; font-weight: 800; padding: 1px 6px; background: var(--hero-text); color: var(--hero-bg); white-space: nowrap; }
1013
1017
  .hero-bmap__shaft { position: absolute; width: 0; height: 0; transform-style: preserve-3d; transition: opacity 0.6s ease; }
1014
1018
  .hero-bmap__shaftwall { position: absolute; left: 0; top: 0; box-sizing: border-box; transform-origin: top; transform: rotateX(90deg); background: color-mix(in srgb, var(--hero-accent) 28%, transparent); border: 1px solid var(--hero-accent); }
@@ -172,7 +172,14 @@
172
172
  <span class="hero-bmap__body" aria-hidden="true" />
173
173
  <span class="hero-bmap__pin" :style="{ height: `${look.pinH}px` }" aria-hidden="true" />
174
174
  <span class="hero-bmap__pin hero-bmap__pin--y" :style="{ height: `${look.pinH}px` }" aria-hidden="true" />
175
- <button type="button" class="hero-bmap__name" :style="{ transform: `translateZ(${look.pinZ}px) ${unskew}` }" @click.stop="emit('open', r.id)" @mousedown.stop>
175
+ <button
176
+ type="button"
177
+ class="hero-bmap__name"
178
+ :class="{ 'hero-bmap__name--left': nameTagSide(r.left, r.top, r.name, plane.w, plane.h, BUILDING_TAG).flipX }"
179
+ :style="{ transform: `translateZ(${look.pinZ}px) ${unskew}` }"
180
+ @click.stop="emit('open', r.id)"
181
+ @mousedown.stop
182
+ >
176
183
  {{ r.name }}
177
184
  </button>
178
185
  </div>
@@ -236,6 +243,8 @@ import useRobotLive, { siteStatesFeed } from "../../composables/useRobotLive";
236
243
  import { openDoorNames } from "../../utils/robot-fleet-core";
237
244
  import { robotMapViews, robotMapsByFloor, type TRobotMapView } from "../../utils/robot-maps";
238
245
  import {
246
+ BUILDING_TAG,
247
+ nameTagSide,
239
248
  brandName,
240
249
  floorName,
241
250
  mapFloors,
@@ -20,7 +20,7 @@
20
20
  <span class="hero-cross hero-cross--v" :style="{ left: point.left, transition: `left ${tickMs}ms linear` }" aria-hidden="true" />
21
21
  <div v-if="readout" class="hero-readout">{{ readout }}</div>
22
22
  <div class="hero-me" :class="{ 'hero-me--stale': stale }" :style="{ left: point.left, top: point.top, transition: `left ${tickMs}ms linear, top ${tickMs}ms linear` }">
23
- <div class="hero-me__tag">{{ name }} <span>{{ statusLabel }}</span></div>
23
+ <div class="hero-me__tag" :class="tagClass">{{ name }} <span>{{ statusLabel }}</span></div>
24
24
  <div class="hero-me__radar" aria-hidden="true" />
25
25
  <div class="hero-me__ping" aria-hidden="true" />
26
26
  <div class="hero-me__body" :style="{ transform: `rotate(${heading}deg)` }" aria-hidden="true"><div class="hero-me__tick" /></div>
@@ -35,9 +35,10 @@
35
35
  import RobotFloorPlan from "./FloorPlan.vue";
36
36
  import RobotPatrolRoutes from "./PatrolRoutes.vue";
37
37
  import RobotReconnecting from "./Reconnecting.vue";
38
- import { trailDots, type TPatrolRouteView } from "../../utils/robot-display";
38
+ import { computed } from "vue";
39
+ import { DETAIL_TAG, nameTagSide, trailDots, type TPatrolRouteView } from "../../utils/robot-display";
39
40
 
40
- withDefaults(
41
+ const props = withDefaults(
41
42
  defineProps<{
42
43
  name?: string;
43
44
  statusLabel?: string;
@@ -69,4 +70,10 @@ withDefaults(
69
70
  { stale: false, name: "", statusLabel: "", point: null, heading: 0, trail: () => [], readout: "", lost: false, route: null, routes: null, image: null, aspect: null, points: () => [], routeMoving: false, spot: () => [], pick: false, tickMs: 1200 },
70
71
  );
71
72
  const emit = defineEmits<{ pick: [point: { x: number; y: number }] }>();
73
+ // The tag stays inside the plan (flipped left near the right edge, below near the top) - never clipped.
74
+ const tagClass = computed(() => {
75
+ if (!props.point) return {};
76
+ const side = nameTagSide(props.point.left, props.point.top, `${props.name} ${props.statusLabel}`, 320, 240, DETAIL_TAG);
77
+ return { "hero-me__tag--left": side.flipX, "hero-me__tag--below": side.below };
78
+ });
72
79
  </script>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.35.1-staging.407",
5
+ "version": "4.35.1-staging.408",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -1609,16 +1609,29 @@ export function credentialPatch(
1609
1609
  }
1610
1610
 
1611
1611
  /**
1612
- * Keep a robot's name tag inside the mini-map plan: flip it to the robot's
1613
- * left near the right edge, and below the robot near the top edge.
1614
- * ponytail: width estimated from the text (10px Archivo 600) against the
1615
- * smallest plan (320px wide, 240 tall); measure if a tag must be exact.
1612
+ * Keep a robot's name tag inside its plan (mini-map, building map, robot
1613
+ * detail): flip it to the robot's left near the right edge, and below the
1614
+ * robot near the top edge.
1615
+ * ponytail: width estimated from the text (default 10px Archivo 600: 6.2 px a
1616
+ * character + 8 px padding; `tag` for bigger tags) against the smallest plan
1617
+ * (320px wide, 240 tall); measure if a tag must be exact.
1616
1618
  */
1617
- export function nameTagSide(left: unknown, top: unknown, name: unknown, planW = 320, planH = 240) {
1619
+ export function nameTagSide(
1620
+ left: unknown,
1621
+ top: unknown,
1622
+ name: unknown,
1623
+ planW = 320,
1624
+ planH = 240,
1625
+ tag: { charW?: number; pad?: number; gap?: number; above?: number } = {},
1626
+ ) {
1618
1627
  const pct = (v: unknown) => (typeof v === "string" ? parseFloat(v) : typeof v === "number" ? v : 0) || 0;
1619
- const width = String(name ?? "").length * 6.2 + 8;
1628
+ const width = String(name ?? "").length * (tag.charW ?? 6.2) + (tag.pad ?? 8);
1620
1629
  return {
1621
- flipX: (pct(left) / 100) * planW + 10 + width > planW,
1622
- below: (pct(top) / 100) * planH < 20,
1630
+ flipX: (pct(left) / 100) * planW + (tag.gap ?? 10) + width > planW,
1631
+ below: (pct(top) / 100) * planH < (tag.above ?? 20),
1623
1632
  };
1624
1633
  }
1634
+
1635
+ /** The bigger tags: robot detail's "name + status" (11px 800, 14px from the dot, 26px above) and the building map's name (11px 800). */
1636
+ export const DETAIL_TAG = { charW: 7.4, pad: 12, gap: 14, above: 30 };
1637
+ export const BUILDING_TAG = { charW: 7.4, pad: 13, gap: 6, above: 0 };