@phis/ui 0.5.6 → 0.6.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/components/controls/phi-amount-list-control.d.ts +69 -0
- package/components/controls/phi-amount-list-control.js +15 -0
- package/components/controls/phi-background-control.d.ts +9 -1
- package/components/controls/phi-background-control.js +66 -20
- package/components/controls/phi-button-control.js +16 -2
- package/components/root/phi-root-layout.d.ts +1 -0
- package/components/root/phi-root-layout.js +1 -0
- package/components/widgets/config/background-pattern-live.d.ts +25 -0
- package/components/widgets/config/background-pattern-live.js +50 -0
- package/components/widgets/shared/markdown-body-client.d.ts +4 -1
- package/components/widgets/shared/markdown-body-client.js +3 -3
- package/components/widgets/shared/markdown-image-vocabulary.d.ts +19 -6
- package/components/widgets/shared/markdown-image-vocabulary.js +34 -9
- package/components/widgets/shared/markdown-render.d.ts +2 -1
- package/components/widgets/shared/markdown-render.js +4 -1
- package/constants/media.d.ts +2 -0
- package/constants/media.js +2 -0
- package/controls.d.ts +2 -0
- package/controls.js +1 -0
- package/gateway/signet-route.d.ts +24 -0
- package/gateway/signet-route.js +102 -0
- package/gateway/site-proxy.js +14 -7
- package/helpers/phi-metadata.d.ts +8 -6
- package/helpers/phi-metadata.js +9 -2
- package/helpers/phi-signet-head.d.ts +25 -0
- package/helpers/phi-signet-head.js +41 -0
- package/helpers/phi-signet-paths.d.ts +16 -0
- package/helpers/phi-signet-paths.js +19 -0
- package/helpers/phi-signet.d.ts +28 -0
- package/helpers/phi-signet.js +59 -0
- package/next/root-route.js +7 -4
- package/next/site-proxy.js +16 -0
- package/package.json +3 -3
- package/plugins/runtime-modules/area-definitions.d.ts +24 -3
- package/plugins/runtime-modules/area-definitions.js +11 -3
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +8 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/card/config.js +1 -0
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +16 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -1
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +34 -0
- package/plugins/runtime-modules/public/presets.d.ts +12 -0
- package/plugins/runtime-modules/public/presets.js +10 -0
- package/plugins/runtime-modules/public/server.js +1 -1
- package/plugins/runtime-modules/public/trees/phi-default-pub-privacy-page-tree.d.ts +4 -0
- package/plugins/runtime-modules/public/trees/phi-default-pub-privacy-page-tree.js +66 -0
- package/plugins/runtime-modules/public-base-page-references.d.ts +2 -1
- package/plugins/runtime-modules/public-base-page-references.js +2 -1
- package/plugins/runtime-modules/theme/controller/runtime.js +7 -2
- package/plugins/runtime-modules/theme/materialize-images.d.ts +16 -0
- package/plugins/runtime-modules/theme/materialize-images.js +37 -0
- package/styles/amount-list.css +142 -0
- package/styles/controls.css +186 -12
- package/styles/gradients.css +21 -20
- package/theme/phi-theme-blocks.d.ts +7 -6
- package/theme/phi-theme-composition.d.ts +19 -1
- package/theme/phi-theme-composition.js +15 -0
- package/theme/phi-theme-signet.d.ts +25 -0
- package/theme/phi-theme-signet.js +17 -0
- package/types/cms-plugins.d.ts +8 -0
- package/types/core-widget-placements.d.ts +2 -1
- package/types/site-theme.d.ts +17 -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
|
+
}
|
package/styles/controls.css
CHANGED
|
@@ -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
|
-
/* ---
|
|
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
|
|
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
|
-
--
|
|
687
|
-
|
|
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. */
|
|
@@ -773,7 +922,32 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
773
922
|
.phi-markdown-body {
|
|
774
923
|
/* The gap between picture and text, on the Phi scale (`PHI_SPACE.md`), not Ant Design's margins. */
|
|
775
924
|
--phi-markdown-float-gap: var(--phi-padding-md, 34px);
|
|
776
|
-
|
|
925
|
+
/*
|
|
926
|
+
* The step of the line a floated picture takes (`PHI_MARKDOWN_IMAGE_FLOAT_WIDTHS`): the divisor is a power
|
|
927
|
+
* of φ -- φ⁴, φ³, φ² and φ. Without a word it is φ², the golden share above. The Widget sets it for all
|
|
928
|
+
* its pictures on the body, a figure for itself; the width is written out where it is used, because a
|
|
929
|
+
* custom property holding the whole `calc()` would be settled on the body and never see a figure's step.
|
|
930
|
+
*/
|
|
931
|
+
--phi-markdown-float-divisor: 2.618034;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.phi-markdown-body--float-width-small,
|
|
935
|
+
.phi-markdown-figure--width-small {
|
|
936
|
+
--phi-markdown-float-divisor: 6.854102;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.phi-markdown-body--float-width-medium,
|
|
940
|
+
.phi-markdown-figure--width-medium {
|
|
941
|
+
--phi-markdown-float-divisor: 4.236068;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
.phi-markdown-figure--width-large {
|
|
945
|
+
--phi-markdown-float-divisor: 2.618034;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.phi-markdown-body--float-width-xlarge,
|
|
949
|
+
.phi-markdown-figure--width-xlarge {
|
|
950
|
+
--phi-markdown-float-divisor: 1.618034;
|
|
777
951
|
}
|
|
778
952
|
|
|
779
953
|
.phi-markdown-body :is(img):not(:where(.phi-markdown-figure *)) {
|
|
@@ -789,13 +963,13 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
789
963
|
@container (min-width: 560px) {
|
|
790
964
|
.phi-markdown-body--float-start :is(img):not(:where(.phi-markdown-figure *)) {
|
|
791
965
|
float: inline-start;
|
|
792
|
-
width: var(--phi-markdown-float-
|
|
966
|
+
width: calc((100% - var(--phi-markdown-float-gap)) / var(--phi-markdown-float-divisor));
|
|
793
967
|
margin-inline-end: var(--phi-markdown-float-gap);
|
|
794
968
|
}
|
|
795
969
|
|
|
796
970
|
.phi-markdown-body--float-end :is(img):not(:where(.phi-markdown-figure *)) {
|
|
797
971
|
float: inline-end;
|
|
798
|
-
width: var(--phi-markdown-float-
|
|
972
|
+
width: calc((100% - var(--phi-markdown-float-gap)) / var(--phi-markdown-float-divisor));
|
|
799
973
|
margin-inline-start: var(--phi-markdown-float-gap);
|
|
800
974
|
}
|
|
801
975
|
}
|
|
@@ -819,13 +993,13 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
819
993
|
@container (min-width: 560px) {
|
|
820
994
|
.phi-markdown-figure--float-start {
|
|
821
995
|
float: inline-start;
|
|
822
|
-
width: var(--phi-markdown-float-
|
|
996
|
+
width: calc((100% - var(--phi-markdown-float-gap)) / var(--phi-markdown-float-divisor));
|
|
823
997
|
margin-inline-end: var(--phi-markdown-float-gap);
|
|
824
998
|
}
|
|
825
999
|
|
|
826
1000
|
.phi-markdown-figure--float-end {
|
|
827
1001
|
float: inline-end;
|
|
828
|
-
width: var(--phi-markdown-float-
|
|
1002
|
+
width: calc((100% - var(--phi-markdown-float-gap)) / var(--phi-markdown-float-divisor));
|
|
829
1003
|
margin-inline-start: var(--phi-markdown-float-gap);
|
|
830
1004
|
}
|
|
831
1005
|
}
|
package/styles/gradients.css
CHANGED
|
@@ -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
|
-
* (`--
|
|
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
|
-
--
|
|
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
|
-
--
|
|
50
|
-
--
|
|
51
|
-
--
|
|
52
|
-
--
|
|
53
|
-
--
|
|
54
|
-
--
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
--
|
|
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
|
-
--
|
|
80
|
-
--
|
|
81
|
-
--
|
|
82
|
-
--
|
|
83
|
-
--
|
|
84
|
-
--
|
|
85
|
-
--
|
|
86
|
-
--
|
|
87
|
-
--
|
|
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
|
|
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
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
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
|
|
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,25 @@
|
|
|
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
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The Signet a Site wears, and whose it is: `site` where the record states it (a save made it the
|
|
12
|
+
* Site's, `materializePhiThemeBrandSignet`), `set` where the Site only follows a Theme Set that has one.
|
|
13
|
+
*/
|
|
14
|
+
export type PhiThemeSignet = PhiThemeSignetPicture & {
|
|
15
|
+
from: "site" | "set";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The Signet the record itself states, and nothing else.
|
|
19
|
+
*
|
|
20
|
+
* Kept apart from the Set resolution so the route that delivers it can read the record without the
|
|
21
|
+
* Theme blocks: a Set's Signet has no address of its own and is named by the head as a data URL. Only a
|
|
22
|
+
* picture that can be delivered counts: an Asset with a positive id, or an inline `data:image/` picture.
|
|
23
|
+
* Anything else -- a path, an address on another server -- says nothing, and the answer is none.
|
|
24
|
+
*/
|
|
25
|
+
export declare function readPhiThemeSiteSignet(authored: PhiSiteThemeBrandSignet | null | undefined): PhiThemeSignetPicture | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Signet the record itself states, and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* Kept apart from the Set resolution so the route that delivers it can read the record without the
|
|
5
|
+
* Theme blocks: a Set's Signet has no address of its own and is named by the head as a data URL. Only a
|
|
6
|
+
* picture that can be delivered counts: an Asset with a positive id, or an inline `data:image/` picture.
|
|
7
|
+
* Anything else -- a path, an address on another server -- says nothing, and the answer is none.
|
|
8
|
+
*/
|
|
9
|
+
export function readPhiThemeSiteSignet(authored) {
|
|
10
|
+
if (authored?.sourceKind === "asset" && Number.isInteger(authored.assetId) && authored.assetId > 0) {
|
|
11
|
+
return { kind: "asset", assetId: authored.assetId };
|
|
12
|
+
}
|
|
13
|
+
if (authored?.sourceKind === "url" && typeof authored.sourceUrl === "string" && authored.sourceUrl.startsWith("data:image/")) {
|
|
14
|
+
return { kind: "data", source: authored.sourceUrl };
|
|
15
|
+
}
|
|
16
|
+
return null;
|
|
17
|
+
}
|
package/types/cms-plugins.d.ts
CHANGED
|
@@ -315,6 +315,14 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
315
315
|
type: "surface";
|
|
316
316
|
/** Whether the mode is offered; left out, it is. */
|
|
317
317
|
tone?: false;
|
|
318
|
+
}) | (PhiCmsConfigFieldBase & {
|
|
319
|
+
/**
|
|
320
|
+
* A Background Overlay (`PhiBackgroundOverlay`, `components/widgets/config/background.ts`) edited
|
|
321
|
+
* alone, for a Widget that draws one over something of its own, such as the Card over its picture.
|
|
322
|
+
* `key` holds the Overlay; absent or `null` is no Overlay, and choosing "none" removes the key.
|
|
323
|
+
* The Inspector shows the Background Control's Overlay section only (`base={false}`).
|
|
324
|
+
*/
|
|
325
|
+
type: "background-overlay";
|
|
318
326
|
}) | (PhiCmsConfigFieldBase & {
|
|
319
327
|
type: "grid-placement" | "column-count";
|
|
320
328
|
section?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PhiBulletListEntry, PhiBulletListStyle } from "../components/widgets/shared/bullet-list-vocabulary";
|
|
2
|
-
import type { PhiMarkdownImageAspectRatio } from "../components/widgets/shared/markdown-image-vocabulary";
|
|
2
|
+
import type { PhiMarkdownImageAspectRatio, PhiMarkdownImageFloatWidth } from "../components/widgets/shared/markdown-image-vocabulary";
|
|
3
3
|
import type { PhiMarkdownFoldSections } from "../components/widgets/shared/markdown-sections";
|
|
4
4
|
import type { PhiLetterSpacingStep, PhiTextTransform } from "../components/widgets/config/text-case-vocabulary";
|
|
5
5
|
import type { PhiRenderableBlockBase } from "./renderable-block";
|
|
@@ -68,6 +68,7 @@ export type PhiMarkdownWidgetPlacement = PhiWidgetPlacementBase & {
|
|
|
68
68
|
revalidateSeconds?: number;
|
|
69
69
|
textAlign?: PhiMarkdownTextAlign;
|
|
70
70
|
imageFloat?: PhiMarkdownImageFloat;
|
|
71
|
+
imageFloatWidth?: PhiMarkdownImageFloatWidth;
|
|
71
72
|
imageAspectRatio?: PhiMarkdownImageAspectRatio;
|
|
72
73
|
foldSections?: PhiMarkdownFoldSections;
|
|
73
74
|
faqStructuredData?: boolean;
|
package/types/site-theme.d.ts
CHANGED
|
@@ -105,6 +105,17 @@ export type PhiSiteThemeBrandLogo = {
|
|
|
105
105
|
sourceKind: "url";
|
|
106
106
|
sourceUrl: string;
|
|
107
107
|
};
|
|
108
|
+
/**
|
|
109
|
+
* The Site's own Signet: where the browser tab's mark comes from once a save has made it the Site's.
|
|
110
|
+
*
|
|
111
|
+
* The Logo's `asset` and `url` shapes and nothing else -- there is no "none". A Signet is a square the
|
|
112
|
+
* Site either carries or leaves to the followed Set, and a Site that wants no mark simply follows a
|
|
113
|
+
* Set that has none. `url` is the state before a save takes the picture into the Media library (a data
|
|
114
|
+
* URL, a Set's own Signet); an `asset` is the state after.
|
|
115
|
+
*/
|
|
116
|
+
export type PhiSiteThemeBrandSignet = Exclude<PhiSiteThemeBrandLogo, {
|
|
117
|
+
sourceKind: "none";
|
|
118
|
+
}>;
|
|
108
119
|
export type PhiSiteThemeBrandLogos = {
|
|
109
120
|
light?: PhiSiteThemeBrandLogo | null;
|
|
110
121
|
dark?: PhiSiteThemeBrandLogo | null;
|
|
@@ -135,6 +146,12 @@ export type PhiSiteThemeBrand = {
|
|
|
135
146
|
eyebrow?: string | null;
|
|
136
147
|
/** The Logo, one picture per mode. A mode the record says nothing about wears the Theme Set's. */
|
|
137
148
|
logo?: PhiSiteThemeBrandLogos | null;
|
|
149
|
+
/**
|
|
150
|
+
* The Signet, one picture for both modes. Absent means the followed Theme Set's, and that is how a
|
|
151
|
+
* Site that never saved a Theme still wears one: a save (`materializePhiThemeBrandSignet`) takes a
|
|
152
|
+
* Module Set's Signet into the Media library and writes the Asset here, the way it does the Logo.
|
|
153
|
+
*/
|
|
154
|
+
signet?: PhiSiteThemeBrandSignet | null;
|
|
138
155
|
/** What the Logo says to somebody who cannot see it. Falls back to the asset's own alt text. */
|
|
139
156
|
logoAlt?: string | null;
|
|
140
157
|
/**
|