@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
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { c as __values, a as __spreadArray, b as __read, _ as __assign } from './common-9efbae57.js';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
|
|
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(React__default, __spreadArray([elementType,
|
|
13
|
-
props], __read(children)));
|
|
14
|
-
}
|
|
15
|
-
else if (children || "children" in props) {
|
|
16
|
-
// Only call React.createElement with `children` if there are actual children,
|
|
17
|
-
// or if there was an explicit (albeit undefined) children passed via
|
|
18
|
-
// props. Otherwise, if you pass `undefined` as the children argument
|
|
19
|
-
// to React.createElement, the created element will have prop {children: undefined}.
|
|
20
|
-
// If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}
|
|
21
|
-
// are used, then it will be taken as a `children` override, and will thus blank out
|
|
22
|
-
// everything under the root node.
|
|
23
|
-
return React__default.createElement(elementType, props, children);
|
|
24
|
-
}
|
|
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
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return React__default.createElement.apply(React__default, __spreadArray([React__default.Fragment, {}], __read(children)));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return children;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Flattens ReactNode into an array of ReactChild, but does NOT replace
|
|
44
|
-
* missing keys with array index, as React.Children.toArray() does.
|
|
45
|
-
*/
|
|
46
|
-
function toChildArray(children) {
|
|
47
|
-
if (isReactChild(children)) {
|
|
48
|
-
return [children];
|
|
49
|
-
}
|
|
50
|
-
else if (Array.isArray(children)) {
|
|
51
|
-
return children.flatMap(toChildArray);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function isReactText(child) {
|
|
58
|
-
return typeof child === "string" || typeof child === "number";
|
|
59
|
-
}
|
|
60
|
-
function isReactChild(child) {
|
|
61
|
-
return React__default.isValidElement(child) || isReactText(child);
|
|
62
|
-
}
|
|
63
|
-
function isReactNode(x) {
|
|
64
|
-
return (typeof x === "string" || typeof x === "number" || React__default.isValidElement(x));
|
|
65
|
-
}
|
|
66
|
-
function mergeProps(props) {
|
|
67
|
-
var e_1, _a, e_2, _b;
|
|
68
|
-
var restProps = [];
|
|
69
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
70
|
-
restProps[_i - 1] = arguments[_i];
|
|
71
|
-
}
|
|
72
|
-
if (restProps.every(function (rest) { return Object.keys(rest).length === 0; })) {
|
|
73
|
-
return props;
|
|
74
|
-
}
|
|
75
|
-
var result = __assign({}, props);
|
|
76
|
-
try {
|
|
77
|
-
for (var restProps_1 = __values(restProps), restProps_1_1 = restProps_1.next(); !restProps_1_1.done; restProps_1_1 = restProps_1.next()) {
|
|
78
|
-
var rest = restProps_1_1.value;
|
|
79
|
-
try {
|
|
80
|
-
for (var _c = (e_2 = void 0, __values(Object.keys(rest))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
81
|
-
var key = _d.value;
|
|
82
|
-
result[key] = mergePropVals(key, result[key], rest[key]);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
86
|
-
finally {
|
|
87
|
-
try {
|
|
88
|
-
if (_d && !_d.done && (_b = _c["return"])) _b.call(_c);
|
|
89
|
-
}
|
|
90
|
-
finally { if (e_2) throw e_2.error; }
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
95
|
-
finally {
|
|
96
|
-
try {
|
|
97
|
-
if (restProps_1_1 && !restProps_1_1.done && (_a = restProps_1["return"])) _a.call(restProps_1);
|
|
98
|
-
}
|
|
99
|
-
finally { if (e_1) throw e_1.error; }
|
|
100
|
-
}
|
|
101
|
-
return result;
|
|
102
|
-
}
|
|
103
|
-
function updateRef(ref, value) {
|
|
104
|
-
if (!ref) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (typeof ref === "function") {
|
|
108
|
-
ref(value);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
if (!Object.isFrozen(ref)) {
|
|
112
|
-
ref.current = value;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function mergeRefs() {
|
|
117
|
-
var refs = [];
|
|
118
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
119
|
-
refs[_i] = arguments[_i];
|
|
120
|
-
}
|
|
121
|
-
return function (value) {
|
|
122
|
-
var e_3, _a;
|
|
123
|
-
try {
|
|
124
|
-
for (var refs_1 = __values(refs), refs_1_1 = refs_1.next(); !refs_1_1.done; refs_1_1 = refs_1.next()) {
|
|
125
|
-
var ref = refs_1_1.value;
|
|
126
|
-
updateRef(ref, value);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
130
|
-
finally {
|
|
131
|
-
try {
|
|
132
|
-
if (refs_1_1 && !refs_1_1.done && (_a = refs_1["return"])) _a.call(refs_1);
|
|
133
|
-
}
|
|
134
|
-
finally { if (e_3) throw e_3.error; }
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function mergePropVals(name, val1, val2) {
|
|
139
|
-
if (val1 === NONE || val2 === NONE) {
|
|
140
|
-
// The NONE sentinel always skips all merging and returns null
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
else if (val1 == null) {
|
|
144
|
-
// If either of them is nil, prefer the other
|
|
145
|
-
return val2;
|
|
146
|
-
}
|
|
147
|
-
else if (val2 == null) {
|
|
148
|
-
return val1;
|
|
149
|
-
}
|
|
150
|
-
else if (name === "className") {
|
|
151
|
-
// Special case for className -- always combine both class names
|
|
152
|
-
return classNames(val1, val2);
|
|
153
|
-
}
|
|
154
|
-
else if (name === "style") {
|
|
155
|
-
// Special case for style -- always shallow-merge style dicts
|
|
156
|
-
return __assign(__assign({}, val1), val2);
|
|
157
|
-
}
|
|
158
|
-
else if (name === "ref") {
|
|
159
|
-
// Special case for ref
|
|
160
|
-
return mergeRefs(val1, val2);
|
|
161
|
-
}
|
|
162
|
-
else if (typeof val1 !== typeof val2) {
|
|
163
|
-
// If the type of the two values are different, then no way to merge them.
|
|
164
|
-
// Prefer val2.
|
|
165
|
-
return val2;
|
|
166
|
-
}
|
|
167
|
-
else if (name.startsWith("on") && typeof val1 === "function") {
|
|
168
|
-
// Special case for event handlers -- always call both handlers
|
|
169
|
-
return function () {
|
|
170
|
-
var args = [];
|
|
171
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
172
|
-
args[_i] = arguments[_i];
|
|
173
|
-
}
|
|
174
|
-
var res;
|
|
175
|
-
if (typeof val1 === "function") {
|
|
176
|
-
res = val1.apply(void 0, __spreadArray([], __read(args)));
|
|
177
|
-
}
|
|
178
|
-
if (typeof val2 === "function") {
|
|
179
|
-
res = val2.apply(void 0, __spreadArray([], __read(args)));
|
|
180
|
-
}
|
|
181
|
-
return res;
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
// For all else, prefer val2
|
|
186
|
-
return val2;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function getElementTypeName(element) {
|
|
190
|
-
var _a, _b, _c, _d;
|
|
191
|
-
if (typeof element.type === "string") {
|
|
192
|
-
return element.type;
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
var comp = element.type;
|
|
196
|
-
return (_d = (_b = (_a = comp.displayName) !== null && _a !== void 0 ? _a : comp.name) !== null && _b !== void 0 ? _b : (_c = comp.render) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "Component";
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export { NONE as N, mergePropVals as a, isBrowser as b, createElementWithChildren as c, mergeRefs as d, ensureNotArray as e, getElementTypeName as g, isReactNode as i, mergeProps as m, toChildArray as t, useIsomorphicLayoutEffect as u };
|
|
201
|
-
//# sourceMappingURL=react-utils-6050fadc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-utils-6050fadc.js","sources":["../../src/react-utils.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport React from \"react\";\n\nexport const isBrowser = typeof window !== \"undefined\";\nexport const NONE = Symbol(\"NONE\");\n\nexport const useIsomorphicLayoutEffect = isBrowser\n ? React.useLayoutEffect\n : React.useEffect;\n\nexport function createElementWithChildren(\n elementType: any,\n props: any,\n children: React.ReactNode\n) {\n if (Array.isArray(children)) {\n return React.createElement(\n elementType,\n props,\n ...children\n ) as React.ReactElement;\n } else if (children || \"children\" in props) {\n // Only call React.createElement with `children` if there are actual children,\n // or if there was an explicit (albeit undefined) children passed via\n // props. Otherwise, if you pass `undefined` as the children argument\n // to React.createElement, the created element will have prop {children: undefined}.\n // If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}\n // are used, then it will be taken as a `children` override, and will thus blank out\n // everything under the root node.\n return React.createElement(elementType, props, children);\n } else {\n return React.createElement(elementType, props);\n }\n}\n\nexport function ensureNotArray(children: React.ReactNode) {\n if (Array.isArray(children)) {\n if (children.length === 1) {\n return children[0];\n } else {\n return React.createElement(React.Fragment, {}, ...children);\n }\n } else {\n return children;\n }\n}\n\n/**\n * Flattens ReactNode into an array of ReactChild, but does NOT replace\n * missing keys with array index, as React.Children.toArray() does.\n */\nexport function toChildArray(children: React.ReactNode): React.ReactChild[] {\n if (isReactChild(children)) {\n return [children];\n } else if (Array.isArray(children)) {\n return children.flatMap(toChildArray);\n } else {\n return [];\n }\n}\n\nexport function isReactText(child: React.ReactNode): child is React.ReactText {\n return typeof child === \"string\" || typeof child === \"number\";\n}\n\nexport function isReactChild(\n child: React.ReactNode\n): child is React.ReactChild {\n return React.isValidElement(child) || isReactText(child);\n}\n\nexport function isReactFragment(\n child: React.ReactNode\n): child is React.ReactElement {\n return React.isValidElement(child) && child.type === React.Fragment;\n}\n\nexport function isReactNode(x: any) {\n return (\n typeof x === \"string\" || typeof x === \"number\" || React.isValidElement(x)\n );\n}\n\n// From https://stackoverflow.com/questions/54775790/forcing-excess-property-checking-on-variable-passed-to-typescript-function\n// We also wrap the error message in a Partial<> because otherwise Jetbrains IDEs will autocomplete the component with all the string methods as props - see https://github.com/plasmicapp/plasmic/issues/16.\nexport type StrictProps<T, TExpected> = Exclude<\n keyof T,\n keyof TExpected\n> extends never\n ? {}\n : Partial<\"Unexpected extraneous props\">;\n\nexport type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<\n React.ComponentProps<T>[\"ref\"],\n string\n>;\n\nexport function mergeProps(\n props: Record<string, any>,\n ...restProps: Record<string, any>[]\n): Record<string, any> {\n if (restProps.every((rest) => Object.keys(rest).length === 0)) {\n return props;\n }\n\n const result = { ...props };\n\n for (const rest of restProps) {\n for (const key of Object.keys(rest)) {\n result[key] = mergePropVals(key, result[key], rest[key]);\n }\n }\n\n return result;\n}\n\nfunction updateRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(value);\n } else {\n if (!Object.isFrozen(ref)) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n }\n}\n\nexport function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]) {\n return (value: T) => {\n for (const ref of refs) {\n updateRef(ref, value);\n }\n };\n}\n\nexport function mergePropVals(name: string, val1: any, val2: any): any {\n if (val1 === NONE || val2 === NONE) {\n // The NONE sentinel always skips all merging and returns null\n return null;\n } else if (val1 == null) {\n // If either of them is nil, prefer the other\n return val2;\n } else if (val2 == null) {\n return val1;\n } else if (name === \"className\") {\n // Special case for className -- always combine both class names\n return classNames(val1, val2);\n } else if (name === \"style\") {\n // Special case for style -- always shallow-merge style dicts\n return { ...val1, ...val2 };\n } else if (name === \"ref\") {\n // Special case for ref\n return mergeRefs(val1, val2);\n } else if (typeof val1 !== typeof val2) {\n // If the type of the two values are different, then no way to merge them.\n // Prefer val2.\n return val2;\n } else if (name.startsWith(\"on\") && typeof val1 === \"function\") {\n // Special case for event handlers -- always call both handlers\n return (...args: any[]) => {\n let res: any;\n if (typeof val1 === \"function\") {\n res = val1(...args);\n }\n if (typeof val2 === \"function\") {\n res = val2(...args);\n }\n return res;\n };\n } else {\n // For all else, prefer val2\n return val2;\n }\n}\n\nexport function getElementTypeName(element: React.ReactElement) {\n if (typeof element.type === \"string\") {\n return element.type;\n } else {\n const comp = element.type as any;\n return comp.displayName ?? comp.name ?? comp.render?.name ?? \"Component\";\n }\n}\n"],"names":["React"],"mappings":";;;;IAGa,SAAS,GAAG,OAAO,MAAM,KAAK,YAAY;IAC1C,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE;IAEtB,yBAAyB,GAAG,SAAS;MAC9CA,cAAK,CAAC,eAAe;MACrBA,cAAK,CAAC,UAAU;SAEJ,yBAAyB,CACvC,WAAgB,EAChB,KAAU,EACV,QAAyB;IAEzB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC3B,OAAOA,cAAK,CAAC,aAAa,OAAnBA,cAAK,iBACV,WAAW;YACX,KAAK,UACF,QAAQ,GACU,CAAC;KACzB;SAAM,IAAI,QAAQ,IAAI,UAAU,IAAI,KAAK,EAAE;;;;;;;;QAQ1C,OAAOA,cAAK,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;KAC1D;SAAM;QACL,OAAOA,cAAK,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;KAChD;AACH,CAAC;SAEe,cAAc,CAAC,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CAAC,MAAM,0CAAE,IAAI,mCAAI,WAAW,CAAC;KAC1E;AACH;;;;"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { b as __spreadArray, a as __assign } from './tslib.es6-d26ffe68.js';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import React__default from 'react';
|
|
4
|
-
|
|
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(React__default, __spreadArray([elementType,
|
|
13
|
-
props], children));
|
|
14
|
-
}
|
|
15
|
-
else if (children || "children" in props) {
|
|
16
|
-
// Only call React.createElement with `children` if there are actual children,
|
|
17
|
-
// or if there was an explicit (albeit undefined) children passed via
|
|
18
|
-
// props. Otherwise, if you pass `undefined` as the children argument
|
|
19
|
-
// to React.createElement, the created element will have prop {children: undefined}.
|
|
20
|
-
// If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}
|
|
21
|
-
// are used, then it will be taken as a `children` override, and will thus blank out
|
|
22
|
-
// everything under the root node.
|
|
23
|
-
return React__default.createElement(elementType, props, children);
|
|
24
|
-
}
|
|
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
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
return React__default.createElement.apply(React__default, __spreadArray([React__default.Fragment, {}], children));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
return children;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Flattens ReactNode into an array of ReactChild, but does NOT replace
|
|
44
|
-
* missing keys with array index, as React.Children.toArray() does.
|
|
45
|
-
*/
|
|
46
|
-
function toChildArray(children) {
|
|
47
|
-
if (isReactChild(children)) {
|
|
48
|
-
return [children];
|
|
49
|
-
}
|
|
50
|
-
else if (Array.isArray(children)) {
|
|
51
|
-
return children.flatMap(toChildArray);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function isReactText(child) {
|
|
58
|
-
return typeof child === "string" || typeof child === "number";
|
|
59
|
-
}
|
|
60
|
-
function isReactChild(child) {
|
|
61
|
-
return React__default.isValidElement(child) || isReactText(child);
|
|
62
|
-
}
|
|
63
|
-
function isReactNode(x) {
|
|
64
|
-
return (typeof x === "string" || typeof x === "number" || React__default.isValidElement(x));
|
|
65
|
-
}
|
|
66
|
-
function mergeProps(props) {
|
|
67
|
-
var restProps = [];
|
|
68
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
69
|
-
restProps[_i - 1] = arguments[_i];
|
|
70
|
-
}
|
|
71
|
-
if (restProps.every(function (rest) { return Object.keys(rest).length === 0; })) {
|
|
72
|
-
return props;
|
|
73
|
-
}
|
|
74
|
-
var result = __assign({}, props);
|
|
75
|
-
for (var _a = 0, restProps_1 = restProps; _a < restProps_1.length; _a++) {
|
|
76
|
-
var rest = restProps_1[_a];
|
|
77
|
-
for (var _b = 0, _c = Object.keys(rest); _b < _c.length; _b++) {
|
|
78
|
-
var key = _c[_b];
|
|
79
|
-
result[key] = mergePropVals(key, result[key], rest[key]);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return result;
|
|
83
|
-
}
|
|
84
|
-
function updateRef(ref, value) {
|
|
85
|
-
if (!ref) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (typeof ref === "function") {
|
|
89
|
-
ref(value);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
if (!Object.isFrozen(ref)) {
|
|
93
|
-
ref.current = value;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function mergeRefs() {
|
|
98
|
-
var refs = [];
|
|
99
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
100
|
-
refs[_i] = arguments[_i];
|
|
101
|
-
}
|
|
102
|
-
return function (value) {
|
|
103
|
-
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
|
|
104
|
-
var ref = refs_1[_i];
|
|
105
|
-
updateRef(ref, value);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function mergePropVals(name, val1, val2) {
|
|
110
|
-
if (val1 === NONE || val2 === NONE) {
|
|
111
|
-
// The NONE sentinel always skips all merging and returns null
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
else if (val1 == null) {
|
|
115
|
-
// If either of them is nil, prefer the other
|
|
116
|
-
return val2;
|
|
117
|
-
}
|
|
118
|
-
else if (val2 == null) {
|
|
119
|
-
return val1;
|
|
120
|
-
}
|
|
121
|
-
else if (name === "className") {
|
|
122
|
-
// Special case for className -- always combine both class names
|
|
123
|
-
return classNames(val1, val2);
|
|
124
|
-
}
|
|
125
|
-
else if (name === "style") {
|
|
126
|
-
// Special case for style -- always shallow-merge style dicts
|
|
127
|
-
return __assign(__assign({}, val1), val2);
|
|
128
|
-
}
|
|
129
|
-
else if (name === "ref") {
|
|
130
|
-
// Special case for ref
|
|
131
|
-
return mergeRefs(val1, val2);
|
|
132
|
-
}
|
|
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
|
-
}
|
|
138
|
-
else if (name.startsWith("on") && typeof val1 === "function") {
|
|
139
|
-
// Special case for event handlers -- always call both handlers
|
|
140
|
-
return function () {
|
|
141
|
-
var args = [];
|
|
142
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
143
|
-
args[_i] = arguments[_i];
|
|
144
|
-
}
|
|
145
|
-
var res;
|
|
146
|
-
if (typeof val1 === "function") {
|
|
147
|
-
res = val1.apply(void 0, args);
|
|
148
|
-
}
|
|
149
|
-
if (typeof val2 === "function") {
|
|
150
|
-
res = val2.apply(void 0, args);
|
|
151
|
-
}
|
|
152
|
-
return res;
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
// For all else, prefer val2
|
|
157
|
-
return val2;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
function getElementTypeName(element) {
|
|
161
|
-
var _a, _b, _c, _d;
|
|
162
|
-
if (typeof element.type === "string") {
|
|
163
|
-
return element.type;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
var comp = element.type;
|
|
167
|
-
return (_d = (_b = (_a = comp.displayName) !== null && _a !== void 0 ? _a : comp.name) !== null && _b !== void 0 ? _b : (_c = comp.render) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "Component";
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export { NONE as N, mergePropVals as a, isBrowser as b, createElementWithChildren as c, mergeRefs as d, ensureNotArray as e, getElementTypeName as g, isReactNode as i, mergeProps as m, toChildArray as t, useIsomorphicLayoutEffect as u };
|
|
172
|
-
//# sourceMappingURL=react-utils-7c01e440.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-utils-7c01e440.js","sources":["../../src/react-utils.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport React from \"react\";\n\nexport const isBrowser = typeof window !== \"undefined\";\nexport const NONE = Symbol(\"NONE\");\n\nexport const useIsomorphicLayoutEffect = isBrowser\n ? React.useLayoutEffect\n : React.useEffect;\n\nexport function createElementWithChildren(\n elementType: any,\n props: any,\n children: React.ReactNode\n) {\n if (Array.isArray(children)) {\n return React.createElement(\n elementType,\n props,\n ...children\n ) as React.ReactElement;\n } else if (children || \"children\" in props) {\n // Only call React.createElement with `children` if there are actual children,\n // or if there was an explicit (albeit undefined) children passed via\n // props. Otherwise, if you pass `undefined` as the children argument\n // to React.createElement, the created element will have prop {children: undefined}.\n // If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}\n // are used, then it will be taken as a `children` override, and will thus blank out\n // everything under the root node.\n return React.createElement(elementType, props, children);\n } else {\n return React.createElement(elementType, props);\n }\n}\n\nexport function ensureNotArray(children: React.ReactNode) {\n if (Array.isArray(children)) {\n if (children.length === 1) {\n return children[0];\n } else {\n return React.createElement(React.Fragment, {}, ...children);\n }\n } else {\n return children;\n }\n}\n\n/**\n * Flattens ReactNode into an array of ReactChild, but does NOT replace\n * missing keys with array index, as React.Children.toArray() does.\n */\nexport function toChildArray(children: React.ReactNode): React.ReactChild[] {\n if (isReactChild(children)) {\n return [children];\n } else if (Array.isArray(children)) {\n return children.flatMap(toChildArray);\n } else {\n return [];\n }\n}\n\nexport function isReactText(child: React.ReactNode): child is React.ReactText {\n return typeof child === \"string\" || typeof child === \"number\";\n}\n\nexport function isReactChild(\n child: React.ReactNode\n): child is React.ReactChild {\n return React.isValidElement(child) || isReactText(child);\n}\n\nexport function isReactFragment(\n child: React.ReactNode\n): child is React.ReactElement {\n return React.isValidElement(child) && child.type === React.Fragment;\n}\n\nexport function isReactNode(x: any) {\n return (\n typeof x === \"string\" || typeof x === \"number\" || React.isValidElement(x)\n );\n}\n\n// From https://stackoverflow.com/questions/54775790/forcing-excess-property-checking-on-variable-passed-to-typescript-function\n// We also wrap the error message in a Partial<> because otherwise Jetbrains IDEs will autocomplete the component with all the string methods as props - see https://github.com/plasmicapp/plasmic/issues/16.\nexport type StrictProps<T, TExpected> = Exclude<\n keyof T,\n keyof TExpected\n> extends never\n ? {}\n : Partial<\"Unexpected extraneous props\">;\n\nexport type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<\n React.ComponentProps<T>[\"ref\"],\n string\n>;\n\nexport function mergeProps(\n props: Record<string, any>,\n ...restProps: Record<string, any>[]\n): Record<string, any> {\n if (restProps.every((rest) => Object.keys(rest).length === 0)) {\n return props;\n }\n\n const result = { ...props };\n\n for (const rest of restProps) {\n for (const key of Object.keys(rest)) {\n result[key] = mergePropVals(key, result[key], rest[key]);\n }\n }\n\n return result;\n}\n\nfunction updateRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(value);\n } else {\n if (!Object.isFrozen(ref)) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n }\n}\n\nexport function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]) {\n return (value: T) => {\n for (const ref of refs) {\n updateRef(ref, value);\n }\n };\n}\n\nexport function mergePropVals(name: string, val1: any, val2: any): any {\n if (val1 === NONE || val2 === NONE) {\n // The NONE sentinel always skips all merging and returns null\n return null;\n } else if (val1 == null) {\n // If either of them is nil, prefer the other\n return val2;\n } else if (val2 == null) {\n return val1;\n } else if (name === \"className\") {\n // Special case for className -- always combine both class names\n return classNames(val1, val2);\n } else if (name === \"style\") {\n // Special case for style -- always shallow-merge style dicts\n return { ...val1, ...val2 };\n } else if (name === \"ref\") {\n // Special case for ref\n return mergeRefs(val1, val2);\n } else if (typeof val1 !== typeof val2) {\n // If the type of the two values are different, then no way to merge them.\n // Prefer val2.\n return val2;\n } else if (name.startsWith(\"on\") && typeof val1 === \"function\") {\n // Special case for event handlers -- always call both handlers\n return (...args: any[]) => {\n let res: any;\n if (typeof val1 === \"function\") {\n res = val1(...args);\n }\n if (typeof val2 === \"function\") {\n res = val2(...args);\n }\n return res;\n };\n } else {\n // For all else, prefer val2\n return val2;\n }\n}\n\nexport function getElementTypeName(element: React.ReactElement) {\n if (typeof element.type === \"string\") {\n return element.type;\n } else {\n const comp = element.type as any;\n return comp.displayName ?? comp.name ?? comp.render?.name ?? \"Component\";\n }\n}\n"],"names":["React"],"mappings":";;;;IAGa,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AAc;gBAAd,yBAAc;;YACpB,IAAI,GAAQ,CAAC;YACb,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC9B,GAAG,GAAG,IAAI,eAAI,IAAI,CAAC,CAAC;aACrB;YACD,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;gBAC9B,GAAG,GAAG,IAAI,eAAI,IAAI,CAAC,CAAC;aACrB;YACD,OAAO,GAAG,CAAC;SACZ,CAAC;KACH;SAAM;;QAEL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;SAEe,kBAAkB,CAAC,OAA2B;;IAC5D,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;QACpC,OAAO,OAAO,CAAC,IAAI,CAAC;KACrB;SAAM;QACL,IAAM,IAAI,GAAG,OAAO,CAAC,IAAW,CAAC;QACjC,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,WAAW,mCAAI,IAAI,CAAC,IAAI,mCAAI,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,mCAAI,WAAW,CAAC;KAC1E;AACH;;;;"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
|
|
4
|
-
const isBrowser = typeof window !== "undefined";
|
|
5
|
-
const NONE = Symbol("NONE");
|
|
6
|
-
const useIsomorphicLayoutEffect = isBrowser
|
|
7
|
-
? React__default.useLayoutEffect
|
|
8
|
-
: React__default.useEffect;
|
|
9
|
-
function createElementWithChildren(elementType, props, children) {
|
|
10
|
-
if (Array.isArray(children)) {
|
|
11
|
-
return React__default.createElement(elementType, props, ...children);
|
|
12
|
-
}
|
|
13
|
-
else if (children || "children" in props) {
|
|
14
|
-
// Only call React.createElement with `children` if there are actual children,
|
|
15
|
-
// or if there was an explicit (albeit undefined) children passed via
|
|
16
|
-
// props. Otherwise, if you pass `undefined` as the children argument
|
|
17
|
-
// to React.createElement, the created element will have prop {children: undefined}.
|
|
18
|
-
// If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}
|
|
19
|
-
// are used, then it will be taken as a `children` override, and will thus blank out
|
|
20
|
-
// everything under the root node.
|
|
21
|
-
return React__default.createElement(elementType, props, children);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return React__default.createElement(elementType, props);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function ensureNotArray(children) {
|
|
28
|
-
if (Array.isArray(children)) {
|
|
29
|
-
if (children.length === 1) {
|
|
30
|
-
return children[0];
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return React__default.createElement(React__default.Fragment, {}, ...children);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return children;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Flattens ReactNode into an array of ReactChild, but does NOT replace
|
|
42
|
-
* missing keys with array index, as React.Children.toArray() does.
|
|
43
|
-
*/
|
|
44
|
-
function toChildArray(children) {
|
|
45
|
-
if (isReactChild(children)) {
|
|
46
|
-
return [children];
|
|
47
|
-
}
|
|
48
|
-
else if (Array.isArray(children)) {
|
|
49
|
-
return children.flatMap(toChildArray);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function isReactText(child) {
|
|
56
|
-
return typeof child === "string" || typeof child === "number";
|
|
57
|
-
}
|
|
58
|
-
function isReactChild(child) {
|
|
59
|
-
return React__default.isValidElement(child) || isReactText(child);
|
|
60
|
-
}
|
|
61
|
-
function isReactNode(x) {
|
|
62
|
-
return (typeof x === "string" || typeof x === "number" || React__default.isValidElement(x));
|
|
63
|
-
}
|
|
64
|
-
function mergeProps(props, ...restProps) {
|
|
65
|
-
if (restProps.every((rest) => Object.keys(rest).length === 0)) {
|
|
66
|
-
return props;
|
|
67
|
-
}
|
|
68
|
-
const result = { ...props };
|
|
69
|
-
for (const rest of restProps) {
|
|
70
|
-
for (const key of Object.keys(rest)) {
|
|
71
|
-
result[key] = mergePropVals(key, result[key], rest[key]);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
function updateRef(ref, value) {
|
|
77
|
-
if (!ref) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (typeof ref === "function") {
|
|
81
|
-
ref(value);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
if (!Object.isFrozen(ref)) {
|
|
85
|
-
ref.current = value;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function mergeRefs(...refs) {
|
|
90
|
-
return (value) => {
|
|
91
|
-
for (const ref of refs) {
|
|
92
|
-
updateRef(ref, value);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function mergePropVals(name, val1, val2) {
|
|
97
|
-
if (val1 === NONE || val2 === NONE) {
|
|
98
|
-
// The NONE sentinel always skips all merging and returns null
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
101
|
-
else if (val1 == null) {
|
|
102
|
-
// If either of them is nil, prefer the other
|
|
103
|
-
return val2;
|
|
104
|
-
}
|
|
105
|
-
else if (val2 == null) {
|
|
106
|
-
return val1;
|
|
107
|
-
}
|
|
108
|
-
else if (name === "className") {
|
|
109
|
-
// Special case for className -- always combine both class names
|
|
110
|
-
return classNames(val1, val2);
|
|
111
|
-
}
|
|
112
|
-
else if (name === "style") {
|
|
113
|
-
// Special case for style -- always shallow-merge style dicts
|
|
114
|
-
return { ...val1, ...val2 };
|
|
115
|
-
}
|
|
116
|
-
else if (name === "ref") {
|
|
117
|
-
// Special case for ref
|
|
118
|
-
return mergeRefs(val1, val2);
|
|
119
|
-
}
|
|
120
|
-
else if (typeof val1 !== typeof val2) {
|
|
121
|
-
// If the type of the two values are different, then no way to merge them.
|
|
122
|
-
// Prefer val2.
|
|
123
|
-
return val2;
|
|
124
|
-
}
|
|
125
|
-
else if (name.startsWith("on") && typeof val1 === "function") {
|
|
126
|
-
// Special case for event handlers -- always call both handlers
|
|
127
|
-
return (...args) => {
|
|
128
|
-
let res;
|
|
129
|
-
if (typeof val1 === "function") {
|
|
130
|
-
res = val1(...args);
|
|
131
|
-
}
|
|
132
|
-
if (typeof val2 === "function") {
|
|
133
|
-
res = val2(...args);
|
|
134
|
-
}
|
|
135
|
-
return res;
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
// For all else, prefer val2
|
|
140
|
-
return val2;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function getElementTypeName(element) {
|
|
144
|
-
var _a, _b, _c, _d;
|
|
145
|
-
if (typeof element.type === "string") {
|
|
146
|
-
return element.type;
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
const comp = element.type;
|
|
150
|
-
return (_d = (_b = (_a = comp.displayName) !== null && _a !== void 0 ? _a : comp.name) !== null && _b !== void 0 ? _b : (_c = comp.render) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "Component";
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export { NONE as N, mergePropVals as a, isBrowser as b, createElementWithChildren as c, mergeRefs as d, ensureNotArray as e, getElementTypeName as g, isReactNode as i, mergeProps as m, toChildArray as t, useIsomorphicLayoutEffect as u };
|
|
155
|
-
//# sourceMappingURL=react-utils-b5dc6320.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-utils-b5dc6320.js","sources":["../../src/react-utils.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport React from \"react\";\n\nexport const isBrowser = typeof window !== \"undefined\";\nexport const NONE = Symbol(\"NONE\");\n\nexport const useIsomorphicLayoutEffect = isBrowser\n ? React.useLayoutEffect\n : React.useEffect;\n\nexport function createElementWithChildren(\n elementType: any,\n props: any,\n children: React.ReactNode\n) {\n if (Array.isArray(children)) {\n return React.createElement(\n elementType,\n props,\n ...children\n ) as React.ReactElement;\n } else if (children || \"children\" in props) {\n // Only call React.createElement with `children` if there are actual children,\n // or if there was an explicit (albeit undefined) children passed via\n // props. Otherwise, if you pass `undefined` as the children argument\n // to React.createElement, the created element will have prop {children: undefined}.\n // If the `root` is an PlasmicGeneratedComponent, and these props with {children: undefined}\n // are used, then it will be taken as a `children` override, and will thus blank out\n // everything under the root node.\n return React.createElement(elementType, props, children);\n } else {\n return React.createElement(elementType, props);\n }\n}\n\nexport function ensureNotArray(children: React.ReactNode) {\n if (Array.isArray(children)) {\n if (children.length === 1) {\n return children[0];\n } else {\n return React.createElement(React.Fragment, {}, ...children);\n }\n } else {\n return children;\n }\n}\n\n/**\n * Flattens ReactNode into an array of ReactChild, but does NOT replace\n * missing keys with array index, as React.Children.toArray() does.\n */\nexport function toChildArray(children: React.ReactNode): React.ReactChild[] {\n if (isReactChild(children)) {\n return [children];\n } else if (Array.isArray(children)) {\n return children.flatMap(toChildArray);\n } else {\n return [];\n }\n}\n\nexport function isReactText(child: React.ReactNode): child is React.ReactText {\n return typeof child === \"string\" || typeof child === \"number\";\n}\n\nexport function isReactChild(\n child: React.ReactNode\n): child is React.ReactChild {\n return React.isValidElement(child) || isReactText(child);\n}\n\nexport function isReactFragment(\n child: React.ReactNode\n): child is React.ReactElement {\n return React.isValidElement(child) && child.type === React.Fragment;\n}\n\nexport function isReactNode(x: any) {\n return (\n typeof x === \"string\" || typeof x === \"number\" || React.isValidElement(x)\n );\n}\n\n// From https://stackoverflow.com/questions/54775790/forcing-excess-property-checking-on-variable-passed-to-typescript-function\n// We also wrap the error message in a Partial<> because otherwise Jetbrains IDEs will autocomplete the component with all the string methods as props - see https://github.com/plasmicapp/plasmic/issues/16.\nexport type StrictProps<T, TExpected> = Exclude<\n keyof T,\n keyof TExpected\n> extends never\n ? {}\n : Partial<\"Unexpected extraneous props\">;\n\nexport type HTMLElementRefOf<T extends keyof JSX.IntrinsicElements> = Exclude<\n React.ComponentProps<T>[\"ref\"],\n string\n>;\n\nexport function mergeProps(\n props: Record<string, any>,\n ...restProps: Record<string, any>[]\n): Record<string, any> {\n if (restProps.every((rest) => Object.keys(rest).length === 0)) {\n return props;\n }\n\n const result = { ...props };\n\n for (const rest of restProps) {\n for (const key of Object.keys(rest)) {\n result[key] = mergePropVals(key, result[key], rest[key]);\n }\n }\n\n return result;\n}\n\nfunction updateRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (!ref) {\n return;\n }\n\n if (typeof ref === \"function\") {\n ref(value);\n } else {\n if (!Object.isFrozen(ref)) {\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n }\n}\n\nexport function mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]) {\n return (value: T) => {\n for (const ref of refs) {\n updateRef(ref, value);\n }\n };\n}\n\nexport function mergePropVals(name: string, val1: any, val2: any): any {\n if (val1 === NONE || val2 === NONE) {\n // The NONE sentinel always skips all merging and returns null\n return null;\n } else if (val1 == null) {\n // If either of them is nil, prefer the other\n return val2;\n } else if (val2 == null) {\n return val1;\n } else if (name === \"className\") {\n // Special case for className -- always combine both class names\n return classNames(val1, val2);\n } else if (name === \"style\") {\n // Special case for style -- always shallow-merge style dicts\n return { ...val1, ...val2 };\n } else if (name === \"ref\") {\n // Special case for ref\n return mergeRefs(val1, val2);\n } else if (typeof val1 !== typeof val2) {\n // If the type of the two values are different, then no way to merge them.\n // Prefer val2.\n return val2;\n } else if (name.startsWith(\"on\") && typeof val1 === \"function\") {\n // Special case for event handlers -- always call both handlers\n return (...args: any[]) => {\n let res: any;\n if (typeof val1 === \"function\") {\n res = val1(...args);\n }\n if (typeof val2 === \"function\") {\n res = val2(...args);\n }\n return res;\n };\n } else {\n // For all else, prefer val2\n return val2;\n }\n}\n\nexport function getElementTypeName(element: React.ReactElement) {\n if (typeof element.type === \"string\") {\n return element.type;\n } else {\n const comp = element.type as any;\n return comp.displayName ?? comp.name ?? comp.render?.name ?? \"Component\";\n }\n}\n"],"names":["React"],"mappings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H;SAAM;;QAEL,OAAO,IAAI,CAAC;KACb;AACH,CAAC;SAEe,kBAAkB,CAAC,OAA2B;;IAC5D,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;QACpC,OAAO,OAAO,CAAC,IAAI,CAAC;KACrB;SAAM;QACL,MAAM,IAAI,GAAG,OAAO,CAAC,IAAW,CAAC;QACjC,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,WAAW,mCAAI,IAAI,CAAC,IAAI,mCAAI,MAAA,IAAI,CAAC,MAAM,0CAAE,IAAI,mCAAI,WAAW,CAAC;KAC1E;AACH;;;;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export declare const PlasmicHeadContext: React.Context<React.ComponentType<any> | undefined>;
|
|
3
|
-
declare type PlasmicHeadProps = {
|
|
4
|
-
title?: string;
|
|
5
|
-
description?: string;
|
|
6
|
-
image?: string;
|
|
7
|
-
canonical?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function PlasmicHead(props: PlasmicHeadProps): JSX.Element | null;
|
|
10
|
-
export declare const plasmicHeadMeta: {
|
|
11
|
-
name: string;
|
|
12
|
-
displayName: string;
|
|
13
|
-
description: string;
|
|
14
|
-
importName: string;
|
|
15
|
-
importPath: string;
|
|
16
|
-
props: {
|
|
17
|
-
title: {
|
|
18
|
-
type: string;
|
|
19
|
-
displayName: string;
|
|
20
|
-
};
|
|
21
|
-
description: {
|
|
22
|
-
type: string;
|
|
23
|
-
displayName: string;
|
|
24
|
-
};
|
|
25
|
-
image: {
|
|
26
|
-
type: string;
|
|
27
|
-
displayName: string;
|
|
28
|
-
};
|
|
29
|
-
canonical: {
|
|
30
|
-
type: string;
|
|
31
|
-
displayName: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {};
|