@plasmicapp/react-web 0.2.112 → 0.2.113

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.
Files changed (95) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/all.d.ts +36 -16
  3. package/dist/common.d.ts +3 -3
  4. package/dist/index-common.d.ts +3 -2
  5. package/dist/react-web.cjs.development.js +52 -31
  6. package/dist/react-web.cjs.development.js.map +1 -1
  7. package/dist/react-web.cjs.production.min.js +1 -1
  8. package/dist/react-web.cjs.production.min.js.map +1 -1
  9. package/dist/react-web.esm.js +41 -31
  10. package/dist/react-web.esm.js.map +1 -1
  11. package/dist/render/ssr.d.ts +1 -0
  12. package/package.json +4 -3
  13. package/skinny/dist/{collection-utils-57c273dc.js → collection-utils-43f97262.js} +14 -13
  14. package/skinny/dist/collection-utils-43f97262.js.map +1 -0
  15. package/skinny/dist/{common-182a0b0c.js → common-9ebe374e.js} +1 -1
  16. package/skinny/dist/common-9ebe374e.js.map +1 -0
  17. package/skinny/dist/common.d.ts +3 -3
  18. package/skinny/dist/index-common.d.ts +3 -2
  19. package/skinny/dist/index.js +40 -42
  20. package/skinny/dist/index.js.map +1 -1
  21. package/skinny/dist/plume/button/index.js +7 -7
  22. package/skinny/dist/plume/button/index.js.map +1 -1
  23. package/skinny/dist/plume/checkbox/index.js +17 -17
  24. package/skinny/dist/plume/checkbox/index.js.map +1 -1
  25. package/skinny/dist/plume/menu/index.js +38 -39
  26. package/skinny/dist/plume/menu/index.js.map +1 -1
  27. package/skinny/dist/plume/menu-button/index.js +22 -22
  28. package/skinny/dist/plume/menu-button/index.js.map +1 -1
  29. package/skinny/dist/plume/select/index.js +41 -43
  30. package/skinny/dist/plume/select/index.js.map +1 -1
  31. package/skinny/dist/plume/switch/index.js +16 -16
  32. package/skinny/dist/plume/switch/index.js.map +1 -1
  33. package/skinny/dist/plume/text-input/index.js +10 -10
  34. package/skinny/dist/plume/text-input/index.js.map +1 -1
  35. package/skinny/dist/plume/triggered-overlay/index.js +14 -14
  36. package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
  37. package/skinny/dist/{plume-utils-d2476af1.js → plume-utils-d9811bf3.js} +2 -2
  38. package/skinny/dist/{plume-utils-27cd384f.js.map → plume-utils-d9811bf3.js.map} +1 -1
  39. package/skinny/dist/{props-utils-cac0cccf.js → props-utils-228208e6.js} +2 -2
  40. package/skinny/dist/{props-utils-7c02c0a8.js.map → props-utils-228208e6.js.map} +1 -1
  41. package/skinny/dist/{react-utils-35cb2a4e.js → react-utils-7bc53870.js} +6 -6
  42. package/skinny/dist/{react-utils-35cb2a4e.js.map → react-utils-7bc53870.js.map} +1 -1
  43. package/skinny/dist/render/PlasmicHead/index.js +6 -6
  44. package/skinny/dist/render/PlasmicImg/index.js +27 -27
  45. package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
  46. package/skinny/dist/render/ssr.d.ts +1 -0
  47. package/skinny/dist/{ssr-d3321868.js → ssr-b16a1854.js} +10 -9
  48. package/skinny/dist/ssr-b16a1854.js.map +1 -0
  49. package/skinny/dist/collection-utils-2745acd4.js +0 -238
  50. package/skinny/dist/collection-utils-2745acd4.js.map +0 -1
  51. package/skinny/dist/collection-utils-42de4441.js +0 -244
  52. package/skinny/dist/collection-utils-42de4441.js.map +0 -1
  53. package/skinny/dist/collection-utils-57c273dc.js.map +0 -1
  54. package/skinny/dist/collection-utils-bf37b8fb.js +0 -238
  55. package/skinny/dist/collection-utils-bf37b8fb.js.map +0 -1
  56. package/skinny/dist/common-182a0b0c.js.map +0 -1
  57. package/skinny/dist/common-98719219.js +0 -68
  58. package/skinny/dist/common-98719219.js.map +0 -1
  59. package/skinny/dist/common-9efbae57.js +0 -201
  60. package/skinny/dist/common-9efbae57.js.map +0 -1
  61. package/skinny/dist/context-4ca6f5cd.js +0 -6
  62. package/skinny/dist/context-4ca6f5cd.js.map +0 -1
  63. package/skinny/dist/plume-utils-1e225de5.js +0 -25
  64. package/skinny/dist/plume-utils-1e225de5.js.map +0 -1
  65. package/skinny/dist/plume-utils-27cd384f.js +0 -35
  66. package/skinny/dist/plume-utils-623b91cc.js +0 -35
  67. package/skinny/dist/plume-utils-623b91cc.js.map +0 -1
  68. package/skinny/dist/plume-utils-d2476af1.js.map +0 -1
  69. package/skinny/dist/props-utils-7c02c0a8.js +0 -8
  70. package/skinny/dist/props-utils-b2ad4997.js +0 -8
  71. package/skinny/dist/props-utils-b2ad4997.js.map +0 -1
  72. package/skinny/dist/props-utils-c60d3105.js +0 -8
  73. package/skinny/dist/props-utils-c60d3105.js.map +0 -1
  74. package/skinny/dist/props-utils-cac0cccf.js.map +0 -1
  75. package/skinny/dist/react-utils-6050fadc.js +0 -201
  76. package/skinny/dist/react-utils-6050fadc.js.map +0 -1
  77. package/skinny/dist/react-utils-7c01e440.js +0 -172
  78. package/skinny/dist/react-utils-7c01e440.js.map +0 -1
  79. package/skinny/dist/react-utils-b5dc6320.js +0 -155
  80. package/skinny/dist/react-utils-b5dc6320.js.map +0 -1
  81. package/skinny/dist/render/PlasmicHead.d.ts +0 -35
  82. package/skinny/dist/ssr-68913b60.js +0 -107
  83. package/skinny/dist/ssr-68913b60.js.map +0 -1
  84. package/skinny/dist/ssr-9ebd98ed.js +0 -158
  85. package/skinny/dist/ssr-9ebd98ed.js.map +0 -1
  86. package/skinny/dist/ssr-d3321868.js.map +0 -1
  87. package/skinny/dist/ssr-f4053cdd.js +0 -110
  88. package/skinny/dist/ssr-f4053cdd.js.map +0 -1
  89. package/skinny/dist/ssr-fbf922f6.js +0 -108
  90. package/skinny/dist/ssr-fbf922f6.js.map +0 -1
  91. package/skinny/dist/states/valtio copy.d.ts +0 -15
  92. package/skinny/dist/stories/UseDollarState.test.d.ts +0 -11
  93. package/skinny/dist/stories/UseDollarState2.stories.d.ts +0 -7
  94. package/skinny/dist/tslib.es6-d26ffe68.js +0 -132
  95. package/skinny/dist/tslib.es6-d26ffe68.js.map +0 -1
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import React__default, { forwardRef, createElement, Fragment, isValidElement, useContext, createContext, useState, useRef, useMemo, useImperativeHandle, useCallback, cloneElement } from 'react';
5
5
  import ReactDOM__default, { createPortal } from 'react-dom';
6
6
  import { PlasmicDataSourceContextProvider } from '@plasmicapp/data-sources-context';
7
+ export { PlasmicDataSourceContextProvider, useCurrentUser } from '@plasmicapp/data-sources-context';
7
8
  import { SSRProvider, useIsSSR as useIsSSR$1 } from '@react-aria/ssr';
8
9
  import { useFocusRing, useFocusable, FocusScope } from '@react-aria/focus';
9
10
  import { useCheckbox as useCheckbox$1 } from '@react-aria/checkbox';
@@ -75,28 +76,24 @@ function _arrayLikeToArray(arr, len) {
75
76
  }
76
77
 
77
78
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
78
- var it;
79
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
80
+ if (it) return (it = it.call(o)).next.bind(it);
79
81
 
80
- if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
81
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
82
- if (it) o = it;
83
- var i = 0;
84
- return function () {
85
- if (i >= o.length) return {
86
- done: true
87
- };
88
- return {
89
- done: false,
90
- value: o[i++]
91
- };
82
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
83
+ if (it) o = it;
84
+ var i = 0;
85
+ return function () {
86
+ if (i >= o.length) return {
87
+ done: true
92
88
  };
93
- }
94
-
95
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
89
+ return {
90
+ done: false,
91
+ value: o[i++]
92
+ };
93
+ };
96
94
  }
