@pisell/private-materials 6.12.168 → 6.12.170

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 (275) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +10 -10
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +10 -10
  9. package/es/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  10. package/es/components/HDLKiosk/app/manifest.js +11 -11
  11. package/es/components/HDLKiosk/app/operations.js +92 -0
  12. package/es/components/HDLKiosk/app/workflow/barcode.js +7 -3
  13. package/es/components/HDLKiosk/app/workflow/index.js +16 -0
  14. package/es/components/HDLKiosk/app/workflow/predicates.js +1 -1
  15. package/es/components/HDLKiosk/app/workflow/quick.js +1 -1
  16. package/es/components/HDLKiosk/app/workflow/registry.js +4 -4
  17. package/es/components/HDLKiosk/app/workflow/scale.js +5 -1
  18. package/es/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
  19. package/es/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
  20. package/es/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
  21. package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  22. package/es/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
  23. package/es/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
  24. package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  25. package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  26. package/es/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
  27. package/es/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
  28. package/es/components/HDLKiosk/docs/README.md +6 -2
  29. package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  30. package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  31. package/es/components/HDLKiosk/index.js +32 -30
  32. package/es/components/HDLKiosk/index.less +8 -3
  33. package/es/components/HDLKiosk/kernel/README.md +13 -12
  34. package/es/components/HDLKiosk/kernel/application/defineApplication.js +63 -24
  35. package/es/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  36. package/es/components/HDLKiosk/kernel/application/runtime.js +237 -0
  37. package/es/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  38. package/es/components/HDLKiosk/kernel/operations/registry.js +3 -3
  39. package/es/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  40. package/es/components/HDLKiosk/kernel/operations/types.js +7 -3
  41. package/es/components/HDLKiosk/kernel/workflow/actor.js +16 -17
  42. package/es/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
  43. package/es/components/HDLKiosk/runtime/createRuntime.js +238 -0
  44. package/es/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  45. package/es/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  46. package/es/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +18 -24
  47. package/es/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  48. package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  49. package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  50. package/es/components/HDLKiosk/runtime/operations/barcode.js +18 -0
  51. package/es/components/HDLKiosk/runtime/operations/cart.js +44 -0
  52. package/es/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  53. package/es/components/HDLKiosk/{app → runtime}/operations/checkout.js +95 -110
  54. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  55. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  56. package/es/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  57. package/es/components/HDLKiosk/runtime/operations/customization.js +70 -0
  58. package/es/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  59. package/es/components/HDLKiosk/runtime/operations/fulfillment.js +6 -0
  60. package/es/components/HDLKiosk/runtime/operations/identity.js +55 -0
  61. package/es/components/HDLKiosk/runtime/operations/registry.js +34 -0
  62. package/es/components/HDLKiosk/runtime/operations/session.js +29 -0
  63. package/es/components/HDLKiosk/runtime/operations/types.js +13 -0
  64. package/es/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  65. package/es/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +67 -17
  66. package/es/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  67. package/es/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  68. package/es/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  69. package/es/components/HDLKiosk/runtime/triggers.js +28 -0
  70. package/es/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  71. package/es/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  72. package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
  73. package/es/components/HDLKiosk/slices/customization/Screen/index.js +34 -35
  74. package/es/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  75. package/es/components/HDLKiosk/slices/customization/slice.js +2 -3
  76. package/es/components/HDLKiosk/slices/fulfillment/slice.js +2 -2
  77. package/es/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  78. package/es/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
  79. package/es/components/HDLKiosk/slices/identity/slice.js +2 -2
  80. package/es/components/HDLKiosk/slices/identity/view.js +1 -1
  81. package/es/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
  82. package/es/components/HDLKiosk/slices/payment/slice.js +3 -3
  83. package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
  84. package/es/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +68 -129
  85. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +387 -0
  86. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  87. package/es/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
  88. package/es/components/HDLKiosk/ui/collaborationStatus.js +11 -0
  89. package/es/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +66 -0
  90. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  91. package/es/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +25 -0
  92. package/es/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +53 -0
  93. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  94. package/es/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +39 -0
  95. package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  96. package/es/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  97. package/es/components/HDLKiosk/ui/scale.js +20 -0
  98. package/es/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -8
  99. package/es/components/HDLKiosk/{app → ui}/views.js +1 -1
  100. package/es/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  101. package/es/components/HDLKiosk/utils.js +4 -4
  102. package/es/components/bigSale/templates/HDLKiosk/README.md +43 -0
  103. package/es/components/bigSale/templates/HDLKiosk/adapter/createHost.js +7 -7
  104. package/es/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
  105. package/es/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
  106. package/es/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
  107. package/es/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +24 -14
  108. package/es/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
  109. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +187 -0
  110. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +160 -0
  111. package/es/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +3 -3
  112. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
  113. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
  114. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
  115. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
  116. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
  117. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +124 -0
  118. package/es/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +2 -2
  119. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +41 -0
  120. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
  121. package/es/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +122 -0
  122. package/es/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
  123. package/es/components/bigSale/templates/HDLKiosk/index.js +42 -148
  124. package/es/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +33 -62
  125. package/es/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
  126. package/es/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
  127. package/lib/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  128. package/lib/components/HDLKiosk/app/manifest.js +18 -19
  129. package/lib/components/HDLKiosk/app/operations.js +105 -0
  130. package/lib/components/HDLKiosk/app/workflow/barcode.js +7 -3
  131. package/lib/components/HDLKiosk/app/workflow/index.js +16 -0
  132. package/lib/components/HDLKiosk/app/workflow/predicates.js +1 -0
  133. package/lib/components/HDLKiosk/app/workflow/quick.js +1 -1
  134. package/lib/components/HDLKiosk/app/workflow/registry.js +3 -3
  135. package/lib/components/HDLKiosk/app/workflow/scale.js +5 -1
  136. package/lib/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
  137. package/lib/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
  138. package/lib/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
  139. package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  140. package/lib/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
  141. package/lib/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
  142. package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  143. package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  144. package/lib/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
  145. package/lib/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
  146. package/lib/components/HDLKiosk/docs/README.md +6 -2
  147. package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  148. package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  149. package/lib/components/HDLKiosk/index.js +35 -33
  150. package/lib/components/HDLKiosk/index.less +8 -3
  151. package/lib/components/HDLKiosk/kernel/README.md +13 -12
  152. package/lib/components/HDLKiosk/kernel/application/defineApplication.js +65 -25
  153. package/lib/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  154. package/lib/components/HDLKiosk/kernel/application/runtime.js +237 -0
  155. package/lib/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  156. package/lib/components/HDLKiosk/kernel/operations/registry.js +3 -3
  157. package/lib/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  158. package/lib/components/HDLKiosk/kernel/operations/types.js +8 -3
  159. package/lib/components/HDLKiosk/kernel/workflow/actor.js +16 -17
  160. package/lib/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
  161. package/lib/components/HDLKiosk/runtime/createRuntime.js +239 -0
  162. package/lib/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  163. package/lib/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  164. package/lib/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +17 -27
  165. package/lib/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  166. package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  167. package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  168. package/lib/components/HDLKiosk/runtime/operations/barcode.js +17 -0
  169. package/lib/components/HDLKiosk/runtime/operations/cart.js +46 -0
  170. package/lib/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  171. package/lib/components/HDLKiosk/{app → runtime}/operations/checkout.js +97 -112
  172. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  173. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  174. package/lib/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  175. package/lib/components/HDLKiosk/runtime/operations/customization.js +73 -0
  176. package/lib/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  177. package/lib/components/HDLKiosk/runtime/operations/fulfillment.js +5 -0
  178. package/lib/components/HDLKiosk/runtime/operations/identity.js +55 -0
  179. package/lib/components/HDLKiosk/runtime/operations/registry.js +34 -0
  180. package/lib/components/HDLKiosk/runtime/operations/session.js +30 -0
  181. package/lib/components/HDLKiosk/runtime/operations/types.js +14 -0
  182. package/lib/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  183. package/lib/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +71 -21
  184. package/lib/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  185. package/lib/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  186. package/lib/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  187. package/lib/components/HDLKiosk/runtime/triggers.js +28 -0
  188. package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  189. package/lib/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  190. package/lib/components/HDLKiosk/slices/catalog/slice.js +3 -3
  191. package/lib/components/HDLKiosk/slices/customization/Screen/index.js +35 -36
  192. package/lib/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  193. package/lib/components/HDLKiosk/slices/customization/slice.js +5 -6
  194. package/lib/components/HDLKiosk/slices/fulfillment/slice.js +3 -3
  195. package/lib/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  196. package/lib/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
  197. package/lib/components/HDLKiosk/slices/identity/slice.js +4 -4
  198. package/lib/components/HDLKiosk/slices/identity/view.js +1 -1
  199. package/lib/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
  200. package/lib/components/HDLKiosk/slices/payment/slice.js +5 -5
  201. package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
  202. package/lib/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +69 -130
  203. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +390 -0
  204. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  205. package/lib/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
  206. package/lib/components/HDLKiosk/ui/collaborationStatus.js +11 -0
  207. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +67 -0
  208. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  209. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +26 -0
  210. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +54 -0
  211. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  212. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +40 -0
  213. package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  214. package/lib/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  215. package/lib/components/HDLKiosk/ui/scale.js +24 -0
  216. package/lib/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -7
  217. package/lib/components/HDLKiosk/{app → ui}/views.js +1 -1
  218. package/lib/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  219. package/lib/components/HDLKiosk/utils.js +4 -4
  220. package/lib/components/bigSale/templates/HDLKiosk/README.md +43 -0
  221. package/lib/components/bigSale/templates/HDLKiosk/adapter/createHost.js +9 -9
  222. package/lib/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
  223. package/lib/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
  224. package/lib/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
  225. package/lib/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +25 -14
  226. package/lib/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
  227. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +189 -0
  228. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +162 -0
  229. package/lib/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +4 -4
  230. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
  231. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
  232. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
  233. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
  234. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
  235. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +126 -0
  236. package/lib/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +3 -3
  237. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +42 -0
  238. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
  239. package/lib/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +124 -0
  240. package/lib/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
  241. package/lib/components/bigSale/templates/HDLKiosk/index.js +43 -149
  242. package/lib/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +31 -61
  243. package/lib/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
  244. package/lib/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
  245. package/package.json +2 -2
  246. package/es/components/HDLKiosk/app/constants.js +0 -9
  247. package/es/components/HDLKiosk/app/operations/barcode.js +0 -22
  248. package/es/components/HDLKiosk/app/operations/cart.js +0 -60
  249. package/es/components/HDLKiosk/app/operations/fulfillment.js +0 -11
  250. package/es/components/HDLKiosk/app/operations/session.js +0 -41
  251. package/es/components/HDLKiosk/app/operations/types.js +0 -11
  252. package/es/components/HDLKiosk/devices/entryArbiter.js +0 -33
  253. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -75
  254. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -160
  255. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -185
  256. package/es/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -12
  257. package/es/components/HDLKiosk/slices/customization/operation.js +0 -80
  258. package/es/components/HDLKiosk/slices/identity/operation.js +0 -60
  259. package/es/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -692
  260. package/lib/components/HDLKiosk/app/constants.js +0 -9
  261. package/lib/components/HDLKiosk/app/operations/barcode.js +0 -21
  262. package/lib/components/HDLKiosk/app/operations/cart.js +0 -62
  263. package/lib/components/HDLKiosk/app/operations/fulfillment.js +0 -10
  264. package/lib/components/HDLKiosk/app/operations/session.js +0 -42
  265. package/lib/components/HDLKiosk/app/operations/types.js +0 -12
  266. package/lib/components/HDLKiosk/devices/entryArbiter.js +0 -33
  267. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -76
  268. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -161
  269. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -186
  270. package/lib/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -13
  271. package/lib/components/HDLKiosk/slices/customization/operation.js +0 -83
  272. package/lib/components/HDLKiosk/slices/identity/operation.js +0 -60
  273. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -694
  274. /package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
  275. /package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
