@manuscripts/style-guide 0.31.19 → 0.31.20
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.
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useFiles = void 0;
|
|
6
7
|
const manuscript_transform_1 = require("@manuscripts/manuscript-transform");
|
|
7
8
|
const manuscripts_json_schema_1 = require("@manuscripts/manuscripts-json-schema");
|
|
8
9
|
const inlineFiles_1 = __importDefault(require("../lib/inlineFiles"));
|
|
@@ -32,7 +33,7 @@ const getOtherFiles = (inlineFiles, supplementFiles, attachments, filePredicate)
|
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
+
const useFiles = (modelMap, attachments, filePredicate) => (0, use_deep_compare_1.useDeepCompareMemo)(() => {
|
|
36
37
|
const inlineFiles = (0, inlineFiles_1.default)(modelMap, attachments);
|
|
37
38
|
const supplementFiles = getSupplementFiles(modelMap, attachments, filePredicate);
|
|
38
39
|
const otherFiles = getOtherFiles(inlineFiles, supplementFiles, attachments, filePredicate);
|
|
@@ -42,3 +43,5 @@ exports.default = (modelMap, attachments, filePredicate) => (0, use_deep_compare
|
|
|
42
43
|
inlineFiles,
|
|
43
44
|
};
|
|
44
45
|
}, [...Array.from(modelMap.values()), ...attachments]);
|
|
46
|
+
exports.useFiles = useFiles;
|
|
47
|
+
exports.default = exports.useFiles;
|
package/dist/cjs/index.js
CHANGED
|
@@ -66,7 +66,7 @@ __exportStar(require("./components/SubmissionInspector"), exports);
|
|
|
66
66
|
__exportStar(require("./components/Dropdown"), exports);
|
|
67
67
|
__exportStar(require("./hooks/use-dropdown"), exports);
|
|
68
68
|
var use_files_1 = require("./hooks/use-files");
|
|
69
|
-
Object.defineProperty(exports, "useFiles", { enumerable: true, get: function () { return
|
|
69
|
+
Object.defineProperty(exports, "useFiles", { enumerable: true, get: function () { return use_files_1.useFiles; } });
|
|
70
70
|
var use_deep_compare_1 = require("./hooks/use-deep-compare");
|
|
71
71
|
Object.defineProperty(exports, "useDeepCompareMemo", { enumerable: true, get: function () { return use_deep_compare_1.useDeepCompareMemo; } });
|
|
72
72
|
Object.defineProperty(exports, "useDeepCompareCallback", { enumerable: true, get: function () { return use_deep_compare_1.useDeepCompareCallback; } });
|
|
@@ -27,7 +27,7 @@ const getOtherFiles = (inlineFiles, supplementFiles, attachments, filePredicate)
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
export
|
|
30
|
+
export const useFiles = (modelMap, attachments, filePredicate) => useDeepCompareMemo(() => {
|
|
31
31
|
const inlineFiles = getInlineFiles(modelMap, attachments);
|
|
32
32
|
const supplementFiles = getSupplementFiles(modelMap, attachments, filePredicate);
|
|
33
33
|
const otherFiles = getOtherFiles(inlineFiles, supplementFiles, attachments, filePredicate);
|
|
@@ -37,3 +37,4 @@ export default (modelMap, attachments, filePredicate) => useDeepCompareMemo(() =
|
|
|
37
37
|
inlineFiles,
|
|
38
38
|
};
|
|
39
39
|
}, [...Array.from(modelMap.values()), ...attachments]);
|
|
40
|
+
export default useFiles;
|
package/dist/es/index.js
CHANGED
|
@@ -48,7 +48,7 @@ export { default as PdfPreview } from './components/PdfPreview';
|
|
|
48
48
|
export * from './components/SubmissionInspector';
|
|
49
49
|
export * from './components/Dropdown';
|
|
50
50
|
export * from './hooks/use-dropdown';
|
|
51
|
-
export {
|
|
51
|
+
export { useFiles } from './hooks/use-files';
|
|
52
52
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
|
53
53
|
export * from './lib/authors';
|
|
54
54
|
export * from './lib/capabilities';
|
|
@@ -2,9 +2,9 @@ import { Model } from '@manuscripts/manuscripts-json-schema';
|
|
|
2
2
|
import { SubmissionAttachment } from '../components/FileManager/FileSectionItem/FileSectionItem';
|
|
3
3
|
import { InlineFile } from '../lib/inlineFiles';
|
|
4
4
|
declare type FilePredicate = (fileName: string) => boolean;
|
|
5
|
-
declare const
|
|
5
|
+
export declare const useFiles: (modelMap: Map<string, Model>, attachments: SubmissionAttachment[], filePredicate?: FilePredicate | undefined) => {
|
|
6
6
|
otherFiles: SubmissionAttachment[];
|
|
7
7
|
supplementFiles: SubmissionAttachment[];
|
|
8
8
|
inlineFiles: InlineFile[];
|
|
9
9
|
};
|
|
10
|
-
export default
|
|
10
|
+
export default useFiles;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export { default as PdfPreview } from './components/PdfPreview';
|
|
|
49
49
|
export * from './components/SubmissionInspector';
|
|
50
50
|
export * from './components/Dropdown';
|
|
51
51
|
export * from './hooks/use-dropdown';
|
|
52
|
-
export {
|
|
52
|
+
export { useFiles } from './hooks/use-files';
|
|
53
53
|
export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
|
|
54
54
|
export * from './lib/authors';
|
|
55
55
|
export * from './lib/capabilities';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "0.31.
|
|
4
|
+
"version": "0.31.20",
|
|
5
5
|
"repository": "gitlab:atypon-opensource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|