@nxgt/material-core 0.3.1 → 0.3.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/package.json +2 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,139 @@
1
+ # @nxgt/material-core
2
+
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#429](https://github.com/softistx/nxgt-material/pull/429) [`13c3eda`](https://github.com/softistx/nxgt-material/commit/13c3edad01f08656ca196aca7c37a21e8c003466) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The package ships its `CHANGELOG.md` (now in `files`), so the notes of every
8
+ version are in `node_modules/<package>/CHANGELOG.md` next to the docs, for
9
+ reading offline and for the upgrade agents of the Claude Code plugins.
10
+ The getting-started pages of `@nxgt/material` and `@nxgt/material-vue`
11
+ list it among the tarball's contents.
12
+
13
+ ## 0.3.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [#427](https://github.com/softistx/nxgt-material/pull/427) [`d4e953f`](https://github.com/softistx/nxgt-material/commit/d4e953fd4fc147b366c5d9d70ebfb1aa3a3c0ba7) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Docs: the roadmap lists what 0.3.0 shipped (`/date-range`, `/file-preview`, `/slider-ticks`) under Shipped, newest first. Troubleshooting has entries for `FilePreviewHttpError` (`Could not read <url>: HTTP <status>`) and `FilePreviewUnsafeUrlError` (`Refused to preview a URL with an unsafe scheme`), so every message the package prints is there again. The README's `/pdf-viewer` section documents `pinToPage`'s `onRelease` and `pinHolds`, with an example.
18
+
19
+ ## 0.3.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#424](https://github.com/softistx/nxgt-material/pull/424) [`d90a68b`](https://github.com/softistx/nxgt-material/commit/d90a68b8f16759b44929effc426b6c3964e92a4c) Thanks [@SteveGT96](https://github.com/SteveGT96)! - New subpath `/date-range`, the pure half of both libraries' `DateRangeField`
24
+ presets and times: `DATE_RANGE_PRESET_IDS` (`today`, `yesterday`,
25
+ `last-7-days`, `last-30-days`, `this-month`, `last-month`, `this-year`),
26
+ `presetRange(id, now?)`, `resolvePresetRange(preset, now?, { withTime })`,
27
+ `isSameDayRange`, `isRangeDisabled(range, { min, max, isDayDisabled })`
28
+ (also true for a range whose end comes before its start),
29
+ `withTimeOf`, `endOfDayTime`, `clampRangeEnd`, `keepRangeTimes` (a new end
30
+ at 23:59), and the types
31
+ `DayRange`, `PartialDayRange`, `DateRangePreset`, `DateRangePresetId`,
32
+ `DateRangePresetOption` and `DateRangeRules`.
33
+
34
+ - [#426](https://github.com/softistx/nxgt-material/pull/426) [`812c101`](https://github.com/softistx/nxgt-material/commit/812c10115278480852852084ddf06b016239e6d4) Thanks [@SteveGT96](https://github.com/SteveGT96)! - New subpath `/file-preview`, the pure half of both libraries' `FilePreview`:
35
+ `fileKind({ type, name, url })` picks a `FileKind` (`image`, `pdf`, `video`,
36
+ `audio`, `text`, `json`, `csv`, `markdown` or `other`) from the MIME type
37
+ when it names one (a `data:` URL's included), else from the extension of the
38
+ name, then of the URL; `describeFile(file, { type, name })` does it for a
39
+ `File` / `Blob` or a URL and returns its name, type and size;
40
+ `safePreviewUrl(url)` returns the URL when it may reach an `href` or a `src`
41
+ (`http(s):`, relative, `blob:`, or a `data:` URL of an image, video, audio
42
+ file, plain text, CSV, Markdown, JSON or PDF) and `null` for anything else
43
+ (`javascript:`, `data:text/html`, and also a `data:` URL of XML, TSV or
44
+ YAML), with `FilePreviewUnsafeUrlError` ("Refused to preview a URL with an unsafe scheme") for the one refused;
45
+ `readTextPreview(source, { maxBytes, signal })` reads the first `maxBytes`
46
+ (`TEXT_PREVIEW_MAX_BYTES`, 256 KB, by default) of a `Blob` or of what a URL
47
+ answers, decoded with the `charset` of the `Content-Type` (or of the `Blob`'s
48
+ `type`) when `TextDecoder` supports it and as UTF-8 otherwise, stopping the
49
+ download past the cap; it throws `FilePreviewHttpError` (with its `status`)
50
+ on an HTTP error, and rejects with the signal's reason once aborted, for a
51
+ `Blob` too. Also
52
+ `fileExtension`, `fileNameFromUrl`, `dataUrlType`, `kindOfMimeType`,
53
+ `normaliseMimeType`, `isTextFileKind`, `TEXT_FILE_KINDS` and the types
54
+ `FileKind`, `FileKindInput`, `DescribedFile`, `FilePreviewSource` and
55
+ `TextPreview`. Nothing runs at import.
56
+
57
+ - [#420](https://github.com/softistx/nxgt-material/pull/420) [`f4ca69b`](https://github.com/softistx/nxgt-material/commit/f4ca69ba5dd7b80f92cdd5374cf6fd01f155784d) Thanks [@SteveGT96](https://github.com/SteveGT96)! - New subpath `/slider-ticks`: `tickValues(min, max, ticks, step?)`, the values a slider's tick marks sit at. Both libraries' `SliderField` (`ticks`) now read it from here instead of keeping a copy each.
58
+
59
+ ### Patch Changes
60
+
61
+ - [#419](https://github.com/softistx/nxgt-material/pull/419) [`99878c9`](https://github.com/softistx/nxgt-material/commit/99878c9bdb0d4c33fd6a777970c4f3735bd5ef3b) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `PdfReader`: opening on an `initialPage` no longer reports another page on a
62
+ slow device. The placement scroll could land after the scroll spy's hold had
63
+ run out, and near the end of the document it read as the last page. While
64
+ the view stays where the opening page's pin put it (that page at the top,
65
+ or the page area at its end with that page not above the top), a scroll is the reader's own and is not
66
+ reported; a scroll that moves the view elsewhere — the user's, find in page,
67
+ a screen reader's cursor — lets go of the pin and is reported. A wheel,
68
+ touch, pointer or key in the page area also ends the hold on the reader's
69
+ own scroll, so the scrolling after it is reported at once. In
70
+ `@nxgt/material-core/pdf-viewer`, `pinToPage` takes an optional `onRelease`,
71
+ called once when the pin lets go, and `pinHolds(node)` tells whether the view
72
+ is still where the pin puts it.
73
+
74
+ ## 0.2.0
75
+
76
+ ### Minor Changes
77
+
78
+ - [#406](https://github.com/softistx/nxgt-material/pull/406) [`b890457`](https://github.com/softistx/nxgt-material/commit/b8904573f18dc6d0cdd16f62146183ff0b7aef18) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Two new subpaths, each the one copy of code `@nxgt/material` and
79
+ `@nxgt/material-vue` used to keep twice:
80
+
81
+ - **`@nxgt/material-core/format-file-size`**: `formatFileSize(bytes)`, the
82
+ byte count both libraries' `FileList`, `NetworkUploadField`, `FileCard` and
83
+ chat attachments show (`'1.5 KB'`; `''` for a negative, `NaN` or infinite
84
+ size).
85
+ - **`@nxgt/material-core/pdfkit-fonts`** (Node only): `pdfkitStandardFontDirs`,
86
+ `pdfkitStandardFontFiles` and `PDFKIT_STANDARD_FONTS` find the real files of
87
+ pdfkit's standard fonts as an app loads them, through `@react-pdf/renderer`
88
+ and `@react-pdf/font`, for a server tracer (`@nxgt/material/next`, the Nuxt
89
+ module of `@nxgt/material-vue`). Without `@react-pdf/renderer` they return
90
+ `[]` silently; any other failure reaches your `warn` callback once per
91
+ call. It is the only subpath that imports `node:` built-ins: never import it
92
+ from browser code.
93
+
94
+ ```ts
95
+ import { formatFileSize } from '@nxgt/material-core/format-file-size';
96
+ import { pdfkitStandardFontDirs } from '@nxgt/material-core/pdfkit-fonts';
97
+
98
+ formatFileSize(1536); // '1.5 KB'
99
+ pdfkitStandardFontDirs(process.cwd(), console.warn); // ['/app/node_modules/pdfkit/js/standard-fonts']
100
+ ```
101
+
102
+ ### Patch Changes
103
+
104
+ - [#407](https://github.com/softistx/nxgt-material/pull/407) [`bf43a14`](https://github.com/softistx/nxgt-material/commit/bf43a14abb147e6dcd2bcac5f1e0e359b0aae6a2) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `pdfkitStandardFontDirs` and `pdfkitStandardFontFiles` (`/pdfkit-fonts`) keep
105
+ only the first line of each error in the one warning they give. Node's
106
+ `Cannot find module` error carries a multi-line `Require stack:`, and joined
107
+ whole into the `; `-separated message it made one warning dozens of lines
108
+ long; it now reads `could not resolve @react-pdf/font: Error: Cannot find
109
+ module '@react-pdf/font'; could not resolve pdfkit's fonts for …`.
110
+
111
+ ## 0.1.1
112
+
113
+ ### Patch Changes
114
+
115
+ - [#399](https://github.com/softistx/nxgt-material/pull/399) [`1abb908`](https://github.com/softistx/nxgt-material/commit/1abb90800ec213d8ec98abd7df5dda9f65c14204) Thanks [@SteveGT96](https://github.com/SteveGT96)! - The package manifest no longer carries a `repository` field. The source
116
+ repository is private, so the link npm showed for it led to a 404; the
117
+ README and the `docs/` shipped in the tarball remain the public reference.
118
+
119
+ - [#398](https://github.com/softistx/nxgt-material/pull/398) [`b4e5770`](https://github.com/softistx/nxgt-material/commit/b4e5770922ad4582a1ad2dcca439f7c8c999a0c7) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Docs: the roadmap's Shipped list now has 0.1.0 — the first release, holding the framework-free code `@nxgt/material` and `@nxgt/material-vue` share.
120
+
121
+ ## 0.1.0
122
+
123
+ ### Minor Changes
124
+
125
+ - [#391](https://github.com/softistx/nxgt-material/pull/391) [`deaf0c4`](https://github.com/softistx/nxgt-material/commit/deaf0c49cbc2268fd20e9e2272104dbd27e4ce7f) Thanks [@SteveGT96](https://github.com/SteveGT96)! - First release of `@nxgt/material-core`: the framework-free core that
126
+ `@nxgt/material` (React) and `@nxgt/material-vue` (Vue) share, as one copy.
127
+ The PDF document model (`/pdf/model`) and its react-pdf renderer
128
+ (`/pdf/render`, both also from `/pdf`), the print formatters (`/print-format`, `/print-value`,
129
+ `/print-table`, `/print-fraction-digits`), the PDF file helpers
130
+ (`/pdf-source`, `/pdf-file-name`, `/pdf-download`), serving a PDF
131
+ (`/pdf/http`, `/pdf/file-loader`), the PDF viewer's framework-free modules
132
+ (`/pdf-viewer`: page geometry, page sizes, scroll spy, text search), the
133
+ currency field's decimals (`/currency-digits`), the fields' blur layers
134
+ (`/field-blur-layers`) and the pdfkit fonts plugin (`/vite`).
135
+ `react` and `@react-pdf/renderer` are optional peers, needed only to render;
136
+ `vite` (6, 7 or 8) is one too, for the types of `/vite`.
137
+ Most apps get it through `@nxgt/material` or `@nxgt/material-vue`; a server
138
+ bundle that inlines either library (`ssr.noExternal`) must list
139
+ `@nxgt/material-core` beside it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material-core",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "The framework-free core of @nxgt/material and @nxgt/material-vue: the PDF document model and its react-pdf renderer, print formatters, PDF file helpers, the PDF viewer's pure modules, the currency digits, the file-size formatter, the field-blur layers, the date range presets, the file preview's kind detection and text reader, the pdfkit fonts Vite plugin and the Node-only pdfkit fonts resolution for Next.js and Nuxt builds",
5
5
  "license": "MIT",
6
6
  "bugs": {
@@ -13,6 +13,7 @@
13
13
  "dist",
14
14
  "docs",
15
15
  "README.md",
16
+ "CHANGELOG.md",
16
17
  "package.json",
17
18
  "LICENSE"
18
19
  ],