@plitzi/sdk-authoring 0.38.11 → 0.38.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index-src.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { n as e$43, r as r$37 } from "./index-declare.js";
1
2
  //#region \0rolldown/runtime.js
2
3
  var __defProp = Object.defineProperty;
3
4
  var __exportAll = (all, no_symbols) => {
@@ -11,10 +12,10 @@ var __exportAll = (all, no_symbols) => {
11
12
  };
12
13
  //#endregion
13
14
  //#region ../sdk-shared/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs
14
- var e$43 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
15
- var t$63 = `(?:${e$43}|\\d+)`;
16
- var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$43}(?:\\.${t$63})*)\\s*\\]`;
17
- var r$36 = `${`${e$43}(?:${n$47})*(?:\\??\\.${t$63}(?:${n$47})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
15
+ var e$42 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
16
+ var t$62 = `(?:${e$42}|\\d+)`;
17
+ var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$42}(?:\\.${t$62})*)\\s*\\]`;
18
+ var r$36 = `${`${e$42}(?:${n$47})*(?:\\??\\.${t$62}(?:${n$47})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
18
19
  var i$29 = `\\{\\{\\s*${r$36}\\s*\\}\\}`;
19
20
  var a$24 = `(?:${`\\{\\{\\{\\s*${r$36}\\s*\\}\\}\\}`}|${i$29})`;
20
21
  var o$26 = new RegExp(a$24, "g");
@@ -28,7 +29,7 @@ var n$46 = (n, r = !1) => {
28
29
  };
29
30
  //#endregion
30
31
  //#region ../sdk-shared/dist/authoring/paramSpec.mjs
31
- var t$62 = [
32
+ var t$61 = [
32
33
  "text",
33
34
  "textarea",
34
35
  "select",
@@ -84,8 +85,8 @@ var c$19 = (e, t, n) => {
84
85
  };
85
86
  //#endregion
86
87
  //#region ../sdk-shared/dist/helpers/scroll.mjs
87
- var e$42 = ["smooth", "auto"];
88
- var t$61 = [
88
+ var e$41 = ["smooth", "auto"];
89
+ var t$60 = [
89
90
  "start",
90
91
  "center",
91
92
  "end",
@@ -98,7 +99,7 @@ var r$34 = {
98
99
  type: "select",
99
100
  description: "How it moves: \"smooth\" glides there, \"auto\" jumps.",
100
101
  default: "smooth",
101
- options: [...e$42]
102
+ options: [...e$41]
102
103
  };
103
104
  var i$27 = {
104
105
  scrollBy: {
@@ -146,13 +147,13 @@ var i$27 = {
146
147
  type: "select",
147
148
  description: "Where the element lands, top to bottom.",
148
149
  default: "start",
149
- options: [...t$61]
150
+ options: [...t$60]
150
151
  },
151
152
  inline: {
152
153
  type: "select",
153
154
  description: "Where it lands, side to side.",
154
155
  default: "nearest",
155
- options: [...t$61]
156
+ options: [...t$60]
156
157
  },
157
158
  behavior: r$34
158
159
  }
@@ -748,7 +749,7 @@ var elementAttributeNames = {
748
749
  };
749
750
  //#endregion
750
751
  //#region ../sdk-elements/dist/Element/helpers/elementConstants.mjs
751
- var e$41 = {
752
+ var e$40 = {
752
753
  onLoad: {
753
754
  action: "onLoad",
754
755
  title: "On Load",
@@ -919,52 +920,25 @@ var e$41 = {
919
920
  }
920
921
  };
921
922
  //#endregion
922
- //#region ../sdk-shared/dist/authoring/declare.mjs
923
- var e$40 = () => (e) => e;
924
- var t$60 = () => (e) => e;
925
- //#endregion
926
923
  //#region ../sdk-elements/dist/elements/advanced/BlockHtml/declaration.mjs
927
- var t$59 = t$60()({
924
+ var t$59 = r$37()({
928
925
  type: "blockHtml",
929
926
  content: {
930
927
  attributes: { content: "" },
931
928
  definition: {
932
929
  label: "HTML Block",
933
- type: "blockHtml",
934
- description: "Renders an arbitrary raw HTML string as a block. Escape hatch when no structured element fits.",
935
- bindings: {},
936
- styleSelectors: { base: "" },
937
- initialState: { visibility: !0 }
938
- },
939
- builder: {
940
- canDelete: !0,
941
- canSelect: !0,
942
- canDragDrop: !0,
943
- canMove: !0,
944
- canSnippet: !0,
945
- itemsAllowed: [],
946
- itemsNotAllowed: []
930
+ description: "Renders an arbitrary raw HTML string as a block. Escape hatch when no structured element fits."
947
931
  },
948
932
  market: {
949
933
  category: "advanced",
950
- owner: "Plitzi",
951
- verified: !0,
952
- license: "MIT",
953
- website: "https://plitzi.com",
954
- backgroundColor: "#4422ee",
955
934
  icon: "fa-brands fa-html5"
956
935
  },
957
- defaultStyle: {
958
- name: "HTML Block",
959
- displayMode: "desktop",
960
- style: { base: { default: {} } }
961
- },
962
- settings: {}
936
+ defaultStyle: { style: { base: { default: {} } } }
963
937
  }
964
938
  });
965
939
  //#endregion
966
940
  //#region ../sdk-elements/dist/elements/advanced/BlockJsx/declaration.mjs
967
- var t$58 = t$60()({
941
+ var t$58 = r$37()({
968
942
  type: "blockJsx",
969
943
  content: {
970
944
  attributes: {
@@ -975,41 +949,18 @@ var t$58 = t$60()({
975
949
  },
976
950
  definition: {
977
951
  label: "Block JSX",
978
- type: "blockJsx",
979
- description: "A compiled JSX block for advanced authoring.",
980
- bindings: {},
981
- styleSelectors: { base: "" },
982
- initialState: { visibility: !0 }
983
- },
984
- builder: {
985
- canDelete: !0,
986
- canSelect: !0,
987
- canDragDrop: !0,
988
- canMove: !0,
989
- canSnippet: !0,
990
- itemsAllowed: [],
991
- itemsNotAllowed: []
952
+ description: "A compiled JSX block for advanced authoring."
992
953
  },
993
954
  market: {
994
955
  category: "advanced",
995
- owner: "Plitzi",
996
- verified: !0,
997
- license: "MIT",
998
- website: "https://plitzi.com",
999
- backgroundColor: "#4422ee",
1000
956
  icon: "fa-solid fa-code"
1001
957
  },
1002
- defaultStyle: {
1003
- name: "Block JSX",
1004
- displayMode: "desktop",
1005
- style: { base: { default: {} } }
1006
- },
1007
- settings: {}
958
+ defaultStyle: { style: { base: { default: {} } } }
1008
959
  }
1009
960
  });
1010
961
  //#endregion
1011
962
  //#region ../sdk-elements/dist/elements/advanced/Custom/declaration.mjs
1012
- var t$57 = t$60()({
963
+ var t$57 = r$37()({
1013
964
  type: "custom",
1014
965
  content: {
1015
966
  attributes: {
@@ -1021,91 +972,50 @@ var t$57 = t$60()({
1021
972
  },
1022
973
  definition: {
1023
974
  label: "Custom",
1024
- type: "custom",
1025
- description: "A custom element slot whose behaviour is supplied by a host/plugin component.",
1026
- bindings: {},
1027
- styleSelectors: { base: "" },
1028
- initialState: { visibility: !0 }
1029
- },
1030
- builder: {
1031
- canDelete: !0,
1032
- canSelect: !0,
1033
- canDragDrop: !0,
1034
- canMove: !0,
1035
- canSnippet: !0,
1036
- itemsAllowed: [],
1037
- itemsNotAllowed: []
975
+ description: "A custom element slot whose behaviour is supplied by a host/plugin component."
1038
976
  },
1039
977
  market: {
1040
978
  category: "advanced",
1041
- owner: "Plitzi",
1042
- verified: !0,
1043
- license: "MIT",
1044
- website: "https://plitzi.com",
1045
- backgroundColor: "#4422ee",
1046
979
  icon: "fa-solid fa-paintbrush"
1047
980
  },
1048
981
  defaultStyle: {
1049
982
  name: "Custom Element",
1050
- displayMode: "desktop",
1051
983
  style: { base: { default: {
1052
984
  display: "flex",
1053
985
  "justify-content": "center",
1054
986
  "align-items": "center"
1055
987
  } } }
1056
- },
1057
- settings: {}
988
+ }
1058
989
  }
1059
990
  });
1060
991
  //#endregion
1061
992
  //#region ../sdk-elements/dist/elements/advanced/NodeHtml/declaration.mjs
1062
- var t$56 = t$60()({
993
+ var t$56 = r$37()({
1063
994
  type: "nodeHtml",
1064
995
  content: {
1065
996
  attributes: { subType: "div" },
1066
997
  definition: {
1067
998
  label: "Html Node",
1068
- type: "nodeHtml",
1069
999
  description: "A single raw HTML tag with custom attributes.",
1070
- items: [],
1071
- bindings: {},
1072
- styleSelectors: { base: "" },
1073
- initialState: { visibility: !0 }
1074
- },
1075
- builder: {
1076
- canDelete: !0,
1077
- canSelect: !0,
1078
- canDragDrop: !0,
1079
- canMove: !0,
1080
- canSnippet: !0,
1081
- itemsAllowed: [],
1082
- itemsNotAllowed: []
1000
+ items: []
1083
1001
  },
1084
1002
  market: {
1085
1003
  category: "advanced",
1086
- owner: "Plitzi",
1087
- verified: !0,
1088
- license: "MIT",
1089
- website: "https://plitzi.com",
1090
- backgroundColor: "#4422ee",
1091
1004
  icon: "fa-brands fa-html5"
1092
1005
  },
1093
1006
  defaultStyle: {
1094
- name: "Html Node",
1095
- displayMode: "desktop",
1096
1007
  style: { base: { default: {} } },
1097
1008
  subTypes: { hr: {
1098
1009
  name: "HR Node",
1099
1010
  displayMode: "desktop",
1100
1011
  style: { base: { default: { "border-top-width": "1px" } } }
1101
1012
  } }
1102
- },
1103
- settings: {}
1013
+ }
1104
1014
  }
1105
1015
  });
1106
1016
  //#endregion
1107
1017
  //#region ../sdk-elements/dist/elements/advanced/Reference/declaration.mjs
1108
- var t$55 = t$60()({
1018
+ var t$55 = r$37()({
1109
1019
  type: "reference",
1110
1020
  content: {
1111
1021
  attributes: {
@@ -1114,37 +1024,17 @@ var t$55 = t$60()({
1114
1024
  },
1115
1025
  definition: {
1116
1026
  label: "Reference",
1117
- type: "reference",
1118
1027
  description: "Places one of the components of the space, or renders another of its elements by id, in place.",
1119
- items: [],
1120
- bindings: {},
1121
- styleSelectors: { base: "" },
1122
- initialState: { visibility: !0 }
1123
- },
1124
- builder: {
1125
- canDelete: !0,
1126
- canSelect: !0,
1127
- canDragDrop: !0,
1128
- canMove: !0,
1129
- canSnippet: !0,
1130
- itemsAllowed: [],
1131
- itemsNotAllowed: []
1028
+ items: []
1132
1029
  },
1133
1030
  market: {
1134
1031
  category: "advanced",
1135
- owner: "Plitzi",
1136
- verified: !0,
1137
- license: "MIT",
1138
- website: "https://plitzi.com",
1139
- backgroundColor: "#4422ee",
1140
1032
  icon: "fa-solid fa-asterisk"
1141
1033
  },
1142
1034
  defaultStyle: {
1143
1035
  name: "Reference Element",
1144
- displayMode: "desktop",
1145
1036
  style: { base: { default: {} } }
1146
- },
1147
- settings: {}
1037
+ }
1148
1038
  }
1149
1039
  });
1150
1040
  //#endregion
@@ -1162,16 +1052,16 @@ var n$44 = {
1162
1052
  "border-bottom-left-radius": "4px",
1163
1053
  "border-bottom-right-radius": "4px"
1164
1054
  };
1165
- var r$33 = t$60()({
1055
+ var r$33 = r$37()({
1166
1056
  type: "button",
1167
1057
  attributeValues: {
1168
- subType: e$40()([
1058
+ subType: e$43()([
1169
1059
  "button",
1170
1060
  "submit",
1171
1061
  "reset"
1172
1062
  ]),
1173
- contentPlacement: e$40()(["before", "after"]),
1174
- iconPlacement: e$40()(["before", "after"])
1063
+ contentPlacement: e$43()(["before", "after"]),
1064
+ iconPlacement: e$43()(["before", "after"])
1175
1065
  },
1176
1066
  content: {
1177
1067
  attributes: {
@@ -1184,37 +1074,15 @@ var r$33 = t$60()({
1184
1074
  },
1185
1075
  definition: {
1186
1076
  label: "Button",
1187
- type: "button",
1188
1077
  description: "A clickable button. On its own it only renders; wire an interaction flow (trigger onClick → callbacks) to make it DO something. Its words are its `content` and an icon beside them its `icon` (Font Awesome classes) — no text or fontAwesome element inside it for them.",
1189
1078
  items: [],
1190
- bindings: {},
1191
- styleSelectors: {
1192
- base: "",
1193
- icon: ""
1194
- },
1195
- initialState: { visibility: !0 }
1196
- },
1197
- builder: {
1198
- canDelete: !0,
1199
- canSelect: !0,
1200
- canDragDrop: !0,
1201
- canMove: !0,
1202
- canSnippet: !0,
1203
- itemsAllowed: [],
1204
- itemsNotAllowed: []
1079
+ styleSelectors: { icon: "" }
1205
1080
  },
1206
1081
  market: {
1207
1082
  category: "basic",
1208
- owner: "Plitzi",
1209
- verified: !0,
1210
- license: "MIT",
1211
- website: "https://plitzi.com",
1212
- backgroundColor: "#4422ee",
1213
1083
  icon: "fa-solid fa-hand-pointer"
1214
1084
  },
1215
1085
  defaultStyle: {
1216
- name: "Button",
1217
- displayMode: "desktop",
1218
1086
  style: { base: { default: n$44 } },
1219
1087
  subTypes: {
1220
1088
  button: {
@@ -1233,15 +1101,14 @@ var r$33 = t$60()({
1233
1101
  style: { base: { default: n$44 } }
1234
1102
  }
1235
1103
  }
1236
- },
1237
- settings: {}
1104
+ }
1238
1105
  }
1239
1106
  });
1240
1107
  //#endregion
1241
1108
  //#region ../sdk-elements/dist/elements/basic/Dropdown/declaration.mjs
1242
- var n$43 = t$60()({
1109
+ var n$43 = r$37()({
1243
1110
  type: "dropdown",
1244
- attributeValues: { popupPlacement: e$40()([
1111
+ attributeValues: { popupPlacement: e$43()([
1245
1112
  "left",
1246
1113
  "right",
1247
1114
  "top",
@@ -1260,94 +1127,56 @@ var n$43 = t$60()({
1260
1127
  },
1261
1128
  definition: {
1262
1129
  label: "Dropdown",
1263
- type: "dropdown",
1264
1130
  description: "A trigger that toggles an attached popup panel (dropdownPopup) — menus, selects, flyouts.",
1265
1131
  items: [],
1266
- bindings: {},
1267
- styleSelectors: {
1268
- base: "",
1269
- backgroundContainer: ""
1270
- },
1271
- initialState: { visibility: !0 }
1272
- },
1273
- builder: {
1274
- canDelete: !0,
1275
- canSelect: !0,
1276
- canDragDrop: !0,
1277
- canMove: !0,
1278
- canSnippet: !0,
1279
- itemsAllowed: [],
1280
- itemsNotAllowed: []
1132
+ styleSelectors: { backgroundContainer: "" }
1281
1133
  },
1282
1134
  market: {
1283
1135
  category: "basic",
1284
- owner: "Plitzi",
1285
- verified: !0,
1286
- license: "MIT",
1287
- website: "https://plitzi.com",
1288
- backgroundColor: "#4422ee",
1289
1136
  icon: "fa-solid fa-angle-down"
1290
1137
  },
1291
- defaultStyle: {
1292
- name: "Dropdown",
1293
- displayMode: "desktop",
1294
- style: {
1295
- base: { default: {
1296
- cursor: "pointer",
1297
- "user-select": "none"
1298
- } },
1299
- backgroundContainer: { default: {
1300
- top: 0,
1301
- bottom: 0,
1302
- left: 0,
1303
- right: 0,
1304
- position: "fixed",
1305
- cursor: "default",
1306
- "z-index": 50
1307
- } }
1308
- }
1309
- },
1310
- settings: {}
1138
+ defaultStyle: { style: {
1139
+ base: { default: {
1140
+ cursor: "pointer",
1141
+ "user-select": "none"
1142
+ } },
1143
+ backgroundContainer: { default: {
1144
+ top: 0,
1145
+ bottom: 0,
1146
+ left: 0,
1147
+ right: 0,
1148
+ position: "fixed",
1149
+ cursor: "default",
1150
+ "z-index": 50
1151
+ } }
1152
+ } }
1311
1153
  },
1312
1154
  initialItems: ["dropdownPopup"]
1313
1155
  });
1314
1156
  //#endregion
1315
1157
  //#region ../sdk-elements/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs
1316
- var t$54 = t$60()({
1158
+ var t$54 = r$37()({
1317
1159
  type: "dropdownPopup",
1318
1160
  ancestorType: "dropdown",
1319
1161
  content: {
1320
1162
  attributes: {},
1321
1163
  definition: {
1322
1164
  label: "Dropdown Popup",
1323
- type: "dropdownPopup",
1324
1165
  description: "The floating panel revealed by a dropdown.",
1325
1166
  items: [],
1326
- bindings: {},
1327
- styleSelectors: { base: "" },
1328
1167
  initialState: {}
1329
1168
  },
1330
1169
  builder: {
1331
1170
  canDelete: !1,
1332
- canSelect: !0,
1333
1171
  canDragDrop: !1,
1334
1172
  canMove: !1,
1335
- canSnippet: !1,
1336
- itemsAllowed: [],
1337
- itemsNotAllowed: []
1173
+ canSnippet: !1
1338
1174
  },
1339
1175
  market: {
1340
1176
  category: "basic",
1341
- owner: "Plitzi",
1342
- verified: !0,
1343
- license: "MIT",
1344
- website: "https://plitzi.com",
1345
- backgroundColor: "#4422ee",
1346
1177
  icon: "fa-regular fa-window-restore"
1347
1178
  },
1348
1179
  defaultStyle: {
1349
- name: "Dropdown Popup",
1350
- displayMode: "desktop",
1351
1180
  style: { base: { default: {
1352
1181
  "background-color": "light-dark(white, oklch(0.21 0.006 285.885))",
1353
1182
  "min-height": "24px",
@@ -1367,16 +1196,15 @@ var t$54 = t$60()({
1367
1196
  "z-index": 100
1368
1197
  } } },
1369
1198
  subTypes: {}
1370
- },
1371
- settings: {}
1199
+ }
1372
1200
  },
1373
1201
  initialItems: []
1374
1202
  });
1375
1203
  //#endregion
1376
1204
  //#region ../sdk-elements/dist/elements/basic/Heading/declaration.mjs
1377
- var n$42 = t$60()({
1205
+ var n$42 = r$37()({
1378
1206
  type: "heading",
1379
- attributeValues: { subType: e$40()([
1207
+ attributeValues: { subType: e$43()([
1380
1208
  "h1",
1381
1209
  "h2",
1382
1210
  "h3",
@@ -1391,33 +1219,13 @@ var n$42 = t$60()({
1391
1219
  },
1392
1220
  definition: {
1393
1221
  label: "Heading",
1394
- type: "heading",
1395
- description: "A section heading (<h1>–<h6>) for titles and document hierarchy.",
1396
- bindings: {},
1397
- styleSelectors: { base: "" },
1398
- initialState: { visibility: !0 }
1399
- },
1400
- builder: {
1401
- canDelete: !0,
1402
- canSelect: !0,
1403
- canDragDrop: !0,
1404
- canMove: !0,
1405
- canSnippet: !0,
1406
- itemsAllowed: [],
1407
- itemsNotAllowed: []
1222
+ description: "A section heading (<h1>–<h6>) for titles and document hierarchy."
1408
1223
  },
1409
1224
  market: {
1410
1225
  category: "basic",
1411
- owner: "Plitzi",
1412
- verified: !0,
1413
- license: "MIT",
1414
- website: "https://plitzi.com",
1415
- backgroundColor: "#4422ee",
1416
1226
  icon: "fa-solid fa-heading"
1417
1227
  },
1418
1228
  defaultStyle: {
1419
- name: "Heading",
1420
- displayMode: "desktop",
1421
1229
  style: { base: { default: {
1422
1230
  "margin-top": "25px",
1423
1231
  "margin-bottom": "25px",
@@ -1491,29 +1299,28 @@ var n$42 = t$60()({
1491
1299
  } } }
1492
1300
  }
1493
1301
  }
1494
- },
1495
- settings: {}
1302
+ }
1496
1303
  }
1497
1304
  });
1498
1305
  //#endregion
1499
1306
  //#region ../sdk-elements/dist/elements/basic/Link/declaration.mjs
1500
- var n$41 = t$60()({
1307
+ var n$41 = r$37()({
1501
1308
  type: "link",
1502
1309
  attributeValues: {
1503
- mode: e$40()([
1310
+ mode: e$43()([
1504
1311
  "page",
1505
1312
  "internal",
1506
1313
  "external"
1507
1314
  ]),
1508
- target: e$40()([
1315
+ target: e$43()([
1509
1316
  "self",
1510
1317
  "blank",
1511
1318
  "parent",
1512
1319
  "top"
1513
1320
  ]),
1514
- contentPlacement: e$40()(["before", "after"]),
1515
- iconPlacement: e$40()(["before", "after"]),
1516
- current: e$40()(["page", "section"])
1321
+ contentPlacement: e$43()(["before", "after"]),
1322
+ iconPlacement: e$43()(["before", "after"]),
1323
+ current: e$43()(["page", "section"])
1517
1324
  },
1518
1325
  content: {
1519
1326
  attributes: {
@@ -1530,50 +1337,26 @@ var n$41 = t$60()({
1530
1337
  },
1531
1338
  definition: {
1532
1339
  label: "Link",
1533
- type: "link",
1534
1340
  description: "Navigation. Moves the user between pages of the site or to an external URL (its `mode`/`href` decide which). Use this to go page-to-page rather than a button + interaction. Its words are its own `content` and an icon beside them its `icon` (Font Awesome classes) — no text or fontAwesome element inside it for them. It marks itself current on the page it leads to (`aria-current`, the `current` style state); its `current` set to `section` keeps it current on every page under its path too — a menu entry for a section and its pages.",
1535
1341
  items: [],
1536
- bindings: {},
1537
- styleSelectors: {
1538
- base: "",
1539
- icon: ""
1540
- },
1541
- initialState: { visibility: !0 }
1542
- },
1543
- builder: {
1544
- canDelete: !0,
1545
- canSelect: !0,
1546
- canDragDrop: !0,
1547
- canMove: !0,
1548
- canSnippet: !0,
1549
- itemsAllowed: [],
1550
- itemsNotAllowed: ["link"]
1342
+ styleSelectors: { icon: "" }
1551
1343
  },
1344
+ builder: { itemsNotAllowed: ["link"] },
1552
1345
  market: {
1553
1346
  category: "basic",
1554
- owner: "Plitzi",
1555
- verified: !0,
1556
- license: "MIT",
1557
- website: "https://plitzi.com",
1558
- backgroundColor: "#4422ee",
1559
1347
  icon: "fa-solid fa-link"
1560
1348
  },
1561
- defaultStyle: {
1562
- name: "Link",
1563
- displayMode: "desktop",
1564
- style: { base: { default: {
1565
- display: "inline-block",
1566
- color: "light-dark(#333, oklch(0.92 0.004 286.32))",
1567
- "text-decoration": "none",
1568
- cursor: "pointer"
1569
- } } }
1570
- },
1571
- settings: {}
1349
+ defaultStyle: { style: { base: { default: {
1350
+ display: "inline-block",
1351
+ color: "inherit",
1352
+ "text-decoration": "none",
1353
+ cursor: "pointer"
1354
+ } } } }
1572
1355
  }
1573
1356
  });
1574
1357
  //#endregion
1575
1358
  //#region ../sdk-elements/dist/elements/basic/Markdown/declaration.mjs
1576
- var t$53 = t$60()({
1359
+ var t$53 = r$37()({
1577
1360
  type: "markdown",
1578
1361
  content: {
1579
1362
  attributes: {
@@ -1582,11 +1365,8 @@ var t$53 = t$60()({
1582
1365
  },
1583
1366
  definition: {
1584
1367
  label: "Markdown",
1585
- type: "markdown",
1586
1368
  description: "Renders a Markdown source string (GitHub-flavoured) as HTML, inside a `div.markdown`. Each part of it takes a class through the slot named for it: `heading` (every `h1`–`h6`) and `heading1`…`heading6` (that level only, beside it — a property goes on one of the two, never both), `paragraph`, `link`, `strong`, `emphasis` (`em`), `list` (`ul`/`ol`), `listItem`, `quote` (`blockquote`), `divider` (`hr`), `code` (inline), `image`, `table`, `tableHead` (`thead`), `tableRow`, `tableHeaderCell` (`th`) and `tableCell` (`td`). A fenced block is `codeBlock` (its `pre`) in `codeBlockFrame`, under `codeBlockHeader`, which holds `codeBlockLanguage` and the `codeBlockCopy` button. Every heading carries an id made of its words, which `/page#its-words` lands on, and starts with an empty link to itself — `a.anchor > span.octicon-link`, the `anchor` slot; `headingLinks: false` leaves the link out and keeps the id. Unstyled, it reads as a document — headings, lists, code, tables — from the base layer of the SDK, which a class on the slot of a part replaces property by property.",
1587
- bindings: {},
1588
1369
  styleSelectors: {
1589
- base: "",
1590
1370
  heading: "",
1591
1371
  heading1: "",
1592
1372
  heading2: "",
@@ -1615,83 +1395,40 @@ var t$53 = t$60()({
1615
1395
  tableHeaderCell: "",
1616
1396
  tableCell: "",
1617
1397
  anchor: ""
1618
- },
1619
- initialState: { visibility: !0 }
1620
- },
1621
- builder: {
1622
- canDelete: !0,
1623
- canSelect: !0,
1624
- canDragDrop: !0,
1625
- canMove: !0,
1626
- canSnippet: !0,
1627
- itemsAllowed: [],
1628
- itemsNotAllowed: []
1398
+ }
1629
1399
  },
1630
1400
  market: {
1631
1401
  category: "basic",
1632
- owner: "Plitzi",
1633
- verified: !0,
1634
- license: "MIT",
1635
- website: "https://plitzi.com",
1636
- backgroundColor: "#4422ee",
1637
1402
  icon: "fa-brands fa-markdown"
1638
1403
  },
1639
- defaultStyle: {
1640
- name: "Markdown",
1641
- displayMode: "desktop",
1642
- style: { base: { default: {} } }
1643
- },
1644
- settings: {}
1404
+ defaultStyle: { style: { base: { default: {} } } }
1645
1405
  }
1646
1406
  });
1647
1407
  //#endregion
1648
1408
  //#region ../sdk-elements/dist/elements/basic/Paragraph/declaration.mjs
1649
- var t$52 = t$60()({
1409
+ var t$52 = r$37()({
1650
1410
  type: "paragraph",
1651
1411
  content: {
1652
1412
  attributes: { content: "Paragraph" },
1653
1413
  definition: {
1654
1414
  label: "Paragraph",
1655
- type: "paragraph",
1656
- description: "A block of body text (a <p>). Use for longer prose passages.",
1657
- bindings: {},
1658
- styleSelectors: { base: "" },
1659
- initialState: { visibility: !0 }
1660
- },
1661
- builder: {
1662
- canDelete: !0,
1663
- canSelect: !0,
1664
- canDragDrop: !0,
1665
- canMove: !0,
1666
- canSnippet: !0,
1667
- itemsAllowed: [],
1668
- itemsNotAllowed: []
1415
+ description: "A block of body text (a <p>). Use for longer prose passages."
1669
1416
  },
1670
1417
  market: {
1671
1418
  category: "basic",
1672
- owner: "Plitzi",
1673
- verified: !0,
1674
- license: "MIT",
1675
- website: "https://plitzi.com",
1676
- backgroundColor: "#4422ee",
1677
1419
  icon: "fa-solid fa-paragraph"
1678
1420
  },
1679
- defaultStyle: {
1680
- name: "Paragraph",
1681
- displayMode: "desktop",
1682
- style: { base: { default: {
1683
- "margin-top": "14px",
1684
- "margin-bottom": "14px"
1685
- } } }
1686
- },
1687
- settings: {}
1421
+ defaultStyle: { style: { base: { default: {
1422
+ "margin-top": "14px",
1423
+ "margin-bottom": "14px"
1424
+ } } } }
1688
1425
  }
1689
1426
  });
1690
1427
  //#endregion
1691
1428
  //#region ../sdk-elements/dist/elements/basic/RichText/declaration.mjs
1692
- var n$40 = t$60()({
1429
+ var n$40 = r$37()({
1693
1430
  type: "richText",
1694
- attributeValues: { format: e$40()([
1431
+ attributeValues: { format: e$43()([
1695
1432
  "html",
1696
1433
  "markdown",
1697
1434
  "text"
@@ -1704,12 +1441,9 @@ var n$40 = t$60()({
1704
1441
  },
1705
1442
  definition: {
1706
1443
  label: "Rich Text",
1707
- type: "richText",
1708
1444
  description: "Renders a body field coming from a CMS — HTML, markdown or plain text. Scripts and event handlers are stripped before rendering, so third-party content cannot execute. The parts of an HTML or markdown body take a class through the slots a `markdown` has, by the same names: `heading` and `heading1`…`heading6` (a property on one of the two, never both), `paragraph`, `link`, `strong` (`strong`/`b`), `emphasis` (`em`/`i`), `list`, `listItem`, `quote`, `divider`, `code` (inline), `codeBlock` (`pre`), `image`, `table`, `tableHead`, `tableRow`, `tableHeaderCell`, `tableCell`; the fenced block of a markdown body also sits in `codeBlockFrame`, under `codeBlockHeader` with `codeBlockLanguage` and `codeBlockCopy`. Unstyled, a body reads as a document from the base layer of the SDK, which a class on the slot of a part replaces property by property.",
1709
1445
  items: [],
1710
- bindings: {},
1711
1446
  styleSelectors: {
1712
- base: "",
1713
1447
  heading: "",
1714
1448
  heading1: "",
1715
1449
  heading2: "",
@@ -1737,74 +1471,33 @@ var n$40 = t$60()({
1737
1471
  tableRow: "",
1738
1472
  tableHeaderCell: "",
1739
1473
  tableCell: ""
1740
- },
1741
- initialState: { visibility: !0 }
1742
- },
1743
- builder: {
1744
- canDelete: !0,
1745
- canSelect: !0,
1746
- canDragDrop: !0,
1747
- canMove: !0,
1748
- canSnippet: !0,
1749
- itemsAllowed: [],
1750
- itemsNotAllowed: []
1474
+ }
1751
1475
  },
1752
1476
  market: {
1753
1477
  category: "basic",
1754
- owner: "Plitzi",
1755
- verified: !0,
1756
- license: "MIT",
1757
- website: "https://plitzi.com",
1758
- backgroundColor: "#4422ee",
1759
1478
  icon: "fa-solid fa-file-lines"
1760
1479
  },
1761
1480
  defaultStyle: {
1762
- name: "Rich Text",
1763
- displayMode: "desktop",
1764
1481
  style: { base: { default: {} } },
1765
1482
  subTypes: {}
1766
- },
1767
- settings: {}
1483
+ }
1768
1484
  }
1769
1485
  });
1770
1486
  //#endregion
1771
1487
  //#region ../sdk-elements/dist/elements/basic/Text/declaration.mjs
1772
- var t$51 = t$60()({
1488
+ var t$51 = r$37()({
1773
1489
  type: "text",
1774
1490
  content: {
1775
1491
  attributes: { content: "Text" },
1776
1492
  definition: {
1777
1493
  label: "Text",
1778
- type: "text",
1779
- description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text.",
1780
- bindings: {},
1781
- styleSelectors: { base: "" },
1782
- initialState: { visibility: !0 }
1783
- },
1784
- builder: {
1785
- canDelete: !0,
1786
- canSelect: !0,
1787
- canDragDrop: !0,
1788
- canMove: !0,
1789
- canSnippet: !0,
1790
- itemsAllowed: [],
1791
- itemsNotAllowed: []
1494
+ description: "Inline plain-text content. Use for short runs of copy; bind its content to data for dynamic text."
1792
1495
  },
1793
1496
  market: {
1794
1497
  category: "basic",
1795
- owner: "Plitzi",
1796
- verified: !0,
1797
- license: "MIT",
1798
- website: "https://plitzi.com",
1799
- backgroundColor: "#4422ee",
1800
1498
  icon: "fa-solid fa-align-left"
1801
1499
  },
1802
- defaultStyle: {
1803
- name: "Text",
1804
- displayMode: "desktop",
1805
- style: { base: { default: { display: "inline" } } }
1806
- },
1807
- settings: {}
1500
+ defaultStyle: { style: { base: { default: { display: "inline" } } } }
1808
1501
  }
1809
1502
  });
1810
1503
  //#endregion
@@ -1830,9 +1523,9 @@ var n$39 = {
1830
1523
  "letter-spacing": "inherit",
1831
1524
  cursor: "pointer"
1832
1525
  };
1833
- var r$32 = t$60()({
1526
+ var r$32 = r$37()({
1834
1527
  type: "themeToggle",
1835
- attributeValues: { subType: e$40()(["switch", "segmented"]) },
1528
+ attributeValues: { subType: e$43()(["switch", "segmented"]) },
1836
1529
  triggers: { onThemeChange: {
1837
1530
  action: "onThemeChange",
1838
1531
  title: "On Theme Change",
@@ -1850,38 +1543,18 @@ var r$32 = t$60()({
1850
1543
  },
1851
1544
  definition: {
1852
1545
  label: "Theme Toggle",
1853
- type: "themeToggle",
1854
1546
  description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: its buttons carry no browser look and take the colour and type around them — style them with the space own classes. A `segmented` one marks the chosen option with `aria-pressed`, which is the `current` state of its `option` slot. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that. A `switch` marks the icon of the scheme in use — the one chosen, or the machine one while none is — with `aria-current`, the `current` state of its `icon` slot.",
1855
1547
  items: [],
1856
- bindings: {},
1857
1548
  styleSelectors: {
1858
- base: "",
1859
1549
  icon: "",
1860
1550
  option: ""
1861
- },
1862
- initialState: { visibility: !0 }
1863
- },
1864
- builder: {
1865
- canDelete: !0,
1866
- canSelect: !0,
1867
- canDragDrop: !0,
1868
- canMove: !0,
1869
- canSnippet: !0,
1870
- itemsAllowed: [],
1871
- itemsNotAllowed: []
1551
+ }
1872
1552
  },
1873
1553
  market: {
1874
1554
  category: "basic",
1875
- owner: "Plitzi",
1876
- verified: !0,
1877
- license: "MIT",
1878
- website: "https://plitzi.com",
1879
- backgroundColor: "#4422ee",
1880
1555
  icon: "fa-solid fa-circle-half-stroke"
1881
1556
  },
1882
1557
  defaultStyle: {
1883
- name: "Theme Toggle",
1884
- displayMode: "desktop",
1885
1558
  style: {
1886
1559
  base: { default: n$39 },
1887
1560
  icon: { default: {} },
@@ -1892,15 +1565,14 @@ var r$32 = t$60()({
1892
1565
  } }
1893
1566
  },
1894
1567
  subTypes: {}
1895
- },
1896
- settings: {}
1568
+ }
1897
1569
  }
1898
1570
  });
1899
1571
  //#endregion
1900
1572
  //#region ../sdk-elements/dist/elements/form/Form/declaration.mjs
1901
- var n$38 = t$60()({
1573
+ var n$38 = r$37()({
1902
1574
  type: "form",
1903
- attributeValues: { method: e$40()(["get", "post"]) },
1575
+ attributeValues: { method: e$43()(["get", "post"]) },
1904
1576
  sourceType: "apiContainer",
1905
1577
  triggers: { onSubmit: {
1906
1578
  action: "onSubmit",
@@ -1968,37 +1640,14 @@ var n$38 = t$60()({
1968
1640
  },
1969
1641
  definition: {
1970
1642
  label: "Form",
1971
- type: "form",
1972
1643
  description: "A <form> that groups form controls and handles submission; wire its submit through an interaction flow.",
1973
- items: [],
1974
- bindings: {},
1975
- styleSelectors: { base: "" },
1976
- initialState: { visibility: !0 }
1977
- },
1978
- builder: {
1979
- canDelete: !0,
1980
- canSelect: !0,
1981
- canDragDrop: !0,
1982
- canMove: !0,
1983
- canSnippet: !0,
1984
- itemsAllowed: [],
1985
- itemsNotAllowed: []
1644
+ items: []
1986
1645
  },
1987
1646
  market: {
1988
1647
  category: "form",
1989
- owner: "Plitzi",
1990
- verified: !0,
1991
- license: "MIT",
1992
- website: "https://plitzi.com",
1993
- backgroundColor: "#4422ee",
1994
1648
  icon: "fa-solid fa-rectangle-list"
1995
1649
  },
1996
- defaultStyle: {
1997
- name: "Form",
1998
- displayMode: "desktop",
1999
- style: { base: { default: {} } }
2000
- },
2001
- settings: {}
1650
+ defaultStyle: { style: { base: { default: {} } } }
2002
1651
  }
2003
1652
  });
2004
1653
  //#endregion
@@ -2083,6 +1732,7 @@ var l$13 = {
2083
1732
  var u$14 = {
2084
1733
  height: "100%",
2085
1734
  width: "100%",
1735
+ "padding-right": "calc(1.15em + 8px)",
2086
1736
  display: "block",
2087
1737
  ...c$18,
2088
1738
  "background-color": "transparent",
@@ -2162,9 +1812,9 @@ var m$7 = (e, t, { field: n, icon: r } = {}) => ({
2162
1812
  }
2163
1813
  });
2164
1814
  var h$4 = { field: l$13 };
2165
- var g$4 = t$60()({
1815
+ var g$4 = r$37()({
2166
1816
  type: "formControl",
2167
- attributeValues: { subType: e$40()([
1817
+ attributeValues: { subType: e$43()([
2168
1818
  "text",
2169
1819
  "number",
2170
1820
  "email",
@@ -2218,41 +1868,22 @@ var g$4 = t$60()({
2218
1868
  },
2219
1869
  definition: {
2220
1870
  label: "Form Control",
2221
- type: "formControl",
2222
1871
  description: "A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input. Optional unless `required: true`, as an HTML field is: a `requiredMessage` alone requires nothing. A select offers its `options`: `[{ label, value }, …]` — the text shown, and what the field takes. A `switch` is a checkbox announced and drawn as an on/off switch (`role=\"switch\"`), for a setting that applies at once; both hold `true`/`false`, and a `defaultValue` of `\"true\"` starts them on. Its slots: `label`, `requiredMark` (the `*` that ends the label of a required field), `input` (the box a typed field or a select is drawn in — a textarea, checkbox or switch is its own box), `field` (the `<input>` or `<select>` inside that box), `icon` (the show/hide button of a password) and `error`. The box is ringed (`2px solid currentColor`) while the field inside has keyboard focus: restyle it with a `focus-within` state on the `input` slot — the box never takes `focus` itself. The thumb of a switch is no element a class reaches: the class on its `input` slot sets `--plitzi-switch-thumb` (off), `--plitzi-switch-thumb-checked` (on, white by default) and `--plitzi-switch-thumb-shadow`.",
2223
- bindings: {},
2224
1872
  styleSelectors: {
2225
- base: "",
2226
1873
  label: "",
2227
1874
  requiredMark: "",
2228
1875
  input: "",
2229
1876
  field: "",
2230
1877
  icon: "",
2231
1878
  error: ""
2232
- },
2233
- initialState: { visibility: !0 }
2234
- },
2235
- builder: {
2236
- canDelete: !0,
2237
- canSelect: !0,
2238
- canDragDrop: !0,
2239
- canMove: !0,
2240
- canSnippet: !1,
2241
- itemsAllowed: [],
2242
- itemsNotAllowed: []
1879
+ }
2243
1880
  },
1881
+ builder: { canSnippet: !1 },
2244
1882
  market: {
2245
1883
  category: "form",
2246
- owner: "Plitzi",
2247
- verified: !0,
2248
- license: "MIT",
2249
- website: "https://plitzi.com",
2250
- backgroundColor: "#4422ee",
2251
1884
  icon: "fa-solid fa-i-cursor"
2252
1885
  },
2253
1886
  defaultStyle: {
2254
- name: "Form Control",
2255
- displayMode: "desktop",
2256
1887
  style: { base: { default: {} } },
2257
1888
  subTypes: {
2258
1889
  hidden: m$7("Form Control Hidden", {}),
@@ -2306,15 +1937,14 @@ var g$4 = t$60()({
2306
1937
  }
2307
1938
  }
2308
1939
  }
2309
- },
2310
- settings: {}
1940
+ }
2311
1941
  }
2312
1942
  });
2313
1943
  //#endregion
2314
1944
  //#region ../sdk-elements/dist/elements/internal/LayoutContainer/declaration.mjs
2315
- var n$36 = t$60()({
1945
+ var n$36 = r$37()({
2316
1946
  type: "layoutContainer",
2317
- attributeValues: { subType: e$40()([
1947
+ attributeValues: { subType: e$43()([
2318
1948
  "div",
2319
1949
  "header",
2320
1950
  "footer",
@@ -2330,127 +1960,63 @@ var n$36 = t$60()({
2330
1960
  attributes: { subType: "div" },
2331
1961
  definition: {
2332
1962
  label: "Layout Container",
2333
- type: "layoutContainer",
2334
1963
  description: "A reusable layout shell (header/footer chrome) shared across pages.",
2335
- items: [],
2336
- bindings: {},
2337
- styleSelectors: { base: "" },
2338
- initialState: { visibility: !0 }
2339
- },
2340
- builder: {
2341
- canDelete: !0,
2342
- canSelect: !0,
2343
- canDragDrop: !1,
2344
- canMove: !0,
2345
- canSnippet: !0,
2346
- itemsAllowed: [],
2347
- itemsNotAllowed: []
1964
+ items: []
2348
1965
  },
1966
+ builder: { canDragDrop: !1 },
2349
1967
  market: {
2350
1968
  category: "internal",
2351
- owner: "Plitzi",
2352
- verified: !0,
2353
- license: "MIT",
2354
- website: "https://plitzi.com",
2355
- backgroundColor: "#4422ee",
2356
1969
  icon: "fa-solid fa-border-all"
2357
1970
  },
2358
1971
  defaultStyle: {
2359
- name: "Layout Container",
2360
- displayMode: "desktop",
2361
1972
  style: { base: { default: {} } },
2362
1973
  subTypes: {}
2363
- },
2364
- settings: {}
1974
+ }
2365
1975
  }
2366
1976
  });
2367
1977
  //#endregion
2368
1978
  //#region ../sdk-elements/dist/elements/internal/Loading/declaration.mjs
2369
- var t$50 = t$60()({
1979
+ var t$50 = r$37()({
2370
1980
  type: "loading",
2371
1981
  content: {
2372
1982
  attributes: {},
2373
1983
  definition: {
2374
1984
  label: "Loading",
2375
- type: "loading",
2376
- description: "A loading placeholder shown while data or a suspense boundary resolves.",
2377
- bindings: {},
2378
- styleSelectors: { base: "" },
2379
- initialState: { visibility: !0 }
2380
- },
2381
- builder: {
2382
- canDelete: !0,
2383
- canSelect: !0,
2384
- canDragDrop: !1,
2385
- canMove: !0,
2386
- canSnippet: !0,
2387
- itemsAllowed: [],
2388
- itemsNotAllowed: []
1985
+ description: "A loading placeholder shown while data or a suspense boundary resolves."
2389
1986
  },
1987
+ builder: { canDragDrop: !1 },
2390
1988
  market: {
2391
1989
  category: "internal",
2392
- owner: "Plitzi",
2393
- verified: !0,
2394
- license: "MIT",
2395
- website: "https://plitzi.com",
2396
- backgroundColor: "#4422ee",
2397
1990
  icon: "https://cdn.plitzi.com/resources/img/favicon.svg"
2398
1991
  },
2399
- defaultStyle: {
2400
- name: "Loading",
2401
- displayMode: "desktop",
2402
- style: { base: { default: {} } }
2403
- },
2404
- settings: {}
1992
+ defaultStyle: { style: { base: { default: {} } } }
2405
1993
  }
2406
1994
  });
2407
1995
  //#endregion
2408
1996
  //#region ../sdk-elements/dist/elements/internal/NotFound/declaration.mjs
2409
- var t$49 = t$60()({
1997
+ var t$49 = r$37()({
2410
1998
  type: "notFound",
2411
1999
  content: {
2412
2000
  attributes: {},
2413
2001
  definition: {
2414
2002
  label: "Not Found",
2415
- type: "notFound",
2416
- description: "The 404 screen shown when no route matches.",
2417
- bindings: {},
2418
- styleSelectors: { base: "" },
2419
- initialState: { visibility: !0 }
2420
- },
2421
- builder: {
2422
- canDelete: !0,
2423
- canSelect: !0,
2424
- canDragDrop: !1,
2425
- canMove: !0,
2426
- canSnippet: !0,
2427
- itemsAllowed: [],
2428
- itemsNotAllowed: []
2003
+ description: "The 404 screen shown when no route matches."
2429
2004
  },
2005
+ builder: { canDragDrop: !1 },
2430
2006
  market: {
2431
2007
  category: "internal",
2432
- owner: "Plitzi",
2433
- verified: !0,
2434
- license: "MIT",
2435
- website: "https://plitzi.com",
2436
- backgroundColor: "#4422ee",
2437
2008
  icon: "https://cdn.plitzi.com/resources/img/favicon.svg"
2438
2009
  },
2439
- defaultStyle: {
2440
- name: "Not Found",
2441
- displayMode: "desktop",
2442
- style: { base: { default: {
2443
- display: "flex",
2444
- "justify-content": "center",
2445
- "align-items": "center"
2446
- } } }
2447
- },
2448
- settings: {}
2010
+ defaultStyle: { style: { base: { default: {
2011
+ display: "flex",
2012
+ "justify-content": "center",
2013
+ "align-items": "center"
2014
+ } } } }
2449
2015
  }
2450
2016
  });
2451
2017
  //#endregion
2452
2018
  //#region ../sdk-elements/dist/elements/internal/Page/declaration.mjs
2453
- var t$48 = t$60()({
2019
+ var t$48 = r$37()({
2454
2020
  type: "page",
2455
2021
  serverTemplates: [
2456
2022
  "seoPageTitle",
@@ -2482,53 +2048,35 @@ var t$48 = t$60()({
2482
2048
  },
2483
2049
  definition: {
2484
2050
  label: "Page",
2485
- type: "page",
2486
2051
  description: "The root of a routable screen. Managed through the page ops (upsertPage/deletePage), not added as a child element.",
2487
- items: [],
2488
- bindings: {},
2489
- styleSelectors: { base: "" },
2490
- initialState: { visibility: !0 }
2052
+ items: []
2491
2053
  },
2492
2054
  builder: {
2493
2055
  canDelete: !1,
2494
- canSelect: !0,
2495
2056
  canDragDrop: !1,
2496
- canMove: !1,
2497
- canSnippet: !0,
2498
- itemsAllowed: [],
2499
- itemsNotAllowed: []
2057
+ canMove: !1
2500
2058
  },
2501
2059
  market: {
2502
2060
  category: "internal",
2503
- owner: "Plitzi",
2504
- verified: !0,
2505
- license: "MIT",
2506
- website: "https://plitzi.com",
2507
- backgroundColor: "#4422ee",
2508
2061
  icon: "fas fa-file"
2509
2062
  },
2510
- defaultStyle: {
2511
- name: "Page",
2512
- displayMode: "desktop",
2513
- style: { base: { default: {
2514
- display: "flex",
2515
- "flex-direction": "column",
2516
- "min-height": "100%",
2517
- "min-width": "100%",
2518
- "font-family": "Arial",
2519
- color: "light-dark(#333, oklch(0.92 0.004 286.32))",
2520
- "font-size": "14px",
2521
- "font-weight": 400,
2522
- "line-height": "16px",
2523
- "text-align": "left"
2524
- } } }
2525
- },
2526
- settings: {}
2063
+ defaultStyle: { style: { base: { default: {
2064
+ display: "flex",
2065
+ "flex-direction": "column",
2066
+ "min-height": "100%",
2067
+ "min-width": "100%",
2068
+ "font-family": "Arial",
2069
+ color: "light-dark(#333, oklch(0.92 0.004 286.32))",
2070
+ "font-size": "14px",
2071
+ "font-weight": 400,
2072
+ "line-height": "16px",
2073
+ "text-align": "left"
2074
+ } } } }
2527
2075
  }
2528
2076
  });
2529
2077
  //#endregion
2530
2078
  //#region ../sdk-elements/dist/elements/media/Embed/declaration.mjs
2531
- var t$47 = t$60()({
2079
+ var t$47 = r$37()({
2532
2080
  type: "embed",
2533
2081
  content: {
2534
2082
  attributes: {
@@ -2538,49 +2086,26 @@ var t$47 = t$60()({
2538
2086
  },
2539
2087
  definition: {
2540
2088
  label: "Embed",
2541
- type: "embed",
2542
- description: "Another page inside this one — a map, a video player, a form — in a frame.",
2543
- bindings: {},
2544
- styleSelectors: { base: "" },
2545
- initialState: { visibility: !0 }
2546
- },
2547
- builder: {
2548
- canDelete: !0,
2549
- canSelect: !0,
2550
- canDragDrop: !0,
2551
- canMove: !0,
2552
- canSnippet: !0,
2553
- itemsAllowed: [],
2554
- itemsNotAllowed: []
2089
+ description: "Another page inside this one — a map, a video player, a form — in a frame."
2555
2090
  },
2556
2091
  market: {
2557
2092
  category: "media",
2558
- owner: "Plitzi",
2559
- verified: !0,
2560
- license: "MIT",
2561
- website: "https://plitzi.com",
2562
- backgroundColor: "#4422ee",
2563
2093
  icon: "fa-solid fa-window-maximize"
2564
2094
  },
2565
- defaultStyle: {
2566
- name: "Embed",
2567
- displayMode: "desktop",
2568
- style: { base: { default: {
2569
- display: "block",
2570
- width: "100%",
2571
- "aspect-ratio": "16 / 9",
2572
- "border-top-width": "0px",
2573
- "border-right-width": "0px",
2574
- "border-bottom-width": "0px",
2575
- "border-left-width": "0px"
2576
- } } }
2577
- },
2578
- settings: {}
2095
+ defaultStyle: { style: { base: { default: {
2096
+ display: "block",
2097
+ width: "100%",
2098
+ "aspect-ratio": "16 / 9",
2099
+ "border-top-width": "0px",
2100
+ "border-right-width": "0px",
2101
+ "border-bottom-width": "0px",
2102
+ "border-left-width": "0px"
2103
+ } } } }
2579
2104
  }
2580
2105
  });
2581
2106
  //#endregion
2582
2107
  //#region ../sdk-elements/dist/elements/media/FontAwesome/declaration.mjs
2583
- var t$46 = t$60()({
2108
+ var t$46 = r$37()({
2584
2109
  type: "fontAwesome",
2585
2110
  content: {
2586
2111
  attributes: {
@@ -2590,52 +2115,29 @@ var t$46 = t$60()({
2590
2115
  },
2591
2116
  definition: {
2592
2117
  label: "Font Awesome",
2593
- type: "fontAwesome",
2594
- description: "Renders a Font Awesome icon by its icon name.",
2595
- bindings: {},
2596
- styleSelectors: { base: "" },
2597
- initialState: { visibility: !0 }
2598
- },
2599
- builder: {
2600
- canDelete: !0,
2601
- canSelect: !0,
2602
- canDragDrop: !0,
2603
- canMove: !0,
2604
- canSnippet: !0,
2605
- itemsAllowed: [],
2606
- itemsNotAllowed: []
2118
+ description: "Renders a Font Awesome icon by its icon name."
2607
2119
  },
2608
2120
  market: {
2609
2121
  category: "media",
2610
- owner: "Plitzi",
2611
- verified: !0,
2612
- license: "MIT",
2613
- website: "https://plitzi.com",
2614
- backgroundColor: "#4422ee",
2615
2122
  icon: "fa-solid fa-font-awesome"
2616
2123
  },
2617
- defaultStyle: {
2618
- name: "Font Awesome",
2619
- displayMode: "desktop",
2620
- style: { base: { default: {
2621
- display: "inline-block",
2622
- "font-size": "16px"
2623
- } } }
2624
- },
2625
- settings: {}
2124
+ defaultStyle: { style: { base: { default: {
2125
+ display: "inline-block",
2126
+ "font-size": "16px"
2127
+ } } } }
2626
2128
  }
2627
2129
  });
2628
2130
  //#endregion
2629
2131
  //#region ../sdk-elements/dist/elements/media/Image/declaration.mjs
2630
- var n$35 = t$60()({
2132
+ var n$35 = r$37()({
2631
2133
  type: "image",
2632
2134
  attributeValues: {
2633
- fetchPriority: e$40()([
2135
+ fetchPriority: e$43()([
2634
2136
  "high",
2635
2137
  "low",
2636
2138
  "auto"
2637
2139
  ]),
2638
- loadMode: e$40()([
2140
+ loadMode: e$43()([
2639
2141
  "auto",
2640
2142
  "eager",
2641
2143
  "lazy"
@@ -2651,46 +2153,23 @@ var n$35 = t$60()({
2651
2153
  },
2652
2154
  definition: {
2653
2155
  label: "Image",
2654
- type: "image",
2655
- description: "Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both.",
2656
- bindings: {},
2657
- styleSelectors: { base: "" },
2658
- initialState: { visibility: !0 }
2659
- },
2660
- builder: {
2661
- canDelete: !0,
2662
- canSelect: !0,
2663
- canDragDrop: !0,
2664
- canMove: !0,
2665
- canSnippet: !0,
2666
- itemsAllowed: [],
2667
- itemsNotAllowed: []
2156
+ description: "Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both."
2668
2157
  },
2669
2158
  market: {
2670
2159
  category: "media",
2671
- owner: "Plitzi",
2672
- verified: !0,
2673
- license: "MIT",
2674
- website: "https://plitzi.com",
2675
- backgroundColor: "#4422ee",
2676
2160
  icon: "fa-solid fa-image"
2677
2161
  },
2678
- defaultStyle: {
2679
- name: "Image",
2680
- displayMode: "desktop",
2681
- style: { base: { default: {
2682
- display: "block",
2683
- width: "140px",
2684
- height: "auto",
2685
- "max-width": "100%"
2686
- } } }
2687
- },
2688
- settings: {}
2162
+ defaultStyle: { style: { base: { default: {
2163
+ display: "block",
2164
+ width: "140px",
2165
+ height: "auto",
2166
+ "max-width": "100%"
2167
+ } } } }
2689
2168
  }
2690
2169
  });
2691
2170
  //#endregion
2692
2171
  //#region ../sdk-elements/dist/elements/media/Svg/declaration.mjs
2693
- var t$45 = t$60()({
2172
+ var t$45 = r$37()({
2694
2173
  type: "svg",
2695
2174
  content: {
2696
2175
  attributes: {
@@ -2699,45 +2178,25 @@ var t$45 = t$60()({
2699
2178
  },
2700
2179
  definition: {
2701
2180
  label: "SVG",
2702
- type: "svg",
2703
- description: "A drawing written as SVG markup, coloured by its class.",
2704
- bindings: {},
2705
- styleSelectors: { base: "" },
2706
- initialState: { visibility: !0 }
2707
- },
2708
- builder: {
2709
- canDelete: !0,
2710
- canSelect: !0,
2711
- canDragDrop: !0,
2712
- canMove: !0,
2713
- canSnippet: !0,
2714
- itemsAllowed: [],
2715
- itemsNotAllowed: []
2181
+ description: "A drawing written as SVG markup, coloured by its class."
2716
2182
  },
2717
2183
  market: {
2718
2184
  category: "media",
2719
- owner: "Plitzi",
2720
- verified: !0,
2721
- license: "MIT",
2722
- website: "https://plitzi.com",
2723
- backgroundColor: "#4422ee",
2724
2185
  icon: "fa-solid fa-bezier-curve"
2725
2186
  },
2726
2187
  defaultStyle: {
2727
2188
  name: "Svg",
2728
- displayMode: "desktop",
2729
2189
  style: { base: { default: {
2730
2190
  display: "inline-flex",
2731
2191
  width: "24px",
2732
2192
  height: "24px"
2733
2193
  } } }
2734
- },
2735
- settings: {}
2194
+ }
2736
2195
  }
2737
2196
  });
2738
2197
  //#endregion
2739
2198
  //#region ../sdk-elements/dist/elements/media/Video/declaration.mjs
2740
- var t$44 = t$60()({
2199
+ var t$44 = r$37()({
2741
2200
  type: "video",
2742
2201
  content: {
2743
2202
  attributes: {
@@ -2749,48 +2208,25 @@ var t$44 = t$60()({
2749
2208
  },
2750
2209
  definition: {
2751
2210
  label: "Video",
2752
- type: "video",
2753
- description: "Embeds a video from a URL.",
2754
- bindings: {},
2755
- styleSelectors: { base: "" },
2756
- initialState: { visibility: !0 }
2757
- },
2758
- builder: {
2759
- canDelete: !0,
2760
- canSelect: !0,
2761
- canDragDrop: !0,
2762
- canMove: !0,
2763
- canSnippet: !0,
2764
- itemsAllowed: [],
2765
- itemsNotAllowed: []
2211
+ description: "Embeds a video from a URL."
2766
2212
  },
2767
2213
  market: {
2768
2214
  category: "media",
2769
- owner: "Plitzi",
2770
- verified: !0,
2771
- license: "MIT",
2772
- website: "https://plitzi.com",
2773
- backgroundColor: "#4422ee",
2774
2215
  icon: "fa-solid fa-video"
2775
2216
  },
2776
- defaultStyle: {
2777
- name: "Video",
2778
- displayMode: "desktop",
2779
- style: { base: { default: {
2780
- display: "block",
2781
- width: "400px",
2782
- height: "250px"
2783
- } } }
2784
- },
2785
- settings: {}
2217
+ defaultStyle: { style: { base: { default: {
2218
+ display: "block",
2219
+ width: "400px",
2220
+ height: "250px"
2221
+ } } } }
2786
2222
  }
2787
2223
  });
2788
2224
  //#endregion
2789
2225
  //#region ../sdk-elements/dist/elements/provider/ApiContainer/declaration.mjs
2790
- var n$34 = t$60()({
2226
+ var n$34 = r$37()({
2791
2227
  type: "apiContainer",
2792
2228
  attributeValues: {
2793
- subType: e$40()([
2229
+ subType: e$43()([
2794
2230
  "",
2795
2231
  "div",
2796
2232
  "header",
@@ -2803,19 +2239,19 @@ var n$34 = t$60()({
2803
2239
  "address",
2804
2240
  "figure"
2805
2241
  ]),
2806
- method: e$40()([
2242
+ method: e$43()([
2807
2243
  "get",
2808
2244
  "post",
2809
2245
  "put",
2810
2246
  "delete",
2811
2247
  "patch"
2812
2248
  ]),
2813
- credentials: e$40()([
2249
+ credentials: e$43()([
2814
2250
  "include",
2815
2251
  "omit",
2816
2252
  "same-origin"
2817
2253
  ]),
2818
- pagination: e$40()([
2254
+ pagination: e$43()([
2819
2255
  "none",
2820
2256
  "url",
2821
2257
  "append"
@@ -2928,45 +2364,24 @@ var n$34 = t$60()({
2928
2364
  },
2929
2365
  definition: {
2930
2366
  label: "Api Container",
2931
- type: "apiContainer",
2932
2367
  description: "Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step, and `refreshSeconds` makes it ask again on its own every N seconds (either runtime; paused while the tab is hidden) — the way to keep a queue, feed or status board current without a plugin. A server provider (`runtime: \"server\"`) whose answer means the address shows nothing — a record not found — says so in `notFound`, a template against its answer (`{{ source.found == false }}`): the page is sent with status 404, rendered as written. Its `subType` (container tag) is empty by default, and then it renders NO element of its own: its children lay out directly in its parent, and any class, variant or style binding on it applies to nothing. To style the provider itself give it a tag (`subType: \"div\"`, `section`, …); otherwise style its parent or a child.",
2933
- items: [],
2934
- bindings: {},
2935
- styleSelectors: { base: "" },
2936
- initialState: { visibility: !0 }
2937
- },
2938
- builder: {
2939
- canDelete: !0,
2940
- canSelect: !0,
2941
- canDragDrop: !0,
2942
- canMove: !0,
2943
- canSnippet: !0,
2944
- itemsAllowed: [],
2945
- itemsNotAllowed: []
2368
+ items: []
2946
2369
  },
2947
2370
  market: {
2948
2371
  category: "provider",
2949
- owner: "Plitzi",
2950
- verified: !0,
2951
- license: "MIT",
2952
- website: "https://plitzi.com",
2953
- backgroundColor: "#4422ee",
2954
2372
  icon: "fa-solid fa-server"
2955
2373
  },
2956
2374
  defaultStyle: {
2957
- name: "Api Container",
2958
- displayMode: "desktop",
2959
2375
  style: { base: { default: {} } },
2960
2376
  subTypes: {}
2961
- },
2962
- settings: {}
2377
+ }
2963
2378
  }
2964
2379
  });
2965
2380
  //#endregion
2966
2381
  //#region ../sdk-elements/dist/elements/provider/Channel/declaration.mjs
2967
- var n$33 = t$60()({
2382
+ var n$33 = r$37()({
2968
2383
  type: "channel",
2969
- attributeValues: { subType: e$40()([
2384
+ attributeValues: { subType: e$43()([
2970
2385
  "",
2971
2386
  "div",
2972
2387
  "section",
@@ -3057,88 +2472,45 @@ var n$33 = t$60()({
3057
2472
  },
3058
2473
  definition: {
3059
2474
  label: "Channel",
3060
- type: "channel",
3061
- description: "A realtime channel: every OTHER page on the same `topic` hears what one publishes, within milliseconds — the page that sent it too with `echo` (its `from` is then the channel's `me`). The topic must match a channel the space declares in its settings (`channels`), e.g. `board:{{ id }}` under `board:{id}`. A topic of a private channel (`grant: true`) opens only with `grant`, bound to the grant the action that let this visitor in returned (its `realtime.grant` step). ITS DESCENDANTS bind to its source `channel_<id>`: `connected`, `members` (with the state each announced), `messages` (the last `keep`) and `last`. It fires `onMessage`; `onJoin` when somebody who came after this page has announced who they are, and `onLeave` when somebody goes — each with `from`, `user` and the `state` they announced; and answers `publish({ type, data, echo })` and `setPresence({ data })`; `presence` is the state this page announces (a name, a colour). Closed in the builder and anywhere without a server.",
3062
- items: [],
3063
- bindings: {},
3064
- styleSelectors: { base: "" },
3065
- initialState: { visibility: !0 }
3066
- },
3067
- builder: {
3068
- canDelete: !0,
3069
- canSelect: !0,
3070
- canDragDrop: !0,
3071
- canMove: !0,
3072
- canSnippet: !0,
3073
- itemsAllowed: [],
3074
- itemsNotAllowed: []
2475
+ description: "A realtime channel: every OTHER page on the same `topic` hears what one publishes, within milliseconds — the page that sent it too with `echo` (its `from` is then the `me` of the channel). The topic must match a channel the space declares in its settings (`channels`), e.g. `board:{{ id }}` under `board:{id}`. A topic of a private channel (`grant: true`) opens only with `grant`, bound to the grant the action that let this visitor in returned (its `realtime.grant` step). ITS DESCENDANTS bind to its source `channel_<id>`: `connected`, `members` (with the state each announced), `messages` (the last `keep`) and `last`. It fires `onMessage`; `onJoin` when somebody who came after this page has announced who they are, and `onLeave` when somebody goes — each with `from`, `user` and the `state` they announced; and answers `publish({ type, data, echo })` and `setPresence({ data })`; `presence` is the state this page announces (a name, a colour). Closed in the builder and anywhere without a server.",
2476
+ items: []
3075
2477
  },
3076
2478
  market: {
3077
2479
  category: "provider",
3078
- owner: "Plitzi",
3079
- verified: !0,
3080
- license: "MIT",
3081
- website: "https://plitzi.com",
3082
- backgroundColor: "#4422ee",
3083
2480
  icon: "fa-solid fa-tower-broadcast"
3084
2481
  },
3085
2482
  defaultStyle: {
3086
- name: "Channel",
3087
- displayMode: "desktop",
3088
2483
  style: { base: { default: {} } },
3089
2484
  subTypes: {}
3090
- },
3091
- settings: {}
2485
+ }
3092
2486
  }
3093
2487
  });
3094
2488
  //#endregion
3095
2489
  //#region ../sdk-elements/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs
3096
- var t$43 = t$60()({
2490
+ var t$43 = r$37()({
3097
2491
  type: "carouselTrack",
3098
2492
  ancestorType: "carousel",
3099
2493
  content: {
3100
2494
  attributes: {},
3101
2495
  definition: {
3102
2496
  label: "Carousel Track",
3103
- type: "carouselTrack",
3104
2497
  description: "Where a carousel shows its slides: what is inside is one slide, rendered once per item.",
3105
- items: [],
3106
- bindings: {},
3107
- styleSelectors: { base: "" },
3108
- initialState: { visibility: !0 }
3109
- },
3110
- builder: {
3111
- canDelete: !0,
3112
- canSelect: !0,
3113
- canDragDrop: !0,
3114
- canMove: !0,
3115
- canSnippet: !1,
3116
- itemsAllowed: [],
3117
- itemsNotAllowed: []
2498
+ items: []
3118
2499
  },
2500
+ builder: { canSnippet: !1 },
3119
2501
  market: {
3120
2502
  category: "structure",
3121
- owner: "Plitzi",
3122
- verified: !0,
3123
- license: "MIT",
3124
- website: "https://plitzi.com",
3125
- backgroundColor: "#4422ee",
3126
2503
  icon: "fa-solid fa-film"
3127
2504
  },
3128
- defaultStyle: {
3129
- name: "Carousel Track",
3130
- displayMode: "desktop",
3131
- style: { base: { default: {
3132
- position: "relative",
3133
- overflow: "hidden"
3134
- } } }
3135
- },
3136
- settings: {}
2505
+ defaultStyle: { style: { base: { default: {
2506
+ position: "relative",
2507
+ overflow: "hidden"
2508
+ } } } }
3137
2509
  }
3138
2510
  });
3139
2511
  //#endregion
3140
2512
  //#region ../sdk-elements/dist/elements/structure/Carousel/declaration.mjs
3141
- var t$42 = t$60()({
2513
+ var t$42 = r$37()({
3142
2514
  type: "carousel",
3143
2515
  sourceType: "carousel",
3144
2516
  triggers: { onChange: {
@@ -3206,37 +2578,14 @@ var t$42 = t$60()({
3206
2578
  },
3207
2579
  definition: {
3208
2580
  label: "Carousel",
3209
- type: "carousel",
3210
2581
  description: "Items shown one at a time, scrolled past as a marquee, or swiped as a row — with controls of its own inside.",
3211
- items: [],
3212
- bindings: {},
3213
- styleSelectors: { base: "" },
3214
- initialState: { visibility: !0 }
3215
- },
3216
- builder: {
3217
- canDelete: !0,
3218
- canSelect: !0,
3219
- canDragDrop: !0,
3220
- canMove: !0,
3221
- canSnippet: !0,
3222
- itemsAllowed: [],
3223
- itemsNotAllowed: []
2582
+ items: []
3224
2583
  },
3225
2584
  market: {
3226
2585
  category: "structure",
3227
- owner: "Plitzi",
3228
- verified: !0,
3229
- license: "MIT",
3230
- website: "https://plitzi.com",
3231
- backgroundColor: "#4422ee",
3232
2586
  icon: "fa-solid fa-images"
3233
2587
  },
3234
- defaultStyle: {
3235
- name: "Carousel",
3236
- displayMode: "desktop",
3237
- style: { base: { default: { position: "relative" } } }
3238
- },
3239
- settings: {}
2588
+ defaultStyle: { style: { base: { default: { position: "relative" } } } }
3240
2589
  },
3241
2590
  initialItems: ["carouselTrack"]
3242
2591
  });
@@ -3253,10 +2602,10 @@ var n$32 = [
3253
2602
  "aside",
3254
2603
  "figure"
3255
2604
  ];
3256
- var r$30 = t$60()({
2605
+ var r$30 = r$37()({
3257
2606
  type: "container",
3258
2607
  attributeValues: {
3259
- subType: e$40()([
2608
+ subType: e$43()([
3260
2609
  "div",
3261
2610
  "header",
3262
2611
  "footer",
@@ -3280,7 +2629,7 @@ var r$30 = t$60()({
3280
2629
  "p",
3281
2630
  "span"
3282
2631
  ]),
3283
- live: e$40()([
2632
+ live: e$43()([
3284
2633
  "",
3285
2634
  "polite",
3286
2635
  "assertive"
@@ -3290,38 +2639,17 @@ var r$30 = t$60()({
3290
2639
  attributes: { subType: "div" },
3291
2640
  definition: {
3292
2641
  label: "Container",
3293
- type: "container",
3294
2642
  description: "Generic layout box (a div). The primary building block for structure: groups and positions child elements with flex/grid. Reach for it whenever you need to wrap or arrange other elements.",
3295
- items: [],
3296
- bindings: {},
3297
- styleSelectors: { base: "" },
3298
- initialState: { visibility: !0 }
3299
- },
3300
- builder: {
3301
- canDelete: !0,
3302
- canSelect: !0,
3303
- canDragDrop: !0,
3304
- canMove: !0,
3305
- canSnippet: !0,
3306
- itemsAllowed: [],
3307
- itemsNotAllowed: []
2643
+ items: []
3308
2644
  },
3309
2645
  market: {
3310
2646
  category: "structure",
3311
- owner: "Plitzi",
3312
- verified: !0,
3313
- license: "MIT",
3314
- website: "https://plitzi.com",
3315
- backgroundColor: "#4422ee",
3316
2647
  icon: "fa-solid fa-crop-simple"
3317
2648
  },
3318
2649
  defaultStyle: {
3319
- name: "Container",
3320
- displayMode: "desktop",
3321
2650
  style: { base: { default: {} } },
3322
2651
  subTypes: {}
3323
- },
3324
- settings: {}
2652
+ }
3325
2653
  }
3326
2654
  });
3327
2655
  //#endregion
@@ -3380,7 +2708,7 @@ var B = {
3380
2708
  Channel: n$33,
3381
2709
  Container: r$30,
3382
2710
  Custom: t$57,
3383
- DialogContainer: t$60()({
2711
+ DialogContainer: r$37()({
3384
2712
  type: "dialogContainer",
3385
2713
  sourceType: "dialogContainer",
3386
2714
  triggers: {
@@ -3453,13 +2781,10 @@ var B = {
3453
2781
  },
3454
2782
  definition: {
3455
2783
  label: "Dialog Container",
3456
- type: "dialogContainer",
3457
2784
  description: "A native <dialog> container shown or hidden through interactions (e.g. an onClick open/close).",
3458
2785
  items: [],
3459
- bindings: {},
3460
2786
  loadStrategy: "lazy",
3461
2787
  styleSelectors: {
3462
- base: "",
3463
2788
  backgroundContainer: "",
3464
2789
  rootContainer: "",
3465
2790
  headerContainer: "",
@@ -3469,30 +2794,13 @@ var B = {
3469
2794
  footerContainer: "",
3470
2795
  acceptButton: "",
3471
2796
  cancelButton: ""
3472
- },
3473
- initialState: { visibility: !0 }
3474
- },
3475
- builder: {
3476
- canDelete: !0,
3477
- canSelect: !0,
3478
- canDragDrop: !0,
3479
- canMove: !0,
3480
- canSnippet: !0,
3481
- itemsAllowed: [],
3482
- itemsNotAllowed: []
2797
+ }
3483
2798
  },
3484
2799
  market: {
3485
2800
  category: "structure",
3486
- owner: "Plitzi",
3487
- verified: !0,
3488
- license: "MIT",
3489
- website: "https://plitzi.com",
3490
- backgroundColor: "#4422ee",
3491
2801
  icon: "fa-regular fa-message"
3492
2802
  },
3493
2803
  defaultStyle: {
3494
- name: "Dialog Container",
3495
- displayMode: "desktop",
3496
2804
  style: {
3497
2805
  base: { default: {
3498
2806
  position: "fixed",
@@ -3562,8 +2870,7 @@ var B = {
3562
2870
  } }
3563
2871
  },
3564
2872
  subTypes: {}
3565
- },
3566
- settings: {}
2873
+ }
3567
2874
  },
3568
2875
  initialItems: ["container"]
3569
2876
  }),
@@ -3577,11 +2884,11 @@ var B = {
3577
2884
  Image: n$35,
3578
2885
  LayoutContainer: n$36,
3579
2886
  Link: n$41,
3580
- List: t$60()({
2887
+ List: r$37()({
3581
2888
  type: "list",
3582
2889
  attributeValues: {
3583
- subType: e$40()(["ul", "ol"]),
3584
- source: e$40()(["none", "controlled"])
2890
+ subType: e$43()(["ul", "ol"]),
2891
+ source: e$43()(["none", "controlled"])
3585
2892
  },
3586
2893
  sourceType: "list",
3587
2894
  content: {
@@ -3592,34 +2899,14 @@ var B = {
3592
2899
  },
3593
2900
  definition: {
3594
2901
  label: "List",
3595
- type: "list",
3596
2902
  description: "Repeats a template (its row: a listItem, or a container with subType \"li\") once per entry of a data array — the way to render a dynamic collection, as a <ul> (subType \"ol\" for a numbered one). Bind its items to a data source (e.g. an apiContainer response).",
3597
- items: [],
3598
- bindings: {},
3599
- styleSelectors: { base: "" },
3600
- initialState: { visibility: !0 }
3601
- },
3602
- builder: {
3603
- canDelete: !0,
3604
- canSelect: !0,
3605
- canDragDrop: !0,
3606
- canMove: !0,
3607
- canSnippet: !0,
3608
- itemsAllowed: [],
3609
- itemsNotAllowed: []
2903
+ items: []
3610
2904
  },
3611
2905
  market: {
3612
2906
  category: "structure",
3613
- owner: "Plitzi",
3614
- verified: !0,
3615
- license: "MIT",
3616
- website: "https://plitzi.com",
3617
- backgroundColor: "#4422ee",
3618
2907
  icon: "fa-solid fa-list"
3619
2908
  },
3620
2909
  defaultStyle: {
3621
- name: "List",
3622
- displayMode: "desktop",
3623
2910
  style: { base: { default: {
3624
2911
  "margin-top": "0px",
3625
2912
  "margin-bottom": "10px",
@@ -3645,8 +2932,7 @@ var B = {
3645
2932
  } } }
3646
2933
  }
3647
2934
  }
3648
- },
3649
- settings: {}
2935
+ }
3650
2936
  },
3651
2937
  initialItems: [
3652
2938
  "listItem",
@@ -3654,48 +2940,26 @@ var B = {
3654
2940
  "listItem"
3655
2941
  ]
3656
2942
  }),
3657
- ListItem: t$60()({
2943
+ ListItem: r$37()({
3658
2944
  type: "listItem",
3659
2945
  content: {
3660
2946
  attributes: {},
3661
2947
  definition: {
3662
2948
  label: "List Item",
3663
- type: "listItem",
3664
2949
  description: "The List Item element lets you add more items to existing List elements. You can then add any content you would like to them, including links, images, etc.",
3665
- items: [],
3666
- bindings: {},
3667
- styleSelectors: { base: "" },
3668
- initialState: { visibility: !0 }
3669
- },
3670
- builder: {
3671
- canDelete: !0,
3672
- canSelect: !0,
3673
- canDragDrop: !0,
3674
- canMove: !0,
3675
- canSnippet: !0,
3676
- itemsAllowed: [],
3677
- itemsNotAllowed: ["listItem"]
2950
+ items: []
3678
2951
  },
2952
+ builder: { itemsNotAllowed: ["listItem"] },
3679
2953
  market: {
3680
2954
  category: "structure",
3681
- owner: "Plitzi",
3682
- verified: !0,
3683
- license: "MIT",
3684
- website: "https://plitzi.com",
3685
- backgroundColor: "#4422ee",
3686
2955
  icon: "fa-solid fa-grip-lines"
3687
2956
  },
3688
- defaultStyle: {
3689
- name: "List Item",
3690
- displayMode: "desktop",
3691
- style: { base: { default: {} } }
3692
- },
3693
- settings: {}
2957
+ defaultStyle: { style: { base: { default: {} } } }
3694
2958
  }
3695
2959
  }),
3696
2960
  Loading: t$50,
3697
2961
  Markdown: t$53,
3698
- ModalContainer: t$60()({
2962
+ ModalContainer: r$37()({
3699
2963
  type: "modalContainer",
3700
2964
  sourceType: "modalContainer",
3701
2965
  triggers: {
@@ -3743,43 +3007,23 @@ var B = {
3743
3007
  },
3744
3008
  definition: {
3745
3009
  label: "Modal Container",
3746
- type: "modalContainer",
3747
3010
  description: "A modal overlay container opened and closed through interactions; use for dialogs over the page. The element itself is fixed over the whole viewport, and holds two layers side by side — neither inside the other: `backgroundContainer`, the dim layer, `rgb(0 0 0 / 50%)` (its `background-color` is the whole dim), and `rootContainer`, the dialog, centred by `top: 50%`, `left: 50%` and `transform: translate3d(-50%, -50%, 0)` — to sit it near the top, set `top` and `transform: translateX(-50%)`; flex alignment on the dim layer moves nothing. Inside the dialog, top to bottom: `headerContainer` (with `headerTitle` and `headerCloseButton`) and `bodyContainer`.",
3748
3011
  items: [],
3749
- bindings: {},
3750
3012
  loadStrategy: "lazy",
3751
3013
  styleSelectors: {
3752
- base: "",
3753
3014
  backgroundContainer: "",
3754
3015
  rootContainer: "",
3755
3016
  headerContainer: "",
3756
3017
  headerTitle: "",
3757
3018
  headerCloseButton: "",
3758
3019
  bodyContainer: ""
3759
- },
3760
- initialState: { visibility: !0 }
3761
- },
3762
- builder: {
3763
- canDelete: !0,
3764
- canSelect: !0,
3765
- canDragDrop: !0,
3766
- canMove: !0,
3767
- canSnippet: !0,
3768
- itemsAllowed: [],
3769
- itemsNotAllowed: []
3020
+ }
3770
3021
  },
3771
3022
  market: {
3772
3023
  category: "structure",
3773
- owner: "Plitzi",
3774
- verified: !0,
3775
- license: "MIT",
3776
- website: "https://plitzi.com",
3777
- backgroundColor: "#4422ee",
3778
3024
  icon: "fa-regular fa-clone"
3779
3025
  },
3780
3026
  defaultStyle: {
3781
- name: "Modal Container",
3782
- displayMode: "desktop",
3783
3027
  style: {
3784
3028
  base: { default: {
3785
3029
  position: "fixed",
@@ -3869,19 +3113,18 @@ var B = {
3869
3113
  } }
3870
3114
  },
3871
3115
  subTypes: {}
3872
- },
3873
- settings: {}
3116
+ }
3874
3117
  },
3875
3118
  initialItems: ["container"]
3876
3119
  }),
3877
3120
  NodeHtml: t$56,
3878
3121
  NotFound: t$49,
3879
3122
  Page: t$48,
3880
- Pagination: t$60()({
3123
+ Pagination: r$37()({
3881
3124
  type: "pagination",
3882
3125
  attributeValues: {
3883
- mode: e$40()(["pages", "loadMore"]),
3884
- target: e$40()(["url", "interaction"])
3126
+ mode: e$43()(["pages", "loadMore"]),
3127
+ target: e$43()(["url", "interaction"])
3885
3128
  },
3886
3129
  triggers: { onPageChange: {
3887
3130
  action: "onPageChange",
@@ -3903,40 +3146,20 @@ var B = {
3903
3146
  },
3904
3147
  definition: {
3905
3148
  label: "Pagination",
3906
- type: "pagination",
3907
3149
  description: "Pages through a list. Bind it to a provider page info: in URL mode it writes the page into the address bar so the result stays shareable and indexable, and in load-more mode it announces the next page for the provider to append. Its buttons take a class through their slots: `previous`, `page` (each numbered one — the page shown carries `aria-current=\"page\"`, so the class's `current` state dresses it), `next` and `loadMore`; one with nowhere to go is disabled, the `disabled` state.",
3908
3150
  items: [],
3909
- bindings: {},
3910
3151
  styleSelectors: {
3911
- base: "",
3912
3152
  previous: "",
3913
3153
  page: "",
3914
3154
  next: "",
3915
3155
  loadMore: ""
3916
- },
3917
- initialState: { visibility: !0 }
3918
- },
3919
- builder: {
3920
- canDelete: !0,
3921
- canSelect: !0,
3922
- canDragDrop: !0,
3923
- canMove: !0,
3924
- canSnippet: !0,
3925
- itemsAllowed: [],
3926
- itemsNotAllowed: []
3156
+ }
3927
3157
  },
3928
3158
  market: {
3929
3159
  category: "structure",
3930
- owner: "Plitzi",
3931
- verified: !0,
3932
- license: "MIT",
3933
- website: "https://plitzi.com",
3934
- backgroundColor: "#4422ee",
3935
3160
  icon: "fa-solid fa-ellipsis"
3936
3161
  },
3937
3162
  defaultStyle: {
3938
- name: "Pagination",
3939
- displayMode: "desktop",
3940
3163
  style: { base: { default: {
3941
3164
  display: "flex",
3942
3165
  "align-items": "center",
@@ -3944,94 +3167,59 @@ var B = {
3944
3167
  "column-gap": "8px"
3945
3168
  } } },
3946
3169
  subTypes: {}
3947
- },
3948
- settings: {}
3170
+ }
3949
3171
  }
3950
3172
  }),
3951
3173
  Paragraph: t$52,
3952
3174
  Reference: t$55,
3953
3175
  RichText: n$40,
3954
3176
  Svg: t$45,
3955
- TabContainer: t$60()({
3177
+ TabContainer: r$37()({
3956
3178
  type: "tabContainer",
3957
3179
  content: {
3958
3180
  attributes: {},
3959
3181
  definition: {
3960
3182
  label: "Tab Container",
3961
- type: "tabContainer",
3962
3183
  description: "A tabbed container that switches between panels; composed of header/body/item parts.",
3963
- items: [],
3964
- bindings: {},
3965
- styleSelectors: { base: "" },
3966
- initialState: { visibility: !0 }
3967
- },
3968
- builder: {
3969
- canDelete: !0,
3970
- canSelect: !0,
3971
- canDragDrop: !0,
3972
- canMove: !0,
3973
- canSnippet: !0,
3974
- itemsAllowed: ["tabContainerHeader", "tabContainerBody"],
3975
- itemsNotAllowed: []
3184
+ items: []
3976
3185
  },
3186
+ builder: { itemsAllowed: ["tabContainerHeader", "tabContainerBody"] },
3977
3187
  market: {
3978
3188
  category: "structure",
3979
- owner: "Plitzi",
3980
- verified: !0,
3981
- license: "MIT",
3982
- website: "https://plitzi.com",
3983
- backgroundColor: "#4422ee",
3984
3189
  icon: "fa-solid fa-table-columns"
3985
3190
  },
3986
3191
  defaultStyle: {
3987
- name: "Tab Container",
3988
- displayMode: "desktop",
3989
3192
  style: { base: { default: {} } },
3990
3193
  subTypes: {}
3991
- },
3992
- settings: {}
3194
+ }
3993
3195
  },
3994
3196
  initialItems: ["tabContainerHeader", "tabContainerBody"]
3995
3197
  }),
3996
- TabContainerBody: t$60()({
3198
+ TabContainerBody: r$37()({
3997
3199
  type: "tabContainerBody",
3998
3200
  ancestorType: "tabContainer",
3999
3201
  content: {
4000
3202
  attributes: {},
4001
3203
  definition: {
4002
3204
  label: "Tab Container Body",
4003
- type: "tabContainerBody",
4004
3205
  description: "The panel area inside a tabContainer that shows the active tab item.",
4005
- items: [],
4006
- bindings: {},
4007
- styleSelectors: { base: "" },
4008
- initialState: { visibility: !0 }
3206
+ items: []
4009
3207
  },
4010
3208
  builder: {
4011
3209
  canDelete: !1,
4012
- canSelect: !0,
4013
3210
  canDragDrop: !1,
4014
3211
  canMove: !1,
4015
3212
  canSnippet: !1,
4016
- itemsAllowed: ["tabContainerItem"],
4017
- itemsNotAllowed: []
3213
+ itemsAllowed: ["tabContainerItem"]
4018
3214
  },
4019
3215
  market: {
4020
3216
  category: "structure",
4021
- owner: "Plitzi",
4022
- verified: !0,
4023
- license: "MIT",
4024
- website: "https://plitzi.com",
4025
- backgroundColor: "#4422ee",
4026
3217
  icon: "fa-solid fa-table-columns"
4027
3218
  },
4028
3219
  defaultStyle: {
4029
- name: "Tab Container Body",
4030
- displayMode: "desktop",
4031
3220
  style: { base: { default: {} } },
4032
3221
  subTypes: {}
4033
- },
4034
- settings: {}
3222
+ }
4035
3223
  },
4036
3224
  initialItems: [
4037
3225
  "tabContainerItem",
@@ -4039,45 +3227,31 @@ var B = {
4039
3227
  "tabContainerItem"
4040
3228
  ]
4041
3229
  }),
4042
- TabContainerHeader: t$60()({
3230
+ TabContainerHeader: r$37()({
4043
3231
  type: "tabContainerHeader",
4044
3232
  ancestorType: "tabContainer",
4045
3233
  content: {
4046
3234
  attributes: {},
4047
3235
  definition: {
4048
3236
  label: "Tab Container Header",
4049
- type: "tabContainerHeader",
4050
3237
  description: "The row of tab triggers inside a tabContainer.",
4051
- items: [],
4052
- bindings: {},
4053
- styleSelectors: { base: "" },
4054
- initialState: { visibility: !0 }
3238
+ items: []
4055
3239
  },
4056
3240
  builder: {
4057
3241
  canDelete: !1,
4058
- canSelect: !0,
4059
3242
  canDragDrop: !1,
4060
3243
  canMove: !1,
4061
3244
  canSnippet: !1,
4062
- itemsAllowed: ["tabContainerItem"],
4063
- itemsNotAllowed: []
3245
+ itemsAllowed: ["tabContainerItem"]
4064
3246
  },
4065
3247
  market: {
4066
3248
  category: "structure",
4067
- owner: "Plitzi",
4068
- verified: !0,
4069
- license: "MIT",
4070
- website: "https://plitzi.com",
4071
- backgroundColor: "#4422ee",
4072
3249
  icon: "fa-solid fa-table-columns"
4073
3250
  },
4074
3251
  defaultStyle: {
4075
- name: "Tab Container Header",
4076
- displayMode: "desktop",
4077
3252
  style: { base: { default: {} } },
4078
3253
  subTypes: {}
4079
- },
4080
- settings: {}
3254
+ }
4081
3255
  },
4082
3256
  initialItems: [
4083
3257
  "tabContainerItem",
@@ -4085,48 +3259,28 @@ var B = {
4085
3259
  "tabContainerItem"
4086
3260
  ]
4087
3261
  }),
4088
- TabContainerItem: t$60()({
3262
+ TabContainerItem: r$37()({
4089
3263
  type: "tabContainerItem",
4090
3264
  content: {
4091
3265
  attributes: {},
4092
3266
  definition: {
4093
3267
  label: "Tab Container Item",
4094
- type: "tabContainerItem",
4095
3268
  description: "One selectable tab (trigger + panel) inside a tabContainer.",
4096
- items: [],
4097
- bindings: {},
4098
- styleSelectors: { base: "" },
4099
- initialState: { visibility: !0 }
4100
- },
4101
- builder: {
4102
- canDelete: !0,
4103
- canSelect: !0,
4104
- canDragDrop: !0,
4105
- canMove: !0,
4106
- canSnippet: !0,
4107
- itemsAllowed: [],
4108
- itemsNotAllowed: [
4109
- "tabContainerItem",
4110
- "tabContainerHeader",
4111
- "tabContainerBody"
4112
- ]
3269
+ items: []
4113
3270
  },
3271
+ builder: { itemsNotAllowed: [
3272
+ "tabContainerItem",
3273
+ "tabContainerHeader",
3274
+ "tabContainerBody"
3275
+ ] },
4114
3276
  market: {
4115
3277
  category: "structure",
4116
- owner: "Plitzi",
4117
- verified: !0,
4118
- license: "MIT",
4119
- website: "https://plitzi.com",
4120
- backgroundColor: "#4422ee",
4121
3278
  icon: "fa-regular fa-folder"
4122
3279
  },
4123
3280
  defaultStyle: {
4124
- name: "Tab Container Item",
4125
- displayMode: "desktop",
4126
3281
  style: { base: { default: {} } },
4127
3282
  subTypes: {}
4128
- },
4129
- settings: {}
3283
+ }
4130
3284
  }
4131
3285
  }),
4132
3286
  Text: t$51,
@@ -4165,7 +3319,7 @@ var elementSourceTypes = Object.fromEntries(Object.values(declarations).filter((
4165
3319
  * element that fires it ever starts the flow — an `onSubmit` on a form's submit button is saved, looks right beside
4166
3320
  * the form, and never runs, which is how a working form reads as "forms do not work outside the builder".
4167
3321
  */
4168
- var elementTriggers = Object.fromEntries(Object.values(declarations).map((declaration) => [declaration.type, [...Object.keys(e$41), ...Object.keys(declaration.triggers ?? {})]]));
3322
+ var elementTriggers = Object.fromEntries(Object.values(declarations).map((declaration) => [declaration.type, [...Object.keys(e$40), ...Object.keys(declaration.triggers ?? {})]]));
4169
3323
  /** The triggers only some types fire, by action name — for a step builder that wants the title the builder shows. */
4170
3324
  var typeTriggerDefinitions = Object.fromEntries(Object.values(declarations).flatMap((declaration) => Object.entries(declaration.triggers ?? {})));
4171
3325
  /** The callbacks only some types answer to, by action name — with their params, for whatever explains or checks one. */
@@ -5173,13 +4327,23 @@ var AUTHORING_CODES = {
5173
4327
  },
5174
4328
  "repeated-shape": {
5175
4329
  kind: "suggested",
5176
- means: "the same structure written again and again with different words — cards, rows, tiles",
4330
+ means: "the same structure written again and again with different words — cards, rows, tiles; copies that bind different data, read their own template or render on the server are controls, not repeats",
5177
4331
  fix: "a component with props (`components`, `component(id, { props })`), or one `list` when they are rows of data side by side — a few cards a person rewords on the canvas can stay cards"
5178
4332
  },
5179
- "content-attribute": {
4333
+ "element-color-inherited": {
5180
4334
  kind: "suggested",
5181
- means: "a button or a link whose children are only its words and an icon — a `text`, a `fontAwesome` — elements more than it needs",
5182
- fix: "its own `content` and `icon` (`link({ href, content: 'Docs', icon: 'fa-solid fa-arrow-right', iconPlacement: 'after' })`); the icon's class goes on the `icon` slot, and what the text's class adds on the box's class, never the class itself"
4335
+ means: "`elements` giving a type — a heading, a text, a link — `color: inherit` or the page's own colour, which it takes by itself",
4336
+ fix: "remove it, and name the colour once on `elements.page`: every element reads in the page’s colour, a link’s words included"
4337
+ },
4338
+ "plugin-custom-host": {
4339
+ kind: "suggested",
4340
+ means: "a `custom` element naming, by `renderType`, a plugin whose declaration the space was handed",
4341
+ fix: "place it from its declaration — `const seatPicker = defineElement(declaration)`, then `seatPicker({ id, … })`: typed by what it declares (a `definePlugin` declaration carries its attributes), the element the builder adds too"
4342
+ },
4343
+ "content-attribute": {
4344
+ kind: "suggested",
4345
+ means: "a button or a link whose children are only its words and an icon — a `text`, a `fontAwesome` — elements more than it needs",
4346
+ fix: "its own `content` and `icon` (`link({ href, content: 'Docs', icon: 'fa-solid fa-arrow-right', iconPlacement: 'after' })`); the icon's class goes on the `icon` slot, and what the text's class adds on the box's class, never the class itself"
5183
4347
  },
5184
4348
  "custom-css-class": {
5185
4349
  kind: "suggested",
@@ -8597,6 +7761,12 @@ var m$2 = (e) => p$5(a$11(e));
8597
7761
  var CUSTOM_TYPE = "custom";
8598
7762
  /** An attribute read as text: a document stores what an editor wrote, which is not always the string a type says. */
8599
7763
  var textOf = (value, fallback = "") => typeof value === "string" ? value : fallback;
7764
+ /** Every string inside a value, however deep — a step's params nest objects and lists of them. */
7765
+ var stringsIn = (value) => {
7766
+ if (typeof value === "string") return [value];
7767
+ if (Array.isArray(value)) return value.flatMap(stringsIn);
7768
+ return typeof value === "object" && value !== null ? Object.values(value).flatMap(stringsIn) : [];
7769
+ };
8600
7770
  /**
8601
7771
  * One reading of a space, shared by every rule: who is where, who publishes what, and the words to name them with.
8602
7772
  *
@@ -8780,14 +7950,14 @@ var withPluginCatalogs = (options) => {
8780
7950
  const byType = (own, hosted = own) => Object.fromEntries(plugins.flatMap((declaration) => {
8781
7951
  return [[declaration.type, own(declaration)], [hostedKey(declaration), hosted(declaration)]].filter((entry) => entry[1] !== void 0);
8782
7952
  }));
8783
- const customTriggers = rest.vocabulary?.triggers?.["custom"] ?? Object.keys(e$41);
7953
+ const customTriggers = rest.vocabulary?.triggers?.["custom"] ?? Object.keys(e$40);
8784
7954
  const customCallbacks = rest.vocabulary?.callbacks?.["custom"] ?? Object.keys(a$22);
8785
7955
  const customAttributes = Object.keys(rest.defaultAttributes?.["custom"] ?? {});
8786
7956
  const vocabulary = rest.vocabulary && {
8787
7957
  ...rest.vocabulary,
8788
7958
  triggers: {
8789
7959
  ...rest.vocabulary.triggers,
8790
- ...byType((declaration) => [...Object.keys(e$41), ...actionsOf(declaration.triggers)], (declaration) => [...customTriggers, ...actionsOf(declaration.triggers)])
7960
+ ...byType((declaration) => [...Object.keys(e$40), ...actionsOf(declaration.triggers)], (declaration) => [...customTriggers, ...actionsOf(declaration.triggers)])
8791
7961
  },
8792
7962
  callbacks: {
8793
7963
  ...rest.vocabulary.callbacks,
@@ -8950,7 +8120,7 @@ var steps_exports$1 = /* @__PURE__ */ __exportAll({
8950
8120
  * the builders useless for exactly the flows that matter most.
8951
8121
  */
8952
8122
  var builtinTrigger = (trigger) => {
8953
- if (Object.hasOwn(e$41, trigger)) return e$41[trigger];
8123
+ if (Object.hasOwn(e$40, trigger)) return e$40[trigger];
8954
8124
  return Object.hasOwn(typeTriggerDefinitions, trigger) ? typeTriggerDefinitions[trigger] : void 0;
8955
8125
  };
8956
8126
  var on = (trigger, params = {}) => {
@@ -9769,6 +8939,192 @@ var applyBuiltinCallback = (action, params) => {
9769
8939
  };
9770
8940
  };
9771
8941
  //#endregion
8942
+ //#region ../sdk-shared/dist/types/SchemaTypes.mjs
8943
+ var e$15 = [
8944
+ "skip",
8945
+ "parallel",
8946
+ "queue",
8947
+ "latest"
8948
+ ];
8949
+ //#endregion
8950
+ //#region src/schema/flows.ts
8951
+ var ruleOf = (rule) => "value" in rule ? rule : {
8952
+ ...rule,
8953
+ value: ""
8954
+ };
8955
+ /**
8956
+ * Where a step runs, when it did not say.
8957
+ *
8958
+ * A trigger fires on the element the flow is declared on, and an element callback with no target changes that same
8959
+ * element — in both cases the answer is the host, and writing it out is repetition that can be got wrong. A global
8960
+ * callback names its source module, which its builder fills in; a utility names nothing, and null is the answer.
8961
+ */
8962
+ var hostFor = (step, host) => step.type === "trigger" || step.type === "callback" ? host ?? null : null;
8963
+ /**
8964
+ * What a step may be called, and that no two are called the same.
8965
+ *
8966
+ * A flow is a MAP keyed by step id, so a repeat does not add a step — it replaces one, and the flow that runs is
8967
+ * shorter than the one that was written with nothing saying so. The charset is the id charset: a later step reads
8968
+ * an earlier one as `{{ <id>.field }}`, and a '.' would split that path into two segments.
8969
+ */
8970
+ var assertStepIds = (ids, where) => {
8971
+ const seen = /* @__PURE__ */ new Set();
8972
+ for (const id of ids) {
8973
+ if (!t$28(id)) throw new AuthoringError("step-name", `Step "${id}" in ${where} is not a valid name: start with a letter, then letters, numbers, hyphens and underscores. A later step reads this one as {{ ${id}.field }}.`);
8974
+ if (seen.has(id)) throw new AuthoringError("step-duplicate", `${where} names the step "${id}" twice. A flow's steps are keyed by id, so the second wins.`);
8975
+ seen.add(id);
8976
+ }
8977
+ };
8978
+ /**
8979
+ * The ids a flow's steps are written under. A step's output is addressed as `{{ <id>.field }}` from every later step,
8980
+ * so an unnamed one still gets a name worth reading — `navigate-2` — counted per action, which is what a person would
8981
+ * have called it anyway.
8982
+ */
8983
+ var stepIds = (steps, counters) => {
8984
+ const named = new Set(steps.map((step) => step.id).filter(Boolean));
8985
+ return steps.map((step) => {
8986
+ if (step.id) return step.id;
8987
+ const base = step.action.replace(/[^A-Za-z0-9]/g, "") || step.type;
8988
+ let next = (counters.get(base) ?? 0) + 1;
8989
+ while (named.has(`${base}-${next}`)) next += 1;
8990
+ counters.set(base, next);
8991
+ return `${base}-${next}`;
8992
+ });
8993
+ };
8994
+ /** Every step's id, flow by flow, as `authorFlows` writes them — where a step of the document was in the source. */
8995
+ var flowStepIds = (flows) => {
8996
+ const counters = /* @__PURE__ */ new Map();
8997
+ return flows.map((steps) => stepIds(steps, counters));
8998
+ };
8999
+ /**
9000
+ * One interaction flow, chained.
9001
+ *
9002
+ * The nodes are a linked list — each knows the one before and the one after, and they all carry the id of the
9003
+ * first as their `flowId`. Getting one of those three wrong produces a flow that half runs, which is why this is
9004
+ * derived from the order the steps were written in rather than declared.
9005
+ */
9006
+ var authorFlow = (steps, host, counters = /* @__PURE__ */ new Map()) => {
9007
+ const ids = stepIds(steps, counters);
9008
+ assertStepIds(ids, host ? `the flow on "${host}"` : "this flow");
9009
+ const flowId = ids[0] ?? "";
9010
+ return steps.reduce((flow, step, index) => {
9011
+ flow[ids[index]] = {
9012
+ id: ids[index],
9013
+ title: step.title ?? step.action,
9014
+ type: step.type,
9015
+ action: step.action,
9016
+ params: step.params ?? {},
9017
+ preview: step.preview ?? {},
9018
+ elementId: step.on ?? hostFor(step, host),
9019
+ beforeNode: index === 0 ? "" : ids[index - 1],
9020
+ afterNode: index === steps.length - 1 ? "" : ids[index + 1],
9021
+ flowId,
9022
+ enabled: step.enabled ?? true,
9023
+ ...step.when ? { when: step.when } : {},
9024
+ ...step.whileRunning && step.whileRunning !== "skip" ? { whileRunning: step.whileRunning } : {}
9025
+ };
9026
+ return flow;
9027
+ }, {});
9028
+ };
9029
+ /**
9030
+ * Names a step, so a later one can read what it produced.
9031
+ *
9032
+ * A running flow keeps its scope keyed by node id, which means `{{ login.values.username }}` resolves only when
9033
+ * the step that produced it is called `login`. Left unnamed, a step is still named — `<action>-<n>` — so its result
9034
+ * is reachable; naming it yourself is how it becomes readable.
9035
+ */
9036
+ var named$2 = (id, step) => ({
9037
+ ...step,
9038
+ id
9039
+ });
9040
+ /**
9041
+ * Runs a step only when a rule holds.
9042
+ *
9043
+ * The pair to {@link named}: that one lets a later step READ what an earlier one produced, this one lets it decide
9044
+ * whether to run at all. Both are about the same thing — a flow is a list, and everything conditional in it is
9045
+ * expressed on the steps rather than by branching the list.
9046
+ *
9047
+ * Written out, a condition is a query-builder group: a combinator and a list of rules, four levels of nesting for
9048
+ * "did that work?". Here it is the rule.
9049
+ */
9050
+ var when = (rules, step, combinator = "and") => {
9051
+ const group = {
9052
+ combinator,
9053
+ rules: (Array.isArray(rules) ? rules : [rules]).map(ruleOf)
9054
+ };
9055
+ return {
9056
+ ...step,
9057
+ when: step.when ? both(step.when, group) : group
9058
+ };
9059
+ };
9060
+ /**
9061
+ * Two conditions a step must BOTH meet — the one it already had and the one put around it.
9062
+ *
9063
+ * `when(a, when(b, step))` used to replace `b` with `a`: the step ran whenever `a` held, whatever `b` said, and nothing
9064
+ * anywhere said so. A helper that returns its steps already guarded (a `when` inside) and a caller adding its own guard
9065
+ * is the ordinary way to get there. Two `and` groups are one group of all their rules; otherwise each keeps its own.
9066
+ */
9067
+ var both = (inner, outer) => inner.combinator === "and" && outer.combinator === "and" && inner.enabled !== false && outer.enabled !== false ? {
9068
+ combinator: "and",
9069
+ rules: [...outer.rules, ...inner.rules]
9070
+ } : {
9071
+ combinator: "and",
9072
+ rules: [outer, inner]
9073
+ };
9074
+ /**
9075
+ * What a trigger does when it fires again while the flow it started still runs.
9076
+ *
9077
+ * `skip` is what happens without this: the new firing is ignored — which is what keeps a double click from submitting
9078
+ * twice, and exactly wrong for a stream of events a flow must answer every one of. `queue` runs each firing after the
9079
+ * last, in order; `parallel` runs them all at once; `latest` stops the run in progress — the server action or request
9080
+ * it waits on included — and runs the new one: a search as you type, where only the last question matters.
9081
+ *
9082
+ * ```ts
9083
+ * [whileRunning('queue', named('arrived', on('onArrival'))), addNotification({ … }), delay(8000), …]
9084
+ * ```
9085
+ */
9086
+ var whileRunning = (mode, trigger) => {
9087
+ if (trigger.type !== "trigger") throw new AuthoringError("while-running", `whileRunning('${mode}', …) wraps a flow's TRIGGER — it decides what firing the trigger again does — and was given a "${trigger.type}" step (${trigger.action}). Put it around the first step: \`[whileRunning('${mode}', onClick()), …]\`.`);
9088
+ if (!e$15.includes(mode)) throw new AuthoringError("while-running", `whileRunning takes ${e$15.map((item) => `'${item}'`).join(", ")}, not '${mode}'.`);
9089
+ return {
9090
+ ...trigger,
9091
+ whileRunning: mode
9092
+ };
9093
+ };
9094
+ /**
9095
+ * Runs a step only if the named server action completed.
9096
+ *
9097
+ * `<id>.status` is the field, and it is only in the flow scope at all when that step ran with `mode: 'await'` and
9098
+ * was {@link named} — the same two conditions that make `{{<id>.output.*}}` readable. Only `runServerAction` publishes
9099
+ * a `status`: any other step is asked about what it publishes (`authLogin`'s `ok`), with {@link when}.
9100
+ */
9101
+ var whenSucceeded = (stepId, step) => when({
9102
+ field: `${stepId}.status`,
9103
+ operator: "=",
9104
+ value: "completed"
9105
+ }, step);
9106
+ /**
9107
+ * Runs a step only if the named server action did NOT complete.
9108
+ *
9109
+ * Every outcome that is not `completed`, which is deliberate: a run can come back `failed`, `skipped` or
9110
+ * `aborted`, and to the page they are one event — it did not work, and the reason is in `{{<id>.reason}}` — and, when
9111
+ * the server or a step wrote one for the caller (`ActionRefusal`, `flow.fail` telling the caller), in
9112
+ * `{{<id>.error}}`.
9113
+ * Matching only `failed` is how the other two end up silently doing nothing.
9114
+ */
9115
+ var whenFailed = (stepId, step) => when({
9116
+ field: `${stepId}.status`,
9117
+ operator: "!=",
9118
+ value: "completed"
9119
+ }, step);
9120
+ var authorFlows = (flows, host) => {
9121
+ const counters = /* @__PURE__ */ new Map();
9122
+ return flows.reduce((all, steps) => ({
9123
+ ...all,
9124
+ ...authorFlow(steps, host, counters)
9125
+ }), {});
9126
+ };
9127
+ //#endregion
9772
9128
  //#region src/interactions/steps.ts
9773
9129
  var steps_exports = /* @__PURE__ */ __exportAll({
9774
9130
  SET_STATE_TYPES: () => SET_STATE_TYPES,
@@ -9788,6 +9144,7 @@ var steps_exports = /* @__PURE__ */ __exportAll({
9788
9144
  navigate: () => navigate,
9789
9145
  removeState: () => removeState,
9790
9146
  runServerAction: () => runServerAction,
9147
+ runServerActionOrNotify: () => runServerActionOrNotify,
9791
9148
  setState: () => setState,
9792
9149
  stepState: () => stepState,
9793
9150
  toggleInState: () => toggleInState,
@@ -9950,6 +9307,25 @@ var runServerAction = (params) => globalStep("runServerAction", {
9950
9307
  input: {},
9951
9308
  ...params
9952
9309
  });
9310
+ /** A text as a Twig string literal: in the quotes it holds fewer of, the other kind escaped. */
9311
+ var twigString = (text) => {
9312
+ const quote = text.includes("'") && !text.includes("\"") ? "\"" : "'";
9313
+ return `${quote}${text.replace(/\\/g, "\\\\").replaceAll(quote, `\\${quote}`)}${quote}`;
9314
+ };
9315
+ /**
9316
+ * A server action run under `id`, and the notice the visitor reads when it fails: the action's own refusal — the words a
9317
+ * task's `ActionRefusal` or a broken param rule gave — or `fallback` when it gave none. Two steps, to spread into a
9318
+ * flow; later steps read the run as `{{ <id>.output }}` and go on with `whenSucceeded(id, …)`.
9319
+ *
9320
+ * ```ts
9321
+ * [onClick(), ...runServerActionOrNotify('saved', { actionId: save.id, input: { title: '{{ state.title }}' } }, 'That did not save. Try again.')]
9322
+ * ```
9323
+ */
9324
+ var runServerActionOrNotify = (id, params, fallback, notice = {}) => [named$2(id, runServerAction(params)), whenFailed(id, addNotification({
9325
+ content: `{{ ${id}.error ? ${id}.error : ${twigString(fallback)} }}`,
9326
+ appearance: notice.appearance ?? "danger",
9327
+ placement: notice.placement ?? "bottom-center"
9328
+ }))];
9953
9329
  var cancelServerAction = (params) => globalStep("cancelServerAction", params);
9954
9330
  /**
9955
9331
  * Tells the page's providers the data behind them changed, so the api containers showing it ask again — a browser
@@ -9996,7 +9372,7 @@ var webHook = (params) => utilityStep("webHook", params);
9996
9372
  var twigTemplate = (params) => utilityStep("twigTemplate", params);
9997
9373
  //#endregion
9998
9374
  //#region ../sdk-interactions/dist/utility/copyToClipboardSpec.mjs
9999
- var e$15 = {
9375
+ var e$14 = {
10000
9376
  title: "Copy To Clipboard",
10001
9377
  type: "utility",
10002
9378
  strictParams: !0,
@@ -10107,295 +9483,109 @@ var BUILTIN_UTILITIES = {
10107
9483
  label: "Cache response",
10108
9484
  when: t$14
10109
9485
  },
10110
- staleTime: {
10111
- type: "number",
10112
- description: "With `cache`: seconds the answer is served without asking again.",
10113
- default: 30,
10114
- label: "Fresh for (s)",
10115
- when: (e) => t$14(e) && (e.cache === !0 || e.cache === "true")
10116
- },
10117
- ...t$16([
10118
- "origin",
10119
- "all",
10120
- "elements",
10121
- "none"
10122
- ], (e) => !t$14(e))
10123
- },
10124
- preview: { response: {
10125
- status: "",
10126
- data: ""
10127
- } }
10128
- },
10129
- copyToClipboard: e$15
10130
- };
10131
- /** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
10132
- var getUtility = (action) => Object.hasOwn(BUILTIN_UTILITIES, action) ? BUILTIN_UTILITIES[action] : void 0;
10133
- /** Reconcile a `utility` action against the utility catalog: unknown keys dropped for a closed utility, then missing
10134
- * defaults filled. An unknown action yields unchanged params. */
10135
- var applyUtility = (action, params) => {
10136
- const utility = getUtility(action);
10137
- if (!utility) return {
10138
- known: false,
10139
- params
10140
- };
10141
- return {
10142
- known: true,
10143
- params: c$19(params, utility.params, utility.strictParams)
10144
- };
10145
- };
10146
- var NOT_FOUND_ID = "plitzi-not-found";
10147
- /**
10148
- * The page a space that declares none of its own answers an unknown address with — inside the home page's layout, so
10149
- * a visitor who mistyped a link is still on the site: what was asked for is not here, and the way home.
10150
- */
10151
- var defaultNotFoundPage = (home) => ({
10152
- id: NOT_FOUND_ID,
10153
- name: "Not found",
10154
- slug: "*",
10155
- seoTitle: "Page not found",
10156
- ...home?.layout ? { layout: home.layout } : {},
10157
- body: [container({
10158
- id: `${NOT_FOUND_ID}-body`,
10159
- css: {
10160
- display: "flex",
10161
- "flex-direction": "column",
10162
- "align-items": "center",
10163
- "row-gap": "16px",
10164
- padding: "96px 24px",
10165
- "text-align": "center"
10166
- },
10167
- children: [
10168
- heading("Page not found", {
10169
- id: `${NOT_FOUND_ID}-title`,
10170
- subType: "h1"
10171
- }),
10172
- paragraph({
10173
- id: `${NOT_FOUND_ID}-text`,
10174
- content: "There is nothing at this address."
10175
- }),
10176
- link({
10177
- id: `${NOT_FOUND_ID}-home`,
10178
- href: "/",
10179
- content: "Back to the home page"
10180
- })
10181
- ]
10182
- })]
10183
- });
10184
- var isTopLevelNotFound = (page) => page.slug === "*" && !page.folder;
10185
- /**
10186
- * The space with a page for the addresses no page answers: its own, or — when it declares none — a plain one, said as a
10187
- * suggestion so the author knows it is there and how to write theirs. A space that is not a list of pages yet is left
10188
- * as it is, for authoring to refuse.
10189
- */
10190
- var withNotFoundPage = (spec) => {
10191
- if (!Array.isArray(spec.pages) || spec.pages.length === 0 || spec.pages.some(isTopLevelNotFound)) return { spec };
10192
- const home = spec.pages.find((page) => page.slug === "" && !page.folder);
10193
- const page = defaultNotFoundPage(home);
10194
- return {
10195
- spec: {
10196
- ...spec,
10197
- pages: [...spec.pages, page]
10198
- },
10199
- added: {
10200
- code: "not-found-page",
10201
- message: `No page answers an address nothing else does, so a plain one was added${home?.layout ? ` in the layout "${home.layout.id}"` : ""}, sent with status 404: write your own — a page whose slug is '*' — to say it in the space's words.`,
10202
- elementIds: [NOT_FOUND_ID],
10203
- saves: 0
10204
- }
10205
- };
10206
- };
10207
- //#endregion
10208
- //#region ../sdk-shared/dist/actions/failureHandler.mjs
10209
- var e$14 = "flow.onFailure";
10210
- //#endregion
10211
- //#region ../sdk-shared/dist/actions/functions.mjs
10212
- var a$9 = (e) => e === "/fn" || e.startsWith("/fn/");
10213
- //#endregion
10214
- //#region ../sdk-shared/dist/types/SchemaTypes.mjs
10215
- var e$13 = [
10216
- "skip",
10217
- "parallel",
10218
- "queue",
10219
- "latest"
10220
- ];
10221
- //#endregion
10222
- //#region src/schema/flows.ts
10223
- var ruleOf = (rule) => "value" in rule ? rule : {
10224
- ...rule,
10225
- value: ""
10226
- };
10227
- /**
10228
- * Where a step runs, when it did not say.
10229
- *
10230
- * A trigger fires on the element the flow is declared on, and an element callback with no target changes that same
10231
- * element — in both cases the answer is the host, and writing it out is repetition that can be got wrong. A global
10232
- * callback names its source module, which its builder fills in; a utility names nothing, and null is the answer.
10233
- */
10234
- var hostFor = (step, host) => step.type === "trigger" || step.type === "callback" ? host ?? null : null;
10235
- /**
10236
- * What a step may be called, and that no two are called the same.
10237
- *
10238
- * A flow is a MAP keyed by step id, so a repeat does not add a step — it replaces one, and the flow that runs is
10239
- * shorter than the one that was written with nothing saying so. The charset is the id charset: a later step reads
10240
- * an earlier one as `{{ <id>.field }}`, and a '.' would split that path into two segments.
10241
- */
10242
- var assertStepIds = (ids, where) => {
10243
- const seen = /* @__PURE__ */ new Set();
10244
- for (const id of ids) {
10245
- if (!t$28(id)) throw new AuthoringError("step-name", `Step "${id}" in ${where} is not a valid name: start with a letter, then letters, numbers, hyphens and underscores. A later step reads this one as {{ ${id}.field }}.`);
10246
- if (seen.has(id)) throw new AuthoringError("step-duplicate", `${where} names the step "${id}" twice. A flow's steps are keyed by id, so the second wins.`);
10247
- seen.add(id);
10248
- }
10249
- };
10250
- /**
10251
- * The ids a flow's steps are written under. A step's output is addressed as `{{ <id>.field }}` from every later step,
10252
- * so an unnamed one still gets a name worth reading — `navigate-2` — counted per action, which is what a person would
10253
- * have called it anyway.
10254
- */
10255
- var stepIds = (steps, counters) => {
10256
- const named = new Set(steps.map((step) => step.id).filter(Boolean));
10257
- return steps.map((step) => {
10258
- if (step.id) return step.id;
10259
- const base = step.action.replace(/[^A-Za-z0-9]/g, "") || step.type;
10260
- let next = (counters.get(base) ?? 0) + 1;
10261
- while (named.has(`${base}-${next}`)) next += 1;
10262
- counters.set(base, next);
10263
- return `${base}-${next}`;
10264
- });
10265
- };
10266
- /** Every step's id, flow by flow, as `authorFlows` writes them — where a step of the document was in the source. */
10267
- var flowStepIds = (flows) => {
10268
- const counters = /* @__PURE__ */ new Map();
10269
- return flows.map((steps) => stepIds(steps, counters));
10270
- };
10271
- /**
10272
- * One interaction flow, chained.
10273
- *
10274
- * The nodes are a linked list — each knows the one before and the one after, and they all carry the id of the
10275
- * first as their `flowId`. Getting one of those three wrong produces a flow that half runs, which is why this is
10276
- * derived from the order the steps were written in rather than declared.
10277
- */
10278
- var authorFlow = (steps, host, counters = /* @__PURE__ */ new Map()) => {
10279
- const ids = stepIds(steps, counters);
10280
- assertStepIds(ids, host ? `the flow on "${host}"` : "this flow");
10281
- const flowId = ids[0] ?? "";
10282
- return steps.reduce((flow, step, index) => {
10283
- flow[ids[index]] = {
10284
- id: ids[index],
10285
- title: step.title ?? step.action,
10286
- type: step.type,
10287
- action: step.action,
10288
- params: step.params ?? {},
10289
- preview: step.preview ?? {},
10290
- elementId: step.on ?? hostFor(step, host),
10291
- beforeNode: index === 0 ? "" : ids[index - 1],
10292
- afterNode: index === steps.length - 1 ? "" : ids[index + 1],
10293
- flowId,
10294
- enabled: step.enabled ?? true,
10295
- ...step.when ? { when: step.when } : {},
10296
- ...step.whileRunning && step.whileRunning !== "skip" ? { whileRunning: step.whileRunning } : {}
10297
- };
10298
- return flow;
10299
- }, {});
9486
+ staleTime: {
9487
+ type: "number",
9488
+ description: "With `cache`: seconds the answer is served without asking again.",
9489
+ default: 30,
9490
+ label: "Fresh for (s)",
9491
+ when: (e) => t$14(e) && (e.cache === !0 || e.cache === "true")
9492
+ },
9493
+ ...t$16([
9494
+ "origin",
9495
+ "all",
9496
+ "elements",
9497
+ "none"
9498
+ ], (e) => !t$14(e))
9499
+ },
9500
+ preview: { response: {
9501
+ status: "",
9502
+ data: ""
9503
+ } }
9504
+ },
9505
+ copyToClipboard: e$14
10300
9506
  };
10301
- /**
10302
- * Names a step, so a later one can read what it produced.
10303
- *
10304
- * A running flow keeps its scope keyed by node id, which means `{{ login.values.username }}` resolves only when
10305
- * the step that produced it is called `login`. Left unnamed, a step is still named — `<action>-<n>` — so its result
10306
- * is reachable; naming it yourself is how it becomes readable.
10307
- */
10308
- var named$2 = (id, step) => ({
10309
- ...step,
10310
- id
10311
- });
10312
- /**
10313
- * Runs a step only when a rule holds.
10314
- *
10315
- * The pair to {@link named}: that one lets a later step READ what an earlier one produced, this one lets it decide
10316
- * whether to run at all. Both are about the same thing — a flow is a list, and everything conditional in it is
10317
- * expressed on the steps rather than by branching the list.
10318
- *
10319
- * Written out, a condition is a query-builder group: a combinator and a list of rules, four levels of nesting for
10320
- * "did that work?". Here it is the rule.
10321
- */
10322
- var when = (rules, step, combinator = "and") => {
10323
- const group = {
10324
- combinator,
10325
- rules: (Array.isArray(rules) ? rules : [rules]).map(ruleOf)
9507
+ /** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
9508
+ var getUtility = (action) => Object.hasOwn(BUILTIN_UTILITIES, action) ? BUILTIN_UTILITIES[action] : void 0;
9509
+ /** Reconcile a `utility` action against the utility catalog: unknown keys dropped for a closed utility, then missing
9510
+ * defaults filled. An unknown action yields unchanged params. */
9511
+ var applyUtility = (action, params) => {
9512
+ const utility = getUtility(action);
9513
+ if (!utility) return {
9514
+ known: false,
9515
+ params
10326
9516
  };
10327
9517
  return {
10328
- ...step,
10329
- when: step.when ? both(step.when, group) : group
9518
+ known: true,
9519
+ params: c$19(params, utility.params, utility.strictParams)
10330
9520
  };
10331
9521
  };
9522
+ var NOT_FOUND_ID = "plitzi-not-found";
10332
9523
  /**
10333
- * Two conditions a step must BOTH meet — the one it already had and the one put around it.
10334
- *
10335
- * `when(a, when(b, step))` used to replace `b` with `a`: the step ran whenever `a` held, whatever `b` said, and nothing
10336
- * anywhere said so. A helper that returns its steps already guarded (a `when` inside) and a caller adding its own guard
10337
- * is the ordinary way to get there. Two `and` groups are one group of all their rules; otherwise each keeps its own.
9524
+ * The page a space that declares none of its own answers an unknown address with — inside the home page's layout, so
9525
+ * a visitor who mistyped a link is still on the site: what was asked for is not here, and the way home.
10338
9526
  */
10339
- var both = (inner, outer) => inner.combinator === "and" && outer.combinator === "and" && inner.enabled !== false && outer.enabled !== false ? {
10340
- combinator: "and",
10341
- rules: [...outer.rules, ...inner.rules]
10342
- } : {
10343
- combinator: "and",
10344
- rules: [outer, inner]
10345
- };
9527
+ var defaultNotFoundPage = (home) => ({
9528
+ id: NOT_FOUND_ID,
9529
+ name: "Not found",
9530
+ slug: "*",
9531
+ seoTitle: "Page not found",
9532
+ ...home?.layout ? { layout: home.layout } : {},
9533
+ body: [container({
9534
+ id: `${NOT_FOUND_ID}-body`,
9535
+ css: {
9536
+ display: "flex",
9537
+ "flex-direction": "column",
9538
+ "align-items": "center",
9539
+ "row-gap": "16px",
9540
+ padding: "96px 24px",
9541
+ "text-align": "center"
9542
+ },
9543
+ children: [
9544
+ heading("Page not found", {
9545
+ id: `${NOT_FOUND_ID}-title`,
9546
+ subType: "h1"
9547
+ }),
9548
+ paragraph({
9549
+ id: `${NOT_FOUND_ID}-text`,
9550
+ content: "There is nothing at this address."
9551
+ }),
9552
+ link({
9553
+ id: `${NOT_FOUND_ID}-home`,
9554
+ href: "/",
9555
+ content: "Back to the home page"
9556
+ })
9557
+ ]
9558
+ })]
9559
+ });
9560
+ var isTopLevelNotFound = (page) => page.slug === "*" && !page.folder;
10346
9561
  /**
10347
- * What a trigger does when it fires again while the flow it started still runs.
10348
- *
10349
- * `skip` is what happens without this: the new firing is ignored — which is what keeps a double click from submitting
10350
- * twice, and exactly wrong for a stream of events a flow must answer every one of. `queue` runs each firing after the
10351
- * last, in order; `parallel` runs them all at once; `latest` stops the run in progress — the server action or request
10352
- * it waits on included — and runs the new one: a search as you type, where only the last question matters.
10353
- *
10354
- * ```ts
10355
- * [whileRunning('queue', named('arrived', on('onArrival'))), addNotification({ … }), delay(8000), …]
10356
- * ```
9562
+ * The space with a page for the addresses no page answers: its own, or — when it declares none — a plain one, said as a
9563
+ * suggestion so the author knows it is there and how to write theirs. A space that is not a list of pages yet is left
9564
+ * as it is, for authoring to refuse.
10357
9565
  */
10358
- var whileRunning = (mode, trigger) => {
10359
- if (trigger.type !== "trigger") throw new AuthoringError("while-running", `whileRunning('${mode}', …) wraps a flow's TRIGGER — it decides what firing the trigger again does — and was given a "${trigger.type}" step (${trigger.action}). Put it around the first step: \`[whileRunning('${mode}', onClick()), …]\`.`);
10360
- if (!e$13.includes(mode)) throw new AuthoringError("while-running", `whileRunning takes ${e$13.map((item) => `'${item}'`).join(", ")}, not '${mode}'.`);
9566
+ var withNotFoundPage = (spec) => {
9567
+ if (!Array.isArray(spec.pages) || spec.pages.length === 0 || spec.pages.some(isTopLevelNotFound)) return { spec };
9568
+ const home = spec.pages.find((page) => page.slug === "" && !page.folder);
9569
+ const page = defaultNotFoundPage(home);
10361
9570
  return {
10362
- ...trigger,
10363
- whileRunning: mode
9571
+ spec: {
9572
+ ...spec,
9573
+ pages: [...spec.pages, page]
9574
+ },
9575
+ added: {
9576
+ code: "not-found-page",
9577
+ message: `No page answers an address nothing else does, so a plain one was added${home?.layout ? ` in the layout "${home.layout.id}"` : ""}, sent with status 404: write your own — a page whose slug is '*' — to say it in the space's words.`,
9578
+ elementIds: [NOT_FOUND_ID],
9579
+ saves: 0
9580
+ }
10364
9581
  };
10365
9582
  };
10366
- /**
10367
- * Runs a step only if the named server action completed.
10368
- *
10369
- * `<id>.status` is the field, and it is only in the flow scope at all when that step ran with `mode: 'await'` and
10370
- * was {@link named} — the same two conditions that make `{{<id>.output.*}}` readable. Only `runServerAction` publishes
10371
- * a `status`: any other step is asked about what it publishes (`authLogin`'s `ok`), with {@link when}.
10372
- */
10373
- var whenSucceeded = (stepId, step) => when({
10374
- field: `${stepId}.status`,
10375
- operator: "=",
10376
- value: "completed"
10377
- }, step);
10378
- /**
10379
- * Runs a step only if the named server action did NOT complete.
10380
- *
10381
- * Every outcome that is not `completed`, which is deliberate: a run can come back `failed`, `skipped` or
10382
- * `aborted`, and to the page they are one event — it did not work, and the reason is in `{{<id>.reason}}` — and, when
10383
- * the server or a step wrote one for the caller (`ActionRefusal`, `flow.fail` telling the caller), in
10384
- * `{{<id>.error}}`.
10385
- * Matching only `failed` is how the other two end up silently doing nothing.
10386
- */
10387
- var whenFailed = (stepId, step) => when({
10388
- field: `${stepId}.status`,
10389
- operator: "!=",
10390
- value: "completed"
10391
- }, step);
10392
- var authorFlows = (flows, host) => {
10393
- const counters = /* @__PURE__ */ new Map();
10394
- return flows.reduce((all, steps) => ({
10395
- ...all,
10396
- ...authorFlow(steps, host, counters)
10397
- }), {});
10398
- };
9583
+ //#endregion
9584
+ //#region ../sdk-shared/dist/actions/failureHandler.mjs
9585
+ var e$13 = "flow.onFailure";
9586
+ //#endregion
9587
+ //#region ../sdk-shared/dist/actions/functions.mjs
9588
+ var a$9 = (e) => e === "/fn" || e.startsWith("/fn/");
10399
9589
  //#endregion
10400
9590
  //#region src/schema/actions.ts
10401
9591
  var accessParams = (access) => {
@@ -10528,7 +9718,7 @@ var defineAction = (spec) => {
10528
9718
  ...undo.length > 0 ? [{
10529
9719
  id: "onFailure",
10530
9720
  type: "task",
10531
- action: e$14,
9721
+ action: e$13,
10532
9722
  params: {}
10533
9723
  }, ...undo.map(taskStep)] : []
10534
9724
  ];
@@ -10542,6 +9732,54 @@ var defineAction = (spec) => {
10542
9732
  }
10543
9733
  };
10544
9734
  };
9735
+ /** What a param of a task takes in from a caller: the same value, as the field of an action's input. */
9736
+ var fieldTypeOf = (type) => {
9737
+ if (type === "number" || type === "boolean") return type;
9738
+ return type === "codemirror-json" || type === "elements" ? "json" : "text";
9739
+ };
9740
+ /** A task's params as the input of an action that runs it: each param a field, with its label, default and need. */
9741
+ var inputOf$1 = (params) => Object.fromEntries(Object.entries(params).map(([key, param]) => {
9742
+ const { defaultValue } = param;
9743
+ return [key, {
9744
+ type: fieldTypeOf(param.type),
9745
+ ...param.label ? { label: param.label } : {},
9746
+ ...typeof defaultValue === "string" || typeof defaultValue === "number" || typeof defaultValue === "boolean" ? { defaultValue } : {},
9747
+ ...param.required ? { required: true } : {}
9748
+ }];
9749
+ }));
9750
+ var kebab = (name) => name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
9751
+ /**
9752
+ * A server action that runs one of the space's tasks and answers its result — the way in a task is reached by from a
9753
+ * page (`call`), the HTML (`render`) or anywhere else, written once: the task's params are the action's input, its
9754
+ * title and description the action's, its address the id.
9755
+ *
9756
+ * ```ts
9757
+ * export const make = taskAction(tasks.make, { trigger: { type: 'call', access: 'public' } });
9758
+ * runServerAction({ actionId: make.id, input: { title: '{{ state.title }}' } });
9759
+ * ```
9760
+ *
9761
+ * An action of more than one step, or one whose input is not the task's params, is a `defineAction`.
9762
+ */
9763
+ var taskAction = (task, { trigger, id, name, description, output, limits }) => {
9764
+ const input = inputOf$1(task.params);
9765
+ const triggers = (Array.isArray(trigger) ? trigger : [trigger]).map((each) => ({
9766
+ ...each,
9767
+ input: each.input ?? input
9768
+ }));
9769
+ const about = description ?? task.description;
9770
+ return defineAction({
9771
+ id: id ?? `${task.namespace}-${kebab(task.action)}`,
9772
+ name: name ?? task.title,
9773
+ ...about ? { description: about } : {},
9774
+ trigger: triggers.length === 1 ? triggers[0] : triggers,
9775
+ steps: [{
9776
+ id: "result",
9777
+ task: `${task.namespace}.${task.action}`
9778
+ }],
9779
+ ...output ? { output } : {},
9780
+ ...limits ? { limits } : {}
9781
+ });
9782
+ };
10545
9783
  //#endregion
10546
9784
  //#region src/schema/codesPage.ts
10547
9785
  var cell = (text) => text.replaceAll("|", "\\|");
@@ -11233,16 +10471,15 @@ var e$9 = "/data/";
11233
10471
  * Following a binding's path into a value — a provider's answer, a sample of it — the one way the linter (against a
11234
10472
  * sample of the answer) and a page check (against the answer itself) both do it, so the two say the same thing.
11235
10473
  */
11236
- var isRecord$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
11237
10474
  /** A path as its steps: `apiContainer_site.data.rows[2].title` is `apiContainer_site`, `data`, `rows`, `2`, `title`. */
11238
10475
  var pathSteps = (path) => path.split(/[.[\]]/).filter((step) => step !== "");
11239
10476
  /** Where a path leads in a value — or how far it got, and what was there to choose from where it stopped. */
11240
10477
  var followPath = (value, steps) => {
11241
10478
  let current = value;
11242
10479
  for (const [index, step] of steps.entries()) {
11243
- const next = Array.isArray(current) ? current[Number(step)] : isRecord$1(current) ? current[step] : void 0;
10480
+ const next = Array.isArray(current) ? current[Number(step)] : e$33(current) ? current[step] : void 0;
11244
10481
  if (next === void 0) {
11245
- const keys = isRecord$1(current) ? Object.keys(current) : Array.isArray(current) ? [`0…${String(current.length - 1)}`] : [];
10482
+ const keys = e$33(current) ? Object.keys(current) : Array.isArray(current) ? [`0…${String(current.length - 1)}`] : [];
11246
10483
  return {
11247
10484
  found: false,
11248
10485
  at: steps.slice(0, index),
@@ -14949,11 +14186,6 @@ var SETTLED_SOURCES = /* @__PURE__ */ new Set([
14949
14186
  "computed"
14950
14187
  ]);
14951
14188
  var shorten = (value) => value.length > 80 ? `${value.slice(0, 77)}…` : value;
14952
- var stringsIn$1 = (value) => {
14953
- if (typeof value === "string") return [value];
14954
- if (Array.isArray(value)) return value.flatMap(stringsIn$1);
14955
- return typeof value === "object" && value !== null ? Object.values(value).flatMap(stringsIn$1) : [];
14956
- };
14957
14189
  var bindingsOf$2 = (element) => Object.entries(element.definition.bindings ?? {}).flatMap(([category, list]) => list.map((binding) => ({
14958
14190
  category,
14959
14191
  binding
@@ -15114,7 +14346,7 @@ var DATA_ATTRIBUTES = /* @__PURE__ */ new Set(["mockData"]);
15114
14346
  */
15115
14347
  var checkTemplateInValue = (ctx, element, where, name, value) => {
15116
14348
  const isProviderInput = element.definition.type === "apiContainer" && name === "input";
15117
- const template = stringsIn$1(value).find(e$7);
14349
+ const template = stringsIn(value).find(e$7);
15118
14350
  if (template === void 0 || DATA_ATTRIBUTES.has(name) || isProviderInput) return;
15119
14351
  ctx.error("template-in-value", `${where}: its "${name}" holds "${shorten(template)}" inside ${Array.isArray(value) ? "a list" : "an object"}, which is never evaluated — only an attribute that is text is, and this one is handed over as written. Bind "${name}" instead, evaluated where it renders: \`bindTemplate('${name}', source, '{{ … }}', { returns: 'value' })\`.`, element.id);
15120
14352
  };
@@ -15194,10 +14426,10 @@ var writtenInput = (input) => {
15194
14426
  * was already given — so `{ room: '{{ navigation.routeParams.room }}' }` hands the action braces instead of the room.
15195
14427
  */
15196
14428
  var checkWrittenInput = (ctx, input, where, elementId) => {
15197
- const templated = Object.entries(writtenInput(input) ?? {}).filter(([, value]) => stringsIn$1(value).some(e$7));
14429
+ const templated = Object.entries(writtenInput(input) ?? {}).filter(([, value]) => stringsIn(value).some(e$7));
15198
14430
  if (templated.length === 0) return;
15199
14431
  const keys = templated.map(([key]) => key);
15200
- const how = templated.filter(([key, value]) => stringsIn$1(value).some((text) => [...text.matchAll(ADDRESS_PARAM)].some((match) => match[1] === key))).length === templated.length ? `The action is already handed the page's route and query params as its input — \`input.${keys[0]}\` — so remove ${keys.length === 1 ? "it" : "them"} from \`input\`.` : `Bind the input instead, evaluated where it runs: \`bindTemplate('input', 'state.${keys[0]}', '{{ { ${keys[0]}: source } }}', { returns: 'value' })\`. The page's route and query params already reach the action as its input.`;
14432
+ const how = templated.filter(([key, value]) => stringsIn(value).some((text) => [...text.matchAll(ADDRESS_PARAM)].some((match) => match[1] === key))).length === templated.length ? `The action is already handed the page's route and query params as its input — \`input.${keys[0]}\` — so remove ${keys.length === 1 ? "it" : "them"} from \`input\`.` : `Bind the input instead, evaluated where it runs: \`bindTemplate('input', 'state.${keys[0]}', '{{ { ${keys[0]}: source } }}', { returns: 'value' })\`. The page's route and query params already reach the action as its input.`;
15201
14433
  ctx.error("template-in-value", `${where} writes ${keys.map((key) => `"${key}"`).join(", ")} into its \`input\` as a template, which is never evaluated: a written input is sent as it is, braces and all. ${how}`, elementId);
15202
14434
  };
15203
14435
  /**
@@ -15271,9 +14503,9 @@ var ROUTE_PARAM = /navigation\.routeParams\.([A-Za-z_][\w-]*)/g;
15271
14503
  */
15272
14504
  var warnRouteParams = (ctx, element, where) => {
15273
14505
  const read = new Set([
15274
- ...PROSE_TYPES.has(element.definition.type) ? [] : stringsIn$1(element.attributes),
15275
- ...bindingsOf$2(element).flatMap(({ binding }) => [binding.source, ...stringsIn$1(binding.transformers)]),
15276
- ...stringsIn$1(Object.values(element.definition.interactions ?? {}).map((node) => node.params))
14506
+ ...PROSE_TYPES.has(element.definition.type) ? [] : stringsIn(element.attributes),
14507
+ ...bindingsOf$2(element).flatMap(({ binding }) => [binding.source, ...stringsIn(binding.transformers)]),
14508
+ ...stringsIn(Object.values(element.definition.interactions ?? {}).map((node) => node.params))
15277
14509
  ].flatMap((text) => [...text.matchAll(ROUTE_PARAM)].map(([, name]) => name)));
15278
14510
  const declared = ctx.routeParams(element.id);
15279
14511
  for (const name of read) if (!declared.includes(name)) ctx.warn("route-param-undeclared", `${where} reads "navigation.routeParams.${name}", but its page's address has no ":${name}"${declared.length > 0 ? ` (it has ${declared.map((param) => `:${param}`).join(", ")})` : ""}, so it is always empty. Add \`:${name}\` to the page's slug — \`slug: 'posts/:${name}'\` — or, for a query parameter, read \`navigation.queryParams.${name}\`.`, element.id, { param: name });
@@ -15416,12 +14648,6 @@ var STATE_PATH_PARAMS = {
15416
14648
  };
15417
14649
  /** The element callbacks that write one field of the element they run on, named by `category` and `key`. */
15418
14650
  var FIELD_CALLBACKS = /* @__PURE__ */ new Set(["setState", "toggleState"]);
15419
- /** Every string inside a value, however deep — a step's params nest objects and lists of them. */
15420
- var stringsIn = (value) => {
15421
- if (typeof value === "string") return [value];
15422
- if (Array.isArray(value)) return value.flatMap(stringsIn);
15423
- return typeof value === "object" && value !== null ? Object.values(value).flatMap(stringsIn) : [];
15424
- };
15425
14651
  /**
15426
14652
  * The flows an element declares, each in the order it runs.
15427
14653
  *
@@ -15533,7 +14759,7 @@ var checkWhileRunning = (ctx, node, where, hostId) => {
15533
14759
  ctx.error("while-running", `${where}: step "${node.id}" (${node.action}) sets whileRunning, which only a flow's trigger reads. Put it on the first step: \`[whileRunning('${whileRunning}', onClick()), …]\`.`, hostId);
15534
14760
  return;
15535
14761
  }
15536
- if (!e$13.includes(whileRunning)) ctx.error("while-running", `${where}: the trigger "${node.action}" sets whileRunning "${whileRunning}". It is one of ${e$13.map((mode) => `'${mode}'`).join(", ")}.`, hostId);
14762
+ if (!e$15.includes(whileRunning)) ctx.error("while-running", `${where}: the trigger "${node.action}" sets whileRunning "${whileRunning}". It is one of ${e$15.map((mode) => `'${mode}'`).join(", ")}.`, hostId);
15537
14763
  };
15538
14764
  var checkTrigger = (ctx, node, where, host) => {
15539
14765
  checkTriggerKeys(ctx, node, where, host.id);
@@ -17766,6 +16992,46 @@ var suggestDeclarations = (schema, style, stylesheets = []) => {
17766
16992
  ];
17767
16993
  };
17768
16994
  //#endregion
16995
+ //#region src/schema/advice/elementColors.ts
16996
+ /** The types the SDK gives no colour of their own: whatever they hold reads in the colour of the page around them. */
16997
+ var INHERITING = /* @__PURE__ */ new Set([
16998
+ "text",
16999
+ "heading",
17000
+ "paragraph",
17001
+ "fontAwesome",
17002
+ "link",
17003
+ "list",
17004
+ "listItem",
17005
+ "container"
17006
+ ]);
17007
+ /** An element type's own colour, as the space writes it for the type — at the widest breakpoint, before any state. */
17008
+ var colourOf = (style, type) => {
17009
+ if (!Object.hasOwn(style.platform.desktop, type)) return;
17010
+ const item = style.platform.desktop[type];
17011
+ if (item.type !== "element" || !e$33(item.attributes.base)) return;
17012
+ const rules = item.attributes.base.default;
17013
+ return e$33(rules) ? rules.color : void 0;
17014
+ };
17015
+ /**
17016
+ * `elements` giving a type the colour it already takes: `inherit`, or the very colour the page has. Every element of
17017
+ * these types reads in the page's colour by itself — a link's words included — so the rule says nothing, and a reader
17018
+ * takes it for a choice. A theme's colour named once on the page is what follows the scheme.
17019
+ */
17020
+ var suggestElementColours = (style) => {
17021
+ const page = colourOf(style, "page");
17022
+ const restated = [...INHERITING].filter((type) => {
17023
+ const colour = colourOf(style, type);
17024
+ return colour === "inherit" || colour !== void 0 && colour === page;
17025
+ });
17026
+ return restated.length === 0 ? [] : [{
17027
+ code: "element-color-inherited",
17028
+ elementIds: [],
17029
+ saves: 0,
17030
+ subjects: restated,
17031
+ message: `\`elements\` gives ${restated.map((type) => `\`${type}\``).join(", ")} the colour ${restated.length === 1 ? "it takes" : "they take"} from the page anyway. Remove it: every element reads in the page's colour by itself, a link's words included — name the colour once, on \`elements.page\`.`
17032
+ }];
17033
+ };
17034
+ //#endregion
17769
17035
  //#region src/schema/advice/motion.ts
17770
17036
  /** What the compositor animates alone — and the two a keyframe may say about its own timing. */
17771
17037
  var COMPOSITED = /* @__PURE__ */ new Set([
@@ -17932,6 +17198,30 @@ var suggestMotion = (schema, style) => {
17932
17198
  }];
17933
17199
  };
17934
17200
  //#endregion
17201
+ //#region src/schema/advice/pluginHosts.ts
17202
+ /**
17203
+ * A `custom` element naming, by `renderType`, a plugin whose declaration the space was handed.
17204
+ *
17205
+ * It renders — a `custom` host loads the plugin's elements as an element of their own type does — so nothing here is
17206
+ * wrong. But a plugin is placed one way: from its declaration, `defineElement(declaration)`, typed by what
17207
+ * it declares and the same element the builder adds when somebody drops it. A `custom` host is for a component
17208
+ * registered by name with no declaration.
17209
+ */
17210
+ var suggestPluginHosts = (schema, pluginTypes) => {
17211
+ const declared = new Set(pluginTypes.filter((type) => type.startsWith(`${CUSTOM_TYPE}:`)));
17212
+ if (declared.size === 0) return [];
17213
+ return [schema.flat, ...Object.values(schema.components).map((component) => component.flat)].flatMap((flat) => Object.values(flat)).flatMap((element) => {
17214
+ const type = textOf(element.attributes.renderType);
17215
+ if (element.definition.type !== "custom" || !declared.has(`custom:${type}`)) return [];
17216
+ return [{
17217
+ code: "plugin-custom-host",
17218
+ message: `"${element.id}" places the plugin "${type}" by name, with \`custom({ renderType: '${type}' })\`: place it from its declaration — \`const ${type} = defineElement(declaration)\`, then \`${type}({ id: '${element.id}', … })\` — typed by what it declares, as the builder adds it.`,
17219
+ elementIds: [element.id],
17220
+ saves: 0
17221
+ }];
17222
+ });
17223
+ };
17224
+ //#endregion
17935
17225
  //#region src/schema/advice/repeats.ts
17936
17226
  /**
17937
17227
  * The same thing written more than once — the copies an author made by hand, or by calling a helper per page.
@@ -17964,6 +17254,12 @@ var stable = (value) => {
17964
17254
  * from its id (`heading-10b9`), different on every copy — counting those, no two copies would ever match.
17965
17255
  */
17966
17256
  var classesKey = (styleSelectors, declared) => stable(Object.fromEntries(Object.entries(styleSelectors).map(([selector, value]) => [selector, value.split(/\s+/).filter((name) => declared.has(name)).join(" ")])));
17257
+ /**
17258
+ * The form of a binding's template, apart from what a prop could say: every `{{ … }}` expression with its names replaced
17259
+ * by one placeholder, the words around them left out — `'{{ views.total|number }} views'` and
17260
+ * `'{{ edits.total|number }} edits'` are one form; `'{{ total }} of {{ quota }}'` another.
17261
+ */
17262
+ var templateForm = (template) => typeof template === "string" ? [...template.matchAll(/\{\{([\s\S]*?)\}\}/g)].map(([, expression]) => expression.replace(/[A-Za-z_$][\w$]*(\.[\w$]+)*/g, "§").replace(/\s+/g, "")).join(",") : "";
17967
17263
  /** The element a binding's source is published by — `apiContainer_feed.items` and `feed.items` both name `feed`. */
17968
17264
  var providerOf = (flat, source) => {
17969
17265
  const [head] = source.split(".");
@@ -18025,10 +17321,12 @@ var signaturesOf = (flat, declared) => {
18025
17321
  ...children.flatMap((child) => child.wiring.split("\n").filter(Boolean))
18026
17322
  ]);
18027
17323
  const body = `${type}|${stable(element.attributes)}|${stable(initialState?.visibility ?? null)}|${stable(reads)}`;
17324
+ const binds = stable(Object.values(bindings ?? {}).flat().map((binding) => `${binding.to}:${(binding.transformers ?? []).map((transformer) => `${transformer.action}(${templateForm(transformer.params.template)})`).join("+")}`).sort());
17325
+ const serverRendered = element.definition.runtime === "server" ? `|server:${id}` : "";
18028
17326
  const signatures = {
18029
17327
  exact: `${body}|${classes}(${children.map((child) => child.exact).join(",")})`,
18030
17328
  near: `${body}(${children.map((child) => child.near).join(",")})`,
18031
- shape: `${type}|${classes}|${flows}(${children.map((child) => child.shape).join(",")})`,
17329
+ shape: `${type}|${classes}|${flows}|${binds}${serverRendered}(${children.map((child) => child.shape).join(",")})`,
18032
17330
  outside,
18033
17331
  wiring: [...wired].sort().join("\n"),
18034
17332
  size: 1 + children.reduce((sum, child) => sum + child.size, 0)
@@ -18303,13 +17601,15 @@ var quietCodes = (schema) => new Map([schema.flat, ...Object.values(schema.compo
18303
17601
  * Each names what to write instead, and the ones about elements say how many it saves, which is what they are ranked
18304
17602
  * by.
18305
17603
  */
18306
- var suggestSpace = ({ schema, style }, { stylesheets = [], families = [] } = {}) => withoutQuieted(schema, [
17604
+ var suggestSpace = ({ schema, style }, { stylesheets = [], families = [], pluginTypes = [] } = {}) => withoutQuieted(schema, [
18307
17605
  ...suggestRepeats(schema, style, families),
18308
17606
  ...suggestContent(schema, style),
18309
17607
  ...suggestCustomCss(schema, style),
18310
17608
  ...suggestCustomCssSlots(schema),
18311
17609
  ...suggestMotion(schema, style),
18312
- ...suggestDeclarations(schema, style, stylesheets)
17610
+ ...suggestDeclarations(schema, style, stylesheets),
17611
+ ...suggestPluginHosts(schema, pluginTypes),
17612
+ ...suggestElementColours(style)
18313
17613
  ]).sort((a, b) => b.saves - a.saves);
18314
17614
  /** The suggestions no element they are about quiets — for those read beside the documents, too (authoring's own). */
18315
17615
  var withoutQuieted = (schema, suggestions) => {
@@ -19116,7 +18416,8 @@ var SpaceAuthor = class {
19116
18416
  style
19117
18417
  }, {
19118
18418
  stylesheets: this.options.stylesheets ?? [],
19119
- families: this.families
18419
+ families: this.families,
18420
+ pluginTypes: this.options.pluginTypes ?? []
19120
18421
  }), ...withoutQuieted(schema, this.classOverrides(schema, style.mode ?? "desktop-first"))].map((suggestion) => {
19121
18422
  const first = suggestion.elementIds.at(0);
19122
18423
  const at = first === void 0 ? void 0 : writtenAt(this.specOf(first));
@@ -19624,7 +18925,7 @@ var SpaceAuthor = class {
19624
18925
  for (const [name, prop] of Object.entries(component.props ?? {})) {
19625
18926
  const problem = c$8(name);
19626
18927
  if (problem) throw new AuthoringError("prop-name", `${where}: ${problem}.`);
19627
- const types = t$62;
18928
+ const types = t$61;
19628
18929
  const type = prop.type;
19629
18930
  if (!types.includes(type)) throw new AuthoringError("prop-type-unknown", `${where} declares the prop "${name}" as \`${type}\`, which is no type${didYouMean(type, [...types]) || "."} A prop is one of ${types.join(", ")}: words are \`text\`.`);
19630
18931
  }
@@ -21065,7 +20366,7 @@ var read = (entry) => {
21065
20366
  const passthrough = passthroughOf(ways);
21066
20367
  const steps = chain.slice(1, answerAt).map((node) => stepOf(node, passthrough));
21067
20368
  const handler = chain.at(answerAt + 1);
21068
- if (handler && handler.action !== "flow.onFailure") return refuse(`"${handler.id}" runs after the answer, where only ${e$14} may`);
20369
+ if (handler && handler.action !== "flow.onFailure") return refuse(`"${handler.id}" runs after the answer, where only ${e$13} may`);
21069
20370
  const undo = chain.slice(answerAt + 2);
21070
20371
  const last = steps.at(-1);
21071
20372
  const values = text(answer.params, "values");
@@ -23020,22 +22321,25 @@ var SourceWriter = class {
23020
22321
  }
23021
22322
  return this.files;
23022
22323
  }
23023
- /** The classes an element, a slot, a page or a layout names — the ones worth a variable. */
23024
- namedClasses() {
23025
- const named = /* @__PURE__ */ new Set();
23026
- const add = (value) => {
23027
- for (const name of Array.isArray(value) ? value : [value]) if (typeof name === "string") named.add(name);
23028
- };
22324
+ /** Every `class` the space writes — an element's, a slot's, a page's or a layout's — as it is written: a name or a list. */
22325
+ forEachClassValue(visit) {
23029
22326
  const walk = (element) => {
23030
- add(element.class);
23031
- Object.values(element.slots ?? {}).forEach(add);
22327
+ visit(element.class);
22328
+ Object.values(element.slots ?? {}).forEach(visit);
23032
22329
  element.children?.forEach(walk);
23033
22330
  };
23034
22331
  for (const root of [...this.spec.layouts ?? [], ...this.spec.pages]) {
23035
- add(root.class);
22332
+ visit(root.class);
23036
22333
  root.body.forEach(walk);
23037
22334
  }
23038
22335
  (this.spec.components ?? []).forEach((component) => walk(component.root));
22336
+ }
22337
+ /** The classes an element, a slot, a page or a layout names — the ones worth a variable. */
22338
+ namedClasses() {
22339
+ const named = /* @__PURE__ */ new Set();
22340
+ this.forEachClassValue((value) => {
22341
+ for (const name of Array.isArray(value) ? value : [value]) if (typeof name === "string") named.add(name);
22342
+ });
23039
22343
  return new Set(Object.keys(this.spec.classes ?? {}).filter((name) => named.has(name)));
23040
22344
  }
23041
22345
  /**
@@ -23057,21 +22361,11 @@ var SourceWriter = class {
23057
22361
  /** Every class that shares a selector with another — `class: ['panel-card', 'quota-panel']`. */
23058
22362
  stackedClasses() {
23059
22363
  const stacked = /* @__PURE__ */ new Set();
23060
- const add = (value) => {
22364
+ this.forEachClassValue((value) => {
23061
22365
  if (Array.isArray(value)) value.forEach((name) => {
23062
22366
  if (typeof name === "string") stacked.add(name);
23063
22367
  });
23064
- };
23065
- const walk = (element) => {
23066
- add(element.class);
23067
- Object.values(element.slots ?? {}).forEach(add);
23068
- element.children?.forEach(walk);
23069
- };
23070
- for (const root of [...this.spec.layouts ?? [], ...this.spec.pages]) {
23071
- add(root.class);
23072
- root.body.forEach(walk);
23073
- }
23074
- (this.spec.components ?? []).forEach((component) => walk(component.root));
22368
+ });
23075
22369
  return stacked;
23076
22370
  }
23077
22371
  /** A class's rules as `specFromSpace` wrote them — always a rule set, never a declaration it would have to name. */
@@ -23416,7 +22710,7 @@ var builderOf = (action, type) => {
23416
22710
  return builders.has(named) ? named : void 0;
23417
22711
  };
23418
22712
  var definitionIn = (catalog, name) => Object.hasOwn(catalog, name) ? catalog[name] : void 0;
23419
- var triggerDefinition = (name) => definitionIn(e$41, name) ?? definitionIn(typeTriggerDefinitions, name);
22713
+ var triggerDefinition = (name) => definitionIn(e$40, name) ?? definitionIn(typeTriggerDefinitions, name);
23420
22714
  /** The attributes each type is authored with; `null` for one that takes any, which is said by its defaults. */
23421
22715
  var attributeNames = elementAttributeNames;
23422
22716
  var explainElement = (type) => {
@@ -23446,7 +22740,7 @@ var explainElement = (type) => {
23446
22740
  var explainTrigger = (name) => {
23447
22741
  const definition = triggerDefinition(name);
23448
22742
  if (!definition) return;
23449
- const basic = Object.hasOwn(e$41, name);
22743
+ const basic = Object.hasOwn(e$40, name);
23450
22744
  return {
23451
22745
  kind: "trigger",
23452
22746
  name,
@@ -23550,7 +22844,7 @@ var explainList = (kind) => {
23550
22844
  name,
23551
22845
  summary: element.label
23552
22846
  })));
23553
- case "trigger": return sorted([.../* @__PURE__ */ new Set([...Object.keys(e$41), ...Object.keys(typeTriggerDefinitions)])].map((name) => ({
22847
+ case "trigger": return sorted([.../* @__PURE__ */ new Set([...Object.keys(e$40), ...Object.keys(typeTriggerDefinitions)])].map((name) => ({
23554
22848
  name,
23555
22849
  summary: triggerDefinition(name)?.title ?? name
23556
22850
  })));
@@ -25205,26 +24499,19 @@ var space$1 = {
25205
24499
  variables,
25206
24500
  fonts,
25207
24501
  /**
25208
- * What text is, before any class touches it.
25209
- *
25210
- * Per element TYPE, so every heading and paragraph follows the palette without naming a colour — which is what
25211
- * makes the dark scheme work: a hard-coded colour would win against the theme and leave black text on black.
24502
+ * What text is, before any class touches it: the page's type and colours, which every element inherits — headings,
24503
+ * paragraphs, icons and the words inside a link alike. Named once, on the page, so the dark scheme works: a colour
24504
+ * hard-coded on an element would win against the theme and leave black text on black.
25212
24505
  */
25213
- elements: {
25214
- page: { base: {
25215
- "font-family": "var(--font-sans)",
25216
- "flex-direction": "column",
25217
- position: "relative",
25218
- "min-width": "100%",
25219
- "min-height": "100dvh",
25220
- color: "var(--foreground)",
25221
- "background-color": "var(--background)"
25222
- } },
25223
- heading: { base: { color: "var(--foreground)" } },
25224
- text: { base: { color: "inherit" } },
25225
- paragraph: { base: { color: "var(--foreground)" } },
25226
- fontAwesome: { base: { color: "inherit" } }
25227
- },
24506
+ elements: { page: { base: {
24507
+ "font-family": "var(--font-sans)",
24508
+ "flex-direction": "column",
24509
+ position: "relative",
24510
+ "min-width": "100%",
24511
+ "min-height": "100dvh",
24512
+ color: "var(--foreground)",
24513
+ "background-color": "var(--background)"
24514
+ } } },
25228
24515
  pages: [{
25229
24516
  id: "home",
25230
24517
  name: "Home",
@@ -25310,7 +24597,7 @@ var space$1 = {
25310
24597
  };
25311
24598
  //#endregion
25312
24599
  //#region src/spaces/blank/spec.ts?raw
25313
- var spec_default$1 = "import { DOCS, GUIDES, PATHS } from './content.ts';\nimport { notFound } from './notFound.ts';\nimport {\n backdrop,\n bodyText,\n brandMark,\n button,\n card,\n cardArrow,\n cardGrid,\n cardHead,\n cardsBand,\n cardTitle,\n command,\n footerBand,\n footerRow,\n guide,\n guideCopy,\n heroBand,\n iconButton,\n kicker,\n navLink,\n sectionHead,\n sectionTitle,\n shell,\n step,\n tile,\n tones,\n topBarBand\n} from './theme.ts';\nimport { fonts, variables } from './tokens.ts';\nimport { container, fontAwesome, heading, image, link, paragraph, text, themeToggle } from '../../elements';\n\nimport type { Path } from './content.ts';\nimport type { ElementSpec, SpaceSpec } from '../../schema';\n\n/**\n * The space, declared: this file is the page, and it assembles the rest — the palette in `tokens.ts`, the classes in\n * `theme.ts`, what the page says in `content.ts`. Everything else — element ids, style selector names, the\n * back-references between them — is derived from what is written in them, so authoring it twice writes byte-identical\n * documents and there is no generated file to keep in step.\n *\n * It starts as the space Plitzi gives a new account, and it is yours: rename things, change the palette, delete the\n * guides. The paths and the guides are each one function mapped over one list, which is not a saving of keystrokes —\n * change `guideCard` and all six follow, add an entry to `GUIDES` and a seventh appears, styled like the rest.\n *\n * Name anything a test, a binding or an agent should be able to point at (`id: 'hero-title'`). An element with no\n * name gets a positional one, which moves the moment something is inserted above it.\n */\n\n// ── The cards ──────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst pathCard = (entry: (typeof PATHS)[number], index: number): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: card,\n children: [\n container({\n class: cardHead,\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n // The number is for the eye: read out, \"1\" before \"In the builder\" says nothing the order does not.\n container({ class: step, decorative: true, children: [text({ content: String(index + 1) })] }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n }),\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText }),\n ...(entry.command\n ? [\n container({\n class: command,\n children: [\n container({ decorative: true, css: { color: 'var(--muted)' }, children: [text({ content: '$' })] }),\n text({ content: entry.command })\n ]\n })\n ]\n : [])\n ]\n });\n\nconst guideCard = (entry: Path): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: [card, guide],\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n container({\n class: guideCopy,\n children: [\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText })\n ]\n }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n });\n\n/** A band's head: its kicker, its title, and a line saying what is in it. */\nconst sectionHeader = (id: string, kickerText: string, title: string, lede: string): ElementSpec =>\n container({\n class: sectionHead,\n children: [\n text({ content: kickerText, class: kicker }),\n heading({ id: `${id}-title`, content: title, subType: 'h2', class: sectionTitle }),\n paragraph({ content: lede, class: bodyText })\n ]\n });\n\n// ── The page ───────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst topBar = container({\n id: 'top-bar',\n subType: 'header',\n class: [shell, topBarBand],\n children: [\n link({\n id: 'brand',\n href: 'https://plitzi.com',\n mode: 'external',\n target: 'blank',\n class: navLink,\n children: [\n // The name beside it already says what the mark is: read out, it would say \"Plitzi\" twice.\n image({ src: 'https://cdn.plitzi.com/resources/img/favicon.svg', decorative: true, class: brandMark }),\n text({ content: 'Plitzi', css: { color: 'var(--foreground)', 'font-size': '16px', 'font-weight': '700' } })\n ]\n }),\n container({\n id: 'top-actions',\n subType: 'nav',\n label: 'Plitzi',\n css: { display: 'flex', 'align-items': 'center', gap: '8px' },\n children: [\n link({ id: 'top-docs', href: DOCS, mode: 'external', target: 'blank', class: navLink, content: 'Docs' }),\n themeToggle({ id: 'theme', class: iconButton })\n ]\n })\n ]\n});\n\nconst heroEyebrow = container({\n id: 'hero-eyebrow',\n css: {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n padding: '6px 12px',\n 'border-radius': '999px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n 'font-size': '13px',\n 'font-weight': '500'\n },\n children: [\n container({\n css: { width: '8px', height: '8px', 'border-radius': '999px', 'background-color': 'var(--tint-emerald)' }\n }),\n text({ content: 'Your new space', css: { color: 'var(--muted)' } })\n ]\n});\n\nconst heroTitle = heading({\n id: 'hero-title',\n content: 'Welcome to Plitzi',\n subType: 'h1',\n css: {\n desktop: {\n 'font-size': '64px',\n 'font-weight': '700',\n 'letter-spacing': '-0.03em',\n 'line-height': '1.05',\n 'text-align': 'center',\n margin: '0px'\n },\n tablet: { 'font-size': '48px' },\n mobile: { 'font-size': '38px' }\n }\n});\n\nconst heroLede = paragraph({\n id: 'hero-lede',\n content:\n 'This page is where your space starts, and it is already yours. Change any of it in the builder, in code, ' +\n 'or by asking an agent — below is how, and where to read more.',\n css: {\n desktop: {\n color: 'var(--muted)',\n 'font-size': '18px',\n 'line-height': '1.6',\n 'text-align': 'center',\n 'max-width': '600px',\n margin: '0px'\n },\n mobile: { 'font-size': '16px' }\n }\n});\n\nconst heroActions = container({\n id: 'hero-actions',\n css: {\n desktop: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n gap: '12px',\n 'margin-top': '8px'\n },\n mobile: { 'flex-direction': 'column', 'align-items': 'stretch', width: '100%' }\n },\n children: [\n link({\n id: 'cta-quickstart',\n href: `${DOCS}/quickstart`,\n mode: 'external',\n target: 'blank',\n class: button,\n variant: 'primary',\n content: 'Start the quickstart',\n icon: 'fas fa-arrow-right',\n iconPlacement: 'after'\n }),\n link({\n id: 'cta-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: button,\n content: 'Read the docs',\n icon: 'fas fa-book-open'\n })\n ]\n});\n\nexport const space: SpaceSpec = {\n name: 'New space',\n permanentUrl: 'new-space',\n mode: 'desktop-first',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n variables,\n fonts,\n /**\n * What text is, before any class touches it.\n *\n * Per element TYPE, so every heading and paragraph follows the palette without naming a colour — which is what\n * makes the dark scheme work: a hard-coded colour would win against the theme and leave black text on black.\n */\n elements: {\n // What every page is: the type, the scheme's colours, a whole screen tall.\n page: {\n base: {\n 'font-family': 'var(--font-sans)',\n 'flex-direction': 'column',\n position: 'relative',\n 'min-width': '100%',\n 'min-height': '100dvh',\n color: 'var(--foreground)',\n 'background-color': 'var(--background)'\n }\n },\n heading: { base: { color: 'var(--foreground)' } },\n text: { base: { color: 'inherit' } },\n paragraph: { base: { color: 'var(--foreground)' } },\n fontAwesome: { base: { color: 'inherit' } }\n },\n pages: [\n {\n id: 'home',\n name: 'Home',\n slug: '',\n isDefault: true,\n css: {\n // A glow over the top of the page, in the palette's primary, so it follows the scheme like everything else.\n 'background-image': 'radial-gradient(60rem 32rem at 50% -8rem, var(--glow), transparent 70%)',\n 'background-repeat': 'no-repeat'\n },\n body: [\n container({ id: 'backdrop', class: backdrop, decorative: true }),\n topBar,\n container({\n id: 'main',\n subType: 'main',\n css: { display: 'flex', 'flex-direction': 'column' },\n children: [\n container({\n id: 'hero',\n class: [shell, heroBand],\n children: [heroEyebrow, heroTitle, heroLede, heroActions]\n }),\n container({\n id: 'paths',\n subType: 'section',\n label: 'Make it yours',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'paths',\n 'Make it yours',\n 'Three ways in, one space',\n 'Start with whichever suits you — the others see every change it makes.'\n ),\n container({ id: 'path-cards', class: cardGrid, children: PATHS.map(pathCard) })\n ]\n }),\n container({\n id: 'guides',\n subType: 'section',\n label: 'Guides',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'guides',\n 'Guides',\n 'Learn the building blocks',\n 'Each one is a page of the docs, short enough to read before you change the page it explains.'\n ),\n container({ id: 'cards', class: cardGrid, children: GUIDES.map(guideCard) })\n ]\n })\n ]\n }),\n container({\n id: 'footer',\n subType: 'footer',\n class: [shell, footerBand],\n children: [\n container({\n class: footerRow,\n children: [\n text({ content: 'Made with Plitzi', css: { color: 'var(--muted)', 'font-size': '13px' } }),\n link({\n id: 'footer-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: navLink,\n content: 'plitzi.com/docs'\n })\n ]\n })\n ]\n })\n ]\n },\n notFound\n ]\n};\n";
24600
+ var spec_default$1 = "import { DOCS, GUIDES, PATHS } from './content.ts';\nimport { notFound } from './notFound.ts';\nimport {\n backdrop,\n bodyText,\n brandMark,\n button,\n card,\n cardArrow,\n cardGrid,\n cardHead,\n cardsBand,\n cardTitle,\n command,\n footerBand,\n footerRow,\n guide,\n guideCopy,\n heroBand,\n iconButton,\n kicker,\n navLink,\n sectionHead,\n sectionTitle,\n shell,\n step,\n tile,\n tones,\n topBarBand\n} from './theme.ts';\nimport { fonts, variables } from './tokens.ts';\nimport { container, fontAwesome, heading, image, link, paragraph, text, themeToggle } from '../../elements';\n\nimport type { Path } from './content.ts';\nimport type { ElementSpec, SpaceSpec } from '../../schema';\n\n/**\n * The space, declared: this file is the page, and it assembles the rest — the palette in `tokens.ts`, the classes in\n * `theme.ts`, what the page says in `content.ts`. Everything else — element ids, style selector names, the\n * back-references between them — is derived from what is written in them, so authoring it twice writes byte-identical\n * documents and there is no generated file to keep in step.\n *\n * It starts as the space Plitzi gives a new account, and it is yours: rename things, change the palette, delete the\n * guides. The paths and the guides are each one function mapped over one list, which is not a saving of keystrokes —\n * change `guideCard` and all six follow, add an entry to `GUIDES` and a seventh appears, styled like the rest.\n *\n * Name anything a test, a binding or an agent should be able to point at (`id: 'hero-title'`). An element with no\n * name gets a positional one, which moves the moment something is inserted above it.\n */\n\n// ── The cards ──────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst pathCard = (entry: (typeof PATHS)[number], index: number): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: card,\n children: [\n container({\n class: cardHead,\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n // The number is for the eye: read out, \"1\" before \"In the builder\" says nothing the order does not.\n container({ class: step, decorative: true, children: [text({ content: String(index + 1) })] }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n }),\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText }),\n ...(entry.command\n ? [\n container({\n class: command,\n children: [\n container({ decorative: true, css: { color: 'var(--muted)' }, children: [text({ content: '$' })] }),\n text({ content: entry.command })\n ]\n })\n ]\n : [])\n ]\n });\n\nconst guideCard = (entry: Path): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: [card, guide],\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n container({\n class: guideCopy,\n children: [\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText })\n ]\n }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n });\n\n/** A band's head: its kicker, its title, and a line saying what is in it. */\nconst sectionHeader = (id: string, kickerText: string, title: string, lede: string): ElementSpec =>\n container({\n class: sectionHead,\n children: [\n text({ content: kickerText, class: kicker }),\n heading({ id: `${id}-title`, content: title, subType: 'h2', class: sectionTitle }),\n paragraph({ content: lede, class: bodyText })\n ]\n });\n\n// ── The page ───────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst topBar = container({\n id: 'top-bar',\n subType: 'header',\n class: [shell, topBarBand],\n children: [\n link({\n id: 'brand',\n href: 'https://plitzi.com',\n mode: 'external',\n target: 'blank',\n class: navLink,\n children: [\n // The name beside it already says what the mark is: read out, it would say \"Plitzi\" twice.\n image({ src: 'https://cdn.plitzi.com/resources/img/favicon.svg', decorative: true, class: brandMark }),\n text({ content: 'Plitzi', css: { color: 'var(--foreground)', 'font-size': '16px', 'font-weight': '700' } })\n ]\n }),\n container({\n id: 'top-actions',\n subType: 'nav',\n label: 'Plitzi',\n css: { display: 'flex', 'align-items': 'center', gap: '8px' },\n children: [\n link({ id: 'top-docs', href: DOCS, mode: 'external', target: 'blank', class: navLink, content: 'Docs' }),\n themeToggle({ id: 'theme', class: iconButton })\n ]\n })\n ]\n});\n\nconst heroEyebrow = container({\n id: 'hero-eyebrow',\n css: {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n padding: '6px 12px',\n 'border-radius': '999px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n 'font-size': '13px',\n 'font-weight': '500'\n },\n children: [\n container({\n css: { width: '8px', height: '8px', 'border-radius': '999px', 'background-color': 'var(--tint-emerald)' }\n }),\n text({ content: 'Your new space', css: { color: 'var(--muted)' } })\n ]\n});\n\nconst heroTitle = heading({\n id: 'hero-title',\n content: 'Welcome to Plitzi',\n subType: 'h1',\n css: {\n desktop: {\n 'font-size': '64px',\n 'font-weight': '700',\n 'letter-spacing': '-0.03em',\n 'line-height': '1.05',\n 'text-align': 'center',\n margin: '0px'\n },\n tablet: { 'font-size': '48px' },\n mobile: { 'font-size': '38px' }\n }\n});\n\nconst heroLede = paragraph({\n id: 'hero-lede',\n content:\n 'This page is where your space starts, and it is already yours. Change any of it in the builder, in code, ' +\n 'or by asking an agent — below is how, and where to read more.',\n css: {\n desktop: {\n color: 'var(--muted)',\n 'font-size': '18px',\n 'line-height': '1.6',\n 'text-align': 'center',\n 'max-width': '600px',\n margin: '0px'\n },\n mobile: { 'font-size': '16px' }\n }\n});\n\nconst heroActions = container({\n id: 'hero-actions',\n css: {\n desktop: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n gap: '12px',\n 'margin-top': '8px'\n },\n mobile: { 'flex-direction': 'column', 'align-items': 'stretch', width: '100%' }\n },\n children: [\n link({\n id: 'cta-quickstart',\n href: `${DOCS}/quickstart`,\n mode: 'external',\n target: 'blank',\n class: button,\n variant: 'primary',\n content: 'Start the quickstart',\n icon: 'fas fa-arrow-right',\n iconPlacement: 'after'\n }),\n link({\n id: 'cta-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: button,\n content: 'Read the docs',\n icon: 'fas fa-book-open'\n })\n ]\n});\n\nexport const space: SpaceSpec = {\n name: 'New space',\n permanentUrl: 'new-space',\n mode: 'desktop-first',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n variables,\n fonts,\n /**\n * What text is, before any class touches it: the page's type and colours, which every element inherits — headings,\n * paragraphs, icons and the words inside a link alike. Named once, on the page, so the dark scheme works: a colour\n * hard-coded on an element would win against the theme and leave black text on black.\n */\n elements: {\n // What every page is: the type, the scheme's colours, a whole screen tall.\n page: {\n base: {\n 'font-family': 'var(--font-sans)',\n 'flex-direction': 'column',\n position: 'relative',\n 'min-width': '100%',\n 'min-height': '100dvh',\n color: 'var(--foreground)',\n 'background-color': 'var(--background)'\n }\n }\n },\n pages: [\n {\n id: 'home',\n name: 'Home',\n slug: '',\n isDefault: true,\n css: {\n // A glow over the top of the page, in the palette's primary, so it follows the scheme like everything else.\n 'background-image': 'radial-gradient(60rem 32rem at 50% -8rem, var(--glow), transparent 70%)',\n 'background-repeat': 'no-repeat'\n },\n body: [\n container({ id: 'backdrop', class: backdrop, decorative: true }),\n topBar,\n container({\n id: 'main',\n subType: 'main',\n css: { display: 'flex', 'flex-direction': 'column' },\n children: [\n container({\n id: 'hero',\n class: [shell, heroBand],\n children: [heroEyebrow, heroTitle, heroLede, heroActions]\n }),\n container({\n id: 'paths',\n subType: 'section',\n label: 'Make it yours',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'paths',\n 'Make it yours',\n 'Three ways in, one space',\n 'Start with whichever suits you — the others see every change it makes.'\n ),\n container({ id: 'path-cards', class: cardGrid, children: PATHS.map(pathCard) })\n ]\n }),\n container({\n id: 'guides',\n subType: 'section',\n label: 'Guides',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'guides',\n 'Guides',\n 'Learn the building blocks',\n 'Each one is a page of the docs, short enough to read before you change the page it explains.'\n ),\n container({ id: 'cards', class: cardGrid, children: GUIDES.map(guideCard) })\n ]\n })\n ]\n }),\n container({\n id: 'footer',\n subType: 'footer',\n class: [shell, footerBand],\n children: [\n container({\n class: footerRow,\n children: [\n text({ content: 'Made with Plitzi', css: { color: 'var(--muted)', 'font-size': '13px' } }),\n link({\n id: 'footer-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: navLink,\n content: 'plitzi.com/docs'\n })\n ]\n })\n ]\n })\n ]\n },\n notFound\n ]\n};\n";
25314
24601
  //#endregion
25315
24602
  //#region src/spaces/blank/theme.ts?raw
25316
24603
  var theme_default = "import { styles } from '../../style';\n\n/**\n * The classes the page wears, declared once and named by the elements that wear them — so re-theming a card re-themes\n * every card. Every colour in them is a `var(--…)` of the palette in `tokens.ts`.\n */\n\n/** The same outline on everything that can be focused from the keyboard. */\nconst focusRing = { outline: '2px solid var(--primary)', 'outline-offset': '3px' };\n\n// A band wears `shell` for its sides and a class of its own for its top and bottom, so both write their sides apart: a\n// `padding` shorthand in either would reset the other's. A class that owns its whole box writes the shorthand.\nexport const shell = styles('shell', {\n css: {\n desktop: {\n display: 'flex',\n 'flex-direction': 'column',\n width: '100%',\n 'max-width': '1120px',\n 'margin-left': 'auto',\n 'margin-right': 'auto',\n 'padding-left': '32px',\n 'padding-right': '32px',\n position: 'relative',\n 'z-index': '1'\n },\n tablet: { 'padding-left': '24px', 'padding-right': '24px' },\n mobile: { 'padding-left': '20px', 'padding-right': '20px' }\n }\n});\n\n/**\n * The grid behind the top of the page, fading into the background as it goes down.\n *\n * Gradients rather than an image: it scales to any screen, costs no request, and follows the theme — the line colour\n * and the fade are variables, so it is faint on light and faint on dark without a second asset. The fade is the first\n * layer, drawn over the lines, so the grid ends softly instead of at an edge.\n */\nexport const backdrop = styles('backdrop', {\n css: {\n desktop: {\n position: 'absolute',\n top: '0px',\n left: '0px',\n right: '0px',\n height: '760px',\n 'pointer-events': 'none',\n 'background-image':\n 'linear-gradient(180deg, transparent 0%, var(--background) 100%), linear-gradient(0deg, var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px)',\n 'background-size': '100% 100%, 48px 48px, 48px 48px',\n 'background-position': '0% 0%, 50% 0%, 50% 0%',\n 'background-repeat': 'no-repeat, repeat, repeat'\n },\n mobile: { height: '560px' }\n }\n});\n\nexport const navLink = styles('nav-link', {\n css: {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n color: 'var(--muted)',\n 'font-size': '14px',\n 'font-weight': '500',\n 'text-decoration': 'none',\n 'border-radius': '8px',\n padding: '6px 10px'\n },\n states: { hover: { color: 'var(--foreground)' }, 'focus-visible': focusRing }\n});\n\n/** The mark beside the name, at the size the bar wants. */\nexport const brandMark = styles('brand-mark', { width: '24px', height: '24px' });\n\n/** The theme switch, dressed like the rest of the bar. It starts as a bare control, centred and in the bar's type. */\nexport const iconButton = styles('icon-button', {\n css: {\n display: 'flex',\n 'justify-content': 'center',\n width: '36px',\n height: '36px',\n 'border-radius': '8px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n color: 'var(--muted)',\n 'font-size': '16px'\n },\n states: { hover: { color: 'var(--foreground)' }, 'focus-visible': focusRing }\n});\n\n/** A call to action. The base is the quiet one; `primary` is the one the eye should land on. */\nexport const button = styles('button', {\n css: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n gap: '8px',\n height: '44px',\n padding: '0px 20px',\n 'border-radius': '10px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n color: 'var(--foreground)',\n 'font-size': '15px',\n 'font-weight': '600',\n 'text-decoration': 'none',\n 'transition-property': 'background-color, border-color, transform',\n 'transition-duration': '150ms',\n 'transition-timing-function': 'ease-out'\n },\n states: {\n hover: { 'border-color': 'var(--muted)' },\n 'focus-visible': focusRing\n },\n variants: {\n primary: {\n css: {\n 'background-color': 'var(--primary)',\n 'border-color': 'var(--primary)',\n color: 'var(--primary-foreground)',\n 'box-shadow': 'var(--shadow-md)'\n },\n states: { hover: { 'background-color': 'var(--primary-hover)', 'border-color': 'var(--primary-hover)' } }\n }\n }\n});\n\n/** A section's small label over its title: what the band is about, in the palette's primary. */\nexport const kicker = styles('kicker', {\n color: 'var(--primary)',\n 'font-size': '13px',\n 'font-weight': '600',\n 'letter-spacing': '0.04em',\n 'text-transform': 'uppercase',\n margin: '0px'\n});\n\nexport const sectionTitle = styles('section-title', {\n css: {\n desktop: {\n 'font-size': '32px',\n 'font-weight': '700',\n 'letter-spacing': '-0.02em',\n 'line-height': '1.15',\n margin: '0px'\n },\n mobile: { 'font-size': '26px' }\n }\n});\n\nexport const sectionHead = styles('section-head', {\n display: 'flex',\n 'flex-direction': 'column',\n gap: '8px',\n 'margin-bottom': '8px'\n});\n\n/** Copy under a title or in a card: the palette's quiet colour, at a size made for reading. */\nexport const bodyText = styles('body-text', {\n color: 'var(--muted)',\n 'font-size': '15px',\n 'line-height': '1.6',\n margin: '0px'\n});\n\n/** A card of either band: the whole card is the link, so the target is as large as what it describes. */\nexport const card = styles('card', {\n css: {\n display: 'flex',\n 'flex-direction': 'column',\n gap: '12px',\n padding: '24px',\n 'border-radius': '16px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n 'box-shadow': 'var(--shadow-sm)',\n 'text-decoration': 'none',\n 'transition-property': 'transform, border-color, box-shadow',\n 'transition-duration': '200ms',\n 'transition-timing-function': 'ease-out'\n },\n states: {\n hover: { transform: 'translateY(-3px)', 'border-color': 'var(--primary)', 'box-shadow': 'var(--shadow-lg)' },\n 'focus-visible': focusRing\n }\n});\n\nexport const cardHead = styles('card-head', { display: 'flex', 'align-items': 'center', gap: '10px' });\n\nexport const cardTitle = styles('card-title', {\n color: 'var(--foreground)',\n 'font-size': '17px',\n 'font-weight': '600',\n margin: '0px'\n});\n\n/** The arrow slides while the card around it is hovered. */\nexport const cardArrow = styles('card-arrow', {\n css: {\n color: 'var(--muted)',\n 'font-size': '13px',\n 'margin-left': 'auto',\n 'transition-property': 'transform, color',\n 'transition-duration': '200ms',\n 'transition-timing-function': 'ease-out'\n },\n ancestors: {\n [card.name]: { states: { hover: { transform: 'translateX(4px)', color: 'var(--primary)' } } }\n }\n});\n\n/** The square an icon sits in. Its colour is a tone, worn beside it: `class: [tile, tones.violet]`. */\nexport const tile = styles('tile', {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n width: '40px',\n height: '40px',\n 'flex-shrink': '0',\n 'border-radius': '10px',\n 'font-size': '16px'\n});\n\n/** One class per tone, each a pair of palette variables — so a tone is dark-ready the moment it is declared. */\nexport const tones = {\n violet: styles('tone-violet', { color: 'var(--tint-violet)', 'background-color': 'var(--tint-violet-bg)' }),\n cyan: styles('tone-cyan', { color: 'var(--tint-cyan)', 'background-color': 'var(--tint-cyan-bg)' }),\n amber: styles('tone-amber', { color: 'var(--tint-amber)', 'background-color': 'var(--tint-amber-bg)' }),\n emerald: styles('tone-emerald', { color: 'var(--tint-emerald)', 'background-color': 'var(--tint-emerald-bg)' }),\n rose: styles('tone-rose', { color: 'var(--tint-rose)', 'background-color': 'var(--tint-rose-bg)' }),\n blue: styles('tone-blue', { color: 'var(--tint-blue)', 'background-color': 'var(--tint-blue-bg)' })\n};\n\n/** A path's number, in a circle: the order the three are worth reading in, not an order they must be taken in. */\nexport const step = styles('step', {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n width: '28px',\n height: '28px',\n 'flex-shrink': '0',\n 'border-radius': '999px',\n border: '1px solid var(--border)',\n color: 'var(--muted)',\n 'font-size': '13px',\n 'font-weight': '600'\n});\n\n/** What a path does, as it would be typed — the one place the page shows code. */\nexport const command = styles('command', {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n 'margin-top': 'auto',\n padding: '10px 12px',\n 'border-radius': '10px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--code-bg)',\n color: 'var(--foreground)',\n 'font-family': 'var(--font-mono)',\n 'font-size': '13px',\n 'white-space': 'nowrap',\n overflow: 'hidden'\n});\n\n/** A guide is smaller than a path: one line under its title, its icon beside it rather than above. */\nexport const guide = styles('guide', {\n 'flex-direction': 'row',\n 'align-items': 'flex-start',\n gap: '16px',\n padding: '20px'\n});\n\nexport const guideCopy = styles('guide-copy', {\n display: 'flex',\n 'flex-direction': 'column',\n gap: '4px',\n 'min-width': '0px'\n});\n\n/** Each band of the page wears `shell` for its width, and one of these for what is its own. */\nexport const topBarBand = styles('top-bar', {\n 'flex-direction': 'row',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n 'padding-top': '20px',\n 'padding-bottom': '20px'\n});\n\nexport const heroBand = styles('hero', {\n css: {\n desktop: { 'align-items': 'center', gap: '24px', 'padding-top': '88px', 'padding-bottom': '88px' },\n tablet: { 'padding-top': '64px', 'padding-bottom': '64px' },\n mobile: { 'padding-top': '40px', 'padding-bottom': '48px' }\n }\n});\n\n/** The two bands of cards: the paths first, the guides after, each under its own head. */\nexport const cardsBand = styles('cards-band', { gap: '20px', 'padding-bottom': '80px' });\n\n/** Three columns that become two and then one, so a card is never narrower than its words. */\nexport const cardGrid = styles('card-grid', {\n css: {\n desktop: { display: 'grid', 'grid-template-columns': 'repeat(3, minmax(0, 1fr))', gap: '16px' },\n tablet: { 'grid-template-columns': 'repeat(2, minmax(0, 1fr))' },\n mobile: { 'grid-template-columns': 'minmax(0, 1fr)' }\n }\n});\n\n/** The footer's line spans the content, not the band's padding: it belongs to what it closes. */\nexport const footerBand = styles('footer', {\n css: {\n desktop: { 'margin-top': 'auto', 'padding-bottom': '32px' },\n mobile: { 'padding-bottom': '24px' }\n }\n});\n\nexport const footerRow = styles('footer-row', {\n css: {\n desktop: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n gap: '16px',\n 'padding-top': '24px',\n 'border-top': '1px solid var(--border)'\n },\n mobile: { 'flex-direction': 'column', gap: '8px' }\n }\n});\n\n/** A tone by its name: what a card of `content.ts` says it is painted in. */\nexport type Tone = keyof typeof tones;\n";
@@ -25501,7 +24788,7 @@ var toSource = (value) => {
25501
24788
  */
25502
24789
  var blankTemplateFiles = ({ name, dir = "src/space", plugin } = {}) => {
25503
24790
  const plugins = plugin === void 0 ? [] : Array.isArray(plugin) ? plugin : [plugin];
25504
- const entry = toPortableSource(plugins.length > 0 ? withPluginHost(spec_default$1, plugins) : spec_default$1);
24791
+ const entry = plugins.length > 0 ? withPluginDeclarations(toPortableSource(withPluginHost(spec_default$1, plugins)), plugins) : toPortableSource(spec_default$1);
25505
24792
  return {
25506
24793
  [`${dir}/index.ts`]: name === void 0 ? entry : renameSpace(entry, name),
25507
24794
  [`${dir}/tokens.ts`]: toPortableSource(tokens_default$1),
@@ -25522,15 +24809,13 @@ var emptyTemplateFiles = ({ name, dir = "src/space" } = {}) => {
25522
24809
  [`${dir}/notFound.ts`]: toPortableSource(notFound_default$1)
25523
24810
  };
25524
24811
  };
25525
- /** The one line in the declaration a `custom` element is hung off — the hero, so it lands under its buttons. */
24812
+ /** The one line in the declaration a plugin's element is hung off — the hero, so it lands under its buttons. */
25526
24813
  var PLUGIN_ANCHOR = "children: [heroEyebrow, heroTitle, heroLede, heroActions]";
25527
- /** One plugin's host — a `custom(…)` or an `element(…)` call, inside its provider when it has one — at `pad`. */
24814
+ /** One plugin's element — a call of the factory its declaration makes, inside its provider when it has one — at `pad`. */
25528
24815
  var hostSource = (plugin, pad) => {
25529
- const asElement = plugin.as === "element";
25530
24816
  const host = (inner) => [
25531
- asElement ? `element('${plugin.renderType}', {` : "custom({",
24817
+ `${plugin.type}({`,
25532
24818
  ` id: '${plugin.id}',`,
25533
- ...asElement ? [] : [` renderType: '${plugin.renderType}',`],
25534
24819
  ...Object.entries(plugin.attributes).map(([key, value]) => ` ${key}: ${toSource(value)},`),
25535
24820
  ...plugin.data ? [` bind: ${toSource(plugin.data.bind)},`] : [],
25536
24821
  " css: { desktop: { 'margin-top': '24px' } }",
@@ -25551,31 +24836,26 @@ var hostSource = (plugin, pad) => {
25551
24836
  * The copy, with a slot for a component the receiver writes.
25552
24837
  *
25553
24838
  * Done to the source rather than to the spec because the spec is not what travels: the copy is a FILE, and what
25554
- * has to end up in it is a `custom(…)` call somebody can read, move and change. The import is prepended as a line
25555
- * of its own rather than merged into the existing one — `toPortableSource` folds every relative import into a
25556
- * single sorted statement afterwards, so this needs to know nothing about what the declaration already imports.
24839
+ * has to end up in it is a call somebody can read, move and change. The import is prepended as a line of its own
24840
+ * rather than merged into the existing one — `toPortableSource` folds every relative import into a single sorted
24841
+ * statement afterwards, so this needs to know nothing about what the declaration already imports. The plugin's own
24842
+ * declaration is not one of this package's modules: `withPluginDeclarations` adds it once the copy is portable.
25557
24843
  *
25558
24844
  * The anchor is a whole authored line, and a miss throws. It is the same bargain as the rename: a source
25559
24845
  * transform that silently does nothing hands back a plausible file with the interesting half missing.
25560
24846
  */
25561
24847
  var withPluginHost = (source, plugins) => {
25562
24848
  if (!source.includes(PLUGIN_ANCHOR)) throw new Error("blankTemplateFiles: cannot host a plugin — the hero's children are not where they were. Update PLUGIN_ANCHOR in src/spaces/index.ts to match the declaration.");
25563
- const asElement = plugins.every((plugin) => plugin.as === "element");
25564
24849
  const fed = plugins.flatMap((plugin) => plugin.data ? [plugin.data.query] : []);
25565
24850
  const indent = /^\s*/.exec(source.split("\n").find((line) => line.includes(PLUGIN_ANCHOR)) ?? "")?.[0] ?? "";
25566
24851
  const pad = `${indent} `;
25567
24852
  const comment = [
25568
24853
  `${plugins.length === 1 ? "A component" : "Components"} of YOUR OWN, rendered by the space.`,
25569
24854
  "",
25570
- ...asElement ? [
25571
- "An element of a plugin's own type — what the builder adds when somebody drops the plugin on a page, and",
25572
- "how a space that loads it from its manifest hosts it. Every attribute arrives in the component as a prop",
25573
- "of the same name — written here, or bound to a source."
25574
- ] : [
25575
- "`renderType` is the name it is registered under in `src/main.ts`; every other attribute arrives in",
25576
- "the component as a prop of the same name — written here, or bound to a source. See",
25577
- "`plitzi/README.md`."
25578
- ],
24855
+ "An element of the plugin's own type, authored from its declaration — what the",
24856
+ "builder adds when somebody drops the plugin on a page. Every attribute arrives in",
24857
+ "the component as a prop of the same name — written here, or bound to a source —",
24858
+ "and is typed by what the declaration says it reads.",
25579
24859
  ...fed.length > 0 ? [
25580
24860
  "",
25581
24861
  `Its numbers come from \`public${fed.join("`, `public")}\`, read by the provider around it like any API: data a`,
@@ -25596,11 +24876,45 @@ var withPluginHost = (source, plugins) => {
25596
24876
  `${pad}${plugins.map((plugin) => hostSource(plugin, pad)).join(`,\n${pad}`)}`,
25597
24877
  `${indent}]`
25598
24878
  ].join("\n");
25599
- return `import { ${[
25600
- ...fed.length > 0 ? ["apiContainer"] : [],
25601
- ...plugins.some((plugin) => plugin.as !== "element") ? ["custom"] : [],
25602
- ...plugins.some((plugin) => plugin.as === "element") ? ["element"] : []
25603
- ].join(", ")} } from '../../elements';\n${source.replace(PLUGIN_ANCHOR, element)}`;
24879
+ return `import { ${[...fed.length > 0 ? ["apiContainer"] : [], "defineElement"].join(", ")} } from '../../elements';\n${source.replace(PLUGIN_ANCHOR, element)}`;
24880
+ };
24881
+ /**
24882
+ * The portable copy, given each plugin's declaration and the factory made from it.
24883
+ *
24884
+ * After `toPortableSource`, not before: the declaration is the receiver's module, not this package's, and the rewrite
24885
+ * refuses — rightly — any other import that climbs out of the folder. Its import goes beside the package's, its
24886
+ * attributes type first among the types, and the factory right under the imports, where the hero calls it.
24887
+ */
24888
+ var withPluginDeclarations = (source, plugins) => {
24889
+ const lines = source.split("\n");
24890
+ const { statements, end } = leadingImports(lines);
24891
+ const values = plugins.map(({ type, declaration }) => `import ${type}Declaration from '${declaration.from}';`);
24892
+ const types = plugins.flatMap(({ declaration }) => declaration.attributes ? [`import type { ${declaration.attributes} } from '${declaration.from}';`] : []);
24893
+ const isType = (text) => text.startsWith("import type ");
24894
+ const isPackage = (text) => !isType(text) && text.endsWith("from '@plitzi/sdk-authoring';");
24895
+ const written = lines.slice(0, end).join("\n");
24896
+ const header = [];
24897
+ let typed = false;
24898
+ for (const [index, statement] of statements.entries()) {
24899
+ if (isType(statement.text) && !typed) {
24900
+ header.push(...types);
24901
+ typed = true;
24902
+ }
24903
+ header.push(statement.written, ...isPackage(statement.text) ? values : []);
24904
+ const next = statements.at(index + 1);
24905
+ if (next && written.includes(`${statement.written}\n\n${next.written}`)) header.push("");
24906
+ }
24907
+ const factories = plugins.map(({ type, declaration }) => `const ${type} = defineElement${declaration.attributes ? `<${declaration.attributes}>` : ""}(${type}Declaration);`);
24908
+ const comment = `/** ${plugins.length === 1 ? "The plugin's element, typed by its declaration" : "The plugins' elements, typed by their declarations"}. */`;
24909
+ const trailingTypes = typed || types.length === 0 ? [] : ["", ...types];
24910
+ return [
24911
+ ...header,
24912
+ ...trailingTypes,
24913
+ "",
24914
+ comment,
24915
+ ...factories,
24916
+ ...lines.slice(end)
24917
+ ].join("\n");
25604
24918
  };
25605
24919
  /** Replaces one declared literal, and refuses to hand back a copy where it silently did not appear. */
25606
24920
  var replaceLiteral = (source, field, from, to) => {
@@ -27264,4 +26578,4 @@ var validateSnippet = (snippet, options = {}) => validateSnippet$1(snippet, {
27264
26578
  ...options
27265
26579
  });
27266
26580
  //#endregion
27267
- export { GLOBAL_CALLBACK_BUILDERS as $, closest as $i, removeState as $n, carouselTrack as $r, css as $t, unrollPage as A, component as Ai, named$2 as An, onPageLoad as Ar, d$2 as At, blankSpace as B, authorBinding as Bi, appendState as Bn, scrollIntoView as Br, grid as Bt, pageTexts as C, o$24 as Ca, tabContainer as Ci, flagGateOf as Cn, onClick as Cr, unusedDeclarations as Ct, pageRegions as D, r$35 as Da, text$1 as Di, authorFlow as Dn, onInterval as Dr, pageFamily as Dt, diffPictures as E, n$45 as Ea, tabContainerItem as Ei, defineAction as En, onFlowProgress as Er, familyOf as Et, readDevTools as F, inferredLinkMode as Fi, BUILTIN_UTILITIES as Fn, openModal as Fr, t$6 as Ft, space as G, resolveSource as Gi, clearState as Gn, elementsFromManifest as Gr, isClassModifier as Gt, catalogTemplateFiles as H, groupBindings as Hi, authLogout as Hn, setFieldValue as Hr, className as Ht, readDevToolsInPage as I, COMPONENT_SOURCES as Ii, applyUtility as In, publishOn as Ir, tokens as It, importSlug as J, visibleWhen as Ji, delay as Jn, apiContainer as Jr, modifierClassName as Jt, space$1 as K, toBindingSpecs as Ki, copyToClipboard as Kn, withPluginCatalogs as Kr, isClassRef as Kt, dataIssues as L, GLOBAL_SOURCES as Li, getUtility as Ln, reloadApi as Lr, createTw as Lt, inspectPage as M, defaultLabel as Mi, whenFailed as Mn, onScroll as Mr, FIXABLE_CODES as Mt, onScreen as N, defineElement as Ni, whenSucceeded as Nn, onSubmit as Nr, n$6 as Nt, profilePictures as O, s$23 as Oa, themeToggle as Oi, authorFlows as On, onKey as Or, notificationsCss as Ot, failedFlowText as P, element as Pi, whileRunning as Pn, openDialog as Pr, r$4 as Pt, EXPLAIN_KINDS as Q, twig as Qi, navigate as Qn, carousel as Qr, STYLE_STATES as Qt, answerAction as R, activeOn as Ri, SET_STATE_TYPES as Rn, resetForm as Rr, tw as Rt, compareTexts as S, i$27 as Sa, svg as Si, selectorFor as Sn, on as Sr, suggestClassOverrides as St, comparePictures as T, c$19 as Ta, tabContainerHeader as Ti, authoringCodesTable as Tn, onFlowError as Tr, refusalOf as Tt, emptyTemplateFiles as U, hasVisibilityBinding as Ui, authRefreshDetails as Un, toggleElement as Ur, classNames as Ut, blankTemplateFiles as V, bindTemplate as Vi, authLogin as Vn, scrollTo as Vr, row as Vt, toPortableSource as W, hiddenWhen as Wi, cancelServerAction as Wn, updateElement as Wr, classRefs as Wt, importProbe as X, actionSource as Xi, invalidateQueries as Xn, blockJsx as Xr, styles as Xt, importedFiles as Y, withVisibility as Yi, hostAction as Yn, blockHtml as Yr, splitClassList as Yt, BUILDER_NAMES as Z, source as Zi, moveState as Zn, button$1 as Zr, BREAKPOINTS$1 as Zt, shortcutKey as _, typeTriggerDefinitions as _a, nodeHtml as _i, slugify as _n, carouselPrevious as _r, assertSnippetValid as _t, locateClasses as a, elementAncestorTypes as aa, dropdownPopup as ai, expandShorthand as an, twigTemplate as ar, SPACE_FIELDS as at, summariseRenders as b, elementAttributeNames as ba, reference as bi, locate as bn, declaredCallback as br, suggestSpace as bt, validateSnippet as c, elementCatalog as ca, form as ci, shorthandLonghands as cn, applyBuiltinCallback as cr, specFromSpace as ct, i as d, elementPartTypes as da, image as di, cssPropertyName as dn, announceOn as dr, actionToSource as dt, scope as ea, channel as ei, isRuleSetSpec as en, runServerAction as er, explain as et, o as f, elementSlots as fa, link as fi, isCssProperty as fn, cancelApi as fr, withNamedIds as ft, pressShortcut as g, typeCallbackDefinitions as ga, modalContainer as gi, digest as gn, carouselPlay as gr, transformerCatalog as gt, withElement as h, elementTypeNames as ha, markdown as hi, e$9 as hn, carouselPause as hr, suggestTransformer as ht, lintSpace as i, isSuggestionCode as ia, dropdown as ii, cssShorthands as in, toggleState as ir, ELEMENT_FIELDS as it, inspectDocument as j, defaultAttributes as ji, when as jn, onPointerDown as jr, i$2 as jt, loadImages as k, t$62 as ka, video as ki, flowStepIds as kn, onLoad as kr, withNotificationsCss as kt, validateSpace as l, elementDefaultAttributes as la, formControl as li, cssNumberValue as ln, getGlobalCallback as lr, compareSpaces as lt, singlePageSpace as m, elementTriggers as ma, listItem as mi, suggestCssProperty as mn, carouselNext as mr, getTransformer as mt, authorSpace as n, AuthoringError as na, custom$1 as ni, toBlocks as nn, stepState as nr, explainList as nt, locateElements as o, elementAttributeValues as oa, embed as oi, expandShorthandPatch as on, webHook as or, specToSource as ot, compactSvg as p, elementSourceTypes as pa, list$1 as pi, isCustomProperty as pn, carouselGoTo as pr, BUILTIN_TRANSFORMERS as pt, darkScheme as q, variantFrom as qi, cycleState as qn, e$33 as qr, isStyleDeclaration as qt, fixSpace as r, authoringCodeEntry as ra, dialogContainer as ri, toResponsive as rn, toggleInState as rr, explanationText as rt, planFixes as s, elementCallbacks as sa, fontAwesome as si, expandShorthandTraced as sn, BUILTIN_GLOBAL_CALLBACKS as sr, SCHEMA_SETTINGS as st, authorSnippet as t, AUTHORING_CODES as ta, container as ti, sameBlocks as tn, setState as tr, explainKindOf as tt, a as u, elementLeafTypes as ua, heading as ui, cssProperties as un, e$16 as ur, actionSpecFromEntry as ut, openPage as v, e$40 as va, pagination as vi, buildHandles as vn, closeDialog as vr, PAGE_SPEC_FIELDS as vt, alignPictures as w, s$21 as wa, tabContainerBody as wi, flagSpecOf as wn, onFlowEnd as wr, SpaceRefusedError as wt, PAGE_TEXT_LIMIT as x, a$22 as xa, richText as xi, pathForSlug as xn, declaredTrigger as xr, withoutQuieted as xt, inspectRenders as y, t$60 as ya, paragraph as yi, instanceSelectorFor as yn, closeModal as yr, assertSpaceValid as yt, CATALOG_TEMPLATE_IDENTITY as z, activeWhen as zi, addNotification as zn, scrollBy as zr, column as zt };
26581
+ export { GLOBAL_CALLBACK_BUILDERS as $, source as $i, twigTemplate as $n, button$1 as $r, css as $t, unrollPage as A, themeToggle as Ai, getUtility as An, onKey as Ar, d$2 as At, blankSpace as B, activeOn as Bi, cycleState as Bn, resetForm as Br, grid as Bt, pageTexts as C, o$24 as Ca, richText as Ci, flagGateOf as Cn, declaredTrigger as Cr, unusedDeclarations as Ct, pageRegions as D, r$35 as Da, tabContainerHeader as Di, taskAction as Dn, onFlowError as Dr, pageFamily as Dt, diffPictures as E, n$45 as Ea, tabContainerBody as Ei, defineAction as En, onFlowEnd as Er, familyOf as Et, readDevTools as F, defineElement as Fi, authLogout as Fn, onSubmit as Fr, t$6 as Ft, space as G, hasVisibilityBinding as Gi, navigate as Gn, toggleElement as Gr, isClassModifier as Gt, catalogTemplateFiles as H, authorBinding as Hi, hostAction as Hn, scrollIntoView as Hr, className as Ht, readDevToolsInPage as I, element as Ii, authRefreshDetails as In, openDialog as Ir, tokens as It, importSlug as J, toBindingSpecs as Ji, runServerActionOrNotify as Jn, withPluginCatalogs as Jr, modifierClassName as Jt, space$1 as K, hiddenWhen as Ki, removeState as Kn, updateElement as Kr, isClassRef as Kt, dataIssues as L, inferredLinkMode as Li, cancelServerAction as Ln, openModal as Lr, createTw as Lt, inspectPage as M, component as Mi, addNotification as Mn, onPageLoad as Mr, FIXABLE_CODES as Mt, onScreen as N, defaultAttributes as Ni, appendState as Nn, onPointerDown as Nr, n$6 as Nt, profilePictures as O, s$23 as Oa, tabContainerItem as Oi, BUILTIN_UTILITIES as On, onFlowProgress as Or, notificationsCss as Ot, failedFlowText as P, defaultLabel as Pi, authLogin as Pn, onScroll as Pr, r$4 as Pt, EXPLAIN_KINDS as Q, actionSource as Qi, toggleState as Qn, blockJsx as Qr, STYLE_STATES as Qt, answerAction as R, COMPONENT_SOURCES as Ri, clearState as Rn, publishOn as Rr, tw as Rt, compareTexts as S, i$27 as Sa, reference as Si, selectorFor as Sn, declaredCallback as Sr, suggestClassOverrides as St, comparePictures as T, c$19 as Ta, tabContainer as Ti, authoringCodesTable as Tn, onClick as Tr, refusalOf as Tt, emptyTemplateFiles as U, bindTemplate as Ui, invalidateQueries as Un, scrollTo as Ur, classNames as Ut, blankTemplateFiles as V, activeWhen as Vi, delay as Vn, scrollBy as Vr, row as Vt, toPortableSource as W, groupBindings as Wi, moveState as Wn, setFieldValue as Wr, classRefs as Wt, importProbe as X, visibleWhen as Xi, stepState as Xn, apiContainer as Xr, styles as Xt, importedFiles as Y, variantFrom as Yi, setState as Yn, e$33 as Yr, splitClassList as Yt, BUILDER_NAMES as Z, withVisibility as Zi, toggleInState as Zn, blockHtml as Zr, BREAKPOINTS$1 as Zt, shortcutKey as _, elementTypeNames as _a, markdown as _i, slugify as _n, carouselPause as _r, assertSnippetValid as _t, locateClasses as a, authoringCodeEntry as aa, dialogContainer as ai, expandShorthand as an, when as ar, SPACE_FIELDS as at, summariseRenders as b, elementAttributeNames as ba, pagination as bi, locate as bn, closeDialog as br, suggestSpace as bt, validateSnippet as c, elementAttributeValues as ca, embed as ci, shorthandLonghands as cn, whileRunning as cr, specFromSpace as ct, i as d, elementDefaultAttributes as da, formControl as di, cssPropertyName as dn, getGlobalCallback as dr, actionToSource as dt, twig as ea, carousel as ei, isRuleSetSpec as en, webHook as er, explain as et, o as f, elementLeafTypes as fa, heading as fi, isCssProperty as fn, e$16 as fr, withNamedIds as ft, pressShortcut as g, elementTriggers as ga, listItem as gi, digest as gn, carouselNext as gr, transformerCatalog as gt, withElement as h, elementSourceTypes as ha, list$1 as hi, e$9 as hn, carouselGoTo as hr, suggestTransformer as ht, lintSpace as i, AuthoringError as ia, custom$1 as ii, cssShorthands as in, named$2 as ir, ELEMENT_FIELDS as it, inspectDocument as j, video as ji, SET_STATE_TYPES as jn, onLoad as jr, i$2 as jt, loadImages as k, t$61 as ka, text$1 as ki, applyUtility as kn, onInterval as kr, withNotificationsCss as kt, validateSpace as l, elementCallbacks as la, fontAwesome as li, cssNumberValue as ln, BUILTIN_GLOBAL_CALLBACKS as lr, compareSpaces as lt, singlePageSpace as m, elementSlots as ma, link as mi, suggestCssProperty as mn, cancelApi as mr, getTransformer as mt, authorSpace as n, scope as na, channel as ni, toBlocks as nn, authorFlows as nr, explainList as nt, locateElements as o, isSuggestionCode as oa, dropdown as oi, expandShorthandPatch as on, whenFailed as or, specToSource as ot, compactSvg as p, elementPartTypes as pa, image as pi, isCustomProperty as pn, announceOn as pr, BUILTIN_TRANSFORMERS as pt, darkScheme as q, resolveSource as qi, runServerAction as qn, elementsFromManifest as qr, isStyleDeclaration as qt, fixSpace as r, AUTHORING_CODES as ra, container as ri, toResponsive as rn, flowStepIds as rr, explanationText as rt, planFixes as s, elementAncestorTypes as sa, dropdownPopup as si, expandShorthandTraced as sn, whenSucceeded as sr, SCHEMA_SETTINGS as st, authorSnippet as t, closest as ta, carouselTrack as ti, sameBlocks as tn, authorFlow as tr, explainKindOf as tt, a as u, elementCatalog as ua, form as ui, cssProperties as un, applyBuiltinCallback as ur, actionSpecFromEntry as ut, openPage as v, typeCallbackDefinitions as va, modalContainer as vi, buildHandles as vn, carouselPlay as vr, PAGE_SPEC_FIELDS as vt, alignPictures as w, s$21 as wa, svg as wi, flagSpecOf as wn, on as wr, SpaceRefusedError as wt, PAGE_TEXT_LIMIT as x, a$22 as xa, paragraph as xi, pathForSlug as xn, closeModal as xr, withoutQuieted as xt, inspectRenders as y, typeTriggerDefinitions as ya, nodeHtml as yi, instanceSelectorFor as yn, carouselPrevious as yr, assertSpaceValid as yt, CATALOG_TEMPLATE_IDENTITY as z, GLOBAL_SOURCES as zi, copyToClipboard as zn, reloadApi as zr, column as zt };