@rytass/bpm-core-react 0.21.0 → 0.21.2

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 (108) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunks/{FormBuilderView-WtC2iW5f.js → FormBuilderView-6KdApi-D.js} +8 -8
  3. package/dist/chunks/{FormBuilderView-WtC2iW5f.js.map → FormBuilderView-6KdApi-D.js.map} +1 -1
  4. package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs → FormBuilderView-CGKkuVFi.cjs} +3 -3
  5. package/dist/chunks/{FormBuilderView-DjPGrOJ2.cjs.map → FormBuilderView-CGKkuVFi.cjs.map} +1 -1
  6. package/dist/chunks/{approval-instance-list-page-Bth7Raya.js → approval-instance-list-page-BI5fIXc-.js} +26 -26
  7. package/dist/chunks/{approval-instance-list-page-Bth7Raya.js.map → approval-instance-list-page-BI5fIXc-.js.map} +1 -1
  8. package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs → approval-instance-list-page-Cv5I1YPX.cjs} +2 -2
  9. package/dist/chunks/{approval-instance-list-page-Dcvo6TrT.cjs.map → approval-instance-list-page-Cv5I1YPX.cjs.map} +1 -1
  10. package/dist/chunks/compose-CtWuunwB.cjs +2 -0
  11. package/dist/chunks/compose-CtWuunwB.cjs.map +1 -0
  12. package/dist/chunks/{compose-DZvIspW3.js → compose-M-GR6smM.js} +4 -4
  13. package/dist/chunks/{compose-DZvIspW3.js.map → compose-M-GR6smM.js.map} +1 -1
  14. package/dist/chunks/{designer-CWubIE69.js → designer-BnMeiMVe.js} +2192 -1609
  15. package/dist/chunks/designer-BnMeiMVe.js.map +1 -0
  16. package/dist/chunks/designer-D6fCDq_q.cjs +69 -0
  17. package/dist/chunks/designer-D6fCDq_q.cjs.map +1 -0
  18. package/dist/chunks/detail-C5KrUC7s.cjs +5 -0
  19. package/dist/chunks/detail-C5KrUC7s.cjs.map +1 -0
  20. package/dist/chunks/{detail-Bv90gvy0.js → detail-Dnc4PPWO.js} +768 -742
  21. package/dist/chunks/detail-Dnc4PPWO.js.map +1 -0
  22. package/dist/chunks/{instance-error-message-CAP1vJhX.js → instance-error-message-BEM4O_Kj.js} +6 -2
  23. package/dist/chunks/instance-error-message-BEM4O_Kj.js.map +1 -0
  24. package/dist/chunks/instance-error-message-BpCLCOjp.cjs +2 -0
  25. package/dist/chunks/instance-error-message-BpCLCOjp.cjs.map +1 -0
  26. package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs +2 -0
  27. package/dist/chunks/organization-time-zone-provider-B7CXQril.cjs.map +1 -0
  28. package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js +42 -0
  29. package/dist/chunks/organization-time-zone-provider-DNL8yo4-.js.map +1 -0
  30. package/dist/chunks/{providers-BbCs23sk.js → providers-CQWekD7_.js} +197 -196
  31. package/dist/chunks/providers-CQWekD7_.js.map +1 -0
  32. package/dist/chunks/providers-VUOh6i0i.cjs +2 -0
  33. package/dist/chunks/providers-VUOh6i0i.cjs.map +1 -0
  34. package/dist/components/notification-drawer-options.d.cts +18 -0
  35. package/dist/components/notification-drawer-options.d.ts +18 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +1 -0
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +23 -23
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/organization-time-zone-provider.d.cts +20 -0
  43. package/dist/lib/organization-time-zone-provider.d.ts +20 -0
  44. package/dist/lib/organization-time-zone.d.cts +8 -0
  45. package/dist/lib/organization-time-zone.d.ts +8 -0
  46. package/dist/lib/providers.d.cts +10 -1
  47. package/dist/lib/providers.d.ts +10 -1
  48. package/dist/next/BPMNextProviders.d.cts +8 -1
  49. package/dist/next/BPMNextProviders.d.ts +8 -1
  50. package/dist/next/index.cjs +1 -1
  51. package/dist/next/index.cjs.map +1 -1
  52. package/dist/next/index.js +12 -11
  53. package/dist/next/index.js.map +1 -1
  54. package/dist/pages/instances/detail/index.cjs +1 -1
  55. package/dist/pages/instances/detail/index.js +1 -1
  56. package/dist/pages/templates/compose/index.cjs +1 -1
  57. package/dist/pages/templates/compose/index.js +1 -1
  58. package/dist/pages/templates/designer/index.cjs +1 -1
  59. package/dist/pages/templates/designer/index.js +1 -1
  60. package/dist/views/cc/index.cjs +1 -1
  61. package/dist/views/cc/index.js +1 -1
  62. package/dist/views/forms/builder/index.cjs +1 -1
  63. package/dist/views/forms/builder/index.js +1 -1
  64. package/dist/views/instances/detail/index.cjs +1 -1
  65. package/dist/views/instances/detail/index.js +1 -1
  66. package/dist/views/instances/detail/sections/shared.d.cts +0 -1
  67. package/dist/views/instances/detail/sections/shared.d.ts +0 -1
  68. package/dist/views/instances/new/index.cjs +1 -1
  69. package/dist/views/instances/new/index.js +1 -1
  70. package/dist/views/search/index.cjs +1 -1
  71. package/dist/views/search/index.js +1 -1
  72. package/dist/views/sent/index.cjs +1 -1
  73. package/dist/views/sent/index.js +1 -1
  74. package/dist/views/templates/compose/index.cjs +1 -1
  75. package/dist/views/templates/compose/index.js +1 -1
  76. package/dist/views/templates/designer/approver-resolver-model.d.cts +105 -1
  77. package/dist/views/templates/designer/approver-resolver-model.d.ts +105 -1
  78. package/dist/views/templates/designer/dynamic-form-resolver-options.d.cts +5 -0
  79. package/dist/views/templates/designer/dynamic-form-resolver-options.d.ts +5 -0
  80. package/dist/views/templates/designer/index.cjs +1 -1
  81. package/dist/views/templates/designer/index.js +1 -1
  82. package/dist/views/templates/designer/node-actor-resolver-options.d.cts +44 -1
  83. package/dist/views/templates/designer/node-actor-resolver-options.d.ts +44 -1
  84. package/dist/views/templates/designer/notify-recipient-options.d.cts +81 -0
  85. package/dist/views/templates/designer/notify-recipient-options.d.ts +81 -0
  86. package/dist/views/templates/designer/position-level-options.d.cts +3 -1
  87. package/dist/views/templates/designer/position-level-options.d.ts +3 -1
  88. package/dist/views/templates/designer/position-scope.d.cts +51 -0
  89. package/dist/views/templates/designer/position-scope.d.ts +51 -0
  90. package/package.json +3 -3
  91. package/dist/chunks/compose-BKUTsB2W.cjs +0 -2
  92. package/dist/chunks/compose-BKUTsB2W.cjs.map +0 -1
  93. package/dist/chunks/designer-CWubIE69.js.map +0 -1
  94. package/dist/chunks/designer-C_m8DmMl.cjs +0 -69
  95. package/dist/chunks/designer-C_m8DmMl.cjs.map +0 -1
  96. package/dist/chunks/detail-Bv90gvy0.js.map +0 -1
  97. package/dist/chunks/detail-DNzqesdI.cjs +0 -5
  98. package/dist/chunks/detail-DNzqesdI.cjs.map +0 -1
  99. package/dist/chunks/instance-error-message-BW464LRQ.cjs +0 -2
  100. package/dist/chunks/instance-error-message-BW464LRQ.cjs.map +0 -1
  101. package/dist/chunks/instance-error-message-CAP1vJhX.js.map +0 -1
  102. package/dist/chunks/language-provider-Bdnx3Gxl.cjs +0 -2
  103. package/dist/chunks/language-provider-Bdnx3Gxl.cjs.map +0 -1
  104. package/dist/chunks/language-provider-phkWOapf.js +0 -17
  105. package/dist/chunks/language-provider-phkWOapf.js.map +0 -1
  106. package/dist/chunks/providers-BbCs23sk.js.map +0 -1
  107. package/dist/chunks/providers-D_KAgOOu.cjs +0 -2
  108. package/dist/chunks/providers-D_KAgOOu.cjs.map +0 -1
