@charisol/plexo-sdk 2.0.29 → 2.0.30
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/README.md +23 -0
- package/dist/{InlineColorPicker-XesBzRsU.js → InlineColorPicker-Cb9p4I_m.js} +123 -90
- package/dist/{blank-BEl6CY5C.js → blank-Dg8GIfQP.js} +271 -246
- package/dist/{files-Df6FY0HK.js → files-Bjoz1wCf.js} +13 -13
- package/dist/index.js +9045 -9078
- package/dist/plexo-sdk.css +1 -1
- package/dist/{v1-Cn7SGvZk.js → v1-B6QkDh9R.js} +545 -545
- package/dist/v2/components/layout/TopToolbar.d.ts +7 -0
- package/dist/v2/components/simple/SimpleCoach.d.ts +8 -0
- package/dist/v2/components/simple/SimpleHint.d.ts +3 -0
- package/dist/v2/components/simple/SimpleInspector.d.ts +3 -0
- package/dist/v2/components/simple/SimpleSidebar.d.ts +3 -0
- package/dist/v2/components/simple/SimpleTopBar.d.ts +5 -0
- package/dist/v2/components/simple/words.d.ts +12 -0
- package/dist/v2/data/blankPage.d.ts +5 -0
- package/dist/v2/host/HostContext.d.ts +14 -0
- package/dist/v2/index.d.ts +2 -1
- package/dist/v2-compile.js +8 -8
- package/dist/v2-files.js +1 -1
- package/dist/v2.js +5230 -4276
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { a as e, c as t, d as n, f as r, i, l as a, o, p as s, r as c, s as l, t as u, u as d } from "./schemas-Bq5o5MfF.js";
|
|
2
2
|
import { a as f, o as p, s as m } from "./colorUtils-BaVkGjFC.js";
|
|
3
3
|
import { t as h } from "./id-CR6Y8qD6.js";
|
|
4
|
-
import {
|
|
5
|
-
import { A as
|
|
6
|
-
import { n as
|
|
4
|
+
import { $ as g, $t as ee, At as te, B as ne, G as re, H as ie, J as ae, K as oe, Nt as se, Q as _, St as ce, W as le, Xt as ue, _t as de, bt as fe, ht as pe, jt as me, k as he, mt as ge, nn as _e, q as ve, tt as ye, ut as be, vt as xe, yt as v } from "./blank-Dg8GIfQP.js";
|
|
5
|
+
import { A as Se, F as Ce, I as we, O as Te, d as y, f as b, i as Ee, l as De, n as Oe, o as x, r as ke, t as Ae } from "./lint-CV3DmM0X.js";
|
|
6
|
+
import { n as je } from "./brandGuide-Dd4fqVjS.js";
|
|
7
7
|
//#region src/v2/sections/pageRecipes.ts
|
|
8
|
-
var
|
|
8
|
+
var S = (e, t = "#") => ({
|
|
9
9
|
label: e,
|
|
10
10
|
href: t
|
|
11
|
-
}),
|
|
11
|
+
}), C = {
|
|
12
12
|
label: "",
|
|
13
13
|
href: ""
|
|
14
|
-
},
|
|
14
|
+
}, w = [
|
|
15
15
|
{
|
|
16
16
|
id: "home-classic",
|
|
17
17
|
pageType: "home",
|
|
@@ -32,8 +32,8 @@ var C = (e, t = "#") => ({
|
|
|
32
32
|
eyebrow: "Welcome",
|
|
33
33
|
headline: "Friendly service you can count on",
|
|
34
34
|
text: "We make it simple to get what you need, done properly the first time. Have a look around, then say hello.",
|
|
35
|
-
cta:
|
|
36
|
-
cta2:
|
|
35
|
+
cta: S("Get started", "/contact"),
|
|
36
|
+
cta2: S("Learn more", "/about")
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
{
|
|
@@ -79,8 +79,8 @@ var C = (e, t = "#") => ({
|
|
|
79
79
|
eyebrow: "Built for results",
|
|
80
80
|
headline: "Push further than you thought you could",
|
|
81
81
|
text: "Everything you need to go from first step to finish line, with people who have your back.",
|
|
82
|
-
cta:
|
|
83
|
-
cta2:
|
|
82
|
+
cta: S("Get started", "/contact"),
|
|
83
|
+
cta2: S("See how it works", "#how")
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
{
|
|
@@ -133,8 +133,8 @@ var C = (e, t = "#") => ({
|
|
|
133
133
|
eyebrow: "Since day one",
|
|
134
134
|
headline: "Thoughtful work, beautifully done",
|
|
135
135
|
text: "A small studio with a big eye for detail. Every piece is made with care, for people who notice the difference.",
|
|
136
|
-
cta:
|
|
137
|
-
cta2:
|
|
136
|
+
cta: S("See the work", "/gallery"),
|
|
137
|
+
cta2: S("Get in touch", "/contact")
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
{
|
|
@@ -175,7 +175,7 @@ var C = (e, t = "#") => ({
|
|
|
175
175
|
variant: "bar",
|
|
176
176
|
content: {
|
|
177
177
|
text: "Booking now — same-week appointments available.",
|
|
178
|
-
link:
|
|
178
|
+
link: S("Book now", "/contact")
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
{
|
|
@@ -185,8 +185,8 @@ var C = (e, t = "#") => ({
|
|
|
185
185
|
eyebrow: "Trusted locally",
|
|
186
186
|
headline: "Reliable help, right when you need it",
|
|
187
187
|
text: "Friendly, qualified and on time. Tell us what you need and we will take it from there.",
|
|
188
|
-
cta:
|
|
189
|
-
cta2:
|
|
188
|
+
cta: S("Book a visit", "/contact"),
|
|
189
|
+
cta2: S("Our services", "/services")
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
{
|
|
@@ -235,7 +235,7 @@ var C = (e, t = "#") => ({
|
|
|
235
235
|
variant: "strip",
|
|
236
236
|
content: {
|
|
237
237
|
text: "Free delivery on your first order.",
|
|
238
|
-
link:
|
|
238
|
+
link: S("Shop now", "/store")
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
241
|
{
|
|
@@ -245,8 +245,8 @@ var C = (e, t = "#") => ({
|
|
|
245
245
|
eyebrow: "New in",
|
|
246
246
|
headline: "Made to be loved, every single day",
|
|
247
247
|
text: "Thoughtfully made, fairly priced and delivered to your door.",
|
|
248
|
-
cta:
|
|
249
|
-
cta2:
|
|
248
|
+
cta: S("Shop now", "/store"),
|
|
249
|
+
cta2: S("Our story", "/about")
|
|
250
250
|
}
|
|
251
251
|
},
|
|
252
252
|
{
|
|
@@ -256,7 +256,7 @@ var C = (e, t = "#") => ({
|
|
|
256
256
|
eyebrow: "Best sellers",
|
|
257
257
|
heading: "Our customers’ favourites",
|
|
258
258
|
text: "The pieces people come back for.",
|
|
259
|
-
cta:
|
|
259
|
+
cta: S("Shop everything", "/store")
|
|
260
260
|
}
|
|
261
261
|
},
|
|
262
262
|
{
|
|
@@ -302,8 +302,8 @@ var C = (e, t = "#") => ({
|
|
|
302
302
|
eyebrow: "Now available",
|
|
303
303
|
headline: "Do your best work, without the busywork",
|
|
304
304
|
text: "One simple place to plan, track and get things done — so your team can focus on what matters.",
|
|
305
|
-
cta:
|
|
306
|
-
cta2:
|
|
305
|
+
cta: S("Start free", "/pricing"),
|
|
306
|
+
cta2: S("See how it works", "#features")
|
|
307
307
|
}
|
|
308
308
|
},
|
|
309
309
|
{
|
|
@@ -348,8 +348,8 @@ var C = (e, t = "#") => ({
|
|
|
348
348
|
eyebrow: "Our mission",
|
|
349
349
|
headline: "Together, we can change what happens next",
|
|
350
350
|
text: "Every gift and every hour given goes straight to the people who need it most.",
|
|
351
|
-
cta:
|
|
352
|
-
cta2:
|
|
351
|
+
cta: S("Get involved", "/contact"),
|
|
352
|
+
cta2: S("Our story", "/about")
|
|
353
353
|
}
|
|
354
354
|
},
|
|
355
355
|
{
|
|
@@ -403,8 +403,8 @@ var C = (e, t = "#") => ({
|
|
|
403
403
|
eyebrow: "Welcome",
|
|
404
404
|
headline: "Come for the experience, stay for the people",
|
|
405
405
|
text: "Good food, warm company and a table waiting for you.",
|
|
406
|
-
cta:
|
|
407
|
-
cta2:
|
|
406
|
+
cta: S("Book a table", "/contact"),
|
|
407
|
+
cta2: S("See the menu", "/menu")
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
{
|
|
@@ -455,8 +455,8 @@ var C = (e, t = "#") => ({
|
|
|
455
455
|
eyebrow: "Now open",
|
|
456
456
|
headline: "The easiest way to get started today",
|
|
457
457
|
text: "Everything you need in one place, set up in minutes. No experience required.",
|
|
458
|
-
cta:
|
|
459
|
-
cta2:
|
|
458
|
+
cta: S("Start free", "#pricing"),
|
|
459
|
+
cta2: S("See how it works", "#how")
|
|
460
460
|
}
|
|
461
461
|
},
|
|
462
462
|
{
|
|
@@ -509,7 +509,7 @@ var C = (e, t = "#") => ({
|
|
|
509
509
|
eyebrow: "Coming soon",
|
|
510
510
|
headline: "Something new is on its way",
|
|
511
511
|
text: "Be the first to know when we open the doors — and get early-bird perks.",
|
|
512
|
-
cta:
|
|
512
|
+
cta: S("Join the waitlist")
|
|
513
513
|
}
|
|
514
514
|
},
|
|
515
515
|
{
|
|
@@ -551,8 +551,8 @@ var C = (e, t = "#") => ({
|
|
|
551
551
|
eyebrow: "Enrolment open",
|
|
552
552
|
headline: "Learn the skill that changes everything",
|
|
553
553
|
text: "A clear, step-by-step programme you can follow at your own pace.",
|
|
554
|
-
cta:
|
|
555
|
-
cta2:
|
|
554
|
+
cta: S("Enrol now", "#buy"),
|
|
555
|
+
cta2: S("What you will learn", "#learn")
|
|
556
556
|
}
|
|
557
557
|
},
|
|
558
558
|
{
|
|
@@ -599,8 +599,8 @@ var C = (e, t = "#") => ({
|
|
|
599
599
|
eyebrow: "About us",
|
|
600
600
|
headline: "The people behind the work",
|
|
601
601
|
text: "We are a small team who care a great deal about doing things well. Here is who we are and what we believe.",
|
|
602
|
-
cta:
|
|
603
|
-
cta2:
|
|
602
|
+
cta: C,
|
|
603
|
+
cta2: C
|
|
604
604
|
}
|
|
605
605
|
},
|
|
606
606
|
{
|
|
@@ -621,7 +621,7 @@ var C = (e, t = "#") => ({
|
|
|
621
621
|
content: {
|
|
622
622
|
heading: "Want to work with us?",
|
|
623
623
|
text: "We would love to hear what you have in mind.",
|
|
624
|
-
cta:
|
|
624
|
+
cta: S("Get in touch", "/contact")
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
]
|
|
@@ -653,8 +653,8 @@ var C = (e, t = "#") => ({
|
|
|
653
653
|
eyebrow: "Our story",
|
|
654
654
|
headline: "It started with a simple idea",
|
|
655
655
|
text: "How we began, what drives us, and why we still love what we do.",
|
|
656
|
-
cta:
|
|
657
|
-
cta2:
|
|
656
|
+
cta: C,
|
|
657
|
+
cta2: C
|
|
658
658
|
}
|
|
659
659
|
},
|
|
660
660
|
{
|
|
@@ -702,8 +702,8 @@ var C = (e, t = "#") => ({
|
|
|
702
702
|
eyebrow: "Our services",
|
|
703
703
|
headline: "Everything you need, handled for you",
|
|
704
704
|
text: "From the first conversation to the finished job, we keep things clear, fair and friendly.",
|
|
705
|
-
cta:
|
|
706
|
-
cta2:
|
|
705
|
+
cta: S("Ask for a quote", "/contact"),
|
|
706
|
+
cta2: C
|
|
707
707
|
}
|
|
708
708
|
},
|
|
709
709
|
{
|
|
@@ -754,8 +754,8 @@ var C = (e, t = "#") => ({
|
|
|
754
754
|
eyebrow: "What we offer",
|
|
755
755
|
headline: "Find the right service for you",
|
|
756
756
|
text: "Every service is tailored to you — just pick a starting point and we will do the rest.",
|
|
757
|
-
cta:
|
|
758
|
-
cta2:
|
|
757
|
+
cta: S("Book now", "/contact"),
|
|
758
|
+
cta2: C
|
|
759
759
|
}
|
|
760
760
|
},
|
|
761
761
|
{
|
|
@@ -803,8 +803,8 @@ var C = (e, t = "#") => ({
|
|
|
803
803
|
eyebrow: "Pricing",
|
|
804
804
|
headline: "Simple prices, no surprises",
|
|
805
805
|
text: "Pick the plan that fits today. You can change or stop whenever you like.",
|
|
806
|
-
cta:
|
|
807
|
-
cta2:
|
|
806
|
+
cta: C,
|
|
807
|
+
cta2: C
|
|
808
808
|
}
|
|
809
809
|
},
|
|
810
810
|
{
|
|
@@ -846,8 +846,8 @@ var C = (e, t = "#") => ({
|
|
|
846
846
|
eyebrow: "Prices",
|
|
847
847
|
headline: "Fair, upfront prices",
|
|
848
848
|
text: "No hidden fees. Here is exactly what each option includes.",
|
|
849
|
-
cta:
|
|
850
|
-
cta2:
|
|
849
|
+
cta: C,
|
|
850
|
+
cta2: C
|
|
851
851
|
}
|
|
852
852
|
},
|
|
853
853
|
{
|
|
@@ -920,8 +920,8 @@ var C = (e, t = "#") => ({
|
|
|
920
920
|
eyebrow: "Visit us",
|
|
921
921
|
headline: "We would love to see you",
|
|
922
922
|
text: "Pop in, call ahead or send a message — whatever suits you.",
|
|
923
|
-
cta:
|
|
924
|
-
cta2:
|
|
923
|
+
cta: C,
|
|
924
|
+
cta2: C
|
|
925
925
|
}
|
|
926
926
|
},
|
|
927
927
|
{
|
|
@@ -964,7 +964,7 @@ var C = (e, t = "#") => ({
|
|
|
964
964
|
eyebrow: "Shop",
|
|
965
965
|
heading: "Shop everything",
|
|
966
966
|
text: "Browse the full collection — new pieces added every week.",
|
|
967
|
-
cta:
|
|
967
|
+
cta: C
|
|
968
968
|
}
|
|
969
969
|
},
|
|
970
970
|
{
|
|
@@ -1027,8 +1027,8 @@ var C = (e, t = "#") => ({
|
|
|
1027
1027
|
eyebrow: "The collection",
|
|
1028
1028
|
headline: "Pieces worth keeping",
|
|
1029
1029
|
text: "Small batches, made with care.",
|
|
1030
|
-
cta:
|
|
1031
|
-
cta2:
|
|
1030
|
+
cta: C,
|
|
1031
|
+
cta2: C
|
|
1032
1032
|
}
|
|
1033
1033
|
},
|
|
1034
1034
|
{
|
|
@@ -1038,7 +1038,7 @@ var C = (e, t = "#") => ({
|
|
|
1038
1038
|
eyebrow: "",
|
|
1039
1039
|
heading: "Shop the collection",
|
|
1040
1040
|
text: "",
|
|
1041
|
-
cta:
|
|
1041
|
+
cta: C
|
|
1042
1042
|
}
|
|
1043
1043
|
},
|
|
1044
1044
|
{
|
|
@@ -1153,8 +1153,8 @@ var C = (e, t = "#") => ({
|
|
|
1153
1153
|
eyebrow: "Read",
|
|
1154
1154
|
headline: "Fresh thinking, every week",
|
|
1155
1155
|
text: "Guides, stories and behind-the-scenes from the team.",
|
|
1156
|
-
cta:
|
|
1157
|
-
cta2:
|
|
1156
|
+
cta: C,
|
|
1157
|
+
cta2: C
|
|
1158
1158
|
}
|
|
1159
1159
|
},
|
|
1160
1160
|
{
|
|
@@ -1189,7 +1189,7 @@ var C = (e, t = "#") => ({
|
|
|
1189
1189
|
sections: [{
|
|
1190
1190
|
kind: "blogArticle",
|
|
1191
1191
|
variant: "classic",
|
|
1192
|
-
content: { back:
|
|
1192
|
+
content: { back: S("Back to all posts", "/blog") }
|
|
1193
1193
|
}, {
|
|
1194
1194
|
kind: "cta",
|
|
1195
1195
|
variant: "signup",
|
|
@@ -1216,7 +1216,7 @@ var C = (e, t = "#") => ({
|
|
|
1216
1216
|
sections: [{
|
|
1217
1217
|
kind: "blogArticle",
|
|
1218
1218
|
variant: "picture-first",
|
|
1219
|
-
content: { back:
|
|
1219
|
+
content: { back: S("Back to all posts", "/blog") }
|
|
1220
1220
|
}, {
|
|
1221
1221
|
kind: "cta",
|
|
1222
1222
|
variant: "card"
|
|
@@ -1244,8 +1244,8 @@ var C = (e, t = "#") => ({
|
|
|
1244
1244
|
eyebrow: "Help",
|
|
1245
1245
|
headline: "Questions, answered",
|
|
1246
1246
|
text: "Everything people usually ask. Can’t find yours? Just ask us.",
|
|
1247
|
-
cta:
|
|
1248
|
-
cta2:
|
|
1247
|
+
cta: C,
|
|
1248
|
+
cta2: C
|
|
1249
1249
|
}
|
|
1250
1250
|
},
|
|
1251
1251
|
{
|
|
@@ -1258,7 +1258,7 @@ var C = (e, t = "#") => ({
|
|
|
1258
1258
|
content: {
|
|
1259
1259
|
heading: "Still wondering?",
|
|
1260
1260
|
text: "Send us a message and a real person will reply.",
|
|
1261
|
-
cta:
|
|
1261
|
+
cta: S("Contact us", "/contact")
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
]
|
|
@@ -1290,8 +1290,8 @@ var C = (e, t = "#") => ({
|
|
|
1290
1290
|
eyebrow: "Our work",
|
|
1291
1291
|
headline: "A few things we are proud of",
|
|
1292
1292
|
text: "A selection of recent projects.",
|
|
1293
|
-
cta:
|
|
1294
|
-
cta2:
|
|
1293
|
+
cta: C,
|
|
1294
|
+
cta2: C
|
|
1295
1295
|
}
|
|
1296
1296
|
},
|
|
1297
1297
|
{
|
|
@@ -1309,7 +1309,7 @@ var C = (e, t = "#") => ({
|
|
|
1309
1309
|
content: {
|
|
1310
1310
|
heading: "Have a project in mind?",
|
|
1311
1311
|
text: "Tell us about it — we reply within a day.",
|
|
1312
|
-
cta:
|
|
1312
|
+
cta: S("Start a project", "/contact")
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
1315
|
]
|
|
@@ -1334,8 +1334,8 @@ var C = (e, t = "#") => ({
|
|
|
1334
1334
|
eyebrow: "Our team",
|
|
1335
1335
|
headline: "Meet the people who make it happen",
|
|
1336
1336
|
text: "Friendly faces, serious skills.",
|
|
1337
|
-
cta:
|
|
1338
|
-
cta2:
|
|
1337
|
+
cta: C,
|
|
1338
|
+
cta2: C
|
|
1339
1339
|
}
|
|
1340
1340
|
},
|
|
1341
1341
|
{
|
|
@@ -1353,7 +1353,7 @@ var C = (e, t = "#") => ({
|
|
|
1353
1353
|
content: {
|
|
1354
1354
|
heading: "Want to work with us?",
|
|
1355
1355
|
text: "We are always happy to meet good people.",
|
|
1356
|
-
cta:
|
|
1356
|
+
cta: S("Get in touch", "/contact")
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
]
|
|
@@ -1383,8 +1383,8 @@ var C = (e, t = "#") => ({
|
|
|
1383
1383
|
eyebrow: "Menu",
|
|
1384
1384
|
headline: "Made fresh, every day",
|
|
1385
1385
|
text: "Seasonal ingredients, cooked with care. Ask us about allergies — we are happy to help.",
|
|
1386
|
-
cta:
|
|
1387
|
-
cta2:
|
|
1386
|
+
cta: C,
|
|
1387
|
+
cta2: C
|
|
1388
1388
|
}
|
|
1389
1389
|
},
|
|
1390
1390
|
{
|
|
@@ -1402,7 +1402,7 @@ var C = (e, t = "#") => ({
|
|
|
1402
1402
|
period: "",
|
|
1403
1403
|
description: "With fresh bread and butter.",
|
|
1404
1404
|
features: "",
|
|
1405
|
-
cta:
|
|
1405
|
+
cta: C,
|
|
1406
1406
|
highlighted: !1
|
|
1407
1407
|
},
|
|
1408
1408
|
{
|
|
@@ -1411,7 +1411,7 @@ var C = (e, t = "#") => ({
|
|
|
1411
1411
|
period: "",
|
|
1412
1412
|
description: "Our most-loved dish, slow cooked.",
|
|
1413
1413
|
features: "",
|
|
1414
|
-
cta:
|
|
1414
|
+
cta: C,
|
|
1415
1415
|
highlighted: !0
|
|
1416
1416
|
},
|
|
1417
1417
|
{
|
|
@@ -1420,7 +1420,7 @@ var C = (e, t = "#") => ({
|
|
|
1420
1420
|
period: "",
|
|
1421
1421
|
description: "Roasted vegetables, grains and herbs.",
|
|
1422
1422
|
features: "",
|
|
1423
|
-
cta:
|
|
1423
|
+
cta: C,
|
|
1424
1424
|
highlighted: !1
|
|
1425
1425
|
}
|
|
1426
1426
|
]
|
|
@@ -1437,7 +1437,7 @@ var C = (e, t = "#") => ({
|
|
|
1437
1437
|
content: {
|
|
1438
1438
|
heading: "Book your table",
|
|
1439
1439
|
text: "Walk-ins welcome, bookings recommended at weekends.",
|
|
1440
|
-
cta:
|
|
1440
|
+
cta: S("Book now", "/contact")
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
1443
|
]
|
|
@@ -1463,8 +1463,8 @@ var C = (e, t = "#") => ({
|
|
|
1463
1463
|
eyebrow: "Reviews",
|
|
1464
1464
|
headline: "Don’t just take our word for it",
|
|
1465
1465
|
text: "Real words from real customers.",
|
|
1466
|
-
cta:
|
|
1467
|
-
cta2:
|
|
1466
|
+
cta: C,
|
|
1467
|
+
cta2: C
|
|
1468
1468
|
}
|
|
1469
1469
|
},
|
|
1470
1470
|
{
|
|
@@ -1482,10 +1482,10 @@ var C = (e, t = "#") => ({
|
|
|
1482
1482
|
}
|
|
1483
1483
|
]
|
|
1484
1484
|
}
|
|
1485
|
-
],
|
|
1485
|
+
], T = (e, t = "#") => ({
|
|
1486
1486
|
label: e,
|
|
1487
1487
|
href: t
|
|
1488
|
-
}),
|
|
1488
|
+
}), Me = [
|
|
1489
1489
|
{
|
|
1490
1490
|
id: "blank",
|
|
1491
1491
|
name: "Blank page",
|
|
@@ -1502,7 +1502,7 @@ var C = (e, t = "#") => ({
|
|
|
1502
1502
|
variant: "bar",
|
|
1503
1503
|
content: {
|
|
1504
1504
|
text: "New: book online in under a minute.",
|
|
1505
|
-
link:
|
|
1505
|
+
link: T("Book now")
|
|
1506
1506
|
}
|
|
1507
1507
|
},
|
|
1508
1508
|
{
|
|
@@ -1512,8 +1512,8 @@ var C = (e, t = "#") => ({
|
|
|
1512
1512
|
eyebrow: "Welcome",
|
|
1513
1513
|
headline: "Friendly service you can count on",
|
|
1514
1514
|
text: "We make it simple to get what you need, done properly the first time. Have a look around, then say hello.",
|
|
1515
|
-
cta:
|
|
1516
|
-
cta2:
|
|
1515
|
+
cta: T("Get started"),
|
|
1516
|
+
cta2: T("Learn more")
|
|
1517
1517
|
}
|
|
1518
1518
|
},
|
|
1519
1519
|
{
|
|
@@ -1552,8 +1552,8 @@ var C = (e, t = "#") => ({
|
|
|
1552
1552
|
eyebrow: "Now open",
|
|
1553
1553
|
headline: "The easiest way to get started today",
|
|
1554
1554
|
text: "Everything you need in one place, set up in minutes. No experience required.",
|
|
1555
|
-
cta:
|
|
1556
|
-
cta2:
|
|
1555
|
+
cta: T("Start free"),
|
|
1556
|
+
cta2: T("See how it works")
|
|
1557
1557
|
}
|
|
1558
1558
|
},
|
|
1559
1559
|
{
|
|
@@ -1622,7 +1622,7 @@ var C = (e, t = "#") => ({
|
|
|
1622
1622
|
content: {
|
|
1623
1623
|
heading: "Want to work with us?",
|
|
1624
1624
|
text: "We would love to hear what you have in mind.",
|
|
1625
|
-
cta:
|
|
1625
|
+
cta: T("Get in touch", "/contact")
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
1628
|
]
|
|
@@ -1639,8 +1639,8 @@ var C = (e, t = "#") => ({
|
|
|
1639
1639
|
eyebrow: "Our services",
|
|
1640
1640
|
headline: "Everything you need, handled for you",
|
|
1641
1641
|
text: "From the first conversation to the finished job, we keep things clear, fair and friendly.",
|
|
1642
|
-
cta:
|
|
1643
|
-
cta2:
|
|
1642
|
+
cta: T("Ask for a quote", "/contact"),
|
|
1643
|
+
cta2: T("See pricing")
|
|
1644
1644
|
}
|
|
1645
1645
|
},
|
|
1646
1646
|
{
|
|
@@ -1716,8 +1716,8 @@ var C = (e, t = "#") => ({
|
|
|
1716
1716
|
}
|
|
1717
1717
|
]
|
|
1718
1718
|
}
|
|
1719
|
-
],
|
|
1720
|
-
let r =
|
|
1719
|
+
], E = (e, t, n) => {
|
|
1720
|
+
let r = w.find((e) => e.id === t);
|
|
1721
1721
|
return {
|
|
1722
1722
|
id: e,
|
|
1723
1723
|
name: n,
|
|
@@ -1725,17 +1725,17 @@ var C = (e, t = "#") => ({
|
|
|
1725
1725
|
sections: r.sections
|
|
1726
1726
|
};
|
|
1727
1727
|
};
|
|
1728
|
-
|
|
1729
|
-
var
|
|
1728
|
+
Me.push(E("store", "store-grid", "Shop"), E("blog", "blog-journal", "Blog"), E("product", "product-spotlight", "Product"), E("faq", "faq-page", "FAQ"), E("gallery", "gallery-portfolio", "Gallery"), E("team", "team-page", "Team"), E("menu", "menu-page", "Menu"));
|
|
1729
|
+
var Ne = /* @__PURE__ */ new Set([
|
|
1730
1730
|
"store",
|
|
1731
1731
|
"blog",
|
|
1732
1732
|
"product"
|
|
1733
|
-
]),
|
|
1733
|
+
]), Pe = new Map(Me.map((e) => [e.id, e])), Fe = new Map(w.map((e) => [e.id, {
|
|
1734
1734
|
id: e.id,
|
|
1735
1735
|
name: e.name,
|
|
1736
1736
|
description: e.description,
|
|
1737
1737
|
sections: e.sections
|
|
1738
|
-
}])),
|
|
1738
|
+
}])), Ie = (e) => Pe.get(e) ?? Fe.get(e) ?? Me[0], Le = (e) => Pe.has(e) || Fe.has(e), Re = {
|
|
1739
1739
|
announcement: "Announcement",
|
|
1740
1740
|
header: "Menu",
|
|
1741
1741
|
hero: "Opening",
|
|
@@ -1770,15 +1770,15 @@ var Me = /* @__PURE__ */ new Set([
|
|
|
1770
1770
|
emailImage: "Picture",
|
|
1771
1771
|
emailFooter: "Footer"
|
|
1772
1772
|
};
|
|
1773
|
-
function
|
|
1774
|
-
return
|
|
1773
|
+
function ze() {
|
|
1774
|
+
return Me.map((e) => ({
|
|
1775
1775
|
id: e.id,
|
|
1776
1776
|
name: e.name,
|
|
1777
1777
|
description: e.description,
|
|
1778
|
-
sections:
|
|
1778
|
+
sections: Be(e).map((e) => Re[e])
|
|
1779
1779
|
}));
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function Be(e) {
|
|
1782
1782
|
if (!e.sections.length) return [];
|
|
1783
1783
|
let t = e.sections.map((e) => e.kind);
|
|
1784
1784
|
return [
|
|
@@ -1787,11 +1787,11 @@ function ze(e) {
|
|
|
1787
1787
|
...t[t.length - 1] === "footer" ? [] : ["footer"]
|
|
1788
1788
|
];
|
|
1789
1789
|
}
|
|
1790
|
-
var
|
|
1791
|
-
function
|
|
1792
|
-
let n =
|
|
1790
|
+
var Ve = (e) => `tpl-${Ie(e).id}`, He = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
|
|
1791
|
+
function Ue(e, t = {}) {
|
|
1792
|
+
let n = Ie(e), r = t.sections ?? n.sections;
|
|
1793
1793
|
if (!r.length) return [];
|
|
1794
|
-
let i = t.seed ??
|
|
1794
|
+
let i = t.seed ?? Ve(n.id), a = t.brand?.trim() || t.designSystem?.name?.trim(), o = [...r];
|
|
1795
1795
|
if (t.chrome === !1) {
|
|
1796
1796
|
for (; o.length && o[0].kind === "header";) o.shift();
|
|
1797
1797
|
for (; o.length && o[o.length - 1].kind === "footer";) o.pop();
|
|
@@ -1803,13 +1803,13 @@ function He(e, t = {}) {
|
|
|
1803
1803
|
variant: "columns"
|
|
1804
1804
|
});
|
|
1805
1805
|
return o.map((e, n) => {
|
|
1806
|
-
let r =
|
|
1806
|
+
let r = ye(e.kind, e.variant), o = e.kind === "header" ? t.chromeContent?.header : e.kind === "footer" ? t.chromeContent?.footer : void 0, s = {
|
|
1807
1807
|
...r.content,
|
|
1808
1808
|
...a && (e.kind === "header" || e.kind === "footer") ? { brand: a } : {},
|
|
1809
1809
|
...e.content ?? {},
|
|
1810
1810
|
...o ?? {}
|
|
1811
1811
|
};
|
|
1812
|
-
return
|
|
1812
|
+
return g({
|
|
1813
1813
|
...r,
|
|
1814
1814
|
content: s,
|
|
1815
1815
|
style: {
|
|
@@ -1819,11 +1819,11 @@ function He(e, t = {}) {
|
|
|
1819
1819
|
}, `${i}-s${n + 1}`);
|
|
1820
1820
|
});
|
|
1821
1821
|
}
|
|
1822
|
-
function
|
|
1823
|
-
return
|
|
1822
|
+
function We(e) {
|
|
1823
|
+
return ue(e).every((e) => !_(e) && !e.children?.length);
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1826
|
-
let n =
|
|
1825
|
+
function Ge(e, t) {
|
|
1826
|
+
let n = Ie(e), r = t.seed ?? Ve(n.id), i = {
|
|
1827
1827
|
id: `${r}-page`,
|
|
1828
1828
|
type: "page",
|
|
1829
1829
|
name: t.name,
|
|
@@ -1831,7 +1831,7 @@ function We(e, t) {
|
|
|
1831
1831
|
backgroundColor: "var(--color-bg-canvas)",
|
|
1832
1832
|
textColor: "var(--color-text-primary)"
|
|
1833
1833
|
},
|
|
1834
|
-
children:
|
|
1834
|
+
children: Ue(n.id, {
|
|
1835
1835
|
seed: r,
|
|
1836
1836
|
designSystem: t.designSystem,
|
|
1837
1837
|
chrome: t.chrome,
|
|
@@ -1843,13 +1843,13 @@ function We(e, t) {
|
|
|
1843
1843
|
return {
|
|
1844
1844
|
id: `${r}-def`,
|
|
1845
1845
|
name: t.name,
|
|
1846
|
-
slug: t.slug ??
|
|
1846
|
+
slug: t.slug ?? He(t.name),
|
|
1847
1847
|
rootNode: i
|
|
1848
1848
|
};
|
|
1849
1849
|
}
|
|
1850
1850
|
//#endregion
|
|
1851
1851
|
//#region src/v2/sol/catalogSchema.ts
|
|
1852
|
-
var
|
|
1852
|
+
var Ke = (e, t) => ({
|
|
1853
1853
|
path: t,
|
|
1854
1854
|
type: e.type,
|
|
1855
1855
|
label: e.label,
|
|
@@ -1860,13 +1860,13 @@ var Ge = (e, t) => ({
|
|
|
1860
1860
|
itemName: e.itemName,
|
|
1861
1861
|
min: e.min,
|
|
1862
1862
|
limit: e.limit,
|
|
1863
|
-
itemFields: (e.item ?? []).map((e) =>
|
|
1863
|
+
itemFields: (e.item ?? []).map((e) => Ke(e, e.key))
|
|
1864
1864
|
} : {}
|
|
1865
1865
|
});
|
|
1866
|
-
function
|
|
1866
|
+
function qe() {
|
|
1867
1867
|
return {
|
|
1868
|
-
pageTemplates:
|
|
1869
|
-
kinds:
|
|
1868
|
+
pageTemplates: ze(),
|
|
1869
|
+
kinds: xe.map((e) => ({
|
|
1870
1870
|
kind: e.kind,
|
|
1871
1871
|
name: e.label,
|
|
1872
1872
|
description: e.description,
|
|
@@ -1878,7 +1878,7 @@ function Ke() {
|
|
|
1878
1878
|
...e.uses ? { fields: e.uses } : {},
|
|
1879
1879
|
...e.backgrounds ? { backgrounds: e.backgrounds } : {}
|
|
1880
1880
|
})),
|
|
1881
|
-
fields: e.fields.map((e) =>
|
|
1881
|
+
fields: e.fields.map((e) => Ke(e, e.key))
|
|
1882
1882
|
})),
|
|
1883
1883
|
style: {
|
|
1884
1884
|
background: [
|
|
@@ -1901,7 +1901,7 @@ function Ke() {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
//#endregion
|
|
1903
1903
|
//#region src/v2/design/themes.ts
|
|
1904
|
-
var
|
|
1904
|
+
var Je = [
|
|
1905
1905
|
0,
|
|
1906
1906
|
50,
|
|
1907
1907
|
100,
|
|
@@ -1913,7 +1913,7 @@ var qe = [
|
|
|
1913
1913
|
700,
|
|
1914
1914
|
800,
|
|
1915
1915
|
900
|
|
1916
|
-
].map((e) => `--color-neutral-${e}`),
|
|
1916
|
+
].map((e) => `--color-neutral-${e}`), D = {
|
|
1917
1917
|
cool: [
|
|
1918
1918
|
"#FFFFFF",
|
|
1919
1919
|
"#F9FAFB",
|
|
@@ -1953,7 +1953,7 @@ var qe = [
|
|
|
1953
1953
|
"#E6EAF2",
|
|
1954
1954
|
"#F5F7FB"
|
|
1955
1955
|
]
|
|
1956
|
-
},
|
|
1956
|
+
}, Ye = {
|
|
1957
1957
|
sharp: {
|
|
1958
1958
|
"--radius-xs": "0",
|
|
1959
1959
|
"--radius-sm": "0",
|
|
@@ -1979,28 +1979,28 @@ var qe = [
|
|
|
1979
1979
|
"--radius-2xl": "32"
|
|
1980
1980
|
}
|
|
1981
1981
|
};
|
|
1982
|
-
function
|
|
1983
|
-
let n =
|
|
1982
|
+
function Xe(e, t) {
|
|
1983
|
+
let n = oe(t);
|
|
1984
1984
|
if (!n) return e;
|
|
1985
|
-
let r =
|
|
1985
|
+
let r = b(e, {
|
|
1986
1986
|
"--color-brand-primary-300": n.light,
|
|
1987
1987
|
"--color-brand-primary-500": n.base,
|
|
1988
1988
|
"--color-brand-primary-700": n.dark
|
|
1989
1989
|
});
|
|
1990
|
-
r =
|
|
1991
|
-
let { r: i, g: a, b: o } =
|
|
1992
|
-
return r =
|
|
1990
|
+
r = y(r, "--color-action-primary-text", x(ve(n.base) === "#FFFFFF" ? "--color-neutral-0" : "--color-neutral-900"));
|
|
1991
|
+
let { r: i, g: a, b: o } = Qe(n.base);
|
|
1992
|
+
return r = y(r, "--shadow-focus", `0 0 0 3px rgba(${i}, ${a}, ${o}, 0.18)`, {
|
|
1993
1993
|
type: "shadow",
|
|
1994
1994
|
layer: "brand",
|
|
1995
1995
|
name: "Shadow Focus",
|
|
1996
1996
|
comment: "Focus ring glow, in the brand colour"
|
|
1997
|
-
}), r.options?.brandSurfaces ?
|
|
1997
|
+
}), r.options?.brandSurfaces ? nt(r, n.base) : r;
|
|
1998
1998
|
}
|
|
1999
|
-
function
|
|
2000
|
-
let n =
|
|
2001
|
-
return n ?
|
|
1999
|
+
function Ze(e, t) {
|
|
2000
|
+
let n = oe(t);
|
|
2001
|
+
return n ? y(e, "--color-brand-secondary-500", n.base) : e;
|
|
2002
2002
|
}
|
|
2003
|
-
function
|
|
2003
|
+
function Qe(e) {
|
|
2004
2004
|
let t = e.replace("#", "");
|
|
2005
2005
|
return {
|
|
2006
2006
|
r: parseInt(t.slice(0, 2), 16),
|
|
@@ -2008,26 +2008,26 @@ function Ze(e) {
|
|
|
2008
2008
|
b: parseInt(t.slice(4, 6), 16)
|
|
2009
2009
|
};
|
|
2010
2010
|
}
|
|
2011
|
-
function
|
|
2012
|
-
return e.options?.brandSurfaces ? "brand" : e.tokens.find((e) => e.key === "--color-neutral-0")?.value.toLowerCase() ===
|
|
2011
|
+
function $e(e) {
|
|
2012
|
+
return e.options?.brandSurfaces ? "brand" : e.tokens.find((e) => e.key === "--color-neutral-0")?.value.toLowerCase() === D.dark[0].toLowerCase() ? "dark" : e.tokens.find((e) => e.key === "--color-neutral-50")?.value.toLowerCase() === D.warm[1].toLowerCase() ? "warm" : "cool";
|
|
2013
2013
|
}
|
|
2014
|
-
var
|
|
2015
|
-
"--color-text-muted":
|
|
2016
|
-
"--color-bg-canvas":
|
|
2017
|
-
"--color-bg-surface":
|
|
2018
|
-
"--color-bg-elevated":
|
|
2019
|
-
"--color-bg-sunken":
|
|
2014
|
+
var et = {
|
|
2015
|
+
"--color-text-muted": x("--color-neutral-500"),
|
|
2016
|
+
"--color-bg-canvas": x("--color-neutral-50"),
|
|
2017
|
+
"--color-bg-surface": x("--color-neutral-0"),
|
|
2018
|
+
"--color-bg-elevated": x("--color-neutral-0"),
|
|
2019
|
+
"--color-bg-sunken": x("--color-neutral-100")
|
|
2020
2020
|
};
|
|
2021
|
-
function
|
|
2022
|
-
if (t === "brand") return
|
|
2023
|
-
let n =
|
|
2024
|
-
"--color-text-muted":
|
|
2025
|
-
"--color-bg-canvas":
|
|
2026
|
-
"--color-bg-surface":
|
|
2027
|
-
"--color-bg-elevated":
|
|
2028
|
-
"--color-bg-sunken":
|
|
2029
|
-
} :
|
|
2030
|
-
if (n =
|
|
2021
|
+
function tt(e, t) {
|
|
2022
|
+
if (t === "brand") return rt(e, !0);
|
|
2023
|
+
let n = b(e, Object.fromEntries(Je.map((e, n) => [e, D[t][n]]))), r = t === "dark" ? {
|
|
2024
|
+
"--color-text-muted": x("--color-neutral-500"),
|
|
2025
|
+
"--color-bg-canvas": x("--color-neutral-0"),
|
|
2026
|
+
"--color-bg-surface": x("--color-neutral-100"),
|
|
2027
|
+
"--color-bg-elevated": x("--color-neutral-200"),
|
|
2028
|
+
"--color-bg-sunken": x("--color-neutral-50")
|
|
2029
|
+
} : et;
|
|
2030
|
+
if (n = b(n, r), n = y(n, "--color-scheme", t === "dark" ? "dark" : "light"), n.options?.brandSurfaces) {
|
|
2031
2031
|
let { brandSurfaces: e, ...t } = n.options;
|
|
2032
2032
|
n = {
|
|
2033
2033
|
...n,
|
|
@@ -2036,11 +2036,11 @@ function et(e, t) {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
return n;
|
|
2038
2038
|
}
|
|
2039
|
-
function
|
|
2040
|
-
let n =
|
|
2039
|
+
function nt(e, t) {
|
|
2040
|
+
let n = le(t);
|
|
2041
2041
|
if (!n) return e;
|
|
2042
|
-
let r =
|
|
2043
|
-
return r =
|
|
2042
|
+
let r = b(e, Object.fromEntries(Je.map((e, t) => [e, n[t]])));
|
|
2043
|
+
return r = b(r, et), r = y(r, "--color-scheme", "light"), {
|
|
2044
2044
|
...r,
|
|
2045
2045
|
options: {
|
|
2046
2046
|
...r.options,
|
|
@@ -2048,34 +2048,34 @@ function tt(e, t) {
|
|
|
2048
2048
|
}
|
|
2049
2049
|
};
|
|
2050
2050
|
}
|
|
2051
|
-
function nt(e, t) {
|
|
2052
|
-
if (t) return tt(e, e.tokens.find((e) => e.key === "--color-brand-primary-500")?.value ?? "#266DDC");
|
|
2053
|
-
let n = st.find((t) => t.id === e.options?.themeId)?.neutrals;
|
|
2054
|
-
return et(e, n && n !== "brand" ? n : "cool");
|
|
2055
|
-
}
|
|
2056
2051
|
function rt(e, t) {
|
|
2052
|
+
if (t) return nt(e, e.tokens.find((e) => e.key === "--color-brand-primary-500")?.value ?? "#266DDC");
|
|
2053
|
+
let n = ct.find((t) => t.id === e.options?.themeId)?.neutrals;
|
|
2054
|
+
return tt(e, n && n !== "brand" ? n : "cool");
|
|
2055
|
+
}
|
|
2056
|
+
function it(e, t) {
|
|
2057
2057
|
if (e.neutrals === "dark") return {
|
|
2058
|
-
page:
|
|
2059
|
-
section:
|
|
2058
|
+
page: D.dark[0],
|
|
2059
|
+
section: D.dark[2]
|
|
2060
2060
|
};
|
|
2061
|
-
let n = t ?
|
|
2061
|
+
let n = t ? le(e.primary) ?? D.cool : D[e.neutrals === "brand" ? "cool" : e.neutrals];
|
|
2062
2062
|
return {
|
|
2063
2063
|
page: n[0],
|
|
2064
2064
|
section: n[10]
|
|
2065
2065
|
};
|
|
2066
2066
|
}
|
|
2067
|
-
function
|
|
2068
|
-
return
|
|
2067
|
+
function at(e, t) {
|
|
2068
|
+
return b(e, Ye[t]);
|
|
2069
2069
|
}
|
|
2070
|
-
function
|
|
2070
|
+
function ot(e) {
|
|
2071
2071
|
let t = e.tokens.find((e) => e.key === "--radius-md")?.value;
|
|
2072
2072
|
return t === "2" || t === "0" ? "sharp" : t === "12" ? "round" : "soft";
|
|
2073
2073
|
}
|
|
2074
|
-
function
|
|
2074
|
+
function st(e, t) {
|
|
2075
2075
|
let n = e;
|
|
2076
|
-
return t.heading && (n =
|
|
2076
|
+
return t.heading && (n = y(n, "--font-family-heading", we(t.heading), { type: "font family" })), t.body && (n = y(n, "--font-family-body", we(t.body), { type: "font family" }), n = y(n, "--font-family-sans", we(t.body), { type: "font family" })), n;
|
|
2077
2077
|
}
|
|
2078
|
-
var
|
|
2078
|
+
var ct = [
|
|
2079
2079
|
{
|
|
2080
2080
|
id: "default",
|
|
2081
2081
|
name: "Classic blue",
|
|
@@ -2181,9 +2181,9 @@ var st = [
|
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
2183
|
];
|
|
2184
|
-
function
|
|
2185
|
-
let n = !!e.options?.brandSurfaces && t.neutrals !== "dark", r =
|
|
2186
|
-
return r =
|
|
2184
|
+
function lt(e, t) {
|
|
2185
|
+
let n = !!e.options?.brandSurfaces && t.neutrals !== "dark", r = tt(e, t.neutrals);
|
|
2186
|
+
return r = Xe(r, t.primary), n && (r = nt(r, t.primary)), r = Ze(r, t.secondary), r = at(r, t.roundness), r = st(r, t.fonts), {
|
|
2187
2187
|
...r,
|
|
2188
2188
|
options: {
|
|
2189
2189
|
...r.options,
|
|
@@ -2191,14 +2191,14 @@ function ct(e, t) {
|
|
|
2191
2191
|
}
|
|
2192
2192
|
};
|
|
2193
2193
|
}
|
|
2194
|
-
function
|
|
2195
|
-
let r =
|
|
2196
|
-
return r ?
|
|
2194
|
+
function ut(e, t, n) {
|
|
2195
|
+
let r = oe(n);
|
|
2196
|
+
return r ? b(e, {
|
|
2197
2197
|
[`--color-raw-${t}`]: r.base,
|
|
2198
|
-
[`--color-raw-${t}-light`]:
|
|
2198
|
+
[`--color-raw-${t}-light`]: ae(r.base, .88)
|
|
2199
2199
|
}) : e;
|
|
2200
2200
|
}
|
|
2201
|
-
function
|
|
2201
|
+
function dt(e, t) {
|
|
2202
2202
|
return {
|
|
2203
2203
|
...e,
|
|
2204
2204
|
options: {
|
|
@@ -2209,27 +2209,27 @@ function ut(e, t) {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
//#endregion
|
|
2211
2211
|
//#region src/v2/sol/describe.ts
|
|
2212
|
-
var
|
|
2213
|
-
function
|
|
2212
|
+
var ft = (e, t = 60) => e.length > t ? `${e.slice(0, t - 1).trimEnd()}…` : e;
|
|
2213
|
+
function pt(e, t = 0) {
|
|
2214
2214
|
if (typeof e.content == "string" && e.content.trim()) return e.content.trim();
|
|
2215
2215
|
if (t > 6) return "";
|
|
2216
2216
|
for (let n of e.children ?? []) {
|
|
2217
|
-
let e =
|
|
2217
|
+
let e = pt(n, t + 1);
|
|
2218
2218
|
if (e) return e;
|
|
2219
2219
|
}
|
|
2220
2220
|
return "";
|
|
2221
2221
|
}
|
|
2222
|
-
function
|
|
2223
|
-
let t =
|
|
2222
|
+
function mt(e) {
|
|
2223
|
+
let t = _(e);
|
|
2224
2224
|
if (!t) return "";
|
|
2225
|
-
let n =
|
|
2225
|
+
let n = fe(t.kind) ? v(t.kind).fields : [];
|
|
2226
2226
|
for (let e of n) {
|
|
2227
2227
|
let n = t.content?.[e.key];
|
|
2228
|
-
if ((e.type === "text" || e.type === "longtext") && typeof n == "string" && n.trim()) return
|
|
2228
|
+
if ((e.type === "text" || e.type === "longtext") && typeof n == "string" && n.trim()) return ft(n.trim());
|
|
2229
2229
|
}
|
|
2230
2230
|
return "";
|
|
2231
2231
|
}
|
|
2232
|
-
var
|
|
2232
|
+
var ht = 150, gt = [
|
|
2233
2233
|
"display",
|
|
2234
2234
|
"layoutMode",
|
|
2235
2235
|
"flexDirection",
|
|
@@ -2249,20 +2249,20 @@ var mt = 150, ht = [
|
|
|
2249
2249
|
"textAlign",
|
|
2250
2250
|
"borderRadius"
|
|
2251
2251
|
];
|
|
2252
|
-
function
|
|
2252
|
+
function _t(e) {
|
|
2253
2253
|
let t = 0, n = (e, r) => {
|
|
2254
|
-
if (t >=
|
|
2254
|
+
if (t >= ht) return null;
|
|
2255
2255
|
t++;
|
|
2256
|
-
let i = typeof e.content == "string" && e.content.trim() ?
|
|
2257
|
-
for (let t of
|
|
2256
|
+
let i = typeof e.content == "string" && e.content.trim() ? ft(e.content.trim(), 160) : void 0, a = typeof e.props?.href == "string" && e.props.href ? e.props.href : void 0, o = typeof e.props?.alt == "string" && e.props.alt ? ft(e.props.alt, 80) : void 0, s = {};
|
|
2257
|
+
for (let t of gt) {
|
|
2258
2258
|
let n = e.styles?.[t];
|
|
2259
|
-
(typeof n == "string" || typeof n == "number" || typeof n == "boolean") && (s[t] = typeof n == "string" ?
|
|
2259
|
+
(typeof n == "string" || typeof n == "number" || typeof n == "boolean") && (s[t] = typeof n == "string" ? ft(n, 80) : n);
|
|
2260
2260
|
}
|
|
2261
2261
|
let c = r < 12 ? (e.children ?? []).map((e) => n(e, r + 1)).filter((e) => !!e) : [];
|
|
2262
2262
|
return {
|
|
2263
2263
|
id: e.id,
|
|
2264
2264
|
type: e.type,
|
|
2265
|
-
...e.name && e.name !== e.type && e.name.toLowerCase() !== e.type ? { name:
|
|
2265
|
+
...e.name && e.name !== e.type && e.name.toLowerCase() !== e.type ? { name: ft(e.name, 40) } : {},
|
|
2266
2266
|
...i ? { text: i } : {},
|
|
2267
2267
|
...a ? { href: a } : {},
|
|
2268
2268
|
...o ? { alt: o } : {},
|
|
@@ -2272,24 +2272,24 @@ function gt(e) {
|
|
|
2272
2272
|
};
|
|
2273
2273
|
return (e.children ?? []).map((e) => n(e, 0)).filter((e) => !!e);
|
|
2274
2274
|
}
|
|
2275
|
-
function
|
|
2276
|
-
let t =
|
|
2275
|
+
function vt(e) {
|
|
2276
|
+
let t = _(e);
|
|
2277
2277
|
return t ? {
|
|
2278
2278
|
id: e.id,
|
|
2279
2279
|
kind: t.kind,
|
|
2280
2280
|
variant: t.variant,
|
|
2281
|
-
preview:
|
|
2281
|
+
preview: mt(e)
|
|
2282
2282
|
} : {
|
|
2283
2283
|
id: e.id,
|
|
2284
|
-
preview:
|
|
2284
|
+
preview: ft(pt(e) || e.name || ""),
|
|
2285
2285
|
freeForm: !0,
|
|
2286
|
-
elements:
|
|
2286
|
+
elements: _t(e)
|
|
2287
2287
|
};
|
|
2288
2288
|
}
|
|
2289
|
-
function
|
|
2289
|
+
function yt(e, t) {
|
|
2290
2290
|
let n = (e) => {
|
|
2291
|
-
let n =
|
|
2292
|
-
return n ?
|
|
2291
|
+
let n = Ee(t, e);
|
|
2292
|
+
return n ? Ce(n) : void 0;
|
|
2293
2293
|
};
|
|
2294
2294
|
return {
|
|
2295
2295
|
pages: e.map((e) => ({
|
|
@@ -2297,22 +2297,22 @@ function vt(e, t) {
|
|
|
2297
2297
|
name: e.name,
|
|
2298
2298
|
slug: e.slug,
|
|
2299
2299
|
...e.isHome ? { isHome: !0 } : {},
|
|
2300
|
-
sections:
|
|
2300
|
+
sections: ue(e.rootNode).filter((e) => e.type === "section").map(vt)
|
|
2301
2301
|
})),
|
|
2302
2302
|
brand: {
|
|
2303
|
-
primaryColor:
|
|
2304
|
-
secondaryColor:
|
|
2303
|
+
primaryColor: Ee(t, "--color-brand-primary-500"),
|
|
2304
|
+
secondaryColor: Ee(t, "--color-brand-secondary-500"),
|
|
2305
2305
|
headingFont: n("--font-family-heading"),
|
|
2306
2306
|
bodyFont: n("--font-family-body"),
|
|
2307
|
-
neutrals:
|
|
2308
|
-
roundness:
|
|
2309
|
-
guidelines:
|
|
2307
|
+
neutrals: $e(t),
|
|
2308
|
+
roundness: ot(t),
|
|
2309
|
+
guidelines: je(t)
|
|
2310
2310
|
}
|
|
2311
2311
|
};
|
|
2312
2312
|
}
|
|
2313
2313
|
//#endregion
|
|
2314
2314
|
//#region src/v2/sol/elements.ts
|
|
2315
|
-
var
|
|
2315
|
+
var bt = [
|
|
2316
2316
|
"container",
|
|
2317
2317
|
"card",
|
|
2318
2318
|
"heading",
|
|
@@ -2323,7 +2323,7 @@ var yt = [
|
|
|
2323
2323
|
"divider",
|
|
2324
2324
|
"spacer",
|
|
2325
2325
|
"icon"
|
|
2326
|
-
],
|
|
2326
|
+
], xt = /* @__PURE__ */ new Set(/* @__PURE__ */ "layoutMode.position.x.y.zIndex.horizontalConstraint.verticalConstraint.rightOffset.bottomOffset.centerOffsetX.centerOffsetY.scaleLeft.scaleWidth.scaleTop.scaleHeight.gridColumns.gridTemplateColumns.gridRows.gridColumnSpan.gridRowSpan.gridGap.widthSizing.heightSizing.stackOnMobile.flexWrap.flexShrink.pinned.flexGrow.flexBasis.pointerEvents.display.flexDirection.justifyContent.alignItems.alignContent.alignSelf.gap.width.customWidth.isFullWidth.maxWidth.minWidth.height.minHeight.maxHeight.padding.paddingTop.paddingBottom.paddingLeft.paddingRight.margin.marginTop.marginBottom.marginLeft.marginRight.fontFamily.fontWeight.fontSize.fontSizeUnit.lineHeight.letterSpacing.textTransform.textStyle.textColor.textAlign.isBold.isItalic.isUnderline.backgroundColor.darkModeBackgroundColor.backgroundImage.backgroundGradient.aspectRatio.backgroundSize.backgroundPosition.opacity.borderRadius.borderWidth.borderStyle.borderColor.boxShadow.overflow.whiteSpace.objectPosition.backdropFilter.linkColor.linkHoverColor.underlineLinks.underlineOnHover.horizontalAlign.customClasses.transitionProperty.transitionDuration.transitionEasing.hoverEffect.entrance.entranceDelay.cursor".split(".")), St = /* @__PURE__ */ new Set([
|
|
2327
2327
|
"href",
|
|
2328
2328
|
"alt",
|
|
2329
2329
|
"src",
|
|
@@ -2335,21 +2335,21 @@ var yt = [
|
|
|
2335
2335
|
"highlightText",
|
|
2336
2336
|
"target",
|
|
2337
2337
|
"rel"
|
|
2338
|
-
]),
|
|
2339
|
-
function
|
|
2338
|
+
]), Ct = 150, wt = 10, Tt = 400, Et = /javascript:|vbscript:|expression\s*\(|@import|<\s*\/?\s*script|<\s*\/?\s*style/i, Dt = (e) => typeof e == "boolean" || typeof e == "number" && Number.isFinite(e) || typeof e == "string";
|
|
2339
|
+
function Ot(e) {
|
|
2340
2340
|
let t = {}, n = [];
|
|
2341
|
-
if (e && typeof e == "object") for (let [r, i] of Object.entries(e))
|
|
2341
|
+
if (e && typeof e == "object") for (let [r, i] of Object.entries(e)) xt.has(r) && Dt(i) && (typeof i != "string" || i.length <= Tt && !Et.test(i)) ? t[r] = i : n.push(r);
|
|
2342
2342
|
return {
|
|
2343
2343
|
styles: t,
|
|
2344
2344
|
dropped: n
|
|
2345
2345
|
};
|
|
2346
2346
|
}
|
|
2347
|
-
function
|
|
2347
|
+
function kt(e) {
|
|
2348
2348
|
let t = {};
|
|
2349
|
-
if (e && typeof e == "object") for (let [n, r] of Object.entries(e)) !
|
|
2349
|
+
if (e && typeof e == "object") for (let [n, r] of Object.entries(e)) !St.has(n) || !Dt(r) || typeof r == "string" && (r.length > 2e3 || Et.test(r) || /^\s*data:(?!image\/)/i.test(r)) || (t[n] = r);
|
|
2350
2350
|
return t;
|
|
2351
2351
|
}
|
|
2352
|
-
var
|
|
2352
|
+
var At = o(() => a({
|
|
2353
2353
|
id: n().optional(),
|
|
2354
2354
|
type: n(),
|
|
2355
2355
|
name: n().max(120).optional(),
|
|
@@ -2361,30 +2361,30 @@ var kt = o(() => a({
|
|
|
2361
2361
|
mobile: d(n(), s()).optional()
|
|
2362
2362
|
}).optional(),
|
|
2363
2363
|
hidden: i().optional(),
|
|
2364
|
-
children: c(
|
|
2365
|
-
})),
|
|
2364
|
+
children: c(At).optional()
|
|
2365
|
+
})), jt = {
|
|
2366
2366
|
layoutMode: "flow",
|
|
2367
2367
|
display: "flex",
|
|
2368
2368
|
flexDirection: "column",
|
|
2369
2369
|
width: "100%"
|
|
2370
|
-
},
|
|
2370
|
+
}, Mt = {
|
|
2371
2371
|
layoutMode: "flow",
|
|
2372
2372
|
display: "flex",
|
|
2373
2373
|
flexDirection: "column",
|
|
2374
2374
|
position: "relative",
|
|
2375
2375
|
width: "100%"
|
|
2376
|
-
},
|
|
2377
|
-
function
|
|
2376
|
+
}, Nt = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 24) || "element";
|
|
2377
|
+
function Pt(e, t, n = {}) {
|
|
2378
2378
|
let r = /* @__PURE__ */ new Set(), i = 0, a = (e, o, s) => {
|
|
2379
|
-
if (++i >
|
|
2380
|
-
if (o >
|
|
2379
|
+
if (++i > Ct) throw Error(`That is too much to build at once (more than ${Ct} elements). Build it in smaller pieces.`);
|
|
2380
|
+
if (o > wt) throw Error("Those elements are nested too deeply. Keep it within ten levels.");
|
|
2381
2381
|
let c = n.section && s;
|
|
2382
|
-
if (!c && !
|
|
2383
|
-
let l = (e.id && /^[A-Za-z0-9_-]{1,40}$/.test(e.id) && !t.has(e.id) ? e.id : null) ?? h(c ? "section" :
|
|
2382
|
+
if (!c && !bt.includes(e.type)) throw Error(`I can't create a "${e.type}" element. I can create: ${bt.join(", ")}. (Grids and columns are a container with display "grid" or "flex".)`);
|
|
2383
|
+
let l = (e.id && /^[A-Za-z0-9_-]{1,40}$/.test(e.id) && !t.has(e.id) ? e.id : null) ?? h(c ? "section" : Nt(e.name ?? e.type));
|
|
2384
2384
|
t.add(l);
|
|
2385
|
-
let { styles: u, dropped: d } =
|
|
2385
|
+
let { styles: u, dropped: d } = Ot(e.styles);
|
|
2386
2386
|
d.forEach((e) => r.add(e));
|
|
2387
|
-
let f = c ? "section" : e.type, p = c ?
|
|
2387
|
+
let f = c ? "section" : e.type, p = c ? Mt : f === "container" || f === "card" ? jt : {}, m = kt(e.props);
|
|
2388
2388
|
f === "heading" && m.level === void 0 && (m.level = 2);
|
|
2389
2389
|
let g = {
|
|
2390
2390
|
id: l,
|
|
@@ -2407,7 +2407,7 @@ function Nt(e, t, n = {}) {
|
|
|
2407
2407
|
let t = {};
|
|
2408
2408
|
for (let n of ["tablet", "mobile"]) {
|
|
2409
2409
|
if (!e.responsive[n]) continue;
|
|
2410
|
-
let i =
|
|
2410
|
+
let i = Ot(e.responsive[n]);
|
|
2411
2411
|
i.dropped.forEach((e) => r.add(e)), Object.keys(i.styles).length && (t[n] = i.styles);
|
|
2412
2412
|
}
|
|
2413
2413
|
Object.keys(t).length && (g.responsive = t);
|
|
@@ -2419,26 +2419,26 @@ function Nt(e, t, n = {}) {
|
|
|
2419
2419
|
dropped: [...r]
|
|
2420
2420
|
};
|
|
2421
2421
|
}
|
|
2422
|
-
var
|
|
2422
|
+
var Ft = (e, t, n) => e.id === t ? n(e) : e.children ? {
|
|
2423
2423
|
...e,
|
|
2424
|
-
children: e.children.map((e) =>
|
|
2425
|
-
} : e,
|
|
2426
|
-
function
|
|
2424
|
+
children: e.children.map((e) => Ft(e, t, n))
|
|
2425
|
+
} : e, It = (e, t) => e.id === t || (e.children ?? []).some((e) => It(e, t)), Lt = (e, t = /* @__PURE__ */ new Set()) => (t.add(e.id), e.children?.forEach((e) => Lt(e, t)), t);
|
|
2426
|
+
function Rt(e, t) {
|
|
2427
2427
|
if (e.id === t) return e;
|
|
2428
2428
|
for (let n of e.children ?? []) {
|
|
2429
|
-
let e =
|
|
2429
|
+
let e = Rt(n, t);
|
|
2430
2430
|
if (e) return e;
|
|
2431
2431
|
}
|
|
2432
2432
|
return null;
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function zt(e, t) {
|
|
2435
2435
|
return e.children ? {
|
|
2436
2436
|
...e,
|
|
2437
|
-
children: e.children.filter((e) => e.id !== t).map((e) =>
|
|
2437
|
+
children: e.children.filter((e) => e.id !== t).map((e) => zt(e, t))
|
|
2438
2438
|
} : e;
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2441
|
-
return
|
|
2440
|
+
function Bt(e, t, n, r) {
|
|
2441
|
+
return Ft(e, t, (e) => {
|
|
2442
2442
|
let t = e.children ?? [], i = r === void 0 ? t.length : Math.max(0, Math.min(r, t.length));
|
|
2443
2443
|
return {
|
|
2444
2444
|
...e,
|
|
@@ -2450,18 +2450,18 @@ function zt(e, t, n, r) {
|
|
|
2450
2450
|
};
|
|
2451
2451
|
});
|
|
2452
2452
|
}
|
|
2453
|
-
function
|
|
2453
|
+
function Vt(e, t) {
|
|
2454
2454
|
let n = h("node");
|
|
2455
2455
|
for (; t.has(n);) n = h("node");
|
|
2456
2456
|
return t.add(n), {
|
|
2457
2457
|
...e,
|
|
2458
2458
|
id: n,
|
|
2459
|
-
children: e.children?.map((e) =>
|
|
2459
|
+
children: e.children?.map((e) => Vt(e, t))
|
|
2460
2460
|
};
|
|
2461
2461
|
}
|
|
2462
2462
|
//#endregion
|
|
2463
2463
|
//#region src/v2/sol/schema.ts
|
|
2464
|
-
var
|
|
2464
|
+
var Ht = a({
|
|
2465
2465
|
background: u([
|
|
2466
2466
|
"canvas",
|
|
2467
2467
|
"surface",
|
|
@@ -2479,27 +2479,27 @@ var Vt = a({
|
|
|
2479
2479
|
"airy"
|
|
2480
2480
|
]).optional(),
|
|
2481
2481
|
pinned: i().optional()
|
|
2482
|
-
}).strict(),
|
|
2482
|
+
}).strict(), Ut = d(n(), s()), Wt = {
|
|
2483
2483
|
index: t().int().min(0).optional(),
|
|
2484
2484
|
afterSectionId: n().optional()
|
|
2485
|
-
},
|
|
2485
|
+
}, Gt = a({
|
|
2486
2486
|
op: l("addSection"),
|
|
2487
2487
|
pageId: n(),
|
|
2488
2488
|
kind: n(),
|
|
2489
2489
|
variant: n().optional(),
|
|
2490
|
-
content:
|
|
2491
|
-
style:
|
|
2490
|
+
content: Ut.optional(),
|
|
2491
|
+
style: Ht.optional(),
|
|
2492
2492
|
id: n().optional(),
|
|
2493
|
-
...
|
|
2494
|
-
}),
|
|
2493
|
+
...Wt
|
|
2494
|
+
}), Kt = a({
|
|
2495
2495
|
op: l("updateSection"),
|
|
2496
2496
|
sectionId: n(),
|
|
2497
|
-
content:
|
|
2497
|
+
content: Ut.optional(),
|
|
2498
2498
|
variant: n().optional(),
|
|
2499
|
-
style:
|
|
2500
|
-
}),
|
|
2501
|
-
Wt,
|
|
2499
|
+
style: Ht.optional()
|
|
2500
|
+
}), qt = d(n(), s()), Jt = e("op", [
|
|
2502
2501
|
Gt,
|
|
2502
|
+
Kt,
|
|
2503
2503
|
a({
|
|
2504
2504
|
op: l("updateElement"),
|
|
2505
2505
|
nodeId: n(),
|
|
@@ -2509,16 +2509,16 @@ var Vt = a({
|
|
|
2509
2509
|
src: n().max(2e3).optional(),
|
|
2510
2510
|
name: n().max(120).optional(),
|
|
2511
2511
|
hidden: i().optional(),
|
|
2512
|
-
style:
|
|
2512
|
+
style: qt.optional(),
|
|
2513
2513
|
responsive: a({
|
|
2514
|
-
tablet:
|
|
2515
|
-
mobile:
|
|
2514
|
+
tablet: qt.optional(),
|
|
2515
|
+
mobile: qt.optional()
|
|
2516
2516
|
}).optional()
|
|
2517
2517
|
}),
|
|
2518
2518
|
a({
|
|
2519
2519
|
op: l("addElement"),
|
|
2520
2520
|
parentId: n(),
|
|
2521
|
-
element:
|
|
2521
|
+
element: At,
|
|
2522
2522
|
index: t().int().min(0).optional(),
|
|
2523
2523
|
afterNodeId: n().optional()
|
|
2524
2524
|
}),
|
|
@@ -2540,13 +2540,13 @@ var Vt = a({
|
|
|
2540
2540
|
a({
|
|
2541
2541
|
op: l("addCustomSection"),
|
|
2542
2542
|
pageId: n(),
|
|
2543
|
-
element:
|
|
2544
|
-
...
|
|
2543
|
+
element: At,
|
|
2544
|
+
...Wt
|
|
2545
2545
|
}),
|
|
2546
2546
|
a({
|
|
2547
2547
|
op: l("replaceSection"),
|
|
2548
2548
|
sectionId: n(),
|
|
2549
|
-
element:
|
|
2549
|
+
element: At
|
|
2550
2550
|
}),
|
|
2551
2551
|
a({
|
|
2552
2552
|
op: l("removeSection"),
|
|
@@ -2555,7 +2555,7 @@ var Vt = a({
|
|
|
2555
2555
|
a({
|
|
2556
2556
|
op: l("moveSection"),
|
|
2557
2557
|
sectionId: n(),
|
|
2558
|
-
...
|
|
2558
|
+
...Wt
|
|
2559
2559
|
}),
|
|
2560
2560
|
a({
|
|
2561
2561
|
op: l("duplicateSection"),
|
|
@@ -2575,52 +2575,52 @@ var Vt = a({
|
|
|
2575
2575
|
pageId: n(),
|
|
2576
2576
|
name: n().min(1)
|
|
2577
2577
|
})
|
|
2578
|
-
]),
|
|
2579
|
-
function
|
|
2580
|
-
|
|
2578
|
+
]), Yt = (e) => Le(e) ? Ue(e, { seed: h("tpl") }) : null;
|
|
2579
|
+
function Xt(e) {
|
|
2580
|
+
Yt = e;
|
|
2581
2581
|
}
|
|
2582
|
-
var
|
|
2582
|
+
var O = (e) => ({
|
|
2583
2583
|
ok: !1,
|
|
2584
2584
|
message: e
|
|
2585
|
-
}),
|
|
2585
|
+
}), k = (e, t) => ({
|
|
2586
2586
|
ok: !0,
|
|
2587
2587
|
message: e,
|
|
2588
2588
|
...t ? { sectionId: t } : {}
|
|
2589
|
-
}),
|
|
2589
|
+
}), Zt = () => xe.map((e) => e.kind).join(", "), Qt = (e) => e.type === "section", $t = (e, t) => e.find((e) => e.id === t) ?? e.find((e) => e.name.trim().toLowerCase() === t.trim().toLowerCase()), en = (e, t) => {
|
|
2590
2590
|
for (let n of e) {
|
|
2591
|
-
let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t &&
|
|
2591
|
+
let e = (n.rootNode.children ?? []).findIndex((e) => e.id === t && Qt(e));
|
|
2592
2592
|
if (e >= 0) return {
|
|
2593
2593
|
page: n,
|
|
2594
2594
|
index: e
|
|
2595
2595
|
};
|
|
2596
2596
|
}
|
|
2597
2597
|
return null;
|
|
2598
|
-
},
|
|
2598
|
+
}, A = (e, t, n) => e.map((e) => e.id === t ? {
|
|
2599
2599
|
...e,
|
|
2600
2600
|
rootNode: {
|
|
2601
2601
|
...e.rootNode,
|
|
2602
2602
|
children: n
|
|
2603
2603
|
}
|
|
2604
|
-
} : e),
|
|
2605
|
-
let t =
|
|
2606
|
-
return t &&
|
|
2604
|
+
} : e), j = (e) => e.rootNode.children ?? [], tn = (e) => O(`I couldn't find a section called "${e}". It may have been removed already.`), nn = (e) => {
|
|
2605
|
+
let t = _(e);
|
|
2606
|
+
return t && fe(t.kind) ? v(t.kind).label : e.name || "section";
|
|
2607
2607
|
};
|
|
2608
|
-
function
|
|
2608
|
+
function rn(e, t, n) {
|
|
2609
2609
|
if (t.afterSectionId !== void 0) {
|
|
2610
2610
|
let n = e.findIndex((e) => e.id === t.afterSectionId);
|
|
2611
2611
|
return n < 0 ? { error: `I couldn't find the section to place it after ("${t.afterSectionId}").` } : { index: n + 1 };
|
|
2612
2612
|
}
|
|
2613
2613
|
return t.index === void 0 ? { index: n } : { index: Math.min(t.index, e.length) };
|
|
2614
2614
|
}
|
|
2615
|
-
var
|
|
2616
|
-
function
|
|
2615
|
+
var an = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "page";
|
|
2616
|
+
function on(e) {
|
|
2617
2617
|
return {
|
|
2618
2618
|
...e,
|
|
2619
2619
|
id: h("node"),
|
|
2620
|
-
children: e.children?.map(
|
|
2620
|
+
children: e.children?.map(on)
|
|
2621
2621
|
};
|
|
2622
2622
|
}
|
|
2623
|
-
var
|
|
2623
|
+
var sn = (e, t) => {
|
|
2624
2624
|
let [n, ...r] = t, i = e.find((e) => e.key === n);
|
|
2625
2625
|
return i ? r.length ? i.type === "list" && /^\d+$/.test(r[0]) ? r.length === 1 ? {
|
|
2626
2626
|
...i,
|
|
@@ -2630,9 +2630,9 @@ var on = (e, t) => {
|
|
|
2630
2630
|
itemName: i.itemName,
|
|
2631
2631
|
label: i.itemName ?? i.label,
|
|
2632
2632
|
limit: -1
|
|
2633
|
-
} :
|
|
2634
|
-
},
|
|
2635
|
-
function
|
|
2633
|
+
} : sn(i.item ?? [], r.slice(1)) : null : i : null;
|
|
2634
|
+
}, cn = (e) => !!e && typeof e == "object" && !Array.isArray(e);
|
|
2635
|
+
function ln(e, t, n) {
|
|
2636
2636
|
switch (e.type) {
|
|
2637
2637
|
case "text":
|
|
2638
2638
|
case "longtext":
|
|
@@ -2646,73 +2646,73 @@ function cn(e, t, n) {
|
|
|
2646
2646
|
return typeof t == "string" && (!r.length || r.includes(t)) ? null : `"${n}" should be one of: ${r.join(", ")}.`;
|
|
2647
2647
|
}
|
|
2648
2648
|
case "button":
|
|
2649
|
-
if (!
|
|
2649
|
+
if (!cn(t)) return `"${n}" should be a button with a label and a link.`;
|
|
2650
2650
|
for (let [e, r] of Object.entries(t)) if (!["label", "href"].includes(e) || typeof r != "string") return `"${n}" can only have a label and a link, both text.`;
|
|
2651
2651
|
return null;
|
|
2652
2652
|
case "list":
|
|
2653
2653
|
if (!Array.isArray(t)) return `"${n}" should be a list.`;
|
|
2654
2654
|
if (e.limit && e.limit > 0 && t.length > e.limit) return `"${n}" can have at most ${e.limit} ${e.itemName ?? "item"}s.`;
|
|
2655
2655
|
for (let [r, i] of t.entries()) {
|
|
2656
|
-
let t =
|
|
2656
|
+
let t = un(e.item ?? [], i, `${n} ${r + 1}`);
|
|
2657
2657
|
if (t) return t;
|
|
2658
2658
|
}
|
|
2659
2659
|
return null;
|
|
2660
2660
|
}
|
|
2661
2661
|
}
|
|
2662
|
-
function
|
|
2663
|
-
if (!
|
|
2662
|
+
function un(e, t, n) {
|
|
2663
|
+
if (!cn(t)) return `${n} should be a group of fields.`;
|
|
2664
2664
|
for (let [r, i] of Object.entries(t)) {
|
|
2665
2665
|
let t = e.find((e) => e.key === r);
|
|
2666
2666
|
if (!t) return `${n} has a field "${r}" that doesn't exist. Available: ${e.map((e) => e.key).join(", ")}.`;
|
|
2667
|
-
let a =
|
|
2667
|
+
let a = ln(t, i, `${n} ${t.label.toLowerCase()}`);
|
|
2668
2668
|
if (a) return a;
|
|
2669
2669
|
}
|
|
2670
2670
|
return null;
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2673
|
-
let n =
|
|
2672
|
+
function dn(e, t) {
|
|
2673
|
+
let n = v(e);
|
|
2674
2674
|
for (let [e, r] of Object.entries(t)) {
|
|
2675
|
-
let t =
|
|
2675
|
+
let t = sn(n.fields, e.split(".").filter(Boolean));
|
|
2676
2676
|
if (!t) return `A ${n.label.toLowerCase()} section has no "${e}" field. The fields are: ${n.fields.map((e) => e.key).join(", ")}.`;
|
|
2677
2677
|
if (t.limit === -1) {
|
|
2678
|
-
let e =
|
|
2678
|
+
let e = un(t.item ?? [], r, t.label);
|
|
2679
2679
|
if (e) return e;
|
|
2680
2680
|
continue;
|
|
2681
2681
|
}
|
|
2682
|
-
let i =
|
|
2682
|
+
let i = ln(t, r, t.label);
|
|
2683
2683
|
if (i) return i;
|
|
2684
2684
|
}
|
|
2685
2685
|
return null;
|
|
2686
2686
|
}
|
|
2687
|
-
var
|
|
2687
|
+
var fn = (e, t) => Object.entries(t).reduce((e, [t, n]) => be(e, t, n), e), pn = [
|
|
2688
2688
|
"primaryColor",
|
|
2689
2689
|
"secondaryColor",
|
|
2690
2690
|
"headingFont",
|
|
2691
2691
|
"bodyFont",
|
|
2692
2692
|
"neutrals",
|
|
2693
2693
|
"roundness"
|
|
2694
|
-
],
|
|
2695
|
-
function
|
|
2694
|
+
], mn = (e) => new Set(Ae(e).map((e) => `${e.kind}:${e.key}`));
|
|
2695
|
+
function hn(e, t) {
|
|
2696
2696
|
let n = e, r = [];
|
|
2697
2697
|
for (let [i, a] of Object.entries(t)) {
|
|
2698
2698
|
let t = String(a).trim();
|
|
2699
2699
|
switch (i) {
|
|
2700
2700
|
case "primaryColor":
|
|
2701
2701
|
case "secondaryColor":
|
|
2702
|
-
if (!
|
|
2702
|
+
if (!oe(t)) return {
|
|
2703
2703
|
ds: e,
|
|
2704
|
-
result:
|
|
2704
|
+
result: O(`"${t}" doesn't look like a colour I can use. Try something like #1D4ED8.`)
|
|
2705
2705
|
};
|
|
2706
|
-
n = i === "primaryColor" ?
|
|
2706
|
+
n = i === "primaryColor" ? Xe(n, t) : Ze(n, t), r.push(i === "primaryColor" ? "main colour" : "second colour");
|
|
2707
2707
|
break;
|
|
2708
2708
|
case "headingFont":
|
|
2709
2709
|
case "bodyFont": {
|
|
2710
|
-
let a =
|
|
2710
|
+
let a = Te.find((e) => e.name.toLowerCase() === t.toLowerCase());
|
|
2711
2711
|
if (!a) return {
|
|
2712
2712
|
ds: e,
|
|
2713
|
-
result:
|
|
2713
|
+
result: O(`I don't have a font called "${t}". Try one of: ${Te.map((e) => e.name).join(", ")}.`)
|
|
2714
2714
|
};
|
|
2715
|
-
n =
|
|
2715
|
+
n = st(n, i === "headingFont" ? { heading: a.name } : { body: a.name }), r.push(i === "headingFont" ? "heading font" : "text font");
|
|
2716
2716
|
break;
|
|
2717
2717
|
}
|
|
2718
2718
|
case "neutrals":
|
|
@@ -2722,9 +2722,9 @@ function mn(e, t) {
|
|
|
2722
2722
|
"dark"
|
|
2723
2723
|
].includes(t)) return {
|
|
2724
2724
|
ds: e,
|
|
2725
|
-
result:
|
|
2725
|
+
result: O("The background feel should be \"cool\", \"warm\" or \"dark\".")
|
|
2726
2726
|
};
|
|
2727
|
-
n =
|
|
2727
|
+
n = tt(n, t), r.push("background feel");
|
|
2728
2728
|
break;
|
|
2729
2729
|
case "roundness":
|
|
2730
2730
|
if (![
|
|
@@ -2733,48 +2733,48 @@ function mn(e, t) {
|
|
|
2733
2733
|
"round"
|
|
2734
2734
|
].includes(t)) return {
|
|
2735
2735
|
ds: e,
|
|
2736
|
-
result:
|
|
2736
|
+
result: O("Corner roundness should be \"sharp\", \"soft\" or \"round\".")
|
|
2737
2737
|
};
|
|
2738
|
-
n =
|
|
2738
|
+
n = at(n, t), r.push("corner roundness");
|
|
2739
2739
|
break;
|
|
2740
2740
|
default: {
|
|
2741
2741
|
if (!i.startsWith("--")) return {
|
|
2742
2742
|
ds: e,
|
|
2743
|
-
result:
|
|
2743
|
+
result: O(`I don't know the brand setting "${i}". I can change: ${pn.join(", ")}.`)
|
|
2744
2744
|
};
|
|
2745
|
-
let a =
|
|
2745
|
+
let a = ke(n, i);
|
|
2746
2746
|
if (!a) return {
|
|
2747
2747
|
ds: e,
|
|
2748
|
-
result:
|
|
2748
|
+
result: O(`There's no brand setting called "${i}" on this site.`)
|
|
2749
2749
|
};
|
|
2750
|
-
n =
|
|
2750
|
+
n = y(n, i, t), r.push(a.name || i);
|
|
2751
2751
|
}
|
|
2752
2752
|
}
|
|
2753
2753
|
}
|
|
2754
2754
|
if (!r.length) return {
|
|
2755
2755
|
ds: e,
|
|
2756
|
-
result:
|
|
2756
|
+
result: O("There was nothing to change in the brand.")
|
|
2757
2757
|
};
|
|
2758
|
-
let i =
|
|
2758
|
+
let i = mn(e), a = Ae(n).filter((e) => !i.has(`${e.kind}:${e.key}`));
|
|
2759
2759
|
return a.length ? {
|
|
2760
2760
|
ds: e,
|
|
2761
|
-
result:
|
|
2761
|
+
result: O(`That brand change wouldn't work: ${a[0].message}`)
|
|
2762
2762
|
} : {
|
|
2763
|
-
ds:
|
|
2764
|
-
result:
|
|
2763
|
+
ds: Oe(n),
|
|
2764
|
+
result: k(`Updated the brand (${r.join(", ")}).`)
|
|
2765
2765
|
};
|
|
2766
2766
|
}
|
|
2767
|
-
var
|
|
2767
|
+
var gn = /* @__PURE__ */ new Set([
|
|
2768
2768
|
"heading",
|
|
2769
2769
|
"paragraph",
|
|
2770
2770
|
"button",
|
|
2771
2771
|
"badge"
|
|
2772
2772
|
]);
|
|
2773
|
-
function
|
|
2773
|
+
function M(e, t) {
|
|
2774
2774
|
for (let n of e) {
|
|
2775
|
-
let e =
|
|
2775
|
+
let e = j(n);
|
|
2776
2776
|
for (let r = 0; r < e.length; r++) {
|
|
2777
|
-
let i =
|
|
2777
|
+
let i = Rt(e[r], t);
|
|
2778
2778
|
if (i) return {
|
|
2779
2779
|
page: n,
|
|
2780
2780
|
index: r,
|
|
@@ -2784,30 +2784,30 @@ function N(e, t) {
|
|
|
2784
2784
|
}
|
|
2785
2785
|
return null;
|
|
2786
2786
|
}
|
|
2787
|
-
var
|
|
2787
|
+
var N = (e) => {
|
|
2788
2788
|
let t = (e.content ?? e.props?.alt ?? "").toString().trim();
|
|
2789
2789
|
return t ? `"${t.length > 40 ? `${t.slice(0, 39).trimEnd()}…` : t}"` : `the ${e.name && e.name !== e.type ? e.name.toLowerCase() : e.type}`;
|
|
2790
2790
|
};
|
|
2791
|
-
function
|
|
2792
|
-
let n =
|
|
2791
|
+
function P(e, t) {
|
|
2792
|
+
let n = M(e, t);
|
|
2793
2793
|
return n ? {
|
|
2794
|
-
label:
|
|
2794
|
+
label: N(n.node),
|
|
2795
2795
|
page: n.page.name
|
|
2796
2796
|
} : { label: "an element" };
|
|
2797
2797
|
}
|
|
2798
|
-
var
|
|
2798
|
+
var _n = (e) => {
|
|
2799
2799
|
let t = /* @__PURE__ */ new Set();
|
|
2800
|
-
for (let n of e)
|
|
2800
|
+
for (let n of e) Lt(n.rootNode, t);
|
|
2801
2801
|
return t;
|
|
2802
|
-
},
|
|
2803
|
-
function
|
|
2802
|
+
}, F = "That belongs to a ready-made section, so change it through the section (its wording and layout) — or rebuild the whole section with replaceSection if it needs a different structure.", vn = (e) => e.length ? ` (I left out settings I don't know: ${e.slice(0, 5).join(", ")}.)` : "", I = (e, t, n, r) => A(e, t.id, j(t).map((e, t) => t === n ? r : e));
|
|
2803
|
+
function yn(e, t) {
|
|
2804
2804
|
if (t.afterNodeId !== void 0) {
|
|
2805
2805
|
let n = e.findIndex((e) => e.id === t.afterNodeId);
|
|
2806
2806
|
return n < 0 ? `I couldn't find the element to place it after ("${t.afterNodeId}") inside that group.` : n + 1;
|
|
2807
2807
|
}
|
|
2808
2808
|
return t.index === void 0 ? e.length : Math.min(t.index, e.length);
|
|
2809
2809
|
}
|
|
2810
|
-
function
|
|
2810
|
+
function bn(e, t, n, r) {
|
|
2811
2811
|
let i = (n) => ({
|
|
2812
2812
|
pages: e,
|
|
2813
2813
|
ds: t,
|
|
@@ -2815,69 +2815,69 @@ function yn(e, t, n, r) {
|
|
|
2815
2815
|
});
|
|
2816
2816
|
switch (n.op) {
|
|
2817
2817
|
case "addSection": {
|
|
2818
|
-
let r =
|
|
2819
|
-
if (!r) return i(
|
|
2820
|
-
if (!
|
|
2821
|
-
let a =
|
|
2822
|
-
if (n.variant && !a.variants.some((e) => e.id === n.variant)) return i(
|
|
2818
|
+
let r = $t(e, n.pageId);
|
|
2819
|
+
if (!r) return i(O(`I couldn't find a page called "${n.pageId}".`));
|
|
2820
|
+
if (!fe(n.kind)) return i(O(`I don't know a "${n.kind}" section. The ones I can add are: ${Zt()}.`));
|
|
2821
|
+
let a = v(n.kind);
|
|
2822
|
+
if (n.variant && !a.variants.some((e) => e.id === n.variant)) return i(O(`A ${a.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${a.variants.map((e) => e.id).join(", ")}.`));
|
|
2823
2823
|
if (n.content) {
|
|
2824
|
-
let e =
|
|
2825
|
-
if (e) return i(
|
|
2824
|
+
let e = dn(n.kind, n.content);
|
|
2825
|
+
if (e) return i(O(e));
|
|
2826
2826
|
}
|
|
2827
|
-
let o =
|
|
2827
|
+
let o = ye(n.kind, n.variant), s = {
|
|
2828
2828
|
...o,
|
|
2829
|
-
content: n.content ?
|
|
2829
|
+
content: n.content ? fn(o.content, n.content) : o.content,
|
|
2830
2830
|
style: {
|
|
2831
2831
|
...o.style,
|
|
2832
2832
|
...n.style
|
|
2833
2833
|
}
|
|
2834
|
-
}, c =
|
|
2835
|
-
if ("error" in d) return i(
|
|
2834
|
+
}, c = j(r), l = new Set(e.flatMap((e) => j(e).map((e) => e.id))), u = n.id && /^[A-Za-z0-9_-]{1,40}$/.test(n.id) && !l.has(n.id) ? n.id : h("section"), d = rn(c, n, n.kind === "header" ? 0 : n.kind !== "footer" && c[c.length - 1] && _(c[c.length - 1])?.kind === "footer" ? c.length - 1 : c.length);
|
|
2835
|
+
if ("error" in d) return i(O(d.error));
|
|
2836
2836
|
let f = [
|
|
2837
2837
|
...c.slice(0, d.index),
|
|
2838
|
-
|
|
2838
|
+
g(s, u),
|
|
2839
2839
|
...c.slice(d.index)
|
|
2840
2840
|
];
|
|
2841
2841
|
return {
|
|
2842
|
-
pages:
|
|
2842
|
+
pages: A(e, r.id, f),
|
|
2843
2843
|
ds: t,
|
|
2844
|
-
result:
|
|
2844
|
+
result: k(`Added a ${a.label.toLowerCase()} section to ${r.name}.`, u)
|
|
2845
2845
|
};
|
|
2846
2846
|
}
|
|
2847
2847
|
case "updateSection": {
|
|
2848
|
-
let r =
|
|
2849
|
-
if (!r) return i(
|
|
2850
|
-
let a =
|
|
2851
|
-
if (!o) return i(
|
|
2852
|
-
if (n.content === void 0 && n.variant === void 0 && n.style === void 0) return i(
|
|
2853
|
-
let s =
|
|
2854
|
-
if (n.variant && !s.variants.some((e) => e.id === n.variant)) return i(
|
|
2848
|
+
let r = en(e, n.sectionId);
|
|
2849
|
+
if (!r) return i(tn(n.sectionId));
|
|
2850
|
+
let a = j(r.page)[r.index], o = _(a);
|
|
2851
|
+
if (!o) return i(O("That section was designed by hand, so its words aren't fields: change the elements inside it one at a time instead."));
|
|
2852
|
+
if (n.content === void 0 && n.variant === void 0 && n.style === void 0) return i(O("There was nothing to change in that section."));
|
|
2853
|
+
let s = v(o.kind);
|
|
2854
|
+
if (n.variant && !s.variants.some((e) => e.id === n.variant)) return i(O(`A ${s.label.toLowerCase()} section doesn't have a "${n.variant}" layout. Choose from: ${s.variants.map((e) => e.id).join(", ")}.`));
|
|
2855
2855
|
if (n.content) {
|
|
2856
|
-
let e =
|
|
2857
|
-
if (e) return i(
|
|
2856
|
+
let e = dn(o.kind, n.content);
|
|
2857
|
+
if (e) return i(O(e));
|
|
2858
2858
|
}
|
|
2859
2859
|
let c = a;
|
|
2860
|
-
if (n.variant && (c =
|
|
2861
|
-
let e =
|
|
2860
|
+
if (n.variant && (c = pe(c, n.variant)), n.content) {
|
|
2861
|
+
let e = _(c);
|
|
2862
2862
|
c = de(c, {
|
|
2863
2863
|
...e,
|
|
2864
|
-
content:
|
|
2864
|
+
content: fn(e.content, n.content)
|
|
2865
2865
|
});
|
|
2866
2866
|
}
|
|
2867
2867
|
n.style && (c = ge(c, n.style));
|
|
2868
|
-
let l =
|
|
2868
|
+
let l = j(r.page).map((e, t) => t === r.index ? c : e);
|
|
2869
2869
|
return {
|
|
2870
|
-
pages:
|
|
2870
|
+
pages: A(e, r.page.id, l),
|
|
2871
2871
|
ds: t,
|
|
2872
|
-
result:
|
|
2872
|
+
result: k(`Updated the ${s.label.toLowerCase()} section on ${r.page.name}.`, a.id)
|
|
2873
2873
|
};
|
|
2874
2874
|
}
|
|
2875
2875
|
case "updateElement": {
|
|
2876
|
-
let r =
|
|
2877
|
-
if (!r) return i(
|
|
2878
|
-
let a =
|
|
2879
|
-
if (
|
|
2880
|
-
if (r.node.id === a.id && (n.text !== void 0 || n.href !== void 0 || n.alt !== void 0 || n.src !== void 0)) return i(
|
|
2876
|
+
let r = M(e, n.nodeId);
|
|
2877
|
+
if (!r) return i(O(`I couldn't find an element called "${n.nodeId}" on the site. It may have been removed already.`));
|
|
2878
|
+
let a = j(r.page)[r.index];
|
|
2879
|
+
if (_(a)) return i(O(F));
|
|
2880
|
+
if (r.node.id === a.id && (n.text !== void 0 || n.href !== void 0 || n.alt !== void 0 || n.src !== void 0)) return i(O("A section has no words of its own; change the elements inside it."));
|
|
2881
2881
|
if ([
|
|
2882
2882
|
"text",
|
|
2883
2883
|
"href",
|
|
@@ -2887,14 +2887,14 @@ function yn(e, t, n, r) {
|
|
|
2887
2887
|
"hidden",
|
|
2888
2888
|
"style",
|
|
2889
2889
|
"responsive"
|
|
2890
|
-
].every((e) => n[e] === void 0)) return i(
|
|
2890
|
+
].every((e) => n[e] === void 0)) return i(O("There was nothing to change in that element."));
|
|
2891
2891
|
let o = r.node;
|
|
2892
|
-
if (n.text !== void 0 && !
|
|
2893
|
-
if (n.href !== void 0 && /^\s*(javascript|data|vbscript):/i.test(n.href)) return i(
|
|
2894
|
-
if ((n.alt !== void 0 || n.src !== void 0) && o.type !== "image") return i(
|
|
2895
|
-
let s = n.style ?
|
|
2896
|
-
if (s && !Object.keys(s.styles).length && n.style && Object.keys(n.style).length && n.text === void 0 && n.href === void 0 && n.alt === void 0 && n.src === void 0 && !c.some(([, e]) => e && Object.keys(e.styles).length)) return i(
|
|
2897
|
-
let u =
|
|
2892
|
+
if (n.text !== void 0 && !gn.has(o.type) && typeof o.content != "string") return i(O(`That ${o.type} has no words to change.`));
|
|
2893
|
+
if (n.href !== void 0 && /^\s*(javascript|data|vbscript):/i.test(n.href)) return i(O("That link isn't one I can use. Use a page address like /about or a full https:// address."));
|
|
2894
|
+
if ((n.alt !== void 0 || n.src !== void 0) && o.type !== "image") return i(O("Only a picture has a picture address and description."));
|
|
2895
|
+
let s = n.style ? Ot(n.style) : null, c = ["tablet", "mobile"].map((e) => [e, n.responsive?.[e] ? Ot(n.responsive[e]) : null]), l = [...s?.dropped ?? [], ...c.flatMap(([, e]) => e?.dropped ?? [])];
|
|
2896
|
+
if (s && !Object.keys(s.styles).length && n.style && Object.keys(n.style).length && n.text === void 0 && n.href === void 0 && n.alt === void 0 && n.src === void 0 && !c.some(([, e]) => e && Object.keys(e.styles).length)) return i(O(`None of those look settings are ones I know${vn(l)}`));
|
|
2897
|
+
let u = N(o), d = kt({
|
|
2898
2898
|
href: n.href,
|
|
2899
2899
|
alt: n.alt,
|
|
2900
2900
|
src: n.src
|
|
@@ -2928,52 +2928,52 @@ function yn(e, t, n, r) {
|
|
|
2928
2928
|
n.name !== void 0 && "name"
|
|
2929
2929
|
].filter(Boolean).join(" and ");
|
|
2930
2930
|
return {
|
|
2931
|
-
pages:
|
|
2931
|
+
pages: I(e, r.page, r.index, Ft(a, n.nodeId, f)),
|
|
2932
2932
|
ds: t,
|
|
2933
|
-
result:
|
|
2933
|
+
result: k(`Changed the ${p} of ${u} on ${r.page.name}.${vn(l)}`, a.id)
|
|
2934
2934
|
};
|
|
2935
2935
|
}
|
|
2936
2936
|
case "addElement": {
|
|
2937
|
-
let r =
|
|
2938
|
-
if (!r) return i(
|
|
2939
|
-
let a =
|
|
2940
|
-
if (
|
|
2937
|
+
let r = M(e, n.parentId);
|
|
2938
|
+
if (!r) return i(O(`I couldn't find the group "${n.parentId}" to add it to.`));
|
|
2939
|
+
let a = j(r.page)[r.index];
|
|
2940
|
+
if (_(a)) return i(O(F));
|
|
2941
2941
|
if (![
|
|
2942
2942
|
"section",
|
|
2943
2943
|
"container",
|
|
2944
2944
|
"card"
|
|
2945
|
-
].includes(r.node.type)) return i(
|
|
2946
|
-
let o =
|
|
2947
|
-
if (typeof o == "string") return i(
|
|
2945
|
+
].includes(r.node.type)) return i(O(`A ${r.node.type} can't hold other elements. Add it to a section, container or card.`));
|
|
2946
|
+
let o = yn(r.node.children ?? [], n);
|
|
2947
|
+
if (typeof o == "string") return i(O(o));
|
|
2948
2948
|
let s;
|
|
2949
2949
|
try {
|
|
2950
|
-
s =
|
|
2950
|
+
s = Pt(n.element, _n(e));
|
|
2951
2951
|
} catch (e) {
|
|
2952
|
-
return i(
|
|
2952
|
+
return i(O(e.message));
|
|
2953
2953
|
}
|
|
2954
|
-
let c =
|
|
2954
|
+
let c = Bt(a, n.parentId, s.node, o);
|
|
2955
2955
|
return {
|
|
2956
|
-
pages:
|
|
2956
|
+
pages: I(e, r.page, r.index, c),
|
|
2957
2957
|
ds: t,
|
|
2958
|
-
result:
|
|
2958
|
+
result: k(`Added ${N(s.node)} to ${r.page.name}.${vn(s.dropped)}`, a.id)
|
|
2959
2959
|
};
|
|
2960
2960
|
}
|
|
2961
2961
|
case "removeElement": {
|
|
2962
|
-
let r =
|
|
2963
|
-
if (!r) return i(
|
|
2964
|
-
let a =
|
|
2965
|
-
return r.node.id === a.id ? i(
|
|
2966
|
-
pages:
|
|
2962
|
+
let r = M(e, n.nodeId);
|
|
2963
|
+
if (!r) return i(O(`I couldn't find an element called "${n.nodeId}". It may have been removed already.`));
|
|
2964
|
+
let a = j(r.page)[r.index];
|
|
2965
|
+
return r.node.id === a.id ? i(O("That is a whole section. Use removeSection to take it out.")) : _(a) ? i(O(F)) : {
|
|
2966
|
+
pages: I(e, r.page, r.index, zt(a, n.nodeId)),
|
|
2967
2967
|
ds: t,
|
|
2968
|
-
result:
|
|
2968
|
+
result: k(`Removed ${N(r.node)} from ${r.page.name}.`, a.id)
|
|
2969
2969
|
};
|
|
2970
2970
|
}
|
|
2971
2971
|
case "duplicateElement": {
|
|
2972
|
-
let r =
|
|
2973
|
-
if (!r) return i(
|
|
2974
|
-
let a =
|
|
2975
|
-
if (r.node.id === a.id) return i(
|
|
2976
|
-
if (
|
|
2972
|
+
let r = M(e, n.nodeId);
|
|
2973
|
+
if (!r) return i(O(`I couldn't find an element called "${n.nodeId}".`));
|
|
2974
|
+
let a = j(r.page)[r.index];
|
|
2975
|
+
if (r.node.id === a.id) return i(O("That is a whole section. Use duplicateSection to copy it."));
|
|
2976
|
+
if (_(a)) return i(O(F));
|
|
2977
2977
|
let o = (function e(t) {
|
|
2978
2978
|
if (t.children?.some((e) => e.id === n.nodeId)) return t;
|
|
2979
2979
|
for (let n of t.children ?? []) {
|
|
@@ -2981,20 +2981,20 @@ function yn(e, t, n, r) {
|
|
|
2981
2981
|
if (t) return t;
|
|
2982
2982
|
}
|
|
2983
2983
|
return null;
|
|
2984
|
-
})(a), s = o.children.findIndex((e) => e.id === n.nodeId), c =
|
|
2984
|
+
})(a), s = o.children.findIndex((e) => e.id === n.nodeId), c = Vt(r.node, _n(e));
|
|
2985
2985
|
return {
|
|
2986
|
-
pages:
|
|
2986
|
+
pages: I(e, r.page, r.index, Bt(a, o.id, c, s + 1)),
|
|
2987
2987
|
ds: t,
|
|
2988
|
-
result:
|
|
2988
|
+
result: k(`Copied ${N(r.node)} on ${r.page.name}.`, a.id)
|
|
2989
2989
|
};
|
|
2990
2990
|
}
|
|
2991
2991
|
case "moveElement": {
|
|
2992
|
-
let r =
|
|
2993
|
-
if (!r) return i(
|
|
2994
|
-
let a =
|
|
2995
|
-
if (r.node.id === a.id) return i(
|
|
2996
|
-
if (
|
|
2997
|
-
if (n.parentId === void 0 && n.index === void 0 && n.afterNodeId === void 0) return i(
|
|
2992
|
+
let r = M(e, n.nodeId);
|
|
2993
|
+
if (!r) return i(O(`I couldn't find an element called "${n.nodeId}".`));
|
|
2994
|
+
let a = j(r.page)[r.index];
|
|
2995
|
+
if (r.node.id === a.id) return i(O("That is a whole section. Use moveSection to move it."));
|
|
2996
|
+
if (_(a)) return i(O(F));
|
|
2997
|
+
if (n.parentId === void 0 && n.index === void 0 && n.afterNodeId === void 0) return i(O("I need to know where to move it to."));
|
|
2998
2998
|
let o = (function e(t) {
|
|
2999
2999
|
if (t.children?.some((e) => e.id === n.nodeId)) return t;
|
|
3000
3000
|
for (let n of t.children ?? []) {
|
|
@@ -3003,117 +3003,117 @@ function yn(e, t, n, r) {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
return null;
|
|
3005
3005
|
})(a), s = n.parentId ?? o.id;
|
|
3006
|
-
if (
|
|
3007
|
-
let c =
|
|
3008
|
-
if (!c) return i(
|
|
3009
|
-
let l =
|
|
3010
|
-
if (
|
|
3006
|
+
if (It(r.node, s)) return i(O("An element can't be moved inside itself."));
|
|
3007
|
+
let c = M(e, s);
|
|
3008
|
+
if (!c) return i(O(`I couldn't find the group "${s}" to move it into.`));
|
|
3009
|
+
let l = j(c.page)[c.index];
|
|
3010
|
+
if (_(l)) return i(O(F));
|
|
3011
3011
|
if (![
|
|
3012
3012
|
"section",
|
|
3013
3013
|
"container",
|
|
3014
3014
|
"card"
|
|
3015
|
-
].includes(c.node.type)) return i(
|
|
3016
|
-
let u =
|
|
3017
|
-
return typeof f == "string" ? i(
|
|
3018
|
-
pages:
|
|
3015
|
+
].includes(c.node.type)) return i(O(`A ${c.node.type} can't hold other elements.`));
|
|
3016
|
+
let u = I(e, r.page, r.index, zt(a, n.nodeId)), d = M(u, s), f = yn(d.node.children ?? [], n);
|
|
3017
|
+
return typeof f == "string" ? i(O(f)) : {
|
|
3018
|
+
pages: I(u, d.page, d.index, Bt(j(d.page)[d.index], s, r.node, f)),
|
|
3019
3019
|
ds: t,
|
|
3020
|
-
result:
|
|
3020
|
+
result: k(`Moved ${N(r.node)} on ${r.page.name}.`, a.id)
|
|
3021
3021
|
};
|
|
3022
3022
|
}
|
|
3023
3023
|
case "addCustomSection": {
|
|
3024
|
-
let r =
|
|
3025
|
-
if (!r) return i(
|
|
3024
|
+
let r = $t(e, n.pageId);
|
|
3025
|
+
if (!r) return i(O(`I couldn't find a page called "${n.pageId}".`));
|
|
3026
3026
|
let a;
|
|
3027
3027
|
try {
|
|
3028
|
-
a =
|
|
3028
|
+
a = Pt(n.element, _n(e), { section: !0 });
|
|
3029
3029
|
} catch (e) {
|
|
3030
|
-
return i(
|
|
3030
|
+
return i(O(e.message));
|
|
3031
3031
|
}
|
|
3032
|
-
let o =
|
|
3033
|
-
if ("error" in s) return i(
|
|
3032
|
+
let o = j(r), s = rn(o, n, o.length);
|
|
3033
|
+
if ("error" in s) return i(O(s.error));
|
|
3034
3034
|
let c = [
|
|
3035
3035
|
...o.slice(0, s.index),
|
|
3036
3036
|
a.node,
|
|
3037
3037
|
...o.slice(s.index)
|
|
3038
3038
|
];
|
|
3039
3039
|
return {
|
|
3040
|
-
pages:
|
|
3040
|
+
pages: A(e, r.id, c),
|
|
3041
3041
|
ds: t,
|
|
3042
|
-
result:
|
|
3042
|
+
result: k(`Added a new ${a.node.name.toLowerCase()} to ${r.name}.${vn(a.dropped)}`, a.node.id)
|
|
3043
3043
|
};
|
|
3044
3044
|
}
|
|
3045
3045
|
case "replaceSection": {
|
|
3046
|
-
let r =
|
|
3047
|
-
if (!r) return i(
|
|
3048
|
-
let a =
|
|
3049
|
-
o.delete(a.id),
|
|
3046
|
+
let r = en(e, n.sectionId);
|
|
3047
|
+
if (!r) return i(tn(n.sectionId));
|
|
3048
|
+
let a = j(r.page)[r.index], o = _n(e);
|
|
3049
|
+
o.delete(a.id), Lt(a).forEach((e) => o.delete(e));
|
|
3050
3050
|
let s;
|
|
3051
3051
|
try {
|
|
3052
|
-
s =
|
|
3052
|
+
s = Pt({
|
|
3053
3053
|
...n.element,
|
|
3054
3054
|
id: a.id
|
|
3055
3055
|
}, o, { section: !0 });
|
|
3056
3056
|
} catch (e) {
|
|
3057
|
-
return i(
|
|
3057
|
+
return i(O(e.message));
|
|
3058
3058
|
}
|
|
3059
|
-
let c =
|
|
3059
|
+
let c = _(a) ? " It is hand-designed now, so it's changed element by element instead of through its fields." : "";
|
|
3060
3060
|
return {
|
|
3061
|
-
pages:
|
|
3061
|
+
pages: I(e, r.page, r.index, {
|
|
3062
3062
|
...s.node,
|
|
3063
3063
|
id: a.id
|
|
3064
3064
|
}),
|
|
3065
3065
|
ds: t,
|
|
3066
|
-
result:
|
|
3066
|
+
result: k(`Rebuilt the ${nn(a).toLowerCase()} section on ${r.page.name}.${c}${vn(s.dropped)}`, a.id)
|
|
3067
3067
|
};
|
|
3068
3068
|
}
|
|
3069
3069
|
case "removeSection": {
|
|
3070
|
-
let r =
|
|
3071
|
-
if (!r) return i(
|
|
3072
|
-
let a =
|
|
3070
|
+
let r = en(e, n.sectionId);
|
|
3071
|
+
if (!r) return i(tn(n.sectionId));
|
|
3072
|
+
let a = j(r.page)[r.index];
|
|
3073
3073
|
return {
|
|
3074
|
-
pages:
|
|
3074
|
+
pages: A(e, r.page.id, j(r.page).filter((e, t) => t !== r.index)),
|
|
3075
3075
|
ds: t,
|
|
3076
|
-
result:
|
|
3076
|
+
result: k(`Removed the ${nn(a).toLowerCase()} section from ${r.page.name}.`)
|
|
3077
3077
|
};
|
|
3078
3078
|
}
|
|
3079
3079
|
case "moveSection": {
|
|
3080
|
-
let r =
|
|
3081
|
-
if (!r) return i(
|
|
3082
|
-
if (n.index === void 0 && n.afterSectionId === void 0) return i(
|
|
3083
|
-
let a =
|
|
3084
|
-
if (n.afterSectionId === n.sectionId) return i(
|
|
3085
|
-
let o =
|
|
3086
|
-
if ("error" in s) return i(
|
|
3080
|
+
let r = en(e, n.sectionId);
|
|
3081
|
+
if (!r) return i(tn(n.sectionId));
|
|
3082
|
+
if (n.index === void 0 && n.afterSectionId === void 0) return i(O("I need to know where to move it to."));
|
|
3083
|
+
let a = j(r.page)[r.index];
|
|
3084
|
+
if (n.afterSectionId === n.sectionId) return i(O("A section can't be moved after itself."));
|
|
3085
|
+
let o = j(r.page).filter((e, t) => t !== r.index), s = rn(o, n, o.length);
|
|
3086
|
+
if ("error" in s) return i(O(s.error));
|
|
3087
3087
|
let c = [
|
|
3088
3088
|
...o.slice(0, s.index),
|
|
3089
3089
|
a,
|
|
3090
3090
|
...o.slice(s.index)
|
|
3091
3091
|
];
|
|
3092
3092
|
return {
|
|
3093
|
-
pages:
|
|
3093
|
+
pages: A(e, r.page.id, c),
|
|
3094
3094
|
ds: t,
|
|
3095
|
-
result:
|
|
3095
|
+
result: k(`Moved the ${nn(a).toLowerCase()} section on ${r.page.name}.`, a.id)
|
|
3096
3096
|
};
|
|
3097
3097
|
}
|
|
3098
3098
|
case "duplicateSection": {
|
|
3099
|
-
let r =
|
|
3100
|
-
if (!r) return i(
|
|
3101
|
-
let a =
|
|
3102
|
-
...
|
|
3099
|
+
let r = en(e, n.sectionId);
|
|
3100
|
+
if (!r) return i(tn(n.sectionId));
|
|
3101
|
+
let a = j(r.page), o = a[r.index], s = h("section"), c = _(o), l = c ? g(c, s) : {
|
|
3102
|
+
...on(o),
|
|
3103
3103
|
id: s
|
|
3104
3104
|
};
|
|
3105
3105
|
return {
|
|
3106
|
-
pages:
|
|
3106
|
+
pages: A(e, r.page.id, [
|
|
3107
3107
|
...a.slice(0, r.index + 1),
|
|
3108
3108
|
l,
|
|
3109
3109
|
...a.slice(r.index + 1)
|
|
3110
3110
|
]),
|
|
3111
3111
|
ds: t,
|
|
3112
|
-
result:
|
|
3112
|
+
result: k(`Copied the ${nn(o).toLowerCase()} section on ${r.page.name}.`, s)
|
|
3113
3113
|
};
|
|
3114
3114
|
}
|
|
3115
3115
|
case "setBrand": {
|
|
3116
|
-
let r =
|
|
3116
|
+
let r = hn(t, n.tokens);
|
|
3117
3117
|
return {
|
|
3118
3118
|
pages: e,
|
|
3119
3119
|
ds: r.ds,
|
|
@@ -3122,21 +3122,21 @@ function yn(e, t, n, r) {
|
|
|
3122
3122
|
}
|
|
3123
3123
|
case "addPage": {
|
|
3124
3124
|
let a = n.name.trim();
|
|
3125
|
-
if (!a) return i(
|
|
3126
|
-
if (e.some((e) => e.name.trim().toLowerCase() === a.toLowerCase())) return i(
|
|
3125
|
+
if (!a) return i(O("The new page needs a name."));
|
|
3126
|
+
if (e.some((e) => e.name.trim().toLowerCase() === a.toLowerCase())) return i(O(`There's already a page called "${a}".`));
|
|
3127
3127
|
let o = [], s = "";
|
|
3128
3128
|
if (n.templateId) {
|
|
3129
3129
|
let e = null;
|
|
3130
3130
|
try {
|
|
3131
|
-
e = (r.templates ??
|
|
3131
|
+
e = (r.templates ?? Yt)?.(n.templateId) ?? null;
|
|
3132
3132
|
} catch {
|
|
3133
3133
|
e = null;
|
|
3134
3134
|
}
|
|
3135
3135
|
e ? o = e : s = ` (I couldn't find the "${n.templateId}" starting layout, so it's blank.)`;
|
|
3136
3136
|
}
|
|
3137
|
-
let c = new Set(e.map((e) => e.slug)), l =
|
|
3137
|
+
let c = new Set(e.map((e) => e.slug)), l = an(a), u = l;
|
|
3138
3138
|
for (let e = 2; c.has(u); e++) u = `${l}-${e}`;
|
|
3139
|
-
let d =
|
|
3139
|
+
let d = ie()[0], f = {
|
|
3140
3140
|
id: h("page"),
|
|
3141
3141
|
name: a,
|
|
3142
3142
|
slug: u,
|
|
@@ -3149,38 +3149,38 @@ function yn(e, t, n, r) {
|
|
|
3149
3149
|
return {
|
|
3150
3150
|
pages: [...e, f],
|
|
3151
3151
|
ds: t,
|
|
3152
|
-
result:
|
|
3152
|
+
result: k(`Added a new page called ${a}.${s}`)
|
|
3153
3153
|
};
|
|
3154
3154
|
}
|
|
3155
3155
|
case "renamePage": {
|
|
3156
|
-
let r =
|
|
3157
|
-
if (!r) return i(
|
|
3156
|
+
let r = $t(e, n.pageId);
|
|
3157
|
+
if (!r) return i(O(`I couldn't find a page called "${n.pageId}".`));
|
|
3158
3158
|
let a = n.name.trim();
|
|
3159
|
-
return e.some((e) => e.id !== r.id && e.name.trim().toLowerCase() === a.toLowerCase()) ? i(
|
|
3159
|
+
return e.some((e) => e.id !== r.id && e.name.trim().toLowerCase() === a.toLowerCase()) ? i(O(`There's already a page called "${a}".`)) : {
|
|
3160
3160
|
pages: e.map((e) => e.id === r.id ? {
|
|
3161
3161
|
...e,
|
|
3162
3162
|
name: a
|
|
3163
3163
|
} : e),
|
|
3164
3164
|
ds: t,
|
|
3165
|
-
result:
|
|
3165
|
+
result: k(`Renamed ${r.name} to ${a}.`)
|
|
3166
3166
|
};
|
|
3167
3167
|
}
|
|
3168
3168
|
}
|
|
3169
3169
|
}
|
|
3170
|
-
function
|
|
3170
|
+
function xn(e, t, n, r = {}) {
|
|
3171
3171
|
let i = e, a = t, o = [];
|
|
3172
3172
|
for (let e of Array.isArray(n) ? n : []) {
|
|
3173
|
-
let t =
|
|
3173
|
+
let t = Jt.safeParse(e);
|
|
3174
3174
|
if (!t.success) {
|
|
3175
|
-
let t =
|
|
3176
|
-
o.push(
|
|
3175
|
+
let t = cn(e) && typeof e.op == "string" ? e.op : "";
|
|
3176
|
+
o.push(O(t ? `I didn't understand one of the "${t}" changes, so I skipped it.` : "I didn't understand one of the changes, so I skipped it."));
|
|
3177
3177
|
continue;
|
|
3178
3178
|
}
|
|
3179
3179
|
try {
|
|
3180
|
-
let e =
|
|
3180
|
+
let e = bn(i, a, t.data, r);
|
|
3181
3181
|
i = e.pages, a = e.ds, o.push(e.result);
|
|
3182
3182
|
} catch {
|
|
3183
|
-
o.push(
|
|
3183
|
+
o.push(O("Something went wrong with one of the changes, so I skipped it."));
|
|
3184
3184
|
}
|
|
3185
3185
|
}
|
|
3186
3186
|
return {
|
|
@@ -3191,8 +3191,8 @@ function bn(e, t, n, r = {}) {
|
|
|
3191
3191
|
}
|
|
3192
3192
|
//#endregion
|
|
3193
3193
|
//#region src/v2/sol/parse.ts
|
|
3194
|
-
var
|
|
3195
|
-
function
|
|
3194
|
+
var Sn = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*?)```/i, Cn = /```[ \t]*plexo-commands[ \t]*\r?\n([\s\S]*)$/i;
|
|
3195
|
+
function wn(e) {
|
|
3196
3196
|
let t = "", n = !1;
|
|
3197
3197
|
for (let r = 0; r < e.length; r++) {
|
|
3198
3198
|
let i = e[r];
|
|
@@ -3217,15 +3217,15 @@ function Cn(e) {
|
|
|
3217
3217
|
}
|
|
3218
3218
|
return t;
|
|
3219
3219
|
}
|
|
3220
|
-
function
|
|
3221
|
-
let t =
|
|
3220
|
+
function Tn(e) {
|
|
3221
|
+
let t = Sn.exec(e), n = t ? null : Cn.exec(e), r = t ?? n;
|
|
3222
3222
|
if (!r) return {
|
|
3223
3223
|
text: e.trim(),
|
|
3224
3224
|
commands: null
|
|
3225
3225
|
};
|
|
3226
3226
|
let i = e.replace(r[0], "").replace(/\n{3,}/g, "\n\n").trim(), a;
|
|
3227
3227
|
try {
|
|
3228
|
-
a = JSON.parse(
|
|
3228
|
+
a = JSON.parse(wn(r[1].trim()));
|
|
3229
3229
|
} catch {
|
|
3230
3230
|
return {
|
|
3231
3231
|
text: i,
|
|
@@ -3241,7 +3241,7 @@ function wn(e) {
|
|
|
3241
3241
|
};
|
|
3242
3242
|
let s = [];
|
|
3243
3243
|
for (let e of o) {
|
|
3244
|
-
let t =
|
|
3244
|
+
let t = Jt.safeParse(e);
|
|
3245
3245
|
t.success && s.push(t.data);
|
|
3246
3246
|
}
|
|
3247
3247
|
let c = o.length - s.length;
|
|
@@ -3255,18 +3255,18 @@ function wn(e) {
|
|
|
3255
3255
|
error: o.length ? "I couldn't understand the changes SOL suggested. Try asking again." : void 0
|
|
3256
3256
|
};
|
|
3257
3257
|
}
|
|
3258
|
-
var
|
|
3259
|
-
function
|
|
3258
|
+
var En = /```[ \t]*plexo-commands[ \t]*\r?\n/i, Dn = "```plexo-commands";
|
|
3259
|
+
function On(e) {
|
|
3260
3260
|
for (let t = Math.min(19, e.length); t >= 3; t--) {
|
|
3261
3261
|
let n = e.slice(-t);
|
|
3262
|
-
if (n[0] === "`" &&
|
|
3262
|
+
if (n[0] === "`" && Dn.startsWith(n.trimEnd().toLowerCase())) return e.slice(0, -t);
|
|
3263
3263
|
}
|
|
3264
3264
|
return e;
|
|
3265
3265
|
}
|
|
3266
|
-
function
|
|
3267
|
-
let t =
|
|
3266
|
+
function kn(e) {
|
|
3267
|
+
let t = En.exec(e);
|
|
3268
3268
|
if (!t) return {
|
|
3269
|
-
text:
|
|
3269
|
+
text: On(e).trim(),
|
|
3270
3270
|
commands: [],
|
|
3271
3271
|
writing: !1
|
|
3272
3272
|
};
|
|
@@ -3285,11 +3285,11 @@ function On(e) {
|
|
|
3285
3285
|
if (e--, e === 1 && n !== -1) {
|
|
3286
3286
|
let e;
|
|
3287
3287
|
try {
|
|
3288
|
-
e = JSON.parse(
|
|
3288
|
+
e = JSON.parse(wn(a.slice(n, r + 1)));
|
|
3289
3289
|
} catch {
|
|
3290
3290
|
e = void 0;
|
|
3291
3291
|
}
|
|
3292
|
-
let t =
|
|
3292
|
+
let t = Jt.safeParse(e);
|
|
3293
3293
|
s.push(t.success ? t.data : null), n = -1;
|
|
3294
3294
|
}
|
|
3295
3295
|
} else i === "[" ? e++ : i === "]" && e--;
|
|
@@ -3303,7 +3303,7 @@ function On(e) {
|
|
|
3303
3303
|
}
|
|
3304
3304
|
//#endregion
|
|
3305
3305
|
//#region src/v2/sol/summarize.ts
|
|
3306
|
-
var
|
|
3306
|
+
var An = {
|
|
3307
3307
|
primaryColor: "main colour",
|
|
3308
3308
|
secondaryColor: "second colour",
|
|
3309
3309
|
headingFont: "heading font",
|
|
@@ -3311,7 +3311,7 @@ var kn = {
|
|
|
3311
3311
|
neutrals: "background feel",
|
|
3312
3312
|
roundness: "corner roundness"
|
|
3313
3313
|
};
|
|
3314
|
-
function
|
|
3314
|
+
function jn(e, t) {
|
|
3315
3315
|
let n = (e) => t.find((t) => t.id === e || t.name.toLowerCase() === e.toLowerCase()), r = (e) => {
|
|
3316
3316
|
for (let n of t) {
|
|
3317
3317
|
let t = (n.rootNode.children ?? []).find((t) => t.id === e);
|
|
@@ -3322,21 +3322,21 @@ function An(e, t) {
|
|
|
3322
3322
|
}
|
|
3323
3323
|
return null;
|
|
3324
3324
|
}, i = (e) => {
|
|
3325
|
-
let t = r(e), n = t &&
|
|
3326
|
-
return n &&
|
|
3325
|
+
let t = r(e), n = t && _(t.s);
|
|
3326
|
+
return n && fe(n.kind) ? `the ${v(n.kind).label.toLowerCase()} section` : "a section";
|
|
3327
3327
|
}, a = (e) => {
|
|
3328
3328
|
let t = r(e);
|
|
3329
3329
|
return t ? ` on ${t.p.name}` : "";
|
|
3330
3330
|
};
|
|
3331
3331
|
switch (e.op) {
|
|
3332
|
-
case "addSection": return `Add a ${
|
|
3332
|
+
case "addSection": return `Add a ${fe(e.kind) ? v(e.kind).label.toLowerCase() : e.kind} section to ${n(e.pageId)?.name ?? "a page"}`;
|
|
3333
3333
|
case "updateSection": return `Change ${[
|
|
3334
3334
|
e.content && "the wording",
|
|
3335
3335
|
e.variant && "the layout",
|
|
3336
3336
|
e.style && "the look"
|
|
3337
3337
|
].filter(Boolean).join(" and ") || "it"} of ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
3338
3338
|
case "updateElement": {
|
|
3339
|
-
let n =
|
|
3339
|
+
let n = P(t, e.nodeId);
|
|
3340
3340
|
return `Change ${[
|
|
3341
3341
|
e.text !== void 0 && "the wording",
|
|
3342
3342
|
(e.href !== void 0 || e.src !== void 0) && "the link or picture",
|
|
@@ -3346,17 +3346,17 @@ function An(e, t) {
|
|
|
3346
3346
|
e.name !== void 0 && "the name"
|
|
3347
3347
|
].filter(Boolean).join(" and ") || "it"} of ${n.label}${n.page ? ` on ${n.page}` : ""}`;
|
|
3348
3348
|
}
|
|
3349
|
-
case "addElement": return `Add ${e.element.type === "container" ? "a group of elements" : `a ${e.element.type}${e.element.content ? ` ("${e.element.content.slice(0, 40)}")` : ""}`}${
|
|
3349
|
+
case "addElement": return `Add ${e.element.type === "container" ? "a group of elements" : `a ${e.element.type}${e.element.content ? ` ("${e.element.content.slice(0, 40)}")` : ""}`}${P(t, e.parentId).page ? ` on ${P(t, e.parentId).page}` : ""}`;
|
|
3350
3350
|
case "removeElement": {
|
|
3351
|
-
let n =
|
|
3351
|
+
let n = P(t, e.nodeId);
|
|
3352
3352
|
return `Remove ${n.label}${n.page ? ` from ${n.page}` : ""}`;
|
|
3353
3353
|
}
|
|
3354
3354
|
case "moveElement": {
|
|
3355
|
-
let n =
|
|
3355
|
+
let n = P(t, e.nodeId);
|
|
3356
3356
|
return `Move ${n.label}${n.page ? ` on ${n.page}` : ""}`;
|
|
3357
3357
|
}
|
|
3358
3358
|
case "duplicateElement": {
|
|
3359
|
-
let n =
|
|
3359
|
+
let n = P(t, e.nodeId);
|
|
3360
3360
|
return `Make a copy of ${n.label}${n.page ? ` on ${n.page}` : ""}`;
|
|
3361
3361
|
}
|
|
3362
3362
|
case "addCustomSection": return `Add a new custom section to ${n(e.pageId)?.name ?? "a page"}`;
|
|
@@ -3364,14 +3364,14 @@ function An(e, t) {
|
|
|
3364
3364
|
case "removeSection": return `Remove ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
3365
3365
|
case "moveSection": return `Move ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
3366
3366
|
case "duplicateSection": return `Make a copy of ${i(e.sectionId)}${a(e.sectionId)}`;
|
|
3367
|
-
case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) =>
|
|
3367
|
+
case "setBrand": return `Update the brand (${Object.keys(e.tokens).map((e) => An[e] ?? "a brand setting").join(", ")})`;
|
|
3368
3368
|
case "addPage": return `Add a new page called "${e.name}"`;
|
|
3369
3369
|
case "renamePage": return `Rename ${n(e.pageId)?.name ?? "a page"} to "${e.name}"`;
|
|
3370
3370
|
}
|
|
3371
3371
|
}
|
|
3372
3372
|
//#endregion
|
|
3373
3373
|
//#region src/v2/sol/prompt.ts
|
|
3374
|
-
var
|
|
3374
|
+
var Mn = "You are SOL, a friendly assistant inside a website builder. The site owner is not technical: speak plainly, never mention JSON, ids, code or \"blocks\" in what you say to them.\n\nYou are given two JSON documents: \"catalog\" (every kind of section you can add, its layouts and the fields you can fill in) and \"design\" (the site's pages, their sections in order, and the brand). Only use kinds, layouts and fields that appear in the catalog, and only refer to pages and sections by the ids in \"design\".\n\nWhen the owner asks for a change, reply with one or two short, warm sentences explaining what you suggest, then a fenced block of changes like this:\n\n```plexo-commands\n[\n {\"op\": \"addSection\", \"pageId\": \"<page id>\", \"kind\": \"hero\", \"variant\": \"<layout id>\", \"content\": {\"headline\": \"...\"}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"updateSection\", \"sectionId\": \"<section id>\", \"content\": {\"heading\": \"...\"}, \"variant\": \"<layout id>\", \"style\": {\"background\": \"surface\", \"align\": \"center\", \"spacing\": \"airy\"}},\n {\"op\": \"updateElement\", \"nodeId\": \"<element id>\", \"text\": \"...\", \"href\": \"/about\", \"src\": \"https://...\", \"alt\": \"...\", \"name\": \"...\", \"hidden\": false, \"style\": {\"fontSize\": \"56px\", \"textColor\": \"#111\", \"display\": \"grid\"}, \"responsive\": {\"mobile\": {\"fontSize\": \"34px\"}, \"tablet\": {}}},\n {\"op\": \"addElement\", \"parentId\": \"<section, container or card id>\", \"element\": {\"type\": \"heading\", \"content\": \"...\", \"props\": {\"level\": 2}, \"styles\": {}}, \"afterNodeId\": \"<sibling id>\"},\n {\"op\": \"removeElement\", \"nodeId\": \"<element id>\"},\n {\"op\": \"moveElement\", \"nodeId\": \"<element id>\", \"parentId\": \"<group id>\", \"index\": 0},\n {\"op\": \"duplicateElement\", \"nodeId\": \"<element id>\"},\n {\"op\": \"addCustomSection\", \"pageId\": \"<page id>\", \"element\": {\"type\": \"section\", \"name\": \"Offer\", \"styles\": {\"backgroundColor\": \"#F4EFE6\"}, \"children\": []}, \"afterSectionId\": \"<section id>\"},\n {\"op\": \"replaceSection\", \"sectionId\": \"<section id>\", \"element\": {\"type\": \"section\", \"children\": []}},\n {\"op\": \"removeSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"moveSection\", \"sectionId\": \"<section id>\", \"index\": 0},\n {\"op\": \"duplicateSection\", \"sectionId\": \"<section id>\"},\n {\"op\": \"setBrand\", \"tokens\": {\"primaryColor\": \"#1D4ED8\", \"headingFont\": \"Poppins\", \"bodyFont\": \"Inter\", \"neutrals\": \"warm\", \"roundness\": \"round\"}},\n {\"op\": \"addPage\", \"name\": \"About\", \"templateId\": \"<optional, from catalog.pageTemplates>\"},\n {\"op\": \"renamePage\", \"pageId\": \"<page id>\", \"name\": \"Our story\"}\n]\n```\n\nRules:\n- The owner always reviews and approves your changes before anything happens, so suggest them confidently, but keep each suggestion small and focused.\n- Content keys are the field paths from the catalog (\"headline\", \"items.0.title\"). A list field needs the whole list. Keep text within each field's \"max\".\n- Write real, specific copy for the owner's business; never lorem ipsum.\n- Sections marked freeForm were designed by hand, so they have no fields. \"design\" lists each one as an outline of elements (id, type, words, link, the settings that decide its layout and look). You can change ANYTHING in them: updateElement for words, links, pictures and any look setting (also per screen with \"responsive\"); addElement, removeElement, moveElement and duplicateElement to restructure; replaceSection to rebuild a whole section from a fresh element tree; addCustomSection to build a new hand-designed section.\n- Elements you can create: container (a group; make columns with display \"grid\" and gridColumns or gridTemplateColumns, a row with display \"flex\" and flexDirection \"row\"), card, heading, paragraph, button, image (props src and alt), badge, divider, spacer, icon (props iconName). Give new elements real settings (padding, gap, colours, font sizes), use brand variables like var(--color-brand-primary-500) where they fit, set mobile settings (responsive.mobile) for anything wide, and give an element a short \"id\" if a later change in the same answer needs to refer to it.\n- Each element command changes one thing; send as many as needed. For a ready-made section (one with a kind) use updateSection; only use replaceSection on one when it truly needs a different structure — it becomes hand-designed afterwards.\n- When the owner has selected an element, \"Asking about\" gives its id: edit that element, not a different one. Make real, specific changes: a punchier headline is new words, not a restyle.\n- Stay on brand: \"design.brand.guidelines\" lists the brand's exact variables. Colour, font, size, spacing and corner settings should use them as var(--name) (e.g. var(--color-action-primary-bg), var(--space-6)), never a made-up hex colour or pixel value, so the site follows the brand when it changes in Strata.\n- If you only need to answer a question or give advice, reply in plain text with no block.", Nn = [
|
|
3375
3375
|
"color",
|
|
3376
3376
|
"font",
|
|
3377
3377
|
"fontSize",
|
|
@@ -3379,7 +3379,7 @@ var jn = "You are SOL, a friendly assistant inside a website builder. The site o
|
|
|
3379
3379
|
"radius",
|
|
3380
3380
|
"shadow",
|
|
3381
3381
|
"spacing"
|
|
3382
|
-
],
|
|
3382
|
+
], Pn = {
|
|
3383
3383
|
color: {
|
|
3384
3384
|
one: "colour",
|
|
3385
3385
|
many: "colours",
|
|
@@ -3415,14 +3415,14 @@ var jn = "You are SOL, a friendly assistant inside a website builder. The site o
|
|
|
3415
3415
|
many: "spacings",
|
|
3416
3416
|
nearest: "brand spacing"
|
|
3417
3417
|
}
|
|
3418
|
-
},
|
|
3418
|
+
}, Fn = [
|
|
3419
3419
|
"textColor",
|
|
3420
3420
|
"backgroundColor",
|
|
3421
3421
|
"darkModeBackgroundColor",
|
|
3422
3422
|
"borderColor",
|
|
3423
3423
|
"linkColor",
|
|
3424
3424
|
"linkHoverColor"
|
|
3425
|
-
],
|
|
3425
|
+
], In = [
|
|
3426
3426
|
"padding",
|
|
3427
3427
|
"paddingTop",
|
|
3428
3428
|
"paddingBottom",
|
|
@@ -3435,56 +3435,56 @@ var jn = "You are SOL, a friendly assistant inside a website builder. The site o
|
|
|
3435
3435
|
"marginRight",
|
|
3436
3436
|
"gap",
|
|
3437
3437
|
"gridGap"
|
|
3438
|
-
],
|
|
3439
|
-
let t =
|
|
3438
|
+
], Ln = /^(#[0-9a-f]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\)|white|black)$/i, Rn = /#[0-9a-f]{8}\b|#[0-9a-f]{6}\b|#[0-9a-f]{3,4}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/gi, zn = /^(\d*\.?\d+)(px|rem)$/i, Bn = (e, t = 2) => Math.round(e * 10 ** t) / 10 ** t, Vn = (e) => {
|
|
3439
|
+
let t = zn.exec(e.trim());
|
|
3440
3440
|
if (!t) return null;
|
|
3441
3441
|
let n = parseFloat(t[1]);
|
|
3442
3442
|
return t[2].toLowerCase() === "rem" ? n * 16 : n;
|
|
3443
|
-
},
|
|
3443
|
+
}, Hn = (e) => Ln.test(e.trim()) && (f(e)?.a ?? 0) > 0, Un = (e) => {
|
|
3444
3444
|
let t = f(e);
|
|
3445
3445
|
return !t || t.a <= 0 ? null : p({
|
|
3446
3446
|
...t,
|
|
3447
|
-
a:
|
|
3447
|
+
a: Bn(t.a, 2)
|
|
3448
3448
|
}).toLowerCase();
|
|
3449
|
-
},
|
|
3450
|
-
function
|
|
3449
|
+
}, Wn = (e) => e.trim().toLowerCase().replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").replace(/\(\s+/g, "(").replace(/\s+\)/g, ")");
|
|
3450
|
+
function Gn(e, t) {
|
|
3451
3451
|
switch (e) {
|
|
3452
|
-
case "color": return
|
|
3453
|
-
case "font": return
|
|
3452
|
+
case "color": return Un(t);
|
|
3453
|
+
case "font": return Ce(t).toLowerCase() || null;
|
|
3454
3454
|
case "fontSize":
|
|
3455
3455
|
case "radius":
|
|
3456
3456
|
case "spacing": {
|
|
3457
|
-
let e =
|
|
3458
|
-
return e === null || e <= 0 ? null : `${
|
|
3457
|
+
let e = Vn(t);
|
|
3458
|
+
return e === null || e <= 0 ? null : `${Bn(e)}px`;
|
|
3459
3459
|
}
|
|
3460
3460
|
case "lineHeight": {
|
|
3461
3461
|
let e = parseFloat(t);
|
|
3462
|
-
return Number.isFinite(e) && e > 0 ? String(
|
|
3462
|
+
return Number.isFinite(e) && e > 0 ? String(Bn(e)) : null;
|
|
3463
3463
|
}
|
|
3464
|
-
case "shadow": return
|
|
3464
|
+
case "shadow": return Wn(t) || null;
|
|
3465
3465
|
}
|
|
3466
3466
|
}
|
|
3467
|
-
function
|
|
3467
|
+
function L(e, t) {
|
|
3468
3468
|
if (!e) return e;
|
|
3469
3469
|
let n = null, r = e, i = (e, t) => {
|
|
3470
3470
|
t !== r[e] && (n ??= { ...r }, n[e] = t);
|
|
3471
3471
|
}, a = (e) => typeof r[e] == "string" && !r[e].includes("var(") ? r[e].trim() : null;
|
|
3472
|
-
for (let e of
|
|
3472
|
+
for (let e of Fn) {
|
|
3473
3473
|
let n = a(e);
|
|
3474
|
-
if (n &&
|
|
3474
|
+
if (n && Hn(n)) {
|
|
3475
3475
|
let r = t("color", n);
|
|
3476
3476
|
r !== void 0 && i(e, r);
|
|
3477
3477
|
}
|
|
3478
3478
|
}
|
|
3479
3479
|
let o = typeof r.backgroundGradient == "string" ? r.backgroundGradient : null;
|
|
3480
|
-
o && i("backgroundGradient", o.replace(
|
|
3480
|
+
o && i("backgroundGradient", o.replace(Rn, (e) => Hn(e) ? t("color", e) ?? e : e));
|
|
3481
3481
|
let s = a("fontFamily");
|
|
3482
3482
|
if (s && !/^(inherit|initial|unset)$/i.test(s)) {
|
|
3483
3483
|
let e = t("font", s);
|
|
3484
3484
|
e !== void 0 && i("fontFamily", e);
|
|
3485
3485
|
}
|
|
3486
3486
|
let c = a("fontSize");
|
|
3487
|
-
if (c &&
|
|
3487
|
+
if (c && zn.test(c)) {
|
|
3488
3488
|
let e = t("fontSize", c);
|
|
3489
3489
|
e !== void 0 && i("fontSize", e);
|
|
3490
3490
|
}
|
|
@@ -3501,11 +3501,11 @@ function Gn(e, t) {
|
|
|
3501
3501
|
let d = (e, n) => {
|
|
3502
3502
|
let r = a(e);
|
|
3503
3503
|
if (!r || r.includes("(")) return;
|
|
3504
|
-
let o = r.split(/\s+/).map((e) =>
|
|
3504
|
+
let o = r.split(/\s+/).map((e) => zn.test(e) && (Vn(e) ?? 0) > 0 ? t(n, e) ?? e : e).join(" ");
|
|
3505
3505
|
i(e, o);
|
|
3506
3506
|
};
|
|
3507
3507
|
d("borderRadius", "radius");
|
|
3508
|
-
for (let e of
|
|
3508
|
+
for (let e of In) d(e, "spacing");
|
|
3509
3509
|
return n ?? e;
|
|
3510
3510
|
}
|
|
3511
3511
|
var Kn = (e) => {
|
|
@@ -3515,7 +3515,7 @@ var Kn = (e) => {
|
|
|
3515
3515
|
function Yn(e, t) {
|
|
3516
3516
|
if (!e.overrides) return e;
|
|
3517
3517
|
let n = !1, r = Object.fromEntries(Object.entries(e.overrides).map(([e, r]) => {
|
|
3518
|
-
let i =
|
|
3518
|
+
let i = L(r.styles, t), a = L(r.responsive?.tablet, t), o = L(r.responsive?.mobile, t);
|
|
3519
3519
|
return i === r.styles && a === r.responsive?.tablet && o === r.responsive?.mobile ? [e, r] : (n = !0, [e, {
|
|
3520
3520
|
...r,
|
|
3521
3521
|
styles: i,
|
|
@@ -3545,7 +3545,7 @@ function Xn(e, t, n) {
|
|
|
3545
3545
|
}
|
|
3546
3546
|
}, e.id, a);
|
|
3547
3547
|
}
|
|
3548
|
-
let i =
|
|
3548
|
+
let i = L(e.styles, t), a = L(e.responsive?.tablet, t), o = L(e.responsive?.mobile, t), s = e.children?.map((e) => Xn(e, t, n)), c = !s || s.every((t, n) => t === e.children[n]);
|
|
3549
3549
|
return i === e.styles && a === e.responsive?.tablet && o === e.responsive?.mobile && c ? e : {
|
|
3550
3550
|
...e,
|
|
3551
3551
|
styles: i,
|
|
@@ -3600,9 +3600,9 @@ function er(e, t) {
|
|
|
3600
3600
|
let n = [], r = Qn[t];
|
|
3601
3601
|
for (let i of e.tokens) {
|
|
3602
3602
|
if (t === "color" ? !(i.type === "color" && i.layer !== "component") : !(r && i.key.startsWith(r))) continue;
|
|
3603
|
-
let a =
|
|
3603
|
+
let a = De(e, i.key);
|
|
3604
3604
|
if (a === void 0) continue;
|
|
3605
|
-
let o =
|
|
3605
|
+
let o = Gn(t, a);
|
|
3606
3606
|
o && n.push({
|
|
3607
3607
|
key: i.key,
|
|
3608
3608
|
name: $n(i),
|
|
@@ -3682,11 +3682,11 @@ function lr(e, t, n, r) {
|
|
|
3682
3682
|
};
|
|
3683
3683
|
break;
|
|
3684
3684
|
case "font": {
|
|
3685
|
-
let e =
|
|
3685
|
+
let e = Ce(n);
|
|
3686
3686
|
return ur(`--font-family-${sr(e) || "custom"}`, e, !1, r);
|
|
3687
3687
|
}
|
|
3688
3688
|
case "fontSize":
|
|
3689
|
-
i = (
|
|
3689
|
+
i = (Vn(t) ?? 0) >= 28 ? {
|
|
3690
3690
|
key: "--font-size-heading",
|
|
3691
3691
|
name: "Heading size",
|
|
3692
3692
|
numbered: !0
|
|
@@ -3746,7 +3746,7 @@ function ur(e, t, n, r) {
|
|
|
3746
3746
|
function dr(e) {
|
|
3747
3747
|
let t = /* @__PURE__ */ new Map();
|
|
3748
3748
|
for (let n of e) Xn(n.rootNode, (e, r) => {
|
|
3749
|
-
let i =
|
|
3749
|
+
let i = Gn(e, r);
|
|
3750
3750
|
if (!i) return;
|
|
3751
3751
|
let a = `${e}:${i}`, o = t.get(a);
|
|
3752
3752
|
o || t.set(a, o = {
|
|
@@ -3762,7 +3762,7 @@ function dr(e) {
|
|
|
3762
3762
|
var fr = (e) => [...e.entries()].sort((e, t) => t[1] - e[1])[0][0];
|
|
3763
3763
|
function pr(e, t, n = {}) {
|
|
3764
3764
|
let r = n.minorBelow ?? 2, i = dr(e), a = new Set(t.tokens.map((e) => e.key)), o = [];
|
|
3765
|
-
for (let e of
|
|
3765
|
+
for (let e of Nn) {
|
|
3766
3766
|
let n = er(t, e), s = new Set(n.map((e) => e.norm)), c = [...i.values()].filter((t) => t.kind === e && !s.has(t.norm)).sort((e, t) => t.uses - e.uses || e.norm.localeCompare(t.norm)), l = [];
|
|
3767
3767
|
for (let t of c) {
|
|
3768
3768
|
let n = l.find((n) => ir(e, n.rep.norm, t.norm) <= ar(e));
|
|
@@ -3787,7 +3787,7 @@ function pr(e, t, n = {}) {
|
|
|
3787
3787
|
}
|
|
3788
3788
|
let p = lr(e, t.norm, c, a);
|
|
3789
3789
|
a.add(p.key);
|
|
3790
|
-
let m =
|
|
3790
|
+
let m = Pn[e];
|
|
3791
3791
|
o.push({
|
|
3792
3792
|
id: `${e}:${t.norm}`,
|
|
3793
3793
|
kind: e,
|
|
@@ -3809,17 +3809,17 @@ function pr(e, t, n = {}) {
|
|
|
3809
3809
|
}
|
|
3810
3810
|
}
|
|
3811
3811
|
o.sort((e, t) => t.uses - e.uses || e.id.localeCompare(t.id));
|
|
3812
|
-
let s = Object.fromEntries(
|
|
3812
|
+
let s = Object.fromEntries(Nn.map((e) => [e, o.filter((t) => t.kind === e)]));
|
|
3813
3813
|
return {
|
|
3814
3814
|
findings: o,
|
|
3815
3815
|
byKind: s,
|
|
3816
|
-
counts: Object.fromEntries(
|
|
3816
|
+
counts: Object.fromEntries(Nn.map((e) => [e, s[e].length])),
|
|
3817
3817
|
total: o.length,
|
|
3818
3818
|
minorCount: o.filter((e) => e.minor).length
|
|
3819
3819
|
};
|
|
3820
3820
|
}
|
|
3821
3821
|
function mr(e) {
|
|
3822
|
-
let t =
|
|
3822
|
+
let t = Nn.filter((t) => e.counts[t] > 0).map((t) => `${e.counts[t]} ${e.counts[t] === 1 ? Pn[t].one : Pn[t].many}`);
|
|
3823
3823
|
return t.length <= 1 ? t.join("") : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
|
|
3824
3824
|
}
|
|
3825
3825
|
function hr(e) {
|
|
@@ -3829,33 +3829,33 @@ function gr(e, t) {
|
|
|
3829
3829
|
let n = e.value;
|
|
3830
3830
|
if (e.kind === "color") {
|
|
3831
3831
|
let r = f(n);
|
|
3832
|
-
return
|
|
3832
|
+
return y(t, e.add.key, r.a < 1 ? m(r) : p(r).toUpperCase(), {
|
|
3833
3833
|
name: e.add.name,
|
|
3834
3834
|
type: "color",
|
|
3835
3835
|
layer: "brand",
|
|
3836
3836
|
comment: "Added from your pages"
|
|
3837
3837
|
});
|
|
3838
3838
|
}
|
|
3839
|
-
if (e.kind === "font") return
|
|
3839
|
+
if (e.kind === "font") return y(t, e.add.key, n.includes(",") ? n : we(Ce(n)), {
|
|
3840
3840
|
name: e.add.name,
|
|
3841
3841
|
type: "font family",
|
|
3842
3842
|
layer: "brand",
|
|
3843
3843
|
comment: "Added from your pages"
|
|
3844
3844
|
});
|
|
3845
|
-
if (e.kind === "shadow") return
|
|
3845
|
+
if (e.kind === "shadow") return y(t, e.add.key, n, {
|
|
3846
3846
|
name: e.add.name,
|
|
3847
3847
|
type: "shadow",
|
|
3848
3848
|
layer: "brand",
|
|
3849
3849
|
comment: "Added from your pages"
|
|
3850
3850
|
});
|
|
3851
|
-
if (e.kind === "lineHeight") return
|
|
3851
|
+
if (e.kind === "lineHeight") return y(t, e.add.key, String(parseFloat(n)), {
|
|
3852
3852
|
name: e.add.name,
|
|
3853
3853
|
type: "number",
|
|
3854
3854
|
layer: "brand",
|
|
3855
3855
|
comment: "Added from your pages"
|
|
3856
3856
|
});
|
|
3857
|
-
let r =
|
|
3858
|
-
return
|
|
3857
|
+
let r = zn.exec(n.trim());
|
|
3858
|
+
return y(t, e.add.key, String(parseFloat(r[1])), {
|
|
3859
3859
|
name: e.add.name,
|
|
3860
3860
|
type: "dimension",
|
|
3861
3861
|
unit: r[2].toLowerCase(),
|
|
@@ -3874,7 +3874,7 @@ function _r(e, t, n, r = {}) {
|
|
|
3874
3874
|
designSystem: t
|
|
3875
3875
|
};
|
|
3876
3876
|
let c = (e, t) => {
|
|
3877
|
-
let n =
|
|
3877
|
+
let n = Gn(e, t), r = n ? o.get(`${e}:${n}`) : void 0;
|
|
3878
3878
|
if (r) return r;
|
|
3879
3879
|
}, l = e.map((e) => {
|
|
3880
3880
|
let t = Xn(e.rootNode, c, !0);
|
|
@@ -3882,8 +3882,8 @@ function _r(e, t, n, r = {}) {
|
|
|
3882
3882
|
...e,
|
|
3883
3883
|
rootNode: t
|
|
3884
3884
|
};
|
|
3885
|
-
}), u =
|
|
3886
|
-
return
|
|
3885
|
+
}), u = Oe(a);
|
|
3886
|
+
return Ae(u).length > Ae(t).length ? {
|
|
3887
3887
|
pages: e,
|
|
3888
3888
|
designSystem: t
|
|
3889
3889
|
} : {
|
|
@@ -3902,7 +3902,7 @@ function vr(e, t) {
|
|
|
3902
3902
|
}
|
|
3903
3903
|
}
|
|
3904
3904
|
let r = (e, t) => {
|
|
3905
|
-
let r =
|
|
3905
|
+
let r = Gn(e, t);
|
|
3906
3906
|
return r ? n.get(`${e}:${r}`) : void 0;
|
|
3907
3907
|
}, i = !1, a = e.map((e) => {
|
|
3908
3908
|
let t = Xn(e.rootNode, r, !0);
|
|
@@ -3951,7 +3951,7 @@ function xr(e, t) {
|
|
|
3951
3951
|
}
|
|
3952
3952
|
if (!a.size) return e;
|
|
3953
3953
|
let o = (e, t) => {
|
|
3954
|
-
let n =
|
|
3954
|
+
let n = Gn(e, t);
|
|
3955
3955
|
return n ? a.get(`${e}:${n}`) : void 0;
|
|
3956
3956
|
}, s = !1, c = e.map((e) => {
|
|
3957
3957
|
let t = Xn(e.rootNode, o, !0);
|
|
@@ -3974,17 +3974,17 @@ var Sr = 1400, Cr = (e) => {
|
|
|
3974
3974
|
}, R = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, z = (e) => typeof e == "string" && e ? e : void 0, B = (e) => `${Math.round(e * 100) / 100}px`, Tr = [
|
|
3975
3975
|
{
|
|
3976
3976
|
name: "desktop",
|
|
3977
|
-
k:
|
|
3977
|
+
k: ee.desktop / Sr,
|
|
3978
3978
|
minFont: 0
|
|
3979
3979
|
},
|
|
3980
3980
|
{
|
|
3981
3981
|
name: "tablet",
|
|
3982
|
-
k:
|
|
3982
|
+
k: ee.tablet / Sr,
|
|
3983
3983
|
minFont: 12
|
|
3984
3984
|
},
|
|
3985
3985
|
{
|
|
3986
3986
|
name: "mobile",
|
|
3987
|
-
k:
|
|
3987
|
+
k: ee.mobile / Sr,
|
|
3988
3988
|
minFont: 11
|
|
3989
3989
|
}
|
|
3990
3990
|
];
|
|
@@ -4329,9 +4329,9 @@ function Fr(e) {
|
|
|
4329
4329
|
for (let n = 0; n < e.length; n++) t = Math.imul(t ^ e.charCodeAt(n), 16777619);
|
|
4330
4330
|
return t >>> 0;
|
|
4331
4331
|
}
|
|
4332
|
-
var Ir = (e) =>
|
|
4332
|
+
var Ir = (e) => w.filter((t) => t.pageType === e), Lr = (e) => w.find((t) => t.id === e), Rr = [...new Set(w.map((e) => e.pageType))];
|
|
4333
4333
|
function zr(e) {
|
|
4334
|
-
return (e ? Ir(e) :
|
|
4334
|
+
return (e ? Ir(e) : w).map((e) => ({
|
|
4335
4335
|
id: e.id,
|
|
4336
4336
|
pageType: e.pageType,
|
|
4337
4337
|
name: e.name,
|
|
@@ -4394,7 +4394,7 @@ function Hr(e) {
|
|
|
4394
4394
|
if (!t) return null;
|
|
4395
4395
|
if (/^#?[0-9a-f]{3}([0-9a-f]{3})?$/.test(t)) {
|
|
4396
4396
|
let e = t.startsWith("#") ? t : `#${t}`;
|
|
4397
|
-
return
|
|
4397
|
+
return oe(e) ? oe(e).base.toUpperCase() : null;
|
|
4398
4398
|
}
|
|
4399
4399
|
return Vr[t] ?? Vr[t.replace(/\s+/g, " ")] ?? null;
|
|
4400
4400
|
}
|
|
@@ -4506,8 +4506,8 @@ var Ur = {
|
|
|
4506
4506
|
};
|
|
4507
4507
|
function Gr(e = {}) {
|
|
4508
4508
|
let t = Mr(e), n = Pr(e), r = Wr[n], i = Fr(e.name ?? t), [a, o] = Ur[t][i % Ur[t].length], s = (e.colors ?? []).map(Hr).filter((e) => !!e), c = s[0] ?? a, l = s[1] ?? o;
|
|
4509
|
-
r.neutrals === "dark" && (
|
|
4510
|
-
let u = r.fonts[i % r.fonts.length], d = (e, t) => e &&
|
|
4509
|
+
r.neutrals === "dark" && (re(c, "#0B0E14") ?? 0) < 4 && (c = (re(l, "#0B0E14") ?? 0) >= 4 ? l : "#A3E635");
|
|
4510
|
+
let u = r.fonts[i % r.fonts.length], d = (e, t) => e && Se(e) ? Se(e).name : t;
|
|
4511
4511
|
return {
|
|
4512
4512
|
industry: t,
|
|
4513
4513
|
style: n,
|
|
@@ -4519,8 +4519,8 @@ function Gr(e = {}) {
|
|
|
4519
4519
|
bodyFont: d(e.fonts?.body, u.body)
|
|
4520
4520
|
};
|
|
4521
4521
|
}
|
|
4522
|
-
function Kr(e = {}, t =
|
|
4523
|
-
let n = Gr(e), r =
|
|
4522
|
+
function Kr(e = {}, t = _e()) {
|
|
4523
|
+
let n = Gr(e), r = lt(t, {
|
|
4524
4524
|
id: `brief-${n.style}`,
|
|
4525
4525
|
name: e.name?.trim() || "Custom",
|
|
4526
4526
|
description: `${n.style} ${n.industry}`,
|
|
@@ -4637,9 +4637,9 @@ function V(e, t) {
|
|
|
4637
4637
|
let a = r.replace(/\s+\S*$/, "");
|
|
4638
4638
|
return (a.length > t * .5 ? a : r).replace(/[,;:\s-]+$/, "");
|
|
4639
4639
|
}
|
|
4640
|
-
var H = (e, t) =>
|
|
4640
|
+
var H = (e, t) => v(e).fields.find((e) => e.key === t)?.max, Yr = (e) => (e.match(/^[^.!?]*[.!?]/)?.[0] ?? e).trim();
|
|
4641
4641
|
function Xr(e = {}, t = [], n) {
|
|
4642
|
-
let r = e.name?.trim() || "Your brand", i = (e.socials ?? []).filter((e) => e && e.network in
|
|
4642
|
+
let r = e.name?.trim() || "Your brand", i = (e.socials ?? []).filter((e) => e && e.network in ce && /^https?:\/\//i.test(String(e.url ?? ""))).map((e) => ({
|
|
4643
4643
|
network: e.network,
|
|
4644
4644
|
url: e.url
|
|
4645
4645
|
})), a = e.about ? V(Yr(e.about), H("footer", "text")) : "", o = [e.contact?.email && `${e.contact.email} | mailto:${e.contact.email}`, e.contact?.phone && `${e.contact.phone} | tel:${e.contact.phone.replace(/[^\d+]/g, "")}`].filter(Boolean), s = [...t.length ? [{
|
|
@@ -4680,7 +4680,7 @@ function Qr(e, t, n, r) {
|
|
|
4680
4680
|
let i = {};
|
|
4681
4681
|
for (let [a, o] of Object.entries(t ?? {})) {
|
|
4682
4682
|
if (o == null) continue;
|
|
4683
|
-
let t =
|
|
4683
|
+
let t = v(e).fields.find((e) => e.key === a), s = typeof o == "string" && t?.max ? V(o, t.max) : o, c = dn(e, { [a]: s });
|
|
4684
4684
|
c ? n.push(`${r}: ${c}`) : i[a] = s;
|
|
4685
4685
|
}
|
|
4686
4686
|
return i;
|
|
@@ -4692,7 +4692,7 @@ function $r(e, t = {}) {
|
|
|
4692
4692
|
for (let t of c) {
|
|
4693
4693
|
let i;
|
|
4694
4694
|
try {
|
|
4695
|
-
i =
|
|
4695
|
+
i = v(t.kind);
|
|
4696
4696
|
} catch {
|
|
4697
4697
|
i = void 0;
|
|
4698
4698
|
}
|
|
@@ -4722,7 +4722,7 @@ function $r(e, t = {}) {
|
|
|
4722
4722
|
}
|
|
4723
4723
|
let u = Xr(n, t.nav ?? [], t.navCta);
|
|
4724
4724
|
return {
|
|
4725
|
-
page:
|
|
4725
|
+
page: Ge(i.id, {
|
|
4726
4726
|
name: o,
|
|
4727
4727
|
slug: e.slug ?? (a.slug || void 0),
|
|
4728
4728
|
seed: t.seed,
|
|
@@ -5293,7 +5293,7 @@ var Si = /* @__PURE__ */ new Set(/* @__PURE__ */ "html.head.body.div.span.sectio
|
|
|
5293
5293
|
"allow-forms",
|
|
5294
5294
|
"allow-scripts",
|
|
5295
5295
|
"allow-presentation"
|
|
5296
|
-
]), Ii = /^[\w\s;*-]{0,200}$/, Li = `(${
|
|
5296
|
+
]), Ii = /^[\w\s;*-]{0,200}$/, Li = `(${ne})(document);`.replace(/<\/script/gi, "<\\/script");
|
|
5297
5297
|
function K(e, t) {
|
|
5298
5298
|
let n = e.raw, r = n === null ? "" : U(n), i = n === null ? "" : `="${n.replace(/"/g, """)}"`;
|
|
5299
5299
|
return t === "bool" ? n === null || n === "" || n.toLowerCase() === e.name ? n === null ? "" : i : null : t === "plain" ? i : t === "href" ? ai(r) ? i : e.name === "href" ? ((e) => `="${ni(e)}"`)("#") : null : t === "image" ? si(r) ? i : null : t === "media" ? ci(r) ? i : null : t.test(r) ? i : null;
|
|
@@ -5624,7 +5624,7 @@ var sa = /[;{}<>\\]|\/\*|javascript:|expression\s*\(|@import|behavior\s*:|-moz-b
|
|
|
5624
5624
|
"capitalize"
|
|
5625
5625
|
]), fa = (e) => {
|
|
5626
5626
|
let t = /url\(\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\s*\)/i.exec(e), n = (t?.[1] ?? t?.[2] ?? t?.[3] ?? "").trim();
|
|
5627
|
-
return n &&
|
|
5627
|
+
return n && se(n) || void 0;
|
|
5628
5628
|
}, pa = /* @__PURE__ */ new Set([
|
|
5629
5629
|
"autoHeight",
|
|
5630
5630
|
"autoWidth",
|
|
@@ -5818,13 +5818,13 @@ function xa(e, t, n) {
|
|
|
5818
5818
|
let n = X(i.href).trim();
|
|
5819
5819
|
return i.openInNewTab && (e.approx = !0, Q(e, "Buttons can't open in a new tab yet, so they open in the same one.")), [c("button", "Button", {
|
|
5820
5820
|
content: Z(X(i.text) || "Button").text,
|
|
5821
|
-
props: { href: n ?
|
|
5821
|
+
props: { href: n ? me(n) : "#" }
|
|
5822
5822
|
}, t)];
|
|
5823
5823
|
}
|
|
5824
5824
|
case "image": {
|
|
5825
5825
|
let e = { ...a };
|
|
5826
5826
|
return i.autoHeight !== !1 && delete e.height, e.width ??= "100%", va(e, s), [c("image", X(i.alt).slice(0, 40) || "Image", { props: {
|
|
5827
|
-
src:
|
|
5827
|
+
src: se(i.src),
|
|
5828
5828
|
alt: X(i.alt)
|
|
5829
5829
|
} }, e)];
|
|
5830
5830
|
}
|
|
@@ -5854,7 +5854,7 @@ function xa(e, t, n) {
|
|
|
5854
5854
|
}, { content: Z(X(i.description) || "Card description.").text })] }, e)];
|
|
5855
5855
|
}
|
|
5856
5856
|
case "icon": {
|
|
5857
|
-
let t = ga(X(i.iconName)), n = t in
|
|
5857
|
+
let t = ga(X(i.iconName)), n = t in he;
|
|
5858
5858
|
n || (e.approx = !0, Q(e, `The icon "${X(i.iconName) || "unnamed"}" isn't in the V2 icon set, so a star stands in for it.`)), X(i.href).trim() && (e.approx = !0, Q(e, "Icons can't be links yet; the icon is kept without its link."));
|
|
5859
5859
|
let r = { ...a };
|
|
5860
5860
|
return r.fontSize ??= `${parseInt(X(i.iconSize), 10) || 48}px`, r.textColor ??= "#1e293b", va(r, s === "left" ? void 0 : s ?? "center"), [c("icon", "Icon", { props: {
|
|
@@ -5865,7 +5865,7 @@ function xa(e, t, n) {
|
|
|
5865
5865
|
}
|
|
5866
5866
|
case "carousel": return [c("carousel", "Carousel", { props: {
|
|
5867
5867
|
slides: Y(i.images, 30).map((e) => J(e)).map((e) => ({
|
|
5868
|
-
src:
|
|
5868
|
+
src: se(e.src),
|
|
5869
5869
|
alt: X(e.alt),
|
|
5870
5870
|
caption: X(e.caption)
|
|
5871
5871
|
})),
|
|
@@ -5881,8 +5881,8 @@ function xa(e, t, n) {
|
|
|
5881
5881
|
case "social": {
|
|
5882
5882
|
let n = Y(i.links, 20).map(J), r = n.map((e) => ({
|
|
5883
5883
|
network: X(e.provider) === "twitter" ? "x" : X(e.provider),
|
|
5884
|
-
url:
|
|
5885
|
-
})).filter((e) => e.network in
|
|
5884
|
+
url: me(X(e.url))
|
|
5885
|
+
})).filter((e) => e.network in ce);
|
|
5886
5886
|
r.length < n.length && (e.approx = !0, Q(e, "A social link to a network V2 has no icon for was left out."));
|
|
5887
5887
|
let o = parseInt(X(J(n[0]).size) || X(J(t.style).iconSize), 10), l = { ...a };
|
|
5888
5888
|
return va(l, s), [c("social", "Social links", { props: {
|
|
@@ -5895,7 +5895,7 @@ function xa(e, t, n) {
|
|
|
5895
5895
|
case "menu": {
|
|
5896
5896
|
let e = Y(i.links, 40).map(J).map((e) => ({
|
|
5897
5897
|
label: X(e.label).trim() || "Link",
|
|
5898
|
-
href:
|
|
5898
|
+
href: me(X(e.href) || "#")
|
|
5899
5899
|
})), t = { ...a };
|
|
5900
5900
|
return (s === "center" || s === "right") && va(t, s), [c("menu", "Menu", { props: {
|
|
5901
5901
|
links: e,
|
|
@@ -6008,7 +6008,7 @@ function wa(e, t, n, r, i, a) {
|
|
|
6008
6008
|
submitLabel: X(n.submitLabel) || "Submit",
|
|
6009
6009
|
successMessage: X(n.successMessage) || "Thanks! We got your message."
|
|
6010
6010
|
};
|
|
6011
|
-
c &&
|
|
6011
|
+
c && me(c) !== "#" && (l.action = me(c)), s.length || (e.approx = !0, Q(e, "A form had no fields, so it starts with an email field."));
|
|
6012
6012
|
let u = { ...i };
|
|
6013
6013
|
return delete u.textAlign, $(t, "form", "Form", u, {
|
|
6014
6014
|
props: l,
|
|
@@ -6155,7 +6155,7 @@ function ja(e, t, n, r, i) {
|
|
|
6155
6155
|
if (t) return t;
|
|
6156
6156
|
}
|
|
6157
6157
|
return "";
|
|
6158
|
-
})(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m =
|
|
6158
|
+
})(u.children ?? []), p = d && d.replace(/[-_]+/g, " ") || f || (i ? "Section" : "Row"), m = te(X(t.htmlClass)), h = {
|
|
6159
6159
|
...ya,
|
|
6160
6160
|
...a,
|
|
6161
6161
|
...m ? { customClasses: m } : {}
|
|
@@ -6250,4 +6250,4 @@ function Fa(e, t) {
|
|
|
6250
6250
|
};
|
|
6251
6251
|
}
|
|
6252
6252
|
//#endregion
|
|
6253
|
-
export {
|
|
6253
|
+
export { dt as $, _r as A, Tn as B, Ir as C, Cr as D, Dr as E, xr as F, yt as G, xn as H, vr as I, lt as J, vt as K, hr as L, rr as M, mr as N, Nn as O, $n as P, rt as Q, Mn as R, Br as S, ei as T, Xt as U, kn as V, Jt as W, it as X, $e as Y, ot as Z, Pr as _, Ui as a, ut as at, zr as b, Hi as c, Ne as ct, Gr as d, Ie as dt, st as et, Fr as f, We as ft, Mr as g, w as gt, Kr as h, Ve as ht, Wi as i, Ze as it, pr as j, Pn as k, qr as l, Ge as lt, Xr as m, ze as mt, na as n, Xe as nt, ea as o, qe as ot, $r as p, Le as pt, ct as q, Na as r, at as rt, _i as s, Me as st, ta as t, tt, Rr as u, Ue as ut, V as v, Jr as w, Hr as x, Lr as y, jn as z };
|