@plitzi/sdk-shared 0.38.3 → 0.38.5

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 (86) hide show
  1. package/CHANGELOG.md +522 -0
  2. package/dist/actions/functions.d.ts +10 -0
  3. package/dist/actions/functions.mjs +10 -10
  4. package/dist/actions/index.d.ts +1 -1
  5. package/dist/actions/index.mjs +6 -6
  6. package/dist/authoring/elementCallbacks.d.ts +2 -2
  7. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  8. package/dist/devTools/chrome.d.ts +8 -0
  9. package/dist/devTools/chrome.mjs +4 -0
  10. package/dist/devTools/index.d.ts +1 -0
  11. package/dist/devTools/index.mjs +5 -4
  12. package/dist/helpers/images.d.ts +5 -0
  13. package/dist/helpers/images.mjs +2 -2
  14. package/dist/helpers/twigWrapper/inspectTemplate.mjs +14 -7
  15. package/dist/helpers/twigWrapper/processTwig/processTwig.d.ts +4 -3
  16. package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +32 -22
  17. package/dist/history/types.d.ts +4 -4
  18. package/dist/index.mjs +56 -54
  19. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.d.ts +10 -0
  20. package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +4 -0
  21. package/dist/network/graphql/builder/Mutations/index.d.ts +2 -0
  22. package/dist/network/graphql/builder/Mutations/index.mjs +124 -122
  23. package/dist/network/graphql/builder/Queries/InitQuery.d.ts +1 -3
  24. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -1
  25. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.d.ts +6 -0
  26. package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +4 -0
  27. package/dist/network/graphql/builder/Queries/index.d.ts +2 -0
  28. package/dist/network/graphql/builder/Queries/index.mjs +22 -20
  29. package/dist/network/spaceEvents.d.ts +2 -2
  30. package/dist/plugins/bundle.d.ts +26 -0
  31. package/dist/plugins/bundle.mjs +62 -0
  32. package/dist/plugins/declaration.d.ts +12 -0
  33. package/dist/plugins/declaration.mjs +9 -0
  34. package/dist/queries/queryCache.d.ts +7 -0
  35. package/dist/queries/queryCache.mjs +14 -7
  36. package/dist/queries/useQuery.d.ts +2 -0
  37. package/dist/queries/useQuery.mjs +5 -2
  38. package/dist/schema/anchor.d.ts +11 -0
  39. package/dist/schema/anchor.mjs +6 -2
  40. package/dist/schema/index.mjs +6 -6
  41. package/dist/schema/markdownHeadings.d.ts +13 -0
  42. package/dist/schema/markdownHeadings.mjs +24 -0
  43. package/dist/schema/motion.d.ts +47 -15
  44. package/dist/schema/motion.mjs +208 -32
  45. package/dist/schema/motionReveal.d.ts +10 -0
  46. package/dist/schema/motionReveal.mjs +23 -0
  47. package/dist/schema/pageElements.d.ts +12 -0
  48. package/dist/schema/pageElements.mjs +41 -0
  49. package/dist/schema/wire.mjs +4 -3
  50. package/dist/server/index.mjs +4 -4
  51. package/dist/server/rsc/projectData.d.ts +6 -0
  52. package/dist/server/rsc/projectData.mjs +4 -0
  53. package/dist/server/rsc/refreshRsc.d.ts +18 -5
  54. package/dist/server/rsc/refreshRsc.mjs +80 -20
  55. package/dist/server/rsc/useRscSync.mjs +26 -15
  56. package/dist/server/usePluginRoute.d.ts +18 -0
  57. package/dist/server/usePluginRoute.mjs +14 -0
  58. package/dist/source/export.d.ts +18 -0
  59. package/dist/source/import.d.ts +55 -0
  60. package/dist/source/import.mjs +4 -0
  61. package/dist/source/index.d.ts +2 -0
  62. package/dist/source/index.mjs +3 -2
  63. package/dist/store/index.d.ts +45 -45
  64. package/dist/style/cssLayers.d.ts +18 -0
  65. package/dist/style/cssLayers.mjs +14 -0
  66. package/dist/style/index.d.ts +1 -0
  67. package/dist/style/index.mjs +11 -10
  68. package/dist/style/styleConstants.d.ts +10 -2
  69. package/dist/style/styleConstants.mjs +16 -0
  70. package/dist/style/useDisplayMode.d.ts +11 -0
  71. package/dist/style/useDisplayMode.mjs +18 -0
  72. package/dist/types/ActionTypes.d.ts +3 -3
  73. package/dist/types/ComponentTypes.d.ts +13 -0
  74. package/dist/types/DataTypes.d.ts +36 -0
  75. package/dist/types/InteractionTypes.d.ts +16 -2
  76. package/dist/types/SchemaTypes.d.ts +10 -2
  77. package/dist/types/SchemaTypes.mjs +2 -1
  78. package/dist/types/ServerTypes.d.ts +60 -8
  79. package/dist/types/StoreTypes.d.ts +19 -6
  80. package/dist/types/index.d.ts +1 -2
  81. package/package.json +58 -28
  82. package/setupTests.ts +16 -13
  83. package/dist/types/AITypes.d.ts +0 -80
  84. package/dist/types/McpTypes/index.d.ts +0 -56
  85. package/dist/types/McpTypes/index.mjs +0 -0
  86. /package/dist/types/{AITypes.mjs → DataTypes.mjs} +0 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The cascade layers the SDK's stylesheets are written in, lowest first — declared once by `plitzi-sdk.css` and the
