@fuzdev/fuz_app 0.175.0 → 0.177.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 (550) hide show
  1. package/README.md +6 -4
  2. package/dist/actions/CLAUDE.md +10 -8
  3. package/dist/actions/action_bridge.d.ts.map +1 -1
  4. package/dist/actions/action_codegen.d.ts.map +1 -1
  5. package/dist/actions/action_dispatcher.d.ts.map +1 -1
  6. package/dist/actions/action_event.d.ts.map +1 -1
  7. package/dist/actions/action_event_data.d.ts +37 -255
  8. package/dist/actions/action_event_data.d.ts.map +1 -1
  9. package/dist/actions/action_event_helpers.d.ts.map +1 -1
  10. package/dist/actions/action_event_types.d.ts +2 -2
  11. package/dist/actions/action_event_types.d.ts.map +1 -1
  12. package/dist/actions/action_registry.d.ts.map +1 -1
  13. package/dist/actions/action_rpc.d.ts.map +1 -1
  14. package/dist/actions/action_spec.d.ts +3 -3
  15. package/dist/actions/action_spec.d.ts.map +1 -1
  16. package/dist/actions/action_types.d.ts.map +1 -1
  17. package/dist/actions/broadcast_api.d.ts.map +1 -1
  18. package/dist/actions/cancel.d.ts +5 -13
  19. package/dist/actions/cancel.d.ts.map +1 -1
  20. package/dist/actions/compile_action_registry.d.ts.map +1 -1
  21. package/dist/actions/connection_closer.d.ts.map +1 -1
  22. package/dist/actions/connection_registry.d.ts.map +1 -1
  23. package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
  24. package/dist/actions/heartbeat.d.ts +2 -2
  25. package/dist/actions/heartbeat.d.ts.map +1 -1
  26. package/dist/actions/peer_ping.d.ts +16 -56
  27. package/dist/actions/peer_ping.d.ts.map +1 -1
  28. package/dist/actions/peer_request.d.ts.map +1 -1
  29. package/dist/actions/perform_action.d.ts.map +1 -1
  30. package/dist/actions/protocol.d.ts.map +1 -1
  31. package/dist/actions/register_action_ws.d.ts.map +1 -1
  32. package/dist/actions/rpc_client.d.ts.map +1 -1
  33. package/dist/actions/socket.svelte.d.ts.map +1 -1
  34. package/dist/actions/transports.d.ts.map +1 -1
  35. package/dist/actions/transports_http.d.ts.map +1 -1
  36. package/dist/actions/transports_ws.d.ts.map +1 -1
  37. package/dist/actions/ws_endpoint_spec.d.ts.map +1 -1
  38. package/dist/actions/ws_outbound_writer.d.ts +8 -8
  39. package/dist/actions/ws_outbound_writer.d.ts.map +1 -1
  40. package/dist/actions/ws_outbound_writer.js +8 -11
  41. package/dist/actions/ws_socket_session.d.ts.map +1 -1
  42. package/dist/auth/CLAUDE.md +1 -1
  43. package/dist/auth/account_action_specs.d.ts +114 -591
  44. package/dist/auth/account_action_specs.d.ts.map +1 -1
  45. package/dist/auth/account_actions.d.ts.map +1 -1
  46. package/dist/auth/account_queries.d.ts.map +1 -1
  47. package/dist/auth/account_route_schema.d.ts +66 -360
  48. package/dist/auth/account_route_schema.d.ts.map +1 -1
  49. package/dist/auth/account_routes.d.ts.map +1 -1
  50. package/dist/auth/account_schema.d.ts +82 -463
  51. package/dist/auth/account_schema.d.ts.map +1 -1
  52. package/dist/auth/actor_lookup_action_specs.d.ts +25 -164
  53. package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
  54. package/dist/auth/actor_lookup_actions.d.ts.map +1 -1
  55. package/dist/auth/actor_lookup_queries.d.ts.map +1 -1
  56. package/dist/auth/actor_search_action_specs.d.ts +27 -165
  57. package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
  58. package/dist/auth/actor_search_actions.d.ts.map +1 -1
  59. package/dist/auth/actor_search_queries.d.ts.map +1 -1
  60. package/dist/auth/admin_action_specs.d.ts +355 -2575
  61. package/dist/auth/admin_action_specs.d.ts.map +1 -1
  62. package/dist/auth/admin_actions.d.ts.map +1 -1
  63. package/dist/auth/all_action_spec_registries.d.ts.map +1 -1
  64. package/dist/auth/all_cell_actions.d.ts.map +1 -1
  65. package/dist/auth/api_token.d.ts +1 -1
  66. package/dist/auth/api_token.d.ts.map +1 -1
  67. package/dist/auth/api_token_queries.d.ts.map +1 -1
  68. package/dist/auth/app_settings_queries.d.ts.map +1 -1
  69. package/dist/auth/app_settings_schema.d.ts +9 -37
  70. package/dist/auth/app_settings_schema.d.ts.map +1 -1
  71. package/dist/auth/audit_emitter.d.ts.map +1 -1
  72. package/dist/auth/audit_log_ddl.d.ts.map +1 -1
  73. package/dist/auth/audit_log_queries.d.ts.map +1 -1
  74. package/dist/auth/audit_log_route_schema.d.ts +2 -11
  75. package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
  76. package/dist/auth/audit_log_routes.d.ts.map +1 -1
  77. package/dist/auth/audit_log_schema.d.ts +164 -728
  78. package/dist/auth/audit_log_schema.d.ts.map +1 -1
  79. package/dist/auth/auth_ddl.d.ts.map +1 -1
  80. package/dist/auth/auth_guard_resolver.d.ts.map +1 -1
  81. package/dist/auth/bearer_auth.d.ts.map +1 -1
  82. package/dist/auth/bootstrap_account.d.ts.map +1 -1
  83. package/dist/auth/bootstrap_route_schema.d.ts +18 -102
  84. package/dist/auth/bootstrap_route_schema.d.ts.map +1 -1
  85. package/dist/auth/bootstrap_routes.d.ts.map +1 -1
  86. package/dist/auth/cell_action_helpers.d.ts.map +1 -1
  87. package/dist/auth/cell_action_specs.d.ts +826 -5965
  88. package/dist/auth/cell_action_specs.d.ts.map +1 -1
  89. package/dist/auth/cell_actions.d.ts.map +1 -1
  90. package/dist/auth/cell_audit_action_specs.d.ts +40 -280
  91. package/dist/auth/cell_audit_action_specs.d.ts.map +1 -1
  92. package/dist/auth/cell_audit_actions.d.ts.map +1 -1
  93. package/dist/auth/cell_audit_events.d.ts.map +1 -1
  94. package/dist/auth/cell_audit_metadata.d.ts +18 -84
  95. package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
  96. package/dist/auth/cell_authorize.d.ts.map +1 -1
  97. package/dist/auth/cell_data_schema.d.ts +3 -9
  98. package/dist/auth/cell_data_schema.d.ts.map +1 -1
  99. package/dist/auth/cell_field_action_specs.d.ts +96 -663
  100. package/dist/auth/cell_field_action_specs.d.ts.map +1 -1
  101. package/dist/auth/cell_field_actions.d.ts.map +1 -1
  102. package/dist/auth/cell_field_audit_metadata.d.ts +8 -44
  103. package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -1
  104. package/dist/auth/cell_grant_action_specs.d.ts +141 -1008
  105. package/dist/auth/cell_grant_action_specs.d.ts.map +1 -1
  106. package/dist/auth/cell_grant_actions.d.ts.map +1 -1
  107. package/dist/auth/cell_grant_audit_metadata.d.ts +25 -179
  108. package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -1
  109. package/dist/auth/cell_item_action_specs.d.ts +129 -903
  110. package/dist/auth/cell_item_action_specs.d.ts.map +1 -1
  111. package/dist/auth/cell_item_actions.d.ts.map +1 -1
  112. package/dist/auth/cell_item_audit_metadata.d.ts +12 -61
  113. package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -1
  114. package/dist/auth/cell_ref_admission.d.ts.map +1 -1
  115. package/dist/auth/cell_relation_list_limit.d.ts +1 -1
  116. package/dist/auth/cell_relation_list_limit.d.ts.map +1 -1
  117. package/dist/auth/cell_relation_visibility.d.ts.map +1 -1
  118. package/dist/auth/cell_steward.d.ts.map +1 -1
  119. package/dist/auth/cleanup.d.ts.map +1 -1
  120. package/dist/auth/credential_deadline.d.ts.map +1 -1
  121. package/dist/auth/credential_type_schema.d.ts +1 -1
  122. package/dist/auth/credential_type_schema.d.ts.map +1 -1
  123. package/dist/auth/daemon_token.d.ts +1 -1
  124. package/dist/auth/daemon_token.d.ts.map +1 -1
  125. package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
  126. package/dist/auth/deps.d.ts.map +1 -1
  127. package/dist/auth/fail_floor.d.ts.map +1 -1
  128. package/dist/auth/grant_path_schema.d.ts +1 -1
  129. package/dist/auth/grant_path_schema.d.ts.map +1 -1
  130. package/dist/auth/invite_queries.d.ts.map +1 -1
  131. package/dist/auth/invite_schema.d.ts +18 -84
  132. package/dist/auth/invite_schema.d.ts.map +1 -1
  133. package/dist/auth/keyring.d.ts +1 -1
  134. package/dist/auth/keyring.d.ts.map +1 -1
  135. package/dist/auth/keyring.js +1 -1
  136. package/dist/auth/middleware.d.ts.map +1 -1
  137. package/dist/auth/migrations.d.ts.map +1 -1
  138. package/dist/auth/name_schema.d.ts.map +1 -1
  139. package/dist/auth/password.d.ts +2 -2
  140. package/dist/auth/password.d.ts.map +1 -1
  141. package/dist/auth/password_argon2.d.ts.map +1 -1
  142. package/dist/auth/request_context.d.ts.map +1 -1
  143. package/dist/auth/resolved_auth.d.ts.map +1 -1
  144. package/dist/auth/role_grant_offer_action_specs.d.ts +318 -2134
  145. package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
  146. package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
  147. package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
  148. package/dist/auth/role_grant_offer_notifications.d.ts +202 -1284
  149. package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
  150. package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
  151. package/dist/auth/role_grant_offer_schema.d.ts +17 -81
  152. package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
  153. package/dist/auth/role_grant_queries.d.ts.map +1 -1
  154. package/dist/auth/role_grant_sql.d.ts.map +1 -1
  155. package/dist/auth/role_schema.d.ts +1 -1
  156. package/dist/auth/role_schema.d.ts.map +1 -1
  157. package/dist/auth/scope_kind_schema.d.ts +1 -1
  158. package/dist/auth/scope_kind_schema.d.ts.map +1 -1
  159. package/dist/auth/self_service_role_action_specs.d.ts +16 -58
  160. package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
  161. package/dist/auth/self_service_role_actions.d.ts.map +1 -1
  162. package/dist/auth/session_cookie.d.ts.map +1 -1
  163. package/dist/auth/session_middleware.d.ts.map +1 -1
  164. package/dist/auth/session_queries.d.ts.map +1 -1
  165. package/dist/auth/signup_route_schema.d.ts +11 -57
  166. package/dist/auth/signup_route_schema.d.ts.map +1 -1
  167. package/dist/auth/signup_routes.d.ts.map +1 -1
  168. package/dist/auth/standard_action_specs.d.ts.map +1 -1
  169. package/dist/auth/standard_rpc_actions.d.ts.map +1 -1
  170. package/dist/auth/token_lifetime.d.ts +6 -29
  171. package/dist/auth/token_lifetime.d.ts.map +1 -1
  172. package/dist/auth/token_scope.d.ts +16 -78
  173. package/dist/auth/token_scope.d.ts.map +1 -1
  174. package/dist/crypto.d.ts.map +1 -1
  175. package/dist/db/CLAUDE.md +9 -0
  176. package/dist/db/assert_row.d.ts.map +1 -1
  177. package/dist/db/cell_audit_queries.d.ts.map +1 -1
  178. package/dist/db/cell_ddl.d.ts.map +1 -1
  179. package/dist/db/cell_field_queries.d.ts.map +1 -1
  180. package/dist/db/cell_grant_queries.d.ts.map +1 -1
  181. package/dist/db/cell_item_queries.d.ts.map +1 -1
  182. package/dist/db/cell_moderation.d.ts.map +1 -1
  183. package/dist/db/cell_queries.d.ts.map +1 -1
  184. package/dist/db/cell_view_sql.d.ts.map +1 -1
  185. package/dist/db/create_db.d.ts.map +1 -1
  186. package/dist/db/db.d.ts.map +1 -1
  187. package/dist/db/db_checkout_error.d.ts.map +1 -1
  188. package/dist/db/db_pg.d.ts.map +1 -1
  189. package/dist/db/db_pglet.d.ts.map +1 -1
  190. package/dist/db/db_pglite.d.ts.map +1 -1
  191. package/dist/db/fact_ddl.d.ts.map +1 -1
  192. package/dist/db/fact_disk_storage.d.ts +3 -2
  193. package/dist/db/fact_disk_storage.d.ts.map +1 -1
  194. package/dist/db/fact_disk_storage.js +2 -1
  195. package/dist/db/fact_holder_queries.d.ts.map +1 -1
  196. package/dist/db/fact_queries.d.ts.map +1 -1
  197. package/dist/db/fact_store.d.ts.map +1 -1
  198. package/dist/db/fact_store_errors.d.ts.map +1 -1
  199. package/dist/db/file_fact_url.d.ts +1 -6
  200. package/dist/db/file_fact_url.d.ts.map +1 -1
  201. package/dist/db/migrate.d.ts.map +1 -1
  202. package/dist/db/pg_error.d.ts.map +1 -1
  203. package/dist/db/postgres_url.d.ts +95 -0
  204. package/dist/db/postgres_url.d.ts.map +1 -0
  205. package/dist/db/postgres_url.js +167 -0
  206. package/dist/db/query_deps.d.ts.map +1 -1
  207. package/dist/db/schema_ready.d.ts.map +1 -1
  208. package/dist/db/sql_columns.d.ts.map +1 -1
  209. package/dist/db/sql_identifier.d.ts.map +1 -1
  210. package/dist/db/status.d.ts.map +1 -1
  211. package/dist/dev/setup.d.ts +101 -33
  212. package/dist/dev/setup.d.ts.map +1 -1
  213. package/dist/dev/setup.js +174 -71
  214. package/dist/env/dotenv.d.ts +1 -1
  215. package/dist/env/dotenv.d.ts.map +1 -1
  216. package/dist/env/dotenv.js +2 -3
  217. package/dist/env/env_schemas.d.ts.map +1 -1
  218. package/dist/env/load.d.ts.map +1 -1
  219. package/dist/env/mask.d.ts.map +1 -1
  220. package/dist/env/update_env_variable.d.ts.map +1 -1
  221. package/dist/hono_context.d.ts.map +1 -1
  222. package/dist/http/CLAUDE.md +1 -1
  223. package/dist/http/auth_shape.d.ts +1 -1
  224. package/dist/http/auth_shape.d.ts.map +1 -1
  225. package/dist/http/body_limit.d.ts +10 -16
  226. package/dist/http/body_limit.d.ts.map +1 -1
  227. package/dist/http/body_limit.js +10 -16
  228. package/dist/http/body_limit_schema.d.ts.map +1 -1
  229. package/dist/http/client_ip.d.ts.map +1 -1
  230. package/dist/http/common_routes.d.ts.map +1 -1
  231. package/dist/http/db_routes.d.ts.map +1 -1
  232. package/dist/http/dev_route_error_check.d.ts.map +1 -1
  233. package/dist/http/error_schemas.d.ts +31 -151
  234. package/dist/http/error_schemas.d.ts.map +1 -1
  235. package/dist/http/health_schema.d.ts +2 -6
  236. package/dist/http/health_schema.d.ts.map +1 -1
  237. package/dist/http/host.d.ts.map +1 -1
  238. package/dist/http/ip_canonical.d.ts.map +1 -1
  239. package/dist/http/json_text.d.ts.map +1 -1
  240. package/dist/http/jsonrpc.d.ts +42 -181
  241. package/dist/http/jsonrpc.d.ts.map +1 -1
  242. package/dist/http/jsonrpc_errors.d.ts.map +1 -1
  243. package/dist/http/jsonrpc_helpers.d.ts.map +1 -1
  244. package/dist/http/middleware_spec.d.ts.map +1 -1
  245. package/dist/http/origin.d.ts +2 -2
  246. package/dist/http/origin.d.ts.map +1 -1
  247. package/dist/http/origin_wildcard.d.ts.map +1 -1
  248. package/dist/http/pending_effects.d.ts.map +1 -1
  249. package/dist/http/proxy.d.ts.map +1 -1
  250. package/dist/http/route_error_check.d.ts.map +1 -1
  251. package/dist/http/route_errors.d.ts.map +1 -1
  252. package/dist/http/route_result.d.ts.map +1 -1
  253. package/dist/http/route_spec.d.ts.map +1 -1
  254. package/dist/http/schema_helpers.d.ts.map +1 -1
  255. package/dist/http/simple_request.d.ts.map +1 -1
  256. package/dist/http/surface.d.ts.map +1 -1
  257. package/dist/http/surface_query.d.ts.map +1 -1
  258. package/dist/periodic.d.ts.map +1 -1
  259. package/dist/primitive_schemas.d.ts +10 -30
  260. package/dist/primitive_schemas.d.ts.map +1 -1
  261. package/dist/rate_limiter.d.ts +1 -1
  262. package/dist/rate_limiter.d.ts.map +1 -1
  263. package/dist/realtime/audit_log_sse.d.ts.map +1 -1
  264. package/dist/realtime/outbound_budget.d.ts.map +1 -1
  265. package/dist/realtime/sse.d.ts.map +1 -1
  266. package/dist/realtime/sse_constants.d.ts.map +1 -1
  267. package/dist/realtime/sse_registry.d.ts.map +1 -1
  268. package/dist/runtime/deps.d.ts +81 -45
  269. package/dist/runtime/deps.d.ts.map +1 -1
  270. package/dist/runtime/deps.js +7 -2
  271. package/dist/runtime/fs.d.ts.map +1 -1
  272. package/dist/runtime/mock.d.ts +63 -16
  273. package/dist/runtime/mock.d.ts.map +1 -1
  274. package/dist/runtime/mock.js +75 -35
  275. package/dist/runtime/node.d.ts +3 -2
  276. package/dist/runtime/node.d.ts.map +1 -1
  277. package/dist/runtime/node.js +20 -72
  278. package/dist/runtime/process_id.d.ts +24 -0
  279. package/dist/runtime/process_id.d.ts.map +1 -0
  280. package/dist/runtime/process_id.js +27 -0
  281. package/dist/runtime/secure_file.d.ts +8 -30
  282. package/dist/runtime/secure_file.d.ts.map +1 -1
  283. package/dist/runtime/secure_file.js +23 -51
  284. package/dist/schema_issues.d.ts +6 -18
  285. package/dist/schema_issues.d.ts.map +1 -1
  286. package/dist/schema_meta.d.ts.map +1 -1
  287. package/dist/sensitivity.d.ts.map +1 -1
  288. package/dist/server/app_backend.d.ts.map +1 -1
  289. package/dist/server/app_error_handler.d.ts.map +1 -1
  290. package/dist/server/app_server.d.ts +2 -2
  291. package/dist/server/app_server.d.ts.map +1 -1
  292. package/dist/server/app_server_context.d.ts.map +1 -1
  293. package/dist/server/env.d.ts +11 -33
  294. package/dist/server/env.d.ts.map +1 -1
  295. package/dist/server/fact_security_headers.d.ts.map +1 -1
  296. package/dist/server/serve_fact_route.d.ts.map +1 -1
  297. package/dist/server/startup.d.ts.map +1 -1
  298. package/dist/server/static.d.ts +1 -1
  299. package/dist/server/static.d.ts.map +1 -1
  300. package/dist/server/surface_route.d.ts.map +1 -1
  301. package/dist/server/x_accel.d.ts +3 -7
  302. package/dist/server/x_accel.d.ts.map +1 -1
  303. package/dist/testing/CLAUDE.md +28 -27
  304. package/dist/testing/admin_integration.d.ts.map +1 -1
  305. package/dist/testing/adversarial_404.d.ts.map +1 -1
  306. package/dist/testing/adversarial_headers.d.ts.map +1 -1
  307. package/dist/testing/adversarial_input.d.ts.map +1 -1
  308. package/dist/testing/adversarial_input_cases.d.ts.map +1 -1
  309. package/dist/testing/app_server.d.ts.map +1 -1
  310. package/dist/testing/assert_dev_env.d.ts.map +1 -1
  311. package/dist/testing/assertions.d.ts.map +1 -1
  312. package/dist/testing/attack_surface.d.ts.map +1 -1
  313. package/dist/testing/audit_completeness.d.ts.map +1 -1
  314. package/dist/testing/audit_drift_guard.d.ts.map +1 -1
  315. package/dist/testing/auth_apps.d.ts.map +1 -1
  316. package/dist/testing/connection_closer_helpers.d.ts.map +1 -1
  317. package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -1
  318. package/dist/testing/cross_backend/action_manifest.d.ts +19 -95
  319. package/dist/testing/cross_backend/action_manifest.d.ts.map +1 -1
  320. package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
  321. package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -1
  322. package/dist/testing/cross_backend/app_settings.d.ts.map +1 -1
  323. package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
  324. package/dist/testing/cross_backend/backend_config.d.ts +7 -7
  325. package/dist/testing/cross_backend/backend_config.d.ts.map +1 -1
  326. package/dist/testing/cross_backend/bench/bench_report.d.ts +2 -2
  327. package/dist/testing/cross_backend/bench/bench_report.d.ts.map +1 -1
  328. package/dist/testing/cross_backend/bench/bench_report.js +2 -2
  329. package/dist/testing/cross_backend/bench/run_cross_impl_bench.d.ts.map +1 -1
  330. package/dist/testing/cross_backend/bench/scenario.d.ts.map +1 -1
  331. package/dist/testing/cross_backend/body_size.d.ts.map +1 -1
  332. package/dist/testing/cross_backend/body_size_smuggling.d.ts.map +1 -1
  333. package/dist/testing/cross_backend/body_size_smuggling.js +1 -4
  334. package/dist/testing/cross_backend/bootstrap_backend.d.ts +1 -1
  335. package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
  336. package/dist/testing/cross_backend/build_test_backend_paths.d.ts.map +1 -1
  337. package/dist/testing/cross_backend/capabilities.d.ts +2 -2
  338. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  339. package/dist/testing/cross_backend/cargo_binary.d.ts.map +1 -1
  340. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  341. package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -1
  342. package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -1
  343. package/dist/testing/cross_backend/cell_grant_steward.d.ts.map +1 -1
  344. package/dist/testing/cross_backend/cell_moderate.d.ts.map +1 -1
  345. package/dist/testing/cross_backend/cell_ref_admission.d.ts.map +1 -1
  346. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  347. package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
  348. package/dist/testing/cross_backend/conformance_rpc_auth.d.ts.map +1 -1
  349. package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
  350. package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -1
  351. package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +2 -2
  352. package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts.map +1 -1
  353. package/dist/testing/cross_backend/create_cross_backend_global_setup.js +1 -1
  354. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +2 -2
  355. package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts.map +1 -1
  356. package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
  357. package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -1
  358. package/dist/testing/cross_backend/cross_rpc.d.ts.map +1 -1
  359. package/dist/testing/cross_backend/default_backend_configs.d.ts +1 -1
  360. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  361. package/dist/testing/cross_backend/default_backend_configs.js +4 -4
  362. package/dist/testing/cross_backend/default_secrets.d.ts.map +1 -1
  363. package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
  364. package/dist/testing/cross_backend/differential.d.ts +2 -2
  365. package/dist/testing/cross_backend/differential.d.ts.map +1 -1
  366. package/dist/testing/cross_backend/differential.js +6 -6
  367. package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
  368. package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
  369. package/dist/testing/cross_backend/fact_serving.js +1 -1
  370. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  371. package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
  372. package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
  373. package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
  374. package/dist/testing/cross_backend/make_cross_backend_project.d.ts +2 -2
  375. package/dist/testing/cross_backend/make_cross_backend_project.d.ts.map +1 -1
  376. package/dist/testing/cross_backend/make_cross_backend_project.js +1 -1
  377. package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
  378. package/dist/testing/cross_backend/narrowed_api_token.d.ts.map +1 -1
  379. package/dist/testing/cross_backend/origin.d.ts.map +1 -1
  380. package/dist/testing/cross_backend/origin_conformance.d.ts +44 -294
  381. package/dist/testing/cross_backend/origin_conformance.d.ts.map +1 -1
  382. package/dist/testing/cross_backend/origin_conformance.json +1 -1
  383. package/dist/testing/cross_backend/origin_scope.d.ts.map +1 -1
  384. package/dist/testing/cross_backend/peer_ping_ws.d.ts.map +1 -1
  385. package/dist/testing/cross_backend/postgres_database.d.ts +7 -21
  386. package/dist/testing/cross_backend/postgres_database.d.ts.map +1 -1
  387. package/dist/testing/cross_backend/postgres_database.js +24 -35
  388. package/dist/testing/cross_backend/provided_context.d.ts.map +1 -1
  389. package/dist/testing/cross_backend/query_shape.d.ts.map +1 -1
  390. package/dist/testing/cross_backend/ready.d.ts.map +1 -1
  391. package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
  392. package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
  393. package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts.map +1 -1
  394. package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
  395. package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
  396. package/dist/testing/cross_backend/role_grant_participation.d.ts.map +1 -1
  397. package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
  398. package/dist/testing/cross_backend/rpc_adversarial.d.ts.map +1 -1
  399. package/dist/testing/cross_backend/rpc_success_fixtures.d.ts.map +1 -1
  400. package/dist/testing/cross_backend/rust_spine_consumer_surface.d.ts.map +1 -1
  401. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
  402. package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
  403. package/dist/testing/cross_backend/session_cookie_codec.d.ts.map +1 -1
  404. package/dist/testing/cross_backend/setup.d.ts.map +1 -1
  405. package/dist/testing/cross_backend/simple_request.d.ts.map +1 -1
  406. package/dist/testing/cross_backend/spawn_backend.d.ts.map +1 -1
  407. package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
  408. package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
  409. package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
  410. package/dist/testing/cross_backend/standard.d.ts.map +1 -1
  411. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -1
  412. package/dist/testing/cross_backend/test_cell_grant_steward_revoke_authorize.d.ts.map +1 -1
  413. package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
  414. package/dist/testing/cross_backend/testing_origin_check.d.ts +24 -136
  415. package/dist/testing/cross_backend/testing_origin_check.d.ts.map +1 -1
  416. package/dist/testing/cross_backend/testing_reset_actions.d.ts +92 -627
  417. package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
  418. package/dist/testing/cross_backend/testing_server_bun.d.ts.map +1 -1
  419. package/dist/testing/cross_backend/testing_server_bun.js +10 -12
  420. package/dist/testing/cross_backend/testing_server_core.d.ts +13 -17
  421. package/dist/testing/cross_backend/testing_server_core.d.ts.map +1 -1
  422. package/dist/testing/cross_backend/testing_server_core.js +1 -1
  423. package/dist/testing/cross_backend/testing_server_node.d.ts.map +1 -1
  424. package/dist/testing/cross_backend/token_lifetime.d.ts.map +1 -1
  425. package/dist/testing/cross_backend/token_scope_surface.d.ts.map +1 -1
  426. package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
  427. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts +7 -17
  428. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  429. package/dist/testing/cross_backend/ts_spine_backend_config.js +0 -51
  430. package/dist/testing/cross_backend/wire_shapes.d.ts.map +1 -1
  431. package/dist/testing/cross_backend/ws_action_rate_limit.d.ts.map +1 -1
  432. package/dist/testing/cross_backend/ws_connection_cap.d.ts.map +1 -1
  433. package/dist/testing/cross_backend/ws_endpoint.d.ts.map +1 -1
  434. package/dist/testing/cross_backend/ws_envelope.d.ts.map +1 -1
  435. package/dist/testing/cross_backend/ws_inbound_dispatch.d.ts.map +1 -1
  436. package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
  437. package/dist/testing/cross_backend/ws_outbound_overflow.js +2 -2
  438. package/dist/testing/cross_backend/ws_role_gated.d.ts.map +1 -1
  439. package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
  440. package/dist/testing/cross_backend/xfail.d.ts.map +1 -1
  441. package/dist/testing/daemon_info.d.ts +17 -24
  442. package/dist/testing/daemon_info.d.ts.map +1 -1
  443. package/dist/testing/daemon_info.js +11 -8
  444. package/dist/testing/daemon_token_rotation.d.ts.map +1 -1
  445. package/dist/testing/data_exposure.d.ts.map +1 -1
  446. package/dist/testing/db.d.ts.map +1 -1
  447. package/dist/testing/db_entities.d.ts.map +1 -1
  448. package/dist/testing/entities.d.ts.map +1 -1
  449. package/dist/testing/error_coverage.d.ts.map +1 -1
  450. package/dist/testing/integration.d.ts.map +1 -1
  451. package/dist/testing/integration_helpers.d.ts.map +1 -1
  452. package/dist/testing/middleware.d.ts.map +1 -1
  453. package/dist/testing/middleware_gate_probes.d.ts.map +1 -1
  454. package/dist/testing/middleware_gate_probes.js +2 -2
  455. package/dist/testing/rate_limiting.d.ts.map +1 -1
  456. package/dist/testing/resolved_auth.d.ts.map +1 -1
  457. package/dist/testing/role_grant_helpers.d.ts.map +1 -1
  458. package/dist/testing/round_trip.d.ts.map +1 -1
  459. package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
  460. package/dist/testing/rpc_envelope_cases.d.ts.map +1 -1
  461. package/dist/testing/rpc_helpers.d.ts.map +1 -1
  462. package/dist/testing/rpc_round_trip.d.ts.map +1 -1
  463. package/dist/testing/schema_generators.d.ts.map +1 -1
  464. package/dist/testing/schema_introspect.d.ts +52 -380
  465. package/dist/testing/schema_introspect.d.ts.map +1 -1
  466. package/dist/testing/schema_parity.d.ts.map +1 -1
  467. package/dist/testing/schema_ready_fixture.d.ts.map +1 -1
  468. package/dist/testing/sse_round_trip.d.ts.map +1 -1
  469. package/dist/testing/stubs.d.ts.map +1 -1
  470. package/dist/testing/surface_invariants.d.ts.map +1 -1
  471. package/dist/testing/test_credentials.d.ts.map +1 -1
  472. package/dist/testing/test_origin.d.ts.map +1 -1
  473. package/dist/testing/token_scope_fixtures.d.ts.map +1 -1
  474. package/dist/testing/transports/bootstrap.d.ts.map +1 -1
  475. package/dist/testing/transports/fetch_transport.d.ts.map +1 -1
  476. package/dist/testing/transports/raw_http.d.ts.map +1 -1
  477. package/dist/testing/transports/sse_frame_reader.d.ts.map +1 -1
  478. package/dist/testing/transports/sse_transport.d.ts.map +1 -1
  479. package/dist/testing/transports/ws_client.d.ts.map +1 -1
  480. package/dist/testing/transports/ws_raw_client.d.ts.map +1 -1
  481. package/dist/testing/transports/ws_transport.d.ts.map +1 -1
  482. package/dist/testing/ws_round_trip.d.ts.map +1 -1
  483. package/dist/timestamp.d.ts.map +1 -1
  484. package/dist/ui/AccountSessions.svelte.d.ts.map +1 -1
  485. package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
  486. package/dist/ui/AdminAuditLog.svelte.d.ts.map +1 -1
  487. package/dist/ui/AdminInvites.svelte.d.ts.map +1 -1
  488. package/dist/ui/AdminOverview.svelte.d.ts.map +1 -1
  489. package/dist/ui/AdminRoleGrantHistory.svelte.d.ts.map +1 -1
  490. package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
  491. package/dist/ui/AdminSettings.svelte.d.ts.map +1 -1
  492. package/dist/ui/AdminSurface.svelte.d.ts.map +1 -1
  493. package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
  494. package/dist/ui/CLAUDE.md +3 -195
  495. package/dist/ui/ConfirmButton.svelte.d.ts.map +1 -1
  496. package/dist/ui/Datatable.svelte.d.ts.map +1 -1
  497. package/dist/ui/LoginForm.svelte.d.ts.map +1 -1
  498. package/dist/ui/LogoutButton.svelte.d.ts.map +1 -1
  499. package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
  500. package/dist/ui/PopoverButton.svelte.d.ts.map +1 -1
  501. package/dist/ui/RoleGrantOfferForm.svelte +1 -1
  502. package/dist/ui/RoleGrantOfferForm.svelte.d.ts.map +1 -1
  503. package/dist/ui/RoleGrantOfferHistory.svelte.d.ts.map +1 -1
  504. package/dist/ui/RoleGrantOfferInbox.svelte +4 -4
  505. package/dist/ui/RoleGrantOfferInbox.svelte.d.ts.map +1 -1
  506. package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
  507. package/dist/ui/SurfaceExplorer.svelte.d.ts.map +1 -1
  508. package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
  509. package/dist/ui/admin_accounts_state.svelte.d.ts +5 -5
  510. package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
  511. package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
  512. package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
  513. package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
  514. package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
  515. package/dist/ui/async_slot.svelte.d.ts.map +1 -1
  516. package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
  517. package/dist/ui/auth_state.svelte.d.ts.map +1 -1
  518. package/dist/ui/backend_probe.svelte.d.ts.map +1 -1
  519. package/dist/ui/datatable.d.ts.map +1 -1
  520. package/dist/ui/form_state.svelte.d.ts.map +1 -1
  521. package/dist/ui/format_scope.d.ts.map +1 -1
  522. package/dist/ui/keyed_async_slot.svelte.d.ts.map +1 -1
  523. package/dist/ui/popover.svelte.d.ts +1 -1
  524. package/dist/ui/popover.svelte.d.ts.map +1 -1
  525. package/dist/ui/popover.svelte.js +1 -1
  526. package/dist/ui/position_helpers.d.ts.map +1 -1
  527. package/dist/ui/role_grant_offers_state.svelte.d.ts +5 -5
  528. package/dist/ui/role_grant_offers_state.svelte.d.ts.map +1 -1
  529. package/dist/ui/table_state.svelte.d.ts.map +1 -1
  530. package/dist/ui/ui_fetch.d.ts.map +1 -1
  531. package/dist/ui/ui_format.d.ts.map +1 -1
  532. package/package.json +10 -15
  533. package/dist/runtime/deno.d.ts +0 -21
  534. package/dist/runtime/deno.d.ts.map +0 -1
  535. package/dist/runtime/deno.js +0 -191
  536. package/dist/testing/cross_backend/testing_server_deno.d.ts +0 -5
  537. package/dist/testing/cross_backend/testing_server_deno.d.ts.map +0 -1
  538. package/dist/testing/cross_backend/testing_server_deno.js +0 -38
  539. package/dist/ui/AppShell.svelte +0 -448
  540. package/dist/ui/AppShell.svelte.d.ts +0 -135
  541. package/dist/ui/AppShell.svelte.d.ts.map +0 -1
  542. package/dist/ui/ColumnLayout.svelte +0 -185
  543. package/dist/ui/ColumnLayout.svelte.d.ts +0 -60
  544. package/dist/ui/ColumnLayout.svelte.d.ts.map +0 -1
  545. package/dist/ui/MenuLink.svelte +0 -45
  546. package/dist/ui/MenuLink.svelte.d.ts +0 -30
  547. package/dist/ui/MenuLink.svelte.d.ts.map +0 -1
  548. package/dist/ui/sidebar_state.svelte.d.ts +0 -113
  549. package/dist/ui/sidebar_state.svelte.d.ts.map +0 -1
  550. package/dist/ui/sidebar_state.svelte.js +0 -125
