@plitzi/sdk-shared 0.39.1 → 0.39.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (505) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  3. package/dist/actions/access.mjs +1 -2
  4. package/dist/actions/cron.mjs +1 -2
  5. package/dist/actions/failureHandler.mjs +1 -2
  6. package/dist/actions/flowDelay.d.ts +6 -0
  7. package/dist/actions/flowDelay.mjs +3 -0
  8. package/dist/actions/functions.d.ts +6 -3
  9. package/dist/actions/functions.mjs +12 -8
  10. package/dist/actions/index.d.ts +2 -1
  11. package/dist/actions/index.mjs +10 -9
  12. package/dist/actions/jobs.mjs +1 -2
  13. package/dist/actions/smtp.mjs +1 -2
  14. package/dist/actions/triggerParams.mjs +1 -2
  15. package/dist/actions/triggers.mjs +1 -2
  16. package/dist/actions/validateDocument.mjs +133 -123
  17. package/dist/activity/describe.mjs +1 -2
  18. package/dist/activity/guard.mjs +1 -2
  19. package/dist/activity/types.mjs +1 -2
  20. package/dist/auth/failureChannel.mjs +1 -2
  21. package/dist/auth/visitorRoles.mjs +1 -2
  22. package/dist/authoring/builder.mjs +1 -2
  23. package/dist/authoring/declare.mjs +1 -2
  24. package/dist/authoring/elementCallbacks.mjs +1 -2
  25. package/dist/authoring/index.mjs +3 -3
  26. package/dist/authoring/paramSpec.mjs +1 -2
  27. package/dist/authoring/spaceCallbacks.mjs +1 -2
  28. package/dist/builder/contexts/BuilderContext.mjs +1 -2
  29. package/dist/builder/contexts/index.mjs +1 -2
  30. package/dist/conditions/dates.d.ts +2 -0
  31. package/dist/conditions/dates.mjs +12 -0
  32. package/dist/conditions/evaluateRuleGroup.d.ts +13 -0
  33. package/dist/conditions/evaluateRuleGroup.mjs +4 -0
  34. package/dist/conditions/evaluator.d.ts +39 -0
  35. package/dist/conditions/evaluator.mjs +75 -0
  36. package/dist/conditions/index.d.ts +10 -0
  37. package/dist/conditions/index.mjs +5 -0
  38. package/dist/conditions/rules.d.ts +3 -0
  39. package/dist/conditions/rules.mjs +3 -0
  40. package/dist/conditions/types.d.ts +44 -0
  41. package/dist/connectors/constants.mjs +1 -2
  42. package/dist/connectors/manifestTokens.mjs +1 -2
  43. package/dist/connectors/presets.mjs +1 -2
  44. package/dist/connectors/validateManifest.mjs +56 -57
  45. package/dist/dataSource/computed.mjs +16 -17
  46. package/dist/dataSource/getBindingsDetails.d.ts +5 -6
  47. package/dist/dataSource/getBindingsDetails.mjs +65 -40
  48. package/dist/dataSource/globalSources.d.ts +1 -1
  49. package/dist/dataSource/globalSources.mjs +1 -2
  50. package/dist/dataSource/helpers/getSourceName.mjs +1 -2
  51. package/dist/dataSource/index.mjs +5 -5
  52. package/dist/dataSource/utility/arrayMap.mjs +2 -2
  53. package/dist/dataSource/utility/capitalize.mjs +1 -2
  54. package/dist/dataSource/utility/checkboxParams.mjs +1 -2
  55. package/dist/dataSource/utility/dateConverter.mjs +0 -1
  56. package/dist/dataSource/utility/index.mjs +15 -16
  57. package/dist/dataSource/utility/not.mjs +1 -2
  58. package/dist/dataSource/utility/staticValue.mjs +0 -1
  59. package/dist/dataSource/utility/stringToArray.mjs +0 -1
  60. package/dist/dataSource/utility/styleSelector.mjs +1 -2
  61. package/dist/dataSource/utility/styleVariant.mjs +2 -3
  62. package/dist/dataSource/utility/truthiness.mjs +1 -2
  63. package/dist/dataSource/utility/twigTemplate.mjs +0 -1
  64. package/dist/dataSource/variables/resolveVariables.mjs +2 -3
  65. package/dist/dates/formatDate.mjs +29 -30
  66. package/dist/dates/isDate.mjs +1 -2
  67. package/dist/devTools/chrome.mjs +1 -2
  68. package/dist/devTools/debugCookie.mjs +1 -2
  69. package/dist/devTools/index.mjs +5 -5
  70. package/dist/devTools/interactionLog.mjs +1 -2
  71. package/dist/devTools/react/DevToolsContext.mjs +1 -2
  72. package/dist/devTools/sight/sight.mjs +1 -2
  73. package/dist/devTools/utils/PlitziConsole.mjs +1 -2
  74. package/dist/elements/ComponentContext.mjs +1 -2
  75. package/dist/flags/flagsCookie.mjs +5 -6
  76. package/dist/flags/index.d.ts +1 -0
  77. package/dist/flags/index.mjs +4 -3
  78. package/dist/flags/overrides.d.ts +36 -0
  79. package/dist/flags/overrides.mjs +13 -0
  80. package/dist/flags/react/useFlagResolution.mjs +5 -6
  81. package/dist/flags/resolveFlags.d.ts +1 -1
  82. package/dist/flags/resolveFlags.mjs +2 -3
  83. package/dist/flags/schemaFlag.mjs +1 -2
  84. package/dist/functions/contract.d.ts +326 -0
  85. package/dist/functions/contract.mjs +3 -0
  86. package/dist/functions/index.d.ts +15 -0
  87. package/dist/functions/index.mjs +9 -0
  88. package/dist/functions/kv.d.ts +80 -0
  89. package/dist/functions/kvChange.d.ts +67 -0
  90. package/dist/functions/kvChange.mjs +24 -0
  91. package/dist/functions/later.d.ts +18 -0
  92. package/dist/functions/messages.d.ts +4 -0
  93. package/dist/functions/messages.mjs +205 -0
  94. package/dist/functions/protocol.d.ts +416 -0
  95. package/dist/functions/protocol.mjs +37 -0
  96. package/dist/functions/rateLimit.d.ts +17 -0
  97. package/dist/functions/rateLimit.mjs +0 -0
  98. package/dist/functions/refusal.d.ts +26 -0
  99. package/dist/functions/refusal.mjs +11 -0
  100. package/dist/functions/runtime.d.ts +44 -0
  101. package/dist/functions/runtime.mjs +13 -0
  102. package/dist/functions/sizes.d.ts +27 -0
  103. package/dist/functions/sizes.mjs +7 -0
  104. package/dist/functions/wire.d.ts +11 -0
  105. package/dist/functions/wire.mjs +39 -0
  106. package/dist/helpers/canonicalJson.mjs +1 -2
  107. package/dist/helpers/clipboard.mjs +1 -2
  108. package/dist/helpers/cookies.mjs +1 -2
  109. package/dist/helpers/deepEqual/deepEqual.d.ts +5 -0
  110. package/dist/helpers/deepEqual/deepEqual.mjs +44 -0
  111. package/dist/helpers/deepEqual/index.d.ts +1 -0
  112. package/dist/helpers/deepEqual/index.mjs +1 -0
  113. package/dist/helpers/eventTarget.mjs +1 -2
  114. package/dist/helpers/fetchManifest.mjs +1 -2
  115. package/dist/helpers/images.mjs +1 -2
  116. package/dist/helpers/index.d.ts +4 -6
  117. package/dist/helpers/index.mjs +24 -20
  118. package/dist/helpers/interval.mjs +1 -2
  119. package/dist/helpers/isRecord.mjs +1 -2
  120. package/dist/helpers/keys.mjs +1 -2
  121. package/dist/helpers/lodash/camelCase.d.ts +1 -0
  122. package/dist/helpers/lodash/camelCase.mjs +7 -0
  123. package/dist/helpers/lodash/capitalize.d.ts +1 -0
  124. package/dist/helpers/lodash/capitalize.mjs +5 -0
  125. package/dist/helpers/lodash/cloneDeep.d.ts +8 -0
  126. package/dist/helpers/lodash/cloneDeep.mjs +53 -0
  127. package/dist/helpers/lodash/get.d.ts +11 -0
  128. package/dist/helpers/lodash/get.mjs +14 -0
  129. package/dist/helpers/lodash/has.d.ts +2 -0
  130. package/dist/helpers/lodash/has.mjs +12 -0
  131. package/dist/helpers/lodash/index.d.ts +11 -0
  132. package/dist/helpers/lodash/index.mjs +7 -0
  133. package/dist/helpers/lodash/omit.d.ts +4 -0
  134. package/dist/helpers/lodash/omit.mjs +35 -0
  135. package/dist/helpers/lodash/set.d.ts +2 -0
  136. package/dist/helpers/lodash/set.mjs +20 -0
  137. package/dist/helpers/lodash/shared.d.ts +2 -0
  138. package/dist/helpers/lodash/shared.mjs +37 -0
  139. package/dist/helpers/reducerOrigin.mjs +1 -2
  140. package/dist/helpers/replaceEqualDeep/index.d.ts +1 -0
  141. package/dist/helpers/replaceEqualDeep/index.mjs +1 -0
  142. package/dist/helpers/replaceEqualDeep/replaceEqualDeep.d.ts +12 -0
  143. package/dist/helpers/replaceEqualDeep/replaceEqualDeep.mjs +30 -0
  144. package/dist/helpers/resources.d.ts +21 -0
  145. package/dist/helpers/resources.mjs +40 -0
  146. package/dist/helpers/scroll.mjs +1 -2
  147. package/dist/helpers/security.d.ts +15 -0
  148. package/dist/helpers/security.mjs +8 -4
  149. package/dist/helpers/spaceRoot.mjs +1 -2
  150. package/dist/helpers/syntaxHighlight.mjs +1 -2
  151. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +75 -76
  152. package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +1 -2
  153. package/dist/helpers/twigWrapper/Lexer/Lexer.mjs +1 -2
  154. package/dist/helpers/twigWrapper/Lexer/types.mjs +1 -2
  155. package/dist/helpers/twigWrapper/Parser/Cursor.mjs +1 -2
  156. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +1 -2
  157. package/dist/helpers/twigWrapper/Parser/Parser.mjs +1 -2
  158. package/dist/helpers/twigWrapper/Parser/helpers.mjs +1 -2
  159. package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -2
  160. package/dist/helpers/twigWrapper/charClass.mjs +1 -2
  161. package/dist/helpers/twigWrapper/filters/arrays.mjs +1 -2
  162. package/dist/helpers/twigWrapper/filters/catalog/index.mjs +1 -2
  163. package/dist/helpers/twigWrapper/filters/dateParts.mjs +1 -2
  164. package/dist/helpers/twigWrapper/filters/dates.mjs +13 -14
  165. package/dist/helpers/twigWrapper/filters/filters.mjs +21 -22
  166. package/dist/helpers/twigWrapper/filters/hashing.mjs +1 -2
  167. package/dist/helpers/twigWrapper/filters/misc.mjs +27 -28
  168. package/dist/helpers/twigWrapper/filters/numbers.mjs +1 -2
  169. package/dist/helpers/twigWrapper/filters/objects.mjs +1 -2
  170. package/dist/helpers/twigWrapper/filters/raw.mjs +1 -2
  171. package/dist/helpers/twigWrapper/filters/strings.mjs +23 -24
  172. package/dist/helpers/twigWrapper/filters/types.mjs +1 -2
  173. package/dist/helpers/twigWrapper/filters/values.mjs +1 -2
  174. package/dist/helpers/twigWrapper/index.mjs +8 -8
  175. package/dist/helpers/twigWrapper/inspectTemplate.mjs +12 -13
  176. package/dist/helpers/twigWrapper/processTwig/helpers.mjs +1 -2
  177. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +1 -2
  178. package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +1 -2
  179. package/dist/helpers/twigWrapper/templateRoots.d.ts +3 -9
  180. package/dist/helpers/twigWrapper/templateRoots.mjs +14 -9
  181. package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +1 -2
  182. package/dist/helpers/twigWrapper/tokens/hasValidToken.mjs +1 -2
  183. package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +1 -2
  184. package/dist/helpers/utils.mjs +2 -3
  185. package/dist/history/describe.mjs +1 -2
  186. package/dist/history/diff.mjs +1 -2
  187. package/dist/hooks/index.mjs +5 -5
  188. package/dist/hooks/useFontHead.mjs +1 -2
  189. package/dist/hooks/useNetwork.mjs +1 -2
  190. package/dist/hooks/usePlitzi.d.ts +7 -6
  191. package/dist/hooks/usePlitzi.mjs +1 -2
  192. package/dist/hooks/useStableValue.mjs +5 -6
  193. package/dist/navigation/index.mjs +3 -3
  194. package/dist/navigation/matchPath.mjs +19 -11
  195. package/dist/navigation/routes.mjs +57 -38
  196. package/dist/navigation/sitemap.mjs +9 -10
  197. package/dist/network/entitlements.d.ts +21 -0
  198. package/dist/network/entitlements.mjs +1 -2
  199. package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -2
  200. package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -2
  201. package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +1 -2
  202. package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -2
  203. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -2
  204. package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +1 -2
  205. package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -2
  206. package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -2
  207. package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -2
  208. package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -2
  209. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -2
  210. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +1 -2
  211. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +1 -2
  212. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -2
  213. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -2
  214. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -2
  215. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +1 -2
  216. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -2
  217. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -2
  218. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -2
  219. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -2
  220. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -2
  221. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -2
  222. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnBucketMutation.mjs +1 -2
  223. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -2
  224. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnBucketMutation.mjs +1 -2
  225. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -2
  226. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -2
  227. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnBucketMutation.mjs +1 -2
  228. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -2
  229. package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +1 -2
  230. package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +1 -2
  231. package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +1 -2
  232. package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +1 -2
  233. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -2
  234. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -2
  235. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -2
  236. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -2
  237. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -2
  238. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -2
  239. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +1 -2
  240. package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +1 -2
  241. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +1 -2
  242. package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +1 -2
  243. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -2
  244. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -2
  245. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -2
  246. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceInstallTemplateFunctionsMutation.mjs +1 -2
  247. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +1 -2
  248. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +1 -2
  249. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +1 -2
  250. package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +1 -2
  251. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -2
  252. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -2
  253. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -2
  254. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -2
  255. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -2
  256. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -2
  257. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -2
  258. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +1 -2
  259. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +1 -2
  260. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +1 -2
  261. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +1 -2
  262. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +1 -2
  263. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +1 -2
  264. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -2
  265. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -2
  266. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -2
  267. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +1 -2
  268. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +1 -2
  269. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -2
  270. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -2
  271. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -2
  272. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -2
  273. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -2
  274. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -2
  275. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -2
  276. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -2
  277. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -2
  278. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -2
  279. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -2
  280. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -2
  281. package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -2
  282. package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -2
  283. package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -2
  284. package/dist/network/graphql/builder/Mutations/index.mjs +155 -156
  285. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
  286. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -2
  287. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -2
  288. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -2
  289. package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -2
  290. package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +1 -2
  291. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -2
  292. package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -2
  293. package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -2
  294. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +1 -2
  295. package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -2
  296. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +1 -1
  297. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +2 -3
  298. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -2
  299. package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +1 -2
  300. package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -2
  301. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -2
  302. package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -2
  303. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +1 -1
  304. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +2 -3
  305. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +1 -2
  306. package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +1 -2
  307. package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +1 -2
  308. package/dist/network/graphql/builder/Queries/index.mjs +37 -38
  309. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -2
  310. package/dist/network/graphql/builder/Subscriptions/index.mjs +1 -2
  311. package/dist/network/graphql/builder/fragments/cdnFields.mjs +1 -2
  312. package/dist/network/graphql/index.d.ts +0 -1
  313. package/dist/network/graphql/index.mjs +1 -3
  314. package/dist/network/index.d.ts +1 -5
  315. package/dist/network/index.mjs +7 -11
  316. package/dist/network/{NetworkContext.d.ts → react/NetworkContext.d.ts} +12 -11
  317. package/dist/network/{NetworkContext.mjs → react/NetworkContext.mjs} +1 -2
  318. package/dist/network/{NetworkInternalContext.d.ts → react/NetworkInternalContext.d.ts} +1 -1
  319. package/dist/network/react/NetworkInternalContext.mjs +4 -0
  320. package/dist/network/react/index.d.ts +5 -0
  321. package/dist/network/react/index.mjs +3 -0
  322. package/dist/network/spaceEvents.mjs +16 -17
  323. package/dist/plugins/bundle/bundle.mjs +1 -2
  324. package/dist/plugins/declaration.mjs +1 -2
  325. package/dist/plugins/react/ElementRegistryContext.d.ts +26 -0
  326. package/dist/plugins/react/ElementRegistryContext.mjs +17 -0
  327. package/dist/plugins/react/PluginAssetsContext.d.ts +11 -0
  328. package/dist/plugins/react/PluginAssetsContext.mjs +4 -0
  329. package/dist/plugins/react/PluginsContext.mjs +6 -3
  330. package/dist/plugins/react/index.d.ts +3 -0
  331. package/dist/plugins/react/index.mjs +4 -1
  332. package/dist/project/index.mjs +7 -7
  333. package/dist/project/layout/check.mjs +26 -27
  334. package/dist/project/layout/codes.mjs +1 -2
  335. package/dist/project/layout/contents.mjs +12 -13
  336. package/dist/project/layout/files.mjs +1 -2
  337. package/dist/project/layout/folders.mjs +43 -44
  338. package/dist/project/layout/index.mjs +3 -3
  339. package/dist/project/layout/plugins.mjs +56 -57
  340. package/dist/project/layout/vendor.mjs +14 -15
  341. package/dist/project/network.mjs +1 -2
  342. package/dist/project/pages/index.mjs +1 -2
  343. package/dist/project/paths/index.d.ts +8 -2
  344. package/dist/project/paths/index.mjs +3 -4
  345. package/dist/project/root.mjs +1 -2
  346. package/dist/queries/index.mjs +1 -2
  347. package/dist/queries/queryCache.mjs +1 -2
  348. package/dist/queries/serverQueries.mjs +1 -2
  349. package/dist/queries/useQuery.mjs +1 -2
  350. package/dist/queries/useServerQuery.mjs +1 -2
  351. package/dist/{helpers → react}/enclosingSpace.mjs +1 -2
  352. package/dist/react/generateFacade.d.ts +1 -0
  353. package/dist/{helpers → react}/generateFacade.mjs +4 -5
  354. package/dist/react/index.d.ts +8 -0
  355. package/dist/react/index.mjs +4 -0
  356. package/dist/{helpers → react}/sharedContext.mjs +0 -1
  357. package/dist/realtime/client.mjs +3 -4
  358. package/dist/realtime/index.mjs +4 -4
  359. package/dist/realtime/presence.mjs +1 -2
  360. package/dist/realtime/topics.mjs +1 -2
  361. package/dist/runs/index.mjs +1 -2
  362. package/dist/runs/report.mjs +1 -2
  363. package/dist/schema/anchor.mjs +1 -2
  364. package/dist/schema/index.mjs +18 -18
  365. package/dist/schema/layoutChain.mjs +1 -2
  366. package/dist/schema/markdownHeadings.mjs +1 -2
  367. package/dist/schema/motion.mjs +1 -2
  368. package/dist/schema/motionReveal.mjs +1 -2
  369. package/dist/schema/pageAccess.d.ts +9 -0
  370. package/dist/schema/pageAccess.mjs +42 -36
  371. package/dist/schema/pageElements.d.ts +3 -1
  372. package/dist/schema/pageElements.mjs +9 -3
  373. package/dist/schema/pageHead.d.ts +5 -2
  374. package/dist/schema/pageHead.mjs +3 -4
  375. package/dist/schema/providerAnswer.mjs +1 -2
  376. package/dist/schema/providerWhen.d.ts +1 -1
  377. package/dist/schema/providerWhen.mjs +6 -7
  378. package/dist/schema/react/SchemaContext.mjs +1 -2
  379. package/dist/schema/schemaConstants.mjs +1 -2
  380. package/dist/schema/schemaSettings.mjs +1 -2
  381. package/dist/schema/serverElements.d.ts +0 -24
  382. package/dist/schema/serverElements.mjs +60 -39
  383. package/dist/schema/serverInput.mjs +23 -24
  384. package/dist/schema/serverQuery.d.ts +15 -5
  385. package/dist/schema/serverQuery.mjs +47 -35
  386. package/dist/schema/snippet.mjs +1 -2
  387. package/dist/schema/wire.mjs +1 -2
  388. package/dist/security/index.d.ts +49 -0
  389. package/dist/security/index.mjs +44 -0
  390. package/dist/server/actions/useActionsSync.mjs +1 -2
  391. package/dist/server/actions/useImagesSync.mjs +1 -2
  392. package/dist/server/actions/useRealtimeSync.mjs +1 -2
  393. package/dist/server/index.mjs +7 -7
  394. package/dist/server/rsc/refreshRsc.mjs +23 -24
  395. package/dist/server/rsc/useRscRefresh.mjs +1 -2
  396. package/dist/server/rsc/useRscSync.mjs +1 -2
  397. package/dist/server/usePluginRoute.mjs +1 -2
  398. package/dist/source/export.d.ts +1 -1
  399. package/dist/source/export.mjs +1 -2
  400. package/dist/source/import.mjs +1 -2
  401. package/dist/source/index.mjs +4 -4
  402. package/dist/source/snapshot.mjs +1 -2
  403. package/dist/state/index.d.ts +0 -1
  404. package/dist/state/index.mjs +1 -3
  405. package/dist/state/paintedState.mjs +10 -11
  406. package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
  407. package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
  408. package/dist/store/actionRuns/index.mjs +3 -3
  409. package/dist/store/actionRuns/useActionRuns.mjs +5 -6
  410. package/dist/store/index.d.ts +1 -0
  411. package/dist/store/index.mjs +2 -1
  412. package/dist/store/renderSettings.d.ts +1 -1
  413. package/dist/store/renderSettings.mjs +1 -2
  414. package/dist/{state → store}/runtimeStatePersist.mjs +29 -30
  415. package/dist/store/storeHooks.d.ts +45 -45
  416. package/dist/store/storeHooks.mjs +1 -2
  417. package/dist/store/tracing/index.mjs +5 -5
  418. package/dist/store/tracing/preview.mjs +1 -2
  419. package/dist/store/tracing/tracingCollector.d.ts +2 -2
  420. package/dist/store/tracing/tracingCollector.mjs +79 -78
  421. package/dist/store/tracing/tracingMiddleware.mjs +1 -2
  422. package/dist/store/tracing/tracingStore.mjs +1 -2
  423. package/dist/store/tracing/useTracing.mjs +6 -7
  424. package/dist/style/breakpoints.mjs +1 -2
  425. package/dist/style/cssLayers.mjs +1 -2
  426. package/dist/style/displayModes.mjs +1 -2
  427. package/dist/style/fontAssets.mjs +1 -2
  428. package/dist/style/fontValidation.mjs +14 -15
  429. package/dist/style/fonts.d.ts +5 -3
  430. package/dist/style/fonts.mjs +23 -24
  431. package/dist/style/fontsFromCss.mjs +1 -2
  432. package/dist/style/index.mjs +18 -18
  433. package/dist/style/keyframes.mjs +1 -2
  434. package/dist/style/layoutGrid.mjs +1 -2
  435. package/dist/style/notifications.mjs +1 -2
  436. package/dist/style/react/useDisplayMode.mjs +1 -2
  437. package/dist/style/react/useElementSize.mjs +1 -2
  438. package/dist/style/runtimeStyle.d.ts +19 -21
  439. package/dist/style/runtimeStyle.mjs +4 -7
  440. package/dist/style/snippetStyle.mjs +5 -6
  441. package/dist/style/styleConditions.mjs +1 -2
  442. package/dist/style/styleConstants.mjs +1 -2
  443. package/dist/style/stylePseudos.mjs +1 -2
  444. package/dist/style/styleStates.mjs +1 -2
  445. package/dist/style/styleTarget.mjs +24 -25
  446. package/dist/theme/cookie/index.mjs +1 -1
  447. package/dist/theme/cookie/themeCookie.d.ts +21 -1
  448. package/dist/theme/cookie/themeCookie.mjs +19 -4
  449. package/dist/theme/index.d.ts +1 -9
  450. package/dist/theme/index.mjs +1 -6
  451. package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
  452. package/dist/theme/react/ThemeProvider.mjs +78 -0
  453. package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
  454. package/dist/theme/react/ThemeScope.mjs +9 -0
  455. package/dist/theme/react/index.d.ts +9 -0
  456. package/dist/theme/react/index.mjs +5 -0
  457. package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
  458. package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
  459. package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
  460. package/dist/theme/react/useTheme.mjs +19 -0
  461. package/dist/types/ActionTypes.d.ts +33 -0
  462. package/dist/types/AuthTypes.d.ts +6 -0
  463. package/dist/types/CommonTypes.d.ts +14 -3
  464. package/dist/types/DataSourceTypes.d.ts +1 -1
  465. package/dist/types/FunctionTypes.d.ts +16 -6
  466. package/dist/types/InteractionTypes.d.ts +1 -1
  467. package/dist/types/JobTypes.d.ts +56 -182
  468. package/dist/types/PluginTypes.d.ts +8 -1
  469. package/dist/types/SchemaTypes.d.ts +1 -1
  470. package/dist/types/SchemaTypes.mjs +1 -2
  471. package/dist/types/ServerAdapterTypes.d.ts +0 -326
  472. package/dist/types/ServerTypes.d.ts +0 -311
  473. package/dist/types/SpaceTypes.d.ts +5 -2
  474. package/dist/types/StoreTypes.d.ts +9 -3
  475. package/dist/types/StyleTypes.d.ts +6 -0
  476. package/dist/types/StyleTypes.mjs +1 -2
  477. package/dist/types/index.d.ts +0 -3
  478. package/dist/websockets/RTCodec.mjs +1 -2
  479. package/eslint.config.mjs +25 -0
  480. package/package.json +29 -18
  481. package/vite.config.ts +58 -0
  482. package/dist/helpers/generateFacade.d.ts +0 -2
  483. package/dist/helpers/ruleEvaluator.d.ts +0 -16
  484. package/dist/helpers/ruleEvaluator.mjs +0 -5
  485. package/dist/network/NetworkInternalContext.mjs +0 -5
  486. package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
  487. package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
  488. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
  489. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
  490. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
  491. package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
  492. package/dist/network/graphql/sdk/index.d.ts +0 -5
  493. package/dist/network/graphql/sdk/index.mjs +0 -3
  494. package/dist/theme/ThemeProvider.mjs +0 -69
  495. package/dist/theme/ThemeScope.mjs +0 -10
  496. package/dist/theme/useTheme.mjs +0 -20
  497. package/dist/types/OAuthTypes.d.ts +0 -246
  498. package/dist/types/ServerConfigTypes.d.ts +0 -527
  499. package/dist/types/ServerLogTypes.d.ts +0 -119
  500. /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
  501. /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
  502. /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
  503. /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
  504. /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
  505. /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- //#region src/style/notifications.ts
