@gluhar/app 4.0.5 → 4.1.0

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.1.0](https://github.com/gluharco/gluhar/compare/@gluhar/app@4.0.5...@gluhar/app@4.1.0) (2025-07-24)
7
+
8
+
9
+ ### 🚀 Enhancements
10
+
11
+ - GContactLink for coping phone and email to clipboard on desktop and tel: mailto: on mobile with data-cursor-text support ([df32796](https://github.com/gluharco/gluhar/commit/df32796c2e79dafb42cd3bbac12f4c1e5167648e))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.0.5](https://github.com/gluharco/gluhar/compare/@gluhar/app@4.0.4...@gluhar/app@4.0.5) (2025-07-23)
7
18
 
8
19
  **📝 Note:** Version bump only for package @gluhar/app
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gluhar/app",
3
3
  "configKey": "gluhar",
4
- "version": "4.0.5",
4
+ "version": "4.1.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.3",
7
7
  "unbuild": "2.0.0"
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ import { useResponsive, computed, ref } from "#imports";
3
+
4
+ const props = defineProps<{
5
+ phone?: string;
6
+ email?: string;
7
+ onCopy?: () => void;
8
+ }>();
9
+
10
+ const defaultCursorText = "Copy to clipboard";
11
+ const cursorText = ref(defaultCursorText);
12
+
13
+ const { isMobile } = useResponsive();
14
+
15
+ const href = computed(() => {
16
+ if (!isMobile.value) return undefined;
17
+ return props.phone ? `tel:${props.phone}` : `mailto:${props.email}`;
18
+ });
19
+
20
+ const handleClick = async (isPhone: boolean) => {
21
+ const value = isPhone ? props.phone : props.email;
22
+
23
+ if (isMobile.value) return;
24
+
25
+ await navigator.clipboard.writeText(value!);
26
+
27
+ props.onCopy?.();
28
+
29
+ cursorText.value = "Copied!";
30
+ };
31
+
32
+ const onMouseLeave = () => {
33
+ cursorText.value = defaultCursorText;
34
+ };
35
+ </script>
36
+
37
+ <template>
38
+ <a
39
+ :href
40
+ @click="handleClick(!!phone)"
41
+ :data-cursor-text="cursorText"
42
+ @mouseleave="onMouseLeave"
43
+ >
44
+ <slot> {{ phone || email }} </slot>
45
+ </a>
46
+ </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gluhar/app",
3
- "version": "4.0.5",
3
+ "version": "4.1.0",
4
4
  "description": "Gluhar main package. This combines and configures @gluhar/theme, @gluhar/i18n, @gluhar/sanity and @gluhar/core into one main package. Provides numerous components, composables, utils and types.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -62,5 +62,5 @@
62
62
  "nuxt": "^3.13.1",
63
63
  "vitest": "^2.0.5"
64
64
  },
65
- "gitHead": "a52ee4ce07d0364f51232c8a6703c521baee9a37"
65
+ "gitHead": "91f00f2dac1858a6aab7ba19fba2056a15893ca4"
66
66
  }