@bettercms-ai/kit 3.0.0 → 3.0.2
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/dist/brand/logo.js +67 -18
- package/dist/brand/logo.js.map +1 -1
- package/dist/context.js +8 -3
- package/dist/context.js.map +1 -1
- package/dist/controls/button.js +451 -134
- package/dist/controls/button.js.map +1 -1
- package/dist/controls/choice.js +336 -95
- package/dist/controls/choice.js.map +1 -1
- package/dist/controls/code.js +245 -72
- package/dist/controls/code.js.map +1 -1
- package/dist/controls/color.js +108 -31
- package/dist/controls/color.js.map +1 -1
- package/dist/controls/date.js +268 -83
- package/dist/controls/date.js.map +1 -1
- package/dist/controls/form-picker.js +26 -9
- package/dist/controls/form-picker.js.map +1 -1
- package/dist/controls/icon.js +341 -100
- package/dist/controls/icon.js.map +1 -1
- package/dist/controls/json.js +20 -7
- package/dist/controls/json.js.map +1 -1
- package/dist/controls/link.js +561 -156
- package/dist/controls/link.js.map +1 -1
- package/dist/controls/location.js +124 -35
- package/dist/controls/location.js.map +1 -1
- package/dist/controls/media.js +928 -267
- package/dist/controls/media.js.map +1 -1
- package/dist/controls/number.js +80 -23
- package/dist/controls/number.js.map +1 -1
- package/dist/controls/reference.js +516 -155
- package/dist/controls/reference.js.map +1 -1
- package/dist/controls/rich-text/article-shell.js +327 -86
- package/dist/controls/rich-text/article-shell.js.map +1 -1
- package/dist/controls/rich-text/author.js +78 -21
- package/dist/controls/rich-text/author.js.map +1 -1
- package/dist/controls/rich-text/blocks.js +1084 -315
- package/dist/controls/rich-text/blocks.js.map +1 -1
- package/dist/controls/rich-text/button.js +30 -9
- package/dist/controls/rich-text/button.js.map +1 -1
- package/dist/controls/rich-text/catalog.js +168 -51
- package/dist/controls/rich-text/catalog.js.map +1 -1
- package/dist/controls/rich-text/columns.js +104 -31
- package/dist/controls/rich-text/columns.js.map +1 -1
- package/dist/controls/rich-text/component-card.js +790 -209
- package/dist/controls/rich-text/component-card.js.map +1 -1
- package/dist/controls/rich-text/component-panel.js +102 -40
- package/dist/controls/rich-text/component-panel.js.map +1 -1
- package/dist/controls/rich-text/control.js +101 -32
- package/dist/controls/rich-text/control.js.map +1 -1
- package/dist/controls/rich-text/editor.js +423 -121
- package/dist/controls/rich-text/editor.js.map +1 -1
- package/dist/controls/rich-text/embed.js +184 -51
- package/dist/controls/rich-text/embed.js.map +1 -1
- package/dist/controls/rich-text/floating.js +171 -42
- package/dist/controls/rich-text/floating.js.map +1 -1
- package/dist/controls/rich-text/footnote.js +89 -28
- package/dist/controls/rich-text/footnote.js.map +1 -1
- package/dist/controls/rich-text/gallery.js +88 -27
- package/dist/controls/rich-text/gallery.js.map +1 -1
- package/dist/controls/rich-text/link-form.js +111 -34
- package/dist/controls/rich-text/link-form.js.map +1 -1
- package/dist/controls/rich-text/plain.js +8 -3
- package/dist/controls/rich-text/plain.js.map +1 -1
- package/dist/controls/rich-text/related.js +86 -25
- package/dist/controls/rich-text/related.js.map +1 -1
- package/dist/controls/rich-text/toc.js +48 -15
- package/dist/controls/rich-text/toc.js.map +1 -1
- package/dist/controls/rich-text/toolbar.js +408 -107
- package/dist/controls/rich-text/toolbar.js.map +1 -1
- package/dist/controls/scale.js +169 -52
- package/dist/controls/scale.js.map +1 -1
- package/dist/controls/slot.js +238 -73
- package/dist/controls/slot.js.map +1 -1
- package/dist/controls/table/table-editor.js +1766 -500
- package/dist/controls/table/table-editor.js.map +1 -1
- package/dist/controls/table/table-link.js +119 -38
- package/dist/controls/table/table-link.js.map +1 -1
- package/dist/controls/table/table.js +26 -9
- package/dist/controls/table/table.js.map +1 -1
- package/dist/controls/text.js +221 -68
- package/dist/controls/text.js.map +1 -1
- package/dist/controls/unknown-value.js +79 -22
- package/dist/controls/unknown-value.js.map +1 -1
- package/dist/engine/array.js +875 -233
- package/dist/engine/array.js.map +1 -1
- package/dist/engine/bits.js +38 -13
- package/dist/engine/bits.js.map +1 -1
- package/dist/engine/breadcrumb.js +25 -8
- package/dist/engine/breadcrumb.js.map +1 -1
- package/dist/engine/expand.js +38 -13
- package/dist/engine/expand.js.map +1 -1
- package/dist/engine/field-list.js +14 -5
- package/dist/engine/field-list.js.map +1 -1
- package/dist/engine/field-shell.js +849 -244
- package/dist/engine/field-shell.js.map +1 -1
- package/dist/engine/frame.js +275 -78
- package/dist/engine/frame.js.map +1 -1
- package/dist/engine/grouping.js +630 -193
- package/dist/engine/grouping.js.map +1 -1
- package/dist/engine/item-list.js +187 -50
- package/dist/engine/item-list.js.map +1 -1
- package/dist/engine/kit-field.js +320 -95
- package/dist/engine/kit-field.js.map +1 -1
- package/dist/engine/schema-form.js +101 -32
- package/dist/engine/schema-form.js.map +1 -1
- package/dist/engine/slot.js +146 -45
- package/dist/engine/slot.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/icons.js +14 -5
- package/dist/lib/icons.js.map +1 -1
- package/dist/styles.css +5821 -1
- package/dist/table/table-view.js +49 -16
- package/dist/table/table-view.js.map +1 -1
- package/dist/testing/test-form.js +14 -5
- package/dist/testing/test-form.js.map +1 -1
- package/dist/theme.js +8 -3
- package/dist/theme.js.map +1 -1
- package/dist/ui/action-tray.js +97 -24
- package/dist/ui/action-tray.js.map +1 -1
- package/dist/ui/autocomplete.js +135 -38
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/button.js +108 -31
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/choice-switch.js +14 -5
- package/dist/ui/choice-switch.js.map +1 -1
- package/dist/ui/controls.js +279 -86
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/display.js +401 -116
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/expanded-editor-modal.js +100 -27
- package/dist/ui/expanded-editor-modal.js.map +1 -1
- package/dist/ui/floating-panel.js +130 -37
- package/dist/ui/floating-panel.js.map +1 -1
- package/dist/ui/index.js +2 -2
- package/dist/ui/input.js +196 -59
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/mode-bar.js +32 -11
- package/dist/ui/mode-bar.js.map +1 -1
- package/dist/ui/overlay.js +616 -179
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/path-crumbs.js +374 -113
- package/dist/ui/path-crumbs.js.map +1 -1
- package/dist/ui/select.js +311 -78
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/shortcut-hint.d.ts +3 -0
- package/dist/ui/shortcut-hint.js +33 -7
- package/dist/ui/shortcut-hint.js.map +1 -1
- package/dist/ui/spinner.js +20 -7
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.js +35 -10
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/tab.js +50 -17
- package/dist/ui/tab.js.map +1 -1
- package/dist/ui/toast.js +107 -30
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tooltip-root.js +24 -7
- package/dist/ui/tooltip-root.js.map +1 -1
- package/package.json +2 -2
package/dist/brand/logo.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
4
4
|
//#region src/brand/logo.tsx
|
|
5
|
+
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/brand/logo.tsx";
|
|
5
6
|
var ICON = [
|
|
6
7
|
"M12.7575 27.0001L1.51134 20.0938C0.572213 19.5171 0.000244141 18.4961 0.000244141 17.3965V8.59934C0.000244141 7.45142 0.623145 6.3933 1.62844 5.83354L9.5867 1.4023C10.4896 0.899541 11.5815 0.866267 12.5135 1.3131L23.8336 6.74014L14.354 12.1618C13.3665 12.7265 12.7575 13.7747 12.7575 14.9096V27.0001Z",
|
|
7
8
|
"M14.3398 16.0219V18.8735L22.2169 13.8627C23.1316 13.2808 23.6853 12.2739 23.6853 11.1921V8.29945L15.7983 13.3576C14.8893 13.9406 14.3398 14.9443 14.3398 16.0219Z",
|
|
@@ -35,42 +36,70 @@ var BRAND_STOPS = [
|
|
|
35
36
|
}
|
|
36
37
|
];
|
|
37
38
|
function MarkGradient({ id }) {
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsxDEV("linearGradient", {
|
|
39
40
|
id,
|
|
40
41
|
x1: "8.81595",
|
|
41
42
|
y1: "-2.84571",
|
|
42
43
|
x2: "18.8801",
|
|
43
44
|
y2: "29.1204",
|
|
44
45
|
gradientUnits: "userSpaceOnUse",
|
|
45
|
-
children: BRAND_STOPS.map((s) => /* @__PURE__ */
|
|
46
|
+
children: BRAND_STOPS.map((s) => /* @__PURE__ */ jsxDEV("stop", {
|
|
46
47
|
offset: s.offset,
|
|
47
48
|
stopColor: s.color
|
|
48
|
-
}, s.offset
|
|
49
|
-
|
|
49
|
+
}, s.offset, false, {
|
|
50
|
+
fileName: _jsxFileName,
|
|
51
|
+
lineNumber: 21,
|
|
52
|
+
columnNumber: 31
|
|
53
|
+
}, this))
|
|
54
|
+
}, void 0, false, {
|
|
55
|
+
fileName: _jsxFileName,
|
|
56
|
+
lineNumber: 20,
|
|
57
|
+
columnNumber: 5
|
|
58
|
+
}, this);
|
|
50
59
|
}
|
|
51
60
|
/** The mark alone (square). */
|
|
52
61
|
function LogoMark({ size = 24, className }) {
|
|
53
62
|
const id = React.useId().replace(/:/g, "");
|
|
54
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ jsxDEV("svg", {
|
|
55
64
|
width: size,
|
|
56
65
|
height: size,
|
|
57
66
|
viewBox: "-1 0 26 28",
|
|
58
67
|
className: cn("shrink-0", className),
|
|
59
68
|
"aria-hidden": true,
|
|
60
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ jsxDEV("defs", { children: /* @__PURE__ */ jsxDEV(MarkGradient, { id: `bm${id}` }, void 0, false, {
|
|
70
|
+
fileName: _jsxFileName,
|
|
71
|
+
lineNumber: 31,
|
|
72
|
+
columnNumber: 13
|
|
73
|
+
}, this) }, void 0, false, {
|
|
74
|
+
fileName: _jsxFileName,
|
|
75
|
+
lineNumber: 31,
|
|
76
|
+
columnNumber: 7
|
|
77
|
+
}, this), ICON.map((d) => /* @__PURE__ */ jsxDEV("path", {
|
|
61
78
|
d,
|
|
62
79
|
fill: `url(#bm${id})`
|
|
63
|
-
}, d.slice(0, 12)
|
|
64
|
-
|
|
80
|
+
}, d.slice(0, 12), false, {
|
|
81
|
+
fileName: _jsxFileName,
|
|
82
|
+
lineNumber: 32,
|
|
83
|
+
columnNumber: 24
|
|
84
|
+
}, this))]
|
|
85
|
+
}, void 0, true, {
|
|
86
|
+
fileName: _jsxFileName,
|
|
87
|
+
lineNumber: 30,
|
|
88
|
+
columnNumber: 5
|
|
89
|
+
}, this);
|
|
65
90
|
}
|
|
66
91
|
/** Full lockup: mark + "BetterCMS" wordmark. Height-driven (default 24px → 106px wide). */
|
|
67
92
|
function Logo({ className, compact, height = 24 }) {
|
|
68
93
|
const id = React.useId().replace(/:/g, "");
|
|
69
|
-
if (compact) return /* @__PURE__ */
|
|
94
|
+
if (compact) return /* @__PURE__ */ jsxDEV(LogoMark, {
|
|
70
95
|
size: height,
|
|
71
96
|
className
|
|
72
|
-
}
|
|
73
|
-
|
|
97
|
+
}, void 0, false, {
|
|
98
|
+
fileName: _jsxFileName,
|
|
99
|
+
lineNumber: 40,
|
|
100
|
+
columnNumber: 23
|
|
101
|
+
}, this);
|
|
102
|
+
return /* @__PURE__ */ jsxDEV("svg", {
|
|
74
103
|
height,
|
|
75
104
|
width: height * 113 / 28,
|
|
76
105
|
viewBox: "0 0 113 28",
|
|
@@ -78,17 +107,37 @@ function Logo({ className, compact, height = 24 }) {
|
|
|
78
107
|
role: "img",
|
|
79
108
|
"aria-label": "BetterCMS",
|
|
80
109
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
110
|
+
/* @__PURE__ */ jsxDEV("defs", { children: /* @__PURE__ */ jsxDEV(MarkGradient, { id: `bl${id}` }, void 0, false, {
|
|
111
|
+
fileName: _jsxFileName,
|
|
112
|
+
lineNumber: 43,
|
|
113
|
+
columnNumber: 13
|
|
114
|
+
}, this) }, void 0, false, {
|
|
115
|
+
fileName: _jsxFileName,
|
|
116
|
+
lineNumber: 43,
|
|
117
|
+
columnNumber: 7
|
|
118
|
+
}, this),
|
|
119
|
+
ICON.map((d) => /* @__PURE__ */ jsxDEV("path", {
|
|
83
120
|
d,
|
|
84
121
|
fill: `url(#bl${id})`
|
|
85
|
-
}, d.slice(0, 12)
|
|
86
|
-
|
|
122
|
+
}, d.slice(0, 12), false, {
|
|
123
|
+
fileName: _jsxFileName,
|
|
124
|
+
lineNumber: 44,
|
|
125
|
+
columnNumber: 24
|
|
126
|
+
}, this)),
|
|
127
|
+
WORD.map((d) => /* @__PURE__ */ jsxDEV("path", {
|
|
87
128
|
d,
|
|
88
129
|
fill: "currentColor"
|
|
89
|
-
}, d.slice(0, 12)
|
|
130
|
+
}, d.slice(0, 12), false, {
|
|
131
|
+
fileName: _jsxFileName,
|
|
132
|
+
lineNumber: 45,
|
|
133
|
+
columnNumber: 24
|
|
134
|
+
}, this))
|
|
90
135
|
]
|
|
91
|
-
}
|
|
136
|
+
}, void 0, true, {
|
|
137
|
+
fileName: _jsxFileName,
|
|
138
|
+
lineNumber: 42,
|
|
139
|
+
columnNumber: 5
|
|
140
|
+
}, this);
|
|
92
141
|
}
|
|
93
142
|
//#endregion
|
|
94
143
|
export { BRAND_STOPS, Logo, LogoMark, SPARKLE_PATH };
|
package/dist/brand/logo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.js","names":[],"sources":["../../src/brand/logo.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../lib/cn\";\n\n/* OFFICIAL BetterCMS logo — exported from the V2 Figma (node 60995:8678 \"Link - BetterCMS home\").\n Mark: three facets with the brand gradient (#A878D2 → #ED6262 → #D13A3A).\n Wordmark: --kit-wordmark (#291018 on light, = --kit-fg on dark). Never redraw or recolor the mark. */\n\nconst ICON = [\"M12.7575 27.0001L1.51134 20.0938C0.572213 19.5171 0.000244141 18.4961 0.000244141 17.3965V8.59934C0.000244141 7.45142 0.623145 6.3933 1.62844 5.83354L9.5867 1.4023C10.4896 0.899541 11.5815 0.866267 12.5135 1.3131L23.8336 6.74014L14.354 12.1618C13.3665 12.7265 12.7575 13.7747 12.7575 14.9096V27.0001Z\", \"M14.3398 16.0219V18.8735L22.2169 13.8627C23.1316 13.2808 23.6853 12.2739 23.6853 11.1921V8.29945L15.7983 13.3576C14.8893 13.9406 14.3398 14.9443 14.3398 16.0219Z\", \"M14.3398 22.2591V25.1107L22.2169 20.0999C23.1316 19.518 23.6853 18.5111 23.6853 17.4293V14.5367L15.7983 19.5948C14.8893 20.1779 14.3398 21.1815 14.3398 22.2591Z\"];\nconst WORD = [\"M70.5658 20.3613V10.9967H72.1245V12.1933C72.8865 11.2048 73.8044 10.8407 75.2418 10.9274V12.7136C73.2675 12.6095 72.1245 13.598 72.1245 15.4362V20.3613H70.5658Z\", \"M65.4408 20.5694C62.8083 20.5694 61.1977 18.4537 61.1977 15.679C61.1977 12.8696 62.8603 10.8406 65.3888 10.8406C67.8134 10.8406 69.4067 12.7309 69.4067 15.4015V16.0779H62.8083C62.9123 17.76 63.8994 19.0433 65.4408 19.0433C66.5319 19.0433 67.4497 18.4363 67.9866 17.2744L69.2682 17.9161C68.4889 19.7023 67.138 20.5694 65.4408 20.5694ZM62.8776 14.6212H67.7615C67.5883 13.2858 66.705 12.3494 65.3888 12.3494C64.0207 12.3494 63.1028 13.3379 62.8776 14.6212Z\", \"M59.2561 20.5693C57.5935 20.5693 56.918 19.9276 56.918 18.2975V12.5053H55.394V10.9966H56.918V8.37799H58.4767V10.9966H60.3298V12.5053H58.4767V18.072C58.4767 18.8524 58.8231 19.0085 59.3253 19.0085H60.4164V20.4999C60.07 20.5346 59.6371 20.5693 59.2561 20.5693Z\", \"M53.3658 20.5693C51.7033 20.5693 51.0278 19.9276 51.0278 18.2975V12.5053H49.5038V10.9966H51.0278V8.37799H52.5865V10.9966H54.4396V12.5053H52.5865V18.072C52.5865 18.8524 52.9329 19.0085 53.4351 19.0085H54.5262V20.4999C54.1798 20.5346 53.7469 20.5693 53.3658 20.5693Z\", \"M44.9815 20.5695C42.3491 20.5695 40.7384 18.4538 40.7384 15.6791C40.7384 12.8697 42.401 10.8408 44.9296 10.8408C47.3542 10.8408 48.9475 12.731 48.9475 15.4016V16.078H42.3491C42.453 17.7601 43.4402 19.0434 44.9815 19.0434C46.0726 19.0434 46.9905 18.4365 47.5274 17.2746L48.8089 17.9162C48.0296 19.7024 46.6787 20.5695 44.9815 20.5695ZM42.4184 14.6213H47.3022C47.129 13.286 46.2458 12.3495 44.9296 12.3495C43.5614 12.3495 42.6435 13.338 42.4184 14.6213Z\", \"M29.834 20.3613V7.32031H35.1162C37.6447 7.32031 39.0995 8.5169 39.0995 10.5806C39.0995 11.8639 38.5279 12.8697 37.4542 13.4593C38.8743 13.9449 39.6537 15.0894 39.6537 16.5808C39.6537 18.8353 37.8352 20.3613 35.1854 20.3613H29.834ZM31.3927 12.7483H34.6486C36.4151 12.7483 37.5581 11.9506 37.5581 10.6673C37.5581 9.52272 36.6229 8.86373 35.0469 8.86373H31.3927V12.7483ZM31.3927 18.8006H35.0642C36.9346 18.8006 38.0603 17.9682 38.043 16.5808C38.0603 15.1415 36.848 14.257 34.891 14.257H31.3927V18.8006Z\", \"M107.608 20.6788C104.835 20.6788 103.115 19.3074 102.697 16.7653L104.2 16.4643C104.501 18.2538 105.637 19.1736 107.524 19.1736C109.345 19.1736 110.614 18.3039 110.614 17.0663C110.614 15.9793 109.629 15.2267 107.224 14.5242C104.301 13.688 103.048 12.4504 103.048 10.7111C103.048 8.72086 104.685 7.48326 107.307 7.48326C109.862 7.48326 111.399 8.65396 111.917 10.895L110.364 11.2295C110.03 9.72433 109.027 8.97173 107.274 8.97173C105.637 8.97173 104.618 9.60726 104.618 10.6943C104.618 11.6978 105.47 12.3835 107.858 13.1194C110.998 14.0727 112.167 15.3103 112.167 17.0663C112.167 19.2572 110.38 20.6788 107.608 20.6788Z\", \"M89.8249 20.3612V7.78442H91.7289L95.871 18.2204L99.9463 7.78442H101.85V20.3612H100.347V10.6945L96.5725 20.3612H95.1695L91.328 10.6945V20.3612H89.8249Z\", \"M83.2802 20.6788C79.6558 20.6788 77.0837 18.0364 77.0837 14.24C77.0837 10.3766 79.8061 7.4833 83.4639 7.4833C85.9692 7.4833 87.9902 8.82125 88.9756 11.079L87.3889 11.4303C86.6206 9.90833 85.2009 9.02194 83.4305 9.02194C80.6579 9.02194 78.7038 11.1961 78.7038 14.1731C78.7038 17.0998 80.5911 19.1569 83.2635 19.1569C85.2343 19.1569 86.8043 18.0364 87.5392 16.1967L89.0424 16.5312C88.0737 19.1569 86.036 20.6788 83.2802 20.6788Z\"];\n/** boxicons:sparkle-circle-filled — path from public/brand/ai-sparkle-glyph.svg (viewBox 2 2 16 16). */\nexport const SPARKLE_PATH = \"M9.4668 2.37243C9.64848 1.87586 10.351 1.87586 10.5326 2.37243L11.0754 3.85459C11.501 5.01732 12.1751 6.07325 13.0506 6.94879C13.9262 7.82432 14.9821 8.4984 16.1448 8.92405L17.627 9.4668C18.1243 9.64848 18.1243 10.351 17.627 10.5326L16.1448 11.0754C14.9821 11.501 13.9262 12.1751 13.0506 13.0506C12.1751 13.9262 11.501 14.9821 11.0754 16.1448L10.5326 17.627C10.351 18.1243 9.64848 18.1243 9.4668 17.627L8.92405 16.1448C8.4984 14.9821 7.82432 13.9262 6.94879 13.0506C6.07325 12.1751 5.01732 11.501 3.85459 11.0754L2.37243 10.5326C1.87586 10.351 1.87586 9.64848 2.37243 9.4668L3.85459 8.92405C5.01732 8.4984 6.07325 7.82432 6.94879 6.94879C7.82432 6.07325 8.4984 5.01732 8.92405 3.85459L9.4668 2.37243Z\";\nexport const BRAND_STOPS = [\n { offset: 0.0817, color: \"#A878D2\" },\n { offset: 0.4808, color: \"#ED6262\" },\n { offset: 0.9231, color: \"#D13A3A\" },\n];\n\nfunction MarkGradient({ id }: { id: string }) {\n return (\n <linearGradient id={id} x1=\"8.81595\" y1=\"-2.84571\" x2=\"18.8801\" y2=\"29.1204\" gradientUnits=\"userSpaceOnUse\">\n {BRAND_STOPS.map((s) => <stop key={s.offset} offset={s.offset} stopColor={s.color} />)}\n </linearGradient>\n );\n}\n\n/** The mark alone (square). */\nexport function LogoMark({ size = 24, className }: { size?: number; className?: string }) {\n const id = React.useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"-1 0 26 28\" className={cn(\"shrink-0\", className)} aria-hidden>\n <defs><MarkGradient id={`bm${id}`} /></defs>\n {ICON.map((d) => <path key={d.slice(0, 12)} d={d} fill={`url(#bm${id})`} />)}\n </svg>\n );\n}\n\n/** Full lockup: mark + \"BetterCMS\" wordmark. Height-driven (default 24px → 106px wide). */\nexport function Logo({ className, compact, height = 24 }: { className?: string; compact?: boolean; height?: number }) {\n const id = React.useId().replace(/:/g, \"\");\n if (compact) return <LogoMark size={height} className={className} />;\n return (\n <svg height={height} width={(height * 113) / 28} viewBox=\"0 0 113 28\" className={cn(\"shrink-0 text-[var(--kit-wordmark,#291018)] [.dark_&]:text-[var(--kit-fg,#e1e1e4)]\", className)} role=\"img\" aria-label=\"BetterCMS\">\n <defs><MarkGradient id={`bl${id}`} /></defs>\n {ICON.map((d) => <path key={d.slice(0, 12)} d={d} fill={`url(#bl${id})`} />)}\n {WORD.map((d) => <path key={d.slice(0, 12)} d={d} fill=\"currentColor\" />)}\n </svg>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logo.js","names":[],"sources":["../../src/brand/logo.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../lib/cn\";\n\n/* OFFICIAL BetterCMS logo — exported from the V2 Figma (node 60995:8678 \"Link - BetterCMS home\").\n Mark: three facets with the brand gradient (#A878D2 → #ED6262 → #D13A3A).\n Wordmark: --kit-wordmark (#291018 on light, = --kit-fg on dark). Never redraw or recolor the mark. */\n\nconst ICON = [\"M12.7575 27.0001L1.51134 20.0938C0.572213 19.5171 0.000244141 18.4961 0.000244141 17.3965V8.59934C0.000244141 7.45142 0.623145 6.3933 1.62844 5.83354L9.5867 1.4023C10.4896 0.899541 11.5815 0.866267 12.5135 1.3131L23.8336 6.74014L14.354 12.1618C13.3665 12.7265 12.7575 13.7747 12.7575 14.9096V27.0001Z\", \"M14.3398 16.0219V18.8735L22.2169 13.8627C23.1316 13.2808 23.6853 12.2739 23.6853 11.1921V8.29945L15.7983 13.3576C14.8893 13.9406 14.3398 14.9443 14.3398 16.0219Z\", \"M14.3398 22.2591V25.1107L22.2169 20.0999C23.1316 19.518 23.6853 18.5111 23.6853 17.4293V14.5367L15.7983 19.5948C14.8893 20.1779 14.3398 21.1815 14.3398 22.2591Z\"];\nconst WORD = [\"M70.5658 20.3613V10.9967H72.1245V12.1933C72.8865 11.2048 73.8044 10.8407 75.2418 10.9274V12.7136C73.2675 12.6095 72.1245 13.598 72.1245 15.4362V20.3613H70.5658Z\", \"M65.4408 20.5694C62.8083 20.5694 61.1977 18.4537 61.1977 15.679C61.1977 12.8696 62.8603 10.8406 65.3888 10.8406C67.8134 10.8406 69.4067 12.7309 69.4067 15.4015V16.0779H62.8083C62.9123 17.76 63.8994 19.0433 65.4408 19.0433C66.5319 19.0433 67.4497 18.4363 67.9866 17.2744L69.2682 17.9161C68.4889 19.7023 67.138 20.5694 65.4408 20.5694ZM62.8776 14.6212H67.7615C67.5883 13.2858 66.705 12.3494 65.3888 12.3494C64.0207 12.3494 63.1028 13.3379 62.8776 14.6212Z\", \"M59.2561 20.5693C57.5935 20.5693 56.918 19.9276 56.918 18.2975V12.5053H55.394V10.9966H56.918V8.37799H58.4767V10.9966H60.3298V12.5053H58.4767V18.072C58.4767 18.8524 58.8231 19.0085 59.3253 19.0085H60.4164V20.4999C60.07 20.5346 59.6371 20.5693 59.2561 20.5693Z\", \"M53.3658 20.5693C51.7033 20.5693 51.0278 19.9276 51.0278 18.2975V12.5053H49.5038V10.9966H51.0278V8.37799H52.5865V10.9966H54.4396V12.5053H52.5865V18.072C52.5865 18.8524 52.9329 19.0085 53.4351 19.0085H54.5262V20.4999C54.1798 20.5346 53.7469 20.5693 53.3658 20.5693Z\", \"M44.9815 20.5695C42.3491 20.5695 40.7384 18.4538 40.7384 15.6791C40.7384 12.8697 42.401 10.8408 44.9296 10.8408C47.3542 10.8408 48.9475 12.731 48.9475 15.4016V16.078H42.3491C42.453 17.7601 43.4402 19.0434 44.9815 19.0434C46.0726 19.0434 46.9905 18.4365 47.5274 17.2746L48.8089 17.9162C48.0296 19.7024 46.6787 20.5695 44.9815 20.5695ZM42.4184 14.6213H47.3022C47.129 13.286 46.2458 12.3495 44.9296 12.3495C43.5614 12.3495 42.6435 13.338 42.4184 14.6213Z\", \"M29.834 20.3613V7.32031H35.1162C37.6447 7.32031 39.0995 8.5169 39.0995 10.5806C39.0995 11.8639 38.5279 12.8697 37.4542 13.4593C38.8743 13.9449 39.6537 15.0894 39.6537 16.5808C39.6537 18.8353 37.8352 20.3613 35.1854 20.3613H29.834ZM31.3927 12.7483H34.6486C36.4151 12.7483 37.5581 11.9506 37.5581 10.6673C37.5581 9.52272 36.6229 8.86373 35.0469 8.86373H31.3927V12.7483ZM31.3927 18.8006H35.0642C36.9346 18.8006 38.0603 17.9682 38.043 16.5808C38.0603 15.1415 36.848 14.257 34.891 14.257H31.3927V18.8006Z\", \"M107.608 20.6788C104.835 20.6788 103.115 19.3074 102.697 16.7653L104.2 16.4643C104.501 18.2538 105.637 19.1736 107.524 19.1736C109.345 19.1736 110.614 18.3039 110.614 17.0663C110.614 15.9793 109.629 15.2267 107.224 14.5242C104.301 13.688 103.048 12.4504 103.048 10.7111C103.048 8.72086 104.685 7.48326 107.307 7.48326C109.862 7.48326 111.399 8.65396 111.917 10.895L110.364 11.2295C110.03 9.72433 109.027 8.97173 107.274 8.97173C105.637 8.97173 104.618 9.60726 104.618 10.6943C104.618 11.6978 105.47 12.3835 107.858 13.1194C110.998 14.0727 112.167 15.3103 112.167 17.0663C112.167 19.2572 110.38 20.6788 107.608 20.6788Z\", \"M89.8249 20.3612V7.78442H91.7289L95.871 18.2204L99.9463 7.78442H101.85V20.3612H100.347V10.6945L96.5725 20.3612H95.1695L91.328 10.6945V20.3612H89.8249Z\", \"M83.2802 20.6788C79.6558 20.6788 77.0837 18.0364 77.0837 14.24C77.0837 10.3766 79.8061 7.4833 83.4639 7.4833C85.9692 7.4833 87.9902 8.82125 88.9756 11.079L87.3889 11.4303C86.6206 9.90833 85.2009 9.02194 83.4305 9.02194C80.6579 9.02194 78.7038 11.1961 78.7038 14.1731C78.7038 17.0998 80.5911 19.1569 83.2635 19.1569C85.2343 19.1569 86.8043 18.0364 87.5392 16.1967L89.0424 16.5312C88.0737 19.1569 86.036 20.6788 83.2802 20.6788Z\"];\n/** boxicons:sparkle-circle-filled — path from public/brand/ai-sparkle-glyph.svg (viewBox 2 2 16 16). */\nexport const SPARKLE_PATH = \"M9.4668 2.37243C9.64848 1.87586 10.351 1.87586 10.5326 2.37243L11.0754 3.85459C11.501 5.01732 12.1751 6.07325 13.0506 6.94879C13.9262 7.82432 14.9821 8.4984 16.1448 8.92405L17.627 9.4668C18.1243 9.64848 18.1243 10.351 17.627 10.5326L16.1448 11.0754C14.9821 11.501 13.9262 12.1751 13.0506 13.0506C12.1751 13.9262 11.501 14.9821 11.0754 16.1448L10.5326 17.627C10.351 18.1243 9.64848 18.1243 9.4668 17.627L8.92405 16.1448C8.4984 14.9821 7.82432 13.9262 6.94879 13.0506C6.07325 12.1751 5.01732 11.501 3.85459 11.0754L2.37243 10.5326C1.87586 10.351 1.87586 9.64848 2.37243 9.4668L3.85459 8.92405C5.01732 8.4984 6.07325 7.82432 6.94879 6.94879C7.82432 6.07325 8.4984 5.01732 8.92405 3.85459L9.4668 2.37243Z\";\nexport const BRAND_STOPS = [\n { offset: 0.0817, color: \"#A878D2\" },\n { offset: 0.4808, color: \"#ED6262\" },\n { offset: 0.9231, color: \"#D13A3A\" },\n];\n\nfunction MarkGradient({ id }: { id: string }) {\n return (\n <linearGradient id={id} x1=\"8.81595\" y1=\"-2.84571\" x2=\"18.8801\" y2=\"29.1204\" gradientUnits=\"userSpaceOnUse\">\n {BRAND_STOPS.map((s) => <stop key={s.offset} offset={s.offset} stopColor={s.color} />)}\n </linearGradient>\n );\n}\n\n/** The mark alone (square). */\nexport function LogoMark({ size = 24, className }: { size?: number; className?: string }) {\n const id = React.useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"-1 0 26 28\" className={cn(\"shrink-0\", className)} aria-hidden>\n <defs><MarkGradient id={`bm${id}`} /></defs>\n {ICON.map((d) => <path key={d.slice(0, 12)} d={d} fill={`url(#bm${id})`} />)}\n </svg>\n );\n}\n\n/** Full lockup: mark + \"BetterCMS\" wordmark. Height-driven (default 24px → 106px wide). */\nexport function Logo({ className, compact, height = 24 }: { className?: string; compact?: boolean; height?: number }) {\n const id = React.useId().replace(/:/g, \"\");\n if (compact) return <LogoMark size={height} className={className} />;\n return (\n <svg height={height} width={(height * 113) / 28} viewBox=\"0 0 113 28\" className={cn(\"shrink-0 text-[var(--kit-wordmark,#291018)] [.dark_&]:text-[var(--kit-fg,#e1e1e4)]\", className)} role=\"img\" aria-label=\"BetterCMS\">\n <defs><MarkGradient id={`bl${id}`} /></defs>\n {ICON.map((d) => <path key={d.slice(0, 12)} d={d} fill={`url(#bl${id})`} />)}\n {WORD.map((d) => <path key={d.slice(0, 12)} d={d} fill=\"currentColor\" />)}\n </svg>\n );\n}\n"],"mappings":";;;;;AAOA,IAAM,OAAO;CAAC;CAAgT;CAAqK;AAAkK;AACroB,IAAM,OAAO;CAAC;CAAoK;CAAyc;CAAsQ;CAA4Q;CAAuc;CAAuf;CAA8mB;CAA0J;AAA4a;;AAE/vG,IAAa,eAAe;AAC5B,IAAa,cAAc;CACzB;EAAE,QAAQ;EAAQ,OAAO;CAAU;CACnC;EAAE,QAAQ;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AAS;EAAG,MAAK;EAAM,cAAW;EAA5M,UAAA;GACE,uBAAC,QAAD,EAAA,UAAM,uBAAC,cAAD,EAAc,IAAI,KAAK,KAAO,GAAA,KAAA,GAAA,OAAA;;;;GAAO,GAAA,IAAA,EAAA,GAAA,KAAA,GAAA,OAAA;;;;;GAC1C,KAAK,KAAK,MAAM,uBAAC,QAAD;IAA8B;IAAG,MAAM,UAAU,GAAG;GAAK,GAA9C,EAAE,MAAM,GAAG,EAAE,GAAA,OAAA;;;;GAAiC,GAAA,IAAA,CAAC;GAC1E,KAAK,KAAK,MAAM,uBAAC,QAAD;IAA8B;IAAG,MAAK;GAAgB,GAA3C,EAAE,MAAM,GAAG,EAAE,GAAA,OAAA;;;;GAA8B,GAAA,IAAA,CAAC;EACrE;;;;;;AAET"}
|
package/dist/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
3
3
|
//#region src/context.tsx
|
|
4
4
|
/**
|
|
5
5
|
* Kit runtime contexts (V2 HEAD 9829bf1 kit/context.tsx).
|
|
@@ -11,6 +11,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
11
11
|
* palette, permissions, presence, comments. Has safe defaults so a control can render alone.
|
|
12
12
|
* - FormApi — present only inside <SchemaForm>: value, writes, navigation, issues, baselines, history.
|
|
13
13
|
*/
|
|
14
|
+
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/context.tsx";
|
|
14
15
|
var AI_PRESETS = [
|
|
15
16
|
{
|
|
16
17
|
id: "improve",
|
|
@@ -88,10 +89,14 @@ function registerKitServices(s) {
|
|
|
88
89
|
}
|
|
89
90
|
var ServicesCtx = React.createContext(null);
|
|
90
91
|
function KitServicesProvider({ value, children }) {
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ jsxDEV(ServicesCtx.Provider, {
|
|
92
93
|
value,
|
|
93
94
|
children
|
|
94
|
-
}
|
|
95
|
+
}, void 0, false, {
|
|
96
|
+
fileName: _jsxFileName,
|
|
97
|
+
lineNumber: 217,
|
|
98
|
+
columnNumber: 10
|
|
99
|
+
}, this);
|
|
95
100
|
}
|
|
96
101
|
function useKitServices() {
|
|
97
102
|
const local = React.useContext(ServicesCtx);
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../src/context.tsx"],"sourcesContent":["/**\n * Kit runtime contexts (V2 HEAD 9829bf1 kit/context.tsx).\n *\n * - KitServices — pluggable app services (media library picker, upload sink, toast, AI rewrite, comment threads).\n * Hosts register theirs once (`registerKitServices`) or provide them (`KitServicesProvider`); the kit\n * never imports a feature. A service that is absent hides the surface that needs it.\n * - KitEnv — the editing environment a control renders in: variant (panel | document), doc identity, site\n * palette, permissions, presence, comments. Has safe defaults so a control can render alone.\n * - FormApi — present only inside <SchemaForm>: value, writes, navigation, issues, baselines, history.\n */\nimport * as React from \"react\";\nimport type { Cap } from \"./schema/sources\";\nimport type { FieldAccess, FieldPath, FieldSchema, Fieldset, TypeSchema } from \"./schema/types\";\nimport type { KitIssue } from \"./lib/validate\";\nimport type { ControlProps } from \"./types\";\nimport type { LinkTarget } from \"./controls/link\";\n\n/* ── Services ─────────────────────────────────────────────────────────── */\n/** The media asset a picker hands back (the host's media library row, narrowed to what the kit reads). */\nexport interface KitMediaAsset {\n id: string;\n url: string;\n name?: string;\n alt?: string;\n kind?: \"image\" | \"video\" | \"file\" | \"svg\";\n width?: number;\n height?: number;\n size?: number;\n}\nexport interface KitMediaPickerProps {\n open: boolean;\n onOpenChange: (v: boolean) => void;\n onPick: (assets: KitMediaAsset[]) => void;\n multiple?: boolean;\n accept?: (\"image\" | \"video\" | \"file\" | \"svg\")[];\n /** What the dialog is for, in the author's words (\"Replace icon\"). Absent: the host's own title. */\n title?: string;\n /** An icon's Remove, in the dialog's footer (its row has no room for one). Absent: no Remove. */\n onRemove?: () => void;\n /**\n * An icon's first tab: the icons already on this site, each with the value it is stored as. The field's own icon\n * leads, marked `current`: picking it closes the dialog with no write. Absent: no such tab.\n */\n icons?: KitSiteIcon[];\n onPickIcon?: (value: unknown) => void;\n}\n/** One icon already on the site (KitServices.useSiteIcons), as the picker's first tab draws it. */\nexport interface KitSiteIcon {\n url: string;\n value: unknown;\n assetId?: string;\n current?: boolean;\n}\nexport interface KitToastOptions {\n /** the second line under the message (V2 sonner `description`) */\n description?: string;\n action?: { label: string; onClick: () => void };\n duration?: number;\n icon?: React.ReactNode;\n}\n/** The host's toaster. The kit has no toast dependency (V2 re-exported sonner's). */\nexport interface KitToast {\n (message: string, opts?: KitToastOptions): void;\n success: (message: string, opts?: KitToastOptions) => void;\n}\n/** Rewrite with AI presets (V2 lib/ai.ts). The host's `aiRewrite` service produces the text. */\nexport type AiPreset = \"improve\" | \"shorter\" | \"longer\" | \"simplify\" | \"grammar\" | \"translate\";\nexport const AI_PRESETS: { id: AiPreset; label: string }[] = [\n { id: \"improve\", label: \"Improve\" },\n { id: \"shorter\", label: \"Shorter\" },\n { id: \"longer\", label: \"Longer\" },\n { id: \"simplify\", label: \"Simplify\" },\n { id: \"grammar\", label: \"Fix spelling & grammar\" },\n { id: \"translate\", label: \"Translate to Spanish\" },\n];\n/** The in-place field comments popover (V2 FieldThreads over the comments store), drawn by the host. */\nexport interface KitFieldCommentsProps {\n docId: string;\n /** pathKey of the field (\"items.1.answer\") */\n fieldKey: string;\n label: string;\n /** the field's text, first 80 characters */\n quote?: string;\n onClose: () => void;\n /** \"Open in panel\": set when the host has a comments panel (`env.onComment`) */\n onOpenPanel?: () => void;\n}\n/** One field's ⋯ menu, as the host's extra items see it (KitServices.FieldMenuExtras). */\nexport interface KitFieldMenuExtrasProps {\n field: FieldSchema;\n path: FieldPath;\n /** the field is read-only for the lens: a host offers nothing that edits */\n readOnly: boolean;\n}\n/* The popover around FieldComments keeps itself open on Escape while focus is on an element marked `data-esc-owner`\n (V2 guardEscape): the composer marks its input so Escape clears or blurs the draft instead of losing it. */\nexport interface KitServices {\n /** The media library picker. */\n MediaPicker?: React.ComponentType<KitMediaPickerProps>;\n /** Called after an upload so the host can file the assets into its media library. */\n onUploaded?: (assets: KitMediaAsset[]) => void;\n /**\n * Image placements keep their edits BESIDE the url (`${name}Alt` · `${name}Focal` · `${name}Crop` ·\n * `${name}Decorative`) instead of turning the value into an object — the Visuals block model.\n */\n imageSiblings?: boolean;\n /** Real metadata for an image url (the host's media library), so captions never show placeholders. */\n resolveImage?: (url: string) => { name?: string; width?: number; height?: number; size?: number } | undefined;\n /** The host's full image editor (crop, rotate, focal, alt…), opened in place. */\n editImage?: (req: { docId: string; path: FieldPath; title: string }) => void;\n /** The project's forms for `reference: { to: [\"form\"] }` (the host's Forms store). */\n forms?: () => { id: string; title: string; subtitle: string }[];\n /** Toasts for Copy / Paste / Reset / AI (each with Undo). Absent → the action still runs, silently. */\n toast?: KitToast;\n /**\n * A slug's \"Save new address\" with \"Redirect it to the new address\" ticked (V2 SlugControl): the host files the\n * redirect from the old slug to the new one. Absent → no checkbox is offered, and the toast says the old address\n * will return \"Not found\", which is what happens. A rejection is named in a toast (the new slug is already saved).\n */\n redirectSlug?: (from: string, to: string) => void | Promise<void>;\n /**\n * A slug's \"Save new address\": the host writes the new address before any redirect is filed. Absent → the form's\n * value is the save (V2). A rejection is named in a toast and the old-address box stays for another try.\n */\n saveSlug?: (to: string) => Promise<void>;\n /** Rewrite with AI. Absent → the ⋯ menu offers no rewrite. `attempt` counts \"Try again\" presses. */\n aiRewrite?: (text: string, preset: AiPreset, attempt: number) => string | Promise<string>;\n /** In-place field comments. Absent and no `env.onComment` → the field shows no add-comment control. */\n FieldComments?: React.ComponentType<KitFieldCommentsProps>;\n /**\n * A React hook: open (unresolved) threads on one field, read from the same store FieldComments draws (V2 counted\n * `useBlockThreads(docId, key)`). Used while the host has no `env.onComment`; absent → SchemaForm `comments` counts.\n */\n useFieldCommentCount?: (docId: string, fieldKey: string) => number;\n /**\n * The host's own control for a type (a FieldRenderer arm in the dashboard), drawn for a stored value a kit control\n * hands off because it cannot carry it unchanged (rich text, LegacyFallback). Bare inside the kit FieldShell, which\n * owns the label row and the help; the box is tagged `data-kit-legacy`. Absent → the field says why in words.\n */\n LegacyControl?: React.ComponentType<ControlProps>;\n /**\n * The host's own items for a field's ⋯ menu (the entry editor's Move up · Move down · Move to panel), drawn after\n * History and before Rewrite with AI. It renders kit `MenuItem`s, with its own leading `MenuSeparator`, or null.\n * Absent → the menu is exactly V2's.\n */\n FieldMenuExtras?: React.ComponentType<KitFieldMenuExtrasProps>;\n /**\n * A React HOOK: the project's pages and CMS items a link can point at (controls/link.tsx). The host passes the same\n * function for the life of the form (it is called on every render of a link control). Absent → the link picker says\n * page search isn't available and takes a typed path. `error` is a whole sentence naming what failed (\"Pages couldn't\n * be loaded: …\", \"Items from Blog couldn't be loaded: …\"); the picker shows it under whatever did load.\n */\n useLinkTargets?: () => { targets: LinkTarget[]; loading?: boolean; error?: string };\n /**\n * A React HOOK: every SVG the site already uses (its pages, header and footer, the library's SVGs), for an icon's\n * picker. The host passes the same function for the life of the form. Absent → the picker has no site tab.\n */\n useSiteIcons?: () => KitSiteIcon[];\n /**\n * The entries a rich text's related posts or author bio block shows (kit-richtext-blocks-plan.md RT8). `ids`: the\n * hand-picked entries (an author bio's one author, related posts in hand-picked mode), answered in that order with\n * any the host cannot find left out. `query`: related posts chosen for the reader (owner 2026-10-24: `topic` = same\n * tags or category, `newest` = the collection newest first; `count` of them, `excludeId` the entry being edited).\n * Absent → the blocks show their empty state; a rejection's message is shown as said.\n */\n resolveRichTextRefs?: (req: KitRichTextRefRequest) => Promise<KitRichTextRef[]>;\n}\n\n/** What a related posts or author bio block asks the host for (KitServices.resolveRichTextRefs). */\nexport interface KitRichTextRefRequest {\n kind: \"relatedPosts\" | \"authorBio\";\n ids?: string[];\n query?: { collection?: string; mode: \"topic\" | \"newest\"; count: number; excludeId?: string };\n}\n/** One resolved entry, as the block draws it: a post card (title, cover, category) or an author (avatar, title as name, bio). */\nexport interface KitRichTextRef {\n id: string;\n title: string;\n href?: string;\n cover?: string;\n category?: string;\n avatar?: string;\n bio?: string;\n}\n\n/**\n * A React HOOK over KitServices.resolveRichTextRefs: `unavailable` when the host offers no resolver (draw the empty\n * state), else `loading`, then `items` or `error` (a sentence). `req` null asks nothing (a block with nothing picked).\n */\nexport function useRichTextRefs(req: KitRichTextRefRequest | null): { items: KitRichTextRef[]; loading: boolean; error?: string; unavailable: boolean } {\n const { resolveRichTextRefs } = useKitServices();\n const key = req ? JSON.stringify(req) : \"\";\n const [state, setState] = React.useState<{ key: string; items: KitRichTextRef[]; error?: string } | null>(null);\n React.useEffect(() => {\n if (!resolveRichTextRefs || !key) return;\n let live = true;\n resolveRichTextRefs(JSON.parse(key) as KitRichTextRefRequest).then(\n (items) => live && setState({ key, items }),\n (e: unknown) => live && setState({ key, items: [], error: e instanceof Error ? e.message : String(e) }),\n );\n return () => void (live = false);\n }, [resolveRichTextRefs, key]);\n if (!resolveRichTextRefs) return { items: [], loading: false, unavailable: true };\n if (!key) return { items: [], loading: false, unavailable: false };\n const done = state?.key === key ? state : null;\n return { items: done?.items ?? [], loading: !done, error: done?.error, unavailable: false };\n}\nlet registry: KitServices = {};\nconst listeners = new Set<() => void>();\n/** Register app services once at module load (e.g. the Content feature registers its media library). */\nexport function registerKitServices(s: KitServices) {\n registry = { ...registry, ...s };\n listeners.forEach((l) => l());\n}\nconst ServicesCtx = React.createContext<KitServices | null>(null);\nexport function KitServicesProvider({ value, children }: { value: KitServices; children: React.ReactNode }) {\n return <ServicesCtx.Provider value={value}>{children}</ServicesCtx.Provider>;\n}\nexport function useKitServices(): KitServices {\n const local = React.useContext(ServicesCtx);\n const global = React.useSyncExternalStore(\n (cb) => {\n listeners.add(cb);\n return () => listeners.delete(cb);\n },\n () => registry,\n () => registry,\n );\n return local ? { ...global, ...local } : global;\n}\n\n/** A host header element a top-level field (by path key) renders its actions into, instead of a label row. */\nexport const FieldHeaderSlot = React.createContext<{ key: string; el: HTMLElement } | null>(null);\n\n/* ── Environment ──────────────────────────────────────────────────────── */\nexport type KitVariant = \"panel\" | \"document\";\nexport interface KitPeer {\n id?: string;\n name: string;\n avatar?: string;\n /** presence colour (avatar ring, field border, caret flag) */\n color?: string;\n /** \"editing\" (soft lock + border) or \"viewing\" */\n status?: \"editing\" | \"viewing\";\n}\nexport interface Swatch {\n name: string;\n value: string;\n token?: string;\n}\n\n/** V2's demo site palette (Caldera). Hosts pass the project's brand palette through `env.palette`. */\nexport const SITE_PALETTE: Swatch[] = [\n { name: \"Ember\", value: \"#E0663B\", token: \"brand.ember\" },\n { name: \"Ochre\", value: \"#D97706\", token: \"brand.ochre\" },\n { name: \"Moss\", value: \"#4F6B4A\", token: \"brand.moss\" },\n { name: \"Lake\", value: \"#2563EB\", token: \"accent.lake\" },\n { name: \"Dusk\", value: \"#7C3AED\", token: \"accent.dusk\" },\n { name: \"Berry\", value: \"#DB2777\", token: \"accent.berry\" },\n { name: \"Char\", value: \"#1E1B18\", token: \"neutral.900\" },\n { name: \"Slate\", value: \"#4B5563\", token: \"neutral.600\" },\n { name: \"Bone\", value: \"#E7E0D6\", token: \"neutral.200\" },\n { name: \"Paper\", value: \"#F6F1EA\", token: \"neutral.50\" },\n];\n\nexport interface KitEnv {\n variant: KitVariant;\n /** Identity of the document/block being edited (rich-text sync, comments, history). */\n docId: string;\n /** The document's title — slug generation. */\n docTitle?: string;\n /** Public URL prefix for slug previews, e.g. \"caldera.bettercms.site/journal/\". */\n urlPrefix?: string;\n /** The document has been published (slug changes warn about the old address). */\n isPublished?: boolean;\n /**\n * The form's slug is the document's ADDRESS (a page's or an entry's URL). Only then does a changed slug on a published\n * document say the old address will stop working and offer the redirect. A slug prop or a key is not an address, so\n * it gets no such box (V2 draws it on document hosts only: its component-prop forms pass no published state).\n */\n slugIsAddress?: boolean;\n palette: Swatch[];\n /** The whole form is read-only for the lens (the host's content.edit rule, a generated twin…). */\n readOnly: boolean;\n /**\n * D58: the host's access check for the lens (`useCan` at the host). The kit never imports the store; it asks this for\n * field-level `access` and for developer surfaces (field keys, IDs, API names: `schema.view` or `api.view`).\n * Hosts that omit it (staff tools, demos) get allow-all.\n */\n can: (cap: Cap) => boolean;\n /** pathKey → teammates in that field */\n presence: Record<string, KitPeer[]>;\n /** pathKey → open comment threads */\n comments: Record<string, number>;\n /** Host comment panel. When absent, field comments live in the in-place popover only. */\n /** `quote`: the words selected in a rich text field when the comment came from its toolbar */\n onComment?: (path: FieldPath, field: FieldSchema, quote?: string) => void;\n /** The whole form is a global block (\"Navigation\") — every field is synced. */\n syncedFrom?: string;\n /** \"Open {title}\" on a reference card: the host edits the referenced entry in place (stacked panel). */\n onOpenReference?: (ref: { collectionId: string; entryId: string; title: string }) => void;\n /** CPO D39: \"inline\" (default) shows help under the label; \"tooltip\" moves it behind the ⓘ — for dense hosts (grid cells, popovers). */\n helpDisplay?: \"inline\" | \"tooltip\";\n /** D61 Review changes: the host's change markers, present only while its History panel is open. */\n review?: KitReview;\n /** D61 field ⋯ › History: the host opens its one History panel on this field. Absent = no History item. */\n onFieldHistory?: (path: FieldPath, field: FieldSchema) => void;\n /**\n * \"quiet\": a meta-form, like the schema editor's field settings (founder call, 2026-10-05). No comment, ⋯ or per-field\n * undo on the fields, and an on/off field is a label-left row with its switch on the right (the inspector's PRow), not a\n * switch card. \"preview\": the same chrome-free fields, controls exactly as editors see them (a schema preview, where a\n * comment would land on a sample, never a real document). Default \"full\".\n */\n fieldChrome?: \"full\" | \"preview\" | \"quiet\";\n /**\n * A host's own control for one field, by its path key (\"type\", \"options\"), drawn inside the usual shell. The schema\n * editor's field settings plug their Type, Options, Key and Show this field controls in here. Absent = kit controls only.\n */\n controls?: Record<string, React.ComponentType<ControlProps>>;\n /**\n * A collapsed fieldset's summary as chips, from the host (the schema editor's field settings: \"Required\", \"3 options\").\n * `undefined` falls back to the kit's own one-line summary. Keep it stable (a new function re-renders the form).\n */\n sectionSummary?: (set: Fieldset, value: Record<string, unknown>) => string[] | undefined;\n}\n\n/**\n * D61 Review changes, as the kit sees it. The host owns the history model; the kit only asks, per field path, whether\n * it changed in the range, and renders the host's marker (a 2px bar in the author's colour at the field's left edge,\n * with its hover card) where the at-rest \"changed\" dot would be.\n */\nexport interface KitReview {\n /** changes at or inside this field in the range (0 = unchanged) */\n count: (path: FieldPath) => number;\n /** the presence colour of whoever changed it last (list rows draw their own bar) */\n color: (path: FieldPath) => string | undefined;\n /** the host's change bar and hover card for a changed field (null when unchanged) */\n bar: (path: FieldPath, field: FieldSchema) => React.ReactNode;\n /** Show only changes: unchanged fields fold into one quiet line each run */\n onlyChanges: boolean;\n}\n\n/** The title of the fieldset a field sits in (null outside one). A quiet meta-form drops a field label that only repeats\n * its section's title (\"Options\" › \"Options\"): the section heading names it. */\nexport const KitSectionTitle = React.createContext<string | null>(null);\n/**\n * D66: the host's address row under a slug field (production URL, who serves it, the preview, live state). The host\n * knows the site's hosting; the kit only asks it to render the row for the slug being typed. Absent = the kit's own row.\n */\nexport const KitAddressContext = React.createContext<((slug: string) => React.ReactNode) | null>(null);\nexport const DEFAULT_ENV: KitEnv = {\n variant: \"panel\",\n docId: \"kit\",\n palette: [],\n readOnly: false,\n can: () => true,\n presence: {},\n comments: {},\n};\nconst EnvCtx = React.createContext<KitEnv>(DEFAULT_ENV);\n\n/** D58 field access: fields in the `seo` group default to `{ edit: \"seo.edit\" }`. */\nexport const fieldAccessOf = (field: FieldSchema): FieldAccess | undefined => field.access ?? (field.group === \"seo\" ? { edit: \"seo.edit\" } : undefined);\n\n/**\n * One field for the lens: hidden (no `view`), read-only (plain text: no `edit`, the field is `readOnly`, or the whole form\n * is read-only and the field has no edit cap of its own), or editable. An explicit `edit` cap wins over the form's\n * read-only rule, so an SEO specialist edits SEO fields inside a form they can't otherwise change.\n */\nexport function resolveFieldAccess(field: FieldSchema, env: Pick<KitEnv, \"can\" | \"readOnly\">): { hidden: boolean; readOnly: boolean } {\n const a = fieldAccessOf(field);\n if (a?.view && !env.can(a.view)) return { hidden: true, readOnly: true };\n if (field.readOnly === true) return { hidden: false, readOnly: true };\n if (a?.edit) return { hidden: false, readOnly: !env.can(a.edit) };\n return { hidden: false, readOnly: env.readOnly };\n}\n/** Drop the fields the lens can't `view` (recursively), so they are neither rendered nor validated. Same object back when\n * nothing is hidden. Values of dropped fields stay in the document untouched. */\nexport function visibleFields(fields: FieldSchema[], can: KitEnv[\"can\"]): FieldSchema[] {\n let changed = false;\n const out: FieldSchema[] = [];\n for (const f of fields) {\n const a = fieldAccessOf(f);\n if (a?.view && !can(a.view)) {\n changed = true;\n continue;\n }\n let g = f;\n if (f.fields) {\n const n = visibleFields(f.fields, can);\n if (n !== f.fields) g = { ...g, fields: n };\n }\n if (Array.isArray(f.of)) {\n const n = visibleFields(f.of, can);\n if (n !== f.of) g = { ...g, of: n };\n }\n if (f.slotSettings) {\n const n = visibleFields(f.slotSettings, can);\n if (n !== f.slotSettings) g = { ...g, slotSettings: n };\n }\n if (g !== f) changed = true;\n out.push(g);\n }\n return changed ? out : fields;\n}\nexport function visibleSchema(schema: TypeSchema, can: KitEnv[\"can\"]): TypeSchema {\n const fields = visibleFields(schema.fields, can);\n return fields === schema.fields ? schema : { ...schema, fields };\n}\n\n/** Developer surfaces (field keys, API names, IDs): `schema.view` or `api.view`. */\nexport const seesDevSurfaces = (env: Pick<KitEnv, \"can\">) => env.can(\"schema.view\") || env.can(\"api.view\");\nexport const KitEnvProvider = EnvCtx.Provider;\nexport const useKitEnv = () => React.useContext(EnvCtx);\n\n/* ── Form runtime (inside <SchemaForm>) ──────────────────────────────── */\nexport interface HistoryEntry {\n value: unknown;\n at: number;\n by: string;\n label?: string;\n}\nexport interface FormApi {\n schema: TypeSchema;\n value: Record<string, unknown>;\n /** write a value; `record: false` skips the field undo/history stack (e.g. programmatic sync) */\n setAt: (path: FieldPath, v: unknown, opts?: { record?: boolean; label?: string }) => void;\n getAt: (path: FieldPath) => unknown;\n /** value when the form mounted (field undo baseline) */\n baselineAt: (path: FieldPath) => unknown;\n /** published value (changed dot, Reset to published); undefined when never published */\n publishedAt: (path: FieldPath) => unknown;\n hasPublished: boolean;\n /** component instances (CPO D28): top-level fields inherit from a component unless overridden */\n inherited?: { from: string; isOverridden: (key: string) => boolean; reset: (key: string) => void };\n /** the current navigation path (drill-in stack) */\n path: FieldPath;\n navigate: (path: FieldPath) => void;\n /** the form draws frames for a non-root path. False while SchemaForm renders only the root frame: History and\n * drill-in rows hide or go inert instead of navigating to a path nothing shows (no silent no-op). */\n canNavigate: boolean;\n resolveSchema?: (blockType: string) => TypeSchema | undefined;\n /** blocks offered by \"+ Add block\" in slots (filtered by each slot's allow list) */\n blockLibrary?: TypeSchema[];\n /** all issues by pathKey */\n issues: Map<string, KitIssue>;\n /** the issue shown for a key (rules on blur, required after blur or a publish attempt) */\n visibleIssue: (key: string) => KitIssue | undefined;\n /** visible issues under a path prefix (rollup dots on rows, crumbs and tabs) */\n rollup: (prefix: FieldPath) => { errors: number; warnings: number };\n touch: (key: string) => void;\n showAllErrors: boolean;\n /** per-field undo (Undo last change to {label}) */\n canUndo: (key: string) => boolean;\n undo: (key: string) => void;\n /** versions of a field this session (newest first) */\n history: (key: string) => HistoryEntry[];\n /** the last change to this field came from AI (⋯ shows \"Undo AI change\") */\n aiKeys: Set<string>;\n markAi: (key: string, on: boolean) => void;\n /** remembered UI state per frame (selected group tab, open fieldsets) */\n memory: Map<string, unknown>;\n}\nconst FormCtx = React.createContext<FormApi | null>(null);\nexport const FormProvider = FormCtx.Provider;\nexport const useForm = () => React.useContext(FormCtx);\n"],"mappings":";;;;;;;;;;;;;AAmEA,IAAa,aAAgD;CAC3D;EAAE,IAAI;EAAW,OAAO;CAAU;CAClC;EAAE,IAAI;EAAW,OAAO;CAAU;CAClC;EAAE,IAAI;EAAU,OAAO;CAAS;CAChC;EAAE,IAAI;EAAY,OAAO;CAAW;CACpC;EAAE,IAAI;EAAW,OAAO;CAAyB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,IAAa,iBAAiB,OAAO;AACrC,IAAa,kBAAkB,MAAM,WAAW,MAAM;AAkDtD,IAAM,UAAU,MAAM,cAA8B,IAAI;AACxD,IAAa,eAAe,QAAQ;AACpC,IAAa,gBAAgB,MAAM,WAAW,OAAO"}
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../src/context.tsx"],"sourcesContent":["/**\n * Kit runtime contexts (V2 HEAD 9829bf1 kit/context.tsx).\n *\n * - KitServices — pluggable app services (media library picker, upload sink, toast, AI rewrite, comment threads).\n * Hosts register theirs once (`registerKitServices`) or provide them (`KitServicesProvider`); the kit\n * never imports a feature. A service that is absent hides the surface that needs it.\n * - KitEnv — the editing environment a control renders in: variant (panel | document), doc identity, site\n * palette, permissions, presence, comments. Has safe defaults so a control can render alone.\n * - FormApi — present only inside <SchemaForm>: value, writes, navigation, issues, baselines, history.\n */\nimport * as React from \"react\";\nimport type { Cap } from \"./schema/sources\";\nimport type { FieldAccess, FieldPath, FieldSchema, Fieldset, TypeSchema } from \"./schema/types\";\nimport type { KitIssue } from \"./lib/validate\";\nimport type { ControlProps } from \"./types\";\nimport type { LinkTarget } from \"./controls/link\";\n\n/* ── Services ─────────────────────────────────────────────────────────── */\n/** The media asset a picker hands back (the host's media library row, narrowed to what the kit reads). */\nexport interface KitMediaAsset {\n id: string;\n url: string;\n name?: string;\n alt?: string;\n kind?: \"image\" | \"video\" | \"file\" | \"svg\";\n width?: number;\n height?: number;\n size?: number;\n}\nexport interface KitMediaPickerProps {\n open: boolean;\n onOpenChange: (v: boolean) => void;\n onPick: (assets: KitMediaAsset[]) => void;\n multiple?: boolean;\n accept?: (\"image\" | \"video\" | \"file\" | \"svg\")[];\n /** What the dialog is for, in the author's words (\"Replace icon\"). Absent: the host's own title. */\n title?: string;\n /** An icon's Remove, in the dialog's footer (its row has no room for one). Absent: no Remove. */\n onRemove?: () => void;\n /**\n * An icon's first tab: the icons already on this site, each with the value it is stored as. The field's own icon\n * leads, marked `current`: picking it closes the dialog with no write. Absent: no such tab.\n */\n icons?: KitSiteIcon[];\n onPickIcon?: (value: unknown) => void;\n}\n/** One icon already on the site (KitServices.useSiteIcons), as the picker's first tab draws it. */\nexport interface KitSiteIcon {\n url: string;\n value: unknown;\n assetId?: string;\n current?: boolean;\n}\nexport interface KitToastOptions {\n /** the second line under the message (V2 sonner `description`) */\n description?: string;\n action?: { label: string; onClick: () => void };\n duration?: number;\n icon?: React.ReactNode;\n}\n/** The host's toaster. The kit has no toast dependency (V2 re-exported sonner's). */\nexport interface KitToast {\n (message: string, opts?: KitToastOptions): void;\n success: (message: string, opts?: KitToastOptions) => void;\n}\n/** Rewrite with AI presets (V2 lib/ai.ts). The host's `aiRewrite` service produces the text. */\nexport type AiPreset = \"improve\" | \"shorter\" | \"longer\" | \"simplify\" | \"grammar\" | \"translate\";\nexport const AI_PRESETS: { id: AiPreset; label: string }[] = [\n { id: \"improve\", label: \"Improve\" },\n { id: \"shorter\", label: \"Shorter\" },\n { id: \"longer\", label: \"Longer\" },\n { id: \"simplify\", label: \"Simplify\" },\n { id: \"grammar\", label: \"Fix spelling & grammar\" },\n { id: \"translate\", label: \"Translate to Spanish\" },\n];\n/** The in-place field comments popover (V2 FieldThreads over the comments store), drawn by the host. */\nexport interface KitFieldCommentsProps {\n docId: string;\n /** pathKey of the field (\"items.1.answer\") */\n fieldKey: string;\n label: string;\n /** the field's text, first 80 characters */\n quote?: string;\n onClose: () => void;\n /** \"Open in panel\": set when the host has a comments panel (`env.onComment`) */\n onOpenPanel?: () => void;\n}\n/** One field's ⋯ menu, as the host's extra items see it (KitServices.FieldMenuExtras). */\nexport interface KitFieldMenuExtrasProps {\n field: FieldSchema;\n path: FieldPath;\n /** the field is read-only for the lens: a host offers nothing that edits */\n readOnly: boolean;\n}\n/* The popover around FieldComments keeps itself open on Escape while focus is on an element marked `data-esc-owner`\n (V2 guardEscape): the composer marks its input so Escape clears or blurs the draft instead of losing it. */\nexport interface KitServices {\n /** The media library picker. */\n MediaPicker?: React.ComponentType<KitMediaPickerProps>;\n /** Called after an upload so the host can file the assets into its media library. */\n onUploaded?: (assets: KitMediaAsset[]) => void;\n /**\n * Image placements keep their edits BESIDE the url (`${name}Alt` · `${name}Focal` · `${name}Crop` ·\n * `${name}Decorative`) instead of turning the value into an object — the Visuals block model.\n */\n imageSiblings?: boolean;\n /** Real metadata for an image url (the host's media library), so captions never show placeholders. */\n resolveImage?: (url: string) => { name?: string; width?: number; height?: number; size?: number } | undefined;\n /** The host's full image editor (crop, rotate, focal, alt…), opened in place. */\n editImage?: (req: { docId: string; path: FieldPath; title: string }) => void;\n /** The project's forms for `reference: { to: [\"form\"] }` (the host's Forms store). */\n forms?: () => { id: string; title: string; subtitle: string }[];\n /** Toasts for Copy / Paste / Reset / AI (each with Undo). Absent → the action still runs, silently. */\n toast?: KitToast;\n /**\n * A slug's \"Save new address\" with \"Redirect it to the new address\" ticked (V2 SlugControl): the host files the\n * redirect from the old slug to the new one. Absent → no checkbox is offered, and the toast says the old address\n * will return \"Not found\", which is what happens. A rejection is named in a toast (the new slug is already saved).\n */\n redirectSlug?: (from: string, to: string) => void | Promise<void>;\n /**\n * A slug's \"Save new address\": the host writes the new address before any redirect is filed. Absent → the form's\n * value is the save (V2). A rejection is named in a toast and the old-address box stays for another try.\n */\n saveSlug?: (to: string) => Promise<void>;\n /** Rewrite with AI. Absent → the ⋯ menu offers no rewrite. `attempt` counts \"Try again\" presses. */\n aiRewrite?: (text: string, preset: AiPreset, attempt: number) => string | Promise<string>;\n /** In-place field comments. Absent and no `env.onComment` → the field shows no add-comment control. */\n FieldComments?: React.ComponentType<KitFieldCommentsProps>;\n /**\n * A React hook: open (unresolved) threads on one field, read from the same store FieldComments draws (V2 counted\n * `useBlockThreads(docId, key)`). Used while the host has no `env.onComment`; absent → SchemaForm `comments` counts.\n */\n useFieldCommentCount?: (docId: string, fieldKey: string) => number;\n /**\n * The host's own control for a type (a FieldRenderer arm in the dashboard), drawn for a stored value a kit control\n * hands off because it cannot carry it unchanged (rich text, LegacyFallback). Bare inside the kit FieldShell, which\n * owns the label row and the help; the box is tagged `data-kit-legacy`. Absent → the field says why in words.\n */\n LegacyControl?: React.ComponentType<ControlProps>;\n /**\n * The host's own items for a field's ⋯ menu (the entry editor's Move up · Move down · Move to panel), drawn after\n * History and before Rewrite with AI. It renders kit `MenuItem`s, with its own leading `MenuSeparator`, or null.\n * Absent → the menu is exactly V2's.\n */\n FieldMenuExtras?: React.ComponentType<KitFieldMenuExtrasProps>;\n /**\n * A React HOOK: the project's pages and CMS items a link can point at (controls/link.tsx). The host passes the same\n * function for the life of the form (it is called on every render of a link control). Absent → the link picker says\n * page search isn't available and takes a typed path. `error` is a whole sentence naming what failed (\"Pages couldn't\n * be loaded: …\", \"Items from Blog couldn't be loaded: …\"); the picker shows it under whatever did load.\n */\n useLinkTargets?: () => { targets: LinkTarget[]; loading?: boolean; error?: string };\n /**\n * A React HOOK: every SVG the site already uses (its pages, header and footer, the library's SVGs), for an icon's\n * picker. The host passes the same function for the life of the form. Absent → the picker has no site tab.\n */\n useSiteIcons?: () => KitSiteIcon[];\n /**\n * The entries a rich text's related posts or author bio block shows (kit-richtext-blocks-plan.md RT8). `ids`: the\n * hand-picked entries (an author bio's one author, related posts in hand-picked mode), answered in that order with\n * any the host cannot find left out. `query`: related posts chosen for the reader (owner 2026-10-24: `topic` = same\n * tags or category, `newest` = the collection newest first; `count` of them, `excludeId` the entry being edited).\n * Absent → the blocks show their empty state; a rejection's message is shown as said.\n */\n resolveRichTextRefs?: (req: KitRichTextRefRequest) => Promise<KitRichTextRef[]>;\n}\n\n/** What a related posts or author bio block asks the host for (KitServices.resolveRichTextRefs). */\nexport interface KitRichTextRefRequest {\n kind: \"relatedPosts\" | \"authorBio\";\n ids?: string[];\n query?: { collection?: string; mode: \"topic\" | \"newest\"; count: number; excludeId?: string };\n}\n/** One resolved entry, as the block draws it: a post card (title, cover, category) or an author (avatar, title as name, bio). */\nexport interface KitRichTextRef {\n id: string;\n title: string;\n href?: string;\n cover?: string;\n category?: string;\n avatar?: string;\n bio?: string;\n}\n\n/**\n * A React HOOK over KitServices.resolveRichTextRefs: `unavailable` when the host offers no resolver (draw the empty\n * state), else `loading`, then `items` or `error` (a sentence). `req` null asks nothing (a block with nothing picked).\n */\nexport function useRichTextRefs(req: KitRichTextRefRequest | null): { items: KitRichTextRef[]; loading: boolean; error?: string; unavailable: boolean } {\n const { resolveRichTextRefs } = useKitServices();\n const key = req ? JSON.stringify(req) : \"\";\n const [state, setState] = React.useState<{ key: string; items: KitRichTextRef[]; error?: string } | null>(null);\n React.useEffect(() => {\n if (!resolveRichTextRefs || !key) return;\n let live = true;\n resolveRichTextRefs(JSON.parse(key) as KitRichTextRefRequest).then(\n (items) => live && setState({ key, items }),\n (e: unknown) => live && setState({ key, items: [], error: e instanceof Error ? e.message : String(e) }),\n );\n return () => void (live = false);\n }, [resolveRichTextRefs, key]);\n if (!resolveRichTextRefs) return { items: [], loading: false, unavailable: true };\n if (!key) return { items: [], loading: false, unavailable: false };\n const done = state?.key === key ? state : null;\n return { items: done?.items ?? [], loading: !done, error: done?.error, unavailable: false };\n}\nlet registry: KitServices = {};\nconst listeners = new Set<() => void>();\n/** Register app services once at module load (e.g. the Content feature registers its media library). */\nexport function registerKitServices(s: KitServices) {\n registry = { ...registry, ...s };\n listeners.forEach((l) => l());\n}\nconst ServicesCtx = React.createContext<KitServices | null>(null);\nexport function KitServicesProvider({ value, children }: { value: KitServices; children: React.ReactNode }) {\n return <ServicesCtx.Provider value={value}>{children}</ServicesCtx.Provider>;\n}\nexport function useKitServices(): KitServices {\n const local = React.useContext(ServicesCtx);\n const global = React.useSyncExternalStore(\n (cb) => {\n listeners.add(cb);\n return () => listeners.delete(cb);\n },\n () => registry,\n () => registry,\n );\n return local ? { ...global, ...local } : global;\n}\n\n/** A host header element a top-level field (by path key) renders its actions into, instead of a label row. */\nexport const FieldHeaderSlot = React.createContext<{ key: string; el: HTMLElement } | null>(null);\n\n/* ── Environment ──────────────────────────────────────────────────────── */\nexport type KitVariant = \"panel\" | \"document\";\nexport interface KitPeer {\n id?: string;\n name: string;\n avatar?: string;\n /** presence colour (avatar ring, field border, caret flag) */\n color?: string;\n /** \"editing\" (soft lock + border) or \"viewing\" */\n status?: \"editing\" | \"viewing\";\n}\nexport interface Swatch {\n name: string;\n value: string;\n token?: string;\n}\n\n/** V2's demo site palette (Caldera). Hosts pass the project's brand palette through `env.palette`. */\nexport const SITE_PALETTE: Swatch[] = [\n { name: \"Ember\", value: \"#E0663B\", token: \"brand.ember\" },\n { name: \"Ochre\", value: \"#D97706\", token: \"brand.ochre\" },\n { name: \"Moss\", value: \"#4F6B4A\", token: \"brand.moss\" },\n { name: \"Lake\", value: \"#2563EB\", token: \"accent.lake\" },\n { name: \"Dusk\", value: \"#7C3AED\", token: \"accent.dusk\" },\n { name: \"Berry\", value: \"#DB2777\", token: \"accent.berry\" },\n { name: \"Char\", value: \"#1E1B18\", token: \"neutral.900\" },\n { name: \"Slate\", value: \"#4B5563\", token: \"neutral.600\" },\n { name: \"Bone\", value: \"#E7E0D6\", token: \"neutral.200\" },\n { name: \"Paper\", value: \"#F6F1EA\", token: \"neutral.50\" },\n];\n\nexport interface KitEnv {\n variant: KitVariant;\n /** Identity of the document/block being edited (rich-text sync, comments, history). */\n docId: string;\n /** The document's title — slug generation. */\n docTitle?: string;\n /** Public URL prefix for slug previews, e.g. \"caldera.bettercms.site/journal/\". */\n urlPrefix?: string;\n /** The document has been published (slug changes warn about the old address). */\n isPublished?: boolean;\n /**\n * The form's slug is the document's ADDRESS (a page's or an entry's URL). Only then does a changed slug on a published\n * document say the old address will stop working and offer the redirect. A slug prop or a key is not an address, so\n * it gets no such box (V2 draws it on document hosts only: its component-prop forms pass no published state).\n */\n slugIsAddress?: boolean;\n palette: Swatch[];\n /** The whole form is read-only for the lens (the host's content.edit rule, a generated twin…). */\n readOnly: boolean;\n /**\n * D58: the host's access check for the lens (`useCan` at the host). The kit never imports the store; it asks this for\n * field-level `access` and for developer surfaces (field keys, IDs, API names: `schema.view` or `api.view`).\n * Hosts that omit it (staff tools, demos) get allow-all.\n */\n can: (cap: Cap) => boolean;\n /** pathKey → teammates in that field */\n presence: Record<string, KitPeer[]>;\n /** pathKey → open comment threads */\n comments: Record<string, number>;\n /** Host comment panel. When absent, field comments live in the in-place popover only. */\n /** `quote`: the words selected in a rich text field when the comment came from its toolbar */\n onComment?: (path: FieldPath, field: FieldSchema, quote?: string) => void;\n /** The whole form is a global block (\"Navigation\") — every field is synced. */\n syncedFrom?: string;\n /** \"Open {title}\" on a reference card: the host edits the referenced entry in place (stacked panel). */\n onOpenReference?: (ref: { collectionId: string; entryId: string; title: string }) => void;\n /** CPO D39: \"inline\" (default) shows help under the label; \"tooltip\" moves it behind the ⓘ — for dense hosts (grid cells, popovers). */\n helpDisplay?: \"inline\" | \"tooltip\";\n /** D61 Review changes: the host's change markers, present only while its History panel is open. */\n review?: KitReview;\n /** D61 field ⋯ › History: the host opens its one History panel on this field. Absent = no History item. */\n onFieldHistory?: (path: FieldPath, field: FieldSchema) => void;\n /**\n * \"quiet\": a meta-form, like the schema editor's field settings (founder call, 2026-10-05). No comment, ⋯ or per-field\n * undo on the fields, and an on/off field is a label-left row with its switch on the right (the inspector's PRow), not a\n * switch card. \"preview\": the same chrome-free fields, controls exactly as editors see them (a schema preview, where a\n * comment would land on a sample, never a real document). Default \"full\".\n */\n fieldChrome?: \"full\" | \"preview\" | \"quiet\";\n /**\n * A host's own control for one field, by its path key (\"type\", \"options\"), drawn inside the usual shell. The schema\n * editor's field settings plug their Type, Options, Key and Show this field controls in here. Absent = kit controls only.\n */\n controls?: Record<string, React.ComponentType<ControlProps>>;\n /**\n * A collapsed fieldset's summary as chips, from the host (the schema editor's field settings: \"Required\", \"3 options\").\n * `undefined` falls back to the kit's own one-line summary. Keep it stable (a new function re-renders the form).\n */\n sectionSummary?: (set: Fieldset, value: Record<string, unknown>) => string[] | undefined;\n}\n\n/**\n * D61 Review changes, as the kit sees it. The host owns the history model; the kit only asks, per field path, whether\n * it changed in the range, and renders the host's marker (a 2px bar in the author's colour at the field's left edge,\n * with its hover card) where the at-rest \"changed\" dot would be.\n */\nexport interface KitReview {\n /** changes at or inside this field in the range (0 = unchanged) */\n count: (path: FieldPath) => number;\n /** the presence colour of whoever changed it last (list rows draw their own bar) */\n color: (path: FieldPath) => string | undefined;\n /** the host's change bar and hover card for a changed field (null when unchanged) */\n bar: (path: FieldPath, field: FieldSchema) => React.ReactNode;\n /** Show only changes: unchanged fields fold into one quiet line each run */\n onlyChanges: boolean;\n}\n\n/** The title of the fieldset a field sits in (null outside one). A quiet meta-form drops a field label that only repeats\n * its section's title (\"Options\" › \"Options\"): the section heading names it. */\nexport const KitSectionTitle = React.createContext<string | null>(null);\n/**\n * D66: the host's address row under a slug field (production URL, who serves it, the preview, live state). The host\n * knows the site's hosting; the kit only asks it to render the row for the slug being typed. Absent = the kit's own row.\n */\nexport const KitAddressContext = React.createContext<((slug: string) => React.ReactNode) | null>(null);\nexport const DEFAULT_ENV: KitEnv = {\n variant: \"panel\",\n docId: \"kit\",\n palette: [],\n readOnly: false,\n can: () => true,\n presence: {},\n comments: {},\n};\nconst EnvCtx = React.createContext<KitEnv>(DEFAULT_ENV);\n\n/** D58 field access: fields in the `seo` group default to `{ edit: \"seo.edit\" }`. */\nexport const fieldAccessOf = (field: FieldSchema): FieldAccess | undefined => field.access ?? (field.group === \"seo\" ? { edit: \"seo.edit\" } : undefined);\n\n/**\n * One field for the lens: hidden (no `view`), read-only (plain text: no `edit`, the field is `readOnly`, or the whole form\n * is read-only and the field has no edit cap of its own), or editable. An explicit `edit` cap wins over the form's\n * read-only rule, so an SEO specialist edits SEO fields inside a form they can't otherwise change.\n */\nexport function resolveFieldAccess(field: FieldSchema, env: Pick<KitEnv, \"can\" | \"readOnly\">): { hidden: boolean; readOnly: boolean } {\n const a = fieldAccessOf(field);\n if (a?.view && !env.can(a.view)) return { hidden: true, readOnly: true };\n if (field.readOnly === true) return { hidden: false, readOnly: true };\n if (a?.edit) return { hidden: false, readOnly: !env.can(a.edit) };\n return { hidden: false, readOnly: env.readOnly };\n}\n/** Drop the fields the lens can't `view` (recursively), so they are neither rendered nor validated. Same object back when\n * nothing is hidden. Values of dropped fields stay in the document untouched. */\nexport function visibleFields(fields: FieldSchema[], can: KitEnv[\"can\"]): FieldSchema[] {\n let changed = false;\n const out: FieldSchema[] = [];\n for (const f of fields) {\n const a = fieldAccessOf(f);\n if (a?.view && !can(a.view)) {\n changed = true;\n continue;\n }\n let g = f;\n if (f.fields) {\n const n = visibleFields(f.fields, can);\n if (n !== f.fields) g = { ...g, fields: n };\n }\n if (Array.isArray(f.of)) {\n const n = visibleFields(f.of, can);\n if (n !== f.of) g = { ...g, of: n };\n }\n if (f.slotSettings) {\n const n = visibleFields(f.slotSettings, can);\n if (n !== f.slotSettings) g = { ...g, slotSettings: n };\n }\n if (g !== f) changed = true;\n out.push(g);\n }\n return changed ? out : fields;\n}\nexport function visibleSchema(schema: TypeSchema, can: KitEnv[\"can\"]): TypeSchema {\n const fields = visibleFields(schema.fields, can);\n return fields === schema.fields ? schema : { ...schema, fields };\n}\n\n/** Developer surfaces (field keys, API names, IDs): `schema.view` or `api.view`. */\nexport const seesDevSurfaces = (env: Pick<KitEnv, \"can\">) => env.can(\"schema.view\") || env.can(\"api.view\");\nexport const KitEnvProvider = EnvCtx.Provider;\nexport const useKitEnv = () => React.useContext(EnvCtx);\n\n/* ── Form runtime (inside <SchemaForm>) ──────────────────────────────── */\nexport interface HistoryEntry {\n value: unknown;\n at: number;\n by: string;\n label?: string;\n}\nexport interface FormApi {\n schema: TypeSchema;\n value: Record<string, unknown>;\n /** write a value; `record: false` skips the field undo/history stack (e.g. programmatic sync) */\n setAt: (path: FieldPath, v: unknown, opts?: { record?: boolean; label?: string }) => void;\n getAt: (path: FieldPath) => unknown;\n /** value when the form mounted (field undo baseline) */\n baselineAt: (path: FieldPath) => unknown;\n /** published value (changed dot, Reset to published); undefined when never published */\n publishedAt: (path: FieldPath) => unknown;\n hasPublished: boolean;\n /** component instances (CPO D28): top-level fields inherit from a component unless overridden */\n inherited?: { from: string; isOverridden: (key: string) => boolean; reset: (key: string) => void };\n /** the current navigation path (drill-in stack) */\n path: FieldPath;\n navigate: (path: FieldPath) => void;\n /** the form draws frames for a non-root path. False while SchemaForm renders only the root frame: History and\n * drill-in rows hide or go inert instead of navigating to a path nothing shows (no silent no-op). */\n canNavigate: boolean;\n resolveSchema?: (blockType: string) => TypeSchema | undefined;\n /** blocks offered by \"+ Add block\" in slots (filtered by each slot's allow list) */\n blockLibrary?: TypeSchema[];\n /** all issues by pathKey */\n issues: Map<string, KitIssue>;\n /** the issue shown for a key (rules on blur, required after blur or a publish attempt) */\n visibleIssue: (key: string) => KitIssue | undefined;\n /** visible issues under a path prefix (rollup dots on rows, crumbs and tabs) */\n rollup: (prefix: FieldPath) => { errors: number; warnings: number };\n touch: (key: string) => void;\n showAllErrors: boolean;\n /** per-field undo (Undo last change to {label}) */\n canUndo: (key: string) => boolean;\n undo: (key: string) => void;\n /** versions of a field this session (newest first) */\n history: (key: string) => HistoryEntry[];\n /** the last change to this field came from AI (⋯ shows \"Undo AI change\") */\n aiKeys: Set<string>;\n markAi: (key: string, on: boolean) => void;\n /** remembered UI state per frame (selected group tab, open fieldsets) */\n memory: Map<string, unknown>;\n}\nconst FormCtx = React.createContext<FormApi | null>(null);\nexport const FormProvider = FormCtx.Provider;\nexport const useForm = () => React.useContext(FormCtx);\n"],"mappings":";;;;;;;;;;;;;;AAmEA,IAAa,aAAgD;CAC3D;EAAE,IAAI;EAAW,OAAO;CAAU;CAClC;EAAE,IAAI;EAAW,OAAO;CAAU;CAClC;EAAE,IAAI;EAAU,OAAO;CAAS;CAChC;EAAE,IAAI;EAAY,OAAO;CAAW;CACpC;EAAE,IAAI;EAAW,OAAO;CAAyB;CACjD;EAAE,IAAI;EAAa,OAAO;CAAuB;AACnD;;;;;AAmHA,SAAgB,gBAAgB,KAAwH;CACtJ,MA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