@@ -11,6 +11,14 @@ interface ProvidersProps {
11
11
  * Independent of `locale`, which only formats calendar dates.
12
12
  */
13
13
  readonly language?: BPMLanguage;
14
+ /**
15
+ * IANA zone in which BPM views read "today" against organization effective
16
+ * dates. Pass the same value given to `BPMRootModule` as
17
+ * `organizationTimeZone`; leave it unset when the API does not set one.
18
+ * Defaults to `DEFAULT_BPM_ORGANIZATION_TIME_ZONE` (`'Asia/Taipei'`); an
19
+ * unknown zone falls back to it with a console warning.
20
+ */
21
+ readonly organizationTimeZone?: string;
14
22
  /**
15
23
  * Public paths that should not trigger redirect to `/login` when there
16
24
  * is no session. Forwarded to `<AuthProvider>`. Defaults to `['/login']`.
@@ -24,6 +32,7 @@ interface ProvidersProps {
24
32
  *
25
33
  * - Mezzanine UI calendar locale (moment-based, `ZH_TW` by default)
26
34
  * - `<BPMLanguageProvider>` (message language, `'zh-TW'` by default)
35
+ * - `<BPMOrganizationTimeZoneProvider>` (organization "today" zone)
27
36
  * - `<AuthProvider>` (BPM session via REST `/auth/*`)
28
37
  * - `<NotificationUnreadProvider>` (polls unread count)
29
38
  * - `<NotificationDrawerProvider>` (controls drawer open/close state)
@@ -35,5 +44,5 @@ interface ProvidersProps {
35
44
  * by the `pages/*` subpath shims when consuming via Next.js, or wired by
36
45
  * hand for other frameworks).
37
46
  */
38
- export declare function Providers({ children, locale, language, publicPaths, loginPath, }: ProvidersProps): ReactElement;
47
+ export declare function Providers({ children, locale, language, organizationTimeZone, publicPaths, loginPath, }: ProvidersProps): ReactElement;
39
48
  export {};
@@ -13,6 +13,13 @@ export interface BPMNextProvidersProps {
13
13
  * `<Providers>`. Defaults to `'zh-TW'`.
14
14
  */
15
15
  readonly language?: BPMLanguage;
16
+ /**
17
+ * IANA zone in which BPM views read "today" against organization effective
18
+ * dates — the `organizationTimeZone` given to `BPMRootModule`. Forwarded to
19
+ * the inner `<Providers>`. Defaults to `'Asia/Taipei'`
20
+ * (`DEFAULT_BPM_ORGANIZATION_TIME_ZONE`).
21
+ */
22
+ readonly organizationTimeZone?: string;
16
23
  /**
17
24
  * Routes that must remain accessible without a BPM session — visiting
18
25
  * these does not redirect to `loginPath` even when `member` is null.
@@ -54,4 +61,4 @@ export interface BPMNextProvidersProps {
54
61
  * (BPM internal navigation), additionally wrap with
55
62
  * `<BPMRoutesProvider>` exported from the same subpath.
56
63
  */
57
- export declare function BPMNextProviders({ children, locale, language, publicPaths, loginPath, }: BPMNextProvidersProps): ReactElement;
64
+ export declare function BPMNextProviders({ children, locale, language, organizationTimeZone, publicPaths, loginPath, }: BPMNextProvidersProps): ReactElement;
@@ -13,6 +13,13 @@ export interface BPMNextProvidersProps {
13
13
  * `<Providers>`. Defaults to `'zh-TW'`.
14
14
  */
15
15
  readonly language?: BPMLanguage;
16
+ /**
17
+ * IANA zone in which BPM views read "today" against organization effective
18
+ * dates — the `organizationTimeZone` given to `BPMRootModule`. Forwarded to
19
+ * the inner `<Providers>`. Defaults to `'Asia/Taipei'`
20
+ * (`DEFAULT_BPM_ORGANIZATION_TIME_ZONE`).
21
+ */
22
+ readonly organizationTimeZone?: string;
16
23
  /**
17
24
  * Routes that must remain accessible without a BPM session — visiting
18
25
  * these does not redirect to `loginPath` even when `member` is null.
@@ -54,4 +61,4 @@ export interface BPMNextProvidersProps {
54
61
  * (BPM internal navigation), additionally wrap with
55
62
  * `<BPMRoutesProvider>` exported from the same subpath.
56
63
  */
57
- export declare function BPMNextProviders({ children, locale, language, publicPaths, loginPath, }: BPMNextProvidersProps): ReactElement;
64
+ export declare function BPMNextProviders({ children, locale, language, organizationTimeZone, publicPaths, loginPath, }: BPMNextProvidersProps): ReactElement;
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../chunks/providers-D_KAgOOu.cjs"),t=require("../chunks/router-adapter--gYs13E8.cjs"),n=require("../chunks/routes-config-C1j_vFKo.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("next/navigation");function o({children:n,locale:o,language:s,publicPaths:c,loginPath:l}){let u=(0,a.useRouter)(),d=(0,a.usePathname)(),f=(0,r.useMemo)(()=>({pathname:d,push:e=>u.push(e),replace:e=>u.replace(e),back:()=>u.back(),searchParams:()=>t.n()}),[u,d]);return(0,i.jsx)(t.t,{value:f,children:(0,i.jsx)(e.t,{locale:o,language:s,publicPaths:c,loginPath:l,children:n})})}exports.BPMNextProviders=o,exports.BPMRoutesProvider=n.t,exports.createDefaultBPMRoutes=n.n,exports.useBPMRoutes=n.r;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../chunks/providers-VUOh6i0i.cjs"),t=require("../chunks/router-adapter--gYs13E8.cjs"),n=require("../chunks/routes-config-C1j_vFKo.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("next/navigation");function o({children:n,locale:o,language:s,organizationTimeZone:c,publicPaths:l,loginPath:u}){let d=(0,a.useRouter)(),f=(0,a.usePathname)(),p=(0,r.useMemo)(()=>({pathname:f,push:e=>d.push(e),replace:e=>d.replace(e),back:()=>d.back(),searchParams:()=>t.n()}),[d,f]);return(0,i.jsx)(t.t,{value:p,children:(0,i.jsx)(e.t,{locale:o,language:s,organizationTimeZone:c,publicPaths:l,loginPath:u,children:n})})}exports.BPMNextProviders=o,exports.BPMRoutesProvider=n.t,exports.createDefaultBPMRoutes=n.n,exports.useBPMRoutes=n.r;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["useRouter","usePathname","useMemo","defaultBrowserSearchParams","RouterAdapterProvider","BPMProviders","require_providers","require_router_adapter","require_routes_config","react","react_jsx_runtime","next_navigation","BPMNextProviders","nextRouter","pathname","adapter","href"],"sources":["../../src/next/BPMNextProviders.tsx"],"sourcesContent":["'use client';\n\n// One-line Next.js App Router shim for BPM. Reads `next/navigation`\n// router/pathname hooks, builds a `RouterAdapter`, then composes\n// `<RouterAdapterProvider>` and the shared `<BPMProviders>`.\n//\n// IMPORTANT: This component intentionally does NOT call\n// `useSearchParams()`. Doing so triggers Next.js's CSR bailout at static\n// prerender, and any `<Suspense fallback={null}>` we wrap around it then\n// erases `<RouterAdapterProvider>` from the SSR/hydration tree — leaving\n// every BPM view to throw \"must be used inside <RouterAdapterProvider>\"\n// when it mounts. None of the shipped BPM views consume\n// `RouterAdapter.searchParams()` anyway; hosts that need reactive query\n// string state should call Next's `useSearchParams()` directly in their\n// page (with their own Suspense). The lazy default getter below is\n// good enough for read-on-demand callers.\n\nimport { useMemo, type ReactElement, type ReactNode } from 'react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport type { CalendarLocale } from '@mezzanine-ui/react/moment';\nimport type { BPMLanguage } from '../lib/language-provider';\nimport { Providers as BPMProviders } from '../lib/providers';\nimport {\n RouterAdapterProvider,\n defaultBrowserSearchParams,\n type RouterAdapter,\n} from '../lib/router-adapter';\n\nexport interface BPMNextProvidersProps {\n readonly children: ReactNode;\n /**\n * Override the Mezzanine calendar locale. Forwarded to the inner\n * `<Providers>`. Defaults to `CalendarLocale.ZH_TW`.\n */\n readonly locale?: CalendarLocale;\n /**\n * Language BPM views write their messages in. Forwarded to the inner\n * `<Providers>`. Defaults to `'zh-TW'`.\n */\n readonly language?: BPMLanguage;\n /**\n * Routes that must remain accessible without a BPM session — visiting\n * these does not redirect to `loginPath` even when `member` is null.\n * Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n *\n * Hosts that mount BPM under a non-root prefix (see\n * `<BPMRoutesProvider>`) should typically expand this to include their\n * own auth-bypass paths.\n */\n readonly publicPaths?: readonly string[];\n /**\n * Where to redirect unauthenticated users. Forwarded to\n * `<AuthProvider>`. Defaults to `'/login'`. Hosts owning their own\n * login route (the recommended case) override this to their host\n * route, e.g. `'/auth/sign-in'`.\n */\n readonly loginPath?: string;\n}\n\n/**\n * One-line Next.js App Router shim for the full BPM provider stack.\n * Mounts in the host's root layout (or layout for the BPM sub-tree):\n *\n * ```tsx\n * import { BPMNextProviders } from '@rytass/bpm-core-react/next';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html><body>\n * <BPMNextProviders loginPath=\"/auth/sign-in\">\n * {children}\n * </BPMNextProviders>\n * </body></html>\n * );\n * }\n * ```\n *\n * Forwards every prop on {@link BPMNextProvidersProps} to the inner\n * `<Providers>` and `<AuthProvider>`. For per-feature path remapping\n * (BPM internal navigation), additionally wrap with\n * `<BPMRoutesProvider>` exported from the same subpath.\n */\nexport function BPMNextProviders({\n children,\n locale,\n language,\n publicPaths,\n loginPath,\n}: BPMNextProvidersProps): ReactElement {\n const nextRouter = useRouter();\n const pathname = usePathname();\n\n const adapter = useMemo<RouterAdapter>(\n () => ({\n pathname,\n push: (href: string): void => nextRouter.push(href),\n replace: (href: string): void => nextRouter.replace(href),\n back: (): void => nextRouter.back(),\n searchParams: (): URLSearchParams => defaultBrowserSearchParams(),\n }),\n [nextRouter, pathname],\n );\n\n return (\n <RouterAdapterProvider value={adapter}>\n <BPMProviders\n locale={locale}\n language={language}\n publicPaths={publicPaths}\n loginPath={loginPath}\n >\n {children}\n </BPMProviders>\n </RouterAdapterProvider>\n );\n}\n"],"mappings":"A,4TAkFA,SAAgBY,EAAiB,CAC/B,WACA,SACA,WACA,cACA,aACsC,CACtC,IAAMC,GAAA,EAAab,EAAAA,UAAAA,CAAU,EACvBc,GAAA,EAAWb,EAAAA,YAAAA,CAAY,EAEvBc,GAAA,EAAUb,EAAAA,QAAAA,MACP,CACL,WACA,KAAO,GAAuBW,EAAW,KAAKG,CAAI,EAClD,QAAU,GAAuBH,EAAW,QAAQG,CAAI,EACxD,SAAkBH,EAAW,KAAK,EAClC,iBAAqCV,EAAAA,EAA2B,CAClE,GACA,CAACU,EAAYC,CAAQ,CACvB,EAEA,OACE,EAAAJ,EAAA,IAAA,CAACN,EAAAA,EAAD,CAAuB,MAAOW,EAC5B,UAAA,EAAAL,EAAA,IAAA,CAACL,EAAAA,EAAD,CACU,SACE,WACG,cACF,YAEV,UACW,CAAA,CACO,CAAA,CAE3B,C"}
1
+ {"version":3,"file":"index.cjs","names":["useRouter","usePathname","useMemo","defaultBrowserSearchParams","RouterAdapterProvider","BPMProviders","require_providers","require_router_adapter","require_routes_config","react","react_jsx_runtime","next_navigation","BPMNextProviders","nextRouter","pathname","adapter","href"],"sources":["../../src/next/BPMNextProviders.tsx"],"sourcesContent":["'use client';\n\n// One-line Next.js App Router shim for BPM. Reads `next/navigation`\n// router/pathname hooks, builds a `RouterAdapter`, then composes\n// `<RouterAdapterProvider>` and the shared `<BPMProviders>`.\n//\n// IMPORTANT: This component intentionally does NOT call\n// `useSearchParams()`. Doing so triggers Next.js's CSR bailout at static\n// prerender, and any `<Suspense fallback={null}>` we wrap around it then\n// erases `<RouterAdapterProvider>` from the SSR/hydration tree — leaving\n// every BPM view to throw \"must be used inside <RouterAdapterProvider>\"\n// when it mounts. None of the shipped BPM views consume\n// `RouterAdapter.searchParams()` anyway; hosts that need reactive query\n// string state should call Next's `useSearchParams()` directly in their\n// page (with their own Suspense). The lazy default getter below is\n// good enough for read-on-demand callers.\n\nimport { useMemo, type ReactElement, type ReactNode } from 'react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport type { CalendarLocale } from '@mezzanine-ui/react/moment';\nimport type { BPMLanguage } from '../lib/language-provider';\nimport { Providers as BPMProviders } from '../lib/providers';\nimport {\n RouterAdapterProvider,\n defaultBrowserSearchParams,\n type RouterAdapter,\n} from '../lib/router-adapter';\n\nexport interface BPMNextProvidersProps {\n readonly children: ReactNode;\n /**\n * Override the Mezzanine calendar locale. Forwarded to the inner\n * `<Providers>`. Defaults to `CalendarLocale.ZH_TW`.\n */\n readonly locale?: CalendarLocale;\n /**\n * Language BPM views write their messages in. Forwarded to the inner\n * `<Providers>`. Defaults to `'zh-TW'`.\n */\n readonly language?: BPMLanguage;\n /**\n * IANA zone in which BPM views read \"today\" against organization effective\n * dates — the `organizationTimeZone` given to `BPMRootModule`. Forwarded to\n * the inner `<Providers>`. Defaults to `'Asia/Taipei'`\n * (`DEFAULT_BPM_ORGANIZATION_TIME_ZONE`).\n */\n readonly organizationTimeZone?: string;\n /**\n * Routes that must remain accessible without a BPM session — visiting\n * these does not redirect to `loginPath` even when `member` is null.\n * Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n *\n * Hosts that mount BPM under a non-root prefix (see\n * `<BPMRoutesProvider>`) should typically expand this to include their\n * own auth-bypass paths.\n */\n readonly publicPaths?: readonly string[];\n /**\n * Where to redirect unauthenticated users. Forwarded to\n * `<AuthProvider>`. Defaults to `'/login'`. Hosts owning their own\n * login route (the recommended case) override this to their host\n * route, e.g. `'/auth/sign-in'`.\n */\n readonly loginPath?: string;\n}\n\n/**\n * One-line Next.js App Router shim for the full BPM provider stack.\n * Mounts in the host's root layout (or layout for the BPM sub-tree):\n *\n * ```tsx\n * import { BPMNextProviders } from '@rytass/bpm-core-react/next';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html><body>\n * <BPMNextProviders loginPath=\"/auth/sign-in\">\n * {children}\n * </BPMNextProviders>\n * </body></html>\n * );\n * }\n * ```\n *\n * Forwards every prop on {@link BPMNextProvidersProps} to the inner\n * `<Providers>` and `<AuthProvider>`. For per-feature path remapping\n * (BPM internal navigation), additionally wrap with\n * `<BPMRoutesProvider>` exported from the same subpath.\n */\nexport function BPMNextProviders({\n children,\n locale,\n language,\n organizationTimeZone,\n publicPaths,\n loginPath,\n}: BPMNextProvidersProps): ReactElement {\n const nextRouter = useRouter();\n const pathname = usePathname();\n\n const adapter = useMemo<RouterAdapter>(\n () => ({\n pathname,\n push: (href: string): void => nextRouter.push(href),\n replace: (href: string): void => nextRouter.replace(href),\n back: (): void => nextRouter.back(),\n searchParams: (): URLSearchParams => defaultBrowserSearchParams(),\n }),\n [nextRouter, pathname],\n );\n\n return (\n <RouterAdapterProvider value={adapter}>\n <BPMProviders\n locale={locale}\n language={language}\n organizationTimeZone={organizationTimeZone}\n publicPaths={publicPaths}\n loginPath={loginPath}\n >\n {children}\n </BPMProviders>\n </RouterAdapterProvider>\n );\n}\n"],"mappings":"A,4TAyFA,SAAgBY,EAAiB,CAC/B,WACA,SACA,WACA,uBACA,cACA,aACsC,CACtC,IAAMC,GAAA,EAAab,EAAAA,UAAAA,CAAU,EACvBc,GAAA,EAAWb,EAAAA,YAAAA,CAAY,EAEvBc,GAAA,EAAUb,EAAAA,QAAAA,MACP,CACL,WACA,KAAO,GAAuBW,EAAW,KAAKG,CAAI,EAClD,QAAU,GAAuBH,EAAW,QAAQG,CAAI,EACxD,SAAkBH,EAAW,KAAK,EAClC,iBAAqCV,EAAAA,EAA2B,CAClE,GACA,CAACU,EAAYC,CAAQ,CACvB,EAEA,OACE,EAAAJ,EAAA,IAAA,CAACN,EAAAA,EAAD,CAAuB,MAAOW,EAC5B,UAAA,EAAAL,EAAA,IAAA,CAACL,EAAAA,EAAD,CACU,SACE,WACY,uBACT,cACF,YAEV,UACW,CAAA,CACO,CAAA,CAE3B,C"}
@@ -1,26 +1,27 @@
1
1
  "use client";
2
- import { t as e } from "../chunks/providers-BbCs23sk.js";
2
+ import { t as e } from "../chunks/providers-CQWekD7_.js";
3
3
  import { n as t, t as n } from "../chunks/router-adapter-CkxCyzf5.js";
4
4
  import { n as r, r as i, t as a } from "../chunks/routes-config-BcNaWJWJ.js";
5
5
  import { useMemo as o } from "react";
6
6
  import { jsx as s } from "react/jsx-runtime";
7
7
  import { usePathname as c, useRouter as l } from "next/navigation";
8
8
  // src/next/BPMNextProviders.tsx
9
- function u({ children: r, locale: i, language: a, publicPaths: u, loginPath: d }) {
10
- let f = l(), p = c(), m = o(() => ({
11
- pathname: p,
12
- push: (e) => f.push(e),
13
- replace: (e) => f.replace(e),
14
- back: () => f.back(),
9
+ function u({ children: r, locale: i, language: a, organizationTimeZone: u, publicPaths: d, loginPath: f }) {
10
+ let p = l(), m = c(), h = o(() => ({
11
+ pathname: m,
12
+ push: (e) => p.push(e),
13
+ replace: (e) => p.replace(e),
14
+ back: () => p.back(),
15
15
  searchParams: () => t()
16
- }), [f, p]);
16
+ }), [p, m]);
17
17
  return /* @__PURE__ */ s(n, {
18
- value: m,
18
+ value: h,
19
19
  children: /* @__PURE__ */ s(e, {
20
20
  locale: i,
21
21
  language: a,
22
- publicPaths: u,
23
- loginPath: d,
22
+ organizationTimeZone: u,
23
+ publicPaths: d,
24
+ loginPath: f,
24
25
  children: r
25
26
  })
26
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["BPMProviders","Providers","defaultBrowserSearchParams","RouterAdapterProvider","createDefaultBPMRoutes","useBPMRoutes","BPMRoutesProvider","BPMNextProviders","nextRouter","useRouter","pathname","usePathname","adapter","useMemo","href"],"sources":["../../src/next/BPMNextProviders.tsx"],"sourcesContent":["'use client';\n\n// One-line Next.js App Router shim for BPM. Reads `next/navigation`\n// router/pathname hooks, builds a `RouterAdapter`, then composes\n// `<RouterAdapterProvider>` and the shared `<BPMProviders>`.\n//\n// IMPORTANT: This component intentionally does NOT call\n// `useSearchParams()`. Doing so triggers Next.js's CSR bailout at static\n// prerender, and any `<Suspense fallback={null}>` we wrap around it then\n// erases `<RouterAdapterProvider>` from the SSR/hydration tree — leaving\n// every BPM view to throw \"must be used inside <RouterAdapterProvider>\"\n// when it mounts. None of the shipped BPM views consume\n// `RouterAdapter.searchParams()` anyway; hosts that need reactive query\n// string state should call Next's `useSearchParams()` directly in their\n// page (with their own Suspense). The lazy default getter below is\n// good enough for read-on-demand callers.\n\nimport { useMemo, type ReactElement, type ReactNode } from 'react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport type { CalendarLocale } from '@mezzanine-ui/react/moment';\nimport type { BPMLanguage } from '../lib/language-provider';\nimport { Providers as BPMProviders } from '../lib/providers';\nimport {\n RouterAdapterProvider,\n defaultBrowserSearchParams,\n type RouterAdapter,\n} from '../lib/router-adapter';\n\nexport interface BPMNextProvidersProps {\n readonly children: ReactNode;\n /**\n * Override the Mezzanine calendar locale. Forwarded to the inner\n * `<Providers>`. Defaults to `CalendarLocale.ZH_TW`.\n */\n readonly locale?: CalendarLocale;\n /**\n * Language BPM views write their messages in. Forwarded to the inner\n * `<Providers>`. Defaults to `'zh-TW'`.\n */\n readonly language?: BPMLanguage;\n /**\n * Routes that must remain accessible without a BPM session — visiting\n * these does not redirect to `loginPath` even when `member` is null.\n * Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n *\n * Hosts that mount BPM under a non-root prefix (see\n * `<BPMRoutesProvider>`) should typically expand this to include their\n * own auth-bypass paths.\n */\n readonly publicPaths?: readonly string[];\n /**\n * Where to redirect unauthenticated users. Forwarded to\n * `<AuthProvider>`. Defaults to `'/login'`. Hosts owning their own\n * login route (the recommended case) override this to their host\n * route, e.g. `'/auth/sign-in'`.\n */\n readonly loginPath?: string;\n}\n\n/**\n * One-line Next.js App Router shim for the full BPM provider stack.\n * Mounts in the host's root layout (or layout for the BPM sub-tree):\n *\n * ```tsx\n * import { BPMNextProviders } from '@rytass/bpm-core-react/next';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html><body>\n * <BPMNextProviders loginPath=\"/auth/sign-in\">\n * {children}\n * </BPMNextProviders>\n * </body></html>\n * );\n * }\n * ```\n *\n * Forwards every prop on {@link BPMNextProvidersProps} to the inner\n * `<Providers>` and `<AuthProvider>`. For per-feature path remapping\n * (BPM internal navigation), additionally wrap with\n * `<BPMRoutesProvider>` exported from the same subpath.\n */\nexport function BPMNextProviders({\n children,\n locale,\n language,\n publicPaths,\n loginPath,\n}: BPMNextProvidersProps): ReactElement {\n const nextRouter = useRouter();\n const pathname = usePathname();\n\n const adapter = useMemo<RouterAdapter>(\n () => ({\n pathname,\n push: (href: string): void => nextRouter.push(href),\n replace: (href: string): void => nextRouter.replace(href),\n back: (): void => nextRouter.back(),\n searchParams: (): URLSearchParams => defaultBrowserSearchParams(),\n }),\n [nextRouter, pathname],\n );\n\n return (\n <RouterAdapterProvider value={adapter}>\n <BPMProviders\n locale={locale}\n language={language}\n publicPaths={publicPaths}\n loginPath={loginPath}\n >\n {children}\n </BPMProviders>\n </RouterAdapterProvider>\n );\n}\n"],"mappings":";;;;;;;;AAkFA,SAAgBO,EAAiB,EAC/B,aACA,WACA,aACA,gBACA,gBACsC;CACtC,IAAMC,IAAaC,EAAU,GACvBC,IAAWC,EAAY,GAEvBC,IAAUC,SACP;EACL;EACA,OAAO,MAAuBL,EAAW,KAAKM,CAAI;EAClD,UAAU,MAAuBN,EAAW,QAAQM,CAAI;EACxD,YAAkBN,EAAW,KAAK;EAClC,oBAAqCN,EAA2B;CAClE,IACA,CAACM,GAAYE,CAAQ,CACvB;CAEA,OACE,kBAACP,GAAD;EAAuB,OAAOS;EAC5B,UAAA,kBAACZ,GAAD;GACU;GACE;GACG;GACF;GAEV;EACW,CAAA;CACO,CAAA;AAE3B"}
1
+ {"version":3,"file":"index.js","names":["BPMProviders","Providers","defaultBrowserSearchParams","RouterAdapterProvider","createDefaultBPMRoutes","useBPMRoutes","BPMRoutesProvider","BPMNextProviders","nextRouter","useRouter","pathname","usePathname","adapter","useMemo","href"],"sources":["../../src/next/BPMNextProviders.tsx"],"sourcesContent":["'use client';\n\n// One-line Next.js App Router shim for BPM. Reads `next/navigation`\n// router/pathname hooks, builds a `RouterAdapter`, then composes\n// `<RouterAdapterProvider>` and the shared `<BPMProviders>`.\n//\n// IMPORTANT: This component intentionally does NOT call\n// `useSearchParams()`. Doing so triggers Next.js's CSR bailout at static\n// prerender, and any `<Suspense fallback={null}>` we wrap around it then\n// erases `<RouterAdapterProvider>` from the SSR/hydration tree — leaving\n// every BPM view to throw \"must be used inside <RouterAdapterProvider>\"\n// when it mounts. None of the shipped BPM views consume\n// `RouterAdapter.searchParams()` anyway; hosts that need reactive query\n// string state should call Next's `useSearchParams()` directly in their\n// page (with their own Suspense). The lazy default getter below is\n// good enough for read-on-demand callers.\n\nimport { useMemo, type ReactElement, type ReactNode } from 'react';\nimport { usePathname, useRouter } from 'next/navigation';\nimport type { CalendarLocale } from '@mezzanine-ui/react/moment';\nimport type { BPMLanguage } from '../lib/language-provider';\nimport { Providers as BPMProviders } from '../lib/providers';\nimport {\n RouterAdapterProvider,\n defaultBrowserSearchParams,\n type RouterAdapter,\n} from '../lib/router-adapter';\n\nexport interface BPMNextProvidersProps {\n readonly children: ReactNode;\n /**\n * Override the Mezzanine calendar locale. Forwarded to the inner\n * `<Providers>`. Defaults to `CalendarLocale.ZH_TW`.\n */\n readonly locale?: CalendarLocale;\n /**\n * Language BPM views write their messages in. Forwarded to the inner\n * `<Providers>`. Defaults to `'zh-TW'`.\n */\n readonly language?: BPMLanguage;\n /**\n * IANA zone in which BPM views read \"today\" against organization effective\n * dates — the `organizationTimeZone` given to `BPMRootModule`. Forwarded to\n * the inner `<Providers>`. Defaults to `'Asia/Taipei'`\n * (`DEFAULT_BPM_ORGANIZATION_TIME_ZONE`).\n */\n readonly organizationTimeZone?: string;\n /**\n * Routes that must remain accessible without a BPM session — visiting\n * these does not redirect to `loginPath` even when `member` is null.\n * Forwarded to `<AuthProvider>`. Defaults to `['/login']`.\n *\n * Hosts that mount BPM under a non-root prefix (see\n * `<BPMRoutesProvider>`) should typically expand this to include their\n * own auth-bypass paths.\n */\n readonly publicPaths?: readonly string[];\n /**\n * Where to redirect unauthenticated users. Forwarded to\n * `<AuthProvider>`. Defaults to `'/login'`. Hosts owning their own\n * login route (the recommended case) override this to their host\n * route, e.g. `'/auth/sign-in'`.\n */\n readonly loginPath?: string;\n}\n\n/**\n * One-line Next.js App Router shim for the full BPM provider stack.\n * Mounts in the host's root layout (or layout for the BPM sub-tree):\n *\n * ```tsx\n * import { BPMNextProviders } from '@rytass/bpm-core-react/next';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html><body>\n * <BPMNextProviders loginPath=\"/auth/sign-in\">\n * {children}\n * </BPMNextProviders>\n * </body></html>\n * );\n * }\n * ```\n *\n * Forwards every prop on {@link BPMNextProvidersProps} to the inner\n * `<Providers>` and `<AuthProvider>`. For per-feature path remapping\n * (BPM internal navigation), additionally wrap with\n * `<BPMRoutesProvider>` exported from the same subpath.\n */\nexport function BPMNextProviders({\n children,\n locale,\n language,\n organizationTimeZone,\n publicPaths,\n loginPath,\n}: BPMNextProvidersProps): ReactElement {\n const nextRouter = useRouter();\n const pathname = usePathname();\n\n const adapter = useMemo<RouterAdapter>(\n () => ({\n pathname,\n push: (href: string): void => nextRouter.push(href),\n replace: (href: string): void => nextRouter.replace(href),\n back: (): void => nextRouter.back(),\n searchParams: (): URLSearchParams => defaultBrowserSearchParams(),\n }),\n [nextRouter, pathname],\n );\n\n return (\n <RouterAdapterProvider value={adapter}>\n <BPMProviders\n locale={locale}\n language={language}\n organizationTimeZone={organizationTimeZone}\n publicPaths={publicPaths}\n loginPath={loginPath}\n >\n {children}\n </BPMProviders>\n </RouterAdapterProvider>\n );\n}\n"],"mappings":";;;;;;;;AAyFA,SAAgBO,EAAiB,EAC/B,aACA,WACA,aACA,yBACA,gBACA,gBACsC;CACtC,IAAMC,IAAaC,EAAU,GACvBC,IAAWC,EAAY,GAEvBC,IAAUC,SACP;EACL;EACA,OAAO,MAAuBL,EAAW,KAAKM,CAAI;EAClD,UAAU,MAAuBN,EAAW,QAAQM,CAAI;EACxD,YAAkBN,EAAW,KAAK;EAClC,oBAAqCN,EAA2B;CAClE,IACA,CAACM,GAAYE,CAAQ,CACvB;CAEA,OACE,kBAACP,GAAD;EAAuB,OAAOS;EAC5B,UAAA,kBAACZ,GAAD;GACU;GACE;GACY;GACT;GACF;GAEV;EACW,CAAA;CACO,CAAA;AAE3B"}
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../../chunks/detail-DNzqesdI.cjs");let t=require("react/jsx-runtime");var n={title:`案件詳情 | BPM Admin`};async function r({params:n}){let{id:r}=await n;return(0,t.jsx)(e.t,{instanceId:r})}exports.default=r,exports.metadata=n;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../../chunks/detail-C5KrUC7s.cjs");let t=require("react/jsx-runtime");var n={title:`案件詳情 | BPM Admin`};async function r({params:n}){let{id:r}=await n;return(0,t.jsx)(e.t,{instanceId:r})}exports.default=r,exports.metadata=n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../../chunks/detail-Bv90gvy0.js";
1
+ import { t as e } from "../../../chunks/detail-Dnc4PPWO.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  // src/pages/instances/detail/index.tsx
4
4
  var n = { title: "案件詳情 | BPM Admin" };
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../../chunks/compose-BKUTsB2W.cjs");let t=require("react/jsx-runtime"),n=require("next/server");var r={title:`建立模板(表單 + 流程) | BPM Admin`,description:`以精靈式流程一次完成 BPM 表單與簽核流程設計並發佈。`};async function i(){return await(0,n.connection)(),(0,t.jsx)(e.t,{aiAssistantAvailable:!!process.env.OPENAI_API_KEY,showAiAssistant:process.env.BPM_AI_ASSISTANT_ENABLED===`true`})}exports.default=i,exports.metadata=r;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../../chunks/compose-CtWuunwB.cjs");let t=require("react/jsx-runtime"),n=require("next/server");var r={title:`建立模板(表單 + 流程) | BPM Admin`,description:`以精靈式流程一次完成 BPM 表單與簽核流程設計並發佈。`};async function i(){return await(0,n.connection)(),(0,t.jsx)(e.t,{aiAssistantAvailable:!!process.env.OPENAI_API_KEY,showAiAssistant:process.env.BPM_AI_ASSISTANT_ENABLED===`true`})}exports.default=i,exports.metadata=r;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../../chunks/compose-DZvIspW3.js";
1
+ import { t as e } from "../../../chunks/compose-M-GR6smM.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  import { connection as n } from "next/server";
4
4
  // src/pages/templates/compose/index.tsx
@@ -1,2 +1,2 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../../chunks/designer-C_m8DmMl.cjs");let t=require("react/jsx-runtime");var n={title:`流程設計器 | BPM Admin`,description:`以視覺化設計器編輯 BPM 簽核流程節點、條件與發佈版本。`};async function r({params:n}){let{id:r}=await n;return(0,t.jsx)(e.t,{aiAssistantAvailable:!!process.env.OPENAI_API_KEY,showAiAssistant:process.env.BPM_AI_ASSISTANT_ENABLED===`true`,showDryRun:process.env.BPM_TEMPLATE_DRY_RUN_ENABLED!==`false`,templateId:r})}exports.default=r,exports.metadata=n;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../../../chunks/designer-D6fCDq_q.cjs");let t=require("react/jsx-runtime");var n={title:`流程設計器 | BPM Admin`,description:`以視覺化設計器編輯 BPM 簽核流程節點、條件與發佈版本。`};async function r({params:n}){let{id:r}=await n;return(0,t.jsx)(e.t,{aiAssistantAvailable:!!process.env.OPENAI_API_KEY,showAiAssistant:process.env.BPM_AI_ASSISTANT_ENABLED===`true`,showDryRun:process.env.BPM_TEMPLATE_DRY_RUN_ENABLED!==`false`,templateId:r})}exports.default=r,exports.metadata=n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../../chunks/designer-CWubIE69.js";
1
+ import { t as e } from "../../../chunks/designer-BnMeiMVe.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  // src/pages/templates/designer/index.tsx
4
4
  var n = {
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-Dcvo6TrT.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`查看抄送給你的簽核案件。`,emptyMessage:`目前沒有抄送給你的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`抄送給我`,view:`CC`})}exports.CcView=n;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-Cv5I1YPX.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`查看抄送給你的簽核案件。`,emptyMessage:`目前沒有抄送給你的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`抄送給我`,view:`CC`})}exports.CcView=n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "../../chunks/approval-instance-list-page-Bth7Raya.js";
2
+ import { t as e } from "../../chunks/approval-instance-list-page-BI5fIXc-.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  // src/views/cc/CcView.tsx
5
5
  function n() {
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/FormBuilderView-DjPGrOJ2.cjs");exports.FormBuilderView=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/FormBuilderView-CGKkuVFi.cjs");exports.FormBuilderView=e.t;
@@ -1 +1 @@
1
- export { t as FormBuilderView } from "../../../chunks/FormBuilderView-WtC2iW5f.js";
1
+ export { t as FormBuilderView } from "../../../chunks/FormBuilderView-6KdApi-D.js";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/detail-DNzqesdI.cjs");exports.InstanceAttachmentsSection=e.o,exports.InstanceDetailView=e.t,exports.InstanceFormSection=e.s,exports.InstanceHistorySection=e.r,exports.InstanceSignaturesSection=e.i,exports.InstanceTasksSection=e.a,exports.InstanceWebhookDeliveriesSection=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/detail-C5KrUC7s.cjs");exports.InstanceAttachmentsSection=e.o,exports.InstanceDetailView=e.t,exports.InstanceFormSection=e.s,exports.InstanceHistorySection=e.r,exports.InstanceSignaturesSection=e.i,exports.InstanceTasksSection=e.a,exports.InstanceWebhookDeliveriesSection=e.n;
@@ -1 +1 @@
1
- export { o as InstanceAttachmentsSection, t as InstanceDetailView, s as InstanceFormSection, r as InstanceHistorySection, i as InstanceSignaturesSection, a as InstanceTasksSection, n as InstanceWebhookDeliveriesSection } from "../../../chunks/detail-Bv90gvy0.js";
1
+ export { o as InstanceAttachmentsSection, t as InstanceDetailView, s as InstanceFormSection, r as InstanceHistorySection, i as InstanceSignaturesSection, a as InstanceTasksSection, n as InstanceWebhookDeliveriesSection } from "../../../chunks/detail-Dnc4PPWO.js";
@@ -123,7 +123,6 @@ export declare function readMemberOptionFromValue(value: unknown): MemberOption
123
123
  export declare function readUniqueMemberOption(searchText: string, options: readonly MemberOption[]): MemberOption | null;
