@phis/ui 0.5.7 → 0.6.1

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 (116) hide show
  1. package/components/controls/phi-amount-list-control.d.ts +69 -0
  2. package/components/controls/phi-amount-list-control.js +15 -0
  3. package/components/controls/phi-button-control.js +16 -2
  4. package/components/controls/phi-form-control.d.ts +6 -0
  5. package/components/controls/phi-form-control.js +23 -7
  6. package/components/controls/phi-media-picker-control.d.ts +3 -1
  7. package/components/controls/phi-media-picker-control.js +2 -2
  8. package/components/forms/form-descriptor-runtime-client.d.ts +3 -1
  9. package/components/forms/form-descriptor-runtime-client.js +2 -2
  10. package/components/forms/form-field-provider-modules.d.ts +23 -0
  11. package/components/forms/form-field-provider-modules.js +28 -0
  12. package/components/forms/form-provider-contract.d.ts +7 -0
  13. package/components/forms/form-provider-contract.js +7 -0
  14. package/components/forms/lazy-form-field-control.d.ts +14 -0
  15. package/components/forms/lazy-form-field-control.js +35 -0
  16. package/components/forms/phi-form-widget.d.ts +3 -2
  17. package/components/forms/phi-form-widget.js +21 -3
  18. package/components/forms/shared-form-provider-registry.js +1 -33
  19. package/components/media/phi-area-upload-widget.js +6 -58
  20. package/components/media/phi-media-picker-binding.d.ts +16 -1
  21. package/components/media/phi-media-picker-binding.js +3 -2
  22. package/components/media/phi-media-upload.d.ts +12 -0
  23. package/components/media/phi-media-upload.js +22 -0
  24. package/components/media/phi-upload-drop-area.d.ts +22 -0
  25. package/components/media/phi-upload-drop-area.js +49 -0
  26. package/components/root/phi-root-layout.d.ts +1 -0
  27. package/components/root/phi-root-layout.js +1 -0
  28. package/components/widgets/helpers/semantic-html-translation.d.ts +4 -1
  29. package/components/widgets/helpers/semantic-html-translation.js +4 -2
  30. package/components/widgets/label-sets/admin-users.d.ts +9 -1
  31. package/components/widgets/label-sets/admin-users.js +14 -2
  32. package/components/widgets/label-sets/slot-upload.js +6 -3
  33. package/components/widgets/label-types/slot-upload.d.ts +7 -1
  34. package/components/widgets/label-types/slot-upload.js +2 -1
  35. package/components/widgets/shared/markdown-render.js +6 -6
  36. package/constants/media-library-provider-keys.d.ts +9 -0
  37. package/constants/media-library-provider-keys.js +9 -0
  38. package/constants/media.d.ts +2 -0
  39. package/constants/media.js +2 -0
  40. package/constants/runtime-module-ownership.js +2 -0
  41. package/controls.d.ts +4 -0
  42. package/controls.js +2 -0
  43. package/gateway/signet-route.d.ts +24 -0
  44. package/gateway/signet-route.js +107 -0
  45. package/gateway/site-proxy.js +14 -7
  46. package/helpers/phi-metadata.d.ts +8 -6
  47. package/helpers/phi-metadata.js +9 -2
  48. package/helpers/phi-signet-head.d.ts +26 -0
  49. package/helpers/phi-signet-head.js +53 -0
  50. package/helpers/phi-signet-paths.d.ts +16 -0
  51. package/helpers/phi-signet-paths.js +19 -0
  52. package/helpers/phi-signet.d.ts +40 -0
  53. package/helpers/phi-signet.js +70 -0
  54. package/net/phi-next-proxy.d.ts +10 -8
  55. package/net/phi-next-proxy.js +27 -84
  56. package/next/proxy-runtime.js +15 -0
  57. package/next/root-route.js +7 -4
  58. package/next/site-proxy.js +21 -0
  59. package/package.json +3 -3
  60. package/plugins/runtime-modules/area-definitions.d.ts +24 -3
  61. package/plugins/runtime-modules/area-definitions.js +11 -3
  62. package/plugins/runtime-modules/asset/definition.d.ts +44 -2
  63. package/plugins/runtime-modules/asset/definition.js +5 -2
  64. package/plugins/runtime-modules/asset/form-providers.d.ts +63 -0
  65. package/plugins/runtime-modules/asset/form-providers.js +54 -0
  66. package/plugins/runtime-modules/asset/form-ui-provider.js +13 -3
  67. package/plugins/runtime-modules/asset/media-asset-field.d.ts +20 -0
  68. package/plugins/runtime-modules/asset/media-asset-field.js +33 -0
  69. package/plugins/runtime-modules/asset/media-asset-form-control.d.ts +21 -0
  70. package/plugins/runtime-modules/asset/media-asset-form-control.js +74 -0
  71. package/plugins/runtime-modules/core/widgets/html/server.js +1 -1
  72. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +28 -23
  73. package/plugins/runtime-modules/core/widgets/slot-upload/slot.d.ts +19 -0
  74. package/plugins/runtime-modules/core/widgets/slot-upload/slot.js +16 -0
  75. package/plugins/runtime-modules/public/presets.d.ts +12 -0
  76. package/plugins/runtime-modules/public/presets.js +10 -0
  77. package/plugins/runtime-modules/public/server.js +1 -1
  78. package/plugins/runtime-modules/public/trees/phi-default-pub-privacy-page-tree.d.ts +4 -0
  79. package/plugins/runtime-modules/public/trees/phi-default-pub-privacy-page-tree.js +66 -0
  80. package/plugins/runtime-modules/public-base-page-references.d.ts +2 -1
  81. package/plugins/runtime-modules/public-base-page-references.js +2 -1
  82. package/plugins/runtime-modules/resolver.js +38 -4
  83. package/plugins/runtime-modules/theme/controller/runtime.js +7 -2
  84. package/plugins/runtime-modules/theme/materialize-images.d.ts +16 -0
  85. package/plugins/runtime-modules/theme/materialize-images.js +37 -0
  86. package/plugins/runtime-modules/user-management/addon-roles.d.ts +35 -0
  87. package/plugins/runtime-modules/user-management/addon-roles.js +76 -0
  88. package/plugins/runtime-modules/user-management/cards.js +1 -1
  89. package/plugins/runtime-modules/user-management/client-data-providers.js +6 -0
  90. package/plugins/runtime-modules/user-management/data-providers.d.ts +11 -2
  91. package/plugins/runtime-modules/user-management/data-providers.js +12 -1
  92. package/plugins/runtime-modules/user-management/definition.d.ts +11 -2
  93. package/plugins/runtime-modules/user-management/ids.d.ts +1 -0
  94. package/plugins/runtime-modules/user-management/ids.js +1 -0
  95. package/plugins/runtime-modules/user-management/services/options.d.ts +8 -0
  96. package/plugins/runtime-modules/user-management/services/options.js +25 -0
  97. package/plugins/runtime-modules/user-management/services/table.js +9 -1
  98. package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +20 -2
  99. package/server-helpers/cms-widget-texts.js +1 -1
  100. package/server-helpers/search-index.js +22 -13
  101. package/server-helpers/search-text.d.ts +3 -2
  102. package/server-helpers/search-text.js +6 -5
  103. package/server-helpers/translate.d.ts +13 -2
  104. package/server-helpers/translate.js +10 -6
  105. package/styles/amount-list.css +142 -0
  106. package/styles/controls.css +156 -7
  107. package/styles/gradients.css +21 -20
  108. package/theme/phi-theme-blocks.d.ts +7 -6
  109. package/theme/phi-theme-composition.d.ts +19 -1
  110. package/theme/phi-theme-composition.js +15 -0
  111. package/theme/phi-theme-signet.d.ts +31 -0
  112. package/theme/phi-theme-signet.js +53 -0
  113. package/theme/phi-tokens.d.ts +1 -1
  114. package/theme/phi-tokens.js +5 -1
  115. package/types/cms-plugins.d.ts +10 -1
  116. package/types/site-theme.d.ts +29 -0