@@ -1,448 +0,0 @@
1
- <script lang="ts">
2
- /**
3
- * Sidebar-and-main app shell. Provisions `sidebar_state_context` (creating
4
- * a fresh `SidebarState` if `sidebar_state` is not supplied) so descendants
5
- * can read sidebar visibility and toggle it. Optionally binds a global
6
- * keyboard shortcut and renders a built-in toggle button (or a custom one
7
- * via the `toggle_button` snippet) while the sidebar is enabled. Requires
8
- * the SvelteKit runtime — it closes the overlay from `afterNavigate`.
9
- *
10
- * Two modes, split by the state's `narrow_query`. Outside it the sidebar
11
- * sits beside the content, padded by `--sidebar_offset`, following
12
- * `show_sidebar_wide`. Inside it the sidebar starts closed and opens as an
13
- * overlay over a scrim, following `show_sidebar_narrow`; the content is
14
- * `inert` while it's open, and navigation, Escape, a scrim click, or
15
- * widening out of narrow mode closes it. Escape never prevents the
16
- * default, so the browser's close requests stay intact; it does nothing
17
- * while a modal (`:modal`) is open, when a window `keydown` listener
18
- * registered before the overlay opened swallows it (a contextmenu, say),
19
- * or when a visible `Popover`'s `document` listener already handled it.
20
- *
21
- * The open overlay is a modal dialog: the sidebar takes `role="dialog"`,
22
- * `aria-modal`, `tabindex="-1"`, and `sidebar_label` as its name, and
23
- * focus moves into it, to its first control that takes focus, else to the
24
- * sidebar itself — the content went inert and dropped it. The attributes
25
- * key on the open overlay, which reads the viewport — that's what keeps
26
- * the wide sidebar from ever being a dialog — and the server render
27
- * matches hydration because the overlay always starts closed, as with the
28
- * content's `inert`. `aria-modal` lets assistive tech hide everything
29
- * outside the sidebar, the built-in toggle included, so a sidebar whose
30
- * screen-reader users need a close control beyond Escape and navigation
31
- * renders its own.
32
- *
33
- * Closing with Escape, the keyboard shortcut, or a scrim click returns
34
- * focus to what opened the overlay, or else to the first element whose
35
- * `aria-controls` names the sidebar's id and that takes it — when focus
36
- * was inside the sidebar or had fallen to the body. The id is the state's
37
- * `sidebar_id` when set, so a toggle outside the shell can carry
38
- * `aria-controls` too; Safari doesn't focus a clicked button, so without
39
- * it a mouse-opened overlay has no opener to return to.
40
- *
41
- * The shell's rules sit in two cascade layers nested under `fuz_app`.
42
- * `fuz_app.app_shell_base`, in the scoped style, holds the base and state
43
- * rules, which apply in both modes; `fuz_app.app_shell_narrow` overrides
44
- * some of them from a style element in `svelte:head` carrying
45
- * `media={narrow_query}`, so the server render paints the right mode
46
- * before hydration and the markup's classes never depend on the viewport.
47
- * The narrow layer is ordered after the base layer, so it wins whatever
48
- * the selectors' specificity or the sheets' order. Its rules are global —
49
- * they match every `.app-shell` on the page — so shells mounted at the
50
- * same time must share a `narrow_query`. Pages served under a strict CSP
51
- * need `style-src-elem 'unsafe-inline'` or the hash of that constant style.
52
- *
53
- * Public class hooks: `.app-shell` (root, with state classes `.wide-open` /
54
- * `.narrow-open`), `.app-shell-content`, `.app-shell-sidebar`,
55
- * `.app-shell-scrim`, `.app-shell-toggle`, `.app-shell-toggle-glyph`. Any
56
- * unlayered rule beats both layers at any specificity, so overrides need
57
- * no specificity games; to layer them instead, order `fuz_app` first
58
- * (`@layer fuz_app, overrides;`) in a sheet that loads before the shell.
59
- * The same rule means an unlayered reset overrides the shell too — the
60
- * fuz_css reset zeroes `padding`, `margin`, and `border` on every element —
61
- * so the layers set none of those. The one they need, the content's
62
- * wide offset, goes through `--sidebar_offset`: the layers set it on
63
- * `.app-shell-content` (`--sidebar_width` while the wide sidebar is open,
64
- * else `0px`), and one unlayered rule at (0,0,1) reads it into the
65
- * content's `padding-left`. Descendants of the content can read it too.
66
- * Override the offset by setting `--sidebar_offset` on
67
- * `.app-shell-content` or with a `padding-left` rule there; a `padding`
68
- * shorthand there overrides it as well. Like any unlayered override,
69
- * these apply in both modes, open or closed; to change only the wide open
70
- * offset, target `.app-shell.wide-open > .app-shell-content` inside the
71
- * narrow query's negation — the state classes don't track the viewport,
72
- * so `.wide-open` stays set in narrow mode too. CSS variables:
73
- * `--sidebar_bg`, `--sidebar_z_index` (default `200` in both modes; the toggle sits one
74
- * above), `--sidebar_scrim_bg`, `--sidebar_width` (set from the
75
- * `sidebar_width` prop; always the configured width, not the offset), and
76
- * `--sidebar_offset`.
77
- *
78
- * @module
79
- */
80
-
81
- import { flushSync, type Snippet } from 'svelte';
82
- import type { SvelteHTMLElements } from 'svelte/elements';
83
- import { on } from 'svelte/events';
84
- import { afterNavigate } from '$app/navigation';
85
- import { is_editable, swallow } from '@fuzdev/fuz_util/dom.ts';
86
-
87
- import { SidebarState, sidebar_state_context } from './sidebar_state.svelte.js';
88
-
89
- // what can take focus from the keyboard, narrowed further by `tabIndex`
90
- const FOCUSABLE_SELECTOR =
91
- 'a[href], area[href], button, input, select, textarea, iframe, summary, [tabindex], [contenteditable]';
92
-
93
- const {
94
- children,
95
- sidebar,
96
- sidebar_width = 180,
97
- sidebar_label = 'sidebar',
98
- sidebar_state: sidebar_state_prop,
99
- keyboard_shortcut = false,
100
- show_toggle = true,
101
- toggle_button,
102
- class: class_prop,
103
- ...rest
104
- }: SvelteHTMLElements['div'] & {
105
- children: Snippet;
106
- sidebar: Snippet;
107
- /**
108
- * Sidebar width in pixels when shown; in narrow mode capped at `85vw`.
109
- * @default 180
110
- */
111
- sidebar_width?: number;
112
- /**
113
- * Accessible name for the sidebar while it's the narrow-mode overlay,
114
- * announced as a modal dialog.
115
- * @default 'sidebar'
116
- */
117
- sidebar_label?: string;
118
- /** Optional pre-built `SidebarState` for sharing visibility across shells. */
119
- sidebar_state?: SidebarState;
120
- /**
121
- * Single-key shortcut that toggles the sidebar (e.g. `'b'`) while it's
122
- * enabled and no modal is open — the persistent sidebar in wide mode,
123
- * the overlay in narrow mode. `false` disables.
124
- * @default false
125
- */
126
- keyboard_shortcut?: string | false;
127
- /**
128
- * Whether to render the built-in (or custom) toggle button. It renders
129
- * only while the sidebar is enabled either way.
130
- * @default true
131
- */
132
- show_toggle?: boolean;
133
- /**
134
- * Custom toggle-button renderer; receives the title, visibility, toggle
135
- * callback, and the sidebar element's id. Give the button
136
- * `class="app-shell-toggle"` so it stacks above the sidebar and scrim
137
- * (it renders as a direct child of the root) — the z-index applies only
138
- * to a positioned button, so position it (e.g. `position: fixed`) — and
139
- * `aria-controls={sidebar_id}` so closing can return focus to it.
140
- * `show_sidebar` is viewport-dependent: the server renders it as in wide
141
- * mode, so rendering it as visible content changes on hydration at
142
- * narrow widths — attributes are repaired, but key visible content on
143
- * CSS or the viewport-free fields instead.
144
- */
145
- toggle_button?: Snippet<
146
- [{ title: string; show_sidebar: boolean; toggle: () => void; sidebar_id: string }]
147
- >;
148
- } = $props();
149
-
150
- const uid = $props.id();
151
-
152
- let fallback_sidebar_state: SidebarState | undefined;
153
- const get_sidebar_state = sidebar_state_context.set(
154
- () => sidebar_state_prop ?? (fallback_sidebar_state ??= new SidebarState())
155
- );
156
- const sidebar_state = $derived(get_sidebar_state());
157
-
158
- const sidebar_id = $derived(sidebar_state.sidebar_id ?? `${uid}-sidebar`);
159
-
160
- // viewport-free, so the server and hydration renders agree
161
- const wide_open = $derived(sidebar_state.enabled && sidebar_state.show_sidebar_wide);
162
- const narrow_open = $derived(sidebar_state.enabled && sidebar_state.show_sidebar_narrow);
163
- // viewport-dependent, only for `inert` and input handling (always `false` in SSR)
164
- const overlay_open = $derived(sidebar_state.narrow && narrow_open);
165
-
166
- const button_title = $derived(
167
- (sidebar_state.show_sidebar ? 'hide sidebar' : 'show sidebar') +
168
- (keyboard_shortcut ? ` [${keyboard_shortcut}]` : '')
169
- );
170
-
171
- let sidebar_el: HTMLElement | undefined = $state();
172
- let opener: HTMLElement | null = null;
173
-
174
- afterNavigate(() => sidebar_state.close_narrow());
175
-
176
- // widening out of narrow mode closes the overlay; the wide preference is untouched
177
- $effect(() => {
178
- if (!sidebar_state.narrow) sidebar_state.close_narrow();
179
- });
180
-
181
- const on_escape = (e: KeyboardEvent): void => {
182
- if (e.key !== 'Escape' || e.defaultPrevented || !overlay_open) return;
183
- // an open modal dialog owns Escape; not preventing the default leaves the
184
- // browser's close requests (dialog `cancel`, `popover="auto"`) intact
185
- if (document.querySelector(':modal')) return;
186
- close_overlay();
187
- };
188
-
189
- // closes the overlay, returning focus when it was inside the sidebar or had
190
- // fallen to the body — the inert content drops focus opened from within it
191
- const close_overlay = (): void => {
192
- const active = document.activeElement;
193
- const should_return_focus =
194
- !active || active === document.body || !!sidebar_el?.contains(active);
195
- // flush so the content is no longer `inert` when focus returns into it
196
- flushSync(() => sidebar_state.close_narrow());
197
- if (should_return_focus) return_focus();
198
- };
199
-
200
- // focuses `el`, returning whether it took focus — disabled, hidden, and
201
- // inert elements refuse it
202
- const try_focus = (el: HTMLElement): boolean => {
203
- el.focus();
204
- return document.activeElement === el;
205
- };
206
-
207
- // the opener if it's still there and takes focus, else the first toggle that
208
- // does — Safari doesn't focus a clicked button, so the opener can be `null`
209
- const return_focus = (): void => {
210
- if (opener?.isConnected && try_focus(opener)) return;
211
- for (const toggle of document.querySelectorAll<HTMLElement>('[aria-controls]')) {
212
- // `aria-controls` is an id list
213
- const ids = toggle.getAttribute('aria-controls')!.split(/\s+/);
214
- if (ids.includes(sidebar_id) && try_focus(toggle)) return;
215
- }
216
- };
217
-
218
- // the first control in the sidebar that takes focus, else the sidebar itself
219
- // (`tabindex="-1"` while it's the overlay); `tabIndex` screens out what only
220
- // script can focus
221
- const focus_sidebar = (): void => {
222
- if (!sidebar_el) return;
223
- for (const el of sidebar_el.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)) {
224
- if (el.tabIndex >= 0 && try_focus(el)) return;
225
- }
226
- sidebar_el.focus();
227
- };
228
-
229
- // while the overlay is open, remember what had focus (to return it on
230
- // close), move focus into the sidebar — the content just went inert, which
231
- // drops its focus — and listen for Escape, registered now, not at mount, so
232
- // window listeners mounted earlier (a contextmenu's, say) see Escape first
233
- // and can swallow it
234
- $effect(() => {
235
- if (!overlay_open) return;
236
- const active = document.activeElement;
237
- // never an element in the sidebar, which hides again on close
238
- opener =
239
- active instanceof HTMLElement && active !== document.body && !sidebar_el?.contains(active)
240
- ? active
241
- : null;
242
- focus_sidebar();
243
- return on(window, 'keydown', on_escape);
244
- });
245
- </script>
246
-
247
- <svelte:head>
248
- {#if sidebar_state.narrow_query !== null}
249
- <style media={sidebar_state.narrow_query}>
250
- @layer fuz_app.app_shell_base, fuz_app.app_shell_narrow;
251
- @layer fuz_app.app_shell_narrow {
252
- .app-shell > .app-shell-content {
253
- --sidebar_offset: 0px;
254
- }
255
- .app-shell > .app-shell-sidebar {
256
- visibility: hidden;
257
- translate: -100% 0;
258
- width: min(var(--sidebar_width), 85vw);
259
- }
260
- .app-shell.narrow-open > .app-shell-sidebar {
261
- visibility: visible;
262
- translate: none;
263
- }
264
- .app-shell.narrow-open > .app-shell-scrim {
265
- display: block;
266
- }
267
- .app-shell > .app-shell-toggle .app-shell-toggle-glyph {
268
- scale: -1 1;
269
- }
270
- .app-shell.narrow-open > .app-shell-toggle .app-shell-toggle-glyph {
271
- scale: none;
272
- }
273
- @media (prefers-reduced-motion: no-preference) {
274
- .app-shell > .app-shell-sidebar {
275
- transition:
276
- translate 150ms ease-out,
277
- visibility 0s 150ms;
278
- }
279
- .app-shell.narrow-open > .app-shell-sidebar {
280
- transition:
281
- translate 150ms ease-out,
282
- visibility 0s;
283
- }
284
- }
285
- }
286
- </style>
287
- {/if}
288
- </svelte:head>
289
-
290
- <svelte:window
291
- onkeydowncapture={(e) => {
292
- if (
293
- keyboard_shortcut &&
294
- sidebar_state.enabled &&
295
- e.key === keyboard_shortcut &&
296
- !is_editable(e.target) &&
297
- // a modal owns the keyboard, even one opened from the overlay
298
- !document.querySelector(':modal')
299
- ) {
300
- // closing the overlay returns focus like Escape; the rest just toggles
301
- if (overlay_open) {
302
- close_overlay();
303
- } else {
304
- sidebar_state.toggle_sidebar();
305
- }
306
- swallow(e);
307
- }
308
- }}
309
- />
310
-
311
- <div
312
- {...rest}
313
- class={['app-shell', class_prop, { 'wide-open': wide_open, 'narrow-open': narrow_open }]}
314
- style:--sidebar_width="{sidebar_width}px"
315
- >
316
- <div class="app-shell-content" inert={overlay_open}>
317
- {@render children()}
318
- </div>
319
- <!-- pointer-only dismissal; Escape is the keyboard path -->
320
- <div class="app-shell-scrim" aria-hidden="true" onclick={close_overlay}></div>
321
- {#if show_toggle && sidebar_state.enabled}
322
- {#if toggle_button}
323
- {@render toggle_button({
324
- title: button_title,
325
- show_sidebar: sidebar_state.show_sidebar,
326
- toggle: () => sidebar_state.toggle_sidebar(),
327
- sidebar_id
328
- })}
329
- {:else}
330
- <button
331
- type="button"
332
- class="app-shell-toggle fixed bottom:0 left:0 icon_button plain border-radius:0 border_top_right_radius_sm"
333
- aria-label="sidebar"
334
- aria-keyshortcuts={keyboard_shortcut || undefined}
335
- aria-expanded={sidebar_state.show_sidebar}
336
- aria-controls={sidebar_id}
337
- title={button_title}
338
- onclick={() => sidebar_state.toggle_sidebar()}
339
- >
340
- <span class="app-shell-toggle-glyph" aria-hidden="true">←</span>
341
- </button>
342
- {/if}
343
- {/if}
344
- <!-- open, the overlay is a modal dialog whose `tabindex="-1"` makes it focus's
345
- fallback target; the wide sidebar stays a plain element, so a click on its
346
- background doesn't take focus. The a11y rule can't see the value is only
347
- ever -1. -->
348
- <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
349
- <div
350
- class="app-shell-sidebar"
351
- id={sidebar_id}
352
- role={overlay_open ? 'dialog' : undefined}
353
- aria-modal={overlay_open ? 'true' : undefined}
354
- aria-label={overlay_open ? sidebar_label : undefined}
355
- tabindex={overlay_open ? -1 : undefined}
356
- bind:this={sidebar_el}
357
- >
358
- {@render sidebar()}
359
- </div>
360
- </div>
361
-
362
- <style>
363
- /*
364
- * The shell's rules sit in `fuz_app.app_shell_base`. The narrow overrides live
365
- * in the `media` style in `svelte:head`, in `fuz_app.app_shell_narrow`, which
366
- * this order statement puts after the base layer — so they win regardless of
367
- * specificity (these selectors carry the scope hash) or of which sheet loads
368
- * first. The head style opens with the same statement; repeating it here pins
369
- * the order whichever sheet the browser meets first.
370
- */
371
- @layer fuz_app.app_shell_base, fuz_app.app_shell_narrow;
372
-
373
- /*
374
- * Never put a property the fuz_css reset sets (`padding`, `margin`, `border`,
375
- * `box-sizing`, and their longhands) in a layer: the reset is unlayered, so it
376
- * beats every layered declaration and the layered value computes to the
377
- * reset's. Route such a value through a custom property the layers set, read
378
- * by an unlayered rule. The content offset is the one case: the layers set
379
- * `--sidebar_offset`, and this rule reads it. It's unscoped at (0,0,1) — above
380
- * the reset's (0,0,0), below any class selector — so a consumer rule on
381
- * `.app-shell-content` overrides it without matching specificity.
382
- */
383
- :global(div:where(.app-shell > .app-shell-content)) {
384
- padding-left: var(--sidebar_offset, 0px);
385
- }
386
-
387
- @layer fuz_app.app_shell_base {
388
- .app-shell-content {
389
- --sidebar_offset: 0px;
390
- display: flex;
391
- flex-direction: column;
392
- /* the small viewport, so the floor alone never makes a mobile page
393
- scroll with the toolbar shown, nor relayouts as the toolbar moves */
394
- min-height: 100svh;
395
- }
396
- .app-shell.wide-open > .app-shell-content {
397
- --sidebar_offset: var(--sidebar_width);
398
- }
399
-
400
- .app-shell-sidebar {
401
- position: fixed;
402
- top: 0;
403
- left: 0;
404
- width: var(--sidebar_width);
405
- height: 100%;
406
- overflow: auto;
407
- overscroll-behavior: contain;
408
- scrollbar-width: thin;
409
- background: var(--sidebar_bg, var(--shade_05));
410
- z-index: var(--sidebar_z_index, 200);
411
- visibility: hidden;
412
- }
413
- .app-shell.wide-open > .app-shell-sidebar {
414
- visibility: visible;
415
- }
416
-
417
- .app-shell-scrim {
418
- display: none;
419
- position: fixed;
420
- inset: 0;
421
- z-index: var(--sidebar_z_index, 200);
422
- background: var(--sidebar_scrim_bg, var(--darken_40));
423
- }
424
-
425
- /*
426
- * The toggle and its glyph may be consumer markup from the `toggle_button`
427
- * snippet, which never carries this component's scope hash, so they're
428
- * matched by their public class names under the scoped root. The glyph
429
- * rules go through the root's own toggle so an outer shell's state never
430
- * reaches a nested shell's glyph.
431
- */
432
- .app-shell > :global(.app-shell-toggle) {
433
- z-index: calc(var(--sidebar_z_index, 200) + 1);
434
- }
435
- .app-shell > :global(.app-shell-toggle) :global(.app-shell-toggle-glyph) {
436
- display: inline-block;
437
- scale: -1 1;
438
- }
439
- .app-shell.wide-open > :global(.app-shell-toggle) :global(.app-shell-toggle-glyph) {
440
- scale: none;
441
- }
442
-
443
- /* a modal in the sidebar is in the top layer but inherits its visibility */
444
- .app-shell-sidebar :global(:modal) {
445
- visibility: visible;
446
- }
447
- }
448
- </style>
@@ -1,135 +0,0 @@
1
- /**
2
- * Sidebar-and-main app shell. Provisions `sidebar_state_context` (creating
3
- * a fresh `SidebarState` if `sidebar_state` is not supplied) so descendants
4
- * can read sidebar visibility and toggle it. Optionally binds a global
5
- * keyboard shortcut and renders a built-in toggle button (or a custom one
6
- * via the `toggle_button` snippet) while the sidebar is enabled. Requires
7
- * the SvelteKit runtime — it closes the overlay from `afterNavigate`.
8
- *
9
- * Two modes, split by the state's `narrow_query`. Outside it the sidebar
10
- * sits beside the content, padded by `--sidebar_offset`, following
11
- * `show_sidebar_wide`. Inside it the sidebar starts closed and opens as an
12
- * overlay over a scrim, following `show_sidebar_narrow`; the content is
13
- * `inert` while it's open, and navigation, Escape, a scrim click, or
14
- * widening out of narrow mode closes it. Escape never prevents the
15
- * default, so the browser's close requests stay intact; it does nothing
16
- * while a modal (`:modal`) is open, when a window `keydown` listener
17
- * registered before the overlay opened swallows it (a contextmenu, say),
18
- * or when a visible `Popover`'s `document` listener already handled it.
19
- *
20
- * The open overlay is a modal dialog: the sidebar takes `role="dialog"`,
21
- * `aria-modal`, `tabindex="-1"`, and `sidebar_label` as its name, and
22
- * focus moves into it, to its first control that takes focus, else to the
23
- * sidebar itself — the content went inert and dropped it. The attributes
24
- * key on the open overlay, which reads the viewport — that's what keeps
25
- * the wide sidebar from ever being a dialog — and the server render
26
- * matches hydration because the overlay always starts closed, as with the
27
- * content's `inert`. `aria-modal` lets assistive tech hide everything
28
- * outside the sidebar, the built-in toggle included, so a sidebar whose
29
- * screen-reader users need a close control beyond Escape and navigation
30
- * renders its own.
31
- *
32
- * Closing with Escape, the keyboard shortcut, or a scrim click returns
33
- * focus to what opened the overlay, or else to the first element whose
34
- * `aria-controls` names the sidebar's id and that takes it — when focus
35
- * was inside the sidebar or had fallen to the body. The id is the state's
36
- * `sidebar_id` when set, so a toggle outside the shell can carry
37
- * `aria-controls` too; Safari doesn't focus a clicked button, so without
38
- * it a mouse-opened overlay has no opener to return to.
39
- *
40
- * The shell's rules sit in two cascade layers nested under `fuz_app`.
41
- * `fuz_app.app_shell_base`, in the scoped style, holds the base and state
42
- * rules, which apply in both modes; `fuz_app.app_shell_narrow` overrides
43
- * some of them from a style element in `svelte:head` carrying
44
- * `media={narrow_query}`, so the server render paints the right mode
45
- * before hydration and the markup's classes never depend on the viewport.
46
- * The narrow layer is ordered after the base layer, so it wins whatever
47
- * the selectors' specificity or the sheets' order. Its rules are global —
48
- * they match every `.app-shell` on the page — so shells mounted at the
49
- * same time must share a `narrow_query`. Pages served under a strict CSP
50
- * need `style-src-elem 'unsafe-inline'` or the hash of that constant style.
51
- *
52
- * Public class hooks: `.app-shell` (root, with state classes `.wide-open` /
53
- * `.narrow-open`), `.app-shell-content`, `.app-shell-sidebar`,
54
- * `.app-shell-scrim`, `.app-shell-toggle`, `.app-shell-toggle-glyph`. Any
55
- * unlayered rule beats both layers at any specificity, so overrides need
56
- * no specificity games; to layer them instead, order `fuz_app` first
57
- * (`@layer fuz_app, overrides;`) in a sheet that loads before the shell.
58
- * The same rule means an unlayered reset overrides the shell too — the
59
- * fuz_css reset zeroes `padding`, `margin`, and `border` on every element —
60
- * so the layers set none of those. The one they need, the content's
61
- * wide offset, goes through `--sidebar_offset`: the layers set it on
62
- * `.app-shell-content` (`--sidebar_width` while the wide sidebar is open,
63
- * else `0px`), and one unlayered rule at (0,0,1) reads it into the
64
- * content's `padding-left`. Descendants of the content can read it too.
65
- * Override the offset by setting `--sidebar_offset` on
66
- * `.app-shell-content` or with a `padding-left` rule there; a `padding`
67
- * shorthand there overrides it as well. Like any unlayered override,
68
- * these apply in both modes, open or closed; to change only the wide open
69
- * offset, target `.app-shell.wide-open > .app-shell-content` inside the
70
- * narrow query's negation — the state classes don't track the viewport,
71
- * so `.wide-open` stays set in narrow mode too. CSS variables:
72
- * `--sidebar_bg`, `--sidebar_z_index` (default `200` in both modes; the toggle sits one
73
- * above), `--sidebar_scrim_bg`, `--sidebar_width` (set from the
74
- * `sidebar_width` prop; always the configured width, not the offset), and
75
- * `--sidebar_offset`.
76
- *
77
- * @module
78
- */
79
- import { type Snippet } from 'svelte';
80
- import type { SvelteHTMLElements } from 'svelte/elements';
81
- import { SidebarState } from './sidebar_state.svelte.js';
82
- type $$ComponentProps = SvelteHTMLElements['div'] & {
83
- children: Snippet;
84
- sidebar: Snippet;
85
- /**
86
- * Sidebar width in pixels when shown; in narrow mode capped at `85vw`.
87
- * @default 180
88
- */
89
- sidebar_width?: number;
90
- /**
91
- * Accessible name for the sidebar while it's the narrow-mode overlay,
92
- * announced as a modal dialog.
93
- * @default 'sidebar'
94
- */
95
- sidebar_label?: string;
96
- /** Optional pre-built `SidebarState` for sharing visibility across shells. */
97
- sidebar_state?: SidebarState;
98
- /**
99
- * Single-key shortcut that toggles the sidebar (e.g. `'b'`) while it's
100
- * enabled and no modal is open — the persistent sidebar in wide mode,
101
- * the overlay in narrow mode. `false` disables.
102
- * @default false
103
- */
104
- keyboard_shortcut?: string | false;
105
- /**
106
- * Whether to render the built-in (or custom) toggle button. It renders
107
- * only while the sidebar is enabled either way.
108
- * @default true
109
- */
110
- show_toggle?: boolean;
111
- /**
112
- * Custom toggle-button renderer; receives the title, visibility, toggle
113
- * callback, and the sidebar element's id. Give the button
114
- * `class="app-shell-toggle"` so it stacks above the sidebar and scrim
115
- * (it renders as a direct child of the root) — the z-index applies only
116
- * to a positioned button, so position it (e.g. `position: fixed`) — and
117
- * `aria-controls={sidebar_id}` so closing can return focus to it.
118
- * `show_sidebar` is viewport-dependent: the server renders it as in wide
119
- * mode, so rendering it as visible content changes on hydration at
120
- * narrow widths — attributes are repaired, but key visible content on
121
- * CSS or the viewport-free fields instead.
122
- */
123
- toggle_button?: Snippet<[
124
- {
125
- title: string;
126
- show_sidebar: boolean;
127
- toggle: () => void;
128
- sidebar_id: string;
129
- }
130
- ]>;
131
- };
132
- declare const AppShell: import("svelte").Component<$$ComponentProps, {}, "">;
133
- type AppShell = ReturnType<typeof AppShell>;
134
- export default AppShell;
135
- //# sourceMappingURL=AppShell.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AppShell.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/ui/AppShell.svelte"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6EI;AACJ,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAK1D,OAAO,EAAE,YAAY,EAAyB,MAAM,2BAA2B,CAAC;AAE/E,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACnC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,OAAO,CACtB;QAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,OAAO,CAAC;YAAC,MAAM,EAAE,MAAM,IAAI,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE;KAAC,CAClF,CAAC;CACF,CAAC;AAsLH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}