124
124
  export declare function readTextDescriptionPart(text: string | null): ActivityStepDescriptionPart | null;
125
125
  export declare function readCommentDescriptionPart(label: string, text: string | null, tone?: 'danger' | 'neutral'): ActivityStepDescriptionPart | null;
126
- export declare function readMemberDescriptionPart(prefix: string, memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, fallbackLabel: string): ActivityStepDescriptionPart;
127
126
  export declare function isActivityDescriptionPart(part: ActivityStepDescriptionPart | null): part is ActivityStepDescriptionPart;
128
127
  export declare function readCurrentActivityStep(activitySteps: readonly ActivityStepRecord[]): number;
129
128
  export declare function isUserMeaningfulActivity(activityLog: ActivityLogRecord): boolean;
@@ -123,7 +123,6 @@ export declare function readMemberOptionFromValue(value: unknown): MemberOption
123
123
  export declare function readUniqueMemberOption(searchText: string, options: readonly MemberOption[]): MemberOption | null;
124
124
  export declare function readTextDescriptionPart(text: string | null): ActivityStepDescriptionPart | null;
125
125
  export declare function readCommentDescriptionPart(label: string, text: string | null, tone?: 'danger' | 'neutral'): ActivityStepDescriptionPart | null;
126
- export declare function readMemberDescriptionPart(prefix: string, memberId: string | null, memberProfilesById: ReadonlyMap<string, MemberProfileRecord>, fallbackLabel: string): ActivityStepDescriptionPart;
127
126
  export declare function isActivityDescriptionPart(part: ActivityStepDescriptionPart | null): part is ActivityStepDescriptionPart;
