@dxos/plugin-thread 0.8.2-main.12df754 → 0.8.2-main.2f9c567

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 (117) hide show
  1. package/dist/lib/browser/{ChatContainer-WC6KQDDU.mjs → ChatContainer-UTQWOBXM.mjs} +5 -5
  2. package/dist/lib/browser/ChatContainer-UTQWOBXM.mjs.map +7 -0
  3. package/dist/lib/browser/{app-graph-builder-6W4UKJDI.mjs → app-graph-builder-SQD3KQKB.mjs} +2 -2
  4. package/dist/lib/browser/app-graph-builder-SQD3KQKB.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-FY5OCUP6.mjs → chunk-2E5LHYLQ.mjs} +2 -2
  6. package/dist/lib/{node-esm/chunk-7DOPZH6Y.mjs.map → browser/chunk-2E5LHYLQ.mjs.map} +2 -2
  7. package/dist/lib/browser/{chunk-AYNXYEKP.mjs → chunk-32EIWOAL.mjs} +1 -1
  8. package/dist/lib/browser/{chunk-AYNXYEKP.mjs.map → chunk-32EIWOAL.mjs.map} +2 -2
  9. package/dist/lib/browser/chunk-AM4MYXGU.mjs +93 -0
  10. package/dist/lib/browser/chunk-AM4MYXGU.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-UT6IV2FX.mjs +17 -0
  12. package/dist/lib/browser/index.mjs +8 -8
  13. package/dist/lib/browser/index.mjs.map +3 -3
  14. package/dist/lib/browser/{intent-resolver-3UW6ROYT.mjs → intent-resolver-EDSAXXNW.mjs} +4 -4
  15. package/dist/lib/browser/intent-resolver-EDSAXXNW.mjs.map +7 -0
  16. package/dist/lib/browser/{markdown-7KXBXCUS.mjs → markdown-M4QAJXHG.mjs} +2 -2
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/{react-surface-KAPIXG2M.mjs → react-surface-FUWNPSKX.mjs} +8 -8
  19. package/dist/lib/browser/{react-surface-KAPIXG2M.mjs.map → react-surface-FUWNPSKX.mjs.map} +3 -3
  20. package/dist/lib/browser/{settings-2VZ7S4SK.mjs → settings-SSYDISA6.mjs} +2 -2
  21. package/dist/lib/browser/types.mjs +1 -1
  22. package/dist/lib/node/{ChatContainer-LVYQ67PJ.cjs → ChatContainer-VO5B47V4.cjs} +11 -11
  23. package/dist/lib/node/ChatContainer-VO5B47V4.cjs.map +7 -0
  24. package/dist/lib/node/{app-graph-builder-HZNWT4QU.cjs → app-graph-builder-G45JDZWQ.cjs} +5 -5
  25. package/dist/lib/node/app-graph-builder-G45JDZWQ.cjs.map +7 -0
  26. package/dist/lib/node/{chunk-RIYLEDQ7.cjs → chunk-BUYO7P2A.cjs} +6 -6
  27. package/dist/lib/node/chunk-BUYO7P2A.cjs.map +7 -0
  28. package/dist/lib/node/{chunk-46BSFPBV.cjs → chunk-HG7J3YR3.cjs} +44 -44
  29. package/dist/lib/node/chunk-HG7J3YR3.cjs.map +7 -0
  30. package/dist/lib/node/{chunk-BASYS5Q5.cjs → chunk-KYLJU47G.cjs} +9 -9
  31. package/dist/lib/node/{chunk-W25MBII2.cjs → chunk-NO6WQR36.cjs} +4 -4
  32. package/dist/lib/node/{chunk-W25MBII2.cjs.map → chunk-NO6WQR36.cjs.map} +2 -2
  33. package/dist/lib/node/index.cjs +15 -15
  34. package/dist/lib/node/index.cjs.map +3 -3
  35. package/dist/lib/node/{intent-resolver-DC6HDNTX.cjs → intent-resolver-ECFDZLCG.cjs} +15 -15
  36. package/dist/lib/node/intent-resolver-ECFDZLCG.cjs.map +7 -0
  37. package/dist/lib/node/{markdown-L2WMCQKM.cjs → markdown-G5NDD5EJ.cjs} +7 -7
  38. package/dist/lib/node/meta.json +1 -1
  39. package/dist/lib/node/{react-surface-5USFRCS3.cjs → react-surface-G7GXAK5G.cjs} +18 -18
  40. package/dist/lib/node/{react-surface-5USFRCS3.cjs.map → react-surface-G7GXAK5G.cjs.map} +3 -3
  41. package/dist/lib/node/{settings-7MGTJ46L.cjs → settings-PV6MGI52.cjs} +6 -6
  42. package/dist/lib/node/types.cjs +3 -3
  43. package/dist/lib/node/types.cjs.map +1 -1
  44. package/dist/lib/node-esm/{ChatContainer-WMOPMK5H.mjs → ChatContainer-IAX56SIL.mjs} +5 -5
  45. package/dist/lib/node-esm/ChatContainer-IAX56SIL.mjs.map +7 -0
  46. package/dist/lib/node-esm/{app-graph-builder-M3KK5QJH.mjs → app-graph-builder-25K4ELOR.mjs} +2 -2
  47. package/dist/lib/node-esm/app-graph-builder-25K4ELOR.mjs.map +7 -0
  48. package/dist/lib/node-esm/{chunk-7DOPZH6Y.mjs → chunk-CBAEGDBZ.mjs} +2 -2
  49. package/dist/lib/node-esm/chunk-CBAEGDBZ.mjs.map +7 -0
  50. package/dist/lib/node-esm/{chunk-T6E5EY7Z.mjs → chunk-IZWN4KAY.mjs} +1 -1
  51. package/dist/lib/node-esm/{chunk-T6E5EY7Z.mjs.map → chunk-IZWN4KAY.mjs.map} +2 -2
  52. package/dist/lib/node-esm/chunk-KUQP2ES3.mjs +19 -0
  53. package/dist/lib/node-esm/chunk-XTZJQJY4.mjs +94 -0
  54. package/dist/lib/node-esm/chunk-XTZJQJY4.mjs.map +7 -0
  55. package/dist/lib/node-esm/index.mjs +8 -8
  56. package/dist/lib/node-esm/index.mjs.map +3 -3
  57. package/dist/lib/node-esm/{intent-resolver-OAMDKGAA.mjs → intent-resolver-GHN5XIMY.mjs} +4 -4
  58. package/dist/lib/node-esm/intent-resolver-GHN5XIMY.mjs.map +7 -0
  59. package/dist/lib/node-esm/{markdown-ZKU23UVD.mjs → markdown-WMR5AZRI.mjs} +2 -2
  60. package/dist/lib/node-esm/meta.json +1 -1
  61. package/dist/lib/node-esm/{react-surface-VNZ2SN6W.mjs → react-surface-FSBMYEZJ.mjs} +8 -8
  62. package/dist/lib/node-esm/{react-surface-VNZ2SN6W.mjs.map → react-surface-FSBMYEZJ.mjs.map} +3 -3
  63. package/dist/lib/node-esm/{settings-AJAZ3O47.mjs → settings-TJ53GIH3.mjs} +2 -2
  64. package/dist/lib/node-esm/types.mjs +1 -1
  65. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  66. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  67. package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
  68. package/dist/types/src/components/MessageContainer.d.ts +5 -4
  69. package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
  70. package/dist/types/src/components/testing.d.ts +158 -49
  71. package/dist/types/src/components/testing.d.ts.map +1 -1
  72. package/dist/types/src/components/types.d.ts +2 -2
  73. package/dist/types/src/components/types.d.ts.map +1 -1
  74. package/dist/types/src/hooks/analytics.d.ts +2 -2
  75. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  76. package/dist/types/src/types.d.ts +328 -61
  77. package/dist/types/src/types.d.ts.map +1 -1
  78. package/package.json +35 -33
  79. package/src/ThreadPlugin.tsx +7 -7
  80. package/src/capabilities/app-graph-builder.ts +3 -3
  81. package/src/capabilities/intent-resolver.ts +2 -2
  82. package/src/components/Chat.stories.tsx +2 -2
  83. package/src/components/ChatContainer.tsx +3 -3
  84. package/src/components/Comments.stories.tsx +2 -2
  85. package/src/components/CommentsContainer.tsx +2 -8
  86. package/src/components/MessageContainer.tsx +9 -12
  87. package/src/components/testing.ts +2 -2
  88. package/src/components/types.ts +2 -2
  89. package/src/hooks/analytics.ts +6 -2
  90. package/src/types.ts +40 -40
  91. package/dist/lib/browser/ChatContainer-WC6KQDDU.mjs.map +0 -7
  92. package/dist/lib/browser/app-graph-builder-6W4UKJDI.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-2S7HPWRY.mjs +0 -17
  94. package/dist/lib/browser/chunk-FY5OCUP6.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-WOG72DWE.mjs +0 -93
  96. package/dist/lib/browser/chunk-WOG72DWE.mjs.map +0 -7
  97. package/dist/lib/browser/intent-resolver-3UW6ROYT.mjs.map +0 -7
  98. package/dist/lib/node/ChatContainer-LVYQ67PJ.cjs.map +0 -7
  99. package/dist/lib/node/app-graph-builder-HZNWT4QU.cjs.map +0 -7
  100. package/dist/lib/node/chunk-46BSFPBV.cjs.map +0 -7
  101. package/dist/lib/node/chunk-RIYLEDQ7.cjs.map +0 -7
  102. package/dist/lib/node/intent-resolver-DC6HDNTX.cjs.map +0 -7
  103. package/dist/lib/node-esm/ChatContainer-WMOPMK5H.mjs.map +0 -7
  104. package/dist/lib/node-esm/app-graph-builder-M3KK5QJH.mjs.map +0 -7
  105. package/dist/lib/node-esm/chunk-E446MGLP.mjs +0 -94
  106. package/dist/lib/node-esm/chunk-E446MGLP.mjs.map +0 -7
  107. package/dist/lib/node-esm/chunk-HZGOTRPK.mjs +0 -19
  108. package/dist/lib/node-esm/intent-resolver-OAMDKGAA.mjs.map +0 -7
  109. /package/dist/lib/browser/{chunk-2S7HPWRY.mjs.map → chunk-UT6IV2FX.mjs.map} +0 -0
  110. /package/dist/lib/browser/{markdown-7KXBXCUS.mjs.map → markdown-M4QAJXHG.mjs.map} +0 -0
  111. /package/dist/lib/browser/{settings-2VZ7S4SK.mjs.map → settings-SSYDISA6.mjs.map} +0 -0
  112. /package/dist/lib/node/{chunk-BASYS5Q5.cjs.map → chunk-KYLJU47G.cjs.map} +0 -0
  113. /package/dist/lib/node/{markdown-L2WMCQKM.cjs.map → markdown-G5NDD5EJ.cjs.map} +0 -0
  114. /package/dist/lib/node/{settings-7MGTJ46L.cjs.map → settings-PV6MGI52.cjs.map} +0 -0
  115. /package/dist/lib/node-esm/{chunk-HZGOTRPK.mjs.map → chunk-KUQP2ES3.mjs.map} +0 -0
  116. /package/dist/lib/node-esm/{markdown-ZKU23UVD.mjs.map → markdown-WMR5AZRI.mjs.map} +0 -0
  117. /package/dist/lib/node-esm/{settings-AJAZ3O47.mjs.map → settings-TJ53GIH3.mjs.map} +0 -0
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var ChatContainer_LVYQ67PJ_exports = {};
30
- __export(ChatContainer_LVYQ67PJ_exports, {
29
+ var ChatContainer_VO5B47V4_exports = {};
30
+ __export(ChatContainer_VO5B47V4_exports, {
31
31
  ChatContainer: () => ChatContainer,
32
32
  ChatHeading: () => ChatHeading,
33
33
  default: () => ChatContainer_default
34
34
  });
35
- module.exports = __toCommonJS(ChatContainer_LVYQ67PJ_exports);
36
- var import_chunk_RIYLEDQ7 = require("./chunk-RIYLEDQ7.cjs");
37
- var import_chunk_W25MBII2 = require("./chunk-W25MBII2.cjs");
35
+ module.exports = __toCommonJS(ChatContainer_VO5B47V4_exports);
36
+ var import_chunk_BUYO7P2A = require("./chunk-BUYO7P2A.cjs");
37
+ var import_chunk_NO6WQR36 = require("./chunk-NO6WQR36.cjs");
38
38
  var import_chunk_ONLWOUYZ = require("./chunk-ONLWOUYZ.cjs");
39
39
  var import_react = __toESM(require("react"));
40
40
  var import_echo_schema = require("@dxos/echo-schema");
@@ -68,14 +68,14 @@ var ChatContainer = ({ space, dxn, context, current, autoFocusTextbox }) => {
68
68
  const queue = (0, import_echo.useQueue)(dxn, {
69
69
  pollInterval: 1e3
70
70
  });
71
- const activity = (0, import_chunk_W25MBII2.useStatus)(space, id);
71
+ const activity = (0, import_chunk_NO6WQR36.useStatus)(space, id);
72
72
  const { t } = (0, import_react_ui.useTranslation)(import_chunk_ONLWOUYZ.THREAD_PLUGIN);
73
73
  const [_count, _setCount] = (0, import_react.useState)(0);
74
74
  const rerenderEditor = () => _setCount((count) => count + 1);
75
75
  const [autoFocus, setAutoFocus] = (0, import_react.useState)(autoFocusTextbox);
76
76
  const threadScrollRef = (0, import_react.useRef)(null);
77
77
  const { themeMode } = (0, import_react_ui.useThemeContext)();
78
- const textboxMetadata = (0, import_chunk_RIYLEDQ7.getMessageMetadata)(id, identity);
78
+ const textboxMetadata = (0, import_chunk_BUYO7P2A.getMessageMetadata)(id, identity);
79
79
  const messageRef = (0, import_react.useRef)("");
80
80
  const extensions = (0, import_react.useMemo)(() => [
81
81
  (0, import_react_ui_editor.createBasicExtensions)({
@@ -87,7 +87,7 @@ var ChatContainer = ({ space, dxn, context, current, autoFocusTextbox }) => {
87
87
  (0, import_react_ui_editor.listener)({
88
88
  onChange: (text) => messageRef.current = text
89
89
  }),
90
- import_chunk_RIYLEDQ7.command
90
+ import_chunk_BUYO7P2A.command
91
91
  ], [
92
92
  themeMode,
93
93
  _count
@@ -104,7 +104,7 @@ var ChatContainer = ({ space, dxn, context, current, autoFocusTextbox }) => {
104
104
  return false;
105
105
  }
106
106
  queue.append([
107
- (0, import_echo_schema.create)(import_schema.MessageType, {
107
+ (0, import_echo_schema.create)(import_schema.DataType.Message, {
108
108
  sender: {
109
109
  identityDid: identity.did
110
110
  },
@@ -137,7 +137,7 @@ var ChatContainer = ({ space, dxn, context, current, autoFocusTextbox }) => {
137
137
  }, /* @__PURE__ */ import_react.default.createElement("div", {
138
138
  role: "none",
139
139
  className: (0, import_react_ui_theme.mx)(import_react_ui_thread.threadLayout, "place-self-end")
140
- }, (queue?.items ?? []).map((message) => /* @__PURE__ */ import_react.default.createElement(import_chunk_RIYLEDQ7.MessageContainer, {
140
+ }, (queue?.items ?? []).map((message) => /* @__PURE__ */ import_react.default.createElement(import_chunk_BUYO7P2A.MessageContainer, {
141
141
  key: message.id,
142
142
  message,
143
143
  members
@@ -160,4 +160,4 @@ var ChatContainer_default = ChatContainer;
160
160
  ChatContainer,
161
161
  ChatHeading
162
162
  });
163
- //# sourceMappingURL=ChatContainer-LVYQ67PJ.cjs.map
163
+ //# sourceMappingURL=ChatContainer-VO5B47V4.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ChatContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useLayoutEffect, useMemo, useRef, useState } from 'react';\n\nimport { create } from '@dxos/echo-schema';\nimport { type DXN } from '@dxos/keys';\nimport { makeRef } from '@dxos/live-object';\nimport { type Space, useMembers, useQueue } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { Icon, ScrollArea, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, listener } from '@dxos/react-ui-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\nimport { MessageTextbox, type MessageTextboxProps, Thread, ThreadFooter, threadLayout } from '@dxos/react-ui-thread';\nimport { DataType } from '@dxos/schema';\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\nexport const ChatHeading = ({ attendableId }: { attendableId?: string }) => {\n const { t } = useTranslation(THREAD_PLUGIN);\n return (\n <div role='none' className='flex items-center'>\n <StackItem.SigilButton attendableId={attendableId}>\n <Icon icon='ph--chat--regular' size={5} />\n </StackItem.SigilButton>\n <StackItem.HeadingLabel attendableId={attendableId}>{t('chat heading')}</StackItem.HeadingLabel>\n </div>\n );\n};\n\nexport type ChatContainerProps = Omit<ThreadContainerProps, 'thread'> & {\n space: Space;\n dxn: DXN;\n};\n\nexport const ChatContainer = ({ space, dxn, context, current, autoFocusTextbox }: ChatContainerProps) => {\n const id = dxn.toString();\n const identity = useIdentity()!;\n const members = useMembers(space?.key);\n const queue = useQueue<DataType.Message>(dxn, { pollInterval: 1_000 });\n const activity = useStatus(space, id);\n const { t } = useTranslation(THREAD_PLUGIN);\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 [autoFocus, setAutoFocus] = useState(autoFocusTextbox);\n const threadScrollRef = useRef<HTMLDivElement | null>(null);\n const { themeMode } = useThemeContext();\n\n const textboxMetadata = getMessageMetadata(id, identity);\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 [themeMode, _count],\n );\n\n // TODO(thure): Factor out.\n // TODO(thure): `flex-col-reverse` does not work to start the container scrolled to the end while also using\n // `ScrollArea`. This is the least-bad way I found to scroll to the end on mount. Note that 0ms was insufficient\n // for the desired effect; this is likely hardware-dependent and should be reevaluated.\n const scrollToEnd = (behavior: ScrollBehavior) =>\n setTimeout(() => threadScrollRef.current?.scrollIntoView({ behavior, block: 'end' }), 10);\n\n useLayoutEffect(() => {\n scrollToEnd('instant');\n }, []);\n\n // TODO(burdon): Change to model.\n const handleCreate: MessageTextboxProps['onSend'] = () => {\n if (!messageRef.current?.length || !queue) {\n return false;\n }\n\n queue.append([\n create(DataType.Message, {\n sender: { identityDid: identity.did },\n created: new Date().toISOString(),\n blocks: [{ type: 'text', text: messageRef.current }],\n properties: context ? { context: makeRef(context) } : undefined,\n }),\n ]);\n\n messageRef.current = '';\n setAutoFocus(true);\n scrollToEnd('smooth');\n rerenderEditor();\n return true;\n };\n\n return (\n <Thread\n current={current}\n id={id}\n classNames='bs-full grid-rows-[1fr_min-content_min-content] overflow-hidden transition-[padding-block-end] [[data-sidebar-inline-start-state=open]_&]:lg:pbe-0'\n >\n <ScrollArea.Root classNames='col-span-2'>\n <ScrollArea.Viewport classNames='overflow-anchored after:overflow-anchor after:block after:bs-px after:-mbs-px [&>div]:min-bs-full [&>div]:!grid [&>div]:grid-rows-[1fr_0]'>\n <div role='none' className={mx(threadLayout, 'place-self-end')}>\n {(queue?.items ?? []).map((message) => (\n <MessageContainer key={message.id} message={message} members={members} />\n ))}\n </div>\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 <ScrollArea.Scrollbar>\n <ScrollArea.Thumb />\n </ScrollArea.Scrollbar>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n <MessageTextbox extensions={extensions} autoFocus={autoFocus} onSend={handleCreate} {...textboxMetadata} />\n <ThreadFooter activity={activity}>{t('activity message')}</ThreadFooter>\n </Thread>\n );\n};\n\nexport default ChatContainer;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkE;AAElE,yBAAuB;AAEvB,yBAAwB;AACxB,kBAAiD;AACjD,kBAA4B;AAC5B,sBAAkE;AAClE,6BAAuE;AACvE,4BAA0B;AAC1B,4BAAmB;AACnB,6BAA6F;AAC7F,oBAAyB;AASlB,IAAMA,cAAc,CAAC,EAAEC,aAAY,MAA6B;AACrE,QAAM,EAAEC,EAAC,QAAKC,gCAAeC,mCAAAA;AAC7B,SACE,6BAAAC,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,6BAAAH,QAAA,cAACI,gCAAUC,aAAW;IAACT;KACrB,6BAAAI,QAAA,cAACM,sBAAAA;IAAKC,MAAK;IAAoBC,MAAM;OAEvC,6BAAAR,QAAA,cAACI,gCAAUK,cAAY;IAACb;KAA6BC,EAAE,cAAA,CAAA,CAAA;AAG7D;AAOO,IAAMa,gBAAgB,CAAC,EAAEC,OAAOC,KAAKC,SAASC,SAASC,iBAAgB,MAAsB;AAClG,QAAMC,KAAKJ,IAAIK,SAAQ;AACvB,QAAMC,eAAWC,yBAAAA;AACjB,QAAMC,cAAUC,wBAAWV,OAAOW,GAAAA;AAClC,QAAMC,YAAQC,sBAA2BZ,KAAK;IAAEa,cAAc;EAAM,CAAA;AACpE,QAAMC,eAAWC,iCAAUhB,OAAOK,EAAAA;AAClC,QAAM,EAAEnB,EAAC,QAAKC,gCAAeC,mCAAAA;AAE7B,QAAM,CAAC6B,QAAQC,SAAAA,QAAaC,uBAAS,CAAA;AACrC,QAAMC,iBAAiB,MAAMF,UAAU,CAACG,UAAUA,QAAQ,CAAA;AAC1D,QAA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F,YAAW;KAC1B,6BAAA3E,QAAA,cAAC4E,2BAAWE,UAAQ;IAACH,YAAW;KAC9B,6BAAA3E,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,eAAW4E,0BAAGC,qCAAc,gBAAA;MACzCzD,OAAO0D,SAAS,CAAA,GAAIC,IAAI,CAACC,YACzB,6BAAAnF,QAAA,cAACoF,wCAAAA;IAAiB9D,KAAK6D,QAAQnE;IAAImE;IAAkB/D;QAIzD,6BAAApB,QAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;IAAgBkF,KAAKlD;MAChD,6BAAAnC,QAAA,cAAC4E,2BAAWU,WAAS,MACnB,6BAAAtF,QAAA,cAAC4E,2BAAWW,OAAK,IAAA,CAAA,CAAA,CAAA,GAIvB,6BAAAvF,QAAA,cAACwF,uCAAAA;IAAe9C;IAAwBT;IAAsBwD,QAAQhC;IAAe,GAAGlB;MACxF,6BAAAvC,QAAA,cAAC0F,qCAAAA;IAAahE;KAAqB7B,EAAE,kBAAA,CAAA,CAAA;AAG3C;AAEA,IAAA,wBAAea;",
6
+ "names": ["ChatHeading", "attendableId", "t", "useTranslation", "THREAD_PLUGIN", "React", "div", "role", "className", "StackItem", "SigilButton", "Icon", "icon", "size", "HeadingLabel", "ChatContainer", "space", "dxn", "context", "current", "autoFocusTextbox", "id", "toString", "identity", "useIdentity", "members", "useMembers", "key", "queue", "useQueue", "pollInterval", "activity", "useStatus", "_count", "_setCount", "useState", "rerenderEditor", "count", "autoFocus", "setAutoFocus", "threadScrollRef", "useRef", "themeMode", "useThemeContext", "textboxMetadata", "getMessageMetadata", "messageRef", "extensions", "useMemo", "createBasicExtensions", "placeholder", "createThemeExtensions", "listener", "onChange", "text", "command", "scrollToEnd", "behavior", "setTimeout", "scrollIntoView", "block", "useLayoutEffect", "handleCreate", "length", "append", "create", "DataType", "Message", "sender", "identityDid", "did", "created", "Date", "toISOString", "blocks", "type", "properties", "makeRef", "undefined", "Thread", "classNames", "ScrollArea", "Root", "Viewport", "mx", "threadLayout", "items", "map", "message", "MessageContainer", "ref", "Scrollbar", "Thumb", "MessageTextbox", "onSend", "ThreadFooter"]
7
+ }
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var app_graph_builder_HZNWT4QU_exports = {};
20
- __export(app_graph_builder_HZNWT4QU_exports, {
19
+ var app_graph_builder_G45JDZWQ_exports = {};
20
+ __export(app_graph_builder_G45JDZWQ_exports, {
21
21
  default: () => app_graph_builder_default
22
22
  });
23
- module.exports = __toCommonJS(app_graph_builder_HZNWT4QU_exports);
23
+ module.exports = __toCommonJS(app_graph_builder_G45JDZWQ_exports);
24
24
  var import_chunk_ONLWOUYZ = require("./chunk-ONLWOUYZ.cjs");
25
25
  var import_app_framework = require("@dxos/app-framework");
26
26
  var import_types = require("@dxos/plugin-deck/types");
@@ -29,7 +29,7 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
29
29
  (0, import_plugin_graph.createExtension)({
30
30
  id: `${import_chunk_ONLWOUYZ.meta.id}/comments`,
31
31
  // TODO(wittjosiah): Support comments on any object.
32
- // filter: (node): node is Node<ReactiveEchoObject<any>> => isEchoObject(node.data),
32
+ // filter: (node): node is Node<AnyLiveObject<any>> => isEchoObject(node.data),
33
33
  filter: (node) => !!node.data && typeof node.data === "object" && "threads" in node.data && Array.isArray(node.data.threads),
34
34
  connector: ({ node }) => [
35
35
  {
@@ -54,4 +54,4 @@ var app_graph_builder_default = (context) => (0, import_app_framework.contribute
54
54
  ]
55
55
  })
56
56
  ]);
57
- //# sourceMappingURL=app-graph-builder-HZNWT4QU.cjs.map
57
+ //# sourceMappingURL=app-graph-builder-G45JDZWQ.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\nimport { type AnyLiveObject } from '@dxos/client/echo';\nimport { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension, type Node } from '@dxos/plugin-graph';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginsContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/comments`,\n // TODO(wittjosiah): Support comments on any object.\n // filter: (node): node is Node<AnyLiveObject<any>> => isEchoObject(node.data),\n filter: (node): node is Node<AnyLiveObject<any>> =>\n !!node.data && typeof node.data === 'object' && 'threads' in node.data && Array.isArray(node.data.threads),\n connector: ({ node }) => [\n {\n id: [node.id, 'comments'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'comments',\n properties: {\n label: ['comments label', { ns: meta.id }],\n icon: 'ph--chat-text--regular',\n disposition: 'hidden',\n position: 'hoist',\n },\n },\n ],\n }),\n ]);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,2BAA+D;AAE/D,mBAAgE;AAChE,0BAA2C;AAI3C,IAAA,4BAAe,CAACA,gBACdC,kCAAYC,kCAAaC,iBAAiB;MACxCC,qCAAgB;IACdC,IAAI,GAAGC,2BAAKD,EAAE;;;IAGdE,QAAQ,CAACC,SACP,CAAC,CAACA,KAAKC,QAAQ,OAAOD,KAAKC,SAAS,YAAY,aAAaD,KAAKC,QAAQC,MAAMC,QAAQH,KAAKC,KAAKG,OAAO;IAC3GC,WAAW,CAAC,EAAEL,KAAI,MAAO;MACvB;QACEH,IAAI;UAACG,KAAKH;UAAI;UAAYS,KAAKC,sCAAAA;QAC/BC,MAAMC;QACNR,MAAM;QACNS,YAAY;UACVC,OAAO;YAAC;YAAkB;cAAEC,IAAId,2BAAKD;YAAG;;UACxCgB,MAAM;UACNC,aAAa;UACbC,UAAU;QACZ;MACF;;EAEJ,CAAA;CACD;",
6
+ "names": ["context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "filter", "node", "data", "Array", "isArray", "threads", "connector", "join", "ATTENDABLE_PATH_SEPARATOR", "type", "PLANK_COMPANION_TYPE", "properties", "label", "ns", "icon", "disposition", "position"]
7
+ }
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_RIYLEDQ7_exports = {};
30
- __export(chunk_RIYLEDQ7_exports, {
29
+ var chunk_BUYO7P2A_exports = {};
30
+ __export(chunk_BUYO7P2A_exports, {
31
31
  MessageContainer: () => MessageContainer,
32
32
  command: () => command,
33
33
  getMessageMetadata: () => getMessageMetadata
34
34
  });
35
- module.exports = __toCommonJS(chunk_RIYLEDQ7_exports);
36
- var import_chunk_W25MBII2 = require("./chunk-W25MBII2.cjs");
35
+ module.exports = __toCommonJS(chunk_BUYO7P2A_exports);
36
+ var import_chunk_NO6WQR36 = require("./chunk-NO6WQR36.cjs");
37
37
  var import_chunk_ONLWOUYZ = require("./chunk-ONLWOUYZ.cjs");
38
38
  var import_language = require("@codemirror/language");
39
39
  var import_react_ui_editor = require("@dxos/react-ui-editor");
@@ -107,7 +107,7 @@ var MessageContainer = ({ message, members, editable = false, onDelete }) => {
107
107
  const deleteLabel = t("delete message label");
108
108
  const textBlock = message.blocks.find((block) => block.type === "text");
109
109
  const references = message.blocks.filter((block) => block.type === "reference").map((block) => block.reference);
110
- (0, import_chunk_W25MBII2.useOnEditAnalytics)(message, textBlock, !!editing);
110
+ (0, import_chunk_NO6WQR36.useOnEditAnalytics)(message, textBlock, !!editing);
111
111
  return /* @__PURE__ */ import_react2.default.createElement(import_react_ui_thread.MessageRoot, {
112
112
  ...messageMetadata,
113
113
  classNames: [
@@ -229,4 +229,4 @@ var MessageBlockObjectTile = /* @__PURE__ */ (0, import_react2.forwardRef)(({ su
229
229
  command,
230
230
  getMessageMetadata
231
231
  });
232
- //# sourceMappingURL=chunk-RIYLEDQ7.cjs.map
232
+ //# sourceMappingURL=chunk-BUYO7P2A.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/command-extension.ts", "../../../src/util.ts", "../../../src/components/MessageContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { StreamLanguage, HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\n\nimport { tags } from '@dxos/react-ui-editor';\nimport { mx } from '@dxos/react-ui-theme';\n\n/**\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n if (state.count === 1 && stream.match(/^(\\/\\w+)/)) {\n return 'tagName';\n }\n stream.next();\n return null;\n },\n});\n\nconst styles = HighlightStyle.define([\n { tag: tags.tagName, class: mx('dx-tag dx-tag--indigo text-baseText font-medium') },\n]);\n\nexport const command: Extension = [parser, syntaxHighlighting(styles)];\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { generateName } from '@dxos/display-name';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Identity } from '@dxos/react-client/halo';\nimport { type MessageMetadata } from '@dxos/react-ui-thread';\nimport { hexToFallback } from '@dxos/util';\n\nexport type MessagePropertiesProvider = (identityKey: PublicKey | undefined) => MessageMetadata;\n\nexport const getMessageMetadata = (id: string, identity?: Identity): MessageMetadata => {\n const fallback = hexToFallback(identity?.identityKey.toHex() ?? '0');\n return {\n id,\n authorId: identity?.did,\n authorName:\n identity?.profile?.displayName ??\n (identity?.identityKey ? generateName(identity.identityKey.toHex()) : undefined),\n authorAvatarProps: {\n hue: identity?.profile?.data?.hue ?? fallback.hue,\n emoji: identity?.profile?.data?.emoji ?? fallback.emoji,\n },\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport { Check, PencilSimple, X } from '@phosphor-icons/react';\nimport React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { RefArray } from '@dxos/live-object';\nimport { PublicKey } from '@dxos/react-client';\nimport { type AnyLiveObject, type Expando, type SpaceMember } from '@dxos/react-client/echo';\nimport { useIdentity, type Identity } from '@dxos/react-client/halo';\nimport { Button, ButtonGroup, Tooltip, useOnTransition, useThemeContext, useTranslation } from '@dxos/react-ui';\nimport { createBasicExtensions, createThemeExtensions, useTextEditor } from '@dxos/react-ui-editor';\nimport {\n getSize,\n hoverableControlItem,\n hoverableControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/react-ui-theme';\nimport { MessageHeading, MessageRoot } from '@dxos/react-ui-thread';\nimport { type DataType } from '@dxos/schema';\n\nimport { command } from './command-extension';\nimport { useOnEditAnalytics } from '../hooks';\nimport { THREAD_PLUGIN } from '../meta';\nimport { getMessageMetadata } from '../util';\n\n// TODO(thure): #8149\nconst messageControlClassNames = ['!p-1 !min-bs-0 transition-opacity', hoverableControlItem];\n\nexport type MessageContainerProps = {\n message: DataType.Message;\n members: SpaceMember[];\n editable?: boolean;\n onDelete?: (id: string) => void;\n};\n\nexport const MessageContainer = ({ message, members, editable = false, onDelete }: MessageContainerProps) => {\n const senderIdentity = members.find(\n (member) =>\n (message.sender.identityDid && member.identity.did === message.sender.identityDid) ||\n (message.sender.identityKey && PublicKey.equals(member.identity.identityKey, message.sender.identityKey)),\n )?.identity;\n const messageMetadata = getMessageMetadata(message.id, senderIdentity);\n const userIsAuthor = useIdentity()?.did === messageMetadata.authorId;\n const [editing, setEditing] = useState(false);\n const handleDelete = useCallback(() => onDelete?.(message.id), [message, onDelete]);\n const { t } = useTranslation(THREAD_PLUGIN);\n const editLabel = t(editing ? 'save message label' : 'edit message label');\n const deleteLabel = t('delete message label');\n const textBlock = message.blocks.find((block) => block.type === 'text');\n const references = message.blocks.filter((block) => block.type === 'reference').map((block) => block.reference);\n\n useOnEditAnalytics(message, textBlock, !!editing);\n\n return (\n <MessageRoot {...messageMetadata} classNames={[hoverableControls, hoverableFocusedWithinControls]}>\n <MessageHeading authorName={messageMetadata.authorName} timestamp={messageMetadata.timestamp}>\n <ButtonGroup classNames='mie-1'>\n {userIsAuthor && editable && (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}\n classNames={messageControlClassNames}\n onClick={() => setEditing((editing) => !editing)}\n >\n <span className='sr-only'>{editLabel}</span>\n {editing ? <Check className={getSize(4)} /> : <PencilSimple className={getSize(4)} />}\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content>\n {editLabel}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n )}\n {onDelete && (\n <Tooltip.Root>\n <Tooltip.Trigger asChild>\n <Button\n variant='ghost'\n data-testid='thread.message.delete'\n classNames={messageControlClassNames}\n onClick={() => handleDelete()}\n >\n <span className='sr-only'>{deleteLabel}</span>\n <X className={getSize(4)} />\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content>\n {deleteLabel}\n <Tooltip.Arrow />\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip.Root>\n )}\n </ButtonGroup>\n </MessageHeading>\n {textBlock && <TextboxBlock block={textBlock} isAuthor={userIsAuthor} editing={editing} />}\n {RefArray.targets(references).map((reference, index) => (\n <MessagePart key={index} part={reference} />\n ))}\n </MessageRoot>\n );\n};\n\nconst MessagePart = ({ part }: { part: Expando }) => {\n return <MessageBlockObjectTile subject={part} />;\n};\n\nconst TextboxBlock = ({\n block,\n isAuthor,\n editing,\n}: {\n block: DataType.MessageBlock.Text;\n editing?: boolean;\n isAuthor?: boolean;\n identity?: Identity;\n}) => {\n const { themeMode } = useThemeContext();\n const inMemoryContentRef = useRef(block.text);\n\n const handleDocumentChange = useCallback((newState: string) => {\n inMemoryContentRef.current = newState;\n }, []);\n\n const saveDocumentChange = useCallback(() => {\n block.text = inMemoryContentRef.current;\n }, [block]);\n\n useOnTransition(editing, true, false, saveDocumentChange);\n\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n initialValue: block.text,\n extensions: [\n createBasicExtensions({ readOnly: !isAuthor || !editing }),\n createThemeExtensions({ themeMode }),\n command,\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n handleDocumentChange(update.state.doc.toString());\n }\n }),\n ],\n }),\n [block.text, editing, isAuthor, themeMode, handleDocumentChange],\n );\n\n useEffect(() => {\n editing && view?.focus();\n }, [editing, view]);\n\n return <div role='none' ref={parentRef} className='mie-4' {...focusAttributes} />;\n};\n\nconst MessageBlockObjectTile = forwardRef<HTMLDivElement, { subject: AnyLiveObject<any> }>(\n ({ subject }, forwardedRef) => {\n let title = subject.name ?? subject.title ?? subject.type ?? 'Object';\n if (typeof title !== 'string') {\n title = title?.content ?? '';\n }\n\n return (\n <div\n role='group'\n className={mx('grid col-span-3 py-1 pr-4', hoverableControls, hoverableFocusedWithinControls)}\n ref={forwardedRef}\n >\n <Surface role='card' limit={1} data={{ subject }} fallback={title} />\n </div>\n );\n },\n);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,sBAAmE;AAGnE,6BAAqB;AACrB,4BAAmB;ACJnB,0BAA6B;AAI7B,kBAA8B;ACJ9B,kBAA2B;AAC3B,mBAAuC;AACvC,IAAAA,gBAA4E;AAE5E,2BAAwB;AACxB,yBAAyB;AACzB,0BAA0B;AAE1B,kBAA2C;AAC3C,sBAA+F;AAC/F,IAAAC,0BAA4E;AAC5E,IAAAC,yBAMO;AACP,6BAA4C;AFT5C,IAAMC,SAASC,+BAAeC,OAA0B;EACtDC,YAA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_react_ui_theme", "parser", "StreamLanguage", "define", "startState", "count", "token", "stream", "state", "eatSpace", "match", "next", "styles", "HighlightStyle", "tag", "tags", "tagName", "class", "mx", "command", "syntaxHighlighting", "getMessageMetadata", "id", "identity", "fallback", "hexToFallback", "identityKey", "toHex", "authorId", "did", "authorName", "profile", "displayName", "generateName", "undefined", "authorAvatarProps", "hue", "data", "emoji", "messageControlClassNames", "hoverableControlItem", "MessageContainer", "message", "members", "editable", "onDelete", "senderIdentity", "find", "member", "sender", "identityDid", "PublicKey", "equals", "messageMetadata", "userIsAuthor", "useIdentity", "editing", "setEditing", "useState", "handleDelete", "useCallback", "t", "useTranslation", "THREAD_PLUGIN", "editLabel", "deleteLabel", "textBlock", "blocks", "block", "type", "references", "filter", "map", "reference", "useOnEditAnalytics", "React", "MessageRoot", "classNames", "hoverableControls", "hoverableFocusedWithinControls", "MessageHeading", "timestamp", "ButtonGroup", "Tooltip", "Root", "Trigger", "asChild", "Button", "variant", "data-testid", "onClick", "span", "className", "Check", "getSize", "PencilSimple", "Portal", "Content", "Arrow", "X", "TextboxBlock", "isAuthor", "RefArray", "targets", "index", "MessagePart", "key", "part", "MessageBlockObjectTile", "subject", "themeMode", "useThemeContext", "inMemoryContentRef", "useRef", "text", "handleDocumentChange", "newState", "current", "saveDocumentChange", "useOnTransition", "parentRef", "focusAttributes", "view", "useTextEditor", "initialValue", "extensions", "createBasicExtensions", "readOnly", "createThemeExtensions", "EditorView", "updateListener", "of", "update", "docChanged", "doc", "toString", "useEffect", "focus", "div", "role", "ref", "forwardRef", "forwardedRef", "title", "name", "content", "Surface", "limit"]
7
+ }
@@ -16,13 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_46BSFPBV_exports = {};
20
- __export(chunk_46BSFPBV_exports, {
19
+ var chunk_HG7J3YR3_exports = {};
20
+ __export(chunk_HG7J3YR3_exports, {
21
21
  ThreadAction: () => ThreadAction,
22
22
  ThreadSettingsSchema: () => ThreadSettingsSchema
23
23
  });
24
- module.exports = __toCommonJS(chunk_46BSFPBV_exports);
24
+ module.exports = __toCommonJS(chunk_HG7J3YR3_exports);
25
25
  var import_chunk_ONLWOUYZ = require("./chunk-ONLWOUYZ.cjs");
26
+ var import_effect = require("effect");
26
27
  var import_echo_schema = require("@dxos/echo-schema");
27
28
  var import_types = require("@dxos/plugin-space/types");
28
29
  var import_echo = require("@dxos/react-client/echo");
@@ -30,84 +31,83 @@ var import_schema = require("@dxos/schema");
30
31
  var ThreadAction;
31
32
  (function(ThreadAction2) {
32
33
  const THREAD_ACTION = `${import_chunk_ONLWOUYZ.THREAD_PLUGIN}/action`;
33
- class CreateChannel extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/create-channel`, {
34
- input: import_echo_schema.S.Struct({
35
- // TODO(wittjosiah): Should be SpaceId.
36
- spaceId: import_echo_schema.S.String,
37
- name: import_echo_schema.S.optional(import_echo_schema.S.String)
34
+ class CreateChannel extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/create-channel`, {
35
+ input: import_effect.Schema.Struct({
36
+ spaceId: import_echo_schema.SpaceIdSchema,
37
+ name: import_effect.Schema.optional(import_effect.Schema.String)
38
38
  }),
39
- output: import_echo_schema.S.Struct({
39
+ output: import_effect.Schema.Struct({
40
40
  object: import_types.ChannelType
41
41
  })
42
42
  }) {
43
43
  }
44
44
  ThreadAction2.CreateChannel = CreateChannel;
45
- class Create extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/create`, {
46
- input: import_echo_schema.S.Struct({
47
- name: import_echo_schema.S.optional(import_echo_schema.S.String),
48
- cursor: import_echo_schema.S.String,
45
+ class Create extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/create`, {
46
+ input: import_effect.Schema.Struct({
47
+ name: import_effect.Schema.optional(import_effect.Schema.String),
48
+ cursor: import_effect.Schema.String,
49
49
  subject: import_echo.EchoObjectSchema
50
50
  }),
51
- output: import_echo_schema.S.Struct({
51
+ output: import_effect.Schema.Struct({
52
52
  object: import_types.ThreadType
53
53
  })
54
54
  }) {
55
55
  }
56
56
  ThreadAction2.Create = Create;
57
- class Select extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/select`, {
58
- input: import_echo_schema.S.Struct({
59
- current: import_echo_schema.S.String
57
+ class Delete extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/delete`, {
58
+ input: import_effect.Schema.Struct({
59
+ thread: import_types.ThreadType,
60
+ subject: import_echo.EchoObjectSchema,
61
+ cursor: import_effect.Schema.optional(import_effect.Schema.String)
60
62
  }),
61
- output: import_echo_schema.S.Void
63
+ output: import_effect.Schema.Void
62
64
  }) {
63
65
  }
64
- ThreadAction2.Select = Select;
65
- class ToggleResolved extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/toggle-resolved`, {
66
- input: import_echo_schema.S.Struct({
67
- thread: import_types.ThreadType
66
+ ThreadAction2.Delete = Delete;
67
+ class Select extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/select`, {
68
+ input: import_effect.Schema.Struct({
69
+ current: import_effect.Schema.String
68
70
  }),
69
- output: import_echo_schema.S.Void
71
+ output: import_effect.Schema.Void
70
72
  }) {
71
73
  }
72
- ThreadAction2.ToggleResolved = ToggleResolved;
73
- class Delete extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/delete`, {
74
- input: import_echo_schema.S.Struct({
75
- thread: import_types.ThreadType,
76
- subject: import_echo.EchoObjectSchema,
77
- cursor: import_echo_schema.S.optional(import_echo_schema.S.String)
74
+ ThreadAction2.Select = Select;
75
+ class ToggleResolved extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/toggle-resolved`, {
76
+ input: import_effect.Schema.Struct({
77
+ thread: import_types.ThreadType
78
78
  }),
79
- output: import_echo_schema.S.Void
79
+ output: import_effect.Schema.Void
80
80
  }) {
81
81
  }
82
- ThreadAction2.Delete = Delete;
83
- class AddMessage extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/add-message`, {
84
- input: import_echo_schema.S.Struct({
82
+ ThreadAction2.ToggleResolved = ToggleResolved;
83
+ class AddMessage extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/add-message`, {
84
+ input: import_effect.Schema.Struct({
85
85
  subject: import_echo.EchoObjectSchema,
86
86
  thread: import_types.ThreadType,
87
- sender: import_schema.ActorSchema,
88
- text: import_echo_schema.S.String
87
+ sender: import_schema.DataType.Actor,
88
+ text: import_effect.Schema.String
89
89
  }),
90
- output: import_echo_schema.S.Void
90
+ output: import_effect.Schema.Void
91
91
  }) {
92
92
  }
93
93
  ThreadAction2.AddMessage = AddMessage;
94
- class DeleteMessage extends import_echo_schema.S.TaggedClass()(`${THREAD_ACTION}/delete-message`, {
95
- input: import_echo_schema.S.Struct({
94
+ class DeleteMessage extends import_effect.Schema.TaggedClass()(`${THREAD_ACTION}/delete-message`, {
95
+ input: import_effect.Schema.Struct({
96
96
  thread: import_types.ThreadType,
97
97
  subject: import_echo.EchoObjectSchema,
98
- messageId: import_echo_schema.S.String,
99
- message: import_echo_schema.S.optional(import_schema.MessageType),
100
- messageIndex: import_echo_schema.S.optional(import_echo_schema.S.Number)
98
+ messageId: import_effect.Schema.String,
99
+ message: import_effect.Schema.optional(import_schema.DataType.Message),
100
+ messageIndex: import_effect.Schema.optional(import_effect.Schema.Number)
101
101
  }),
102
- output: import_echo_schema.S.Void
102
+ output: import_effect.Schema.Void
103
103
  }) {
104
104
  }
105
105
  ThreadAction2.DeleteMessage = DeleteMessage;
106
106
  })(ThreadAction || (ThreadAction = {}));
107
- var ThreadSettingsSchema = import_echo_schema.S.mutable(import_echo_schema.S.Struct({}));
107
+ var ThreadSettingsSchema = import_effect.Schema.mutable(import_effect.Schema.Struct({}));
108
108
  // Annotate the CommonJS export names for ESM import in node:
109
109
  0 && (module.exports = {
110
110
  ThreadAction,
111
111
  ThreadSettingsSchema
112
112
  });
113
- //# sourceMappingURL=chunk-46BSFPBV.cjs.map
113
+ //# sourceMappingURL=chunk-HG7J3YR3.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { SpaceIdSchema } from '@dxos/echo-schema';\nimport { ChannelType, ThreadType } from '@dxos/plugin-space/types';\nimport { EchoObjectSchema } from '@dxos/react-client/echo';\nimport { DataType } from '@dxos/schema';\n\nimport { THREAD_PLUGIN } from './meta';\n\nexport namespace ThreadAction {\n const THREAD_ACTION = `${THREAD_PLUGIN}/action`;\n\n export class CreateChannel extends Schema.TaggedClass<CreateChannel>()(`${THREAD_ACTION}/create-channel`, {\n input: Schema.Struct({\n spaceId: SpaceIdSchema,\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: ChannelType,\n }),\n }) {}\n\n export class Create extends Schema.TaggedClass<Create>()(`${THREAD_ACTION}/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n cursor: Schema.String,\n subject: EchoObjectSchema,\n }),\n output: Schema.Struct({\n object: ThreadType,\n }),\n }) {}\n\n export class Delete extends Schema.TaggedClass<Delete>()(`${THREAD_ACTION}/delete`, {\n input: Schema.Struct({\n thread: ThreadType,\n subject: EchoObjectSchema,\n cursor: Schema.optional(Schema.String),\n }),\n output: Schema.Void,\n }) {}\n\n export class Select extends Schema.TaggedClass<Select>()(`${THREAD_ACTION}/select`, {\n input: Schema.Struct({\n current: Schema.String,\n }),\n output: Schema.Void,\n }) {}\n\n export class ToggleResolved extends Schema.TaggedClass<ToggleResolved>()(`${THREAD_ACTION}/toggle-resolved`, {\n input: Schema.Struct({\n thread: ThreadType,\n }),\n output: Schema.Void,\n }) {}\n\n export class AddMessage extends Schema.TaggedClass<AddMessage>()(`${THREAD_ACTION}/add-message`, {\n input: Schema.Struct({\n subject: EchoObjectSchema,\n thread: ThreadType,\n sender: DataType.Actor,\n text: Schema.String,\n }),\n output: Schema.Void,\n }) {}\n\n export class DeleteMessage extends Schema.TaggedClass<DeleteMessage>()(`${THREAD_ACTION}/delete-message`, {\n input: Schema.Struct({\n thread: ThreadType,\n subject: EchoObjectSchema,\n messageId: Schema.String,\n message: Schema.optional(DataType.Message),\n messageIndex: Schema.optional(Schema.Number),\n }),\n output: Schema.Void,\n }) {}\n}\n\nexport const ThreadSettingsSchema = Schema.mutable(Schema.Struct({}));\nexport type ThreadSettingsProps = Schema.Schema.Type<typeof ThreadSettingsSchema>;\n\nexport interface ThreadModel {\n root: ThreadType;\n}\n\ntype SubjectId = string;\nexport type ViewState = { showResolvedThreads: boolean };\nexport type ViewStore = Record<SubjectId, ViewState>;\n\nexport type ThreadState = {\n /** Current channel activity. */\n activities: Record<string, string | undefined>;\n /** In-memory draft threads. */\n drafts: Record<string, ThreadType[]>;\n current?: string | undefined;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,oBAAuB;AAEvB,yBAA8B;AAC9B,mBAAwC;AACxC,kBAAiC;AACjC,oBAAyB;;UAIRA,eAAAA;AACf,QAAMC,gBAAgB,GAAGC,mCAAAA;EAElB,MAAMC,sBAAsBC,qBAAOC,YAAW,EAAkB,GAAGJ,aAAAA,mBAAgC;IACxGK,OAAOF,qBAAOG,OAAO;MACnBC,SAASC;MACTC,MAAMN,qBAAOO,SAASP,qBAAOQ,MAAM;IACrC,CAAA;IACAC,QAAQT,qBAAOG,OAAO;MACpBO,QAAQC;IACV,CAAA;EACF,CAAA,EAAA;EAAI;gBARSZ,gBAAAA;EAUN,MAAMa,eAAeZ,qBAAOC,YAAW,EAAW,GAAGJ,aAAAA,WAAwB;IAClFK,OAAOF,qBAAOG,OAAO;MACnBG,MAAMN,qBAAOO,SAASP,qBAAOQ,MAAM;MACnCK,QAAQb,qBAAOQ;MACfM,SAASC;IACX,CAAA;IACAN,QAAQT,qBAAOG,OAAO;MACpBO,QAAQM;IACV,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,iBAAAA,eAAAA,CAAAA,EAAAA;AAqEV,IAAMsC,uBAAuBlC,qBAAOmC,QAAQnC,qBAAOG,OAAO,CAAC,CAAA,CAAA;",
6
+ "names": ["ThreadAction", "THREAD_ACTION", "THREAD_PLUGIN", "CreateChannel", "Schema", "TaggedClass", "input", "Struct", "spaceId", "SpaceIdSchema", "name", "optional", "String", "output", "object", "ChannelType", "Create", "cursor", "subject", "EchoObjectSchema", "ThreadType", "Delete", "thread", "Void", "Select", "current", "ToggleResolved", "AddMessage", "sender", "DataType", "Actor", "text", "DeleteMessage", "messageId", "message", "Message", "messageIndex", "Number", "ThreadSettingsSchema", "mutable"]
7
+ }
@@ -26,21 +26,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_BASYS5Q5_exports = {};
30
- __export(chunk_BASYS5Q5_exports, {
29
+ var chunk_KYLJU47G_exports = {};
30
+ __export(chunk_KYLJU47G_exports, {
31
31
  AppGraphBuilder: () => AppGraphBuilder,
32
32
  IntentResolver: () => IntentResolver,
33
33
  Markdown: () => Markdown,
34
34
  ReactSurface: () => ReactSurface,
35
35
  ThreadState: () => ThreadState
36
36
  });
37
- module.exports = __toCommonJS(chunk_BASYS5Q5_exports);
37
+ module.exports = __toCommonJS(chunk_KYLJU47G_exports);
38
38
  var import_app_framework = require("@dxos/app-framework");
39
- var AppGraphBuilder = (0, import_app_framework.lazy)(() => import("./app-graph-builder-HZNWT4QU.cjs"));
40
- var IntentResolver = (0, import_app_framework.lazy)(() => import("./intent-resolver-DC6HDNTX.cjs"));
41
- var Markdown = (0, import_app_framework.lazy)(() => import("./markdown-L2WMCQKM.cjs"));
42
- var ReactSurface = (0, import_app_framework.lazy)(() => import("./react-surface-5USFRCS3.cjs"));
43
- var ThreadSettings = (0, import_app_framework.lazy)(() => import("./settings-7MGTJ46L.cjs"));
39
+ var AppGraphBuilder = (0, import_app_framework.lazy)(() => import("./app-graph-builder-G45JDZWQ.cjs"));
40
+ var IntentResolver = (0, import_app_framework.lazy)(() => import("./intent-resolver-ECFDZLCG.cjs"));
41
+ var Markdown = (0, import_app_framework.lazy)(() => import("./markdown-G5NDD5EJ.cjs"));
42
+ var ReactSurface = (0, import_app_framework.lazy)(() => import("./react-surface-G7GXAK5G.cjs"));
43
+ var ThreadSettings = (0, import_app_framework.lazy)(() => import("./settings-PV6MGI52.cjs"));
44
44
  var ThreadState = (0, import_app_framework.lazy)(() => import("./state-FOHMAVSU.cjs"));
45
45
  // Annotate the CommonJS export names for ESM import in node:
46
46
  0 && (module.exports = {
@@ -50,4 +50,4 @@ var ThreadState = (0, import_app_framework.lazy)(() => import("./state-FOHMAVSU.
50
50
  ReactSurface,
51
51
  ThreadState
52
52
  });
53
- //# sourceMappingURL=chunk-BASYS5Q5.cjs.map
53
+ //# sourceMappingURL=chunk-KYLJU47G.cjs.map
@@ -16,12 +16,12 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_W25MBII2_exports = {};
20
- __export(chunk_W25MBII2_exports, {
19
+ var chunk_NO6WQR36_exports = {};
20
+ __export(chunk_NO6WQR36_exports, {
21
21
  useOnEditAnalytics: () => useOnEditAnalytics,
22
22
  useStatus: () => useStatus
23
23
  });
24
- module.exports = __toCommonJS(chunk_W25MBII2_exports);
24
+ module.exports = __toCommonJS(chunk_NO6WQR36_exports);
25
25
  var import_react = require("react");
26
26
  var import_react2 = require("react");
27
27
  var import_app_framework = require("@dxos/app-framework");
@@ -84,4 +84,4 @@ var useOnEditAnalytics = (message, textBlock, editing) => {
84
84
  useOnEditAnalytics,
85
85
  useStatus
86
86
  });
87
- //# sourceMappingURL=chunk-W25MBII2.cjs.map
87
+ //# sourceMappingURL=chunk-NO6WQR36.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useStatus.ts", "../../../src/hooks/analytics.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect, useState } from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\n\n// TODO(burdon): Generalize and factor out.\nexport const useStatus = (space?: Space, channel?: string) => {\n const [processing, setProcessing] = useState(false);\n useEffect(() => {\n if (!space || !channel) {\n return;\n }\n\n const unsubscribe = space.listen(`status/${channel}`, (status) => {\n const { event } = status.payload ?? {};\n setProcessing(event === 'processing');\n });\n\n const t = setInterval(() => {\n setProcessing((prev: any) => {\n if (typeof prev?.ts === 'number' && Date.now() - prev.ts > 30_000) {\n return undefined;\n } else {\n return prev;\n }\n });\n }, 1_000);\n\n return () => {\n unsubscribe();\n clearInterval(t);\n };\n }, [space, channel]);\n\n return processing;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { type Live } from '@dxos/live-object';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { useOnTransition } from '@dxos/react-ui';\nimport { type TextContentBlock } from '@dxos/schema';\n\nexport const useOnEditAnalytics = (message: Live<any>, textBlock: TextContentBlock | undefined, editing: boolean) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const onEdit = useCallback(() => {\n const space = getSpace(message);\n if (!space || !textBlock) {\n return;\n }\n\n void dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: 'threads.message.update',\n properties: {\n spaceId: space.id,\n messageId: message.id,\n messageLength: textBlock?.text.length,\n },\n }),\n );\n }, [dispatch, message, textBlock]);\n\n useOnTransition(editing, true, false, onEdit);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAoC;ACApC,IAAAA,gBAA4B;AAE5B,2BAAkD;AAElD,mBAAoC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\nimport { type Space } from '@dxos/react-client/echo';\n\n// TODO(burdon): Generalize and factor out.\nexport const useStatus = (space?: Space, channel?: string) => {\n const [processing, setProcessing] = useState(false);\n useEffect(() => {\n if (!space || !channel) {\n return;\n }\n\n const unsubscribe = space.listen(`status/${channel}`, (status) => {\n const { event } = status.payload ?? {};\n setProcessing(event === 'processing');\n });\n\n const t = setInterval(() => {\n setProcessing((prev: any) => {\n if (typeof prev?.ts === 'number' && Date.now() - prev.ts > 30_000) {\n return undefined;\n } else {\n return prev;\n }\n });\n }, 1_000);\n\n return () => {\n unsubscribe();\n clearInterval(t);\n };\n }, [space, channel]);\n\n return processing;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { type Live } from '@dxos/live-object';\nimport { ObservabilityAction } from '@dxos/plugin-observability/types';\nimport { getSpace } from '@dxos/react-client/echo';\nimport { useOnTransition } from '@dxos/react-ui';\nimport { type DataType } from '@dxos/schema';\n\nexport const useOnEditAnalytics = (\n message: Live<any>,\n textBlock: DataType.MessageBlock.Text | undefined,\n editing: boolean,\n) => {\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const onEdit = useCallback(() => {\n const space = getSpace(message);\n if (!space || !textBlock) {\n return;\n }\n\n void dispatch(\n createIntent(ObservabilityAction.SendEvent, {\n name: 'threads.message.update',\n properties: {\n spaceId: space.id,\n messageId: message.id,\n messageLength: textBlock?.text.length,\n },\n }),\n );\n }, [dispatch, message, textBlock]);\n\n useOnTransition(editing, true, false, onEdit);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAoC;ACApC,IAAAA,gBAA4B;AAE5B,2BAAkD;AAElD,mBAAoC;AACpC,kBAAyB;AACzB,sBAAgC;ADDzB,IAAMC,YAAY,CAACC,OAAeC,YAAAA;AACvC,QAAM,CAACC,YAAYC,aAAAA,QAAiBC,uBAAS,KAAA;AAC7CC,8BAAU,MAAA;AACR,QAAI,CAACL,SAAS,CAACC,SAAS;AACtB;IACF;AAEA,UAAMK,cAAcN,MAAMO,OAAO,UAAUN,OAAAA,IAAW,CAACO,WAAAA;AACrD,YAAM,EAAEC,MAAK,IAAKD,OAAOE,WAAW,CAAC;AACrCP,oBAAcM,UAAU,YAAA;IAC1B,CAAA;AAEA,UAAME,IAAIC,YAAY,MAAA;AACpBT,oBAAc,CAACU,SAAAA;AACb,YAAI,OAAOA,MAAMC,OAAO,YAAYC,KAAKC,IAAG,IAAKH,KAAKC,KAAK,KAAQ;AACjE,iBAAOG;QACT,OAAO;AACL,iBAAOJ;QACT;MACF,CAAA;IACF,GAAG,GAAA;AAEH,WAAO,MAAA;AACLP,kBAAAA;AACAY,oBAAcP,CAAAA;IAChB;EACF,GAAG;IAACX;IAAOC;GAAQ;AAEnB,SAAOC;AACT;ACzBO,IAAMiB,qBAAqB,CAChCC,SACAC,WACAC,YAAAA;AAEA,QAAM,EAAEC,iBAAiBC,SAAQ,QAAKC,0CAAAA;AAEtC,QAAMC,aAASC,2BAAY,MAAA;AACzB,UAAM3B,YAAQ4B,sBAASR,OAAAA;AACvB,QAAI,CAACpB,SAAS,CAACqB,WAAW;AACxB;IACF;AAEA,SAAKG,aACHK,mCAAaC,iCAAoBC,WAAW;MAC1CC,MAAM;MACNC,YAAY;QACVC,SAASlC,MAAMmC;QACfC,WAAWhB,QAAQe;QACnBE,eAAehB,WAAWiB,KAAKC;MACjC;IACF,CAAA,CAAA;EAEJ,GAAG;IAACf;IAAUJ;IAASC;GAAU;AAEjCmB,uCAAgBlB,SAAS,MAAM,OAAOI,MAAAA;AACxC;",
6
6
  "names": ["import_react", "useStatus", "space", "channel", "processing", "setProcessing", "useState", "useEffect", "unsubscribe", "listen", "status", "event", "payload", "t", "setInterval", "prev", "ts", "Date", "now", "undefined", "clearInterval", "useOnEditAnalytics", "message", "textBlock", "editing", "dispatchPromise", "dispatch", "useIntentDispatcher", "onEdit", "useCallback", "getSpace", "createIntent", "ObservabilityAction", "SendEvent", "name", "properties", "spaceId", "id", "messageId", "messageLength", "text", "length", "useOnTransition"]
7
7
  }
@@ -24,14 +24,14 @@ __export(node_exports, {
24
24
  ThreadEvents: () => ThreadEvents,
25
25
  ThreadPlugin: () => ThreadPlugin,
26
26
  meta: () => import_chunk_ONLWOUYZ.meta,
27
- useOnEditAnalytics: () => import_chunk_W25MBII2.useOnEditAnalytics,
28
- useStatus: () => import_chunk_W25MBII2.useStatus
27
+ useOnEditAnalytics: () => import_chunk_NO6WQR36.useOnEditAnalytics,
28
+ useStatus: () => import_chunk_NO6WQR36.useStatus
29
29
  });
30
30
  module.exports = __toCommonJS(node_exports);
31
- var import_chunk_BASYS5Q5 = require("./chunk-BASYS5Q5.cjs");
31
+ var import_chunk_KYLJU47G = require("./chunk-KYLJU47G.cjs");
32
32
  var import_chunk_NQ5DTPOY = require("./chunk-NQ5DTPOY.cjs");
33
- var import_chunk_W25MBII2 = require("./chunk-W25MBII2.cjs");
34
- var import_chunk_46BSFPBV = require("./chunk-46BSFPBV.cjs");
33
+ var import_chunk_NO6WQR36 = require("./chunk-NO6WQR36.cjs");
34
+ var import_chunk_HG7J3YR3 = require("./chunk-HG7J3YR3.cjs");
35
35
  var import_chunk_ONLWOUYZ = require("./chunk-ONLWOUYZ.cjs");
36
36
  var import_app_framework = require("@dxos/app-framework");
37
37
  var import_app_framework2 = require("@dxos/app-framework");
@@ -98,7 +98,7 @@ var ThreadPlugin = () => (0, import_app_framework2.definePlugin)(import_chunk_ON
98
98
  // Should this be a different event?
99
99
  // Should settings store be renamed to be more generic?
100
100
  activatesOn: import_app_framework2.Events.SetupSettings,
101
- activate: import_chunk_BASYS5Q5.ThreadState
101
+ activate: import_chunk_KYLJU47G.ThreadState
102
102
  }),
103
103
  (0, import_app_framework2.defineModule)({
104
104
  id: `${import_chunk_ONLWOUYZ.meta.id}/module/translations`,
@@ -126,7 +126,7 @@ var ThreadPlugin = () => (0, import_app_framework2.definePlugin)(import_chunk_ON
126
126
  }
127
127
  }),
128
128
  (0, import_app_framework2.contributes)(import_app_framework2.Capabilities.Metadata, {
129
- id: import_schema.MessageType.typename,
129
+ id: import_schema.DataType.Message.typename,
130
130
  metadata: {
131
131
  // TODO(wittjosiah): Move out of metadata.
132
132
  loadReferences: (message) => []
@@ -161,7 +161,7 @@ var ThreadPlugin = () => (0, import_app_framework2.definePlugin)(import_chunk_ON
161
161
  activatesOn: import_plugin_client.ClientEvents.SetupSchema,
162
162
  activate: () => (0, import_app_framework2.contributes)(import_plugin_space.SpaceCapabilities.ObjectForm, (0, import_types.defineObjectForm)({
163
163
  objectSchema: import_types.ChannelType,
164
- getIntent: (_, options) => (0, import_app_framework2.createIntent)(import_chunk_46BSFPBV.ThreadAction.CreateChannel, {
164
+ getIntent: (_, options) => (0, import_app_framework2.createIntent)(import_chunk_HG7J3YR3.ThreadAction.CreateChannel, {
165
165
  spaceId: options.space.id
166
166
  })
167
167
  }))
@@ -171,21 +171,21 @@ var ThreadPlugin = () => (0, import_app_framework2.definePlugin)(import_chunk_ON
171
171
  activatesOn: import_plugin_client.ClientEvents.SetupSchema,
172
172
  activate: () => (0, import_app_framework2.contributes)(import_plugin_client.ClientCapabilities.Schema, [
173
173
  import_types.ThreadType,
174
- import_schema.MessageType,
175
- import_schema.MessageTypeV1
174
+ import_schema.DataType.Message,
175
+ import_schema.DataType.MessageV1
176
176
  ])
177
177
  }),
178
178
  (0, import_app_framework2.defineModule)({
179
179
  id: `${import_chunk_ONLWOUYZ.meta.id}/module/migration`,
180
180
  activatesOn: import_plugin_client.ClientEvents.SetupMigration,
181
181
  activate: () => (0, import_app_framework2.contributes)(import_plugin_client.ClientCapabilities.Migration, [
182
- import_schema.MessageTypeV1ToV2
182
+ import_schema.DataType.MessageV1ToV2
183
183
  ])
184
184
  }),
185
185
  (0, import_app_framework2.defineModule)({
186
186
  id: `${import_chunk_ONLWOUYZ.meta.id}/module/markdown`,
187
187
  activatesOn: import_plugin_markdown.MarkdownEvents.SetupExtensions,
188
- activate: import_chunk_BASYS5Q5.Markdown
188
+ activate: import_chunk_KYLJU47G.Markdown
189
189
  }),
190
190
  (0, import_app_framework2.defineModule)({
191
191
  id: `${import_chunk_ONLWOUYZ.meta.id}/module/react-surface`,
@@ -195,17 +195,17 @@ var ThreadPlugin = () => (0, import_app_framework2.definePlugin)(import_chunk_ON
195
195
  import_plugin_space.ThreadEvents.SetupThread,
196
196
  ThreadEvents.SetupActivity
197
197
  ],
198
- activate: import_chunk_BASYS5Q5.ReactSurface
198
+ activate: import_chunk_KYLJU47G.ReactSurface
199
199
  }),
200
200
  (0, import_app_framework2.defineModule)({
201
201
  id: `${import_chunk_ONLWOUYZ.meta.id}/module/intent-resolver`,
202
202
  activatesOn: import_app_framework2.Events.SetupIntentResolver,
203
- activate: import_chunk_BASYS5Q5.IntentResolver
203
+ activate: import_chunk_KYLJU47G.IntentResolver
204
204
  }),
205
205
  (0, import_app_framework2.defineModule)({
206
206
  id: `${import_chunk_ONLWOUYZ.meta.id}/module/app-graph-builder`,
207
207
  activatesOn: import_app_framework2.Events.SetupAppGraph,
208
- activate: import_chunk_BASYS5Q5.AppGraphBuilder
208
+ activate: import_chunk_KYLJU47G.AppGraphBuilder
209
209
  })
210
210
  ]);
211
211
  // Annotate the CommonJS export names for ESM import in node: