From 82c34618c9c52370c6b3f4b456a9d94cc0569384 Mon Sep 17 00:00:00 2001 From: Caleb OLeary Date: Mon, 15 Aug 2022 18:19:02 -0500 Subject: [PATCH 01/79] fix(component): make Select close when option chosen with Enter key --- libs/components/ui/src/select/Select.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/libs/components/ui/src/select/Select.tsx b/libs/components/ui/src/select/Select.tsx index 7dcfcdc45a..c11ee9f3b4 100644 --- a/libs/components/ui/src/select/Select.tsx +++ b/libs/components/ui/src/select/Select.tsx @@ -1,5 +1,6 @@ import { forwardRef, + useState, type CSSProperties, type ForwardedRef, type ReactNode, @@ -39,6 +40,7 @@ export const Select = forwardRef(function CustomSelect( props: ExtendSelectProps & SelectUnstyledProps, ref: ForwardedRef ) { + const [isOpen, setIsOpen] = useState(false); const { width = '100%', style, listboxStyle, placeholder } = props; const components: SelectUnstyledProps['components'] = { // Root: generateStyledRoot({ width, ...style }), @@ -76,7 +78,21 @@ export const Select = forwardRef(function CustomSelect( ...props.components, }; - return ; + return ( + { + setIsOpen(true); + }} + {...props} + onChange={v => { + setIsOpen(false); + props.onChange && props.onChange(v); + }} + ref={ref} + components={components} + /> + ); }) as ( props: ExtendSelectProps & SelectUnstyledProps & From e1dece05952a60845413d0fec110853d7d2494f5 Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Fri, 19 Aug 2022 20:41:09 +0800 Subject: [PATCH 02/79] refactor: change activatable to editable in BaseVeiw --- .../editor-blocks/src/blocks/code/index.ts | 2 +- .../src/blocks/embed-link/index.ts | 2 +- .../editor-blocks/src/blocks/figma/index.ts | 2 +- .../editor-blocks/src/blocks/file/index.ts | 2 +- .../src/blocks/grid-item/index.ts | 2 +- .../editor-blocks/src/blocks/grid/index.ts | 2 +- .../editor-blocks/src/blocks/group/Group.tsx | 2 +- .../editor-blocks/src/blocks/image/index.ts | 2 +- .../editor-blocks/src/blocks/youtube/index.ts | 2 +- .../src/editor/selection/selection.ts | 24 +++++++++---------- .../editor-core/src/editor/views/base-view.ts | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libs/components/editor-blocks/src/blocks/code/index.ts b/libs/components/editor-blocks/src/blocks/code/index.ts index 9b089d6db5..ce8d7badfb 100644 --- a/libs/components/editor-blocks/src/blocks/code/index.ts +++ b/libs/components/editor-blocks/src/blocks/code/index.ts @@ -16,7 +16,7 @@ import { ComponentType } from 'react'; export class CodeBlock extends BaseView { type = Protocol.Block.Type.code; public override selectable = true; - public override activatable = false; + public override editable = false; // View = CodeView; View = CodeView; override async onCreate(block: AsyncBlock): Promise { diff --git a/libs/components/editor-blocks/src/blocks/embed-link/index.ts b/libs/components/editor-blocks/src/blocks/embed-link/index.ts index 731ae801d6..947763ee16 100644 --- a/libs/components/editor-blocks/src/blocks/embed-link/index.ts +++ b/libs/components/editor-blocks/src/blocks/embed-link/index.ts @@ -8,7 +8,7 @@ import { EmbedLinkView } from './EmbedLinkView'; export class EmbedLinkBlock extends BaseView { public override selectable = true; - public override activatable = false; + public override editable = false; type = Protocol.Block.Type.embedLink; View = EmbedLinkView; diff --git a/libs/components/editor-blocks/src/blocks/figma/index.ts b/libs/components/editor-blocks/src/blocks/figma/index.ts index 3ed44c9c85..4eb9d6047f 100644 --- a/libs/components/editor-blocks/src/blocks/figma/index.ts +++ b/libs/components/editor-blocks/src/blocks/figma/index.ts @@ -8,7 +8,7 @@ import { FigmaView } from './FigmaView'; export class FigmaBlock extends BaseView { public override selectable = true; - public override activatable = false; + public override editable = false; type = Protocol.Block.Type.figma; View = FigmaView; diff --git a/libs/components/editor-blocks/src/blocks/file/index.ts b/libs/components/editor-blocks/src/blocks/file/index.ts index e55eed7721..e3119e9a16 100644 --- a/libs/components/editor-blocks/src/blocks/file/index.ts +++ b/libs/components/editor-blocks/src/blocks/file/index.ts @@ -12,7 +12,7 @@ import { FileView } from './FileView'; export class FileBlock extends BaseView { public override selectable = true; - public override activatable = false; + public override editable = false; type = Protocol.Block.Type.file; View = FileView; diff --git a/libs/components/editor-blocks/src/blocks/grid-item/index.ts b/libs/components/editor-blocks/src/blocks/grid-item/index.ts index 7f51c47a05..2c6598d18d 100644 --- a/libs/components/editor-blocks/src/blocks/grid-item/index.ts +++ b/libs/components/editor-blocks/src/blocks/grid-item/index.ts @@ -6,7 +6,7 @@ import { GridItemRender } from './GridItemRender'; export class GridItemBlock extends BaseView { public override selectable = false; - public override activatable = false; + public override editable = false; public override allowPendant = false; public override layoutOnly = true; diff --git a/libs/components/editor-blocks/src/blocks/grid/index.ts b/libs/components/editor-blocks/src/blocks/grid/index.ts index 582014376f..a74bb130f9 100644 --- a/libs/components/editor-blocks/src/blocks/grid/index.ts +++ b/libs/components/editor-blocks/src/blocks/grid/index.ts @@ -7,7 +7,7 @@ export { GRID_PROPERTY_KEY, removePercent } from './Grid'; export class GridBlock extends BaseView { public override selectable = false; - public override activatable = false; + public override editable = false; public override allowPendant = false; public override layoutOnly = true; diff --git a/libs/components/editor-blocks/src/blocks/group/Group.tsx b/libs/components/editor-blocks/src/blocks/group/Group.tsx index ac194d7eab..787c537f18 100644 --- a/libs/components/editor-blocks/src/blocks/group/Group.tsx +++ b/libs/components/editor-blocks/src/blocks/group/Group.tsx @@ -9,7 +9,7 @@ import { GroupView } from './GroupView'; export class Group extends BaseView { public override selectable = true; - public override activatable = false; + public override editable = false; public override allowPendant = false; type = Protocol.Block.Type.group; diff --git a/libs/components/editor-blocks/src/blocks/image/index.ts b/libs/components/editor-blocks/src/blocks/image/index.ts index 8f56468b41..e5c33514e2 100644 --- a/libs/components/editor-blocks/src/blocks/image/index.ts +++ b/libs/components/editor-blocks/src/blocks/image/index.ts @@ -8,7 +8,7 @@ import { ImageView } from './ImageView'; export class ImageBlock extends BaseView { public override selectable = true; - public override activatable = false; + public override editable = false; type = Protocol.Block.Type.image; View = ImageView; diff --git a/libs/components/editor-blocks/src/blocks/youtube/index.ts b/libs/components/editor-blocks/src/blocks/youtube/index.ts index 42f22bcda4..f04e241d88 100644 --- a/libs/components/editor-blocks/src/blocks/youtube/index.ts +++ b/libs/components/editor-blocks/src/blocks/youtube/index.ts @@ -8,7 +8,7 @@ import { YoutubeView } from './YoutubeView'; export class YoutubeBlock extends BaseView { public override selectable = true; - public override activatable = false; + public override editable = false; type = Protocol.Block.Type.youtube; View = YoutubeView; diff --git a/libs/components/editor-core/src/editor/selection/selection.ts b/libs/components/editor-core/src/editor/selection/selection.ts index e6c1f94c83..c33eb6d64c 100644 --- a/libs/components/editor-core/src/editor/selection/selection.ts +++ b/libs/components/editor-core/src/editor/selection/selection.ts @@ -408,13 +408,13 @@ export class SelectionManager implements VirgoSelection { /** * - * get previous activatable blockNode + * get previous editable blockNode * @private * @param {AsyncBlock} node * @return {*} {(Promise)} * @memberof SelectionManager */ - private async _getPreviousActivatableBlockNode( + private async _getPreviousEditableBlockNode( node: AsyncBlock ): Promise { const preNode = await node.physicallyPerviousSibling(); @@ -422,8 +422,8 @@ export class SelectionManager implements VirgoSelection { if (!preNode) { return null; } - const { activatable, selectable } = this._editor.getView(preNode.type); - if (activatable) { + const { editable, selectable } = this._editor.getView(preNode.type); + if (editable) { this.setSelectedNodesIds([]); return preNode; } @@ -432,18 +432,18 @@ export class SelectionManager implements VirgoSelection { (document.activeElement as HTMLInputElement)?.blur(); return null; } - return this._getPreviousActivatableBlockNode(preNode); + return this._getPreviousEditableBlockNode(preNode); } /** * - * get next activatable blockNode + * get next editable blockNode * @private * @param {AsyncBlock} node * @return {*} {(Promise)} * @memberof SelectionManager */ - private async _getNextActivatableBlockNode( + private async _getNextEditableBlockNode( node: AsyncBlock, ignoreSelf = true ): Promise { @@ -482,8 +482,8 @@ export class SelectionManager implements VirgoSelection { } } - const { activatable, selectable } = this._editor.getView(nextNode.type); - if (activatable) { + const { editable, selectable } = this._editor.getView(nextNode.type); + if (editable) { this.setSelectedNodesIds([]); return nextNode; } @@ -492,7 +492,7 @@ export class SelectionManager implements VirgoSelection { (document.activeElement as HTMLInputElement)?.blur(); return null; } - return this._getNextActivatableBlockNode(nextNode); + return this._getNextEditableBlockNode(nextNode); } /** @@ -513,7 +513,7 @@ export class SelectionManager implements VirgoSelection { return; } } - preNode = await this._getPreviousActivatableBlockNode(node); + preNode = await this._getPreviousEditableBlockNode(node); if (preNode) { this.activeNodeByNodeId(preNode.id, position); } @@ -622,7 +622,7 @@ export class SelectionManager implements VirgoSelection { } } - nextNode = await this._getNextActivatableBlockNode(node); + nextNode = await this._getNextEditableBlockNode(node); if (nextNode) { this.activeNodeByNodeId(nextNode.id, position); } diff --git a/libs/components/editor-core/src/editor/views/base-view.ts b/libs/components/editor-core/src/editor/views/base-view.ts index eb5c293243..2b3002f500 100644 --- a/libs/components/editor-core/src/editor/views/base-view.ts +++ b/libs/components/editor-core/src/editor/views/base-view.ts @@ -36,10 +36,10 @@ export abstract class BaseView { abstract type: string; /** - * activatable means can be focused + * editable means can be focused * @memberof BaseView */ - public activatable = true; + public editable = true; public selectable = true; From 7c117e5f8fb80930fb3277fa6a2b0468e57723db Mon Sep 17 00:00:00 2001 From: Yipei Wei <79373028+Yipei-Operation@users.noreply.github.com> Date: Sun, 21 Aug 2022 21:33:26 +0800 Subject: [PATCH 03/79] Update README.md add contact email --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 396bfe008e..d4e8eb9953 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,8 @@ Get quick help on [Telegram](https://t.me/affineworkos) or [Discord](https://dis Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [Medium](https://medium.com/@affineworkos) and the [AFFiNE Blog](https://blog.affine.pro/). +Our contact email address is contact@toeverything.info. + # The Philosophy of AFFiNE Timothy Berners-Lee once taught us about the idea of the semantic web, where all the data can be interpreted in any form while the "truth" is kept. This gives our best image of an ideal knowledge base by far, that sorting of information, planning of project and goals as well as creating of knowledge can be all together. From 7822c4a0fda2e1208ba424c21065cd75a8db6d63 Mon Sep 17 00:00:00 2001 From: Yipei Wei <79373028+Yipei-Operation@users.noreply.github.com> Date: Sun, 21 Aug 2022 21:40:06 +0800 Subject: [PATCH 04/79] Update README.md add contact info of founder --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 396bfe008e..a7ac8da75e 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,10 @@ Get quick help on [Telegram](https://t.me/affineworkos) or [Discord](https://dis Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [Medium](https://medium.com/@affineworkos) and the [AFFiNE Blog](https://blog.affine.pro/). +# Contact Us +The contact info for AFFiNE Founder is here: hejiachen@toeverything.info + + # The Philosophy of AFFiNE Timothy Berners-Lee once taught us about the idea of the semantic web, where all the data can be interpreted in any form while the "truth" is kept. This gives our best image of an ideal knowledge base by far, that sorting of information, planning of project and goals as well as creating of knowledge can be all together. From 96b3a2c0d5d1787ff81f5de330ed7ec21565c40b Mon Sep 17 00:00:00 2001 From: Chi Zhang Date: Sun, 21 Aug 2022 21:53:00 +0800 Subject: [PATCH 05/79] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index eec49318e0..919fcf4114 100644 --- a/README.md +++ b/README.md @@ -139,10 +139,9 @@ Get quick help on [Telegram](https://t.me/affineworkos) or [Discord](https://dis Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [Medium](https://medium.com/@affineworkos) and the [AFFiNE Blog](https://blog.affine.pro/). - # Contact Us -The contact info for AFFiNE Founder is here: hejiachen@toeverything.info +The contact info for AFFiNE Founder is here: hejiachen@toeverything.info # The Philosophy of AFFiNE From 17e454b1e65026cdd804602d2fb076f6b4f1013e Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Sun, 21 Aug 2022 22:58:41 +0800 Subject: [PATCH 06/79] refactor: refactor clipboard --- .../common/src/lib/text/slate-utils.ts | 37 ++++- .../editor-blocks/src/blocks/bullet/index.ts | 9 -- .../editor-blocks/src/blocks/code/index.ts | 9 -- .../src/blocks/numbered/index.ts | 9 -- .../editor-blocks/src/blocks/page/index.ts | 9 -- .../src/blocks/text/QuoteBlock.tsx | 17 --- .../src/blocks/text/TextBlock.tsx | 33 ----- .../editor-blocks/src/blocks/todo/index.ts | 9 -- .../editor-blocks/src/blocks/youtube/index.ts | 4 +- .../src/editor/block/block-helper.ts | 114 +++++++++++++++- .../src/editor/clipboard/browser-clipboard.ts | 128 ----------------- .../editor/clipboard/clipboard-populator.ts | 38 ------ .../src/editor/clipboard/clipboard.ts | 47 +++++++ .../clipboard/clipboardEventDispatcher.ts | 82 +++++++++++ .../src/editor/clipboard/clipboardUtils.ts | 121 ++++++++++++++++ .../editor-core/src/editor/clipboard/copy.ts | 129 +++++++++++++++++- .../editor-core/src/editor/clipboard/index.ts | 0 .../editor-core/src/editor/clipboard/paste.ts | 4 +- .../editor-core/src/editor/clipboard/utils.ts | 8 +- .../editor-core/src/editor/editor.ts | 63 ++++----- .../editor-core/src/editor/index.ts | 2 +- .../editor-core/src/editor/plugin/hooks.ts | 11 +- .../editor-core/src/editor/types.ts | 10 +- .../editor-core/src/editor/views/base-view.ts | 45 +++--- 24 files changed, 592 insertions(+), 346 deletions(-) delete mode 100644 libs/components/editor-core/src/editor/clipboard/browser-clipboard.ts delete mode 100644 libs/components/editor-core/src/editor/clipboard/clipboard-populator.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/clipboard.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/index.ts diff --git a/libs/components/common/src/lib/text/slate-utils.ts b/libs/components/common/src/lib/text/slate-utils.ts index ec7e219810..fb183a7c35 100644 --- a/libs/components/common/src/lib/text/slate-utils.ts +++ b/libs/components/common/src/lib/text/slate-utils.ts @@ -24,6 +24,7 @@ import { MARKDOWN_STYLE_MAP, MatchRes, } from './utils'; +import { AsyncBlock, SelectBlock } from '@toeverything/components/editor-core'; function isInlineAndVoid(editor: Editor, el: any) { return editor.isInline(el) && editor.isVoid(el); @@ -958,7 +959,41 @@ class SlateUtils { } public getNodeByPath(path: Path) { - Editor.node(this.editor, path); + return Editor.node(this.editor, path); + } + + public getNodeByRange(range: Range) { + return Editor.node(this.editor, range); + } + + // This may should write with logic of render slate + public convertLeaf2Html(textValue: any) { + const { text, fontColor, fontBgColor } = textValue; + + const style = `style="${fontColor ? `color: ${fontColor};` : ''}${ + fontBgColor ? `backgroundColor: ${fontBgColor};` : '' + }"`; + if (textValue.bold) { + return `${text}`; + } + if (textValue.italic) { + return `${text}`; + } + if (textValue.underline) { + return `${text}`; + } + if (textValue.inlinecode) { + return `${text}`; + } + if (textValue.strikethrough) { + return `${text}`; + } + if (textValue.type === 'link') { + return `${this.convertLeaf2Html( + textValue.children + )}`; + } + return `${text}>`; } public getStartSelection() { diff --git a/libs/components/editor-blocks/src/blocks/bullet/index.ts b/libs/components/editor-blocks/src/blocks/bullet/index.ts index 087afb3056..58360954ce 100644 --- a/libs/components/editor-blocks/src/blocks/bullet/index.ts +++ b/libs/components/editor-blocks/src/blocks/bullet/index.ts @@ -2,7 +2,6 @@ import { AsyncBlock, BaseView, CreateView, - getTextProperties, SelectBlock, getTextHtml, } from '@toeverything/framework/virgo'; @@ -28,14 +27,6 @@ export class BulletBlock extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] diff --git a/libs/components/editor-blocks/src/blocks/code/index.ts b/libs/components/editor-blocks/src/blocks/code/index.ts index 9b089d6db5..1fc84f1df8 100644 --- a/libs/components/editor-blocks/src/blocks/code/index.ts +++ b/libs/components/editor-blocks/src/blocks/code/index.ts @@ -1,7 +1,6 @@ import { BaseView, AsyncBlock, - getTextProperties, CreateView, SelectBlock, getTextHtml, @@ -28,14 +27,6 @@ export class CodeBlock extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - // TODO: internal format not implemented yet override html2block( el: Element, diff --git a/libs/components/editor-blocks/src/blocks/numbered/index.ts b/libs/components/editor-blocks/src/blocks/numbered/index.ts index b8b3c3dc0a..37295e026f 100644 --- a/libs/components/editor-blocks/src/blocks/numbered/index.ts +++ b/libs/components/editor-blocks/src/blocks/numbered/index.ts @@ -1,7 +1,6 @@ import { AsyncBlock, BaseView, - getTextProperties, SelectBlock, getTextHtml, } from '@toeverything/framework/virgo'; @@ -29,14 +28,6 @@ export class NumberedBlock extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] diff --git a/libs/components/editor-blocks/src/blocks/page/index.ts b/libs/components/editor-blocks/src/blocks/page/index.ts index 412bbdbd7c..06151bc481 100644 --- a/libs/components/editor-blocks/src/blocks/page/index.ts +++ b/libs/components/editor-blocks/src/blocks/page/index.ts @@ -8,7 +8,6 @@ import { BaseView, ChildrenView, getTextHtml, - getTextProperties, SelectBlock, } from '@toeverything/framework/virgo'; @@ -35,14 +34,6 @@ export class PageBlock extends BaseView { return this.get_decoration(content, 'text')?.value?.[0].text; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override async block2html( block: AsyncBlock, children: SelectBlock[], diff --git a/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx b/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx index f62dfae040..94938aa595 100644 --- a/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx +++ b/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx @@ -7,7 +7,6 @@ import { BaseView, CreateView, getTextHtml, - getTextProperties, SelectBlock, } from '@toeverything/framework/virgo'; @@ -29,14 +28,6 @@ export class QuoteBlock extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] @@ -96,14 +87,6 @@ export class CalloutBlock extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] diff --git a/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx b/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx index 64902e252d..74085db922 100644 --- a/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx +++ b/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx @@ -2,7 +2,6 @@ import { BaseView, CreateView, AsyncBlock, - getTextProperties, SelectBlock, getTextHtml, } from '@toeverything/framework/virgo'; @@ -28,14 +27,6 @@ export class TextBlock extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] @@ -145,14 +136,6 @@ export class Heading1Block extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] @@ -210,14 +193,6 @@ export class Heading2Block extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] @@ -275,14 +250,6 @@ export class Heading3Block extends BaseView { return block; } - override getSelProperties( - block: AsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] diff --git a/libs/components/editor-blocks/src/blocks/todo/index.ts b/libs/components/editor-blocks/src/blocks/todo/index.ts index c6580009d0..db4187a890 100644 --- a/libs/components/editor-blocks/src/blocks/todo/index.ts +++ b/libs/components/editor-blocks/src/blocks/todo/index.ts @@ -1,6 +1,5 @@ import { BaseView, - getTextProperties, AsyncBlock, SelectBlock, getTextHtml, @@ -29,14 +28,6 @@ export class TodoBlock extends BaseView { return block; } - override getSelProperties( - block: TodoAsyncBlock, - selectInfo: any - ): DefaultColumnsValue { - const properties = super.getSelProperties(block, selectInfo); - return getTextProperties(properties, selectInfo); - } - override html2block( el: Element, parseEl: (el: Element) => any[] diff --git a/libs/components/editor-blocks/src/blocks/youtube/index.ts b/libs/components/editor-blocks/src/blocks/youtube/index.ts index 42f22bcda4..94ad3ac59d 100644 --- a/libs/components/editor-blocks/src/blocks/youtube/index.ts +++ b/libs/components/editor-blocks/src/blocks/youtube/index.ts @@ -41,7 +41,9 @@ export class YoutubeBlock extends BaseView { return null; } - + override async block2Text(block: AsyncBlock, selectInfo: SelectBlock) { + return block.getProperty('embedLink')?.value ?? ''; + } override async block2html( block: AsyncBlock, children: SelectBlock[], diff --git a/libs/components/editor-core/src/editor/block/block-helper.ts b/libs/components/editor-core/src/editor/block/block-helper.ts index 7bd0284ffc..70238c4be5 100644 --- a/libs/components/editor-core/src/editor/block/block-helper.ts +++ b/libs/components/editor-core/src/editor/block/block-helper.ts @@ -11,6 +11,11 @@ import { Selection as SlateSelection, } from 'slate'; import { Editor } from '../editor'; +import { + AsyncBlock, + SelectBlock, + SelectInfo, +} from '@toeverything/components/editor-core'; type TextUtilsFunctions = | 'getString' @@ -37,7 +42,9 @@ type TextUtilsFunctions = | 'blur' | 'setSelection' | 'insertNodes' - | 'getNodeByPath'; + | 'getNodeByPath' + | 'getNodeByRange' + | 'convertLeaf2Html'; type ExtendedTextUtils = SlateUtils & { setLinkModalVisible: (visible: boolean) => void; @@ -98,15 +105,116 @@ export class BlockHelper { return ''; } - public getBlockTextBetweenSelection(blockId: string) { + public async isBlockEditable(blockOrBlockId: AsyncBlock | string) { + const block = + typeof blockOrBlockId === 'string' + ? await this._editor.getBlockById(blockOrBlockId) + : blockOrBlockId; + const blockView = this._editor.getView(block.type); + + return blockView.activatable; + } + + public async getFlatBlocksUnderParent( + parentBlockId: string, + includeParent: boolean = false + ): Promise { + const blocks = []; + const block = await this._editor.getBlockById(parentBlockId); + if (includeParent) { + blocks.push(block); + } + const children = await block.children(); + ( + await Promise.all( + children.map(child => { + return this.getFlatBlocksUnderParent(child.id, true); + }) + ) + ).forEach(editableChildren => { + blocks.push(...editableChildren); + }); + return blocks; + } + + public getBlockTextBetweenSelection( + blockId: string, + shouldUsePreviousSelection = true + ) { const text_utils = this._blockTextUtilsMap[blockId]; if (text_utils) { - return text_utils.getStringBetweenSelection(true); + return text_utils.getStringBetweenSelection( + shouldUsePreviousSelection + ); } console.warn('Could find the block text utils'); return ''; } + public async getEditableBlockPropertiesBySelectInfo( + block: AsyncBlock, + selectInfo: SelectBlock + ) { + const properties = block.getProperties(); + if (properties.text.value.length === 0) { + return properties; + } + let text_value = properties.text.value; + + const { + text: { value: originTextValue, ...otherTextProperties }, + ...otherProperties + } = properties; + + // Use deepClone method will throw incomprehensible error + let textValue = JSON.parse(JSON.stringify(originTextValue)); + + if (selectInfo.endInfo) { + textValue = textValue.slice(0, selectInfo.endInfo.arrayIndex + 1); + textValue[textValue.length - 1].text = text_value[ + textValue.length - 1 + ].text.substring(0, selectInfo.endInfo.offset); + } + if (selectInfo.startInfo) { + textValue = textValue.slice(selectInfo.startInfo.arrayIndex); + textValue[0].text = textValue[0].text.substring( + selectInfo.startInfo.offset + ); + } + return { + ...otherProperties, + text: { + ...otherTextProperties, + value: textValue, + }, + }; + } + + // For editable blocks, the properties containing the selected text will be returned with the selection information + public async getBlockPropertiesBySelectInfo(selectBlockInfo: SelectBlock) { + const block = await this._editor.getBlockById(selectBlockInfo.blockId); + const blockView = this._editor.getView(block.type); + if (blockView.activatable) { + return this.getEditableBlockPropertiesBySelectInfo( + block, + selectBlockInfo + ); + } else { + return block?.getProperties(); + } + } + + public convertTextValue2Html(blockId: string, textValue: any) { + const text_utils = this._blockTextUtilsMap[blockId]; + if (!text_utils) { + return ''; + } + return textValue.reduce((html: string, textValueItem: any) => { + const fragment = text_utils.convertLeaf2Html(textValueItem); + return `${html}${fragment}`; + }, ''); + } + public setBlockBlur(blockId: string) { const text_utils = this._blockTextUtilsMap[blockId]; if (text_utils) { diff --git a/libs/components/editor-core/src/editor/clipboard/browser-clipboard.ts b/libs/components/editor-core/src/editor/clipboard/browser-clipboard.ts deleted file mode 100644 index 687c5280ee..0000000000 --- a/libs/components/editor-core/src/editor/clipboard/browser-clipboard.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { HooksRunner } from '../types'; -import { Editor } from '../editor'; -import ClipboardParse from './clipboard-parse'; -import { MarkdownParser } from './markdown-parse'; -import { shouldHandlerContinue } from './utils'; -import { Paste } from './paste'; -// todo needs to be a switch - -enum ClipboardAction { - COPY = 'copy', - CUT = 'cut', - PASTE = 'paste', -} - -//TODO: need to consider the cursor position after inserting the children -class BrowserClipboard { - private _eventTarget: Element; - private _hooks: HooksRunner; - private _editor: Editor; - private _clipboardParse: ClipboardParse; - private _markdownParse: MarkdownParser; - private _paste: Paste; - - constructor(eventTarget: Element, hooks: HooksRunner, editor: Editor) { - this._eventTarget = eventTarget; - this._hooks = hooks; - this._editor = editor; - this._clipboardParse = new ClipboardParse(editor); - this._markdownParse = new MarkdownParser(); - this._paste = new Paste( - editor, - this._clipboardParse, - this._markdownParse - ); - this._initialize(); - } - - public getClipboardParse() { - return this._clipboardParse; - } - - private _initialize() { - this._handleCopy = this._handleCopy.bind(this); - this._handleCut = this._handleCut.bind(this); - - document.addEventListener(ClipboardAction.COPY, this._handleCopy); - document.addEventListener(ClipboardAction.CUT, this._handleCut); - document.addEventListener( - ClipboardAction.PASTE, - this._paste.handlePaste - ); - this._eventTarget.addEventListener( - ClipboardAction.COPY, - this._handleCopy - ); - this._eventTarget.addEventListener( - ClipboardAction.CUT, - this._handleCut - ); - this._eventTarget.addEventListener( - ClipboardAction.PASTE, - this._paste.handlePaste - ); - } - - private _handleCopy(e: Event) { - if (!shouldHandlerContinue(e, this._editor)) { - return; - } - - this._dispatchClipboardEvent(ClipboardAction.COPY, e as ClipboardEvent); - } - - private _handleCut(e: Event) { - if (!shouldHandlerContinue(e, this._editor)) { - return; - } - - this._dispatchClipboardEvent(ClipboardAction.CUT, e as ClipboardEvent); - } - - private _preCopyCut(action: ClipboardAction, e: ClipboardEvent) { - switch (action) { - case ClipboardAction.COPY: - this._hooks.beforeCopy(e); - break; - - case ClipboardAction.CUT: - this._hooks.beforeCut(e); - break; - } - } - - private _dispatchClipboardEvent( - action: ClipboardAction, - e: ClipboardEvent - ) { - this._preCopyCut(action, e); - } - - dispose() { - document.removeEventListener(ClipboardAction.COPY, this._handleCopy); - document.removeEventListener(ClipboardAction.CUT, this._handleCut); - document.removeEventListener( - ClipboardAction.PASTE, - this._paste.handlePaste - ); - this._eventTarget.removeEventListener( - ClipboardAction.COPY, - this._handleCopy - ); - this._eventTarget.removeEventListener( - ClipboardAction.CUT, - this._handleCut - ); - this._eventTarget.removeEventListener( - ClipboardAction.PASTE, - this._paste.handlePaste - ); - this._clipboardParse.dispose(); - this._clipboardParse = null; - this._eventTarget = null; - this._hooks = null; - this._editor = null; - } -} - -export { BrowserClipboard }; diff --git a/libs/components/editor-core/src/editor/clipboard/clipboard-populator.ts b/libs/components/editor-core/src/editor/clipboard/clipboard-populator.ts deleted file mode 100644 index d7a8172566..0000000000 --- a/libs/components/editor-core/src/editor/clipboard/clipboard-populator.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Editor } from '../editor'; -import { SelectionManager } from '../selection'; -import { HookType, PluginHooks } from '../types'; -import ClipboardParse from './clipboard-parse'; -import { Subscription } from 'rxjs'; -import { Copy } from './copy'; -class ClipboardPopulator { - private _editor: Editor; - private _hooks: PluginHooks; - private _selectionManager: SelectionManager; - private _clipboardParse: ClipboardParse; - private _sub = new Subscription(); - private _copy: Copy; - constructor( - editor: Editor, - hooks: PluginHooks, - selectionManager: SelectionManager - ) { - this._editor = editor; - this._hooks = hooks; - this._selectionManager = selectionManager; - this._clipboardParse = new ClipboardParse(editor); - this._copy = new Copy(editor); - this._sub.add( - hooks.get(HookType.BEFORE_COPY).subscribe(this._copy.handleCopy) - ); - this._sub.add( - hooks.get(HookType.BEFORE_CUT).subscribe(this._copy.handleCopy) - ); - } - - disposeInternal() { - this._sub.unsubscribe(); - this._hooks = null; - } -} - -export { ClipboardPopulator }; diff --git a/libs/components/editor-core/src/editor/clipboard/clipboard.ts b/libs/components/editor-core/src/editor/clipboard/clipboard.ts new file mode 100644 index 0000000000..4891f7dffc --- /dev/null +++ b/libs/components/editor-core/src/editor/clipboard/clipboard.ts @@ -0,0 +1,47 @@ +import { ClipboardEventDispatcher } from './clipboardEventDispatcher'; +import { HookType } from '@toeverything/components/editor-core'; +import { Editor } from '../editor'; +import { Copy } from './copy'; +import { Paste } from './paste'; +import ClipboardParse from './clipboard-parse'; +import { MarkdownParser } from './markdown-parse'; + +export class Clipboard { + private _clipboardEventDispatcher: ClipboardEventDispatcher; + private _copy: Copy; + private _paste: Paste; + private _clipboardParse: ClipboardParse; + private _markdownParse: MarkdownParser; + + constructor(editor: Editor, clipboardTarget: HTMLElement) { + this._clipboardEventDispatcher = new ClipboardEventDispatcher( + editor, + clipboardTarget + ); + this._clipboardParse = new ClipboardParse(editor); + this._markdownParse = new MarkdownParser(); + this._copy = new Copy(editor); + + this._paste = new Paste( + editor, + this._clipboardParse, + this._markdownParse + ); + + editor + .getHooks() + .get(HookType.ON_COPY) + .subscribe(this._copy.handleCopy); + + editor.getHooks().get(HookType.ON_CUT).subscribe(this._copy.handleCopy); + + editor + .getHooks() + .get(HookType.ON_PASTE) + .subscribe(this._paste.handlePaste); + } + + public dispose() { + this._clipboardEventDispatcher.dispose(); + } +} diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts new file mode 100644 index 0000000000..d529e20a84 --- /dev/null +++ b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts @@ -0,0 +1,82 @@ +import { Editor } from '../editor'; +import { shouldHandlerContinue } from './utils'; + +enum ClipboardAction { + copy = 'copy', + cut = 'cut', + paste = 'paste', +} + +//TODO: need to consider the cursor position after inserting the children +export class ClipboardEventDispatcher { + private _editor: Editor; + private _clipboardTarget: HTMLElement; + + constructor(editor: Editor, clipboardTarget: HTMLElement) { + this._editor = editor; + this._clipboardTarget = clipboardTarget; + this._initialize(); + } + + private _initialize() { + this._copyHandler = this._copyHandler.bind(this); + this._cutHandler = this._cutHandler.bind(this); + this._pasteHandler = this._pasteHandler.bind(this); + + document.addEventListener(ClipboardAction.copy, this._copyHandler); + document.addEventListener(ClipboardAction.cut, this._cutHandler); + document.addEventListener(ClipboardAction.paste, this._pasteHandler); + this._clipboardTarget.addEventListener( + ClipboardAction.copy, + this._copyHandler + ); + this._clipboardTarget.addEventListener( + ClipboardAction.cut, + this._cutHandler + ); + this._clipboardTarget.addEventListener( + ClipboardAction.paste, + this._pasteHandler + ); + } + + private _copyHandler(e: ClipboardEvent) { + if (!shouldHandlerContinue(e, this._editor)) { + return; + } + this._editor.getHooks().onCopy(e); + } + + private _cutHandler(e: ClipboardEvent) { + if (!shouldHandlerContinue(e, this._editor)) { + return; + } + this._editor.getHooks().onCut(e); + } + private _pasteHandler(e: ClipboardEvent) { + if (!shouldHandlerContinue(e, this._editor)) { + return; + } + + this._editor.getHooks().onPaste(e); + } + + dispose() { + document.removeEventListener(ClipboardAction.copy, this._copyHandler); + document.removeEventListener(ClipboardAction.cut, this._cutHandler); + document.removeEventListener(ClipboardAction.paste, this._pasteHandler); + this._clipboardTarget.removeEventListener( + ClipboardAction.copy, + this._copyHandler + ); + this._clipboardTarget.removeEventListener( + ClipboardAction.cut, + this._cutHandler + ); + this._clipboardTarget.removeEventListener( + ClipboardAction.paste, + this._pasteHandler + ); + this._editor = null; + } +} diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts new file mode 100644 index 0000000000..1a31620fb6 --- /dev/null +++ b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts @@ -0,0 +1,121 @@ +import { Editor } from '../editor'; +import { + AsyncBlock, + SelectBlock, + SelectInfo, +} from '@toeverything/components/editor-core'; +import { ClipBlockInfo, OFFICE_CLIPBOARD_MIMETYPE } from './types'; +import { getClipInfoOfBlockById } from './utils'; +import { Clip } from './clip'; + +export class ClipboardUtils { + private _editor: Editor; + constructor(editor: Editor) { + this._editor = editor; + } + + async isBlockEditable(blockOrBlockId: AsyncBlock | string) { + const block = + typeof blockOrBlockId === 'string' + ? await this._editor.getBlockById(blockOrBlockId) + : blockOrBlockId; + const blockView = this._editor.getView(block.type); + + return blockView.activatable; + } + + async getClipInfoOfBlockById(blockId: string) { + const block = await this._editor.getBlockById(blockId); + const blockInfo: ClipBlockInfo = { + type: block.type, + properties: block?.getProperties(), + children: [] as ClipBlockInfo[], + }; + const children = (await block?.children()) ?? []; + + await Promise.all( + children.map(async childBlock => { + const childInfo = await this.getClipInfoOfBlockById( + childBlock.id + ); + blockInfo.children.push(childInfo); + }) + ); + + return blockInfo; + } + + async getClipDataOfBlocksById(blockIds: string[]) { + const clipInfos = await Promise.all( + blockIds.map(blockId => this.getClipInfoOfBlockById(blockId)) + ); + + return new Clip( + OFFICE_CLIPBOARD_MIMETYPE.DOCS_DOCUMENT_SLICE_CLIP_WRAPPED, + JSON.stringify({ + data: clipInfos, + }) + ); + } + + async getClipInfoOfBlockBySelectInfo(selectBlockInfo: SelectBlock) { + const block = await this._editor.getBlockById(selectBlockInfo.blockId); + const blockInfo: ClipBlockInfo = { + type: block?.type, + properties: + await this._editor.blockHelper.getBlockPropertiesBySelectInfo( + selectBlockInfo + ), + // Editable has no children + children: [], + }; + return blockInfo; + } + + async getClipDataOfBlocksBySelectInfo(selectInfo: SelectInfo) { + const clipInfos = await Promise.all( + selectInfo.blocks.map(selectBlockInfo => + this.getClipInfoOfBlockBySelectInfo(selectBlockInfo) + ) + ); + return new Clip( + OFFICE_CLIPBOARD_MIMETYPE.DOCS_DOCUMENT_SLICE_CLIP_WRAPPED, + JSON.stringify({ + data: clipInfos, + }) + ); + } + + async convertEditableBlockToHtml(block: AsyncBlock) { + const generate = (textList: any[]) => { + let content = ''; + textList.forEach(text_obj => { + let text = text_obj.text || ''; + if (text_obj.bold) { + text = `${text}`; + } + if (text_obj.italic) { + text = `${text}`; + } + if (text_obj.underline) { + text = `${text}`; + } + if (text_obj.inlinecode) { + text = `${text}`; + } + if (text_obj.strikethrough) { + text = `${text}`; + } + if (text_obj.type === 'link') { + text = `${generate( + text_obj.children + )}`; + } + content += text; + }); + return content; + }; + const text_list: any[] = block.getProperty('text').value; + return generate(text_list); + } +} diff --git a/libs/components/editor-core/src/editor/clipboard/copy.ts b/libs/components/editor-core/src/editor/clipboard/copy.ts index 94b3117264..8509af23fc 100644 --- a/libs/components/editor-core/src/editor/clipboard/copy.ts +++ b/libs/components/editor-core/src/editor/clipboard/copy.ts @@ -4,15 +4,15 @@ import { OFFICE_CLIPBOARD_MIMETYPE } from './types'; import { Clip } from './clip'; import ClipboardParse from './clipboard-parse'; import { getClipDataOfBlocksById } from './utils'; -import { copyToClipboard } from '@toeverything/utils'; +import { ClipboardUtils } from './clipboardUtils'; class Copy { private _editor: Editor; private _clipboardParse: ClipboardParse; - + private _utils: ClipboardUtils; constructor(editor: Editor) { this._editor = editor; this._clipboardParse = new ClipboardParse(editor); - + this._utils = new ClipboardUtils(editor); this.handleCopy = this.handleCopy.bind(this); } public async handleCopy(e: ClipboardEvent) { @@ -22,7 +22,6 @@ class Copy { if (!clips.length) { return; } - // TODO: is not compatible with safari const success = this._copyToClipboardFromPc(clips); if (!success) { // This way, not compatible with firefox @@ -49,7 +48,11 @@ class Copy { const affineClip = await this._getAffineClip(); clips.push(affineClip); - // get common html clip + const textClip = await this._getTextClip(); + clips.push(textClip); + + // const htmlClip = await this._getHtmlClip(); + // clips.push(htmlClip); const htmlClip = await this._clipboardParse.generateHtml(); htmlClip && clips.push(new Clip(OFFICE_CLIPBOARD_MIMETYPE.HTML, htmlClip)); @@ -57,16 +60,128 @@ class Copy { return clips; } + // private async _getHtmlClip(): Promise { + // const selectInfo: SelectInfo = + // await this._editor.selectionManager.getSelectInfo(); + // + // if (selectInfo.type === 'Range') { + // const html = ( + // await Promise.all( + // selectInfo.blocks.map(async selectBlockInfo => { + // const block = await this._editor.getBlockById( + // selectBlockInfo.blockId + // ); + // const blockView = this._editor.getView(block.type); + // const block2html = await blockView.block2html({ + // editor: this._editor, + // block, + // selectInfo: selectBlockInfo, + // }); + // + // if ( + // await this._editor.blockHelper.isBlockEditable( + // block + // ) + // ) { + // const selectedProperties = + // await this._editor.blockHelper.getEditableBlockPropertiesBySelectInfo( + // block, + // selectBlockInfo + // ); + // + // return ( + // block2html || + // this._editor.blockHelper.convertTextValue2Html( + // block.id, + // selectedProperties.text.value + // ) + // ); + // } + // + // return block2html; + // }) + // ) + // ).join(''); + // console.log('html', html); + // } + // + // return new Clip(OFFICE_CLIPBOARD_MIMETYPE.HTML, 'blockText'); + // } + private async _getAffineClip(): Promise { const selectInfo: SelectInfo = await this._editor.selectionManager.getSelectInfo(); - return getClipDataOfBlocksById( - this._editor, + if (selectInfo.type === 'Range') { + return this._utils.getClipDataOfBlocksBySelectInfo(selectInfo); + } + + // The only remaining case is that selectInfo.type === 'Block' + return this._utils.getClipDataOfBlocksById( selectInfo.blocks.map(block => block.blockId) ); } + private async _getTextClip(): Promise { + const selectInfo: SelectInfo = + await this._editor.selectionManager.getSelectInfo(); + + if (selectInfo.type === 'Range') { + const text = ( + await Promise.all( + selectInfo.blocks.map(async selectBlockInfo => { + const block = await this._editor.getBlockById( + selectBlockInfo.blockId + ); + const blockView = this._editor.getView(block.type); + const block2Text = await blockView.block2Text( + block, + selectBlockInfo + ); + + return ( + block2Text || + this._editor.blockHelper.getBlockTextBetweenSelection( + selectBlockInfo.blockId, + false + ) + ); + }) + ) + ).join('\n'); + return new Clip(OFFICE_CLIPBOARD_MIMETYPE.TEXT, text); + } + + // The only remaining case is that selectInfo.type === 'Block' + const selectedBlocks = ( + await Promise.all( + selectInfo.blocks.map(selectBlockInfo => + this._editor.blockHelper.getFlatBlocksUnderParent( + selectBlockInfo.blockId, + true + ) + ) + ) + ).flat(); + + const blockText = ( + await Promise.all( + selectedBlocks.map(async block => { + const blockView = this._editor.getView(block.type); + const block2Text = await blockView.block2Text(block); + return ( + block2Text || + this._editor.blockHelper.getBlockText(block.id) + ); + }) + ) + ).join('\n'); + + return new Clip(OFFICE_CLIPBOARD_MIMETYPE.TEXT, blockText); + } + + // TODO: Optimization + // TODO: is not compatible with safari private _copyToClipboardFromPc(clips: any[]) { let success = false; const tempElem = document.createElement('textarea'); diff --git a/libs/components/editor-core/src/editor/clipboard/index.ts b/libs/components/editor-core/src/editor/clipboard/index.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libs/components/editor-core/src/editor/clipboard/paste.ts b/libs/components/editor-core/src/editor/clipboard/paste.ts index 37168c2614..0d631991c2 100644 --- a/libs/components/editor-core/src/editor/clipboard/paste.ts +++ b/libs/components/editor-core/src/editor/clipboard/paste.ts @@ -42,13 +42,13 @@ export class Paste { OFFICE_CLIPBOARD_MIMETYPE.HTML, OFFICE_CLIPBOARD_MIMETYPE.TEXT, ]; - public handlePaste(e: Event) { + public handlePaste(e: ClipboardEvent) { if (!shouldHandlerContinue(e, this._editor)) { return; } e.stopPropagation(); - const clipboardData = (e as ClipboardEvent).clipboardData; + const clipboardData = e.clipboardData; const isPureFile = Paste._isPureFileInClipboard(clipboardData); if (isPureFile) { diff --git a/libs/components/editor-core/src/editor/clipboard/utils.ts b/libs/components/editor-core/src/editor/clipboard/utils.ts index c807a869a0..548e187814 100644 --- a/libs/components/editor-core/src/editor/clipboard/utils.ts +++ b/libs/components/editor-core/src/editor/clipboard/utils.ts @@ -2,7 +2,10 @@ import { Editor } from '../editor'; import { ClipBlockInfo, OFFICE_CLIPBOARD_MIMETYPE } from './types'; import { Clip } from './clip'; -export const shouldHandlerContinue = (event: Event, editor: Editor) => { +export const shouldHandlerContinue = ( + event: ClipboardEvent, + editor: Editor +) => { const filterNodes = ['INPUT', 'SELECT', 'TEXTAREA']; if (event.defaultPrevented) { @@ -20,10 +23,9 @@ export const getClipInfoOfBlockById = async ( blockId: string ) => { const block = await editor.getBlockById(blockId); - const blockView = editor.getView(block.type); const blockInfo: ClipBlockInfo = { type: block.type, - properties: blockView.getSelProperties(block, {}), + properties: block?.getProperties(), children: [] as ClipBlockInfo[], }; const children = (await block?.children()) ?? []; diff --git a/libs/components/editor-core/src/editor/editor.ts b/libs/components/editor-core/src/editor/editor.ts index e85db2ba65..931fd25da0 100644 --- a/libs/components/editor-core/src/editor/editor.ts +++ b/libs/components/editor-core/src/editor/editor.ts @@ -15,8 +15,7 @@ import assert from 'assert'; import type { WorkspaceAndBlockId } from './block'; import { AsyncBlock } from './block'; import { BlockHelper } from './block/block-helper'; -import { BrowserClipboard } from './clipboard/browser-clipboard'; -import { ClipboardPopulator } from './clipboard/clipboard-populator'; +import { Clipboard } from './clipboard/clipboard'; import { EditorCommands } from './commands'; import { EditorConfig } from './config'; import { DragDropManager } from './drag-drop'; @@ -65,8 +64,9 @@ export class Editor implements Virgo { readonly = false; private _rootBlockId: string; private storage_manager?: StorageManager; - private clipboard?: BrowserClipboard; - private clipboard_populator?: ClipboardPopulator; + private _clipboard: Clipboard; + // private clipboardActionDispacher?: ClipboardEventDispatcher; + // private clipboard_populator?: ClipboardPopulator; public reactRenderRoot: { render: PatchNode; has: (key: string) => boolean; @@ -138,7 +138,7 @@ export class Editor implements Virgo { public set container(v: HTMLDivElement) { this.ui_container = v; - this._initClipboard(); + this._clipboard = new Clipboard(this, this.ui_container); } public get container() { @@ -191,26 +191,26 @@ export class Editor implements Virgo { }; } - private _disposeClipboard() { - this.clipboard?.dispose(); - this.clipboard_populator?.disposeInternal(); - } + // private _disposeClipboard() { + // this.clipboard?.dispose(); + // this.clipboard_populator?.disposeInternal(); + // } - private _initClipboard() { - this._disposeClipboard(); - if (this.ui_container && !this._isDisposed) { - this.clipboard = new BrowserClipboard( - this.ui_container, - this.hooks, - this - ); - this.clipboard_populator = new ClipboardPopulator( - this, - this.hooks, - this.selectionManager - ); - } - } + // private _initClipboard() { + // this._disposeClipboard(); + // if (this.ui_container && !this._isDisposed) { + // this.clipboardActionDispacher = new ClipboardEventDispatcher({ + // clipboardTarget: this.ui_container, + // hooks: this.hooks, + // editor: this, + // }); + // this.clipboard_populator = new ClipboardPopulator( + // this, + // this.hooks, + // this.selectionManager + // ); + // } + // } /** Root Block Id */ getRootBlockId() { @@ -498,12 +498,13 @@ export class Editor implements Virgo { } public async page2html(): Promise { - const parse = this.clipboard?.getClipboardParse(); - if (!parse) { - return ''; - } - const html_str = await parse.page2html(); - return html_str; + return ''; + // const parse = this.clipboard?.getClipboardParse(); + // if (!parse) { + // return ''; + // } + // const html_str = await parse.page2html(); + // return html_str; } dispose() { @@ -519,6 +520,6 @@ export class Editor implements Virgo { this.plugin_manager.dispose(); this.selectionManager.dispose(); this.dragDropManager.dispose(); - this._disposeClipboard(); + this._clipboard?.dispose(); } } diff --git a/libs/components/editor-core/src/editor/index.ts b/libs/components/editor-core/src/editor/index.ts index 3131e6f0a1..08c479ba8f 100644 --- a/libs/components/editor-core/src/editor/index.ts +++ b/libs/components/editor-core/src/editor/index.ts @@ -8,6 +8,6 @@ export { Editor as BlockEditor } from './editor'; export * from './selection'; export { BlockDropPlacement, HookType, GroupDirection } from './types'; export type { Plugin, PluginCreator, PluginHooks, Virgo } from './types'; -export { BaseView, getTextHtml, getTextProperties } from './views/base-view'; +export { BaseView, getTextHtml } from './views/base-view'; export type { ChildrenView, CreateView } from './views/base-view'; export { getClipDataOfBlocksById } from './clipboard/utils'; diff --git a/libs/components/editor-core/src/editor/plugin/hooks.ts b/libs/components/editor-core/src/editor/plugin/hooks.ts index 42b9c262a0..747f0b42e2 100644 --- a/libs/components/editor-core/src/editor/plugin/hooks.ts +++ b/libs/components/editor-core/src/editor/plugin/hooks.ts @@ -116,12 +116,15 @@ export class Hooks implements HooksRunner, PluginHooks { this._runHook(HookType.ON_SEARCH); } - public beforeCopy(e: ClipboardEvent): void { - this._runHook(HookType.BEFORE_COPY, e); + public onCopy(e: ClipboardEvent): void { + this._runHook(HookType.ON_COPY, e); } - public beforeCut(e: ClipboardEvent): void { - this._runHook(HookType.BEFORE_CUT, e); + public onCut(e: ClipboardEvent): void { + this._runHook(HookType.ON_CUT, e); + } + public onPaste(e: ClipboardEvent): void { + this._runHook(HookType.ON_PASTE, e); } public onRootNodeScroll(e: React.UIEvent): void { diff --git a/libs/components/editor-core/src/editor/types.ts b/libs/components/editor-core/src/editor/types.ts index 1b97cf0f86..f2621164b6 100644 --- a/libs/components/editor-core/src/editor/types.ts +++ b/libs/components/editor-core/src/editor/types.ts @@ -174,8 +174,9 @@ export enum HookType { ON_ROOTNODE_DRAG_END = 'onRootNodeDragEnd', ON_ROOTNODE_DRAG_OVER_CAPTURE = 'onRootNodeDragOverCapture', ON_ROOTNODE_DROP = 'onRootNodeDrop', - BEFORE_COPY = 'beforeCopy', - BEFORE_CUT = 'beforeCut', + ON_COPY = 'onCopy', + ON_CUT = 'onCut', + ON_PASTE = 'onPaste', ON_ROOTNODE_SCROLL = 'onRootNodeScroll', } @@ -207,8 +208,9 @@ export interface HooksRunner { onRootNodeDragEnd: (e: React.DragEvent) => void; onRootNodeDragLeave: (e: React.DragEvent) => void; onRootNodeDrop: (e: React.DragEvent) => void; - beforeCopy: (e: ClipboardEvent) => void; - beforeCut: (e: ClipboardEvent) => void; + onCopy: (e: ClipboardEvent) => void; + onCut: (e: ClipboardEvent) => void; + onPaste: (e: ClipboardEvent) => void; onRootNodeScroll: (e: React.UIEvent) => void; } diff --git a/libs/components/editor-core/src/editor/views/base-view.ts b/libs/components/editor-core/src/editor/views/base-view.ts index b69cdd848a..f9db79fbc5 100644 --- a/libs/components/editor-core/src/editor/views/base-view.ts +++ b/libs/components/editor-core/src/editor/views/base-view.ts @@ -131,10 +131,6 @@ export abstract class BaseView { return result; } - getSelProperties(block: AsyncBlock, selectInfo: any): DefaultColumnsValue { - return cloneDeep(block.getProperties()); - } - html2block(el: Element, parseEl: (el: Element) => any[]): any[] | null { return null; } @@ -146,31 +142,24 @@ export abstract class BaseView { ): Promise { return ''; } -} + async block2Text( + block: AsyncBlock, + // The selectInfo parameter is not passed when the block is selected in ful, the selectInfo.type is Range + selectInfo?: SelectBlock + ): Promise { + return ''; + } -export const getTextProperties = ( - properties: DefaultColumnsValue, - selectInfo: any -) => { - let text_value = properties.text.value; - if (text_value.length === 0) { - return properties; - } - if (selectInfo.endInfo) { - text_value = text_value.slice(0, selectInfo.endInfo.arrayIndex + 1); - text_value[text_value.length - 1].text = text_value[ - text_value.length - 1 - ].text.substring(0, selectInfo.endInfo.offset); - } - if (selectInfo.startInfo) { - text_value = text_value.slice(selectInfo.startInfo.arrayIndex); - text_value[0].text = text_value[0].text.substring( - selectInfo.startInfo.offset - ); - } - properties.text.value = text_value; - return properties; -}; + // TODO: Try using new methods + // async block2html2(props: { + // editor: Editor; + // block: AsyncBlock; + // // The selectInfo parameter is not passed when the block is selected in ful, the selectInfo.type is Range + // selectInfo?: SelectBlock; + // }) { + // return ''; + // } +} export const getTextHtml = (block: AsyncBlock) => { const generate = (textList: any[]) => { From 065f833564f25aecf547f4c967e6e1f07386f087 Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Mon, 22 Aug 2022 10:29:42 +0800 Subject: [PATCH 07/79] refactor: remove clipboard utils to ClipboardUtils --- .../src/editor/clipboard/clipboard.ts | 12 ++-- .../clipboard/clipboardEventDispatcher.ts | 10 ++-- .../src/editor/clipboard/clipboardUtils.ts | 59 ++++--------------- .../editor-core/src/editor/clipboard/copy.ts | 1 - .../editor-core/src/editor/clipboard/index.ts | 0 .../editor-core/src/editor/clipboard/paste.ts | 5 -- .../editor-core/src/editor/clipboard/utils.ts | 54 ----------------- .../editor-core/src/editor/editor.ts | 4 ++ .../editor-core/src/editor/index.ts | 1 - 9 files changed, 30 insertions(+), 116 deletions(-) delete mode 100644 libs/components/editor-core/src/editor/clipboard/index.ts delete mode 100644 libs/components/editor-core/src/editor/clipboard/utils.ts diff --git a/libs/components/editor-core/src/editor/clipboard/clipboard.ts b/libs/components/editor-core/src/editor/clipboard/clipboard.ts index 4891f7dffc..4cee691a08 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboard.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboard.ts @@ -5,6 +5,7 @@ import { Copy } from './copy'; import { Paste } from './paste'; import ClipboardParse from './clipboard-parse'; import { MarkdownParser } from './markdown-parse'; +import { ClipboardUtils } from './clipboardUtils'; export class Clipboard { private _clipboardEventDispatcher: ClipboardEventDispatcher; @@ -12,14 +13,12 @@ export class Clipboard { private _paste: Paste; private _clipboardParse: ClipboardParse; private _markdownParse: MarkdownParser; + public clipboardUtils: ClipboardUtils; constructor(editor: Editor, clipboardTarget: HTMLElement) { - this._clipboardEventDispatcher = new ClipboardEventDispatcher( - editor, - clipboardTarget - ); this._clipboardParse = new ClipboardParse(editor); this._markdownParse = new MarkdownParser(); + this.clipboardUtils = new ClipboardUtils(editor); this._copy = new Copy(editor); this._paste = new Paste( @@ -28,6 +27,11 @@ export class Clipboard { this._markdownParse ); + this._clipboardEventDispatcher = new ClipboardEventDispatcher( + editor, + clipboardTarget + ); + editor .getHooks() .get(HookType.ON_COPY) diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts index d529e20a84..b3fd8305db 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts @@ -1,5 +1,5 @@ import { Editor } from '../editor'; -import { shouldHandlerContinue } from './utils'; +import { ClipboardUtils } from './clipboardUtils'; enum ClipboardAction { copy = 'copy', @@ -11,10 +11,12 @@ enum ClipboardAction { export class ClipboardEventDispatcher { private _editor: Editor; private _clipboardTarget: HTMLElement; + private _utils: ClipboardUtils; constructor(editor: Editor, clipboardTarget: HTMLElement) { this._editor = editor; this._clipboardTarget = clipboardTarget; + this._utils = new ClipboardUtils(editor); this._initialize(); } @@ -41,20 +43,20 @@ export class ClipboardEventDispatcher { } private _copyHandler(e: ClipboardEvent) { - if (!shouldHandlerContinue(e, this._editor)) { + if (!this._utils.shouldHandlerContinue(e)) { return; } this._editor.getHooks().onCopy(e); } private _cutHandler(e: ClipboardEvent) { - if (!shouldHandlerContinue(e, this._editor)) { + if (!this._utils.shouldHandlerContinue(e)) { return; } this._editor.getHooks().onCut(e); } private _pasteHandler(e: ClipboardEvent) { - if (!shouldHandlerContinue(e, this._editor)) { + if (!this._utils.shouldHandlerContinue(e)) { return; } diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts index 1a31620fb6..d50b2fbdae 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts @@ -1,11 +1,6 @@ import { Editor } from '../editor'; -import { - AsyncBlock, - SelectBlock, - SelectInfo, -} from '@toeverything/components/editor-core'; +import { SelectBlock, SelectInfo } from '@toeverything/components/editor-core'; import { ClipBlockInfo, OFFICE_CLIPBOARD_MIMETYPE } from './types'; -import { getClipInfoOfBlockById } from './utils'; import { Clip } from './clip'; export class ClipboardUtils { @@ -14,15 +9,18 @@ export class ClipboardUtils { this._editor = editor; } - async isBlockEditable(blockOrBlockId: AsyncBlock | string) { - const block = - typeof blockOrBlockId === 'string' - ? await this._editor.getBlockById(blockOrBlockId) - : blockOrBlockId; - const blockView = this._editor.getView(block.type); + shouldHandlerContinue = (event: ClipboardEvent) => { + const filterNodes = ['INPUT', 'SELECT', 'TEXTAREA']; - return blockView.activatable; - } + if (event.defaultPrevented) { + return false; + } + if (filterNodes.includes((event.target as HTMLElement)?.tagName)) { + return false; + } + + return this._editor.selectionManager.currentSelectInfo.type !== 'None'; + }; async getClipInfoOfBlockById(blockId: string) { const block = await this._editor.getBlockById(blockId); @@ -85,37 +83,4 @@ export class ClipboardUtils { }) ); } - - async convertEditableBlockToHtml(block: AsyncBlock) { - const generate = (textList: any[]) => { - let content = ''; - textList.forEach(text_obj => { - let text = text_obj.text || ''; - if (text_obj.bold) { - text = `${text}`; - } - if (text_obj.italic) { - text = `${text}`; - } - if (text_obj.underline) { - text = `${text}`; - } - if (text_obj.inlinecode) { - text = `${text}`; - } - if (text_obj.strikethrough) { - text = `${text}`; - } - if (text_obj.type === 'link') { - text = `${generate( - text_obj.children - )}`; - } - content += text; - }); - return content; - }; - const text_list: any[] = block.getProperty('text').value; - return generate(text_list); - } } diff --git a/libs/components/editor-core/src/editor/clipboard/copy.ts b/libs/components/editor-core/src/editor/clipboard/copy.ts index 8509af23fc..3056091cd3 100644 --- a/libs/components/editor-core/src/editor/clipboard/copy.ts +++ b/libs/components/editor-core/src/editor/clipboard/copy.ts @@ -3,7 +3,6 @@ import { SelectInfo } from '../selection'; import { OFFICE_CLIPBOARD_MIMETYPE } from './types'; import { Clip } from './clip'; import ClipboardParse from './clipboard-parse'; -import { getClipDataOfBlocksById } from './utils'; import { ClipboardUtils } from './clipboardUtils'; class Copy { private _editor: Editor; diff --git a/libs/components/editor-core/src/editor/clipboard/index.ts b/libs/components/editor-core/src/editor/clipboard/index.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libs/components/editor-core/src/editor/clipboard/paste.ts b/libs/components/editor-core/src/editor/clipboard/paste.ts index 0d631991c2..10643decbd 100644 --- a/libs/components/editor-core/src/editor/clipboard/paste.ts +++ b/libs/components/editor-core/src/editor/clipboard/paste.ts @@ -14,7 +14,6 @@ import { services, } from '@toeverything/datasource/db-service'; import { MarkdownParser } from './markdown-parse'; -import { shouldHandlerContinue } from './utils'; const SUPPORT_MARKDOWN_PASTE = true; type TextValueItem = { @@ -26,7 +25,6 @@ export class Paste { private _editor: Editor; private _markdownParse: MarkdownParser; private _clipboardParse: ClipboardParse; - constructor( editor: Editor, clipboardParse: ClipboardParse, @@ -43,9 +41,6 @@ export class Paste { OFFICE_CLIPBOARD_MIMETYPE.TEXT, ]; public handlePaste(e: ClipboardEvent) { - if (!shouldHandlerContinue(e, this._editor)) { - return; - } e.stopPropagation(); const clipboardData = e.clipboardData; diff --git a/libs/components/editor-core/src/editor/clipboard/utils.ts b/libs/components/editor-core/src/editor/clipboard/utils.ts deleted file mode 100644 index 548e187814..0000000000 --- a/libs/components/editor-core/src/editor/clipboard/utils.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Editor } from '../editor'; -import { ClipBlockInfo, OFFICE_CLIPBOARD_MIMETYPE } from './types'; -import { Clip } from './clip'; - -export const shouldHandlerContinue = ( - event: ClipboardEvent, - editor: Editor -) => { - const filterNodes = ['INPUT', 'SELECT', 'TEXTAREA']; - - if (event.defaultPrevented) { - return false; - } - if (filterNodes.includes((event.target as HTMLElement)?.tagName)) { - return false; - } - - return editor.selectionManager.currentSelectInfo.type !== 'None'; -}; - -export const getClipInfoOfBlockById = async ( - editor: Editor, - blockId: string -) => { - const block = await editor.getBlockById(blockId); - const blockInfo: ClipBlockInfo = { - type: block.type, - properties: block?.getProperties(), - children: [] as ClipBlockInfo[], - }; - const children = (await block?.children()) ?? []; - - for (let i = 0; i < children.length; i++) { - const childInfo = await getClipInfoOfBlockById(editor, children[i].id); - blockInfo.children.push(childInfo); - } - return blockInfo; -}; - -export const getClipDataOfBlocksById = async ( - editor: Editor, - blockIds: string[] -) => { - const clipInfos = await Promise.all( - blockIds.map(blockId => getClipInfoOfBlockById(editor, blockId)) - ); - - return new Clip( - OFFICE_CLIPBOARD_MIMETYPE.DOCS_DOCUMENT_SLICE_CLIP_WRAPPED, - JSON.stringify({ - data: clipInfos, - }) - ); -}; diff --git a/libs/components/editor-core/src/editor/editor.ts b/libs/components/editor-core/src/editor/editor.ts index 931fd25da0..9253ab2cbe 100644 --- a/libs/components/editor-core/src/editor/editor.ts +++ b/libs/components/editor-core/src/editor/editor.ts @@ -145,6 +145,10 @@ export class Editor implements Virgo { return this.ui_container; } + public get clipboard() { + return this._clipboard; + } + /** * Use it discreetly. * Preference to use {@link withBatch} diff --git a/libs/components/editor-core/src/editor/index.ts b/libs/components/editor-core/src/editor/index.ts index 08c479ba8f..d03326f386 100644 --- a/libs/components/editor-core/src/editor/index.ts +++ b/libs/components/editor-core/src/editor/index.ts @@ -10,4 +10,3 @@ export { BlockDropPlacement, HookType, GroupDirection } from './types'; export type { Plugin, PluginCreator, PluginHooks, Virgo } from './types'; export { BaseView, getTextHtml } from './views/base-view'; export type { ChildrenView, CreateView } from './views/base-view'; -export { getClipDataOfBlocksById } from './clipboard/utils'; From e61b3ce4e40e3e4266783165c26512eb81fba521 Mon Sep 17 00:00:00 2001 From: zuomeng wang Date: Mon, 22 Aug 2022 15:02:33 +0800 Subject: [PATCH 08/79] feat: add get-started template (#309) --- .../src/services/editor-block/templates/template-factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts b/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts index 6c8d5a5643..4cdf62676d 100644 --- a/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts +++ b/libs/datasource/db-service/src/services/editor-block/templates/template-factory.ts @@ -29,7 +29,7 @@ const groupTemplateMap = { const defaultTemplateList: Array = [ { name: 'New From Quick Start', - groupKeys: ['todolist'], + groupKeys: ['getStartedGroup0', 'getStartedGroup1', 'getStartedGroup2'], }, { name: 'New From Grid System', groupKeys: ['grid'] }, { name: 'New From Blog', groupKeys: ['blog'] }, From 4b904ef76204655e6253deabfab22d47d98feec4 Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Mon, 22 Aug 2022 22:03:11 +0800 Subject: [PATCH 09/79] refactor: refactor block2html in clipboard --- libs/components/affine-board/src/Board.tsx | 13 ++- .../common/src/lib/text/slate-utils.ts | 2 +- .../editor-blocks/src/blocks/bullet/index.ts | 30 ++----- .../editor-blocks/src/blocks/code/index.ts | 28 ++----- .../editor-blocks/src/blocks/divider/index.ts | 10 +-- .../src/blocks/embed-link/index.ts | 12 +-- .../editor-blocks/src/blocks/figma/index.ts | 12 +-- .../editor-blocks/src/blocks/file/index.ts | 23 +++--- .../editor-blocks/src/blocks/group/Group.tsx | 19 +++-- .../src/blocks/groupDvider/index.ts | 10 +-- .../editor-blocks/src/blocks/image/index.ts | 26 +++--- .../src/blocks/numbered/index.ts | 29 ++----- .../editor-blocks/src/blocks/page/index.ts | 37 ++++----- .../src/blocks/text/QuoteBlock.tsx | 33 +++----- .../src/blocks/text/TextBlock.tsx | 51 +++--------- .../editor-blocks/src/blocks/todo/index.ts | 28 ++----- .../editor-blocks/src/blocks/youtube/index.ts | 12 +-- .../src/utils/commonBlockClip.ts | 30 +++++++ .../src/editor/block/block-helper.ts | 6 +- .../src/editor/clipboard/clipboard-parse.ts | 75 +---------------- .../src/editor/clipboard/clipboardUtils.ts | 78 +++++++++++++++++- .../editor-core/src/editor/clipboard/copy.ts | 80 +++++++------------ .../editor-core/src/editor/editor.ts | 8 +- .../editor-core/src/editor/index.ts | 2 +- .../editor-core/src/editor/views/base-view.ts | 56 ++----------- .../layout/src/header/PageSettingPortal.tsx | 8 +- .../Settings/util/handle-export.ts | 16 ++-- 27 files changed, 284 insertions(+), 450 deletions(-) create mode 100644 libs/components/editor-blocks/src/utils/commonBlockClip.ts diff --git a/libs/components/affine-board/src/Board.tsx b/libs/components/affine-board/src/Board.tsx index 4e99d6bbb0..5730649545 100644 --- a/libs/components/affine-board/src/Board.tsx +++ b/libs/components/affine-board/src/Board.tsx @@ -5,10 +5,7 @@ import { getSession } from '@toeverything/components/board-sessions'; import { deepCopy, TldrawApp } from '@toeverything/components/board-state'; import { tools } from '@toeverything/components/board-tools'; import { TDShapeType } from '@toeverything/components/board-types'; -import { - RecastBlockProvider, - getClipDataOfBlocksById, -} from '@toeverything/components/editor-core'; +import { RecastBlockProvider } from '@toeverything/components/editor-core'; import { services } from '@toeverything/datasource/db-service'; import { AsyncBlock, BlockEditor } from '@toeverything/framework/virgo'; import { useEffect, useState } from 'react'; @@ -70,10 +67,10 @@ const AffineBoard = ({ set_app(app); }, async onCopy(e, groupIds) { - const clip = await getClipDataOfBlocksById( - editor, - groupIds - ); + const clip = + await editor.clipboard.clipboardUtils.getClipDataOfBlocksById( + groupIds + ); e.clipboardData?.setData( clip.getMimeType(), diff --git a/libs/components/common/src/lib/text/slate-utils.ts b/libs/components/common/src/lib/text/slate-utils.ts index fb183a7c35..160f1a416b 100644 --- a/libs/components/common/src/lib/text/slate-utils.ts +++ b/libs/components/common/src/lib/text/slate-utils.ts @@ -993,7 +993,7 @@ class SlateUtils { textValue.children )}`; } - return `${text}>`; + return `${text}`; } public getStartSelection() { diff --git a/libs/components/editor-blocks/src/blocks/bullet/index.ts b/libs/components/editor-blocks/src/blocks/bullet/index.ts index 58360954ce..1577263af3 100644 --- a/libs/components/editor-blocks/src/blocks/bullet/index.ts +++ b/libs/components/editor-blocks/src/blocks/bullet/index.ts @@ -1,18 +1,10 @@ -import { - AsyncBlock, - BaseView, - CreateView, - SelectBlock, - getTextHtml, -} from '@toeverything/framework/virgo'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; -// import { withTreeViewChildren } from '../../utils/with-tree-view-children'; +import { AsyncBlock, BaseView } from '@toeverything/framework/virgo'; +import { Protocol } from '@toeverything/datasource/db-service'; import { defaultBulletProps, BulletView } from './BulletView'; -import { IndentWrapper } from '../../components/IndentWrapper'; - +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class BulletBlock extends BaseView { public type = Protocol.Block.Type.bullet; @@ -71,13 +63,7 @@ export class BulletBlock extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `
  • ${content}
`; + override async block2html(props: Block2HtmlProps) { + return `
  • ${await commonBlock2HtmlContent(props)}
`; } } diff --git a/libs/components/editor-blocks/src/blocks/code/index.ts b/libs/components/editor-blocks/src/blocks/code/index.ts index 1fc84f1df8..a204779656 100644 --- a/libs/components/editor-blocks/src/blocks/code/index.ts +++ b/libs/components/editor-blocks/src/blocks/code/index.ts @@ -1,16 +1,10 @@ -import { - BaseView, - AsyncBlock, - CreateView, - SelectBlock, - getTextHtml, -} from '@toeverything/framework/virgo'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; +import { BaseView, AsyncBlock } from '@toeverything/framework/virgo'; +import { Protocol } from '@toeverything/datasource/db-service'; import { CodeView } from './CodeView'; -import { ComponentType } from 'react'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class CodeBlock extends BaseView { type = Protocol.Block.Type.code; @@ -62,13 +56,7 @@ export class CodeBlock extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `${content}`; + override async block2html(props: Block2HtmlProps) { + return `${await commonBlock2HtmlContent(props)}`; } } diff --git a/libs/components/editor-blocks/src/blocks/divider/index.ts b/libs/components/editor-blocks/src/blocks/divider/index.ts index 6d67611cda..eb4615963c 100644 --- a/libs/components/editor-blocks/src/blocks/divider/index.ts +++ b/libs/components/editor-blocks/src/blocks/divider/index.ts @@ -5,6 +5,7 @@ import { } from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { DividerView } from './divider-view'; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class DividerBlock extends BaseView { type = Protocol.Block.Type.divider; @@ -28,12 +29,7 @@ export class DividerBlock extends BaseView { return null; } - - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - return `
`; + override async block2html(props: Block2HtmlProps) { + return `
`; } } diff --git a/libs/components/editor-blocks/src/blocks/embed-link/index.ts b/libs/components/editor-blocks/src/blocks/embed-link/index.ts index 731ae801d6..7674c71c3e 100644 --- a/libs/components/editor-blocks/src/blocks/embed-link/index.ts +++ b/libs/components/editor-blocks/src/blocks/embed-link/index.ts @@ -5,6 +5,7 @@ import { } from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { EmbedLinkView } from './EmbedLinkView'; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class EmbedLinkBlock extends BaseView { public override selectable = true; @@ -35,13 +36,8 @@ export class EmbedLinkBlock extends BaseView { return null; } - - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - const figma_url = block.getProperty('embedLink')?.value; - return `

${figma_url}

`; + override async block2html({ block }: Block2HtmlProps) { + const url = block.getProperty('embedLink')?.value; + return `

${url}

`; } } diff --git a/libs/components/editor-blocks/src/blocks/figma/index.ts b/libs/components/editor-blocks/src/blocks/figma/index.ts index 3ed44c9c85..652abfbc1d 100644 --- a/libs/components/editor-blocks/src/blocks/figma/index.ts +++ b/libs/components/editor-blocks/src/blocks/figma/index.ts @@ -5,6 +5,7 @@ import { SelectBlock, } from '@toeverything/framework/virgo'; import { FigmaView } from './FigmaView'; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class FigmaBlock extends BaseView { public override selectable = true; @@ -41,13 +42,8 @@ export class FigmaBlock extends BaseView { return null; } - - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - const figma_url = block.getProperty('embedLink')?.value; - return `

${figma_url}

`; + override async block2html({ block }: Block2HtmlProps) { + const figmaUrl = block.getProperty('embedLink')?.value; + return `

${figmaUrl}

`; } } diff --git a/libs/components/editor-blocks/src/blocks/file/index.ts b/libs/components/editor-blocks/src/blocks/file/index.ts index e55eed7721..42c2bee1f6 100644 --- a/libs/components/editor-blocks/src/blocks/file/index.ts +++ b/libs/components/editor-blocks/src/blocks/file/index.ts @@ -9,25 +9,22 @@ import { services, } from '@toeverything/datasource/db-service'; import { FileView } from './FileView'; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class FileBlock extends BaseView { public override selectable = true; public override activatable = false; type = Protocol.Block.Type.file; View = FileView; + override async block2html({ block }: Block2HtmlProps) { + const fileProperty = block.getProperty('file'); + const fileId = fileProperty?.value; + const fileInfo = fileId + ? await services.api.file.get(fileId, block.workspace) + : null; - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - const file_property = - block.getProperty('file') || ({} as FileColumnValue); - const file_id = file_property.value; - let file_info = null; - if (file_id) { - file_info = await services.api.file.get(file_id, block.workspace); - } - return `

${file_property?.name}

`; + return fileInfo + ? `

${fileProperty?.name}

` + : ''; } } diff --git a/libs/components/editor-blocks/src/blocks/group/Group.tsx b/libs/components/editor-blocks/src/blocks/group/Group.tsx index ac194d7eab..b5fdcac58c 100644 --- a/libs/components/editor-blocks/src/blocks/group/Group.tsx +++ b/libs/components/editor-blocks/src/blocks/group/Group.tsx @@ -6,6 +6,10 @@ import { SelectBlock, } from '@toeverything/framework/virgo'; import { GroupView } from './GroupView'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class Group extends BaseView { public override selectable = true; @@ -25,13 +29,12 @@ export class Group extends BaseView { override async onCreate(block: AsyncBlock): Promise { return block; } - - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - const content = await generateHtml(children); - return `
${content}
`; + override async block2html({ editor, selectInfo, block }: Block2HtmlProps) { + const childrenHtml = + await editor.clipboard.clipboardUtils.convertBlock2HtmlBySelectInfos( + block, + selectInfo?.children + ); + return `
${childrenHtml}`; } } diff --git a/libs/components/editor-blocks/src/blocks/groupDvider/index.ts b/libs/components/editor-blocks/src/blocks/groupDvider/index.ts index 4120f1a525..52940173e6 100644 --- a/libs/components/editor-blocks/src/blocks/groupDvider/index.ts +++ b/libs/components/editor-blocks/src/blocks/groupDvider/index.ts @@ -5,6 +5,7 @@ import { } from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { GroupDividerView } from './groupDividerView'; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class GroupDividerBlock extends BaseView { type = Protocol.Block.Type.groupDivider; @@ -28,12 +29,7 @@ export class GroupDividerBlock extends BaseView { return null; } - - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - return `
`; + override async block2html(props: Block2HtmlProps) { + return `
`; } } diff --git a/libs/components/editor-blocks/src/blocks/image/index.ts b/libs/components/editor-blocks/src/blocks/image/index.ts index 8f56468b41..190f83d72a 100644 --- a/libs/components/editor-blocks/src/blocks/image/index.ts +++ b/libs/components/editor-blocks/src/blocks/image/index.ts @@ -1,10 +1,7 @@ -import { - AsyncBlock, - BaseView, - SelectBlock, -} from '@toeverything/framework/virgo'; +import { BaseView } from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { ImageView } from './ImageView'; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class ImageBlock extends BaseView { public override selectable = true; @@ -37,18 +34,13 @@ export class ImageBlock extends BaseView { return null; } - // TODO: - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - const text = block.getProperty('text'); + override async block2html({ block, editor }: Block2HtmlProps) { + const textValue = block.getProperty('text'); const content = ''; - if (text) { - text.value.map(text => `${text}`).join(''); - } - // TODO: child - return `

`; + // TODO: text.value should export with style?? + const figcaption = (textValue?.value ?? []) + .map(({ text }) => `${text}`) + .join(''); + return `
${figcaption}
${figcaption}
`; } } diff --git a/libs/components/editor-blocks/src/blocks/numbered/index.ts b/libs/components/editor-blocks/src/blocks/numbered/index.ts index 37295e026f..d6eb9c1839 100644 --- a/libs/components/editor-blocks/src/blocks/numbered/index.ts +++ b/libs/components/editor-blocks/src/blocks/numbered/index.ts @@ -1,16 +1,10 @@ -import { - AsyncBlock, - BaseView, - SelectBlock, - getTextHtml, -} from '@toeverything/framework/virgo'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; -// import { withTreeViewChildren } from '../../utils/with-tree-view-children'; +import { AsyncBlock, BaseView } from '@toeverything/framework/virgo'; +import { Protocol } from '@toeverything/datasource/db-service'; import { defaultTodoProps, NumberedView } from './NumberedView'; -import { IndentWrapper } from '../../components/IndentWrapper'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class NumberedBlock extends BaseView { public type = Protocol.Block.Type.numbered; @@ -77,14 +71,7 @@ export class NumberedBlock extends BaseView { return null; } - - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `
  1. ${content}
`; + override async block2html(props: Block2HtmlProps) { + return `
  1. ${await commonBlock2HtmlContent(props)}
`; } } diff --git a/libs/components/editor-blocks/src/blocks/page/index.ts b/libs/components/editor-blocks/src/blocks/page/index.ts index 06151bc481..4209cbbdb6 100644 --- a/libs/components/editor-blocks/src/blocks/page/index.ts +++ b/libs/components/editor-blocks/src/blocks/page/index.ts @@ -1,20 +1,9 @@ import { withRecastBlock } from '@toeverything/components/editor-core'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; -import { - AsyncBlock, - BaseView, - ChildrenView, - getTextHtml, - SelectBlock, -} from '@toeverything/framework/virgo'; +import { Protocol } from '@toeverything/datasource/db-service'; +import { AsyncBlock, BaseView } from '@toeverything/framework/virgo'; import { PageView } from './PageView'; - -export const PageChildrenView: (prop: ChildrenView) => JSX.Element = props => - props.children; +import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class PageBlock extends BaseView { type = Protocol.Block.Type.page; @@ -34,13 +23,17 @@ export class PageBlock extends BaseView { return this.get_decoration(content, 'text')?.value?.[0].text; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - const content = getTextHtml(block); - const childrenContent = await generateHtml(children); - return `

${content}

${childrenContent}`; + override async block2html({ block, editor, selectInfo }: Block2HtmlProps) { + const header = + await editor.clipboard.clipboardUtils.convertTextValue2HtmlBySelectInfo( + block, + selectInfo + ); + const childrenHtml = + await editor.clipboard.clipboardUtils.convertBlock2HtmlBySelectInfos( + block, + selectInfo?.children + ); + return `

${header}

${childrenHtml}`; } } diff --git a/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx b/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx index 94938aa595..c3613f585d 100644 --- a/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx +++ b/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx @@ -1,14 +1,13 @@ -import { - DefaultColumnsValue, - Protocol, -} from '@toeverything/datasource/db-service'; +import { Protocol } from '@toeverything/datasource/db-service'; import { AsyncBlock, BaseView, CreateView, - getTextHtml, - SelectBlock, } from '@toeverything/framework/virgo'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; import { TextView } from './TextView'; @@ -60,14 +59,10 @@ export class QuoteBlock extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `
${content}
`; + override async block2html(props: Block2HtmlProps) { + return `
${await commonBlock2HtmlContent( + props + )}
`; } } @@ -135,13 +130,7 @@ export class CalloutBlock extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return ``; + override async block2html(props: Block2HtmlProps) { + return ``; } } diff --git a/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx b/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx index 74085db922..7161d0ec9e 100644 --- a/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx +++ b/libs/components/editor-blocks/src/blocks/text/TextBlock.tsx @@ -2,16 +2,15 @@ import { BaseView, CreateView, AsyncBlock, - SelectBlock, - getTextHtml, } from '@toeverything/framework/virgo'; -import { - DefaultColumnsValue, - Protocol, -} from '@toeverything/datasource/db-service'; +import { Protocol } from '@toeverything/datasource/db-service'; import { TextView } from './TextView'; import { getRandomString } from '@toeverything/components/common'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class TextBlock extends BaseView { type = Protocol.Block.Type.text; @@ -111,14 +110,8 @@ export class TextBlock extends BaseView { : null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `

${content}

`; + override async block2html(props: Block2HtmlProps) { + return `

${await commonBlock2HtmlContent(props)}

`; } } @@ -168,14 +161,8 @@ export class Heading1Block extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `

${content}

`; + override async block2html(props: Block2HtmlProps) { + return `

${await commonBlock2HtmlContent(props)}

`; } } @@ -225,14 +212,8 @@ export class Heading2Block extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `

${content}

`; + override async block2html(props: Block2HtmlProps) { + return `

${await commonBlock2HtmlContent(props)}

`; } } @@ -282,13 +263,7 @@ export class Heading3Block extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `

${content}

`; + override async block2html(props: Block2HtmlProps) { + return `

${await commonBlock2HtmlContent(props)}

`; } } diff --git a/libs/components/editor-blocks/src/blocks/todo/index.ts b/libs/components/editor-blocks/src/blocks/todo/index.ts index db4187a890..9ea9bbccad 100644 --- a/libs/components/editor-blocks/src/blocks/todo/index.ts +++ b/libs/components/editor-blocks/src/blocks/todo/index.ts @@ -1,18 +1,12 @@ -import { - BaseView, - AsyncBlock, - SelectBlock, - getTextHtml, -} from '@toeverything/framework/virgo'; -// import type { CreateView } from '@toeverything/framework/virgo'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; -// import { withTreeViewChildren } from '../../utils/with-tree-view-children'; +import { BaseView } from '@toeverything/framework/virgo'; +import { Protocol } from '@toeverything/datasource/db-service'; import { withTreeViewChildren } from '../../utils/WithTreeViewChildren'; import { TodoView, defaultTodoProps } from './TodoView'; import type { TodoAsyncBlock } from './types'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class TodoBlock extends BaseView { type = Protocol.Block.Type.todo; @@ -78,13 +72,7 @@ export class TodoBlock extends BaseView { return null; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - let content = getTextHtml(block); - content += await generateHtml(children); - return `
  • [ ] ${content}
`; + override async block2html(props: Block2HtmlProps) { + return `
  • [ ] ${await commonBlock2HtmlContent(props)}
`; } } diff --git a/libs/components/editor-blocks/src/blocks/youtube/index.ts b/libs/components/editor-blocks/src/blocks/youtube/index.ts index 94ad3ac59d..f1f6e1faa3 100644 --- a/libs/components/editor-blocks/src/blocks/youtube/index.ts +++ b/libs/components/editor-blocks/src/blocks/youtube/index.ts @@ -5,6 +5,10 @@ import { SelectBlock, } from '@toeverything/framework/virgo'; import { YoutubeView } from './YoutubeView'; +import { + Block2HtmlProps, + commonBlock2HtmlContent, +} from '../../utils/commonBlockClip'; export class YoutubeBlock extends BaseView { public override selectable = true; @@ -44,12 +48,8 @@ export class YoutubeBlock extends BaseView { override async block2Text(block: AsyncBlock, selectInfo: SelectBlock) { return block.getProperty('embedLink')?.value ?? ''; } - override async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { + override async block2html({ block }: Block2HtmlProps) { const url = block.getProperty('embedLink')?.value; - return `

${url}

`; + return `

${url}

`; } } diff --git a/libs/components/editor-blocks/src/utils/commonBlockClip.ts b/libs/components/editor-blocks/src/utils/commonBlockClip.ts new file mode 100644 index 0000000000..b381f465de --- /dev/null +++ b/libs/components/editor-blocks/src/utils/commonBlockClip.ts @@ -0,0 +1,30 @@ +import { + AsyncBlock, + BlockEditor, + SelectBlock, +} from '@toeverything/components/editor-core'; + +export type Block2HtmlProps = { + editor: BlockEditor; + block: AsyncBlock; + // The selectInfo parameter is not passed when the block is selected in ful, the selectInfo.type is Range + selectInfo?: SelectBlock; +}; + +export const commonBlock2HtmlContent = async ({ + editor, + block, + selectInfo, +}: Block2HtmlProps) => { + const html = + await editor.clipboard.clipboardUtils.convertTextValue2HtmlBySelectInfo( + block, + selectInfo + ); + const childrenHtml = + await editor.clipboard.clipboardUtils.convertBlock2HtmlBySelectInfos( + block, + selectInfo?.children + ); + return `${html}${childrenHtml}`; +}; diff --git a/libs/components/editor-core/src/editor/block/block-helper.ts b/libs/components/editor-core/src/editor/block/block-helper.ts index 70238c4be5..947e7eafe6 100644 --- a/libs/components/editor-core/src/editor/block/block-helper.ts +++ b/libs/components/editor-core/src/editor/block/block-helper.ts @@ -153,7 +153,7 @@ export class BlockHelper { public async getEditableBlockPropertiesBySelectInfo( block: AsyncBlock, - selectInfo: SelectBlock + selectInfo?: SelectBlock ) { const properties = block.getProperties(); if (properties.text.value.length === 0) { @@ -169,13 +169,13 @@ export class BlockHelper { // Use deepClone method will throw incomprehensible error let textValue = JSON.parse(JSON.stringify(originTextValue)); - if (selectInfo.endInfo) { + if (selectInfo?.endInfo) { textValue = textValue.slice(0, selectInfo.endInfo.arrayIndex + 1); textValue[textValue.length - 1].text = text_value[ textValue.length - 1 ].text.substring(0, selectInfo.endInfo.offset); } - if (selectInfo.startInfo) { + if (selectInfo?.startInfo) { textValue = textValue.slice(selectInfo.startInfo.arrayIndex); textValue[0].text = textValue[0].text.substring( selectInfo.startInfo.offset diff --git a/libs/components/editor-core/src/editor/clipboard/clipboard-parse.ts b/libs/components/editor-core/src/editor/clipboard/clipboard-parse.ts index 43b72ed6e7..04d976612d 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboard-parse.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboard-parse.ts @@ -1,31 +1,7 @@ import { Protocol, BlockFlavorKeys } from '@toeverything/datasource/db-service'; -import { escape } from '@toeverything/utils'; import { Editor } from '../editor'; -import { SelectBlock } from '../selection'; import { ClipBlockInfo } from './types'; -class DefaultBlockParse { - public static html2block(el: Element): ClipBlockInfo[] | undefined | null { - const tag_name = el.tagName; - if (tag_name === 'DIV' || el instanceof Text) { - return el.textContent?.split('\n').map(str => { - const data = { - text: escape(str), - }; - return { - type: 'text', - properties: { - text: { value: [data] }, - }, - children: [], - }; - }); - } - - return null; - } -} - export default class ClipboardParse { private editor: Editor; private static block_types: BlockFlavorKeys[] = [ @@ -82,7 +58,7 @@ export default class ClipboardParse { constructor(editor: Editor) { this.editor = editor; - this.generate_html = this.generate_html.bind(this); + // this.generate_html = this.generate_html.bind(this); this.parse_dom = this.parse_dom.bind(this); } // TODO: escape @@ -152,55 +128,6 @@ export default class ClipboardParse { return blocks; } - public async generateHtml(): Promise { - const select_info = await this.editor.selectionManager.getSelectInfo(); - return await this.generate_html(select_info.blocks); - } - - public async page2html(): Promise { - const root_block_id = this.editor.getRootBlockId(); - if (!root_block_id) { - return ''; - } - - const block_info = await this.get_select_info(root_block_id); - return await this.generate_html([block_info]); - } - - private async get_select_info(blockId: string) { - const block = await this.editor.getBlockById(blockId); - if (!block) return null; - const block_info: SelectBlock = { - blockId: block.id, - children: [], - }; - const children_ids = block.childrenIds; - for (let i = 0; i < children_ids.length; i++) { - block_info.children.push( - await this.get_select_info(children_ids[i]) - ); - } - return block_info; - } - - private async generate_html(selectBlocks: SelectBlock[]): Promise { - let result = ''; - for (let i = 0; i < selectBlocks.length; i++) { - const sel_block = selectBlocks[i]; - if (!sel_block || !sel_block.blockId) continue; - const block = await this.editor.getBlockById(sel_block.blockId); - if (!block) continue; - const block_utils = this.editor.getView(block.type); - const html = await block_utils.block2html( - block, - sel_block.children, - this.generate_html - ); - result += html; - } - return result; - } - public dispose() { this.editor = null; } diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts index d50b2fbdae..f4e9665b7e 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts @@ -1,5 +1,9 @@ import { Editor } from '../editor'; -import { SelectBlock, SelectInfo } from '@toeverything/components/editor-core'; +import { + AsyncBlock, + SelectBlock, + SelectInfo, +} from '@toeverything/components/editor-core'; import { ClipBlockInfo, OFFICE_CLIPBOARD_MIMETYPE } from './types'; import { Clip } from './clip'; @@ -83,4 +87,76 @@ export class ClipboardUtils { }) ); } + + async convertTextValue2HtmlBySelectInfo( + blockOrBlockId: AsyncBlock | string, + selectBlockInfo?: SelectBlock + ) { + const block = + typeof blockOrBlockId === 'string' + ? await this._editor.getBlockById(blockOrBlockId) + : blockOrBlockId; + const selectedProperties = + await this._editor.blockHelper.getEditableBlockPropertiesBySelectInfo( + block, + selectBlockInfo + ); + return this._editor.blockHelper.convertTextValue2Html( + block.id, + selectedProperties.text.value + ); + } + async convertBlock2HtmlBySelectInfos( + blockOrBlockId: AsyncBlock | string, + selectBlockInfos?: SelectBlock[] + ) { + if (!selectBlockInfos) { + const block = + typeof blockOrBlockId === 'string' + ? await this._editor.getBlockById(blockOrBlockId) + : blockOrBlockId; + const children = await block?.children(); + return ( + await Promise.all( + children.map(async childBlock => { + const blockView = this._editor.getView(childBlock.type); + return await blockView.block2html({ + editor: this._editor, + block: childBlock, + }); + }) + ) + ).join(''); + } + + return ( + await Promise.all( + selectBlockInfos.map(async selectBlockInfo => { + const block = await this._editor.getBlockById( + selectBlockInfo.blockId + ); + const blockView = this._editor.getView(block.type); + return await blockView.block2html({ + editor: this._editor, + block, + selectInfo: selectBlockInfo, + }); + }) + ) + ).join(''); + } + + async page2html() { + const rootBlockId = this._editor.getRootBlockId(); + if (!rootBlockId) { + return ''; + } + const rootBlock = await this._editor.getBlockById(rootBlockId); + const blockView = this._editor.getView(rootBlock.type); + + return await blockView.block2html({ + editor: this._editor, + block: rootBlock, + }); + } } diff --git a/libs/components/editor-core/src/editor/clipboard/copy.ts b/libs/components/editor-core/src/editor/clipboard/copy.ts index 3056091cd3..4d89a500b6 100644 --- a/libs/components/editor-core/src/editor/clipboard/copy.ts +++ b/libs/components/editor-core/src/editor/clipboard/copy.ts @@ -50,62 +50,38 @@ class Copy { const textClip = await this._getTextClip(); clips.push(textClip); - // const htmlClip = await this._getHtmlClip(); - // clips.push(htmlClip); - const htmlClip = await this._clipboardParse.generateHtml(); - htmlClip && - clips.push(new Clip(OFFICE_CLIPBOARD_MIMETYPE.HTML, htmlClip)); + const htmlClip = await this._getHtmlClip(); + + clips.push(htmlClip); + // const htmlClip = await this._clipboardParse.generateHtml(); + // htmlClip && + // clips.push(new Clip(OFFICE_CLIPBOARD_MIMETYPE.HTML, htmlClip)); return clips; } - // private async _getHtmlClip(): Promise { - // const selectInfo: SelectInfo = - // await this._editor.selectionManager.getSelectInfo(); - // - // if (selectInfo.type === 'Range') { - // const html = ( - // await Promise.all( - // selectInfo.blocks.map(async selectBlockInfo => { - // const block = await this._editor.getBlockById( - // selectBlockInfo.blockId - // ); - // const blockView = this._editor.getView(block.type); - // const block2html = await blockView.block2html({ - // editor: this._editor, - // block, - // selectInfo: selectBlockInfo, - // }); - // - // if ( - // await this._editor.blockHelper.isBlockEditable( - // block - // ) - // ) { - // const selectedProperties = - // await this._editor.blockHelper.getEditableBlockPropertiesBySelectInfo( - // block, - // selectBlockInfo - // ); - // - // return ( - // block2html || - // this._editor.blockHelper.convertTextValue2Html( - // block.id, - // selectedProperties.text.value - // ) - // ); - // } - // - // return block2html; - // }) - // ) - // ).join(''); - // console.log('html', html); - // } - // - // return new Clip(OFFICE_CLIPBOARD_MIMETYPE.HTML, 'blockText'); - // } + private async _getHtmlClip(): Promise { + const selectInfo: SelectInfo = + await this._editor.selectionManager.getSelectInfo(); + + const htmlStr = ( + await Promise.all( + selectInfo.blocks.map(async selectBlockInfo => { + const block = await this._editor.getBlockById( + selectBlockInfo.blockId + ); + const blockView = this._editor.getView(block.type); + return await blockView.block2html({ + editor: this._editor, + block, + selectInfo: selectBlockInfo, + }); + }) + ) + ).join(''); + + return new Clip(OFFICE_CLIPBOARD_MIMETYPE.HTML, htmlStr); + } private async _getAffineClip(): Promise { const selectInfo: SelectInfo = diff --git a/libs/components/editor-core/src/editor/editor.ts b/libs/components/editor-core/src/editor/editor.ts index 9253ab2cbe..acdf4233c5 100644 --- a/libs/components/editor-core/src/editor/editor.ts +++ b/libs/components/editor-core/src/editor/editor.ts @@ -502,13 +502,7 @@ export class Editor implements Virgo { } public async page2html(): Promise { - return ''; - // const parse = this.clipboard?.getClipboardParse(); - // if (!parse) { - // return ''; - // } - // const html_str = await parse.page2html(); - // return html_str; + return this.clipboard?.clipboardUtils?.page2html?.(); } dispose() { diff --git a/libs/components/editor-core/src/editor/index.ts b/libs/components/editor-core/src/editor/index.ts index d03326f386..2525fe5683 100644 --- a/libs/components/editor-core/src/editor/index.ts +++ b/libs/components/editor-core/src/editor/index.ts @@ -8,5 +8,5 @@ export { Editor as BlockEditor } from './editor'; export * from './selection'; export { BlockDropPlacement, HookType, GroupDirection } from './types'; export type { Plugin, PluginCreator, PluginHooks, Virgo } from './types'; -export { BaseView, getTextHtml } from './views/base-view'; +export { BaseView } from './views/base-view'; export type { ChildrenView, CreateView } from './views/base-view'; diff --git a/libs/components/editor-core/src/editor/views/base-view.ts b/libs/components/editor-core/src/editor/views/base-view.ts index f9db79fbc5..d632f6e70a 100644 --- a/libs/components/editor-core/src/editor/views/base-view.ts +++ b/libs/components/editor-core/src/editor/views/base-view.ts @@ -135,13 +135,6 @@ export abstract class BaseView { return null; } - async block2html( - block: AsyncBlock, - children: SelectBlock[], - generateHtml: (el: any[]) => Promise - ): Promise { - return ''; - } async block2Text( block: AsyncBlock, // The selectInfo parameter is not passed when the block is selected in ful, the selectInfo.type is Range @@ -151,45 +144,12 @@ export abstract class BaseView { } // TODO: Try using new methods - // async block2html2(props: { - // editor: Editor; - // block: AsyncBlock; - // // The selectInfo parameter is not passed when the block is selected in ful, the selectInfo.type is Range - // selectInfo?: SelectBlock; - // }) { - // return ''; - // } + async block2html(props: { + editor: Editor; + block: AsyncBlock; + // The selectInfo parameter is not passed when the block is selected in ful, the selectInfo.type is Range + selectInfo?: SelectBlock; + }) { + return ''; + } } - -export const getTextHtml = (block: AsyncBlock) => { - const generate = (textList: any[]) => { - let content = ''; - textList.forEach(text_obj => { - let text = text_obj.text || ''; - if (text_obj.bold) { - text = `${text}`; - } - if (text_obj.italic) { - text = `${text}`; - } - if (text_obj.underline) { - text = `${text}`; - } - if (text_obj.inlinecode) { - text = `${text}`; - } - if (text_obj.strikethrough) { - text = `${text}`; - } - if (text_obj.type === 'link') { - text = `${generate( - text_obj.children - )}`; - } - content += text; - }); - return content; - }; - const text_list: any[] = block.getProperty('text').value; - return generate(text_list); -}; diff --git a/libs/components/layout/src/header/PageSettingPortal.tsx b/libs/components/layout/src/header/PageSettingPortal.tsx index 452734ff3c..9defcf754d 100644 --- a/libs/components/layout/src/header/PageSettingPortal.tsx +++ b/libs/components/layout/src/header/PageSettingPortal.tsx @@ -153,9 +153,7 @@ function PageSettingPortal() { const handleExportHtml = async () => { //@ts-ignore - const htmlContent = await virgo.clipboard - .getClipboardParse() - .page2html(); + const htmlContent = await virgo.clipboard.clipboardUtils.page2html(); const htmlTitle = pageBlock.title; FileExporter.exportHtml(htmlTitle, htmlContent); @@ -163,9 +161,7 @@ function PageSettingPortal() { const handleExportMarkdown = async () => { //@ts-ignore - const htmlContent = await virgo.clipboard - .getClipboardParse() - .page2html(); + const htmlContent = await virgo.clipboard.clipboardUtils.page2html(); const htmlTitle = pageBlock.title; FileExporter.exportMarkdown(htmlTitle, htmlContent); }; diff --git a/libs/components/layout/src/settings-sidebar/Settings/util/handle-export.ts b/libs/components/layout/src/settings-sidebar/Settings/util/handle-export.ts index fe284b986c..d329701f25 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/util/handle-export.ts +++ b/libs/components/layout/src/settings-sidebar/Settings/util/handle-export.ts @@ -1,5 +1,4 @@ import { createEditor } from '@toeverything/components/affine-editor'; -import { ClipboardParse } from '@toeverything/components/editor-core'; import { fileExporter } from './file-exporter'; interface CreateClipboardParseProps { @@ -7,13 +6,12 @@ interface CreateClipboardParseProps { rootBlockId: string; } -const createClipboardParse = ({ +const createClipboardUtils = ({ workspaceId, rootBlockId, }: CreateClipboardParseProps) => { const editor = createEditor(workspaceId, rootBlockId); - - return new ClipboardParse(editor); + return editor.clipboard.clipboardUtils; }; interface ExportHandlerProps extends CreateClipboardParseProps { @@ -25,9 +23,8 @@ export const exportHtml = async ({ rootBlockId, title, }: ExportHandlerProps) => { - const clipboardParse = createClipboardParse({ workspaceId, rootBlockId }); - const htmlContent = await clipboardParse.page2html(); - fileExporter.exportHtml(title, htmlContent); + const clipboardUtils = createClipboardUtils({ workspaceId, rootBlockId }); + fileExporter.exportHtml(title, await clipboardUtils.page2html()); }; export const exportMarkdown = async ({ @@ -35,7 +32,6 @@ export const exportMarkdown = async ({ rootBlockId, title, }: ExportHandlerProps) => { - const clipboardParse = createClipboardParse({ workspaceId, rootBlockId }); - const htmlContent = await clipboardParse.page2html(); - fileExporter.exportMarkdown(title, htmlContent); + const clipboardUtils = createClipboardUtils({ workspaceId, rootBlockId }); + fileExporter.exportMarkdown(title, await clipboardUtils.page2html()); }; From 7b4999225a6526b09e6ed5c391c549fc92e96920 Mon Sep 17 00:00:00 2001 From: HeJiachen-PM <79301703+HeJiachen-PM@users.noreply.github.com> Date: Mon, 22 Aug 2022 22:58:16 +0800 Subject: [PATCH 10/79] hided my personal email --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 919fcf4114..718d32c94d 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [ # Contact Us -The contact info for AFFiNE Founder is here: hejiachen@toeverything.info +You may contact us by emailing to: contact@toeverything.info # The Philosophy of AFFiNE From ab070daa7ee511fb78b48ef26e0af6e7c93d4b29 Mon Sep 17 00:00:00 2001 From: mitsuha Date: Tue, 23 Aug 2022 15:37:44 +0800 Subject: [PATCH 11/79] feat: 1. add toc; --- README.md | 2 +- .../src/pages/workspace/docs/Page.tsx | 67 ++++--- .../workspace/docs/components/tabs/Tabs.tsx | 36 ++-- .../workspace/docs/components/toc/TOC.tsx | 168 ++++++++++++++++++ .../workspace/docs/components/toc/index.ts | 1 + .../docs/utils/getPageContentById.ts | 64 +++++++ .../editor-core/src/editor/editor.ts | 13 ++ .../db-service/src/services/index.ts | 9 + .../db-service/src/services/workspace/toc.ts | 28 +++ 9 files changed, 350 insertions(+), 38 deletions(-) create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts create mode 100644 libs/datasource/db-service/src/services/workspace/toc.ts diff --git a/README.md b/README.md index 718d32c94d..19e0db1307 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [ # Contact Us -You may contact us by emailing to: contact@toeverything.info +You may contact us by emailing to: contact@toeverything.info # The Philosophy of AFFiNE diff --git a/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx b/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx index a2440a1757..6d9d2fac90 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx @@ -22,16 +22,29 @@ import { type BlockEditor } from '@toeverything/components/editor-core'; import { useFlag } from '@toeverything/datasource/feature-flags'; import { CollapsiblePageTree } from './collapsible-page-tree'; import { Tabs } from './components/tabs'; +import { TabMap, TAB_TITLE } from './components/tabs/Tabs'; +import { TOC } from './components/toc'; import { WorkspaceName } from './workspace-name'; + type PageProps = { workspace: string; }; export function Page(props: PageProps) { + const [activeTab, setActiveTab] = useState( + TabMap.get(TAB_TITLE.PAGES).value + ); const { page_id } = useParams(); const { showSpaceSidebar, fixedDisplay, setSpaceSidebarVisible } = useShowSpaceSidebar(); const dailyNotesFlag = useFlag('BooleanDailyNotes', false); + const editorRef = useRef(null); + + const onTabChange = v => setActiveTab(v); + + const getEditor = editor => { + editorRef.current = editor; + }; return ( @@ -50,35 +63,45 @@ export function Page(props: PageProps) { > - + -
- {dailyNotesFlag && ( + {activeTab === TabMap.get(TAB_TITLE.PAGES).value && ( +
+ {dailyNotesFlag && ( +
+ + + +
+ )}
- - + +
- )} -
- - - +
+ + {page_id ? : null} + +
-
- - {page_id ? : null} - -
-
+ )} + + {activeTab === TabMap.get(TAB_TITLE.TOC).value && ( + TOC + )} - + ); } @@ -86,9 +109,11 @@ export function Page(props: PageProps) { const EditorContainer = ({ pageId, workspace, + getEditor, }: { pageId: string; workspace: string; + getEditor: (editor: BlockEditor) => void; }) => { const [lockScroll, setLockScroll] = useState(false); const [scrollContainer, setScrollContainer] = useState(); @@ -105,6 +130,8 @@ const EditorContainer = ({ const obv = new ResizeObserver(e => { setPageClientWidth(e[0].contentRect.width); }); + + getEditor(editorRef.current); obv.observe(scrollContainer); return () => obv.disconnect(); } diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/tabs/Tabs.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/tabs/Tabs.tsx index 74a8dcc5ae..aea0c88374 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/tabs/Tabs.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/tabs/Tabs.tsx @@ -1,6 +1,5 @@ import { styled } from '@toeverything/components/ui'; import type { ValueOf } from '@toeverything/utils'; -import { useState } from 'react'; const StyledTabs = styled('div')(({ theme }) => { return { @@ -56,32 +55,35 @@ const StyledTabTitle = styled('div')<{ } `; -const TAB_TITLE = { - PAGES: 'pages', - GALLERY: 'gallery', - TOC: 'toc', +export const TAB_TITLE = { + PAGES: 'PAGES', + GALLERY: 'GALLERY', + TOC: 'TOC', } as const; -const TabMap = new Map([ - ['PAGES', { value: 'pages' }], - ['GALLERY', { value: 'gallery', disabled: true }], - ['TOC', { value: 'toc' }], +export const TabMap = new Map< + TabValue, + { value: TabValue; disabled?: boolean } +>([ + [TAB_TITLE.PAGES, { value: TAB_TITLE.PAGES }], + [TAB_TITLE.GALLERY, { value: TAB_TITLE.GALLERY, disabled: true }], + [TAB_TITLE.TOC, { value: TAB_TITLE.TOC }], ]); -type TabKey = keyof typeof TAB_TITLE; type TabValue = ValueOf; -const Tabs = () => { - const [activeValue, setActiveTab] = useState(TAB_TITLE.PAGES); +interface Props { + activeTab: TabValue; + onTabChange: (v: TabValue) => void; +} - const onClick = (v: TabValue) => { - setActiveTab(v); - }; +const Tabs = (props: Props) => { + const { activeTab, onTabChange } = props; return ( {[...TabMap.entries()].map(([k, { value, disabled = false }]) => { - const isActive = activeValue === value; + const isActive = activeTab === value; return ( { className={isActive ? 'active' : ''} isActive={isActive} isDisabled={disabled} - onClick={() => onClick(value)} + onClick={() => onTabChange(value)} > {k} diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx new file mode 100644 index 0000000000..b2c0aa693e --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -0,0 +1,168 @@ +import { BlockEditor } from '@toeverything/components/editor-core'; +import { styled } from '@toeverything/components/ui'; +import { services } from '@toeverything/datasource/db-service'; +import type { ReactNode } from 'react'; +import { + createContext, + useCallback, + useContext, + useEffect, + useState, +} from 'react'; +import { useParams } from 'react-router'; +import { + BLOCK_TYPES, + getPageContentById, +} from '../../utils/getPageContentById'; + +const StyledTOC = styled('div')(() => { + return {}; +}); + +const StyledTOCItem = styled('a')<{ type?: string; isActive?: boolean }>( + ({ type, isActive }) => { + const common = { + height: '32px', + display: 'flex', + alignItems: 'center', + cursor: 'pointer', + color: isActive ? '#3E6FDB' : '#4C6275', + }; + + if (type === BLOCK_TYPES.HEADING1) { + return { + ...common, + padding: '0 12px', + fontWeight: '600', + fontSize: '16px', + }; + } + + if (type === BLOCK_TYPES.HEADING2) { + return { + ...common, + padding: '0 32px', + fontSize: '14px', + }; + } + + if (type === BLOCK_TYPES.HEADING3) { + return { + ...common, + padding: '0 52px', + fontSize: '12px', + }; + } + + if (type === BLOCK_TYPES.GROUP) { + return { + ...common, + margin: '6px 0px', + height: '46px', + padding: '6px 12px', + fontWeight: '600', + fontSize: '16px', + borderTop: '0.5px solid #E0E6EB', + borderBottom: '0.5px solid #E0E6EB', + color: isActive ? '#3E6FDB' : '#98ACBD', + }; + } + + return {}; + } +); + +const StyledItem = styled('div')(props => { + return { + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + }; +}); + +const TOCContext = createContext(null); + +interface Props { + children: ReactNode; + editor: BlockEditor; +} + +const TOCItem = props => { + const { activeBlockId, onClick } = useContext(TOCContext); + const { id, type, text } = props; + const isActive = id === activeBlockId; + + return ( + onClick(id)} + > + {text} + + ); +}; + +const renderTOCContent = tocDataSource => { + return ( + <> + {tocDataSource.map(tocItem => { + if (tocItem?.length) { + return renderTOCContent(tocItem); + } + + const { id, type, text } = tocItem; + + return ; + })} + + ); +}; + +export const TOC = (props: Props) => { + const { editor } = props; + const { workspace_id, page_id } = useParams(); + const [tocDataSource, setTocDataSource] = useState([]); + const [activeBlockId, setActiveBlockId] = useState('blockId'); + + const updateTocDataSource = useCallback(async () => { + const tocDataSource = await getPageContentById(editor, page_id); + setTocDataSource(tocDataSource); + }, [editor, page_id]); + + useEffect(() => { + (async () => await updateTocDataSource())(); + }, [updateTocDataSource]); + + useEffect(() => { + let unobserve: () => void; + const observe = async () => { + unobserve = await services.api.tocService.observe( + { workspace: workspace_id, pageId: page_id }, + updateTocDataSource + ); + }; + void observe(); + + return () => { + unobserve?.(); + }; + }, [updateTocDataSource, workspace_id]); + + const onClick = async (blockId?: string) => { + if (blockId === activeBlockId) { + return; + } + + console.log(blockId); + setActiveBlockId(blockId); + await editor.scrollManager.scrollIntoViewByBlockId(blockId); + }; + + return ( + + {renderTOCContent(tocDataSource)} + + ); +}; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts new file mode 100644 index 0000000000..e603af8242 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts @@ -0,0 +1 @@ +export { TOC } from './TOC'; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts b/apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts new file mode 100644 index 0000000000..b1d16cb9d6 --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts @@ -0,0 +1,64 @@ +import type { BlockEditor } from '@toeverything/components/editor-core'; + +export const BLOCK_TYPES = { + GROUP: 'group', + HEADING1: 'heading1', + HEADING2: 'heading2', + HEADING3: 'heading3', +}; + +const getContentByAsyncBlocks = async (asyncBlocks = []) => { + /* maybe should recast it to tail recursion */ + return await Promise.all( + asyncBlocks.map(async asyncBlock => { + const asyncBlocks = await asyncBlock.children(); + + if (asyncBlocks?.length) { + return getContentByAsyncBlocks(asyncBlocks); + } + + const { id, type } = asyncBlock; + + if (Object.values(BLOCK_TYPES).includes(type)) { + const properties = await asyncBlock.getProperties(); + + return { + id: id, + type, + text: properties?.text?.value?.[0]?.text || '', + }; + } + + return null; + }) + ); +}; + +const getPageContentById = async (editor: BlockEditor, pageId: string) => { + const { children = [] } = (await editor.queryByPageId(pageId))?.[0] || {}; + const asyncBlocks = (await editor.getBlockByIds(children)) || []; + + const tocContents = await getContentByAsyncBlocks(asyncBlocks); + + return tocContents + .reduce((tocGroupContent, tocContent, index) => { + const { id, type } = asyncBlocks[index]; + const groupContent = { + id, + type, + text: 'Untitled Group', + }; + + tocGroupContent.push( + !tocContent.flat(Infinity).filter(Boolean).length + ? groupContent + : tocContent + ); + + return tocGroupContent; + }, []) + .flat(Infinity) + .filter(Boolean); +}; + +export { getPageContentById }; diff --git a/libs/components/editor-core/src/editor/editor.ts b/libs/components/editor-core/src/editor/editor.ts index e7f6458a5f..74243ba6aa 100644 --- a/libs/components/editor-core/src/editor/editor.ts +++ b/libs/components/editor-core/src/editor/editor.ts @@ -333,6 +333,12 @@ export class Editor implements Virgo { return await this.getBlock({ workspace: this.workspace, id: blockId }); } + async getBlockByIds(ids: string[]): Promise[]> { + return await Promise.all( + ids.map(id => this.getBlock({ workspace: this.workspace, id })) + ); + } + /** * TODO: to be optimized * get block`s dom by block`s id @@ -477,6 +483,13 @@ export class Editor implements Virgo { return await services.api.editorBlock.query(this.workspace, query); } + async queryByPageId(pageId: string) { + return await services.api.editorBlock.get({ + workspace: this.workspace, + ids: [pageId], + }); + } + /** Hooks */ public getHooks(): HooksRunner & PluginHooks { diff --git a/libs/datasource/db-service/src/services/index.ts b/libs/datasource/db-service/src/services/index.ts index 315ee84496..c39119fe68 100644 --- a/libs/datasource/db-service/src/services/index.ts +++ b/libs/datasource/db-service/src/services/index.ts @@ -5,6 +5,7 @@ import { Database } from './database'; import { EditorBlock } from './editor-block'; import { FileService } from './file'; import { PageTree } from './workspace/page-tree'; +import { TOC } from './workspace/toc'; import { UserConfig } from './workspace/user-config'; export { @@ -48,6 +49,7 @@ export interface DbServicesMap { userConfig: UserConfig; file: FileService; commentService: CommentService; + tocService: TOC; } interface RegisterDependencyConfigWithName extends RegisterDependencyConfig { @@ -76,6 +78,13 @@ const dbServiceConfig: RegisterDependencyConfigWithName[] = [ value: PageTree, dependencies: [{ token: Database }], }, + { + type: 'class', + callName: 'tocService', + token: TOC, + value: TOC, + dependencies: [{ token: Database }], + }, { type: 'class', callName: 'userConfig', diff --git a/libs/datasource/db-service/src/services/workspace/toc.ts b/libs/datasource/db-service/src/services/workspace/toc.ts new file mode 100644 index 0000000000..16bec3da18 --- /dev/null +++ b/libs/datasource/db-service/src/services/workspace/toc.ts @@ -0,0 +1,28 @@ +import { ServiceBaseClass } from '../base'; +import { ReturnUnobserve } from '../database/observer'; +import { ObserveCallback } from './page-tree'; + +export class TOC extends ServiceBaseClass { + private onActivePageChange?: () => void; + + async observe( + { workspace, pageId }: { workspace: string; pageId: string }, + callback: ObserveCallback + ): Promise { + // not only use observe, but also addChildrenListener is OK 🎉🎉🎉 + // const pageBlock = await this.getBlock(workspace, pageId); + // + // this.onActivePageChange?.(); + // pageBlock?.addChildrenListener('onPageChildrenChange', () => { + // callback(); + // }); + // + // this.onActivePageChange = () => pageBlock?.removeChildrenListener('onPageChildrenChange'); + + const unobserve = await this._observe(workspace, pageId, callback); + + return () => { + unobserve(); + }; + } +} From a13e2a59d3c30f5908cc18c73913e8327b85d9e9 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Tue, 23 Aug 2022 16:51:41 +0800 Subject: [PATCH 12/79] docs(readme): update readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 718d32c94d..19e0db1307 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [ # Contact Us -You may contact us by emailing to: contact@toeverything.info +You may contact us by emailing to: contact@toeverything.info # The Philosophy of AFFiNE From eedb4864df81d80830e7d5b9912da6110cff0b72 Mon Sep 17 00:00:00 2001 From: austaras Date: Tue, 23 Aug 2022 12:04:32 +0800 Subject: [PATCH 13/79] mod(whiteboard): close tool panel when select tool --- README.md | 2 +- libs/components/affine-board/src/Board.tsx | 7 ++-- .../src/components/tools-panel/LineTools.tsx | 6 +++- .../src/components/tools-panel/ShapeTools.tsx | 6 +++- .../src/components/tools-panel/ToolsPanel.tsx | 36 +++++++++---------- .../tools-panel/pen-tools/PenTools.tsx | 17 ++++++--- libs/components/ui/src/cascader/Cascader.tsx | 2 +- libs/components/ui/src/popper/Popper.tsx | 11 ++++-- libs/components/ui/src/popper/interface.ts | 2 ++ 9 files changed, 55 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 718d32c94d..19e0db1307 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [ # Contact Us -You may contact us by emailing to: contact@toeverything.info +You may contact us by emailing to: contact@toeverything.info # The Philosophy of AFFiNE diff --git a/libs/components/affine-board/src/Board.tsx b/libs/components/affine-board/src/Board.tsx index af9e8982fe..101d54d37b 100644 --- a/libs/components/affine-board/src/Board.tsx +++ b/libs/components/affine-board/src/Board.tsx @@ -134,17 +134,14 @@ const AffineBoard = ({ } }) ); - let pageBindingsString = ( + const pageBindingsString = ( await services.api.editorBlock.get({ workspace: workspace, ids: [rootBlockId], }) )?.[0].properties.bindings?.value; - console.log(123123123); - let pageBindings = JSON.parse(pageBindingsString ?? '{}'); - console.log(pageBindings, 3333, bindings); + const pageBindings = JSON.parse(pageBindingsString ?? '{}'); Object.keys(bindings).forEach(bindingsKey => { - console.log(345345345345345); if (!bindings[bindingsKey]) { delete pageBindings[bindingsKey]; } else { diff --git a/libs/components/board-draw/src/components/tools-panel/LineTools.tsx b/libs/components/board-draw/src/components/tools-panel/LineTools.tsx index 3ef546ca3c..ce6cb97574 100644 --- a/libs/components/board-draw/src/components/tools-panel/LineTools.tsx +++ b/libs/components/board-draw/src/components/tools-panel/LineTools.tsx @@ -35,6 +35,7 @@ const activeToolSelector = (s: TDSnapshot) => s.appState.activeTool; export const LineTools = ({ app }: { app: TldrawApp }) => { const activeTool = app.useStore(activeToolSelector); + const [visible, setVisible] = useState(false); const [lastActiveTool, setLastActiveTool] = useState( TDShapeType.Line @@ -51,8 +52,10 @@ export const LineTools = ({ app }: { app: TldrawApp }) => { return ( setVisible(prev => !prev)} + onClickAway={() => setVisible(false)} content={ {shapes.map(({ type, label, tooltip, icon: Icon }) => ( @@ -60,6 +63,7 @@ export const LineTools = ({ app }: { app: TldrawApp }) => { { app.selectTool(type); + setVisible(false); setLastActiveTool(type); }} > diff --git a/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx b/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx index eb2fb5c564..0c04126c95 100644 --- a/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx +++ b/libs/components/board-draw/src/components/tools-panel/ShapeTools.tsx @@ -71,6 +71,7 @@ const activeToolSelector = (s: TDSnapshot) => s.appState.activeTool; export const ShapeTools = ({ app }: { app: TldrawApp }) => { const activeTool = app.useStore(activeToolSelector); + const [visible, setVisible] = useState(false); const [lastActiveTool, setLastActiveTool] = useState( TDShapeType.Rectangle @@ -87,8 +88,10 @@ export const ShapeTools = ({ app }: { app: TldrawApp }) => { return ( setVisible(prev => !prev)} + onClickAway={() => setVisible(false)} content={ {shapes.map(({ type, label, tooltip, icon: Icon }) => ( @@ -96,6 +99,7 @@ export const ShapeTools = ({ app }: { app: TldrawApp }) => { { app.selectTool(type); + setVisible(false); setLastActiveTool(type); }} > diff --git a/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx b/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx index f659fdff1c..82a5315816 100644 --- a/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx +++ b/libs/components/board-draw/src/components/tools-panel/ToolsPanel.tsx @@ -12,12 +12,12 @@ import { import { IconButton, PopoverContainer, + styled, // MuiIconButton as IconButton, // MuiTooltip as Tooltip, Tooltip, useTheme, } from '@toeverything/components/ui'; -import style9 from 'style9'; import { TldrawApp } from '@toeverything/components/board-state'; import { @@ -90,8 +90,8 @@ export const ToolsPanel = ({ app }: { app: TldrawApp }) => { }} direction="none" > -
-
+ + {tools.map( ({ type, @@ -127,24 +127,22 @@ export const ToolsPanel = ({ app }: { app: TldrawApp }) => { ) )} -
-
+ + ); }; -const styles = style9.create({ - container: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - height: '100%', - }, - toolBar: { - display: 'flex', - flexDirection: 'column', - backgroundColor: '#ffffff', - borderRadius: '10px', - padding: '4px 4px', - }, +const Container = styled('div')({ + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + height: '100%', +}); +const ToolBar = styled('div')({ + display: 'flex', + flexDirection: 'column', + backgroundColor: '#ffffff', + borderRadius: '10px', + padding: '4px 4px', }); diff --git a/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx b/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx index 0536acfce1..c955afba0d 100644 --- a/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx +++ b/libs/components/board-draw/src/components/tools-panel/pen-tools/PenTools.tsx @@ -12,7 +12,7 @@ import { styled, Tooltip, } from '@toeverything/components/ui'; -import { ReactElement, type CSSProperties } from 'react'; +import { useState, type CSSProperties, type ReactElement } from 'react'; import { Palette } from '../../palette'; import { Pen } from './Pen'; @@ -106,6 +106,7 @@ const PENCIL_CONFIGS_MAP = PENCIL_CONFIGS.reduce< export const PenTools = ({ app }: { app: TldrawApp }) => { const appCurrentTool = app.useStore(state => state.appState.activeTool); + const [visible, setVisible] = useState(false); const chosenPen = PENCIL_CONFIGS.find(config => config.key === appCurrentTool) || PENCIL_CONFIGS[0]; @@ -134,8 +135,10 @@ export const PenTools = ({ app }: { app: TldrawApp }) => { return ( setVisible(prev => !prev)} + onClickAway={() => setVisible(false)} content={ @@ -153,7 +156,10 @@ export const PenTools = ({ app }: { app: TldrawApp }) => { name={title} primaryColor={color_vars['--color-0']} secondaryColor={color_vars['--color-1']} - onClick={() => setPen(key)} + onClick={() => { + setVisible(false); + setPen(key); + }} /> ); } @@ -163,7 +169,10 @@ export const PenTools = ({ app }: { app: TldrawApp }) => { setPenColor(color)} + onSelect={color => { + setVisible(false); + setPenColor(color); + }} />
diff --git a/libs/components/ui/src/cascader/Cascader.tsx b/libs/components/ui/src/cascader/Cascader.tsx index 1ba44aab6b..7bf43413f2 100644 --- a/libs/components/ui/src/cascader/Cascader.tsx +++ b/libs/components/ui/src/cascader/Cascader.tsx @@ -1,5 +1,5 @@ import { ArrowRightIcon } from '@toeverything/components/icons'; -import { ReactElement, useRef, useState } from 'react'; +import { useRef, useState, type ReactElement } from 'react'; import { Divider } from '../divider'; import { MuiGrow as Grow, diff --git a/libs/components/ui/src/popper/Popper.tsx b/libs/components/ui/src/popper/Popper.tsx index 924e3be8fd..55d5692927 100644 --- a/libs/components/ui/src/popper/Popper.tsx +++ b/libs/components/ui/src/popper/Popper.tsx @@ -35,6 +35,8 @@ export const Popper = ({ offset = [0, 5], showArrow = false, popperHandlerRef, + onClick, + onClickAway, ...popperProps }: PopperProps) => { const [anchorEl, setAnchorEl] = useState(null); @@ -97,15 +99,20 @@ export const Popper = ({ return ( { - setVisible(false); + if (visibleControlledByParent) { + onClickAway?.(); + } else { + setVisible(false); + } }} > {isAnchorCustom ? null : (
setAnchorEl(dom)} - onClick={() => { + onClick={e => { if (!hasClickTrigger || visibleControlledByParent) { + onClick?.(e); return; } setVisible(!visible); diff --git a/libs/components/ui/src/popper/interface.ts b/libs/components/ui/src/popper/interface.ts index b449eff61f..1f7473ebf4 100644 --- a/libs/components/ui/src/popper/interface.ts +++ b/libs/components/ui/src/popper/interface.ts @@ -62,4 +62,6 @@ export type PopperProps = { showArrow?: boolean; popperHandlerRef?: Ref; + + onClickAway?: () => void; } & Omit; From 6df2676c8807916110fb77d0cc29df69ae265089 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Tue, 23 Aug 2022 17:07:16 +0800 Subject: [PATCH 14/79] refactor: jwt internal version migration --- libs/datasource/jwt/package.json | 2 +- libs/datasource/jwt/src/block/abstract.ts | 35 +++--- libs/datasource/jwt/src/block/base.ts | 38 +++--- libs/datasource/jwt/src/block/indexer.ts | 33 +++-- libs/datasource/jwt/src/index.ts | 117 +++++++++++------- libs/datasource/jwt/src/types/block.ts | 6 +- libs/datasource/jwt/src/utils/event-bus.ts | 2 +- libs/datasource/jwt/src/utils/index.ts | 4 +- .../jwt/src/{adapter => }/yjs/binary.ts | 6 +- .../jwt/src/{adapter => }/yjs/block.ts | 17 +-- .../jwt/src/{adapter => }/yjs/gatekeeper.ts | 2 +- .../jwt/src/{adapter => }/yjs/history.ts | 5 +- .../jwt/src/{adapter => }/yjs/index.ts | 42 ++++--- .../jwt/src/{adapter => }/yjs/listener.ts | 3 +- .../jwt/src/{adapter => }/yjs/operation.ts | 38 ++++-- .../jwt/src/{adapter => }/yjs/provider.ts | 6 +- .../src/{adapter/index.ts => yjs/types.ts} | 6 +- pnpm-lock.yaml | 57 ++++++++- 18 files changed, 274 insertions(+), 145 deletions(-) rename libs/datasource/jwt/src/{adapter => }/yjs/binary.ts (96%) rename libs/datasource/jwt/src/{adapter => }/yjs/block.ts (95%) rename libs/datasource/jwt/src/{adapter => }/yjs/gatekeeper.ts (95%) rename libs/datasource/jwt/src/{adapter => }/yjs/history.ts (95%) rename libs/datasource/jwt/src/{adapter => }/yjs/index.ts (95%) rename libs/datasource/jwt/src/{adapter => }/yjs/listener.ts (98%) rename libs/datasource/jwt/src/{adapter => }/yjs/operation.ts (93%) rename libs/datasource/jwt/src/{adapter => }/yjs/provider.ts (97%) rename libs/datasource/jwt/src/{adapter/index.ts => yjs/types.ts} (97%) diff --git a/libs/datasource/jwt/package.json b/libs/datasource/jwt/package.json index dd8f6f6761..b43942b6ee 100644 --- a/libs/datasource/jwt/package.json +++ b/libs/datasource/jwt/package.json @@ -12,7 +12,7 @@ "file-selector": "^0.6.0", "flexsearch": "^0.7.21", "lib0": "^0.2.52", - "lru-cache": "^7.13.2", + "lru-cache": "^7.14.0", "ts-debounce": "^4.0.0" }, "dependencies": { diff --git a/libs/datasource/jwt/src/block/abstract.ts b/libs/datasource/jwt/src/block/abstract.ts index 38ee415e05..55249514b3 100644 --- a/libs/datasource/jwt/src/block/abstract.ts +++ b/libs/datasource/jwt/src/block/abstract.ts @@ -1,3 +1,10 @@ +import { + BlockFlavorKeys, + BlockFlavors, + BlockTypeKeys, + BlockTypes, +} from '../types'; +import { getLogger } from '../utils'; import { BlockInstance, BlockListener, @@ -6,14 +13,7 @@ import { ContentTypes, HistoryManager, MapOperation, -} from '../adapter'; -import { - BlockFlavorKeys, - BlockFlavors, - BlockTypeKeys, - BlockTypes, -} from '../types'; -import { getLogger } from '../utils'; +} from '../yjs/types'; declare const JWT_DEV: boolean; const logger = getLogger('BlockDB:block'); @@ -29,10 +29,10 @@ export class AbstractBlock< private readonly _id: string; private readonly _block: BlockInstance; private readonly _history: HistoryManager; - private readonly _root?: AbstractBlock; + private readonly _root: AbstractBlock | undefined; private readonly _parentListener: Map; - private _parent?: AbstractBlock; + private _parent: AbstractBlock | undefined; private _changeParent?: () => void; constructor( @@ -48,7 +48,9 @@ export class AbstractBlock< this._parentListener = new Map(); JWT_DEV && logger_debug(`init: exists ${this._id}`); - if (parent) this._refreshParent(parent); + if (parent) { + this._refreshParent(parent); + } } public get root() { @@ -146,7 +148,7 @@ export class AbstractBlock< return new Date(timestamp) .toISOString() .split('T')[0] - .replace(/-/g, ''); + ?.replace(/-/g, ''); } // eslint-disable-next-line no-empty } catch (e) {} @@ -259,7 +261,7 @@ export class AbstractBlock< } /** - * Insert sub-Block + * Insert children block * @param block Block instance * @param position Insertion position, if it is empty, it will be inserted at the end. If the block already exists, the position will be moved * @returns @@ -270,9 +272,12 @@ export class AbstractBlock< ) { JWT_DEV && logger(`insertChildren: start`); - if (block.id === this._id) return; // avoid self-reference + if (block.id === this._id) { + // avoid self-reference + return; + } if ( - this.type !== BlockTypes.block || // binary cannot insert subblocks + this.type !== BlockTypes.block || // binary cannot insert children blocks (block.type !== BlockTypes.block && this.flavor !== BlockFlavors.workspace) // binary can only be inserted into workspace ) { diff --git a/libs/datasource/jwt/src/block/base.ts b/libs/datasource/jwt/src/block/base.ts index 72183187b1..b5872980db 100644 --- a/libs/datasource/jwt/src/block/base.ts +++ b/libs/datasource/jwt/src/block/base.ts @@ -1,3 +1,5 @@ +import { BlockItem } from '../types'; +import { getLogger } from '../utils'; import { ArrayOperation, BlockInstance, @@ -5,9 +7,7 @@ import { ContentTypes, InternalPlainObject, MapOperation, -} from '../adapter'; -import { BlockItem } from '../types'; -import { getLogger } from '../utils'; +} from '../yjs/types'; import { AbstractBlock } from './abstract'; import { BlockCapability } from './capability'; @@ -23,8 +23,8 @@ export interface Decoration extends InternalPlainObject { type Validator = (value: T | undefined) => boolean | void; export type IndexMetadata = Readonly<{ - content?: string; - reference?: string; + content: string | undefined; + reference: string | undefined; tags: string[]; }>; export type QueryMetadata = Readonly< @@ -51,7 +51,7 @@ export class BaseBlock< B extends BlockInstance, C extends ContentOperation > extends AbstractBlock { - private readonly _exporters?: Exporters; + private readonly _exporters: Exporters | undefined; private readonly _contentExportersGetter: () => Map< string, ReadableContentExporter @@ -68,7 +68,7 @@ export class BaseBlock< ReadableContentExporter >; - validators: Map = new Map(); + private readonly _validators: Map = new Map(); constructor( block: B, @@ -157,14 +157,14 @@ export class BaseBlock< setValidator(key: string, validator?: Validator) { if (validator) { - this.validators.set(key, validator); + this._validators.set(key, validator); } else { - this.validators.delete(key); + this._validators.delete(key); } } private validate(key: string, value: unknown): boolean { - const validate = this.validators.get(key); + const validate = this._validators.get(key); if (validate) { return validate(value) === false ? false : true; } @@ -179,7 +179,7 @@ export class BaseBlock< } /** - * Get an instance of the child Block + * Get an instance of the child block * @param blockId block id */ private get_children_instance(blockId?: string): BaseBlock[] { @@ -201,9 +201,15 @@ export class BaseBlock< } try { const parent_page = this._getParentPage(false); - if (parent_page) metadata['page'] = parent_page; - if (this.group) metadata['group'] = this.group.id; - if (this.parent) metadata['parent'] = this.parent.id; + if (parent_page) { + metadata['page'] = parent_page; + } + if (this.group) { + metadata['group'] = this.group.id; + } + if (this.parent) { + metadata['parent'] = this.parent.id; + } } catch (e) { logger(`Failed to export default metadata`, e); } @@ -228,7 +234,9 @@ export class BaseBlock< for (const [name, exporter] of this._contentExportersGetter()) { try { const content = exporter(this.getContent()); - if (content) contents.push(content); + if (content) { + contents.push(content); + } } catch (err) { logger(`Failed to export content: ${name}`, err); } diff --git a/libs/datasource/jwt/src/block/indexer.ts b/libs/datasource/jwt/src/block/indexer.ts index dfee685b7e..ed57465dbc 100644 --- a/libs/datasource/jwt/src/block/indexer.ts +++ b/libs/datasource/jwt/src/block/indexer.ts @@ -7,14 +7,14 @@ import produce from 'immer'; import LRUCache from 'lru-cache'; import sift, { Query } from 'sift'; +import { BlockFlavors } from '../types'; +import { BlockEventBus, getLogger } from '../utils'; import { AsyncDatabaseAdapter, BlockInstance, ChangedStates, ContentOperation, -} from '../adapter'; -import { BlockFlavors } from '../types'; -import { BlockEventBus, getLogger } from '../utils'; +} from '../yjs/types'; import { BaseBlock, IndexMetadata, QueryMetadata } from './base'; @@ -315,7 +315,9 @@ export class BlockIndexer< private _testMetaKey(key: string) { try { const metadata = this._blockMetadata.values().next().value; - if (!metadata || typeof metadata !== 'object') return false; + if (!metadata || typeof metadata !== 'object') { + return false; + } return !!(key in metadata); } catch (e) { return false; @@ -324,8 +326,11 @@ export class BlockIndexer< private _getSortedMetadata(sort: string, desc?: boolean) { const sorter = naturalSort(Array.from(this._blockMetadata.entries())); - if (desc) return sorter.desc(([, m]) => m[sort]); - else return sorter.asc(([, m]) => m[sort]); + if (desc) { + return sorter.desc(([, m]) => m[sort]); + } else { + return sorter.asc(([, m]) => m[sort]); + } } public query(query: QueryIndexMetadata) { @@ -337,15 +342,23 @@ export class BlockIndexer< if ($sort && this._testMetaKey($sort)) { const metadata = this._getSortedMetadata($sort, $desc); metadata.forEach(([key, value]) => { - if (matches.length > limit) return; - if (filter(value)) matches.push(key); + if (matches.length > limit) { + return; + } + if (filter(value)) { + matches.push(key); + } }); return matches; } else { this._blockMetadata.forEach((value, key) => { - if (matches.length > limit) return; - if (filter(value)) matches.push(key); + if (matches.length > limit) { + return; + } + if (filter(value)) { + matches.push(key); + } }); return matches; diff --git a/libs/datasource/jwt/src/index.ts b/libs/datasource/jwt/src/index.ts index 664e0f21fa..e08bdc1e16 100644 --- a/libs/datasource/jwt/src/index.ts +++ b/libs/datasource/jwt/src/index.ts @@ -1,26 +1,7 @@ /* eslint-disable max-lines */ import { DocumentSearchOptions } from 'flexsearch'; import LRUCache from 'lru-cache'; -import { - AsyncDatabaseAdapter, - BlockInstance, - BlockListener, - ChangedStates, - Connectivity, - ContentOperation, - ContentTypes, - DataExporter, - getDataExporter, - HistoryManager, - YjsAdapter, - YjsContentOperation, - YjsInitOptions, -} from './adapter'; -import { - getYjsProviders, - YjsBlockInstance, - YjsProviderOptions, -} from './adapter/yjs'; + import { BaseBlock, BlockIndexer, @@ -39,6 +20,26 @@ import { UUID, } from './types'; import { BlockEventBus, genUUID, getLogger } from './utils'; +import { + getYjsProviders, + YjsAdapter, + YjsBlockInstance, + YjsContentOperation, + YjsInitOptions, + YjsProviderOptions, +} from './yjs'; +import { + AsyncDatabaseAdapter, + BlockInstance, + BlockListener, + ChangedStates, + Connectivity, + ContentOperation, + ContentTypes, + DataExporter, + getDataExporter, + HistoryManager, +} from './yjs/types'; declare const JWT_DEV: boolean; @@ -157,8 +158,11 @@ export class BlockClient< public addBlockListener(tag: string, listener: BlockListener) { const bus = this._eventBus.topic('updated'); - if (tag !== 'index' || !bus.has(tag)) bus.on(tag, listener); - else console.error(`block listener ${tag} is reserved or exists`); + if (tag !== 'index' || !bus.has(tag)) { + bus.on(tag, listener); + } else { + console.error(`block listener ${tag} is reserved or exists`); + } } public removeBlockListener(tag: string) { @@ -170,8 +174,11 @@ export class BlockClient< listener: BlockListener> ) { const bus = this._eventBus.topic>>('editing'); - if (tag !== 'index' || !bus.has(tag)) bus.on(tag, listener); - else console.error(`editing listener ${tag} is reserved or exists`); + if (tag !== 'index' || !bus.has(tag)) { + bus.on(tag, listener); + } else { + console.error(`editing listener ${tag} is reserved or exists`); + } } public removeEditingListener(tag: string) { @@ -184,15 +191,18 @@ export class BlockClient< ) { const bus = this._eventBus.topic>('connectivity'); - if (tag !== 'index' || !bus.has(tag)) bus.on(tag, listener); - else + if (tag !== 'index' || !bus.has(tag)) { + bus.on(tag, listener); + } else { console.error(`connectivity listener ${tag} is reserved or exists`); + } } public removeConnectivityListener(tag: string) { this._eventBus.topic('connectivity').off(tag); } + // @ts-ignore private inspector() { return { ...this._adapter.inspector(), @@ -220,7 +230,9 @@ export class BlockClient< this.addBlockListener('index', async states => { await Promise.allSettled( Array.from(states.entries()).map(([id, state]) => { - if (state === 'delete') this._blockCaches.delete(id); + if (state === 'delete') { + this._blockCaches.delete(id); + } return this._blockIndexer.refreshIndex(id, state); }) ); @@ -255,7 +267,7 @@ export class BlockClient< } /** - * research all + * Full text search * @param part_of_title_or_content Title or content keyword, support Chinese * @param part_of_title_or_content.index search range, optional values: title, ttl, content, reference * @param part_of_title_or_content.tag tag, string or array of strings, supports multiple tags @@ -295,7 +307,9 @@ export class BlockClient< this.search(part_of_title_or_content).flatMap(({ result }) => result.map(async id => { const page = this._pageMapping.get(id as string); - if (page) return page; + if (page) { + return page; + } const block = await this.get(id as BlockTypeKeys); return this.set_page(block); }) @@ -307,9 +321,10 @@ export class BlockClient< } return Promise.all( this._blockIndexer.getMetadata(pages).map(async page => ({ - content: this.get_decoded_content( - await this._adapter.getBlock(page.id) - ), + content: + this.get_decoded_content( + await this._adapter.getBlock(page.id) + ) || '', ...page, })) ); @@ -327,9 +342,10 @@ export class BlockClient< const ids = this.query(query); return Promise.all( this._blockIndexer.getMetadata(ids).map(async page => ({ - content: this.get_decoded_content( - await this._adapter.getBlock(page.id) - ), + content: + this.get_decoded_content( + await this._adapter.getBlock(page.id) + ) || '', ...page, })) ); @@ -378,7 +394,7 @@ export class BlockClient< private async get_parent(id: string) { const parents = this._parentMapping.get(id); - if (parents) { + if (parents && parents[0]) { const parent_block_id = parents[0]; if (!this._blockCaches.has(parent_block_id)) { this._blockCaches.set( @@ -405,7 +421,9 @@ export class BlockClient< private set_page(block: BaseBlock) { const page = this._pageMapping.get(block.id); - if (page) return page; + if (page) { + return page; + } const parent_page = block.parent_page; if (parent_page) { this._pageMapping.set(block.id, parent_page); @@ -472,8 +490,9 @@ export class BlockClient< matched += 1; } } - if (matched === conditions.length) + if (matched === conditions.length) { exporters.push([name, exporter] as const); + } } return exporters; @@ -487,7 +506,9 @@ export class BlockClient< ); if (exporter) { const op = block.content.asMap(); - if (op) return exporter[1](op); + if (op) { + return exporter[1](op); + } } } return undefined; @@ -566,7 +587,9 @@ export class BlockClient< this.set_page(abstract_block); abstract_block.on('parent', 'client_hook', state => { const [parent] = state.keys(); - this.set_parent(parent, abstract_block.id); + if (parent) { + this.set_parent(parent, abstract_block.id); + } this.set_page(abstract_block); }); this._blockCaches.set(abstract_block.id, abstract_block); @@ -650,13 +673,6 @@ export type BlockInitOptions = NonNullable< Parameters[1] >; -export type { - ArrayOperation, - ChangedStates, - Connectivity, - MapOperation, - TextOperation, -} from './adapter'; export type { BlockSearchItem, Decoration as BlockDecoration, @@ -665,4 +681,11 @@ export type { export { BlockTypes, BucketBackend as BlockBackend } from './types'; export type { BlockTypeKeys } from './types'; export { isBlock } from './utils'; +export type { + ArrayOperation, + ChangedStates, + Connectivity, + MapOperation, + TextOperation, +} from './yjs/types'; export type { QueryIndexMetadata }; diff --git a/libs/datasource/jwt/src/types/block.ts b/libs/datasource/jwt/src/types/block.ts index 3b04dc7830..d1867f1ef9 100644 --- a/libs/datasource/jwt/src/types/block.ts +++ b/libs/datasource/jwt/src/types/block.ts @@ -1,4 +1,4 @@ -import { ContentOperation } from '../adapter'; +import { ContentOperation } from '../yjs/types'; import { RefMetadata } from './metadata'; import { UUID } from './uuid'; // base type of block @@ -60,8 +60,8 @@ export type BlockItem = { flavor: typeof BlockFlavors[BlockFlavorKeys]; children: string[]; readonly created: number; // creation time, UTC timestamp - readonly updated?: number; // update time, UTC timestamp - readonly creator?: string; // creator id + readonly updated?: number | undefined; // update time, UTC timestamp + readonly creator?: string | undefined; // creator id content: C; // Essentially what is stored here is either Uint8Array (binary resource) or YDoc (structured resource) }; diff --git a/libs/datasource/jwt/src/utils/event-bus.ts b/libs/datasource/jwt/src/utils/event-bus.ts index 50f5363390..85096dd6ed 100644 --- a/libs/datasource/jwt/src/utils/event-bus.ts +++ b/libs/datasource/jwt/src/utils/event-bus.ts @@ -81,7 +81,7 @@ class BlockScopedEventBus extends BlockEventBus { options?: ListenerOptions ) { if (options?.debounce) { - const { wait, maxWait } = options.debounce; + const { wait, maxWait = 500 } = options.debounce; const debounced = debounce(listener, wait, { maxWait }); this.on_listener(this._topic, name, e => { debounced((e as CustomEvent)?.detail); diff --git a/libs/datasource/jwt/src/utils/index.ts b/libs/datasource/jwt/src/utils/index.ts index f19e5633a1..3d0d3bb101 100644 --- a/libs/datasource/jwt/src/utils/index.ts +++ b/libs/datasource/jwt/src/utils/index.ts @@ -39,7 +39,9 @@ export function getLogger(namespace: string) { if (JWT_DEV) { const logger = debug(namespace); logger.log = console.log.bind(console); - if (JWT_DEV === ('testing' as any)) logger.enabled = true; + if (JWT_DEV === ('testing' as any)) { + logger.enabled = true; + } return logger; } else { return () => {}; diff --git a/libs/datasource/jwt/src/adapter/yjs/binary.ts b/libs/datasource/jwt/src/yjs/binary.ts similarity index 96% rename from libs/datasource/jwt/src/adapter/yjs/binary.ts rename to libs/datasource/jwt/src/yjs/binary.ts index 468710ac4a..c156452c78 100644 --- a/libs/datasource/jwt/src/adapter/yjs/binary.ts +++ b/libs/datasource/jwt/src/yjs/binary.ts @@ -25,7 +25,7 @@ export class YjsRemoteBinaries { } else { // TODO: Remote Load try { - const file = await this._remoteStorage?.instance.getBuffData( + const file = await this._remoteStorage?.instance?.getBuffData( name ); console.log(file); @@ -44,11 +44,11 @@ export class YjsRemoteBinaries { this._binaries.set(name, binary); if (this._remoteStorage) { // TODO: Remote Save, if there is an object with the same name remotely, the upload is skipped, because the file name is the hash of the file content - const has_file = this._remoteStorage.instance.exist(name); + const has_file = this._remoteStorage.instance?.exist(name); if (!has_file) { const upload_file = new File(binary.toArray(), name); await this._remoteStorage.instance - .upload(upload_file) + ?.upload(upload_file) .catch(err => { throw new Error(`${err} upload error`); }); diff --git a/libs/datasource/jwt/src/adapter/yjs/block.ts b/libs/datasource/jwt/src/yjs/block.ts similarity index 95% rename from libs/datasource/jwt/src/adapter/yjs/block.ts rename to libs/datasource/jwt/src/yjs/block.ts index 3f2b756799..513016f90e 100644 --- a/libs/datasource/jwt/src/adapter/yjs/block.ts +++ b/libs/datasource/jwt/src/yjs/block.ts @@ -5,8 +5,8 @@ import { transact, } from 'yjs'; -import { BlockItem, BlockTypes } from '../../types'; -import { BlockInstance, BlockListener, HistoryManager } from '../index'; +import { BlockItem, BlockTypes } from '../types'; +import { BlockInstance, BlockListener, HistoryManager } from './types'; import { YjsHistoryManager } from './history'; import { ChildrenListenerHandler, ContentListenerHandler } from './listener'; @@ -34,7 +34,7 @@ type YjsBlockInstanceProps = { export class YjsBlockInstance implements BlockInstance { private readonly _id: string; private readonly _block: YMap; - private readonly _binary?: YArray; + private readonly _binary: YArray | undefined; private readonly _children: YArray; private readonly _setBlock: ( id: string, @@ -48,8 +48,7 @@ export class YjsBlockInstance implements BlockInstance { private readonly _childrenListeners: Map; private readonly _contentListeners: Map; - // eslint-disable-next-line @typescript-eslint/naming-convention - _childrenMap: Map; + private _childrenMap: Map; constructor(props: YjsBlockInstanceProps) { this._id = props.id; @@ -184,7 +183,9 @@ export class YjsBlockInstance implements BlockInstance { } hasChildren(id: string): boolean { - if (this.children.includes(id)) return true; + if (this.children.includes(id)) { + return true; + } return this.getChildren().some(block => block.hasChildren(id)); } @@ -263,7 +264,9 @@ export class YjsBlockInstance implements BlockInstance { break; } } - if (id) failed.push(id); + if (id) { + failed.push(id); + } } this._childrenMap = getMapFromYArray(this._children); diff --git a/libs/datasource/jwt/src/adapter/yjs/gatekeeper.ts b/libs/datasource/jwt/src/yjs/gatekeeper.ts similarity index 95% rename from libs/datasource/jwt/src/adapter/yjs/gatekeeper.ts rename to libs/datasource/jwt/src/yjs/gatekeeper.ts index 7e02c5a09e..9acf1becf5 100644 --- a/libs/datasource/jwt/src/adapter/yjs/gatekeeper.ts +++ b/libs/datasource/jwt/src/yjs/gatekeeper.ts @@ -32,7 +32,7 @@ export class GateKeeper { return creator === this._userId || !!this._common.get(block_id); } - checkDeleteLists(block_ids: string[]) { + checkDeleteLists(block_ids: string[]): [string[], string[]] { const success = []; const fail = []; for (const block_id of block_ids) { diff --git a/libs/datasource/jwt/src/adapter/yjs/history.ts b/libs/datasource/jwt/src/yjs/history.ts similarity index 95% rename from libs/datasource/jwt/src/adapter/yjs/history.ts rename to libs/datasource/jwt/src/yjs/history.ts index 6739cf9a50..5c6f5c4001 100644 --- a/libs/datasource/jwt/src/adapter/yjs/history.ts +++ b/libs/datasource/jwt/src/yjs/history.ts @@ -1,10 +1,11 @@ import { Map as YMap, UndoManager } from 'yjs'; -import { HistoryCallback, HistoryManager } from '../../adapter'; +import { HistoryCallback, HistoryManager } from './types'; type StackItem = UndoManager['undoStack'][0]; export class YjsHistoryManager implements HistoryManager { + // @ts-ignore private readonly _blocks: YMap; private readonly _historyManager: UndoManager; private readonly _pushListeners: Map>; @@ -56,7 +57,7 @@ export class YjsHistoryManager implements HistoryManager { } break(): void { - // this.#history_manager. + // this._historyManager. } undo(): Map | undefined { diff --git a/libs/datasource/jwt/src/adapter/yjs/index.ts b/libs/datasource/jwt/src/yjs/index.ts similarity index 95% rename from libs/datasource/jwt/src/adapter/yjs/index.ts rename to libs/datasource/jwt/src/yjs/index.ts index ec201c2d84..7d0f30e4e3 100644 --- a/libs/datasource/jwt/src/adapter/yjs/index.ts +++ b/libs/datasource/jwt/src/yjs/index.ts @@ -18,15 +18,15 @@ import { transact, } from 'yjs'; +import { BlockItem, BlockTypes } from '../types'; +import { getLogger, sha3, sleep } from '../utils'; import { AsyncDatabaseAdapter, BlockListener, ChangedStateKeys, Connectivity, HistoryManager, -} from '../../adapter'; -import { BlockItem, BlockTypes } from '../../types'; -import { getLogger, sha3, sleep } from '../../utils'; +} from './types'; import { YjsRemoteBinaries } from './binary'; import { YjsBlockInstance } from './block'; @@ -40,6 +40,7 @@ import { import { YjsProvider } from './provider'; declare const JWT_DEV: boolean; +// @ts-ignore const logger = getLogger('BlockDB:yjs'); type ConnectivityListener = ( @@ -54,7 +55,7 @@ type YjsProviders = { gatekeeper: GateKeeper; connListener: { listeners?: ConnectivityListener }; userId: string; - remoteToken?: string; // remote storage token + remoteToken: string | undefined; // remote storage token }; const _yjsDatabaseInstance = new Map(); @@ -70,8 +71,8 @@ async function _initYjsDatabase( workspace: string, options: { userId: string; - token?: string; - provider?: Record; + token?: string | undefined; + provider?: Record | undefined; } ): Promise { if (_asyncInitLoading.has(workspace)) { @@ -243,9 +244,10 @@ export class YjsAdapter implements AsyncDatabaseAdapter { typeof updated === 'number' && updated + 1000 * 10 > Date.now() ) { - if (!editing_mapping[editing]) + if (!editing_mapping[editing]) { editing_mapping[editing] = []; - editing_mapping[editing].push(userId); + } + editing_mapping[editing]?.push(userId); } } listener( @@ -338,7 +340,7 @@ export class YjsAdapter implements AsyncDatabaseAdapter { ], }); const [file] = (await fromEvent(handles)) as File[]; - const binary = await file.arrayBuffer(); + const binary = await file?.arrayBuffer(); // await this._provider.idb.clearData(); const doc = new Doc({ autoLoad: true, shouldLoad: true }); let updated = 0; @@ -348,7 +350,9 @@ export class YjsAdapter implements AsyncDatabaseAdapter { updated += 1; }); setInterval(() => { - if (updated > 0) updated -= 1; + if (updated > 0) { + updated -= 1; + } }, 500); const update_check = new Promise(resolve => { @@ -362,8 +366,10 @@ export class YjsAdapter implements AsyncDatabaseAdapter { }); // await new IndexedDBProvider(this._provider.idb.name, doc) // .whenSynced; - applyUpdate(doc, new Uint8Array(binary)); - await update_check; + if (binary) { + applyUpdate(doc, new Uint8Array(binary)); + await update_check; + } console.log('load success'); }, parse: () => this._doc.toJSON(), @@ -409,8 +415,8 @@ export class YjsAdapter implements AsyncDatabaseAdapter { async createBlock( options: Pick, 'type' | 'flavor'> & { - uuid?: string; - binary?: ArrayBufferLike; + uuid: string | undefined; + binary: ArrayBufferLike | undefined; } ): Promise { const uuid = options.uuid || `affine${nanoid(16)}`; @@ -481,7 +487,9 @@ export class YjsAdapter implements AsyncDatabaseAdapter { async getBlock(id: string): Promise { const block_instance = this.get_block_sync(id); - if (block_instance) return block_instance; + if (block_instance) { + return block_instance; + } const block = this._blocks.get(id); if (block && block.get('type') === BlockTypes.binary) { const binary = await this._binaries.get( @@ -540,7 +548,9 @@ export class YjsAdapter implements AsyncDatabaseAdapter { let uploaded: Promise | undefined; if (!block.size) { const content = item.content[INTO_INNER](); - if (!content) return reject(); + if (!content) { + return reject(); + } const children = new YArray(); children.push(item.children); diff --git a/libs/datasource/jwt/src/adapter/yjs/listener.ts b/libs/datasource/jwt/src/yjs/listener.ts similarity index 98% rename from libs/datasource/jwt/src/adapter/yjs/listener.ts rename to libs/datasource/jwt/src/yjs/listener.ts index 36c203bbce..a109862b20 100644 --- a/libs/datasource/jwt/src/adapter/yjs/listener.ts +++ b/libs/datasource/jwt/src/yjs/listener.ts @@ -1,7 +1,8 @@ import { produce } from 'immer'; import { debounce } from 'ts-debounce'; import { YEvent } from 'yjs'; -import { BlockListener, ChangedStateKeys } from '../index'; + +import { BlockListener, ChangedStateKeys } from './types'; let listener_suspend = false; diff --git a/libs/datasource/jwt/src/adapter/yjs/operation.ts b/libs/datasource/jwt/src/yjs/operation.ts similarity index 93% rename from libs/datasource/jwt/src/adapter/yjs/operation.ts rename to libs/datasource/jwt/src/yjs/operation.ts index a8dfdaffa4..8d1bac4723 100644 --- a/libs/datasource/jwt/src/adapter/yjs/operation.ts +++ b/libs/datasource/jwt/src/yjs/operation.ts @@ -6,6 +6,7 @@ import { Text as YText, } from 'yjs'; +import { ChildrenListenerHandler, ContentListenerHandler } from './listener'; import { ArrayOperation, BaseTypes, @@ -16,21 +17,29 @@ import { Operable, TextOperation, TextToken, -} from '../index'; -import { ChildrenListenerHandler, ContentListenerHandler } from './listener'; +} from './types'; const INTO_INNER = Symbol('INTO_INNER'); export const DO_NOT_USE_THIS_OR_YOU_WILL_BE_FIRED_SYMBOL_INTO_INNER: typeof INTO_INNER = INTO_INNER; -function auto_get(root: ContentOperation, key: string): unknown | undefined { +function auto_get( + root: ContentOperation, + key: string | undefined +): unknown | undefined { const array = root.asArray(); - if (array && !Number.isNaN(Number(key))) return array.get(Number(key)); + if (array && !Number.isNaN(Number(key))) { + return array.get(Number(key)); + } const map = root.asMap(); - if (map) return map.get(key); + if (map && key) { + return map.get(key); + } const text = root.asText(); - if (text) return text.toString(); + if (text) { + return text.toString(); + } console.error('auto_get unknown root', root, key); return undefined; } @@ -150,7 +159,9 @@ export class YjsContentOperation implements ContentOperation { if (root instanceof YjsContentOperation) { if (path.length === 1) { const [key] = path; - if (key) return auto_set(root, key, data); + if (key) { + return auto_set(root, key, data); + } console.error('autoSet unknown path', root, path, data); return; } @@ -191,6 +202,7 @@ export class YjsContentOperation implements ContentOperation { } // eslint-disable-next-line @typescript-eslint/naming-convention + // @ts-ignore private toJSON() { return this._content.toJSON(); } @@ -283,7 +295,9 @@ class YjsArrayOperation get(index: number): Operable | undefined { const content = this._arrayContent.get(index); - if (content) return this.to_operable(content); + if (content) { + return this.to_operable(content); + } return undefined; } @@ -368,7 +382,9 @@ class YjsMapOperation set(key: string, value: Operable): void { if (value instanceof YjsContentOperation) { const content = value[INTO_INNER](); - if (content) this._mapContent.set(key, content as unknown as T); + if (content) { + this._mapContent.set(key, content as unknown as T); + } } else { this._mapContent.set(key, value as T); } @@ -376,7 +392,9 @@ class YjsMapOperation get(key: string): Operable | undefined { const content = this._mapContent.get(key); - if (content) return this.to_operable(content); + if (content) { + return this.to_operable(content); + } return undefined; } diff --git a/libs/datasource/jwt/src/adapter/yjs/provider.ts b/libs/datasource/jwt/src/yjs/provider.ts similarity index 97% rename from libs/datasource/jwt/src/adapter/yjs/provider.ts rename to libs/datasource/jwt/src/yjs/provider.ts index ba1835cc52..99a09fd69c 100644 --- a/libs/datasource/jwt/src/adapter/yjs/provider.ts +++ b/libs/datasource/jwt/src/yjs/provider.ts @@ -7,13 +7,13 @@ import { WebsocketProvider, } from '@toeverything/datasource/jwt-rpc'; -import { Connectivity } from '../../adapter'; -import { BucketBackend } from '../../types'; +import { BucketBackend } from '../types'; +import { Connectivity } from './types'; type YjsDefaultInstances = { awareness: Awareness; doc: Doc; - token?: string; + token?: string | undefined; workspace: string; emitState: (connectivity: Connectivity) => void; }; diff --git a/libs/datasource/jwt/src/adapter/index.ts b/libs/datasource/jwt/src/yjs/types.ts similarity index 97% rename from libs/datasource/jwt/src/adapter/index.ts rename to libs/datasource/jwt/src/yjs/types.ts index 2d7176e6be..b23c685e5c 100644 --- a/libs/datasource/jwt/src/adapter/index.ts +++ b/libs/datasource/jwt/src/yjs/types.ts @@ -139,8 +139,8 @@ interface AsyncDatabaseAdapter { reload(): void; createBlock( options: Pick, 'type' | 'flavor'> & { - binary?: ArrayBuffer; - uuid?: string; + binary: ArrayBuffer | undefined; + uuid: string | undefined; } ): Promise>; getBlock(id: string): Promise | undefined>; @@ -184,8 +184,6 @@ export const getDataExporter = () => { return { importData, exportData, hasExporter, installExporter }; }; -export { YjsAdapter } from './yjs'; -export type { YjsContentOperation, YjsInitOptions } from './yjs'; export type { AsyncDatabaseAdapter, BlockPosition, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 802d964374..e9f182f211 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -184,7 +184,7 @@ importers: yjs: ^13.5.41 dependencies: authing-js-sdk: 4.23.35 - firebase-admin: 11.0.1_@firebase+app-types@0.7.0 + firebase-admin: 11.0.1 lib0: 0.2.52 lru-cache: 7.13.2 nanoid: 4.0.0 @@ -566,6 +566,9 @@ importers: dependencies: ffc-js-client-side-sdk: 1.1.5 + libs/datasource/jwst/pkg: + specifiers: {} + libs/datasource/jwt: specifiers: '@types/debug': ^4.1.7 @@ -583,7 +586,7 @@ importers: idb-keyval: ^6.2.0 immer: ^9.0.15 lib0: ^0.2.52 - lru-cache: ^7.13.2 + lru-cache: ^7.14.0 nanoid: ^4.0.0 sha3: ^2.1.4 sift: ^16.0.0 @@ -614,7 +617,7 @@ importers: file-selector: 0.6.0 flexsearch: 0.7.21 lib0: 0.2.52 - lru-cache: 7.13.2 + lru-cache: 7.14.0 ts-debounce: 4.0.0 libs/datasource/jwt-rpc: @@ -3180,6 +3183,15 @@ packages: - utf-8-validate dev: true + /@firebase/auth-interop-types/0.1.6_@firebase+util@1.6.3: + resolution: {integrity: sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==} + peerDependencies: + '@firebase/app-types': 0.x + '@firebase/util': 1.x + dependencies: + '@firebase/util': 1.6.3 + dev: false + /@firebase/auth-interop-types/0.1.6_pbfwexsq7uf6mrzcwnikj3g37m: resolution: {integrity: sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==} peerDependencies: @@ -3188,6 +3200,7 @@ packages: dependencies: '@firebase/app-types': 0.7.0 '@firebase/util': 1.6.3 + dev: true /@firebase/auth-types/0.11.0_pbfwexsq7uf6mrzcwnikj3g37m: resolution: {integrity: sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw==} @@ -3223,6 +3236,19 @@ packages: '@firebase/util': 1.6.3 tslib: 2.4.0 + /@firebase/database-compat/0.2.4: + resolution: {integrity: sha512-VtsGixO5mTjNMJn6PwxAJEAR70fj+3blCXIdQKel3q+eYGZAfdqxox1+tzZDnf9NWBJpaOgAHPk3JVDxEo9NFQ==} + dependencies: + '@firebase/component': 0.5.17 + '@firebase/database': 0.13.4 + '@firebase/database-types': 0.9.12 + '@firebase/logger': 0.3.3 + '@firebase/util': 1.6.3 + tslib: 2.4.0 + transitivePeerDependencies: + - '@firebase/app-types' + dev: false + /@firebase/database-compat/0.2.4_@firebase+app-types@0.7.0: resolution: {integrity: sha512-VtsGixO5mTjNMJn6PwxAJEAR70fj+3blCXIdQKel3q+eYGZAfdqxox1+tzZDnf9NWBJpaOgAHPk3JVDxEo9NFQ==} dependencies: @@ -3234,6 +3260,7 @@ packages: tslib: 2.4.0 transitivePeerDependencies: - '@firebase/app-types' + dev: true /@firebase/database-types/0.9.10: resolution: {integrity: sha512-2ji6nXRRsY+7hgU6zRhUtK0RmSjVWM71taI7Flgaw+BnopCo/lDF5HSwxp8z7LtiHlvQqeRA3Ozqx5VhlAbiKg==} @@ -3248,6 +3275,19 @@ packages: '@firebase/app-types': 0.7.0 '@firebase/util': 1.6.3 + /@firebase/database/0.13.4: + resolution: {integrity: sha512-NW7bOoiaC4sJCj6DY/m9xHoFNa0CK32YPMCh6FiMweLCDQbOZM8Ql/Kn6yyuxCb7K7ypz9eSbRlCWQJsJRQjhg==} + dependencies: + '@firebase/auth-interop-types': 0.1.6_@firebase+util@1.6.3 + '@firebase/component': 0.5.17 + '@firebase/logger': 0.3.3 + '@firebase/util': 1.6.3 + faye-websocket: 0.11.4 + tslib: 2.4.0 + transitivePeerDependencies: + - '@firebase/app-types' + dev: false + /@firebase/database/0.13.4_@firebase+app-types@0.7.0: resolution: {integrity: sha512-NW7bOoiaC4sJCj6DY/m9xHoFNa0CK32YPMCh6FiMweLCDQbOZM8Ql/Kn6yyuxCb7K7ypz9eSbRlCWQJsJRQjhg==} dependencies: @@ -3259,6 +3299,7 @@ packages: tslib: 2.4.0 transitivePeerDependencies: - '@firebase/app-types' + dev: true /@firebase/firestore-compat/0.1.23_53yvy43rwpg2c45kgeszsxtrca: resolution: {integrity: sha512-QfcuyMAavp//fQnjSfCEpnbWi7spIdKaXys1kOLu7395fLr+U6ykmto1HUMCSz8Yus9cEr/03Ujdi2SUl2GUAA==} @@ -10332,12 +10373,12 @@ packages: semver-regex: 2.0.0 dev: true - /firebase-admin/11.0.1_@firebase+app-types@0.7.0: + /firebase-admin/11.0.1: resolution: {integrity: sha512-rL3wlZbi2Kb/KJgcmj1YHlD4ZhfmhfgRO2YJialxAllm0tj1IQea878hHuBLGmv4DpbW9t9nLvX9kddNR2Y65Q==} engines: {node: '>=14'} dependencies: '@fastify/busboy': 1.1.0 - '@firebase/database-compat': 0.2.4_@firebase+app-types@0.7.0 + '@firebase/database-compat': 0.2.4 '@firebase/database-types': 0.9.10 '@types/node': 18.0.1 jsonwebtoken: 8.5.1 @@ -13573,6 +13614,12 @@ packages: /lru-cache/7.13.2: resolution: {integrity: sha512-VJL3nIpA79TodY/ctmZEfhASgqekbT574/c4j3jn4bKXbSCnTTCH/KltZyvL2GlV+tGSMtsWyem8DCX7qKTMBA==} engines: {node: '>=12'} + dev: false + + /lru-cache/7.14.0: + resolution: {integrity: sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==} + engines: {node: '>=12'} + dev: true /lru-memoizer/2.1.4: resolution: {integrity: sha512-IXAq50s4qwrOBrXJklY+KhgZF+5y98PDaNo0gi/v2KQBFLyWr+JyFvijZXkGKjQj/h9c0OwoE+JZbwUXce76hQ==} From 8a95f6e05b8bb463ff870ac7cbd3ae9aba54462d Mon Sep 17 00:00:00 2001 From: CJSS Date: Tue, 23 Aug 2022 17:38:19 +0800 Subject: [PATCH 15/79] Update README and documentation (#314) * Update README.md Introduction update * Update README.md Sections updated: Stars Getting Started * Update README.md License section updated * Rename CONTRIBUTING.md to docs/CONTRIBUTING.md Move CONTRIBUTING to docs folder. * Rename CODE_OF_CONDUCT.md to docs/CODE_OF_CONDUCT.md Move CODE_OF_CONDUCT to docs folder. * Update CONTRIBUTING.md Title error * Update README.md Table of contents removed Useful links added * Update README.md Create your story moved and updated * Update README.md Useful links - added communities (removed FAQ) * Update README.md Fixed contribution and code of conduct links * Update CONTRIBUTING.md * Update CONTRIBUTING.md Labels link update * Create types-of-contributions.md * Update types-of-contributions.md README link fixed * Update types-of-contributions.md Punctuation * Update README.md Update useful links - added descriptions * chore: format * chore: format Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com> Co-authored-by: Whitewater --- README.md | 119 +++++------------- CODE_OF_CONDUCT.md => docs/CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md => docs/CONTRIBUTING.md | 12 +- docs/types-of-contributions.md | 31 +++++ 4 files changed, 70 insertions(+), 92 deletions(-) rename CODE_OF_CONDUCT.md => docs/CODE_OF_CONDUCT.md (100%) rename CONTRIBUTING.md => docs/CONTRIBUTING.md (84%) create mode 100644 docs/types-of-contributions.md diff --git a/README.md b/README.md index 19e0db1307..b2507efa5b 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,13 @@ AFFiNE.PRO
- The Next-Gen Knowledge Base to Replace Notion & Miro. + The Next-Gen Collaborative Knowledge Base

-Planning, Sorting and Creating all Together. Open-source, Privacy-First, and Free to use. +Open-source and privacy-first.
+A free replacement for Notion & Miro.

@@ -22,9 +23,10 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066 -[![affine.pro](https://img.shields.io/static/v1?label=live%20demo&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAhpJREFUWEdjZEACtnl3MxgY/0YzMjAaMzAwcCLLUYH9/T/D/7MM/5mXHp6kPANmHiOI4Zx9Xfg3C+tKBob/zlSwiAgjGPey/vkdvneq5luwA+zy7+yhn+Vwv+89NFHFhREU7IyM/6YT4WyqK/n/nymT0Tb/1mFGBkYbqptOhIH/Gf4fYbTLv/2NBgmOCOvBSr6DHPCfWNW0UEe2A2x1uRlakiXBbtpx6jND+7KXZLmPbAdURokzeJjxwi31rrzH8OX7P5IdQbYDtnUoMXBzMMEt7Fj2imH7qU/0cQBy8MNsPHL5K0P13Of0cQB68MNsJScaSI4CHk4mhq3tSnCf3n36k0FZmh3Mn7L+DcPqgx9ICgWSHeBpxsdQESUGtgRk+eqDH+H8O09/MiR3P6atA1qTJRlsdLnhPgYlPOQQCW96wPDi3R+iHUFSCKAHP8wydEeREg0kOQA9+JOgwR1qL8CQEygC9jWp0UCSA+aVysIT3JqDHxgmr38DtlRCiIVhZZ0CPNhB6QDkEGIA0Q4gZAkuxxFyBNEOQA7ml+/+MIQ1PUAxG1kelAhB6YMYQLQDCPmQUAjhcgxRDiDWcEKOxOYIohyQGyjCEGIvANaPLfhhBiNHA6hmBBXNhABRDgCV/aBQAAFQpYMrn4PUgNTCACiXEMoNRDmAkC8okR8UDhjYRumAN8sHvGMCSkAD2jUDOWDAO6ewbDQQ3XMAy/oxKownQR0AAAAASUVORK5CYII=&color=orange&message=→)](https://affine.pro) +[![affine.pro](https://img.shields.io/static/v1?label=live%20demo&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAhpJREFUWEdjZEACtnl3MxgY/0YzMjAaMzAwcCLLUYH9/T/D/7MM/5mXHp6kPANmHiOI4Zx9Xfg3C+tKBob/zlSwiAgjGPey/vkdvneq5luwA+zy7+yhn+Vwv+89NFHFhREU7IyM/6YT4WyqK/n/nymT0Tb/1mFGBkYbqptOhIH/Gf4fYbTLv/2NBgmOCOvBSr6DHPCfWNW0UEe2A2x1uRlakiXBbtpx6jND+7KXZLmPbAdURokzeJjxwi31rrzH8OX7P5IdQbYDtnUoMXBzMMEt7Fj2imH7qU/0cQBy8MNsPHL5K0P13Of0cQB68MNsJScaSI4CHk4mhq3tSnCf3n36k0FZmh3Mn7L+DcPqgx9ICgWSHeBpxsdQESUGtgRk+eqDH+H8O09/MiR3P6atA1qTJRlsdLnhPgYlPOQQCW96wPDi3R+iHUFSCKAHP8wydEeREg0kOQA9+JOgwR1qL8CQEygC9jWp0UCSA+aVysIT3JqDHxgmr38DtlRCiIVhZZ0CPNhB6QDkEGIA0Q4gZAkuxxFyBNEOQA7ml+/+MIQ1PUAxG1kelAhB6YMYQLQDCPmQUAjhcgxRDiDWcEKOxOYIohyQGyjCEGIvANaPLfhhBiNHA6hmBBXNhABRDgCV/aBQAAFQpYMrn4PUgNTCACiXEMoNRDmAkC8okR8UDhjYRumAN8sHvGMCSkAD2jUDOWDAO6ewbDQQ3XMAy/oxKownQR0AAAAASUVORK5CYII=&color=orange&message=→)](https://livedemo.affine.pro) [![stars](https://img.shields.io/github/stars/toeverything/AFFiNE.svg?style=flat&logo=github&colorB=red&label=stars)](https://github.com/toeverything/AFFiNE) [![All Contributors][all-contributors-badge]](#contributors) +
[![Node](https://img.shields.io/badge/node->=16.0-success)](https://www.typescriptlang.org/) [![React](https://img.shields.io/badge/TypeScript-4.7-3178c6)](https://www.typescriptlang.org/) [![React](https://img.shields.io/badge/React-18-61dafb)](https://reactjs.org/) @@ -35,11 +37,11 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066

  - +   - +   - +  

@@ -48,100 +50,53 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066

affine_screen

-# Stay Up-to-Date and Support Us +# :star: Support Us and Keep Updated :star: ![952cd7a5-70fe-48ab-b74f-23981d94d2c5](https://user-images.githubusercontent.com/79301703/182365526-df074c64-cee4-45f6-b8e0-b912f17332c6.gif) -# How to use +# Getting Started -

-🥳🥳🥳 Our web live demo is ready! 🥳🥳🥳 -

+[![affine.pro](https://img.shields.io/static/v1?label=Try%20it%20Online&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAhpJREFUWEdjZEACtnl3MxgY/0YzMjAaMzAwcCLLUYH9/T/D/7MM/5mXHp6kPANmHiOI4Zx9Xfg3C+tKBob/zlSwiAgjGPey/vkdvneq5luwA+zy7+yhn+Vwv+89NFHFhREU7IyM/6YT4WyqK/n/nymT0Tb/1mFGBkYbqptOhIH/Gf4fYbTLv/2NBgmOCOvBSr6DHPCfWNW0UEe2A2x1uRlakiXBbtpx6jND+7KXZLmPbAdURokzeJjxwi31rrzH8OX7P5IdQbYDtnUoMXBzMMEt7Fj2imH7qU/0cQBy8MNsPHL5K0P13Of0cQB68MNsJScaSI4CHk4mhq3tSnCf3n36k0FZmh3Mn7L+DcPqgx9ICgWSHeBpxsdQESUGtgRk+eqDH+H8O09/MiR3P6atA1qTJRlsdLnhPgYlPOQQCW96wPDi3R+iHUFSCKAHP8wydEeREg0kOQA9+JOgwR1qL8CQEygC9jWp0UCSA+aVysIT3JqDHxgmr38DtlRCiIVhZZ0CPNhB6QDkEGIA0Q4gZAkuxxFyBNEOQA7ml+/+MIQ1PUAxG1kelAhB6YMYQLQDCPmQUAjhcgxRDiDWcEKOxOYIohyQGyjCEGIvANaPLfhhBiNHA6hmBBXNhABRDgCV/aBQAAFQpYMrn4PUgNTCACiXEMoNRDmAkC8okR8UDhjYRumAN8sHvGMCSkAD2jUDOWDAO6ewbDQQ3XMAy/oxKownQR0AAAAASUVORK5CYII=&message=%E2%86%92&style=for-the-badge)](https://affine.pro) No installation or registration required! Head over to our website and try it out now. -

-Start to play with AFFiNE web version on our landing page: -

- -

- check_live_demo -

- -If you have experience in front-end development, you may wish to refer to our [documentation](https://docs.affine.pro/affine/basic-documentation/contribute-to-affine) to learn more about deploying your own version or contributing further to development. -Also, thanks to Lee who has made a [desktop build with Tauri](https://github.com/m1911star/affine-client) for you to try out. -Please notice that AFFiNE is still under Alpha stage and is not ready for production use. - -# Table of contents - -- [Stay Up-to-Date and Support Us](#stay-up-to-date-and-support-us) -- [How to Use](#how-to-use) -- [Table of contents](#table-of-contents) - - [Shape your page](#shape-your-page) - - [Plan your task](#plan-your-task) - - [Sort your knowledge](#sort-your-knowledge) - - [Create your story](#create-your-story) -- [Documentation](#documentation) - - [Getting Started with development](#getting-started-with-development) -- [Roadmap](#roadmap) -- [Releases](#releases) -- [Feature requests](#feature-requests) -- [FAQ](#faq) -- [The Philosophy of AFFiNE](#the-philosophy-of-affine) -- [Community](#community) -- [Contributors](#contributors) -- [Acknowledgments](#acknowledgments) -- [License](#license) - -## Shape your page - -![546163d6-4c39-4128-ae7f-55d59bc3b76b](https://user-images.githubusercontent.com/79301703/182365611-b0ba3690-21c0-4d9b-bfbc-0bc15da05aeb.gif) - -## Plan your task - -![41a7b3a4-32f2-4d18-ac6b-57d1e1fda753](https://user-images.githubusercontent.com/79301703/182366553-1f6558a7-f17b-4611-ab95-aea3ec997154.gif) - -## Sort your knowledge - -![c9e1ff46-cec2-411b-b89d-6727a5e6f6c3](https://user-images.githubusercontent.com/79301703/182366602-08e44d28-a031-4097-9904-52fb9b1e9e17.gif) +Want to deploy it yourself? AFFiNE can run just about anywhere. Check our +[documentation](#documentation) +for more information. +

+⚠️ Please note that AFFiNE is still under active development and is not yet ready for production use. ⚠️ ## Create your story -We want your data always to be yours, without any sacrifice to your accessibility. Your data is always stored local first, yet we support real-time collaboration on a peer-to-peer basis. We don't think "privacy-first" is a good excuse for not supporting modern web features. -And when it comes to collaboration, these features are not just necessarily for teams -- you can take and insert pictures on your phone, edit them from your desktop, and then share them with your collaborators. -Affine is fully built with web technologies to ensure consistency and accessibility on Mac, Windows and Linux. The local file system support will be available when version 0.0.1beta is released. +There can be more than Notion and Miro. AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use, built with web technologies to ensure consistency and accessibility on Mac, Windows and Linux. We want your data always to be yours, without any sacrifice to your accessibility. Your data is always stored local first, with full support for real-time collaboration through peer-to-peer technology. We don't think "privacy-first" is a good excuse for not supporting modern web features. +And when it comes to collaboration, these features are not just necessarily for teams - you can take and insert pictures on your phone, edit them from your desktop, and then share them with your collaborators. -# Documentation +### Shape your page -AFFiNE is not yet ready for production use. For installation, you may check how to build or deploy AFFiNE from our [quick-start](https://docs.affine.pro/affine/basic-documentation/contribute-to-affine/quick-start) guide. Alternatively, you can view our [full documentation](https://docs.affine.pro/affine/). +![546163d6-4c39-4128-ae7f-55d59bc3b76b](https://user-images.githubusercontent.com/79301703/182365611-b0ba3690-21c0-4d9b-bfbc-0bc15da05aeb.gif) -## Getting Started with development +### Plan your task -Please view the path Contribute-to-AFFiNE/Software-Contributions/Quick-Start in the documentation. +![41a7b3a4-32f2-4d18-ac6b-57d1e1fda753](https://user-images.githubusercontent.com/79301703/182366553-1f6558a7-f17b-4611-ab95-aea3ec997154.gif) -# Roadmap +### Sort your knowledge -Yes! Permanent storage, collaboration, stable release is planned! Check it [here](https://github.com/toeverything/AFFiNE/issues/293) +![c9e1ff46-cec2-411b-b89d-6727a5e6f6c3](https://user-images.githubusercontent.com/79301703/182366602-08e44d28-a031-4097-9904-52fb9b1e9e17.gif) -# Releases +# Useful Links -Get our latest [release notes](https://github.com/toeverything/AFFiNE/wiki) from here. +- [AFFiNE Documentation](https://docs.affine.pro/affine/) - More detailed documentation on how to use and develop with AFFiNE -# Feature requests +- [Feature Roadmap](https://github.com/toeverything/AFFiNE/issues/293) - Looking for a feature? It might already be planned for release - you can check here +- [Release Notes](https://github.com/toeverything/AFFiNE/wiki) - Find out what changes we are making and how we are improving AFFiNE -Please go to [feature requests](https://github.com/toeverything/AFFiNE/issues). +- [Contributing Guide](/docs/CONTRIBUTING.md) - Want to help improve AFFiNE? You might not even need to write a line of code. Find out how you can contribute. +- [Code of Conduct](/docs/CODE_OF_CONDUCT.md) - How we promote and maintain a harassment-free experience for everyone in our community. -# FAQ - -Get quick help on [Telegram](https://t.me/affineworkos) or [Discord](https://discord.gg/yz6tGVsf5p) and join our community of developers and contributors. - -Our latest news can be found on [Twitter](https://twitter.com/AffineOfficial), [Medium](https://medium.com/@affineworkos) and the [AFFiNE Blog](https://blog.affine.pro/). +- AFFiNE Communities: [Discord](https://discord.gg/yz6tGVsf5p) | [Telegram](https://t.me/affineworkos) | [Twitter](https://twitter.com/AffineOfficial) | + [Medium](https://medium.com/@affineworkos) | [AFFiNE Blog](https://blog.affine.pro) # Contact Us -You may contact us by emailing to: contact@toeverything.info +Feel free to send us an email: contact@toeverything.info # The Philosophy of AFFiNE @@ -186,12 +141,6 @@ We would also like to give thanks to open-source projects that make affine possi Thanks a lot to the community for providing such powerful and simple libraries, so that we can focus more on the implementation of the product logic, and we hope that in the future our projects will also provide a more easy-to-use knowledge base for everyone. -# Community - -For help, discussion about best practices, or any other conversation that would benefit from being searchable: - -[Discuss AFFiNE on GitHub](https://github.com/toeverything/AFFiNE/discussions) - # Contributors @@ -250,4 +199,4 @@ For help, discussion about best practices, or any other conversation that would AFFiNE is distributed under the terms of MIT license. -See LICENSE for details. +See [LICENSE](/LICENSE) for details. diff --git a/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to docs/CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 84% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 7b7b63a1a5..cd21902653 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Welcome to ourcontributing guide +# Welcome to our contributing guide Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on our GitHub :sparkles:. @@ -10,7 +10,7 @@ Use the table of contents icon on the top left corner of this document to get to ## New contributor guide -To get an overview of the project, read the [README](README.md). Here are some resources to help you get started with open source contributions: +To get an overview of the project, read the [README](../README.md). Here are some resources to help you get started with open source contributions: - [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github) - [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git) @@ -19,19 +19,17 @@ To get an overview of the project, read the [README](README.md). Here are some r ## Getting started -To navigate our codebase with confidence, see [the introduction to working in the docs repository](/contributing/working-in-docs-repository.md) :confetti_ball:. For more information on how we write our markdown files, see [the GitHub Markdown reference](contributing/content-markup-reference.md). - -Check to see what [types of contributions](/contributing/types-of-contributions.md) we accept before making changes. Some of them don't even require writing a single line of code :sparkles:. +Check to see what [types of contributions](/types-of-contributions.md) we accept before making changes. Some of them don't even require writing a single line of code :sparkles:. ### Issues -#### Create a new issue +#### Create a new issue or feature request If you spot a problem, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/toeverything/AFFiNE/issues/new/choose). #### Solve an issue -Scan through our [existing issues](https://github.com/toeverything/AFFiNE/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See [Labels](/contributing/how-to-use-labels.md) for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. +Scan through our [existing issues](https://github.com/toeverything/AFFiNE/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See our [Labels](https://github.com/toeverything/AFFiNE/labels) for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. ### Make Changes diff --git a/docs/types-of-contributions.md b/docs/types-of-contributions.md new file mode 100644 index 0000000000..fd448200e9 --- /dev/null +++ b/docs/types-of-contributions.md @@ -0,0 +1,31 @@ +# Types of contributions :memo: + +You can contribute to AFFiNE in several ways. This repo is a place to discuss and collaborate on AFFiNE! + +### :mega: Discussions + +Discussions are where we have conversations. + +If you'd like help troubleshooting a docs PR you're working on, have a great new idea, or want to share something amazing you've learned in our docs, join us in [discussions](https://github.com/toeverything/AFFiNE/discussions). + +### :lady_beetle: Issues + +[Issues](https://docs.github.com/en/github/managing-your-work-on-github/about-issues) are used to track tasks that contributors can help with. If an issue has a triage label, we haven't reviewed it yet, and you shouldn't begin work on it. + +If you've found something in the content or the website that should be updated, search open issues to see if someone else has reported the same thing. If it's something new, open an issue using a [template](https://github.com/toeverything/AFFiNE/issues/new/choose). We'll use the issue to have a conversation about the problem you want to fix. + +### :hammer_and_wrench: Pull requests + +A [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) is a way to suggest changes in our repository. When we merge those changes, they should be deployed to the live site within 24 hours. :earth_africa: +You can [create a new pull request](https://github.com/toeverything/AFFiNE/compare) and view [current pull requests](https://github.com/toeverything/AFFiNE/pulls). + +### :question: Support + +We are a small team working hard to keep up with the documentation demands of a continuously changing product. +You may be able to find additional help and information on our social media platforms and groups - the links to these can be found in our [README](../README.md). + +### :earth_asia: Translations + +AFFiNE is internationalized and available in multiple languages. The source content in this repository is written in English. We integrate with an external localization platform to work with the community in localizing the English content. + +**We do not currently offer this feature**, but we hope to in the future. From b96d6c37f75407580309123699649fcc178a57e5 Mon Sep 17 00:00:00 2001 From: mitsuha Date: Tue, 23 Aug 2022 20:07:35 +0800 Subject: [PATCH 16/79] opti: 1.adjust eventlistener; --- .../src/pages/workspace/docs/Page.tsx | 4 +- .../workspace/docs/components/toc/TOC.tsx | 45 +++++++------------ .../workspace/docs/components/toc/index.ts | 2 +- .../utils/{getPageContentById.ts => toc.ts} | 27 +++++------ .../db-service/src/services/index.ts | 9 ---- .../db-service/src/services/workspace/toc.ts | 28 ------------ 6 files changed, 34 insertions(+), 81 deletions(-) rename apps/ligo-virgo/src/pages/workspace/docs/utils/{getPageContentById.ts => toc.ts} (67%) delete mode 100644 libs/datasource/db-service/src/services/workspace/toc.ts diff --git a/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx b/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx index 6d9d2fac90..0bbcfb5d75 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx @@ -23,7 +23,7 @@ import { useFlag } from '@toeverything/datasource/feature-flags'; import { CollapsiblePageTree } from './collapsible-page-tree'; import { Tabs } from './components/tabs'; import { TabMap, TAB_TITLE } from './components/tabs/Tabs'; -import { TOC } from './components/toc'; +import { Toc } from './components/toc'; import { WorkspaceName } from './workspace-name'; type PageProps = { @@ -92,7 +92,7 @@ export function Page(props: PageProps) { )} {activeTab === TabMap.get(TAB_TITLE.TOC).value && ( - TOC + TOC )} diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index b2c0aa693e..513e2913a6 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -1,6 +1,5 @@ import { BlockEditor } from '@toeverything/components/editor-core'; import { styled } from '@toeverything/components/ui'; -import { services } from '@toeverything/datasource/db-service'; import type { ReactNode } from 'react'; import { createContext, @@ -12,12 +11,9 @@ import { import { useParams } from 'react-router'; import { BLOCK_TYPES, - getPageContentById, -} from '../../utils/getPageContentById'; - -const StyledTOC = styled('div')(() => { - return {}; -}); + getContentByAsyncBlocks, + getPageTOC, +} from '../../utils/toc'; const StyledTOCItem = styled('a')<{ type?: string; isActive?: boolean }>( ({ type, isActive }) => { @@ -120,49 +116,42 @@ const renderTOCContent = tocDataSource => { ); }; -export const TOC = (props: Props) => { +export const Toc = (props: Props) => { const { editor } = props; - const { workspace_id, page_id } = useParams(); + const { page_id } = useParams(); const [tocDataSource, setTocDataSource] = useState([]); const [activeBlockId, setActiveBlockId] = useState('blockId'); const updateTocDataSource = useCallback(async () => { - const tocDataSource = await getPageContentById(editor, page_id); + const { children = [] } = + (await editor.queryByPageId(page_id))?.[0] || {}; + const asyncBlocks = (await editor.getBlockByIds(children)) || []; + const tocDataSource = getPageTOC( + asyncBlocks, + await getContentByAsyncBlocks(asyncBlocks, updateTocDataSource) + ); + setTocDataSource(tocDataSource); }, [editor, page_id]); useEffect(() => { - (async () => await updateTocDataSource())(); + (async () => { + await updateTocDataSource(); + })(); }, [updateTocDataSource]); - useEffect(() => { - let unobserve: () => void; - const observe = async () => { - unobserve = await services.api.tocService.observe( - { workspace: workspace_id, pageId: page_id }, - updateTocDataSource - ); - }; - void observe(); - - return () => { - unobserve?.(); - }; - }, [updateTocDataSource, workspace_id]); - const onClick = async (blockId?: string) => { if (blockId === activeBlockId) { return; } - console.log(blockId); setActiveBlockId(blockId); await editor.scrollManager.scrollIntoViewByBlockId(blockId); }; return ( - {renderTOCContent(tocDataSource)} +
{renderTOCContent(tocDataSource)}
); }; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts index e603af8242..1e45e9bd09 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts @@ -1 +1 @@ -export { TOC } from './TOC'; +export { Toc } from './Toc'; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts similarity index 67% rename from apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts rename to apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts index b1d16cb9d6..8331b0726d 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/utils/getPageContentById.ts +++ b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts @@ -1,4 +1,4 @@ -import type { BlockEditor } from '@toeverything/components/editor-core'; +import { AsyncBlock } from '@toeverything/components/editor-core'; export const BLOCK_TYPES = { GROUP: 'group', @@ -7,23 +7,29 @@ export const BLOCK_TYPES = { HEADING3: 'heading3', }; -const getContentByAsyncBlocks = async (asyncBlocks = []) => { +/* 😞😞sorry, I don't know how to define unlimited dimensions array */ +const getContentByAsyncBlocks = async ( + asyncBlocks: AsyncBlock[] = [], + callback: () => void +): Promise => { /* maybe should recast it to tail recursion */ return await Promise.all( - asyncBlocks.map(async asyncBlock => { + asyncBlocks.map(async (asyncBlock: AsyncBlock) => { const asyncBlocks = await asyncBlock.children(); if (asyncBlocks?.length) { - return getContentByAsyncBlocks(asyncBlocks); + return getContentByAsyncBlocks(asyncBlocks, callback); } - const { id, type } = asyncBlock; + /* get update notice */ + asyncBlock.onUpdate(callback); + const { id, type } = asyncBlock; if (Object.values(BLOCK_TYPES).includes(type)) { const properties = await asyncBlock.getProperties(); return { - id: id, + id, type, text: properties?.text?.value?.[0]?.text || '', }; @@ -34,12 +40,7 @@ const getContentByAsyncBlocks = async (asyncBlocks = []) => { ); }; -const getPageContentById = async (editor: BlockEditor, pageId: string) => { - const { children = [] } = (await editor.queryByPageId(pageId))?.[0] || {}; - const asyncBlocks = (await editor.getBlockByIds(children)) || []; - - const tocContents = await getContentByAsyncBlocks(asyncBlocks); - +const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents) => { return tocContents .reduce((tocGroupContent, tocContent, index) => { const { id, type } = asyncBlocks[index]; @@ -61,4 +62,4 @@ const getPageContentById = async (editor: BlockEditor, pageId: string) => { .filter(Boolean); }; -export { getPageContentById }; +export { getPageTOC, getContentByAsyncBlocks }; diff --git a/libs/datasource/db-service/src/services/index.ts b/libs/datasource/db-service/src/services/index.ts index c39119fe68..315ee84496 100644 --- a/libs/datasource/db-service/src/services/index.ts +++ b/libs/datasource/db-service/src/services/index.ts @@ -5,7 +5,6 @@ import { Database } from './database'; import { EditorBlock } from './editor-block'; import { FileService } from './file'; import { PageTree } from './workspace/page-tree'; -import { TOC } from './workspace/toc'; import { UserConfig } from './workspace/user-config'; export { @@ -49,7 +48,6 @@ export interface DbServicesMap { userConfig: UserConfig; file: FileService; commentService: CommentService; - tocService: TOC; } interface RegisterDependencyConfigWithName extends RegisterDependencyConfig { @@ -78,13 +76,6 @@ const dbServiceConfig: RegisterDependencyConfigWithName[] = [ value: PageTree, dependencies: [{ token: Database }], }, - { - type: 'class', - callName: 'tocService', - token: TOC, - value: TOC, - dependencies: [{ token: Database }], - }, { type: 'class', callName: 'userConfig', diff --git a/libs/datasource/db-service/src/services/workspace/toc.ts b/libs/datasource/db-service/src/services/workspace/toc.ts deleted file mode 100644 index 16bec3da18..0000000000 --- a/libs/datasource/db-service/src/services/workspace/toc.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ServiceBaseClass } from '../base'; -import { ReturnUnobserve } from '../database/observer'; -import { ObserveCallback } from './page-tree'; - -export class TOC extends ServiceBaseClass { - private onActivePageChange?: () => void; - - async observe( - { workspace, pageId }: { workspace: string; pageId: string }, - callback: ObserveCallback - ): Promise { - // not only use observe, but also addChildrenListener is OK 🎉🎉🎉 - // const pageBlock = await this.getBlock(workspace, pageId); - // - // this.onActivePageChange?.(); - // pageBlock?.addChildrenListener('onPageChildrenChange', () => { - // callback(); - // }); - // - // this.onActivePageChange = () => pageBlock?.removeChildrenListener('onPageChildrenChange'); - - const unobserve = await this._observe(workspace, pageId, callback); - - return () => { - unobserve(); - }; - } -} From 595a29db740769bab14fa6495ebaf27466c877a0 Mon Sep 17 00:00:00 2001 From: CJSS Date: Tue, 23 Aug 2022 20:30:47 +0800 Subject: [PATCH 17/79] Update CONTRIBUTING.md (#316) Fixed types of contributions link --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index cd21902653..94806e00f8 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -19,7 +19,7 @@ To get an overview of the project, read the [README](../README.md). Here are som ## Getting started -Check to see what [types of contributions](/types-of-contributions.md) we accept before making changes. Some of them don't even require writing a single line of code :sparkles:. +Check to see what [types of contributions](types-of-contributions.md) we accept before making changes. Some of them don't even require writing a single line of code :sparkles:. ### Issues From 85838c77a101cad77941ba2c4f3b3f13ff462ca0 Mon Sep 17 00:00:00 2001 From: mitsuha Date: Tue, 23 Aug 2022 21:25:38 +0800 Subject: [PATCH 18/79] opti: 1.adjust eventlistener; --- .../workspace/docs/components/toc/TOC.tsx | 15 +++- .../src/pages/workspace/docs/utils/toc.ts | 79 +++++++++++++------ 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index 513e2913a6..be567780f7 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -11,8 +11,10 @@ import { import { useParams } from 'react-router'; import { BLOCK_TYPES, + destroyEventList, getContentByAsyncBlocks, getPageTOC, + type TocType, } from '../../utils/toc'; const StyledTOCItem = styled('a')<{ type?: string; isActive?: boolean }>( @@ -119,19 +121,24 @@ const renderTOCContent = tocDataSource => { export const Toc = (props: Props) => { const { editor } = props; const { page_id } = useParams(); - const [tocDataSource, setTocDataSource] = useState([]); - const [activeBlockId, setActiveBlockId] = useState('blockId'); + const [tocDataSource, setTocDataSource] = useState([]); + const [activeBlockId, setActiveBlockId] = useState(''); + const [blockEventListeners, setBlockEventListeners] = useState([]); const updateTocDataSource = useCallback(async () => { + destroyEventList(blockEventListeners); + const { children = [] } = (await editor.queryByPageId(page_id))?.[0] || {}; const asyncBlocks = (await editor.getBlockByIds(children)) || []; - const tocDataSource = getPageTOC( + const { tocContents, eventListeners } = await getContentByAsyncBlocks( asyncBlocks, - await getContentByAsyncBlocks(asyncBlocks, updateTocDataSource) + updateTocDataSource ); + const tocDataSource = getPageTOC(asyncBlocks, tocContents); setTocDataSource(tocDataSource); + setBlockEventListeners(eventListeners); }, [editor, page_id]); useEffect(() => { diff --git a/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts index 8331b0726d..2ef9a39032 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts +++ b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts @@ -1,5 +1,11 @@ import { AsyncBlock } from '@toeverything/components/editor-core'; +export type TocType = { + id: string; + type: string; + text: string; +}; + export const BLOCK_TYPES = { GROUP: 'group', HEADING1: 'heading1', @@ -11,36 +17,51 @@ export const BLOCK_TYPES = { const getContentByAsyncBlocks = async ( asyncBlocks: AsyncBlock[] = [], callback: () => void -): Promise => { - /* maybe should recast it to tail recursion */ - return await Promise.all( - asyncBlocks.map(async (asyncBlock: AsyncBlock) => { - const asyncBlocks = await asyncBlock.children(); +): Promise<{ + tocContents: any[]; + eventListeners: (() => void | undefined)[]; +}> => { + const eventListeners = []; - if (asyncBlocks?.length) { - return getContentByAsyncBlocks(asyncBlocks, callback); - } + const collect = async (asyncBlocks): Promise => { + /* maybe should recast it to tail recursion */ + return await Promise.all( + asyncBlocks.map(async (asyncBlock: AsyncBlock) => { + const asyncBlocks = await asyncBlock.children(); - /* get update notice */ - asyncBlock.onUpdate(callback); + if (asyncBlocks?.length) { + return collect(asyncBlocks); + } - const { id, type } = asyncBlock; - if (Object.values(BLOCK_TYPES).includes(type)) { - const properties = await asyncBlock.getProperties(); + /* get update notice */ + const destroyHandler = asyncBlock.onUpdate(callback); - return { - id, - type, - text: properties?.text?.value?.[0]?.text || '', - }; - } + /* collect destroy handlers */ + eventListeners.push(destroyHandler); - return null; - }) - ); + const { id, type } = asyncBlock; + if (Object.values(BLOCK_TYPES).includes(type)) { + const properties = await asyncBlock.getProperties(); + + return { + id, + type, + text: properties?.text?.value?.[0]?.text || '', + }; + } + + return null; + }) + ); + }; + + return { + tocContents: await collect(asyncBlocks), + eventListeners, + }; }; -const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents) => { +const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents): TocType[] => { return tocContents .reduce((tocGroupContent, tocContent, index) => { const { id, type } = asyncBlocks[index]; @@ -62,4 +83,14 @@ const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents) => { .filter(Boolean); }; -export { getPageTOC, getContentByAsyncBlocks }; +const destroyEventList = ( + eventListeners: (() => void | undefined)[] = [] +): boolean => { + for (const eventListener of eventListeners) { + eventListener?.(); + } + + return true; +}; + +export { getPageTOC, getContentByAsyncBlocks, destroyEventList }; From ab1fe668b4fb37fc3dac349c39e39d50d9f8f80a Mon Sep 17 00:00:00 2001 From: mitsuha Date: Wed, 24 Aug 2022 01:54:10 +0800 Subject: [PATCH 19/79] opti: 1.adjust eventlistener; --- .../workspace/docs/components/toc/TOC.tsx | 20 ++++++++++--- .../src/pages/workspace/docs/utils/toc.ts | 30 ++++++++++++------- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index be567780f7..dd12469d90 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -14,6 +14,7 @@ import { destroyEventList, getContentByAsyncBlocks, getPageTOC, + listenerMap, type TocType, } from '../../utils/toc'; @@ -123,24 +124,35 @@ export const Toc = (props: Props) => { const { page_id } = useParams(); const [tocDataSource, setTocDataSource] = useState([]); const [activeBlockId, setActiveBlockId] = useState(''); - const [blockEventListeners, setBlockEventListeners] = useState([]); const updateTocDataSource = useCallback(async () => { - destroyEventList(blockEventListeners); + /* page listener: trigger update-notice when add new group */ + const pageAsyncBlock = (await editor.getBlockByIds([page_id]))?.[0]; + if (!listenerMap.has(pageAsyncBlock.id)) { + listenerMap.set( + pageAsyncBlock.id, + pageAsyncBlock.onUpdate(updateTocDataSource) + ); + } + /* block listener: trigger update-notice when change block content */ const { children = [] } = (await editor.queryByPageId(page_id))?.[0] || {}; const asyncBlocks = (await editor.getBlockByIds(children)) || []; - const { tocContents, eventListeners } = await getContentByAsyncBlocks( + const { tocContents } = await getContentByAsyncBlocks( asyncBlocks, updateTocDataSource ); + /* toc: flat content */ const tocDataSource = getPageTOC(asyncBlocks, tocContents); setTocDataSource(tocDataSource); - setBlockEventListeners(eventListeners); + + /* remove listener when unmount component */ + return destroyEventList; }, [editor, page_id]); + /* init toc and add page/block update-listener & unmount-listener */ useEffect(() => { (async () => { await updateTocDataSource(); diff --git a/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts index 2ef9a39032..b9a6e5dd56 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts +++ b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts @@ -13,16 +13,16 @@ export const BLOCK_TYPES = { HEADING3: 'heading3', }; +/* store page/block unmount-listener */ +export const listenerMap = new Map void>(); + /* 😞😞sorry, I don't know how to define unlimited dimensions array */ const getContentByAsyncBlocks = async ( asyncBlocks: AsyncBlock[] = [], callback: () => void ): Promise<{ tocContents: any[]; - eventListeners: (() => void | undefined)[]; }> => { - const eventListeners = []; - const collect = async (asyncBlocks): Promise => { /* maybe should recast it to tail recursion */ return await Promise.all( @@ -33,11 +33,14 @@ const getContentByAsyncBlocks = async ( return collect(asyncBlocks); } - /* get update notice */ - const destroyHandler = asyncBlock.onUpdate(callback); + /* add only once event listener for every block */ + if (!listenerMap.has(asyncBlock.id)) { + /* get update notice */ + const destroyHandler = asyncBlock.onUpdate(callback); - /* collect destroy handlers */ - eventListeners.push(destroyHandler); + /* collect destroy handlers */ + listenerMap.set(asyncBlock.id, destroyHandler); + } const { id, type } = asyncBlock; if (Object.values(BLOCK_TYPES).includes(type)) { @@ -57,10 +60,14 @@ const getContentByAsyncBlocks = async ( return { tocContents: await collect(asyncBlocks), - eventListeners, }; }; +/** + * get flat toc + * @param asyncBlocks + * @param tocContents + */ const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents): TocType[] => { return tocContents .reduce((tocGroupContent, tocContent, index) => { @@ -83,9 +90,10 @@ const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents): TocType[] => { .filter(Boolean); }; -const destroyEventList = ( - eventListeners: (() => void | undefined)[] = [] -): boolean => { +/* destroy page/block update-listener */ +const destroyEventList = (): boolean => { + const eventListeners = listenerMap.values(); + for (const eventListener of eventListeners) { eventListener?.(); } From a6848dda51ae409ffbd8fe1c550db1904f906031 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 23 Aug 2022 21:05:20 +0300 Subject: [PATCH 20/79] Correct a typo in README (#317) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2507efa5b..8789712501 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ That's why we are making AFFiNE. Some of the most important features are: - Data is always stored locally by default - CRDTs are applied so that peer-to-peer collaboration is possible. -We appreciate the ideas of Monday, Airtable, and Notion databases. They have inspired us and shaped our product, helping us get it right when it comes to task management. But we also do things differently. We don't like doing things again and again. It's easy to set a todo with Markdown, but then why do you need to repeat and recreate data for a kanban or other databases. This is the power of AFFiNE. With AFFiNE, every block group has infinite views, for you to keep your single source of data, a signle source of truth. +We appreciate the ideas of Monday, Airtable, and Notion databases. They have inspired us and shaped our product, helping us get it right when it comes to task management. But we also do things differently. We don't like doing things again and again. It's easy to set a todo with Markdown, but then why do you need to repeat and recreate data for a kanban or other databases. This is the power of AFFiNE. With AFFiNE, every block group has infinite views, for you to keep your single source of data, a single source of truth. We would like to give special thanks to the innovators and pioneers who greatly inspired us: From eb02e62a0e0b17e58104bfa5c3353837fc1e17d5 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 24 Aug 2022 01:20:52 +0800 Subject: [PATCH 21/79] feat: new useBlockRender API --- .../editor-core/src/render-block/Context.tsx | 32 ++++ .../src/render-block/RenderBlock.tsx | 9 +- .../src/render-block/RenderBlockChildren.tsx | 35 +++- .../src/render-block/RenderKanbanBlock.tsx | 56 ++++++ .../src/render-block/WithTreeViewChildren.tsx | 181 ++++++++++++++++++ .../editor-core/src/render-block/index.ts | 2 + 6 files changed, 307 insertions(+), 8 deletions(-) create mode 100644 libs/components/editor-core/src/render-block/Context.tsx create mode 100644 libs/components/editor-core/src/render-block/RenderKanbanBlock.tsx create mode 100644 libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx diff --git a/libs/components/editor-core/src/render-block/Context.tsx b/libs/components/editor-core/src/render-block/Context.tsx new file mode 100644 index 0000000000..8a1b68465c --- /dev/null +++ b/libs/components/editor-core/src/render-block/Context.tsx @@ -0,0 +1,32 @@ +import { genErrorObj } from '@toeverything/utils'; +import { createContext, PropsWithChildren, useContext } from 'react'; +import { RenderBlockProps } from './RenderBlock'; + +type BlockRenderProps = { + blockRender: (args: RenderBlockProps) => JSX.Element | null; +}; + +export const BlockRenderContext = createContext( + genErrorObj( + 'Failed to get BlockChildrenContext! The context only can use under the "render-root"' + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) as any +); + +export const BlockRenderProvider = ({ + blockRender, + children, +}: PropsWithChildren) => { + return ( + + {children} + + ); +}; + +export const useBlockRender = () => { + const { blockRender } = useContext(BlockRenderContext); + return { + BlockRender: blockRender, + }; +}; diff --git a/libs/components/editor-core/src/render-block/RenderBlock.tsx b/libs/components/editor-core/src/render-block/RenderBlock.tsx index 0a1531a709..1dc945e870 100644 --- a/libs/components/editor-core/src/render-block/RenderBlock.tsx +++ b/libs/components/editor-core/src/render-block/RenderBlock.tsx @@ -4,7 +4,12 @@ import { useCallback, useMemo } from 'react'; import { useEditor } from '../Contexts'; import { useBlock } from '../hooks'; -interface RenderBlockProps { +/** + * Render nothing + */ +export const NullBlockRender = (): null => null; + +export interface RenderBlockProps { blockId: string; hasContainer?: boolean; } @@ -29,7 +34,7 @@ export function RenderBlock({ if (block?.type) { return editor.getView(block.type).View; } - return () => null; + return (): null => null; }, [editor, block?.type]); if (!block) { diff --git a/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx b/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx index 4c87ccc8e8..d79d0cd002 100644 --- a/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx +++ b/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx @@ -1,16 +1,39 @@ +import { styled } from '@toeverything/components/ui'; import type { AsyncBlock } from '../editor'; -import { RenderBlock } from './RenderBlock'; +import { useBlockRender } from './Context'; +import { NullBlockRender } from './RenderBlock'; -interface RenderChildrenProps { +export interface RenderChildrenProps { block: AsyncBlock; + indent?: boolean; } -export const RenderBlockChildren = ({ block }: RenderChildrenProps) => { +export const RenderBlockChildren = ({ + block, + indent = true, +}: RenderChildrenProps) => { + const { BlockRender } = useBlockRender(); + if (BlockRender === NullBlockRender) { + return null; + } + return block.childrenIds.length ? ( - <> + {block.childrenIds.map(childId => { - return ; + return ; })} - + ) : null; }; + +/** + * Indent rendering child nodes + */ +const StyledIdentWrapper = styled('div')<{ indent?: boolean }>( + ({ indent }) => ({ + display: 'flex', + flexDirection: 'column', + // TODO: marginLeft should use theme provided by styled + ...(indent && { marginLeft: '30px' }), + }) +); diff --git a/libs/components/editor-core/src/render-block/RenderKanbanBlock.tsx b/libs/components/editor-core/src/render-block/RenderKanbanBlock.tsx new file mode 100644 index 0000000000..54f9e2276e --- /dev/null +++ b/libs/components/editor-core/src/render-block/RenderKanbanBlock.tsx @@ -0,0 +1,56 @@ +import { styled } from '@toeverything/components/ui'; +import { useBlock } from '../hooks'; +import { BlockRenderProvider } from './Context'; +import { NullBlockRender, RenderBlock, RenderBlockProps } from './RenderBlock'; + +/** + * Render block without children. + */ +const BlockWithoutChildrenRender = ({ blockId }: RenderBlockProps) => { + return ( + + + + ); +}; + +/** + * Render a block, but only one level of children. + */ +const OneLevelBlockRender = ({ blockId }: RenderBlockProps) => { + return ( + + + + ); +}; + +export const KanbanBlockRender = ({ blockId }: RenderBlockProps) => { + const { block } = useBlock(blockId); + + if (!block) { + return ( + + + + ); + } + + return ( + + + {block?.childrenIds.map(childId => ( + + + + ))} + + ); +}; + +const StyledBorder = styled('div')({ + border: '1px solid #E0E6EB', + borderRadius: '5px', + margin: '4px', + padding: '0 4px', +}); diff --git a/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx b/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx new file mode 100644 index 0000000000..8c3642ef6d --- /dev/null +++ b/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx @@ -0,0 +1,181 @@ +import { styled } from '@toeverything/components/ui'; +import type { + ComponentPropsWithoutRef, + ComponentPropsWithRef, + CSSProperties, + ReactElement, +} from 'react'; +import { forwardRef } from 'react'; +import { CreateView } from '../editor'; +import { useBlockRender } from './Context'; +import { NullBlockRender } from './RenderBlock'; + +type WithChildrenConfig = { + indent: CSSProperties['marginLeft']; +}; + +const defaultConfig: WithChildrenConfig = { + indent: '30px', +}; + +const TreeView = forwardRef< + HTMLDivElement, + { lastItem?: boolean } & ComponentPropsWithRef<'div'> +>(({ lastItem = false, children, onClick, ...restProps }, ref) => { + return ( + + + + + {lastItem && } + + {/* maybe need a child wrapper */} + {children} + + ); +}); + +const CollapsedNode = forwardRef< + HTMLDivElement, + ComponentPropsWithoutRef<'div'> +>((props, ref) => { + return ( + + ··· + + ); +}); + +/** + * Indent rendering child nodes + */ +export const withTreeViewChildren = ( + creator: (props: CreateView) => ReactElement, + customConfig: Partial = {} +) => { + const config = { + ...defaultConfig, + ...customConfig, + }; + + return (props: CreateView) => { + const { block } = props; + const { BlockRender } = useBlockRender(); + const collapsed = block.getProperty('collapsed')?.value; + const childrenIds = block.childrenIds; + const showChildren = + !collapsed && + childrenIds.length > 0 && + BlockRender !== NullBlockRender; + + const handleCollapse = () => { + block.setProperty('collapsed', { value: true }); + }; + + const handleExpand = () => { + block.setProperty('collapsed', { value: false }); + }; + + return ( + <> + {creator(props)} + + {collapsed && ( + + )} + {showChildren && + childrenIds.map((childId, idx) => { + return ( + + + + ); + })} + + ); + }; +}; + +const TREE_COLOR = '#D5DFE6'; +// adjust left and right margins of the the tree line +const TREE_LINE_LEFT_OFFSET = '-16px'; +// determine the position of the horizontal line by the type of the item +const TREE_LINE_TOP_OFFSET = '20px'; // '50%' +const TREE_LINE_WIDTH = '12px'; + +const TreeWrapper = styled('div')({ + position: 'relative', + display: 'flex', +}); + +const StyledTreeView = styled('div')({ + position: 'absolute', + left: TREE_LINE_LEFT_OFFSET, + height: '100%', +}); + +const Line = styled('div')({ + position: 'absolute', + cursor: 'pointer', + backgroundColor: TREE_COLOR, + // somehow tldraw would override this + boxSizing: 'content-box!important' as any, + // See [Can I add background color only for padding?](https://stackoverflow.com/questions/14628601/can-i-add-background-color-only-for-padding) + backgroundClip: 'content-box', + backgroundOrigin: 'content-box', + // Increase click hot spot + padding: '10px', +}); + +const VerticalLine = styled(Line)<{ last: boolean }>(({ last }) => ({ + width: '1px', + height: last ? TREE_LINE_TOP_OFFSET : '100%', + paddingTop: 0, + paddingBottom: 0, + transform: 'translate(-50%, 0)', + + opacity: last ? 0 : 'unset', +})); + +const HorizontalLine = styled(Line)<{ last: boolean }>(({ last }) => ({ + width: TREE_LINE_WIDTH, + height: '1px', + paddingLeft: 0, + paddingRight: 0, + top: TREE_LINE_TOP_OFFSET, + transform: 'translate(0, -50%)', + opacity: last ? 0 : 'unset', +})); + +const Collapsed = styled('div')({ + cursor: 'pointer', + display: 'inline-block', + color: '#98ACBD', + padding: '8px', +}); + +const LastItemRadius = styled('div')({ + boxSizing: 'content-box', + position: 'absolute', + left: '-0.5px', + top: 0, + height: TREE_LINE_TOP_OFFSET, + bottom: '50%', + width: TREE_LINE_WIDTH, + borderWidth: '1px', + borderStyle: 'solid', + borderLeftColor: TREE_COLOR, + borderBottomColor: TREE_COLOR, + borderTop: 'none', + borderRight: 'none', + borderRadius: '0 0 0 3px', + pointerEvents: 'none', +}); diff --git a/libs/components/editor-core/src/render-block/index.ts b/libs/components/editor-core/src/render-block/index.ts index 820bac8b57..0d5c809c4c 100644 --- a/libs/components/editor-core/src/render-block/index.ts +++ b/libs/components/editor-core/src/render-block/index.ts @@ -1,2 +1,4 @@ +export { BlockRenderProvider, useBlockRender } from './Context'; export * from './RenderBlock'; export * from './RenderBlockChildren'; +export { withTreeViewChildren } from './WithTreeViewChildren'; From dd24711f21ef6097c99edade1a40202b23802374 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 24 Aug 2022 01:25:25 +0800 Subject: [PATCH 22/79] refactor: update editor --- libs/components/affine-editor/src/Editor.tsx | 5 +- libs/components/editor-core/src/Contexts.tsx | 28 +++++-- .../components/editor-core/src/RenderRoot.tsx | 82 +++++++++---------- libs/components/editor-core/src/index.ts | 27 +++--- .../editor-core/src/kanban/Context.tsx | 10 ++- 5 files changed, 81 insertions(+), 71 deletions(-) diff --git a/libs/components/affine-editor/src/Editor.tsx b/libs/components/affine-editor/src/Editor.tsx index c280bea984..f1edb2ce74 100644 --- a/libs/components/affine-editor/src/Editor.tsx +++ b/libs/components/affine-editor/src/Editor.tsx @@ -1,7 +1,6 @@ import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react'; import { - RenderBlock, RenderRoot, type BlockEditor, } from '@toeverything/components/editor-core'; @@ -88,9 +87,7 @@ export const AffineEditor = forwardRef( editor={editor} editorElement={AffineEditor as any} scrollBlank={scrollBlank} - > - - + /> ); } ); diff --git a/libs/components/editor-core/src/Contexts.tsx b/libs/components/editor-core/src/Contexts.tsx index 418fe0e8b4..0b7c7d2270 100644 --- a/libs/components/editor-core/src/Contexts.tsx +++ b/libs/components/editor-core/src/Contexts.tsx @@ -1,22 +1,34 @@ -import { createContext, useContext } from 'react'; -import type { BlockEditor, AsyncBlock } from './editor'; import { genErrorObj } from '@toeverything/utils'; +import { createContext, PropsWithChildren, useContext } from 'react'; +import type { AsyncBlock, BlockEditor } from './editor'; -const RootContext = createContext<{ +type EditorProps = { editor: BlockEditor; // TODO: Temporary fix, dependencies in the new architecture are bottom-up, editors do not need to be passed down from the top editorElement: () => JSX.Element; -}>( +}; + +const EditorContext = createContext( genErrorObj( - 'Failed to get context! The context only can use under the "render-root"' + 'Failed to get EditorContext! The context only can use under the "render-root"' // eslint-disable-next-line @typescript-eslint/no-explicit-any ) as any ); -export const EditorProvider = RootContext.Provider; - export const useEditor = () => { - return useContext(RootContext); + return useContext(EditorContext); +}; + +export const EditorProvider = ({ + editor, + editorElement, + children, +}: PropsWithChildren) => { + return ( + + {children} + + ); }; /** diff --git a/libs/components/editor-core/src/RenderRoot.tsx b/libs/components/editor-core/src/RenderRoot.tsx index cbafd3ea75..c1f1dd0d49 100644 --- a/libs/components/editor-core/src/RenderRoot.tsx +++ b/libs/components/editor-core/src/RenderRoot.tsx @@ -4,12 +4,12 @@ import { services, type ReturnUnobserve, } from '@toeverything/datasource/db-service'; -import type { PropsWithChildren } from 'react'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { EditorProvider } from './Contexts'; import type { BlockEditor } from './editor'; import { useIsOnDrag } from './hooks'; import { addNewGroup, appendNewGroup } from './recast-block'; +import { BlockRenderProvider, RenderBlock } from './render-block'; import { SelectionRect, SelectionRef } from './Selection'; interface RenderRootProps { @@ -24,11 +24,7 @@ interface RenderRootProps { const MAX_PAGE_WIDTH = 5000; export const MIN_PAGE_WIDTH = 1480; -export const RenderRoot = ({ - editor, - editorElement, - children, -}: PropsWithChildren) => { +export const RenderRoot = ({ editor, editorElement }: RenderRootProps) => { const selectionRef = useRef(null); const triggeredBySelect = useRef(false); const [pageWidth, setPageWidth] = useState(MIN_PAGE_WIDTH); @@ -158,39 +154,43 @@ export const RenderRoot = ({ }; return ( - - { - if (ref != null && ref !== editor.container) { - editor.container = ref; - editor.getHooks().render(); - } - }} - onMouseMove={onMouseMove} - onMouseDown={onMouseDown} - onMouseUp={onMouseUp} - onMouseLeave={onMouseLeave} - onMouseOut={onMouseOut} - onContextMenu={onContextmenu} - onKeyDown={onKeyDown} - onKeyDownCapture={onKeyDownCapture} - onKeyUp={onKeyUp} - onDragOver={onDragOver} - onDragLeave={onDragLeave} - onDragOverCapture={onDragOverCapture} - onDragEnd={onDragEnd} - onDrop={onDrop} - isOnDrag={isOnDrag} - > - - {children} - - {/** TODO: remove selectionManager insert */} - {editor && } - {editor.isEdgeless ? null : } - {patchedNodes} - + + + { + if (ref != null && ref !== editor.container) { + editor.container = ref; + editor.getHooks().render(); + } + }} + onMouseMove={onMouseMove} + onMouseDown={onMouseDown} + onMouseUp={onMouseUp} + onMouseLeave={onMouseLeave} + onMouseOut={onMouseOut} + onContextMenu={onContextmenu} + onKeyDown={onKeyDown} + onKeyDownCapture={onKeyDownCapture} + onKeyUp={onKeyUp} + onDragOver={onDragOver} + onDragLeave={onDragLeave} + onDragOverCapture={onDragOverCapture} + onDragEnd={onDragEnd} + onDrop={onDrop} + isOnDrag={isOnDrag} + > + + + + {/** TODO: remove selectionManager insert */} + {editor && ( + + )} + {editor.isEdgeless ? null : } + {patchedNodes} + + ); }; @@ -251,7 +251,7 @@ function ScrollBlank({ editor }: { editor: BlockEditor }) { ); return ( - - {children} - + + + {children} + + ); }; From a4dc7bf127d2c2905527919dc01fd06e9324534e Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 24 Aug 2022 01:35:04 +0800 Subject: [PATCH 23/79] refactor: update block --- .../src/blocks/bullet/BulletView.tsx | 27 +- .../editor-blocks/src/blocks/bullet/index.ts | 14 +- .../src/blocks/grid-item/GridItemRender.tsx | 5 +- .../editor-blocks/src/blocks/grid/Grid.tsx | 17 +- .../src/blocks/group/ScenePage.tsx | 2 +- .../blocks/group/scene-kanban/CardItem.tsx | 5 +- .../src/blocks/numbered/NumberedView.tsx | 17 +- .../src/blocks/numbered/index.ts | 11 +- .../src/blocks/text/TextView.tsx | 5 +- .../src/blocks/todo/TodoView.tsx | 62 +++-- .../editor-blocks/src/blocks/todo/index.ts | 16 +- .../BlockContainer/BlockContainer.tsx | 2 +- .../IndentWrapper/IndentWrapper.tsx | 17 -- .../src/components/IndentWrapper/index.ts | 1 - .../source-view/format-url/youtube.ts | 1 + .../src/utils/WithTreeViewChildren.tsx | 236 ------------------ .../src/render-block/RenderBlock.tsx | 1 + 17 files changed, 96 insertions(+), 343 deletions(-) delete mode 100644 libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx delete mode 100644 libs/components/editor-blocks/src/components/IndentWrapper/index.ts delete mode 100644 libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx diff --git a/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx b/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx index 9f77eda6cb..b2f76e46f9 100644 --- a/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx +++ b/libs/components/editor-blocks/src/blocks/bullet/BulletView.tsx @@ -1,29 +1,28 @@ import type { TextProps } from '@toeverything/components/common'; import { ContentColumnValue, - services, Protocol, + services, } from '@toeverything/datasource/db-service'; import { type CreateView } from '@toeverything/framework/virgo'; import { useEffect, useRef, useState } from 'react'; +import { + BlockPendantProvider, + RenderBlockChildren, + supportChildren, + useOnSelect, +} from '@toeverything/components/editor-core'; +import { styled } from '@toeverything/components/ui'; +import { BlockContainer } from '../../components/BlockContainer'; +import { List } from '../../components/style-container'; import { TextManage, type ExtendedTextUtils, } from '../../components/text-manage'; import { tabBlock } from '../../utils/indent'; +import { BulletIcon, getChildrenType, NumberType } from './data'; import { BulletBlock, BulletProperties } from './types'; -import { - supportChildren, - RenderBlockChildren, - useOnSelect, - BlockPendantProvider, -} from '@toeverything/components/editor-core'; -import { List } from '../../components/style-container'; -import { getChildrenType, BulletIcon, NumberType } from './data'; -import { IndentWrapper } from '../../components/IndentWrapper'; -import { BlockContainer } from '../../components/BlockContainer'; -import { styled } from '@toeverything/components/ui'; export const defaultBulletProps: BulletProperties = { text: { value: [{ text: '' }] }, @@ -208,9 +207,7 @@ export const BulletView = ({ block, editor }: CreateView) => {
- - - + ); }; diff --git a/libs/components/editor-blocks/src/blocks/bullet/index.ts b/libs/components/editor-blocks/src/blocks/bullet/index.ts index 087afb3056..761aab03a1 100644 --- a/libs/components/editor-blocks/src/blocks/bullet/index.ts +++ b/libs/components/editor-blocks/src/blocks/bullet/index.ts @@ -1,18 +1,16 @@ +import { + DefaultColumnsValue, + Protocol, +} from '@toeverything/datasource/db-service'; import { AsyncBlock, BaseView, - CreateView, + getTextHtml, getTextProperties, SelectBlock, - getTextHtml, } from '@toeverything/framework/virgo'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; // import { withTreeViewChildren } from '../../utils/with-tree-view-children'; -import { defaultBulletProps, BulletView } from './BulletView'; -import { IndentWrapper } from '../../components/IndentWrapper'; +import { BulletView, defaultBulletProps } from './BulletView'; export class BulletBlock extends BaseView { public type = Protocol.Block.Type.bullet; diff --git a/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx b/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx index 3a598b3145..1dece91699 100644 --- a/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx +++ b/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx @@ -1,4 +1,4 @@ -import { RenderBlock } from '@toeverything/components/editor-core'; +import { useBlockRender } from '@toeverything/components/editor-core'; import { ChildrenView, CreateView } from '@toeverything/framework/virgo'; export const GridItemRender = function ( @@ -6,10 +6,11 @@ export const GridItemRender = function ( ) { const GridItem = function (props: CreateView) { const { block } = props; + const { BlockRender } = useBlockRender(); const children = ( <> {block.childrenIds.map(id => { - return ; + return ; })} ); diff --git a/libs/components/editor-blocks/src/blocks/grid/Grid.tsx b/libs/components/editor-blocks/src/blocks/grid/Grid.tsx index 4ecf47f3b5..4b5bfd49b3 100644 --- a/libs/components/editor-blocks/src/blocks/grid/Grid.tsx +++ b/libs/components/editor-blocks/src/blocks/grid/Grid.tsx @@ -1,16 +1,16 @@ -import { RenderBlock } from '@toeverything/components/editor-core'; -import { CreateView } from '@toeverything/framework/virgo'; -import React, { useEffect, useRef, useState } from 'react'; -import { GridHandle } from './GirdHandle'; +import { useBlockRender } from '@toeverything/components/editor-core'; import { styled } from '@toeverything/components/ui'; +import { Protocol } from '@toeverything/datasource/db-service'; +import { CreateView } from '@toeverything/framework/virgo'; +import { debounce, domToRect, Point } from '@toeverything/utils'; +import clsx from 'clsx'; +import React, { useEffect, useRef, useState } from 'react'; import ReactDOM from 'react-dom'; import { GRID_ITEM_CLASS_NAME, GRID_ITEM_CONTENT_CLASS_NAME, } from '../grid-item/GridItem'; -import { debounce, domToRect, Point } from '@toeverything/utils'; -import clsx from 'clsx'; -import { Protocol } from '@toeverything/datasource/db-service'; +import { GridHandle } from './GirdHandle'; const DB_UPDATE_DELAY = 50; const GRID_ON_DRAG_CLASS = 'grid-layout-on-drag'; @@ -31,6 +31,7 @@ export const Grid = function (props: CreateView) { const originalLeftWidth = useRef(gridItemMinWidth); const originalRightWidth = useRef(gridItemMinWidth); const [alertHandleId, setAlertHandleId] = useState(null); + const { BlockRender } = useBlockRender(); const getLeftRightGridItemDomByIndex = (index: number) => { const gridItems = Array.from(gridContainerRef.current?.children).filter( @@ -226,7 +227,7 @@ export const Grid = function (props: CreateView) { key={id} className={GRID_ITEM_CLASS_NAME} > - + handleDragGrid(event, i)} editor={editor} diff --git a/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx b/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx index 6145bec114..739927626d 100644 --- a/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx +++ b/libs/components/editor-blocks/src/blocks/group/ScenePage.tsx @@ -2,5 +2,5 @@ import { RenderBlockChildren } from '@toeverything/components/editor-core'; import type { CreateView } from '@toeverything/framework/virgo'; export const ScenePage = ({ block }: CreateView) => { - return ; + return ; }; diff --git a/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx b/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx index 837772bed2..8f79a6c208 100644 --- a/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx +++ b/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx @@ -1,6 +1,6 @@ import { KanbanCard, - RenderBlock, + useBlockRender, useEditor, useKanban, } from '@toeverything/components/editor-core'; @@ -94,6 +94,7 @@ export const CardItem = ({ const [editable, setEditable] = useState(false); const showKanbanRefPageFlag = useFlag('ShowKanbanRefPage', false); const { editor } = useEditor(); + const { BlockRender } = useBlockRender(); const onAddItem = async () => { setEditable(true); @@ -114,7 +115,7 @@ export const CardItem = ({ setEditable(false)}> - + {showKanbanRefPageFlag && !editable && ( diff --git a/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx b/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx index 38dac6fc75..74bcfab504 100644 --- a/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx +++ b/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx @@ -1,8 +1,8 @@ import { TextProps } from '@toeverything/components/common'; import { ContentColumnValue, - services, Protocol, + services, } from '@toeverything/datasource/db-service'; import { type CreateView } from '@toeverything/framework/virgo'; import { useEffect, useRef, useState } from 'react'; @@ -11,18 +11,17 @@ import { type ExtendedTextUtils, } from '../../components/text-manage'; import { tabBlock } from '../../utils/indent'; -import { IndentWrapper } from '../../components/IndentWrapper'; import type { Numbered, NumberedAsyncBlock } from './types'; -import { getChildrenType, getNumber } from './data'; import { - supportChildren, - RenderBlockChildren, - useOnSelect, BlockPendantProvider, + RenderBlockChildren, + supportChildren, + useOnSelect, } from '@toeverything/components/editor-core'; -import { List } from '../../components/style-container'; import { BlockContainer } from '../../components/BlockContainer'; +import { List } from '../../components/style-container'; +import { getChildrenType, getNumber } from './data'; export const defaultTodoProps: Numbered = { text: { value: [{ text: '' }] }, @@ -204,9 +203,7 @@ export const NumberedView = ({ block, editor }: CreateView) => { - - - + ); }; diff --git a/libs/components/editor-blocks/src/blocks/numbered/index.ts b/libs/components/editor-blocks/src/blocks/numbered/index.ts index b8b3c3dc0a..92187be81b 100644 --- a/libs/components/editor-blocks/src/blocks/numbered/index.ts +++ b/libs/components/editor-blocks/src/blocks/numbered/index.ts @@ -1,17 +1,16 @@ +import { + DefaultColumnsValue, + Protocol, +} from '@toeverything/datasource/db-service'; import { AsyncBlock, BaseView, + getTextHtml, getTextProperties, SelectBlock, - getTextHtml, } from '@toeverything/framework/virgo'; -import { - Protocol, - DefaultColumnsValue, -} from '@toeverything/datasource/db-service'; // import { withTreeViewChildren } from '../../utils/with-tree-view-children'; import { defaultTodoProps, NumberedView } from './NumberedView'; -import { IndentWrapper } from '../../components/IndentWrapper'; export class NumberedBlock extends BaseView { public type = Protocol.Block.Type.numbered; diff --git a/libs/components/editor-blocks/src/blocks/text/TextView.tsx b/libs/components/editor-blocks/src/blocks/text/TextView.tsx index 5edf231217..fcb06238e2 100644 --- a/libs/components/editor-blocks/src/blocks/text/TextView.tsx +++ b/libs/components/editor-blocks/src/blocks/text/TextView.tsx @@ -12,7 +12,6 @@ import { styled } from '@toeverything/components/ui'; import { Protocol } from '@toeverything/datasource/db-service'; import { CreateView } from '@toeverything/framework/virgo'; import { BlockContainer } from '../../components/BlockContainer'; -import { IndentWrapper } from '../../components/IndentWrapper'; import { TextManage } from '../../components/text-manage'; import { dedentBlock, tabBlock } from '../../utils/indent'; interface CreateTextView extends CreateView { @@ -255,9 +254,7 @@ export const TextView = ({ handleTab={onTab} /> - - - + ); }; diff --git a/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx b/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx index 8982f4695e..9bf24a37ec 100644 --- a/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx +++ b/libs/components/editor-blocks/src/blocks/todo/TodoView.tsx @@ -1,11 +1,17 @@ import { TextProps } from '@toeverything/components/common'; +import { + AsyncBlock, + BlockPendantProvider, + CreateView, + useOnSelect, +} from '@toeverything/components/editor-core'; import { styled } from '@toeverything/components/ui'; import { ContentColumnValue, Protocol, } from '@toeverything/datasource/db-service'; -import { AsyncBlock, type CreateView } from '@toeverything/framework/virgo'; -import { useRef } from 'react'; +import { useRef, useState } from 'react'; +import { BlockContainer } from '../../components/BlockContainer'; import { TextManage, type ExtendedTextUtils, @@ -36,6 +42,10 @@ const todoIsEmpty = (contentValue: ContentColumnValue): boolean => { export const TodoView = ({ block, editor }: CreateView) => { const properties = { ...defaultTodoProps, ...block.getProperties() }; const text_ref = useRef(null); + const [isSelect, setIsSelect] = useState(false); + useOnSelect(block.id, (isSelect: boolean) => { + setIsSelect(isSelect); + }); const turn_into_text_block = async () => { // Convert to text block @@ -121,28 +131,34 @@ export const TodoView = ({ block, editor }: CreateView) => { }; return ( - -
- -
+ + + +
+ +
-
- -
-
+
+ +
+
+ + ); }; diff --git a/libs/components/editor-blocks/src/blocks/todo/index.ts b/libs/components/editor-blocks/src/blocks/todo/index.ts index c6580009d0..78f317103a 100644 --- a/libs/components/editor-blocks/src/blocks/todo/index.ts +++ b/libs/components/editor-blocks/src/blocks/todo/index.ts @@ -1,18 +1,16 @@ import { - BaseView, - getTextProperties, AsyncBlock, - SelectBlock, + BaseView, getTextHtml, -} from '@toeverything/framework/virgo'; -// import type { CreateView } from '@toeverything/framework/virgo'; + getTextProperties, + SelectBlock, + withTreeViewChildren, +} from '@toeverything/components/editor-core'; import { - Protocol, DefaultColumnsValue, + Protocol, } from '@toeverything/datasource/db-service'; -// import { withTreeViewChildren } from '../../utils/with-tree-view-children'; -import { withTreeViewChildren } from '../../utils/WithTreeViewChildren'; -import { TodoView, defaultTodoProps } from './TodoView'; +import { defaultTodoProps, TodoView } from './TodoView'; import type { TodoAsyncBlock } from './types'; export class TodoBlock extends BaseView { diff --git a/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx b/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx index 00da92a813..4c043ce163 100644 --- a/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx +++ b/libs/components/editor-blocks/src/components/BlockContainer/BlockContainer.tsx @@ -23,7 +23,7 @@ export const BlockContainer = function ({ ); }; -export const Container = styled('div')<{ selected: boolean }>( +export const Container = styled('div')<{ selected?: boolean }>( ({ selected, theme }) => ({ backgroundColor: selected ? theme.affine.palette.textSelected : '', marginBottom: '2px', diff --git a/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx b/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx deleted file mode 100644 index 93aa9d34a1..0000000000 --- a/libs/components/editor-blocks/src/components/IndentWrapper/IndentWrapper.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { PropsWithChildren } from 'react'; -import { ChildrenView } from '@toeverything/framework/virgo'; -import { styled } from '@toeverything/components/ui'; - -/** - * Indent rendering child nodes - */ -export const IndentWrapper = (props: PropsWithChildren) => { - return {props.children}; -}; - -const StyledIdentWrapper = styled('div')({ - display: 'flex', - flexDirection: 'column', - // TODO: marginLeft should use theme provided by styled - marginLeft: '30px', -}); diff --git a/libs/components/editor-blocks/src/components/IndentWrapper/index.ts b/libs/components/editor-blocks/src/components/IndentWrapper/index.ts deleted file mode 100644 index e4234a916d..0000000000 --- a/libs/components/editor-blocks/src/components/IndentWrapper/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './IndentWrapper'; diff --git a/libs/components/editor-blocks/src/components/source-view/format-url/youtube.ts b/libs/components/editor-blocks/src/components/source-view/format-url/youtube.ts index 56f165a515..7cd540b12e 100644 --- a/libs/components/editor-blocks/src/components/source-view/format-url/youtube.ts +++ b/libs/components/editor-blocks/src/components/source-view/format-url/youtube.ts @@ -1,4 +1,5 @@ export const isYoutubeUrl = (url?: string): boolean => { + if (!url) return false; const allowedHosts = ['www.youtu.be', 'www.youtube.com']; const host = new URL(url).host; return allowedHosts.includes(host); diff --git a/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx b/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx deleted file mode 100644 index e7e497f2ef..0000000000 --- a/libs/components/editor-blocks/src/utils/WithTreeViewChildren.tsx +++ /dev/null @@ -1,236 +0,0 @@ -import { - BlockPendantProvider, - CreateView, - RenderBlock, - useCurrentView, - useOnSelect, -} from '@toeverything/components/editor-core'; -import { styled } from '@toeverything/components/ui'; -import type { - ComponentPropsWithoutRef, - ComponentPropsWithRef, - CSSProperties, - ReactElement, -} from 'react'; -import { forwardRef, useState } from 'react'; -import { SCENE_CONFIG } from '../blocks/group/config'; -import { BlockContainer } from '../components/BlockContainer'; - -type WithChildrenConfig = { - indent: CSSProperties['marginLeft']; -}; - -const defaultConfig: WithChildrenConfig = { - indent: '30px', -}; - -const TreeView = forwardRef< - HTMLDivElement, - { lastItem?: boolean } & ComponentPropsWithRef<'div'> ->(({ lastItem = false, children, onClick, ...restProps }, ref) => { - return ( - - - - - {lastItem && } - - {/* maybe need a child wrapper */} - {children} - - ); -}); - -interface ChildrenViewProp { - childrenIds: string[]; - handleCollapse: () => void; - indent?: string | number; -} - -const ChildrenView = ({ - childrenIds, - handleCollapse, - indent, -}: ChildrenViewProp) => { - const [currentView] = useCurrentView(); - const isKanbanScene = currentView.type === SCENE_CONFIG.KANBAN; - - return ( - - {childrenIds.map((childId, idx) => { - if (isKanbanScene) { - return ( - - - - ); - } - - return ( - - - - ); - })} - - ); -}; - -const CollapsedNode = forwardRef< - HTMLDivElement, - ComponentPropsWithoutRef<'div'> ->((props, ref) => { - return ( - - ··· - - ); -}); - -/** - * Indent rendering child nodes - */ -export const withTreeViewChildren = ( - creator: (props: CreateView) => ReactElement, - customConfig: Partial = {} -) => { - const config = { - ...defaultConfig, - ...customConfig, - }; - - return (props: CreateView) => { - const { block, editor } = props; - const collapsed = block.getProperty('collapsed')?.value; - const childrenIds = block.childrenIds; - const showChildren = !collapsed && childrenIds.length > 0; - - const [isSelect, setIsSelect] = useState(false); - useOnSelect(block.id, (isSelect: boolean) => { - setIsSelect(isSelect); - }); - const handleCollapse = () => { - block.setProperty('collapsed', { value: true }); - }; - - const handleExpand = () => { - block.setProperty('collapsed', { value: false }); - }; - - return ( - - -
{creator(props)}
-
- - {collapsed && ( - - )} - {showChildren && ( - - )} -
- ); - }; -}; - -const Wrapper = styled('div')({ display: 'flex', flexDirection: 'column' }); - -const Children = Wrapper; - -const TREE_COLOR = '#D5DFE6'; -// adjust left and right margins of the the tree line -const TREE_LINE_LEFT_OFFSET = '-16px'; -// determine the position of the horizontal line by the type of the item -const TREE_LINE_TOP_OFFSET = '20px'; // '50%' -const TREE_LINE_WIDTH = '12px'; - -const TreeWrapper = styled('div')({ - position: 'relative', -}); - -const StyledTreeView = styled('div')({ - position: 'absolute', - left: TREE_LINE_LEFT_OFFSET, - height: '100%', -}); - -const Line = styled('div')({ - position: 'absolute', - cursor: 'pointer', - backgroundColor: TREE_COLOR, - // somehow tldraw would override this - boxSizing: 'content-box!important' as any, - // See [Can I add background color only for padding?](https://stackoverflow.com/questions/14628601/can-i-add-background-color-only-for-padding) - backgroundClip: 'content-box', - backgroundOrigin: 'content-box', - // Increase click hot spot - padding: '10px', -}); - -const VerticalLine = styled(Line)<{ last: boolean }>(({ last }) => ({ - width: '1px', - height: last ? TREE_LINE_TOP_OFFSET : '100%', - paddingTop: 0, - paddingBottom: 0, - transform: 'translate(-50%, 0)', - - opacity: last ? 0 : 'unset', -})); - -const HorizontalLine = styled(Line)<{ last: boolean }>(({ last }) => ({ - width: TREE_LINE_WIDTH, - height: '1px', - paddingLeft: 0, - paddingRight: 0, - top: TREE_LINE_TOP_OFFSET, - transform: 'translate(0, -50%)', - opacity: last ? 0 : 'unset', -})); - -const Collapsed = styled('div')({ - cursor: 'pointer', - display: 'inline-block', - color: '#98ACBD', - padding: '8px', -}); - -const LastItemRadius = styled('div')({ - boxSizing: 'content-box', - position: 'absolute', - left: '-0.5px', - top: 0, - height: TREE_LINE_TOP_OFFSET, - bottom: '50%', - width: TREE_LINE_WIDTH, - borderWidth: '1px', - borderStyle: 'solid', - borderLeftColor: TREE_COLOR, - borderBottomColor: TREE_COLOR, - borderTop: 'none', - borderRight: 'none', - borderRadius: '0 0 0 3px', - pointerEvents: 'none', -}); - -const StyledBorder = styled('div')({ - border: '1px solid #E0E6EB', - borderRadius: '5px', - margin: '4px', -}); diff --git a/libs/components/editor-core/src/render-block/RenderBlock.tsx b/libs/components/editor-core/src/render-block/RenderBlock.tsx index 1dc945e870..c843274166 100644 --- a/libs/components/editor-core/src/render-block/RenderBlock.tsx +++ b/libs/components/editor-core/src/render-block/RenderBlock.tsx @@ -69,4 +69,5 @@ export function RenderBlock({ const BlockContainer = styled('div')(({ theme }) => ({ fontSize: theme.typography.body1.fontSize, + flex: 1, })); From 123091c1aaa37bfd80da7c891542a9f33cde8d8f Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 24 Aug 2022 02:07:37 +0800 Subject: [PATCH 24/79] chore: add warn comment --- libs/components/editor-core/src/render-block/Context.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/components/editor-core/src/render-block/Context.tsx b/libs/components/editor-core/src/render-block/Context.tsx index 8a1b68465c..90c89eec0e 100644 --- a/libs/components/editor-core/src/render-block/Context.tsx +++ b/libs/components/editor-core/src/render-block/Context.tsx @@ -13,6 +13,9 @@ export const BlockRenderContext = createContext( ) as any ); +/** + * CAUTION! DO NOT PROVIDE A DYNAMIC BLOCK RENDER! + */ export const BlockRenderProvider = ({ blockRender, children, From c4de1a606166cd7ec6e5f8c1308d98200e53738e Mon Sep 17 00:00:00 2001 From: mitsuha Date: Wed, 24 Aug 2022 09:08:12 +0800 Subject: [PATCH 25/79] opti: 1.adjust eventlistener; --- apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts index b9a6e5dd56..9b550e9bbe 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts +++ b/apps/ligo-virgo/src/pages/workspace/docs/utils/toc.ts @@ -93,6 +93,7 @@ const getPageTOC = (asyncBlocks: AsyncBlock[], tocContents): TocType[] => { /* destroy page/block update-listener */ const destroyEventList = (): boolean => { const eventListeners = listenerMap.values(); + listenerMap.clear(); for (const eventListener of eventListeners) { eventListener?.(); From f2a21e6c3bf6a4c16dda09d405b1b2c4477c0d48 Mon Sep 17 00:00:00 2001 From: mitsuha Date: Wed, 24 Aug 2022 10:40:14 +0800 Subject: [PATCH 26/79] opti: 1.adjust eventlistener; --- apps/ligo-virgo/src/pages/workspace/docs/Page.tsx | 4 ++-- .../src/pages/workspace/docs/components/toc/TOC.tsx | 2 +- .../src/pages/workspace/docs/components/toc/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx b/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx index 0bbcfb5d75..6d9d2fac90 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/Page.tsx @@ -23,7 +23,7 @@ import { useFlag } from '@toeverything/datasource/feature-flags'; import { CollapsiblePageTree } from './collapsible-page-tree'; import { Tabs } from './components/tabs'; import { TabMap, TAB_TITLE } from './components/tabs/Tabs'; -import { Toc } from './components/toc'; +import { TOC } from './components/toc'; import { WorkspaceName } from './workspace-name'; type PageProps = { @@ -92,7 +92,7 @@ export function Page(props: PageProps) { )} {activeTab === TabMap.get(TAB_TITLE.TOC).value && ( - TOC + TOC )} diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index dd12469d90..a4c4fba27e 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -119,7 +119,7 @@ const renderTOCContent = tocDataSource => { ); }; -export const Toc = (props: Props) => { +export const TOC = (props: Props) => { const { editor } = props; const { page_id } = useParams(); const [tocDataSource, setTocDataSource] = useState([]); diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts index 1e45e9bd09..e603af8242 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/index.ts @@ -1 +1 @@ -export { Toc } from './Toc'; +export { TOC } from './TOC'; From 617e9a06125671066787f097ef537c72e1d0baf9 Mon Sep 17 00:00:00 2001 From: DiamondThree Date: Wed, 24 Aug 2022 13:47:47 +0800 Subject: [PATCH 27/79] Bugfix/delete log (#315) * fix delete log * fix delete log --- libs/components/affine-board/src/Board.tsx | 5 +++-- libs/components/affine-board/src/hooks/use-shapes.ts | 3 ++- .../board-draw/src/components/command-panel/ArrowTo.tsx | 8 +++++--- libs/components/board-state/src/tldraw-app.ts | 4 ++-- libs/components/common/src/lib/text/EditableText.tsx | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libs/components/affine-board/src/Board.tsx b/libs/components/affine-board/src/Board.tsx index 101d54d37b..9936d115a0 100644 --- a/libs/components/affine-board/src/Board.tsx +++ b/libs/components/affine-board/src/Board.tsx @@ -52,6 +52,7 @@ const AffineBoard = ({ }); const { shapes, bindings } = useShapes(workspace, rootBlockId); + useEffect(() => { if (app) { app.replacePageContent(shapes || {}, bindings, {}); @@ -109,7 +110,6 @@ const AffineBoard = ({ }); } shape.affineId = block.id; - Object.keys(bindings).forEach(bilingKey => { if ( bindings[bilingKey]?.fromId === shape.id @@ -148,7 +148,8 @@ const AffineBoard = ({ Object.assign(pageBindings, bindings); } }); - services.api.editorBlock.update({ + + await services.api.editorBlock.update({ workspace: workspace, id: rootBlockId, properties: { diff --git a/libs/components/affine-board/src/hooks/use-shapes.ts b/libs/components/affine-board/src/hooks/use-shapes.ts index beb8c50efa..ba1bf066ff 100644 --- a/libs/components/affine-board/src/hooks/use-shapes.ts +++ b/libs/components/affine-board/src/hooks/use-shapes.ts @@ -12,7 +12,7 @@ const getBindings = (workspace: string, rootBlockId: string) => { ids: [rootBlockId], }) .then(blcoks => { - return blcoks[0].properties.bindings?.value; + return blcoks[0]?.properties.bindings?.value; }); }; @@ -104,6 +104,7 @@ export const useShapes = (workspace: string, rootBlockId: string) => { return acc; }, {} as Record); + return { shapes: blocksShapes, bindings: JSON.parse(blocks?.bindings ?? '{}'), diff --git a/libs/components/board-draw/src/components/command-panel/ArrowTo.tsx b/libs/components/board-draw/src/components/command-panel/ArrowTo.tsx index 21f37a9fbc..84ef142ef0 100644 --- a/libs/components/board-draw/src/components/command-panel/ArrowTo.tsx +++ b/libs/components/board-draw/src/components/command-panel/ArrowTo.tsx @@ -21,6 +21,9 @@ export const ArrowTo = ({ app, shapes }: GroupAndUnGroupProps) => { let activeShape = shapes[0]; let toNextShapBindings: ArrowBinding[] = []; let bindingId = ''; + if (!activeShape) { + return; + } Object.keys(bindings).forEach(key => { if (bindings[key].toId === activeShape.id) { bindingId = bindings[key].fromId; @@ -35,7 +38,6 @@ export const ArrowTo = ({ app, shapes }: GroupAndUnGroupProps) => { toNextShapBindings.forEach(binding => { if (binding.toId !== activeShape.id) { allShape.forEach(item => { - console.log(item); if (item.id === binding.toId) { ArrowToArr.push(item); } @@ -44,7 +46,7 @@ export const ArrowTo = ({ app, shapes }: GroupAndUnGroupProps) => { }); setarrowToArr(ArrowToArr); return () => {}; - }, [app.page.bindings, app.shapes]); + }, [app.page.bindings]); const jumpToNextShap = (shape: TDShape) => { app.zoomToShapes([shape]); }; @@ -68,7 +70,7 @@ export const ArrowTo = ({ app, shapes }: GroupAndUnGroupProps) => {
} > - + diff --git a/libs/components/board-state/src/tldraw-app.ts b/libs/components/board-state/src/tldraw-app.ts index 34a392db72..98bffcf654 100644 --- a/libs/components/board-state/src/tldraw-app.ts +++ b/libs/components/board-state/src/tldraw-app.ts @@ -626,7 +626,7 @@ export class TldrawApp extends StateManager { private prev_bindings = this.page.bindings; private prev_assets = this.document.assets; - private _broadcastPageChanges = () => { + private _broadcastPageChanges = async () => { const visited = new Set(); const changedShapes: Record = {}; @@ -683,7 +683,7 @@ export class TldrawApp extends StateManager { Object.keys(changedAssets).length > 0 ) { this.just_sent = true; - this.callbacks.onChangePage?.( + await this.callbacks.onChangePage?.( this, changedShapes, changedBindings, diff --git a/libs/components/common/src/lib/text/EditableText.tsx b/libs/components/common/src/lib/text/EditableText.tsx index 8637246d7d..b2b2229fec 100644 --- a/libs/components/common/src/lib/text/EditableText.tsx +++ b/libs/components/common/src/lib/text/EditableText.tsx @@ -804,7 +804,7 @@ const EditorLeaf = ({ attributes, children, leaf }: any) => { backgroundColor: '#F2F5F9', borderRadius: '5px', color: '#3A4C5C', - padding: '3px 8px', + padding: '1px 8px', margin: '0 2px', }} > From 012c0441d0e96a4b6f2dead990ab69a32d064ad8 Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Wed, 24 Aug 2022 14:41:21 +0800 Subject: [PATCH 28/79] refactor: recode html2block --- .../editor-blocks/src/blocks/bullet/index.ts | 78 +++--- .../editor-blocks/src/blocks/code/index.ts | 54 ++-- .../editor-blocks/src/blocks/divider/index.ts | 36 +-- .../src/blocks/embed-link/index.ts | 23 -- .../editor-blocks/src/blocks/figma/index.ts | 29 --- .../src/blocks/groupDvider/index.ts | 18 -- .../editor-blocks/src/blocks/image/index.ts | 34 ++- .../src/blocks/numbered/index.ts | 83 +++--- .../src/blocks/text/QuoteBlock.tsx | 105 +++----- .../src/blocks/text/TextBlock.tsx | 246 +++++------------- .../editor-blocks/src/blocks/todo/index.ts | 84 +++--- .../editor-blocks/src/blocks/youtube/index.ts | 29 --- .../src/utils/commonBlockClip.ts | 27 ++ libs/components/editor-core/package.json | 2 + .../src/editor/clipboard/clipboard-parse.ts | 134 ---------- .../src/editor/clipboard/clipboard.ts | 14 +- .../src/editor/clipboard/clipboardUtils.ts | 60 +++++ .../editor-core/src/editor/clipboard/copy.ts | 6 - .../editor-core/src/editor/clipboard/paste.ts | 172 +++++------- .../editor-core/src/editor/clipboard/types.ts | 7 +- .../editor-core/src/editor/clipboard/utils.ts | 150 +++++++++++ .../editor-core/src/editor/editor.ts | 8 + .../editor-core/src/editor/index.ts | 5 +- .../editor-core/src/editor/views/base-view.ts | 16 +- pnpm-lock.yaml | 101 +++++++ 25 files changed, 693 insertions(+), 828 deletions(-) delete mode 100644 libs/components/editor-core/src/editor/clipboard/clipboard-parse.ts create mode 100644 libs/components/editor-core/src/editor/clipboard/utils.ts diff --git a/libs/components/editor-blocks/src/blocks/bullet/index.ts b/libs/components/editor-blocks/src/blocks/bullet/index.ts index 1577263af3..212575da31 100644 --- a/libs/components/editor-blocks/src/blocks/bullet/index.ts +++ b/libs/components/editor-blocks/src/blocks/bullet/index.ts @@ -1,9 +1,15 @@ -import { AsyncBlock, BaseView } from '@toeverything/framework/virgo'; +import { + AsyncBlock, + BaseView, + BlockEditor, + HTML2BlockResult, +} from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { defaultBulletProps, BulletView } from './BulletView'; import { Block2HtmlProps, commonBlock2HtmlContent, + commonHTML2block, } from '../../utils/commonBlockClip'; export class BulletBlock extends BaseView { public type = Protocol.Block.Type.bullet; @@ -18,49 +24,41 @@ export class BulletBlock extends BaseView { } return block; } + override async html2block2({ + element, + editor, + }: { + element: Element; + editor: BlockEditor; + }): Promise { + if (element.tagName === 'UL') { + const firstList = element.querySelector('li'); - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'UL') { - const result = []; - for (let i = 0; i < el.children.length; i++) { - const blocks_info = parseEl(el.children[i]); - result.push(...blocks_info); + if (!firstList || firstList.innerText.startsWith('[ ] ')) { + return null; } - return result.length > 0 ? result : null; + const children = Array.from(element.children); + const childrenBlockInfos = ( + await Promise.all( + children.map(childElement => + this.html2block2({ + editor, + element: childElement, + }) + ) + ) + ) + .flat() + .filter(v => v); + return childrenBlockInfos.length ? childrenBlockInfos : null; } - if (tag_name == 'LI' && !el.textContent.startsWith('[ ] ')) { - const childNodes = el.childNodes; - const texts = []; - const children = []; - for (let i = 0; i < childNodes.length; i++) { - const blocks_info = parseEl(childNodes[i] as Element); - for (let j = 0; j < blocks_info.length; j++) { - if (blocks_info[j].type === 'text') { - const block_texts = - blocks_info[j].properties.text.value; - texts.push(...block_texts); - } else { - children.push(blocks_info[j]); - } - } - } - return [ - { - type: this.type, - properties: { - text: { value: texts }, - }, - children: children, - }, - ]; - } - - return null; + return commonHTML2block({ + element, + editor, + type: this.type, + tagName: 'LI', + }); } override async block2html(props: Block2HtmlProps) { diff --git a/libs/components/editor-blocks/src/blocks/code/index.ts b/libs/components/editor-blocks/src/blocks/code/index.ts index a204779656..306d909716 100644 --- a/libs/components/editor-blocks/src/blocks/code/index.ts +++ b/libs/components/editor-blocks/src/blocks/code/index.ts @@ -1,9 +1,15 @@ -import { BaseView, AsyncBlock } from '@toeverything/framework/virgo'; +import { + BaseView, + AsyncBlock, + BlockEditor, + HTML2BlockResult, +} from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { CodeView } from './CodeView'; import { Block2HtmlProps, commonBlock2HtmlContent, + commonHTML2block, } from '../../utils/commonBlockClip'; export class CodeBlock extends BaseView { @@ -21,39 +27,19 @@ export class CodeBlock extends BaseView { return block; } - // TODO: internal format not implemented yet - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'CODE') { - const childNodes = el.childNodes; - let text_value = ''; - for (let i = 0; i < childNodes.length; i++) { - const blocks_info = parseEl(childNodes[i] as Element); - for (let j = 0; j < blocks_info.length; j++) { - if (blocks_info[j].type === 'text') { - const block_texts = - blocks_info[j].properties.text.value; - if (block_texts.length > 0) { - text_value += block_texts[0].text; - } - } - } - } - return [ - { - type: this.type, - properties: { - text: { value: [{ text: text_value }] }, - }, - children: [], - }, - ]; - } - - return null; + override async html2block2({ + element, + editor, + }: { + element: Element; + editor: BlockEditor; + }): Promise { + return commonHTML2block({ + element, + editor, + type: this.type, + tagName: 'CODE', + }); } override async block2html(props: Block2HtmlProps) { diff --git a/libs/components/editor-blocks/src/blocks/divider/index.ts b/libs/components/editor-blocks/src/blocks/divider/index.ts index eb4615963c..14f29b8807 100644 --- a/libs/components/editor-blocks/src/blocks/divider/index.ts +++ b/libs/components/editor-blocks/src/blocks/divider/index.ts @@ -1,34 +1,34 @@ import { AsyncBlock, BaseView, + BlockEditor, + HTML2BlockResult, SelectBlock, } from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { DividerView } from './divider-view'; -import { Block2HtmlProps } from '../../utils/commonBlockClip'; +import { Block2HtmlProps, commonHTML2block } from '../../utils/commonBlockClip'; export class DividerBlock extends BaseView { type = Protocol.Block.Type.divider; View = DividerView; - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'HR') { - return [ - { - type: this.type, - properties: { - text: {}, - }, - children: [], - }, - ]; - } - return null; + override async html2block2({ + element, + editor, + }: { + element: Element; + editor: BlockEditor; + }): Promise { + return commonHTML2block({ + element, + editor, + type: this.type, + tagName: 'HR', + ignoreEmptyElement: false, + }); } + override async block2html(props: Block2HtmlProps) { return `
`; } diff --git a/libs/components/editor-blocks/src/blocks/embed-link/index.ts b/libs/components/editor-blocks/src/blocks/embed-link/index.ts index 7674c71c3e..8b6e23f527 100644 --- a/libs/components/editor-blocks/src/blocks/embed-link/index.ts +++ b/libs/components/editor-blocks/src/blocks/embed-link/index.ts @@ -13,29 +13,6 @@ export class EmbedLinkBlock extends BaseView { type = Protocol.Block.Type.embedLink; View = EmbedLinkView; - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'A' && el.parentElement?.childElementCount === 1) { - return [ - { - type: this.type, - properties: { - // TODO: Not sure what value to fill for name - embedLink: { - name: this.type, - value: el.getAttribute('href'), - }, - }, - children: [], - }, - ]; - } - - return null; - } override async block2html({ block }: Block2HtmlProps) { const url = block.getProperty('embedLink')?.value; return `

${url}

`; diff --git a/libs/components/editor-blocks/src/blocks/figma/index.ts b/libs/components/editor-blocks/src/blocks/figma/index.ts index 652abfbc1d..382429b137 100644 --- a/libs/components/editor-blocks/src/blocks/figma/index.ts +++ b/libs/components/editor-blocks/src/blocks/figma/index.ts @@ -13,35 +13,6 @@ export class FigmaBlock extends BaseView { type = Protocol.Block.Type.figma; View = FigmaView; - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'A' && el.parentElement?.childElementCount === 1) { - const href = el.getAttribute('href'); - const allowedHosts = ['www.figma.com']; - const host = new URL(href).host; - - if (allowedHosts.includes(host)) { - return [ - { - type: this.type, - properties: { - // TODO: Not sure what value to fill for name - embedLink: { - name: this.type, - value: el.getAttribute('href'), - }, - }, - children: [], - }, - ]; - } - } - - return null; - } override async block2html({ block }: Block2HtmlProps) { const figmaUrl = block.getProperty('embedLink')?.value; return `

${figmaUrl}

`; diff --git a/libs/components/editor-blocks/src/blocks/groupDvider/index.ts b/libs/components/editor-blocks/src/blocks/groupDvider/index.ts index 52940173e6..458ef2f708 100644 --- a/libs/components/editor-blocks/src/blocks/groupDvider/index.ts +++ b/libs/components/editor-blocks/src/blocks/groupDvider/index.ts @@ -10,25 +10,7 @@ import { Block2HtmlProps } from '../../utils/commonBlockClip'; export class GroupDividerBlock extends BaseView { type = Protocol.Block.Type.groupDivider; View = GroupDividerView; - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'HR') { - return [ - { - type: this.type, - properties: { - text: {}, - }, - children: [], - }, - ]; - } - return null; - } override async block2html(props: Block2HtmlProps) { return `
`; } diff --git a/libs/components/editor-blocks/src/blocks/image/index.ts b/libs/components/editor-blocks/src/blocks/image/index.ts index 190f83d72a..844ae43cb2 100644 --- a/libs/components/editor-blocks/src/blocks/image/index.ts +++ b/libs/components/editor-blocks/src/blocks/image/index.ts @@ -1,7 +1,12 @@ -import { BaseView } from '@toeverything/framework/virgo'; +import { + BaseView, + BlockEditor, + HTML2BlockResult, +} from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { ImageView } from './ImageView'; import { Block2HtmlProps } from '../../utils/commonBlockClip'; +import { getRandomString } from '@toeverything/components/common'; export class ImageBlock extends BaseView { public override selectable = true; @@ -10,27 +15,30 @@ export class ImageBlock extends BaseView { View = ImageView; // TODO: needs to download the image and then upload it to get a new link and then assign it - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'IMG') { + override async html2block2({ + element, + editor, + }: { + element: Element; + editor: BlockEditor; + }): Promise { + if (element.tagName === 'IMG') { return [ { type: this.type, properties: { - value: '', - url: el.getAttribute('src'), - name: el.getAttribute('src'), - size: 0, - type: 'link', + image: { + value: getRandomString('image'), + url: element.getAttribute('src'), + name: element.getAttribute('src'), + size: 0, + type: 'link', + }, }, children: [], }, ]; } - return null; } diff --git a/libs/components/editor-blocks/src/blocks/numbered/index.ts b/libs/components/editor-blocks/src/blocks/numbered/index.ts index d6eb9c1839..5c3f8a4e4e 100644 --- a/libs/components/editor-blocks/src/blocks/numbered/index.ts +++ b/libs/components/editor-blocks/src/blocks/numbered/index.ts @@ -1,9 +1,15 @@ -import { AsyncBlock, BaseView } from '@toeverything/framework/virgo'; +import { + AsyncBlock, + BaseView, + BlockEditor, + HTML2BlockResult, +} from '@toeverything/framework/virgo'; import { Protocol } from '@toeverything/datasource/db-service'; import { defaultTodoProps, NumberedView } from './NumberedView'; import { Block2HtmlProps, commonBlock2HtmlContent, + commonHTML2block, } from '../../utils/commonBlockClip'; export class NumberedBlock extends BaseView { @@ -22,55 +28,38 @@ export class NumberedBlock extends BaseView { return block; } - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'OL') { - const result = []; - for (let i = 0; i < el.children.length; i++) { - const blocks_info = parseEl(el.children[i]); - result.push(...blocks_info); - } - return result.length > 0 ? result : null; + override async html2block2({ + element, + editor, + }: { + element: Element; + editor: BlockEditor; + }): Promise { + if (element.tagName === 'OL') { + const children = Array.from(element.children); + const childrenBlockInfos = ( + await Promise.all( + children.map(childElement => + this.html2block2({ + editor, + element: childElement, + }) + ) + ) + ) + .flat() + .filter(v => v); + return childrenBlockInfos.length ? childrenBlockInfos : null; } - if (tag_name == 'LI' && el.textContent.startsWith('[ ] ')) { - const childNodes = el.childNodes; - let texts = []; - const children = []; - for (let i = 0; i < childNodes.length; i++) { - const blocks_info = parseEl(childNodes[i] as Element); - for (let j = 0; j < blocks_info.length; j++) { - if (blocks_info[j].type === 'text') { - const block_texts = - blocks_info[j].properties.text.value; - texts.push(...block_texts); - } else { - children.push(blocks_info[j]); - } - } - } - if (texts.length > 0 && (texts[0].text || '').startsWith('[ ] ')) { - texts[0].text = texts[0].text.substring('[ ] '.length); - if (!texts[0].text) { - texts = texts.slice(1); - } - } - return [ - { - type: this.type, - properties: { - text: { value: texts }, - }, - children: children, - }, - ]; - } - - return null; + return commonHTML2block({ + element, + editor, + type: this.type, + tagName: 'LI', + }); } + override async block2html(props: Block2HtmlProps) { return `
  1. ${await commonBlock2HtmlContent(props)}
`; } diff --git a/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx b/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx index c3613f585d..51f63e3dec 100644 --- a/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx +++ b/libs/components/editor-blocks/src/blocks/text/QuoteBlock.tsx @@ -2,11 +2,14 @@ import { Protocol } from '@toeverything/datasource/db-service'; import { AsyncBlock, BaseView, + BlockEditor, CreateView, + HTML2BlockResult, } from '@toeverything/framework/virgo'; import { Block2HtmlProps, commonBlock2HtmlContent, + commonHTML2block, } from '../../utils/commonBlockClip'; import { TextView } from './TextView'; @@ -27,36 +30,19 @@ export class QuoteBlock extends BaseView { return block; } - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if (tag_name === 'BLOCKQUOTE') { - const childNodes = el.childNodes; - const texts = []; - for (let i = 0; i < childNodes.length; i++) { - const blocks_info = parseEl(childNodes[i] as Element); - for (let j = 0; j < blocks_info.length; j++) { - if (blocks_info[j].type === 'text') { - const block_texts = - blocks_info[j].properties.text.value; - texts.push(...block_texts); - } - } - } - return [ - { - type: this.type, - properties: { - text: { value: texts }, - }, - children: [], - }, - ]; - } - - return null; + override async html2block2({ + element, + editor, + }: { + element: Element; + editor: BlockEditor; + }): Promise { + return commonHTML2block({ + element, + editor, + type: this.type, + tagName: 'BLOCKQUOTE', + }); } override async block2html(props: Block2HtmlProps) { @@ -82,52 +68,19 @@ export class CalloutBlock extends BaseView { return block; } - override html2block( - el: Element, - parseEl: (el: Element) => any[] - ): any[] | null { - const tag_name = el.tagName; - if ( - tag_name === 'ASIDE' || - el.firstChild?.nodeValue?.startsWith('
- Copy + + Copy
diff --git a/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx b/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx index 86b43908d1..c3e7199c29 100644 --- a/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx +++ b/libs/components/editor-blocks/src/blocks/embed-link/EmbedLinkView.tsx @@ -33,7 +33,7 @@ export const EmbedLinkView = (props: EmbedLinkView) => { }; return ( - + {embedLinkUrl ? ( { setIsSelect(isSelect); }); return ( - + {figmaUrl ? ( { }; return ( - +
- {!isSelect ? ( - - ) : null} + {!isSelect ? : null} {imgUrl ? (
{ diff --git a/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx b/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx index 74bcfab504..c45321a138 100644 --- a/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx +++ b/libs/components/editor-blocks/src/blocks/numbered/NumberedView.tsx @@ -183,7 +183,7 @@ export const NumberedView = ({ block, editor }: CreateView) => { return ( - +
{getNumber(properties.numberType, number)}. diff --git a/libs/components/editor-blocks/src/blocks/page/PageView.tsx b/libs/components/editor-blocks/src/blocks/page/PageView.tsx index 64fba3ca83..123021e361 100644 --- a/libs/components/editor-blocks/src/blocks/page/PageView.tsx +++ b/libs/components/editor-blocks/src/blocks/page/PageView.tsx @@ -1,14 +1,14 @@ -import { useRef, useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { useParams } from 'react-router'; import { BackLink, TextProps } from '@toeverything/components/common'; import { - RenderBlockChildren, BlockPendantProvider, + RenderBlockChildren, } from '@toeverything/components/editor-core'; +import { styled } from '@toeverything/components/ui'; import { ContentColumnValue } from '@toeverything/datasource/db-service'; import { CreateView } from '@toeverything/framework/virgo'; -import { Theme, styled } from '@toeverything/components/ui'; import { TextManage, @@ -81,7 +81,7 @@ export const PageView = ({ block, editor }: CreateView) => { return ( - + - + { return ( - +
) => { @@ -23,8 +30,23 @@ export const BlockPendantProvider = ({ const showTriggerLine = properties.filter(property => getValue(property.id)).length === 0; + const onClick = useCallback( + (e: MouseEvent) => { + if (containerFlavor.includes(block.type)) { + return; + } + if (e.target === e.currentTarget) { + const rect = e.currentTarget.getBoundingClientRect(); + const middle = (rect.left + rect.right) / 2; + const position = e.clientX < middle ? 'start' : 'end'; + editor.selectionManager.activeNodeByNodeId(block.id, position); + } + }, + [editor, block] + ); + return ( - + {children} {showTriggerLine ? ( diff --git a/libs/components/editor-core/src/editor/scroll/scroll.ts b/libs/components/editor-core/src/editor/scroll/scroll.ts index 08f2b8ec16..2e3c8453e6 100644 --- a/libs/components/editor-core/src/editor/scroll/scroll.ts +++ b/libs/components/editor-core/src/editor/scroll/scroll.ts @@ -196,11 +196,11 @@ export class ScrollManager { private _getKeepInViewParams(blockRect: Rect) { if (this.scrollContainer == null) return 0; const { top, bottom } = domToRect(this._scrollContainer); - if (blockRect.top <= top + blockRect.height * 3) { + if (blockRect.top <= top + blockRect.height) { return -1; } - if (blockRect.bottom >= bottom - blockRect.height * 3) { + if (blockRect.bottom >= bottom - blockRect.height) { return 1; } return 0; diff --git a/libs/components/editor-plugins/src/menu/left-menu/LeftMenuPlugin.tsx b/libs/components/editor-plugins/src/menu/left-menu/LeftMenuPlugin.tsx index 9c339e8630..f3b8fa35a1 100644 --- a/libs/components/editor-plugins/src/menu/left-menu/LeftMenuPlugin.tsx +++ b/libs/components/editor-plugins/src/menu/left-menu/LeftMenuPlugin.tsx @@ -1,3 +1,4 @@ +import { containerFlavor } from '@toeverything/datasource/db-service'; import { BlockDropPlacement, HookType } from '@toeverything/framework/virgo'; import { domToRect, last, Point } from '@toeverything/utils'; import { StrictMode } from 'react'; @@ -9,7 +10,6 @@ import { LeftMenuDraggable, LineInfoSubject, } from './LeftMenuDraggable'; -import { ignoreBlockTypes } from './menu-config'; const DRAG_THROTTLE_DELAY = 60; export class LeftMenuPlugin extends BasePlugin { private _mousedown?: boolean; @@ -104,7 +104,7 @@ export class LeftMenuPlugin extends BasePlugin { const block = await this.editor.getBlockByPoint( new Point(event.clientX, event.clientY) ); - if (block == null || ignoreBlockTypes.includes(block.type)) return; + if (block == null || containerFlavor.includes(block.type)) return; const { direction, block: targetBlock } = await this.editor.dragDropManager.checkBlockDragTypes( event, @@ -143,7 +143,7 @@ export class LeftMenuPlugin extends BasePlugin { const node = await this.editor.getBlockByPoint( new Point(event.clientX, event.clientY) ); - if (node == null || ignoreBlockTypes.includes(node.type)) { + if (node == null || containerFlavor.includes(node.type)) { return; } if (node.dom) { diff --git a/libs/components/editor-plugins/src/menu/left-menu/menu-config.ts b/libs/components/editor-plugins/src/menu/left-menu/menu-config.ts index 0d107c15a8..d210c71a23 100644 --- a/libs/components/editor-plugins/src/menu/left-menu/menu-config.ts +++ b/libs/components/editor-plugins/src/menu/left-menu/menu-config.ts @@ -1,14 +1,14 @@ -import { BlockFlavorKeys, Protocol } from '@toeverything/datasource/db-service'; -import ShortTextIcon from '@mui/icons-material/ShortText'; -import TitleIcon from '@mui/icons-material/Title'; import FormatListBulletedIcon from '@mui/icons-material/FormatListBulleted'; import HorizontalRuleIcon from '@mui/icons-material/HorizontalRule'; +import ListIcon from '@mui/icons-material/List'; import NotificationsNoneIcon from '@mui/icons-material/NotificationsNone'; +import ShortTextIcon from '@mui/icons-material/ShortText'; +import TitleIcon from '@mui/icons-material/Title'; import { CodeBlockInlineIcon, PagesIcon, } from '@toeverything/components/common'; -import ListIcon from '@mui/icons-material/List'; +import { Protocol } from '@toeverything/datasource/db-service'; export const MENU_WIDTH = 14; export const pageConvertIconSize = 24; type MenuItem = { @@ -93,12 +93,3 @@ const textTypeBlocks: MenuItem[] = [ export const addMenuList = [...textTypeBlocks].filter(v => v); export const textConvertMenuList = textTypeBlocks; - -export const ignoreBlockTypes: BlockFlavorKeys[] = [ - Protocol.Block.Type.workspace, - Protocol.Block.Type.page, - Protocol.Block.Type.group, - Protocol.Block.Type.title, - Protocol.Block.Type.grid, - Protocol.Block.Type.gridItem, -]; diff --git a/libs/datasource/db-service/src/index.ts b/libs/datasource/db-service/src/index.ts index 3d4ffb01a9..c9e7cc2e86 100644 --- a/libs/datasource/db-service/src/index.ts +++ b/libs/datasource/db-service/src/index.ts @@ -42,6 +42,7 @@ export { type TemplateMeta, } from './services/editor-block/templates'; export type { Template } from './services/editor-block/templates/types'; +export { containerFlavor } from './services/editor-block/types'; export { DEFAULT_COLUMN_KEYS } from './services/editor-block/utils/column/default-config'; const api = new Proxy({} as DbServicesMap, { diff --git a/libs/datasource/db-service/src/services/editor-block/types.ts b/libs/datasource/db-service/src/services/editor-block/types.ts index e2bb7922b2..5c7ab2a2dd 100644 --- a/libs/datasource/db-service/src/services/editor-block/types.ts +++ b/libs/datasource/db-service/src/services/editor-block/types.ts @@ -4,6 +4,15 @@ import { Column, DefaultColumnsValue } from './utils/column'; export type BlockFlavors = typeof Protocol.Block.Type; export type BlockFlavorKeys = keyof typeof Protocol.Block.Type; +export const containerFlavor: BlockFlavorKeys[] = [ + Protocol.Block.Type.workspace, + Protocol.Block.Type.page, + Protocol.Block.Type.group, + Protocol.Block.Type.title, + Protocol.Block.Type.grid, + Protocol.Block.Type.gridItem, +]; + export interface CreateEditorBlock { workspace: string; type: keyof BlockFlavors; From 7eff19509fe057b6ef8217839ec397b5eae605e3 Mon Sep 17 00:00:00 2001 From: DarkSky Date: Fri, 26 Aug 2022 18:53:58 +0800 Subject: [PATCH 54/79] chore: fix deps warn --- apps/ligo-virgo/package.json | 2 +- libs/components/editor-blocks/package.json | 2 +- libs/components/editor-core/package.json | 4 +- .../editor-core/src/editor/clipboard/index.ts | 2 +- libs/components/editor-plugins/package.json | 4 +- libs/components/layout/package.json | 4 +- libs/components/ui/package.json | 2 +- libs/datasource/state/package.json | 4 +- package.json | 65 +- pnpm-lock.yaml | 2092 +++++++++-------- 10 files changed, 1127 insertions(+), 1054 deletions(-) diff --git a/apps/ligo-virgo/package.json b/apps/ligo-virgo/package.json index 5bb0d78eaa..e8a18e071c 100644 --- a/apps/ligo-virgo/package.json +++ b/apps/ligo-virgo/package.json @@ -13,7 +13,7 @@ "@mui/icons-material": "^5.8.4" }, "devDependencies": { - "firebase": "^9.9.2", + "firebase": "^9.9.3", "mini-css-extract-plugin": "^2.6.1", "webpack": "^5.74.0" } diff --git a/libs/components/editor-blocks/package.json b/libs/components/editor-blocks/package.json index d9b9c66f72..04d8e0e544 100644 --- a/libs/components/editor-blocks/package.json +++ b/libs/components/editor-blocks/package.json @@ -38,7 +38,7 @@ "react-window": "^1.8.7", "slate": "^0.81.1", "slate-react": "^0.81.0", - "style9": "^0.13.3" + "style9": "^0.14.0" }, "devDependencies": { "@types/codemirror": "^5.60.5", diff --git a/libs/components/editor-core/package.json b/libs/components/editor-core/package.json index a9c5cd636f..b680b35b96 100644 --- a/libs/components/editor-core/package.json +++ b/libs/components/editor-core/package.json @@ -4,7 +4,7 @@ "license": "MIT", "dependencies": { "@mui/icons-material": "^5.8.4", - "date-fns": "^2.28.0", + "date-fns": "^2.29.2", "eventemitter3": "^4.0.7", "hotkeys-js": "^3.9.4", "html-escaper": "^3.0.3", @@ -12,6 +12,6 @@ "marked": "^4.0.19", "nanoid": "^4.0.0", "slate": "^0.81.0", - "style9": "^0.13.3" + "style9": "^0.14.0" } } diff --git a/libs/components/editor-core/src/editor/clipboard/index.ts b/libs/components/editor-core/src/editor/clipboard/index.ts index 41cf2aba32..cca57e3a47 100644 --- a/libs/components/editor-core/src/editor/clipboard/index.ts +++ b/libs/components/editor-core/src/editor/clipboard/index.ts @@ -1,2 +1,2 @@ -export { HTML2BlockResult, ClipBlockInfo } from './types'; export { Clipboard } from './clipboard'; +export type { ClipBlockInfo, HTML2BlockResult } from './types'; diff --git a/libs/components/editor-plugins/package.json b/libs/components/editor-plugins/package.json index 94f7b8e0c5..7d3696c949 100644 --- a/libs/components/editor-plugins/package.json +++ b/libs/components/editor-plugins/package.json @@ -4,7 +4,7 @@ "license": "MIT", "dependencies": { "@mui/icons-material": "^5.8.4", - "date-fns": "^2.28.0", - "style9": "^0.13.3" + "date-fns": "^2.29.2", + "style9": "^0.14.0" } } diff --git a/libs/components/layout/package.json b/libs/components/layout/package.json index 739ad7c56e..a36a746d84 100644 --- a/libs/components/layout/package.json +++ b/libs/components/layout/package.json @@ -10,8 +10,8 @@ "@dnd-kit/utilities": "^3.2.0", "@mui/icons-material": "^5.8.4", "clsx": "^1.2.1", - "date-fns": "^2.28.0", - "jotai": "^1.7.4", + "date-fns": "^2.29.2", + "jotai": "^1.8.1", "tinycolor2": "^1.4.2", "turndown": "7.1.1" }, diff --git a/libs/components/ui/package.json b/libs/components/ui/package.json index 6df3065fa9..a4b562991e 100644 --- a/libs/components/ui/package.json +++ b/libs/components/ui/package.json @@ -13,7 +13,7 @@ "@mui/x-date-pickers": "^5.0.0-alpha.7", "@mui/x-date-pickers-pro": "^5.0.0-alpha.7", "@types/react-date-range": "^1.4.4", - "clsx": "^1.2.0", + "clsx": "^1.2.1", "notistack": "^2.0.5", "react-date-range": "^1.4.0" } diff --git a/libs/datasource/state/package.json b/libs/datasource/state/package.json index a1a92d478b..20bdf4c8ce 100644 --- a/libs/datasource/state/package.json +++ b/libs/datasource/state/package.json @@ -3,9 +3,9 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "jotai": "^1.7.4" + "jotai": "^1.8.1" }, "devDependencies": { - "firebase": "^9.9.2" + "firebase": "^9.9.3" } } diff --git a/package.json b/package.json index a0e060199e..88f5c1264e 100644 --- a/package.json +++ b/package.json @@ -51,13 +51,20 @@ "@mui/material", "babel-loader", "jest-environment-node", + "mobx", "rollup", "webpack", "react", "react-dom", "reflect-metadata", "rxjs" - ] + ], + "allowedVersions": { + "@types/react": "18", + "react": "18", + "react-dom": "18", + "react-test-renderer": "18" + } } }, "dependencies": { @@ -66,9 +73,9 @@ "@mui/icons-material": "^5.8.4", "@mui/material": "^5.8.6", "assert": "^2.0.0", - "clsx": "^1.2.0", - "core-js": "^3.23.3", - "got": "^12.1.0", + "clsx": "^1.2.1", + "core-js": "^3.25.0", + "got": "^12.3.1", "level": "^8.0.0", "level-read-stream": "1.1.0", "react": "^18.2.0", @@ -76,38 +83,36 @@ "react-router": "^6.3.0", "react-router-dom": "^6.3.0", "regenerator-runtime": "^0.13.9", - "rxjs": "^7.5.5", - "style9": "^0.13.3", + "rxjs": "^7.5.6", + "style9": "^0.14.0", "tslib": "^2.4.0" }, "devDependencies": { "@firebase/auth": "^0.20.5", - "@headlessui/react": "^1.6.5", - "@heroicons/react": "^1.0.6", - "@nrwl/cli": "^14.4.0", - "@nrwl/cypress": "^14.4.0", - "@nrwl/eslint-plugin-nx": "^14.4.0", - "@nrwl/jest": "^14.4.0", - "@nrwl/js": "^14.4.0", - "@nrwl/linter": "^14.4.0", - "@nrwl/node": "^14.4.0", - "@nrwl/nx-cloud": "^14.2.0", - "@nrwl/react": "^14.4.0", - "@nrwl/tao": "^14.4.0", - "@nrwl/web": "^14.4.0", - "@nrwl/workspace": "^14.4.0", + "@nrwl/cli": "^14.5.10", + "@nrwl/cypress": "^14.5.10", + "@nrwl/eslint-plugin-nx": "^14.5.10", + "@nrwl/jest": "^14.5.10", + "@nrwl/js": "^14.5.10", + "@nrwl/linter": "^14.5.10", + "@nrwl/node": "^14.5.10", + "@nrwl/nx-cloud": "^14.5.4", + "@nrwl/react": "^14.5.10", + "@nrwl/tao": "^14.5.10", + "@nrwl/web": "^14.5.10", + "@nrwl/workspace": "^14.5.10", "@portabletext/react": "^1.0.6", - "@svgr/core": "^6.2.1", + "@svgr/core": "^6.3.1", "@swc/cli": "^0.1.57", - "@swc/core": "^1.2.208", - "@swc/helpers": "^0.4.3", - "@swc/jest": "^0.2.21", + "@swc/core": "^1.2.244", + "@swc/helpers": "^0.4.11", + "@swc/jest": "^0.2.22", "@testing-library/react": "^13.3.0", "@testing-library/react-hooks": "^8.0.1", - "@types/jest": "^28.1.4", - "@types/node": "^18.0.1", - "@types/react": "^18.0.14", - "@types/react-dom": "^18.0.5", + "@types/jest": "^28.1.8", + "@types/node": "^18.7.13", + "@types/react": "^18.0.17", + "@types/react-dom": "^18.0.6", "@types/react-router-dom": "^5.3.3", "@typescript-eslint/eslint-plugin": "^5.30.4", "@typescript-eslint/parser": "^5.30.4", @@ -128,13 +133,13 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.30.1", "eslint-plugin-react-hooks": "^4.6.0", - "firebase": "^9.9.2", + "firebase": "^9.9.3", "fs-extra": "^10.1.0", "html-webpack-plugin": "^5.5.0", "husky": "^8.0.1", "jest": "^28.1.2", "lint-staged": "^13.0.3", - "nx": "^14.4.0", + "nx": "^14.5.10", "prettier": "^2.7.1", "react-test-renderer": "^18.2.0", "svgo": "^2.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27efb6db8e..89bc777cd6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,34 +7,32 @@ importers: '@emotion/react': ^11.9.3 '@emotion/styled': ^11.9.3 '@firebase/auth': ^0.20.5 - '@headlessui/react': ^1.6.5 - '@heroicons/react': ^1.0.6 '@mui/icons-material': ^5.8.4 '@mui/material': ^5.8.6 - '@nrwl/cli': ^14.4.0 - '@nrwl/cypress': ^14.4.0 - '@nrwl/eslint-plugin-nx': ^14.4.0 - '@nrwl/jest': ^14.4.0 - '@nrwl/js': ^14.4.0 - '@nrwl/linter': ^14.4.0 - '@nrwl/node': ^14.4.0 - '@nrwl/nx-cloud': ^14.2.0 - '@nrwl/react': ^14.4.0 - '@nrwl/tao': ^14.4.0 - '@nrwl/web': ^14.4.0 - '@nrwl/workspace': ^14.4.0 + '@nrwl/cli': ^14.5.10 + '@nrwl/cypress': ^14.5.10 + '@nrwl/eslint-plugin-nx': ^14.5.10 + '@nrwl/jest': ^14.5.10 + '@nrwl/js': ^14.5.10 + '@nrwl/linter': ^14.5.10 + '@nrwl/node': ^14.5.10 + '@nrwl/nx-cloud': ^14.5.4 + '@nrwl/react': ^14.5.10 + '@nrwl/tao': ^14.5.10 + '@nrwl/web': ^14.5.10 + '@nrwl/workspace': ^14.5.10 '@portabletext/react': ^1.0.6 - '@svgr/core': ^6.2.1 + '@svgr/core': ^6.3.1 '@swc/cli': ^0.1.57 - '@swc/core': ^1.2.208 - '@swc/helpers': ^0.4.3 - '@swc/jest': ^0.2.21 + '@swc/core': ^1.2.244 + '@swc/helpers': ^0.4.11 + '@swc/jest': ^0.2.22 '@testing-library/react': ^13.3.0 '@testing-library/react-hooks': ^8.0.1 - '@types/jest': ^28.1.4 - '@types/node': ^18.0.1 - '@types/react': ^18.0.14 - '@types/react-dom': ^18.0.5 + '@types/jest': ^28.1.8 + '@types/node': ^18.7.13 + '@types/react': ^18.0.17 + '@types/react-dom': ^18.0.6 '@types/react-router-dom': ^5.3.3 '@typescript-eslint/eslint-plugin': ^5.30.4 '@typescript-eslint/parser': ^5.30.4 @@ -42,9 +40,9 @@ importers: babel-jest: ^28.1.2 babel-plugin-open-source: ^1.3.4 change-case: ^4.1.2 - clsx: ^1.2.0 + clsx: ^1.2.1 compression-webpack-plugin: ^10.0.0 - core-js: ^3.23.3 + core-js: ^3.25.0 cross-env: ^7.0.3 css-minimizer-webpack-plugin: ^4.0.0 cz-customizable: ^5.3.0 @@ -58,16 +56,16 @@ importers: eslint-plugin-prettier: ^4.2.1 eslint-plugin-react: ^7.30.1 eslint-plugin-react-hooks: ^4.6.0 - firebase: ^9.9.2 + firebase: ^9.9.3 fs-extra: ^10.1.0 - got: ^12.1.0 + got: ^12.3.1 html-webpack-plugin: ^5.5.0 husky: ^8.0.1 jest: ^28.1.2 level: ^8.0.0 level-read-stream: 1.1.0 lint-staged: ^13.0.3 - nx: ^14.4.0 + nx: ^14.5.10 prettier: ^2.7.1 react: ^18.2.0 react-dom: ^18.2.0 @@ -75,8 +73,8 @@ importers: react-router-dom: ^6.3.0 react-test-renderer: ^18.2.0 regenerator-runtime: ^0.13.9 - rxjs: ^7.5.5 - style9: ^0.13.3 + rxjs: ^7.5.6 + style9: ^0.14.0 svgo: ^2.8.0 terser-webpack-plugin: ^5.3.3 ts-jest: ^28.0.5 @@ -86,14 +84,14 @@ importers: webpack: ^5.74.0 webpack-bundle-analyzer: ^4.5.0 dependencies: - '@emotion/react': 11.9.3_4jaruczdv2uxjj3lb2xbkiuci4 - '@emotion/styled': 11.9.3_toiz7tndcw4z2b7gxmmeo5fkcu - '@mui/icons-material': 5.8.4_vdnh4jyrnjwcar5vg6k35n5t6e - '@mui/material': 5.8.7_h2u6a3oivtyocvjxeke7xcvlfa + '@emotion/react': 11.9.3_aev5mndowrsc2o4rquiaswzsei + '@emotion/styled': 11.9.3_lzq4tq5osthlqcqhyhuicy5gfy + '@mui/icons-material': 5.8.4_wip2cf6yrkxu2zuyrl3lmpbdaa + '@mui/material': 5.8.7_mugunlselc52kyz7qt5aa5ixva assert: 2.0.0 - clsx: 1.2.0 - core-js: 3.23.3 - got: 12.1.0 + clsx: 1.2.1 + core-js: 3.25.0 + got: 12.3.1 level: 8.0.0 level-read-stream: 1.1.0 react: 18.2.0 @@ -101,36 +99,34 @@ importers: react-router: 6.3.0_react@18.2.0 react-router-dom: 6.3.0_biqbaboplfbrettd7655fr4n2y regenerator-runtime: 0.13.9 - rxjs: 7.5.5 - style9: 0.13.3_3dhnqjc63a233tfpt3a625zcdq + rxjs: 7.5.6 + style9: 0.14.0_3dhnqjc63a233tfpt3a625zcdq tslib: 2.4.0 devDependencies: - '@firebase/auth': 0.20.5_@firebase+app@0.7.30 - '@headlessui/react': 1.6.5_biqbaboplfbrettd7655fr4n2y - '@heroicons/react': 1.0.6_react@18.2.0 - '@nrwl/cli': 14.4.2_@swc+core@1.2.210 - '@nrwl/cypress': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/eslint-plugin-nx': 14.4.2_afsbewstkdex5d4fc6xnpjlnau - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle - '@nrwl/js': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/node': 14.4.2_ehspof47b5bphcyk4536mwaw4u - '@nrwl/nx-cloud': 14.2.0 - '@nrwl/react': 14.4.2_46t6z7wulh2zjyi5wmxujdm57y - '@nrwl/tao': 14.4.2_@swc+core@1.2.210 - '@nrwl/web': 14.4.2_7ggz7ibmlwrqtwusxeq53zzcym - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq + '@firebase/auth': 0.20.5_@firebase+app@0.7.31 + '@nrwl/cli': 14.5.10_@swc+core@1.2.244 + '@nrwl/cypress': 14.5.10_fh4vayvykx4so2ggxmjmy42o7q + '@nrwl/eslint-plugin-nx': 14.5.10_givxt7oldssnfrhy2ogb3txvmu + '@nrwl/jest': 14.5.10_mxnt7yjwrufofllb6rm3srb2gy + '@nrwl/js': 14.5.10_fh4vayvykx4so2ggxmjmy42o7q + '@nrwl/linter': 14.5.10_nccbbaajqjy3rznvgrrzaevqwe + '@nrwl/node': 14.5.10_b7xqi4yfwax4wnal77xdlkadre + '@nrwl/nx-cloud': 14.5.4 + '@nrwl/react': 14.5.10_o5732ev3g42bu2r3ngh6yfrgia + '@nrwl/tao': 14.5.10_@swc+core@1.2.244 + '@nrwl/web': 14.5.10_tpw7pltx5fafq53de536pruocy + '@nrwl/workspace': 14.5.10_eva5qnqrnaa26adtrypogyveky '@portabletext/react': 1.0.6_react@18.2.0 - '@svgr/core': 6.2.1 - '@swc/cli': 0.1.57_@swc+core@1.2.210 - '@swc/core': 1.2.210 - '@swc/helpers': 0.4.3 - '@swc/jest': 0.2.21_@swc+core@1.2.210 + '@svgr/core': 6.3.1 + '@swc/cli': 0.1.57_@swc+core@1.2.244 + '@swc/core': 1.2.244 + '@swc/helpers': 0.4.11 + '@swc/jest': 0.2.22_@swc+core@1.2.244 '@testing-library/react': 13.3.0_biqbaboplfbrettd7655fr4n2y - '@testing-library/react-hooks': 8.0.1_5qggqhesezyescxqnsg4rpj6qa - '@types/jest': 28.1.4 - '@types/node': 18.0.1 - '@types/react': 18.0.14 + '@testing-library/react-hooks': 8.0.1_y6lpz2mvcoua7qihahug4ke22i + '@types/jest': 28.1.8 + '@types/node': 18.7.13 + '@types/react': 18.0.17 '@types/react-dom': 18.0.6 '@types/react-router-dom': 5.3.3 '@typescript-eslint/eslint-plugin': 5.30.5_6zdoc3rn4mpiddqwhppni2mnnm @@ -152,21 +148,21 @@ importers: eslint-plugin-prettier: 4.2.1_7uxdfn2xinezdgvmbammh6ev5i eslint-plugin-react: 7.30.1_eslint@8.19.0 eslint-plugin-react-hooks: 4.6.0_eslint@8.19.0 - firebase: 9.9.2 + firebase: 9.9.3 fs-extra: 10.1.0 html-webpack-plugin: 5.5.0_webpack@5.74.0 husky: 8.0.1 - jest: 28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq + jest: 28.1.2_3glepa5322b7j342guju4hszoy lint-staged: 13.0.3 - nx: 14.4.2_@swc+core@1.2.210 + nx: 14.5.10_@swc+core@1.2.244 prettier: 2.7.1 react-test-renderer: 18.2.0_react@18.2.0 svgo: 2.8.0 - terser-webpack-plugin: 5.3.3_vwzmvoh3samqo2nn3x7mqt365m + terser-webpack-plugin: 5.3.3_5yvlrjpud4kvfyyr2mesgpo47e ts-jest: 28.0.5_dvf3gqad2lwurck7yyca7j3d3i - ts-node: 10.8.2_y42jqzo3jkzuv3kp7opavo2xbi + ts-node: 10.8.2_hixnfb2jfw56u6pahjg3ndp4oy typescript: 4.7.4 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-bundle-analyzer: 4.5.0 apps/keck: @@ -184,7 +180,7 @@ importers: yjs: ^13.5.41 dependencies: authing-js-sdk: 4.23.35 - firebase-admin: 11.0.1 + firebase-admin: 11.0.1_@firebase+app-types@0.7.0 lib0: 0.2.52 lru-cache: 7.13.2 nanoid: 4.0.0 @@ -199,13 +195,13 @@ importers: apps/ligo-virgo: specifiers: '@mui/icons-material': ^5.8.4 - firebase: ^9.9.2 + firebase: ^9.9.3 mini-css-extract-plugin: ^2.6.1 webpack: ^5.74.0 dependencies: '@mui/icons-material': 5.8.4 devDependencies: - firebase: 9.9.2 + firebase: 9.9.3 mini-css-extract-plugin: 2.6.1_webpack@5.74.0 webpack: 5.74.0 @@ -260,7 +256,7 @@ importers: '@tldraw/intersect': ^1.7.1 '@tldraw/vec': ^1.7.0 dependencies: - '@tldraw/core': 1.14.1_mobx@6.6.1 + '@tldraw/core': 1.14.1 '@tldraw/intersect': 1.7.1 '@tldraw/vec': 1.7.1 @@ -409,22 +405,22 @@ importers: react-window: ^1.8.7 slate: ^0.81.1 slate-react: ^0.81.0 - style9: ^0.13.3 + style9: ^0.14.0 dependencies: '@codemirror/commands': 6.0.1 '@codemirror/lang-cpp': 6.0.1 - '@codemirror/lang-css': 6.0.0_bmjizg7gr5ieupmvn5u62mbipm - '@codemirror/lang-html': 6.1.0_@codemirror+view@6.2.0 + '@codemirror/lang-css': 6.0.0 + '@codemirror/lang-html': 6.1.0 '@codemirror/lang-java': 6.0.0 '@codemirror/lang-javascript': 6.0.2 '@codemirror/lang-json': 6.0.0 '@codemirror/lang-lezer': 6.0.0 '@codemirror/lang-markdown': 6.0.1 - '@codemirror/lang-php': 6.0.0_@codemirror+view@6.2.0 + '@codemirror/lang-php': 6.0.0 '@codemirror/lang-python': 6.0.1 '@codemirror/lang-rust': 6.0.0 - '@codemirror/lang-sql': 6.1.0_bmjizg7gr5ieupmvn5u62mbipm - '@codemirror/lang-xml': 6.0.0_@codemirror+view@6.2.0 + '@codemirror/lang-sql': 6.1.0 + '@codemirror/lang-xml': 6.0.0 '@codemirror/language': 6.2.1 '@codemirror/legacy-modes': 6.1.0 '@codemirror/next': 0.16.0 @@ -438,7 +434,7 @@ importers: '@emotion/styled': 11.9.3_dc5dh2wp562rsjxvguwi2i3yzq '@mui/system': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i code-example: 3.3.6 - codemirror: 6.0.1_@lezer+common@1.0.0 + codemirror: 6.0.1 codemirror-lang-elixir: 3.0.0_@codemirror+language@6.2.1 keymap: link:@codemirror/next/keymap nanoid: 4.0.0 @@ -446,7 +442,7 @@ importers: react-window: 1.8.7 slate: 0.81.1 slate-react: 0.81.0_slate@0.81.1 - style9: 0.13.3 + style9: 0.14.0 devDependencies: '@types/codemirror': 5.60.5 '@types/react-resizable': 3.0.1 @@ -455,7 +451,7 @@ importers: libs/components/editor-core: specifiers: '@mui/icons-material': ^5.8.4 - date-fns: ^2.28.0 + date-fns: ^2.29.2 eventemitter3: ^4.0.7 hotkeys-js: ^3.9.4 html-escaper: ^3.0.3 @@ -463,10 +459,10 @@ importers: marked: ^4.0.19 nanoid: ^4.0.0 slate: ^0.81.0 - style9: ^0.13.3 + style9: ^0.14.0 dependencies: '@mui/icons-material': 5.8.4 - date-fns: 2.28.0 + date-fns: 2.29.2 eventemitter3: 4.0.7 hotkeys-js: 3.9.4 html-escaper: 3.0.3 @@ -474,17 +470,17 @@ importers: marked: 4.0.19 nanoid: 4.0.0 slate: 0.81.1 - style9: 0.13.3 + style9: 0.14.0 libs/components/editor-plugins: specifiers: '@mui/icons-material': ^5.8.4 - date-fns: ^2.28.0 - style9: ^0.13.3 + date-fns: ^2.29.2 + style9: ^0.14.0 dependencies: '@mui/icons-material': 5.8.4 - date-fns: 2.28.0 - style9: 0.13.3 + date-fns: 2.29.2 + style9: 0.14.0 libs/components/icons: specifiers: {} @@ -500,20 +496,20 @@ importers: '@types/tinycolor2': ^1.4.3 '@types/turndown': ^5.0.1 clsx: ^1.2.1 - date-fns: ^2.28.0 - jotai: ^1.7.4 + date-fns: ^2.29.2 + jotai: ^1.8.1 tinycolor2: ^1.4.2 turndown: 7.1.1 dependencies: - '@date-io/date-fns': 2.14.0_date-fns@2.28.0 + '@date-io/date-fns': 2.14.0_date-fns@2.29.2 '@dnd-kit/core': 6.0.5 '@dnd-kit/modifiers': 6.0.0_@dnd-kit+core@6.0.5 '@dnd-kit/sortable': 7.0.1_@dnd-kit+core@6.0.5 '@dnd-kit/utilities': 3.2.0 '@mui/icons-material': 5.8.4 clsx: 1.2.1 - date-fns: 2.28.0 - jotai: 1.7.4 + date-fns: 2.29.2 + jotai: 1.8.1 tinycolor2: 1.4.2 turndown: 7.1.1 devDependencies: @@ -532,7 +528,7 @@ importers: '@mui/x-date-pickers': ^5.0.0-alpha.7 '@mui/x-date-pickers-pro': ^5.0.0-alpha.7 '@types/react-date-range': ^1.4.4 - clsx: ^1.2.0 + clsx: ^1.2.1 notistack: ^2.0.5 react-date-range: ^1.4.0 dependencies: @@ -543,12 +539,12 @@ importers: '@mui/base': 5.0.0-alpha.88 '@mui/material': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i '@mui/system': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i - '@mui/x-date-pickers': 5.0.0-alpha.7_3ze6eywwrphmf4xmeajh7ll6xm - '@mui/x-date-pickers-pro': 5.0.0-alpha.7_3ze6eywwrphmf4xmeajh7ll6xm + '@mui/x-date-pickers': 5.0.0-alpha.7_k34ytkg6gx4xxob5q3piijp2ce + '@mui/x-date-pickers-pro': 5.0.0-alpha.7_k34ytkg6gx4xxob5q3piijp2ce '@types/react-date-range': 1.4.4 - clsx: 1.2.0 + clsx: 1.2.1 notistack: 2.0.5_5ejcbl776hpy2drdn6qveocmsu - react-date-range: 1.4.0_date-fns@2.28.0 + react-date-range: 1.4.0_date-fns@2.29.2 libs/datasource/commands: specifiers: {} @@ -570,6 +566,9 @@ importers: dependencies: ffc-js-client-side-sdk: 1.1.5 + libs/datasource/jwst/pkg: + specifiers: {} + libs/datasource/jwt: specifiers: '@types/debug': ^4.1.7 @@ -651,12 +650,12 @@ importers: libs/datasource/state: specifiers: - firebase: ^9.9.2 - jotai: ^1.7.4 + firebase: ^9.9.3 + jotai: ^1.8.1 dependencies: - jotai: 1.7.4 + jotai: 1.8.1 devDependencies: - firebase: 9.9.2 + firebase: 9.9.3 libs/framework/virgo: specifiers: {} @@ -2258,13 +2257,8 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@codemirror/autocomplete/6.0.3_nq4pwfkqi5icglf26kczcr4s2i: + /@codemirror/autocomplete/6.0.3: resolution: {integrity: sha512-JTSBDC4tUyR8iRmCwQJaYpTXtOZmRn4gKjw1Fu4xIatFPqTJ7m0QRCdkdbzlvMovzjTiuHp4a8WUEB1c/LtiHg==} - peerDependencies: - '@codemirror/language': ^6.0.0 - '@codemirror/state': ^6.0.0 - '@codemirror/view': ^6.0.0 - '@lezer/common': ^1.0.0 dependencies: '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 @@ -2288,30 +2282,25 @@ packages: '@lezer/cpp': 1.0.0 dev: false - /@codemirror/lang-css/6.0.0_bmjizg7gr5ieupmvn5u62mbipm: + /@codemirror/lang-css/6.0.0: resolution: {integrity: sha512-jBqc+BTuwhNOTlrimFghLlSrN6iFuE44HULKWoR4qKYObhOIl9Lci1iYj6zMIte1XTQmZguNvjXMyr43LUKwSw==} dependencies: - '@codemirror/autocomplete': 6.0.3_nq4pwfkqi5icglf26kczcr4s2i + '@codemirror/autocomplete': 6.0.3 '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 '@lezer/css': 1.0.0 - transitivePeerDependencies: - - '@codemirror/view' - - '@lezer/common' dev: false - /@codemirror/lang-html/6.1.0_@codemirror+view@6.2.0: + /@codemirror/lang-html/6.1.0: resolution: {integrity: sha512-gA7NmJxqvnhwza05CvR7W/39Ap9r/4Vs9uiC0IeFYo1hSlJzc/8N6Evviz6vTW1x8SpHcRYyqKOf6rpl6LfWtg==} dependencies: - '@codemirror/autocomplete': 6.0.3_nq4pwfkqi5icglf26kczcr4s2i - '@codemirror/lang-css': 6.0.0_bmjizg7gr5ieupmvn5u62mbipm + '@codemirror/autocomplete': 6.0.3 + '@codemirror/lang-css': 6.0.0 '@codemirror/lang-javascript': 6.0.2 '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 '@lezer/common': 1.0.0 '@lezer/html': 1.0.0 - transitivePeerDependencies: - - '@codemirror/view' dev: false /@codemirror/lang-java/6.0.0: @@ -2324,7 +2313,7 @@ packages: /@codemirror/lang-javascript/6.0.2: resolution: {integrity: sha512-BZRJ9u/zl16hLkSpDAWm73mrfIR7HJrr0lvnhoSOCQVea5BglguWI/slxexhvUb0CB5cXgKWuo2bM+N9EhIaZw==} dependencies: - '@codemirror/autocomplete': 6.0.3_nq4pwfkqi5icglf26kczcr4s2i + '@codemirror/autocomplete': 6.0.3 '@codemirror/language': 6.2.1 '@codemirror/lint': 6.0.0 '@codemirror/state': 6.1.1 @@ -2352,7 +2341,7 @@ packages: /@codemirror/lang-markdown/6.0.1: resolution: {integrity: sha512-pHPQuRwf9cUrmkmsTHRjtS9ZnGu3fA9YzAdh2++d+L9wbfnC2XbKh0Xvm/0YiUjdCnoCx9wDFEoCuAnkqKWLIw==} dependencies: - '@codemirror/lang-html': 6.1.0_@codemirror+view@6.2.0 + '@codemirror/lang-html': 6.1.0 '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 '@codemirror/view': 6.2.0 @@ -2360,16 +2349,14 @@ packages: '@lezer/markdown': 1.0.1 dev: false - /@codemirror/lang-php/6.0.0_@codemirror+view@6.2.0: + /@codemirror/lang-php/6.0.0: resolution: {integrity: sha512-96CEjq0xEgbzc6bdFPwILPfZ6m8917JRbh2oPszZJABlYxG4Y+eYjtYkUTDb4yuyjQKyigHoeGC6zoIOYA1NWA==} dependencies: - '@codemirror/lang-html': 6.1.0_@codemirror+view@6.2.0 + '@codemirror/lang-html': 6.1.0 '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 '@lezer/common': 1.0.0 '@lezer/php': 1.0.0 - transitivePeerDependencies: - - '@codemirror/view' dev: false /@codemirror/lang-python/6.0.1: @@ -2386,29 +2373,24 @@ packages: '@lezer/rust': 1.0.0 dev: false - /@codemirror/lang-sql/6.1.0_bmjizg7gr5ieupmvn5u62mbipm: + /@codemirror/lang-sql/6.1.0: resolution: {integrity: sha512-eTNTP0+uNHqYClCvJ3QGE7mn1S96QJFNsK76dB4c1pYAQjbgVVjy5DqtD3//A44rp2kuRkgBccRaPKrWDzBdNQ==} dependencies: - '@codemirror/autocomplete': 6.0.3_nq4pwfkqi5icglf26kczcr4s2i + '@codemirror/autocomplete': 6.0.3 '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 '@lezer/highlight': 1.0.0 '@lezer/lr': 1.2.0 - transitivePeerDependencies: - - '@codemirror/view' - - '@lezer/common' dev: false - /@codemirror/lang-xml/6.0.0_@codemirror+view@6.2.0: + /@codemirror/lang-xml/6.0.0: resolution: {integrity: sha512-M/HLWxIiP956xGjtrxkeHkCmDGVQGKu782x8pOH5CLJIMkWtiB1DWfDoDHqpFjdEE9dkfcqPWvYfVi6GbhuXEg==} dependencies: - '@codemirror/autocomplete': 6.0.3_nq4pwfkqi5icglf26kczcr4s2i + '@codemirror/autocomplete': 6.0.3 '@codemirror/language': 6.2.1 '@codemirror/state': 6.1.1 '@lezer/common': 1.0.0 '@lezer/xml': 1.0.0 - transitivePeerDependencies: - - '@codemirror/view' dev: false /@codemirror/language/6.2.1: @@ -2547,7 +2529,7 @@ packages: bluebird: 3.7.1 debug: 4.3.4 lodash: 4.17.21 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 transitivePeerDependencies: - supports-color dev: true @@ -2565,7 +2547,7 @@ packages: resolution: {integrity: sha512-qFN64hiFjmlDHJhu+9xMkdfDG2jLsggNxKXglnekUpXSq8faiqZgtHm2lsHCUuaPDTV6wuXHcCl8J1GQ5wLmPw==} dev: false - /@date-io/date-fns/2.14.0_date-fns@2.28.0: + /@date-io/date-fns/2.14.0_date-fns@2.29.2: resolution: {integrity: sha512-4fJctdVyOd5cKIKGaWUM+s3MUXMuzkZaHuTY15PH70kU1YTMrCoauA7hgQVx9qj0ZEbGrH9VSPYJYnYro7nKiA==} peerDependencies: date-fns: ^2.0.0 @@ -2574,7 +2556,7 @@ packages: optional: true dependencies: '@date-io/core': 2.14.0 - date-fns: 2.28.0 + date-fns: 2.29.2 dev: false /@date-io/dayjs/2.14.0: @@ -2613,7 +2595,7 @@ packages: /@dnd-kit/accessibility/3.0.1: resolution: {integrity: sha512-HXRrwS9YUYQO9lFRc/49uO/VICbM+O+ZRpFDe9Pd1rwVv2PCNkRiTZRdxrDgng/UkvdC3Re9r2vwPpXXrWeFzg==} peerDependencies: - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: react: optional: true @@ -2624,8 +2606,8 @@ packages: /@dnd-kit/core/6.0.5: resolution: {integrity: sha512-3nL+Zy5cT+1XwsWdlXIvGIFvbuocMyB4NBxTN74DeBaBqeWdH9JsnKwQv7buZQgAHmAH+eIENfS1ginkvW6bCw==} peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' + react: '>=16.8.0 || 18' + react-dom: '>=16.8.0 || 18' peerDependenciesMeta: react: optional: true @@ -2653,7 +2635,7 @@ packages: resolution: {integrity: sha512-n77qAzJQtMMywu25sJzhz3gsHnDOUlEjTtnRl8A87rWIhnu32zuP+7zmFjwGgvqfXmRufqiHOSlH7JPC/tnJ8Q==} peerDependencies: '@dnd-kit/core': ^6.0.4 - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: react: optional: true @@ -2666,7 +2648,7 @@ packages: /@dnd-kit/utilities/3.2.0: resolution: {integrity: sha512-h65/pn2IPCCIWwdlR2BMLqRkDxpTEONA+HQW3n765HBijLYGyrnTCLa2YQt8VVjjSQD6EfFlTE6aS2Q/b6nb2g==} peerDependencies: - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: react: optional: true @@ -2794,7 +2776,7 @@ packages: peerDependencies: '@babel/core': ^7.0.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -2817,7 +2799,7 @@ packages: peerDependencies: '@babel/core': ^7.0.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -2835,38 +2817,12 @@ packages: hoist-non-react-statics: 3.3.2 dev: false - /@emotion/react/11.9.3_4jaruczdv2uxjj3lb2xbkiuci4: - resolution: {integrity: sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ==} - peerDependencies: - '@babel/core': ^7.0.0 - '@types/react': '*' - react: '>=16.8.0' - peerDependenciesMeta: - '@babel/core': - optional: true - '@types/react': - optional: true - react: - optional: true - dependencies: - '@babel/core': 7.18.6 - '@babel/runtime': 7.18.6 - '@emotion/babel-plugin': 11.9.2_@babel+core@7.18.6 - '@emotion/cache': 11.9.3 - '@emotion/serialize': 1.0.4 - '@emotion/utils': 1.1.0 - '@emotion/weak-memoize': 0.2.5 - '@types/react': 18.0.14 - hoist-non-react-statics: 3.3.2 - react: 18.2.0 - dev: false - /@emotion/react/11.9.3_@babel+core@7.18.6: resolution: {integrity: sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ==} peerDependencies: '@babel/core': ^7.0.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -2885,6 +2841,32 @@ packages: hoist-non-react-statics: 3.3.2 dev: false + /@emotion/react/11.9.3_aev5mndowrsc2o4rquiaswzsei: + resolution: {integrity: sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ==} + peerDependencies: + '@babel/core': ^7.0.0 + '@types/react': '*' + react: '>=16.8.0 || 18' + peerDependenciesMeta: + '@babel/core': + optional: true + '@types/react': + optional: true + react: + optional: true + dependencies: + '@babel/core': 7.18.6 + '@babel/runtime': 7.18.6 + '@emotion/babel-plugin': 11.9.2_@babel+core@7.18.6 + '@emotion/cache': 11.9.3 + '@emotion/serialize': 1.0.4 + '@emotion/utils': 1.1.0 + '@emotion/weak-memoize': 0.2.5 + '@types/react': 18.0.17 + hoist-non-react-statics: 3.3.2 + react: 18.2.0 + dev: false + /@emotion/serialize/1.0.4: resolution: {integrity: sha512-1JHamSpH8PIfFwAMryO2bNka+y8+KA5yga5Ocf2d7ZEiJjb7xlLW7aknBGZqJLajuLOvJ+72vN+IBSwPlXD1Pg==} dependencies: @@ -2919,7 +2901,7 @@ packages: '@babel/core': ^7.0.0 '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -2944,7 +2926,7 @@ packages: '@babel/core': ^7.0.0 '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -2968,7 +2950,7 @@ packages: '@babel/core': ^7.0.0 '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -2993,7 +2975,7 @@ packages: '@babel/core': ^7.0.0 '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -3013,13 +2995,13 @@ packages: '@emotion/utils': 1.1.0 dev: false - /@emotion/styled/11.9.3_toiz7tndcw4z2b7gxmmeo5fkcu: + /@emotion/styled/11.9.3_lzq4tq5osthlqcqhyhuicy5gfy: resolution: {integrity: sha512-o3sBNwbtoVz9v7WB1/Y/AmXl69YHmei2mrVnK7JgyBJ//Rst5yqPZCecEJlMlJrFeWHp+ki/54uN265V2pEcXA==} peerDependencies: '@babel/core': ^7.0.0 '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' - react: '>=16.8.0' + react: '>=16.8.0 || 18' peerDependenciesMeta: '@babel/core': optional: true @@ -3034,10 +3016,10 @@ packages: '@babel/runtime': 7.18.6 '@emotion/babel-plugin': 11.9.2_@babel+core@7.18.6 '@emotion/is-prop-valid': 1.1.3 - '@emotion/react': 11.9.3_4jaruczdv2uxjj3lb2xbkiuci4 + '@emotion/react': 11.9.3_aev5mndowrsc2o4rquiaswzsei '@emotion/serialize': 1.0.4 '@emotion/utils': 1.1.0 - '@types/react': 18.0.14 + '@types/react': 18.0.17 react: 18.2.0 dev: false @@ -3089,14 +3071,14 @@ packages: text-decoding: 1.0.0 dev: false - /@firebase/analytics-compat/0.1.13_ntdu3hfexp42gsr3dmzonffheq: + /@firebase/analytics-compat/0.1.13_kowmy6vzi2xcdysg3n6ul4qaae: resolution: {integrity: sha512-QC1DH/Dwc8fBihn0H+jocBWyE17GF1fOCpCrpAiQ2u16F/NqsVDVG4LjIqdhq963DXaXneNY7oDwa25Up682AA==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/analytics': 0.8.0_@firebase+app@0.7.30 + '@firebase/analytics': 0.8.0_@firebase+app@0.7.31 '@firebase/analytics-types': 0.7.0 - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3108,27 +3090,27 @@ packages: resolution: {integrity: sha512-DNE2Waiwy5+zZnCfintkDtBfaW6MjIG883474v6Z0K1XZIvl76cLND4iv0YUb48leyF+PJK1KO2XrgHb/KpmhQ==} dev: true - /@firebase/analytics/0.8.0_@firebase+app@0.7.30: + /@firebase/analytics/0.8.0_@firebase+app@0.7.31: resolution: {integrity: sha512-wkcwainNm8Cu2xkJpDSHfhBSdDJn86Q1TZNmLWc67VrhZUHXIKXxIqb65/tNUVE+I8+sFiDDNwA+9R3MqTQTaA==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 - '@firebase/installations': 0.5.12_@firebase+app@0.7.30 + '@firebase/installations': 0.5.12_@firebase+app@0.7.31 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 tslib: 2.4.0 dev: true - /@firebase/app-check-compat/0.2.12_ntdu3hfexp42gsr3dmzonffheq: + /@firebase/app-check-compat/0.2.12_kowmy6vzi2xcdysg3n6ul4qaae: resolution: {integrity: sha512-GFppNLlUyMN9Iq31ME/+GkjRVKlc+MeanzUKQ9UaR73ZsYH3oX3Ja+xjoYgixaVJDDG+ofBYR7ZXTkkQdSR/pw==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-check': 0.5.12_@firebase+app@0.7.30 + '@firebase/app-check': 0.5.12_@firebase+app@0.7.31 '@firebase/app-check-types': 0.4.0 - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 @@ -3145,22 +3127,22 @@ packages: resolution: {integrity: sha512-SsWafqMABIOu7zLgWbmwvHGOeQQVQlwm42kwwubsmfLmL4Sf5uGpBfDhQ0CAkpi7bkJ/NwNFKafNDL9prRNP0Q==} dev: true - /@firebase/app-check/0.5.12_@firebase+app@0.7.30: + /@firebase/app-check/0.5.12_@firebase+app@0.7.31: resolution: {integrity: sha512-l+MmvupSGT/F+I5ei7XjhEfpoL4hLVJr0vUwcG5NEf2hAkQnySli9fnbl9fZu1BJaQ2kthrMmtg1gcbcM9BUCQ==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 tslib: 2.4.0 dev: true - /@firebase/app-compat/0.1.31: - resolution: {integrity: sha512-oH3F4Pf0/Q0WTyNynMlaoM1qjUTTu7ofDdAWUOgr9BH9gftIClqeCulltXSQH3DO3XUE61pIIpIakAWQ7zzumA==} + /@firebase/app-compat/0.1.32: + resolution: {integrity: sha512-dChnJsnHxih0MYQxCWBPAruqK2M4ba/t+DvKu8IcRpd4FkcUQ8FO19Z963nCdXyu2T6cxPcwCopKWaWlymBVVA==} dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 @@ -3170,8 +3152,8 @@ packages: /@firebase/app-types/0.7.0: resolution: {integrity: sha512-6fbHQwDv2jp/v6bXhBw2eSRbNBpxHcd1NBF864UksSMVIqIyri9qpJB1Mn6sGZE+bnDsSQBC5j2TbMxYsJQkQg==} - /@firebase/app/0.7.30: - resolution: {integrity: sha512-uJRMShpCWCrW6eO+/UuN0ExgztPMpK/w/AUryHJh7Ll4lFkc71pqE9P/XlfE+XXi0zkWoXVgPeLAQDkUJwgmMA==} + /@firebase/app/0.7.31: + resolution: {integrity: sha512-pqCkY2wC5pRBVH1oYliD9E0aSW6qisuMy7meaCtGzwaVcE8AFMhW9xhxHuBMpX1291+2iimUZWnCxSL9DaUUGA==} dependencies: '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 @@ -3180,13 +3162,13 @@ packages: tslib: 2.4.0 dev: true - /@firebase/auth-compat/0.2.18_53yvy43rwpg2c45kgeszsxtrca: + /@firebase/auth-compat/0.2.18_kg6iqletipudcxzgqetrtqyldy: resolution: {integrity: sha512-Fw2PJS0G/tGrfyEBcYJQ42sfy5+sANrK5xd7tuzgV7zLFW5rYkHUIZngXjuOBwLOcfO2ixa/FavfeJle3oJ38Q==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 - '@firebase/auth': 0.20.5_@firebase+app@0.7.30 + '@firebase/app-compat': 0.1.32 + '@firebase/auth': 0.20.5_@firebase+app@0.7.31 '@firebase/auth-types': 0.11.0_pbfwexsq7uf6mrzcwnikj3g37m '@firebase/component': 0.5.17 '@firebase/util': 1.6.3 @@ -3201,15 +3183,6 @@ packages: - utf-8-validate dev: true - /@firebase/auth-interop-types/0.1.6_@firebase+util@1.6.3: - resolution: {integrity: sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==} - peerDependencies: - '@firebase/app-types': 0.x - '@firebase/util': 1.x - dependencies: - '@firebase/util': 1.6.3 - dev: false - /@firebase/auth-interop-types/0.1.6_pbfwexsq7uf6mrzcwnikj3g37m: resolution: {integrity: sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==} peerDependencies: @@ -3218,7 +3191,6 @@ packages: dependencies: '@firebase/app-types': 0.7.0 '@firebase/util': 1.6.3 - dev: true /@firebase/auth-types/0.11.0_pbfwexsq7uf6mrzcwnikj3g37m: resolution: {integrity: sha512-q7Bt6cx+ySj9elQHTsKulwk3+qDezhzRBFC9zlQ1BjgMueUOnGMcvqmU0zuKlQ4RhLSH7MNAdBV2znVaoN3Vxw==} @@ -3230,12 +3202,12 @@ packages: '@firebase/util': 1.6.3 dev: true - /@firebase/auth/0.20.5_@firebase+app@0.7.30: + /@firebase/auth/0.20.5_@firebase+app@0.7.31: resolution: {integrity: sha512-SbKj7PCAuL0lXEToUOoprc1im2Lr/bzOePXyPC7WWqVgdVBt0qovbfejlzKYwJLHUAPg9UW1y3XYe3IlbXr77w==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 @@ -3254,11 +3226,11 @@ packages: '@firebase/util': 1.6.3 tslib: 2.4.0 - /@firebase/database-compat/0.2.4: + /@firebase/database-compat/0.2.4_@firebase+app-types@0.7.0: resolution: {integrity: sha512-VtsGixO5mTjNMJn6PwxAJEAR70fj+3blCXIdQKel3q+eYGZAfdqxox1+tzZDnf9NWBJpaOgAHPk3JVDxEo9NFQ==} dependencies: '@firebase/component': 0.5.17 - '@firebase/database': 0.13.4 + '@firebase/database': 0.13.4_@firebase+app-types@0.7.0 '@firebase/database-types': 0.9.12 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 @@ -3267,12 +3239,12 @@ packages: - '@firebase/app-types' dev: false - /@firebase/database-compat/0.2.4_@firebase+app-types@0.7.0: - resolution: {integrity: sha512-VtsGixO5mTjNMJn6PwxAJEAR70fj+3blCXIdQKel3q+eYGZAfdqxox1+tzZDnf9NWBJpaOgAHPk3JVDxEo9NFQ==} + /@firebase/database-compat/0.2.5_@firebase+app-types@0.7.0: + resolution: {integrity: sha512-fj88gwtNJMcJBDjcTMbCuYEiVzuGb76rTOaaiAOqxR+unzvvbs2KU5KbFyl83jcpIjY6NIt+xXNrCXpzo7Zp3g==} dependencies: '@firebase/component': 0.5.17 - '@firebase/database': 0.13.4_@firebase+app-types@0.7.0 - '@firebase/database-types': 0.9.12 + '@firebase/database': 0.13.5_@firebase+app-types@0.7.0 + '@firebase/database-types': 0.9.13 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3292,22 +3264,30 @@ packages: dependencies: '@firebase/app-types': 0.7.0 '@firebase/util': 1.6.3 - - /@firebase/database/0.13.4: - resolution: {integrity: sha512-NW7bOoiaC4sJCj6DY/m9xHoFNa0CK32YPMCh6FiMweLCDQbOZM8Ql/Kn6yyuxCb7K7ypz9eSbRlCWQJsJRQjhg==} - dependencies: - '@firebase/auth-interop-types': 0.1.6_@firebase+util@1.6.3 - '@firebase/component': 0.5.17 - '@firebase/logger': 0.3.3 - '@firebase/util': 1.6.3 - faye-websocket: 0.11.4 - tslib: 2.4.0 - transitivePeerDependencies: - - '@firebase/app-types' dev: false + /@firebase/database-types/0.9.13: + resolution: {integrity: sha512-dIJ1zGe3EHMhwcvukTOPzYlFYFIG1Et5Znl7s7y/ZTN2/toARRNnsv1qCKvqevIMYKvIrRsYOYfOXDS8l1YIJA==} + dependencies: + '@firebase/app-types': 0.7.0 + '@firebase/util': 1.6.3 + dev: true + /@firebase/database/0.13.4_@firebase+app-types@0.7.0: resolution: {integrity: sha512-NW7bOoiaC4sJCj6DY/m9xHoFNa0CK32YPMCh6FiMweLCDQbOZM8Ql/Kn6yyuxCb7K7ypz9eSbRlCWQJsJRQjhg==} + dependencies: + '@firebase/auth-interop-types': 0.1.6_pbfwexsq7uf6mrzcwnikj3g37m + '@firebase/component': 0.5.17 + '@firebase/logger': 0.3.3 + '@firebase/util': 1.6.3 + faye-websocket: 0.11.4 + tslib: 2.4.0 + transitivePeerDependencies: + - '@firebase/app-types' + dev: false + + /@firebase/database/0.13.5_@firebase+app-types@0.7.0: + resolution: {integrity: sha512-QmX73yi8URk36NAbykXeuAcJCjDtx3BzuxKJO3sL9B4CtjNFAfpWawVxoaaThocDWNAyMJxFhiL1kkaVraH7Lg==} dependencies: '@firebase/auth-interop-types': 0.1.6_pbfwexsq7uf6mrzcwnikj3g37m '@firebase/component': 0.5.17 @@ -3319,14 +3299,14 @@ packages: - '@firebase/app-types' dev: true - /@firebase/firestore-compat/0.1.23_53yvy43rwpg2c45kgeszsxtrca: + /@firebase/firestore-compat/0.1.23_kg6iqletipudcxzgqetrtqyldy: resolution: {integrity: sha512-QfcuyMAavp//fQnjSfCEpnbWi7spIdKaXys1kOLu7395fLr+U6ykmto1HUMCSz8Yus9cEr/03Ujdi2SUl2GUAA==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 - '@firebase/firestore': 3.4.14_@firebase+app@0.7.30 + '@firebase/firestore': 3.4.14_@firebase+app@0.7.31 '@firebase/firestore-types': 2.5.0_pbfwexsq7uf6mrzcwnikj3g37m '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3346,13 +3326,13 @@ packages: '@firebase/util': 1.6.3 dev: true - /@firebase/firestore/3.4.14_@firebase+app@0.7.30: + /@firebase/firestore/3.4.14_@firebase+app@0.7.31: resolution: {integrity: sha512-F4Pqd5OUBtJaAWWC39C0vrMLIdZtx7jsO7sARFHSiOZY/8bikfH9YovIRkpxk7OSs3HT/SgVdK0B1vISGNSnJA==} engines: {node: '>=10.10.0'} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 @@ -3365,14 +3345,14 @@ packages: - encoding dev: true - /@firebase/functions-compat/0.2.4_53yvy43rwpg2c45kgeszsxtrca: + /@firebase/functions-compat/0.2.4_kg6iqletipudcxzgqetrtqyldy: resolution: {integrity: sha512-Crfn6il1yXGuXkjSd8nKrqR4XxPvuP19g64bXpM6Ix67qOkQg676kyOuww0FF17xN0NSXHfG8Pyf+CUrx8wJ5g==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 - '@firebase/functions': 0.8.4_54flq6t3lt2vkv56b3wekvuqsq + '@firebase/functions': 0.8.4_lwgt3sk4yfjgasfpmvix4ixi2u '@firebase/functions-types': 0.5.0 '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3386,12 +3366,12 @@ packages: resolution: {integrity: sha512-qza0M5EwX+Ocrl1cYI14zoipUX4gI/Shwqv0C1nB864INAD42Dgv4v94BCyxGHBg2kzlWy8PNafdP7zPO8aJQA==} dev: true - /@firebase/functions/0.8.4_54flq6t3lt2vkv56b3wekvuqsq: + /@firebase/functions/0.8.4_lwgt3sk4yfjgasfpmvix4ixi2u: resolution: {integrity: sha512-o1bB0xMyQKe+b246zGnjwHj4R6BH4mU2ZrSaa/3QvTpahUQ3hqYfkZPLOXCU7+vEFxHb3Hd4UUjkFhxoAcPqLA==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/app-check-interop-types': 0.1.0 '@firebase/auth-interop-types': 0.1.6_pbfwexsq7uf6mrzcwnikj3g37m '@firebase/component': 0.5.17 @@ -3404,14 +3384,14 @@ packages: - encoding dev: true - /@firebase/installations-compat/0.1.12_53yvy43rwpg2c45kgeszsxtrca: + /@firebase/installations-compat/0.1.12_kg6iqletipudcxzgqetrtqyldy: resolution: {integrity: sha512-BIhFpWIn/GkuOa+jnXkp3SDJT2RLYJF6MWpinHIBKFJs7MfrgYZ3zQ1AlhobDEql+bkD1dK4dB5sNcET2T+EyA==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 - '@firebase/installations': 0.5.12_@firebase+app@0.7.30 + '@firebase/installations': 0.5.12_@firebase+app@0.7.31 '@firebase/installations-types': 0.4.0_@firebase+app-types@0.7.0 '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3428,12 +3408,12 @@ packages: '@firebase/app-types': 0.7.0 dev: true - /@firebase/installations/0.5.12_@firebase+app@0.7.30: + /@firebase/installations/0.5.12_@firebase+app@0.7.31: resolution: {integrity: sha512-Zq43fCE0PB5tGJ3ojzx5RNQzKdej1188qgAk22rwjuhP7npaG/PlJqDG1/V0ZjTLRePZ1xGrfXSPlA17c/vtNw==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 '@firebase/util': 1.6.3 idb: 7.0.1 @@ -3445,14 +3425,14 @@ packages: dependencies: tslib: 2.4.0 - /@firebase/messaging-compat/0.1.16_ntdu3hfexp42gsr3dmzonffheq: + /@firebase/messaging-compat/0.1.16_kowmy6vzi2xcdysg3n6ul4qaae: resolution: {integrity: sha512-uG7rWcXJzU8vvlEBFpwG1ndw/GURrrmKcwsHopEWbsPGjMRaVWa7XrdKbvIR7IZohqPzcC/V9L8EeqF4Q4lz8w==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 - '@firebase/messaging': 0.9.16_@firebase+app@0.7.30 + '@firebase/messaging': 0.9.16_@firebase+app@0.7.31 '@firebase/util': 1.6.3 tslib: 2.4.0 transitivePeerDependencies: @@ -3463,29 +3443,29 @@ packages: resolution: {integrity: sha512-DbvUl/rXAZpQeKBnwz0NYY5OCqr2nFA0Bj28Fmr3NXGqR4PAkfTOHuQlVtLO1Nudo3q0HxAYLa68ZDAcuv2uKQ==} dev: true - /@firebase/messaging/0.9.16_@firebase+app@0.7.30: + /@firebase/messaging/0.9.16_@firebase+app@0.7.31: resolution: {integrity: sha512-Yl9gGrAvJF6C1gg3+Cr2HxlL6APsDEkrorkFafmSP1l+rg1epZKoOAcKJbSF02Vtb50wfb9FqGGy8tzodgETxg==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 - '@firebase/installations': 0.5.12_@firebase+app@0.7.30 + '@firebase/installations': 0.5.12_@firebase+app@0.7.31 '@firebase/messaging-interop-types': 0.1.0 '@firebase/util': 1.6.3 idb: 7.0.1 tslib: 2.4.0 dev: true - /@firebase/performance-compat/0.1.12_ntdu3hfexp42gsr3dmzonffheq: + /@firebase/performance-compat/0.1.12_kowmy6vzi2xcdysg3n6ul4qaae: resolution: {integrity: sha512-IBORzUeGY1MGdZnsix9Mu5z4+C3WHIwalu0usxvygL0EZKHztGG8bppYPGH/b5vvg8QyHs9U+Pn1Ot2jZhffQQ==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 - '@firebase/performance': 0.5.12_@firebase+app@0.7.30 + '@firebase/performance': 0.5.12_@firebase+app@0.7.31 '@firebase/performance-types': 0.1.0 '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3497,36 +3477,28 @@ packages: resolution: {integrity: sha512-6p1HxrH0mpx+622Ql6fcxFxfkYSBpE3LSuwM7iTtYU2nw91Hj6THC8Bc8z4nboIq7WvgsT/kOTYVVZzCSlXl8w==} dev: true - /@firebase/performance/0.5.12_@firebase+app@0.7.30: + /@firebase/performance/0.5.12_@firebase+app@0.7.31: resolution: {integrity: sha512-MPVTkOkGrm2SMQgI1FPNBm85y2pPqlPb6VDjIMCWkVpAr6G1IZzUT24yEMySRcIlK/Hh7/Qu1Nu5ASRzRuX6+Q==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 - '@firebase/installations': 0.5.12_@firebase+app@0.7.30 + '@firebase/installations': 0.5.12_@firebase+app@0.7.31 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 tslib: 2.4.0 dev: true - /@firebase/polyfill/0.3.36: - resolution: {integrity: sha512-zMM9oSJgY6cT2jx3Ce9LYqb0eIpDE52meIzd/oe/y70F+v9u1LDqk5kUF5mf16zovGBWMNFmgzlsh6Wj0OsFtg==} - dependencies: - core-js: 3.6.5 - promise-polyfill: 8.1.3 - whatwg-fetch: 2.0.4 - dev: true - - /@firebase/remote-config-compat/0.1.12_ntdu3hfexp42gsr3dmzonffheq: + /@firebase/remote-config-compat/0.1.12_kowmy6vzi2xcdysg3n6ul4qaae: resolution: {integrity: sha512-Yz7Gtb2rLa7ykXZX9DnSTId8CXd++jFFLW3foUImrYwJEtWgLJc7gwkRfd1M73IlKGNuQAY+DpUNF0n1dLbecA==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 '@firebase/logger': 0.3.3 - '@firebase/remote-config': 0.3.11_@firebase+app@0.7.30 + '@firebase/remote-config': 0.3.11_@firebase+app@0.7.31 '@firebase/remote-config-types': 0.2.0 '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3538,27 +3510,27 @@ packages: resolution: {integrity: sha512-hqK5sCPeZvcHQ1D6VjJZdW6EexLTXNMJfPdTwbD8NrXUw6UjWC4KWhLK/TSlL0QPsQtcKRkaaoP+9QCgKfMFPw==} dev: true - /@firebase/remote-config/0.3.11_@firebase+app@0.7.30: + /@firebase/remote-config/0.3.11_@firebase+app@0.7.31: resolution: {integrity: sha512-qA84dstrvVpO7rWT/sb2CLv1kjHVmz59SRFPKohJJYFBcPOGK4Pe4FWWhKAE9yg1Gnl0qYAGkahOwNawq3vE0g==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 - '@firebase/installations': 0.5.12_@firebase+app@0.7.30 + '@firebase/installations': 0.5.12_@firebase+app@0.7.31 '@firebase/logger': 0.3.3 '@firebase/util': 1.6.3 tslib: 2.4.0 dev: true - /@firebase/storage-compat/0.1.17_53yvy43rwpg2c45kgeszsxtrca: + /@firebase/storage-compat/0.1.17_kg6iqletipudcxzgqetrtqyldy: resolution: {integrity: sha512-nOYmnpI0gwoz5nROseMi9WbmHGf+xumfsOvdPyMZAjy0VqbDnpKIwmTUZQBdR+bLuB5oIkHQsvw9nbb1SH+PzQ==} peerDependencies: '@firebase/app-compat': 0.x dependencies: - '@firebase/app-compat': 0.1.31 + '@firebase/app-compat': 0.1.32 '@firebase/component': 0.5.17 - '@firebase/storage': 0.9.9_@firebase+app@0.7.30 + '@firebase/storage': 0.9.9_@firebase+app@0.7.31 '@firebase/storage-types': 0.6.0_pbfwexsq7uf6mrzcwnikj3g37m '@firebase/util': 1.6.3 tslib: 2.4.0 @@ -3578,12 +3550,12 @@ packages: '@firebase/util': 1.6.3 dev: true - /@firebase/storage/0.9.9_@firebase+app@0.7.30: + /@firebase/storage/0.9.9_@firebase+app@0.7.31: resolution: {integrity: sha512-Zch7srLT2SIh9y2nCVv/4Kne0HULn7OPkmreY70BJTUJ+g5WLRjggBq6x9fV5ls9V38iqMWfn4prxzX8yIc08A==} peerDependencies: '@firebase/app': 0.x dependencies: - '@firebase/app': 0.7.30 + '@firebase/app': 0.7.31 '@firebase/component': 0.5.17 '@firebase/util': 1.6.3 node-fetch: 2.6.7 @@ -3702,33 +3674,6 @@ packages: protobufjs: 6.11.3 yargs: 16.2.0 - /@headlessui/react/1.6.5_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-3VkKteDxlxf3fE0KbfO9t60KC1lM7YNpZggLpwzVNg1J/zwL+h+4N7MBlFDVpInZI3rKlZGpNx0PWsG/9c2vQg==} - engines: {node: '>=10'} - peerDependencies: - react: ^16 || ^17 || ^18 - react-dom: ^16 || ^17 || ^18 - peerDependenciesMeta: - react: - optional: true - react-dom: - optional: true - dependencies: - react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - dev: true - - /@heroicons/react/1.0.6_react@18.2.0: - resolution: {integrity: sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ==} - peerDependencies: - react: '>= 16' - peerDependenciesMeta: - react: - optional: true - dependencies: - react: 18.2.0 - dev: true - /@humanwhocodes/config-array/0.9.5: resolution: {integrity: sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==} engines: {node: '>=10.10.0'} @@ -3765,7 +3710,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -3777,7 +3722,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 jest-message-util: 28.1.1 jest-util: 28.1.1 @@ -3798,14 +3743,14 @@ packages: '@jest/test-result': 28.1.1 '@jest/transform': 28.1.2 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.3.2 exit: 0.1.2 graceful-fs: 4.2.10 jest-changed-files: 28.0.2 - jest-config: 28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq + jest-config: 28.1.2_3glepa5322b7j342guju4hszoy jest-haste-map: 28.1.1 jest-message-util: 28.1.1 jest-regex-util: 28.0.2 @@ -3840,7 +3785,7 @@ packages: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-mock: 27.5.1 dev: true @@ -3850,7 +3795,7 @@ packages: dependencies: '@jest/fake-timers': 28.1.2 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-mock: 28.1.1 dev: true @@ -3877,7 +3822,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -3889,7 +3834,7 @@ packages: dependencies: '@jest/types': 28.1.1 '@sinonjs/fake-timers': 9.1.2 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-message-util: 28.1.1 jest-mock: 28.1.1 jest-util: 28.1.1 @@ -3929,8 +3874,8 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 - chalk: 4.1.0 + '@types/node': 18.7.13 + chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 glob: 7.2.3 @@ -3968,7 +3913,7 @@ packages: '@jest/transform': 28.1.2 '@jest/types': 28.1.1 '@jridgewell/trace-mapping': 0.3.14 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -4110,7 +4055,7 @@ packages: dependencies: '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 '@types/yargs': 16.0.4 chalk: 4.1.2 dev: true @@ -4122,7 +4067,7 @@ packages: '@jest/schemas': 28.0.2 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 '@types/yargs': 17.0.10 chalk: 4.1.2 dev: true @@ -4280,9 +4225,9 @@ packages: resolution: {integrity: sha512-uL7ej2F/3GUnZewsDQSHUVHoSBT3AQcTIdfdy6QeCHy7X26mtbcIvTRcjl2PzbbNQplppavSTibPiQG/giJ+ng==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - react-dom: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + react-dom: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -4296,18 +4241,18 @@ packages: '@mui/types': 7.1.4 '@mui/utils': 5.8.6 '@popperjs/core': 2.11.5 - clsx: 1.2.0 + clsx: 1.2.1 prop-types: 15.8.1 react-is: 17.0.2 dev: false - /@mui/base/5.0.0-alpha.88_twyhzqqpkwvvgrmyeapdo6i4my: + /@mui/base/5.0.0-alpha.88_zxljzmqdrxwnuenbkrz77w74uy: resolution: {integrity: sha512-uL7ej2F/3GUnZewsDQSHUVHoSBT3AQcTIdfdy6QeCHy7X26mtbcIvTRcjl2PzbbNQplppavSTibPiQG/giJ+ng==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - react-dom: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + react-dom: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -4318,11 +4263,11 @@ packages: dependencies: '@babel/runtime': 7.18.6 '@emotion/is-prop-valid': 1.1.3 - '@mui/types': 7.1.4_@types+react@18.0.14 + '@mui/types': 7.1.4_@types+react@18.0.17 '@mui/utils': 5.8.6_react@18.2.0 '@popperjs/core': 2.11.5 - '@types/react': 18.0.14 - clsx: 1.2.0 + '@types/react': 18.0.17 + clsx: 1.2.1 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 @@ -4333,9 +4278,9 @@ packages: resolution: {integrity: sha512-ZgnSLrTXL4iUdLQhjp01dAOTQPQlnwrqjZRwDT3E6LZXEYn6cMv1MY6LZkWcF/zxrUnyasnsyMAgZ5d8AXS7bA==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - react-dom: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + react-dom: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -4359,8 +4304,8 @@ packages: engines: {node: '>=12.0.0'} peerDependencies: '@mui/material': ^5.0.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@mui/material': optional: true @@ -4377,8 +4322,8 @@ packages: engines: {node: '>=12.0.0'} peerDependencies: '@mui/material': ^5.0.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@mui/material': optional: true @@ -4391,13 +4336,13 @@ packages: '@mui/material': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i dev: false - /@mui/icons-material/5.8.4_vdnh4jyrnjwcar5vg6k35n5t6e: + /@mui/icons-material/5.8.4_wip2cf6yrkxu2zuyrl3lmpbdaa: resolution: {integrity: sha512-9Z/vyj2szvEhGWDvb+gG875bOGm8b8rlHBKOD1+nA3PcgC3fV6W1AU6pfOorPeBfH2X4mb9Boe97vHvaSndQvA==} engines: {node: '>=12.0.0'} peerDependencies: '@mui/material': ^5.0.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@mui/material': optional: true @@ -4407,8 +4352,8 @@ packages: optional: true dependencies: '@babel/runtime': 7.18.6 - '@mui/material': 5.8.7_h2u6a3oivtyocvjxeke7xcvlfa - '@types/react': 18.0.14 + '@mui/material': 5.8.7_mugunlselc52kyz7qt5aa5ixva + '@types/react': 18.0.17 react: 18.2.0 dev: false @@ -4418,9 +4363,9 @@ packages: peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - react-dom: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + react-dom: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4452,9 +4397,9 @@ packages: peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - react-dom: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + react-dom: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4475,22 +4420,22 @@ packages: '@mui/types': 7.1.4 '@mui/utils': 5.8.6 '@types/react-transition-group': 4.4.5 - clsx: 1.2.0 + clsx: 1.2.1 csstype: 3.1.0 prop-types: 15.8.1 react-is: 17.0.2 react-transition-group: 4.4.2 dev: false - /@mui/material/5.8.7_h2u6a3oivtyocvjxeke7xcvlfa: + /@mui/material/5.8.7_mugunlselc52kyz7qt5aa5ixva: resolution: {integrity: sha512-Oo62UhrgEi+BMLr3nUEASJgScE2/hhq14CbBUmrVV3GQlEGtqMZsy26Vb0AqEmphFeN3TXlsbM9aeW5yq8ZFlw==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - react-dom: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + react-dom: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4504,15 +4449,15 @@ packages: optional: true dependencies: '@babel/runtime': 7.18.6 - '@emotion/react': 11.9.3_4jaruczdv2uxjj3lb2xbkiuci4 - '@emotion/styled': 11.9.3_toiz7tndcw4z2b7gxmmeo5fkcu - '@mui/base': 5.0.0-alpha.88_twyhzqqpkwvvgrmyeapdo6i4my - '@mui/system': 5.8.7_2n63gx4a5hafw7crejwh35wbou - '@mui/types': 7.1.4_@types+react@18.0.14 + '@emotion/react': 11.9.3_aev5mndowrsc2o4rquiaswzsei + '@emotion/styled': 11.9.3_lzq4tq5osthlqcqhyhuicy5gfy + '@mui/base': 5.0.0-alpha.88_zxljzmqdrxwnuenbkrz77w74uy + '@mui/system': 5.8.7_q75tbj2u2psqs4y633sohfsc6i + '@mui/types': 7.1.4_@types+react@18.0.17 '@mui/utils': 5.8.6_react@18.2.0 - '@types/react': 18.0.14 + '@types/react': 18.0.17 '@types/react-transition-group': 4.4.5 - clsx: 1.2.0 + clsx: 1.2.1 csstype: 3.1.0 prop-types: 15.8.1 react: 18.2.0 @@ -4525,8 +4470,8 @@ packages: resolution: {integrity: sha512-yHsJk1qU9r/q0DlnxGRJPHyM0Y/nUv8FTNgDTiI9I58GWuVuZqeTUr7JRvPh6ybeP/FLtW5eXEavRK9wxVk4uQ==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -4538,12 +4483,12 @@ packages: prop-types: 15.8.1 dev: false - /@mui/private-theming/5.8.6_luyos4mouogwq6z3wafb3re4ce: + /@mui/private-theming/5.8.6_ug65io7jkbhmo4fihdmbrh3ina: resolution: {integrity: sha512-yHsJk1qU9r/q0DlnxGRJPHyM0Y/nUv8FTNgDTiI9I58GWuVuZqeTUr7JRvPh6ybeP/FLtW5eXEavRK9wxVk4uQ==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -4552,7 +4497,7 @@ packages: dependencies: '@babel/runtime': 7.18.6 '@mui/utils': 5.8.6_react@18.2.0 - '@types/react': 18.0.14 + '@types/react': 18.0.17 prop-types: 15.8.1 react: 18.2.0 dev: false @@ -4561,8 +4506,8 @@ packages: resolution: {integrity: sha512-Ys3WO39WqoGciGX9k5AIi/k2zJhlydv4FzlEEwtw9OqdMaV0ydK/TdZekKzjP9sTI/JcdAP3H5DWtUaPLQJjWg==} engines: {node: '>=12.0.0'} peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -4580,7 +4525,7 @@ packages: peerDependencies: '@emotion/react': ^11.4.1 '@emotion/styled': ^11.3.0 - react: ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4603,7 +4548,7 @@ packages: peerDependencies: '@emotion/react': ^11.4.1 '@emotion/styled': ^11.3.0 - react: ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4614,8 +4559,8 @@ packages: dependencies: '@babel/runtime': 7.18.6 '@emotion/cache': 11.9.3 - '@emotion/react': 11.9.3 - '@emotion/styled': 11.9.3_@emotion+react@11.9.3 + '@emotion/react': 11.9.3_@babel+core@7.18.6 + '@emotion/styled': 11.9.3_dc5dh2wp562rsjxvguwi2i3yzq csstype: 3.1.0 prop-types: 15.8.1 dev: false @@ -4626,7 +4571,7 @@ packages: peerDependencies: '@emotion/react': ^11.4.1 '@emotion/styled': ^11.3.0 - react: ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4637,40 +4582,8 @@ packages: dependencies: '@babel/runtime': 7.18.6 '@emotion/cache': 11.9.3 - '@emotion/react': 11.9.3_4jaruczdv2uxjj3lb2xbkiuci4 - '@emotion/styled': 11.9.3_toiz7tndcw4z2b7gxmmeo5fkcu - csstype: 3.1.0 - prop-types: 15.8.1 - react: 18.2.0 - dev: false - - /@mui/system/5.8.7_2n63gx4a5hafw7crejwh35wbou: - resolution: {integrity: sha512-yFoFbfO42FWeSUDrFPixYjpqySQMqVMOSbSlAxiKnwFpvXGGn/bkfQTboCRNO31fvES29FJLQd4mwwMHd5mXng==} - engines: {node: '>=12.0.0'} - peerDependencies: - '@emotion/react': ^11.5.0 - '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@emotion/react': - optional: true - '@emotion/styled': - optional: true - '@types/react': - optional: true - react: - optional: true - dependencies: - '@babel/runtime': 7.18.6 - '@emotion/react': 11.9.3_4jaruczdv2uxjj3lb2xbkiuci4 - '@emotion/styled': 11.9.3_toiz7tndcw4z2b7gxmmeo5fkcu - '@mui/private-theming': 5.8.6_luyos4mouogwq6z3wafb3re4ce - '@mui/styled-engine': 5.8.7_fdnqutfacy7v3gmlcm66flps3q - '@mui/types': 7.1.4_@types+react@18.0.14 - '@mui/utils': 5.8.6_react@18.2.0 - '@types/react': 18.0.14 - clsx: 1.2.0 + '@emotion/react': 11.9.3_aev5mndowrsc2o4rquiaswzsei + '@emotion/styled': 11.9.3_lzq4tq5osthlqcqhyhuicy5gfy csstype: 3.1.0 prop-types: 15.8.1 react: 18.2.0 @@ -4682,8 +4595,8 @@ packages: peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4706,14 +4619,46 @@ packages: prop-types: 15.8.1 dev: false + /@mui/system/5.8.7_q75tbj2u2psqs4y633sohfsc6i: + resolution: {integrity: sha512-yFoFbfO42FWeSUDrFPixYjpqySQMqVMOSbSlAxiKnwFpvXGGn/bkfQTboCRNO31fvES29FJLQd4mwwMHd5mXng==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@emotion/react': ^11.5.0 + '@emotion/styled': ^11.3.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 + peerDependenciesMeta: + '@emotion/react': + optional: true + '@emotion/styled': + optional: true + '@types/react': + optional: true + react: + optional: true + dependencies: + '@babel/runtime': 7.18.6 + '@emotion/react': 11.9.3_aev5mndowrsc2o4rquiaswzsei + '@emotion/styled': 11.9.3_lzq4tq5osthlqcqhyhuicy5gfy + '@mui/private-theming': 5.8.6_ug65io7jkbhmo4fihdmbrh3ina + '@mui/styled-engine': 5.8.7_fdnqutfacy7v3gmlcm66flps3q + '@mui/types': 7.1.4_@types+react@18.0.17 + '@mui/utils': 5.8.6_react@18.2.0 + '@types/react': 18.0.17 + clsx: 1.2.0 + csstype: 3.1.0 + prop-types: 15.8.1 + react: 18.2.0 + dev: false + /@mui/system/5.9.3_72v32ofbtgpmxm7mhvtx474vfu: resolution: {integrity: sha512-EXQV2POwncstHLYII+G4VSYdEFun1TjBbQSBDK76DbIkug8nPjtjAZ+3Kgk3/NoFIigW+vQ9cDVUZtlbRH6YMQ==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4742,8 +4687,8 @@ packages: peerDependencies: '@emotion/react': ^11.5.0 '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 - react: ^17.0.0 || ^18.0.0 + '@types/react': ^17.0.0 || ^18.0.0 || 18 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4775,7 +4720,7 @@ packages: optional: true dev: false - /@mui/types/7.1.4_@types+react@18.0.14: + /@mui/types/7.1.4_@types+react@18.0.17: resolution: {integrity: sha512-uveM3byMbthO+6tXZ1n2zm0W3uJCQYtwt/v5zV5I77v2v18u0ITkb8xwhsDD2i3V2Kye7SaNR6FFJ6lMuY/WqQ==} peerDependencies: '@types/react': '*' @@ -4783,7 +4728,7 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.0.14 + '@types/react': 18.0.17 dev: false /@mui/types/7.1.5: @@ -4799,7 +4744,7 @@ packages: resolution: {integrity: sha512-QM2Sd1xZo2jOt2Vz5Rmro+pi2FLJyiv4+OjxkUwXR3oUM65KSMAMLl/KNYU55s3W3DLRFP5MVwE4FhAbHseHAg==} engines: {node: '>=12.0.0'} peerDependencies: - react: ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -4815,7 +4760,7 @@ packages: resolution: {integrity: sha512-QM2Sd1xZo2jOt2Vz5Rmro+pi2FLJyiv4+OjxkUwXR3oUM65KSMAMLl/KNYU55s3W3DLRFP5MVwE4FhAbHseHAg==} engines: {node: '>=12.0.0'} peerDependencies: - react: ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -4832,7 +4777,7 @@ packages: resolution: {integrity: sha512-l0N5bcrenE9hnwZ/jPecpIRqsDFHkPXoFUcmkgysaJwVZzJ3yQkGXB47eqmXX5yyGrSc6HksbbqXEaUya+siew==} engines: {node: '>=12.0.0'} peerDependencies: - react: ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -4850,8 +4795,8 @@ packages: peerDependencies: '@mui/material': ^5.4.1 '@mui/system': ^5.4.1 - react: ^17.0.2 || ^18.0.0 - react-dom: ^17.0.2 || ^18.0.0 + react: ^17.0.2 || ^18.0.0 || 18 + react-dom: ^17.0.2 || ^18.0.0 || 18 peerDependenciesMeta: '@mui/material': optional: true @@ -4869,7 +4814,7 @@ packages: reselect: 4.1.6 dev: false - /@mui/x-date-pickers-pro/5.0.0-alpha.7_3ze6eywwrphmf4xmeajh7ll6xm: + /@mui/x-date-pickers-pro/5.0.0-alpha.7_k34ytkg6gx4xxob5q3piijp2ce: resolution: {integrity: sha512-Ni244FQNYmiPCGUS47E9FE5YYSTJZ4BxjUmQ8h2Mz0Ob+n+q2zXN+q2KzRjtuhBcH3w+VGjFD1zxvKxyAZkgbg==} engines: {node: '>=12.0.0'} peerDependencies: @@ -4879,7 +4824,7 @@ packages: dayjs: ^1.10.7 luxon: ^1.28.0 || ^2.0.0 moment: ^2.29.1 - react: ^17.0.2 || ^18.0.0 + react: ^17.0.2 || ^18.0.0 || 18 peerDependenciesMeta: '@mui/material': optional: true @@ -4895,17 +4840,17 @@ packages: optional: true dependencies: '@babel/runtime': 7.18.6 - '@date-io/date-fns': 2.14.0_date-fns@2.28.0 + '@date-io/date-fns': 2.14.0_date-fns@2.29.2 '@date-io/dayjs': 2.14.0 '@date-io/luxon': 2.14.0 '@date-io/moment': 2.14.0 '@mui/material': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i '@mui/system': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i '@mui/utils': 5.8.6 - '@mui/x-date-pickers': 5.0.0-alpha.7_3ze6eywwrphmf4xmeajh7ll6xm + '@mui/x-date-pickers': 5.0.0-alpha.7_k34ytkg6gx4xxob5q3piijp2ce '@mui/x-license-pro': 5.12.1 - clsx: 1.2.0 - date-fns: 2.28.0 + clsx: 1.2.1 + date-fns: 2.29.2 prop-types: 15.8.1 react-transition-group: 4.4.2 rifm: 0.12.1 @@ -4915,7 +4860,7 @@ packages: - react-dom dev: false - /@mui/x-date-pickers/5.0.0-alpha.7_3ze6eywwrphmf4xmeajh7ll6xm: + /@mui/x-date-pickers/5.0.0-alpha.7_k34ytkg6gx4xxob5q3piijp2ce: resolution: {integrity: sha512-y+RAkuC9riyoPD8mt2/Y9nV3+MxwCYfUOh2o09nFVnIKUSud37hhOMiX8BzAbQRO/2JoRByN5jEj2zuWPW2zuw==} engines: {node: '>=12.0.0'} peerDependencies: @@ -4927,7 +4872,7 @@ packages: dayjs: ^1.10.7 luxon: ^1.28.0 || ^2.0.0 moment: ^2.29.1 - react: ^17.0.2 || ^18.0.0 + react: ^17.0.2 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -4947,7 +4892,7 @@ packages: optional: true dependencies: '@babel/runtime': 7.18.6 - '@date-io/date-fns': 2.14.0_date-fns@2.28.0 + '@date-io/date-fns': 2.14.0_date-fns@2.29.2 '@date-io/dayjs': 2.14.0 '@date-io/luxon': 2.14.0 '@date-io/moment': 2.14.0 @@ -4956,8 +4901,8 @@ packages: '@mui/material': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i '@mui/system': 5.8.7_d6menda4vqwq6peqnkbe7mkj4i '@mui/utils': 5.8.6 - clsx: 1.2.0 - date-fns: 2.28.0 + clsx: 1.2.1 + date-fns: 2.29.2 prop-types: 15.8.1 react-transition-group: 4.4.2 rifm: 0.12.1 @@ -4970,7 +4915,7 @@ packages: engines: {node: '>=12.0.0'} hasBin: true peerDependencies: - react: ^17.0.2 || ^18.0.0 + react: ^17.0.2 || ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -5002,25 +4947,25 @@ packages: fastq: 1.13.0 dev: true - /@nrwl/cli/14.4.2: - resolution: {integrity: sha512-JNV4kP9goZD4BlTQGKdKhCRc1bhiWYp1TaDJHdk4ZfhiLt1NzXNxxgc/eX2obFZ3Hw+KdM/gM5F7KfWBbtSGSw==} + /@nrwl/cli/14.5.10: + resolution: {integrity: sha512-GpnnKGO3+HwlMmZSStbq1MOyoDJg2I0HN4nBqM3ltaQkfxGZv3erwRMOAT+8mba2MWbJJ2QQgASAYvTscNYjOQ==} dependencies: - nx: 14.4.2_@swc+core@1.2.210 + nx: 14.5.10_@swc+core@1.2.244 dev: true - /@nrwl/cli/14.4.2_@swc+core@1.2.210: - resolution: {integrity: sha512-JNV4kP9goZD4BlTQGKdKhCRc1bhiWYp1TaDJHdk4ZfhiLt1NzXNxxgc/eX2obFZ3Hw+KdM/gM5F7KfWBbtSGSw==} + /@nrwl/cli/14.5.10_@swc+core@1.2.244: + resolution: {integrity: sha512-GpnnKGO3+HwlMmZSStbq1MOyoDJg2I0HN4nBqM3ltaQkfxGZv3erwRMOAT+8mba2MWbJJ2QQgASAYvTscNYjOQ==} dependencies: - nx: 14.4.2_@swc+core@1.2.210 + nx: 14.5.10_@swc+core@1.2.244 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' dev: true - /@nrwl/cypress/14.4.2_gtbxvtmh5ipj3piki3xg57n5fe: - resolution: {integrity: sha512-vek4tJYzaJwnLgeJLAJKWuCmtE+XWCq6IgmCl/4G/lWxTWGzlJ19ZK8MoCEiJqbnNYeoHZPxoaAGwyBAbVuO3w==} + /@nrwl/cypress/14.5.10_7nv76pmmfazpmc5mincnwvnlka: + resolution: {integrity: sha512-NymwWehtpgCNZBLV/jwvKFCHWz4mw8+YG70uAheyO4ybkCmA2ghvaOG3shni9MG9mOMfRGz5Cc23/ScIekxA2w==} peerDependencies: - cypress: '>= 3 < 10' + cypress: '>= 3 < 11' peerDependenciesMeta: cypress: optional: true @@ -5028,19 +4973,21 @@ packages: '@babel/core': 7.18.6 '@babel/preset-env': 7.18.6_@babel+core@7.18.6 '@cypress/webpack-preprocessor': 5.12.0_kbhwel7in52p4dlvjkqlq5ojfi - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/linter': 14.5.10_z5rj2yvzo55d4uujwqo5vfieea + '@nrwl/workspace': 14.5.10_cx6aw7aax7s3eyq3oi6a2zoeoi + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 babel-loader: 8.2.5_m3opitmgss2x7fiy6klia7uvaa chalk: 4.1.0 + dotenv: 10.0.0 enhanced-resolve: 5.10.0 - fork-ts-checker-webpack-plugin: 6.2.10_wln64xm7gyszy6wbwhdijmigya + fork-ts-checker-webpack-plugin: 7.2.13_xnp4kzegbjokq62cajex2ovgkm rxjs: 6.6.7 ts-loader: 9.3.1_xnp4kzegbjokq62cajex2ovgkm tsconfig-paths: 3.14.1 tsconfig-paths-webpack-plugin: 3.5.2 tslib: 2.4.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-node-externals: 3.0.0 transitivePeerDependencies: - '@swc-node/register' @@ -5061,21 +5008,69 @@ packages: - webpack-cli dev: true - /@nrwl/devkit/14.4.2_nx@14.4.2: - resolution: {integrity: sha512-CJCczAbnZ7w6XZeOMHhb4aTQeDzU0pJOAAJvNU1EAzbj/nkP+QILn/sX+WQR6z94UT2Y9SMamnE4TjQC2F48vQ==} + /@nrwl/cypress/14.5.10_fh4vayvykx4so2ggxmjmy42o7q: + resolution: {integrity: sha512-NymwWehtpgCNZBLV/jwvKFCHWz4mw8+YG70uAheyO4ybkCmA2ghvaOG3shni9MG9mOMfRGz5Cc23/ScIekxA2w==} + peerDependencies: + cypress: '>= 3 < 11' + peerDependenciesMeta: + cypress: + optional: true + dependencies: + '@babel/core': 7.18.6 + '@babel/preset-env': 7.18.6_@babel+core@7.18.6 + '@cypress/webpack-preprocessor': 5.12.0_kbhwel7in52p4dlvjkqlq5ojfi + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/linter': 14.5.10_nccbbaajqjy3rznvgrrzaevqwe + '@nrwl/workspace': 14.5.10_eva5qnqrnaa26adtrypogyveky + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 + babel-loader: 8.2.5_m3opitmgss2x7fiy6klia7uvaa + chalk: 4.1.0 + dotenv: 10.0.0 + enhanced-resolve: 5.10.0 + fork-ts-checker-webpack-plugin: 7.2.13_xnp4kzegbjokq62cajex2ovgkm + rxjs: 6.6.7 + ts-loader: 9.3.1_xnp4kzegbjokq62cajex2ovgkm + tsconfig-paths: 3.14.1 + tsconfig-paths-webpack-plugin: 3.5.2 + tslib: 2.4.0 + webpack: 5.74.0_@swc+core@1.2.244 + webpack-node-externals: 3.0.0 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - bufferutil + - canvas + - esbuild + - eslint + - node-notifier + - nx + - prettier + - supports-color + - ts-node + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli + dev: true + + /@nrwl/devkit/14.5.10_friigstnlhuirqu4wr7dfbyroa: + resolution: {integrity: sha512-YVT0MRvyXwe0uczUZK4XUi1f2iLAqklFMfAoqwfgcgWToH8xN06NSlyUphD4eLHFgem3Sd0kimAJVsnse/PTlA==} peerDependencies: nx: '>= 13.10 <= 15' dependencies: + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 ejs: 3.1.8 ignore: 5.2.0 - nx: 14.4.2_@swc+core@1.2.210 - rxjs: 6.6.7 + nx: 14.5.10_@swc+core@1.2.244 semver: 7.3.4 tslib: 2.4.0 + transitivePeerDependencies: + - typescript dev: true - /@nrwl/eslint-plugin-nx/14.4.2_afsbewstkdex5d4fc6xnpjlnau: - resolution: {integrity: sha512-lYePXOoBWDbnzv/ltkT/ueE0rm30wJTaHaSJAZwI+csHR5Oj61l0zaCdXz4GlDOl6ZJLbS98/oOgufCnOSdMhw==} + /@nrwl/eslint-plugin-nx/14.5.10_givxt7oldssnfrhy2ogb3txvmu: + resolution: {integrity: sha512-YKXgnY8UzHfsw7Hzut7aO02t/8midI/vagUpwGCs08k8oWLZJ50CsTfnEgh61V6VAQWEpm8iPTaubAVLPLwtlg==} peerDependencies: '@typescript-eslint/parser': ^5.29.0 eslint-config-prettier: ^8.1.0 @@ -5083,10 +5078,10 @@ packages: eslint-config-prettier: optional: true dependencies: - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq - '@typescript-eslint/experimental-utils': 5.30.5_4x5o4skxv6sl53vpwefgt23khm + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/workspace': 14.5.10_eva5qnqrnaa26adtrypogyveky '@typescript-eslint/parser': 5.30.5_4x5o4skxv6sl53vpwefgt23khm + '@typescript-eslint/utils': 5.30.5_4x5o4skxv6sl53vpwefgt23khm chalk: 4.1.0 confusing-browser-globals: 1.0.11 eslint-config-prettier: 8.5.0_eslint@8.19.0 @@ -5106,14 +5101,15 @@ packages: - utf-8-validate dev: true - /@nrwl/jest/14.4.2_dltevkctzdxkrvyldbyepwbdle: - resolution: {integrity: sha512-5BIbkChVRmJQ0ngNBdL1Fy3oSLm20zR1ec9XgBAktPDQ4ZMPz3ZWk9c5kKX2H2tOvyu98hbOqZ0HLbPXAbt/Ew==} + /@nrwl/jest/14.5.10_mxnt7yjwrufofllb6rm3srb2gy: + resolution: {integrity: sha512-gGqghwDcpBhk8TNK2Gfp/5PWqnnAPUjNfSCOz39kk9ZBtsyloozGwjg/VEF3k2p9uCifRfAyZOpDrSdALxBpdA==} dependencies: '@jest/reporters': 27.5.1 '@jest/test-result': 27.5.1 - '@nrwl/devkit': 14.4.2_nx@14.4.2 + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 chalk: 4.1.0 + dotenv: 10.0.0 identity-obj-proxy: 3.0.0 jest-config: 27.5.1_ts-node@10.8.2 jest-resolve: 27.5.1 @@ -5132,13 +5128,40 @@ packages: - utf-8-validate dev: true - /@nrwl/js/14.4.2_gtbxvtmh5ipj3piki3xg57n5fe: - resolution: {integrity: sha512-kVi+DAm1iaEZ8XQ8+dViDlK9/2ZM4Eq0fhWXtWisvuVmgoTdWQ88DDzXyINbzv4cWtpMnKHeIWJeM/WMWAX36w==} + /@nrwl/jest/14.5.10_oqd6w67pqggug57az6damxqvgm: + resolution: {integrity: sha512-gGqghwDcpBhk8TNK2Gfp/5PWqnnAPUjNfSCOz39kk9ZBtsyloozGwjg/VEF3k2p9uCifRfAyZOpDrSdALxBpdA==} dependencies: - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq + '@jest/reporters': 27.5.1 + '@jest/test-result': 27.5.1 + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 + chalk: 4.1.0 + dotenv: 10.0.0 + identity-obj-proxy: 3.0.0 + jest-config: 27.5.1_ts-node@10.9.1 + jest-resolve: 27.5.1 + jest-util: 27.5.1 + resolve.exports: 1.1.0 + rxjs: 6.6.7 + tslib: 2.4.0 + transitivePeerDependencies: + - bufferutil + - canvas + - node-notifier + - nx + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: true + + /@nrwl/js/14.5.10_7nv76pmmfazpmc5mincnwvnlka: + resolution: {integrity: sha512-UNLGI1kP2YoWCraDaSDQOqQSgj3S5+qpvnqWBkDMl+augJmNEDBSWi/bNXMQgQqKDvLHF65iJeAuFSFhtdksAA==} + dependencies: + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_oqd6w67pqggug57az6damxqvgm + '@nrwl/linter': 14.5.10_z5rj2yvzo55d4uujwqo5vfieea + '@nrwl/workspace': 14.5.10_cx6aw7aax7s3eyq3oi6a2zoeoi '@parcel/watcher': 2.0.4 chalk: 4.1.0 fast-glob: 3.2.7 @@ -5163,19 +5186,50 @@ packages: - utf-8-validate dev: true - /@nrwl/linter/14.4.2_jqnzvbaca4rx3byobgjku3onji: - resolution: {integrity: sha512-K44C+mwwbq0Q3IECNqxO9WGB9J7vSKoyaOzx0BH0HgKtfTSTyALHuM6ylzZ9y9pNK0CDbkVraKoFwDZ42GtzCQ==} + /@nrwl/js/14.5.10_fh4vayvykx4so2ggxmjmy42o7q: + resolution: {integrity: sha512-UNLGI1kP2YoWCraDaSDQOqQSgj3S5+qpvnqWBkDMl+augJmNEDBSWi/bNXMQgQqKDvLHF65iJeAuFSFhtdksAA==} + dependencies: + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_mxnt7yjwrufofllb6rm3srb2gy + '@nrwl/linter': 14.5.10_nccbbaajqjy3rznvgrrzaevqwe + '@nrwl/workspace': 14.5.10_eva5qnqrnaa26adtrypogyveky + '@parcel/watcher': 2.0.4 + chalk: 4.1.0 + fast-glob: 3.2.7 + fs-extra: 10.1.0 + ignore: 5.2.0 + js-tokens: 4.0.0 + minimatch: 3.0.5 + source-map-support: 0.5.19 + tree-kill: 1.2.2 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - bufferutil + - canvas + - eslint + - node-notifier + - nx + - prettier + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: true + + /@nrwl/linter/14.5.10_nccbbaajqjy3rznvgrrzaevqwe: + resolution: {integrity: sha512-3c6KhSLJmt8wMkYZw+f/KayPHkM+KV/z+QaYQL59XY5o9DdYyq6jHjnvu/CuW2JzU97yHkacYbwkSFQlDKCyIg==} peerDependencies: eslint: ^8.0.0 peerDependenciesMeta: eslint: optional: true dependencies: - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_mxnt7yjwrufofllb6rm3srb2gy '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 eslint: 8.19.0 - nx: 14.4.2_@swc+core@1.2.210 + nx: 14.5.10_@swc+core@1.2.244 tmp: 0.2.1 tslib: 2.4.0 transitivePeerDependencies: @@ -5190,32 +5244,59 @@ packages: - utf-8-validate dev: true - /@nrwl/node/14.4.2_ehspof47b5bphcyk4536mwaw4u: - resolution: {integrity: sha512-YMolQH3R/DTyPap3fQFWXvBaKJQG6l+msAUqzHp5OML3lPDg+zBYGW2kD1IsXpYq/ccpaot1ePS5K0JDpbZ8zQ==} + /@nrwl/linter/14.5.10_z5rj2yvzo55d4uujwqo5vfieea: + resolution: {integrity: sha512-3c6KhSLJmt8wMkYZw+f/KayPHkM+KV/z+QaYQL59XY5o9DdYyq6jHjnvu/CuW2JzU97yHkacYbwkSFQlDKCyIg==} + peerDependencies: + eslint: ^8.0.0 + peerDependenciesMeta: + eslint: + optional: true dependencies: - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle - '@nrwl/js': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_oqd6w67pqggug57az6damxqvgm + '@phenomnomnominal/tsquery': 4.1.1_typescript@4.7.4 + eslint: 8.19.0 + nx: 14.5.10_@swc+core@1.2.244 + tmp: 0.2.1 + tslib: 2.4.0 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - bufferutil + - canvas + - node-notifier + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: true + + /@nrwl/node/14.5.10_b7xqi4yfwax4wnal77xdlkadre: + resolution: {integrity: sha512-d/2QSLyOe19/GddWExA2YeRu97r1jyjFpqpQGjJQ/PzdAMuAXWw8fOvhM5iq8XDlWi0IoQMmU5r/OoPDzRtbLg==} + dependencies: + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_oqd6w67pqggug57az6damxqvgm + '@nrwl/js': 14.5.10_7nv76pmmfazpmc5mincnwvnlka + '@nrwl/linter': 14.5.10_z5rj2yvzo55d4uujwqo5vfieea + '@nrwl/workspace': 14.5.10_cx6aw7aax7s3eyq3oi6a2zoeoi chalk: 4.1.0 - copy-webpack-plugin: 9.1.0_webpack@5.74.0 + copy-webpack-plugin: 10.2.4_webpack@5.74.0 + dotenv: 10.0.0 enhanced-resolve: 5.10.0 - fork-ts-checker-webpack-plugin: 6.2.10_wln64xm7gyszy6wbwhdijmigya + fork-ts-checker-webpack-plugin: 7.2.13_xnp4kzegbjokq62cajex2ovgkm fs-extra: 10.1.0 glob: 7.1.4 license-webpack-plugin: 4.0.2_webpack@5.74.0 rxjs: 6.6.7 - rxjs-for-await: 0.0.2_rxjs@6.6.7 source-map-support: 0.5.19 - terser-webpack-plugin: 5.3.3_vwzmvoh3samqo2nn3x7mqt365m + terser-webpack-plugin: 5.3.3_5yvlrjpud4kvfyyr2mesgpo47e tree-kill: 1.2.2 ts-loader: 9.3.1_xnp4kzegbjokq62cajex2ovgkm - ts-node: 10.8.2_y42jqzo3jkzuv3kp7opavo2xbi + ts-node: 10.9.1_hixnfb2jfw56u6pahjg3ndp4oy tsconfig-paths: 3.14.1 tsconfig-paths-webpack-plugin: 3.5.2 tslib: 2.4.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-merge: 5.8.0 webpack-node-externals: 3.0.0 transitivePeerDependencies: @@ -5238,44 +5319,46 @@ packages: - webpack-cli dev: true - /@nrwl/nx-cloud/14.2.0: - resolution: {integrity: sha512-KnrNFDCII9mbLwFp0HgyKVlhMTXoN90CQzGgdtCNPPBP/Wg84pttcpynGdWyupkrBJxdqMNTJEC7HGib0ipxew==} + /@nrwl/nx-cloud/14.5.4: + resolution: {integrity: sha512-fuKsx+2jvpL5OAuwSUsODEydzt01qiPJwZslbCtMWXRGva5KNbT4udNwl0C1M/W9RFVYmFbD7n4Ewz3oho531A==} hasBin: true dependencies: axios: 0.21.4 chalk: 4.1.0 + dotenv: 10.0.0 node-machine-id: 1.1.12 strip-json-comments: 3.1.1 tar: 6.1.11 + yargs-parser: 21.0.1 transitivePeerDependencies: - debug dev: true - /@nrwl/react/14.4.2_46t6z7wulh2zjyi5wmxujdm57y: - resolution: {integrity: sha512-5OlTpa5wRgADkNuP55Ii0myZLqzcefwR+lMRSBFquwOzxQ5VEU9JCyZVeO4pBdVr1ibbIJoj1EfO+NnVpCtELg==} + /@nrwl/react/14.5.10_o5732ev3g42bu2r3ngh6yfrgia: + resolution: {integrity: sha512-cdMWs9BKu1mkKg+/UisOSxAIxD13kbKY565+mqIRKzsdN8LvP7Xe6iDCfGtIpg1esrZxVZbcMm38L3rn6x+4hQ==} dependencies: '@babel/core': 7.18.6 '@babel/preset-react': 7.18.6_@babel+core@7.18.6 - '@nrwl/cypress': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle - '@nrwl/js': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/storybook': 14.4.2_brofqo76x5gdh2qufyuyzjmfne - '@nrwl/web': 14.4.2_7ggz7ibmlwrqtwusxeq53zzcym - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq + '@nrwl/cypress': 14.5.10_fh4vayvykx4so2ggxmjmy42o7q + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_mxnt7yjwrufofllb6rm3srb2gy + '@nrwl/js': 14.5.10_fh4vayvykx4so2ggxmjmy42o7q + '@nrwl/linter': 14.5.10_nccbbaajqjy3rznvgrrzaevqwe + '@nrwl/storybook': 14.5.10_cu63rkszloo7pn4oqbb7oabdnu + '@nrwl/web': 14.5.10_tpw7pltx5fafq53de536pruocy + '@nrwl/workspace': 14.5.10_eva5qnqrnaa26adtrypogyveky '@pmmmwh/react-refresh-webpack-plugin': 0.5.7_bgbvhssx5jbdjtmrq4m55itcsu - '@storybook/node-logger': 6.1.20 '@svgr/webpack': 6.2.1 chalk: 4.1.0 eslint-plugin-import: 2.26.0_iom7pm3yknyiblqpw2vvqvxs5i eslint-plugin-jsx-a11y: 6.6.0_eslint@8.19.0 eslint-plugin-react: 7.30.0_eslint@8.19.0 eslint-plugin-react-hooks: 4.6.0_eslint@8.19.0 + minimatch: 3.0.5 react-refresh: 0.10.0 semver: 7.3.4 url-loader: 4.1.1_webpack@5.74.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-merge: 5.8.0 transitivePeerDependencies: - '@parcel/css' @@ -5318,14 +5401,15 @@ packages: - webpack-plugin-serve dev: true - /@nrwl/storybook/14.4.2_brofqo76x5gdh2qufyuyzjmfne: - resolution: {integrity: sha512-G6h3jQT+pIY0RAEbeclguEFSAIXsToRVKEeRyq1bk6fWJHy7y//bCeJrINL9xPf9zk12cWyKkjJvwsOcy0Z1Mw==} + /@nrwl/storybook/14.5.10_cu63rkszloo7pn4oqbb7oabdnu: + resolution: {integrity: sha512-CIeVgxYvkEvVDo3RaHS49bbqm97Mpv+g3iM8lFU11yz5ImJdnJkjZOF8AHl1jLJpyFj1nAXdmWtbTzULAObgTw==} dependencies: - '@nrwl/cypress': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq - core-js: 3.23.3 + '@nrwl/cypress': 14.5.10_fh4vayvykx4so2ggxmjmy42o7q + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/linter': 14.5.10_nccbbaajqjy3rznvgrrzaevqwe + '@nrwl/workspace': 14.5.10_eva5qnqrnaa26adtrypogyveky + core-js: 3.25.0 + dotenv: 10.0.0 semver: 7.3.4 ts-loader: 9.3.1_xnp4kzegbjokq62cajex2ovgkm tsconfig-paths-webpack-plugin: 3.5.2 @@ -5350,18 +5434,18 @@ packages: - webpack-cli dev: true - /@nrwl/tao/14.4.2_@swc+core@1.2.210: - resolution: {integrity: sha512-Ygw3skKZfFhi4MBHZKQ8A67pDQxeyDdY78tFWViMN0SEn9ExL41Q8V9aSMfir8VZYGca6ZOXX5MRhbeHdcgMLQ==} + /@nrwl/tao/14.5.10_@swc+core@1.2.244: + resolution: {integrity: sha512-eWORRba0HlTNmOQFUxHqki0Z5yiRIq1Hl0taprmZpz2lgDXuzPIjGfAi5/ETy5+G5gkEyxFnCq7+SiMilPokwA==} hasBin: true dependencies: - nx: 14.4.2_@swc+core@1.2.210 + nx: 14.5.10_@swc+core@1.2.244 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' dev: true - /@nrwl/web/14.4.2_7ggz7ibmlwrqtwusxeq53zzcym: - resolution: {integrity: sha512-x00dE67yDRC3zmVEdO1HdtIbPezZ5gSKmNmEL2++PrA6AUz3a+f7/Ahhs4ALxnEPx1oDRLzM5OxRb5w6kLmGfw==} + /@nrwl/web/14.5.10_tpw7pltx5fafq53de536pruocy: + resolution: {integrity: sha512-mMlHRgywmSJIRfKyfDfVbOt0NnAPf+tV2gEAYnXt8GF0SfcQhG1xpn3A6oQgl36fpZ78FzO2Z+txw4OiKk+lrw==} dependencies: '@babel/core': 7.18.6 '@babel/plugin-proposal-class-properties': 7.18.6_@babel+core@7.18.6 @@ -5371,12 +5455,12 @@ packages: '@babel/preset-env': 7.18.6_@babel+core@7.18.6 '@babel/preset-typescript': 7.18.6_@babel+core@7.18.6 '@babel/runtime': 7.18.6 - '@nrwl/cypress': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle - '@nrwl/js': 14.4.2_gtbxvtmh5ipj3piki3xg57n5fe - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji - '@nrwl/workspace': 14.4.2_a22ftc74wzukohhtmp6cnnvzoq + '@nrwl/cypress': 14.5.10_7nv76pmmfazpmc5mincnwvnlka + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_oqd6w67pqggug57az6damxqvgm + '@nrwl/js': 14.5.10_7nv76pmmfazpmc5mincnwvnlka + '@nrwl/linter': 14.5.10_z5rj2yvzo55d4uujwqo5vfieea + '@nrwl/workspace': 14.5.10_cx6aw7aax7s3eyq3oi6a2zoeoi '@pmmmwh/react-refresh-webpack-plugin': 0.5.7_obbju5ecoedcc2mvvgblbzwdca '@rollup/plugin-babel': 5.3.1_fb3qe53zzddvqjqqltveoanfhe '@rollup/plugin-commonjs': 20.0.0_rollup@2.75.7 @@ -5394,13 +5478,13 @@ packages: caniuse-lite: 1.0.30001363 chalk: 4.1.0 chokidar: 3.5.3 - copy-webpack-plugin: 9.1.0_webpack@5.74.0 - core-js: 3.23.3 + copy-webpack-plugin: 10.2.4_webpack@5.74.0 + core-js: 3.25.0 css-loader: 6.7.1_webpack@5.74.0 css-minimizer-webpack-plugin: 3.4.1_webpack@5.74.0 enhanced-resolve: 5.10.0 file-loader: 6.2.0_webpack@5.74.0 - fork-ts-checker-webpack-plugin: 6.2.10_wln64xm7gyszy6wbwhdijmigya + fork-ts-checker-webpack-plugin: 7.2.13_xnp4kzegbjokq62cajex2ovgkm fs-extra: 10.1.0 http-server: 14.1.0 identity-obj-proxy: 3.0.0 @@ -5420,10 +5504,9 @@ packages: rollup: 2.75.7 rollup-plugin-copy: 3.4.0 rollup-plugin-peer-deps-external: 2.2.4_rollup@2.75.7 - rollup-plugin-postcss: 4.0.2_i7duc3lt6p42geuj2nwruihc6u + rollup-plugin-postcss: 4.0.2_pe6iykxod2v7i2uk6okjazxzki rollup-plugin-typescript2: 0.31.2_okefoyb4o5sittgqayreuhurei rxjs: 6.6.7 - rxjs-for-await: 0.0.2_rxjs@6.6.7 sass: 1.53.0 sass-loader: 12.6.0_sass@1.53.0+webpack@5.74.0 semver: 7.3.4 @@ -5432,13 +5515,13 @@ packages: style-loader: 3.3.1_webpack@5.74.0 stylus: 0.55.0 stylus-loader: 6.2.0_772wava6yveehcyvgfd527qm3q - terser-webpack-plugin: 5.3.3_vwzmvoh3samqo2nn3x7mqt365m + terser-webpack-plugin: 5.3.3_5yvlrjpud4kvfyyr2mesgpo47e ts-loader: 9.3.1_xnp4kzegbjokq62cajex2ovgkm - ts-node: 10.8.2_y42jqzo3jkzuv3kp7opavo2xbi + ts-node: 10.9.1_hixnfb2jfw56u6pahjg3ndp4oy tsconfig-paths: 3.14.1 tsconfig-paths-webpack-plugin: 3.5.2 tslib: 2.4.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-dev-server: 4.9.3_webpack@5.74.0 webpack-merge: 5.8.0 webpack-sources: 3.2.3 @@ -5478,17 +5561,17 @@ packages: - webpack-plugin-serve dev: true - /@nrwl/workspace/14.4.2_a22ftc74wzukohhtmp6cnnvzoq: - resolution: {integrity: sha512-D3EXkeg/39V3OeKINvymeOsr5QVRLZFwYOWHfvVcJh8iKpVrev/zMFOm6rSrHmdlpoLkJVAOW2QI+1MYl92Gig==} + /@nrwl/workspace/14.5.10_cx6aw7aax7s3eyq3oi6a2zoeoi: + resolution: {integrity: sha512-bJK2O5NcIYhU7z1mmWoONo2+tOt1VUYyOQUUrAcI00hiBhMJPOTwPPN+W5BbJsue95ndH6mRLo2UhTz20U2tNA==} peerDependencies: prettier: ^2.6.2 peerDependenciesMeta: prettier: optional: true dependencies: - '@nrwl/devkit': 14.4.2_nx@14.4.2 - '@nrwl/jest': 14.4.2_dltevkctzdxkrvyldbyepwbdle - '@nrwl/linter': 14.4.2_jqnzvbaca4rx3byobgjku3onji + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_oqd6w67pqggug57az6damxqvgm + '@nrwl/linter': 14.5.10_z5rj2yvzo55d4uujwqo5vfieea '@parcel/watcher': 2.0.4 chalk: 4.1.0 chokidar: 3.5.3 @@ -5503,7 +5586,54 @@ packages: ignore: 5.2.0 minimatch: 3.0.5 npm-run-path: 4.0.1 - nx: 14.4.2_@swc+core@1.2.210 + nx: 14.5.10_@swc+core@1.2.244 + open: 8.4.0 + prettier: 2.7.1 + rxjs: 6.6.7 + semver: 7.3.4 + tmp: 0.2.1 + tslib: 2.4.0 + yargs: 17.5.1 + yargs-parser: 21.0.1 + transitivePeerDependencies: + - '@swc-node/register' + - '@swc/core' + - bufferutil + - canvas + - eslint + - node-notifier + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: true + + /@nrwl/workspace/14.5.10_eva5qnqrnaa26adtrypogyveky: + resolution: {integrity: sha512-bJK2O5NcIYhU7z1mmWoONo2+tOt1VUYyOQUUrAcI00hiBhMJPOTwPPN+W5BbJsue95ndH6mRLo2UhTz20U2tNA==} + peerDependencies: + prettier: ^2.6.2 + peerDependenciesMeta: + prettier: + optional: true + dependencies: + '@nrwl/devkit': 14.5.10_friigstnlhuirqu4wr7dfbyroa + '@nrwl/jest': 14.5.10_mxnt7yjwrufofllb6rm3srb2gy + '@nrwl/linter': 14.5.10_nccbbaajqjy3rznvgrrzaevqwe + '@parcel/watcher': 2.0.4 + chalk: 4.1.0 + chokidar: 3.5.3 + cli-cursor: 3.1.0 + cli-spinners: 2.6.1 + dotenv: 10.0.0 + enquirer: 2.3.6 + figures: 3.2.0 + flat: 5.0.2 + fs-extra: 10.1.0 + glob: 7.1.4 + ignore: 5.2.0 + minimatch: 3.0.5 + npm-run-path: 4.0.1 + nx: 14.5.10_@swc+core@1.2.244 open: 8.4.0 prettier: 2.7.1 rxjs: 6.6.7 @@ -5586,7 +5716,7 @@ packages: react-refresh: 0.10.0 schema-utils: 3.1.1 source-map: 0.7.4 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /@pmmmwh/react-refresh-webpack-plugin/0.5.7_obbju5ecoedcc2mvvgblbzwdca: @@ -5627,7 +5757,7 @@ packages: react-refresh: 0.10.0 schema-utils: 3.1.1 source-map: 0.7.4 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-dev-server: 4.9.3_webpack@5.74.0 dev: true @@ -5642,7 +5772,7 @@ packages: /@portabletext/react/1.0.6_react@18.2.0: resolution: {integrity: sha512-j6BprLiwFz3zr1Lo6BxM2sQ1b3g1JIjGwePeuxqSfbBiEYbGXn2izEckMJ02hSa1f7+RCEUJ+Bojvtzz6BBUaw==} peerDependencies: - react: ^17 || ^18 + react: ^17 || ^18 || 18 peerDependenciesMeta: react: optional: true @@ -5825,9 +5955,9 @@ packages: engines: {node: '>=4'} dev: true - /@sindresorhus/is/4.6.0: - resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} - engines: {node: '>=10'} + /@sindresorhus/is/5.3.0: + resolution: {integrity: sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==} + engines: {node: '>=14.16'} dev: false /@sinonjs/commons/1.8.3: @@ -5848,18 +5978,8 @@ packages: '@sinonjs/commons': 1.8.3 dev: true - /@storybook/node-logger/6.1.20: - resolution: {integrity: sha512-Z6337htb1mxIccvCx2Ai0v9LPDlBlmXzeWhap3q2Y6hg8g1p4+0W5Y6bG9RmXqJoXLaT1trO8uAXgGO7AN92yg==} - dependencies: - '@types/npmlog': 4.1.4 - chalk: 4.1.0 - core-js: 3.23.3 - npmlog: 4.1.2 - pretty-hrtime: 1.0.3 - dev: true - - /@svgr/babel-plugin-add-jsx-attribute/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-MdPdhdWLtQsjd29Wa4pABdhWbaRMACdM1h31BY+c6FghTZqNGT7pEYdBoaGeKtdTOBC/XNFQaKVj+r/Ei2ryWA==} + /@svgr/babel-plugin-add-jsx-attribute/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-jDBKArXYO1u0B1dmd2Nf8Oy6aTF5vLDfLoO9Oon/GLkqZ/NiggYWZA+a2HpUMH4ITwNqS3z43k8LWApB8S583w==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5870,8 +5990,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-remove-jsx-attribute/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-aVdtfx9jlaaxc3unA6l+M9YRnKIZjOhQPthLKqmTXC8UVkBLDRGwPKo+r8n3VZN8B34+yVajzPTZ+ptTSuZZCw==} + /@svgr/babel-plugin-remove-jsx-attribute/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-dQzyJ4prwjcFd929T43Z8vSYiTlTu8eafV40Z2gO7zy/SV5GT+ogxRJRBIKWomPBOiaVXFg3jY4S5hyEN3IBjQ==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5882,8 +6002,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-remove-jsx-empty-expression/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-Ccj42ApsePD451AZJJf1QzTD1B/BOU392URJTeXFxSK709i0KUsGtbwyiqsKu7vsYxpTM0IA5clAKDyf9RCZyA==} + /@svgr/babel-plugin-remove-jsx-empty-expression/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-HBOUc1XwSU67fU26V5Sfb8MQsT0HvUyxru7d0oBJ4rA2s4HW3PhyAPC7fV/mdsSGpAvOdd8Wpvkjsr0fWPUO7A==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5894,8 +6014,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-replace-jsx-attribute-value/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-88V26WGyt1Sfd1emBYmBJRWMmgarrExpKNVmI9vVozha4kqs6FzQJ/Kp5+EYli1apgX44518/0+t9+NU36lThQ==} + /@svgr/babel-plugin-replace-jsx-attribute-value/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-C12e6aN4BXAolRrI601gPn5MDFCRHO7C4TM8Kks+rDtl8eEq+NN1sak0eAzJu363x3TmHXdZn7+Efd2nr9I5dA==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5906,8 +6026,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-svg-dynamic-title/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-F7YXNLfGze+xv0KMQxrl2vkNbI9kzT9oDK55/kUuymh1ACyXkMV+VZWX1zEhSTfEKh7VkHVZGmVtHg8eTZ6PRg==} + /@svgr/babel-plugin-svg-dynamic-title/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-6NU55Mmh3M5u2CfCCt6TX29/pPneutrkJnnDCHbKZnjukZmmgUAZLtZ2g6ZoSPdarowaQmAiBRgAHqHmG0vuqA==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5918,8 +6038,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-svg-em-dimensions/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-+rghFXxdIqJNLQK08kwPBD3Z22/0b2tEZ9lKiL/yTfuyj1wW8HUXu4bo/XkogATIYuXSghVQOOCwURXzHGKyZA==} + /@svgr/babel-plugin-svg-em-dimensions/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-HV1NGHYTTe1vCNKlBgq/gKuCSfaRlKcHIADn7P8w8U3Zvujdw1rmusutghJ1pZJV7pDt3Gt8ws+SVrqHnBO/Qw==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5930,8 +6050,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-transform-react-native-svg/6.0.0_@babel+core@7.18.6: - resolution: {integrity: sha512-VaphyHZ+xIKv5v0K0HCzyfAaLhPGJXSk2HkpYfXIOKb7DjLBv0soHDxNv6X0vr2titsxE7klb++u7iOf7TSrFQ==} + /@svgr/babel-plugin-transform-react-native-svg/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-2wZhSHvTolFNeKDAN/ZmIeSz2O9JSw72XD+o2bNp2QAaWqa8KGpn5Yk5WHso6xqfSAiRzAE+GXlsrBO4UP9LLw==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5942,8 +6062,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-plugin-transform-svg-component/6.2.0_@babel+core@7.18.6: - resolution: {integrity: sha512-bhYIpsORb++wpsp91fymbFkf09Z/YEKR0DnFjxvN+8JHeCUD2unnh18jIMKnDJTWtvpTaGYPXELVe4OOzFI0xg==} + /@svgr/babel-plugin-transform-svg-component/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-cZ8Tr6ZAWNUFfDeCKn/pGi976iWSkS8ijmEYKosP+6ktdZ7lW9HVLHojyusPw3w0j8PI4VBeWAXAmi/2G7owxw==} engines: {node: '>=12'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5954,8 +6074,8 @@ packages: '@babel/core': 7.18.6 dev: true - /@svgr/babel-preset/6.2.0_@babel+core@7.18.6: - resolution: {integrity: sha512-4WQNY0J71JIaL03DRn0vLiz87JXx0b9dYm2aA8XHlQJQoixMl4r/soYHm8dsaJZ3jWtkCiOYy48dp9izvXhDkQ==} + /@svgr/babel-preset/6.3.1_@babel+core@7.18.6: + resolution: {integrity: sha512-tQtWtzuMMQ3opH7je+MpwfuRA1Hf3cKdSgTtAYwOBDfmhabP7rcTfBi3E7V3MuwJNy/Y02/7/RutvwS1W4Qv9g==} engines: {node: '>=10'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -5964,57 +6084,57 @@ packages: optional: true dependencies: '@babel/core': 7.18.6 - '@svgr/babel-plugin-add-jsx-attribute': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-remove-jsx-attribute': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-remove-jsx-empty-expression': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-replace-jsx-attribute-value': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-svg-dynamic-title': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-svg-em-dimensions': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-transform-react-native-svg': 6.0.0_@babel+core@7.18.6 - '@svgr/babel-plugin-transform-svg-component': 6.2.0_@babel+core@7.18.6 + '@svgr/babel-plugin-add-jsx-attribute': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-remove-jsx-attribute': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-remove-jsx-empty-expression': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-replace-jsx-attribute-value': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-svg-dynamic-title': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-svg-em-dimensions': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-transform-react-native-svg': 6.3.1_@babel+core@7.18.6 + '@svgr/babel-plugin-transform-svg-component': 6.3.1_@babel+core@7.18.6 dev: true - /@svgr/core/6.2.1: - resolution: {integrity: sha512-NWufjGI2WUyrg46mKuySfviEJ6IxHUOm/8a3Ph38VCWSp+83HBraCQrpEM3F3dB6LBs5x8OElS8h3C0oOJaJAA==} + /@svgr/core/6.3.1: + resolution: {integrity: sha512-Sm3/7OdXbQreemf9aO25keerZSbnKMpGEfmH90EyYpj1e8wMD4TuwJIb3THDSgRMWk1kYJfSRulELBy4gVgZUA==} engines: {node: '>=10'} dependencies: - '@svgr/plugin-jsx': 6.2.1_@svgr+core@6.2.1 + '@svgr/plugin-jsx': 6.3.1_@svgr+core@6.3.1 camelcase: 6.3.0 cosmiconfig: 7.0.1 transitivePeerDependencies: - supports-color dev: true - /@svgr/hast-util-to-babel-ast/6.2.1: - resolution: {integrity: sha512-pt7MMkQFDlWJVy9ULJ1h+hZBDGFfSCwlBNW1HkLnVi7jUhyEXUaGYWi1x6bM2IXuAR9l265khBT4Av4lPmaNLQ==} + /@svgr/hast-util-to-babel-ast/6.3.1: + resolution: {integrity: sha512-NgyCbiTQIwe3wHe/VWOUjyxmpUmsrBjdoIxKpXt3Nqc3TN30BpJG22OxBvVzsAh9jqep0w0/h8Ywvdk3D9niNQ==} engines: {node: '>=10'} dependencies: '@babel/types': 7.18.7 - entities: 3.0.1 + entities: 4.3.1 dev: true - /@svgr/plugin-jsx/6.2.1_@svgr+core@6.2.1: - resolution: {integrity: sha512-u+MpjTsLaKo6r3pHeeSVsh9hmGRag2L7VzApWIaS8imNguqoUwDq/u6U/NDmYs/KAsrmtBjOEaAAPbwNGXXp1g==} + /@svgr/plugin-jsx/6.3.1_@svgr+core@6.3.1: + resolution: {integrity: sha512-r9+0mYG3hD4nNtUgsTXWGYJomv/bNd7kC16zvsM70I/bGeoCi/3lhTmYqeN6ChWX317OtQCSZZbH4wq9WwoXbw==} engines: {node: '>=10'} peerDependencies: '@svgr/core': ^6.0.0 dependencies: '@babel/core': 7.18.6 - '@svgr/babel-preset': 6.2.0_@babel+core@7.18.6 - '@svgr/core': 6.2.1 - '@svgr/hast-util-to-babel-ast': 6.2.1 + '@svgr/babel-preset': 6.3.1_@babel+core@7.18.6 + '@svgr/core': 6.3.1 + '@svgr/hast-util-to-babel-ast': 6.3.1 svg-parser: 2.0.4 transitivePeerDependencies: - supports-color dev: true - /@svgr/plugin-svgo/6.2.0_@svgr+core@6.2.1: + /@svgr/plugin-svgo/6.2.0_@svgr+core@6.3.1: resolution: {integrity: sha512-oDdMQONKOJEbuKwuy4Np6VdV6qoaLLvoY86hjvQEgU82Vx1MSWRyYms6Sl0f+NtqxLI/rDVufATbP/ev996k3Q==} engines: {node: '>=10'} peerDependencies: '@svgr/core': ^6.0.0 dependencies: - '@svgr/core': 6.2.1 + '@svgr/core': 6.3.1 cosmiconfig: 7.0.1 deepmerge: 4.2.2 svgo: 2.8.0 @@ -6029,14 +6149,14 @@ packages: '@babel/preset-env': 7.18.6_@babel+core@7.18.6 '@babel/preset-react': 7.18.6_@babel+core@7.18.6 '@babel/preset-typescript': 7.18.6_@babel+core@7.18.6 - '@svgr/core': 6.2.1 - '@svgr/plugin-jsx': 6.2.1_@svgr+core@6.2.1 - '@svgr/plugin-svgo': 6.2.0_@svgr+core@6.2.1 + '@svgr/core': 6.3.1 + '@svgr/plugin-jsx': 6.3.1_@svgr+core@6.3.1 + '@svgr/plugin-svgo': 6.2.0_@svgr+core@6.3.1 transitivePeerDependencies: - supports-color dev: true - /@swc/cli/0.1.57_@swc+core@1.2.210: + /@swc/cli/0.1.57_@swc+core@1.2.244: resolution: {integrity: sha512-HxM8TqYHhAg+zp7+RdTU69bnkl4MWdt1ygyp6BDIPjTiaJVH6Dizn2ezbgDS8mnFZI1FyhKvxU/bbaUs8XhzQg==} engines: {node: '>= 12.13'} hasBin: true @@ -6047,152 +6167,175 @@ packages: chokidar: optional: true dependencies: - '@swc/core': 1.2.210 + '@swc/core': 1.2.244 commander: 7.2.0 fast-glob: 3.2.11 slash: 3.0.0 source-map: 0.7.4 dev: true - /@swc/core-android-arm-eabi/1.2.210: - resolution: {integrity: sha512-JGPcCM9XixJIbCHP/fbI79pXTuU9C3V6AxolTy0zEhgNe7r59CiSVcGWN5t5dgkEuwApAxN2iNjJRmz4z+ALAg==} + /@swc/core-android-arm-eabi/1.2.244: + resolution: {integrity: sha512-bQN6SY78bFIm6lz46ss4+ZDU9owevVjF95Cm+3KB/13ZOPF+m5Pdm8WQLoBYTLgJ0r4/XukEe9XXjba/6Kf8kw==} engines: {node: '>=10'} cpu: [arm] os: [android] requiresBuild: true + dependencies: + '@swc/wasm': 1.2.122 optional: true - /@swc/core-android-arm64/1.2.210: - resolution: {integrity: sha512-oP2b8LjZiMNrzOnoC/mVomksSiqQDrIsm4LxPAGTK1fWnbtITLF/Wj/St1wnUu98jZf5kvQP9AH3p2d3J6UaDA==} + /@swc/core-android-arm64/1.2.244: + resolution: {integrity: sha512-CJeL/EeOIzrH+77otNT6wfGF8uadOHo4rEaBN/xvmtnpdADjYJ8Wt85X4nRK0G929bMke/QdJm5ilPNJdmgCTg==} engines: {node: '>=10'} cpu: [arm64] os: [android] requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 optional: true - /@swc/core-darwin-arm64/1.2.210: - resolution: {integrity: sha512-7PEHF1AHRpVcMtttfOVtyjZq73VUVaLsBnTWUqdFv1toRu42n+CmnXm3brmnSwyi7TTtCU/nahunWNmBbJeG8A==} + /@swc/core-darwin-arm64/1.2.244: + resolution: {integrity: sha512-ZhRK8L/lpPCerUxtrW48cRJtpsUG5xVTUXu3N0TrYuxRzzapHgK+61g1JdtcwdNvEV7l00X4vfCBRYO0S2nsmw==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] requiresBuild: true optional: true - /@swc/core-darwin-x64/1.2.210: - resolution: {integrity: sha512-FEPSgnzRy7X9SaDWtAQKfoodttG90GOyTKqBC/915SPhvuprSf3/PpX2NP63E44/GVgEoNzmNGGiUzbL5k70Dg==} + /@swc/core-darwin-x64/1.2.244: + resolution: {integrity: sha512-4mY8Gkq2ZMUpXYCLceGp7w0Jnxp75N1gQswNFhMBU4k90ElDuBtPoUSnB1v8MwlQtK7WA25MdvwFnBaEJnfxOg==} engines: {node: '>=10'} cpu: [x64] os: [darwin] requiresBuild: true optional: true - /@swc/core-freebsd-x64/1.2.210: - resolution: {integrity: sha512-nehrNTikTfY4H08VUjp20/U5/bt4PC/hi8Zthjz1A0evcIdA0WHajByFj0um/0lYmdF1K6T7A9UuaoOwPEAZ0A==} + /@swc/core-freebsd-x64/1.2.244: + resolution: {integrity: sha512-k/NEZfkgtZ4S96woYArZ89jwJ/L1zyxihTgFFu7SxDt+WRE1EPmY42Gt4y874zi1JiSEFSRHiiueDUfRPu7C0Q==} engines: {node: '>=10'} cpu: [x64] os: [freebsd] requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 optional: true - /@swc/core-linux-arm-gnueabihf/1.2.210: - resolution: {integrity: sha512-vbSQxZcPBJC2WqVWHZhZIPpv+8xoNug/Qv6FLFPcl735MeNRzgciKC1LlXuy6DNA0RqoCPPyzaK2jnwJyq4bSw==} + /@swc/core-linux-arm-gnueabihf/1.2.244: + resolution: {integrity: sha512-tE9b/oZWhMXwoXHkgHFckMrLrlczvG7HgQAdtDuA6g30Xd/3XmdVzC4NbXR+1HoaGVDh7cf0EFE3aKdfPvPQwA==} engines: {node: '>=10'} cpu: [arm] os: [linux] requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 optional: true - /@swc/core-linux-arm64-gnu/1.2.210: - resolution: {integrity: sha512-gfItagFmC06q5Uu7WHf/O3n1yKhA7uAo9VPUcNDKKrOh/WSkMI2dxtoeo4u5xOuJWKWedGCcdyJw46uhpYST0w==} + /@swc/core-linux-arm64-gnu/1.2.244: + resolution: {integrity: sha512-zrpVKUeQxZnzorOp3aXhjK1X2/6xuVZcdyxAUDzItP6G4nLbgPBEQLUi6aUjOjquFiihokXoKWaMPQjF/LqH+g==} engines: {node: '>=10'} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@swc/core-linux-arm64-musl/1.2.210: - resolution: {integrity: sha512-3nlNHIYiuppJBB+bbaxLfGN/mnofaVvKVEwUQ9HPtghY87zFIsKl1RfNQtxcOlcarcWya1XAMSk9NXv2dFHWDg==} + /@swc/core-linux-arm64-musl/1.2.244: + resolution: {integrity: sha512-gI6bntk+HDe2witOsQgBDyDDpRmF5dfxbygvVsEdCI+Ko9yj5S9aCsc8WhhbtdcEG1Fo3v/sM/F/9pGatCAwzQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] requiresBuild: true optional: true - /@swc/core-linux-x64-gnu/1.2.210: - resolution: {integrity: sha512-BmhfneSvUzIufUhPaql3YvoWlSrNZiAhpL3c5fPrfQxADywkZLljgh0kckxpeCi5R8iWIUlNSPFmo589QS2Jsg==} + /@swc/core-linux-x64-gnu/1.2.244: + resolution: {integrity: sha512-hwJ5HrDj7asmVGjzaT6SFdhPVxVUIYm9LCuE3yu89+6C5aR9YrCXvpgIjGcHJvEO2PLAtff72FsX7sbXbzzYGQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@swc/core-linux-x64-musl/1.2.210: - resolution: {integrity: sha512-0VT7FeF4Vc/u0oxVLplF/0hcApE+fwC4Njf49SFyvszgAMc9a+fyUNBX2NSqIrTQFwmifRcpQOeXDT8Edy0g6w==} + /@swc/core-linux-x64-musl/1.2.244: + resolution: {integrity: sha512-P8d4AIVN63xaS3t5WhOo0Ejy/X7XaDxXe9sJpEbGQP7CGofhURvgXwe8Q6uhPeWC9AwEPu35ArFQ0ZUmOCY0rg==} engines: {node: '>=10'} cpu: [x64] os: [linux] requiresBuild: true optional: true - /@swc/core-win32-arm64-msvc/1.2.210: - resolution: {integrity: sha512-MwM35TtzMX7GS424y/Bk0CrwWsYRfZ/WX15QAi/Yz+fnPCDLtFNknRC7gAaTpDeqywu6dsXUFyErzK1FC8l8YA==} + /@swc/core-win32-arm64-msvc/1.2.244: + resolution: {integrity: sha512-PZUhgooqPDo+NUo+tIxWI1jKnYVV2ACs8eUkSE++Qf7E4/9Igy79XHbG4/G5ERlCudhdcw4XkYiRN8GJQg6P5w==} engines: {node: '>=10'} cpu: [arm64] os: [win32] requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 optional: true - /@swc/core-win32-ia32-msvc/1.2.210: - resolution: {integrity: sha512-KpofYa0wqd8urFLrdsz0yQU2YkF7NEDU3+IzqUNnxwamlaEFg/C3l6rTgmiihHXIZuYQS9di4YwykyMVVXutOA==} + /@swc/core-win32-ia32-msvc/1.2.244: + resolution: {integrity: sha512-w7v8fND4E8wOHoVVNJIDjOh8EQiedI9HCsCTEDM/z/dVPsk/rxi6iHYnZG6gv+X/d0aCLeZQOkW9khfyy128cg==} engines: {node: '>=10'} cpu: [ia32] os: [win32] requiresBuild: true + dependencies: + '@swc/wasm': 1.2.130 optional: true - /@swc/core-win32-x64-msvc/1.2.210: - resolution: {integrity: sha512-bUhY0bK8s+B6LSdbNu9L0RKrO/rWrXICtIZyHZolUZKo326hfQ0Iwx+N/xuh6jYpON0RaY9pR0HAyaCDHugoRA==} + /@swc/core-win32-x64-msvc/1.2.244: + resolution: {integrity: sha512-/A9ssLtqXEQrdHnJ9SvZSBF7zQM/0ydz8B3p5BT9kUbAhmNqbfE4/Wy3d2zd7nrF16n6tRm4giCzcIdzd/7mvw==} engines: {node: '>=10'} cpu: [x64] os: [win32] requiresBuild: true optional: true - /@swc/core/1.2.210: - resolution: {integrity: sha512-euiCxnx+dCnE6iDGM04hIvcLS2LADVgIDo0OGnxqRce4SwUNHZi/KcRxIT04YtJd3BdO5v+l4K8RHIx4jvn+TA==} + /@swc/core/1.2.244: + resolution: {integrity: sha512-/UguNMvKgVeR8wGFb53h+Y9hFSiEpeUhC4Cr1neN15wvWZD3lfvN4qAdqNifZiiPKXrCwYy8NTKlHVtHMYzpXw==} engines: {node: '>=10'} hasBin: true + requiresBuild: true optionalDependencies: - '@swc/core-android-arm-eabi': 1.2.210 - '@swc/core-android-arm64': 1.2.210 - '@swc/core-darwin-arm64': 1.2.210 - '@swc/core-darwin-x64': 1.2.210 - '@swc/core-freebsd-x64': 1.2.210 - '@swc/core-linux-arm-gnueabihf': 1.2.210 - '@swc/core-linux-arm64-gnu': 1.2.210 - '@swc/core-linux-arm64-musl': 1.2.210 - '@swc/core-linux-x64-gnu': 1.2.210 - '@swc/core-linux-x64-musl': 1.2.210 - '@swc/core-win32-arm64-msvc': 1.2.210 - '@swc/core-win32-ia32-msvc': 1.2.210 - '@swc/core-win32-x64-msvc': 1.2.210 + '@swc/core-android-arm-eabi': 1.2.244 + '@swc/core-android-arm64': 1.2.244 + '@swc/core-darwin-arm64': 1.2.244 + '@swc/core-darwin-x64': 1.2.244 + '@swc/core-freebsd-x64': 1.2.244 + '@swc/core-linux-arm-gnueabihf': 1.2.244 + '@swc/core-linux-arm64-gnu': 1.2.244 + '@swc/core-linux-arm64-musl': 1.2.244 + '@swc/core-linux-x64-gnu': 1.2.244 + '@swc/core-linux-x64-musl': 1.2.244 + '@swc/core-win32-arm64-msvc': 1.2.244 + '@swc/core-win32-ia32-msvc': 1.2.244 + '@swc/core-win32-x64-msvc': 1.2.244 - /@swc/helpers/0.4.3: - resolution: {integrity: sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA==} + /@swc/helpers/0.4.11: + resolution: {integrity: sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==} dependencies: tslib: 2.4.0 dev: true - /@swc/jest/0.2.21_@swc+core@1.2.210: - resolution: {integrity: sha512-/+NcExiZbxXANNhNPnIdFuGq62CeumulLS1bngwqIXd8H7d96LFUfrYzdt8tlTwLMel8tFtQ5aRjzVkyOTyPDw==} + /@swc/jest/0.2.22_@swc+core@1.2.244: + resolution: {integrity: sha512-PIUIk9IdB1oAVfF9zNIfYoMBoEhahrrSvyryFANas7swC1cF0L5HR0f9X4qfet46oyCHCBtNcSpN0XJEOFIKlw==} engines: {npm: '>= 7.0.0'} peerDependencies: '@swc/core': '*' dependencies: '@jest/create-cache-key-function': 27.5.1 - '@swc/core': 1.2.210 + '@swc/core': 1.2.244 dev: true + /@swc/wasm/1.2.122: + resolution: {integrity: sha512-sM1VCWQxmNhFtdxME+8UXNyPNhxNu7zdb6ikWpz0YKAQQFRGT5ThZgJrubEpah335SUToNg8pkdDF7ibVCjxbQ==} + requiresBuild: true + optional: true + + /@swc/wasm/1.2.130: + resolution: {integrity: sha512-rNcJsBxS70+pv8YUWwf5fRlWX6JoY/HJc25HD/F8m6Kv7XhJdqPPMhyX6TKkUBPAG7TWlZYoxa+rHAjPy4Cj3Q==} + requiresBuild: true + optional: true + /@szmarczak/http-timer/5.0.1: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} @@ -6214,14 +6357,14 @@ packages: pretty-format: 27.5.1 dev: true - /@testing-library/react-hooks/8.0.1_5qggqhesezyescxqnsg4rpj6qa: + /@testing-library/react-hooks/8.0.1_y6lpz2mvcoua7qihahug4ke22i: resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} engines: {node: '>=12'} peerDependencies: - '@types/react': ^16.9.0 || ^17.0.0 - react: ^16.9.0 || ^17.0.0 - react-dom: ^16.9.0 || ^17.0.0 - react-test-renderer: ^16.9.0 || ^17.0.0 + '@types/react': ^16.9.0 || ^17.0.0 || 18 + react: ^16.9.0 || ^17.0.0 || 18 + react-dom: ^16.9.0 || ^17.0.0 || 18 + react-test-renderer: ^16.9.0 || ^17.0.0 || 18 peerDependenciesMeta: '@types/react': optional: true @@ -6233,7 +6376,7 @@ packages: optional: true dependencies: '@babel/runtime': 7.18.6 - '@types/react': 18.0.14 + '@types/react': 18.0.17 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-error-boundary: 3.1.4_react@18.2.0 @@ -6244,8 +6387,8 @@ packages: resolution: {integrity: sha512-DB79aA426+deFgGSjnf5grczDPiL4taK3hFaa+M5q7q20Kcve9eQottOG5kZ74KEr55v0tU2CQormSSDK87zYQ==} engines: {node: '>=12'} peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 + react: ^18.0.0 || 18 + react-dom: ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -6262,8 +6405,8 @@ packages: /@tldraw/core/1.14.1: resolution: {integrity: sha512-FAiX/TD/tl5eMvTk0IHhFUSmldCe/UTTOnLL5aWQHqhicF/iTP5m3H12L6kyjN60yfssN8U9g4E/7y70TY7JxA==} peerDependencies: - react: '>=16.8' - react-dom: '>=16.8' + react: '>=16.8 || 18' + react-dom: '>=16.8 || 18' peerDependenciesMeta: react: optional: true @@ -6284,8 +6427,8 @@ packages: /@tldraw/core/1.14.1_mobx@6.6.1: resolution: {integrity: sha512-FAiX/TD/tl5eMvTk0IHhFUSmldCe/UTTOnLL5aWQHqhicF/iTP5m3H12L6kyjN60yfssN8U9g4E/7y70TY7JxA==} peerDependencies: - react: '>=16.8' - react-dom: '>=16.8' + react: '>=16.8 || 18' + react-dom: '>=16.8 || 18' peerDependenciesMeta: react: optional: true @@ -6391,7 +6534,7 @@ packages: /@types/bonjour/3.5.10: resolution: {integrity: sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/cacheable-request/6.0.2: @@ -6399,7 +6542,7 @@ packages: dependencies: '@types/http-cache-semantics': 4.0.1 '@types/keyv': 3.1.4 - '@types/node': 18.0.1 + '@types/node': 18.7.13 '@types/responselike': 1.0.0 dev: false @@ -6413,7 +6556,7 @@ packages: resolution: {integrity: sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==} dependencies: '@types/express-serve-static-core': 4.17.29 - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/connect/3.4.35: @@ -6482,20 +6625,20 @@ packages: /@types/fs-extra/8.1.2: resolution: {integrity: sha512-SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/glob/7.2.0: resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} dependencies: '@types/minimatch': 3.0.5 - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/history/4.7.11: @@ -6513,7 +6656,7 @@ packages: /@types/http-proxy/1.17.9: resolution: {integrity: sha512-QsbSjA/fSk7xB+UXlCT3wHBy5ai9wOcNDWwZAtud+jXhwOM3l+EYZh8Lng4+/6n8uar0J7xILzqftJdJ/Wdfkw==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/is-hotkey/0.1.7: @@ -6539,10 +6682,10 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: true - /@types/jest/28.1.4: - resolution: {integrity: sha512-telv6G5N7zRJiLcI3Rs3o+ipZ28EnE+7EvF0pSrt2pZOMnAVI/f+6/LucDxOvcBcTeTL3JMF744BbVQAVBUQRA==} + /@types/jest/28.1.8: + resolution: {integrity: sha512-8TJkV++s7B6XqnDrzR1m/TT0A0h948Pnl/097veySPN67VRAgQ4gZ7n2KfJo2rVq6njQjdxU3GCCyDvAeuHoiw==} dependencies: - jest-matcher-utils: 28.1.1 + expect: 28.1.1 pretty-format: 28.1.1 dev: true @@ -6598,9 +6741,8 @@ packages: /@types/node/18.0.1: resolution: {integrity: sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==} - /@types/npmlog/4.1.4: - resolution: {integrity: sha512-WKG4gTr8przEZBiJ5r3s8ZIAoMXNbOgQ+j/d5O4X3x6kZJRLNvyUJuUK/KoG3+8BaOHPhp2m7WC6JKKeovDSzQ==} - dev: true + /@types/node/18.7.13: + resolution: {integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==} /@types/parse-json/4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} @@ -6628,7 +6770,7 @@ packages: /@types/react-dom/18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: - '@types/react': 18.0.14 + '@types/react': 18.0.17 dev: true /@types/react-is/17.0.3: @@ -6647,7 +6789,7 @@ packages: resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.14 + '@types/react': 18.0.17 '@types/react-router': 5.1.18 dev: true @@ -6655,13 +6797,13 @@ packages: resolution: {integrity: sha512-YYknwy0D0iOwKQgz9v8nOzt2J6l4gouBmDnWqUUznltOTaon+r8US8ky8HvN0tXvc38U9m6z/t2RsVsnd1zM0g==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.14 + '@types/react': 18.0.17 dev: true /@types/react-transition-group/4.4.5: resolution: {integrity: sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==} dependencies: - '@types/react': 18.0.14 + '@types/react': 18.0.17 dev: false /@types/react-window/1.8.5: @@ -6677,6 +6819,13 @@ packages: '@types/scheduler': 0.16.2 csstype: 3.1.0 + /@types/react/18.0.17: + resolution: {integrity: sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.0 + /@types/readable-stream/2.3.14: resolution: {integrity: sha512-8jQ5Mp7bsDJEnW/69i6nAaQMoLwAVJVc7ZRAVTrdh/o6XueQsX38TEvKuYyoQj76/mg7WdlRfMrtl9pDLCJWsg==} dependencies: @@ -6687,7 +6836,7 @@ packages: /@types/resolve/1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/responselike/1.0.0: @@ -6725,7 +6874,7 @@ packages: /@types/sockjs/0.3.33: resolution: {integrity: sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /@types/sql.js/1.4.3: @@ -6818,19 +6967,6 @@ packages: - supports-color dev: true - /@typescript-eslint/experimental-utils/5.30.5_4x5o4skxv6sl53vpwefgt23khm: - resolution: {integrity: sha512-lsOedOkwAHWiJyvQsv9DtvWnANWecf28eO/L1EPNxLIBRoB7UCDa0uZF61IikZHYubGnDLLHDQ/6KFWl4Nrnjg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@typescript-eslint/utils': 5.30.5_4x5o4skxv6sl53vpwefgt23khm - eslint: 8.19.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /@typescript-eslint/parser/5.30.5_4x5o4skxv6sl53vpwefgt23khm: resolution: {integrity: sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -6937,7 +7073,7 @@ packages: /@use-gesture/react/10.2.16: resolution: {integrity: sha512-kkWi97SHzj/F6XqRXSyrk5pLoSiuRgqvnQl2Bawmf05dWo2q6DL7v5LhnnyPNZRVkCm+WEb3e1nsR+iVza1vmg==} peerDependencies: - react: '>= 16.8.0' + react: '>= 16.8.0 || 18' peerDependenciesMeta: react: optional: true @@ -7141,10 +7277,8 @@ packages: indent-string: 4.0.0 dev: true - /ajv-formats/2.1.1_ajv@8.11.0: + /ajv-formats/2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} - peerDependencies: - ajv: ^8.0.0 peerDependenciesMeta: ajv: optional: true @@ -7208,11 +7342,6 @@ packages: hasBin: true dev: true - /ansi-regex/2.1.1: - resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} - engines: {node: '>=0.10.0'} - dev: true - /ansi-regex/3.0.1: resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} engines: {node: '>=4'} @@ -7262,10 +7391,6 @@ packages: picomatch: 2.3.1 dev: true - /aproba/1.2.0: - resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==} - dev: true - /arch/2.2.0: resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==} dev: true @@ -7277,13 +7402,6 @@ packages: file-type: 4.4.0 dev: true - /are-we-there-yet/1.1.7: - resolution: {integrity: sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==} - dependencies: - delegates: 1.0.0 - readable-stream: 2.3.7 - dev: true - /arg/4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true @@ -7571,7 +7689,7 @@ packages: loader-utils: 2.0.2 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /babel-plugin-const-enum/1.2.0_@babel+core@7.18.6: @@ -8331,11 +8449,6 @@ packages: resolution: {integrity: sha512-JN7Fa6iwAUPyJC/h8myT4Dm+/Weu2TvaPzKcyl1qJ9yX7pmQsEszbF2D+23oFlR7jngCeU2KRkUiakbFTOobRA==} dev: false - /code-point-at/1.1.0: - resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} - engines: {node: '>=0.10.0'} - dev: true - /codemirror-lang-elixir/3.0.0_@codemirror+language@6.2.1: resolution: {integrity: sha512-Liy5MDxf+xw7aFqNfhLfntSK6vsRkI0lSlyytw23P1hWSrb0Bw5WunEB3iKJ49iUu8Kj2dx+vvMqD8I5ms7rSQ==} peerDependencies: @@ -8344,18 +8457,16 @@ packages: '@codemirror/language': 6.2.1 dev: false - /codemirror/6.0.1_@lezer+common@1.0.0: + /codemirror/6.0.1: resolution: {integrity: sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==} dependencies: - '@codemirror/autocomplete': 6.0.3_nq4pwfkqi5icglf26kczcr4s2i + '@codemirror/autocomplete': 6.0.3 '@codemirror/commands': 6.0.1 '@codemirror/language': 6.2.1 '@codemirror/lint': 6.0.0 '@codemirror/search': 6.0.0 '@codemirror/state': 6.1.1 '@codemirror/view': 6.2.0 - transitivePeerDependencies: - - '@lezer/common' dev: false /collect-v8-coverage/1.0.1: @@ -8464,7 +8575,7 @@ packages: dependencies: schema-utils: 4.0.0 serialize-javascript: 6.0.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /compression/1.7.4: @@ -8512,10 +8623,6 @@ packages: engines: {node: '>=0.8'} dev: true - /console-control-strings/1.1.0: - resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} - dev: true - /constant-case/3.0.4: resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} dependencies: @@ -8556,9 +8663,9 @@ packages: toggle-selection: 1.0.6 dev: false - /copy-webpack-plugin/9.1.0_webpack@5.74.0: - resolution: {integrity: sha512-rxnR7PaGigJzhqETHGmAcxKnLZSR5u1Y3/bcIv/1FnqXedcL/E2ewK7ZCNrArJKCiSv8yVXhTqetJh8inDvfsA==} - engines: {node: '>= 12.13.0'} + /copy-webpack-plugin/10.2.4_webpack@5.74.0: + resolution: {integrity: sha512-xFVltahqlsRcyyJqQbDY6EYTtyQZF9rf+JPjwHObLdPFMEISqkFkr7mFoVOC6BfYS/dNThyoQKvziugm+OnwBg==} + engines: {node: '>= 12.20.0'} peerDependencies: webpack: ^5.1.0 peerDependenciesMeta: @@ -8567,11 +8674,11 @@ packages: dependencies: fast-glob: 3.2.11 glob-parent: 6.0.2 - globby: 11.1.0 + globby: 12.2.0 normalize-path: 3.0.0 - schema-utils: 3.1.1 + schema-utils: 4.0.0 serialize-javascript: 6.0.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /core-js-compat/3.23.3: @@ -8586,16 +8693,10 @@ packages: requiresBuild: true dev: true - /core-js/3.23.3: - resolution: {integrity: sha512-oAKwkj9xcWNBAvGbT//WiCdOMpb9XQG92/Fe3ABFM/R16BsHgePG00mFOgKf7IsCtfj8tA1kHtf/VwErhriz5Q==} + /core-js/3.25.0: + resolution: {integrity: sha512-CVU1xvJEfJGhyCpBrzzzU1kjCfgsGUxhEvwUV2e/cOedYWHdmluamx+knDnmhqALddMG16fZvIqvs9aijsHHaA==} requiresBuild: true - /core-js/3.6.5: - resolution: {integrity: sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==} - deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. - requiresBuild: true - dev: true - /core-util-is/1.0.2: resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} dev: true @@ -8703,7 +8804,7 @@ packages: postcss-modules-values: 4.0.0_postcss@8.4.14 postcss-value-parser: 4.2.0 semver: 7.3.7 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /css-minimizer-webpack-plugin/3.4.1_webpack@5.74.0: @@ -8733,7 +8834,7 @@ packages: schema-utils: 4.0.0 serialize-javascript: 6.0.0 source-map: 0.6.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /css-minimizer-webpack-plugin/4.0.0_webpack@5.74.0: @@ -8763,7 +8864,7 @@ packages: schema-utils: 4.0.0 serialize-javascript: 6.0.0 source-map: 0.6.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /css-select/4.3.0: @@ -8972,6 +9073,11 @@ packages: engines: {node: '>=0.11'} dev: false + /date-fns/2.29.2: + resolution: {integrity: sha512-0VNbwmWJDS/G3ySwFSJA3ayhbURMTJLtwM2DTxf9CWondCnh6DTNlO9JgRSq6ibf4eD0lfMJNBxUdEAHHix+bA==} + engines: {node: '>=0.11'} + dev: false + /dayjs/1.11.3: resolution: {integrity: sha512-xxwlswWOlGhzgQ4TKzASQkUhqERI3egRNqgV4ScR8wlANA/A9tZ7miXa44vTTKEq5l7vWoL5G57bG3zA+Kow0A==} dev: true @@ -9162,10 +9268,6 @@ packages: engines: {node: '>=0.4.0'} dev: true - /delegates/1.0.0: - resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} - dev: true - /depd/1.1.2: resolution: {integrity: sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==} engines: {node: '>= 0.6'} @@ -9467,8 +9569,8 @@ packages: resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} dev: true - /entities/3.0.1: - resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==} + /entities/4.3.1: + resolution: {integrity: sha512-o4q/dYJlmyjP2zfnaWDUC6A3BQFmVTX+tZPezK7k0GLSU9QYCauscf5Y+qcEPzKL+EixVouYDgLQK5H9GrLpkg==} engines: {node: '>=0.12'} dev: true @@ -10252,7 +10354,7 @@ packages: dependencies: loader-utils: 2.0.2 schema-utils: 3.1.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /file-saver/2.0.5: @@ -10395,12 +10497,12 @@ packages: semver-regex: 2.0.0 dev: true - /firebase-admin/11.0.1: + /firebase-admin/11.0.1_@firebase+app-types@0.7.0: resolution: {integrity: sha512-rL3wlZbi2Kb/KJgcmj1YHlD4ZhfmhfgRO2YJialxAllm0tj1IQea878hHuBLGmv4DpbW9t9nLvX9kddNR2Y65Q==} engines: {node: '>=14'} dependencies: '@fastify/busboy': 1.1.0 - '@firebase/database-compat': 0.2.4 + '@firebase/database-compat': 0.2.4_@firebase+app-types@0.7.0 '@firebase/database-types': 0.9.10 '@types/node': 18.0.1 jsonwebtoken: 8.5.1 @@ -10416,35 +10518,34 @@ packages: - supports-color dev: false - /firebase/9.9.2: - resolution: {integrity: sha512-zhWUEyBQbwWhLEYhULwZ0A6eRuHP/EP2bpwASpHkI1QQgO1GVqkyCZEpp/feGSDve0COhv9oWC1wOuAzrQrV6g==} + /firebase/9.9.3: + resolution: {integrity: sha512-lU1FstWqfVZQfz4+TWCZvqJYbwZMyoyP0X/xD/YIfrtXgquOMEDTpoasH4P79N9y3I8iV+6gQHuVmpK+AX2elg==} dependencies: - '@firebase/analytics': 0.8.0_@firebase+app@0.7.30 - '@firebase/analytics-compat': 0.1.13_ntdu3hfexp42gsr3dmzonffheq - '@firebase/app': 0.7.30 - '@firebase/app-check': 0.5.12_@firebase+app@0.7.30 - '@firebase/app-check-compat': 0.2.12_ntdu3hfexp42gsr3dmzonffheq - '@firebase/app-compat': 0.1.31 + '@firebase/analytics': 0.8.0_@firebase+app@0.7.31 + '@firebase/analytics-compat': 0.1.13_kowmy6vzi2xcdysg3n6ul4qaae + '@firebase/app': 0.7.31 + '@firebase/app-check': 0.5.12_@firebase+app@0.7.31 + '@firebase/app-check-compat': 0.2.12_kowmy6vzi2xcdysg3n6ul4qaae + '@firebase/app-compat': 0.1.32 '@firebase/app-types': 0.7.0 - '@firebase/auth': 0.20.5_@firebase+app@0.7.30 - '@firebase/auth-compat': 0.2.18_53yvy43rwpg2c45kgeszsxtrca - '@firebase/database': 0.13.4_@firebase+app-types@0.7.0 - '@firebase/database-compat': 0.2.4_@firebase+app-types@0.7.0 - '@firebase/firestore': 3.4.14_@firebase+app@0.7.30 - '@firebase/firestore-compat': 0.1.23_53yvy43rwpg2c45kgeszsxtrca - '@firebase/functions': 0.8.4_54flq6t3lt2vkv56b3wekvuqsq - '@firebase/functions-compat': 0.2.4_53yvy43rwpg2c45kgeszsxtrca - '@firebase/installations': 0.5.12_@firebase+app@0.7.30 - '@firebase/installations-compat': 0.1.12_53yvy43rwpg2c45kgeszsxtrca - '@firebase/messaging': 0.9.16_@firebase+app@0.7.30 - '@firebase/messaging-compat': 0.1.16_ntdu3hfexp42gsr3dmzonffheq - '@firebase/performance': 0.5.12_@firebase+app@0.7.30 - '@firebase/performance-compat': 0.1.12_ntdu3hfexp42gsr3dmzonffheq - '@firebase/polyfill': 0.3.36 - '@firebase/remote-config': 0.3.11_@firebase+app@0.7.30 - '@firebase/remote-config-compat': 0.1.12_ntdu3hfexp42gsr3dmzonffheq - '@firebase/storage': 0.9.9_@firebase+app@0.7.30 - '@firebase/storage-compat': 0.1.17_53yvy43rwpg2c45kgeszsxtrca + '@firebase/auth': 0.20.5_@firebase+app@0.7.31 + '@firebase/auth-compat': 0.2.18_kg6iqletipudcxzgqetrtqyldy + '@firebase/database': 0.13.5_@firebase+app-types@0.7.0 + '@firebase/database-compat': 0.2.5_@firebase+app-types@0.7.0 + '@firebase/firestore': 3.4.14_@firebase+app@0.7.31 + '@firebase/firestore-compat': 0.1.23_kg6iqletipudcxzgqetrtqyldy + '@firebase/functions': 0.8.4_lwgt3sk4yfjgasfpmvix4ixi2u + '@firebase/functions-compat': 0.2.4_kg6iqletipudcxzgqetrtqyldy + '@firebase/installations': 0.5.12_@firebase+app@0.7.31 + '@firebase/installations-compat': 0.1.12_kg6iqletipudcxzgqetrtqyldy + '@firebase/messaging': 0.9.16_@firebase+app@0.7.31 + '@firebase/messaging-compat': 0.1.16_kowmy6vzi2xcdysg3n6ul4qaae + '@firebase/performance': 0.5.12_@firebase+app@0.7.31 + '@firebase/performance-compat': 0.1.12_kowmy6vzi2xcdysg3n6ul4qaae + '@firebase/remote-config': 0.3.11_@firebase+app@0.7.31 + '@firebase/remote-config-compat': 0.1.12_kowmy6vzi2xcdysg3n6ul4qaae + '@firebase/storage': 0.9.9_@firebase+app@0.7.31 + '@firebase/storage-compat': 0.1.17_kg6iqletipudcxzgqetrtqyldy '@firebase/util': 1.6.3 transitivePeerDependencies: - bufferutil @@ -10502,42 +10603,38 @@ packages: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} dev: true - /fork-ts-checker-webpack-plugin/6.2.10_wln64xm7gyszy6wbwhdijmigya: - resolution: {integrity: sha512-HveFCHWSH2WlYU1tU3PkrupvW8lNFMTfH3Jk0TfC2mtktE9ibHGcifhCsCFvj+kqlDfNIlwmNLiNqR9jnSA7OQ==} - engines: {node: '>=10', yarn: '>=1.0.0'} + /fork-ts-checker-webpack-plugin/7.2.13_xnp4kzegbjokq62cajex2ovgkm: + resolution: {integrity: sha512-fR3WRkOb4bQdWB/y7ssDUlVdrclvwtyCUIHCfivAoYxq9dF7XfrDKbMdZIfwJ7hxIAqkYSGeU7lLJE6xrxIBdg==} + engines: {node: '>=12.13.0', yarn: '>=1.0.0'} peerDependencies: - eslint: '>= 6' - typescript: '>= 2.7' + typescript: '>3.6.0' vue-template-compiler: '*' - webpack: '>= 4' + webpack: ^5.11.0 peerDependenciesMeta: - eslint: - optional: true vue-template-compiler: optional: true webpack: optional: true dependencies: '@babel/code-frame': 7.18.6 - '@types/json-schema': 7.0.11 chalk: 4.1.2 chokidar: 3.5.3 - cosmiconfig: 6.0.0 + cosmiconfig: 7.0.1 deepmerge: 4.2.2 - eslint: 8.19.0 - fs-extra: 9.1.0 - glob: 7.2.3 + fs-extra: 10.1.0 memfs: 3.4.7 minimatch: 3.1.2 - schema-utils: 2.7.0 + node-abort-controller: 3.0.1 + schema-utils: 3.1.1 semver: 7.3.7 - tapable: 1.1.3 + tapable: 2.2.1 typescript: 4.7.4 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true - /form-data-encoder/1.7.1: - resolution: {integrity: sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==} + /form-data-encoder/2.1.0: + resolution: {integrity: sha512-njK60LnfhfDWy+AEUIf9ZQNRAcmXCdDfiNOm2emuPtzwh7U9k/mo9F3S54aPiaZ3vhqUjikVLfcPg2KuBddskQ==} + engines: {node: '>= 14.17'} dev: false /form-data/2.3.3: @@ -10651,19 +10748,6 @@ packages: /functions-have-names/1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - /gauge/2.7.4: - resolution: {integrity: sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==} - dependencies: - aproba: 1.2.0 - console-control-strings: 1.1.0 - has-unicode: 2.0.1 - object-assign: 4.1.1 - signal-exit: 3.0.7 - string-width: 1.0.2 - strip-ansi: 3.0.1 - wide-align: 1.1.5 - dev: true - /gaxios/4.3.3: resolution: {integrity: sha512-gSaYYIO1Y3wUtdfHmjDUZ8LWaxJQpiavzbF5Kq53akSzvmVg0RfyOcFDbO1KJ/KCGRFz2qG+lS81F0nkr7cRJA==} engines: {node: '>=10'} @@ -10987,18 +11071,18 @@ packages: dev: false optional: true - /got/12.1.0: - resolution: {integrity: sha512-hBv2ty9QN2RdbJJMK3hesmSkFTjVIHyIDDbssCKnSmq62edGgImJWD10Eb1k77TiV1bxloxqcFAVK8+9pkhOig==} + /got/12.3.1: + resolution: {integrity: sha512-tS6+JMhBh4iXMSXF6KkIsRxmloPln31QHDlcb6Ec3bzxjjFJFr/8aXdpyuLmVc9I4i2HyBHYw1QU5K1ruUdpkw==} engines: {node: '>=14.16'} dependencies: - '@sindresorhus/is': 4.6.0 + '@sindresorhus/is': 5.3.0 '@szmarczak/http-timer': 5.0.1 '@types/cacheable-request': 6.0.2 '@types/responselike': 1.0.0 cacheable-lookup: 6.0.4 cacheable-request: 7.0.2 decompress-response: 6.0.0 - form-data-encoder: 1.7.1 + form-data-encoder: 2.1.0 get-stream: 6.0.1 http2-wrapper: 2.1.11 lowercase-keys: 3.0.0 @@ -11133,10 +11217,6 @@ packages: dependencies: has-symbols: 1.0.3 - /has-unicode/2.0.1: - resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} - dev: true - /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} @@ -11244,7 +11324,7 @@ packages: lodash: 4.17.21 pretty-error: 4.0.0 tapable: 2.2.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /htmlparser2/6.1.0: @@ -11732,13 +11812,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /is-fullwidth-code-point/1.0.0: - resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} - engines: {node: '>=0.10.0'} - dependencies: - number-is-nan: 1.0.1 - dev: true - /is-fullwidth-code-point/2.0.0: resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} engines: {node: '>=4'} @@ -12053,7 +12126,7 @@ packages: '@jest/environment': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -12081,7 +12154,7 @@ packages: '@jest/expect': 28.1.2 '@jest/test-result': 28.1.1 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -12100,7 +12173,7 @@ packages: - supports-color dev: true - /jest-cli/28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq: + /jest-cli/28.1.2_3glepa5322b7j342guju4hszoy: resolution: {integrity: sha512-l6eoi5Do/IJUXAFL9qRmDiFpBeEJAnjJb1dcd9i/VWfVWbp3mJhuH50dNtX67Ali4Ecvt4eBkWb4hXhPHkAZTw==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} hasBin: true @@ -12117,7 +12190,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.10 import-local: 3.1.0 - jest-config: 28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq + jest-config: 28.1.2_3glepa5322b7j342guju4hszoy jest-util: 28.1.1 jest-validate: 28.1.1 prompts: 2.4.2 @@ -12141,7 +12214,7 @@ packages: '@jest/test-sequencer': 27.5.1 '@jest/types': 27.5.1 babel-jest: 27.5.1_@babel+core@7.18.6 - chalk: 4.1.0 + chalk: 4.1.2 ci-info: 3.3.2 deepmerge: 4.2.2 glob: 7.2.3 @@ -12161,7 +12234,7 @@ packages: pretty-format: 27.5.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.8.2_y42jqzo3jkzuv3kp7opavo2xbi + ts-node: 10.8.2_hixnfb2jfw56u6pahjg3ndp4oy transitivePeerDependencies: - bufferutil - canvas @@ -12169,7 +12242,48 @@ packages: - utf-8-validate dev: true - /jest-config/28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq: + /jest-config/27.5.1_ts-node@10.9.1: + resolution: {integrity: sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + peerDependencies: + ts-node: '>=9.0.0' + peerDependenciesMeta: + ts-node: + optional: true + dependencies: + '@babel/core': 7.18.6 + '@jest/test-sequencer': 27.5.1 + '@jest/types': 27.5.1 + babel-jest: 27.5.1_@babel+core@7.18.6 + chalk: 4.1.2 + ci-info: 3.3.2 + deepmerge: 4.2.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-circus: 27.5.1 + jest-environment-jsdom: 27.5.1 + jest-environment-node: 27.5.1 + jest-get-type: 27.5.1 + jest-jasmine2: 27.5.1 + jest-regex-util: 27.5.1 + jest-resolve: 27.5.1 + jest-runner: 27.5.1 + jest-util: 27.5.1 + jest-validate: 27.5.1 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 27.5.1 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1_hixnfb2jfw56u6pahjg3ndp4oy + transitivePeerDependencies: + - bufferutil + - canvas + - supports-color + - utf-8-validate + dev: true + + /jest-config/28.1.2_3glepa5322b7j342guju4hszoy: resolution: {integrity: sha512-g6EfeRqddVbjPVBVY4JWpUY4IvQoFRIZcv4V36QkqzE0IGhEC/VkugFeBMAeUE7PRgC8KJF0yvJNDeQRbamEVA==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} peerDependencies: @@ -12184,7 +12298,7 @@ packages: '@babel/core': 7.18.6 '@jest/test-sequencer': 28.1.1 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 babel-jest: 28.1.2_@babel+core@7.18.6 chalk: 4.1.2 ci-info: 3.3.2 @@ -12204,7 +12318,7 @@ packages: pretty-format: 28.1.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.8.2_y42jqzo3jkzuv3kp7opavo2xbi + ts-node: 10.8.2_hixnfb2jfw56u6pahjg3ndp4oy transitivePeerDependencies: - supports-color dev: true @@ -12272,7 +12386,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 16.7.0 @@ -12290,7 +12404,7 @@ packages: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-mock: 27.5.1 jest-util: 27.5.1 dev: true @@ -12302,7 +12416,7 @@ packages: '@jest/environment': 28.1.2 '@jest/fake-timers': 28.1.2 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 jest-mock: 28.1.1 jest-util: 28.1.1 dev: true @@ -12323,7 +12437,7 @@ packages: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.5 - '@types/node': 18.0.1 + '@types/node': 18.7.13 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -12343,7 +12457,7 @@ packages: dependencies: '@jest/types': 28.1.1 '@types/graceful-fs': 4.1.5 - '@types/node': 18.0.1 + '@types/node': 18.7.13 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.10 @@ -12364,7 +12478,7 @@ packages: '@jest/source-map': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 co: 4.6.0 expect: 27.5.1 @@ -12452,7 +12566,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /jest-mock/28.1.1: @@ -12460,7 +12574,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 dev: true /jest-pnp-resolver/1.2.2_jest-resolve@27.5.1: @@ -12512,7 +12626,7 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - chalk: 4.1.0 + chalk: 4.1.2 graceful-fs: 4.2.10 jest-haste-map: 27.5.1 jest-pnp-resolver: 1.2.2_jest-resolve@27.5.1 @@ -12547,7 +12661,7 @@ packages: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.10 @@ -12579,7 +12693,7 @@ packages: '@jest/test-result': 28.1.1 '@jest/transform': 28.1.2 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 emittery: 0.10.2 graceful-fs: 4.2.10 @@ -12663,7 +12777,7 @@ packages: resolution: {integrity: sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 graceful-fs: 4.2.10 dev: true @@ -12733,8 +12847,8 @@ packages: engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: '@jest/types': 27.5.1 - '@types/node': 18.0.1 - chalk: 4.1.0 + '@types/node': 18.7.13 + chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 picomatch: 2.3.1 @@ -12745,7 +12859,7 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 chalk: 4.1.2 ci-info: 3.3.2 graceful-fs: 4.2.10 @@ -12782,7 +12896,7 @@ packages: dependencies: '@jest/test-result': 28.1.1 '@jest/types': 28.1.1 - '@types/node': 18.0.1 + '@types/node': 18.7.13 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.10.2 @@ -12794,7 +12908,7 @@ packages: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -12802,12 +12916,12 @@ packages: resolution: {integrity: sha512-Au7slXB08C6h+xbJPp7VIb6U0XX5Kc9uel/WFc6/rcTzGiaVCBRngBExSYuXSLFPULPSYU3cJ3ybS988lNFQhQ==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest/28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq: + /jest/28.1.2_3glepa5322b7j342guju4hszoy: resolution: {integrity: sha512-Tuf05DwLeCh2cfWCQbcz9UxldoDyiR1E9Igaei5khjonKncYdc6LDfynKCEWozK0oLE3GD+xKAo2u8x/0s6GOg==} engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0} hasBin: true @@ -12820,7 +12934,7 @@ packages: '@jest/core': 28.1.2_ts-node@10.8.2 '@jest/types': 28.1.1 import-local: 3.1.0 - jest-cli: 28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq + jest-cli: 28.1.2_3glepa5322b7j342guju4hszoy transitivePeerDependencies: - '@types/node' - supports-color @@ -12839,17 +12953,17 @@ packages: '@panva/asn1.js': 1.0.0 dev: false - /jotai/1.7.4: - resolution: {integrity: sha512-PvkjL6DA4I0GFNFWt/1MKouTpN6Ohj0qyfuV4LoYGBHQRlf38qF6cPILozYsYZi2Nfeap9MdzWVGSYu1qBElKQ==} + /jotai/1.8.1: + resolution: {integrity: sha512-ZhZ15z+94E95aMYpH9MfwFFYP5m8TuFKkEN/6+3P4SC3dXnQc5s+DbMl+kA4RC63OcUlfi9C0nJU3YDnJfqLIg==} engines: {node: '>=12.7.0'} peerDependencies: '@babel/core': '*' '@babel/template': '*' + '@tanstack/query-core': '*' '@urql/core': '*' immer: '*' optics-ts: '*' - react: '>=16.8' - react-query: '*' + react: '>=16.8 || 18' valtio: '*' wonka: '*' xstate: '*' @@ -12858,6 +12972,8 @@ packages: optional: true '@babel/template': optional: true + '@tanstack/query-core': + optional: true '@urql/core': optional: true immer: @@ -12866,8 +12982,6 @@ packages: optional: true react: optional: true - react-query: - optional: true valtio: optional: true wonka: @@ -13193,7 +13307,7 @@ packages: dependencies: klona: 2.0.5 less: 3.12.2 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /less/3.12.2: @@ -13365,7 +13479,7 @@ packages: webpack-sources: optional: true dependencies: - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-sources: 3.2.3 dev: true @@ -13444,7 +13558,7 @@ packages: log-update: 4.0.0 p-map: 4.0.0 rfdc: 1.3.0 - rxjs: 7.5.5 + rxjs: 7.5.6 through: 2.3.8 wrap-ansi: 7.0.0 dev: true @@ -13822,7 +13936,7 @@ packages: dependencies: loader-utils: 2.0.2 schema-utils: 3.1.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-sources: 1.4.3 dev: false @@ -13836,7 +13950,7 @@ packages: optional: true dependencies: schema-utils: 4.0.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /mini-css-extract-plugin/2.6.1_webpack@5.74.0: @@ -13915,10 +14029,12 @@ packages: resolution: {integrity: sha512-bRuZp3C0itgLKHu/VNxi66DN/XVkQG7xtoBVWxpvC5FhAqbOCP21+nPhULjnzEqd7xBMybp6KwytdUpZKEgpIQ==} peerDependencies: mobx: ^6.1.0 - react: ^16.8.0 || ^17 || ^18 + react: ^16.8.0 || ^17 || ^18 || 18 react-dom: '*' react-native: '*' peerDependenciesMeta: + mobx: + optional: true react: optional: true react-dom: @@ -13931,10 +14047,12 @@ packages: resolution: {integrity: sha512-bRuZp3C0itgLKHu/VNxi66DN/XVkQG7xtoBVWxpvC5FhAqbOCP21+nPhULjnzEqd7xBMybp6KwytdUpZKEgpIQ==} peerDependencies: mobx: ^6.1.0 - react: ^16.8.0 || ^17 || ^18 + react: ^16.8.0 || ^17 || ^18 || 18 react-dom: '*' react-native: '*' peerDependenciesMeta: + mobx: + optional: true react: optional: true react-dom: @@ -14028,6 +14146,10 @@ packages: tslib: 2.4.0 dev: true + /node-abort-controller/3.0.1: + resolution: {integrity: sha512-/ujIVxthRs+7q6hsdjHMaj8hRG9NuWmwrz+JdRwZ14jdFoKSkm+vDsCbF9PLpnSqjaWQJuTmVtcWHNLr+vrOFw==} + dev: true + /node-addon-api/3.2.1: resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} dev: true @@ -14091,8 +14213,8 @@ packages: '@emotion/react': ^11.4.1 '@emotion/styled': ^11.3.0 '@mui/material': ^5.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || 18 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: '@emotion/react': optional: true @@ -14141,32 +14263,18 @@ packages: path-key: 4.0.0 dev: true - /npmlog/4.1.2: - resolution: {integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==} - dependencies: - are-we-there-yet: 1.1.7 - console-control-strings: 1.1.0 - gauge: 2.7.4 - set-blocking: 2.0.0 - dev: true - /nth-check/2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: boolbase: 1.0.0 dev: true - /number-is-nan/1.0.1: - resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} - engines: {node: '>=0.10.0'} - dev: true - /nwsapi/2.2.1: resolution: {integrity: sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg==} dev: true - /nx/14.4.2_@swc+core@1.2.210: - resolution: {integrity: sha512-bYO//HuwQL4X8y+2BjUPtkPLDiYI1zMejQo6+uJl3+VdYPcsjwW/ca581tBPHiPH95XnHiBartnMrMJtn11grw==} + /nx/14.5.10_@swc+core@1.2.244: + resolution: {integrity: sha512-dqiV+zY32k98mfKFTgiQyYd9HYZmB1zoJj6gYniEuqzs6CKp8ZSpeRDaVQRxR6wEMvW9MSTA9kBg8sJ78W/NZg==} hasBin: true requiresBuild: true peerDependencies: @@ -14178,10 +14286,10 @@ packages: '@swc/core': optional: true dependencies: - '@nrwl/cli': 14.4.2 - '@nrwl/tao': 14.4.2_@swc+core@1.2.210 + '@nrwl/cli': 14.5.10 + '@nrwl/tao': 14.5.10_@swc+core@1.2.244 '@parcel/watcher': 2.0.4 - '@swc/core': 1.2.210 + '@swc/core': 1.2.244 chalk: 4.1.0 chokidar: 3.5.3 cli-cursor: 3.1.0 @@ -14833,7 +14941,7 @@ packages: resolve: 1.22.1 dev: true - /postcss-load-config/3.1.4_i7duc3lt6p42geuj2nwruihc6u: + /postcss-load-config/3.1.4_pe6iykxod2v7i2uk6okjazxzki: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} peerDependencies: @@ -14847,7 +14955,7 @@ packages: dependencies: lilconfig: 2.0.5 postcss: 8.4.14 - ts-node: 10.8.2_y42jqzo3jkzuv3kp7opavo2xbi + ts-node: 10.9.1_hixnfb2jfw56u6pahjg3ndp4oy yaml: 1.10.2 dev: true @@ -14865,7 +14973,7 @@ packages: klona: 2.0.5 postcss: 8.4.14 semver: 7.3.7 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /postcss-merge-longhand/5.1.6_postcss@8.4.14: @@ -15220,19 +15328,10 @@ packages: react-is: 18.2.0 dev: true - /pretty-hrtime/1.0.3: - resolution: {integrity: sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==} - engines: {node: '>= 0.8'} - dev: true - /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /promise-polyfill/8.1.3: - resolution: {integrity: sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==} - dev: true - /promise.series/0.2.0: resolution: {integrity: sha512-VWQJyU2bcDTgZw8kpfBpB/ejZASlCrzwz5f2hjb/zlujOEB4oeiAhHygAWq8ubsX2GVkD4kCU5V2dwOTaCY5EQ==} engines: {node: '>=0.12'} @@ -15403,20 +15502,20 @@ packages: dependencies: loader-utils: 2.0.2 schema-utils: 3.1.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true - /react-date-range/1.4.0_date-fns@2.28.0: + /react-date-range/1.4.0_date-fns@2.29.2: resolution: {integrity: sha512-+9t0HyClbCqw1IhYbpWecjsiaftCeRN5cdhsi9v06YdimwyMR2yYHWcgVn3URwtN/txhqKpEZB6UX1fHpvK76w==} peerDependencies: date-fns: 2.0.0-alpha.7 || >=2.0.0 - react: ^0.14 || ^15.0.0-rc || >=15.0 + react: ^0.14 || ^15.0.0-rc || >=15.0 || 18 peerDependenciesMeta: react: optional: true dependencies: classnames: 2.3.1 - date-fns: 2.28.0 + date-fns: 2.29.2 prop-types: 15.8.1 react-list: 0.8.17 shallow-equal: 1.2.1 @@ -15425,7 +15524,7 @@ packages: /react-dom/18.2.0_react@18.2.0: resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: - react: ^18.2.0 + react: ^18.2.0 || 18 peerDependenciesMeta: react: optional: true @@ -15437,8 +15536,8 @@ packages: /react-draggable/4.4.5: resolution: {integrity: sha512-OMHzJdyJbYTZo4uQE393fHcqqPYsEtkjfMgvCHr6rejT+Ezn4OZbNyGH50vv+SunC1RMvwOTSWkEODQLzw1M9g==} peerDependencies: - react: '>= 16.3.0' - react-dom: '>= 16.3.0' + react: '>= 16.3.0 || 18' + react-dom: '>= 16.3.0 || 18' peerDependenciesMeta: react: optional: true @@ -15453,7 +15552,7 @@ packages: resolution: {integrity: sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==} engines: {node: '>=10', npm: '>=6'} peerDependencies: - react: '>=16.13.1' + react: '>=16.13.1 || 18' peerDependenciesMeta: react: optional: true @@ -15465,7 +15564,7 @@ packages: resolution: {integrity: sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==} engines: {node: '>=10', npm: '>=6'} peerDependencies: - react: '>=16.13.1' + react: '>=16.13.1 || 18' peerDependenciesMeta: react: optional: true @@ -15477,8 +15576,8 @@ packages: /react-hotkeys-hook/3.4.6: resolution: {integrity: sha512-SiGKHnauaAQglRA7qeiW5LTa0KoT2ssv8YGYKZQoM3P9v5JFEHJdXOSFml1N6K86oKQ8dLCLlxqBqGlSJWGmxQ==} peerDependencies: - react: '>=16.8.1' - react-dom: '>=16.8.1' + react: '>=16.8.1 || 18' + react-dom: '>=16.8.1 || 18' peerDependenciesMeta: react: optional: true @@ -15492,7 +15591,7 @@ packages: resolution: {integrity: sha512-gK/AylAQC5DvCD5YLNCHW4PNzpCfrWIyVAXbSMl+/5QXzlDP8VdBoqE2s2niGHB+zIXwBV9hRXbDrVuupbgHcg==} peerDependencies: i18next: '>= 19.0.0' - react: '>= 16.8.0' + react: '>= 16.8.0 || 18' react-dom: '*' react-native: '*' peerDependenciesMeta: @@ -15520,7 +15619,7 @@ packages: /react-list/0.8.17: resolution: {integrity: sha512-pgmzGi0G5uGrdHzMhgO7KR1wx5ZXVvI3SsJUmkblSAKtewIhMwbQiMuQiTE83ozo04BQJbe0r3WIWzSO0dR1xg==} peerDependencies: - react: 0.14 || 15 - 18 + react: 0.14 || 15 - 18 || 18 peerDependenciesMeta: react: optional: true @@ -15536,7 +15635,7 @@ packages: /react-resizable/3.0.4: resolution: {integrity: sha512-StnwmiESiamNzdRHbSSvA65b0ZQJ7eVQpPusrSmcpyGKzC0gojhtO62xxH6YOBmepk9dQTBi9yxidL3W4s3EBA==} peerDependencies: - react: '>= 16.3' + react: '>= 16.3 || 18' peerDependenciesMeta: react: optional: true @@ -15550,8 +15649,8 @@ packages: /react-router-dom/6.3.0_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==} peerDependencies: - react: '>=16.8' - react-dom: '>=16.8' + react: '>=16.8 || 18' + react-dom: '>=16.8 || 18' peerDependenciesMeta: react: optional: true @@ -15567,7 +15666,7 @@ packages: /react-router/6.3.0_react@18.2.0: resolution: {integrity: sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==} peerDependencies: - react: '>=16.8' + react: '>=16.8 || 18' peerDependenciesMeta: react: optional: true @@ -15579,7 +15678,7 @@ packages: /react-shallow-renderer/16.15.0_react@18.2.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: - react: ^16.0.0 || ^17.0.0 || ^18.0.0 + react: ^16.0.0 || ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -15592,7 +15691,7 @@ packages: /react-test-renderer/18.2.0_react@18.2.0: resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: - react: ^18.2.0 + react: ^18.2.0 || 18 peerDependenciesMeta: react: optional: true @@ -15606,8 +15705,8 @@ packages: /react-transition-group/4.4.2: resolution: {integrity: sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==} peerDependencies: - react: '>=16.6.0' - react-dom: '>=16.6.0' + react: '>=16.6.0 || 18' + react-dom: '>=16.6.0 || 18' peerDependenciesMeta: react: optional: true @@ -15623,8 +15722,8 @@ packages: /react-transition-group/4.4.2_biqbaboplfbrettd7655fr4n2y: resolution: {integrity: sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==} peerDependencies: - react: '>=16.6.0' - react-dom: '>=16.6.0' + react: '>=16.6.0 || 18' + react-dom: '>=16.6.0 || 18' peerDependenciesMeta: react: optional: true @@ -15643,8 +15742,8 @@ packages: resolution: {integrity: sha512-JHEZbPXBpKMmoNO1bNhoXOOLg/ujhL/BU4IqVU9r8eQPcy5KQnGHIHDRkJ0ns9IM5+Aq5LNwt3j8t3tIrePQzA==} engines: {node: '>8.0.0'} peerDependencies: - react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 - react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || 18 + react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || 18 peerDependenciesMeta: react: optional: true @@ -15919,7 +16018,7 @@ packages: /rifm/0.12.1: resolution: {integrity: sha512-OGA1Bitg/dSJtI/c4dh90svzaUPt228kzFsUkJbtA2c964IqEAwWXeL9ZJi86xWv3j5SMqRvGULl7bA6cK0Bvg==} peerDependencies: - react: '>=16.8' + react: '>=16.8 || 18' peerDependenciesMeta: react: optional: true @@ -15961,7 +16060,7 @@ packages: rollup: 2.75.7 dev: true - /rollup-plugin-postcss/4.0.2_i7duc3lt6p42geuj2nwruihc6u: + /rollup-plugin-postcss/4.0.2_pe6iykxod2v7i2uk6okjazxzki: resolution: {integrity: sha512-05EaY6zvZdmvPUDi3uCcAQoESDcYnv8ogJJQRp6V5kZ6J6P7uAVJlrTZcaaA20wTH527YTnKfkAoPxWI/jPp4w==} engines: {node: '>=10'} peerDependencies: @@ -15974,7 +16073,7 @@ packages: p-queue: 6.6.2 pify: 5.0.0 postcss: 8.4.14 - postcss-load-config: 3.1.4_i7duc3lt6p42geuj2nwruihc6u + postcss-load-config: 3.1.4_pe6iykxod2v7i2uk6okjazxzki postcss-modules: 4.3.1_postcss@8.4.14 promise.series: 0.2.0 resolve: 1.22.1 @@ -16034,17 +16133,6 @@ packages: queue-microtask: 1.2.3 dev: true - /rxjs-for-await/0.0.2_rxjs@6.6.7: - resolution: {integrity: sha512-IJ8R/ZCFMHOcDIqoABs82jal00VrZx8Xkgfe7TOKoaRPAW5nH/VFlG23bXpeGdrmtqI9UobFPgUKgCuFc7Lncw==} - peerDependencies: - rxjs: ^6.0.0 - peerDependenciesMeta: - rxjs: - optional: true - dependencies: - rxjs: 6.6.7 - dev: true - /rxjs/6.6.7: resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==} engines: {npm: '>=2.0.0'} @@ -16056,6 +16144,12 @@ packages: resolution: {integrity: sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==} dependencies: tslib: 2.4.0 + dev: true + + /rxjs/7.5.6: + resolution: {integrity: sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw==} + dependencies: + tslib: 2.4.0 /safari-14-idb-fix/3.0.0: resolution: {integrity: sha512-eBNFLob4PMq8JA1dGyFn6G97q3/WzNtFK4RnzT1fnLq+9RyrGknzYiM/9B12MnKAxuj1IXr7UKYtTNtjyKMBog==} @@ -16099,7 +16193,7 @@ packages: klona: 2.0.5 neo-async: 2.6.2 sass: 1.53.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /sass/1.53.0: @@ -16131,15 +16225,6 @@ packages: dependencies: loose-envify: 1.4.0 - /schema-utils/2.7.0: - resolution: {integrity: sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==} - engines: {node: '>= 8.9.0'} - dependencies: - '@types/json-schema': 7.0.11 - ajv: 6.12.6 - ajv-keywords: 3.5.2_ajv@6.12.6 - dev: true - /schema-utils/2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} engines: {node: '>= 8.9.0'} @@ -16163,7 +16248,7 @@ packages: dependencies: '@types/json-schema': 7.0.11 ajv: 8.11.0 - ajv-formats: 2.1.1_ajv@8.11.0 + ajv-formats: 2.1.1 ajv-keywords: 5.1.0_ajv@8.11.0 dev: true @@ -16174,7 +16259,7 @@ packages: dev: false /secure-compare/3.0.1: - resolution: {integrity: sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=} + resolution: {integrity: sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==} dev: true /seek-bzip/1.0.6: @@ -16194,7 +16279,7 @@ packages: dependencies: jszip: 3.10.0 tmp: 0.2.1 - ws: 8.8.0 + ws: 8.8.1 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -16309,10 +16394,6 @@ packages: - supports-color dev: true - /set-blocking/2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - dev: true - /setimmediate/1.0.5: resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} dev: true @@ -16407,8 +16488,8 @@ packages: /slate-react/0.81.0_slate@0.81.1: resolution: {integrity: sha512-bwryad4EvOmc7EFKb8aGg9DWNDh3KvToaggGieIgGTTbHJYHc9ADFC3A87Ittlpd5XUVopR0MpChQ3g3ODyvqw==} peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' + react: '>=16.8.0 || 18' + react-dom: '>=16.8.0 || 18' slate: '>=0.65.3' peerDependenciesMeta: react: @@ -16528,7 +16609,7 @@ packages: abab: 2.0.6 iconv-lite: 0.6.3 source-map-js: 1.0.2 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /source-map-resolve/0.6.0: @@ -16704,15 +16785,6 @@ packages: schema-utils: 3.1.1 dev: false - /string-width/1.0.2: - resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} - engines: {node: '>=0.10.0'} - dependencies: - code-point-at: 1.1.0 - is-fullwidth-code-point: 1.0.0 - strip-ansi: 3.0.1 - dev: true - /string-width/2.1.1: resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} engines: {node: '>=4'} @@ -16776,13 +16848,6 @@ packages: dependencies: safe-buffer: 5.2.1 - /strip-ansi/3.0.1: - resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} - engines: {node: '>=0.10.0'} - dependencies: - ansi-regex: 2.1.1 - dev: true - /strip-ansi/4.0.0: resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} engines: {node: '>=4'} @@ -16879,7 +16944,7 @@ packages: webpack: optional: true dependencies: - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /style-mod/3.2.2: @@ -16890,8 +16955,8 @@ packages: resolution: {integrity: sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==} dev: false - /style9/0.13.3: - resolution: {integrity: sha512-mQ39P2a4o5vHzy80vdpG4JfolQkBNxjvIvQen2JkM4/EdF4KEl0vOBCobD4Dd43aW2HoOzFuEVYHmsdmJoMs2g==} + /style9/0.14.0: + resolution: {integrity: sha512-zcKdz1GGM7kq8clEfAQ/2TV52d1hj+BgWPPGjqkjtUhP/i3qJq+nA4UJSgO67T7UQPax56tmOQs4y1AZrv9FTw==} engines: {node: '>=12'} dependencies: '@babel/core': 7.18.6 @@ -16917,8 +16982,8 @@ packages: - webpack dev: false - /style9/0.13.3_3dhnqjc63a233tfpt3a625zcdq: - resolution: {integrity: sha512-mQ39P2a4o5vHzy80vdpG4JfolQkBNxjvIvQen2JkM4/EdF4KEl0vOBCobD4Dd43aW2HoOzFuEVYHmsdmJoMs2g==} + /style9/0.14.0_3dhnqjc63a233tfpt3a625zcdq: + resolution: {integrity: sha512-zcKdz1GGM7kq8clEfAQ/2TV52d1hj+BgWPPGjqkjtUhP/i3qJq+nA4UJSgO67T7UQPax56tmOQs4y1AZrv9FTw==} engines: {node: '>=12'} dependencies: '@babel/core': 7.18.6 @@ -16973,7 +17038,7 @@ packages: klona: 2.0.5 normalize-path: 3.0.0 stylus: 0.55.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /stylus/0.55.0: @@ -16987,7 +17052,7 @@ packages: safer-buffer: 2.1.2 sax: 1.2.4 semver: 6.3.0 - source-map: 0.7.3 + source-map: 0.7.4 transitivePeerDependencies: - supports-color dev: true @@ -17045,11 +17110,6 @@ packages: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true - /tapable/1.1.3: - resolution: {integrity: sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==} - engines: {node: '>=6'} - dev: true - /tapable/2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -17134,7 +17194,7 @@ packages: supports-hyperlinks: 2.2.0 dev: true - /terser-webpack-plugin/5.3.3_vwzmvoh3samqo2nn3x7mqt365m: + /terser-webpack-plugin/5.3.3_5yvlrjpud4kvfyyr2mesgpo47e: resolution: {integrity: sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ==} engines: {node: '>= 10.13.0'} peerDependencies: @@ -17153,12 +17213,12 @@ packages: optional: true dependencies: '@jridgewell/trace-mapping': 0.3.14 - '@swc/core': 1.2.210 + '@swc/core': 1.2.244 jest-worker: 27.5.1 schema-utils: 3.1.1 serialize-javascript: 6.0.0 terser: 5.14.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 /terser-webpack-plugin/5.3.3_webpack@5.74.0: resolution: {integrity: sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ==} @@ -17366,7 +17426,7 @@ packages: babel-jest: 28.1.2_@babel+core@7.18.6 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 28.1.2_hxaxlvfys2pc3hefxwkmyo5cpq + jest: 28.1.2_3glepa5322b7j342guju4hszoy jest-util: 28.1.1 json5: 2.2.1 lodash.memoize: 4.1.2 @@ -17386,15 +17446,15 @@ packages: webpack: optional: true dependencies: - chalk: 4.1.0 + chalk: 4.1.2 enhanced-resolve: 5.10.0 micromatch: 4.0.5 semver: 7.3.7 typescript: 4.7.4 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true - /ts-node/10.8.2_y42jqzo3jkzuv3kp7opavo2xbi: + /ts-node/10.8.2_hixnfb2jfw56u6pahjg3ndp4oy: resolution: {integrity: sha512-LYdGnoGddf1D6v8REPtIH+5iq/gTDuZqv2/UJUU7tKjuEU8xVZorBM+buCGNjj+pGEud+sOoM4CX3/YzINpENA==} hasBin: true peerDependencies: @@ -17409,12 +17469,44 @@ packages: optional: true dependencies: '@cspotcode/source-map-support': 0.8.1 - '@swc/core': 1.2.210 + '@swc/core': 1.2.244 '@tsconfig/node10': 1.0.9 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.0.1 + '@types/node': 18.7.13 + acorn: 8.7.1 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.7.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /ts-node/10.9.1_hixnfb2jfw56u6pahjg3ndp4oy: + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@swc/core': 1.2.244 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 18.7.13 acorn: 8.7.1 acorn-walk: 8.2.0 arg: 4.1.3 @@ -17597,7 +17689,7 @@ packages: /upath2/3.1.13: resolution: {integrity: sha512-M88uBoqgzrkXvXrF/+oSIPsTmL21uRwGhPVJKODrl+3lXkQ5NPKrTYuSBZVa+lgPGFoI6qYyHlSKACFHO0AoNw==} dependencies: - '@types/node': 18.0.1 + '@types/node': 18.7.13 path-is-network-drive: 1.0.15 path-strip-sep: 1.0.12 tslib: 2.4.0 @@ -17649,7 +17741,7 @@ packages: loader-utils: 2.0.2 mime-types: 2.1.35 schema-utils: 3.1.1 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /url-parse-lax/1.0.0: @@ -17704,7 +17796,7 @@ packages: dev: true /utils-merge/1.0.1: - resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: true @@ -17850,7 +17942,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.0.0 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /webpack-dev-server/4.9.3_webpack@5.74.0: @@ -17893,9 +17985,9 @@ packages: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 webpack-dev-middleware: 5.3.3_webpack@5.74.0 - ws: 8.8.0 + ws: 8.8.1 transitivePeerDependencies: - bufferutil - debug @@ -17949,7 +18041,7 @@ packages: dependencies: html-webpack-plugin: 5.5.0_webpack@5.74.0 typed-assert: 1.0.9 - webpack: 5.74.0_@swc+core@1.2.210 + webpack: 5.74.0_@swc+core@1.2.244 dev: true /webpack-virtual-modules/0.4.4: @@ -17996,7 +18088,7 @@ packages: - uglify-js dev: true - /webpack/5.74.0_@swc+core@1.2.210: + /webpack/5.74.0_@swc+core@1.2.244: resolution: {integrity: sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==} engines: {node: '>=10.13.0'} hasBin: true @@ -18027,7 +18119,7 @@ packages: neo-async: 2.6.2 schema-utils: 3.1.1 tapable: 2.2.1 - terser-webpack-plugin: 5.3.3_vwzmvoh3samqo2nn3x7mqt365m + terser-webpack-plugin: 5.3.3_5yvlrjpud4kvfyyr2mesgpo47e watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -18060,10 +18152,6 @@ packages: iconv-lite: 0.6.3 dev: true - /whatwg-fetch/2.0.4: - resolution: {integrity: sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==} - dev: true - /whatwg-mimetype/2.3.0: resolution: {integrity: sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==} dev: true @@ -18119,12 +18207,6 @@ packages: isexe: 2.0.0 dev: true - /wide-align/1.1.5: - resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} - dependencies: - string-width: 1.0.2 - dev: true - /wildcard/2.0.0: resolution: {integrity: sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==} dev: true @@ -18184,19 +18266,6 @@ packages: optional: true dev: true - /ws/8.8.0: - resolution: {integrity: sha512-JDAgSYQ1ksuwqfChJusw1LSJ8BizJ2e/vVu5Lxjq3YvNJNlROv1ui4i+c/kUUrPheBvQl4c5UbERhTwKa6QBJQ==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: true - /ws/8.8.1: resolution: {integrity: sha512-bGy2JzvzkPowEJV++hF07hAD6niYSr0JzBNo/J29WsB57A2r7Wlc1UFcTR9IzrPvuNVO4B8LGqF8qcpsVOhJCA==} engines: {node: '>=10.0.0'} @@ -18208,7 +18277,6 @@ packages: optional: true utf-8-validate: optional: true - dev: false /xml-name-validator/3.0.0: resolution: {integrity: sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==} @@ -18318,7 +18386,7 @@ packages: resolution: {integrity: sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==} engines: {node: '>=12.7.0'} peerDependencies: - react: '>=16.8' + react: '>=16.8 || 18' peerDependenciesMeta: react: optional: true From 12afd6be681c05112174548996e84f93327d9150 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Fri, 26 Aug 2022 19:50:17 +0800 Subject: [PATCH 55/79] refactor: remove useBlockRender --- .../src/blocks/grid-item/GridItemRender.tsx | 11 ++--------- .../components/editor-blocks/src/blocks/grid/Grid.tsx | 3 +-- .../editor-core/src/render-block/Context.tsx | 9 +++++++-- .../editor-core/src/render-block/RenderBlock.tsx | 5 +++-- .../src/render-block/RenderBlockChildren.tsx | 3 +-- .../src/render-block/WithTreeViewChildren.tsx | 3 +-- libs/components/editor-core/src/render-block/index.ts | 2 +- 7 files changed, 16 insertions(+), 20 deletions(-) diff --git a/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx b/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx index 1dece91699..620a25dba6 100644 --- a/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx +++ b/libs/components/editor-blocks/src/blocks/grid-item/GridItemRender.tsx @@ -1,4 +1,4 @@ -import { useBlockRender } from '@toeverything/components/editor-core'; +import { RenderBlockChildren } from '@toeverything/components/editor-core'; import { ChildrenView, CreateView } from '@toeverything/framework/virgo'; export const GridItemRender = function ( @@ -6,14 +6,7 @@ export const GridItemRender = function ( ) { const GridItem = function (props: CreateView) { const { block } = props; - const { BlockRender } = useBlockRender(); - const children = ( - <> - {block.childrenIds.map(id => { - return ; - })} - - ); + const children = ; return <>{creator({ ...props, children })}; }; return GridItem; diff --git a/libs/components/editor-blocks/src/blocks/grid/Grid.tsx b/libs/components/editor-blocks/src/blocks/grid/Grid.tsx index 4b5bfd49b3..a8e69125d0 100644 --- a/libs/components/editor-blocks/src/blocks/grid/Grid.tsx +++ b/libs/components/editor-blocks/src/blocks/grid/Grid.tsx @@ -1,4 +1,4 @@ -import { useBlockRender } from '@toeverything/components/editor-core'; +import { BlockRender } from '@toeverything/components/editor-core'; import { styled } from '@toeverything/components/ui'; import { Protocol } from '@toeverything/datasource/db-service'; import { CreateView } from '@toeverything/framework/virgo'; @@ -31,7 +31,6 @@ export const Grid = function (props: CreateView) { const originalLeftWidth = useRef(gridItemMinWidth); const originalRightWidth = useRef(gridItemMinWidth); const [alertHandleId, setAlertHandleId] = useState(null); - const { BlockRender } = useBlockRender(); const getLeftRightGridItemDomByIndex = (index: number) => { const gridItems = Array.from(gridContainerRef.current?.children).filter( diff --git a/libs/components/editor-core/src/render-block/Context.tsx b/libs/components/editor-core/src/render-block/Context.tsx index 90c89eec0e..d34f5d6801 100644 --- a/libs/components/editor-core/src/render-block/Context.tsx +++ b/libs/components/editor-core/src/render-block/Context.tsx @@ -3,7 +3,7 @@ import { createContext, PropsWithChildren, useContext } from 'react'; import { RenderBlockProps } from './RenderBlock'; type BlockRenderProps = { - blockRender: (args: RenderBlockProps) => JSX.Element | null; + blockRender: (args: RenderBlockProps) => JSX.Element; }; export const BlockRenderContext = createContext( @@ -27,9 +27,14 @@ export const BlockRenderProvider = ({ ); }; -export const useBlockRender = () => { +const useBlockRender = () => { const { blockRender } = useContext(BlockRenderContext); return { BlockRender: blockRender, }; }; + +export const BlockRender = (props: RenderBlockProps) => { + const { BlockRender } = useBlockRender(); + return ; +}; diff --git a/libs/components/editor-core/src/render-block/RenderBlock.tsx b/libs/components/editor-core/src/render-block/RenderBlock.tsx index c843274166..a7ebc53789 100644 --- a/libs/components/editor-core/src/render-block/RenderBlock.tsx +++ b/libs/components/editor-core/src/render-block/RenderBlock.tsx @@ -7,7 +7,8 @@ import { useBlock } from '../hooks'; /** * Render nothing */ -export const NullBlockRender = (): null => null; +// eslint-disable-next-line react/jsx-no-useless-fragment +export const NullBlockRender = () => <>; export interface RenderBlockProps { blockId: string; @@ -22,7 +23,7 @@ export function RenderBlock({ const { block } = useBlock(blockId); const setRef = useCallback( - (dom: HTMLElement) => { + (dom: HTMLElement | null) => { if (block != null && dom != null) { block.dom = dom; } diff --git a/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx b/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx index d79d0cd002..3ff9892949 100644 --- a/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx +++ b/libs/components/editor-core/src/render-block/RenderBlockChildren.tsx @@ -1,6 +1,6 @@ import { styled } from '@toeverything/components/ui'; import type { AsyncBlock } from '../editor'; -import { useBlockRender } from './Context'; +import { BlockRender } from './Context'; import { NullBlockRender } from './RenderBlock'; export interface RenderChildrenProps { @@ -12,7 +12,6 @@ export const RenderBlockChildren = ({ block, indent = true, }: RenderChildrenProps) => { - const { BlockRender } = useBlockRender(); if (BlockRender === NullBlockRender) { return null; } diff --git a/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx b/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx index 8c3642ef6d..6dccd49ace 100644 --- a/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx +++ b/libs/components/editor-core/src/render-block/WithTreeViewChildren.tsx @@ -7,7 +7,7 @@ import type { } from 'react'; import { forwardRef } from 'react'; import { CreateView } from '../editor'; -import { useBlockRender } from './Context'; +import { BlockRender } from './Context'; import { NullBlockRender } from './RenderBlock'; type WithChildrenConfig = { @@ -60,7 +60,6 @@ export const withTreeViewChildren = ( return (props: CreateView) => { const { block } = props; - const { BlockRender } = useBlockRender(); const collapsed = block.getProperty('collapsed')?.value; const childrenIds = block.childrenIds; const showChildren = diff --git a/libs/components/editor-core/src/render-block/index.ts b/libs/components/editor-core/src/render-block/index.ts index 5d3c6d122e..bc071cf5a2 100644 --- a/libs/components/editor-core/src/render-block/index.ts +++ b/libs/components/editor-core/src/render-block/index.ts @@ -1,4 +1,4 @@ -export { BlockRenderProvider, useBlockRender } from './Context'; +export { BlockRender, BlockRenderProvider } from './Context'; export { NullBlockRender, RenderBlock } from './RenderBlock'; export { RenderBlockChildren } from './RenderBlockChildren'; export { KanbanBlockRender } from './RenderKanbanBlock'; From 374d9d94efb4d39374d1221679c28d7655f9f389 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Fri, 26 Aug 2022 19:51:33 +0800 Subject: [PATCH 56/79] chore: clean styles --- .../src/blocks/group/GroupView.tsx | 21 +++++++------------ .../blocks/group/group-menu/AddViewMenu.tsx | 2 +- .../src/blocks/group/group-menu/ViewsMenu.tsx | 4 ++-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/libs/components/editor-blocks/src/blocks/group/GroupView.tsx b/libs/components/editor-blocks/src/blocks/group/GroupView.tsx index 791059e36c..f0d6e56cc5 100644 --- a/libs/components/editor-blocks/src/blocks/group/GroupView.tsx +++ b/libs/components/editor-blocks/src/blocks/group/GroupView.tsx @@ -21,19 +21,6 @@ const SceneMap: Record> = { kanban: SceneKanban, } as const; -const GroupBox = styled('div')(({ theme }) => { - return { - '&:hover': { - // Workaround referring to other components - // See https://emotion.sh/docs/styled#targeting-another-emotion-component - // [GroupActionWrapper.toString()]: {}, - '& > *': { - visibility: 'visible', - }, - }, - }; -}); - const GroupActionWrapper = styled('div')(({ theme }) => ({ height: '30px', display: 'flex', @@ -59,6 +46,14 @@ const GroupActionWrapper = styled('div')(({ theme }) => ({ }, })); +const GroupBox = styled('div')({ + '&:hover': { + [GroupActionWrapper.toString()]: { + visibility: 'visible', + }, + }, +}); + const GroupContainer = styled('div')<{ isSelect?: boolean }>( ({ isSelect, theme }) => ({ background: theme.affine.palette.white, diff --git a/libs/components/editor-blocks/src/blocks/group/group-menu/AddViewMenu.tsx b/libs/components/editor-blocks/src/blocks/group/group-menu/AddViewMenu.tsx index a376785b52..cffa0a0dd0 100644 --- a/libs/components/editor-blocks/src/blocks/group/group-menu/AddViewMenu.tsx +++ b/libs/components/editor-blocks/src/blocks/group/group-menu/AddViewMenu.tsx @@ -41,7 +41,7 @@ export const AddViewMenu = () => { onClick={() => setActivePanel(!activePanel)} > - Add View + Add View {activePanel && ( diff --git a/libs/components/editor-blocks/src/blocks/group/group-menu/ViewsMenu.tsx b/libs/components/editor-blocks/src/blocks/group/group-menu/ViewsMenu.tsx index 1fee99465e..9e6a70df24 100644 --- a/libs/components/editor-blocks/src/blocks/group/group-menu/ViewsMenu.tsx +++ b/libs/components/editor-blocks/src/blocks/group/group-menu/ViewsMenu.tsx @@ -20,7 +20,7 @@ export const ViewsMenu = () => { useRecastView(); const handleChange = (e: ChangeEvent) => { - setViewName(e.target.value.trim()); + setViewName(e.target.value); }; const handleKeyDown = (event: KeyboardEvent) => { @@ -36,7 +36,7 @@ export const ViewsMenu = () => { } await updateView({ ...activeView, - name: viewName, + name: viewName.trim(), type: viewType, }); setActiveView(null); From 8df4ac7f14ad3a353bf309f284a4470cc6a5c345 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Fri, 26 Aug 2022 21:20:55 +0800 Subject: [PATCH 57/79] feat(scss): remove last scss file --- .../src/components/table/basic-table.scss | 6 ------ .../editor-blocks/src/components/table/basic-table.tsx | 10 +++++----- 2 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 libs/components/editor-blocks/src/components/table/basic-table.scss diff --git a/libs/components/editor-blocks/src/components/table/basic-table.scss b/libs/components/editor-blocks/src/components/table/basic-table.scss deleted file mode 100644 index d5546784fc..0000000000 --- a/libs/components/editor-blocks/src/components/table/basic-table.scss +++ /dev/null @@ -1,6 +0,0 @@ -.v-basic-table-body { - overflow: hidden !important; - &:hover { - overflow: auto !important; - } -} diff --git a/libs/components/editor-blocks/src/components/table/basic-table.tsx b/libs/components/editor-blocks/src/components/table/basic-table.tsx index 04507ddebd..01f6a154ef 100644 --- a/libs/components/editor-blocks/src/components/table/basic-table.tsx +++ b/libs/components/editor-blocks/src/components/table/basic-table.tsx @@ -1,19 +1,19 @@ import { - useMemo, memo, + useCallback, + useLayoutEffect, + useMemo, useRef, useState, - useLayoutEffect, - useCallback, } from 'react'; -import { VariableSizeGrid, areEqual } from 'react-window'; import type { GridChildComponentProps, GridItemKeySelector, } from 'react-window'; +import { VariableSizeGrid } from 'react-window'; import style9 from 'style9'; -import './basic-table.scss'; + export interface TableColumn { dataKey: string; label: string; From aac9eee6e29c4c6e19a5d496eb438e332419c9a4 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Fri, 26 Aug 2022 21:53:45 +0800 Subject: [PATCH 58/79] feat(toc): add scroll active item --- .../src/pages/workspace/docs/components/toc/TOC.tsx | 7 ++++++- .../src/pages/workspace/docs/components/toc/toc.css | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index 6e416a8b6b..877a17d480 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -16,8 +16,8 @@ import { getContentByAsyncBlocks, getPageTOC, } from './toc-util'; +import './toc.css'; import type { ListenerMap, TOCType } from './types'; - const StyledTOCItem = styled('a')<{ type?: string; isActive?: boolean }>( ({ type, isActive }) => { const common = { @@ -168,6 +168,11 @@ export const TOC = () => { const onClick = async (blockId?: string) => { setActiveBlockId(blockId); + const block = await editor.getBlockById(blockId); + block.dom.classList.add('toc-scroll-item'); + setTimeout(() => { + block.dom.classList.remove('toc-scroll-item'); + }, 1000); await editor.scrollManager.scrollIntoViewByBlockId(blockId); }; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css new file mode 100644 index 0000000000..44364012dc --- /dev/null +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css @@ -0,0 +1,13 @@ +.toc-scroll-item { + animation: blinker 1s linear; + animation-delay: 1s; +} + +@keyframes blinker { + 0% { + background: rgba(152, 172, 189, 0.1); + } + 100% { + background: rgba(152, 172, 189, 0.1); + } +} From 6b6e70f02c0447bc625ae626f2bc2f48688b04c2 Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Mon, 29 Aug 2022 11:26:01 +0800 Subject: [PATCH 59/79] fix: can not copy text other than block --- .../src/editor/clipboard/clipboardEventDispatcher.ts | 12 ++++++------ .../src/editor/clipboard/clipboardUtils.ts | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts index a4f0c76044..675b1d603f 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboardEventDispatcher.ts @@ -72,21 +72,21 @@ export class ClipboardEventDispatcher { ); } - private _copyHandler(e: ClipboardEvent) { - if (!this._utils.shouldHandlerContinue(e)) { + private async _copyHandler(e: ClipboardEvent) { + if (!(await this._utils.shouldHandlerContinue(e))) { return; } this._editor.getHooks().onCopy(e); } - private _cutHandler(e: ClipboardEvent) { - if (!this._utils.shouldHandlerContinue(e)) { + private async _cutHandler(e: ClipboardEvent) { + if (!(await this._utils.shouldHandlerContinue(e))) { return; } this._editor.getHooks().onCut(e); } - private _pasteHandler(e: ClipboardEvent) { - if (!this._utils.shouldHandlerContinue(e)) { + private async _pasteHandler(e: ClipboardEvent) { + if (!(await this._utils.shouldHandlerContinue(e))) { return; } diff --git a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts index 09c532273c..2b93912d67 100644 --- a/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts +++ b/libs/components/editor-core/src/editor/clipboard/clipboardUtils.ts @@ -11,7 +11,7 @@ export class ClipboardUtils { this._editor = editor; } - shouldHandlerContinue(event: ClipboardEvent) { + async shouldHandlerContinue(event: ClipboardEvent) { const filterNodes = ['INPUT', 'SELECT', 'TEXTAREA']; if (event.defaultPrevented) { @@ -20,8 +20,12 @@ export class ClipboardUtils { if (filterNodes.includes((event.target as HTMLElement)?.tagName)) { return false; } + const selectInfo = await this._editor.selectionManager.getSelectInfo(); - return this._editor.selectionManager.currentSelectInfo.type !== 'None'; + return ( + selectInfo.blocks.length && + this._editor.selectionManager.currentSelectInfo.type !== 'None' + ); } async getClipInfoOfBlockById(blockId: string) { From c0a41074497e2282113054e50e27e42ba05c0ea6 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Mon, 29 Aug 2022 12:02:32 +0800 Subject: [PATCH 60/79] feat(toc): add animation to toc item --- .../workspace/docs/components/toc/TOC.tsx | 20 ++++++++++++++++--- .../workspace/docs/components/toc/toc.css | 13 ------------ 2 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index 877a17d480..3e9eb11d4a 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -1,3 +1,4 @@ +import { keyframes } from '@emotion/react'; import type { Virgo } from '@toeverything/components/editor-core'; import { styled } from '@toeverything/components/ui'; import { useCurrentEditors } from '@toeverything/datasource/state'; @@ -16,8 +17,21 @@ import { getContentByAsyncBlocks, getPageTOC, } from './toc-util'; -import './toc.css'; import type { ListenerMap, TOCType } from './types'; +// import './toc.css'; +const blinker = keyframes` +0% { + background: rgba(152, 172, 189, 0.1); +} +100% { + background: rgba(152, 172, 189, 0.1); +} +`; +const toScrollItem = styled('div')` + animation: ${blinker} 1s linear; + animation-delay: 1s; +`; +const toScrollItemClassName = toScrollItem.toString().substring(1); const StyledTOCItem = styled('a')<{ type?: string; isActive?: boolean }>( ({ type, isActive }) => { const common = { @@ -169,9 +183,9 @@ export const TOC = () => { const onClick = async (blockId?: string) => { setActiveBlockId(blockId); const block = await editor.getBlockById(blockId); - block.dom.classList.add('toc-scroll-item'); + block.dom.classList.add(toScrollItemClassName); setTimeout(() => { - block.dom.classList.remove('toc-scroll-item'); + block.dom.classList.remove(toScrollItemClassName); }, 1000); await editor.scrollManager.scrollIntoViewByBlockId(blockId); }; diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css deleted file mode 100644 index 44364012dc..0000000000 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/toc.css +++ /dev/null @@ -1,13 +0,0 @@ -.toc-scroll-item { - animation: blinker 1s linear; - animation-delay: 1s; -} - -@keyframes blinker { - 0% { - background: rgba(152, 172, 189, 0.1); - } - 100% { - background: rgba(152, 172, 189, 0.1); - } -} From fd4f99bd83a1c70846a88f67fd147419eeeb609b Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Mon, 29 Aug 2022 13:30:56 +0800 Subject: [PATCH 61/79] refactor: use web animate api --- .../workspace/docs/components/toc/TOC.tsx | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx index 3e9eb11d4a..0a5c442590 100644 --- a/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx +++ b/apps/ligo-virgo/src/pages/workspace/docs/components/toc/TOC.tsx @@ -1,6 +1,6 @@ -import { keyframes } from '@emotion/react'; import type { Virgo } from '@toeverything/components/editor-core'; import { styled } from '@toeverything/components/ui'; +import { Protocol } from '@toeverything/datasource/db-service'; import { useCurrentEditors } from '@toeverything/datasource/state'; import { createContext, @@ -18,20 +18,7 @@ import { getPageTOC, } from './toc-util'; import type { ListenerMap, TOCType } from './types'; -// import './toc.css'; -const blinker = keyframes` -0% { - background: rgba(152, 172, 189, 0.1); -} -100% { - background: rgba(152, 172, 189, 0.1); -} -`; -const toScrollItem = styled('div')` - animation: ${blinker} 1s linear; - animation-delay: 1s; -`; -const toScrollItemClassName = toScrollItem.toString().substring(1); + const StyledTOCItem = styled('a')<{ type?: string; isActive?: boolean }>( ({ type, isActive }) => { const common = { @@ -183,11 +170,28 @@ export const TOC = () => { const onClick = async (blockId?: string) => { setActiveBlockId(blockId); const block = await editor.getBlockById(blockId); - block.dom.classList.add(toScrollItemClassName); - setTimeout(() => { - block.dom.classList.remove(toScrollItemClassName); - }, 1000); await editor.scrollManager.scrollIntoViewByBlockId(blockId); + + if (!block || block.type === Protocol.Block.Type.group) { + // the group block has its own background + return; + } + // See https://developer.mozilla.org/en-US/docs/Web/API/Element/animate + block.dom?.animate( + [ + { + backgroundColor: 'rgba(152, 172, 189, 0.1)', + }, + { + backgroundColor: 'rgba(152, 172, 189, 0)', + }, + ], + { + delay: 500, + duration: 700, + easing: 'linear', + } + ); }; return ( From bd9796bd256046c66b762913b91be7afd29c6937 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Mon, 29 Aug 2022 15:52:07 +0800 Subject: [PATCH 62/79] update i18n for venus --- apps/venus/src/app/App.tsx | 4 ++-- apps/venus/src/app/i18n/resources/en.json | 2 ++ apps/venus/src/app/i18n/resources/zh.json | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/venus/src/app/App.tsx b/apps/venus/src/app/App.tsx index 8f791b7ec3..af2ac5cc6f 100644 --- a/apps/venus/src/app/App.tsx +++ b/apps/venus/src/app/App.tsx @@ -259,7 +259,7 @@ export function App() { }} size="lg" > - Blog + {t('Blog')} + +// const { t, i18n } = useTranslation(); +// const changeLanguage = (event: any) => { +// i18n.changeLanguage(event); +// }; diff --git a/libs/components/layout/src/i18n/resources/en.json b/libs/components/layout/src/i18n/resources/en.json new file mode 100644 index 0000000000..d12f3bc040 --- /dev/null +++ b/libs/components/layout/src/i18n/resources/en.json @@ -0,0 +1,30 @@ +{ + "translation": { + "Paper": "Paper", + "Edgeless": "Edgeless", + "Sync to Disk": "Sync to Disk", + "Share": "Share", + "warningTips": { + "isNotfsApiSupported": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge", + "isNotLocalWorkspace": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.", + "DoNotStore": "AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data" + }, + "stetting": { + "Layout": { + "title": "Layout" + }, + "Comment": { + "title": "Comment" + }, + "Settings": { + "title": "Settings", + "Duplicate Page": "Duplicate Page", + "Copy Page Link": "Copy Page Link", + "Language": "Language", + "Clear Workspace": "Clear Workspace", + "Last edited by": "Last edited by ", + "Logout": "Logout" + } + } + } +} diff --git a/libs/components/layout/src/i18n/resources/zh.json b/libs/components/layout/src/i18n/resources/zh.json new file mode 100644 index 0000000000..90847e4610 --- /dev/null +++ b/libs/components/layout/src/i18n/resources/zh.json @@ -0,0 +1,30 @@ +{ + "translation": { + "Paper": "页面", + "Edgeless": "无边缘", + "Sync to Disk": "同步到磁盘", + "Share": "分享", + "warningTips": { + "isNotfsApiSupported": "欢迎来到AFFiNE 的演示界面。您可以使用最新版本的基于Chrome的浏览器(如Chrome/Edge)将数据同步到磁盘来进行保存", + "isNotLocalWorkspace": "欢迎来到AFFiNE 的演示界面,您可以同步到磁盘来进行保存操作。", + "DoNotStore": "AFFINE 正在积极开发中,当前版本不稳定。请不要存储信息或数据。" + }, + "stetting": { + "Layout": { + "title": "布局" + }, + "Comment": { + "title": "评论" + }, + "Settings": { + "title": "设置", + "Duplicate Page": "复制页面", + "Copy Page Link": "拷贝页面链接", + "Language": "当前语言", + "Clear Workspace": "清空工作区域", + "Last edited by": "最后编辑者为 ", + "Logout": "登出" + } + } + } +} diff --git a/libs/components/layout/src/index.ts b/libs/components/layout/src/index.ts index 69a6d3ff72..1aee5a687f 100644 --- a/libs/components/layout/src/index.ts +++ b/libs/components/layout/src/index.ts @@ -1,3 +1,4 @@ export * from './header'; +export * from './i18n'; export * from './settings-sidebar'; export * from './workspace-sidebar'; diff --git a/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx b/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx index dc5320c19d..9019063f30 100644 --- a/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx +++ b/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx @@ -5,6 +5,7 @@ import { } from '@toeverything/components/icons'; import { styled } from '@toeverything/components/ui'; import { cloneElement, useCallback, useMemo, type ReactElement } from 'react'; +import { useTranslation } from 'react-i18next'; import { Comments } from '../Comments'; import { useActiveComment } from '../Comments/use-comments'; import { LayoutSettings } from '../Layout'; @@ -67,7 +68,7 @@ export const ContainerTabs = () => { _defaultTabsKeys as unknown as string[], 'settings' ); - + const { t } = useTranslation(); return ( <> @@ -75,7 +76,7 @@ export const ContainerTabs = () => { const { type, text, icon } = tab; return ( { diff --git a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx index 57e4a2fbf0..a0d93aae23 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx @@ -1,8 +1,21 @@ -import { Divider, ListItem, styled, Switch } from '@toeverything/components/ui'; +import { + Divider, + ListItem, + Option, + Select, + styled, + Switch, +} from '@toeverything/components/ui'; +import { useTranslation } from 'react-i18next'; +import { options } from '../../i18n'; import { useSettings } from './use-settings'; export const SettingsList = () => { const settings = useSettings(); + const { t, i18n } = useTranslation(); + const changeLanguage = (event: any) => { + i18n.changeLanguage(event); + }; return ( @@ -32,7 +45,24 @@ export const SettingsList = () => { return ( item.onClick()}> - {item.name} + {t(`stetting.Settings.${item.name}`)} + {item.name === 'Language' ? ( +
+ +
+ ) : null}
); })} diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx index 1bcf8a83be..2d37a73717 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx @@ -1,6 +1,7 @@ import { styled, Typography } from '@toeverything/components/ui'; import { useUserAndSpaces } from '@toeverything/datasource/state'; import format from 'date-fns/format'; +import { useTranslation } from 'react-i18next'; import { usePageLastUpdated, useWorkspaceAndPageId } from '../util'; export const LastModified = () => { @@ -9,11 +10,12 @@ export const LastModified = () => { const { workspaceId, pageId } = useWorkspaceAndPageId(); const lastModified = usePageLastUpdated({ workspaceId, pageId }); const formatLastModified = format(lastModified, 'MM/dd/yyyy hh:mm'); + const { t } = useTranslation(); return (
- Last edited by + {t('stetting.Settings.Last edited by')} {username}
diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx index a168f25b6d..1960a74626 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx @@ -2,6 +2,7 @@ import { MoveToIcon } from '@toeverything/components/icons'; import { ListItem, styled, Typography } from '@toeverything/components/ui'; import { LOGOUT_COOKIES, LOGOUT_LOCAL_STORAGE } from '@toeverything/utils'; import { getAuth, signOut } from 'firebase/auth'; +import { useTranslation } from 'react-i18next'; const logout = () => { LOGOUT_LOCAL_STORAGE.forEach(name => localStorage.removeItem(name)); @@ -16,10 +17,13 @@ const logout = () => { }; export const Logout = () => { + const { t } = useTranslation(); return ( - Logout + + {t('stetting.Settings.Logout')} + ); }; diff --git a/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts b/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts index 0dd9413c89..fdd1a1fb53 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts +++ b/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts @@ -97,6 +97,13 @@ export const useSettings = (): SettingItem[] => { message.success('Page link copied successfully'); }, }, + { + type: 'button', + name: 'Language', + onClick: () => { + console.log('Language is change'); + }, + }, { type: 'separator', }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5d023ebe9e..5ed408b554 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -196,10 +196,14 @@ importers: specifiers: '@mui/icons-material': ^5.8.4 firebase: ^9.9.3 + i18next: ^21.9.1 mini-css-extract-plugin: ^2.6.1 + react-i18next: ^11.18.4 webpack: ^5.74.0 dependencies: '@mui/icons-material': 5.8.4 + i18next: 21.9.1 + react-i18next: 11.18.4_i18next@21.9.1 devDependencies: firebase: 9.9.3 mini-css-extract-plugin: 2.6.1_webpack@5.74.0 @@ -501,7 +505,9 @@ importers: '@types/turndown': ^5.0.1 clsx: ^1.2.1 date-fns: ^2.29.2 + i18next: ^21.9.1 jotai: ^1.8.1 + react-i18next: ^11.18.4 tinycolor2: ^1.4.2 turndown: 7.1.1 dependencies: @@ -513,7 +519,9 @@ importers: '@mui/icons-material': 5.8.4 clsx: 1.2.1 date-fns: 2.29.2 + i18next: 21.9.1 jotai: 1.8.1 + react-i18next: 11.18.4_i18next@21.9.1 tinycolor2: 1.4.2 turndown: 7.1.1 devDependencies: @@ -7383,10 +7391,8 @@ packages: indent-string: 4.0.0 dev: true - /ajv-formats/2.1.1_ajv@8.11.0: + /ajv-formats/2.1.1: resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} - peerDependencies: - ajv: ^8.0.0 peerDependenciesMeta: ajv: optional: true @@ -16953,7 +16959,7 @@ packages: dependencies: '@types/json-schema': 7.0.11 ajv: 8.11.0 - ajv-formats: 2.1.1_ajv@8.11.0 + ajv-formats: 2.1.1 ajv-keywords: 5.1.0_ajv@8.11.0 dev: true From 0baf02e80f0a88c616f03d423d9d57a5481b96a0 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Tue, 30 Aug 2022 00:28:57 +0800 Subject: [PATCH 66/79] Update libs/components/layout/src/i18n/resources/en.json Co-authored-by: Whitewater --- libs/components/layout/src/i18n/resources/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/components/layout/src/i18n/resources/en.json b/libs/components/layout/src/i18n/resources/en.json index d12f3bc040..8706296bba 100644 --- a/libs/components/layout/src/i18n/resources/en.json +++ b/libs/components/layout/src/i18n/resources/en.json @@ -9,7 +9,7 @@ "isNotLocalWorkspace": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.", "DoNotStore": "AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data" }, - "stetting": { + "setting": { "Layout": { "title": "Layout" }, From 0bda0feb8322aaf9e863cf541acb295a1861844d Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Tue, 30 Aug 2022 00:29:28 +0800 Subject: [PATCH 67/79] Update libs/components/layout/src/i18n/index.ts Co-authored-by: Whitewater --- libs/components/layout/src/i18n/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/components/layout/src/i18n/index.ts b/libs/components/layout/src/i18n/index.ts index 6e7cf7521b..dae0c24f3c 100644 --- a/libs/components/layout/src/i18n/index.ts +++ b/libs/components/layout/src/i18n/index.ts @@ -20,7 +20,7 @@ i18next.use(initReactI18next).init({ export const options = [ { value: 'en', text: 'English' }, { value: 'zh', text: '简体中文' }, -]; +] as const; export { i18next }; From e6569410844e970a77919546ab448325a861df74 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 30 Aug 2022 10:32:52 +0800 Subject: [PATCH 68/79] update i18n --- .../header/EditorBoardSwitcher/Switcher.tsx | 4 +- libs/components/layout/src/i18n/index.ts | 6 ++- .../layout/src/i18n/resources/en.json | 46 +++++++++---------- .../layout/src/i18n/resources/zh.json | 46 +++++++++---------- .../ContainerTabs/ContainerTabs.tsx | 10 ++-- .../Settings/SettingsList.tsx | 6 +-- .../settings-sidebar/Settings/use-settings.ts | 14 +++--- 7 files changed, 64 insertions(+), 68 deletions(-) diff --git a/libs/components/layout/src/header/EditorBoardSwitcher/Switcher.tsx b/libs/components/layout/src/header/EditorBoardSwitcher/Switcher.tsx index d1b5cc2acc..636dfdc905 100644 --- a/libs/components/layout/src/header/EditorBoardSwitcher/Switcher.tsx +++ b/libs/components/layout/src/header/EditorBoardSwitcher/Switcher.tsx @@ -38,7 +38,7 @@ export const Switcher = () => { active={pageViewMode === DocMode.doc} onClick={() => switchToPageView(DocMode.doc)} > - {t('Paper')} + Paper { active={pageViewMode === DocMode.board} onClick={() => switchToPageView(DocMode.board)} > - {t('Edgeless')} + Edgeless ); diff --git a/libs/components/layout/src/i18n/index.ts b/libs/components/layout/src/i18n/index.ts index dae0c24f3c..efb3848125 100644 --- a/libs/components/layout/src/i18n/index.ts +++ b/libs/components/layout/src/i18n/index.ts @@ -4,8 +4,10 @@ import en_US from './resources/en.json'; import zh_CN from './resources/zh.json'; const resources = { - en: en_US, - zh: zh_CN, + translation: { + en: en_US, + zh: zh_CN, + }, } as const; i18next.use(initReactI18next).init({ diff --git a/libs/components/layout/src/i18n/resources/en.json b/libs/components/layout/src/i18n/resources/en.json index 8706296bba..ef13d02e86 100644 --- a/libs/components/layout/src/i18n/resources/en.json +++ b/libs/components/layout/src/i18n/resources/en.json @@ -1,30 +1,26 @@ { - "translation": { - "Paper": "Paper", - "Edgeless": "Edgeless", - "Sync to Disk": "Sync to Disk", - "Share": "Share", - "warningTips": { - "isNotfsApiSupported": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge", - "isNotLocalWorkspace": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.", - "DoNotStore": "AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data" + "Sync to Disk": "Sync to Disk", + "Share": "Share", + "WarningTips": { + "IsNotfsApiSupported": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC DATA TO DISK with the latest version of Chromium based browser like Chrome/Edge", + "IsNotLocalWorkspace": "Welcome to the AFFiNE demo. To begin saving changes you can SYNC TO DISK.", + "DoNotStore": "AFFiNE is under active development and the current version is UNSTABLE. Please DO NOT store information or data" + }, + "Setting": { + "Layout": { + "Title": "Layout" }, - "setting": { - "Layout": { - "title": "Layout" - }, - "Comment": { - "title": "Comment" - }, - "Settings": { - "title": "Settings", - "Duplicate Page": "Duplicate Page", - "Copy Page Link": "Copy Page Link", - "Language": "Language", - "Clear Workspace": "Clear Workspace", - "Last edited by": "Last edited by ", - "Logout": "Logout" - } + "Comment": { + "Title": "Comment" + }, + "Settings": { + "Title": "Settings", + "Duplicate Page": "Duplicate Page", + "Copy Page Link": "Copy Page Link", + "Language": "Language", + "Clear Workspace": "Clear Workspace", + "Last edited by": "Last edited by ", + "Logout": "Logout" } } } diff --git a/libs/components/layout/src/i18n/resources/zh.json b/libs/components/layout/src/i18n/resources/zh.json index 90847e4610..51a0cfcd00 100644 --- a/libs/components/layout/src/i18n/resources/zh.json +++ b/libs/components/layout/src/i18n/resources/zh.json @@ -1,30 +1,26 @@ { - "translation": { - "Paper": "页面", - "Edgeless": "无边缘", - "Sync to Disk": "同步到磁盘", - "Share": "分享", - "warningTips": { - "isNotfsApiSupported": "欢迎来到AFFiNE 的演示界面。您可以使用最新版本的基于Chrome的浏览器(如Chrome/Edge)将数据同步到磁盘来进行保存", - "isNotLocalWorkspace": "欢迎来到AFFiNE 的演示界面,您可以同步到磁盘来进行保存操作。", - "DoNotStore": "AFFINE 正在积极开发中,当前版本不稳定。请不要存储信息或数据。" + "Sync to Disk": "同步到磁盘", + "Share": "分享", + "WarningTips": { + "IsNotfsApiSupported": "欢迎来到AFFiNE 的演示界面。您可以使用最新版本的基于Chrome的浏览器(如Chrome/Edge)将数据同步到磁盘来进行保存", + "IsNotLocalWorkspace": "欢迎来到AFFiNE 的演示界面,您可以同步到磁盘来进行保存操作。", + "DoNotStore": "AFFINE 正在积极开发中,当前版本不稳定。请不要存储信息或数据。" + }, + "Setting": { + "Layout": { + "Title": "布局" }, - "stetting": { - "Layout": { - "title": "布局" - }, - "Comment": { - "title": "评论" - }, - "Settings": { - "title": "设置", - "Duplicate Page": "复制页面", - "Copy Page Link": "拷贝页面链接", - "Language": "当前语言", - "Clear Workspace": "清空工作区域", - "Last edited by": "最后编辑者为 ", - "Logout": "登出" - } + "Comment": { + "Title": "评论" + }, + "Settings": { + "Title": "设置", + "Duplicate Page": "复制页面", + "Copy Page Link": "拷贝页面链接", + "Language": "当前语言", + "Clear Workspace": "清空工作区域", + "Last edited by": "最后编辑者为 ", + "Logout": "退出登录" } } } diff --git a/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx b/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx index 9019063f30..9e29edaa2d 100644 --- a/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx +++ b/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx @@ -17,12 +17,13 @@ const _defaultTabsKeys = ['layout', 'comment', 'settings'] as const; export const ContainerTabs = () => { const { activeCommentId, resolveComment } = useActiveComment(); + const { t } = useTranslation(); const getSettingsTabsData = useCallback((): SettingsTabItemType[] => { return [ { type: 'layout', - text: 'Layout', + text: t('Setting.Layout'), icon: ( @@ -32,7 +33,7 @@ export const ContainerTabs = () => { }, { type: 'comment', - text: 'Comment', + text: t('Setting.Comment'), icon: ( @@ -49,7 +50,7 @@ export const ContainerTabs = () => { }, { type: 'settings', - text: 'Settings', + text: t('Setting.Settings'), icon: ( @@ -68,7 +69,6 @@ export const ContainerTabs = () => { _defaultTabsKeys as unknown as string[], 'settings' ); - const { t } = useTranslation(); return ( <> @@ -76,7 +76,7 @@ export const ContainerTabs = () => { const { type, text, icon } = tab; return ( { diff --git a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx index a0d93aae23..47384cf99f 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx @@ -12,8 +12,8 @@ import { useSettings } from './use-settings'; export const SettingsList = () => { const settings = useSettings(); - const { t, i18n } = useTranslation(); - const changeLanguage = (event: any) => { + const { i18n } = useTranslation(); + const changeLanguage = event => { i18n.changeLanguage(event); }; @@ -45,7 +45,7 @@ export const SettingsList = () => { return ( item.onClick()}> - {t(`stetting.Settings.${item.name}`)} + {item.name} {item.name === 'Language' ? (
+ ) : item.name === '当前语言' ? ( +
+ +
) : null}
); diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx index 2d37a73717..853912780b 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx @@ -15,7 +15,7 @@ export const LastModified = () => {
- {t('stetting.Settings.Last edited by')} + {t('Last edited by')} {username}
diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx index 1960a74626..3dfc7dffb9 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/footer/Logout.tsx @@ -21,9 +21,7 @@ export const Logout = () => { return ( - - {t('stetting.Settings.Logout')} - + {t('Logout')} ); }; diff --git a/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts b/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts index eb7d2d1454..8b08312e94 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts +++ b/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts @@ -82,7 +82,7 @@ export const useSettings = (): SettingItem[] => { // }, { type: 'button', - name: t('Setting.Settings.Duplicate Page'), + name: t('Duplicate Page'), onClick: async () => { const newPageInfo = await duplicatePage({ workspaceId, @@ -93,7 +93,7 @@ export const useSettings = (): SettingItem[] => { }, { type: 'button', - name: t('Setting.Settings.Copy Page Link'), + name: t('Copy Page Link'), onClick: () => { copyToClipboard(window.location.href); message.success('Page link copied successfully'); @@ -101,7 +101,7 @@ export const useSettings = (): SettingItem[] => { }, { type: 'button', - name: t('Setting.Settings.Language'), + name: t('Language'), onClick: () => { //Do noting }, @@ -150,7 +150,7 @@ export const useSettings = (): SettingItem[] => { }, { type: 'button', - name: t('Setting.Settings.Clear Workspace'), + name: t('Clear Workspace'), onClick: () => clearWorkspace(workspaceId), flag: 'booleanClearWorkspace', }, From 6b373642e786f0dd861e43d2ea8c7caef6c36fbc Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 30 Aug 2022 11:16:59 +0800 Subject: [PATCH 70/79] update --- libs/components/layout/src/i18n/index.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/libs/components/layout/src/i18n/index.ts b/libs/components/layout/src/i18n/index.ts index 174786cb26..866edee933 100644 --- a/libs/components/layout/src/i18n/index.ts +++ b/libs/components/layout/src/i18n/index.ts @@ -24,18 +24,3 @@ export const options = [ ] as const; export { i18next }; - -// import { useTranslation } from 'react-i18next'; -// import { options } from './i18n'; -// - -// const { t, i18n } = useTranslation(); -// const changeLanguage = (event: any) => { -// i18n.changeLanguage(event); -// }; From 838113941e2ec8785296baa0c480d62c3b5b5965 Mon Sep 17 00:00:00 2001 From: JimmFly Date: Tue, 30 Aug 2022 12:42:04 +0800 Subject: [PATCH 71/79] update i18n --- libs/components/layout/src/i18n/index.ts | 14 +++++++++++ .../layout/src/i18n/resources/en.json | 9 +++++-- .../layout/src/i18n/resources/zh.json | 9 +++++-- .../ContainerTabs/ContainerTabs.tsx | 10 ++++---- .../Settings/SettingsList.tsx | 22 +++-------------- .../Settings/footer/LastModified.tsx | 3 +-- .../settings-sidebar/Settings/use-settings.ts | 24 ++++++++++++++----- 7 files changed, 55 insertions(+), 36 deletions(-) diff --git a/libs/components/layout/src/i18n/index.ts b/libs/components/layout/src/i18n/index.ts index 866edee933..20f4e2a3ce 100644 --- a/libs/components/layout/src/i18n/index.ts +++ b/libs/components/layout/src/i18n/index.ts @@ -3,6 +3,20 @@ import { initReactI18next } from 'react-i18next'; import en_US from './resources/en.json'; import zh_CN from './resources/zh.json'; +// See https://react.i18next.com/latest/typescript +declare module 'react-i18next' { + // and extend them! + interface CustomTypeOptions { + // custom namespace type if you changed it + defaultNS: 'ns1'; + // custom resources type + resources: { + en: typeof en_US.translation; + zh: typeof zh_CN.translation; + }; + } +} + const resources = { en: en_US, zh: zh_CN, diff --git a/libs/components/layout/src/i18n/resources/en.json b/libs/components/layout/src/i18n/resources/en.json index 0a3efcdc9a..4c6a714e9b 100644 --- a/libs/components/layout/src/i18n/resources/en.json +++ b/libs/components/layout/src/i18n/resources/en.json @@ -10,12 +10,17 @@ "Layout": "Layout", "Comment": "Comment", "Settings": "Settings", - + "ComingSoon": "Layout Settings Coming Soon...", "Duplicate Page": "Duplicate Page", "Copy Page Link": "Copy Page Link", "Language": "Language", "Clear Workspace": "Clear Workspace", - "Last edited by": "Last edited by ", + "Export As Markdown": "Export As Markdown", + "Export As HTML": "Export As HTML", + "Export As PDF (Unsupported)": "Export As PDF (Unsupported)", + "Import Workspace": "Import Workspace", + "Export Workspace": "Export Workspace", + "Last edited by": "Last edited by {{name}}", "Logout": "Logout" } } diff --git a/libs/components/layout/src/i18n/resources/zh.json b/libs/components/layout/src/i18n/resources/zh.json index d8fcedc53f..da86cef6b2 100644 --- a/libs/components/layout/src/i18n/resources/zh.json +++ b/libs/components/layout/src/i18n/resources/zh.json @@ -7,7 +7,7 @@ "IsNotLocalWorkspace": "欢迎来到AFFiNE 的演示界面,您可以同步到磁盘来进行保存操作。", "DoNotStore": "AFFINE 正在积极开发中,当前版本不稳定。请不要存储信息或数据。" }, - + "ComingSoon": "布局设置即将到来", "Layout": "布局", "Comment": "评论", "Settings": "设置", @@ -15,7 +15,12 @@ "Copy Page Link": "复制页面链接", "Language": "当前语言", "Clear Workspace": "清空工作区域", - "Last edited by": "最后编辑者为 ", + "Export As Markdown": "导出 markdown", + "Export As HTML": "导出 HTML", + "Export As PDF (Unsupported)": "导出 PDF (暂不支持)", + "Import Workspace": "导入 Workspace", + "Export Workspace": "导出 Workspace", + "Last edited by": "最后编辑者为 {{name}}", "Logout": "退出登录" } } diff --git a/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx b/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx index a479e7f372..4503482d05 100644 --- a/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx +++ b/libs/components/layout/src/settings-sidebar/ContainerTabs/ContainerTabs.tsx @@ -23,7 +23,7 @@ export const ContainerTabs = () => { return [ { type: 'layout', - text: 'Layout', + text: t('Layout'), icon: ( @@ -33,7 +33,7 @@ export const ContainerTabs = () => { }, { type: 'comment', - text: 'Comment', + text: t('Comment'), icon: ( @@ -50,7 +50,7 @@ export const ContainerTabs = () => { }, { type: 'settings', - text: 'Settings', + text: t('Settings'), icon: ( @@ -59,7 +59,7 @@ export const ContainerTabs = () => { panel: , }, ]; - }, [activeCommentId, resolveComment]); + }, [activeCommentId, resolveComment, t]); const settingsTabsData = useMemo(() => { return getSettingsTabsData(); @@ -76,7 +76,7 @@ export const ContainerTabs = () => { const { type, text, icon } = tab; return ( { diff --git a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx index 90ecf60cc6..d1b633b754 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx @@ -28,7 +28,7 @@ export const SettingsList = () => { if (type === 'switch') { return ( { item.onChange(!item.value); }} @@ -44,9 +44,9 @@ export const SettingsList = () => { } return ( - item.onClick()}> + item.onClick()}> {item.name} - {item.name === 'Language' ? ( + {item.key === 'Language' ? (
- ) : item.name === '当前语言' ? ( -
- -
) : null}
); diff --git a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx index 853912780b..0c0b5c2efd 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/footer/LastModified.tsx @@ -15,8 +15,7 @@ export const LastModified = () => {
- {t('Last edited by')} - {username} + {t('Last edited by', { name: username })}
diff --git a/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts b/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts index 8b08312e94..dfd8918c49 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts +++ b/libs/components/layout/src/settings-sidebar/Settings/use-settings.ts @@ -17,6 +17,7 @@ import { interface BaseSettingItem { flag?: keyof SettingFlags; + key: string; } interface SwitchItem extends BaseSettingItem { @@ -83,6 +84,7 @@ export const useSettings = (): SettingItem[] => { { type: 'button', name: t('Duplicate Page'), + key: 'Duplicate Page', onClick: async () => { const newPageInfo = await duplicatePage({ workspaceId, @@ -94,6 +96,7 @@ export const useSettings = (): SettingItem[] => { { type: 'button', name: t('Copy Page Link'), + key: 'Copy Page Link', onClick: () => { copyToClipboard(window.location.href); message.success('Page link copied successfully'); @@ -102,16 +105,19 @@ export const useSettings = (): SettingItem[] => { { type: 'button', name: t('Language'), + key: 'Language', onClick: () => { - //Do noting + // Do noting }, }, { type: 'separator', + key: 'separator1', }, { type: 'button', - name: 'Export As Markdown', + name: t('Export As Markdown'), + key: 'Export As Markdown', onClick: async () => { const title = await getPageTitle({ workspaceId, pageId }); exportMarkdown({ workspaceId, rootBlockId: pageId, title }); @@ -120,7 +126,8 @@ export const useSettings = (): SettingItem[] => { }, { type: 'button', - name: 'Export As HTML', + name: t('Export As HTML'), + key: 'Export As HTML', onClick: async () => { const title = await getPageTitle({ workspaceId, pageId }); exportHtml({ workspaceId, rootBlockId: pageId, title }); @@ -129,28 +136,33 @@ export const useSettings = (): SettingItem[] => { }, { type: 'button', - name: 'Export As PDF (Unsupported)', + name: t('Export As PDF (Unsupported)'), + key: 'Export As PDF (Unsupported)', onClick: () => console.log('Export As PDF'), flag: 'booleanExportPdf', }, { type: 'separator', + key: 'separator2', }, { type: 'button', - name: 'Import Workspace', + name: t('Import Workspace'), + key: 'Import Workspace', onClick: () => importWorkspace(workspaceId), flag: 'booleanImportWorkspace', }, { type: 'button', - name: 'Export Workspace', + name: t('Export Workspace'), + key: 'Export Workspace', onClick: () => exportWorkspace(), flag: 'booleanExportWorkspace', }, { type: 'button', name: t('Clear Workspace'), + key: 'Clear Workspace', onClick: () => clearWorkspace(workspaceId), flag: 'booleanClearWorkspace', }, From 5e767e187f220e16a316e8d535ead6ac2eecc899 Mon Sep 17 00:00:00 2001 From: JimmFly <102217452+JimmFly@users.noreply.github.com> Date: Tue, 30 Aug 2022 14:58:04 +0800 Subject: [PATCH 72/79] Update libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx Co-authored-by: Whitewater --- .../layout/src/settings-sidebar/Settings/SettingsList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx index d1b633b754..18e7d20d3f 100644 --- a/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx +++ b/libs/components/layout/src/settings-sidebar/Settings/SettingsList.tsx @@ -49,7 +49,7 @@ export const SettingsList = () => { {item.key === 'Language' ? (
- {options.map(option => ( - - ))} - - - + - - - - - - - - - - - + ); }; + +export const AFFiNEHeader = () => { + const matches = useMediaQuery('(max-width: 1024px)'); + const navigate = useNavigate(); + const { i18n } = useTranslation(); + + const changeLanguage = (event: any) => { + i18n.changeLanguage(event); + }; + return ( + + + + + + + + + + + + ); +}; From 93e5eacd566c9f54b22869169c450e7e6f69d878 Mon Sep 17 00:00:00 2001 From: tzhangchi Date: Thu, 1 Sep 2022 15:55:15 +0800 Subject: [PATCH 76/79] feat(venus): add responsive --- apps/venus/src/app/Common.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/venus/src/app/Common.tsx b/apps/venus/src/app/Common.tsx index 7adb206a56..87347f4fa1 100644 --- a/apps/venus/src/app/Common.tsx +++ b/apps/venus/src/app/Common.tsx @@ -350,6 +350,7 @@ export const AFFiNEHeader = () => { const changeLanguage = (event: any) => { i18n.changeLanguage(event); }; + const matchesIPAD = useMediaQuery('(max-width: 768px)'); return ( { > About Us - {options.map(option => (