@plasmicapp/react-web 0.2.90 → 0.2.94
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 +21 -4
- package/dist/index-common.d.ts +1 -0
- package/dist/plume/collection-utils.d.ts +1 -1
- package/dist/plume/menu-button/menu-trigger.d.ts +1 -1
- package/dist/plume/text-input/index.d.ts +1 -1
- package/dist/react-utils.d.ts +2 -2
- package/dist/react-web.cjs.development.js +105 -6
- 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 +104 -7
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/PlasmicLink.d.ts +2 -2
- package/dist/render/ssr.d.ts +2 -0
- package/dist/render/translation.d.ts +18 -0
- package/lib/plasmic.css +1 -1
- package/package.json +3 -3
- package/skinny/dist/{collection-utils-aadc3a43.js → collection-utils-47e89cbe.js} +4 -4
- package/skinny/dist/{collection-utils-976df07d.js.map → collection-utils-47e89cbe.js.map} +1 -1
- package/skinny/dist/collection-utils-4dae6efa.js +292 -0
- package/skinny/dist/{collection-utils-21ad9cae.js.map → collection-utils-4dae6efa.js.map} +1 -1
- package/skinny/dist/collection-utils-57ec40f9.js +292 -0
- package/skinny/dist/{collection-utils-aadc3a43.js.map → collection-utils-57ec40f9.js.map} +1 -1
- package/skinny/dist/collection-utils-b0b8f30e.js +287 -234
- package/skinny/dist/index-common.d.ts +1 -0
- package/skinny/dist/index.js +6 -6
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +1 -1
- package/skinny/dist/plume/menu/index.js +1 -1
- package/skinny/dist/plume/menu-button/index.js +1 -1
- package/skinny/dist/plume/select/index.js +1 -1
- package/skinny/dist/plume/switch/index.js +1 -1
- package/skinny/dist/plume/text-input/index.d.ts +1 -1
- package/skinny/dist/plume/text-input/index.js.map +1 -1
- package/skinny/dist/{props-utils-6cf101b2.js → plume-utils-5c413fd1.js} +3 -7
- package/skinny/dist/plume-utils-5c413fd1.js.map +1 -0
- package/skinny/dist/props-utils-4633caf6.js +8 -0
- package/skinny/dist/props-utils-4633caf6.js.map +1 -0
- package/skinny/dist/props-utils-5c0ad25a.js +59 -0
- package/skinny/dist/{props-utils-6cf101b2.js.map → props-utils-5c0ad25a.js.map} +1 -1
- package/skinny/dist/props-utils-c632595f.js +53 -33
- package/skinny/dist/props-utils-fd5f444e.js +59 -0
- package/skinny/dist/{props-utils-1f98cfd3.js.map → props-utils-fd5f444e.js.map} +1 -1
- package/skinny/dist/react-utils-118d8539.js +186 -168
- package/skinny/dist/react-utils-2a2fd6c9.js +339 -0
- package/skinny/dist/react-utils-2a2fd6c9.js.map +1 -0
- package/skinny/dist/{react-utils-14af9d28.js → react-utils-2d70bbbe.js} +2 -2
- package/skinny/dist/react-utils-2d70bbbe.js.map +1 -0
- package/skinny/dist/react-utils-675565b4.js +334 -0
- package/skinny/dist/react-utils-675565b4.js.map +1 -0
- package/skinny/dist/react-utils.d.ts +1 -1
- package/skinny/dist/render/PlasmicImg.d.ts +62 -55
- package/skinny/dist/render/PlasmicLink.d.ts +2 -2
- package/skinny/dist/render/ssr.d.ts +2 -0
- package/skinny/dist/render/translation.d.ts +18 -0
- package/skinny/dist/ssr-902d1292.js +105 -0
- package/skinny/dist/ssr-902d1292.js.map +1 -0
- package/skinny/dist/ssr-a8081074.js +108 -0
- package/skinny/dist/ssr-a8081074.js.map +1 -0
- package/skinny/dist/tslib.es6-00014098.js +143 -123
- package/skinny/dist/{tslib.es6-10d3f595.js → tslib.es6-73236e8e.js} +12 -3
- package/skinny/dist/tslib.es6-73236e8e.js.map +1 -0
- package/skinny/dist/collection-utils-21ad9cae.js +0 -238
- package/skinny/dist/collection-utils-87ffc0ed.js +0 -238
- package/skinny/dist/collection-utils-87ffc0ed.js.map +0 -1
- package/skinny/dist/collection-utils-976df07d.js +0 -238
- package/skinny/dist/collection-utils-b8a2fd59.js +0 -238
- package/skinny/dist/collection-utils-b8a2fd59.js.map +0 -1
- package/skinny/dist/props-utils-1f98cfd3.js +0 -40
- package/skinny/dist/props-utils-40224c71.js +0 -40
- package/skinny/dist/props-utils-40224c71.js.map +0 -1
- package/skinny/dist/props-utils-69f9ba8b.js +0 -40
- package/skinny/dist/props-utils-69f9ba8b.js.map +0 -1
- package/skinny/dist/props-utils-85691c9c.js +0 -40
- package/skinny/dist/props-utils-85691c9c.js.map +0 -1
- package/skinny/dist/react-utils-06bae09a.js +0 -254
- package/skinny/dist/react-utils-06bae09a.js.map +0 -1
- package/skinny/dist/react-utils-14af9d28.js.map +0 -1
- package/skinny/dist/react-utils-834a65c3.js +0 -254
- package/skinny/dist/react-utils-834a65c3.js.map +0 -1
- package/skinny/dist/react-utils-ae69f4e0.js +0 -254
- package/skinny/dist/react-utils-ae69f4e0.js.map +0 -1
- package/skinny/dist/react-utils-cca81efc.js +0 -245
- package/skinny/dist/react-utils-cca81efc.js.map +0 -1
- package/skinny/dist/stories/Button.d.ts +0 -29
- package/skinny/dist/stories/Header.d.ts +0 -10
- package/skinny/dist/stories/Page.d.ts +0 -10
- package/skinny/dist/tslib.es6-10d3f595.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-utils-
|
|
1
|
+
{"version":3,"file":"props-utils-fd5f444e.js","sources":["../../src/plume/plume-utils.ts","../../src/plume/props-utils.ts"],"sourcesContent":["import * as React from \"react\";\nimport { groupBy, mapValues } from \"../common\";\nimport { SingleChoiceArg } from \"../render/elements\";\n\nexport let PLUME_STRICT_MODE = true;\n\nexport function setPlumeStrictMode(mode: boolean) {\n PLUME_STRICT_MODE = mode;\n}\n\ntype VariantArgChoices<T> = T extends (infer M)[]\n ? M\n : T extends SingleChoiceArg<infer M>\n ? M\n : never;\ntype VariantArgsChoices<V> = { [k in keyof V]-?: VariantArgChoices<V[k]> };\ntype DictValues<V extends Record<string, any>> = V[keyof V];\ntype DictTuples<V extends Record<string, any>> = DictValues<\n { [K in keyof V]: [K, V[K]] }\n>;\nexport type VariantDefTuple<V> = DictTuples<VariantArgsChoices<V>>;\n\ntype DistributeTuple<T> = T extends [infer T1, infer T2]\n ? { group: T1; variant: T2 }\n : never;\n\nexport type VariantDef<V> = DistributeTuple<VariantDefTuple<V>>;\n\nexport type PlasmicClass<\n V extends Record<string, any>,\n A extends Record<string, any>,\n O extends Record<string, any>\n> = {\n (props: { variants?: V; args?: A; overrides?: O }): React.ReactElement | null;\n internalVariantProps: (keyof V)[];\n internalArgProps: (keyof A)[];\n};\n\nexport type AnyPlasmicClass = PlasmicClass<any, any, any>;\n\nexport type PlasmicClassVariants<\n C extends AnyPlasmicClass\n> = C extends PlasmicClass<infer V, any, any> ? V : unknown;\nexport type PlasmicClassArgs<\n C extends AnyPlasmicClass\n> = C extends PlasmicClass<any, infer A, any> ? A : unknown;\nexport type PlasmicClassOverrides<\n C extends AnyPlasmicClass\n> = C extends PlasmicClass<any, any, infer O> ? O : unknown;\n\ntype BooleanLike = boolean | undefined | null;\n\nexport function mergeVariantToggles<V>(\n ...toggles: { def?: VariantDef<V>; active: BooleanLike }[]\n) {\n const definedToggles = toggles.filter((x) => !!x.def) as {\n def: VariantDef<V>;\n active: BooleanLike;\n }[];\n const grouped = groupBy(definedToggles, ({ def }) => def.group as string);\n return mapValues(grouped, (subToggles) => {\n return Object.fromEntries(\n subToggles.map(({ def, active }) => [def.variant, !!active])\n );\n });\n}\n\nexport function noOutline() {\n return { outline: \"none\" };\n}\n\nexport function getPlumeType(child: React.ReactChild): string | undefined {\n if (!React.isValidElement(child)) {\n return undefined;\n }\n const childType = child.type as any;\n return (childType.__plumeType || childType.getPlumeType?.(child.props)) as\n | string\n | undefined;\n}\n","import * as React from \"react\";\nimport { pick, pickBy } from \"../common\";\nimport {\n AnyPlasmicClass,\n PlasmicClassArgs,\n PlasmicClassOverrides,\n PlasmicClassVariants,\n} from \"./plume-utils\";\n\nexport interface StyleProps {\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function getStyleProps<P extends StyleProps>(props: P): StyleProps {\n return pick(props, \"className\", \"style\");\n}\n\nexport function getDefaultPlasmicProps<C extends AnyPlasmicClass>(\n plasmicClass: C,\n props: Record<string, any>\n) {\n return {\n plasmicProps: {\n variants: pick(\n props,\n ...plasmicClass.internalVariantProps\n ) as PlasmicClassVariants<C>,\n args: pick(\n props,\n ...plasmicClass.internalArgProps\n ) as PlasmicClassArgs<C>,\n overrides: {} as PlasmicClassOverrides<C>,\n },\n };\n}\n\nconst RE_DATA_PROP = /^(data-.*)$/;\n\nexport function getDataProps(props: Record<string, any>) {\n return pickBy(props, (k) => RE_DATA_PROP.test(k));\n}\n"],"names":[],"mappings":";;;IAIW,iBAAiB,GAAG,KAAK;SAgDpB,mBAAmB;IACjC,iBAA0D;SAA1D,UAA0D,EAA1D,qBAA0D,EAA1D,IAA0D;QAA1D,4BAA0D;;IAE1D,IAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,CAAC,CAAC,GAAG,GAAA,CAGjD,CAAC;IACJ,IAAM,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,UAAC,EAAO;YAAL,GAAG,SAAA;QAAO,OAAA,GAAG,CAAC,KAAe;KAAA,CAAC,CAAC;IAC1E,OAAO,SAAS,CAAC,OAAO,EAAE,UAAC,UAAU;QACnC,OAAO,MAAM,CAAC,WAAW,CACvB,UAAU,CAAC,GAAG,CAAC,UAAC,EAAe;gBAAb,GAAG,SAAA,EAAE,MAAM,YAAA;YAAO,OAAA,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;SAAA,CAAC,CAC7D,CAAC;KACH,CAAC,CAAC;AACL,CAAC;SAEe,SAAS;IACvB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;SAEe,YAAY,CAAC,KAAuB;;IAClD,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;QAChC,OAAO,SAAS,CAAC;KAClB;IACD,IAAM,SAAS,GAAG,KAAK,CAAC,IAAW,CAAC;IACpC,QAAQ,SAAS,CAAC,WAAW,KAAI,MAAA,SAAS,CAAC,YAAY,+CAAtB,SAAS,EAAgB,KAAK,CAAC,KAAK,CAAC,CAAA,EAExD;AAChB;;SCjEgB,aAAa,CAAuB,KAAQ;IAC1D,OAAO,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AAC3C;;;;"}
|
|
@@ -1,172 +1,190 @@
|
|
|
1
|
-
import { b as __spreadArray, a as __assign } from
|
|
2
|
-
import classNames from
|
|
3
|
-
import React__default from
|
|
1
|
+
import { b as __spreadArray, a as __assign } from "./tslib.es6-00014098.js";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import React__default from "react";
|
|
4
4
|
|
|
5
|
-
var isBrowser = typeof window !== "undefined";
|
|
6
|
-
var NONE = Symbol("NONE");
|
|
7
|
-
var useIsomorphicLayoutEffect = isBrowser
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function createElementWithChildren(elementType, props, children) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
function ensureNotArray(children) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
5
|
+
var isBrowser = typeof window !== "undefined";
|
|
6
|
+
var NONE = Symbol("NONE");
|
|
7
|
+
var useIsomorphicLayoutEffect = isBrowser
|
|
8
|
+
? React__default.useLayoutEffect
|
|
9
|
+
: React__default.useEffect;
|
|
10
|
+
function createElementWithChildren(elementType, props, children) {
|
|
11
|
+
if (Array.isArray(children)) {
|
|
12
|
+
return React__default.createElement.apply(
|
|
13
|
+
React__default,
|
|
14
|
+
__spreadArray([elementType, props], children)
|
|
15
|
+
);
|
|
16
|
+
} else if (children || "children" in props) {
|
|
17
|
+
// Only call React.createElement with `children` if there are actual children,
|
|
18
|
+
// or if there was an explicit (albeit undefined) children passed via
|
|
19
|
+
// props. Otherwise, if you pass `undefined` as the children argument
|
|
20
|
+
// to React.createElement, the created element will have prop {children: undefined}.
|
|
21
|
+
// If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}
|
|
22
|
+
// are used, then it will be taken as a `children` override, and will thus blank out
|
|
23
|
+
// everything under the root node.
|
|
24
|
+
return React__default.createElement(elementType, props, children);
|
|
25
|
+
} else {
|
|
26
|
+
return React__default.createElement(elementType, props);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function ensureNotArray(children) {
|
|
30
|
+
if (Array.isArray(children)) {
|
|
31
|
+
if (children.length === 1) {
|
|
32
|
+
return children[0];
|
|
33
|
+
} else {
|
|
34
|
+
return React__default.createElement.apply(
|
|
35
|
+
React__default,
|
|
36
|
+
__spreadArray([React__default.Fragment, {}], children)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
return children;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Flattens ReactNode into an array of ReactChild, but does NOT replace
|
|
45
|
+
* missing keys with array index, as React.Children.toArray() does.
|
|
46
|
+
*/
|
|
47
|
+
function toChildArray(children) {
|
|
48
|
+
if (isReactChild(children)) {
|
|
49
|
+
return [children];
|
|
50
|
+
} else if (Array.isArray(children)) {
|
|
51
|
+
return children.flatMap(toChildArray);
|
|
52
|
+
} else {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function isReactText(child) {
|
|
57
|
+
return typeof child === "string" || typeof child === "number";
|
|
58
|
+
}
|
|
59
|
+
function isReactChild(child) {
|
|
60
|
+
return React__default.isValidElement(child) || isReactText(child);
|
|
61
|
+
}
|
|
62
|
+
function isReactNode(x) {
|
|
63
|
+
return (
|
|
64
|
+
typeof x === "string" ||
|
|
65
|
+
typeof x === "number" ||
|
|
66
|
+
React__default.isValidElement(x)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function mergeProps(props) {
|
|
70
|
+
var restProps = [];
|
|
71
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
72
|
+
restProps[_i - 1] = arguments[_i];
|
|
73
|
+
}
|
|
74
|
+
if (
|
|
75
|
+
restProps.every(function (rest) {
|
|
76
|
+
return Object.keys(rest).length === 0;
|
|
77
|
+
})
|
|
78
|
+
) {
|
|
79
|
+
return props;
|
|
80
|
+
}
|
|
81
|
+
var result = __assign({}, props);
|
|
82
|
+
for (var _a = 0, restProps_1 = restProps; _a < restProps_1.length; _a++) {
|
|
83
|
+
var rest = restProps_1[_a];
|
|
84
|
+
for (var _b = 0, _c = Object.keys(rest); _b < _c.length; _b++) {
|
|
85
|
+
var key = _c[_b];
|
|
86
|
+
result[key] = mergePropVals(key, result[key], rest[key]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
function updateRef(ref, value) {
|
|
92
|
+
if (!ref) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (typeof ref === "function") {
|
|
96
|
+
ref(value);
|
|
97
|
+
} else {
|
|
98
|
+
if (!Object.isFrozen(ref)) {
|
|
99
|
+
ref.current = value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function mergeRefs() {
|
|
104
|
+
var refs = [];
|
|
105
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
106
|
+
refs[_i] = arguments[_i];
|
|
107
|
+
}
|
|
108
|
+
return function (value) {
|
|
109
|
+
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
|
|
110
|
+
var ref = refs_1[_i];
|
|
111
|
+
updateRef(ref, value);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function mergePropVals(name, val1, val2) {
|
|
116
|
+
if (val1 === NONE || val2 === NONE) {
|
|
117
|
+
// The NONE sentinel always skips all merging and returns null
|
|
118
|
+
return null;
|
|
119
|
+
} else if (val1 == null) {
|
|
120
|
+
// If either of them is nil, prefer the other
|
|
121
|
+
return val2;
|
|
122
|
+
} else if (val2 == null) {
|
|
123
|
+
return val1;
|
|
124
|
+
} else if (name === "className") {
|
|
125
|
+
// Special case for className -- always combine both class names
|
|
126
|
+
return classNames(val1, val2);
|
|
127
|
+
} else if (name === "style") {
|
|
128
|
+
// Special case for style -- always shallow-merge style dicts
|
|
129
|
+
return __assign(__assign({}, val1), val2);
|
|
130
|
+
} else if (name === "ref") {
|
|
131
|
+
// Special case for ref
|
|
132
|
+
return mergeRefs(val1, val2);
|
|
133
|
+
} else if (typeof val1 !== typeof val2) {
|
|
134
|
+
// If the type of the two values are different, then no way to merge them.
|
|
135
|
+
// Prefer val2.
|
|
136
|
+
return val2;
|
|
137
|
+
} else if (name.startsWith("on") && typeof val1 === "function") {
|
|
138
|
+
// Special case for event handlers -- always call both handlers
|
|
139
|
+
return function () {
|
|
140
|
+
var args = [];
|
|
141
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
142
|
+
args[_i] = arguments[_i];
|
|
143
|
+
}
|
|
144
|
+
var res;
|
|
145
|
+
if (typeof val1 === "function") {
|
|
146
|
+
res = val1.apply(void 0, args);
|
|
147
|
+
}
|
|
148
|
+
if (typeof val2 === "function") {
|
|
149
|
+
res = val2.apply(void 0, args);
|
|
150
|
+
}
|
|
151
|
+
return res;
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
// For all else, prefer val2
|
|
155
|
+
return val2;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function getElementTypeName(element) {
|
|
159
|
+
var _a, _b, _c, _d;
|
|
160
|
+
if (typeof element.type === "string") {
|
|
161
|
+
return element.type;
|
|
162
|
+
} else {
|
|
163
|
+
var comp = element.type;
|
|
164
|
+
return (_d =
|
|
165
|
+
(_b =
|
|
166
|
+
(_a = comp.displayName) !== null && _a !== void 0 ? _a : comp.name) !==
|
|
167
|
+
null && _b !== void 0
|
|
168
|
+
? _b
|
|
169
|
+
: (_c = comp.render) === null || _c === void 0
|
|
170
|
+
? void 0
|
|
171
|
+
: _c.name) !== null && _d !== void 0
|
|
172
|
+
? _d
|
|
173
|
+
: "Component";
|
|
174
|
+
}
|
|
169
175
|
}
|
|
170
176
|
|
|
171
|
-
export {
|
|
177
|
+
export {
|
|
178
|
+
NONE as N,
|
|
179
|
+
mergePropVals as a,
|
|
180
|
+
isBrowser as b,
|
|
181
|
+
createElementWithChildren as c,
|
|
182
|
+
mergeRefs as d,
|
|
183
|
+
ensureNotArray as e,
|
|
184
|
+
getElementTypeName as g,
|
|
185
|
+
isReactNode as i,
|
|
186
|
+
mergeProps as m,
|
|
187
|
+
toChildArray as t,
|
|
188
|
+
useIsomorphicLayoutEffect as u,
|
|
189
|
+
};
|
|
172
190
|
//# sourceMappingURL=react-utils-118d8539.js.map
|