brut 0.4.0 → 0.5.0

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 (378) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -1
  3. data/Gemfile.lock +1 -1
  4. data/assets/MetroIcon.graffle +0 -0
  5. data/brut-css/package-lock.json +2 -2
  6. data/brut-css/package.json +1 -1
  7. data/brut-css/src/css/flex.css +1 -1
  8. data/brut-css/src/docs/includes/body-and-header.html.ejs +1 -1
  9. data/brut-js/package-lock.json +2 -2
  10. data/brut-js/package.json +1 -1
  11. data/brut-js/specs/AjaxSubmit.spec.js +100 -7
  12. data/brut-js/src/AjaxSubmit.js +76 -40
  13. data/brutrb.com/adrs.md +1 -0
  14. data/docs/404.html +2 -2
  15. data/docs/adrs.html +5 -5
  16. data/docs/ai.html +3 -3
  17. data/docs/api/Brut/BackEnd/SeedData.html +1 -1
  18. data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server/FlushSpans.html +1 -1
  19. data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server.html +1 -1
  20. data/docs/api/Brut/BackEnd/Sidekiq/Middlewares.html +1 -1
  21. data/docs/api/Brut/BackEnd/Sidekiq.html +1 -1
  22. data/docs/api/Brut/BackEnd/Validators/FormValidator.html +1 -1
  23. data/docs/api/Brut/BackEnd/Validators.html +1 -1
  24. data/docs/api/Brut/BackEnd.html +1 -1
  25. data/docs/api/Brut/CLI/App.html +1 -1
  26. data/docs/api/Brut/CLI/AppRunner.html +1 -1
  27. data/docs/api/Brut/CLI/Apps/BuildAssets/All.html +1 -1
  28. data/docs/api/Brut/CLI/Apps/BuildAssets/CSS.html +1 -1
  29. data/docs/api/Brut/CLI/Apps/BuildAssets/Images.html +1 -1
  30. data/docs/api/Brut/CLI/Apps/BuildAssets/JS.html +1 -1
  31. data/docs/api/Brut/CLI/Apps/BuildAssets.html +1 -1
  32. data/docs/api/Brut/CLI/Apps/DB/Create.html +1 -1
  33. data/docs/api/Brut/CLI/Apps/DB/Drop.html +1 -1
  34. data/docs/api/Brut/CLI/Apps/DB/Migrate.html +1 -1
  35. data/docs/api/Brut/CLI/Apps/DB/NewMigration.html +1 -1
  36. data/docs/api/Brut/CLI/Apps/DB/Rebuild.html +1 -1
  37. data/docs/api/Brut/CLI/Apps/DB/Seed.html +1 -1
  38. data/docs/api/Brut/CLI/Apps/DB/Status.html +1 -1
  39. data/docs/api/Brut/CLI/Apps/DB.html +1 -1
  40. data/docs/api/Brut/CLI/Apps/DeployBase/GitChecks.html +1 -1
  41. data/docs/api/Brut/CLI/Apps/DeployBase.html +1 -1
  42. data/docs/api/Brut/CLI/Apps/HerokuContainerBasedDeploy/Deploy.html +1 -1
  43. data/docs/api/Brut/CLI/Apps/HerokuContainerBasedDeploy.html +1 -1
  44. data/docs/api/Brut/CLI/Apps/Scaffold/Action/Route.html +1 -1
  45. data/docs/api/Brut/CLI/Apps/Scaffold/Action.html +1 -1
  46. data/docs/api/Brut/CLI/Apps/Scaffold/Component.html +1 -1
  47. data/docs/api/Brut/CLI/Apps/Scaffold/CustomElementTest.html +1 -1
  48. data/docs/api/Brut/CLI/Apps/Scaffold/DbModel.html +2 -2
  49. data/docs/api/Brut/CLI/Apps/Scaffold/E2ETest.html +1 -1
  50. data/docs/api/Brut/CLI/Apps/Scaffold/Form.html +1 -1
  51. data/docs/api/Brut/CLI/Apps/Scaffold/Page/Route.html +1 -1
  52. data/docs/api/Brut/CLI/Apps/Scaffold/Page.html +1 -1
  53. data/docs/api/Brut/CLI/Apps/Scaffold/RoutesEditor.html +1 -1
  54. data/docs/api/Brut/CLI/Apps/Scaffold/Test.html +1 -1
  55. data/docs/api/Brut/CLI/Apps/Scaffold.html +1 -1
  56. data/docs/api/Brut/CLI/Apps/Test/Audit.html +1 -1
  57. data/docs/api/Brut/CLI/Apps/Test/E2e.html +1 -1
  58. data/docs/api/Brut/CLI/Apps/Test/JS.html +1 -1
  59. data/docs/api/Brut/CLI/Apps/Test/Run.html +1 -1
  60. data/docs/api/Brut/CLI/Apps/Test.html +1 -1
  61. data/docs/api/Brut/CLI/Apps.html +1 -1
  62. data/docs/api/Brut/CLI/Command.html +1 -1
  63. data/docs/api/Brut/CLI/Error.html +1 -1
  64. data/docs/api/Brut/CLI/ExecutionResults/Result.html +1 -1
  65. data/docs/api/Brut/CLI/ExecutionResults.html +1 -1
  66. data/docs/api/Brut/CLI/Executor.html +1 -1
  67. data/docs/api/Brut/CLI/InvalidOption.html +1 -1
  68. data/docs/api/Brut/CLI/Options.html +1 -1
  69. data/docs/api/Brut/CLI/Output.html +1 -1
  70. data/docs/api/Brut/CLI/SystemExecError.html +1 -1
  71. data/docs/api/Brut/CLI.html +1 -1
  72. data/docs/api/Brut/FactoryBot.html +1 -1
  73. data/docs/api/Brut/Framework/App.html +1 -1
  74. data/docs/api/Brut/Framework/Config.html +1 -1
  75. data/docs/api/Brut/Framework/Container.html +1 -1
  76. data/docs/api/Brut/Framework/Error.html +1 -1
  77. data/docs/api/Brut/Framework/Errors/AbstractMethod.html +1 -1
  78. data/docs/api/Brut/Framework/Errors/Bug.html +1 -1
  79. data/docs/api/Brut/Framework/Errors/MissingConfiguration.html +1 -1
  80. data/docs/api/Brut/Framework/Errors/MissingParameter.html +1 -1
  81. data/docs/api/Brut/Framework/Errors/NoClassForPath.html +1 -1
  82. data/docs/api/Brut/Framework/Errors/NotFound.html +1 -1
  83. data/docs/api/Brut/Framework/Errors/NotImplemented.html +1 -1
  84. data/docs/api/Brut/Framework/Errors.html +1 -1
  85. data/docs/api/Brut/Framework/FussyTypeEnforcement.html +1 -1
  86. data/docs/api/Brut/Framework/MCP.html +1 -1
  87. data/docs/api/Brut/Framework/ProjectEnvironment.html +1 -1
  88. data/docs/api/Brut/Framework.html +1 -1
  89. data/docs/api/Brut/FrontEnd/AssetPathResolver.html +1 -1
  90. data/docs/api/Brut/FrontEnd/Component/Helpers.html +86 -2
  91. data/docs/api/Brut/FrontEnd/Component.html +78 -9
  92. data/docs/api/Brut/FrontEnd/Components/ConstraintViolations.html +3 -3
  93. data/docs/api/Brut/FrontEnd/Components/FormTag.html +3 -3
  94. data/docs/api/Brut/FrontEnd/Components/I18nTranslations.html +3 -3
  95. data/docs/api/Brut/FrontEnd/Components/Input.html +3 -3
  96. data/docs/api/Brut/FrontEnd/Components/Inputs/CsrfToken.html +3 -3
  97. data/docs/api/Brut/FrontEnd/Components/Inputs/InputTag.html +3 -3
  98. data/docs/api/Brut/FrontEnd/Components/Inputs/RadioButton.html +3 -3
  99. data/docs/api/Brut/FrontEnd/Components/Inputs/SelectTagWithOptions.html +3 -3
  100. data/docs/api/Brut/FrontEnd/Components/Inputs/TextareaTag.html +3 -3
  101. data/docs/api/Brut/FrontEnd/Components/Inputs.html +1 -1
  102. data/docs/api/Brut/FrontEnd/Components/LocaleDetection.html +3 -3
  103. data/docs/api/Brut/FrontEnd/Components/PageIdentifier.html +3 -3
  104. data/docs/api/Brut/FrontEnd/Components/TimeTag.html +3 -3
  105. data/docs/api/Brut/FrontEnd/Components/Traceparent.html +3 -3
  106. data/docs/api/Brut/FrontEnd/Components.html +1 -1
  107. data/docs/api/Brut/FrontEnd/Download.html +1 -1
  108. data/docs/api/Brut/FrontEnd/Flash.html +1 -1
  109. data/docs/api/Brut/FrontEnd/Form.html +1 -1
  110. data/docs/api/Brut/FrontEnd/Forms/ConstraintViolation.html +1 -1
  111. data/docs/api/Brut/FrontEnd/Forms/Input/Color.html +1 -1
  112. data/docs/api/Brut/FrontEnd/Forms/Input/TimeOfDay.html +1 -1
  113. data/docs/api/Brut/FrontEnd/Forms/Input.html +1 -1
  114. data/docs/api/Brut/FrontEnd/Forms/InputDeclarations.html +1 -1
  115. data/docs/api/Brut/FrontEnd/Forms/InputDefinition.html +1 -1
  116. data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInput.html +1 -1
  117. data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInputDefinition.html +1 -1
  118. data/docs/api/Brut/FrontEnd/Forms/SelectInput.html +1 -1
  119. data/docs/api/Brut/FrontEnd/Forms/SelectInputDefinition.html +1 -1
  120. data/docs/api/Brut/FrontEnd/Forms/ValidityState.html +1 -1
  121. data/docs/api/Brut/FrontEnd/Forms.html +1 -1
  122. data/docs/api/Brut/FrontEnd/GenericResponse.html +1 -1
  123. data/docs/api/Brut/FrontEnd/Handler.html +1 -1
  124. data/docs/api/Brut/FrontEnd/Handlers/CspReportingHandler.html +1 -1
  125. data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler/TraceParent.html +1 -1
  126. data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler.html +1 -1
  127. data/docs/api/Brut/FrontEnd/Handlers/LocaleDetectionHandler.html +1 -1
  128. data/docs/api/Brut/FrontEnd/Handlers/MissingHandler/Form.html +1 -1
  129. data/docs/api/Brut/FrontEnd/Handlers/MissingHandler.html +1 -1
  130. data/docs/api/Brut/FrontEnd/Handlers.html +1 -1
  131. data/docs/api/Brut/FrontEnd/HandlingResults.html +1 -1
  132. data/docs/api/Brut/FrontEnd/HttpMethod.html +1 -1
  133. data/docs/api/Brut/FrontEnd/HttpStatus.html +1 -1
  134. data/docs/api/Brut/FrontEnd/InlineSvgLocator.html +1 -1
  135. data/docs/api/Brut/FrontEnd/Layout.html +3 -3
  136. data/docs/api/Brut/FrontEnd/Middleware.html +1 -1
  137. data/docs/api/Brut/FrontEnd/Middlewares/AnnotateBrutOwnedPaths.html +1 -1
  138. data/docs/api/Brut/FrontEnd/Middlewares/Favicon.html +1 -1
  139. data/docs/api/Brut/FrontEnd/Middlewares/OpenTelemetrySpan.html +1 -1
  140. data/docs/api/Brut/FrontEnd/Middlewares/ReloadApp.html +1 -1
  141. data/docs/api/Brut/FrontEnd/Middlewares.html +1 -1
  142. data/docs/api/Brut/FrontEnd/Page.html +31 -23
  143. data/docs/api/Brut/FrontEnd/Pages/MissingPage.html +3 -3
  144. data/docs/api/Brut/FrontEnd/Pages.html +1 -1
  145. data/docs/api/Brut/FrontEnd/RequestContext.html +1 -1
  146. data/docs/api/Brut/FrontEnd/RouteHook.html +1 -1
  147. data/docs/api/Brut/FrontEnd/RouteHooks/AgeFlash.html +1 -1
  148. data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineScripts.html +1 -1
  149. data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts/ReportOnly.html +1 -1
  150. data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts.html +1 -1
  151. data/docs/api/Brut/FrontEnd/RouteHooks/LocaleDetection.html +1 -1
  152. data/docs/api/Brut/FrontEnd/RouteHooks/SetupRequestContext.html +1 -1
  153. data/docs/api/Brut/FrontEnd/RouteHooks.html +1 -1
  154. data/docs/api/Brut/FrontEnd/Routing/FormHandlerRoute.html +1 -1
  155. data/docs/api/Brut/FrontEnd/Routing/FormRoute.html +1 -1
  156. data/docs/api/Brut/FrontEnd/Routing/MissingForm.html +1 -1
  157. data/docs/api/Brut/FrontEnd/Routing/MissingHandler.html +1 -1
  158. data/docs/api/Brut/FrontEnd/Routing/MissingPage.html +1 -1
  159. data/docs/api/Brut/FrontEnd/Routing/MissingPath.html +1 -1
  160. data/docs/api/Brut/FrontEnd/Routing/PageRoute.html +1 -1
  161. data/docs/api/Brut/FrontEnd/Routing/Route.html +1 -1
  162. data/docs/api/Brut/FrontEnd/Routing.html +1 -1
  163. data/docs/api/Brut/FrontEnd/Session.html +1 -1
  164. data/docs/api/Brut/FrontEnd.html +1 -1
  165. data/docs/api/Brut/I18n/BaseMethods.html +1 -1
  166. data/docs/api/Brut/I18n/ForBackEnd.html +1 -1
  167. data/docs/api/Brut/I18n/ForCLI.html +1 -1
  168. data/docs/api/Brut/I18n/ForHTML.html +1 -1
  169. data/docs/api/Brut/I18n/HTTPAcceptLanguage/AlwaysEnglish.html +1 -1
  170. data/docs/api/Brut/I18n/HTTPAcceptLanguage.html +1 -1
  171. data/docs/api/Brut/I18n.html +1 -1
  172. data/docs/api/Brut/Instrumentation/LoggerSpanExporter.html +1 -1
  173. data/docs/api/Brut/Instrumentation/OpenTelemetry/NormalizedAttributes.html +1 -1
  174. data/docs/api/Brut/Instrumentation/OpenTelemetry/Span.html +1 -1
  175. data/docs/api/Brut/Instrumentation/OpenTelemetry.html +1 -1
  176. data/docs/api/Brut/Instrumentation.html +1 -1
  177. data/docs/api/Brut/SinatraHelpers/ClassMethods.html +13 -11
  178. data/docs/api/Brut/SinatraHelpers.html +1 -1
  179. data/docs/api/Brut/SpecSupport/ClockSupport.html +1 -1
  180. data/docs/api/Brut/SpecSupport/ComponentSupport.html +1 -1
  181. data/docs/api/Brut/SpecSupport/E2ETestServer.html +1 -1
  182. data/docs/api/Brut/SpecSupport/E2eSupport.html +1 -1
  183. data/docs/api/Brut/SpecSupport/EnhancedNode.html +1 -1
  184. data/docs/api/Brut/SpecSupport/FlashSupport.html +1 -1
  185. data/docs/api/Brut/SpecSupport/GeneralSupport/ClassMethods.html +1 -1
  186. data/docs/api/Brut/SpecSupport/GeneralSupport.html +1 -1
  187. data/docs/api/Brut/SpecSupport/HandlerSupport.html +1 -1
  188. data/docs/api/Brut/SpecSupport/Matchers/BeABug.html +1 -1
  189. data/docs/api/Brut/SpecSupport/Matchers/BePageFor.html +1 -1
  190. data/docs/api/Brut/SpecSupport/Matchers/BeRoutingFor.html +1 -1
  191. data/docs/api/Brut/SpecSupport/Matchers/HaveConstraintViolation.html +1 -1
  192. data/docs/api/Brut/SpecSupport/Matchers/HaveGenerated.html +1 -1
  193. data/docs/api/Brut/SpecSupport/Matchers/HaveHTMLAttribute.html +1 -1
  194. data/docs/api/Brut/SpecSupport/Matchers/HaveI18nString.html +1 -1
  195. data/docs/api/Brut/SpecSupport/Matchers/HaveLinkTo.html +1 -1
  196. data/docs/api/Brut/SpecSupport/Matchers/HaveRedirectedTo.html +1 -1
  197. data/docs/api/Brut/SpecSupport/Matchers/HaveReturnedHttpStatus.html +1 -1
  198. data/docs/api/Brut/SpecSupport/Matchers/HaveReturnedRackResponse.html +1 -1
  199. data/docs/api/Brut/SpecSupport/Matchers.html +1 -1
  200. data/docs/api/Brut/SpecSupport/RSpecSetup/OptionalSidekiqSupport.html +1 -1
  201. data/docs/api/Brut/SpecSupport/RSpecSetup.html +1 -1
  202. data/docs/api/Brut/SpecSupport/SessionSupport.html +1 -1
  203. data/docs/api/Brut/SpecSupport.html +1 -1
  204. data/docs/api/Brut.html +1 -1
  205. data/docs/api/Clock.html +1 -1
  206. data/docs/api/ModuleName.html +1 -1
  207. data/docs/api/RichString.html +1 -1
  208. data/docs/api/SemanticLogger/Appender/Async.html +1 -1
  209. data/docs/api/Sequel/Extensions/BrutInstrumentation.html +1 -1
  210. data/docs/api/Sequel/Extensions/BrutMigrations.html +1 -1
  211. data/docs/api/Sequel/Extensions.html +1 -1
  212. data/docs/api/Sequel/Plugins/CreatedAt/InstanceMethods.html +1 -1
  213. data/docs/api/Sequel/Plugins/CreatedAt.html +1 -1
  214. data/docs/api/Sequel/Plugins/ExternalId/ClassMethods.html +1 -1
  215. data/docs/api/Sequel/Plugins/ExternalId/InstanceMethods.html +1 -1
  216. data/docs/api/Sequel/Plugins/ExternalId.html +1 -1
  217. data/docs/api/Sequel/Plugins/FindBang/ClassMethods.html +1 -1
  218. data/docs/api/Sequel/Plugins/FindBang.html +1 -1
  219. data/docs/api/Sequel/Plugins.html +1 -1
  220. data/docs/api/Sequel.html +1 -1
  221. data/docs/api/_index.html +1 -1
  222. data/docs/api/file.README.html +1 -1
  223. data/docs/api/index.html +1 -1
  224. data/docs/api/method_list.html +92 -76
  225. data/docs/api/top-level-namespace.html +1 -1
  226. data/docs/assets/{adrs.md.JRxZ5uYE.js → adrs.md.BxjHi9-8.js} +1 -1
  227. data/docs/assets/adrs.md.BxjHi9-8.lean.js +1 -0
  228. data/docs/assets/{app.AkS4fHzI.js → app.D6BuVHo9.js} +1 -1
  229. data/docs/assets/chunks/@localSearchIndexroot.COP2Bcmp.js +1 -0
  230. data/docs/assets/chunks/{VPLocalSearchBox.By6un1FD.js → VPLocalSearchBox.BpvHMbx6.js} +1 -1
  231. data/docs/assets/chunks/{theme.DwiUPdci.js → theme.wlAOvi2f.js} +2 -2
  232. data/docs/assets/{components.md.BfeWD9sX.js → components.md.iLiv2E9X.js} +3 -3
  233. data/docs/assets/{configuration.md.DoSBNc0H.js → configuration.md.DmuAdsli.js} +1 -1
  234. data/docs/assets/{forms.md.DFveP5g_.js → forms.md.D8aa_qI-.js} +1 -1
  235. data/docs/assets/{getting-started.md.DZWjCVC0.js → getting-started.md.DLplsDUd.js} +2 -2
  236. data/docs/assets.html +3 -3
  237. data/docs/brut-css/brut.max.css +1 -1
  238. data/docs/brut-css/classes/appearances.html +1 -1
  239. data/docs/brut-css/classes/background-colors.html +1 -1
  240. data/docs/brut-css/classes/border-colors.html +1 -1
  241. data/docs/brut-css/classes/borders.html +1 -1
  242. data/docs/brut-css/classes/dimensions.html +1 -1
  243. data/docs/brut-css/classes/flex.html +3 -3
  244. data/docs/brut-css/classes/foreground-colors.html +1 -1
  245. data/docs/brut-css/classes/junk-drawer.html +1 -1
  246. data/docs/brut-css/classes/layout.html +1 -1
  247. data/docs/brut-css/classes/lists.html +1 -1
  248. data/docs/brut-css/classes/positioning.html +1 -1
  249. data/docs/brut-css/classes/spacings.html +1 -1
  250. data/docs/brut-css/classes/typography.html +1 -1
  251. data/docs/brut-css/customization/advanced-configuration.html +1 -1
  252. data/docs/brut-css/customization/breakpoints.html +1 -1
  253. data/docs/brut-css/customization/design-system.html +1 -1
  254. data/docs/brut-css/customization/pseudo-classes.html +1 -1
  255. data/docs/brut-css/getting-started/core-concepts.html +1 -1
  256. data/docs/brut-css/getting-started/installation.html +1 -1
  257. data/docs/brut-css/getting-started/overview.html +1 -1
  258. data/docs/brut-css/getting-started/simple-example.html +1 -1
  259. data/docs/brut-css/index.html +1 -1
  260. data/docs/brut-css/properties/colors.html +1 -1
  261. data/docs/brut-css/properties/spacings.html +1 -1
  262. data/docs/brut-css/properties/typography.html +1 -1
  263. data/docs/brut-js/api/AjaxSubmit.html +56 -7
  264. data/docs/brut-js/api/AjaxSubmit.js.html +77 -41
  265. data/docs/brut-js/api/Autosubmit.html +1 -1
  266. data/docs/brut-js/api/Autosubmit.js.html +1 -1
  267. data/docs/brut-js/api/BaseCustomElement.html +1 -1
  268. data/docs/brut-js/api/BaseCustomElement.js.html +1 -1
  269. data/docs/brut-js/api/BrutCustomElements.html +1 -1
  270. data/docs/brut-js/api/BufferedLogger.html +1 -1
  271. data/docs/brut-js/api/ConfirmSubmit.html +1 -1
  272. data/docs/brut-js/api/ConfirmSubmit.js.html +1 -1
  273. data/docs/brut-js/api/ConfirmationDialog.html +1 -1
  274. data/docs/brut-js/api/ConfirmationDialog.js.html +1 -1
  275. data/docs/brut-js/api/ConstraintViolationMessage.html +1 -1
  276. data/docs/brut-js/api/ConstraintViolationMessage.js.html +1 -1
  277. data/docs/brut-js/api/ConstraintViolationMessages.html +1 -1
  278. data/docs/brut-js/api/ConstraintViolationMessages.js.html +1 -1
  279. data/docs/brut-js/api/CopyToClipboard.html +1 -1
  280. data/docs/brut-js/api/CopyToClipboard.js.html +1 -1
  281. data/docs/brut-js/api/Form.html +1 -1
  282. data/docs/brut-js/api/Form.js.html +1 -1
  283. data/docs/brut-js/api/I18nTranslation.html +1 -1
  284. data/docs/brut-js/api/I18nTranslation.js.html +1 -1
  285. data/docs/brut-js/api/LocaleDetection.html +1 -1
  286. data/docs/brut-js/api/LocaleDetection.js.html +1 -1
  287. data/docs/brut-js/api/Logger.html +1 -1
  288. data/docs/brut-js/api/Logger.js.html +1 -1
  289. data/docs/brut-js/api/Message.html +1 -1
  290. data/docs/brut-js/api/Message.js.html +1 -1
  291. data/docs/brut-js/api/PrefixedLogger.html +1 -1
  292. data/docs/brut-js/api/RichString.html +1 -1
  293. data/docs/brut-js/api/RichString.js.html +1 -1
  294. data/docs/brut-js/api/Tabs.html +1 -1
  295. data/docs/brut-js/api/Tabs.js.html +1 -1
  296. data/docs/brut-js/api/Tracing.html +1 -1
  297. data/docs/brut-js/api/Tracing.js.html +1 -1
  298. data/docs/brut-js/api/external-CustomElementRegistry.html +1 -1
  299. data/docs/brut-js/api/external-Performance.html +1 -1
  300. data/docs/brut-js/api/external-Promise.html +1 -1
  301. data/docs/brut-js/api/external-ValidityState.html +1 -1
  302. data/docs/brut-js/api/external-Window.html +1 -1
  303. data/docs/brut-js/api/external-fetch.html +1 -1
  304. data/docs/brut-js/api/global.html +1 -1
  305. data/docs/brut-js/api/index.html +1 -1
  306. data/docs/brut-js/api/index.js.html +1 -1
  307. data/docs/brut-js/api/module-testing.html +1 -1
  308. data/docs/brut-js/api/testing.AssetMetadata.html +1 -1
  309. data/docs/brut-js/api/testing.AssetMetadataLoader.html +1 -1
  310. data/docs/brut-js/api/testing.CustomElementTest.html +1 -1
  311. data/docs/brut-js/api/testing.DOMCreator.html +1 -1
  312. data/docs/brut-js/api/testing_AssetMetadata.js.html +1 -1
  313. data/docs/brut-js/api/testing_AssetMetadataLoader.js.html +1 -1
  314. data/docs/brut-js/api/testing_CustomElementTest.js.html +1 -1
  315. data/docs/brut-js/api/testing_DOMCreator.js.html +1 -1
  316. data/docs/brut-js/api/testing_index.js.html +1 -1
  317. data/docs/brut-js.html +3 -3
  318. data/docs/business-logic.html +3 -3
  319. data/docs/cli.html +3 -3
  320. data/docs/components.html +7 -7
  321. data/docs/configuration.html +5 -5
  322. data/docs/css.html +3 -3
  323. data/docs/custom-element-tests.html +3 -3
  324. data/docs/database-access.html +3 -3
  325. data/docs/database-schema.html +3 -3
  326. data/docs/deployment.html +3 -3
  327. data/docs/dev-environment.html +3 -3
  328. data/docs/dir-structure.html +3 -3
  329. data/docs/doc-conventions.html +3 -3
  330. data/docs/end-to-end-tests.html +3 -3
  331. data/docs/features.html +3 -3
  332. data/docs/flash-and-session.html +3 -3
  333. data/docs/form-constraints.html +3 -3
  334. data/docs/forms.html +5 -5
  335. data/docs/getting-started.html +6 -6
  336. data/docs/handlers.html +3 -3
  337. data/docs/hashmap.json +1 -1
  338. data/docs/hooks.html +3 -3
  339. data/docs/i18n.html +3 -3
  340. data/docs/index.html +3 -3
  341. data/docs/instrumentation.html +3 -3
  342. data/docs/javascript.html +3 -3
  343. data/docs/jobs.html +3 -3
  344. data/docs/keyword-injection.html +3 -3
  345. data/docs/layouts.html +3 -3
  346. data/docs/lsp.html +3 -3
  347. data/docs/markdown-examples.html +3 -3
  348. data/docs/middleware.html +3 -3
  349. data/docs/overview.html +3 -3
  350. data/docs/pages.html +3 -3
  351. data/docs/recipes/alternate-layouts.html +3 -3
  352. data/docs/recipes/authentication.html +3 -3
  353. data/docs/recipes/blank-layouts.html +3 -3
  354. data/docs/recipes/custom-flash.html +3 -3
  355. data/docs/recipes/indexed-forms.html +3 -3
  356. data/docs/recipes/migrations.html +3 -3
  357. data/docs/recipes/text-field-component.html +3 -3
  358. data/docs/roadmap.html +3 -3
  359. data/docs/routes.html +3 -3
  360. data/docs/security.html +3 -3
  361. data/docs/seed-data.html +3 -3
  362. data/docs/space-time-continuum.html +3 -3
  363. data/docs/tutorial.html +3 -3
  364. data/docs/unit-tests.html +3 -3
  365. data/docs/why.html +3 -3
  366. data/lib/brut/cli/apps/scaffold.rb +1 -1
  367. data/lib/brut/front_end/component.rb +19 -0
  368. data/lib/brut/front_end/page.rb +11 -7
  369. data/lib/brut/sinatra_helpers.rb +1 -0
  370. data/lib/brut/version.rb +1 -1
  371. metadata +16 -16
  372. data/brut-js/CHANGELOG.md +0 -5
  373. data/docs/assets/adrs.md.JRxZ5uYE.lean.js +0 -1
  374. data/docs/assets/chunks/@localSearchIndexroot.C9FqcQxD.js +0 -1
  375. /data/docs/assets/{components.md.BfeWD9sX.lean.js → components.md.iLiv2E9X.lean.js} +0 -0
  376. /data/docs/assets/{configuration.md.DoSBNc0H.lean.js → configuration.md.DmuAdsli.lean.js} +0 -0
  377. /data/docs/assets/{forms.md.DFveP5g_.lean.js → forms.md.D8aa_qI-.lean.js} +0 -0
  378. /data/docs/assets/{getting-started.md.DZWjCVC0.lean.js → getting-started.md.DLplsDUd.lean.js} +0 -0
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -708,7 +708,7 @@
708
708
  </div>
