@nice2dev/ui-core 1.1.7 → 1.1.10

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 (72) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/dist/core/cssColor.d.ts +12 -0
  3. package/dist/core/hooks.d.ts +3 -2
  4. package/dist/core/i18n.d.ts +2 -0
  5. package/dist/core/marks.d.ts +40 -0
  6. package/dist/core/theme.d.ts +1 -1
  7. package/dist/core/traceless.d.ts +1 -0
  8. package/dist/index.cjs +26 -26
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.mjs +8072 -7836
  11. package/package.json +3 -3
  12. package/dist/core/NiceFieldStatus.d.ts.map +0 -1
  13. package/dist/core/NiceInlineHelp.d.ts.map +0 -1
  14. package/dist/core/NiceThemeProvider.d.ts.map +0 -1
  15. package/dist/core/NiceThemeVariants.d.ts.map +0 -1
  16. package/dist/core/NiceUserPreferences.d.ts.map +0 -1
  17. package/dist/core/a11y-advanced.d.ts.map +0 -1
  18. package/dist/core/a11y.d.ts.map +0 -1
  19. package/dist/core/access-control.d.ts.map +0 -1
  20. package/dist/core/adapters.d.ts.map +0 -1
  21. package/dist/core/ai.d.ts.map +0 -1
  22. package/dist/core/animations.d.ts.map +0 -1
  23. package/dist/core/colorBlind.d.ts.map +0 -1
  24. package/dist/core/datasource-advanced.d.ts.map +0 -1
  25. package/dist/core/datasource-aggregation.d.ts.map +0 -1
  26. package/dist/core/datasource-hooks.d.ts.map +0 -1
  27. package/dist/core/datasource-offline.d.ts.map +0 -1
  28. package/dist/core/datasource.d.ts.map +0 -1
  29. package/dist/core/deprecation.d.ts.map +0 -1
  30. package/dist/core/displayMode.d.ts.map +0 -1
  31. package/dist/core/displayStyle.d.ts.map +0 -1
  32. package/dist/core/filterToSql.d.ts.map +0 -1
  33. package/dist/core/helpContext.d.ts.map +0 -1
  34. package/dist/core/hooks.d.ts.map +0 -1
  35. package/dist/core/i18n.d.ts.map +0 -1
  36. package/dist/core/i18nDictionaries.d.ts.map +0 -1
  37. package/dist/core/icons.d.ts.map +0 -1
  38. package/dist/core/icuMessageFormat.d.ts.map +0 -1
  39. package/dist/core/leak-detector.d.ts.map +0 -1
  40. package/dist/core/omniverkTypes.d.ts.map +0 -1
  41. package/dist/core/pluginSystem.d.ts.map +0 -1
  42. package/dist/core/profiling.d.ts.map +0 -1
  43. package/dist/core/responsive.d.ts.map +0 -1
  44. package/dist/core/rtl.d.ts.map +0 -1
  45. package/dist/core/sanitizeHtml.d.ts.map +0 -1
  46. package/dist/core/spatialNav.d.ts.map +0 -1
  47. package/dist/core/standardProps.d.ts.map +0 -1
  48. package/dist/core/testing.d.ts.map +0 -1
  49. package/dist/core/theme.d.ts.map +0 -1
  50. package/dist/core/themeGallery.d.ts.map +0 -1
  51. package/dist/core/themePacks.d.ts.map +0 -1
  52. package/dist/core/themePacksExtended.d.ts.map +0 -1
  53. package/dist/core/themePresets.d.ts.map +0 -1
  54. package/dist/core/themeVariants.d.ts.map +0 -1
  55. package/dist/core/touch.d.ts.map +0 -1
  56. package/dist/core/traceless.d.ts.map +0 -1
  57. package/dist/core/tutorials.d.ts.map +0 -1
  58. package/dist/core/types.d.ts.map +0 -1
  59. package/dist/core/useControllableState.d.ts.map +0 -1
  60. package/dist/core/useGamepad.d.ts.map +0 -1
  61. package/dist/core/useThemeIsDark.d.ts.map +0 -1
  62. package/dist/core/validation.d.ts.map +0 -1
  63. package/dist/index.cjs.map +0 -1
  64. package/dist/index.d.ts.map +0 -1
  65. package/dist/index.mjs.map +0 -1
  66. package/dist/performance/concurrent.d.ts.map +0 -1
  67. package/dist/performance/images.d.ts.map +0 -1
  68. package/dist/performance/index.d.ts.map +0 -1
  69. package/dist/performance/memory.d.ts.map +0 -1
  70. package/dist/performance/virtualization.d.ts.map +0 -1
  71. package/dist/performance/workers.d.ts.map +0 -1
  72. package/dist/viewSchema.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,151 @@
