@payloadcms/richtext-lexical 0.1.0-beta.0 → 0.1.0-beta.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 (39) hide show
  1. package/dist/field/features/Blocks/component/index.scss +125 -0
  2. package/dist/field/features/Blocks/drawer/index.scss +1 -0
  3. package/dist/field/features/Blocks/index.scss +1 -0
  4. package/dist/field/features/Link/drawer/index.scss +50 -0
  5. package/dist/field/features/Link/index.scss +1 -0
  6. package/dist/field/features/Link/plugins/floatingLinkEditor/index.scss +79 -0
  7. package/dist/field/features/Relationship/drawer/index.scss +1 -0
  8. package/dist/field/features/Relationship/index.scss +1 -0
  9. package/dist/field/features/Relationship/nodes/components/index.scss +89 -0
  10. package/dist/field/features/Upload/component/index.scss +151 -0
  11. package/dist/field/features/Upload/drawer/index.scss +1 -0
  12. package/dist/field/features/Upload/index.scss +1 -0
  13. package/dist/field/features/Upload/nodes/UploadNode.scss +4 -0
  14. package/dist/field/features/align/index.scss +4 -0
  15. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.scss +4 -0
  16. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.scss +4 -0
  17. package/dist/field/features/debug/TreeView/index.scss +78 -0
  18. package/dist/field/features/format/common/index.scss +4 -0
  19. package/dist/field/features/indent/index.scss +4 -0
  20. package/dist/field/index.scss +1 -0
  21. package/dist/field/lexical/LexicalEditor.scss +34 -0
  22. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.scss +39 -0
  23. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.scss +100 -0
  24. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.scss +57 -0
  25. package/dist/field/lexical/plugins/SlashMenu/index.scss +49 -0
  26. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +35 -0
  27. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +50 -0
  28. package/dist/field/lexical/theme/EditorTheme.scss +508 -0
  29. package/dist/field/lexical/ui/ContentEditable.scss +21 -0
  30. package/dist/field/lexical/ui/icons/Add/index.svg +4 -0
  31. package/dist/field/lexical/ui/icons/Caret/index.svg +3 -0
  32. package/dist/field/lexical/ui/icons/DraggableBlock/index.svg +9 -0
  33. package/dist/field/lexical/ui/icons/Edit/index.svg +10 -0
  34. package/dist/field/lexical/ui/icons/Remove/index.svg +4 -0
  35. package/dist/index.d.ts +18 -4
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +35 -20
  38. package/package.json +6 -4
  39. package/src/index.ts +20 -4
