@plasmicapp/react-web 0.2.393 → 0.2.395

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 CHANGED
@@ -11976,12 +11976,15 @@ interface EventHandlerType<P> extends PropTypeBase<P> {
11976
11976
  type: ArgType<any>;
11977
11977
  }[];
11978
11978
  }
11979
+ type ChoiceValue = string | number | boolean;
11980
+ type ChoiceObject = {
11981
+ label: string;
11982
+ value: ChoiceValue;
11983
+ };
11984
+ type ChoiceOptions = ChoiceValue[] | ChoiceObject[];
11979
11985
  interface ChoiceTypeBase$1<P, T> extends PropTypeBaseDefault<P, T> {
11980
11986
  type: "choice";
11981
- options: (string | number | boolean)[] | {
11982
- label: string;
11983
- value: string | number | boolean;
11984
- }[] | ContextDependentConfig$1<P, string[] | {
11987
+ options: ChoiceOptions | ContextDependentConfig$1<P, string[] | {
11985
11988
  label: string;
11986
11989
  value: string | number | boolean;
11987
11990
  }[]>;
@@ -12873,53 +12876,22 @@ declare const useIsSSR: typeof useIsSSR$1;
12873
12876
 
12874
12877
  declare const Stack: (<T extends keyof JSX.IntrinsicElements = "div">(props: {
12875
12878
  as?: T | undefined;
12876
- hasGap?: boolean | undefined;
12877
12879
  } & React$1.ComponentProps<T>) => React$1.ReactElement) & {
12878
- div: React$1.FC<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
12879
- hasGap?: boolean | undefined;
12880
- }>;
12881
- a: React$1.FC<React$1.ClassAttributes<HTMLAnchorElement> & React$1.AnchorHTMLAttributes<HTMLAnchorElement> & {
12882
- hasGap?: boolean | undefined;
12883
- }>;
12884
- button: React$1.FC<React$1.ClassAttributes<HTMLButtonElement> & React$1.ButtonHTMLAttributes<HTMLButtonElement> & {
12885
- hasGap?: boolean | undefined;
12886
- }>;
12887
- h1: React$1.FC<React$1.ClassAttributes<HTMLHeadingElement> & React$1.HTMLAttributes<HTMLHeadingElement> & {
12888
- hasGap?: boolean | undefined;
12889
- }>;
12890
- h2: React$1.FC<React$1.ClassAttributes<HTMLHeadingElement> & React$1.HTMLAttributes<HTMLHeadingElement> & {
12891
- hasGap?: boolean | undefined;
12892
- }>;
12893
- h3: React$1.FC<React$1.ClassAttributes<HTMLHeadingElement> & React$1.HTMLAttributes<HTMLHeadingElement> & {
12894
- hasGap?: boolean | undefined;
12895
- }>;
12896
- h4: React$1.FC<React$1.ClassAttributes<HTMLHeadingElement> & React$1.HTMLAttributes<HTMLHeadingElement> & {
12897
- hasGap?: boolean | undefined;
12898
- }>;
12899
- h5: React$1.FC<React$1.ClassAttributes<HTMLHeadingElement> & React$1.HTMLAttributes<HTMLHeadingElement> & {
12900
- hasGap?: boolean | undefined;
12901
- }>;
12902
- h6: React$1.FC<React$1.ClassAttributes<HTMLHeadingElement> & React$1.HTMLAttributes<HTMLHeadingElement> & {
12903
- hasGap?: boolean | undefined;
12904
- }>;
12905
- label: React$1.FC<React$1.ClassAttributes<HTMLLabelElement> & React$1.LabelHTMLAttributes<HTMLLabelElement> & {
12906
- hasGap?: boolean | undefined;
12907
- }>;
12908
- form: React$1.FC<React$1.ClassAttributes<HTMLFormElement> & React$1.FormHTMLAttributes<HTMLFormElement> & {
12909
- hasGap?: boolean | undefined;
12910
- }>;
12911
- section: React$1.FC<React$1.ClassAttributes<HTMLElement> & React$1.HTMLAttributes<HTMLElement> & {
12912
- hasGap?: boolean | undefined;
12913
- }>;
12914
- head: React$1.FC<React$1.ClassAttributes<HTMLHeadElement> & React$1.HTMLAttributes<HTMLHeadElement> & {
12915
- hasGap?: boolean | undefined;
12916
- }>;
12917
- main: React$1.FC<React$1.ClassAttributes<HTMLElement> & React$1.HTMLAttributes<HTMLElement> & {
12918
- hasGap?: boolean | undefined;
12919
- }>;
12920
- nav: React$1.FC<React$1.ClassAttributes<HTMLElement> & React$1.HTMLAttributes<HTMLElement> & {
12921
- hasGap?: boolean | undefined;
12922
- }>;
12880
+ div: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
12881
+ a: React$1.FC<React$1.DetailedHTMLProps<React$1.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>>;
12882
+ button: React$1.FC<React$1.DetailedHTMLProps<React$1.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
12883
+ h1: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
12884
+ h2: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
12885
+ h3: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
12886
+ h4: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
12887
+ h5: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
12888
+ h6: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
12889
+ label: React$1.FC<React$1.DetailedHTMLProps<React$1.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>;
12890
+ form: React$1.FC<React$1.DetailedHTMLProps<React$1.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>>;
12891
+ section: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>>;
12892
+ head: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLHeadElement>, HTMLHeadElement>>;
12893
+ main: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>>;
12894
+ nav: React$1.FC<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>>;
12923
12895
  };
12924
12896
 
12925
12897
  declare const usePlasmicTranslator: typeof usePlasmicTranslator$1;
package/dist/index.cjs.js CHANGED
@@ -656,20 +656,18 @@ function getElementTypeName(element) {
656
656
  }
657
657
  }
