@plitzi/sdk-shared 0.38.16 → 0.38.18

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 (125) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/dist/actions/cron.mjs +5 -9
  3. package/dist/actions/validateDocument.mjs +24 -50
  4. package/dist/connectors/validateManifest.mjs +28 -73
  5. package/dist/dataSource/helpers/index.mjs +1 -2
  6. package/dist/dataSource/index.d.ts +1 -1
  7. package/dist/dataSource/index.mjs +6 -8
  8. package/dist/dataSource/utility/dateConverter.mjs +1 -1
  9. package/dist/dataSource/utility/index.d.ts +1 -0
  10. package/dist/dataSource/utility/index.mjs +16 -15
  11. package/dist/{helpers → dates}/formatDate.mjs +1 -1
  12. package/dist/dates/index.d.ts +6 -0
  13. package/dist/dates/index.mjs +3 -0
  14. package/dist/{helpers → dates}/isDate.mjs +1 -1
  15. package/dist/devTools/index.d.ts +1 -3
  16. package/dist/devTools/index.mjs +5 -6
  17. package/dist/devTools/{DevToolsContext.d.ts → react/DevToolsContext.d.ts} +1 -1
  18. package/dist/devTools/{DevToolsContext.mjs → react/DevToolsContext.mjs} +1 -1
  19. package/dist/devTools/react/index.d.ts +3 -0
  20. package/dist/devTools/react/index.mjs +1 -0
  21. package/dist/devTools/utils/PlitziConsole.mjs +8 -12
  22. package/dist/elements/index.mjs +1 -2
  23. package/dist/flags/flagsCookie.mjs +4 -4
  24. package/dist/flags/index.mjs +2 -2
  25. package/dist/flags/react/index.d.ts +3 -0
  26. package/dist/flags/react/index.mjs +1 -0
  27. package/dist/flags/{useFlagResolution.d.ts → react/useFlagResolution.d.ts} +2 -4
  28. package/dist/flags/react/useFlagResolution.mjs +35 -0
  29. package/dist/flags/resolveFlags.d.ts +3 -1
  30. package/dist/flags/resolveFlags.mjs +16 -8
  31. package/dist/helpers/index.d.ts +8 -2
  32. package/dist/helpers/index.mjs +19 -13
  33. package/dist/helpers/keys.mjs +4 -8
  34. package/dist/helpers/twigWrapper/Evaluator/index.mjs +1 -2
  35. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +12 -26
  36. package/dist/helpers/twigWrapper/Parser/index.mjs +1 -2
  37. package/dist/helpers/twigWrapper/TemplateCache/index.mjs +1 -2
  38. package/dist/helpers/twigWrapper/charClass.mjs +2 -6
  39. package/dist/helpers/twigWrapper/filters/index.mjs +1 -2
  40. package/dist/helpers/twigWrapper/templateRoots.mjs +3 -8
  41. package/dist/hooks/useNetwork.mjs +1 -4
  42. package/dist/index.d.ts +5 -19
  43. package/dist/index.mjs +3 -99
  44. package/dist/network/graphql/builder/Mutations/index.d.ts +1 -0
  45. package/dist/network/graphql/builder/Mutations/index.mjs +148 -148
  46. package/dist/network/graphql/builder/Queries/index.mjs +4 -4
  47. package/dist/network/index.mjs +8 -8
  48. package/dist/plugins/{bundle.mjs → bundle/bundle.mjs} +1 -1
  49. package/dist/plugins/bundle/index.d.ts +2 -0
  50. package/dist/plugins/bundle/index.mjs +1 -0
  51. package/dist/plugins/index.d.ts +1 -0
  52. package/dist/plugins/index.mjs +1 -0
  53. package/dist/plugins/{PluginsContext.d.ts → react/PluginsContext.d.ts} +1 -1
  54. package/dist/plugins/{PluginsContext.mjs → react/PluginsContext.mjs} +1 -1
  55. package/dist/plugins/react/index.d.ts +3 -0
  56. package/dist/plugins/react/index.mjs +1 -0
  57. package/dist/project/index.d.ts +8 -0
  58. package/dist/project/index.mjs +5 -0
  59. package/dist/project/layout.mjs +5 -5
  60. package/dist/project/{paths.d.ts → paths/index.d.ts} +8 -1
  61. package/dist/project/paths/index.mjs +4 -0
  62. package/dist/project/root.mjs +1 -1
  63. package/dist/queries/queryCache.mjs +1 -7
  64. package/dist/realtime/client.mjs +3 -12
  65. package/dist/schema/index.d.ts +5 -3
  66. package/dist/schema/index.mjs +11 -7
  67. package/dist/schema/{SchemaContext.d.ts → react/SchemaContext.d.ts} +1 -1
  68. package/dist/schema/{SchemaContext.mjs → react/SchemaContext.mjs} +1 -1
  69. package/dist/schema/react/index.d.ts +3 -0
  70. package/dist/schema/react/index.mjs +1 -0
  71. package/dist/server/actions/useActionsSync.mjs +1 -1
  72. package/dist/server/actions/useImagesSync.mjs +1 -1
  73. package/dist/server/actions/useRealtimeSync.mjs +1 -1
  74. package/dist/server/index.d.ts +3 -0
  75. package/dist/server/index.mjs +7 -4
  76. package/dist/server/rsc/refreshRsc.mjs +11 -11
  77. package/dist/server/rsc/useRscSync.mjs +1 -1
  78. package/dist/server/usePluginRoute.mjs +1 -1
  79. package/dist/state/runtimeStatePersist.mjs +9 -15
  80. package/dist/store/index.d.ts +1 -193
  81. package/dist/store/index.mjs +6 -9
  82. package/dist/store/renderSettings.mjs +1 -1
  83. package/dist/store/storeHooks.d.ts +193 -0
  84. package/dist/store/storeHooks.mjs +5 -0
  85. package/dist/store/tracing/tracingCollector.mjs +1 -5
  86. package/dist/style/fonts.mjs +17 -25
  87. package/dist/style/index.d.ts +2 -0
  88. package/dist/style/index.mjs +17 -15
  89. package/dist/style/react/index.d.ts +5 -0
  90. package/dist/style/react/index.mjs +3 -0
  91. package/dist/style/{useDisplayMode.d.ts → react/useDisplayMode.d.ts} +1 -1
  92. package/dist/style/{useDisplayMode.mjs → react/useDisplayMode.mjs} +2 -2
  93. package/dist/style/{useElementSize.mjs → react/useElementSize.mjs} +1 -1
  94. package/dist/style/stylePseudos.mjs +2 -5
  95. package/dist/style/styleTarget.mjs +6 -6
  96. package/dist/theme/ThemeProvider.mjs +2 -2
  97. package/dist/theme/cookie/index.d.ts +1 -0
  98. package/dist/theme/cookie/index.mjs +1 -0
  99. package/dist/theme/{themeCookie.d.ts → cookie/themeCookie.d.ts} +1 -1
  100. package/dist/theme/{themeCookie.mjs → cookie/themeCookie.mjs} +2 -2
  101. package/dist/theme/index.d.ts +2 -1
  102. package/dist/theme/index.mjs +5 -5
  103. package/dist/types/SchemaTypes.d.ts +2 -1
  104. package/dist/types/ServerTypes.d.ts +27 -11
  105. package/dist/websockets/index.mjs +1 -2
  106. package/package.json +21 -1607
  107. package/vite.config.ts +20 -4
  108. package/dist/auth/authFailureLink.d.ts +0 -9
  109. package/dist/auth/authFailureLink.mjs +0 -20
  110. package/dist/dataSource/hooks/index.d.ts +0 -4
  111. package/dist/dataSource/hooks/index.mjs +0 -3
  112. package/dist/dataSource/hooks/useRegisterSource.d.ts +0 -9
  113. package/dist/dataSource/hooks/useRegisterSource.mjs +0 -40
  114. package/dist/dataSource/hooks/useResolvedVariables.d.ts +0 -12
  115. package/dist/dataSource/hooks/useResolvedVariables.mjs +0 -28
  116. package/dist/flags/useFlagResolution.mjs +0 -43
  117. package/dist/helpers/stripTypename.d.ts +0 -15
  118. package/dist/helpers/stripTypename.mjs +0 -41
  119. package/dist/project/paths.mjs +0 -4
  120. package/dist/server/rsc/projectData.d.ts +0 -6
  121. package/dist/server/rsc/projectData.mjs +0 -4
  122. /package/dist/{helpers → dates}/formatDate.d.ts +0 -0
  123. /package/dist/{helpers → dates}/isDate.d.ts +0 -0
  124. /package/dist/plugins/{bundle.d.ts → bundle/bundle.d.ts} +0 -0
  125. /package/dist/style/{useElementSize.d.ts → react/useElementSize.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { useCommonStoreSync as e } from "../../store/index.mjs";
1
+ import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
2
2
  //#region src/server/actions/useImagesSync.ts
3
3
  var t = (t) => {
4
4
  e(["images.endpoint"], [t?.imagePath]);
@@ -1,4 +1,4 @@
1
- import { useCommonStoreSync as e } from "../../store/index.mjs";
1
+ import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
2
2
  //#region src/server/actions/useRealtimeSync.ts
3
3
  var t = (t) => {
4
4
  e(["realtime.endpoint", "realtime.transport"], [t?.realtimePath, t?.realtimeTransport]);
@@ -4,3 +4,6 @@ import { default as useRscRefresh } from './rsc/useRscRefresh';
4
4
  import { default as useRscSync } from './rsc/useRscSync';
5
5
  export * from './rsc/refreshRsc';
6
6
  export { refreshRsc, useActionsSync, useRscRefresh, useRscSync };
7
+ export { default as usePluginRoute } from './usePluginRoute';
8
+ export { default as useImagesSync } from './actions/useImagesSync';
9
+ export { default as useRealtimeSync } from './actions/useRealtimeSync';
@@ -1,5 +1,8 @@
1
1
  import e from "./actions/useActionsSync.mjs";
2
- import t, { cancelRsc as n, currentRscLocation as r, releaseRscRequests as i, rscDataPath as a } from "./rsc/refreshRsc.mjs";
3
- import o from "./rsc/useRscRefresh.mjs";
4
- import s from "./rsc/useRscSync.mjs";
5
- export { n as cancelRsc, r as currentRscLocation, t as refreshRsc, i as releaseRscRequests, a as rscDataPath, e as useActionsSync, o as useRscRefresh, s as useRscSync };
2
+ import t from "./actions/useImagesSync.mjs";
3
+ import n from "./actions/useRealtimeSync.mjs";
4
+ import r, { cancelRsc as i, currentRscLocation as a, releaseRscRequests as o, rscDataPath as s } from "./rsc/refreshRsc.mjs";
5
+ import c from "./rsc/useRscRefresh.mjs";
6
+ import l from "./rsc/useRscSync.mjs";
7
+ import u from "./usePluginRoute.mjs";
8
+ export { i as cancelRsc, a as currentRscLocation, r as refreshRsc, o as releaseRscRequests, s as rscDataPath, e as useActionsSync, t as useImagesSync, u as usePluginRoute, n as useRealtimeSync, c as useRscRefresh, l as useRscSync };
@@ -1,15 +1,15 @@
1
1
  import { authFailureFromResponse as e, reportAuthFailure as t } from "../../auth/failureChannel.mjs";
2
2
  import { recordRenderActionRuns as n } from "../../store/actionRuns/actionRunsRecorder.mjs";
3
- import { collectServerElements as r, hasServerElements as i } from "../../schema/serverElements.mjs";
4
- import { getPaths as a, matchRoutePath as o } from "../../navigation/routes.mjs";
3
+ import { getPaths as r, matchRoutePath as i } from "../../navigation/routes.mjs";
4
+ import { collectServerElements as a, hasServerElements as o } from "../../schema/serverElements.mjs";
5
5
  //#region src/server/rsc/refreshRsc.ts
6
6
  var s = (e, t, n) => {
7
7
  if (!e) return;
8
- let r = e.pages.reduce((t, n) => (n in e.flat && (t[n] = e.flat[n]), t), {});
9
- return o(a(r, e.pageFolders, n), t.split("?")[0], n).pageId;
10
- }, c = (e, t, n, i) => {
11
- let a = new Set(r(e, t, [...n], i).map(({ id: e }) => e));
12
- return n.filter((e) => a.has(e));
8
+ let a = e.pages.reduce((t, n) => (n in e.flat && (t[n] = e.flat[n]), t), {});
9
+ return i(r(a, e.pageFolders, n), t.split("?")[0], n).pageId;
10
+ }, c = (e, t, n, r) => {
11
+ let i = new Set(a(e, t, [...n], r).map(({ id: e }) => e));
12
+ return n.filter((e) => i.has(e));
13
13
  }, l = (e) => `rsc.data.${e}`, u = () => typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`, d = "*", f = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new WeakMap(), m = () => ({
14
14
  seq: 0,
15
15
  inFlight: /* @__PURE__ */ new Set(),
@@ -51,15 +51,15 @@ var s = (e, t, n) => {
51
51
  }
52
52
  e.set("rsc.loaded", !0), e.set("rsc.stale", !1), e.set("rsc.location", i);
53
53
  });
54
- }, x = async (r, a, o, { location: l, fresh: f = !1 } = {}) => {
54
+ }, x = async (r, i, a, { location: l, fresh: f = !1 } = {}) => {
55
55
  let { enabled: p, endpoint: m } = r.get("rsc") ?? {};
56
56
  if (!p || !m || typeof window > "u") return;
57
57
  let v = l ?? u(), y = r.get("schema"), x = r.get("runtime.sources.auth"), S = l ? s(y, l, !!x?.details) : r.get("navigation.currentPageId"), C = l ? void 0 : r.get("runtime.sources.flags");
58
58
  if (!y) return;
59
- let w = a?.length ? c(y, S, a, C) : void 0;
60
- if (w ? !w.length : !i(y, S, C)) return;
59
+ let w = i?.length ? c(y, S, i, C) : void 0;
60
+ if (w ? !w.length : !o(y, S, C)) return;
61
61
  let T = new URLSearchParams({ location: v });
62
- w?.length && T.set("ids", w.join(",")), Object.entries(o ?? {}).forEach(([e, t]) => T.set(e, t));
62
+ w?.length && T.set("ids", w.join(",")), Object.entries(a ?? {}).forEach(([e, t]) => T.set(e, t));
63
63
  let E = `${m}?${T.toString()}`, D = h(r), O = [...D.inFlight].find((e) => e.url === E && (e.fresh || !f));
64
64
  if (O) return O.promise;
65
65
  D.inFlight.forEach((e) => {
@@ -1,4 +1,4 @@
1
- import { useCommonStore as e, useCommonStoreSync as t } from "../../store/index.mjs";
1
+ import { useCommonStore as e, useCommonStoreSync as t } from "../../store/storeHooks.mjs";
2
2
  import n, { currentRscLocation as r, releaseRscRequests as i } from "./refreshRsc.mjs";
3
3
  import { useEffect as a, useId as o } from "react";
4
4
  import { useStoreById as s } from "@plitzi/nexus/react";
@@ -1,5 +1,5 @@
1
1
  import { pluginRoutePath as e } from "../actions/functions.mjs";
2
- import { useCommonStore as t } from "../store/index.mjs";
2
+ import { useCommonStore as t } from "../store/storeHooks.mjs";
3
3
  import { useCallback as n } from "react";
4
4
  //#region src/server/usePluginRoute.ts
5
5
  var r = (r) => {
@@ -61,21 +61,15 @@ var l = /* @__PURE__ */ new Set([
61
61
  h = t?.owner === y ? JSON.stringify(a(t.values, _)) : void 0;
62
62
  }
63
63
  let x = a(b, _), S = JSON.stringify(x);
64
- if (S !== h) {
65
- if (h = S, Object.keys(x).length === 0) {
66
- n(f);
67
- return;
68
- }
69
- s(f, {
70
- owner: y,
71
- values: x
72
- }) === "too-large" && t.warning("store", `settings.paintedState holds more than a cookie can carry — the first paint uses the space's defaults for ${[..._].join(", ")}. Declare only what the first paint shows.`, {
73
- storeName: "runtime",
74
- path: "runtime.state",
75
- prev: void 0,
76
- next: x
77
- });
78
- }
64
+ S !== h && (h = S, Object.keys(x).length === 0 ? n(f) : s(f, {
65
+ owner: y,
66
+ values: x
67
+ }) === "too-large" && t.warning("store", `settings.paintedState holds more than a cookie can carry — the first paint uses the space's defaults for ${[..._].join(", ")}. Declare only what the first paint shows.`, {
68
+ storeName: "runtime",
69
+ path: "runtime.state",
70
+ prev: void 0,
71
+ next: x
72
+ }));
79
73
  };
80
74
  }, b = (t) => {
81
75
  let n = c({