@@ -0,0 +1,142 @@
1
+ /*
2
+ * PhiAmountListControl (components/controls/phi-amount-list-control.tsx).
3
+ *
4
+ * One grid for the whole list: [media] [text] [controls] [amount]. Item rows and total rows are subgrids
5
+ * of it, so the amount column is the same column for all of them and sized by the widest amount. The
6
+ * cells carry their own inset instead of the grid a `column-gap`: a column no row uses (no media in the
7
+ * list, no controls) is then 0 wide and leaves no empty gap.
8
+ *
9
+ * Narrow is the list's own width (`@container`), not the viewport's: below 30rem an item is two lines.
10
+ */
11
+
12
+ .phi-amount-list {
13
+ container: phi-amount-list / inline-size;
14
+ display: grid;
15
+ grid-template-columns: auto minmax(0, 1fr) auto max-content;
16
+ width: 100%;
17
+ min-width: 0;
18
+ font-size: var(--phi-font-size);
19
+ line-height: var(--phi-line-height);
20
+ color: var(--phi-color-text);
21
+ }
22
+
23
+ .phi-amount-list--small {
24
+ font-size: var(--phi-font-size-sm);
25
+ }
26
+
27
+ .phi-amount-list--large {
28
+ font-size: var(--phi-font-size-lg);
29
+ }
30
+
31
+ .phi-amount-list__items,
32
+ .phi-amount-list__totals,
33
+ .phi-amount-list__item,
34
+ .phi-amount-list__total {
35
+ display: grid;
36
+ grid-template-columns: subgrid;
37
+ grid-column: 1 / -1;
38
+ }
39
+
40
+ .phi-amount-list__items,
41
+ .phi-amount-list__totals {
42
+ margin: 0;
43
+ padding: 0;
44
+ list-style: none;
45
+ }
46
+
47
+ .phi-amount-list__totals {
48
+ margin-block-start: var(--phi-padding-xs);
49
+ }
50
+
51
+ .phi-amount-list__item,
52
+ .phi-amount-list__total {
53
+ align-items: start;
54
+ padding-block: var(--phi-padding-xs);
55
+ }
56
+
57
+ .phi-amount-list--small .phi-amount-list__item,
58
+ .phi-amount-list--small .phi-amount-list__total {
59
+ padding-block: var(--phi-padding-xxs);
60
+ }
61
+
62
+ .phi-amount-list--large .phi-amount-list__item,
63
+ .phi-amount-list--large .phi-amount-list__total {
64
+ padding-block: var(--phi-padding-sm);
65
+ }
66
+
67
+ .phi-amount-list__media {
68
+ grid-column: 1;
69
+ padding-inline-end: var(--phi-padding-sm);
70
+ }
71
+
72
+ .phi-amount-list__text {
73
+ grid-column: 2;
74
+ min-width: 0;
75
+ overflow-wrap: anywhere;
76
+ }
77
+
78
+ .phi-amount-list__controls {
79
+ grid-column: 3;
80
+ align-self: center;
81
+ padding-inline-start: var(--phi-padding-sm);
82
+ }
83
+
84
+ .phi-amount-list__amount {
85
+ grid-column: 4;
86
+ margin: 0;
87
+ padding-inline-start: var(--phi-padding-sm);
88
+ text-align: end;
89
+ white-space: nowrap;
90
+ font-variant-numeric: tabular-nums;
91
+ }
92
+
93
+ .phi-amount-list__description,
94
+ .phi-amount-list__note {
95
+ color: var(--phi-color-text-description);
96
+ }
97
+
98
+ .phi-amount-list__note {
99
+ display: block;
100
+ font-size: var(--phi-font-size-sm);
101
+ }
102
+
103
+ .phi-amount-list__label {
104
+ grid-column: 1 / 4;
105
+ min-width: 0;
106
+ margin: 0;
107
+ overflow-wrap: anywhere;
108
+ }
109
+
110
+ .phi-amount-list__total--strong {
111
+ font-weight: var(--phi-font-weight-strong);
112
+ }
113
+
114
+ .phi-amount-list__total--divided {
115
+ border-block-start: 1px solid var(--phi-color-split);
116
+ }
117
+
118
+ .phi-amount-list__empty {
119
+ color: var(--phi-color-text-description);
120
+ }
121
+
122
+ @container phi-amount-list (max-width: 30rem) {
123
+ .phi-amount-list__media {
124
+ grid-row: 1;
125
+ }
126
+
127
+ .phi-amount-list__text {
128
+ grid-column: 2 / -1;
129
+ grid-row: 1;
130
+ }
131
+
132
+ .phi-amount-list__controls {
133
+ grid-column: 1 / 4;
134
+ grid-row: 2;
135
+ justify-self: start;
136
+ padding-inline-start: 0;
137
+ }
138
+
139
+ .phi-amount-list__item > .phi-amount-list__amount {
140
+ grid-row: 2;
141
+ }
142
+ }
@@ -673,18 +673,167 @@ h5.phi-typography, .phi-typography h5 {
673
673
  min-block-size: var(--phi-control-height-sm);
674
674
  }
675
675
 
676
- /* --- Compact Select ------------------------------------------------------------------------------ */
676
+ /* --- Single-line fields -------------------------------------------------------------------------- */
677
+
678
+ /*
679
+ * A single-line field is exactly as high as a Button of its size: the Theme's control height
680
+ * (`--phi-control-height-sm`, `--phi-control-height`, `--phi-control-height-lg`), whatever that height is.
681
+ * Ant Design gives a Button that height outright, but a field only the sum of its parts -- the line, a
682
+ * padding it reckons as (control height - line) / 2 - border, and the border -- and clamps the padding at
683
+ * zero. A Theme whose small control height is shorter than its small line (21 px against 22 px) therefore
684
+ * got fields taller than the Buttons beside them, and at the other sizes a fraction over or under. So the
685
+ * field's line is the field's inside, its height minus the border above and below, the padding is nothing,
686
+ * and the text stands in the middle of that line. A field that grows -- TextArea, Mentions, a Select or
687
+ * Date Picker that takes several values -- keeps the control height as its minimum, as before.
688
+ */
689
+
690
+ /*
691
+ * Select, and with it Cascader, TreeSelect and AutoComplete, reckon their box from variables of their own,
692
+ * written under Ant Design's component prefix, `--ant-select-*`: only the global tokens follow
693
+ * `cssVar.prefix` (`--phi-`), so a `--phi-select-*` name would set a variable nothing reads. The padding is
694
+ * (height - font height) / 2 - border, so a font height that is the inside of the field leaves none, and
695
+ * the line height is that same length.
696
+ */
697
+ [class~="ant-select"][class~="ant-select-single"] {
698
+ --ant-select-font-height: calc(var(--ant-select-height) - 2 * var(--ant-select-border-size));
699
+ --ant-select-line-height: var(--ant-select-font-height);
700
+ }
677
701
 
678
702
  /*
679
703
  * A compact control writes small: Input, InputNumber, DatePicker and Button take the scale's `sm` through
680
- * their component tokens (theme/phi-theme.ts). Select has no such token -- it sizes its words by variables
681
- * of its own and gives `-sm` the body's -- so its compact form is told here. Both variables move together:
682
- * Select reckons its padding as (height - font height) / 2, so a smaller font size with the body's font
683
- * height would leave the box short of `controlHeightSM` by the difference.
704
+ * their component tokens (theme/phi-theme.ts). Select has no such token -- it gives `-sm` the body's size.
684
705
  */
