@cyprnet/node-red-contrib-uibuilder-formgen 0.5.4 → 0.5.6

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 CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this package will be documented in this file.
4
4
 
5
+ ## 0.5.6
6
+
7
+ - Schema Builder: fixed saved-schema **load/delete selection** (was swapped due to index vs sorted list mismatch).
8
+
9
+ ## 0.5.5
10
+
11
+ - Dark mode: improved **result table readability** (light table background + black text).
12
+
5
13
  ## 0.5.4
6
14
 
7
15
  - Templates: reduced header-to-form spacing when using larger custom logos.
@@ -796,9 +796,9 @@ email{{currentField.keyvalueDelimiter || '='}}john@example.com</code></pre>
796
796
  <b-alert variant="info" show>
797
797
  <strong>Saved Schemas:</strong>
798
798
  <ul class="mb-0 mt-2" v-if="savedSchemas.length > 0">
799
- <li v-for="(saved, idx) in savedSchemas" :key="idx">
799
+ <li v-for="(saved, idx) in savedSchemas" :key="saved.name || idx">
800
800
  {{saved.name}} <small class="text-muted">({{saved.date}})</small>
801
- <b-button variant="link" size="sm" @click="deleteSavedSchema(idx)" class="p-0 ml-2 text-danger">
801
+ <b-button variant="link" size="sm" @click="deleteSavedSchema(saved.name)" class="p-0 ml-2 text-danger">
802
802
  <i class="fa fa-trash"></i>
803
803
  </b-button>
804
804
  </li>
@@ -173,7 +173,8 @@
173
173
 
174
174
  savedSchemaOptions() {
175
175
  return this.savedSchemas.map((s, idx) => ({
176
- value: idx,
176
+ // Use stable key (name) rather than index so sorting doesn't break selection
177
+ value: s.name,
177
178
  text: `${s.name} (${s.date})`
178
179
  }));
179
180
  },
@@ -1317,13 +1318,15 @@
1317
1318
  this.showAlertMessage('Failed to read saved schemas', 'danger');
1318
1319
  return;
1319
1320
  }
1320
-
1321
- if (this.selectedLoadSchema >= saved.length) {
1322
- this.showAlertMessage('Selected schema index is invalid', 'danger');
1321
+
1322
+ // Selected value is the schema name (stable), not an array index
1323
+ const selectedName = String(this.selectedLoadSchema || "").trim();
1324
+ if (!selectedName) {
1325
+ this.showAlertMessage('Please select a schema to load', 'warning');
1323
1326
  return;
1324
1327
  }
1325
-
1326
- const savedItem = saved[this.selectedLoadSchema];
1328
+
1329
+ const savedItem = saved.find(s => String(s && s.name ? s.name : "") === selectedName);
1327
1330
  if (!savedItem || !savedItem.schema) {
1328
1331
  this.showAlertMessage('Selected schema is invalid or corrupted', 'danger');
1329
1332
  return;
@@ -1364,10 +1367,17 @@
1364
1367
  this.selectedLoadSchema = null;
1365
1368
  },
1366
1369
 
1367
- deleteSavedSchema(idx) {
1370
+ deleteSavedSchema(name) {
1371
+ const schemaName = String(name || "").trim();
1372
+ if (!schemaName) return;
1368
1373
  if (confirm('Delete this saved schema?')) {
1369
1374
  try {
1370
1375
  const saved = JSON.parse(localStorage.getItem('portalsmith:savedSchemas') || '[]');
1376
+ const idx = saved.findIndex(s => String(s && s.name ? s.name : "") === schemaName);
1377
+ if (idx < 0) {
1378
+ this.showAlertMessage('Schema not found', 'warning');
1379
+ return;
1380
+ }
1371
1381
  saved.splice(idx, 1);
1372
1382
  localStorage.setItem('portalsmith:savedSchemas', JSON.stringify(saved));
1373
1383
  this.loadSavedSchemasList();
@@ -455,7 +455,7 @@ module.exports = function(RED) {
455
455
  await fs.writeJson(targetSchema, schema, { spaces: 2 });
456
456
 
457
457
  const runtimeData = {
458
- generatorVersion: "0.5.4",
458
+ generatorVersion: "0.5.5",
459
459
  generatorNode: "uibuilder-formgen-v3",
460
460
  timestamp: new Date().toISOString(),
461
461
  instanceName: instanceName,
@@ -484,7 +484,7 @@ module.exports = function(RED) {
484
484
 
485
485
  // Write runtime metadata
486
486
  const runtimeData = {
487
- generatorVersion: "0.5.4",
487
+ generatorVersion: "0.5.5",
488
488
  timestamp: new Date().toISOString(),
489
489
  instanceName: instanceName,
490
490
  storageMode: storageMode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyprnet/node-red-contrib-uibuilder-formgen",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "PortalSmith: Generate schema-driven uibuilder form portals from JSON",
5
5
  "keywords": [
6
6
  "node-red",
@@ -101,6 +101,24 @@
101
101
  border-color: var(--ps-border) !important;
102
102
  }
103
103
 
104
+ /* Dark mode readability: force result tables to light background + black text */
105
+ html[data-theme="dark"] .table,
106
+ html[data-theme="dark"] .table th,
107
+ html[data-theme="dark"] .table td {
108
+ background-color: #ffffff !important;
109
+ color: #000000 !important;
110
+ }
111
+ html[data-theme="dark"] .table thead th {
112
+ background-color: #f2f2f2 !important;
113
+ color: #000000 !important;
114
+ }
115
+ html[data-theme="dark"] .table-bordered,
116
+ html[data-theme="dark"] .table th,
117
+ html[data-theme="dark"] .table td,
118
+ html[data-theme="dark"] .table thead th {
119
+ border-color: rgba(0,0,0,0.15) !important;
120
+ }
121
+
104
122
  .form-control,
105
123
  .custom-select {
106
124
  background-color: var(--ps-input-bg);
@@ -86,6 +86,24 @@
86
86
  border-color: var(--ps-border) !important;
87
87
  }
88
88
 
89
+ /* Dark mode readability: force result tables to light background + black text */
90
+ html[data-theme="dark"] .table,
91
+ html[data-theme="dark"] .table th,
92
+ html[data-theme="dark"] .table td {
93
+ background-color: #ffffff !important;
94
+ color: #000000 !important;
95
+ }
96
+ html[data-theme="dark"] .table thead th {
97
+ background-color: #f2f2f2 !important;
98
+ color: #000000 !important;
99
+ }
100
+ html[data-theme="dark"] .table-bordered,
101
+ html[data-theme="dark"] .table th,
102
+ html[data-theme="dark"] .table td,
103
+ html[data-theme="dark"] .table thead th {
104
+ border-color: rgba(0,0,0,0.15) !important;
105
+ }
106
+
89
107
  .form-control,
90
108
  .form-select {
91
109
  background-color: var(--ps-input-bg);