Skip to content

Commit

Permalink
Updated @ placeholder copy and styles (#1271)
Browse files Browse the repository at this point in the history
REF MOM-220
  • Loading branch information
sanne-san authored Jun 12, 2024
1 parent 96a6a9a commit 511a0a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {$applyNodeReplacement, TextNode} from 'lexical';
export class AtLinkSearchNode extends TextNode {
__placeholder = null;

defaultPlaceholder = 'Search for a link';
defaultPlaceholder = 'Type to search';

static getType() {
return 'at-link-search';
Expand Down
4 changes: 2 additions & 2 deletions packages/kg-default-nodes/test/nodes/at-link-search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('AtLinkSearchNode', function () {
const dom = atLinkNode.createDOM(config);
dom.classList.contains('multiple').should.be.true;
dom.classList.contains('classes').should.be.true;
dom.dataset.placeholder.should.equal('Search for a link');
dom.dataset.placeholder.should.equal('Type to search');
}));

it('renders without default placeholder if text is present', editorTest(function () {
Expand All @@ -106,7 +106,7 @@ describe('AtLinkSearchNode', function () {
it('updates to remove default placeholder when text is added', editorTest(function () {
const atLinkNode = $createAtLinkSearchNode();
const dom = atLinkNode.createDOM(config);
dom.dataset.placeholder.should.equal('Search for a link');
dom.dataset.placeholder.should.equal('Type to search');

const prevNode = AtLinkSearchNode.clone(atLinkNode);

Expand Down
2 changes: 1 addition & 1 deletion packages/koenig-lexical/src/themes/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const defaultTheme = {
},
code: undefined,
tkHighlighted: 'bg-lime-500 dark:bg-lime-800 py-1',
atLink: 'inline-block bg-grey-200/70 dark:bg-grey-900',
atLink: 'inline-block bg-grey-200/70 mx-[-.2rem] px-1 pb-[.2rem] leading-[1.4] rounded dark:bg-grey-900',
atLinkSearch: 'after:content-[attr(data-placeholder)] after:text-grey-500 dark:after:text-grey-600 min-w-[5px]'
};

Expand Down
2 changes: 1 addition & 1 deletion packages/koenig-lexical/test/e2e/internal-linking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ test.describe('Internal linking', async () => {
<span>
<span data-lexical-text="true"></span>
<span
data-placeholder="Search for a link"
data-placeholder="Type to search"
data-lexical-text="true"
></span>
</span>
Expand Down

0 comments on commit 511a0a7

Please sign in to comment.