@stamprally/admin-ui 0.13.0 → 0.15.0

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @stamprally/admin-ui
1
+ # @stamprally/admin-ui v0.15.0
2
2
 
3
3
  Accessible authoring forms and a headless editor for rally management screens.
4
4
 
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
+ "use client";
1
2
  'use strict';
2
3
 
3
4
  var core = require('@stamprally/core');
4
5
  var react = require('react');
5
6
  var jsxRuntime = require('react/jsx-runtime');
6
7
 
7
- // src/index.tsx
8
8
  function nextEntityId(prefix, ids) {
9
9
  let index = ids.size + 1;
10
10
  let candidate = `${prefix}-${index}`;
@@ -1185,18 +1185,97 @@ function GeneralSettingsForm({
1185
1185
  dictionary
1186
1186
  }) {
1187
1187
  const activeLocale = locale ?? "en";
1188
- return /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1189
- text(dictionary, activeLocale, "title", "Rally title"),
1190
- /* @__PURE__ */ jsxRuntime.jsx(
1191
- "input",
1192
- {
1193
- value: core.resolveLocalizedText(config.title, activeLocale),
1194
- onChange: (event) => onChange({
1195
- ...config,
1196
- title: core.updateLocalizedField(config.title, activeLocale, event.target.value)
1197
- })
1198
- }
1199
- )
1188
+ return /* @__PURE__ */ jsxRuntime.jsxs("section", { "aria-label": text(dictionary, activeLocale, "generalSettings", "General settings"), children: [
1189
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1190
+ text(dictionary, activeLocale, "title", "Rally title"),
1191
+ /* @__PURE__ */ jsxRuntime.jsx(
1192
+ "input",
1193
+ {
1194
+ value: core.resolveLocalizedText(config.title, activeLocale),
1195
+ onChange: (event) => onChange({
1196
+ ...config,
1197
+ title: core.updateLocalizedField(config.title, activeLocale, event.target.value)
1198
+ })
1199
+ }
1200
+ )
1201
+ ] }),
1202
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1203
+ text(dictionary, activeLocale, "inventoryLimit", "Global inventory limit"),
1204
+ /* @__PURE__ */ jsxRuntime.jsx(
1205
+ "input",
1206
+ {
1207
+ type: "number",
1208
+ min: 0,
1209
+ placeholder: text(dictionary, activeLocale, "inventoryLimitPlaceholder", "Unlimited"),
1210
+ title: text(
1211
+ dictionary,
1212
+ activeLocale,
1213
+ "inventoryOverrideHelp",
1214
+ "Individual reward limits override this global limit."
1215
+ ),
1216
+ value: config.inventory?.global ?? "",
1217
+ onChange: (event) => {
1218
+ const value = event.target.value;
1219
+ const inventory = { ...config.inventory ?? {} };
1220
+ if (value === "") delete inventory.global;
1221
+ else inventory.global = Number(value);
1222
+ onChange({ ...config, inventory });
1223
+ }
1224
+ }
1225
+ )
1226
+ ] }),
1227
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1228
+ text(dictionary, activeLocale, "inventoryMode", "Inventory aggregation"),
1229
+ /* @__PURE__ */ jsxRuntime.jsxs(
1230
+ "select",
1231
+ {
1232
+ value: config.inventoryMode ?? "shared",
1233
+ title: text(
1234
+ dictionary,
1235
+ activeLocale,
1236
+ "inventoryModeHelp",
1237
+ "Individual reward limits override this setting."
1238
+ ),
1239
+ onChange: (event) => onChange({
1240
+ ...config,
1241
+ inventoryMode: event.target.value
1242
+ }),
1243
+ children: [
1244
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "shared", children: text(dictionary, activeLocale, "inventoryShared", "Shared") }),
1245
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "per_reward", children: text(dictionary, activeLocale, "inventoryPerReward", "Per reward") })
1246
+ ]
1247
+ }
1248
+ )
1249
+ ] }),
1250
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
1251
+ text(dictionary, activeLocale, "staffPasscode", "Global staff passcode"),
1252
+ /* @__PURE__ */ jsxRuntime.jsx(
1253
+ "input",
1254
+ {
1255
+ type: "password",
1256
+ placeholder: text(
1257
+ dictionary,
1258
+ activeLocale,
1259
+ "staffPasscodePlaceholder",
1260
+ "Used unless a reward has its own passcode"
1261
+ ),
1262
+ title: text(
1263
+ dictionary,
1264
+ activeLocale,
1265
+ "staffPasscodeHelp",
1266
+ "Individual spot or reward settings override this global passcode."
1267
+ ),
1268
+ value: config.staffPasscode ?? "",
1269
+ onChange: (event) => {
1270
+ const value = event.target.value;
1271
+ if (value === "") {
1272
+ const { staffPasscode: _staffPasscode, ...withoutPasscode } = config;
1273
+ onChange(withoutPasscode);
1274
+ } else onChange({ ...config, staffPasscode: value });
1275
+ }
1276
+ }
1277
+ )
1278
+ ] })
1200
1279
  ] });
1201
1280
  }
1202
1281
  function JsonConfigIO({ config, onImport, locale, dictionary }) {