709
709
 
710
710
 
711
- <h3 class="f-5 mt-4" id="class-scale:flex-grow">Flex Grow</h3>
711
+ <h3 class="f-5 mt-4" id="class-scale:flex-shrink">Flex Shrink</h3>
712
712
  <p class="p">
713
713
  <p>Flex shrink, using a six-step scale.</p>
714
714
 
@@ -896,7 +896,7 @@
896
896
 
897
897
  <li class="lh-copy"><a href="#class-scale:flex-grow">Flex Grow</a></li>
898
898
 
899
- <li class="lh-copy"><a href="#class-scale:flex-grow">Flex Grow</a></li>
899
+ <li class="lh-copy"><a href="#class-scale:flex-shrink">Flex Shrink</a></li>
900
900
 
901
901
  <li class="lh-copy"><a href="#class-group:flex-basis">Flex Basis</a></li>
902
902
 
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -11,7 +11,7 @@
11
11
  <div class="flex gap-3 justify-between items-center">
12
12
  <h1><a href="/brut-css" class="black tdn">BrutCSS Reference Documentation</a></h1>
13
13
  <ul class="lst-none pl-0 flex gap-2 justify-end items-center">
14
- <form class="flex items-center gap-1 mr-3">
14
+ <form class="dn flex items-center gap-1 mr-3">
15
15
  <label>
