@plitzi/sdk-shared 0.37.2 → 0.37.4

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 (280) hide show
  1. package/CHANGELOG.md +1162 -0
  2. package/dist/actions/access.d.ts +12 -0
  3. package/dist/actions/access.mjs +13 -0
  4. package/dist/actions/functions.d.ts +27 -0
  5. package/dist/actions/functions.mjs +18 -0
  6. package/dist/actions/index.d.ts +4 -0
  7. package/dist/actions/index.mjs +9 -7
  8. package/dist/auth/index.d.ts +2 -1
  9. package/dist/auth/index.mjs +2 -2
  10. package/dist/auth/visitorRoles.d.ts +27 -0
  11. package/dist/auth/visitorRoles.mjs +48 -0
  12. package/dist/authoring/builder.mjs +1 -0
  13. package/dist/authoring/declare.d.ts +53 -0
  14. package/dist/authoring/declare.mjs +2 -2
  15. package/dist/authoring/index.mjs +5 -5
  16. package/dist/authoring/paramSpec.d.ts +1 -1
  17. package/dist/authoring/paramSpec.mjs +1 -0
  18. package/dist/authoring/spaceCallbacks.mjs +2 -2
  19. package/dist/dataSource/computed.d.ts +21 -0
  20. package/dist/dataSource/computed.mjs +45 -0
  21. package/dist/dataSource/getBindingsDetails.mjs +35 -34
  22. package/dist/dataSource/index.d.ts +1 -0
  23. package/dist/dataSource/index.mjs +7 -6
  24. package/dist/dataSource/utility/not.mjs +4 -7
  25. package/dist/dataSource/utility/stringToArray.mjs +1 -1
  26. package/dist/dataSource/utility/truthiness.d.ts +1 -0
  27. package/dist/dataSource/utility/truthiness.mjs +8 -0
  28. package/dist/dataSource/utility/twigTemplate.d.ts +2 -1
  29. package/dist/dataSource/utility/twigTemplate.mjs +29 -17
  30. package/dist/devTools/utils/PlitziConsole.mjs +22 -22
  31. package/dist/helpers/cookies.d.ts +10 -0
  32. package/dist/helpers/cookies.mjs +19 -0
  33. package/dist/helpers/fetchManifest.d.ts +9 -0
  34. package/dist/helpers/fetchManifest.mjs +3 -6
  35. package/dist/helpers/formatDate.d.ts +5 -3
  36. package/dist/helpers/formatDate.mjs +34 -36
  37. package/dist/helpers/index.d.ts +2 -1
  38. package/dist/helpers/index.mjs +17 -14
  39. package/dist/helpers/isDate.d.ts +7 -0
  40. package/dist/helpers/isDate.mjs +15 -0
  41. package/dist/helpers/keys.d.ts +42 -0
  42. package/dist/helpers/keys.mjs +91 -0
  43. package/dist/helpers/twigWrapper/AST.d.ts +2 -2
  44. package/dist/helpers/twigWrapper/Evaluator/Evaluator.d.ts +12 -2
  45. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +57 -34
  46. package/dist/helpers/twigWrapper/Evaluator/index.d.ts +1 -1
  47. package/dist/helpers/twigWrapper/Evaluator/index.mjs +2 -2
  48. package/dist/helpers/twigWrapper/Parser/ExpressionParser.d.ts +2 -2
  49. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +147 -34
  50. package/dist/helpers/twigWrapper/Parser/Parser.d.ts +2 -1
  51. package/dist/helpers/twigWrapper/Parser/Parser.mjs +21 -20
  52. package/dist/helpers/twigWrapper/filters/filters.mjs +130 -112
  53. package/dist/helpers/twigWrapper/index.d.ts +5 -2
  54. package/dist/helpers/twigWrapper/index.mjs +7 -5
  55. package/dist/helpers/twigWrapper/inspectTemplate.d.ts +23 -0
  56. package/dist/helpers/twigWrapper/inspectTemplate.mjs +110 -0
  57. package/dist/helpers/twigWrapper/processTwig/helpers.d.ts +7 -0
  58. package/dist/helpers/twigWrapper/processTwig/helpers.mjs +2 -1
  59. package/dist/helpers/twigWrapper/processTwig/index.d.ts +2 -1
  60. package/dist/helpers/twigWrapper/processTwig/index.mjs +3 -2
  61. package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +28 -0
  62. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +73 -16
  63. package/dist/helpers/twigWrapper/processTwig/resolveStepParam.d.ts +17 -0
  64. package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +14 -0
  65. package/dist/helpers/twigWrapper/templateRoots.d.ts +11 -0
  66. package/dist/helpers/twigWrapper/templateRoots.mjs +4 -4
  67. package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.d.ts +1 -1
  68. package/dist/history/describe.d.ts +29 -0
  69. package/dist/history/describe.mjs +93 -0
  70. package/dist/history/diff.d.ts +33 -0
  71. package/dist/history/diff.mjs +73 -0
  72. package/dist/history/index.d.ts +3 -0
  73. package/dist/history/index.mjs +3 -0
  74. package/dist/history/types.d.ts +48 -0
  75. package/dist/history/types.mjs +0 -0
  76. package/dist/index.d.ts +1 -0
  77. package/dist/index.mjs +76 -67
  78. package/dist/navigation/index.d.ts +1 -1
  79. package/dist/navigation/index.mjs +2 -2
  80. package/dist/navigation/routes.d.ts +11 -1
  81. package/dist/navigation/routes.mjs +15 -10
  82. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +1 -1
  83. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +1 -1
  84. package/dist/network/graphql/builder/Mutations/Segment/SegmentPublishMutation.mjs +1 -1
  85. package/dist/network/graphql/builder/Mutations/Segment/SegmentRemoveMutation.mjs +1 -1
  86. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +1 -1
  87. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +1 -1
  88. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +1 -1
  89. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +1 -1
  90. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +1 -1
  91. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +1 -1
  92. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +1 -1
  93. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +1 -1
  94. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceAddVariableMutation.mjs +1 -1
  95. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceRemoveVariableMutation.mjs +1 -1
  96. package/dist/network/graphql/builder/Mutations/Segment/space/variables/SegmentSpaceUpdateVariableMutation.mjs +1 -1
  97. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableMutation.mjs +1 -1
  98. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableMutation.mjs +1 -1
  99. package/dist/network/graphql/builder/Mutations/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableMutation.mjs +1 -1
  100. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleAddSelectorMutation.mjs +1 -1
  101. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorMutation.mjs +1 -1
  102. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleRemoveSelectorsMutation.mjs +1 -1
  103. package/dist/network/graphql/builder/Mutations/Segment/style/selectors/SegmentStyleUpdateSelectorMutation.mjs +1 -1
  104. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleAddVariableMutation.mjs +1 -1
  105. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleRemoveVariableMutation.mjs +1 -1
  106. package/dist/network/graphql/builder/Mutations/Segment/style/variables/SegmentStyleUpdateVariableMutation.mjs +1 -1
  107. package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -1
  108. package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -1
  109. package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +1 -1
  110. package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -1
  111. package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -1
  112. package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.d.ts +14 -0
  113. package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +16 -0
  114. package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -1
  115. package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -1
  116. package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -1
  117. package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -1
  118. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -1
  119. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -1
  120. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -1
  121. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -1
  122. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.d.ts +4 -0
  123. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +3 -3
  124. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -1
  125. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -1
  126. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -1
  127. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -1
  128. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +2 -1
  129. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -1
  130. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -1
  131. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -1
  132. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -1
  133. package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -1
  134. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -1
  135. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -1
  136. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -1
  137. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -1
  138. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -1
  139. package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -1
  140. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -1
  141. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -1
  142. package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -1
  143. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.d.ts +3 -0
  144. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +9 -0
  145. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.d.ts +11 -0
  146. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +24 -0
  147. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.d.ts +4 -0
  148. package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +15 -0
  149. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -1
  150. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -1
  151. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -1
  152. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -1
  153. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -1
  154. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -1
  155. package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -1
  156. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.d.ts +2 -0
  157. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +9 -0
  158. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.d.ts +2 -0
  159. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +9 -0
  160. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.d.ts +2 -0
  161. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +9 -0
  162. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.d.ts +2 -0
  163. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +9 -0
  164. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.d.ts +2 -0
  165. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +9 -0
  166. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.d.ts +2 -0
  167. package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +9 -0
  168. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -1
  169. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -1
  170. package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -1
  171. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.d.ts +2 -0
  172. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +11 -0
  173. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.d.ts +2 -0
  174. package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +11 -0
  175. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -1
  176. package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -1
  177. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -1
  178. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -1
  179. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -1
  180. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -1
  181. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -1
  182. package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -1
  183. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -1
  184. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -1
  185. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -1
  186. package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -1
  187. package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -1
  188. package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -1
  189. package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -1
  190. package/dist/network/graphql/builder/Mutations/index.d.ts +28 -0
  191. package/dist/network/graphql/builder/Mutations/index.mjs +108 -84
  192. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
  193. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +1 -1
  194. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +1 -1
  195. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -1
  196. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -1
  197. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -1
  198. package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -1
  199. package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.d.ts +23 -0
  200. package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +49 -0
  201. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -1
  202. package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -1
  203. package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -1
  204. package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -1
  205. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +6 -0
  206. package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +13 -0
  207. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.d.ts +17 -0
  208. package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +22 -0
  209. package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -1
  210. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -1
  211. package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -1
  212. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +6 -0
  213. package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +32 -0
  214. package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.d.ts +6 -0
  215. package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +16 -0
  216. package/dist/network/graphql/builder/Queries/index.d.ts +17 -3
  217. package/dist/network/graphql/builder/Queries/index.mjs +30 -22
  218. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -1
  219. package/dist/network/graphql/sdk/Mutations/index.d.ts +1 -1
  220. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +1 -1
  221. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +2 -91
  222. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.d.ts +1 -1
  223. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +2 -44
  224. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.d.ts +1 -1
  225. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +2 -55
  226. package/dist/network/graphql/sdk/Queries/index.d.ts +1 -5
  227. package/dist/network/index.mjs +7 -7
  228. package/dist/network/spaceEvents.d.ts +33 -3
  229. package/dist/network/spaceEvents.mjs +102 -89
  230. package/dist/realtime/client.d.ts +46 -0
  231. package/dist/realtime/client.mjs +192 -0
  232. package/dist/realtime/index.d.ts +6 -0
  233. package/dist/realtime/index.mjs +4 -0
  234. package/dist/realtime/presence.d.ts +38 -0
  235. package/dist/realtime/presence.mjs +70 -0
  236. package/dist/realtime/topics.d.ts +36 -0
  237. package/dist/realtime/topics.mjs +25 -0
  238. package/dist/server/actions/useRealtimeSync.d.ts +9 -0
  239. package/dist/server/actions/useRealtimeSync.mjs +7 -0
  240. package/dist/state/index.d.ts +1 -0
  241. package/dist/state/index.mjs +3 -2
  242. package/dist/state/paintedState.d.ts +52 -0
  243. package/dist/state/paintedState.mjs +37 -0
  244. package/dist/state/runtimeStatePersist.d.ts +8 -1
  245. package/dist/state/runtimeStatePersist.mjs +79 -29
  246. package/dist/store/index.d.ts +45 -45
  247. package/dist/store/renderSettings.d.ts +6 -3
  248. package/dist/store/tracing/index.d.ts +1 -0
  249. package/dist/store/tracing/tracingCollector.d.ts +17 -1
  250. package/dist/store/tracing/tracingCollector.mjs +5 -0
  251. package/dist/style/index.d.ts +1 -0
  252. package/dist/style/index.mjs +3 -2
  253. package/dist/style/runtimeStyle.d.ts +29 -0
  254. package/dist/style/runtimeStyle.mjs +7 -0
  255. package/dist/style/styleConstants.d.ts +3 -2
  256. package/dist/style/styleConstants.mjs +2 -0
  257. package/dist/style/styleStates.d.ts +14 -1
  258. package/dist/style/styleStates.mjs +10 -7
  259. package/dist/theme/ThemeProvider.mjs +35 -29
  260. package/dist/theme/themeCookie.mjs +11 -15
  261. package/dist/types/ActionTypes.d.ts +4 -0
  262. package/dist/types/AuthTypes.d.ts +11 -1
  263. package/dist/types/CommonTypes.d.ts +6 -0
  264. package/dist/types/FunctionTypes.d.ts +52 -0
  265. package/dist/types/FunctionTypes.mjs +0 -0
  266. package/dist/types/PluginTypes.d.ts +0 -1
  267. package/dist/types/RealtimeTypes.d.ts +94 -0
  268. package/dist/types/RealtimeTypes.mjs +0 -0
  269. package/dist/types/SchemaTypes.d.ts +54 -0
  270. package/dist/types/SchemaTypes.mjs +8 -0
  271. package/dist/types/ServerTypes.d.ts +259 -15
  272. package/dist/types/SpaceTypes.d.ts +53 -0
  273. package/dist/types/StateTypes.d.ts +6 -0
  274. package/dist/types/StoreTypes.d.ts +11 -0
  275. package/dist/types/index.d.ts +2 -0
  276. package/dist/types/index.mjs +3 -2
  277. package/package.json +180 -11
  278. package/vite.config.ts +0 -12
  279. package/dist/network/graphql/builder/Queries/PluginsQuery.d.ts +0 -9
  280. package/dist/network/graphql/builder/Queries/PluginsQuery.mjs +0 -54
