@nice2dev/admin 1.1.6 → 1.1.7
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 +48 -0
- package/dist/index.mjs +49 -27
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# @nice2dev/admin — Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Close the three items left open in the 1.1.6 response to OmniVerk.
|
|
8
|
+
|
|
9
|
+
**Every value control works without state in the parent.** The `audit-controllable-state` gate
|
|
10
|
+
counted 87 value props that were required with no `default*`, so the control could not render from a
|
|
11
|
+
manifest without data. It now reports 0 and gates CI at `--max=0`. 48 controls gained `default*` props
|
|
12
|
+
through `useControllableState` (existing `value` + handler call sites behave as before); 33 read-only
|
|
13
|
+
data lists are optional with a stable empty default; 4 props paired with a handler only by name are
|
|
14
|
+
optional; `NiceWhiteboard` and `NiceMetricsDashboard` render an empty state until a session or
|
|
15
|
+
dashboard arrives. Additive API only — nothing renamed or removed.
|
|
16
|
+
|
|
17
|
+
- `NicePivotGrid.fields`, `NiceScheduler.events` and `NiceGitHooks.hooks` are controlled only together
|
|
18
|
+
with their change handler, as `NiceScheduler` already documented for `currentDate`/`view`. A bare
|
|
19
|
+
prop stays an initial value; prop plus handler now always wins (later prop updates used to be
|
|
20
|
+
ignored). `NiceGitHooks.onHookChange` is now called; `onHooksChange` and
|
|
21
|
+
`NiceLocaleManager.onTranslationsChange` are new.
|
|
22
|
+
- `NiceCodeEditor` / `NiceCodeDiffEditor` no longer report a value written from the prop back through
|
|
23
|
+
`onChange`, and call the latest handler rather than the one captured at mount.
|
|
24
|
+
- `NiceHtmlEditor` no longer rewrites its content on every render (React 19 compares the
|
|
25
|
+
`dangerouslySetInnerHTML` object, not its string), which moved the caret; the HTML source and
|
|
26
|
+
Markdown views can be closed again.
|
|
27
|
+
- Selections seeded once from the first item (access manager, automation/scene editors, git diff
|
|
28
|
+
viewer, ribbon, setup wizard) follow data that arrives after mount.
|
|
29
|
+
- `useControllableState`: new `fallbackValue` seed that never triggers the value/default clash warning;
|
|
30
|
+
two functional updates in one tick no longer lose the first; `onChange` is called with one argument
|
|
31
|
+
when there is no meta. `UseControllableStateOptions` is now a union type alias.
|
|
32
|
+
|
|
33
|
+
**`--nice-*` is the source of truth for design tokens.** Controls read only `--nice-*` (9,225 reads in
|
|
34
|
+
339 files). The unprefixed names (`--color-primary`, `--bg-primary`, `--text-muted`, …) stay declared
|
|
35
|
+
as aliases pointing at the Nice tokens, so reading them works, but setting them no longer repaints Nice
|
|
36
|
+
controls. Apps that relied on that can import `@nice2dev/ui/css/legacy-bg-text-aliases.css` after
|
|
37
|
+
`style.css` (removed in 1.2), or set `--nice-color-primary` and friends directly. 13 tokens that were
|
|
38
|
+
read and never declared (`--color-danger`, `--text-on-primary`, `--color-white`, …) are defined; the
|
|
39
|
+
dark blocks define the canonical names, so `.nice-dark` on `<body>` no longer leaves them on light
|
|
40
|
+
values; `--nice-primary-bg` and `--nice-selected-bg` are a primary tint instead of falling through to
|
|
41
|
+
grey. New gate `audit-token-names`.
|
|
42
|
+
|
|
43
|
+
**Node ESM and `require()`.** `@nice2dev/spatial-core` imports from plain Node ESM (51 relative
|
|
44
|
+
specifiers gained extensions, enforced by `nodenext`), and so does `@nice2dev/ui-buildings`, which
|
|
45
|
+
failed through it. `require()` works for `ui-3d`, `ui-graphics` and `game-engine`. The package-exports
|
|
46
|
+
gate now loads every entry in both module systems.
|
|
47
|
+
|
|
48
|
+
**Hygiene.** Sources are prettier-formatted and CI gates on it; 640 stale `.d.ts` files were removed
|
|
49
|
+
from source trees (never published).
|
|
50
|
+
|
|
3
51
|
## 1.1.6
|
|
4
52
|
|
|
5
53
|
No changes in this release.
|
package/dist/index.mjs
CHANGED
|
@@ -1026,7 +1026,9 @@ const M = {
|
|
|
1026
1026
|
),
|
|
1027
1027
|
[u, S]
|
|
1028
1028
|
), o = D(
|
|
1029
|
-
() => [..._].sort(
|
|
1029
|
+
() => [..._].sort(
|
|
1030
|
+
(t, E) => new Date(E.timestamp).getTime() - new Date(t.timestamp).getTime()
|
|
1031
|
+
),
|
|
1030
1032
|
[_]
|
|
1031
1033
|
), L = D(() => {
|
|
1032
1034
|
const t = u.filter((I) => I.active).length, E = u.reduce((I, B) => I + B.tripCount, 0), R = _.filter((I) => I.severity === "critical").length;
|
|
@@ -1091,12 +1093,19 @@ const M = {
|
|
|
1091
1093
|
}
|
|
1092
1094
|
),
|
|
1093
1095
|
/* @__PURE__ */ e("select", { value: a, onChange: (t) => s(t.target.value), children: Object.entries(H).map(([t, E]) => /* @__PURE__ */ e("option", { value: t, children: E }, t)) }),
|
|
1094
|
-
/* @__PURE__ */ n(
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1096
|
+
/* @__PURE__ */ n(
|
|
1097
|
+
"select",
|
|
1098
|
+
{
|
|
1099
|
+
value: d,
|
|
1100
|
+
onChange: (t) => r(t.target.value),
|
|
1101
|
+
children: [
|
|
1102
|
+
/* @__PURE__ */ e("option", { value: "low", children: "Low" }),
|
|
1103
|
+
/* @__PURE__ */ e("option", { value: "medium", children: "Medium" }),
|
|
1104
|
+
/* @__PURE__ */ e("option", { value: "high", children: "High" }),
|
|
1105
|
+
/* @__PURE__ */ e("option", { value: "critical", children: "Critical" })
|
|
1106
|
+
]
|
|
1107
|
+
}
|
|
1108
|
+
),
|
|
1100
1109
|
/* @__PURE__ */ e(
|
|
1101
1110
|
"input",
|
|
1102
1111
|
{
|
|
@@ -1125,26 +1134,39 @@ const M = {
|
|
|
1125
1134
|
/* @__PURE__ */ e("th", { children: "Status" }),
|
|
1126
1135
|
/* @__PURE__ */ e("th", { children: "Actions" })
|
|
1127
1136
|
] }) }),
|
|
1128
|
-
/* @__PURE__ */ e("tbody", { children: w.map((t) => /* @__PURE__ */ n(
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1137
|
+
/* @__PURE__ */ e("tbody", { children: w.map((t) => /* @__PURE__ */ n(
|
|
1138
|
+
"tr",
|
|
1139
|
+
{
|
|
1140
|
+
className: t.tripCount > 0 ? "nice-honey-token-dashboard__row--tripped" : "",
|
|
1141
|
+
children: [
|
|
1142
|
+
/* @__PURE__ */ e("td", { children: t.name }),
|
|
1143
|
+
/* @__PURE__ */ e("td", { children: H[t.type] }),
|
|
1144
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1145
|
+
"span",
|
|
1146
|
+
{
|
|
1147
|
+
className: "nice-honey-token-dashboard__severity",
|
|
1148
|
+
style: { color: M[t.severity] },
|
|
1149
|
+
children: t.severity
|
|
1150
|
+
}
|
|
1151
|
+
) }),
|
|
1152
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: t.location }) }),
|
|
1153
|
+
/* @__PURE__ */ e("td", { children: t.tripCount }),
|
|
1154
|
+
/* @__PURE__ */ e("td", { children: t.lastTripped ?? "—" }),
|
|
1155
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1156
|
+
"span",
|
|
1157
|
+
{
|
|
1158
|
+
className: `nice-honey-token-dashboard__status--${t.active ? "active" : "inactive"}`,
|
|
1159
|
+
children: t.active ? "Active" : "Inactive"
|
|
1160
|
+
}
|
|
1161
|
+
) }),
|
|
1162
|
+
/* @__PURE__ */ n("td", { children: [
|
|
1163
|
+
y && /* @__PURE__ */ e("button", { onClick: () => y(t.id, !t.active), children: t.active ? "Disable" : "Enable" }),
|
|
1164
|
+
g && /* @__PURE__ */ e("button", { onClick: () => g(t.id), children: "Delete" })
|
|
1165
|
+
] })
|
|
1166
|
+
]
|
|
1167
|
+
},
|
|
1168
|
+
t.id
|
|
1169
|
+
)) })
|
|
1148
1170
|
] })
|
|
1149
1171
|
] }),
|
|
1150
1172
|
o.length > 0 && /* @__PURE__ */ n("div", { className: "nice-honey-token-dashboard__events", children: [
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.nice-admin-users__header{display:flex;align-items:center;gap:var(--nice-space-3);margin-bottom:var(--nice-space-3)}.nice-admin-users__count{font-size:var(--nice-font-size-sm);color:var(--nice-color-text-muted, currentColor);opacity:.7}.nice-admin-users__toolbar{display:flex;align-items:center;gap:var(--nice-space-2);flex-wrap:wrap}.nice-admin-users__user-cell{display:inline-flex;align-items:center;gap:var(--nice-space-2)}.nice-admin-users__roles{display:inline-flex;align-items:center;gap:var(--nice-space-1);flex-wrap:wrap}.nice-admin-users__status-badge--toggle{-moz-appearance:none;appearance:none;-webkit-appearance:none;background:transparent;border:0;padding:0;margin:0;cursor:pointer;font:inherit;color:inherit;border-radius:var(--nice-radius-full)}.nice-admin-users__status-badge--toggle:focus-visible{outline:none;box-shadow:var(--nice-focus-ring, 0 0 0 2px currentColor)}.nice-admin-users__actions{display:inline-flex;align-items:center;justify-content:flex-end;gap:var(--nice-space-1)}.nice-admin-roles{display:flex;flex-direction:column;gap:var(--nice-space-4, 1rem)}.nice-admin-roles__header{display:flex;align-items:center;justify-content:space-between;gap:var(--nice-space-3, .75rem)}.nice-admin-roles__header h3{margin:0;font-size:var(--nice-font-size-lg, 1.125rem);font-weight:var(--nice-font-weight-semibold, 600);color:var(--text-primary)}.nice-admin-roles__name-cell{display:inline-flex;align-items:center;gap:var(--nice-space-2, .5rem)}.nice-admin-roles__color-dot{width:.625rem;height:.625rem;border-radius:var(--nice-radius-full, 9999px);flex:0 0 auto;box-shadow:0 0 0 1px var(--border-color, rgba(0, 0, 0, .12))}.nice-admin-roles__system-icon{color:var(--text-muted, #6b7280)}.nice-admin-roles__create-form{display:flex;flex-wrap:wrap;align-items:center;gap:var(--nice-space-2, .5rem);padding:var(--nice-space-3, .75rem);background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:var(--nice-radius-md, 6px)}.nice-admin-roles__create-form input{padding:var(--nice-space-1-5, 6px) var(--nice-space-2, 8px);border:1px solid var(--border-color);border-radius:var(--nice-radius-sm, 4px);background:var(--bg-primary);color:var(--text-primary);font:inherit}.nice-admin-roles__matrix-wrap{padding:var(--nice-space-4, 1rem);background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:var(--nice-radius-md, 6px);overflow-x:auto}.nice-admin-roles__description{margin:0 0 var(--nice-space-3, .75rem);color:var(--text-secondary);font-size:var(--nice-font-size-sm, .875rem)}.nice-admin-roles__matrix{width:100%;border-collapse:collapse;font-size:var(--nice-font-size-sm, .875rem)}.nice-admin-roles__matrix th,.nice-admin-roles__matrix td{padding:var(--nice-space-1-5, 6px) var(--nice-space-2, 8px);border-bottom:1px solid var(--border-color);text-align:center;color:var(--text-primary)}.nice-admin-roles__matrix th:first-child,.nice-admin-roles__matrix td:first-child{text-align:left}.nice-admin-roles__matrix th{color:var(--text-secondary);font-weight:var(--nice-font-weight-semibold, 600)}.nice-admin-roles__role-actions{display:flex;gap:var(--nice-space-2, .5rem);margin-top:var(--nice-space-3, .75rem)}.nice-admin-roles button:not(.nice-btn){padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);border:1px solid var(--border-color);border-radius:var(--nice-radius-sm, 4px);background:var(--bg-primary);color:var(--text-primary);font:inherit;cursor:pointer}.nice-admin-roles button:not(.nice-btn):hover{background:var(--hover-bg, var(--bg-tertiary))}.nice-admin-roles button:not(.nice-btn):disabled{opacity:.5;cursor:not-allowed}.nice-admin-notifications{display:flex;flex-direction:column;gap:var(--nice-space-4, 1rem)}.nice-admin-notifications__header{display:flex;align-items:center;justify-content:space-between;gap:var(--nice-space-3, .75rem)}.nice-admin-notifications__header h3{margin:0;font-size:var(--nice-font-size-lg, 1.125rem);font-weight:var(--nice-font-weight-semibold, 600);color:var(--text-primary)}.nice-admin-notifications__name{display:flex;flex-direction:column;gap:2px}.nice-admin-notifications__description{color:var(--text-secondary);font-size:var(--nice-font-size-xs, .75rem)}.nice-admin-notifications__actions{display:inline-flex;gap:var(--nice-space-1-5, 6px)}.nice-admin-notifications button:not(.nice-btn){padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);border:1px solid var(--border-color);border-radius:var(--nice-radius-sm, 4px);background:var(--bg-primary);color:var(--text-primary);font:inherit;font-size:var(--nice-font-size-sm, .875rem);cursor:pointer}.nice-admin-notifications button:not(.nice-btn):hover{background:var(--hover-bg, var(--bg-tertiary))}.nice-admin-notifications__create{font-weight:var(--nice-font-weight-medium, 500)}
|
|
1
|
+
.nice-admin-users__header{display:flex;align-items:center;gap:var(--nice-space-3);margin-bottom:var(--nice-space-3)}.nice-admin-users__count{font-size:var(--nice-font-size-sm);color:var(--nice-color-text-muted, currentColor);opacity:.7}.nice-admin-users__toolbar{display:flex;align-items:center;gap:var(--nice-space-2);flex-wrap:wrap}.nice-admin-users__user-cell{display:inline-flex;align-items:center;gap:var(--nice-space-2)}.nice-admin-users__roles{display:inline-flex;align-items:center;gap:var(--nice-space-1);flex-wrap:wrap}.nice-admin-users__status-badge--toggle{-moz-appearance:none;appearance:none;-webkit-appearance:none;background:transparent;border:0;padding:0;margin:0;cursor:pointer;font:inherit;color:inherit;border-radius:var(--nice-radius-full)}.nice-admin-users__status-badge--toggle:focus-visible{outline:none;box-shadow:var(--nice-focus-ring, 0 0 0 2px currentColor)}.nice-admin-users__actions{display:inline-flex;align-items:center;justify-content:flex-end;gap:var(--nice-space-1)}.nice-admin-roles{display:flex;flex-direction:column;gap:var(--nice-space-4, 1rem)}.nice-admin-roles__header{display:flex;align-items:center;justify-content:space-between;gap:var(--nice-space-3, .75rem)}.nice-admin-roles__header h3{margin:0;font-size:var(--nice-font-size-lg, 1.125rem);font-weight:var(--nice-font-weight-semibold, 600);color:var(--nice-text-primary)}.nice-admin-roles__name-cell{display:inline-flex;align-items:center;gap:var(--nice-space-2, .5rem)}.nice-admin-roles__color-dot{width:.625rem;height:.625rem;border-radius:var(--nice-radius-full, 9999px);flex:0 0 auto;box-shadow:0 0 0 1px var(--nice-border-color, rgba(0, 0, 0, .12))}.nice-admin-roles__system-icon{color:var(--nice-text-muted, #6b7280)}.nice-admin-roles__create-form{display:flex;flex-wrap:wrap;align-items:center;gap:var(--nice-space-2, .5rem);padding:var(--nice-space-3, .75rem);background:var(--nice-bg-secondary);border:1px solid var(--nice-border-color);border-radius:var(--nice-radius-md, 6px)}.nice-admin-roles__create-form input{padding:var(--nice-space-1-5, 6px) var(--nice-space-2, 8px);border:1px solid var(--nice-border-color);border-radius:var(--nice-radius-sm, 4px);background:var(--nice-bg-primary);color:var(--nice-text-primary);font:inherit}.nice-admin-roles__matrix-wrap{padding:var(--nice-space-4, 1rem);background:var(--nice-bg-secondary);border:1px solid var(--nice-border-color);border-radius:var(--nice-radius-md, 6px);overflow-x:auto}.nice-admin-roles__description{margin:0 0 var(--nice-space-3, .75rem);color:var(--nice-text-secondary);font-size:var(--nice-font-size-sm, .875rem)}.nice-admin-roles__matrix{width:100%;border-collapse:collapse;font-size:var(--nice-font-size-sm, .875rem)}.nice-admin-roles__matrix th,.nice-admin-roles__matrix td{padding:var(--nice-space-1-5, 6px) var(--nice-space-2, 8px);border-bottom:1px solid var(--nice-border-color);text-align:center;color:var(--nice-text-primary)}.nice-admin-roles__matrix th:first-child,.nice-admin-roles__matrix td:first-child{text-align:left}.nice-admin-roles__matrix th{color:var(--nice-text-secondary);font-weight:var(--nice-font-weight-semibold, 600)}.nice-admin-roles__role-actions{display:flex;gap:var(--nice-space-2, .5rem);margin-top:var(--nice-space-3, .75rem)}.nice-admin-roles button:not(.nice-btn){padding:var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);border:1px solid var(--nice-border-color);border-radius:var(--nice-radius-sm, 4px);background:var(--nice-bg-primary);color:var(--nice-text-primary);font:inherit;cursor:pointer}.nice-admin-roles button:not(.nice-btn):hover{background:var(--nice-hover-bg, var(--nice-bg-tertiary))}.nice-admin-roles button:not(.nice-btn):disabled{opacity:.5;cursor:not-allowed}.nice-admin-notifications{display:flex;flex-direction:column;gap:var(--nice-space-4, 1rem)}.nice-admin-notifications__header{display:flex;align-items:center;justify-content:space-between;gap:var(--nice-space-3, .75rem)}.nice-admin-notifications__header h3{margin:0;font-size:var(--nice-font-size-lg, 1.125rem);font-weight:var(--nice-font-weight-semibold, 600);color:var(--nice-text-primary)}.nice-admin-notifications__name{display:flex;flex-direction:column;gap:2px}.nice-admin-notifications__description{color:var(--nice-text-secondary);font-size:var(--nice-font-size-xs, .75rem)}.nice-admin-notifications__actions{display:inline-flex;gap:var(--nice-space-1-5, 6px)}.nice-admin-notifications button:not(.nice-btn){padding:var(--nice-space-1, 4px) var(--nice-space-2, 8px);border:1px solid var(--nice-border-color);border-radius:var(--nice-radius-sm, 4px);background:var(--nice-bg-primary);color:var(--nice-text-primary);font:inherit;font-size:var(--nice-font-size-sm, .875rem);cursor:pointer}.nice-admin-notifications button:not(.nice-btn):hover{background:var(--nice-hover-bg, var(--nice-bg-tertiary))}.nice-admin-notifications__create{font-weight:var(--nice-font-weight-medium, 500)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/admin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Nice2Dev Admin — Dashboard, user management, roles, audit log, settings, feature flags, import/export for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-dom": ">=17.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@nice2dev/ui": "^1.1.
|
|
66
|
+
"@nice2dev/ui": "^1.1.7",
|
|
67
67
|
"@testing-library/jest-dom": "^7.0.1",
|
|
68
68
|
"@testing-library/react": "^16.3.3",
|
|
69
69
|
"@types/react": "^19.2.18",
|