16
16
  <input type="search" placeholder="e.g. padding-left" class="pa-2 br-2 ba bc-gray-600 bg-white-ish gray-200">
17
17
  <span class="sr-only">Search term</span>
@@ -44,9 +44,18 @@ the form it's a part of via AJAX. It accounts for network failures and timeouts.
44
44
  <ul>
45
45
  <li><code>requesting</code> will be removed and <code>submitted</code> will be added.</li>
46
46
  <li><code>submitted</code> will be removed after <code>submitted-lifetime</code> ms.</li>
47
+ <li>the <code>brut:submitok</code> event will be fired with the response text, <strong>parsed as HTML</strong>, as <code>event.detail</code>.</li>
48
+ </ul>
49
+ </li>
50
+ <li>If the request returned a 422:
51
+ <ul>
52
+ <li>If you have set <code>no-server-side-error-parsing</code>, the results will be included in the
53
+ detail field of the <code>brut:submitinvalid</code> event.</li>
54
+ <li>If you have NOT set <code>no-server-side-error-parsing</code>, the response is parsed as
55
+ errors to be inserted into the DOM. See below for how that works. In this case,
56
+ <code>brut:submitinvalid</code>'s detail bill be null.</li>
47
57
  </ul>
48
58
  </li>
49
- <li>If the request returned a 422, error messages are parsed. See below.</li>
50
59
  <li>If the request returns not OK and not 422:
