@teambit/code.ui.queries.get-file-content 0.0.485 → 0.0.488
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/get-file-content.d.ts +1 -1
- package/dist/get-file-content.js +2 -2
- package/dist/get-file-content.js.map +1 -1
- package/dist/tsconfig.json +32 -0
- package/get-file-content.ts +3 -3
- package/package-tar/teambit-code.ui.queries.get-file-content-0.0.488.tgz +0 -0
- package/package.json +5 -7
- package/preview-1654572446572.js +1 -0
- package/tsconfig.json +8 -2
- package/package-tar/teambit-code.ui.queries.get-file-content-0.0.485.tgz +0 -0
|
@@ -12,7 +12,7 @@ declare type FileResult = {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare function useFileContent(componentId
|
|
15
|
+
export declare function useFileContent(componentId?: ComponentID, filePath?: string): {
|
|
16
16
|
client: import("@apollo/client").ApolloClient<any>;
|
|
17
17
|
previousData?: FileResult;
|
|
18
18
|
error?: import("@apollo/client").ApolloError;
|
package/dist/get-file-content.js
CHANGED
|
@@ -32,10 +32,10 @@ const getFile = (0, client_1.gql) `
|
|
|
32
32
|
`;
|
|
33
33
|
function useFileContent(componentId, filePath) {
|
|
34
34
|
var _a;
|
|
35
|
-
const id = componentId.toString();
|
|
35
|
+
const id = componentId === null || componentId === void 0 ? void 0 : componentId.toString();
|
|
36
36
|
const _b = (0, ui_foundation_ui_hooks_use_data_query_1.useDataQuery)(getFile, {
|
|
37
37
|
variables: { id, path: filePath },
|
|
38
|
-
skip: filePath === undefined,
|
|
38
|
+
skip: !componentId || filePath === undefined,
|
|
39
39
|
}), { data } = _b, rest = __rest(_b, ["data"]);
|
|
40
40
|
const fileContent = (_a = data === null || data === void 0 ? void 0 : data.getHost) === null || _a === void 0 ? void 0 : _a.get.getFile;
|
|
41
41
|
return Object.assign({ fileContent }, rest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-content.js","sourceRoot":"","sources":["../get-file-content.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAAqC;AACrC,0GAA8E;AAG9E,MAAM,OAAO,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;CAelB,CAAC;AAgBF,SAAgB,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"get-file-content.js","sourceRoot":"","sources":["../get-file-content.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAAqC;AACrC,0GAA8E;AAG9E,MAAM,OAAO,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;CAelB,CAAC;AAgBF,SAAgB,cAAc,CAAC,WAAyB,EAAE,QAAiB;;IACzE,MAAM,EAAE,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,EAAE,CAAC;IACnC,MAAM,KAAoB,IAAA,oDAAY,EAAa,OAAO,EAAE;QAC1D,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACjC,IAAI,EAAE,CAAC,WAAW,IAAI,QAAQ,KAAK,SAAS;KAC7C,CAAC,EAHI,EAAE,IAAI,OAGV,EAHe,IAAI,cAAf,QAAiB,CAGrB,CAAC;IAEH,MAAM,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,GAAG,CAAC,OAAO,CAAC;IAE/C,uBAAS,WAAW,IAAK,IAAI,EAAG;AAClC,CAAC;AAVD,wCAUC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"es2019",
|
|
5
|
+
"DOM",
|
|
6
|
+
"ES6",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"target": "es2015",
|
|
10
|
+
"module": "CommonJS",
|
|
11
|
+
"jsx": "react",
|
|
12
|
+
"allowJs": true,
|
|
13
|
+
"composite": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"outDir": "dist",
|
|
19
|
+
"moduleResolution": "node",
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"rootDir": ".",
|
|
22
|
+
"resolveJsonModule": true
|
|
23
|
+
},
|
|
24
|
+
"exclude": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/get-file-content.ts
CHANGED
|
@@ -33,11 +33,11 @@ type FileResult = {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export function useFileContent(componentId
|
|
37
|
-
const id = componentId
|
|
36
|
+
export function useFileContent(componentId?: ComponentID, filePath?: string) {
|
|
37
|
+
const id = componentId?.toString();
|
|
38
38
|
const { data, ...rest } = useDataQuery<FileResult>(getFile, {
|
|
39
39
|
variables: { id, path: filePath },
|
|
40
|
-
skip: filePath === undefined,
|
|
40
|
+
skip: !componentId || filePath === undefined,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
const fileContent = data?.getHost?.get.getFile;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/code.ui.queries.get-file-content",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.488",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/code/ui/queries/get-file-content",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.code",
|
|
8
8
|
"name": "ui/queries/get-file-content",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.488"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"core-js": "^3.0.0",
|
|
13
|
-
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.
|
|
13
|
+
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@types/mocha": "
|
|
16
|
+
"@types/mocha": "9.1.0",
|
|
17
17
|
"@types/testing-library__jest-dom": "5.9.5",
|
|
18
18
|
"@babel/runtime": "7.12.18",
|
|
19
19
|
"@types/jest": "^26.0.0",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@apollo/client": "^3.0.0",
|
|
26
|
-
"@teambit/legacy": "1.0.193",
|
|
27
26
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
28
27
|
"react": "^16.8.0 || ^17.0.0"
|
|
29
28
|
},
|
|
@@ -40,7 +39,7 @@
|
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@teambit/legacy": "-",
|
|
43
|
-
"@types/mocha": "
|
|
42
|
+
"@types/mocha": "9.1.0",
|
|
44
43
|
"@types/testing-library__jest-dom": "5.9.5",
|
|
45
44
|
"@babel/runtime": "7.12.18",
|
|
46
45
|
"@types/jest": "^26.0.0",
|
|
@@ -51,7 +50,6 @@
|
|
|
51
50
|
"react": "-"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
|
-
"@teambit/legacy": "1.0.193",
|
|
55
53
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
56
54
|
"react": "^16.8.0 || ^17.0.0"
|
|
57
55
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/tsconfig.json
CHANGED
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
"DOM.Iterable"
|
|
8
8
|
],
|
|
9
9
|
"target": "es2015",
|
|
10
|
-
"module": "
|
|
10
|
+
"module": "CommonJS",
|
|
11
11
|
"jsx": "react",
|
|
12
12
|
"allowJs": true,
|
|
13
13
|
"composite": true,
|
|
14
14
|
"declaration": true,
|
|
15
15
|
"sourceMap": true,
|
|
16
16
|
"skipLibCheck": true,
|
|
17
|
+
"experimentalDecorators": true,
|
|
17
18
|
"outDir": "dist",
|
|
18
19
|
"moduleResolution": "node",
|
|
19
20
|
"esModuleInterop": true,
|
|
@@ -21,6 +22,11 @@
|
|
|
21
22
|
"resolveJsonModule": true
|
|
22
23
|
},
|
|
23
24
|
"exclude": [
|
|
24
|
-
"dist"
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
25
31
|
]
|
|
26
32
|
}
|
|
Binary file
|