payload-canvas 0.6.6 → 0.6.7

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,154 +1,154 @@
1
- // Localization in the editor: the top bar's switcher, the inspector note and field marks, and
2
- // the outline dot. Payload CSS variables only.
3
-
4
- @layer payload-default {
5
- .builder-locale-switch {
6
- display: inline-flex;
7
- flex: none;
8
- align-items: center;
9
- gap: 4px;
10
- height: 28px;
11
- padding: 0 6px 0 8px;
12
- border: 1px solid var(--be-border);
13
- border-radius: var(--be-radius);
14
- background: transparent;
15
- color: var(--theme-text);
16
- font: inherit;
17
- font-size: var(--be-text-m);
18
- font-weight: var(--be-weight-strong);
19
- cursor: pointer;
20
-
21
- &:hover {
22
- background: var(--be-hover);
23
- }
24
-
25
- &:focus-visible {
26
- outline: 2px solid var(--be-accent);
27
- outline-offset: 1px;
28
- }
29
-
30
- svg {
31
- color: var(--be-muted);
32
- }
33
- }
34
-
35
- // Editing another language than the default: the switcher stands out a little.
36
- .builder-locale-switch--other {
37
- border-color: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 55%, transparent);
38
- background: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 10%, transparent);
39
- }
40
-
41
- .builder-locale-switch__code {
42
- letter-spacing: 0.02em;
43
- }
44
-
45
- .builder-locale-note {
46
- display: flex;
47
- gap: 8px;
48
- margin: 0 0 12px;
49
- padding: 8px 10px;
50
- border: 1px solid color-mix(in srgb, var(--theme-warning-500, #f59e0b) 40%, transparent);
51
- border-radius: var(--be-radius-m);
52
- background: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 8%, transparent);
53
- color: var(--theme-text);
54
- font-size: var(--be-text-m);
55
- line-height: 1.4;
56
-
57
- > svg {
58
- flex: none;
59
- margin-top: 2px;
60
- color: var(--theme-warning-500, #f59e0b);
61
- }
62
-
63
- p {
64
- margin: 0;
65
- }
66
-
67
- .builder-locale-field__action {
68
- margin-top: 6px;
69
- }
70
- }
71
-
72
- .builder-locale-field {
73
- display: flex;
74
- flex-direction: column;
75
- gap: 4px;
76
- }
77
-
78
- // The input shows the fallback language's value: greyed.
79
- .builder-locale-field[data-locale-status='untranslated'] {
80
- input,
81
- textarea,
82
- .rich-text-lexical,
83
- .react-select,
84
- .upload,
85
- .relationship {
86
- opacity: 0.6;
87
- }
88
- }
89
-
90
- .builder-locale-field__mark {
91
- display: flex;
92
- flex-wrap: wrap;
93
- align-items: center;
94
- gap: 4px 8px;
95
- margin-top: -6px;
96
- color: var(--be-muted);
97
- font-size: var(--be-text-s);
98
- }
99
-
100
- .builder-locale-field[data-locale-status='untranslated'] .builder-locale-field__state,
101
- .builder-locale-field[data-locale-status='missing'] .builder-locale-field__state {
102
- color: var(--theme-warning-500, #f59e0b);
103
- }
104
-
105
- .builder-locale-field__action {
106
- padding: 0;
107
- border: 0;
108
- background: none;
109
- color: var(--theme-text);
110
- font: inherit;
111
- font-size: var(--be-text-s);
112
- text-decoration: underline;
113
- text-underline-offset: 2px;
114
- cursor: pointer;
115
-
116
- &:hover {
117
- color: var(--be-accent-strong);
118
- }
119
-
120
- &:focus-visible {
121
- outline: 2px solid var(--be-accent);
122
- outline-offset: 1px;
123
- }
124
- }
125
-
126
- // Outline: a block with props that show the fallback language.
127
- .builder-editor__row-untranslated {
128
- flex: none;
129
- width: 6px;
130
- height: 6px;
131
- margin-left: auto;
132
- border-radius: 50%;
133
- background: var(--theme-warning-500, #f59e0b);
134
- }
135
-
136
- .builder-editor__row-untranslated + .builder-editor__row-problem {
137
- margin-left: 4px;
138
- }
139
-
140
- // Presence: a collaborator's language under their initials.
141
- .builder-presence__locale {
142
- position: absolute;
143
- right: -6px;
144
- bottom: -5px;
145
- padding: 0 3px;
146
- border-radius: 3px;
147
- background: var(--theme-elevation-800);
148
- color: var(--theme-elevation-0);
149
- font-size: 8px;
150
- font-weight: 700;
151
- line-height: 11px;
152
- letter-spacing: 0.02em;
153
- }
154
- }
1
+ // Localization in the editor: the top bar's switcher, the inspector note and field marks, and
2
+ // the outline dot. Payload CSS variables only.
3
+
4
+ @layer payload-default {
5
+ .builder-locale-switch {
6
+ display: inline-flex;
7
+ flex: none;
8
+ align-items: center;
9
+ gap: 4px;
10
+ height: 28px;
11
+ padding: 0 6px 0 8px;
12
+ border: 1px solid var(--be-border);
13
+ border-radius: var(--be-radius);
14
+ background: transparent;
15
+ color: var(--theme-text);
16
+ font: inherit;
17
+ font-size: var(--be-text-m);
18
+ font-weight: var(--be-weight-strong);
19
+ cursor: pointer;
20
+
21
+ &:hover {
22
+ background: var(--be-hover);
23
+ }
24
+
25
+ &:focus-visible {
26
+ outline: 2px solid var(--be-accent);
27
+ outline-offset: 1px;
28
+ }
29
+
30
+ svg {
31
+ color: var(--be-muted);
32
+ }
33
+ }
34
+
35
+ // Editing another language than the default: the switcher stands out a little.
36
+ .builder-locale-switch--other {
37
+ border-color: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 55%, transparent);
38
+ background: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 10%, transparent);
39
+ }
40
+
41
+ .builder-locale-switch__code {
42
+ letter-spacing: 0.02em;
43
+ }
44
+
45
+ .builder-locale-note {
46
+ display: flex;
47
+ gap: 8px;
48
+ margin: 0 0 12px;
49
+ padding: 8px 10px;
50
+ border: 1px solid color-mix(in srgb, var(--theme-warning-500, #f59e0b) 40%, transparent);
51
+ border-radius: var(--be-radius-m);
52
+ background: color-mix(in srgb, var(--theme-warning-500, #f59e0b) 8%, transparent);
53
+ color: var(--theme-text);
54
+ font-size: var(--be-text-m);
55
+ line-height: 1.4;
56
+
57
+ > svg {
58
+ flex: none;
59
+ margin-top: 2px;
60
+ color: var(--theme-warning-500, #f59e0b);
61
+ }
62
+
63
+ p {
64
+ margin: 0;
65
+ }
66
+
67
+ .builder-locale-field__action {
68
+ margin-top: 6px;
69
+ }
70
+ }
71
+
72
+ .builder-locale-field {
73
+ display: flex;
74
+ flex-direction: column;
75
+ gap: 4px;
76
+ }
77
+
78
+ // The input shows the fallback language's value: greyed.
79
+ .builder-locale-field[data-locale-status='untranslated'] {
80
+ input,
81
+ textarea,
82
+ .rich-text-lexical,
83
+ .react-select,
84
+ .upload,
85
+ .relationship {
86
+ opacity: 0.6;
87
+ }
88
+ }
89
+
90
+ .builder-locale-field__mark {
91
+ display: flex;
92
+ flex-wrap: wrap;
93
+ align-items: center;
94
+ gap: 4px 8px;
95
+ margin-top: -6px;
96
+ color: var(--be-muted);
97
+ font-size: var(--be-text-s);
98
+ }
99
+
100
+ .builder-locale-field[data-locale-status='untranslated'] .builder-locale-field__state,
101
+ .builder-locale-field[data-locale-status='missing'] .builder-locale-field__state {
102
+ color: var(--theme-warning-500, #f59e0b);
103
+ }
104
+
105
+ .builder-locale-field__action {
106
+ padding: 0;
107
+ border: 0;
108
+ background: none;
109
+ color: var(--theme-text);
110
+ font: inherit;
111
+ font-size: var(--be-text-s);
112
+ text-decoration: underline;
113
+ text-underline-offset: 2px;
114
+ cursor: pointer;
115
+
116
+ &:hover {
117
+ color: var(--be-accent-strong);
118
+ }
119
+
120
+ &:focus-visible {
121
+ outline: 2px solid var(--be-accent);
122
+ outline-offset: 1px;
123
+ }
124
+ }
125
+
126
+ // Outline: a block with props that show the fallback language.
127
+ .builder-editor__row-untranslated {
128
+ flex: none;
129
+ width: 6px;
130
+ height: 6px;
131
+ margin-left: auto;
132
+ border-radius: 50%;
133
+ background: var(--theme-warning-500, #f59e0b);
134
+ }
135
+
136
+ .builder-editor__row-untranslated + .builder-editor__row-problem {
137
+ margin-left: 4px;
138
+ }
139
+
140
+ // Presence: a collaborator's language under their initials.
141
+ .builder-presence__locale {
142
+ position: absolute;
143
+ right: -6px;
144
+ bottom: -5px;
145
+ padding: 0 3px;
146
+ border-radius: 3px;
147
+ background: var(--theme-elevation-800);
148
+ color: var(--theme-elevation-0);
149
+ font-size: 8px;
150
+ font-weight: 700;
151
+ line-height: 11px;
152
+ letter-spacing: 0.02em;
153
+ }
154
+ }
@@ -1,132 +1,132 @@
1
- // Menus (`Menu.tsx`). Payload CSS variables only. The editor variables (`--be-*`) have fallbacks,
2
- // so a menu still looks right if it renders outside the editor root.
3
-
4
- @layer payload-default {
5
- .builder-menu__positioner {
6
- z-index: 1000;
7
- outline: 0;
8
- }
9
-
10
- .builder-menu {
11
- box-sizing: border-box;
12
- min-width: 220px;
13
- max-width: 320px;
14
- max-height: var(--available-height, 480px);
15
- overflow: auto;
16
- padding: 4px;
17
- border: 1px solid var(--be-border, var(--theme-elevation-150));
18
- border-radius: var(--be-radius-m, var(--style-radius-m, 6px));
19
- background: var(--theme-bg);
20
- color: var(--theme-text);
21
- font-family: var(--font-body);
22
- font-size: var(--be-text-m);
23
- line-height: 1.3;
24
- box-shadow: var(--be-shadow);
25
- outline: 0;
26
- transform-origin: var(--transform-origin);
27
-
28
- @media (prefers-reduced-motion: no-preference) {
29
- transition:
30
- opacity 90ms ease,
31
- transform 90ms ease;
32
- }
33
-
34
- &[data-starting-style],
35
- &[data-ending-style] {
36
- opacity: 0;
37
- transform: scale(0.98);
38
- }
39
- }
40
-
41
- .builder-menu__item {
42
- display: flex;
43
- align-items: center;
44
- gap: 8px;
45
- height: 30px;
46
- padding: 0 8px;
47
- border-radius: var(--be-radius, var(--style-radius-s, 4px));
48
- color: var(--theme-text);
49
- text-decoration: none;
50
- white-space: nowrap;
51
- cursor: default;
52
- outline: 0;
53
- user-select: none;
54
-
55
- svg {
56
- flex: none;
57
- color: var(--be-muted, var(--theme-elevation-500));
58
- }
59
-
60
- &[data-highlighted] {
61
- background: var(--be-hover, var(--theme-elevation-100));
62
- }
63
-
64
- &[data-disabled] {
65
- opacity: 0.4;
66
- }
67
- }
68
-
69
- // A disabled destructive item is neutral: red says "this acts", and it cannot act.
70
- .builder-menu__item--danger:not([data-disabled]) {
71
- color: var(--theme-error-500);
72
-
73
- svg {
74
- color: currentColor;
75
- }
76
-
77
- &[data-highlighted] {
78
- background: color-mix(in srgb, var(--theme-error-500) 12%, transparent);
79
- }
80
- }
81
-
82
- .builder-menu__icon {
83
- flex: none;
84
- width: 14px;
85
- }
86
-
87
- .builder-menu__label {
88
- flex: 1;
89
- min-width: 0;
90
- overflow: hidden;
91
- text-overflow: ellipsis;
92
- }
93
-
94
- // `.builder-menu` in front: beats the editor's general `kbd` style.
95
- .builder-menu .builder-menu__keys {
96
- flex: none;
97
- min-width: 0;
98
- height: auto;
99
- margin-left: auto;
100
- padding: 0 0 0 16px;
101
- border: 0;
102
- background: none;
103
- color: var(--be-subtle, var(--theme-elevation-400));
104
- font: inherit;
105
- font-size: var(--be-text-s);
106
- }
107
-
108
- .builder-menu .builder-menu__check {
109
- color: var(--be-accent, var(--theme-success-500));
110
- }
111
-
112
- .builder-menu__sep {
113
- height: 1px;
114
- margin: 4px 0;
115
- border: 0;
116
- background: var(--be-border-soft, var(--theme-elevation-100));
117
- }
118
-
119
- .builder-menu__note {
120
- margin: 4px 0 0;
121
- padding: 6px 8px 4px;
122
- border-top: 1px solid var(--be-border-soft, var(--theme-elevation-100));
123
- color: var(--be-muted, var(--theme-elevation-500));
124
- font-size: var(--be-text-s);
125
- }
126
-
127
- // The highlight shows the keyboard position; no focus ring inside the menu.
128
- .builder-editor .builder-menu:focus-visible,
129
- .builder-editor .builder-menu__item:focus-visible {
130
- outline: 0;
131
- }
132
- }
1
+ // Menus (`Menu.tsx`). Payload CSS variables only. The editor variables (`--be-*`) have fallbacks,
2
+ // so a menu still looks right if it renders outside the editor root.
3
+
4
+ @layer payload-default {
5
+ .builder-menu__positioner {
6
+ z-index: 1000;
7
+ outline: 0;
8
+ }
9
+
10
+ .builder-menu {
11
+ box-sizing: border-box;
12
+ min-width: 220px;
13
+ max-width: 320px;
14
+ max-height: var(--available-height, 480px);
15
+ overflow: auto;
16
+ padding: 4px;
17
+ border: 1px solid var(--be-border, var(--theme-elevation-150));
18
+ border-radius: var(--be-radius-m, var(--style-radius-m, 6px));
19
+ background: var(--theme-bg);
20
+ color: var(--theme-text);
21
+ font-family: var(--font-body);
22
+ font-size: var(--be-text-m);
23
+ line-height: 1.3;
24
+ box-shadow: var(--be-shadow);
25
+ outline: 0;
26
+ transform-origin: var(--transform-origin);
27
+
28
+ @media (prefers-reduced-motion: no-preference) {
29
+ transition:
30
+ opacity 90ms ease,
31
+ transform 90ms ease;
32
+ }
33
+
34
+ &[data-starting-style],
35
+ &[data-ending-style] {
36
+ opacity: 0;
37
+ transform: scale(0.98);
38
+ }
39
+ }
40
+
41
+ .builder-menu__item {
42
+ display: flex;
43
+ align-items: center;
44
+ gap: 8px;
45
+ height: 30px;
46
+ padding: 0 8px;
47
+ border-radius: var(--be-radius, var(--style-radius-s, 4px));
48
+ color: var(--theme-text);
49
+ text-decoration: none;
50
+ white-space: nowrap;
51
+ cursor: default;
52
+ outline: 0;
53
+ user-select: none;
54
+
55
+ svg {
56
+ flex: none;
57
+ color: var(--be-muted, var(--theme-elevation-500));
58
+ }
59
+
60
+ &[data-highlighted] {
61
+ background: var(--be-hover, var(--theme-elevation-100));
62
+ }
63
+
64
+ &[data-disabled] {
65
+ opacity: 0.4;
66
+ }
67
+ }
68
+
69
+ // A disabled destructive item is neutral: red says "this acts", and it cannot act.
70
+ .builder-menu__item--danger:not([data-disabled]) {
71
+ color: var(--theme-error-500);
72
+
73
+ svg {
74
+ color: currentColor;
75
+ }
76
+
77
+ &[data-highlighted] {
78
+ background: color-mix(in srgb, var(--theme-error-500) 12%, transparent);
79
+ }
80
+ }
81
+
82
+ .builder-menu__icon {
83
+ flex: none;
84
+ width: 14px;
85
+ }
86
+
87
+ .builder-menu__label {
88
+ flex: 1;
89
+ min-width: 0;
90
+ overflow: hidden;
91
+ text-overflow: ellipsis;
92
+ }
93
+
94
+ // `.builder-menu` in front: beats the editor's general `kbd` style.
95
+ .builder-menu .builder-menu__keys {
96
+ flex: none;
97
+ min-width: 0;
98
+ height: auto;
99
+ margin-left: auto;
100
+ padding: 0 0 0 16px;
101
+ border: 0;
102
+ background: none;
103
+ color: var(--be-subtle, var(--theme-elevation-400));
104
+ font: inherit;
105
+ font-size: var(--be-text-s);
106
+ }
107
+
108
+ .builder-menu .builder-menu__check {
109
+ color: var(--be-accent, var(--theme-success-500));
110
+ }
111
+
112
+ .builder-menu__sep {
113
+ height: 1px;
114
+ margin: 4px 0;
115
+ border: 0;
116
+ background: var(--be-border-soft, var(--theme-elevation-100));
117
+ }
118
+
119
+ .builder-menu__note {
120
+ margin: 4px 0 0;
121
+ padding: 6px 8px 4px;
122
+ border-top: 1px solid var(--be-border-soft, var(--theme-elevation-100));
123
+ color: var(--be-muted, var(--theme-elevation-500));
124
+ font-size: var(--be-text-s);
125
+ }
126
+
127
+ // The highlight shows the keyboard position; no focus ring inside the menu.
128
+ .builder-editor .builder-menu:focus-visible,
129
+ .builder-editor .builder-menu__item:focus-visible {
130
+ outline: 0;
131
+ }
132
+ }