@port60/template-kit 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/commands/content.mjs +15 -4
- package/src/commands/dev.mjs +37 -21
- package/src/lib/previewOptions.mjs +70 -0
- package/src/vendor/contract/v1/behaviours.json +235 -44
- package/src/vendor/contract/v1/manifest.schema.json +3 -0
- package/src/vendor/validator/behaviors-runtime.js +1 -1
- package/src/vendor/validator/fonts.mjs +53 -0
- package/src/vendor/validator/icons.mjs +37 -0
- package/src/vendor/validator/preview.mjs +116 -40
- package/src/vendor/validator/site-context.mjs +134 -8
- package/src/vendor/validator/validate.mjs +10 -0
|
@@ -185,6 +185,16 @@ export async function validateArtifact(files) {
|
|
|
185
185
|
if (/data-p60-nav-(item|burger)\b/.test(liquidSource) && !/data-p60-nav(?!-)\b/.test(liquidSource)) {
|
|
186
186
|
errors.push("behaviour 'nav': data-p60-nav-item and data-p60-nav-burger need a data-p60-nav root around the menu");
|
|
187
187
|
}
|
|
188
|
+
if (/data-p60-show-more(?!-)\b/.test(liquidSource)
|
|
189
|
+
&& (!/data-p60-show-more-item\b/.test(liquidSource) || !/data-p60-show-more-toggle\b/.test(liquidSource))) {
|
|
190
|
+
errors.push("behaviour 'showMore': a data-p60-show-more list needs data-p60-show-more-item entries and a data-p60-show-more-toggle button");
|
|
191
|
+
}
|
|
192
|
+
if (/data-p60-show-more-toggle\b/.test(liquidSource) && !/<button\b[^>]*data-p60-show-more-toggle\b/.test(liquidSource)) {
|
|
193
|
+
errors.push("behaviour 'showMore': data-p60-show-more-toggle belongs on a <button> (a link would navigate; a div would not be operable)");
|
|
194
|
+
}
|
|
195
|
+
if (/data-p60-scrollspy\b/.test(liquidSource) && !/href=["']#[^"'\s]/.test(liquidSource)) {
|
|
196
|
+
errors.push("behaviour 'scrollspy': a data-p60-scrollspy menu needs links to in-page anchors (href=\"#section-id\")");
|
|
197
|
+
}
|
|
188
198
|
}
|
|
189
199
|
|
|
190
200
|
// Font knobs: the default family must be a real catalogue entry (the tenant-unset render uses
|