@7365admin1/layer-common 4.124.0 → 4.124.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.124.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 3f10a5a: Robot setup: saved point names and the zone editor fill in again (an early watcher hit not-yet-created state - point name boxes were empty).
8
+
3
9
  ## 4.124.0
4
10
 
5
11
  ### Minor Changes
@@ -3264,11 +3270,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3264
3270
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3265
3271
  own rule from two endpoints the console already calls, unprojected:
3266
3272
 
3267
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3268
- GET /api/roles/id/:role that membership's role document
3273
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3274
+ GET /api/roles/id/:role that membership's role document
3269
3275
 
3270
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3271
- staff = member.type === "admin" && role.type === "admin"
3276
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3277
+ staff = member.type === "admin" && role.type === "admin"
3272
3278
 
3273
3279
  `role.default` is the marker because it is the only property of a platform
3274
3280
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -65,13 +65,6 @@ const props = defineProps<{ setup: Record<string, any>; busy?: boolean }>();
65
65
  const emit = defineEmits<{ apply: [change: Record<string, any>, ctx?: { map?: string }] }>();
66
66
 
67
67
  const mapId = ref<string | null>(null);
68
- watch(() => props.setup, (s) => {
69
- if (!mapId.value || !(s.maps ?? []).some((m: any) => m.mapId === mapId.value)) mapId.value = s.currentMapId ?? s.maps?.[0]?.mapId ?? null;
70
- for (const k of Object.keys(names)) delete names[k];
71
- for (const m of s.maps ?? []) for (const p of m.points ?? []) names[p.targetPointId] = p.name;
72
- newName.value = "";
73
- stopPick();
74
- }, { immediate: true });
75
68
  const map = computed(() => (props.setup.maps ?? []).find((m: any) => m.mapId === mapId.value) ?? null);
76
69
  const placed = computed(() => (map.value?.points ?? []).filter((p: any) => p.at).map((p: any) => ({ targetPointId: p.targetPointId, name: p.name, x: p.at.x, y: p.at.y })));
77
70
  const names = reactive<Record<string, string>>({});
@@ -100,6 +93,15 @@ function add(at: "robot" | TShare) {
100
93
  if (!map.value) return;
101
94
  emit("apply", { action: "point-add", mapId: map.value.mapId, name: newName.value.trim(), at, ...yaw() }, { map: map.value.name });
102
95
  }
96
+ // Last: an immediate watcher runs during setup, so everything it touches must already exist.
97
+ watch(() => props.setup, (s) => {
98
+ if (!mapId.value || !(s.maps ?? []).some((m: any) => m.mapId === mapId.value)) mapId.value = s.currentMapId ?? s.maps?.[0]?.mapId ?? null;
99
+ for (const k of Object.keys(names)) delete names[k];
100
+ for (const m of s.maps ?? []) for (const p of m.points ?? []) names[p.targetPointId] = p.name;
101
+ newName.value = "";
102
+ stopPick();
103
+ }, { immediate: true });
104
+
103
105
  function donePick() {
104
106
  if (!picked.value || !map.value) return;
105
107
  const at = { x: Math.round(picked.value.x * 100) / 100, y: Math.round(picked.value.y * 100) / 100 };
@@ -109,7 +109,6 @@ function reset() {
109
109
  wallsDirty.value = slowDirty.value = false;
110
110
  cancelDraw();
111
111
  }
112
- watch(() => props.setup, reset, { immediate: true });
113
112
 
114
113
  /* ---- drawing ---- */
115
114
  const drawing = ref<{ kind: TKind; name: string; target: TDraftShape | null } | null>(null);
@@ -145,6 +144,9 @@ const drawn = computed(() => [
145
144
  ...safe.value.map((z) => ({ kind: "safe" as const, name: z.name, points: z.points })),
146
145
  ]);
147
146
 
147
+ // Last: an immediate watcher runs during setup, so everything reset() touches must already exist.
148
+ watch(() => props.setup, reset, { immediate: true });
149
+
148
150
  function save(kind: "wall" | "slow") {
149
151
  if (!map.value) return;
150
152
  emit("apply", zonesChange(map.value.mapId, kind, kind === "wall" ? loadedWalls.value : loadedSlow.value, kind === "wall" ? walls.value : slow.value), { map: map.value.name });
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.124.0",
5
+ "version": "4.124.1",
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.",