Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prismicio/api-renderer

Package Overview
Dependencies
Maintainers
18
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismicio/api-renderer - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

66

lib/widgets/nestable/StructuredTextContent/BlockRenderer.js

@@ -79,39 +79,35 @@ "use strict";

const direction = block.direction ? { direction: block.direction } : {};
const spans = block.content.spans
? {
spans: block.content.spans.map((m) => {
const partial = {
start: m.start,
end: m.end,
type: m.type,
};
if (m.type === "hyperlink") {
const asMaybeLink = Link_1.LinkContent.decode(m.data);
const asLink = (() => {
if (E.isRight(asMaybeLink)) {
const content = {
__TYPE__: Link_1.LinksTypes.LinkContent,
value: Link_1.Link.encode(asMaybeLink.right.value),
};
return renderStructuredTextLink(content, apiVersion, ctx);
}
return {};
})();
return {
...partial,
data: asLink,
const spans = (block.content.spans || []).map((m) => {
const partial = {
start: m.start,
end: m.end,
type: m.type,
};
if (m.type === "hyperlink") {
const asMaybeLink = Link_1.LinkContent.decode(m.data);
const asLink = (() => {
if (E.isRight(asMaybeLink)) {
const content = {
__TYPE__: Link_1.LinksTypes.LinkContent,
value: Link_1.Link.encode(asMaybeLink.right.value),
};
return renderStructuredTextLink(content, apiVersion, ctx);
}
else if (m.type === "label") {
return {
...partial,
data: { label: typeof m.data === "string" ? m.data : "" },
};
}
else {
return partial;
}
}),
return {};
})();
return {
...partial,
data: asLink,
};
}
: {};
else if (m.type === "label") {
return {
...partial,
data: { label: typeof m.data === "string" ? m.data : "" },
};
}
else {
return partial;
}
});
return {

@@ -121,3 +117,3 @@ type: block.type,

...label,
...spans,
spans,
...direction,

@@ -124,0 +120,0 @@ };

{
"name": "@prismicio/api-renderer",
"version": "0.1.3",
"version": "0.1.4",
"description": "Prismic renderers for the content API",

@@ -38,3 +38,3 @@ "keywords": [

"dependencies": {
"@prismicio/types-internal": "0.2.7",
"@prismicio/types-internal": "0.2.9",
"tslib": "^2.3.1"

@@ -41,0 +41,0 @@ },

@@ -101,38 +101,34 @@ import {

const direction = block.direction ? { direction: block.direction } : {}
const spans = block.content.spans
? {
spans: block.content.spans.map((m) => {
const partial = {
start: m.start,
end: m.end,
type: m.type,
}
if (m.type === "hyperlink") {
const asMaybeLink = LinkContent.decode(m.data)
const asLink = (() => {
if (E.isRight(asMaybeLink)) {
const content = {
__TYPE__: LinksTypes.LinkContent,
value: Link.encode(asMaybeLink.right.value),
} as LinkContent
return renderStructuredTextLink(content, apiVersion, ctx)
}
return {}
})()
const spans = (block.content.spans || []).map((m) => {
const partial = {
start: m.start,
end: m.end,
type: m.type,
}
if (m.type === "hyperlink") {
const asMaybeLink = LinkContent.decode(m.data)
const asLink = (() => {
if (E.isRight(asMaybeLink)) {
const content = {
__TYPE__: LinksTypes.LinkContent,
value: Link.encode(asMaybeLink.right.value),
} as LinkContent
return renderStructuredTextLink(content, apiVersion, ctx)
}
return {}
})()
return {
...partial,
data: asLink,
}
} else if (m.type === "label") {
return {
...partial,
data: { label: typeof m.data === "string" ? m.data : "" },
}
} else {
return partial
}
}),
}
: {}
return {
...partial,
data: asLink,
}
} else if (m.type === "label") {
return {
...partial,
data: { label: typeof m.data === "string" ? m.data : "" },
}
} else {
return partial
}
})
return {

@@ -142,3 +138,3 @@ type: block.type,

...label,
...spans,
spans,
...direction,

@@ -145,0 +141,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc