@dxos/react-ui-chat 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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 (26) hide show
  1. package/dist/lib/browser/index.mjs +145 -230
  2. package/dist/lib/browser/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +145 -230
  5. package/dist/lib/node-esm/index.mjs.map +3 -3
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/ChatDialog/ChatDialog.d.ts +1 -1
  8. package/dist/types/src/components/ChatDialog/ChatDialog.d.ts.map +1 -1
  9. package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts +2 -3
  10. package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts.map +1 -1
  11. package/dist/types/src/components/ChatEditor/ChatEditor.d.ts +7 -8
  12. package/dist/types/src/components/ChatEditor/ChatEditor.d.ts.map +1 -1
  13. package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts +3 -3
  14. package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts.map +1 -1
  15. package/dist/types/src/components/ChatEditor/references.d.ts +4 -0
  16. package/dist/types/src/components/ChatEditor/references.d.ts.map +1 -1
  17. package/dist/types/src/translations.d.ts +2 -2
  18. package/dist/types/src/translations.d.ts.map +1 -1
  19. package/dist/types/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +37 -35
  21. package/src/components/ChatDialog/ChatDialog.stories.tsx +3 -4
  22. package/src/components/ChatDialog/ChatDialog.tsx +27 -17
  23. package/src/components/ChatEditor/ChatEditor.stories.tsx +17 -15
  24. package/src/components/ChatEditor/ChatEditor.tsx +31 -80
  25. package/src/components/ChatEditor/references.ts +18 -12
  26. package/src/translations.ts +1 -1
@@ -14,7 +14,7 @@ type ChatDialogContentProps = ThemedClassName<PropsWithChildren>;
14
14
  type ChatDialogFooterProps = ThemedClassName<PropsWithChildren>;
