@nice2dev/ui-presentations 1.1.10 → 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,178 @@
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
+
106
+ ## 1.2.0
107
+
108
+ ### Minor Changes
109
+
110
+ - 3a4939d: 1.2.0 — the API cleanup announced for this version, dictionaries per language by default, and
111
+ three new controls. **Breaking:** every removal has a replacement, listed name by name in
112
+ `documentation/omniverk/OMNIVERK_UPGRADE_1.2.0.md`.
113
+
114
+ **Removed (breaking).** All 118 `@deprecated` names: the aliases without the `Nice` prefix in
115
+ `ui-audio`, `ui-graphics` and `ui-3d`; `NiceBarcodeGenerator` (→ `NiceBarcode`), `NiceFloorPlanCanvas`
116
+ (→ `NiceSpatialEditor` in `@nice2dev/ui-buildings`), the v2 props and types of `NiceTopNav`,
117
+ `NiceProgress.showLabel`, `NiceCountryPicker.showDialCode` / `showFlag`, `type` on
118
+ `NiceDateTimePicker` / `NiceDateRangeBox` (→ `dateFormatPreset`); `ZoneOccupancy` in
119
+ `ui-buildings` and `events`, the `SmartHome*` types; the icon variant `flat` (→ `cutout`) and
120
+ `NiceIconEditor` (→ `NiceVectorEditor`); `NiceSizeLegacy`; the `snapGrid` module of `ui-diagrams` (→
121
+ `@nice2dev/spatial-core`); the opt-in stylesheet `@nice2dev/ui/css/legacy-bg-text-aliases.css`, which
122
+ formed an alias cycle with `style.css`. Props that were accepted and never read — 19 on
123
+ `NiceModuleGrid`, and more on `NiceAutocomplete`, `NiceTaskInbox`, `NiceConsentBanner`, the
124
+ building and communication controls, four `ui-audio` panels and `NiceStreamDashboard` — are gone
125
+ from the types. `NiceResourceAllocation` in `ui-erp` is `NiceCapacityPlanner` (the one in `ui`
126
+ keeps its name); `NiceGenericPlayerStageVisualizer` (→ `NiceStageVisualizer`) and
127
+ `NiceCubeBrowserProps` are removed. The `@nice2dev/ui/overlays` entry calls its modal, drawer,
128
+ bottom sheet and context menu `NiceOverlayModal`, `NiceOverlayDrawer`, `NiceOverlayBottomSheet` and
129
+ `NiceOverlayContextMenu`: the old names belonged to different components of `@nice2dev/ui`.
130
+
131
+ **Dictionaries per language.** `NiceI18nProvider` loads only the language in use, with `import()`
132
+ (it was `NiceI18nLazyProvider` in 1.1.10, which stays as the same component); the controls show their
133
+ built-in English until it arrives — `await loadNiceDictionary(lang)` before the first render to start
134
+ in the language. Nothing on the main entry of `@nice2dev/i18n` imports a dictionary any more:
135
+ `NICE_I18N_DICTIONARIES`, `createTranslator`, `NICE_I18N_VARIANTS` / `resolvePlVariant` and the
136
+ translation tooling moved to the new entry `@nice2dev/i18n/all`, and `@nice2dev/ui-core` no longer
137
+ re-exports the dictionary map. `@nice2dev/ui` with what it bundles: 1283 kB → 952 kB gzip loaded up
138
+ front. The `ui-audio` controls read the app's `NiceI18nProvider` now; their own provider overrides it.
139
+
140
+ **New controls.** `NiceRecurrenceEditor`, `NiceStopwatch`, `NiceCountdownTimer` (`@nice2dev/ui`) and
141
+ `NicePasswordGenerator` (`@nice2dev/auth`), plus `recurrenceDates()` and `generatePassword()`.
142
+ `NiceScheduler` honours a weekly rule's `byDay`, which it ignored.
143
+
144
+ **Visible changes.** The palette meets WCAG AA for text on every fill: darker fills in the light
145
+ theme, dark text on the fills of the dark theme (new `--nice-text-on-success` / `-error` / `-info` /
146
+ `-accent` / `-warning`; `NiceThemeText` takes `onSuccess`, `onError`, `onInfo`, `onWarning`). Mobile
147
+ and platform panels follow the app theme instead of `prefers-color-scheme`. Swipes in
148
+ `NiceSwipeActions`, `NiceTouchTable` and `NiceMobileCalendar` work with a mouse and a pen. The
149
+ `ui-forms` editors have the intended spacing (it was four times too large). `NiceMAM`,
150
+ `NiceTranscoder`, `NiceVideoAnnotator` and `NiceStreamDashboard` use `nice-`-prefixed BEM classes.
151
+
152
+ **Fixes.** Controls that invented results ask the host instead: `NiceIntegrationHub`,
153
+ `NiceMLStudio` (`onExperimentRun` may return metrics), `NiceRemoteManagement`
154
+ (`onCaptureScreenshot`), `NicePoseDetector` (`detector`), `NiceBatchScannerProvider`,
155
+ `NiceCacheStrategies`; `NiceLowCodeStudio` accepts dropped components. Controls that did nothing
156
+ work or say why they are off: `NiceStreamDashboard` adds sources, sends chat and runs the chosen
157
+ transition (new `onAddPlatform`, `onSendChatMessage`, `onTransition`, `onScreenshot`,
158
+ `onOpenAudioMixer`, `onOpenSettings`; `receiveChatMessage` feeds incoming chat), `NiceMLStudio`
159
+ downloads through `onModelDownload`, `NiceETLBuilder` saves through `onSave` (its Save button had
160
+ no handler), `NiceTranscoder` makes jobs of picked and dropped files, `NiceAutomationEditor` offers
161
+ the trigger types its model has. Texts of about fifty components go
162
+ through `t()` in six languages, among them the AI data grid, chart and form builders, the ML
163
+ studio, the report designer, the song picker, `NiceProtocolConfig`, `NiceETLBuilder` and
164
+ `NiceInlineHelp` — every key the controls pass to `t()` now has a dictionary entry, so none of
165
+ them stays English under another language; `NiceDataGridAI` sorts on a query in any language, not
166
+ only in English. `NiceWindow`, `NiceConsole`, `NiceFileManager` and `NiceGitManager` no longer
167
+ crash when `accessMode` switches to or from `'hidden'`. Ids come from `createId()` (`@nice2dev/ui-core`), so nothing throws
168
+ outside a secure context as `crypto.randomUUID()` did on plain http. `ui-3d` runs on three r183
169
+ without its deprecation warnings. `NiceRemoteManagement` calls the handlers of the latest render.
170
+ The AI hint popover and the `ui-platform` panels follow the app theme, not the system's or a
171
+ `.dark` class on the host. `NiceCommandPalette` has styles and its search filters;
172
+ `NiceTimeoutFeedback` starts its clock; `NiceOfflineBanner` takes `online`; Monaco's workers in
173
+ `NiceCodeEditor` load; the `ui-audio` panels that used Bootstrap classes use Nice controls; colours
174
+ that reached a canvas as `var(…)` (karaoke lanes and notes) are resolved first.
175
+
3
176
  ## 1.1.10
4
177
 
5
178
  ### Patch Changes
package/README.md CHANGED
@@ -67,12 +67,6 @@ This package ships unstyled component logic. Import the shared CSS bundle once a
67
67
  import '@nice2dev/ui/style.css';
68
68
  ```
69
69
 
70
- Optional: opt into the legacy shorthand token aliases (`--bg-*`, `--text-*`, `--border-*`, ...) when migrating from a custom design-token system:
71
-
72
- ```tsx
73
- import '@nice2dev/ui/css/legacy-bg-text-aliases.css';
74
- ```
75
-
76
70
  ## License
77
71
 
78
72
  MIT © NiceToDev
@@ -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
  /**