@phis/ui 0.4.21 → 0.4.23

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 (112) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +1 -1
  2. package/components/controls/phi-brand-control.d.ts +10 -2
  3. package/components/controls/phi-brand-control.js +12 -8
  4. package/components/controls/phi-cascader-control.js +6 -1
  5. package/components/controls/phi-geometry-control.d.ts +33 -1
  6. package/components/controls/phi-geometry-control.js +87 -29
  7. package/components/controls/phi-series-chart-control.js +4 -2
  8. package/components/forms/form-provider-contract.d.ts +1 -0
  9. package/components/forms/form-provider-contract.js +1 -0
  10. package/components/forms/upload-form-control.js +1 -0
  11. package/components/layouts/clients/phi-flex-layout-client.js +23 -5
  12. package/components/layouts/clients/phi-grid-layout-client.js +20 -10
  13. package/components/layouts/clients/phi-layout-anchored-overlay.d.ts +2 -0
  14. package/components/layouts/clients/phi-layout-anchored-overlay.js +9 -2
  15. package/components/layouts/clients/phi-three-column-layout-client.js +7 -4
  16. package/components/layouts/layout-definitions.d.ts +16 -16
  17. package/components/layouts/layout-definitions.js +8 -8
  18. package/components/layouts/phi-base-layout.js +13 -9
  19. package/components/layouts/phi-layout-contract.d.ts +12 -2
  20. package/components/layouts/phi-layout-contract.js +30 -7
  21. package/components/layouts/phi-masonry-layout.d.ts +6 -0
  22. package/components/layouts/phi-masonry-layout.js +13 -3
  23. package/components/layouts/plugins/masonry-layout-plugin.js +2 -1
  24. package/components/media/asset-collection-runtime.d.ts +1 -6
  25. package/components/media/asset-collection-runtime.js +2 -93
  26. package/components/media/label-sets/media.js +12 -0
  27. package/components/media/media-folder-lock.d.ts +19 -0
  28. package/components/media/media-folder-lock.js +40 -0
  29. package/components/media/media-folder-options.d.ts +14 -2
  30. package/components/media/media-folder-options.js +17 -5
  31. package/components/media/media-widget-labels.d.ts +9 -0
  32. package/components/media/media-widget-labels.js +6 -0
  33. package/components/media/phi-area-upload-widget.js +1 -0
  34. package/components/media/phi-asset-folder-control.d.ts +14 -1
  35. package/components/media/phi-asset-folder-control.js +11 -4
  36. package/components/media/phi-image-preview-store.d.ts +0 -4
  37. package/components/media/phi-image-preview-store.js +0 -10
  38. package/components/media/phi-media-picker-binding.d.ts +7 -2
  39. package/components/media/phi-media-upload.d.ts +2 -0
  40. package/components/media/phi-media-upload.js +3 -0
  41. package/components/regions/clients/cms-region-container-client.d.ts +3 -1
  42. package/components/regions/clients/cms-region-container-client.js +4 -3
  43. package/components/regions/phi-cms-region-container.d.ts +3 -1
  44. package/components/regions/phi-cms-region-container.js +3 -2
  45. package/components/regions/phi-cms-region-shell.d.ts +9 -1
  46. package/components/regions/phi-cms-region-shell.js +3 -1
  47. package/components/regions/phi-cms-region-static.d.ts +3 -1
  48. package/components/regions/phi-cms-region-static.js +3 -2
  49. package/components/regions/presets/navigation-redirect.d.ts +2 -2
  50. package/components/regions/presets/navigation-redirect.js +5 -3
  51. package/components/shell/phi-antd-icon.d.ts +2 -0
  52. package/components/shell/phi-antd-icon.js +6 -0
  53. package/components/widgets/label-sets/geometry.js +10 -0
  54. package/components/widgets/label-types/geometry.d.ts +7 -0
  55. package/components/widgets/label-types/geometry.js +6 -0
  56. package/components/widgets/shared/markdown-render.js +30 -135
  57. package/components/widgets/shared/markdown-translation-unit.d.ts +62 -0
  58. package/components/widgets/shared/markdown-translation-unit.js +211 -0
  59. package/helpers/block-geometry-profiles.d.ts +67 -0
  60. package/helpers/block-geometry-profiles.js +105 -0
  61. package/helpers/cms-navigation-catalog.js +4 -2
  62. package/helpers/renderable-block-effects.js +16 -0
  63. package/package.json +1 -1
  64. package/plugins/runtime/phi-slot-child-frame-view.js +14 -4
  65. package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +42 -2
  66. package/plugins/runtime/slot-size-policy.d.ts +15 -0
  67. package/plugins/runtime/slot-size-policy.js +29 -0
  68. package/plugins/runtime-modules/asset/data-providers.js +3 -0
  69. package/plugins/runtime-modules/asset/services/collection.js +34 -0
  70. package/plugins/runtime-modules/asset/services/options.js +19 -2
  71. package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +9 -0
  72. package/plugins/runtime-modules/auth/trees/phi-auth-runtime-page-tree.js +21 -17
  73. package/plugins/runtime-modules/avatar/widgets/account-avatar-picker/client.js +2 -0
  74. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  75. package/plugins/runtime-modules/builder/render-root-node-preview.server.js +2 -1
  76. package/plugins/runtime-modules/builder/services/navigation-table.js +3 -2
  77. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +7 -1
  78. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +8 -2
  79. package/plugins/runtime-modules/core/messaging/data-providers.js +23 -0
  80. package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -0
  81. package/plugins/runtime-modules/core/messaging/labels.js +8 -0
  82. package/plugins/runtime-modules/core/messaging/thread-inbox-table.d.ts +32 -0
  83. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +31 -16
  84. package/plugins/runtime-modules/core/widgets/brand/client.d.ts +3 -1
  85. package/plugins/runtime-modules/core/widgets/brand/client.js +2 -1
  86. package/plugins/runtime-modules/core/widgets/brand/plugin.js +23 -2
  87. package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
  88. package/plugins/runtime-modules/core/widgets/brand/server.js +2 -1
  89. package/plugins/runtime-modules/core/widgets/card/server.js +7 -4
  90. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +52 -6
  91. package/plugins/runtime-modules/core/widgets/gallery/plugin.js +3 -1
  92. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +3 -1
  93. package/plugins/runtime-modules/core/widgets/gallery/server.js +12 -2
  94. package/plugins/runtime-modules/core/widgets/image/server.js +28 -5
  95. package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +3 -0
  96. package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +8 -2
  97. package/plugins/runtime-modules/descriptor-compiler.js +45 -2
  98. package/plugins/runtime-modules/public/trees/phi-default-pub-welcome-page-tree.js +8 -14
  99. package/plugins/runtime-modules/search/widgets/search-box/client.d.ts +2 -1
  100. package/plugins/runtime-modules/search/widgets/search-box/client.js +28 -6
  101. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +19 -2
  102. package/plugins/runtime-modules/threads/labels.d.ts +6 -0
  103. package/plugins/runtime-modules/threads/labels.js +16 -0
  104. package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +24 -1
  105. package/styles/layout.css +101 -0
  106. package/styles/root.css +2 -1
  107. package/types/cms-config.d.ts +5 -1
  108. package/types/cms-config.js +1 -0
  109. package/types/cms-module-descriptors.d.ts +17 -0
  110. package/types/renderable-block.d.ts +5 -0
  111. package/types/site-theme.d.ts +9 -1
  112. package/types.d.ts +1 -1
