@dxos/plugin-thread 0.6.9-staging.8e43e2a → 0.6.10-main.bbdfaa4

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.
Files changed (28) hide show
  1. package/dist/lib/browser/{ThreadArticle-J4VCLPMS.mjs → ThreadArticle-O64ZECMF.mjs} +2 -2
  2. package/dist/lib/browser/{ThreadMain-VV7MGQZJ.mjs → ThreadMain-ZDCRC6RG.mjs} +2 -2
  3. package/dist/lib/browser/{chunk-CQ2RYETH.mjs → chunk-P7ZE5N5M.mjs} +2 -2
  4. package/dist/lib/browser/{chunk-CQ2RYETH.mjs.map → chunk-P7ZE5N5M.mjs.map} +2 -2
  5. package/dist/lib/browser/index.mjs +4 -4
  6. package/dist/lib/browser/index.mjs.map +2 -2
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/node/{ThreadArticle-CSENFNNT.cjs → ThreadArticle-DO56JXBU.cjs} +6 -6
  9. package/dist/lib/node/{ThreadMain-XP4YSF7U.cjs → ThreadMain-XJX75GHG.cjs} +6 -6
  10. package/dist/lib/node/{chunk-3VAAUEU5.cjs → chunk-5PZNPPQF.cjs} +5 -5
  11. package/dist/lib/node/{chunk-3VAAUEU5.cjs.map → chunk-5PZNPPQF.cjs.map} +2 -2
  12. package/dist/lib/node/index.cjs +13 -13
  13. package/dist/lib/node/index.cjs.map +2 -2
  14. package/dist/lib/node/meta.json +1 -1
  15. package/dist/types/src/components/Chat.stories.d.ts +1 -1
  16. package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/Comments.stories.d.ts +1 -1
  18. package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/testing.d.ts +2 -2
  20. package/package.json +28 -28
  21. package/src/components/Chat.stories.tsx +1 -1
  22. package/src/components/Comments.stories.tsx +1 -1
  23. package/src/components/CommentsContainer.tsx +1 -1
  24. package/src/components/command-extension.ts +1 -1
  25. /package/dist/lib/browser/{ThreadArticle-J4VCLPMS.mjs.map → ThreadArticle-O64ZECMF.mjs.map} +0 -0
  26. /package/dist/lib/browser/{ThreadMain-VV7MGQZJ.mjs.map → ThreadMain-ZDCRC6RG.mjs.map} +0 -0
  27. /package/dist/lib/node/{ThreadArticle-CSENFNNT.cjs.map → ThreadArticle-DO56JXBU.cjs.map} +0 -0
  28. /package/dist/lib/node/{ThreadMain-XP4YSF7U.cjs.map → ThreadMain-XJX75GHG.cjs.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ThreadPlugin.tsx", "../../../src/components/index.ts", "../../../src/components/ThreadSettings.tsx", "../../../src/components/CommentContainer.tsx", "../../../src/components/CommentsContainer.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Chat, type IconProps } from '@phosphor-icons/react';\nimport { computed, effect } from '@preact/signals-core';\nimport React from 'react';\n\nimport {\n type IntentPluginProvides,\n LayoutAction,\n NavigationAction,\n type LocationProvides,\n type Plugin,\n type PluginDefinition,\n parseIntentPlugin,\n parseNavigationPlugin,\n resolvePlugin,\n parseGraphPlugin,\n SLUG_PATH_SEPARATOR,\n SLUG_COLLECTION_INDICATOR,\n isLayoutParts,\n parseMetadataResolverPlugin,\n type IntentDispatcher,\n} from '@dxos/app-framework';\nimport { type UnsubscribeCallback } from '@dxos/async';\nimport { type EchoReactiveObject, getTypename } from '@dxos/echo-schema';\nimport { create } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { ObservabilityAction } from '@dxos/plugin-observability/meta';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { ThreadType, MessageType, ChannelType } from '@dxos/plugin-space/types';\nimport {\n getSpace,\n getTextInRange,\n Filter,\n createDocAccessor,\n fullyQualifiedId,\n getRangeFromCursor,\n loadObjectReferences,\n} from '@dxos/react-client/echo';\nimport { ScrollArea } from '@dxos/react-ui';\nimport { createAttendableAttributes } from '@dxos/react-ui-attention';\nimport { comments, createExternalCommentSync, listener } from '@dxos/react-ui-editor';\nimport { translations as threadTranslations } from '@dxos/react-ui-thread';\nimport { nonNullable } from '@dxos/util';\n\nimport {\n ThreadMain,\n ThreadSettings,\n CommentsContainer,\n CommentsHeading,\n ChatContainer,\n ChatHeading,\n ThreadArticle,\n} from './components';\nimport meta, { THREAD_ITEM, THREAD_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ThreadAction, type ThreadPluginProvides, type ThreadSettingsProps } from './types';\n\ntype ThreadState = {\n staging: Record<string, ThreadType[]>;\n current?: string | undefined;\n focus?: boolean;\n};\n\ntype SubjectId = string;\nconst initialViewState = { showResolvedThreads: false };\ntype ViewStore = Record<SubjectId, typeof initialViewState>;\n\nexport const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {\n const settings = new LocalStorageStore<ThreadSettingsProps>(THREAD_PLUGIN);\n const state = create<ThreadState>({ staging: {} });\n\n const viewStore = create<ViewStore>({});\n const getViewState = (subjectId: string) => {\n if (!viewStore[subjectId]) {\n viewStore[subjectId] = { ...initialViewState };\n }\n return viewStore[subjectId];\n };\n\n let attentionPlugin: Plugin<AttentionPluginProvides> | undefined;\n let navigationPlugin: Plugin<LocationProvides> | undefined;\n let intentPlugin: Plugin<IntentPluginProvides> | undefined;\n let dispatch: IntentDispatcher | undefined;\n\n const unsubscribeCallbacks = [] as UnsubscribeCallback[];\n\n return {\n meta,\n ready: async (plugins) => {\n settings.prop({ key: 'standalone', type: LocalStorageStore.bool({ allowUndefined: true }) });\n\n attentionPlugin = resolvePlugin(plugins, parseAttentionPlugin);\n navigationPlugin = resolvePlugin(plugins, parseNavigationPlugin);\n intentPlugin = resolvePlugin(plugins, parseIntentPlugin)!;\n dispatch = intentPlugin?.provides.intent.dispatch;\n\n const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n if (!client) {\n return;\n }\n\n // TODO(wittjosiah): This is a hack to make standalone threads work in the c11y sidebar.\n // This should have a better solution when deck is introduced.\n const channelsQuery = client.spaces.query(Filter.schema(ChannelType));\n const queryUnsubscribe = channelsQuery.subscribe();\n const unsubscribe = effect(() => {\n const attention = attentionPlugin?.provides.attention;\n if (!attention?.attended) {\n return;\n }\n\n const firstAttendedNodeWithComments = Array.from(attention.attended)\n .map((id) => graphPlugin?.provides.graph.findNode(id))\n .find((node) => node?.data instanceof DocumentType && (node.data.threads?.length ?? 0) > 0);\n\n if (firstAttendedNodeWithComments) {\n void intentPlugin?.provides.intent.dispatch({\n action: NavigationAction.OPEN,\n data: {\n activeParts: {\n complementary: `${firstAttendedNodeWithComments.id}${SLUG_PATH_SEPARATOR}comments`,\n },\n },\n });\n }\n });\n\n unsubscribeCallbacks.push(queryUnsubscribe);\n unsubscribeCallbacks.push(unsubscribe);\n },\n unload: async () => {\n unsubscribeCallbacks.forEach((unsubscribe) => unsubscribe());\n },\n provides: {\n settings: settings.values,\n metadata: {\n records: {\n [ChannelType.typename]: {\n placeholder: ['channel title placeholder', { ns: THREAD_PLUGIN }],\n icon: (props: IconProps) => <Chat {...props} />,\n iconSymbol: 'ph--chat--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (channel: ChannelType) => loadObjectReferences(channel, (channel) => channel.threads),\n },\n [ThreadType.typename]: {\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (thread: ThreadType) => loadObjectReferences(thread, (thread) => thread.messages),\n },\n [MessageType.typename]: {\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (message: MessageType) => [], // loadObjectReferences(message, (message) => [...message.parts, message.context]),\n },\n [THREAD_ITEM]: {\n parse: (item: EchoReactiveObject<any>, type: string) => {\n switch (type) {\n case 'node':\n return { id: item.id, label: item.title, data: item };\n case 'object':\n return item;\n case 'view-object':\n return { id: `${item.id}-view`, object: item };\n }\n },\n },\n },\n },\n translations: [...translations, ...threadTranslations],\n echo: { schema: [ChannelType, ThreadType, MessageType] },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n const metadataResolver = resolvePlugin(plugins, parseMetadataResolverPlugin)?.provides.metadata.resolver;\n\n if (!client || !dispatch || !metadataResolver) {\n return [];\n }\n\n return [\n createExtension({\n id: `${THREAD_PLUGIN}/comments-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~comments')) {\n return;\n }\n\n // TODO(Zan): Find util (or make one)\n const docId = id.split('~').at(0);\n const [spaceId, objectId] = docId?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const doc = space?.db.getObjectById(objectId);\n\n if (!doc || !docId) {\n return;\n }\n\n const docMeta = metadataResolver(getTypename(doc) ?? '');\n const label = docMeta.label?.(doc) ||\n doc.name ||\n docMeta.placeholder || ['unnamed object threads label', { ns: THREAD_PLUGIN }];\n // const label = docMeta.label?.(doc) || doc.name || docMeta.placeholder;\n\n const viewState = getViewState(docId);\n\n return {\n id,\n type: 'orphan-comments-for-subject',\n data: doc,\n properties: {\n icon: meta.iconComponent,\n label,\n showResolvedThreads: viewState.showResolvedThreads,\n },\n };\n },\n actions: ({ node }) => {\n const dataId = node.id.split('~').at(0);\n\n if (!node.id.endsWith('~comments') || !dataId) {\n return;\n }\n\n const [spaceId, objectId] = dataId.split(':');\n\n const viewState = getViewState(dataId);\n const toggle = () => {\n const newToggleState = !viewState.showResolvedThreads;\n viewState.showResolvedThreads = newToggleState;\n void dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'threads.toggle-show-resolved',\n properties: { spaceId, threadId: objectId, showResolved: newToggleState },\n },\n });\n };\n\n return [\n {\n id: `${THREAD_PLUGIN}/toggle-show-resolved/${node.id}`,\n data: toggle,\n properties: {\n label: ['toggle show resolved', { ns: THREAD_PLUGIN }],\n menuItemType: 'toggle',\n isChecked: viewState.showResolvedThreads,\n testId: 'threadPlugin.toggleShowResolved',\n },\n },\n ];\n },\n }),\n createExtension({\n id: ThreadAction.CREATE,\n filter: (node): node is ActionGroup =>\n !!settings.values.standalone && isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${THREAD_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: THREAD_PLUGIN, action: ThreadAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create channel label', { ns: THREAD_PLUGIN }],\n icon: (props: IconProps) => <Chat {...props} />,\n iconSymbol: 'ph--chat--regular',\n testId: 'threadPlugin.createObject',\n },\n },\n ];\n },\n }),\n ];\n },\n },\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n case 'main': {\n return data.active instanceof ChannelType && data.active.threads[0] ? (\n <ThreadMain thread={data.active.threads[0]} />\n ) : null;\n }\n\n case 'settings': {\n return data.plugin === meta.id ? <ThreadSettings settings={settings.values} /> : null;\n }\n\n case 'article':\n case 'complementary': {\n const location = navigationPlugin?.provides.location;\n\n if (data.object instanceof ChannelType && data.object.threads[0]) {\n const channel = data.object;\n // TODO(zan): Maybe we should have utility for positional main object ids.\n if (isLayoutParts(location?.active) && location.active.main) {\n const layoutEntries = location.active.main;\n\n const currentPosition = layoutEntries.findIndex((entry) => channel.id === entry.id);\n\n if (currentPosition > 0) {\n const objectToTheLeft = layoutEntries[currentPosition - 1];\n const context = getSpace(data.object)?.db.getObjectById(objectToTheLeft.id);\n return <ThreadArticle thread={data.object.threads[0]} context={context} />;\n }\n }\n\n return <ThreadArticle thread={data.object.threads[0]} />;\n }\n\n if (data.subject instanceof DocumentType) {\n const doc = data.subject;\n const accessor = doc.content ? createDocAccessor(doc.content, ['content']) : undefined;\n\n if (!accessor) {\n return null;\n }\n\n const getStartPosition = (cursor: string | undefined) => {\n const range = cursor ? getRangeFromCursor(accessor, cursor) : undefined;\n return range?.start ?? Number.MAX_SAFE_INTEGER;\n };\n\n const threads = doc.threads\n .concat(state.staging[data.subject.id])\n .filter(nonNullable)\n .sort((a, b) => getStartPosition(a.anchor) - getStartPosition(b.anchor));\n\n const detached = data.subject.threads\n .filter(nonNullable)\n .filter(({ anchor }) => !anchor)\n .map((thread) => thread.id);\n\n const qualifiedSubjectId = fullyQualifiedId(doc);\n const attention = attentionPlugin?.provides.attention?.attended ?? new Set([qualifiedSubjectId]);\n const attendableAttrs = createAttendableAttributes(qualifiedSubjectId);\n const space = getSpace(doc);\n const { showResolvedThreads } = getViewState(qualifiedSubjectId);\n\n const dispatchAnalytic = (name: string, meta: any) => {\n void dispatch?.({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name,\n properties: { ...meta, space: space?.id },\n },\n });\n };\n\n return (\n <div role='none' className='contents group/attention' {...attendableAttrs}>\n {role === 'complementary' && <CommentsHeading attendableId={qualifiedSubjectId} />}\n <ScrollArea.Root classNames='row-span-2'>\n <ScrollArea.Viewport>\n <CommentsContainer\n threads={threads}\n detached={detached}\n currentId={attention.has(qualifiedSubjectId) ? state.current : undefined}\n autoFocusCurrentTextbox={state.focus}\n showResolvedThreads={showResolvedThreads}\n onThreadAttend={(thread) => {\n if (state.current !== thread.id) {\n state.current = thread.id;\n void dispatch?.({\n action: LayoutAction.SCROLL_INTO_VIEW,\n data: {\n id: fullyQualifiedId(data.subject!),\n thread: fullyQualifiedId(thread),\n cursor: thread.anchor,\n },\n });\n }\n }}\n onThreadDelete={(thread) =>\n dispatch?.({\n plugin: THREAD_PLUGIN,\n action: ThreadAction.DELETE,\n data: { document: data.subject, thread },\n })\n }\n onMessageDelete={(thread, messageId) =>\n dispatch?.({\n plugin: THREAD_PLUGIN,\n action: ThreadAction.DELETE_MESSAGE,\n data: { document: data.subject, thread, messageId },\n })\n }\n onThreadToggleResolved={(thread) =>\n dispatch?.({\n plugin: THREAD_PLUGIN,\n action: ThreadAction.TOGGLE_RESOLVED,\n data: { thread },\n })\n }\n onComment={(thread) => {\n // TODO(Zan): This might be a bit too much logic for a component. Move to intents?\n const doc = data.subject as DocumentType;\n if (state.staging[doc.id]?.find((t) => t === thread)) {\n // Move thread from staging to document.\n thread.status = 'active';\n doc.threads ? doc.threads.push(thread) : (doc.threads = [thread]);\n state.staging[doc.id] = state.staging[doc.id]?.filter((t) => t.id !== thread.id);\n dispatchAnalytic('threads.thread-created', { threadId: thread.id });\n }\n\n dispatchAnalytic('threads.message-added', {\n threadId: thread.id,\n threadLength: thread.messages.length,\n });\n }}\n />\n <div role='none' className='bs-10' />\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </div>\n );\n } else if (data.subject instanceof ThreadType) {\n return (\n <>\n <ChatHeading attendableId={data.subject.id} />\n <ChatContainer thread={data.subject} />\n </>\n );\n }\n }\n }\n\n return null;\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case ThreadAction.CREATE: {\n return { data: create(ChannelType, { threads: [create(ThreadType, { messages: [] })] }) };\n }\n\n case ThreadAction.SELECT: {\n state.focus = intent.data?.current === state.current ? state.focus : intent.data?.focus;\n state.current = intent.data?.current;\n return { data: true };\n }\n\n case ThreadAction.TOGGLE_RESOLVED: {\n const { thread } = intent.data ?? {};\n if (!(thread instanceof ThreadType)) {\n return;\n }\n\n if (thread.status === 'active' || thread.status === undefined) {\n thread.status = 'resolved';\n } else if (thread.status === 'resolved') {\n thread.status = 'active';\n }\n\n const space = getSpace(thread);\n const spaceId = space?.id;\n\n return {\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: { name: 'threads.toggle-resolved', properties: { threadId: thread.id, spaceId } },\n },\n ],\n ],\n };\n }\n\n case ThreadAction.DELETE: {\n const { document: doc, thread } = intent.data ?? {};\n if (!(doc instanceof DocumentType) || !(thread instanceof ThreadType)) {\n return;\n }\n\n const stagingArea = state.staging[doc.id];\n if (stagingArea) {\n // Check if we're deleting a thread that's in the staging area.\n // If so, remove it from the staging area without ceremony.\n const index = state.staging[doc.id]?.findIndex((t) => t.id === thread.id);\n if (index !== -1) {\n state.staging[doc.id]?.splice(index, 1);\n return;\n }\n }\n\n const space = getSpace(thread);\n if (!space || !doc.threads) {\n return;\n }\n\n if (!intent.undo) {\n const index = doc.threads.findIndex((t) => t?.id === thread.id);\n const cursor = doc.threads[index]?.anchor;\n if (index !== -1) {\n doc.threads?.splice(index, 1);\n }\n\n space.db.remove(thread);\n\n return {\n undoable: {\n message: translations[0]['en-US'][THREAD_PLUGIN]['thread deleted label'],\n data: { cursor },\n },\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: { name: 'threads.delete', properties: { threadId: thread.id, spaceId: space.id } },\n },\n ],\n ],\n };\n } else if (intent.undo) {\n // TODO(wittjosiah): SDK should do this automatically.\n const savedThread = space.db.add(thread);\n doc.threads.push(savedThread);\n\n return {\n data: true,\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: { name: 'threads.undo-delete', properties: { threadId: thread.id, spaceId: space.id } },\n },\n ],\n ],\n };\n }\n break;\n }\n case ThreadAction.DELETE_MESSAGE: {\n const { document: doc, thread, messageId } = intent.data ?? {};\n const space = getSpace(doc);\n\n if (!(doc instanceof DocumentType) || !(thread instanceof ThreadType) || !space) {\n return;\n }\n\n if (!intent.undo) {\n const message = thread.messages.find((m) => m?.id === messageId);\n const messageIndex = thread.messages.findIndex((m) => m?.id === messageId);\n if (messageIndex === -1 || !message) {\n return undefined;\n }\n\n if (messageIndex === 0 && thread.messages.length === 1) {\n // If the message is the only message in the thread, delete the thread.\n return {\n intents: [[{ action: ThreadAction.DELETE, data: { document: doc, thread } }]],\n };\n } else {\n thread.messages.splice(messageIndex, 1);\n }\n\n return {\n undoable: {\n message: translations[0]['en-US'][THREAD_PLUGIN]['message deleted label'],\n data: { message, messageIndex },\n },\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'threads.message.delete',\n properties: { threadId: thread.id, spaceId: space.id },\n },\n },\n ],\n ],\n };\n } else if (intent.undo) {\n const message = intent.data?.message;\n const messageIndex = intent.data?.messageIndex;\n\n if (!(message instanceof MessageType) || !(typeof messageIndex === 'number')) {\n return;\n }\n\n thread.messages.splice(messageIndex, 0, message);\n\n return {\n data: true,\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'threads.message.undo-delete',\n properties: { threadId: thread.id, spaceId: space.id },\n },\n },\n ],\n ],\n };\n }\n }\n }\n },\n },\n markdown: {\n // TODO(burdon): Factor out extension factory into separate file (for simplicity).\n extensions: ({ document: doc }) => {\n const space = doc && getSpace(doc);\n if (!doc || !space) {\n // Include no-op comments extension here to ensure that the facets are always present when they are expected.\n // TODO(wittjosiah): The Editor should only look for these facets when comments are available.\n return [comments()];\n }\n\n // TODO(Zan): When we have the deepsignal specific equivalent of this we should use that instead.\n const threads = computed(() =>\n [...doc.threads.filter(nonNullable), ...(state.staging[doc.id] ?? [])].filter(\n (thread) => !(thread?.status === 'resolved'),\n ),\n );\n\n return [\n listener({\n onChange: () => {\n doc.threads.forEach((thread) => {\n if (thread?.anchor) {\n const [start, end] = thread.anchor.split(':');\n const name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);\n // TODO(burdon): This seems unsafe; review.\n // Only update if the name has changed, otherwise this will cause an infinite loop.\n // Skip if the name is empty - this means comment text was deleted, but thread name should remain.\n if (name && name !== thread.name) {\n thread.name = name;\n }\n }\n });\n },\n }),\n createExternalCommentSync(\n doc.id,\n (sink) => effect(() => sink()),\n () =>\n threads.value\n .filter((thread) => thread?.anchor)\n .map((thread) => ({ id: thread.id, cursor: thread.anchor! })),\n ),\n comments({\n id: doc.id,\n onCreate: ({ cursor }) => {\n const [start, end] = cursor.split(':');\n const name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);\n const thread = create(ThreadType, { name, anchor: cursor, messages: [], status: 'staged' });\n\n const stagingArea = state.staging[doc.id];\n if (stagingArea) {\n stagingArea.push(thread);\n } else {\n state.staging[doc.id] = [thread];\n }\n\n void intentPlugin?.provides.intent.dispatch([\n {\n action: NavigationAction.OPEN,\n data: {\n activeParts: {\n complementary: `${fullyQualifiedId(doc)}${SLUG_PATH_SEPARATOR}comments${SLUG_COLLECTION_INDICATOR}`,\n },\n },\n },\n {\n action: ThreadAction.SELECT,\n data: { current: thread.id, focus: true },\n },\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'complementary',\n subject: doc,\n state: true,\n },\n },\n ]);\n\n return thread.id;\n },\n onDelete: ({ id }) => {\n // If the thread is in the staging area, remove it.\n const stagingArea = state.staging[doc.id];\n if (stagingArea) {\n const index = stagingArea.findIndex((thread) => thread.id === id);\n if (index !== -1) {\n stagingArea.splice(index, 1);\n }\n }\n\n const thread = doc.threads.find((thread) => thread?.id === id);\n if (thread) {\n thread.anchor = undefined;\n }\n },\n onUpdate: ({ id, cursor }) => {\n const thread =\n state.staging[doc.id]?.find((thread) => thread.id === id) ??\n doc.threads.find((thread) => thread?.id === id);\n\n if (thread instanceof ThreadType && thread.anchor) {\n const [start, end] = thread.anchor.split(':');\n thread.name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);\n thread.anchor = cursor;\n }\n },\n onSelect: ({ selection: { current, closest } }) => {\n const dispatch = intentPlugin?.provides.intent.dispatch;\n if (dispatch) {\n void dispatch([{ action: ThreadAction.SELECT, data: { current: current ?? closest } }]);\n }\n },\n }),\n ];\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const ThreadMain = React.lazy(() => import('./ThreadMain'));\nexport const ThreadArticle = React.lazy(() => import('./ThreadArticle'));\n\n// TODO(wittjosiah): Suspense boundary for sidebar?\nexport * from './ThreadSettings';\nexport * from './CommentContainer';\nexport * from './MessageContainer';\nexport * from './CommentsContainer';\nexport * from './ChatContainer';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { THREAD_PLUGIN } from '../meta';\nimport type { ThreadSettingsProps } from '../types';\n\nexport const ThreadSettings = ({ settings }: { settings: ThreadSettingsProps }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n\n return (\n <>\n <SettingsValue label={t('settings standalone label')}>\n <Input.Switch checked={settings.standalone} onCheckedChange={(checked) => (settings.standalone = !!checked)} />\n </SettingsValue>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CheckCircle, X } from '@phosphor-icons/react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { create } from '@dxos/echo-schema';\nimport { MessageType } from '@dxos/plugin-space/types';\nimport { getSpace, useMembers } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Button, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport {\n getSize,\n hoverableControlItem,\n hoverableControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/react-ui-theme';\nimport { MessageTextbox, type MessageTextboxProps, Thread, ThreadFooter, ThreadHeading } from '@dxos/react-ui-thread';\nimport { nonNullable } from '@dxos/util';\n\nimport { MessageContainer } from './MessageContainer';\nimport { command } from './command-extension';\nimport { type ThreadContainerProps } from './types';\nimport { useStatus } from '../hooks';\nimport { THREAD_PLUGIN } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nconst sizeClass = getSize(4);\n\nconst ToggleResolvedButton = ({\n isResolved,\n onResolve,\n}: {\n isResolved: boolean | undefined;\n onResolve: () => void;\n}) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n const label = t(isResolved ? 'mark as unresolved label' : 'mark as resolved label');\n return (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid='thread.toggle-resolved'\n onClick={onResolve}\n classNames={['min-bs-0 p-1', !isResolved && hoverableControlItem]}\n >\n <span className='sr-only'>{label}</span>\n {isResolved ? <CheckCircle className={sizeClass} weight='fill' /> : <CheckCircle className={sizeClass} />}\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content classNames={'z-[21]'}>\n {label}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n};\n\nconst DeleteThreadButton = ({ onDelete }: { onDelete: () => void }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n const label = t('delete thread label');\n return (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid='thread.delete'\n onClick={onDelete}\n classNames={['min-bs-0 p-1', hoverableControlItem]}\n >\n <span className='sr-only'>{label}</span>\n <X className={sizeClass} />\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content classNames='z-[21]'>\n {label}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n};\n\nexport const CommentContainer = ({\n thread,\n detached,\n context,\n current,\n autoFocusTextbox,\n onAttend,\n onThreadDelete,\n onMessageDelete,\n onResolve,\n onComment,\n}: ThreadContainerProps) => {\n const identity = useIdentity()!;\n const space = getSpace(thread);\n const members = useMembers(space?.key);\n const activity = useStatus(space, thread.id);\n const { t } = useTranslation(THREAD_PLUGIN);\n const threadScrollRef = useRef<HTMLDivElement | null>(null);\n const [autoFocus, setAutoFocus] = useState(!!autoFocusTextbox);\n const { themeMode } = useThemeContext();\n\n const textboxMetadata = getMessageMetadata(thread.id, identity);\n // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.\n const [_count, _setCount] = useState(0);\n const rerenderEditor = () => _setCount((count) => count + 1);\n const messageRef = useRef('');\n const extensions = useMemo(\n () => [\n createBasicExtensions({ placeholder: t('message placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: (text) => (messageRef.current = text) }),\n command,\n ],\n [_count],\n );\n\n // TODO(thure): Because of the way the `autoFocus` property is handled by TextEditor,\n // this is the least-bad way of moving focus at the right time, though it is an anti-pattern.\n // Refactor to behave more like <input/>’s `autoFocus` or `autofocus` (yes, they’re different).\n useEffect(() => {\n setAutoFocus(!!autoFocusTextbox);\n }, [autoFocusTextbox]);\n\n // TODO(thure): Factor out.\n const scrollToEnd = (behavior: ScrollBehavior) =>\n setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);\n\n const handleCreate: MessageTextboxProps['onSend'] = useCallback(() => {\n if (!messageRef.current) {\n return false;\n }\n\n thread.messages.push(\n create(MessageType, {\n sender: { identityKey: identity.identityKey.toHex() },\n timestamp: new Date().toISOString(),\n text: messageRef.current,\n context,\n }),\n );\n onComment?.(thread);\n\n messageRef.current = '';\n setAutoFocus(true);\n scrollToEnd('instant');\n rerenderEditor();\n\n // TODO(burdon): Scroll to bottom.\n return true;\n }, [thread, identity]);\n\n const handleDeleteMessage = (id: string) => onMessageDelete?.(id);\n\n return (\n <Thread onClickCapture={onAttend} onFocusCapture={onAttend} current={current} id={thread.id}>\n <div\n role='none'\n className={mx(\n 'col-span-2 grid grid-cols-[var(--rail-size)_1fr_min-content]',\n hoverableControls,\n hoverableFocusedWithinControls,\n )}\n >\n {detached ? (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <ThreadHeading detached>{thread.name ?? t('thread title placeholder')}</ThreadHeading>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content classNames='z-[21]' side='top'>\n {t('detached thread label')}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n ) : (\n <ThreadHeading>{thread.name ?? t('thread title placeholder')}</ThreadHeading>\n )}\n <div className='flex flex-row items-center pli-1'>\n {thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}\n {onResolve && !(thread?.status === 'staged') && (\n <ToggleResolvedButton isResolved={thread?.status === 'resolved'} onResolve={onResolve} />\n )}\n {onThreadDelete && <DeleteThreadButton onDelete={onThreadDelete} />}\n </div>\n </div>\n {thread.messages.filter(nonNullable).map((message) => (\n <MessageContainer key={message.id} message={message} members={members} onDelete={handleDeleteMessage} />\n ))}\n <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />\n <ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>\n {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}\n <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />\n </Thread>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ChatText, Quotes } from '@phosphor-icons/react';\nimport React, { useEffect } from 'react';\n\nimport { type ThreadType } from '@dxos/plugin-space/types';\nimport { useTranslation, Trans } from '@dxos/react-ui';\nimport { PlankHeading, plankHeadingIconProps } from '@dxos/react-ui-deck';\nimport { descriptionText, mx } from '@dxos/react-ui-theme';\n\nimport { CommentContainer } from './CommentContainer';\nimport { type ThreadContainerProps } from './types';\nimport { THREAD_PLUGIN } from '../meta';\n\nexport type ThreadsContainerProps = Omit<\n ThreadContainerProps,\n 'thread' | 'detached' | 'onAttend' | 'onThreadDelete' | 'onMessageDelete' | 'current' | 'autoFocus'\n> & {\n threads: ThreadType[];\n /**\n * Threads that are no longer anchored to a position in the object.\n */\n detached?: string[];\n currentId?: string;\n autoFocusCurrentTextbox?: boolean;\n showResolvedThreads?: boolean;\n onThreadAttend?: (thread: ThreadType) => void;\n onThreadDelete?: (thread: ThreadType) => void;\n onMessageDelete?: (thread: ThreadType, messageId: string) => void;\n onThreadToggleResolved?: (thread: ThreadType) => void;\n onComment?: (thread: ThreadType) => void;\n};\n\nexport const CommentsHeading = ({ attendableId }: { attendableId?: string }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n\n return (\n <div role='none' className='flex items-center'>\n <PlankHeading.Button attendableId={attendableId}>\n <Quotes {...plankHeadingIconProps} />\n </PlankHeading.Button>\n <PlankHeading.Label attendableId={attendableId}>{t('comments heading')}</PlankHeading.Label>\n </div>\n );\n};\n\n/**\n * Comment threads.\n */\nexport const CommentsContainer = ({\n threads,\n detached = [],\n currentId,\n autoFocusCurrentTextbox,\n showResolvedThreads,\n onThreadAttend,\n onThreadDelete,\n onMessageDelete,\n onThreadToggleResolved,\n ...props\n}: ThreadsContainerProps) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n const filteredThreads = showResolvedThreads ? threads : threads.filter((thread) => !(thread?.status === 'resolved'));\n\n useEffect(() => {\n if (currentId) {\n document.getElementById(currentId)?.scrollIntoView({ behavior: 'smooth', block: 'end' });\n }\n }, [currentId]);\n\n return (\n <>\n {filteredThreads.length > 0 ? (\n filteredThreads.map((thread) => (\n <CommentContainer\n key={thread.id}\n thread={thread}\n current={currentId === thread.id}\n detached={detached.includes(thread.id)}\n autoFocusTextbox={autoFocusCurrentTextbox && currentId === thread.id}\n {...(onThreadAttend && { onAttend: () => onThreadAttend(thread) })}\n {...(onThreadDelete && { onThreadDelete: () => onThreadDelete(thread) })}\n {...(onMessageDelete && { onMessageDelete: (messageId: string) => onMessageDelete(thread, messageId) })}\n {...(onThreadToggleResolved && { onResolve: () => onThreadToggleResolved(thread) })}\n {...props}\n />\n ))\n ) : (\n <div\n role='alert'\n className={mx(\n descriptionText,\n 'place-self-center border border-dashed border-neutral-400/50 rounded-lg text-center p-4 m-4',\n )}\n >\n <h2 className='mbe-2 font-medium text-base'>{t('no comments title')}</h2>\n <p>\n <Trans\n {...{\n t,\n i18nKey: 'no comments message',\n components: {\n commentIcon: <ChatText className='inline-block' />,\n },\n }}\n />\n </p>\n </div>\n )}\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { THREAD_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [THREAD_PLUGIN]: {\n 'plugin name': 'Threads',\n 'channel name placeholder': 'New channel',\n 'channel title label': 'Title',\n 'delete channel label': 'Delete channel',\n 'create channel label': 'Create channel',\n 'message placeholder': 'Reply…',\n 'settings standalone label': 'Enable channel creation (experimental)',\n 'activity message': 'Processing…',\n 'anonymous label': 'Anonymous',\n 'delete message block label': 'Delete message block',\n 'detached thread label': 'Referenced content was removed',\n 'delete thread label': 'Delete thread',\n 'thread deleted label': 'You deleted a thread.',\n 'message deleted label': 'You deleted a message.',\n 'comments heading': 'Comments',\n 'chat heading': 'Chat',\n 'draft button': 'DRAFT',\n 'no comments title': 'No comments (yet)',\n 'no comments message':\n 'To start a comment thread, select a range of text in a document and click the <commentIcon></commentIcon> Create comment button in the toolbar.',\n 'toggle show resolved': 'Show resolved',\n 'unnamed object threads label': 'Threads',\n 'mark as resolved label': 'Mark as resolved',\n 'mark as unresolved label': 'Mark as unresolved',\n 'save message label': 'Save',\n 'edit message label': 'Edit',\n 'delete message label': 'Delete message',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ThreadPlugin } from './ThreadPlugin';\n\nexport default ThreadPlugin;\n\nexport * from './hooks';\nexport * from './types';\n\nexport * from './ThreadPlugin';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqC;AACrC,0BAAiC;AACjC,IAAAA,gBAAkB;AAElB,2BAgBO;AAEP,yBAAqD;AACrD,IAAAC,sBAAuB;AACvB,2BAAkC;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EACF;AACF;AMruBA,IAAA,cAAehM;",
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Chat, type IconProps } from '@phosphor-icons/react';\nimport { computed, effect } from '@preact/signals-core';\nimport React from 'react';\n\nimport {\n type IntentPluginProvides,\n LayoutAction,\n NavigationAction,\n type LocationProvides,\n type Plugin,\n type PluginDefinition,\n parseIntentPlugin,\n parseNavigationPlugin,\n resolvePlugin,\n parseGraphPlugin,\n SLUG_PATH_SEPARATOR,\n SLUG_COLLECTION_INDICATOR,\n isLayoutParts,\n parseMetadataResolverPlugin,\n type IntentDispatcher,\n} from '@dxos/app-framework';\nimport { type UnsubscribeCallback } from '@dxos/async';\nimport { type EchoReactiveObject, getTypename } from '@dxos/echo-schema';\nimport { create } from '@dxos/echo-schema';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type AttentionPluginProvides, parseAttentionPlugin } from '@dxos/plugin-attention';\nimport { parseClientPlugin } from '@dxos/plugin-client';\nimport { type ActionGroup, createExtension, isActionGroup } from '@dxos/plugin-graph';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { ObservabilityAction } from '@dxos/plugin-observability/meta';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { ThreadType, MessageType, ChannelType } from '@dxos/plugin-space/types';\nimport {\n getSpace,\n getTextInRange,\n Filter,\n createDocAccessor,\n fullyQualifiedId,\n getRangeFromCursor,\n loadObjectReferences,\n} from '@dxos/react-client/echo';\nimport { ScrollArea } from '@dxos/react-ui';\nimport { createAttendableAttributes } from '@dxos/react-ui-attention';\nimport { comments, createExternalCommentSync, listener } from '@dxos/react-ui-editor';\nimport { translations as threadTranslations } from '@dxos/react-ui-thread';\nimport { nonNullable } from '@dxos/util';\n\nimport {\n ThreadMain,\n ThreadSettings,\n CommentsContainer,\n CommentsHeading,\n ChatContainer,\n ChatHeading,\n ThreadArticle,\n} from './components';\nimport meta, { THREAD_ITEM, THREAD_PLUGIN } from './meta';\nimport translations from './translations';\nimport { ThreadAction, type ThreadPluginProvides, type ThreadSettingsProps } from './types';\n\ntype ThreadState = {\n staging: Record<string, ThreadType[]>;\n current?: string | undefined;\n focus?: boolean;\n};\n\ntype SubjectId = string;\nconst initialViewState = { showResolvedThreads: false };\ntype ViewStore = Record<SubjectId, typeof initialViewState>;\n\nexport const ThreadPlugin = (): PluginDefinition<ThreadPluginProvides> => {\n const settings = new LocalStorageStore<ThreadSettingsProps>(THREAD_PLUGIN);\n const state = create<ThreadState>({ staging: {} });\n\n const viewStore = create<ViewStore>({});\n const getViewState = (subjectId: string) => {\n if (!viewStore[subjectId]) {\n viewStore[subjectId] = { ...initialViewState };\n }\n return viewStore[subjectId];\n };\n\n let attentionPlugin: Plugin<AttentionPluginProvides> | undefined;\n let navigationPlugin: Plugin<LocationProvides> | undefined;\n let intentPlugin: Plugin<IntentPluginProvides> | undefined;\n let dispatch: IntentDispatcher | undefined;\n\n const unsubscribeCallbacks = [] as UnsubscribeCallback[];\n\n return {\n meta,\n ready: async (plugins) => {\n settings.prop({ key: 'standalone', type: LocalStorageStore.bool({ allowUndefined: true }) });\n\n attentionPlugin = resolvePlugin(plugins, parseAttentionPlugin);\n navigationPlugin = resolvePlugin(plugins, parseNavigationPlugin);\n intentPlugin = resolvePlugin(plugins, parseIntentPlugin)!;\n dispatch = intentPlugin?.provides.intent.dispatch;\n\n const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n if (!client) {\n return;\n }\n\n // TODO(wittjosiah): This is a hack to make standalone threads work in the c11y sidebar.\n // This should have a better solution when deck is introduced.\n const channelsQuery = client.spaces.query(Filter.schema(ChannelType));\n const queryUnsubscribe = channelsQuery.subscribe();\n const unsubscribe = effect(() => {\n const attention = attentionPlugin?.provides.attention;\n if (!attention?.attended) {\n return;\n }\n\n const firstAttendedNodeWithComments = Array.from(attention.attended)\n .map((id) => graphPlugin?.provides.graph.findNode(id))\n .find((node) => node?.data instanceof DocumentType && (node.data.threads?.length ?? 0) > 0);\n\n if (firstAttendedNodeWithComments) {\n void intentPlugin?.provides.intent.dispatch({\n action: NavigationAction.OPEN,\n data: {\n activeParts: {\n complementary: `${firstAttendedNodeWithComments.id}${SLUG_PATH_SEPARATOR}comments`,\n },\n },\n });\n }\n });\n\n unsubscribeCallbacks.push(queryUnsubscribe);\n unsubscribeCallbacks.push(unsubscribe);\n },\n unload: async () => {\n unsubscribeCallbacks.forEach((unsubscribe) => unsubscribe());\n },\n provides: {\n settings: settings.values,\n metadata: {\n records: {\n [ChannelType.typename]: {\n placeholder: ['channel title placeholder', { ns: THREAD_PLUGIN }],\n icon: (props: IconProps) => <Chat {...props} />,\n iconSymbol: 'ph--chat--regular',\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (channel: ChannelType) => loadObjectReferences(channel, (channel) => channel.threads),\n },\n [ThreadType.typename]: {\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (thread: ThreadType) => loadObjectReferences(thread, (thread) => thread.messages),\n },\n [MessageType.typename]: {\n // TODO(wittjosiah): Move out of metadata.\n loadReferences: (message: MessageType) => [], // loadObjectReferences(message, (message) => [...message.parts, message.context]),\n },\n [THREAD_ITEM]: {\n parse: (item: EchoReactiveObject<any>, type: string) => {\n switch (type) {\n case 'node':\n return { id: item.id, label: item.title, data: item };\n case 'object':\n return item;\n case 'view-object':\n return { id: `${item.id}-view`, object: item };\n }\n },\n },\n },\n },\n translations: [...translations, ...threadTranslations],\n echo: { schema: [ChannelType, ThreadType, MessageType] },\n graph: {\n builder: (plugins) => {\n const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;\n const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatch;\n const metadataResolver = resolvePlugin(plugins, parseMetadataResolverPlugin)?.provides.metadata.resolver;\n\n if (!client || !dispatch || !metadataResolver) {\n return [];\n }\n\n return [\n createExtension({\n id: `${THREAD_PLUGIN}/comments-for-subject`,\n resolver: ({ id }) => {\n if (!id.endsWith('~comments')) {\n return;\n }\n\n // TODO(Zan): Find util (or make one)\n const docId = id.split('~').at(0);\n const [spaceId, objectId] = docId?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const doc = space?.db.getObjectById(objectId);\n\n if (!doc || !docId) {\n return;\n }\n\n const docMeta = metadataResolver(getTypename(doc) ?? '');\n const label = docMeta.label?.(doc) ||\n doc.name ||\n docMeta.placeholder || ['unnamed object threads label', { ns: THREAD_PLUGIN }];\n // const label = docMeta.label?.(doc) || doc.name || docMeta.placeholder;\n\n const viewState = getViewState(docId);\n\n return {\n id,\n type: 'orphan-comments-for-subject',\n data: doc,\n properties: {\n icon: meta.iconComponent,\n label,\n showResolvedThreads: viewState.showResolvedThreads,\n },\n };\n },\n actions: ({ node }) => {\n const dataId = node.id.split('~').at(0);\n\n if (!node.id.endsWith('~comments') || !dataId) {\n return;\n }\n\n const [spaceId, objectId] = dataId.split(':');\n\n const viewState = getViewState(dataId);\n const toggle = () => {\n const newToggleState = !viewState.showResolvedThreads;\n viewState.showResolvedThreads = newToggleState;\n void dispatch({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'threads.toggle-show-resolved',\n properties: { spaceId, threadId: objectId, showResolved: newToggleState },\n },\n });\n };\n\n return [\n {\n id: `${THREAD_PLUGIN}/toggle-show-resolved/${node.id}`,\n data: toggle,\n properties: {\n label: ['toggle show resolved', { ns: THREAD_PLUGIN }],\n menuItemType: 'toggle',\n isChecked: viewState.showResolvedThreads,\n testId: 'threadPlugin.toggleShowResolved',\n },\n },\n ];\n },\n }),\n createExtension({\n id: ThreadAction.CREATE,\n filter: (node): node is ActionGroup =>\n !!settings.values.standalone && isActionGroup(node) && node.id.startsWith(SpaceAction.ADD_OBJECT),\n actions: ({ node }) => {\n const id = node.id.split('/').at(-1);\n const [spaceId, objectId] = id?.split(':') ?? [];\n const space = client.spaces.get().find((space) => space.id === spaceId);\n const object = objectId && space?.db.getObjectById(objectId);\n const target = objectId ? object : space;\n if (!target) {\n return;\n }\n\n return [\n {\n id: `${THREAD_PLUGIN}/create/${node.id}`,\n data: async () => {\n await dispatch([\n { plugin: THREAD_PLUGIN, action: ThreadAction.CREATE },\n { action: SpaceAction.ADD_OBJECT, data: { target } },\n { action: NavigationAction.OPEN },\n ]);\n },\n properties: {\n label: ['create channel label', { ns: THREAD_PLUGIN }],\n icon: (props: IconProps) => <Chat {...props} />,\n iconSymbol: 'ph--chat--regular',\n testId: 'threadPlugin.createObject',\n },\n },\n ];\n },\n }),\n ];\n },\n },\n surface: {\n component: ({ data, role }) => {\n switch (role) {\n case 'main': {\n return data.active instanceof ChannelType && data.active.threads[0] ? (\n <ThreadMain thread={data.active.threads[0]} />\n ) : null;\n }\n\n case 'settings': {\n return data.plugin === meta.id ? <ThreadSettings settings={settings.values} /> : null;\n }\n\n case 'article':\n case 'complementary': {\n const location = navigationPlugin?.provides.location;\n\n if (data.object instanceof ChannelType && data.object.threads[0]) {\n const channel = data.object;\n // TODO(zan): Maybe we should have utility for positional main object ids.\n if (isLayoutParts(location?.active) && location.active.main) {\n const layoutEntries = location.active.main;\n\n const currentPosition = layoutEntries.findIndex((entry) => channel.id === entry.id);\n\n if (currentPosition > 0) {\n const objectToTheLeft = layoutEntries[currentPosition - 1];\n const context = getSpace(data.object)?.db.getObjectById(objectToTheLeft.id);\n return <ThreadArticle thread={data.object.threads[0]} context={context} />;\n }\n }\n\n return <ThreadArticle thread={data.object.threads[0]} />;\n }\n\n if (data.subject instanceof DocumentType) {\n const doc = data.subject;\n const accessor = doc.content ? createDocAccessor(doc.content, ['content']) : undefined;\n\n if (!accessor) {\n return null;\n }\n\n const getStartPosition = (cursor: string | undefined) => {\n const range = cursor ? getRangeFromCursor(accessor, cursor) : undefined;\n return range?.start ?? Number.MAX_SAFE_INTEGER;\n };\n\n const threads = doc.threads\n .concat(state.staging[data.subject.id])\n .filter(nonNullable)\n .sort((a, b) => getStartPosition(a.anchor) - getStartPosition(b.anchor));\n\n const detached = data.subject.threads\n .filter(nonNullable)\n .filter(({ anchor }) => !anchor)\n .map((thread) => thread.id);\n\n const qualifiedSubjectId = fullyQualifiedId(doc);\n const attention = attentionPlugin?.provides.attention?.attended ?? new Set([qualifiedSubjectId]);\n const attendableAttrs = createAttendableAttributes(qualifiedSubjectId);\n const space = getSpace(doc);\n const { showResolvedThreads } = getViewState(qualifiedSubjectId);\n\n const dispatchAnalytic = (name: string, meta: any) => {\n void dispatch?.({\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name,\n properties: { ...meta, space: space?.id },\n },\n });\n };\n\n return (\n <div role='none' className='contents group/attention' {...attendableAttrs}>\n {role === 'complementary' && <CommentsHeading attendableId={qualifiedSubjectId} />}\n <ScrollArea.Root classNames='row-span-2'>\n <ScrollArea.Viewport>\n <CommentsContainer\n threads={threads}\n detached={detached}\n currentId={attention.has(qualifiedSubjectId) ? state.current : undefined}\n autoFocusCurrentTextbox={state.focus}\n showResolvedThreads={showResolvedThreads}\n onThreadAttend={(thread) => {\n if (state.current !== thread.id) {\n state.current = thread.id;\n void dispatch?.({\n action: LayoutAction.SCROLL_INTO_VIEW,\n data: {\n id: fullyQualifiedId(data.subject!),\n thread: fullyQualifiedId(thread),\n cursor: thread.anchor,\n },\n });\n }\n }}\n onThreadDelete={(thread) =>\n dispatch?.({\n plugin: THREAD_PLUGIN,\n action: ThreadAction.DELETE,\n data: { document: data.subject, thread },\n })\n }\n onMessageDelete={(thread, messageId) =>\n dispatch?.({\n plugin: THREAD_PLUGIN,\n action: ThreadAction.DELETE_MESSAGE,\n data: { document: data.subject, thread, messageId },\n })\n }\n onThreadToggleResolved={(thread) =>\n dispatch?.({\n plugin: THREAD_PLUGIN,\n action: ThreadAction.TOGGLE_RESOLVED,\n data: { thread },\n })\n }\n onComment={(thread) => {\n // TODO(Zan): This might be a bit too much logic for a component. Move to intents?\n const doc = data.subject as DocumentType;\n if (state.staging[doc.id]?.find((t) => t === thread)) {\n // Move thread from staging to document.\n thread.status = 'active';\n doc.threads ? doc.threads.push(thread) : (doc.threads = [thread]);\n state.staging[doc.id] = state.staging[doc.id]?.filter((t) => t.id !== thread.id);\n dispatchAnalytic('threads.thread-created', { threadId: thread.id });\n }\n\n dispatchAnalytic('threads.message-added', {\n threadId: thread.id,\n threadLength: thread.messages.length,\n });\n }}\n />\n <div role='none' className='bs-10' />\n <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </div>\n );\n } else if (data.subject instanceof ThreadType) {\n return (\n <>\n <ChatHeading attendableId={data.subject.id} />\n <ChatContainer thread={data.subject} />\n </>\n );\n }\n }\n }\n\n return null;\n },\n },\n intent: {\n resolver: async (intent) => {\n switch (intent.action) {\n case ThreadAction.CREATE: {\n return { data: create(ChannelType, { threads: [create(ThreadType, { messages: [] })] }) };\n }\n\n case ThreadAction.SELECT: {\n state.focus = intent.data?.current === state.current ? state.focus : intent.data?.focus;\n state.current = intent.data?.current;\n return { data: true };\n }\n\n case ThreadAction.TOGGLE_RESOLVED: {\n const { thread } = intent.data ?? {};\n if (!(thread instanceof ThreadType)) {\n return;\n }\n\n if (thread.status === 'active' || thread.status === undefined) {\n thread.status = 'resolved';\n } else if (thread.status === 'resolved') {\n thread.status = 'active';\n }\n\n const space = getSpace(thread);\n const spaceId = space?.id;\n\n return {\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: { name: 'threads.toggle-resolved', properties: { threadId: thread.id, spaceId } },\n },\n ],\n ],\n };\n }\n\n case ThreadAction.DELETE: {\n const { document: doc, thread } = intent.data ?? {};\n if (!(doc instanceof DocumentType) || !(thread instanceof ThreadType)) {\n return;\n }\n\n const stagingArea = state.staging[doc.id];\n if (stagingArea) {\n // Check if we're deleting a thread that's in the staging area.\n // If so, remove it from the staging area without ceremony.\n const index = state.staging[doc.id]?.findIndex((t) => t.id === thread.id);\n if (index !== -1) {\n state.staging[doc.id]?.splice(index, 1);\n return;\n }\n }\n\n const space = getSpace(thread);\n if (!space || !doc.threads) {\n return;\n }\n\n if (!intent.undo) {\n const index = doc.threads.findIndex((t) => t?.id === thread.id);\n const cursor = doc.threads[index]?.anchor;\n if (index !== -1) {\n doc.threads?.splice(index, 1);\n }\n\n space.db.remove(thread);\n\n return {\n undoable: {\n message: translations[0]['en-US'][THREAD_PLUGIN]['thread deleted label'],\n data: { cursor },\n },\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: { name: 'threads.delete', properties: { threadId: thread.id, spaceId: space.id } },\n },\n ],\n ],\n };\n } else if (intent.undo) {\n // TODO(wittjosiah): SDK should do this automatically.\n const savedThread = space.db.add(thread);\n doc.threads.push(savedThread);\n\n return {\n data: true,\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: { name: 'threads.undo-delete', properties: { threadId: thread.id, spaceId: space.id } },\n },\n ],\n ],\n };\n }\n break;\n }\n case ThreadAction.DELETE_MESSAGE: {\n const { document: doc, thread, messageId } = intent.data ?? {};\n const space = getSpace(doc);\n\n if (!(doc instanceof DocumentType) || !(thread instanceof ThreadType) || !space) {\n return;\n }\n\n if (!intent.undo) {\n const message = thread.messages.find((m) => m?.id === messageId);\n const messageIndex = thread.messages.findIndex((m) => m?.id === messageId);\n if (messageIndex === -1 || !message) {\n return undefined;\n }\n\n if (messageIndex === 0 && thread.messages.length === 1) {\n // If the message is the only message in the thread, delete the thread.\n return {\n intents: [[{ action: ThreadAction.DELETE, data: { document: doc, thread } }]],\n };\n } else {\n thread.messages.splice(messageIndex, 1);\n }\n\n return {\n undoable: {\n message: translations[0]['en-US'][THREAD_PLUGIN]['message deleted label'],\n data: { message, messageIndex },\n },\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'threads.message.delete',\n properties: { threadId: thread.id, spaceId: space.id },\n },\n },\n ],\n ],\n };\n } else if (intent.undo) {\n const message = intent.data?.message;\n const messageIndex = intent.data?.messageIndex;\n\n if (!(message instanceof MessageType) || !(typeof messageIndex === 'number')) {\n return;\n }\n\n thread.messages.splice(messageIndex, 0, message);\n\n return {\n data: true,\n intents: [\n [\n {\n action: ObservabilityAction.SEND_EVENT,\n data: {\n name: 'threads.message.undo-delete',\n properties: { threadId: thread.id, spaceId: space.id },\n },\n },\n ],\n ],\n };\n }\n }\n }\n },\n },\n markdown: {\n // TODO(burdon): Factor out extension factory into separate file (for simplicity).\n extensions: ({ document: doc }) => {\n const space = doc && getSpace(doc);\n if (!doc || !space) {\n // Include no-op comments extension here to ensure that the facets are always present when they are expected.\n // TODO(wittjosiah): The Editor should only look for these facets when comments are available.\n return [comments()];\n }\n\n // TODO(Zan): When we have the deepsignal specific equivalent of this we should use that instead.\n const threads = computed(() =>\n [...doc.threads.filter(nonNullable), ...(state.staging[doc.id] ?? [])].filter(\n (thread) => !(thread?.status === 'resolved'),\n ),\n );\n\n return [\n listener({\n onChange: () => {\n doc.threads.forEach((thread) => {\n if (thread?.anchor) {\n const [start, end] = thread.anchor.split(':');\n const name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);\n // TODO(burdon): This seems unsafe; review.\n // Only update if the name has changed, otherwise this will cause an infinite loop.\n // Skip if the name is empty - this means comment text was deleted, but thread name should remain.\n if (name && name !== thread.name) {\n thread.name = name;\n }\n }\n });\n },\n }),\n createExternalCommentSync(\n doc.id,\n (sink) => effect(() => sink()),\n () =>\n threads.value\n .filter((thread) => thread?.anchor)\n .map((thread) => ({ id: thread.id, cursor: thread.anchor! })),\n ),\n comments({\n id: doc.id,\n onCreate: ({ cursor }) => {\n const [start, end] = cursor.split(':');\n const name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);\n const thread = create(ThreadType, { name, anchor: cursor, messages: [], status: 'staged' });\n\n const stagingArea = state.staging[doc.id];\n if (stagingArea) {\n stagingArea.push(thread);\n } else {\n state.staging[doc.id] = [thread];\n }\n\n void intentPlugin?.provides.intent.dispatch([\n {\n action: NavigationAction.OPEN,\n data: {\n activeParts: {\n complementary: `${fullyQualifiedId(doc)}${SLUG_PATH_SEPARATOR}comments${SLUG_COLLECTION_INDICATOR}`,\n },\n },\n },\n {\n action: ThreadAction.SELECT,\n data: { current: thread.id, focus: true },\n },\n {\n action: LayoutAction.SET_LAYOUT,\n data: {\n element: 'complementary',\n subject: doc,\n state: true,\n },\n },\n ]);\n\n return thread.id;\n },\n onDelete: ({ id }) => {\n // If the thread is in the staging area, remove it.\n const stagingArea = state.staging[doc.id];\n if (stagingArea) {\n const index = stagingArea.findIndex((thread) => thread.id === id);\n if (index !== -1) {\n stagingArea.splice(index, 1);\n }\n }\n\n const thread = doc.threads.find((thread) => thread?.id === id);\n if (thread) {\n thread.anchor = undefined;\n }\n },\n onUpdate: ({ id, cursor }) => {\n const thread =\n state.staging[doc.id]?.find((thread) => thread.id === id) ??\n doc.threads.find((thread) => thread?.id === id);\n\n if (thread instanceof ThreadType && thread.anchor) {\n const [start, end] = thread.anchor.split(':');\n thread.name = doc.content && getTextInRange(createDocAccessor(doc.content, ['content']), start, end);\n thread.anchor = cursor;\n }\n },\n onSelect: ({ selection: { current, closest } }) => {\n const dispatch = intentPlugin?.provides.intent.dispatch;\n if (dispatch) {\n void dispatch([{ action: ThreadAction.SELECT, data: { current: current ?? closest } }]);\n }\n },\n }),\n ];\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const ThreadMain = React.lazy(() => import('./ThreadMain'));\nexport const ThreadArticle = React.lazy(() => import('./ThreadArticle'));\n\n// TODO(wittjosiah): Suspense boundary for sidebar?\nexport * from './ThreadSettings';\nexport * from './CommentContainer';\nexport * from './MessageContainer';\nexport * from './CommentsContainer';\nexport * from './ChatContainer';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { Input, useTranslation } from '@dxos/react-ui';\n\nimport { THREAD_PLUGIN } from '../meta';\nimport type { ThreadSettingsProps } from '../types';\n\nexport const ThreadSettings = ({ settings }: { settings: ThreadSettingsProps }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n\n return (\n <>\n <SettingsValue label={t('settings standalone label')}>\n <Input.Switch checked={settings.standalone} onCheckedChange={(checked) => (settings.standalone = !!checked)} />\n </SettingsValue>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CheckCircle, X } from '@phosphor-icons/react';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { create } from '@dxos/echo-schema';\nimport { MessageType } from '@dxos/plugin-space/types';\nimport { getSpace, useMembers } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Button, Tag, Tooltip, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport {\n getSize,\n hoverableControlItem,\n hoverableControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/react-ui-theme';\nimport { MessageTextbox, type MessageTextboxProps, Thread, ThreadFooter, ThreadHeading } from '@dxos/react-ui-thread';\nimport { nonNullable } from '@dxos/util';\n\nimport { MessageContainer } from './MessageContainer';\nimport { command } from './command-extension';\nimport { type ThreadContainerProps } from './types';\nimport { useStatus } from '../hooks';\nimport { THREAD_PLUGIN } from '../meta';\nimport { getMessageMetadata } from '../util';\n\nconst sizeClass = getSize(4);\n\nconst ToggleResolvedButton = ({\n isResolved,\n onResolve,\n}: {\n isResolved: boolean | undefined;\n onResolve: () => void;\n}) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n const label = t(isResolved ? 'mark as unresolved label' : 'mark as resolved label');\n return (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid='thread.toggle-resolved'\n onClick={onResolve}\n classNames={['min-bs-0 p-1', !isResolved && hoverableControlItem]}\n >\n <span className='sr-only'>{label}</span>\n {isResolved ? <CheckCircle className={sizeClass} weight='fill' /> : <CheckCircle className={sizeClass} />}\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content classNames={'z-[21]'}>\n {label}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n};\n\nconst DeleteThreadButton = ({ onDelete }: { onDelete: () => void }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n const label = t('delete thread label');\n return (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid='thread.delete'\n onClick={onDelete}\n classNames={['min-bs-0 p-1', hoverableControlItem]}\n >\n <span className='sr-only'>{label}</span>\n <X className={sizeClass} />\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content classNames='z-[21]'>\n {label}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n );\n};\n\nexport const CommentContainer = ({\n thread,\n detached,\n context,\n current,\n autoFocusTextbox,\n onAttend,\n onThreadDelete,\n onMessageDelete,\n onResolve,\n onComment,\n}: ThreadContainerProps) => {\n const identity = useIdentity()!;\n const space = getSpace(thread);\n const members = useMembers(space?.key);\n const activity = useStatus(space, thread.id);\n const { t } = useTranslation(THREAD_PLUGIN);\n const threadScrollRef = useRef<HTMLDivElement | null>(null);\n const [autoFocus, setAutoFocus] = useState(!!autoFocusTextbox);\n const { themeMode } = useThemeContext();\n\n const textboxMetadata = getMessageMetadata(thread.id, identity);\n // TODO(wittjosiah): This is a hack to reset the editor after a message is sent.\n const [_count, _setCount] = useState(0);\n const rerenderEditor = () => _setCount((count) => count + 1);\n const messageRef = useRef('');\n const extensions = useMemo(\n () => [\n createBasicExtensions({ placeholder: t('message placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: (text) => (messageRef.current = text) }),\n command,\n ],\n [_count],\n );\n\n // TODO(thure): Because of the way the `autoFocus` property is handled by TextEditor,\n // this is the least-bad way of moving focus at the right time, though it is an anti-pattern.\n // Refactor to behave more like <input/>’s `autoFocus` or `autofocus` (yes, they’re different).\n useEffect(() => {\n setAutoFocus(!!autoFocusTextbox);\n }, [autoFocusTextbox]);\n\n // TODO(thure): Factor out.\n const scrollToEnd = (behavior: ScrollBehavior) =>\n setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);\n\n const handleCreate: MessageTextboxProps['onSend'] = useCallback(() => {\n if (!messageRef.current) {\n return false;\n }\n\n thread.messages.push(\n create(MessageType, {\n sender: { identityKey: identity.identityKey.toHex() },\n timestamp: new Date().toISOString(),\n text: messageRef.current,\n context,\n }),\n );\n onComment?.(thread);\n\n messageRef.current = '';\n setAutoFocus(true);\n scrollToEnd('instant');\n rerenderEditor();\n\n // TODO(burdon): Scroll to bottom.\n return true;\n }, [thread, identity]);\n\n const handleDeleteMessage = (id: string) => onMessageDelete?.(id);\n\n return (\n <Thread onClickCapture={onAttend} onFocusCapture={onAttend} current={current} id={thread.id}>\n <div\n role='none'\n className={mx(\n 'col-span-2 grid grid-cols-[var(--rail-size)_1fr_min-content]',\n hoverableControls,\n hoverableFocusedWithinControls,\n )}\n >\n {detached ? (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <ThreadHeading detached>{thread.name ?? t('thread title placeholder')}</ThreadHeading>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content classNames='z-[21]' side='top'>\n {t('detached thread label')}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n ) : (\n <ThreadHeading>{thread.name ?? t('thread title placeholder')}</ThreadHeading>\n )}\n <div className='flex flex-row items-center pli-1'>\n {thread.status === 'staged' && <Tag palette='neutral'>{t('draft button')}</Tag>}\n {onResolve && !(thread?.status === 'staged') && (\n <ToggleResolvedButton isResolved={thread?.status === 'resolved'} onResolve={onResolve} />\n )}\n {onThreadDelete && <DeleteThreadButton onDelete={onThreadDelete} />}\n </div>\n </div>\n {thread.messages.filter(nonNullable).map((message) => (\n <MessageContainer key={message.id} message={message} members={members} onDelete={handleDeleteMessage} />\n ))}\n <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />\n <ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>\n {/* NOTE(thure): This can’t also be the `overflow-anchor` because `ScrollArea` injects an interceding node that contains this necessary ref’d element. */}\n <div role='none' className='bs-px -mbs-px' ref={threadScrollRef} />\n </Thread>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { ChatText, Quotes } from '@phosphor-icons/react';\nimport React, { useEffect } from 'react';\n\nimport { type ThreadType } from '@dxos/plugin-space/types';\nimport { useTranslation, Trans } from '@dxos/react-ui';\nimport { PlankHeading, plankHeadingIconProps } from '@dxos/react-ui-deck';\nimport { descriptionText, mx } from '@dxos/react-ui-theme';\n\nimport { CommentContainer } from './CommentContainer';\nimport { type ThreadContainerProps } from './types';\nimport { THREAD_PLUGIN } from '../meta';\n\nexport type ThreadsContainerProps = Omit<\n ThreadContainerProps,\n 'thread' | 'detached' | 'onAttend' | 'onThreadDelete' | 'onMessageDelete' | 'current' | 'autoFocus'\n> & {\n threads: ThreadType[];\n /**\n * Threads that are no longer anchored to a position in the object.\n */\n detached?: string[];\n currentId?: string;\n autoFocusCurrentTextbox?: boolean;\n showResolvedThreads?: boolean;\n onThreadAttend?: (thread: ThreadType) => void;\n onThreadDelete?: (thread: ThreadType) => void;\n onMessageDelete?: (thread: ThreadType, messageId: string) => void;\n onThreadToggleResolved?: (thread: ThreadType) => void;\n onComment?: (thread: ThreadType) => void;\n};\n\nexport const CommentsHeading = ({ attendableId }: { attendableId?: string }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n\n return (\n <div role='none' className='flex items-center'>\n <PlankHeading.Button attendableId={attendableId}>\n <Quotes {...plankHeadingIconProps} />\n </PlankHeading.Button>\n <PlankHeading.Label attendableId={attendableId}>{t('comments heading')}</PlankHeading.Label>\n </div>\n );\n};\n\n/**\n * Comment threads.\n */\nexport const CommentsContainer = ({\n threads,\n detached = [],\n currentId,\n autoFocusCurrentTextbox,\n showResolvedThreads,\n onThreadAttend,\n onThreadDelete,\n onMessageDelete,\n onThreadToggleResolved,\n ...props\n}: ThreadsContainerProps) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n const filteredThreads = showResolvedThreads ? threads : threads.filter((thread) => !(thread?.status === 'resolved'));\n\n useEffect(() => {\n if (currentId) {\n document.getElementById(currentId)?.scrollIntoView({ behavior: 'smooth', block: 'end' });\n }\n }, [currentId]);\n\n return (\n <>\n {filteredThreads.length > 0 ? (\n filteredThreads.map((thread) => (\n <CommentContainer\n key={thread.id}\n thread={thread}\n current={currentId === thread.id}\n detached={detached.includes(thread.id)}\n autoFocusTextbox={autoFocusCurrentTextbox && currentId === thread.id}\n {...(onThreadAttend && { onAttend: () => onThreadAttend(thread) })}\n {...(onThreadDelete && { onThreadDelete: () => onThreadDelete(thread) })}\n {...(onMessageDelete && { onMessageDelete: (messageId: string) => onMessageDelete(thread, messageId) })}\n {...(onThreadToggleResolved && { onResolve: () => onThreadToggleResolved(thread) })}\n {...props}\n />\n ))\n ) : (\n <div\n role='alert'\n className={mx(\n descriptionText,\n 'place-self-center border border-dashed border-neutral-400/50 rounded-lg text-center p-4 m-4',\n )}\n >\n <h2 className='mbe-2 font-medium text-baseText'>{t('no comments title')}</h2>\n <p>\n <Trans\n {...{\n t,\n i18nKey: 'no comments message',\n components: {\n commentIcon: <ChatText className='inline-block' />,\n },\n }}\n />\n </p>\n </div>\n )}\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { THREAD_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [THREAD_PLUGIN]: {\n 'plugin name': 'Threads',\n 'channel name placeholder': 'New channel',\n 'channel title label': 'Title',\n 'delete channel label': 'Delete channel',\n 'create channel label': 'Create channel',\n 'message placeholder': 'Reply…',\n 'settings standalone label': 'Enable channel creation (experimental)',\n 'activity message': 'Processing…',\n 'anonymous label': 'Anonymous',\n 'delete message block label': 'Delete message block',\n 'detached thread label': 'Referenced content was removed',\n 'delete thread label': 'Delete thread',\n 'thread deleted label': 'You deleted a thread.',\n 'message deleted label': 'You deleted a message.',\n 'comments heading': 'Comments',\n 'chat heading': 'Chat',\n 'draft button': 'DRAFT',\n 'no comments title': 'No comments (yet)',\n 'no comments message':\n 'To start a comment thread, select a range of text in a document and click the <commentIcon></commentIcon> Create comment button in the toolbar.',\n 'toggle show resolved': 'Show resolved',\n 'unnamed object threads label': 'Threads',\n 'mark as resolved label': 'Mark as resolved',\n 'mark as unresolved label': 'Mark as unresolved',\n 'save message label': 'Save',\n 'edit message label': 'Edit',\n 'delete message label': 'Delete message',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ThreadPlugin } from './ThreadPlugin';\n\nexport default ThreadPlugin;\n\nexport * from './hooks';\nexport * from './types';\n\nexport * from './ThreadPlugin';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAqC;AACrC,0BAAiC;AACjC,IAAAA,gBAAkB;AAElB,2BAgBO;AAEP,yBAAqD;AACrD,IAAAC,sBAAuB;AACvB,2BAAkC;AAClC,8BAAmE;AACnE,2BAAkC;AAClC,0BAAiE;AACjE,mBAA6B;AAC7B,kBAAoC;AACpC,0BAA4B;AAC5B,IAAAC,gBAAqD;AACrD,kBAQO;AACP,sBAA2B;AAC3B,gCAA2C;AAC3C,6BAA8D;AAC9D,6BAAmD;AACnD,kBAA4B;AC7C5B,IAAAF,gBAAkB;ACAlB,IAAAA,gBAAkB;AAElB,6BAA8B;AAC9B,IAAAG,mBAAsC;ACHtC,IAAAH,gBAA+B;AAC/B,IAAAA,gBAAyE;AAEzE,IAAAC,sBAAuB;AACvB,IAAAC,gBAA4B;AAC5B,IAAAE,eAAqC;AACrC,kBAA4B;AAC5B,IAAAD,mBAAsE;AACtE,IAAAE,0BAAuE;AACvE,4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EAAE/R,IAAIwO,OAAM,MAAE;AACvB,sBAAM1P,SACJsH,MAAMC,QAAQuF,IAAI5L,EAAE,GAAGgJ,KAAK,CAAClK,YAAWA,QAAOkB,OAAOA,EAAAA,KACtD4L,IAAInH,QAAQuE,KAAK,CAAClK,YAAWA,SAAQkB,OAAOA,EAAAA;AAE9C,oBAAIlB,kBAAkByL,4BAAczL,OAAOoQ,QAAQ;AACjD,wBAAM,CAACP,OAAO2C,GAAAA,IAAOxS,OAAOoQ,OAAO3D,MAAM,GAAA;AACzCzM,yBAAOsE,OAAOwI,IAAIwC,eAAWmD,gCAAelD,+BAAkBzC,IAAIwC,SAAS;oBAAC;mBAAU,GAAGO,OAAO2C,GAAAA;AAChGxS,yBAAOoQ,SAASV;gBAClB;cACF;cACAwD,UAAU,CAAC,EAAEC,WAAW,EAAEhT,SAASiT,QAAO,EAAE,MAAE;AAC5C,sBAAMtL,YAAWD,cAAcc,SAASC,OAAOd;AAC/C,oBAAIA,WAAU;AACZ,uBAAKA,UAAS;oBAAC;sBAAEwC,QAAQ2D,mCAAawD;sBAAQrH,MAAM;wBAAEjK,SAASA,WAAWiT;sBAAQ;oBAAE;mBAAE;gBACxF;cACF;YACF,CAAA;;QAEJ;MACF;IACF;EACF;AACF;AMruBA,IAAA,cAAehM;",
6
6
  "names": ["import_react", "import_echo_schema", "import_types", "import_react_ui", "import_echo", "import_react_ui_editor", "import_react_ui_thread", "import_util", "import_react_ui_theme", "ThreadSettings", "settings", "t", "useTranslation", "THREAD_PLUGIN", "React", "SettingsValue", "label", "Input", "Switch", "checked", "standalone", "onCheckedChange", "sizeClass", "getSize", "ToggleResolvedButton", "isResolved", "onResolve", "Tooltip", "Root", "Trigger", "asChild", "Button", "variant", "data-testid", "onClick", "classNames", "hoverableControlItem", "span", "className", "CheckCircle", "weight", "Portal", "Content", "Arrow", "DeleteThreadButton", "onDelete", "X", "CommentContainer", "thread", "detached", "context", "current", "autoFocusTextbox", "onAttend", "onThreadDelete", "onMessageDelete", "onComment", "identity", "useIdentity", "space", "getSpace", "members", "useMembers", "key", "activity", "useStatus", "id", "threadScrollRef", "useRef", "autoFocus", "setAutoFocus", "useState", "themeMode", "useThemeContext", "textboxMetadata", "getMessageMetadata", "_count", "_setCount", "rerenderEditor", "count", "messageRef", "extensions", "useMemo", "createBasicExtensions", "placeholder", "createThemeExtensions", "listener", "onChange", "text", "command", "useEffect", "scrollToEnd", "behavior", "setTimeout", "scrollIntoView", "block", "handleCreate", "useCallback", "messages", "push", "create", "MessageType", "sender", "identityKey", "toHex", "timestamp", "Date", "toISOString", "handleDeleteMessage", "Thread", "onClickCapture", "onFocusCapture", "div", "role", "mx", "hoverableControls", "hoverableFocusedWithinControls", "ThreadHeading", "name", "side", "status", "Tag", "palette", "filter", "nonNullable", "map", "message", "MessageContainer", "MessageTextbox", "onSend", "ThreadFooter", "ref", "CommentsHeading", "attendableId", "PlankHeading", "Quotes", "plankHeadingIconProps", "Label", "CommentsContainer", "threads", "currentId", "autoFocusCurrentTextbox", "showResolvedThreads", "onThreadAttend", "onThreadToggleResolved", "props", "filteredThreads", "document", "getElementById", "length", "includes", "messageId", "descriptionText", "h2", "p", "Trans", "i18nKey", "components", "commentIcon", "ChatText", "ThreadMain", "lazy", "ThreadArticle", "initialViewState", "ThreadPlugin", "LocalStorageStore", "state", "staging", "viewStore", "getViewState", "subjectId", "attentionPlugin", "navigationPlugin", "intentPlugin", "dispatch", "unsubscribeCallbacks", "meta", "ready", "plugins", "prop", "type", "bool", "allowUndefined", "resolvePlugin", "parseAttentionPlugin", "parseNavigationPlugin", "parseIntentPlugin", "provides", "intent", "graphPlugin", "parseGraphPlugin", "client", "parseClientPlugin", "channelsQuery", "spaces", "query", "Filter", "schema", "ChannelType", "queryUnsubscribe", "subscribe", "unsubscribe", "effect", "attention", "attended", "firstAttendedNodeWithComments", "Array", "from", "graph", "findNode", "find", "node", "data", "DocumentType", "action", "NavigationAction", "OPEN", "activeParts", "complementary", "SLUG_PATH_SEPARATOR", "unload", "forEach", "values", "metadata", "records", "typename", "ns", "icon", "Chat", "iconSymbol", "loadReferences", "channel", "loadObjectReferences", "ThreadType", "THREAD_ITEM", "parse", "item", "title", "object", "translations", "threadTranslations", "echo", "builder", "metadataResolver", "parseMetadataResolverPlugin", "resolver", "createExtension", "endsWith", "docId", "split", "at", "spaceId", "objectId", "get", "doc", "db", "getObjectById", "docMeta", "getTypename", "viewState", "properties", "iconComponent", "actions", "dataId", "toggle", "newToggleState", "ObservabilityAction", "SEND_EVENT", "threadId", "showResolved", "menuItemType", "isChecked", "testId", "ThreadAction", "CREATE", "isActionGroup", "startsWith", "SpaceAction", "ADD_OBJECT", "target", "plugin", "surface", "component", "active", "location", "isLayoutParts", "main", "layoutEntries", "currentPosition", "findIndex", "entry", "objectToTheLeft", "subject", "accessor", "content", "createDocAccessor", "undefined", "getStartPosition", "cursor", "range", "getRangeFromCursor", "start", "Number", "MAX_SAFE_INTEGER", "concat", "sort", "a", "b", "anchor", "qualifiedSubjectId", "fullyQualifiedId", "Set", "attendableAttrs", "createAttendableAttributes", "dispatchAnalytic", "ScrollArea", "Viewport", "has", "focus", "LayoutAction", "SCROLL_INTO_VIEW", "DELETE", "DELETE_MESSAGE", "TOGGLE_RESOLVED", "threadLength", "Scrollbar", "Thumb", "ChatHeading", "ChatContainer", "SELECT", "intents", "stagingArea", "index", "splice", "undo", "remove", "undoable", "savedThread", "add", "m", "messageIndex", "markdown", "comments", "computed", "end", "getTextInRange", "createExternalCommentSync", "sink", "value", "onCreate", "SLUG_COLLECTION_INDICATOR", "SET_LAYOUT", "element", "onUpdate", "onSelect", "selection", "closest"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-thread/src/meta.tsx":{"bytes":2229,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ThreadSettings.tsx":{"bytes":2595,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/command-extension.ts":{"bytes":3671,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/hooks/useStatus.ts":{"bytes":3661,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/hooks/analytics.ts":{"bytes":4347,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/hooks/index.ts":{"bytes":602,"imports":[{"path":"packages/plugins/plugin-thread/src/hooks/useStatus.ts","kind":"import-statement","original":"./useStatus"},{"path":"packages/plugins/plugin-thread/src/hooks/analytics.ts","kind":"import-statement","original":"./analytics"}],"format":"esm"},"packages/plugins/plugin-thread/src/util.ts":{"bytes":3056,"imports":[{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/components/MessageContainer.tsx":{"bytes":24068,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-thread/src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/CommentContainer.tsx":{"bytes":25497,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/MessageContainer.tsx","kind":"import-statement","original":"./MessageContainer"},{"path":"packages/plugins/plugin-thread/src/components/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-thread/src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/CommentsContainer.tsx":{"bytes":11717,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/CommentContainer.tsx","kind":"import-statement","original":"./CommentContainer"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ChatContainer.tsx":{"bytes":18635,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/MessageContainer.tsx","kind":"import-statement","original":"./MessageContainer"},{"path":"packages/plugins/plugin-thread/src/components/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-thread/src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ThreadMain.tsx":{"bytes":2735,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/ChatContainer.tsx","kind":"import-statement","original":"./ChatContainer"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx":{"bytes":1740,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/ChatContainer.tsx","kind":"import-statement","original":"./ChatContainer"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/index.ts":{"bytes":1898,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/ThreadSettings.tsx","kind":"import-statement","original":"./ThreadSettings"},{"path":"packages/plugins/plugin-thread/src/components/CommentContainer.tsx","kind":"import-statement","original":"./CommentContainer"},{"path":"packages/plugins/plugin-thread/src/components/MessageContainer.tsx","kind":"import-statement","original":"./MessageContainer"},{"path":"packages/plugins/plugin-thread/src/components/CommentsContainer.tsx","kind":"import-statement","original":"./CommentsContainer"},{"path":"packages/plugins/plugin-thread/src/components/ChatContainer.tsx","kind":"import-statement","original":"./ChatContainer"},{"path":"packages/plugins/plugin-thread/src/components/ThreadMain.tsx","kind":"dynamic-import","original":"./ThreadMain"},{"path":"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx","kind":"dynamic-import","original":"./ThreadArticle"}],"format":"esm"},"packages/plugins/plugin-thread/src/translations.ts":{"bytes":4946,"imports":[{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/types.ts":{"bytes":2935,"imports":[{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/ThreadPlugin.tsx":{"bytes":115173,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-thread/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-thread/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-thread/src/index.ts":{"bytes":948,"imports":[{"path":"packages/plugins/plugin-thread/src/ThreadPlugin.tsx","kind":"import-statement","original":"./ThreadPlugin"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/plugins/plugin-thread/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-thread/src/ThreadPlugin.tsx","kind":"import-statement","original":"./ThreadPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-thread/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":74865},"packages/plugins/plugin-thread/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-3VAAUEU5.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/dist/lib/node/ThreadMain-XP4YSF7U.cjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-thread/dist/lib/node/ThreadArticle-CSENFNNT.cjs","kind":"dynamic-import"}],"exports":["ThreadAction","ThreadPlugin","default","useAnalyticsCallback","useOnEditAnalytics","useStatus"],"entryPoint":"packages/plugins/plugin-thread/src/index.ts","inputs":{"packages/plugins/plugin-thread/src/ThreadPlugin.tsx":{"bytesInOutput":29912},"packages/plugins/plugin-thread/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/plugin-thread/src/components/ThreadSettings.tsx":{"bytesInOutput":556},"packages/plugins/plugin-thread/src/components/CommentContainer.tsx":{"bytesInOutput":6654},"packages/plugins/plugin-thread/src/components/CommentsContainer.tsx":{"bytesInOutput":2728},"packages/plugins/plugin-thread/src/translations.ts":{"bytesInOutput":1495},"packages/plugins/plugin-thread/src/index.ts":{"bytesInOutput":32}},"bytes":42590},"packages/plugins/plugin-thread/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-thread/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"}],"exports":["THREAD_ITEM","THREAD_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-thread/src/meta.tsx","inputs":{},"bytes":191},"packages/plugins/plugin-thread/dist/lib/node/types.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-thread/dist/lib/node/types.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"}],"exports":["ThreadAction"],"entryPoint":"packages/plugins/plugin-thread/src/types.ts","inputs":{},"bytes":148},"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1535},"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"}],"exports":["ThreadAction"],"inputs":{"packages/plugins/plugin-thread/src/types.ts":{"bytesInOutput":589}},"bytes":765},"packages/plugins/plugin-thread/dist/lib/node/ThreadMain-XP4YSF7U.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1392},"packages/plugins/plugin-thread/dist/lib/node/ThreadMain-XP4YSF7U.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-3VAAUEU5.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-thread/src/components/ThreadMain.tsx","inputs":{"packages/plugins/plugin-thread/src/components/ThreadMain.tsx":{"bytesInOutput":536}},"bytes":781},"packages/plugins/plugin-thread/dist/lib/node/ThreadArticle-CSENFNNT.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":852},"packages/plugins/plugin-thread/dist/lib/node/ThreadArticle-CSENFNNT.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-3VAAUEU5.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx","inputs":{"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx":{"bytesInOutput":271}},"bytes":525},"packages/plugins/plugin-thread/dist/lib/node/chunk-3VAAUEU5.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":30202},"packages/plugins/plugin-thread/dist/lib/node/chunk-3VAAUEU5.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ChatContainer","ChatHeading","MessageContainer","command","getMessageMetadata","useAnalyticsCallback","useOnEditAnalytics","useStatus"],"inputs":{"packages/plugins/plugin-thread/src/hooks/useStatus.ts":{"bytesInOutput":748},"packages/plugins/plugin-thread/src/hooks/analytics.ts":{"bytesInOutput":975},"packages/plugins/plugin-thread/src/hooks/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-thread/src/components/ChatContainer.tsx":{"bytesInOutput":4595},"packages/plugins/plugin-thread/src/components/MessageContainer.tsx":{"bytesInOutput":6313},"packages/plugins/plugin-thread/src/components/command-extension.ts":{"bytesInOutput":711},"packages/plugins/plugin-thread/src/util.ts":{"bytesInOutput":563}},"bytes":14688},"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1078},"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["THREAD_ITEM","THREAD_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-thread/src/meta.tsx":{"bytesInOutput":509}},"bytes":660}}}
1
+ {"inputs":{"packages/plugins/plugin-thread/src/meta.tsx":{"bytes":2229,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ThreadSettings.tsx":{"bytes":2595,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/command-extension.ts":{"bytes":3679,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/hooks/useStatus.ts":{"bytes":3661,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/hooks/analytics.ts":{"bytes":4347,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/hooks/index.ts":{"bytes":602,"imports":[{"path":"packages/plugins/plugin-thread/src/hooks/useStatus.ts","kind":"import-statement","original":"./useStatus"},{"path":"packages/plugins/plugin-thread/src/hooks/analytics.ts","kind":"import-statement","original":"./analytics"}],"format":"esm"},"packages/plugins/plugin-thread/src/util.ts":{"bytes":3056,"imports":[{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-thread/src/components/MessageContainer.tsx":{"bytes":24068,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-thread/src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/CommentContainer.tsx":{"bytes":25497,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/MessageContainer.tsx","kind":"import-statement","original":"./MessageContainer"},{"path":"packages/plugins/plugin-thread/src/components/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-thread/src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/CommentsContainer.tsx":{"bytes":11725,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/CommentContainer.tsx","kind":"import-statement","original":"./CommentContainer"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ChatContainer.tsx":{"bytes":18635,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/MessageContainer.tsx","kind":"import-statement","original":"./MessageContainer"},{"path":"packages/plugins/plugin-thread/src/components/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"../hooks"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-thread/src/util.ts","kind":"import-statement","original":"../util"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ThreadMain.tsx":{"bytes":2735,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/ChatContainer.tsx","kind":"import-statement","original":"./ChatContainer"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx":{"bytes":1740,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/ChatContainer.tsx","kind":"import-statement","original":"./ChatContainer"}],"format":"esm"},"packages/plugins/plugin-thread/src/components/index.ts":{"bytes":1898,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/ThreadSettings.tsx","kind":"import-statement","original":"./ThreadSettings"},{"path":"packages/plugins/plugin-thread/src/components/CommentContainer.tsx","kind":"import-statement","original":"./CommentContainer"},{"path":"packages/plugins/plugin-thread/src/components/MessageContainer.tsx","kind":"import-statement","original":"./MessageContainer"},{"path":"packages/plugins/plugin-thread/src/components/CommentsContainer.tsx","kind":"import-statement","original":"./CommentsContainer"},{"path":"packages/plugins/plugin-thread/src/components/ChatContainer.tsx","kind":"import-statement","original":"./ChatContainer"},{"path":"packages/plugins/plugin-thread/src/components/ThreadMain.tsx","kind":"dynamic-import","original":"./ThreadMain"},{"path":"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx","kind":"dynamic-import","original":"./ThreadArticle"}],"format":"esm"},"packages/plugins/plugin-thread/src/translations.ts":{"bytes":4946,"imports":[{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/types.ts":{"bytes":2935,"imports":[{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/plugin-thread/src/ThreadPlugin.tsx":{"bytes":115173,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/plugin-thread/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-thread/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-thread/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-thread/src/index.ts":{"bytes":948,"imports":[{"path":"packages/plugins/plugin-thread/src/ThreadPlugin.tsx","kind":"import-statement","original":"./ThreadPlugin"},{"path":"packages/plugins/plugin-thread/src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"packages/plugins/plugin-thread/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/plugins/plugin-thread/src/ThreadPlugin.tsx","kind":"import-statement","original":"./ThreadPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-thread/dist/lib/node/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":74869},"packages/plugins/plugin-thread/dist/lib/node/index.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-5PZNPPQF.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-attention","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-thread/dist/lib/node/ThreadMain-XJX75GHG.cjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-thread/dist/lib/node/ThreadArticle-DO56JXBU.cjs","kind":"dynamic-import"}],"exports":["ThreadAction","ThreadPlugin","default","useAnalyticsCallback","useOnEditAnalytics","useStatus"],"entryPoint":"packages/plugins/plugin-thread/src/index.ts","inputs":{"packages/plugins/plugin-thread/src/ThreadPlugin.tsx":{"bytesInOutput":29912},"packages/plugins/plugin-thread/src/components/index.ts":{"bytesInOutput":180},"packages/plugins/plugin-thread/src/components/ThreadSettings.tsx":{"bytesInOutput":556},"packages/plugins/plugin-thread/src/components/CommentContainer.tsx":{"bytesInOutput":6654},"packages/plugins/plugin-thread/src/components/CommentsContainer.tsx":{"bytesInOutput":2732},"packages/plugins/plugin-thread/src/translations.ts":{"bytesInOutput":1495},"packages/plugins/plugin-thread/src/index.ts":{"bytesInOutput":32}},"bytes":42594},"packages/plugins/plugin-thread/dist/lib/node/meta.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-thread/dist/lib/node/meta.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"}],"exports":["THREAD_ITEM","THREAD_PLUGIN","default"],"entryPoint":"packages/plugins/plugin-thread/src/meta.tsx","inputs":{},"bytes":191},"packages/plugins/plugin-thread/dist/lib/node/types.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-thread/dist/lib/node/types.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"}],"exports":["ThreadAction"],"entryPoint":"packages/plugins/plugin-thread/src/types.ts","inputs":{},"bytes":148},"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1535},"packages/plugins/plugin-thread/dist/lib/node/chunk-WPPLQNMJ.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"}],"exports":["ThreadAction"],"inputs":{"packages/plugins/plugin-thread/src/types.ts":{"bytesInOutput":589}},"bytes":765},"packages/plugins/plugin-thread/dist/lib/node/ThreadMain-XJX75GHG.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1392},"packages/plugins/plugin-thread/dist/lib/node/ThreadMain-XJX75GHG.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-5PZNPPQF.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-thread/src/components/ThreadMain.tsx","inputs":{"packages/plugins/plugin-thread/src/components/ThreadMain.tsx":{"bytesInOutput":536}},"bytes":781},"packages/plugins/plugin-thread/dist/lib/node/ThreadArticle-DO56JXBU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":852},"packages/plugins/plugin-thread/dist/lib/node/ThreadArticle-DO56JXBU.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-5PZNPPQF.cjs","kind":"import-statement"},{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx","inputs":{"packages/plugins/plugin-thread/src/components/ThreadArticle.tsx":{"bytesInOutput":271}},"bytes":525},"packages/plugins/plugin-thread/dist/lib/node/chunk-5PZNPPQF.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":30206},"packages/plugins/plugin-thread/dist/lib/node/chunk-5PZNPPQF.cjs":{"imports":[{"path":"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-observability/meta","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-deck","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/halo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/react-ui-thread","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["ChatContainer","ChatHeading","MessageContainer","command","getMessageMetadata","useAnalyticsCallback","useOnEditAnalytics","useStatus"],"inputs":{"packages/plugins/plugin-thread/src/hooks/useStatus.ts":{"bytesInOutput":748},"packages/plugins/plugin-thread/src/hooks/analytics.ts":{"bytesInOutput":975},"packages/plugins/plugin-thread/src/hooks/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-thread/src/components/ChatContainer.tsx":{"bytesInOutput":4595},"packages/plugins/plugin-thread/src/components/MessageContainer.tsx":{"bytesInOutput":6313},"packages/plugins/plugin-thread/src/components/command-extension.ts":{"bytesInOutput":715},"packages/plugins/plugin-thread/src/util.ts":{"bytesInOutput":563}},"bytes":14692},"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1078},"packages/plugins/plugin-thread/dist/lib/node/chunk-BWBONZGU.cjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["THREAD_ITEM","THREAD_PLUGIN","meta_default"],"inputs":{"packages/plugins/plugin-thread/src/meta.tsx":{"bytesInOutput":509}},"bytes":660}}}
@@ -1,4 +1,4 @@
1
- import '@dxosTheme';
1
+ import '@dxos-theme';
2
2
  import React from 'react';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DnD,wBAOE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"Chat.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DnD,wBAOE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -1,4 +1,4 @@
1
- import '@dxosTheme';
1
+ import '@dxos-theme';
2
2
  import React from 'react';
3
3
  declare const _default: {
4
4
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDnD,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDnD,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { Expando } from '@dxos/echo-schema';
2
2
  import { type Identity } from '@dxos/react-client/halo';
3
3
  export declare const createChatThread: (identity: Identity) => import("@dxos/echo-schema").ReactiveObject<{
4
- anchor?: string | undefined;
5
4
  name?: string | undefined;
5
+ anchor?: string | undefined;
6
6
  status?: "active" | "staged" | "resolved" | undefined;
7
7
  messages: import("@dxos/echo-schema").Ref<{
8
8
  text: string;
@@ -33,8 +33,8 @@ export declare const createChatThread: (identity: Identity) => import("@dxos/ech
33
33
  id: string;
34
34
  }>;
35
35
  export declare const createCommentThread: (identity: Identity) => import("@dxos/echo-schema").ReactiveObject<{
36
- anchor?: string | undefined;
37
36
  name?: string | undefined;
37
+ anchor?: string | undefined;
38
38
  status?: "active" | "staged" | "resolved" | undefined;
39
39
  messages: import("@dxos/echo-schema").Ref<{
40
40
  text: string;