@plasmicapp/react-web 0.2.112 → 0.2.114

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