Lexical: modify headers
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
bcd958a473
commit
1d8b686928
17 changed files with 73 additions and 115 deletions
|
@ -1,11 +1,9 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
|
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
|
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
import { AutoLinkPlugin, createLinkMatcherWithRegExp } from '@lexical/react/LexicalAutoLinkPlugin';
|
import { AutoLinkPlugin, createLinkMatcherWithRegExp } from '@lexical/react/LexicalAutoLinkPlugin';
|
||||||
import { LexicalComposer, InitialConfigType } from '@lexical/react/LexicalComposer';
|
import { LexicalComposer, InitialConfigType } from '@lexical/react/LexicalComposer';
|
||||||
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
||||||
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
|
import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
|
||||||
import { mergeRegister } from '@lexical/utils';
|
import { mergeRegister } from '@lexical/utils';
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { $applyNodeReplacement, DecoratorNode } from 'lexical';
|
import { $applyNodeReplacement, DecoratorNode } from 'lexical';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { CodeHighlightNode, CodeNode } from '@lexical/code';
|
import { CodeHighlightNode, CodeNode } from '@lexical/code';
|
||||||
import { HashtagNode } from '@lexical/hashtag';
|
import { HashtagNode } from '@lexical/hashtag';
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { addClassNamesToElement } from '@lexical/utils';
|
import { addClassNamesToElement } from '@lexical/utils';
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
||||||
import { $createHorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
import { $createHorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
import { $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { $createCodeNode, $isCodeHighlightNode } from '@lexical/code';
|
import { $createCodeNode, $isCodeHighlightNode } from '@lexical/code';
|
||||||
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { LinkPlugin as LexicalLinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
import { LinkPlugin as LexicalLinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* eslint-disable eqeqeq */
|
/* eslint-disable eqeqeq */
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { $isAtNodeEnd } from '@lexical/selection';
|
import { $isAtNodeEnd } from '@lexical/selection';
|
||||||
import { ElementNode, RangeSelection, TextNode } from 'lexical';
|
import { ElementNode, RangeSelection, TextNode } from 'lexical';
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Point {
|
class Point {
|
||||||
|
|
||||||
private readonly _x: number;
|
private readonly _x: number;
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/* eslint-disable no-dupe-class-members */
|
/* eslint-disable no-dupe-class-members */
|
||||||
/**
|
/**
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
*
|
* and affiliates, licensed under the MIT license located in the
|
||||||
* This source code is licensed under the MIT license found in the
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { isPoint, Point } from './point';
|
import { isPoint, Point } from './point';
|
||||||
|
|
||||||
type ContainsPointReturn = {
|
type ContainsPointReturn = {
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const VERTICAL_GAP = 10;
|
const VERTICAL_GAP = 10;
|
||||||
const HORIZONTAL_OFFSET = 5;
|
const HORIZONTAL_OFFSET = 5;
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/**
|
||||||
MIT License
|
* This source code is derived from code from Meta Platforms, Inc.
|
||||||
|
* and affiliates, licensed under the MIT license located in the
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
* LICENSE file in the /app/soapbox/features/compose/editor directory.
|
||||||
|
*/
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the /app/soapbox/features/compose/editor directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const sanitizeUrl = (url: string): string => {
|
export const sanitizeUrl = (url: string): string => {
|
||||||
/** A pattern that matches safe URLs. */
|
/** A pattern that matches safe URLs. */
|
||||||
|
|
Loading…
Reference in a new issue