@plasmicapp/react-web
Advanced tools
Comparing version 0.2.13 to 0.2.14
@@ -161,2 +161,3 @@ import * as React from "react"; | ||
}; | ||
export declare function ensureGlobalVariants<T extends Record<string, any>>(globalVariantValues: T): T; | ||
export declare function pick<T, S extends keyof T>(obj: T, ...keys: S[]): Partial<Pick<T, S>>; | ||
@@ -163,0 +164,0 @@ export declare function omit<T>(obj: T, ...keys: (keyof T)[]): Partial<T>; |
@@ -54,3 +54,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useTrigger = exports.omit = exports.pick = 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.PlasmicSlot = exports.PlasmicIcon = exports.wrapWithClassName = exports.UNSET = exports.makeFragment = exports.createPlasmicElementProxy = exports.createPlasmicElement = exports.hasVariant = void 0; | ||
var focus_1 = require("@react-aria/focus"); | ||
@@ -604,2 +604,15 @@ var classnames_1 = __importDefault(require("classnames")); | ||
exports.deriveRenderOpts = deriveRenderOpts; | ||
function ensureGlobalVariants(globalVariantValues) { | ||
Object.entries(globalVariantValues).forEach(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
if (value === "PLEASE_RENDER_INSIDE_PROVIDER") { | ||
var providerName = key === "screen" | ||
? "ScreenVariantProvider" | ||
: "" + key[0].toUpperCase() + key.substring(1) + "Context.Provider"; | ||
throw new Error("Plasmic context value for global variant \"" + key + "\" was not provided; please use " + providerName + " at the root of your React app. Learn More: https://www.plasmic.app/learn/other-assets/#global-variants"); | ||
} | ||
}); | ||
return globalVariantValues; | ||
} | ||
exports.ensureGlobalVariants = ensureGlobalVariants; | ||
function notNil(x) { | ||
@@ -606,0 +619,0 @@ return x != null; |
{ | ||
"name": "@plasmicapp/react-web", | ||
"version": "0.2.13", | ||
"version": "0.2.14", | ||
"description": "plasmic library for rendering in the presentational style", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
41847
938