1
1
  # @nice2dev/ui-core — Changelog
2
2
 
3
+ ## 1.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - The package description on npm shows a dash instead of the mis-encoded "—".
8
+ - 1.1.10 — the additive part of OmniVerk's 1.2.0 list: ui-audio builds without optional packages, one
9
+ i18n context, dictionaries per language, data props optional. No breaking changes.
10
+
11
+ **`@nice2dev/ui-audio` no longer breaks the consumer's build.** It imported `react-bootstrap`,
12
+ `recharts`, `react-window`, `react-youtube` and `pitchy` statically while declaring none of them
13
+ (only optional entries in `peerDependenciesMeta`), so a Vite app without them failed with "failed to
14
+ resolve import". Loading them with `import()` is no way out: Vite 8 (Rolldown) resolves dynamic
15
+ imports at build time and fails the same way, which made `hls.js` and `phaser` mandatory too.
16
+ `react-bootstrap`, `recharts`, `react-window` and `phaser` are now gone from the code
17
+ (`NiceBarFillEditor` uses Nice controls, `NiceVocalPerformanceReport` uses `NiceChart` /
18
+ `NicePieChart`, the karaoke editor list uses `NiceVirtualScroller`, `NiceKaraokePhaserRenderer`
19
+ renders with the DOM and keeps its name); `pitchy`, `react-youtube` and `hls.js` are regular
20
+ `dependencies`. Found on the way: in live mode the vocal performance report subtracted UltraStar note
21
+ numbers from MIDI pitch, so every singer got thousands of cents of deviation and 0 % accuracy — it now
22
+ compares pitch within the octave, as the scoring does; `NiceBarFillEditor` put a colour into a
23
+ percentage slider.
24
+
25
+ **Every package declares what its bundle imports.** A new CI gate checks every `import`, `import()`
26
+ and `require()` in the published `dist` against `dependencies` and non-optional `peerDependencies`.
27
+ To reach zero: `@nice2dev/licensing` no longer has `require('webpack')` in its main bundle (the webpack
28
+ plugin uses `compiler.webpack`; webpack 4 gets a warning instead of feature flags) and `react` is a
29
+ required peer; `@nice2dev/erp-adapter` lists `@microsoft/signalr` in `dependencies` (still loaded on
30
+ first use); `@nice2dev/icons-cursor` declares its `react-dom` peer; `@nice2dev/ui-printing` treats
31
+ `@nice2dev/ui` as a required peer.
32
+
33
+ **One copy of each package, one i18n context.** `@nice2dev/ui` carried its own copy of
34
+ `@nice2dev/ui-core` and `@nice2dev/i18n`, and `ui-forms`, `ui-api`, `ui-bi`, `ui-designers`, `ui-math`
35
+ and `ui-video` each carried a copy of all of `@nice2dev/ui` (about 4.4 MB each). Every copy had its own
36
+ React contexts: a `NiceI18nProvider` imported from `@nice2dev/i18n` did not reach the controls of
37
+ `@nice2dev/ui`, which kept their English defaults and `lang` `'en'`, and the dictionaries ended up in
38
+ an app several times. These packages now import `@nice2dev/*` instead (`ui-forms` 4.4 MB → 82 kB).
39
+ Keep every `@nice2dev/*` package on the same version.
40
+
41
+ **Dictionaries per language.** `NiceI18nLazyProvider` takes the same props as `NiceI18nProvider`
42
+ (`t`, `lang`, `overrides`, plus `fallback` and `onError`) but loads only the active language's
43
+ dictionary, with `import()`; until it arrives the controls show their built-in English (or
44
+ `fallback`), and with `t` nothing is loaded at all. Also `loadNiceDictionary(lang)`, to start in a
45
+ language without a flash of English, and `getLoadedNiceDictionary(lang)`. Exported from
46
+ `@nice2dev/i18n`, `@nice2dev/ui-core` and `@nice2dev/ui`; in the `i18n` build every language is its own
47
+ file. `NiceI18nProvider` and `NICE_I18N_DICTIONARIES` are unchanged and still bring all 30 dictionaries.
48
+ `NiceTestWrapper` (ui-core) and `NiceShowcase` (ui) use the lazy provider now, so they no longer pull
49
+ every dictionary into the apps that bundle them.
50
+
51
+ **Data props are optional.** These controls threw a `TypeError` without data and now render empty:
52
+ `NiceTreeView.nodes`, `NiceAccordion.items`, `NiceCascadeSelect.options`, `NiceAutocomplete.options`,
53
+ `NiceAuditLog.entries`, `NiceDocumentVersionList.versions`, `NicePermissionMatrix.roles` / `actions`,
54
+ `WizardStep.content`, `NiceDiagramViewer.document`, `NiceOrgChartVisualizer.data`,
55
+ `NiceSpatialViewer.document`, and in `@nice2dev/events` the lists of `NiceGiftRegistry`,
56
+ `NiceParticipantList`, `NiceExpenseSplit`, `NiceSeatingChart`, `NiceMediaCollage` and `NiceEventMedia`.
57
+ `NiceMap` without `center` centres on its markers (the whole world without markers), `NiceCountdown`
58
+ without `targetDate` shows zero and never calls `onComplete`, `NiceChat` without `onSend` is read-only
59
+ (no input), and `NiceInvitationDesigner` gains `defaultTemplate`. A CI ratchet counts the required
60
+ array props that remain.
61
+
62
+ **Smaller fixes.** `NicePieChart` draws a 100 % slice as a full circle instead of nothing. In
63
+ development `NiceThemeProvider` warns when `--nice-primary` / `--nice-color-primary` (or another linked
64
+ pair) resolves to nothing on `:root` — usually an alias cycle in the app's CSS; the theming guides say
65
+ which side to set. `@nice2dev/game-engine` exports `createAnimationClip`, `AnimatorController` and
66
+ `createAnimatorController` (two modules exported each name, so `export *` dropped all three); the other
67
+ implementations are `StateMachineAnimatorController`, `createStateMachineAnimatorController`,
68
+ `createTimelineAnimationClip` and `createRetargetingAnimationClip`.
69
+
70
+ Nothing was renamed or removed.
71
+
72
+ ## 1.1.9
73
+
74
+ ### Patch Changes
75
+
76
+ - 1.1.9 — themes reach the controls again, every control has a rendered demo, no breaking changes.
77
+
78
+ **Theming.** `NiceThemeProvider`, `applyTheme` and `NiceThemePreview` write the `--nice-*` tokens
79
+ again, so a theme recolours the controls and not only the app's own CSS — since 1.1.7 only
80
+ light/dark switched. The provider's scope wins over values set on `:root`, as it did before 1.1.7:
81
+ put a brand colour into the theme rather than on `<html>`. Alias tokens are computed in the theme
82
+ scope, not only on `:root`. About 1,600 places that used a text token as a background or border, or
83
+ a surface token as text colour, now use the token of the right role. `--nice-warning-light` and
84
+ `--nice-danger-light` are the light shade of the status colour, like `--nice-success-light`
85
+ (new: `--nice-color-warning-light`, `--nice-color-error-light`); backgrounds use `--nice-*-bg`.
86
+
87
+ **Styles that never shipped.** Six stylesheets in `@nice2dev/ui` were unreachable from its entry
88
+ point, so `NiceLiveDataGrid`, `NiceTaskInbox`, `NiceBPMNDesigner`, `NiceInstanceMonitor`,
89
+ `NiceIntegrationHub`, `NiceRulesEngine` and `NiceVideoEditor` rendered unstyled; eleven more
90
+ components had no stylesheet at all; `workflow.css` read its spacing scale as pixels; and
91
+ `NiceModuleGrid` was styled for a `<table>` it does not render.
92
+
93
+ **Language.** `useNiceTranslation()` returns `{ t, lang }` and dates are formatted in the interface
94
+ language rather than the browser's (`ui-presentations` adds `useNiceLang()`). `NiceInvoiceLineEditor`
95
+ takes its currency and units from the active language unless you pass them. `NiceAuditLog`,
96
+ `NiceRecordingPanel`, the four game-engine editors and `NiceTemplateEditor` are translated, the
97
+ game-engine dictionary is actually registered, and 136 ui-audio strings have English defaults
98
+ instead of rendering raw keys.
99
+
100
+ **Canvas and document colours.** Canvas never resolves `var()`: the QR and barcode generators drew a
101
+ black rectangle, the whiteboard lost its colours and light presets parsed to `NaN`. Data colours are
102
+ resolved first now. Colours stored in documents — slide templates, theme presets, brand kits,
103
+ exports — are literals, so a saved document looks the same in every theme.
104
+
105
+ **Fixes found by the new demos.** All 895 controls now have a rendered showcase demo, and roughly
106
+ every third new demo exposed a bug. `ui-platform`: the service worker re-registered on every
107
+ render, a screen permission prompt appeared on mount, reconnects and start-up tasks ran twice,
108
+ valid EAN-13 codes were rejected. `ui-ai`: `createProviderFromConfig` dropped the endpoint path —
109
+ OpenAI, Anthropic and Groq were called without `/v1` and Azure always threw — and the theme
110
+ generator failed on every request. `ui-communication`: the local participant appeared twice in a
111
+ conference and `activeConversationId` was ignored. `ui-buildings`: automation days were saved as
112
+ indices (both forms are read now), the row toggle changed the selected rule instead of the clicked
113
+ one, and floor-plan devices were drawn in the corner. `ui-mobile`: `NiceTouchTable` rendered invalid
114
+ table markup. `ui-diagrams`: arrowheads grew with the stroke width and transition clicks never fired.
115
+ `ui-3d`: opening a code editor before the 3D view broke the whole app. `ui-presentations`: the editor
116
+ clipped slides in columns narrower than 800 px.
117
+
118
+ **Additive API only.** `@nice2dev/ui-platform` now exports its hooks, provider aliases and Props / Ref
119
+ types. Nothing was renamed or removed.
120
+
121
+ ## 1.1.8
122
+
123
+ ### Patch Changes
124
+
125
+ - 1.1.8 — old problems closed, no breaking changes.
126
+
127
+ **English-first UI.** Text that was hardcoded Polish now goes through `t()` with an English
128
+ default: the planning views, the whole of `@nice2dev/ui-printing`, smart home, backup, the
129
+ navigation and settings panels, `@nice2dev/ui-buildings` end to end, the photo editor and the
130
+ presentation Q&A panel. The dictionary gains 566 keys in en, pl, de, fr, es and uk, so an app
131
+ with `locale="pl"` reads as before. Three prop defaults changed with it:
132
+ `NiceInvoiceLineEditor` (`currencySymbol` `'zł'` → `'$'`, `units` → English) and
133
+ `NiceTimeoutFeedback`'s two messages.
134
+
135
+ **Icons.** No emoji, unicode glyphs or inline `<svg>` are used as icons any more — not in JSX,
136
+ not in `icon:` data fields, not on canvas. Ten icons in `icons-business` / `icons-education`
137
+ that drew their artwork as `<text>` use paths now, and the behaviour-tree palette names resolve
138
+ to real `NiceIcon` builtins (`shield` and `repeat` are new; 176 in total).
139
+
140
+ **Fixes.** The shadcn adapter reads the host's `--primary` / `--accent` again instead of
141
+ producing invalid `hsl(#hex)`; `ui-diagrams` ships the 21 translation keys its components were
142
+ already asking for; `--nice-font-size-2xl` is declared; `NiceScheduler` warns in development
143
+ when it ignores a `currentDate`, `view` or `events` change; `ui-buildings` typechecks clean and
144
+ `DeviceProtocol` accepts `'mqtt'`.
145
+
146
+ **Docs.** `doc.json` no longer lists CSS variables no component implements; eleven components
147
+ document the tokens their stylesheets really read.
148
+
3
149
  ## 1.1.7
