@plitzi/sdk-shared 0.38.23 → 0.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +162 -1
  2. package/dist/actions/functions.d.ts +22 -1
  3. package/dist/actions/functions.mjs +3 -3
  4. package/dist/actions/index.d.ts +1 -1
  5. package/dist/actions/index.mjs +7 -7
  6. package/dist/auth/failureChannel.mjs +1 -0
  7. package/dist/auth/index.d.ts +1 -1
  8. package/dist/auth/index.mjs +2 -2
  9. package/dist/auth/visitorRoles.d.ts +8 -0
  10. package/dist/auth/visitorRoles.mjs +5 -2
  11. package/dist/authoring/declare.d.ts +34 -1
  12. package/dist/authoring/elementCallbacks.d.ts +13 -0
  13. package/dist/authoring/elementCallbacks.mjs +11 -5
  14. package/dist/authoring/index.mjs +3 -3
  15. package/dist/authoring/paramSpec.d.ts +1 -0
  16. package/dist/dataSource/getBindingsDetails.d.ts +1 -1
  17. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  18. package/dist/dataSource/globalSources.d.ts +1 -1
  19. package/dist/dataSource/index.d.ts +1 -2
  20. package/dist/dataSource/index.mjs +1 -1
  21. package/dist/dataSource/utility/arrayMap.mjs +1 -1
  22. package/dist/dataSource/utility/capitalize.mjs +1 -1
  23. package/dist/dataSource/utility/styleSelector.mjs +5 -3
  24. package/dist/dataSource/utility/styleVariant.mjs +17 -13
  25. package/dist/dataSource/variables/index.d.ts +2 -0
  26. package/dist/dataSource/variables/index.mjs +1 -0
  27. package/dist/dataSource/{resolveVariables.d.ts → variables/resolveVariables.d.ts} +1 -1
  28. package/dist/dataSource/{resolveVariables.mjs → variables/resolveVariables.mjs} +1 -1
  29. package/dist/devTools/chrome.d.ts +6 -0
  30. package/dist/devTools/chrome.mjs +2 -2
  31. package/dist/devTools/index.mjs +5 -5
  32. package/dist/devTools/sight/index.d.ts +1 -0
  33. package/dist/devTools/sight/index.mjs +1 -0
  34. package/dist/devTools/sight/sight.d.ts +28 -0
  35. package/dist/devTools/sight/sight.mjs +127 -0
  36. package/dist/devTools/utils/PlitziConsole.d.ts +14 -0
  37. package/dist/devTools/utils/PlitziConsole.mjs +20 -3
  38. package/dist/flags/flagsCookie.mjs +4 -4
  39. package/dist/flags/resolveFlags.d.ts +1 -1
  40. package/dist/helpers/index.mjs +19 -19
  41. package/dist/helpers/ruleEvaluator.d.ts +2 -0
  42. package/dist/helpers/ruleEvaluator.mjs +2 -2
  43. package/dist/helpers/scroll.d.ts +10 -0
  44. package/dist/helpers/scroll.mjs +2 -2
  45. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +90 -88
  46. package/dist/helpers/twigWrapper/Evaluator/helpers.d.ts +6 -0
  47. package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +11 -2
  48. package/dist/helpers/twigWrapper/filters/arrays.d.ts +2 -0
  49. package/dist/helpers/twigWrapper/filters/arrays.mjs +66 -0
  50. package/dist/helpers/twigWrapper/filters/catalog/index.d.ts +17 -0
  51. package/dist/helpers/twigWrapper/filters/catalog/index.mjs +351 -0
  52. package/dist/helpers/twigWrapper/filters/dateParts.d.ts +25 -0
  53. package/dist/helpers/twigWrapper/filters/dateParts.mjs +56 -0
  54. package/dist/helpers/twigWrapper/filters/dates.d.ts +2 -0
  55. package/dist/helpers/twigWrapper/filters/dates.mjs +97 -0
  56. package/dist/helpers/twigWrapper/filters/filters.d.ts +3 -13
  57. package/dist/helpers/twigWrapper/filters/filters.mjs +25 -483
  58. package/dist/helpers/twigWrapper/filters/hashing.d.ts +3 -0
  59. package/dist/helpers/twigWrapper/filters/hashing.mjs +101 -0
  60. package/dist/helpers/twigWrapper/filters/index.mjs +4 -1
  61. package/dist/helpers/twigWrapper/filters/misc.d.ts +5 -0
  62. package/dist/helpers/twigWrapper/filters/misc.mjs +52 -0
  63. package/dist/helpers/twigWrapper/filters/numbers.d.ts +2 -0
  64. package/dist/helpers/twigWrapper/filters/numbers.mjs +36 -0
  65. package/dist/helpers/twigWrapper/filters/objects.d.ts +3 -0
  66. package/dist/helpers/twigWrapper/filters/objects.mjs +61 -0
  67. package/dist/helpers/twigWrapper/filters/raw.d.ts +8 -0
  68. package/dist/helpers/twigWrapper/filters/raw.mjs +7 -0
  69. package/dist/helpers/twigWrapper/filters/strings.d.ts +7 -0
  70. package/dist/helpers/twigWrapper/filters/strings.mjs +79 -0
  71. package/dist/helpers/twigWrapper/filters/types.d.ts +5 -0
  72. package/dist/helpers/twigWrapper/filters/types.mjs +4 -0
  73. package/dist/helpers/twigWrapper/filters/values.d.ts +12 -0
  74. package/dist/helpers/twigWrapper/filters/values.mjs +17 -0
  75. package/dist/helpers/twigWrapper/inspectTemplate.d.ts +5 -0
  76. package/dist/helpers/twigWrapper/inspectTemplate.mjs +39 -20
  77. package/dist/helpers/utils.d.ts +4 -0
  78. package/dist/helpers/utils.mjs +3 -5
  79. package/dist/navigation/index.d.ts +2 -0
  80. package/dist/navigation/index.mjs +2 -1
  81. package/dist/navigation/sitemap.d.ts +16 -0
  82. package/dist/navigation/sitemap.mjs +25 -0
  83. package/dist/network/entitlements.d.ts +101 -0
  84. package/dist/network/entitlements.mjs +4 -0
  85. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.d.ts +31 -0
  86. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +13 -0
  87. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.d.ts +5 -0
  88. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +11 -0
  89. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.d.ts +1 -1
  90. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -1
  91. package/dist/network/graphql/builder/Mutations/index.d.ts +5 -0
  92. package/dist/network/graphql/builder/Mutations/index.mjs +150 -146
  93. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.d.ts +40 -0
  94. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +24 -0
  95. package/dist/network/graphql/builder/Queries/index.d.ts +3 -0
  96. package/dist/network/graphql/builder/Queries/index.mjs +44 -42
  97. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +3 -1
  98. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +1 -1
  99. package/dist/network/index.d.ts +1 -0
  100. package/dist/network/index.mjs +9 -8
  101. package/dist/network/spaceEvents.d.ts +20 -1
  102. package/dist/network/spaceEvents.mjs +12 -0
  103. package/dist/project/index.mjs +8 -5
  104. package/dist/project/layout/check.d.ts +22 -0
  105. package/dist/project/layout/check.mjs +60 -0
  106. package/dist/project/{layout.d.ts → layout/codes.d.ts} +3 -66
  107. package/dist/project/layout/codes.mjs +108 -0
  108. package/dist/project/layout/contents.d.ts +10 -0
  109. package/dist/project/layout/contents.mjs +31 -0
  110. package/dist/project/layout/files.d.ts +31 -0
  111. package/dist/project/layout/files.mjs +49 -0
  112. package/dist/project/layout/folders.d.ts +4 -0
  113. package/dist/project/layout/folders.mjs +69 -0
  114. package/dist/project/layout/index.d.ts +16 -0
  115. package/dist/project/layout/index.mjs +5 -0
  116. package/dist/project/layout/plugins.d.ts +46 -0
  117. package/dist/project/layout/plugins.mjs +99 -0
  118. package/dist/project/layout/vendor.d.ts +15 -0
  119. package/dist/project/layout/vendor.mjs +34 -0
  120. package/dist/project/pages/index.d.ts +8 -0
  121. package/dist/project/pages/index.mjs +14 -0
  122. package/dist/project/paths/index.d.ts +52 -4
  123. package/dist/project/paths/index.mjs +2 -2
  124. package/dist/project/root.d.ts +6 -0
  125. package/dist/project/root.mjs +11 -10
  126. package/dist/realtime/client.mjs +104 -91
  127. package/dist/realtime/presence.d.ts +2 -2
  128. package/dist/realtime/presence.mjs +27 -21
  129. package/dist/runs/index.d.ts +73 -0
  130. package/dist/runs/index.mjs +6 -0
  131. package/dist/runs/report.d.ts +56 -0
  132. package/dist/runs/report.mjs +17 -0
  133. package/dist/schema/index.d.ts +6 -0
  134. package/dist/schema/index.mjs +18 -12
  135. package/dist/schema/motion.d.ts +25 -0
  136. package/dist/schema/motion.mjs +47 -19
  137. package/dist/schema/pageAccess.d.ts +6 -0
  138. package/dist/schema/pageAccess.mjs +8 -3
  139. package/dist/schema/pageHead.d.ts +64 -0
  140. package/dist/schema/pageHead.mjs +68 -0
  141. package/dist/schema/providerAnswer.d.ts +17 -0
  142. package/dist/schema/providerAnswer.mjs +4 -0
  143. package/dist/schema/providerWhen.d.ts +36 -0
  144. package/dist/schema/providerWhen.mjs +58 -0
  145. package/dist/schema/schemaSettings.d.ts +14 -0
  146. package/dist/schema/schemaSettings.mjs +4 -0
  147. package/dist/schema/serverElements.d.ts +20 -1
  148. package/dist/schema/serverElements.mjs +41 -28
  149. package/dist/schema/serverInput.d.ts +34 -0
  150. package/dist/schema/serverInput.mjs +60 -0
  151. package/dist/schema/serverQuery.d.ts +47 -0
  152. package/dist/schema/serverQuery.mjs +70 -0
  153. package/dist/server/index.mjs +5 -5
  154. package/dist/server/rsc/refreshRsc.d.ts +6 -2
  155. package/dist/server/rsc/refreshRsc.mjs +75 -59
  156. package/dist/server/rsc/useRscSync.mjs +22 -18
  157. package/dist/source/export.d.ts +1 -1
  158. package/dist/state/runtimeStatePersist.mjs +25 -17
  159. package/dist/store/renderSettings.d.ts +2 -0
  160. package/dist/store/renderSettings.mjs +13 -5
  161. package/dist/store/storeHooks.d.ts +45 -45
  162. package/dist/style/index.mjs +16 -16
  163. package/dist/style/styleConstants.d.ts +12 -2
  164. package/dist/style/styleConstants.mjs +20 -0
  165. package/dist/style/styleStates.d.ts +5 -0
  166. package/dist/style/styleStates.mjs +21 -5
  167. package/dist/types/ActionTypes.d.ts +26 -3
  168. package/dist/types/AuthTypes.d.ts +19 -1
  169. package/dist/types/CommonTypes.d.ts +3 -2
  170. package/dist/types/ElementTypes.d.ts +1 -1
  171. package/dist/types/InteractionTypes.d.ts +10 -1
  172. package/dist/types/JobTypes.d.ts +2 -1
  173. package/dist/types/OAuthTypes.d.ts +246 -0
  174. package/dist/types/OAuthTypes.mjs +0 -0
  175. package/dist/types/PluginTypes.d.ts +2 -0
  176. package/dist/types/PreviewTypes.d.ts +71 -0
  177. package/dist/types/PreviewTypes.mjs +0 -0
  178. package/dist/types/RealtimeTypes.d.ts +11 -0
  179. package/dist/types/SchemaTypes.d.ts +56 -0
  180. package/dist/types/ServerAdapterTypes.d.ts +345 -0
  181. package/dist/types/ServerAdapterTypes.mjs +0 -0
  182. package/dist/types/ServerConfigTypes.d.ts +527 -0
  183. package/dist/types/ServerConfigTypes.mjs +0 -0
  184. package/dist/types/ServerLogTypes.d.ts +119 -0
  185. package/dist/types/ServerLogTypes.mjs +0 -0
  186. package/dist/types/ServerTypes.d.ts +30 -1215
  187. package/dist/types/StoreTypes.d.ts +39 -1
  188. package/dist/types/TestTypes.d.ts +249 -0
  189. package/dist/types/TestTypes.mjs +0 -0
  190. package/dist/types/index.d.ts +6 -0
  191. package/eslint.config.mjs +3 -1
  192. package/package.json +2 -2
  193. package/setupTests.ts +4 -3
  194. package/dist/project/layout.mjs +0 -394