51
60
  <ul>
52
61
  <li>if it has been <code>request-timeout</code> ms or more since the button was first clicked, the operation is aborted (see below).</li>
@@ -58,7 +67,8 @@ the form it's a part of via AJAX. It accounts for network failures and timeouts.
58
67
  </ol>
59
68
  <p>Aborting the operation will submit the form in the normal way, allowing the browser to deal with whatever the issue is. You can set
60
69
  <code>log-request-errors</code> to introspect this process.</p>
61
- <p>For a 422 response, this element assumes the response is <code>text/html</code> and contains one or more <code>&lt;brut-cv&gt;</code>
70
+ <p>For a 422 response (where <code>no-server-side-error-parsing</code> is <em>not</em> set),
71
+ this element assumes the response is <code>text/html</code> and contains one or more <code>&lt;brut-cv&gt;</code>
62
72
  elements. These elements will be inserted into the proper <code>&lt;brut-cv-messages&gt;</code> element, as follows:</p>
63
73
  <ol>
64
74
  <li>The <code>input-name</code> is examined.</li>
@@ -71,7 +81,23 @@ elements. These elements will be inserted into the proper <code>&lt;brut-cv-mes
71
81
  <li>validity is reported</li>
72
82
  <li>The first input located is scrolled into view</li>
