@plasmicapp/react-web
Advanced tools
Comparing version 0.2.14 to 0.2.15
@@ -70,2 +70,3 @@ import * as React from "react"; | ||
}): JSX.Element | null; | ||
export declare function PlasmicLink(props: any): JSX.Element; | ||
export declare const Stack: (<T extends "symbol" | "object" | "big" | "link" | "small" | "sub" | "sup" | "track" | "progress" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "map" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "menuitem" | "keygen" | "noindex" | "webview" | "animate" | "animateMotion" | "animateTransform" | "feDropShadow" | "mpath" = "div">(props: { | ||
@@ -72,0 +73,0 @@ as?: T | undefined; |
@@ -54,3 +54,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useTrigger = exports.omit = exports.pick = exports.ensureGlobalVariants = exports.deriveRenderOpts = exports.NodeRenderer = exports.Renderer = exports.classNames = exports.Stack = exports.PlasmicSlot = exports.PlasmicIcon = exports.wrapWithClassName = exports.UNSET = exports.makeFragment = exports.createPlasmicElementProxy = exports.createPlasmicElement = exports.hasVariant = void 0; | ||
exports.useTrigger = exports.omit = exports.pick = exports.ensureGlobalVariants = exports.deriveRenderOpts = exports.NodeRenderer = exports.Renderer = exports.classNames = exports.Stack = exports.PlasmicLink = exports.PlasmicSlot = exports.PlasmicIcon = exports.wrapWithClassName = exports.UNSET = exports.makeFragment = exports.createPlasmicElementProxy = exports.createPlasmicElement = exports.hasVariant = void 0; | ||
var focus_1 = require("@react-aria/focus"); | ||
@@ -371,2 +371,24 @@ var classnames_1 = __importDefault(require("classnames")); | ||
exports.PlasmicSlot = PlasmicSlot; | ||
function isInternalHref(href) { | ||
return /^\/(?!\/)/.test(href); | ||
} | ||
function PlasmicLink(props) { | ||
if (props.platform === "nextjs") { | ||
var nextjsProps = [ | ||
"href", | ||
"replace", | ||
"scroll", | ||
"shallow", | ||
"passHref", | ||
"prefetch", | ||
"locale", | ||
]; | ||
return React.createElement(props.component, pick.apply(void 0, __spreadArrays([props], nextjsProps)), React.createElement("a", __assign({}, omit.apply(void 0, __spreadArrays([props, "component", "platform"], nextjsProps))))); | ||
} | ||
if (props.platform === "gatsby" && isInternalHref(props.href)) { | ||
return React.createElement(props.component, __assign(__assign({}, omit(props, "component", "platform", "href")), { to: props.href })); | ||
} | ||
return React.createElement("a", __assign({}, omit(props, "component", "platform"))); | ||
} | ||
exports.PlasmicLink = PlasmicLink; | ||
function renderStack(as, props, hasGap, ref) { | ||
@@ -373,0 +395,0 @@ var children = props.children, rest = __rest(props, ["children"]); |
{ | ||
"name": "@plasmicapp/react-web", | ||
"version": "0.2.14", | ||
"version": "0.2.15", | ||
"description": "plasmic library for rendering in the presentational style", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
42850
961