@jobber/components-native 0.70.0 → 0.70.1-CLEANUPex-e95f16e.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.1-CLEANUPex-e95f16e.2+e95f16e9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"react-native-safe-area-context": "^4.5.2",
|
|
83
83
|
"react-native-svg": ">=12.0.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "e95f16e9ba785cb1e14de3f3cf39096563784f86"
|
|
86
86
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exportedComponents": [
|
|
3
|
+
"ActionItem",
|
|
4
|
+
"ActionItemGroup",
|
|
5
|
+
"ActionLabel",
|
|
6
|
+
"ActivityIndicator",
|
|
7
|
+
"AtlantisContext.Provider",
|
|
8
|
+
"AtlantisContext.Consumer",
|
|
9
|
+
"AutoLink",
|
|
10
|
+
"Banner",
|
|
11
|
+
"BottomSheet",
|
|
12
|
+
"BottomSheetOption",
|
|
13
|
+
"Button",
|
|
14
|
+
"ButtonGroup",
|
|
15
|
+
"ButtonGroup.PrimaryAction",
|
|
16
|
+
"ButtonGroup.SecondaryAction",
|
|
17
|
+
"Card",
|
|
18
|
+
"Checkbox",
|
|
19
|
+
"CheckboxGroup",
|
|
20
|
+
"Chip",
|
|
21
|
+
"Content",
|
|
22
|
+
"ContentOverlay",
|
|
23
|
+
"Disclosure",
|
|
24
|
+
"Divider",
|
|
25
|
+
"EmptyState",
|
|
26
|
+
"ErrorMessageContext.Provider",
|
|
27
|
+
"ErrorMessageContext.Consumer",
|
|
28
|
+
"ErrorMessageProvider",
|
|
29
|
+
"ErrorMessageWrapper",
|
|
30
|
+
"Flex",
|
|
31
|
+
"Form",
|
|
32
|
+
"FormMessage",
|
|
33
|
+
"AtlantisFormContext.Provider",
|
|
34
|
+
"AtlantisFormContext.Consumer",
|
|
35
|
+
"FormatFile",
|
|
36
|
+
"FormField",
|
|
37
|
+
"Glimmer",
|
|
38
|
+
"Heading",
|
|
39
|
+
"Icon",
|
|
40
|
+
"IconButton",
|
|
41
|
+
"InputCurrency",
|
|
42
|
+
"InputDate",
|
|
43
|
+
"InputEmail",
|
|
44
|
+
"InputFieldWrapper",
|
|
45
|
+
"InputNumber",
|
|
46
|
+
"InputPassword",
|
|
47
|
+
"InputPressable",
|
|
48
|
+
"FilterButton",
|
|
49
|
+
"InputSearch",
|
|
50
|
+
"InputText",
|
|
51
|
+
"InputAccessoriesContext.Provider",
|
|
52
|
+
"InputAccessoriesContext.Consumer",
|
|
53
|
+
"InputAccessoriesProvider",
|
|
54
|
+
"InputTime",
|
|
55
|
+
"Menu",
|
|
56
|
+
"ProgressBar",
|
|
57
|
+
"Option",
|
|
58
|
+
"Select",
|
|
59
|
+
"StatusLabel",
|
|
60
|
+
"Switch",
|
|
61
|
+
"Text",
|
|
62
|
+
"TextList",
|
|
63
|
+
"ThumbnailList",
|
|
64
|
+
"Toast",
|
|
65
|
+
"TypographyGestureDetector"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as fs from "fs/promises";
|
|
2
|
+
import * as allExports from "../../index";
|
|
3
|
+
|
|
4
|
+
jest.mock("../../AutoLink/clipboard", () => {
|
|
5
|
+
return {
|
|
6
|
+
copyTextToClipboard: jest.fn(),
|
|
7
|
+
};
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe("meta", () => {
|
|
11
|
+
// If this test fails, please update meta.json accordingly.
|
|
12
|
+
it("verifies that the meta.json file is up to date", async () => {
|
|
13
|
+
const meta = await fs.readFile(`${__dirname}/meta.json`, "utf-8");
|
|
14
|
+
const allNames = findComponentNamesDeep(allExports);
|
|
15
|
+
|
|
16
|
+
expect(JSON.parse(meta)).toStrictEqual({
|
|
17
|
+
exportedComponents: allNames,
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
function isComponent(name: string, value: any): boolean {
|
|
24
|
+
const isFirstLetterUppercase = /^[A-Z]/.test(name);
|
|
25
|
+
const isFunctionComponent = typeof value === "function";
|
|
26
|
+
|
|
27
|
+
return isFirstLetterUppercase && isFunctionComponent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
function isContext(value: any): boolean {
|
|
32
|
+
return (
|
|
33
|
+
value &&
|
|
34
|
+
typeof value === "object" &&
|
|
35
|
+
Object.prototype.hasOwnProperty.call(value, "Provider") &&
|
|
36
|
+
Object.prototype.hasOwnProperty.call(value, "Consumer")
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
function isForwardedRef(name: string, value: any): boolean {
|
|
42
|
+
const isFirstLetterUppercase = /^[A-Z]/.test(name);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
isFirstLetterUppercase &&
|
|
46
|
+
value &&
|
|
47
|
+
typeof value === "object" &&
|
|
48
|
+
typeof value.render === "function"
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
function findComponentNamesDeep(objectOrFunction: any, name?: string) {
|
|
54
|
+
const entries = [...Object.entries(objectOrFunction)];
|
|
55
|
+
|
|
56
|
+
return entries.reduce<string[]>((allNames, [k, v]) => {
|
|
57
|
+
if (isContext(v)) {
|
|
58
|
+
allNames.push(`${k}.Provider`, `${k}.Consumer`);
|
|
59
|
+
} else if (isForwardedRef(k, v)) {
|
|
60
|
+
allNames.push(k);
|
|
61
|
+
} else if (isComponent(k, v)) {
|
|
62
|
+
const thisName = name ? `${name}.${k}` : k;
|
|
63
|
+
allNames.push(thisName);
|
|
64
|
+
|
|
65
|
+
const childComponents = findComponentNamesDeep(v, k);
|
|
66
|
+
allNames.push(...childComponents);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return allNames;
|
|
70
|
+
}, []);
|
|
71
|
+
}
|