@@ -0,0 +1,105 @@
1
+ import { PHI_CONTAINER_BREAKPOINT_COL3, PHI_CONTAINER_BREAKPOINT_CONTENT, } from "../theme/phi-container-breakpoints";
2
+ /**
3
+ * Where a block's geometry switches profile: one pair for every block (design/RESPONSIVE_BLOCK_GEOMETRY.md).
4
+ *
5
+ * A container query cannot read a custom property in its condition, so the widths stand literally in
6
+ * `styles/layout.css` and one rule serves every block -- the Grid's pair, so `compact | medium | wide`
7
+ * means one thing across the tree. `validate-container-breakpoint-contracts.ts` holds the literals to
8
+ * these numbers.
9
+ */
10
+ export const PHI_BLOCK_GEOMETRY_RESPONSIVE_MIN_WIDTH = {
11
+ medium: PHI_CONTAINER_BREAKPOINT_COL3,
12
+ wide: PHI_CONTAINER_BREAKPOINT_CONTENT,
13
+ };
14
+ const PHI_BLOCK_PROFILE_ENTRIES = [
15
+ { declaration: "width", key: "width", axis: "inline", part: "size" },
16
+ { declaration: "height", key: "height", axis: "block", part: "size" },
17
+ { declaration: "min-width", key: "minWidth", axis: "inline", part: "min" },
18
+ { declaration: "min-height", key: "minHeight", axis: "block", part: "min" },
19
+ { declaration: "max-width", key: "maxWidth", axis: "inline", part: "max" },
20
+ { declaration: "max-height", key: "maxHeight", axis: "block", part: "max" },
21
+ ];
22
+ /** The attribute a box carries for the declarations it hands to CSS, space-separated. */
23
+ export const PHI_BLOCK_PROFILED_ATTRIBUTE = "data-phi-block-profiled";
24
+ /** The attribute a box that offers a profiled block its room carries; `styles/layout.css` makes it the `phi-slot` container. */
25
+ const PHI_SLOT_CONTAINER_ATTRIBUTE = "data-phi-slot-container";
26
+ const PHI_EMPTY_BLOCK_PROFILE_STYLE = {
27
+ declarations: [],
28
+ attributes: {},
29
+ properties: {},
30
+ };
31
+ /**
32
+ * The profile answers as the stylesheet reads them (LAYOUTING.md, "Block geometry per profile").
33
+ *
34
+ * **An axis is written inline or in CSS, never both**: an inline style beats every `@container` rule.
35
+ * So a declaration whose three answers differ is left out of the inline style and written as three
36
+ * custom properties, and the rules in `styles/layout.css` choose by the room the block is offered. A
37
+ * declaration that answers the same at every profile stays inline, and a block that names no profile
38
+ * hands nothing over and pays nothing.
39
+ *
40
+ * All three properties are written for a declaration handed over, the silent ones with the box's own
41
+ * answer: custom properties inherit, so a property left unwritten would read whatever an enclosing
42
+ * block wrote for its own geometry.
43
+ */
44
+ export function resolvePhiBlockProfileStyle(geometry, box) {
45
+ if (geometry.profiles == null) {
46
+ return PHI_EMPTY_BLOCK_PROFILE_STYLE;
47
+ }
48
+ const answers = [
49
+ { inline: geometry.inline, block: geometry.block },
50
+ geometry.profiles.medium,
51
+ geometry.profiles.wide,
52
+ ];
53
+ const declarations = [];
54
+ const properties = {};
55
+ for (const entry of PHI_BLOCK_PROFILE_ENTRIES) {
56
+ const [compact, medium, wide] = answers.map((answer) => {
57
+ const length = answer[entry.axis][entry.part];
58
+ if (length == null) {
59
+ return box.unstated[entry.declaration];
60
+ }
61
+ return entry.declaration === "max-width" && box.inlineMaximum ? box.inlineMaximum(length) : length.css;
62
+ });
63
+ if (compact === medium && medium === wide) {
64
+ continue;
65
+ }
66
+ declarations.push(entry.declaration);
67
+ properties[`--phi-block-${entry.declaration}`] = compact;
68
+ properties[`--phi-block-${entry.declaration}-medium`] = medium;
69
+ properties[`--phi-block-${entry.declaration}-wide`] = wide;
70
+ }
71
+ return declarations.length === 0
72
+ ? PHI_EMPTY_BLOCK_PROFILE_STYLE
73
+ : {
74
+ declarations,
75
+ attributes: { [PHI_BLOCK_PROFILED_ATTRIBUTE]: declarations.join(" ") },
76
+ properties,
77
+ };
78
+ }
79
+ /** The inline style without the declarations handed to the stylesheet. */
80
+ export function omitPhiBlockProfiledDeclarations(style, declarations) {
81
+ if (declarations.length === 0) {
82
+ return style;
83
+ }
84
+ const next = { ...style };
85
+ for (const entry of PHI_BLOCK_PROFILE_ENTRIES) {
86
+ if (declarations.includes(entry.declaration)) {
87
+ delete next[entry.key];
88
+ }
89
+ }
90
+ return next;
91
+ }
92
+ /**
93
+ * Whether a block asks the room it is offered a question, which is what makes that room a container.
94
+ *
95
+ * The box offering the room is a `phi-slot` size container only where the block standing in it names a
96
+ * profile; containment is not free (design/RESPONSIVE_BLOCK_GEOMETRY.md, "What it costs elsewhere"),
97
+ * and a page that names no profile stays byte for byte what it was.
98
+ */
99
+ export function phiBlockGeometryQueriesRoom(geometry) {
100
+ return geometry.profiles != null;
101
+ }
102
+ /** The attribute that declares the `phi-slot` container, on the box that offers a profiled block its room. */
103
+ export function phiSlotContainerAttributes(queriesRoom) {
104
+ return { [PHI_SLOT_CONTAINER_ATTRIBUTE]: queriesRoom ? "true" : undefined };
105
+ }
@@ -49,6 +49,8 @@ export function getPhiBuilderNavigationDefaultScopeKey(area, family) {
49
49
  function materializeNavigationItem(item, tombstones, customItems, overrides) {
50
50
  const customItem = customItems.get(item.id);
51
51
  const customTarget = customItem?.target;
52
+ // A Site's stored external link and a Module's external entry resolve to the same target.
53
+ const externalTarget = item.target?.kind === "custom" && item.target.external === true ? item.target : null;
52
54
  const folder = item.kind === "container" ? customItem?.folder ?? overrides.get(item.id)?.folder : undefined;
53
55
  return {
54
56
  id: item.id,
@@ -68,8 +70,8 @@ function materializeNavigationItem(item, tombstones, customItems, overrides) {
68
70
  ...(item.target?.kind === "module"
69
71
  ? { targetPreset: { ownerModuleId: item.target.ownerModuleId, presetKey: item.target.presetKey } }
70
72
  : {}),
71
- ...(customTarget?.kind === "external" ? { external: true } : {}),
72
- ...(customItem?.newTab === true ? { newTab: true } : {}),
73
+ ...(customTarget?.kind === "external" || externalTarget ? { external: true } : {}),
74
+ ...(customItem?.newTab === true || externalTarget?.newTab === true ? { newTab: true } : {}),
73
75
  hidden: tombstones.has(item.id),
74
76
  ...(folder ? { folder } : {}),
75
77
  children: item.children.map((child) => materializeNavigationItem(child, tombstones, customItems, overrides)),
@@ -1,5 +1,7 @@
1
1
  import { mergeRenderableBlockDefaults } from "./renderable-block-serialization";
2
2
  import { PHI_RENDERABLE_BLOCK_DEFAULT_TRANSITION } from "./renderable-block-defaults";
3
+ /** A last frame that leaves the Block where it stands: no shift, no turn, no scale. */
4
+ const PHI_RESTING_TRANSFORM = /^(translate3d\(0, 0, 0\)|scale\(1\)|rotate[XYZ]?\(0deg\))$/;
3
5
  function resolveCssDistance(value, fallback) {
4
6
  const resolved = value ?? fallback;
5
7
  return typeof resolved === "number" ? `${resolved}px` : resolved;
@@ -106,6 +108,7 @@ export function resolveRenderableBlockEffectsStyle(config) {
106
108
  const style = {};
107
109
  let transformIndex = 0;
108
110
  let opacityIndex = 0;
111
+ let endsAtRest = true;
109
112
  for (const transition of transitions) {
110
113
  const step = resolveTransitionStep(transition);
111
114
  if (step.kind === "none") {
@@ -122,6 +125,8 @@ export function resolveRenderableBlockEffectsStyle(config) {
122
125
  animationCompositions.push("replace");
123
126
  style[`--phi-effects-opacity-${cappedIndex}-from`] = String((step.fromOpacity ?? 1) * finalOpacity);
124
127
  style[`--phi-effects-opacity-${cappedIndex}-to`] = String((step.toOpacity ?? 1) * finalOpacity);
128
+ if ((step.toOpacity ?? 1) !== 1)
129
+ endsAtRest = false;
125
130
  }
126
131
  if (step.kind === "transform") {
127
132
  const index = transformIndex;
@@ -132,11 +137,22 @@ export function resolveRenderableBlockEffectsStyle(config) {
132
137
  const perspective = step.perspectivePx ? `perspective(${step.perspectivePx}px)` : "";
133
138
  style[`--phi-effects-transform-${cappedIndex}-from`] = [perspective, step.fromTransform].filter(Boolean).join(" ") || "none";
134
139
  style[`--phi-effects-transform-${cappedIndex}-to`] = [perspective, step.toTransform].filter(Boolean).join(" ") || "none";
140
+ if (step.toTransform && !PHI_RESTING_TRANSFORM.test(step.toTransform))
141
+ endsAtRest = false;
135
142
  }
136
143
  transformOrigin = step.origin ?? transformOrigin;
137
144
  perspectivePx = step.perspectivePx ?? perspectivePx;
138
145
  }
139
146
  if (animationNames.length > 0) {
147
+ /*
148
+ * An entrance that ends where the Block stands anyway lets go of it when it is done: it holds only its
149
+ * first frame, for the wait before it starts. One held after its end keeps adding its last frame to the
150
+ * Block's transform, and Firefox runs such a held transform animation on its compositor against the
151
+ * transform the Block had when the animation began -- under a viewport effect that was the flat one,
152
+ * so the picture flipped between flat and turned on every scroll. An exit keeps its last frame.
153
+ */
154
+ if (endsAtRest)
155
+ style["--phi-effects-animation-fill"] = "backwards";
140
156
  style["--phi-effects-animation-name"] = animationNames.join(", ");
141
157
  style["--phi-effects-animation-duration"] = animationDurations.join(", ");
142
158
  style["--phi-effects-animation-delay"] = animationDelays.join(", ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phis/ui",
3
- "version": "0.4.21",
3
+ "version": "0.4.23",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -4,9 +4,10 @@ import { resolvePhiSurfaceStyle } from "../../helpers/surface-style";
4
4
  import { PHI_LAYOUT_SURFACE_RADIUS } from "../../components/layouts/phi-layout-contract";
5
5
  import { PhiSurfaceGroundLayer } from "../../components/surface/phi-surface-ground";
6
6
  import { PhiSurfaceTone } from "../../components/surface/phi-surface-tone";
7
- import { buildPhiSlotChildClassName, buildPhiSlotChildDataAttributes, resolvePhiEffectiveSlotSizePolicy, resolvePhiSlotChildBaseStyle, resolvePhiSlotChildExplicitAxes, resolvePhiSlotChildSizeConstraints, resolvePhiSlotChildSizeStyle, resolvePhiSlotSizePolicy, } from "./slot-size-policy";
7
+ import { buildPhiSlotChildClassName, buildPhiSlotChildDataAttributes, resolvePhiEffectiveSlotSizePolicy, resolvePhiSlotChildBaseStyle, resolvePhiSlotChildExplicitAxes, resolvePhiSlotChildProfileStyle, resolvePhiSlotChildSizeConstraints, resolvePhiSlotChildSizeStyle, resolvePhiSlotSizePolicy, } from "./slot-size-policy";
8
8
  import { resolvePhiRenderableBlockGeometry } from "../../types/renderable-block-geometry";
9
9
  import { joinPhiClassNames } from "../../helpers/class-names";
10
+ import { omitPhiBlockProfiledDeclarations } from "../../helpers/block-geometry-profiles";
10
11
  export function requiresPhiSlotChildEffectsObserver(config, disableEffects = false) {
11
12
  if (disableEffects) {
12
13
  return false;
@@ -40,16 +41,25 @@ export function PhiSlotChildFrameView({ kind, slotSizePolicy, surfacePolicy, blo
40
41
  const effectsAttributes = disableEffects
41
42
  ? undefined
42
43
  : resolveRenderableBlockEffectsAttributes(resolvedConfig);
44
+ /*
45
+ * A declaration that names a value per profile is the stylesheet's, not the inline style's: the frame
46
+ * writes the three answers as custom properties and `styles/layout.css` picks one by the room the
47
+ * nearest `phi-slot` container offers (LAYOUTING.md, "Block geometry per profile").
48
+ */
49
+ const profile = resolvePhiSlotChildProfileStyle(geometry, policy);
43
50
  const surface = kind === "widget" && surfacePolicy === "frame"
44
51
  ? resolvePhiSurfaceStyle(resolvedConfig.surface, { cornerFallback: PHI_LAYOUT_SURFACE_RADIUS })
45
52
  : null;
46
- return (_jsxs("div", { ref: anchorRef, hidden: resolvedVisibility === "hidden", className: joinPhiClassNames(buildPhiSlotChildClassName(policy), className, resolvedConfig.className, surface?.className), "data-phi-slot-child-frame": "true", "data-phi-renderable-block": "true", "data-phi-slot-child-kind": kind, "data-phi-block-id": blockId ?? undefined, "data-phi-signal-receiver": receiver ?? undefined, "data-phi-block-render-mode": resolvedConfig.renderMode, "data-phi-block-visibility": resolvedVisibility, "data-phi-viewport-flags": resolvedConfig.viewportFlags || undefined, "data-phi-block-enabled": resolvedEnabled ? "true" : "false", "data-phi-debug-scaffold": resolvedConfig.debugMode ? "on" : undefined, "data-phi-builder-widget-title": builderWidgetTitle?.trim() || undefined, "data-phi-builder-widget-selected": builderWidgetSelected ? "true" : undefined, "data-phi-builder-popup-open": builderWidgetPopupOpen ? "true" : undefined, ...effectsAttributes, "data-phi-effects-state": effectsState ?? effectsAttributes?.["data-phi-effects-state"], ...buildPhiSlotChildDataAttributes(policy, {
53
+ return (_jsxs("div", { ref: anchorRef, hidden: resolvedVisibility === "hidden", className: joinPhiClassNames(buildPhiSlotChildClassName(policy), className, resolvedConfig.className, surface?.className), "data-phi-slot-child-frame": "true", "data-phi-renderable-block": "true", "data-phi-slot-child-kind": kind, "data-phi-block-id": blockId ?? undefined, "data-phi-signal-receiver": receiver ?? undefined, "data-phi-block-render-mode": resolvedConfig.renderMode, "data-phi-block-visibility": resolvedVisibility, "data-phi-viewport-flags": resolvedConfig.viewportFlags || undefined, "data-phi-block-enabled": resolvedEnabled ? "true" : "false", "data-phi-debug-scaffold": resolvedConfig.debugMode ? "on" : undefined, "data-phi-builder-widget-title": builderWidgetTitle?.trim() || undefined, "data-phi-builder-widget-selected": builderWidgetSelected ? "true" : undefined, "data-phi-builder-popup-open": builderWidgetPopupOpen ? "true" : undefined, ...effectsAttributes, "data-phi-effects-state": effectsState ?? effectsAttributes?.["data-phi-effects-state"], ...profile.attributes, ...buildPhiSlotChildDataAttributes(policy, {
47
54
  explicitInlineSize: resolvedExplicitInlineSize,
48
55
  explicitBlockSize: resolvedExplicitBlockSize,
49
56
  ...resolvePhiSlotChildSizeConstraints(geometry),
50
57
  }), style: {
51
- ...resolvePhiSlotChildBaseStyle(policy),
52
- ...resolvePhiSlotChildSizeStyle(geometry, policy),
58
+ ...omitPhiBlockProfiledDeclarations({
59
+ ...resolvePhiSlotChildBaseStyle(policy),
60
+ ...resolvePhiSlotChildSizeStyle(geometry, policy),
61
+ }, profile.declarations),
62
+ ...profile.properties,
53
63
  ...surface?.style,
54
64
  ...(resolvedConfig.zIndex == null ? {} : { zIndex: resolvedConfig.zIndex }),
55
65
  ...(resolvedConfig.opacity == null ? {} : { opacity: resolvedConfig.opacity }),
@@ -5,8 +5,13 @@ import { PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT } from "../../helpers/rend
5
5
  function resolveRangePoint(point, rect, viewportWidth, viewportHeight, axis) {
6
6
  const viewportSize = axis === "x" ? viewportWidth : viewportHeight;
7
7
  const targetSize = axis === "x" ? rect.width : rect.height;
8
+ /*
9
+ * A number is a share of the viewport along the axis, where the block's leading edge stands: 0 the top
10
+ * (or left) edge, 1 the bottom (or right) -- the same 0..1 the config reader keeps it to. It was taken
11
+ * as pixels here, so every number landed within a pixel of the top and the effect became a switch.
12
+ */
8
13
  if (typeof point === "number" && Number.isFinite(point)) {
9
- return point;
14
+ return point * viewportSize;
10
15
  }
11
16
  if (point === "center") {
12
17
  return viewportSize / 2 - targetSize / 2;
@@ -45,8 +50,34 @@ function formatViewportEffectValue(value, unit) {
45
50
  }
46
51
  return `${value}${unit ?? PHI_RENDERABLE_BLOCK_DEFAULT_VIEWPORT_EFFECT.unit ?? "px"}`;
47
52
  }
53
+ /**
54
+ * Where the block lies in the viewport as laid out, before its own transform.
55
+ *
56
+ * The effect moves, turns and scales the block, so its drawn box is a product of the last answer: a turn
57
+ * seen in perspective makes the box taller, which moves its top, which moves the progress, which moves
58
+ * the turn. Measured that way the block swung between two states on every scroll -- plainly so in Firefox
59
+ * on a strongly turned picture. The layout box is what the scroll alone moves. Transforms of ancestors
60
+ * are not undone; a viewport effect inside a transformed parent is measured as laid out there.
61
+ */
62
+ function readViewportLayoutRect(target) {
63
+ let left = 0;
64
+ let top = 0;
65
+ for (let node = target; node; node = node.offsetParent) {
66
+ left += node.offsetLeft;
67
+ top += node.offsetTop;
68
+ if (!node.offsetParent && getComputedStyle(node).position === "fixed") {
69
+ return new DOMRect(left, top, target.offsetWidth, target.offsetHeight);
70
+ }
71
+ }
72
+ // Scrolled boxes between the block and the page move it as the window's scroll does.
73
+ for (let node = target.parentElement; node && node !== document.body && node !== document.documentElement; node = node.parentElement) {
74
+ left -= node.scrollLeft;
75
+ top -= node.scrollTop;
76
+ }
77
+ return new DOMRect(left - window.scrollX, top - window.scrollY, target.offsetWidth, target.offsetHeight);
78
+ }
48
79
  function resolveViewportEffectValues(effects, target) {
49
- const rect = target.getBoundingClientRect();
80
+ const rect = readViewportLayoutRect(target);
50
81
  const viewportWidth = window.innerWidth;
51
82
  const viewportHeight = window.innerHeight;
52
83
  const values = {
@@ -166,13 +197,22 @@ export function PhiSlotChildViewportEffectsObserver({ effects, }) {
166
197
  }
167
198
  }, { rootMargin: "50% 50% 50% 50%", threshold: 0 });
168
199
  const handleScrollOrResize = () => scheduleUpdate();
200
+ /*
201
+ * The block's own size moves its range: an image that arrives after the first measure gives the block
202
+ * its height only then. Without a second measure the effect kept the value it worked out against the
203
+ * empty box until the first scroll -- in Firefox, where images arrive after the first frame, the
204
+ * picture stood in a later state and jumped on the first scroll away from the top.
205
+ */
206
+ const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(scheduleUpdate);
169
207
  target.style.setProperty("--phi-effects-viewport-scale", "1");
170
208
  observer.observe(target);
209
+ resizeObserver?.observe(target);
171
210
  window.addEventListener("scroll", handleScrollOrResize, { passive: true });
172
211
  window.addEventListener("resize", handleScrollOrResize);
173
212
  scheduleUpdate();
174
213
  return () => {
175
214
  observer.disconnect();
215
+ resizeObserver?.disconnect();
176
216
  window.removeEventListener("scroll", handleScrollOrResize);
177
217
  window.removeEventListener("resize", handleScrollOrResize);
178
218
  if (frameId != null) {
@@ -1,6 +1,7 @@
1
1
  import { type CSSProperties, type ReactNode } from "react";
2
2
  import type { PhiSlotAxisSizePolicy, PhiSlotSizePolicy, PhiNormalizedSlotSizePolicy } from "../../types";
3
3
  import { type PhiRenderableBlockGeometryInput, type PhiResolvedBlockGeometry } from "../../types/renderable-block-geometry";
4
+ import { type PhiBlockProfileStyle } from "../../helpers/block-geometry-profiles";
4
5
  export type PhiSlotChildKind = "widget" | "layout";
5
6
  export type PhiSlotChildSizing = {
6
7
  policy: PhiNormalizedSlotSizePolicy;
@@ -10,6 +11,11 @@ export type PhiSlotChildSizing = {
10
11
  minBlockSize?: CSSProperties["minHeight"];
11
12
  maxInlineSize?: CSSProperties["maxWidth"];
12
13
  maxBlockSize?: CSSProperties["maxHeight"];
14
+ /**
15
+ * The child names a value per profile, so the box that offers it room has to be the `phi-slot`
16
+ * container its queries ask (design/RESPONSIVE_BLOCK_GEOMETRY.md, "Only where it is needed").
17
+ */
18
+ queriesRoom: boolean;
13
19
  };
14
20
  export declare function resolvePhiSlotSizePolicy(policy: PhiSlotSizePolicy | null | undefined, kind: PhiSlotChildKind): PhiNormalizedSlotSizePolicy;
15
21
  export declare function resolvePhiSlotChildExplicitAxes(geometry: PhiResolvedBlockGeometry): {
@@ -80,3 +86,12 @@ export declare function buildPhiSlotChildDataAttributes(policy: PhiNormalizedSlo
80
86
  export declare function resolvePhiSlotChildSizing(child: ReactNode, fallbackKind?: PhiSlotChildKind): PhiSlotChildSizing;
81
87
  export declare function resolvePhiSlotChildBaseStyle(policy: PhiNormalizedSlotSizePolicy): CSSProperties;
82
88
  export declare function resolvePhiSlotChildSizeStyle(geometry: PhiResolvedBlockGeometry, policy: PhiNormalizedSlotSizePolicy): CSSProperties;
89
+ /**
90
+ * The frame's profile answers, handed to the stylesheet (`helpers/block-geometry-profiles.ts`).
91
+ *
92
+ * The cap rule applies per profile by the same test as the base answer: an absolute inline maximum is
93
+ * capped at the slot unless the child is `intrinsic`. A declaration handed over is left out of the
94
+ * frame's inline style -- base style included -- because an inline declaration beats every
95
+ * `@container` rule.
96
+ */
97
+ export declare function resolvePhiSlotChildProfileStyle(geometry: PhiResolvedBlockGeometry, policy: PhiNormalizedSlotSizePolicy): PhiBlockProfileStyle;
@@ -1,6 +1,7 @@
1
1
  import { isValidElement } from "react";
2
2
  import { PHI_SLOT_BLOCK_PLACEMENT_MARGIN_STYLE, PHI_SLOT_INLINE_PLACEMENT_MARGIN_STYLE, } from "../../components/layouts/phi-layout-contract";
3
3
  import { resolvePhiRenderableBlockGeometry, } from "../../types/renderable-block-geometry";
4
+ import { PHI_BLOCK_PROFILED_ATTRIBUTE, phiBlockGeometryQueriesRoom, resolvePhiBlockProfileStyle, } from "../../helpers/block-geometry-profiles";
4
5
  /*
5
6
  * What a child sizes like when nothing says otherwise.
6
7
  *
@@ -129,6 +130,7 @@ export function resolvePhiSlotChildSizingForConfig(kind, slotSizePolicy, config)
129
130
  policy: resolvePhiEffectiveSlotSizePolicy(resolvePhiSlotSizePolicy(slotSizePolicy, kind), explicit),
130
131
  ...explicit,
131
132
  ...resolvePhiSlotChildSizeConstraints(geometry),
133
+ queriesRoom: phiBlockGeometryQueriesRoom(geometry),
132
134
  };
133
135
  }
134
136
  export function buildPhiSlotChildClassName(policy) {
@@ -162,6 +164,7 @@ export function resolvePhiSlotChildSizing(child, fallbackKind = "widget") {
162
164
  policy: resolvePhiSlotSizePolicy(undefined, fallbackKind),
163
165
  explicitInlineSize: false,
164
166
  explicitBlockSize: false,
167
+ queriesRoom: false,
165
168
  };
166
169
  }
167
170
  const props = child.props;
@@ -177,6 +180,7 @@ export function resolvePhiSlotChildSizing(child, fallbackKind = "widget") {
177
180
  * stretched what the frame had sized.
178
181
  */
179
182
  const configExplicit = resolvePhiSlotChildExplicitAxes(configGeometry);
183
+ const queriesRoom = phiBlockGeometryQueriesRoom(configGeometry) || typeof props[PHI_BLOCK_PROFILED_ATTRIBUTE] === "string";
180
184
  if (props.slotSizePolicy != null || props.kind != null) {
181
185
  const resolvedKind = props.kind === "widget" || props.kind === "layout"
182
186
  ? props.kind
@@ -193,6 +197,7 @@ export function resolvePhiSlotChildSizing(child, fallbackKind = "widget") {
193
197
  policy: resolvePhiEffectiveSlotSizePolicy(resolvePhiSlotSizePolicy(props.slotSizePolicy, resolvedKind), explicit),
194
198
  ...explicit,
195
199
  ...configConstraints,
200
+ queriesRoom,
196
201
  };
197
202
  }
198
203
  const policy = resolvePhiSlotSizePolicy({
@@ -215,6 +220,7 @@ export function resolvePhiSlotChildSizing(child, fallbackKind = "widget") {
215
220
  // Idempotent: an element that already wrote the effective policy into its attributes says the same again.
216
221
  policy: resolvePhiEffectiveSlotSizePolicy(policy, explicit),
217
222
  ...explicit,
223
+ queriesRoom,
218
224
  minInlineSize: configConstraints.minInlineSize ??
219
225
  (typeof props["data-phi-slot-min-inline-size"] === "string"
220
226
  ? props["data-phi-slot-min-inline-size"]
@@ -320,3 +326,26 @@ export function resolvePhiSlotChildSizeStyle(geometry, policy) {
320
326
  ...(geometry.block.max == null ? {} : { maxHeight: geometry.block.max.css }),
321
327
  };
322
328
  }
329
+ /** What the frame writes where a profile states nothing: its own base style for a block without geometry. */
330
+ const PHI_SLOT_CHILD_UNSTATED_PROFILE_VALUES = {
331
+ width: "auto",
332
+ height: "auto",
333
+ "min-width": "0",
334
+ "min-height": "0",
335
+ "max-width": "100%",
336
+ "max-height": "100%",
337
+ };
338
+ /**
339
+ * The frame's profile answers, handed to the stylesheet (`helpers/block-geometry-profiles.ts`).
340
+ *
341
+ * The cap rule applies per profile by the same test as the base answer: an absolute inline maximum is
342
+ * capped at the slot unless the child is `intrinsic`. A declaration handed over is left out of the
343
+ * frame's inline style -- base style included -- because an inline declaration beats every
344
+ * `@container` rule.
345
+ */
346
+ export function resolvePhiSlotChildProfileStyle(geometry, policy) {
347
+ return resolvePhiBlockProfileStyle(geometry, {
348
+ unstated: PHI_SLOT_CHILD_UNSTATED_PROFILE_VALUES,
349
+ inlineMaximum: (maximum) => resolvePhiSlotChildInlineMaximum(maximum, policy.inline) ?? maximum.css,
350
+ });
351
+ }
@@ -95,6 +95,9 @@ export const PHI_ASSET_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
95
95
  },
96
96
  actions: [
97
97
  { key: "createFolder", title: "Create folder", scope: "resource" },
98
+ // The Folder the listing is filtered to; Core refuses every change to what a locked one holds.
99
+ { key: "lockFolder", title: "Lock folder", scope: "resource" },
100
+ { key: "unlockFolder", title: "Unlock folder", scope: "resource" },
98
101
  { key: "upload", title: "Upload", scope: "resource", panelKey: "upload" },
99
102
  { key: "refresh", title: "Reload", scope: "resource" },
100
103
  { key: "update", title: "Update", scope: "item" },
@@ -4,6 +4,7 @@ import { PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY } from "../../../../constants/media
4
4
  import { createPhiCollectionProviderClient } from "../../../../components/widgets/client/shared/phi-collection-provider";
5
5
  import { buildPhiMediaRequestHeaders } from "../../../../components/media/phi-media-request-headers";
6
6
  import { readPhiImagePreviewResponse } from "../../../../components/media/phi-image-preview-data";
7
+ import { PHI_MEDIA_FOLDER_LOCKED_CODE, PhiMediaFolderLockedError, writePhiMediaFolderLock, } from "../../../../components/media/media-folder-lock";
7
8
  function readFilter(query, key) {
8
9
  return query.filters?.[key];
9
10
  }
@@ -103,8 +104,19 @@ function readAssetId(value) {
103
104
  }
104
105
  return assetId;
105
106
  }
107
+ function readFolderId(value) {
108
+ const folderId = typeof value === "number" ? value : Number(value);
109
+ if (!Number.isInteger(folderId) || folderId <= 0) {
110
+ throw new Error("Folder action requires a positive folder id.");
111
+ }
112
+ return folderId;
113
+ }
106
114
  async function readMutationResponse(response) {
107
115
  const payload = await response.json().catch(() => null);
116
+ // Core's word for a write a locked Folder refuses, kept as a code so the surface reads it in its own.
117
+ if (payload?.error === PHI_MEDIA_FOLDER_LOCKED_CODE) {
118
+ throw new PhiMediaFolderLockedError(payload.message);
119
+ }
108
120
  if (!response.ok || !payload) {
109
121
  throw new Error(payload?.message ?? payload?.error ?? `Media request failed with status ${response.status}.`);
110
122
  }
@@ -140,6 +152,28 @@ async function runMediaCollectionAction(request) {
140
152
  }));
141
153
  actionItem = payload.asset ?? null;
142
154
  }
155
+ else if (request.actionKey === "lockFolder" || request.actionKey === "unlockFolder") {
156
+ /*
157
+ * The lock is one bit of the Folder's flags, and the flags are written whole: the Folder's current
158
+ * flags come with the action, so the other bits are kept as they are. The Space is the one the
159
+ * listing reads, because a Folder belongs to the Space it was listed from.
160
+ */
161
+ const folderId = readFolderId(request.itemKey);
162
+ const flags = typeof request.item?.flags === "number" ? request.item.flags : 0;
163
+ const spaceId = request.query?.filters?.spaceId;
164
+ const search = typeof spaceId === "string" && spaceId ? `?${new URLSearchParams({ spaceId }).toString()}` : "";
165
+ await readMutationResponse(await fetch(`/api/site/media/folders/${folderId}${search}`, {
166
+ method: "PATCH",
167
+ headers: buildPhiMediaRequestHeaders({
168
+ Accept: "application/json",
169
+ "Content-Type": "application/json",
170
+ }),
171
+ cache: "no-store",
172
+ credentials: "include",
173
+ signal: request.signal,
174
+ body: JSON.stringify({ flags: writePhiMediaFolderLock(flags, request.actionKey === "lockFolder") }),
175
+ }));
176
+ }
143
177
  else if (request.actionKey !== "refresh") {
144
178
  throw new Error(`Unsupported Asset collection action "${request.actionKey}".`);
145
179
  }
@@ -6,6 +6,7 @@ import { readPhiMediaFolders } from "../../../../components/media/phi-image-prev
6
6
  import { PHI_ASSET_CONTROLLER_STORE_KEY } from "../../../../components/media/asset-controller-signals";
7
7
  import { phiImagePreviewStore } from "../../../../components/media/phi-image-preview-store";
8
8
  import { buildPhiMediaFolderCascaderOptions, buildPhiMediaFolderNamesById, buildPhiMediaFolderValueById, } from "../../../../components/media/media-folder-options";
9
+ import { isPhiMediaFolderLocked } from "../../../../components/media/media-folder-lock";
9
10
  export const PhiMediaFoldersOptionsProviderClient = createPhiControlOptionsProviderClient({
10
11
  key: PHI_ASSET_RUNTIME_DATA_PROVIDER_KEYS.mediaFolders,
11
12
  subscribe: (listener) => phiImagePreviewStore.subscribe(PHI_ASSET_CONTROLLER_STORE_KEY, listener),
@@ -19,7 +20,15 @@ export const PhiMediaFoldersOptionsProviderClient = createPhiControlOptionsProvi
19
20
  return {
20
21
  options: [
21
22
  ...configuredOptions,
22
- ...state.folders.map((folder) => ({ value: String(folder.id), label: namePath(folder.id) })),
23
+ /*
24
+ * The Asset's Folder, chosen in its metadata: a locked Folder takes nothing in, so it is not
25
+ * offered as a destination. The one the Asset already stands in stays readable as the value.
26
+ */
27
+ ...state.folders.map((folder) => ({
28
+ value: String(folder.id),
29
+ label: namePath(folder.id),
30
+ ...(isPhiMediaFolderLocked(folder) ? { icon: "lock", disabled: true } : {}),
31
+ })),
23
32
  ],
24
33
  value: state.folderId == null ? undefined : String(state.folderId),
25
34
  };
@@ -32,7 +41,15 @@ export const PhiMediaFoldersOptionsProviderClient = createPhiControlOptionsProvi
32
41
  return {
33
42
  options: [
34
43
  ...configuredOptions,
35
- ...state.folders.map((folder) => ({ value: namePath(folder.id), label: folder.name })),
44
+ /*
45
+ * A parent for a new Folder. A locked one is marked rather than disabled: a disabled row in a
46
+ * cascader cannot be opened, and the Folders below a locked one still take new ones.
47
+ */
48
+ ...state.folders.map((folder) => ({
49
+ value: namePath(folder.id),
50
+ label: folder.name,
51
+ ...(isPhiMediaFolderLocked(folder) ? { icon: "lock" } : {}),
52
+ })),
36
53
  ],
37
54
  value: namePath(state.folderId),
38
55
  };
@@ -415,7 +415,16 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
415
415
  control: "cascader",
416
416
  placeholder: mediaLabels?.tool.folderLabel ?? "Folder",
417
417
  width: 168,
418
+ /*
419
+ * The lock of the chosen Folder, beside the cascader that chose it. Its label is the
420
+ * Widget's own (lock or unlock, by the Folder's state); naming it here only places it.
421
+ */
418
422
  actions: [{
423
+ key: "lockFolder",
424
+ label: mediaLabels?.tool.lockFolderLabel ?? "Lock folder",
425
+ icon: "antd:lock",
426
+ display: "icon",
427
+ }, {
419
428
  key: "createFolder",
420
429
  label: mediaLabels?.tool.createFolderLabel ?? "Create folder",
421
430
  description: mediaLabels?.tool.createFolderLabel ?? "Create folder",
@@ -1,20 +1,22 @@
1
1
  import { createPhiPresetCmsInstanceIdMap } from "../../../../types/cms-instance-id";
2
2
  import { PHI_AUTH_RUNTIME_MODULE_ID } from "../ids";
3
3
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../../constants/cms-layout-types";
4
- import { PhiCmsFlags, PhiCmsPageType, PhiCmsRegionType } from "../../../../constants/phi-cms";
4
+ import { PhiCmsFlags, PhiCmsPageType } from "../../../../constants/phi-cms";
5
+ import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "../../../../components/regions/presets/phi-base-page-layout";
5
6
  import { createPhiCmsPresetNodes } from "../../../../helpers/cms-preset-nodes";
6
7
  export function buildPhiAuthRuntimePageTree({ page, presetKey, widgetTypeKey, label, }) {
7
8
  const layouts = createPhiPresetCmsInstanceIdMap({
8
9
  domain: "page",
9
10
  ownerModuleId: PHI_AUTH_RUNTIME_MODULE_ID,
10
11
  presetKey,
11
- }, ["layoutRoot"]);
12
+ }, ["layoutCentre"]);
12
13
  const widgets = createPhiPresetCmsInstanceIdMap({
13
14
  domain: "page",
14
15
  ownerModuleId: PHI_AUTH_RUNTIME_MODULE_ID,
15
16
  presetKey,
16
17
  }, ["widgetMain"]);
17
18
  const nodes = createPhiCmsPresetNodes(page);
19
+ const scaffold = buildPhiBasePageContentScaffold({ page, regionId: -483 });
18
20
  return {
19
21
  page: nodes.page({ pageType: PhiCmsPageType.Standard }),
20
22
  pageMeta: {
@@ -22,27 +24,29 @@ export function buildPhiAuthRuntimePageTree({ page, presetKey, widgetTypeKey, la
22
24
  description: null,
23
25
  },
24
26
  overlays: [],
25
- regions: [nodes.region({
26
- id: -483,
27
- regionType: PhiCmsRegionType.Content,
28
- rootLayoutNodeId: layouts.layoutRoot,
29
- sortOrder: 30,
30
- config: {},
31
- })],
32
- layoutNodes: [nodes.layout({
33
- id: layouts.layoutRoot,
34
- parentLayoutNodeId: null,
35
- creationPreset: { layoutKind: "content", preset: "panel" },
36
- typeKey: "content",
27
+ regions: [scaffold.region],
28
+ layoutNodes: [
29
+ // The base scaffold every module Page stands on.
30
+ scaffold.layoutNode,
31
+ /*
32
+ * The sign-out stands in the middle of the screen, where the scaffold alone would put it at the
33
+ * top: a vertical Flex that fills the scaffold and centres its one Widget both ways. No panel preset,
34
+ * so it adds no padding to the scaffold's.
35
+ */
36
+ nodes.layout({
37
+ typeKey: "flex-vertical",
38
+ id: layouts.layoutCentre,
39
+ parentLayoutNodeId: PHI_BASE_PAGE_LAYOUT_NODE_ID,
37
40
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
38
41
  sortOrder: 0,
39
42
  label,
40
- config: {},
41
- })],
43
+ config: { anchor: { horizontal: "center", vertical: "middle" } },
44
+ }),
45
+ ],
42
46
  contentWidgets: [nodes.widget({
43
47
  typeKey: widgetTypeKey,
44
48
  id: widgets.widgetMain,
45
- parentLayoutNodeId: layouts.layoutRoot,
49
+ parentLayoutNodeId: layouts.layoutCentre,
46
50
  slotIndex: PHI_CMS_DEFAULT_SLOT_INDEX,
47
51
  sortOrder: 0,
48
52
  label,
@@ -46,6 +46,8 @@ export function PhiAccountAvatarPickerWidgetClient({ labels, config, }) {
46
46
  errorQuotaExceeded: labels.feedback.errorQuotaExceeded,
47
47
  errorSpaceUnavailable: labels.feedback.errorSpaceUnavailable,
48
48
  errorStorageUnreachable: labels.feedback.errorStorageUnreachable,
49
+ // An avatar is written into the person's own Space and names no Folder, so no lock can refuse it.
50
+ errorFolderLocked: labels.feedback.errorGeneric,
49
51
  }), [labels]);
50
52
  const { accept, items, upload } = usePhiMediaUpload({
51
53
  labels: uploadLabels,
@@ -58,7 +58,7 @@ export function PhiDeveloperBuilderRegionInspectorWidgetClient({ section, builde
58
58
  {
59
59
  key: "geometry",
60
60
  title: "Geometry",
61
- children: (_jsxs("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: [_jsx(PhiGeometryControl, { mode: "control", disabled: isPreviewMode, showViewport: false, showSticky: stickyEdge !== null, showOffsetTop: stickyEdge === "top", value: effectiveDraft, onChange: (geometry) => updateDraft(geometry), labels: geometryLabels }), stickyEdge === "bottom" ? renderPhiInspectorConfigField({
61
+ children: (_jsxs("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: [_jsx(PhiGeometryControl, { mode: "control", disabled: isPreviewMode, showViewport: false, showProfiles: false, showSticky: stickyEdge !== null, showOffsetTop: stickyEdge === "top", value: effectiveDraft, onChange: (geometry) => updateDraft(geometry), labels: geometryLabels }), stickyEdge === "bottom" ? renderPhiInspectorConfigField({
62
62
  field: { key: "offsetBottom", type: "length", label: geometryLabels?.fields.offsetBottom ?? "Offset bottom", min: 0 },
63
63
  value: effectiveDraft.regionConfig?.offsetBottom,
64
64
  defaultValue: undefined,