@@ -0,0 +1,55 @@
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { identitySyncOperation } from "../../app/operations.js";
3
+ import { createOperationError, operationFailed, operationUnknown } from "./errors.js";
4
+ import { bindOperation } from "./types.js";
5
+ //#region src/components/HDLKiosk/runtime/operations/identity.ts
6
+ function partialFailure(code, cause) {
7
+ return {
8
+ status: "partialFailure",
9
+ error: createOperationError(code, "staff", cause)
10
+ };
11
+ }
12
+ function identityMatches(customerId, customer) {
13
+ if (!customerId) return (customer === null || customer === void 0 ? void 0 : customer.member) !== true;
14
+ if ((customer === null || customer === void 0 ? void 0 : customer.member) !== true) return false;
15
+ return customer.customerId === customerId;
16
+ }
17
+ const identitySyncOperationBinding = bindOperation(identitySyncOperation, { execute: function() {
18
+ var _ref = _asyncToGenerator(function* (context, input, signal) {
19
+ var _input$customerId;
20
+ if (!input || input.customerId !== void 0 && !input.customerId.trim()) return operationFailed("identityInputInvalid", "back");
21
+ const customerId = (_input$customerId = input.customerId) === null || _input$customerId === void 0 ? void 0 : _input$customerId.trim();
22
+ const beforeSelection = context.host.sales.getObservedSnapshot();
23
+ const selected = yield context.host.sales.selectIdentity(customerId ? { customerId } : {}, signal);
24
+ if (selected.status !== "succeeded") return selected;
25
+ if (signal.aborted) return operationUnknown("identityAbortedAfterWrite");
26
+ const afterSelection = context.host.sales.getObservedSnapshot();
27
+ const hasOrderLines = beforeSelection.cart.lineCount > 0 || afterSelection.cart.lineCount > 0;
28
+ let summaryConfirmed = false;
29
+ if (hasOrderLines) {
30
+ const consistency = yield context.host.sales.waitForCartConsistency(signal);
31
+ if (consistency.status !== "succeeded") {
32
+ if (consistency.status === "unknown") return consistency;
33
+ return partialFailure("identityConsistencyFailed", consistency);
34
+ }
35
+ const summary = yield context.host.sales.recalculateSummary(signal);
36
+ if (summary.status !== "succeeded") {
37
+ if (summary.status === "unknown") return summary;
38
+ return partialFailure("identitySummaryRecalculationFailed", summary);
39
+ }
40
+ summaryConfirmed = Boolean(summary.data.confirmedSummary);
41
+ }
42
+ const observed = context.host.sales.getObservedSnapshot();
43
+ if (hasOrderLines && !summaryConfirmed && observed.summary.status !== "ready") return partialFailure("identitySummaryProjectionMissing");
44
+ if (!(customerId ? identityMatches(customerId, selected.data.customer) : selected.data.customer === void 0) && !identityMatches(customerId, observed.customer)) return operationUnknown("identitySelectionNotObserved");
45
+ return {
46
+ status: "succeeded",
47
+ data: void 0
48
+ };
49
+ });
50
+ return function execute(_x, _x2, _x3) {
51
+ return _ref.apply(this, arguments);
52
+ };
53
+ }() });
54
+ //#endregion
55
+ export { identitySyncOperationBinding };
@@ -0,0 +1,34 @@
1
+ import { createOperationRegistry } from "./types.js";
2
+ import { barcodeConsumeOperationBinding } from "./barcode.js";
3
+ import { cartAddProductOperationBinding, cartRemoveLineOperationBinding, cartUpdateQuantityOperationBinding } from "./cart.js";
4
+ import { checkoutOpenOperationBinding, checkoutPayEftposOperationBinding, checkoutPrepareOperationBinding, checkoutRequestStaffPaymentApprovalOperationBinding } from "./checkout.js";
5
+ import { setFulfillmentOperationBinding } from "./fulfillment.js";
6
+ import { sessionEnsureOperationBinding, sessionResetOperationBinding } from "./session.js";
7
+ import { identitySyncOperationBinding } from "./identity.js";
8
+ import { productRemovePrimaryProductOperationBinding, productSyncPrimaryWeightedProductOperationBinding } from "./customization.js";
9
+ //#region src/components/HDLKiosk/runtime/operations/registry.ts
10
+ /**
11
+ * 文件角色:为 HDLKiosk Operation Contract 提供生产 Runtime Handler Registry。
12
+ * 边界:Application Manifest 只引用 Contract;Host 业务方法只能从本 Binding 层进入。
13
+ */
14
+ const HDLKIOSK_OPERATION_BINDINGS = Object.freeze([
15
+ barcodeConsumeOperationBinding,
16
+ cartAddProductOperationBinding,
17
+ cartRemoveLineOperationBinding,
18
+ cartUpdateQuantityOperationBinding,
19
+ checkoutOpenOperationBinding,
20
+ checkoutPayEftposOperationBinding,
21
+ checkoutPrepareOperationBinding,
22
+ checkoutRequestStaffPaymentApprovalOperationBinding,
23
+ sessionEnsureOperationBinding,
24
+ sessionResetOperationBinding,
25
+ setFulfillmentOperationBinding,
26
+ identitySyncOperationBinding,
27
+ productRemovePrimaryProductOperationBinding,
28
+ productSyncPrimaryWeightedProductOperationBinding
29
+ ]);
30
+ function createHDLKioskOperationRegistry() {
31
+ return createOperationRegistry(HDLKIOSK_OPERATION_BINDINGS);
32
+ }
33
+ //#endregion
34
+ export { createHDLKioskOperationRegistry };
@@ -0,0 +1,29 @@
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { sessionEnsureOperation, sessionResetOperation } from "../../app/operations.js";
3
+ import { operationUnknown } from "./errors.js";
4
+ import { bindOperation } from "./types.js";
5
+ //#region src/components/HDLKiosk/runtime/operations/session.ts
6
+ function forwardFailure(result) {
7
+ return result;
8
+ }
9
+ const sessionEnsureOperationBinding = bindOperation(sessionEnsureOperation, { execute: ({ host }, _input, signal) => host.sales.ensureSession(signal) });
10
+ const sessionResetOperationBinding = bindOperation(sessionResetOperation, { execute: function() {
11
+ var _ref = _asyncToGenerator(function* ({ host }, _input, signal) {
12
+ const before = host.sales.getObservedSnapshot();
13
+ if (before.payment.status === "pending" || before.payment.status === "unknown") return operationUnknown("resetBlockedByPaymentState");
14
+ const reset = yield host.sales.clearAndReset(signal);
15
+ if (reset.status !== "succeeded") return forwardFailure(reset);
16
+ if (!reset.data.cartEmpty) return operationUnknown("resetHostResultNotEmpty");
17
+ const consistency = yield host.sales.waitForCartConsistency(signal);
18
+ if (consistency.status !== "succeeded") return forwardFailure(consistency);
19
+ return {
20
+ status: "succeeded",
21
+ data: void 0
22
+ };
23
+ });
24
+ return function execute(_x, _x2, _x3) {
25
+ return _ref.apply(this, arguments);
26
+ };
27
+ }() });
28
+ //#endregion
29
+ export { sessionEnsureOperationBinding, sessionResetOperationBinding };
@@ -0,0 +1,13 @@
1
+ import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import { createKernelOperationRegistry } from "../../kernel/operations/registry.js";
3
+ import { bindKernelOperation } from "../../kernel/operations/types.js";
4
+ //#region src/components/HDLKiosk/runtime/operations/types.ts
5
+ function bindOperation(contract, handler) {
6
+ const bound = bindKernelOperation(contract, { execute: handler.execute });
7
+ return Object.freeze(_objectSpread2(_objectSpread2({}, bound), {}, { verify: handler.verify }));
8
+ }
9
+ function createOperationRegistry(operations) {
10
+ return createKernelOperationRegistry(operations);
11
+ }
12
+ //#endregion
13
+ export { bindOperation, createOperationRegistry };
@@ -0,0 +1,14 @@
1
+ //#region src/components/HDLKiosk/runtime/session/blockPolicy.ts
2
+ const CHECKOUT_DISPATCH_OPERATIONS = new Set(["checkout.open", "checkout.payEftpos"]);
3
+ /** 这些结果发生在任何支付调用之前,不存在重复扣款风险。 */
4
+ const RETRYABLE_CHECKOUT_PREFLIGHT_ERRORS = new Set(["checkoutProjectionUnstable", "checkoutCartStillChanging"]);
5
+ function shouldHardBlockOperationResult(operationId, result) {
6
+ var _result$error$details;
7
+ if (result.status !== "partialFailure" && result.status !== "unknown") return false;
8
+ if (operationId === "session.reset") return true;
9
+ if (!CHECKOUT_DISPATCH_OPERATIONS.has(operationId)) return false;
10
+ if (((_result$error$details = result.error.details) === null || _result$error$details === void 0 ? void 0 : _result$error$details.checkoutDispatched) === false) return false;
11
+ return !RETRYABLE_CHECKOUT_PREFLIGHT_ERRORS.has(result.error.code);
12
+ }
13
+ //#endregion
14
+ export { shouldHardBlockOperationResult };
@@ -1,19 +1,21 @@
1
- import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
- import { createOperationCoordinator } from "../app/operations/coordinator.js";
3
- import { createHDLKioskOperationRegistry } from "../app/manifest.js";
4
- import { defaultActivityRegistry, getBuiltInWorkflowDefinition } from "../app/workflow/registry.js";
5
- import { defaultPredicateRegistry } from "../app/workflow/predicates.js";
6
- import { createHDLKioskBeforeEachGuard, defaultNavigationGuardRegistry } from "../app/workflow/navigationGuards.js";
7
- import { validateHDLKioskWorkflowPolicy } from "../app/workflow/policy.js";
8
- import { HDL_WORKFLOW_IDS } from "../app/constants.js";
9
- import { composeWorkflowLifecycles } from "../kernel/lifecycle.js";
10
- import { createWorkflowActor } from "../kernel/workflow/actor.js";
11
- import { compileWorkflowStructure } from "../kernel/workflow/compiler.js";
12
- import { createHDLKioskTransitionRunner } from "./domainTransitionRunner.js";
1
+ import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
3
+ import { defaultActivityRegistry, getBuiltInWorkflowDefinition } from "../../app/workflow/registry.js";
4
+ import { defaultPredicateRegistry } from "../../app/workflow/predicates.js";
5
+ import { createHDLKioskBeforeEachGuard, defaultNavigationGuardRegistry } from "../../app/workflow/navigationGuards.js";
6
+ import { validateHDLKioskWorkflowPolicy } from "../../app/workflow/policy.js";
7
+ import { HDL_WORKFLOW_IDS } from "../../app/workflow/index.js";
8
+ import { createHDLKioskOperationRegistry } from "../operations/registry.js";
9
+ import { composeWorkflowLifecycles } from "../../kernel/lifecycle.js";
10
+ import { createWorkflowActor } from "../../kernel/workflow/actor.js";
11
+ import { compileWorkflowStructure } from "../../kernel/workflow/compiler.js";
12
+ import { createOperationCoordinator } from "../operations/coordinator.js";
13
+ import { shouldHardBlockOperationResult } from "./blockPolicy.js";
14
+ import { createHDLKioskTransitionRunner } from "./transitionRunner.js";
13
15
  import { createHDLKioskWorkflowLifecycle } from "./workflowLifecycle.js";
