@nxgt/material-vue 0.23.1 → 0.23.3
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/{Button-DcFHQ3oH.js → Button-CVIR6uLK.js} +1 -1
- package/dist/{HoverCardTrigger-D99aHKDX.js → HoverCardTrigger-iAL5ALrL.js} +2 -2
- package/dist/{camera-G80plUZO.js → camera-CrMabX3d.js} +12 -12
- package/dist/{components-D3nLHMxx.js → components-aga1BOH2.js} +4887 -4912
- package/dist/components.js +6 -6
- package/dist/composables.js +2 -2
- package/dist/dnd.js +1 -1
- package/dist/{i18n-provider-BTm3J_K9.js → i18n-provider-BqWxpaKu.js} +1 -1
- package/dist/i18n.js +4 -4
- package/dist/{icon-button-DnjboAtZ.js → icon-button-DbEME76t.js} +1 -1
- package/dist/lib/components/ui/media/file-list/index.d.ts +1 -1
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.d.ts +0 -1
- package/dist/lib/i18n/resources/fr/material.json.d.ts +1 -1
- package/dist/lib/nuxt/pdf-fonts.d.ts +3 -14
- package/dist/lib.js +2 -2
- package/dist/main.js +11 -11
- package/dist/map.js +4 -4
- package/dist/{pdf-outline-sidebar-DycVwjfJ.js → pdf-outline-sidebar-D3NgGXpn.js} +2 -2
- package/dist/{pdf-page-CHfDMJ_4.js → pdf-page-DniEW6ho.js} +1 -1
- package/dist/{pdf-page-list-Cy3Qgm2N.js → pdf-page-list-ByRU33Lx.js} +2 -2
- package/dist/{pdf-reader-D8CFeq1E.js → pdf-reader-DzLQa6Uq.js} +8 -8
- package/dist/{pdf-sidebar-D4BpuyNy.js → pdf-sidebar-DoGWupRN.js} +3 -3
- package/dist/{pdf-thumbnail-sidebar-Cl9o8zQp.js → pdf-thumbnail-sidebar-B4Srzga5.js} +3 -3
- package/dist/{pdf-toolbar-Cj_fCmo3.js → pdf-toolbar-B6gRRcsv.js} +4 -4
- package/dist/pdf.js +2 -2
- package/dist/{sortable-provider-CxI3cMbb.js → sortable-provider-oEVjQiCl.js} +2 -2
- package/dist/{stored-language-D7FRT1hD.js → stored-language-rjOMJkyX.js} +1 -1
- package/dist/{stx-player-CpzcZSMq.js → stx-player-CrirKEQm.js} +2 -2
- package/dist/{translator-BJPRdlc8.js → translator-BCSJSO1-.js} +1 -1
- package/dist/{use-heading-spy-xe2FFmGU.js → use-heading-spy-d50_nxgR.js} +1 -1
- package/dist/{use-material-translation-gr5V24w5.js → use-material-translation-C5zPFhbk.js} +3 -3
- package/docs/troubleshooting.md +6 -1
- package/lib/nuxt/module.ts +2 -5
- package/lib/nuxt/pdf-fonts.ts +3 -76
- package/package.json +2 -2
- package/dist/lib/components/ui/media/file-list/format-file-size.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./stored-language-
|
|
2
|
-
import { a as e } from "./i18n-provider-
|
|
3
|
-
import { i as t, r as n } from "./translator-
|
|
1
|
+
import "./stored-language-rjOMJkyX.js";
|
|
2
|
+
import { a as e } from "./i18n-provider-BqWxpaKu.js";
|
|
3
|
+
import { i as t, r as n } from "./translator-BCSJSO1-.js";
|
|
4
4
|
//#region lib/i18n/translate-material.ts
|
|
5
5
|
function r(e, r, i, a) {
|
|
6
6
|
if (e) for (let t of /* @__PURE__ */ new Set([e, e.split("-")[0]])) {
|
package/docs/troubleshooting.md
CHANGED
|
@@ -1082,8 +1082,13 @@ alone: add the `traceInclude` above yourself (as an `externals` object), or
|
|
|
1082
1082
|
inline the server and use `bundleStandardFonts`. A server built with
|
|
1083
1083
|
`noExternals` has no `node_modules` to trace into: use
|
|
1084
1084
|
`bundleStandardFonts` instead ([above](#cannot-find-module-standard-fontshelvetica)).
|
|
1085
|
+
The module resolves them with `pdfkitStandardFontFiles(rootDir, warn)` from
|
|
1086
|
+
`@nxgt/material-core/pdfkit-fonts` (Node-only); a Nitro config can call it
|
|
1087
|
+
too, with `@nxgt/material-core` installed as a direct dependency, in place
|
|
1088
|
+
of the snippet above.
|
|
1085
1089
|
When the module cannot resolve pdfkit's fonts although `@react-pdf/renderer`
|
|
1086
|
-
is installed, `nuxi build` prints
|
|
1090
|
+
is installed, `nuxi build` prints one `pdf fonts:` warning naming everything
|
|
1091
|
+
that failed.
|
|
1087
1092
|
|
|
1088
1093
|
### `still references '#standard-fonts/' after the transform`
|
|
1089
1094
|
|
package/lib/nuxt/module.ts
CHANGED
|
@@ -7,13 +7,10 @@ import {
|
|
|
7
7
|
extendViteConfig,
|
|
8
8
|
useLogger,
|
|
9
9
|
} from '@nuxt/kit';
|
|
10
|
+
import { pdfkitStandardFontFiles } from '@nxgt/material-core/pdfkit-fonts';
|
|
10
11
|
import { COMPOSABLE_IMPORTS, I18N_IMPORTS } from './auto-imports';
|
|
11
12
|
import { COMPONENT_NAMES } from './component-names';
|
|
12
|
-
import {
|
|
13
|
-
addPdfFontsPlugin,
|
|
14
|
-
addPdfFontsTrace,
|
|
15
|
-
pdfkitStandardFontFiles,
|
|
16
|
-
} from './pdf-fonts';
|
|
13
|
+
import { addPdfFontsPlugin, addPdfFontsTrace } from './pdf-fonts';
|
|
17
14
|
|
|
18
15
|
export type ModuleOptions = {
|
|
19
16
|
/** Prepended to auto-imported component names. Empty by default. */
|
package/lib/nuxt/pdf-fonts.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
1
|
import { pdfkitStandardFonts } from '../vite/index';
|
|
4
2
|
|
|
5
3
|
type NitroConfigLike = {
|
|
@@ -21,80 +19,6 @@ export function addPdfFontsPlugin(config: NitroConfigLike): void {
|
|
|
21
19
|
config.rollupConfig.plugins = [...plugins, pdfkitStandardFonts()];
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
/** The fourteen standard PDF fonts, as pdfkit exports them. */
|
|
25
|
-
export const PDFKIT_STANDARD_FONTS = [
|
|
26
|
-
'Courier',
|
|
27
|
-
'CourierBold',
|
|
28
|
-
'CourierBoldOblique',
|
|
29
|
-
'CourierOblique',
|
|
30
|
-
'Helvetica',
|
|
31
|
-
'HelveticaBold',
|
|
32
|
-
'HelveticaBoldOblique',
|
|
33
|
-
'HelveticaOblique',
|
|
34
|
-
'Symbol',
|
|
35
|
-
'TimesBold',
|
|
36
|
-
'TimesBoldItalic',
|
|
37
|
-
'TimesItalic',
|
|
38
|
-
'TimesRoman',
|
|
39
|
-
'ZapfDingbats',
|
|
40
|
-
] as const;
|
|
41
|
-
|
|
42
|
-
const isNotFound = (error: unknown) =>
|
|
43
|
-
(error as { code?: string } | null)?.code === 'MODULE_NOT_FOUND';
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* pdfkit's standard-font modules as the app at `rootDir` loads them: through
|
|
47
|
-
* pdfkit's own `standard-fonts/<Name>` exports under the `require` condition
|
|
48
|
-
* (the `.cjs` files its runtime `require('#standard-fonts/<Name>')` reads),
|
|
49
|
-
* for the pdfkit `@react-pdf/renderer` depends on and the one
|
|
50
|
-
* `@react-pdf/font` depends on, without duplicates.
|
|
51
|
-
*
|
|
52
|
-
* None, silently, when the app does not install `@react-pdf/renderer` (an
|
|
53
|
-
* optional peer). Any other failure is passed to `warn` — a font that
|
|
54
|
-
* cannot be resolved here is a PDF route that fails in production.
|
|
55
|
-
*/
|
|
56
|
-
export function pdfkitStandardFontFiles(
|
|
57
|
-
rootDir: string,
|
|
58
|
-
warn: (message: string) => void = () => {},
|
|
59
|
-
): string[] {
|
|
60
|
-
let renderer: string;
|
|
61
|
-
try {
|
|
62
|
-
renderer = createRequire(join(rootDir, 'package.json')).resolve(
|
|
63
|
-
'@react-pdf/renderer',
|
|
64
|
-
);
|
|
65
|
-
} catch (error) {
|
|
66
|
-
if (!isNotFound(error)) {
|
|
67
|
-
warn(`could not resolve @react-pdf/renderer: ${String(error)}`);
|
|
68
|
-
}
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
const fromRenderer = createRequire(renderer);
|
|
72
|
-
const owners: [string, ReturnType<typeof createRequire>][] = [
|
|
73
|
-
['@react-pdf/renderer', fromRenderer],
|
|
74
|
-
];
|
|
75
|
-
try {
|
|
76
|
-
owners.push([
|
|
77
|
-
'@react-pdf/font',
|
|
78
|
-
createRequire(fromRenderer.resolve('@react-pdf/font')),
|
|
79
|
-
]);
|
|
80
|
-
} catch (error) {
|
|
81
|
-
warn(`could not resolve @react-pdf/font: ${String(error)}`);
|
|
82
|
-
}
|
|
83
|
-
const files = new Set<string>();
|
|
84
|
-
for (const [owner, from] of owners) {
|
|
85
|
-
for (const font of PDFKIT_STANDARD_FONTS) {
|
|
86
|
-
try {
|
|
87
|
-
files.add(from.resolve(`pdfkit/standard-fonts/${font}`));
|
|
88
|
-
} catch (error) {
|
|
89
|
-
warn(
|
|
90
|
-
`could not resolve pdfkit's ${font} font for ${owner}: ${String(error)}`,
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return [...files];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
22
|
/**
|
|
99
23
|
* Adds pdfkit's standard fonts to what Nitro traces into
|
|
100
24
|
* `.output/server/node_modules`. pdfkit loads them with a runtime
|
|
@@ -102,6 +26,9 @@ export function pdfkitStandardFontFiles(
|
|
|
102
26
|
* tracer never sees: without this, a default Nuxt build copies pdfkit but not
|
|
103
27
|
* those files, and every PDF rendered on the server fails with
|
|
104
28
|
* `Cannot find module '…/pdfkit/js/standard-fonts/Helvetica.cjs'`.
|
|
29
|
+
* `fontFiles` comes from `pdfkitStandardFontFiles`
|
|
30
|
+
* (`@nxgt/material-core/pdfkit-fonts`, shared with `@nxgt/material`'s
|
|
31
|
+
* Next.js helper).
|
|
105
32
|
* Nothing changes for a server built with `noExternals`, which traces nothing,
|
|
106
33
|
* nor for an `externals` set to a boolean, which is left as it is.
|
|
107
34
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxgt/material-vue",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "stevegires@gmail.com"
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"docs:previews": "vitest run --project previews"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@nxgt/material-core": "^0.
|
|
121
|
+
"@nxgt/material-core": "^0.2.0",
|
|
122
122
|
"@floating-ui/dom": "^1.8.0",
|
|
123
123
|
"@fortawesome/fontawesome-common-types": "7.3.1",
|
|
124
124
|
"@lucide/vue": "^1.45.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function formatFileSize(bytes: number): string;
|