license?
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
fa2afbd629
commit
5d062d07ac
10 changed files with 92 additions and 106 deletions
17
app/soapbox/features/compose/editor/LICENSE
Normal file
17
app/soapbox/features/compose/editor/LICENSE
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
|
@ -1,3 +1,12 @@
|
||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
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 {
|
import {
|
||||||
$convertToMarkdownString,
|
$convertToMarkdownString,
|
||||||
TRANSFORMERS,
|
TRANSFORMERS,
|
||||||
|
@ -19,8 +28,6 @@ import nodes from './nodes';
|
||||||
import FloatingLinkEditorPlugin from './plugins/floating-link-editor-plugin';
|
import FloatingLinkEditorPlugin from './plugins/floating-link-editor-plugin';
|
||||||
import FloatingTextFormatToolbarPlugin from './plugins/floating-text-format-toolbar-plugin';
|
import FloatingTextFormatToolbarPlugin from './plugins/floating-text-format-toolbar-plugin';
|
||||||
|
|
||||||
// import type { EditorState } from 'lexical';
|
|
||||||
|
|
||||||
const initialConfig: InitialConfigType = {
|
const initialConfig: InitialConfigType = {
|
||||||
namespace: 'ComposeForm',
|
namespace: 'ComposeForm',
|
||||||
onError: console.error,
|
onError: console.error,
|
||||||
|
|
|
@ -1,74 +1,27 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
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 { CodeHighlightNode, CodeNode } from '@lexical/code';
|
import { CodeHighlightNode, CodeNode } from '@lexical/code';
|
||||||
// import { HashtagNode } from '@lexical/hashtag';
|
|
||||||
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
||||||
// import { ListItemNode, ListNode } from '@lexical/list';
|
|
||||||
// import { MarkNode } from '@lexical/mark';
|
|
||||||
// import { OverflowNode } from '@lexical/overflow';
|
|
||||||
import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
import { HorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
|
||||||
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
|
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
|
||||||
// import { TableCellNode, TableNode, TableRowNode } from '@lexical/table';
|
|
||||||
|
|
||||||
// import { CollapsibleContainerNode } from '../plugins/CollapsiblePlugin/CollapsibleContainerNode';
|
|
||||||
// import { CollapsibleContentNode } from '../plugins/CollapsiblePlugin/CollapsibleContentNode';
|
|
||||||
// import { CollapsibleTitleNode } from '../plugins/CollapsiblePlugin/CollapsibleTitleNode';
|
|
||||||
|
|
||||||
// import { AutocompleteNode } from './AutocompleteNode';
|
|
||||||
// import { EmojiNode } from './EmojiNode';
|
|
||||||
// import { EquationNode } from './EquationNode';
|
|
||||||
// import { ExcalidrawNode } from './ExcalidrawNode';
|
|
||||||
// import { FigmaNode } from './FigmaNode';
|
|
||||||
// import { ImageNode } from './ImageNode';
|
|
||||||
// import { KeywordNode } from './KeywordNode';
|
|
||||||
// import { MentionNode } from './MentionNode';
|
|
||||||
// import { PollNode } from './PollNode';
|
|
||||||
// import { StickyNode } from './StickyNode';
|
|
||||||
// import { TableNode as NewTableNode } from './TableNode';
|
|
||||||
// import { TweetNode } from './TweetNode';
|
|
||||||
// import { YouTubeNode } from './YouTubeNode';
|
|
||||||
|
|
||||||
import type { Klass, LexicalNode } from 'lexical';
|
import type { Klass, LexicalNode } from 'lexical';
|
||||||
|
|
||||||
const PlaygroundNodes: Array<Klass<LexicalNode>> = [
|
const PlaygroundNodes: Array<Klass<LexicalNode>> = [
|
||||||
HeadingNode,
|
HeadingNode,
|
||||||
// ListNode,
|
|
||||||
// ListItemNode,
|
|
||||||
QuoteNode,
|
QuoteNode,
|
||||||
CodeNode,
|
CodeNode,
|
||||||
// NewTableNode,
|
|
||||||
// TableNode,
|
|
||||||
// TableCellNode,
|
|
||||||
// TableRowNode,
|
|
||||||
// HashtagNode,
|
|
||||||
CodeHighlightNode,
|
CodeHighlightNode,
|
||||||
AutoLinkNode,
|
AutoLinkNode,
|
||||||
LinkNode,
|
LinkNode,
|
||||||
// OverflowNode,
|
|
||||||
// PollNode,
|
|
||||||
// StickyNode,
|
|
||||||
// ImageNode,
|
|
||||||
// MentionNode,
|
|
||||||
// EmojiNode,
|
|
||||||
// ExcalidrawNode,
|
|
||||||
// EquationNode,
|
|
||||||
// AutocompleteNode,
|
|
||||||
// KeywordNode,
|
|
||||||
HorizontalRuleNode,
|
HorizontalRuleNode,
|
||||||
// TweetNode,
|
|
||||||
// YouTubeNode,
|
|
||||||
// FigmaNode,
|
|
||||||
// MarkNode,
|
|
||||||
// CollapsibleContainerNode,
|
|
||||||
// CollapsibleContentNode,
|
|
||||||
// CollapsibleTitleNode,
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export default PlaygroundNodes;
|
export default PlaygroundNodes;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
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,12 +1,11 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// import './index.css';
|
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 { $isCodeHighlightNode } from '@lexical/code';
|
import { $isCodeHighlightNode } from '@lexical/code';
|
||||||
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
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,11 +1,14 @@
|
||||||
|
/*
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
/* eslint-disable eqeqeq */
|
/* eslint-disable eqeqeq */
|
||||||
/**
|
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export const getDOMRangeRect = (
|
export const getDOMRangeRect = (
|
||||||
nativeSelection: Selection,
|
nativeSelection: Selection,
|
||||||
rootElement: HTMLElement,
|
rootElement: HTMLElement,
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
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,12 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
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,10 +1,11 @@
|
||||||
/**
|
/*
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
MIT License
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*
|
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