nuxt-error-tracker 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -123,11 +123,15 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
123
123
|
const tag = el.tagName.toLowerCase();
|
|
124
124
|
const id = el.id ? `#${el.id}` : "";
|
|
125
125
|
const cls = typeof el.className === "string" && el.className ? `.${el.className.trim().split(/\s+/).slice(0, 2).join(".")}` : "";
|
|
126
|
+
const dataset = el.dataset;
|
|
127
|
+
const dataAttrs = dataset ? Object.entries(dataset).slice(0, 5).map(
|
|
128
|
+
([k, v]) => `data-${k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}=${(v ?? "").slice(0, 40)}`
|
|
129
|
+
).join(" ") : "";
|
|
126
130
|
const text = (el.textContent ?? "").trim().slice(0, 40);
|
|
127
131
|
addCrumb({
|
|
128
132
|
type: "click",
|
|
129
133
|
category: "ui.click",
|
|
130
|
-
message: `${tag}${id}${cls}${text ? ` "${text}"` : ""}`
|
|
134
|
+
message: `${tag}${id}${cls}${dataAttrs ? ` [${dataAttrs}]` : ""}${text ? ` "${text}"` : ""}`
|
|
131
135
|
});
|
|
132
136
|
},
|
|
133
137
|
{ capture: true, passive: true }
|