@saltcorn/markup
Advanced tools
Comparing version 0.0.9 to 0.1.0
const { contract, is } = require("contractis"); | ||
const { div, span, h6, text } = require("./tags"); | ||
const { div, a, span, h6, text, img } = require("./tags"); | ||
const { alert } = require("./layout_utils"); | ||
@@ -51,4 +51,22 @@ | ||
if (segment.type === "blank") { | ||
return wrap(segment, isTop, ix, segment.contents); | ||
return wrap(segment, isTop, ix, segment.contents || ""); | ||
} | ||
if (segment.type === "view") { | ||
return wrap(segment, isTop, ix, segment.contents || ""); | ||
} | ||
if (segment.type === "image") { | ||
return wrap( | ||
segment, | ||
isTop, | ||
ix, | ||
img({ | ||
class: "w-100", | ||
alt: segment.alt, | ||
src: `/files/serve/${segment.fileid}` | ||
}) | ||
); | ||
} | ||
if (segment.type === "link") { | ||
return wrap(segment, isTop, ix, a({ href: segment.url }, segment.text)); | ||
} | ||
if (segment.type === "card") | ||
@@ -107,3 +125,5 @@ return wrap( | ||
role: is.maybe(is.posint), | ||
alerts: is.maybe(is.array(is.obj({ type: is.str, msg: is.or(is.str, is.array(is.str)) }))) | ||
alerts: is.maybe( | ||
is.array(is.obj({ type: is.str, msg: is.or(is.str, is.array(is.str)) })) | ||
) | ||
}), | ||
@@ -110,0 +130,0 @@ is.str |
{ | ||
"name": "@saltcorn/markup", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"description": "Markup for Saltcorn, open-source no-code platform", | ||
@@ -13,3 +13,3 @@ "homepage": "https://saltcorn.com", | ||
"dependencies": { | ||
"contractis": "^0.0.9", | ||
"contractis": "^0.0.10", | ||
"escape-html": "^1.0.3", | ||
@@ -28,3 +28,3 @@ "xss": "^1.0.6" | ||
}, | ||
"gitHead": "2a088e28b3df98fb79b91d891ae0c2bff9811300" | ||
"gitHead": "41e0daca8dffe1dfcf9c2419dd84aae41fa72d30" | ||
} |
30357
1004
+ Addedcontractis@0.0.10(transitive)
- Removedcontractis@0.0.9(transitive)
Updatedcontractis@^0.0.10