-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from freshjuice-dev/develop
Add Accordion module with FAQ schema support
- Loading branch information
Showing
11 changed files
with
293 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3547,6 +3547,100 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); | |
} | ||
var module_default2 = src_default2; | ||
|
||
// node_modules/@alpinejs/collapse/dist/module.esm.js | ||
function src_default3(Alpine2) { | ||
Alpine2.directive("collapse", collapse); | ||
collapse.inline = (el, { modifiers }) => { | ||
if (!modifiers.includes("min")) | ||
return; | ||
el._x_doShow = () => { | ||
}; | ||
el._x_doHide = () => { | ||
}; | ||
}; | ||
function collapse(el, { modifiers }) { | ||
let duration = modifierValue2(modifiers, "duration", 250) / 1e3; | ||
let floor = modifierValue2(modifiers, "min", 0); | ||
let fullyHide = !modifiers.includes("min"); | ||
if (!el._x_isShown) | ||
el.style.height = `${floor}px`; | ||
if (!el._x_isShown && fullyHide) | ||
el.hidden = true; | ||
if (!el._x_isShown) | ||
el.style.overflow = "hidden"; | ||
let setFunction = (el2, styles) => { | ||
let revertFunction = Alpine2.setStyles(el2, styles); | ||
return styles.height ? () => { | ||
} : revertFunction; | ||
}; | ||
let transitionStyles = { | ||
transitionProperty: "height", | ||
transitionDuration: `${duration}s`, | ||
transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)" | ||
}; | ||
el._x_transition = { | ||
in(before = () => { | ||
}, after = () => { | ||
}) { | ||
if (fullyHide) | ||
el.hidden = false; | ||
if (fullyHide) | ||
el.style.display = null; | ||
let current = el.getBoundingClientRect().height; | ||
el.style.height = "auto"; | ||
let full = el.getBoundingClientRect().height; | ||
if (current === full) { | ||
current = floor; | ||
} | ||
Alpine2.transition(el, Alpine2.setStyles, { | ||
during: transitionStyles, | ||
start: { height: current + "px" }, | ||
end: { height: full + "px" } | ||
}, () => el._x_isShown = true, () => { | ||
if (el.getBoundingClientRect().height == full) { | ||
el.style.overflow = null; | ||
} | ||
}); | ||
}, | ||
out(before = () => { | ||
}, after = () => { | ||
}) { | ||
let full = el.getBoundingClientRect().height; | ||
Alpine2.transition(el, setFunction, { | ||
during: transitionStyles, | ||
start: { height: full + "px" }, | ||
end: { height: floor + "px" } | ||
}, () => el.style.overflow = "hidden", () => { | ||
el._x_isShown = false; | ||
if (el.style.height == `${floor}px` && fullyHide) { | ||
el.style.display = "none"; | ||
el.hidden = true; | ||
} | ||
}); | ||
} | ||
}; | ||
} | ||
} | ||
function modifierValue2(modifiers, key, fallback) { | ||
if (modifiers.indexOf(key) === -1) | ||
return fallback; | ||
const rawValue = modifiers[modifiers.indexOf(key) + 1]; | ||
if (!rawValue) | ||
return fallback; | ||
if (key === "duration") { | ||
let match = rawValue.match(/([0-9]+)ms/); | ||
if (match) | ||
return match[1]; | ||
} | ||
if (key === "min") { | ||
let match = rawValue.match(/([0-9]+)px/); | ||
if (match) | ||
return match[1]; | ||
} | ||
return rawValue; | ||
} | ||
var module_default3 = src_default3; | ||
|
||
// source/js/modules/Alpine.data/DOM.js | ||
var import_debugLog = __toESM(require_debugLog()); | ||
var import_loadScript = __toESM(require_loadScript()); | ||
|
@@ -3577,6 +3671,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); | |
} | ||
} | ||
module_default.plugin(module_default2); | ||
module_default.plugin(module_default3); | ||
module_default.data("xDOM", DOM_default); | ||
if (navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Chrome") == -1) { | ||
(0, import_loadScript2.default)("//cdn.jsdelivr.net/npm/[email protected]/balancetext.min.js", "async", () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[ { | ||
"id" : "8bd8d0b7-dd10-01db-3a1f-f65c8b32cc8f", | ||
"name" : "items", | ||
"display_width" : null, | ||
"label" : "Questions", | ||
"required" : false, | ||
"locked" : false, | ||
"occurrence" : { | ||
"min" : 1, | ||
"max" : null, | ||
"sorting_label_field" : "1fcf58ba-3dfd-b383-91ea-11206c82d664", | ||
"default" : 5 | ||
}, | ||
"children" : [ { | ||
"id" : "1fcf58ba-3dfd-b383-91ea-11206c82d664", | ||
"name" : "question", | ||
"display_width" : null, | ||
"label" : "Question", | ||
"required" : true, | ||
"locked" : false, | ||
"validation_regex" : "", | ||
"allow_new_line" : false, | ||
"show_emoji_picker" : false, | ||
"type" : "text", | ||
"default" : "Question" | ||
}, { | ||
"id" : "6338415d-a203-6e8f-df91-e2dacd023151", | ||
"name" : "answer", | ||
"display_width" : null, | ||
"label" : "Answer", | ||
"required" : false, | ||
"locked" : false, | ||
"type" : "richtext", | ||
"default" : "Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam quod natus deleniti architecto eaque consequuntur ex, illo neque iste repellendus modi, quasi ipsa commodi saepe? Provident ipsa nulla earum." | ||
} ], | ||
"tab" : "CONTENT", | ||
"expanded" : false, | ||
"type" : "group", | ||
"default" : [ { | ||
"question" : "Question", | ||
"answer" : "Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam quod natus deleniti architecto eaque consequuntur ex, illo neque iste repellendus modi, quasi ipsa commodi saepe? Provident ipsa nulla earum." | ||
}, { | ||
"question" : "Question", | ||
"answer" : "Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam quod natus deleniti architecto eaque consequuntur ex, illo neque iste repellendus modi, quasi ipsa commodi saepe? Provident ipsa nulla earum." | ||
}, { | ||
"question" : "Question", | ||
"answer" : "Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam quod natus deleniti architecto eaque consequuntur ex, illo neque iste repellendus modi, quasi ipsa commodi saepe? Provident ipsa nulla earum." | ||
}, { | ||
"question" : "Question", | ||
"answer" : "Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam quod natus deleniti architecto eaque consequuntur ex, illo neque iste repellendus modi, quasi ipsa commodi saepe? Provident ipsa nulla earum." | ||
}, { | ||
"question" : "Question", | ||
"answer" : "Lorem ipsum dolor sit amet consectetur adipisicing elit. In magnam quod natus deleniti architecto eaque consequuntur ex, illo neque iste repellendus modi, quasi ipsa commodi saepe? Provident ipsa nulla earum." | ||
} ] | ||
}, { | ||
"id" : "035814d7-a42a-8fdb-a342-298cfa4ab12e", | ||
"name" : "enable_faq_schema", | ||
"display_width" : null, | ||
"label" : "Enable FAQ Schema?", | ||
"inline_help_text" : "Learn more about how to use the <a href=\"https://developers.google.com/search/docs/appearance/structured-data/faqpage\">FAQ Schema markup here</a>.", | ||
"required" : true, | ||
"locked" : false, | ||
"display" : "toggle", | ||
"type" : "boolean", | ||
"default" : false | ||
} ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"global": false, | ||
"content_types": [ | ||
"LANDING_PAGE", | ||
"SITE_PAGE", | ||
"BLOG_LISTING", | ||
"BLOG_POST" | ||
], | ||
"icon": "fontawesome-5.14.0:List:SOLID", | ||
"host_template_types": [ | ||
"PAGE", | ||
"BLOG_LISTING", | ||
"BLOG_POST" | ||
], | ||
"label": "Accordion", | ||
"is_available_for_new_content": true | ||
} |
Empty file.
Oops, something went wrong.