658
658
 
659
- function renderStack(as, props, hasGap, ref) {
659
+ function renderStack(as, props, ref) {
660
660
  var children = props.children, rest = __rest(props, ["children"]);
661
- var wrappedChildren = wrapFlexContainerChildren(children, hasGap !== null && hasGap !== void 0 ? hasGap : false);
662
- return createElementWithChildren(as, __assign({ ref: ref }, rest), wrappedChildren);
661
+ return createElementWithChildren(as, __assign({ ref: ref }, rest), children);
663
662
  }
664
663
  function FlexStack_(props, outerRef) {
665
- var as = props.as, hasGap = props.hasGap, rest = __rest(props, ["as", "hasGap"]);
666
- return renderStack(as !== null && as !== void 0 ? as : "div", rest, hasGap, outerRef);
664
+ var as = props.as, rest = __rest(props, ["as"]);
665
+ return renderStack(as !== null && as !== void 0 ? as : "div", rest, outerRef);
667
666
  }
668
667
  var FlexStack = React__namespace.forwardRef(FlexStack_);
669
668
  var makeStackImpl = function (as) {
670
669
  return React__namespace.forwardRef(function (props, ref) {
671
- var hasGap = props.hasGap, rest = __rest(props, ["hasGap"]);
672
- return renderStack(as, rest, hasGap, ref);
670
+ return renderStack(as, props, ref);
673
671
  });
674
672
  };
675
673
  var Stack = Object.assign(FlexStack, {
@@ -714,23 +712,7 @@ function hasVariant(variants, groupName, variant) {
714
712
  return (groupVariants[variant] !== undefined && groupVariants[variant] !== false);
715
713
  }
716
714
  }
717
- function wrapFlexContainerChildren(children, hasGap) {
718
- // We need to always wrap the children, even if there are no gaps, because
719
- // otherwise if we toggle between with and without gap, React reconciliation
720
- // will blow away the children tree and all state if we switch from having
721
- // a wrapper and not.
722
- var className = hasGap ? "__wab_flex-container ρfc" : "__wab_passthrough";
723
- if (!children) {
724
- return null;
725
- }
726
- else if (Array.isArray(children)) {
727
- return React__namespace.createElement.apply(React__namespace, __spreadArray(["div", { className: className }], __read(children), false));
728
- }
729
- else {
730
- return React__namespace.createElement("div", { className: className }, children);
731
- }
732
- }
733
- function createPlasmicElement(override, defaultRoot, defaultProps, wrapChildrenInFlex) {
715
+ function createPlasmicElement(override, defaultRoot, defaultProps) {
734
716
  if (!override ||
735
717
  (typeof override === "object" && Object.keys(override).length === 0)) {
736
718
  return createElementWithChildren(defaultRoot, defaultProps, defaultProps.children);
@@ -757,10 +739,6 @@ function createPlasmicElement(override, defaultRoot, defaultProps, wrapChildrenI
757
739
  if (override2.wrapChildren) {
758
740
  children = override2.wrapChildren(ensureNotArray(children));
759
741
  }
760
- if (wrapChildrenInFlex) {
761
- // For legacy, we still support data-plasmic-wrap-flex-children
762
- children = wrapFlexContainerChildren(children, true);
763
- }
764
742
  var result = createElementWithChildren(root, props, children);
765
743
  if (override2.wrap) {
766
744
  result = override2.wrap(result);
@@ -821,15 +799,13 @@ function createPlasmicElementFromJsx(defaultElement, props) {
821
799
  children[_i - 2] = arguments[_i];
822
800
  }
823
801
  var override = props["data-plasmic-override"];
824
- var wrapFlexChild = props["data-plasmic-wrap-flex-child"];
825
802
  var triggerProps = ((_a = props["data-plasmic-trigger-props"]) !== null && _a !== void 0 ? _a : []);
826
803
  delete props["data-plasmic-override"];
827
- delete props["data-plasmic-wrap-flex-child"];
828
804
  delete props["data-plasmic-trigger-props"];
829
805
  return createPlasmicElement(override, defaultElement, mergeProps.apply(void 0, __spreadArray([props,
830
806
  children.length === 0
831
807
  ? {}
832
- : { children: children.length === 1 ? children[0] : children }], __read(triggerProps), false)), wrapFlexChild);
808
+ : { children: children.length === 1 ? children[0] : children }], __read(triggerProps), false)));
833
809
  }
834
810
  function makeFragment() {
835
811
  var children = [];