73
83
  <li>If the input is modified after this all happens, custom validity is cleared</li>
74
- </ol></div>
84
+ </ol>
85
+ <p>For the server you are contacting, this element has a few requirements:</p>
86
+ <ul>
87
+ <li>If everything is OK/the operation did what it was intended to do:
88
+ <ul>
89
+ <li>the server will respond with a 2xx</li>
90
+ <li>the response body, if it contains anything, be <code>text/html</code> (this is provided in the event detail)</li>
91
+ </ul>
92
+ </li>
93
+ <li>If there are server-side constraint violations.
94
+ <ul>
95
+ <li>the server will return 422</li>
96
+ <li>the response body will be <code>text/html</code></li>
97
+ <li>the response body will contain one or more <code>&lt;brut-cv&gt;</code> elements</li>
98
+ </ul>
99
+ </li>
100
+ </ul></div>
75
101
 
76
102
 
77
103
  </header>
@@ -129,6 +155,29 @@ elements. These elements will be inserted into the proper <code>&lt;brut-cv-mes
129
155
  <tbody>
130
156
 
131
157
 
158
+ <tr>
159
+
160
+ <td class="name"><code>no-server-side-error-parsing</code></td>
161
+
162
+
163
+ <td class="type">
164
+
165
+
166
+ <span class="param-type">boolean</span>
167
+
168
+
169
+
170
+ </td>
171
+
172
+
173
+
174
+
175
+
176
+ <td class="description last"><p>if set, the response body for a 422 will not be parsed and inserted into the DOM. Instead, the body will be part of the detail of the <code>brut:submitinvalid</code> event.</p></td>
177
+ </tr>
178
+
179
+
180
+
132
181
  <tr>
