@oneclick.dev/cms-core-modules 0.0.78 → 0.0.79
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/{AppointmentDetailsCard-SMNXi117.mjs → AppointmentDetailsCard-Bu9VzIRx.mjs} +54 -55
- package/dist/AppointmentDetailsCard-LL-6PARb.js +1 -0
- package/dist/{AppointmentListTable-vMSMt0M5.mjs → AppointmentListTable-B8YLwOfT.mjs} +41 -42
- package/dist/AppointmentListTable-DNvvb4sz.js +1 -0
- package/dist/CountryBreakdownCard-BpDXbxwZ.js +1 -0
- package/dist/{CountryBreakdownCard-B_VhBsm8.mjs → CountryBreakdownCard-oDzmpvAd.mjs} +45 -46
- package/dist/DeviceBreakdownCard-OXiU9Cf0.js +1 -0
- package/dist/DeviceBreakdownCard-Oh_yzipG.mjs +159 -0
- package/dist/{PeakHoursCard-_1JS0tpZ.mjs → PeakHoursCard-DzNo4SNo.mjs} +56 -57
- package/dist/PeakHoursCard-OkgI1vnd.js +1 -0
- package/dist/ProductDetailsCard-BBOorNmB.js +1 -0
- package/dist/{ProductDetailsCard-C5gqBJag.mjs → ProductDetailsCard-CYK9Mtt4.mjs} +44 -45
- package/dist/RealtimeCard-DESm9Fs_.js +1 -0
- package/dist/{RealtimeCard-CtX6Yyk-.mjs → RealtimeCard-tNUSIw6B.mjs} +44 -45
- package/dist/{SearchTermsCard-DzSu9jzo.mjs → SearchTermsCard-BVHFHWUZ.mjs} +66 -67
- package/dist/SearchTermsCard-DmyhGQVM.js +1 -0
- package/dist/{TopPagesCard-D7lH_QYV.mjs → TopPagesCard-CRIa3rSZ.mjs} +52 -53
- package/dist/TopPagesCard-CgtNyhwY.js +1 -0
- package/dist/TrafficSourcesCard-CPAxaQTi.js +1 -0
- package/dist/{TrafficSourcesCard-Fng3fVh7.mjs → TrafficSourcesCard-Ct20QYax.mjs} +48 -49
- package/dist/VisitorStatsCard-Cs6jPehw.js +1 -0
- package/dist/{VisitorStatsCard-CuXXnMBc.mjs → VisitorStatsCard-DMULybKV.mjs} +57 -58
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +11 -11
- package/package.json +2 -2
- package/dist/AppointmentDetailsCard-BfBwWxTU.js +0 -1
- package/dist/AppointmentListTable-Dk-CnNR6.js +0 -1
- package/dist/CountryBreakdownCard-Ghg0Wz-h.js +0 -1
- package/dist/DeviceBreakdownCard-CQR65Zr_.mjs +0 -160
- package/dist/DeviceBreakdownCard-Cpcj75Rv.js +0 -1
- package/dist/PeakHoursCard-CFIg8dys.js +0 -1
- package/dist/ProductDetailsCard-Ce11f_9r.js +0 -1
- package/dist/RealtimeCard-CatAzdxv.js +0 -1
- package/dist/SearchTermsCard-BPAdRL-r.js +0 -1
- package/dist/TopPagesCard-BA9Are_Z.js +0 -1
- package/dist/TrafficSourcesCard-DV13ZOBq.js +0 -1
- package/dist/VisitorStatsCard-CAzAZtKD.js +0 -1
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Users as A, MousePointerClick as
|
|
3
|
-
|
|
4
|
-
const ce = { class: "w-full" }, ue = {
|
|
1
|
+
import { defineComponent as J, computed as w, ref as m, onMounted as K, resolveComponent as Q, openBlock as o, createElementBlock as c, unref as r, createVNode as h, createElementVNode as l, toDisplayString as d, Fragment as W, renderList as X, createBlock as x, resolveDynamicComponent as Z, normalizeClass as _, createCommentVNode as U, withCtx as ee, createTextVNode as te } from "vue";
|
|
2
|
+
import { Users as A, MousePointerClick as se, Eye as M, ArrowDownRight as F, Timer as C, Loader2 as ne, BarChart3 as ae, ArrowUpRight as re, Minus as oe, ExternalLink as ie } from "lucide-vue-next";
|
|
3
|
+
const le = { class: "w-full" }, ce = {
|
|
5
4
|
key: 0,
|
|
6
5
|
class: "flex items-center gap-2 py-3"
|
|
7
|
-
},
|
|
6
|
+
}, ue = {
|
|
8
7
|
key: 1,
|
|
9
8
|
class: "text-xs text-destructive py-2"
|
|
10
|
-
},
|
|
9
|
+
}, de = {
|
|
11
10
|
key: 2,
|
|
12
11
|
class: "rounded-xl border bg-background overflow-hidden"
|
|
13
|
-
},
|
|
12
|
+
}, ge = { class: "px-3 py-2 border-b bg-muted/40 flex items-center justify-between" }, me = { class: "flex items-center gap-2" }, ve = { class: "text-[10px] text-muted-foreground" }, pe = { class: "grid grid-cols-2 sm:grid-cols-4 divide-x divide-y" }, fe = { class: "flex items-center gap-1.5" }, he = { class: "text-[10px] text-muted-foreground uppercase tracking-wide" }, xe = { class: "text-sm font-semibold" }, ye = {
|
|
14
13
|
key: 0,
|
|
15
14
|
class: "flex items-center gap-0.5"
|
|
16
|
-
},
|
|
15
|
+
}, be = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, we = {
|
|
17
16
|
key: 0,
|
|
18
17
|
class: "text-[10px] text-muted-foreground"
|
|
19
|
-
},
|
|
18
|
+
}, Pe = /* @__PURE__ */ J({
|
|
20
19
|
__name: "VisitorStatsCard",
|
|
21
20
|
props: {
|
|
22
21
|
toolName: {},
|
|
@@ -27,9 +26,9 @@ const ce = { class: "w-full" }, ue = {
|
|
|
27
26
|
status: {}
|
|
28
27
|
},
|
|
29
28
|
emits: ["submit"],
|
|
30
|
-
setup(S, { emit:
|
|
31
|
-
const u = S,
|
|
32
|
-
function
|
|
29
|
+
setup(S, { emit: N }) {
|
|
30
|
+
const { $useRoute: L, $useModuleOverlay: _e } = useNuxtApp(), u = S, j = N, z = L(), E = w(() => z.params.slug), I = $useModuleApi(u.instanceId), v = m(!0), g = m(null), a = m({}), i = m({}), p = m(null);
|
|
31
|
+
function O() {
|
|
33
32
|
const e = u.resolvedArgs?._cachedData;
|
|
34
33
|
return e ? (a.value = {
|
|
35
34
|
totalUsers: e.totalUsers || 0,
|
|
@@ -41,7 +40,7 @@ const ce = { class: "w-full" }, ue = {
|
|
|
41
40
|
engagementRate: D(e.engagementRate),
|
|
42
41
|
screenPageViewsPerSession: parseFloat(e.pagesPerSession) || 0
|
|
43
42
|
}, i.value = Object.fromEntries(
|
|
44
|
-
Object.entries(e.changes || {}).map(([t, s]) => [t,
|
|
43
|
+
Object.entries(e.changes || {}).map(([t, s]) => [t, T(s)])
|
|
45
44
|
), p.value = u.resolvedArgs._fetchedAt || null, v.value = !1, !0) : !1;
|
|
46
45
|
}
|
|
47
46
|
function D(e) {
|
|
@@ -52,28 +51,28 @@ const ce = { class: "w-full" }, ue = {
|
|
|
52
51
|
const t = e.match(/(\d+)m/), s = e.match(/(\d+)s/);
|
|
53
52
|
return (t ? parseInt(t[1]) * 60 : 0) + (s ? parseInt(s[1]) : 0);
|
|
54
53
|
}
|
|
55
|
-
function
|
|
54
|
+
function T(e) {
|
|
56
55
|
return !e || e === "N/A" ? null : parseFloat(e.replace("+", ""));
|
|
57
56
|
}
|
|
58
|
-
async function
|
|
57
|
+
async function Y() {
|
|
59
58
|
const { startDate: e, endDate: t } = u.resolvedArgs || {};
|
|
60
59
|
v.value = !0, g.value = null;
|
|
61
60
|
try {
|
|
62
61
|
const s = new URLSearchParams();
|
|
63
62
|
e && s.set("startDate", e), t && s.set("endDate", t);
|
|
64
|
-
const n = await
|
|
63
|
+
const n = await I.get(`/report?${s.toString()}`);
|
|
65
64
|
a.value = n.totals || {}, i.value = n.changes || {}, p.value = (/* @__PURE__ */ new Date()).toISOString(), P({
|
|
66
|
-
period:
|
|
65
|
+
period: $.value,
|
|
67
66
|
totalUsers: Math.round(a.value.totalUsers || 0),
|
|
68
67
|
sessions: Math.round(a.value.sessions || 0),
|
|
69
68
|
pageViews: Math.round(a.value.screenPageViews || 0),
|
|
70
69
|
newUsers: Math.round(a.value.newUsers || 0),
|
|
71
70
|
bounceRate: `${(a.value.bounceRate * 100).toFixed(1)}%`,
|
|
72
|
-
avgSessionDuration:
|
|
71
|
+
avgSessionDuration: k(a.value.averageSessionDuration),
|
|
73
72
|
engagementRate: `${(a.value.engagementRate * 100).toFixed(1)}%`,
|
|
74
73
|
pagesPerSession: (a.value.screenPageViewsPerSession || 0).toFixed(1),
|
|
75
74
|
changes: Object.fromEntries(
|
|
76
|
-
Object.entries(i.value).map(([
|
|
75
|
+
Object.entries(i.value).map(([H, b]) => [H, b !== null ? `${b > 0 ? "+" : ""}${b.toFixed(1)}%` : "N/A"])
|
|
77
76
|
)
|
|
78
77
|
});
|
|
79
78
|
} catch (s) {
|
|
@@ -82,67 +81,67 @@ const ce = { class: "w-full" }, ue = {
|
|
|
82
81
|
v.value = !1;
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
|
-
|
|
86
|
-
u.status === "completed" &&
|
|
84
|
+
K(() => {
|
|
85
|
+
u.status === "completed" && O() || Y();
|
|
87
86
|
});
|
|
88
87
|
function P(e) {
|
|
89
|
-
u.status !== "completed" &&
|
|
88
|
+
u.status !== "completed" && j("submit", e);
|
|
90
89
|
}
|
|
91
|
-
const
|
|
90
|
+
const $ = w(() => {
|
|
92
91
|
const { startDate: e, endDate: t } = u.resolvedArgs || {};
|
|
93
92
|
if (!e && !t) return "Last 30 days";
|
|
94
93
|
const s = e || "30daysAgo", n = s.match(/^(\d+)daysAgo$/);
|
|
95
94
|
return s === "yesterday" && (!t || t === "yesterday") ? "Yesterday" : n ? `Last ${n[1]} days` : `${s} → ${t || "today"}`;
|
|
96
|
-
}),
|
|
95
|
+
}), k = (e) => {
|
|
97
96
|
if (!e) return "0s";
|
|
98
97
|
const t = Math.floor(e / 60), s = Math.round(e % 60);
|
|
99
98
|
return t > 0 ? `${t}m ${s}s` : `${s}s`;
|
|
100
|
-
}, f = (e) => e == null ? "0" : Math.round(e).toLocaleString(),
|
|
99
|
+
}, f = (e) => e == null ? "0" : Math.round(e).toLocaleString(), V = (e) => e == null ? "0%" : `${(e * 100).toFixed(1)}%`, q = (e) => e ? new Date(e).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "", y = (e, t = !1) => {
|
|
101
100
|
if (e == null) return "text-muted-foreground";
|
|
102
101
|
const s = t ? e < 0 : e > 0, n = t ? e > 0 : e < 0;
|
|
103
102
|
return s ? "text-emerald-600 dark:text-emerald-400" : n ? "text-red-600 dark:text-red-400" : "text-muted-foreground";
|
|
104
|
-
}, R = (e) => e == null ? null : `${e > 0 ? "+" : ""}${e.toFixed(1)}%`,
|
|
103
|
+
}, R = (e) => e == null ? null : `${e > 0 ? "+" : ""}${e.toFixed(1)}%`, G = w(() => [
|
|
105
104
|
{ label: "Users", value: f(a.value.totalUsers), change: i.value.totalUsers, icon: A },
|
|
106
|
-
{ label: "Sessions", value: f(a.value.sessions), change: i.value.sessions, icon:
|
|
107
|
-
{ label: "Page Views", value: f(a.value.screenPageViews), change: i.value.screenPageViews, icon:
|
|
105
|
+
{ label: "Sessions", value: f(a.value.sessions), change: i.value.sessions, icon: se },
|
|
106
|
+
{ label: "Page Views", value: f(a.value.screenPageViews), change: i.value.screenPageViews, icon: M },
|
|
108
107
|
{ label: "New Users", value: f(a.value.newUsers), change: i.value.newUsers, icon: A },
|
|
109
|
-
{ label: "Bounce Rate", value:
|
|
110
|
-
{ label: "Engagement", value:
|
|
111
|
-
{ label: "Avg Duration", value:
|
|
112
|
-
{ label: "Pages/Session", value: (a.value.screenPageViewsPerSession || 0).toFixed(1), change: i.value.screenPageViewsPerSession, icon:
|
|
108
|
+
{ label: "Bounce Rate", value: V(a.value.bounceRate), change: i.value.bounceRate, inverted: !0, icon: F },
|
|
109
|
+
{ label: "Engagement", value: V(a.value.engagementRate), change: i.value.engagementRate, icon: C },
|
|
110
|
+
{ label: "Avg Duration", value: k(a.value.averageSessionDuration), change: i.value.averageSessionDuration, icon: C },
|
|
111
|
+
{ label: "Pages/Session", value: (a.value.screenPageViewsPerSession || 0).toFixed(1), change: i.value.screenPageViewsPerSession, icon: M }
|
|
113
112
|
]);
|
|
114
113
|
return (e, t) => {
|
|
115
|
-
const s =
|
|
116
|
-
return o(), c("div",
|
|
117
|
-
r(v) ? (o(), c("div",
|
|
118
|
-
h(r(
|
|
114
|
+
const s = Q("NuxtLink");
|
|
115
|
+
return o(), c("div", le, [
|
|
116
|
+
r(v) ? (o(), c("div", ce, [
|
|
117
|
+
h(r(ne), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
119
118
|
t[0] || (t[0] = l("span", { class: "text-xs text-muted-foreground" }, "Loading visitor statistics…", -1))
|
|
120
|
-
])) : r(g) ? (o(), c("div",
|
|
121
|
-
l("div",
|
|
122
|
-
l("div",
|
|
123
|
-
h(r(
|
|
119
|
+
])) : r(g) ? (o(), c("div", ue, d(r(g)), 1)) : (o(), c("div", de, [
|
|
120
|
+
l("div", ge, [
|
|
121
|
+
l("div", me, [
|
|
122
|
+
h(r(ae), { class: "size-3.5 text-primary" }),
|
|
124
123
|
t[1] || (t[1] = l("span", { class: "text-xs font-medium" }, "Visitor Statistics", -1))
|
|
125
124
|
]),
|
|
126
|
-
l("span",
|
|
125
|
+
l("span", ve, d(r($)), 1)
|
|
127
126
|
]),
|
|
128
|
-
l("div",
|
|
129
|
-
(o(!0), c(
|
|
127
|
+
l("div", pe, [
|
|
128
|
+
(o(!0), c(W, null, X(r(G), (n) => (o(), c("div", {
|
|
130
129
|
key: n.label,
|
|
131
130
|
class: "px-3 py-3 space-y-1"
|
|
132
131
|
}, [
|
|
133
|
-
l("div",
|
|
134
|
-
(o(), x(
|
|
135
|
-
l("span",
|
|
132
|
+
l("div", fe, [
|
|
133
|
+
(o(), x(Z(n.icon), { class: "size-3 text-muted-foreground" })),
|
|
134
|
+
l("span", he, d(n.label), 1)
|
|
136
135
|
]),
|
|
137
|
-
l("p",
|
|
138
|
-
R(n.change) ? (o(), c("div",
|
|
139
|
-
(n.change ?? 0) > 0 ? (o(), x(r(
|
|
136
|
+
l("p", xe, d(n.value), 1),
|
|
137
|
+
R(n.change) ? (o(), c("div", ye, [
|
|
138
|
+
(n.change ?? 0) > 0 ? (o(), x(r(re), {
|
|
140
139
|
key: 0,
|
|
141
140
|
class: _(["size-2.5", y(n.change, n.inverted)])
|
|
142
|
-
}, null, 8, ["class"])) : (n.change ?? 0) < 0 ? (o(), x(r(
|
|
141
|
+
}, null, 8, ["class"])) : (n.change ?? 0) < 0 ? (o(), x(r(F), {
|
|
143
142
|
key: 1,
|
|
144
143
|
class: _(["size-2.5", y(n.change, n.inverted)])
|
|
145
|
-
}, null, 8, ["class"])) : (o(), x(r(
|
|
144
|
+
}, null, 8, ["class"])) : (o(), x(r(oe), {
|
|
146
145
|
key: 2,
|
|
147
146
|
class: "size-2.5 text-muted-foreground"
|
|
148
147
|
})),
|
|
@@ -152,15 +151,15 @@ const ce = { class: "w-full" }, ue = {
|
|
|
152
151
|
])) : U("", !0)
|
|
153
152
|
]))), 128))
|
|
154
153
|
]),
|
|
155
|
-
l("div",
|
|
156
|
-
r(p) ? (o(), c("span",
|
|
154
|
+
l("div", be, [
|
|
155
|
+
r(p) ? (o(), c("span", we, " Fetched " + d(q(r(p))), 1)) : U("", !0),
|
|
157
156
|
h(s, {
|
|
158
|
-
to: `/projects/${r(
|
|
157
|
+
to: `/projects/${r(E)}/modules/${S.instanceId}`,
|
|
159
158
|
class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
|
|
160
159
|
}, {
|
|
161
|
-
default:
|
|
162
|
-
h(r(
|
|
163
|
-
t[2] || (t[2] =
|
|
160
|
+
default: ee(() => [
|
|
161
|
+
h(r(ie), { class: "size-3" }),
|
|
162
|
+
t[2] || (t[2] = te(" View full report ", -1))
|
|
164
163
|
]),
|
|
165
164
|
_: 1
|
|
166
165
|
}, 8, ["to"])
|
|
@@ -171,5 +170,5 @@ const ce = { class: "w-full" }, ue = {
|
|
|
171
170
|
}
|
|
172
171
|
});
|
|
173
172
|
export {
|
|
174
|
-
|
|
173
|
+
Pe as default
|
|
175
174
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@oneclick.dev/cms-kit"),t={name:"Table",description:"Manage tables and structured data.",icon:"mdi-table",version:"1.0.0"},o=e.defineModuleConfig({getItems:{label:"Fetch items",type:"flow"},viewable:{label:"Viewable",type:"checkbox",default:!1},editable:{label:"Editable",type:"checkbox",default:!1},deletable:{label:"Deletable",type:"checkbox",default:!1},addable:{label:"Addable",type:"checkbox",default:!1},searchable:{label:"Searchable",type:"checkbox",default:!1},downloadable:{label:"Downloadable",type:"checkbox",default:!1},allowBulkActions:{label:"Allow Bulk Actions",type:"checkbox",default:!1}}),r=[{path:"",component:()=>Promise.resolve().then(()=>require("./TableView-DD3y_PZ3.js"))}],n=[],i={component:()=>Promise.resolve().then(()=>require("./index-DFQGVHTs.js")),metadata:t,config:o,routes:r,permissions:n},a={name:"Products",description:"Manage products",icon:"mdi-table",version:"1.0.0"},s=e.defineModuleConfig({project:{label:"Database",type:"resource",accept:["FIREBASE"]},productCollection:{label:"Product Collection",type:"input",default:"products"},collectionsCollection:{label:"Collections Collection",type:"input",default:"public/e-commerce:collections"},allowedMediaSources:{label:"Allowed Media Sources",type:"mediaSource",multiple:!0},defaultUploadMediaSource:{label:"Default Upload Media Source",type:"mediaSource",multiple:!1},previewUrl:{label:"Preview URL",type:"input",default:"https://preview.com/shop/{{slug}}"}}),c=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-B-8TLLjh.js"))},{path:"/:productId",component:()=>Promise.resolve().then(()=>require("./Detail-BcboL7NF.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-BcboL7NF.js"))}],p=[{key:"create-product",name:"Create product",description:"Team member can create a new product"},{key:"edit-product",name:"Edit product",description:"Team member can edit a product"},{key:"delete-product",name:"Delete product",description:"Team member can delete a product"}],l=[{name:"getEmptyStock",description:"Get a list of products with empty stock.",executionMode:"api",parameters:{type:"object",properties:{category:{type:"string",description:"Category of the product"}},required:["category"]}},{name:"viewProductDetails",description:"Show a card in chat with details of a product based on product ID.",executionMode:"component",chatComponent:"ProductDetailsCard",parameters:{type:"object",properties:{productId:{type:"string",description:"ID of the product"}},required:["productId"]}}],d={component:()=>Promise.resolve().then(()=>require("./index-R2oUDsjx.js")),metadata:a,config:s,routes:c,permissions:p,tools:l,chatComponents:{ProductDetailsCard:()=>Promise.resolve().then(()=>require("./ProductDetailsCard-Ce11f_9r.js"))}},m={name:"Custom",description:"Custom module",icon:"mdi-table",version:"1.0.0"},u=e.defineModuleConfig({formLayout:{label:"Design View",type:"form"}}),h=[{path:"",component:()=>Promise.resolve().then(()=>require("./View-DfzaVOzS.js"))}],f=[],g={component:()=>Promise.resolve().then(()=>require("./index-CSxYBeVA.js")),metadata:m,config:u,routes:h,permissions:f},y={name:"Promo Codes",description:"Create and manage promo codes",icon:"mdi-table",version:"1.0.0"},b=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},promoCodeCollection:{label:"Promo Code Collection",type:"input",default:"promo-codes"}}),v=[{path:"",component:()=>Promise.resolve().then(()=>require("./Create-CRn2sMHp.js"))},{path:"/promo-codes",component:()=>Promise.resolve().then(()=>require("./Find-Ds6OvuH6.js"))},{path:"/promo-codes/:promoCodeId",component:()=>Promise.resolve().then(()=>require("./Detail-Bxi7lG9x.js"))}],C=[{key:"create-promo-codes",name:"Create promo codes",description:"Team member can create promo codes"},{key:"view-promo-codes",name:"View promo codes",description:"Team member can view promo codes"},{key:"delete-promo-codes",name:"Delete promo codes",description:"Team member can delete promo codes"}],w={component:()=>Promise.resolve().then(()=>require("./index-CkiNvRzs.js")),metadata:y,config:b,routes:v,permissions:C},P={name:"Product Collections",description:"Manage product collections",icon:"mdi-table",version:"1.0.0"},q=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},collectionsCollection:{label:"Collections Collection",type:"input",default:"public/e-commerce:collections"},allowedMediaSources:{label:"Allowed Media Sources",type:"mediaSource",multiple:!0},defaultUploadMediaSource:{label:"Default Upload Media Source",type:"mediaSource",multiple:!1}}),D=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-T-lsy3UZ.js"))},{path:"/:collectionId",component:()=>Promise.resolve().then(()=>require("./Detail-CnK-qbhE.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-CnK-qbhE.js"))}],S=[{key:"create-collection",name:"Create product collection",description:"Team member can create a new product collection"},{key:"edit-collection",name:"Edit product collection",description:"Team member can edit a product collection"},{key:"delete-collection",name:"Delete product collection",description:"Team member can delete a product collection"}],k={component:()=>Promise.resolve().then(()=>require("./index-CwqrAU-H.js")),metadata:P,config:q,routes:D,permissions:S},M={name:"Shipping Options",description:"Manage shipping options",icon:"mdi-table",version:"1.0.0"},A=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},shippingOptionsCollection:{label:"Shipping Options Collection",type:"input",default:"public/e-commerce:shipping-options"}}),$=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-BbvfH1u-.js"))},{path:"/:optionId",component:()=>Promise.resolve().then(()=>require("./Detail-BayNaAg9.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-BayNaAg9.js"))}],T=[{key:"create-option",name:"Create shipping option",description:"Team member can create a new shipping option"},{key:"edit-option",name:"Edit shipping option",description:"Team member can edit a shipping option"},{key:"delete-option",name:"Delete shipping option",description:"Team member can delete a shipping option"}],x={component:()=>Promise.resolve().then(()=>require("./index-Co4ON2Di.js")),metadata:M,config:A,routes:$,permissions:T},E={name:"Google Analytics",description:"Configure Google Analytics settings.",icon:"mdi-google-analytics",version:"1.0.0"},I=e.defineModuleConfig({serviceAccount:{label:"Google Service Account",type:"resource",accept:["GOOGLE_SERVICE_ACCOUNT"]},propertyId:{label:"GA4 Property ID",type:"input",default:""},siteUrl:{label:"Search Console Site URL",type:"input",default:"",placeholder:"https://example.com or sc-domain:example.com",description:"Optional. When set, the module will fetch real keyword data from Google Search Console. Use the same site URL format as shown in Search Console."}}),j=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-pCO_47Zt.js"))},{path:"/acquisition",component:()=>Promise.resolve().then(()=>require("./Acquisition-_-cq972V.js"))},{path:"/content",component:()=>Promise.resolve().then(()=>require("./Content-C-4Cdniz.js"))},{path:"/audience",component:()=>Promise.resolve().then(()=>require("./Audience-QnFQs93n.js"))},{path:"/seo",component:()=>Promise.resolve().then(()=>require("./SeoHealth-EZzDmPDM.js"))}],U=[],Y=[{name:"getTopPages",description:"Show a card in chat with the most popular/visited pages on the website for a given period.",executionMode:"component",chatComponent:"TopPagesCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Use relative formats like 'yesterday', '7daysAgo', '30daysAgo', '90daysAgo', '365daysAgo' or exact dates 'YYYY-MM-DD'. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Use 'today', 'yesterday', or exact dates 'YYYY-MM-DD'. Default: 'today'"},limit:{type:"number",description:"Number of pages to show. Default: 10, max: 50",default:10}},required:[]}},{name:"getVisitorStats",description:"Show a card in chat with visitor/traffic statistics (sessions, users, page views, bounce rate, etc.) for a given period. Use this when the user asks about traffic, visitors, how many people visited, etc.",executionMode:"component",chatComponent:"VisitorStatsCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Use 'yesterday' for yesterday, '7daysAgo' for last week, '30daysAgo' for last month, '90daysAgo' for last quarter, '365daysAgo' for last year, or exact 'YYYY-MM-DD'. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Use 'today', 'yesterday', or exact 'YYYY-MM-DD'. Default: 'today'"}},required:[]}},{name:"getSearchTerms",description:"Show a card in chat with search terms/keywords that bring visitors to the website. Use this when the user asks about keywords, SEO terms, what people search for, or search queries.",executionMode:"component",chatComponent:"SearchTermsCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getTrafficSources",description:"Show a card in chat with where website visitors are coming from (traffic sources, channels, referrals). Use this when the user asks about traffic sources, where visitors come from, referrals, channels, etc.",executionMode:"component",chatComponent:"TrafficSourcesCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getRealtimeVisitors",description:"Show a card in chat with the current real-time active visitors on the website right now.",executionMode:"component",chatComponent:"RealtimeCard",parameters:{type:"object",properties:{},required:[]}},{name:"getCountryBreakdown",description:"Show a card in chat with a geographic breakdown of where website visitors are located. Use this when the user asks about visitor countries, geographic distribution, or where their audience is from.",executionMode:"component",chatComponent:"CountryBreakdownCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getDeviceBreakdown",description:"Show a card in chat with a device breakdown (desktop, mobile, tablet) of website visitors. Use this when the user asks about what devices people use, mobile vs desktop traffic, or if their site is mobile-friendly.",executionMode:"component",chatComponent:"DeviceBreakdownCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getPeakHours",description:"Show a card in chat with peak traffic hours and a weekly heatmap showing when visitors are most active. Use this when the user asks about best times to post, peak hours, busiest times, or when their audience is online.",executionMode:"component",chatComponent:"PeakHoursCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}}],R={component:()=>Promise.resolve().then(()=>require("./index-DwHYfZl_.js")),metadata:E,config:I,routes:j,permissions:U,tools:Y,chatComponents:{TopPagesCard:()=>Promise.resolve().then(()=>require("./TopPagesCard-BA9Are_Z.js")),VisitorStatsCard:()=>Promise.resolve().then(()=>require("./VisitorStatsCard-CAzAZtKD.js")),SearchTermsCard:()=>Promise.resolve().then(()=>require("./SearchTermsCard-BPAdRL-r.js")),TrafficSourcesCard:()=>Promise.resolve().then(()=>require("./TrafficSourcesCard-DV13ZOBq.js")),RealtimeCard:()=>Promise.resolve().then(()=>require("./RealtimeCard-CatAzdxv.js")),CountryBreakdownCard:()=>Promise.resolve().then(()=>require("./CountryBreakdownCard-Ghg0Wz-h.js")),DeviceBreakdownCard:()=>Promise.resolve().then(()=>require("./DeviceBreakdownCard-Cpcj75Rv.js")),PeakHoursCard:()=>Promise.resolve().then(()=>require("./PeakHoursCard-CFIg8dys.js"))}},B={name:"Content Manager",description:"Create and manage content",icon:"mdi-table",version:"1.0.0"},O=e.defineModuleConfig({project:{label:"Database",type:"resource",accept:["FIREBASE"]},domain:{label:"Domain",type:"input",default:"https://domain.com"},collectionsCollection:{label:"Collections Collection",type:"input",default:"content_collections"},contentCollection:{label:"Content Collection",type:"input",default:"content"},allowedMediaSources:{label:"Allowed Media Sources",type:"mediaSource",multiple:!0},defaultUploadMediaSource:{label:"Default Upload Media Source",type:"mediaSource",multiple:!1},supportedLanguages:{label:"Supported Languages",type:"select",predefinedOptions:"languages",multiple:!0},defaultLanguage:{label:"Default Language",type:"select",predefinedOptions:"languages"}}),L=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-CwCAeBnX.js"))},{path:"/collections",component:()=>Promise.resolve().then(()=>require("./Overview-CwCAeBnX.js"))},{path:"/collections/:collectionId",component:()=>Promise.resolve().then(()=>require("./Entries-BPkZ7Jg5.js"))},{path:"/collections/:collectionId/:entryId",component:()=>Promise.resolve().then(()=>require("./ContentEditor-4e80zFyn.js"))},{path:"/components",component:()=>Promise.resolve().then(()=>require("./Components-DXbx0RLV.js"))},{path:"/global-styling",component:()=>Promise.resolve().then(()=>require("./GlobalStyling-CnSlXkZc.js"))}],G=[{key:"create-content",name:"Create content",description:"Team member can create content"},{key:"edit-content",name:"Edit content",description:"Team member can edit content"},{key:"delete-content",name:"Delete content",description:"Team member can delete content"}],F={component:()=>Promise.resolve().then(()=>require("./index-UtjLbLw-.js")),metadata:B,config:O,routes:L,permissions:G},V={name:"Mail Templates",description:"Build templates for your transactional emails.",icon:"mdi-table",version:"1.0.0"},N=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},templateCollection:{label:"Mail Templates Collection",type:"input",default:"mail-templates"}}),_=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-BDlBCUI_.js"))},{path:"/:optionId",component:()=>Promise.resolve().then(()=>require("./Detail-mvSGbnFU.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-mvSGbnFU.js"))}],H=[{key:"create-template",name:"Create mail template",description:"Team member can create a new mail template"},{key:"edit-template",name:"Edit mail template",description:"Team member can edit a mail template"},{key:"delete-template",name:"Delete mail template",description:"Team member can delete a mail template"}],K={component:()=>Promise.resolve().then(()=>require("./index-Cz-baGax.js")),metadata:V,config:N,routes:_,permissions:H},W={name:"Appointments",description:"Create and manage agendas for booking appointments.",icon:"mdi-table",version:"1.0.0"},z=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},mailAccount:{label:"Mail account",type:"resource",accept:["GMAIL"]},agendaCollection:{label:"Agenda Collection",type:"input",default:"agendas"},reservationsCollection:{label:"Reservations Collection",type:"input",default:"bookings_orders"},reservedSpotsCollection:{label:"Reserved Spots Collection",type:"input",default:"reserved_spots"}}),J=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-t0pG5xjA.js"))},{path:"/create",component:()=>Promise.resolve().then(()=>require("./index-D2a6wEPh.js"))},{path:"/create/regular",component:()=>Promise.resolve().then(()=>require("./regular-1LXNPviB.js"))},{path:"/edit/:id",component:()=>Promise.resolve().then(()=>require("./index-DTzdHh6g.js"))},{path:"/edit/:id/agenda",component:()=>Promise.resolve().then(()=>require("./agenda-wNFDKn0G.js"))},{path:"/edit/:id/regular-slots",component:()=>Promise.resolve().then(()=>require("./regular-slots-Bs3WJB3U.js"))},{path:"/edit/:id/exceptions",component:()=>Promise.resolve().then(()=>require("./exceptions-wEQEVzIs.js"))},{path:"/edit/:id/availability",component:()=>Promise.resolve().then(()=>require("./availability-BiBbzEIM.js"))},{path:"/edit/:id/payment",component:()=>Promise.resolve().then(()=>require("./payment-BQaAqQ5q.js"))},{path:"/edit/:id/resources",component:()=>Promise.resolve().then(()=>require("./resources-eb0pivDL.js"))},{path:"/edit/:id/orders",component:()=>Promise.resolve().then(()=>require("./orders-D5GJOZXN.js"))}],Q=[{key:"create-agendas",name:"Create agendas",description:"Team member can create agendas"},{key:"edit-agendas",name:"Edit agendas",description:"Team member can edit agendas"},{key:"delete-agendas",name:"Delete agendas",description:"Team member can delete agendas"},{key:"manage-reservations",name:"Manage reservations",description:"Team member can create, edit, and delete reservations"}],X=[{name:"findAppointment",description:"Show a card in chat with details of an appointment/booking/reservation/...",executionMode:"component",chatComponent:"AppointmentDetailsCard",parameters:{type:"object",properties:{name:{type:"string",description:"Name of the booker"},email:{type:"string",description:"Email of the booker"},date:{type:"string",description:"Date of the appointment (YYYY-MM-DD)"}},required:["date"]}},{name:"getRecentAppointments",description:"Show a table in chat with recent appointments, default loading the latest 20 appointments.",executionMode:"component",chatComponent:"AppointmentListTable",parameters:{type:"object",properties:{quantity:{type:"number",description:"Number of appointments to load. default: 20 max: 100",default:20}},required:["quantity"]}},{name:"changeAppointmentDetails",description:"Show a card in chat where user can edit name, email and date of an existing appointment.",executionMode:"component",chatComponent:"AppointmentEditor",parameters:{type:"object",properties:{orderId:{type:"string",description:"ID of the order / appointment. This is NOT the reservation ID."}},required:["orderId"]}}],Z={component:()=>Promise.resolve().then(()=>require("./index-9HVlmvK3.js")),metadata:W,config:z,routes:J,permissions:Q,tools:X,chatComponents:{AppointmentDetailsCard:()=>Promise.resolve().then(()=>require("./AppointmentDetailsCard-BfBwWxTU.js")),AppointmentListTable:()=>Promise.resolve().then(()=>require("./AppointmentListTable-Dk-CnNR6.js")),AppointmentEditor:()=>Promise.resolve().then(()=>require("./AppointmentEditor-CaTfbkIf.js"))}};exports.appointments=Z;exports.contentManager=F;exports.custom=g;exports.googleAnalytics=R;exports.mailTemplates=K;exports.productCollections=k;exports.products=d;exports.promoCodes=w;exports.shippingOptions=x;exports.table=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@oneclick.dev/cms-kit"),t={name:"Table",description:"Manage tables and structured data.",icon:"mdi-table",version:"1.0.0"},o=e.defineModuleConfig({getItems:{label:"Fetch items",type:"flow"},viewable:{label:"Viewable",type:"checkbox",default:!1},editable:{label:"Editable",type:"checkbox",default:!1},deletable:{label:"Deletable",type:"checkbox",default:!1},addable:{label:"Addable",type:"checkbox",default:!1},searchable:{label:"Searchable",type:"checkbox",default:!1},downloadable:{label:"Downloadable",type:"checkbox",default:!1},allowBulkActions:{label:"Allow Bulk Actions",type:"checkbox",default:!1}}),r=[{path:"",component:()=>Promise.resolve().then(()=>require("./TableView-DD3y_PZ3.js"))}],n=[],i={component:()=>Promise.resolve().then(()=>require("./index-DFQGVHTs.js")),metadata:t,config:o,routes:r,permissions:n},a={name:"Products",description:"Manage products",icon:"mdi-table",version:"1.0.0"},s=e.defineModuleConfig({project:{label:"Database",type:"resource",accept:["FIREBASE"]},productCollection:{label:"Product Collection",type:"input",default:"products"},collectionsCollection:{label:"Collections Collection",type:"input",default:"public/e-commerce:collections"},allowedMediaSources:{label:"Allowed Media Sources",type:"mediaSource",multiple:!0},defaultUploadMediaSource:{label:"Default Upload Media Source",type:"mediaSource",multiple:!1},previewUrl:{label:"Preview URL",type:"input",default:"https://preview.com/shop/{{slug}}"}}),c=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-B-8TLLjh.js"))},{path:"/:productId",component:()=>Promise.resolve().then(()=>require("./Detail-BcboL7NF.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-BcboL7NF.js"))}],p=[{key:"create-product",name:"Create product",description:"Team member can create a new product"},{key:"edit-product",name:"Edit product",description:"Team member can edit a product"},{key:"delete-product",name:"Delete product",description:"Team member can delete a product"}],l=[{name:"getEmptyStock",description:"Get a list of products with empty stock.",executionMode:"api",parameters:{type:"object",properties:{category:{type:"string",description:"Category of the product"}},required:["category"]}},{name:"viewProductDetails",description:"Show a card in chat with details of a product based on product ID.",executionMode:"component",chatComponent:"ProductDetailsCard",parameters:{type:"object",properties:{productId:{type:"string",description:"ID of the product"}},required:["productId"]}}],d={component:()=>Promise.resolve().then(()=>require("./index-R2oUDsjx.js")),metadata:a,config:s,routes:c,permissions:p,tools:l,chatComponents:{ProductDetailsCard:()=>Promise.resolve().then(()=>require("./ProductDetailsCard-BBOorNmB.js"))}},m={name:"Custom",description:"Custom module",icon:"mdi-table",version:"1.0.0"},u=e.defineModuleConfig({formLayout:{label:"Design View",type:"form"}}),h=[{path:"",component:()=>Promise.resolve().then(()=>require("./View-DfzaVOzS.js"))}],f=[],g={component:()=>Promise.resolve().then(()=>require("./index-CSxYBeVA.js")),metadata:m,config:u,routes:h,permissions:f},y={name:"Promo Codes",description:"Create and manage promo codes",icon:"mdi-table",version:"1.0.0"},b=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},promoCodeCollection:{label:"Promo Code Collection",type:"input",default:"promo-codes"}}),v=[{path:"",component:()=>Promise.resolve().then(()=>require("./Create-CRn2sMHp.js"))},{path:"/promo-codes",component:()=>Promise.resolve().then(()=>require("./Find-Ds6OvuH6.js"))},{path:"/promo-codes/:promoCodeId",component:()=>Promise.resolve().then(()=>require("./Detail-Bxi7lG9x.js"))}],C=[{key:"create-promo-codes",name:"Create promo codes",description:"Team member can create promo codes"},{key:"view-promo-codes",name:"View promo codes",description:"Team member can view promo codes"},{key:"delete-promo-codes",name:"Delete promo codes",description:"Team member can delete promo codes"}],w={component:()=>Promise.resolve().then(()=>require("./index-CkiNvRzs.js")),metadata:y,config:b,routes:v,permissions:C},P={name:"Product Collections",description:"Manage product collections",icon:"mdi-table",version:"1.0.0"},q=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},collectionsCollection:{label:"Collections Collection",type:"input",default:"public/e-commerce:collections"},allowedMediaSources:{label:"Allowed Media Sources",type:"mediaSource",multiple:!0},defaultUploadMediaSource:{label:"Default Upload Media Source",type:"mediaSource",multiple:!1}}),D=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-T-lsy3UZ.js"))},{path:"/:collectionId",component:()=>Promise.resolve().then(()=>require("./Detail-CnK-qbhE.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-CnK-qbhE.js"))}],S=[{key:"create-collection",name:"Create product collection",description:"Team member can create a new product collection"},{key:"edit-collection",name:"Edit product collection",description:"Team member can edit a product collection"},{key:"delete-collection",name:"Delete product collection",description:"Team member can delete a product collection"}],k={component:()=>Promise.resolve().then(()=>require("./index-CwqrAU-H.js")),metadata:P,config:q,routes:D,permissions:S},M={name:"Shipping Options",description:"Manage shipping options",icon:"mdi-table",version:"1.0.0"},A=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},shippingOptionsCollection:{label:"Shipping Options Collection",type:"input",default:"public/e-commerce:shipping-options"}}),$=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-BbvfH1u-.js"))},{path:"/:optionId",component:()=>Promise.resolve().then(()=>require("./Detail-BayNaAg9.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-BayNaAg9.js"))}],T=[{key:"create-option",name:"Create shipping option",description:"Team member can create a new shipping option"},{key:"edit-option",name:"Edit shipping option",description:"Team member can edit a shipping option"},{key:"delete-option",name:"Delete shipping option",description:"Team member can delete a shipping option"}],x={component:()=>Promise.resolve().then(()=>require("./index-Co4ON2Di.js")),metadata:M,config:A,routes:$,permissions:T},E={name:"Google Analytics",description:"Configure Google Analytics settings.",icon:"mdi-google-analytics",version:"1.0.0"},I=e.defineModuleConfig({serviceAccount:{label:"Google Service Account",type:"resource",accept:["GOOGLE_SERVICE_ACCOUNT"]},propertyId:{label:"GA4 Property ID",type:"input",default:""},siteUrl:{label:"Search Console Site URL",type:"input",default:"",placeholder:"https://example.com or sc-domain:example.com",description:"Optional. When set, the module will fetch real keyword data from Google Search Console. Use the same site URL format as shown in Search Console."}}),j=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-pCO_47Zt.js"))},{path:"/acquisition",component:()=>Promise.resolve().then(()=>require("./Acquisition-_-cq972V.js"))},{path:"/content",component:()=>Promise.resolve().then(()=>require("./Content-C-4Cdniz.js"))},{path:"/audience",component:()=>Promise.resolve().then(()=>require("./Audience-QnFQs93n.js"))},{path:"/seo",component:()=>Promise.resolve().then(()=>require("./SeoHealth-EZzDmPDM.js"))}],U=[],Y=[{name:"getTopPages",description:"Show a card in chat with the most popular/visited pages on the website for a given period.",executionMode:"component",chatComponent:"TopPagesCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Use relative formats like 'yesterday', '7daysAgo', '30daysAgo', '90daysAgo', '365daysAgo' or exact dates 'YYYY-MM-DD'. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Use 'today', 'yesterday', or exact dates 'YYYY-MM-DD'. Default: 'today'"},limit:{type:"number",description:"Number of pages to show. Default: 10, max: 50",default:10}},required:[]}},{name:"getVisitorStats",description:"Show a card in chat with visitor/traffic statistics (sessions, users, page views, bounce rate, etc.) for a given period. Use this when the user asks about traffic, visitors, how many people visited, etc.",executionMode:"component",chatComponent:"VisitorStatsCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Use 'yesterday' for yesterday, '7daysAgo' for last week, '30daysAgo' for last month, '90daysAgo' for last quarter, '365daysAgo' for last year, or exact 'YYYY-MM-DD'. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Use 'today', 'yesterday', or exact 'YYYY-MM-DD'. Default: 'today'"}},required:[]}},{name:"getSearchTerms",description:"Show a card in chat with search terms/keywords that bring visitors to the website. Use this when the user asks about keywords, SEO terms, what people search for, or search queries.",executionMode:"component",chatComponent:"SearchTermsCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getTrafficSources",description:"Show a card in chat with where website visitors are coming from (traffic sources, channels, referrals). Use this when the user asks about traffic sources, where visitors come from, referrals, channels, etc.",executionMode:"component",chatComponent:"TrafficSourcesCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getRealtimeVisitors",description:"Show a card in chat with the current real-time active visitors on the website right now.",executionMode:"component",chatComponent:"RealtimeCard",parameters:{type:"object",properties:{},required:[]}},{name:"getCountryBreakdown",description:"Show a card in chat with a geographic breakdown of where website visitors are located. Use this when the user asks about visitor countries, geographic distribution, or where their audience is from.",executionMode:"component",chatComponent:"CountryBreakdownCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getDeviceBreakdown",description:"Show a card in chat with a device breakdown (desktop, mobile, tablet) of website visitors. Use this when the user asks about what devices people use, mobile vs desktop traffic, or if their site is mobile-friendly.",executionMode:"component",chatComponent:"DeviceBreakdownCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}},{name:"getPeakHours",description:"Show a card in chat with peak traffic hours and a weekly heatmap showing when visitors are most active. Use this when the user asks about best times to post, peak hours, busiest times, or when their audience is online.",executionMode:"component",chatComponent:"PeakHoursCard",parameters:{type:"object",properties:{startDate:{type:"string",description:"Start date for the report. Default: '30daysAgo'"},endDate:{type:"string",description:"End date for the report. Default: 'today'"}},required:[]}}],R={component:()=>Promise.resolve().then(()=>require("./index-DwHYfZl_.js")),metadata:E,config:I,routes:j,permissions:U,tools:Y,chatComponents:{TopPagesCard:()=>Promise.resolve().then(()=>require("./TopPagesCard-CgtNyhwY.js")),VisitorStatsCard:()=>Promise.resolve().then(()=>require("./VisitorStatsCard-Cs6jPehw.js")),SearchTermsCard:()=>Promise.resolve().then(()=>require("./SearchTermsCard-DmyhGQVM.js")),TrafficSourcesCard:()=>Promise.resolve().then(()=>require("./TrafficSourcesCard-CPAxaQTi.js")),RealtimeCard:()=>Promise.resolve().then(()=>require("./RealtimeCard-DESm9Fs_.js")),CountryBreakdownCard:()=>Promise.resolve().then(()=>require("./CountryBreakdownCard-BpDXbxwZ.js")),DeviceBreakdownCard:()=>Promise.resolve().then(()=>require("./DeviceBreakdownCard-OXiU9Cf0.js")),PeakHoursCard:()=>Promise.resolve().then(()=>require("./PeakHoursCard-OkgI1vnd.js"))}},B={name:"Content Manager",description:"Create and manage content",icon:"mdi-table",version:"1.0.0"},O=e.defineModuleConfig({project:{label:"Database",type:"resource",accept:["FIREBASE"]},domain:{label:"Domain",type:"input",default:"https://domain.com"},collectionsCollection:{label:"Collections Collection",type:"input",default:"content_collections"},contentCollection:{label:"Content Collection",type:"input",default:"content"},allowedMediaSources:{label:"Allowed Media Sources",type:"mediaSource",multiple:!0},defaultUploadMediaSource:{label:"Default Upload Media Source",type:"mediaSource",multiple:!1},supportedLanguages:{label:"Supported Languages",type:"select",predefinedOptions:"languages",multiple:!0},defaultLanguage:{label:"Default Language",type:"select",predefinedOptions:"languages"}}),L=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-CwCAeBnX.js"))},{path:"/collections",component:()=>Promise.resolve().then(()=>require("./Overview-CwCAeBnX.js"))},{path:"/collections/:collectionId",component:()=>Promise.resolve().then(()=>require("./Entries-BPkZ7Jg5.js"))},{path:"/collections/:collectionId/:entryId",component:()=>Promise.resolve().then(()=>require("./ContentEditor-4e80zFyn.js"))},{path:"/components",component:()=>Promise.resolve().then(()=>require("./Components-DXbx0RLV.js"))},{path:"/global-styling",component:()=>Promise.resolve().then(()=>require("./GlobalStyling-CnSlXkZc.js"))}],G=[{key:"create-content",name:"Create content",description:"Team member can create content"},{key:"edit-content",name:"Edit content",description:"Team member can edit content"},{key:"delete-content",name:"Delete content",description:"Team member can delete content"}],F={component:()=>Promise.resolve().then(()=>require("./index-UtjLbLw-.js")),metadata:B,config:O,routes:L,permissions:G},V={name:"Mail Templates",description:"Build templates for your transactional emails.",icon:"mdi-table",version:"1.0.0"},N=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},templateCollection:{label:"Mail Templates Collection",type:"input",default:"mail-templates"}}),_=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-BDlBCUI_.js"))},{path:"/:optionId",component:()=>Promise.resolve().then(()=>require("./Detail-mvSGbnFU.js"))},{path:"/new",component:()=>Promise.resolve().then(()=>require("./Detail-mvSGbnFU.js"))}],H=[{key:"create-template",name:"Create mail template",description:"Team member can create a new mail template"},{key:"edit-template",name:"Edit mail template",description:"Team member can edit a mail template"},{key:"delete-template",name:"Delete mail template",description:"Team member can delete a mail template"}],K={component:()=>Promise.resolve().then(()=>require("./index-Cz-baGax.js")),metadata:V,config:N,routes:_,permissions:H},W={name:"Appointments",description:"Create and manage agendas for booking appointments.",icon:"mdi-table",version:"1.0.0"},z=e.defineModuleConfig({project:{label:"Project",type:"resource",accept:["FIREBASE"]},mailAccount:{label:"Mail account",type:"resource",accept:["GMAIL"]},agendaCollection:{label:"Agenda Collection",type:"input",default:"agendas"},reservationsCollection:{label:"Reservations Collection",type:"input",default:"bookings_orders"},reservedSpotsCollection:{label:"Reserved Spots Collection",type:"input",default:"reserved_spots"}}),J=[{path:"",component:()=>Promise.resolve().then(()=>require("./Overview-t0pG5xjA.js"))},{path:"/create",component:()=>Promise.resolve().then(()=>require("./index-D2a6wEPh.js"))},{path:"/create/regular",component:()=>Promise.resolve().then(()=>require("./regular-1LXNPviB.js"))},{path:"/edit/:id",component:()=>Promise.resolve().then(()=>require("./index-DTzdHh6g.js"))},{path:"/edit/:id/agenda",component:()=>Promise.resolve().then(()=>require("./agenda-wNFDKn0G.js"))},{path:"/edit/:id/regular-slots",component:()=>Promise.resolve().then(()=>require("./regular-slots-Bs3WJB3U.js"))},{path:"/edit/:id/exceptions",component:()=>Promise.resolve().then(()=>require("./exceptions-wEQEVzIs.js"))},{path:"/edit/:id/availability",component:()=>Promise.resolve().then(()=>require("./availability-BiBbzEIM.js"))},{path:"/edit/:id/payment",component:()=>Promise.resolve().then(()=>require("./payment-BQaAqQ5q.js"))},{path:"/edit/:id/resources",component:()=>Promise.resolve().then(()=>require("./resources-eb0pivDL.js"))},{path:"/edit/:id/orders",component:()=>Promise.resolve().then(()=>require("./orders-D5GJOZXN.js"))}],Q=[{key:"create-agendas",name:"Create agendas",description:"Team member can create agendas"},{key:"edit-agendas",name:"Edit agendas",description:"Team member can edit agendas"},{key:"delete-agendas",name:"Delete agendas",description:"Team member can delete agendas"},{key:"manage-reservations",name:"Manage reservations",description:"Team member can create, edit, and delete reservations"}],X=[{name:"findAppointment",description:"Show a card in chat with details of an appointment/booking/reservation/...",executionMode:"component",chatComponent:"AppointmentDetailsCard",parameters:{type:"object",properties:{name:{type:"string",description:"Name of the booker"},email:{type:"string",description:"Email of the booker"},date:{type:"string",description:"Date of the appointment (YYYY-MM-DD)"}},required:["date"]}},{name:"getRecentAppointments",description:"Show a table in chat with recent appointments, default loading the latest 20 appointments.",executionMode:"component",chatComponent:"AppointmentListTable",parameters:{type:"object",properties:{quantity:{type:"number",description:"Number of appointments to load. default: 20 max: 100",default:20}},required:["quantity"]}},{name:"changeAppointmentDetails",description:"Show a card in chat where user can edit name, email and date of an existing appointment.",executionMode:"component",chatComponent:"AppointmentEditor",parameters:{type:"object",properties:{orderId:{type:"string",description:"ID of the order / appointment. This is NOT the reservation ID."}},required:["orderId"]}}],Z={component:()=>Promise.resolve().then(()=>require("./index-9HVlmvK3.js")),metadata:W,config:z,routes:J,permissions:Q,tools:X,chatComponents:{AppointmentDetailsCard:()=>Promise.resolve().then(()=>require("./AppointmentDetailsCard-LL-6PARb.js")),AppointmentListTable:()=>Promise.resolve().then(()=>require("./AppointmentListTable-DNvvb4sz.js")),AppointmentEditor:()=>Promise.resolve().then(()=>require("./AppointmentEditor-CaTfbkIf.js"))}};exports.appointments=Z;exports.contentManager=F;exports.custom=g;exports.googleAnalytics=R;exports.mailTemplates=K;exports.productCollections=k;exports.products=d;exports.promoCodes=w;exports.shippingOptions=x;exports.table=i;
|
package/dist/index.mjs
CHANGED
|
@@ -140,7 +140,7 @@ const t = {
|
|
|
140
140
|
permissions: s,
|
|
141
141
|
tools: c,
|
|
142
142
|
chatComponents: {
|
|
143
|
-
ProductDetailsCard: () => import("./ProductDetailsCard-
|
|
143
|
+
ProductDetailsCard: () => import("./ProductDetailsCard-CYK9Mtt4.mjs")
|
|
144
144
|
}
|
|
145
145
|
}, d = {
|
|
146
146
|
name: "Custom",
|
|
@@ -454,14 +454,14 @@ const t = {
|
|
|
454
454
|
permissions: T,
|
|
455
455
|
tools: E,
|
|
456
456
|
chatComponents: {
|
|
457
|
-
TopPagesCard: () => import("./TopPagesCard-
|
|
458
|
-
VisitorStatsCard: () => import("./VisitorStatsCard-
|
|
459
|
-
SearchTermsCard: () => import("./SearchTermsCard-
|
|
460
|
-
TrafficSourcesCard: () => import("./TrafficSourcesCard-
|
|
461
|
-
RealtimeCard: () => import("./RealtimeCard-
|
|
462
|
-
CountryBreakdownCard: () => import("./CountryBreakdownCard-
|
|
463
|
-
DeviceBreakdownCard: () => import("./DeviceBreakdownCard-
|
|
464
|
-
PeakHoursCard: () => import("./PeakHoursCard-
|
|
457
|
+
TopPagesCard: () => import("./TopPagesCard-CRIa3rSZ.mjs"),
|
|
458
|
+
VisitorStatsCard: () => import("./VisitorStatsCard-DMULybKV.mjs"),
|
|
459
|
+
SearchTermsCard: () => import("./SearchTermsCard-BVHFHWUZ.mjs"),
|
|
460
|
+
TrafficSourcesCard: () => import("./TrafficSourcesCard-Ct20QYax.mjs"),
|
|
461
|
+
RealtimeCard: () => import("./RealtimeCard-tNUSIw6B.mjs"),
|
|
462
|
+
CountryBreakdownCard: () => import("./CountryBreakdownCard-oDzmpvAd.mjs"),
|
|
463
|
+
DeviceBreakdownCard: () => import("./DeviceBreakdownCard-Oh_yzipG.mjs"),
|
|
464
|
+
PeakHoursCard: () => import("./PeakHoursCard-DzNo4SNo.mjs")
|
|
465
465
|
}
|
|
466
466
|
}, I = {
|
|
467
467
|
name: "Content Manager",
|
|
@@ -680,8 +680,8 @@ const t = {
|
|
|
680
680
|
permissions: F,
|
|
681
681
|
tools: V,
|
|
682
682
|
chatComponents: {
|
|
683
|
-
AppointmentDetailsCard: () => import("./AppointmentDetailsCard-
|
|
684
|
-
AppointmentListTable: () => import("./AppointmentListTable-
|
|
683
|
+
AppointmentDetailsCard: () => import("./AppointmentDetailsCard-Bu9VzIRx.mjs"),
|
|
684
|
+
AppointmentListTable: () => import("./AppointmentListTable-B8YLwOfT.mjs"),
|
|
685
685
|
AppointmentEditor: () => import("./AppointmentEditor-BeOtYV6u.mjs")
|
|
686
686
|
}
|
|
687
687
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneclick.dev/cms-core-modules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@formkit/drag-and-drop": "^0.5.3",
|
|
30
30
|
"@internationalized/date": "^3.8.0",
|
|
31
|
-
"@oneclick.dev/cms-kit": "0.0.
|
|
31
|
+
"@oneclick.dev/cms-kit": "0.0.89",
|
|
32
32
|
"@tanstack/vue-table": "^8.21.3",
|
|
33
33
|
"@vee-validate/zod": "^4.15.0",
|
|
34
34
|
"@vue-flow/core": "^1.48.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("lucide-vue-next"),p=require("@oneclick.dev/cms-kit"),E={class:"w-full"},h={key:0,class:"flex items-center gap-2 py-3"},S={key:1,class:"text-xs text-destructive py-2"},B={key:2,class:"rounded-xl border bg-background p-4 text-center"},D={key:3,class:"space-y-3"},I={class:"flex items-start gap-3"},C={class:"shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center"},z={class:"flex-1 min-w-0"},T={class:"text-sm font-semibold truncate"},w={class:"flex items-center gap-2 mt-1 flex-wrap"},j={key:0,class:"text-xs font-medium"},A={class:"grid grid-cols-2 gap-2 text-xs text-muted-foreground"},L={class:"flex items-center gap-1.5"},P={class:"truncate"},$={class:"flex items-center gap-1.5"},M={class:"flex items-center gap-1.5"},q={class:"flex items-center gap-1.5"},F=e.defineComponent({__name:"AppointmentDetailsCard",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(u,{emit:f}){const d=u,g=f,x=p.useRoute(),v=e.computed(()=>x.params.slug),N=p.useModuleApi(d.instanceId),c=e.ref(!0),a=e.ref(null),l=e.ref([]);async function k(){const{name:s,email:n,date:i}=d.resolvedArgs||{};if(!i){a.value="No date provided",c.value=!1;return}c.value=!0,a.value=null;try{const t=new URLSearchParams;s&&t.set("name",s),n&&t.set("email",n),i&&t.set("date",i);const V=await N.get(`/appointments/find?${t.toString()}`);l.value=V.appointments||[],m({count:l.value.length,appointments:l.value.map(r=>({orderId:r.orderId,reservationId:r.reservationId,customerName:`${r.customerInfo?.firstName||""} ${r.customerInfo?.lastName||""}`.trim(),email:r.customerInfo?.email,date:r.date,startTime:r.startTime,endTime:r.endTime,spots:r.spots,status:r.reservationStatus||r.status,price:r.reservationPrice}))})}catch(t){a.value=t?.data?.statusMessage||t?.message||"Failed to find appointment",m(`Error finding appointment: ${a.value}`)}finally{c.value=!1}}e.onMounted(()=>{k()});function m(s){d.status!=="completed"&&g("submit",s)}const _=s=>{switch(s){case"approved":return"text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";case"needs_approval":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";case"rejected":case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20"}},y=s=>{switch(s){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return s||"Pending"}},b=s=>s==null?"":`€${s.toFixed(2)}`;return(s,n)=>{const i=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",E,[e.unref(c)?(e.openBlock(),e.createElementBlock("div",h,[e.createVNode(e.unref(o.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),n[0]||(n[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Searching appointments…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(e.unref(a)),1)):e.unref(l).length===0?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.unref(o.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),n[1]||(n[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No appointments found for the given criteria.",-1))])):(e.openBlock(),e.createElementBlock("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),t=>(e.openBlock(),e.createElementBlock("div",{key:t.reservationId||t.orderId,class:"rounded-xl border bg-background p-3 space-y-3"},[e.createElementVNode("div",I,[e.createElementVNode("div",C,[e.createVNode(e.unref(o.CalendarDays),{class:"size-5 text-primary"})]),e.createElementVNode("div",z,[e.createElementVNode("p",T,e.toDisplayString(t.customerInfo?.firstName)+" "+e.toDisplayString(t.customerInfo?.lastName),1),e.createElementVNode("div",w,[e.createElementVNode("span",{class:e.normalizeClass(["text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase",_(t.reservationStatus||t.status)])},e.toDisplayString(y(t.reservationStatus||t.status)),3),t.reservationPrice!=null?(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(b(t.reservationPrice)),1)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",A,[e.createElementVNode("div",L,[e.createVNode(e.unref(o.Mail),{class:"size-3"}),e.createElementVNode("span",P,e.toDisplayString(t.customerInfo?.email||"—"),1)]),e.createElementVNode("div",$,[e.createVNode(e.unref(o.CalendarDays),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(t.date),1)]),e.createElementVNode("div",M,[e.createVNode(e.unref(o.Clock),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(t.startTime)+" – "+e.toDisplayString(t.endTime),1)]),e.createElementVNode("div",q,[e.createVNode(e.unref(o.Users),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(t.spots||1)+" "+e.toDisplayString((t.spots||1)===1?"spot":"spots"),1)])]),e.createVNode(i,{to:`/projects/${e.unref(v)}/modules/${u.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ExternalLink),{class:"size-3"}),n[2]||(n[2]=e.createTextVNode(" Open in agenda ",-1))]),_:1},8,["to"])]))),128))]))])}}});exports.default=F;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),m=require("@oneclick.dev/cms-kit"),k={class:"w-full"},E={key:0,class:"flex items-center gap-2 py-3"},V={key:1,class:"text-xs text-destructive py-2"},w={key:2,class:"rounded-xl border bg-background p-4 text-center"},S={key:3,class:"rounded-xl border bg-background overflow-hidden"},D={class:"overflow-x-auto"},I={class:"w-full text-xs"},B={class:"px-3 py-2"},T={class:"font-medium truncate max-w-[160px]"},C={class:"text-muted-foreground truncate max-w-[160px]"},L={class:"px-3 py-2 whitespace-nowrap"},j={class:"px-3 py-2 whitespace-nowrap"},A={class:"px-3 py-2 text-center"},$={class:"px-3 py-2"},q={class:"px-3 py-2 text-right font-medium whitespace-nowrap"},P={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},z={class:"text-xs text-muted-foreground"},M=e.defineComponent({__name:"AppointmentListTable",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(i,{emit:p}){const d=i,x=p,f=m.useRoute(),g=e.computed(()=>f.params.slug),y=m.useModuleApi(d.instanceId),l=e.ref(!0),a=e.ref(null),s=e.ref([]);async function b(){const t=d.resolvedArgs?.quantity||20;l.value=!0,a.value=null;try{const r=await y.get(`/appointments?quantity=${t}`);s.value=r.appointments||[],u({count:s.value.length,appointments:s.value.map(o=>({orderId:o.orderId,reservationId:o.reservationId,customerName:`${o.customerInfo?.firstName||""} ${o.customerInfo?.lastName||""}`.trim(),email:o.customerInfo?.email,date:o.date,startTime:o.startTime,endTime:o.endTime,spots:o.spots,status:o.reservationStatus||o.status,price:o.reservationPrice}))})}catch(r){a.value=r?.data?.statusMessage||r?.message||"Failed to load appointments",u(`Error loading appointments: ${a.value}`)}finally{l.value=!1}}e.onMounted(()=>{b()});function u(t){d.status!=="completed"&&x("submit",t)}const N=t=>{switch(t){case"approved":return"text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";case"needs_approval":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";case"rejected":case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20"}},v=t=>{switch(t){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return t||"Pending"}},h=t=>t==null?"—":`€${t.toFixed(2)}`,_=t=>{if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return t}};return(t,r)=>{const o=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",k,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),r[0]||(r[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading appointments…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(e.unref(a)),1)):e.unref(s).length===0?(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(e.unref(c.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),r[1]||(r[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No recent appointments found.",-1))])):(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",D,[e.createElementVNode("table",I,[r[2]||(r[2]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b bg-muted/40"},[e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Customer"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Date"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Time"),e.createElementVNode("th",{class:"text-center px-3 py-2 font-medium text-muted-foreground"},"Spots"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Status"),e.createElementVNode("th",{class:"text-right px-3 py-2 font-medium text-muted-foreground"},"Price")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),n=>(e.openBlock(),e.createElementBlock("tr",{key:n.reservationId||n.orderId,class:"border-b last:border-b-0 hover:bg-muted/30 transition-colors"},[e.createElementVNode("td",B,[e.createElementVNode("div",T,e.toDisplayString(n.customerInfo?.firstName)+" "+e.toDisplayString(n.customerInfo?.lastName),1),e.createElementVNode("div",C,e.toDisplayString(n.customerInfo?.email),1)]),e.createElementVNode("td",L,e.toDisplayString(_(n.date)),1),e.createElementVNode("td",j,e.toDisplayString(n.startTime)+" – "+e.toDisplayString(n.endTime),1),e.createElementVNode("td",A,e.toDisplayString(n.spots||1),1),e.createElementVNode("td",$,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap",N(n.reservationStatus||n.status)])},e.toDisplayString(v(n.reservationStatus||n.status)),3)]),e.createElementVNode("td",q,e.toDisplayString(h(n.reservationPrice)),1)]))),128))])])]),e.createElementVNode("div",P,[e.createElementVNode("span",z,e.toDisplayString(e.unref(s).length)+" appointment"+e.toDisplayString(e.unref(s).length===1?"":"s"),1),e.createVNode(o,{to:`/projects/${e.unref(g)}/modules/${i.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ExternalLink),{class:"size-3"}),r[3]||(r[3]=e.createTextVNode(" View all ",-1))]),_:1},8,["to"])])]))])}}});exports.default=M;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("lucide-vue-next"),x=require("@oneclick.dev/cms-kit"),A={class:"w-full"},C={key:0,class:"flex items-center gap-2 py-3"},L={key:1,class:"text-xs text-destructive py-2"},$={key:2,class:"rounded-xl border bg-background p-4 text-center space-y-2"},z={key:3,class:"rounded-xl border bg-background overflow-hidden"},T={class:"px-3 py-2 border-b bg-muted/40 flex items-center justify-between"},F={class:"flex items-center gap-2"},U={class:"text-[10px] text-muted-foreground"},I={class:"divide-y"},M={class:"flex items-center gap-2 mb-1.5"},j={class:"text-sm shrink-0"},P={class:"text-xs font-medium truncate flex-1"},R={class:"text-[10px] text-muted-foreground"},G={class:"ml-7 space-y-1.5"},q={class:"h-1.5 rounded-full bg-muted overflow-hidden"},K={class:"flex items-center gap-3 text-[10px] text-muted-foreground"},O={class:"flex items-center gap-1"},H={class:"flex items-center gap-1"},J={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},Z={class:"text-[10px] text-muted-foreground"},Q=e.defineComponent({__name:"CountryBreakdownCard",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(p,{emit:y}){const i=p,h=y,v=x.useRoute(),N=e.computed(()=>v.params.slug),_=x.useModuleApi(i.instanceId),d=e.ref(!0),c=e.ref(null),o=e.ref([]),u=e.ref(null),V=t=>({"United States":"🇺🇸","United Kingdom":"🇬🇧",Germany:"🇩🇪",France:"🇫🇷",Netherlands:"🇳🇱",Belgium:"🇧🇪",Canada:"🇨🇦",Australia:"🇦🇺",India:"🇮🇳",Brazil:"🇧🇷",Spain:"🇪🇸",Italy:"🇮🇹",Japan:"🇯🇵",China:"🇨🇳","South Korea":"🇰🇷",Mexico:"🇲🇽",Russia:"🇷🇺",Sweden:"🇸🇪",Norway:"🇳🇴",Denmark:"🇩🇰",Finland:"🇫🇮",Poland:"🇵🇱",Switzerland:"🇨🇭",Austria:"🇦🇹",Portugal:"🇵🇹",Ireland:"🇮🇪","New Zealand":"🇳🇿",Singapore:"🇸🇬","South Africa":"🇿🇦",Turkey:"🇹🇷",Indonesia:"🇮🇩",Thailand:"🇹🇭",Philippines:"🇵🇭",Vietnam:"🇻🇳",Argentina:"🇦🇷",Colombia:"🇨🇴",Israel:"🇮🇱",UAE:"🇦🇪","United Arab Emirates":"🇦🇪","Czech Republic":"🇨🇿",Czechia:"🇨🇿",Romania:"🇷🇴",Hungary:"🇭🇺",Ukraine:"🇺🇦",Greece:"🇬🇷",Luxembourg:"🇱🇺"})[t]||"🌍";function b(){const t=i.resolvedArgs?._cachedData;return t?(o.value=(t.countries||[]).map(s=>({country:s.country,sessions:s.sessions,totalUsers:s.users})),u.value=i.resolvedArgs._fetchedAt||null,d.value=!1,!0):!1}async function k(){const{startDate:t,endDate:s}=i.resolvedArgs||{};d.value=!0,c.value=null;try{const n=new URLSearchParams;t&&n.set("startDate",t),s&&n.set("endDate",s);const r=await _.get(`/countries?${n.toString()}`);o.value=r.rows||[],u.value=new Date().toISOString();const m=o.value.reduce((a,w)=>a+(w.sessions||0),0);f({count:o.value.length,countries:o.value.map(a=>({country:a.country,sessions:a.sessions,users:a.totalUsers,share:`${(a.sessions/m*100).toFixed(1)}%`})),suggestion:o.value.length===0?"No geographic data found for this period.":`Top countries by traffic: ${o.value.slice(0,5).map(a=>`${a.country} (${(a.sessions/m*100).toFixed(0)}%)`).join(", ")}.`})}catch(n){c.value=n?.data?.statusMessage||n?.message||"Failed to load country data",f(`Error loading country data: ${c.value}`)}finally{d.value=!1}}e.onMounted(()=>{i.status==="completed"&&b()||k()});function f(t){i.status!=="completed"&&h("submit",t)}const g=t=>t==null?"0":Math.round(t).toLocaleString(),E=t=>t?new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"",S=e.computed(()=>o.value.reduce((t,s)=>t+(s.sessions||0),0)||1),D=e.computed(()=>Math.max(...o.value.map(t=>t.sessions||0),1)),B=e.computed(()=>{const{startDate:t,endDate:s}=i.resolvedArgs||{};if(!t&&!s)return"Last 30 days";const n=t||"30daysAgo",r=n.match(/^(\d+)daysAgo$/);return r?`Last ${r[1]} days`:`${n} → ${s||"today"}`});return(t,s)=>{const n=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",A,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(l.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),s[0]||(s[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading country data…",-1))])):e.unref(c)?(e.openBlock(),e.createElementBlock("div",L,e.toDisplayString(e.unref(c)),1)):e.unref(o).length===0?(e.openBlock(),e.createElementBlock("div",$,[e.createVNode(e.unref(l.Globe),{class:"size-8 text-muted-foreground mx-auto"}),s[1]||(s[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No geographic data found for this period.",-1))])):(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("div",T,[e.createElementVNode("div",F,[e.createVNode(e.unref(l.Globe),{class:"size-3.5 text-primary"}),s[2]||(s[2]=e.createElementVNode("span",{class:"text-xs font-medium"},"Visitors by Country",-1))]),e.createElementVNode("span",U,e.toDisplayString(e.unref(B)),1)]),e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(r,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"px-3 py-2.5 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",M,[e.createElementVNode("span",j,e.toDisplayString(V(r.country)),1),e.createElementVNode("span",P,e.toDisplayString(r.country),1),e.createElementVNode("span",R,e.toDisplayString((r.sessions/e.unref(S)*100).toFixed(1))+"%",1)]),e.createElementVNode("div",G,[e.createElementVNode("div",q,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500/70 transition-all",style:e.normalizeStyle({width:`${r.sessions/e.unref(D)*100}%`})},null,4)]),e.createElementVNode("div",K,[e.createElementVNode("span",O,[e.createVNode(e.unref(l.MousePointerClick),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(g(r.sessions))+" sessions ",1)]),e.createElementVNode("span",H,[e.createVNode(e.unref(l.Users),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(g(r.totalUsers))+" users ",1)])])])]))),128))]),e.createElementVNode("div",J,[e.createElementVNode("span",Z,[e.createTextVNode(e.toDisplayString(e.unref(o).length)+" countr"+e.toDisplayString(e.unref(o).length===1?"y":"ies")+" ",1),e.unref(u)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" · fetched "+e.toDisplayString(E(e.unref(u))),1)],64)):e.createCommentVNode("",!0)]),e.createVNode(n,{to:`/projects/${e.unref(N)}/modules/${p.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ExternalLink),{class:"size-3"}),s[3]||(s[3]=e.createTextVNode(" View full report ",-1))]),_:1},8,["to"])])]))])}}});exports.default=Q;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { defineComponent as P, computed as _, ref as h, onMounted as R, resolveComponent as O, openBlock as i, createElementBlock as l, unref as s, createVNode as m, createElementVNode as o, toDisplayString as c, Fragment as k, renderList as L, normalizeStyle as q, normalizeClass as S, createBlock as G, resolveDynamicComponent as H, createTextVNode as v, createCommentVNode as J, withCtx as K } from "vue";
|
|
2
|
-
import { Loader2 as Q, Monitor as w, MousePointerClick as W, Users as X, ExternalLink as Y, Smartphone as Z, Tablet as ee } from "lucide-vue-next";
|
|
3
|
-
import { useRoute as te, useModuleApi as se } from "@oneclick.dev/cms-kit";
|
|
4
|
-
const oe = { class: "w-full" }, re = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "flex items-center gap-2 py-3"
|
|
7
|
-
}, ne = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "text-xs text-destructive py-2"
|
|
10
|
-
}, ae = {
|
|
11
|
-
key: 2,
|
|
12
|
-
class: "rounded-xl border bg-background p-4 text-center space-y-2"
|
|
13
|
-
}, ie = {
|
|
14
|
-
key: 3,
|
|
15
|
-
class: "rounded-xl border bg-background overflow-hidden"
|
|
16
|
-
}, le = { class: "px-3 py-2 border-b bg-muted/40 flex items-center justify-between" }, de = { class: "flex items-center gap-2" }, ce = { class: "text-[10px] text-muted-foreground" }, ue = { class: "px-3 pt-3 pb-1" }, me = { class: "flex h-3 rounded-full overflow-hidden" }, fe = { class: "divide-y" }, pe = { class: "flex items-center gap-2" }, ve = { class: "text-xs font-medium capitalize flex-1" }, xe = { class: "text-sm font-semibold tabular-nums" }, ge = { class: "ml-6 mt-1 flex items-center gap-3 text-[10px] text-muted-foreground" }, he = { class: "flex items-center gap-1" }, ye = { class: "flex items-center gap-1" }, be = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, _e = { class: "text-[10px] text-muted-foreground" }, De = /* @__PURE__ */ P({
|
|
17
|
-
__name: "DeviceBreakdownCard",
|
|
18
|
-
props: {
|
|
19
|
-
toolName: {},
|
|
20
|
-
instanceId: {},
|
|
21
|
-
instanceName: {},
|
|
22
|
-
moduleType: {},
|
|
23
|
-
resolvedArgs: {},
|
|
24
|
-
status: {}
|
|
25
|
-
},
|
|
26
|
-
emits: ["submit"],
|
|
27
|
-
setup(C, { emit: $ }) {
|
|
28
|
-
const u = C, N = $, z = te(), A = _(() => z.params.slug), F = se(u.instanceId), x = h(!0), p = h(null), n = h([]), g = h(null), M = (t) => {
|
|
29
|
-
const e = (t || "").toLowerCase();
|
|
30
|
-
return e === "mobile" || e === "smartphone" ? Z : e === "tablet" ? ee : w;
|
|
31
|
-
}, j = (t) => {
|
|
32
|
-
const e = (t || "").toLowerCase();
|
|
33
|
-
return e === "desktop" ? "bg-blue-500" : e === "mobile" || e === "smartphone" ? "bg-emerald-500" : e === "tablet" ? "bg-amber-500" : "bg-violet-500";
|
|
34
|
-
}, B = (t) => {
|
|
35
|
-
const e = (t || "").toLowerCase();
|
|
36
|
-
return e === "desktop" ? "text-blue-500" : e === "mobile" || e === "smartphone" ? "text-emerald-500" : e === "tablet" ? "text-amber-500" : "text-violet-500";
|
|
37
|
-
};
|
|
38
|
-
function I() {
|
|
39
|
-
const t = u.resolvedArgs?._cachedData;
|
|
40
|
-
return t ? (n.value = (t.devices || []).map((e) => ({
|
|
41
|
-
deviceCategory: e.device,
|
|
42
|
-
sessions: e.sessions,
|
|
43
|
-
totalUsers: e.users
|
|
44
|
-
})), g.value = u.resolvedArgs._fetchedAt || null, x.value = !1, !0) : !1;
|
|
45
|
-
}
|
|
46
|
-
async function T() {
|
|
47
|
-
const { startDate: t, endDate: e } = u.resolvedArgs || {};
|
|
48
|
-
x.value = !0, p.value = null;
|
|
49
|
-
try {
|
|
50
|
-
const a = new URLSearchParams();
|
|
51
|
-
t && a.set("startDate", t), e && a.set("endDate", e);
|
|
52
|
-
const r = await F.get(`/devices?${a.toString()}`);
|
|
53
|
-
n.value = r.rows || [], g.value = (/* @__PURE__ */ new Date()).toISOString();
|
|
54
|
-
const f = n.value.reduce((d, E) => d + (E.sessions || 0), 0);
|
|
55
|
-
D({
|
|
56
|
-
count: n.value.length,
|
|
57
|
-
devices: n.value.map((d) => ({
|
|
58
|
-
device: d.deviceCategory,
|
|
59
|
-
sessions: d.sessions,
|
|
60
|
-
users: d.totalUsers,
|
|
61
|
-
share: `${(d.sessions / f * 100).toFixed(1)}%`
|
|
62
|
-
})),
|
|
63
|
-
suggestion: n.value.length === 0 ? "No device data found for this period." : `Device breakdown: ${n.value.map((d) => `${d.deviceCategory} ${(d.sessions / f * 100).toFixed(0)}%`).join(", ")}.`
|
|
64
|
-
});
|
|
65
|
-
} catch (a) {
|
|
66
|
-
p.value = a?.data?.statusMessage || a?.message || "Failed to load device data", D(`Error loading device data: ${p.value}`);
|
|
67
|
-
} finally {
|
|
68
|
-
x.value = !1;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
R(() => {
|
|
72
|
-
u.status === "completed" && I() || T();
|
|
73
|
-
});
|
|
74
|
-
function D(t) {
|
|
75
|
-
u.status !== "completed" && N("submit", t);
|
|
76
|
-
}
|
|
77
|
-
const y = (t) => t == null ? "0" : Math.round(t).toLocaleString(), U = (t) => t ? new Date(t).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "", b = _(
|
|
78
|
-
() => n.value.reduce((t, e) => t + (e.sessions || 0), 0) || 1
|
|
79
|
-
), V = _(() => {
|
|
80
|
-
const { startDate: t, endDate: e } = u.resolvedArgs || {};
|
|
81
|
-
if (!t && !e) return "Last 30 days";
|
|
82
|
-
const a = t || "30daysAgo", r = a.match(/^(\d+)daysAgo$/);
|
|
83
|
-
return r ? `Last ${r[1]} days` : `${a} → ${e || "today"}`;
|
|
84
|
-
});
|
|
85
|
-
return (t, e) => {
|
|
86
|
-
const a = O("NuxtLink");
|
|
87
|
-
return i(), l("div", oe, [
|
|
88
|
-
s(x) ? (i(), l("div", re, [
|
|
89
|
-
m(s(Q), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
90
|
-
e[0] || (e[0] = o("span", { class: "text-xs text-muted-foreground" }, "Loading device data…", -1))
|
|
91
|
-
])) : s(p) ? (i(), l("div", ne, c(s(p)), 1)) : s(n).length === 0 ? (i(), l("div", ae, [
|
|
92
|
-
m(s(w), { class: "size-8 text-muted-foreground mx-auto" }),
|
|
93
|
-
e[1] || (e[1] = o("p", { class: "text-sm text-muted-foreground" }, "No device data found for this period.", -1))
|
|
94
|
-
])) : (i(), l("div", ie, [
|
|
95
|
-
o("div", le, [
|
|
96
|
-
o("div", de, [
|
|
97
|
-
m(s(w), { class: "size-3.5 text-primary" }),
|
|
98
|
-
e[2] || (e[2] = o("span", { class: "text-xs font-medium" }, "Device Breakdown", -1))
|
|
99
|
-
]),
|
|
100
|
-
o("span", ce, c(s(V)), 1)
|
|
101
|
-
]),
|
|
102
|
-
o("div", ue, [
|
|
103
|
-
o("div", me, [
|
|
104
|
-
(i(!0), l(k, null, L(s(n), (r, f) => (i(), l("div", {
|
|
105
|
-
key: f,
|
|
106
|
-
class: S([j(r.deviceCategory), "transition-all first:rounded-l-full last:rounded-r-full"]),
|
|
107
|
-
style: q({ width: `${r.sessions / s(b) * 100}%` })
|
|
108
|
-
}, null, 6))), 128))
|
|
109
|
-
])
|
|
110
|
-
]),
|
|
111
|
-
o("div", fe, [
|
|
112
|
-
(i(!0), l(k, null, L(s(n), (r, f) => (i(), l("div", {
|
|
113
|
-
key: f,
|
|
114
|
-
class: "px-3 py-2.5 hover:bg-muted/30 transition-colors"
|
|
115
|
-
}, [
|
|
116
|
-
o("div", pe, [
|
|
117
|
-
(i(), G(H(M(r.deviceCategory)), {
|
|
118
|
-
class: S(["size-4 shrink-0", B(r.deviceCategory)])
|
|
119
|
-
}, null, 8, ["class"])),
|
|
120
|
-
o("span", ve, c(r.deviceCategory), 1),
|
|
121
|
-
o("span", xe, c((r.sessions / s(b) * 100).toFixed(1)) + "% ", 1)
|
|
122
|
-
]),
|
|
123
|
-
o("div", ge, [
|
|
124
|
-
o("span", he, [
|
|
125
|
-
m(s(W), { class: "size-2.5" }),
|
|
126
|
-
v(" " + c(y(r.sessions)) + " sessions ", 1)
|
|
127
|
-
]),
|
|
128
|
-
o("span", ye, [
|
|
129
|
-
m(s(X), { class: "size-2.5" }),
|
|
130
|
-
v(" " + c(y(r.totalUsers)) + " users ", 1)
|
|
131
|
-
])
|
|
132
|
-
])
|
|
133
|
-
]))), 128))
|
|
134
|
-
]),
|
|
135
|
-
o("div", be, [
|
|
136
|
-
o("span", _e, [
|
|
137
|
-
v(c(y(s(b))) + " total sessions ", 1),
|
|
138
|
-
s(g) ? (i(), l(k, { key: 0 }, [
|
|
139
|
-
v(" · fetched " + c(U(s(g))), 1)
|
|
140
|
-
], 64)) : J("", !0)
|
|
141
|
-
]),
|
|
142
|
-
m(a, {
|
|
143
|
-
to: `/projects/${s(A)}/modules/${C.instanceId}`,
|
|
144
|
-
class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
|
|
145
|
-
}, {
|
|
146
|
-
default: K(() => [
|
|
147
|
-
m(s(Y), { class: "size-3" }),
|
|
148
|
-
e[3] || (e[3] = v(" View full report ", -1))
|
|
149
|
-
]),
|
|
150
|
-
_: 1
|
|
151
|
-
}, 8, ["to"])
|
|
152
|
-
])
|
|
153
|
-
]))
|
|
154
|
-
]);
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
export {
|
|
159
|
-
De as default
|
|
160
|
-
};
|