@nice2dev/ui-core 1.3.12 → 1.3.14

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/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # @nice2dev/ui-core — Changelog
2
2
 
3
+ ## 1.3.14
4
+
5
+ ### Patch Changes
6
+
7
+ - ff59527: Package builds (1.3.14, OmniVerk's list):
8
+
9
+ - **@nice2dev/ui ESM: a module per source file.**
10
+ - Until now `dist/index.mjs` was a single 2.6 MB module, so an app's bundler could not keep controls used only on a lazily loaded page out of the chunk every page loads. Now an app splits the library like its own code.
11
+ - Entry paths, the `exports` map, the CommonJS build and `style.css` (byte-identical) do not change.
12
+ - `country-flag-icons`, already a dependency, is no longer bundled.
13
+ - Note: an app rule that sends every `@nice2dev/ui/` module to one manual chunk undoes the split.
14
+ - **Only `style.css` ships:** the chunk CSS files it inlines are no longer published next to it, which halves the CSS in the package.
15
+ - **ui-audio workers:** their URLs are relative. They were addressed from the site root (`/assets/pitchWorker-….js`), where an app that installs the package has no such file. Test and benchmark declarations are no longer published.
16
+ - **ui-buildings:** no longer ships an import worker that nothing refers to.
17
+ - **Clean builds:** ui-core, ui-display and ui-tools empty `dist` before building, so stale hashed chunks cannot be packed.
18
+ - **Release pipeline:**
19
+ - The publish job takes the builds from a folder emptied after every job. Old builds' files had piled up in its previous folder and were published (e.g. @nice2dev/ui 1.3.10: 793 files instead of 337).
20
+ - It checks each package against the file list the build recorded before anything goes to npm.
21
+ - The contents audit also lists published files that no entry reaches.
22
+
23
+ - f840d64: Smaller items from OmniVerk's list (1.3.14):
24
+
25
+ - **NiceScheduler** names days and months through `Intl` in the provider's language. Before, it looked up keys that no dictionary had, so a Polish calendar showed "January" and "Mon". Its titles, agenda and tooltip dates also follow the provider's `lang` now, no longer the browser's language.
26
+ - **NiceTopNav**:
27
+ - The collapsed tools cluster shows a small swatch of the current theme and the language code next to its chevron, and its accessible name says both (`collapsedSummary`, default `true`, a node of your own or `false`).
28
+ - Once open, the cluster lets the language and theme pickers' lists hang below the bar instead of cutting them off.
29
+ - **NiceTopNav `hideOnScroll` and NiceAnchor** take a `scrollContainer`: the window (default), an element, `'nearest'` or a function. They then work where the content scrolls inside a shell. The helpers are new in @nice2dev/ui-core: `getScrollParent`, `resolveScrollContainer`, `scrollTopOf`, `scrollTopFor`.
30
+ - **First frame on narrow screens:** NiceNavShell and NiceTopNav read the screen width on their first render, so a phone no longer flashes the desktop sidebar on every mount. `useMediaQuery` also guards against a missing `matchMedia`.
31
+ - **Exported types:** `NiceTreeGridRowAction` and `NiceTreeGridCheckedSummaryInfo` are now exported.
32
+ - **Docs:** the admin and auth READMEs say to import their `style.css`. The ui README no longer links to the compatibility sheet removed in 1.2.0.
33
+
34
+ ## 1.3.13
35
+
36
+ No changes in this release.
37
+
3
38
  ## 1.3.12
4
39
 
5
40
  No changes in this release.
@@ -27,6 +27,10 @@ export interface UseBreakpointResult {
27
27
  isDesktop: boolean;
28
28
  }
29
29
  export declare function useBreakpoint(breakpoints?: NiceBreakpoints): UseBreakpointResult;
30
+ /**
31
+ * Whether `query` matches — already on the first render (the first frame of a phone layout is not
32
+ * a desktop one), then on every change. `false` on the server and where `matchMedia` is missing.
33
+ */
30
34
  export declare function useMediaQuery(query: string): boolean;
31
35
  /**
32
36
  * Define a value per breakpoint. Missing breakpoints inherit from the
@@ -0,0 +1,16 @@
1
+ /** The `scrollContainer` of a control: a window or element, `'nearest'`, or a function giving one. */
2
+ export type NiceScrollContainer = Window | HTMLElement | 'nearest' | (() => Window | HTMLElement | null | undefined);
3
+ /**
4
+ * The nearest ancestor of `el` that scrolls vertically (`overflow-y: auto | scroll | overlay`),
5
+ * else the window.
6
+ */
7
+ export declare function getScrollParent(el: Element | null | undefined): HTMLElement | Window;
8
+ /** The element or window a `scrollContainer` prop names for the element `self`; default the window. */
9
+ export declare function resolveScrollContainer(container: NiceScrollContainer | undefined, self: Element | null | undefined): HTMLElement | Window;
10
+ /** How far a container is scrolled down, in px. */
11
+ export declare function scrollTopOf(container: HTMLElement | Window): number;
12
+ /**
13
+ * The scroll position that brings `target` to the top of `container`, less `offset` px — for
14
+ * `container.scrollTo({ top })`.
15
+ */
16
+ export declare function scrollTopFor(container: HTMLElement | Window, target: Element, offset?: number): number;