@7365admin1/layer-common 4.35.0 → 4.35.1-staging.371

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 (48) hide show
  1. package/CHANGELOG.md +4 -4
  2. package/assets/css/robot-hero.css +40 -3
  3. package/components/AccessCardAddForm.vue +5 -4
  4. package/components/AccessCardAssignToUnitForm.vue +3 -2
  5. package/components/AccessCardPreviewDialog.vue +4 -3
  6. package/components/Dialog/UpdateMoreAction.vue +11 -1
  7. package/components/DocumentForm.vue +407 -112
  8. package/components/DocumentManagement.vue +213 -12
  9. package/components/EntryPass/QrTemplatePreview.vue +21 -25
  10. package/components/EntryPassInformation.vue +119 -24
  11. package/components/Facility/BookingSetup.vue +63 -0
  12. package/components/HidAccessLogDashboard.vue +41 -8
  13. package/components/HidAccessPermissions.vue +424 -0
  14. package/components/HidIntercomManagement.vue +148 -14
  15. package/components/HidProfileQrCode.vue +332 -0
  16. package/components/HidQrCodeConfiguration.vue +17 -195
  17. package/components/HidReaderManagement.vue +306 -0
  18. package/components/HidReaderUserRoster.vue +44 -3
  19. package/components/HidUserEnrollment.vue +845 -155
  20. package/components/InvitationClientForm.vue +19 -1
  21. package/components/Robot/MapEditor.vue +313 -56
  22. package/components/VisitorForm.vue +12 -0
  23. package/components/VisitorManagement.vue +267 -5
  24. package/composables/useAccessManagement.ts +5 -0
  25. package/composables/useDocument.ts +7 -0
  26. package/composables/useFacility.ts +11 -0
  27. package/composables/useHidAmico.ts +134 -0
  28. package/composables/useHidNavigation.ts +25 -1
  29. package/composables/useHidReaderSelection.ts +50 -0
  30. package/composables/usePeople.ts +19 -0
  31. package/composables/usePropertyPermission.ts +17 -0
  32. package/composables/useSecurityPermission.ts +19 -0
  33. package/composables/useSiteCategory.ts +45 -0
  34. package/composables/useSiteEntryPassSettings.ts +26 -0
  35. package/composables/useWebUsb.ts +14 -11
  36. package/package.json +1 -1
  37. package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
  38. package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
  39. package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +23 -0
  40. package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
  41. package/plugins/API.ts +11 -0
  42. package/types/document.d.ts +14 -0
  43. package/types/facility.d.ts +4 -0
  44. package/types/people.d.ts +28 -1
  45. package/utils/hid-permission-assignments.ts +190 -0
  46. package/utils/hid-reader-selection.ts +52 -0
  47. package/utils/occupancy-role.ts +109 -0
  48. package/utils/robot-building.ts +472 -36
package/CHANGELOG.md CHANGED
@@ -1418,11 +1418,11 @@
1418
1418
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1419
1419
  own rule from two endpoints the console already calls, unprojected:
1420
1420
 
1421
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1422
- GET /api/roles/id/:role that membership's role document
1421
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1422
+ GET /api/roles/id/:role that membership's role document
1423
1423
 
1424
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1425
- staff = member.type === "admin" && role.type === "admin"
1424
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1425
+ staff = member.type === "admin" && role.type === "admin"
1426
1426
 
1427
1427
  `role.default` is the marker because it is the only property of a platform
1428
1428
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -1009,7 +1009,7 @@
1009
1009
  .hero-seg__kbd { opacity: 0.55; }
1010
1010
  .hero .hero-input.hero-editor__floor { width: auto; min-height: 32px; padding: 4px 26px 4px 8px; }
1011
1011
  .hero .hero-input.hero-editor__zone { width: 220px; min-height: 32px; }
1012
- .hero-editor__hint { font-size: 12px; opacity: 0.7; }
1012
+ .hero-editor__hint { font-size: 12px; opacity: 0.7; order: 1; flex-basis: 100%; } /* own line: switching tools never moves the plan */
1013
1013
  .hero .v-btn.hero-editor__fs { margin-left: auto; }