1
+ // src/style/notifications.ts
2
2
  var e = ".Toastify__toast-container.plitzi-sdk-toasts", t = [
3
3
  {
4
4
  selector: e,
@@ -88,5 +88,4 @@ var e = ".Toastify__toast-container.plitzi-sdk-toasts", t = [
88
88
  customCss: r.endsWith("\n\n") ? r.slice(0, -2) : r
89
89
  };
90
90
  };
91
- //#endregion
92
91
  export { i as NOTIFICATIONS_FIELDS, o as notificationsCss, a as notificationsProblem, d as splitNotificationsCss, s as withNotificationsCss };
@@ -1,6 +1,6 @@
1
1
  import { displayModeWidthRem as e } from "../breakpoints.mjs";
2
2
  import { useSyncExternalStore as t } from "react";
3
- //#region src/style/react/useDisplayMode.ts
3
+ // src/style/react/useDisplayMode.ts
4
4
  var n = {
5
5
  mobile: `(max-width: ${e("tablet")})`,
6
6
  tablet: `(max-width: ${e("desktop")})`
@@ -14,5 +14,4 @@ var n = {
14
14
  });
15
15
  };
16
16
  }, o = () => "desktop", s = () => t(a, i, o);
17
- //#endregion
18
17
  export { s as default };
