@liveblocks/react-tiptap 3.9.2 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LiveblocksExtension.cjs +4 -4
- package/dist/LiveblocksExtension.cjs.map +1 -1
- package/dist/LiveblocksExtension.js +4 -4
- package/dist/LiveblocksExtension.js.map +1 -1
- package/dist/ai/AiExtension.cjs.map +1 -1
- package/dist/ai/AiExtension.js.map +1 -1
- package/dist/ai/AiToolbar.cjs.map +1 -1
- package/dist/ai/AiToolbar.js.map +1 -1
- package/dist/comments/AnchoredThreads.cjs +1 -1
- package/dist/comments/AnchoredThreads.cjs.map +1 -1
- package/dist/comments/AnchoredThreads.js +1 -1
- package/dist/comments/AnchoredThreads.js.map +1 -1
- package/dist/comments/CommentsExtension.cjs +0 -3
- package/dist/comments/CommentsExtension.cjs.map +1 -1
- package/dist/comments/CommentsExtension.js +0 -3
- package/dist/comments/CommentsExtension.js.map +1 -1
- package/dist/comments/FloatingComposer.cjs +7 -3
- package/dist/comments/FloatingComposer.cjs.map +1 -1
- package/dist/comments/FloatingComposer.js +7 -3
- package/dist/comments/FloatingComposer.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -4
- package/dist/index.d.ts +165 -4
- package/dist/index.js.map +1 -1
- package/dist/mentions/GroupMentionNode.cjs.map +1 -1
- package/dist/mentions/GroupMentionNode.js.map +1 -1
- package/dist/mentions/Mention.cjs +37 -46
- package/dist/mentions/Mention.cjs.map +1 -1
- package/dist/mentions/Mention.js +36 -45
- package/dist/mentions/Mention.js.map +1 -1
- package/dist/mentions/MentionNode.cjs.map +1 -1
- package/dist/mentions/MentionNode.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/version-history/HistoryVersionPreview.cjs +1 -0
- package/dist/version-history/HistoryVersionPreview.cjs.map +1 -1
- package/dist/version-history/HistoryVersionPreview.js +1 -0
- package/dist/version-history/HistoryVersionPreview.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +14 -14
- package/src/styles/index.css +3 -2
- package/styles.css +1 -1
- package/styles.css.map +1 -1
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../src/types.ts"],"sourcesContent":["import type {\n ContextualPromptContext,\n ContextualPromptResponse,\n MentionData,\n Relax,\n TextEditorType,\n ThreadData,\n} from \"@liveblocks/core\";\nimport type { LiveblocksYjsProvider } from \"@liveblocks/yjs\";\nimport type { Content, Range } from \"@tiptap/core\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\nimport type { ChainedCommands, SingleCommands } from \"@tiptap/react\";\nimport type { ProsemirrorBinding } from \"y-prosemirror\";\nimport type { Doc, PermanentUserData, Snapshot } from \"yjs\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\n\nexport const LIVEBLOCKS_MENTION_EXTENSION = \"liveblocksMentionExt\";\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\nexport const LIVEBLOCKS_GROUP_MENTION_TYPE = \"liveblocksGroupMention\";\n\nexport const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(\n \"lb-threads-active-selection-plugin\"\n);\nexport const THREADS_PLUGIN_KEY = new PluginKey<ThreadPluginState>(\n \"lb-threads-plugin\"\n);\nexport const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(\n \"lb-ai-toolbar-selection-plugin\"\n);\n\nexport const LIVEBLOCKS_COMMENT_MARK_TYPE = \"liveblocksCommentMark\";\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptArgs = {\n /**\n * The prompt being requested by the user.\n */\n prompt: string;\n\n /**\n * The context of the document and its current selection.\n */\n context: ContextualPromptContext;\n\n /**\n * The previous request and its response, if this is a follow-up request.\n */\n previous?: {\n prompt: string;\n response: ContextualPromptResponse;\n };\n\n /**\n * An abort signal that can be used to cancel requests.\n */\n signal: AbortSignal;\n};\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptResponse = ContextualPromptResponse;\n\nexport interface AiConfiguration {\n /**\n * The AI's name. (\"Ask {name} anything…\", \"{name} is thinking…\", etc)\n */\n name?: string;\n\n /**\n * A function that returns an a response to a contextual prompt.\n */\n resolveContextualPrompt?: (\n args: ResolveContextualPromptArgs\n ) => Promise<ContextualPromptResponse>;\n}\n\nexport type LiveblocksExtensionOptions = {\n field?: string;\n comments?: boolean; // | CommentsConfiguration\n mentions?: boolean; // | MentionsConfiguration\n ai?: boolean | AiConfiguration;\n offlineSupport_experimental?: boolean;\n threads_experimental?: ThreadData[];\n initialContent?: Content;\n enablePermanentUserData?: boolean;\n /**\n * @internal\n * For reporting another text editor type from a\n * text editor extended from `TipTap` such as our `BlockNote` integration.\n *\n * Only useful for Liveblocks developers, not for end users.\n */\n textEditorType?: TextEditorType;\n};\n\nexport type LiveblocksExtensionStorage = {\n unsubs: (() => void)[];\n doc: Doc;\n provider: LiveblocksYjsProvider;\n permanentUserData?: PermanentUserData;\n};\n\nexport type CommentsExtensionStorage = {\n pendingComment: boolean;\n};\n\nexport const enum ThreadPluginActions {\n SET_SELECTED_THREAD_ID = \"SET_SELECTED_THREAD_ID\",\n}\n\nexport type AiExtensionOptions = Required<\n Pick<AiConfiguration, \"name\" | \"resolveContextualPrompt\">\n> & {\n doc: Doc | undefined;\n pud: PermanentUserData | undefined;\n};\n\n/**\n * The state of the AI toolbar.\n *\n * ┌────────────────────────────────────────────────────────────────────────────────┐\n * │ │\n * │ ┌──────────────────────────────────────────────┐ │\n * ▼ ▼ │ │\n * ┌───────$closeAiToolbar()───────┐ │ │\n * ▼ ◇ ◇ ◇\n * ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐\n * │ CLOSED │ │ ASKING │ │ THINKING │ │ REVIEWING │\n * └───────────────────────┘ └───────────────────────┘ └───────────────────────┘ └───────────────────────┘\n * ▲ ◇ ◇ ▲ ▲ ◇ ▲ ▲ ◇ ▲ ◇ ◇\n * │ │ └───$openAiToolbarAsking()──┘ │ │ └ ─ ─ ─ ─ ─ ─⚠─ ─ ─ ─ ─ ─ ─│─├── ─ ─ ─ ─ ─ ─✓─ ─ ─ ─ ─ ─ ─ ┘ │ │\n * │ │ │ ▼ │ │ │ │\n * │ └─────────────────$startAiToolbarThinking(prompt)──────────────┘ │ │ │\n * │ │ ▲ │ │ │\n * │ │ └──────────────────────────────┼───────────────────────────────┘ │\n * │ │ │ │\n * │ └───$cancelAiToolbarThinking()───┘ │\n * │ │\n * └─────────────────────────────────────$acceptAiToolbarResponse()─────────────────────────────────────┘\n *\n */\nexport type AiToolbarState = Relax<\n | {\n phase: \"closed\";\n }\n | {\n phase: \"asking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * A potential error that occurred during the last AI request.\n */\n error?: Error;\n }\n | {\n phase: \"thinking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * An abort controller to cancel the AI request.\n */\n abortController: AbortController;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The previous response if this \"thinking\" phase is a refinement.\n */\n previousResponse?: ContextualPromptResponse;\n }\n | {\n phase: \"reviewing\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The response of the AI request.\n */\n response: ContextualPromptResponse;\n }\n>;\n\nexport type AiExtensionStorage = {\n name: string;\n state: AiToolbarState;\n snapshot?: Snapshot;\n};\n\nexport type ThreadPluginState = {\n threadPositions: Map<string, { from: number; to: number }>;\n selectedThreadId: string | null;\n selectedThreadPos: number | null;\n decorations: DecorationSet;\n};\n\nexport type FloatingPosition = \"top\" | \"bottom\";\n\nexport type ExtendedCommands<\n T extends string,\n A extends any[] = [],\n> = SingleCommands & Record<T, (...args: A) => boolean>;\n\nexport type ExtendedChainedCommands<\n T extends string,\n A extends any[] = [],\n> = ChainedCommands & Record<T, (...args: A) => ChainedCommands>;\n\nexport type ChainedAiCommands = ChainedCommands & {\n [K in keyof AiCommands]: (\n ...args: Parameters<AiCommands[K]>\n ) => ChainedCommands;\n};\n\nexport type CommentsCommands<ReturnType = boolean> = {\n /**\n * Add a comment\n */\n addComment: (id: string) => ReturnType;\n selectThread: (id: string | null) => ReturnType;\n addPendingComment: () => ReturnType;\n\n /** @internal */\n closePendingComment: () => ReturnType;\n};\n\nexport type AiCommands<ReturnType = boolean> = {\n /**\n * Open the AI toolbar, with an optional prompt.\n */\n askAi: (prompt?: string) => ReturnType;\n\n /**\n * Close the AI toolbar.\n */\n closeAi: () => ReturnType;\n\n // Transitions (see AiToolbarState)\n\n /**\n * @internal\n * @transition\n *\n * Close the AI toolbar.\n */\n $closeAiToolbar: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Accept the current AI response and close the AI toolbar.\n */\n $acceptAiToolbarResponse: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Open the AI toolbar in the \"asking\" phase.\n */\n $openAiToolbarAsking: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Set (and open if not already open) the AI toolbar in the \"thinking\" phase with the given prompt.\n */\n $startAiToolbarThinking: (\n prompt: string,\n withPreviousResponse?: boolean\n ) => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Cancel the current \"thinking\" phase, going back to the \"asking\" phase.\n */\n $cancelAiToolbarThinking: () => ReturnType;\n\n // Other\n\n /**\n * @internal\n *\n * Show the diff of the current \"reviewing\" phase.\n */\n _showAiToolbarReviewingDiff: () => ReturnType;\n\n /**\n * @internal\n *\n * Handle the success of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingSuccess: (\n response: ContextualPromptResponse\n ) => ReturnType;\n\n /**\n * @internal\n *\n * Handle an error of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingError: (error: unknown) => ReturnType;\n\n /**\n * @internal\n *\n * Update the current custom AI prompt.\n */\n _updateAiToolbarCustomPrompt: (\n customPrompt: string | ((currentCustomPrompt: string) => string)\n ) => ReturnType;\n};\n\nexport type YSyncPluginState = {\n binding: ProsemirrorBinding;\n};\n\nexport type TiptapMentionData = MentionData & {\n notificationId: string;\n};\n\nexport type SerializedTiptapMentionData = TiptapMentionData extends infer T\n ? T extends { kind: \"group\" }\n ? Omit<T, \"userIds\"> & { userIds?: string }\n : T\n : never;\n"],"names":["PluginKey","ThreadPluginActions"],"mappings":";;;;AAgBa,MAAA,sBAAA,GAAyB,IAAIA,eAAA,CAAU,mBAAmB,EAAA;AAChE,MAAM,+BAA+B,IAAIA,eAAA;AAAA,EAC9C,yBAAA;AACF,EAAA;AACO,MAAM,kCAAkC,IAAIA,eAAA;AAAA,EACjD,0BAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,uBAAA;AACrC,MAAM,uBAA0B,GAAA,oBAAA;AAChC,MAAM,6BAAgC,GAAA,yBAAA;AAEtC,MAAM,kCAAkC,IAAIA,eAAA;AAAA,EACjD,oCAAA;AACF,EAAA;AACO,MAAM,qBAAqB,IAAIA,eAAA;AAAA,EACpC,mBAAA;AACF,EAAA;AACO,MAAM,8BAA8B,IAAIA,eAAA;AAAA,EAC7C,gCAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,wBAAA;AA+E1B,IAAA,mBAAA,qBAAAC,oBAAX,KAAA;AACL,EAAAA,qBAAA,wBAAyB,CAAA,GAAA,wBAAA,CAAA;AADT,EAAAA,OAAAA,oBAAAA,CAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../src/types.ts"],"sourcesContent":["import type {\n ContextualPromptContext,\n ContextualPromptResponse,\n MentionData,\n Relax,\n TextEditorType,\n ThreadData,\n} from \"@liveblocks/core\";\nimport type { LiveblocksYjsProvider } from \"@liveblocks/yjs\";\nimport type { Content, Range } from \"@tiptap/core\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\nimport type { ChainedCommands, SingleCommands } from \"@tiptap/react\";\nimport type { ProsemirrorBinding } from \"y-prosemirror\";\nimport type { Doc, PermanentUserData, Snapshot } from \"yjs\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\n\nexport const LIVEBLOCKS_MENTION_EXTENSION = \"liveblocksMentionExt\";\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\nexport const LIVEBLOCKS_GROUP_MENTION_TYPE = \"liveblocksGroupMention\";\n\nexport const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(\n \"lb-threads-active-selection-plugin\"\n);\nexport const THREADS_PLUGIN_KEY = new PluginKey<ThreadPluginState>(\n \"lb-threads-plugin\"\n);\nexport const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(\n \"lb-ai-toolbar-selection-plugin\"\n);\n\nexport const LIVEBLOCKS_COMMENT_MARK_TYPE = \"liveblocksCommentMark\";\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptArgs = {\n /**\n * The prompt being requested by the user.\n */\n prompt: string;\n\n /**\n * The context of the document and its current selection.\n */\n context: ContextualPromptContext;\n\n /**\n * The previous request and its response, if this is a follow-up request.\n */\n previous?: {\n prompt: string;\n response: ContextualPromptResponse;\n };\n\n /**\n * An abort signal that can be used to cancel requests.\n */\n signal: AbortSignal;\n};\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptResponse = ContextualPromptResponse;\n\nexport interface AiConfiguration {\n /**\n * The AI's name. (\"Ask {name} anything…\", \"{name} is thinking…\", etc)\n */\n name?: string;\n\n /**\n * A function that returns an a response to a contextual prompt.\n */\n resolveContextualPrompt?: (\n args: ResolveContextualPromptArgs\n ) => Promise<ContextualPromptResponse>;\n}\n\nexport type LiveblocksExtensionOptions = {\n field?: string;\n comments?: boolean; // | CommentsConfiguration\n mentions?: boolean; // | MentionsConfiguration\n ai?: boolean | AiConfiguration;\n offlineSupport_experimental?: boolean;\n threads_experimental?: ThreadData[];\n initialContent?: Content;\n enablePermanentUserData?: boolean;\n /**\n * @internal\n * For reporting another text editor type from a\n * text editor extended from `TipTap` such as our `BlockNote` integration.\n *\n * Only useful for Liveblocks developers, not for end users.\n */\n textEditorType?: TextEditorType;\n};\n\nexport type LiveblocksExtensionStorage = {\n unsubs: (() => void)[];\n doc: Doc;\n provider: LiveblocksYjsProvider;\n permanentUserData?: PermanentUserData;\n};\n\nexport type CommentsExtensionStorage = {\n pendingComment: boolean;\n};\n\nexport const enum ThreadPluginActions {\n SET_SELECTED_THREAD_ID = \"SET_SELECTED_THREAD_ID\",\n}\n\nexport type AiExtensionOptions = Required<\n Pick<AiConfiguration, \"name\" | \"resolveContextualPrompt\">\n> & {\n doc: Doc | undefined;\n pud: PermanentUserData | undefined;\n};\n\n/**\n * The state of the AI toolbar.\n *\n * ┌────────────────────────────────────────────────────────────────────────────────┐\n * │ │\n * │ ┌──────────────────────────────────────────────┐ │\n * ▼ ▼ │ │\n * ┌───────$closeAiToolbar()───────┐ │ │\n * ▼ ◇ ◇ ◇\n * ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐\n * │ CLOSED │ │ ASKING │ │ THINKING │ │ REVIEWING │\n * └───────────────────────┘ └───────────────────────┘ └───────────────────────┘ └───────────────────────┘\n * ▲ ◇ ◇ ▲ ▲ ◇ ▲ ▲ ◇ ▲ ◇ ◇\n * │ │ └───$openAiToolbarAsking()──┘ │ │ └ ─ ─ ─ ─ ─ ─⚠─ ─ ─ ─ ─ ─ ─│─├── ─ ─ ─ ─ ─ ─✓─ ─ ─ ─ ─ ─ ─ ┘ │ │\n * │ │ │ ▼ │ │ │ │\n * │ └─────────────────$startAiToolbarThinking(prompt)──────────────┘ │ │ │\n * │ │ ▲ │ │ │\n * │ │ └──────────────────────────────┼───────────────────────────────┘ │\n * │ │ │ │\n * │ └───$cancelAiToolbarThinking()───┘ │\n * │ │\n * └─────────────────────────────────────$acceptAiToolbarResponse()─────────────────────────────────────┘\n *\n */\nexport type AiToolbarState = Relax<\n | {\n phase: \"closed\";\n }\n | {\n phase: \"asking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * A potential error that occurred during the last AI request.\n */\n error?: Error;\n }\n | {\n phase: \"thinking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * An abort controller to cancel the AI request.\n */\n abortController: AbortController;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The previous response if this \"thinking\" phase is a refinement.\n */\n previousResponse?: ContextualPromptResponse;\n }\n | {\n phase: \"reviewing\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The response of the AI request.\n */\n response: ContextualPromptResponse;\n }\n>;\n\nexport type AiExtensionStorage = {\n name: string;\n state: AiToolbarState;\n snapshot?: Snapshot;\n};\n\ndeclare module \"@tiptap/core\" {\n interface Storage {\n liveblocksAi: AiExtensionStorage;\n liveblocksExtension: LiveblocksExtensionStorage;\n liveblocksComments: CommentsExtensionStorage;\n }\n // TODO: this is already defined in collaboration-caret, we shouldn't need it, but something isn't working\n // maybe because we use configure?\n interface Commands<ReturnType> {\n collaborationCaret: {\n /**\n * Update details of the current user\n * @example editor.commands.updateUser({ name: 'John Doe', color: '#305500' })\n */\n updateUser: (attributes: Record<string, any>) => ReturnType;\n /**\n * Update details of the current user\n *\n * @deprecated The \"user\" command is deprecated. Please use \"updateUser\" instead. Read more: https://tiptap.dev/api/extensions/collaboration-caret\n */\n user: (attributes: Record<string, any>) => ReturnType;\n };\n\n collaboration: {\n /**\n * Undo recent changes\n * @example editor.commands.undo()\n */\n undo: () => ReturnType;\n /**\n * Reapply reverted changes\n * @example editor.commands.redo()\n */\n redo: () => ReturnType;\n };\n }\n}\nexport type ThreadPluginState = {\n threadPositions: Map<string, { from: number; to: number }>;\n selectedThreadId: string | null;\n selectedThreadPos: number | null;\n decorations: DecorationSet;\n};\n\nexport type FloatingPosition = \"top\" | \"bottom\";\n\nexport type ExtendedCommands<\n T extends string,\n A extends any[] = [],\n> = SingleCommands & Record<T, (...args: A) => boolean>;\n\nexport type ExtendedChainedCommands<\n T extends string,\n A extends any[] = [],\n> = ChainedCommands & Record<T, (...args: A) => ChainedCommands>;\n\nexport type ChainedAiCommands = ChainedCommands & {\n [K in keyof AiCommands]: (\n ...args: Parameters<AiCommands[K]>\n ) => ChainedCommands;\n};\n\nexport type CommentsCommands<ReturnType = boolean> = {\n /**\n * Add a comment\n */\n addComment: (id: string) => ReturnType;\n selectThread: (id: string | null) => ReturnType;\n addPendingComment: () => ReturnType;\n\n /** @internal */\n closePendingComment: () => ReturnType;\n};\n\nexport type AiCommands<ReturnType = boolean> = {\n /**\n * Open the AI toolbar, with an optional prompt.\n */\n askAi: (prompt?: string) => ReturnType;\n\n /**\n * Close the AI toolbar.\n */\n closeAi: () => ReturnType;\n\n // Transitions (see AiToolbarState)\n\n /**\n * @internal\n * @transition\n *\n * Close the AI toolbar.\n */\n $closeAiToolbar: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Accept the current AI response and close the AI toolbar.\n */\n $acceptAiToolbarResponse: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Open the AI toolbar in the \"asking\" phase.\n */\n $openAiToolbarAsking: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Set (and open if not already open) the AI toolbar in the \"thinking\" phase with the given prompt.\n */\n $startAiToolbarThinking: (\n prompt: string,\n withPreviousResponse?: boolean\n ) => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Cancel the current \"thinking\" phase, going back to the \"asking\" phase.\n */\n $cancelAiToolbarThinking: () => ReturnType;\n\n // Other\n\n /**\n * @internal\n *\n * Show the diff of the current \"reviewing\" phase.\n */\n _showAiToolbarReviewingDiff: () => ReturnType;\n\n /**\n * @internal\n *\n * Handle the success of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingSuccess: (\n response: ContextualPromptResponse\n ) => ReturnType;\n\n /**\n * @internal\n *\n * Handle an error of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingError: (error: unknown) => ReturnType;\n\n /**\n * @internal\n *\n * Update the current custom AI prompt.\n */\n _updateAiToolbarCustomPrompt: (\n customPrompt: string | ((currentCustomPrompt: string) => string)\n ) => ReturnType;\n};\n\nexport type YSyncPluginState = {\n binding: ProsemirrorBinding;\n};\n\nexport type TiptapMentionData = MentionData & {\n notificationId: string;\n};\n\nexport type SerializedTiptapMentionData = TiptapMentionData extends infer T\n ? T extends { kind: \"group\" }\n ? Omit<T, \"userIds\"> & { userIds?: string }\n : T\n : never;\n"],"names":["PluginKey","ThreadPluginActions"],"mappings":";;;;AAgBa,MAAA,sBAAA,GAAyB,IAAIA,eAAA,CAAU,mBAAmB,EAAA;AAChE,MAAM,+BAA+B,IAAIA,eAAA;AAAA,EAC9C,yBAAA;AACF,EAAA;AACO,MAAM,kCAAkC,IAAIA,eAAA;AAAA,EACjD,0BAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,uBAAA;AACrC,MAAM,uBAA0B,GAAA,oBAAA;AAChC,MAAM,6BAAgC,GAAA,yBAAA;AAEtC,MAAM,kCAAkC,IAAIA,eAAA;AAAA,EACjD,oCAAA;AACF,EAAA;AACO,MAAM,qBAAqB,IAAIA,eAAA;AAAA,EACpC,mBAAA;AACF,EAAA;AACO,MAAM,8BAA8B,IAAIA,eAAA;AAAA,EAC7C,gCAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,wBAAA;AA+E1B,IAAA,mBAAA,qBAAAC,oBAAX,KAAA;AACL,EAAAA,qBAAA,wBAAyB,CAAA,GAAA,wBAAA,CAAA;AADT,EAAAA,OAAAA,oBAAAA,CAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;;;;;;;;;;;;;;"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n ContextualPromptContext,\n ContextualPromptResponse,\n MentionData,\n Relax,\n TextEditorType,\n ThreadData,\n} from \"@liveblocks/core\";\nimport type { LiveblocksYjsProvider } from \"@liveblocks/yjs\";\nimport type { Content, Range } from \"@tiptap/core\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\nimport type { ChainedCommands, SingleCommands } from \"@tiptap/react\";\nimport type { ProsemirrorBinding } from \"y-prosemirror\";\nimport type { Doc, PermanentUserData, Snapshot } from \"yjs\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\n\nexport const LIVEBLOCKS_MENTION_EXTENSION = \"liveblocksMentionExt\";\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\nexport const LIVEBLOCKS_GROUP_MENTION_TYPE = \"liveblocksGroupMention\";\n\nexport const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(\n \"lb-threads-active-selection-plugin\"\n);\nexport const THREADS_PLUGIN_KEY = new PluginKey<ThreadPluginState>(\n \"lb-threads-plugin\"\n);\nexport const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(\n \"lb-ai-toolbar-selection-plugin\"\n);\n\nexport const LIVEBLOCKS_COMMENT_MARK_TYPE = \"liveblocksCommentMark\";\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptArgs = {\n /**\n * The prompt being requested by the user.\n */\n prompt: string;\n\n /**\n * The context of the document and its current selection.\n */\n context: ContextualPromptContext;\n\n /**\n * The previous request and its response, if this is a follow-up request.\n */\n previous?: {\n prompt: string;\n response: ContextualPromptResponse;\n };\n\n /**\n * An abort signal that can be used to cancel requests.\n */\n signal: AbortSignal;\n};\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptResponse = ContextualPromptResponse;\n\nexport interface AiConfiguration {\n /**\n * The AI's name. (\"Ask {name} anything…\", \"{name} is thinking…\", etc)\n */\n name?: string;\n\n /**\n * A function that returns an a response to a contextual prompt.\n */\n resolveContextualPrompt?: (\n args: ResolveContextualPromptArgs\n ) => Promise<ContextualPromptResponse>;\n}\n\nexport type LiveblocksExtensionOptions = {\n field?: string;\n comments?: boolean; // | CommentsConfiguration\n mentions?: boolean; // | MentionsConfiguration\n ai?: boolean | AiConfiguration;\n offlineSupport_experimental?: boolean;\n threads_experimental?: ThreadData[];\n initialContent?: Content;\n enablePermanentUserData?: boolean;\n /**\n * @internal\n * For reporting another text editor type from a\n * text editor extended from `TipTap` such as our `BlockNote` integration.\n *\n * Only useful for Liveblocks developers, not for end users.\n */\n textEditorType?: TextEditorType;\n};\n\nexport type LiveblocksExtensionStorage = {\n unsubs: (() => void)[];\n doc: Doc;\n provider: LiveblocksYjsProvider;\n permanentUserData?: PermanentUserData;\n};\n\nexport type CommentsExtensionStorage = {\n pendingComment: boolean;\n};\n\nexport const enum ThreadPluginActions {\n SET_SELECTED_THREAD_ID = \"SET_SELECTED_THREAD_ID\",\n}\n\nexport type AiExtensionOptions = Required<\n Pick<AiConfiguration, \"name\" | \"resolveContextualPrompt\">\n> & {\n doc: Doc | undefined;\n pud: PermanentUserData | undefined;\n};\n\n/**\n * The state of the AI toolbar.\n *\n * ┌────────────────────────────────────────────────────────────────────────────────┐\n * │ │\n * │ ┌──────────────────────────────────────────────┐ │\n * ▼ ▼ │ │\n * ┌───────$closeAiToolbar()───────┐ │ │\n * ▼ ◇ ◇ ◇\n * ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐\n * │ CLOSED │ │ ASKING │ │ THINKING │ │ REVIEWING │\n * └───────────────────────┘ └───────────────────────┘ └───────────────────────┘ └───────────────────────┘\n * ▲ ◇ ◇ ▲ ▲ ◇ ▲ ▲ ◇ ▲ ◇ ◇\n * │ │ └───$openAiToolbarAsking()──┘ │ │ └ ─ ─ ─ ─ ─ ─⚠─ ─ ─ ─ ─ ─ ─│─├── ─ ─ ─ ─ ─ ─✓─ ─ ─ ─ ─ ─ ─ ┘ │ │\n * │ │ │ ▼ │ │ │ │\n * │ └─────────────────$startAiToolbarThinking(prompt)──────────────┘ │ │ │\n * │ │ ▲ │ │ │\n * │ │ └──────────────────────────────┼───────────────────────────────┘ │\n * │ │ │ │\n * │ └───$cancelAiToolbarThinking()───┘ │\n * │ │\n * └─────────────────────────────────────$acceptAiToolbarResponse()─────────────────────────────────────┘\n *\n */\nexport type AiToolbarState = Relax<\n | {\n phase: \"closed\";\n }\n | {\n phase: \"asking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * A potential error that occurred during the last AI request.\n */\n error?: Error;\n }\n | {\n phase: \"thinking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * An abort controller to cancel the AI request.\n */\n abortController: AbortController;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The previous response if this \"thinking\" phase is a refinement.\n */\n previousResponse?: ContextualPromptResponse;\n }\n | {\n phase: \"reviewing\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The response of the AI request.\n */\n response: ContextualPromptResponse;\n }\n>;\n\nexport type AiExtensionStorage = {\n name: string;\n state: AiToolbarState;\n snapshot?: Snapshot;\n};\n\nexport type ThreadPluginState = {\n threadPositions: Map<string, { from: number; to: number }>;\n selectedThreadId: string | null;\n selectedThreadPos: number | null;\n decorations: DecorationSet;\n};\n\nexport type FloatingPosition = \"top\" | \"bottom\";\n\nexport type ExtendedCommands<\n T extends string,\n A extends any[] = [],\n> = SingleCommands & Record<T, (...args: A) => boolean>;\n\nexport type ExtendedChainedCommands<\n T extends string,\n A extends any[] = [],\n> = ChainedCommands & Record<T, (...args: A) => ChainedCommands>;\n\nexport type ChainedAiCommands = ChainedCommands & {\n [K in keyof AiCommands]: (\n ...args: Parameters<AiCommands[K]>\n ) => ChainedCommands;\n};\n\nexport type CommentsCommands<ReturnType = boolean> = {\n /**\n * Add a comment\n */\n addComment: (id: string) => ReturnType;\n selectThread: (id: string | null) => ReturnType;\n addPendingComment: () => ReturnType;\n\n /** @internal */\n closePendingComment: () => ReturnType;\n};\n\nexport type AiCommands<ReturnType = boolean> = {\n /**\n * Open the AI toolbar, with an optional prompt.\n */\n askAi: (prompt?: string) => ReturnType;\n\n /**\n * Close the AI toolbar.\n */\n closeAi: () => ReturnType;\n\n // Transitions (see AiToolbarState)\n\n /**\n * @internal\n * @transition\n *\n * Close the AI toolbar.\n */\n $closeAiToolbar: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Accept the current AI response and close the AI toolbar.\n */\n $acceptAiToolbarResponse: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Open the AI toolbar in the \"asking\" phase.\n */\n $openAiToolbarAsking: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Set (and open if not already open) the AI toolbar in the \"thinking\" phase with the given prompt.\n */\n $startAiToolbarThinking: (\n prompt: string,\n withPreviousResponse?: boolean\n ) => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Cancel the current \"thinking\" phase, going back to the \"asking\" phase.\n */\n $cancelAiToolbarThinking: () => ReturnType;\n\n // Other\n\n /**\n * @internal\n *\n * Show the diff of the current \"reviewing\" phase.\n */\n _showAiToolbarReviewingDiff: () => ReturnType;\n\n /**\n * @internal\n *\n * Handle the success of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingSuccess: (\n response: ContextualPromptResponse\n ) => ReturnType;\n\n /**\n * @internal\n *\n * Handle an error of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingError: (error: unknown) => ReturnType;\n\n /**\n * @internal\n *\n * Update the current custom AI prompt.\n */\n _updateAiToolbarCustomPrompt: (\n customPrompt: string | ((currentCustomPrompt: string) => string)\n ) => ReturnType;\n};\n\nexport type YSyncPluginState = {\n binding: ProsemirrorBinding;\n};\n\nexport type TiptapMentionData = MentionData & {\n notificationId: string;\n};\n\nexport type SerializedTiptapMentionData = TiptapMentionData extends infer T\n ? T extends { kind: \"group\" }\n ? Omit<T, \"userIds\"> & { userIds?: string }\n : T\n : never;\n"],"names":["ThreadPluginActions"],"mappings":";;AAgBa,MAAA,sBAAA,GAAyB,IAAI,SAAA,CAAU,mBAAmB,EAAA;AAChE,MAAM,+BAA+B,IAAI,SAAA;AAAA,EAC9C,yBAAA;AACF,EAAA;AACO,MAAM,kCAAkC,IAAI,SAAA;AAAA,EACjD,0BAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,uBAAA;AACrC,MAAM,uBAA0B,GAAA,oBAAA;AAChC,MAAM,6BAAgC,GAAA,yBAAA;AAEtC,MAAM,kCAAkC,IAAI,SAAA;AAAA,EACjD,oCAAA;AACF,EAAA;AACO,MAAM,qBAAqB,IAAI,SAAA;AAAA,EACpC,mBAAA;AACF,EAAA;AACO,MAAM,8BAA8B,IAAI,SAAA;AAAA,EAC7C,gCAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,wBAAA;AA+E1B,IAAA,mBAAA,qBAAAA,oBAAX,KAAA;AACL,EAAAA,qBAAA,wBAAyB,CAAA,GAAA,wBAAA,CAAA;AADT,EAAAA,OAAAA,oBAAAA,CAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n ContextualPromptContext,\n ContextualPromptResponse,\n MentionData,\n Relax,\n TextEditorType,\n ThreadData,\n} from \"@liveblocks/core\";\nimport type { LiveblocksYjsProvider } from \"@liveblocks/yjs\";\nimport type { Content, Range } from \"@tiptap/core\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\nimport type { ChainedCommands, SingleCommands } from \"@tiptap/react\";\nimport type { ProsemirrorBinding } from \"y-prosemirror\";\nimport type { Doc, PermanentUserData, Snapshot } from \"yjs\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\n\nexport const LIVEBLOCKS_MENTION_EXTENSION = \"liveblocksMentionExt\";\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\nexport const LIVEBLOCKS_GROUP_MENTION_TYPE = \"liveblocksGroupMention\";\n\nexport const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(\n \"lb-threads-active-selection-plugin\"\n);\nexport const THREADS_PLUGIN_KEY = new PluginKey<ThreadPluginState>(\n \"lb-threads-plugin\"\n);\nexport const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(\n \"lb-ai-toolbar-selection-plugin\"\n);\n\nexport const LIVEBLOCKS_COMMENT_MARK_TYPE = \"liveblocksCommentMark\";\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptArgs = {\n /**\n * The prompt being requested by the user.\n */\n prompt: string;\n\n /**\n * The context of the document and its current selection.\n */\n context: ContextualPromptContext;\n\n /**\n * The previous request and its response, if this is a follow-up request.\n */\n previous?: {\n prompt: string;\n response: ContextualPromptResponse;\n };\n\n /**\n * An abort signal that can be used to cancel requests.\n */\n signal: AbortSignal;\n};\n\n/**\n * @beta\n */\nexport type ResolveContextualPromptResponse = ContextualPromptResponse;\n\nexport interface AiConfiguration {\n /**\n * The AI's name. (\"Ask {name} anything…\", \"{name} is thinking…\", etc)\n */\n name?: string;\n\n /**\n * A function that returns an a response to a contextual prompt.\n */\n resolveContextualPrompt?: (\n args: ResolveContextualPromptArgs\n ) => Promise<ContextualPromptResponse>;\n}\n\nexport type LiveblocksExtensionOptions = {\n field?: string;\n comments?: boolean; // | CommentsConfiguration\n mentions?: boolean; // | MentionsConfiguration\n ai?: boolean | AiConfiguration;\n offlineSupport_experimental?: boolean;\n threads_experimental?: ThreadData[];\n initialContent?: Content;\n enablePermanentUserData?: boolean;\n /**\n * @internal\n * For reporting another text editor type from a\n * text editor extended from `TipTap` such as our `BlockNote` integration.\n *\n * Only useful for Liveblocks developers, not for end users.\n */\n textEditorType?: TextEditorType;\n};\n\nexport type LiveblocksExtensionStorage = {\n unsubs: (() => void)[];\n doc: Doc;\n provider: LiveblocksYjsProvider;\n permanentUserData?: PermanentUserData;\n};\n\nexport type CommentsExtensionStorage = {\n pendingComment: boolean;\n};\n\nexport const enum ThreadPluginActions {\n SET_SELECTED_THREAD_ID = \"SET_SELECTED_THREAD_ID\",\n}\n\nexport type AiExtensionOptions = Required<\n Pick<AiConfiguration, \"name\" | \"resolveContextualPrompt\">\n> & {\n doc: Doc | undefined;\n pud: PermanentUserData | undefined;\n};\n\n/**\n * The state of the AI toolbar.\n *\n * ┌────────────────────────────────────────────────────────────────────────────────┐\n * │ │\n * │ ┌──────────────────────────────────────────────┐ │\n * ▼ ▼ │ │\n * ┌───────$closeAiToolbar()───────┐ │ │\n * ▼ ◇ ◇ ◇\n * ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐ ┌───────────────────────┐\n * │ CLOSED │ │ ASKING │ │ THINKING │ │ REVIEWING │\n * └───────────────────────┘ └───────────────────────┘ └───────────────────────┘ └───────────────────────┘\n * ▲ ◇ ◇ ▲ ▲ ◇ ▲ ▲ ◇ ▲ ◇ ◇\n * │ │ └───$openAiToolbarAsking()──┘ │ │ └ ─ ─ ─ ─ ─ ─⚠─ ─ ─ ─ ─ ─ ─│─├── ─ ─ ─ ─ ─ ─✓─ ─ ─ ─ ─ ─ ─ ┘ │ │\n * │ │ │ ▼ │ │ │ │\n * │ └─────────────────$startAiToolbarThinking(prompt)──────────────┘ │ │ │\n * │ │ ▲ │ │ │\n * │ │ └──────────────────────────────┼───────────────────────────────┘ │\n * │ │ │ │\n * │ └───$cancelAiToolbarThinking()───┘ │\n * │ │\n * └─────────────────────────────────────$acceptAiToolbarResponse()─────────────────────────────────────┘\n *\n */\nexport type AiToolbarState = Relax<\n | {\n phase: \"closed\";\n }\n | {\n phase: \"asking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * A potential error that occurred during the last AI request.\n */\n error?: Error;\n }\n | {\n phase: \"thinking\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * An abort controller to cancel the AI request.\n */\n abortController: AbortController;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The previous response if this \"thinking\" phase is a refinement.\n */\n previousResponse?: ContextualPromptResponse;\n }\n | {\n phase: \"reviewing\";\n\n /**\n * The selection stored when opening the AI toolbar.\n */\n initialSelection: Range;\n\n /**\n * The custom prompt being written in the toolbar.\n */\n customPrompt: string;\n\n /**\n * The prompt sent to the AI.\n */\n prompt: string;\n\n /**\n * The response of the AI request.\n */\n response: ContextualPromptResponse;\n }\n>;\n\nexport type AiExtensionStorage = {\n name: string;\n state: AiToolbarState;\n snapshot?: Snapshot;\n};\n\ndeclare module \"@tiptap/core\" {\n interface Storage {\n liveblocksAi: AiExtensionStorage;\n liveblocksExtension: LiveblocksExtensionStorage;\n liveblocksComments: CommentsExtensionStorage;\n }\n // TODO: this is already defined in collaboration-caret, we shouldn't need it, but something isn't working\n // maybe because we use configure?\n interface Commands<ReturnType> {\n collaborationCaret: {\n /**\n * Update details of the current user\n * @example editor.commands.updateUser({ name: 'John Doe', color: '#305500' })\n */\n updateUser: (attributes: Record<string, any>) => ReturnType;\n /**\n * Update details of the current user\n *\n * @deprecated The \"user\" command is deprecated. Please use \"updateUser\" instead. Read more: https://tiptap.dev/api/extensions/collaboration-caret\n */\n user: (attributes: Record<string, any>) => ReturnType;\n };\n\n collaboration: {\n /**\n * Undo recent changes\n * @example editor.commands.undo()\n */\n undo: () => ReturnType;\n /**\n * Reapply reverted changes\n * @example editor.commands.redo()\n */\n redo: () => ReturnType;\n };\n }\n}\nexport type ThreadPluginState = {\n threadPositions: Map<string, { from: number; to: number }>;\n selectedThreadId: string | null;\n selectedThreadPos: number | null;\n decorations: DecorationSet;\n};\n\nexport type FloatingPosition = \"top\" | \"bottom\";\n\nexport type ExtendedCommands<\n T extends string,\n A extends any[] = [],\n> = SingleCommands & Record<T, (...args: A) => boolean>;\n\nexport type ExtendedChainedCommands<\n T extends string,\n A extends any[] = [],\n> = ChainedCommands & Record<T, (...args: A) => ChainedCommands>;\n\nexport type ChainedAiCommands = ChainedCommands & {\n [K in keyof AiCommands]: (\n ...args: Parameters<AiCommands[K]>\n ) => ChainedCommands;\n};\n\nexport type CommentsCommands<ReturnType = boolean> = {\n /**\n * Add a comment\n */\n addComment: (id: string) => ReturnType;\n selectThread: (id: string | null) => ReturnType;\n addPendingComment: () => ReturnType;\n\n /** @internal */\n closePendingComment: () => ReturnType;\n};\n\nexport type AiCommands<ReturnType = boolean> = {\n /**\n * Open the AI toolbar, with an optional prompt.\n */\n askAi: (prompt?: string) => ReturnType;\n\n /**\n * Close the AI toolbar.\n */\n closeAi: () => ReturnType;\n\n // Transitions (see AiToolbarState)\n\n /**\n * @internal\n * @transition\n *\n * Close the AI toolbar.\n */\n $closeAiToolbar: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Accept the current AI response and close the AI toolbar.\n */\n $acceptAiToolbarResponse: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Open the AI toolbar in the \"asking\" phase.\n */\n $openAiToolbarAsking: () => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Set (and open if not already open) the AI toolbar in the \"thinking\" phase with the given prompt.\n */\n $startAiToolbarThinking: (\n prompt: string,\n withPreviousResponse?: boolean\n ) => ReturnType;\n\n /**\n * @internal\n * @transition\n *\n * Cancel the current \"thinking\" phase, going back to the \"asking\" phase.\n */\n $cancelAiToolbarThinking: () => ReturnType;\n\n // Other\n\n /**\n * @internal\n *\n * Show the diff of the current \"reviewing\" phase.\n */\n _showAiToolbarReviewingDiff: () => ReturnType;\n\n /**\n * @internal\n *\n * Handle the success of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingSuccess: (\n response: ContextualPromptResponse\n ) => ReturnType;\n\n /**\n * @internal\n *\n * Handle an error of the current \"thinking\" phase.\n */\n _handleAiToolbarThinkingError: (error: unknown) => ReturnType;\n\n /**\n * @internal\n *\n * Update the current custom AI prompt.\n */\n _updateAiToolbarCustomPrompt: (\n customPrompt: string | ((currentCustomPrompt: string) => string)\n ) => ReturnType;\n};\n\nexport type YSyncPluginState = {\n binding: ProsemirrorBinding;\n};\n\nexport type TiptapMentionData = MentionData & {\n notificationId: string;\n};\n\nexport type SerializedTiptapMentionData = TiptapMentionData extends infer T\n ? T extends { kind: \"group\" }\n ? Omit<T, \"userIds\"> & { userIds?: string }\n : T\n : never;\n"],"names":["ThreadPluginActions"],"mappings":";;AAgBa,MAAA,sBAAA,GAAyB,IAAI,SAAA,CAAU,mBAAmB,EAAA;AAChE,MAAM,+BAA+B,IAAI,SAAA;AAAA,EAC9C,yBAAA;AACF,EAAA;AACO,MAAM,kCAAkC,IAAI,SAAA;AAAA,EACjD,0BAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,uBAAA;AACrC,MAAM,uBAA0B,GAAA,oBAAA;AAChC,MAAM,6BAAgC,GAAA,yBAAA;AAEtC,MAAM,kCAAkC,IAAI,SAAA;AAAA,EACjD,oCAAA;AACF,EAAA;AACO,MAAM,qBAAqB,IAAI,SAAA;AAAA,EACpC,mBAAA;AACF,EAAA;AACO,MAAM,8BAA8B,IAAI,SAAA;AAAA,EAC7C,gCAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,wBAAA;AA+E1B,IAAA,mBAAA,qBAAAA,oBAAX,KAAA;AACL,EAAAA,qBAAA,wBAAyB,CAAA,GAAA,wBAAA,CAAA;AADT,EAAAA,OAAAA,oBAAAA,CAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;;;;"}
|
|
@@ -17,6 +17,7 @@ const HistoryVersionPreview = react.forwardRef(
|
|
|
17
17
|
const previewEditor = react$2.useEditor({
|
|
18
18
|
// ignore extensions, only get marks/nodes
|
|
19
19
|
editable: false,
|
|
20
|
+
immediatelyRender: false,
|
|
20
21
|
extensions: parentEditor.extensionManager.extensions.filter(
|
|
21
22
|
(e) => e.type !== "extension"
|
|
22
23
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryVersionPreview.cjs","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n cn,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(\n (\n { version, editor: parentEditor, onVersionRestore, className, ...props },\n forwardedRef\n ) => {\n const $ = useOverrides();\n const { isLoading, data, error } = useHistoryVersionData(version.id);\n\n const previewEditor = useEditor({\n // ignore extensions, only get marks/nodes\n editable: false,\n extensions: parentEditor.extensionManager.extensions.filter(\n (e) => e.type !== \"extension\"\n ),\n });\n useEffect(() => {\n if (data && previewEditor) {\n const doc = new Doc();\n applyUpdate(doc, data);\n const root = doc.getXmlFragment(\"default\"); // TODO: lookup field\n const node = yXmlFragmentToProseMirrorRootNode(\n root,\n parentEditor.schema\n );\n previewEditor.commands.setContent(node.toJSON() as Content);\n }\n }, [data, previewEditor, parentEditor]);\n const restore = useCallback(() => {\n parentEditor.commands.setContent(previewEditor?.getJSON() ?? \"\");\n onVersionRestore?.(version);\n }, [onVersionRestore, parentEditor, previewEditor, version]);\n\n return (\n <div\n {...props}\n className={cn(\n \"lb-root lb-history-version-preview lb-tiptap-version-preview\",\n className\n )}\n ref={forwardedRef}\n >\n {isLoading ? (\n <div className=\"lb-loading lb-history-version-preview-loading\">\n <SpinnerIcon />\n </div>\n ) : error ? (\n <div className=\"lb-error lb-history-version-preview-error\">\n {$.HISTORY_VERSION_PREVIEW_ERROR(error)}\n </div>\n ) : (\n <div className=\"lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container\">\n <EditorContent editor={previewEditor} />\n </div>\n )}\n <div className=\"lb-history-version-preview-footer\">\n <span className=\"lb-history-version-preview-authors\">\n {$.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(\n <List\n values={version.authors.map((author) => (\n <User key={author.id} userId={author.id} replaceSelf />\n ))}\n formatRemaining={$.LIST_REMAINING_USERS}\n truncate={AUTHORS_TRUNCATE}\n locale={$.locale}\n />\n )}\n </span>\n <div className=\"lb-history-version-preview-actions\">\n <Button\n onClick={restore}\n disabled={!data}\n variant=\"primary\"\n size=\"large\"\n className=\"lb-history-version-preview-action\"\n icon={<RestoreIcon />}\n >\n {$.HISTORY_VERSION_PREVIEW_RESTORE}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n);\n"],"names":["forwardRef","useOverrides","useHistoryVersionData","useEditor","useEffect","Doc","applyUpdate","yXmlFragmentToProseMirrorRootNode","useCallback","jsxs","cn","jsx","SpinnerIcon","EditorContent","List","User","Button","RestoreIcon"],"mappings":";;;;;;;;;;;AAkBA,MAAM,gBAAmB,GAAA,CAAA,CAAA;AAelB,MAAM,qBAAwB,GAAAA,gBAAA;AAAA,EAInC,CACE,EAAE,OAAA,EAAS,MAAQ,EAAA,YAAA,EAAc,kBAAkB,SAAW,EAAA,GAAG,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EAAU,oCACb,EAAA,QAAA,kBAAAA,cAAA;AAAA,cAACK,eAAA;AAAA,cAAA;AAAA,gBACC,OAAS,EAAA,OAAA;AAAA,gBACT,UAAU,CAAC,IAAA;AAAA,gBACX,OAAQ,EAAA,SAAA;AAAA,gBACR,IAAK,EAAA,OAAA;AAAA,gBACL,SAAU,EAAA,mCAAA;AAAA,gBACV,IAAA,iCAAOC,oBAAY,EAAA,EAAA,CAAA;AAAA,gBAElB,QAAE,EAAA,CAAA,CAAA,+BAAA;AAAA,eAAA;AAAA,aAEP,EAAA,CAAA;AAAA,WACF,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"HistoryVersionPreview.cjs","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n cn,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(\n (\n { version, editor: parentEditor, onVersionRestore, className, ...props },\n forwardedRef\n ) => {\n const $ = useOverrides();\n const { isLoading, data, error } = useHistoryVersionData(version.id);\n\n const previewEditor = useEditor({\n // ignore extensions, only get marks/nodes\n editable: false,\n immediatelyRender: false,\n extensions: parentEditor.extensionManager.extensions.filter(\n (e) => e.type !== \"extension\"\n ),\n });\n useEffect(() => {\n if (data && previewEditor) {\n const doc = new Doc();\n applyUpdate(doc, data);\n const root = doc.getXmlFragment(\"default\"); // TODO: lookup field\n const node = yXmlFragmentToProseMirrorRootNode(\n root,\n parentEditor.schema\n );\n previewEditor.commands.setContent(node.toJSON() as Content);\n }\n }, [data, previewEditor, parentEditor]);\n const restore = useCallback(() => {\n parentEditor.commands.setContent(previewEditor?.getJSON() ?? \"\");\n onVersionRestore?.(version);\n }, [onVersionRestore, parentEditor, previewEditor, version]);\n\n return (\n <div\n {...props}\n className={cn(\n \"lb-root lb-history-version-preview lb-tiptap-version-preview\",\n className\n )}\n ref={forwardedRef}\n >\n {isLoading ? (\n <div className=\"lb-loading lb-history-version-preview-loading\">\n <SpinnerIcon />\n </div>\n ) : error ? (\n <div className=\"lb-error lb-history-version-preview-error\">\n {$.HISTORY_VERSION_PREVIEW_ERROR(error)}\n </div>\n ) : (\n <div className=\"lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container\">\n <EditorContent editor={previewEditor} />\n </div>\n )}\n <div className=\"lb-history-version-preview-footer\">\n <span className=\"lb-history-version-preview-authors\">\n {$.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(\n <List\n values={version.authors.map((author) => (\n <User key={author.id} userId={author.id} replaceSelf />\n ))}\n formatRemaining={$.LIST_REMAINING_USERS}\n truncate={AUTHORS_TRUNCATE}\n locale={$.locale}\n />\n )}\n </span>\n <div className=\"lb-history-version-preview-actions\">\n <Button\n onClick={restore}\n disabled={!data}\n variant=\"primary\"\n size=\"large\"\n className=\"lb-history-version-preview-action\"\n icon={<RestoreIcon />}\n >\n {$.HISTORY_VERSION_PREVIEW_RESTORE}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n);\n"],"names":["forwardRef","useOverrides","useHistoryVersionData","useEditor","useEffect","Doc","applyUpdate","yXmlFragmentToProseMirrorRootNode","useCallback","jsxs","cn","jsx","SpinnerIcon","EditorContent","List","User","Button","RestoreIcon"],"mappings":";;;;;;;;;;;AAkBA,MAAM,gBAAmB,GAAA,CAAA,CAAA;AAelB,MAAM,qBAAwB,GAAAA,gBAAA;AAAA,EAInC,CACE,EAAE,OAAA,EAAS,MAAQ,EAAA,YAAA,EAAc,kBAAkB,SAAW,EAAA,GAAG,KAAM,EAAA,EACvE,YACG,KAAA;AACH,IAAA,MAAM,IAAIC,oBAAa,EAAA,CAAA;AACvB,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,OAAU,GAAAC,6BAAA,CAAsB,QAAQ,EAAE,CAAA,CAAA;AAEnE,IAAA,MAAM,gBAAgBC,iBAAU,CAAA;AAAA;AAAA,MAE9B,QAAU,EAAA,KAAA;AAAA,MACV,iBAAmB,EAAA,KAAA;AAAA,MACnB,UAAA,EAAY,YAAa,CAAA,gBAAA,CAAiB,UAAW,CAAA,MAAA;AAAA,QACnD,CAAC,CAAM,KAAA,CAAA,CAAE,IAAS,KAAA,WAAA;AAAA,OACpB;AAAA,KACD,CAAA,CAAA;AACD,IAAAC,eAAA,CAAU,MAAM;AACd,MAAA,IAAI,QAAQ,aAAe,EAAA;AACzB,QAAM,MAAA,GAAA,GAAM,IAAIC,OAAI,EAAA,CAAA;AACpB,QAAAC,eAAA,CAAY,KAAK,IAAI,CAAA,CAAA;AACrB,QAAM,MAAA,IAAA,GAAO,GAAI,CAAA,cAAA,CAAe,SAAS,CAAA,CAAA;AACzC,QAAA,MAAM,IAAO,GAAAC,8CAAA;AAAA,UACX,IAAA;AAAA,UACA,YAAa,CAAA,MAAA;AAAA,SACf,CAAA;AACA,QAAA,aAAA,CAAc,QAAS,CAAA,UAAA,CAAW,IAAK,CAAA,MAAA,EAAmB,CAAA,CAAA;AAAA,OAC5D;A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AAA,GAAA,CAAI,CAAC,MAC3B,qBAAAH,cAAA,CAACI,aAAqB,EAAA,EAAA,MAAA,EAAQ,OAAO,EAAI,EAAA,WAAA,EAAW,IAAzC,EAAA,EAAA,MAAA,CAAO,EAAmC,CACtD,CAAA;AAAA,kBACD,iBAAiB,CAAE,CAAA,oBAAA;AAAA,kBACnB,QAAU,EAAA,gBAAA;AAAA,kBACV,QAAQ,CAAE,CAAA,MAAA;AAAA,iBAAA;AAAA,eACZ;AAAA,aAEJ,EAAA,CAAA;AAAA,4BACAJ,cAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAU,oCACb,EAAA,QAAA,kBAAAA,cAAA;AAAA,cAACK,eAAA;AAAA,cAAA;AAAA,gBACC,OAAS,EAAA,OAAA;AAAA,gBACT,UAAU,CAAC,IAAA;AAAA,gBACX,OAAQ,EAAA,SAAA;AAAA,gBACR,IAAK,EAAA,OAAA;AAAA,gBACL,SAAU,EAAA,mCAAA;AAAA,gBACV,IAAA,iCAAOC,oBAAY,EAAA,EAAA,CAAA;AAAA,gBAElB,QAAE,EAAA,CAAA,CAAA,+BAAA;AAAA,eAAA;AAAA,aAEP,EAAA,CAAA;AAAA,WACF,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -15,6 +15,7 @@ const HistoryVersionPreview = forwardRef(
|
|
|
15
15
|
const previewEditor = useEditor({
|
|
16
16
|
// ignore extensions, only get marks/nodes
|
|
17
17
|
editable: false,
|
|
18
|
+
immediatelyRender: false,
|
|
18
19
|
extensions: parentEditor.extensionManager.extensions.filter(
|
|
19
20
|
(e) => e.type !== "extension"
|
|
20
21
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryVersionPreview.js","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n cn,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(\n (\n { version, editor: parentEditor, onVersionRestore, className, ...props },\n forwardedRef\n ) => {\n const $ = useOverrides();\n const { isLoading, data, error } = useHistoryVersionData(version.id);\n\n const previewEditor = useEditor({\n // ignore extensions, only get marks/nodes\n editable: false,\n extensions: parentEditor.extensionManager.extensions.filter(\n (e) => e.type !== \"extension\"\n ),\n });\n useEffect(() => {\n if (data && previewEditor) {\n const doc = new Doc();\n applyUpdate(doc, data);\n const root = doc.getXmlFragment(\"default\"); // TODO: lookup field\n const node = yXmlFragmentToProseMirrorRootNode(\n root,\n parentEditor.schema\n );\n previewEditor.commands.setContent(node.toJSON() as Content);\n }\n }, [data, previewEditor, parentEditor]);\n const restore = useCallback(() => {\n parentEditor.commands.setContent(previewEditor?.getJSON() ?? \"\");\n onVersionRestore?.(version);\n }, [onVersionRestore, parentEditor, previewEditor, version]);\n\n return (\n <div\n {...props}\n className={cn(\n \"lb-root lb-history-version-preview lb-tiptap-version-preview\",\n className\n )}\n ref={forwardedRef}\n >\n {isLoading ? (\n <div className=\"lb-loading lb-history-version-preview-loading\">\n <SpinnerIcon />\n </div>\n ) : error ? (\n <div className=\"lb-error lb-history-version-preview-error\">\n {$.HISTORY_VERSION_PREVIEW_ERROR(error)}\n </div>\n ) : (\n <div className=\"lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container\">\n <EditorContent editor={previewEditor} />\n </div>\n )}\n <div className=\"lb-history-version-preview-footer\">\n <span className=\"lb-history-version-preview-authors\">\n {$.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(\n <List\n values={version.authors.map((author) => (\n <User key={author.id} userId={author.id} replaceSelf />\n ))}\n formatRemaining={$.LIST_REMAINING_USERS}\n truncate={AUTHORS_TRUNCATE}\n locale={$.locale}\n />\n )}\n </span>\n <div className=\"lb-history-version-preview-actions\">\n <Button\n onClick={restore}\n disabled={!data}\n variant=\"primary\"\n size=\"large\"\n className=\"lb-history-version-preview-action\"\n icon={<RestoreIcon />}\n >\n {$.HISTORY_VERSION_PREVIEW_RESTORE}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;AAkBA,MAAM,gBAAmB,GAAA,CAAA,CAAA;AAelB,MAAM,qBAAwB,GAAA,UAAA;AAAA,EAInC,CACE,EAAE,OAAA,EAAS,MAAQ,EAAA,YAAA,EAAc,kBAAkB,SAAW,EAAA,GAAG,KAAM,EAAA,EACvE,YACG,KAAA;AACH,IAAA,MAAM,IAAI,YAAa,EAAA,CAAA;AACvB,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,OAAU,GAAA,qBAAA,CAAsB,QAAQ,EAAE,CAAA,CAAA;AAEnE,IAAA,MAAM,gBAAgB,SAAU,CAAA;AAAA;AAAA,MAE9B,QAAU,EAAA,KAAA;AAAA,MACV,UAAA,EAAY,YAAa,CAAA,gBAAA,CAAiB,UAAW,CAAA,MAAA;AAAA,QACnD,CAAC,CAAM,KAAA,CAAA,CAAE,IAAS,KAAA,WAAA;AAAA,OACpB;AAAA,KACD,CAAA,CAAA;A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|
1
|
+
{"version":3,"file":"HistoryVersionPreview.js","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n cn,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(\n (\n { version, editor: parentEditor, onVersionRestore, className, ...props },\n forwardedRef\n ) => {\n const $ = useOverrides();\n const { isLoading, data, error } = useHistoryVersionData(version.id);\n\n const previewEditor = useEditor({\n // ignore extensions, only get marks/nodes\n editable: false,\n immediatelyRender: false,\n extensions: parentEditor.extensionManager.extensions.filter(\n (e) => e.type !== \"extension\"\n ),\n });\n useEffect(() => {\n if (data && previewEditor) {\n const doc = new Doc();\n applyUpdate(doc, data);\n const root = doc.getXmlFragment(\"default\"); // TODO: lookup field\n const node = yXmlFragmentToProseMirrorRootNode(\n root,\n parentEditor.schema\n );\n previewEditor.commands.setContent(node.toJSON() as Content);\n }\n }, [data, previewEditor, parentEditor]);\n const restore = useCallback(() => {\n parentEditor.commands.setContent(previewEditor?.getJSON() ?? \"\");\n onVersionRestore?.(version);\n }, [onVersionRestore, parentEditor, previewEditor, version]);\n\n return (\n <div\n {...props}\n className={cn(\n \"lb-root lb-history-version-preview lb-tiptap-version-preview\",\n className\n )}\n ref={forwardedRef}\n >\n {isLoading ? (\n <div className=\"lb-loading lb-history-version-preview-loading\">\n <SpinnerIcon />\n </div>\n ) : error ? (\n <div className=\"lb-error lb-history-version-preview-error\">\n {$.HISTORY_VERSION_PREVIEW_ERROR(error)}\n </div>\n ) : (\n <div className=\"lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container\">\n <EditorContent editor={previewEditor} />\n </div>\n )}\n <div className=\"lb-history-version-preview-footer\">\n <span className=\"lb-history-version-preview-authors\">\n {$.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(\n <List\n values={version.authors.map((author) => (\n <User key={author.id} userId={author.id} replaceSelf />\n ))}\n formatRemaining={$.LIST_REMAINING_USERS}\n truncate={AUTHORS_TRUNCATE}\n locale={$.locale}\n />\n )}\n </span>\n <div className=\"lb-history-version-preview-actions\">\n <Button\n onClick={restore}\n disabled={!data}\n variant=\"primary\"\n size=\"large\"\n className=\"lb-history-version-preview-action\"\n icon={<RestoreIcon />}\n >\n {$.HISTORY_VERSION_PREVIEW_RESTORE}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;AAkBA,MAAM,gBAAmB,GAAA,CAAA,CAAA;AAelB,MAAM,qBAAwB,GAAA,UAAA;AAAA,EAInC,CACE,EAAE,OAAA,EAAS,MAAQ,EAAA,YAAA,EAAc,kBAAkB,SAAW,EAAA,GAAG,KAAM,EAAA,EACvE,YACG,KAAA;AACH,IAAA,MAAM,IAAI,YAAa,EAAA,CAAA;AACvB,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,OAAU,GAAA,qBAAA,CAAsB,QAAQ,EAAE,CAAA,CAAA;AAEnE,IAAA,MAAM,gBAAgB,SAAU,CAAA;AAAA;AAAA,MAE9B,QAAU,EAAA,KA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AO,WAAY,EAAA,EAAA,CAAA;AAAA,gBAElB,QAAE,EAAA,CAAA,CAAA,+BAAA;AAAA,eAAA;AAAA,aAEP,EAAA,CAAA;AAAA,WACF,EAAA,CAAA;AAAA,SAAA;AAAA,OAAA;AAAA,KACF,CAAA;AAAA,GAEJ;AACF;;;;"}
|
package/dist/version.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const PKG_NAME = "@liveblocks/react-tiptap";
|
|
4
|
-
const PKG_VERSION = typeof "3.
|
|
4
|
+
const PKG_VERSION = typeof "3.10.1" === "string" && "3.10.1";
|
|
5
5
|
const PKG_FORMAT = typeof "cjs" === "string" && "cjs";
|
|
6
6
|
|
|
7
7
|
exports.PKG_FORMAT = PKG_FORMAT;
|
package/dist/version.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"version.cjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,QAAA,KAAgB,QAAY,IAAA,SAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;;;"}
|
package/dist/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const PKG_NAME = "@liveblocks/react-tiptap";
|
|
2
|
-
const PKG_VERSION = typeof "3.
|
|
2
|
+
const PKG_VERSION = typeof "3.10.1" === "string" && "3.10.1";
|
|
3
3
|
const PKG_FORMAT = typeof "esm" === "string" && "esm";
|
|
4
4
|
|
|
5
5
|
export { PKG_FORMAT, PKG_NAME, PKG_VERSION };
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,QAAA,KAAgB,QAAY,IAAA,SAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react-tiptap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "An integration of TipTap + React to enable collaboration, comments, live cursors, and more with Liveblocks.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@floating-ui/react-dom": "^2.1.2",
|
|
46
|
-
"@liveblocks/client": "3.
|
|
47
|
-
"@liveblocks/core": "3.
|
|
48
|
-
"@liveblocks/react": "3.
|
|
49
|
-
"@liveblocks/react-ui": "3.
|
|
50
|
-
"@liveblocks/yjs": "3.
|
|
46
|
+
"@liveblocks/client": "3.10.1",
|
|
47
|
+
"@liveblocks/core": "3.10.1",
|
|
48
|
+
"@liveblocks/react": "3.10.1",
|
|
49
|
+
"@liveblocks/react-ui": "3.10.1",
|
|
50
|
+
"@liveblocks/yjs": "3.10.1",
|
|
51
51
|
"@radix-ui/react-select": "^2.1.2",
|
|
52
52
|
"@radix-ui/react-toggle": "^1.1.0",
|
|
53
|
-
"@tiptap/core": "^
|
|
54
|
-
"@tiptap/react": "^
|
|
55
|
-
"@tiptap/suggestion": "^
|
|
53
|
+
"@tiptap/core": "^3.4.2",
|
|
54
|
+
"@tiptap/react": "^3.4.2",
|
|
55
|
+
"@tiptap/suggestion": "^3.4.2",
|
|
56
56
|
"cmdk": "^1.0.4",
|
|
57
57
|
"y-prosemirror": "^1.2.12",
|
|
58
58
|
"yjs": "^13.6.18"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@tiptap/extension-collaboration": "^
|
|
62
|
-
"@tiptap/extension-collaboration-
|
|
63
|
-
"@tiptap/pm": "^
|
|
64
|
-
"@tiptap/react": "^
|
|
65
|
-
"@tiptap/suggestion": "^
|
|
61
|
+
"@tiptap/extension-collaboration": "^3.4.2",
|
|
62
|
+
"@tiptap/extension-collaboration-caret": "^3.4.2",
|
|
63
|
+
"@tiptap/pm": "^3.4.2",
|
|
64
|
+
"@tiptap/react": "^3.4.2",
|
|
65
|
+
"@tiptap/suggestion": "^3.4.2",
|
|
66
66
|
"@types/react": "*",
|
|
67
67
|
"@types/react-dom": "*",
|
|
68
68
|
"react": "^18 || ^19 || ^19.0.0-rc",
|
package/src/styles/index.css
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* stylelint-disable selector-class-pattern */
|
|
1
2
|
@import "./utils";
|
|
2
3
|
@import "./constants";
|
|
3
4
|
|
|
@@ -618,7 +619,7 @@
|
|
|
618
619
|
*************************************/
|
|
619
620
|
|
|
620
621
|
/* Give a remote user a caret */
|
|
621
|
-
|
|
622
|
+
.collaboration-carets__caret,
|
|
622
623
|
.collaboration-cursor__caret {
|
|
623
624
|
position: relative;
|
|
624
625
|
margin-inline-start: -1px;
|
|
@@ -630,7 +631,7 @@
|
|
|
630
631
|
}
|
|
631
632
|
|
|
632
633
|
/* Render the username above the caret */
|
|
633
|
-
|
|
634
|
+
.collaboration-carets__label,
|
|
634
635
|
.collaboration-cursor__label {
|
|
635
636
|
position: absolute;
|
|
636
637
|
inset-inline-start: -1px;
|
package/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.lb-tiptap-suggestions-list{margin:0;padding:0;list-style:none}.lb-tiptap-suggestions{animation-duration:var(--lb-transition-duration);animation-timing-function:var(--lb-transition-easing);will-change:transform,opacity;padding:4px}.lb-tiptap-suggestions-list-item{padding:calc(.25*var(--lb-spacing))calc(.5*var(--lb-spacing));border-radius:calc(var(--lb-radius) - .75*4px);color:var(--lb-foreground-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;scroll-margin-block:4px;font-size:.875rem;transition-property:background,color,opacity;display:flex}.lb-tiptap-suggestions-list-item:where([data-highlighted]:not([data-highlighted=false]),[data-selected]:not([data-selected=false])){background:var(--lb-foreground-subtle);transition-duration:calc(var(--lb-transition-duration)/2)}.lb-tiptap-suggestions-list-item:where(:disabled,[data-disabled]:not([data-disabled=false])){opacity:.5;cursor:not-allowed}.lb-tiptap-suggestions:where([data-side=top]){animation-name:lb-animation-slide-up}.lb-tiptap-suggestions:where([data-side=bottom]){animation-name:lb-animation-slide-down}.lb-tiptap-suggestions:where([data-state=closed]){animation-name:lb-animation-disappear}.lb-tiptap-mention-suggestions{--lb-tiptap-mention-suggestion-avatar-size:1.25rem}.lb-tiptap-mention-suggestion{padding-inline-start:calc(.5*var(--lb-spacing));padding-inline-end:calc(.625*var(--lb-spacing));padding-block:calc(.25*var(--lb-spacing))}.lb-tiptap-mention-suggestion-avatar{inline-size:var(--lb-tiptap-mention-suggestion-avatar-size);block-size:var(--lb-tiptap-mention-suggestion-avatar-size);margin-inline-start:calc(-.125*var(--lb-spacing));margin-inline-end:calc(.5*var(--lb-spacing));margin-block:calc(.125*var(--lb-spacing));justify-content:center;align-items:center;display:flex}.lb-tiptap-mention-suggestion-avatar:where(.lb-avatar){background:var(--lb-foreground-subtle);color:var(--lb-foreground-moderate)}.lb-tiptap-mention-suggestion-avatar :where(.lb-icon){color:var(--lb-foreground-moderate)}.lb-tiptap-mention-suggestion-group-description{color:var(--lb-foreground-tertiary);align-self:baseline;margin-inline-start:calc(.625*var(--lb-spacing));font-size:.875em}.lb-tiptap-mention{border-radius:calc(.675*var(--lb-radius));background:var(--lb-accent-subtle);color:var(--lb-accent);-webkit-box-decoration-break:clone;box-decoration-break:clone;cursor:default;padding:.1em .3em;font-weight:500}.lb-tiptap-mention::selection{background:0 0}.lb-tiptap-mention ::selection{background:0 0}.lb-mention-selected{background:var(--lb-accent);color:var(--lb-accent-foreground)}:where(.lb-tiptap-thread-mark:not([data-orphan=true],[data-hidden])){background:var(--lb-accent-subtle);color:var(--lb-foreground);text-decoration-line:underline;-webkit-text-decoration-color:var(--lb-foreground-moderate);text-decoration-color:var(--lb-foreground-moderate);text-underline-offset:2px;outline:none;font-weight:500;transition-property:color,text-decoration-color}:where(.lb-tiptap-thread-mark:not([data-orphan=true],[data-hidden]) .lb-tiptap-thread-mark-selected){color:var(--lb-accent);text-decoration-line:underline;-webkit-text-decoration-color:var(--lb-accent-moderate);text-decoration-color:var(--lb-accent-moderate);text-underline-offset:2px}.lb-tiptap-thread-mark{scroll-margin-block:var(--lb-spacing)}.lb-tiptap-anchored-threads{--lb-tiptap-anchored-threads-gap:1.25rem;--lb-tiptap-anchored-threads-active-thread-offset:-.75rem}.lb-tiptap-anchored-threads-thread-container{transition-duration:calc(var(--lb-transition-duration)*2);transition-property:transform}.lb-tiptap-anchored-threads-thread{border-radius:var(--lb-radius);background:var(--lb-dynamic-background);transition-property:background,box-shadow;position:relative;overflow:hidden;box-shadow:0 0 0 1px #0000000a,0 2px 6px #0000000a,0 6px 20px #0000000f}.lb-tiptap-anchored-threads-thread:after{content:"";z-index:1;border-radius:inherit;box-shadow:var(--lb-inset-shadow);pointer-events:none;position:absolute;inset:0}.lb-tiptap-anchored-threads-thread:where([data-state=active]){box-shadow:0 0 0 1px #0000000a,0 2px 6px #00000014,0 8px 26px #0000001f}.lb-tiptap-floating{--lb-tiptap-floating-size:350px}.lb-tiptap-floating-threads-thread{inline-size:var(--lb-tiptap-floating-size)}.lb-tiptap-floating-threads-thread:where(:not(:last-of-type)){border-block-end:1px solid var(--lb-foreground-subtle)}.lb-tiptap-floating-composer{inline-size:var(--lb-tiptap-floating-size)}.lb-tiptap-active-selection{background:var(--lb-selection,#00f3);pointer-events:none}.lb-tiptap-toolbar{--lb-tiptap-toolbar-spacing:calc(.25*var(--lb-spacing));gap:var(--lb-tiptap-toolbar-spacing);padding:var(--lb-tiptap-toolbar-spacing);background:var(--lb-background);-ms-overflow-style:none;scrollbar-width:none;flex-direction:row;align-items:center;display:flex;position:relative;overflow-x:auto}.lb-tiptap-toolbar::-webkit-scrollbar{display:none}.lb-tiptap-toolbar>*{flex:none}.lb-tiptap-floating-toolbar{--lb-tiptap-toolbar-spacing:4px}.lb-tiptap-toolbar-separator{pointer-events:none;align-self:stretch;inline-size:1px;margin-inline:1px;position:relative}.lb-tiptap-toolbar-separator:before{content:"";background:var(--lb-foreground-subtle);position:absolute;inset:10% 0}.lb-tiptap-ai-selection{background:var(--lb-selection,#00f3);pointer-events:none}.lb-tiptap-ai-toolbar-portal{inline-size:var(--lb-tiptap-editor-width);pointer-events:none;outline:none;flex-direction:column;gap:8px;display:flex}.lb-tiptap-ai-toolbar-portal:where([data-liveblocks-ai-toolbar-flip]){flex-direction:column-reverse}.lb-tiptap-ai-toolbar-container{--lb-tiptap-ai-toolbar-padding:calc(.5*var(--lb-spacing));--lb-tiptap-ai-toolbar-height:calc(calc(2*.25*var(--lb-spacing) + var(--lb-icon-size)) + 2*var(--lb-tiptap-ai-toolbar-padding));min-block-size:var(--lb-tiptap-ai-toolbar-height);position:relative}.lb-tiptap-ai-toolbar{color:var(--lb-foreground);pointer-events:auto;flex-direction:column;display:flex}.lb-tiptap-ai-toolbar-response-container,.lb-tiptap-ai-toolbar-content{max-block-size:calc(6lh + 2*var(--lb-tiptap-ai-toolbar-padding));overflow-y:auto}.lb-tiptap-ai-toolbar-content{inline-size:100%;min-inline-size:0;padding:var(--lb-tiptap-ai-toolbar-padding);outline:none;grid-template-columns:auto 1fr auto;display:grid}.lb-tiptap-ai-toolbar-response-container{--lb-line-height-crop:calc(1lh - 1em)/-2;padding:calc(var(--lb-spacing) + var(--lb-line-height-crop))var(--lb-spacing);border-block-end:1px solid var(--lb-foreground-subtle);flex-direction:column;display:flex}.lb-tiptap-ai-toolbar-response{white-space:pre-wrap}.lb-tiptap-ai-toolbar-response:before{content:"";vertical-align:middle;-webkit-user-select:none;user-select:none;display:inline-block}.lb-tiptap-ai-toolbar-icon-container,.lb-tiptap-ai-toolbar-actions{block-size:calc(2*.25*var(--lb-spacing) + var(--lb-icon-size));flex:none;display:flex}.lb-tiptap-ai-toolbar-icon-container{color:var(--lb-foreground-moderate);align-self:start;align-items:center;position:sticky;inset-block-start:0}.lb-tiptap-ai-toolbar-actions{gap:var(--lb-tiptap-ai-toolbar-padding);align-self:end;position:sticky;inset-block-end:0}.lb-tiptap-ai-toolbar-custom-prompt{all:unset;color:var(--lb-foreground);resize:none;background:0 0;outline:none}.lb-tiptap-ai-toolbar-custom-prompt::placeholder{color:var(--lb-foreground-moderate)}.lb-tiptap-ai-toolbar-custom-prompt-container{z-index:auto;margin-block:calc(-1*var(--lb-tiptap-ai-toolbar-padding));display:grid;position:relative}.lb-tiptap-ai-toolbar-custom-prompt-container:before{content:attr(data-value)" ";visibility:hidden}.lb-tiptap-ai-toolbar-custom-prompt,.lb-tiptap-ai-toolbar-custom-prompt-container:before{box-sizing:inherit;inline-size:100%;min-inline-size:0;padding:calc(var(--lb-tiptap-ai-toolbar-padding) + (calc(2*.25*var(--lb-spacing) + var(--lb-icon-size)) - 1lh)/2)var(--lb-tiptap-ai-toolbar-padding);font:inherit;letter-spacing:inherit;white-space:pre-wrap;grid-area:1/1/2/2}.lb-tiptap-ai-toolbar-error{--lb-dynamic-background:var(--lb-background-destructive-subtle);gap:calc(.5*var(--lb-spacing));padding:var(--lb-tiptap-ai-toolbar-padding);background:var(--lb-dynamic-background);color:var(--lb-destructive);text-wrap:balance;align-items:center;font-size:.875em;display:flex;position:relative}.lb-tiptap-ai-toolbar-error:after{content:"";border-block-start:1px solid var(--lb-destructive-moderate);opacity:.35;pointer-events:none;position:absolute;inset:0}.lb-tiptap-ai-toolbar-error :where(.lb-icon-container){color:var(--lb-destructive-secondary)}.lb-tiptap-ai-toolbar-halo{--lb-tiptap-ai-toolbar-halo-blur:16px;--lb-tiptap-ai-toolbar-halo-outset:8px;inset:calc(-1*var(--lb-tiptap-ai-toolbar-halo-outset));z-index:-1;border-radius:calc(var(--lb-radius) + var(--lb-tiptap-ai-toolbar-halo-outset));filter:blur(var(--lb-tiptap-ai-toolbar-halo-blur));pointer-events:none;transition-property:opacity;transition-duration:1s;animation:1s cubic-bezier(.165,.84,.44,1) both lb-animation-ai-toolbar-halo-scale-in;position:absolute;overflow:hidden}.lb-tiptap-ai-toolbar-halo:where(:not([data-active])){opacity:.5}:is(.lb-tiptap-ai-toolbar-halo-horizontal,.lb-tiptap-ai-toolbar-halo-vertical){position:absolute;inset:0}:is(.lb-tiptap-ai-toolbar-halo-horizontal,.lb-tiptap-ai-toolbar-halo-vertical):before,:is(.lb-tiptap-ai-toolbar-halo-horizontal,.lb-tiptap-ai-toolbar-halo-vertical):after{content:"";opacity:.175;animation-timing-function:cubic-bezier(.455,.03,.515,.955);animation-iteration-count:infinite;position:absolute;inset:0}.lb-tiptap-ai-toolbar-halo-horizontal:before{background:linear-gradient(30deg,transparent 20%,var(--lb-accent)50%,transparent 80%);background-position:0 0;background-size:50% 100%;block-size:100%;inline-size:200%;animation-name:lb-animation-ai-toolbar-halo-horizontal;animation-duration:8s;animation-direction:alternate}.lb-tiptap-ai-toolbar-halo-horizontal:after{background:linear-gradient(90deg,transparent 20%,var(--lb-accent)50%,transparent 80%);background-position:0 0;background-size:75% 100%;block-size:100%;inline-size:400%;animation-name:lb-animation-ai-toolbar-halo-horizontal;animation-duration:6s;animation-direction:alternate-reverse;animation-delay:-2s;inset-inline-start:-50%}.lb-tiptap-ai-toolbar-halo-vertical:before{background:linear-gradient(1deg,transparent 40%,var(--lb-accent)50%,transparent 60%);background-position:0 0;background-repeat:round;background-size:100% 600px;block-size:400%;inline-size:100%;animation-name:lb-animation-ai-toolbar-halo-vertical;animation-duration:4s;animation-direction:alternate-reverse;animation-delay:-2s;inset-block-start:-50%}.lb-tiptap-ai-toolbar-halo-vertical:after{background:linear-gradient(-2deg,transparent 40%,var(--lb-accent)50%,transparent 60%);background-position:0 0;background-repeat:round;background-size:100% 400px;block-size:400%;inline-size:100%;animation-name:lb-animation-ai-toolbar-halo-vertical;animation-duration:3s;animation-direction:alternate;animation-delay:-1s;inset-block-start:-50%}.lb-tiptap-ai-toolbar-thinking{text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;max-inline-size:fit-content;padding-inline:var(--lb-tiptap-ai-toolbar-padding);color:var(--lb-foreground-tertiary);-webkit-user-select:none;user-select:none;align-self:center;animation:5s linear infinite lb-animation-shimmer-text;overflow:hidden}.lb-tiptap-ai-toolbar-dropdown{pointer-events:auto;inline-size:min(250px,100%)}.lb-tiptap-change-removed{color:color-mix(in srgb,currentcolor 40%,transparent);text-decoration:line-through;text-decoration-thickness:1px}.lb-tiptap-change-added{background:color-mix(in srgb,var(--lb-accent)calc(var(--lb-accent-contrast)*1.5),transparent);color:var(--lb-accent)}.collaboration-cursor__caret{word-break:normal;pointer-events:none;border-inline:1px solid #0d0d0d;margin-inline:-1px;position:relative}.collaboration-cursor__label{border-radius:6px;color:#fff;white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none;border-end-start-radius:0;padding:2px 6px;font-size:14px;font-style:normal;font-weight:600;line-height:normal;position:absolute;inset-block-start:-1.4em;inset-inline-start:-1px}@keyframes lb-animation-ai-toolbar-halo-scale-in{0%{transform:scale(.5)}to{transform:scale(1)}}@keyframes lb-animation-ai-toolbar-halo-horizontal{0%{transform:translate(-50%)}to{transform:translate(0)}}@keyframes lb-animation-ai-toolbar-halo-vertical{0%{transform:translateY(0)}to{transform:translateY(-50%)}}@media (prefers-reduced-motion){.lb-tiptap-suggestions:where(:not([data-state=closed])){animation-name:lb-animation-appear}.lb-tiptap-anchored-threads-thread-container{transition-duration:0s}}
|
|
1
|
+
.lb-tiptap-suggestions-list{margin:0;padding:0;list-style:none}.lb-tiptap-suggestions{animation-duration:var(--lb-transition-duration);animation-timing-function:var(--lb-transition-easing);will-change:transform,opacity;padding:4px}.lb-tiptap-suggestions-list-item{padding:calc(.25*var(--lb-spacing))calc(.5*var(--lb-spacing));border-radius:calc(var(--lb-radius) - .75*4px);color:var(--lb-foreground-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;outline:none;align-items:center;scroll-margin-block:4px;font-size:.875rem;transition-property:background,color,opacity;display:flex}.lb-tiptap-suggestions-list-item:where([data-highlighted]:not([data-highlighted=false]),[data-selected]:not([data-selected=false])){background:var(--lb-foreground-subtle);transition-duration:calc(var(--lb-transition-duration)/2)}.lb-tiptap-suggestions-list-item:where(:disabled,[data-disabled]:not([data-disabled=false])){opacity:.5;cursor:not-allowed}.lb-tiptap-suggestions:where([data-side=top]){animation-name:lb-animation-slide-up}.lb-tiptap-suggestions:where([data-side=bottom]){animation-name:lb-animation-slide-down}.lb-tiptap-suggestions:where([data-state=closed]){animation-name:lb-animation-disappear}.lb-tiptap-mention-suggestions{--lb-tiptap-mention-suggestion-avatar-size:1.25rem}.lb-tiptap-mention-suggestion{padding-inline-start:calc(.5*var(--lb-spacing));padding-inline-end:calc(.625*var(--lb-spacing));padding-block:calc(.25*var(--lb-spacing))}.lb-tiptap-mention-suggestion-avatar{inline-size:var(--lb-tiptap-mention-suggestion-avatar-size);block-size:var(--lb-tiptap-mention-suggestion-avatar-size);margin-inline-start:calc(-.125*var(--lb-spacing));margin-inline-end:calc(.5*var(--lb-spacing));margin-block:calc(.125*var(--lb-spacing));justify-content:center;align-items:center;display:flex}.lb-tiptap-mention-suggestion-avatar:where(.lb-avatar){background:var(--lb-foreground-subtle);color:var(--lb-foreground-moderate)}.lb-tiptap-mention-suggestion-avatar :where(.lb-icon){color:var(--lb-foreground-moderate)}.lb-tiptap-mention-suggestion-group-description{color:var(--lb-foreground-tertiary);align-self:baseline;margin-inline-start:calc(.625*var(--lb-spacing));font-size:.875em}.lb-tiptap-mention{border-radius:calc(.675*var(--lb-radius));background:var(--lb-accent-subtle);color:var(--lb-accent);-webkit-box-decoration-break:clone;box-decoration-break:clone;cursor:default;padding:.1em .3em;font-weight:500}.lb-tiptap-mention::selection{background:0 0}.lb-tiptap-mention ::selection{background:0 0}.lb-mention-selected{background:var(--lb-accent);color:var(--lb-accent-foreground)}:where(.lb-tiptap-thread-mark:not([data-orphan=true],[data-hidden])){background:var(--lb-accent-subtle);color:var(--lb-foreground);text-decoration-line:underline;-webkit-text-decoration-color:var(--lb-foreground-moderate);text-decoration-color:var(--lb-foreground-moderate);text-underline-offset:2px;outline:none;font-weight:500;transition-property:color,text-decoration-color}:where(.lb-tiptap-thread-mark:not([data-orphan=true],[data-hidden]) .lb-tiptap-thread-mark-selected){color:var(--lb-accent);text-decoration-line:underline;-webkit-text-decoration-color:var(--lb-accent-moderate);text-decoration-color:var(--lb-accent-moderate);text-underline-offset:2px}.lb-tiptap-thread-mark{scroll-margin-block:var(--lb-spacing)}.lb-tiptap-anchored-threads{--lb-tiptap-anchored-threads-gap:1.25rem;--lb-tiptap-anchored-threads-active-thread-offset:-.75rem}.lb-tiptap-anchored-threads-thread-container{transition-duration:calc(var(--lb-transition-duration)*2);transition-property:transform}.lb-tiptap-anchored-threads-thread{border-radius:var(--lb-radius);background:var(--lb-dynamic-background);transition-property:background,box-shadow;position:relative;overflow:hidden;box-shadow:0 0 0 1px #0000000a,0 2px 6px #0000000a,0 6px 20px #0000000f}.lb-tiptap-anchored-threads-thread:after{content:"";z-index:1;border-radius:inherit;box-shadow:var(--lb-inset-shadow);pointer-events:none;position:absolute;inset:0}.lb-tiptap-anchored-threads-thread:where([data-state=active]){box-shadow:0 0 0 1px #0000000a,0 2px 6px #00000014,0 8px 26px #0000001f}.lb-tiptap-floating{--lb-tiptap-floating-size:350px}.lb-tiptap-floating-threads-thread{inline-size:var(--lb-tiptap-floating-size)}.lb-tiptap-floating-threads-thread:where(:not(:last-of-type)){border-block-end:1px solid var(--lb-foreground-subtle)}.lb-tiptap-floating-composer{inline-size:var(--lb-tiptap-floating-size)}.lb-tiptap-active-selection{background:var(--lb-selection,#00f3);pointer-events:none}.lb-tiptap-toolbar{--lb-tiptap-toolbar-spacing:calc(.25*var(--lb-spacing));gap:var(--lb-tiptap-toolbar-spacing);padding:var(--lb-tiptap-toolbar-spacing);background:var(--lb-background);-ms-overflow-style:none;scrollbar-width:none;flex-direction:row;align-items:center;display:flex;position:relative;overflow-x:auto}.lb-tiptap-toolbar::-webkit-scrollbar{display:none}.lb-tiptap-toolbar>*{flex:none}.lb-tiptap-floating-toolbar{--lb-tiptap-toolbar-spacing:4px}.lb-tiptap-toolbar-separator{pointer-events:none;align-self:stretch;inline-size:1px;margin-inline:1px;position:relative}.lb-tiptap-toolbar-separator:before{content:"";background:var(--lb-foreground-subtle);position:absolute;inset:10% 0}.lb-tiptap-ai-selection{background:var(--lb-selection,#00f3);pointer-events:none}.lb-tiptap-ai-toolbar-portal{inline-size:var(--lb-tiptap-editor-width);pointer-events:none;outline:none;flex-direction:column;gap:8px;display:flex}.lb-tiptap-ai-toolbar-portal:where([data-liveblocks-ai-toolbar-flip]){flex-direction:column-reverse}.lb-tiptap-ai-toolbar-container{--lb-tiptap-ai-toolbar-padding:calc(.5*var(--lb-spacing));--lb-tiptap-ai-toolbar-height:calc(calc(2*.25*var(--lb-spacing) + var(--lb-icon-size)) + 2*var(--lb-tiptap-ai-toolbar-padding));min-block-size:var(--lb-tiptap-ai-toolbar-height);position:relative}.lb-tiptap-ai-toolbar{color:var(--lb-foreground);pointer-events:auto;flex-direction:column;display:flex}.lb-tiptap-ai-toolbar-response-container,.lb-tiptap-ai-toolbar-content{max-block-size:calc(6lh + 2*var(--lb-tiptap-ai-toolbar-padding));overflow-y:auto}.lb-tiptap-ai-toolbar-content{inline-size:100%;min-inline-size:0;padding:var(--lb-tiptap-ai-toolbar-padding);outline:none;grid-template-columns:auto 1fr auto;display:grid}.lb-tiptap-ai-toolbar-response-container{--lb-line-height-crop:calc(1lh - 1em)/-2;padding:calc(var(--lb-spacing) + var(--lb-line-height-crop))var(--lb-spacing);border-block-end:1px solid var(--lb-foreground-subtle);flex-direction:column;display:flex}.lb-tiptap-ai-toolbar-response{white-space:pre-wrap}.lb-tiptap-ai-toolbar-response:before{content:"";vertical-align:middle;-webkit-user-select:none;user-select:none;display:inline-block}.lb-tiptap-ai-toolbar-icon-container,.lb-tiptap-ai-toolbar-actions{block-size:calc(2*.25*var(--lb-spacing) + var(--lb-icon-size));flex:none;display:flex}.lb-tiptap-ai-toolbar-icon-container{color:var(--lb-foreground-moderate);align-self:start;align-items:center;position:sticky;inset-block-start:0}.lb-tiptap-ai-toolbar-actions{gap:var(--lb-tiptap-ai-toolbar-padding);align-self:end;position:sticky;inset-block-end:0}.lb-tiptap-ai-toolbar-custom-prompt{all:unset;color:var(--lb-foreground);resize:none;background:0 0;outline:none}.lb-tiptap-ai-toolbar-custom-prompt::placeholder{color:var(--lb-foreground-moderate)}.lb-tiptap-ai-toolbar-custom-prompt-container{z-index:auto;margin-block:calc(-1*var(--lb-tiptap-ai-toolbar-padding));display:grid;position:relative}.lb-tiptap-ai-toolbar-custom-prompt-container:before{content:attr(data-value)" ";visibility:hidden}.lb-tiptap-ai-toolbar-custom-prompt,.lb-tiptap-ai-toolbar-custom-prompt-container:before{box-sizing:inherit;inline-size:100%;min-inline-size:0;padding:calc(var(--lb-tiptap-ai-toolbar-padding) + (calc(2*.25*var(--lb-spacing) + var(--lb-icon-size)) - 1lh)/2)var(--lb-tiptap-ai-toolbar-padding);font:inherit;letter-spacing:inherit;white-space:pre-wrap;grid-area:1/1/2/2}.lb-tiptap-ai-toolbar-error{--lb-dynamic-background:var(--lb-background-destructive-subtle);gap:calc(.5*var(--lb-spacing));padding:var(--lb-tiptap-ai-toolbar-padding);background:var(--lb-dynamic-background);color:var(--lb-destructive);text-wrap:balance;align-items:center;font-size:.875em;display:flex;position:relative}.lb-tiptap-ai-toolbar-error:after{content:"";border-block-start:1px solid var(--lb-destructive-moderate);opacity:.35;pointer-events:none;position:absolute;inset:0}.lb-tiptap-ai-toolbar-error :where(.lb-icon-container){color:var(--lb-destructive-secondary)}.lb-tiptap-ai-toolbar-halo{--lb-tiptap-ai-toolbar-halo-blur:16px;--lb-tiptap-ai-toolbar-halo-outset:8px;inset:calc(-1*var(--lb-tiptap-ai-toolbar-halo-outset));z-index:-1;border-radius:calc(var(--lb-radius) + var(--lb-tiptap-ai-toolbar-halo-outset));filter:blur(var(--lb-tiptap-ai-toolbar-halo-blur));pointer-events:none;transition-property:opacity;transition-duration:1s;animation:1s cubic-bezier(.165,.84,.44,1) both lb-animation-ai-toolbar-halo-scale-in;position:absolute;overflow:hidden}.lb-tiptap-ai-toolbar-halo:where(:not([data-active])){opacity:.5}:is(.lb-tiptap-ai-toolbar-halo-horizontal,.lb-tiptap-ai-toolbar-halo-vertical){position:absolute;inset:0}:is(.lb-tiptap-ai-toolbar-halo-horizontal,.lb-tiptap-ai-toolbar-halo-vertical):before,:is(.lb-tiptap-ai-toolbar-halo-horizontal,.lb-tiptap-ai-toolbar-halo-vertical):after{content:"";opacity:.175;animation-timing-function:cubic-bezier(.455,.03,.515,.955);animation-iteration-count:infinite;position:absolute;inset:0}.lb-tiptap-ai-toolbar-halo-horizontal:before{background:linear-gradient(30deg,transparent 20%,var(--lb-accent)50%,transparent 80%);background-position:0 0;background-size:50% 100%;block-size:100%;inline-size:200%;animation-name:lb-animation-ai-toolbar-halo-horizontal;animation-duration:8s;animation-direction:alternate}.lb-tiptap-ai-toolbar-halo-horizontal:after{background:linear-gradient(90deg,transparent 20%,var(--lb-accent)50%,transparent 80%);background-position:0 0;background-size:75% 100%;block-size:100%;inline-size:400%;animation-name:lb-animation-ai-toolbar-halo-horizontal;animation-duration:6s;animation-direction:alternate-reverse;animation-delay:-2s;inset-inline-start:-50%}.lb-tiptap-ai-toolbar-halo-vertical:before{background:linear-gradient(1deg,transparent 40%,var(--lb-accent)50%,transparent 60%);background-position:0 0;background-repeat:round;background-size:100% 600px;block-size:400%;inline-size:100%;animation-name:lb-animation-ai-toolbar-halo-vertical;animation-duration:4s;animation-direction:alternate-reverse;animation-delay:-2s;inset-block-start:-50%}.lb-tiptap-ai-toolbar-halo-vertical:after{background:linear-gradient(-2deg,transparent 40%,var(--lb-accent)50%,transparent 60%);background-position:0 0;background-repeat:round;background-size:100% 400px;block-size:400%;inline-size:100%;animation-name:lb-animation-ai-toolbar-halo-vertical;animation-duration:3s;animation-direction:alternate;animation-delay:-1s;inset-block-start:-50%}.lb-tiptap-ai-toolbar-thinking{text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;max-inline-size:fit-content;padding-inline:var(--lb-tiptap-ai-toolbar-padding);color:var(--lb-foreground-tertiary);-webkit-user-select:none;user-select:none;align-self:center;animation:5s linear infinite lb-animation-shimmer-text;overflow:hidden}.lb-tiptap-ai-toolbar-dropdown{pointer-events:auto;inline-size:min(250px,100%)}.lb-tiptap-change-removed{color:color-mix(in srgb,currentcolor 40%,transparent);text-decoration:line-through;text-decoration-thickness:1px}.lb-tiptap-change-added{background:color-mix(in srgb,var(--lb-accent)calc(var(--lb-accent-contrast)*1.5),transparent);color:var(--lb-accent)}.collaboration-carets__caret,.collaboration-cursor__caret{word-break:normal;pointer-events:none;border-inline:1px solid #0d0d0d;margin-inline:-1px;position:relative}.collaboration-carets__label,.collaboration-cursor__label{border-radius:6px;color:#fff;white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none;border-end-start-radius:0;padding:2px 6px;font-size:14px;font-style:normal;font-weight:600;line-height:normal;position:absolute;inset-block-start:-1.4em;inset-inline-start:-1px}@keyframes lb-animation-ai-toolbar-halo-scale-in{0%{transform:scale(.5)}to{transform:scale(1)}}@keyframes lb-animation-ai-toolbar-halo-horizontal{0%{transform:translate(-50%)}to{transform:translate(0)}}@keyframes lb-animation-ai-toolbar-halo-vertical{0%{transform:translateY(0)}to{transform:translateY(-50%)}}@media (prefers-reduced-motion){.lb-tiptap-suggestions:where(:not([data-state=closed])){animation-name:lb-animation-appear}.lb-tiptap-anchored-threads-thread-container{transition-duration:0s}}
|
package/styles.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["src/styles/src/styles/index.css","src/styles/src/styles/utils.css"],"names":[],"mappings":"AAOA,4BAAA,QAAA,CAAA,SAAA,CAAA,eAAA,CAUA,uBAAA,gDAAA,CAAA,qDAAA,CAAA,6BAAA,CAAA,WAAA,CAOA,iCAAA,6DAAA,CAAA,8CAAA,CAAA,oCAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,kBAAA,CAAA,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BAoBF,sBAAA,CAAA,kBAAA,CAAA,iBAAA,CAAA,2BAAA,CAAA,kDAAA,CAAA,mCAAA,CAAA,wBAAA,CAAA,gBAAA,CAAA,iBAAA,CAAA,sDAAA,CAAA,eAAA,CAAA,+BAYA,mBAAA,CAAA,2BAAA,CAAA,0BASA,qDAAA,CAAA,4BAAA,CAAA,6BAAA,CAAA,wBAMA,6FAAA,CAAA,sBAAA,CAAA,6BAeA,iBAAA,CAAA,mBAAA,CAAA,+BAAA,CAAA,kBAAA,CAAA,iBAAA,CAAA,6BAYA,iBAAA,CAAA,UAAA,CAAA,kBAAA,CAAA,mBAAA,CAAA,wBAAA,CAAA,gBAAA,CAAA,yBAAA,CAAA,eAAA,CAAA,cAAA,CAAA,iBAAA,CAAA,eAAA,CAAA,kBAAA,CAAA,iBAAA,CAAA,wBAAA,CAAA,uBAAA,CAAA,iDAqBA,GAAA,mBAAA,CAAA,GAAA,kBAAA,CAAA,CAAA,mDAUA,GAAA,yBAAA,CAAA,GAAA,sBAAA,CAAA,CAAA,iDAUA,GAAA,uBAAA,CAAA,GAAA,0BAAA,CAAA,CAAA,gCA3lBA,wDACE,kCAAA,CAAA,6CAgHA,sBAAA,CAAA","file":"styles.css","sourcesContent":["@import \"./utils\";\n@import \"./constants\";\n\n/*************************************\n * Suggestions *\n *************************************/\n\n.lb-tiptap-suggestions-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/*************************************\n * Elevation lists *\n *************************************/\n\n.lb-tiptap-suggestions {\n padding: $lb-elevation-padding;\n animation-duration: var(--lb-transition-duration);\n animation-timing-function: var(--lb-transition-easing);\n will-change: transform, opacity;\n}\n\n.lb-tiptap-suggestions-list-item {\n display: flex;\n align-items: center;\n padding: calc(0.25 * var(--lb-spacing)) calc(0.5 * var(--lb-spacing));\n border-radius: calc(var(--lb-radius) - 0.75 * $lb-elevation-padding);\n color: var(--lb-foreground-secondary);\n outline: none;\n font-size: 0.875rem;\n cursor: pointer;\n user-select: none;\n transition-property: background, color, opacity;\n scroll-margin-block: $lb-elevation-padding;\n}\n\n:is(.lb-tiptap-suggestions-list-item) {\n &:where(\n [data-highlighted]:not([data-highlighted=\"false\"]),\n [data-selected]:not([data-selected=\"false\"])\n ) {\n background: var(--lb-foreground-subtle);\n transition-duration: calc(var(--lb-transition-duration) / 2);\n }\n\n &:where(:disabled, [data-disabled]:not([data-disabled=\"false\"])) {\n opacity: 0.5;\n cursor: not-allowed;\n }\n}\n\n/*************************************\n * Floating animations *\n *************************************/\n\n:is(.lb-tiptap-suggestions) {\n &:where([data-side=\"top\"]) {\n animation-name: lb-animation-slide-up;\n }\n\n &:where([data-side=\"bottom\"]) {\n animation-name: lb-animation-slide-down;\n }\n\n &:where([data-state=\"closed\"]) {\n animation-name: lb-animation-disappear;\n }\n}\n\n@media (prefers-reduced-motion) {\n .lb-tiptap-suggestions:where(:not([data-state=\"closed\"])) {\n animation-name: lb-animation-appear;\n }\n}\n\n/*************************************\n * Mention suggestions *\n *************************************/\n\n.lb-tiptap-mention-suggestions {\n --lb-tiptap-mention-suggestion-avatar-size: 1.25rem;\n}\n\n.lb-tiptap-mention-suggestion {\n padding-inline-start: calc(0.5 * var(--lb-spacing));\n padding-inline-end: calc(0.625 * var(--lb-spacing));\n padding-block: calc(0.25 * var(--lb-spacing));\n}\n\n.lb-tiptap-mention-suggestion-avatar {\n display: flex;\n justify-content: center;\n align-items: center;\n inline-size: var(--lb-tiptap-mention-suggestion-avatar-size);\n block-size: var(--lb-tiptap-mention-suggestion-avatar-size);\n margin-inline-start: calc(-0.125 * var(--lb-spacing));\n margin-inline-end: calc(0.5 * var(--lb-spacing));\n margin-block: calc(0.125 * var(--lb-spacing));\n\n &:where(.lb-avatar) {\n background: var(--lb-foreground-subtle);\n color: var(--lb-foreground-moderate);\n }\n\n :where(.lb-icon) {\n color: var(--lb-foreground-moderate);\n }\n}\n\n.lb-tiptap-mention-suggestion-group-description {\n align-self: baseline;\n margin-inline-start: calc(0.625 * var(--lb-spacing));\n color: var(--lb-foreground-tertiary);\n font-size: 0.875em;\n}\n\n/*************************************\n * Mention *\n *************************************/\n\n.lb-tiptap-mention {\n padding: 0.1em 0.3em;\n border-radius: calc(0.675 * var(--lb-radius));\n background: var(--lb-accent-subtle);\n color: var(--lb-accent);\n box-decoration-break: clone;\n font-weight: 500;\n cursor: default;\n\n @include invisible-selection;\n}\n\n.lb-mention-selected {\n background: var(--lb-accent);\n color: var(--lb-accent-foreground);\n}\n\n/*************************************\n * Thread mark *\n *************************************/\n\n:where(.lb-tiptap-thread-mark:not([data-orphan=\"true\"], [data-hidden])) {\n background: var(--lb-accent-subtle);\n color: var(--lb-foreground);\n outline: none;\n font-weight: 500;\n transition-property: color, text-decoration-color;\n text-decoration-line: underline;\n text-decoration-color: var(--lb-foreground-moderate);\n text-underline-offset: 2px;\n}\n\n:where(\n .lb-tiptap-thread-mark:not([data-orphan=\"true\"], [data-hidden])\n .lb-tiptap-thread-mark-selected\n) {\n color: var(--lb-accent);\n text-decoration-line: underline;\n text-decoration-color: var(--lb-accent-moderate);\n text-underline-offset: 2px;\n}\n\n.lb-tiptap-thread-mark {\n /* Add some space above/below when scrolling to it. */\n scroll-margin-block: var(--lb-spacing);\n}\n\n/*************************************\n * Anchored threads *\n *************************************/\n\n.lb-tiptap-anchored-threads {\n --lb-tiptap-anchored-threads-gap: 1.25rem;\n --lb-tiptap-anchored-threads-active-thread-offset: -0.75rem;\n}\n\n.lb-tiptap-anchored-threads-thread-container {\n transition-duration: calc(var(--lb-transition-duration) * 2);\n transition-property: transform;\n}\n\n@media (prefers-reduced-motion) {\n .lb-tiptap-anchored-threads-thread-container {\n transition-duration: 0s;\n }\n}\n\n.lb-tiptap-anchored-threads-thread {\n position: relative;\n overflow: hidden;\n border-radius: var(--lb-radius);\n background: var(--lb-dynamic-background);\n box-shadow: $lb-tiptap-anchored-threads-shadow;\n transition-property: background, box-shadow;\n\n &::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 1;\n border-radius: inherit;\n box-shadow: var(--lb-inset-shadow);\n pointer-events: none;\n }\n\n &:where([data-state=\"active\"]) {\n box-shadow: $lb-tiptap-anchored-threads-active-shadow;\n }\n}\n\n/*************************************\n * Floating components *\n *************************************/\n\n.lb-tiptap-floating {\n --lb-tiptap-floating-size: 350px;\n}\n\n/*************************************\n * Floating threads *\n *************************************/\n\n.lb-tiptap-floating-threads-thread {\n inline-size: var(--lb-tiptap-floating-size);\n\n &:where(:not(:last-of-type)) {\n border-block-end: 1px solid var(--lb-foreground-subtle);\n }\n}\n\n/*************************************\n * Floating composer *\n *************************************/\n\n.lb-tiptap-floating-composer {\n inline-size: var(--lb-tiptap-floating-size);\n}\n\n/*************************************\n * Active selection *\n *************************************/\n\n.lb-tiptap-active-selection {\n background: var(--lb-selection, rgb(0 0 255 / 20%));\n pointer-events: none;\n}\n\n/*************************************\n * Toolbar *\n *************************************/\n\n.lb-tiptap-toolbar {\n --lb-tiptap-toolbar-spacing: calc(0.25 * var(--lb-spacing));\n\n position: relative;\n display: flex;\n flex-direction: row;\n gap: var(--lb-tiptap-toolbar-spacing);\n align-items: center;\n padding: var(--lb-tiptap-toolbar-spacing);\n background: var(--lb-background);\n\n /* overflow-inline: auto; doesn't work as expected */\n /* stylelint-disable-next-line plugin/use-logical-properties-and-values */\n overflow-x: auto;\n\n @include invisible-scrollbar;\n\n > * {\n flex: none;\n }\n}\n\n.lb-tiptap-floating-toolbar {\n --lb-tiptap-toolbar-spacing: $lb-elevation-padding;\n}\n\n.lb-tiptap-toolbar-separator {\n position: relative;\n align-self: stretch;\n inline-size: 1px;\n margin-inline: 1px;\n pointer-events: none;\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 10% 0;\n background: var(--lb-foreground-subtle);\n }\n}\n\n/*************************************\n * AI Toolbar *\n *************************************/\n\n.lb-tiptap-ai-selection {\n background: var(--lb-selection, rgb(0 0 255 / 20%));\n pointer-events: none;\n}\n\n.lb-tiptap-ai-toolbar-portal {\n display: flex;\n flex-direction: column;\n gap: 8px;\n inline-size: var(--lb-tiptap-editor-width);\n outline: none;\n pointer-events: none;\n\n &:where([data-liveblocks-ai-toolbar-flip]) {\n flex-direction: column-reverse;\n }\n}\n\n.lb-tiptap-ai-toolbar-container {\n --lb-tiptap-ai-toolbar-padding: calc(0.5 * var(--lb-spacing));\n --lb-tiptap-ai-toolbar-height: calc(\n $lb-button-size + 2 * var(--lb-tiptap-ai-toolbar-padding)\n );\n\n position: relative;\n min-block-size: var(--lb-tiptap-ai-toolbar-height);\n}\n\n.lb-tiptap-ai-toolbar {\n display: flex;\n flex-direction: column;\n color: var(--lb-foreground);\n pointer-events: auto;\n}\n\n.lb-tiptap-ai-toolbar-response-container,\n.lb-tiptap-ai-toolbar-content {\n max-block-size: calc(6lh + 2 * var(--lb-tiptap-ai-toolbar-padding));\n\n /* overflow-block: auto; doesn't work as expected */\n /* stylelint-disable-next-line plugin/use-logical-properties-and-values */\n overflow-y: auto;\n}\n\n.lb-tiptap-ai-toolbar-content {\n display: grid;\n grid-template-columns: auto 1fr auto;\n inline-size: 100%;\n min-inline-size: 0;\n padding: var(--lb-tiptap-ai-toolbar-padding);\n outline: none;\n}\n\n.lb-tiptap-ai-toolbar-response-container {\n --lb-line-height-crop: calc(1lh - 1em) / -2;\n\n display: flex;\n flex-direction: column;\n padding: calc(var(--lb-spacing) + var(--lb-line-height-crop))\n var(--lb-spacing);\n border-block-end: 1px solid var(--lb-foreground-subtle);\n}\n\n.lb-tiptap-ai-toolbar-response {\n white-space: pre-wrap;\n\n &::before {\n content: \"\\FEFF\";\n display: inline-block;\n vertical-align: middle;\n user-select: none;\n }\n}\n\n.lb-tiptap-ai-toolbar-icon-container,\n.lb-tiptap-ai-toolbar-actions {\n display: flex;\n flex: none;\n block-size: $lb-button-size;\n}\n\n.lb-tiptap-ai-toolbar-icon-container {\n position: sticky;\n inset-block-start: 0;\n align-items: center;\n align-self: start;\n color: var(--lb-foreground-moderate);\n}\n\n.lb-tiptap-ai-toolbar-actions {\n position: sticky;\n inset-block-end: 0;\n gap: var(--lb-tiptap-ai-toolbar-padding);\n align-self: end;\n}\n\n.lb-tiptap-ai-toolbar-custom-prompt {\n all: unset;\n background: transparent;\n color: var(--lb-foreground);\n outline: none;\n resize: none;\n\n &::placeholder {\n color: var(--lb-foreground-moderate);\n }\n}\n\n.lb-tiptap-ai-toolbar-custom-prompt-container {\n position: relative;\n z-index: auto;\n display: grid;\n margin-block: calc(-1 * var(--lb-tiptap-ai-toolbar-padding));\n\n &::before {\n /* The space is important when handling new lines */\n content: attr(data-value) \" \";\n visibility: hidden;\n }\n}\n\n.lb-tiptap-ai-toolbar-custom-prompt,\n.lb-tiptap-ai-toolbar-custom-prompt-container::before {\n /* Overlap the textarea and its value to auto-size it */\n grid-area: 1 / 1 / 2 / 2;\n box-sizing: inherit;\n inline-size: 100%;\n min-inline-size: 0;\n padding: calc(\n var(--lb-tiptap-ai-toolbar-padding) + ($lb-button-size - 1lh) / 2\n )\n var(--lb-tiptap-ai-toolbar-padding);\n font: inherit;\n letter-spacing: inherit;\n white-space: pre-wrap;\n}\n\n.lb-tiptap-ai-toolbar-error {\n --lb-dynamic-background: var(--lb-background-destructive-subtle);\n\n position: relative;\n display: flex;\n gap: calc(0.5 * var(--lb-spacing));\n align-items: center;\n padding: var(--lb-tiptap-ai-toolbar-padding);\n background: var(--lb-dynamic-background);\n color: var(--lb-destructive);\n font-size: 0.875em;\n text-wrap: balance;\n\n &::after {\n content: \"\";\n position: absolute;\n inset: 0;\n border-block-start: 1px solid var(--lb-destructive-moderate);\n opacity: 0.35;\n pointer-events: none;\n }\n\n :where(.lb-icon-container) {\n color: var(--lb-destructive-secondary);\n }\n}\n\n.lb-tiptap-ai-toolbar-halo {\n --lb-tiptap-ai-toolbar-halo-blur: 16px;\n --lb-tiptap-ai-toolbar-halo-outset: 8px;\n\n position: absolute;\n inset: calc(-1 * var(--lb-tiptap-ai-toolbar-halo-outset));\n z-index: -1;\n overflow: hidden;\n border-radius: calc(\n var(--lb-radius) + var(--lb-tiptap-ai-toolbar-halo-outset)\n );\n filter: blur(var(--lb-tiptap-ai-toolbar-halo-blur));\n pointer-events: none;\n transition-duration: 1s;\n transition-property: opacity;\n animation: lb-animation-ai-toolbar-halo-scale-in 1s\n cubic-bezier(0.165, 0.84, 0.44, 1) both;\n\n &:where(:not([data-active])) {\n opacity: 0.5;\n }\n}\n\n:is(\n .lb-tiptap-ai-toolbar-halo-horizontal,\n .lb-tiptap-ai-toolbar-halo-vertical\n) {\n position: absolute;\n inset: 0;\n\n &::before,\n &::after {\n content: \"\";\n position: absolute;\n inset: 0;\n opacity: 0.175;\n animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955);\n animation-iteration-count: infinite;\n }\n}\n\n.lb-tiptap-ai-toolbar-halo-horizontal {\n &::before {\n inline-size: 200%;\n block-size: 100%;\n background: linear-gradient(\n 30deg,\n transparent 20%,\n var(--lb-accent) 50%,\n transparent 80%\n );\n background-position: top left;\n background-size: 50% 100%;\n animation-name: lb-animation-ai-toolbar-halo-horizontal;\n animation-duration: 8s;\n animation-direction: alternate;\n }\n\n &::after {\n inset-inline-start: -50%;\n inline-size: 400%;\n block-size: 100%;\n background: linear-gradient(\n 90deg,\n transparent 20%,\n var(--lb-accent) 50%,\n transparent 80%\n );\n background-position: top left;\n background-size: 75% 100%;\n animation-name: lb-animation-ai-toolbar-halo-horizontal;\n animation-duration: 6s;\n animation-delay: -2s;\n animation-direction: alternate-reverse;\n }\n}\n\n.lb-tiptap-ai-toolbar-halo-vertical {\n &::before {\n inset-block-start: -50%;\n inline-size: 100%;\n block-size: 400%;\n background: linear-gradient(\n 1deg,\n transparent 40%,\n var(--lb-accent) 50%,\n transparent 60%\n );\n background-position: top left;\n background-size: 100% 600px;\n background-repeat: round;\n animation-name: lb-animation-ai-toolbar-halo-vertical;\n animation-duration: 4s;\n animation-delay: -2s;\n animation-direction: alternate-reverse;\n }\n\n &::after {\n inset-block-start: -50%;\n inline-size: 100%;\n block-size: 400%;\n background: linear-gradient(\n -2deg,\n transparent 40%,\n var(--lb-accent) 50%,\n transparent 60%\n );\n background-position: top left;\n background-size: 100% 400px;\n background-repeat: round;\n animation-name: lb-animation-ai-toolbar-halo-vertical;\n animation-duration: 3s;\n animation-delay: -1s;\n animation-direction: alternate;\n }\n}\n\n.lb-tiptap-ai-toolbar-thinking {\n @include truncate;\n\n align-self: center;\n min-inline-size: 0;\n max-inline-size: fit-content;\n padding-inline: var(--lb-tiptap-ai-toolbar-padding);\n color: var(--lb-foreground-tertiary);\n user-select: none;\n animation: lb-animation-shimmer-text 5s linear infinite;\n}\n\n.lb-tiptap-ai-toolbar-dropdown {\n inline-size: min(250px, 100%);\n pointer-events: auto;\n}\n\n/*************************************\n * Diff Changes *\n *************************************/\n\n.lb-tiptap-change-removed {\n color: color-mix(in srgb, currentcolor 40%, transparent);\n text-decoration: line-through;\n text-decoration-thickness: 1px;\n}\n\n.lb-tiptap-change-added {\n background: color-mix(\n in srgb,\n var(--lb-accent) calc(var(--lb-accent-contrast) * 1.5),\n transparent\n );\n color: var(--lb-accent);\n}\n\n/*************************************\n * Collaboration cursors *\n *************************************/\n\n/* Give a remote user a caret */\n/* stylelint-disable-next-line selector-class-pattern */\n.collaboration-cursor__caret {\n position: relative;\n margin-inline-start: -1px;\n margin-inline-end: -1px;\n border-inline-start: 1px solid #0d0d0d;\n border-inline-end: 1px solid #0d0d0d;\n word-break: normal;\n pointer-events: none;\n}\n\n/* Render the username above the caret */\n/* stylelint-disable-next-line selector-class-pattern */\n.collaboration-cursor__label {\n position: absolute;\n inset-inline-start: -1px;\n inset-block-start: -1.4em;\n padding: 2px 6px;\n border-radius: 6px;\n border-end-start-radius: 0;\n color: #fff;\n font-weight: 600;\n font-style: normal;\n font-size: 14px;\n line-height: normal;\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n}\n\n/*************************************\n * Animations *\n *************************************/\n\n@keyframes lb-animation-ai-toolbar-halo-scale-in {\n from {\n transform: scale(0.5);\n }\n\n to {\n transform: scale(1);\n }\n}\n\n@keyframes lb-animation-ai-toolbar-halo-horizontal {\n from {\n transform: translateX(-50%);\n }\n\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes lb-animation-ai-toolbar-halo-vertical {\n from {\n transform: translateY(0);\n }\n\n to {\n transform: translateY(-50%);\n }\n}\n","@mixin invisible-selection {\n &::selection,\n *::selection {\n background: transparent;\n }\n}\n\n@mixin invisible-scrollbar {\n & {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n@mixin truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["src/styles/src/styles/index.css","src/styles/src/styles/utils.css"],"names":[],"mappings":"AAQA,4BAAA,QAAA,CAAA,SAAA,CAAA,eAAA,CAUA,uBAAA,gDAAA,CAAA,qDAAA,CAAA,6BAAA,CAAA,WAAA,CAOA,iCAAA,6DAAA,CAAA,8CAAA,CAAA,oCAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,kBAAA,CAAA,uBAAA,CAAA,iBAAA,CAAA,4CAAA,CAAA,YAAA,CAeE,oIAAA,sCAAA,CAAA,yDAAA,CAQA,6FAAA,UAAA,CAAA,kBAAA,CAWA,8CAAA,oCAAA,CAIA,iDAAA,sCAAA,CAIA,kDAAA,qCAAA,CAeF,+BAAA,kDAAA,CAIA,8BAAA,+CAAA,CAAA,+CAAA,CAAA,yCAAA,CAMA,qCAAA,2DAAA,CAAA,0DAAA,CAAA,iDAAA,CAAA,4CAAA,CAAA,yCAAA,CAAA,sBAAA,CAAA,kBAAA,CAAA,YAAA,CAUE,uDAAA,sCAAA,CAAA,mCAAA,CAKA,sDAAA,mCAAA,CAKF,gDAAA,mCAAA,CAAA,mBAAA,CAAA,gDAAA,CAAA,gBAAA,CAWA,mBAAA,yCAAA,CAAA,kCAAA,CAAA,sBAAA,CAAA,kCAAA,CAA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AA,CAAA,iDAsBA,GAAA,mBAAA,CAAA,GAAA,kBAAA,CAAA,CAAA,mDAUA,GAAA,yBAAA,CAAA,GAAA,sBAAA,CAAA,CAAA,iDAUA,GAAA,uBAAA,CAAA,GAAA,0BAAA,CAAA,CAAA,gCA3lBA,wDACE,kCAAA,CAAA,6CAgHA,sBAAA,CAAA","file":"styles.css","sourcesContent":["/* stylelint-disable selector-class-pattern */\n@import \"./utils\";\n@import \"./constants\";\n\n/*************************************\n * Suggestions *\n *************************************/\n\n.lb-tiptap-suggestions-list {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n/*************************************\n * Elevation lists *\n *************************************/\n\n.lb-tiptap-suggestions {\n padding: $lb-elevation-padding;\n animation-duration: var(--lb-transition-duration);\n animation-timing-function: var(--lb-transition-easing);\n will-change: transform, opacity;\n}\n\n.lb-tiptap-suggestions-list-item {\n display: flex;\n align-items: center;\n padding: calc(0.25 * var(--lb-spacing)) calc(0.5 * var(--lb-spacing));\n border-radius: calc(var(--lb-radius) - 0.75 * $lb-elevation-padding);\n color: var(--lb-foreground-secondary);\n outline: none;\n font-size: 0.875rem;\n cursor: pointer;\n user-select: none;\n transition-property: background, color, opacity;\n scroll-margin-block: $lb-elevation-padding;\n}\n\n:is(.lb-tiptap-suggestions-list-item) {\n &:where(\n [data-highlighted]:not([data-highlighted=\"false\"]),\n [data-selected]:not([data-selected=\"false\"])\n ) {\n background: var(--lb-foreground-subtle);\n transition-duration: calc(var(--lb-transition-duration) / 2);\n }\n\n &:where(:disabled, [data-disabled]:not([data-disabled=\"false\"])) {\n opacity: 0.5;\n cursor: not-allowed;\n }\n}\n\n/*************************************\n * Floating animations *\n *************************************/\n\n:is(.lb-tiptap-suggestions) {\n &:where([data-side=\"top\"]) {\n animation-name: lb-animation-slide-up;\n }\n\n &:where([data-side=\"bottom\"]) {\n animation-name: lb-animation-slide-down;\n }\n\n &:where([data-state=\"closed\"]) {\n animation-name: lb-animation-disappear;\n }\n}\n\n@media (prefers-reduced-motion) {\n .lb-tiptap-suggestions:where(:not([data-state=\"closed\"])) {\n animation-name: lb-animation-appear;\n }\n}\n\n/*************************************\n * Mention suggestions *\n *************************************/\n\n.lb-tiptap-mention-suggestions {\n --lb-tiptap-mention-suggestion-avatar-size: 1.25rem;\n}\n\n.lb-tiptap-mention-suggestion {\n padding-inline-start: calc(0.5 * var(--lb-spacing));\n padding-inline-end: calc(0.625 * var(--lb-spacing));\n padding-block: calc(0.25 * var(--lb-spacing));\n}\n\n.lb-tiptap-mention-suggestion-avatar {\n display: flex;\n justify-content: center;\n align-items: center;\n inline-size: var(--lb-tiptap-mention-suggestion-avatar-size);\n block-size: var(--lb-tiptap-mention-suggestion-avatar-size);\n margin-inline-start: calc(-0.125 * var(--lb-spacing));\n margin-inline-end: calc(0.5 * var(--lb-spacing));\n margin-block: calc(0.125 * var(--lb-spacing));\n\n &:where(.lb-avatar) {\n background: var(--lb-foreground-subtle);\n color: var(--lb-foreground-moderate);\n }\n\n :where(.lb-icon) {\n color: var(--lb-foreground-moderate);\n }\n}\n\n.lb-tiptap-mention-suggestion-group-description {\n align-self: baseline;\n margin-inline-start: calc(0.625 * var(--lb-spacing));\n color: var(--lb-foreground-tertiary);\n font-size: 0.875em;\n}\n\n/*************************************\n * Mention *\n *************************************/\n\n.lb-tiptap-mention {\n padding: 0.1em 0.3em;\n border-radius: calc(0.675 * var(--lb-radius));\n background: var(--lb-accent-subtle);\n color: var(--lb-accent);\n box-decoration-break: clone;\n font-weight: 500;\n cursor: default;\n\n @include invisible-selection;\n}\n\n.lb-mention-selected {\n background: var(--lb-accent);\n color: var(--lb-accent-foreground);\n}\n\n/*************************************\n * Thread mark *\n *************************************/\n\n:where(.lb-tiptap-thread-mark:not([data-orphan=\"true\"], [data-hidden])) {\n background: var(--lb-accent-subtle);\n color: var(--lb-foreground);\n outline: none;\n font-weight: 500;\n transition-property: color, text-decoration-color;\n text-decoration-line: underline;\n text-decoration-color: var(--lb-foreground-moderate);\n text-underline-offset: 2px;\n}\n\n:where(\n .lb-tiptap-thread-mark:not([data-orphan=\"true\"], [data-hidden])\n .lb-tiptap-thread-mark-selected\n) {\n color: var(--lb-accent);\n text-decoration-line: underline;\n text-decoration-color: var(--lb-accent-moderate);\n text-underline-offset: 2px;\n}\n\n.lb-tiptap-thread-mark {\n /* Add some space above/below when scrolling to it. */\n scroll-margin-block: var(--lb-spacing);\n}\n\n/*************************************\n * Anchored threads *\n *************************************/\n\n.lb-tiptap-anchored-threads {\n --lb-tiptap-anchored-threads-gap: 1.25rem;\n --lb-tiptap-anchored-threads-active-thread-offset: -0.75rem;\n}\n\n.lb-tiptap-anchored-threads-thread-container {\n transition-duration: calc(var(--lb-transition-duration) * 2);\n transition-property: transform;\n}\n\n@media (prefers-reduced-motion) {\n .lb-tiptap-anchored-threads-thread-container {\n transition-duration: 0s;\n }\n}\n\n.lb-tiptap-anchored-threads-thread {\n position: relative;\n overflow: hidden;\n border-radius: var(--lb-radius);\n background: var(--lb-dynamic-background);\n box-shadow: $lb-tiptap-anchored-threads-shadow;\n transition-property: background, box-shadow;\n\n &::after {\n content: \"\";\n position: absolute;\n inset: 0;\n z-index: 1;\n border-radius: inherit;\n box-shadow: var(--lb-inset-shadow);\n pointer-events: none;\n }\n\n &:where([data-state=\"active\"]) {\n box-shadow: $lb-tiptap-anchored-threads-active-shadow;\n }\n}\n\n/*************************************\n * Floating components *\n *************************************/\n\n.lb-tiptap-floating {\n --lb-tiptap-floating-size: 350px;\n}\n\n/*************************************\n * Floating threads *\n *************************************/\n\n.lb-tiptap-floating-threads-thread {\n inline-size: var(--lb-tiptap-floating-size);\n\n &:where(:not(:last-of-type)) {\n border-block-end: 1px solid var(--lb-foreground-subtle);\n }\n}\n\n/*************************************\n * Floating composer *\n *************************************/\n\n.lb-tiptap-floating-composer {\n inline-size: var(--lb-tiptap-floating-size);\n}\n\n/*************************************\n * Active selection *\n *************************************/\n\n.lb-tiptap-active-selection {\n background: var(--lb-selection, rgb(0 0 255 / 20%));\n pointer-events: none;\n}\n\n/*************************************\n * Toolbar *\n *************************************/\n\n.lb-tiptap-toolbar {\n --lb-tiptap-toolbar-spacing: calc(0.25 * var(--lb-spacing));\n\n position: relative;\n display: flex;\n flex-direction: row;\n gap: var(--lb-tiptap-toolbar-spacing);\n align-items: center;\n padding: var(--lb-tiptap-toolbar-spacing);\n background: var(--lb-background);\n\n /* overflow-inline: auto; doesn't work as expected */\n /* stylelint-disable-next-line plugin/use-logical-properties-and-values */\n overflow-x: auto;\n\n @include invisible-scrollbar;\n\n > * {\n flex: none;\n }\n}\n\n.lb-tiptap-floating-toolbar {\n --lb-tiptap-toolbar-spacing: $lb-elevation-padding;\n}\n\n.lb-tiptap-toolbar-separator {\n position: relative;\n align-self: stretch;\n inline-size: 1px;\n margin-inline: 1px;\n pointer-events: none;\n\n &::before {\n content: \"\";\n position: absolute;\n inset: 10% 0;\n background: var(--lb-foreground-subtle);\n }\n}\n\n/*************************************\n * AI Toolbar *\n *************************************/\n\n.lb-tiptap-ai-selection {\n background: var(--lb-selection, rgb(0 0 255 / 20%));\n pointer-events: none;\n}\n\n.lb-tiptap-ai-toolbar-portal {\n display: flex;\n flex-direction: column;\n gap: 8px;\n inline-size: var(--lb-tiptap-editor-width);\n outline: none;\n pointer-events: none;\n\n &:where([data-liveblocks-ai-toolbar-flip]) {\n flex-direction: column-reverse;\n }\n}\n\n.lb-tiptap-ai-toolbar-container {\n --lb-tiptap-ai-toolbar-padding: calc(0.5 * var(--lb-spacing));\n --lb-tiptap-ai-toolbar-height: calc(\n $lb-button-size + 2 * var(--lb-tiptap-ai-toolbar-padding)\n );\n\n position: relative;\n min-block-size: var(--lb-tiptap-ai-toolbar-height);\n}\n\n.lb-tiptap-ai-toolbar {\n display: flex;\n flex-direction: column;\n color: var(--lb-foreground);\n pointer-events: auto;\n}\n\n.lb-tiptap-ai-toolbar-response-container,\n.lb-tiptap-ai-toolbar-content {\n max-block-size: calc(6lh + 2 * var(--lb-tiptap-ai-toolbar-padding));\n\n /* overflow-block: auto; doesn't work as expected */\n /* stylelint-disable-next-line plugin/use-logical-properties-and-values */\n overflow-y: auto;\n}\n\n.lb-tiptap-ai-toolbar-content {\n display: grid;\n grid-template-columns: auto 1fr auto;\n inline-size: 100%;\n min-inline-size: 0;\n padding: var(--lb-tiptap-ai-toolbar-padding);\n outline: none;\n}\n\n.lb-tiptap-ai-toolbar-response-container {\n --lb-line-height-crop: calc(1lh - 1em) / -2;\n\n display: flex;\n flex-direction: column;\n padding: calc(var(--lb-spacing) + var(--lb-line-height-crop))\n var(--lb-spacing);\n border-block-end: 1px solid var(--lb-foreground-subtle);\n}\n\n.lb-tiptap-ai-toolbar-response {\n white-space: pre-wrap;\n\n &::before {\n content: \"\\FEFF\";\n display: inline-block;\n vertical-align: middle;\n user-select: none;\n }\n}\n\n.lb-tiptap-ai-toolbar-icon-container,\n.lb-tiptap-ai-toolbar-actions {\n display: flex;\n flex: none;\n block-size: $lb-button-size;\n}\n\n.lb-tiptap-ai-toolbar-icon-container {\n position: sticky;\n inset-block-start: 0;\n align-items: center;\n align-self: start;\n color: var(--lb-foreground-moderate);\n}\n\n.lb-tiptap-ai-toolbar-actions {\n position: sticky;\n inset-block-end: 0;\n gap: var(--lb-tiptap-ai-toolbar-padding);\n align-self: end;\n}\n\n.lb-tiptap-ai-toolbar-custom-prompt {\n all: unset;\n background: transparent;\n color: var(--lb-foreground);\n outline: none;\n resize: none;\n\n &::placeholder {\n color: var(--lb-foreground-moderate);\n }\n}\n\n.lb-tiptap-ai-toolbar-custom-prompt-container {\n position: relative;\n z-index: auto;\n display: grid;\n margin-block: calc(-1 * var(--lb-tiptap-ai-toolbar-padding));\n\n &::before {\n /* The space is important when handling new lines */\n content: attr(data-value) \" \";\n visibility: hidden;\n }\n}\n\n.lb-tiptap-ai-toolbar-custom-prompt,\n.lb-tiptap-ai-toolbar-custom-prompt-container::before {\n /* Overlap the textarea and its value to auto-size it */\n grid-area: 1 / 1 / 2 / 2;\n box-sizing: inherit;\n inline-size: 100%;\n min-inline-size: 0;\n padding: calc(\n var(--lb-tiptap-ai-toolbar-padding) + ($lb-button-size - 1lh) / 2\n )\n var(--lb-tiptap-ai-toolbar-padding);\n font: inherit;\n letter-spacing: inherit;\n white-space: pre-wrap;\n}\n\n.lb-tiptap-ai-toolbar-error {\n --lb-dynamic-background: var(--lb-background-destructive-subtle);\n\n position: relative;\n display: flex;\n gap: calc(0.5 * var(--lb-spacing));\n align-items: center;\n padding: var(--lb-tiptap-ai-toolbar-padding);\n background: var(--lb-dynamic-background);\n color: var(--lb-destructive);\n font-size: 0.875em;\n text-wrap: balance;\n\n &::after {\n content: \"\";\n position: absolute;\n inset: 0;\n border-block-start: 1px solid var(--lb-destructive-moderate);\n opacity: 0.35;\n pointer-events: none;\n }\n\n :where(.lb-icon-container) {\n color: var(--lb-destructive-secondary);\n }\n}\n\n.lb-tiptap-ai-toolbar-halo {\n --lb-tiptap-ai-toolbar-halo-blur: 16px;\n --lb-tiptap-ai-toolbar-halo-outset: 8px;\n\n position: absolute;\n inset: calc(-1 * var(--lb-tiptap-ai-toolbar-halo-outset));\n z-index: -1;\n overflow: hidden;\n border-radius: calc(\n var(--lb-radius) + var(--lb-tiptap-ai-toolbar-halo-outset)\n );\n filter: blur(var(--lb-tiptap-ai-toolbar-halo-blur));\n pointer-events: none;\n transition-duration: 1s;\n transition-property: opacity;\n animation: lb-animation-ai-toolbar-halo-scale-in 1s\n cubic-bezier(0.165, 0.84, 0.44, 1) both;\n\n &:where(:not([data-active])) {\n opacity: 0.5;\n }\n}\n\n:is(\n .lb-tiptap-ai-toolbar-halo-horizontal,\n .lb-tiptap-ai-toolbar-halo-vertical\n) {\n position: absolute;\n inset: 0;\n\n &::before,\n &::after {\n content: \"\";\n position: absolute;\n inset: 0;\n opacity: 0.175;\n animation-timing-function: cubic-bezier(0.455, 0.03, 0.515, 0.955);\n animation-iteration-count: infinite;\n }\n}\n\n.lb-tiptap-ai-toolbar-halo-horizontal {\n &::before {\n inline-size: 200%;\n block-size: 100%;\n background: linear-gradient(\n 30deg,\n transparent 20%,\n var(--lb-accent) 50%,\n transparent 80%\n );\n background-position: top left;\n background-size: 50% 100%;\n animation-name: lb-animation-ai-toolbar-halo-horizontal;\n animation-duration: 8s;\n animation-direction: alternate;\n }\n\n &::after {\n inset-inline-start: -50%;\n inline-size: 400%;\n block-size: 100%;\n background: linear-gradient(\n 90deg,\n transparent 20%,\n var(--lb-accent) 50%,\n transparent 80%\n );\n background-position: top left;\n background-size: 75% 100%;\n animation-name: lb-animation-ai-toolbar-halo-horizontal;\n animation-duration: 6s;\n animation-delay: -2s;\n animation-direction: alternate-reverse;\n }\n}\n\n.lb-tiptap-ai-toolbar-halo-vertical {\n &::before {\n inset-block-start: -50%;\n inline-size: 100%;\n block-size: 400%;\n background: linear-gradient(\n 1deg,\n transparent 40%,\n var(--lb-accent) 50%,\n transparent 60%\n );\n background-position: top left;\n background-size: 100% 600px;\n background-repeat: round;\n animation-name: lb-animation-ai-toolbar-halo-vertical;\n animation-duration: 4s;\n animation-delay: -2s;\n animation-direction: alternate-reverse;\n }\n\n &::after {\n inset-block-start: -50%;\n inline-size: 100%;\n block-size: 400%;\n background: linear-gradient(\n -2deg,\n transparent 40%,\n var(--lb-accent) 50%,\n transparent 60%\n );\n background-position: top left;\n background-size: 100% 400px;\n background-repeat: round;\n animation-name: lb-animation-ai-toolbar-halo-vertical;\n animation-duration: 3s;\n animation-delay: -1s;\n animation-direction: alternate;\n }\n}\n\n.lb-tiptap-ai-toolbar-thinking {\n @include truncate;\n\n align-self: center;\n min-inline-size: 0;\n max-inline-size: fit-content;\n padding-inline: var(--lb-tiptap-ai-toolbar-padding);\n color: var(--lb-foreground-tertiary);\n user-select: none;\n animation: lb-animation-shimmer-text 5s linear infinite;\n}\n\n.lb-tiptap-ai-toolbar-dropdown {\n inline-size: min(250px, 100%);\n pointer-events: auto;\n}\n\n/*************************************\n * Diff Changes *\n *************************************/\n\n.lb-tiptap-change-removed {\n color: color-mix(in srgb, currentcolor 40%, transparent);\n text-decoration: line-through;\n text-decoration-thickness: 1px;\n}\n\n.lb-tiptap-change-added {\n background: color-mix(\n in srgb,\n var(--lb-accent) calc(var(--lb-accent-contrast) * 1.5),\n transparent\n );\n color: var(--lb-accent);\n}\n\n/*************************************\n * Collaboration cursors *\n *************************************/\n\n/* Give a remote user a caret */\n.collaboration-carets__caret,\n.collaboration-cursor__caret {\n position: relative;\n margin-inline-start: -1px;\n margin-inline-end: -1px;\n border-inline-start: 1px solid #0d0d0d;\n border-inline-end: 1px solid #0d0d0d;\n word-break: normal;\n pointer-events: none;\n}\n\n/* Render the username above the caret */\n.collaboration-carets__label,\n.collaboration-cursor__label {\n position: absolute;\n inset-inline-start: -1px;\n inset-block-start: -1.4em;\n padding: 2px 6px;\n border-radius: 6px;\n border-end-start-radius: 0;\n color: #fff;\n font-weight: 600;\n font-style: normal;\n font-size: 14px;\n line-height: normal;\n white-space: nowrap;\n pointer-events: none;\n user-select: none;\n}\n\n/*************************************\n * Animations *\n *************************************/\n\n@keyframes lb-animation-ai-toolbar-halo-scale-in {\n from {\n transform: scale(0.5);\n }\n\n to {\n transform: scale(1);\n }\n}\n\n@keyframes lb-animation-ai-toolbar-halo-horizontal {\n from {\n transform: translateX(-50%);\n }\n\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes lb-animation-ai-toolbar-halo-vertical {\n from {\n transform: translateY(0);\n }\n\n to {\n transform: translateY(-50%);\n }\n}\n","@mixin invisible-selection {\n &::selection,\n *::selection {\n background: transparent;\n }\n}\n\n@mixin invisible-scrollbar {\n & {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n\n &::-webkit-scrollbar {\n display: none;\n }\n}\n\n@mixin truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n"]}
|