@@ -1,4 +1,4 @@
1
- import { SchemaVariable, SchemaVariableValue } from '../types';
1
+ import { SchemaVariable, SchemaVariableValue } from '../../types';
2
2
  /** What a variable's `subValues` are matched against — everything a `when` rule may name. */
3
3
  export type VariableScope = {
4
4
  routeParams?: Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  import { QueryBuilderEvaluator as e } from "@plitzi/plitzi-ui/QueryBuilder/evaluator";
2
- //#region src/dataSource/resolveVariables.ts
2
+ //#region src/dataSource/variables/resolveVariables.ts
3
3
  var t = (t, n = {}) => Array.isArray(t) ? t.reduce((t, r) => {
4
4
  let { name: i, value: a, subValues: o } = r;
5
5
  if (!Array.isArray(o) || o.length === 0) return {
@@ -6,3 +6,9 @@
6
6
  export declare const DEV_TOOLS_ATTRIBUTE = "data-plitzi-devtools";
7
7
  /** The rule that hides the dev tools' chrome, for a capture of the page alone. */
8
8
  export declare const HIDE_DEV_TOOLS_CSS = "[data-plitzi-devtools] { display: none !important; }";
9
+ /**
10
+ * The mark of the page a project's server answers with while its space does not author (`spaceFailure.ts`): a page of
11
+ * Plitzi's own, not the space's. Whatever reads the page — `plitzi page measure`, `page outline` — says it, rather than
12
+ * "No element …" for every element asked (a run's dev-2 read that six times).
13
+ */
14
+ export declare const SPACE_FAILURE_META = "plitzi-space-failure";
@@ -1,4 +1,4 @@
1
1
  //#region src/devTools/chrome.ts
2
- var e = "data-plitzi-devtools", t = `[${e}] { display: none !important; }`;
2
+ var e = "data-plitzi-devtools", t = `[${e}] { display: none !important; }`, n = "plitzi-space-failure";
3
3
  //#endregion
4
- export { e as DEV_TOOLS_ATTRIBUTE, t as HIDE_DEV_TOOLS_CSS };
4
+ export { e as DEV_TOOLS_ATTRIBUTE, t as HIDE_DEV_TOOLS_CSS, n as SPACE_FAILURE_META };
@@ -1,5 +1,5 @@
1
- import { DEV_TOOLS_ATTRIBUTE as e, HIDE_DEV_TOOLS_CSS as t } from "./chrome.mjs";
2
- import { debugCookieName as n } from "./debugCookie.mjs";
3
- import r from "./interactionLog.mjs";
4
- import i, { createStoreDevToolsLogger as a, pConsole as o } from "./utils/PlitziConsole.mjs";
5
- export { e as DEV_TOOLS_ATTRIBUTE, t as HIDE_DEV_TOOLS_CSS, i as PlitziConsole, a as createStoreDevToolsLogger, n as debugCookieName, r as isInteractionFlow, o as pConsole };
1
+ import { DEV_TOOLS_ATTRIBUTE as e, HIDE_DEV_TOOLS_CSS as t, SPACE_FAILURE_META as n } from "./chrome.mjs";
2
+ import { debugCookieName as r } from "./debugCookie.mjs";
3
+ import i from "./interactionLog.mjs";
4
+ import a, { createStoreDevToolsLogger as o, pConsole as s } from "./utils/PlitziConsole.mjs";
5
+ export { e as DEV_TOOLS_ATTRIBUTE, t as HIDE_DEV_TOOLS_CSS, a as PlitziConsole, n as SPACE_FAILURE_META, o as createStoreDevToolsLogger, r as debugCookieName, i as isInteractionFlow, s as pConsole };
@@ -0,0 +1 @@
1
+ export * from './sight';
@@ -0,0 +1 @@
1
+ export { sightOf, sightText } from "./sight.mjs";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * What a visitor sees of an element: whether any of it is in sight, scrolling where the page lets them — or what keeps
3
+ * it out of sight. A box on the page is not one seen: a run's panel was "visible" at y=614 inside a column of 495 px that
4
+ * clipped it under the legend, and every check of the run passed on what no visitor saw.
5
+ */
6
+ export type Sight =
7
+ /** `scrolled`: the scrolling box a visitor scrolls to bring it into sight — none when it is in sight as it is. */
8
+ {
9
+ seen: true;
10
+ scrolled?: string;
11
+ } | {
12
+ seen: false;
13
+ /**
14
+ * `clipped`: a box that hides what spills past it, and does not scroll (`overflow: hidden`, `clip`); `outside`: past
15
+ * the edge of a screen that does not scroll to it (a page whose document is locked); `covered`: under something
16
+ * drawn over every part of it in sight; `taken`: a control whose press another control over it takes — seen
17
+ * through a clear button, and never pressed; `no-size`: nothing of it drawn.
18
+ */
19
+ why: 'clipped' | 'outside' | 'covered' | 'taken' | 'no-size';
20
+ by?: string;
21
+ };
22
+ /**
23
+ * The sight of `node`, read from the page as it is — nothing scrolled, nothing changed. Self-contained, as a function a
24
+ * browser is handed whole (`page.evaluate`) must be: no name of this module is read inside it.
25
+ */
26
+ export declare const sightOf: (node: Element) => Sight;
27
+ /** A sight said in words, as a check says why an element it was asked about is not seen — or where it is. */
28
+ export declare const sightText: (sight: Sight) => string;
@@ -0,0 +1,127 @@
1
+ //#region src/devTools/sight/sight.ts
2
+ var e = (e) => {
3
+ let t = (e) => e.closest("[data-plitzi-el]")?.getAttribute("data-plitzi-el") ?? `${e.tagName.toLowerCase()}${e.id ? `#${e.id}` : ""}`, n = e.getBoundingClientRect();
4
+ if (n.width <= 0 || n.height <= 0) return {
5
+ seen: !1,
6
+ why: "no-size"
7
+ };
8
+ let r = e.ownerDocument.defaultView, i = r?.innerWidth ?? 0, a = r?.innerHeight ?? 0, o = e.ownerDocument.documentElement, s = e.ownerDocument.body, { left: c, top: l, right: u, bottom: d } = n, f = {
9
+ left: c,
10
+ top: l,
11
+ right: u,
12
+ bottom: d
13
+ }, p, m = (e) => e === "auto" || e === "scroll";
14
+ for (let n = e.parentElement; n && n !== s && n !== o; n = n.parentElement) {
15
+ let e = getComputedStyle(n);
16
+ if (e.display === "contents" || e.overflowX === "visible" && e.overflowY === "visible") continue;
17
+ let r = n.getBoundingClientRect(), i = {
18
+ left: r.left + n.clientLeft,
19
+ top: r.top + n.clientTop,
20
+ right: r.left + n.clientLeft + (n.clientWidth || r.width),
21
+ bottom: r.top + n.clientTop + (n.clientHeight || r.height)
22
+ }, a = [{
23
+ overflow: e.overflowX,
24
+ start: "left",
25
+ end: "right",
26
+ room: n.scrollWidth > n.clientWidth
27
+ }, {
28
+ overflow: e.overflowY,
29
+ start: "top",
30
+ end: "bottom",
31
+ room: n.scrollHeight > n.clientHeight
32
+ }];
33
+ for (let e of a) {
34
+ if (e.overflow === "visible") continue;
35
+ let r = e.start === "left" ? c : l, a = e.end === "right" ? u : d, o = {
36
+ from: i[e.start],
37
+ to: i[e.end]
38
+ };
39
+ if (r < o.to && a > o.from) {
40
+ let t = Math.max(r, o.from), n = Math.min(a, o.to);
41
+ e.start === "left" ? (c = t, u = n) : (l = t, d = n);
42
+ continue;
43
+ }
44
+ if (!m(e.overflow) || !e.room) return {
45
+ seen: !1,
46
+ why: "clipped",
47
+ by: t(n)
48
+ };
49
+ p ??= t(n), f = void 0;
50
+ let s = Math.min(a - r, o.to - o.from);
51
+ e.start === "left" ? (c = o.from, u = o.from + s) : (l = o.from, d = o.from + s);
52
+ }
53
+ }
54
+ if ([o, s].some((e) => {
55
+ let t = getComputedStyle(e);
56
+ return t.overflowY === "hidden" || t.overflowY === "clip";
57
+ }) && i > 0 && a > 0 && (d <= 0 || l >= a || u <= 0 || c >= i)) return {
58
+ seen: !1,
59
+ why: "outside",
60
+ by: "the screen"
61
+ };
62
+ if (f === void 0 || typeof e.ownerDocument.elementFromPoint != "function" || i <= 0 || a <= 0) return p === void 0 ? { seen: !0 } : {
63
+ seen: !0,
64
+ scrolled: p
65
+ };
66
+ let h = {
67
+ left: Math.max(c, 0),
68
+ top: Math.max(l, 0),
69
+ right: Math.min(u, i),
70
+ bottom: Math.min(d, a)
71
+ };
72
+ if (h.right <= h.left || h.bottom <= h.top || getComputedStyle(e).pointerEvents === "none") return { seen: !0 };
73
+ let g = (e) => e.matches("a[href], button, input, select, textarea, summary, [role=\"button\"], [role=\"tab\"], [role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"option\"]") || getComputedStyle(e).cursor === "pointer";
74
+ if (g(e)) {
75
+ let n = e.ownerDocument.elementFromPoint((h.left + h.right) / 2, (h.top + h.bottom) / 2);
76
+ for (; n && !e.contains(n) && !n.contains(e) && !g(n);) n = n.parentElement;
77
+ if (n && !e.contains(n) && !n.contains(e)) return {
78
+ seen: !1,
79
+ why: "taken",
80
+ by: t(n)
81
+ };
82
+ }
83
+ let _ = (e) => {
84
+ let t = getComputedStyle(e), n = /rgba?\(([^)]+)\)/.exec(t.backgroundColor)?.[1]?.split(",");
85
+ return (n && n.length === 4 ? Number.parseFloat(n[3] ?? "1") : +!!n) > 0 || t.backgroundImage !== "" && t.backgroundImage !== "none" || [
86
+ "IMG",
87
+ "CANVAS",
88
+ "VIDEO",
89
+ "SVG",
90
+ "svg",
91
+ "IFRAME"
92
+ ].includes(e.tagName) || Array.from(e.childNodes).some((e) => e.nodeType === 3 && (e.textContent ?? "").trim() !== "");
93
+ }, v = [
94
+ [.5, .5],
95
+ [.25, .25],
96
+ [.75, .25],
97
+ [.25, .75],
98
+ [.75, .75]
99
+ ].map(([e = 0, t = 0]) => [h.left + (h.right - h.left) * e, h.top + (h.bottom - h.top) * t]), y;
100
+ for (let [t = 0, n = 0] of v) {
101
+ let r = e.ownerDocument.elementFromPoint(t, n);
102
+ if (!r || e.contains(r) || r.contains(e)) return { seen: !0 };
103
+ let i;
104
+ for (let t = r; t && !t.contains(e); t = t.parentElement) if (_(t)) {
105
+ i = t;
106
+ break;
107
+ }
108
+ if (!i) return { seen: !0 };
109
+ y ??= i;
110
+ }
111
+ return y ? {
112
+ seen: !1,
113
+ why: "covered",
114
+ by: t(y)
115
+ } : { seen: !0 };
116
+ }, t = (e) => {
117
+ if (e.seen) return e.scrolled === void 0 ? "in sight" : `out of sight until ${e.scrolled} is scrolled`;
118
+ switch (e.why) {
119
+ case "clipped": return `clipped by ${e.by ?? "a box"}, which hides what spills past it and does not scroll: nothing a visitor does brings it into sight`;
120
+ case "outside": return "past the edge of the screen, and the page does not scroll to it (its document is locked)";
121
+ case "covered": return `under ${e.by ?? "another element"}, drawn over every part of it in sight`;
122
+ case "taken": return `under ${e.by ?? "another control"}, which takes its press: a visitor sees it through it and cannot press it`;
123
+ case "no-size": return "nothing of it is drawn (no size)";
124
+ }
125
+ };
126
+ //#endregion
127
+ export { e as sightOf, t as sightText };
@@ -29,11 +29,25 @@ declare class PlitziConsole {
29
29
  addListener(listener: (log: Log) => void, { replay }?: {
30
30
  replay?: boolean;
31
31
  }): () => void;
32
+ /**
33
+ * The last logs written, oldest first: what a panel mounting again starts from. Its logs lived in its own state, and
34
+ * opening the panel from the badge moved it in the page's layout — React mounted it again, empty: the badge said a
35
+ * warning and the panel showed none. Only in a browser, as everything kept here is.
36
+ */
37
+ history(): Log[];
38
+ /** The history and what waits for a panel emptied: a panel's Clear empties what it starts from next time too. */
39
+ clearHistory(): void;
40
+ /** What waited for a panel dropped, once the panel took the history that holds it. */
41
+ dropPending(): void;
32
42
  setCallbackAddProvider(callback?: CallbackAddProvider): void;
33
43
  setCallbackRemoveProvider(callback?: CallbackRemoveProvider): void;
34
44
  flush(hard?: boolean): void;
35
45
  addProviderMethod(methodName: string, callback: ProviderCallback): void;
36
46
  removeProviderMethod(methodName: string): void;
47
+ /** Every method registered now, by name: what a panel mounting late starts from. */
48
+ providerMethods(): Record<string, ProviderCallback>;
49
+ /** What a registered method answers — undefined when none is registered by that name. */
50
+ providerData(methodName: string, ...args: unknown[]): unknown;
37
51
  getTime(asString: true): string;
38
52
  getTime(asString?: false): Date;
39
53
  info(category: Log['category'], message: Log['message'], params: Log['params']): void;
@@ -14,7 +14,7 @@ var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}
14
14
  #t = !1;
15
15
  #n = /* @__PURE__ */ new Set();
16
16
  #r = [];
17
- recentLimit = 200;
17
+ recentLimit = 1e3;
18
18
  constructor(e, t = 100) {
19
19
  this.callbackInternal = e, this.pendingLimit = t;
20
20
  }
@@ -33,6 +33,15 @@ var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}
33
33
  this.#n.delete(e);
34
34
  };
35
35
  }