128
127
  export declare function readCurrentActivityStep(activitySteps: readonly ActivityStepRecord[]): number;
129
128
  export declare function isUserMeaningfulActivity(activityLog: ActivityLogRecord): boolean;
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/rolldown-runtime-BocRIvOZ.cjs"),t=require("../../../chunks/instance-error-message-BW464LRQ.cjs"),n=require("../../../chunks/format-date-time-D-cx5M8z.cjs"),r=require("../../../chunks/auth-provider-4BeCw7cI.cjs"),i=require("../../../chunks/router-adapter--gYs13E8.cjs"),a=require("../../../chunks/routes-config-C1j_vFKo.cjs"),o=require("../../../chunks/FormRendererView-B-xycC9S.cjs");let s=require("react"),c=require("@mezzanine-ui/react"),l=require("react/jsx-runtime"),u=require("@rytass/bpm-core-client/workflow"),d=require("@mezzanine-ui/react/ContentHeader");d=e.t(d,1);let f=require("@rytass/bpm-core-client/form"),p=require("@mezzanine-ui/icons");var m={display:`grid`,gap:16};function h(e={}){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)(_,{}),children:(0,l.jsx)(g,{templateId:e.templateId??void 0})})}function g({templateId:e}){let h=i.r(),g=a.r(),{member:_}=r.n(),v=_?.memberId??null,y=e??null,[b,x]=(0,s.useState)(null),[S,C]=(0,s.useState)({}),[w,T]=(0,s.useState)([]),[E,D]=(0,s.useState)(null),[O,k]=(0,s.useState)({}),[A,j]=(0,s.useState)(!0),[M,N]=(0,s.useState)(!1),[P,F]=(0,s.useState)({}),I=o.o(),L=(0,s.useMemo)(()=>b?t.r(b.formVersion.schema,b.templateVersion.workflowDefinition):null,[b]),R=(0,s.useCallback)((e,t)=>{F(n=>{let r=n[e];return r?.hasValue===t.hasValue&&r.selectionExpired===(t.selectionExpired===!0)&&r.status===t.status?n:{...n,[e]:{hasValue:t.hasValue,selectionExpired:t.selectionExpired===!0,status:t.status}}})},[]);(0,s.useEffect)(()=>{y?U(y):H()},[y]);let z=(0,s.useMemo)(()=>w.map(e=>({...e,key:e.id,updatedAt:n.t(e.updatedAt),versionLabel:`v${e.version}`})),[w]),B=(0,s.useMemo)(()=>[{dataIndex:`name`,key:`name`,title:`模板名稱`,width:240},{dataIndex:`versionLabel`,key:`versionLabel`,title:`發布版本`,width:120},{dataIndex:`updatedAt`,key:`updatedAt`,title:`更新時間`,width:220}],[]),V=(0,s.useMemo)(()=>({render:e=>[{name:`發起`,onClick:()=>h.push(g.caseNew(e.id)),variant:`base-primary`}],variant:`base-secondary`,width:88}),[h]);async function H(){j(!0),D(null),x(null),F({});try{T(await(0,u.listLaunchableTemplates)())}catch(e){D(t.t(e))}finally{j(!1)}}async function U(e){j(!0),D(null),T([]),F({});try{x(await(0,u.readLaunchContext)(e))}catch(e){D(t.t(e))}finally{j(!1)}}async function W(){if(!b||!L||!v)return;N(!0),D(null),k({});let e=o.l(Object.values(P));if(e){D(e),N(!1);return}if(I.blockMessage){D(I.blockMessage),N(!1);return}let n=t.i((0,f.buildFormRendererValues)(L.fields,S),b.templateVersion.workflowDefinition);try{let e=await(0,f.validateFormRendererValuesInWorker)({schema:L,uiSchema:b.formVersion.uiSchema,values:n});if(!e.valid){k(e.errors),D(`請先修正表單中標示的欄位。`),e.firstInvalidFieldKey&&(0,f.focusFormRendererField)(e.firstInvalidFieldKey);return}let t=await(0,u.submitApprovalInstance)({formData:n,initiatorMemberId:v,templateId:b.template.id,title:(0,u.readFormDataCaseTitle)({fallbackTitle:b.template.name,formData:n,schema:L,uiSchema:b.formVersion.uiSchema})});h.push(g.caseDetail(t))}catch(e){D(t.t(e))}finally{N(!1)}}async function G(e,t){if(!v)throw Error(`尚未登入,無法上傳附件`);return{id:(await(0,u.uploadAttachment)({file:t,formFieldPath:`form.${e.fieldKey}`})).id}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:b?`${b.template.name} · 表單 v${b.formVersion.version}`:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`,children:b?(0,l.jsx)(c.Button,{disabled:A||M,icon:p.CheckedIcon,iconType:`leading`,onClick:W,variant:`base-primary`,children:`送出`}):null})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsx)(c.Section,{children:(0,l.jsxs)(`div`,{style:m,children:[E?(0,l.jsx)(c.Typography,{color:`text-error`,variant:`body`,children:E}):null,A?(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`}):null,b&&L?(0,l.jsx)(o.t,{dataSourceContext:{kind:`runtime`,templateId:b.template.id},errors:O,maxWidth:480,onChange:e=>{C(e),k({})},onDataSourceStateChange:R,onFileUploadStateChange:I.onFileUploadStateChange,onUploadAttachment:G,schema:L,singleColumn:!0,uiSchema:b.formVersion.uiSchema,value:S}):null,!y&&!A?z.length>0?(0,l.jsx)(c.Table,{actions:V,columns:B,dataSource:z,fullWidth:!0}):(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`目前沒有可發起的已發布模板。`}):null]})})})]})}function _(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsx)(c.Section,{children:(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`})})})]})}exports.InstanceNewView=h;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/rolldown-runtime-BocRIvOZ.cjs"),t=require("../../../chunks/instance-error-message-BpCLCOjp.cjs"),n=require("../../../chunks/format-date-time-D-cx5M8z.cjs"),r=require("../../../chunks/auth-provider-4BeCw7cI.cjs"),i=require("../../../chunks/router-adapter--gYs13E8.cjs"),a=require("../../../chunks/routes-config-C1j_vFKo.cjs"),o=require("../../../chunks/FormRendererView-B-xycC9S.cjs");let s=require("react"),c=require("@mezzanine-ui/react"),l=require("react/jsx-runtime"),u=require("@rytass/bpm-core-client/workflow"),d=require("@mezzanine-ui/react/ContentHeader");d=e.t(d,1);let f=require("@rytass/bpm-core-client/form"),p=require("@mezzanine-ui/icons");var m={display:`grid`,gap:16};function h(e={}){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)(_,{}),children:(0,l.jsx)(g,{templateId:e.templateId??void 0})})}function g({templateId:e}){let h=i.r(),g=a.r(),{member:_}=r.n(),v=_?.memberId??null,y=e??null,[b,x]=(0,s.useState)(null),[S,C]=(0,s.useState)({}),[w,T]=(0,s.useState)([]),[E,D]=(0,s.useState)(null),[O,k]=(0,s.useState)({}),[A,j]=(0,s.useState)(!0),[M,N]=(0,s.useState)(!1),[P,F]=(0,s.useState)({}),I=o.o(),L=(0,s.useMemo)(()=>b?t.r(b.formVersion.schema,b.templateVersion.workflowDefinition):null,[b]),R=(0,s.useCallback)((e,t)=>{F(n=>{let r=n[e];return r?.hasValue===t.hasValue&&r.selectionExpired===(t.selectionExpired===!0)&&r.status===t.status?n:{...n,[e]:{hasValue:t.hasValue,selectionExpired:t.selectionExpired===!0,status:t.status}}})},[]);(0,s.useEffect)(()=>{y?U(y):H()},[y]);let z=(0,s.useMemo)(()=>w.map(e=>({...e,key:e.id,updatedAt:n.t(e.updatedAt),versionLabel:`v${e.version}`})),[w]),B=(0,s.useMemo)(()=>[{dataIndex:`name`,key:`name`,title:`模板名稱`,width:240},{dataIndex:`versionLabel`,key:`versionLabel`,title:`發布版本`,width:120},{dataIndex:`updatedAt`,key:`updatedAt`,title:`更新時間`,width:220}],[]),V=(0,s.useMemo)(()=>({render:e=>[{name:`發起`,onClick:()=>h.push(g.caseNew(e.id)),variant:`base-primary`}],variant:`base-secondary`,width:88}),[h]);async function H(){j(!0),D(null),x(null),F({});try{T(await(0,u.listLaunchableTemplates)())}catch(e){D(t.t(e))}finally{j(!1)}}async function U(e){j(!0),D(null),T([]),F({});try{x(await(0,u.readLaunchContext)(e))}catch(e){D(t.t(e))}finally{j(!1)}}async function W(){if(!b||!L||!v)return;N(!0),D(null),k({});let e=o.l(Object.values(P));if(e){D(e),N(!1);return}if(I.blockMessage){D(I.blockMessage),N(!1);return}let n=t.i((0,f.buildFormRendererValues)(L.fields,S),b.templateVersion.workflowDefinition);try{let e=await(0,f.validateFormRendererValuesInWorker)({schema:L,uiSchema:b.formVersion.uiSchema,values:n});if(!e.valid){k(e.errors),D(`請先修正表單中標示的欄位。`),e.firstInvalidFieldKey&&(0,f.focusFormRendererField)(e.firstInvalidFieldKey);return}let t=await(0,u.submitApprovalInstance)({formData:n,initiatorMemberId:v,templateId:b.template.id,title:(0,u.readFormDataCaseTitle)({fallbackTitle:b.template.name,formData:n,schema:L,uiSchema:b.formVersion.uiSchema})});h.push(g.caseDetail(t))}catch(e){D(t.t(e))}finally{N(!1)}}async function G(e,t){if(!v)throw Error(`尚未登入,無法上傳附件`);return{id:(await(0,u.uploadAttachment)({file:t,formFieldPath:`form.${e.fieldKey}`})).id}}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:b?`${b.template.name} · 表單 v${b.formVersion.version}`:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`,children:b?(0,l.jsx)(c.Button,{disabled:A||M,icon:p.CheckedIcon,iconType:`leading`,onClick:W,variant:`base-primary`,children:`送出`}):null})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsx)(c.Section,{children:(0,l.jsxs)(`div`,{style:m,children:[E?(0,l.jsx)(c.Typography,{color:`text-error`,variant:`body`,children:E}):null,A?(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`}):null,b&&L?(0,l.jsx)(o.t,{dataSourceContext:{kind:`runtime`,templateId:b.template.id},errors:O,maxWidth:480,onChange:e=>{C(e),k({})},onDataSourceStateChange:R,onFileUploadStateChange:I.onFileUploadStateChange,onUploadAttachment:G,schema:L,singleColumn:!0,uiSchema:b.formVersion.uiSchema,value:S}):null,!y&&!A?z.length>0?(0,l.jsx)(c.Table,{actions:V,columns:B,dataSource:z,fullWidth:!0}):(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`目前沒有可發起的已發布模板。`}):null]})})})]})}function _(){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.PageHeader,{children:(0,l.jsx)(d.default,{description:`選擇可發起的已發布模板後填寫表單內容。`,title:`發起簽核`})}),(0,l.jsx)(c.SectionGroup,{children:(0,l.jsx)(c.Section,{children:(0,l.jsx)(c.Typography,{color:`text-neutral`,variant:`body`,children:`載入中...`})})})]})}exports.InstanceNewView=h;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { i as e, r as t, t as n } from "../../../chunks/instance-error-message-CAP1vJhX.js";
2
+ import { i as e, r as t, t as n } from "../../../chunks/instance-error-message-BEM4O_Kj.js";
3
3
  import { t as r } from "../../../chunks/format-date-time-B0LdmWg4.js";