1014
1014
  .hero .v-btn.hero-editor__fs .v-btn__content { gap: 8px; }
1015
1015
  .hero-editor__notice { padding: 10px 12px; font-size: 12.5px; border-left: 2px solid var(--hero-accent); background: var(--hero-surface); }
@@ -1017,6 +1017,7 @@
1017
1017
  .hero-editor__split { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; flex: 1; }
1018
1018
  .hero-editor__plan {
1019
1019
  flex: 999 1 460px;
1020
+ align-self: flex-start; /* a taller side list must not stretch the plan under the pointer */
1020
1021
  min-width: 0;
1021
1022
  position: relative;
1022
1023
  min-height: max(480px, calc(100vh - 330px));
@@ -1027,6 +1028,18 @@
1027
1028
  border: 1px solid var(--hero-divider);
1028
1029
  overflow: hidden;
1029
1030
  cursor: crosshair;
1031
+ touch-action: none; /* a finger drags shapes, not the page */
1032
+ user-select: none;
1033
+ }
1034
+ .hero-editor__plan--default { cursor: default; }
1035
+ .hero-editor__plan--pointer { cursor: pointer; }
1036
+ .hero-editor__plan--move { cursor: move; }
1037
+ .hero-editor__plan--ns { cursor: ns-resize; }
1038
+ .hero-editor__plan--ew { cursor: ew-resize; }
1039
+ .hero-editor__plan--nwse { cursor: nwse-resize; }
1040
+ .hero-editor__plan--nesw { cursor: nesw-resize; }
1041
+ .hero-editor__plan--rotate, .hero-editor__handle--rotate {
1042
+ cursor: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27%3E%3Cpath d=%27M20 12a8 8 0 1 1-2.34-5.66M20 4v5h-5%27 fill=%27none%27 stroke=%27%23fff%27 stroke-width=%274%27/%3E%3Cpath d=%27M20 12a8 8 0 1 1-2.34-5.66M20 4v5h-5%27 fill=%27none%27 stroke=%27%23000%27 stroke-width=%272%27/%3E%3C/svg%3E") 12 12, grab;
1030
1043
  }
1031
1044
  .hero-editor__plan:focus-visible { outline: 2px solid var(--hero-accent); outline-offset: 0; }
1032
1045
  .hero-editor__room { position: absolute; border: 2px solid var(--hero-text); opacity: 0.4; pointer-events: none; }
