@byline/richtext-lexical 6.10.0 → 6.11.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 (60) hide show
  1. package/dist/field/content-editable.css +22 -18
  2. package/dist/field/editor-component.css +33 -29
  3. package/dist/field/editor.css +1218 -1214
  4. package/dist/field/extensions/admonition/admonition-modal.css +20 -16
  5. package/dist/field/extensions/admonition/admonition-node.css +114 -110
  6. package/dist/field/extensions/admonition/icons/danger-icon.css +13 -9
  7. package/dist/field/extensions/admonition/icons/note-icon.css +13 -9
  8. package/dist/field/extensions/admonition/icons/tip-icon.css +13 -9
  9. package/dist/field/extensions/admonition/icons/warning-icon.css +13 -9
  10. package/dist/field/extensions/auto-embed/auto-embed-modal.css +14 -10
  11. package/dist/field/extensions/floating-text-format/index.css +130 -126
  12. package/dist/field/extensions/inline-image/inline-image-modal.css +120 -116
  13. package/dist/field/extensions/inline-image/inline-image-node-component.css +243 -239
  14. package/dist/field/extensions/layout/insert-layout-modal.css +16 -12
  15. package/dist/field/extensions/link/floating-link-editor.css +113 -109
  16. package/dist/field/extensions/link/link-target-fields.css +61 -57
  17. package/dist/field/normalize/adapted-notice.css +2 -4
  18. package/dist/field/plugins/table-plugin/table-modal.css +17 -13
  19. package/dist/field/themes/lexical-editor-theme.css +471 -467
  20. package/dist/field/ui/button.css +28 -24
  21. package/dist/field/ui/checkbox.css +43 -39
  22. package/dist/field/ui/color-picker.css +69 -65
  23. package/dist/field/ui/dialog.css +18 -14
  24. package/dist/field/ui/input.css +23 -19
  25. package/dist/field/ui/modal.css +66 -62
  26. package/dist/field/ui/placeholder.css +25 -21
  27. package/dist/field/ui/select.css +32 -28
  28. package/dist/field/ui/text-area.css +29 -25
  29. package/dist/richtext-field_module.css +21 -17
  30. package/package.json +6 -6
  31. package/src/field/content-editable.css +31 -17
  32. package/src/field/editor-component.css +56 -40
  33. package/src/field/editor.css +1248 -1232
  34. package/src/field/extensions/admonition/admonition-modal.css +32 -16
  35. package/src/field/extensions/admonition/admonition-node.css +105 -89
  36. package/src/field/extensions/admonition/icons/danger-icon.css +25 -9
  37. package/src/field/extensions/admonition/icons/note-icon.css +25 -9
  38. package/src/field/extensions/admonition/icons/tip-icon.css +25 -9
  39. package/src/field/extensions/admonition/icons/warning-icon.css +25 -9
  40. package/src/field/extensions/auto-embed/auto-embed-modal.css +25 -9
  41. package/src/field/extensions/floating-text-format/index.css +142 -126
  42. package/src/field/extensions/inline-image/inline-image-modal.css +144 -128
  43. package/src/field/extensions/inline-image/inline-image-node-component.css +258 -242
  44. package/src/field/extensions/layout/insert-layout-modal.css +28 -12
  45. package/src/field/extensions/link/floating-link-editor.css +129 -113
  46. package/src/field/extensions/link/link-target-fields.css +68 -52
  47. package/src/field/normalize/adapted-notice.css +5 -4
  48. package/src/field/plugins/table-plugin/table-modal.css +29 -13
  49. package/src/field/themes/lexical-editor-theme.css +508 -494
  50. package/src/field/ui/button.css +46 -30
  51. package/src/field/ui/checkbox.css +62 -46
  52. package/src/field/ui/color-picker.css +89 -73
  53. package/src/field/ui/dialog.css +30 -14
  54. package/src/field/ui/input.css +38 -22
  55. package/src/field/ui/modal.css +81 -65
  56. package/src/field/ui/placeholder.css +36 -20
  57. package/src/field/ui/select.css +46 -30
  58. package/src/field/ui/text-area.css +45 -29
  59. package/src/lexical-editor.tsx +2 -0
  60. package/src/richtext-field.module.css +38 -22
