openxiangda 1.0.151 → 1.0.153

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.
Files changed (30) hide show
  1. package/README.md +14 -0
  2. package/openxiangda-skills/SKILL.md +1 -0
  3. package/openxiangda-skills/references/component-guide.md +13 -0
  4. package/openxiangda-skills/references/pages/page-sdk.md +37 -3
  5. package/package.json +6 -2
  6. package/packages/sdk/dist/{ProcessPreview-BOCARAvP.d.mts → ProcessPreview-DMkzccq4.d.mts} +58 -2
  7. package/packages/sdk/dist/{ProcessPreview-BOCARAvP.d.ts → ProcessPreview-DMkzccq4.d.ts} +58 -2
  8. package/packages/sdk/dist/components/index.cjs +3518 -2279
  9. package/packages/sdk/dist/components/index.cjs.map +1 -1
  10. package/packages/sdk/dist/components/index.d.mts +92 -38
  11. package/packages/sdk/dist/components/index.d.ts +92 -38
  12. package/packages/sdk/dist/components/index.mjs +3266 -2022
  13. package/packages/sdk/dist/components/index.mjs.map +1 -1
  14. package/packages/sdk/dist/{dataManagementApi-CLMqf79O.d.mts → dataManagementApi-C9O-Bb0j.d.ts} +2 -2
  15. package/packages/sdk/dist/{dataManagementApi-DhpRKmlp.d.ts → dataManagementApi-gpZkgRDM.d.mts} +2 -2
  16. package/packages/sdk/dist/runtime/index.cjs +8220 -7071
  17. package/packages/sdk/dist/runtime/index.cjs.map +1 -1
  18. package/packages/sdk/dist/runtime/index.d.mts +5 -4
  19. package/packages/sdk/dist/runtime/index.d.ts +5 -4
  20. package/packages/sdk/dist/runtime/index.mjs +8153 -6999
  21. package/packages/sdk/dist/runtime/index.mjs.map +1 -1
  22. package/packages/sdk/dist/runtime/react.cjs +2899 -453
  23. package/packages/sdk/dist/runtime/react.cjs.map +1 -1
  24. package/packages/sdk/dist/runtime/react.d.mts +63 -4
  25. package/packages/sdk/dist/runtime/react.d.ts +63 -4
  26. package/packages/sdk/dist/runtime/react.mjs +2908 -439
  27. package/packages/sdk/dist/runtime/react.mjs.map +1 -1
  28. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +1 -0
  29. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +1 -0
  30. package/templates/openxiangda-react-spa/AGENTS.md +5 -1
package/README.md CHANGED
@@ -299,6 +299,20 @@ const file = await api.uploadPublicFile(imageFile, "public-assets")
299
299
 
300
300
  图片字段和附件字段支持浏览器端压缩图。对用户上传的大图,可以在 `ImageField` 或 `AttachmentField` 上启用 `imageCompression`,运行时会保留原图 `url`,并额外上传缩略图和预览图,保存到 `thumbUrl`、`previewUrl` 和 `variants`。非图片、GIF、SVG、小于阈值的图片,以及浏览器不支持 canvas 压缩时会自动退回原上传流程。
301
301
 