14
16
  import { reduceHDLKioskWorkflowContext } from "./workflowContext.js";
15
17
  import { locales } from "@pisell/utils";
16
- //#region src/components/HDLKiosk/runtime/createWorkflowSession.ts
18
+ //#region src/components/HDLKiosk/runtime/session/createSession.ts
17
19
  /**
18
20
  * 文件角色:创建一次点餐会话所需的全部纯 Core 对象。
19
21
  * 运行机制:选择/编译 Definition,组装 Activity Registry、Operation Registry、
@@ -21,7 +23,7 @@ import { locales } from "@pisell/utils";
21
23
  * 边界:每次会话创建一次;不持有 React UI,也不复用上一单 Actor。
22
24
  */
23
25
  function createHDLKioskWorkflowSession(entry, host, options = {}) {
24
- var _options$initialConte, _options$lifecycleExt;
26
+ var _options$initialConte, _options$lifecycleExt, _options$cause, _options$sessionId;
25
27
  const operations = createHDLKioskOperationRegistry();
26
28
  const structuralCompilation = compileWorkflowStructure(getBuiltInWorkflowDefinition(entry), {
27
29
  operations,
@@ -41,7 +43,7 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
41
43
  });
42
44
  let actorRef;
43
45
  const coordinator = createOperationCoordinator(host, operations, {
44
- checkoutRequirementIds: definition.checkoutRequirements,
46
+ checkoutRequirementIds: definition.requirements,
45
47
  getWorkflowContext: () => {
46
48
  var _actorRef$getSnapshot;
47
49
  return (_actorRef$getSnapshot = actorRef === null || actorRef === void 0 ? void 0 : actorRef.getSnapshot().context) !== null && _actorRef$getSnapshot !== void 0 ? _actorRef$getSnapshot : initialContext;
@@ -66,6 +68,40 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
66
68
  beforeEach: createHDLKioskBeforeEachGuard(() => host.sales.getObservedSnapshot())
67
69
  });
68
70
  actorRef = workflowActor;
71
+ let paymentProjectionObservationId;
72
+ const advanceConfirmedPayment = () => {
73
+ var _definition$nodes$sna;
74
+ const snapshot = workflowActor.getSnapshot();
75
+ const projection = host.sales.getObservedSnapshot();
76
+ if (snapshot.status !== "idle" || ((_definition$nodes$sna = definition.nodes[snapshot.nodeId]) === null || _definition$nodes$sna === void 0 ? void 0 : _definition$nodes$sna.activity) !== "paymentMethod" || projection.payment.status !== "succeeded" || paymentProjectionObservationId === projection.observationId) return;
77
+ paymentProjectionObservationId = projection.observationId;
78
+ workflowActor.send({
79
+ type: "ACTIVITY_INTENT",
80
+ stepId: snapshot.nodeId,
81
+ activityId: "paymentMethod",
82
+ intent: "complete",
83
+ intentId: `projection:payment:${snapshot.sessionEpoch}:${projection.observationId}`
84
+ });
85
+ };
86
+ let unsubscribePaymentProjection = () => void 0;
87
+ let unsubscribePaymentWorkflow = () => void 0;
88
+ try {
89
+ unsubscribePaymentProjection = host.sales.subscribe(advanceConfirmedPayment);
90
+ unsubscribePaymentWorkflow = workflowActor.subscribe(advanceConfirmedPayment);
91
+ } catch (error) {
92
+ unsubscribePaymentProjection();
93
+ workflowActor.dispose();
94
+ throw error;
95
+ }
96
+ advanceConfirmedPayment();
97
+ const sessionSnapshot = workflowActor.getSnapshot();
98
+ const cause = (_options$cause = options.cause) !== null && _options$cause !== void 0 ? _options$cause : Object.freeze({
99
+ trigger: "manual",
100
+ channel: definition.id,
101
+ occurrenceId: `${definition.id}:${sessionSnapshot.sessionEpoch}`,
102
+ correlationId: `${definition.id}:${sessionSnapshot.sessionEpoch}`
103
+ });
104
+ let disposed = false;
69
105
  try {
70
106
  const snapshot = workflowActor.getSnapshot();
71
107
  host.telemetry.emit({
@@ -79,10 +115,24 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
79
115
  }
80
116
  });
81
117
  } catch (_unused) {}
118
+ const disposeSession = () => {
119
+ if (disposed) return;
120
+ disposed = true;
121
+ unsubscribePaymentProjection();
122
+ unsubscribePaymentWorkflow();
123
+ workflowActor.dispose();
124
+ };
125
+ const publicActor = Object.freeze(_objectSpread2(_objectSpread2({}, workflowActor), {}, { dispose: disposeSession }));
82
126
  return Object.freeze({
127
+ id: (_options$sessionId = options.sessionId) !== null && _options$sessionId !== void 0 ? _options$sessionId : `${definition.id}:${sessionSnapshot.sessionEpoch}:${cause.occurrenceId}`,
128
+ workflowId: definition.id,
129
+ cause,
83
130
  entry,
84
131
  definition,
85
- actor: workflowActor,
132
+ actor: publicActor,
133
+ dispatch: (event) => workflowActor.send(event),
134
+ isActive: () => !disposed && workflowActor.getSnapshot().status !== "finished",
135
+ dispose: disposeSession,
86
136
  ensure: (intentId) => {
87
137
  const snapshot = workflowActor.getSnapshot();
88
138
  return coordinator.execute("session.ensure", {
@@ -101,7 +151,7 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
101
151
  sessionEpoch: snapshot.sessionEpoch,
102
152
  input
103
153
  });
104
- if (result.status === "partialFailure" || result.status === "unknown") workflowActor.block(result.error, intentId);
154
+ if (shouldHardBlockOperationResult(commandId, result)) workflowActor.block(result.error, intentId);
105
155
  return result;
106
156
  });
107
157
  return function executeCommand(_x, _x2, _x3) {
@@ -1,6 +1,7 @@
1
- import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
- import { resolveOperationTransition } from "../kernel/workflow/transition.js";
3
- //#region src/components/HDLKiosk/runtime/domainTransitionRunner.ts
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { resolveOperationTransition } from "../../kernel/workflow/transition.js";
3
+ import { shouldHardBlockOperationResult } from "./blockPolicy.js";
4
+ //#region src/components/HDLKiosk/runtime/session/transitionRunner.ts
4
5
  let domainErrorSequence = 0;
5
6
  function createDomainWorkflowError(code, recovery = "staff", cause) {
6
7
  domainErrorSequence += 1;
@@ -44,7 +45,7 @@ function createHDLKioskTransitionRunner({ host, coordinator, predicates, now = D
44
45
  const error = createDomainWorkflowError("workflowPredicateEvaluationFailed", "staff", cause);
45
46
  emitError(error, workflowId, stepId, event.intent);
46
47
  return {
47
- status: "blocked",
48
+ status: "stay",
48
49
  lastError: error
49
50
  };
50
51
  }
@@ -94,6 +95,10 @@ function createHDLKioskTransitionRunner({ host, coordinator, predicates, now = D
94
95
  status: "stay",
95
96
  lastError: createDomainWorkflowError("checkoutPaymentCancelled", "retry", result.reason)
96
97
  };
98
+ if ((result.status === "partialFailure" || result.status === "unknown") && !shouldHardBlockOperationResult(command.id, result)) return {
99
+ status: "stay",
100
+ lastError: result.error
101
+ };
97
102
  const decision = resolveOperationTransition({
98
103
  currentNodeId: stepId,
99
104
  targetNodeId: transition.target,
@@ -105,7 +110,7 @@ function createHDLKioskTransitionRunner({ host, coordinator, predicates, now = D
105
110
  };
106
111
  if (decision.nodeId === transition.target) return {
107
112
  status: "advance",
108
- confirmedCheckout: (command.id === "checkout.open" || command.id === "checkout.payEftpos") && result.status === "succeeded" ? result.data : void 0
113
+ receipt: (command.id === "checkout.open" || command.id === "checkout.payEftpos") && result.status === "succeeded" ? result.data : void 0
109
114
  };
110
115
  return {
111
116
  status: "stay",
@@ -1,5 +1,5 @@
1
- import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
- //#region src/components/HDLKiosk/runtime/workflowContext.ts
1
+ import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ //#region src/components/HDLKiosk/runtime/session/workflowContext.ts
3
3
  const reduceHDLKioskWorkflowContext = (context, patch) => {
4
4
  if (!patch) return context;
5
5
  const fulfillment = patch.fulfillment === "dine_in" || patch.fulfillment === "takeaway" ? patch.fulfillment : context.fulfillment;
@@ -1,5 +1,5 @@
1
- import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
- //#region src/components/HDLKiosk/runtime/workflowLifecycle.ts
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ //#region src/components/HDLKiosk/runtime/session/workflowLifecycle.ts
3
3
  function createHDLKioskWorkflowLifecycle(host, now = Date.now) {
4
4
  const lifecycle = {
5
5
  committed: function() {
@@ -0,0 +1,28 @@
1
+ import { createScaleIngress } from "./devices/scaleIngress.js";
2
+ //#region src/components/HDLKiosk/runtime/triggers.ts
3
+ function createHDLKioskEntryTriggerAdapters(host, config, scannerTriggerAdapter) {
4
+ const scaleIngress = createScaleIngress();
5
+ const onWeight = Object.freeze({
6
+ trigger: "onWeight",
7
+ activate: ({ emit }) => host.devices.subscribe((event) => {
8
+ if (event.type !== "weightChanged") return;
9
+ const accepted = scaleIngress.accept(event, {
10
+ active: true,
11
+ supported: config.enabledEntries.includes("scale") && Boolean(config.primaryWeightedProductId) && host.capabilities.scale.available && host.capabilities.scale.weightChangeTrigger,
12
+ workflowLocked: false,
13
+ nodeAcceptsEvent: true,
14
+ paymentFrozen: false
15
+ });
16
+ if (accepted.status !== "accepted") return;
17
+ emit({
18
+ channel: "weighing-product",
19
+ occurrenceId: accepted.event.eventId,
20
+ correlationId: `device:scale:${accepted.event.eventId}`,
21
+ payload: { weight: accepted.event.weight }
22
+ });
23
+ }, { sources: ["scale"] })
24
+ });
25
+ return Object.freeze([scannerTriggerAdapter, onWeight]);
26
+ }
27
+ //#endregion
28
+ export { createHDLKioskEntryTriggerAdapters };
@@ -226,20 +226,24 @@ function CatalogScreen({ products, loading, errorReference, errorMessage, busy,
226
226
  const item = rawItem;
227
227
  const product = item;
228
228
  const quantity = formatQuantity(orderBar.quantitiesByProduct[product.productId]);
229
+ const addProduct = () => send({
230
+ kind: "command",
231
+ command: "cart.addProduct",
232
+ input: {
233
+ productId: product.productId,
234
+ quantity: "1"
235
+ }
236
+ });
229
237
  const action = /* @__PURE__ */ React.createElement("button", {
230
238
  type: "button",
231
239
  className: `${KIOSK_CATALOG_PRODUCT_CARD_CLASS_NAME}__add`,
232
240
  disabled: busy || !product.available,
233
241
  "aria-label": `${locales.getText("pisell2.hdl-kiosk.catalog-add-item")}: ${product.name}`,
234
242
  "aria-busy": busy || void 0,
235
- onClick: () => send({
236
- kind: "command",
237
- command: "cart.addProduct",
238
- input: {
239
- productId: product.productId,
240
- quantity: "1"
241
- }
242
- })
243
+ onClick: (event) => {
244
+ event.stopPropagation();
245
+ addProduct();
246
+ }
243
247
  }, quantity ? /* @__PURE__ */ React.createElement("span", { "data-length": Math.min(quantity.length, 5) }, quantity) : /* @__PURE__ */ React.createElement(PlusIcon, null));
244
248
  return /* @__PURE__ */ React.createElement(ProductCard, {
245
249
  key: product.productId,
@@ -247,6 +251,9 @@ function CatalogScreen({ products, loading, errorReference, errorMessage, busy,
247
251
  index,
248
252
  scenario: "booking2",
249
253
  selectionTrigger: "click",
254
+ onSelect: busy || !product.available ? void 0 : addProduct,
255
+ onSelectCover: busy || !product.available ? void 0 : addProduct,
256
+ onSelectInfo: busy || !product.available ? void 0 : addProduct,
250
257
  className: KIOSK_CATALOG_PRODUCT_CARD_CLASS_NAME,
251
258
  customSkuCardAllConfig: createKioskCatalogProductCardConfig({
252
259
  title: product.name,
@@ -1,5 +1,8 @@
1
1
  .pisell-hdl-kiosk {
2
2
  .hdl-catalog-screen {
3
+ --hdl-catalog-menu-font-level-1: 24px;
4
+ --hdl-catalog-menu-font-level-2: 20px;
5
+ --hdl-catalog-menu-font-level-3: 18px;
3
6
  position: relative;
4
7
  width: 100%;
5
8
  height: 100%;
@@ -9,16 +12,14 @@
9
12
  }
10
13
 
11
14
  .hdl-catalog-layout {
12
- display: grid;
15
+ display: flex;
13
16
  width: 100%;
14
17
  height: 100%;
15
18
  min-height: 0;
16
- grid-template-columns: clamp(96px, 18vw, 180px) minmax(0, 1fr);
17
19
  overflow: hidden;
18
20
  }
19
21
 
20
22
  .hdl-catalog-layout > .pisell-kiosk-category-sidebar {
21
- width: 100%;
22
23
  border-right-color: rgba(255, 255, 255, 0.1);
23
24
  background: #202735;
24
25
  --pisell-kiosk-cart-capsule-reserved-space: max(
@@ -49,14 +50,17 @@
49
50
  .pisell-kiosk-category-sidebar__tabbar
50
51
  .text-card {
51
52
  box-sizing: border-box;
53
+ min-height: 80px !important;
52
54
  justify-content: flex-start !important;
55
+ gap: 10px !important;
53
56
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
54
57
  border-radius: 14px !important;
58
+ padding: 10px 16px !important;
55
59
  background: rgba(255, 255, 255, 0.06) !important;
56
60
  color: rgba(255, 255, 255, 0.78) !important;
57
- font-size: 29px;
58
- font-weight: 950;
59
- line-height: 1.05;
61
+ font-size: var(--hdl-catalog-menu-font-level-1);
62
+ font-weight: 850;
63
+ line-height: 1.15;
60
64
  text-align: left;
61
65
  }
62
66
 
@@ -65,9 +69,9 @@
65
69
  .text-card
66
70
  .text-card__content {
67
71
  color: rgba(255, 255, 255, 0.78) !important;
68
- font-size: 29px !important;
69
- font-weight: 950 !important;
70
- line-height: 1.05;
72
+ font-size: var(--hdl-catalog-menu-font-level-1) !important;
73
+ font-weight: 850 !important;
74
+ line-height: 1.15;
71
75
  text-align: left !important;
72
76
  }
73
77
 
@@ -84,6 +88,16 @@
84
88
  .text-card
85
89
  .anticon {
86
90
  color: rgba(255, 255, 255, 0.86) !important;
91
+ font-size: 24px !important;
92
+ }
93
+
94
+ .hdl-catalog-layout
95
+ .pisell-kiosk-category-sidebar__tabbar
96
+ .text-card
97
+ .text-card__icon
98
+ img {
99
+ width: 24px !important;
100
+ height: 24px !important;
87
101
  }
88
102
 
89
103
  .hdl-catalog-layout
@@ -130,10 +144,14 @@
130
144
  .pisell-kiosk-category-sidebar__tabbar
131
145
  .pisell-tabbar__level--2
132
146
  .text-card {
147
+ min-height: 68px !important;
148
+ gap: 8px !important;
133
149
  border-radius: 12px !important;
150
+ padding: 8px 14px !important;
134
151
  background: transparent !important;
135
- font-size: 21px;
152
+ font-size: var(--hdl-catalog-menu-font-level-2);
136
153
  font-weight: 850;
154
+ line-height: 1.15;
137
155
  }
138
156
 
139
157
  .hdl-catalog-layout
@@ -141,18 +159,23 @@
141
159
  .pisell-tabbar__level--2
142
160
  .text-card
143
161
  .text-card__content {
144
- font-size: 21px !important;
162
+ font-size: var(--hdl-catalog-menu-font-level-2) !important;
145
163
  font-weight: 850 !important;
164
+ line-height: 1.15;
146
165
  }
147
166
 
148
167
  .hdl-catalog-layout
149
168
  .pisell-kiosk-category-sidebar__tabbar
150
169
  .pisell-tabbar__level--3
151
170
  .text-card {
171
+ min-height: 60px !important;
172
+ gap: 8px !important;
152
173
  border-radius: 10px !important;
174
+ padding: 7px 12px !important;
153
175
  background: transparent !important;
154
- font-size: 18px;
176
+ font-size: var(--hdl-catalog-menu-font-level-3);
155
177
  font-weight: 800;
178
+ line-height: 1.15;
156
179
  }
157
180
 
158
181
  .hdl-catalog-layout
@@ -160,8 +183,45 @@
160
183
  .pisell-tabbar__level--3
161
184
  .text-card
162
185
  .text-card__content {
163
- font-size: 18px !important;
186
+ font-size: var(--hdl-catalog-menu-font-level-3) !important;
164
187
  font-weight: 800 !important;
188
+ line-height: 1.15;
189
+ }
190
+
191
+ .hdl-catalog-layout
192
+ .pisell-kiosk-category-sidebar__tabbar
193
+ .pisell-tabbar__level--2
194
+ .text-card
195
+ :is(.pisell-icon, .iconfont, .anticon) {
196
+ font-size: 20px !important;
197
+ }
198
+
199
+ .hdl-catalog-layout
200
+ .pisell-kiosk-category-sidebar__tabbar
201
+ .pisell-tabbar__level--2
202
+ .text-card
203
+ .text-card__icon
204
+ img {
205
+ width: 20px !important;
206
+ height: 20px !important;
207
+ }
208
+
209
+ .hdl-catalog-layout
210
+ .pisell-kiosk-category-sidebar__tabbar
211
+ .pisell-tabbar__level--3
212
+ .text-card
213
+ :is(.pisell-icon, .iconfont, .anticon) {
214
+ font-size: 18px !important;
215
+ }
216
+
217
+ .hdl-catalog-layout
218
+ .pisell-kiosk-category-sidebar__tabbar
219
+ .pisell-tabbar__level--3
220
+ .text-card
221
+ .text-card__icon
222
+ img {
223
+ width: 18px !important;
224
+ height: 18px !important;
165
225
  }
166
226
 
167
227
  .hdl-catalog-layout
@@ -206,6 +266,7 @@
206
266
  .hdl-catalog-main {
207
267
  position: relative;
208
268
  display: flex;
269
+ flex: 1 1 0;
209
270
  min-width: 0;
210
271
  min-height: 0;
211
272
  flex-direction: column;
@@ -1,10 +1,10 @@
1
1
  import { defineSlice, intentPrecondition } from "../../kernel/application/defineSlice.js";
2
- import { cartAddProductOperation } from "../../app/operations/cart.js";
2
+ import { cartAddProductOperation } from "../../app/operations.js";
3
3
  //#region src/components/HDLKiosk/slices/catalog/slice.ts
4
4
  /** Catalog Slice:声明补充商品加购;商品浏览动作不进入 Workflow。 */
5
5
  const catalogSlice = defineSlice({
6
6
  id: "catalog",
7
- screen: { id: "catalog" },
7
+ surface: { id: "catalog" },
8
8
  commands: { addProduct: cartAddProductOperation },
9
9
  intents: { complete: intentPrecondition("cart.notEmpty", { navigate: "next" }) }
10
10
  });