@@ -1,148 +1,164 @@
1
- .floating-text-format-popup {
2
- display: flex;
3
- background: #fff;
4
- padding: 4px;
5
- vertical-align: middle;
6
- position: absolute;
7
- top: 0;
8
- left: 0;
9
- z-index: 10;
10
- opacity: 0;
11
- background-color: #fff;
12
- box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
13
- border-radius: 6px;
14
- transition: opacity 0.5s;
15
- height: 35px;
16
- will-change: transform;
17
- }
18
-
19
- .floating-text-format-popup button.popup-item {
20
- border: 0;
21
- display: flex;
22
- background: none;
23
- border-radius: 6px;
24
- cursor: pointer;
25
- vertical-align: middle;
26
- }
27
-
28
- .floating-text-format-popup button.popup-item:disabled {
29
- cursor: not-allowed;
30
- }
1
+ @layer base,
2
+ byline-base,
3
+ theme,
4
+ byline-theme,
5
+ byline-functional,
6
+ byline-typography,
7
+ components,
8
+ byline-components,
9
+ overrides,
10
+ byline-utilities,
11
+ utilities;
12
+
13
+ @layer byline-components.primitives, byline-components.cms;
14
+
15
+ @layer byline-components.cms {
16
+ .floating-text-format-popup {
17
+ display: flex;
18
+ background: #fff;
19
+ padding: 4px;
20
+ vertical-align: middle;
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ z-index: 10;
25
+ opacity: 0;
26
+ background-color: #fff;
27
+ box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
28
+ border-radius: 6px;
29
+ transition: opacity 0.5s;
30
+ height: 35px;
31
+ will-change: transform;
32
+ }
31
33
 
32
- .floating-text-format-popup button.popup-item.spaced {
33
- margin-right: 2px;
34
- }
34
+ .floating-text-format-popup button.popup-item {
35
+ border: 0;
36
+ display: flex;
37
+ background: none;
38
+ border-radius: 6px;
39
+ cursor: pointer;
40
+ vertical-align: middle;
41
+ }
35
42
 
36
- .floating-text-format-popup button.popup-item i.format {
37
- background-size: contain;
38
- display: inline-block;
39
- height: 18px;
40
- width: 18px;
41
- margin-top: 3px;
42
- vertical-align: -0.25em;
43
- opacity: 0.6;
44
- }
43
+ .floating-text-format-popup button.popup-item:disabled {
44
+ cursor: not-allowed;
45
+ }
45
46
 
46
- .floating-text-format-popup button.popup-item:disabled i.format {
47
- opacity: 0.2;
48
- }
47
+ .floating-text-format-popup button.popup-item.spaced {
48
+ margin-right: 2px;
49
+ }
49
50
 
50
- .floating-text-format-popup button.popup-item.active {
51
- background-color: rgba(223, 232, 250, 0.3);
52
- }
51
+ .floating-text-format-popup button.popup-item i.format {
52
+ background-size: contain;
53
+ display: inline-block;
54
+ height: 18px;
55
+ width: 18px;
56
+ margin-top: 3px;
57
+ vertical-align: -0.25em;
58
+ opacity: 0.6;
59
+ }
53
60
 
54
- .floating-text-format-popup button.popup-item.active i {
55
- opacity: 1;
56
- }
61
+ .floating-text-format-popup button.popup-item:disabled i.format {
62
+ opacity: 0.2;
63
+ }
57
64
 
58
- .floating-text-format-popup .popup-item:hover:not([disabled]) {
59
- background-color: #eee;
60
- }
65
+ .floating-text-format-popup button.popup-item.active {
66
+ background-color: rgba(223, 232, 250, 0.3);
67
+ }
61
68
 
62
- .floating-text-format-popup select.popup-item {
63
- border: 0;
64
- display: flex;
65
- background: none;
66
- border-radius: 6px;
67
- padding: 8px;
68
- vertical-align: middle;
69
- -webkit-appearance: none;
70
- -moz-appearance: none;
71
- width: 70px;
72
- font-size: 14px;
73
- color: #777;
74
- text-overflow: ellipsis;
75
- }
69
+ .floating-text-format-popup button.popup-item.active i {
70
+ opacity: 1;
71
+ }
76
72
 
77
- .floating-text-format-popup select.code-language {
78
- text-transform: capitalize;
79
- width: 130px;
80
- }
73
+ .floating-text-format-popup .popup-item:hover:not([disabled]) {
74
+ background-color: #eee;
75
+ }
81
76
 
82
- .floating-text-format-popup .popup-item .text {
83
- display: flex;
84
- line-height: 20px;
85
- width: 200px;
86
- vertical-align: middle;
87
- font-size: 14px;
88
- color: #777;
89
- text-overflow: ellipsis;
90
- overflow: hidden;
91
- height: 20px;
92
- text-align: left;
93
- }
77
+ .floating-text-format-popup select.popup-item {
78
+ border: 0;
79
+ display: flex;
80
+ background: none;
81
+ border-radius: 6px;
82
+ padding: 8px;
83
+ vertical-align: middle;
84
+ -webkit-appearance: none;
85
+ -moz-appearance: none;
86
+ width: 70px;
87
+ font-size: 14px;
88
+ color: #777;
89
+ text-overflow: ellipsis;
90
+ }
94
91
 
95
- .floating-text-format-popup .popup-item .icon {
96
- display: flex;
97
- width: 20px;
98
- height: 20px;
99
- user-select: none;
100
- margin-right: 8px;
101
- line-height: 16px;
102
- background-size: contain;
103
- }
92
+ .floating-text-format-popup select.code-language {
93
+ text-transform: capitalize;
94
+ width: 130px;
95
+ }
104
96
 
105
- .floating-text-format-popup i.chevron-down {
106
- margin-top: 3px;
107
- width: 16px;
108
- height: 16px;
109
- display: flex;
110
- user-select: none;
111
- }
97
+ .floating-text-format-popup .popup-item .text {
98
+ display: flex;
99
+ line-height: 20px;
100
+ width: 200px;
101
+ vertical-align: middle;
102
+ font-size: 14px;
103
+ color: #777;
104
+ text-overflow: ellipsis;
105
+ overflow: hidden;
106
+ height: 20px;
107
+ text-align: left;
108
+ }
112
109
 
113
- .floating-text-format-popup i.chevron-down.inside {
114
- width: 16px;
115
- height: 16px;
116
- display: flex;
117
- margin-left: -25px;
118
- margin-top: 11px;
119
- margin-right: 10px;
120
- pointer-events: none;
121
- }
110
+ .floating-text-format-popup .popup-item .icon {
111
+ display: flex;
112
+ width: 20px;
113
+ height: 20px;
114
+ user-select: none;
115
+ margin-right: 8px;
116
+ line-height: 16px;
117
+ background-size: contain;
118
+ }
122
119
 
123
- .floating-text-format-popup .divider {
124
- width: 1px;
125
- background-color: #eee;
126
- margin: 0 4px;
127
- }
120
+ .floating-text-format-popup i.chevron-down {
121
+ margin-top: 3px;
122
+ width: 16px;
123
+ height: 16px;
124
+ display: flex;
125
+ user-select: none;
126
+ }
128
127
 
129
- @media (max-width: 1024px) {
130
- .floating-text-format-popup button.insert-comment {
131
- display: none;
128
+ .floating-text-format-popup i.chevron-down.inside {
129
+ width: 16px;
130
+ height: 16px;
131
+ display: flex;
132
+ margin-left: -25px;
133
+ margin-top: 11px;
134
+ margin-right: 10px;
135
+ pointer-events: none;
132
136
  }
133
- }
134
137
 
135
- .dark {
136
- .floating-text-format-popup {
137
- background-color: var(--canvas-800);
138
- border: 1px solid var(--border-color);
138
+ .floating-text-format-popup .divider {
139
+ width: 1px;
140
+ background-color: #eee;
141
+ margin: 0 4px;
139
142
  }
140
143
 
141
- .floating-text-format-popup i {
142
- filter: invert(1);
144
+ @media (max-width: 1024px) {
145
+ .floating-text-format-popup button.insert-comment {
146
+ display: none;
147
+ }
143
148
  }
144
149
 
145
- .floating-text-format-popup .popup-item:hover:not([disabled]) {
146
- background-color: #1c1c1c;
150
+ .dark {
151
+ .floating-text-format-popup {
152
+ background-color: var(--canvas-800);
153
+ border: 1px solid var(--border-color);
154
+ }
155
+
156
+ .floating-text-format-popup i {
157
+ filter: invert(1);
158
+ }
159
+
160
+ .floating-text-format-popup .popup-item:hover:not([disabled]) {
161
+ background-color: #1c1c1c;
162
+ }
147
163
  }
148
164
  }
@@ -1,3 +1,17 @@
1
+ @layer base,
2
+ byline-base,
3
+ theme,
4
+ byline-theme,
5
+ byline-functional,
6
+ byline-typography,
7
+ components,
8
+ byline-components,
9
+ overrides,
10
+ byline-utilities,
11
+ utilities;
12
+
13
+ @layer byline-components.primitives, byline-components.cms;
14
+
1
15
  /**
2
16
  * Inline image modal — image picker row.
3
17
  *
@@ -6,154 +20,156 @@
6
20
  * components. Colours use the design tokens so the row is theme-aware.
7
21
  */
8
22
 
9
- .inline-image-modal-picker {
10
- display: flex;
11
- align-items: center;
12
- gap: 0.75rem;
13
- }
14
-
15
- .inline-image-modal-thumb,
16
- .inline-image-modal-thumb-placeholder {
17
- flex-shrink: 0;
18
- width: 8rem;
19
- height: 8rem;
20
- border-radius: 0.25rem;
21
- border: 1px solid var(--border-color);
22
- }
23
+ @layer byline-components.cms {
24
+ .inline-image-modal-picker {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: 0.75rem;
28
+ }
23
29
 
24
- .inline-image-modal-thumb {
25
- object-fit: cover;
26
- }
30
+ .inline-image-modal-thumb,
31
+ .inline-image-modal-thumb-placeholder {
32
+ flex-shrink: 0;
33
+ width: 8rem;
34
+ height: 8rem;
35
+ border-radius: 0.25rem;
36
+ border: 1px solid var(--border-color);
37
+ }
27
38
 
28
- .inline-image-modal-thumb-placeholder {
29
- display: flex;
30
- align-items: center;
31
- justify-content: center;
32
- background-color: var(--surface-subtle);
33
- color: var(--text-subtle);
34
- font-size: 0.75rem;
35
- }
39
+ .inline-image-modal-thumb {
40
+ object-fit: cover;
41
+ }
36
42
 
37
- .inline-image-modal-picker-details {
38
- display: flex;
39
- flex: 1;
40
- min-width: 0;
41
- flex-direction: column;
42
- align-items: flex-start;
43
- gap: 0.5rem;
44
- }
43
+ .inline-image-modal-thumb-placeholder {
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ background-color: var(--surface-subtle);
48
+ color: var(--text-subtle);
49
+ font-size: 0.75rem;
50
+ }
45
51
 
46
- .inline-image-modal-change-btn {
47
- flex-shrink: 0;
48
- min-width: 70px;
49
- }
52
+ .inline-image-modal-picker-details {
53
+ display: flex;
54
+ flex: 1;
55
+ min-width: 0;
56
+ flex-direction: column;
57
+ align-items: flex-start;
58
+ gap: 0.5rem;
59
+ }
50
60
 
51
- .inline-image-modal-title {
52
- align-self: stretch;
53
- min-width: 0;
54
- overflow: hidden;
55
- white-space: nowrap;
56
- text-overflow: ellipsis;
57
- font-size: 0.875rem;
58
- color: var(--text-subtle);
59
- }
61
+ .inline-image-modal-change-btn {
62
+ flex-shrink: 0;
63
+ min-width: 70px;
64
+ }
60
65
 
61
- /**
62
- * Tab strip — matched to the admin document editor's tabs.
63
- *
64
- * The shared `@byline/ui` Tabs ships a boxed look (bordered root, bordered
65
- * list). Inside this modal we want the admin surface's idiom instead:
66
- * borderless triggers on a hairline rule, muted by default, primary text
67
- * plus a 2px primary underline when selected. Rather than change the
68
- * shared component — which every other Tabs consumer would inherit — the
69
- * overrides are scoped to `.inline-image-modal-tabs`.
70
- *
71
- * Base UI 1.8 marks the selected trigger with `data-active` (not
72
- * `data-selected`). Colours, weights and transitions mirror
73
- * `packages/admin/src/presentation/tabs.module.css` so the two strips stay
74
- * recognisably the same control.
75
- */
66
+ .inline-image-modal-title {
67
+ align-self: stretch;
68
+ min-width: 0;
69
+ overflow: hidden;
70
+ white-space: nowrap;
71
+ text-overflow: ellipsis;
72
+ font-size: 0.875rem;
73
+ color: var(--text-subtle);
74
+ }
76
75
 
77
- .inline-image-modal-tabs.byline-tabs-root {
78
- padding: 0;
79
- gap: 0;
80
- border: none;
81
- border-radius: 0;
82
- }
76
+ /**
77
+ * Tab strip — matched to the admin document editor's tabs.
78
+ *
79
+ * The shared `@byline/ui` Tabs ships a boxed look (bordered root, bordered
80
+ * list). Inside this modal we want the admin surface's idiom instead:
81
+ * borderless triggers on a hairline rule, muted by default, primary text
82
+ * plus a 2px primary underline when selected. Rather than change the
83
+ * shared component — which every other Tabs consumer would inherit — the
84
+ * overrides are scoped to `.inline-image-modal-tabs`.
85
+ *
86
+ * Base UI 1.8 marks the selected trigger with `data-active` (not
87
+ * `data-selected`). Colours, weights and transitions mirror
88
+ * `packages/admin/src/presentation/tabs.module.css` so the two strips stay
89
+ * recognisably the same control.
90
+ */
91
+
92
+ .inline-image-modal-tabs.byline-tabs-root {
93
+ padding: 0;
94
+ gap: 0;
95
+ border: none;
96
+ border-radius: 0;
97
+ }
83
98
 
84
- .inline-image-modal-tabs .byline-tabs-list {
85
- gap: 1.25rem;
86
- padding: 0;
87
- border: none;
88
- border-bottom: 1px solid var(--border-color);
89
- border-radius: 0;
90
- }
99
+ .inline-image-modal-tabs .byline-tabs-list {
100
+ gap: 1.25rem;
101
+ padding: 0;
102
+ border: none;
103
+ border-bottom: 1px solid var(--border-color);
104
+ border-radius: 0;
105
+ }
91
106
 
92
- .inline-image-modal-tabs .byline-tabs-trigger {
93
- position: relative;
94
- display: inline-flex;
95
- flex: none;
96
- width: auto;
97
- justify-content: flex-start;
98
- padding: 0.5rem 0;
99
- /* Sits on top of the list's hairline so the active underline covers it. */
100
- margin-bottom: -1px;
101
- border: none;
102
- border-bottom: 2px solid transparent;
103
- background: none;
104
- color: var(--gray-500);
105
- font-size: 1rem;
106
- font-weight: var(--font-weight-medium);
107
- cursor: pointer;
108
- transition:
109
- color 150ms ease,
110
- border-color 150ms ease;
111
- }
107
+ .inline-image-modal-tabs .byline-tabs-trigger {
108
+ position: relative;
109
+ display: inline-flex;
110
+ flex: none;
111
+ width: auto;
112
+ justify-content: flex-start;
113
+ padding: 0.5rem 0;
114
+ /* Sits on top of the list's hairline so the active underline covers it. */
115
+ margin-bottom: -1px;
116
+ border: none;
117
+ border-bottom: 2px solid transparent;
118
+ background: none;
119
+ color: var(--gray-500);
120
+ font-size: 1rem;
121
+ font-weight: var(--font-weight-medium);
122
+ cursor: pointer;
123
+ transition:
124
+ color 150ms ease,
125
+ border-color 150ms ease;
126
+ }
112
127
 
113
- .inline-image-modal-tabs .byline-tabs-trigger:hover {
114
- color: var(--gray-800);
115
- border-bottom-color: var(--gray-300);
116
- }
128
+ .inline-image-modal-tabs .byline-tabs-trigger:hover {
129
+ color: var(--gray-800);
130
+ border-bottom-color: var(--gray-300);
131
+ }
117
132
 
118
- .inline-image-modal-tabs .byline-tabs-trigger:focus-visible {
119
- outline: none;
120
- box-shadow: inset 0 0 0 2px var(--blue-500);
121
- border-radius: var(--radius-sm, 3px);
122
- }
133
+ .inline-image-modal-tabs .byline-tabs-trigger:focus-visible {
134
+ outline: none;
135
+ box-shadow: inset 0 0 0 2px var(--blue-500);
136
+ border-radius: var(--radius-sm, 3px);
137
+ }
123
138
 
124
- .inline-image-modal-tabs .byline-tabs-trigger[data-active] {
125
- color: var(--primary-600);
126
- border-bottom-color: var(--primary-400);
127
- }
139
+ .inline-image-modal-tabs .byline-tabs-trigger[data-active] {
140
+ color: var(--primary-600);
141
+ border-bottom-color: var(--primary-400);
142
+ }
128
143
 
129
- .inline-image-modal-tabs .byline-tabs-trigger[data-active]:hover {
130
- color: var(--primary-600);
131
- border-bottom-color: var(--primary-400);
132
- }
144
+ .inline-image-modal-tabs .byline-tabs-trigger[data-active]:hover {
145
+ color: var(--primary-600);
146
+ border-bottom-color: var(--primary-400);
147
+ }
133
148
 
134
- /*
149
+ /*
135
150
  * Reserve the height of the tallest link state. Measured: 118px with no
136
151
  * link, 231px for a custom URL, 301px for a document pick — so choosing a
137
152
  * link type would otherwise shift the dialog by ~180px under the cursor.
138
153
  * The floor holds the panel steady across all three.
139
154
  */
140
- .inline-image-modal-tabs .inline-image-modal-link-panel {
141
- min-height: 20rem;
142
- }
143
-
144
- :is([data-theme="dark"], .dark) {
145
- .inline-image-modal-tabs .byline-tabs-trigger {
146
- color: var(--gray-400);
155
+ .inline-image-modal-tabs .inline-image-modal-link-panel {
156
+ min-height: 20rem;
147
157
  }
148
158
 
149
- .inline-image-modal-tabs .byline-tabs-trigger:hover {
150
- color: var(--gray-200);
151
- border-bottom-color: var(--gray-600);
152
- }
153
-
154
- .inline-image-modal-tabs .byline-tabs-trigger[data-active],
155
- .inline-image-modal-tabs .byline-tabs-trigger[data-active]:hover {
156
- color: var(--primary-200);
157
- border-bottom-color: var(--primary-400);
159
+ :is([data-theme="dark"], .dark) {
160
+ .inline-image-modal-tabs .byline-tabs-trigger {
161
+ color: var(--gray-400);
162
+ }
163
+
164
+ .inline-image-modal-tabs .byline-tabs-trigger:hover {
165
+ color: var(--gray-200);
166
+ border-bottom-color: var(--gray-600);
167
+ }
168
+
169
+ .inline-image-modal-tabs .byline-tabs-trigger[data-active],
170
+ .inline-image-modal-tabs .byline-tabs-trigger[data-active]:hover {
171
+ color: var(--primary-200);
172
+ border-bottom-color: var(--primary-400);
173
+ }
158
174
  }
159
175
  }