@plasmicapp/react-web 0.2.206 → 0.2.208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.d.ts +5 -4
- package/dist/index.cjs.js +17 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/plume/button/index.d.ts +3 -2
- package/dist/react-web.esm.js +17 -5
- package/dist/react-web.esm.js.map +1 -1
- package/package.json +4 -4
- package/skinny/dist/plume/button/index.d.ts +3 -2
- package/skinny/dist/plume/button/index.js +17 -5
- package/skinny/dist/plume/button/index.js.map +1 -1
package/dist/all.d.ts
CHANGED
|
@@ -11553,7 +11553,7 @@ interface CodeComponentMeta<P> {
|
|
|
11553
11553
|
* will always be named by the name of this component.
|
|
11554
11554
|
*/
|
|
11555
11555
|
alwaysAutoName?: boolean;
|
|
11556
|
-
|
|
11556
|
+
refActions?: Record<string, RefActionRegistration<P>>;
|
|
11557
11557
|
}
|
|
11558
11558
|
interface FunctionParam<P> {
|
|
11559
11559
|
name: string;
|
|
@@ -11563,7 +11563,7 @@ interface FunctionParam<P> {
|
|
|
11563
11563
|
interface RefActionRegistration<P> {
|
|
11564
11564
|
displayName?: string;
|
|
11565
11565
|
description?: string;
|
|
11566
|
-
|
|
11566
|
+
argTypes: FunctionParam<P>[];
|
|
11567
11567
|
}
|
|
11568
11568
|
interface ComponentRegistration {
|
|
11569
11569
|
component: React.ComponentType<any>;
|
|
@@ -12407,7 +12407,6 @@ type PlasmicClassArgs<C extends AnyPlasmicClass> = C extends PlasmicClass<any, i
|
|
|
12407
12407
|
type PlasmicClassOverrides<C extends AnyPlasmicClass> = C extends PlasmicClass<any, any, infer O> ? O : unknown;
|
|
12408
12408
|
|
|
12409
12409
|
interface CommonProps {
|
|
12410
|
-
htmlType?: "submit" | "button";
|
|
12411
12410
|
showStartIcon?: boolean;
|
|
12412
12411
|
showEndIcon?: boolean;
|
|
12413
12412
|
startIcon?: React$1.ReactNode;
|
|
@@ -12416,9 +12415,11 @@ interface CommonProps {
|
|
|
12416
12415
|
isDisabled?: boolean;
|
|
12417
12416
|
}
|
|
12418
12417
|
interface HtmlButtonProps extends Omit<React$1.ComponentProps<"button">, "ref" | "disabled"> {
|
|
12418
|
+
submitsForm?: boolean;
|
|
12419
12419
|
}
|
|
12420
|
-
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href"> {
|
|
12420
|
+
interface HtmlAnchorProps extends Omit<React$1.ComponentProps<"a">, "ref" | "href" | "target"> {
|
|
12421
12421
|
link?: string;
|
|
12422
|
+
target?: React$1.ComponentProps<"a">["target"] | boolean;
|
|
12422
12423
|
}
|
|
12423
12424
|
type BaseButtonProps = CommonProps & HtmlButtonProps & HtmlAnchorProps;
|
|
12424
12425
|
type HtmlAnchorOnlyProps = Exclude<keyof HtmlAnchorProps, keyof HtmlButtonProps>;
|
package/dist/index.cjs.js
CHANGED
|
@@ -2620,16 +2620,28 @@ function getPlumeType(child) {
|
|
|
2620
2620
|
function useButton(plasmicClass, props, config, ref) {
|
|
2621
2621
|
var _a, _b, _c, _d;
|
|
2622
2622
|
if (ref === void 0) { ref = null; }
|
|
2623
|
-
var link = props.link, isDisabled = props.isDisabled, startIcon = props.startIcon, endIcon = props.endIcon, showStartIcon = props.showStartIcon, showEndIcon = props.showEndIcon, children = props.children,
|
|
2623
|
+
var link = props.link, isDisabled = props.isDisabled, startIcon = props.startIcon, endIcon = props.endIcon, showStartIcon = props.showStartIcon, showEndIcon = props.showEndIcon, children = props.children, target = props.target, _e = props.submitsForm, submitsForm = _e === void 0 ? false : _e, rest = __rest(props, ["link", "isDisabled", "startIcon", "endIcon", "showStartIcon", "showEndIcon", "children", "target", "submitsForm"]);
|
|
2624
2624
|
var variants = __assign(__assign({}, pick.apply(void 0, __spreadArray([props], __read(plasmicClass.internalVariantProps), false))), mergeVariantToggles({ def: config.showStartIconVariant, active: showStartIcon }, { def: config.showEndIconVariant, active: showEndIcon }, { def: config.isDisabledVariant, active: isDisabled }));
|
|
2625
2625
|
var args = __assign(__assign(__assign(__assign({}, pick.apply(void 0, __spreadArray([props], __read(plasmicClass.internalArgProps), false))), (config.startIconSlot && (_a = {}, _a[config.startIconSlot] = startIcon, _a))), (config.endIconSlot && (_b = {}, _b[config.endIconSlot] = endIcon, _b))), (_c = {}, _c[config.contentSlot] = children, _c));
|
|
2626
|
+
var buttonType = undefined;
|
|
2627
|
+
if (!link) {
|
|
2628
|
+
if (!plasmicClass.internalVariantProps.includes("type") &&
|
|
2629
|
+
!plasmicClass.internalArgProps.includes("type") &&
|
|
2630
|
+
"type" in rest) {
|
|
2631
|
+
// There's no Plasmic-defined variant or arg called "type",
|
|
2632
|
+
// but the user passed in a "type" arg, so must be an override
|
|
2633
|
+
// or direct instantiation. We use that value
|
|
2634
|
+
buttonType = rest.type;
|
|
2635
|
+
}
|
|
2636
|
+
else {
|
|
2637
|
+
// Otherwise, we set buttonType depending in submitsForm
|
|
2638
|
+
buttonType = submitsForm ? "submit" : "button";
|
|
2639
|
+
}
|
|
2640
|
+
}
|
|
2626
2641
|
var overrides = (_d = {},
|
|
2627
2642
|
_d[config.root] = {
|
|
2628
2643
|
as: link ? "a" : "button",
|
|
2629
|
-
props: __assign(__assign(__assign({
|
|
2630
|
-
// Put this at the top, as user may also have set `type` as
|
|
2631
|
-
// inherited from "button", so let `rest` override it
|
|
2632
|
-
type: htmlType }, omit.apply(void 0, __spreadArray(__spreadArray([rest], __read(plasmicClass.internalArgProps), false), __read(plasmicClass.internalVariantProps), false))), { ref: ref, disabled: isDisabled }), (!!link && { href: link })),
|
|
2644
|
+
props: __assign(__assign(__assign({}, omit.apply(void 0, __spreadArray(__spreadArray([rest], __read(plasmicClass.internalArgProps), false), __read(plasmicClass.internalVariantProps), false))), { type: buttonType, ref: ref, disabled: isDisabled, target: target === true ? "_blank" : target === false ? undefined : target }), (!!link && { href: link })),
|
|
2633
2645
|
},
|
|
2634
2646
|
_d);
|
|
2635
2647
|
return {
|