@dao42/d42paas-front 0.9.193 → 0.9.195

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 CHANGED
@@ -1,4 +1,170 @@
1
1
  # 更新日志
2
+ ## v0.9.195
3
+ ### 新增
4
+ + 支持动态配置是否显示Editor Tooltips配置
5
+ ```ts
6
+ daoPaasObj?.updateGlobalBaseConfig({
7
+ hideEditorToolTip: true/false,
8
+ });
9
+ ```
10
+ + 支持动态配置是否显示Editor 右键菜单配置
11
+ ```ts
12
+ daoPaasObj?.updateGlobalBaseConfig({
13
+ hideEditorContextMenu: true/false,
14
+ });
15
+ ```
16
+ + 支持配置特殊语言不支持远程LSP,但是只用CodeMirror内置LSP,默认支持是`['html', 'css', 'less', 'sass']`,业务方也可以进行配置
17
+ ```ts
18
+ const dao = new DaoPaaS({
19
+ paasDomain:
20
+ process.env.PAAS_MANAGER_API_ORIGIN + (mockSdkInitFail ? '1' : ''),
21
+ tenantId: '3',
22
+ ticket: dataRes?.ticket,
23
+ defaultLspLang: ['html', 'css', 'less', 'sass'], // 会直接覆盖默认配置
24
+ ```
25
+ + 支持Editor fileHeader 通过配置,显示Tooltips, 显示时间3S
26
+ ```ts
27
+ fileHeader[0].showTips = true; // 对应时机设置对应的showTips=true,
28
+ dao?.updateFileHeader([...fileHeader]);
29
+ ```
30
+ + 支持Editor fileHeader 通过配置,显示Tooltips配置消失时常参数`tipsDuration`
31
+ ```ts
32
+ {
33
+ icon: {
34
+ className: 'dao42__icon--layout2',
35
+ tips: {
36
+ [I18nLanguageType.ZH]: '预览Markdown',
37
+ [I18nLanguageType.EN]: 'Preview Markdown',
38
+ },
39
+ action: () => {
40
+ messageBox.success('预览Markdown');
41
+ },
42
+ },
43
+ tipsDuration: 1000 * 4, // 不配置默认为: 100ms
44
+ },
45
+ ```
46
+ ### 优化
47
+ + 优化AI标识的内容,能够复制,并且复制的内容不包括AI标识
48
+ ## v0.9.194
49
+ + 支持自定义编辑器右键菜单配置`aiCodeMenu`
50
+ > 1. 新增内置菜单行为`cut`, ` copy`, `paste`,`removeAllFlags`(删除所有AI标识),`removeFlag`(删除AI标识),`remove`(删除代码块)
51
+ > 2. 支持内置菜单行为,自定义菜单行为
52
+ > 3. 支持菜单自定义样式
53
+ > 4. `aiCodeMenu`配置是一个**二维数组**,可以针对菜单进行分组显示
54
+ ```ts
55
+ const dao = new DaoPaaS({
56
+ paasDomain:
57
+ process.env.PAAS_MANAGER_API_ORIGIN + (mockSdkInitFail ? '1' : ''),
58
+ ...,
59
+ aiCodeMenu: [
60
+ [
61
+ {
62
+ text: {
63
+ [I18nLanguageType.ZH]: '清空内容',
64
+ [I18nLanguageType.EN]: 'Cut',
65
+ },
66
+ actionName: 'remove',
67
+ shortcutClassName: '',
68
+ withCodeFlag: true,
69
+ },
70
+ {
71
+ text: {
72
+ [I18nLanguageType.ZH]: '复制代码',
73
+ [I18nLanguageType.EN]: 'Copy',
74
+ },
75
+ actionName: 'copy',
76
+ },
77
+ {
78
+ text: {
79
+ [I18nLanguageType.ZH]: '粘贴代码',
80
+ [I18nLanguageType.EN]: 'Paste',
81
+ },
82
+ actionName: 'paste',
83
+ },
84
+ {
85
+ text: {
86
+ [I18nLanguageType.ZH]: '取消标识',
87
+ [I18nLanguageType.EN]: 'Paste',
88
+ },
89
+ actionName: 'removeFlag',
90
+ },
91
+ {
92
+ text: {
93
+ [I18nLanguageType.ZH]: '取消所有标识',
94
+ [I18nLanguageType.EN]: 'Paste',
95
+ },
96
+ actionName: 'removeAllFlags',
97
+ },
98
+ ],
99
+ [
100
+ {
101
+ text: {
102
+ [I18nLanguageType.ZH]: '解释代码',
103
+ [I18nLanguageType.EN]: 'Cut(Custom)',
104
+ },
105
+ shortcutKey: 'Ctrl/Cmd+X',
106
+ actionFun: (view, commands) => {
107
+ const selections = dao?.daoEditor.getSelection();
108
+ console.log(selections);
109
+ const tr = view.state.replaceSelection('replaceCode');
110
+ view?.dispatch({
111
+ ...tr,
112
+ });
113
+ },
114
+ },
115
+ {
116
+ text: {
117
+ [I18nLanguageType.ZH]: '生成代码',
118
+ [I18nLanguageType.EN]: 'Cut(Custom)',
119
+ },
120
+ shortcutKey: 'Ctrl/Cmd+X',
121
+ actionFun: (view, commands) => {
122
+ // const tr = view.state.replaceSelection('');
123
+ // view?.dispatch({
124
+ // ...tr,
125
+ // });
126
+ },
127
+ },
128
+ {
129
+ text: {
130
+ [I18nLanguageType.ZH]: '交换代码',
131
+ [I18nLanguageType.EN]: 'Cut(Custom)',
132
+ },
133
+ shortcutKey: 'Ctrl/Cmd+X',
134
+ actionFun: (view, commands) => {
135
+ // const tr = view.state.replaceSelection('');
136
+ // view?.dispatch({
137
+ // ...tr,
138
+ // });
139
+ },
140
+ },
141
+ ],
142
+ ]
143
+ });
144
+ ```
145
+ + 新增`getAllUnConfirmAIBlock`,用于获取待确认的代码块信息
146
+ ```ts
147
+ const res = await daoPaasObj?.daoEditor.getAllUnConfirmAIBlock(
148
+ aiBlockPath,
149
+ );
150
+ messageBox.info(JSON.stringify(res));
151
+ }}
152
+ ```
153
+ + 新增`removeAllAiFlags`,用于移除指定文件的所有AI标识
154
+ ```ts
155
+ const res = await daoPaasObj?.daoEditor.removeAllAiFlags(
156
+ aiBlockPath,
157
+ );
158
+ messageBox.info(JSON.stringify(res));
159
+ }}
160
+ ```
161
+ ### 优化
162
+ + 优化`isEnableEditCode` 方法, 会返回对应代码块的`boundingClientRect` 等位置信息,方便业务方定位弹框位置
163
+ + 优化AI代码块文件,全选能够删除AI代码块标识
164
+ + 优化空白文件, AI编程,不需要确认弹框
165
+ + 优化点击AI代码菜单按钮, 选中代码区域
166
+ + 优化AI代码块高亮区域, 只有Hover/光标移至对应区域才显示
167
+
2
168
  ## v0.9.193
3
169
  ### 新增
4
170
  + 新增支持**AI**编程代码块功能(AI编程用`replayCodeByRange` 方法进行代码的操作)