@nice2dev/ui-presentations 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-presentations — 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
@@ -10,6 +10,11 @@ export interface NiceI18nProviderProps {
10
10
  lang?: NicePresentationsLang;
11
11
  children: ReactNode;
12
12
  }
13
+ /**
14
+ * The translator for one language — the provider's, and NicePresentationEditor's own: it renders
15
+ * the provider for its `lang`, so a hook in it would read the context above.
16
+ */
17
+ export declare function presentationsTranslator(lang: NicePresentationsLang): NiceTranslateFn;
13
18
  export declare const NiceI18nProvider: React.FC<NiceI18nProviderProps>;
14
19
  export declare function useNiceTranslation(): NiceTranslateFn;
15
20
  /**