@nice2dev/ui-core 1.2.0 → 1.2.1

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,108 @@
1
1
  # @nice2dev/ui-core — Changelog
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8c82c30: 1.2.1 — the decisions that waited since 1.2.0, and the debts the CI gates were holding. One API
8
+ change, agreed: `NiceIconSuggestorAI` suggests Nice icons only. Two stylesheets to import if you use
9
+ the packages: `@nice2dev/social/style.css`, `@nice2dev/ui-science/style.css`. Upgrade notes:
10
+ `documentation/omniverk/OMNIVERK_UPGRADE_1.2.1.md`.
11
+
12
+ **Tree-shaking.** An import from a package no longer brings the whole package. Module-level
13
+ statements that may have a side effect — a `displayName` assigned after each component (now
14
+ `Object.assign` inside `/* @__PURE__ */`, or under a development check for plain functions),
15
+ unannotated `forwardRef` / `memo` / `createContext` / icon-factory calls, spreads, registries filled
16
+ at import, `<style>` tags injected at import, a direct `eval` in ui-math — are gone. One import from
17
+ each of 53 packages: 5066.5 kB → 1171.6 kB (`@nice2dev/ui` 1928.2 kB → 12.9 kB, icon packs 48–275 kB
18
+ → 1.6–2.6 kB). `defaultViewRegistry` has the Nice\* input controls from the start, each loading its
19
+ module on first render; sixteen controls add their styles to `<head>` on first render.
20
+
21
+ **Dead code.** 405 source files no entry point imported (never on npm) are deleted;
22
+ `NiceClipboardStack` (`@nice2dev/ui`) and `NiceSampleBrowser` (`@nice2dev/ui-audio`), finished and
23
+ documented, are exported.
24
+
25
+ **ui-mobile draws Nice icons.** New peer `@nice2dev/icons ^1.2.0`; `TabIcons`, `DrawerIcons`,
26
+ `HeaderIcons`, the `NiceSwipeActions` presets and the `NiceInfiniteScroll` states are `Ntd*` icons
27
+ instead of pasted `<svg>`, simple glyphs are CSS marks. `@nice2dev/icons` adds `NtdReply` and
28
+ `NtdInbox`; an icon no longer throws without `window.matchMedia`.
29
+
30
+ **`NiceIconSuggestorAI` (breaking, agreed).** `AIIconLibrary` is `'nice'`; `svgPath` and `unicode`
31
+ left `AISuggestedIcon`; the preview is a `<NiceIcon>`, "Copy SVG" is "Copy JSX".
32
+
33
+ **Peer ranges.** Every internal `@nice2dev/*` peer is `^1.2.0` (was as wide as `^1.0.20`), except
34
+ `@nice2dev/icons ^1.2.1` where a package draws an icon new in 1.2.1: ui-mobile (`NtdReply`,
35
+ `NtdInbox`), ui-audio (`NtdMicrophoneOff`) and ui-security (`NtdBackspace`). ui-security, licensing
36
+ (`^1.2.0`) and templates (`^1.2.0`) gain the `@nice2dev/icons` peer: their glyph icons (`⌫`, `←`,
37
+ `→`, `↑`, `↓`) are Nice icons now. `@nice2dev/icons` adds `NtdBackspace`.
38
+
39
+ **Class names inside components.** 834 class names in library stylesheets had no `nice-` prefix
40
+ (`.tab-button`, `.status-badge`, `.selected`, …) and styled every element of that name on the page.
41
+ They follow `nice-{block}__{element}--{modifier}` now — no change on screen. The class theme hooks
42
+ next to `[data-theme]` on seven controls (`dark` on the AI chart / data grid / code and HTML
43
+ editors / form builder, `light-theme` on `NiceMAM` and `NiceVideoAnnotator`) are `nice-dark` /
44
+ `nice-light`; `NiceLowPowerMode` marks `<html>` with `nice-lpm-no-animations` /
45
+ `nice-lpm-reduced-quality`; the `NiceVideoEditor` of `@nice2dev/ui-video` styles its elements under
46
+ `nice-video-studio`, so they no longer collide with the `NiceVideoEditor` of `@nice2dev/ui`.
47
+ Rules for classes nothing rendered are gone, among them the stylesheet of `NiceGanttChart`, which
48
+ left ui-erp in 1.0.10.
49
+
50
+ **Translations.** About 3,400 UI texts in 32 packages were hard-coded; they go through `t()` now,
51
+ with the English text unchanged and pl / de / fr / es / uk in `@nice2dev/i18n` (ui-diagrams,
52
+ ui-presentations and ui-math in their own dictionaries). In `@nice2dev/events` and
53
+ `@nice2dev/admin` that includes column headers, option labels and the statuses and roles they used
54
+ to print raw (`checked-in`, `no-show`) — English labels for those come from the dictionary. ui-3d and ui-graphics read the app's
55
+ global translator, as ui-audio does since 1.2.0 — their own provider overrides it. ui-audio's
56
+ controls used 631 keys the dictionary did not have (English in every language), and the radio
57
+ player showed raw keys (`search_stations`). Texts that were hard-coded **in Polish** — in
58
+ `NiceSidebarNav`, `NiceNetworkDiscoveryPanel`, the backup and smart-home controls,
59
+ `NiceSavedQueryPanel`, `NiceNotificationPreferences`, the ui-buildings panels, the ui-printing
60
+ template editor and the photo editor — default to English now; Polish is in the dictionary. English
61
+ plurals glued on (`result{s}`) are two keys. `presentationsTranslator(lang)` (ui-presentations)
62
+ translates outside its provider.
63
+
64
+ **List props are optional.** 170 list props (`items`, `columns`, `data`, …) in 15 packages that
65
+ were required without a default are optional, with a stable empty default; every one of those
66
+ controls mounts without data (tested). `NiceStockChart` without data no longer computes NaN
67
+ coordinates.
68
+
69
+ **Unstyled components get stylesheets.** 98 components rendered class names no stylesheet had —
70
+ admin panels, auth forms, events rounds and pickers, the ERP invoice / purchase order / VAT table /
71
+ HR dashboard, the radio player, `NiceInbox`, PWA prompts, `NiceViewRenderer`, shells, smart-home,
72
+ … The fixed layout that sat in inline style objects is in classes now, so an app can override it;
73
+ values that depend on data stay inline. **`@nice2dev/social` and `@nice2dev/ui-science` ship a
74
+ stylesheet — import `@nice2dev/social/style.css` / `@nice2dev/ui-science/style.css`.** ui-science's
75
+ `sideEffects` is `["*.css"]`. Colours, spacing and radii in every stylesheet come from theme tokens
76
+ (visible in dark themes: `NiceRecipe` difficulty badges, transcoder states, warehouse heat map).
77
+
78
+ **Icons only from Nice.** About 130 glyphs (`×`, `→`, `↑`) and 100 pasted `<svg>` used as icons
79
+ are Nice icons; 11 `<svg>` stay as the control's own graphic (logos, spinners, checkbox mark). `NiceIcon`
80
+ gains `pin`, `mic-off`, `log-out`, `chevrons-left`, `chevrons-right`, `zoom-in`, `zoom-out`,
81
+ `navigation`, `refresh-ccw`, `minimize` and `smartphone`; `@nice2dev/icons` gains
82
+ `NtdMicrophoneOff`. The `icon` fields of the module, menu, tab, mode, quick-action, scene and admin
83
+ widget DTOs, notification channels and view toolbar items are rendered through `NiceIcon` — they
84
+ used to be printed as text. `NiceRatings` `thumbs` draws shapes instead of emoji.
85
+
86
+ **Dialogs instead of `window.prompt` / `confirm` / `alert`.** New `useNiceDialogs()` — `prompt`,
87
+ `confirm` and `alert` as promises on `NicePromptDialog` / `NiceConfirmDialog` — and
88
+ `NiceConfirmDialog.showReject`. Seventeen controls asked through the browser's blocking dialogs and
89
+ use the library's now (`NiceFileManager`, `NiceHtmlEditor`, `NiceViewRenderer` action `confirm`, the 3D,
90
+ vector and pixel editors, …). Keys pressed in `NicePromptDialog` / `NiceConfirmDialog` no longer
91
+ reach the page's shortcuts (Escape still closes them), and `NicePromptDialog`'s backdrop covers the
92
+ whole viewport.
93
+
94
+ **Smaller fixes.** `NiceFileManager.items` is optional. `NiceMLStudio` status badges: `draft`,
95
+ `registered`, `archived`, `cancelled` get a neutral colour, deploying / stopped deployments theirs.
96
+ Component docs (`doc.json`) list only props the components have. `NiceMobileTabs`: tabs beyond
97
+ `maxTabs` open from "More" (it only logged). `NiceInventoryManager`: new `onCreatePurchaseOrder`;
98
+ without it the "Create PO" button is gone (it only logged). Keyboard: `NiceNavShell` tabs follow the
99
+ WAI-ARIA tabs pattern, clickable `NiceDeviceTile` / `NiceCardGroup` cards and animated icons with
100
+ `trigger="click"` are focusable. ui-math: `CalculatorService.evaluate` parses instead of running
101
+ `new Function` (`asin`, `sinh`, `ceil`, exponents and `angleUnit` were wrong); `ExpressionParser`
102
+ takes `functions`, `constants`, `ignoreCase` and `strict`, multiplies implicitly (`2x`) and reads `^`
103
+ right to left. `InvoiceLine.vatRate` and `VatRate.rate` are documented as fractions (0.23).
104
+ `AmqpServerBinding` is `Record<string, never>`.
105
+
3
106
  ## 1.2.0
