@difizen/libro-prompt-cell 0.2.35 → 0.2.36
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 +1 -1
- package/es/input-handler/chat-record-input.d.ts.map +1 -1
- package/es/input-handler/chat-record-input.js +2 -1
- package/es/prompt-cell-view.d.ts.map +1 -1
- package/es/prompt-cell-view.js +2 -1
- package/es/prompt-output-render.d.ts.map +1 -1
- package/es/prompt-output-render.js +5 -4
- package/package.json +3 -3
- package/src/input-handler/chat-record-input.tsx +2 -1
- package/src/prompt-cell-view.tsx +2 -1
- package/src/prompt-output-render.tsx +5 -4
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-record-input.d.ts","sourceRoot":"","sources":["../../src/input-handler/chat-record-input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-record-input.d.ts","sourceRoot":"","sources":["../../src/input-handler/chat-record-input.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,cAAc,CAAC;AAEtB,UAAU,oBAAoB;IAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAoFpD,CAAC"}
|
|
@@ -7,6 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { EditFilled } from '@ant-design/icons';
|
|
8
8
|
import { LibroContextKey } from '@difizen/libro-core';
|
|
9
9
|
import { useInject } from '@difizen/mana-app';
|
|
10
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
10
11
|
import { Select, Tag } from 'antd';
|
|
11
12
|
import classNames from 'classnames';
|
|
12
13
|
import { useEffect } from 'react';
|
|
@@ -63,7 +64,7 @@ export var ChatRecordInput = function ChatRecordInput(props) {
|
|
|
63
64
|
style: {
|
|
64
65
|
width: '100%'
|
|
65
66
|
},
|
|
66
|
-
placeholder:
|
|
67
|
+
placeholder: l10n.t('选择或输入聊天标识'),
|
|
67
68
|
onSelect: handleSelectChange,
|
|
68
69
|
onChange: handleSelectChange,
|
|
69
70
|
showSearch: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-cell-view.d.ts","sourceRoot":"","sources":["../src/prompt-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EAEV,SAAS,EACT,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAQL,WAAW,EAIZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-cell-view.d.ts","sourceRoot":"","sources":["../src/prompt-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EAEV,SAAS,EACT,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,q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IA8BtC,WAAW;IAQX,MAAM,IAAI,SAAS;IASnB,qBAAqB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC;IAQtD,IAAI,aAGX;IAEO,cAAc,aAGrB;IAEF,aAAa,QAAO,EAAE,CAEpB;IAEF,qBAAqB,cAAe,MAAM;;;MAKxC;IAEa,GAAG;IA4ElB,KAAK,YACM,cAAc,kBAAkB,CAAC,SAAS,CAAC,oBAClC,cAAc,aAAa,KAAK,GAAG,6CAUrD;IAEF,iBAAiB,gDAmBf;IACF,iBAAiB,gDAef;IAEF,iBAAiB,SAAU,UAAU;;;;MAMnC;IAEF,mBAAmB,aACP,cAAc,aAAa,eACxB,MAAM,KAAK,IAAI,UA6B5B;IAEF,0BAA0B,iBAAkB,MAAM,aAQhD;IACF,qBAAqB,UAAW,MAAM,UAEpC;IACF,wBAAwB,UAAW,MAAM,UAEvC;IACF,kBAAkB,UAAW,MAAM,GAAG,SAAS,UAE7C;CACH"}
|
package/es/prompt-cell-view.js
CHANGED
|
@@ -39,6 +39,7 @@ import { CellService, LibroEditableExecutableCellView } from '@difizen/libro-cor
|
|
|
39
39
|
import { KernelError, LibroJupyterModel } from '@difizen/libro-jupyter';
|
|
40
40
|
import { getOrigin, inject, prop, transient, useInject, view, ViewInstance, ViewManager, ViewOption, ViewRender, watch } from '@difizen/mana-app';
|
|
41
41
|
import { Deferred } from '@difizen/mana-app';
|
|
42
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
42
43
|
import { Select, Tag } from 'antd';
|
|
43
44
|
import classNames from 'classnames';
|
|
44
45
|
import React, { useEffect, useState } from 'react';
|
|
@@ -131,7 +132,7 @@ var CellEditorRaw = function CellEditorRaw() {
|
|
|
131
132
|
export var CellEditor = /*#__PURE__*/React.memo(CellEditorRaw);
|
|
132
133
|
var PropmtEditorViewComponent = /*#__PURE__*/React.forwardRef(function MaxPropmtEditorViewComponent(props, ref) {
|
|
133
134
|
var instance = useInject(ViewInstance);
|
|
134
|
-
var _useState = useState('暂无内置模型'),
|
|
135
|
+
var _useState = useState(l10n.t('暂无内置模型')),
|
|
135
136
|
_useState2 = _slicedToArray(_useState, 2),
|
|
136
137
|
selectedModel = _useState2[0],
|
|
137
138
|
setSelectedModel = _useState2[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-output-render.d.ts","sourceRoot":"","sources":["../src/prompt-output-render.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-output-render.d.ts","sourceRoot":"","sources":["../src/prompt-output-render.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,OAAO,KAAmB,MAAM,OAAO,CAAC;AAcxC,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC;IACxC,KAAK,EAAE,cAAc,CAAC;CACvB,CAgGA,CAAC"}
|
|
@@ -12,6 +12,7 @@ import { copy2clipboard } from '@difizen/libro-common';
|
|
|
12
12
|
import { concatMultilineString } from '@difizen/libro-common';
|
|
13
13
|
import { NotebookCommands } from '@difizen/libro-jupyter';
|
|
14
14
|
import { CommandRegistry, useInject } from '@difizen/mana-app';
|
|
15
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
15
16
|
import React, { useState } from 'react';
|
|
16
17
|
import { v4 } from 'uuid';
|
|
17
18
|
import { LibroLLMRenderMemo } from "./libro-llm-render.js";
|
|
@@ -174,20 +175,20 @@ export var PromptOutputRender = function PromptOutputRender(props) {
|
|
|
174
175
|
children: [/*#__PURE__*/_jsx("span", {
|
|
175
176
|
onClick: insertAndRun,
|
|
176
177
|
className: "libro-prompt-output-btn",
|
|
177
|
-
children:
|
|
178
|
+
children: l10n.t('插入并运行')
|
|
178
179
|
}), /*#__PURE__*/_jsx("span", {
|
|
179
180
|
onClick: insert,
|
|
180
181
|
className: "libro-prompt-output-btn",
|
|
181
|
-
children:
|
|
182
|
+
children: l10n.t('插入代码')
|
|
182
183
|
}), /*#__PURE__*/_jsx("span", {
|
|
183
184
|
onClick: copy,
|
|
184
185
|
className: "libro-prompt-output-btn",
|
|
185
|
-
children:
|
|
186
|
+
children: l10n.t('复制代码')
|
|
186
187
|
})]
|
|
187
188
|
}), selection && /*#__PURE__*/_jsx("span", {
|
|
188
189
|
onClick: copySelection,
|
|
189
190
|
className: "libro-prompt-output-btn",
|
|
190
|
-
children:
|
|
191
|
+
children: l10n.t('复制选中内容')
|
|
191
192
|
})]
|
|
192
193
|
});
|
|
193
194
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-prompt-cell",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@difizen/libro-code-editor": "^0.2.35",
|
|
36
|
-
"@difizen/libro-jupyter": "^0.2.
|
|
36
|
+
"@difizen/libro-jupyter": "^0.2.36",
|
|
37
37
|
"@difizen/libro-rendermime": "^0.2.35",
|
|
38
38
|
"@difizen/libro-common": "^0.2.35",
|
|
39
|
-
"@difizen/libro-core": "^0.2.
|
|
39
|
+
"@difizen/libro-core": "^0.2.36",
|
|
40
40
|
"@ant-design/icons": "^5.1.0",
|
|
41
41
|
"@difizen/mana-l10n": "latest",
|
|
42
42
|
"@difizen/mana-app": "latest",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EditFilled } from '@ant-design/icons';
|
|
2
2
|
import { LibroContextKey } from '@difizen/libro-core';
|
|
3
3
|
import { useInject } from '@difizen/mana-app';
|
|
4
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
4
5
|
import { Select, Tag } from 'antd';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
7
|
import type { BaseSelectRef } from 'rc-select';
|
|
@@ -62,7 +63,7 @@ export const ChatRecordInput: FC<ChatRecordInputProps> = (
|
|
|
62
63
|
size="small"
|
|
63
64
|
mode="tags"
|
|
64
65
|
style={{ width: '100%' }}
|
|
65
|
-
placeholder=
|
|
66
|
+
placeholder={l10n.t('选择或输入聊天标识')}
|
|
66
67
|
onSelect={handleSelectChange}
|
|
67
68
|
onChange={handleSelectChange}
|
|
68
69
|
showSearch={false}
|
package/src/prompt-cell-view.tsx
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
watch,
|
|
25
25
|
} from '@difizen/mana-app';
|
|
26
26
|
import { Deferred } from '@difizen/mana-app';
|
|
27
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
27
28
|
import { Select, Tag } from 'antd';
|
|
28
29
|
import classNames from 'classnames';
|
|
29
30
|
import React, { useEffect, useState } from 'react';
|
|
@@ -127,7 +128,7 @@ export const CellEditor = React.memo(CellEditorRaw);
|
|
|
127
128
|
const PropmtEditorViewComponent = React.forwardRef<HTMLDivElement>(
|
|
128
129
|
function MaxPropmtEditorViewComponent(props, ref) {
|
|
129
130
|
const instance = useInject<LibroPromptCellView>(ViewInstance);
|
|
130
|
-
const [selectedModel, setSelectedModel] = useState<string>('暂无内置模型');
|
|
131
|
+
const [selectedModel, setSelectedModel] = useState<string>(l10n.t('暂无内置模型'));
|
|
131
132
|
useEffect(() => {
|
|
132
133
|
// TODO: Data initialization should not depend on view initialization, which causes limitations in usage scenarios and multiple renderings.
|
|
133
134
|
instance.model.variableName = instance.model.decodeObject.variableName;
|
|
@@ -8,6 +8,7 @@ import { concatMultilineString } from '@difizen/libro-common';
|
|
|
8
8
|
import type { BaseOutputView } from '@difizen/libro-jupyter';
|
|
9
9
|
import { NotebookCommands } from '@difizen/libro-jupyter';
|
|
10
10
|
import { CommandRegistry, useInject } from '@difizen/mana-app';
|
|
11
|
+
import { l10n } from '@difizen/mana-l10n';
|
|
11
12
|
import React, { useState } from 'react';
|
|
12
13
|
import { v4 } from 'uuid';
|
|
13
14
|
|
|
@@ -103,19 +104,19 @@ export const PromptOutputRender: React.FC<{
|
|
|
103
104
|
{sourceArr.length > 0 && (
|
|
104
105
|
<>
|
|
105
106
|
<span onClick={insertAndRun} className="libro-prompt-output-btn">
|
|
106
|
-
插入并运行
|
|
107
|
+
{l10n.t('插入并运行')}
|
|
107
108
|
</span>
|
|
108
109
|
<span onClick={insert} className="libro-prompt-output-btn">
|
|
109
|
-
插入代码
|
|
110
|
+
{l10n.t('插入代码')}
|
|
110
111
|
</span>
|
|
111
112
|
<span onClick={copy} className="libro-prompt-output-btn">
|
|
112
|
-
复制代码
|
|
113
|
+
{l10n.t('复制代码')}
|
|
113
114
|
</span>
|
|
114
115
|
</>
|
|
115
116
|
)}
|
|
116
117
|
{selection && (
|
|
117
118
|
<span onClick={copySelection} className="libro-prompt-output-btn">
|
|
118
|
-
复制选中内容
|
|
119
|
+
{l10n.t('复制选中内容')}
|
|
119
120
|
</span>
|
|
120
121
|
)}
|
|
121
122
|
</div>
|