4
4
  import { n as i } from "../../../chunks/auth-provider-C2b-5mGt.js";
5
5
  import { r as a } from "../../../chunks/router-adapter-CkxCyzf5.js";
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-Dcvo6TrT.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`以關鍵字與狀態查詢你有權限查看的簽核案件。`,emptyMessage:`沒有符合條件的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`案件搜尋`,view:`ALL`})}exports.SearchView=n;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-Cv5I1YPX.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`以關鍵字與狀態查詢你有權限查看的簽核案件。`,emptyMessage:`沒有符合條件的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`案件搜尋`,view:`ALL`})}exports.SearchView=n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "../../chunks/approval-instance-list-page-Bth7Raya.js";
2
+ import { t as e } from "../../chunks/approval-instance-list-page-BI5fIXc-.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  // src/views/search/SearchView.tsx
5
5
  function n() {
@@ -1,2 +1,2 @@
1
- "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-Dcvo6TrT.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`查看由你發起或代為送出的簽核案件與目前流程狀態。`,emptyMessage:`目前沒有由你發起或代為送出的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`我發起的`,view:`SENT`})}exports.SentView=n;
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/approval-instance-list-page-Cv5I1YPX.cjs");let t=require("react/jsx-runtime");function n(){return(0,t.jsx)(e.t,{defaultState:null,description:`查看由你發起或代為送出的簽核案件與目前流程狀態。`,emptyMessage:`目前沒有由你發起或代為送出的簽核案件。`,searchPlaceholder:`關鍵字:搜尋案件、發起人、模板或狀態`,title:`我發起的`,view:`SENT`})}exports.SentView=n;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "../../chunks/approval-instance-list-page-Bth7Raya.js";
2
+ import { t as e } from "../../chunks/approval-instance-list-page-BI5fIXc-.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  // src/views/sent/SentView.tsx
5
5
  function n() {
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-BKUTsB2W.cjs");exports.EMPTY_COMPOSE_FORM_SCHEMA=e.n,exports.EMPTY_COMPOSE_FORM_UI_SCHEMA=e.r,exports.TemplateComposeWizardView=e.t,exports.useTemplateComposeWizard=e.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../chunks/compose-CtWuunwB.cjs");exports.EMPTY_COMPOSE_FORM_SCHEMA=e.n,exports.EMPTY_COMPOSE_FORM_UI_SCHEMA=e.r,exports.TemplateComposeWizardView=e.t,exports.useTemplateComposeWizard=e.i;
@@ -1 +1 @@
1
- export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-DZvIspW3.js";
1
+ export { n as EMPTY_COMPOSE_FORM_SCHEMA, r as EMPTY_COMPOSE_FORM_UI_SCHEMA, t as TemplateComposeWizardView, i as useTemplateComposeWizard } from "../../../chunks/compose-M-GR6smM.js";
@@ -1,4 +1,4 @@
1
- import { ApproverResolver, ApproverResolverFallback } from '@rytass/bpm-core-shared/workflow';
1
+ import { ApproverResolver, ApproverResolverFallback, OrgManagerChainStart } from '@rytass/bpm-core-shared/workflow';
2
2
  import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
3
3
  import { OrgUnitRecord, PositionRecord } from '@rytass/bpm-core-client/organization';
4
4
  import { OrgUnitOption, PositionOption } from '../../../components/admin-picker-options.cjs';
@@ -208,4 +208,108 @@ export type ApproverManagerRuleView = Readonly<{
208
208
  */
209
209
  export declare function readApproverManagerRule(resolver: ApproverResolver): ApproverManagerRuleView | null;
210
210
  export declare function withPreferClosestOrgUnit(resolver: ApproverResolver, preferClosestOrgUnit: boolean): ApproverResolver;
211
+ type OrgManagerChainResolver = Extract<ApproverResolver, {
212
+ readonly type: 'ORG_MANAGER_CHAIN';
213
+ }>;
214
+ export type OrgManagerChainStartMode = OrgManagerChainStart['type'];
215
+ export type OrgManagerChainStartOption = Readonly<{
216
+ id: string;
217
+ name: string;
218
+ }>;
219
+ /** The choices of 從誰的主管開始. Today's behaviour is the first one. */
220
+ export declare const ORG_MANAGER_CHAIN_START_OPTIONS: readonly Readonly<{
221
+ id: OrgManagerChainStartMode;
222
+ name: string;
223
+ }>[];
224
+ /** The id of the read-only entry an unknown start is shown as. */
225
+ export declare const UNSUPPORTED_ORG_MANAGER_CHAIN_START_OPTION_ID = "UNSUPPORTED";
226
+ /** The 從職等幾開始簽 choice that leaves the setting out. */
227
+ export declare const NO_START_POSITION_LEVEL_OPTION_ID = "NONE";
228
+ export declare const START_POSITION_LEVEL_HINT = "\u8077\u7B49\u4F4E\u65BC\u9019\u88E1\u7684\u4E3B\u7BA1\u53EA\u6703\u88AB\u7565\u904E\u3001\u4E0D\u7C3D\u6838\uFF1B\u7559\u767D\u5247\u5F9E\u93C8\u4E0A\u7B2C\u4E00\u4F4D\u6709\u8077\u7B49\u7684\u4E3B\u7BA1\u958B\u59CB\u7C3D\u3002\u4E0D\u53EF\u9AD8\u65BC\u300C\u7C3D\u5230\u8077\u7B49\u300D\u3002";
229
+ export declare const START_POSITION_LEVEL_ABOVE_MIN_HINT = "\u8D77\u59CB\u8077\u7B49\u4E0D\u53EF\u9AD8\u65BC\u7C3D\u5230\u8077\u7B49\uFF0C\u767C\u5E03\u524D\u5FC5\u9808\u4FEE\u6B63\u3002";
230
+ /**
231
+ * Where the chain starts, or `null` for a start this build does not know (a
232
+ * definition saved by a newer BPMCore): shown read-only, never rewritten.
233
+ * No `startFrom` is the initiator.
234
+ */
235
+ export declare function readOrgManagerChainStartMode(resolver: OrgManagerChainResolver): OrgManagerChainStartMode | null;
236
+ export type OrgManagerChainStartChoice = Readonly<{
237
+ /** Hint under the select: what the chosen start means. */
238
+ hint: string;
239
+ options: readonly OrgManagerChainStartOption[];
240
+ selected: OrgManagerChainStartOption;
241
+ }>;
242
+ /**
243
+ * The 從誰的主管開始 select. A start this build does not know is the current
244
+ * value as an extra read-only entry; picking it writes nothing
245
+ * ({@link readOrgManagerChainStartPick}).
246
+ */
247
+ export declare function readOrgManagerChainStartChoice(resolver: OrgManagerChainResolver): OrgManagerChainStartChoice;
248
+ /**
249
+ * The resolver after 從誰的主管開始 is set to `mode`: the initiator drops the
250
+ * `startFrom` key (the same as never having set it), a form field or earlier
251
+ * stages starts empty for the author to fill. The start level and the rest of
252
+ * the resolver are kept.
253
+ */
254
+ export declare function withOrgManagerChainStart(resolver: OrgManagerChainResolver, mode: OrgManagerChainStartMode): OrgManagerChainResolver;
255
+ /**
256
+ * The resolver a 從誰的主管開始 pick produces, or `null` when the pick must
257
+ * change nothing: no option, the read-only unsupported entry, or the start the
258
+ * resolver already has (re-picking it used to clear the field or stages
259
+ * already chosen).
260
+ */
261
+ export declare function readOrgManagerChainStartPick(resolver: ApproverResolver, optionId: string | null): OrgManagerChainResolver | null;
262
+ /** The form field a `FORM_MEMBER` start names, else `null`. */
263
+ export declare function readOrgManagerChainStartFormPath(resolver: OrgManagerChainResolver): string | null;
264
+ /** The stages a `NODE_ACTOR` start names, else `null`. */
265
+ export declare function readOrgManagerChainStartNodeIds(resolver: OrgManagerChainResolver): readonly string[] | null;
266
+ /**
267
+ * The resolver with the field of a `FORM_MEMBER` start set. Any other start
268
+ * comes back as the same object: there is no field to write.
269
+ */
270
+ export declare function withOrgManagerChainStartFormPath(resolver: OrgManagerChainResolver, formPath: string): OrgManagerChainResolver;
271
+ /**
272
+ * The resolver with the stages of a `NODE_ACTOR` start set. Any other start
273
+ * comes back as the same object.
274
+ */
275
+ export declare function withOrgManagerChainStartNodeIds(resolver: OrgManagerChainResolver, nodeIds: readonly string[]): OrgManagerChainResolver;
276
+ /**
277
+ * The resolver after 簽到職等 is set to `minPositionLevel`: `startFrom`,
278
+ * `startPositionLevel` and `fallback` stay as they were.
279
+ */
280
+ export declare function withOrgManagerChainMinPositionLevel(resolver: OrgManagerChainResolver, minPositionLevel: number): OrgManagerChainResolver;
281
+ export type OrgManagerChainStartLevelChoice = Readonly<{
282
+ /** The stored level is not a whole number: shown, not offered. */
283
+ invalid: boolean;
284
+ options: readonly OrgManagerChainStartOption[];
285
+ selected: OrgManagerChainStartOption;
286
+ }>;
287
+ /**
288
+ * The 從職等幾開始簽 select: 不指定 plus the position levels at or below
289
+ * 簽到職等 (a start above it cannot be published, so it is not offered). A
290
+ * stored level the directory has no position for, or one above 簽到職等, stays
291
+ * in the list so the select can show it; a stored value that is not a number
292
+ * is shown as invalid rather than as 不指定.
293
+ */
294
+ export declare function readOrgManagerChainStartLevelChoice(resolver: OrgManagerChainResolver, positions: readonly PositionRecord[]): OrgManagerChainStartLevelChoice;
295
+ /**
296
+ * The resolver a 從職等幾開始簽 pick produces, or `null` when the pick must
297
+ * change nothing: no option, the invalid entry, or the level already stored.
298
+ * 不指定 drops the `startPositionLevel` key (never writes `undefined`).
299
+ */
300
+ export declare function readOrgManagerChainStartLevelPick(resolver: ApproverResolver, optionId: string | null): OrgManagerChainResolver | null;
301
+ /**
302
+ * Why the chosen 簽到職等 and 從職等幾開始簽 cannot be published together, or
303
+ * `null`. The same rule as the publish check (`readOrgManagerChainIssue`),
304
+ * said under the select as the author picks.
305
+ */
306
+ export declare function readOrgManagerChainStartLevelProblem(resolver: OrgManagerChainResolver): string | null;
307
+ /**
308
+ * The hint under 無主管時 for a manager chain. With neither the start nor the
309
+ * start level set it is the text it always was. Otherwise it adds the two ways
310
+ * the engine ends up at the fallback with nobody on the chain: no start person
311
+ * (`resolveOrgManagerChainStart` returns no member) and no manager at or above
312
+ * the start level (the chain stays empty and `resolveFallbackAssignees` runs).
313
+ */
314
+ export declare function readOrgManagerChainFallbackHint(resolver: OrgManagerChainResolver): string;
211
315
  export {};
@@ -1,4 +1,4 @@
1
- import { ApproverResolver, ApproverResolverFallback } from '@rytass/bpm-core-shared/workflow';
1
+ import { ApproverResolver, ApproverResolverFallback, OrgManagerChainStart } from '@rytass/bpm-core-shared/workflow';
2
2
  import { FormDefinitionSchema } from '@rytass/bpm-core-shared/form';
3
3
  import { OrgUnitRecord, PositionRecord } from '@rytass/bpm-core-client/organization';
4
4
  import { OrgUnitOption, PositionOption } from '../../../components/admin-picker-options.js';
@@ -208,4 +208,108 @@ export type ApproverManagerRuleView = Readonly<{
208
208
  */
209
209
  export declare function readApproverManagerRule(resolver: ApproverResolver): ApproverManagerRuleView | null;
210
210
  export declare function withPreferClosestOrgUnit(resolver: ApproverResolver, preferClosestOrgUnit: boolean): ApproverResolver;
211
+ type OrgManagerChainResolver = Extract<ApproverResolver, {
212
+ readonly type: 'ORG_MANAGER_CHAIN';
213
+ }>;
214
+ export type OrgManagerChainStartMode = OrgManagerChainStart['type'];
215
+ export type OrgManagerChainStartOption = Readonly<{
216
+ id: string;
217
+ name: string;
218
+ }>;
219
+ /** The choices of 從誰的主管開始. Today's behaviour is the first one. */
220
+ export declare const ORG_MANAGER_CHAIN_START_OPTIONS: readonly Readonly<{
221
+ id: OrgManagerChainStartMode;
222
+ name: string;
223
+ }>[];
224
+ /** The id of the read-only entry an unknown start is shown as. */
225
+ export declare const UNSUPPORTED_ORG_MANAGER_CHAIN_START_OPTION_ID = "UNSUPPORTED";
226
+ /** The 從職等幾開始簽 choice that leaves the setting out. */
227
+ export declare const NO_START_POSITION_LEVEL_OPTION_ID = "NONE";
228
+ export declare const START_POSITION_LEVEL_HINT = "\u8077\u7B49\u4F4E\u65BC\u9019\u88E1\u7684\u4E3B\u7BA1\u53EA\u6703\u88AB\u7565\u904E\u3001\u4E0D\u7C3D\u6838\uFF1B\u7559\u767D\u5247\u5F9E\u93C8\u4E0A\u7B2C\u4E00\u4F4D\u6709\u8077\u7B49\u7684\u4E3B\u7BA1\u958B\u59CB\u7C3D\u3002\u4E0D\u53EF\u9AD8\u65BC\u300C\u7C3D\u5230\u8077\u7B49\u300D\u3002";
229
+ export declare const START_POSITION_LEVEL_ABOVE_MIN_HINT = "\u8D77\u59CB\u8077\u7B49\u4E0D\u53EF\u9AD8\u65BC\u7C3D\u5230\u8077\u7B49\uFF0C\u767C\u5E03\u524D\u5FC5\u9808\u4FEE\u6B63\u3002";
230
+ /**
231
+ * Where the chain starts, or `null` for a start this build does not know (a
232
+ * definition saved by a newer BPMCore): shown read-only, never rewritten.
233
+ * No `startFrom` is the initiator.
234
+ */
235
+ export declare function readOrgManagerChainStartMode(resolver: OrgManagerChainResolver): OrgManagerChainStartMode | null;
236
+ export type OrgManagerChainStartChoice = Readonly<{
237
+ /** Hint under the select: what the chosen start means. */
238
+ hint: string;
239
+ options: readonly OrgManagerChainStartOption[];
240
+ selected: OrgManagerChainStartOption;
241
+ }>;
242
+ /**
243
+ * The 從誰的主管開始 select. A start this build does not know is the current
244
+ * value as an extra read-only entry; picking it writes nothing
245
+ * ({@link readOrgManagerChainStartPick}).
246
+ */
247
+ export declare function readOrgManagerChainStartChoice(resolver: OrgManagerChainResolver): OrgManagerChainStartChoice;
248
+ /**
249
+ * The resolver after 從誰的主管開始 is set to `mode`: the initiator drops the
250
+ * `startFrom` key (the same as never having set it), a form field or earlier
251
+ * stages starts empty for the author to fill. The start level and the rest of
252
+ * the resolver are kept.
253
+ */
254
+ export declare function withOrgManagerChainStart(resolver: OrgManagerChainResolver, mode: OrgManagerChainStartMode): OrgManagerChainResolver;
255
+ /**
256
+ * The resolver a 從誰的主管開始 pick produces, or `null` when the pick must
257
+ * change nothing: no option, the read-only unsupported entry, or the start the
258
+ * resolver already has (re-picking it used to clear the field or stages
259
+ * already chosen).
260
+ */
261
+ export declare function readOrgManagerChainStartPick(resolver: ApproverResolver, optionId: string | null): OrgManagerChainResolver | null;
262
+ /** The form field a `FORM_MEMBER` start names, else `null`. */
263
+ export declare function readOrgManagerChainStartFormPath(resolver: OrgManagerChainResolver): string | null;
264
+ /** The stages a `NODE_ACTOR` start names, else `null`. */
265
+ export declare function readOrgManagerChainStartNodeIds(resolver: OrgManagerChainResolver): readonly string[] | null;
266
+ /**
267
+ * The resolver with the field of a `FORM_MEMBER` start set. Any other start
268
+ * comes back as the same object: there is no field to write.
269
+ */
270
+ export declare function withOrgManagerChainStartFormPath(resolver: OrgManagerChainResolver, formPath: string): OrgManagerChainResolver;
271
+ /**
272
+ * The resolver with the stages of a `NODE_ACTOR` start set. Any other start
273
+ * comes back as the same object.
274
+ */
275
+ export declare function withOrgManagerChainStartNodeIds(resolver: OrgManagerChainResolver, nodeIds: readonly string[]): OrgManagerChainResolver;
276
+ /**
277
+ * The resolver after 簽到職等 is set to `minPositionLevel`: `startFrom`,
278
+ * `startPositionLevel` and `fallback` stay as they were.
279
+ */
280
+ export declare function withOrgManagerChainMinPositionLevel(resolver: OrgManagerChainResolver, minPositionLevel: number): OrgManagerChainResolver;
281
+ export type OrgManagerChainStartLevelChoice = Readonly<{
282
+ /** The stored level is not a whole number: shown, not offered. */
283
+ invalid: boolean;
284
+ options: readonly OrgManagerChainStartOption[];
285
+ selected: OrgManagerChainStartOption;
286
+ }>;
287
+ /**
288
+ * The 從職等幾開始簽 select: 不指定 plus the position levels at or below
289
+ * 簽到職等 (a start above it cannot be published, so it is not offered). A
290
+ * stored level the directory has no position for, or one above 簽到職等, stays
291
+ * in the list so the select can show it; a stored value that is not a number
292
+ * is shown as invalid rather than as 不指定.
293
+ */
294
+ export declare function readOrgManagerChainStartLevelChoice(resolver: OrgManagerChainResolver, positions: readonly PositionRecord[]): OrgManagerChainStartLevelChoice;
295
+ /**
296
+ * The resolver a 從職等幾開始簽 pick produces, or `null` when the pick must
297
+ * change nothing: no option, the invalid entry, or the level already stored.
298
+ * 不指定 drops the `startPositionLevel` key (never writes `undefined`).
299
+ */
300
+ export declare function readOrgManagerChainStartLevelPick(resolver: ApproverResolver, optionId: string | null): OrgManagerChainResolver | null;
301
+ /**
302
+ * Why the chosen 簽到職等 and 從職等幾開始簽 cannot be published together, or
303
+ * `null`. The same rule as the publish check (`readOrgManagerChainIssue`),
304
+ * said under the select as the author picks.
305
+ */
306
+ export declare function readOrgManagerChainStartLevelProblem(resolver: OrgManagerChainResolver): string | null;
307
+ /**
308
+ * The hint under 無主管時 for a manager chain. With neither the start nor the
309
+ * start level set it is the text it always was. Otherwise it adds the two ways
310
+ * the engine ends up at the fallback with nobody on the chain: no start person
311
+ * (`resolveOrgManagerChainStart` returns no member) and no manager at or above
312
+ * the start level (the chain stays empty and `resolveFallbackAssignees` runs).
313
+ */
314
+ export declare function readOrgManagerChainFallbackHint(resolver: OrgManagerChainResolver): string;
211
315
  export {};
@@ -46,6 +46,11 @@ export declare function readFormMemberManagerFieldChoice(schema: FormDefinitionS
46
46
  export declare function readOrgUnitFieldOptions(schema: FormDefinitionSchema | null): readonly MemberFieldOption[];
47
47
  /** The field picker for 組織 = 表單欄位 of 指定組織主管. */
48
48
  export declare function readFormOrgUnitFieldChoice(schema: FormDefinitionSchema | null, formPath: string): DynamicFormFieldChoice;
49
+ /**
50
+ * What a form field is called in a sentence: its label, or the field key when
51
+ * the form has no such field (any more) or the field has no label.
52
+ */
53
+ export declare function readFormFieldDisplayName(schema: FormDefinitionSchema | null, formPath: string): string;
49
54
  /**
50
55
  * 依表單欄位:<label>; the field key when the form does not have it (any
51
56
  * more), and a marker when the key names something that is not a member field.
@@ -46,6 +46,11 @@ export declare function readFormMemberManagerFieldChoice(schema: FormDefinitionS
46
46
  export declare function readOrgUnitFieldOptions(schema: FormDefinitionSchema | null): readonly MemberFieldOption[];
47
47
  /** The field picker for 組織 = 表單欄位 of 指定組織主管. */
48
48
  export declare function readFormOrgUnitFieldChoice(schema: FormDefinitionSchema | null, formPath: string): DynamicFormFieldChoice;
49
+ /**
50
+ * What a form field is called in a sentence: its label, or the field key when
51
+ * the form has no such field (any more) or the field has no label.
52
+ */
53
+ export declare function readFormFieldDisplayName(schema: FormDefinitionSchema | null, formPath: string): string;
49
54
  /**
50
55
  * 依表單欄位:<label>; the field key when the form does not have it (any
51
56
  * more), and a marker when the key names something that is not a member field.