@saltcorn/markup
Advanced tools
Comparing version 1.1.0-beta.11 to 1.1.0-beta.12
@@ -36,3 +36,3 @@ /** | ||
breadcrumbs: (crumbs: any[], right: any, after: any) => string; | ||
headersInHead: (headers: any[]) => string; | ||
headersInHead: (headers: any[], isDark?: boolean | undefined) => string; | ||
headersInBody: (headers: any[]) => string; | ||
@@ -39,0 +39,0 @@ cardHeaderTabs: (tabList: any) => string; |
@@ -176,3 +176,5 @@ "use strict"; | ||
class: "navbar-brand js-scroll-trigger", | ||
href: isNode ? "/" : "javascript:parent.gotoEntryView()", | ||
href: isNode | ||
? "/" | ||
: "javascript:parent.saltcorn.mobileApp.navigation.gotoEntryView()", | ||
}, logo && | ||
@@ -328,7 +330,7 @@ img({ | ||
: standardBreadcrumbItem(crumbs.length)(c, ix)), after ? li({ class: "ms-3" }, after) : "", right ? li({ class: "ms-auto" }, right) : "")); | ||
const removeLeadingSlash = (s) => { | ||
if (s.startsWith("/")) | ||
return s.slice(1); | ||
const normaliseHeaderForMobile = (header) => { | ||
if (header.startsWith("/plugins")) | ||
return header.replace("/plugins", "sc_plugins"); | ||
else | ||
return s; | ||
return header; | ||
}; | ||
@@ -339,6 +341,12 @@ /** | ||
*/ | ||
const headersInHead = (headers) => headers | ||
const headersInHead = (headers, isDark) => headers | ||
.filter((h) => h.css) | ||
.map((h) => `<link href="${isNode ? h.css : removeLeadingSlash(h.css)}" rel="stylesheet">`) | ||
.map((h) => `<link href="${isNode ? h.css : normaliseHeaderForMobile(h.css)}" rel="stylesheet">`) | ||
.join("") + | ||
(isDark | ||
? headers | ||
.filter((h) => h.cssDark) | ||
.map((h) => `<link href="${isNode ? h.cssDark : normaliseHeaderForMobile(h.cssDark)}" rel="stylesheet">`) | ||
.join("") | ||
: "") + | ||
headers | ||
@@ -358,3 +366,3 @@ .filter((h) => h.style) | ||
.filter((h) => h.script) | ||
.map((h) => `<script ${h.defer ? "defer " : ""}src="${isNode ? h.script : removeLeadingSlash(h.script)}" ${h.integrity | ||
.map((h) => `<script ${h.defer ? "defer " : ""}src="${isNode ? h.script : normaliseHeaderForMobile(h.script)}" ${h.integrity | ||
? `integrity="${h.integrity}" crossorigin="anonymous"` | ||
@@ -361,0 +369,0 @@ : ""}></script>`) |
{ | ||
"name": "@saltcorn/markup", | ||
"version": "1.1.0-beta.11", | ||
"version": "1.1.0-beta.12", | ||
"description": "Markup for Saltcorn, open-source no-code platform", | ||
@@ -38,3 +38,3 @@ "homepage": "https://saltcorn.com", | ||
"devDependencies": { | ||
"@saltcorn/types": "1.1.0-beta.11", | ||
"@saltcorn/types": "1.1.0-beta.12", | ||
"@types/escape-html": "^1.0.1", | ||
@@ -41,0 +41,0 @@ "@types/jest": "^29.5.11", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
270789
3518