@7365admin1/layer-common 4.35.1-staging.411 → 4.35.1-staging.412

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.
@@ -809,8 +809,10 @@
809
809
  .hero-detail__main { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 20px; align-items: start; }
810
810
  .hero-detail__main--single { grid-template-columns: minmax(0, 1fr); }
811
811
  .hero-detail__cam, .hero-detail__map { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
812
- .hero-detail__main .hero-plan--detail { max-height: 280px; }
813
- .hero-detail__main--single .hero-plan--detail { max-height: 360px; }
812
+ .hero-detail__top { scroll-margin-top: 72px; }
813
+ .hero-detail__main { --hero-plan-max: 280px; }
814
+ .hero-detail__main--single { --hero-plan-max: 360px; }
815
+ .hero-detail__main .hero-plan--detail { max-height: var(--hero-plan-max); }
814
816
  .hero-detail__main .hero-livepanel .hero-dialog__actions:empty { display: none; }
815
817
  .hero-detail__commands { border-top: 2px solid var(--hero-divider); padding-top: 10px; }
816
818
  .hero-detail__alertcode { color: var(--hero-accent); }
@@ -8,7 +8,7 @@
8
8
  runs -> this robot's alerts -> "What this robot can do" folded at the bottom.
9
9
  No camera: the map takes the full width. Narrow: camera, map, commands, patrol.
10
10
  -->
11
- <div>
11
+ <div ref="topEl" class="hero-detail__top">
12
12
  <button type="button" class="hero-back hero-back--sm" @click="emit('back')">‹ {{ backLabel || `${record?.site?.name || "Site"} fleet` }}</button>
13
13
  <div class="hero-detail__title hero-detail__title--main">
14
14
  <h2>{{ record?.name ?? "Robot" }}</h2>
@@ -332,6 +332,7 @@ const {
332
332
  } = useRobots();
333
333
 
334
334
  const record = ref<Record<string, any> | null>(null);
335
+ const topEl = ref<HTMLElement | null>(null);
335
336
  const brands = ref<Array<Record<string, any>>>([]);
336
337
  const error = ref("");
337
338
  const toast = ref("");
@@ -745,6 +746,8 @@ watch(
745
746
  runsLoaded.value = false;
746
747
  siteAlerts.value = [];
747
748
  await loadRecord();
749
+ // Open with the robot's header at the top, so camera + map are on screen (the Super Admin page has pickers above).
750
+ topEl.value?.scrollIntoView?.({ block: "start" });
748
751
  loadSchedule();
749
752
  loadMaps();
750
753
  loadAlerts();
@@ -35,11 +35,11 @@ const props = defineProps<{
35
35
  /** That image's width / height, so the plan keeps its shape. */
36
36
  aspect?: number | null;
37
37
  }>();
38
- /** The image's own shape; the detail plan's 440 px height cap narrows the width instead of squashing it. */
38
+ /** The image's own shape; the detail plan's height cap (--hero-plan-max, 440 px) narrows the width instead of squashing it. */
39
39
  const frameStyle = computed(() => {
40
40
  const a = props.image && props.aspect && Number.isFinite(props.aspect) && props.aspect > 0 ? props.aspect : null;
41
41
  if (!a) return undefined;
42
- return { aspectRatio: String(a), ...(props.detail ? { width: `min(100%, ${Math.round(440 * a)}px)`, maxHeight: "none", marginInline: "auto" } : {}) };
42
+ return { aspectRatio: String(a), ...(props.detail ? { width: `min(100%, calc(var(--hero-plan-max, 440px) * ${a.toFixed(4)}))`, maxHeight: "none", marginInline: "auto" } : {}) };
43
43
  });
44
44
  const emit = defineEmits<{ pick: [point: { x: number; y: number }] }>();
45
45
  const root = ref<HTMLElement | null>(null);
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.411",
5
+ "version": "4.35.1-staging.412",
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.",