@apptegy/nuxt-navigation 0.1.76 → 0.1.77

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.0.0"
5
5
  },
6
6
  "configKey": "@apptegy/nuxt-navigation",
7
- "version": "0.1.76",
7
+ "version": "0.1.77",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.1",
10
10
  "unbuild": "unknown"
@@ -20,21 +20,21 @@
20
20
  <div :class="['header-actions', { 'collapsed': !expanded && !isMobile }]">
21
21
  <NuxtLink v-if="expanded" class="no-link-style" :to="homepageUrl">
22
22
  <slot name="logo">
23
- <div class="navbar--logo">
24
- <img v-if="brandLogo" :src="brandLogo" :alt="$t('navigation.brandLogoAlt')">
25
- <component
26
- :is="ApptegyLogo"
27
- v-else
28
- :alt="$t('navigation.brandLogoAlt')"
29
- :use-light-logo="isAdmin || Object.values(getBrandingStyles).length === 0"
30
- />
31
- <div v-if="!brand?.hide_school_name">
32
- <div class="school-name"> {{ brand?.school_name }} </div>
33
- <div v-if="brand?.school_tag_line" class="school-tag">{{ brand.school_tag_line }}</div>
34
- </div>
23
+ <div class="navbar--logo" :class="{ 'big-logo': _brandLogoWidth > 80 }">
24
+ <img v-if="brandLogo" ref="brandLogoRef" :src="brandLogo" :alt="$t('navigation.brandLogoAlt')">
25
+ <component
26
+ :is="ApptegyLogo"
27
+ v-else
28
+ :alt="$t('navigation.brandLogoAlt')"
29
+ :use-light-logo="isAdmin || Object.values(getBrandingStyles).length === 0"
30
+ />
31
+ <div v-if="!brand?.hide_school_name">
32
+ <div class="school-name"> {{ brand?.school_name }} </div>
33
+ <div v-if="brand?.school_tag_line" class="school-tag">{{ brand.school_tag_line }}</div>
35
34
  </div>
36
- </slot>
37
- </NuxtLink>
35
+ </div>
36
+ </slot>
37
+ </NuxtLink>
38
38
  <div v-if="!isMobile && showCollapseButton">
39
39
  <button v-if="lockedExpanded && !allowCollapse && expanded" class="hamburger-button" @click="closeSidebar" v-tooltip.bottom="'Unpin menu'">
40
40
  <Pinned />
@@ -91,7 +91,7 @@
91
91
  </template>
92
92
 
93
93
  <script setup>
94
- import { useSidebar, useBranding, useNuxtApp, ref, watch } from "#imports";
94
+ import { useSidebar, useBranding, useNuxtApp, ref, watch, computed, onMounted, onBeforeUnmount } from "#imports";
95
95
  import ApptegyLogo from "./Icons/ApptegyLogo.vue";
96
96
  import { useBreakpoints, breakpointsTailwind } from "@vueuse/core";
97
97
  import Unpinned from "./Icons/Unpinned.vue";
@@ -128,10 +128,30 @@ const emit = defineEmits(["toggle-expand"]);
128
128
  const { state: expanded } = useSidebar();
129
129
  const { brand, getBrandingStyles } = await useBranding(props.clientId);
130
130
  const brandLogo = ref(brand.value?.logo_light);
131
+ const brandLogoRef = ref(null);
132
+ const brandLogoWidthPx = ref(0);
133
+ let brandLogoResizeObserver = null;
134
+ const _brandLogoWidth = computed(() => brandLogoWidthPx.value);
131
135
  const breakpoints = useBreakpoints(breakpointsTailwind);
132
136
  const isMobile = breakpoints.smaller("md");
133
137
  const lockedExpanded = ref(true);
134
138
  const allowCollapse = ref(false);
139
+ function updateBrandLogoWidth() {
140
+ brandLogoWidthPx.value = brandLogoRef.value?.clientWidth ?? 0;
141
+ }
142
+ onMounted(() => {
143
+ updateBrandLogoWidth();
144
+ if (brandLogoRef.value) {
145
+ brandLogoResizeObserver = new ResizeObserver(() => {
146
+ updateBrandLogoWidth();
147
+ });
148
+ brandLogoResizeObserver.observe(brandLogoRef.value);
149
+ }
150
+ });
151
+ onBeforeUnmount(() => {
152
+ brandLogoResizeObserver?.disconnect();
153
+ brandLogoResizeObserver = null;
154
+ });
135
155
  watch(expanded, (value) => {
136
156
  emit("toggle-expand", value ? 264 : 64);
137
157
  });
@@ -223,6 +243,10 @@ function lockSidebar() {
223
243
  align-items: center;
224
244
  gap: 8px;
225
245
  }
246
+ .navbar--logo.big-logo {
247
+ flex-direction: column;
248
+ align-items: flex-start;
249
+ }
226
250
  .navbar--logo .school-name {
227
251
  font-size: 16px;
228
252
  font-style: normal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -46,5 +46,5 @@
46
46
  "vue": "^3.5.13",
47
47
  "vue-tsc": "^3.0.3"
48
48
  },
49
- "gitHead": "b115e75078e5a86f7ce2d2b358f68dbcdd43617a"
49
+ "gitHead": "112c6210e954838d100c8a5bf94c9f32d91152b1"
50
50
  }