@@ -1038,11 +1051,35 @@ polygon.hero-editor__sel { stroke: var(--hero-accent); stroke-width: 2; stroke-d
1038
1051
  div.hero-editor__sel { outline: 2px solid var(--hero-accent); }
1039
1052
  .hero-editor__label { position: absolute; display: grid; place-items: center; font-size: 10px; font-weight: 600; pointer-events: none; }
1040
1053
  .hero-editor__lift { position: absolute; box-sizing: border-box; display: grid; place-items: center; font-size: 10px; font-weight: 600; background: color-mix(in srgb, var(--hero-accent) 30%, transparent); border: 1px solid var(--hero-accent); }
1041
- .hero-editor__door { position: absolute; width: 3%; height: 3%; margin: -1.5% 0 0 -1.5%; background: var(--hero-accent); }
1054
+ .hero-editor__door { stroke: var(--hero-accent); stroke-width: 4; stroke-linecap: square; }
1055
+ line.hero-editor__door.hero-editor__sel { stroke: var(--hero-text); }
1056
+ .hero-editor__swing { fill: none; stroke: var(--hero-text); stroke-width: 1; stroke-dasharray: 3 2; opacity: 0.7; }
1057
+ .hero-editor__rotline { stroke: var(--hero-accent); stroke-width: 1; stroke-dasharray: 3 2; }
1058
+ /* Handles: 24px to hit (36px for a finger), a 10px square to see. */
1059
+ .hero-editor__handle { position: absolute; z-index: 2; width: 24px; height: 24px; margin: -12px 0 0 -12px; display: grid; place-items: center; touch-action: none; }
1060
+ .hero-editor__handle::before { content: ""; box-sizing: border-box; width: 10px; height: 10px; background: var(--hero-surface); border: 2px solid var(--hero-accent); }
1061
+ .hero-editor__handle--vertex::before { background: var(--hero-accent); border-color: var(--hero-surface); outline: 1px solid var(--hero-accent); }
1062
+ .hero-editor__handle--on::before { background: var(--hero-text); outline-color: var(--hero-text); }
1063
+ .hero-editor__handle--rotate::before { width: 11px; height: 11px; background: var(--hero-accent); border-color: var(--hero-surface); transform: rotate(45deg); }
1064
+ @media (pointer: coarse) {
1065
+ .hero-editor__handle { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
1066
+ .hero-editor__handle::before { width: 14px; height: 14px; }
1067
+ }
1068
+ .hero-editor__marquee { position: absolute; border: 1px dashed var(--hero-accent); background: color-mix(in srgb, var(--hero-accent) 8%, transparent); pointer-events: none; }
1069
+ .hero-editor .hero-seg__opt--redo { font-weight: 400; }
1070
+ .hero-editor__grid { font: inherit; font-size: 12px; padding: 7px 8px; color: inherit; background: transparent; border: 0; border-left: 1px solid var(--hero-divider); cursor: pointer; }
1071
+ .hero-editor__grid option { color: var(--hero-text); background: var(--hero-surface); }
1072
+ .hero-editor__actions { display: flex; flex-wrap: wrap; gap: 6px; }
1073
+ .hero-editor__act { font: inherit; font-size: 12px; padding: 6px 10px; min-height: 32px; color: inherit; background: transparent; border: 1px solid var(--hero-divider); cursor: pointer; }
1074
+ .hero-editor__act:hover { background: color-mix(in srgb, var(--hero-text) 7%, transparent); }
1075
+ .hero-editor__act:disabled { opacity: 0.45; cursor: not-allowed; }
1076
+ .hero-editor__act--del { color: var(--hero-accent); }
1042
1077
  .hero-editor__cursor { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--hero-accent); pointer-events: none; }
1043
1078
  .hero-editor__aside { font-size: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1 1 260px; max-width: 360px; min-width: 0; align-self: stretch; }
1044
1079
  .hero-editor__asidetitle { border-top: 2px solid var(--hero-divider); padding-top: 8px; }
1045
- .hero-editor__row { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--hero-divider); padding: 4px 0; }
1080
+ .hero-editor__row { display: flex; justify-content: space-between; gap: 8px; border: 0; border-bottom: 1px solid var(--hero-divider); padding: 4px 0; font: inherit; color: inherit; background: transparent; text-align: left; cursor: pointer; }
1081
+ .hero-editor__row:hover { background: color-mix(in srgb, var(--hero-text) 5%, transparent); }
1082
+ .hero-editor__row--sel { box-shadow: inset 2px 0 0 var(--hero-accent); padding-left: 6px; font-weight: 600; }
1046
1083
  .hero-editor__pos { opacity: 0.55; font-variant-numeric: tabular-nums; }
1047
1084
  .hero-editor__note { opacity: 0.6; margin-top: auto; }
1048
1085
 
@@ -433,7 +433,10 @@ const {
433
433
  bulkPhysicalAccessCard: _bulkPhysicalAccessCard,
434
434
  getBlockLevelUnitList: _getBlockLevelUnitList,
435
435
  } = useAccessManagement();
436
- const { getBySiteId: _getEntryPassSettings } = useSiteEntryPassSettings();
436
+ const {
437
+ getBySiteId: _getEntryPassSettings,
438
+ getEncryptedAcmUrl: _getEncryptedAcmUrl,
439
+ } = useSiteEntryPassSettings();
437
440
  const { getFileUrl } = useFile();
438
441
 
439
442
  const config = useRuntimeConfig();
