@kywi-software/core 0.11.0 → 0.12.1

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 (216) hide show
  1. package/AGENT-PATTERNS.md +96 -10
  2. package/dist/admin/content-form.d.ts.map +1 -1
  3. package/dist/admin/content-form.js +97 -10
  4. package/dist/admin/content-form.js.map +1 -1
  5. package/dist/admin/layout-editor/component-actions.d.ts +219 -22
  6. package/dist/admin/layout-editor/component-actions.d.ts.map +1 -1
  7. package/dist/admin/layout-editor/component-actions.js +356 -36
  8. package/dist/admin/layout-editor/component-actions.js.map +1 -1
  9. package/dist/admin/layout-editor/component-fork.d.ts +224 -0
  10. package/dist/admin/layout-editor/component-fork.d.ts.map +1 -0
  11. package/dist/admin/layout-editor/component-fork.js +342 -0
  12. package/dist/admin/layout-editor/component-fork.js.map +1 -0
  13. package/dist/admin/layout-editor/editor-canvas.d.ts +12 -0
  14. package/dist/admin/layout-editor/editor-canvas.d.ts.map +1 -1
  15. package/dist/admin/layout-editor/editor-canvas.js +76 -12
  16. package/dist/admin/layout-editor/editor-canvas.js.map +1 -1
  17. package/dist/admin/layout-editor/editor-dialog.d.ts +164 -0
  18. package/dist/admin/layout-editor/editor-dialog.d.ts.map +1 -0
  19. package/dist/admin/layout-editor/editor-dialog.js +195 -0
  20. package/dist/admin/layout-editor/editor-dialog.js.map +1 -0
  21. package/dist/admin/layout-editor/editor-state.d.ts +76 -0
  22. package/dist/admin/layout-editor/editor-state.d.ts.map +1 -1
  23. package/dist/admin/layout-editor/editor-state.js +47 -1
  24. package/dist/admin/layout-editor/editor-state.js.map +1 -1
  25. package/dist/admin/layout-editor/editor.css +279 -2
  26. package/dist/admin/layout-editor/index.d.ts +10 -1
  27. package/dist/admin/layout-editor/index.d.ts.map +1 -1
  28. package/dist/admin/layout-editor/index.js +11 -1
  29. package/dist/admin/layout-editor/index.js.map +1 -1
  30. package/dist/admin/layout-editor/layout-editor.d.ts +58 -1
  31. package/dist/admin/layout-editor/layout-editor.d.ts.map +1 -1
  32. package/dist/admin/layout-editor/layout-editor.js +161 -190
  33. package/dist/admin/layout-editor/layout-editor.js.map +1 -1
  34. package/dist/admin/layout-editor/linked-component.d.ts +38 -0
  35. package/dist/admin/layout-editor/linked-component.d.ts.map +1 -0
  36. package/dist/admin/layout-editor/linked-component.js +42 -0
  37. package/dist/admin/layout-editor/linked-component.js.map +1 -0
  38. package/dist/admin/layout-editor/module-overlay.d.ts +10 -1
  39. package/dist/admin/layout-editor/module-overlay.d.ts.map +1 -1
  40. package/dist/admin/layout-editor/module-overlay.js +33 -4
  41. package/dist/admin/layout-editor/module-overlay.js.map +1 -1
  42. package/dist/admin/layout-editor/node-lookup.d.ts +34 -0
  43. package/dist/admin/layout-editor/node-lookup.d.ts.map +1 -1
  44. package/dist/admin/layout-editor/node-lookup.js +90 -0
  45. package/dist/admin/layout-editor/node-lookup.js.map +1 -1
  46. package/dist/admin/layout-editor/overlay-shell.d.ts.map +1 -1
  47. package/dist/admin/layout-editor/overlay-shell.js +114 -23
  48. package/dist/admin/layout-editor/overlay-shell.js.map +1 -1
  49. package/dist/admin/layout-editor/props-panel.d.ts +55 -1
  50. package/dist/admin/layout-editor/props-panel.d.ts.map +1 -1
  51. package/dist/admin/layout-editor/props-panel.js +118 -9
  52. package/dist/admin/layout-editor/props-panel.js.map +1 -1
  53. package/dist/admin/layout-editor/section-overlay.d.ts +9 -1
  54. package/dist/admin/layout-editor/section-overlay.d.ts.map +1 -1
  55. package/dist/admin/layout-editor/section-overlay.js +14 -4
  56. package/dist/admin/layout-editor/section-overlay.js.map +1 -1
  57. package/dist/admin/layout-editor/section-template-picker.d.ts +27 -1
  58. package/dist/admin/layout-editor/section-template-picker.d.ts.map +1 -1
  59. package/dist/admin/layout-editor/section-template-picker.js +71 -17
  60. package/dist/admin/layout-editor/section-template-picker.js.map +1 -1
  61. package/dist/admin/layout-editor/use-component-connect.d.ts +65 -0
  62. package/dist/admin/layout-editor/use-component-connect.d.ts.map +1 -0
  63. package/dist/admin/layout-editor/use-component-connect.js +294 -0
  64. package/dist/admin/layout-editor/use-component-connect.js.map +1 -0
  65. package/dist/admin/layout-editor/use-component-fork.d.ts +123 -0
  66. package/dist/admin/layout-editor/use-component-fork.d.ts.map +1 -0
  67. package/dist/admin/layout-editor/use-component-fork.js +346 -0
  68. package/dist/admin/layout-editor/use-component-fork.js.map +1 -0
  69. package/dist/admin/layout-editor/use-component-library.d.ts +94 -0
  70. package/dist/admin/layout-editor/use-component-library.d.ts.map +1 -0
  71. package/dist/admin/layout-editor/use-component-library.js +55 -0
  72. package/dist/admin/layout-editor/use-component-library.js.map +1 -0
  73. package/dist/admin/registry.d.ts +11 -2
  74. package/dist/admin/registry.d.ts.map +1 -1
  75. package/dist/admin/registry.js +40 -4
  76. package/dist/admin/registry.js.map +1 -1
  77. package/dist/admin/server.d.ts +1 -0
  78. package/dist/admin/server.d.ts.map +1 -1
  79. package/dist/admin/server.js +5 -0
  80. package/dist/admin/server.js.map +1 -1
  81. package/dist/admin/styles/admin.css +43 -0
  82. package/dist/admin/surfaces/components/component-edit.d.ts +3 -0
  83. package/dist/admin/surfaces/components/component-edit.d.ts.map +1 -0
  84. package/dist/admin/surfaces/components/component-edit.js +235 -0
  85. package/dist/admin/surfaces/components/component-edit.js.map +1 -0
  86. package/dist/admin/surfaces/components/components-data.d.ts +153 -0
  87. package/dist/admin/surfaces/components/components-data.d.ts.map +1 -0
  88. package/dist/admin/surfaces/components/components-data.js +154 -0
  89. package/dist/admin/surfaces/components/components-data.js.map +1 -0
  90. package/dist/admin/surfaces/components/components-list.d.ts +3 -0
  91. package/dist/admin/surfaces/components/components-list.d.ts.map +1 -0
  92. package/dist/admin/surfaces/components/components-list.js +196 -0
  93. package/dist/admin/surfaces/components/components-list.js.map +1 -0
  94. package/dist/admin/surfaces/components/definition-canvas.d.ts +73 -0
  95. package/dist/admin/surfaces/components/definition-canvas.d.ts.map +1 -0
  96. package/dist/admin/surfaces/components/definition-canvas.js +207 -0
  97. package/dist/admin/surfaces/components/definition-canvas.js.map +1 -0
  98. package/dist/admin/surfaces/layouts/layout-editor-client.d.ts.map +1 -1
  99. package/dist/admin/surfaces/layouts/layout-editor-client.js +14 -2
  100. package/dist/admin/surfaces/layouts/layout-editor-client.js.map +1 -1
  101. package/dist/admin/surfaces/layouts/layouts-data.d.ts +3 -14
  102. package/dist/admin/surfaces/layouts/layouts-data.d.ts.map +1 -1
  103. package/dist/admin/surfaces/layouts/layouts-data.js +4 -7
  104. package/dist/admin/surfaces/layouts/layouts-data.js.map +1 -1
  105. package/dist/admin/surfaces/layouts/layouts-list.d.ts.map +1 -1
  106. package/dist/admin/surfaces/layouts/layouts-list.js +16 -22
  107. package/dist/admin/surfaces/layouts/layouts-list.js.map +1 -1
  108. package/dist/admin/surfaces/settings/admin-features.d.ts.map +1 -1
  109. package/dist/admin/surfaces/settings/admin-features.js +1 -0
  110. package/dist/admin/surfaces/settings/admin-features.js.map +1 -1
  111. package/dist/api/bulk-routes.d.ts.map +1 -1
  112. package/dist/api/bulk-routes.js +25 -0
  113. package/dist/api/bulk-routes.js.map +1 -1
  114. package/dist/api/changeset-routes.d.ts.map +1 -1
  115. package/dist/api/changeset-routes.js +17 -3
  116. package/dist/api/changeset-routes.js.map +1 -1
  117. package/dist/api/component-routes.d.ts.map +1 -1
  118. package/dist/api/component-routes.js +228 -8
  119. package/dist/api/component-routes.js.map +1 -1
  120. package/dist/api/content-routes.d.ts.map +1 -1
  121. package/dist/api/content-routes.js +64 -0
  122. package/dist/api/content-routes.js.map +1 -1
  123. package/dist/api/feed-routes.d.ts +6 -6
  124. package/dist/api/graphql/resolvers.d.ts +4 -4
  125. package/dist/api/layout-routes.d.ts.map +1 -1
  126. package/dist/api/layout-routes.js +4 -17
  127. package/dist/api/layout-routes.js.map +1 -1
  128. package/dist/api/layout-write-guard.d.ts +80 -0
  129. package/dist/api/layout-write-guard.d.ts.map +1 -0
  130. package/dist/api/layout-write-guard.js +88 -0
  131. package/dist/api/layout-write-guard.js.map +1 -0
  132. package/dist/api/section-template-routes.d.ts.map +1 -1
  133. package/dist/api/section-template-routes.js +11 -0
  134. package/dist/api/section-template-routes.js.map +1 -1
  135. package/dist/api/translation-routes.d.ts.map +1 -1
  136. package/dist/api/translation-routes.js +8 -0
  137. package/dist/api/translation-routes.js.map +1 -1
  138. package/dist/api/version-routes.d.ts.map +1 -1
  139. package/dist/api/version-routes.js +20 -8
  140. package/dist/api/version-routes.js.map +1 -1
  141. package/dist/api/workflow-routes.d.ts.map +1 -1
  142. package/dist/api/workflow-routes.js +53 -8
  143. package/dist/api/workflow-routes.js.map +1 -1
  144. package/dist/db/analytics-queries.d.ts +3 -3
  145. package/dist/db/apply-snapshot.d.ts +75 -8
  146. package/dist/db/apply-snapshot.d.ts.map +1 -1
  147. package/dist/db/apply-snapshot.js +104 -8
  148. package/dist/db/apply-snapshot.js.map +1 -1
  149. package/dist/db/audit-queries.d.ts +12 -12
  150. package/dist/db/category-queries.d.ts +3 -3
  151. package/dist/db/changeset-audit-queries.d.ts +4 -4
  152. package/dist/db/changeset-queries.d.ts +7 -7
  153. package/dist/db/comment-queries.d.ts +8 -8
  154. package/dist/db/comment-subscription-queries.d.ts +2 -2
  155. package/dist/db/component-instance-queries.d.ts +197 -0
  156. package/dist/db/component-instance-queries.d.ts.map +1 -0
  157. package/dist/db/component-instance-queries.js +405 -0
  158. package/dist/db/component-instance-queries.js.map +1 -0
  159. package/dist/db/content-queries.d.ts.map +1 -1
  160. package/dist/db/content-queries.js +39 -2
  161. package/dist/db/content-queries.js.map +1 -1
  162. package/dist/db/extension-queries.d.ts +7 -7
  163. package/dist/db/feed-queries.d.ts +3 -3
  164. package/dist/db/index.d.ts +1 -0
  165. package/dist/db/index.d.ts.map +1 -1
  166. package/dist/db/index.js +1 -0
  167. package/dist/db/index.js.map +1 -1
  168. package/dist/db/layout-queries.d.ts +13 -1
  169. package/dist/db/layout-queries.d.ts.map +1 -1
  170. package/dist/db/layout-queries.js +52 -7
  171. package/dist/db/layout-queries.js.map +1 -1
  172. package/dist/db/locale-queries.d.ts.map +1 -1
  173. package/dist/db/locale-queries.js +0 -0
  174. package/dist/db/locale-queries.js.map +1 -1
  175. package/dist/db/media-queries.d.ts +12 -12
  176. package/dist/db/revision-queries.d.ts +3 -3
  177. package/dist/db/site-admin-queries.d.ts +2 -2
  178. package/dist/db/site-membership-queries.d.ts +3 -3
  179. package/dist/db/site-plugin-queries.d.ts +2 -2
  180. package/dist/db/site-queries.d.ts +6 -6
  181. package/dist/db/version-queries.d.ts +12 -12
  182. package/dist/db/webhook-queries.d.ts +11 -11
  183. package/dist/db/workflow-queries.d.ts +6 -6
  184. package/dist/db/workflow-queries.d.ts.map +1 -1
  185. package/dist/db/workflow-queries.js +11 -2
  186. package/dist/db/workflow-queries.js.map +1 -1
  187. package/dist/layout/component-refs.d.ts +465 -0
  188. package/dist/layout/component-refs.d.ts.map +1 -0
  189. package/dist/layout/component-refs.js +848 -0
  190. package/dist/layout/component-refs.js.map +1 -0
  191. package/dist/layout/index.d.ts +2 -1
  192. package/dist/layout/index.d.ts.map +1 -1
  193. package/dist/layout/index.js +1 -0
  194. package/dist/layout/index.js.map +1 -1
  195. package/dist/layout/module-permissions.d.ts +49 -1
  196. package/dist/layout/module-permissions.d.ts.map +1 -1
  197. package/dist/layout/module-permissions.js +117 -6
  198. package/dist/layout/module-permissions.js.map +1 -1
  199. package/dist/layout/renderer.d.ts +51 -4
  200. package/dist/layout/renderer.d.ts.map +1 -1
  201. package/dist/layout/renderer.js +36 -38
  202. package/dist/layout/renderer.js.map +1 -1
  203. package/dist/layout/types.d.ts +42 -0
  204. package/dist/layout/types.d.ts.map +1 -1
  205. package/dist/layout/types.js +54 -11
  206. package/dist/layout/types.js.map +1 -1
  207. package/dist/schema/base.d.ts +1 -1
  208. package/dist/schema/components.d.ts +150 -0
  209. package/dist/schema/components.d.ts.map +1 -1
  210. package/dist/schema/components.js +50 -4
  211. package/dist/schema/components.js.map +1 -1
  212. package/dist/versioning/scheduler.d.ts +8 -0
  213. package/dist/versioning/scheduler.d.ts.map +1 -1
  214. package/dist/versioning/scheduler.js +21 -7
  215. package/dist/versioning/scheduler.js.map +1 -1
  216. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useReducer, useState, useCallback, useEffect, useRef } from 'react';