685
706
  [class~="ant-select"][class~="ant-select-sm"] {
686
- --phi-select-font-size: var(--phi-font-size-sm);
687
- --phi-select-font-height: calc(var(--phi-font-size-sm) * var(--phi-select-line-height));
707
+ --ant-select-font-size: var(--phi-font-size-sm);
708
+ }
709
+
710
+ /*
711
+ * Input, its prefix and suffix form (the affix wrapper, which is also Search and Password), and the
712
+ * addons of a group have no variable for their height: they set a padding from tokens and let the line
713
+ * make up the rest, so these set `height` and the line themselves. An input inside an affix wrapper
714
+ * takes its height from the wrapper, hence that rule comes after the others at the same weight.
715
+ */
716
+ input.ant-input {
717
+ height: var(--phi-control-height);
718
+ padding-block: 0;
719
+ line-height: calc(var(--phi-control-height) - 2 * var(--phi-line-width));
720
+ }
721
+
722
+ input.ant-input.ant-input-sm {
723
+ height: var(--phi-control-height-sm);
724
+ line-height: calc(var(--phi-control-height-sm) - 2 * var(--phi-line-width));
725
+ }
726
+
727
+ input.ant-input.ant-input-lg {
728
+ height: var(--phi-control-height-lg);
729
+ line-height: calc(var(--phi-control-height-lg) - 2 * var(--phi-line-width));
730
+ }
731
+
732
+ .ant-input-affix-wrapper:not(.ant-input-textarea-affix-wrapper) {
733
+ height: var(--phi-control-height);
734
+ padding-block: 0;
735
+ }
736
+
737
+ .ant-input-affix-wrapper.ant-input-affix-wrapper-sm:not(.ant-input-textarea-affix-wrapper) {
738
+ height: var(--phi-control-height-sm);
739
+ }
740
+
741
+ .ant-input-affix-wrapper.ant-input-affix-wrapper-lg:not(.ant-input-textarea-affix-wrapper) {
742
+ height: var(--phi-control-height-lg);
743
+ }
744
+
745
+ .ant-input-affix-wrapper > input.ant-input {
746
+ height: auto;
747
+ }
748
+
749
+ /*
750
+ * A group with addons is a table, and its input is an inline box in an unnamed cell: the line of the table
751
+ * is that box's strut, so it is the field's line too, or the row stays taller than the input in it. An
752
+ * addon is a cell of that row; its own padding would only add to the row.
753
+ */
754
+ .ant-input-group {
755
+ line-height: calc(var(--phi-control-height) - 2 * var(--phi-line-width));
756
+ }
757
+
758
+ .ant-input-group-wrapper-sm .ant-input-group {
759
+ line-height: calc(var(--phi-control-height-sm) - 2 * var(--phi-line-width));
760
+ }
761
+
762
+ .ant-input-group-wrapper-lg .ant-input-group {
763
+ line-height: calc(var(--phi-control-height-lg) - 2 * var(--phi-line-width));
764
+ }
765
+
766
+ /* The input rides at the top of its cell, so the strut's baseline cannot add a fraction to the row. */
767
+ .ant-input-group > input.ant-input {
768
+ vertical-align: top;
769
+ }
770
+
771
+ .ant-input-group-addon {
772
+ padding-block: 0;
773
+ line-height: inherit;
774
+ }
775
+
776
+ /*
777
+ * Search's Button is the control height through `--ant-input-search-btn-height`, but a small one also
778
+ * carries a floor of its own, reckoned from the small line (23.875 px with a 14 px font), which would keep
779
+ * it above the field beside it. The floor is the height itself.
780
+ */
781
+ .ant-input-search.ant-input-search-small .ant-input-search-btn {
782
+ min-height: var(--ant-input-search-btn-height);
783
+ }
784
+
785
+ .ant-input-search.ant-input-search-small .ant-input-search-btn.ant-btn-icon-only {
786
+ min-width: var(--ant-input-search-btn-height);
787
+ }
788
+
789
+ /*
790
+ * Input Number sets its inner input's padding through `--ant-input-number-input-padding-block`, but its
791
+ * borderless forms rewrite that variable at the weight of these rules, so the padding is cleared on the
792
+ * input itself. The wrapper's line is inherited by the input.
793
+ */
794
+ .ant-input-number {
795
+ height: var(--phi-control-height);
796
+ line-height: calc(var(--phi-control-height) - 2 * var(--phi-line-width));
797
+ }
798
+
799
+ .ant-input-number.ant-input-number-sm {
800
+ height: var(--phi-control-height-sm);
801
+ line-height: calc(var(--phi-control-height-sm) - 2 * var(--phi-line-width));
802
+ }
803
+
804
+ .ant-input-number.ant-input-number-lg {
805
+ height: var(--phi-control-height-lg);
806
+ line-height: calc(var(--phi-control-height-lg) - 2 * var(--phi-line-width));
807
+ }
808
+
809
+ .ant-input-number .ant-input-number-input {
810
+ padding-block: 0;
811
+ }
812
+
813
+ /* Date Picker, Range Picker and Time Picker: the box, and the line of the input in it. */
814
+ .ant-picker:not(.ant-picker-multiple) {
815
+ height: var(--phi-control-height);
816
+ padding-block: 0;
817
+ }
818
+
819
+ .ant-picker:not(.ant-picker-multiple) .ant-picker-input > input {
820
+ line-height: calc(var(--phi-control-height) - 2 * var(--phi-line-width));
821
+ }
822
+
823
+ .ant-picker.ant-picker-small:not(.ant-picker-multiple) {
824
+ height: var(--phi-control-height-sm);
825
+ }
826
+
827
+ .ant-picker.ant-picker-small:not(.ant-picker-multiple) .ant-picker-input > input {
828
+ line-height: calc(var(--phi-control-height-sm) - 2 * var(--phi-line-width));
829
+ }
830
+
831
+ .ant-picker.ant-picker-large:not(.ant-picker-multiple) {
832
+ height: var(--phi-control-height-lg);
833
+ }
834
+
835
+ .ant-picker.ant-picker-large:not(.ant-picker-multiple) .ant-picker-input > input {
836
+ line-height: calc(var(--phi-control-height-lg) - 2 * var(--phi-line-width));
688
837
  }
