rimelight-components 1.1.3 → 1.2.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.
Files changed (37) hide show
  1. package/dist/module.mjs +7 -1
  2. package/dist/runtime/components/app/ScrollToTop.d.vue.ts +10 -0
  3. package/dist/runtime/components/app/ScrollToTop.vue +97 -0
  4. package/dist/runtime/components/app/ScrollToTop.vue.d.ts +10 -0
  5. package/dist/runtime/components/backgrounds/AnimateGrid.d.vue.ts +23 -0
  6. package/dist/runtime/components/backgrounds/AnimateGrid.vue +84 -0
  7. package/dist/runtime/components/backgrounds/AnimateGrid.vue.d.ts +23 -0
  8. package/dist/runtime/components/backgrounds/FlickeringGrid.d.vue.ts +19 -0
  9. package/dist/runtime/components/backgrounds/FlickeringGrid.vue +130 -0
  10. package/dist/runtime/components/backgrounds/FlickeringGrid.vue.d.ts +19 -0
  11. package/dist/runtime/components/backgrounds/InteractiveGrid.d.vue.ts +15 -0
  12. package/dist/runtime/components/backgrounds/InteractiveGrid.vue +58 -0
  13. package/dist/runtime/components/backgrounds/InteractiveGrid.vue.d.ts +15 -0
  14. package/dist/runtime/components/{app/ConstructionBanner.d.vue.ts → feedback/Feedback.d.vue.ts} +4 -1
  15. package/dist/runtime/components/feedback/Feedback.vue +207 -0
  16. package/dist/runtime/components/{app/ConstructionBanner.vue.d.ts → feedback/Feedback.vue.d.ts} +4 -1
  17. package/dist/runtime/components/feedback/FeedbackChart.d.vue.ts +18 -0
  18. package/dist/runtime/components/feedback/FeedbackChart.vue +604 -0
  19. package/dist/runtime/components/feedback/FeedbackChart.vue.d.ts +18 -0
  20. package/dist/runtime/components/feedback/FeedbackDatePicker.d.vue.ts +3 -0
  21. package/dist/runtime/components/feedback/FeedbackDatePicker.vue +149 -0
  22. package/dist/runtime/components/feedback/FeedbackDatePicker.vue.d.ts +3 -0
  23. package/dist/runtime/components/feedback/FeedbackItem.d.vue.ts +10 -0
  24. package/dist/runtime/components/feedback/FeedbackItem.vue +77 -0
  25. package/dist/runtime/components/feedback/FeedbackItem.vue.d.ts +10 -0
  26. package/dist/runtime/components/feedback/FeedbackStatCard.d.vue.ts +17 -0
  27. package/dist/runtime/components/feedback/FeedbackStatCard.vue +66 -0
  28. package/dist/runtime/components/feedback/FeedbackStatCard.vue.d.ts +17 -0
  29. package/dist/runtime/composables/useFeedback.d.ts +50 -0
  30. package/dist/runtime/composables/useFeedback.js +237 -0
  31. package/dist/runtime/composables/useFeedbackExports.d.ts +4 -0
  32. package/dist/runtime/composables/useFeedbackExports.js +150 -0
  33. package/dist/runtime/types/index.d.ts +14 -0
  34. package/dist/runtime/utils/index.d.ts +3 -0
  35. package/dist/runtime/utils/index.js +5 -0
  36. package/package.json +28 -8
  37. package/dist/runtime/components/app/ConstructionBanner.vue +0 -23
