@fieldia/core 0.29.0 → 0.30.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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/schema/page.schema.json +17 -1
  4. package/src/lib/format/head-checks.d.mts +10 -2
  5. package/src/lib/format/head-checks.d.ts +10 -2
  6. package/src/lib/format/head-checks.js +9 -2
  7. package/src/lib/format/head-checks.js.map +1 -1
  8. package/src/lib/format/head-checks.mjs +10 -4
  9. package/src/lib/format/head-checks.mjs.map +1 -1
  10. package/src/lib/format/layout.d.mts +29 -0
  11. package/src/lib/format/layout.d.ts +29 -0
  12. package/src/lib/format/layout.js +5 -0
  13. package/src/lib/format/layout.js.map +1 -1
  14. package/src/lib/format/layout.mjs +5 -0
  15. package/src/lib/format/layout.mjs.map +1 -1
  16. package/src/lib/format/page.d.mts +5 -1
  17. package/src/lib/format/page.d.ts +5 -1
  18. package/src/lib/format/references.d.mts +3 -1
  19. package/src/lib/format/references.d.ts +3 -1
  20. package/src/lib/format/references.js +10 -13
  21. package/src/lib/format/references.js.map +1 -1
  22. package/src/lib/format/references.mjs +11 -14
  23. package/src/lib/format/references.mjs.map +1 -1
  24. package/src/lib/format/sheet-head-checks.d.mts +10 -2
  25. package/src/lib/format/sheet-head-checks.d.ts +10 -2
  26. package/src/lib/format/sheet-head-checks.js +24 -0
  27. package/src/lib/format/sheet-head-checks.js.map +1 -1
  28. package/src/lib/format/sheet-head-checks.mjs +23 -0
  29. package/src/lib/format/sheet-head-checks.mjs.map +1 -1
  30. package/src/lib/format/upgrade.d.mts +3 -1
  31. package/src/lib/format/upgrade.d.ts +3 -1
  32. package/src/lib/format/upgrade.js +3 -1
  33. package/src/lib/format/upgrade.js.map +1 -1
  34. package/src/lib/format/upgrade.mjs +3 -1
  35. package/src/lib/format/upgrade.mjs.map +1 -1
  36. package/src/lib/format/version.d.mts +2 -2
  37. package/src/lib/format/version.d.ts +2 -2
  38. package/src/lib/format/version.js +2 -2
  39. package/src/lib/format/version.js.map +1 -1
  40. package/src/lib/format/version.mjs +2 -2
  41. package/src/lib/format/version.mjs.map +1 -1
  42. package/src/lib/record/form.js +11 -10
  43. package/src/lib/record/form.js.map +1 -1
  44. package/src/lib/record/form.mjs +11 -10
  45. package/src/lib/record/form.mjs.map +1 -1
  46. package/src/lib/record/run.d.mts +6 -1
  47. package/src/lib/record/run.d.ts +6 -1
  48. package/src/lib/record/run.js.map +1 -1
  49. package/src/lib/record/run.mjs.map +1 -1
@@ -3640,7 +3640,14 @@ function indexLayout(root, functions) {
3640
3640
  ...(does.length ? { does } : {}),
3641
3641
  source,
3642
3642
  });
3643
- // A button's menu: each item a button of the record, hidden with it.
3643
+ // A menu's built-in Archive shows while the record is active, Unarchive while it is not.
3644
+ const builtin = source.builtin;
3645
+ if (builtin === 'archive' || builtin === 'unarchive') {
3646
+ const own = index.get(source.id);
3647
+ const mine = own.invisible;
3648
+ own.invisible = { ...mine, evaluate: (context, env) => (context['active'] === false) !== (builtin === 'unarchive') || mine.evaluate(context, env) };
3649
+ }
3650
+ // A button's menu, and a menu inside a menu: each item a button of the record, hidden with it.
3644
3651
  if (kind === 'button')
3645
3652
  for (const item of source.menu ?? [])
3646
3653
  add(item, source.id, 'button', { invisible: item.invisible });
@@ -3749,16 +3756,10 @@ function indexLayout(root, functions) {
3749
3756
  walk(head?.band?.children ?? [], root.id);
3750
3757
  if (root.sidePanel)
3751
3758
  add(root.sidePanel, root.id, 'other', { invisible: root.sidePanel.invisible });
3752
- // The gear menu's items are buttons of the record; Archive shows while it is active, Unarchive while it is not.
3753
- for (const item of root.toolbar?.menu ?? []) {
3759
+ // The gear menu's items are buttons of the record — those of a menu inside it too, hidden with the item that opens
3760
+ // it (add's own); Archive shows while it is active, Unarchive while it is not.
3761
+ for (const item of root.toolbar?.menu ?? [])
3754
3762
  add(item, root.id, 'button', { invisible: item.invisible });
3755
- if (item.builtin === 'archive' || item.builtin === 'unarchive') {
3756
- const own = index.get(item.id);
3757
- const mine = own.invisible;
3758
- const archived = item.builtin === 'unarchive';
3759
- own.invisible = { ...mine, evaluate: (context, env) => (context['active'] === false) !== archived || mine.evaluate(context, env) };
3760
- }
3761
- }
3762
3763
  if (root.attachmentPreview)
3763
3764
  add({ id: '#preview', ...root.attachmentPreview }, root.id, 'other', { invisible: root.attachmentPreview.invisible });
3764
3765
  }