@avocadostudio-ai/cli 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +1 -1
- package/dist/index.js +276 -58
- package/editor-dist/assets/{Editor-EPSED64A-1h0xO9QI.js → Editor-EPSED64A-5GXOZwWs.js} +1 -1
- package/editor-dist/assets/PuckPrototypeRoute-CIpO3h9H.js +235 -0
- package/editor-dist/assets/{PuckPrototypeRoute-DtqTlafP.css → PuckPrototypeRoute-JfYCb1Z5.css} +1 -1
- package/editor-dist/assets/{Render-CU35UAWV-BC5ynnCM.js → Render-CU35UAWV-C1VtWmg6.js} +1 -1
- package/editor-dist/assets/{chunk-2CNEFIQP-Q9gAzMw1.js → chunk-2CNEFIQP-W9Nm3hTe.js} +1 -1
- package/editor-dist/assets/{full-N67EAB2Q-Dtb7CnaF.js → full-N67EAB2Q-5hqHUblQ.js} +1 -1
- package/editor-dist/assets/index-C0aP_ANq.css +1 -0
- package/editor-dist/assets/index-CM2p2yNB.js +699 -0
- package/editor-dist/assets/{index-oh4S_G9Y.js → index-Cqq_JD7D.js} +6 -6
- package/editor-dist/assets/{index-D4SeD5gd.js → index-DaRt8zrp.js} +1 -1
- package/editor-dist/assets/{loaded-F37CNCVG-Bav6-7kM.js → loaded-F37CNCVG-Cg4RQXYq.js} +1 -1
- package/editor-dist/assets/{loaded-H325ZSK5-DhwWhSPx.js → loaded-H325ZSK5-VDlQcHWH.js} +1 -1
- package/editor-dist/assets/{loaded-MIY725CK-C7ZoKWol.js → loaded-MIY725CK-DUPDdSS5.js} +1 -1
- package/editor-dist/index.html +2 -2
- package/package.json +11 -11
- package/editor-dist/assets/PuckPrototypeRoute-CrbybIsD.js +0 -231
- package/editor-dist/assets/index-BVru-J_w.js +0 -680
- package/editor-dist/assets/index-Wz7Aw5V1.css +0 -1
package/dist/index.js
CHANGED
|
@@ -15,6 +15,70 @@ import { fileURLToPath } from "node:url";
|
|
|
15
15
|
// ../shared/src/protocol.ts
|
|
16
16
|
var EDITOR_PROTOCOL_VERSION = "site-editor/v1";
|
|
17
17
|
|
|
18
|
+
// ../richtext/src/parse.ts
|
|
19
|
+
var INLINE_PATTERN = new RegExp(
|
|
20
|
+
[
|
|
21
|
+
// Code spans bind tightest, so they come first: nothing inside them is markup.
|
|
22
|
+
"(?<!\\\\)`(?<code>[^`]+?)`",
|
|
23
|
+
// Before the link alternative, so the `!` is consumed rather than left behind.
|
|
24
|
+
"!\\[(?<imageAlt>.*?)(?<!\\\\)\\]\\((?<imageSrc>.+?)(?<!\\\\)\\)",
|
|
25
|
+
"(?<!\\\\)\\*\\*(?<strong>.+?)(?<!\\\\)\\*\\*",
|
|
26
|
+
"(?<!\\\\)~~(?<strike>.+?)(?<!\\\\)~~",
|
|
27
|
+
"(?<!\\\\)\\*(?<em>.+?)(?<!\\\\)\\*",
|
|
28
|
+
"(?<!\\\\)\\[(?<linkText>.+?)(?<!\\\\)\\]\\((?<linkHref>.+?)(?<!\\\\)\\)"
|
|
29
|
+
].join("|"),
|
|
30
|
+
"g"
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
// ../richtext/src/doc.ts
|
|
34
|
+
var MARK = {
|
|
35
|
+
bold: "bold",
|
|
36
|
+
italic: "italic",
|
|
37
|
+
strike: "strike",
|
|
38
|
+
code: "code",
|
|
39
|
+
underline: "underline",
|
|
40
|
+
link: "link"
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// ../richtext/src/merge.ts
|
|
44
|
+
var MARKDOWN_MARKS = [MARK.bold, MARK.italic, MARK.strike, MARK.code, MARK.link];
|
|
45
|
+
|
|
46
|
+
// ../richtext/src/portable-text.ts
|
|
47
|
+
var DECORATOR_TO_MARK = {
|
|
48
|
+
strong: MARK.bold,
|
|
49
|
+
em: MARK.italic,
|
|
50
|
+
underline: MARK.underline,
|
|
51
|
+
"strike-through": MARK.strike,
|
|
52
|
+
code: MARK.code
|
|
53
|
+
};
|
|
54
|
+
var MARK_TO_DECORATOR = Object.fromEntries(
|
|
55
|
+
Object.entries(DECORATOR_TO_MARK).map(([decorator, mark]) => [mark, decorator])
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// ../richtext/src/contentful.ts
|
|
59
|
+
var CONTENTFUL_TO_MARK = {
|
|
60
|
+
bold: MARK.bold,
|
|
61
|
+
italic: MARK.italic,
|
|
62
|
+
underline: MARK.underline,
|
|
63
|
+
code: MARK.code,
|
|
64
|
+
strikethrough: MARK.strike
|
|
65
|
+
};
|
|
66
|
+
var MARK_TO_CONTENTFUL = Object.fromEntries(
|
|
67
|
+
Object.entries(CONTENTFUL_TO_MARK).map(([contentful, mark]) => [mark, contentful])
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// ../richtext/src/strapi.ts
|
|
71
|
+
var FLAG_TO_MARK = {
|
|
72
|
+
bold: MARK.bold,
|
|
73
|
+
italic: MARK.italic,
|
|
74
|
+
underline: MARK.underline,
|
|
75
|
+
strikethrough: MARK.strike,
|
|
76
|
+
code: MARK.code
|
|
77
|
+
};
|
|
78
|
+
var MARK_TO_FLAG = Object.fromEntries(
|
|
79
|
+
Object.entries(FLAG_TO_MARK).map(([flag, mark]) => [mark, flag])
|
|
80
|
+
);
|
|
81
|
+
|
|
18
82
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
19
83
|
var external_exports = {};
|
|
20
84
|
__export(external_exports, {
|
|
@@ -13783,33 +13847,6 @@ function date4(params) {
|
|
|
13783
13847
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
13784
13848
|
config(en_default());
|
|
13785
13849
|
|
|
13786
|
-
// ../shared/src/block-manifest.ts
|
|
13787
|
-
var jsonSchemaLikeSchema = external_exports.lazy(
|
|
13788
|
-
() => external_exports.object({
|
|
13789
|
-
type: external_exports.string().optional(),
|
|
13790
|
-
properties: external_exports.record(external_exports.string(), jsonSchemaLikeSchema).optional(),
|
|
13791
|
-
required: external_exports.array(external_exports.string()).optional(),
|
|
13792
|
-
items: external_exports.union([jsonSchemaLikeSchema, external_exports.array(jsonSchemaLikeSchema)]).optional(),
|
|
13793
|
-
enum: external_exports.array(external_exports.unknown()).optional(),
|
|
13794
|
-
anyOf: external_exports.array(jsonSchemaLikeSchema).optional(),
|
|
13795
|
-
oneOf: external_exports.array(jsonSchemaLikeSchema).optional(),
|
|
13796
|
-
allOf: external_exports.array(jsonSchemaLikeSchema).optional(),
|
|
13797
|
-
additionalProperties: external_exports.union([external_exports.boolean(), jsonSchemaLikeSchema]).optional(),
|
|
13798
|
-
description: external_exports.string().optional()
|
|
13799
|
-
}).catchall(external_exports.unknown())
|
|
13800
|
-
);
|
|
13801
|
-
var blockDefinitionSchema = external_exports.object({
|
|
13802
|
-
type: external_exports.string().min(1),
|
|
13803
|
-
displayName: external_exports.string().min(1).optional(),
|
|
13804
|
-
editablePaths: external_exports.array(external_exports.string().min(1)).optional(),
|
|
13805
|
-
propsSchema: jsonSchemaLikeSchema,
|
|
13806
|
-
defaultProps: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
13807
|
-
});
|
|
13808
|
-
var blockManifestSchema = external_exports.object({
|
|
13809
|
-
version: external_exports.number().int().positive(),
|
|
13810
|
-
blocks: external_exports.array(blockDefinitionSchema)
|
|
13811
|
-
});
|
|
13812
|
-
|
|
13813
13850
|
// ../shared/src/blocks/_registry.ts
|
|
13814
13851
|
var G = globalThis;
|
|
13815
13852
|
var _blockSchemas = G.__ase_blockSchemas ?? (G.__ase_blockSchemas = {});
|
|
@@ -13875,8 +13912,8 @@ registerBlock("Hero", {
|
|
|
13875
13912
|
ctaHref: external_exports.string().min(1),
|
|
13876
13913
|
imageUrl: external_exports.string().min(1),
|
|
13877
13914
|
imageAlt: external_exports.string().min(1),
|
|
13878
|
-
imagePosition: external_exports.enum(["left", "right", "full"]).default("right"),
|
|
13879
|
-
textAlign: external_exports.enum(["left", "center"]).default("left"),
|
|
13915
|
+
imagePosition: external_exports.enum(["left", "right", "full"]).default("right").catch("right"),
|
|
13916
|
+
textAlign: external_exports.enum(["left", "center"]).default("left").catch("left"),
|
|
13880
13917
|
eyebrow: external_exports.string().optional(),
|
|
13881
13918
|
secondaryCtaText: external_exports.string().optional(),
|
|
13882
13919
|
secondaryCtaHref: external_exports.string().optional()
|
|
@@ -13906,8 +13943,9 @@ registerBlock("Hero", {
|
|
|
13906
13943
|
registerBlock("FeatureGrid", {
|
|
13907
13944
|
schema: external_exports.object({
|
|
13908
13945
|
title: external_exports.string().min(1),
|
|
13909
|
-
columns: external_exports.enum(["2", "3", "4"]).default("3"),
|
|
13946
|
+
columns: external_exports.enum(["2", "3", "4"]).default("3").catch("3"),
|
|
13910
13947
|
features: external_exports.array(external_exports.object({
|
|
13948
|
+
id: external_exports.string().optional(),
|
|
13911
13949
|
icon: external_exports.string().optional(),
|
|
13912
13950
|
title: external_exports.string().min(1),
|
|
13913
13951
|
description: external_exports.string().min(1)
|
|
@@ -13926,7 +13964,7 @@ registerBlock("FeatureGrid", {
|
|
|
13926
13964
|
features: {
|
|
13927
13965
|
label: "Features",
|
|
13928
13966
|
itemFields: {
|
|
13929
|
-
icon: f.text("Icon (emoji
|
|
13967
|
+
icon: f.text("Icon (single emoji)"),
|
|
13930
13968
|
title: f.text("Feature title"),
|
|
13931
13969
|
description: f.longtext("Feature description")
|
|
13932
13970
|
}
|
|
@@ -13940,6 +13978,8 @@ registerBlock("Testimonials", {
|
|
|
13940
13978
|
schema: external_exports.object({
|
|
13941
13979
|
title: external_exports.string().min(1),
|
|
13942
13980
|
items: external_exports.array(external_exports.object({
|
|
13981
|
+
id: external_exports.string().optional(),
|
|
13982
|
+
icon: external_exports.string().optional(),
|
|
13943
13983
|
quote: external_exports.string().min(1),
|
|
13944
13984
|
author: external_exports.string().min(1),
|
|
13945
13985
|
role: external_exports.string().optional(),
|
|
@@ -13956,6 +13996,7 @@ registerBlock("Testimonials", {
|
|
|
13956
13996
|
items: {
|
|
13957
13997
|
label: "Testimonials",
|
|
13958
13998
|
itemFields: {
|
|
13999
|
+
icon: f.text("Icon (single emoji)"),
|
|
13959
14000
|
quote: f.longtext("Quote"),
|
|
13960
14001
|
author: f.text("Author"),
|
|
13961
14002
|
role: f.text("Role / Company"),
|
|
@@ -13971,7 +14012,7 @@ registerBlock("Testimonials", {
|
|
|
13971
14012
|
registerBlock("FAQAccordion", {
|
|
13972
14013
|
schema: external_exports.object({
|
|
13973
14014
|
title: external_exports.string().min(1),
|
|
13974
|
-
items: external_exports.array(external_exports.object({ q: external_exports.string().min(1), a: external_exports.string().min(1) })).min(1)
|
|
14015
|
+
items: external_exports.array(external_exports.object({ id: external_exports.string().optional(), q: external_exports.string().min(1), a: external_exports.string().min(1) })).min(1)
|
|
13975
14016
|
}),
|
|
13976
14017
|
meta: {
|
|
13977
14018
|
displayName: "FAQ Accordion",
|
|
@@ -14022,7 +14063,7 @@ registerBlock("Card", {
|
|
|
14022
14063
|
ctaHref: external_exports.string().min(1),
|
|
14023
14064
|
imageUrl: external_exports.string().min(1).optional(),
|
|
14024
14065
|
imageAlt: external_exports.string().min(1).optional(),
|
|
14025
|
-
variant: external_exports.enum(["default", "full-bleed"]).default("default")
|
|
14066
|
+
variant: external_exports.enum(["default", "full-bleed"]).default("default").catch("default")
|
|
14026
14067
|
}),
|
|
14027
14068
|
meta: {
|
|
14028
14069
|
displayName: "Card",
|
|
@@ -14046,10 +14087,11 @@ registerBlock("CardGrid", {
|
|
|
14046
14087
|
schema: external_exports.object({
|
|
14047
14088
|
title: external_exports.string().min(1),
|
|
14048
14089
|
subtitle: external_exports.string().optional(),
|
|
14049
|
-
columns: external_exports.enum(["2", "3", "4"]).default("3"),
|
|
14050
|
-
cardVariant: external_exports.enum(["default", "full-bleed"]).default("default"),
|
|
14090
|
+
columns: external_exports.enum(["2", "3", "4"]).default("3").catch("3"),
|
|
14091
|
+
cardVariant: external_exports.enum(["default", "full-bleed"]).default("default").catch("default"),
|
|
14051
14092
|
cards: external_exports.array(
|
|
14052
14093
|
external_exports.object({
|
|
14094
|
+
id: external_exports.string().optional(),
|
|
14053
14095
|
title: external_exports.string().min(1),
|
|
14054
14096
|
description: external_exports.string().min(1),
|
|
14055
14097
|
ctaText: external_exports.string().min(1),
|
|
@@ -14109,6 +14151,7 @@ registerBlock("Stats", {
|
|
|
14109
14151
|
schema: external_exports.object({
|
|
14110
14152
|
title: external_exports.string().optional(),
|
|
14111
14153
|
stats: external_exports.array(external_exports.object({
|
|
14154
|
+
id: external_exports.string().optional(),
|
|
14112
14155
|
icon: external_exports.string().optional(),
|
|
14113
14156
|
value: external_exports.string().min(1),
|
|
14114
14157
|
label: external_exports.string().min(1),
|
|
@@ -14124,7 +14167,7 @@ registerBlock("Stats", {
|
|
|
14124
14167
|
stats: {
|
|
14125
14168
|
label: "Stats",
|
|
14126
14169
|
itemFields: {
|
|
14127
|
-
icon: f.text("Icon (emoji
|
|
14170
|
+
icon: f.text("Icon (single emoji)"),
|
|
14128
14171
|
value: f.text("Value"),
|
|
14129
14172
|
label: f.text("Label"),
|
|
14130
14173
|
description: f.text("Description")
|
|
@@ -14136,7 +14179,11 @@ registerBlock("Stats", {
|
|
|
14136
14179
|
|
|
14137
14180
|
// ../shared/src/blocks/two-column.ts
|
|
14138
14181
|
var twoColumnChild = external_exports.object({
|
|
14139
|
-
|
|
14182
|
+
id: external_exports.string().optional(),
|
|
14183
|
+
// Required, no natural default — coerce an out-of-range/legacy type to "paragraph"
|
|
14184
|
+
// (a safe text component that keeps the item's `text`) so a single drifted child
|
|
14185
|
+
// can't reject the whole block on re-validation during update_props/item ops (#21).
|
|
14186
|
+
type: external_exports.enum(["heading", "subheading", "paragraph", "list", "cta", "ctas", "image", "video"]).catch("paragraph"),
|
|
14140
14187
|
text: external_exports.string().optional(),
|
|
14141
14188
|
label: external_exports.string().optional(),
|
|
14142
14189
|
href: external_exports.string().optional(),
|
|
@@ -14158,7 +14205,7 @@ var twoColumnItemFields = {
|
|
|
14158
14205
|
};
|
|
14159
14206
|
registerBlock("TwoColumn", {
|
|
14160
14207
|
schema: external_exports.object({
|
|
14161
|
-
variant: external_exports.enum(["default", "accent"]).default("default"),
|
|
14208
|
+
variant: external_exports.enum(["default", "accent"]).default("default").catch("default"),
|
|
14162
14209
|
left: external_exports.array(twoColumnChild).min(1),
|
|
14163
14210
|
right: external_exports.array(twoColumnChild).min(1)
|
|
14164
14211
|
}),
|
|
@@ -14181,7 +14228,7 @@ registerBlock("TwoColumn", {
|
|
|
14181
14228
|
registerBlock("Footer", {
|
|
14182
14229
|
schema: external_exports.object({
|
|
14183
14230
|
copyright: external_exports.string().min(1),
|
|
14184
|
-
columns: external_exports.array(external_exports.object({ title: external_exports.string().min(1), links: external_exports.string().min(1) })).min(1)
|
|
14231
|
+
columns: external_exports.array(external_exports.object({ id: external_exports.string().optional(), title: external_exports.string().min(1), links: external_exports.string().min(1) })).min(1)
|
|
14185
14232
|
}),
|
|
14186
14233
|
meta: {
|
|
14187
14234
|
displayName: "Footer",
|
|
@@ -14192,7 +14239,26 @@ registerBlock("Footer", {
|
|
|
14192
14239
|
listFields: {
|
|
14193
14240
|
columns: {
|
|
14194
14241
|
label: "Footer columns",
|
|
14195
|
-
itemFields: {
|
|
14242
|
+
itemFields: {
|
|
14243
|
+
title: f.text("Column title"),
|
|
14244
|
+
/*
|
|
14245
|
+
* A newline-delimited list of `label|url` pairs — NOT prose.
|
|
14246
|
+
*
|
|
14247
|
+
* This was `f.richtext`, which put a markdown editor on it. Markdown
|
|
14248
|
+
* has no bare newline: Tiptap parsed the lines as one paragraph with
|
|
14249
|
+
* a soft break and serialised it back with a space, so a single
|
|
14250
|
+
* keystroke turned "Features|/features\nPricing|/pricing" into
|
|
14251
|
+
* "Features|/features Pricing|/pricing" — one link, with the rest of
|
|
14252
|
+
* the column swallowed into its href. Footer is a chrome block, so
|
|
14253
|
+
* that was live on every page of every site.
|
|
14254
|
+
*
|
|
14255
|
+
* A plain textarea preserves the separator. The real fix is a field
|
|
14256
|
+
* kind for a list of scalars, which needs a schema change and a
|
|
14257
|
+
* migration of stored footers; until then, do not put a prose editor
|
|
14258
|
+
* on a delimited value.
|
|
14259
|
+
*/
|
|
14260
|
+
links: f.longtext("Links (one label|url per line)")
|
|
14261
|
+
}
|
|
14196
14262
|
}
|
|
14197
14263
|
}
|
|
14198
14264
|
}
|
|
@@ -14200,6 +14266,7 @@ registerBlock("Footer", {
|
|
|
14200
14266
|
|
|
14201
14267
|
// ../shared/src/blocks/site-header.ts
|
|
14202
14268
|
var navLinkLeaf = external_exports.object({
|
|
14269
|
+
id: external_exports.string().optional(),
|
|
14203
14270
|
label: external_exports.string().min(1),
|
|
14204
14271
|
href: external_exports.string().min(1)
|
|
14205
14272
|
});
|
|
@@ -14238,10 +14305,10 @@ registerBlock("SiteHeader", {
|
|
|
14238
14305
|
// ../shared/src/blocks/embed.ts
|
|
14239
14306
|
registerBlock("Embed", {
|
|
14240
14307
|
schema: external_exports.object({
|
|
14241
|
-
embedType: external_exports.enum(["map", "social", "custom"]).default("map"),
|
|
14308
|
+
embedType: external_exports.enum(["map", "social", "custom"]).default("map").catch("map"),
|
|
14242
14309
|
url: external_exports.string().min(1),
|
|
14243
14310
|
title: external_exports.string().optional(),
|
|
14244
|
-
aspectRatio: external_exports.enum(["16:9", "4:3", "1:1"]).default("16:9")
|
|
14311
|
+
aspectRatio: external_exports.enum(["16:9", "4:3", "1:1"]).default("16:9").catch("16:9")
|
|
14245
14312
|
}),
|
|
14246
14313
|
meta: {
|
|
14247
14314
|
displayName: "Embed",
|
|
@@ -14260,7 +14327,7 @@ registerBlock("Embed", {
|
|
|
14260
14327
|
registerBlock("Banner", {
|
|
14261
14328
|
schema: external_exports.object({
|
|
14262
14329
|
text: external_exports.string().min(1),
|
|
14263
|
-
variant: external_exports.enum(["info", "success", "warning"]).default("info"),
|
|
14330
|
+
variant: external_exports.enum(["info", "success", "warning"]).default("info").catch("info"),
|
|
14264
14331
|
ctaText: external_exports.string().optional(),
|
|
14265
14332
|
ctaHref: external_exports.string().optional(),
|
|
14266
14333
|
backgroundColor: external_exports.string().optional(),
|
|
@@ -14285,6 +14352,7 @@ registerBlock("Banner", {
|
|
|
14285
14352
|
registerBlock("Carousel", {
|
|
14286
14353
|
schema: external_exports.object({
|
|
14287
14354
|
items: external_exports.array(external_exports.object({
|
|
14355
|
+
id: external_exports.string().optional(),
|
|
14288
14356
|
imageUrl: external_exports.string().min(1),
|
|
14289
14357
|
imageAlt: external_exports.string().optional(),
|
|
14290
14358
|
heading: external_exports.string().optional(),
|
|
@@ -14292,7 +14360,7 @@ registerBlock("Carousel", {
|
|
|
14292
14360
|
ctaText: external_exports.string().optional(),
|
|
14293
14361
|
ctaHref: external_exports.string().optional()
|
|
14294
14362
|
})).min(1),
|
|
14295
|
-
autoplay: external_exports.enum(["true", "false"]).default("false"),
|
|
14363
|
+
autoplay: external_exports.enum(["true", "false"]).default("false").catch("false"),
|
|
14296
14364
|
interval: external_exports.number().optional()
|
|
14297
14365
|
}),
|
|
14298
14366
|
meta: {
|
|
@@ -14324,8 +14392,9 @@ registerBlock("Gallery", {
|
|
|
14324
14392
|
schema: external_exports.object({
|
|
14325
14393
|
title: external_exports.string().optional(),
|
|
14326
14394
|
headingLevel: external_exports.string().optional(),
|
|
14327
|
-
columns: external_exports.enum(["2", "3", "4"]).default("3"),
|
|
14395
|
+
columns: external_exports.enum(["2", "3", "4"]).default("3").catch("3"),
|
|
14328
14396
|
images: external_exports.array(external_exports.object({
|
|
14397
|
+
id: external_exports.string().optional(),
|
|
14329
14398
|
imageUrl: external_exports.string().min(1),
|
|
14330
14399
|
alt: external_exports.string().optional(),
|
|
14331
14400
|
caption: external_exports.string().optional()
|
|
@@ -14358,6 +14427,7 @@ registerBlock("Tabs", {
|
|
|
14358
14427
|
schema: external_exports.object({
|
|
14359
14428
|
title: external_exports.string().optional(),
|
|
14360
14429
|
tabs: external_exports.array(external_exports.object({
|
|
14430
|
+
id: external_exports.string().optional(),
|
|
14361
14431
|
label: external_exports.string().min(1),
|
|
14362
14432
|
content: external_exports.string().min(1)
|
|
14363
14433
|
})).min(1)
|
|
@@ -14386,7 +14456,7 @@ registerBlock("Table", {
|
|
|
14386
14456
|
headingLevel: external_exports.string().optional(),
|
|
14387
14457
|
headers: external_exports.array(external_exports.string().min(1)).min(1),
|
|
14388
14458
|
rows: external_exports.array(external_exports.array(external_exports.coerce.string())).min(1),
|
|
14389
|
-
striped: external_exports.enum(["true", "false"]).default("false")
|
|
14459
|
+
striped: external_exports.enum(["true", "false"]).default("false").catch("false")
|
|
14390
14460
|
}),
|
|
14391
14461
|
meta: {
|
|
14392
14462
|
displayName: "Table",
|
|
@@ -14431,8 +14501,8 @@ registerBlock("Video", {
|
|
|
14431
14501
|
src: external_exports.string().min(1),
|
|
14432
14502
|
title: external_exports.string().optional(),
|
|
14433
14503
|
posterUrl: external_exports.string().optional(),
|
|
14434
|
-
autoplay: external_exports.enum(["true", "false"]).default("false"),
|
|
14435
|
-
loop: external_exports.enum(["true", "false"]).default("false")
|
|
14504
|
+
autoplay: external_exports.enum(["true", "false"]).default("false").catch("false"),
|
|
14505
|
+
loop: external_exports.enum(["true", "false"]).default("false").catch("false")
|
|
14436
14506
|
}),
|
|
14437
14507
|
meta: {
|
|
14438
14508
|
displayName: "Video",
|
|
@@ -14448,6 +14518,102 @@ registerBlock("Video", {
|
|
|
14448
14518
|
}
|
|
14449
14519
|
});
|
|
14450
14520
|
|
|
14521
|
+
// ../shared/src/block-manifest.ts
|
|
14522
|
+
var jsonSchemaLikeSchema = external_exports.lazy(
|
|
14523
|
+
() => external_exports.object({
|
|
14524
|
+
type: external_exports.string().optional(),
|
|
14525
|
+
properties: external_exports.record(external_exports.string(), jsonSchemaLikeSchema).optional(),
|
|
14526
|
+
required: external_exports.array(external_exports.string()).optional(),
|
|
14527
|
+
items: external_exports.union([jsonSchemaLikeSchema, external_exports.array(jsonSchemaLikeSchema)]).optional(),
|
|
14528
|
+
enum: external_exports.array(external_exports.unknown()).optional(),
|
|
14529
|
+
anyOf: external_exports.array(jsonSchemaLikeSchema).optional(),
|
|
14530
|
+
oneOf: external_exports.array(jsonSchemaLikeSchema).optional(),
|
|
14531
|
+
allOf: external_exports.array(jsonSchemaLikeSchema).optional(),
|
|
14532
|
+
additionalProperties: external_exports.union([external_exports.boolean(), jsonSchemaLikeSchema]).optional(),
|
|
14533
|
+
description: external_exports.string().optional()
|
|
14534
|
+
}).catchall(external_exports.unknown())
|
|
14535
|
+
);
|
|
14536
|
+
var fieldMetaSchema = external_exports.object({
|
|
14537
|
+
kind: external_exports.enum(["text", "richtext", "url", "image", "imageAlt", "enum", "color", "number", "boolean", "headingLevel"]),
|
|
14538
|
+
label: external_exports.string().optional(),
|
|
14539
|
+
inlineEditable: external_exports.boolean().optional(),
|
|
14540
|
+
options: external_exports.array(external_exports.string()).optional(),
|
|
14541
|
+
imageSpec: external_exports.object({
|
|
14542
|
+
aspectRatio: external_exports.enum(["landscape", "square", "portrait"]),
|
|
14543
|
+
width: external_exports.number(),
|
|
14544
|
+
height: external_exports.number(),
|
|
14545
|
+
format: external_exports.enum(["png", "webp", "jpeg"]).optional()
|
|
14546
|
+
}).optional(),
|
|
14547
|
+
multiline: external_exports.boolean().optional(),
|
|
14548
|
+
inline: external_exports.boolean().optional(),
|
|
14549
|
+
decorators: external_exports.array(external_exports.object({ name: external_exports.string().min(1), title: external_exports.string().optional() })).optional(),
|
|
14550
|
+
required: external_exports.boolean().optional()
|
|
14551
|
+
});
|
|
14552
|
+
var listFieldMetaSchema = external_exports.object({
|
|
14553
|
+
label: external_exports.string().optional(),
|
|
14554
|
+
itemFields: external_exports.record(external_exports.string(), fieldMetaSchema).optional(),
|
|
14555
|
+
discriminator: external_exports.string().optional(),
|
|
14556
|
+
itemFieldsByType: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), fieldMetaSchema)).optional()
|
|
14557
|
+
});
|
|
14558
|
+
var blockDefinitionSchema = external_exports.object({
|
|
14559
|
+
type: external_exports.string().min(1),
|
|
14560
|
+
displayName: external_exports.string().min(1).optional(),
|
|
14561
|
+
editablePaths: external_exports.array(external_exports.string().min(1)).optional(),
|
|
14562
|
+
propsSchema: jsonSchemaLikeSchema,
|
|
14563
|
+
defaultProps: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
14564
|
+
/**
|
|
14565
|
+
* Optional editing metadata, merged over what the schema implies.
|
|
14566
|
+
*
|
|
14567
|
+
* `propsSchema` stays the source of truth for *which* props exist; this only
|
|
14568
|
+
* refines how the ones already there are presented.
|
|
14569
|
+
*/
|
|
14570
|
+
fields: external_exports.record(external_exports.string(), fieldMetaSchema).optional(),
|
|
14571
|
+
listFields: external_exports.record(external_exports.string(), listFieldMetaSchema).optional(),
|
|
14572
|
+
/**
|
|
14573
|
+
* How the block presents itself in a catalogue, and whether it can be placed
|
|
14574
|
+
* at all. None of the three is derivable from `propsSchema`.
|
|
14575
|
+
*
|
|
14576
|
+
* `chrome` is the one that changes what a caller may do: a chrome block is
|
|
14577
|
+
* structurally pinned — always present, never added, moved or removed. An
|
|
14578
|
+
* agent reading this manifest to decide what to insert needs to be told
|
|
14579
|
+
* that, or it plans an `add_block` the ops engine will refuse.
|
|
14580
|
+
*/
|
|
14581
|
+
category: external_exports.string().min(1).optional(),
|
|
14582
|
+
description: external_exports.string().min(1).optional(),
|
|
14583
|
+
chrome: external_exports.boolean().optional()
|
|
14584
|
+
});
|
|
14585
|
+
var blockManifestSchema = external_exports.object({
|
|
14586
|
+
version: external_exports.number().int().positive(),
|
|
14587
|
+
blocks: external_exports.array(blockDefinitionSchema)
|
|
14588
|
+
});
|
|
14589
|
+
|
|
14590
|
+
// ../shared/src/ops/theme-tokens.ts
|
|
14591
|
+
var THEME_TOKEN_TO_CSS_VARS = {
|
|
14592
|
+
brandColor: ["--brand", "--brand-hover", "--link"],
|
|
14593
|
+
accentColor: ["--accent", "--accent-hover"],
|
|
14594
|
+
backgroundColor: ["--bg-0", "--bg-000"],
|
|
14595
|
+
surfaceColor: ["--surface", "--card-bg", "--bg-100"],
|
|
14596
|
+
headingColor: ["--heading", "--text-100"],
|
|
14597
|
+
textColor: ["--body", "--text-200"],
|
|
14598
|
+
mutedTextColor: ["--body-secondary", "--text-300", "--caption"],
|
|
14599
|
+
headingFont: ["--font-heading"],
|
|
14600
|
+
bodyFont: ["--font-body"],
|
|
14601
|
+
radius: ["--radius", "--radius-btn", "--radius-card", "--radius-feature", "--radius-input"]
|
|
14602
|
+
};
|
|
14603
|
+
var themeTokenKeys = Object.keys(THEME_TOKEN_TO_CSS_VARS);
|
|
14604
|
+
var semanticThemeTokensSchema = external_exports.object({
|
|
14605
|
+
brandColor: external_exports.string().optional().describe("Primary brand color (sets --brand, --brand-hover, --link). Any CSS color."),
|
|
14606
|
+
accentColor: external_exports.string().optional().describe("Secondary accent color (sets --accent, --accent-hover)."),
|
|
14607
|
+
backgroundColor: external_exports.string().optional().describe("Page background color (sets --bg-0, --bg-000)."),
|
|
14608
|
+
surfaceColor: external_exports.string().optional().describe("Card/panel surface color (sets --surface, --card-bg, --bg-100)."),
|
|
14609
|
+
headingColor: external_exports.string().optional().describe("Heading text color (sets --heading, --text-100)."),
|
|
14610
|
+
textColor: external_exports.string().optional().describe("Body text color (sets --body, --text-200)."),
|
|
14611
|
+
mutedTextColor: external_exports.string().optional().describe("Secondary/muted text color (sets --body-secondary, --text-300, --caption)."),
|
|
14612
|
+
headingFont: external_exports.string().optional().describe("Heading font stack (sets --font-heading), e.g. 'Georgia, serif'."),
|
|
14613
|
+
bodyFont: external_exports.string().optional().describe("Body font stack (sets --font-body)."),
|
|
14614
|
+
radius: external_exports.string().optional().describe("Corner radius applied across buttons/cards/inputs (sets --radius and friends), e.g. '12px'.")
|
|
14615
|
+
});
|
|
14616
|
+
|
|
14451
14617
|
// ../shared/src/schemas.ts
|
|
14452
14618
|
var siteConfigSchema = external_exports.object({
|
|
14453
14619
|
name: external_exports.string().optional(),
|
|
@@ -14468,7 +14634,22 @@ var siteConfigSchema = external_exports.object({
|
|
|
14468
14634
|
var pageMetaSchema = external_exports.object({
|
|
14469
14635
|
title: external_exports.string().optional(),
|
|
14470
14636
|
description: external_exports.string().optional(),
|
|
14471
|
-
ogImage: external_exports.string().optional()
|
|
14637
|
+
ogImage: external_exports.string().optional(),
|
|
14638
|
+
/*
|
|
14639
|
+
* The public path this page is served at, when that differs from its slug.
|
|
14640
|
+
*
|
|
14641
|
+
* Avocado has always treated the slug as the URL, which holds only while a
|
|
14642
|
+
* site's routing is Avocado's. It is not for anything with a locale prefix,
|
|
14643
|
+
* a basePath, or a CMS that owns its own routes: Paintball Arena Bern keeps
|
|
14644
|
+
* one editable page per (document x language), so `/de/events` is a page
|
|
14645
|
+
* identity, while the site serves German at the root and answers 404 for
|
|
14646
|
+
* that path. An agent given the slug and told to open it goes to a 404 and
|
|
14647
|
+
* has no way to know it was handed an id rather than a URL.
|
|
14648
|
+
*
|
|
14649
|
+
* Optional, and absent means "the slug is the path" — which stays true for
|
|
14650
|
+
* every site whose routing Avocado does own.
|
|
14651
|
+
*/
|
|
14652
|
+
path: external_exports.string().optional()
|
|
14472
14653
|
});
|
|
14473
14654
|
var pageDocFields = {
|
|
14474
14655
|
id: external_exports.string().min(1),
|
|
@@ -14526,6 +14707,7 @@ var addItemSchema = external_exports.object({
|
|
|
14526
14707
|
blockId: external_exports.string().min(1),
|
|
14527
14708
|
listKey: external_exports.string().min(1),
|
|
14528
14709
|
item: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
14710
|
+
afterItemId: external_exports.string().min(1).optional(),
|
|
14529
14711
|
afterIndex: external_exports.number().int().min(0).optional()
|
|
14530
14712
|
});
|
|
14531
14713
|
var updateItemSchema = external_exports.object({
|
|
@@ -14533,7 +14715,8 @@ var updateItemSchema = external_exports.object({
|
|
|
14533
14715
|
pageSlug: external_exports.string().min(1),
|
|
14534
14716
|
blockId: external_exports.string().min(1),
|
|
14535
14717
|
listKey: external_exports.string().min(1),
|
|
14536
|
-
|
|
14718
|
+
itemId: external_exports.string().min(1).optional(),
|
|
14719
|
+
index: external_exports.number().int().min(0).optional(),
|
|
14537
14720
|
patch: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
14538
14721
|
});
|
|
14539
14722
|
var removeItemSchema = external_exports.object({
|
|
@@ -14541,16 +14724,31 @@ var removeItemSchema = external_exports.object({
|
|
|
14541
14724
|
pageSlug: external_exports.string().min(1),
|
|
14542
14725
|
blockId: external_exports.string().min(1),
|
|
14543
14726
|
listKey: external_exports.string().min(1),
|
|
14544
|
-
|
|
14727
|
+
itemId: external_exports.string().min(1).optional(),
|
|
14728
|
+
index: external_exports.number().int().min(0).optional()
|
|
14545
14729
|
});
|
|
14546
14730
|
var moveItemSchema = external_exports.object({
|
|
14547
14731
|
op: external_exports.literal("move_item"),
|
|
14548
14732
|
pageSlug: external_exports.string().min(1),
|
|
14549
14733
|
blockId: external_exports.string().min(1),
|
|
14550
14734
|
listKey: external_exports.string().min(1),
|
|
14551
|
-
|
|
14735
|
+
itemId: external_exports.string().min(1).optional(),
|
|
14736
|
+
index: external_exports.number().int().min(0).optional(),
|
|
14737
|
+
afterItemId: external_exports.string().min(1).optional(),
|
|
14552
14738
|
afterIndex: external_exports.number().int().min(0).optional()
|
|
14553
14739
|
});
|
|
14740
|
+
var reorderItemsSchema = external_exports.object({
|
|
14741
|
+
op: external_exports.literal("reorder_items"),
|
|
14742
|
+
pageSlug: external_exports.string().min(1),
|
|
14743
|
+
blockId: external_exports.string().min(1),
|
|
14744
|
+
listKey: external_exports.string().min(1),
|
|
14745
|
+
order: external_exports.array(external_exports.union([external_exports.string().min(1), external_exports.number().int().min(0)])).min(1)
|
|
14746
|
+
});
|
|
14747
|
+
var reorderBlocksSchema = external_exports.object({
|
|
14748
|
+
op: external_exports.literal("reorder_blocks"),
|
|
14749
|
+
pageSlug: external_exports.string().min(1),
|
|
14750
|
+
order: external_exports.array(external_exports.string().min(1)).min(1)
|
|
14751
|
+
});
|
|
14554
14752
|
var renamePageSchema = external_exports.object({
|
|
14555
14753
|
op: external_exports.literal("rename_page"),
|
|
14556
14754
|
pageSlug: external_exports.string().min(1),
|
|
@@ -14573,14 +14771,26 @@ var duplicatePageSchema = external_exports.object({
|
|
|
14573
14771
|
newTitle: external_exports.string().min(1).optional(),
|
|
14574
14772
|
afterPageSlug: external_exports.string().min(1).optional()
|
|
14575
14773
|
});
|
|
14774
|
+
var UPDATE_PAGE_META_KEYS = ["title", "description", "ogImage"];
|
|
14576
14775
|
var updatePageMetaSchema = external_exports.object({
|
|
14577
14776
|
op: external_exports.literal("update_page_meta"),
|
|
14578
14777
|
pageSlug: external_exports.string().min(1),
|
|
14579
|
-
patch: external_exports.
|
|
14580
|
-
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
|
|
14778
|
+
patch: external_exports.strictObject(
|
|
14779
|
+
{
|
|
14780
|
+
title: external_exports.string().optional(),
|
|
14781
|
+
description: external_exports.string().optional(),
|
|
14782
|
+
ogImage: external_exports.string().optional()
|
|
14783
|
+
},
|
|
14784
|
+
{
|
|
14785
|
+
error: (issue2) => {
|
|
14786
|
+
if (issue2.code !== "unrecognized_keys") return void 0;
|
|
14787
|
+
const keys = issue2.keys;
|
|
14788
|
+
const named = keys.map((key) => `\`${key}\``).join(", ");
|
|
14789
|
+
const why = keys.includes("path") ? " `path` reports where the site already serves this page and is supplied by the site's adapter, so Avocado cannot reassign it here." : "";
|
|
14790
|
+
return `Invalid update_page_meta patch: unrecognized key ${named}. This patch accepts ${UPDATE_PAGE_META_KEYS.join(", ")}.${why}`;
|
|
14791
|
+
}
|
|
14792
|
+
}
|
|
14793
|
+
)
|
|
14584
14794
|
});
|
|
14585
14795
|
var updateSiteConfigSchema = external_exports.object({
|
|
14586
14796
|
op: external_exports.literal("update_site_config"),
|
|
@@ -14591,6 +14801,11 @@ var updateSiteConfigSchema = external_exports.object({
|
|
|
14591
14801
|
navGroups: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).optional()
|
|
14592
14802
|
})
|
|
14593
14803
|
});
|
|
14804
|
+
var updateThemeSchema = external_exports.object({
|
|
14805
|
+
op: external_exports.literal("update_theme"),
|
|
14806
|
+
patch: semanticThemeTokensSchema,
|
|
14807
|
+
cssVars: external_exports.record(external_exports.string(), external_exports.string()).optional()
|
|
14808
|
+
});
|
|
14594
14809
|
var operationSchema = external_exports.discriminatedUnion("op", [
|
|
14595
14810
|
createPageSchema,
|
|
14596
14811
|
addBlockSchema,
|
|
@@ -14602,12 +14817,15 @@ var operationSchema = external_exports.discriminatedUnion("op", [
|
|
|
14602
14817
|
updateItemSchema,
|
|
14603
14818
|
removeItemSchema,
|
|
14604
14819
|
moveItemSchema,
|
|
14820
|
+
reorderItemsSchema,
|
|
14821
|
+
reorderBlocksSchema,
|
|
14605
14822
|
renamePageSchema,
|
|
14606
14823
|
removePageSchema,
|
|
14607
14824
|
movePageSchema,
|
|
14608
14825
|
duplicatePageSchema,
|
|
14609
14826
|
updatePageMetaSchema,
|
|
14610
|
-
updateSiteConfigSchema
|
|
14827
|
+
updateSiteConfigSchema,
|
|
14828
|
+
updateThemeSchema
|
|
14611
14829
|
]);
|
|
14612
14830
|
var editPlanSchema = external_exports.object({
|
|
14613
14831
|
intent: external_exports.enum(["edit_plan", "needs_clarification", "content_answer"]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as b}from"./chunk-2CNEFIQP-
|
|
1
|
+
import{P as b}from"./chunk-2CNEFIQP-W9Nm3hTe.js";import{u as y,a as j,E as L,_ as m,L as M,b as p,o as P,i as A}from"./PuckPrototypeRoute-CIpO3h9H.js";import{r as s,j as g}from"./index-CM2p2yNB.js";import{E as N,u as U}from"./index-DaRt8zrp.js";import"./index-Cqq_JD7D.js";A();A();function C({content:a,onChange:x,extensions:v,editable:d=!0,onFocusChange:o,name:c}){const[i,E]=P(null,50,{leading:!0,maxWait:200}),l=s.useRef(!1),S=s.useRef(""),f=s.useRef(null),R=!!f.current,_=j(t=>t.state.ui.field.focus===c),T=t=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{S.current===t&&(f.current=null)},200)},u=y(),e=U({extensions:v,content:a,editable:d,immediatelyRender:!1,parseOptions:{preserveWhitespace:"full"},onUpdate:({editor:t})=>{if(l.current||!_){u.getState().setUi({field:{focus:c}});return}const r=t.getHTML(),{from:n,to:h}=t.state.selection;E({from:n,to:h,html:r}),T(r),S.current=r}});return s.useEffect(()=>{if(!e)return;const t=()=>{o==null||o(e)};return e.on("focus",t),()=>{e.off("focus",t)}},[e,o]),s.useEffect(()=>{if(i){const{ui:t}=u.getState().state;x(i.html,{field:m(p({},t.field),{metadata:{from:i.from,to:i.to}})})}},[e,i,x,u,c]),s.useEffect(()=>{e==null||e.setEditable(d)},[e,d]),s.useEffect(()=>{var t;if(!e||R||e.getHTML()===a)return;l.current=!0,e.commands.setContent(a,{emitUpdate:!1});const{ui:n}=u.getState().state;typeof((t=n.field.metadata)==null?void 0:t.from)<"u"&&e.commands.setTextSelection({from:n.field.metadata.from,to:n.field.metadata.to}),l.current=!1},[a,e,u]),e}var F=s.memo(a=>{const{onChange:x,content:v,readOnly:d=!1,field:o,inline:c=!1,onFocus:i,id:E,name:l}=a,{tiptap:S={},options:f}=o,{extensions:R=[]}=S,_=s.useMemo(()=>[b.configure(f),...R],[o,R]),T=y(),u=`${l}${c?"::inline":""}`,e=C({content:v,onChange:x,extensions:_,editable:!d,name:u,onFocusChange:r=>{if(r){const n=T.getState();T.setState({currentRichText:{field:o,editor:r,id:E,inline:c},state:m(p({},n.state),{ui:m(p({},n.state.ui),{field:m(p({},n.state.ui.field),{focus:u})})})}),i==null||i(r)}}}),t=j(r=>{var n,h;return!c&&((n=r.currentRichText)==null?void 0:n.id)===E&&((h=r.currentRichText)!=null&&h.inlineComponentId)?r.currentRichText.editor:e});return e?g.jsx(L,m(p({},a),{editor:e,menu:g.jsx(M,{field:o,editor:t,readOnly:d}),children:g.jsx(N,{editor:e,className:"rich-text"})})):null});F.displayName="Editor";export{F as Editor};
|