Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into refactor-npm-package-…
Browse files Browse the repository at this point in the history
…process-facebookgh-5869
  • Loading branch information
etrepum committed Apr 17, 2024
2 parents 37c078e + 93cf85e commit b3aad22
Show file tree
Hide file tree
Showing 73 changed files with 605 additions and 603 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ module.exports = {
rules: {
'accessor-pairs': OFF,

'brace-style': [ERROR, '1tbs'],
'consistent-return': OFF,
curly: [ERROR, 'all'],
'dot-location': [ERROR, 'property'],
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ name: Nightly Release Branch
on:
schedule:
# Run daily at 2:30am UTC
- cron: '30 2 * * 1-5'
# - cron: '30 2 * * 1-5'
jobs:
release:
# prevents this action from running on forks
if: github.repository_owner == 'facebook'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_KEY }}
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name "Lexical GitHub Actions Bot"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run prepare-release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_KEY }}
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: |
git config user.name "Lexical GitHub Actions Bot"
Expand All @@ -37,4 +36,5 @@ jobs:
- run: LATEST_RELEASE=${{ steps.latest.outputs.release }} npm run increment-version -- --i $INCREMENT
env:
INCREMENT: ${{ inputs.increment }}
- run: npm install
- run: git push -u [email protected]:facebook/lexical.git --follow-tags
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
## v0.14.5 (2024-04-16)

