Skip to content

Commit

Permalink
feat: support _editor_link and _editorLink as flags in component …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
bglw committed Dec 8, 2021
1 parent 237291d commit 1fa8591
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion javascript-modules/live/lib/app/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ export const hydrateEditorLinks = async (liveInstance, documentNode, pathsInScop
for (let { startNode, endNode, params, pathStack, scope, name } of components) {
// By default, don't add editor links for bookshop shared includes
const isStandardComponent = liveInstance.resolveComponentType(name) === 'component';
const editorLinkFlag = scope?.editorLink ?? scope?.editor_link ?? isStandardComponent;
const editorLinkFlag = scope?.editorLink
?? scope?.editor_link
?? scope?._editorLink
?? scope?._editor_link
?? isStandardComponent;
if (editorLinkFlag) { // If we should be adding an editor link _for this component_
let editorLink = null;
for (const [, identifier] of params) {
Expand Down

0 comments on commit 1fa8591

Please sign in to comment.