97
95
 
98
- it = o[Symbol.iterator]();
99
- return it.next.bind(it);
96
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
100
97
  }
101
98
 
102
99
  function notNil(x) {
@@ -370,9 +367,13 @@ function getElementTypeName(element) {
370
367
  }
371
368
  }
372
369
 
370
+ var _excluded = ["children"],
371
+ _excluded2 = ["as", "hasGap"],
372
+ _excluded3 = ["hasGap"];
373
+
373
374
  function renderStack(as, props, hasGap, ref) {
374
375
  var children = props.children,
375
- rest = _objectWithoutPropertiesLoose(props, ["children"]);
376
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
376
377
 
377
378
  var wrappedChildren = wrapFlexContainerChildren(children, hasGap != null ? hasGap : false);
378
379
  return createElementWithChildren(as, _extends({
@@ -383,7 +384,7 @@ function renderStack(as, props, hasGap, ref) {
383
384
  function FlexStack_(props, outerRef) {
384
385
  var as = props.as,
385
386
  hasGap = props.hasGap,
386
- rest = _objectWithoutPropertiesLoose(props, ["as", "hasGap"]);
387
+ rest = _objectWithoutPropertiesLoose(props, _excluded2);
387
388
 
388
389
  return renderStack(as != null ? as : "div", rest, hasGap, outerRef);
389
390
  }
@@ -393,7 +394,7 @@ var FlexStack = /*#__PURE__*/forwardRef(FlexStack_);
393
394
  var makeStackImpl = function makeStackImpl(as) {
394
395
  return forwardRef(function (props, ref) {
395
396
  var hasGap = props.hasGap,
396
- rest = _objectWithoutPropertiesLoose(props, ["hasGap"]);
397
+ rest = _objectWithoutPropertiesLoose(props, _excluded3);
397
398
 
398
399
  return renderStack(as, rest, hasGap, ref);
399
400
  });
@@ -899,13 +900,15 @@ var plasmicHeadMeta = {
899
900
  }
900
901
  };
901
902
 
903
+ var _excluded$1 = ["PlasmicIconType"];
902
904
  function PlasmicIcon(props) {
903
905
  var PlasmicIconType = props.PlasmicIconType,
904
- rest = _objectWithoutPropertiesLoose(props, ["PlasmicIconType"]);
906
+ rest = _objectWithoutPropertiesLoose(props, _excluded$1);
905
907
 
906
908
  return createElement(PlasmicIconType, Object.assign({}, rest));
907
909
  }
908
910
 
911
+ var _excluded$2 = ["src", "className", "displayWidth", "displayHeight", "displayMinWidth", "displayMinHeight", "displayMaxWidth", "displayMaxHeight", "quality", "loader", "imgRef", "style", "loading"];
909
912
  // TODO: make this configurable?
910
913
 
911
914
  var IMG_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
@@ -925,7 +928,7 @@ var PlasmicImg = /*#__PURE__*/React__default.forwardRef(function PlasmicImg(prop
925
928
  imgRef = props.imgRef,
926
929
  style = props.style,
927
930
  loading = props.loading,
928
- rest = _objectWithoutPropertiesLoose(props, ["src", "className", "displayWidth", "displayHeight", "displayMinWidth", "displayMinHeight", "displayMaxWidth", "displayMaxHeight", "quality", "loader", "imgRef", "style", "loading"]);
931
+ rest = _objectWithoutPropertiesLoose(props, _excluded$2);
929
932
 
930
933
  var imgProps = Object.assign({}, rest, {
931
934
  // Default loading to "lazy" if not specified (which is different from the
@@ -1384,6 +1387,7 @@ function hasKey(v, key) {
1384
1387
  return typeof v === "object" && v !== null && key in v;
1385
1388
  }
1386
1389
 
1390
+ var _excluded$3 = ["as", "defaultContents", "value"];
1387
1391
  function PlasmicSlot(props) {
1388
1392
  return renderPlasmicSlot(props);
1389
1393
  }
@@ -1391,7 +1395,7 @@ function renderPlasmicSlot(opts) {
1391
1395
  var as = opts.as,
1392
1396
  defaultContents = opts.defaultContents,
1393
1397
  value = opts.value,
1394
- rest = _objectWithoutPropertiesLoose(opts, ["as", "defaultContents", "value"]);
1398
+ rest = _objectWithoutPropertiesLoose(opts, _excluded$3);
1395
1399
 
1396
1400
  var content = value === undefined ? defaultContents : value;
1397
1401
 
@@ -1543,7 +1547,8 @@ var PlasmicRootContext = /*#__PURE__*/createContext(undefined);
1543
1547
  function PlasmicRootProvider(props) {
1544
1548
  var platform = props.platform,
1545
1549
  children = props.children,
1546
- userAuthToken = props.userAuthToken;
1550
+ userAuthToken = props.userAuthToken,
1551
+ user = props.user;
1547
1552
  var context = useMemo(function () {
1548
1553
  return {
1549
1554
  platform: platform
@@ -1551,9 +1556,10 @@ function PlasmicRootProvider(props) {
1551
1556
  }, [platform]);
1552
1557
  var dataSourceContextValue = useMemo(function () {
1553
1558
  return {
1554
- userAuthToken: userAuthToken
1559
+ userAuthToken: userAuthToken,
1560
+ user: user
1555
1561
  };
1556
- }, [userAuthToken]);
1562
+ }, [userAuthToken, user]);
1557
1563
  return createElement(PlasmicRootContext.Provider, {
1558
1564
  value: context
1559
1565
  }, createElement(SSRProvider, null, createElement(PlasmicDataSourceContextProvider, {
@@ -1716,6 +1722,7 @@ function getPlumeType(child) {
1716
1722
  return childType.__plumeType || (childType.getPlumeType == null ? void 0 : childType.getPlumeType(child.props));
1717
1723
  }
1718
1724
 
1725
+ var _excluded$4 = ["link", "isDisabled", "startIcon", "endIcon", "showStartIcon", "showEndIcon", "children"];
1719
1726
  function useButton(plasmicClass, props, config, ref) {
1720
1727
  var _ref, _ref2, _extends2, _overrides;
1721
1728
 
@@ -1730,7 +1737,7 @@ function useButton(plasmicClass, props, config, ref) {
1730
1737
  showStartIcon = props.showStartIcon,
1731
1738
  showEndIcon = props.showEndIcon,
1732
1739
  children = props.children,
1733
- rest = _objectWithoutPropertiesLoose(props, ["link", "isDisabled", "startIcon", "endIcon", "showStartIcon", "showEndIcon", "children"]);
1740
+ rest = _objectWithoutPropertiesLoose(props, _excluded$4);
1734
1741
 
1735
1742
  var variants = _extends({}, pick.apply(void 0, [props].concat(plasmicClass.internalVariantProps)), mergeVariantToggles({
1736
1743
  def: config.showStartIconVariant,
@@ -2080,6 +2087,7 @@ var TriggeredOverlayContext = /*#__PURE__*/createContext(undefined);
2080
2087
 
2081
2088
  var MenuContext = /*#__PURE__*/createContext(undefined);
2082
2089
 
2090
+ var _excluded$5 = ["children"];
2083
2091
  var COLLECTION_OPTS = {
2084
2092
  itemPlumeType: "menu-item",
2085
2093
  sectionPlumeType: "menu-group"
@@ -2090,7 +2098,7 @@ var COLLECTION_OPTS = {
2090
2098
 
2091
2099
  function asAriaMenuProps(props) {
2092
2100
  var children = props.children,
2093
- rest = _objectWithoutPropertiesLoose(props, ["children"]);
2101
+ rest = _objectWithoutPropertiesLoose(props, _excluded$5);
2094
2102
 
2095
2103
  var _useDerivedItemsFromC = useDerivedItemsFromChildren(children, _extends({}, COLLECTION_OPTS, {
2096
2104
  invalidChildError: "Can only use Menu.Item and Menu.Group as children to Menu",
@@ -2533,6 +2541,7 @@ function useMenuButton(plasmicClass, props, config, outerRef) {
2533
2541
 
2534
2542
  var SelectContext = /*#__PURE__*/createContext(undefined);
2535
2543
 
2544
+ var _excluded$6 = ["value", "defaultValue", "children", "onChange", "placement", "menuMatchTriggerWidth", "menuWidth"];
2536
2545
  var COLLECTION_OPTS$1 = {
2537
2546
  itemPlumeType: "select-option",
2538
2547
  sectionPlumeType: "select-option-group"
@@ -2578,7 +2587,7 @@ function useAriaSelectProps(props) {
2578
2587
  defaultValue = props.defaultValue,
2579
2588
  children = props.children,
2580
2589
  onChange = props.onChange,
2581
- rest = _objectWithoutPropertiesLoose(props, ["value", "defaultValue", "children", "onChange", "placement", "menuMatchTriggerWidth", "menuWidth"]);
2590
+ rest = _objectWithoutPropertiesLoose(props, _excluded$6);
2582
2591
 
2583
2592
  var _useDerivedItemsFromC = useDerivedItemsFromChildren(children, _extends({}, COLLECTION_OPTS$1, {
2584
2593
  invalidChildError: "Can only use Select.Option and Select.OptionGroup as children to Select",
@@ -3020,6 +3029,7 @@ function useSwitch(plasmicClass, props, config, ref) {
3020
3029
  };
3021
3030
  }
3022
3031
 
3032
+ var _excluded$7 = ["isDisabled", "startIcon", "endIcon", "showStartIcon", "showEndIcon", "className", "style", "inputClassName", "inputStyle"];
3023
3033
  function useTextInput(plasmicClass, props, config, ref) {
3024
3034
  var _ref, _ref2, _overrides;
3025
3035
 
@@ -3036,7 +3046,7 @@ function useTextInput(plasmicClass, props, config, ref) {
3036
3046
  style = props.style,
3037
3047
  inputClassName = props.inputClassName,
3038
3048
  inputStyle = props.inputStyle,
3039
- rest = _objectWithoutPropertiesLoose(props, ["isDisabled", "startIcon", "endIcon", "showStartIcon", "showEndIcon", "className", "style", "inputClassName", "inputStyle"]);
3049
+ rest = _objectWithoutPropertiesLoose(props, _excluded$7);
3040
3050
 
3041
3051
  var rootRef = useRef(null);
3042
3052
  var inputRef = useRef(null);