diff --git a/scripts/delayed.js b/scripts/delayed.js index 3ec6aebf..a08e3ec7 100644 --- a/scripts/delayed.js +++ b/scripts/delayed.js @@ -19,3 +19,21 @@ const analyticsConsent = localStorage.getItem('consent_status_ANALYTICS'); if (analyticsConsent) { await analyticsSetConsent(analyticsConsent === 'ALLOW'); } + +const mystique = async ({ detail }) => { + // const sk = detail.data; + // // your custom code from button.action goes here + console.log('Load Mystique here...', sk); +}; + +const sk = document.querySelector('helix-sidekick'); +if (sk) { + // sidekick already loaded + sk.addEventListener('custom:mystique', mystique); +} else { + // wait for sidekick to be loaded + document.addEventListener('sidekick-ready', () => { + document.querySelector('helix-sidekick') + .addEventListener('custom:mystique', mystique); + }, { once: true }); +} \ No newline at end of file diff --git a/tools/sidekick/config.json b/tools/sidekick/config.json index 346d2410..e0b181ff 100644 --- a/tools/sidekick/config.json +++ b/tools/sidekick/config.json @@ -24,6 +24,12 @@ "passConfig": true, "environments": [ "preview", "live", "edit" ], "includePaths": ["**.docx**"] + }, + { + "id": "mystique", + "title": "Mystique", + "event": "mystique", + "environments": [ "dev", "preview" ] } ] }