3
+ import { useReducer, useState, useCallback, useEffect, useMemo, useRef } from 'react';
4
4
  import { DndContext } from '@dnd-kit/core';
5
5
  import { editorReducer, createInitialState } from './editor-state.js';
6
6
  import { findModuleInDocument, findSectionInDocument, findVariantContainerInDocument, } from './node-lookup.js';
@@ -12,8 +12,9 @@ import { EditorCanvas } from './editor-canvas.js';
12
12
  import { PropsPanel } from './props-panel.js';
13
13
  import { SectionTemplatePicker } from './section-template-picker.js';
14
14
  import { ConfirmDialog } from '../primitives.js';
15
- import { adminFetch } from '../../host-client/index.js';
16
- import { saveAsComponent, detachModuleFromComponent, detachSectionFromComponent, resolveComponentDefinition } from './component-actions.js';
15
+ import { useComponentLibrary } from './use-component-library.js';
16
+ import { useComponentConnect } from './use-component-connect.js';
17
+ import { useComponentFork } from './use-component-fork.js';
17
18
  import './editor.css';
18
19
  // ── Helpers ───────────────────────────────────────────────────────────────────
19
20
  // Selection lookups are arm-aware (kywi-cms#92): a module or section living
@@ -22,42 +23,22 @@ import './editor.css';
22
23
  const findModuleById = findModuleInDocument;