133
182
 
134
183
  <td class="name"><code>request-timeout</code></td>
@@ -279,7 +328,7 @@ cause any form submission to be delayed by 2s to allow you to read the console.<
279
328
 
280
329
  <dt class="tag-source">Source:</dt>
281
330
  <dd class="tag-source"><ul class="dummy"><li>
282
- <a href="AjaxSubmit.js.html">AjaxSubmit.js</a>, <a href="AjaxSubmit.js.html#line61">line 61</a>
331
+ <a href="AjaxSubmit.js.html">AjaxSubmit.js</a>, <a href="AjaxSubmit.js.html#line79">line 79</a>
283
332
  </li></ul></dd>
284
333
 
285
334
 
@@ -296,9 +345,9 @@ cause any form submission to be delayed by 2s to allow you to read the console.<
296
345
 
297
346
  <h5>Fires:</h5>
298
347
  <ul>
299
- <li>brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed</li>
348
+ <li>brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed.event: The detail will include the *parsed document* of the HTML returned in the response.</li>
300
349
 
301
- <li>brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed</li>
350
+ <li>brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed. The detail will be null unless `no-server-side-error-parsing` is set,event: in which case it will be the parsed document of the HTML returned in the response.</li>
302
351
  </ul>
303
352
 
304
353
 