4
150
 
5
151
  ### Patch Changes
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Canvas and WebGL APIs take a colour string but do not understand CSS custom properties:
3
+ * `ctx.fillStyle = 'var(--nice-bg, #fff)'` is silently ignored and the previous colour
4
+ * stays. `resolveCssColor` turns a `var(--name, fallback)` into the value it has on
5
+ * `element` (pass the canvas, so a theme scoped to a wrapper applies), falling back
6
+ * through nested `var()` fallbacks. Any other string is returned unchanged. An element
7
+ * that is not in the document (an offscreen canvas) resolves against the root.
8
+ *
9
+ * @example
10
+ * ctx.fillStyle = resolveCssColor('var(--nice-bg-primary, #fff)', ctx.canvas);
11
+ */
12
+ export declare function resolveCssColor(color: string, element?: Element | OffscreenCanvas | null): string;
@@ -143,8 +143,9 @@ export declare function useBrandColors(imageSource: string | HTMLImageElement |
143
143
  *
144
144
  * @example
145
145
  * ```tsx
146
- * const palette = generatePaletteFromColor('var(--nice-primary, #3b82f6)');
147
- * // { light: 'var(--nice-primary-bg, #dbeafe)', base: 'var(--nice-primary, #3b82f6)', dark: 'var(--nice-primary-dark, #1e40af)', ... }
146
+ * const palette = generatePaletteFromColor('#3b82f6');
147
+ * // { lightest: '#…', …, base: '#3b82f6', …, text: '#000000', textInverse: '#ffffff' }
148
+ * // — hex in, hex out (the input is parsed as #rrggbb)
148
149
  * ```
149
150
  */
150
151
  export declare function generatePaletteFromColor(baseColor: string): {
@@ -6,4 +6,6 @@
6
6
  */
7
7
  export { NiceI18nProvider, useNiceTranslation } from '@nice2dev/i18n';
8
8
  export type { NiceTranslateFn, NiceSupportedLang, NiceI18nProviderProps } from '@nice2dev/i18n';
9
+ export { NiceI18nLazyProvider, loadNiceDictionary, getLoadedNiceDictionary } from '@nice2dev/i18n';
10
+ export type { NiceI18nLazyProviderProps } from '@nice2dev/i18n';
9
11
  export { NICE_SUPPORTED_LANGS, NICE_I18N_DICTIONARIES } from '@nice2dev/i18n';
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ /**
3
+ * CSS-drawn marks — the SOURCE OF TRUTH (TODO_1.1.9 B6).
4
+ *
5
+ * Eight packages (`social`, `templates`, `ui-security`, `licensing`, `ui-mobile`,
6
+ * `ui-platform`, `ui-science`, `auth`) ship with `dependencies: {}` — react and react-dom
7
+ * peers only — so they cannot reach `@nice2dev/icons` for a glyph. Each had grown its own
8
+ * copy of the same shapes, in three different unit systems: `licensing/src/marks.tsx` in
9
+ * `em`, `auth`'s refresh ring in `px` inside `NiceCaptcha.css`, `social/src/shapes.tsx` as
10
+ * `clip-path`. Three implementations of one open ring is exactly the drift B6 named.
11
+ *
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
14
+ * `scripts/audit-marks-sync.mjs` (gate `P1.8 marks-sync`, regenerate with `--write`).
15
+ *
16
+ * Units are `em` throughout, so a mark scales with the control it sits in — the `px`
17
+ * version did not. Colour is always `currentColor`, which keeps a mark on the foreground
18
+ * side of the token roles the P1.5 ratchets enforce. Every mark is `aria-hidden`: the
19
+ * accessible name belongs to the button or label that contains it, never to the mark.
20
+ *
21
+ * This is the sanctioned exception to the "icons come from @nice2dev/icons only" rule in
22
+ * CLAUDE.md: it applies where an icon dependency is not available at all, and it draws
23
+ * geometry with borders rather than substituting a glyph or an emoji.
24
+ */
25
+ export interface NiceMarkProps {
26
+ /** Merged over the mark's own inline style. */
27
+ style?: React.CSSProperties;
28
+ }
29
+ /** Tick, drawn as two borders of a rotated box. */
30
+ export declare const CheckMark: React.FC<NiceMarkProps>;
31
+ /** Open ring, read as "reload"; the button it sits in carries the accessible name. */
32
+ export declare const RefreshMark: React.FC<NiceMarkProps>;
33
+ /** Chevron for expand / collapse affordances. */
34
+ export declare const ChevronMark: React.FC<NiceMarkProps & {
35
+ direction: 'up' | 'down';
36
+ }>;
37
+ /** Filled dot, for status and presence indicators. */
38
+ export declare const DotMark: React.FC<NiceMarkProps>;
39
+ /** Close affordance: two strokes crossed, instead of a `×` glyph. */
40
+ export declare const CloseMark: React.FC<NiceMarkProps>;
@@ -42,7 +42,7 @@ export interface NiceThemeBackgrounds {
42
42
  export interface NiceThemeBackgroundImage {
43
43
  /** Background type */
44
44
  type?: 'none' | 'solid' | 'gradient' | 'image' | 'pattern';
45
- /** CSS gradient string (e.g. 'linear-gradient(135deg, var(--nice-accent, #667eea) 0%, var(--nice-accent-dark, #764ba2) 100%)') */
45
+ /** CSS gradient string (e.g. 'linear-gradient(135deg, var(--nice-accent, #667eea) 0%, var(--nice-color-accent-hover, #764ba2) 100%)') */
46
46
  gradient?: string;
47
47
  /** Image URL */
48
48
  imageUrl?: string;
@@ -355,6 +355,7 @@ export interface TracelessComplianceReport {
355
355
  */
356
356
  export interface TracelessBadgeInfo {
357
357
  mode: TracelessMode;
358
+ /** NiceIcon name for the mode (render with `<NiceIcon name={…} />`). */
358
359
  icon: string;
359
360
  color: string;
360
361
  label: string;