689
838
 
690
839
  /* The list a compact Select opens writes as the field does; Ant Design gives every Select's list the body size. */
@@ -2,7 +2,8 @@
2
2
  * Gradients and glass on Controls (theme/phi-theme-gradients.ts).
3
3
  *
4
4
  * Ant Design 6 draws a Button's ground with `background-color` from its own variables
5
- * (`--phi-btn-bg-color`, `-hover`, `-active`) and never sets `background-image`. So a run laid on as
5
+ * (`--ant-btn-bg-color`, `-hover`, `-active`, written under the component prefix `ant`, not `--phi-`: only
6
+ * tokens follow `cssVar.prefix`, THEME.md) and never sets `background-image`. So a run laid on as
6
7
  * `background-image` sits over Ant Design's colour without fighting it and keeps that colour as the edge
7
8
  * a gradient cannot draw. A disabled Button is left out of every rule here: its run would outweigh the
8
9
  * `background` shorthand Ant Design greys it out with. Text colour goes through Ant Design's text variables, which is
@@ -23,7 +24,7 @@
23
24
  background-origin: border-box;
24
25
  background-repeat: no-repeat;
25
26
  will-change: filter;
26
- --phi-btn-text-color: var(--phi-primary-button-gradient-text, var(--phi-color-text-light-solid));
27
+ --ant-btn-text-color: var(--phi-primary-button-gradient-text, var(--phi-color-text-light-solid));
27
28
  }
28
29
 
29
30
  .ant-btn.ant-btn.ant-btn-color-primary.ant-btn-variant-solid:not(.ant-btn-background-ghost):not(.phi-btn-gradient):not(:disabled):not(.ant-btn-disabled):hover {
@@ -46,15 +47,15 @@
46
47
  filter eases, rasterises its rounded rim there, and the pill seemed to change size twice. */
47
48
  will-change: filter;
48
49
  /* The run is the whole ground: a colour beneath it showed through the anti-aliased rim of a pill. */
49
- --phi-btn-bg-color: transparent;
50
- --phi-btn-bg-color-hover: transparent;
51
- --phi-btn-bg-color-active: transparent;
52
- --phi-btn-border-color: transparent;
53
- --phi-btn-border-color-hover: transparent;
54
- --phi-btn-border-color-active: transparent;
55
- --phi-btn-text-color: var(--phi-control-gradient-text);
56
- --phi-btn-text-color-hover: var(--phi-control-gradient-text);
57
- --phi-btn-text-color-active: var(--phi-control-gradient-text);
50
+ --ant-btn-bg-color: transparent;
51
+ --ant-btn-bg-color-hover: transparent;
52
+ --ant-btn-bg-color-active: transparent;
53
+ --ant-btn-border-color: transparent;
54
+ --ant-btn-border-color-hover: transparent;
55
+ --ant-btn-border-color-active: transparent;
56
+ --ant-btn-text-color: var(--phi-control-gradient-text);
57
+ --ant-btn-text-color-hover: var(--phi-control-gradient-text);
58
+ --ant-btn-text-color-active: var(--phi-control-gradient-text);
58
59
  }
59
60
 
60
61
  /*
@@ -76,15 +77,15 @@
76
77
  * one, so the pane darkens instead of misting a dark picture white.
77
78
  */
78
79
  .ant-btn.ant-btn.phi-btn-glass.phi-btn-glass {
79
- --phi-btn-bg-color: color-mix(in srgb, var(--phi-color-bg-container) 24%, transparent);
80
- --phi-btn-bg-color-hover: color-mix(in srgb, var(--phi-color-bg-container) 38%, transparent);
81
- --phi-btn-bg-color-active: color-mix(in srgb, var(--phi-color-bg-container) 48%, transparent);
82
- --phi-btn-border-color: color-mix(in srgb, var(--phi-color-text) 24%, transparent);
83
- --phi-btn-border-color-hover: color-mix(in srgb, var(--phi-color-text) 40%, transparent);
84
- --phi-btn-border-color-active: color-mix(in srgb, var(--phi-color-text) 40%, transparent);
85
- --phi-btn-text-color: var(--phi-color-text);
86
- --phi-btn-text-color-hover: var(--phi-color-text);
87
- --phi-btn-text-color-active: var(--phi-color-text);
80
+ --ant-btn-bg-color: color-mix(in srgb, var(--phi-color-bg-container) 24%, transparent);
81
+ --ant-btn-bg-color-hover: color-mix(in srgb, var(--phi-color-bg-container) 38%, transparent);
82
+ --ant-btn-bg-color-active: color-mix(in srgb, var(--phi-color-bg-container) 48%, transparent);
83
+ --ant-btn-border-color: color-mix(in srgb, var(--phi-color-text) 24%, transparent);
84
+ --ant-btn-border-color-hover: color-mix(in srgb, var(--phi-color-text) 40%, transparent);
85
+ --ant-btn-border-color-active: color-mix(in srgb, var(--phi-color-text) 40%, transparent);
86
+ --ant-btn-text-color: var(--phi-color-text);
87
+ --ant-btn-text-color-hover: var(--phi-color-text);
88
+ --ant-btn-text-color-active: var(--phi-color-text);
88
89
  /* The frost itself is inline on the Button: a `backdrop-filter` in a stylesheet does not survive the build (styles/shell.css). */
89
90
  }