@@ -365,7 +414,7 @@ cause any form submission to be delayed by 2s to allow you to read the console.<
365
414
  <br class="clear">
366
415
 
367
416
  <footer>
368
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
417
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
369
418
  </footer>
370
419
 
371
420
  <script> prettyPrint(); </script>
@@ -41,7 +41,13 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
41
41
  * 4. If the request returns OK:
42
42
  * - `requesting` will be removed and `submitted` will be added.
43
43
  * - `submitted` will be removed after `submitted-lifetime` ms.
44
- * 5. If the request returned a 422, error messages are parsed. See below.
44
+ * - the `brut:submitok` event will be fired with the response text, **parsed as HTML**, as `event.detail`.
45
+ * 5. If the request returned a 422:
46
+ * - If you have set `no-server-side-error-parsing`, the results will be included in the
47
+ * detail field of the `brut:submitinvalid` event.
48
+ * - If you have NOT set `no-server-side-error-parsing`, the response is parsed as
49
+ * errors to be inserted into the DOM. See below for how that works. In this case,
50
+ * `brut:submitinvalid`'s detail bill be null.
45
51
  * 6. If the request returns not OK and not 422:
46
52
  * - if it has been `request-timeout` ms or more since the button was first clicked, the operation is aborted (see below).
47
53
  * - if it has been less than `request-timeout` ms and the HTTP status code was 5xx, the operation is retried.
@@ -51,7 +57,8 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
51
57
  * Aborting the operation will submit the form in the normal way, allowing the browser to deal with whatever the issue is. You can set
52
58
  * `log-request-errors` to introspect this process.
53
59
  *
54
- * For a 422 response, this element assumes the response is `text/html` and contains one or more `&lt;brut-cv>`
60
+ * For a 422 response (where `no-server-side-error-parsing` is *not* set),
61
+ * this element assumes the response is `text/html` and contains one or more `&lt;brut-cv>`
55
62
  * elements. These elements will be inserted into the proper `&lt;brut-cv-messages>` element, as follows:
56
63
  *
57
64
  * 1. The `input-name` is examined.
@@ -65,6 +72,17 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
65
72
  * 9. The first input located is scrolled into view
66
73
  * 10. If the input is modified after this all happens, custom validity is cleared
67
74
  *
75
+ * For the server you are contacting, this element has a few requirements:
76
+ *
77
+ * - If everything is OK/the operation did what it was intended to do:
78
+ * - the server will respond with a 2xx
79
+ * - the response body, if it contains anything, be `text/html` (this is provided in the event detail)
80
+ * - If there are server-side constraint violations.
81
+ * - the server will return 422
82
+ * - the response body will be `text/html`
83
+ * - the response body will contain one or more `&lt;brut-cv>` elements
84
+ *
85
+ * @property {boolean} no-server-side-error-parsing - if set, the response body for a 422 will not be parsed and inserted into the DOM. Instead, the body will be part of the detail of the `brut:submitinvalid` event.
68
86
  * @property {number} request-timeout - number of ms that the entire operation is expected to complete within. Default is 5000
69
87
  * @property {number} submitted-lifetime - number of ms that "submitted" should remain on the element after the form has completed. Default is 2000
70
88
  * @property {boolean} requesting - boolean attribute that indicates the request has been made, but not yet returned. Don't set this yourself outside of development. It will be set and removed by this element.
@@ -72,8 +90,8 @@ import ConstraintViolationMessage from "./ConstraintViolationMessage"
72
90
  * @property {boolean} log-request-errors - if set, logging related to request error handling will appear in the console. It will also
73
91
  * cause any form submission to be delayed by 2s to allow you to read the console.
74
92
  *
75
- * @fires brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed
76
- * @fires brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed
93
+ * @fires brut:submitok Fired when the AJAX request initated by this returns OK and all processing has completed. The detail will include the *parsed document* of the HTML returned in the response.
94
+ * @fires brut:submitinvalid Fired when the AJAX request initated by this returns a 422 and all logic around managing the reponse has completed. The detail will be null unless `no-server-side-error-parsing` is set, in which case it will be the parsed document of the HTML returned in the response.
77
95
  *
78
96
  * @example
79
97
  * &lt;form action="/widgets" method="post">
@@ -96,6 +114,7 @@ class AjaxSubmit extends BaseCustomElement {
96
114
  "request-timeout",
97
115
  "max-retry-attempts",
98
116
  "log-request-errors",
117
+ "no-server-side-error-parsing",
99
118
  ]
100
119
 
101
120
  #requestErrorLogger = () => {}