@@ -0,0 +1,150 @@
1
+ export function useFeedbackExport() {
2
+ const toast = useToast();
3
+ function formatDateForCSV(date) {
4
+ const d = typeof date === `string` ? new Date(date) : date;
5
+ return d.toLocaleDateString(`en-US`, {
6
+ year: `numeric`,
7
+ month: `2-digit`,
8
+ day: `2-digit`,
9
+ hour: `2-digit`,
10
+ minute: `2-digit`,
11
+ second: `2-digit`
12
+ });
13
+ }
14
+ function convertToCSV(data) {
15
+ if (!data || data.length === 0) {
16
+ return `No data to export`;
17
+ }
18
+ const headers = [
19
+ `ID`,
20
+ `Rating`,
21
+ `Score`,
22
+ `Rating Label`,
23
+ `Feedback`,
24
+ `Page Path`,
25
+ `Page Title`,
26
+ `Page Stem`,
27
+ `Country`,
28
+ `Created At`,
29
+ `Updated At`
30
+ ];
31
+ const rows = data.map((item) => {
32
+ const ratingOption = FEEDBACK_OPTIONS.find(
33
+ (opt) => opt.value === item.rating
34
+ );
35
+ return [
36
+ item.id,
37
+ item.rating,
38
+ ratingOption?.score || 0,
39
+ ratingOption?.label || `Unknown`,
40
+ // Escape quotes
41
+ `"${(item.feedback || ``).replace(/"/g, `""`)}"`,
42
+ item.path,
43
+ // Escape quotes
44
+ `"${item.title.replace(/"/g, `""`)}"`,
45
+ item.stem,
46
+ item.country || ``,
47
+ formatDateForCSV(item.createdAt),
48
+ formatDateForCSV(item.updatedAt)
49
+ ];
50
+ });
51
+ return [headers, ...rows].map((row) => row.join(`,`)).join(`
52
+ `);
53
+ }
54
+ function downloadCSV(csvContent, filename) {
55
+ const blob = new Blob([csvContent], {
56
+ type: `text/csv;charset=utf-8;`
57
+ });
58
+ const link = document.createElement(`a`);
59
+ if (link.download !== void 0) {
60
+ const url = URL.createObjectURL(blob);
61
+ link.setAttribute(`href`, url);
62
+ link.setAttribute(`download`, filename);
63
+ link.style.visibility = `hidden`;
64
+ document.body.appendChild(link);
65
+ link.click();
66
+ document.body.removeChild(link);
67
+ URL.revokeObjectURL(url);
68
+ }
69
+ }
70
+ async function exportFeedbackData(feedbackData) {
71
+ try {
72
+ const csvContent = convertToCSV(feedbackData);
73
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().split(`T`)[0];
74
+ const filename = `feedback-export-${timestamp}.csv`;
75
+ downloadCSV(csvContent, filename);
76
+ toast.add({
77
+ title: `Export successful`,
78
+ description: `${feedbackData.length} feedback entries exported to ${filename}`,
79
+ color: `success`,
80
+ icon: `i-lucide-download`
81
+ });
82
+ } catch (error) {
83
+ console.error(`Export failed:`, error);
84
+ toast.add({
85
+ title: `Export failed`,
86
+ description: `Unable to export feedback data. Please try again.`,
87
+ color: `error`,
88
+ icon: `i-lucide-circle-alert`
89
+ });
90
+ }
91
+ }
92
+ async function exportPageAnalytics(pageAnalytics) {
93
+ try {
94
+ if (!pageAnalytics || pageAnalytics.length === 0) {
95
+ toast.add({
96
+ title: `No data to export`,
97
+ description: `No page analytics data available for export.`,
98
+ color: `warning`,
99
+ icon: `i-lucide-info`
100
+ });
101
+ return;
102
+ }
103
+ const headers = [
104
+ `Page Path`,
105
+ `Page Title`,
106
+ `Total Feedback`,
107
+ `Positive Feedback`,
108
+ `Negative Feedback`,
109
+ `Average Score`,
110
+ `Positive Percentage`,
111
+ `Created At`,
112
+ `Updated At`
113
+ ];
114
+ const rows = pageAnalytics.map((page) => [
115
+ page.path,
116
+ `"${page.lastFeedback.title.replace(/"/g, `""`)}"`,
117
+ page.total,
118
+ page.positive,
119
+ page.negative,
120
+ page.averageScore,
121
+ page.positivePercentage,
122
+ formatDateForCSV(page.createdAt),
123
+ formatDateForCSV(page.updatedAt)
124
+ ]);
125
+ const csvContent = [headers, ...rows].map((row) => row.join(`,`)).join(`
126
+ `);
127
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().split(`T`)[0];
128
+ const filename = `page-analytics-export-${timestamp}.csv`;
129
+ downloadCSV(csvContent, filename);
130
+ toast.add({
131
+ title: `Export successful`,
132
+ description: `${pageAnalytics.length} page analytics exported to ${filename}`,
133
+ color: `success`,
134
+ icon: `i-lucide-download`
135
+ });
136
+ } catch (error) {
137
+ console.error(`Export failed:`, error);
138
+ toast.add({
139
+ title: `Export failed`,
140
+ description: `Unable to export page analytics. Please try again.`,
141
+ color: `error`,
142
+ icon: `i-lucide-circle-alert`
143
+ });
144
+ }
145
+ }
146
+ return {
147
+ exportFeedbackData,
148
+ exportPageAnalytics
149
+ };
150
+ }
@@ -0,0 +1,14 @@
1
+ export interface Notification {
2
+ id: number
3
+ unread?: boolean
4
+ sender: User
5
+ body: string
6
+ date: string
7
+ }
8
+
9
+ export type Period = `daily` | `weekly` | `monthly`
10
+
11
+ export interface Range {
12
+ start: Date
13
+ end: Date
14
+ }
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export type ObjectValues<T> = T[keyof T];
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
package/package.json CHANGED
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "name": "rimelight-components",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "My new Nuxt module",
5
- "repository": "RimelightEntertainment/rimelight-components",
5
+ "repository": "Rimelight Entertainment/rimelight-components",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/types.d.mts",
11
11
  "import": "./dist/module.mjs"