90
91
 
@@ -97,7 +97,7 @@ export type PhiThemeSetBlock = PhiThemeBlockIdentity & {
97
97
  * The Signet: the square the Site is marked with where only a square will do -- the browser tab, the
98
98
  * home screen, an avatar.
99
99
  *
100
- * One picture, not one per mode, and no authored counterpart beside it the way the Logo has: a Signet
100
+ * One picture, not one per mode, and no editor field for an authored one the way the Logo has: a Signet
101
101
  * carries its own ground, so it does not need the mode, and a Signet that did not match the Logo it
102
102
  * stands in for would be a mistake rather than a choice. Whoever wants another one changes the Set.
103
103
  *
@@ -105,11 +105,12 @@ export type PhiThemeSetBlock = PhiThemeBlockIdentity & {
105
105
  * because a file did not ship. Its media type comes with it, so a Set is free to mark itself with
106
106
  * something that is not a drawing.
107
107
  *
108
- * It is read per request and never copied into the Site's record the way the four parts are, nor
109
- * taken into the Media library the way the Logo is on the first save. What those two protect is a
110
- * decision the author made -- the Logo of a Set becomes the Site's own the moment it is kept. The
111
- * Signet is nobody's decision but the Set's, so it lives and goes with it: switch the Module off and
112
- * the tab goes blank, the same way `unavailable.set` already says the look is gone.
108
+ * Followed per request while the Site only follows the Set: switch the Module off and the tab goes
109
+ * blank, the way `unavailable.set` already says the look is gone. Saving the Theme changes that, as it
110
+ * does for the Logo -- the Signet of a Module's Set is taken into the Media library and the record's
111
+ * `brand.signet` names the Asset from then on (`materializePhiThemeBrandSignet`); the core Set offers
112
+ * none and is never copied. The record's own Signet is read before the Set's
113
+ * (`resolvePhiThemeSignet`). Only the Site's own is delivered at a real address (THEME.md, Signet).
113
114
  */
114
115
  signet?: string | null;
115
116
  };
@@ -1,5 +1,6 @@
1
1
  import { type PhiThemeFontsBlock, type PhiThemeGroundBlock, type PhiThemePaletteBlock, type PhiThemeSetBlock, type PhiThemeStyleBlock } from "./phi-theme-blocks";
2
- import type { PhiSiteFontSlots, PhiSiteThemeBrandLogos, PhiSiteThemeRoot } from "../types/site-theme";
2
+ import { type PhiThemeSignet } from "./phi-theme-signet";
3
+ import type { PhiSiteFontSlots, PhiSiteThemeBrandLogos, PhiSiteThemeBrandSignet, PhiSiteThemeRoot } from "../types/site-theme";
3
4
  /**
4
5
  * What a Site follows, and what its author changed on top of it.
5
6
  *
@@ -37,6 +38,10 @@ export type PhiThemeCompositionSource = {
37
38
  presetVersion?: number | null;
38
39
  root?: PhiSiteThemeRoot | null;
39
40
  fonts?: PhiSiteFontSlots | null;
41
+ /** Only the Signet is read from the Brand here; the Logo has its own resolver below. */
42
+ brand?: {
43
+ signet?: PhiSiteThemeBrandSignet | null;
44
+ } | null;
40
45
  };
41
46
  /**
42
47
  * Which blocks a stored Theme names.
@@ -66,6 +71,11 @@ export type PhiThemeComposition = {
66
71
  * Set where it names none or one that is not available, the same floor every part falls back to.
67
72
  */
68
73
  markSet: PhiThemeSetBlock;
74
+ /**
75
+ * The Signet: the Site's own where its record states one, the `markSet`'s otherwise, and none where
76
+ * neither has one. See `resolvePhiThemeSignet`.
77
+ */
78
+ signet: PhiThemeSignet | null;
69
79
  /** The parts whose selection could not be resolved and are running on the core block instead. */
