@fses/workbench-app 0.2.15 → 0.2.17
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/WORKBENCH-CLOSURE.json +18 -12
- package/dist/Workspace-r8ayksVF.js +23176 -0
- package/dist/canvas/api/index.js +1 -1
- package/dist/{canvasFacade-B2EHgdqA.js → canvasFacade-B8jYm_aO.js} +748 -748
- package/dist/cardFactory-DmEBcCf4.js +1460 -0
- package/dist/extensions/index.js +1 -1
- package/dist/fses-workbench-app.js +5 -5
- package/dist/{index-C0L5xASu.js → index-DEOR_GPc.js} +350 -346
- package/dist/internal/personal-workbench/fde-skill-cards/runtime/fdeSkillProtocolChartDisplayData.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/assistantPersonaProfiles.d.ts +6 -6
- package/dist/internal/personal-workbench/lib/cardStyleConfig.d.ts +26 -26
- package/dist/internal/personal-workbench/lib/echartsOptionEditorBridge.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/historyCardBindingRestore.fixture.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/workbenchCanvasBusinessGapChecklist.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchCardRecommendationFallback.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchCardRecommendationReturnItemUpsert.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/workbenchDataBindingBadge.d.ts +0 -5
- package/dist/internal/personal-workbench/lib/workbenchImageComposeEntry.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchLayout.d.ts +0 -5
- package/dist/runtime/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useWorkbenchRuntime-DLf_FgC7.js → useWorkbenchRuntime-DDD22mdF.js} +7817 -7813
- package/dist/version.d.ts +1 -1
- package/dist/{workbenchCustomComponentRegistry-Bt94Lgko.js → workbenchCustomComponentRegistry-CWUPjCnJ.js} +74 -74
- package/node_modules/@byteluck-fe/locale-message/README.md +2 -0
- package/node_modules/@byteluck-fe/locale-message/dist/index.d.ts +37 -0
- package/node_modules/@byteluck-fe/locale-message/dist/locale-message.js +55 -0
- package/node_modules/@byteluck-fe/locale-message/package.json +37 -0
- package/node_modules/@fses/ai-chat/dist/components/ContextUsageRing.vue.d.ts +5 -0
- package/node_modules/@fses/ai-chat/dist/components/FsesAiChat.vue.d.ts +5 -0
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +6225 -6075
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +17 -19
- package/node_modules/@fses/ai-chat/dist/style.css +1 -1
- package/node_modules/@fses/ai-chat/dist/utils/attachment-upload.d.ts +0 -5
- package/node_modules/@fses/ai-chat/package.json +4 -3
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +10144 -9914
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +1517 -1503
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
- package/node_modules/@fses/workbench-card/dist/renderers/chart/chartRendererRegistry.d.ts +97 -97
- package/node_modules/@fses/workbench-card/dist/renderers/style.css +1 -1
- package/node_modules/@fses/workbench-card/package.json +4 -1
- package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +99 -98
- package/node_modules/@fses/workbench-card/src/registry/compositeCardPatterns.ts +31 -30
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateCategories.ts +24 -23
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +765 -764
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +765 -764
- package/node_modules/@fses/workbench-card/src/renderers/WorkbenchBlockRenderer.vue +143 -129
- package/node_modules/@fses/workbench-card/src/renderers/chart/ChartRegistry.vue +4 -3
- package/node_modules/@fses/workbench-card/src/renderers/chart/EChartsProtocolRenderer.vue +2 -1
- package/node_modules/@fses/workbench-card/src/renderers/chart/chartRendererRegistry.ts +99 -98
- package/node_modules/@fses/workbench-card/src/renderers/chart/useEchart.ts +30 -29
- package/node_modules/@fses/workbench-card/src/renderers/native/nativeBindings.ts +11 -10
- package/node_modules/@fses/workbench-card/src/renderers/nested/nestedBlockBindings.ts +102 -101
- package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceCompositeBindings.ts +364 -363
- package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceRiskAndStrategyBindings.ts +90 -89
- package/node_modules/@fses/workbench-card/src/renderers/useWorkbenchBlockRendererBindings.ts +33 -32
- package/package.json +4 -3
- package/dist/Workspace-_r17G1XR.js +0 -22895
- package/dist/cardFactory-BK3CA-Gn.js +0 -1443
package/dist/version.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author seadon
|
|
5
5
|
* @created 2026-08-17
|
|
6
6
|
*/
|
|
7
|
-
export declare const WORKBENCH_APP_VERSION = "0.2.
|
|
7
|
+
export declare const WORKBENCH_APP_VERSION = "0.2.17";
|
|
8
8
|
export declare const WORKBENCH_APP_VERSION_META_NAME = "workbench-app-version";
|
|
9
9
|
/**
|
|
10
10
|
* 将当前包版本写入页面 head 的 meta 标签。
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { c as x, a as z } from "./cardFactory-
|
|
2
|
-
import { defineComponent as V, computed as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
1
|
+
import { c as x, a as z, d as E } from "./cardFactory-DmEBcCf4.js";
|
|
2
|
+
import { defineComponent as V, computed as R, ref as C, watch as j, onBeforeUnmount as I, openBlock as h, createElementBlock as y, createElementVNode as o, toDisplayString as u, createCommentVNode as T, normalizeClass as U } from "vue";
|
|
3
|
+
const D = "/workbench-card-previews/custom-cards";
|
|
4
|
+
function N(r) {
|
|
5
5
|
return `${r.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "system_card"}.png`;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function he(r) {
|
|
8
8
|
const t = x(
|
|
9
9
|
{
|
|
10
10
|
capabilityId: r,
|
|
11
11
|
meta: {
|
|
12
|
-
id: `system-card-preview-${
|
|
12
|
+
id: `system-card-preview-${N(r).replace(/\.png$/u, "")}`,
|
|
13
13
|
systemCardPreview: !0
|
|
14
14
|
}
|
|
15
15
|
},
|
|
@@ -24,12 +24,12 @@ function ve(r) {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
async function
|
|
27
|
+
async function ye(r) {
|
|
28
28
|
const t = await z(
|
|
29
29
|
{
|
|
30
30
|
capabilityId: r,
|
|
31
31
|
meta: {
|
|
32
|
-
id: `system-card-preview-${
|
|
32
|
+
id: `system-card-preview-${N(r).replace(/\.png$/u, "")}`,
|
|
33
33
|
systemCardPreview: !0
|
|
34
34
|
}
|
|
35
35
|
},
|
|
@@ -44,17 +44,17 @@ async function he(r) {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function G(r) {
|
|
48
48
|
const t = r.trim().replace(/^\/+/, "");
|
|
49
|
-
return `${
|
|
49
|
+
return `${D}/${t}`;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const Y = G("template_weather_card.png"), q = "@byteluck-fe/workbench-template.WeatherCard", J = "card.fde.templateWeather", we = [
|
|
52
52
|
{
|
|
53
|
-
capabilityId:
|
|
53
|
+
capabilityId: J,
|
|
54
54
|
category: "card.fde_custom_cards",
|
|
55
55
|
type: "templateWeather",
|
|
56
|
-
title: "
|
|
57
|
-
description: "
|
|
56
|
+
title: E("FWA.60571787571486716"),
|
|
57
|
+
description: E("FWA.1b9f1787570205830"),
|
|
58
58
|
blockType: "display",
|
|
59
59
|
subType: "fdeCustom",
|
|
60
60
|
rendererKey: "fdeCustomComponent",
|
|
@@ -65,65 +65,65 @@ const G = D("template_weather_card.png"), Y = "@byteluck-fe/workbench-template.W
|
|
|
65
65
|
handlerClassName: "WorkbenchTemplateWeatherComponentAbility",
|
|
66
66
|
status: "implemented",
|
|
67
67
|
sourceLabel: "npm",
|
|
68
|
-
componentRef:
|
|
68
|
+
componentRef: q,
|
|
69
69
|
packageName: "@byteluck-fe/workbench-template",
|
|
70
70
|
packageVersion: "0.1.1",
|
|
71
71
|
exportName: "WeatherCard",
|
|
72
|
-
previewUrl:
|
|
73
|
-
defaultProps: { city: "
|
|
72
|
+
previewUrl: Y,
|
|
73
|
+
defaultProps: { city: E("FWA.c4601787571649315") },
|
|
74
74
|
insertionMode: "registered"
|
|
75
75
|
}
|
|
76
|
-
],
|
|
76
|
+
], Q = ["aria-busy"], X = { class: "weather-card__header" }, Z = { class: "weather-card__heading" }, ee = { class: "weather-card__city" }, te = {
|
|
77
77
|
key: 0,
|
|
78
78
|
class: "weather-card__region"
|
|
79
|
-
},
|
|
79
|
+
}, re = {
|
|
80
80
|
key: 0,
|
|
81
81
|
class: "weather-card__state"
|
|
82
|
-
},
|
|
82
|
+
}, ae = {
|
|
83
83
|
key: 2,
|
|
84
84
|
class: "weather-card__body"
|
|
85
|
-
},
|
|
85
|
+
}, ne = { class: "weather-card__temperature" }, le = { class: "weather-card__summary" }, se = { class: "weather-card__metrics" }, oe = { class: "weather-card__metric" }, ie = { class: "weather-card__metric" }, ce = { class: "weather-card__updated" }, ue = /* @__PURE__ */ V({
|
|
86
86
|
__name: "WeatherCard",
|
|
87
87
|
props: {
|
|
88
88
|
city: {}
|
|
89
89
|
},
|
|
90
90
|
setup(r) {
|
|
91
|
-
const t = r, w =
|
|
91
|
+
const t = r, w = R(() => t.city.trim()), f = R(() => {
|
|
92
92
|
var e;
|
|
93
93
|
return ((e = l.value) == null ? void 0 : e.city) ?? (w.value || "未选择城市");
|
|
94
|
-
}), m = C(!1), p = C(""),
|
|
94
|
+
}), m = C(!1), p = C(""), k = C("empty"), l = C(null);
|
|
95
95
|
let d = null, g = 0;
|
|
96
|
-
|
|
96
|
+
j(
|
|
97
97
|
w,
|
|
98
98
|
(e) => {
|
|
99
|
-
|
|
99
|
+
S(e);
|
|
100
100
|
},
|
|
101
101
|
{ immediate: !0 }
|
|
102
|
-
),
|
|
102
|
+
), I(() => {
|
|
103
103
|
d == null || d.abort();
|
|
104
104
|
});
|
|
105
|
-
async function
|
|
105
|
+
async function S(e) {
|
|
106
106
|
const a = ++g;
|
|
107
107
|
if (d == null || d.abort(), d = null, l.value = null, p.value = "", !e) {
|
|
108
|
-
m.value = !1,
|
|
108
|
+
m.value = !1, k.value = "empty", p.value = "请输入城市名称";
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
111
|
const n = new AbortController();
|
|
112
112
|
d = n, m.value = !0;
|
|
113
113
|
try {
|
|
114
|
-
const s = await
|
|
114
|
+
const s = await B(e, n.signal), i = await O(s, n.signal);
|
|
115
115
|
if (a !== g)
|
|
116
116
|
return;
|
|
117
|
-
l.value =
|
|
117
|
+
l.value = $(s, i);
|
|
118
118
|
} catch (s) {
|
|
119
119
|
if (n.signal.aborted || a !== g)
|
|
120
120
|
return;
|
|
121
|
-
|
|
121
|
+
k.value = "error", p.value = s instanceof Error ? s.message : "天气数据请求失败";
|
|
122
122
|
} finally {
|
|
123
123
|
a === g && (m.value = !1, d === n && (d = null));
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
async function
|
|
126
|
+
async function B(e, a) {
|
|
127
127
|
var n;
|
|
128
128
|
const s = new URL("https://geocoding-api.open-meteo.com/v1/search");
|
|
129
129
|
s.searchParams.set("name", e), s.searchParams.set("count", "1"), s.searchParams.set("language", "zh"), s.searchParams.set("format", "json");
|
|
@@ -135,7 +135,7 @@ const G = D("template_weather_card.png"), Y = "@byteluck-fe/workbench-template.W
|
|
|
135
135
|
throw new Error(`未找到城市:${e}`);
|
|
136
136
|
return v;
|
|
137
137
|
}
|
|
138
|
-
async function
|
|
138
|
+
async function O(e, a) {
|
|
139
139
|
const n = new URL("https://api.open-meteo.com/v1/forecast");
|
|
140
140
|
n.searchParams.set("latitude", String(e.latitude)), n.searchParams.set("longitude", String(e.longitude)), n.searchParams.set(
|
|
141
141
|
"current",
|
|
@@ -149,13 +149,13 @@ const G = D("template_weather_card.png"), Y = "@byteluck-fe/workbench-template.W
|
|
|
149
149
|
throw new Error("天气数据暂不可用");
|
|
150
150
|
return i;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
var n, s, i, v,
|
|
154
|
-
const c = a.current, b = a.daily,
|
|
152
|
+
function $(e, a) {
|
|
153
|
+
var n, s, i, v, P, A;
|
|
154
|
+
const c = a.current, b = a.daily, F = [e.admin2, e.admin1, e.country].filter((W, H, M) => !!W && M.indexOf(W) === H).join(" / ");
|
|
155
155
|
return {
|
|
156
156
|
city: e.name,
|
|
157
|
-
region:
|
|
158
|
-
condition:
|
|
157
|
+
region: F,
|
|
158
|
+
condition: K(c == null ? void 0 : c.weather_code),
|
|
159
159
|
temperature: c == null ? void 0 : c.temperature_2m,
|
|
160
160
|
temperatureUnit: ((n = a.current_units) == null ? void 0 : n.temperature_2m) ?? "°C",
|
|
161
161
|
humidity: c == null ? void 0 : c.relative_humidity_2m,
|
|
@@ -163,15 +163,15 @@ const G = D("template_weather_card.png"), Y = "@byteluck-fe/workbench-template.W
|
|
|
163
163
|
windSpeed: c == null ? void 0 : c.wind_speed_10m,
|
|
164
164
|
windSpeedUnit: ((i = a.current_units) == null ? void 0 : i.wind_speed_10m) ?? "km/h",
|
|
165
165
|
high: (v = b == null ? void 0 : b.temperature_2m_max) == null ? void 0 : v[0],
|
|
166
|
-
low: (
|
|
167
|
-
rangeUnit: ((
|
|
168
|
-
updatedAt:
|
|
166
|
+
low: (P = b == null ? void 0 : b.temperature_2m_min) == null ? void 0 : P[0],
|
|
167
|
+
rangeUnit: ((A = a.daily_units) == null ? void 0 : A.temperature_2m_max) ?? "°C",
|
|
168
|
+
updatedAt: L(c == null ? void 0 : c.time)
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function K(e) {
|
|
172
172
|
return e === 0 ? { label: "晴", tone: "clear" } : e === 1 || e === 2 ? { label: "多云", tone: "cloudy" } : e === 3 ? { label: "阴", tone: "cloudy" } : e === 45 || e === 48 ? { label: "雾", tone: "fog" } : [51, 53, 55, 56, 57, 61, 63, 65, 66, 67, 80, 81, 82].includes(e ?? -1) ? { label: "降雨", tone: "rain" } : [71, 73, 75, 77, 85, 86].includes(e ?? -1) ? { label: "降雪", tone: "snow" } : [95, 96, 99].includes(e ?? -1) ? { label: "雷阵雨", tone: "storm" } : { label: "未知", tone: "neutral" };
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function L(e) {
|
|
175
175
|
return e ? e.replace("T", " ") : "未知";
|
|
176
176
|
}
|
|
177
177
|
function _(e, a) {
|
|
@@ -183,49 +183,49 @@ const G = D("template_weather_card.png"), Y = "@byteluck-fe/workbench-template.W
|
|
|
183
183
|
class: "weather-card",
|
|
184
184
|
"aria-busy": m.value
|
|
185
185
|
}, [
|
|
186
|
-
o("div",
|
|
187
|
-
o("div",
|
|
186
|
+
o("div", X, [
|
|
187
|
+
o("div", Z, [
|
|
188
188
|
a[0] || (a[0] = o("div", { class: "weather-card__label" }, "实时天气", -1)),
|
|
189
|
-
o("h2",
|
|
190
|
-
(n = l.value) != null && n.region ? (h(), y("p",
|
|
189
|
+
o("h2", ee, u(f.value), 1),
|
|
190
|
+
(n = l.value) != null && n.region ? (h(), y("p", te, u(l.value.region), 1)) : T("", !0)
|
|
191
191
|
]),
|
|
192
192
|
o("div", {
|
|
193
|
-
class:
|
|
193
|
+
class: U(["weather-card__badge", l.value ? `weather-card__badge--${l.value.condition.tone}` : void 0])
|
|
194
194
|
}, u(((s = l.value) == null ? void 0 : s.condition.label) ?? "待更新"), 3)
|
|
195
195
|
]),
|
|
196
|
-
m.value ? (h(), y("div",
|
|
196
|
+
m.value ? (h(), y("div", re, "正在获取天气...")) : p.value ? (h(), y("div", {
|
|
197
197
|
key: 1,
|
|
198
|
-
class:
|
|
199
|
-
}, u(p.value), 3)) : l.value ? (h(), y("div",
|
|
200
|
-
o("div",
|
|
201
|
-
o("div",
|
|
198
|
+
class: U(["weather-card__state", { "weather-card__state--error": k.value === "error" }])
|
|
199
|
+
}, u(p.value), 3)) : l.value ? (h(), y("div", ae, [
|
|
200
|
+
o("div", ne, u(_(l.value.temperature, l.value.temperatureUnit)), 1),
|
|
201
|
+
o("div", le, [
|
|
202
202
|
o("span", null, "最高 " + u(_(l.value.high, l.value.rangeUnit)), 1),
|
|
203
203
|
o("span", null, "最低 " + u(_(l.value.low, l.value.rangeUnit)), 1)
|
|
204
204
|
]),
|
|
205
|
-
o("div",
|
|
206
|
-
o("div",
|
|
205
|
+
o("div", se, [
|
|
206
|
+
o("div", oe, [
|
|
207
207
|
a[1] || (a[1] = o("span", { class: "weather-card__metric-label" }, "湿度", -1)),
|
|
208
208
|
o("strong", null, u(_(l.value.humidity, l.value.humidityUnit)), 1)
|
|
209
209
|
]),
|
|
210
|
-
o("div",
|
|
210
|
+
o("div", ie, [
|
|
211
211
|
a[2] || (a[2] = o("span", { class: "weather-card__metric-label" }, "风速", -1)),
|
|
212
212
|
o("strong", null, u(_(l.value.windSpeed, l.value.windSpeedUnit)), 1)
|
|
213
213
|
])
|
|
214
214
|
]),
|
|
215
|
-
o("p",
|
|
216
|
-
])) :
|
|
217
|
-
], 8,
|
|
215
|
+
o("p", ce, "更新时间 " + u(l.value.updatedAt), 1)
|
|
216
|
+
])) : T("", !0)
|
|
217
|
+
], 8, Q);
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
}),
|
|
220
|
+
}), de = [
|
|
221
221
|
{
|
|
222
222
|
packageName: "@byteluck-fe/workbench-template",
|
|
223
223
|
version: "0.1.1",
|
|
224
224
|
componentRef: "@byteluck-fe/workbench-template.WeatherCard",
|
|
225
|
-
componentName: "
|
|
225
|
+
componentName: E("FWA.3d751787571486718"),
|
|
226
226
|
exportName: "WeatherCard",
|
|
227
227
|
enabled: !0,
|
|
228
|
-
component:
|
|
228
|
+
component: ue,
|
|
229
229
|
validateProps: (r) => typeof r.city == "string" && r.city.trim().length > 0
|
|
230
230
|
}
|
|
231
231
|
// 示例:
|
|
@@ -239,29 +239,29 @@ const G = D("template_weather_card.png"), Y = "@byteluck-fe/workbench-template.W
|
|
|
239
239
|
// component: SalesSummaryCard,
|
|
240
240
|
// validateProps: (props) => typeof props.amount === 'number' && typeof props.trend === 'number',
|
|
241
241
|
// },
|
|
242
|
-
],
|
|
243
|
-
function
|
|
242
|
+
], me = new Map(de.map((r) => [r.componentRef, r]));
|
|
243
|
+
function pe(r, t, w) {
|
|
244
244
|
var f;
|
|
245
245
|
return ((f = r.validateProps) == null ? void 0 : f.call(r, t, w)) ?? !0;
|
|
246
246
|
}
|
|
247
|
-
const
|
|
247
|
+
const fe = {
|
|
248
248
|
/**
|
|
249
249
|
* 根据 componentRef 查找已安装、已审核并启用的 npm 组件。
|
|
250
250
|
* @param data - FDE 自定义组件卡片数据。
|
|
251
251
|
* @returns 命中的组件登记项;未登记或禁用时返回 null。
|
|
252
252
|
*/
|
|
253
253
|
resolve(r) {
|
|
254
|
-
const t =
|
|
254
|
+
const t = me.get(r.componentRef);
|
|
255
255
|
return !t || t.enabled === !1 ? null : t;
|
|
256
256
|
},
|
|
257
|
-
validateProps:
|
|
257
|
+
validateProps: pe
|
|
258
258
|
};
|
|
259
259
|
export {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
260
|
+
we as W,
|
|
261
|
+
J as a,
|
|
262
|
+
q as b,
|
|
263
|
+
Y as c,
|
|
264
|
+
fe as d,
|
|
265
|
+
ye as e,
|
|
266
|
+
he as s
|
|
267
267
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare enum LocaleEnum {
|
|
2
|
+
zh = "zh-CN",
|
|
3
|
+
en = "en-US",
|
|
4
|
+
ja = "ja-JP"
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 获取国际化文本
|
|
8
|
+
* @param key 字段key
|
|
9
|
+
* @param replaceObj 文本中要替换的字段
|
|
10
|
+
* @param failBack 未匹配key时的兜底文字
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
declare const getLocaleText: (key: string, replaceObj?: any, failBack?: string) => string;
|
|
14
|
+
declare const updateLocalMessage: (messages: any) => void;
|
|
15
|
+
/**
|
|
16
|
+
* 初始化国际化文本
|
|
17
|
+
* @param options
|
|
18
|
+
* @param options.locale 当前语言类型,默认'zh-CN'
|
|
19
|
+
* @param options.projects 需要获取的语言项目,用逗号进行分割
|
|
20
|
+
* @param options.isPc 是否pc端
|
|
21
|
+
* @param options.mainProject 当前项目的project名
|
|
22
|
+
* @param options.urlPrefix cdn地址
|
|
23
|
+
* @param options.platform 所属平台,runtime/designer,默认runtime
|
|
24
|
+
* @param options.codeOutJson
|
|
25
|
+
*/
|
|
26
|
+
declare function initSetI18nMessages(options: {
|
|
27
|
+
locale: string;
|
|
28
|
+
projects: string;
|
|
29
|
+
isPc: boolean;
|
|
30
|
+
mainProject: string;
|
|
31
|
+
urlPrefix: string;
|
|
32
|
+
platform?: string;
|
|
33
|
+
codeOutJson?: any;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
declare const getLabel: (context: any, instanceId: string, failBackValue: any, appointField?: string) => any;
|
|
36
|
+
declare const getPlaceholder: (context: any, instanceId: string, failBackValue: any, appointField?: string) => any;
|
|
37
|
+
export { getLocaleText, updateLocalMessage, initSetI18nMessages, getLabel, getPlaceholder, LocaleEnum, };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var c = /* @__PURE__ */ ((e) => (e.zh = "zh-CN", e.en = "en-US", e.ja = "ja-JP", e))(c || {});
|
|
2
|
+
const d = (e, a, n) => {
|
|
3
|
+
if (!e)
|
|
4
|
+
return console.error("getLocaleText的key不能为空"), "";
|
|
5
|
+
const t = e.split(".");
|
|
6
|
+
let s;
|
|
7
|
+
const g = (window.baitedaWorkers || {}).languageMessages || {};
|
|
8
|
+
t.forEach((i, l) => {
|
|
9
|
+
l === 0 ? s = g[i] : s && (s = s[i]);
|
|
10
|
+
});
|
|
11
|
+
let o = "";
|
|
12
|
+
return s && (o = s), a && Object.keys(a).forEach((i) => {
|
|
13
|
+
const l = a[i];
|
|
14
|
+
o = o.replace(new RegExp(`\\{\\s*${i}\\s*\\}`, "g"), l);
|
|
15
|
+
}), o || (n ? o = n : o = e), o;
|
|
16
|
+
}, u = (e) => {
|
|
17
|
+
window.baitedaWorkers || (window.baitedaWorkers = {}), window.baitedaWorkers.languageMessages || (window.baitedaWorkers.languageMessages = {});
|
|
18
|
+
const a = window.baitedaWorkers.languageMessages;
|
|
19
|
+
e || (e = {}), Object.assign(a, e);
|
|
20
|
+
};
|
|
21
|
+
async function C(e) {
|
|
22
|
+
const a = e.locale || "zh-CN", n = e.projects, t = e.isPc, s = e.urlPrefix, r = window.location.origin, g = e.platform || "runtime";
|
|
23
|
+
let o;
|
|
24
|
+
e.codeOutJson ? (o = e.codeOutJson, window.baitedaWorkers.languageMessages || (window.baitedaWorkers.languageMessages = o)) : o = await new Promise((i) => {
|
|
25
|
+
const l = window.baitedaWorkers;
|
|
26
|
+
l && (l.languageDataStoreWorker.postMessage({
|
|
27
|
+
action: "getLanguageData",
|
|
28
|
+
options: {
|
|
29
|
+
locale: a,
|
|
30
|
+
projects: n,
|
|
31
|
+
urlPrefix: r + s,
|
|
32
|
+
platform: g
|
|
33
|
+
}
|
|
34
|
+
}), l.languageDataStoreWorkerInterface.getLanguageMessages = (w) => {
|
|
35
|
+
g === "runtime" && window.localStorage.setItem("allLanguageList", JSON.stringify(w.languageList)), window.baitedaWorkers.languageMessages || (window.baitedaWorkers.languageMessages = {}), Object.assign(window.baitedaWorkers.languageMessages, w.messages), i(w.messages);
|
|
36
|
+
});
|
|
37
|
+
}), /(CWD)|(CWM)/.test(n) && (window.okuiConfig || (window.okuiConfig = {}), window.okuiConfig.i18n = {}, window.okuiConfig.locale = a, t ? window.okuiConfig.i18n[a] = o.CWD : window.okuiConfig.i18n[a] = o.CWM), /(CAD)|(CAM)/.test(n) && (window.approvalConfig || (window.approvalConfig = {}), window.approvalConfig.i18n = {}, window.approvalConfig.locale = a, t ? window.approvalConfig.i18n[a] = o.CAD : window.approvalConfig.i18n[a] = o.CAM);
|
|
38
|
+
}
|
|
39
|
+
const f = (e, a, n, t) => {
|
|
40
|
+
let s = e.value || e, r;
|
|
41
|
+
s && s.externalParams && (r = s.externalParams.data.content.i18n);
|
|
42
|
+
let g = {};
|
|
43
|
+
r && r.local && (g = r.local[a] || {});
|
|
44
|
+
const o = window.localStorage.getItem("locale");
|
|
45
|
+
let i = {};
|
|
46
|
+
return r && r[o] && (i = r[o][a]), t ? g[t] || i[t] || n : g.caption || g.content || i.caption || i.content || n;
|
|
47
|
+
}, k = (e, a, n, t) => f(e, a, n, t || "placeholder");
|
|
48
|
+
export {
|
|
49
|
+
c as LocaleEnum,
|
|
50
|
+
f as getLabel,
|
|
51
|
+
d as getLocaleText,
|
|
52
|
+
k as getPlaceholder,
|
|
53
|
+
C as initSetI18nMessages,
|
|
54
|
+
u as updateLocalMessage
|
|
55
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@byteluck-fe/locale-message",
|
|
3
|
+
"version": "1.0.16",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/locale-message.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"build": "vite build",
|
|
11
|
+
"lint": "vue-cli-service lint",
|
|
12
|
+
"cleanup": "rimraf ./dist",
|
|
13
|
+
"prepublish": "npm run cleanup && npm run build"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"registry": "https://registry.npmjs.org/",
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^22.0.2",
|
|
26
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
27
|
+
"@vitejs/plugin-vue-jsx": "^3.0.2",
|
|
28
|
+
"rollup-plugin-dts": "^6.0.0",
|
|
29
|
+
"rollup-plugin-typescript2": "^0.35.0",
|
|
30
|
+
"rollup-plugin-visualizer": "^5.9.2",
|
|
31
|
+
"vite": "^4.4.5",
|
|
32
|
+
"vite-plugin-dts": "^3.5.2"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [],
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "ISC"
|
|
37
|
+
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Context usage ring - displays context window usage as a circular progress indicator.
|
|
3
|
+
* @author seadon
|
|
4
|
+
* @created 2026-05-16
|
|
5
|
+
*/
|
|
1
6
|
import type { ContextUsage } from "../composables/context-usage";
|
|
2
7
|
type __VLS_Props = {
|
|
3
8
|
disabled?: boolean;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview FSES AI chat component - renders conversation history, composer controls, and chart-card actions.
|
|
3
|
+
* @author seadon
|
|
4
|
+
* @created 2026-05-06
|
|
5
|
+
*/
|
|
1
6
|
import type { ChartCardSpec, MetricWorkbenchCardSpec } from "../chart-card/types";
|
|
2
7
|
import type { AssistantPersonaPayload, AttachmentPayload, CardRecommendationChooseFeedback, CardRecommendationDraft, CardRecommendationItem, ChatMessage, BusinessGroupContext, BusinessGroupOption, FsesAiChatConversationChangeMeta, FsesAiChatTransport, FsesAiChatTransportMessageInput, ImagePayload } from "../composables/types";
|
|
3
8
|
import type { PlanDraft } from "../composables/types";
|