pict-section-formeditor 1.0.0 → 1.0.2

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "Generated": "2026-02-22T22:01:46.339Z",
2
+ "Generated": "2026-02-23T01:20:17.038Z",
3
3
  "GitHubOrg": "stevenvelozo",
4
4
  "DefaultBranch": "master",
5
5
  "Groups": [
@@ -20,6 +20,25 @@
20
20
  }
21
21
  ]
22
22
  },
23
+ {
24
+ "Name": "Docs",
25
+ "Key": "docs",
26
+ "Description": "",
27
+ "Modules": [
28
+ {
29
+ "Name": "css",
30
+ "Repo": "css",
31
+ "Group": "docs",
32
+ "Branch": "master",
33
+ "HasDocs": true,
34
+ "HasCover": false,
35
+ "Sidebar": [],
36
+ "DocFiles": [
37
+ "css/docuserve.css"
38
+ ]
39
+ }
40
+ ]
41
+ },
23
42
  {
24
43
  "Name": "Example_applications",
25
44
  "Key": "example_applications",
@@ -1,5 +1,5 @@
1
1
  {
2
- "Generated": "2026-02-22T22:01:46.522Z",
2
+ "Generated": "2026-02-23T01:20:17.230Z",
3
3
  "DocumentCount": 137,
4
4
  "LunrIndex": {
5
5
  "version": "2.3.9",
@@ -61,6 +61,13 @@ class FormEditorExampleApplication extends libPictApplication
61
61
  this._FormEditorView.initialize();
62
62
  this._FormEditorView.render();
63
63
 
64
+ // Wire up the import event to add extra manifests to the selector
65
+ let tmpSelf = this;
66
+ this._FormEditorView.onImport = function(pManifests, pFileName)
67
+ {
68
+ tmpSelf._handleImportedManifests(pManifests, pFileName);
69
+ };
70
+
64
71
  // Render the selector bar
65
72
  this.renderSelector();
66
73
 
@@ -147,6 +154,14 @@ class FormEditorExampleApplication extends libPictApplication
147
154
 
148
155
  let tmpEntry = this._ManifestList[pIndex];
149
156
 
157
+ if (tmpEntry.ManifestData)
158
+ {
159
+ // Directly loaded manifest (e.g. from CSV import)
160
+ this.pict.AppData.FormConfig = tmpEntry.ManifestData;
161
+ this._refreshEditor();
162
+ return;
163
+ }
164
+
150
165
  if (!tmpEntry.File)
151
166
  {
152
167
  // "New Form" — empty manifest
@@ -188,6 +203,36 @@ class FormEditorExampleApplication extends libPictApplication
188
203
  tmpXHR.send();
189
204
  }
190
205
 
206
+ _handleImportedManifests(pManifests, pFileName)
207
+ {
208
+ let tmpManifestKeys = Object.keys(pManifests);
209
+ if (tmpManifestKeys.length <= 1)
210
+ {
211
+ return;
212
+ }
213
+
214
+ // Determine the source label from the file extension
215
+ let tmpSourceLabel = pFileName.toLowerCase().endsWith('.json') ? 'JSON' : 'CSV';
216
+
217
+ // Add additional manifests (beyond the first which was auto-loaded) to the selector
218
+ for (let i = 1; i < tmpManifestKeys.length; i++)
219
+ {
220
+ let tmpKey = tmpManifestKeys[i];
221
+ let tmpFormName = pManifests[tmpKey].FormName || tmpKey;
222
+ let tmpEntry = { Name: `${tmpSourceLabel}: ${tmpFormName}`, File: false, ManifestData: pManifests[tmpKey] };
223
+ this._ManifestList.push(tmpEntry);
224
+ }
225
+
226
+ // Re-render the selector to show new entries
227
+ this.renderSelector();
228
+ }
229
+
230
+ loadManifestDirect(pManifestData)
231
+ {
232
+ this.pict.AppData.FormConfig = pManifestData;
233
+ this._refreshEditor();
234
+ }
235
+
191
236
  _refreshEditor()
192
237
  {
193
238
  if (this._FormEditorView)