Skip to content

Commit

Permalink
feat: add mystique button
Browse files Browse the repository at this point in the history
  • Loading branch information
kptdobe committed Jun 17, 2024
1 parent 124a6ea commit bac30bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/delayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,21 @@ const analyticsConsent = localStorage.getItem('consent_status_ANALYTICS');
if (analyticsConsent) {
await analyticsSetConsent(analyticsConsent === 'ALLOW');
}

const mystique = async ({ detail }) => {

Check failure on line 23 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

'detail' is defined but never used
// const sk = detail.data;
// // your custom code from button.action goes here
console.log('Load Mystique here...', sk);

Check warning on line 26 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement

Check failure on line 26 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

'sk' was used before it was defined
};

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 });
}

Check failure on line 39 in scripts/delayed.js

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found
6 changes: 6 additions & 0 deletions tools/sidekick/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
"passConfig": true,
"environments": [ "preview", "live", "edit" ],
"includePaths": ["**.docx**"]
},
{
"id": "mystique",
"title": "Mystique",
"event": "mystique",
"environments": [ "dev", "preview" ]
}
]
}

0 comments on commit bac30bf

Please sign in to comment.