@huaqiu/dsh-hardware-ui 0.7.19 → 0.7.21
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/lib/client.js +851 -219
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
- package/src/client/components.tsx +3 -0
- package/src/client/copy.ts +53 -13
- package/src/client/index.ts +77 -0
- package/src/client/locales.ts +63 -26
- package/src/client/model.ts +40 -0
- package/src/client/order.tsx +423 -453
- package/src/client/place-order.tsx +275 -0
- package/src/client/preview.tsx +4 -1
- package/src/client/store.ts +3 -0
- package/src/client/toolchain-view.tsx +90 -17
- package/src/client/toolchain.ts +173 -3
- package/src/client/transport.ts +4 -4
- package/src/client/wizard.tsx +16 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-hardware-ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hardware Engineering product UI for DSH: five-destination engineering navigation, right-panel artifact viewer, CAD installation settings and contextual native-application actions.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -261,6 +261,8 @@ export function HardwareViewerBody(props: HardwareProps): ReactNode {
|
|
|
261
261
|
const artifact = useStore(state => selectedArtifact(state, active))
|
|
262
262
|
const missing = useStore(state => missingState(state, active))
|
|
263
263
|
const workspaceRoot = useStore(state => state.workspaceRoot)
|
|
264
|
+
/** Operation the Place Order view picked, if this navigation came from it. */
|
|
265
|
+
const orderKind = params?.orderKind
|
|
264
266
|
const cwd = useSessions?.(state => {
|
|
265
267
|
if (sessionId === undefined) return undefined
|
|
266
268
|
return state.byId[sessionId]?.cwd
|
|
@@ -425,6 +427,7 @@ export function HardwareViewerBody(props: HardwareProps): ReactNode {
|
|
|
425
427
|
...(sessionId === undefined ? {} : { session: sessionId }),
|
|
426
428
|
revision: navRevision,
|
|
427
429
|
configured: kicadConfigured,
|
|
430
|
+
...(orderKind === undefined ? {} : { orderKind }),
|
|
428
431
|
})]
|
|
429
432
|
: [createElement('div', {
|
|
430
433
|
key: 'missing',
|
package/src/client/copy.ts
CHANGED
|
@@ -261,22 +261,52 @@ export const COPY = {
|
|
|
261
261
|
get copyUrl(): string { return translateCopy('order.copyUrl') },
|
|
262
262
|
get copied(): string { return translateCopy('order.copied') },
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
confirmHost: (baseUrl: string | undefined): string =>
|
|
272
|
-
baseUrl ?? translateCopy('order.confirmHostFallback'),
|
|
273
|
-
get confirmAck(): string { return translateCopy('order.confirmAck') },
|
|
274
|
-
get cancel(): string { return translateCopy('order.cancel') },
|
|
275
|
-
get uploadAndOpen(): string { return translateCopy('order.uploadAndOpen') },
|
|
276
|
-
get uploading(): string { return translateCopy('order.uploading') },
|
|
264
|
+
/**
|
|
265
|
+
* The one-click contract, stated once where the click happens.
|
|
266
|
+
*
|
|
267
|
+
* There is no confirmation dialog: the button uploads, so the panel says
|
|
268
|
+
* that plainly instead of asking afterwards.
|
|
269
|
+
*/
|
|
270
|
+
get uploadHint(): string { return translateCopy('order.uploadHint') },
|
|
277
271
|
|
|
278
272
|
get batch(): string { return translateCopy('order.batch') },
|
|
279
273
|
batchUnits: (count: number): string => translateCopy('order.batchUnits', { count }),
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The project-selection view in front of this destination.
|
|
277
|
+
*
|
|
278
|
+
* It only chooses *what* to order; the package, the price, the token and the
|
|
279
|
+
* page stay where they already were, so this block is deliberately short.
|
|
280
|
+
*/
|
|
281
|
+
placeOrder: {
|
|
282
|
+
get title(): string { return translateCopy('order.placeOrder.title') },
|
|
283
|
+
get lead(): string { return translateCopy('order.placeOrder.lead') },
|
|
284
|
+
get workspace(): string { return translateCopy('order.placeOrder.workspace') },
|
|
285
|
+
get workspaceUnknown(): string { return translateCopy('order.placeOrder.workspaceUnknown') },
|
|
286
|
+
get refresh(): string { return translateCopy('order.placeOrder.refresh') },
|
|
287
|
+
get refreshing(): string { return translateCopy('order.placeOrder.refreshing') },
|
|
288
|
+
get loading(): string { return translateCopy('order.placeOrder.loading') },
|
|
289
|
+
get noProjects(): string { return translateCopy('order.placeOrder.noProjects') },
|
|
290
|
+
get noProjectsHint(): string { return translateCopy('order.placeOrder.noProjectsHint') },
|
|
291
|
+
discoveryFailed: (detail: string): string =>
|
|
292
|
+
translateCopy('order.placeOrder.discoveryFailed', { detail }),
|
|
293
|
+
get colProject(): string { return translateCopy('order.placeOrder.colProject') },
|
|
294
|
+
get colArtifacts(): string { return translateCopy('order.placeOrder.colArtifacts') },
|
|
295
|
+
get colActions(): string { return translateCopy('order.placeOrder.colActions') },
|
|
296
|
+
get pcbAction(): string { return translateCopy('order.placeOrder.pcbAction') },
|
|
297
|
+
get pcbaAction(): string { return translateCopy('order.placeOrder.pcbaAction') },
|
|
298
|
+
boardCount: (count: number): string => translateCopy('order.placeOrder.boardCount', { count }),
|
|
299
|
+
get noSchematic(): string { return translateCopy('order.placeOrder.noSchematic') },
|
|
300
|
+
get noBoard(): string { return translateCopy('order.placeOrder.noBoard') },
|
|
301
|
+
get needsKicad(): string { return translateCopy('order.placeOrder.needsKicad') },
|
|
302
|
+
get kicadReady(): string { return translateCopy('order.placeOrder.kicadReady') },
|
|
303
|
+
/** Emitted while the readiness probes are still in flight, never as a claim. */
|
|
304
|
+
get checking(): string { return translateCopy('order.placeOrder.checking') },
|
|
305
|
+
get needsSignIn(): string { return translateCopy('order.placeOrder.needsSignIn') },
|
|
306
|
+
get signInReady(): string { return translateCopy('order.placeOrder.signInReady') },
|
|
307
|
+
get selectedProject(): string { return translateCopy('order.placeOrder.selectedProject') },
|
|
308
|
+
get multipleProjects(): string { return translateCopy('order.placeOrder.multipleProjects') },
|
|
309
|
+
},
|
|
280
310
|
quoteBasis: (count: number): string => translateCopy('order.quoteBasis', { count }),
|
|
281
311
|
},
|
|
282
312
|
|
|
@@ -300,6 +330,13 @@ export const COPY = {
|
|
|
300
330
|
get solidcraftChip(): string { return translateCopy('wizard.solidcraftChip') },
|
|
301
331
|
get solidcraftBlurb(): string { return translateCopy('wizard.solidcraftBlurb') },
|
|
302
332
|
get selectFile(): string { return translateCopy('wizard.selectFile') },
|
|
333
|
+
/**
|
|
334
|
+
* The prototype's wizard badge once a tool is usable: `✓ Ready (v10.0.7)`.
|
|
335
|
+
* It says "ready", not "configured", because the wizard is about what the user
|
|
336
|
+
* can start using now — a path the Host just validated counts, saved or not.
|
|
337
|
+
*/
|
|
338
|
+
ready: (label: string): string => translateCopy('wizard.ready', { label }),
|
|
339
|
+
get readyDetected(): string { return translateCopy('wizard.readyDetected') },
|
|
303
340
|
dontHave: (name: string): string => translateCopy('wizard.dontHave', { name }),
|
|
304
341
|
get serverDownload(): string { return translateCopy('wizard.serverDownload') },
|
|
305
342
|
get footer(): string { return translateCopy('wizard.footer') },
|
|
@@ -332,6 +369,9 @@ export const COPY = {
|
|
|
332
369
|
get statusVerified(): string { return translateCopy('settings.statusVerified') },
|
|
333
370
|
get statusAwaiting(): string { return translateCopy('settings.statusAwaiting') },
|
|
334
371
|
get statusUnsaved(): string { return translateCopy('settings.statusUnsaved') },
|
|
372
|
+
/** The fading success badge that replaces the (no longer printed) path line. */
|
|
373
|
+
statusSavedBadge: (version: string): string => translateCopy('settings.statusSavedBadge', { version }),
|
|
374
|
+
get statusSavedPlain(): string { return translateCopy('settings.statusSavedPlain') },
|
|
335
375
|
download: (tool: 'kicad' | 'solidcraft', version: string): string => (tool === 'kicad'
|
|
336
376
|
? translateCopy('settings.downloadKicad', { version })
|
|
337
377
|
: translateCopy('settings.downloadSolidCraft', { version })),
|
package/src/client/index.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* scope").
|
|
19
19
|
*/
|
|
20
20
|
import { HardwareSettingsSection, HardwareViewerBody } from './components.js'
|
|
21
|
+
import { PlaceOrderBody } from './place-order.js'
|
|
21
22
|
import { ToolchainIndicator, ToolchainToastHost } from './toolchain-view.js'
|
|
22
23
|
import { TOOLCHAIN_ONBOARDING_STEP, ToolchainOnboarding } from './wizard.js'
|
|
23
24
|
import { ToolchainController } from './toolchain.js'
|
|
@@ -41,9 +42,24 @@ export const inject = ['slots', 'locale', 'sidebarRight', 'sidebarRightTabs', 'c
|
|
|
41
42
|
export const HARDWARE_SETTINGS_ID = 'hardware-engineering'
|
|
42
43
|
export const HARDWARE_TAB_ID = '@huaqiu/dsh-hardware-ui'
|
|
43
44
|
export const HARDWARE_TAB_KIND = 'hardware-engineering'
|
|
45
|
+
/** The project-selection view that fronts the order destination. */
|
|
46
|
+
export const PLACE_ORDER_TAB_ID = '@huaqiu/dsh-hardware-ui/place-order'
|
|
47
|
+
export const PLACE_ORDER_TAB_KIND = 'hardware-place-order'
|
|
44
48
|
/** Host plugin row id whose volatile config backs the product settings page. */
|
|
45
49
|
export const HARDWARE_CONFIG_ENTRY = 'hardware-artifacts'
|
|
46
50
|
|
|
51
|
+
declare global {
|
|
52
|
+
interface Window {
|
|
53
|
+
/**
|
|
54
|
+
* The one-method handle the desktop shell's Place Order menu calls (PO-02).
|
|
55
|
+
*
|
|
56
|
+
* A handle rather than a shell-side URL or IPC: the shell stays unable to
|
|
57
|
+
* name a project, but can still ask the workflow to start.
|
|
58
|
+
*/
|
|
59
|
+
huaqiu?: { placeOrder?: () => boolean }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
47
63
|
interface SlotSpec {
|
|
48
64
|
name: string
|
|
49
65
|
id?: string
|
|
@@ -205,6 +221,35 @@ export function apply(ctx: ClientContext): void {
|
|
|
205
221
|
revealIfOpened: true,
|
|
206
222
|
})
|
|
207
223
|
},
|
|
224
|
+
// One tab, not one per click: a menu that is pressed twice must reveal what
|
|
225
|
+
// the first press opened rather than stack two project lists.
|
|
226
|
+
placeOrder() {
|
|
227
|
+
const tabs = ctx.sidebarRight
|
|
228
|
+
if (tabs === undefined) return false
|
|
229
|
+
tabs.openTab(PLACE_ORDER_TAB_KIND, { revealIfOpened: true })
|
|
230
|
+
return true
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* Hand the chosen project to the existing order destination. The path and
|
|
234
|
+
* the project travel in the navigation params, so the viewer discovers that
|
|
235
|
+
* project and the order panel packages the board — no second packaging path.
|
|
236
|
+
*/
|
|
237
|
+
orderProject(request) {
|
|
238
|
+
navigation += 1
|
|
239
|
+
const params: ViewerNavigationParams = {
|
|
240
|
+
destination: 'order',
|
|
241
|
+
path: request.boardPath,
|
|
242
|
+
kind: 'pcb',
|
|
243
|
+
projectPath: request.projectPath,
|
|
244
|
+
...(request.schematicPath === undefined ? {} : { schematicPath: request.schematicPath }),
|
|
245
|
+
orderKind: request.kind,
|
|
246
|
+
navigationRevision: navigation,
|
|
247
|
+
}
|
|
248
|
+
ctx.sidebarRight?.openTab(HARDWARE_TAB_KIND, {
|
|
249
|
+
params: params as unknown as Readonly<Record<string, unknown>>,
|
|
250
|
+
revealIfOpened: true,
|
|
251
|
+
})
|
|
252
|
+
},
|
|
208
253
|
async openNative(request) {
|
|
209
254
|
await openArtifact({
|
|
210
255
|
application: request.application,
|
|
@@ -239,6 +284,26 @@ export function apply(ctx: ClientContext): void {
|
|
|
239
284
|
title: () => COPY.product.name,
|
|
240
285
|
}) ?? (() => {}), 'hardware-ui: right-panel tab type')
|
|
241
286
|
|
|
287
|
+
// The Place Order view is its own tab: reachable with no engineering document
|
|
288
|
+
// open, and a single instance so a second menu click only brings it forward.
|
|
289
|
+
effect(() => ctx.sidebarRightTabs?.register({
|
|
290
|
+
id: PLACE_ORDER_TAB_ID,
|
|
291
|
+
kind: PLACE_ORDER_TAB_KIND,
|
|
292
|
+
title: () => COPY.order.placeOrder.title,
|
|
293
|
+
}) ?? (() => {}), 'hardware-ui: place order tab type')
|
|
294
|
+
|
|
295
|
+
// The desktop shell's Place Order menu (PO-02) needs one thing from this
|
|
296
|
+
// plugin: a way to ask for the workflow. It is a single handle with a single
|
|
297
|
+
// method, installed while the plugin is active and removed with it, so the
|
|
298
|
+
// menu never reaches into business logic and a reload keeps working.
|
|
299
|
+
if (typeof window !== 'undefined') {
|
|
300
|
+
effect(() => {
|
|
301
|
+
const handle = { placeOrder: (): boolean => controller.placeOrder() }
|
|
302
|
+
window.huaqiu = handle
|
|
303
|
+
return () => { if (window.huaqiu === handle) delete window.huaqiu }
|
|
304
|
+
}, 'hardware-ui: place order handle')
|
|
305
|
+
}
|
|
306
|
+
|
|
242
307
|
const slots = ctx.slots
|
|
243
308
|
if (slots === undefined) return
|
|
244
309
|
|
|
@@ -255,6 +320,18 @@ export function apply(ctx: ClientContext): void {
|
|
|
255
320
|
OrderTabBody,
|
|
256
321
|
)), 'hardware-ui: order page body')
|
|
257
322
|
|
|
323
|
+
// Project selection for the Place Order workflow: same panel seat, its own tab.
|
|
324
|
+
effect(() => slots.inject('sidebar.right.pane.tab', () => slots.register({
|
|
325
|
+
name: 'sidebar.right.pane.tab',
|
|
326
|
+
key: PLACE_ORDER_TAB_ID,
|
|
327
|
+
locale: HARDWARE_UI_NS,
|
|
328
|
+
inject: () => ({
|
|
329
|
+
discover: controller.discover,
|
|
330
|
+
installations: controller.installations,
|
|
331
|
+
orderProject: controller.orderProject,
|
|
332
|
+
}),
|
|
333
|
+
}, PlaceOrderBody)), 'hardware-ui: place order body')
|
|
334
|
+
|
|
258
335
|
effect(() => slots.inject('settings.section', () => slots.register({
|
|
259
336
|
name: 'settings.section',
|
|
260
337
|
id: HARDWARE_SETTINGS_ID,
|
package/src/client/locales.ts
CHANGED
|
@@ -142,21 +142,35 @@ export const zh = {
|
|
|
142
142
|
'order.opening': '正在打开…',
|
|
143
143
|
'order.copyUrl': '复制链接',
|
|
144
144
|
'order.copied': '已复制',
|
|
145
|
-
'order.
|
|
146
|
-
'order.confirmTitlePcb': '上传板文件并创建 PCB 订单?',
|
|
147
|
-
'order.confirmTitleSmt': '上传贴片文件包?',
|
|
148
|
-
'order.confirmBody': '以下文件将发送到华秋下单服务。订单在那里创建,其页面会在右侧面板中打开;付款仍在该页面完成。',
|
|
149
|
-
'order.confirmZip': '{zip} — Gerber 与钻孔文件({size})',
|
|
150
|
-
'order.confirmPositions': '元件坐标({size})',
|
|
151
|
-
'order.confirmBom': '贴片 BOM({size})',
|
|
152
|
-
'order.confirmHostFallback': '已配置的下单服务',
|
|
153
|
-
'order.confirmAck': '我了解这些板文件将离开本机。',
|
|
154
|
-
'order.cancel': '取消',
|
|
155
|
-
'order.uploadAndOpen': '上传并打开订单页',
|
|
156
|
-
'order.uploading': '正在上传…',
|
|
145
|
+
'order.uploadHint': '点击「提交订单」即上传上面列出的文件到华秋并创建订单,订单页随后在右侧页签打开;付款在华秋页面完成。',
|
|
157
146
|
'order.batch': '生产数量',
|
|
158
147
|
'order.batchUnits': '{count} 片',
|
|
159
148
|
'order.quoteBasis': '报价基准 · {count} 片',
|
|
149
|
+
'order.placeOrder.title': '下单',
|
|
150
|
+
'order.placeOrder.lead': '从当前工作目录中选择一个 KiCad 工程,直接进入 PCB 或 PCBA 下单流程。',
|
|
151
|
+
'order.placeOrder.workspace': '工作目录',
|
|
152
|
+
'order.placeOrder.workspaceUnknown': '尚未确定工作目录',
|
|
153
|
+
'order.placeOrder.refresh': '重新扫描',
|
|
154
|
+
'order.placeOrder.refreshing': '正在扫描…',
|
|
155
|
+
'order.placeOrder.loading': '正在扫描工作目录中的 KiCad 工程…',
|
|
156
|
+
'order.placeOrder.noProjects': '这个工作目录里没有找到 KiCad 工程',
|
|
157
|
+
'order.placeOrder.noProjectsHint': '工程需要包含 .kicad_pro 文件。保存工程后点「重新扫描」。',
|
|
158
|
+
'order.placeOrder.discoveryFailed': '工程扫描失败:{detail}',
|
|
159
|
+
'order.placeOrder.colProject': '工程',
|
|
160
|
+
'order.placeOrder.colArtifacts': '工程文件',
|
|
161
|
+
'order.placeOrder.colActions': '下单',
|
|
162
|
+
'order.placeOrder.pcbAction': '下 PCB',
|
|
163
|
+
'order.placeOrder.pcbaAction': '下 PCBA',
|
|
164
|
+
'order.placeOrder.boardCount': '{count} 个 PCB',
|
|
165
|
+
'order.placeOrder.noSchematic': '缺少工程原理图,无法生成贴片 BOM 与坐标',
|
|
166
|
+
'order.placeOrder.noBoard': '缺少 .kicad_pcb,无法打包制板文件',
|
|
167
|
+
'order.placeOrder.needsKicad': '未配置 KiCad,无法打包 Gerber',
|
|
168
|
+
'order.placeOrder.kicadReady': 'KiCad 已就绪',
|
|
169
|
+
'order.placeOrder.checking': '检测中…',
|
|
170
|
+
'order.placeOrder.needsSignIn': '未登录华秋账号,订单页将无法带登录态打开',
|
|
171
|
+
'order.placeOrder.signInReady': '已登录华秋',
|
|
172
|
+
'order.placeOrder.selectedProject': '当前工程',
|
|
173
|
+
'order.placeOrder.multipleProjects': '{count} 个工程',
|
|
160
174
|
|
|
161
175
|
// First-run setup wizard.
|
|
162
176
|
|
|
@@ -192,7 +206,7 @@ export const zh = {
|
|
|
192
206
|
'errors.stale-revision': '文件已变化,请刷新后重试。',
|
|
193
207
|
'errors.invalid-request': '请求参数不完整。',
|
|
194
208
|
'errors.invalid-application': '不支持该本地程序。',
|
|
195
|
-
'errors.confirmation-required': '
|
|
209
|
+
'errors.confirmation-required': '下单请求缺少确认标志,已被拒绝。',
|
|
196
210
|
'errors.invalid-order-url': '订单链接无效,已拒绝打开。',
|
|
197
211
|
'errors.order-unreachable': '无法连接下单服务。',
|
|
198
212
|
'errors.order-rejected': '下单服务未能返回可用的订单页。',
|
|
@@ -281,6 +295,8 @@ export const zh = {
|
|
|
281
295
|
'wizard.solidcraftChip': '可选 · MCAD',
|
|
282
296
|
'wizard.solidcraftBlurb': '提供结构外壳上下文与 3D CAD 互操作能力。',
|
|
283
297
|
'wizard.selectFile': '选择本地文件…',
|
|
298
|
+
'wizard.ready': '✓ 就绪(v{label})',
|
|
299
|
+
'wizard.readyDetected': '✓ 就绪(已检测)',
|
|
284
300
|
'wizard.dontHave': '还没有 {name}?',
|
|
285
301
|
'wizard.serverDownload': '从 HuaQiu 服务器下载',
|
|
286
302
|
'wizard.footer': '你随时可以在「设置 → 硬件工程」中配置或更新这些路径',
|
|
@@ -291,6 +307,8 @@ export const zh = {
|
|
|
291
307
|
'settings.statusVerified': '已验证可执行文件',
|
|
292
308
|
'settings.statusAwaiting': '等待可执行文件路径',
|
|
293
309
|
'settings.statusUnsaved': '未保存 · 点「校验并保存」',
|
|
310
|
+
'settings.statusSavedBadge': '已保存 v{version}',
|
|
311
|
+
'settings.statusSavedPlain': '已保存',
|
|
294
312
|
'settings.downloadKicad': '下载 KiCad(v{version})',
|
|
295
313
|
'settings.downloadSolidCraft': '下载 SolidCraft(v{version})',
|
|
296
314
|
'toolchain.downloading': '正在从 down.eda.cn 下载…',
|
|
@@ -437,21 +455,35 @@ export const en: Record<HardwareCopyKey, string> = {
|
|
|
437
455
|
'order.opening': 'Opening…',
|
|
438
456
|
'order.copyUrl': 'Copy link',
|
|
439
457
|
'order.copied': 'Copied',
|
|
440
|
-
'order.
|
|
441
|
-
'order.confirmTitlePcb': 'Upload board files and create a PCB order?',
|
|
442
|
-
'order.confirmTitleSmt': 'Upload the assembly package?',
|
|
443
|
-
'order.confirmBody': 'The following files will be sent to the Huaqiu ordering service. The order is created there and its page opens in the right panel; payment is completed on that page.',
|
|
444
|
-
'order.confirmZip': '{zip} — Gerber and drill files ({size})',
|
|
445
|
-
'order.confirmPositions': 'Component positions ({size})',
|
|
446
|
-
'order.confirmBom': 'Assembly BOM ({size})',
|
|
447
|
-
'order.confirmHostFallback': 'the configured ordering service',
|
|
448
|
-
'order.confirmAck': 'I understand these board files will leave this machine.',
|
|
449
|
-
'order.cancel': 'Cancel',
|
|
450
|
-
'order.uploadAndOpen': 'Upload and open order page',
|
|
451
|
-
'order.uploading': 'Uploading…',
|
|
458
|
+
'order.uploadHint': 'Clicking the order button uploads the files listed above to Huaqiu and creates the order; the order page then opens in a tab on the right, where payment is completed.',
|
|
452
459
|
'order.batch': 'Quantity',
|
|
453
460
|
'order.batchUnits': '{count} boards',
|
|
454
461
|
'order.quoteBasis': 'Quote basis · {count} boards',
|
|
462
|
+
'order.placeOrder.title': 'Place Order',
|
|
463
|
+
'order.placeOrder.lead': 'Pick one KiCad project from the current workspace and go straight to a PCB or PCBA order.',
|
|
464
|
+
'order.placeOrder.workspace': 'Workspace',
|
|
465
|
+
'order.placeOrder.workspaceUnknown': 'No workspace resolved yet',
|
|
466
|
+
'order.placeOrder.refresh': 'Scan again',
|
|
467
|
+
'order.placeOrder.refreshing': 'Scanning...',
|
|
468
|
+
'order.placeOrder.loading': 'Scanning the workspace for KiCad projects...',
|
|
469
|
+
'order.placeOrder.noProjects': 'No KiCad project in this workspace',
|
|
470
|
+
'order.placeOrder.noProjectsHint': 'A project needs a .kicad_pro file. Save it, then scan again.',
|
|
471
|
+
'order.placeOrder.discoveryFailed': 'Project scan failed: {detail}',
|
|
472
|
+
'order.placeOrder.colProject': 'Project',
|
|
473
|
+
'order.placeOrder.colArtifacts': 'Files',
|
|
474
|
+
'order.placeOrder.colActions': 'Order',
|
|
475
|
+
'order.placeOrder.pcbAction': 'Order PCB',
|
|
476
|
+
'order.placeOrder.pcbaAction': 'Order PCBA',
|
|
477
|
+
'order.placeOrder.boardCount': '{count} PCB',
|
|
478
|
+
'order.placeOrder.noSchematic': 'No project schematic, so no positions or assembly BOM',
|
|
479
|
+
'order.placeOrder.noBoard': 'No .kicad_pcb, so no fabrication package',
|
|
480
|
+
'order.placeOrder.needsKicad': 'KiCad is not configured, so Gerbers cannot be packaged',
|
|
481
|
+
'order.placeOrder.kicadReady': 'KiCad ready',
|
|
482
|
+
'order.placeOrder.checking': 'Checking…',
|
|
483
|
+
'order.placeOrder.needsSignIn': 'Not signed in to Huaqiu, so the order page cannot open signed in',
|
|
484
|
+
'order.placeOrder.signInReady': 'Signed in to Huaqiu',
|
|
485
|
+
'order.placeOrder.selectedProject': 'Current project',
|
|
486
|
+
'order.placeOrder.multipleProjects': '{count} projects',
|
|
455
487
|
|
|
456
488
|
|
|
457
489
|
'settings.title': 'Hardware Engineering',
|
|
@@ -484,7 +516,7 @@ export const en: Record<HardwareCopyKey, string> = {
|
|
|
484
516
|
'errors.stale-revision': 'The file changed; refresh and try again.',
|
|
485
517
|
'errors.invalid-request': 'The request parameters are incomplete.',
|
|
486
518
|
'errors.invalid-application': 'This local application is not supported.',
|
|
487
|
-
'errors.confirmation-required': '
|
|
519
|
+
'errors.confirmation-required': 'The order request carried no confirmation flag, so it was refused.',
|
|
488
520
|
'errors.invalid-order-url': 'The order link is invalid and was refused.',
|
|
489
521
|
'errors.order-unreachable': 'Could not connect to the ordering service.',
|
|
490
522
|
'errors.order-rejected': 'The ordering service did not return a usable order page.',
|
|
@@ -571,6 +603,8 @@ export const en: Record<HardwareCopyKey, string> = {
|
|
|
571
603
|
'wizard.solidcraftChip': 'Optional • MCAD',
|
|
572
604
|
'wizard.solidcraftBlurb': 'Provides structural enclosure context and 3D CAD interoperability.',
|
|
573
605
|
'wizard.selectFile': 'Select Local File...',
|
|
606
|
+
'wizard.ready': '✓ Ready (v{label})',
|
|
607
|
+
'wizard.readyDetected': '✓ Ready (Detected)',
|
|
574
608
|
'wizard.dontHave': "Don't have {name}?",
|
|
575
609
|
'wizard.serverDownload': 'Download from HuaQiu Server',
|
|
576
610
|
'wizard.footer': 'You can configure or update these anytime in Settings → Hardware Engineering',
|
|
@@ -581,6 +615,8 @@ export const en: Record<HardwareCopyKey, string> = {
|
|
|
581
615
|
'settings.statusVerified': 'Verified executable',
|
|
582
616
|
'settings.statusAwaiting': 'Awaiting executable path',
|
|
583
617
|
'settings.statusUnsaved': 'Not saved · click Validate and save',
|
|
618
|
+
'settings.statusSavedBadge': 'Saved v{version}',
|
|
619
|
+
'settings.statusSavedPlain': 'Saved',
|
|
584
620
|
'settings.downloadKicad': 'Download KiCad (v{version})',
|
|
585
621
|
'settings.downloadSolidCraft': 'Download SolidCraft (v{version})',
|
|
586
622
|
'toolchain.downloading': 'Downloading from down.eda.cn...',
|
|
@@ -602,3 +638,4 @@ export const en: Record<HardwareCopyKey, string> = {
|
|
|
602
638
|
'toolchain.pickerValid': 'usable',
|
|
603
639
|
'toolchain.pickerInvalid': 'fails validation',
|
|
604
640
|
}
|
|
641
|
+
|
package/src/client/model.ts
CHANGED
|
@@ -61,6 +61,11 @@ export interface HardwareProjectInfo {
|
|
|
61
61
|
readonly boards?: readonly HardwareArtifactInfo[]
|
|
62
62
|
readonly defaultBoard?: string
|
|
63
63
|
readonly selectionRequired?: boolean
|
|
64
|
+
/** Static order readiness the Host derives from the project's own files. */
|
|
65
|
+
readonly order?: {
|
|
66
|
+
readonly pcb: { readonly ready: boolean; readonly reason?: string }
|
|
67
|
+
readonly pcba: { readonly ready: boolean; readonly reason?: string }
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
export interface InstallationsInfo {
|
|
@@ -146,6 +151,22 @@ export interface ViewerNavigationParams {
|
|
|
146
151
|
/** Source revision of the artifact at navigation time, when known. */
|
|
147
152
|
readonly revision?: string
|
|
148
153
|
readonly projectPath?: string
|
|
154
|
+
/**
|
|
155
|
+
* The manufacturing operation the user picked in the Place Order view.
|
|
156
|
+
*
|
|
157
|
+
* The order destination serves both; this only decides which workflow card's
|
|
158
|
+
* confirmation opens first, so the choice between PCB and PCBA is carried
|
|
159
|
+
* instead of being lost on the way.
|
|
160
|
+
*/
|
|
161
|
+
readonly orderKind?: 'pcb' | 'smt'
|
|
162
|
+
/**
|
|
163
|
+
* Root schematic of the project being ordered.
|
|
164
|
+
*
|
|
165
|
+
* Discovery also assigns a unique schematic from the scanned tree, so a tab
|
|
166
|
+
* that already had another project selected would otherwise package the new
|
|
167
|
+
* board's PCBA with the old project's BOM and positions.
|
|
168
|
+
*/
|
|
169
|
+
readonly schematicPath?: string
|
|
149
170
|
/** Monotonic navigation counter: increments even when params are unchanged. */
|
|
150
171
|
readonly navigationRevision: number
|
|
151
172
|
}
|
|
@@ -175,6 +196,25 @@ export interface HardwareController {
|
|
|
175
196
|
configForm(): ConfigFormLike<HardwareInstallationConfig> | undefined
|
|
176
197
|
/** Open or retarget the product viewer tab. */
|
|
177
198
|
openDestination(destination: HardwareDestination, path?: string): void
|
|
199
|
+
/**
|
|
200
|
+
* Open the plugin-owned Place Order view (project selection) in the panel.
|
|
201
|
+
*
|
|
202
|
+
* Idempotent by design: the view is one tab, so a second click from the
|
|
203
|
+
* desktop menu reveals the tab that is already there instead of opening a
|
|
204
|
+
* second copy. Returns whether a panel was asked to open it.
|
|
205
|
+
*/
|
|
206
|
+
placeOrder(): boolean
|
|
207
|
+
/**
|
|
208
|
+
* Send one discovered project to the order destination, carrying the
|
|
209
|
+
* operation the user picked there.
|
|
210
|
+
*/
|
|
211
|
+
orderProject(request: {
|
|
212
|
+
readonly projectPath: string
|
|
213
|
+
readonly boardPath: string
|
|
214
|
+
/** The project's root schematic, so PCBA orders this project, not the last one. */
|
|
215
|
+
readonly schematicPath?: string
|
|
216
|
+
readonly kind: 'pcb' | 'smt'
|
|
217
|
+
}): void
|
|
178
218
|
/** Launch the exact artifact in its configured native application. */
|
|
179
219
|
openNative(request: {
|
|
180
220
|
application: NativeApplication
|