@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,25 @@
1
+ import { useEffect, useState } from "react";
2
+ //#region src/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.ts
3
+ /**
4
+ * 文件角色:把 Scale 连接状态投影给 React Entry。
5
+ * 运行机制:只观察 connectionChanged;称重启动完全由 Runtime 的 onWeight Adapter 持有。
6
+ * 边界:不消费重量、不创建 Session,也不参与 Trigger 路由。
7
+ */
8
+ function useHDLKioskDeviceController({ host, isActive }) {
9
+ const [scaleConnectionState, setScaleConnectionState] = useState();
10
+ useEffect(() => {
11
+ setScaleConnectionState(void 0);
12
+ }, [host]);
13
+ useEffect(() => {
14
+ if (!isActive || !host.capabilities.scale.available) return void 0;
15
+ return host.devices.subscribe((event) => {
16
+ if (event.type === "connectionChanged" && event.device === "scale") {
17
+ var _event$state;
18
+ setScaleConnectionState((_event$state = event.state) !== null && _event$state !== void 0 ? _event$state : event.connected ? "connected" : "disconnected");
19
+ }
20
+ }, { sources: ["scale"] });
21
+ }, [host, isActive]);
22
+ return { scaleConnectionState };
23
+ }
24
+ //#endregion
25
+ export { useHDLKioskDeviceController };
@@ -0,0 +1,53 @@
1
+ import { useCallback, useEffect, useRef } from "react";
2
+ //#region src/components/HDLKiosk/ui/controllers/useHDLKioskExitController.ts
3
+ /**
4
+ * 文件角色:适配 Session Exit Navigation 与验证式订单重置。
5
+ * 运行机制:用户退出先经过 Actor Guard/确认;自动退出直接解析既有 Pending Navigation,
6
+ * 两者最终都调用 Runtime 提供的 returnToEntry。
7
+ * 边界:不拥有 reset pending/error,也不渲染确认弹层。
8
+ */
9
+ function useHDLKioskExitController({ session, snapshot, returnToEntry }) {
10
+ var _snapshot$pendingNavi, _snapshot$pendingNavi2;
11
+ const sequence = useRef(0);
12
+ const pendingConfirmation = ((_snapshot$pendingNavi = snapshot.pendingNavigation) === null || _snapshot$pendingNavi === void 0 ? void 0 : _snapshot$pendingNavi.request.kind) === "confirmEndOrder" ? snapshot.pendingNavigation : void 0;
13
+ const pendingAutomaticExit = ((_snapshot$pendingNavi2 = snapshot.pendingNavigation) === null || _snapshot$pendingNavi2 === void 0 ? void 0 : _snapshot$pendingNavi2.request.kind) === "performSessionExit" ? snapshot.pendingNavigation : void 0;
14
+ const resetSession = useCallback(() => {
15
+ returnToEntry("ui");
16
+ }, [returnToEntry]);
17
+ const requestEndOrder = useCallback(() => {
18
+ sequence.current += 1;
19
+ session.actor.navigate({
20
+ kind: "sessionExit",
21
+ reason: "userRequest"
22
+ }, `ui:${snapshot.sessionEpoch}:exit:${sequence.current}`);
23
+ }, [session.actor, snapshot.sessionEpoch]);
24
+ const cancelEndOrder = useCallback(() => {
25
+ if (!pendingConfirmation) return;
26
+ session.actor.resolvePendingNavigation(pendingConfirmation.navigationId, "cancel");
27
+ }, [pendingConfirmation, session.actor]);
28
+ const confirmEndOrder = useCallback(() => {
29
+ if (!pendingConfirmation || !session.actor.resolvePendingNavigation(pendingConfirmation.navigationId, "allow")) return;
30
+ resetSession();
31
+ }, [
32
+ pendingConfirmation,
33
+ resetSession,
34
+ session.actor
35
+ ]);
36
+ useEffect(() => {
37
+ if (!pendingAutomaticExit || !session.actor.resolvePendingNavigation(pendingAutomaticExit.navigationId, "allow")) return;
38
+ resetSession();
39
+ }, [
40
+ pendingAutomaticExit,
41
+ resetSession,
42
+ session.actor
43
+ ]);
44
+ return {
45
+ endOrderConfirmationOpen: Boolean(pendingConfirmation),
46
+ resetSession,
47
+ requestEndOrder,
48
+ cancelEndOrder,
49
+ confirmEndOrder
50
+ };
51
+ }
52
+ //#endregion
53
+ export { useHDLKioskExitController };
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- //#region src/components/HDLKiosk/runtime/controllers/useHDLKioskScreenData.ts
2
+ //#region src/components/HDLKiosk/ui/controllers/useHDLKioskScreenData.ts
3
3
  /**
4
4
  * 文件角色:按当前 Screen 集中加载页面所需的 Catalog/称重/定制商品数据。
5
5
  * 运行机制:观察当前节点,调用 Host read/query 能力并输出 loading/ready/error 数据,
@@ -0,0 +1,39 @@
1
+ import { createHDLKioskApplicationRuntime } from "../../runtime/createRuntime.js";
2
+ import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
3
+ //#region src/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.ts
4
+ /**
5
+ * 文件角色:把 React Entry 状态适配到无头 Application Runtime。
6
+ * 运行机制:Controller 只处理能力/可见性和 UI pending;Trigger 路由、Session 创建、
7
+ * ensure、单会话准入与销毁均由 Runtime 持有。
8
+ * 边界:不直接创建 Actor,也不消费具体 Screen 的局部交互。
9
+ */
10
+ function useHDLKioskSessionController({ host, config, isActive }) {
11
+ const applicationRuntime = useMemo(() => createHDLKioskApplicationRuntime(host, { config }), [config, host]);
12
+ const snapshot = useSyncExternalStore(applicationRuntime.subscribe, applicationRuntime.getSnapshot, applicationRuntime.getSnapshot);
13
+ useEffect(() => {
14
+ return () => applicationRuntime.dispose();
15
+ }, [applicationRuntime]);
16
+ useEffect(() => {
17
+ if (!isActive) {
18
+ applicationRuntime.deactivate();
19
+ return;
20
+ }
21
+ applicationRuntime.activate();
22
+ return () => applicationRuntime.deactivate();
23
+ }, [applicationRuntime, isActive]);
24
+ const start = useCallback(({ entry }) => applicationRuntime.start(entry), [applicationRuntime]);
25
+ const completeReset = useCallback((completedSession) => applicationRuntime.completeReset(completedSession), [applicationRuntime]);
26
+ const returnToEntry = useCallback((reason = "application") => applicationRuntime.returnToEntry(reason), [applicationRuntime]);
27
+ return {
28
+ session: snapshot.session,
29
+ starting: snapshot.starting,
30
+ startErrorReference: snapshot.startErrorReference,
31
+ returning: snapshot.returning,
32
+ returnError: snapshot.returnError,
33
+ start,
34
+ completeReset,
35
+ returnToEntry
36
+ };
37
+ }
38
+ //#endregion
39
+ export { useHDLKioskSessionController };
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { locales } from "@pisell/utils";
3
- //#region src/components/HDLKiosk/app/entry/Screen/index.tsx
3
+ //#region src/components/HDLKiosk/ui/entry/Screen/index.tsx
4
4
  const LANGUAGE_OPTIONS = Object.freeze([
5
5
  {
6
6
  value: "en",
@@ -23,10 +23,12 @@ const LANGUAGE_OPTIONS = Object.freeze([
23
23
  label: "Português"
24
24
  }
25
25
  ]);
26
- function BrandMark() {
27
- return /* @__PURE__ */ React.createElement("span", {
26
+ function BrandMark({ onClick }) {
27
+ return /* @__PURE__ */ React.createElement("button", {
28
28
  className: "hdl-entry-brand-mark",
29
- "aria-label": "Hi Malatang"
29
+ type: "button",
30
+ "aria-label": "打开称重模拟器",
31
+ onClick
30
32
  }, "Hi");
31
33
  }
32
34
  function GlobeIcon() {
@@ -176,7 +178,7 @@ function EntryGraphic({ entry }) {
176
178
  if (entry === "barcode") return /* @__PURE__ */ React.createElement(BarcodeGraphic, null);
177
179
  return /* @__PURE__ */ React.createElement(ScaleGraphic, null);
178
180
  }
179
- function EntryScreen({ locale, model, onLocaleChange, onTechnicalSupportClick, onSelect, busy = false, errorReference, errorMessage = "Unable to start a safe order session." }) {
181
+ function EntryScreen({ locale, model, onLocaleChange, onTechnicalSupportClick, onScaleSimulatorRequest, onSelect, busy = false, errorReference, errorMessage = "Unable to start a safe order session." }) {
180
182
  const [reachMode, setReachMode] = useState(false);
181
183
  const entryLocale = locale || "en";
182
184
  return /* @__PURE__ */ React.createElement("section", {
@@ -202,7 +204,7 @@ function EntryScreen({ locale, model, onLocaleChange, onTechnicalSupportClick, o
202
204
  }, /* @__PURE__ */ React.createElement("path", { d: "M112 248c-52-38-43-88-5-118 33-26 40-71 3-116" })), /* @__PURE__ */ React.createElement("svg", {
203
205
  className: "hdl-entry-steam hdl-entry-steam--two",
204
206
  viewBox: "0 0 180 260"
205
- }, /* @__PURE__ */ React.createElement("path", { d: "M71 250c38-41 22-78-6-111-31-37-19-78 16-125" })), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null)), /* @__PURE__ */ React.createElement("header", { className: "hdl-entry-screen__header" }, /* @__PURE__ */ React.createElement("div", { className: "hdl-entry-brand" }, /* @__PURE__ */ React.createElement(BrandMark, null), /* @__PURE__ */ React.createElement("span", { className: "hdl-entry-brand__copy" }, /* @__PURE__ */ React.createElement("strong", null, locales.getText("pisell2.hdl-kiosk.brand")), /* @__PURE__ */ React.createElement("small", null, "MALA · TANG"))), /* @__PURE__ */ React.createElement("label", { className: "hdl-entry-language" }, /* @__PURE__ */ React.createElement(GlobeIcon, null), /* @__PURE__ */ React.createElement("select", {
207
+ }, /* @__PURE__ */ React.createElement("path", { d: "M71 250c38-41 22-78-6-111-31-37-19-78 16-125" })), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null), /* @__PURE__ */ React.createElement("span", null)), /* @__PURE__ */ React.createElement("header", { className: "hdl-entry-screen__header" }, /* @__PURE__ */ React.createElement("div", { className: "hdl-entry-brand" }, /* @__PURE__ */ React.createElement(BrandMark, { onClick: onScaleSimulatorRequest }), /* @__PURE__ */ React.createElement("span", { className: "hdl-entry-brand__copy" }, /* @__PURE__ */ React.createElement("strong", null, locales.getText("pisell2.hdl-kiosk.brand")), /* @__PURE__ */ React.createElement("small", null, "MALA · TANG"))), /* @__PURE__ */ React.createElement("label", { className: "hdl-entry-language" }, /* @__PURE__ */ React.createElement(GlobeIcon, null), /* @__PURE__ */ React.createElement("select", {
206
208
  "aria-label": locales.getText("pisell2.hdl-kiosk.entry-language-label"),
207
209
  value: entryLocale,
208
210
  onChange: (event) => onLocaleChange === null || onLocaleChange === void 0 ? void 0 : onLocaleChange(event.target.value)
@@ -1,6 +1,6 @@
1
- import { isBuiltInWorkflowProductionReady } from "../workflow/registry.js";
1
+ import { isBuiltInWorkflowProductionReady } from "../../app/workflow/registry.js";
2
2
  import { locales } from "@pisell/utils";
3
- //#region src/components/HDLKiosk/app/entry/model.ts
3
+ //#region src/components/HDLKiosk/ui/entry/model.ts
4
4
  function createEntryScreenModel(config, capabilities, scaleConnectionState, hostStatus, entryDataPreparing = false) {
5
5
  const dataPreparing = entryDataPreparing || hostStatus === "loading";
6
6
  const hostUnavailable = hostStatus === "error";
@@ -0,0 +1,20 @@
1
+ import { createHDLScaleRuntime } from "../runtime/devices/scaleStore.js";
2
+ import React, { createContext, useContext, useSyncExternalStore } from "react";
3
+ //#region src/components/HDLKiosk/ui/scale.tsx
4
+ const HDLScaleRuntimeContext = createContext(createHDLScaleRuntime());
5
+ function HDLScaleRuntimeProvider({ runtime, children }) {
6
+ return React.createElement(HDLScaleRuntimeContext.Provider, {
7
+ value: runtime,
8
+ children
9
+ });
10
+ }
11
+ function useHDLScaleSnapshot() {
12
+ const runtime = useContext(HDLScaleRuntimeContext);
13
+ return useSyncExternalStore(runtime.subscribe, runtime.getSnapshot, runtime.getSnapshot);
14
+ }
15
+ /** 仅供提交边界同步读取点击当下的最新设备快照。 */
16
+ function useHDLScaleRuntime() {
17
+ return useContext(HDLScaleRuntimeContext);
18
+ }
19
+ //#endregion
20
+ export { HDLScaleRuntimeProvider, useHDLScaleRuntime, useHDLScaleSnapshot };
@@ -1,11 +1,6 @@
1
1
  import { useCallback, useRef, useSyncExternalStore } from "react";
2
- //#region src/components/HDLKiosk/runtime/useHostSnapshot.ts
3
- /**
4
- * 文件角色:将 Host Sales Projection 安全接入 React。
5
- * 运行机制:通过 useSyncExternalStore 订阅统一快照,确保同一次 render 读取一致事实并
6
- * 兼容 Host 对象身份稳定、内部来源变化的情况。
7
- * 边界:只读,不触发 load/recalc,也不复制一份 React 订单状态。
8
- */
2
+ //#region src/components/HDLKiosk/ui/snapshots.ts
3
+ /** 将纯 Host 与 Workflow 快照安全接入 React,不发送命令或派生业务事实。 */
9
4
  function useHostSnapshot(host) {
10
5
  const cacheRef = useRef();
11
6
  const getSnapshot = useCallback(() => {
@@ -20,5 +15,8 @@ function useHostSnapshot(host) {
20
15
  }, [host]);
21
16
  return useSyncExternalStore(host.sales.subscribe, getSnapshot, getSnapshot);
22
17
  }
18
+ function useWorkflowSnapshot(actor) {
19
+ return useSyncExternalStore(actor.subscribe, actor.getSnapshot, actor.getSnapshot);
20
+ }
23
21
  //#endregion
24
- export { useHostSnapshot };
22
+ export { useHostSnapshot, useWorkflowSnapshot };
@@ -4,7 +4,7 @@ import { renderFulfillment } from "../slices/fulfillment/view.js";
4
4
  import { renderIdentity } from "../slices/identity/view.js";
5
5
  import { renderPayment } from "../slices/payment/view.js";
6
6
  import { renderPrimaryProductPrompt } from "../slices/primaryProductPrompt/view.js";
7
- //#region src/components/HDLKiosk/app/views.ts
7
+ //#region src/components/HDLKiosk/ui/views.ts
8
8
  const hdlKioskViews = Object.freeze({
9
9
  identity: renderIdentity,
10
10
  fulfillment: renderFulfillment,
@@ -1,6 +1,6 @@
1
1
  import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
2
  import { _objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
3
- //#region src/components/HDLKiosk/runtime/workflowEvent.ts
3
+ //#region src/components/HDLKiosk/ui/workflowEvent.ts
4
4
  const _excluded = ["kind"];
5
5
  function createWorkflowEvent(action, currentActivity, stepId, intentId) {
6
6
  if (action.activityId !== currentActivity) return void 0;
@@ -56,10 +56,10 @@ function createCartDrawerModel(sales, primaryWeightedProductId) {
56
56
  totalLabel: totalText ? locales.getText("pisell2.hdl-kiosk.total") : locales.getText("pisell2.hdl-kiosk.total-calculating")
57
57
  });
58
58
  }
59
- function createActivityScreenModel(screenId, snapshot, node, sales, businessMode = "prototype") {
59
+ function createActivityScreenModel(surfaceId, snapshot, node, sales, businessMode = "prototype") {
60
60
  let title;
61
61
  let description;
62
- switch (screenId) {
62
+ switch (surfaceId) {
63
63
  case "entry":
64
64
  title = locales.getText("pisell2.hdl-kiosk.entry-title");
65
65
  description = locales.getText("pisell2.hdl-kiosk.entry-supporting");
@@ -85,12 +85,12 @@ function createActivityScreenModel(screenId, snapshot, node, sales, businessMode
85
85
  description = locales.getText("pisell2.hdl-kiosk.checkout-title");
86
86
  break;
87
87
  }
88
- const canReviewCatalog = screenId !== "catalog" || sales.cart.lineCount > 0;
88
+ const canReviewCatalog = surfaceId !== "catalog" || sales.cart.lineCount > 0;
89
89
  const placeholder = node.readiness === "placeholder";
90
90
  const placeholderBlocked = placeholder && businessMode === "production";
91
91
  const error = resolveHDLKioskErrorPresentation({ error: snapshot.lastError });
92
92
  return Object.freeze({
93
- screenId,
93
+ surfaceId,
94
94
  activity: node.activity,
95
95
  title,
96
96
  description,
@@ -0,0 +1,43 @@
1
+ # BigSale HDLKiosk integration
2
+
3
+ This directory is the compatibility boundary between BigSale/SalesSDK and the
4
+ independent `components/HDLKiosk` material.
5
+
6
+ ## Structure
7
+
8
+ - `index.tsx`: outer composition only; renders device owners, HDLKiosk and the
9
+ embedded payment runtime.
10
+ - `adapter/useBigSaleHDLKioskAdapter.ts`: owns late React capabilities and the
11
+ stable Host assembly (payment controller, authenticated customer, scale and
12
+ fulfillment).
13
+ - `adapter/useBigSaleHDLKioskHost.ts`: bridges changing React Context into one
14
+ stable Host and publishes semantic Projection changes.
15
+ - `adapter/createHost.ts`: pure Host composition factory.
16
+ - `adapter/host/`: pure Host support: capabilities, Projection, telemetry and
17
+ the fulfillment writer.
18
+ - `adapter/devices/`: raw BigSale device sources converted to HDLKiosk ports.
19
+ - `adapter/sales/index.ts`: composition-only Sales Port entry.
20
+ - `adapter/sales/`: capability modules for session, catalog, identity,
21
+ fulfillment, cart, weighted products and payment.
22
+ - `runtime/scaleBridge.ts`: owns one Scale Snapshot runtime and one standard
23
+ device-event stream.
24
+ - `runtime/BigSaleScaleRuntimeOwner.tsx`: the only React owner of the native
25
+ scale Hook; publishes exclusively through ScaleBridge.
26
+ - `runtime/HDLKioskPaymentRuntime.tsx`: React-owned payment runtime.
27
+ - `hooks/`: template-level React effects that are not Host adapters.
28
+ - `cart/`: SaleDetail-based cart overlay presentation.
29
+ - `auth/`: BigSale login/register integration.
30
+
31
+ ## Boundary rules
32
+
33
+ 1. Raw BigSale, SalesSDK and OS objects stop in this directory.
34
+ 2. HDLKiosk Core receives only contracts from `components/HDLKiosk/app`.
35
+ 3. Reads use Projection snapshots; writes use explicit Host operations.
36
+ 4. A stable Host must pair `getSnapshot` with semantic `subscribe`
37
+ notifications. Updating a ref without publishing is not a valid store.
38
+ 5. React-owned capabilities are assembled in `useBigSaleHDLKioskAdapter`; do
39
+ not add new controller refs to `index.tsx`.
40
+ 6. Add capability-specific code to `adapter/sales/` rather than growing the
41
+ Sales Port composition file with unrelated concerns.
42
+ 7. Keep tests beside their capability. Shared BigSale test data belongs in
43
+ `adapter/testing/`, not in a new aggregate adapter suite.
@@ -1,11 +1,11 @@
1
- import { resolveBigSaleHDLKioskCapabilities } from "./capabilities.js";
2
- import { createBigSaleDevicePort } from "./devices.js";
3
- import { createBigSaleProjectionReader } from "./projection.js";
4
- import { createBigSaleSalesPort } from "./sales.js";
5
- import { createBigSaleTelemetryPort } from "./telemetry.js";
1
+ import { resolveBigSaleHDLKioskCapabilities } from "./host/capabilities.js";
2
+ import { createBigSaleDevicePort } from "./devices/devicePort.js";
3
+ import { createBigSaleProjectionReader } from "./host/projection.js";
4
+ import { createBigSaleSalesPort } from "./sales/index.js";
5
+ import { createBigSaleTelemetryPort } from "./host/telemetry.js";
6
6
  //#region src/components/bigSale/templates/HDLKiosk/adapter/createHost.ts
7
7
  function createBigSaleHDLKioskHost({ getContext, executeScan, hasScanExecutionSource, devices, writeFulfillment, getWriteFulfillment, getAuthenticatedCustomer, allowSimulatedFulfillment, subscribeProjection, getPickupReferenceMode, getPaymentController }) {
8
- const resolveScaleWeightChangeSource = () => (devices === null || devices === void 0 ? void 0 : devices.getSubscribeWeightChange) ? devices.getSubscribeWeightChange() : devices === null || devices === void 0 ? void 0 : devices.subscribeWeightChange;
8
+ const resolveScaleEventSource = () => (devices === null || devices === void 0 ? void 0 : devices.getSubscribeScaleEvents) ? devices.getSubscribeScaleEvents() : devices === null || devices === void 0 ? void 0 : devices.subscribeScaleEvents;
9
9
  const getSnapshot = createBigSaleProjectionReader(getContext, getPickupReferenceMode);
10
10
  const telemetry = createBigSaleTelemetryPort();
11
11
  let compatibilityFallbackSequence = 0;
@@ -37,7 +37,7 @@ function createBigSaleHDLKioskHost({ getContext, executeScan, hasScanExecutionSo
37
37
  telemetry,
38
38
  get capabilities() {
39
39
  return resolveBigSaleHDLKioskCapabilities(getContext(), {
40
- hasScaleWeightChangeSource: typeof resolveScaleWeightChangeSource() === "function",
40
+ hasScaleWeightChangeSource: typeof resolveScaleEventSource() === "function",
41
41
  hasScanExecutionSource: (hasScanExecutionSource === null || hasScanExecutionSource === void 0 ? void 0 : hasScanExecutionSource()) === true
42
42
  });
43
43
  }
@@ -1,4 +1,4 @@
1
- //#region src/components/bigSale/templates/HDLKiosk/adapter/devices.ts
1
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/devices/devicePort.ts
2
2
  const SCAN_RESULT_EVENT = "nativeScanResult";
3
3
  const FALLBACK_DEDUPE_WINDOW_MS = 350;
4
4
  function fingerprint(value) {
@@ -13,7 +13,7 @@ function fingerprint(value) {
13
13
  * BigSale/PisellOS 原始扫码协议只停留在本文件。缺少宿主 eventId 时使用
14
14
  * 非明文 fingerprint + 短窗口合成降级 ID;capability 会保持 stableEventId=false。
15
15
  */
16
- function createBigSaleDevicePort({ getPubsub, getAcquireScanFocus, subscribeWeightChange, subscribeScaleConnection, getSubscribeWeightChange, getSubscribeScaleConnection, now = Date.now } = {}) {
16
+ function createBigSaleDevicePort({ getPubsub, getAcquireScanFocus, subscribeScaleEvents, getSubscribeScaleEvents, now = Date.now } = {}) {
17
17
  const listeners = /* @__PURE__ */ new Map();
18
18
  let stopScanner;
19
19
  let stopScale;
@@ -82,44 +82,16 @@ function createBigSaleDevicePort({ getPubsub, getAcquireScanFocus, subscribeWeig
82
82
  } catch (_unused5) {}
83
83
  };
84
84
  const connectScale = () => {
85
- const currentSubscribeWeightChange = getSubscribeWeightChange ? getSubscribeWeightChange() : subscribeWeightChange;
86
- const currentSubscribeScaleConnection = getSubscribeScaleConnection ? getSubscribeScaleConnection() : subscribeScaleConnection;
87
- if (stopScale || !currentSubscribeWeightChange && !currentSubscribeScaleConnection) return;
88
- const cleanups = [];
89
- if (currentSubscribeWeightChange) try {
90
- const cleanup = currentSubscribeWeightChange((payload) => {
91
- var _payload$occurredAt, _payload$eventId;
92
- const occurredAt = (_payload$occurredAt = payload.occurredAt) !== null && _payload$occurredAt !== void 0 ? _payload$occurredAt : now();
93
- eventSequence += 1;
94
- emit("scale", {
95
- type: "weightChanged",
96
- eventId: (_payload$eventId = payload.eventId) !== null && _payload$eventId !== void 0 ? _payload$eventId : `big-sale-scale:${occurredAt}:${eventSequence}`,
97
- weight: payload.weight,
98
- occurredAt
99
- });
100
- });
101
- if (typeof cleanup === "function") cleanups.push(cleanup);
102
- } catch (_unused6) {}
103
- if (currentSubscribeScaleConnection) try {
104
- const cleanup = currentSubscribeScaleConnection((payload) => {
105
- var _payload$occurredAt2;
106
- emit("scale", {
107
- type: "connectionChanged",
108
- device: "scale",
109
- connected: payload.connected,
110
- state: payload.state,
111
- occurredAt: (_payload$occurredAt2 = payload.occurredAt) !== null && _payload$occurredAt2 !== void 0 ? _payload$occurredAt2 : now()
112
- });
113
- });
114
- if (typeof cleanup === "function") cleanups.push(cleanup);
115
- } catch (_unused7) {}
116
- stopScale = () => {
117
- cleanups.forEach((cleanup) => {
85
+ const currentSubscribe = getSubscribeScaleEvents ? getSubscribeScaleEvents() : subscribeScaleEvents;
86
+ if (stopScale || !currentSubscribe) return;
87
+ try {
88
+ const cleanup = currentSubscribe((event) => emit("scale", event));
89
+ stopScale = () => {
118
90
  try {
119
91
  cleanup();
120
- } catch (_unused8) {}
121
- });
122
- };
92
+ } catch (_unused6) {}
93
+ };
94
+ } catch (_unused7) {}
123
95
  };
124
96
  const syncConnections = () => {
125
97
  const scannerNeeded = Array.from(listeners.values()).some((sources) => sources.has("scanner"));
@@ -1,4 +1,4 @@
1
- //#region src/components/bigSale/templates/HDLKiosk/adapter/capabilities.ts
1
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/host/capabilities.ts
2
2
  function resolveBigSaleHDLKioskCapabilities(context, options = {}) {
3
3
  var _bookingTicket$store;
4
4
  const bookingTicket = context.sales.bookingTicket;
@@ -6,7 +6,7 @@ function resolveBigSaleHDLKioskCapabilities(context, options = {}) {
6
6
  const canUpdateCustomizedProduct = typeof context.cart.updateItem === "function" && typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.transformDetailToProductAndBooking) === "function";
7
7
  return {
8
8
  session: {
9
- ensure: typeof context.sales.createNew === "function",
9
+ ensure: typeof context.sales.createNew === "function" && typeof context.sales.clearCartAndReset === "function",
10
10
  reset: typeof context.sales.clearCartAndReset === "function"
11
11
  },
12
12
  cart: {
@@ -1,6 +1,6 @@
1
- import { _asyncToGenerator } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
- import { partialFailure, unknown } from "./normalize.js";
3
- //#region src/components/bigSale/templates/HDLKiosk/adapter/fulfillment.ts
1
+ import { _asyncToGenerator } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { partialFailure, unknown } from "../normalize.js";
3
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/host/fulfillmentWriter.ts
4
4
  function createHDLKioskFulfillmentWriter(runtime) {
5
5
  if (typeof (runtime === null || runtime === void 0 ? void 0 : runtime.setPickupReferenceMode) !== "function" || typeof (runtime === null || runtime === void 0 ? void 0 : runtime.setServiceType) !== "function") return;
6
6
  const setPickupReferenceMode = runtime.setPickupReferenceMode.bind(runtime);
@@ -1,13 +1,22 @@
1
- import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
- import { hasSkuSelection, resolveSkuValueCandidates } from "../../../../../plus/skuOptionsSelection/utils/resolveSkuValue.js";
1
+ import { _objectSpread2 } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import { hasSkuSelection, resolveSkuValueCandidates } from "../../../../../../plus/skuOptionsSelection/utils/resolveSkuValue.js";
3
3
  import Decimal from "decimal.js";
4
- //#region src/components/bigSale/templates/HDLKiosk/adapter/projection.ts
4
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/host/projection.ts
5
5
  /**
6
6
  * 文件角色:把 BigSale/SalesSDK 当前状态投影成 HDLKiosk 只读业务快照。
7
7
  * 运行机制:归一化订单行、称重数量、Summary、Customer、Payment 和 fingerprint,
8
8
  * 仅在语义变化时推进 observationId。
9
9
  * 边界:Projection 只读且不是第二个 Store;不得在这里执行 load、写入或前端定价。
10
10
  */
11
+ /**
12
+ * 交易门禁必须优先读取 OS 同步真源。SalesSDK reset 已完成但 React RootSnapshot
13
+ * 尚未提交时,context.tempOrder 可能仍是上一笔 paid 订单。
14
+ */
15
+ function resolveBigSaleLiveTempOrder(context) {
16
+ const bookingTicket = context.sales.bookingTicket;
17
+ if (typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.getTempOrder) === "function") return bookingTicket.getTempOrder();
18
+ return context.sales.tempOrder;
19
+ }
11
20
  function getProduct(line) {
12
21
  return "product_id" in line ? line : line._extend.product;
13
22
  }
@@ -93,9 +102,10 @@ function projectBigSaleCartLine(line) {
93
102
  });
94
103
  }
95
104
  function normalizePayment(context, cartLineCount) {
96
- var _context$sales$tempOr, _context$sales$tempOr2, _context$sales$tempOr3, _context$summary$summ;
97
- const paymentStatus = String((_context$sales$tempOr = (_context$sales$tempOr2 = context.sales.tempOrder) === null || _context$sales$tempOr2 === void 0 ? void 0 : _context$sales$tempOr2.payment_status) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : "").toLowerCase();
98
- const orderId = (_context$sales$tempOr3 = context.sales.tempOrder) === null || _context$sales$tempOr3 === void 0 ? void 0 : _context$sales$tempOr3.order_id;
105
+ var _tempOrder$payment_st, _context$summary$summ;
106
+ const tempOrder = resolveBigSaleLiveTempOrder(context);
107
+ const paymentStatus = String((_tempOrder$payment_st = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.payment_status) !== null && _tempOrder$payment_st !== void 0 ? _tempOrder$payment_st : "").toLowerCase();
108
+ const orderId = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id;
99
109
  const amount = (_context$summary$summ = context.summary.summary) === null || _context$summary$summ === void 0 ? void 0 : _context$summary$summ.total_amount;
100
110
  if (paymentStatus === "paid" && orderId != null && amount != null) return Object.freeze({
101
111
  status: "succeeded",
@@ -118,19 +128,19 @@ function resolveHDLKioskPickupReferenceMode(openData) {
118
128
  return (openData === null || openData === void 0 ? void 0 : openData["fulfillment.fulfillment_ref_mode"]) === "sale_number" ? "sale_number" : "short_number";
119
129
  }
120
130
  function resolvePickupNumber(context, mode) {
121
- var _context$sales$tempOr4;
131
+ var _context$sales$tempOr;
122
132
  const field = mode === "sale_number" ? "shop_order_number" : "shop_full_order_number";
123
- return ((_context$sales$tempOr4 = context.sales.tempOrder) === null || _context$sales$tempOr4 === void 0 ? void 0 : _context$sales$tempOr4[field]) || void 0;
133
+ return ((_context$sales$tempOr = context.sales.tempOrder) === null || _context$sales$tempOr === void 0 ? void 0 : _context$sales$tempOr[field]) || void 0;
124
134
  }
125
135
  function buildSnapshot(context, observationId, pickupReferenceMode) {
126
- var _context$cart$display, _context$sales$tempOr5, _context$sales$tempOr6, _context$sales$tempOr7, _context$sales$tempOr8, _context$customer$sel, _context$customer$sel2, _context$sales$tempOr9, _context$sales$tempOr10, _customer$customerId, _context$sales$tempOr11;
136
+ var _context$cart$display, _context$sales$tempOr2, _context$sales$tempOr3, _context$sales$tempOr4, _context$sales$tempOr5, _context$customer$sel, _context$customer$sel2, _context$sales$tempOr6, _context$sales$tempOr7, _customer$customerId, _context$sales$tempOr8;
127
137
  const rawLines = (_context$cart$display = context.cart.displayLines) !== null && _context$cart$display !== void 0 ? _context$cart$display : context.cart.items;
128
138
  const lines = Object.freeze(rawLines.map(projectBigSaleCartLine).filter((line) => line !== null));
129
139
  const summary = context.summary.summary;
130
140
  const normalizedSummary = summary ? Object.freeze({
131
141
  status: "ready",
132
- currency: String((_context$sales$tempOr5 = (_context$sales$tempOr6 = context.sales.tempOrder) === null || _context$sales$tempOr6 === void 0 ? void 0 : _context$sales$tempOr6.currency_code) !== null && _context$sales$tempOr5 !== void 0 ? _context$sales$tempOr5 : ""),
133
- currencySymbol: String((_context$sales$tempOr7 = (_context$sales$tempOr8 = context.sales.tempOrder) === null || _context$sales$tempOr8 === void 0 ? void 0 : _context$sales$tempOr8.currency_symbol) !== null && _context$sales$tempOr7 !== void 0 ? _context$sales$tempOr7 : ""),
142
+ currency: String((_context$sales$tempOr2 = (_context$sales$tempOr3 = context.sales.tempOrder) === null || _context$sales$tempOr3 === void 0 ? void 0 : _context$sales$tempOr3.currency_code) !== null && _context$sales$tempOr2 !== void 0 ? _context$sales$tempOr2 : ""),
143
+ currencySymbol: String((_context$sales$tempOr4 = (_context$sales$tempOr5 = context.sales.tempOrder) === null || _context$sales$tempOr5 === void 0 ? void 0 : _context$sales$tempOr5.currency_symbol) !== null && _context$sales$tempOr4 !== void 0 ? _context$sales$tempOr4 : ""),
134
144
  total: String(summary.total_amount),
135
145
  due: String(summary.expect_amount)
136
146
  }) : context.sales.status === "loading" ? Object.freeze({ status: "calculating" }) : Object.freeze({ status: "missing" });
@@ -144,7 +154,7 @@ function buildSnapshot(context, observationId, pickupReferenceMode) {
144
154
  ""
145
155
  ].includes(String((_context$customer$sel2 = context.customer.selected.id) !== null && _context$customer$sel2 !== void 0 ? _context$customer$sel2 : "")) })) : void 0;
146
156
  const fingerprintValue = [
147
- (_context$sales$tempOr9 = (_context$sales$tempOr10 = context.sales.tempOrder) === null || _context$sales$tempOr10 === void 0 ? void 0 : _context$sales$tempOr10.order_id) !== null && _context$sales$tempOr9 !== void 0 ? _context$sales$tempOr9 : "",
157
+ (_context$sales$tempOr6 = (_context$sales$tempOr7 = context.sales.tempOrder) === null || _context$sales$tempOr7 === void 0 ? void 0 : _context$sales$tempOr7.order_id) !== null && _context$sales$tempOr6 !== void 0 ? _context$sales$tempOr6 : "",
148
158
  ...lines.map((line) => `${line.lineId}:${line.quantity}`),
149
159
  normalizedSummary.status === "ready" ? normalizedSummary.due : "",
150
160
  (_customer$customerId = customer === null || customer === void 0 ? void 0 : customer.customerId) !== null && _customer$customerId !== void 0 ? _customer$customerId : ""
@@ -152,7 +162,7 @@ function buildSnapshot(context, observationId, pickupReferenceMode) {
152
162
  return Object.freeze({
153
163
  observationId,
154
164
  hostStatus: context.sales.status,
155
- orderId: ((_context$sales$tempOr11 = context.sales.tempOrder) === null || _context$sales$tempOr11 === void 0 ? void 0 : _context$sales$tempOr11.order_id) == null ? void 0 : String(context.sales.tempOrder.order_id),
165
+ orderId: ((_context$sales$tempOr8 = context.sales.tempOrder) === null || _context$sales$tempOr8 === void 0 ? void 0 : _context$sales$tempOr8.order_id) == null ? void 0 : String(context.sales.tempOrder.order_id),
156
166
  pickupNumber: resolvePickupNumber(context, pickupReferenceMode),
157
167
  cart: Object.freeze({
158
168
  lines,
@@ -183,4 +193,4 @@ function createBigSaleProjectionReader(getContext, getPickupReferenceMode = () =
183
193
  };
184
194
  }
185
195
  //#endregion
186
- export { createBigSaleProjectionReader, projectBigSaleCartLine, resolveBigSaleLineId, resolveHDLKioskPickupReferenceMode };
196
+ export { createBigSaleProjectionReader, projectBigSaleCartLine, resolveBigSaleLineId, resolveBigSaleLiveTempOrder, resolveHDLKioskPickupReferenceMode };
@@ -1,4 +1,4 @@
1
- //#region src/components/bigSale/templates/HDLKiosk/adapter/telemetry.ts
1
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/host/telemetry.ts
2
2
  /** M11 接入正式埋点前保持无副作用,不回退到散落 console。 */
3
3
  function createBigSaleTelemetryPort() {
4
4
  return { emit: () => void 0 };