23
24
  const findSectionById = findSectionInDocument;
24
25
  // ── Component ─────────────────────────────────────────────────────────────────
25
- export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents, onSave, onCancel, audiences, onChange, userRole, }) {
26
+ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents, onSave, onCancel, audiences, onChange, userRole, canvasKind = 'page', }) {
27
+ // One rule, two canvases (see `canvasKind`): a document that is not a page has
28
+ // no placements, so every placement-shaped affordance is withheld.
29
+ const componentActionsWithheld = canvasKind !== 'page';
26
30
  const [state, dispatch] = useReducer(editorReducer, initialLayout, createInitialState);
27
31
  const [showTemplatePicker, setShowTemplatePicker] = useState(false);
28
32
  const [templateRegion, setTemplateRegion] = useState(null);
29
33
  // Cancel-with-unsaved-changes confirm (kywi-cms#135) — mirrors overlay-shell's
30
34
  // exit-confirm pattern.
31
35
  const [confirmCancel, setConfirmCancel] = useState(false);
32
- // Saved reusable components (kywi-cms#46): loaded once so the props panel can
33
- // offer them in the picker and the canvas can preview connected nodes as their
34
- // real module. Best-effort a load failure just leaves the picker empty.
35
- const [components, setComponents] = useState([]);
36
- useEffect(() => {
37
- let cancelled = false;
38
- adminFetch('/api/v1/components?type=module')
39
- .then(r => (r.ok ? r.json() : Promise.reject(new Error(String(r.status)))))
40
- .then((body) => {
41
- if (!cancelled)
42
- setComponents(body.data ?? []);
43
- })
44
- .catch(() => { });
45
- return () => { cancelled = true; };
46
- }, []);
47
- // Saved section-type components (kywi-cms#69): loaded so the props panel can
48
- // name the linked-badge component for a selected linked section. Best-effort.
49
- const [sectionComponents, setSectionComponents] = useState([]);
50
- useEffect(() => {
51
- let cancelled = false;
52
- adminFetch('/api/v1/components?type=section')
53
- .then(r => (r.ok ? r.json() : Promise.reject(new Error(String(r.status)))))
54
- .then((body) => {
55
- if (!cancelled)
56
- setSectionComponents(body.data ?? []);
57
- })
58
- .catch(() => { });
59
- return () => { cancelled = true; };
60
- }, []);
36
+ // Saved reusable components of every type (kywi-cms#46/#69/#147), loaded once:
37
+ // the props panel offers them in the picker and names linked instances, the
38
+ // canvas previews connected module nodes as their real module, and detach /
39
+ // save-as-component read their definitions. Shared with the front-of-site
40
+ // overlay shell — one hook, one request (see use-component-library.ts).
41
+ const library = useComponentLibrary();
61
42
  // Shell parity with OverlayShell (kywi-cms#135 review): a host that unmounts
62
43
  // this editor as part of its own save handling — content-form.tsx's Layout
63
44
  // tab navigates away once the PUT resolves — would otherwise get the
@@ -81,35 +62,58 @@ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents,
81
62
  useEffect(() => {
82
63
  onChangeRef.current = onChange;
83
64
  });
84
- // Keep the host form in sync with every layout mutation. Skips the very
85
- // first (mount) render so we don't spuriously mark a pristine form dirty;
86
- // the initialLayout the parent already holds is authoritative until an
87
- // edit lands. Compared against the initial state.layout reference (set
88
- // once by useReducer's lazy init, stable across StrictMode's mount ->
89
- // unmount -> remount double-invoke) rather than a boolean ref, since a
90
- // boolean would already read `true` on the post-StrictMode-remount render
91
- // and let the pristine layout spuriously fire onChange.
65
+ // Keep the host form in sync with every layout mutation. Skips any render
66
+ // where the document is still the last-saved one, so we don't spuriously
67
+ // mark a pristine form dirty; the layout the parent already holds is
68
+ // authoritative until an edit lands.
69
+ //
70
+ // Compared against `state.originalLayout` rather than a mount-time ref. That
71
+ // is the same thing at mount (both are the initial document, and the reducer
72
+ // sets `originalLayout` once in its lazy init, so it is stable across
73
+ // StrictMode's mount -> unmount -> remount double-invoke), and it stays
74
+ // correct for the two later moments where the document changes without anyone
75
+ // editing anything: MARK_SAVED, and REFRESH_COMPONENT_COPIES — the linked-copy
76
+ // refresh (kywi-cms#147 T4 review, C1), which moves both baselines together
77
+ // precisely so it is not an edit. Firing onChange for either would tell the
78
+ // host form it has unsaved changes it does not have.
92
79
  //
93
80
  // `hasSyncedRef` (kywi-cms#135): once a real edit has fired onChange at
94
81
  // least once, every later state.layout change fires again unconditionally
95
- // — including one that happens to be reference-equal to the mount-time
96
- // layout. That happens for real: RESET_TO_SAVED (the Layout-tab Cancel
97
- // revert) sets `layout` back to `originalLayout`, which is still the exact
98
- // mount-time object when no save has occurred yet, so the naive reference
99
- // check above would wrongly treat "reverted to the original" the same as
100
- // "still pristine" and leave the host form stranded on the discarded edit.
101
- const initialLayoutRef = useRef(state.layout);
82
+ // — including one that happens to be reference-equal to `originalLayout`.
83
+ // That happens for real: RESET_TO_SAVED (the Layout-tab Cancel revert) sets
84
+ // `layout` back to `originalLayout`, so the check above would wrongly treat
85
+ // "reverted to the original" the same as "still pristine" and leave the host
86
+ // form stranded on the discarded edit.
87
+ //
88
+ // The dependency list is `[state.layout]` alone on purpose. `originalLayout` is
89
+ // read, not depended on: adding it would re-run the effect on MARK_SAVED — where
90
+ // the document did not change at all — and fire a spurious onChange right after
91
+ // every successful save.
102
92
  const hasSyncedRef = useRef(false);
103
93
  useEffect(() => {
104
- if (!hasSyncedRef.current && state.layout === initialLayoutRef.current)
94
+ if (!hasSyncedRef.current && state.layout === state.originalLayout)
105
95
  return;
106
96
  hasSyncedRef.current = true;
107
97
  onChangeRef.current?.(state.layout);
98
+ // eslint-disable-next-line react-hooks/exhaustive-deps
108
99
  }, [state.layout]);
109
100
  // Sensors, collision detection and drop handling are shared with the
110
101
  // front-of-site OverlayShell (kywi-cms#134) — see use-editor-dnd.ts.
111
102
  const dnd = useEditorDnd({ registry: moduleRegistry, dispatch });
112
- const handleSave = useCallback(() => {
103
+ // The save fork (kywi-cms#147 T4): a save that would persist an edited linked
104
+ // instance stops and asks first. With nothing edited it is a pass-through, so
105
+ // every other save behaves exactly as before.
106
+ const fork = useComponentFork({
107
+ layout: state.layout,
108
+ originalLayout: state.originalLayout,
109
+ dispatch,
110
+ library,
111
+ // On a definition canvas there is nothing to fork: saving IS the propagation
112
+ // (kywi-cms#147 T5 review, I1). On a blueprint canvas there is no "this page"
113
+ // to keep an edit on (final review, M2).
114
+ inert: componentActionsWithheld,
115
+ });
116
+ const persist = useCallback((saved) => {
113
117
  // kywi-cms#135 review: only advance the "last-saved" baseline once the
114
118
  // host's save callback actually reports success. `onSave` may be
115
119
  // synchronous, async, or report nothing at all (`void`/`undefined`,
@@ -118,18 +122,26 @@ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents,
118
122
  // rejection) means the save did NOT persist, so MARK_SAVED must not
119
123
  // fire and the Save button / beforeunload guard must stay armed.
120
124
  //
121
- // `saved` is captured here, in the closure, and handed to MARK_SAVED: the
122
- // baseline must become the document that was actually persisted, not
123
- // whatever the author has since dragged onto the canvas while the PUT was
124
- // in flight (see the MARK_SAVED action doc in editor-state.ts).
125
- const saved = state.layout;
126
- void Promise.resolve(onSave?.(saved))
125
+ // `saved` is the document that was actually handed over captured by the
126
+ // caller, not read from state at resolve time so the baseline can never
127
+ // become something the author dragged onto the canvas while the PUT was in
128
+ // flight (see the MARK_SAVED action doc in editor-state.ts). With the fork
129
+ // it is also the RESOLVED document, not the edited one.
130
+ const result = onSave?.(saved);
131
+ void Promise.resolve(result)
127
132
  .then(ok => {
128
133
  if (ok !== false && mountedRef.current)
129
134
  dispatch({ type: 'MARK_SAVED', layout: saved });
130
135
  })
131
136
  .catch(() => { });
132
- }, [onSave, state.layout]);
137
+ // Reported back so the fork can tell a failed page save from a clean one:
138
+ // it has already written component definitions by this point and has to say
139
+ // so rather than closing as if everything landed.
140
+ return result;
141
+ }, [onSave]);
142
+ const handleSave = useCallback(() => {
143
+ fork.guardSave(persist);
144
+ }, [fork, persist]);
133
145
  const handleCancel = useCallback(() => {
134
146
  if (!state.isDirty) {
135
147
  onCancel?.();
@@ -153,119 +165,27 @@ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents,
153
165
  setShowTemplatePicker(false);
154
166
  setTemplateRegion(null);
155
167
  }, [templateRegion]);
156
- // ── Reusable components (kywi-cms#46) ─────────────────────────────────────
157
- // Resolve a componentId → its live module definition for the canvas preview.
158
- const resolveComponent = useCallback((componentId) => {
159
- const c = components.find(x => x.id === componentId);
160
- return resolveComponentDefinition(c ?? null);
161
- }, [components]);
162
- // Connect a node to a saved component: props/style become live-resolved from
163
- // the component, so the node carries only the id (empty overrides).
164
- const linkModule = useCallback((moduleId, componentId) => {
165
- const node = findModuleById(state.layout, moduleId);
166
- if (!node)
167
- return;
168
- dispatch({
169
- type: 'REPLACE_MODULE',
170
- moduleId,
171
- node: { ...node, componentId, props: { componentId }, style: {} },
172
- });
173
- }, [state.layout]);
174
- // Save the selected module as a reusable component, then link it in place so
175
- // it immediately becomes a live instance of the new component.
176
- const handleSaveAsComponent = useCallback(async () => {
177
- const moduleId = state.selectedId;
178
- if (!moduleId)
179
- return;
180
- const node = findModuleById(state.layout, moduleId);
181
- if (!node)
182
- return;
183
- const name = window.prompt('Save this module as a reusable component. Name:')?.trim();
184
- if (!name)
185
- return;
186
- try {
187
- const res = await adminFetch('/api/v1/components', {
188
- method: 'POST',
189
- body: JSON.stringify(saveAsComponent(node, name)),
190
- });
191
- if (!res.ok)
192
- return;
193
- const body = (await res.json());
194
- const created = body.data;
195
- if (created?.id) {
196
- setComponents(prev => [...prev, created]);
197
- linkModule(moduleId, created.id);
198
- }
199
- }
200
- catch {
201
- /* ignore — save failed, node stays inline */
202
- }
203
- }, [state.selectedId, state.layout, linkModule]);
204
- // Detach a connected node back into an editable inline copy (snapshots the
205
- // component's current definition into the node and drops the link).
206
- const handleDetach = useCallback(() => {
207
- const moduleId = state.selectedId;
208
- if (!moduleId)
209
- return;
210
- const node = findModuleById(state.layout, moduleId);
211
- if (!node?.componentId)
212
- return;
213
- const comp = components.find(c => c.id === node.componentId);
214
- const detached = detachModuleFromComponent(node, comp ?? null);
215
- dispatch({ type: 'REPLACE_MODULE', moduleId, node: detached });
216
- dispatch({ type: 'DESELECT' });
217
- }, [state.selectedId, state.layout, components]);
218
- // ── Reusable section components (kywi-cms#69) ─────────────────────────────
219
- // Save the selected section as a reusable section component, then link it in
220
- // place (stamp componentId, keeping the section id/position) so it immediately
221
- // becomes a live instance of the new component.
222
- const handleSaveSectionAsComponent = useCallback(async () => {
223
- const sectionId = state.selectedId;
224
- if (!sectionId)
225
- return;
226
- const section = findSectionById(state.layout, sectionId);
227
- if (!section)
228
- return;
229
- const name = window.prompt('Save this section as a reusable component. Name:')?.trim();
230
- if (!name)
231
- return;
232
- try {
233
- const res = await adminFetch('/api/v1/components', {
234
- method: 'POST',
235
- body: JSON.stringify(saveAsComponent(section, name)),
236
- });
237
- if (!res.ok)
238
- return;
239
- const body = (await res.json());
240
- const created = body.data;
241
- if (created?.id) {
242
- setSectionComponents(prev => [...prev, created]);
243
- // Link in place: keep the section's id/position, stamp the new componentId.
244
- dispatch({
245
- type: 'REPLACE_SECTION',
246
- sectionId,
247
- section: { ...section, componentId: created.id },
248
- });
249
- }
250
- }
251
- catch {
252
- /* ignore — save failed, section stays inline */
253
- }
254
- }, [state.selectedId, state.layout]);
255
- // Detach a connected section back into an editable inline copy (strips the
256
- // link, deep-clones the local copy with fresh ids). The fresh id means the old
257
- // selection is stale, so deselect afterwards (mirrors module detach).
258
- const handleDetachSection = useCallback(() => {
259
- const sectionId = state.selectedId;
260
- if (!sectionId)
261
- return;
262
- const section = findSectionById(state.layout, sectionId);
263
- if (!section?.componentId)
264
- return;
265
- const detached = detachSectionFromComponent(section);
266
- dispatch({ type: 'REPLACE_SECTION', sectionId, section: detached });
267
- dispatch({ type: 'DESELECT' });
268
- }, [state.selectedId, state.layout]);
168
+ // ── Reusable components (kywi-cms#46/#69/#147) ────────────────────────────
169
+ //
170
+ // Save-as-component (all three granularities), connect-in-place and detach all
171
+ // live in one hook shared with the overlay shell, so the two editors cannot
172
+ // drift apart on what saving or detaching means.
173
+ const connect = useComponentConnect({ layout: state.layout, dispatch, library });
174
+ // The canvas chrome only ever needed the linked pill's name lookup
175
+ // (`nameOf`) its "Save as component" buttons are gone at every granularity
176
+ // (kywi-cms#159), so there is nothing left here for a definition/blueprint
177
+ // canvas to withhold. `connect.affordances` is exactly `{ nameOf }` in every
178
+ // case now; `componentActionsWithheld` still gates the props rail's own
179
+ // buttons (via `canvasKind` below) and the palette filter just below.
180
+ const componentAffordances = connect.affordances;
181
+ // The `component` placeholder is the one palette entry these canvases cannot
182
+ // use: its only purpose is to be pointed at a saved component — the nested link
183
+ // a definition may not hold, and the untracked link a blueprint must not mint.
184
+ // Withheld rather than offered-then-inert.
185
+ const paletteModules = useMemo(() => {
186
+ const modules = moduleRegistry.list();
187
+ return componentActionsWithheld ? modules.filter(m => m.name !== 'component') : modules;
188
+ }, [moduleRegistry, componentActionsWithheld]);
269
189
  const handleDeleteSection = useCallback(() => {
270
190
  if (state.selectedId)
271
191
  dispatch({ type: 'REMOVE_SECTION', sectionId: state.selectedId });
@@ -290,16 +210,27 @@ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents,
290
210
  dispatch({ type: 'UNWRAP_VARIANT_CONTAINER', containerId });
291
211
  dispatch({ type: 'DESELECT' });
292
212
  }, []);
293
- // Module-type components offered by the props-panel picker.
294
- const componentOptions = components.map(c => ({ id: c.id, name: c.name, moduleType: c.moduleType }));
295
- // Section-type components, for the linked-badge label.
296
- const sectionComponentOptions = sectionComponents.map(c => ({ id: c.id, name: c.name, moduleType: c.moduleType }));
213
+ // Module-type components offered by the props-panel picker; section- and
214
+ // container-type ones name a linked instance in its badge.
215
+ const componentOptions = library.optionsFor('module');
216
+ const sectionComponentOptions = library.optionsFor('section');
217
+ const containerComponentOptions = library.optionsFor('variantContainer');
218
+ // The selection may sit INSIDE another node's linked component instance (a
219
+ // module in a linked section, a section in a linked container's arm), where
220
+ // every component action is refused — see `useComponentConnect`. The rail
221
+ // withdraws them rather than offering a button that cannot work.
222
+ const selectionInsideLinkedComponent = state.selectedId
223
+ ? connect.isInsideLinkedComponent(state.selectedId)
224
+ : false;
297
225
  const selectedModule = state.selectedId
298
226
  ? findModuleById(state.layout, state.selectedId)
299
227
  : null;
300
- const selectedConfig = selectedModule
301
- ? moduleRegistry.get(selectedModule.type)
302
- : null;
228
+ // Which registry entry describes this node's FIELDS: for a linked instance the
229
+ // component's own moduleType, not the placeholder node's `type` (kywi-cms#147 T4
230
+ // review, I2 — see `fieldModuleType`). Null means there is nothing honest to show,
231
+ // and the rail renders no content fields at all.
232
+ const selectedFieldType = selectedModule ? library.fieldModuleType(selectedModule) : null;
233
+ const selectedConfig = selectedFieldType ? moduleRegistry.get(selectedFieldType) : null;
303
234
  // A section is selected when SELECT carried selectionType 'section' (#69).
304
235
  const selectedSection = state.selectedType === 'section' && state.selectedId
305
236
  ? findSectionById(state.layout, state.selectedId)
@@ -311,10 +242,37 @@ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents,
311
242
  return (_jsxs(DndContext, { sensors: dnd.sensors, collisionDetection: dnd.collisionDetection, onDragStart: dnd.handleDragStart, onDragMove: dnd.handleDragMove, onDragEnd: dnd.handleDragEnd, onDragCancel: dnd.handleDragCancel, accessibility: dnd.accessibility, children: [_jsx(PaletteDragGhost, { activeDrag: dnd.activeDrag }), _jsxs("div", { className: "kywi-editor-root", children: [_jsx(EditorToolbar, { state: state, dispatch: dispatch, ...(audiences ? { audiences } : {}), onSave: handleSave, onCancel: handleCancel, onAddSection: () => {
312
243
  setTemplateRegion(Object.keys(state.layout.regions)[0] ?? 'main');
313
244
  setShowTemplatePicker(true);
314
- } }), _jsxs("div", { className: "kywi-editor-body", children: [_jsx(ModulePalette, { modules: moduleRegistry.list(), ...(userRole ? { userRole } : {}) }), _jsx("div", { className: "kywi-editor-canvas", children: _jsx(DropTargetContext.Provider, { value: dnd.dropTarget, children: _jsx(EditorCanvas, { state: state, dispatch: dispatch, moduleComponents: moduleComponents, onInsertSection: handleInsertSection, resolveComponent: resolveComponent }) }) }), _jsx(PropsPanel, { module: selectedModule, moduleConfig: selectedConfig, ...(audiences ? { audiences } : {}), components: componentOptions, onUpdateProps: (props) => dispatch({ type: 'UPDATE_PROPS', moduleId: state.selectedId, props }), onUpdateStyle: (style) => dispatch({ type: 'UPDATE_STYLE', moduleId: state.selectedId, style }), onDelete: () => dispatch({ type: 'REMOVE_MODULE', moduleId: state.selectedId }), onSaveAsComponent: handleSaveAsComponent, onLinkComponent: (componentId) => {
245
+ } }), _jsxs("div", { className: "kywi-editor-body", children: [_jsx(ModulePalette, { modules: paletteModules, ...(userRole ? { userRole } : {}) }), _jsx("div", { className: "kywi-editor-canvas", children: _jsx(DropTargetContext.Provider, { value: dnd.dropTarget, children: _jsx(EditorCanvas, { state: state, dispatch: dispatch, moduleComponents: moduleComponents, onInsertSection: handleInsertSection, resolveComponent: library.resolveModule, componentAffordances: componentAffordances }) }) }), _jsx(PropsPanel, { module: selectedModule, moduleConfig: selectedConfig, ...(audiences ? { audiences } : {}), components: componentOptions,
246
+ // What a linked module renders, so its fields show the component's
247
+ // content rather than an empty form (kywi-cms#147 T4).
248
+ linkedModuleRender: selectedModule ? library.renderedModule(selectedModule) : null, onUpdateProps: (props) => dispatch({ type: 'UPDATE_PROPS', moduleId: state.selectedId, props }), onUpdateStyle: (style) => dispatch({ type: 'UPDATE_STYLE', moduleId: state.selectedId, style }), onDelete: () => dispatch({ type: 'REMOVE_MODULE', moduleId: state.selectedId }), onSaveAsComponent: () => {
315
249
  if (state.selectedId)
316
- linkModule(state.selectedId, componentId);
317
- }, onDetach: handleDetach, section: selectedSection, sectionComponents: sectionComponentOptions, onSaveSectionAsComponent: handleSaveSectionAsComponent, onDetachSection: handleDetachSection, onDeleteSection: handleDeleteSection, variantContainer: selectedVariantContainer, onUpdateVariantContainer: handleUpdateVariantContainer, onDeleteVariantContainer: handleDeleteVariantContainer, onUnwrapVariantContainer: handleUnwrapVariantContainer, onClose: () => dispatch({ type: 'DESELECT' }) })] })] }), showTemplatePicker && (_jsx(SectionTemplatePicker, { onSelect: (columns) => {
250
+ connect.saveModule(state.selectedId);
251
+ }, onLinkComponent: (componentId) => {
252
+ if (state.selectedId)
253
+ connect.linkModule(state.selectedId, componentId);
254
+ }, onDetach: () => {
255
+ if (state.selectedId)
256
+ connect.detachModule(state.selectedId);
257
+ }, insideLinkedComponent: selectionInsideLinkedComponent, canvasKind: canvasKind, section: selectedSection, sectionComponents: sectionComponentOptions, onSaveSectionAsComponent: () => {
258
+ if (state.selectedId)
259
+ connect.saveSection(state.selectedId);
260
+ }, onDetachSection: () => {
261
+ if (state.selectedId)
262
+ connect.detachSection(state.selectedId);
263
+ }, onDeleteSection: handleDeleteSection, variantContainer: selectedVariantContainer, variantContainerComponents: containerComponentOptions, onSaveVariantContainerAsComponent: () => {
264
+ if (state.selectedId)
265
+ connect.saveVariantContainer(state.selectedId);
266
+ }, onDetachVariantContainer: () => {
267
+ if (state.selectedId)
268
+ connect.detachVariantContainer(state.selectedId);
269
+ }, onUpdateVariantContainer: handleUpdateVariantContainer, onDeleteVariantContainer: handleDeleteVariantContainer, onUnwrapVariantContainer: handleUnwrapVariantContainer, onClose: () => dispatch({ type: 'DESELECT' }) })] })] }), showTemplatePicker && (_jsx(SectionTemplatePicker
270
+ // The library this shell already loaded — the picker must not fetch its
271
+ // own copy of rows we are holding (kywi-cms#147 T3 review, I3).
272
+ , {
273
+ // The library this shell already loaded — the picker must not fetch its
274
+ // own copy of rows we are holding (kywi-cms#147 T3 review, I3).
275
+ componentLibrary: library.components, onSelect: (columns) => {
318
276
  if (templateRegion) {
319
277
  dispatch({ type: 'ADD_SECTION', regionName: templateRegion, columns });
320
278
  }
@@ -326,17 +284,30 @@ export function LayoutEditor({ initialLayout, moduleRegistry, moduleComponents,
326
284
  }
327
285
  setShowTemplatePicker(false);
328
286
  setTemplateRegion(null);
329
- }, onInsertComponent: (section) => {
330
- // A linked section (componentId stamped) ADD_SECTIONS clones it with
331
- // fresh ids while cloneSection preserves the reference (#69).
332
- if (templateRegion) {
333
- dispatch({ type: 'ADD_SECTIONS', regionName: templateRegion, sections: [section] });
334
- }
335
- setShowTemplatePicker(false);
336
- setTemplateRegion(null);
337
- }, onClose: () => {
287
+ }, ...(componentActionsWithheld ? {} : {
288
+ onInsertComponent: (section) => {
289
+ // A linked section (componentId stamped) ADD_SECTIONS clones it with
290
+ // fresh ids while cloneSection preserves the reference (#69).
291
+ if (templateRegion) {
292
+ dispatch({ type: 'ADD_SECTIONS', regionName: templateRegion, sections: [section] });
293
+ }
294
+ setShowTemplatePicker(false);
295
+ setTemplateRegion(null);
296
+ },
297
+ onInsertVariantContainer: (container) => {
298
+ // A linked container component (kywi-cms#147). Containers live at
299
+ // region level only, so this is the same insert affordance a section
300
+ // uses — ADD_VARIANT_CONTAINER clones it with fresh ids while
301
+ // cloneVariantContainer preserves the reference.
302
+ if (templateRegion) {
303
+ dispatch({ type: 'ADD_VARIANT_CONTAINER', regionName: templateRegion, container });
304
+ }
305
+ setShowTemplatePicker(false);
306
+ setTemplateRegion(null);
307
+ },
308
+ }), onClose: () => {
338
309
  setShowTemplatePicker(false);
339
310
  setTemplateRegion(null);
340
- } })), confirmCancel && (_jsx(ConfirmDialog, { title: "Discard unsaved layout changes?", message: "This layout has changes you haven't saved yet. Cancelling now discards them.", confirmLabel: "Discard", onConfirm: confirmCancelDiscard, onCancel: () => setConfirmCancel(false) }))] }));
311
+ } })), connect.dialog, fork.dialog, confirmCancel && (_jsx(ConfirmDialog, { title: "Discard unsaved layout changes?", message: "This layout has changes you haven't saved yet. Cancelling now discards them.", confirmLabel: "Discard", onConfirm: confirmCancelDiscard, onCancel: () => setConfirmCancel(false) }))] }));
341
312
  }