302
+ 图片和附件预览由运行时统一处理:图片点击后进入同组弹窗画廊,视频、音频和文档在站内弹窗中打开;预览动作只在平台 capability API 返回 `canPreview: true` 时展示。表单上下文继续使用 `ImageField` 和 `AttachmentField`;自定义 React SPA 页面展示任意业务数据里的文件时,直接使用 `ImagePreviewGrid`、`AttachmentPreviewList`,或用 `useFilePreview` 接入自定义卡片和表格。不要为只读附件伪造 `FormProvider`,也不要自行维护扩展名白名单。
303
+
304
+ ```tsx
305
+ import {
306
+ AttachmentPreviewList,
307
+ ImagePreviewGrid,
308
+ } from "openxiangda/runtime/react"
309
+
310
+ <AttachmentPreviewList items={record.attachments || []} />
311
+ <ImagePreviewGrid items={record.photos || []} />
312
+ ```
313
+
314
+ 这些独立 API 必须在模板默认提供的 `OpenXiangdaProvider` 和 `OpenXiangdaPageProvider` 内使用。它们会从 PageSdk 获取当前 `appType`,并统一处理 preview ticket、metadata 和二进制文件响应。默认覆盖 PDF、常见媒体、文本、DOCX 和 XLSX,更多 DOC/XLS/PPT、ODF 格式由部署侧 ONLYOFFICE 配置决定。只有在需要复制、分享或新窗口打开预览页时,才通过 PageSdk `sdk.createFileAccessTicket(..., "preview", { appType })` 获取并打开 `previewPageUrl`;不要直接打开文件内容流 `previewUrl`。
315
+
302
316
  ```tsx
303
317
  import { ImageField } from "openxiangda"
304
318
 
@@ -58,6 +58,7 @@ OpenXiangda supports two workspace modes. Classic `sy-lowcode-app-workspace` pub
58
58
  - ✅ For form-entry UX, pick components in this order: OpenXiangda platform form components → `antd` / `antd-mobile` wrappers → custom component only when neither exists.
59
59
  - ✅ In React SPA apps, keep imports on public package entrypoints such as `openxiangda`, `openxiangda/runtime`, and `openxiangda/runtime/react`. The default template already groups large vendor chunks; if a bundle is too large, use route-level lazy loading and Vite `manualChunks`, not `openxiangda/packages/sdk/dist/...` internal paths.
60
60
  - ✅ For image thumbnails or lightweight previews, use `imageCompression` on `ImageField` or `AttachmentField`. Keep the original `url` for the source file and use `thumbUrl` / `previewUrl` / `variants` for smaller images.
61
+ - ✅ In form context, let `ImageField` and `AttachmentField` own preview UX. In standalone React SPA pages, use `AttachmentPreviewList`, `ImagePreviewGrid`, or `useFilePreview` from `openxiangda/runtime/react`; do not create a fake form context or import internal `FilePreviewContent` / `useFilePreviewController`. All paths must honor platform capability checks, and apps must not maintain local previewable-extension allowlists.
61
62
  - ✅ For data delivery with files, use `openxiangda form export <formCode> --mode xlsx|xlsx-images|package --profile <name>`. `package` writes a zip with `data.xlsx`, `attachments/`, and `manifest.json`; do not hand-write export URLs or stream binary content to stdout.
62
63
  - ✅ List pages, linked options, remote selectors, and report drill-downs must use paginated server-side queries with explicit searchable fields. Do not fetch a large page and filter in local state.
63
64
  - ✅ Treat workflow forms as an exception. Ordinary ticket/order/task/asset lifecycles use status fields, state machines, action logs, permissions, and automations; workflows are for real approval tasks.
@@ -87,6 +87,19 @@ OSS 浏览器直传所需的 CORS 规则在 `src/resources/storage/<code>.json`
87
87
 
88
88
  `AttachmentField` 和 `ImageField` 都可设置 `imageCompression`。启用后只压缩图片文件,保存值会额外包含 `thumbUrl`、`previewUrl` 和 `variants`,用于列表缩略图、小图预览或详情页轻量展示;原图 `url` 仍保留用于下载和高清预览。
89
89
 
90
+ 预览能力也由运行时统一接管:表单上下文使用 `ImageField` / `AttachmentField`;自定义 React SPA 页面展示任意业务数据中的只读附件时,从 `openxiangda/runtime/react` 使用 `ImagePreviewGrid` / `AttachmentPreviewList`,或使用 `useFilePreview({ items })` 接入自定义卡片、表格和详情操作。不要为只读附件伪造 `FormProvider`。
91
+
92
+ ```tsx
93
+ import { AttachmentPreviewList, ImagePreviewGrid } from "openxiangda/runtime/react"
94
+
95
+ <AttachmentPreviewList items={record.attachments || []} />
96
+ <ImagePreviewGrid items={record.photos || []} />
97
+ ```
98
+
99
+ 这些 API 先调用平台 capability,只为 `canPreview: true` 的文件显示或执行预览,并在站内弹窗中打开图片画廊、视频、音频、PDF、DOCX、XLSX、文本等内容。不要在应用代码中维护扩展名白名单,不要直接引用内部 `FilePreviewContent` / `useFilePreviewController`,也不要把文件流 URL 当成页面入口。DOC/XLS/PPT、ODF 等格式是否可预览由部署侧 ONLYOFFICE 配置决定。
100
+
101
+ 声明式 OSS 文件需要 bucket CORS 允许应用域名读取对象,浏览器端 DOCX/XLSX/HEIC 解析才能工作;平台私有附件由 ticket 文件流处理,不直接暴露对象地址。
102
+
90
103
  业务应用只能从 `openxiangda`、`openxiangda/runtime`、`openxiangda/runtime/react` 等公开入口导入组件和 SDK。不要为了减小包体积去引用 `openxiangda/packages/sdk/dist/...` 内部文件;React SPA 模板已提供 vendor chunk 分组,SDK 会把 `antd-mobile`、`dayjs` 等大型 UI 依赖交给应用构建器按路由拆分。
91
104
 
92
105
  `DataManagementList` 默认 `permissionMode="auto"`,进入页面会读取表单 action
@@ -16,7 +16,7 @@ Guidelines:
16
16
  - Use `sdk.function.invoke(code, { input })` for reusable backend business logic declared under `src/resources/functions/` and `src/functions/`. Do not implement multi-form orchestration, connector fan-out, notification orchestration, or permission-sensitive backend rules directly in a page component.
17
17
  - Use `sdk.connector.invoke`, `sdk.connector.call("connector.api")`, or `sdk.connector.download` for external services. The SDK calls the platform runtime connector endpoint; it must not call third-party domains directly.
18
18
  - Use `sdk.notification.sendByType` and `batchSendByType` for reusable business messages. Custom notification types must be declared in `src/resources/notifications/` and published with `openxiangda resource publish`.
19
- - Use `sdk.createFileAccessTicket(bucketName, objectName, fileName, "preview")` when a custom React SPA page needs a user-openable attachment preview link. Open `response.result.previewPageUrl`; do not use `previewUrl` or `/service/file/preview-by-ticket/:ticket` as the page entry.
19
+ - Use `AttachmentPreviewList`, `ImagePreviewGrid`, or `useFilePreview` from `openxiangda/runtime/react` for in-page attachment previews in a custom React SPA page. They use the current PageSdk context and enforce the platform capability and ticket contracts. Use `sdk.createFileAccessTicket(bucketName, objectName, fileName, "preview", { appType })` only when the page needs a shareable or new-window preview link. `appType` defaults to the current page context. Open `response.result.previewPageUrl`; do not use `previewUrl` or `/service/file/preview-by-ticket/:ticket` as the page entry.
20
20
  - Use `sdk.organization.departments.*` and `sdk.organization.accounts.*` only for admin-style app pages that intentionally manage platform departments/accounts. The current user needs `app:organization:manage` on the app. Do not call legacy `/user` or `/department` write endpoints from pages.
21
21
  - Use `sdk.workCenter.listItems({ boxType })` and `sdk.workCenter.getStats()` for current-user work center lists and counts. `boxType` is one of `todo`, `done`, `cc`, or `initiated`. This is the end-user task/handled/cc/initiated surface; do not build todo pages by reading workflow operation logs, automation logs, or raw process-task tables.
22
22
  - `sdk.form.create` returns identifiers and generated serial number values only. Treat `formInstId` / `formInstanceId` as the required success contract; `serialNumber` / `serialNumbers` are present only when the form has `SerialNumberField`. Do not expect the save response to contain the full row, formula results, or other server-generated field values. Call `sdk.form.getDetail` explicitly after create when those values are needed.
@@ -101,7 +101,40 @@ const response = await sdk.dataSource.run("tickets", {
101
101
 
102
102
  Data view filters, having, and fields use output aliases such as `customerName` or `ticketCount`, not source references such as `customer.name`. For option-like fields, prefer scalar aliases such as `statusValue` in the view definition and page filters. If the page only needs one form, prefer `sdk.form.advancedSearch`. If the page only needs a simple one-form dropdown, prefer linkedForm options.
103
103
 
104
- File preview ticket:
104
+ Standalone in-page file preview:
105
+
106
+ ```tsx
107
+ import { EyeOutlined } from "@ant-design/icons"
108
+ import { Button } from "antd"
109
+ import {
110
+ AttachmentPreviewList,
111
+ ImagePreviewGrid,
112
+ useFilePreview,
113
+ } from "openxiangda/runtime/react"
114
+
115
+ export function RecordFiles({ record }) {
116
+ const files = record.attachments || []
117
+ const preview = useFilePreview({ items: files })
118
+ const primary = files[0]
119
+
120
+ return (
121
+ <>
122
+ <AttachmentPreviewList items={files} />
123
+ <ImagePreviewGrid items={record.photos || []} />
124
+ {primary && preview.canPreview(primary) ? (
125
+ <Button icon={<EyeOutlined />} onClick={() => void preview.open(primary)}>
126
+ Preview primary file
127
+ </Button>
128
+ ) : null}
129
+ {preview.host}
130
+ </>
131
+ )
132
+ }
133
+ ```
134
+
135
+ These APIs must render below `OpenXiangdaProvider` and `OpenXiangdaPageProvider`. `useFilePreview` returns `canPreview`, `getCapability`, `open`, `download`, `isOpening`, and `host`. Render `host` once in the component tree. Do not import the internal `FilePreviewContent` or `useFilePreviewController`, create a fake `FormProvider`, or keep a local previewable-extension list.
136
+
137
+ Shareable file preview ticket:
105
138
 
106
139
  ```ts