@@ -103,6 +122,12 @@ class AjaxSubmit extends BaseCustomElement {
103
122
  #submittedLifetime = 2000
104
123
  #requestTimeout = 5000
105
124
  #maxRetryAttempts = 25
125
+ #serverSideErrorParsing = true
126
+
127
+ constructor() {
128
+ super()
129
+ this.domParser = new DOMParser()
130
+ }
106
131
 
107
132
  submittedLifetimeChangedCallback({newValue}) {
108
133
  const newValueAsInt = parseInt(newValue)
@@ -112,6 +137,10 @@ class AjaxSubmit extends BaseCustomElement {
112
137
  this.#submittedLifetime = newValueAsInt
113
138
  }
114
139
 
140
+ noServerSideErrorParsingChangedCallback({newValueAsBoolean}) {
141
+ this.#serverSideErrorParsing = !newValueAsBoolean
142
+ }
143
+
115
144
  maxRetryAttemptsChangedCallback({newValue}) {
116
145
  const num = parseInt(newValue)
117
146
  if (isNaN(num)) {
@@ -215,7 +244,10 @@ class AjaxSubmit extends BaseCustomElement {
215
244
  this.setAttribute("submitted",true)
216
245
 
217
246
  setTimeout( () => this.removeAttribute("submitted"), this.#submittedLifetime )
218
- this.dispatchEvent(new CustomEvent("brut:submitok"))
247
+ response.text().then( (text) => {
248
+ const parsedDocument = this.domParser.parseFromString(text,"text/html")
249
+ this.dispatchEvent(new CustomEvent("brut:submitok", { detail: parsedDocument }))
250
+ })
219
251
  }
220
252
  else {
221
253
 
@@ -278,49 +310,53 @@ class AjaxSubmit extends BaseCustomElement {
278
310
  #handleConstraintViolations(response) {
279
311
  let resubmit = false
280
312
  response.text().then( (text) => {
281
- try {
282
- const inputsToMessages = ErrorMessagesForInput.mapInputsToErrorMessages(
283
- this.#errorMessagesFromServer(text),
284
- this.#requestErrorLogger
285
- )
313
+ const parsedDocument = this.domParser.parseFromString(text,"text/html")
314
+ let event
315
+ if (this.#serverSideErrorParsing) {
316
+ event = new CustomEvent("brut:submitinvalid")
317
+ }
318
+ else {
319
+ event = new CustomEvent("brut:submitinvalid", { detail: parsedDocument })
320
+ }
321
+ this.dispatchEvent(event)
322
+ if (this.#serverSideErrorParsing) {
323
+ const constraintViolationNodes = parsedDocument.querySelectorAll(ConstraintViolationMessage.tagName)
324
+ try {
325
+ const inputsToMessages = ErrorMessagesForInput.mapInputsToErrorMessages(
326
+ constraintViolationNodes,
327
+ this.#requestErrorLogger
328
+ )
329
+
330
+ let inputToScrollToAfterReportingValidity
331
+ for (const [inputName, {input, messagesElement, errorMessages}] of Object.entries(inputsToMessages)) {
332
+ if (!inputToScrollToAfterReportingValidity) {
333
+ inputToScrollToAfterReportingValidity = input
334
+ }
335
+ messagesElement.clearServerSideMessages()
336
+ errorMessages.forEach( (element) => {
337
+ ConstraintViolationMessage.markServerSide(element)
338
+ messagesElement.appendChild(element)
339
+ })
340
+ this.#setCustomValidityThatClearsOnChange(input,errorMessages)
341
+ }
286
342
 
287
- let inputToScrollToAfterReportingValidity
288
- for (const [inputName, {input, messagesElement, errorMessages}] of Object.entries(inputsToMessages)) {
289
- if (!inputToScrollToAfterReportingValidity) {
290
- inputToScrollToAfterReportingValidity = input
343
+ if (inputToScrollToAfterReportingValidity) {
344
+ inputToScrollToAfterReportingValidity.scrollIntoView()
291
345
  }
292
- messagesElement.clearServerSideMessages()
293
- errorMessages.forEach( (element) => {
294
- ConstraintViolationMessage.markServerSide(element)
295
- messagesElement.appendChild(element)
296
- })
297
- this.#setCustomValidityThatClearsOnChange(input,errorMessages)
346
+ resubmit = false
347
+ this.removeAttribute("requesting")
298
348
  }
299
-
300
- if (inputToScrollToAfterReportingValidity) {
301
- inputToScrollToAfterReportingValidity.scrollIntoView()
349
+ catch (e) {
350
+ this.#requestErrorLogger("While parsing %s, got %s", text, e)
351
+ resubmit = true
352
+ }
353
+ if (resubmit) {
354
+ this.#submitFormThroughBrowser(form)
302
355
  }
303
- resubmit = false
304
- this.removeAttribute("requesting")
305
- this.dispatchEvent(new CustomEvent("brut:submitinvalid"))
306
- }
307
- catch (e) {
308
- this.#requestErrorLogger("While parsing %s, got %s", text, e)
309
- resubmit = true
310
- }
311
- if (resubmit) {
312
- this.#submitFormThroughBrowser(form)
313
356
  }
314
357
  })
315
358
  }
316
359
 
317
- #errorMessagesFromServer(text) {
318
- const parser = new DOMParser()
319
- const fragment = parser.parseFromString(text,"text/html")
320
-
321
- return fragment.querySelectorAll(ConstraintViolationMessage.tagName)
322
- }
323
-
324
360
  #setCustomValidityThatClearsOnChange(input,errorMessages) {
325
361
  input.setCustomValidity(errorMessages[0].textContent)
326
362
  input.reportValidity()
@@ -426,7 +462,7 @@ export default AjaxSubmit
426
462
  <br class="clear">
427
463
 
428
464
  <footer>
429
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
465
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
430
466
  </footer>
431
467
 
432
468
  <script> prettyPrint(); </script>
@@ -183,7 +183,7 @@ That means if your input/textarea/select uses the <code>form</code> attribute, t
183
183
  <br class="clear">
184
184
 
185
185
  <footer>
186
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
186
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
187
187
  </footer>
188
188
 
189
189
  <script> prettyPrint(); </script>
@@ -105,7 +105,7 @@ export default Autosubmit
105
105
  <br class="clear">
106
106
 
107
107
  <footer>
108
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
108
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
109
109
  </footer>
110
110
 
111
111
  <script> prettyPrint(); </script>
@@ -1082,7 +1082,7 @@ this inside a <code>DOMContentLoaded</code> event, or after the page's HTML has
1082
1082
  <br class="clear">
1083
1083
 
1084
1084
  <footer>
1085
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
1085
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
1086
1086
  </footer>
1087
1087
 
1088
1088
  <script> prettyPrint(); </script>
@@ -303,7 +303,7 @@ export default BaseCustomElement
303
303
  <br class="clear">
304
304
 
305
305
  <footer>
306
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
306
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
307
307
  </footer>
308
308
 
309
309
  <script> prettyPrint(); </script>
@@ -163,7 +163,7 @@ elements.</p></div>
163
163
  <br class="clear">
164
164
 
165
165
  <footer>
166
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Sat Jul 12 2025 21:26:00 GMT+0000 (Coordinated Universal Time)
166
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Mon Jul 21 2025 18:28:19 GMT+0000 (Coordinated Universal Time)
167
167
  </footer>
168
168
 
169
169
  <script> prettyPrint(); </script>