@@ -588,9 +591,7 @@ watch(uploadMode, (mode) => {
588
591
 
589
592
  onMounted(async () => {
590
593
  try {
591
- const { encrypted: acmUrl } = await $fetch<{ encrypted: string }>(
592
- "/api/encrypt-acm-url"
593
- );
594
+ const acmUrl = await _getEncryptedAcmUrl(siteId);
594
595
  encryptedAcmUrl.value = acmUrl;
595
596
  const [doorLevels, liftLevels, groups] = await Promise.all([
596
597
  _getDoorAccessLevels(acmUrl),
@@ -203,6 +203,7 @@ const {
203
203
  getBlockLevelUnitList: _getBlockLevelUnitList,
204
204
  } = useAccessManagement();
205
205
  const { requiredRule } = useUtils();
206
+ const { getEncryptedAcmUrl } = useSiteEntryPassSettings();
206
207
 
207
208
  const route = useRoute();
208
209
  const siteId = computed(() => props.siteId || (route.params.site as string));
@@ -294,7 +295,7 @@ onMounted(async () => {
294
295
 
295
296
  const [blockLevelResult, acmResult] = await Promise.allSettled([
296
297
  _getBlockLevelUnitList(siteId.value),
297
- $fetch<{ encrypted: string }>("/api/encrypt-acm-url"),
298
+ getEncryptedAcmUrl(siteId.value),
298
299
  ]);
299
300
 
300
301
  // Blocks / Levels / Units
@@ -309,7 +310,7 @@ onMounted(async () => {
309
310
 
310
311
  // ACM levels (door + lift)
311
312
  if (acmResult.status === "fulfilled") {
312
- const acmUrl = acmResult.value.encrypted;
313
+ const acmUrl = acmResult.value;
313
314
  try {
314
315
  const [doorLevels, liftLevels] = await Promise.all([
315
316
  _getDoorAccessLevels(acmUrl),
@@ -403,6 +403,7 @@ const emit = defineEmits<{
403
403
  }>();
404
404
 
405
405
  const { getResidents, assignUser } = useAccessManagement();
406
+ const { getEncryptedAcmUrl } = useSiteEntryPassSettings();
406
407
 
407
408
  const historyDialog = ref(false);
408
409
  const showAssignForm = ref(false);
@@ -475,12 +476,12 @@ async function openAssignForm() {
475
476
  if (!props.unit?._id || !props.orgId || !props.siteId) return;
476
477
  peopleLoading.value = true;
477
478
  try {
478
- const [residentsRes, acmRes] = await Promise.all([
479
+ const [residentsRes, acmUrl] = await Promise.all([
479
480
  getResidents({ orgId: props.orgId, siteId: props.siteId, unitId: props.unit._id }),
480
- $fetch<{ encrypted: string }>("/api/encrypt-acm-url"),
481
+ getEncryptedAcmUrl(props.siteId),
481
482
  ]);
482
483
  peopleItems.value = residentsRes?.data ?? [];
483
- encryptedAcmUrl.value = acmRes?.encrypted ?? "";
484
+ encryptedAcmUrl.value = acmUrl ?? "";
484
485
  } catch {
485
486
  peopleItems.value = [];
486
487
  } finally {
@@ -23,7 +23,7 @@
23
23
  Close
24
24
  </v-btn>
25
25
 
26
- <v-menu v-if="canUpdate || canDelete" contained>
26
+ <v-menu v-if="canUpdate || canDelete || $slots.actions" contained>
27
27
  <template #activator="{ props }">
28
28
  <v-btn
29
29
  variant="flat"
@@ -42,6 +42,16 @@
42
42
  render-verified either. Only the row type and the destructive ink
43
43
  change. -->
44
44
  <v-list class="pa-0 update-more__list">
45
+ <!--
46
+ Screen-specific rows, above Edit and the destructive one.
47
+
48
+ Additive: a screen that passes nothing gets the menu it always
49
+ had, and `$slots.actions` is undefined unless a caller actually
50
+ defines the slot - so the button does not appear over an empty
51
+ list when a screen has neither permission nor extra rows.
52
+ -->
53
+ <slot name="actions" />
54
+
45
55
  <v-list-item v-if="canUpdate" @click="emit('edit')">
46
56
  <v-list-item-title>
47
57
  {{ editButtonLabel }}