@plasmicapp/react-web 0.2.196 → 0.2.198
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/index.cjs.js +3715 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/plume/button/index.d.ts +4 -4
- package/dist/plume/checkbox/index.d.ts +1 -1
- package/dist/plume/collection-utils.d.ts +7 -7
- package/dist/plume/collection-utils.spec.d.ts +1 -0
- package/dist/plume/menu/menu.d.ts +1 -1
- package/dist/plume/menu-button/menu-button.d.ts +1 -1
- package/dist/plume/menu-button/menu-trigger.d.ts +1 -1
- package/dist/plume/plume-utils.d.ts +13 -13
- package/dist/plume/select/select-option.d.ts +1 -1
- package/dist/plume/select/select.d.ts +1 -1
- package/dist/plume/switch/index.d.ts +1 -1
- package/dist/plume/text-input/index.d.ts +1 -1
- package/dist/plume/triggered-overlay/triggered-overlay.d.ts +1 -1
- package/dist/react-utils.d.ts +3 -3
- package/dist/react-utils.spec.d.ts +1 -0
- package/dist/react-web.esm.js +3485 -4538
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/PlasmicHead/index.d.ts +2 -2
- package/dist/render/PlasmicImg/index.d.ts +1 -1
- package/dist/render/Stack.d.ts +1 -1
- package/dist/render/elements.d.ts +12 -12
- package/dist/render/screen-variants.d.ts +1 -1
- package/dist/render/translation.d.ts +2 -2
- package/dist/render/triggers.d.ts +1 -1
- package/dist/states/helpers.d.ts +1 -1
- package/dist/states/types.d.ts +6 -6
- package/dist/stories/PlasmicImg.stories.d.ts +3 -2
- package/dist/stories/UseDollarState.stories.d.ts +23 -22
- package/package.json +17 -44
- package/skinny/dist/{collection-utils-0967eaf0.js → collection-utils-33d43bc0.js} +5 -4
- package/skinny/dist/{collection-utils-0967eaf0.js.map → collection-utils-33d43bc0.js.map} +1 -1
- package/skinny/dist/common-dc5a84e8.js +135 -0
- package/skinny/dist/common-dc5a84e8.js.map +1 -0
- package/skinny/dist/index.js +4 -3
- package/skinny/dist/index.js.map +1 -1
- package/skinny/dist/plume/button/index.js +3 -2
- package/skinny/dist/plume/button/index.js.map +1 -1
- package/skinny/dist/plume/checkbox/index.js +5 -4
- package/skinny/dist/plume/checkbox/index.js.map +1 -1
- package/skinny/dist/plume/menu/index.js +6 -5
- package/skinny/dist/plume/menu/index.js.map +1 -1
- package/skinny/dist/plume/menu-button/index.js +5 -4
- package/skinny/dist/plume/menu-button/index.js.map +1 -1
- package/skinny/dist/plume/select/index.js +6 -5
- package/skinny/dist/plume/select/index.js.map +1 -1
- package/skinny/dist/plume/switch/index.js +5 -4
- package/skinny/dist/plume/switch/index.js.map +1 -1
- package/skinny/dist/plume/text-input/index.js +3 -2
- package/skinny/dist/plume/text-input/index.js.map +1 -1
- package/skinny/dist/plume/triggered-overlay/index.js +5 -4
- package/skinny/dist/plume/triggered-overlay/index.js.map +1 -1
- package/skinny/dist/{plume-utils-7d68bcc0.js → plume-utils-83879d02.js} +2 -2
- package/skinny/dist/{plume-utils-7d68bcc0.js.map → plume-utils-83879d02.js.map} +1 -1
- package/skinny/dist/props-utils-1c39261f.js +9 -0
- package/skinny/dist/{props-utils-9f9c761a.js.map → props-utils-1c39261f.js.map} +1 -1
- package/skinny/dist/{react-utils-ee4e03ba.js → react-utils-898d19d0.js} +2 -2
- package/skinny/dist/{react-utils-ee4e03ba.js.map → react-utils-898d19d0.js.map} +1 -1
- package/skinny/dist/render/PlasmicImg/index.js +3 -2
- package/skinny/dist/render/PlasmicImg/index.js.map +1 -1
- package/dist/all.d.ts +0 -13357
- package/dist/index.js +0 -8
- package/dist/react-web.cjs.development.js +0 -4737
- package/dist/react-web.cjs.development.js.map +0 -1
- package/dist/react-web.cjs.production.min.js +0 -2
- package/dist/react-web.cjs.production.min.js.map +0 -1
- package/skinny/dist/common-9d6d348d.js +0 -264
- package/skinny/dist/common-9d6d348d.js.map +0 -1
- package/skinny/dist/props-utils-9f9c761a.js +0 -8
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { __values } from 'tslib';
|
|
2
|
+
|
|
3
|
+
function notNil(x) {
|
|
4
|
+
return x != null;
|
|
5
|
+
}
|
|
6
|
+
function pick(obj) {
|
|
7
|
+
var e_1, _a;
|
|
8
|
+
var keys = [];
|
|
9
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
10
|
+
keys[_i - 1] = arguments[_i];
|
|
11
|
+
}
|
|
12
|
+
if (Object.keys(obj).length === 0) {
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
var res = {};
|
|
16
|
+
try {
|
|
17
|
+
for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
|
|
18
|
+
var key = keys_1_1.value;
|
|
19
|
+
if (key in obj) {
|
|
20
|
+
res[key] = obj[key];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
25
|
+
finally {
|
|
26
|
+
try {
|
|
27
|
+
if (keys_1_1 && !keys_1_1.done && (_a = keys_1["return"])) _a.call(keys_1);
|
|
28
|
+
}
|
|
29
|
+
finally { if (e_1) throw e_1.error; }
|
|
30
|
+
}
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
function omit(obj) {
|
|
34
|
+
var e_3, _a;
|
|
35
|
+
var keys = [];
|
|
36
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
37
|
+
keys[_i - 1] = arguments[_i];
|
|
38
|
+
}
|
|
39
|
+
if (Object.keys(obj).length === 0) {
|
|
40
|
+
return obj;
|
|
41
|
+
}
|
|
42
|
+
var res = {};
|
|
43
|
+
try {
|
|
44
|
+
for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
45
|
+
var key = _c.value;
|
|
46
|
+
if (!keys.includes(key)) {
|
|
47
|
+
res[key] = obj[key];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
52
|
+
finally {
|
|
53
|
+
try {
|
|
54
|
+
if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
|
|
55
|
+
}
|
|
56
|
+
finally { if (e_3) throw e_3.error; }
|
|
57
|
+
}
|
|
58
|
+
return res;
|
|
59
|
+
}
|
|
60
|
+
function isSubset(a1, a2) {
|
|
61
|
+
return a1.every(function (x) { return a2.includes(x); });
|
|
62
|
+
}
|
|
63
|
+
function chainSingleArgFuncs() {
|
|
64
|
+
var funcs = [];
|
|
65
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
66
|
+
funcs[_i] = arguments[_i];
|
|
67
|
+
}
|
|
68
|
+
if (funcs.length === 0) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return function (arg) {
|
|
72
|
+
var e_4, _a;
|
|
73
|
+
var res = arg;
|
|
74
|
+
try {
|
|
75
|
+
for (var funcs_1 = __values(funcs), funcs_1_1 = funcs_1.next(); !funcs_1_1.done; funcs_1_1 = funcs_1.next()) {
|
|
76
|
+
var func = funcs_1_1.value;
|
|
77
|
+
res = func(res);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
81
|
+
finally {
|
|
82
|
+
try {
|
|
83
|
+
if (funcs_1_1 && !funcs_1_1.done && (_a = funcs_1["return"])) _a.call(funcs_1);
|
|
84
|
+
}
|
|
85
|
+
finally { if (e_4) throw e_4.error; }
|
|
86
|
+
}
|
|
87
|
+
return res;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function ensure(x) {
|
|
91
|
+
if (x === null || x === undefined) {
|
|
92
|
+
debugger;
|
|
93
|
+
throw new Error("Value must not be undefined or null");
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return x;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function isString(x) {
|
|
100
|
+
return typeof x === "string";
|
|
101
|
+
}
|
|
102
|
+
function groupBy(collection, keyFunc) {
|
|
103
|
+
var e_5, _a;
|
|
104
|
+
var result = {};
|
|
105
|
+
try {
|
|
106
|
+
for (var collection_1 = __values(collection), collection_1_1 = collection_1.next(); !collection_1_1.done; collection_1_1 = collection_1.next()) {
|
|
107
|
+
var obj = collection_1_1.value;
|
|
108
|
+
var key = keyFunc(obj);
|
|
109
|
+
if (key in result) {
|
|
110
|
+
result[key].push(obj);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
result[key] = [obj];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
118
|
+
finally {
|
|
119
|
+
try {
|
|
120
|
+
if (collection_1_1 && !collection_1_1.done && (_a = collection_1["return"])) _a.call(collection_1);
|
|
121
|
+
}
|
|
122
|
+
finally { if (e_5) throw e_5.error; }
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
function mapValues(obj, mapper) {
|
|
127
|
+
var result = {};
|
|
128
|
+
for (var key in obj) {
|
|
129
|
+
result[key] = mapper(obj[key]);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { isString as a, chainSingleArgFuncs as c, ensure as e, groupBy as g, isSubset as i, mapValues as m, notNil as n, omit as o, pick as p };
|
|
135
|
+
//# sourceMappingURL=common-dc5a84e8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-dc5a84e8.js","sources":["../../src/common.ts"],"sourcesContent":["export function notNil<T>(x: T | undefined | null): x is T {\n return x != null;\n}\n\nexport function pick<T extends {}>(\n obj: T,\n ...keys: (string | number | symbol)[]\n): Partial<T> {\n if (Object.keys(obj).length === 0) {\n return obj;\n }\n const res: any = {};\n for (const key of keys) {\n if (key in obj) {\n res[key] = obj[key as keyof T];\n }\n }\n return res as Partial<T>;\n}\n\nexport function pickBy<T extends {}>(\n obj: T,\n func: (key: string, val: any) => boolean\n): Partial<T> {\n const res: any = {};\n for (const [key, val] of Object.entries(obj)) {\n if (func(key, val)) {\n res[key] = obj[key as keyof T];\n }\n }\n return res as Partial<T>;\n}\n\nexport function omit<T extends {}>(obj: T, ...keys: (keyof T)[]): Partial<T> {\n if (Object.keys(obj).length === 0) {\n return obj;\n }\n const res: Partial<T> = {};\n for (const key of Object.keys(obj) as (keyof T)[]) {\n if (!keys.includes(key)) {\n res[key] = obj[key];\n }\n }\n return res;\n}\n\nexport function isSubset<T>(a1: T[], a2: T[]) {\n return a1.every((x) => a2.includes(x));\n}\n\nexport function chainSingleArgFuncs<A>(...funcs: ((arg: A) => A)[]) {\n if (funcs.length === 0) {\n return undefined;\n }\n return (arg: A) => {\n let res: A = arg;\n for (const func of funcs) {\n res = func(res);\n }\n return res;\n };\n}\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nexport function isString(x: any): x is string {\n return typeof x === \"string\";\n}\n\nexport function groupBy<T>(\n collection: T[],\n keyFunc: (x: T) => string\n): Record<string, T[]> {\n const result: Record<string, T[]> = {};\n for (const obj of collection) {\n const key = keyFunc(obj);\n if (key in result) {\n result[key].push(obj);\n } else {\n result[key] = [obj];\n }\n }\n return result;\n}\n\nexport function mapValues<V, V2>(\n obj: Record<string, V>,\n mapper: (value: V) => V2\n): Record<string, V2> {\n const result: Record<string, V2> = {};\n for (const key in obj) {\n result[key] = mapper(obj[key]);\n }\n return result;\n}\n"],"names":[],"mappings":";;SAAgB,MAAM,CAAI,CAAuB;IAC/C,OAAO,CAAC,IAAI,IAAI,CAAC;AACnB,CAAC;SAEe,IAAI,CAClB,GAAM;;IACN,cAAqC;SAArC,UAAqC,EAArC,qBAAqC,EAArC,IAAqC;QAArC,6BAAqC;;IAErC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,C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ED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import classNames$1 from 'classnames';
|
|
2
|
+
import { __awaiter, __generator, __assign, __rest, __spreadArray, __read, __values, __extends } from 'tslib';
|
|
2
3
|
import { usePlasmicDataSourceContext } from '@plasmicapp/data-sources-context';
|
|
3
4
|
export { PlasmicDataSourceContextProvider, useCurrentUser } from '@plasmicapp/data-sources-context';
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import React__default, { useLayoutEffect, useEffect } from 'react';
|
|
6
7
|
import get from 'dlv';
|
|
7
8
|
export { default as get } from 'dlv';
|
|
8
|
-
import { c as createElementWithChildren, m as mergeProps, e as ensureNotArray, N as NONE, a as mergePropVals, i as isReactNode, b as isBrowser, u as useIsomorphicLayoutEffect$1 } from './react-utils-
|
|
9
|
-
import {
|
|
10
|
-
export { o as omit, p as pick } from './common-
|
|
9
|
+
import { c as createElementWithChildren, m as mergeProps, e as ensureNotArray, N as NONE, a as mergePropVals, i as isReactNode, b as isBrowser, u as useIsomorphicLayoutEffect$1 } from './react-utils-898d19d0.js';
|
|
10
|
+
import { o as omit, p as pick, i as isSubset, c as chainSingleArgFuncs, n as notNil, e as ensure } from './common-dc5a84e8.js';
|
|
11
|
+
export { o as omit, p as pick } from './common-dc5a84e8.js';
|
|
11
12
|
export { PlasmicHead, plasmicHeadMeta } from './render/PlasmicHead/index.js';
|
|
12
13
|
export { PlasmicImg } from './render/PlasmicImg/index.js';
|
|
13
14
|
import { T as Trans } from './ssr-c9834f50.js';
|