@kywi-software/core 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT-PATTERNS.md +111 -23
- package/README.md +67 -0
- package/dist/admin/content-form.d.ts.map +1 -1
- package/dist/admin/content-form.js +97 -10
- package/dist/admin/content-form.js.map +1 -1
- package/dist/admin/layout-editor/component-actions.d.ts +219 -22
- package/dist/admin/layout-editor/component-actions.d.ts.map +1 -1
- package/dist/admin/layout-editor/component-actions.js +356 -36
- package/dist/admin/layout-editor/component-actions.js.map +1 -1
- package/dist/admin/layout-editor/component-fork.d.ts +224 -0
- package/dist/admin/layout-editor/component-fork.d.ts.map +1 -0
- package/dist/admin/layout-editor/component-fork.js +342 -0
- package/dist/admin/layout-editor/component-fork.js.map +1 -0
- package/dist/admin/layout-editor/editor-canvas.d.ts +28 -7
- package/dist/admin/layout-editor/editor-canvas.d.ts.map +1 -1
- package/dist/admin/layout-editor/editor-canvas.js +145 -32
- package/dist/admin/layout-editor/editor-canvas.js.map +1 -1
- package/dist/admin/layout-editor/editor-dialog.d.ts +164 -0
- package/dist/admin/layout-editor/editor-dialog.d.ts.map +1 -0
- package/dist/admin/layout-editor/editor-dialog.js +195 -0
- package/dist/admin/layout-editor/editor-dialog.js.map +1 -0
- package/dist/admin/layout-editor/editor-state.d.ts +76 -0
- package/dist/admin/layout-editor/editor-state.d.ts.map +1 -1
- package/dist/admin/layout-editor/editor-state.js +47 -1
- package/dist/admin/layout-editor/editor-state.js.map +1 -1
- package/dist/admin/layout-editor/editor.css +366 -4
- package/dist/admin/layout-editor/index.d.ts +10 -1
- package/dist/admin/layout-editor/index.d.ts.map +1 -1
- package/dist/admin/layout-editor/index.js +11 -1
- package/dist/admin/layout-editor/index.js.map +1 -1
- package/dist/admin/layout-editor/inline-text.d.ts +56 -4
- package/dist/admin/layout-editor/inline-text.d.ts.map +1 -1
- package/dist/admin/layout-editor/inline-text.js +134 -11
- package/dist/admin/layout-editor/inline-text.js.map +1 -1
- package/dist/admin/layout-editor/layout-editor.d.ts +58 -1
- package/dist/admin/layout-editor/layout-editor.d.ts.map +1 -1
- package/dist/admin/layout-editor/layout-editor.js +160 -190
- package/dist/admin/layout-editor/layout-editor.js.map +1 -1
- package/dist/admin/layout-editor/linked-component.d.ts +39 -0
- package/dist/admin/layout-editor/linked-component.d.ts.map +1 -0
- package/dist/admin/layout-editor/linked-component.js +42 -0
- package/dist/admin/layout-editor/linked-component.js.map +1 -0
- package/dist/admin/layout-editor/module-overlay.d.ts +36 -14
- package/dist/admin/layout-editor/module-overlay.d.ts.map +1 -1
- package/dist/admin/layout-editor/module-overlay.js +233 -25
- package/dist/admin/layout-editor/module-overlay.js.map +1 -1
- package/dist/admin/layout-editor/node-lookup.d.ts +35 -0
- package/dist/admin/layout-editor/node-lookup.d.ts.map +1 -1
- package/dist/admin/layout-editor/node-lookup.js +91 -0
- package/dist/admin/layout-editor/node-lookup.js.map +1 -1
- package/dist/admin/layout-editor/overlay-shell.d.ts.map +1 -1
- package/dist/admin/layout-editor/overlay-shell.js +150 -32
- package/dist/admin/layout-editor/overlay-shell.js.map +1 -1
- package/dist/admin/layout-editor/props-panel.d.ts +54 -1
- package/dist/admin/layout-editor/props-panel.d.ts.map +1 -1
- package/dist/admin/layout-editor/props-panel.js +119 -10
- package/dist/admin/layout-editor/props-panel.js.map +1 -1
- package/dist/admin/layout-editor/section-overlay.d.ts +16 -1
- package/dist/admin/layout-editor/section-overlay.d.ts.map +1 -1
- package/dist/admin/layout-editor/section-overlay.js +21 -11
- package/dist/admin/layout-editor/section-overlay.js.map +1 -1
- package/dist/admin/layout-editor/section-template-picker.d.ts +27 -1
- package/dist/admin/layout-editor/section-template-picker.d.ts.map +1 -1
- package/dist/admin/layout-editor/section-template-picker.js +71 -17
- package/dist/admin/layout-editor/section-template-picker.js.map +1 -1
- package/dist/admin/layout-editor/section-variant-container-config.js +5 -5
- package/dist/admin/layout-editor/section-variant-container-config.js.map +1 -1
- package/dist/admin/layout-editor/use-chrome-flip.d.ts +111 -11
- package/dist/admin/layout-editor/use-chrome-flip.d.ts.map +1 -1
- package/dist/admin/layout-editor/use-chrome-flip.js +233 -33
- package/dist/admin/layout-editor/use-chrome-flip.js.map +1 -1
- package/dist/admin/layout-editor/use-component-connect.d.ts +61 -0
- package/dist/admin/layout-editor/use-component-connect.d.ts.map +1 -0
- package/dist/admin/layout-editor/use-component-connect.js +292 -0
- package/dist/admin/layout-editor/use-component-connect.js.map +1 -0
- package/dist/admin/layout-editor/use-component-fork.d.ts +123 -0
- package/dist/admin/layout-editor/use-component-fork.d.ts.map +1 -0
- package/dist/admin/layout-editor/use-component-fork.js +346 -0
- package/dist/admin/layout-editor/use-component-fork.js.map +1 -0
- package/dist/admin/layout-editor/use-component-library.d.ts +94 -0
- package/dist/admin/layout-editor/use-component-library.d.ts.map +1 -0
- package/dist/admin/layout-editor/use-component-library.js +55 -0
- package/dist/admin/layout-editor/use-component-library.js.map +1 -0
- package/dist/admin/registry.d.ts +11 -2
- package/dist/admin/registry.d.ts.map +1 -1
- package/dist/admin/registry.js +40 -4
- package/dist/admin/registry.js.map +1 -1
- package/dist/admin/server.d.ts +1 -0
- package/dist/admin/server.d.ts.map +1 -1
- package/dist/admin/server.js +5 -0
- package/dist/admin/server.js.map +1 -1
- package/dist/admin/styles/admin.css +57 -1
- package/dist/admin/surfaces/components/component-edit.d.ts +3 -0
- package/dist/admin/surfaces/components/component-edit.d.ts.map +1 -0
- package/dist/admin/surfaces/components/component-edit.js +235 -0
- package/dist/admin/surfaces/components/component-edit.js.map +1 -0
- package/dist/admin/surfaces/components/components-data.d.ts +153 -0
- package/dist/admin/surfaces/components/components-data.d.ts.map +1 -0
- package/dist/admin/surfaces/components/components-data.js +154 -0
- package/dist/admin/surfaces/components/components-data.js.map +1 -0
- package/dist/admin/surfaces/components/components-list.d.ts +3 -0
- package/dist/admin/surfaces/components/components-list.d.ts.map +1 -0
- package/dist/admin/surfaces/components/components-list.js +196 -0
- package/dist/admin/surfaces/components/components-list.js.map +1 -0
- package/dist/admin/surfaces/components/definition-canvas.d.ts +73 -0
- package/dist/admin/surfaces/components/definition-canvas.d.ts.map +1 -0
- package/dist/admin/surfaces/components/definition-canvas.js +207 -0
- package/dist/admin/surfaces/components/definition-canvas.js.map +1 -0
- package/dist/admin/surfaces/layouts/layout-editor-client.d.ts.map +1 -1
- package/dist/admin/surfaces/layouts/layout-editor-client.js +14 -2
- package/dist/admin/surfaces/layouts/layout-editor-client.js.map +1 -1
- package/dist/admin/surfaces/layouts/layouts-data.d.ts +3 -14
- package/dist/admin/surfaces/layouts/layouts-data.d.ts.map +1 -1
- package/dist/admin/surfaces/layouts/layouts-data.js +4 -7
- package/dist/admin/surfaces/layouts/layouts-data.js.map +1 -1
- package/dist/admin/surfaces/layouts/layouts-list.d.ts.map +1 -1
- package/dist/admin/surfaces/layouts/layouts-list.js +16 -22
- package/dist/admin/surfaces/layouts/layouts-list.js.map +1 -1
- package/dist/admin/surfaces/settings/admin-features.d.ts.map +1 -1
- package/dist/admin/surfaces/settings/admin-features.js +1 -0
- package/dist/admin/surfaces/settings/admin-features.js.map +1 -1
- package/dist/api/bulk-routes.d.ts.map +1 -1
- package/dist/api/bulk-routes.js +25 -0
- package/dist/api/bulk-routes.js.map +1 -1
- package/dist/api/changeset-routes.d.ts.map +1 -1
- package/dist/api/changeset-routes.js +17 -3
- package/dist/api/changeset-routes.js.map +1 -1
- package/dist/api/component-routes.d.ts.map +1 -1
- package/dist/api/component-routes.js +228 -8
- package/dist/api/component-routes.js.map +1 -1
- package/dist/api/content-routes.d.ts.map +1 -1
- package/dist/api/content-routes.js +64 -0
- package/dist/api/content-routes.js.map +1 -1
- package/dist/api/feed-routes.d.ts +6 -6
- package/dist/api/graphql/resolvers.d.ts +4 -4
- package/dist/api/layout-routes.d.ts.map +1 -1
- package/dist/api/layout-routes.js +4 -17
- package/dist/api/layout-routes.js.map +1 -1
- package/dist/api/layout-write-guard.d.ts +80 -0
- package/dist/api/layout-write-guard.d.ts.map +1 -0
- package/dist/api/layout-write-guard.js +88 -0
- package/dist/api/layout-write-guard.js.map +1 -0
- package/dist/api/section-template-routes.d.ts.map +1 -1
- package/dist/api/section-template-routes.js +11 -0
- package/dist/api/section-template-routes.js.map +1 -1
- package/dist/api/translation-routes.d.ts.map +1 -1
- package/dist/api/translation-routes.js +8 -0
- package/dist/api/translation-routes.js.map +1 -1
- package/dist/api/version-routes.d.ts.map +1 -1
- package/dist/api/version-routes.js +20 -8
- package/dist/api/version-routes.js.map +1 -1
- package/dist/api/workflow-routes.d.ts.map +1 -1
- package/dist/api/workflow-routes.js +53 -8
- package/dist/api/workflow-routes.js.map +1 -1
- package/dist/db/analytics-queries.d.ts +3 -3
- package/dist/db/apply-snapshot.d.ts +75 -8
- package/dist/db/apply-snapshot.d.ts.map +1 -1
- package/dist/db/apply-snapshot.js +104 -8
- package/dist/db/apply-snapshot.js.map +1 -1
- package/dist/db/audit-queries.d.ts +12 -12
- package/dist/db/category-queries.d.ts +3 -3
- package/dist/db/changeset-audit-queries.d.ts +4 -4
- package/dist/db/changeset-queries.d.ts +7 -7
- package/dist/db/comment-queries.d.ts +8 -8
- package/dist/db/comment-subscription-queries.d.ts +2 -2
- package/dist/db/component-instance-queries.d.ts +197 -0
- package/dist/db/component-instance-queries.d.ts.map +1 -0
- package/dist/db/component-instance-queries.js +405 -0
- package/dist/db/component-instance-queries.js.map +1 -0
- package/dist/db/content-queries.d.ts.map +1 -1
- package/dist/db/content-queries.js +39 -2
- package/dist/db/content-queries.js.map +1 -1
- package/dist/db/extension-queries.d.ts +7 -7
- package/dist/db/feed-queries.d.ts +3 -3
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/layout-queries.d.ts +13 -1
- package/dist/db/layout-queries.d.ts.map +1 -1
- package/dist/db/layout-queries.js +52 -7
- package/dist/db/layout-queries.js.map +1 -1
- package/dist/db/locale-queries.d.ts.map +1 -1
- package/dist/db/locale-queries.js +0 -0
- package/dist/db/locale-queries.js.map +1 -1
- package/dist/db/media-queries.d.ts +12 -12
- package/dist/db/revision-queries.d.ts +3 -3
- package/dist/db/site-admin-queries.d.ts +2 -2
- package/dist/db/site-membership-queries.d.ts +3 -3
- package/dist/db/site-plugin-queries.d.ts +2 -2
- package/dist/db/site-queries.d.ts +6 -6
- package/dist/db/version-queries.d.ts +12 -12
- package/dist/db/webhook-queries.d.ts +11 -11
- package/dist/db/workflow-queries.d.ts +6 -6
- package/dist/db/workflow-queries.d.ts.map +1 -1
- package/dist/db/workflow-queries.js +11 -2
- package/dist/db/workflow-queries.js.map +1 -1
- package/dist/layout/comments-module.d.ts.map +1 -1
- package/dist/layout/comments-module.js +6 -2
- package/dist/layout/comments-module.js.map +1 -1
- package/dist/layout/component-refs.d.ts +465 -0
- package/dist/layout/component-refs.d.ts.map +1 -0
- package/dist/layout/component-refs.js +848 -0
- package/dist/layout/component-refs.js.map +1 -0
- package/dist/layout/index.d.ts +2 -1
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +1 -0
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/module-permissions.d.ts +49 -1
- package/dist/layout/module-permissions.d.ts.map +1 -1
- package/dist/layout/module-permissions.js +117 -6
- package/dist/layout/module-permissions.js.map +1 -1
- package/dist/layout/module-render-context.d.ts +32 -0
- package/dist/layout/module-render-context.d.ts.map +1 -1
- package/dist/layout/module-render-context.js +32 -1
- package/dist/layout/module-render-context.js.map +1 -1
- package/dist/layout/modules-extended.d.ts.map +1 -1
- package/dist/layout/modules-extended.js +21 -11
- package/dist/layout/modules-extended.js.map +1 -1
- package/dist/layout/modules.d.ts.map +1 -1
- package/dist/layout/modules.js +15 -10
- package/dist/layout/modules.js.map +1 -1
- package/dist/layout/renderer.d.ts +51 -4
- package/dist/layout/renderer.d.ts.map +1 -1
- package/dist/layout/renderer.js +36 -38
- package/dist/layout/renderer.js.map +1 -1
- package/dist/layout/types.d.ts +42 -0
- package/dist/layout/types.d.ts.map +1 -1
- package/dist/layout/types.js +54 -11
- package/dist/layout/types.js.map +1 -1
- package/dist/schema/base.d.ts +1 -1
- package/dist/schema/components.d.ts +150 -0
- package/dist/schema/components.d.ts.map +1 -1
- package/dist/schema/components.js +50 -4
- package/dist/schema/components.js.map +1 -1
- package/dist/scope/inline-editing.d.ts.map +1 -1
- package/dist/scope/inline-editing.js +10 -0
- package/dist/scope/inline-editing.js.map +1 -1
- package/dist/scope/sticky-offset.d.ts +185 -0
- package/dist/scope/sticky-offset.d.ts.map +1 -0
- package/dist/scope/sticky-offset.js +432 -0
- package/dist/scope/sticky-offset.js.map +1 -0
- package/dist/site/styles.css +41 -3
- package/dist/versioning/scheduler.d.ts +8 -0
- package/dist/versioning/scheduler.d.ts.map +1 -1
- package/dist/versioning/scheduler.js +21 -7
- package/dist/versioning/scheduler.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { PropField } from './prop-field.js';
|
|
@@ -13,12 +13,91 @@ import { ConfirmDialog } from '../primitives.js';
|
|
|
13
13
|
// Which prop on each form module holds the referenced form's slug — replaced in
|
|
14
14
|
// the panel by the form picker (kywi-cms#35).
|
|
15
15
|
const FORM_SLUG_PROP = { form: 'slug', formEmbed: 'formSlug' };
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* What the rail tells the owner about a linked instance (kywi-cms#147).
|
|
18
|
+
*
|
|
19
|
+
* The three granularities get ONE note, because they have one contract: a linked
|
|
20
|
+
* instance renders its component, so the component is what every instance shows.
|
|
21
|
+
*
|
|
22
|
+
* WORDING (T3 review I2, now completed by T4). In T3 the note deliberately stopped
|
|
23
|
+
* at "every instance renders the component", because the choice it would otherwise
|
|
24
|
+
* have promised — update everywhere, or keep the change here — did not exist yet,
|
|
25
|
+
* and a rail that describes a button the editor does not have is a rail that lies.
|
|
26
|
+
* The save fork ships in this same release (`use-component-fork.tsx`), so the
|
|
27
|
+
* sentence is now a description of what the Save button really does: edit freely
|
|
28
|
+
* here, and answer for it at save time.
|
|
29
|
+
*
|
|
30
|
+
* `previewsStoredCopy` is set for sections and containers, which resolve
|
|
31
|
+
* WHOLESALE: the canvas shows this page's own copy of the definition. Since T4's
|
|
32
|
+
* C1 fix that copy is brought back in line with the component when the editor
|
|
33
|
+
* loads, so it is the component's content — as of the moment the page was opened,
|
|
34
|
+
* which is the part still worth saying. Modules resolve their preview live
|
|
35
|
+
* (`ModulePreview`), so they say nothing about it.
|
|
36
|
+
*
|
|
37
|
+
* `stylesCopyWholeMap` is set for modules, and discloses something the owner cannot
|
|
38
|
+
* see (kywi-cms#147 T4 review, M4): the style editor emits the WHOLE declaration
|
|
39
|
+
* map it was handed, and for a clean instance that map is the component's. So the
|
|
40
|
+
* first style change copies all of the component's styling onto this instance,
|
|
41
|
+
* which "update all" then writes straight back and "this page only" bakes in. There
|
|
42
|
+
* is no per-declaration override in v1 — a minimal write could not express
|
|
43
|
+
* "unset what the component sets" — so the behaviour is stated rather than hidden.
|
|
44
|
+
*/
|
|
45
|
+
function LinkedComponentNote({ name, previewsStoredCopy = false, stylesCopyWholeMap = false, }) {
|
|
46
|
+
return (_jsxs(_Fragment, { children: [_jsxs("p", { className: "kywi-editor-props-linked-note", children: ["This is a linked instance of", name ? _jsxs(_Fragment, { children: [" ", _jsx("strong", { children: name })] }) : _jsx(_Fragment, { children: " a component" }), ". Every instance renders that component, so updating the component updates all of them. Edit it here and saving asks whether to update every instance or keep the change on this page only."] }), previewsStoredCopy && (_jsx("p", { className: "kywi-editor-props-linked-note kywi-editor-props-linked-aside", children: "This canvas shows the component\u2019s content as it was when the page opened; visitors always see its current content." })), stylesCopyWholeMap && (_jsx("p", { className: "kywi-editor-props-linked-note kywi-editor-props-linked-aside", "data-linked-style-disclosure": "", children: "Changing any style here copies all of the component\u2019s styling onto this instance." }))] }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Why the rail offers no component action for this selection (kywi-cms#147 T3
|
|
50
|
+
* review, I1).
|
|
51
|
+
*
|
|
52
|
+
* The selection sits inside ANOTHER node's linked component instance, where a
|
|
53
|
+
* link of its own would be written into that component's inline fallback copy:
|
|
54
|
+
* invisible to the instance index, the usage counts and the delete gate, stripped
|
|
55
|
+
* at render, and lost the moment the outer component stops resolving. The action
|
|
56
|
+
* is therefore not offered at all — but silence in a rail that offers the same
|
|
57
|
+
* button one section up reads as a bug, so the rail says why.
|
|
58
|
+
*
|
|
59
|
+
* One sentence for both cases it serves — saving a section, and pointing a
|
|
60
|
+
* placeholder at a component — because both are the same act: giving this node a
|
|
61
|
+
* link of its own.
|
|
62
|
+
*/
|
|
63
|
+
function InsideLinkedComponentNote({ what }) {
|
|
64
|
+
return (_jsxs("p", { className: "kywi-editor-props-linked-note", "data-inside-linked-component": "", children: ["This ", what, " is part of a linked component, so it cannot be linked to a component of its own. Detach the instance it sits inside first."] }));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Why the rail offers no component action on a DEFINITION canvas (kywi-cms#147
|
|
68
|
+
* T5 review, I1).
|
|
69
|
+
*
|
|
70
|
+
* The document being edited is a component's own definition, so every component
|
|
71
|
+
* action the rail knows about is about something else: "save this as a component"
|
|
72
|
+
* would save a component's insides as a second component, and pointing anything
|
|
73
|
+
* here at a saved component writes the nested link the API refuses outright
|
|
74
|
+
* (`rejectNestedComponentLinks`). Same treatment as the linked-ancestor case
|
|
75
|
+
* above — withheld, with the reason, rather than offered and then refused at save.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Why the component actions are missing on a canvas that is not a page — one note
|
|
79
|
+
* per kind, because the two reasons are genuinely different and an owner reading
|
|
80
|
+
* either one should be able to act on it.
|
|
81
|
+
*/
|
|
82
|
+
function UnplacedCanvasNote({ kind, what }) {
|
|
83
|
+
if (kind === 'blueprint') {
|
|
84
|
+
return (_jsxs("p", { className: "kywi-editor-props-linked-note", "data-blueprint-canvas": "", children: ["This is a saved layout, not a page \u2014 nothing here is placed yet. Component actions live on pages: a link written into a saved layout is invisible to a component's usage count and to its delete confirmation. Add this layout to a page, then save the ", what, " as a component from there."] }));
|
|
85
|
+
}
|
|
86
|
+
return (_jsxs("p", { className: "kywi-editor-props-linked-note", "data-definition-canvas": "", children: ["You are editing this component itself, so this ", what, " cannot link to another component. Place this component on a page to combine it with others."] }));
|
|
87
|
+
}
|
|
88
|
+
export function PropsPanel({ module, moduleConfig, onUpdateProps, onUpdateStyle, onDelete, onClose, themeRegistry, themeName, audiences, components, linkedModuleRender, onSaveAsComponent, onLinkComponent, onDetach, insideLinkedComponent = false, canvasKind = 'page', section, sectionComponents, onSaveSectionAsComponent, onDetachSection, onDeleteSection, variantContainer, variantContainerComponents, onSaveVariantContainerAsComponent, onDetachVariantContainer, onUpdateVariantContainer, onDeleteVariantContainer, onUnwrapVariantContainer, }) {
|
|
17
89
|
// Selections are mutually exclusive; the panel opens for whichever arrived.
|
|
18
90
|
// Module-mode takes precedence, then section, if more than one is provided.
|
|
19
91
|
const showSection = !module && !!section;
|
|
20
92
|
const showVariantContainer = !module && !section && !!variantContainer;
|
|
21
93
|
const isHidden = module === null && !section && !variantContainer;
|
|
94
|
+
// Three different reasons, one withdrawal: a node inside someone else's linked
|
|
95
|
+
// instance cannot own a link, a node inside a DEFINITION cannot either, and a
|
|
96
|
+
// node inside a BLUEPRINT would own one nothing can see (kywi-cms#147 T3 review
|
|
97
|
+
// I1, T5 review I1, final review M2). Every "save as component" / "link to a
|
|
98
|
+
// component" affordance reads this; each note says which case it is.
|
|
99
|
+
const unplacedCanvas = canvasKind === 'page' ? null : canvasKind;
|
|
100
|
+
const componentActionsWithheld = insideLinkedComponent || unplacedCanvas !== null;
|
|
22
101
|
// Remove personalization (kywi-cms#121) needs a two-part confirm (title +
|
|
23
102
|
// body), so it uses the styled ConfirmDialog rather than the plain
|
|
24
103
|
// `window.confirm` the rest of this panel's danger actions use. Holds the
|
|
@@ -29,6 +108,11 @@ export function PropsPanel({ module, moduleConfig, onUpdateProps, onUpdateStyle,
|
|
|
29
108
|
function handlePropChange(propName, value) {
|
|
30
109
|
if (!module)
|
|
31
110
|
return;
|
|
111
|
+
// Deliberately only the prop that was touched, even on a linked instance
|
|
112
|
+
// whose displayed values came from the component (kywi-cms#147 T4): the node
|
|
113
|
+
// then carries exactly the author's overrides, which is what lets the save
|
|
114
|
+
// fork rebuild the definition (definition + overrides) without inventing
|
|
115
|
+
// values, and what makes "keep it on this page" bake in what they see.
|
|
32
116
|
onUpdateProps({ ...module.props, [propName]: value });
|
|
33
117
|
}
|
|
34
118
|
function handleDelete() {
|
|
@@ -53,6 +137,12 @@ export function PropsPanel({ module, moduleConfig, onUpdateProps, onUpdateStyle,
|
|
|
53
137
|
? (sectionComponents?.find(c => c.id === section.componentId) ?? null)
|
|
54
138
|
: null;
|
|
55
139
|
const isSectionLinked = Boolean(section?.componentId);
|
|
140
|
+
// The container equivalent (kywi-cms#147): a section-level variant container
|
|
141
|
+
// can itself be a component, so it gets the same linked badge / Detach pair.
|
|
142
|
+
const containerLinkedComponent = variantContainer?.componentId
|
|
143
|
+
? (variantContainerComponents?.find(c => c.id === variantContainer.componentId) ?? null)
|
|
144
|
+
: null;
|
|
145
|
+
const isContainerLinked = Boolean(variantContainer?.componentId);
|
|
56
146
|
const propEntries = moduleConfig?.props ? Object.entries(moduleConfig.props) : [];
|
|
57
147
|
// Reusable-component state (kywi-cms#46). A node with a componentId is a live
|
|
58
148
|
// instance of a saved component; a bare `component` node from the palette is
|
|
@@ -62,11 +152,19 @@ export function PropsPanel({ module, moduleConfig, onUpdateProps, onUpdateStyle,
|
|
|
62
152
|
: null;
|
|
63
153
|
const isLinked = Boolean(module?.componentId);
|
|
64
154
|
const isUnlinkedComponentNode = module?.type === 'component' && !module?.componentId;
|
|
155
|
+
// What the fields SHOW: the node's own props/style, or — for a linked instance
|
|
156
|
+
// whose component resolved — what this placement actually renders. A clean
|
|
157
|
+
// instance's own props are just the link, so without this the rail would show
|
|
158
|
+
// an empty form for a module full of content (kywi-cms#147 T4).
|
|
159
|
+
const displayProps = (isLinked ? linkedModuleRender?.props : null) ?? module?.props ?? {};
|
|
160
|
+
const displayStyle = (isLinked ? linkedModuleRender?.style : null) ?? module?.style ?? {};
|
|
65
161
|
return (_jsxs("div", { className: isHidden
|
|
66
162
|
? 'kywi-editor-props-panel kywi-editor-props-panel--hidden'
|
|
67
|
-
: 'kywi-editor-props-panel', children: [showSection && section && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "kywi-editor-props-header", children: [_jsx("span", { className: "kywi-editor-props-header-icon", children: _jsx(EditorIcon, { name: "columns", size: 16 }) }), _jsxs("span", { className: "kywi-editor-props-header-title", children: [_jsx("span", { className: "kywi-editor-props-header-eyebrow", children: "Editing" }), _jsx("span", { className: "kywi-editor-props-header-type", children: "section" })] }), _jsx("button", { type: "button", className: "kywi-editor-props-close", onClick: onClose, "aria-label": "Close panel", title: "Close", children: _jsx(EditorIcon, { name: "close", size: 16 }) })] }), _jsx("div", { className: "kywi-editor-props-body", children: isSectionLinked ? (_jsxs("div", { className: "kywi-editor-props-linked", "data-section-linked": "", children: [_jsx("span", { className: "kywi-editor-props-linked-icon", children: _jsx(EditorIcon, { name: "card", size: 16 }) }),
|
|
163
|
+
: 'kywi-editor-props-panel', children: [showSection && section && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "kywi-editor-props-header", children: [_jsx("span", { className: "kywi-editor-props-header-icon", children: _jsx(EditorIcon, { name: "columns", size: 16 }) }), _jsxs("span", { className: "kywi-editor-props-header-title", children: [_jsx("span", { className: "kywi-editor-props-header-eyebrow", children: "Editing" }), _jsx("span", { className: "kywi-editor-props-header-type", children: "section" })] }), _jsx("button", { type: "button", className: "kywi-editor-props-close", onClick: onClose, "aria-label": "Close panel", title: "Close", children: _jsx(EditorIcon, { name: "close", size: 16 }) })] }), _jsx("div", { className: "kywi-editor-props-body", children: isSectionLinked ? (_jsxs("div", { className: "kywi-editor-props-linked", "data-section-linked": "", children: [_jsx("span", { className: "kywi-editor-props-linked-icon", children: _jsx(EditorIcon, { name: "card", size: 16 }) }), _jsx("div", { children: _jsx(LinkedComponentNote, { name: sectionLinkedComponent?.name, previewsStoredCopy: true }) })] })) : unplacedCanvas ? (_jsx(UnplacedCanvasNote, { kind: unplacedCanvas, what: "section" })) : insideLinkedComponent ? (_jsx(InsideLinkedComponentNote, { what: "section" })) : (_jsx("p", { className: "kywi-editor-props-linked-note", children: "Save this section as a reusable component to drop synced copies across your pages." })) }), _jsxs("div", { className: "kywi-editor-props-footer kywi-editor-props-danger-zone", children: [isSectionLinked
|
|
68
164
|
? onDetachSection && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "detach-section", onClick: onDetachSection, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Detach from Component"] }))
|
|
69
|
-
: onSaveSectionAsComponent && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "save-section-as-component", onClick: onSaveSectionAsComponent, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Save as Component"] })), onDeleteSection && (_jsxs("button", { type: "button", className: "kywi-editor-danger", "data-action": "delete-section", onClick: handleDeleteSection, children: [_jsx(EditorIcon, { name: "trash", size: 15 }), "Delete Section"] }))] })] })), showVariantContainer && variantContainer && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "kywi-editor-props-header", children: [_jsx("span", { className: "kywi-editor-props-header-icon", children: _jsx(EditorIcon, { name: variantContainer.mode === 'ab_test' ? 'variant' : 'personalize', size: 16 }) }), _jsxs("span", { className: "kywi-editor-props-header-title", children: [_jsx("span", { className: "kywi-editor-props-header-eyebrow", children: "Editing" }), _jsx("span", { className: "kywi-editor-props-header-type", children: variantContainer.mode === 'ab_test' ? 'A/B tested section' : 'personalized section' })] }), _jsx("button", { type: "button", className: "kywi-editor-props-close", onClick: onClose, "aria-label": "Close panel", title: "Close", children: _jsx(EditorIcon, { name: "close", size: 16 }) })] }),
|
|
165
|
+
: onSaveSectionAsComponent && !componentActionsWithheld && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "save-section-as-component", onClick: onSaveSectionAsComponent, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Save as Component"] })), onDeleteSection && (_jsxs("button", { type: "button", className: "kywi-editor-danger", "data-action": "delete-section", onClick: handleDeleteSection, children: [_jsx(EditorIcon, { name: "trash", size: 15 }), "Delete Section"] }))] })] })), showVariantContainer && variantContainer && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "kywi-editor-props-header", children: [_jsx("span", { className: "kywi-editor-props-header-icon", children: _jsx(EditorIcon, { name: variantContainer.mode === 'ab_test' ? 'variant' : 'personalize', size: 16 }) }), _jsxs("span", { className: "kywi-editor-props-header-title", children: [_jsx("span", { className: "kywi-editor-props-header-eyebrow", children: "Editing" }), _jsx("span", { className: "kywi-editor-props-header-type", children: variantContainer.mode === 'ab_test' ? 'A/B tested section' : 'personalized section' })] }), _jsx("button", { type: "button", className: "kywi-editor-props-close", onClick: onClose, "aria-label": "Close panel", title: "Close", children: _jsx(EditorIcon, { name: "close", size: 16 }) })] }), _jsxs("div", { className: "kywi-editor-props-body", children: [isContainerLinked && (_jsxs("div", { className: "kywi-editor-props-linked", "data-variant-container-linked": "", children: [_jsx("span", { className: "kywi-editor-props-linked-icon", children: _jsx(EditorIcon, { name: "card", size: 16 }) }), _jsx("div", { children: _jsx(LinkedComponentNote, { name: containerLinkedComponent?.name, previewsStoredCopy: true }) })] })), _jsx(SectionVariantContainerConfig, { container: variantContainer, ...(audiences ? { audiences } : {}), onChange: (patch) => onUpdateVariantContainer?.(patch) })] }), _jsxs("div", { className: "kywi-editor-props-footer kywi-editor-props-danger-zone", children: [isContainerLinked
|
|
166
|
+
? onDetachVariantContainer && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "detach-variant-container", onClick: onDetachVariantContainer, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Detach from Component"] }))
|
|
167
|
+
: onSaveVariantContainerAsComponent && !componentActionsWithheld && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "save-variant-container-as-component", onClick: onSaveVariantContainerAsComponent, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Save as Component"] })), onUnwrapVariantContainer && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "unwrap-variant-container", onClick: () => setConfirmUnwrapId(variantContainer.id), children: [_jsx(EditorIcon, { name: "undo", size: 15 }), "Remove personalization"] })), onDeleteVariantContainer && (_jsxs("button", { type: "button", className: "kywi-editor-danger", "data-action": "delete-variant-container", onClick: handleDeleteVariantContainer, children: [_jsx(EditorIcon, { name: "trash", size: 15 }), "Delete Section"] }))] }), confirmUnwrapId && createPortal(
|
|
70
168
|
// Portalled straight to `document.body`, wrapped in BOTH
|
|
71
169
|
// `kywi-admin-shell` and `kywi-overlay-dialog-host` — exactly the
|
|
72
170
|
// element `overlay-shell.tsx`'s own dialog host uses (editor.css's
|
|
@@ -82,20 +180,31 @@ export function PropsPanel({ module, moduleConfig, onUpdateProps, onUpdateStyle,
|
|
|
82
180
|
// height while the dialog is open. The portal escapes the rail
|
|
83
181
|
// entirely, landing as a sibling of it at the document root, same
|
|
84
182
|
// as the existing "Leave the editor?" dialog.
|
|
85
|
-
_jsx("div", { className: "kywi-admin-shell kywi-overlay-dialog-host", children: _jsx(ConfirmDialog, { title: "Remove personalization?", message: "Keeps the Default
|
|
183
|
+
_jsx("div", { className: "kywi-admin-shell kywi-overlay-dialog-host", children: _jsx(ConfirmDialog, { title: "Remove personalization?", message: "Keeps the Default variant's content in place; other variants are discarded (undo restores them).", confirmLabel: "Remove personalization", onConfirm: () => {
|
|
86
184
|
const containerId = confirmUnwrapId;
|
|
87
185
|
setConfirmUnwrapId(null);
|
|
88
186
|
onUnwrapVariantContainer?.(containerId);
|
|
89
|
-
}, onCancel: () => setConfirmUnwrapId(null) }) }), document.body)] })), module && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "kywi-editor-props-header", children: [_jsx("span", { className: "kywi-editor-props-header-icon", children: _jsx(EditorIcon, { name: moduleIconName(module.type), size: 16 }) }), _jsxs("span", { className: "kywi-editor-props-header-title", children: [_jsx("span", { className: "kywi-editor-props-header-eyebrow", children: "Editing" }), _jsx("span", { className: "kywi-editor-props-header-type", children: module.type })] }), _jsx("button", { type: "button", className: "kywi-editor-props-close", onClick: onClose, "aria-label": "Close panel", title: "Close", children: _jsx(EditorIcon, { name: "close", size: 16 }) })] }), _jsxs("div", { className: "kywi-editor-props-body", children: [isLinked ? (_jsxs("div", { className: "kywi-editor-props-linked", children: [_jsx("span", { className: "kywi-editor-props-linked-icon", children: _jsx(EditorIcon, { name: "card", size: 16 }) }),
|
|
187
|
+
}, onCancel: () => setConfirmUnwrapId(null) }) }), document.body)] })), module && (_jsxs(_Fragment, { children: [_jsxs("div", { className: "kywi-editor-props-header", children: [_jsx("span", { className: "kywi-editor-props-header-icon", children: _jsx(EditorIcon, { name: moduleIconName(module.type), size: 16 }) }), _jsxs("span", { className: "kywi-editor-props-header-title", children: [_jsx("span", { className: "kywi-editor-props-header-eyebrow", children: "Editing" }), _jsx("span", { className: "kywi-editor-props-header-type", children: module.type })] }), _jsx("button", { type: "button", className: "kywi-editor-props-close", onClick: onClose, "aria-label": "Close panel", title: "Close", children: _jsx(EditorIcon, { name: "close", size: 16 }) })] }), _jsxs("div", { className: "kywi-editor-props-body", children: [isLinked ? (_jsxs("div", { className: "kywi-editor-props-linked", "data-module-linked": "", children: [_jsx("span", { className: "kywi-editor-props-linked-icon", children: _jsx(EditorIcon, { name: "card", size: 16 }) }), _jsx("div", { children: _jsx(LinkedComponentNote, { name: linkedComponent?.name, stylesCopyWholeMap: true }) })] })) : isUnlinkedComponentNode ? (
|
|
188
|
+
// The picker is withdrawn inside another component, not merely
|
|
189
|
+
// wired to nothing: pointing this placeholder at a component would
|
|
190
|
+
// write a link into the outer component's fallback copy, which is
|
|
191
|
+
// the same unindexed-and-then-lost link the save path refuses.
|
|
192
|
+
unplacedCanvas ? (_jsx(UnplacedCanvasNote, { kind: unplacedCanvas, what: "placeholder" })) : insideLinkedComponent ? (_jsx(InsideLinkedComponentNote, { what: "placeholder" })) : (_jsx(ComponentPickerField, { components: components ?? [], onSelect: (id) => onLinkComponent?.(id) }))) : module.type === 'variantContainer' ? (_jsx(VariantContainerConfig, { props: module.props, ...(audiences ? { audiences } : {}), onChange: (patch) => onUpdateProps({ ...module.props, ...patch }) })) : null, (isLinked || (!isUnlinkedComponentNode && module.type !== 'variantContainer')) && (_jsxs(_Fragment, { children: [propEntries.length > 0 && (_jsx("div", { className: "kywi-editor-props-section-label", children: "Content" })), propEntries.map(([propName, definition]) => {
|
|
90
193
|
// Form / Form Embed: the slug prop is chosen with the form
|
|
91
194
|
// picker (primary UX) rather than typed by hand (kywi-cms#35).
|
|
92
195
|
if (FORM_SLUG_PROP[module.type] === propName) {
|
|
93
|
-
const current =
|
|
196
|
+
const current = displayProps[propName];
|
|
94
197
|
return (_jsxs("div", { className: "kywi-editor-prop-group", children: [_jsx("label", { className: "kywi-editor-prop-label", htmlFor: `prop-${propName}`, children: definition.label }), _jsx(FormPickerField, { id: `prop-${propName}`, value: typeof current === 'string' ? current : '', onChange: (value) => handlePropChange(propName, value) })] }, propName));
|
|
95
198
|
}
|
|
96
|
-
return (_jsx(PropField, { name: propName, definition: definition, value:
|
|
97
|
-
})] })), !
|
|
199
|
+
return (_jsx(PropField, { name: propName, definition: definition, value: displayProps[propName] ?? definition.defaultValue ?? '', onChange: (value) => handlePropChange(propName, value) }, propName));
|
|
200
|
+
})] })), !isUnlinkedComponentNode && (
|
|
201
|
+
// A linked instance shows the style it RENDERS with, same as its
|
|
202
|
+
// props. StyleEditor emits the whole map it was handed, so the first
|
|
203
|
+
// style edit on a clean instance copies the definition's styles onto
|
|
204
|
+
// the node — an override state the save fork then resolves, exactly
|
|
205
|
+
// as it does for props.
|
|
206
|
+
_jsx(StyleEditor, { style: displayStyle, onChange: onUpdateStyle }))] }), _jsxs("div", { className: "kywi-editor-props-footer kywi-editor-props-danger-zone", children: [isLinked
|
|
98
207
|
? onDetach && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "detach-component", onClick: onDetach, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Detach from Component"] }))
|
|
99
|
-
: module.type !== 'component' && onSaveAsComponent && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "save-as-component", onClick: onSaveAsComponent, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Save as Component"] })), _jsxs("button", { type: "button", className: "kywi-editor-danger", onClick: handleDelete, children: [_jsx(EditorIcon, { name: "trash", size: 15 }), "Delete Module"] })] })] }))] }));
|
|
208
|
+
: module.type !== 'component' && onSaveAsComponent && !componentActionsWithheld && (_jsxs("button", { type: "button", className: "kywi-editor-props-component-action", "data-action": "save-as-component", onClick: onSaveAsComponent, children: [_jsx(EditorIcon, { name: "card", size: 15 }), "Save as Component"] })), _jsxs("button", { type: "button", className: "kywi-editor-danger", onClick: handleDelete, children: [_jsx(EditorIcon, { name: "trash", size: 15 }), "Delete Module"] })] })] }))] }));
|
|
100
209
|
}
|
|
101
210
|
//# sourceMappingURL=props-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-panel.js","sourceRoot":"","sources":["../../../src/admin/layout-editor/props-panel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AACZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,eAAe,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IAAI,EAAC,MAAM,EAAC,IAAI,EAAE,EAAE,GAAI,yBAE7B,CACV,EACL,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,oBAAoB,EAC9B,OAAO,EAAE,YAAY,aAErB,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,EAAE,GAAI,qBAE9B,IACL,IACL,CACJ,IACG,CACP,CAAA;AACH,CAAC"}
|
|
@@ -28,12 +28,27 @@ interface SectionOverlayProps {
|
|
|
28
28
|
* occupies on the live page (kywi-cms#94).
|
|
29
29
|
*/
|
|
30
30
|
inPlace?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the front editor's left module-palette rail is expanded. That rail
|
|
33
|
+
* is fixed to the viewport's left edge and paints over a full-width section's
|
|
34
|
+
* chrome, so the chrome moves out of its way (kywi-cms#132). In-place only —
|
|
35
|
+
* the admin artboard's palette is an in-flow column with nothing to avoid.
|
|
36
|
+
*/
|
|
37
|
+
paletteOpen?: boolean;
|
|
31
38
|
/** Resolved base style for the section, applied only in in-place mode. */
|
|
32
39
|
inPlaceStyle?: Record<string, string>;
|
|
33
40
|
/** Scoped responsive CSS for the section, emitted only in in-place mode. */
|
|
34
41
|
responsiveCss?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The component this section is a linked instance of (kywi-cms#147): its id
|
|
44
|
+
* stamps `data-component-id` (matching the public renderer's own hook) and
|
|
45
|
+
* switches the section to the linked outline; its name goes in the pill. Absent
|
|
46
|
+
* for an ordinary section.
|
|
47
|
+
*/
|
|
48
|
+
componentId?: string;
|
|
49
|
+
componentName?: string | null;
|
|
35
50
|
children: React.ReactNode;
|
|
36
51
|
}
|
|
37
|
-
export declare function SectionOverlay({ sectionId, onAddColumn, onDelete, onSelect, isSelected, actions, inPlace, inPlaceStyle, responsiveCss, children, }: SectionOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function SectionOverlay({ sectionId, onAddColumn, onDelete, onSelect, isSelected, actions, inPlace, paletteOpen, inPlaceStyle, responsiveCss, componentId, componentName, children, }: SectionOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
38
53
|
export {};
|
|
39
54
|
//# sourceMappingURL=section-overlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-overlay.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/section-overlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"section-overlay.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/section-overlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIvD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,cAAc,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB;mEAC+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAA;IACzB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAkB,EAClB,OAAO,EACP,OAAe,EACf,WAAmB,EACnB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,QAAQ,GACT,EAAE,mBAAmB,2CAoHrB"}
|
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { EditorIcon } from './editor-icons.js';
|
|
5
|
-
import { useChromeFlip } from './use-chrome-flip.js';
|
|
6
|
-
|
|
5
|
+
import { useChromeFlip, chromeOffsetClasses, chromeOffsetStyle } from './use-chrome-flip.js';
|
|
6
|
+
import { LinkedComponentPill } from './linked-component.js';
|
|
7
|
+
export function SectionOverlay({ sectionId, onAddColumn, onDelete, onSelect, isSelected = false, actions, inPlace = false, paletteOpen = false, inPlaceStyle, responsiveCss, componentId, componentName, children, }) {
|
|
7
8
|
// In place the chrome floats above this section — which puts it under the
|
|
8
9
|
// editor's fixed top bar when the section is at the top of the page, so it is
|
|
9
|
-
// pinned down inside the section instead (kywi-cms#122)
|
|
10
|
-
//
|
|
10
|
+
// pinned down inside the section instead (kywi-cms#122), and behind the open
|
|
11
|
+
// module palette when the section runs full width, so it is also pushed right
|
|
12
|
+
// out of that rail's footprint (kywi-cms#132). Artboard mode has no floating
|
|
13
|
+
// chrome.
|
|
11
14
|
const sectionRef = React.useRef(null);
|
|
12
|
-
const
|
|
15
|
+
const chromeOffsets = useChromeFlip(sectionRef, inPlace, paletteOpen);
|
|
13
16
|
// kywi-cms#49: these overlay controls live inside the page editor's <form>
|
|
14
17
|
// (content-form.tsx) in admin mode. Without an explicit type="button" a
|
|
15
18
|
// <button> defaults to type="submit" — clicking "+Col" submitted the whole
|
|
16
19
|
// page form instead of adding a column. Each also stops propagation so it
|
|
17
20
|
// doesn't double as a section-select (#69).
|
|
18
|
-
const chrome = (_jsxs(_Fragment, { children: [_jsx("span", { className: "kywi-editor-section-handle", "aria-hidden": "true", children: _jsx(EditorIcon, { name: "grip", size: 14 }) }), _jsx("span", { className: "kywi-editor-section-title", children: "Section" }), _jsxs("div", { className: "kywi-editor-section-toolbar-actions", children: [_jsxs("button", { type: "button", className: "kywi-editor-section-toolbar-btn", onClick: (e) => { e.stopPropagation(); onAddColumn(); }, title: "Add column", children: [_jsx(EditorIcon, { name: "columns-plus", size: 14 }), "+Col"] }), actions?.map((action) => (_jsxs("button", { type: "button", className: "kywi-editor-section-toolbar-btn", onClick: (e) => { e.stopPropagation(); action.onClick(); }, title: action.label, children: [_jsx(EditorIcon, { name: action.icon, size: 14 }), action.label] }, action.label))), _jsx("button", { type: "button", className: "kywi-editor-section-toolbar-btn", onClick: (e) => { e.stopPropagation(); onDelete(); }, title: "Delete section", children: "\u00D7" })] })] }));
|
|
21
|
+
const chrome = (_jsxs(_Fragment, { children: [_jsx("span", { className: "kywi-editor-section-handle", "aria-hidden": "true", children: _jsx(EditorIcon, { name: "grip", size: 14 }) }), _jsx("span", { className: "kywi-editor-section-title", children: "Section" }), componentId ? _jsx(LinkedComponentPill, { name: componentName }) : null, _jsxs("div", { className: "kywi-editor-section-toolbar-actions", children: [_jsxs("button", { type: "button", className: "kywi-editor-section-toolbar-btn", onClick: (e) => { e.stopPropagation(); onAddColumn(); }, title: "Add column", children: [_jsx(EditorIcon, { name: "columns-plus", size: 14 }), "+Col"] }), actions?.map((action) => (_jsxs("button", { type: "button", className: "kywi-editor-section-toolbar-btn", onClick: (e) => { e.stopPropagation(); action.onClick(); }, title: action.label, children: [_jsx(EditorIcon, { name: action.icon, size: 14 }), action.label] }, action.label))), _jsx("button", { type: "button", className: "kywi-editor-section-toolbar-btn", onClick: (e) => { e.stopPropagation(); onDelete(); }, title: "Delete section", children: "\u00D7" })] })] }));
|
|
19
22
|
const selectHandler = onSelect
|
|
20
23
|
? {
|
|
21
24
|
onClick: (e) => {
|
|
@@ -27,12 +30,19 @@ export function SectionOverlay({ sectionId, onAddColumn, onDelete, onSelect, isS
|
|
|
27
30
|
}
|
|
28
31
|
: {};
|
|
29
32
|
if (inPlace) {
|
|
30
|
-
return (_jsxs("div", { ref: sectionRef, className:
|
|
33
|
+
return (_jsxs("div", { ref: sectionRef, className: [
|
|
34
|
+
'kywi-section',
|
|
35
|
+
'kywi-ip-section',
|
|
36
|
+
isSelected ? 'kywi-ip-section--selected' : null,
|
|
37
|
+
componentId ? 'kywi-ip-section--linked' : null,
|
|
38
|
+
].filter(Boolean).join(' '), "data-kywi-section": "", "data-section-id": sectionId, ...(componentId ? { 'data-component-id': componentId } : {}), style: inPlaceStyle && Object.keys(inPlaceStyle).length > 0
|
|
31
39
|
? inPlaceStyle
|
|
32
|
-
: undefined, ...selectHandler, children: [responsiveCss ? _jsx("style", { dangerouslySetInnerHTML: { __html: responsiveCss } }) : null, _jsx("div", { className:
|
|
33
|
-
? { '--kywi-ip-chrome-clamp': `${chromeClampPx}px` }
|
|
34
|
-
: undefined, "data-kywi-editor-chrome": "", contentEditable: false, children: chrome }), _jsx("div", { className: "kywi-section-columns", children: children })] }));
|
|
40
|
+
: undefined, ...selectHandler, children: [responsiveCss ? _jsx("style", { dangerouslySetInnerHTML: { __html: responsiveCss } }) : null, _jsx("div", { className: ['kywi-ip-chrome', 'kywi-ip-section-chrome', ...chromeOffsetClasses(chromeOffsets)].join(' '), style: chromeOffsetStyle(chromeOffsets), "data-kywi-editor-chrome": "", contentEditable: false, children: chrome }), _jsx("div", { className: "kywi-section-columns", children: children })] }));
|
|
35
41
|
}
|
|
36
|
-
return (_jsxs("div", { className:
|
|
42
|
+
return (_jsxs("div", { className: [
|
|
43
|
+
'kywi-editor-section',
|
|
44
|
+
isSelected ? 'kywi-editor-section--selected' : null,
|
|
45
|
+
componentId ? 'kywi-editor-section--linked' : null,
|
|
46
|
+
].filter(Boolean).join(' '), "data-section-id": sectionId, ...(componentId ? { 'data-component-id': componentId } : {}), ...selectHandler, children: [_jsx("div", { className: "kywi-editor-section-toolbar", children: chrome }), _jsx("div", { className: "kywi-editor-columns", children: children })] }));
|
|
37
47
|
}
|
|
38
48
|
//# sourceMappingURL=section-overlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-overlay.js","sourceRoot":"","sources":["../../../src/admin/layout-editor/section-overlay.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AACZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"section-overlay.js","sourceRoot":"","sources":["../../../src/admin/layout-editor/section-overlay.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AACZ,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAqD3D,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,OAAO,EACP,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,KAAK,EACnB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,QAAQ,GACY;IACpB,0EAA0E;IAC1E,8EAA8E;IAC9E,6EAA6E;IAC7E,8EAA8E;IAC9E,6EAA6E;IAC7E,UAAU;IACV,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAwB,I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AC,IAAI,CAAC,GAAG,CAAC,EACxG,KAAK,EAAE,iBAAiB,CAAC,aAAa,CAAC,6BACf,EAAE,EAC1B,eAAe,EAAE,KAAK,YAErB,MAAM,GACH,EACN,cAAK,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAO,IAClD,CACP,CAAA;IACH,CAAC;IAED,OAAO,CACL,eACE,SAAS,EAAE;YACT,qBAAqB;YACrB,UAAU,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,IAAI;YACnD,WAAW,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,IAAI;SACnD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,qBACV,SAAS,KACtB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,KACzD,aAAa,aAEjB,cAAK,SAAS,EAAC,6BAA6B,YAAE,MAAM,GAAO,EAC3D,cAAK,SAAS,EAAC,qBAAqB,YAAE,QAAQ,GAAO,IACjD,CACP,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { LayoutSection } from '../../layout/types.js';
|
|
2
|
+
import type { VariantContainer } from '../../layout/types.js';
|
|
3
|
+
import type { EditorComponent } from './use-component-library.js';
|
|
2
4
|
export interface SectionTemplatePickerProps {
|
|
3
5
|
/** Insert an empty section built from one of the 7 built-in column presets. */
|
|
4
6
|
onSelect: (columns: number[]) => void;
|
|
@@ -15,7 +17,31 @@ export interface SectionTemplatePickerProps {
|
|
|
15
17
|
* picker fetches section-type components and offers them as a "Components" source.
|
|
16
18
|
*/
|
|
17
19
|
onInsertComponent?: (section: LayoutSection) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Insert a reusable CONTAINER component (kywi-cms#147) as a linked
|
|
22
|
+
* variant container — a personalized or A-B'd band saved whole.
|
|
23
|
+
*
|
|
24
|
+
* It belongs in this picker rather than in a palette of its own because a
|
|
25
|
+
* container is a region-level node, exactly like a section: this modal already
|
|
26
|
+
* IS the region-level insert affordance, in both shells. A richer library
|
|
27
|
+
* browser (search, previews, usage counts) is the admin Components surface's
|
|
28
|
+
* job (kywi-cms#147 T5); this is the "place one on the page" path.
|
|
29
|
+
*/
|
|
30
|
+
onInsertVariantContainer?: (container: VariantContainer) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The saved components the shell has ALREADY loaded (kywi-cms#147 T3 review,
|
|
33
|
+
* I3): both editor shells hold the whole library from `useComponentLibrary` —
|
|
34
|
+
* one unfiltered `GET /components` — for their pills, their pickers and detach.
|
|
35
|
+
* The picker used to issue two more requests of its own (`?type=section`,
|
|
36
|
+
* `?type=variantContainer`) for rows the caller was already holding, so opening
|
|
37
|
+
* the section picker cost three round trips for one library.
|
|
38
|
+
*
|
|
39
|
+
* Omitted, the picker falls back to fetching its own rows, so a call site
|
|
40
|
+
* without a library still works standalone (that path is what the #47/#69 tests
|
|
41
|
+
* exercise, and it is the only reason the fetches below still exist).
|
|
42
|
+
*/
|
|
43
|
+
componentLibrary?: EditorComponent[];
|
|
18
44
|
onClose: () => void;
|
|
19
45
|
}
|
|
20
|
-
export declare function SectionTemplatePicker({ onSelect, onApplyLayout, onInsertComponent, onClose }: SectionTemplatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function SectionTemplatePicker({ onSelect, onApplyLayout, onInsertComponent, onInsertVariantContainer, componentLibrary, onClose, }: SectionTemplatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
47
|
//# sourceMappingURL=section-template-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-template-picker.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/section-template-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"section-template-picker.d.ts","sourceRoot":"","sources":["../../../src/admin/layout-editor/section-template-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAK7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,MAAM,WAAW,0BAA0B;IACzC,+EAA+E;IAC/E,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACrC;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,IAAI,CAAA;IACnD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;IACpD;;;;;;;;;OASG;IACH,wBAAwB,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAA;IAChE;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAA;IACpC,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAgDD,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EAChB,OAAO,GACR,EAAE,0BAA0B,2CAoM5B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { SECTION_TEMPLATES } from './drag-utils.js';
|
|
5
5
|
import { adminFetch } from '../../host-client/index.js';
|
|
6
6
|
import { isLayoutSection } from '../../layout/types.js';
|
|
7
|
-
import { buildConnectedSectionNode } from './component-actions.js';
|
|
7
|
+
import { buildConnectedSectionNode, buildConnectedVariantContainerNode, } from './component-actions.js';
|
|
8
8
|
/** Flatten a saved layout document to its top-level LayoutSections (across every
|
|
9
9
|
* region, in order). VariantContainers are skipped — only plain sections apply. */
|
|
10
10
|
function layoutToSections(def) {
|
|
@@ -12,9 +12,28 @@ function layoutToSections(def) {
|
|
|
12
12
|
return [];
|
|
13
13
|
return Object.values(def.regions).flat().filter(isLayoutSection);
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/** Component rows → insertable linked sections, dropping anything that isn't one. */
|
|
16
|
+
function toSectionOptions(rows) {
|
|
17
|
+
return rows
|
|
18
|
+
.map(row => {
|
|
19
|
+
const section = buildConnectedSectionNode(row);
|
|
20
|
+
return section ? { id: row.id, name: row.name, section } : null;
|
|
21
|
+
})
|
|
22
|
+
.filter((row) => row !== null);
|
|
23
|
+
}
|
|
24
|
+
/** The container equivalent — a fresh experiment binding per placement. */
|
|
25
|
+
function toContainerOptions(rows) {
|
|
26
|
+
return rows
|
|
27
|
+
.map(row => {
|
|
28
|
+
const container = buildConnectedVariantContainerNode(row);
|
|
29
|
+
return container ? { id: row.id, name: row.name, container } : null;
|
|
30
|
+
})
|
|
31
|
+
.filter((row) => row !== null);
|
|
32
|
+
}
|
|
33
|
+
export function SectionTemplatePicker({ onSelect, onApplyLayout, onInsertComponent, onInsertVariantContainer, componentLibrary, onClose, }) {
|
|
16
34
|
const [savedLayouts, setSavedLayouts] = useState([]);
|
|
17
|
-
const [
|
|
35
|
+
const [fetchedSections, setFetchedSections] = useState([]);
|
|
36
|
+
const [fetchedContainers, setFetchedContainers] = useState([]);
|
|
18
37
|
// Load saved layouts (stored as full LayoutDocuments under /section-templates).
|
|
19
38
|
// Best-effort: a load failure just leaves the saved-layouts group empty, so the
|
|
20
39
|
// 7 built-in presets always remain available.
|
|
@@ -40,11 +59,13 @@ export function SectionTemplatePicker({ onSelect, onApplyLayout, onInsertCompone
|
|
|
40
59
|
.catch(() => { });
|
|
41
60
|
return () => { cancelled = true; };
|
|
42
61
|
}, [onApplyLayout]);
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
62
|
+
// Reusable section components (kywi-cms#69). Each becomes an insertable *linked*
|
|
63
|
+
// section (buildConnectedSectionNode stamps its componentId). Fetched ONLY when
|
|
64
|
+
// the caller has no library to hand (see `componentLibrary`) — best-effort
|
|
65
|
+
// either way, so a load failure just leaves the group empty and the 7 presets
|
|
66
|
+
// available.
|
|
46
67
|
useEffect(() => {
|
|
47
|
-
if (!onInsertComponent)
|
|
68
|
+
if (!onInsertComponent || componentLibrary)
|
|
48
69
|
return;
|
|
49
70
|
let cancelled = false;
|
|
50
71
|
adminFetch('/api/v1/components?type=section')
|
|
@@ -52,17 +73,46 @@ export function SectionTemplatePicker({ onSelect, onApplyLayout, onInsertCompone
|
|
|
52
73
|
.then((body) => {
|
|
53
74
|
if (cancelled)
|
|
54
75
|
return;
|
|
55
|
-
|
|
56
|
-
.map(row => {
|
|
57
|
-
const section = buildConnectedSectionNode(row);
|
|
58
|
-
return section ? { id: row.id, name: row.name, section } : null;
|
|
59
|
-
})
|
|
60
|
-
.filter((row) => row !== null);
|
|
61
|
-
setSectionComponents(rows);
|
|
76
|
+
setFetchedSections(toSectionOptions(body.data ?? []));
|
|
62
77
|
})
|
|
63
78
|
.catch(() => { });
|
|
64
79
|
return () => { cancelled = true; };
|
|
65
|
-
}, [onInsertComponent]);
|
|
80
|
+
}, [onInsertComponent, componentLibrary]);
|
|
81
|
+
// Container components (kywi-cms#147), the same shape one level up: each
|
|
82
|
+
// becomes an insertable LINKED container (buildConnectedVariantContainerNode
|
|
83
|
+
// stamps its componentId and mints a fresh experiment binding for an A/B one,
|
|
84
|
+
// so a second placement never reports into the first placement's experiment).
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!onInsertVariantContainer || componentLibrary)
|
|
87
|
+
return;
|
|
88
|
+
let cancelled = false;
|
|
89
|
+
adminFetch('/api/v1/components?type=variantContainer')
|
|
90
|
+
.then(r => (r.ok ? r.json() : Promise.reject(new Error(String(r.status)))))
|
|
91
|
+
.then((body) => {
|
|
92
|
+
if (cancelled)
|
|
93
|
+
return;
|
|
94
|
+
setFetchedContainers(toContainerOptions(body.data ?? []));
|
|
95
|
+
})
|
|
96
|
+
.catch(() => { });
|
|
97
|
+
return () => { cancelled = true; };
|
|
98
|
+
}, [onInsertVariantContainer, componentLibrary]);
|
|
99
|
+
// The rows on offer: the caller's library when there is one, otherwise what was
|
|
100
|
+
// fetched above. Each group stays empty without its insert handler — a row that
|
|
101
|
+
// cannot be inserted is not an offer.
|
|
102
|
+
const sectionComponents = useMemo(() => {
|
|
103
|
+
if (!onInsertComponent)
|
|
104
|
+
return [];
|
|
105
|
+
if (!componentLibrary)
|
|
106
|
+
return fetchedSections;
|
|
107
|
+
return toSectionOptions(componentLibrary.filter(c => c.type === 'section'));
|
|
108
|
+
}, [onInsertComponent, componentLibrary, fetchedSections]);
|
|
109
|
+
const containerComponents = useMemo(() => {
|
|
110
|
+
if (!onInsertVariantContainer)
|
|
111
|
+
return [];
|
|
112
|
+
if (!componentLibrary)
|
|
113
|
+
return fetchedContainers;
|
|
114
|
+
return toContainerOptions(componentLibrary.filter(c => c.type === 'variantContainer'));
|
|
115
|
+
}, [onInsertVariantContainer, componentLibrary, fetchedContainers]);
|
|
66
116
|
function handleOverlayClick(e) {
|
|
67
117
|
// Only close when clicking the backdrop itself, not children
|
|
68
118
|
if (e.target === e.currentTarget) {
|
|
@@ -81,9 +131,13 @@ export function SectionTemplatePicker({ onSelect, onApplyLayout, onInsertCompone
|
|
|
81
131
|
onInsertComponent?.(option.section);
|
|
82
132
|
onClose();
|
|
83
133
|
}
|
|
134
|
+
function handleInsertContainer(option) {
|
|
135
|
+
onInsertVariantContainer?.(option.container);
|
|
136
|
+
onClose();
|
|
137
|
+
}
|
|
84
138
|
return (_jsx("div", { className: "kywi-editor-template-overlay", onClick: handleOverlayClick, children: _jsxs("div", { className: "kywi-editor-template-modal", children: [_jsx("div", { className: "kywi-editor-template-modal-header", children: _jsx("span", { className: "kywi-editor-template-modal-title", children: "Choose Section Layout" }) }), _jsx("div", { className: "kywi-editor-template-grid", children: SECTION_TEMPLATES.map((template) => (
|
|
85
139
|
// kywi-cms#49: rendered inside the page editor's <form> — needs an
|
|
86
140
|
// explicit type="button" or it defaults to type="submit".
|
|
87
|
-
_jsxs("button", { type: "button", className: "kywi-editor-template-option", onClick: () => handleOptionClick(template.columns), children: [_jsx("div", { className: "kywi-editor-template-preview", children: template.columns.map((width, idx) => (_jsx("div", { className: "kywi-editor-template-col", style: { flexGrow: width, flexShrink: 1, flexBasis: 0 } }, idx))) }), _jsx("div", { className: "kywi-editor-template-label", children: template.label })] }, template.label))) }), onApplyLayout && savedLayouts.length > 0 && (_jsxs("div", { className: "kywi-editor-template-saved", children: [_jsx("div", { className: "kywi-editor-template-modal-subtitle", children: "Saved Layouts" }), _jsx("div", { className: "kywi-editor-template-saved-list", children: savedLayouts.map((option) => (_jsxs("button", { type: "button", className: "kywi-editor-template-saved-option", "data-saved-layout-id": option.id, onClick: () => handleApply(option), children: [_jsx("span", { className: "kywi-editor-template-saved-name", children: option.name }), _jsxs("span", { className: "kywi-editor-template-saved-meta", children: [option.category, " \u00B7 ", option.sections.length, " section", option.sections.length === 1 ? '' : 's'] })] }, option.id))) })] })),
|
|
141
|
+
_jsxs("button", { type: "button", className: "kywi-editor-template-option", onClick: () => handleOptionClick(template.columns), children: [_jsx("div", { className: "kywi-editor-template-preview", children: template.columns.map((width, idx) => (_jsx("div", { className: "kywi-editor-template-col", style: { flexGrow: width, flexShrink: 1, flexBasis: 0 } }, idx))) }), _jsx("div", { className: "kywi-editor-template-label", children: template.label })] }, template.label))) }), onApplyLayout && savedLayouts.length > 0 && (_jsxs("div", { className: "kywi-editor-template-saved", children: [_jsx("div", { className: "kywi-editor-template-modal-subtitle", children: "Saved Layouts" }), _jsx("div", { className: "kywi-editor-template-saved-list", children: savedLayouts.map((option) => (_jsxs("button", { type: "button", className: "kywi-editor-template-saved-option", "data-saved-layout-id": option.id, onClick: () => handleApply(option), children: [_jsx("span", { className: "kywi-editor-template-saved-name", children: option.name }), _jsxs("span", { className: "kywi-editor-template-saved-meta", children: [option.category, " \u00B7 ", option.sections.length, " section", option.sections.length === 1 ? '' : 's'] })] }, option.id))) })] })), sectionComponents.length + containerComponents.length > 0 && (_jsxs("div", { className: "kywi-editor-template-saved", children: [_jsx("div", { className: "kywi-editor-template-modal-subtitle", children: "Components" }), _jsxs("div", { className: "kywi-editor-template-saved-list", children: [sectionComponents.map((option) => (_jsxs("button", { type: "button", className: "kywi-editor-template-saved-option kywi-editor-template-component-option", "data-section-component-id": option.id, onClick: () => handleInsertComponent(option), children: [_jsx("span", { className: "kywi-editor-template-saved-name", children: option.name }), _jsx("span", { className: "kywi-editor-template-saved-meta", children: "Linked \u00B7 stays in sync with the source" })] }, option.id))), containerComponents.map((option) => (_jsxs("button", { type: "button", className: "kywi-editor-template-saved-option kywi-editor-template-component-option", "data-container-component-id": option.id, onClick: () => handleInsertContainer(option), children: [_jsx("span", { className: "kywi-editor-template-saved-name", children: option.name }), _jsxs("span", { className: "kywi-editor-template-saved-meta", children: ["Linked \u00B7 ", option.container.mode === 'ab_test' ? 'A/B tested' : 'personalized', " band"] })] }, option.id)))] })] }))] }) }));
|
|
88
142
|
}
|
|
89
143
|
//# sourceMappingURL=section-template-picker.js.map
|