@dxos/react-ui-chat 0.8.4-main.84f28bd

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 (43) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +1 -0
  3. package/dist/lib/browser/index.mjs +480 -0
  4. package/dist/lib/browser/index.mjs.map +7 -0
  5. package/dist/lib/browser/meta.json +1 -0
  6. package/dist/lib/node-esm/index.mjs +482 -0
  7. package/dist/lib/node-esm/index.mjs.map +7 -0
  8. package/dist/lib/node-esm/meta.json +1 -0
  9. package/dist/types/src/components/ChatDialog/ChatDialog.d.ts +34 -0
  10. package/dist/types/src/components/ChatDialog/ChatDialog.d.ts.map +1 -0
  11. package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts +8 -0
  12. package/dist/types/src/components/ChatDialog/ChatDialog.stories.d.ts.map +1 -0
  13. package/dist/types/src/components/ChatDialog/index.d.ts +2 -0
  14. package/dist/types/src/components/ChatDialog/index.d.ts.map +1 -0
  15. package/dist/types/src/components/ChatEditor/ChatEditor.d.ts +21 -0
  16. package/dist/types/src/components/ChatEditor/ChatEditor.d.ts.map +1 -0
  17. package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts +10 -0
  18. package/dist/types/src/components/ChatEditor/ChatEditor.stories.d.ts.map +1 -0
  19. package/dist/types/src/components/ChatEditor/autocomplete.d.ts +25 -0
  20. package/dist/types/src/components/ChatEditor/autocomplete.d.ts.map +1 -0
  21. package/dist/types/src/components/ChatEditor/index.d.ts +3 -0
  22. package/dist/types/src/components/ChatEditor/index.d.ts.map +1 -0
  23. package/dist/types/src/components/ChatEditor/references.d.ts +30 -0
  24. package/dist/types/src/components/ChatEditor/references.d.ts.map +1 -0
  25. package/dist/types/src/components/index.d.ts +3 -0
  26. package/dist/types/src/components/index.d.ts.map +1 -0
  27. package/dist/types/src/index.d.ts +2 -0
  28. package/dist/types/src/index.d.ts.map +1 -0
  29. package/dist/types/src/translations.d.ts +40 -0
  30. package/dist/types/src/translations.d.ts.map +1 -0
  31. package/dist/types/tsconfig.tsbuildinfo +1 -0
  32. package/package.json +74 -0
  33. package/src/components/ChatDialog/ChatDialog.stories.tsx +65 -0
  34. package/src/components/ChatDialog/ChatDialog.tsx +193 -0
  35. package/src/components/ChatDialog/index.ts +5 -0
  36. package/src/components/ChatEditor/ChatEditor.stories.tsx +96 -0
  37. package/src/components/ChatEditor/ChatEditor.tsx +91 -0
  38. package/src/components/ChatEditor/autocomplete.ts +218 -0
  39. package/src/components/ChatEditor/index.ts +7 -0
  40. package/src/components/ChatEditor/references.ts +175 -0
  41. package/src/components/index.ts +6 -0
  42. package/src/index.ts +5 -0
  43. package/src/translations.ts +54 -0
