@nice2dev/ui-graphics 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 +173 -0
- package/README.md +60 -63
- package/dist/cjs/animation/AnimationEditor.js +0 -3
- package/dist/cjs/animation/Audience.js +3 -1
- package/dist/cjs/animation/BodyRenderer.js +1 -4
- package/dist/cjs/animation/rig/RigPlayer.js +1 -1
- package/dist/cjs/animation/rig/presets.js +67 -55
- package/dist/cjs/animation/shapes/heads.js +0 -3
- package/dist/cjs/animation/shapes/headwear.js +4 -1
- package/dist/cjs/core/NiceBrushEngine.js +6 -6
- package/dist/cjs/core/editorAsk.js +48 -0
- package/dist/cjs/core/i18n.js +7 -3
- package/dist/cjs/core/plugins.js +1 -1
- package/dist/cjs/core/rtl.js +1 -1
- package/dist/cjs/core/theme.js +1 -1
- package/dist/cjs/font/NiceFontEditor.js +16 -14
- package/dist/cjs/game/GameAsset2dEditor.js +28 -19
- package/dist/cjs/index.js +0 -11
- package/dist/cjs/nice2dev-ui-graphics.css +1 -1
- package/dist/cjs/photo/FilterThumb.js +3 -3
- package/dist/cjs/photo/NiceAITools.js +7 -5
- package/dist/cjs/photo/PhotoEditor.js +3 -1
- package/dist/cjs/photo/PhotoEditorCanvas.js +8 -6
- package/dist/cjs/photo/PhotoEditorLeftPanel.js +19 -19
- package/dist/cjs/photo/PhotoEditorToolbar.js +5 -5
- package/dist/cjs/photo/photoFilters.js +1 -0
- package/dist/cjs/pixel/PixelEditor.js +6 -6
- package/dist/cjs/pixel/PixelEditor.module.css.js +1 -1
- package/dist/cjs/pixel/PixelEditorCanvas.js +10 -6
- package/dist/cjs/pixel/PixelEditorMenuBar.js +3 -3
- package/dist/cjs/pixel/PixelEditorRightPanel.js +28 -24
- package/dist/cjs/pixel/PixelEditorStatusBar.js +8 -4
- package/dist/cjs/pixel/PixelEditorTimeline.js +11 -2
- package/dist/cjs/pixel/PixelEditorToolbar.js +10 -6
- package/dist/cjs/pixel/SpriteGeneratorPanel.js +12 -8
- package/dist/cjs/pixel/animalGeneratorPresets.js +31 -31
- package/dist/cjs/pixel/buildingGeneratorPresets.js +24 -24
- package/dist/cjs/pixel/characterGeneratorPresets.js +25 -25
- package/dist/cjs/pixel/usePixelEditor.js +13 -10
- package/dist/cjs/texture/Nice3DTexturePainter.js +12 -10
- package/dist/cjs/ui/NiceUIDesigner.js +18 -14
- package/dist/cjs/vector/NiceSvgToCode.js +6 -4
- package/dist/cjs/vector/VectorEditor.js +3 -5
- package/dist/cjs/vector/VectorEditorShapeRenderer.js +3 -1
- package/dist/cjs/vector/useVectorEditor.js +38 -29
- package/dist/cjs/vector/vectorEditorImport.js +1 -0
- package/dist/cjs/vector/vectorIconImport.js +1 -0
- package/dist/esm/animation/AnimationEditor.js +1 -3
- package/dist/esm/animation/Audience.js +3 -1
- package/dist/esm/animation/BodyRenderer.js +3 -5
- package/dist/esm/animation/rig/RigPlayer.js +1 -1
- package/dist/esm/animation/rig/presets.js +68 -56
- package/dist/esm/animation/shapes/heads.js +1 -3
- package/dist/esm/animation/shapes/headwear.js +4 -1
- package/dist/esm/animation/spineExport.js +1 -1
- package/dist/esm/core/NiceBrushEngine.js +6 -6
- package/dist/esm/core/editorAsk.js +45 -0
- package/dist/esm/core/i18n.js +8 -4
- package/dist/esm/core/plugins.js +1 -1
- package/dist/esm/core/rtl.js +1 -1
- package/dist/esm/core/theme.js +1 -1
- package/dist/esm/font/NiceFontEditor.js +16 -14
- package/dist/esm/game/GameAsset2dEditor.js +29 -19
- package/dist/esm/index.js +10 -10
- package/dist/esm/nice2dev-ui-graphics.css +1 -1
- package/dist/esm/photo/FilterThumb.js +3 -3
- package/dist/esm/photo/NiceAITools.js +7 -5
- package/dist/esm/photo/PhotoEditor.js +3 -1
- package/dist/esm/photo/PhotoEditorCanvas.js +8 -6
- package/dist/esm/photo/PhotoEditorLeftPanel.js +19 -19
- package/dist/esm/photo/PhotoEditorToolbar.js +5 -5
- package/dist/esm/photo/photoFilters.js +1 -0
- package/dist/esm/pixel/PixelEditor.js +7 -6
- package/dist/esm/pixel/PixelEditor.module.css.js +1 -1
- package/dist/esm/pixel/PixelEditorCanvas.js +10 -6
- package/dist/esm/pixel/PixelEditorMenuBar.js +3 -3
- package/dist/esm/pixel/PixelEditorRightPanel.js +28 -24
- package/dist/esm/pixel/PixelEditorStatusBar.js +8 -4
- package/dist/esm/pixel/PixelEditorTimeline.js +11 -2
- package/dist/esm/pixel/PixelEditorToolbar.js +10 -6
- package/dist/esm/pixel/SpriteGeneratorPanel.js +12 -8
- package/dist/esm/pixel/animalGeneratorPresets.js +32 -32
- package/dist/esm/pixel/buildingGeneratorPresets.js +25 -25
- package/dist/esm/pixel/characterGeneratorPresets.js +26 -26
- package/dist/esm/pixel/usePixelEditor.js +13 -10
- package/dist/esm/texture/Nice3DTexturePainter.js +12 -10
- package/dist/esm/ui/NiceUIDesigner.js +18 -14
- package/dist/esm/vector/NiceSvgToCode.js +6 -4
- package/dist/esm/vector/VectorEditor.js +4 -5
- package/dist/esm/vector/VectorEditorShapeRenderer.js +3 -1
- package/dist/esm/vector/useVectorEditor.js +38 -29
- package/dist/esm/vector/vectorEditorImport.js +1 -0
- package/dist/esm/vector/vectorIconImport.js +1 -0
- package/dist/types/animation/AnimatedPerson.d.ts +0 -4
- package/dist/types/animation/AnimationEditor.d.ts +1 -5
- package/dist/types/animation/Audience.d.ts +0 -4
- package/dist/types/animation/BodyRenderer.d.ts +0 -4
- package/dist/types/animation/rig/RigPlayer.d.ts +0 -7
- package/dist/types/animation/rig/RiggedBody.d.ts +0 -4
- package/dist/types/animation/shapes/heads.d.ts +0 -4
- package/dist/types/core/LocalUI.d.ts +1 -2
- package/dist/types/core/editorAsk.d.ts +26 -0
- package/dist/types/core/i18n.d.ts +1 -17
- package/dist/types/game/GameAsset2dEditor.d.ts +0 -4
- package/dist/types/game/index.d.ts +1 -1
- package/dist/types/index.d.ts +9 -19
- package/dist/types/photo/index.d.ts +0 -2
- package/dist/types/pixel/PixelEditor.d.ts +0 -4
- package/dist/types/pixel/SpriteGeneratorPanel.d.ts +0 -4
- package/dist/types/pixel/usePixelEditor.d.ts +3 -0
- package/dist/types/vector/VectorEditor.d.ts +0 -4
- package/dist/types/vector/useVectorEditor.d.ts +2 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,178 @@
|
|
|
1
1
|
# @nice2dev/ui-graphics — 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
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
### Editors
|
|
14
14
|
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
15
|
+
- **NicePixelEditor** — Aseprite-inspired pixel art with layers, frames, dithering, GIF / sprite-sheet export, .aseprite import, tile map mode
|
|
16
|
+
- **NiceVectorEditor** — SVG shapes, pen tool, boolean operations, gradients, pattern fills, text-on-path, PDF export
|
|
17
|
+
- **NicePhotoEditor** — 50+ filters, RAW support, smart selection (magic wand, lasso, magnetic), healing brush, content-aware fill, face detection, batch processing, AI style-transfer
|
|
18
|
+
- **NiceAnimationEditor** — 2D character builder with skeleton rigging, IK/FK, ragdoll/cloth physics, motion paths, Lottie & Spine export
|
|
19
|
+
- **NiceGameAsset2dEditor** — tile maps, sprite sheets, animation state machines, collision shapes, isometric 2.5D, multi-engine export (Tiled, Godot, Unity, Phaser, Construct)
|
|
20
20
|
- **NiceIconEditor** — SVG icon creation with variant system
|
|
21
21
|
- **NiceUIDesigner** — drag & drop UI builder generating React code
|
|
22
22
|
- **Nice3DTexturePainter** — paint textures on 3D models in-browser
|
|
@@ -61,11 +61,11 @@ npm install @nice2dev/ui-graphics framer-motion
|
|
|
61
61
|
## Quick Start
|
|
62
62
|
|
|
63
63
|
```tsx
|
|
64
|
-
import {
|
|
64
|
+
import { NicePixelEditor } from '@nice2dev/ui-graphics';
|
|
65
65
|
import '@nice2dev/ui-graphics/style.css';
|
|
66
66
|
|
|
67
67
|
function App() {
|
|
68
|
-
return <
|
|
68
|
+
return <NicePixelEditor initialWidth={64} initialHeight={64} />;
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -73,72 +73,65 @@ function App() {
|
|
|
73
73
|
|
|
74
74
|
## Editors
|
|
75
75
|
|
|
76
|
-
###
|
|
76
|
+
### NicePixelEditor
|
|
77
77
|
|
|
78
78
|
```tsx
|
|
79
|
-
import {
|
|
79
|
+
import { NicePixelEditor } from '@nice2dev/ui-graphics';
|
|
80
80
|
|
|
81
|
-
<
|
|
82
|
-
initialWidth={64}
|
|
83
|
-
initialHeight={64}
|
|
84
|
-
onSaveToLibrary={(dataUrl, name, mimeType) => upload(dataUrl)}
|
|
85
|
-
/>
|
|
81
|
+
<NicePixelEditor initialWidth={64} initialHeight={64} onSaveToLibrary={(dataUrl, name, mimeType) => upload(dataUrl)} />;
|
|
86
82
|
```
|
|
87
83
|
|
|
88
|
-
| Prop
|
|
89
|
-
|
|
90
|
-
| `initialWidth`
|
|
91
|
-
| `initialHeight`
|
|
92
|
-
| `className`
|
|
93
|
-
| `onSaveToLibrary` | `(dataUrl, name, mimeType) => void` | —
|
|
84
|
+
| Prop | Type | Default | Description |
|
|
85
|
+
| ----------------- | ----------------------------------- | ------- | ----------------------- |
|
|
86
|
+
| `initialWidth` | `number` | `64` | Canvas width in pixels |
|
|
87
|
+
| `initialHeight` | `number` | `64` | Canvas height in pixels |
|
|
88
|
+
| `className` | `string` | — | CSS class on root |
|
|
89
|
+
| `onSaveToLibrary` | `(dataUrl, name, mimeType) => void` | — | Callback on save |
|
|
94
90
|
|
|
95
|
-
###
|
|
91
|
+
### NiceVectorEditor
|
|
96
92
|
|
|
97
93
|
```tsx
|
|
98
|
-
import {
|
|
94
|
+
import { NiceVectorEditor } from '@nice2dev/ui-graphics';
|
|
99
95
|
|
|
100
|
-
<
|
|
96
|
+
<NiceVectorEditor />;
|
|
101
97
|
```
|
|
102
98
|
|
|
103
|
-
| Prop
|
|
104
|
-
|
|
105
|
-
| `className` | `string` | —
|
|
99
|
+
| Prop | Type | Default | Description |
|
|
100
|
+
| ----------- | -------- | ------- | ----------------- |
|
|
101
|
+
| `className` | `string` | — | CSS class on root |
|
|
106
102
|
|
|
107
|
-
###
|
|
103
|
+
### NicePhotoEditor
|
|
108
104
|
|
|
109
105
|
```tsx
|
|
110
|
-
import {
|
|
106
|
+
import { NicePhotoEditor } from '@nice2dev/ui-graphics';
|
|
111
107
|
|
|
112
|
-
<
|
|
108
|
+
<NicePhotoEditor />;
|
|
113
109
|
```
|
|
114
110
|
|
|
115
|
-
###
|
|
111
|
+
### NiceAnimationEditor
|
|
116
112
|
|
|
117
113
|
```tsx
|
|
118
|
-
import {
|
|
114
|
+
import { NiceAnimationEditor } from '@nice2dev/ui-graphics';
|
|
119
115
|
|
|
120
|
-
<
|
|
121
|
-
onChange={(cfg) => saveCharacter(cfg)}
|
|
122
|
-
onNotify={(msg, type) => toast(msg, { type })}
|
|
123
|
-
/>
|
|
116
|
+
<NiceAnimationEditor onChange={(cfg) => saveCharacter(cfg)} onNotify={(msg, type) => toast(msg, { type })} />;
|
|
124
117
|
```
|
|
125
118
|
|
|
126
|
-
| Prop
|
|
127
|
-
|
|
128
|
-
| `initialConfig` | `CharacterConfig`
|
|
129
|
-
| `onChange`
|
|
130
|
-
| `storageKey`
|
|
131
|
-
| `onNotify`
|
|
132
|
-
| `showJsonPanel` | `boolean`
|
|
133
|
-
| `showPreview`
|
|
134
|
-
| `className`
|
|
119
|
+
| Prop | Type | Default | Description |
|
|
120
|
+
| --------------- | -------------------------------- | --------------------------------------- | ------------------------------------ |
|
|
121
|
+
| `initialConfig` | `CharacterConfig` | `DEFAULT_CHARACTER` | Starting character config |
|
|
122
|
+
| `onChange` | `(cfg: CharacterConfig) => void` | — | Called on every change |
|
|
123
|
+
| `storageKey` | `string \| false` | `"nice2dev.animation-editor.character"` | localStorage key; `false` to disable |
|
|
124
|
+
| `onNotify` | `(msg, type?) => void` | — | Notification callback |
|
|
125
|
+
| `showJsonPanel` | `boolean` | `true` | Show JSON editor panel |
|
|
126
|
+
| `showPreview` | `boolean` | `true` | Show animated preview |
|
|
127
|
+
| `className` | `string` | — | CSS class on root |
|
|
135
128
|
|
|
136
|
-
###
|
|
129
|
+
### NiceGameAsset2dEditor
|
|
137
130
|
|
|
138
131
|
```tsx
|
|
139
|
-
import {
|
|
132
|
+
import { NiceGameAsset2dEditor } from '@nice2dev/ui-graphics';
|
|
140
133
|
|
|
141
|
-
<
|
|
134
|
+
<NiceGameAsset2dEditor />;
|
|
142
135
|
```
|
|
143
136
|
|
|
144
137
|
---
|
|
@@ -148,11 +141,11 @@ import { GameAsset2dEditor } from '@nice2dev/ui-graphics';
|
|
|
148
141
|
### i18n — Translation Provider
|
|
149
142
|
|
|
150
143
|
```tsx
|
|
151
|
-
import { NiceI18nProvider,
|
|
144
|
+
import { NiceI18nProvider, NiceAnimationEditor } from '@nice2dev/ui-graphics';
|
|
152
145
|
|
|
153
146
|
<NiceI18nProvider t={(key, fallback) => myI18n(key) ?? fallback}>
|
|
154
|
-
<
|
|
155
|
-
</NiceI18nProvider
|
|
147
|
+
<NiceAnimationEditor />
|
|
148
|
+
</NiceI18nProvider>;
|
|
156
149
|
```
|
|
157
150
|
|
|
158
151
|
### Plugin System
|
|
@@ -174,8 +167,8 @@ PluginRegistry.register(myPlugin);
|
|
|
174
167
|
|
|
175
168
|
// Or via React context
|
|
176
169
|
<NicePluginProvider plugins={[myPlugin]}>
|
|
177
|
-
<
|
|
178
|
-
</NicePluginProvider
|
|
170
|
+
<NicePixelEditor />
|
|
171
|
+
</NicePluginProvider>;
|
|
179
172
|
```
|
|
180
173
|
|
|
181
174
|
### Theme (Dark / Light)
|
|
@@ -185,7 +178,7 @@ import { NiceEditorThemeProvider, useEditorTheme } from '@nice2dev/ui-graphics';
|
|
|
185
178
|
|
|
186
179
|
<NiceEditorThemeProvider initialMode="auto">
|
|
187
180
|
<YourApp />
|
|
188
|
-
</NiceEditorThemeProvider
|
|
181
|
+
</NiceEditorThemeProvider>;
|
|
189
182
|
|
|
190
183
|
// Inside components:
|
|
191
184
|
const { theme, mode, setMode, toggleMode } = useEditorTheme();
|
|
@@ -239,8 +232,8 @@ const guide = createGuide('vertical', 100);
|
|
|
239
232
|
import { NiceRTLProvider, useIsRTL } from '@nice2dev/ui-graphics';
|
|
240
233
|
|
|
241
234
|
<NiceRTLProvider direction="rtl">
|
|
242
|
-
<
|
|
243
|
-
</NiceRTLProvider
|
|
235
|
+
<NicePixelEditor />
|
|
236
|
+
</NiceRTLProvider>;
|
|
244
237
|
```
|
|
245
238
|
|
|
246
239
|
### Animation Utilities
|
|
@@ -248,9 +241,13 @@ import { NiceRTLProvider, useIsRTL } from '@nice2dev/ui-graphics';
|
|
|
248
241
|
```tsx
|
|
249
242
|
import {
|
|
250
243
|
solveTwoBoneIK,
|
|
251
|
-
blendPose,
|
|
252
|
-
|
|
253
|
-
|
|
244
|
+
blendPose,
|
|
245
|
+
tweenPose,
|
|
246
|
+
ease,
|
|
247
|
+
createLinearPath,
|
|
248
|
+
evaluatePath,
|
|
249
|
+
exportToLottie,
|
|
250
|
+
exportToSpine,
|
|
254
251
|
} from '@nice2dev/ui-graphics';
|
|
255
252
|
|
|
256
253
|
// IK solving
|
|
@@ -318,13 +315,13 @@ npm run analyze
|
|
|
318
315
|
```
|
|
319
316
|
src/
|
|
320
317
|
index.ts # public API barrel export
|
|
321
|
-
pixel/ #
|
|
322
|
-
vector/ #
|
|
323
|
-
photo/ #
|
|
324
|
-
animation/ #
|
|
318
|
+
pixel/ # NicePixelEditor + utils
|
|
319
|
+
vector/ # NiceVectorEditor + boolean ops, gradients
|
|
320
|
+
photo/ # NicePhotoEditor + filters, selection
|
|
321
|
+
animation/ # NiceAnimationEditor + rig, physics, motion paths
|
|
325
322
|
rig/ # Skeleton rigging, IK, FK, pose blending
|
|
326
323
|
shapes/ # SVG body part renderers
|
|
327
|
-
game/ #
|
|
324
|
+
game/ # NiceGameAsset2dEditor
|
|
328
325
|
icon/ # NiceIconEditor
|
|
329
326
|
ui/ # NiceUIDesigner
|
|
330
327
|
texture/ # Nice3DTexturePainter
|
|
@@ -111,8 +111,5 @@ function NiceAnimationEditor({ initialConfig, onChange, storageKey = STORAGE_KEY
|
|
|
111
111
|
};
|
|
112
112
|
return (jsxRuntime.jsxs("div", { className: `ntd-animation-editor ${className !== null && className !== void 0 ? className : ''}`, style: style, children: [jsxRuntime.jsxs("div", { className: "ntd-ae-controls", children: [jsxRuntime.jsx(Row, { title: t('characterEditor.name', 'Name'), children: jsxRuntime.jsx(ui.NiceTextInput, { className: "ntd-ae-input", value: cfg.name || '', onChange: (val) => setCfg({ ...cfg, name: val }), placeholder: t('characterEditor.namePlaceholder', 'Character name') }) }), jsxRuntime.jsxs(Row, { title: t('characters.size', 'Size'), children: [jsxRuntime.jsx(ui.NiceSlider, { min: 140, max: 300, value: (_a = cfg.size) !== null && _a !== void 0 ? _a : 180, onChange: (val) => setCfg({ ...cfg, size: val }) }), jsxRuntime.jsxs("span", { className: "ntd-ae-size-value", children: [(_b = cfg.size) !== null && _b !== void 0 ? _b : 180, "px"] })] }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.faceShape', 'Face'), feature: cfg.face, variants: characterTypes.VARIANTS.face, onChange: (v) => updateFeature('face', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.hairstyle', 'Hair'), feature: cfg.hair, variants: characterTypes.VARIANTS.hair, onChange: (v) => updateFeature('hair', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.eyes', 'Eyes'), feature: cfg.eyes, variants: characterTypes.VARIANTS.eyes, onChange: (v) => updateFeature('eyes', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.nose', 'Nose'), feature: cfg.nose, variants: characterTypes.VARIANTS.nose, onChange: (v) => updateFeature('nose', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.mouth', 'Mouth'), feature: cfg.mouth, variants: characterTypes.VARIANTS.mouth, onChange: (v) => updateFeature('mouth', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.clothing', 'Outfit'), feature: cfg.outfit, variants: characterTypes.VARIANTS.outfit, onChange: (v) => updateFeature('outfit', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.headwear', 'Headwear'), feature: cfg.headwear, variants: characterTypes.VARIANTS.headwear, onChange: (v) => updateFeature('headwear', v) }), jsxRuntime.jsx(FeatureEditor, { title: t('characters.prop', 'Prop'), feature: cfg.prop, variants: characterTypes.VARIANTS.prop, onChange: (v) => updateFeature('prop', v) }), jsxRuntime.jsxs("div", { className: "ntd-ae-action-row", children: [jsxRuntime.jsxs(ui.NiceButton, { className: "ntd-ae-btn", variant: "ghost", onClick: randomizeColors, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "shuffle", size: 14 }), ' ', t('characterEditor.randomizeColors', 'Randomize colors')] }), jsxRuntime.jsxs(ui.NiceButton, { className: "ntd-ae-btn", variant: "ghost", onClick: downloadJson, children: [jsxRuntime.jsx(uiCore.NiceIcon, { name: "download", size: 14 }), " ", t('characters.downloadJson', 'Download JSON')] })] }), showJsonPanel && (jsxRuntime.jsxs("div", { className: "ntd-ae-json-panel", children: [jsxRuntime.jsx("div", { className: "ntd-ae-json-label", children: t('characterEditor.jsonSection', 'JSON') }), jsxRuntime.jsx(ui.NiceTextArea, { className: "ntd-ae-textarea", value: json, onChange: (val) => setJson(val) }), jsxRuntime.jsxs("div", { className: "ntd-ae-json-actions", children: [jsxRuntime.jsx(ui.NiceButton, { className: "ntd-ae-btn", variant: "primary", onClick: applyJson, children: t('characterEditor.applyJson', 'Apply JSON') }), jsxRuntime.jsx(ui.NiceButton, { className: "ntd-ae-btn", variant: "ghost", onClick: () => navigator.clipboard.writeText(JSON.stringify(cfg, null, 2)), children: t('characterEditor.copyToClipboard', 'Copy') })] })] }))] }), showPreview && (jsxRuntime.jsxs("div", { className: "ntd-ae-preview", children: [jsxRuntime.jsx("div", { className: "ntd-ae-preview-label", children: t('characterEditor.preview', 'Preview') }), jsxRuntime.jsx(AnimatedPerson, { character: cfg, score: 10, startPose: "idle" })] }))] }));
|
|
113
113
|
}
|
|
114
|
-
/** @deprecated Use NiceAnimationEditor */
|
|
115
|
-
const AnimationEditor = NiceAnimationEditor;
|
|
116
114
|
|
|
117
|
-
exports.AnimationEditor = AnimationEditor;
|
|
118
115
|
exports.NiceAnimationEditor = NiceAnimationEditor;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var ui = require('@nice2dev/ui');
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var i18n = require('../core/i18n.js');
|
|
6
7
|
var AnimatedPerson = require('./AnimatedPerson.js');
|
|
7
8
|
var characterTypes = require('./characterTypes.js');
|
|
8
9
|
var choreoDSL = require('./choreoDSL.js');
|
|
@@ -35,6 +36,7 @@ function makeAudience(n) {
|
|
|
35
36
|
}
|
|
36
37
|
/** Grid of animated audience members with wave/cheer actions. */
|
|
37
38
|
const NiceAudience = ({ count = 36, columns = 12 }) => {
|
|
39
|
+
const { t } = i18n.useNiceTranslation();
|
|
38
40
|
const people = React.useMemo(() => makeAudience(count), [count]);
|
|
39
41
|
const refs = React.useRef([]);
|
|
40
42
|
refs.current = [];
|
|
@@ -59,7 +61,7 @@ const NiceAudience = ({ count = 36, columns = 12 }) => {
|
|
|
59
61
|
display: 'grid',
|
|
60
62
|
gap: 8,
|
|
61
63
|
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
62
|
-
}, children: people.map((c, i) => (jsxRuntime.jsx(AnimatedPerson, { character: c, score: 10, startPose: "idle", onReady: (fx) => (refs.current[i] = fx) }, i))) }), jsxRuntime.jsxs("div", { style: { display: 'flex', gap: 8 }, children: [jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: wave, children:
|
|
64
|
+
}, children: people.map((c, i) => (jsxRuntime.jsx(AnimatedPerson, { character: c, score: 10, startPose: "idle", onReady: (fx) => (refs.current[i] = fx) }, i))) }), jsxRuntime.jsxs("div", { style: { display: 'flex', gap: 8 }, children: [jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: wave, children: t('audience.wave', 'Wave') }), jsxRuntime.jsx(ui.NiceButton, { variant: "ghost", size: "sm", onClick: cheer, children: t('audience.cheer', 'Cheer') })] })] }));
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
module.exports = NiceAudience;
|
|
@@ -25,11 +25,8 @@ const NiceBodyRenderer = ({ character, size }) => {
|
|
|
25
25
|
const outfitBase = characterTypes.pick(character.outfit.colors, 0, characterTypes.DEFAULT_COLORS.shirt);
|
|
26
26
|
const armColors = [skin, outfitBase, stroke];
|
|
27
27
|
const legColors = [outfitBase, characterTypes.pick(character.outfit.colors, 1, outfitBase), stroke];
|
|
28
|
-
return (jsxRuntime.jsx("svg", { width: S, height: S, viewBox: `0 0 ${S} ${S}`, role: "img", children: jsxRuntime.jsxs("g", { transform: `translate(${S / 2} ${S * 0.86})`, children: [jsxRuntime.jsx(legs.Leg, { colors: legColors, side: -1, variant: "pants", scale: k, transform: "translate(-16 0)" }), jsxRuntime.jsx(legs.Leg, { colors: legColors, side: 1, variant: "pants", scale: k, transform: "translate(16 0)" }), jsxRuntime.jsx(torsos.Torso, { variant: "vShape", colors: [skin, 'var(--anim-transparent, #00000000)', stroke], scale: k }), jsxRuntime.jsx(outfits.Outfit, { variant: character.outfit.variant, colors: character.outfit.colors, scale: k }), jsxRuntime.jsx(arms.Arm, { colors: armColors, side: -1, variant: "sleeveShort", scale: k, transform: "translate(-40 -8)" }), jsxRuntime.jsx(arms.Arm, { colors: armColors, side: 1, variant: "sleeveShort", scale: k, transform: "translate(40 -8)" }), jsxRuntime.jsxs("g", { transform: "translate(0 -84)", children: [jsxRuntime.jsx(heads.
|
|
28
|
+
return (jsxRuntime.jsx("svg", { width: S, height: S, viewBox: `0 0 ${S} ${S}`, role: "img", children: jsxRuntime.jsxs("g", { transform: `translate(${S / 2} ${S * 0.86})`, children: [jsxRuntime.jsx(legs.Leg, { colors: legColors, side: -1, variant: "pants", scale: k, transform: "translate(-16 0)" }), jsxRuntime.jsx(legs.Leg, { colors: legColors, side: 1, variant: "pants", scale: k, transform: "translate(16 0)" }), jsxRuntime.jsx(torsos.Torso, { variant: "vShape", colors: [skin, 'var(--anim-transparent, #00000000)', stroke], scale: k }), jsxRuntime.jsx(outfits.Outfit, { variant: character.outfit.variant, colors: character.outfit.colors, scale: k }), jsxRuntime.jsx(arms.Arm, { colors: armColors, side: -1, variant: "sleeveShort", scale: k, transform: "translate(-40 -8)" }), jsxRuntime.jsx(arms.Arm, { colors: armColors, side: 1, variant: "sleeveShort", scale: k, transform: "translate(40 -8)" }), jsxRuntime.jsxs("g", { transform: "translate(0 -84)", children: [jsxRuntime.jsx(heads.NiceHead, { variant: character.face.variant, colors: character.face.colors, scale: k }), jsxRuntime.jsx(hair.Hair, { variant: character.hair.variant, colors: character.hair.colors, scale: k }), jsxRuntime.jsx(eyes.Eyes, { variant: character.eyes.variant, colors: character.eyes.colors, scale: k }), jsxRuntime.jsx(noses.Nose, { variant: character.nose.variant, colors: character.nose.colors, scale: k }), jsxRuntime.jsx(mouths.Mouth, { variant: character.mouth.variant, colors: character.mouth.colors, scale: k }), jsxRuntime.jsx(headwear.Headwear, { variant: character.headwear.variant, colors: character.headwear.colors, scale: k })] })] }) }));
|
|
29
29
|
};
|
|
30
|
-
/** @deprecated Use NiceBodyRenderer */
|
|
31
|
-
const BodyRenderer = NiceBodyRenderer;
|
|
32
30
|
|
|
33
|
-
exports.BodyRenderer = BodyRenderer;
|
|
34
31
|
exports.NiceBodyRenderer = NiceBodyRenderer;
|
|
35
32
|
exports.default = NiceBodyRenderer;
|
|
@@ -9,7 +9,7 @@ var RiggedBody = require('./RiggedBody.js');
|
|
|
9
9
|
var rigMath = require('./rigMath.js');
|
|
10
10
|
var rigTypes = require('./rigTypes.js');
|
|
11
11
|
|
|
12
|
-
const NiceRigPlayer = React.forwardRef(({ character, rig, pose, size, debug }, ref) => {
|
|
12
|
+
const NiceRigPlayer = /* @__PURE__ */ React.forwardRef(({ character, rig, pose, size, debug }, ref) => {
|
|
13
13
|
var _a;
|
|
14
14
|
const [current, setCurrent] = React.useState({ ...rigTypes.DEFAULT_POSE, ...(pose !== null && pose !== void 0 ? pose : {}) });
|
|
15
15
|
const r = rig !== null && rig !== void 0 ? rig : rigTypes.DEFAULT_RIG;
|
|
@@ -3,66 +3,78 @@
|
|
|
3
3
|
var rigTypes = require('./rigTypes.js');
|
|
4
4
|
|
|
5
5
|
/** Slim proportions preset. */
|
|
6
|
-
const RIG_SLIM = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
6
|
+
const RIG_SLIM = /* @__PURE__ */ (function () {
|
|
7
|
+
return {
|
|
8
|
+
...rigTypes.DEFAULT_RIG,
|
|
9
|
+
lUpperArm: { ...rigTypes.DEFAULT_RIG.lUpperArm, length: 0.11 },
|
|
10
|
+
lForearm: { ...rigTypes.DEFAULT_RIG.lForearm, length: 0.11 },
|
|
11
|
+
rUpperArm: { ...rigTypes.DEFAULT_RIG.rUpperArm, length: 0.11 },
|
|
12
|
+
rForearm: { ...rigTypes.DEFAULT_RIG.rForearm, length: 0.11 },
|
|
13
|
+
lThigh: { ...rigTypes.DEFAULT_RIG.lThigh, length: 0.14 },
|
|
14
|
+
lShin: { ...rigTypes.DEFAULT_RIG.lShin, length: 0.14 },
|
|
15
|
+
rThigh: { ...rigTypes.DEFAULT_RIG.rThigh, length: 0.14 },
|
|
16
|
+
rShin: { ...rigTypes.DEFAULT_RIG.rShin, length: 0.14 },
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
17
19
|
/** Broad shoulders preset. */
|
|
18
|
-
const RIG_HERO = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
20
|
+
const RIG_HERO = /* @__PURE__ */ (function () {
|
|
21
|
+
return {
|
|
22
|
+
...rigTypes.DEFAULT_RIG,
|
|
23
|
+
lShoulder: { ...rigTypes.DEFAULT_RIG.lShoulder, offset: [-0.13, 0] },
|
|
24
|
+
rShoulder: { ...rigTypes.DEFAULT_RIG.rShoulder, offset: [0.13, 0] },
|
|
25
|
+
lUpperArm: { ...rigTypes.DEFAULT_RIG.lUpperArm, length: 0.13 },
|
|
26
|
+
rUpperArm: { ...rigTypes.DEFAULT_RIG.rUpperArm, length: 0.13 },
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
25
29
|
/** Robot-like short limbs preset. */
|
|
26
|
-
const RIG_ROBOT = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
30
|
+
const RIG_ROBOT = /* @__PURE__ */ (function () {
|
|
31
|
+
return {
|
|
32
|
+
...rigTypes.DEFAULT_RIG,
|
|
33
|
+
lUpperArm: { ...rigTypes.DEFAULT_RIG.lUpperArm, length: 0.1 },
|
|
34
|
+
lForearm: { ...rigTypes.DEFAULT_RIG.lForearm, length: 0.1 },
|
|
35
|
+
rUpperArm: { ...rigTypes.DEFAULT_RIG.rUpperArm, length: 0.1 },
|
|
36
|
+
rForearm: { ...rigTypes.DEFAULT_RIG.rForearm, length: 0.1 },
|
|
37
|
+
lThigh: { ...rigTypes.DEFAULT_RIG.lThigh, length: 0.13 },
|
|
38
|
+
lShin: { ...rigTypes.DEFAULT_RIG.lShin, length: 0.13 },
|
|
39
|
+
rThigh: { ...rigTypes.DEFAULT_RIG.rThigh, length: 0.13 },
|
|
40
|
+
rShin: { ...rigTypes.DEFAULT_RIG.rShin, length: 0.13 },
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
37
43
|
/** Happy pose. */
|
|
38
|
-
const POSE_HAPPY = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const POSE_HAPPY = /* @__PURE__ */ (function () {
|
|
45
|
+
return {
|
|
46
|
+
...rigTypes.DEFAULT_POSE,
|
|
47
|
+
spineUpper: 80,
|
|
48
|
+
neck: 70,
|
|
49
|
+
head: 60,
|
|
50
|
+
lUpperArm: 60,
|
|
51
|
+
lForearm: 20,
|
|
52
|
+
rUpperArm: 120,
|
|
53
|
+
rForearm: 160,
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
48
56
|
/** Angry pose. */
|
|
49
|
-
const POSE_ANGRY = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
const POSE_ANGRY = /* @__PURE__ */ (function () {
|
|
58
|
+
return {
|
|
59
|
+
...rigTypes.DEFAULT_POSE,
|
|
60
|
+
head: 90,
|
|
61
|
+
lUpperArm: 150,
|
|
62
|
+
rUpperArm: 30,
|
|
63
|
+
lForearm: 160,
|
|
64
|
+
rForearm: 20,
|
|
65
|
+
};
|
|
66
|
+
})();
|
|
57
67
|
/** Dance pose A. */
|
|
58
|
-
const POSE_DANCE_A = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
const POSE_DANCE_A = /* @__PURE__ */ (function () {
|
|
69
|
+
return {
|
|
70
|
+
...rigTypes.DEFAULT_POSE,
|
|
71
|
+
pelvis: 100,
|
|
72
|
+
lThigh: 120,
|
|
73
|
+
rThigh: 70,
|
|
74
|
+
lUpperArm: 30,
|
|
75
|
+
rUpperArm: 150,
|
|
76
|
+
};
|
|
77
|
+
})();
|
|
66
78
|
|
|
67
79
|
exports.POSE_ANGRY = POSE_ANGRY;
|
|
68
80
|
exports.POSE_DANCE_A = POSE_DANCE_A;
|
|
@@ -67,11 +67,8 @@ const NiceHead = ({ variant, ...rest }) => {
|
|
|
67
67
|
const Comp = (_a = HEAD_RENDERERS[variant]) !== null && _a !== void 0 ? _a : HeadRound;
|
|
68
68
|
return jsxRuntime.jsx(Comp, { ...rest });
|
|
69
69
|
};
|
|
70
|
-
/** @deprecated Use NiceHead */
|
|
71
|
-
const Head = NiceHead;
|
|
72
70
|
|
|
73
71
|
exports.HEAD_RENDERERS = HEAD_RENDERERS;
|
|
74
|
-
exports.Head = Head;
|
|
75
72
|
exports.HeadChubby = HeadChubby;
|
|
76
73
|
exports.HeadDiamond = HeadDiamond;
|
|
77
74
|
exports.HeadHeart = HeadHeart;
|