- update lock file (#5904) Acy Watson
- fix(lexicalreact) lexicalreact 0.14.4 brings in lexicaldevtools-core dependency without declaring it (#5902) Vlad Fedosov
- v0.14.4 (#5900) Acy Watson
- v0.14.4 Lexical GitHub Actions Bot

## v0.14.4 (2024-04-16)

- chore(lexicalplayground) Remove unnecessary type assertions from useReport.ts (#5884) wnhlee
- fix(lexical) avoid implicit any type by explicitly setting variable type (#5889) Xuan
- fix(lexical-reactLexicalClearEditorPlugin) Fix #3456 stale selection state after clear format (#5896) Sahejkm
- feat(lexicaldevtools) Extracted storemessaging implementation to the separate packages (#5894) Vlad Fedosov
- Remove a special case in table deleteTextHandler (#5891) Alex Reznik
- Bump publish scripts to v4 (#5817) Ivaylo Pavlov
- docs Fix broken style for node overrides example on docs (#5890) wnhlee
- chore Fix nested typo in README (#5892) Zach Heckert
- docs fix typedoc links and add missing packages (#5850) Bob Ippolito
- feat use devprod conditions instead of webpack in exports (#5858) Bob Ippolito
- fix(playground) wrong logic for FloatingLinkEditorPlugin bad node (#5814) Aron Griffis
- fix #4468 Preserv elemement text align format on new paragraph creation (#5878) Sahejkm
- fix test failing after rebase on bug fix for multiple text nodes styles in a cell node (#5872) Sahejkm
- Fix #5663 styling from td not persisted on copy paste (#5855) Sahejkm
- Replace async arrow with function (#5870) Gerard Rovira
- TextNode support font-weight bold (#5852) Gerard Rovira
- Add missing rewrite of utils import (#5866) John Flockton
- Revert Revert feat(lexicaldevtools) Added TreeView rendering instead of a simple textarea (#5864) John Flockton
- Revert feat(lexicaldevtools) Added TreeView rendering instead of a simple textarea (#5861) John Flockton
- Fix bug with typeahead positioning (#5859) John Flockton
- feat(lexicaldevtools) Added TreeView rendering instead of a simple textarea (#5830) Vlad Fedosov
- fix Clear Formatting (#5849) Manuel Ojeda
- Fix issue with removeing selectionchange correctly (#5848) John Flockton
- Fix #5620 Persist format at paragraph level for new line (#5822) Sahejkm
- Use updated docRoot count in removeRootElementEvents (#5847) John Flockton
- chore upgrade to docusaurus 3 (#5838) Bob Ippolito
- Use unnamed ESM imports for Prism modules (#5828) John Flockton
- fix webpack needs its own export condition (#5833) Bob Ippolito
- Add missing flow type parameters for insertNewAfter (#5832) Sahejkm
- feat export IS and CAN environment constants from lexicalutils (#5831) Bob Ippolito
- Fix failing WWW build (#5826) John Flockton
- v0.14.3 (#5816) Ivaylo Pavlov
- v0.14.3 Lexical GitHub Actions Bot

## v0.14.3 (2024-04-03)

- fix removed overwrite of copyright (#5811) Sven ani
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ For those familiar with React Hooks, you can think of these $functions as having

Node Transforms and Command Listeners are called with an implicit `editor.update(() => {...})` context.

It is permitted to do nest updates within reads and updates, but an update may not be nested in a read.
It is permitted to do nested updates within reads and updates, but an update may not be nested in a read.
For example, `editor.update(() => editor.update(() => {...}))` is allowed.

All Lexical Nodes are dependent on the associated Editor State. With few exceptions, you should only call methods
Expand Down
6 changes: 3 additions & 3 deletions examples/react-rich/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@lexical/react-rich-example",
"private": true,
"version": "0.14.3",
"version": "0.14.5",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@lexical/react": "0.14.3",
"lexical": "0.14.3",
"@lexical/react": "0.14.5",
"lexical": "0.14.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
12 changes: 6 additions & 6 deletions examples/vanilla-js-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@lexical/vanilla-js-plugin-example",
"private": true,
"version": "0.14.3",
"version": "0.14.5",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@lexical/dragon": "0.14.3",
"@lexical/history": "0.14.3",
"@lexical/rich-text": "0.14.3",
"@lexical/utils": "0.14.3",
"@lexical/dragon": "0.14.5",
"@lexical/history": "0.14.5",
"@lexical/rich-text": "0.14.5",
"@lexical/utils": "0.14.5",
"emoji-datasource-facebook": "15.1.2",
"lexical": "0.14.3"
"lexical": "0.14.5"
},
"devDependencies": {
"typescript": "^5.2.2",
Expand Down
12 changes: 6 additions & 6 deletions examples/vanilla-js/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@lexical/vanilla-js-example",
"private": true,
"version": "0.14.3",
"version": "0.14.5",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@lexical/dragon": "0.14.3",
"@lexical/history": "0.14.3",
"@lexical/rich-text": "0.14.3",
"@lexical/utils": "0.14.3",
"lexical": "0.14.3"
"@lexical/dragon": "0.14.5",
"@lexical/history": "0.14.5",
"@lexical/rich-text": "0.14.5",
"@lexical/utils": "0.14.5",
"lexical": "0.14.5"
},
"devDependencies": {
"typescript": "^5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion 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.14.3",
"version": "0.14.5",
"license": "MIT",
"private": true,
"workspaces": [
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,15 +9,15 @@
"paste"
],
"license": "MIT",
"version": "0.14.3",
"version": "0.14.5",
"main": "LexicalClipboard.js",
"types": "index.d.ts",
"dependencies": {
"@lexical/html": "0.14.3",
"@lexical/list": "0.14.3",
"@lexical/selection": "0.14.3",
"@lexical/utils": "0.14.3",
"lexical": "0.14.3"
"@lexical/html": "0.14.5",
"@lexical/list": "0.14.5",
"@lexical/selection": "0.14.5",
"@lexical/utils": "0.14.5",
"lexical": "0.14.5"
},
"repository": {
"type": "git",
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,12 +8,12 @@
"code"
],
"license": "MIT",
"version": "0.14.3",
"version": "0.14.5",
"main": "LexicalCode.js",
"types": "index.d.ts",
"dependencies": {
"@lexical/utils": "0.14.3",
"lexical": "0.14.3",
"@lexical/utils": "0.14.5",
"lexical": "0.14.5",
"prismjs": "^1.27.0"
},
"repository": {
Expand Down
14 changes: 7 additions & 7 deletions packages/lexical-devtools-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"utils"
],
"license": "MIT",
"version": "0.14.3",
"version": "0.14.5",
"main": "LexicalDevtoolsCore.js",
"types": "index.d.ts",
"dependencies": {
"@lexical/html": "0.14.3",
"@lexical/link": "0.14.3",
"@lexical/mark": "0.14.3",
"@lexical/table": "0.14.3",
"@lexical/utils": "0.14.3",
"lexical": "0.14.3"
"@lexical/html": "0.14.5",
"@lexical/link": "0.14.5",
"@lexical/mark": "0.14.5",
"@lexical/table": "0.14.5",
"@lexical/utils": "0.14.5",
"lexical": "0.14.5"
},
"peerDependencies": {
"react": ">=17.x",
Expand Down
6 changes: 3 additions & 3 deletions packages/lexical-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@lexical/devtools",
"description": "Lexical DevTools browser extension",
"private": true,
"version": "0.14.3",
"version": "0.14.5",
"type": "module",
"scripts": {
"dev": "wxt",
Expand All @@ -22,12 +22,12 @@
"zustand": "^4.5.1"
},
"devDependencies": {
"@lexical/devtools-core": "0.14.3",
"@lexical/devtools-core": "0.14.5",
"@rollup/plugin-babel": "^6.0.4",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@vitejs/plugin-react": "^4.2.1",
"lexical": "0.14.3",
"lexical": "0.14.5",
"typescript": "^5.3.3",
"vite": "^5.2.2",
"wxt": "^0.17.0"
Expand Down
15 changes: 12 additions & 3 deletions packages/lexical-devtools/src/components/EditorsRefreshCTA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,30 @@
*
*/

import type {IInjectedPegasusService} from '../entrypoints/injected/InjectedPegasusService';

import {getRPCService} from '@webext-pegasus/rpc';
import * as React from 'react';
import {useState} from 'react';

interface Props {
tabID: number;
setErrorMessage: (value: string) => void;
sendMessage: (message: string, t: null, target: string) => Promise<unknown>;
}

function EditorsRefreshCTA({tabID, setErrorMessage, sendMessage}: Props) {
function EditorsRefreshCTA({tabID, setErrorMessage}: Props) {
const [isRefreshing, setIsRefreshing] = useState(false);

const handleRefreshClick = () => {
setIsRefreshing(true);
sendMessage('refreshLexicalEditorsForTabID', null, `window@${tabID}`)

const injectedPegasusService = getRPCService<IInjectedPegasusService>(
'InjectedPegasusService',
{context: 'window', tabId: tabID},
);

injectedPegasusService
.refreshLexicalEditorsForTabID()
.catch((err) => {
setErrorMessage(err.message);
console.error(err);
Expand Down
9 changes: 9 additions & 0 deletions packages/lexical-devtools/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* 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 EXTENSION_NAME = 'lexical-devtools';
32 changes: 0 additions & 32 deletions packages/lexical-devtools/src/entrypoints/background.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* 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.
*
*/
import {PegasusRPCMessage} from '@webext-pegasus/rpc';

export type ITabIDService = typeof getTabIDService;

export async function getTabIDService(
message: PegasusRPCMessage,
): Promise<number> {
let tabID: number | undefined = message.sender.tabId;
if (message.sender.context === 'popup') {
tabID = (await browser.tabs.query({active: true, currentWindow: true}))[0]
.id;
}
if (tabID === undefined) {
throw new Error(`Could not get tab ID for message: ${message.toString()}`);
}
return tabID;
}
Loading

0 comments on commit b3aad22

Please sign in to comment.