@@ -1,6 +1,5 @@
1
- import { formatDate as e } from "../../helpers/formatDate.mjs";
2
1
  //#region src/devTools/utils/PlitziConsole.ts
3
- var t = class {
2
+ var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}:${e(t.getMinutes())}:${e(t.getSeconds())}.${e(t.getMilliseconds(), 3)}`, n = () => typeof window < "u", r = class {
4
3
  callbackInternal;
5
4
  callbackAddProvider;
6
5
  callbackRemoveProvider;
@@ -34,30 +33,31 @@ var t = class {
34
33
  flush(e = !1) {
35
34
  this.logsListened = [], e && (this.pendingLogs = []);
36
35
  }
37
- #n(e, t, n, r) {
38
- let i = this.getTime(!0);
36
+ #n(e, t, r, i) {
37
+ if (!this.callbackInternal && !n()) return;
38
+ let a = this.getTime(!0);
39
39
  if (!this.callbackInternal) {
40
40
  this.pendingLogs.push({
41
41
  logType: e,
42
42
  category: t,
43
- message: n,
44
- params: r,
45
- time: i
43
+ message: r,
44
+ params: i,
45
+ time: a
46
46
  }), this.pendingLogs.length > this.pendingLimit && this.pendingLogs.shift();
47
47
  return;
48
48
  }
49
49
  this.listening ? this.logsListened.push({
50
50
  logType: e,
51
51
  category: t,
52
- message: n,
53
- params: r,
54
- time: i
52
+ message: r,
53
+ params: i,
54
+ time: a
55
55
  }) : (this.#e.push({
56
56
  logType: e,
57
57
  category: t,
58
- message: n,
59
- params: r,
60
- time: i
58
+ message: r,
59
+ params: i,
60
+ time: a
61
61
  }), this.#r()), this.logsListened.length > this.logsListenedLimit && this.logsListened.shift();
62
62
  }
63
63
  #r() {
@@ -73,9 +73,9 @@ var t = class {
73
73
  removeProviderMethod(e) {
74
74
  typeof this.callbackRemoveProvider == "function" && this.callbackRemoveProvider(e);
75
75
  }
76
- getTime(t = !1) {
76
+ getTime(e = !1) {
77
77
  let n = /* @__PURE__ */ new Date();
78
- return t ? e(n, "HH:mm:ss.SSS") : n;
78
+ return e ? t(n) : n;
79
79
  }
80
80
  info(e, t, n) {
81
81
  this.#n("info", e, t, n);
@@ -95,16 +95,16 @@ var t = class {
95
95
  end() {
96
96
  this.listening = !1, this.listeningCategory && this.logsListened.length > 0 && this.callbackInternal?.("info", this.listeningCategory, `${this.logsListened.length} Log${this.logsListened.length === 1 ? "" : "s"}`, { logs: this.logsListened }), this.logsListened = [], this.listeningCategory = void 0;
97
97
  }
98
- }, n = new t();
99
- function r(e = "store") {
100
- return ({ path: t, prevValue: r, nextValue: i }) => {
101
- n.info("store", e, {
98
+ }, i = new r();
99
+ function a(e = "store") {
100
+ return ({ path: t, prevValue: n, nextValue: r }) => {
101
+ i.info("store", e, {
102
102
  storeName: e,
103
103
  path: t,
104
- prev: r,
105
- next: i
104
+ prev: n,
105
+ next: r
106
106
  });
107
107
  };
108
108
  }
109
109
  //#endregion
110
- export { r as createStoreDevToolsLogger, t as default, n as pConsole };
110
+ export { a as createStoreDevToolsLogger, r as default, i as pConsole };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * One cookie's value out of a `Cookie` header — or out of `document.cookie`, which is written the same way.
3
+ *
4
+ * One function for both halves of the SDK, because the cookies it reads this way are the ones a server reads to render
5
+ * what the browser is about to hydrate: two parsers are two chances to disagree about a value, and a disagreement there
6
+ * is a page thrown away and drawn again. Undecodable values answer `undefined`, like absent ones.
7
+ */
8
+ export declare const cookieFromHeader: (header: string | undefined, name: string) => string | undefined;
9
+ /** `document.cookie`, or nothing where there is no document or it may not be read (a sandboxed frame throws). */
10
+ export declare const documentCookies: () => string | undefined;
@@ -0,0 +1,19 @@
1
+ //#region src/helpers/cookies.ts
2
+ var e = (e, t) => {
3
+ if (e) for (let n of e.split(";")) {
4
+ let e = n.indexOf("=");
5
+ if (e > -1 && n.slice(0, e).trim() === t) try {
6
+ return decodeURIComponent(n.slice(e + 1).trim());
7
+ } catch {
8
+ return;
9
+ }
10
+ }
11
+ }, t = () => {
12
+ try {
13
+ return typeof document > "u" ? void 0 : document.cookie;
14
+ } catch {
15
+ return;
16
+ }
17
+ };
18
+ //#endregion
19
+ export { e as cookieFromHeader, t as documentCookies };
@@ -1,2 +1,11 @@
1
+ /**
2
+ * A plugin's `plugin-manifest.json`, or `undefined` when it cannot be had.
3
+ *
4
+ * Plugins live on hosts of their own — a CDN, a bucket, the builder's resources — so this is nearly always a
5
+ * cross-origin request, and it is kept a SIMPLE one: `Accept` says what is wanted, where the `Content-Type` this used to
6
+ * send (on a GET, with no body to describe) made the browser ask the host's permission first. A host that allows plain
7
+ * cross-origin reads — the usual CORS setting of a bucket — refused that preflight, and the element rendered "Not
8
+ * Found" with the manifest sitting right there.
9
+ */
1
10
  declare const fetchManifest: <T extends object>(manifestUrl: string) => Promise<T | undefined>;
2
11
  export default fetchManifest;
@@ -1,13 +1,10 @@
1
1
  //#region src/helpers/fetchManifest.ts
2
2
  var e = async (e) => {
3
- let t;
4
3
  try {
5
- return t = await (await fetch(e, {
6
- method: "GET",
7
- headers: { "Content-Type": "application/json" }
8
- })).json(), t;
4
+ let t = await fetch(e, { headers: { Accept: "application/json" } });
5
+ return t.ok ? await t.json() : void 0;
9
6
  } catch {
10
- return t;
7
+ return;
11
8
  }
12
9
  };
13
10
  //#endregion
@@ -25,7 +25,11 @@ export declare const parseDate: (date: string | number | Date) => Date;
25
25
  */
26
26
  export declare function formatDate(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
27
27
  export declare function formatDateUTC(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
28
- /** Formats a UTC timestamp/string to local timezone */
28
+ /**
29
+ * Formats a UTC timestamp/string in the local timezone. A `Date` is an instant and `format` reads its local fields, so
30
+ * there is nothing to convert: moving it first is what printed the repeated hour at the end of daylight saving time an
31
+ * hour off.
32
+ */
29
33
  export declare function formatUTCToLocal(date?: string | number | Date, formatStr?: string, locale?: SupportedLocale): string;
30
34
  /**
31
35
  * Returns the difference between two dates in milliseconds
@@ -52,5 +56,3 @@ export declare function getDurationMs(start: string | number | Date, end: string
52
56
  export declare function formatFromNow(date?: string | number | Date, locale?: SupportedLocale, options?: FormatDistanceToNowOptions): string;
53
57
  export declare function isValidFormat(formatStr: string): boolean;
54
58
  export declare const toUnixSeconds: (input: string | number | Date) => string;
55
- /** Strictly validates whether a string matches a given date-fns format. */
56
- export declare function isDate(value: string, formatStr: string): boolean;
@@ -1,58 +1,56 @@
1
- import { differenceInMilliseconds as e, format as t, formatDistanceToNow as n, getTime as r, isValid as i, parse as a, parseISO as o } from "date-fns";
2
- import { enUS as s, es as c, pt as l } from "date-fns/locale";
3
- import { toZonedTime as u } from "date-fns-tz";
1
+ import { differenceInMilliseconds as e } from "date-fns/differenceInMilliseconds";
2
+ import { format as t } from "date-fns/format";
3
+ import { formatDistanceToNow as n } from "date-fns/formatDistanceToNow";
4
+ import { getTime as r } from "date-fns/getTime";
5
+ import { enUS as i } from "date-fns/locale/en-US";
6
+ import { es as a } from "date-fns/locale/es";
7
+ import { pt as o } from "date-fns/locale/pt";
8
+ import { parseISO as s } from "date-fns/parseISO";
4
9
  //#region src/helpers/formatDate.ts
5
- var d = {
6
- en: s,
7
- es: c,
8
- pt: l
9
- }, f = (e) => {
10
+ var c = {
11
+ en: i,
12
+ es: a,
13
+ pt: o
14
+ }, l = (e) => {
10
15
  let t;
11
- return t = typeof e == "number" ? e < 0xe8d4a51000 ? /* @__PURE__ */ new Date(e * 1e3) : new Date(e) : typeof e == "string" ? o(e) : e, t;
16
+ return t = typeof e == "number" ? e < 0xe8d4a51000 ? /* @__PURE__ */ new Date(e * 1e3) : new Date(e) : typeof e == "string" ? s(e) : e, t;
12
17
  };
13
- function p(e, n = "dd MMMM, yyyy", r = "en") {
18
+ function u(e, n = "dd MMMM, yyyy", r = "en") {
14
19
  if (!e) return "";
15
- let i = f(e);
16
- return t(i, n, { locale: d[r] });
20
+ let i = l(e);
21
+ return t(i, n, { locale: c[r] });
17
22
  }
18
- function m(e, n = "dd MMMM, yyyy", r = "en") {
23
+ var d = (e) => {
24
+ let t = new Date(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.getUTCMilliseconds());
25
+ return t.setFullYear(e.getUTCFullYear()), t;
26
+ };
27
+ function f(e, n = "dd MMMM, yyyy", r = "en") {
19
28
  if (!e) return "";
20
- let i = f(e);
21
- return t(u(i, "UTC"), n, { locale: d[r] });
29
+ let i = l(e);
30
+ return t(d(i), n, { locale: c[r] });
22
31
  }
23
- function h(e, n = "dd MMMM, yyyy HH:mm", r = "en") {
24
- if (!e) return "";
25
- let i = f(e), a = Intl.DateTimeFormat().resolvedOptions().timeZone, o = u(i, a);
26
- return t(o, n, { locale: d[r] });
32
+ function p(e, n = "dd MMMM, yyyy HH:mm", r = "en") {
33
+ return e ? t(l(e), n, { locale: c[r] }) : "";
27
34
  }
28
- function g(t, n) {
29
- let r = f(t), i = f(n);
35
+ function m(t, n) {
36
+ let r = l(t), i = l(n);
30
37
  return e(i, r);
31
38
  }
32
- function _(e, t = "en", r) {
39
+ function h(e, t = "en", r) {
33
40
  if (!e) return "";
34
- let i = f(e);
41
+ let i = l(e);
35
42
  return isNaN(i.getTime()) ? "" : n(i, {
36
43
  ...r,
37
- locale: d[t]
44
+ locale: c[t]
38
45
  });
39
46
  }
40
- function v(e) {
47
+ function g(e) {
41
48
  try {
42
49
  return t(/* @__PURE__ */ new Date(), e), !0;
43
50
  } catch {
44
51
  return !1;
45
52
  }
46
53
  }
47
- var y = (e) => Math.floor(r(f(e)) / 1e3).toString();
48
- function b(e, n) {
49
- if (typeof e != "string") return !1;
50
- try {
51
- let r = a(e, n, /* @__PURE__ */ new Date());
52
- return i(r) ? t(r, n) === e : !1;
53
- } catch {
54
- return !1;
55
- }
56
- }
54
+ var _ = (e) => Math.floor(r(l(e)) / 1e3).toString();
57
55
  //#endregion
58
- export { p as formatDate, m as formatDateUTC, _ as formatFromNow, h as formatUTCToLocal, g as getDurationMs, b as isDate, v as isValidFormat, f as parseDate, y as toUnixSeconds };
56
+ export { u as formatDate, f as formatDateUTC, h as formatFromNow, p as formatUTCToLocal, m as getDurationMs, g as isValidFormat, l as parseDate, _ as toUnixSeconds };
@@ -1,8 +1,10 @@
1
1
  import { default as fetchManifest } from './fetchManifest';
2
2
  import { default as generateFacade } from './generateFacade';
3
3
  import { default as syntaxHighlight } from './syntaxHighlight';
4
+ export * from './cookies';
4
5
  export * from './fetchManifest';
5
6
  export * from './formatDate';
7
+ export * from './isDate';
6
8
  export * from './generateFacade';
7
9
  export * from './reducerOrigin';
8
10
  export * from './ruleEvaluator';
@@ -10,5 +12,4 @@ export * from './syntaxHighlight';
10
12
  export * from './twigWrapper';
11
13
  export * from './utils';
12
14
  export * from './security';
13
- export * from './stripTypename';
14
15
  export { fetchManifest, generateFacade, syntaxHighlight };
@@ -1,15 +1,18 @@
1
1
  import { filters as e } from "./twigWrapper/filters/filters.mjs";
2
- import { processTwig as t } from "./twigWrapper/processTwig/processTwig.mjs";
3
- import { hasTemplateSyntax as n } from "./twigWrapper/tokens/hasTemplateSyntax.mjs";
4
- import { hasValidToken as r } from "./twigWrapper/tokens/hasValidToken.mjs";
5
- import { templateRootNames as i } from "./twigWrapper/templateRoots.mjs";
6
- import a from "./fetchManifest.mjs";
7
- import o from "./generateFacade.mjs";
8
- import s from "./syntaxHighlight.mjs";
9
- import { formatDate as c, formatDateUTC as l, formatFromNow as u, formatUTCToLocal as d, getDurationMs as f, isDate as p, isValidFormat as m, parseDate as h, toUnixSeconds as g } from "./formatDate.mjs";
10
- import { isUserEdit as _ } from "./reducerOrigin.mjs";
11
- import { evaluateRuleGroup as v } from "./ruleEvaluator.mjs";
12
- import { ParamsFromURL as y, delay as b, emptyObject as x, getDisplayName as S, getKeyDecoded as C, getPathsFromObeject as w, hexToRGB as T, isInViewport as E, makeId as D } from "./utils.mjs";
13
- import { disableReactDevTools as O } from "./security.mjs";
14
- import { createStripTypenameLink as k, stripTypenameDeep as A } from "./stripTypename.mjs";
15
- export { y as ParamsFromURL, k as createStripTypenameLink, b as delay, O as disableReactDevTools, x as emptyObject, v as evaluateRuleGroup, a as fetchManifest, e as filters, c as formatDate, l as formatDateUTC, u as formatFromNow, d as formatUTCToLocal, o as generateFacade, S as getDisplayName, f as getDurationMs, C as getKeyDecoded, w as getPathsFromObeject, n as hasTemplateSyntax, r as hasValidToken, T as hexToRGB, p as isDate, E as isInViewport, _ as isUserEdit, m as isValidFormat, D as makeId, h as parseDate, t as processTwig, A as stripTypenameDeep, s as syntaxHighlight, i as templateRootNames, g as toUnixSeconds };
2
+ import { processTwig as t, processTwigParam as n, processTwigValue as r } from "./twigWrapper/processTwig/processTwig.mjs";
3
+ import { hasTemplateSyntax as i } from "./twigWrapper/tokens/hasTemplateSyntax.mjs";
4
+ import { hasValidToken as a } from "./twigWrapper/tokens/hasValidToken.mjs";
5
+ import { MAX_PARAM_PASSES as o, resolveStepParam as s } from "./twigWrapper/processTwig/resolveStepParam.mjs";
6
+ import { inspectTemplate as c } from "./twigWrapper/inspectTemplate.mjs";
7
+ import { templatePaths as l, templateRootNames as u } from "./twigWrapper/templateRoots.mjs";
8
+ import d from "./fetchManifest.mjs";
9
+ import f from "./generateFacade.mjs";
10
+ import p from "./syntaxHighlight.mjs";
11
+ import { cookieFromHeader as m, documentCookies as h } from "./cookies.mjs";
12
+ import { formatDate as g, formatDateUTC as _, formatFromNow as v, formatUTCToLocal as y, getDurationMs as b, isValidFormat as x, parseDate as S, toUnixSeconds as C } from "./formatDate.mjs";
13
+ import { isDate as w } from "./isDate.mjs";
14
+ import { isUserEdit as T } from "./reducerOrigin.mjs";
15
+ import { evaluateRuleGroup as E } from "./ruleEvaluator.mjs";
16
+ import { ParamsFromURL as D, delay as O, emptyObject as k, getDisplayName as A, getKeyDecoded as j, getPathsFromObeject as M, hexToRGB as N, isInViewport as P, makeId as F } from "./utils.mjs";
17
+ import { disableReactDevTools as I } from "./security.mjs";
18
+ export { o as MAX_PARAM_PASSES, D as ParamsFromURL, m as cookieFromHeader, O as delay, I as disableReactDevTools, h as documentCookies, k as emptyObject, E as evaluateRuleGroup, d as fetchManifest, e as filters, g as formatDate, _ as formatDateUTC, v as formatFromNow, y as formatUTCToLocal, f as generateFacade, A as getDisplayName, b as getDurationMs, j as getKeyDecoded, M as getPathsFromObeject, i as hasTemplateSyntax, a as hasValidToken, N as hexToRGB, c as inspectTemplate, w as isDate, P as isInViewport, T as isUserEdit, x as isValidFormat, F as makeId, S as parseDate, t as processTwig, n as processTwigParam, r as processTwigValue, s as resolveStepParam, p as syntaxHighlight, l as templatePaths, u as templateRootNames, C as toUnixSeconds };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A module of its own because `parse` is the heaviest thing in date-fns — it compiles every token parser the format
3
+ * language has, about 100 MB of memory on the way in — and nothing that formats a date should pay for it. Imported from
4
+ * `formatDate`, it was paid by every page server at start, for a function no renderer calls.
5
+ */
6
+ /** Strictly validates whether a string matches a given date-fns format. */
7
+ export declare function isDate(value: string, formatStr: string): boolean;
@@ -0,0 +1,15 @@
1
+ import { format as e } from "date-fns/format";
2
+ import { isValid as t } from "date-fns/isValid";
3
+ import { parse as n } from "date-fns/parse";
4
+ //#region src/helpers/isDate.ts
5
+ function r(r, i) {
6
+ if (typeof r != "string") return !1;
7
+ try {
8
+ let a = n(r, i, /* @__PURE__ */ new Date());
9
+ return t(a) ? e(a, i) === r : !1;
10
+ } catch {
11
+ return !1;
12
+ }
13
+ }
14
+ //#endregion
15
+ export { r as isDate };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Keyboard shortcuts, as a space writes them: `'f'`, `'shift+f'`, `'mod+k'`, `'escape'`, several at once with commas
3
+ * (`'plus, ='`).
4
+ *
5
+ * Both halves of matching live here — reading what an author wrote and reading what a key press was — so they meet
6
+ * in one canonical form: modifiers in a fixed order, then the key, lower case (`ctrl+shift+f`). Authoring reads the
7
+ * first half to refuse a shortcut that could never fire; the element listening reads both.
8
+ */
9
+ /** The trigger a shortcut starts: fired once per key press, with every shortcut it matched. */
10
+ export declare const KEY_TRIGGER = "onKey";
11
+ export type KeyTriggerPayload = {
12
+ /** The key pressed, canonical — `shift+f`. */
13
+ key: string;
14
+ /** Each `keys` param, exactly as written, that the press matched: the flows that run are the ones written so. */
15
+ shortcuts: string[];
16
+ };
17
+ export type ParsedKeys = {
18
+ /** Each shortcut, canonical: `ctrl+alt+shift+meta+key`, with only the modifiers it uses. */
19
+ combos: string[];
20
+ /** Each part that is not a shortcut, with why — empty when all of it is. */
21
+ problems: string[];
22
+ };
23
+ /** Every shortcut in what an author wrote, canonical, and what in it is not one. */
24
+ export declare const parseKeys: (spec: string, isMac?: boolean) => ParsedKeys;
25
+ export type KeyPress = Pick<KeyboardEvent, 'key' | 'code' | 'ctrlKey' | 'altKey' | 'shiftKey' | 'metaKey'>;
26
+ /**
27
+ * A key press, in the form {@link parseKeys} writes.
28
+ *
29
+ * Two keyboard facts decide it. Shift is part of a LETTER's shortcut (`shift+f`), but a symbol is typed with whatever
30
+ * it takes — `+` is Shift+= on one keyboard and a key of its own on another — so for a symbol Shift is not counted.
31
+ * And with Alt, Ctrl or ⌘ held, `key` can be another character altogether (Option+F is `ƒ` on a Mac): the physical
32
+ * letter or digit is read from `code` instead.
33
+ */
34
+ export declare const keyPressCombo: (press: KeyPress) => string;
35
+ /**
36
+ * Whether a press, made in a text field, is the field's own editing — so a shortcut must not take it.
37
+ *
38
+ * With ⌘, Ctrl or Alt held a press in a field is otherwise a shortcut's, which is what lets `mod+k` open a palette
39
+ * from a search box. But `mod+a` in a title field is "select this text", not "select everything on the board", and
40
+ * `alt+backspace` deletes a word: a shortcut that took those would break typing wherever the page has one.
41
+ */
42
+ export declare const isFieldEditing: (combo: string) => boolean;
@@ -0,0 +1,91 @@
1
+ //#region src/helpers/keys.ts
2
+ var e = "onKey", t = [
3
+ "ctrl",
4
+ "alt",
5
+ "shift",
6
+ "meta"
7
+ ], n = {
8
+ ctrl: "ctrl",
9
+ control: "ctrl",
10
+ alt: "alt",
11
+ option: "alt",
12
+ shift: "shift",
13
+ meta: "meta",
14
+ cmd: "meta",
15
+ command: "meta",
16
+ mod: "mod"
17
+ }, r = {
18
+ esc: "escape",
19
+ space: "space",
20
+ spacebar: "space",
21
+ plus: "+",
22
+ minus: "-",
23
+ up: "arrowup",
24
+ down: "arrowdown",
25
+ left: "arrowleft",
26
+ right: "arrowright",
27
+ del: "delete",
28
+ return: "enter"
29
+ }, i = /* @__PURE__ */ new Set([
30
+ "escape",
31
+ "enter",
32
+ "tab",
33
+ "space",
34
+ "backspace",
35
+ "delete",
36
+ "insert",
37
+ "arrowup",
38
+ "arrowdown",
39
+ "arrowleft",
40
+ "arrowright",
41
+ "home",
42
+ "end",
43
+ "pageup",
44
+ "pagedown",
45
+ ...Array.from({ length: 12 }, (e, t) => `f${t + 1}`)
46
+ ]), a = (e, n) => [...t.filter((t) => e.has(t)), n].join("+"), o = (e, t) => {
47
+ let o = e.trim().toLowerCase();
48
+ if (!o) return { problem: "an empty shortcut (two commas in a row, or one at the end)" };
49
+ let s = o.endsWith("++") ? [...o.slice(0, -2).split("+"), "+"] : o.split("+"), c = o === "+" ? ["+"] : s.filter((e) => e !== ""), l = /* @__PURE__ */ new Set(), u = [];
50
+ for (let e of c) {
51
+ if (Object.hasOwn(n, e)) {
52
+ let r = n[e];
53
+ l.add(r === "mod" ? t ? "meta" : "ctrl" : r);
54
+ continue;
55
+ }
56
+ u.push(Object.hasOwn(r, e) ? r[e] : e);
57
+ }
58
+ if (u.length !== 1) return { problem: `"${e.trim()}" names ${u.length ? `${u.length} keys (${u.join(", ")})` : "no key, only modifiers"}: a shortcut is modifiers and ONE key, like "shift+f"` };
59
+ let [d] = u;
60
+ return d.length !== 1 && !i.has(d) ? { problem: `"${d}" in "${e.trim()}" is not a key: use one character ("f", "?", "+") or a key's name (${[...i].slice(0, 15).join(", ")}, f1…f12)` } : { combo: a(l, d) };
61
+ }, s = (e, t = !1) => {
62
+ let n = e.split(",").map((e) => o(e, t));
63
+ return {
64
+ combos: n.flatMap((e) => e.combo ? [e.combo] : []),
65
+ problems: n.flatMap((e) => e.problem ? [e.problem] : [])
66
+ };
67
+ }, c = (e) => {
68
+ let t = e.ctrlKey || e.altKey || e.metaKey, n = /^(?:Key|Digit)([A-Z0-9])$/.exec(e.code), r = t && n ? n[1] : e.key, i = r === " " ? "space" : r.toLowerCase(), o = i.length === 1 && !/[a-z0-9]/.test(i), s = /* @__PURE__ */ new Set();
69
+ return e.ctrlKey && s.add("ctrl"), e.altKey && s.add("alt"), e.shiftKey && !o && s.add("shift"), e.metaKey && s.add("meta"), a(s, i);
70
+ }, l = /* @__PURE__ */ new Set([
71
+ "a",
72
+ "z",
73
+ "y",
74
+ "c",
75
+ "x",
76
+ "v"
77
+ ]), u = /* @__PURE__ */ new Set([
78
+ "arrowleft",
79
+ "arrowright",
80
+ "arrowup",
81
+ "arrowdown",
82
+ "home",
83
+ "end",
84
+ "backspace",
85
+ "delete"
86
+ ]), d = (e) => {
87
+ let t = e.split("+"), n = e.endsWith("++") ? "+" : t[t.length - 1];
88
+ return u.has(n) || l.has(n) && (e.includes("ctrl+") || e.includes("meta+"));
89
+ };
90
+ //#endregion
91
+ export { e as KEY_TRIGGER, d as isFieldEditing, c as keyPressCombo, s as parseKeys };
@@ -47,7 +47,7 @@ export type ContinueNode = {
47
47
  export type Expression = LiteralNode | ArrayLiteralNode | ObjectLiteralNode | RangeNode | PathNode | IndexNode | FunctionNode | FilterExpression | ConcatNode | UnaryNode | BinaryNode | DefaultNode | TernaryNode | ArrowFunctionNode;
48
48
  export type LiteralNode = {
49
49
  readonly type: 'literal';
50
- readonly value: string | number | boolean;
50
+ readonly value: string | number | boolean | null;
51
51
  };
52
52
  export type ArrayLiteralNode = {
53
53
  readonly type: 'array';
@@ -117,7 +117,7 @@ export type DefaultNode = {
117
117
  export type TernaryNode = {
118
118
  readonly type: 'ternary';
119
119
  readonly condition: Expression;
120
- readonly trueExpr: Expression;
120
+ readonly trueExpr: Expression | null;
121
121
  readonly falseExpr: Expression;
122
122
  };
123
123
  export type ArrowFunctionNode = {
@@ -1,7 +1,17 @@
1
- import { ASTNode } from '../AST';
1
+ import { ASTNode, Expression } from '../AST';
2
2
  export type EvalResult = {
3
3
  readonly output: string;
4
4
  readonly variables: Record<string, unknown>;
5
5
  readonly hasSet: boolean;
6
6
  };
7
- export declare const evaluate: (nodes: readonly ASTNode[], context: Record<string, unknown>, keepEmptyTokens?: boolean) => EvalResult;
7
+ /**
8
+ * Renders `nodes` against `context`.
9
+ *
10
+ * `jsonStrings` is for a template the author wrote as a JSON document — `{ "city": "{{ values.city }}" }`: a value
11
+ * printed inside one of its string literals is escaped for it, so a city typed with a quote or on two lines is still
12
+ * that document, not text the reader has to give up on. A value printed anywhere else is printed as always: it IS the
13
+ * JSON value there (`"seen": {{ count }}`).
14
+ */
15
+ export declare const evaluate: (nodes: readonly ASTNode[], context: Record<string, unknown>, keepEmptyTokens?: boolean, jsonStrings?: boolean) => EvalResult;
16
+ /** One expression's value, as it is — not rendered to text. What `processTwigValue` answers a `{{ expr }}` with. */
17
+ export declare const evaluateExpression: (expression: Expression, context: Record<string, unknown>) => unknown;