@@ -0,0 +1,125 @@
1
+ @import 'payload/scss';
2
+
3
+ .lexical-block {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: calc(var(--base) / 2);
7
+ font-family: var(
8
+ --font-body
9
+ ); // Reset font to non-serif, body font, as the lexical editor parent uses a serif font.
10
+
11
+ &__header {
12
+ h3 {
13
+ margin: 0;
14
+ }
15
+ }
16
+
17
+ &__header-wrap {
18
+ display: flex;
19
+ align-items: flex-end;
20
+ width: 100%;
21
+ justify-content: space-between;
22
+ }
23
+
24
+ &__heading-with-error {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: base(0.5);
28
+ }
29
+
30
+ &--has-no-error {
31
+ > .array-field__header .array-field__heading-with-error {
32
+ color: var(--theme-text);
33
+ }
34
+ }
35
+
36
+ &--has-error {
37
+ > .array-field__header {
38
+ color: var(--theme-error-500);
39
+ }
40
+ }
41
+
42
+ &__error-pill {
43
+ align-self: center;
44
+ }
45
+
46
+ &__header-actions {
47
+ list-style: none;
48
+ margin: 0;
49
+ padding: 0;
50
+ display: flex;
51
+ }
52
+
53
+ &__header-action {
54
+ @extend %btn-reset;
55
+ cursor: pointer;
56
+ margin-left: base(0.5);
57
+
58
+ &:hover,
59
+ &:focus-visible {
60
+ text-decoration: underline;
61
+ }
62
+ }
63
+
64
+ &__block-header {
65
+ display: inline-flex;
66
+ max-width: 100%;
67
+ overflow: hidden;
68
+ gap: base(0.375);
69
+ }
70
+
71
+ &__block-number {
72
+ flex-shrink: 0;
73
+ }
74
+
75
+ &__block-pill {
76
+ flex-shrink: 0;
77
+ display: block;
78
+ line-height: unset;
79
+ }
80
+
81
+ &__error-wrap {
82
+ position: relative;
83
+ }
84
+
85
+ &__rows {
86
+ display: flex;
87
+ flex-direction: column;
88
+ gap: calc(var(--base) / 2);
89
+ }
90
+
91
+ &__drawer-toggler {
92
+ background-color: transparent;
93
+ margin: 0;
94
+ padding: 0;
95
+ border: none;
96
+ align-self: flex-start;
97
+
98
+ .btn {
99
+ color: var(--theme-elevation-400);
100
+ margin: 0;
101
+
102
+ &:hover {
103
+ color: var(--theme-elevation-800);
104
+ }
105
+ }
106
+ }
107
+ }
108
+
109
+ html[data-theme='light'] {
110
+ .blocks-field--has-error {
111
+ .section-title__input,
112
+ .blocks-field__heading-with-error {
113
+ color: var(--theme-error-750);
114
+ }
115
+ }
116
+ }
117
+
118
+ html[data-theme='dark'] {
119
+ .blocks-field--has-error {
120
+ .section-title__input,
121
+ .blocks-field__heading-with-error {
122
+ color: var(--theme-error-500);
123
+ }
124
+ }
125
+ }
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1,50 @@
1
+ @import 'payload/scss';
2
+
3
+ .lexical-link-edit-drawer {
4
+ &__template {
5
+ position: relative;
6
+ z-index: 1;
7
+ padding-top: base(1);
8
+ padding-bottom: base(2);
9
+ }
10
+
11
+ &__header {
12
+ width: 100%;
13
+ margin-bottom: $baseline;
14
+ display: flex;
15
+ justify-content: space-between;
16
+ margin-top: base(2.5);
17
+ margin-bottom: base(1);
18
+
19
+ @include mid-break {
20
+ margin-top: base(1.5);
21
+ }
22
+ }
23
+
24
+ &__header-text {
25
+ margin: 0;
26
+ }
27
+
28
+ &__header-close {
29
+ border: 0;
30
+ background-color: transparent;
31
+ padding: 0;
32
+ cursor: pointer;
33
+ overflow: hidden;
34
+ width: base(1);
35
+ height: base(1);
36
+
37
+ svg {
38
+ width: base(2.75);
39
+ height: base(2.75);
40
+ position: relative;
41
+ left: base(-0.825);
42
+ top: base(-0.825);
43
+
44
+ .stroke {
45
+ stroke-width: 2px;
46
+ vector-effect: non-scaling-stroke;
47
+ }
48
+ }
49
+ }
50
+ }
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1,79 @@
1
+ @import 'payload/scss';
2
+
3
+ html[data-theme='light'] {
4
+ .link-editor {
5
+ box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.2);
6
+ }
7
+ }
8
+
9
+ .link-editor {
10
+ z-index: 10;
11
+ display: flex;
12
+ align-items: center;
13
+ background: var(--color-base-0);
14
+ padding: 0px 3.72px 0px 6.25px;
15
+ vertical-align: middle;
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ z-index: 10;
20
+ opacity: 0;
21
+ border-radius: 6.25px;
22
+ transition: opacity 0.2s;
23
+ height: 37.5px;
24
+ will-change: transform;
25
+
26
+ .link-input {
27
+ display: flex;
28
+ align-items: center;
29
+ flex-direction: row;
30
+ flex-wrap: nowrap;
31
+ min-height: 28px;
32
+ box-sizing: border-box;
33
+ padding: 2px 4px;
34
+ font-size: 15px;
35
+ border: 0;
36
+ outline: 0;
37
+ position: relative;
38
+ font-family: inherit;
39
+
40
+ a {
41
+ text-decoration: none;
42
+ display: block;
43
+ white-space: nowrap;
44
+ overflow: hidden;
45
+ margin-right: 30px;
46
+ text-overflow: ellipsis;
47
+ color: var(--color-blue-600);
48
+ border-bottom: 1px dotted;
49
+
50
+ &:hover {
51
+ color: var(--color-blue-400);
52
+ }
53
+ }
54
+ }
55
+
56
+ button {
57
+ all: unset;
58
+ background-size: 16px;
59
+ background-position: center;
60
+ background-repeat: no-repeat;
61
+ width: 30px;
62
+ height: 30px;
63
+ cursor: pointer;
64
+ color: var(--color-base-600);
65
+ border-radius: 4px;
66
+
67
+ &:hover:not([disabled]) {
68
+ background-color: var(--color-base-100);
69
+ }
70
+ }
71
+
72
+ .link-edit {
73
+ background-image: url(../../../../lexical/ui/icons/Edit/index.svg);
74
+ }
75
+
76
+ .link-trash {
77
+ background-image: url(../../../../lexical/ui/icons/Remove/index.svg);
78
+ }
79
+ }
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1,89 @@
1
+ @import 'payload/scss';
2
+
3
+ .lexical-relationship {
4
+ @extend %body;
5
+ @include shadow-sm;
6
+ padding: base(0.75);
7
+ display: flex;
8
+ align-items: center;
9
+ background: var(--theme-input-bg);
10
+ border: 1px solid var(--theme-elevation-100);
11
+ max-width: base(15);
12
+ font-family: var(--font-body);
13
+
14
+ &:hover {
15
+ border: 1px solid var(--theme-elevation-150);
16
+ }
17
+
18
+ &[data-slate-node='element'] {
19
+ margin: base(0.625) 0;
20
+ }
21
+
22
+ &__label {
23
+ margin-bottom: base(0.25);
24
+ }
25
+
26
+ &__title {
27
+ margin: 0;
28
+ }
29
+
30
+ &__label,
31
+ &__title {
32
+ white-space: nowrap;
33
+ text-overflow: ellipsis;
34
+ overflow: hidden;
35
+ line-height: 1 !important;
36
+ }
37
+
38
+ &__title {
39
+ font-weight: bold;
40
+ }
41
+
42
+ &__wrap {
43
+ flex-grow: 1;
44
+ overflow: hidden;
45
+ }
46
+
47
+ &--selected {
48
+ box-shadow: $focus-box-shadow;
49
+ outline: none;
50
+ }
51
+
52
+ &__doc-drawer-toggler {
53
+ text-decoration: underline;
54
+ pointer-events: all;
55
+ line-height: inherit;
56
+ & > * {
57
+ margin: 0;
58
+ }
59
+
60
+ &:disabled {
61
+ color: var(--theme-elevation-300);
62
+ pointer-events: none;
63
+ }
64
+ }
65
+
66
+ &__actions {
67
+ display: flex;
68
+ align-items: center;
69
+ flex-shrink: 0;
70
+ margin-left: base(0.5);
71
+
72
+ & > *:not(:last-child) {
73
+ margin-right: base(0.25);
74
+ }
75
+ }
76
+
77
+ &__removeButton {
78
+ margin: 0;
79
+
80
+ line {
81
+ stroke-width: $style-stroke-width-m;
82
+ }
83
+
84
+ &:disabled {
85
+ color: var(--theme-elevation-300);
86
+ pointer-events: none;
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,151 @@
1
+ @import 'payload/scss';
2
+
3
+ .lexical-upload {
4
+ @extend %body;
5
+ @include shadow-sm;
6
+ max-width: base(15);
7
+ display: flex;
8
+ align-items: center;
9
+ background: var(--theme-input-bg);
10
+ border: 1px solid var(--theme-elevation-100);
11
+ position: relative;
12
+ font-family: var(--font-body);
13
+
14
+ .btn {
15
+ margin: 0;
16
+ }
17
+
18
+ &:hover {
19
+ border: 1px solid var(--theme-elevation-150);
20
+ }
21
+
22
+ &[data-slate-node='element'] {
23
+ margin: base(0.625) 0;
24
+ }
25
+
26
+ &__card {
27
+ @include soft-shadow-bottom;
28
+ display: flex;
29
+ flex-direction: column;
30
+ width: 100%;
31
+ }
32
+
33
+ &__topRow {
34
+ display: flex;
35
+ }
36
+
37
+ &__thumbnail {
38
+ width: base(3.25);
39
+ height: auto;
40
+ position: relative;
41
+ overflow: hidden;
42
+ flex-shrink: 0;
43
+
44
+ img,
45
+ svg {
46
+ position: absolute;
47
+ object-fit: cover;
48
+ width: 100%;
49
+ height: 100%;
50
+ background-color: var(--theme-elevation-800);
51
+ }
52
+ }
53
+
54
+ &__topRowRightPanel {
55
+ flex-grow: 1;
56
+ display: flex;
57
+ align-items: center;
58
+ padding: base(0.75);
59
+ justify-content: space-between;
60
+ max-width: calc(100% - #{base(3.25)});
61
+ }
62
+
63
+ &__actions {
64
+ display: flex;
65
+ align-items: center;
66
+ flex-shrink: 0;
67
+ margin-left: base(0.5);
68
+
69
+ .lexical-upload__doc-drawer-toggler {
70
+ pointer-events: all;
71
+ }
72
+
73
+ & > *:not(:last-child) {
74
+ margin-right: base(0.25);
75
+ }
76
+ }
77
+
78
+ &__removeButton {
79
+ margin: 0;
80
+
81
+ line {
82
+ stroke-width: $style-stroke-width-m;
83
+ }
84
+
85
+ &:disabled {
86
+ color: var(--theme-elevation-300);
87
+ pointer-events: none;
88
+ }
89
+ }
90
+
91
+ &__upload-drawer-toggler {
92
+ background-color: transparent;
93
+ border: none;
94
+ padding: 0;
95
+ margin: 0;
96
+ outline: none;
97
+ line-height: inherit;
98
+ }
99
+
100
+ &__doc-drawer-toggler {
101
+ text-decoration: underline;
102
+ }
103
+
104
+ &__doc-drawer-toggler,
105
+ &__list-drawer-toggler,
106
+ &__upload-drawer-toggler {
107
+ & > * {
108
+ margin: 0;
109
+ }
110
+
111
+ &:disabled {
112
+ color: var(--theme-elevation-300);
113
+ pointer-events: none;
114
+ }
115
+ }
116
+
117
+ &__collectionLabel {
118
+ overflow: hidden;
119
+ text-overflow: ellipsis;
120
+ white-space: nowrap;
121
+ }
122
+
123
+ &__bottomRow {
124
+ padding: base(0.5);
125
+ border-top: 1px solid var(--theme-elevation-100);
126
+ }
127
+
128
+ h5 {
129
+ white-space: nowrap;
130
+ text-overflow: ellipsis;
131
+ overflow: hidden;
132
+ }
133
+
134
+ &__wrap {
135
+ padding: base(0.5) base(0.5) base(0.5) base(1);
136
+ text-align: left;
137
+ overflow: hidden;
138
+ text-overflow: ellipsis;
139
+ }
140
+
141
+ &--selected {
142
+ box-shadow: $focus-box-shadow;
143
+ outline: none;
144
+ }
145
+
146
+ @include small-break {
147
+ &__topRowRightPanel {
148
+ padding: base(0.75) base(0.5);
149
+ }
150
+ }
151
+ }
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1,4 @@
1
+ @import 'payload/scss';
2
+
3
+ .editor-upload {
4
+ }
@@ -0,0 +1,4 @@
1
+ .floating-select-toolbar-popup__section-dropdown-align {
2
+ display: flex;
3
+ gap: 2px;
4
+ }
@@ -0,0 +1,4 @@
1
+ .floating-select-toolbar-popup__section-features {
2
+ display: flex;
3
+ gap: 2px;
4
+ }
@@ -0,0 +1,4 @@
1
+ .floating-select-toolbar-popup__section-dropdown-text {
2
+ display: flex;
3
+ gap: 2px;
4
+ }
@@ -0,0 +1,78 @@
1
+ .tree-view-output {
2
+ display: block;
3
+ background: #222;
4
+ color: #fff;
5
+ padding: 0;
6
+ font-size: 12px;
7
+ margin: 1px auto 10px auto;
8
+ position: relative;
9
+ overflow: hidden;
10
+ border-bottom-left-radius: 10px;
11
+ border-bottom-right-radius: 10px;
12
+
13
+ pre {
14
+ line-height: 1.1;
15
+ background: #222;
16
+ color: #fff;
17
+ margin: 0;
18
+ padding: 10px;
19
+ font-size: 12px;
20
+ overflow: auto;
21
+ max-height: 400px;
22
+ }
23
+
24
+ .debug-treetype-button {
25
+ border: 0;
26
+ padding: 0;
27
+ font-size: 12px;
28
+ top: 10px;
29
+ right: 85px;
30
+ position: absolute;
31
+ background: none;
32
+ color: #fff;
33
+
34
+ &:hover {
35
+ text-decoration: underline;
36
+ }
37
+ }
38
+
39
+ .debug-timetravel-button {
40
+ border: 0;
41
+ padding: 0;
42
+ font-size: 12px;
43
+ top: 10px;
44
+ right: 15px;
45
+ position: absolute;
46
+ background: none;
47
+ color: #fff;
48
+
49
+ &:hover {
50
+ text-decoration: underline;
51
+ }
52
+ }
53
+
54
+ .debug-timetravel-panel {
55
+ overflow: hidden;
56
+ padding: 0 0 10px;
57
+ margin: auto;
58
+ display: flex;
59
+
60
+ &-button {
61
+ padding: 0;
62
+ border: 0;
63
+ background: none;
64
+ flex: 1;
65
+ color: #fff;
66
+ font-size: 12px;
67
+
68
+ &:hover {
69
+ text-decoration: underline;
70
+ }
71
+ }
72
+
73
+ &-slider {
74
+ padding: 0;
75
+ flex: 8;
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,4 @@
1
+ .floating-select-toolbar-popup__section-format {
2
+ display: flex;
3
+ gap: 2px;
4
+ }
@@ -0,0 +1,4 @@
1
+ .floating-select-toolbar-popup__section-indent {
2
+ display: flex;
3
+ gap: 2px;
4
+ }
@@ -0,0 +1 @@
1
+ @import 'payload/scss';
@@ -0,0 +1,34 @@
1
+ @import 'payload/scss';
2
+
3
+ .editor-shell {
4
+ position: relative;
5
+
6
+ font-family: var(--font-serif);
7
+ font-size: base(0.625);
8
+
9
+ h1,
10
+ h2,
11
+ h3,
12
+ h4,
13
+ h5,
14
+ h6 {
15
+ font-family: var(--font-body);
16
+ line-height: 1.125;
17
+ }
18
+ }
19
+
20
+ .editor-placeholder {
21
+ position: absolute;
22
+ top: 8px;
23
+ left: 0px;
24
+ font-size: 15px;
25
+ color: var(--theme-elevation-500);
26
+ /* Prevent text selection */
27
+ user-select: none;
28
+ -webkit-user-select: none;
29
+ -moz-user-select: none;
30
+ -ms-user-select: none;
31
+
32
+ /* Make it behave more like a background element (no interaction) */
33
+ pointer-events: none;
34
+ }
@@ -0,0 +1,39 @@
1
+ @import 'payload/scss';
2
+
3
+ .floating-select-toolbar-popup__button {
4
+ display: flex;
5
+ align-items: center;
6
+ vertical-align: middle;
7
+ justify-content: center;
8
+ height: 30px;
9
+ width: 30px;
10
+ border: 0;
11
+ background: none;
12
+ border-radius: 4px;
13
+ cursor: pointer;
14
+ padding: 0;
15
+
16
+ &.spaced {
17
+ margin-right: 2px;
18
+ }
19
+
20
+ &.active {
21
+ background-color: var(--color-base-100);
22
+
23
+ .icon {
24
+ opacity: 1;
25
+ }
26
+ }
27
+
28
+ &.disabled {
29
+ cursor: not-allowed;
30
+
31
+ .icon {
32
+ opacity: 0.2;
33
+ }
34
+ }
35
+
36
+ &:hover:not([disabled]) {
37
+ background-color: var(--color-base-100);
38
+ }
39
+ }