@nebularstreams/libmui 3.1.0 → 3.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +48 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nebularstreams/libmui",
3
3
  "description": "Lightweight, high-performance Mithril widget library for modern websites and JavaScript applications.",
4
- "version": "3.1.0",
4
+ "version": "3.1.1",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
package/readme.md CHANGED
@@ -273,6 +273,54 @@ m(SmileysButton, {
273
273
 
274
274
  The current `icon` may contain an `icon` field for a Font Awesome symbol, a `glyph` field for an emoji, or both. This widget uses `MainState` to open the `emoji` application panel, so that panel must be registered by the host application.
275
275
 
276
+ #### Optional emoji picker package
277
+
278
+ Install `@nebularstreams/libmui-extensions` when your application needs a ready-made emoji picker:
279
+
280
+ ```bash
281
+ npm install @nebularstreams/libmui-extensions
282
+ ```
283
+
284
+ The optional package provides `SmileysWidget`, a searchable picker organized into emoji categories. It can also include Font Awesome symbols and remembers selected emoji as favorites during the current session.
285
+
286
+ ```js
287
+ import m from "mithril";
288
+ import {SmileysWidget} from "@nebularstreams/libmui-extensions";
289
+
290
+ m(SmileysWidget, {
291
+ icons: true,
292
+ onClick: (glyph, item) => {
293
+ state.marker = {
294
+ glyph,
295
+ icon: item.icon,
296
+ name: item.name
297
+ };
298
+ }
299
+ });
300
+ ```
301
+
302
+ | Attribute | Description |
303
+ | --- | --- |
304
+ | `onClick(glyph, item)` | Called with the selected character and its metadata. |
305
+ | `icons` | Includes Font Awesome symbols alongside emoji. |
306
+ | `noemojis` | Hides emoji and shows only the optional icon set. |
307
+ | `horizontal` | Places the category navigation above the picker instead of beside it. |
308
+ | `mainclass` | Replaces the picker's default root class. |
309
+
310
+ The package also exports `SmileysPanel`, which wraps the picker in a horizontal panel with a title bar and optional back action:
311
+
312
+ ```js
313
+ import {SmileysPanel} from "@nebularstreams/libmui-extensions";
314
+
315
+ m(SmileysPanel, {
316
+ icons: true,
317
+ onClick: (glyph, item) => selectMarker(glyph, item),
318
+ onClose: closePicker
319
+ });
320
+ ```
321
+
322
+ Use `SmileysWidget` when embedding the picker in your own layout. Use `SmileysPanel` when you want a complete application panel. The extension package is optional; the rest of LibMui does not require it.
323
+
276
324
  ### `Selector`
277
325
 
278
326
  Builds a toolbar that switches between complete Mithril components.