@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,13 +1,13 @@
1
1
  //#region src/helpers/twigWrapper/filters/filters.ts
2
- var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t) => e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t)), r = (e) => e == null ? "" : String(e), i = (e) => {
2
+ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t) => e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t)), r = (e) => e === void 0 || typeof e == "function" || typeof e == "symbol" ? "null" : typeof e == "bigint" ? e.toString() : JSON.stringify(e), i = (e) => e == null ? "" : String(e), a = (e) => {
3
3
  let t = new TextEncoder().encode(e), n = "";
4
4
  for (let e = 0; e < t.length; e++) n += String.fromCharCode(t[e]);
5
5
  return btoa(n);
6
- }, a = (e) => {
6
+ }, o = (e) => {
7
7
  let t = atob(e), n = new Uint8Array(t.length);
8
8
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
9
9
  return new TextDecoder().decode(n);
10
- }, o = (e) => {
10
+ }, s = (e) => {
11
11
  let t = [
12
12
  7,
13
13
  12,
@@ -96,10 +96,10 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
96
96
  return t;
97
97
  };
98
98
  return p(c) + p(l) + p(u) + p(d);
99
- }, s = "__PLITZI_RAW__", c = (e) => typeof e == "object" && !!e && e.__marker === "__PLITZI_RAW__", l = (e) => ({
99
+ }, c = "__PLITZI_RAW__", l = (e) => typeof e == "object" && !!e && e.__marker === "__PLITZI_RAW__", u = (e) => ({
100
100
  __raw: e,
101
- __marker: s
102
- }), u = (e) => c(e) ? e.__raw : e, d = [
101
+ __marker: c
102
+ }), d = (e) => l(e) ? e.__raw : e, f = [
103
103
  "Sun",
104
104
  "Mon",
105
105
  "Tue",
@@ -107,9 +107,9 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
107
107
  "Thu",
108
108
  "Fri",
109
109
  "Sat"
110
- ], f = /* @__PURE__ */ new Map(), p = (e) => {
111
- if (!f.has(e)) try {
112
- f.set(e, new Intl.DateTimeFormat("en-US", {
110
+ ], p = /* @__PURE__ */ new Map(), m = (e) => {
111
+ if (!p.has(e)) try {
112
+ p.set(e, new Intl.DateTimeFormat("en-US", {
113
113
  timeZone: e,
114
114
  hourCycle: "h23",
115
115
  year: "numeric",
@@ -121,15 +121,15 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
121
121
  weekday: "short"
122
122
  }));
123
123
  } catch {
124
- f.set(e, null);
124
+ p.set(e, null);
125
125
  }
126
- return f.get(e) ?? null;
127
- }, m = (e) => {
126
+ return p.get(e) ?? null;
127
+ }, h = (e) => {
128
128
  if (e instanceof Date) return e;
129
129
  if (typeof e == "number") return new Date(e);
130
130
  let t = String(e).trim();
131
131
  return /^-?\d+$/.test(t) ? new Date(Number(t)) : new Date(t);
132
- }, h = (e, t) => {
132
+ }, g = (e, t) => {
133
133
  if (!t) return {
134
134
  year: e.getFullYear(),
135
135
  month: e.getMonth() + 1,
@@ -139,7 +139,7 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
139
139
  seconds: e.getSeconds(),
140
140
  weekday: e.getDay()
141
141
  };
142
- let n = p(t);
142
+ let n = m(t);
143
143
  if (!n) return;
144
144
  let r = n.formatToParts(e), i = (e) => r.find((t) => t.type === e)?.value ?? "";
145
145
  return {
@@ -149,12 +149,12 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
149
149
  hours: Number(i("hour")),
150
150
  minutes: Number(i("minute")),
151
151
  seconds: Number(i("second")),
152
- weekday: d.indexOf(i("weekday"))
152
+ weekday: f.indexOf(i("weekday"))
153
153
  };
154
- }, g = {
155
- raw: (e) => l(e),
156
- to_json: (e) => typeof e == "object" && e ? JSON.stringify(e) : r(e),
157
- json_encode: (e) => typeof e == "object" && e ? JSON.stringify(e) : r(e),
154
+ }, _ = {
155
+ raw: (e) => u(e),
156
+ to_json: (e) => r(e),
157
+ json_encode: (e) => r(e),
158
158
  object_as_json: (e) => typeof e == "object" && e ? JSON.stringify(e) : e,
159
159
  default: (e, n) => t(e) ? n[0] : e,
160
160
  upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
@@ -169,21 +169,21 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
169
169
  rtrim: (e) => typeof e == "string" ? e.trimEnd() : e,
170
170
  pad: (e, t) => {
171
171
  if (typeof e != "string") return e;
172
- let n = Number(t[0]) || 0, i = t.length > 1 ? r(t[1]) : " ";
173
- if (i === "") return e;
172
+ let n = Number(t[0]) || 0, r = t.length > 1 ? i(t[1]) : " ";
173
+ if (r === "") return e;
174
174
  let a = n - e.length;
175
175
  if (a <= 0) return e;
176
- let o = Math.ceil(a / i.length);
177
- return i.repeat(o).slice(0, a) + e;
176
+ let o = Math.ceil(a / r.length);
177
+ return r.repeat(o).slice(0, a) + e;
178
178
  },
179
179
  padRight: (e, t) => {
180
180
  if (typeof e != "string") return e;
181
- let n = Number(t[0]) || 0, i = t.length > 1 ? r(t[1]) : " ";
182
- if (i === "") return e;
181
+ let n = Number(t[0]) || 0, r = t.length > 1 ? i(t[1]) : " ";
182
+ if (r === "") return e;
183
183
  let a = n - e.length;
184
184
  if (a <= 0) return e;
185
- let o = Math.ceil(a / i.length);
186
- return e + i.repeat(o).slice(0, a);
185
+ let o = Math.ceil(a / r.length);
186
+ return e + r.repeat(o).slice(0, a);
187
187
  },
188
188
  number: (e, t) => {
189
189
  if (typeof e == "number") {
@@ -194,31 +194,31 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
194
194
  let n = e.match(/-?\d+(?:\.\d+)?/);
195
195
  return n ? Number(n[0]) : 0;
196
196
  },
197
- replace: (e, t) => typeof e != "string" || t.length === 0 ? e : e.split(r(t[0])).join(r(t[1])),
197
+ replace: (e, t) => typeof e != "string" || t.length === 0 ? e : e.split(i(t[0])).join(i(t[1])),
198
198
  slice: (e, t) => {
199
199
  if (t.length === 0) return e;
200
200
  let n = Number(t[0]) || 0, r = t.length > 1 && Number.isFinite(Number(t[1])) ? n + Number(t[1]) : void 0;
201
201
  return typeof e == "string" || Array.isArray(e) ? e.slice(n, r) : e;
202
202
  },
203
- split: (e, t) => typeof e == "string" && t.length > 0 ? e.split(r(t[0])) : e,
204
- join: (e, t) => Array.isArray(e) ? e.join(t.length === 0 ? "" : r(t[0])) : e,
203
+ split: (e, t) => typeof e == "string" && t.length > 0 ? e.split(i(t[0])) : e,
204
+ join: (e, t) => Array.isArray(e) ? e.join(t.length === 0 ? "" : i(t[0])) : e,
205
205
  reverse: (e) => typeof e == "string" ? e.split("").reverse().join("") : Array.isArray(e) ? [...e].reverse() : e,
206
- length: (e) => typeof e == "string" || Array.isArray(e) ? e.length : typeof e == "number" ? r(e).length : typeof e == "object" && e ? Object.keys(e).length : 0,
206
+ length: (e) => typeof e == "string" || Array.isArray(e) ? e.length : typeof e == "number" ? i(e).length : typeof e == "object" && e ? Object.keys(e).length : 0,
207
207
  first: (e) => typeof e == "string" ? e.length > 0 ? e[0] : "" : Array.isArray(e) ? e.length > 0 ? e[0] : void 0 : e,
208
208
  last: (e) => typeof e == "string" ? e.length > 0 ? e[e.length - 1] : "" : Array.isArray(e) ? e.length > 0 ? e[e.length - 1] : void 0 : e,
209
209
  contains: (e, t) => {
210
210
  if (t.length === 0) return !1;
211
211
  let n = t[0];
212
- return typeof e == "string" ? e.includes(r(n)) : Array.isArray(e) ? e.includes(n) : !1;
212
+ return typeof e == "string" ? e.includes(i(n)) : Array.isArray(e) ? e.includes(n) : !1;
213
213
  },
214
- startswith: (e, t) => typeof e == "string" && t.length > 0 && e.startsWith(r(t[0])),
215
- endswith: (e, t) => typeof e == "string" && t.length > 0 && e.endsWith(r(t[0])),
214
+ startswith: (e, t) => typeof e == "string" && t.length > 0 && e.startsWith(i(t[0])),
215
+ endswith: (e, t) => typeof e == "string" && t.length > 0 && e.endsWith(i(t[0])),
216
216
  number_format: (e, t) => {
217
217
  if (typeof e != "number") return e;
218
- let n = Number(t[0]) || 0, i = t[1] == null ? "." : r(t[1]), a = t[2] == null ? "" : r(t[2]), o = e.toFixed(n);
219
- if (a === "") return o.replace(".", i);
218
+ let n = Number(t[0]) || 0, r = t[1] == null ? "." : i(t[1]), a = t[2] == null ? "" : i(t[2]), o = e.toFixed(n);
219
+ if (a === "") return o.replace(".", r);
220
220
  let s = o.split(".");
221
- return s[0] = s[0].replace(/\B(?=(\d{3})+(?!\d))/g, a), s.join(i);
221
+ return s[0] = s[0].replace(/\B(?=(\d{3})+(?!\d))/g, a), s.join(r);
222
222
  },
223
223
  sort: (t, r) => {
224
224
  if (!Array.isArray(t)) return t;
@@ -265,10 +265,10 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
265
265
  if (t.length === 0) return e.filter(Boolean);
266
266
  let n = t[0];
267
267
  if (typeof n == "function") return e.filter((e, t) => n(e, t));
268
- let i = r(n);
268
+ let r = i(n);
269
269
  return e.filter((e) => {
270
270
  if (typeof e == "object" && e) {
271
- let t = e[i];
271
+ let t = e[r];
272
272
  return t != null && t !== !1 && t !== "";
273
273
  }
274
274
  return !!e;
@@ -276,14 +276,14 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
276
276
  },
277
277
  column: (e, t) => {
278
278
  if (!Array.isArray(e) || t.length === 0) return e;
279
- let n = r(t[0]);
279
+ let n = i(t[0]);
280
280
  return e.map((e) => typeof e == "object" && e ? e[n] : void 0);
281
281
  },
282
- url_encode: (e) => typeof e == "string" ? encodeURIComponent(e) : typeof e == "object" && e && !Array.isArray(e) ? new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e, t]) => [e, r(t)]))).toString() : e,
282
+ url_encode: (e) => typeof e == "string" ? encodeURIComponent(e) : typeof e == "object" && e && !Array.isArray(e) ? new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e, t]) => [e, i(t)]))).toString() : e,
283
283
  nl2br: (e) => typeof e == "string" ? e.replace(/\n/g, "<br>") : e,
