@plitzi/sdk-shared 0.38.17 → 0.38.19

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 (72) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  3. package/dist/dataSource/resolveVariables.mjs +1 -1
  4. package/dist/dataSource/utility/dateConverter.mjs +1 -1
  5. package/dist/{helpers → dates}/formatDate.mjs +1 -1
  6. package/dist/dates/index.d.ts +6 -0
  7. package/dist/dates/index.mjs +3 -0
  8. package/dist/{helpers → dates}/isDate.mjs +1 -1
  9. package/dist/devTools/index.d.ts +1 -3
  10. package/dist/devTools/index.mjs +5 -6
  11. package/dist/devTools/{DevToolsContext.d.ts → react/DevToolsContext.d.ts} +1 -1
  12. package/dist/devTools/{DevToolsContext.mjs → react/DevToolsContext.mjs} +1 -1
  13. package/dist/devTools/react/index.d.ts +3 -0
  14. package/dist/devTools/react/index.mjs +1 -0
  15. package/dist/flags/flagsCookie.mjs +4 -4
  16. package/dist/flags/index.d.ts +0 -2
  17. package/dist/flags/index.mjs +2 -3
  18. package/dist/flags/react/index.d.ts +3 -0
  19. package/dist/flags/react/index.mjs +1 -0
  20. package/dist/flags/{useFlagResolution.d.ts → react/useFlagResolution.d.ts} +2 -4
  21. package/dist/flags/react/useFlagResolution.mjs +35 -0
  22. package/dist/flags/resolveFlags.d.ts +3 -1
  23. package/dist/flags/resolveFlags.mjs +16 -8
  24. package/dist/helpers/generateFacade.mjs +1 -1
  25. package/dist/helpers/index.d.ts +0 -2
  26. package/dist/helpers/index.mjs +17 -19
  27. package/dist/helpers/ruleEvaluator.d.ts +4 -4
  28. package/dist/helpers/ruleEvaluator.mjs +1 -1
  29. package/dist/helpers/utils.mjs +1 -1
  30. package/dist/plugins/index.d.ts +0 -3
  31. package/dist/plugins/index.mjs +1 -3
  32. package/dist/plugins/{PluginsContext.d.ts → react/PluginsContext.d.ts} +1 -1
  33. package/dist/plugins/{PluginsContext.mjs → react/PluginsContext.mjs} +1 -1
  34. package/dist/plugins/react/index.d.ts +3 -0
  35. package/dist/plugins/react/index.mjs +1 -0
  36. package/dist/project/index.mjs +5 -5
  37. package/dist/project/layout.mjs +1 -1
  38. package/dist/project/{paths.d.ts → paths/index.d.ts} +8 -1
  39. package/dist/project/paths/index.mjs +4 -0
  40. package/dist/project/root.mjs +1 -1
  41. package/dist/schema/index.d.ts +0 -3
  42. package/dist/schema/index.mjs +10 -11
  43. package/dist/schema/{SchemaContext.d.ts → react/SchemaContext.d.ts} +1 -1
  44. package/dist/schema/{SchemaContext.mjs → react/SchemaContext.mjs} +1 -1
  45. package/dist/schema/react/index.d.ts +3 -0
  46. package/dist/schema/react/index.mjs +1 -0
  47. package/dist/server/index.d.ts +0 -1
  48. package/dist/server/index.mjs +2 -3
  49. package/dist/store/storeHooks.d.ts +33 -33
  50. package/dist/style/index.d.ts +0 -2
  51. package/dist/style/index.mjs +2 -4
  52. package/dist/style/react/index.d.ts +5 -0
  53. package/dist/style/react/index.mjs +3 -0
  54. package/dist/style/{useDisplayMode.d.ts → react/useDisplayMode.d.ts} +1 -1
  55. package/dist/style/{useDisplayMode.mjs → react/useDisplayMode.mjs} +2 -2
  56. package/dist/style/{useElementSize.mjs → react/useElementSize.mjs} +1 -1
  57. package/dist/theme/ThemeProvider.mjs +1 -1
  58. package/dist/theme/cookie/index.d.ts +1 -0
  59. package/dist/theme/cookie/index.mjs +1 -0
  60. package/dist/theme/{themeCookie.d.ts → cookie/themeCookie.d.ts} +1 -1
  61. package/dist/theme/{themeCookie.mjs → cookie/themeCookie.mjs} +2 -2
  62. package/dist/theme/index.d.ts +1 -1
  63. package/dist/theme/index.mjs +1 -1
  64. package/dist/types/ServerTypes.d.ts +27 -11
  65. package/package.json +2 -2
  66. package/dist/flags/useFlagResolution.mjs +0 -43
  67. package/dist/project/paths.mjs +0 -4
  68. package/dist/server/rsc/projectData.d.ts +0 -6
  69. package/dist/server/rsc/projectData.mjs +0 -4
  70. /package/dist/{helpers → dates}/formatDate.d.ts +0 -0
  71. /package/dist/{helpers → dates}/isDate.d.ts +0 -0
  72. /package/dist/style/{useElementSize.d.ts → react/useElementSize.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,95 @@
1
1
  # @plitzi/sdk-shared
2
2
 
3
+ ## 0.38.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 92a9f1b: ## Security
8
+
9
+ - **The `Origin` fallback tells the ports apart over HTTP/2 too** (`@plitzi/sdk-server`): a browser that sends no
10
+ `Sec-Fetch-Site` (Safari before 16.4, older webviews) is judged by its `Origin`, compared with the authority the
11
+ request was addressed to. HTTP/2 carries no `Host` header — the authority is `:authority` — and the comparison then
12
+ fell back to the host's NAME, so every port and scheme of it counted as this server's own: what 0.38.18 closed for
13
+ `same-site` stayed open there, over TLS, where a Plitzi server speaks HTTP/2. The authority is now `:authority`,
14
+ `Host`, or the `X-Forwarded-Host` a proxy in front wrote — whichever names the host the request is answered as — port
15
+ included; when none does, the origin is not taken as its own. The write guard (`crossSiteWrites`), the sign-in's
16
+ login-CSRF check and `createOriginGuardMiddleware` share it.
17
+
18
+ ## Packages
19
+ - **The server evaluates rules without the query editor** (`@plitzi/sdk-shared`, `@plitzi/sdk-auth`,
20
+ `@plitzi/sdk-elements`, `@plitzi/sdk-interactions`, `@plitzi/plitzi-builder`): every evaluation of a `when` rule
21
+ group imports `QueryBuilderEvaluator` from `@plitzi/plitzi-ui/QueryBuilder/evaluator` — the evaluator alone — instead
22
+ of the `QueryBuilder` barrel, which brings the editor's React components, or `QueryBuilder/helpers`, which brings the
23
+ SQL and MongoDB formatters. `@plitzi/sdk-shared/helpers` reads `get` and `omit` from `@plitzi/plitzi-ui/helpers/lodash`.
24
+ Importing `@plitzi/sdk-server` loads 19 modules of `@plitzi/plitzi-ui` (26 before) and neither
25
+ `class-variance-authority` nor `clsx`, and starts in ~125 ms (~150 before). Needs `@plitzi/plitzi-ui` 1.6.34.
26
+
27
+ ## 0.38.18
28
+
29
+ ### Patch Changes
30
+
31
+ - b3023c9: ## Security
32
+
33
+ - **A page of the same site on another origin is no longer this server's own** (`@plitzi/sdk-server`): the guard
34
+ against writes another page caused (`crossSiteWrites`, the sign-in's login-CSRF check and `createOriginGuardMiddleware`)
35
+ trusted `Sec-Fetch-Site: same-site` — and a site has no port and spans every sub-domain, so another port of the host
36
+ (where `createAuthoringHost` serves pages an agent wrote) or a sibling sub-domain (every space of a platform on one
37
+ domain) could write as if it were the server's own page. Now only `same-origin` (and `none`, a typed URL) is; `same-site`
38
+ is refused 403 `reason: 'foreign'` unless its origin is named (`crossSiteWrites.origins`, `identity.platformOrigins`),
39
+ and the `Origin` fallback compares host and port. In production an app and its spaces are already on different sites,
40
+ so a deployment that works there needs nothing; one that relied on a sibling sub-domain locally names it.
41
+ `createAuthoringHost`'s docs now say to serve on a host of its own — a cookie belongs to a host whatever its port.
42
+
43
+ ## Server
44
+ - **An open page takes a new version of its space where it stands** (`@plitzi/sdk-server`, `@plitzi/plitzi-sdk`):
45
+ `server.updatePages(documents, { draft? })` hands the pages showing that space — or that draft — its new documents,
46
+ and each swaps them in place, its state, scroll and focus kept (`replaceSpace` on what the SDK's `render` returns;
47
+ `false`, and the page loads again, for a page with elements the server draws). The development loop of a project uses
48
+ it: a save to the space no longer reloads the open page. `createAuthoringHost`'s `put` over an id that pages show
49
+ hands them the new version and answers how many took it (`updated`), so a page an agent keeps improving is seen to
50
+ grow instead of reloading — no second iframe needed.
51
+ - **`devReload` is `livePages`** (`@plitzi/sdk-server`): the channel the open pages listen on now carries the space,
52
+ not only "load again", and a host that is not developing uses it too. Its address is `/__plitzi/live`; a draft's page
53
+ listens for its own changes alone (`?__pt=`). A plugin swapped where it is drawn stays a development server's
54
+ (`devMode`). `plitzi upgrade migrations --write` renames the option in a project's code (`livePagesOption`).
55
+
56
+ ## Packages
57
+ - **`@plitzi/sdk-server` starts in half the time** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): importing it took
58
+ ~310 ms, ~200 of them `date-fns` — 108 modules nothing on the server uses, brought by `@plitzi/sdk-shared/helpers` —
59
+ and loaded the browser's hooks and contexts of every folder of `@plitzi/sdk-shared` it read, `@plitzi/nexus/react`
60
+ with them. Now ~150 ms (`@plitzi/sdk-shared` 139 → 113 modules, `@plitzi/nexus` 53 → 31). What moved, each
61
+ rewritten by `plitzi upgrade migrations --write` (`movedExports`):
62
+ - the dates — `formatDate`, `formatDateUTC`, `formatFromNow`, `formatUTCToLocal`, `getDurationMs`, `isDate`,
63
+ `isValidFormat`, `parseDate`, `toUnixSeconds`, `SupportedLocale` — from `@plitzi/sdk-shared/helpers` to
64
+ `@plitzi/sdk-shared/dates`;
65
+ - React's bindings to an entry of their own beside each area, as `@plitzi/nexus/react` is: `useDisplayMode`,
66
+ `useElementSize` → `@plitzi/sdk-shared/style/react`; `SchemaContext` → `schema/react`; `PluginsContext` →
67
+ `plugins/react`; `DevToolsContext` → `devTools/react`; `useFlagResolution` → `flags/react` (`flagUserFrom` stays
68
+ in `flags`);
69
+ - `PROJECT_DATA_PREFIX` from `@plitzi/sdk-shared/server` to `@plitzi/sdk-shared/project/paths` — the project's
70
+ layout names, an entry a browser imports too (`@plitzi/sdk-shared/project` stays Node only and re-exports them).
71
+ The theme cookie's helpers (`themeFromCookies`…) are also `@plitzi/sdk-shared/theme/cookie`, still exported by
72
+ `@plitzi/sdk-shared/theme`.
73
+
74
+ `yarn check:server-footprint` (in CI after the build) holds what the server's root loads, package by package — Plitzi's
75
+ and every other — to a budget: a heavy library or a folder of hooks coming back fails with what came in.
76
+
77
+ ## CLI
78
+ - **`plitzi upgrade migrations --write` writes a file import's new home when it has one** (`@plitzi/cli`): the
79
+ `folderImports` migration of 0.38.17 named every import of a package's FILE and wrote none. It now reads the installed
80
+ declarations with the project's own TypeScript and rewrites each `import` / `export … from` whose every name the folder
81
+ exports under one name — `import usePlitzi from '@plitzi/sdk-shared/hooks/usePlitzi'` →
82
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`, `type` modifiers and aliases kept. What has no one answer is
83
+ said with why (a namespace import, an `import()` or mock, a name the folder does not export, a project with no
84
+ TypeScript). The report says which places `--write` writes (`writable` in `--json`) instead of calling every one
85
+ "yours to change"; a migration now gives each place its own `edit` in place of a whole-file `rewrite`
86
+ (`docs/en/releases.md`).
87
+ - **`plitzi doctor` says an import of a path the installed package does not export** (`@plitzi/cli`):
88
+ `import-not-exported`, an error, at the importing file — what Node otherwise reports at start as an
89
+ `ERR_MODULE_NOT_FOUND` into the package's `dist`, which reads as a broken install rather than a changed API. For a
90
+ `@plitzi` package the fix names `plitzi upgrade migrations --write`; for any other, its `exports`. Asked only of a
91
+ package that is installed.
92
+
3
93
  ## 0.38.17
4
94
 
5
95
  ### Patch Changes
@@ -2,7 +2,7 @@ import { isTrue as e } from "./utility/truthiness.mjs";
2
2
  import t from "./utility/index.mjs";
3
3
  import { checkboxParams as n } from "./utility/checkboxParams.mjs";
4
4
  import { camelCase as r, get as i, set as a } from "@plitzi/plitzi-ui/helpers/lodash";
5
- import { QueryBuilderEvaluator as o } from "@plitzi/plitzi-ui/QueryBuilder";
5
+ import { QueryBuilderEvaluator as o } from "@plitzi/plitzi-ui/QueryBuilder/evaluator";
6
6
  import { produce as s } from "immer";
7
7
  //#region src/dataSource/getBindingsDetails.ts
8
8
  var c = (e, t, n, r, a) => {
@@ -1,4 +1,4 @@
1
- import { QueryBuilderEvaluator as e } from "@plitzi/plitzi-ui/QueryBuilder";
1
+ import { QueryBuilderEvaluator as e } from "@plitzi/plitzi-ui/QueryBuilder/evaluator";
2
2
  //#region src/dataSource/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;
@@ -1,4 +1,4 @@
1
- import { formatDate as e, formatDateUTC as t, formatFromNow as n, parseDate as r } from "../../helpers/formatDate.mjs";
1
+ import { formatDate as e, formatDateUTC as t, formatFromNow as n, parseDate as r } from "../../dates/formatDate.mjs";
2
2
  var i = {
3
3
  action: "dateConverter",
4
4
  title: "Date Converter",
@@ -6,7 +6,7 @@ import { enUS as i } from "date-fns/locale/en-US";
6
6
  import { es as a } from "date-fns/locale/es";
7
7
  import { pt as o } from "date-fns/locale/pt";
8
8
  import { parseISO as s } from "date-fns/parseISO";
9
- //#region src/helpers/formatDate.ts
9
+ //#region src/dates/formatDate.ts
10
10
  var c = {
11
11
  en: i,
12
12
  es: a,
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Dates as a page shows them — formatted, parsed, relative to now — in the locales a space speaks. Apart from `helpers`
3
+ * because date-fns is heavy to load (a hundred modules), and only what shows a date should pay for it.
4
+ */
5
+ export * from './formatDate';
6
+ export * from './isDate';
@@ -0,0 +1,3 @@
1
+ import { formatDate as e, formatDateUTC as t, formatFromNow as n, formatUTCToLocal as r, getDurationMs as i, isValidFormat as a, parseDate as o, toUnixSeconds as s } from "./formatDate.mjs";
2
+ import { isDate as c } from "./isDate.mjs";
3
+ export { e as formatDate, t as formatDateUTC, n as formatFromNow, r as formatUTCToLocal, i as getDurationMs, c as isDate, a as isValidFormat, o as parseDate, s as toUnixSeconds };
@@ -1,7 +1,7 @@
1
1
  import { format as e } from "date-fns/format";
2
2
  import { isValid as t } from "date-fns/isValid";
3
3
  import { parse as n } from "date-fns/parse";
4
- //#region src/helpers/isDate.ts
4
+ //#region src/dates/isDate.ts
5
5
  function r(r, i) {
6
6
  if (typeof r != "string") return !1;
7
7
  try {
@@ -1,10 +1,8 @@
1
1
  import { default as debugCookieName } from './debugCookie';
2
- import { default as DevToolsContext } from './DevToolsContext';
3
2
  import { default as isInteractionFlow } from './interactionLog';
4
3
  import { default as PlitziConsole } from './utils/PlitziConsole';
5
4
  export * from './chrome';
6
5
  export * from './debugCookie';
7
- export * from './DevToolsContext';
8
6
  export * from './interactionLog';
9
7
  export * from './utils/PlitziConsole';
10
- export { PlitziConsole, DevToolsContext, debugCookieName, isInteractionFlow };
8
+ export { PlitziConsole, debugCookieName, isInteractionFlow };
@@ -1,6 +1,5 @@
1
- import e from "./DevToolsContext.mjs";
2
- import { DEV_TOOLS_ATTRIBUTE as t, HIDE_DEV_TOOLS_CSS as n } from "./chrome.mjs";
3
- import { debugCookieName as r } from "./debugCookie.mjs";
4
- import i from "./interactionLog.mjs";
5
- import a, { createStoreDevToolsLogger as o, pConsole as s } from "./utils/PlitziConsole.mjs";
6
- export { t as DEV_TOOLS_ATTRIBUTE, e as DevToolsContext, n as HIDE_DEV_TOOLS_CSS, a as PlitziConsole, o as createStoreDevToolsLogger, r as debugCookieName, i as isInteractionFlow, s as pConsole };
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,4 +1,4 @@
1
- import { Log, ProviderCallback } from '../types';
1
+ import { Log, ProviderCallback } from '../../types';
2
2
  import { Dispatch, SetStateAction } from 'react';
3
3
  export type DevToolsContextValue = {
4
4
  providers: Record<string, ProviderCallback>;
@@ -1,4 +1,4 @@
1
- import { sharedContext as e } from "../helpers/sharedContext.mjs";
1
+ import { sharedContext as e } from "../../helpers/sharedContext.mjs";
2
2
  var t = e("DevToolsContext", {
3
3
  logs: [],
4
4
  providers: {}
@@ -0,0 +1,3 @@
1
+ /** devTools's React bindings — apart from `@plitzi/sdk-shared/devTools`, which a server imports without React's hooks and contexts. */
2
+ export { default as DevToolsContext } from './DevToolsContext';
3
+ export * from './DevToolsContext';
@@ -0,0 +1 @@
1
+ export { default as DevToolsContext } from "./DevToolsContext.mjs";
@@ -1,16 +1,16 @@
1
- import { cookieFromHeader as e } from "../helpers/cookies.mjs";
2
- import { isFlagName as t } from "./schemaFlag.mjs";
1
+ import { isFlagName as e } from "./schemaFlag.mjs";
2
+ import { cookieFromHeader as t } from "../helpers/cookies.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 = (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) => {
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) => {
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 = (t, i) => r(e(t, n(i))), s = (e, t) => {
13
+ }, o = (e, i) => r(t(e, 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,5 +1,3 @@
1
1
  export * from './schemaFlag';
2
2
  export * from './resolveFlags';
3
3
  export * from './flagsCookie';
4
- export * from './useFlagResolution';
5
- export { default as useFlagResolution } from './useFlagResolution';
@@ -1,5 +1,4 @@
1
1
  import { FLAG_GATE_PATTERN as e, FLAG_NAME_PATTERN as t, isFlagName as n, isSchemaFlag as r } from "./schemaFlag.mjs";
2
2
  import { flagsCookieName as i, forcedFlagsFromCookies as a, parseFlagList as o, serializeFlagList as s, withForcedFlag as c, writeForcedFlags as l } from "./flagsCookie.mjs";
3
- import { FLAG_LAYERS as u, flagUserFromSSR as d, flagValues as f, hasConditions as p, passesFlagGate as m, resolveFlags as h, undeclaredFlagOverrides as g } from "./resolveFlags.mjs";
4
- import _, { flagUserFrom as v } from "./useFlagResolution.mjs";
5
- export { e as FLAG_GATE_PATTERN, u as FLAG_LAYERS, t as FLAG_NAME_PATTERN, v as flagUserFrom, d as flagUserFromSSR, f as flagValues, i as flagsCookieName, a as forcedFlagsFromCookies, p as hasConditions, n as isFlagName, r as isSchemaFlag, o as parseFlagList, m as passesFlagGate, h as resolveFlags, s as serializeFlagList, g as undeclaredFlagOverrides, _ as useFlagResolution, c as withForcedFlag, l as writeForcedFlags };
3
+ import { FLAG_LAYERS as u, flagUserFrom as d, flagUserFromSSR as f, flagValues as p, hasConditions as m, passesFlagGate as h, resolveFlags as g, undeclaredFlagOverrides as _ } from "./resolveFlags.mjs";
4
+ export { e as FLAG_GATE_PATTERN, u as FLAG_LAYERS, t as FLAG_NAME_PATTERN, d as flagUserFrom, f as flagUserFromSSR, p as flagValues, i as flagsCookieName, a as forcedFlagsFromCookies, m as hasConditions, n as isFlagName, r as isSchemaFlag, o as parseFlagList, h as passesFlagGate, g as resolveFlags, s as serializeFlagList, _ as undeclaredFlagOverrides, c as withForcedFlag, l as writeForcedFlags };
@@ -0,0 +1,3 @@
1
+ /** flags's React bindings — apart from `@plitzi/sdk-shared/flags`, which a server imports without React's hooks and contexts. */
2
+ export { default as useFlagResolution } from './useFlagResolution';
3
+ export * from './useFlagResolution';
@@ -0,0 +1 @@
1
+ export { default as useFlagResolution } from "./useFlagResolution.mjs";
@@ -1,7 +1,5 @@
1
- import { AuthContextValue } from '../types';
2
- import { FlagResolution, FlagUser } from './resolveFlags';
3
- /** The visitor as a flag's rule sees them, from what auth knows. */
4
- export declare const flagUserFrom: ({ authenticated, user }: Partial<Pick<AuthContextValue, "authenticated" | "user">>) => FlagUser;
1
+ import { AuthContextValue } from '../../types';
2
+ import { FlagResolution } from '../resolveFlags';
5
3
  /**
6
4
  * Every declared flag, resolved for where this render is and who is looking.
7
5
  *
@@ -0,0 +1,35 @@
1
+ import { flagUserFrom as e, resolveFlags as t } from "../resolveFlags.mjs";
2
+ import n from "../../hooks/useStableValue.mjs";
3
+ import { useCommonStore as r } from "../../store/storeHooks.mjs";
4
+ import i from "../../store/renderSettings.mjs";
5
+ import { useMemo as a } from "react";
6
+ //#region src/flags/react/useFlagResolution.ts
7
+ var o = (o) => {
8
+ let { environment: s } = i(), [[c, l, u, d, f]] = r([
9
+ "schema.flags",
10
+ "navigation.routeParams",
11
+ "navigation.queryParams",
12
+ "navigation.hostname",
13
+ "flags.overrides"
14
+ ]), { authenticated: p, user: m } = o, h = a(() => e({
15
+ authenticated: p,
16
+ user: m
17
+ }), [p, m]);
18
+ return n(a(() => t(c, {
19
+ environment: s,
20
+ hostname: d,
21
+ routeParams: l,
22
+ queryParams: u,
23
+ user: h
24
+ }, f), [
25
+ c,
26
+ s,
27
+ d,
28
+ l,
29
+ u,
30
+ h,
31
+ f
32
+ ]));
33
+ };
34
+ //#endregion
35
+ export { o as default };
@@ -1,6 +1,6 @@
1
1
  import { VariableScope } from '../dataSource/resolveVariables';
2
2
  import { RuleGroup } from '../helpers/ruleEvaluator';
3
- import { Schema, SSRUser } from '../types';
3
+ import { AuthContextValue, Schema, SSRUser } from '../types';
4
4
  /**
5
5
  * Who decided a flag, weakest first: the space's own declaration, then the server rendering it, then the SDK
6
6
  * embedding it, then a tester with the dev tools open. Each layer only ever answers for a flag the space declares.
@@ -17,6 +17,8 @@ export type FlagUser = {
17
17
  username?: string;
18
18
  roles?: string[];
19
19
  };
20
+ /** The visitor as a flag's rule sees them, from what auth knows. */
21
+ export declare const flagUserFrom: ({ authenticated, user }: Partial<Pick<AuthContextValue, "authenticated" | "user">>) => FlagUser;
20
22
  /** The visitor a server resolved, as a flag's rule sees them — the same fields the browser's rules see. */
21
23
  export declare const flagUserFromSSR: (user: Pick<SSRUser, "email" | "username" | "roles"> | undefined) => FlagUser;
22
24
  /** What a flag's rules are matched against: everything a variable's are, and who is visiting. */
@@ -5,17 +5,25 @@ var t = [
5
5
  "server",
6
6
  "sdk",
7
7
  "qa"
8
- ], n = (e) => e ? {
8
+ ], n = ({ authenticated: e, user: t }) => {
9
+ let n = t?.details, r = { authenticated: e === !0 };
10
+ return n ? {
11
+ ...r,
12
+ email: n.email,
13
+ username: n.username,
14
+ roles: n.roles
15
+ } : r;
16
+ }, r = (e) => e ? {
9
17
  authenticated: !0,
10
18
  email: e.email,
11
19
  username: e.username,
12
20
  roles: e.roles
13
- } : { authenticated: !1 }, r = [
21
+ } : { authenticated: !1 }, i = [
14
22
  "server",
15
23
  "sdk",
16
24
  "qa"
17
- ], i = (e) => typeof e == "object" && !!e && "rules" in e && Array.isArray(e.rules) && e.rules.some((e) => typeof e == "object" && !!e && !("enabled" in e && e.enabled === !1)), a = (t, n) => Array.isArray(t.rules) ? t.rules.findIndex((t) => i(t.when) && e(t.when, n)) : -1, o = (e, t) => {
18
- let n = a(e, t);
25
+ ], a = (e) => typeof e == "object" && !!e && "rules" in e && Array.isArray(e.rules) && e.rules.some((e) => typeof e == "object" && !!e && !("enabled" in e && e.enabled === !1)), o = (t, n) => Array.isArray(t.rules) ? t.rules.findIndex((t) => a(t.when) && e(t.when, n)) : -1, s = (e, t) => {
26
+ let n = o(e, t);
19
27
  return n === -1 ? {
20
28
  value: e.value,
21
29
  layer: "space"
@@ -24,15 +32,15 @@ var t = [
24
32
  layer: "space",
25
33
  rule: n
26
34
  };
27
- }, s = (e, t = {}, n = {}) => Object.fromEntries(Object.entries(e ?? {}).map(([e, i]) => [e, r.reduce((t, r) => {
35
+ }, c = (e, t = {}, n = {}) => Object.fromEntries(Object.entries(e ?? {}).map(([e, r]) => [e, i.reduce((t, r) => {
28
36
  let i = n[r]?.[e];
29
37
  return typeof i == "boolean" ? {
30
38
  value: i,
31
39
  layer: r
32
40
  } : t;
33
- }, o(i, t))])), c = (e) => Object.fromEntries(Object.entries(e).map(([e, { value: t }]) => [e, t])), l = (e, t) => r.flatMap((n) => Object.keys(t[n] ?? {}).filter((t) => !Object.hasOwn(e ?? {}, t)).map((e) => ({
41
+ }, s(r, t))])), l = (e) => Object.fromEntries(Object.entries(e).map(([e, { value: t }]) => [e, t])), u = (e, t) => i.flatMap((n) => Object.keys(t[n] ?? {}).filter((t) => !Object.hasOwn(e ?? {}, t)).map((e) => ({
34
42
  layer: n,
35
43
  name: e
36
- }))), u = (e, t) => !e || (t[e.name] ?? !1) === e.is;
44
+ }))), d = (e, t) => !e || (t[e.name] ?? !1) === e.is;
37
45
  //#endregion
38
- export { t as FLAG_LAYERS, n as flagUserFromSSR, c as flagValues, i as hasConditions, u as passesFlagGate, s as resolveFlags, l as undeclaredFlagOverrides };
46
+ export { t as FLAG_LAYERS, n as flagUserFrom, r as flagUserFromSSR, l as flagValues, a as hasConditions, d as passesFlagGate, c as resolveFlags, u as undeclaredFlagOverrides };
@@ -1,5 +1,5 @@
1
1
  import { isRecord as e } from "./isRecord.mjs";
2
- import { omit as t } from "@plitzi/plitzi-ui/helpers";
2
+ import { omit as t } from "@plitzi/plitzi-ui/helpers/lodash";
3
3
  //#region src/helpers/generateFacade.tsx
4
4
  var n = (e) => e.replace(/^@/, "").replace(/[-/]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase()).replace(/\s+/g, ""), r = (t, n) => {
5
5
  let r = Reflect.get(window, t), i = e(r) ? r[n] : void 0;
@@ -4,9 +4,7 @@ import { default as syntaxHighlight } from './syntaxHighlight';
4
4
  export * from './cookies';
5
5
  export * from './eventTarget';
6
6
  export * from './fetchManifest';
7
- export * from './formatDate';
8
7
  export * from './interval';
9
- export * from './isDate';
10
8
  export * from './isRecord';
11
9
  export * from './generateFacade';
12
10
  export * from './reducerOrigin';
@@ -8,22 +8,20 @@ import { inspectTemplate as l } from "./twigWrapper/inspectTemplate.mjs";
8
8
  import { templatePaths as u, templateRootNames as d } from "./twigWrapper/templateRoots.mjs";
9
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
10
  import { sharedContext as v } from "./sharedContext.mjs";
11
- import y from "./fetchManifest.mjs";
12
- import b from "./generateFacade.mjs";
13
- import x from "./syntaxHighlight.mjs";
14
- import { cookieFromHeader as S, documentCookies as C } from "./cookies.mjs";
15
- import { elementOf as w, isElementTarget as T, isNodeTarget as E, nodeOf as D } from "./eventTarget.mjs";
16
- import { formatDate as O, formatDateUTC as k, formatFromNow as A, formatUTCToLocal as j, getDurationMs as M, isValidFormat as N, parseDate as P, toUnixSeconds as F } from "./formatDate.mjs";
17
- import { INTERVAL_TRIGGER as I, MIN_INTERVAL_MS as L, intervalOf as R } from "./interval.mjs";
18
- import { isDate as z } from "./isDate.mjs";
19
- import { isUserEdit as B } from "./reducerOrigin.mjs";
20
- import { evaluateRuleGroup as V } from "./ruleEvaluator.mjs";
21
- import { ParamsFromURL as H, delay as U, emptyObject as W, getDisplayName as G, getKeyDecoded as K, getPathsFromObject as q, hexToRGB as J, isInViewport as Y, makeId as X } from "./utils.mjs";
22
- import { disableReactDevTools as Z } from "./security.mjs";
23
- import { EnclosingSpaceContext as Q } from "./enclosingSpace.mjs";
24
- import { canonicalJson as $ } from "./canonicalJson.mjs";
25
- import { SPACE_ROOT_CLASS as ee, spaceRootOf as te } from "./spaceRoot.mjs";
26
- import { IMAGE_PATH as ne, IMAGE_WIDTHS as re, imageSrcSet as ie, imageUrl as ae, isImageWidth as oe, isRemoteImage as se, isResizableImage as ce } from "./images.mjs";
27
- import { KEY_TRIGGER as le, isFieldEditing as ue, keyPressCombo as de, parseKeys as fe } from "./keys.mjs";
28
- import { NOT_COPIED_REASON as pe, clipboardWriter as me, copyText as he } from "./clipboard.mjs";
29
- export { Q as EnclosingSpaceContext, ne as IMAGE_PATH, re as IMAGE_WIDTHS, I as INTERVAL_TRIGGER, le as KEY_TRIGGER, s as MAX_PARAM_PASSES, L as MIN_INTERVAL_MS, pe as NOT_COPIED_REASON, H as ParamsFromURL, f as SCROLL_BEHAVIORS, p as SCROLL_POSITIONS, m as SCROLL_TRIGGER, ee as SPACE_ROOT_CLASS, $ as canonicalJson, me as clipboardWriter, S as cookieFromHeader, he as copyText, U as delay, Z as disableReactDevTools, C as documentCookies, w as elementOf, W as emptyObject, V as evaluateRuleGroup, y as fetchManifest, t as filters, O as formatDate, k as formatDateUTC, A as formatFromNow, j as formatUTCToLocal, b as generateFacade, G as getDisplayName, M as getDurationMs, K as getKeyDecoded, q as getPathsFromObject, a as hasTemplateSyntax, o as hasValidToken, J as hexToRGB, ie as imageSrcSet, ae as imageUrl, l as inspectTemplate, R as intervalOf, z as isDate, T as isElementTarget, ue as isFieldEditing, oe as isImageWidth, Y as isInViewport, E as isNodeTarget, e as isRecord, se as isRemoteImage, ce as isResizableImage, B as isUserEdit, N as isValidFormat, de as keyPressCombo, X as makeId, D as nodeOf, P as parseDate, fe 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, te as spaceRootOf, x as syntaxHighlight, u as templatePaths, d as templateRootNames, F as toUnixSeconds };
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 };
@@ -1,14 +1,14 @@
1
- import { RuleGroup, RuleValue } from '@plitzi/plitzi-ui/QueryBuilder';
1
+ import { RuleGroup, RuleValue } from '@plitzi/plitzi-ui/QueryBuilder/evaluator';
2
2
  /**
3
3
  * Evaluates a `when` rule group against a value bag.
4
4
  *
5
5
  * A rule group has to be evaluated on both sides — the browser for an interaction, the server for an action — and
6
6
  * the only implementation lives in `plitzi-ui`. This wrapper exists for two reasons beyond naming:
7
7
  *
8
- * - the `@plitzi/plitzi-ui/QueryBuilder` BARREL pulls the React components with it, which is the boot weight the
9
- * MCP already paid for once. `/QueryBuilder/helpers` carries the evaluator and nothing that renders;
8
+ * - the `@plitzi/plitzi-ui/QueryBuilder` BARREL pulls the React components with it, and `/QueryBuilder/helpers` the
9
+ * SQL and MongoDB formatters; `/QueryBuilder/evaluator` is the evaluator alone, which is all a server loads;
10
10
  * - it keeps `plitzi-ui` out of the server's dependency list. `sdk-shared` already depends on it, so the chain is
11
11
  * declared in exactly one place.
12
12
  */
13
13
  export declare const evaluateRuleGroup: (group: RuleGroup, values: Record<string, RuleValue>) => boolean;
14
- export type { Rule, RuleGroup, RuleValue } from '@plitzi/plitzi-ui/QueryBuilder';
14
+ export type { Rule, RuleGroup, RuleValue } from '@plitzi/plitzi-ui/QueryBuilder/evaluator';
@@ -1,4 +1,4 @@
1
- import { QueryBuilderEvaluator as e } from "@plitzi/plitzi-ui/QueryBuilder/helpers";
1
+ import { QueryBuilderEvaluator as e } from "@plitzi/plitzi-ui/QueryBuilder/evaluator";
2
2
  //#region src/helpers/ruleEvaluator.ts
3
3
  var t = (t, n) => !!e(t, n);
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { get as e } from "@plitzi/plitzi-ui/helpers";
1
+ import { get as e } from "@plitzi/plitzi-ui/helpers/lodash";
2
2
  //#region src/helpers/utils.ts
3
3
  function t(e) {
4
4
  return e && (e.displayName || e.name) || "Component";
@@ -1,4 +1 @@
1
- import { default as PluginsContext } from './PluginsContext';
2
- export * from './PluginsContext';
3
1
  export * from './declaration';
4
- export { PluginsContext };
@@ -1,3 +1 @@
1
- import e from "./PluginsContext.mjs";
2
- import { pluginDeclarationOf as t, pluginTypesOf as n } from "./declaration.mjs";
3
- export { e as PluginsContext, t as pluginDeclarationOf, n as pluginTypesOf };
1
+ export { pluginDeclarationOf, pluginTypesOf } from "./declaration.mjs";
@@ -1,3 +1,3 @@
1
- import { PluginsContextValue } from '../types';
1
+ import { PluginsContextValue } from '../../types';
2
2
  declare const PluginsContext: import('react').Context<PluginsContextValue>;
3
3
  export default PluginsContext;
@@ -1,4 +1,4 @@
1
- import { sharedContext as e } from "../helpers/sharedContext.mjs";
1
+ import { sharedContext as e } from "../../helpers/sharedContext.mjs";
2
2
  var t = e("PluginsContext", { assets: {} });
3
3
  //#endregion
4
4
  export { t as default };
@@ -0,0 +1,3 @@
1
+ /** plugins's React bindings — apart from `@plitzi/sdk-shared/plugins`, which a server imports without React's hooks and contexts. */
2
+ export { default as PluginsContext } from './PluginsContext';
3
+ export * from './PluginsContext';
@@ -0,0 +1 @@
1
+ export { default as PluginsContext } from "./PluginsContext.mjs";
@@ -1,5 +1,5 @@
1
- import { AUTHOR_FILE as e, BUILD_DIR as t, CLI_DIR as n, DATA_DIR as r, DEV_SERVER_FILE as i, FUNCTIONS_DIR as a, KV_FILE as o, PLUGINS_DIR as s, PLUGIN_DECLARATION_FILE as c, PLUGIN_ENTRIES as l, PLUGIN_FUNCTIONS_DIR as u, PLUGIN_MANIFEST_FILE as d, PROJECT_STATE as f, PROJECT_TMP as p, PUBLIC_DIR as m, RUNTIME_BUNDLE as h, RUNTIME_DIR as g, RUNTIME_ENTRY as _, SOURCE_DIR as v, SPACE_DIR as y, SPACE_ENTRY as b, VENDOR_PLUGINS_DIR as x } from "./paths.mjs";
2
- import { PROJECT_LAYOUT_CODES as S, ProjectLayoutError as C, assertProjectLayout as w, checkPluginFolder as T, checkProjectLayout as E, elementEntry as D, layoutFindingText as O, pluginEntry as k, pluginTypeOf as A, readVendorPlugin as j } from "./layout.mjs";
3
- import { localNetworkName as M, networkAddresses as N } from "./network.mjs";
4
- import { ProjectRootError as P, checkProjectRoot as F, projectModule as I, projectRoot as L } from "./root.mjs";
5
- export { e as AUTHOR_FILE, t as BUILD_DIR, n as CLI_DIR, r as DATA_DIR, i as DEV_SERVER_FILE, a as FUNCTIONS_DIR, o as KV_FILE, s as PLUGINS_DIR, c as PLUGIN_DECLARATION_FILE, l as PLUGIN_ENTRIES, u as PLUGIN_FUNCTIONS_DIR, d as PLUGIN_MANIFEST_FILE, S as PROJECT_LAYOUT_CODES, f as PROJECT_STATE, p as PROJECT_TMP, m as PUBLIC_DIR, C as ProjectLayoutError, P as ProjectRootError, h as RUNTIME_BUNDLE, g as RUNTIME_DIR, _ as RUNTIME_ENTRY, v as SOURCE_DIR, y as SPACE_DIR, b as SPACE_ENTRY, x as VENDOR_PLUGINS_DIR, w as assertProjectLayout, T as checkPluginFolder, E as checkProjectLayout, F as checkProjectRoot, D as elementEntry, O as layoutFindingText, M as localNetworkName, N as networkAddresses, k as pluginEntry, A as pluginTypeOf, I as projectModule, L as projectRoot, j as readVendorPlugin };
1
+ import { AUTHOR_FILE as e, BUILD_DIR as t, CLI_DIR as n, DATA_DIR as r, DEV_SERVER_FILE as i, FUNCTIONS_DIR as a, KV_FILE as o, PLUGINS_DIR as s, PLUGIN_DECLARATION_FILE as c, PLUGIN_ENTRIES as l, PLUGIN_FUNCTIONS_DIR as u, PLUGIN_MANIFEST_FILE as d, PROJECT_DATA_PREFIX as f, PROJECT_STATE as p, PROJECT_TMP as m, PUBLIC_DIR as h, RUNTIME_BUNDLE as g, RUNTIME_DIR as _, RUNTIME_ENTRY as v, SOURCE_DIR as y, SPACE_DIR as b, SPACE_ENTRY as x, VENDOR_PLUGINS_DIR as S } from "./paths/index.mjs";
2
+ import { PROJECT_LAYOUT_CODES as C, ProjectLayoutError as w, assertProjectLayout as T, checkPluginFolder as E, checkProjectLayout as D, elementEntry as O, layoutFindingText as k, pluginEntry as A, pluginTypeOf as j, readVendorPlugin as M } from "./layout.mjs";
3
+ import { localNetworkName as N, networkAddresses as P } from "./network.mjs";
4
+ import { ProjectRootError as F, checkProjectRoot as I, projectModule as L, projectRoot as R } from "./root.mjs";
5
+ export { e as AUTHOR_FILE, t as BUILD_DIR, n as CLI_DIR, r as DATA_DIR, i as DEV_SERVER_FILE, a as FUNCTIONS_DIR, o as KV_FILE, s as PLUGINS_DIR, c as PLUGIN_DECLARATION_FILE, l as PLUGIN_ENTRIES, u as PLUGIN_FUNCTIONS_DIR, d as PLUGIN_MANIFEST_FILE, f as PROJECT_DATA_PREFIX, C as PROJECT_LAYOUT_CODES, p as PROJECT_STATE, m as PROJECT_TMP, h as PUBLIC_DIR, w as ProjectLayoutError, F as ProjectRootError, g as RUNTIME_BUNDLE, _ as RUNTIME_DIR, v as RUNTIME_ENTRY, y as SOURCE_DIR, b as SPACE_DIR, x as SPACE_ENTRY, S as VENDOR_PLUGINS_DIR, T as assertProjectLayout, E as checkPluginFolder, D as checkProjectLayout, I as checkProjectRoot, O as elementEntry, k as layoutFindingText, N as localNetworkName, P as networkAddresses, A as pluginEntry, j as pluginTypeOf, L as projectModule, R as projectRoot, M as readVendorPlugin };
@@ -1,5 +1,5 @@
1
1
  import { isRecord as e } from "../helpers/isRecord.mjs";
2
- import { AUTHOR_FILE as t, DATA_DIR as n, FUNCTIONS_DIR as r, PLUGINS_DIR as i, PLUGIN_DECLARATION_FILE as a, PLUGIN_ENTRIES as o, PLUGIN_FUNCTIONS_DIR as s, PLUGIN_MANIFEST_FILE as c, PUBLIC_DIR as l, RUNTIME_DIR as u, SPACE_DIR as d, SPACE_ENTRY as f, VENDOR_PLUGINS_DIR as p } from "./paths.mjs";
2
+ import { AUTHOR_FILE as t, DATA_DIR as n, FUNCTIONS_DIR as r, PLUGINS_DIR as i, PLUGIN_DECLARATION_FILE as a, PLUGIN_ENTRIES as o, PLUGIN_FUNCTIONS_DIR as s, PLUGIN_MANIFEST_FILE as c, PUBLIC_DIR as l, RUNTIME_DIR as u, SPACE_DIR as d, SPACE_ENTRY as f, VENDOR_PLUGINS_DIR as p } from "./paths/index.mjs";
3
3
  import m from "node:path";
4
4
  import { readFileSync as h, readdirSync as g, statSync as _ } from "node:fs";
5
5
  //#region src/project/layout.ts
@@ -1,5 +1,6 @@
1
1
  /**
2
- * The layout of a project `@plitzi/cli` writes, relative to its root: the one place the CLI that writes and checks it,
2
+ * The layout of a project `@plitzi/cli` writes, relative to its root — names alone, nothing of Node, so a browser imports
3
+ * them too (`@plitzi/sdk-shared/project/paths`; the folder above it is Node only): the one place the CLI that writes and checks it,
3
4
  * the server that serves it (`@plitzi/sdk-server/project`) and the authoring that checks its space
4
5
  * (`@plitzi/sdk-authoring/node`'s `projectAuthoring`) read it from.
5
6
  *
@@ -59,6 +60,12 @@ export declare const PUBLIC_DIR = "public";
59
60
  * `/data/<file>` on the server. A project with no server keeps it in `public/data/`, where the browser fetches it.
60
61
  */
61
62
  export declare const DATA_DIR = "src/data";
63
+ /**
64
+ * Where a project's own data answers: a provider whose `query` is `/data/<file>` reads `<file>` from the folder the
65
+ * server keeps it in (`dataDir`), which is never served — so only a provider resolved on the server reads it. The
66
+ * server's resolver and the authoring check that refuses a browser read hold the same prefix.
67
+ */
68
+ export declare const PROJECT_DATA_PREFIX = "/data/";
62
69
  /** The project's own server code — the tasks and `/fn/` routes `defineFunctions` declares — built at boot. */
63
70
  export declare const FUNCTIONS_DIR = "src/functions";
64
71
  /**
@@ -0,0 +1,4 @@
1
+ //#region src/project/paths/index.ts
2
+ var e = "tmp", t = "src", n = "plitzi", r = `${n}/author.ts`, i = "src/space", a = `${i}/index.ts`, o = "src/plugins", s = ["index.ts", "index.tsx"], c = "declaration.ts", l = "functions", u = "vendor/plugins", d = "plugin-manifest.json", f = "vendor/runtime.bundle", p = "public", m = "src/data", h = "/data/", g = "src/functions", _ = "src/runtime", v = `${_}/index.ts`, y = "dist", b = "state", x = `${b}/kv.json`, S = "tmp/dev-server.json";
3
+ //#endregion
4
+ export { r as AUTHOR_FILE, y as BUILD_DIR, n as CLI_DIR, m as DATA_DIR, S as DEV_SERVER_FILE, g as FUNCTIONS_DIR, x as KV_FILE, o as PLUGINS_DIR, c as PLUGIN_DECLARATION_FILE, s as PLUGIN_ENTRIES, l as PLUGIN_FUNCTIONS_DIR, d as PLUGIN_MANIFEST_FILE, h as PROJECT_DATA_PREFIX, b as PROJECT_STATE, e as PROJECT_TMP, p as PUBLIC_DIR, f as RUNTIME_BUNDLE, _ as RUNTIME_DIR, v as RUNTIME_ENTRY, t as SOURCE_DIR, i as SPACE_DIR, a as SPACE_ENTRY, u as VENDOR_PLUGINS_DIR };
@@ -1,4 +1,4 @@
1
- import { BUILD_DIR as e } from "./paths.mjs";
1
+ import { BUILD_DIR as e } from "./paths/index.mjs";
2
2
  import t from "node:path";
3
3
  import { existsSync as n, realpathSync as r } from "node:fs";
4
4
  //#region src/project/root.ts
@@ -1,11 +1,8 @@
1
- import { default as SchemaContext } from './SchemaContext';
2
1
  export * from './anchor';
3
2
  export * from './schemaConstants';
4
- export * from './SchemaContext';
5
3
  export * from './layoutChain';
6
4
  export * from './serverElements';
7
5
  export * from './snippet';
8
- export { SchemaContext };
9
6
  export * from './motion';
10
7
  export * from './motionReveal';
11
8
  export * from './wire';