@momentumcms/server-analog 0.1.9 → 0.2.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/CHANGELOG.md +15 -0
- package/index.cjs +29 -2
- package/index.js +29 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 0.2.0 (2026-02-17)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for server-analog to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.1.10 (2026-02-17)
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **create-momentum-app:** add shell option to execFileSync for Windows ([#28](https://github.com/DonaldMurillo/momentum-cms/pull/28))
|
|
10
|
+
|
|
11
|
+
### ❤️ Thank You
|
|
12
|
+
|
|
13
|
+
- Claude Opus 4.6
|
|
14
|
+
- Donald Murillo @DonaldMurillo
|
|
15
|
+
|
|
1
16
|
## 0.1.9 (2026-02-16)
|
|
2
17
|
|
|
3
18
|
This was a version bump only for server-analog to align it with other projects, there were no code changes.
|
package/index.cjs
CHANGED
|
@@ -301,12 +301,26 @@ var ReferentialIntegrityError = class extends Error {
|
|
|
301
301
|
this.constraint = constraint;
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
+
function isNamedTab(tab) {
|
|
305
|
+
return typeof tab.name === "string" && tab.name.length > 0;
|
|
306
|
+
}
|
|
304
307
|
function flattenDataFields(fields) {
|
|
305
308
|
const result = [];
|
|
306
309
|
for (const field of fields) {
|
|
307
310
|
if (field.type === "tabs") {
|
|
308
311
|
for (const tab of field.tabs) {
|
|
309
|
-
|
|
312
|
+
if (isNamedTab(tab)) {
|
|
313
|
+
const syntheticGroup = {
|
|
314
|
+
name: tab.name,
|
|
315
|
+
type: "group",
|
|
316
|
+
label: tab.label,
|
|
317
|
+
description: tab.description,
|
|
318
|
+
fields: tab.fields
|
|
319
|
+
};
|
|
320
|
+
result.push(syntheticGroup);
|
|
321
|
+
} else {
|
|
322
|
+
result.push(...flattenDataFields(tab.fields));
|
|
323
|
+
}
|
|
310
324
|
}
|
|
311
325
|
} else if (field.type === "collapsible" || field.type === "row") {
|
|
312
326
|
result.push(...flattenDataFields(field.fields));
|
|
@@ -670,7 +684,20 @@ async function runFieldHooks(hookType, fields, data, req, operation) {
|
|
|
670
684
|
for (const field of fields) {
|
|
671
685
|
if (field.type === "tabs") {
|
|
672
686
|
for (const tab of field.tabs) {
|
|
673
|
-
|
|
687
|
+
if (isNamedTab(tab)) {
|
|
688
|
+
const nested = processedData[tab.name];
|
|
689
|
+
if (nested && typeof nested === "object" && !Array.isArray(nested)) {
|
|
690
|
+
processedData[tab.name] = await runFieldHooks(
|
|
691
|
+
hookType,
|
|
692
|
+
tab.fields,
|
|
693
|
+
nested,
|
|
694
|
+
req,
|
|
695
|
+
operation
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
} else {
|
|
699
|
+
processedData = await runFieldHooks(hookType, tab.fields, processedData, req, operation);
|
|
700
|
+
}
|
|
674
701
|
}
|
|
675
702
|
continue;
|
|
676
703
|
}
|
package/index.js
CHANGED
|
@@ -263,12 +263,26 @@ var ReferentialIntegrityError = class extends Error {
|
|
|
263
263
|
this.constraint = constraint;
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
|
+
function isNamedTab(tab) {
|
|
267
|
+
return typeof tab.name === "string" && tab.name.length > 0;
|
|
268
|
+
}
|
|
266
269
|
function flattenDataFields(fields) {
|
|
267
270
|
const result = [];
|
|
268
271
|
for (const field of fields) {
|
|
269
272
|
if (field.type === "tabs") {
|
|
270
273
|
for (const tab of field.tabs) {
|
|
271
|
-
|
|
274
|
+
if (isNamedTab(tab)) {
|
|
275
|
+
const syntheticGroup = {
|
|
276
|
+
name: tab.name,
|
|
277
|
+
type: "group",
|
|
278
|
+
label: tab.label,
|
|
279
|
+
description: tab.description,
|
|
280
|
+
fields: tab.fields
|
|
281
|
+
};
|
|
282
|
+
result.push(syntheticGroup);
|
|
283
|
+
} else {
|
|
284
|
+
result.push(...flattenDataFields(tab.fields));
|
|
285
|
+
}
|
|
272
286
|
}
|
|
273
287
|
} else if (field.type === "collapsible" || field.type === "row") {
|
|
274
288
|
result.push(...flattenDataFields(field.fields));
|
|
@@ -632,7 +646,20 @@ async function runFieldHooks(hookType, fields, data, req, operation) {
|
|
|
632
646
|
for (const field of fields) {
|
|
633
647
|
if (field.type === "tabs") {
|
|
634
648
|
for (const tab of field.tabs) {
|
|
635
|
-
|
|
649
|
+
if (isNamedTab(tab)) {
|
|
650
|
+
const nested = processedData[tab.name];
|
|
651
|
+
if (nested && typeof nested === "object" && !Array.isArray(nested)) {
|
|
652
|
+
processedData[tab.name] = await runFieldHooks(
|
|
653
|
+
hookType,
|
|
654
|
+
tab.fields,
|
|
655
|
+
nested,
|
|
656
|
+
req,
|
|
657
|
+
operation
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
} else {
|
|
661
|
+
processedData = await runFieldHooks(hookType, tab.fields, processedData, req, operation);
|
|
662
|
+
}
|
|
636
663
|
}
|
|
637
664
|
continue;
|
|
638
665
|
}
|