107
140
  const ticketResponse = await sdk.createFileAccessTicket(
@@ -109,6 +142,7 @@ const ticketResponse = await sdk.createFileAccessTicket(
109
142
  "attachments/contracts/demo.docx",
110
143
  "demo.docx",
111
144
  "preview",
145
+ { appType: sdk.context.app.appType },
112
146
  )
113
147
 
114
148
  const previewPageUrl = ticketResponse.result?.previewPageUrl
@@ -117,7 +151,7 @@ if (previewPageUrl) {
117
151
  }
118
152
  ```
119
153
 
120
- `previewPageUrl` is the final browser page URL, normally `/view/:appType/file-preview?ticket=...`. `previewUrl` is the file content stream for the preview renderer and should not be used as the user-facing page entry.
154
+ `previewPageUrl` is the final browser page URL, normally `/view/:appType/file-preview?ticket=...`. `previewUrl` is the file content stream for the preview renderer and should not be used as the user-facing page entry. The request contract calls this fourth argument `purpose`; supported values are `preview`, `download`, and `onlyoffice`.
121
155
 
122
156
  App Function invocation:
123
157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.151",
3
+ "version": "1.0.153",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -112,9 +112,11 @@
112
112
  "antd-mobile": "^5.37.0",
113
113
  "autoprefixer": "^10.4.21",
114
114
  "dayjs": "^1.11.20",
115
+ "docx-preview": "^0.3.7",
115
116
  "dotenv": "^16.6.1",
116
117
  "esbuild": "^0.25.0",
117
118
  "glob": "^10.4.5",
119
+ "heic2any": "^0.0.4",
118
120
  "lowlight": "3.3.0",
119
121
  "minimist": "^1.2.8",
120
122
  "p-limit": "^5.0.0",
@@ -122,13 +124,15 @@
122
124
  "tailwindcss": "^3.4.17",
123
125
  "tsx": "^4.20.0",
124
126
  "undici": "^6.27.0",
125
- "vite": "^6.0.0"
127
+ "vite": "^6.0.0",
128
+ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
126
129
  },
127
130
  "peerDependencies": {
128
131
  "react": ">=18 <20",
129
132
  "react-dom": ">=18 <20"
130
133
  },
131
134
  "devDependencies": {
135
+ "@testing-library/dom": "^10.4.1",
132
136
  "@testing-library/jest-dom": "^6.9.1",
133
137
  "@testing-library/react": "^16.3.2",
134
138
  "@types/node": "^22.0.0",
@@ -1,4 +1,5 @@
1
1
  import React__default from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  type FormSectionVariant = 'plain' | 'card';
4
5
  type FormSectionAccent = 'blue' | 'green';
@@ -17,7 +18,7 @@ interface FormSectionProps {
17
18
  contentClassName?: string;
18
19
  children: React__default.ReactNode;
19
20
  }
20
- declare function FormSection({ title, description, variant, accent, icon, iconKey, collapsible, defaultCollapsed, className, titleClassName, contentClassName, children, }: FormSectionProps): React__default.JSX.Element;
21
+ declare function FormSection({ title, description, variant, accent, icon, iconKey, collapsible, defaultCollapsed, className, titleClassName, contentClassName, children, }: FormSectionProps): react_jsx_runtime.JSX.Element;
21
22
 
22
23
  /** 字段行为状态 */
23
24
  type FieldBehavior = 'NORMAL' | 'READONLY' | 'DISABLED' | 'HIDDEN';
@@ -673,6 +674,7 @@ interface AttachmentFieldProps extends BaseFieldProps {
673
674
  showDownload?: boolean;
674
675
  showFileSize?: boolean;
675
676
  showFileTypeBadge?: boolean;
677
+ /** @deprecated Preview now opens in the runtime dialog; use ticket previewPageUrl for shareable links. */
676
678
  previewPagePath?: string;
677
679
  mobileDownloadMode?: 'auto' | 'direct' | 'ticketRelay';
678
680
  /** 图片附件的浏览器端压缩配置;非图片、GIF、SVG 会自动跳过。 */
@@ -1186,6 +1188,60 @@ interface StatusMeta {
1186
1188
  tone: 'brand' | 'success' | 'danger' | 'neutral' | 'warning';
1187
1189
  }
1188
1190
 
1191
+ type FilePreviewType = 'image' | 'video' | 'audio' | 'pdf' | 'spreadsheet' | 'text' | 'office' | 'download';
1192
+ type FilePreviewRenderMode = 'inline' | 'image-transcode' | 'image-heic' | 'pdfjs' | 'excel-basic' | 'excel-client' | 'text' | 'text-client' | 'docx-html' | 'onlyoffice' | 'office-text' | 'download';
1193
+ type FilePreviewSurface = 'media' | 'document' | 'download';
1194
+ type FilePreviewProvider = 'browser' | 'platform' | 'onlyoffice' | 'none';
1195
+ interface FilePreviewCapability {
1196
+ key?: string;
1197
+ extension?: string;
1198
+ previewType?: FilePreviewType;
1199
+ renderMode?: FilePreviewRenderMode;
1200
+ previewSurface?: FilePreviewSurface;
1201
+ previewProvider?: FilePreviewProvider;
1202
+ canPreview?: boolean;
1203
+ canDownload?: boolean;
1204
+ unsupportedReason?: string;
1205
+ }
1206
+ interface FilePreviewMetadata extends FilePreviewCapability {
1207
+ capabilityVersion?: number;
1208
+ ticket?: string;
1209
+ appType?: string;
1210
+ fileName?: string;
1211
+ bucketName?: string;
1212
+ objectName?: string;
1213
+ size?: number;
1214
+ contentType?: string;
1215
+ downloadUrl?: string;
1216
+ previewUrl?: string;
1217
+ previewPageUrl?: string;
1218
+ metadataUrl?: string;
1219
+ imagePreviewUrl?: string;
1220
+ excelPreviewUrl?: string;
1221
+ textPreviewUrl?: string;
1222
+ officeTextPreviewUrl?: string;
1223
+ onlyofficeConfigUrl?: string;
1224
+ onlyofficeEnabled?: boolean;
1225
+ expiresIn?: number;
1226
+ }
1227
+ interface PreparedFilePreview {
1228
+ item: AttachmentItem;
1229
+ metadata: FilePreviewMetadata;
1230
+ direct: boolean;
1231
+ }
1232
+ type FilePreviewRequest = FormRuntimeApi['request'];
1233
+ interface FilePreviewCapabilityBatch {
1234
+ capabilityVersion?: number;
1235
+ onlyofficeEnabled?: boolean;
1236
+ items?: FilePreviewCapability[];
1237
+ }
1238
+ interface PreviewImageItem {
1239
+ key: string;
1240
+ src: string;
1241
+ name: string;
1242
+ revokeOnClose?: boolean;
1243
+ }
1244
+
1189
1245
  interface ApprovalTimelineProps {
1190
1246
  tasks: ProcessTask[];
1191
1247
  className?: string;
@@ -1205,4 +1261,4 @@ interface ProcessPreviewProps {
1205
1261
  }
1206
1262
  declare const ProcessPreview: React__default.FC<ProcessPreviewProps>;
1207
1263
 
1208
- export { type DepartmentSelectFieldProps as $, type ApprovalPermission as A, type ReturnParams as B, type ChangeRecordQueryParams as C, type SaveTaskParams as D, type TransferParams as E, type FieldDefinition as F, type TextFieldProps as G, type TextAreaFieldProps as H, type InitiatorSelectCandidate as I, type SelectFieldProps as J, type RadioFieldProps as K, type CheckboxFieldProps as L, type MultiSelectFieldProps as M, type NumberFieldProps as N, type OptionItem as O, type ProcessStatus as P, type DateFieldProps as Q, type RuntimeResponse as R, type StatusMeta as S, type TaskStatus as T, type CascadeDateFieldProps as U, type ValidationPreset as V, type WithdrawParams as W, type AttachmentFieldProps as X, type ImageFieldProps as Y, type SubFormFieldProps as Z, type UserSelectFieldProps as _, type FormRuntimeApi as a, type PeopleShortcutConfig as a$, type CascadeSelectFieldProps as a0, type AddressFieldProps as a1, type AssociationFormFieldProps as a2, type EditorFieldProps as a3, type EditorChoiceOption as a4, type SerialNumberFieldProps as a5, type LocationFieldProps as a6, type DigitalSignatureFieldProps as a7, type JSONFieldProps as a8, type ProcessAction as a9, type DepartmentTreeNode as aA, type DigitalSignatureValue as aB, type EditorToolbarAction as aC, type FieldLayoutNode as aD, type FieldValueSyncConfig as aE, type FormEffectAction as aF, type FormEffectCondition as aG, type FormEffectConditionOperator as aH, type FormEngineMode as aI, type FormLayoutNode as aJ, FormSection as aK, type FormSectionProps as aL, type FormSubmitBehavior as aM, type FormTemplateConfig as aN, type GridLayoutCell as aO, type GridLayoutNode as aP, type ImageCompressionConfig as aQ, type ImageCompressionVariantConfig as aR, type ImageVariant as aS, type InitiatorSelectScope as aT, type LayoutVisibleWhen as aU, type LinkedFormOptionConfig as aV, type LocationValue as aW, type LowcodePageMeta as aX, type LowcodePageNode as aY, type LowcodePageNodeType as aZ, type OptionSourceType as a_, type InitiatorSelectedApprovers as aa, type ReturnPolicy as ab, type ChangeRecord as ac, type StandardFormPageMode as ad, type LowcodePageSchema as ae, type AddressValue as af, type ApprovalActionType as ag, ApprovalTimeline as ah, type ApprovalTimelineProps as ai, type AssociationFormConfig as aj, type AssociationValue as ak, type AttachmentImageVariants as al, type AttachmentItem as am, type BaseFieldProps as an, type BaseLayoutNode as ao, type DataFilter as ap, type DataLinkageCondition as aq, type DataLinkageConfig as ar, type DateRangeRestriction as as, type DateRestrictionConfig as at, type DateShortcutConfig as au, type DateShortcutType as av, type DefaultValueLinkageConfig as aw, type DepartmentSearchParams as ax, type DepartmentSearchResult as ay, type DepartmentSearchScope as az, type FormSchema as b, type PeopleShortcutType as b0, type ProcessNodeType as b1, ProcessPreview as b2, type ProcessPreviewProps as b3, type RuntimeAuthHeadersProvider as b4, type RuntimeDataQueryParams as b5, type RuntimeDataQueryResult as b6, type RuntimeRequestConfig as b7, type RuntimeUploadOptions as b8, type RuntimeUploadProvider as b9, type SectionLayoutNode as ba, type SignaturePoint as bb, type StepLayoutItem as bc, type StepsLayoutNode as bd, type SubFormColumn as be, type TabLayoutItem as bf, type TabsLayoutNode as bg, type TextShortcutConfig as bh, type TextShortcutType as bi, type UserDisplayFormat as bj, type UserItem as bk, type FormRuntimeApiConfig as c, type FormEngineConfig as d, type FieldBehavior as e, type FormRuntimeConfig as f, type FormAppearanceConfig as g, type ValidationRule as h, type FormEffect as i, type OptionSourceConfig as j, type FormDataDeleteParams as k, type ChangeRecordListResponse as l, type FormDataQueryParams as m, type FormInstanceData as n, type InitiatorSelectRequirement as o, type ProcessBasicInfo as p, type ProcessDefinition as q, type ProcessTask as r, type ReturnableNodeResult as s, type ReturnableNode as t, type ViewPermissionQueryParams as u, type ViewPermissionSummary as v, type ApproveParams as w, type PreviewParams as x, type ProcessRoute as y, type ResubmitParams as z };
1264
+ export { type FormDataDeleteParams as $, type AddressFieldProps as A, type BaseFieldProps as B, type CascadeDateFieldProps as C, type DataFilter as D, type DepartmentSearchParams as E, type DepartmentSearchResult as F, type DepartmentSearchScope as G, type DepartmentSelectFieldProps as H, type DepartmentTreeNode as I, type DigitalSignatureFieldProps as J, type DigitalSignatureValue as K, type EditorChoiceOption as L, type EditorFieldProps as M, type EditorToolbarAction as N, type FieldBehavior as O, type FieldDefinition as P, type FieldLayoutNode as Q, type FieldValueSyncConfig as R, type FilePreviewCapability as S, type FilePreviewCapabilityBatch as T, type FilePreviewMetadata as U, type FilePreviewProvider as V, type FilePreviewRenderMode as W, type FilePreviewRequest as X, type FilePreviewSurface as Y, type FilePreviewType as Z, type FormAppearanceConfig as _, type AddressValue as a, type RuntimeDataQueryResult as a$, type FormDataQueryParams as a0, type FormEffect as a1, type FormEffectAction as a2, type FormEffectCondition as a3, type FormEffectConditionOperator as a4, type FormEngineConfig as a5, type FormEngineMode as a6, type FormInstanceData as a7, type FormLayoutNode as a8, type FormRuntimeApi as a9, type MultiSelectFieldProps as aA, type NumberFieldProps as aB, type OptionItem as aC, type OptionSourceConfig as aD, type OptionSourceType as aE, type PeopleShortcutConfig as aF, type PeopleShortcutType as aG, type PreparedFilePreview as aH, type PreviewImageItem as aI, type PreviewParams as aJ, type ProcessAction as aK, type ProcessBasicInfo as aL, type ProcessDefinition as aM, type ProcessNodeType as aN, ProcessPreview as aO, type ProcessPreviewProps as aP, type ProcessRoute as aQ, type ProcessStatus as aR, type ProcessTask as aS, type RadioFieldProps as aT, type ResubmitParams as aU, type ReturnParams as aV, type ReturnPolicy as aW, type ReturnableNode as aX, type ReturnableNodeResult as aY, type RuntimeAuthHeadersProvider as aZ, type RuntimeDataQueryParams as a_, type FormRuntimeApiConfig as aa, type FormRuntimeConfig as ab, type FormSchema as ac, FormSection as ad, type FormSectionProps as ae, type FormSubmitBehavior as af, type FormTemplateConfig as ag, type GridLayoutCell as ah, type GridLayoutNode as ai, type ImageCompressionConfig as aj, type ImageCompressionVariantConfig as ak, type ImageFieldProps as al, type ImageVariant as am, type InitiatorSelectCandidate as an, type InitiatorSelectRequirement as ao, type InitiatorSelectScope as ap, type InitiatorSelectedApprovers as aq, type JSONFieldProps as ar, type LayoutVisibleWhen as as, type LinkedFormOptionConfig as at, type LocationFieldProps as au, type LocationValue as av, type LowcodePageMeta as aw, type LowcodePageNode as ax, type LowcodePageNodeType as ay, type LowcodePageSchema as az, type ApprovalActionType as b, type RuntimeRequestConfig as b0, type RuntimeResponse as b1, type RuntimeUploadOptions as b2, type RuntimeUploadProvider as b3, type SaveTaskParams as b4, type SectionLayoutNode as b5, type SelectFieldProps as b6, type SerialNumberFieldProps as b7, type SignaturePoint as b8, type StandardFormPageMode as b9, type StatusMeta as ba, type StepLayoutItem as bb, type StepsLayoutNode as bc, type SubFormColumn as bd, type SubFormFieldProps as be, type TabLayoutItem as bf, type TabsLayoutNode as bg, type TaskStatus as bh, type TextAreaFieldProps as bi, type TextFieldProps as bj, type TextShortcutConfig as bk, type TextShortcutType as bl, type TransferParams as bm, type UserDisplayFormat as bn, type UserItem as bo, type UserSelectFieldProps as bp, type ValidationPreset as bq, type ValidationRule as br, type ViewPermissionQueryParams as bs, type ViewPermissionSummary as bt, type WithdrawParams as bu, type ApprovalPermission as c, ApprovalTimeline as d, type ApprovalTimelineProps as e, type ApproveParams as f, type AssociationFormConfig as g, type AssociationFormFieldProps as h, type AssociationValue as i, type AttachmentFieldProps as j, type AttachmentImageVariants as k, type AttachmentItem as l, type BaseLayoutNode as m, type CascadeSelectFieldProps as n, type ChangeRecord as o, type ChangeRecordListResponse as p, type ChangeRecordQueryParams as q, type CheckboxFieldProps as r, type DataLinkageCondition as s, type DataLinkageConfig as t, type DateFieldProps as u, type DateRangeRestriction as v, type DateRestrictionConfig as w, type DateShortcutConfig as x, type DateShortcutType as y, type DefaultValueLinkageConfig as z };
@@ -1,4 +1,5 @@
1
1
  import React__default from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
4
  type FormSectionVariant = 'plain' | 'card';
4
5
  type FormSectionAccent = 'blue' | 'green';
@@ -17,7 +18,7 @@ interface FormSectionProps {
17
18
  contentClassName?: string;
18
19
  children: React__default.ReactNode;
19
20
  }
20
- declare function FormSection({ title, description, variant, accent, icon, iconKey, collapsible, defaultCollapsed, className, titleClassName, contentClassName, children, }: FormSectionProps): React__default.JSX.Element;
21
+ declare function FormSection({ title, description, variant, accent, icon, iconKey, collapsible, defaultCollapsed, className, titleClassName, contentClassName, children, }: FormSectionProps): react_jsx_runtime.JSX.Element;
21
22
 
22
23
  /** 字段行为状态 */
23
24
  type FieldBehavior = 'NORMAL' | 'READONLY' | 'DISABLED' | 'HIDDEN';
@@ -673,6 +674,7 @@ interface AttachmentFieldProps extends BaseFieldProps {
673
674
  showDownload?: boolean;
674
675
  showFileSize?: boolean;
675
676
  showFileTypeBadge?: boolean;
677
+ /** @deprecated Preview now opens in the runtime dialog; use ticket previewPageUrl for shareable links. */
676
678
  previewPagePath?: string;
677
679
  mobileDownloadMode?: 'auto' | 'direct' | 'ticketRelay';
678
680
  /** 图片附件的浏览器端压缩配置;非图片、GIF、SVG 会自动跳过。 */
@@ -1186,6 +1188,60 @@ interface StatusMeta {
1186
1188
  tone: 'brand' | 'success' | 'danger' | 'neutral' | 'warning';
1187
1189
  }
1188
1190
 
1191
+ type FilePreviewType = 'image' | 'video' | 'audio' | 'pdf' | 'spreadsheet' | 'text' | 'office' | 'download';
1192
+ type FilePreviewRenderMode = 'inline' | 'image-transcode' | 'image-heic' | 'pdfjs' | 'excel-basic' | 'excel-client' | 'text' | 'text-client' | 'docx-html' | 'onlyoffice' | 'office-text' | 'download';
1193
+ type FilePreviewSurface = 'media' | 'document' | 'download';
1194
+ type FilePreviewProvider = 'browser' | 'platform' | 'onlyoffice' | 'none';
1195
+ interface FilePreviewCapability {
1196
+ key?: string;
1197
+ extension?: string;
1198
+ previewType?: FilePreviewType;
1199
+ renderMode?: FilePreviewRenderMode;
1200
+ previewSurface?: FilePreviewSurface;
1201
+ previewProvider?: FilePreviewProvider;
1202
+ canPreview?: boolean;
1203
+ canDownload?: boolean;
1204
+ unsupportedReason?: string;
1205
+ }
1206
+ interface FilePreviewMetadata extends FilePreviewCapability {
1207
+ capabilityVersion?: number;
1208
+ ticket?: string;
1209
+ appType?: string;
1210
+ fileName?: string;
1211
+ bucketName?: string;
1212
+ objectName?: string;
1213
+ size?: number;
1214
+ contentType?: string;
1215
+ downloadUrl?: string;
1216
+ previewUrl?: string;
1217
+ previewPageUrl?: string;
1218
+ metadataUrl?: string;
1219
+ imagePreviewUrl?: string;
1220
+ excelPreviewUrl?: string;
1221
+ textPreviewUrl?: string;
1222
+ officeTextPreviewUrl?: string;
1223
+ onlyofficeConfigUrl?: string;
1224
+ onlyofficeEnabled?: boolean;
1225
+ expiresIn?: number;
1226
+ }
1227
+ interface PreparedFilePreview {
1228
+ item: AttachmentItem;
1229
+ metadata: FilePreviewMetadata;
1230
+ direct: boolean;
1231
+ }
1232
+ type FilePreviewRequest = FormRuntimeApi['request'];
1233
+ interface FilePreviewCapabilityBatch {
1234
+ capabilityVersion?: number;
1235
+ onlyofficeEnabled?: boolean;
1236
+ items?: FilePreviewCapability[];
1237
+ }
1238
+ interface PreviewImageItem {
1239
+ key: string;
1240
+ src: string;
1241
+ name: string;
1242
+ revokeOnClose?: boolean;
1243
+ }
1244
+
1189
1245
  interface ApprovalTimelineProps {
1190
1246
  tasks: ProcessTask[];
1191
1247
  className?: string;
@@ -1205,4 +1261,4 @@ interface ProcessPreviewProps {
1205
1261
  }
1206
1262
  declare const ProcessPreview: React__default.FC<ProcessPreviewProps>;
1207
1263
 
1208
- export { type DepartmentSelectFieldProps as $, type ApprovalPermission as A, type ReturnParams as B, type ChangeRecordQueryParams as C, type SaveTaskParams as D, type TransferParams as E, type FieldDefinition as F, type TextFieldProps as G, type TextAreaFieldProps as H, type InitiatorSelectCandidate as I, type SelectFieldProps as J, type RadioFieldProps as K, type CheckboxFieldProps as L, type MultiSelectFieldProps as M, type NumberFieldProps as N, type OptionItem as O, type ProcessStatus as P, type DateFieldProps as Q, type RuntimeResponse as R, type StatusMeta as S, type TaskStatus as T, type CascadeDateFieldProps as U, type ValidationPreset as V, type WithdrawParams as W, type AttachmentFieldProps as X, type ImageFieldProps as Y, type SubFormFieldProps as Z, type UserSelectFieldProps as _, type FormRuntimeApi as a, type PeopleShortcutConfig as a$, type CascadeSelectFieldProps as a0, type AddressFieldProps as a1, type AssociationFormFieldProps as a2, type EditorFieldProps as a3, type EditorChoiceOption as a4, type SerialNumberFieldProps as a5, type LocationFieldProps as a6, type DigitalSignatureFieldProps as a7, type JSONFieldProps as a8, type ProcessAction as a9, type DepartmentTreeNode as aA, type DigitalSignatureValue as aB, type EditorToolbarAction as aC, type FieldLayoutNode as aD, type FieldValueSyncConfig as aE, type FormEffectAction as aF, type FormEffectCondition as aG, type FormEffectConditionOperator as aH, type FormEngineMode as aI, type FormLayoutNode as aJ, FormSection as aK, type FormSectionProps as aL, type FormSubmitBehavior as aM, type FormTemplateConfig as aN, type GridLayoutCell as aO, type GridLayoutNode as aP, type ImageCompressionConfig as aQ, type ImageCompressionVariantConfig as aR, type ImageVariant as aS, type InitiatorSelectScope as aT, type LayoutVisibleWhen as aU, type LinkedFormOptionConfig as aV, type LocationValue as aW, type LowcodePageMeta as aX, type LowcodePageNode as aY, type LowcodePageNodeType as aZ, type OptionSourceType as a_, type InitiatorSelectedApprovers as aa, type ReturnPolicy as ab, type ChangeRecord as ac, type StandardFormPageMode as ad, type LowcodePageSchema as ae, type AddressValue as af, type ApprovalActionType as ag, ApprovalTimeline as ah, type ApprovalTimelineProps as ai, type AssociationFormConfig as aj, type AssociationValue as ak, type AttachmentImageVariants as al, type AttachmentItem as am, type BaseFieldProps as an, type BaseLayoutNode as ao, type DataFilter as ap, type DataLinkageCondition as aq, type DataLinkageConfig as ar, type DateRangeRestriction as as, type DateRestrictionConfig as at, type DateShortcutConfig as au, type DateShortcutType as av, type DefaultValueLinkageConfig as aw, type DepartmentSearchParams as ax, type DepartmentSearchResult as ay, type DepartmentSearchScope as az, type FormSchema as b, type PeopleShortcutType as b0, type ProcessNodeType as b1, ProcessPreview as b2, type ProcessPreviewProps as b3, type RuntimeAuthHeadersProvider as b4, type RuntimeDataQueryParams as b5, type RuntimeDataQueryResult as b6, type RuntimeRequestConfig as b7, type RuntimeUploadOptions as b8, type RuntimeUploadProvider as b9, type SectionLayoutNode as ba, type SignaturePoint as bb, type StepLayoutItem as bc, type StepsLayoutNode as bd, type SubFormColumn as be, type TabLayoutItem as bf, type TabsLayoutNode as bg, type TextShortcutConfig as bh, type TextShortcutType as bi, type UserDisplayFormat as bj, type UserItem as bk, type FormRuntimeApiConfig as c, type FormEngineConfig as d, type FieldBehavior as e, type FormRuntimeConfig as f, type FormAppearanceConfig as g, type ValidationRule as h, type FormEffect as i, type OptionSourceConfig as j, type FormDataDeleteParams as k, type ChangeRecordListResponse as l, type FormDataQueryParams as m, type FormInstanceData as n, type InitiatorSelectRequirement as o, type ProcessBasicInfo as p, type ProcessDefinition as q, type ProcessTask as r, type ReturnableNodeResult as s, type ReturnableNode as t, type ViewPermissionQueryParams as u, type ViewPermissionSummary as v, type ApproveParams as w, type PreviewParams as x, type ProcessRoute as y, type ResubmitParams as z };
1264
+ export { type FormDataDeleteParams as $, type AddressFieldProps as A, type BaseFieldProps as B, type CascadeDateFieldProps as C, type DataFilter as D, type DepartmentSearchParams as E, type DepartmentSearchResult as F, type DepartmentSearchScope as G, type DepartmentSelectFieldProps as H, type DepartmentTreeNode as I, type DigitalSignatureFieldProps as J, type DigitalSignatureValue as K, type EditorChoiceOption as L, type EditorFieldProps as M, type EditorToolbarAction as N, type FieldBehavior as O, type FieldDefinition as P, type FieldLayoutNode as Q, type FieldValueSyncConfig as R, type FilePreviewCapability as S, type FilePreviewCapabilityBatch as T, type FilePreviewMetadata as U, type FilePreviewProvider as V, type FilePreviewRenderMode as W, type FilePreviewRequest as X, type FilePreviewSurface as Y, type FilePreviewType as Z, type FormAppearanceConfig as _, type AddressValue as a, type RuntimeDataQueryResult as a$, type FormDataQueryParams as a0, type FormEffect as a1, type FormEffectAction as a2, type FormEffectCondition as a3, type FormEffectConditionOperator as a4, type FormEngineConfig as a5, type FormEngineMode as a6, type FormInstanceData as a7, type FormLayoutNode as a8, type FormRuntimeApi as a9, type MultiSelectFieldProps as aA, type NumberFieldProps as aB, type OptionItem as aC, type OptionSourceConfig as aD, type OptionSourceType as aE, type PeopleShortcutConfig as aF, type PeopleShortcutType as aG, type PreparedFilePreview as aH, type PreviewImageItem as aI, type PreviewParams as aJ, type ProcessAction as aK, type ProcessBasicInfo as aL, type ProcessDefinition as aM, type ProcessNodeType as aN, ProcessPreview as aO, type ProcessPreviewProps as aP, type ProcessRoute as aQ, type ProcessStatus as aR, type ProcessTask as aS, type RadioFieldProps as aT, type ResubmitParams as aU, type ReturnParams as aV, type ReturnPolicy as aW, type ReturnableNode as aX, type ReturnableNodeResult as aY, type RuntimeAuthHeadersProvider as aZ, type RuntimeDataQueryParams as a_, type FormRuntimeApiConfig as aa, type FormRuntimeConfig as ab, type FormSchema as ac, FormSection as ad, type FormSectionProps as ae, type FormSubmitBehavior as af, type FormTemplateConfig as ag, type GridLayoutCell as ah, type GridLayoutNode as ai, type ImageCompressionConfig as aj, type ImageCompressionVariantConfig as ak, type ImageFieldProps as al, type ImageVariant as am, type InitiatorSelectCandidate as an, type InitiatorSelectRequirement as ao, type InitiatorSelectScope as ap, type InitiatorSelectedApprovers as aq, type JSONFieldProps as ar, type LayoutVisibleWhen as as, type LinkedFormOptionConfig as at, type LocationFieldProps as au, type LocationValue as av, type LowcodePageMeta as aw, type LowcodePageNode as ax, type LowcodePageNodeType as ay, type LowcodePageSchema as az, type ApprovalActionType as b, type RuntimeRequestConfig as b0, type RuntimeResponse as b1, type RuntimeUploadOptions as b2, type RuntimeUploadProvider as b3, type SaveTaskParams as b4, type SectionLayoutNode as b5, type SelectFieldProps as b6, type SerialNumberFieldProps as b7, type SignaturePoint as b8, type StandardFormPageMode as b9, type StatusMeta as ba, type StepLayoutItem as bb, type StepsLayoutNode as bc, type SubFormColumn as bd, type SubFormFieldProps as be, type TabLayoutItem as bf, type TabsLayoutNode as bg, type TaskStatus as bh, type TextAreaFieldProps as bi, type TextFieldProps as bj, type TextShortcutConfig as bk, type TextShortcutType as bl, type TransferParams as bm, type UserDisplayFormat as bn, type UserItem as bo, type UserSelectFieldProps as bp, type ValidationPreset as bq, type ValidationRule as br, type ViewPermissionQueryParams as bs, type ViewPermissionSummary as bt, type WithdrawParams as bu, type ApprovalPermission as c, ApprovalTimeline as d, type ApprovalTimelineProps as e, type ApproveParams as f, type AssociationFormConfig as g, type AssociationFormFieldProps as h, type AssociationValue as i, type AttachmentFieldProps as j, type AttachmentImageVariants as k, type AttachmentItem as l, type BaseLayoutNode as m, type CascadeSelectFieldProps as n, type ChangeRecord as o, type ChangeRecordListResponse as p, type ChangeRecordQueryParams as q, type CheckboxFieldProps as r, type DataLinkageCondition as s, type DataLinkageConfig as t, type DateFieldProps as u, type DateRangeRestriction as v, type DateRestrictionConfig as w, type DateShortcutConfig as x, type DateShortcutType as y, type DefaultValueLinkageConfig as z };