342
313
  //# sourceMappingURL=layout-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout-editor.js","sourceRoot":"","sources":["../../../src/admin/layout-editor/layout-editor.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AACZ,OAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAErE,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,UAAU,E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AU,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,CAAA;wBACpF,CAAC;wBACD,qBAAqB,CAAC,KAAK,CAAC,CAAA;wBAC5B,iBAAiB,CAAC,IAAI,CAAC,CAAA;oBACzB,CAAC;iBACF,CAAC,EACF,OAAO,EAAE,GAAG,EAAE;oBACZ,qBAAqB,CAAC,KAAK,CAAC,CAAA;oBAC5B,iBAAiB,CAAC,IAAI,CAAC,CAAA;gBACzB,CAAC,GACD,CACH,EAIA,OAAO,CAAC,MAAM,EACd,IAAI,CAAC,MAAM,EACX,aAAa,IAAI,CAChB,KAAC,aAAa,IACZ,KAAK,EAAC,iCAAiC,EACvC,OAAO,EAAC,8EAA8E,EACtF,YAAY,EAAC,SAAS,EACtB,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,GACvC,CACH,IACU,CACd,CAAA;AACH,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The pill naming the component a node is an instance of.
3
+ *
4
+ * `data-linked-component` is the test/e2e hook; the name is the accessible text,
5
+ * not a tooltip, because "which component is this?" is the question the
6
+ * affordance exists to answer.
7
+ */
8
+ export declare function LinkedComponentPill({ name }: {
9
+ name?: string | null | undefined;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ /**
12
+ * What the canvas needs from its shell to name a linked instance's pill.
13
+ *
14
+ * Both shells build one of these from the loaded component library (see
15
+ * `use-component-connect.ts`), so the canvas stays free of fetching. `nameOf`
16
+ * is optional: a shell that wires none of it gets a canvas with no pill name at
17
+ * all, which is what the unit tests that render `EditorCanvas` directly rely on.
18
+ *
19
+ * Used to also carry `onSaveModule` / `onSaveSection` / `onSaveVariantContainer`
20
+ * for the chrome's own "Save as component" buttons, but that button no longer
21
+ * lives in the chrome at any granularity (kywi-cms#159) — the props rail is its
22
+ * only home now, wired straight to `use-component-connect.tsx`'s
23
+ * `saveModule` / `saveSection` / `saveVariantContainer` independent of this type.
24
+ */
25
+ export interface ComponentAffordances {
26
+ /** Human name for a linked component id, or null when it isn't known. */
27
+ nameOf: (componentId: string) => string | null;
28
+ }
29
+ /**
30
+ * `nameOf` for a node that may or may not be linked, or null when it isn't.
31
+ * Keeps the "is this linked?" test in one place: the node's own `componentId`,
32
+ * never a separate flag (there isn't one, and a second source of truth here
33
+ * would be one more thing to keep in step with the renderer).
34
+ */
35
+ export declare function linkedComponentName(node: {
36
+ componentId?: string | undefined;
37
+ }, affordances: ComponentAffordances | undefined): string | null;
38
+ //# sourceMappingURL=linked-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linked-component.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/linked-component.tsx"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,2CAWjF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,MAAM,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAC1C,WAAW,EAAE,oBAAoB,GAAG,SAAS,GAC5C,MAAM,GAAG,IAAI,CAGf"}
@@ -0,0 +1,42 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { EditorIcon } from './editor-icons.js';
4
+ /**
5
+ * linked-component.tsx
6
+ * The editor's linked-instance affordance and the callbacks the canvas needs to
7
+ * offer "Save as component" (kywi-cms#147).
8
+ *
9
+ * A linked instance looks like ordinary content — that is the whole point of a
10
+ * component — so without an affordance the owner has no way to know that the
11
+ * heading they are about to edit is shared with eleven other pages. Webflow's
12
+ * answer is a distinct outline plus a named badge, and that is what this is: one
13
+ * pill, rendered inside whichever chrome already floats above the node
14
+ * (section bar, container bar, module chip row), plus a `--linked` modifier class
15
+ * the stylesheet turns into a distinct outline.
16
+ *
17
+ * Editor-only, in both shells: nothing here reaches the public renderer.
18
+ */
19
+ /** Fallback when the component library hasn't loaded (or the row is gone). */
20
+ const UNNAMED_COMPONENT = 'Component';
21
+ /**
22
+ * The pill naming the component a node is an instance of.
23
+ *
24
+ * `data-linked-component` is the test/e2e hook; the name is the accessible text,
25
+ * not a tooltip, because "which component is this?" is the question the
26
+ * affordance exists to answer.
27
+ */
28
+ export function LinkedComponentPill({ name }) {
29
+ return (_jsxs("span", { className: "kywi-editor-linked-pill", "data-linked-component": name ?? UNNAMED_COMPONENT, contentEditable: false, children: [_jsx(EditorIcon, { name: "card", size: 12 }), name ?? UNNAMED_COMPONENT] }));
30
+ }
31
+ /**
32
+ * `nameOf` for a node that may or may not be linked, or null when it isn't.
33
+ * Keeps the "is this linked?" test in one place: the node's own `componentId`,
34
+ * never a separate flag (there isn't one, and a second source of truth here
35
+ * would be one more thing to keep in step with the renderer).
36
+ */
37
+ export function linkedComponentName(node, affordances) {
38
+ if (!node.componentId)
39
+ return null;
40
+ return affordances?.nameOf(node.componentId) ?? UNNAMED_COMPONENT;
41
+ }
42
+ //# sourceMappingURL=linked-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linked-component.js","sourceRoot":"","sources":["../../../src/admin/layout-editor/linked-component.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAAwC;IAChF,OAAO,CACL,gBACE,SAAS,EAAC,yBAAyB,2BACZ,IAAI,IAAI,iBAAiB,EAChD,eAAe,EAAE,KAAK,aAEtB,KAAC,UAAU,IAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAE,EAAE,GAAI,EACnC,IAAI,IAAI,iBAAiB,IACrB,CACR,CAAA;AACH,CAAC;AAqBD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAA0C,EAC1C,WAA6C;IAE7C,IAAI,CAAC,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAA;IAClC,OAAO,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAA;AACnE,CAAC"}
@@ -70,8 +70,17 @@ interface ModuleOverlayProps {
70
70
  * this either.
71
71
  */
72
72
  onInlineFallback?: () => void;
73
+ /**
74
+ * The component this module is a linked instance of (kywi-cms#147). Stamps
75
+ * `data-component-id` (the same hook the public renderer emits), switches the
76
+ * wrapper to the linked outline, and names the component in a pill beside the
77
+ * type chip — a linked module is otherwise indistinguishable from an ordinary
78
+ * one, which is how an owner edits eleven pages by accident.
79
+ */
80
+ componentId?: string;
81
+ componentName?: string | null;
73
82
  children: React.ReactNode;
74
83
  }
75
- export declare function ModuleOverlay({ moduleId, instanceId, columnId, index, isSelected, onSelect, actions, typeLabel, inPlace, moduleType, inlineText, onInlineFallback, children, }: ModuleOverlayProps): import("react/jsx-runtime").JSX.Element;
84
+ export declare function ModuleOverlay({ moduleId, instanceId, columnId, index, isSelected, onSelect, actions, typeLabel, inPlace, moduleType, inlineText, onInlineFallback, componentId, componentName, children, }: ModuleOverlayProps): import("react/jsx-runtime").JSX.Element;
76
85
  export {};
77
86
  //# sourceMappingURL=module-overlay.d.ts.map