@@ -0,0 +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;AACnD,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EAIxB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIzF,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C;IACE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC,GAAG,mBAAmB,GACrB,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,GACrC,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,aAAa,CAAC,CAC/D,CAAC;AAEF,eAAO,MAAM,UAAU;iBAPN,SAAS;iBACT,iBAAiB;;;8CA2DjC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import '@dxos-theme';
2
+ import { type StoryObj, type Meta } from '@storybook/react-vite';
3
+ import { ChatEditor } from './ChatEditor';
4
+ declare const meta: Meta<typeof ChatEditor>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof ChatEditor>;
7
+ export declare const Default: Story;
8
+ export declare const WithSuggestions: Story;
9
+ export declare const WithReferences: Story;
10
+ //# sourceMappingURL=ChatEditor.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/ChatEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAQjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAiBF,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ export type AutocompleteOptions = {
3
+ /**
4
+ * Callback triggered when Enter is pressed.
5
+ * @param text The current text in the editor
6
+ * @returns true if the editor should reset the document.
7
+ */
8
+ onSubmit?: (text: string) => boolean | void;
9
+ /**
10
+ * Function that returns a list of suggestions based on the current text.
11
+ * @param text The current text before the cursor
12
+ * @returns Array of suggestion strings
13
+ */
14
+ onSuggest?: (text: string) => string[];
15
+ /**
16
+ * ESC pressed.
17
+ */
18
+ onCancel?: () => void;
19
+ };
20
+ /**
21
+ * Creates an autocomplete extension that shows inline suggestions.
22
+ * Pressing Tab will complete the suggestion.
23
+ */
24
+ export declare const autocomplete: ({ onSubmit, onSuggest, onCancel }: AutocompleteOptions) => Extension;
25
+ //# sourceMappingURL=autocomplete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/autocomplete.ts"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWzD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,YAAY,GAAI,mCAAmC,mBAAmB,KAAG,SA+JrF,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './references';
2
+ export * from './ChatEditor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChatEditor/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type Extension } from '@codemirror/state';
2
+ export type ReferenceData = {
3
+ uri: string;
4
+ label: string;
5
+ };
6
+ export interface ReferencesProvider {
7
+ getReferences({ query }: {
8
+ query: string;
9
+ }): Promise<ReferenceData[]>;
10
+ resolveReference({ uri }: {
11
+ uri: string;
12
+ }): Promise<ReferenceData | null>;
13
+ }
14
+ export type ReferencesOptions = {
15
+ provider: ReferencesProvider;
16
+ /**
17
+ * @default '@'
18
+ */
19
+ triggerCharacter?: string;
20
+ /**
21
+ * Prevent the autocomplete from closing when the user blurs the editor.
22
+ * @default false
23
+ */
24
+ debug?: boolean;
25
+ };
26
+ /**
27
+ * Lookup object references.
28
+ */
29
+ export declare const references: ({ provider, triggerCharacter, debug }: ReferencesOptions) => Extension;
30
+ //# sourceMappingURL=references.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export * from './ChatDialog';
2
+ export * from './ChatEditor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,40 @@
1
+ export declare const translationKey = "react-ui-chat";
2
+ export declare const translations: [{
3
+ readonly 'en-US': {
4
+ readonly "react-ui-chat": {
5
+ readonly 'templates label': "Templates";
6
+ readonly 'open ambient chat label': "Open Assistant";
7
+ readonly 'assistant chat label': "Assistant";
8
+ readonly 'plugin name': "Assistant";
9
+ readonly 'object placeholder': "New prompt";
10
+ readonly 'create object label': "Create prompt";
11
+ readonly 'create trigger label': "Create trigger";
12
+ readonly 'create stack section label': "Create prompt";
13
+ readonly 'command placeholder': "Enter slash command...";
14
+ readonly 'template placeholder': "Enter template...";
15
+ readonly 'value placeholder': "Enter value...";
16
+ readonly 'prompt rules label': "Prompt Rules";
17
+ readonly 'typename placeholder': "Enter typename of objects which this template is for";
18
+ readonly 'description placeholder': "Enter description of when this template should be used";
19
+ readonly 'select preset template placeholder': "Select preset";
20
+ readonly 'service registry label': "Service Registry";
21
+ readonly 'sequence logs label': "Logs";
22
+ readonly 'assistant dialog title': "Assistant";
23
+ readonly 'open assistant label': "Open assistant";
24
+ readonly 'search input placeholder': "Search...";
25
+ readonly 'chat input placeholder': "Ask a question...";
26
+ readonly 'chat stop': "Cancel request.";
27
+ readonly 'button save': "Save";
28
+ readonly 'button run': "Run";
29
+ readonly 'prompt placeholder': "Ask a question...";
30
+ readonly 'microphone button': "Click to speak";
31
+ readonly 'cancel processing button': "Stop processing";
32
+ readonly 'settings default label': "Default";
33
+ readonly 'settings custom prompts label': "Use custom prompts";
34
+ readonly 'settings llm provider label': "LLM provider";
35
+ readonly 'settings edge llm model label': "Remote language model";
36
+ readonly 'settings ollama llm model label': "Ollama language model";
37
+ };
38
+ };
39
+ }];
40
+ //# sourceMappingURL=translations.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CM,CAAC"}