@tachybase/module-pdf 0.23.8

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.
Files changed (135) hide show
  1. package/.turbo/turbo-build.log +15 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/PdfInstruction.d.ts +107 -0
  6. package/dist/client/index.d.ts +10 -0
  7. package/dist/client/index.js +239 -0
  8. package/dist/externalVersion.js +11 -0
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.js +39 -0
  11. package/dist/node_modules/@babel/core/LICENSE +22 -0
  12. package/dist/node_modules/@babel/core/cjs-proxy.cjs +68 -0
  13. package/dist/node_modules/@babel/core/lib/config/cache-contexts.js +3 -0
  14. package/dist/node_modules/@babel/core/lib/config/caching.js +261 -0
  15. package/dist/node_modules/@babel/core/lib/config/config-chain.js +469 -0
  16. package/dist/node_modules/@babel/core/lib/config/config-descriptors.js +190 -0
  17. package/dist/node_modules/@babel/core/lib/config/files/configuration.js +287 -0
  18. package/dist/node_modules/@babel/core/lib/config/files/import.cjs +6 -0
  19. package/dist/node_modules/@babel/core/lib/config/files/index-browser.js +58 -0
  20. package/dist/node_modules/@babel/core/lib/config/files/index.js +78 -0
  21. package/dist/node_modules/@babel/core/lib/config/files/module-types.js +195 -0
  22. package/dist/node_modules/@babel/core/lib/config/files/package.js +61 -0
  23. package/dist/node_modules/@babel/core/lib/config/files/plugins.js +229 -0
  24. package/dist/node_modules/@babel/core/lib/config/files/types.js +3 -0
  25. package/dist/node_modules/@babel/core/lib/config/files/utils.js +36 -0
  26. package/dist/node_modules/@babel/core/lib/config/full.js +312 -0
  27. package/dist/node_modules/@babel/core/lib/config/helpers/config-api.js +84 -0
  28. package/dist/node_modules/@babel/core/lib/config/helpers/deep-array.js +23 -0
  29. package/dist/node_modules/@babel/core/lib/config/helpers/environment.js +12 -0
  30. package/dist/node_modules/@babel/core/lib/config/index.js +93 -0
  31. package/dist/node_modules/@babel/core/lib/config/item.js +67 -0
  32. package/dist/node_modules/@babel/core/lib/config/partial.js +158 -0
  33. package/dist/node_modules/@babel/core/lib/config/pattern-to-regex.js +38 -0
  34. package/dist/node_modules/@babel/core/lib/config/plugin.js +33 -0
  35. package/dist/node_modules/@babel/core/lib/config/printer.js +113 -0
  36. package/dist/node_modules/@babel/core/lib/config/resolve-targets-browser.js +41 -0
  37. package/dist/node_modules/@babel/core/lib/config/resolve-targets.js +61 -0
  38. package/dist/node_modules/@babel/core/lib/config/util.js +31 -0
  39. package/dist/node_modules/@babel/core/lib/config/validation/option-assertions.js +277 -0
  40. package/dist/node_modules/@babel/core/lib/config/validation/options.js +189 -0
  41. package/dist/node_modules/@babel/core/lib/config/validation/plugins.js +67 -0
  42. package/dist/node_modules/@babel/core/lib/config/validation/removed.js +68 -0
  43. package/dist/node_modules/@babel/core/lib/errors/config-error.js +18 -0
  44. package/dist/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +98 -0
  45. package/dist/node_modules/@babel/core/lib/gensync-utils/async.js +90 -0
  46. package/dist/node_modules/@babel/core/lib/gensync-utils/fs.js +31 -0
  47. package/dist/node_modules/@babel/core/lib/gensync-utils/functional.js +58 -0
  48. package/dist/node_modules/@babel/core/lib/index.js +227 -0
  49. package/dist/node_modules/@babel/core/lib/parse.js +47 -0
  50. package/dist/node_modules/@babel/core/lib/parser/index.js +79 -0
  51. package/dist/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js +339 -0
  52. package/dist/node_modules/@babel/core/lib/tools/build-external-helpers.js +144 -0
  53. package/dist/node_modules/@babel/core/lib/transform-ast.js +50 -0
  54. package/dist/node_modules/@babel/core/lib/transform-file-browser.js +23 -0
  55. package/dist/node_modules/@babel/core/lib/transform-file.js +40 -0
  56. package/dist/node_modules/@babel/core/lib/transform.js +49 -0
  57. package/dist/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js +84 -0
  58. package/dist/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs +4 -0
  59. package/dist/node_modules/@babel/core/lib/transformation/file/file.js +214 -0
  60. package/dist/node_modules/@babel/core/lib/transformation/file/generate.js +84 -0
  61. package/dist/node_modules/@babel/core/lib/transformation/file/merge-map.js +37 -0
  62. package/dist/node_modules/@babel/core/lib/transformation/index.js +92 -0
  63. package/dist/node_modules/@babel/core/lib/transformation/normalize-file.js +129 -0
  64. package/dist/node_modules/@babel/core/lib/transformation/normalize-opts.js +59 -0
  65. package/dist/node_modules/@babel/core/lib/transformation/plugin-pass.js +50 -0
  66. package/dist/node_modules/@babel/core/lib/transformation/util/clone-deep.js +36 -0
  67. package/dist/node_modules/@babel/core/lib/vendor/import-meta-resolve.js +1043 -0
  68. package/dist/node_modules/@babel/core/node_modules/.bin/json5 +17 -0
  69. package/dist/node_modules/@babel/core/node_modules/.bin/parser +17 -0
  70. package/dist/node_modules/@babel/core/node_modules/.bin/semver +17 -0
  71. package/dist/node_modules/@babel/core/package.json +1 -0
  72. package/dist/node_modules/@babel/core/src/config/files/index-browser.ts +113 -0
  73. package/dist/node_modules/@babel/core/src/config/files/index.ts +29 -0
  74. package/dist/node_modules/@babel/core/src/config/resolve-targets-browser.ts +40 -0
  75. package/dist/node_modules/@babel/core/src/config/resolve-targets.ts +56 -0
  76. package/dist/node_modules/@babel/core/src/transform-file-browser.ts +31 -0
  77. package/dist/node_modules/@babel/core/src/transform-file.ts +55 -0
  78. package/dist/node_modules/@react-pdf/renderer/index.d.ts +590 -0
  79. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.cjs +4558 -0
  80. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.d.cts +590 -0
  81. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.d.ts +590 -0
  82. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.js +4505 -0
  83. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.min.cjs +10 -0
  84. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.min.d.cts +590 -0
  85. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.min.d.ts +590 -0
  86. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.browser.min.js +10 -0
  87. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.cjs +40 -0
  88. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.d.cts +590 -0
  89. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.d.ts +590 -0
  90. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.js +4393 -0
  91. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.min.cjs +10 -0
  92. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.min.d.cts +590 -0
  93. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.min.d.ts +590 -0
  94. package/dist/node_modules/@react-pdf/renderer/lib/react-pdf.min.js +10 -0
  95. package/dist/node_modules/@react-pdf/renderer/package.json +1 -0
  96. package/dist/node_modules/fs-extra/LICENSE +15 -0
  97. package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +161 -0
  98. package/dist/node_modules/fs-extra/lib/copy/copy.js +177 -0
  99. package/dist/node_modules/fs-extra/lib/copy/index.js +7 -0
  100. package/dist/node_modules/fs-extra/lib/empty/index.js +39 -0
  101. package/dist/node_modules/fs-extra/lib/ensure/file.js +66 -0
  102. package/dist/node_modules/fs-extra/lib/ensure/index.js +23 -0
  103. package/dist/node_modules/fs-extra/lib/ensure/link.js +64 -0
  104. package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +101 -0
  105. package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +34 -0
  106. package/dist/node_modules/fs-extra/lib/ensure/symlink.js +67 -0
  107. package/dist/node_modules/fs-extra/lib/fs/index.js +140 -0
  108. package/dist/node_modules/fs-extra/lib/index.js +1 -0
  109. package/dist/node_modules/fs-extra/lib/json/index.js +16 -0
  110. package/dist/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
  111. package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
  112. package/dist/node_modules/fs-extra/lib/json/output-json.js +12 -0
  113. package/dist/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
  114. package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
  115. package/dist/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
  116. package/dist/node_modules/fs-extra/lib/move/index.js +7 -0
  117. package/dist/node_modules/fs-extra/lib/move/move-sync.js +55 -0
  118. package/dist/node_modules/fs-extra/lib/move/move.js +59 -0
  119. package/dist/node_modules/fs-extra/lib/output-file/index.js +31 -0
  120. package/dist/node_modules/fs-extra/lib/path-exists/index.js +12 -0
  121. package/dist/node_modules/fs-extra/lib/remove/index.js +17 -0
  122. package/dist/node_modules/fs-extra/lib/util/stat.js +158 -0
  123. package/dist/node_modules/fs-extra/lib/util/utimes.js +36 -0
  124. package/dist/node_modules/fs-extra/package.json +1 -0
  125. package/dist/server/PdfInstruction.d.ts +10 -0
  126. package/dist/server/PdfInstruction.js +108 -0
  127. package/dist/server/index.d.ts +2 -0
  128. package/dist/server/index.js +53 -0
  129. package/dist/server/plugin.d.ts +11 -0
  130. package/dist/server/plugin.js +102 -0
  131. package/dist/server/services/font-manager.d.ts +6 -0
  132. package/dist/server/services/font-manager.js +199 -0
  133. package/package.json +32 -0
  134. package/server.d.ts +2 -0
  135. package/server.js +1 -0
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = normalizeFile;
7
+ function _fs() {
8
+ const data = require("fs");
9
+ _fs = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _path() {
15
+ const data = require("path");
16
+ _path = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _debug() {
22
+ const data = require("debug");
23
+ _debug = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _t() {
29
+ const data = require("@babel/types");
30
+ _t = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _convertSourceMap() {
36
+ const data = require("convert-source-map");
37
+ _convertSourceMap = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ var _file = require("./file/file.js");
43
+ var _index = require("../parser/index.js");
44
+ var _cloneDeep = require("./util/clone-deep.js");
45
+ const {
46
+ file,
47
+ traverseFast
48
+ } = _t();
49
+ const debug = _debug()("babel:transform:file");
50
+ const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,.*$/;
51
+ const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
52
+ function* normalizeFile(pluginPasses, options, code, ast) {
53
+ code = `${code || ""}`;
54
+ if (ast) {
55
+ if (ast.type === "Program") {
56
+ ast = file(ast, [], []);
57
+ } else if (ast.type !== "File") {
58
+ throw new Error("AST root must be a Program or File node");
59
+ }
60
+ if (options.cloneInputAst) {
61
+ ast = (0, _cloneDeep.default)(ast);
62
+ }
63
+ } else {
64
+ ast = yield* (0, _index.default)(pluginPasses, options, code);
65
+ }
66
+ let inputMap = null;
67
+ if (options.inputSourceMap !== false) {
68
+ if (typeof options.inputSourceMap === "object") {
69
+ inputMap = _convertSourceMap().fromObject(options.inputSourceMap);
70
+ }
71
+ if (!inputMap) {
72
+ const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);
73
+ if (lastComment) {
74
+ try {
75
+ inputMap = _convertSourceMap().fromComment("//" + lastComment);
76
+ } catch (err) {
77
+ {
78
+ debug("discarding unknown inline input sourcemap");
79
+ }
80
+ }
81
+ }
82
+ }
83
+ if (!inputMap) {
84
+ const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);
85
+ if (typeof options.filename === "string" && lastComment) {
86
+ try {
87
+ const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment);
88
+ const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8");
89
+ inputMap = _convertSourceMap().fromJSON(inputMapContent);
90
+ } catch (err) {
91
+ debug("discarding unknown file input sourcemap", err);
92
+ }
93
+ } else if (lastComment) {
94
+ debug("discarding un-loadable file input sourcemap");
95
+ }
96
+ }
97
+ }
98
+ return new _file.default(options, {
99
+ code,
100
+ ast: ast,
101
+ inputMap
102
+ });
103
+ }
104
+ function extractCommentsFromList(regex, comments, lastComment) {
105
+ if (comments) {
106
+ comments = comments.filter(({
107
+ value
108
+ }) => {
109
+ if (regex.test(value)) {
110
+ lastComment = value;
111
+ return false;
112
+ }
113
+ return true;
114
+ });
115
+ }
116
+ return [comments, lastComment];
117
+ }
118
+ function extractComments(regex, ast) {
119
+ let lastComment = null;
120
+ traverseFast(ast, node => {
121
+ [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment);
122
+ [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment);
123
+ [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment);
124
+ });
125
+ return lastComment;
126
+ }
127
+ 0 && 0;
128
+
129
+ //# sourceMappingURL=normalize-file.js.map
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = normalizeOptions;
7
+ function _path() {
8
+ const data = require("path");
9
+ _path = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function normalizeOptions(config) {
15
+ const {
16
+ filename,
17
+ cwd,
18
+ filenameRelative = typeof filename === "string" ? _path().relative(cwd, filename) : "unknown",
19
+ sourceType = "module",
20
+ inputSourceMap,
21
+ sourceMaps = !!inputSourceMap,
22
+ sourceRoot = config.options.moduleRoot,
23
+ sourceFileName = _path().basename(filenameRelative),
24
+ comments = true,
25
+ compact = "auto"
26
+ } = config.options;
27
+ const opts = config.options;
28
+ const options = Object.assign({}, opts, {
29
+ parserOpts: Object.assign({
30
+ sourceType: _path().extname(filenameRelative) === ".mjs" ? "module" : sourceType,
31
+ sourceFileName: filename,
32
+ plugins: []
33
+ }, opts.parserOpts),
34
+ generatorOpts: Object.assign({
35
+ filename,
36
+ auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
37
+ auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
38
+ retainLines: opts.retainLines,
39
+ comments,
40
+ shouldPrintComment: opts.shouldPrintComment,
41
+ compact,
42
+ minified: opts.minified,
43
+ sourceMaps,
44
+ sourceRoot,
45
+ sourceFileName
46
+ }, opts.generatorOpts)
47
+ });
48
+ for (const plugins of config.passes) {
49
+ for (const plugin of plugins) {
50
+ if (plugin.manipulateOptions) {
51
+ plugin.manipulateOptions(options, options.parserOpts);
52
+ }
53
+ }
54
+ }
55
+ return options;
56
+ }
57
+ 0 && 0;
58
+
59
+ //# sourceMappingURL=normalize-opts.js.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ class PluginPass {
8
+ constructor(file, key, options, isAsync) {
9
+ this._map = new Map();
10
+ this.key = void 0;
11
+ this.file = void 0;
12
+ this.opts = void 0;
13
+ this.cwd = void 0;
14
+ this.filename = void 0;
15
+ this.isAsync = void 0;
16
+ this.key = key;
17
+ this.file = file;
18
+ this.opts = options || {};
19
+ this.cwd = file.opts.cwd;
20
+ this.filename = file.opts.filename;
21
+ this.isAsync = isAsync;
22
+ }
23
+ set(key, val) {
24
+ this._map.set(key, val);
25
+ }
26
+ get(key) {
27
+ return this._map.get(key);
28
+ }
29
+ availableHelper(name, versionRange) {
30
+ return this.file.availableHelper(name, versionRange);
31
+ }
32
+ addHelper(name) {
33
+ return this.file.addHelper(name);
34
+ }
35
+ buildCodeFrameError(node, msg, _Error) {
36
+ return this.file.buildCodeFrameError(node, msg, _Error);
37
+ }
38
+ }
39
+ exports.default = PluginPass;
40
+ {
41
+ PluginPass.prototype.getModuleName = function getModuleName() {
42
+ return this.file.getModuleName();
43
+ };
44
+ PluginPass.prototype.addImport = function addImport() {
45
+ this.file.addImport();
46
+ };
47
+ }
48
+ 0 && 0;
49
+
50
+ //# sourceMappingURL=plugin-pass.js.map
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = _default;
7
+ function deepClone(value, cache) {
8
+ if (value !== null) {
9
+ if (cache.has(value)) return cache.get(value);
10
+ let cloned;
11
+ if (Array.isArray(value)) {
12
+ cloned = new Array(value.length);
13
+ cache.set(value, cloned);
14
+ for (let i = 0; i < value.length; i++) {
15
+ cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache);
16
+ }
17
+ } else {
18
+ cloned = {};
19
+ cache.set(value, cloned);
20
+ const keys = Object.keys(value);
21
+ for (let i = 0; i < keys.length; i++) {
22
+ const key = keys[i];
23
+ cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache);
24
+ }
25
+ }
26
+ return cloned;
27
+ }
28
+ return value;
29
+ }
30
+ function _default(value) {
31
+ if (typeof value !== "object") return value;
32
+ return deepClone(value, new Map());
33
+ }
34
+ 0 && 0;
35
+
36
+ //# sourceMappingURL=clone-deep.js.map