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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-error-tracker",
3
3
  "configKey": "errorTracker",
4
- "version": "0.1.12",
4
+ "version": "0.1.13",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -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 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-error-tracker",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {