diff --git a/.github/ISSUE_TEMPLATE/example_request.yml b/.github/ISSUE_TEMPLATE/example_request.yml new file mode 100644 index 000000000..c8fd00bab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/example_request.yml @@ -0,0 +1,24 @@ +name: Example Request +description: Submit a request for an example +title: '[Example Request]: ' +labels: ['Example Request'] +body: + - type: markdown + attributes: + value: | + Need an example of how to do something with Yoopta-Editor? + - type: textarea + id: description + attributes: + label: What's the example? + description: Please describe the example. What would you like to see? + validations: + required: true + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/Darginec05/Yoopta-Editor/blob/master/CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true \ No newline at end of file diff --git a/package.json b/package.json index e7b29ed8b..ff26fba0f 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,13 @@ ], "private": true, "scripts": { + "dev": "npm-run-all --parallel start serve", "start": "yarn lerna run start --parallel --ignore development", - "build": "yarn clean && yarn lerna run build --parallel --ignore development", - "clean": "find ./packages -type d -name dist ! -path './packages/development/*' -exec rm -rf {} +", "serve": "yarn lerna run dev --scope=development", + "build": "yarn clean && yarn install && yarn lerna run build --parallel --ignore development", + "clean": "find ./packages -type d -name dist ! -path './packages/development/*' -exec rm -rf {} +", "coverage": "vitest run --coverage", "test": "vitest", - "dev": "npm-run-all --parallel start serve", "test:ui": "vitest --ui", "test:integration": "playwright test", "release": "yarn clean && yarn build && yarn lerna publish --no-private" diff --git a/packages/core/editor/package.json b/packages/core/editor/package.json index a6a7cc14d..4ccaf548d 100644 --- a/packages/core/editor/package.json +++ b/packages/core/editor/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/editor", - "version": "4.6.4", + "version": "4.6.5-rc.3", "license": "MIT", "private": false, "main": "dist/index.js", @@ -67,5 +67,5 @@ "url": "https://github.com/Darginec05/Yoopta-Editor/issues" }, "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme", - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/core/editor/src/UI/Overlay/Overlay.tsx b/packages/core/editor/src/UI/Overlay/Overlay.tsx index 821571842..fd8267298 100644 --- a/packages/core/editor/src/UI/Overlay/Overlay.tsx +++ b/packages/core/editor/src/UI/Overlay/Overlay.tsx @@ -6,12 +6,29 @@ type Props = { lockScroll?: boolean; className?: string; onClick?: (e: MouseEvent) => void; + onMouseDown?: (e: MouseEvent) => void; style?: React.CSSProperties; }; -const Overlay = ({ className, onClick, children, lockScroll = true, ...rest }: Props) => { +const Overlay = ({ className, children, lockScroll = true, ...props }: Props) => { + const onMouseDown = (e: MouseEvent) => { + e.stopPropagation(); + props.onMouseDown?.(e); + }; + + const onClick = (e: MouseEvent) => { + e.stopPropagation(); + props.onClick?.(e); + }; + return ( - + {children} ); diff --git a/packages/core/editor/src/UI/Portal/Portal.tsx b/packages/core/editor/src/UI/Portal/Portal.tsx index 4070ebb61..1f5e0c73f 100644 --- a/packages/core/editor/src/UI/Portal/Portal.tsx +++ b/packages/core/editor/src/UI/Portal/Portal.tsx @@ -1,5 +1,5 @@ import { FloatingPortal } from '@floating-ui/react'; -import { MutableRefObject, ReactNode, useEffect, useState } from 'react'; +import { MutableRefObject, ReactNode, useEffect, useRef, useState } from 'react'; import { useYooptaEditor } from '../../contexts/YooptaContext/YooptaContext'; type Props = { @@ -9,19 +9,30 @@ type Props = { const Portal = (props: Props) => { const [isMounted, setIsMounted] = useState(false); + const rootEl = useRef(null); const editor = useYooptaEditor(); useEffect(() => { setIsMounted(true); + const editorEl = document.querySelector(`[data-yoopta-editor-id="${editor.id}"]`) as HTMLElement; + const overlays = editorEl.querySelector('.yoopta-overlays'); + if (!overlays) { + rootEl.current = document.createElement('div'); + rootEl.current.className = 'yoopta-overlays'; + editorEl.appendChild(rootEl.current); + } + + return () => { + if (rootEl.current) { + rootEl.current.remove(); + } + }; }, []); if (!isMounted) return null; return ( - + {props.children} ); diff --git a/packages/core/editor/src/YooptaEditor.tsx b/packages/core/editor/src/YooptaEditor.tsx index 9bced6886..4d43d2bb3 100644 --- a/packages/core/editor/src/YooptaEditor.tsx +++ b/packages/core/editor/src/YooptaEditor.tsx @@ -4,7 +4,7 @@ import { getDefaultYooptaChildren } from './components/Editor/utils'; import { Editor } from './components/Editor/Editor'; import { CSSProperties, useMemo, useState } from 'react'; import { YooEditor, YooptaBlockData, YooptaContentValue } from './editor/types'; -import { Plugin } from './plugins/types'; +import { Plugin, PluginElementProps } from './plugins/types'; import NoSSR from './components/NoSsr/NoSsr'; import { Tools, ToolsProvider } from './contexts/YooptaContext/ToolsContext'; import { @@ -22,7 +22,7 @@ import { generateId } from './utils/generateId'; type Props = { id?: string; editor: YooEditor; - plugins: YooptaPlugin[]; + plugins: YooptaPlugin, Record>[]; marks?: YooptaMark[]; value?: YooptaContentValue; autoFocus?: boolean; diff --git a/packages/core/editor/src/components/Editor/Editor.tsx b/packages/core/editor/src/components/Editor/Editor.tsx index df37fce74..b885f3bd2 100644 --- a/packages/core/editor/src/components/Editor/Editor.tsx +++ b/packages/core/editor/src/components/Editor/Editor.tsx @@ -12,7 +12,6 @@ import { ReactEditor } from 'slate-react'; import { YooptaBlockPath } from '../../editor/types'; import { useRectangeSelectionBox } from '../SelectionBox/hooks'; import { SelectionBox } from '../SelectionBox/SelectionBox'; -import { serializeHTML } from '../../parsers/serializeHTML'; import { Blocks } from '../../editor/blocks'; type Props = { @@ -155,8 +154,6 @@ const Editor = ({ const isInsideEditor = yooptaEditorRef.current?.contains(event.relatedTarget as Node); if (isInsideEditor || isReadOnly) return; - editor.blur(); - resetSelectionState(); resetSelectedBlocks(); }; @@ -183,12 +180,17 @@ const Editor = ({ if (Array.isArray(editor.selectedBlocks) && editor.selectedBlocks.length > 0) { event.preventDefault(); - const htmlString = serializeHTML(editor, editor.getEditorValue()); - const blob = new Blob([htmlString], { type: 'text/html' }); + const htmlString = editor.getHTML(editor.getEditorValue()); + const textString = editor.getPlainText(editor.getEditorValue()); + const htmlBlob = new Blob([htmlString], { type: 'text/html' }); + const textBlob = new Blob([textString], { type: 'text/plain' }); - const item = new ClipboardItem({ 'text/html': blob }); + const clipboardItem = new ClipboardItem({ + 'text/html': htmlBlob, + 'text/plain': textBlob, + }); - navigator.clipboard.write([item]).then(() => { + navigator.clipboard.write([clipboardItem]).then(() => { const html = new DOMParser().parseFromString(htmlString, 'text/html'); console.log('HTML copied\n', html.body); }); diff --git a/packages/core/editor/src/contexts/YooptaContext/YooptaContext.tsx b/packages/core/editor/src/contexts/YooptaContext/YooptaContext.tsx index d9d221bc4..c8467098b 100644 --- a/packages/core/editor/src/contexts/YooptaContext/YooptaContext.tsx +++ b/packages/core/editor/src/contexts/YooptaContext/YooptaContext.tsx @@ -50,6 +50,10 @@ const DEFAULT_HANDLERS: YooptaEditorContext = { blur: () => undefined, isFocused: () => false, focus: () => undefined, + + getHTML: () => '', + getMarkdown: () => '', + getPlainText: () => '', }, }; diff --git a/packages/core/editor/src/editor/index.tsx b/packages/core/editor/src/editor/index.tsx index 252c8798e..0ac56f60a 100644 --- a/packages/core/editor/src/editor/index.tsx +++ b/packages/core/editor/src/editor/index.tsx @@ -4,7 +4,7 @@ import { moveBlock } from './blocks/moveBlock'; import { focusBlock } from './blocks/focusBlock'; import { splitBlock } from './blocks/splitBlock'; import { setSelection } from './selection/setSelection'; -import { YooEditor } from './types'; +import { YooEditor, YooptaContentValue } from './types'; import { increaseBlockDepth } from './blocks/increaseBlockDepth'; import { decreaseBlockDepth } from './blocks/decreaseBlockDepth'; import { getEditorValue } from './core/getEditorValue'; @@ -19,6 +19,9 @@ import { focus } from './core/focus'; import { isFocused } from './core/isFocused'; import { deleteBlocks } from './blocks/deleteBlocks'; import { getBlock } from './blocks/getBlock'; +import { getHTML } from '../parsers/getHTML'; +import { getMarkdown } from '../parsers/getMarkdown'; +import { getPlainText } from '../parsers/getPlainText'; // export const YooEditor = {} // export const BlockTransforms = {} @@ -75,6 +78,10 @@ export const createYooptaEditor = (): YooEditor => { isFocused: () => isFocused(editor), focus: () => focus(editor), blur: (...args) => blur(editor, ...args), + + getHTML: (content: YooptaContentValue) => getHTML(editor, content), + getMarkdown: (content: YooptaContentValue) => getMarkdown(editor, content), + getPlainText: (content: YooptaContentValue) => getPlainText(editor, content), }; return editor; diff --git a/packages/core/editor/src/editor/types.ts b/packages/core/editor/src/editor/types.ts index f2c4d3a48..6a7df098f 100644 --- a/packages/core/editor/src/editor/types.ts +++ b/packages/core/editor/src/editor/types.ts @@ -105,9 +105,15 @@ export type YooEditor = { emit: (event: YooEditorEvents, payload: any) => void; readOnly: boolean; + // focus handlers isFocused: () => boolean; blur: (options?: EditorBlurOptions) => void; focus: () => void; + + // parser handlers + getHTML: (content: YooptaContentValue) => string; + getMarkdown: (content: YooptaContentValue) => string; + getPlainText: (content: YooptaContentValue) => string; }; // types for slate values diff --git a/packages/core/editor/src/hooks/useForceRender.ts b/packages/core/editor/src/hooks/useForceRender.ts deleted file mode 100644 index 99309208a..000000000 --- a/packages/core/editor/src/hooks/useForceRender.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { useReducer } from 'react'; - -export const useForceRerender = () => useReducer((x) => x + 1, 0)[1]; diff --git a/packages/core/editor/src/parsers/deserializeHTML.ts b/packages/core/editor/src/parsers/deserializeHTML.ts index 4e90dcd5d..fcec34345 100644 --- a/packages/core/editor/src/parsers/deserializeHTML.ts +++ b/packages/core/editor/src/parsers/deserializeHTML.ts @@ -170,7 +170,7 @@ function mapNodeChildren(child) { const block = child as YooptaBlockData; let text = ''; - block.value[0].children.forEach((child) => { + (block.value[0] as SlateElement).children.forEach((child: any) => { text += `${child.text}`; }); @@ -184,7 +184,6 @@ export function deserializeHTML(editor: YooEditor, html: HTMLElement) { console.log('pasted html', html); const PLUGINS_NODE_NAME_MATCHERS_MAP = getMappedPluginByNodeNames(editor); - console.log('PLUGINS_NODE_NAME_MATCHERS_MAP', PLUGINS_NODE_NAME_MATCHERS_MAP); const blocks = deserialize(editor, PLUGINS_NODE_NAME_MATCHERS_MAP, html).filter(isYooptaBlock) as YooptaBlockData[]; diff --git a/packages/core/editor/src/parsers/serializeHTML.ts b/packages/core/editor/src/parsers/getHTML.ts similarity index 79% rename from packages/core/editor/src/parsers/serializeHTML.ts rename to packages/core/editor/src/parsers/getHTML.ts index 42101e75e..b48e8f86a 100644 --- a/packages/core/editor/src/parsers/serializeHTML.ts +++ b/packages/core/editor/src/parsers/getHTML.ts @@ -1,4 +1,5 @@ -import { YooEditor, YooptaContentValue } from '../editor/types'; +import { BaseText, Descendant } from 'slate'; +import { SlateElement, YooEditor, YooptaContentValue } from '../editor/types'; import { getPluginByInlineElement } from '../utils/blockElements'; const MARKS_NODE_NAME_MATCHERS_MAP = { @@ -37,7 +38,7 @@ function serializeChildren(children, plugins) { .join(''); } -export function serializeHTML(editor: YooEditor, content: YooptaContentValue) { +export function getHTML(editor: YooEditor, content: YooptaContentValue): string { const blocks = Object.values(content) .filter((item) => editor.selectedBlocks?.includes(item.meta.order)) .sort((a, b) => a.meta.order - b.meta.order); @@ -46,8 +47,8 @@ export function serializeHTML(editor: YooEditor, content: YooptaContentValue) { const plugin = editor.plugins[blockData.type]; if (plugin && plugin.parsers?.html?.serialize) { - const content = serializeChildren(blockData.value[0].children, editor.plugins); - return plugin.parsers.html.serialize(blockData.value[0], content); + const content = serializeChildren((blockData.value[0] as SlateElement).children, editor.plugins); + return plugin.parsers.html.serialize(blockData.value[0] as SlateElement, content); } return ''; diff --git a/packages/core/editor/src/parsers/getMarkdown.ts b/packages/core/editor/src/parsers/getMarkdown.ts new file mode 100644 index 000000000..993febeb0 --- /dev/null +++ b/packages/core/editor/src/parsers/getMarkdown.ts @@ -0,0 +1,30 @@ +import { SlateElement, YooEditor, YooptaBlockData, YooptaContentValue } from '../editor/types'; + +export function serialize(editor: YooEditor, blocksData: YooptaBlockData[]) { + const blocks = blocksData.sort((a, b) => (a.meta.order > b.meta.order ? 1 : -1)); + + const markdown = blocks.map((blockData) => { + const plugin = editor.plugins[blockData.type]; + + if (plugin) { + const element = blockData.value[0] as SlateElement; + + if (plugin.parsers?.markdown?.serialize) { + const serialized = plugin.parsers.markdown.serialize( + element, + element.children.map((child) => child.text).join(''), + ); + if (serialized) return serialized; + } + } + + return ''; + }); + + return markdown.join('\n'); +} + +export function getMarkdown(editor: YooEditor, content: YooptaContentValue) { + const selectedBlocks = Object.values(content); + return serialize(editor, selectedBlocks); +} diff --git a/packages/core/editor/src/parsers/getPlainText.ts b/packages/core/editor/src/parsers/getPlainText.ts new file mode 100644 index 000000000..713814c33 --- /dev/null +++ b/packages/core/editor/src/parsers/getPlainText.ts @@ -0,0 +1,10 @@ +import { YooEditor, YooptaContentValue } from '../editor/types'; +import { getHTML } from './getHTML'; + +export function getPlainText(editor: YooEditor, content: YooptaContentValue) { + const htmlString = getHTML(editor, content); + + const div = document.createElement('div'); + div.innerHTML = htmlString; + return div.innerText; +} diff --git a/packages/core/exports/package.json b/packages/core/exports/package.json index e35be0a09..5ff355780 100644 --- a/packages/core/exports/package.json +++ b/packages/core/exports/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/exports", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Serialize/deserialize exports in different formats for Yoopta-Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -35,5 +35,6 @@ }, "dependencies": { "marked": "^13.0.0" - } + }, + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/core/starter-kit/README.md b/packages/core/starter-kit/README.md new file mode 100644 index 000000000..36f812578 --- /dev/null +++ b/packages/core/starter-kit/README.md @@ -0,0 +1,21 @@ +# StarterKit plugin + +StarterKit is plugin for Yoopta-Editor + +### Installation + +```bash +yarn add @yoopta/starter-kit +``` + +### Usage + +```jsx +import StarterKit from '@yoopta/starter-kit'; + +const plugins = [StarterKit]; + +const Editor = () => { + return ; +}; +``` diff --git a/packages/core/starter-kit/package.json b/packages/core/starter-kit/package.json new file mode 100644 index 000000000..341e6c6e0 --- /dev/null +++ b/packages/core/starter-kit/package.json @@ -0,0 +1,59 @@ +{ + "name": "@yoopta/starter-kit", + "version": "4.6.5-rc.3", + "description": "StarterKit for Yoopta Editor", + "author": "Darginec05 ", + "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", + "license": "MIT", + "private": false, + "main": "dist/index.js", + "type": "module", + "module": "dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "dist/" + ], + "dependencies": { + "@yoopta/accordion": "latest", + "@yoopta/action-menu-list": "latest", + "@yoopta/blockquote": "latest", + "@yoopta/callout": "latest", + "@yoopta/code": "latest", + "@yoopta/editor": "latest", + "@yoopta/embed": "latest", + "@yoopta/exports": "latest", + "@yoopta/file": "latest", + "@yoopta/headings": "latest", + "@yoopta/image": "latest", + "@yoopta/link": "latest", + "@yoopta/link-tool": "latest", + "@yoopta/lists": "latest", + "@yoopta/marks": "latest", + "@yoopta/paragraph": "latest", + "@yoopta/toolbar": "latest", + "@yoopta/video": "latest", + "slate": "^0.102.0", + "slate-react": "^0.102.0" + }, + "peerDependencies": { + "react": ">=17.0.2", + "react-dom": ">=17.0.2" + }, + "publishConfig": { + "registry": "https://registry.yarnpkg.com" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Darginec05/Editor-Yoopta.git" + }, + "scripts": { + "test": "node ./__tests__/yoopta-starter-kit.test.js", + "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development", + "prepublishOnly": "yarn build", + "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production" + }, + "bugs": { + "url": "https://github.com/Darginec05/Editor-Yoopta/issues" + }, + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" +} diff --git a/packages/core/starter-kit/rollup.config.js b/packages/core/starter-kit/rollup.config.js new file mode 100644 index 000000000..7a2f01266 --- /dev/null +++ b/packages/core/starter-kit/rollup.config.js @@ -0,0 +1,7 @@ +import { createRollupConfig } from '../../../config/rollup'; + +const pkg = require('./package.json'); +export default createRollupConfig({ + pkg, + tailwindConfig: { content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'], prefix: 'yoo-starter-' }, +}); diff --git a/packages/core/starter-kit/src/components/StarterKit/StarterKit.tsx b/packages/core/starter-kit/src/components/StarterKit/StarterKit.tsx new file mode 100644 index 000000000..7cb172f38 --- /dev/null +++ b/packages/core/starter-kit/src/components/StarterKit/StarterKit.tsx @@ -0,0 +1,72 @@ +import { CSSProperties, useEffect, useMemo, useRef } from 'react'; +import YooptaEditor, { createYooptaEditor, YooptaContentValue } from '@yoopta/editor'; + +import { TOOLS } from '../../utilts/tools'; +import { MARKS } from '../../utilts/marks'; +import { getPlugins } from '../../utilts/plugins'; +import { ImageUploadResponse } from '@yoopta/image'; +import { VideoUploadResponse } from '@yoopta/video'; +import { FileUploadResponse } from '@yoopta/file'; + +export type StarterKitProps = { + id?: string; + value?: YooptaContentValue; + onChange?: (value: YooptaContentValue) => void; + readOnly?: boolean; + autoFocus?: boolean; + className?: string; + placeholder?: string; + style?: CSSProperties; + selectionRef?: React.RefObject | false; + media?: MediaUploadsFn; +}; + +export type MediaUploadsFn = { + imageUpload?: (file: File) => Promise; + videoUpload?: (file: File) => Promise; + fileUpload?: (file: File) => Promise; +}; + +function StarterKit({ + id, + value, + style, + onChange, + readOnly, + autoFocus, + className, + placeholder, + media, + selectionRef = false, +}: StarterKitProps) { + const editor = useMemo(() => createYooptaEditor(), []); + + useEffect(() => { + if (typeof onChange === 'function') { + editor.on('change', onChange); + return () => { + editor.off('change', onChange); + }; + } + }, [editor]); + + return ( + + ); +} + +export { StarterKit }; diff --git a/packages/core/starter-kit/src/index.ts b/packages/core/starter-kit/src/index.ts new file mode 100644 index 000000000..3cfbc2b27 --- /dev/null +++ b/packages/core/starter-kit/src/index.ts @@ -0,0 +1,4 @@ +import { StarterKit, type MediaUploadsFn, type StarterKitProps } from './components/StarterKit/StarterKit'; + +export default StarterKit; +export type { MediaUploadsFn, StarterKitProps }; diff --git a/packages/core/starter-kit/src/styles.css b/packages/core/starter-kit/src/styles.css new file mode 100644 index 000000000..3db5b698c --- /dev/null +++ b/packages/core/starter-kit/src/styles.css @@ -0,0 +1 @@ +@tailwind utilities; \ No newline at end of file diff --git a/packages/core/starter-kit/src/utilts/marks.ts b/packages/core/starter-kit/src/utilts/marks.ts new file mode 100644 index 000000000..45587a5aa --- /dev/null +++ b/packages/core/starter-kit/src/utilts/marks.ts @@ -0,0 +1,3 @@ +import { Bold, Italic, CodeMark, Underline, Strike, Highlight } from '@yoopta/marks'; + +export const MARKS = [Bold, Italic, CodeMark, Underline, Strike, Highlight]; diff --git a/packages/core/starter-kit/src/utilts/plugins.ts b/packages/core/starter-kit/src/utilts/plugins.ts new file mode 100644 index 000000000..1f7999caf --- /dev/null +++ b/packages/core/starter-kit/src/utilts/plugins.ts @@ -0,0 +1,71 @@ +import Paragraph from '@yoopta/paragraph'; +import Blockquote from '@yoopta/blockquote'; +import Embed from '@yoopta/embed'; +import Image from '@yoopta/image'; +import Link from '@yoopta/link'; +import Callout from '@yoopta/callout'; +import Video from '@yoopta/video'; +import File from '@yoopta/file'; +import Accordion from '@yoopta/accordion'; +import { NumberedList, BulletedList, TodoList } from '@yoopta/lists'; +import { HeadingOne, HeadingThree, HeadingTwo } from '@yoopta/headings'; +import Code from '@yoopta/code'; +import { type MediaUploadsFn } from '../components/StarterKit/StarterKit'; + +type PluginParams = { + media?: MediaUploadsFn; +}; + +export const getPlugins = ({ media }: PluginParams) => { + return [ + Paragraph, + Accordion, + HeadingOne, + HeadingTwo, + HeadingThree, + Blockquote, + Callout, + NumberedList, + BulletedList, + TodoList, + Code, + Link, + Embed, + Image.extend({ + options: { + async onUpload(file) { + if (!media?.imageUpload) { + throw new Error('Image upload function is not provided'); + } + + const data = await media?.imageUpload(file); + return data; + }, + }, + }), + Video.extend({ + options: { + onUpload: async (file) => { + if (!media?.videoUpload) { + throw new Error('Image upload function is not provided'); + } + + const data = await media?.videoUpload(file); + return data; + }, + }, + }), + File.extend({ + options: { + onUpload: async (file) => { + if (!media?.fileUpload) { + throw new Error('Image upload function is not provided'); + } + + const data = await media?.fileUpload(file); + return data; + }, + }, + }), + ]; +}; diff --git a/packages/core/starter-kit/src/utilts/tools.ts b/packages/core/starter-kit/src/utilts/tools.ts new file mode 100644 index 000000000..f6b7264e8 --- /dev/null +++ b/packages/core/starter-kit/src/utilts/tools.ts @@ -0,0 +1,18 @@ +import ActionMenuList, { DefaultActionMenuRender } from '@yoopta/action-menu-list'; +import LinkTool, { DefaultLinkToolRender } from '@yoopta/link-tool'; +import Toolbar, { DefaultToolbarRender } from '@yoopta/toolbar'; + +export const TOOLS = { + ActionMenu: { + render: DefaultActionMenuRender, + tool: ActionMenuList, + }, + Toolbar: { + render: DefaultToolbarRender, + tool: Toolbar, + }, + LinkTool: { + render: DefaultLinkToolRender, + tool: LinkTool, + }, +}; diff --git a/packages/core/starter-kit/tsconfig.json b/packages/core/starter-kit/tsconfig.json new file mode 100644 index 000000000..ab104acf8 --- /dev/null +++ b/packages/core/starter-kit/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../config/tsconfig.base.json", + "include": ["react-svg.d.ts", "css-modules.d.ts", "src"], + "exclude": ["dist", "src/**/*.test.tsx", "src/**/*.stories.tsx"], + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist" + }, + "references": [ + { + "path": "../../core/editor" + } + ] +} diff --git a/packages/development/src/pages/dev/index.tsx b/packages/development/src/pages/dev/index.tsx index 10d81639c..c91dae1a2 100644 --- a/packages/development/src/pages/dev/index.tsx +++ b/packages/development/src/pages/dev/index.tsx @@ -8,8 +8,10 @@ import YooptaEditor, { YooptaBlockData, YooptaContentValue, } from '@yoopta/editor'; +import YooptaStarterKit from '@yoopta/starter-kit'; import { html } from '@yoopta/exports'; import { useMemo, useRef, useState } from 'react'; +import { uploadToCloudinary } from '../../utils/cloudinary'; import { MARKS } from '../../utils/yoopta/marks'; import { YOOPTA_PLUGINS } from '../../utils/yoopta/plugins'; import { TOOLS } from '../../utils/yoopta/tools'; @@ -18,268 +20,61 @@ export type YooptaChildrenValue = Record; const BasicExample = () => { const editor: YooEditor = useMemo(() => createYooptaEditor(), []); - const rectangleSelectionRef = useRef(null); + const selectionRef = useRef(null); const [readOnly, setReadOnly] = useState(false); - - // useEffect(() => { - // const handleCopy = (value) => console.log('BLOCK COPY', value); - // const handleFocus = (focused) => console.log('FOCUS', focused); - - // editor.on('block:copy', handleCopy); - // editor.on('focus', handleFocus); - - // return () => { - // editor.off('block:copy', handleCopy); - // editor.off('focus', handleFocus); - // }; - // }, []); - - const onSubmit = () => { - const editorData = editor.getEditorValue(); - console.log('EDITOR DATA', editorData); - }; + const [value, setValue] = useState(); return ( - <> -
- + + {/* + setValue(data)} + style={{ width: 650 }} + selectionRef={selectionRef} + placeholder="Start typing here..." + media={{ + imageUpload: async (file: File) => { + const data = await uploadToCloudinary(file, 'image'); + + return { + src: data.secure_url, + alt: 'cloudinary', + sizes: { + width: data.width, + height: data.height, }, - }, - 'ae04c7a1-fb94-4f0b-b428-3757a8d21196': { - id: 'ae04c7a1-fb94-4f0b-b428-3757a8d21196', - value: [ - { - id: '08a13b95-2371-4eac-9c30-83f1f8b72fc5', - type: 'callout', - children: [ - { - text: "By default, the @yoopta/image plugin provides its own image rendering. \nBut what if you want to change the default rendering with powerful components like next/image, which provide top-level optimization and rendering with different layout. So, it's easy-peasy. ", - }, - ], - props: { - theme: 'default', - }, - }, - ], - type: 'Callout', - meta: { - order: 3, - depth: 0, + }; + }, + fileUpload: async (file: File) => { + const response = await uploadToCloudinary(file, 'auto'); + return { src: response.url, name: response.name }; + }, + videoUpload: async (file: File) => { + const data = await uploadToCloudinary(file, 'video'); + return { + src: data.secure_url, + alt: 'cloudinary', + sizes: { + width: data.width, + height: data.height, }, - }, - }} - style={{ - width: 750, - }} - > - - -
- - ); -}; - -const Buttons = ({ onSubmit }: any) => { - const editor = useYooptaEditor(); - - return ( -
- - {/* - */} - - - + /> */}
); }; diff --git a/packages/development/src/pages/index.tsx b/packages/development/src/pages/index.tsx index 34fa5461f..f7732e1b6 100644 --- a/packages/development/src/pages/index.tsx +++ b/packages/development/src/pages/index.tsx @@ -4,9 +4,9 @@ import { useRouter } from 'next/router'; const Index = () => { const router = useRouter(); - // useEffect(() => { - // router.push('/dev'); - // }); + useEffect(() => { + router.push('/dev'); + }); return (
diff --git a/packages/development/src/utils/yoopta/plugins.tsx b/packages/development/src/utils/yoopta/plugins.tsx index 1380b5b35..a164e0ef2 100644 --- a/packages/development/src/utils/yoopta/plugins.tsx +++ b/packages/development/src/utils/yoopta/plugins.tsx @@ -80,7 +80,7 @@ export const YOOPTA_PLUGINS = [ }, onUpload: async (file: File) => { - const data = await uploadToCloudinary(file); + const data = await uploadToCloudinary(file, 'image'); return { src: data.secure_url, diff --git a/packages/marks/package.json b/packages/marks/package.json index 9ddbfe048..9318d40e0 100644 --- a/packages/marks/package.json +++ b/packages/marks/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/marks", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Marks for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -33,5 +33,6 @@ }, "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" - } + }, + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/accordion/package.json b/packages/plugins/accordion/package.json index dc4161ffd..7ac32c316 100644 --- a/packages/plugins/accordion/package.json +++ b/packages/plugins/accordion/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/accordion", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Accordion plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -37,5 +37,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/accordion/src/plugin/index.tsx b/packages/plugins/accordion/src/plugin/index.tsx index c02258595..6340cc26e 100644 --- a/packages/plugins/accordion/src/plugin/index.tsx +++ b/packages/plugins/accordion/src/plugin/index.tsx @@ -138,7 +138,6 @@ const Accordion = new YooptaPlugin // parsers: { // html: { // serialize: (element) => { - // console.log('accordion element', element); // return ''; // }, // }, diff --git a/packages/plugins/blockquote/package.json b/packages/plugins/blockquote/package.json index 7d257e67c..20ad44512 100644 --- a/packages/plugins/blockquote/package.json +++ b/packages/plugins/blockquote/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/blockquote", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Blockquote plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -34,5 +34,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/callout/package.json b/packages/plugins/callout/package.json index c6f3d7533..b2bcd8828 100644 --- a/packages/plugins/callout/package.json +++ b/packages/plugins/callout/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/callout", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Callout plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -34,5 +34,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/code/package.json b/packages/plugins/code/package.json index 5fca013f4..531d22491 100644 --- a/packages/plugins/code/package.json +++ b/packages/plugins/code/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/code", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Code plugin with syntax highlighting for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -69,5 +69,5 @@ "devDependencies": { "check-peer-dependencies": "^4.3.0" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/embed/package.json b/packages/plugins/embed/package.json index 46a778811..d48f65cd8 100644 --- a/packages/plugins/embed/package.json +++ b/packages/plugins/embed/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/embed", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Embed plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -39,5 +39,5 @@ "@radix-ui/react-icons": "^1.3.0", "re-resizable": "^6.9.11" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/embed/src/plugin/index.tsx b/packages/plugins/embed/src/plugin/index.tsx index fa9f0f6af..f2046d61c 100644 --- a/packages/plugins/embed/src/plugin/index.tsx +++ b/packages/plugins/embed/src/plugin/index.tsx @@ -62,7 +62,7 @@ const Embed = new YooptaPlugin -
`; }, }, markdown: { diff --git a/packages/plugins/file/package.json b/packages/plugins/file/package.json index 73db2740f..1ce50b6fa 100644 --- a/packages/plugins/file/package.json +++ b/packages/plugins/file/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/file", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "File plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -38,5 +38,5 @@ "@floating-ui/react": "^0.26.9", "@radix-ui/react-icons": "^1.3.0" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/file/src/index.ts b/packages/plugins/file/src/index.ts index 478721bfc..f8536eb46 100644 --- a/packages/plugins/file/src/index.ts +++ b/packages/plugins/file/src/index.ts @@ -1,5 +1,5 @@ import { File } from './plugin'; -import { FileElement } from './types'; +import { FileElement, FileElementProps, FileUploadResponse } from './types'; import './styles.css'; declare module 'slate' { @@ -9,4 +9,4 @@ declare module 'slate' { } export default File; -export { FileElement }; +export { FileElement, FileElementProps, FileUploadResponse }; diff --git a/packages/plugins/file/src/types.ts b/packages/plugins/file/src/types.ts index eefb40f55..6042a2d5c 100644 --- a/packages/plugins/file/src/types.ts +++ b/packages/plugins/file/src/types.ts @@ -10,9 +10,9 @@ export type FileElementProps = { export type FilePluginElements = 'file'; export type FileElement = SlateElement<'file', FileElementProps>; -export type OnUploadResponse = Partial & { src: string }; +export type FileUploadResponse = Partial & { src: string }; export type FilePluginOptions = { - onUpload?: (file: File) => Promise; + onUpload?: (file: File) => Promise; accept?: string; }; diff --git a/packages/plugins/headings/package.json b/packages/plugins/headings/package.json index 4db87774c..b269bb767 100644 --- a/packages/plugins/headings/package.json +++ b/packages/plugins/headings/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/headings", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Headings plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -39,5 +39,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/image/package.json b/packages/plugins/image/package.json index 97e5f70e5..040a4149f 100644 --- a/packages/plugins/image/package.json +++ b/packages/plugins/image/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/image", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Image plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -39,5 +39,5 @@ "@radix-ui/react-icons": "^1.3.0", "re-resizable": "^6.9.11" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/image/src/index.ts b/packages/plugins/image/src/index.ts index 49a5de1b2..3f06f6114 100644 --- a/packages/plugins/image/src/index.ts +++ b/packages/plugins/image/src/index.ts @@ -1,5 +1,5 @@ import { Image } from './plugin'; -import { ImageElement } from './types'; +import { ImageElement, ImageElementProps, ImageUploadResponse } from './types'; import './styles.css'; declare module 'slate' { @@ -9,4 +9,4 @@ declare module 'slate' { } export default Image; -export { ImageElement }; +export { ImageElement, ImageElementProps, ImageUploadResponse }; diff --git a/packages/plugins/image/src/plugin/index.tsx b/packages/plugins/image/src/plugin/index.tsx index ce4d250b3..56fce2bf6 100644 --- a/packages/plugins/image/src/plugin/index.tsx +++ b/packages/plugins/image/src/plugin/index.tsx @@ -33,8 +33,6 @@ const Image = new YooptaPlugin { - console.log('el.nodeName', el.nodeName); - if (el.nodeName === 'IMG') { const props: SlateElement<'image', ImageElementProps>['props'] = { nodeType: 'void', diff --git a/packages/plugins/image/src/types.ts b/packages/plugins/image/src/types.ts index 8f3688c9f..5313ba14b 100644 --- a/packages/plugins/image/src/types.ts +++ b/packages/plugins/image/src/types.ts @@ -17,7 +17,7 @@ export type ImageElementProps = { export type ImagePluginElements = 'image'; export type ImageElement = SlateElement<'image', ImageElementProps>; -export type OnUploadResponse = Omit; +export type ImageUploadResponse = Omit; export type ImageOptimizationFields = { deviceSizes?: number[]; @@ -25,7 +25,7 @@ export type ImageOptimizationFields = { }; export type ImagePluginOptions = { - onUpload: (file: File) => Promise; + onUpload: (file: File) => Promise; accept?: string; optimizations?: ImageOptimizationFields; maxSizes?: { diff --git a/packages/plugins/link/package.json b/packages/plugins/link/package.json index b60c4ce31..c8c03ac42 100644 --- a/packages/plugins/link/package.json +++ b/packages/plugins/link/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/link", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Link plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -36,5 +36,6 @@ }, "dependencies": { "lucide-react": "^0.379.0" - } + }, + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/lists/package.json b/packages/plugins/lists/package.json index 1b7fc5ca2..d8e93b49d 100644 --- a/packages/plugins/lists/package.json +++ b/packages/plugins/lists/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/lists", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Lists plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -34,5 +34,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/paragraph/package.json b/packages/plugins/paragraph/package.json index 77eb87f0d..12130579d 100644 --- a/packages/plugins/paragraph/package.json +++ b/packages/plugins/paragraph/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/paragraph", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Paragraph plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -34,5 +34,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/video/package.json b/packages/plugins/video/package.json index 093205dc2..06b2be346 100644 --- a/packages/plugins/video/package.json +++ b/packages/plugins/video/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/video", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Video plugin for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -39,5 +39,5 @@ "@radix-ui/react-icons": "^1.3.0", "re-resizable": "^6.9.11" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/plugins/video/src/index.ts b/packages/plugins/video/src/index.ts index d538929b6..ed1a89f8d 100644 --- a/packages/plugins/video/src/index.ts +++ b/packages/plugins/video/src/index.ts @@ -1,5 +1,5 @@ import { Video } from './plugin'; -import { VideoElement } from './types'; +import { VideoElement, VideoElementProps, VideoUploadResponse } from './types'; import './styles.css'; declare module 'slate' { @@ -9,4 +9,4 @@ declare module 'slate' { } export default Video; -export { VideoElement }; +export { VideoElement, VideoElementProps, VideoUploadResponse }; diff --git a/packages/plugins/video/src/plugin/index.tsx b/packages/plugins/video/src/plugin/index.tsx index bd2aecc63..73fe67aad 100644 --- a/packages/plugins/video/src/plugin/index.tsx +++ b/packages/plugins/video/src/plugin/index.tsx @@ -74,7 +74,6 @@ const Video = new YooptaPlugin; -export type OnUploadResponse = Omit; +export type VideoUploadResponse = Omit; export type VideoPluginOptions = { - onUpload: (file: File) => Promise; + onUpload: (file: File) => Promise; accept?: string; maxSizes?: { maxWidth?: number; diff --git a/packages/tools/action-menu/package.json b/packages/tools/action-menu/package.json index 9b306b7d4..7a25e279a 100644 --- a/packages/tools/action-menu/package.json +++ b/packages/tools/action-menu/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/action-menu-list", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "ActionMenuList tool for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -38,5 +38,5 @@ "@floating-ui/react": "^0.26.9", "@radix-ui/react-icons": "^1.3.0" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/tools/link-tool/package.json b/packages/tools/link-tool/package.json index aaae4a77d..4f7ccfe01 100644 --- a/packages/tools/link-tool/package.json +++ b/packages/tools/link-tool/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/link-tool", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Link tool for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -34,5 +34,5 @@ "bugs": { "url": "https://github.com/Darginec05/Editor-Yoopta/issues" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/packages/tools/toolbar/package.json b/packages/tools/toolbar/package.json index ce266dc50..26b41c557 100644 --- a/packages/tools/toolbar/package.json +++ b/packages/tools/toolbar/package.json @@ -1,6 +1,6 @@ { "name": "@yoopta/toolbar", - "version": "4.6.4", + "version": "4.6.5-rc.3", "description": "Toolbar tool for Yoopta Editor", "author": "Darginec05 ", "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme", @@ -40,5 +40,5 @@ "@radix-ui/react-toolbar": "^1.0.4", "lodash.throttle": "^4.1.1" }, - "gitHead": "29e4ae316ec75bb43d3822d028abcb0c34256ec5" + "gitHead": "600e0cf267a0ce7df074ddc7db1114d67c4185d1" } diff --git a/web/next-example/package.json b/web/next-example/package.json index 78e00d177..0494310ac 100644 --- a/web/next-example/package.json +++ b/web/next-example/package.json @@ -23,24 +23,25 @@ "@types/js-beautify": "^1.14.3", "@uiw/codemirror-theme-vscode": "^4.21.24", "@uiw/react-codemirror": "^4.21.25", - "@yoopta/accordion": "^4.6.4", - "@yoopta/action-menu-list": "^4.6.4", - "@yoopta/blockquote": "^4.6.4", - "@yoopta/callout": "^4.6.4", - "@yoopta/code": "^4.6.4", - "@yoopta/editor": "^4.6.4", - "@yoopta/embed": "^4.6.4", - "@yoopta/exports": "^4.6.4", - "@yoopta/file": "^4.6.4", - "@yoopta/headings": "^4.6.4", - "@yoopta/image": "^4.6.4", - "@yoopta/link": "^4.6.4", - "@yoopta/link-tool": "^4.6.4", - "@yoopta/lists": "^4.6.4", - "@yoopta/marks": "^4.6.4", - "@yoopta/paragraph": "^4.6.4", - "@yoopta/toolbar": "^4.6.4", - "@yoopta/video": "^4.6.4", + "@yoopta/accordion": "^4.6.5-rc.3", + "@yoopta/action-menu-list": "^4.6.5-rc.3", + "@yoopta/blockquote": "^4.6.5-rc.3", + "@yoopta/callout": "^4.6.5-rc.3", + "@yoopta/code": "^4.6.5-rc.3", + "@yoopta/editor": "^4.6.5-rc.3", + "@yoopta/embed": "^4.6.5-rc.3", + "@yoopta/exports": "^4.6.5-rc.3", + "@yoopta/file": "^4.6.5-rc.3", + "@yoopta/headings": "^4.6.5-rc.3", + "@yoopta/image": "^4.6.5-rc.3", + "@yoopta/link": "^4.6.5-rc.3", + "@yoopta/link-tool": "^4.6.5-rc.3", + "@yoopta/lists": "^4.6.5-rc.3", + "@yoopta/marks": "^4.6.5-rc.3", + "@yoopta/paragraph": "^4.6.5-rc.3", + "@yoopta/starter-kit": "^4.6.5-rc.3", + "@yoopta/toolbar": "^4.6.5-rc.3", + "@yoopta/video": "^4.6.5-rc.3", "class-variance-authority": "^0.7.0", "classnames": "^2.5.1", "clsx": "^2.1.0", diff --git a/web/next-example/src/components/examples/withStarterKit/index.tsx b/web/next-example/src/components/examples/withStarterKit/index.tsx new file mode 100644 index 000000000..0db8f71c8 --- /dev/null +++ b/web/next-example/src/components/examples/withStarterKit/index.tsx @@ -0,0 +1,55 @@ +import { uploadToCloudinary } from '@/utils/cloudinary'; +import { YooptaContentValue } from '@yoopta/editor'; +import YooptaStarterKit from '@yoopta/starter-kit'; +import { useRef, useState } from 'react'; + +const WithStarterKit = () => { + const [value, setValue] = useState(); + const selectionRef = useRef(null); + + return ( +
+ setValue(data)} + style={{ width: 650 }} + selectionRef={selectionRef} + placeholder="Start typing here..." + media={{ + imageUpload: async (file) => { + const data = await uploadToCloudinary(file, 'image'); + + return { + src: data.secure_url, + alt: 'cloudinary', + sizes: { + width: data.width, + height: data.height, + }, + }; + }, + fileUpload: async (file) => { + const response = await uploadToCloudinary(file, 'auto'); + return { src: response.url, name: response.name }; + }, + videoUpload: async (file) => { + const data = await uploadToCloudinary(file, 'video'); + return { + src: data.secure_url, + alt: 'cloudinary', + sizes: { + width: data.width, + height: data.height, + }, + }; + }, + }} + /> +
+ ); +}; + +export default WithStarterKit; diff --git a/web/next-example/src/pages/examples/[example].tsx b/web/next-example/src/pages/examples/[example].tsx index ec831f1bb..75002fdfa 100644 --- a/web/next-example/src/pages/examples/[example].tsx +++ b/web/next-example/src/pages/examples/[example].tsx @@ -21,6 +21,7 @@ import withCustomStyles from '@/components/examples/withCustomStyles'; import withEditorFocusBlur from '@/components/examples/withEditorFocusBlur'; import withCustomRenders from '@/components/examples/withCustomRenders'; import withMultiPageEditors from '@/components/examples/withMultiPageEditors'; +import WithStarterKit from '@/components/examples/withStarterKit'; import { Head } from '@/components/Head/Head'; import { useRouter } from 'next/router'; @@ -47,9 +48,10 @@ export const EXAMPLES: Record React.JSX.Element> = { withSavingToDatabase, withCustomStyles, withLargeDocuments, + withMultiPageEditors, + WithStarterKit, withChatSlack, withEditorFocusBlur, - withMultiPageEditors, // withCraftExample, // withOffline, // withCustomComponent, @@ -140,6 +142,10 @@ const EXAMPLE_MAP: Record = { title: 'Custom Renders (next/image, next/link, etc.)', description: '', }, + WithStarterKit: { + title: 'Using Starter Kit with full setup', + description: '', + }, }; const ExampleComponentPage = () => { diff --git a/web/next-example/yarn.lock b/web/next-example/yarn.lock index d6d17592e..b82f93bce 100644 --- a/web/next-example/yarn.lock +++ b/web/next-example/yarn.lock @@ -2568,35 +2568,35 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@yoopta/accordion@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/accordion/-/accordion-4.6.4.tgz#7e822d15cd9fb035495a34fb6e69f26f546677c4" - integrity sha512-Ihm691wirRaD28IPTyrEl/WEv9kb5r3U/s4zaqMte87u0ugEeO26axs27GKu4mBtW3boBHYKzSenY35ihSQ5kg== +"@yoopta/accordion@^4.6.5-rc.3", "@yoopta/accordion@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/accordion/-/accordion-4.6.5-rc.3.tgz#5f68a1ce8765fa16c3127cc46becd490d7d6f983" + integrity sha512-vN1sgqSAY2NiCQvkeUncaSaIlUHSPRZrhAhjK5wv3ey0jIUedMAhA/3FO4yFM2fJf0NvOX2TbwYgE+fMrCIBBw== dependencies: lucide-react "^0.378.0" -"@yoopta/action-menu-list@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/action-menu-list/-/action-menu-list-4.6.4.tgz#b3d702a5f7016960cf24e31feb89a360840f6521" - integrity sha512-mAa34H5ld1o4s/CopZ3vRYlMyLPnwVRwkcahbpFyvKop01GQ1wiCBjiOz1scYKnLoX9oBPv0yR8C3Ux9Zdztaw== +"@yoopta/action-menu-list@^4.6.5-rc.3", "@yoopta/action-menu-list@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/action-menu-list/-/action-menu-list-4.6.5-rc.3.tgz#5d8db051d10f37f14327ef789d39429ba559086f" + integrity sha512-kNFFMPo4O3pP9xHpLp1F0U7zFFf8lcYfdSGLTFe6aL0cCBTg27XSUtbKs9MH0e0PuKqK080JgJzl2+udkma+lQ== dependencies: "@floating-ui/react" "^0.26.9" "@radix-ui/react-icons" "^1.3.0" -"@yoopta/blockquote@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/blockquote/-/blockquote-4.6.4.tgz#05ba800592d72cb2ab497036f425ed3ae27cecea" - integrity sha512-PcYDyVDwSFyG5p2kKUUPWIi1c2uqVSSk7jd/Me3TrYCKMVrXVC0bYC/MTQAylZ6VI9I9HKwA45DZ4qy4KU5oGQ== +"@yoopta/blockquote@^4.6.5-rc.3", "@yoopta/blockquote@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/blockquote/-/blockquote-4.6.5-rc.3.tgz#8c38c07f42e6791411741eca0879dddf1aa61e88" + integrity sha512-GQ6/uf3sEDNIn7FT3C/KE+5sRKjSin/h28lXvG4mjK82OhfdHb+0eyAzNQtLD2biUZ15qXetuf1Z7KG5YuDaOA== -"@yoopta/callout@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/callout/-/callout-4.6.4.tgz#9098ee62a0512b5967f52c394597310478a348e0" - integrity sha512-nsuJx6PX+TSHrKhn67WEEaE1sRhWchQP2WTBwzRDZwAvBWt6ZvFfDh3+gzsVO8+a7LHMwXIQv+bAo/13U5OAjQ== +"@yoopta/callout@^4.6.5-rc.3", "@yoopta/callout@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/callout/-/callout-4.6.5-rc.3.tgz#60ce847a26575e85188d2ba0b555ef3d0130fa35" + integrity sha512-MXE1uB7qkthROL/u/l3pKkBmDqKQUrVj2iYJNV4wYGUauL2f9uljVk9CLrjC45CKg1zY7ZE2POxBKtLxsaG3cQ== -"@yoopta/code@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/code/-/code-4.6.4.tgz#f1465940b4b4171f78bcbf4e3b5a338bae364050" - integrity sha512-Z/9LLHW3IZa44uBtw/QnysX2DT6eqdvYmiCgYoYs/Pj4rrXBnd/A+CIG44ixKoVMo7TRSiqjvhBl8hvBqRBrAw== +"@yoopta/code@^4.6.5-rc.3", "@yoopta/code@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/code/-/code-4.6.5-rc.3.tgz#6f3eedb019d55e922faef971c97b2ba4d248510e" + integrity sha512-B672APUtsu0G/Smmvg/+1V0dWrAn9a+KHID3iM1vgLkrgVBrP09755smwtJaoHg93oeNhPuDaH3Loj/fCvVlHQ== dependencies: "@codemirror/lang-angular" "^0.1.3" "@codemirror/lang-cpp" "^6.0.2" @@ -2629,10 +2629,10 @@ codemirror "^6.0.1" copy-to-clipboard "^3.3.3" -"@yoopta/editor@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/editor/-/editor-4.6.4.tgz#9cf851f0ff32d9c56d53a722706680005b929502" - integrity sha512-66BgsCxTf533QEBJOpg2dO9pWnZMuYz6Z8+6xQWLsvkabhLH++RZFvib2aj+drtF3WQOjkvahuDw/FKchOUhAg== +"@yoopta/editor@^4.6.5-rc.3", "@yoopta/editor@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/editor/-/editor-4.6.5-rc.3.tgz#4d48eb1d022b9f7d423bc6fcf879b96518f544f4" + integrity sha512-2jlh+iNe/m6sc23p8h0bcGL+n3WZGoeo8ecHa5hf7nurG+S7curQstmrsaRAPoRiWKHZiuREgNZ3hEKV1/ikcw== dependencies: "@dnd-kit/core" "^6.1.0" "@dnd-kit/sortable" "^8.0.0" @@ -2645,85 +2645,111 @@ lodash.clonedeep "^4.5.0" slate-history "^0.100.0" -"@yoopta/embed@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/embed/-/embed-4.6.4.tgz#56f2c9eba4b5dceeec32d2bb9cb533cdd4918fc8" - integrity sha512-qgPD7MXz7OVMwdg7zeiA2o4tqBDLC1KuAsaS5ZJNrkt+vPg6abKL+Erz+tfCo+eEnVfnVlC9dHfFzsbdt9kXJw== +"@yoopta/embed@^4.6.5-rc.3", "@yoopta/embed@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/embed/-/embed-4.6.5-rc.3.tgz#23e2cf517a5746f104d76a6c61f2263f58903961" + integrity sha512-VI9F1lGGhaaDvsVBSBP1q+mevtP6GHu74OYLRNrxNRgT09EpzjsbU4OoGhAThaQOQ+dok0oXubnZTBVwmaZMvg== dependencies: "@floating-ui/react" "^0.26.9" "@radix-ui/react-icons" "^1.3.0" re-resizable "^6.9.11" -"@yoopta/exports@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/exports/-/exports-4.6.4.tgz#261a6b0f7b0d084669504460c72ef0e358869f73" - integrity sha512-9qPu7R3g+lPm46fN3dyPipLAHbk6+uVH8FOO5LNEsAG2eSAIzy7B96UYH135JJxE7P5PxoXDkBXtjK2QOHjUZg== +"@yoopta/exports@^4.6.5-rc.3", "@yoopta/exports@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/exports/-/exports-4.6.5-rc.3.tgz#efd85edba43b69d957c3e26906fcb34c945bdd3f" + integrity sha512-PDUK/6ocJq6HKXRXyh9paqpDREAQR2ao25r/p2V32HyEpMY9MNqRJBdMDHvuqrXU9jXlJuou6P6xldWXRNTZ0w== dependencies: marked "^13.0.0" -"@yoopta/file@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/file/-/file-4.6.4.tgz#d43edf26552a5223d88f497db93cb93f68b0c5c2" - integrity sha512-QnQeVPBDQcskaIYKNAITblColiba4fMKNgoFd7d+Q1XrAfuegJvdcMNjjTLTUvB7Ob8vfm1FHcIDTEQwl0YDyg== +"@yoopta/file@^4.6.5-rc.3", "@yoopta/file@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/file/-/file-4.6.5-rc.3.tgz#1f01c3b52a0dc79a9d844a672b26fce51d1cda9d" + integrity sha512-sX9W2hattzXVNj2cMiPzAolnEcRDZJLsmKdhXAQPxVL4HWK+ZkMMfh58hpyhgNh7HkuX6YqtymFIGuMdCYc2bw== dependencies: "@floating-ui/react" "^0.26.9" "@radix-ui/react-icons" "^1.3.0" -"@yoopta/headings@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/headings/-/headings-4.6.4.tgz#8c24b7fe7522479ab57eb4a8a5ce2f914d94d984" - integrity sha512-svd3N68Z+Krwjo9ZUYkCFM7l1QUO/PTwxWkBhjQ9Eqr5qDriCiA3SxagW/Qbm6VuucSY+WAhV3wP1fK6Kn76xA== +"@yoopta/headings@^4.6.5-rc.3", "@yoopta/headings@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/headings/-/headings-4.6.5-rc.3.tgz#6c319ab2926259ec27aedf67915215745ba11a93" + integrity sha512-qLb4icngk9VtAHuxt/U+ganwN9PDQ9jGBsYP5acmBsmxLPwMRrqnFTsem1xlr3GfrKaIOFU5psAST/dioSYxFQ== -"@yoopta/image@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/image/-/image-4.6.4.tgz#8a986583a6936397055ed1820d39b957b3bf1075" - integrity sha512-//1m63th5NnSObrBhvQxh3vSbUAKwHcfywFfVcavFjfNgTLvIMY+qv3WthQI/0Aq3gZ0ZWm41QexiuQT3NnOWg== +"@yoopta/image@^4.6.5-rc.3", "@yoopta/image@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/image/-/image-4.6.5-rc.3.tgz#2503b7547aa13242cc2fc3dc50fe2d7480e1bc12" + integrity sha512-LRml2yDOYj9tlTPp59XbZzbQZFrOe1vVRv2AUDa1Y3q/mdy++CdalNrauITn6Pjsj+VnFJ8qW6tV/l+TYs25Lw== dependencies: "@floating-ui/react" "^0.26.9" "@radix-ui/react-icons" "^1.3.0" re-resizable "^6.9.11" -"@yoopta/link-tool@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/link-tool/-/link-tool-4.6.4.tgz#3f867bcdfdc947188b53389b269cbe01ac5c9004" - integrity sha512-66Dm4RlceaHuh+cL1IKred5royFmUSaVP+keMtmfKxz96kPuqFZlYRF9WU2iXUAW0DMv+tXeK6oFzsrnXKG9ew== +"@yoopta/link-tool@^4.6.5-rc.3", "@yoopta/link-tool@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/link-tool/-/link-tool-4.6.5-rc.3.tgz#4a2a284f2ef4dcf64a0682c46b525bf58bc6fcd7" + integrity sha512-XtvwT0wYCAyUzsal703U7SZM9t7hRVAzZ5EI4qtw8QQ3w+wX1fv7ltbVAKODgFRVoCdVf2VT2QPP3q41t05pdg== -"@yoopta/link@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/link/-/link-4.6.4.tgz#6a30dc5ae3c80a1a5980355233ef3309f6f60b46" - integrity sha512-NziIYDIAue7IoNsLdOo2ISrzfAltpKQwb6xRK8duQ3PKTQ0RhpkOeBt+MA480UXg2eDDgJmg+brprS95yaVmJg== +"@yoopta/link@^4.6.5-rc.3", "@yoopta/link@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/link/-/link-4.6.5-rc.3.tgz#25a19b3a54a907ec39a05a9bd935c2b376d7c850" + integrity sha512-66oDwrdnht2obCTqFAdTDYpu9PcPZP5HWTakEJlEQ/52DExcBjm4OnnQEbFlTRzpc2D46SgTqmq3ov2P5BGptw== dependencies: lucide-react "^0.379.0" -"@yoopta/lists@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/lists/-/lists-4.6.4.tgz#1f9d08276fe84cf9d6d399b0247b754577bca0c4" - integrity sha512-jwEql3JdOHMRqOW+26bCTFC+tbSeU5lv0g3wR7w303E0j/7ZljG3vvapmQUBZqYME609e3X8MilNz9GSgzdJYg== - -"@yoopta/marks@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/marks/-/marks-4.6.4.tgz#b0443d4fb74e62f19086d90894996a49af315910" - integrity sha512-ycWhUsZXaEhGVeHVdy+G40HlRJHHA/UUFjt+cXhuo5Pp3pU2OHURDJyzYVtG/PoOt0R5U3MHqI8D4znw5/DimQ== - -"@yoopta/paragraph@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/paragraph/-/paragraph-4.6.4.tgz#00584880f2898bcc1541a4b2ccd126aec3a91d9f" - integrity sha512-7IBpWd6mRI5Frwkd5ptWiNGF/oUBqWjDyAoqh3893REAodEcXwMoxp9XzTqoftiOZVR+yyZxSNaHeoFpoJy44g== - -"@yoopta/toolbar@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/toolbar/-/toolbar-4.6.4.tgz#bc9ad9828424ce697bb5475dfc2e1b24bab7400f" - integrity sha512-3V+L1F/eCGM3wQy6f0Oul4MbmYrJhiTae9esmA85O9GqUVh/62OyKmQXYJ475GTEEXBfWvSJ/Zy+l9XXy/DLnw== +"@yoopta/lists@^4.6.5-rc.3", "@yoopta/lists@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/lists/-/lists-4.6.5-rc.3.tgz#d84011722baef71b37a99762d8a07a790c8ad2b6" + integrity sha512-HarODFVghnKSurgTv5QX37mdo581OXNM7Yyylp0euklkMTv9pwqAncle3k449WZgx2NDOuD1Tih/yBvKgw/ziw== + +"@yoopta/marks@^4.6.5-rc.3", "@yoopta/marks@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/marks/-/marks-4.6.5-rc.3.tgz#b29245931a8d21f8d8b981c1a5db57373471b64b" + integrity sha512-j9q2yb02oGA3tAQCYny70qFxPrqPkBciOFZ/0Me65YwgwVsLNw9d5hYe5/qOdGAn8G9ovyWjZmui8t+wv6jdpw== + +"@yoopta/paragraph@^4.6.5-rc.3", "@yoopta/paragraph@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/paragraph/-/paragraph-4.6.5-rc.3.tgz#f09c2dbef01310515c6b8e70c850d139632b9cd9" + integrity sha512-Wbi3DzYm0I5tteTOjw9rUZJYJujzKkv8K4mYLuLUz2A1bw2t+LoXHpphpo3yRKJ9cFzsU6/nZlk7qRQTRQ5Xjw== + +"@yoopta/starter-kit@^4.6.5-rc.3": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/starter-kit/-/starter-kit-4.6.5-rc.3.tgz#ded0b4fc659f9f41d4173698e716a65b839ce6b1" + integrity sha512-xMCX+Vhi+p0LiamNPn41739MSTP2YPVQHb5hq9ry2fGh3VgVKqk+dw/bTSj+8TkDWBOY33WBuU6jc8GZJwucWA== + dependencies: + "@yoopta/accordion" latest + "@yoopta/action-menu-list" latest + "@yoopta/blockquote" latest + "@yoopta/callout" latest + "@yoopta/code" latest + "@yoopta/editor" latest + "@yoopta/embed" latest + "@yoopta/exports" latest + "@yoopta/file" latest + "@yoopta/headings" latest + "@yoopta/image" latest + "@yoopta/link" latest + "@yoopta/link-tool" latest + "@yoopta/lists" latest + "@yoopta/marks" latest + "@yoopta/paragraph" latest + "@yoopta/toolbar" latest + "@yoopta/video" latest + slate "^0.102.0" + slate-react "^0.102.0" + +"@yoopta/toolbar@^4.6.5-rc.3", "@yoopta/toolbar@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/toolbar/-/toolbar-4.6.5-rc.3.tgz#75fbfd30ee904d97850274069e54b5dd16112a1a" + integrity sha512-T6lIabSCGYaBgBO1pOnGnRcmleNkRHCwRdz/fdjjtCkNdM0Dd0qmldShNBxuqP3gZZQTvlRLXSRo2D0LD61uaQ== dependencies: "@floating-ui/react" "^0.26.9" "@radix-ui/react-icons" "^1.3.0" "@radix-ui/react-toolbar" "^1.0.4" lodash.throttle "^4.1.1" -"@yoopta/video@^4.6.4": - version "4.6.4" - resolved "https://registry.yarnpkg.com/@yoopta/video/-/video-4.6.4.tgz#e5d205d95c4be31e99493ea063ef733c69309f0c" - integrity sha512-iQ1OT4VWcdDpyUAQp/o0wcSGPut6ZiFK8g35mNllhHtGb69jiSX6XzYLTSkFcQV7vghw4CelItR5CUniELMHZA== +"@yoopta/video@^4.6.5-rc.3", "@yoopta/video@latest": + version "4.6.5-rc.3" + resolved "https://registry.yarnpkg.com/@yoopta/video/-/video-4.6.5-rc.3.tgz#22a5436c809f72f2a2d0d76d15e1ba32e53f2411" + integrity sha512-fFqh4Qf44nGqYSWvyGo1cqXxBWBtVcKANSO4ZUsm5TxP3Wgi3BSWR3qc0r9l5ewwPiaLGFz4C6IwggkO26SlFQ== dependencies: "@floating-ui/react" "^0.26.9" "@radix-ui/react-icons" "^1.3.0" diff --git a/yarn.lock b/yarn.lock index 509733662..69969a673 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3798,6 +3798,167 @@ js-yaml "^3.10.0" tslib "^2.4.0" +"@yoopta/accordion@*", "@yoopta/accordion@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/accordion/-/accordion-4.6.4.tgz#7e822d15cd9fb035495a34fb6e69f26f546677c4" + integrity sha512-Ihm691wirRaD28IPTyrEl/WEv9kb5r3U/s4zaqMte87u0ugEeO26axs27GKu4mBtW3boBHYKzSenY35ihSQ5kg== + dependencies: + lucide-react "^0.378.0" + +"@yoopta/action-menu-list@*", "@yoopta/action-menu-list@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/action-menu-list/-/action-menu-list-4.6.4.tgz#b3d702a5f7016960cf24e31feb89a360840f6521" + integrity sha512-mAa34H5ld1o4s/CopZ3vRYlMyLPnwVRwkcahbpFyvKop01GQ1wiCBjiOz1scYKnLoX9oBPv0yR8C3Ux9Zdztaw== + dependencies: + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + +"@yoopta/blockquote@*", "@yoopta/blockquote@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/blockquote/-/blockquote-4.6.4.tgz#05ba800592d72cb2ab497036f425ed3ae27cecea" + integrity sha512-PcYDyVDwSFyG5p2kKUUPWIi1c2uqVSSk7jd/Me3TrYCKMVrXVC0bYC/MTQAylZ6VI9I9HKwA45DZ4qy4KU5oGQ== + +"@yoopta/callout@*", "@yoopta/callout@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/callout/-/callout-4.6.4.tgz#9098ee62a0512b5967f52c394597310478a348e0" + integrity sha512-nsuJx6PX+TSHrKhn67WEEaE1sRhWchQP2WTBwzRDZwAvBWt6ZvFfDh3+gzsVO8+a7LHMwXIQv+bAo/13U5OAjQ== + +"@yoopta/code@*", "@yoopta/code@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/code/-/code-4.6.4.tgz#f1465940b4b4171f78bcbf4e3b5a338bae364050" + integrity sha512-Z/9LLHW3IZa44uBtw/QnysX2DT6eqdvYmiCgYoYs/Pj4rrXBnd/A+CIG44ixKoVMo7TRSiqjvhBl8hvBqRBrAw== + dependencies: + "@codemirror/lang-angular" "^0.1.3" + "@codemirror/lang-cpp" "^6.0.2" + "@codemirror/lang-css" "^6.2.1" + "@codemirror/lang-html" "^6.4.8" + "@codemirror/lang-java" "^6.0.1" + "@codemirror/lang-javascript" "^6.2.2" + "@codemirror/lang-json" "^6.0.1" + "@codemirror/lang-markdown" "^6.2.4" + "@codemirror/lang-php" "^6.0.1" + "@codemirror/lang-python" "^6.1.4" + "@codemirror/lang-rust" "^6.0.1" + "@codemirror/lang-sql" "^6.6.1" + "@codemirror/lang-vue" "^0.1.3" + "@codemirror/lang-xml" "^6.1.0" + "@codemirror/lang-yaml" "^6.0.0" + "@codemirror/theme-one-dark" "^6.1.2" + "@radix-ui/react-select" "^2.0.0" + "@uiw/codemirror-extensions-basic-setup" "^4.21.24" + "@uiw/codemirror-theme-basic" "^4.21.24" + "@uiw/codemirror-theme-copilot" "^4.21.24" + "@uiw/codemirror-theme-dracula" "^4.21.24" + "@uiw/codemirror-theme-github" "^4.21.24" + "@uiw/codemirror-theme-material" "^4.21.24" + "@uiw/codemirror-theme-monokai-dimmed" "^4.21.24" + "@uiw/codemirror-theme-okaidia" "^4.21.24" + "@uiw/codemirror-theme-sublime" "^4.21.24" + "@uiw/codemirror-theme-vscode" "^4.21.24" + "@uiw/react-codemirror" "^4.21.25" + codemirror "^6.0.1" + copy-to-clipboard "^3.3.3" + +"@yoopta/editor@*", "@yoopta/editor@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/editor/-/editor-4.6.4.tgz#9cf851f0ff32d9c56d53a722706680005b929502" + integrity sha512-66BgsCxTf533QEBJOpg2dO9pWnZMuYz6Z8+6xQWLsvkabhLH++RZFvib2aj+drtF3WQOjkvahuDw/FKchOUhAg== + dependencies: + "@dnd-kit/core" "^6.1.0" + "@dnd-kit/sortable" "^8.0.0" + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + copy-to-clipboard "^3.3.3" + eventemitter3 "^5.0.1" + immer "^10.0.3" + is-hotkey "^0.2.0" + lodash.clonedeep "^4.5.0" + slate-history "^0.100.0" + +"@yoopta/embed@*", "@yoopta/embed@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/embed/-/embed-4.6.4.tgz#56f2c9eba4b5dceeec32d2bb9cb533cdd4918fc8" + integrity sha512-qgPD7MXz7OVMwdg7zeiA2o4tqBDLC1KuAsaS5ZJNrkt+vPg6abKL+Erz+tfCo+eEnVfnVlC9dHfFzsbdt9kXJw== + dependencies: + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + re-resizable "^6.9.11" + +"@yoopta/exports@*", "@yoopta/exports@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/exports/-/exports-4.6.4.tgz#261a6b0f7b0d084669504460c72ef0e358869f73" + integrity sha512-9qPu7R3g+lPm46fN3dyPipLAHbk6+uVH8FOO5LNEsAG2eSAIzy7B96UYH135JJxE7P5PxoXDkBXtjK2QOHjUZg== + dependencies: + marked "^13.0.0" + +"@yoopta/file@*", "@yoopta/file@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/file/-/file-4.6.4.tgz#d43edf26552a5223d88f497db93cb93f68b0c5c2" + integrity sha512-QnQeVPBDQcskaIYKNAITblColiba4fMKNgoFd7d+Q1XrAfuegJvdcMNjjTLTUvB7Ob8vfm1FHcIDTEQwl0YDyg== + dependencies: + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + +"@yoopta/headings@*", "@yoopta/headings@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/headings/-/headings-4.6.4.tgz#8c24b7fe7522479ab57eb4a8a5ce2f914d94d984" + integrity sha512-svd3N68Z+Krwjo9ZUYkCFM7l1QUO/PTwxWkBhjQ9Eqr5qDriCiA3SxagW/Qbm6VuucSY+WAhV3wP1fK6Kn76xA== + +"@yoopta/image@*", "@yoopta/image@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/image/-/image-4.6.4.tgz#8a986583a6936397055ed1820d39b957b3bf1075" + integrity sha512-//1m63th5NnSObrBhvQxh3vSbUAKwHcfywFfVcavFjfNgTLvIMY+qv3WthQI/0Aq3gZ0ZWm41QexiuQT3NnOWg== + dependencies: + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + re-resizable "^6.9.11" + +"@yoopta/link-tool@*", "@yoopta/link-tool@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/link-tool/-/link-tool-4.6.4.tgz#3f867bcdfdc947188b53389b269cbe01ac5c9004" + integrity sha512-66Dm4RlceaHuh+cL1IKred5royFmUSaVP+keMtmfKxz96kPuqFZlYRF9WU2iXUAW0DMv+tXeK6oFzsrnXKG9ew== + +"@yoopta/link@*", "@yoopta/link@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/link/-/link-4.6.4.tgz#6a30dc5ae3c80a1a5980355233ef3309f6f60b46" + integrity sha512-NziIYDIAue7IoNsLdOo2ISrzfAltpKQwb6xRK8duQ3PKTQ0RhpkOeBt+MA480UXg2eDDgJmg+brprS95yaVmJg== + dependencies: + lucide-react "^0.379.0" + +"@yoopta/lists@*", "@yoopta/lists@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/lists/-/lists-4.6.4.tgz#1f9d08276fe84cf9d6d399b0247b754577bca0c4" + integrity sha512-jwEql3JdOHMRqOW+26bCTFC+tbSeU5lv0g3wR7w303E0j/7ZljG3vvapmQUBZqYME609e3X8MilNz9GSgzdJYg== + +"@yoopta/marks@*", "@yoopta/marks@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/marks/-/marks-4.6.4.tgz#b0443d4fb74e62f19086d90894996a49af315910" + integrity sha512-ycWhUsZXaEhGVeHVdy+G40HlRJHHA/UUFjt+cXhuo5Pp3pU2OHURDJyzYVtG/PoOt0R5U3MHqI8D4znw5/DimQ== + +"@yoopta/paragraph@*", "@yoopta/paragraph@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/paragraph/-/paragraph-4.6.4.tgz#00584880f2898bcc1541a4b2ccd126aec3a91d9f" + integrity sha512-7IBpWd6mRI5Frwkd5ptWiNGF/oUBqWjDyAoqh3893REAodEcXwMoxp9XzTqoftiOZVR+yyZxSNaHeoFpoJy44g== + +"@yoopta/toolbar@*", "@yoopta/toolbar@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/toolbar/-/toolbar-4.6.4.tgz#bc9ad9828424ce697bb5475dfc2e1b24bab7400f" + integrity sha512-3V+L1F/eCGM3wQy6f0Oul4MbmYrJhiTae9esmA85O9GqUVh/62OyKmQXYJ475GTEEXBfWvSJ/Zy+l9XXy/DLnw== + dependencies: + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + "@radix-ui/react-toolbar" "^1.0.4" + lodash.throttle "^4.1.1" + +"@yoopta/video@*", "@yoopta/video@latest": + version "4.6.4" + resolved "https://registry.yarnpkg.com/@yoopta/video/-/video-4.6.4.tgz#e5d205d95c4be31e99493ea063ef733c69309f0c" + integrity sha512-iQ1OT4VWcdDpyUAQp/o0wcSGPut6ZiFK8g35mNllhHtGb69jiSX6XzYLTSkFcQV7vghw4CelItR5CUniELMHZA== + dependencies: + "@floating-ui/react" "^0.26.9" + "@radix-ui/react-icons" "^1.3.0" + re-resizable "^6.9.11" + "@zkochan/js-yaml@0.0.6": version "0.0.6" resolved "https://registry.yarnpkg.com/@zkochan/js-yaml/-/js-yaml-0.0.6.tgz#975f0b306e705e28b8068a07737fa46d3fc04826"