@@ -1,5 +1,5 @@
1
1
  import { useEffect as e, useState as t } from "react";
2
- //#region src/style/react/useElementSize.ts
2
+ // src/style/react/useElementSize.ts
3
3
  var n = (n) => {
4
4
  let [r, i] = t(void 0);
5
5
  return e(() => {
@@ -16,5 +16,4 @@ var n = (n) => {
16
16
  return a.observe(e), () => a.disconnect();
17
17
  }, [n]), r;
18
18
  };
19
- //#endregion
20
19
  export { n as default };
@@ -1,29 +1,27 @@
1
1
  /**
2
- * The space's compiled stylesheet (`style.cache`) on a server-rendered page, which carries it once.
2
+ * The space's compiled stylesheet (`style.cache`) on a server-rendered page: linked, not carried.
3
3
  *
4
- * The runtime `<style>` the page renders already holds the cache, verbatim, so sending it again in the hydration payload
5
- * made every page ship its stylesheet twice. Instead the server leaves it out of the payload, and the browser reads it
6
- * back from that `<style>` before hydrating — the same string, so the client renders the same markup and the store
7
- * holds the same cache it always did.
4
+ * It is the whole space's — every page's rules — and on a large one most of the page: the dashboard's 429 KB of a
5
+ * 496 KB document. Inline, every response compressed it again and every page load parsed it again with the HTML; a
6
+ * file of its own is compressed once, kept by the browser for good under its name, and the page carries what is this
7
+ * request's alone — the variables, the custom CSS — beside a `<link>` to it.
8
8
  *
9
- * The cache sits between two comment markers inside the runtime stylesheet: a comment changes nothing about the
10
- * cascade, and the element and its place in the tree stay exactly what they were.
9
+ * It travels as a file only when its text is the same for every visitor of that version of the space: a `{{ token }}`
10
+ * in it is replaced by the variables as THIS request resolves them (its route, its host), so a cache holding one stays
11
+ * inline, as does any page the server could not answer the file for (a draft, a space named by a token).
11
12
  */
12
13
  /** The `data-id` of the stylesheet the SDK renders into the page. */
13
14
  export declare const RUNTIME_STYLE_ID = "plitzi-runtime-style";
14
- /** The cache as the runtime stylesheet embeds it, between the markers `styleCacheFromDocument` reads it by. */
15
- export declare const markStyleCache: (cache: string) => string;
15
+ /** The `id` of the `<link>` a server-rendered page's head loads the stylesheet with. */
16
+ export declare const STYLE_SHEET_ID = "plitzi-style";
17
+ /** Where a space's stylesheet is served from: `/_plitzi/style/<hash>.css`, on the page's own host. */
18
+ export declare const STYLE_SHEET_PATH = "/_plitzi/style/";
19
+ /** The address of the stylesheet named `hash`. */
20
+ export declare const styleSheetHref: (hash: string) => string;
21
+ /** Whether the cache reads the same for every request, and so can be a file of its own. */
22
+ export declare const styleSheetLinkable: (cache: string) => boolean;
16
23
  /**
17
- * Whether the cache reads back from the document byte for byte, so it can be left out of the payload.
18
- *
19
- * - `{{ token }}`: the stylesheet holds the cache with its tokens already replaced, and the browser needs the tokens to
20
- * replace them again when a variable changes.
21
- * - `<`: React escapes a `<style` inside a stylesheet as it renders it, so the text would not come back as it went.
22
- * - `\r` and `\0`: the HTML parser normalises both.
23
- * - The end marker: the cache would end early.
24
- *
25
- * An empty cache has nothing to save.
24
+ * The stylesheet's text: the cache in the runtime layer, with the layers' order said first — the file may be the first
25
+ * thing on the page to name them, and a plugin's stylesheet arriving later would otherwise take a layer above it.
26
26
  */
27
- export declare const styleCacheTravelsInDocument: (cache: string) => boolean;
28
- /** The cache the server left in the runtime stylesheet under `root`, or `undefined` when there is none to read. */
29
- export declare const styleCacheFromDocument: (root: ParentNode) => string | undefined;
27
+ export declare const styleSheetCss: (cache: string) => string;
@@ -1,7 +1,4 @@
1
- //#region src/style/runtimeStyle.ts
2
- var e = "plitzi-runtime-style", t = "/*plitzi:style-cache*/", n = "/*plitzi:style-cache-end*/", r = (e) => `${t}${e}${n}`, i = (e) => e !== "" && !/\{\{|<|\r|\0/.test(e) && !e.includes(n), a = (e) => {
3
- let r = e.querySelector("style[data-id=\"plitzi-runtime-style\"]")?.textContent ?? "", i = r.indexOf(t), a = r.indexOf(n, i);
4
- if (!(i < 0 || a < 0)) return r.slice(i + 22, a);
5
- };
6
- //#endregion
7
- export { e as RUNTIME_STYLE_ID, r as markStyleCache, a as styleCacheFromDocument, i as styleCacheTravelsInDocument };
1
+ import { PLUGIN_CSS_LAYER as e, RUNTIME_CSS_LAYER as t } from "./cssLayers.mjs";
2
+ // src/style/runtimeStyle.ts
3
+ var n = "plitzi-runtime-style", r = "plitzi-style", i = "/_plitzi/style/", a = (e) => `${i}${e}.css`, o = (e) => e !== "" && !e.includes("{{"), s = (n) => `@layer ${e}, ${t};@layer ${t}{${n}}`;
4
+ export { n as RUNTIME_STYLE_ID, r as STYLE_SHEET_ID, i as STYLE_SHEET_PATH, s as styleSheetCss, a as styleSheetHref, o as styleSheetLinkable };
@@ -1,12 +1,12 @@
1
- import { sameValue as e } from "../history/diff.mjs";
1
+ import { isDisplayMode as e } from "./displayModes.mjs";
2
2
  import { StyleVariableCategory as t } from "../types/StyleTypes.mjs";
3
- import { isDisplayMode as n } from "./displayModes.mjs";
4
- //#region src/style/snippetStyle.ts
5
- var r = (...e) => [...new Set(e.flatMap((e) => Object.keys(e).filter(n)))], i = (e) => {
3
+ import { sameValue as n } from "../history/diff.mjs";
4
+ // src/style/snippetStyle.ts
5
+ var r = (...t) => [...new Set(t.flatMap((t) => Object.keys(t).filter(e)))], i = (e) => {
6
6
  if (!e) return;
7
7
  let { cache: t, ...n } = e;
8
8
  return n;
9
- }, a = (e) => new Set(Object.values(e).flatMap((e) => Object.keys(e))), o = (t, n, a) => r(n, a).every((r) => e(i(n[r]?.[t]), i(a[r]?.[t]))), s = (e, n) => {
9
+ }, a = (e) => new Set(Object.values(e).flatMap((e) => Object.keys(e))), o = (e, t, a) => r(t, a).every((r) => n(i(t[r]?.[e]), i(a[r]?.[e]))), s = (e, n) => {
10
10
  let i = { ...e.platform };
11
11
  r(n.platform).forEach((t) => {
12
12
  let r = Object.entries(n.platform[t]).filter(([n]) => !Object.hasOwn(e.platform[t], n));
@@ -28,5 +28,4 @@ var r = (...e) => [...new Set(e.flatMap((e) => Object.keys(e).filter(n)))], i =
28
28
  variables: a
29
29
  };
30
30
  };
31
- //#endregion
32
31
  export { s as mergeSnippetStyle, o as sameSelector, a as selectorsOf };
@@ -1,4 +1,4 @@
1
- //#region src/style/styleConditions.ts
1
+ // src/style/styleConditions.ts
2
2
  var e = {
3
3
  "motion-reduce": "@media (prefers-reduced-motion: reduce)",
4
4
  "motion-safe": "@media (prefers-reduced-motion: no-preference)"
@@ -25,5 +25,4 @@ var e = {
25
25
  let r = /^@container\s+(.*)$/.exec(n);
26
26
  if (r) return c(`container ${r[1]}`);
27
27
  };
28
- //#endregion
29
28
  export { e as MOTION_CONDITIONS, n as STYLE_CONDITION_LABELS, t as STYLE_MOTION_CONDITIONS, c as canonicalCondition, u as conditionAtRule, d as conditionLabel, f as conditionOfAtRule, l as isStyleCondition, s as parseContainerCondition };
@@ -1,4 +1,4 @@
1
- //#region src/style/styleConstants.ts
1
+ // src/style/styleConstants.ts
2
2
  var e = {
3
3
  platform: {
4
4
  desktop: {},
@@ -456,5 +456,4 @@ var e = {
456
456
  [t.STROKE]: "none",
457
457
  [t.STROKE_WIDTH]: "1"
458
458
  };
459
- //#endregion
460
459
  export { e as EMPTY_STYLE_SCHEMA, r as StyleBindingsAllowed, i as baseDefaultValue, t as default, n as inheritableAttributesBase };
@@ -1,4 +1,4 @@
1
- //#region src/style/stylePseudos.ts
1
+ // src/style/stylePseudos.ts
2
2
  var e = [
3
3
  "before",
4
4
  "after",
@@ -102,5 +102,4 @@ var e = [
102
102
  let t = p(e.trim());
103
103
  return t?.length ? t.every((e) => /^(["']).*\1$/s.test(e) || d.has(e.toLowerCase()) || f.test(e) && e.endsWith(")")) : !1;
104
104
  };
105
- //#endregion
106
105
  export { i as CONTENT_PSEUDOS, a as GENERATED_PSEUDOS, l as PSEUDO_PROPERTIES, e as STYLE_PSEUDOS, t as STYLE_PSEUDO_LABELS, m as isContentValue, n as isStylePseudo, u as pseudoHonours, r as pseudoSuffix };
@@ -1,4 +1,4 @@
1
- //#region src/style/styleStates.ts
1
+ // src/style/styleStates.ts
2
2
  var e = [
3
3
  "hover",
4
4
  "focus",
@@ -72,5 +72,4 @@ var e = [
72
72
  odd: ":nth-child(odd)",
73
73
  even: ":nth-child(even)"
74
74
  }, d = (e) => (a(e) ? u[e] : void 0) ?? `:${e}`, f = (e) => e === "hidden", p = ">", m = (e) => e === ">";
75
- //#endregion
76
75
  export { c as CURRENT_SELECTOR, l as EXPANDED_SELECTOR, t as HIDDEN_CLASS, p as PARENT_ANCESTOR, e as STYLE_STATES, n as STYLE_STATE_LABELS, r as STYLE_STATE_MEANINGS, s as inCascadeOrder, a as isKnownState, m as isParentAncestor, f as isStartingState, d as stateSuffix };
@@ -1,36 +1,35 @@
1
- import { isRecord as e } from "../helpers/isRecord.mjs";
1
+ import { canonicalCondition as e } from "./styleConditions.mjs";
2
2
  import { isStylePseudo as t } from "./stylePseudos.mjs";
3
3
  import { isParentAncestor as n } from "./styleStates.mjs";
4
- import { canonicalCondition as r } from "./styleConditions.mjs";
5
- //#region src/style/styleTarget.ts
4
+ import { isRecord as r } from "../helpers/isRecord.mjs";
5
+ // src/style/styleTarget.ts
6
6
  var i = (e) => {
7
7
  let t = [];
8
8
  return e.styleAncestor ? t.push("ancestors", e.styleAncestor) : e.styleCondition && t.push("conditions", e.styleCondition), e.styleVariant && t.push("variants", e.styleVariant), e.stylePseudo && t.push("pseudos", e.stylePseudo), t.push(...e.styleState ? ["states", e.styleState] : ["default"]), t;
9
- }, a = (e) => {
10
- if (e.styleAncestor && e.styleCondition) return "an ancestor condition cannot also be under a condition";
11
- if (e.styleAncestor && e.stylePseudo) return "a pseudo-element has no ancestor conditions of its own";
12
- if (e.styleCondition && e.styleVariant) return "a condition holds the class’s own rules, not its variants’";
13
- if (e.styleCondition && r(e.styleCondition) !== e.styleCondition) return `"${e.styleCondition}" is not a condition`;
14
- if (e.stylePseudo && !t(e.stylePseudo)) return `"${String(e.stylePseudo)}" is not a pseudo-element`;
15
- if (e.styleAncestor && n(e.styleAncestor) && e.styleVariant) return "the element around it is named by its state, never by a variant";
16
- }, o = (t, n) => {
17
- let r = t;
18
- for (let t of n) {
19
- if (!e(r) || !Object.hasOwn(r, t)) return;
20
- r = r[t];
9
+ }, a = (r) => {
10
+ if (r.styleAncestor && r.styleCondition) return "an ancestor condition cannot also be under a condition";
11
+ if (r.styleAncestor && r.stylePseudo) return "a pseudo-element has no ancestor conditions of its own";
12
+ if (r.styleCondition && r.styleVariant) return "a condition holds the class’s own rules, not its variants’";
13
+ if (r.styleCondition && e(r.styleCondition) !== r.styleCondition) return `"${r.styleCondition}" is not a condition`;
14
+ if (r.stylePseudo && !t(r.stylePseudo)) return `"${String(r.stylePseudo)}" is not a pseudo-element`;
15
+ if (r.styleAncestor && n(r.styleAncestor) && r.styleVariant) return "the element around it is named by its state, never by a variant";
16
+ }, o = (e, t) => {
17
+ let n = e;
18
+ for (let e of t) {
19
+ if (!r(n) || !Object.hasOwn(n, e)) return;
20
+ n = n[e];
21
21
  }
22
- return r;
23
- }, s = (t, n, r) => {
24
- let i = t;
25
- n.slice(0, -1).forEach((t) => {
26
- let n = i[t], r = e(n) ? n : {};
27
- i[t] = r, i = r;
22
+ return n;
23
+ }, s = (e, t, n) => {
24
+ let i = e;
25
+ t.slice(0, -1).forEach((e) => {
26
+ let t = i[e], n = r(t) ? t : {};
27
+ i[e] = n, i = n;
28
28
  });
29
- let a = n.at(-1);
30
- a !== void 0 && (i[a] = r);
31
- }, c = (t) => e(t) && Object.values(t).every((e) => typeof e == "string" || typeof e == "number"), l = (e, t) => {
29
+ let a = t.at(-1);
30
+ a !== void 0 && (i[a] = n);
31
+ }, c = (e) => r(e) && Object.values(e).every((e) => typeof e == "string" || typeof e == "number"), l = (e, t) => {
32
32
  let n = o(e, i(t));
33
33
  return c(n) ? n : void 0;
34
34
  };
35
- //#endregion
36
35
  export { c as isStyleRules, s as setAtKeys, i as styleTargetKeys, a as styleTargetProblem, l as styleTargetRules, o as valueAtKeys };
@@ -1 +1 @@
1
- export { THEME_CLASSES, THEME_COOKIE_NAME, applyThemeClass, isTheme, readThemeCookie, themeFromCookies, writeThemeCookie } from "./themeCookie.mjs";
1
+ export { THEME_CLASSES, THEME_COOKIE_NAME, applyThemeClass, isTheme, readSchemeCookie, readThemeCookie, requestScheme, schemeCookieName, schemeFromClientHint, schemeFromCookies, themeFromCookies, writeSchemeCookie, writeThemeCookie } from "./themeCookie.mjs";
@@ -1,4 +1,4 @@
1
- import { Theme } from '../../types';
1
+ import { ColorScheme, Theme } from '../../types';
2
2
  /** The name the choice is kept under, and the one a server reads it back with. */
3
3
  export declare const THEME_COOKIE_NAME = "theme";
4
4
  /** The two a document may WEAR. `system` writes nothing — the absence is what lets the media queries answer. */
@@ -28,3 +28,23 @@ export declare const themeFromCookies: (cookies: string | undefined, name?: stri
28
28
  */
29
29
  export declare const readThemeCookie: (name?: string) => Theme | undefined;
30
30
  export declare const writeThemeCookie: (mode: Theme, name?: string) => void;
31
+ /**
32
+ * The scheme the visitor's machine asks for, kept beside the choice — under the choice's name with `-scheme` — so a
33
+ * server can resolve `system` as the browser will: a picture whose address names the scheme is asked for once, in the
34
+ * right one, rather than the light one swapped for the dark as the page hydrates. Not a choice: a fact about the
35
+ * machine the browser had, written whenever it is learnt and read only for a surface that defers to it.
36
+ */
37
+ export declare const schemeCookieName: (themeCookieName?: string) => string;
38
+ export declare const schemeFromCookies: (cookies: string | undefined, name?: string) => ColorScheme | undefined;
39
+ /**
40
+ * The scheme a Chromium browser says in its `Sec-CH-Prefers-Color-Scheme` client hint, once a page asked for it
41
+ * (`Accept-CH`). A structured-field string: `"dark"`, quoted.
42
+ */
43
+ export declare const schemeFromClientHint: (header: string | undefined) => ColorScheme | undefined;
44
+ export declare const readSchemeCookie: (name?: string) => ColorScheme | undefined;
45
+ export declare const writeSchemeCookie: (scheme: ColorScheme, name?: string) => void;
46
+ /**
47
+ * What a server knows of the visitor's machine: the client hint it said on this request, else the scheme the browser
48
+ * kept from its last visit. `undefined` on a first visit from a browser without the hint.
49
+ */
50
+ export declare const requestScheme: (cookies: string | undefined, hint: string | undefined) => ColorScheme | undefined;
@@ -1,5 +1,5 @@
1
1
  import { cookieFromHeader as e } from "../../helpers/cookies.mjs";
2
- //#region src/theme/cookie/themeCookie.ts
2
+ // src/theme/cookie/themeCookie.ts
3
3
  var t = "theme", n = ["dark", "light"], r = [...n, "system"], i = 31536e3, a = (e) => r.includes(e), o = (e, t) => {
4
4
  for (let r of n) t.classList.toggle(r, e === r);
5
5
  }, s = (n, r = t) => {
@@ -15,6 +15,21 @@ var t = "theme", n = ["dark", "light"], r = [...n, "system"], i = 31536e3, a = (
15
15
  try {
16
16
  document.cookie = `${n}=${encodeURIComponent(e)};path=/;max-age=${i};SameSite=Lax`;
17
17
  } catch {}
18
- };
19
- //#endregion
20
- export { n as THEME_CLASSES, t as THEME_COOKIE_NAME, o as applyThemeClass, a as isTheme, c as readThemeCookie, s as themeFromCookies, l as writeThemeCookie };
18
+ }, u = (e = t) => `${e}-scheme`, d = (e) => e === "light" || e === "dark", f = (t, n = u()) => {
19
+ let r = e(t, n);
20
+ return d(r) ? r : void 0;
21
+ }, p = (e) => {
22
+ let t = e?.trim().replace(/^"|"$/g, "");
23
+ return d(t) ? t : void 0;
24
+ }, m = (e = u()) => {
25
+ try {
26
+ return f(document.cookie, e);
27
+ } catch {
28
+ return;
29
+ }
30
+ }, h = (e, t = u()) => {
31
+ try {
32
+ document.cookie = `${t}=${e};path=/;max-age=${i};SameSite=Lax`;
33
+ } catch {}
34
+ }, g = (e, t) => p(t) ?? f(e);
35
+ export { n as THEME_CLASSES, t as THEME_COOKIE_NAME, o as applyThemeClass, a as isTheme, m as readSchemeCookie, c as readThemeCookie, g as requestScheme, u as schemeCookieName, p as schemeFromClientHint, f as schemeFromCookies, s as themeFromCookies, h as writeSchemeCookie, l as writeThemeCookie };
@@ -1,10 +1,2 @@
1
- import { default as ThemeProvider } from './ThemeProvider';
2
- import { default as useTheme } from './useTheme';
3
- export * from './ThemeProvider';
4
- export * from './ThemeScope';
1
+ /** What a theme is on the wire — its cookie — for a server as for a page. Drawing one is `./react`. */
5
2
  export * from './cookie';
6
- export * from './themeStore';
7
- export * from './useTheme';
8
- export { default as themeStore } from './themeStore';
9
- export { default as ThemeScopeContext } from './ThemeScope';
10
- export { ThemeProvider, useTheme };
@@ -1,6 +1 @@
1
- import { THEME_CLASSES as e, THEME_COOKIE_NAME as t, applyThemeClass as n, isTheme as r, readThemeCookie as i, themeFromCookies as a, writeThemeCookie as o } from "./cookie/themeCookie.mjs";
2
- import s, { createThemeState as c, createThemeStore as l, resolveScheme as u, setAreaTheme as d, setMachineScheme as f, setThemeMode as p, startingThemeState as m, themeFor as h } from "./themeStore.mjs";
3
- import g, { ThemeStartContext as _, useThemeState as v, useThemeStore as y } from "./ThemeScope.mjs";
4
- import b from "./ThemeProvider.mjs";
5
- import x, { SPACE_THEME_AREA as S } from "./useTheme.mjs";
6
- export { S as SPACE_THEME_AREA, e as THEME_CLASSES, t as THEME_COOKIE_NAME, b as ThemeProvider, g as ThemeScopeContext, _ as ThemeStartContext, n as applyThemeClass, c as createThemeState, l as createThemeStore, r as isTheme, i as readThemeCookie, u as resolveScheme, d as setAreaTheme, f as setMachineScheme, p as setThemeMode, m as startingThemeState, h as themeFor, a as themeFromCookies, s as themeStore, x as useTheme, v as useThemeState, y as useThemeStore, o as writeThemeCookie };
1
+ export { THEME_CLASSES, THEME_COOKIE_NAME, applyThemeClass, isTheme, readSchemeCookie, readThemeCookie, requestScheme, schemeCookieName, schemeFromClientHint, schemeFromCookies, themeFromCookies, writeSchemeCookie, writeThemeCookie } from "./cookie/themeCookie.mjs";
@@ -1,4 +1,4 @@
1
- import { Theme } from '../types';
1
+ import { ColorScheme, Theme } from '../../types';
2
2
  import { ReactNode } from 'react';
3
3
  /**
4
4
  * Whose theme this provider is running.
@@ -24,6 +24,12 @@ export type ThemeProviderProps = {
24
24
  */
25
25
  theme?: Theme;
26
26
  scope?: ThemeScope;
27
+ /**
28
+ * The scheme the visitor's machine asks for, as the host already knows it — a server, from the client hint or the
29
+ * cookie this provider keeps it in — so a `system` surface renders resolved as the browser will, from its first
30
+ * render. Left out, `light` until the browser answers.
31
+ */
32
+ scheme?: ColorScheme;
27
33
  /** The cookie the choice lives in. Named per surface where two share an origin — the builder and a space do. */
28
34
  cookieName?: string;
29
35
  children?: ReactNode;
@@ -38,5 +44,5 @@ export type ThemeProviderProps = {
38
44
  * updating the moment the visitor changes their system setting, which is how a panel ends up dark inside a page
39
45
  * that is still light.
40
46
  */
41
- declare const ThemeProvider: ({ defaultTheme, theme, scope, cookieName, children }: ThemeProviderProps) => import('react').JSX.Element;
47
+ declare const ThemeProvider: ({ defaultTheme, theme, scheme, scope, cookieName, children }: ThemeProviderProps) => import('react').JSX.Element;
42
48
  export default ThemeProvider;
@@ -0,0 +1,78 @@
1
+ import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
2
+ import { THEME_COOKIE_NAME as t, applyThemeClass as n, readSchemeCookie as r, readThemeCookie as i, schemeCookieName as a, writeSchemeCookie as o, writeThemeCookie as s } from "../cookie/themeCookie.mjs";
3
+ import c, { ThemeStartContext as l, useThemeState as u } from "./ThemeScope.mjs";
4
+ import d, { createThemeStore as f, resolveScheme as p, setMachineScheme as m, setThemeMode as h } from "./themeStore.mjs";
5
+ import { use as g, useEffect as _, useId as v, useMemo as y, useRef as b, useState as x } from "react";
6
+ import { StoreContext as S, useIsomorphicLayoutEffect as C } from "@plitzi/nexus/react";
7
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
8
+ // src/theme/react/ThemeProvider.tsx
9
+ var E = "(prefers-color-scheme: dark)", D = () => window.matchMedia(E).matches ? "dark" : "light", O = ({ store: t }) => {
10
+ let n = u(t);
11
+ return e([
12
+ "theme.mode",
13
+ "theme.resolved",
14
+ "theme.areas"
15
+ ], [
16
+ n.mode,
17
+ p(n.mode, n.scheme),
18
+ n.areas
19
+ ]), null;
20
+ }, k = ({ defaultTheme: e = "system", theme: u, scheme: p, scope: k = "document", cookieName: A = t, children: j }) => {
21
+ let M = k === "container", N = v(), [P] = x(() => M ? f(`theme${N}`) : void 0), F = P ?? d, I = b({
22
+ mode: e,
23
+ remembered: !1
24
+ });
25
+ C(() => {
26
+ let t = M ? void 0 : i(A), n = u ?? t ?? e;
27
+ I.current = {
28
+ mode: n,
29
+ remembered: t !== void 0
30
+ }, F.batch(() => {
31
+ m(D(), F), h(n, F);
32
+ });
33
+ }, [
34
+ e,
35
+ u,
36
+ A,
37
+ M,
38
+ F
39
+ ]);
40
+ let L = u ?? e, R = y(() => ({
41
+ mode: L,
42
+ ...p ? { scheme: p } : {}
43
+ }), [L, p]), z = g(S) !== void 0;
44
+ _(() => {
45
+ let e = window.matchMedia(E), t = () => {
46
+ let t = e.matches ? "dark" : "light";
47
+ m(t, F), !M && r(a(A)) !== t && o(t, a(A));
48
+ };
49
+ return e.addEventListener("change", t), t(), () => e.removeEventListener("change", t);
50
+ }, [
51
+ F,
52
+ M,
53
+ A
54
+ ]), _(() => {
55
+ if (M) return;
56
+ let e = () => {
57
+ let { mode: e } = F.getState();
58
+ (I.current.remembered || e !== I.current.mode) && (s(e, A), I.current.remembered = !0), n(e, document.documentElement);
59
+ };
60
+ return e(), F.subscribe(e);
61
+ }, [
62
+ A,
63
+ M,
64
+ F
65
+ ]);
66
+ let B = z ? /* @__PURE__ */ w(O, { store: F }) : null;
67
+ return M ? /* @__PURE__ */ w(c, {
68
+ value: P,
69
+ children: /* @__PURE__ */ T(l, {
70
+ value: R,
71
+ children: [B, j]
72
+ })
73
+ }) : /* @__PURE__ */ T(l, {
74
+ value: R,
75
+ children: [B, j]
76
+ });
77
+ };
78
+ export { k as default };
@@ -1,5 +1,5 @@
1
1
  import { ThemeStoreInstance } from './themeStore';
2
- import { Theme, ThemeState } from '../types';
2
+ import { ColorScheme, Theme, ThemeState } from '../../types';
3
3
  /**
4
4
  * Which theme store the tree under here reads.
5
5
  *
@@ -25,7 +25,11 @@ export default ThemeScopeContext;
25
25
  * and `{{ theme.resolved }}` was not: a picture whose address names the scheme was the light one, swapped for the dark
26
26
  * one as the page hydrated.
27
27
  */
28
- export declare const ThemeStartContext: import('react').Context<Theme | undefined>;
28
+ export type ThemeStart = {
29
+ mode: Theme;
30
+ scheme?: ColorScheme;
31
+ };
32
+ export declare const ThemeStartContext: import('react').Context<ThemeStart | undefined>;
29
33
  /**
30
34
  * The theme store's state, as the server rendered it until the surface is live.
31
35
  *
@@ -0,0 +1,9 @@
1
+ import e, { startingThemeState as t } from "./themeStore.mjs";
2
+ import { sharedContext as n } from "../../react/sharedContext.mjs";
3
+ import { use as r, useMemo as i, useSyncExternalStore as a } from "react";
4
+ // src/theme/react/ThemeScope.ts
5
+ var o = n("ThemeScopeContext", void 0), s = () => r(o) ?? e, c = n("ThemeStartContext", void 0), l = (e) => {
6
+ let n = r(c), o = i(() => n === void 0 ? void 0 : t(n.mode, n.scheme), [n]);
7
+ return a(e.subscribe, e.getState, () => o ?? e.getState());
8
+ };
9
+ export { c as ThemeStartContext, o as default, l as useThemeState, s as useThemeStore };
@@ -0,0 +1,9 @@
1
+ import { default as ThemeProvider } from './ThemeProvider';
2
+ import { default as useTheme } from './useTheme';
3
+ export * from './ThemeProvider';
4
+ export * from './ThemeScope';
5
+ export * from './themeStore';
6
+ export * from './useTheme';
7
+ export { default as themeStore } from './themeStore';
8
+ export { default as ThemeScopeContext } from './ThemeScope';
9
+ export { ThemeProvider, useTheme };
@@ -0,0 +1,5 @@
1
+ import e from "./ThemeProvider.mjs";
2
+ import t, { SPACE_THEME_AREA as n } from "./useTheme.mjs";
3
+ import r, { ThemeStartContext as i, useThemeState as a, useThemeStore as o } from "./ThemeScope.mjs";
4
+ import s, { createThemeState as c, createThemeStore as l, resolveScheme as u, setAreaTheme as d, setMachineScheme as f, setThemeMode as p, startingThemeState as m, themeFor as h } from "./themeStore.mjs";
5
+ export { n as SPACE_THEME_AREA, e as ThemeProvider, r as ThemeScopeContext, i as ThemeStartContext, c as createThemeState, l as createThemeStore, u as resolveScheme, d as setAreaTheme, f as setMachineScheme, p as setThemeMode, m as startingThemeState, h as themeFor, s as themeStore, t as useTheme, a as useThemeState, o as useThemeStore };
@@ -1,11 +1,11 @@
1
- import { ColorScheme, Theme, ThemeState } from '../types';
1
+ import { ColorScheme, Theme, ThemeState } from '../../types';
2
2
  export declare const createThemeState: () => ThemeState;
3
3
  /**
4
- * The state a surface starts in, before anything could ask the machine: the mode it opens with, and `light` for what a
5
- * `system` mode resolves to until the browser answers — the one guess a server has to make, and the one the
6
- * stylesheet's media queries correct without a class.
4
+ * The state a surface starts in, before anything could ask the machine: the mode it opens with, and what a `system`
5
+ * mode resolves to until the browser answers — the scheme the host read (a server, from the client hint or the cookie
6
+ * the browser kept it in), or `light`, the one guess left, which the stylesheet's media queries correct without a class.
7
7
  */
8
- export declare const startingThemeState: (mode: Theme) => ThemeState;
8
+ export declare const startingThemeState: (mode: Theme, scheme?: ColorScheme) => ThemeState;
9
9
  /**
10
10
  * The theme, as a store rather than a context.
11
11
  *
@@ -1,12 +1,13 @@
1
1
  import { createStore as e } from "@plitzi/nexus";
2
- //#region src/theme/themeStore.ts
2
+ // src/theme/react/themeStore.ts
3
3
  var t = () => ({
4
4
  mode: "system",
5
5
  scheme: "light",
6
6
  areas: {}
7
- }), n = (e) => ({
7
+ }), n = (e, n) => ({
8
8
  ...t(),
9
- mode: e
9
+ mode: e,
10
+ ...n ? { scheme: n } : {}
10
11
  }), r = (n = "theme") => e(t(), { id: n }), i = r(), a = (e, t) => e === "system" ? t : e, o = (e, t) => (t ? e.areas[t] : void 0) ?? e.mode, s = (e, t = i) => {
11
12
  t.batch(() => {
12
13
  t.setState("mode", e), t.setState("areas", {});
@@ -16,5 +17,4 @@ var t = () => ({
16
17
  }, l = (e, t = i) => {
17
18
  t.setState("scheme", e);
18
19
  };
19
- //#endregion
20
20
  export { t as createThemeState, r as createThemeStore, i as default, a as resolveScheme, c as setAreaTheme, l as setMachineScheme, s as setThemeMode, n as startingThemeState, o as themeFor };
@@ -1,4 +1,4 @@
1
- import { ThemeValue } from '../types';
1
+ import { ThemeValue } from '../../types';
2
2
  /**
3
3
  * The area every surface that paints the SPACE uses — the builder's canvas, and every `BuilderAreaPreview`: the
4
4
  * page thumbnails, a template preview, what the agent renders in the chat.
@@ -0,0 +1,19 @@
1
+ import { useThemeState as e, useThemeStore as t } from "./ThemeScope.mjs";
2
+ import { resolveScheme as n, setAreaTheme as r, setThemeMode as i, themeFor as a } from "./themeStore.mjs";
3
+ import { useCallback as o, useMemo as s } from "react";
4
+ // src/theme/react/useTheme.ts
5
+ var c = "canvas", l = (c) => {
6
+ let l = t(), u = e(l), d = a(u, c), f = n(d, u.scheme), p = o((e) => c ? r(c, e, l) : i(e, l), [c, l]), m = o(() => p(f === "dark" ? "light" : "dark"), [f, p]);
7
+ return s(() => ({
8
+ theme: d,
9
+ resolvedTheme: f,
10
+ setTheme: p,
11
+ toggleTheme: m
12
+ }), [
13
+ d,
14
+ f,
15
+ p,
16
+ m
17
+ ]);
18
+ };
19
+ export { c as SPACE_THEME_AREA, l as default };
@@ -201,6 +201,14 @@ export type ActionLimits = {
201
201
  * response rather than per run, because it exists to stop one answer from being unbounded. 5 000 000 by default.
202
202
  */
203
203
  maxResponseBytes?: number;
204
+ /**
205
+ * Bytes all of one run's outbound responses may carry back together: 10 000 000 by default.
206
+ *
207
+ * `maxResponseBytes` bounds one answer; a flow that reads twenty answers just under it holds twenty of them, and a
208
+ * parsed answer holds several times its size in memory. Counted as the answers stream in, across every request the
209
+ * run makes, and refused the moment they go over — the run fails as `over_capacity`, naming this ceiling.
210
+ */
211
+ maxRunBytes?: number;
204
212
  };
205
213
  /**
206
214
  * A server action: a declarative flow, stored per space, executed by the server.
@@ -308,6 +316,11 @@ export type ActionErrorReason = 'not_found' | 'disabled'
308
316
  | 'duplicate'
309
317
  /** A concurrency or stream cap was reached. */
310
318
  | 'over_capacity'
319
+ /**
320
+ * The space's plan spent this period's allowance of runs (a paywall): refused until the period renews or the plan
321
+ * grows, the refusal naming which. Never retried: it would be refused again.
322
+ */
323
+ | 'quota'
311
324
  /** The run's lineage already names this action: a loop through the outside world. */
312
325
  | 'recursion' | 'timeout' | 'aborted' | 'failed';
313
326
  /**
@@ -385,7 +398,27 @@ export type ActionRunRecord = {
385
398
  trace: InteractionNode[];
386
399
  /** Present when the run ended badly. Already redacted of credential values. */
387
400
  error?: string;
401
+ /** Why, when a ceiling ended it — its deadline, its step or request budget, the process's capacity. A step that threw is
402
+ * `error` with no reason. */
403
+ reason?: ActionErrorReason;
404
+ /**
405
+ * The run ended because its own code refused (`ActionRefusal`, `refuse(…)`): an answer written for whoever asked, not
406
+ * a fault — `error` is that answer.
407
+ */
408
+ refused?: true;
409
+ /**
410
+ * The limit the run was stopped at, when that is what ended it — the run asked for more than it may, which is its own
411
+ * doing and not a fault: what a process's error rate leaves out. See {@link ActionRunLimit}.
412
+ */
413
+ limit?: ActionRunLimit;
388
414
  };
415
+ /**
416
+ * A limit a run can be stopped at: the action's own — its deadline (`time`), its steps, its outbound requests and the
417
+ * bytes they answered (`response`) — those of the space's code it ran, as its runner stops it (`cpu`, `wall`, `memory`,
418
+ * `output`, `calls`: the runner's stop reasons), its account's CPU budget over the minute (`cpuBudget`), and its plan's
419
+ * allowance over the period — runs, a function's compute — spent (`quota`, a paywall).
420
+ */
421
+ export type ActionRunLimit = 'time' | 'steps' | 'requests' | 'response' | 'cpu' | 'wall' | 'memory' | 'output' | 'calls' | 'cpuBudget' | 'quota';
389
422
  /**
390
423
  * One step of a server action run, as a debugger may show it to anybody allowed to debug the page.
391
424
  *