3
+ * builder's canvas, and again by the runtime stylesheet for a page that loads neither.
4
+ *
5
+ * A plugin's own stylesheet sits BELOW the space's: what the space writes about an element — its classes, `customCss`
6
+ * — wins over the defaults the element's author shipped, whatever their specificity, as it does for a built-in
7
+ * element. Above, a space's `customCss` hiding a marker inside a map lost to the plugin's `.marker { display: flex }`.
8
+ */
9
+ export declare const PLUGIN_CSS_LAYER = "plitzi-sdk-plugin";
10
+ export declare const RUNTIME_CSS_LAYER = "plitzi-sdk-runtime";
11
+ /**
12
+ * A plugin's stylesheet, as it ships: everything in it in {@link PLUGIN_CSS_LAYER}. Written by whatever builds a
13
+ * plugin — a server compiling one, `plitzi pack plugin` — so every way the file later reaches a page (a `<link>` in the
14
+ * server's HTML, the SDK's assets, the builder's canvas) puts it in its place with no work of its own.
15
+ *
16
+ * Idempotent: a stylesheet already wrapped is returned as it is.
17
+ */
18
+ export declare const inPluginLayer: (css: string, layer?: string) => string;
@@ -0,0 +1,14 @@
1
+ //#region src/style/cssLayers.ts
2
+ var e = "plitzi-sdk-plugin", t = "plitzi-sdk-runtime", n = /^\s*(@charset\s[^;]*;|@import\s[^;]*;|\/\*[\s\S]*?\*\/)/, r = (e, t) => {
3
+ let n = /^@import\s+(url\([^)]*\)|"[^"]*"|'[^']*')([^;]*);$/.exec(e.trim());
4
+ return !n || /\blayer\b/.test(n[2]) ? e : `@import ${n[1]} layer(${t})${n[2]};`;
5
+ }, i = (t, i = e) => {
6
+ let a = t, o = "";
7
+ for (let e = n.exec(a); e; e = n.exec(a)) {
8
+ let t = e[1];
9
+ o += t.startsWith("@import") ? r(t, i) : t, a = a.slice(e[0].length);
10
+ }
11
+ return a.trimStart().startsWith(`@layer ${i}`) ? t : a.trim() ? `${o}@layer ${i}{${a}}` : o;
12
+ };
13
+ //#endregion
14
+ export { e as PLUGIN_CSS_LAYER, t as RUNTIME_CSS_LAYER, i as inPluginLayer };
@@ -1,5 +1,6 @@
1
1
  import { default as styleConstants } from './styleConstants';
2
2
  export * from './breakpoints';
3
+ export * from './cssLayers';
3
4
  export * from './displayModes';
4
5
  export * from './fontAssets';
5
6
  export * from './fontValidation';
@@ -1,12 +1,13 @@
1
1
  import e, { EMPTY_STYLE_SCHEMA as t, StyleBindingsAllowed as n, baseDefaultValue as r, inheritableAttributesBase as i } from "./styleConstants.mjs";
2
2
  import { DISPLAY_MODE_MIN_WIDTH as a, displayModeAt as o, displayModeWidthRem as s } from "./breakpoints.mjs";
