Skip to content

Commit

Permalink
Merge branch 'main' into documentation/rootnode-semantics-and-special…
Browse files Browse the repository at this point in the history
…cases
  • Loading branch information
citruscai authored Nov 26, 2024
2 parents a251272 + 149949f commit db079e5
Show file tree
Hide file tree
Showing 38 changed files with 1,358 additions and 838 deletions.
4 changes: 0 additions & 4 deletions examples/react-table/src/ExampleTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,9 @@ export default {
tableCellActionButton: 'ExampleEditorTheme__tableCellActionButton',
tableCellActionButtonContainer:
'ExampleEditorTheme__tableCellActionButtonContainer',
tableCellEditing: 'ExampleEditorTheme__tableCellEditing',
tableCellHeader: 'ExampleEditorTheme__tableCellHeader',
tableCellPrimarySelected: 'ExampleEditorTheme__tableCellPrimarySelected',
tableCellResizer: 'ExampleEditorTheme__tableCellResizer',
tableCellSelected: 'ExampleEditorTheme__tableCellSelected',
tableCellSortedIndicator: 'ExampleEditorTheme__tableCellSortedIndicator',
tableResizeRuler: 'ExampleEditorTheme__tableCellResizeRuler',
tableSelected: 'ExampleEditorTheme__tableSelected',
tableSelection: 'ExampleEditorTheme__tableSelection',
text: {
Expand Down
33 changes: 10 additions & 23 deletions examples/react-table/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,6 @@ i.justify-align {
position: relative;
outline: none;
}
.ExampleEditorTheme__tableCellSortedIndicator {
display: block;
opacity: 0.5;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 4px;
background-color: #999;
}
.ExampleEditorTheme__tableCellResizer {
position: absolute;
right: -4px;
Expand All @@ -498,21 +488,18 @@ i.justify-align {
text-align: start;
}
.ExampleEditorTheme__tableCellSelected {
background-color: #c9dbf0;
caret-color: transparent;
}
.ExampleEditorTheme__tableCellPrimarySelected {
border: 2px solid rgb(60, 132, 244);
display: block;
height: calc(100% - 2px);
.ExampleEditorTheme__tableCellSelected::after {
position: absolute;
width: calc(100% - 2px);
left: -1px;
top: -1px;
z-index: 2;
}
.ExampleEditorTheme__tableCellEditing {
box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
border-radius: 3px;
left: 0;
right: 0;
bottom: 0;
top: 0;
background-color: rgb(172, 206, 247);
opacity: 0.6;
content: '';
pointer-events: none;
}
.ExampleEditorTheme__tableAddColumns {
position: absolute;
Expand Down
61 changes: 60 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions packages/lexical-clipboard/src/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ import {
BaseSelection,
COMMAND_PRIORITY_CRITICAL,
COPY_COMMAND,
getDOMSelection,
isSelectionWithinEditor,
LexicalEditor,
LexicalNode,
SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,
SerializedElementNode,
SerializedTextNode,
} from 'lexical';
import {CAN_USE_DOM} from 'shared/canUseDOM';
import invariant from 'shared/invariant';

const getDOMSelection = (targetWindow: Window | null): Selection | null =>
CAN_USE_DOM ? (targetWindow || window).getSelection() : null;

export interface LexicalClipboardData {
'text/html'?: string | undefined;
'application/x-lexical-editor'?: string | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,47 +302,41 @@ test.describe('HTML Tables CopyAndPaste', () => {
</colgroup>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">a</span>
</p>
</th>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">b</span>
</p>
</th>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</th>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</th>
</tr>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
<span data-lexical-text="true">c</span>
</p>
</th>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr"
Expand All @@ -351,57 +345,47 @@ test.describe('HTML Tables CopyAndPaste', () => {
</p>
</td>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
</tr>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</th>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
</tr>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</th>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
<td
class="PlaygroundEditorTheme__tableCell"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellSelected">
<p class="PlaygroundEditorTheme__paragraph"><br /></p>
</td>
</tr>
Expand Down
15 changes: 5 additions & 10 deletions packages/lexical-playground/__tests__/e2e/Indentation.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ test.describe('Identation', () => {
</colgroup>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr">
Expand Down Expand Up @@ -198,8 +197,7 @@ test.describe('Identation', () => {
</colgroup>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr PlaygroundEditorTheme__indent"
dir="ltr"
Expand Down Expand Up @@ -294,8 +292,7 @@ test.describe('Identation', () => {
</colgroup>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr PlaygroundEditorTheme__indent"
dir="ltr"
Expand Down Expand Up @@ -384,8 +381,7 @@ test.describe('Identation', () => {
</colgroup>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr PlaygroundEditorTheme__indent"
dir="ltr"
Expand Down Expand Up @@ -464,8 +460,7 @@ test.describe('Identation', () => {
</colgroup>
<tr>
<th
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader"
style="background-color: rgb(172, 206, 247); caret-color: transparent">
class="PlaygroundEditorTheme__tableCell PlaygroundEditorTheme__tableCellHeader PlaygroundEditorTheme__tableCellSelected">
<p
class="PlaygroundEditorTheme__paragraph PlaygroundEditorTheme__ltr"
dir="ltr"
Expand Down
Loading

0 comments on commit db079e5

Please sign in to comment.