12
+ },
13
+ "./runtime/*": "./dist/runtime/*",
14
+ "./components/*": "./dist/runtime/components/*",
15
+ "./composables/*": "./dist/runtime/composables/*",
16
+ "./types/*": "./dist/runtime/types/*",
17
+ "./utils/*": {
18
+ "types": "./dist/runtime/utils/*.d.ts",
19
+ "import": "./dist/runtime/utils/*.js"
12
20
  }
13
21
  },
14
22
  "main": "./dist/module.mjs",
@@ -38,7 +46,10 @@
38
46
  "playground"
39
47
  ],
40
48
  "dependencies": {
49
+ "@nuxt/image": "^1.11.0",
41
50
  "@nuxt/kit": "^4.1.3",
51
+ "@nuxt/ui": "^4.0.1",
52
+ "@vueuse/core": "^13.9.0",
42
53
  "date-fns": "^4.1.0",
43
54
  "nuxt": "^4.1.3",
44
55
  "tailwind-variants": "^3.1.1",
@@ -49,14 +60,23 @@
49
60
  "@nuxt/module-builder": "^1.0.2",
50
61
  "@nuxt/schema": "^4.1.3",
51
62
  "@nuxt/test-utils": "^3.19.2",
63
+ "@prettier/plugin-oxc": "^0.0.4",
52
64
  "@types/node": "latest",
53
65
  "changelogen": "^0.6.2",
54
- "typescript": "~5.9.3",
55
- "vitest": "^3.2.4",
56
- "vue-tsc": "^3.1.0",
57
- "@prettier/plugin-oxc": "^0.0.4",
66
+ "class-variance-authority": "^0.7.1",
67
+ "clsx": "^2.1.1",
68
+ "motion-v": "^1.7.2",
58
69
  "oxlint": "^1.21.0",
59
70
  "prettier": "^3.6.2",
60
- "prettier-plugin-tailwindcss": "^0.6.14"
61
- }
71
+ "prettier-plugin-tailwindcss": "^0.6.14",
72
+ "tailwind-merge": "^3.3.1",
73
+ "tw-animate-css": "^1.4.0",
74
+ "typescript": "~5.9.3",
75
+ "vitest": "^3.2.4",
76
+ "vue-tsc": "^3.1.0"
77
+ },
78
+ "trustedDependencies": [
79
+ "@parcel/watcher",
80
+ "@tailwindcss/oxide"
81
+ ]
62
82
  }
@@ -1,23 +0,0 @@
1
- <script setup>
2
- import { ref } from "vue";
3
- const { to } = defineProps({
4
- to: { type: String, required: true }
5
- });
6
- const actions = ref([
7
- {
8
- label: "View on GitHub",
9
- trailingIcon: "mdi:github",
10
- to
11
- }
12
- ]);
13
- </script>
14
-
15
- <template>
16
- <UBanner
17
- color="primary"
18
- icon="lucide:construction"
19
- title="This website is currently under construction. Feel free to report any issues!"
20
- :actions="actions"
21
- close
22
- />
23
- </template>