15
15
  export declare const ChatDialog: {
16
16
  Root: {
17
- ({ children, open: _open, expanded: expandedParam, onOpenChange, onExpandedChange, onEscape, }: ChatDialogRootProps): React.JSX.Element;
17
+ ({ children, open: openProp, expanded: expandedProp, onOpenChange, onExpandedChange, onEscape, }: ChatDialogRootProps): React.JSX.Element;
18
18
  displayName: string;
19
19
  };
20
20
  Header: {
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAiB,KAAK,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAE/G,OAAO,EAA4B,KAAK,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AAgCpG,KAAK,mBAAmB,GAAG,iBAAiB,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC,CAAC;AAkDH,KAAK,qBAAqB,GAAG,eAAe,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAsCH,KAAK,sBAAsB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAwCjE,KAAK,qBAAqB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAYhE,eAAO,MAAM,UAAU;;wGArIpB,mBAAmB;;;;gCA6C2B,qBAAqB;;;;mCAsCjB,sBAAsB;;;;mCAwCvB,qBAAqB;;;CAexE,CAAC"}
1
+ {"version":3,"file":"ChatDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAiB,KAAK,iBAAiB,EAA4C,MAAM,OAAO,CAAC;AAE/G,OAAO,EAA4B,KAAK,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AAkCpG,KAAK,mBAAmB,GAAG,iBAAiB,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC,CAAC;AAoDH,KAAK,qBAAqB,GAAG,eAAe,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AA0CH,KAAK,sBAAsB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AA0CjE,KAAK,qBAAqB,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAYhE,eAAO,MAAM,UAAU;;0GA7IpB,mBAAmB;;;;gCA+C2B,qBAAqB;;;;mCA0CjB,sBAAsB;;;;mCA0CvB,qBAAqB;;;CAexE,CAAC"}
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: {
6
- ({ children, open: _open, expanded: expandedParam, onOpenChange, onExpandedChange, onEscape, }: {
6
+ ({ children, open: openProp, expanded: expandedProp, onOpenChange, onExpandedChange, onEscape, }: {
7
7
  open?: boolean;
8
8
  expanded?: boolean;
9
9
  onOpenChange?: (open: boolean) => void;
@@ -25,10 +25,9 @@ declare const meta: {
25
25
  }) => React.JSX.Element;
26
26
  decorators: import("@storybook/react").Decorator[];
27
27
  parameters: {
28
- layout: string;
29
28
  translations: [{
30
29
  readonly 'en-US': {
31
- readonly "react-ui-chat": {};
30
+ readonly "@dxos/react-ui-chat": {};
32
31
  };
33
32
  }];
34
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0C8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
1
+ {"version":3,"file":"ChatDialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatDialog/ChatDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,21 +1,20 @@
1
1
  import { type Extension } from '@codemirror/state';
2
2
  import React from 'react';
3
3
  import { type ThemedClassName } from '@dxos/react-ui';
4
- import { type AutocompleteOptions, type BasicExtensionsOptions, type UseTextEditorProps } from '@dxos/react-ui-editor';
4
+ import { type EditorController, type UseTextEditorProps } from '@dxos/react-ui-editor';
5
+ import { type BasicExtensionsOptions, type SubmitOptions } from '@dxos/ui-editor';
5
6
  import { type ReferencesOptions } from './references';
6
- export interface ChatEditorController {
7
- focus(): void;
8
- getText(): string;
9
- setText(text: string): void;
7
+ export interface ChatEditorController extends EditorController {
10
8
  }
11
9
  export type ChatEditorProps = ThemedClassName<{
12
10
  extensions?: Extension;
13
11
  references?: ReferencesOptions;
14
- } & AutocompleteOptions & Pick<UseTextEditorProps, 'id' | 'autoFocus'> & Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>>;
12
+ } & (SubmitOptions & Pick<UseTextEditorProps, 'id' | 'autoFocus'> & Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>)>;
13
+ export declare const useChatExtensions: ({ extensions, lineWrapping, placeholder, onSubmit }: ChatEditorProps) => Extension[];
15
14
  export declare const ChatEditor: React.ForwardRefExoticComponent<Omit<{
16
15
  extensions?: Extension;
17
16
  references?: ReferencesOptions;
18
- } & AutocompleteOptions & Pick<UseTextEditorProps, "autoFocus" | "id"> & Pick<BasicExtensionsOptions, "lineWrapping" | "placeholder">, "className"> & {
19
- classNames?: import("@dxos/react-ui-types").ClassNameValue;
17
+ } & SubmitOptions & Pick<UseTextEditorProps, "autoFocus" | "id"> & Pick<BasicExtensionsOptions, "lineWrapping" | "placeholder">, "className"> & {
18
+ classNames?: import("@dxos/ui-types").ClassNameValue;
20
19
  } & React.RefAttributes<ChatEditorController>>;
21
20
  //# sourceMappingURL=ChatEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/ChatEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAKxB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,KAAK,iBAAiB,EAAqC,MAAM,cAAc,CAAC;AAEzF,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,IAAI,CAAC;IACd,OA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AAI,qDAA6D,eAAe,gBAY7G,CAAC;AAEF,eAAO,MAAM,UAAU;iBArBN,SAAS;iBACT,iBAAiB;;;8CA+BjC,CAAC"}
@@ -4,15 +4,15 @@ declare const meta: {
4
4
  component: import("react").ForwardRefExoticComponent<Omit<{
5
5
  extensions?: import("@codemirror/state").Extension;
6
6
  references?: import("./references").ReferencesOptions;
7
- } & import("@dxos/react-ui-editor").AutocompleteOptions & Pick<import("@dxos/react-ui-editor").UseTextEditorProps, "autoFocus" | "id"> & Pick<import("@dxos/react-ui-editor").BasicExtensionsOptions, "lineWrapping" | "placeholder">, "className"> & {
8
- classNames?: import("@dxos/react-ui-types").ClassNameValue;
7
+ } & import("@dxos/ui-editor").SubmitOptions & Pick<import("@dxos/react-ui-editor").UseTextEditorProps, "autoFocus" | "id"> & Pick<import("@dxos/ui-editor").BasicExtensionsOptions, "lineWrapping" | "placeholder">, "className"> & {
8
+ classNames?: import("@dxos/ui-types").ClassNameValue;
9
9
  } & import("react").RefAttributes<import("./ChatEditor").ChatEditorController>>;
10
10
  decorators: import("@storybook/react").Decorator[];
11
11
  parameters: {
12
12
  layout: string;
13
13
  translations: [{
14
14
  readonly 'en-US': {
15
- readonly "react-ui-chat": {};
15
+ readonly "@dxos/react-ui-chat": {};
16
16
  };
17
17
  }];
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ChatEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/ChatEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;CAQyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AAIpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAiBF,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAC"}
1
+ {"version":3,"file":"ChatEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/ChatEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUjE,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;CAQyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AAIpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAkBF,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAC"}
@@ -3,6 +3,9 @@ export type ReferenceData = {
3
3
  uri: string;
4
4
  label: string;
5
5
  };
6
+ /**
7
+ * @deprecated
8
+ */
6
9
  export interface ReferencesProvider {
7
10
  getReferences({ query }: {
8
11
  query: string;
@@ -25,6 +28,7 @@ export type ReferencesOptions = {
25
28
  };
26
29
  /**
27
30
  * Lookup object references.
31
+ * @deprecated
28
32
  */
29
33
  export declare const references: ({ provider, triggerCharacter, debug }: ReferencesOptions) => Extension;
30
34
  //# sourceMappingURL=references.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/references.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,mBAAmB,CAAC;AAe7D,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACtE,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;CAC3E;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,uCAAqD,iBAAiB,KAAG,SAyGnG,CAAC"}
1
+ {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/references.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,mBAAmB,CAAC;AAe7D,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AAEH,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACtE,gBAAgB,CAAC,EAAE,GAAG,EAAE,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;CAC3E;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,UAAU,GAAI,uCAAqD,iBAAiB,KAAG,SAyGnG,CAAC"}
@@ -1,7 +1,7 @@
1
- export declare const translationKey = "react-ui-chat";
1
+ export declare const translationKey = "@dxos/react-ui-chat";
2
2
  export declare const translations: [{
3
3
  readonly 'en-US': {
4
- readonly "react-ui-chat": {};
4
+ readonly "@dxos/react-ui-chat": {};
5
5
  };
6
6
  }];
7
7
  //# sourceMappingURL=translations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY;;;;EAMM,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,YAAY;;;;EAMM,CAAC"}