@aglyn/shared-data-enums 1.0.0-beta.143 → 1.0.0-beta.144

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/README.md +56 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,3 +1,57 @@
1
- # shared-data-enums
1
+ # @aglyn/shared-data-enums
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ Constants, enums and small pure helpers shared across the Aglyn packages: HTTP codes, CSS value parsing, palette-token CSS variables, MUI `sx` alias expansion, icon constants and environment flags. It is mainly a dependency of the larger `@aglyn/*` packages, and the helpers are usable on their own.
4
+
5
+ > Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
6
+
7
+ ## Install
8
+
9
+ npm install @aglyn/shared-data-enums@beta
10
+
11
+ Peer dependency: `firebase`. The `firebase-auth` module imports error codes and types from `firebase/auth`, and the root entry re-exports that module.
12
+
13
+ ## What's in it
14
+
15
+ The root entry re-exports every module below. Each is also importable on its own as `@aglyn/shared-data-enums/<module>`.
16
+
17
+ - `http` — the `HttpStatusCode`, `HttpRequestMethod` and `HttpResponseStatus` enums, the `HttpRefCode*` enums and `createHttpRefCode`.
18
+ - `styles` — `CssUnit`, `parseCssDimension` / `buildCssDimension`, `parseCssGradient` / `buildCssGradient`, `isCssGradientValue`, `describeCssColorProblem`, `parseCssMeasurement` / `buildCssMeasurement`. Values a parser cannot model come back as `raw` and serialize unchanged.
19
+ - `palette-token-css-var` (re-exported through `styles`) — converts between a palette token path and its `var(--mui-palette-…)` form: `paletteTokenToCssVar`, `parsePaletteTokenCssVar`, `paletteTokenToAlphaCssVar`, `cssColorToChannel` and related functions.
20
+ - `sx-property-aliases` — `SX_PROPERTY_ALIASES`, `expandSxAliases`, `isSxAliasProperty`, `canonicalSxProperties`, `sxAliasesFor`.
21
+ - `breakpoint-span` — `SPAN_BREAKPOINTS`, `parseBreakpointSpan`, `buildBreakpointSpan`.
22
+ - `data-table` — helpers for a rows-of-strings table value: `parseDataTableRows`, `serializeDataTable`, `readPastedDataTable`, `withRowAdded`, `withColumnAdded`, `withCellSet` and their counterparts.
23
+ - `icons` — `ICON_VARIANT_*` constants, each an icon object from `@aglyn/shared-data-mdi`.
24
+ - `firebase-auth` — `AuthAppErrorCodes`, `AuthErrorMessage`, `AuthErrorNotice`, `AuthErrorIgnore` and the related types.
25
+ - `global` — flags read from `process.env` (`IS_PRODUCTION`, `IS_DEVELOPMENT`, `IS_TEST`, `PACKAGE_VERSION`, the Firebase emulator flags) and `HAS_WINDOW` / `HAS_DOCUMENT`.
26
+ - `aglyn`, `aglyn-applications` — Aglyn's own brand and application name constants (`BRAND`, `PRODUCT_NAME`, `APP_CONSOLE`, `APP_TENANT`, `APP_WWW`).
27
+
28
+ ## Usage
29
+
30
+ ```ts
31
+ import {
32
+ CssUnit,
33
+ HttpStatusCode,
34
+ buildCssDimension,
35
+ parseCssDimension,
36
+ } from '@aglyn/shared-data-enums'
37
+
38
+ parseCssDimension('12px') // { value: 12, unit: CssUnit.PIXELS }
39
+ parseCssDimension('calc(100% - 2rem)') // { raw: 'calc(100% - 2rem)' }
40
+ buildCssDimension({ value: 1.5, unit: CssUnit.EM }) // '1.5em'
41
+
42
+ HttpStatusCode.OK // 200
43
+ ```
44
+
45
+ A single module, without the rest of the barrel:
46
+
47
+ ```ts
48
+ import { expandSxAliases } from '@aglyn/shared-data-enums/sx-property-aliases'
49
+ ```
50
+
51
+ ## How it fits
52
+
53
+ A `shared` data package. It depends only on other shared packages (`@aglyn/shared-data-mdi`, `@aglyn/shared-util-tools`), and the core (`@aglyn/aglyn`), tenant, Besigner and plugin packages depend on it. Shared packages are generic: they import only other shared packages and hold no plugin's domain.
54
+
55
+ ## License
56
+
57
+ Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/shared/data/enums
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/shared-data-enums",
3
- "version": "1.0.0-beta.143",
3
+ "version": "1.0.0-beta.144",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,8 +25,8 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/shared-data-mdi": "1.0.0-beta.143",
29
- "@aglyn/shared-util-tools": "1.0.0-beta.143",
28
+ "@aglyn/shared-data-mdi": "1.0.0-beta.144",
29
+ "@aglyn/shared-util-tools": "1.0.0-beta.144",
30
30
  "@swc/helpers": "0.5.23"
31
31
  },
32
32
  "peerDependencies": {