3
- import { DISPLAY_MODES as c, isDisplayMode as l } from "./displayModes.mjs";
4
- import { fontLinkAssets as u } from "./fontAssets.mjs";
5
- import { SYSTEM_FONTS as d, availableFonts as f, familiesInCss as p, fontFamilyStack as m, fontUrlResolver as h, fontsToHead as g, googleCss2Url as _, googleTextSubsetUrl as v, isSafeFontUrl as y, primaryFamily as b } from "./fonts.mjs";
6
- import { FontValidationError as x, parseSpaceFont as S } from "./fontValidation.mjs";
7
- import { fallbackForFamily as C, fontsFromCss as w } from "./fontsFromCss.mjs";
8
- import { LAYOUT_GRIDS as T, layoutGridCss as E, layoutGridLook as D } from "./layoutGrid.mjs";
9
- import { RUNTIME_STYLE_ID as O, markStyleCache as k, styleCacheFromDocument as A, styleCacheTravelsInDocument as j } from "./runtimeStyle.mjs";
10
- import { mergeSnippetStyle as M, sameSelector as N, selectorsOf as P } from "./snippetStyle.mjs";
11
- import { CURRENT_PAGE_SELECTOR as F, HIDDEN_CLASS as I, STYLE_STATES as L, STYLE_STATE_LABELS as R, inCascadeOrder as z, isKnownState as B, isStartingState as V, stateSuffix as H } from "./styleStates.mjs";
12
- export { F as CURRENT_PAGE_SELECTOR, c as DISPLAY_MODES, a as DISPLAY_MODE_MIN_WIDTH, t as EMPTY_STYLE_SCHEMA, x as FontValidationError, I as HIDDEN_CLASS, T as LAYOUT_GRIDS, O as RUNTIME_STYLE_ID, L as STYLE_STATES, R as STYLE_STATE_LABELS, d as SYSTEM_FONTS, n as StyleBindingsAllowed, f as availableFonts, r as baseDefaultValue, o as displayModeAt, s as displayModeWidthRem, C as fallbackForFamily, p as familiesInCss, m as fontFamilyStack, u as fontLinkAssets, h as fontUrlResolver, w as fontsFromCss, g as fontsToHead, _ as googleCss2Url, v as googleTextSubsetUrl, z as inCascadeOrder, i as inheritableAttributesBase, l as isDisplayMode, B as isKnownState, y as isSafeFontUrl, V as isStartingState, E as layoutGridCss, D as layoutGridLook, k as markStyleCache, M as mergeSnippetStyle, S as parseSpaceFont, b as primaryFamily, N as sameSelector, P as selectorsOf, H as stateSuffix, A as styleCacheFromDocument, j as styleCacheTravelsInDocument, e as styleConstants };
3
+ import { PLUGIN_CSS_LAYER as c, RUNTIME_CSS_LAYER as l, inPluginLayer as u } from "./cssLayers.mjs";
4
+ import { DISPLAY_MODES as d, isDisplayMode as f } from "./displayModes.mjs";
5
+ import { fontLinkAssets as p } from "./fontAssets.mjs";
6
+ import { SYSTEM_FONTS as m, availableFonts as h, familiesInCss as g, fontFamilyStack as _, fontUrlResolver as v, fontsToHead as y, googleCss2Url as b, googleTextSubsetUrl as x, isSafeFontUrl as S, primaryFamily as C } from "./fonts.mjs";
7
+ import { FontValidationError as w, parseSpaceFont as T } from "./fontValidation.mjs";
8
+ import { fallbackForFamily as E, fontsFromCss as D } from "./fontsFromCss.mjs";
9
+ import { LAYOUT_GRIDS as O, layoutGridCss as k, layoutGridLook as A } from "./layoutGrid.mjs";
10
+ import { RUNTIME_STYLE_ID as j, markStyleCache as M, styleCacheFromDocument as N, styleCacheTravelsInDocument as P } from "./runtimeStyle.mjs";
11
+ import { mergeSnippetStyle as F, sameSelector as I, selectorsOf as L } from "./snippetStyle.mjs";
12
+ import { CURRENT_PAGE_SELECTOR as R, HIDDEN_CLASS as z, STYLE_STATES as B, STYLE_STATE_LABELS as V, inCascadeOrder as H, isKnownState as U, isStartingState as W, stateSuffix as G } from "./styleStates.mjs";
13
+ export { R as CURRENT_PAGE_SELECTOR, d as DISPLAY_MODES, a as DISPLAY_MODE_MIN_WIDTH, t as EMPTY_STYLE_SCHEMA, w as FontValidationError, z as HIDDEN_CLASS, O as LAYOUT_GRIDS, c as PLUGIN_CSS_LAYER, l as RUNTIME_CSS_LAYER, j as RUNTIME_STYLE_ID, B as STYLE_STATES, V as STYLE_STATE_LABELS, m as SYSTEM_FONTS, n as StyleBindingsAllowed, h as availableFonts, r as baseDefaultValue, o as displayModeAt, s as displayModeWidthRem, E as fallbackForFamily, g as familiesInCss, _ as fontFamilyStack, p as fontLinkAssets, v as fontUrlResolver, D as fontsFromCss, y as fontsToHead, b as googleCss2Url, x as googleTextSubsetUrl, H as inCascadeOrder, u as inPluginLayer, i as inheritableAttributesBase, f as isDisplayMode, U as isKnownState, S as isSafeFontUrl, W as isStartingState, k as layoutGridCss, A as layoutGridLook, M as markStyleCache, F as mergeSnippetStyle, T as parseSpaceFont, C as primaryFamily, I as sameSelector, L as selectorsOf, G as stateSuffix, N as styleCacheFromDocument, P as styleCacheTravelsInDocument, e as styleConstants };
@@ -94,7 +94,13 @@ declare const styleConstants: {
94
94
  readonly CLIP_PATH: "clip-path";
95
95
  readonly TRANSFORM: "transform";
96
96
  readonly TRANSFORM_ORIGIN: "transform-origin";
97
+ readonly TRANSLATE: "translate";
98
+ readonly ROTATE: "rotate";
99
+ readonly SCALE: "scale";
100
+ readonly TRANSFORM_STYLE: "transform-style";
97
101
  readonly PERSPECTIVE: "perspective";
102
+ readonly PERSPECTIVE_ORIGIN: "perspective-origin";
103
+ readonly BACKFACE_VISIBILITY: "backface-visibility";
98
104
  readonly WILL_CHANGE: "will-change";
99
105
  readonly OUTLINE_WIDTH: "outline-width";
100
106
  readonly OUTLINE_STYLE: "outline-style";
@@ -136,6 +142,8 @@ declare const styleConstants: {
136
142
  readonly OVERFLOW_Y: "overflow-y";
137
143
  readonly SCROLLBAR_WIDTH: "scrollbar-width";
138
144
  readonly SCROLLBAR_COLOR: "scrollbar-color";
145
+ readonly CONTAINER_TYPE: "container-type";
146
+ readonly CONTAINER_NAME: "container-name";
139
147
  readonly OBJECT_FIT: "object-fit";
140
148
  readonly OBJECT_POSITION: "object-position";
141
149
  readonly COLUMN_WIDTH: "column-width";
@@ -190,8 +198,8 @@ declare const styleConstants: {
190
198
  };
191
199
  export declare const inheritableAttributesBase: StyleCategory[];
192
200
  export declare const StyleBindingsAllowed: {
193
- path: "color" | "cursor" | "filter" | "fill" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "mask-size" | "mask-position" | "mask-repeat" | "mask-composite" | "-webkit-mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "transition-behavior" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "animation-timeline" | "animation-range" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "scroll-snap-type" | "scroll-snap-align" | "scroll-snap-stop" | "scroll-padding-top" | "scroll-margin-top" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "scrollbar-width" | "scrollbar-color" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "font-variant-numeric" | "font-feature-settings" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "-webkit-text-fill-color" | "-webkit-background-clip" | "box-decoration-break" | "-webkit-box-decoration-break" | "stroke" | "stroke-width";
194
- label: "color" | "cursor" | "filter" | "fill" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "mask-size" | "mask-position" | "mask-repeat" | "mask-composite" | "-webkit-mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "transition-behavior" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "animation-timeline" | "animation-range" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "perspective" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "scroll-snap-type" | "scroll-snap-align" | "scroll-snap-stop" | "scroll-padding-top" | "scroll-margin-top" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "scrollbar-width" | "scrollbar-color" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "font-variant-numeric" | "font-feature-settings" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "-webkit-text-fill-color" | "-webkit-background-clip" | "box-decoration-break" | "-webkit-box-decoration-break" | "stroke" | "stroke-width";
201
+ path: "color" | "cursor" | "filter" | "fill" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "mask-size" | "mask-position" | "mask-repeat" | "mask-composite" | "-webkit-mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "transition-behavior" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "animation-timeline" | "animation-range" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "translate" | "rotate" | "scale" | "transform-style" | "perspective" | "perspective-origin" | "backface-visibility" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "scroll-snap-type" | "scroll-snap-align" | "scroll-snap-stop" | "scroll-padding-top" | "scroll-margin-top" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "scrollbar-width" | "scrollbar-color" | "container-type" | "container-name" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "font-variant-numeric" | "font-feature-settings" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "-webkit-text-fill-color" | "-webkit-background-clip" | "box-decoration-break" | "-webkit-box-decoration-break" | "stroke" | "stroke-width";
202
+ label: "color" | "cursor" | "filter" | "fill" | "display" | "flex-wrap" | "flex-direction" | "align-items" | "justify-items" | "justify-content" | "align-content" | "row-gap" | "column-gap" | "grid-row-gap" | "grid-column-gap" | "grid-template-areas" | "grid-template-columns" | "grid-template-rows" | "grid-auto-flow" | "grid-auto-rows" | "grid-auto-columns" | "grid-row-start" | "grid-column-start" | "grid-row-end" | "grid-column-end" | "align-self" | "justify-self" | "order" | "flex-grow" | "flex-shrink" | "flex-basis" | "list-style" | "list-style-type" | "list-style-position" | "list-style-image" | "background-color" | "background-image" | "background-position" | "background-size" | "background-repeat" | "background-origin" | "background-clip" | "background-attachment" | "background-blend-mode" | "mask-image" | "mask-size" | "mask-position" | "mask-repeat" | "mask-composite" | "-webkit-mask-image" | "border-top-style" | "border-top-width" | "border-top-color" | "border-bottom-style" | "border-bottom-width" | "border-bottom-color" | "border-left-style" | "border-left-width" | "border-left-color" | "border-right-style" | "border-right-width" | "border-right-color" | "border-top-left-radius" | "border-top-right-radius" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-collapse" | "border-spacing" | "table-layout" | "opacity" | "visibility" | "transition" | "transition-property" | "transition-duration" | "transition-timing-function" | "transition-delay" | "transition-behavior" | "animation" | "animation-name" | "animation-duration" | "animation-timing-function" | "animation-delay" | "animation-iteration-count" | "animation-direction" | "animation-fill-mode" | "animation-play-state" | "animation-timeline" | "animation-range" | "box-shadow" | "backdrop-filter" | "mix-blend-mode" | "isolation" | "clip-path" | "transform" | "transform-origin" | "translate" | "rotate" | "scale" | "transform-style" | "perspective" | "perspective-origin" | "backface-visibility" | "will-change" | "outline-width" | "outline-style" | "outline-color" | "outline-offset" | "pointer-events" | "user-select" | "touch-action" | "resize" | "appearance" | "scroll-behavior" | "overscroll-behavior" | "scroll-snap-type" | "scroll-snap-align" | "scroll-snap-stop" | "scroll-padding-top" | "scroll-margin-top" | "accent-color" | "caret-color" | "color-scheme" | "position" | "float" | "clear" | "z-index" | "top" | "bottom" | "left" | "right" | "box-sizing" | "aspect-ratio" | "width" | "height" | "min-width" | "min-height" | "max-width" | "max-height" | "overflow" | "overflow-x" | "overflow-y" | "scrollbar-width" | "scrollbar-color" | "container-type" | "container-name" | "object-fit" | "object-position" | "column-width" | "column-count" | "margin-top" | "margin-bottom" | "margin-left" | "margin-right" | "padding-top" | "padding-bottom" | "padding-left" | "padding-right" | "font-family" | "font-weight" | "font-size" | "line-height" | "text-align" | "font-style" | "font-variant" | "font-variant-numeric" | "font-feature-settings" | "text-decoration" | "text-decoration-line" | "text-decoration-color" | "text-decoration-style" | "text-decoration-thickness" | "text-underline-offset" | "letter-spacing" | "word-spacing" | "text-indent" | "text-transform" | "direction" | "white-space" | "text-wrap" | "word-break" | "overflow-wrap" | "hyphens" | "vertical-align" | "text-overflow" | "text-shadow" | "line-clamp" | "-webkit-line-clamp" | "-webkit-box-orient" | "-webkit-text-fill-color" | "-webkit-background-clip" | "box-decoration-break" | "-webkit-box-decoration-break" | "stroke" | "stroke-width";
195
203
  }[];
196
204
  export declare const baseDefaultValue: Record<StyleCategory, StyleValue>;
197
205
  export default styleConstants;
@@ -107,7 +107,13 @@ var e = {
107
107
  CLIP_PATH: "clip-path",
108
108
  TRANSFORM: "transform",
109
109
  TRANSFORM_ORIGIN: "transform-origin",
110
+ TRANSLATE: "translate",
111
+ ROTATE: "rotate",
112
+ SCALE: "scale",
113
+ TRANSFORM_STYLE: "transform-style",
110
114
  PERSPECTIVE: "perspective",
115
+ PERSPECTIVE_ORIGIN: "perspective-origin",
116
+ BACKFACE_VISIBILITY: "backface-visibility",
111
117
  WILL_CHANGE: "will-change",
112
118
  OUTLINE_WIDTH: "outline-width",
113
119
  OUTLINE_STYLE: "outline-style",
@@ -149,6 +155,8 @@ var e = {
149
155
  OVERFLOW_Y: "overflow-y",
150
156
  SCROLLBAR_WIDTH: "scrollbar-width",
151
157
  SCROLLBAR_COLOR: "scrollbar-color",
158
+ CONTAINER_TYPE: "container-type",
159
+ CONTAINER_NAME: "container-name",
152
160
  OBJECT_FIT: "object-fit",
153
161
  OBJECT_POSITION: "object-position",
154
162
  COLUMN_WIDTH: "column-width",
@@ -320,7 +328,13 @@ var e = {
320
328
  [t.CLIP_PATH]: "none",
321
329
  [t.TRANSFORM]: "translate3d(0px, 0px, 0px)",
322
330
  [t.TRANSFORM_ORIGIN]: "50% 50%",
331
+ [t.TRANSLATE]: "none",
332
+ [t.ROTATE]: "none",
333
+ [t.SCALE]: "none",
334
+ [t.TRANSFORM_STYLE]: "flat",
323
335
  [t.PERSPECTIVE]: "none",
336
+ [t.PERSPECTIVE_ORIGIN]: "50% 50%",
337
+ [t.BACKFACE_VISIBILITY]: "visible",
324
338
  [t.WILL_CHANGE]: "auto",
325
339
  [t.OUTLINE_WIDTH]: "medium",
326
340
  [t.OUTLINE_STYLE]: "none",
@@ -362,6 +376,8 @@ var e = {
362
376
  [t.OVERFLOW_Y]: "visible",
363
377
  [t.SCROLLBAR_WIDTH]: "auto",
364
378
  [t.SCROLLBAR_COLOR]: "auto",
379
+ [t.CONTAINER_TYPE]: "normal",
380
+ [t.CONTAINER_NAME]: "none",
365
381
  [t.OBJECT_FIT]: "fill",
366
382
  [t.OBJECT_POSITION]: "50% 50%",
367
383
  [t.COLUMN_WIDTH]: "auto",
@@ -0,0 +1,11 @@
1
+ import { DisplayMode } from '../types';
2
+ /**
3
+ * Which of the space's breakpoints the page is showing — `desktop`, `tablet` or `mobile` — kept current as the window
4
+ * or the builder's canvas is resized. For a plugin that decides by layout (a dock only where there is room for one)
5
+ * with the space's own widths, rather than a number of its own that drifts from them. `compact`, in the space's
6
+ * styles, is `tablet` and `mobile` together.
7
+ *
8
+ * It listens to two media queries and nothing else — no resize handler, no store.
9
+ */
10
+ declare const useDisplayMode: () => DisplayMode;
11
+ export default useDisplayMode;
@@ -0,0 +1,18 @@
1
+ import { displayModeWidthRem as e } from "./breakpoints.mjs";
2
+ import { useSyncExternalStore as t } from "react";
3
+ //#region src/style/useDisplayMode.ts
4
+ var n = {
5
+ mobile: `(max-width: ${e("tablet")})`,
6
+ tablet: `(max-width: ${e("desktop")})`
7
+ }, r = (e) => typeof window > "u" || typeof window.matchMedia != "function" ? void 0 : window.matchMedia(e), i = () => r(n.mobile)?.matches ? "mobile" : r(n.tablet)?.matches ? "tablet" : "desktop", a = (e) => {
8
+ let t = [r(n.mobile), r(n.tablet)].filter((e) => e !== void 0);
9
+ return t.forEach((t) => {
10
+ t.addEventListener("change", e);
11
+ }), () => {
12
+ t.forEach((t) => {
13
+ t.removeEventListener("change", e);
14
+ });
15
+ };
16
+ }, o = () => "desktop", s = () => t(a, i, o);
17
+ //#endregion
18
+ export { s as default };
@@ -209,10 +209,10 @@ export type ActionTaskDescriptor = {
209
209
  title: string;
210
210
  description?: string;
211
211
  /**
212
- * Whose step it is: the deployment's (`http.request`, `kv.get`…) or one of the space's own functions. A run treats
213
- * both alike; the editor lists them apart.
212
+ * Whose step it is: the deployment's (`http.request`, `kv.get`…), one of the space's own functions, or the server half
213
+ * of a plugin the space uses (`<type>.<action>`). A run treats them alike; the editor lists them apart.
214
214
  */
215
- origin: 'deployment' | 'space';
215
+ origin: 'deployment' | 'space' | 'plugin';
216
216
  params: Record<string, unknown>;
217
217
  };
218
218
  /**
@@ -20,6 +20,19 @@ export type ComponentPlugin<T = unknown> = ComponentPluginFC<T> & {
20
20
  version?: string;
21
21
  initialItems?: string[];
22
22
  };
23
+ /**
24
+ * What a plugin says about itself apart from its code — its definition, its sub-plugins' — as data a page can carry.
25
+ *
26
+ * A page is sent with the plugins it draws and only the declarations of the rest: the space knows every type it has
27
+ * (an element's defaults, a sub-plugin's name) from the start, and a plugin's code is fetched when a page that draws
28
+ * it is opened.
29
+ */
30
+ export type PluginDeclaration = {
31
+ content?: ComponentDefinition;
32
+ version?: string;
33
+ initialItems?: string[];
34
+ plugins?: Record<string, PluginDeclaration>;
35
+ };
23
36
  export type ComponentPluginWithHOC<T = unknown> = ComponentPluginFC<T & {
24
37
  internalProps: InternalPropsSTG1;
25
38
  }> & {
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A space's own data, as everything outside the page server sees it — the builder, the CLI, the MCP and the platform
3
+ * that keeps it: JSON files a provider of the space reads on the server (`/data/<file>`), never served. What a project
4
+ * keeps in `src/data/`.
5
+ */
6
+ /** One reason the data was not saved, by the file it is about — what an editor marks. */
7
+ export type DataProblem = {
8
+ file: string;
9
+ message: string;
10
+ };
11
+ /** The draft's data: its files, and which copy of them this is. */
12
+ export type DataDraft = {
13
+ /** `{ "products.json": "[…]", "shop/hours.json": "{…}" }`. */
14
+ files: Record<string, string>;
15
+ /** Hand it back as `base` when saving: data that moved on since is refused rather than overwritten. */
16
+ version: string;
17
+ };
18
+ /**
19
+ * Why nothing was saved: `version`, the data moved on since the copy this save started from; `storage`, the space has no
20
+ * private bucket to keep it in (the error says how to add one); `size`, it weighs more than a render reads.
21
+ */
22
+ export type DataRefusal = {
23
+ status: number;
24
+ error: string;
25
+ limit: 'version' | 'storage' | 'size';
26
+ };
27
+ export type DataSaveResult = {
28
+ ok: true;
29
+ version: string;
30
+ } | {
31
+ ok: false;
32
+ problems: DataProblem[];
33
+ } | {
34
+ ok: false;
35
+ refusal: DataRefusal;
36
+ };
@@ -19,7 +19,7 @@ export type InteractionNode = {
19
19
  endTime: number;
20
20
  whenParams?: Record<string, RuleValue>;
21
21
  };
22
- export type InteractionParamType = 'boolean' | 'select' | 'text' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
22
+ export type InteractionParamType = 'boolean' | 'select' | 'text' | 'number' | 'textarea' | 'codemirror-text' | 'codemirror-json' | 'elements';
23
23
  export type InteractionCallbackParamValues<T extends Record<string, unknown> = Record<string, unknown>> = T;
24
24
  export type InteractionCallbackParam<T extends Record<string, unknown> = Record<string, unknown>> = {
25
25
  canBind?: boolean;
@@ -33,6 +33,11 @@ export type InteractionCallbackParam<T extends Record<string, unknown> = Record<
33
33
  } & ({
34
34
  type: 'text';
35
35
  defaultValue?: string | number;
36
+ }
37
+ /** Written as text — a number or a template — and handed to the callback as a number. */
38
+ | {
39
+ type: 'number';
40
+ defaultValue?: number;
36
41
  } | {
37
42
  type: 'textarea';
38
43
  defaultValue?: string | number;
@@ -74,7 +79,11 @@ export type InteractionCallbackParam<T extends Record<string, unknown> = Record<
74
79
  value: string;
75
80
  }[]);
76
81
  });
77
- export type InteractionCallbackPreview = string | Record<string, unknown>;
82
+ /**
83
+ * What a field a step or a trigger hands its flow looks like — a sample, shown where a flow is written, never sent: `0`
84
+ * for a count, `false` for a flag, `[]` for a list, as well as the text `''`.
85
+ */
86
+ export type InteractionCallbackPreview = string | number | boolean | null | unknown[] | Record<string, unknown>;
78
87
  export type InteractionCallbackPreviews = Record<string, InteractionCallbackPreview>;
79
88
  /**
80
89
  * What a callback learns about the flow running it.
@@ -86,6 +95,11 @@ export type InteractionCallbackPreviews = Record<string, InteractionCallbackPrev
86
95
  export type InteractionCallbackContext = {
87
96
  /** Id of the element this flow fired on. Absent for a flow with no host element. */
88
97
  hostElementId?: string;
98
+ /**
99
+ * Aborted when the flow running this step is superseded — its trigger fired again under `whileRunning: 'latest'`. A
100
+ * step waiting on something it can stop (a request, a server run) stops it; the flow starts no further step.
101
+ */
102
+ signal?: AbortSignal;
89
103
  };
90
104
  export type InteractionCallback<T extends Record<string, unknown> = Record<string, unknown>> = {
91
105
  elementId?: string;
@@ -53,8 +53,10 @@ export type ElementBinding = {
53
53
  * - `skip` (the default): the new firing is ignored — what keeps a double click from submitting twice.
54
54
  * - `parallel`: every firing runs its own flow, at the same time.
55
55
  * - `queue`: every firing runs, one after another, in the order they came — none lost, none overlapping.
56
+ * - `latest`: every firing runs, and the run before it stops — it starts no further step, and the step it is waiting
57
+ * on stops if it can (a server action, a request). A search as you type: only the last question is answered.
56
58
  */
57
- export type WhileRunning = 'skip' | 'parallel' | 'queue';
59
+ export type WhileRunning = 'skip' | 'parallel' | 'queue' | 'latest';
58
60
  export declare const WHILE_RUNNING_MODES: readonly WhileRunning[];
59
61
  export type ElementInteraction<T extends Record<string, unknown> = Record<string, unknown>> = {
60
62
  id: string;
@@ -117,6 +119,12 @@ export type ElementDefinition = {
117
119
  anchor?: string;
118
120
  /** How it arrives and whether it keeps moving, played by the SDK's stylesheet. See {@link ElementMotion}. */
119
121
  motion?: ElementMotion;
122
+ /**
123
+ * The codes of the suggestions this element is not offered, because it is written this way on purpose —
124
+ * `['repeated-shape']`. Read by the one place suggestions are made (`suggestSpace`), so authoring, the builder and
125
+ * the MCP leave out the same ones. Never a problem's code.
126
+ */
127
+ quiet?: string[];
120
128
  };
121
129
  /**
122
130
  * An element, keyed by the one name it answers to.
@@ -340,7 +348,7 @@ export type SchemaContextValue = {
340
348
  schemaUpdateSettings?: (value: string | number | boolean, path?: string, fromSubscriptions?: boolean) => void;
341
349
  };
342
350
  /** The fields of a definition an element may go without — absent in a document, `null` from GraphQL. */
343
- type OptionalDefinitionKey = 'parentId' | 'items' | 'bindings' | 'interactions' | 'initialState' | 'runtime' | 'loadStrategy' | 'flag' | 'anchor' | 'motion';
351
+ type OptionalDefinitionKey = 'parentId' | 'items' | 'bindings' | 'interactions' | 'initialState' | 'runtime' | 'loadStrategy' | 'flag' | 'anchor' | 'motion' | 'quiet';
344
352
  /**
345
353
  * An element as it arrives on the wire. GraphQL answers every field a query names, so one the element does not have
346
354
  * comes back `null` — where the element itself has nothing. `schemaFromWire` drops them on arrival.
@@ -2,7 +2,8 @@
2
2
  var e = [
3
3
  "skip",
4
4
  "parallel",
5
- "queue"
5
+ "queue",
6
+ "latest"
6
7
  ];
7
8
  //#endregion
8
9
  export { e as WHILE_RUNNING_MODES };
@@ -1,6 +1,8 @@
1
1
  import { ActionEmailConfig, ActionEntry, ActionJobQueue, ActionLimits, ActionRejectReason, ActionRunSummary, ActionRejectRecord, ActionRunRecord, ActionRunReport, ActionRunStatus, ActionTaskDescriptor, ActionTriggerType } from './ActionTypes';
2
2
  import { Environment } from './CommonTypes';
3
+ import { PluginDeclaration } from './ComponentTypes';
3
4
  import { ConnectorEntry } from './ConnectorTypes';
5
+ import { DataDraft, DataSaveResult } from './DataTypes';
4
6
  import { FunctionsDraft, FunctionsSaveResult } from './FunctionTypes';
5
7
  import { SSRRealtimeConfig } from './RealtimeTypes';
6
8
  import { Schema } from './SchemaTypes';
@@ -119,6 +121,11 @@ export type PluginEntry = {
119
121
  * against, and the mismatch throws away the whole tree it happens in.
120
122
  */
121
123
  ssr?: boolean;
124
+ /**
125
+ * What the plugin declares, when this page draws none of its types: its code and stylesheet are left out of the
126
+ * document and loaded when a page that draws it is opened. Absent, the page loads it up front.
127
+ */
128
+ deferred?: PluginDeclaration;
122
129
  };
123
130
  export type SSRTemplateProps = {
124
131
  title?: string;
@@ -126,6 +133,13 @@ export type SSRTemplateProps = {
126
133
  description?: string;
127
134
  jsPath?: string;
128
135
  cssPath?: string;
136
+ /** Font Awesome's rules, after `cssPath`; its fonts are files beside it, fetched only for a style the page uses. */
137
+ iconsCssPath?: string;
138
+ /**
139
+ * Where the page fetches the space from, when it travels beside the document rather than in its payload: the
140
+ * page preloads it, and the bootstrap reads it before hydrating.
141
+ */
142
+ spaceDocumentPath?: string;
129
143
  builderJsPath?: string;
130
144
  builderCssPath?: string;
131
145
  plugins?: PluginEntry[];
@@ -171,7 +185,7 @@ export type SSRImagesConfig = {
171
185
  * to the rule every outbound request is (no private network, every redirect judged).
172
186
  */
173
187
  domains: readonly string[];
174
- /** Where the resized files are kept. Default: `.plitzi/images` under the working directory. */
188
+ /** Where the resized files are kept. Default: `tmp/images` under the working directory. */
175
189
  cacheDir?: string;
176
190
  };
177
191
  /**
@@ -348,10 +362,6 @@ export type SSRAdapters = {
348
362
  /** Which space, environment and revision a request resolves to. Optional here for the same reason as
349
363
  * `getOfflineData`: MCP resolves its space from the request token (`getGrant`), never from the host. */
350
364
  getSpaceDeployment?: (req: SSRRequest) => Promise<SSRSpaceDeployment>;
351
- /** Persist a space mutated by the mcp-ai `apply` tool — store it as given; derived caches (notably `style.cache`)
352
- * arrive already compiled. When omitted, mcp-ai runs read/preview/validate only and `apply` reports
353
- * `persisted: false`. */
354
- saveOfflineData?: (spaceId: number, environment: string, data: OfflineDataRaw) => Promise<void>;
355
365
  /** Resolve the grant the MCP request operates under, from the verified `Authorization` bearer. The consumer
356
366
  * owns the JWT secret and the authorization model, so it decides here; the MCP service stays stateless.
357
367
  * Returns undefined when the token is missing or invalid. Required for the `mcp` service to serve any
@@ -399,6 +409,12 @@ export type SSRAdapters = {
399
409
  saveFunctions?: (spaceId: number, files: Record<string, string>, base: string, write: SSRWriteContext) => Promise<FunctionsSaveResult>;
400
410
  /** Run one task of the draft's functions in the sandbox for the person behind the agent — the builder's Try. */
401
411
  tryFunction?: (spaceId: number, task: string, params: Record<string, unknown>, write: SSRWriteContext) => Promise<ActionRunReport>;
412
+ /** The space's own data: the draft's JSON files its server providers read (`/data/<file>`), and which copy they are.
413
+ * When omitted, the MCP offers no data resource and refuses the data ops. */
414
+ getData?: (spaceId: number) => Promise<DataDraft | undefined>;
415
+ /** Save the draft's data, whole: every file JSON at a plain path. `base` is the version the agent read, and data that
416
+ * moved on since is refused rather than overwritten. */
417
+ saveData?: (spaceId: number, files: Record<string, string>, base: string, write: SSRWriteContext) => Promise<DataSaveResult>;
402
418
  /** Persist the element schema mutated by the MCP `apply` tool. When omitted, `apply` reports `persisted: false`. */
403
419
  saveSchema?: (spaceId: number, environment: Environment, schema: Schema, write: SSRWriteContext) => Promise<void>;
404
420
  /** Persist the style document mutated by the MCP `apply` tool — store it as given. `style.cache` arrives already
@@ -523,6 +539,11 @@ export interface SSRRscContext {
523
539
  * against the page it matched and skips it — so a feature that is off puts nothing in the payload.
524
540
  */
525
541
  flagOverrides?: FlagOverrides;
542
+ /**
543
+ * Aborted when whoever asked stops waiting — a browser that hung up, a refresh superseded by a newer one, a STOP — so
544
+ * what it asked for stops being worked on, here and in the runs it started.
545
+ */
546
+ signal?: AbortSignal;
526
547
  }
527
548
  /**
528
549
  * Which published version of a space is asking.
@@ -554,6 +575,14 @@ export type ActionLookupsConfig = {
554
575
  getConnector?: (spaceId: number, connectorId: string, at?: SpaceRevision) => Promise<unknown>;
555
576
  /** The space's own functions as of that revision — `SpaceFunctions` in `@plitzi/sdk-server/functions`. */
556
577
  getFunctions?: (spaceId: number, at?: SpaceRevision) => Promise<unknown>;
578
+ /** The server halves of the plugins the space uses, by plugin type — a `SpaceFunctions` each. */
579
+ getPluginFunctions?: (spaceId: number, at?: SpaceRevision) => Promise<unknown>;
580
+ /**
581
+ * The space's own data as of that revision — what a project keeps in `src/data/`, kept privately and frozen with each
582
+ * publish — as its files' text by path (`products.json`). A provider resolved on the server whose `query` is
583
+ * `/data/<file>` reads it, as `dataDir` reads a folder; no browser is answered it.
584
+ */
585
+ getData?: (spaceId: number, at?: SpaceRevision) => Promise<unknown>;
557
586
  /** The feature flags the space declares as of that revision — what a flow reads as `{{ flags.<name> }}`. */
558
587
  getFlags?: (spaceId: number, at?: SpaceRevision) => Promise<Schema['flags']>;
559
588
  };
@@ -903,7 +932,15 @@ export type SSRServerConfig = {
903
932
  minVersion?: 'TLSv1' | 'TLSv1.1' | 'TLSv1.2' | 'TLSv1.3';
904
933
  };
905
934
  environment?: ServerEnvironment;
935
+ /** Served to anyone who asks, as it is: pictures, a favicon, what a page fetches in the browser. */
906
936
  publicDir?: string;
937
+ /**
938
+ * The project's own data, never served as files: a provider resolved on the server (`runtime: 'server'`) whose
939
+ * `query` is `/data/<file>` reads `<dataDir>/<file>`, and the page arrives with it. Nobody downloads the folder; what
940
+ * a provider reads goes into the page it renders, though — data a page must not carry is a server action's to read,
941
+ * answering only what is shown.
942
+ */
943
+ dataDir?: string;
907
944
  static?: Record<string, string>;
908
945
  devMode?: boolean;
909
946
  /**
@@ -945,6 +982,7 @@ export type SSRServerConfig = {
945
982
  authCookie?: SSRAuthCookie;
946
983
  templateFn?: SSRTemplateFn;
947
984
  plugins?: Record<string, PluginSource>;
985
+ /** Where the plugins it builds are kept. Default: `tmp/.sdk-plugins` under the working directory. */
948
986
  pluginsCacheDir?: string;
949
987
  pluginsTtlMs?: number;
950
988
  /** Auto-download and cache plugins declared in the schema's offlineData.plugins list. Default: true. */
@@ -975,12 +1013,13 @@ export type SSRServerConfig = {
975
1013
  /** Write endpoint for server-driven providers. Absent means the server serves reads only. */
976
1014
  action?: SSRActionConfig;
977
1015
  /**
978
- * Code of this server's own, and the sandbox for the spaces' — shaped as `FunctionsConfig` in
979
- * `@plitzi/sdk-server/functions`. `native` is trusted code loaded in the process (a self-hosted server's tasks, or a
980
- * platform's own); `runner` runs each space's functions, isolated.
1016
+ * The server's code: its own (`native`), the server halves of the plugins it ships (`plugins`, by plugin type), the
1017
+ * runner the spaces' code runs on, and the ceilings. Built by `@plitzi/sdk-server/functions` (`loadFunctions`), and
1018
+ * checked as the server starts.
981
1019
  */
982
1020
  functions?: {
983
1021
  native?: unknown[];
1022
+ plugins?: Record<string, unknown>;
984
1023
  runner?: unknown;
985
1024
  limits?: Record<string, number>;
986
1025
  };
@@ -1130,6 +1169,12 @@ export type SSRContext = {
1130
1169
  * refresh is done, and handed on only to a page whose debugging is authorized.
1131
1170
  */
1132
1171
  actionRuns?: ActionRunSummary[];
1172
+ /**
1173
+ * What a refresh of server data asked for beside the page's own address (`/_rsc?location=…&q=…`): a provider's
1174
+ * `input`, a page window. What the provider asks for this time, so it wins over the `input` the element was saved
1175
+ * with — the query string of the page does not.
1176
+ */
1177
+ rscParams?: Record<string, string>;
1133
1178
  };
1134
1179
  export type SSRServer = {
1135
1180
  listen: (port: number, host?: string) => void;
@@ -1141,6 +1186,13 @@ export type SSRServer = {
1141
1186
  * calls once it wrote the new documents, instead of restarting the server. Nothing otherwise.
1142
1187
  */
1143
1188
  reloadPages: () => void;
1189
+ /**
1190
+ * The server halves of the plugins this server ships (`functions.plugins`), replaced while it runs: what a development
1191
+ * server does when a plugin's `functions/` change. `definition` is what `loadFunctions` loads; none takes it away.
1192
+ */
1193
+ readonly functions: {
1194
+ setPlugin: (plugin: string, definition: unknown) => void;
1195
+ };
1144
1196
  };
1145
1197
  /** A key/value store with per-entry expiry, backing the OAuth layer's short-lived protocol state (registered
1146
1198
  * clients, authorization codes, refresh grants). Values are opaque strings the SDK serialises itself. A
@@ -101,6 +101,12 @@ export type CommonState = {
101
101
  href: string;
102
102
  currentPageId: string;
103
103
  navigate: (url: string, isExternal?: boolean) => void;
104
+ /**
105
+ * Where a navigation is going while it waits for the destination's server data — `''` when none is. A link to a
106
+ * page resolved on the server asks for that page's data before it goes, and the page on screen stays until then:
107
+ * this is what a loading bar for it reads.
108
+ */
109
+ pendingLocation?: string;
104
110
  };
105
111
  };
106
112
  /** Not document state and not server data: the surface the schema is being rendered on. `previewMode` and
@@ -209,6 +215,19 @@ export type RscState = {
209
215
  * compare this against where the visitor actually is, and a mismatch means "not mine yet" rather than "gone".
210
216
  */
211
217
  location?: string;
218
+ /**
219
+ * The elements a refresh in flight is asking about for the page on screen, by id — `*` for the whole payload.
220
+ *
221
+ * What makes a server provider's `isLoading` true while it is asked again (`performQuery`, `refreshSeconds`, a page
222
+ * of a pager), as a browser provider's is while it refetches. A navigation's prefetch is for another page, and
223
+ * marks nothing on this one.
224
+ */
225
+ refreshing?: Record<string, boolean>;
226
+ /**
227
+ * Names this SDK root, so the refreshes asked through any store under it — each element writes through a scoped store
228
+ * of its own — are known to each other: one request per question, the newest question winning.
229
+ */
230
+ instance?: string;
212
231
  };
213
232
  export type BuilderState = CommonState & {
214
233
  collaboration: {
@@ -233,12 +252,6 @@ export type BuilderState = CommonState & {
233
252
  queryParams: QueryParams;
234
253
  hostname: string;
235
254
  };
236
- /**
237
- * The builder's OWN feature flags — Plitzi's, not the space's: which parts of the editor this person is shown, as the
238
- * platform resolved them for them when the editor opened (`PlatformFlags` in the builder's first query). Never
239
- * authored, never published.
240
- */
241
- platformFlags?: Record<string, boolean>;
242
255
  displayMode: DisplayMode;
243
256
  selector?: string;
244
257
  styleSelector?: string;
@@ -11,6 +11,7 @@ export * from './NavigationTypes';
11
11
  export * from './CollectionTypes';
12
12
  export * from './ConnectorTypes';
13
13
  export * from './ActionTypes';
14
+ export * from './DataTypes';
14
15
  export * from './FunctionTypes';
15
16
  export * from './RealtimeTypes';
16
17
  export * from './ComponentTypes';
@@ -23,6 +24,4 @@ export * from './SpaceTypes';
23
24
  export * from './DevToolsTypes';
24
25
  export * from './StoreTypes';
25
26
  export * from './ThemeTypes';
26
- export * from './McpTypes';
27
27
  export * from './ServerTypes';
28
- export * from './AITypes';