Skip to content

Commit

Permalink
0.4.2 next.0 (#3002)
Browse files Browse the repository at this point in the history
* fix (#2956)

* Add table cell menu back (#2958)

* fix (#2957)

* fix typo on read-mode / edit-mode page (#2962)

Co-authored-by: Christian Ratz <christian.ratz@b-ite.de>

* Fix link breaking when formatting on (#2954)

* Fix link breaking when formatting on

* nodeFormat to const

* retry checks

* allow escaped markdown within TextFormatTransformer (#2964)

Co-authored-by: Christian Ratz <christian.ratz@b-ite.de>

* Fix bugs with isEditable (#2967)

* Fix bugs with isEditable

* Revise

* Add empty comment in front of 'export' in a bundled file (#2970)

* Automated releases (#2949)

* change to using package.json in root as pinned version

* wip automated release workflow with manual triggerl

* change release script

* Fix build script

* checkout new branch

* release on push to next

* no accidental releases

* release on push to latest

* fix yaml

* fix yaml

* fix yaml

* remove unnecessary

* remove unnecessary

* prettier

* Update collab errors, related cleanup (#2971)

* install (#2972)

* Improve docs around the React plugins page (#2976)

* Improve docs around the React plugins page

* Improve docs around the React plugins page

* config (#2977)

* Clean up redundant newlines during pasting (#2969)

* Cleanup newlines unless its preformatted element

* Update docs

* push config (#2979)

* add ssh key

* add back config

* merge from main

* merge from main

* fix versioning for ff merge (#2983)

* remove ff merge from release (#2984)

* Fixed exportDOM for paragraph node (#2981)

* export DOM for paragraph node

* Fixed export DOM for paragraph node

* docs: Fix URL of rich-text and plain-text (#2985)

* docs: loadContent clarification (#2989)

* Fix insert column header bug (#2995)

* Fix WWW import rewrite for React (#2996)

* bad toc types

* fix react rename

* Fix www exports (#2994)

* [Automated Releases] Add logging and dry run to release script (#2986)

* add logs to release script

* add dry run to release script

* adjust dry run script

* add tag

* dont paginate changelog output

* auto-update changelog

* fix changelog

* fix import

* async

* cleanup

* fix

* fix

* Add DEPRECATED prefix to Grid APIs (#2966)

* Rm unused helpers from older markdown code (#2998)

* ElementNode -> isTopLevel() (#3001)

* Capture pendingDecorators after garbage collecting detached decorators (#2999)

* v0.4.2-next.0

Co-authored-by: Tyler Bainbridge <tyler@tylerbainbridge.com>
Co-authored-by: Christian Ratz <2630316+digitalgopnik@users.noreply.github.com>
Co-authored-by: Christian Ratz <christian.ratz@b-ite.de>
Co-authored-by: Patrick McCullough <57294106+pgmccullough@users.noreply.github.com>
Co-authored-by: Dominic Gannaway <trueadm@users.noreply.github.com>
Co-authored-by: Maksim Horbachevsky <fantactuka@gmail.com>
Co-authored-by: Hafiz <muhamm3dhafiz@gmail.com>
Co-authored-by: kimulaco <11986753+kimulaco@users.noreply.github.com>
Co-authored-by: ly3xqhl8g9 <ly3xqhl8g9@plurid.com>
Co-authored-by: Gerard Rovira <zurfyx@users.noreply.github.com>
Co-authored-by: Adrien Wald <adrien@genei.io>
Co-authored-by: Lexical GitHub Actions Bot <>
  • Loading branch information
12 people committed Sep 13, 2022
1 parent 343a006 commit a58b761
Show file tree
Hide file tree
Showing 92 changed files with 1,116 additions and 842 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish to NPM
on:
push:
branches:
- next
- latest
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm run prepare-release
- run: node ./scripts/npm/release.js --non-interactive --dry-run=${{ secrets.RELEASE_DRY_RUN }} --channel $GITHUB_REF_NAME
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Create New Release Branch
on:
workflow_dispatch:
inputs:
increment:
description: 'Version Increment'
required: true
default: 'prerelease'
type: choice
options:
- prerelease
- patch
- minor
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_KEY }}
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name "Lexical GitHub Actions Bot"
git config user.email "<>"
- run: npm install
- run: npm run increment-version -- --i $INCREMENT
env:
INCREMENT: ${{ inputs.increment }}
- run: git push -u git@github.com:facebook/lexical.git --follow-tags
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.3.11 (September 5, 2022)
## 0.4.1 (September 5, 2022)

- Fix breaking bug for `isEditable` mode in editor initialization (#2945) Tim Laubert
- Fix Safari selection highlighting bug (#2943) John Flockton
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lexical/monorepo",
"description": "Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.",
"version": "0.4.1",
"version": "0.4.2-next.0",
"license": "MIT",
"private": true,
"workspaces": [
Expand Down Expand Up @@ -90,8 +90,11 @@
"prepare-release": "npm run build-release && node ./scripts/npm/prepare-release.js",
"prepare": "husky install",
"prepare-www": "node scripts/www/rewriteImports.js",
"changelog": "func() { git log --oneline ${1}...HEAD --pretty=format:\"- %s %an\"; }; func",
"changelog": "func() { git --no-pager log --oneline ${1}...HEAD --pretty=format:\"- %s %an\"; }; func",
"increment-version": "node ./scripts/npm/increment-version",
"update-changelog": "node ./scripts/npm/update-changelog",
"update-version": "node ./scripts/updateVersion",
"postversion": "git checkout -b $npm_package_version && npm install && npm run update-version && npm run update-changelog && git add -A && git commit -m v${npm_package_version} && git tag -a v${npm_package_version} -m v${npm_package_version}",
"release": "npm run prepare-release && node ./scripts/npm/release.js"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/lexical-clipboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"paste"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalClipboard.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"dependencies": {
"@lexical/utils": "0.4.1",
"@lexical/list": "0.4.1",
"@lexical/selection": "0.4.1",
"@lexical/html": "0.4.1"
"@lexical/utils": "0.4.2-next.0",
"@lexical/list": "0.4.2-next.0",
"@lexical/selection": "0.4.2-next.0",
"@lexical/html": "0.4.2-next.0"
},
"repository": {
"type": "git",
Expand Down
56 changes: 31 additions & 25 deletions packages/lexical-clipboard/src/clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ import {
} from '@lexical/selection';
import {$findMatchingParent} from '@lexical/utils';
import {
$createGridSelection,
$createParagraphNode,
$getRoot,
$getSelection,
$isDecoratorNode,
$isElementNode,
$isGridCellNode,
$isGridNode,
$isGridRowNode,
$isGridSelection,
$isLineBreakNode,
$isRangeSelection,
$isTextNode,
$parseSerializedNode,
$setSelection,
GridNode,
DEPRECATED_$createGridSelection,
DEPRECATED_$isGridCellNode,
DEPRECATED_$isGridNode,
DEPRECATED_$isGridRowNode,
DEPRECATED_$isGridSelection,
DEPRECATED_GridNode,
SELECTION_CHANGE_COMMAND,
} from 'lexical';
import invariant from 'shared/invariant';
Expand Down Expand Up @@ -148,15 +148,19 @@ export function $insertGeneratedNodes(
selection: RangeSelection | GridSelection,
) {
const isSelectionInsideOfGrid =
$isGridSelection(selection) ||
DEPRECATED_$isGridSelection(selection) ||
($findMatchingParent(selection.anchor.getNode(), (n) =>
$isGridCellNode(n),
DEPRECATED_$isGridCellNode(n),
) !== null &&
$findMatchingParent(selection.focus.getNode(), (n) =>
$isGridCellNode(n),
DEPRECATED_$isGridCellNode(n),
) !== null);

if (isSelectionInsideOfGrid && nodes.length === 1 && $isGridNode(nodes[0])) {
if (
isSelectionInsideOfGrid &&
nodes.length === 1 &&
DEPRECATED_$isGridNode(nodes[0])
) {
$mergeGridNodesStrategy(nodes, selection, false, editor);
return;
}
Expand Down Expand Up @@ -216,11 +220,11 @@ function $basicInsertStrategy(

if ($isRangeSelection(selection)) {
selection.insertNodes(topLevelBlocks);
} else if ($isGridSelection(selection)) {
} else if (DEPRECATED_$isGridSelection(selection)) {
// If there's an active grid selection and a non grid is pasted, add to the anchor.
const anchorCell = selection.anchor.getNode();

if (!$isGridCellNode(anchorCell)) {
if (!DEPRECATED_$isGridCellNode(anchorCell)) {
invariant(false, 'Expected Grid Cell in Grid Selection');
}

Expand All @@ -234,28 +238,30 @@ function $mergeGridNodesStrategy(
isFromLexical: boolean,
editor: LexicalEditor,
) {
if (nodes.length !== 1 || !$isGridNode(nodes[0])) {
if (nodes.length !== 1 || !DEPRECATED_$isGridNode(nodes[0])) {
invariant(false, '$mergeGridNodesStrategy: Expected Grid insertion.');
}

const newGrid = nodes[0];
const newGridRows = newGrid.getChildren();
const newColumnCount = newGrid
.getFirstChildOrThrow<GridNode>()
.getFirstChildOrThrow<DEPRECATED_GridNode>()
.getChildrenSize();
const newRowCount = newGrid.getChildrenSize();
const gridCellNode = $findMatchingParent(selection.anchor.getNode(), (n) =>
$isGridCellNode(n),
DEPRECATED_$isGridCellNode(n),
);
const gridRowNode =
gridCellNode && $findMatchingParent(gridCellNode, (n) => $isGridRowNode(n));
gridCellNode &&
$findMatchingParent(gridCellNode, (n) => DEPRECATED_$isGridRowNode(n));
const gridNode =
gridRowNode && $findMatchingParent(gridRowNode, (n) => $isGridNode(n));
gridRowNode &&
$findMatchingParent(gridRowNode, (n) => DEPRECATED_$isGridNode(n));

if (
!$isGridCellNode(gridCellNode) ||
!$isGridRowNode(gridRowNode) ||
!$isGridNode(gridNode)
!DEPRECATED_$isGridCellNode(gridCellNode) ||
!DEPRECATED_$isGridRowNode(gridRowNode) ||
!DEPRECATED_$isGridNode(gridNode)
) {
invariant(
false,
Expand Down Expand Up @@ -285,13 +291,13 @@ function $mergeGridNodesStrategy(
for (let r = fromY; r <= toY; r++) {
const currentGridRowNode = gridRowNodes[r];

if (!$isGridRowNode(currentGridRowNode)) {
if (!DEPRECATED_$isGridRowNode(currentGridRowNode)) {
invariant(false, 'getNodes: expected to find GridRowNode');
}

const newGridRowNode = newGridRows[newRowIdx];

if (!$isGridRowNode(newGridRowNode)) {
if (!DEPRECATED_$isGridRowNode(newGridRowNode)) {
invariant(false, 'getNodes: expected to find GridRowNode');
}

Expand All @@ -302,13 +308,13 @@ function $mergeGridNodesStrategy(
for (let c = fromX; c <= toX; c++) {
const currentGridCellNode = gridCellNodes[c];

if (!$isGridCellNode(currentGridCellNode)) {
if (!DEPRECATED_$isGridCellNode(currentGridCellNode)) {
invariant(false, 'getNodes: expected to find GridCellNode');
}

const newGridCellNode = newGridCellNodes[newColumnIdx];

if (!$isGridCellNode(newGridCellNode)) {
if (!DEPRECATED_$isGridCellNode(newGridCellNode)) {
invariant(false, 'getNodes: expected to find GridCellNode');
}

Expand Down Expand Up @@ -336,7 +342,7 @@ function $mergeGridNodesStrategy(
}

if (newAnchorCellKey && newFocusCellKey) {
const newGridSelection = $createGridSelection();
const newGridSelection = DEPRECATED_$createGridSelection();
newGridSelection.set(gridNode.getKey(), newAnchorCellKey, newFocusCellKey);
$setSelection(newGridSelection);
editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);
Expand Down
6 changes: 3 additions & 3 deletions packages/lexical-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"code"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalCode.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"dependencies": {
"@lexical/utils": "0.4.1",
"@lexical/utils": "0.4.2-next.0",
"prismjs": "^1.27.0"
},
"repository": {
Expand Down
8 changes: 5 additions & 3 deletions packages/lexical-code/src/CodeNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,13 @@ export function $isCodeNode(
}

function convertPreElement(domNode: Node): DOMConversionOutput {
return {node: $createCodeNode()};
return {node: $createCodeNode(), preformatted: true};
}

function convertDivElement(domNode: Node): DOMConversionOutput {
// domNode is a <div> since we matched it by nodeName
const div = domNode as HTMLDivElement;
const isCode = isCodeElement(div);
return {
after: (childLexicalNodes) => {
const domParent = domNode.parentNode;
Expand All @@ -304,12 +305,13 @@ function convertDivElement(domNode: Node): DOMConversionOutput {
}
return childLexicalNodes;
},
node: isCodeElement(div) ? $createCodeNode() : null,
node: isCode ? $createCodeNode() : null,
preformatted: isCode,
};
}

function convertTableElement(): DOMConversionOutput {
return {node: $createCodeNode()};
return {node: $createCodeNode(), preformatted: true};
}

function convertCodeNoop(): DOMConversionOutput {
Expand Down
4 changes: 2 additions & 2 deletions packages/lexical-dragon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"accessibility"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalDragon.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/lexical-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"export"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalFile.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/lexical-hashtag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"hashtag"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalHashtag.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"dependencies": {
"@lexical/utils": "0.4.1"
"@lexical/utils": "0.4.2-next.0"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/lexical-headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"headless"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalHeadless.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/lexical-history/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"history"
],
"license": "MIT",
"version": "0.4.1",
"version": "0.4.2-next.0",
"main": "LexicalHistory.js",
"peerDependencies": {
"lexical": "0.4.1"
"lexical": "0.4.2-next.0"
},
"dependencies": {
"@lexical/utils": "0.4.1"
"@lexical/utils": "0.4.2-next.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit a58b761

Please sign in to comment.