70
80
  unavailable: {
71
81
  palette: string | null;
@@ -93,6 +103,14 @@ export declare function resolvePhiThemeComposition(theme: PhiThemeCompositionSou
93
103
  * must show through it rather than leaving the slot naming nothing.
94
104
  */
95
105
  export declare function resolvePhiThemeEffectiveFonts(authored: PhiSiteFontSlots | null | undefined, fonts: PhiThemeFontsBlock): PhiSiteFontSlots;
106
+ /**
107
+ * The Signet a Site wears: its own, the Set's where the record says nothing.
108
+ *
109
+ * The Site's own comes first because a save made it the Site's (`materializePhiThemeBrandSignet`), and
110
+ * what a Site keeps must not change when the Set it follows does. `from` says which it is, because only
111
+ * the Site's has an address (`GET /api/site/signet`); a Set's is a data URL the head names itself.
112
+ */
113
+ export declare function resolvePhiThemeSignet(authored: PhiSiteThemeBrandSignet | null | undefined, set: PhiThemeSetBlock): PhiThemeSignet | null;
96
114
  /**
97
115
  * The Logo a Site shows: its own per mode, the Set's where the record says nothing about a mode.
98
116
  *
@@ -1,4 +1,5 @@
1
1
  import { PHI_CORE_THEME_FONTS_BLOCKS, PHI_CORE_THEME_FONTS_BLOCK_KEY, PHI_CORE_THEME_GROUND_BLOCKS, PHI_CORE_THEME_GROUND_BLOCK_KEY, PHI_CORE_THEME_PALETTE_BLOCKS, PHI_CORE_THEME_PALETTE_BLOCK_KEY, PHI_CORE_THEME_SETS, PHI_CORE_THEME_STYLE_BLOCKS, PHI_CORE_THEME_STYLE_BLOCK_KEY, resolvePhiThemeBlockSelection, resolvePhiThemeSetSelection, } from "./phi-theme-blocks";
2
+ import { readPhiThemeSiteSignet } from "./phi-theme-signet";
2
3
  export const PHI_CORE_THEME_BLOCK_CATALOG = {
3
4
  palettes: PHI_CORE_THEME_PALETTE_BLOCKS,
4
5
  styles: PHI_CORE_THEME_STYLE_BLOCKS,
@@ -51,6 +52,7 @@ export function resolvePhiThemeComposition(theme, catalog = PHI_CORE_THEME_BLOCK
51
52
  fonts: fonts.block,
52
53
  set: set?.available ? set.set : null,
53
54
  markSet,
55
+ signet: resolvePhiThemeSignet(theme?.brand?.signet, markSet),
54
56
  unavailable: {
55
57
  palette: palette.available ? null : palette.requested,
56
58
  style: style.available ? null : style.requested,
@@ -77,6 +79,19 @@ export function resolvePhiThemeEffectiveFonts(authored, fonts) {
77
79
  }
78
80
  return merged;
79
81
  }
82
+ /**
83
+ * The Signet a Site wears: its own, the Set's where the record says nothing.
84
+ *
85
+ * The Site's own comes first because a save made it the Site's (`materializePhiThemeBrandSignet`), and
86
+ * what a Site keeps must not change when the Set it follows does. `from` says which it is, because only
87
+ * the Site's has an address (`GET /api/site/signet`); a Set's is a data URL the head names itself.
88
+ */
89
+ export function resolvePhiThemeSignet(authored, set) {
90
+ const own = readPhiThemeSiteSignet(authored);
91
+ if (own)
92
+ return { ...own, from: "site" };
93
+ return set.signet?.startsWith("data:image/") ? { kind: "data", source: set.signet, from: "set" } : null;
94
+ }
80
95
  /**
81
96
  * The Logo a Site shows: its own per mode, the Set's where the record says nothing about a mode.
82
97
  *
@@ -0,0 +1,31 @@
1
+ import type { PhiSiteThemeBrandSignet } from "../types/site-theme";
2
+ /** A Signet picture the Site can deliver: inline as a data URL, or an Asset of its Media library. */
3
+ export type PhiThemeSignetPicture = {
4
+ kind: "data";
5
+ source: string;
6
+ } | {
7
+ kind: "asset";
8
+ assetId: number;
9
+ /** The Asset's revision, read from the delivered address the Core resolved (`?r=<revision>`). */
10
+ revision?: number;
11
+ /** The picture's media type and size as the Core states them, where it does. */
12
+ contentType?: string;
13
+ width?: number;
14
+ height?: number;
15
+ };
16
+ /**
17
+ * The Signet a Site wears, and whose it is: `site` where the record states it (a save made it the
18
+ * Site's, `materializePhiThemeBrandSignet`), `set` where the Site only follows a Theme Set that has one.
19
+ */
20
+ export type PhiThemeSignet = PhiThemeSignetPicture & {
21
+ from: "site" | "set";
22
+ };
23
+ /**
24
+ * The Signet the record itself states, and nothing else.
25
+ *
26
+ * Kept apart from the Set resolution so the route that delivers it can read the record without the
27
+ * Theme blocks: a Set's Signet has no address of its own and is named by the head as a data URL. Only a
28
+ * picture that can be delivered counts: an Asset with a positive id, or an inline `data:image/` picture.
29
+ * Anything else -- a path, an address on another server -- says nothing, and the answer is none.
30
+ */
31
+ export declare function readPhiThemeSiteSignet(authored: PhiSiteThemeBrandSignet | null | undefined): PhiThemeSignetPicture | null;
@@ -0,0 +1,53 @@
1
+ /** A media type the head may state: an image type as the Core writes it, nothing with parameters. */
2
+ const PHI_SIGNET_CONTENT_TYPE = /^image\/[a-z0-9][a-z0-9.+-]*$/u;
3
+ function isPositiveInteger(value) {
4
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
5
+ }
6
+ /**
7
+ * The revision in the address the Core delivers an Asset at, `/api/site/media/<id>/content?r=<revision>`.
8
+ * Only that address for this Asset counts: anything else (a path elsewhere, another id, a missing or
9
+ * non-numeric `r`) states no revision, and the Signet is named as it was before the Core wrote one.
10
+ */
11
+ function readPhiSignetAssetRevision(url, assetId) {
12
+ if (typeof url !== "string")
13
+ return null;
14
+ let parsed;
15
+ try {
16
+ parsed = new URL(url, "http://signet.invalid");
17
+ }
18
+ catch {
19
+ return null;
20
+ }
21
+ if (parsed.origin !== "http://signet.invalid" || parsed.pathname !== `/api/site/media/${assetId}/content`)
22
+ return null;
23
+ const revision = parsed.searchParams.get("r");
24
+ return revision !== null && /^\d{1,15}$/u.test(revision) ? Number(revision) : null;
25
+ }
26
+ /**
27
+ * The Signet the record itself states, and nothing else.
28
+ *
29
+ * Kept apart from the Set resolution so the route that delivers it can read the record without the
30
+ * Theme blocks: a Set's Signet has no address of its own and is named by the head as a data URL. Only a
31
+ * picture that can be delivered counts: an Asset with a positive id, or an inline `data:image/` picture.
32
+ * Anything else -- a path, an address on another server -- says nothing, and the answer is none.
33
+ */
34
+ export function readPhiThemeSiteSignet(authored) {
35
+ if (authored?.sourceKind === "asset" && Number.isInteger(authored.assetId) && authored.assetId > 0) {
36
+ const revision = readPhiSignetAssetRevision(authored.url, authored.assetId);
37
+ const contentType = typeof authored.contentType === "string" && PHI_SIGNET_CONTENT_TYPE.test(authored.contentType)
38
+ ? authored.contentType
39
+ : null;
40
+ const sized = isPositiveInteger(authored.width) && isPositiveInteger(authored.height);
41
+ return {
42
+ kind: "asset",
43
+ assetId: authored.assetId,
44
+ ...(revision != null ? { revision } : {}),
45
+ ...(contentType ? { contentType } : {}),
46
+ ...(sized ? { width: authored.width, height: authored.height } : {}),
47
+ };
48
+ }
49
+ if (authored?.sourceKind === "url" && typeof authored.sourceUrl === "string" && authored.sourceUrl.startsWith("data:image/")) {
50
+ return { kind: "data", source: authored.sourceUrl };
51
+ }
52
+ return null;
53
+ }
@@ -61,7 +61,7 @@ export declare const PHI_RADII: {
61
61
  readonly xxl: 89;
62
62
  };
63
63
  export declare const PHI_CONTROL_HEIGHTS: {
64
- readonly sm: 26;
64
+ readonly sm: 21;
65
65
  readonly md: 34;
66
66
  readonly lg: 55;
67
67
  };
@@ -60,8 +60,12 @@ export const PHI_RADII = {
60
60
  xl: 55,
61
61
  xxl: 89,
62
62
  };
63
+ /*
64
+ * The Fibonacci row 21, 34, 55. A single-line field is as high as the Button of its size, so the small 21
65
+ * is the height that carries the small text (13).
66
+ */
63
67
  export const PHI_CONTROL_HEIGHTS = {
64
- sm: 26,
68
+ sm: 21,
65
69
  md: 34,
66
70
  lg: 55,
67
71
  };
@@ -549,7 +549,8 @@ export type PhiCmsWidgetPlugin<TConfig> = {
549
549
  * answers the text as the reader sees it -- translated for `runtime.locale`, with the Page's values
550
550
  * filled in -- and nothing a reader does not see. A Widget without it contributes no text, which is
551
551
  * right for a picture, a form or a navigation; a Widget that draws words a visitor would search for
552
- * says them here, in reading order, one entry per line or paragraph.
552
+ * says them here, in reading order, one entry per line or paragraph. It runs outside a request, so it
553
+ * uses the `runtime` it is given and passes it to what it calls, never the request's scope.
553
554
  */
554
555
  searchText?: PhiBivariantCallback<[
555
556
  PhiCmsWidgetSearchTextArgs<TConfig>
@@ -613,6 +614,13 @@ export type PhiCmsRuntimeRenderRegistry = {
613
614
  ownerModuleIdByLayoutType: ReadonlyMap<string, PhiRuntimeModuleId>;
614
615
  /** The used Modules whose catalog entry says they bring a UI provider through their Client half. */
615
616
  uiProviderModuleIds: ReadonlySet<PhiRuntimeModuleId>;
617
+ /** The Modules active in this Area. */
618
+ activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
619
+ /**
620
+ * Which installed Module owns each Form field type, active here or not. A Form widget mounts the field
621
+ * Providers of the active owners its Form uses, and marks the fields of the others as unavailable.
622
+ */
623
+ ownerModuleIdByFormFieldTypeKey: ReadonlyMap<PhiFormProviderKey, PhiRuntimeModuleId>;
616
624
  /**
617
625
  * How to ask each active Module for the facts it publishes, by the namespace it publishes them under.
618
626
  *
@@ -1129,6 +1137,7 @@ export type PhiResolvedRuntimeModuleSet = {
1129
1137
  platformModuleId: PhiRuntimeModuleId;
1130
1138
  installedOwnerModuleIdByWidgetType: ReadonlyMap<string, PhiRuntimeModuleId>;
1131
1139
  installedOwnerModuleIdByLayoutType: ReadonlyMap<string, PhiRuntimeModuleId>;
1140
+ installedOwnerModuleIdByFormFieldTypeKey: ReadonlyMap<PhiFormProviderKey, PhiRuntimeModuleId>;
1132
1141
  ownerModuleIdByControllerType: ReadonlyMap<string, PhiRuntimeModuleId>;
1133
1142
  areaControllerSettings: readonly PhiRuntimeControllerSetting[];
1134
1143
  };