@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.
- package/LICENSE.md +21 -0
- package/dist/all.d.ts +40 -16
- package/dist/common.d.ts +3 -3
- package/dist/index-common.d.ts +3 -2
- package/dist/react-web.cjs.development.js +53 -31
- package/dist/react-web.cjs.development.js.map +1 -1
- package/dist/react-web.cjs.production.min.js +1 -1
- package/dist/react-web.cjs.production.min.js.map +1 -1
- package/dist/react-web.esm.js +42 -31
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +1 -0
- package/dist/states/helpers.d.ts +2 -0
- package/package.json +4 -3
- package/skinny/dist/{collection-utils-57c273dc.js → collection-utils-43f97262.js} +14 -13
- package/skinny/dist/collection-utils-43f97262.js.map +1 -0
- package/skinny/dist/{common-182a0b0c.js → common-9ebe374e.js} +1 -1
- package/skinny/dist/common-9ebe374e.js.map +1 -0
- package/skinny/dist/common.d.ts +3 -3
- package/skinny/dist/index-common.d.ts +3 -2
- package/skinny/dist/index.js +40 -42
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/button/index.js +7 -7
- package/skinny/dist/plume/button/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +17 -17
- package/skinny/dist/plume/checkbox/index.js.map +1 -1
- package/skinny/dist/plume/menu/index.js +38 -39
- package/skinny/dist/plume/menu/index.js.map +1 -1
- package/skinny/dist/plume/menu-button/index.js +22 -22
- package/skinny/dist/plume/menu-button/index.js.map +1 -1
- package/skinny/dist/plume/select/index.js +41 -43
- package/skinny/dist/plume/select/index.js.map +1 -1
- package/skinny/dist/plume/switch/index.js +16 -16
- package/skinny/dist/plume/switch/index.js.map +1 -1
- package/skinny/dist/plume/text-input/index.js +10 -10
- package/skinny/dist/plume/text-input/index.js.map +1 -1
- package/skinny/dist/plume/triggered-overlay/index.js +14 -14
- package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
- package/skinny/dist/{plume-utils-d2476af1.js → plume-utils-d9811bf3.js} +2 -2
- package/skinny/dist/{plume-utils-27cd384f.js.map → plume-utils-d9811bf3.js.map} +1 -1
- package/skinny/dist/{props-utils-cac0cccf.js → props-utils-228208e6.js} +2 -2
- package/skinny/dist/{props-utils-7c02c0a8.js.map → props-utils-228208e6.js.map} +1 -1
- package/skinny/dist/{react-utils-35cb2a4e.js → react-utils-7bc53870.js} +6 -6
- package/skinny/dist/{react-utils-35cb2a4e.js.map → react-utils-7bc53870.js.map} +1 -1
- package/skinny/dist/render/PlasmicHead/index.js +6 -6
- package/skinny/dist/render/PlasmicImg/index.js +27 -27
- package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
- package/skinny/dist/render/ssr.d.ts +1 -0
- package/skinny/dist/{ssr-d3321868.js → ssr-b16a1854.js} +10 -9
- package/skinny/dist/ssr-b16a1854.js.map +1 -0
- package/skinny/dist/states/helpers.d.ts +2 -0
- package/skinny/dist/collection-utils-2745acd4.js +0 -238
- package/skinny/dist/collection-utils-2745acd4.js.map +0 -1
- package/skinny/dist/collection-utils-42de4441.js +0 -244
- package/skinny/dist/collection-utils-42de4441.js.map +0 -1
- package/skinny/dist/collection-utils-57c273dc.js.map +0 -1
- package/skinny/dist/collection-utils-bf37b8fb.js +0 -238
- package/skinny/dist/collection-utils-bf37b8fb.js.map +0 -1
- package/skinny/dist/common-182a0b0c.js.map +0 -1
- package/skinny/dist/common-98719219.js +0 -68
- package/skinny/dist/common-98719219.js.map +0 -1
- package/skinny/dist/common-9efbae57.js +0 -201
- package/skinny/dist/common-9efbae57.js.map +0 -1
- package/skinny/dist/context-4ca6f5cd.js +0 -6
- package/skinny/dist/context-4ca6f5cd.js.map +0 -1
- package/skinny/dist/plume-utils-1e225de5.js +0 -25
- package/skinny/dist/plume-utils-1e225de5.js.map +0 -1
- package/skinny/dist/plume-utils-27cd384f.js +0 -35
- package/skinny/dist/plume-utils-623b91cc.js +0 -35
- package/skinny/dist/plume-utils-623b91cc.js.map +0 -1
- package/skinny/dist/plume-utils-d2476af1.js.map +0 -1
- package/skinny/dist/props-utils-7c02c0a8.js +0 -8
- package/skinny/dist/props-utils-b2ad4997.js +0 -8
- package/skinny/dist/props-utils-b2ad4997.js.map +0 -1
- package/skinny/dist/props-utils-c60d3105.js +0 -8
- package/skinny/dist/props-utils-c60d3105.js.map +0 -1
- package/skinny/dist/props-utils-cac0cccf.js.map +0 -1
- package/skinny/dist/react-utils-6050fadc.js +0 -201
- package/skinny/dist/react-utils-6050fadc.js.map +0 -1
- package/skinny/dist/react-utils-7c01e440.js +0 -172
- package/skinny/dist/react-utils-7c01e440.js.map +0 -1
- package/skinny/dist/react-utils-b5dc6320.js +0 -155
- package/skinny/dist/react-utils-b5dc6320.js.map +0 -1
- package/skinny/dist/render/PlasmicHead.d.ts +0 -35
- package/skinny/dist/ssr-68913b60.js +0 -107
- package/skinny/dist/ssr-68913b60.js.map +0 -1
- package/skinny/dist/ssr-9ebd98ed.js +0 -158
- package/skinny/dist/ssr-9ebd98ed.js.map +0 -1
- package/skinny/dist/ssr-d3321868.js.map +0 -1
- package/skinny/dist/ssr-f4053cdd.js +0 -110
- package/skinny/dist/ssr-f4053cdd.js.map +0 -1
- package/skinny/dist/ssr-fbf922f6.js +0 -108
- package/skinny/dist/ssr-fbf922f6.js.map +0 -1
- package/skinny/dist/states/valtio copy.d.ts +0 -15
- package/skinny/dist/stories/UseDollarState.test.d.ts +0 -11
- package/skinny/dist/stories/UseDollarState2.stories.d.ts +0 -7
- package/skinny/dist/tslib.es6-d26ffe68.js +0 -132
- package/skinny/dist/tslib.es6-d26ffe68.js.map +0 -1
package/dist/react-web.esm.js
CHANGED
|
@@ -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 (
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
90
|
+
return {
|
|
91
|
+
done: false,
|
|
92
|
+
value: o[i++]
|
|
93
|
+
};
|
|
94
|
+
};
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
3050
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$7);
|
|
3040
3051
|
|
|
3041
3052
|
var rootRef = useRef(null);
|
|
3042
3053
|
var inputRef = useRef(null);
|