@devicai/ui 0.57.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -0
- package/dist/cjs/api/types.js.map +1 -1
- package/dist/cjs/components/AICommandBar/AICommandBar.js +10 -7
- package/dist/cjs/components/AICommandBar/AICommandBar.js.map +1 -1
- package/dist/cjs/components/AICommandBar/useAICommandBar.js +7 -5
- package/dist/cjs/components/AICommandBar/useAICommandBar.js.map +1 -1
- package/dist/cjs/components/AIElementWrapper/AIElementWrapper.js +17 -14
- package/dist/cjs/components/AIElementWrapper/AIElementWrapper.js.map +1 -1
- package/dist/cjs/components/AIElementWrapper/useAIElementWrapper.js +7 -5
- package/dist/cjs/components/AIElementWrapper/useAIElementWrapper.js.map +1 -1
- package/dist/cjs/components/AIGenerationButton/AIGenerationButton.js +11 -6
- package/dist/cjs/components/AIGenerationButton/AIGenerationButton.js.map +1 -1
- package/dist/cjs/components/AIGenerationButton/useAIGenerationButton.js +6 -4
- package/dist/cjs/components/AIGenerationButton/useAIGenerationButton.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/ChatDrawer.js +26 -12
- package/dist/cjs/components/ChatDrawer/ChatDrawer.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/ChatInput.js +21 -15
- package/dist/cjs/components/ChatDrawer/ChatInput.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/ChatMessages.js +54 -13
- package/dist/cjs/components/ChatDrawer/ChatMessages.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/CompactionWidget.js +13 -4
- package/dist/cjs/components/ChatDrawer/CompactionWidget.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/ConversationSelector.js +6 -4
- package/dist/cjs/components/ChatDrawer/ConversationSelector.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/GuardrailNotice.js +40 -0
- package/dist/cjs/components/ChatDrawer/GuardrailNotice.js.map +1 -0
- package/dist/cjs/components/ChatDrawer/HandoffSubagentWidget.js +3 -1
- package/dist/cjs/components/ChatDrawer/HandoffSubagentWidget.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/LimitBanner.js +19 -9
- package/dist/cjs/components/ChatDrawer/LimitBanner.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/QueueNotice.js +19 -7
- package/dist/cjs/components/ChatDrawer/QueueNotice.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/RecalledMemoriesWidget.js +17 -5
- package/dist/cjs/components/ChatDrawer/RecalledMemoriesWidget.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/ReferenceChip.js +3 -1
- package/dist/cjs/components/ChatDrawer/ReferenceChip.js.map +1 -1
- package/dist/cjs/components/ChatDrawer/UsageBar.js +23 -18
- package/dist/cjs/components/ChatDrawer/UsageBar.js.map +1 -1
- package/dist/cjs/components/CoreMemoryModal/CoreMemoryModal.js +20 -9
- package/dist/cjs/components/CoreMemoryModal/CoreMemoryModal.js.map +1 -1
- package/dist/cjs/components/Feedback/FeedbackModal.js +5 -1
- package/dist/cjs/components/Feedback/FeedbackModal.js.map +1 -1
- package/dist/cjs/components/Feedback/MessageActions.js +3 -1
- package/dist/cjs/components/Feedback/MessageActions.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/ConnectFieldsForm.js +12 -8
- package/dist/cjs/components/IntegrationsModal/ConnectFieldsForm.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/IntegrationsHint.js +5 -3
- package/dist/cjs/components/IntegrationsModal/IntegrationsHint.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/IntegrationsLauncher.js +12 -3
- package/dist/cjs/components/IntegrationsModal/IntegrationsLauncher.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/IntegrationsPanel.js +34 -24
- package/dist/cjs/components/IntegrationsModal/IntegrationsPanel.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/IntegrationsToggle.js +15 -6
- package/dist/cjs/components/IntegrationsModal/IntegrationsToggle.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/McpConnectForm.js +15 -7
- package/dist/cjs/components/IntegrationsModal/McpConnectForm.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/McpServersSection.js +32 -19
- package/dist/cjs/components/IntegrationsModal/McpServersSection.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/useIntegrations.js +3 -1
- package/dist/cjs/components/IntegrationsModal/useIntegrations.js.map +1 -1
- package/dist/cjs/components/IntegrationsModal/useTenantMcp.js +3 -1
- package/dist/cjs/components/IntegrationsModal/useTenantMcp.js.map +1 -1
- package/dist/cjs/components/ThreadStateTag/ThreadStateTag.js +63 -40
- package/dist/cjs/components/ThreadStateTag/ThreadStateTag.js.map +1 -1
- package/dist/cjs/hooks/useDevicChat.js +11 -5
- package/dist/cjs/hooks/useDevicChat.js.map +1 -1
- package/dist/cjs/hooks/useSpeechRecording.js +8 -4
- package/dist/cjs/hooks/useSpeechRecording.js.map +1 -1
- package/dist/cjs/i18n/translate.js +48 -0
- package/dist/cjs/i18n/translate.js.map +1 -0
- package/dist/cjs/i18n/useTranslations.js +57 -0
- package/dist/cjs/i18n/useTranslations.js.map +1 -0
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/provider/DevicProvider.js +3 -1
- package/dist/cjs/provider/DevicProvider.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/api/types.d.ts +10 -1
- package/dist/esm/api/types.js.map +1 -1
- package/dist/esm/components/AICommandBar/AICommandBar.js +11 -8
- package/dist/esm/components/AICommandBar/AICommandBar.js.map +1 -1
- package/dist/esm/components/AICommandBar/AICommandBar.types.d.ts +10 -0
- package/dist/esm/components/AICommandBar/useAICommandBar.js +7 -5
- package/dist/esm/components/AICommandBar/useAICommandBar.js.map +1 -1
- package/dist/esm/components/AIElementWrapper/AIElementWrapper.js +17 -14
- package/dist/esm/components/AIElementWrapper/AIElementWrapper.js.map +1 -1
- package/dist/esm/components/AIElementWrapper/AIElementWrapper.types.d.ts +10 -0
- package/dist/esm/components/AIElementWrapper/useAIElementWrapper.js +7 -5
- package/dist/esm/components/AIElementWrapper/useAIElementWrapper.js.map +1 -1
- package/dist/esm/components/AIGenerationButton/AIGenerationButton.js +12 -7
- package/dist/esm/components/AIGenerationButton/AIGenerationButton.js.map +1 -1
- package/dist/esm/components/AIGenerationButton/AIGenerationButton.types.d.ts +10 -0
- package/dist/esm/components/AIGenerationButton/useAIGenerationButton.js +6 -4
- package/dist/esm/components/AIGenerationButton/useAIGenerationButton.js.map +1 -1
- package/dist/esm/components/ChatDrawer/ChatDrawer.js +27 -13
- package/dist/esm/components/ChatDrawer/ChatDrawer.js.map +1 -1
- package/dist/esm/components/ChatDrawer/ChatDrawer.types.d.ts +33 -0
- package/dist/esm/components/ChatDrawer/ChatInput.js +21 -15
- package/dist/esm/components/ChatDrawer/ChatInput.js.map +1 -1
- package/dist/esm/components/ChatDrawer/ChatMessages.d.ts +1 -1
- package/dist/esm/components/ChatDrawer/ChatMessages.js +54 -13
- package/dist/esm/components/ChatDrawer/ChatMessages.js.map +1 -1
- package/dist/esm/components/ChatDrawer/CompactionWidget.js +13 -4
- package/dist/esm/components/ChatDrawer/CompactionWidget.js.map +1 -1
- package/dist/esm/components/ChatDrawer/ConversationSelector.js +6 -4
- package/dist/esm/components/ChatDrawer/ConversationSelector.js.map +1 -1
- package/dist/esm/components/ChatDrawer/GuardrailNotice.d.ts +36 -0
- package/dist/esm/components/ChatDrawer/GuardrailNotice.js +38 -0
- package/dist/esm/components/ChatDrawer/GuardrailNotice.js.map +1 -0
- package/dist/esm/components/ChatDrawer/HandoffSubagentWidget.js +3 -1
- package/dist/esm/components/ChatDrawer/HandoffSubagentWidget.js.map +1 -1
- package/dist/esm/components/ChatDrawer/LimitBanner.js +19 -9
- package/dist/esm/components/ChatDrawer/LimitBanner.js.map +1 -1
- package/dist/esm/components/ChatDrawer/QueueNotice.js +19 -7
- package/dist/esm/components/ChatDrawer/QueueNotice.js.map +1 -1
- package/dist/esm/components/ChatDrawer/RecalledMemoriesWidget.js +17 -5
- package/dist/esm/components/ChatDrawer/RecalledMemoriesWidget.js.map +1 -1
- package/dist/esm/components/ChatDrawer/ReferenceChip.js +3 -1
- package/dist/esm/components/ChatDrawer/ReferenceChip.js.map +1 -1
- package/dist/esm/components/ChatDrawer/UsageBar.js +23 -18
- package/dist/esm/components/ChatDrawer/UsageBar.js.map +1 -1
- package/dist/esm/components/ChatDrawer/index.d.ts +2 -0
- package/dist/esm/components/CoreMemoryModal/CoreMemoryModal.js +20 -9
- package/dist/esm/components/CoreMemoryModal/CoreMemoryModal.js.map +1 -1
- package/dist/esm/components/Feedback/FeedbackModal.js +5 -1
- package/dist/esm/components/Feedback/FeedbackModal.js.map +1 -1
- package/dist/esm/components/Feedback/MessageActions.js +3 -1
- package/dist/esm/components/Feedback/MessageActions.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/ConnectFieldsForm.js +12 -8
- package/dist/esm/components/IntegrationsModal/ConnectFieldsForm.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/IntegrationsHint.js +5 -3
- package/dist/esm/components/IntegrationsModal/IntegrationsHint.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/IntegrationsLauncher.js +12 -3
- package/dist/esm/components/IntegrationsModal/IntegrationsLauncher.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/IntegrationsPanel.d.ts +1 -1
- package/dist/esm/components/IntegrationsModal/IntegrationsPanel.js +34 -24
- package/dist/esm/components/IntegrationsModal/IntegrationsPanel.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/IntegrationsToggle.d.ts +1 -1
- package/dist/esm/components/IntegrationsModal/IntegrationsToggle.js +15 -6
- package/dist/esm/components/IntegrationsModal/IntegrationsToggle.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/McpConnectForm.js +15 -7
- package/dist/esm/components/IntegrationsModal/McpConnectForm.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/McpServersSection.js +32 -19
- package/dist/esm/components/IntegrationsModal/McpServersSection.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/useIntegrations.js +3 -1
- package/dist/esm/components/IntegrationsModal/useIntegrations.js.map +1 -1
- package/dist/esm/components/IntegrationsModal/useTenantMcp.js +3 -1
- package/dist/esm/components/IntegrationsModal/useTenantMcp.js.map +1 -1
- package/dist/esm/components/ThreadStateTag/ThreadStateTag.js +63 -40
- package/dist/esm/components/ThreadStateTag/ThreadStateTag.js.map +1 -1
- package/dist/esm/hooks/useDevicChat.js +12 -6
- package/dist/esm/hooks/useDevicChat.js.map +1 -1
- package/dist/esm/hooks/useSpeechRecording.js +8 -4
- package/dist/esm/hooks/useSpeechRecording.js.map +1 -1
- package/dist/esm/i18n/index.d.ts +4 -0
- package/dist/esm/i18n/translate.d.ts +23 -0
- package/dist/esm/i18n/translate.js +43 -0
- package/dist/esm/i18n/translate.js.map +1 -0
- package/dist/esm/i18n/types.d.ts +27 -0
- package/dist/esm/i18n/useTranslations.d.ts +32 -0
- package/dist/esm/i18n/useTranslations.js +53 -0
- package/dist/esm/i18n/useTranslations.js.map +1 -0
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/provider/DevicProvider.d.ts +1 -1
- package/dist/esm/provider/DevicProvider.js +3 -1
- package/dist/esm/provider/DevicProvider.js.map +1 -1
- package/dist/esm/provider/types.d.ts +33 -0
- package/dist/esm/styles.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Replace `{name}` placeholders. A placeholder with no matching value is
|
|
5
|
+
* dropped rather than left in the text — half-substituted braces on screen
|
|
6
|
+
* read as a bug to the end user.
|
|
7
|
+
*/
|
|
8
|
+
function fillTemplate(template, vars) {
|
|
9
|
+
if (!vars)
|
|
10
|
+
return template;
|
|
11
|
+
return template.replace(/\{(\w+)\}/g, (_, name) => {
|
|
12
|
+
const value = vars[name];
|
|
13
|
+
return value === undefined || value === null ? '' : String(value);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Look one English text up in the dictionary, then fill its placeholders.
|
|
18
|
+
* An absent entry falls back to the English text itself, so a partial
|
|
19
|
+
* dictionary is perfectly usable.
|
|
20
|
+
*/
|
|
21
|
+
function translate(dictionary, text, vars) {
|
|
22
|
+
return fillTemplate(dictionary?.[text] ?? text, vars);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a translator bound to one dictionary. Stable for as long as the
|
|
26
|
+
* dictionary is, so it is safe in a dependency list.
|
|
27
|
+
*/
|
|
28
|
+
function createTranslator(dictionary) {
|
|
29
|
+
return (text, vars) => translate(dictionary, text, vars);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Merge dictionaries, later ones winning. `undefined` layers are skipped so
|
|
33
|
+
* callers can pass optional ones straight in.
|
|
34
|
+
*/
|
|
35
|
+
function mergeTranslations(...layers) {
|
|
36
|
+
const present = layers.filter(Boolean);
|
|
37
|
+
if (present.length === 0)
|
|
38
|
+
return undefined;
|
|
39
|
+
if (present.length === 1)
|
|
40
|
+
return present[0];
|
|
41
|
+
return Object.assign({}, ...present);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.createTranslator = createTranslator;
|
|
45
|
+
exports.fillTemplate = fillTemplate;
|
|
46
|
+
exports.mergeTranslations = mergeTranslations;
|
|
47
|
+
exports.translate = translate;
|
|
48
|
+
//# sourceMappingURL=translate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.js","sources":["../../../../src/i18n/translate.ts"],"sourcesContent":["import type { DevicTranslations, Translator } from './types';\n\n/**\n * Replace `{name}` placeholders. A placeholder with no matching value is\n * dropped rather than left in the text — half-substituted braces on screen\n * read as a bug to the end user.\n */\nexport function fillTemplate(\n template: string,\n vars?: Record<string, string | number>\n): string {\n if (!vars) return template;\n return template.replace(/\\{(\\w+)\\}/g, (_, name: string) => {\n const value = vars[name];\n return value === undefined || value === null ? '' : String(value);\n });\n}\n\n/**\n * Look one English text up in the dictionary, then fill its placeholders.\n * An absent entry falls back to the English text itself, so a partial\n * dictionary is perfectly usable.\n */\nexport function translate(\n dictionary: DevicTranslations | undefined,\n text: string,\n vars?: Record<string, string | number>\n): string {\n return fillTemplate(dictionary?.[text] ?? text, vars);\n}\n\n/**\n * Build a translator bound to one dictionary. Stable for as long as the\n * dictionary is, so it is safe in a dependency list.\n */\nexport function createTranslator(dictionary?: DevicTranslations): Translator {\n return (text, vars) => translate(dictionary, text, vars);\n}\n\n/**\n * Merge dictionaries, later ones winning. `undefined` layers are skipped so\n * callers can pass optional ones straight in.\n */\nexport function mergeTranslations(\n ...layers: (DevicTranslations | undefined)[]\n): DevicTranslations | undefined {\n const present = layers.filter(Boolean) as DevicTranslations[];\n if (present.length === 0) return undefined;\n if (present.length === 1) return present[0];\n return Object.assign({}, ...present) as DevicTranslations;\n}\n"],"names":[],"mappings":";;AAEA;;;;AAIG;AACG,SAAU,YAAY,CAC1B,QAAgB,EAChB,IAAsC,EAAA;AAEtC,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,QAAQ;IAC1B,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,IAAY,KAAI;AACxD,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;AACxB,QAAA,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;AACnE,IAAA,CAAC,CAAC;AACJ;AAEA;;;;AAIG;SACa,SAAS,CACvB,UAAyC,EACzC,IAAY,EACZ,IAAsC,EAAA;AAEtC,IAAA,OAAO,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC;AACvD;AAEA;;;AAGG;AACG,SAAU,gBAAgB,CAAC,UAA8B,EAAA;AAC7D,IAAA,OAAO,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC;AAC1D;AAEA;;;AAGG;AACG,SAAU,iBAAiB,CAC/B,GAAG,MAAyC,EAAA;IAE5C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAwB;AAC7D,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,SAAS;AAC1C,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,OAAO,CAAC,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,OAAO,CAAsB;AAC3D;;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var DevicContext = require('../provider/DevicContext.js');
|
|
6
|
+
var translate = require('./translate.js');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Dictionary contributed by an enclosing component, on top of the provider's.
|
|
10
|
+
*
|
|
11
|
+
* It exists so `<ChatDrawer options={{ translations }}>` reaches the input,
|
|
12
|
+
* the message list and the dialogs it opens without every one of them taking
|
|
13
|
+
* a prop for it. Nesting merges rather than replaces.
|
|
14
|
+
*/
|
|
15
|
+
const TranslationsScope = React.createContext(undefined);
|
|
16
|
+
/**
|
|
17
|
+
* Scopes a dictionary to a subtree. Rarely needed directly — the components
|
|
18
|
+
* that take a `translations` option already wrap their own subtree with it —
|
|
19
|
+
* but useful to translate one region of a page differently.
|
|
20
|
+
*/
|
|
21
|
+
function DevicTranslationsProvider({ translations, children, }) {
|
|
22
|
+
const outer = React.useContext(TranslationsScope);
|
|
23
|
+
const value = React.useMemo(() => translate.mergeTranslations(outer, translations), [outer, translations]);
|
|
24
|
+
return (jsxRuntime.jsx(TranslationsScope.Provider, { value: value, children: children }));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The dictionary in force here: the provider's, plus any scoped by an
|
|
28
|
+
* enclosing component, plus the `local` argument. Later layers win.
|
|
29
|
+
*/
|
|
30
|
+
function useTranslationsDictionary(local) {
|
|
31
|
+
const context = DevicContext.useOptionalDevicContext();
|
|
32
|
+
const scoped = React.useContext(TranslationsScope);
|
|
33
|
+
const global = context?.translations;
|
|
34
|
+
return React.useMemo(() => translate.mergeTranslations(global, scoped, local), [global, scoped, local]);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns `t`, the translator for every text this library renders itself.
|
|
38
|
+
*
|
|
39
|
+
* Works with or without a `DevicProvider`: with no dictionary anywhere it
|
|
40
|
+
* returns the English text unchanged, which is what a component mounted
|
|
41
|
+
* standalone gets.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* const t = useTranslations();
|
|
46
|
+
* <button aria-label={t('New chat')}>…</button>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
function useTranslations(local) {
|
|
50
|
+
const dictionary = useTranslationsDictionary(local);
|
|
51
|
+
return React.useMemo(() => translate.createTranslator(dictionary), [dictionary]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
exports.DevicTranslationsProvider = DevicTranslationsProvider;
|
|
55
|
+
exports.useTranslations = useTranslations;
|
|
56
|
+
exports.useTranslationsDictionary = useTranslationsDictionary;
|
|
57
|
+
//# sourceMappingURL=useTranslations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTranslations.js","sources":["../../../../src/i18n/useTranslations.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\nimport { useOptionalDevicContext } from '../provider/DevicContext';\nimport { createTranslator, mergeTranslations } from './translate';\nimport type { DevicTranslations, Translator } from './types';\n\n/**\n * Dictionary contributed by an enclosing component, on top of the provider's.\n *\n * It exists so `<ChatDrawer options={{ translations }}>` reaches the input,\n * the message list and the dialogs it opens without every one of them taking\n * a prop for it. Nesting merges rather than replaces.\n */\nconst TranslationsScope = createContext<DevicTranslations | undefined>(undefined);\n\nexport interface DevicTranslationsProviderProps {\n /** Entries added on top of the enclosing dictionaries. */\n translations?: DevicTranslations;\n children: React.ReactNode;\n}\n\n/**\n * Scopes a dictionary to a subtree. Rarely needed directly — the components\n * that take a `translations` option already wrap their own subtree with it —\n * but useful to translate one region of a page differently.\n */\nexport function DevicTranslationsProvider({\n translations,\n children,\n}: DevicTranslationsProviderProps): JSX.Element {\n const outer = useContext(TranslationsScope);\n const value = useMemo(\n () => mergeTranslations(outer, translations),\n [outer, translations]\n );\n return (\n <TranslationsScope.Provider value={value}>\n {children}\n </TranslationsScope.Provider>\n );\n}\n\n/**\n * The dictionary in force here: the provider's, plus any scoped by an\n * enclosing component, plus the `local` argument. Later layers win.\n */\nexport function useTranslationsDictionary(\n local?: DevicTranslations\n): DevicTranslations | undefined {\n const context = useOptionalDevicContext();\n const scoped = useContext(TranslationsScope);\n const global = context?.translations;\n return useMemo(\n () => mergeTranslations(global, scoped, local),\n [global, scoped, local]\n );\n}\n\n/**\n * Returns `t`, the translator for every text this library renders itself.\n *\n * Works with or without a `DevicProvider`: with no dictionary anywhere it\n * returns the English text unchanged, which is what a component mounted\n * standalone gets.\n *\n * @example\n * ```tsx\n * const t = useTranslations();\n * <button aria-label={t('New chat')}>…</button>\n * ```\n */\nexport function useTranslations(local?: DevicTranslations): Translator {\n const dictionary = useTranslationsDictionary(local);\n return useMemo(() => createTranslator(dictionary), [dictionary]);\n}\n"],"names":["createContext","useContext","useMemo","mergeTranslations","_jsx","useOptionalDevicContext","createTranslator"],"mappings":";;;;;;;AAKA;;;;;;AAMG;AACH,MAAM,iBAAiB,GAAGA,mBAAa,CAAgC,SAAS,CAAC;AAQjF;;;;AAIG;SACa,yBAAyB,CAAC,EACxC,YAAY,EACZ,QAAQ,GACuB,EAAA;AAC/B,IAAA,MAAM,KAAK,GAAGC,gBAAU,CAAC,iBAAiB,CAAC;IAC3C,MAAM,KAAK,GAAGC,aAAO,CACnB,MAAMC,2BAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,EAC5C,CAAC,KAAK,EAAE,YAAY,CAAC,CACtB;AACD,IAAA,QACEC,cAAA,CAAC,iBAAiB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,QAAA,EACrC,QAAQ,EAAA,CACkB;AAEjC;AAEA;;;AAGG;AACG,SAAU,yBAAyB,CACvC,KAAyB,EAAA;AAEzB,IAAA,MAAM,OAAO,GAAGC,oCAAuB,EAAE;AACzC,IAAA,MAAM,MAAM,GAAGJ,gBAAU,CAAC,iBAAiB,CAAC;AAC5C,IAAA,MAAM,MAAM,GAAG,OAAO,EAAE,YAAY;IACpC,OAAOC,aAAO,CACZ,MAAMC,2BAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAC9C,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CACxB;AACH;AAEA;;;;;;;;;;;;AAYG;AACG,SAAU,eAAe,CAAC,KAAyB,EAAA;AACvD,IAAA,MAAM,UAAU,GAAG,yBAAyB,CAAC,KAAK,CAAC;AACnD,IAAA,OAAOD,aAAO,CAAC,MAAMI,0BAAgB,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AAClE;;;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var DevicProvider = require('./provider/DevicProvider.js');
|
|
4
4
|
var DevicContext = require('./provider/DevicContext.js');
|
|
5
|
+
var useTranslations = require('./i18n/useTranslations.js');
|
|
6
|
+
var translate = require('./i18n/translate.js');
|
|
5
7
|
var ChatDrawer = require('./components/ChatDrawer/ChatDrawer.js');
|
|
6
8
|
var ChatMessages = require('./components/ChatDrawer/ChatMessages.js');
|
|
7
9
|
var ChatInput = require('./components/ChatDrawer/ChatInput.js');
|
|
@@ -14,6 +16,7 @@ var LimitBanner = require('./components/ChatDrawer/LimitBanner.js');
|
|
|
14
16
|
var QueueNotice = require('./components/ChatDrawer/QueueNotice.js');
|
|
15
17
|
var RecalledMemoriesWidget = require('./components/ChatDrawer/RecalledMemoriesWidget.js');
|
|
16
18
|
var CompactionWidget = require('./components/ChatDrawer/CompactionWidget.js');
|
|
19
|
+
var GuardrailNotice = require('./components/ChatDrawer/GuardrailNotice.js');
|
|
17
20
|
var CoreMemoryModal = require('./components/CoreMemoryModal/CoreMemoryModal.js');
|
|
18
21
|
var IntegrationsModal = require('./components/IntegrationsModal/IntegrationsModal.js');
|
|
19
22
|
var IntegrationsPanel = require('./components/IntegrationsModal/IntegrationsPanel.js');
|
|
@@ -54,6 +57,13 @@ exports.DevicProvider = DevicProvider.DevicProvider;
|
|
|
54
57
|
exports.DevicContext = DevicContext.DevicContext;
|
|
55
58
|
exports.useDevicContext = DevicContext.useDevicContext;
|
|
56
59
|
exports.useOptionalDevicContext = DevicContext.useOptionalDevicContext;
|
|
60
|
+
exports.DevicTranslationsProvider = useTranslations.DevicTranslationsProvider;
|
|
61
|
+
exports.useTranslations = useTranslations.useTranslations;
|
|
62
|
+
exports.useTranslationsDictionary = useTranslations.useTranslationsDictionary;
|
|
63
|
+
exports.createTranslator = translate.createTranslator;
|
|
64
|
+
exports.fillTemplate = translate.fillTemplate;
|
|
65
|
+
exports.mergeTranslations = translate.mergeTranslations;
|
|
66
|
+
exports.translate = translate.translate;
|
|
57
67
|
exports.ChatDrawer = ChatDrawer.ChatDrawer;
|
|
58
68
|
exports.ChatMessages = ChatMessages.ChatMessages;
|
|
59
69
|
exports.ChatInput = ChatInput.ChatInput;
|
|
@@ -66,6 +76,7 @@ exports.LimitBanner = LimitBanner.LimitBanner;
|
|
|
66
76
|
exports.QueueNotice = QueueNotice.QueueNotice;
|
|
67
77
|
exports.RecalledMemoriesWidget = RecalledMemoriesWidget.RecalledMemoriesWidget;
|
|
68
78
|
exports.CompactionWidget = CompactionWidget.CompactionWidget;
|
|
79
|
+
exports.GuardrailNotice = GuardrailNotice.GuardrailNotice;
|
|
69
80
|
exports.CoreMemoryModal = CoreMemoryModal.CoreMemoryModal;
|
|
70
81
|
exports.DEFAULT_CORE_MEMORY_LABELS = CoreMemoryModal.DEFAULT_CORE_MEMORY_LABELS;
|
|
71
82
|
exports.IntegrationsModal = IntegrationsModal.IntegrationsModal;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,7 +23,7 @@ const DEFAULT_BASE_URL = 'https://api.devic.ai';
|
|
|
23
23
|
* </DevicProvider>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
function DevicProvider({ apiKey, getTenantSession, onSessionExpired, baseUrl = DEFAULT_BASE_URL, tenantId, tenantMetadata, subtenantId, subtenantMetadata, tags, pollingInterval, debug, children, }) {
|
|
26
|
+
function DevicProvider({ apiKey, getTenantSession, onSessionExpired, baseUrl = DEFAULT_BASE_URL, tenantId, tenantMetadata, subtenantId, subtenantMetadata, tags, pollingInterval, translations, debug, children, }) {
|
|
27
27
|
const [references, setReferences] = React.useState([]);
|
|
28
28
|
const drawerRef = React.useRef(null);
|
|
29
29
|
const addReference = React.useCallback((ref) => {
|
|
@@ -83,6 +83,7 @@ function DevicProvider({ apiKey, getTenantSession, onSessionExpired, baseUrl = D
|
|
|
83
83
|
subtenantMetadata,
|
|
84
84
|
tags,
|
|
85
85
|
pollingInterval,
|
|
86
|
+
translations,
|
|
86
87
|
isConfigured: !!apiKey || usesSessions,
|
|
87
88
|
debug,
|
|
88
89
|
references,
|
|
@@ -104,6 +105,7 @@ function DevicProvider({ apiKey, getTenantSession, onSessionExpired, baseUrl = D
|
|
|
104
105
|
subtenantMetadata,
|
|
105
106
|
tags,
|
|
106
107
|
pollingInterval,
|
|
108
|
+
translations,
|
|
107
109
|
debug,
|
|
108
110
|
references,
|
|
109
111
|
addReference,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevicProvider.js","sources":["../../../../src/provider/DevicProvider.tsx"],"sourcesContent":["import React, { useMemo, useState, useRef, useCallback } from 'react';\nimport { DevicContext } from './DevicContext';\nimport { DevicApiClient } from '../api/client';\nimport { createSharedSession } from './sharedSession';\nimport { generateId } from '../utils';\nimport type {\n DevicProviderProps,\n DevicContextValue,\n AIReference,\n DrawerRegistration,\n} from './types';\n\nconst DEFAULT_BASE_URL = 'https://api.devic.ai';\n\n/**\n * Provider component for Devic UI configuration\n *\n * @example\n * ```tsx\n * <DevicProvider\n * apiKey=\"devic-xxx\"\n * baseUrl=\"https://api.devic.ai\"\n * tenantId=\"tenant-123\"\n * tenantMetadata={{ userId: '456' }}\n * >\n * <App />\n * </DevicProvider>\n * ```\n */\nexport function DevicProvider({\n apiKey,\n getTenantSession,\n onSessionExpired,\n baseUrl = DEFAULT_BASE_URL,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n pollingInterval,\n debug,\n children,\n}: DevicProviderProps): JSX.Element {\n const [references, setReferences] = useState<AIReference[]>([]);\n const drawerRef = useRef<DrawerRegistration | null>(null);\n\n const addReference = useCallback((ref: Omit<AIReference, 'id'>): string => {\n const id = generateId();\n setReferences((prev) => [...prev, { ...ref, id }]);\n return id;\n }, []);\n\n const removeReference = useCallback((id: string) => {\n setReferences((prev) => prev.filter((r) => r.id !== id));\n }, []);\n\n const clearReferences = useCallback(() => {\n setReferences([]);\n }, []);\n\n const registerDrawer = useCallback((handle: DrawerRegistration) => {\n drawerRef.current = handle;\n return () => {\n if (drawerRef.current === handle) {\n drawerRef.current = null;\n }\n };\n }, []);\n\n const openDrawer = useCallback(() => {\n drawerRef.current?.open();\n }, []);\n\n // Both callbacks are read through a ref and handed on as stable wrappers.\n // An inline `getTenantSession={() => …}` is a new function on every render,\n // and passing it straight through would rebuild the client — throwing away\n // the session it holds, so the page fetches a token per render — and rebuild\n // the context, so every component below it would do the same.\n const sessionSourceRef = useRef(getTenantSession);\n sessionSourceRef.current = getTenantSession;\n const expiredRef = useRef(onSessionExpired);\n expiredRef.current = onSessionExpired;\n const usesSessions = !!getTenantSession;\n\n // One session for the whole tree: every component below builds its own API\n // client, and each dedupes only its own renewals — so without this, N clients\n // ask for N tokens. See `createSharedSession`.\n const tenantSession = useMemo(\n () =>\n usesSessions\n ? createSharedSession(() => sessionSourceRef.current!())\n : undefined,\n [usesSessions]\n );\n const sessionExpired = useMemo(() => () => expiredRef.current?.(), []);\n\n const client = useMemo(\n () =>\n new DevicApiClient({\n apiKey,\n baseUrl,\n getTenantSession: tenantSession,\n onSessionExpired: sessionExpired,\n }),\n [apiKey, baseUrl, tenantSession, sessionExpired]\n );\n\n const contextValue = useMemo<DevicContextValue>(\n () => ({\n client,\n apiKey,\n getTenantSession: tenantSession,\n onSessionExpired: sessionExpired,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n pollingInterval,\n isConfigured: !!apiKey || usesSessions,\n debug,\n references,\n addReference,\n removeReference,\n clearReferences,\n registerDrawer,\n openDrawer,\n }),\n [\n client,\n apiKey,\n tenantSession,\n sessionExpired,\n usesSessions,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n pollingInterval,\n debug,\n references,\n addReference,\n removeReference,\n clearReferences,\n registerDrawer,\n openDrawer,\n ]\n );\n\n return (\n <DevicContext.Provider value={contextValue}>\n {children}\n </DevicContext.Provider>\n );\n}\n"],"names":["useState","useRef","useCallback","generateId","useMemo","createSharedSession","client","DevicApiClient","_jsx","DevicContext"],"mappings":";;;;;;;;;AAYA,MAAM,gBAAgB,GAAG,sBAAsB;AAE/C;;;;;;;;;;;;;;AAcG;AACG,SAAU,aAAa,CAAC,EAC5B,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,GAAG,gBAAgB,EAC1B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,IAAI,EACJ,eAAe,EACf,KAAK,EACL,QAAQ,GACW,EAAA;IACnB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,CAAgB,EAAE,CAAC;AAC/D,IAAA,MAAM,SAAS,GAAGC,YAAM,CAA4B,IAAI,CAAC;AAEzD,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAAC,CAAC,GAA4B,KAAY;AACxE,QAAA,MAAM,EAAE,GAAGC,gBAAU,EAAE;AACvB,QAAA,aAAa,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;AAClD,QAAA,OAAO,EAAE;IACX,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,MAAM,eAAe,GAAGD,iBAAW,CAAC,CAAC,EAAU,KAAI;QACjD,aAAa,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,MAAM,eAAe,GAAGA,iBAAW,CAAC,MAAK;QACvC,aAAa,CAAC,EAAE,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC;AAEN,IAAA,MAAM,cAAc,GAAGA,iBAAW,CAAC,CAAC,MAA0B,KAAI;AAChE,QAAA,SAAS,CAAC,OAAO,GAAG,MAAM;AAC1B,QAAA,OAAO,MAAK;AACV,YAAA,IAAI,SAAS,C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|
+
{"version":3,"file":"DevicProvider.js","sources":["../../../../src/provider/DevicProvider.tsx"],"sourcesContent":["import React, { useMemo, useState, useRef, useCallback } from 'react';\nimport { DevicContext } from './DevicContext';\nimport { DevicApiClient } from '../api/client';\nimport { createSharedSession } from './sharedSession';\nimport { generateId } from '../utils';\nimport type {\n DevicProviderProps,\n DevicContextValue,\n AIReference,\n DrawerRegistration,\n} from './types';\n\nconst DEFAULT_BASE_URL = 'https://api.devic.ai';\n\n/**\n * Provider component for Devic UI configuration\n *\n * @example\n * ```tsx\n * <DevicProvider\n * apiKey=\"devic-xxx\"\n * baseUrl=\"https://api.devic.ai\"\n * tenantId=\"tenant-123\"\n * tenantMetadata={{ userId: '456' }}\n * >\n * <App />\n * </DevicProvider>\n * ```\n */\nexport function DevicProvider({\n apiKey,\n getTenantSession,\n onSessionExpired,\n baseUrl = DEFAULT_BASE_URL,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n pollingInterval,\n translations,\n debug,\n children,\n}: DevicProviderProps): JSX.Element {\n const [references, setReferences] = useState<AIReference[]>([]);\n const drawerRef = useRef<DrawerRegistration | null>(null);\n\n const addReference = useCallback((ref: Omit<AIReference, 'id'>): string => {\n const id = generateId();\n setReferences((prev) => [...prev, { ...ref, id }]);\n return id;\n }, []);\n\n const removeReference = useCallback((id: string) => {\n setReferences((prev) => prev.filter((r) => r.id !== id));\n }, []);\n\n const clearReferences = useCallback(() => {\n setReferences([]);\n }, []);\n\n const registerDrawer = useCallback((handle: DrawerRegistration) => {\n drawerRef.current = handle;\n return () => {\n if (drawerRef.current === handle) {\n drawerRef.current = null;\n }\n };\n }, []);\n\n const openDrawer = useCallback(() => {\n drawerRef.current?.open();\n }, []);\n\n // Both callbacks are read through a ref and handed on as stable wrappers.\n // An inline `getTenantSession={() => …}` is a new function on every render,\n // and passing it straight through would rebuild the client — throwing away\n // the session it holds, so the page fetches a token per render — and rebuild\n // the context, so every component below it would do the same.\n const sessionSourceRef = useRef(getTenantSession);\n sessionSourceRef.current = getTenantSession;\n const expiredRef = useRef(onSessionExpired);\n expiredRef.current = onSessionExpired;\n const usesSessions = !!getTenantSession;\n\n // One session for the whole tree: every component below builds its own API\n // client, and each dedupes only its own renewals — so without this, N clients\n // ask for N tokens. See `createSharedSession`.\n const tenantSession = useMemo(\n () =>\n usesSessions\n ? createSharedSession(() => sessionSourceRef.current!())\n : undefined,\n [usesSessions]\n );\n const sessionExpired = useMemo(() => () => expiredRef.current?.(), []);\n\n const client = useMemo(\n () =>\n new DevicApiClient({\n apiKey,\n baseUrl,\n getTenantSession: tenantSession,\n onSessionExpired: sessionExpired,\n }),\n [apiKey, baseUrl, tenantSession, sessionExpired]\n );\n\n const contextValue = useMemo<DevicContextValue>(\n () => ({\n client,\n apiKey,\n getTenantSession: tenantSession,\n onSessionExpired: sessionExpired,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n pollingInterval,\n translations,\n isConfigured: !!apiKey || usesSessions,\n debug,\n references,\n addReference,\n removeReference,\n clearReferences,\n registerDrawer,\n openDrawer,\n }),\n [\n client,\n apiKey,\n tenantSession,\n sessionExpired,\n usesSessions,\n baseUrl,\n tenantId,\n tenantMetadata,\n subtenantId,\n subtenantMetadata,\n tags,\n pollingInterval,\n translations,\n debug,\n references,\n addReference,\n removeReference,\n clearReferences,\n registerDrawer,\n openDrawer,\n ]\n );\n\n return (\n <DevicContext.Provider value={contextValue}>\n {children}\n </DevicContext.Provider>\n );\n}\n"],"names":["useState","useRef","useCallback","generateId","useMemo","createSharedSession","client","DevicApiClient","_jsx","DevicContext"],"mappings":";;;;;;;;;AAYA,MAAM,gBAAgB,GAAG,sBAAsB;AAE/C;;;;;;;;;;;;;;AAcG;AACG,SAAU,aAAa,CAAC,EAC5B,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,GAAG,gBAAgB,EAC1B,QAAQ,EACR,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,I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