diff --git a/packages/marko-web-p1-events/browser/.eslintrc.js b/packages/marko-web-p1-events/browser/.eslintrc.js new file mode 100644 index 000000000..2eb0b8d9c --- /dev/null +++ b/packages/marko-web-p1-events/browser/.eslintrc.js @@ -0,0 +1,21 @@ +module.exports = { + extends: [ + 'airbnb-base', + 'plugin:vue/recommended', + ], + env: { + browser: true, + }, + rules: { + 'vue/max-attributes-per-line': ['error', { + singleline: 3, + multiline: { + max: 1, + allowFirstLine: false, + }, + }], + }, + parserOptions: { + parser: 'babel-eslint', + }, +}; diff --git a/packages/marko-web-p1-events/browser/index.js b/packages/marko-web-p1-events/browser/index.js new file mode 100644 index 000000000..a01be7255 --- /dev/null +++ b/packages/marko-web-p1-events/browser/index.js @@ -0,0 +1,5 @@ +const TrackContentBodyLinks = () => import(/* webpackChunkName: "p1-events-track-content-body-links" */ './track-content-body-links.vue'); + +export default (Browser) => { + Browser.register('P1EventsTrackContentBodyLinks', TrackContentBodyLinks); +}; diff --git a/packages/marko-web-p1-events/browser/track-content-body-links.vue b/packages/marko-web-p1-events/browser/track-content-body-links.vue new file mode 100644 index 000000000..8cf04729e --- /dev/null +++ b/packages/marko-web-p1-events/browser/track-content-body-links.vue @@ -0,0 +1,49 @@ + + + diff --git a/packages/marko-web-p1-events/components/marko.json b/packages/marko-web-p1-events/components/marko.json index f4f9a7d0a..05a631b31 100644 --- a/packages/marko-web-p1-events/components/marko.json +++ b/packages/marko-web-p1-events/components/marko.json @@ -9,6 +9,23 @@ "template": "./track-content.marko", "@node": "object" }, + "": { + "template": "./track-content-body-links.marko", + "": { + "@id": { + "type": "number", + "required": true + }, + "@type": { + "type": "string", + "required": true + } + }, + "@selector": "string", + "@link-type": "string", + "@action": "string", + "@category": "string" + }, "": { "template": "./track-website-section.marko", "@node": "object" diff --git a/packages/marko-web-p1-events/components/track-content-body-links.marko b/packages/marko-web-p1-events/components/track-content-body-links.marko new file mode 100644 index 000000000..a6fb67c72 --- /dev/null +++ b/packages/marko-web-p1-events/components/track-content-body-links.marko @@ -0,0 +1,15 @@ +import { getAsObject } from "@parameter1/base-cms-object-path"; +import eventEntity from "../utils/base-content-entity"; + +$ const content = getAsObject(input, "content"); + +