36
+ history() {
37
+ return [...this.#r];
38
+ }
39
+ clearHistory() {
40
+ this.#r = [], this.pendingLogs = [];
41
+ }
42
+ dropPending() {
43
+ this.pendingLogs = [];
44
+ }
36
45
  setCallbackAddProvider(e) {
37
46
  this.callbackAddProvider = e;
38
47
  }
@@ -83,11 +92,19 @@ var e = (e, t = 2) => String(e).padStart(t, "0"), t = (t) => `${e(t.getHours())}
83
92
  if (this.#e = [], e) for (let n of t) e(n.logType, n.category, n.message, n.params, n.time);
84
93
  }));
85
94
  }
95
+ #o = /* @__PURE__ */ new Map();
86
96
  addProviderMethod(e, t) {
87
- this.callbackAddProvider?.(e, t);
97
+ this.#o.set(e, t), this.callbackAddProvider?.(e, t);
88
98
  }
89
99
  removeProviderMethod(e) {
90
- typeof this.callbackRemoveProvider == "function" && this.callbackRemoveProvider(e);
100
+ this.#o.delete(e), typeof this.callbackRemoveProvider == "function" && this.callbackRemoveProvider(e);
101
+ }
102
+ providerMethods() {
103
+ return Object.fromEntries(this.#o);
104
+ }
105
+ providerData(e, ...t) {
106
+ let n = this.#o.get(e);
107
+ return n === void 0 ? void 0 : n(...t);
91
108
  }
92
109
  getTime(e = !1) {
93
110
  let n = /* @__PURE__ */ new Date();
@@ -1,16 +1,16 @@
1
- import { isFlagName as e } from "./schemaFlag.mjs";
2
- import { cookieFromHeader as t } from "../helpers/cookies.mjs";
1
+ import { cookieFromHeader as e } from "../helpers/cookies.mjs";
2
+ import { isFlagName as t } from "./schemaFlag.mjs";
3
3
  //#region src/flags/flagsCookie.ts
4
4
  var n = (e) => {
5
5
  let t = e?.split(":")[1];
6
6
  return t ? `plitzi_flags_${t}` : "plitzi_flags";
7
- }, r = (t) => t ? Object.fromEntries(t.split(",").map((e) => e.split(":")).filter(([t, n]) => e(t) && (n === "1" || n === "0")).map(([e, t]) => [e, t === "1"])) : {}, i = (t) => Object.entries(t).filter(([t]) => e(t)).map(([e, t]) => `${e}:${t ? "1" : "0"}`).join(","), a = (e, t, n) => {
7
+ }, r = (e) => e ? Object.fromEntries(e.split(",").map((e) => e.split(":")).filter(([e, n]) => t(e) && (n === "1" || n === "0")).map(([e, t]) => [e, t === "1"])) : {}, i = (e) => Object.entries(e).filter(([e]) => t(e)).map(([e, t]) => `${e}:${t ? "1" : "0"}`).join(","), a = (e, t, n) => {
8
8
  let { [t]: r, ...i } = e;
9
9
  return n === void 0 ? i : {
10
10
  ...i,
11
11
  [t]: n
12
12
  };
13
- }, o = (e, i) => r(t(e, n(i))), s = (e, t) => {
13
+ }, o = (t, i) => r(e(t, n(i))), s = (e, t) => {
14
14
  let r = n(e), a = i(t);
15
15
  try {
16
16
  document.cookie = a ? `${r}=${encodeURIComponent(a)};path=/;SameSite=Lax` : `${r}=;path=/;max-age=0;SameSite=Lax`;
@@ -1,4 +1,4 @@
1
- import { VariableScope } from '../dataSource/resolveVariables';
1
+ import { VariableScope } from '../dataSource/variables';
2
2
  import { RuleGroup } from '../helpers/ruleEvaluator';
3
3
  import { AuthContextValue, Schema, SSRUser } from '../types';
4
4
  /**
@@ -6,22 +6,22 @@ import { hasValidToken as o } from "./twigWrapper/tokens/hasValidToken.mjs";
6
6
  import { MAX_PARAM_PASSES as s, resolveStepParam as c } from "./twigWrapper/processTwig/resolveStepParam.mjs";
7
7
  import { inspectTemplate as l } from "./twigWrapper/inspectTemplate.mjs";
8
8
  import { templatePaths as u, templateRootNames as d } from "./twigWrapper/templateRoots.mjs";
9
- import { SCROLL_BEHAVIORS as f, SCROLL_POSITIONS as p, SCROLL_TRIGGER as m, scrollDistance as h, scrollPosition as g, scrollState as _ } from "./scroll.mjs";
10
- import { sharedContext as v } from "./sharedContext.mjs";
11
- import { cookieFromHeader as y, documentCookies as b } from "./cookies.mjs";
12
- import { evaluateRuleGroup as x } from "./ruleEvaluator.mjs";
13
- import { canonicalJson as S } from "./canonicalJson.mjs";
14
- import { NOT_COPIED_REASON as C, clipboardWriter as w, copyText as T } from "./clipboard.mjs";
15
- import { EnclosingSpaceContext as E } from "./enclosingSpace.mjs";
16
- import { elementOf as D, isElementTarget as O, isNodeTarget as k, nodeOf as A } from "./eventTarget.mjs";
17
- import j from "./fetchManifest.mjs";
18
- import M from "./generateFacade.mjs";
19
- import { IMAGE_PATH as N, IMAGE_WIDTHS as P, imageSrcSet as F, imageUrl as I, isImageWidth as L, isRemoteImage as R, isResizableImage as z } from "./images.mjs";
20
- import B from "./syntaxHighlight.mjs";
21
- import { INTERVAL_TRIGGER as V, MIN_INTERVAL_MS as H, intervalOf as U } from "./interval.mjs";
22
- import { isUserEdit as W } from "./reducerOrigin.mjs";
23
- import { ParamsFromURL as G, delay as K, emptyObject as q, getDisplayName as J, getKeyDecoded as Y, getPathsFromObject as X, hexToRGB as Z, isInViewport as Q, makeId as $ } from "./utils.mjs";
24
- import { disableReactDevTools as ee } from "./security.mjs";
25
- import { SPACE_ROOT_CLASS as te, spaceRootOf as ne } from "./spaceRoot.mjs";
26
- import { KEY_TRIGGER as re, isFieldEditing as ie, keyPressCombo as ae, parseKeys as oe } from "./keys.mjs";
27
- export { E as EnclosingSpaceContext, N as IMAGE_PATH, P as IMAGE_WIDTHS, V as INTERVAL_TRIGGER, re as KEY_TRIGGER, s as MAX_PARAM_PASSES, H as MIN_INTERVAL_MS, C as NOT_COPIED_REASON, G as ParamsFromURL, f as SCROLL_BEHAVIORS, p as SCROLL_POSITIONS, m as SCROLL_TRIGGER, te as SPACE_ROOT_CLASS, S as canonicalJson, w as clipboardWriter, y as cookieFromHeader, T as copyText, K as delay, ee as disableReactDevTools, b as documentCookies, D as elementOf, q as emptyObject, x as evaluateRuleGroup, j as fetchManifest, t as filters, M as generateFacade, J as getDisplayName, Y as getKeyDecoded, X as getPathsFromObject, a as hasTemplateSyntax, o as hasValidToken, Z as hexToRGB, F as imageSrcSet, I as imageUrl, l as inspectTemplate, U as intervalOf, O as isElementTarget, ie as isFieldEditing, L as isImageWidth, Q as isInViewport, k as isNodeTarget, e as isRecord, R as isRemoteImage, z as isResizableImage, W as isUserEdit, ae as keyPressCombo, $ as makeId, A as nodeOf, oe as parseKeys, n as processTwig, r as processTwigParam, i as processTwigValue, c as resolveStepParam, h as scrollDistance, g as scrollPosition, _ as scrollState, v as sharedContext, ne as spaceRootOf, B as syntaxHighlight, u as templatePaths, d as templateRootNames };
9
+ import { SCROLL_BEHAVIORS as f, SCROLL_POSITIONS as p, SCROLL_TRIGGER as m, VIEW_TRIGGER as h, scrollDistance as g, scrollPosition as _, scrollState as v } from "./scroll.mjs";
10
+ import { sharedContext as y } from "./sharedContext.mjs";
11
+ import b from "./fetchManifest.mjs";
12
+ import x from "./generateFacade.mjs";
13
+ import S from "./syntaxHighlight.mjs";
14
+ import { cookieFromHeader as C, documentCookies as w } from "./cookies.mjs";
15
+ import { elementOf as T, isElementTarget as E, isNodeTarget as D, nodeOf as O } from "./eventTarget.mjs";
16
+ import { INTERVAL_TRIGGER as k, MIN_INTERVAL_MS as A, intervalOf as j } from "./interval.mjs";
17
+ import { isUserEdit as M } from "./reducerOrigin.mjs";
18
+ import { evaluateRuleGroup as N, ruleValuesOf as P } from "./ruleEvaluator.mjs";
19
+ import { ParamsFromURL as F, delay as I, emptyObject as L, getDisplayName as R, getKeyDecoded as z, getPathsFromObject as B, hexToRGB as V, isInViewport as H, makeId as U } from "./utils.mjs";
20
+ import { disableReactDevTools as W } from "./security.mjs";
21
+ import { EnclosingSpaceContext as G } from "./enclosingSpace.mjs";
22
+ import { canonicalJson as K } from "./canonicalJson.mjs";
23
+ import { SPACE_ROOT_CLASS as q, spaceRootOf as J } from "./spaceRoot.mjs";
24
+ import { IMAGE_PATH as Y, IMAGE_WIDTHS as X, imageSrcSet as Z, imageUrl as Q, isImageWidth as $, isRemoteImage as ee, isResizableImage as te } from "./images.mjs";
25
+ import { KEY_TRIGGER as ne, isFieldEditing as re, keyPressCombo as ie, parseKeys as ae } from "./keys.mjs";
26
+ import { NOT_COPIED_REASON as oe, clipboardWriter as se, copyText as ce } from "./clipboard.mjs";
27
+ export { G as EnclosingSpaceContext, Y as IMAGE_PATH, X as IMAGE_WIDTHS, k as INTERVAL_TRIGGER, ne as KEY_TRIGGER, s as MAX_PARAM_PASSES, A as MIN_INTERVAL_MS, oe as NOT_COPIED_REASON, F as ParamsFromURL, f as SCROLL_BEHAVIORS, p as SCROLL_POSITIONS, m as SCROLL_TRIGGER, q as SPACE_ROOT_CLASS, h as VIEW_TRIGGER, K as canonicalJson, se as clipboardWriter, C as cookieFromHeader, ce as copyText, I as delay, W as disableReactDevTools, w as documentCookies, T as elementOf, L as emptyObject, N as evaluateRuleGroup, b as fetchManifest, t as filters, x as generateFacade, R as getDisplayName, z as getKeyDecoded, B as getPathsFromObject, a as hasTemplateSyntax, o as hasValidToken, V as hexToRGB, Z as imageSrcSet, Q as imageUrl, l as inspectTemplate, j as intervalOf, E as isElementTarget, re as isFieldEditing, $ as isImageWidth, H as isInViewport, D as isNodeTarget, e as isRecord, ee as isRemoteImage, te as isResizableImage, M as isUserEdit, ie as keyPressCombo, U as makeId, O as nodeOf, ae as parseKeys, n as processTwig, r as processTwigParam, i as processTwigValue, c as resolveStepParam, P as ruleValuesOf, g as scrollDistance, _ as scrollPosition, v as scrollState, y as sharedContext, J as spaceRootOf, S as syntaxHighlight, u as templatePaths, d as templateRootNames };
@@ -11,4 +11,6 @@ import { RuleGroup, RuleValue } from '@plitzi/plitzi-ui/QueryBuilder/evaluator';
11
11
  * declared in exactly one place.
12
12
  */
13
13
  export declare const evaluateRuleGroup: (group: RuleGroup, values: Record<string, RuleValue>) => boolean;
14
+ /** A value bag as a rule group reads it: what no rule can compare — a function, a symbol — left out. */
15
+ export declare const ruleValuesOf: (values: Record<string, unknown>) => Record<string, RuleValue>;
14
16
  export type { Rule, RuleGroup, RuleValue } from '@plitzi/plitzi-ui/QueryBuilder/evaluator';
@@ -1,5 +1,5 @@
1
1
  import { QueryBuilderEvaluator as e } from "@plitzi/plitzi-ui/QueryBuilder/evaluator";
2
2
  //#region src/helpers/ruleEvaluator.ts
3
- var t = (t, n) => !!e(t, n);
3
+ var t = (t, n) => !!e(t, n), n = (e) => typeof e != "function" && typeof e != "symbol" && typeof e != "bigint", r = (e) => Object.fromEntries(Object.entries(e).filter((e) => n(e[1])));
4
4
  //#endregion
5
- export { t as evaluateRuleGroup };
5
+ export { t as evaluateRuleGroup, r as ruleValuesOf };
@@ -40,3 +40,13 @@ export declare const scrollPosition: (value: unknown, scrollSize: number, client
40
40
  export declare const scrollState: (box: ScrollBox) => ScrollTriggerPayload;
41
41
  /** The trigger a scroll fires, its action name in a flow. */
42
42
  export declare const SCROLL_TRIGGER = "onScroll";
43
+ /**
44
+ * The trigger an element coming into the visitor's view fires — and leaving it — its action name in a flow: "load more
45
+ * as you scroll" is a list's last row firing it. A run's agents searched for it six times and wrote a "Show more"
46
+ * button instead: a page that scrolls the document had no way to know a row was reached.
47
+ */
48
+ export declare const VIEW_TRIGGER = "onView";
49
+ /** What `onView` carries: whether the element is now in view (it fires when it comes in, and when it goes). */
50
+ export type ViewTriggerPayload = {
51
+ inView: boolean;
52
+ };
@@ -25,6 +25,6 @@ var e = ["smooth", "auto"], t = [
25
25
  atStart: r <= n,
26
26
  atEnd: r >= i - n
27
27
  };
28
- }, s = "onScroll";
28
+ }, s = "onScroll", c = "onView";
29
29
  //#endregion
30
- export { e as SCROLL_BEHAVIORS, t as SCROLL_POSITIONS, s as SCROLL_TRIGGER, i as scrollDistance, a as scrollPosition, o as scrollState };
30
+ export { e as SCROLL_BEHAVIORS, t as SCROLL_POSITIONS, s as SCROLL_TRIGGER, c as VIEW_TRIGGER, i as scrollDistance, a as scrollPosition, o as scrollState };