4
107
 
5
108
  ### Minor Changes
@@ -231,7 +231,7 @@ export declare function formatShortcut(shortcut: KeyboardShortcut): string;
231
231
  export declare function matchesShortcut(e: React.KeyboardEvent | KeyboardEvent, shortcut: KeyboardShortcut): boolean;
232
232
  export interface NiceKeyboardHintProps {
233
233
  /** Array of keyboard shortcuts to display */
234
- shortcuts: KeyboardShortcut[];
234
+ shortcuts?: KeyboardShortcut[];
235
235
  /** Position of the tooltip */
236
236
  position?: 'top' | 'bottom' | 'left' | 'right';
237
237
  /** Custom trigger icon (default: ?) */
@@ -10,8 +10,11 @@ import React from 'react';
10
10
  * `clip-path`. Three implementations of one open ring is exactly the drift B6 named.
11
11
  *
12
12
  * This module is that one implementation. Packages that depend on `@nice2dev/ui-core`
13
- * import it from here; the dependency-free ones carry a GENERATED copy, kept identical by
13
+ * import it from here; the others carry a GENERATED copy, kept identical by
14
14
  * `scripts/audit-marks-sync.mjs` (gate `P1.8 marks-sync`, regenerate with `--write`).
15
+ * ui-mobile has depended on `@nice2dev/icons` since 1.2.1 (TODO_1.2.1 A3) and draws its icon
16
+ * sets with `Ntd*`; it keeps the marks for the simple affordances (chevrons, close, tick,
17
+ * spinner ring), from a copy — it still does not depend on ui-core.
15
18
  *
16
19
  * Units are `em` throughout, so a mark scales with the control it sits in — the `px`
17
20
  * version did not. Colour is always `currentColor`, which keeps a mark on the foreground
@@ -30,9 +33,9 @@ export interface NiceMarkProps {
30
33
  export declare const CheckMark: React.FC<NiceMarkProps>;
31
34
  /** Open ring, read as "reload"; the button it sits in carries the accessible name. */
32
35
  export declare const RefreshMark: React.FC<NiceMarkProps>;
33
- /** Chevron for expand / collapse affordances. */
36
+ /** Chevron for expand / collapse affordances, and back / previous / next. */
34
37
  export declare const ChevronMark: React.FC<NiceMarkProps & {
35
- direction: 'up' | 'down';
38
+ direction: 'up' | 'down' | 'left' | 'right';
36
39
  }>;
37
40
  /** Filled dot, for status and presence indicators. */
38
41
  export declare const DotMark: React.FC<NiceMarkProps>;
@@ -2,6 +2,7 @@
2
2
  export interface NiceModeInfo {
3
3
  key: string;
4
4
  displayName: string;
5
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
5
6
  icon?: string;
6
7
  color?: string;
7
8
  sourcePackage?: string;
@@ -12,6 +13,7 @@ export interface NiceModuleMenuDto {
12
13
  id: string;
13
14
  name: string;
14
15
  label: string;
16
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
15
17
  icon?: string;
16
18
  order: number;
17
19
  isAvailable: boolean;
@@ -23,6 +25,7 @@ export interface NiceEntityMenuDto {
23
25
  id: string;
24
26
  name: string;
25
27
  label: string;
28
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
26
29
  icon?: string;
27
30
  listViewId?: string;
28
31
  formViewId?: string;
@@ -37,6 +40,7 @@ export interface NiceUserMenuResponse {
37
40
  export interface NiceQuickAction {
38
41
  id: string;
39
42
  label: string;
43
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
40
44
  icon?: string;
41
45
  route: string;
42
46
  shortcut?: string;
@@ -44,6 +48,7 @@ export interface NiceQuickAction {
44
48
  export interface NiceFavoriteItem {
45
49
  id: string;
46
50
  label: string;
51
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
47
52
  icon?: string;
48
53
  route: string;
49
54
  entityId?: string;
@@ -54,6 +59,7 @@ export interface NiceTabDescriptor {
54
59
  id: string;
55
60
  route: string;
56
61
  title: string;
62
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
57
63
  icon?: string;
58
64
  entityId?: string;
59
65
  isDirty?: boolean;
@@ -131,6 +137,7 @@ export interface NiceModuleInfo {
131
137
  label: string;
132
138
  description: string;
133
139
  version: string;
140
+ /** NiceIcon name, e.g. 'folder' (until 1.2.1 the components printed it as text). */
134
141
  icon?: string;
135
142
  status: NiceModuleStatus;
136
143
  author?: string;