284
284
  striptags: (e, t) => {
285
285
  if (typeof e != "string") return e;
286
- let n = t.length > 0 ? r(t[0]).trim() : "";
286
+ let n = t.length > 0 ? i(t[0]).trim() : "";
287
287
  if (n) {
288
288
  let t = n.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map((e) => e.replace(/[/>]/g, "").trim());
289
289
  if (t.length > 0) {
@@ -296,106 +296,124 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
296
296
  abs: (e) => typeof e == "number" ? Math.abs(e) : e,
297
297
  round: (e, t) => {
298
298
  if (typeof e != "number") return e;
299
- let n = Number(t[0]) || 0, i = t[1] == null ? "common" : r(t[1]), a = 10 ** n;
300
- return i === "ceil" ? Math.ceil(e * a) / a : i === "floor" ? Math.floor(e * a) / a : Math.round(e * a) / a;
299
+ let n = Number(t[0]) || 0, r = t[1] == null ? "common" : i(t[1]), a = 10 ** n;
300
+ return r === "ceil" ? Math.ceil(e * a) / a : r === "floor" ? Math.floor(e * a) / a : Math.round(e * a) / a;
301
301
  },
302
302
  format: (e, t) => {
303
303
  if (typeof e != "string") return e;
304
304
  let n = 0;
305
- return e.replace(/%s|%d|%f|%%/g, (e) => {
306
- if (e === "%%") return "%";
307
- let i = t[n];
308
- return n++, i === void 0 ? e : e === "%d" ? String(Math.floor(Number(i))) : e === "%f" ? String(Number(i)) : r(i);
305
+ return e.replace(/%((?:[-+ 0]|'.)*)(\d*)(?:\.(\d+))?([sdf%])/g, (e, r, a, o, s) => {
306
+ if (s === "%") return "%";
307
+ let c = t[n];
308
+ if (n++, c === void 0) return e;
309
+ let l = r.includes("+"), u;
310
+ if (s === "d") {
311
+ let e = Math.trunc(Number(c));
312
+ u = `${l && e >= 0 ? "+" : ""}${e}`;
313
+ } else if (s === "f") {
314
+ let e = Number(c);
315
+ u = `${l && e >= 0 ? "+" : ""}${o === void 0 ? String(e) : e.toFixed(Number(o))}`;
316
+ } else u = i(c), u = o === void 0 ? u : u.slice(0, Number(o));
317
+ let d = Number(a || 0);
318
+ if (u.length >= d) return u;
319
+ let f = /'(.)/.exec(r), p = f ? f[1] : r.includes("0") ? "0" : " ";
320
+ return r.includes("-") ? u.padEnd(d, p === "0" ? " " : p) : p === "0" && s !== "s" && /^[+-]/.test(u) ? u[0] + u.slice(1).padStart(d - 1, "0") : u.padStart(d, p);
309
321
  });
310
322
  },
311
323
  spaceless: (e) => typeof e == "string" ? e.replace(/>\s+</g, "><").trim() : e,
312
324
  random: (e) => Array.isArray(e) ? e.length > 0 ? e[Math.floor(Math.random() * e.length)] : void 0 : typeof e == "string" ? e.length > 0 ? e[Math.floor(Math.random() * e.length)] : "" : typeof e == "number" ? Math.floor(Math.random() * e) : e,
313
325
  date: (e, t) => {
314
326
  if (t.length === 0) return e;
315
- let n = r(t[0]), i = m(e);
316
- if (Number.isNaN(i.getTime())) return "";
317
- let a = h(i, t.length > 1 ? r(t[1]) : "");
327
+ let n = i(t[0]), r = h(e);
328
+ if (Number.isNaN(r.getTime())) return "";
329
+ let a = g(r, t.length > 1 ? i(t[1]) : "");
318
330
  if (!a) return "";
319
- let o = (e) => String(e).padStart(2, "0"), s = {
331
+ let o = (e) => String(e).padStart(2, "0"), s = [
332
+ "January",
333
+ "February",
334
+ "March",
335
+ "April",
336
+ "May",
337
+ "June",
338
+ "July",
339
+ "August",
340
+ "September",
341
+ "October",
342
+ "November",
343
+ "December"
344
+ ], c = [
345
+ "Jan",
346
+ "Feb",
347
+ "Mar",
348
+ "Apr",
349
+ "May",
350
+ "Jun",
351
+ "Jul",
352
+ "Aug",
353
+ "Sep",
354
+ "Oct",
355
+ "Nov",
356
+ "Dec"
357
+ ], l = [
358
+ "Sunday",
359
+ "Monday",
360
+ "Tuesday",
361
+ "Wednesday",
362
+ "Thursday",
363
+ "Friday",
364
+ "Saturday"
365
+ ], u = {
320
366
  Y: String(a.year),
367
+ y: o(a.year % 100),
321
368
  m: o(a.month),
322
369
  n: String(a.month),
323
370
  d: o(a.day),
324
371
  j: String(a.day),
325
372
  H: o(a.hours),
326
373
  G: String(a.hours),
374
+ h: o(a.hours % 12 || 12),
375
+ g: String(a.hours % 12 || 12),
376
+ A: a.hours < 12 ? "AM" : "PM",
377
+ a: a.hours < 12 ? "am" : "pm",
327
378
  i: o(a.minutes),
328
379
  s: o(a.seconds),
329
380
  w: String(a.weekday),
330
381
  N: String(a.weekday === 0 ? 7 : a.weekday),
331
- U: String(Math.floor(i.getTime() / 1e3)),
332
- l: [
333
- "Sunday",
334
- "Monday",
335
- "Tuesday",
336
- "Wednesday",
337
- "Thursday",
338
- "Friday",
339
- "Saturday"
340
- ][a.weekday],
341
- F: [
342
- "January",
343
- "February",
344
- "March",
345
- "April",
346
- "May",
347
- "June",
348
- "July",
349
- "August",
350
- "September",
351
- "October",
352
- "November",
353
- "December"
354
- ][a.month - 1],
355
- M: [
356
- "Jan",
357
- "Feb",
358
- "Mar",
359
- "Apr",
360
- "May",
361
- "Jun",
362
- "Jul",
363
- "Aug",
364
- "Sep",
365
- "Oct",
366
- "Nov",
367
- "Dec"
368
- ][a.month - 1]
369
- }, c = "";
370
- for (let e of n) c += Object.prototype.hasOwnProperty.call(s, e) ? s[e] : e;
371
- return c;
382
+ U: String(Math.floor(r.getTime() / 1e3)),
383
+ l: l[a.weekday],
384
+ D: l[a.weekday].slice(0, 3),
385
+ F: s[a.month - 1],
386
+ M: c[a.month - 1]
387
+ }, d = "", f = !1;
388
+ for (let e of n) f ? (d += e, f = !1) : e === "\\" ? f = !0 : d += Object.prototype.hasOwnProperty.call(u, e) ? u[e] : e;
389
+ return d;
372
390
  },
373
- base64_encode: (e) => typeof e == "string" ? i(e) : e,
374
- base64_decode: (e) => typeof e == "string" ? a(e) : e,
375
- md5: (e) => typeof e == "string" ? o(e) : e,
391
+ base64_encode: (e) => typeof e == "string" ? a(e) : e,
392
+ base64_decode: (e) => typeof e == "string" ? o(e) : e,
393
+ md5: (e) => typeof e == "string" ? s(e) : e,
376
394
  without: (e, t) => {
377
395
  if (typeof e != "object" || !e || Array.isArray(e)) return e;
378
- let n = t.map(r), i = {};
379
- for (let [t, r] of Object.entries(e)) n.includes(t) || (i[t] = r);
380
- return i;
396
+ let n = t.map(i), r = {};
397
+ for (let [t, i] of Object.entries(e)) n.includes(t) || (r[t] = i);
398
+ return r;
381
399
  },
382
400
  only: (e, t) => {
383
401
  if (typeof e != "object" || !e || Array.isArray(e)) return e;
384
- let n = t.map(r), i = {};
385
- for (let [t, r] of Object.entries(e)) n.includes(t) && (i[t] = r);
386
- return i;
402
+ let n = t.map(i), r = {};
403
+ for (let [t, i] of Object.entries(e)) n.includes(t) && (r[t] = i);
404
+ return r;
387
405
  },
388
406
  find: (e, t) => {
389
407
  if (!Array.isArray(e) || t.length === 0) return;
390
408
  let n = t[0];
391
409
  if (typeof n == "function") return e.find((e, t) => n(e, t));
392
410
  if (t.length < 2) return;
393
- let i = r(n), a = t[1];
394
- return e.find((e) => typeof e == "object" && e ? e[i] === a : e === a);
411
+ let r = i(n), a = t[1];
412
+ return e.find((e) => typeof e == "object" && e ? e[r] === a : e === a);
395
413
  },
396
414
  pluck: (e, t) => {
397
415
  if (!Array.isArray(e) || t.length === 0) return e;
398
- let n = r(t[0]);
416
+ let n = i(t[0]);
399
417
  return e.map((e) => typeof e == "object" && e ? e[n] : void 0);
400
418
  },
401
419
  unique: (e) => Array.isArray(e) ? [...new Set(e)] : e,
@@ -411,22 +429,22 @@ var e = Symbol("twigArrowParams"), t = (e) => e == null || e === "", n = (e, t)
411
429
  },
412
430
  index_by: (e, t) => {
413
431
  if (!Array.isArray(e) || t.length === 0) return e;
414
- let n = r(t[0]), i = {};
432
+ let n = i(t[0]), r = {};
415
433
  for (let t of e) if (typeof t == "object" && t) {
416
434
  let e = String(t[n] ?? "");
417
- i[e] = t;
435
+ r[e] = t;
418
436
  }
419
- return i;
437
+ return r;
420
438
  },
421
439
  group_by: (e, t) => {
422
440
  if (!Array.isArray(e) || t.length === 0) return e;
423
- let n = r(t[0]), i = {};
441
+ let n = i(t[0]), r = {};
424
442
  for (let t of e) if (typeof t == "object" && t) {
425
443
  let e = String(t[n] ?? "");
426
- i[e] = i[e] ?? [], i[e].push(t);
444
+ r[e] = r[e] ?? [], r[e].push(t);
427
445
  }
428
- return i;
446
+ return r;
429
447
  }
430
448
  };
431
449
  //#endregion
432
- export { e as ARROW_PARAMS, s as RAW_MARKER, g as filters, c as isRawMarker, u as unwrapRaw, l as wrapRaw };
450
+ export { e as ARROW_PARAMS, c as RAW_MARKER, _ as filters, l as isRawMarker, d as unwrapRaw, u as wrapRaw };
@@ -1,7 +1,10 @@
1
- export { processTwig } from './processTwig';
1
+ export { processTwig, processTwigParam, processTwigValue } from './processTwig';
2
+ export { MAX_PARAM_PASSES, resolveStepParam } from './processTwig/resolveStepParam';
2
3
  export { hasTemplateSyntax } from './tokens/hasTemplateSyntax';
3
4
  export { hasValidToken } from './tokens/hasValidToken';
4
- export { templateRootNames } from './templateRoots';
5
+ export { inspectTemplate } from './inspectTemplate';
6
+ export { templatePaths, templateRootNames } from './templateRoots';
5
7
  export { filters } from './filters/filters';
6
8
  export type { ASTNode, Expression } from './AST';
9
+ export type { TemplateInspection } from './inspectTemplate';
7
10
  export type { TwigFilter } from './filters/filters';
@@ -1,6 +1,8 @@
1
1
  import { filters as e } from "./filters/filters.mjs";
2
- import { processTwig as t } from "./processTwig/processTwig.mjs";
3
- import { hasTemplateSyntax as n } from "./tokens/hasTemplateSyntax.mjs";
4
- import { hasValidToken as r } from "./tokens/hasValidToken.mjs";
5
- import { templateRootNames as i } from "./templateRoots.mjs";
6
- export { e as filters, n as hasTemplateSyntax, r as hasValidToken, t as processTwig, i as templateRootNames };
2
+ import { processTwig as t, processTwigParam as n, processTwigValue as r } from "./processTwig/processTwig.mjs";
3
+ import { hasTemplateSyntax as i } from "./tokens/hasTemplateSyntax.mjs";
4
+ import { hasValidToken as a } from "./tokens/hasValidToken.mjs";
5
+ import { MAX_PARAM_PASSES as o, resolveStepParam as s } from "./processTwig/resolveStepParam.mjs";
6
+ import { inspectTemplate as c } from "./inspectTemplate.mjs";
7
+ import { templatePaths as l, templateRootNames as u } from "./templateRoots.mjs";
8
+ export { o as MAX_PARAM_PASSES, e as filters, i as hasTemplateSyntax, a as hasValidToken, c as inspectTemplate, t as processTwig, n as processTwigParam, r as processTwigValue, s as resolveStepParam, l as templatePaths, u as templateRootNames };
@@ -0,0 +1,23 @@
1
+ export type TemplateInspection = {
2
+ /**
3
+ * Everything the interpreter would read past rather than understand, in words: a character it skipped, an operator
4
+ * it does not implement, a filter or function it does not have, a tag it drops. Empty for a template that renders
5
+ * what it says.
6
+ */
7
+ issues: string[];
8
+ /**
9
+ * The names the template reads from its context — the first segment of every path that is not bound by the
10
+ * template itself (a `set`, a `for` variable, an arrow's parameter). What a caller checks against what will be in
11
+ * scope when it renders.
12
+ */
13
+ freeNames: string[];
14
+ };
15
+ /**
16
+ * What a template would do that its author did not write — read at author time, with the parser the runtime uses.
17
+ *
18
+ * The interpreter is forgiving on purpose: a page renders what it can rather than throwing. That same forgiveness is
19
+ * what turns a typo into a plausible wrong value — `s starts with 'x'` evaluated to `s` before the test existed, and a
20
+ * value in a condition is true. Anything that authors templates (the authoring surface, the builder) asks this first
21
+ * and refuses what it reports.
22
+ */
23
+ export declare const inspectTemplate: (template: string) => TemplateInspection;
@@ -0,0 +1,110 @@
1
+ import { filters as e } from "./filters/filters.mjs";
2
+ import { lex as t } from "./Lexer/Lexer.mjs";
3
+ import { parse as n } from "./Parser/Parser.mjs";
4
+ //#region src/helpers/twigWrapper/inspectTemplate.ts
5
+ var r = /* @__PURE__ */ new Set([
6
+ "cycle",
7
+ "max",
8
+ "min",
9
+ "range"
10
+ ]), i = "loop", a = class {
11
+ issues = [];
12
+ freeNames = /* @__PURE__ */ new Set();
13
+ nodes(e, t) {
14
+ let n = new Set(t);
15
+ for (let t of e) switch (t.type) {
16
+ case "text":
17
+ case "break":
18
+ case "continue": break;
19
+ case "variable":
20
+ this.expression(t.expression, n);
21
+ break;
22
+ case "if":
23
+ this.expression(t.condition, n), this.nodes(t.body, n);
24
+ for (let e of t.elseifClauses) this.expression(e.condition, n), this.nodes(e.body, n);
25
+ t.elseBody && this.nodes(t.elseBody, n);
26
+ break;
27
+ case "for": {
28
+ this.expression(t.collection, n);
29
+ let e = /* @__PURE__ */ new Set([
30
+ ...n,
31
+ t.valueVar,
32
+ i,
33
+ ...t.keyVar ? [t.keyVar] : []
34
+ ]);
35
+ this.nodes(t.body, e), n = /* @__PURE__ */ new Set([...n, ...this.setsIn(t.body)]), t.elseBody && this.nodes(t.elseBody, n);
36
+ break;
37
+ }
38
+ case "set":
39
+ Array.isArray(t.value) ? this.nodes(t.value, n) : this.expression(t.value, n), n = /* @__PURE__ */ new Set([...n, t.name]);
40
+ break;
41
+ case "apply":
42
+ this.filterNames(t.filters.map((e) => e.name));
43
+ for (let e of t.filters) e.args.forEach((e) => this.expression(e, n));
44
+ this.nodes(t.body, n);
45
+ }
46
+ return n;
47
+ }
48
+ setsIn(e) {
49
+ return e.flatMap((e) => e.type === "set" ? [e.name] : []);
50
+ }
51
+ filterNames(t) {
52
+ for (let n of t) n && !Object.hasOwn(e, n) && this.issues.push(`Unknown filter "${n}"`);
53
+ }
54
+ expression(e, t) {
55
+ switch (e.type) {
56
+ case "literal": return;
57
+ case "array":
58
+ e.elements.forEach((e) => this.expression(e, t));
59
+ return;
60
+ case "object":
61
+ for (let n of e.entries) this.expression(n.key, t), this.expression(n.value, t);
62
+ return;
63
+ case "range":
64
+ this.expression(e.start, t), this.expression(e.end, t);
65
+ return;
66
+ case "path":
67
+ t.has(e.segments[0]) || this.freeNames.add(e.segments[0]);
68
+ return;
69
+ case "index":
70
+ this.expression(e.object, t), this.expression(e.index, t);
71
+ return;
72
+ case "function":
73
+ r.has(e.name) || this.issues.push(`Unknown function "${e.name}()": the functions are ${[...r].join(", ")}`), e.args.forEach((e) => this.expression(e, t));
74
+ return;
75
+ case "filter":
76
+ this.expression(e.subject, t), this.filterNames(e.filters.map((e) => e.name));
77
+ for (let n of e.filters) n.args.forEach((e) => this.expression(e, t));
78
+ return;
79
+ case "concat":
80
+ e.parts.forEach((e) => this.expression(e, t));
81
+ return;
82
+ case "unary":
83
+ this.expression(e.operand, t);
84
+ return;
85
+ case "binary":
86
+ this.expression(e.left, t), (e.operator !== "is" && e.operator !== "is not" || e.right.type !== "path") && this.expression(e.right, t);
87
+ return;
88
+ case "default":
89
+ this.expression(e.value, t), this.expression(e.defaultExpr, t);
90
+ return;
91
+ case "ternary":
92
+ this.expression(e.condition, t), e.trueExpr && this.expression(e.trueExpr, t), this.expression(e.falseExpr, t);
93
+ return;
94
+ case "arrow": this.expression(e.body, /* @__PURE__ */ new Set([...t, ...e.params]));
95
+ }
96
+ }
97
+ }, o = (e) => {
98
+ let r = t(e);
99
+ if (r.error) return {
100
+ issues: [r.error],
101
+ freeNames: []
102
+ };
103
+ let i = new a(), { nodes: o, error: s } = n(r.tokens, !1, i.issues);
104
+ return s && i.issues.push(s), i.nodes(o, /* @__PURE__ */ new Set()), {
105
+ issues: [...new Set(i.issues)],
106
+ freeNames: [...i.freeNames]
107
+ };
108
+ };
109
+ //#endregion
110
+ export { o as inspectTemplate };
@@ -2,6 +2,13 @@ import { CacheEntry } from '../TemplateCache';
2
2
  export declare const resolveSimplePath: (context: Record<string, unknown>, name: string) => unknown;
3
3
  export declare const resolveDottedPath: (context: Record<string, unknown>, path: string) => unknown;
4
4
  export declare const serializeValue: (value: unknown) => string;
5
+ /**
6
+ * A rendered template as the value it reads as: `30` the number, `true`, an object from its JSON.
7
+ *
8
+ * Except a number that would not read back as the text it came from — `012345`, a code with a leading zero, or a
9
+ * 20-digit id past what a number can hold exactly. Those were handed on as `12345` and as the nearest double, which is
10
+ * a different second-factor code, PIN or id by the time anything sends it; they stay the text they were.
11
+ */
5
12
  export declare const finalizeRaw: (output: string) => unknown;
6
13
  export declare const flattenContext: (variables: Record<string, unknown>) => Record<string, unknown>;
7
14
  export declare const renderSimpleTokens: (entry: CacheEntry, context: Record<string, unknown>) => string;
@@ -12,7 +12,8 @@ var e = (e, t) => e[t], t = (e, t) => {
12
12
  return r;
13
13
  }, n = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), r = (e) => {
14
14
  try {
15
- return JSON.parse(e) || e;
15
+ let t = JSON.parse(e);
16
+ return typeof t == "number" && String(t) !== e.trim() ? e : t || e;
16
17
  } catch {
17
18
  return e;
18
19
  }
@@ -1 +1,2 @@
1
- export { processTwig } from './processTwig';
1
+ export { processTwig, processTwigParam, processTwigValue } from './processTwig';
2
+ export { MAX_PARAM_PASSES, resolveStepParam } from './resolveStepParam';
@@ -1,2 +1,3 @@
1
- import { processTwig as e } from "./processTwig.mjs";
2
- export { e as processTwig };
1
+ import { processTwig as e, processTwigParam as t, processTwigValue as n } from "./processTwig.mjs";
2
+ import { MAX_PARAM_PASSES as r, resolveStepParam as i } from "./resolveStepParam.mjs";
3
+ export { r as MAX_PARAM_PASSES, e as processTwig, t as processTwigParam, n as processTwigValue, i as resolveStepParam };
@@ -1 +1,29 @@
1
1
  export declare const processTwig: (template: string, variables?: Record<string, unknown>, keepEmptyTokens?: boolean, asRaw?: boolean) => unknown;
2
+ /**
3
+ * A template's VALUE, where it has one: `{{ rows|filter(r => r.open) }}` is the filtered array, `{{ count > 0 }}` a
4
+ * boolean, `{{ total }}` the number it holds.
5
+ *
6
+ * A template that is one `{{ expression }}` and nothing else (surrounding whitespace aside) answers that expression's
7
+ * value untouched. Anything with text around it, or tags, is text by nature and renders as {@link processTwig}.
8
+ *
9
+ * Unlike `processTwig`'s `asRaw`, nothing goes through JSON on the way: `0`, `false` and `null` come back as
10
+ * themselves, and a string that looks like a number stays a string.
11
+ */
12
+ export declare const processTwigValue: (template: string, variables?: Record<string, unknown>) => unknown;
13
+ /**
14
+ * A flow step's param — in the browser's flows and in a server action's — as the value the step is handed.
15
+ *
16
+ * A param that is one `{{ expression }}` is that expression's value, exactly: a string stays a string however it
17
+ * looks. The type is the VALUE's, never guessed from its text — which is what the step params used to do, rendering
18
+ * the value to text and reading the text back as JSON: a password typed as `1234` reached the server as a number, and
19
+ * a text field declared `text` on the far side then saw no password at all. What a param should be converted to is
20
+ * the business of whoever declares its type — `setState`'s `type`, an action's input fields — not of the resolver.
21
+ *
22
+ * Two readings of JSON stay, because in both the author wrote JSON on purpose: a param that is nothing but a JSON
23
+ * filter (`{{ saved|json_encode }}`) is the value it encodes, and text around the tokens that makes a JSON object or
24
+ * array (`{ "id": "{{ id }}" }`, an `input` written as a document) is that document. A value printed inside one of
25
+ * the document's string literals is escaped for it: a visitor's `Say "hi"` or a note on two lines used to break the
26
+ * document, and the step was handed its raw text instead. Any other text is text. A value that is not there reads as
27
+ * an empty string, as it renders.
28
+ */
29
+ export declare const processTwigParam: (template: string, variables?: Record<string, unknown>) => unknown;