@webstudio-is/sdk 0.272.0 → 0.273.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -6,10 +6,10 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/schema/assets.ts
8
8
  import { z } from "zod";
9
- import { FontFormat, FontMeta } from "@webstudio-is/fonts";
10
- var AssetId = z.string();
9
+ import { fontFormat, fontMeta } from "@webstudio-is/fonts";
10
+ var assetId = z.string();
11
11
  var baseAsset = {
12
- id: AssetId,
12
+ id: assetId,
13
13
  projectId: z.string(),
14
14
  size: z.number(),
15
15
  name: z.string(),
@@ -17,55 +17,56 @@ var baseAsset = {
17
17
  description: z.union([z.string().optional(), z.null()]),
18
18
  createdAt: z.string()
19
19
  };
20
- var FontAsset = z.object({
20
+ var assetType = z.enum(["font", "image", "file"]);
21
+ var fontAsset = z.object({
21
22
  ...baseAsset,
22
- format: FontFormat,
23
- meta: FontMeta,
24
- type: z.literal("font")
23
+ format: fontFormat,
24
+ meta: fontMeta,
25
+ type: z.literal(assetType.enum.font)
25
26
  });
26
- var ImageMeta = z.object({
27
+ var imageMeta = z.object({
27
28
  width: z.number(),
28
29
  height: z.number()
29
30
  });
30
- var ImageAsset = z.object({
31
+ var imageAsset = z.object({
31
32
  ...baseAsset,
32
33
  format: z.string(),
33
- meta: ImageMeta,
34
- type: z.literal("image")
34
+ meta: imageMeta,
35
+ type: z.literal(assetType.enum.image)
35
36
  });
36
- var FileAsset = z.object({
37
+ var fileAsset = z.object({
37
38
  ...baseAsset,
38
39
  format: z.string(),
39
40
  meta: z.object({}),
40
- type: z.literal("file")
41
+ type: z.literal(assetType.enum.file)
41
42
  });
42
- var Asset = z.union([FontAsset, ImageAsset, FileAsset]);
43
- var Assets = z.map(AssetId, Asset);
43
+ var asset = z.union([fontAsset, imageAsset, fileAsset]);
44
+ var assets = z.map(assetId, asset);
44
45
 
45
46
  // src/schema/pages.ts
46
47
  import { z as z2 } from "zod";
47
48
  import { validateBasicAuth } from "@webstudio-is/wsauth";
48
49
  var MIN_TITLE_LENGTH = 2;
49
- var PageId = z2.string();
50
- var FolderId = z2.string();
51
- var FolderName = z2.string().refine((value) => value.trim() !== "", "Can't be empty");
52
- var Slug = z2.string().refine(
50
+ var pageId = z2.string();
51
+ var folderId = z2.string();
52
+ var folderName = z2.string().refine((value) => value.trim() !== "", "Can't be empty");
53
+ var slug = z2.string().refine(
53
54
  (path) => /^[-a-z0-9]*$/.test(path),
54
55
  "Only a-z, 0-9 and - are allowed"
55
56
  );
56
- var Folder = z2.object({
57
- id: FolderId,
58
- name: FolderName,
59
- slug: Slug,
60
- children: z2.array(z2.union([FolderId, PageId]))
57
+ var folder = z2.object({
58
+ id: folderId,
59
+ name: folderName,
60
+ slug,
61
+ children: z2.array(z2.union([folderId, pageId]))
61
62
  });
62
- var PageName = z2.string().refine((value) => value.trim() !== "", "Can't be empty");
63
- var PageTitle = z2.string().refine(
63
+ var pageName = z2.string().refine((value) => value.trim() !== "", "Can't be empty");
64
+ var pageTitle = z2.string().refine(
64
65
  (val) => val.length >= MIN_TITLE_LENGTH,
65
66
  `Minimum ${MIN_TITLE_LENGTH} characters required`
66
67
  );
67
68
  var documentTypes = ["html", "xml", "text"];
68
- var BasicAuthFields = {
69
+ var basicAuthFields = {
69
70
  login: z2.string(),
70
71
  password: z2.string()
71
72
  };
@@ -81,23 +82,23 @@ var validateBasicAuthFields = ({
81
82
  });
82
83
  }
83
84
  };
84
- var PageBasicAuth = z2.object({
85
+ var pageBasicAuth = z2.object({
85
86
  method: z2.literal("basic"),
86
- ...BasicAuthFields
87
+ ...basicAuthFields
87
88
  }).superRefine(validateBasicAuthFields);
88
- var LegacyPageBasicAuth = z2.object({
89
+ var legacyPageBasicAuth = z2.object({
89
90
  type: z2.literal("basic"),
90
- ...BasicAuthFields
91
+ ...basicAuthFields
91
92
  }).superRefine(validateBasicAuthFields).transform(({ login, password }) => ({
92
93
  method: "basic",
93
94
  login,
94
95
  password
95
96
  }));
96
- var PageAuth = z2.union([PageBasicAuth, LegacyPageBasicAuth]);
97
+ var pageAuth = z2.union([pageBasicAuth, legacyPageBasicAuth]);
97
98
  var commonPageFields = {
98
- id: PageId,
99
- name: PageName,
100
- title: PageTitle,
99
+ id: pageId,
100
+ name: pageName,
101
+ title: pageTitle,
101
102
  history: z2.optional(z2.array(z2.string())),
102
103
  rootInstanceId: z2.string(),
103
104
  systemDataSourceId: z2.string().optional(),
@@ -112,7 +113,7 @@ var commonPageFields = {
112
113
  redirect: z2.string().optional(),
113
114
  documentType: z2.optional(z2.enum(documentTypes)),
114
115
  content: z2.string().optional(),
115
- auth: PageAuth.optional(),
116
+ auth: pageAuth.optional(),
116
117
  custom: z2.array(
117
118
  z2.object({
118
119
  property: z2.string(),
@@ -128,8 +129,8 @@ var commonPageFields = {
128
129
  })
129
130
  )
130
131
  };
131
- var HomePagePath = z2.string().refine((path) => path === "", "Home page path must be empty");
132
- var DefaultPagePage = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
132
+ var homePagePath = z2.string().refine((path) => path === "", "Home page path must be empty");
133
+ var defaultPagePath = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine((path) => path.endsWith("/") === false, "Can't end with a /").refine((path) => path.includes("//") === false, "Can't contain repeating /").refine(
133
134
  (path) => /^[-_a-z0-9*:?\\/.]*$/.test(path),
134
135
  "Only a-z, 0-9, -, _, /, :, ?, . and * are allowed"
135
136
  ).refine(
@@ -142,7 +143,7 @@ var DefaultPagePage = z2.string().refine((path) => path !== "", "Can't be empty"
142
143
  (path) => path !== "/build" && path.startsWith("/build/") === false,
143
144
  "/build prefix is reserved for the system"
144
145
  ).refine((path) => path.length <= 255, "Path can't exceed 255 characters");
145
- var RedirectSourcePath = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine(
146
+ var redirectSourcePath = z2.string().refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine(
146
147
  (path) => path.startsWith("/") && path.startsWith("//") === false,
147
148
  "Must start with a /"
148
149
  ).refine((path) => {
@@ -162,23 +163,23 @@ var RedirectSourcePath = z2.string().refine((path) => path !== "", "Can't be emp
162
163
  (path) => path !== "/build" && path.startsWith("/build/") === false,
163
164
  "/build prefix is reserved for the system"
164
165
  );
165
- var PagePath = DefaultPagePage.refine(
166
+ var pagePath = defaultPagePath.refine(
166
167
  (path) => path === "" || path.startsWith("/"),
167
168
  "Must start with a / or a full URL e.g. https://website.org"
168
169
  );
169
- var Page = z2.object({
170
+ var page = z2.object({
170
171
  ...commonPageFields,
171
- path: z2.union([HomePagePath, PagePath])
172
+ path: z2.union([homePagePath, pagePath])
172
173
  });
173
- var PageTemplate = z2.object({
174
- id: PageId,
175
- name: PageName,
176
- title: PageTitle,
174
+ var pageTemplate = z2.object({
175
+ id: pageId,
176
+ name: pageName,
177
+ title: pageTitle,
177
178
  rootInstanceId: z2.string(),
178
179
  systemDataSourceId: z2.string().optional(),
179
180
  meta: commonPageFields.meta
180
181
  });
181
- var ProjectMeta = z2.object({
182
+ var projectMeta = z2.object({
182
183
  // All fields are optional to ensure consistency and allow for the addition of new fields without requiring migration
183
184
  siteName: z2.string().optional(),
184
185
  contactEmail: z2.string().optional(),
@@ -186,7 +187,7 @@ var ProjectMeta = z2.object({
186
187
  code: z2.string().optional(),
187
188
  auth: z2.string().optional()
188
189
  });
189
- var ProjectNewRedirectPath = z2.string().min(1, "Path is required").refine((data) => {
190
+ var projectNewRedirectPath = z2.string().min(1, "Path is required").refine((data) => {
190
191
  try {
191
192
  new URL(data, "http://url.com");
192
193
  return true;
@@ -194,27 +195,27 @@ var ProjectNewRedirectPath = z2.string().min(1, "Path is required").refine((data
194
195
  return false;
195
196
  }
196
197
  }, "Must be a valid URL");
197
- var PageRedirect = z2.object({
198
- old: RedirectSourcePath,
199
- new: ProjectNewRedirectPath,
198
+ var pageRedirect = z2.object({
199
+ old: redirectSourcePath,
200
+ new: projectNewRedirectPath,
200
201
  status: z2.enum(["301", "302"]).optional()
201
202
  });
202
- var CompilerSettings = z2.object({
203
+ var compilerSettings = z2.object({
203
204
  // All fields are optional to ensure consistency and allow for the addition of new fields without requiring migration
204
205
  atomicStyles: z2.boolean().optional()
205
206
  });
206
- var Pages = z2.object({
207
- meta: ProjectMeta.optional(),
208
- compiler: CompilerSettings.optional(),
209
- redirects: z2.array(PageRedirect).optional(),
210
- homePageId: PageId,
211
- rootFolderId: FolderId,
212
- pages: z2.map(PageId, Page),
213
- pageTemplates: z2.map(PageId, PageTemplate).optional(),
214
- folders: z2.map(FolderId, Folder).refine((folders) => folders.size > 0, "Folders can't be empty")
215
- }).superRefine((pages, context) => {
216
- const homePage = pages.pages.get(pages.homePageId);
217
- const rootFolder = pages.folders.get(pages.rootFolderId);
207
+ var pages = z2.object({
208
+ meta: projectMeta.optional(),
209
+ compiler: compilerSettings.optional(),
210
+ redirects: z2.array(pageRedirect).optional(),
211
+ homePageId: pageId,
212
+ rootFolderId: folderId,
213
+ pages: z2.map(pageId, page),
214
+ pageTemplates: z2.map(pageId, pageTemplate).optional(),
215
+ folders: z2.map(folderId, folder).refine((folders) => folders.size > 0, "Folders can't be empty")
216
+ }).superRefine((pages2, context) => {
217
+ const homePage = pages2.pages.get(pages2.homePageId);
218
+ const rootFolder = pages2.folders.get(pages2.rootFolderId);
218
219
  if (homePage === void 0) {
219
220
  context.addIssue({
220
221
  code: z2.ZodIssueCode.custom,
@@ -232,27 +233,27 @@ var Pages = z2.object({
232
233
  if (homePage !== void 0 && homePage.path !== "") {
233
234
  context.addIssue({
234
235
  code: z2.ZodIssueCode.custom,
235
- path: ["pages", pages.homePageId, "path"],
236
+ path: ["pages", pages2.homePageId, "path"],
236
237
  message: "Home page path must be empty"
237
238
  });
238
239
  }
239
- for (const [pageId, page] of pages.pages) {
240
- if (page.id !== pageId) {
240
+ for (const [pageId2, page2] of pages2.pages) {
241
+ if (page2.id !== pageId2) {
241
242
  context.addIssue({
242
243
  code: z2.ZodIssueCode.custom,
243
- path: ["pages", pageId, "id"],
244
+ path: ["pages", pageId2, "id"],
244
245
  message: "Page id must match its record key"
245
246
  });
246
247
  }
247
- if (pageId !== pages.homePageId && page.path === "") {
248
+ if (pageId2 !== pages2.homePageId && page2.path === "") {
248
249
  context.addIssue({
249
250
  code: z2.ZodIssueCode.custom,
250
- path: ["pages", pageId, "path"],
251
+ path: ["pages", pageId2, "path"],
251
252
  message: "Page path can't be empty"
252
253
  });
253
254
  }
254
255
  }
255
- for (const [templateId, template] of pages.pageTemplates ?? []) {
256
+ for (const [templateId, template] of pages2.pageTemplates ?? []) {
256
257
  if (template.id !== templateId) {
257
258
  context.addIssue({
258
259
  code: z2.ZodIssueCode.custom,
@@ -260,7 +261,7 @@ var Pages = z2.object({
260
261
  message: "Page template id must match its record key"
261
262
  });
262
263
  }
263
- if (pages.pages.has(templateId)) {
264
+ if (pages2.pages.has(templateId)) {
264
265
  context.addIssue({
265
266
  code: z2.ZodIssueCode.custom,
266
267
  path: ["pageTemplates", templateId, "id"],
@@ -268,75 +269,75 @@ var Pages = z2.object({
268
269
  });
269
270
  }
270
271
  }
271
- for (const [folderId, folder] of pages.folders) {
272
- if (folder.id !== folderId) {
272
+ for (const [folderId2, folder2] of pages2.folders) {
273
+ if (folder2.id !== folderId2) {
273
274
  context.addIssue({
274
275
  code: z2.ZodIssueCode.custom,
275
- path: ["folders", folderId, "id"],
276
+ path: ["folders", folderId2, "id"],
276
277
  message: "Folder id must match its record key"
277
278
  });
278
279
  }
279
- for (const [index, childId] of folder.children.entries()) {
280
- if (pages.pages.has(childId) === false && pages.folders.has(childId) === false) {
280
+ for (const [index, childId] of folder2.children.entries()) {
281
+ if (pages2.pages.has(childId) === false && pages2.folders.has(childId) === false) {
281
282
  context.addIssue({
282
283
  code: z2.ZodIssueCode.custom,
283
- path: ["folders", folderId, "children", index],
284
+ path: ["folders", folderId2, "children", index],
284
285
  message: "Folder child must reference an existing page or folder"
285
286
  });
286
287
  }
287
- if (childId === pages.rootFolderId) {
288
+ if (childId === pages2.rootFolderId) {
288
289
  context.addIssue({
289
290
  code: z2.ZodIssueCode.custom,
290
- path: ["folders", folderId, "children", index],
291
+ path: ["folders", folderId2, "children", index],
291
292
  message: "Root folder can't be nested"
292
293
  });
293
294
  }
294
295
  }
295
296
  }
296
- if (rootFolder !== void 0 && rootFolder.children[0] !== pages.homePageId) {
297
+ if (rootFolder !== void 0 && rootFolder.children[0] !== pages2.homePageId) {
297
298
  context.addIssue({
298
299
  code: z2.ZodIssueCode.custom,
299
- path: ["folders", pages.rootFolderId, "children"],
300
+ path: ["folders", pages2.rootFolderId, "children"],
300
301
  message: "Root folder must start with the home page"
301
302
  });
302
303
  }
303
304
  const childParents = /* @__PURE__ */ new Map();
304
- for (const [folderId, folder] of pages.folders) {
305
- for (const [index, childId] of folder.children.entries()) {
305
+ for (const [folderId2, folder2] of pages2.folders) {
306
+ for (const [index, childId] of folder2.children.entries()) {
306
307
  const parentId = childParents.get(childId);
307
308
  if (parentId !== void 0) {
308
309
  context.addIssue({
309
310
  code: z2.ZodIssueCode.custom,
310
- path: ["folders", folderId, "children", index],
311
+ path: ["folders", folderId2, "children", index],
311
312
  message: `Child is already registered in folder "${parentId}"`
312
313
  });
313
314
  continue;
314
315
  }
315
- childParents.set(childId, folderId);
316
+ childParents.set(childId, folderId2);
316
317
  }
317
318
  }
318
- const hasFolderCycle = (folderId, path = /* @__PURE__ */ new Set()) => {
319
- if (path.has(folderId)) {
319
+ const hasFolderCycle = (folderId2, path = /* @__PURE__ */ new Set()) => {
320
+ if (path.has(folderId2)) {
320
321
  return true;
321
322
  }
322
- const folder = pages.folders.get(folderId);
323
- if (folder === void 0) {
323
+ const folder2 = pages2.folders.get(folderId2);
324
+ if (folder2 === void 0) {
324
325
  return false;
325
326
  }
326
- path.add(folderId);
327
- for (const childId of folder.children) {
328
- if (pages.folders.has(childId) && hasFolderCycle(childId, path)) {
327
+ path.add(folderId2);
328
+ for (const childId of folder2.children) {
329
+ if (pages2.folders.has(childId) && hasFolderCycle(childId, path)) {
329
330
  return true;
330
331
  }
331
332
  }
332
- path.delete(folderId);
333
+ path.delete(folderId2);
333
334
  return false;
334
335
  };
335
- for (const folderId of pages.folders.keys()) {
336
- if (hasFolderCycle(folderId)) {
336
+ for (const folderId2 of pages2.folders.keys()) {
337
+ if (hasFolderCycle(folderId2)) {
337
338
  context.addIssue({
338
339
  code: z2.ZodIssueCode.custom,
339
- path: ["folders", folderId, "children"],
340
+ path: ["folders", folderId2, "children"],
340
341
  message: "Folders can't contain cycles"
341
342
  });
342
343
  }
@@ -345,35 +346,35 @@ var Pages = z2.object({
345
346
 
346
347
  // src/schema/instances.ts
347
348
  import { z as z3 } from "zod";
348
- var TextChild = z3.object({
349
+ var textChild = z3.object({
349
350
  type: z3.literal("text"),
350
351
  value: z3.string(),
351
352
  placeholder: z3.boolean().optional()
352
353
  });
353
- var InstanceId = z3.string();
354
- var IdChild = z3.object({
354
+ var instanceId = z3.string();
355
+ var idChild = z3.object({
355
356
  type: z3.literal("id"),
356
- value: InstanceId
357
+ value: instanceId
357
358
  });
358
- var ExpressionChild = z3.object({
359
+ var expressionChild = z3.object({
359
360
  type: z3.literal("expression"),
360
361
  value: z3.string()
361
362
  });
362
- var InstanceChild = z3.union([IdChild, TextChild, ExpressionChild]);
363
- var Instance = z3.object({
363
+ var instanceChild = z3.union([idChild, textChild, expressionChild]);
364
+ var instance = z3.object({
364
365
  type: z3.literal("instance"),
365
- id: InstanceId,
366
+ id: instanceId,
366
367
  component: z3.string(),
367
368
  tag: z3.string().optional(),
368
369
  label: z3.string().optional(),
369
- children: z3.array(InstanceChild)
370
+ children: z3.array(instanceChild)
370
371
  });
371
- var Instances = z3.map(InstanceId, Instance);
372
+ var instances = z3.map(instanceId, instance);
372
373
 
373
374
  // src/schema/data-sources.ts
374
375
  import { z as z4 } from "zod";
375
- var DataSourceId = z4.string();
376
- var DataSourceVariableValue = z4.union([
376
+ var dataSourceId = z4.string();
377
+ var dataSourceVariableValue = z4.union([
377
378
  z4.object({
378
379
  type: z4.literal("number"),
379
380
  // initial value of variable store
@@ -396,10 +397,10 @@ var DataSourceVariableValue = z4.union([
396
397
  value: z4.unknown()
397
398
  })
398
399
  ]);
399
- var DataSource = z4.union([
400
+ var dataSource = z4.union([
400
401
  z4.object({
401
402
  type: z4.literal("variable"),
402
- id: DataSourceId,
403
+ id: dataSourceId,
403
404
  // The instance should always be specified for variables,
404
405
  // however, there was a bug in the embed template
405
406
  // which produced variables without an instance
@@ -407,38 +408,38 @@ var DataSource = z4.union([
407
408
  // if we make it required
408
409
  scopeInstanceId: z4.string().optional(),
409
410
  name: z4.string(),
410
- value: DataSourceVariableValue
411
+ value: dataSourceVariableValue
411
412
  }),
412
413
  z4.object({
413
414
  type: z4.literal("parameter"),
414
- id: DataSourceId,
415
+ id: dataSourceId,
415
416
  scopeInstanceId: z4.string().optional(),
416
417
  name: z4.string()
417
418
  }),
418
419
  z4.object({
419
420
  type: z4.literal("resource"),
420
- id: DataSourceId,
421
+ id: dataSourceId,
421
422
  scopeInstanceId: z4.string().optional(),
422
423
  name: z4.string(),
423
424
  resourceId: z4.string()
424
425
  })
425
426
  ]);
426
- var DataSources = z4.map(DataSourceId, DataSource);
427
+ var dataSources = z4.map(dataSourceId, dataSource);
427
428
 
428
429
  // src/schema/resources.ts
429
430
  import { z as z5 } from "zod";
430
- var ResourceId = z5.string();
431
- var Method = z5.union([
431
+ var resourceId = z5.string();
432
+ var method = z5.union([
432
433
  z5.literal("get"),
433
434
  z5.literal("post"),
434
435
  z5.literal("put"),
435
436
  z5.literal("delete")
436
437
  ]);
437
- var Resource = z5.object({
438
- id: ResourceId,
438
+ var resource = z5.object({
439
+ id: resourceId,
439
440
  name: z5.string(),
440
441
  control: z5.optional(z5.union([z5.literal("system"), z5.literal("graphql")])),
441
- method: Method,
442
+ method,
442
443
  // expression
443
444
  url: z5.string(),
444
445
  searchParams: z5.array(
@@ -458,9 +459,9 @@ var Resource = z5.object({
458
459
  // expression
459
460
  body: z5.optional(z5.string())
460
461
  });
461
- var ResourceRequest = z5.object({
462
+ var resourceRequest = z5.object({
462
463
  name: z5.string(),
463
- method: Method,
464
+ method,
464
465
  url: z5.string(),
465
466
  searchParams: z5.array(
466
467
  z5.object({
@@ -478,13 +479,13 @@ var ResourceRequest = z5.object({
478
479
  ),
479
480
  body: z5.optional(z5.unknown())
480
481
  });
481
- var Resources = z5.map(ResourceId, Resource);
482
+ var resources = z5.map(resourceId, resource);
482
483
 
483
484
  // src/schema/props.ts
484
485
  import { z as z7 } from "zod";
485
486
 
486
487
  // src/schema/animation-schema.ts
487
- import { StyleValue } from "@webstudio-is/css-engine";
488
+ import { styleValue } from "@webstudio-is/css-engine";
488
489
  import { z as z6 } from "zod";
489
490
  var literalUnion = (arr) => z6.union(
490
491
  arr.map((val) => z6.literal(val))
@@ -533,12 +534,12 @@ var RANGE_UNITS = [
533
534
  "lvmax",
534
535
  "dvmax"
535
536
  ];
536
- var rangeUnitSchema = literalUnion(RANGE_UNITS);
537
- var rangeUnitValueSchema = z6.union([
537
+ var rangeUnit = literalUnion(RANGE_UNITS);
538
+ var rangeUnitValue = z6.union([
538
539
  z6.object({
539
540
  type: z6.literal("unit"),
540
541
  value: z6.number(),
541
- unit: rangeUnitSchema
542
+ unit: rangeUnit
542
543
  }),
543
544
  z6.object({
544
545
  type: z6.literal("unparsed"),
@@ -550,32 +551,32 @@ var rangeUnitValueSchema = z6.union([
550
551
  })
551
552
  ]);
552
553
  var TIME_UNITS = ["ms", "s"];
553
- var timeUnitSchema = literalUnion(TIME_UNITS);
554
- var durationUnitValueSchema = z6.union([
554
+ var timeUnit = literalUnion(TIME_UNITS);
555
+ var durationUnitValue = z6.union([
555
556
  z6.object({
556
557
  type: z6.literal("unit"),
557
558
  value: z6.number(),
558
- unit: timeUnitSchema
559
+ unit: timeUnit
559
560
  }),
560
561
  z6.object({
561
562
  type: z6.literal("var"),
562
563
  value: z6.string()
563
564
  })
564
565
  ]);
565
- var iterationsUnitValueSchema = z6.union([z6.number(), z6.literal("infinite")]);
566
- var insetUnitValueSchema = z6.union([
567
- rangeUnitValueSchema,
566
+ var iterationsUnitValue = z6.union([z6.number(), z6.literal("infinite")]);
567
+ var insetUnitValue = z6.union([
568
+ rangeUnitValue,
568
569
  z6.object({
569
570
  type: z6.literal("keyword"),
570
571
  value: z6.literal("auto")
571
572
  })
572
573
  ]);
573
- var keyframeStylesSchema = z6.record(StyleValue);
574
- var animationKeyframeSchema = z6.object({
574
+ var keyframeStyles = z6.record(styleValue);
575
+ var animationKeyframe = z6.object({
575
576
  offset: z6.number().optional(),
576
- styles: keyframeStylesSchema
577
+ styles: keyframeStyles
577
578
  });
578
- var keyframeEffectOptionsSchema = z6.object({
579
+ var keyframeEffectOptions = z6.object({
579
580
  easing: z6.string().optional(),
580
581
  fill: z6.union([
581
582
  z6.literal("none"),
@@ -584,29 +585,23 @@ var keyframeEffectOptionsSchema = z6.object({
584
585
  z6.literal("both")
585
586
  ]).optional(),
586
587
  // FillMode
587
- duration: durationUnitValueSchema.optional(),
588
- delay: durationUnitValueSchema.optional(),
589
- iterations: iterationsUnitValueSchema.optional()
588
+ duration: durationUnitValue.optional(),
589
+ delay: durationUnitValue.optional(),
590
+ iterations: iterationsUnitValue.optional()
590
591
  });
591
- var scrollNamedRangeSchema = z6.union([
592
- z6.literal("start"),
593
- z6.literal("end")
594
- ]);
595
- var scrollRangeValueSchema = z6.tuple([
596
- scrollNamedRangeSchema,
597
- rangeUnitValueSchema
598
- ]);
599
- var scrollRangeOptionsSchema = z6.object({
600
- rangeStart: scrollRangeValueSchema.optional(),
601
- rangeEnd: scrollRangeValueSchema.optional()
592
+ var scrollNamedRange = z6.union([z6.literal("start"), z6.literal("end")]);
593
+ var scrollRangeValue = z6.tuple([scrollNamedRange, rangeUnitValue]);
594
+ var scrollRangeOptions = z6.object({
595
+ rangeStart: scrollRangeValue.optional(),
596
+ rangeEnd: scrollRangeValue.optional()
602
597
  });
603
- var animationAxisSchema = z6.union([
598
+ var animationAxis = z6.union([
604
599
  z6.literal("block"),
605
600
  z6.literal("inline"),
606
601
  z6.literal("x"),
607
602
  z6.literal("y")
608
603
  ]);
609
- var viewNamedRangeSchema = z6.union([
604
+ var viewNamedRange = z6.union([
610
605
  z6.literal("contain"),
611
606
  z6.literal("cover"),
612
607
  z6.literal("entry"),
@@ -614,62 +609,59 @@ var viewNamedRangeSchema = z6.union([
614
609
  z6.literal("entry-crossing"),
615
610
  z6.literal("exit-crossing")
616
611
  ]);
617
- var viewRangeValueSchema = z6.tuple([
618
- viewNamedRangeSchema,
619
- rangeUnitValueSchema
620
- ]);
621
- var viewRangeOptionsSchema = z6.object({
622
- rangeStart: viewRangeValueSchema.optional(),
623
- rangeEnd: viewRangeValueSchema.optional()
612
+ var viewRangeValue = z6.tuple([viewNamedRange, rangeUnitValue]);
613
+ var viewRangeOptions = z6.object({
614
+ rangeStart: viewRangeValue.optional(),
615
+ rangeEnd: viewRangeValue.optional()
624
616
  });
625
617
  var baseAnimation = z6.object({
626
618
  name: z6.string().optional(),
627
619
  description: z6.string().optional(),
628
620
  enabled: z6.array(z6.tuple([z6.string().describe("breakpointId"), z6.boolean()])).optional(),
629
- keyframes: z6.array(animationKeyframeSchema)
621
+ keyframes: z6.array(animationKeyframe)
630
622
  });
631
- var scrollAnimationSchema = baseAnimation.merge(
623
+ var scrollAnimation = baseAnimation.merge(
632
624
  z6.object({
633
- timing: keyframeEffectOptionsSchema.merge(scrollRangeOptionsSchema)
625
+ timing: keyframeEffectOptions.merge(scrollRangeOptions)
634
626
  })
635
627
  );
636
- var scrollActionSchema = z6.object({
628
+ var scrollAction = z6.object({
637
629
  type: z6.literal("scroll"),
638
630
  source: z6.union([z6.literal("closest"), z6.literal("nearest"), z6.literal("root")]).optional(),
639
- axis: animationAxisSchema.optional(),
640
- animations: z6.array(scrollAnimationSchema),
631
+ axis: animationAxis.optional(),
632
+ animations: z6.array(scrollAnimation),
641
633
  isPinned: z6.boolean().optional(),
642
634
  debug: z6.boolean().optional()
643
635
  });
644
- var viewAnimationSchema = baseAnimation.merge(
636
+ var viewAnimation = baseAnimation.merge(
645
637
  z6.object({
646
- timing: keyframeEffectOptionsSchema.merge(viewRangeOptionsSchema)
638
+ timing: keyframeEffectOptions.merge(viewRangeOptions)
647
639
  })
648
640
  );
649
- var viewActionSchema = z6.object({
641
+ var viewAction = z6.object({
650
642
  type: z6.literal("view"),
651
643
  subject: z6.string().optional(),
652
- axis: animationAxisSchema.optional(),
653
- animations: z6.array(viewAnimationSchema),
654
- insetStart: insetUnitValueSchema.optional(),
655
- insetEnd: insetUnitValueSchema.optional(),
644
+ axis: animationAxis.optional(),
645
+ animations: z6.array(viewAnimation),
646
+ insetStart: insetUnitValue.optional(),
647
+ insetEnd: insetUnitValue.optional(),
656
648
  isPinned: z6.boolean().optional(),
657
649
  debug: z6.boolean().optional()
658
650
  });
659
- var animationActionSchema = z6.discriminatedUnion("type", [
660
- scrollActionSchema,
661
- viewActionSchema
651
+ var animationAction = z6.discriminatedUnion("type", [
652
+ scrollAction,
653
+ viewAction
662
654
  ]);
663
655
 
664
656
  // src/schema/props.ts
665
- var PropId = z7.string();
657
+ var propId = z7.string();
666
658
  var baseProp = {
667
- id: PropId,
659
+ id: propId,
668
660
  instanceId: z7.string(),
669
661
  name: z7.string(),
670
662
  required: z7.optional(z7.boolean())
671
663
  };
672
- var Prop = z7.union([
664
+ var prop = z7.union([
673
665
  z7.object({
674
666
  ...baseProp,
675
667
  type: z7.literal("number"),
@@ -745,16 +737,16 @@ var Prop = z7.union([
745
737
  z7.object({
746
738
  ...baseProp,
747
739
  type: z7.literal("animationAction"),
748
- value: animationActionSchema
740
+ value: animationAction
749
741
  })
750
742
  ]);
751
- var Props = z7.map(PropId, Prop);
743
+ var props = z7.map(propId, prop);
752
744
 
753
745
  // src/schema/breakpoints.ts
754
746
  import { z as z8 } from "zod";
755
- var BreakpointId = z8.string();
756
- var Breakpoint = z8.object({
757
- id: BreakpointId,
747
+ var breakpointId = z8.string();
748
+ var breakpoint = z8.object({
749
+ id: breakpointId,
758
750
  label: z8.string(),
759
751
  minWidth: z8.number().optional(),
760
752
  maxWidth: z8.number().optional(),
@@ -773,7 +765,7 @@ var Breakpoint = z8.object({
773
765
  }
774
766
  return true;
775
767
  }, "Width-based (minWidth/maxWidth) and condition are mutually exclusive, and minWidth must be less than maxWidth");
776
- var Breakpoints = z8.map(BreakpointId, Breakpoint);
768
+ var breakpoints = z8.map(breakpointId, breakpoint);
777
769
  var initialBreakpoints = [
778
770
  { id: "placeholder", label: "Base" },
779
771
  { id: "placeholder", label: "Tablet", maxWidth: 991 },
@@ -783,51 +775,51 @@ var initialBreakpoints = [
783
775
 
784
776
  // src/schema/style-sources.ts
785
777
  import { z as z9 } from "zod";
786
- var StyleSourceId = z9.string();
787
- var StyleSourceToken = z9.object({
778
+ var styleSourceId = z9.string();
779
+ var styleSourceToken = z9.object({
788
780
  type: z9.literal("token"),
789
- id: StyleSourceId,
781
+ id: styleSourceId,
790
782
  name: z9.string(),
791
783
  locked: z9.boolean().optional()
792
784
  });
793
- var StyleSourceLocal = z9.object({
785
+ var styleSourceLocal = z9.object({
794
786
  type: z9.literal("local"),
795
- id: StyleSourceId
787
+ id: styleSourceId
796
788
  });
797
- var StyleSource = z9.union([StyleSourceToken, StyleSourceLocal]);
798
- var StyleSources = z9.map(StyleSourceId, StyleSource);
789
+ var styleSource = z9.union([styleSourceToken, styleSourceLocal]);
790
+ var styleSources = z9.map(styleSourceId, styleSource);
799
791
 
800
792
  // src/schema/style-source-selections.ts
801
793
  import { z as z10 } from "zod";
802
- var InstanceId2 = z10.string();
803
- var StyleSourceId2 = z10.string();
804
- var StyleSourceSelection = z10.object({
805
- instanceId: InstanceId2,
806
- values: z10.array(StyleSourceId2)
794
+ var instanceId2 = z10.string();
795
+ var styleSourceId2 = z10.string();
796
+ var styleSourceSelection = z10.object({
797
+ instanceId: instanceId2,
798
+ values: z10.array(styleSourceId2)
807
799
  });
808
- var StyleSourceSelections = z10.map(InstanceId2, StyleSourceSelection);
800
+ var styleSourceSelections = z10.map(instanceId2, styleSourceSelection);
809
801
 
810
802
  // src/schema/styles.ts
811
803
  import { z as z11 } from "zod";
812
- import { StyleValue as StyleValue2 } from "@webstudio-is/css-engine";
813
- var StyleDeclRaw = z11.object({
804
+ import { styleValue as styleValue2 } from "@webstudio-is/css-engine";
805
+ var styleDeclRaw = z11.object({
814
806
  styleSourceId: z11.string(),
815
807
  breakpointId: z11.string(),
816
808
  state: z11.optional(z11.string()),
817
809
  // @todo can't figure out how to make property to be enum
818
810
  property: z11.string(),
819
- value: StyleValue2,
811
+ value: styleValue2,
820
812
  listed: z11.boolean().optional().describe("Whether the style is from the Advanced panel")
821
813
  });
822
- var StyleDecl = StyleDeclRaw;
823
- var getStyleDeclKey = (styleDecl) => {
824
- return `${styleDecl.styleSourceId}:${styleDecl.breakpointId}:${styleDecl.property}:${styleDecl.state ?? ""}`;
814
+ var styleDecl = styleDeclRaw;
815
+ var getStyleDeclKey = (styleDecl2) => {
816
+ return `${styleDecl2.styleSourceId}:${styleDecl2.breakpointId}:${styleDecl2.property}:${styleDecl2.state ?? ""}`;
825
817
  };
826
- var Styles = z11.map(z11.string(), StyleDecl);
818
+ var styles = z11.map(z11.string(), styleDecl);
827
819
 
828
820
  // src/schema/deployment.ts
829
821
  import { z as z12 } from "zod";
830
- var Templates = z12.enum([
822
+ var templates = z12.enum([
831
823
  "docker",
832
824
  "vercel",
833
825
  "netlify",
@@ -835,13 +827,13 @@ var Templates = z12.enum([
835
827
  "ssg-netlify",
836
828
  "ssg-vercel"
837
829
  ]);
838
- var Deployment = z12.union([
830
+ var deployment = z12.union([
839
831
  z12.object({
840
832
  destination: z12.literal("static"),
841
833
  name: z12.string(),
842
834
  assetsDomain: z12.string(),
843
835
  // Must be validated very strictly
844
- templates: z12.array(Templates)
836
+ templates: z12.array(templates)
845
837
  }),
846
838
  z12.object({
847
839
  destination: z12.literal("saas").optional(),
@@ -857,17 +849,17 @@ var Deployment = z12.union([
857
849
 
858
850
  // src/schema/webstudio.ts
859
851
  import { z as z13 } from "zod";
860
- var WebstudioFragment = z13.object({
861
- children: z13.array(InstanceChild),
862
- instances: z13.array(Instance),
863
- assets: z13.array(Asset),
864
- dataSources: z13.array(DataSource),
865
- resources: z13.array(Resource),
866
- props: z13.array(Prop),
867
- breakpoints: z13.array(Breakpoint),
868
- styleSourceSelections: z13.array(StyleSourceSelection),
869
- styleSources: z13.array(StyleSource),
870
- styles: z13.array(StyleDecl)
852
+ var webstudioFragment = z13.object({
853
+ children: z13.array(instanceChild),
854
+ instances: z13.array(instance),
855
+ assets: z13.array(asset),
856
+ dataSources: z13.array(dataSource),
857
+ resources: z13.array(resource),
858
+ props: z13.array(prop),
859
+ breakpoints: z13.array(breakpoint),
860
+ styleSourceSelections: z13.array(styleSourceSelection),
861
+ styleSources: z13.array(styleSource),
862
+ styles: z13.array(styleDecl)
871
863
  });
872
864
 
873
865
  // src/schema/prop-meta.ts
@@ -878,26 +870,26 @@ var common = {
878
870
  required: z14.boolean(),
879
871
  contentMode: z14.boolean().optional()
880
872
  };
881
- var Tag = z14.object({
873
+ var tag = z14.object({
882
874
  ...common,
883
875
  control: z14.literal("tag"),
884
876
  type: z14.literal("string"),
885
877
  defaultValue: z14.undefined().optional(),
886
878
  options: z14.array(z14.string())
887
879
  });
888
- var Number = z14.object({
880
+ var number = z14.object({
889
881
  ...common,
890
882
  control: z14.literal("number"),
891
883
  type: z14.literal("number"),
892
884
  defaultValue: z14.number().optional()
893
885
  });
894
- var Range = z14.object({
886
+ var range = z14.object({
895
887
  ...common,
896
888
  control: z14.literal("range"),
897
889
  type: z14.literal("number"),
898
890
  defaultValue: z14.number().optional()
899
891
  });
900
- var Text = z14.object({
892
+ var text = z14.object({
901
893
  ...common,
902
894
  control: z14.literal("text"),
903
895
  type: z14.literal("string"),
@@ -908,87 +900,87 @@ var Text = z14.object({
908
900
  */
909
901
  rows: z14.number().optional()
910
902
  });
911
- var Resource2 = z14.object({
903
+ var resource2 = z14.object({
912
904
  ...common,
913
905
  control: z14.literal("resource"),
914
906
  type: z14.literal("resource"),
915
907
  defaultValue: z14.string().optional()
916
908
  });
917
- var Code = z14.object({
909
+ var code = z14.object({
918
910
  ...common,
919
911
  control: z14.literal("code"),
920
912
  type: z14.literal("string"),
921
913
  language: z14.union([z14.literal("html"), z14.literal("markdown")]),
922
914
  defaultValue: z14.string().optional()
923
915
  });
924
- var CodeText = z14.object({
916
+ var codeText = z14.object({
925
917
  ...common,
926
918
  control: z14.literal("codetext"),
927
919
  type: z14.literal("string"),
928
920
  defaultValue: z14.string().optional()
929
921
  });
930
- var Color = z14.object({
922
+ var color = z14.object({
931
923
  ...common,
932
924
  control: z14.literal("color"),
933
925
  type: z14.literal("string"),
934
926
  defaultValue: z14.string().optional()
935
927
  });
936
- var Boolean = z14.object({
928
+ var boolean = z14.object({
937
929
  ...common,
938
930
  control: z14.literal("boolean"),
939
931
  type: z14.literal("boolean"),
940
932
  defaultValue: z14.boolean().optional()
941
933
  });
942
- var Radio = z14.object({
934
+ var radio = z14.object({
943
935
  ...common,
944
936
  control: z14.literal("radio"),
945
937
  type: z14.literal("string"),
946
938
  defaultValue: z14.string().optional(),
947
939
  options: z14.array(z14.string())
948
940
  });
949
- var InlineRadio = z14.object({
941
+ var inlineRadio = z14.object({
950
942
  ...common,
951
943
  control: z14.literal("inline-radio"),
952
944
  type: z14.literal("string"),
953
945
  defaultValue: z14.string().optional(),
954
946
  options: z14.array(z14.string())
955
947
  });
956
- var Select = z14.object({
948
+ var select = z14.object({
957
949
  ...common,
958
950
  control: z14.literal("select"),
959
951
  type: z14.literal("string"),
960
952
  defaultValue: z14.string().optional(),
961
953
  options: z14.array(z14.string())
962
954
  });
963
- var TimeZone = z14.object({
955
+ var timeZone = z14.object({
964
956
  ...common,
965
957
  control: z14.literal("timeZone"),
966
958
  type: z14.literal("string"),
967
959
  defaultValue: z14.string().optional(),
968
960
  options: z14.array(z14.string())
969
961
  });
970
- var Check = z14.object({
962
+ var check = z14.object({
971
963
  ...common,
972
964
  control: z14.literal("check"),
973
965
  type: z14.literal("string[]"),
974
966
  defaultValue: z14.array(z14.string()).optional(),
975
967
  options: z14.array(z14.string())
976
968
  });
977
- var InlineCheck = z14.object({
969
+ var inlineCheck = z14.object({
978
970
  ...common,
979
971
  control: z14.literal("inline-check"),
980
972
  type: z14.literal("string[]"),
981
973
  defaultValue: z14.array(z14.string()).optional(),
982
974
  options: z14.array(z14.string())
983
975
  });
984
- var MultiSelect = z14.object({
976
+ var multiSelect = z14.object({
985
977
  ...common,
986
978
  control: z14.literal("multi-select"),
987
979
  type: z14.literal("string[]"),
988
980
  defaultValue: z14.array(z14.string()).optional(),
989
981
  options: z14.array(z14.string())
990
982
  });
991
- var File = z14.object({
983
+ var file = z14.object({
992
984
  ...common,
993
985
  control: z14.literal("file"),
994
986
  type: z14.literal("string"),
@@ -996,19 +988,19 @@ var File = z14.object({
996
988
  /** https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept */
997
989
  accept: z14.string().optional()
998
990
  });
999
- var Url = z14.object({
991
+ var url = z14.object({
1000
992
  ...common,
1001
993
  control: z14.literal("url"),
1002
994
  type: z14.literal("string"),
1003
995
  defaultValue: z14.string().optional()
1004
996
  });
1005
- var Json = z14.object({
997
+ var json = z14.object({
1006
998
  ...common,
1007
999
  control: z14.literal("json"),
1008
1000
  type: z14.literal("json"),
1009
1001
  defaultValue: z14.unknown().optional()
1010
1002
  });
1011
- var Date = z14.object({
1003
+ var date = z14.object({
1012
1004
  ...common,
1013
1005
  control: z14.literal("date"),
1014
1006
  // @todo not sure what type should be here
@@ -1016,58 +1008,58 @@ var Date = z14.object({
1016
1008
  type: z14.literal("string"),
1017
1009
  defaultValue: z14.string().optional()
1018
1010
  });
1019
- var Action = z14.object({
1011
+ var action = z14.object({
1020
1012
  ...common,
1021
1013
  control: z14.literal("action"),
1022
1014
  type: z14.literal("action"),
1023
1015
  defaultValue: z14.undefined().optional()
1024
1016
  });
1025
- var TextContent = z14.object({
1017
+ var textContent = z14.object({
1026
1018
  ...common,
1027
1019
  control: z14.literal("textContent"),
1028
1020
  type: z14.literal("string"),
1029
1021
  defaultValue: z14.string().optional()
1030
1022
  });
1031
- var AnimationAction = z14.object({
1023
+ var animationAction2 = z14.object({
1032
1024
  ...common,
1033
1025
  control: z14.literal("animationAction"),
1034
1026
  type: z14.literal("animationAction"),
1035
1027
  defaultValue: z14.undefined().optional()
1036
1028
  });
1037
- var PropMeta = z14.union([
1038
- Tag,
1039
- Number,
1040
- Range,
1041
- Text,
1042
- Resource2,
1043
- Code,
1044
- CodeText,
1045
- Color,
1046
- Boolean,
1047
- Radio,
1048
- InlineRadio,
1049
- Select,
1050
- TimeZone,
1051
- MultiSelect,
1052
- Check,
1053
- InlineCheck,
1054
- File,
1055
- Url,
1056
- Json,
1057
- Date,
1058
- Action,
1059
- TextContent,
1060
- AnimationAction
1029
+ var propMeta = z14.union([
1030
+ tag,
1031
+ number,
1032
+ range,
1033
+ text,
1034
+ resource2,
1035
+ code,
1036
+ codeText,
1037
+ color,
1038
+ boolean,
1039
+ radio,
1040
+ inlineRadio,
1041
+ select,
1042
+ timeZone,
1043
+ multiSelect,
1044
+ check,
1045
+ inlineCheck,
1046
+ file,
1047
+ url,
1048
+ json,
1049
+ date,
1050
+ action,
1051
+ textContent,
1052
+ animationAction2
1061
1053
  ]);
1062
1054
 
1063
1055
  // src/schema/component-meta.ts
1064
1056
  import { z as z15 } from "zod";
1065
- import { StyleValue as StyleValue3 } from "@webstudio-is/css-engine";
1066
- var PresetStyleDecl = z15.object({
1057
+ import { styleValue as styleValue3 } from "@webstudio-is/css-engine";
1058
+ var presetStyleDecl = z15.object({
1067
1059
  // State selector, e.g. :hover
1068
1060
  state: z15.optional(z15.string()),
1069
1061
  property: z15.string(),
1070
- value: StyleValue3
1062
+ value: styleValue3
1071
1063
  });
1072
1064
  var componentCategories = [
1073
1065
  "general",
@@ -1084,12 +1076,12 @@ var componentCategories = [
1084
1076
  "hidden",
1085
1077
  "internal"
1086
1078
  ];
1087
- var ComponentState = z15.object({
1079
+ var componentState = z15.object({
1088
1080
  selector: z15.string(),
1089
1081
  label: z15.string()
1090
1082
  });
1091
- var ComponentContent = z15.string();
1092
- var ContentModel = z15.object({
1083
+ var componentContent = z15.string();
1084
+ var contentModel = z15.object({
1093
1085
  /*
1094
1086
  * instance - accepted by any parent with "instance" in children categories
1095
1087
  * none - accepted by parents with this component name in children categories
@@ -1098,15 +1090,15 @@ var ContentModel = z15.object({
1098
1090
  /**
1099
1091
  * enforce direct children of category or components
1100
1092
  */
1101
- children: z15.array(ComponentContent),
1093
+ children: z15.array(componentContent),
1102
1094
  /**
1103
1095
  * enforce descendants of category or components
1104
1096
  */
1105
- descendants: z15.array(ComponentContent).optional()
1097
+ descendants: z15.array(componentContent).optional()
1106
1098
  });
1107
- var WsComponentMeta = z15.object({
1099
+ var wsComponentMeta = z15.object({
1108
1100
  category: z15.enum(componentCategories).optional(),
1109
- contentModel: ContentModel.optional(),
1101
+ contentModel: contentModel.optional(),
1110
1102
  // when this field is specified component receives
1111
1103
  // prop with index of same components withiin specified ancestor
1112
1104
  // important to automatically enumerate collections without
@@ -1115,12 +1107,12 @@ var WsComponentMeta = z15.object({
1115
1107
  label: z15.optional(z15.string()),
1116
1108
  description: z15.string().optional(),
1117
1109
  icon: z15.string().optional(),
1118
- presetStyle: z15.optional(z15.record(z15.string(), z15.array(PresetStyleDecl))),
1119
- states: z15.optional(z15.array(ComponentState)),
1110
+ presetStyle: z15.optional(z15.record(z15.string(), z15.array(presetStyleDecl))),
1111
+ states: z15.optional(z15.array(componentState)),
1120
1112
  order: z15.number().optional(),
1121
1113
  // properties and html attributes that will be always visible in properties panel
1122
1114
  initialProps: z15.array(z15.string()).optional(),
1123
- props: z15.record(PropMeta).optional()
1115
+ props: z15.record(propMeta).optional()
1124
1116
  });
1125
1117
 
1126
1118
  // src/assets.ts
@@ -1310,18 +1302,18 @@ var getAssetMime = ({
1310
1302
  }
1311
1303
  return mime2;
1312
1304
  };
1313
- var doesAssetMatchMimePatterns = (asset, patterns) => {
1305
+ var doesAssetMatchMimePatterns = (asset2, patterns) => {
1314
1306
  if (patterns === "*") {
1315
1307
  return true;
1316
1308
  }
1317
- const mime = getAssetMime(asset);
1309
+ const mime = getAssetMime(asset2);
1318
1310
  if (mime !== void 0) {
1319
1311
  if (patterns.has(mime) || patterns.has(`${getCategory(mime)}/*`)) {
1320
1312
  return true;
1321
1313
  }
1322
1314
  }
1323
- if (asset.type === "file" && asset.name) {
1324
- const extension = asset.name.split(".").pop()?.toLowerCase();
1315
+ if (asset2.type === "file" && asset2.name) {
1316
+ const extension = asset2.name.split(".").pop()?.toLowerCase();
1325
1317
  if (extension) {
1326
1318
  const mimeFromExtension = extensionToMime.get(`.${extension}`);
1327
1319
  if (mimeFromExtension) {
@@ -1374,37 +1366,37 @@ var decodePathFragment = (fragment) => {
1374
1366
  }
1375
1367
  return decoded;
1376
1368
  };
1377
- var getAssetUrl = (asset, origin) => {
1369
+ var getAssetUrl = (asset2, origin) => {
1378
1370
  let path;
1379
- const assetType = detectAssetType(asset.name);
1380
- if (assetType === "image") {
1381
- path = `/cgi/image/${asset.name}?format=raw`;
1371
+ const assetType2 = detectAssetType(asset2.name);
1372
+ if (assetType2 === "image") {
1373
+ path = `/cgi/image/${asset2.name}?format=raw`;
1382
1374
  } else {
1383
- path = `/cgi/asset/${asset.name}?format=raw`;
1375
+ path = `/cgi/asset/${asset2.name}?format=raw`;
1384
1376
  }
1385
1377
  return new URL(path, origin);
1386
1378
  };
1387
- var extractImageMetadata = (asset) => {
1388
- if (asset.type !== "image") {
1379
+ var extractImageMetadata = (asset2) => {
1380
+ if (asset2.type !== "image") {
1389
1381
  return;
1390
1382
  }
1391
- if (asset.meta.width && asset.meta.height) {
1383
+ if (asset2.meta.width && asset2.meta.height) {
1392
1384
  return {
1393
- width: asset.meta.width,
1394
- height: asset.meta.height
1385
+ width: asset2.meta.width,
1386
+ height: asset2.meta.height
1395
1387
  };
1396
1388
  }
1397
1389
  };
1398
- var extractFontMetadata = (asset) => {
1399
- if (asset.type !== "font") {
1390
+ var extractFontMetadata = (asset2) => {
1391
+ if (asset2.type !== "font") {
1400
1392
  return;
1401
1393
  }
1402
1394
  const metadata = {
1403
- family: asset.meta.family
1395
+ family: asset2.meta.family
1404
1396
  };
1405
- if ("style" in asset.meta) {
1406
- metadata.style = asset.meta.style;
1407
- metadata.weight = asset.meta.weight;
1397
+ if ("style" in asset2.meta) {
1398
+ metadata.style = asset2.meta.style;
1399
+ metadata.weight = asset2.meta.weight;
1408
1400
  }
1409
1401
  return metadata;
1410
1402
  };
@@ -1416,11 +1408,11 @@ var metadataExtractors = {
1416
1408
  font: extractFontMetadata,
1417
1409
  file: extractFileMetadata
1418
1410
  };
1419
- var toRuntimeAsset = (asset, origin) => {
1420
- const extractor = metadataExtractors[asset.type];
1421
- const metadata = extractor(asset);
1422
- const url = getAssetUrl(asset, origin);
1423
- const relativeUrl = url.pathname + url.search;
1411
+ var toRuntimeAsset = (asset2, origin) => {
1412
+ const extractor = metadataExtractors[asset2.type];
1413
+ const metadata = extractor(asset2);
1414
+ const url2 = getAssetUrl(asset2, origin);
1415
+ const relativeUrl = url2.pathname + url2.search;
1424
1416
  return {
1425
1417
  url: relativeUrl,
1426
1418
  ...metadata
@@ -1447,7 +1439,7 @@ __export(normalize_css_exports, {
1447
1439
  body: () => body,
1448
1440
  button: () => button,
1449
1441
  checkbox: () => checkbox,
1450
- code: () => code,
1442
+ code: () => code2,
1451
1443
  div: () => div,
1452
1444
  figure: () => figure,
1453
1445
  footer: () => footer,
@@ -1475,10 +1467,10 @@ __export(normalize_css_exports, {
1475
1467
  p: () => p,
1476
1468
  pre: () => pre,
1477
1469
  progress: () => progress,
1478
- radio: () => radio,
1470
+ radio: () => radio2,
1479
1471
  samp: () => samp,
1480
1472
  section: () => section,
1481
- select: () => select,
1473
+ select: () => select2,
1482
1474
  small: () => small,
1483
1475
  span: () => span,
1484
1476
  strong: () => strong,
@@ -1578,7 +1570,7 @@ var b = [
1578
1570
  { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
1579
1571
  ];
1580
1572
  var strong = b;
1581
- var code = [
1573
+ var code2 = [
1582
1574
  {
1583
1575
  property: "font-family",
1584
1576
  value: {
@@ -1596,9 +1588,9 @@ var code = [
1596
1588
  { property: "font-size", value: { type: "unit", unit: "em", value: 1 } },
1597
1589
  { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
1598
1590
  ];
1599
- var kbd = code;
1600
- var samp = code;
1601
- var pre = code;
1591
+ var kbd = code2;
1592
+ var samp = code2;
1593
+ var pre = code2;
1602
1594
  var small = [
1603
1595
  { property: "font-size", value: { type: "unit", unit: "%", value: 80 } },
1604
1596
  { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
@@ -1703,7 +1695,7 @@ var optgroup = [
1703
1695
  },
1704
1696
  { property: "box-sizing", value: { type: "keyword", value: "border-box" } }
1705
1697
  ];
1706
- var radio = [
1698
+ var radio2 = [
1707
1699
  { property: "font-family", value: { type: "keyword", value: "inherit" } },
1708
1700
  { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
1709
1701
  {
@@ -1732,7 +1724,7 @@ var radio = [
1732
1724
  },
1733
1725
  { property: "border-left-style", value: { type: "keyword", value: "none" } }
1734
1726
  ];
1735
- var checkbox = radio;
1727
+ var checkbox = radio2;
1736
1728
  var button = [
1737
1729
  { property: "font-family", value: { type: "keyword", value: "inherit" } },
1738
1730
  { property: "font-size", value: { type: "unit", unit: "%", value: 100 } },
@@ -1766,7 +1758,7 @@ var button = [
1766
1758
  { property: "border-left-style", value: { type: "keyword", value: "solid" } },
1767
1759
  { property: "text-transform", value: { type: "keyword", value: "none" } }
1768
1760
  ];
1769
- var select = button;
1761
+ var select2 = button;
1770
1762
  var legend = [
1771
1763
  {
1772
1764
  property: "padding-top",
@@ -2083,33 +2075,33 @@ var isComponentDetachable = (component) => component !== rootComponent && compon
2083
2075
 
2084
2076
  // src/instances-utils.ts
2085
2077
  var ROOT_INSTANCE_ID = ":root";
2086
- var traverseInstances = (instances, instanceId, callback) => {
2087
- const instance = instances.get(instanceId);
2088
- if (instance === void 0) {
2078
+ var traverseInstances = (instances2, instanceId3, callback) => {
2079
+ const instance2 = instances2.get(instanceId3);
2080
+ if (instance2 === void 0) {
2089
2081
  return;
2090
2082
  }
2091
- const skipTraversingChildren = callback(instance);
2083
+ const skipTraversingChildren = callback(instance2);
2092
2084
  if (skipTraversingChildren === false) {
2093
2085
  return;
2094
2086
  }
2095
- for (const child of instance.children) {
2087
+ for (const child of instance2.children) {
2096
2088
  if (child.type === "id") {
2097
- traverseInstances(instances, child.value, callback);
2089
+ traverseInstances(instances2, child.value, callback);
2098
2090
  }
2099
2091
  }
2100
2092
  };
2101
- var findTreeInstanceIds = (instances, rootInstanceId) => {
2093
+ var findTreeInstanceIds = (instances2, rootInstanceId) => {
2102
2094
  const ids = /* @__PURE__ */ new Set([rootInstanceId]);
2103
- traverseInstances(instances, rootInstanceId, (instance) => {
2104
- ids.add(instance.id);
2095
+ traverseInstances(instances2, rootInstanceId, (instance2) => {
2096
+ ids.add(instance2.id);
2105
2097
  });
2106
2098
  return ids;
2107
2099
  };
2108
- var findTreeInstanceIdsExcludingSlotDescendants = (instances, rootInstanceId) => {
2100
+ var findTreeInstanceIdsExcludingSlotDescendants = (instances2, rootInstanceId) => {
2109
2101
  const ids = /* @__PURE__ */ new Set([rootInstanceId]);
2110
- traverseInstances(instances, rootInstanceId, (instance) => {
2111
- ids.add(instance.id);
2112
- if (instance.component === "Slot") {
2102
+ traverseInstances(instances2, rootInstanceId, (instance2) => {
2103
+ ids.add(instance2.id);
2104
+ if (instance2.component === "Slot") {
2113
2105
  return false;
2114
2106
  }
2115
2107
  });
@@ -2126,36 +2118,36 @@ var parseComponentName = (componentName) => {
2126
2118
  }
2127
2119
  return [namespace, name];
2128
2120
  };
2129
- var getHtmlTagsFromProps = (props) => {
2121
+ var getHtmlTagsFromProps = (props2) => {
2130
2122
  const tags2 = /* @__PURE__ */ new Map();
2131
- for (const prop of props.values()) {
2132
- if (prop.type === "string" && prop.name === "tag") {
2133
- tags2.set(prop.instanceId, prop.value);
2123
+ for (const prop2 of props2.values()) {
2124
+ if (prop2.type === "string" && prop2.name === "tag") {
2125
+ tags2.set(prop2.instanceId, prop2.value);
2134
2126
  }
2135
2127
  }
2136
2128
  return tags2;
2137
2129
  };
2138
2130
  var getHtmlTagFromInstance = ({
2139
- instance,
2131
+ instance: instance2,
2140
2132
  metas,
2141
- props,
2133
+ props: props2,
2142
2134
  htmlTagsByInstanceId
2143
2135
  }) => {
2144
- if (instance.component === "XmlNode") {
2136
+ if (instance2.component === "XmlNode") {
2145
2137
  return;
2146
2138
  }
2147
- if (instance.tag !== void 0) {
2148
- return instance.tag;
2139
+ if (instance2.tag !== void 0) {
2140
+ return instance2.tag;
2149
2141
  }
2150
- const propTag = htmlTagsByInstanceId === void 0 ? props === void 0 ? void 0 : getHtmlTagsFromProps(props).get(instance.id) : htmlTagsByInstanceId.get(instance.id);
2142
+ const propTag = htmlTagsByInstanceId === void 0 ? props2 === void 0 ? void 0 : getHtmlTagsFromProps(props2).get(instance2.id) : htmlTagsByInstanceId.get(instance2.id);
2151
2143
  if (propTag !== void 0) {
2152
2144
  return propTag;
2153
2145
  }
2154
- const meta = metas.get(instance.component);
2146
+ const meta = metas.get(instance2.component);
2155
2147
  const metaTag = Object.keys(meta?.presetStyle ?? {}).at(0);
2156
2148
  return metaTag;
2157
2149
  };
2158
- var getIndexesWithinAncestors = (metas, instances, rootIds) => {
2150
+ var getIndexesWithinAncestors = (metas, instances2, rootIds) => {
2159
2151
  const ancestors = /* @__PURE__ */ new Set();
2160
2152
  for (const meta of metas.values()) {
2161
2153
  if (meta.indexWithinAncestor !== void 0) {
@@ -2163,17 +2155,17 @@ var getIndexesWithinAncestors = (metas, instances, rootIds) => {
2163
2155
  }
2164
2156
  }
2165
2157
  const indexes = /* @__PURE__ */ new Map();
2166
- const traverseInstances2 = (instances2, instanceId, latestIndexes2 = /* @__PURE__ */ new Map()) => {
2167
- const instance = instances2.get(instanceId);
2168
- if (instance === void 0) {
2158
+ const traverseInstances2 = (instances3, instanceId3, latestIndexes2 = /* @__PURE__ */ new Map()) => {
2159
+ const instance2 = instances3.get(instanceId3);
2160
+ if (instance2 === void 0) {
2169
2161
  return;
2170
2162
  }
2171
- const meta = metas.get(instance.component);
2172
- if (ancestors.has(instance.component)) {
2163
+ const meta = metas.get(instance2.component);
2164
+ if (ancestors.has(instance2.component)) {
2173
2165
  latestIndexes2 = new Map(latestIndexes2);
2174
- latestIndexes2.set(instance.component, /* @__PURE__ */ new Map());
2166
+ latestIndexes2.set(instance2.component, /* @__PURE__ */ new Map());
2175
2167
  }
2176
- if (instance.component === blockTemplateComponent) {
2168
+ if (instance2.component === blockTemplateComponent) {
2177
2169
  latestIndexes2 = new Map(latestIndexes2);
2178
2170
  for (const key of latestIndexes2.keys()) {
2179
2171
  latestIndexes2.set(key, /* @__PURE__ */ new Map());
@@ -2182,21 +2174,21 @@ var getIndexesWithinAncestors = (metas, instances, rootIds) => {
2182
2174
  if (meta?.indexWithinAncestor !== void 0) {
2183
2175
  const ancestorIndexes = latestIndexes2.get(meta.indexWithinAncestor);
2184
2176
  if (ancestorIndexes) {
2185
- let index = ancestorIndexes.get(instance.component) ?? -1;
2177
+ let index = ancestorIndexes.get(instance2.component) ?? -1;
2186
2178
  index += 1;
2187
- ancestorIndexes.set(instance.component, index);
2188
- indexes.set(instance.id, index);
2179
+ ancestorIndexes.set(instance2.component, index);
2180
+ indexes.set(instance2.id, index);
2189
2181
  }
2190
2182
  }
2191
- for (const child of instance.children) {
2183
+ for (const child of instance2.children) {
2192
2184
  if (child.type === "id") {
2193
- traverseInstances2(instances2, child.value, latestIndexes2);
2185
+ traverseInstances2(instances3, child.value, latestIndexes2);
2194
2186
  }
2195
2187
  }
2196
2188
  };
2197
2189
  const latestIndexes = /* @__PURE__ */ new Map();
2198
- for (const instanceId of rootIds) {
2199
- traverseInstances2(instances, instanceId, latestIndexes);
2190
+ for (const instanceId3 of rootIds) {
2191
+ traverseInstances2(instances2, instanceId3, latestIndexes);
2200
2192
  }
2201
2193
  return indexes;
2202
2194
  };
@@ -2595,15 +2587,15 @@ var transpileExpression = ({
2595
2587
  const replacements = [];
2596
2588
  const replacementIndexByRange = /* @__PURE__ */ new Map();
2597
2589
  const addReplacement = (start, end, fragment, { replaceExisting = false } = {}) => {
2598
- const range = `${start}:${end}`;
2599
- const existingIndex = replacementIndexByRange.get(range);
2590
+ const range2 = `${start}:${end}`;
2591
+ const existingIndex = replacementIndexByRange.get(range2);
2600
2592
  if (existingIndex !== void 0) {
2601
2593
  if (replaceExisting) {
2602
2594
  replacements[existingIndex] = [start, end, fragment];
2603
2595
  }
2604
2596
  return;
2605
2597
  }
2606
- replacementIndexByRange.set(range, replacements.length);
2598
+ replacementIndexByRange.set(range2, replacements.length);
2607
2599
  replacements.push([start, end, fragment]);
2608
2600
  };
2609
2601
  const replaceIdentifier = (node, assignee) => {
@@ -2723,7 +2715,7 @@ var decodeDataVariableId = (name) => {
2723
2715
  };
2724
2716
  var generateExpression = ({
2725
2717
  expression,
2726
- dataSources,
2718
+ dataSources: dataSources2,
2727
2719
  usedDataSources,
2728
2720
  scope
2729
2721
  }) => {
@@ -2732,7 +2724,7 @@ var generateExpression = ({
2732
2724
  executable: true,
2733
2725
  replaceVariable: (identifier) => {
2734
2726
  const depId = decodeDataVariableId(identifier);
2735
- let dep = depId ? dataSources.get(depId) : void 0;
2727
+ let dep = depId ? dataSources2.get(depId) : void 0;
2736
2728
  if (depId === SYSTEM_VARIABLE_ID) {
2737
2729
  dep = systemParameter;
2738
2730
  }
@@ -2770,85 +2762,85 @@ var isAbsoluteUrl = (href) => {
2770
2762
 
2771
2763
  // src/page-utils.ts
2772
2764
  var ROOT_FOLDER_ID = "root";
2773
- var isPage = (page) => page !== void 0 && "path" in page;
2774
- var isPageTemplate = (page) => page !== void 0 && !("path" in page);
2765
+ var isPage = (page2) => page2 !== void 0 && "path" in page2;
2766
+ var isPageTemplate = (page2) => page2 !== void 0 && !("path" in page2);
2775
2767
  var isRootFolder = ({ id }) => id === ROOT_FOLDER_ID;
2776
- var getPageById = (pages, pageId) => {
2777
- return pages.pages.get(pageId);
2768
+ var getPageById = (pages2, pageId2) => {
2769
+ return pages2.pages.get(pageId2);
2778
2770
  };
2779
- var getFolderById = (pages, folderId) => {
2780
- return pages.folders.get(folderId);
2771
+ var getFolderById = (pages2, folderId2) => {
2772
+ return pages2.folders.get(folderId2);
2781
2773
  };
2782
- var getAllPages = (pages) => {
2783
- return Array.from(pages.pages.values());
2774
+ var getAllPages = (pages2) => {
2775
+ return Array.from(pages2.pages.values());
2784
2776
  };
2785
- var getAllFolders = (pages) => {
2786
- return Array.from(pages.folders.values());
2777
+ var getAllFolders = (pages2) => {
2778
+ return Array.from(pages2.folders.values());
2787
2779
  };
2788
- var getHomePage = (pages) => {
2789
- const homePage = getPageById(pages, pages.homePageId);
2780
+ var getHomePage = (pages2) => {
2781
+ const homePage = getPageById(pages2, pages2.homePageId);
2790
2782
  if (homePage === void 0) {
2791
- throw new Error(`Home page "${pages.homePageId}" was not found.`);
2783
+ throw new Error(`Home page "${pages2.homePageId}" was not found.`);
2792
2784
  }
2793
2785
  return homePage;
2794
2786
  };
2795
- function findPageByIdOrPath(idOrPath, pages, options = {}) {
2796
- if (idOrPath === "" || idOrPath === "/" || idOrPath === pages.homePageId) {
2797
- return getHomePage(pages);
2787
+ function findPageByIdOrPath(idOrPath, pages2, options = {}) {
2788
+ if (idOrPath === "" || idOrPath === "/" || idOrPath === pages2.homePageId) {
2789
+ return getHomePage(pages2);
2798
2790
  }
2799
- const found = getAllPages(pages).find(
2800
- (page) => page.id === idOrPath || getPagePath(page.id, pages) === idOrPath
2791
+ const found = getAllPages(pages2).find(
2792
+ (page2) => page2.id === idOrPath || getPagePath(page2.id, pages2) === idOrPath
2801
2793
  );
2802
2794
  if (found) {
2803
2795
  return found;
2804
2796
  }
2805
2797
  if (options.includeTemplates) {
2806
- return pages.pageTemplates?.get(idOrPath);
2798
+ return pages2.pageTemplates?.get(idOrPath);
2807
2799
  }
2808
2800
  }
2809
2801
  var findParentFolderByChildId = (id, folders) => {
2810
2802
  const folderList = folders instanceof Map ? folders.values() : folders;
2811
- for (const folder of folderList) {
2812
- if (folder.children.includes(id)) {
2813
- return folder;
2803
+ for (const folder2 of folderList) {
2804
+ if (folder2.children.includes(id)) {
2805
+ return folder2;
2814
2806
  }
2815
2807
  }
2816
2808
  };
2817
- var getPagePath = (id, pages) => {
2809
+ var getPagePath = (id, pages2) => {
2818
2810
  const foldersMap = /* @__PURE__ */ new Map();
2819
2811
  const childParentMap = /* @__PURE__ */ new Map();
2820
- for (const folder of getAllFolders(pages)) {
2821
- foldersMap.set(folder.id, folder);
2822
- for (const childId of folder.children) {
2823
- childParentMap.set(childId, folder.id);
2812
+ for (const folder2 of getAllFolders(pages2)) {
2813
+ foldersMap.set(folder2.id, folder2);
2814
+ for (const childId of folder2.children) {
2815
+ childParentMap.set(childId, folder2.id);
2824
2816
  }
2825
2817
  }
2826
2818
  const paths = [];
2827
2819
  let currentId = id;
2828
- const allPages = getAllPages(pages);
2829
- for (const page of allPages) {
2830
- if (page.id === id) {
2831
- paths.push(page.path);
2832
- currentId = childParentMap.get(page.id);
2820
+ const allPages = getAllPages(pages2);
2821
+ for (const page2 of allPages) {
2822
+ if (page2.id === id) {
2823
+ paths.push(page2.path);
2824
+ currentId = childParentMap.get(page2.id);
2833
2825
  break;
2834
2826
  }
2835
2827
  }
2836
2828
  while (currentId) {
2837
- const folder = foldersMap.get(currentId);
2838
- if (folder === void 0) {
2829
+ const folder2 = foldersMap.get(currentId);
2830
+ if (folder2 === void 0) {
2839
2831
  break;
2840
2832
  }
2841
- paths.push(folder.slug);
2833
+ paths.push(folder2.slug);
2842
2834
  currentId = childParentMap.get(currentId);
2843
2835
  }
2844
2836
  return paths.reverse().join("/").replace(/\/+/g, "/");
2845
2837
  };
2846
- var getStaticSiteMapXml = (pages, updatedAt) => {
2847
- const allPages = getAllPages(pages);
2848
- return allPages.filter((page) => (page.meta.documentType ?? "html") === "html").filter(
2849
- (page) => executeExpression(page.meta.excludePageFromSearch) !== true
2850
- ).filter((page) => false === isPathnamePattern(page.path)).map((page) => ({
2851
- path: getPagePath(page.id, pages),
2838
+ var getStaticSiteMapXml = (pages2, updatedAt) => {
2839
+ const allPages = getAllPages(pages2);
2840
+ return allPages.filter((page2) => (page2.meta.documentType ?? "html") === "html").filter(
2841
+ (page2) => executeExpression(page2.meta.excludePageFromSearch) !== true
2842
+ ).filter((page2) => false === isPathnamePattern(page2.path)).map((page2) => ({
2843
+ path: getPagePath(page2.id, pages2),
2852
2844
  lastModified: updatedAt.split("T")[0]
2853
2845
  }));
2854
2846
  };
@@ -2900,34 +2892,34 @@ var createScope = (occupiedIdentifiers = [], normalizeName = normalizeJsName, se
2900
2892
  // src/resources-generator.ts
2901
2893
  var generateResources = ({
2902
2894
  scope,
2903
- page,
2904
- dataSources,
2905
- props,
2906
- resources
2895
+ page: page2,
2896
+ dataSources: dataSources2,
2897
+ props: props2,
2898
+ resources: resources2
2907
2899
  }) => {
2908
2900
  const usedDataSources = /* @__PURE__ */ new Map();
2909
2901
  let generatedRequests = "";
2910
- for (const resource of resources.values()) {
2902
+ for (const resource3 of resources2.values()) {
2911
2903
  let generatedRequest = "";
2912
- const resourceName = scope.getName(resource.id, resource.name);
2904
+ const resourceName = scope.getName(resource3.id, resource3.name);
2913
2905
  generatedRequest += ` const ${resourceName}: ResourceRequest = {
2914
2906
  `;
2915
- generatedRequest += ` name: ${JSON.stringify(resource.name)},
2907
+ generatedRequest += ` name: ${JSON.stringify(resource3.name)},
2916
2908
  `;
2917
- const url = generateExpression({
2918
- expression: resource.url,
2919
- dataSources,
2909
+ const url2 = generateExpression({
2910
+ expression: resource3.url,
2911
+ dataSources: dataSources2,
2920
2912
  usedDataSources,
2921
2913
  scope
2922
2914
  });
2923
- generatedRequest += ` url: ${url},
2915
+ generatedRequest += ` url: ${url2},
2924
2916
  `;
2925
2917
  generatedRequest += ` searchParams: [
2926
2918
  `;
2927
- for (const searchParam of resource.searchParams ?? []) {
2919
+ for (const searchParam of resource3.searchParams ?? []) {
2928
2920
  const value = generateExpression({
2929
2921
  expression: searchParam.value,
2930
- dataSources,
2922
+ dataSources: dataSources2,
2931
2923
  usedDataSources,
2932
2924
  scope
2933
2925
  });
@@ -2936,14 +2928,14 @@ var generateResources = ({
2936
2928
  }
2937
2929
  generatedRequest += ` ],
2938
2930
  `;
2939
- generatedRequest += ` method: "${resource.method}",
2931
+ generatedRequest += ` method: "${resource3.method}",
2940
2932
  `;
2941
2933
  generatedRequest += ` headers: [
2942
2934
  `;
2943
- for (const header2 of resource.headers) {
2935
+ for (const header2 of resource3.headers) {
2944
2936
  const value = generateExpression({
2945
2937
  expression: header2.value,
2946
- dataSources,
2938
+ dataSources: dataSources2,
2947
2939
  usedDataSources,
2948
2940
  scope
2949
2941
  });
@@ -2952,10 +2944,10 @@ var generateResources = ({
2952
2944
  }
2953
2945
  generatedRequest += ` ],
2954
2946
  `;
2955
- if (resource.body !== void 0 && resource.body.length > 0) {
2947
+ if (resource3.body !== void 0 && resource3.body.length > 0) {
2956
2948
  const body2 = generateExpression({
2957
- expression: resource.body,
2958
- dataSources,
2949
+ expression: resource3.body,
2950
+ dataSources: dataSources2,
2959
2951
  usedDataSources,
2960
2952
  scope
2961
2953
  });
@@ -2967,16 +2959,16 @@ var generateResources = ({
2967
2959
  generatedRequests += generatedRequest;
2968
2960
  }
2969
2961
  let generatedVariables = "";
2970
- for (const dataSource of usedDataSources.values()) {
2971
- if (dataSource.type === "variable") {
2972
- const name = scope.getName(dataSource.id, dataSource.name);
2973
- const value = JSON.stringify(dataSource.value.value);
2962
+ for (const dataSource2 of usedDataSources.values()) {
2963
+ if (dataSource2.type === "variable") {
2964
+ const name = scope.getName(dataSource2.id, dataSource2.name);
2965
+ const value = JSON.stringify(dataSource2.value.value);
2974
2966
  generatedVariables += ` let ${name} = ${value}
2975
2967
  `;
2976
2968
  }
2977
- if (dataSource.type === "parameter") {
2978
- if (dataSource.id === page.systemDataSourceId || dataSource.id === SYSTEM_VARIABLE_ID) {
2979
- const name = scope.getName(dataSource.id, dataSource.name);
2969
+ if (dataSource2.type === "parameter") {
2970
+ if (dataSource2.id === page2.systemDataSourceId || dataSource2.id === SYSTEM_VARIABLE_ID) {
2971
+ const name = scope.getName(dataSource2.id, dataSource2.name);
2980
2972
  generatedVariables += ` const ${name} = _props.system
2981
2973
  `;
2982
2974
  }
@@ -2991,9 +2983,9 @@ var generateResources = ({
2991
2983
  generated += generatedRequests;
2992
2984
  generated += ` const _data = new Map<string, ResourceRequest>([
2993
2985
  `;
2994
- for (const dataSource of dataSources.values()) {
2995
- if (dataSource.type === "resource") {
2996
- const name = scope.getName(dataSource.resourceId, dataSource.name);
2986
+ for (const dataSource2 of dataSources2.values()) {
2987
+ if (dataSource2.type === "resource") {
2988
+ const name = scope.getName(dataSource2.resourceId, dataSource2.name);
2997
2989
  generated += ` ["${name}", ${name}],
2998
2990
  `;
2999
2991
  }
@@ -3002,9 +2994,9 @@ var generateResources = ({
3002
2994
  `;
3003
2995
  generated += ` const _action = new Map<string, ResourceRequest>([
3004
2996
  `;
3005
- for (const prop of props.values()) {
3006
- if (prop.type === "resource") {
3007
- const name = scope.getName(prop.value, prop.name);
2997
+ for (const prop2 of props2.values()) {
2998
+ if (prop2.type === "resource") {
2999
+ const name = scope.getName(prop2.value, prop2.name);
3008
3000
  generated += ` ["${name}", ${name}],
3009
3001
  `;
3010
3002
  }
@@ -3030,44 +3022,44 @@ var getMethod = (value) => {
3030
3022
  }
3031
3023
  };
3032
3024
  var replaceFormActionsWithResources = ({
3033
- props,
3034
- instances,
3035
- resources
3025
+ props: props2,
3026
+ instances: instances2,
3027
+ resources: resources2
3036
3028
  }) => {
3037
3029
  const formProps = /* @__PURE__ */ new Map();
3038
- for (const prop of props.values()) {
3039
- if (prop.name === "method" && prop.type === "string" && instances.get(prop.instanceId)?.component === "Form") {
3040
- let data = formProps.get(prop.instanceId);
3030
+ for (const prop2 of props2.values()) {
3031
+ if (prop2.name === "method" && prop2.type === "string" && instances2.get(prop2.instanceId)?.component === "Form") {
3032
+ let data = formProps.get(prop2.instanceId);
3041
3033
  if (data === void 0) {
3042
3034
  data = {};
3043
- formProps.set(prop.instanceId, data);
3035
+ formProps.set(prop2.instanceId, data);
3044
3036
  }
3045
- data.method = prop.value;
3046
- props.delete(prop.id);
3037
+ data.method = prop2.value;
3038
+ props2.delete(prop2.id);
3047
3039
  }
3048
- if (prop.name === "action" && prop.type === "string" && prop.value && instances.get(prop.instanceId)?.component === "Form") {
3049
- let data = formProps.get(prop.instanceId);
3040
+ if (prop2.name === "action" && prop2.type === "string" && prop2.value && instances2.get(prop2.instanceId)?.component === "Form") {
3041
+ let data = formProps.get(prop2.instanceId);
3050
3042
  if (data === void 0) {
3051
3043
  data = {};
3052
- formProps.set(prop.instanceId, data);
3044
+ formProps.set(prop2.instanceId, data);
3053
3045
  }
3054
- data.action = prop.value;
3055
- props.set(prop.id, {
3056
- id: prop.id,
3057
- instanceId: prop.instanceId,
3058
- name: prop.name,
3046
+ data.action = prop2.value;
3047
+ props2.set(prop2.id, {
3048
+ id: prop2.id,
3049
+ instanceId: prop2.instanceId,
3050
+ name: prop2.name,
3059
3051
  type: "resource",
3060
- value: prop.instanceId
3052
+ value: prop2.instanceId
3061
3053
  });
3062
3054
  }
3063
3055
  }
3064
- for (const [instanceId, { action, method }] of formProps) {
3065
- if (action) {
3066
- resources.set(instanceId, {
3067
- id: instanceId,
3056
+ for (const [instanceId3, { action: action2, method: method2 }] of formProps) {
3057
+ if (action2) {
3058
+ resources2.set(instanceId3, {
3059
+ id: instanceId3,
3068
3060
  name: "action",
3069
- method: getMethod(method),
3070
- url: JSON.stringify(action),
3061
+ method: getMethod(method2),
3062
+ url: JSON.stringify(action2),
3071
3063
  headers: [
3072
3064
  { name: "Content-Type", value: JSON.stringify("application/json") }
3073
3065
  ]
@@ -3079,74 +3071,74 @@ var replaceFormActionsWithResources = ({
3079
3071
  // src/page-meta-generator.ts
3080
3072
  var generatePageMeta = ({
3081
3073
  globalScope,
3082
- page,
3083
- dataSources,
3084
- assets
3074
+ page: page2,
3075
+ dataSources: dataSources2,
3076
+ assets: assets2
3085
3077
  }) => {
3086
3078
  const localScope = createScope(["system", "resources"]);
3087
3079
  const usedDataSources = /* @__PURE__ */ new Map();
3088
3080
  const titleExpression = generateExpression({
3089
- expression: page.title,
3090
- dataSources,
3081
+ expression: page2.title,
3082
+ dataSources: dataSources2,
3091
3083
  usedDataSources,
3092
3084
  scope: localScope
3093
3085
  });
3094
3086
  const descriptionExpression = generateExpression({
3095
- expression: page.meta.description ?? "undefined",
3096
- dataSources,
3087
+ expression: page2.meta.description ?? "undefined",
3088
+ dataSources: dataSources2,
3097
3089
  usedDataSources,
3098
3090
  scope: localScope
3099
3091
  });
3100
3092
  const excludePageFromSearchExpression = generateExpression({
3101
- expression: page.meta.excludePageFromSearch ?? "undefined",
3102
- dataSources,
3093
+ expression: page2.meta.excludePageFromSearch ?? "undefined",
3094
+ dataSources: dataSources2,
3103
3095
  usedDataSources,
3104
3096
  scope: localScope
3105
3097
  });
3106
3098
  const languageExpression = generateExpression({
3107
- expression: page.meta.language ?? "undefined",
3108
- dataSources,
3099
+ expression: page2.meta.language ?? "undefined",
3100
+ dataSources: dataSources2,
3109
3101
  usedDataSources,
3110
3102
  scope: localScope
3111
3103
  });
3112
3104
  const socialImageAssetNameExpression = JSON.stringify(
3113
- page.meta.socialImageAssetId ? assets.get(page.meta.socialImageAssetId)?.name : void 0
3105
+ page2.meta.socialImageAssetId ? assets2.get(page2.meta.socialImageAssetId)?.name : void 0
3114
3106
  );
3115
3107
  const socialImageUrlExpression = generateExpression({
3116
- expression: page.meta.socialImageUrl ?? "undefined",
3117
- dataSources,
3108
+ expression: page2.meta.socialImageUrl ?? "undefined",
3109
+ dataSources: dataSources2,
3118
3110
  usedDataSources,
3119
3111
  scope: localScope
3120
3112
  });
3121
3113
  const statusExpression = generateExpression({
3122
- expression: page.meta.status ?? "undefined",
3123
- dataSources,
3114
+ expression: page2.meta.status ?? "undefined",
3115
+ dataSources: dataSources2,
3124
3116
  usedDataSources,
3125
3117
  scope: localScope
3126
3118
  });
3127
3119
  const redirectExpression = generateExpression({
3128
- expression: page.meta.redirect ?? "undefined",
3129
- dataSources,
3120
+ expression: page2.meta.redirect ?? "undefined",
3121
+ dataSources: dataSources2,
3130
3122
  usedDataSources,
3131
3123
  scope: localScope
3132
3124
  });
3133
3125
  const contentExpression = generateExpression({
3134
- expression: page.meta.content ?? "undefined",
3135
- dataSources,
3126
+ expression: page2.meta.content ?? "undefined",
3127
+ dataSources: dataSources2,
3136
3128
  usedDataSources,
3137
3129
  scope: localScope
3138
3130
  });
3139
3131
  let customExpression = "";
3140
3132
  customExpression += `[
3141
3133
  `;
3142
- for (const customMeta of page.meta.custom ?? []) {
3134
+ for (const customMeta of page2.meta.custom ?? []) {
3143
3135
  if (customMeta.property.trim().length === 0) {
3144
3136
  continue;
3145
3137
  }
3146
3138
  const propertyExpression = JSON.stringify(customMeta.property);
3147
3139
  const contentExpression2 = generateExpression({
3148
3140
  expression: customMeta.content,
3149
- dataSources,
3141
+ dataSources: dataSources2,
3150
3142
  usedDataSources,
3151
3143
  scope: localScope
3152
3144
  });
@@ -3175,27 +3167,27 @@ var generatePageMeta = ({
3175
3167
  `;
3176
3168
  generated += `}): PageMeta => {
3177
3169
  `;
3178
- for (const dataSource of usedDataSources.values()) {
3179
- if (dataSource.type === "variable") {
3180
- const valueName = localScope.getName(dataSource.id, dataSource.name);
3181
- const initialValueString = JSON.stringify(dataSource.value.value);
3170
+ for (const dataSource2 of usedDataSources.values()) {
3171
+ if (dataSource2.type === "variable") {
3172
+ const valueName = localScope.getName(dataSource2.id, dataSource2.name);
3173
+ const initialValueString = JSON.stringify(dataSource2.value.value);
3182
3174
  generated += ` let ${valueName} = ${initialValueString}
3183
3175
  `;
3184
3176
  continue;
3185
3177
  }
3186
- if (dataSource.type === "parameter") {
3187
- if (dataSource.id === page.systemDataSourceId || dataSource.id === SYSTEM_VARIABLE_ID) {
3188
- const valueName = localScope.getName(dataSource.id, dataSource.name);
3178
+ if (dataSource2.type === "parameter") {
3179
+ if (dataSource2.id === page2.systemDataSourceId || dataSource2.id === SYSTEM_VARIABLE_ID) {
3180
+ const valueName = localScope.getName(dataSource2.id, dataSource2.name);
3189
3181
  generated += ` let ${valueName} = system
3190
3182
  `;
3191
3183
  }
3192
3184
  continue;
3193
3185
  }
3194
- if (dataSource.type === "resource") {
3195
- const valueName = localScope.getName(dataSource.id, dataSource.name);
3186
+ if (dataSource2.type === "resource") {
3187
+ const valueName = localScope.getName(dataSource2.id, dataSource2.name);
3196
3188
  const resourceName = globalScope.getName(
3197
- dataSource.resourceId,
3198
- dataSource.name
3189
+ dataSource2.resourceId,
3190
+ dataSource2.name
3199
3191
  );
3200
3192
  generated += ` let ${valueName} = resources.${resourceName}
3201
3193
  `;
@@ -3263,13 +3255,13 @@ import {
3263
3255
  import { getFontFaces } from "@webstudio-is/fonts";
3264
3256
  var addFontRules = ({
3265
3257
  sheet,
3266
- assets,
3258
+ assets: assets2,
3267
3259
  assetBaseUrl
3268
3260
  }) => {
3269
3261
  const fontAssets = [];
3270
- for (const asset of assets.values()) {
3271
- if (asset.type === "font") {
3272
- fontAssets.push(asset);
3262
+ for (const asset2 of assets2.values()) {
3263
+ if (asset2.type === "font") {
3264
+ fontAssets.push(asset2);
3273
3265
  }
3274
3266
  }
3275
3267
  const fontFaces = getFontFaces(fontAssets, { assetBaseUrl });
@@ -3277,31 +3269,31 @@ var addFontRules = ({
3277
3269
  sheet.addFontFaceRule(fontFace);
3278
3270
  }
3279
3271
  };
3280
- var createImageValueTransformer = (assets, { assetBaseUrl }) => (styleValue) => {
3281
- if (styleValue.type === "image" && styleValue.value.type === "asset") {
3282
- const asset = assets.get(styleValue.value.value);
3283
- if (asset === void 0) {
3272
+ var createImageValueTransformer = (assets2, { assetBaseUrl }) => (styleValue4) => {
3273
+ if (styleValue4.type === "image" && styleValue4.value.type === "asset") {
3274
+ const asset2 = assets2.get(styleValue4.value.value);
3275
+ if (asset2 === void 0) {
3284
3276
  return { type: "keyword", value: "none" };
3285
3277
  }
3286
- const url = `${assetBaseUrl}${asset.name}`;
3278
+ const url2 = `${assetBaseUrl}${asset2.name}`;
3287
3279
  return {
3288
3280
  type: "image",
3289
3281
  value: {
3290
3282
  type: "url",
3291
- url
3283
+ url: url2
3292
3284
  },
3293
- hidden: styleValue.hidden
3285
+ hidden: styleValue4.hidden
3294
3286
  };
3295
3287
  }
3296
3288
  };
3297
3289
  var normalizeClassName = (name) => kebabCase(name);
3298
3290
  var generateCss = ({
3299
- assets,
3300
- instances,
3301
- props,
3302
- breakpoints,
3303
- styles,
3304
- styleSourceSelections,
3291
+ assets: assets2,
3292
+ instances: instances2,
3293
+ props: props2,
3294
+ breakpoints: breakpoints2,
3295
+ styles: styles2,
3296
+ styleSourceSelections: styleSourceSelections2,
3305
3297
  componentMetas,
3306
3298
  assetBaseUrl,
3307
3299
  atomic
@@ -3309,27 +3301,27 @@ var generateCss = ({
3309
3301
  const fontSheet = createRegularStyleSheet({ name: "ssr" });
3310
3302
  const presetSheet = createRegularStyleSheet({ name: "ssr" });
3311
3303
  const userSheet = createRegularStyleSheet({ name: "ssr" });
3312
- addFontRules({ sheet: fontSheet, assets, assetBaseUrl });
3304
+ addFontRules({ sheet: fontSheet, assets: assets2, assetBaseUrl });
3313
3305
  presetSheet.addMediaRule("presets");
3314
3306
  const presetClasses = /* @__PURE__ */ new Map();
3315
3307
  const scope = createScope([], normalizeClassName, "-");
3316
3308
  const tagsByComponent = /* @__PURE__ */ new Map();
3317
3309
  tagsByComponent.set(rootComponent, /* @__PURE__ */ new Set(["html"]));
3318
- const htmlTagsByInstanceId = getHtmlTagsFromProps(props);
3319
- for (const instance of instances.values()) {
3320
- let componentTags = tagsByComponent.get(instance.component);
3310
+ const htmlTagsByInstanceId = getHtmlTagsFromProps(props2);
3311
+ for (const instance2 of instances2.values()) {
3312
+ let componentTags = tagsByComponent.get(instance2.component);
3321
3313
  if (componentTags === void 0) {
3322
3314
  componentTags = /* @__PURE__ */ new Set();
3323
- tagsByComponent.set(instance.component, componentTags);
3315
+ tagsByComponent.set(instance2.component, componentTags);
3324
3316
  }
3325
- const tag = getHtmlTagFromInstance({
3326
- instance,
3317
+ const tag2 = getHtmlTagFromInstance({
3318
+ instance: instance2,
3327
3319
  metas: componentMetas,
3328
- props,
3320
+ props: props2,
3329
3321
  htmlTagsByInstanceId
3330
3322
  });
3331
- if (tag) {
3332
- componentTags.add(tag);
3323
+ if (tag2) {
3324
+ componentTags.add(tag2);
3333
3325
  }
3334
3326
  }
3335
3327
  for (const [component, meta] of componentMetas) {
@@ -3340,13 +3332,13 @@ var generateCss = ({
3340
3332
  if (presetStyle.length > 0) {
3341
3333
  presetClasses.set(component, className);
3342
3334
  }
3343
- for (const [tag, styles2] of presetStyle) {
3344
- if (!componentTags?.has(tag)) {
3335
+ for (const [tag2, styles3] of presetStyle) {
3336
+ if (!componentTags?.has(tag2)) {
3345
3337
  continue;
3346
3338
  }
3347
- const selector = component === rootComponent ? ":root" : `${tag}.${className}`;
3339
+ const selector = component === rootComponent ? ":root" : `${tag2}.${className}`;
3348
3340
  const rule = presetSheet.addNestingRule(selector);
3349
- for (const declaration of styles2) {
3341
+ for (const declaration of styles3) {
3350
3342
  rule.setDeclaration({
3351
3343
  breakpoint: "presets",
3352
3344
  selector: declaration.state ?? "",
@@ -3356,78 +3348,78 @@ var generateCss = ({
3356
3348
  }
3357
3349
  }
3358
3350
  }
3359
- for (const breakpoint of breakpoints.values()) {
3360
- userSheet.addMediaRule(breakpoint.id, breakpoint);
3351
+ for (const breakpoint2 of breakpoints2.values()) {
3352
+ userSheet.addMediaRule(breakpoint2.id, breakpoint2);
3361
3353
  }
3362
- const imageValueTransformer = createImageValueTransformer(assets, {
3354
+ const imageValueTransformer = createImageValueTransformer(assets2, {
3363
3355
  assetBaseUrl
3364
3356
  });
3365
3357
  userSheet.setTransformer(imageValueTransformer);
3366
- for (const styleDecl of styles.values()) {
3367
- const rule = userSheet.addMixinRule(styleDecl.styleSourceId);
3358
+ for (const styleDecl2 of styles2.values()) {
3359
+ const rule = userSheet.addMixinRule(styleDecl2.styleSourceId);
3368
3360
  rule.setDeclaration({
3369
- breakpoint: styleDecl.breakpointId,
3370
- selector: styleDecl.state ?? "",
3371
- property: styleDecl.property,
3372
- value: styleDecl.value
3361
+ breakpoint: styleDecl2.breakpointId,
3362
+ selector: styleDecl2.state ?? "",
3363
+ property: styleDecl2.property,
3364
+ value: styleDecl2.value
3373
3365
  });
3374
3366
  }
3375
3367
  const classes = /* @__PURE__ */ new Map();
3376
3368
  const parentIdByInstanceId = /* @__PURE__ */ new Map();
3377
- for (const instance of instances.values()) {
3378
- const presetClass = presetClasses.get(instance.component);
3369
+ for (const instance2 of instances2.values()) {
3370
+ const presetClass = presetClasses.get(instance2.component);
3379
3371
  if (presetClass) {
3380
- classes.set(instance.id, [presetClass]);
3372
+ classes.set(instance2.id, [presetClass]);
3381
3373
  }
3382
- for (const child of instance.children) {
3374
+ for (const child of instance2.children) {
3383
3375
  if (child.type === "id") {
3384
- parentIdByInstanceId.set(child.value, instance.id);
3376
+ parentIdByInstanceId.set(child.value, instance2.id);
3385
3377
  }
3386
3378
  }
3387
3379
  }
3388
3380
  const descendantSelectorByInstanceId = /* @__PURE__ */ new Map();
3389
- for (const prop of props.values()) {
3390
- if (prop.name === "selector" && prop.type === "string") {
3391
- descendantSelectorByInstanceId.set(prop.instanceId, prop.value);
3381
+ for (const prop2 of props2.values()) {
3382
+ if (prop2.name === "selector" && prop2.type === "string") {
3383
+ descendantSelectorByInstanceId.set(prop2.instanceId, prop2.value);
3392
3384
  }
3393
3385
  }
3394
3386
  const instanceByRule = /* @__PURE__ */ new Map();
3395
- for (const selection of styleSourceSelections.values()) {
3396
- let { instanceId } = selection;
3387
+ for (const selection of styleSourceSelections2.values()) {
3388
+ let { instanceId: instanceId3 } = selection;
3397
3389
  const { values } = selection;
3398
- if (instanceId === ROOT_INSTANCE_ID) {
3390
+ if (instanceId3 === ROOT_INSTANCE_ID) {
3399
3391
  const rule2 = userSheet.addNestingRule(`:root`);
3400
3392
  rule2.applyMixins(values);
3401
3393
  continue;
3402
3394
  }
3403
3395
  let descendantSuffix = "";
3404
- const instance = instances.get(instanceId);
3405
- if (instance === void 0) {
3396
+ const instance2 = instances2.get(instanceId3);
3397
+ if (instance2 === void 0) {
3406
3398
  continue;
3407
3399
  }
3408
- if (instance.component === descendantComponent) {
3409
- const parentId = parentIdByInstanceId.get(instanceId);
3410
- const descendantSelector = descendantSelectorByInstanceId.get(instanceId);
3400
+ if (instance2.component === descendantComponent) {
3401
+ const parentId = parentIdByInstanceId.get(instanceId3);
3402
+ const descendantSelector = descendantSelectorByInstanceId.get(instanceId3);
3411
3403
  if (parentId && descendantSelector) {
3412
3404
  descendantSuffix = descendantSelector;
3413
- instanceId = parentId;
3405
+ instanceId3 = parentId;
3414
3406
  }
3415
3407
  }
3416
- const meta = componentMetas.get(instance.component);
3417
- const [_namespace, shortName] = parseComponentName(instance.component);
3418
- const baseName = instance.label ?? meta?.label ?? shortName;
3419
- const className = `w-${scope.getName(instanceId, baseName)}`;
3408
+ const meta = componentMetas.get(instance2.component);
3409
+ const [_namespace, shortName] = parseComponentName(instance2.component);
3410
+ const baseName = instance2.label ?? meta?.label ?? shortName;
3411
+ const className = `w-${scope.getName(instanceId3, baseName)}`;
3420
3412
  if (atomic === false) {
3421
- let classList = classes.get(instanceId);
3413
+ let classList = classes.get(instanceId3);
3422
3414
  if (classList === void 0) {
3423
3415
  classList = [];
3424
- classes.set(instanceId, classList);
3416
+ classes.set(instanceId3, classList);
3425
3417
  }
3426
3418
  classList.push(className);
3427
3419
  }
3428
3420
  const rule = userSheet.addNestingRule(`.${className}`, descendantSuffix);
3429
3421
  rule.applyMixins(values);
3430
- instanceByRule.set(rule, instanceId);
3422
+ instanceByRule.set(rule, instanceId3);
3431
3423
  }
3432
3424
  const fontCss = fontSheet.cssText;
3433
3425
  const presetCss = presetSheet.cssText.replaceAll(
@@ -3455,102 +3447,67 @@ ${userSheet.cssText}`,
3455
3447
  export {
3456
3448
  ALLOWED_FILE_EXTENSIONS,
3457
3449
  ALLOWED_FILE_TYPES,
3458
- Asset,
3459
- Assets,
3460
- Breakpoint,
3461
- Breakpoints,
3462
- CompilerSettings,
3463
- ComponentState,
3464
- ContentModel,
3465
- DataSource,
3466
- DataSourceVariableValue,
3467
- DataSources,
3468
- Deployment,
3469
- ExpressionChild,
3470
3450
  FILE_EXTENSIONS_BY_CATEGORY,
3471
3451
  FONT_EXTENSIONS,
3472
- FileAsset,
3473
- Folder,
3474
- FolderId,
3475
- FolderName,
3476
- FontAsset,
3477
- HomePagePath,
3478
3452
  IMAGE_EXTENSIONS,
3479
3453
  IMAGE_MIME_TYPES,
3480
- IdChild,
3481
- ImageAsset,
3482
- ImageMeta,
3483
- Instance,
3484
- InstanceChild,
3485
- Instances,
3486
3454
  MIME_CATEGORIES,
3487
- Page,
3488
- PageAuth,
3489
- PageId,
3490
- PageName,
3491
- PagePath,
3492
- PageRedirect,
3493
- PageTemplate,
3494
- PageTitle,
3495
- Pages,
3496
- PresetStyleDecl,
3497
- ProjectMeta,
3498
- ProjectNewRedirectPath,
3499
- Prop,
3500
- PropMeta,
3501
- Props,
3502
3455
  RANGE_UNITS,
3503
3456
  RESIZABLE_IMAGE_MIME_TYPES,
3504
3457
  ROOT_FOLDER_ID,
3505
3458
  ROOT_INSTANCE_ID,
3506
- RedirectSourcePath,
3507
- Resource,
3508
- ResourceRequest,
3509
- Resources,
3510
3459
  SYSTEM_VARIABLE_ID,
3511
- StyleDecl,
3512
- StyleSource,
3513
- StyleSourceSelection,
3514
- StyleSourceSelections,
3515
- StyleSources,
3516
- Styles,
3517
- Templates,
3518
- TextChild,
3519
3460
  VIDEO_EXTENSIONS,
3520
3461
  VIDEO_MIME_TYPES,
3521
- WebstudioFragment,
3522
- WsComponentMeta,
3523
3462
  acceptToMimeCategories,
3524
3463
  acceptToMimePatterns,
3525
3464
  addFontRules,
3526
3465
  allowedArrayMethods,
3527
3466
  allowedStringMethods,
3528
- animationActionSchema,
3529
- animationKeyframeSchema,
3467
+ animationAction,
3468
+ animationKeyframe,
3469
+ asset,
3470
+ assetType,
3471
+ assets,
3530
3472
  blockComponent,
3531
3473
  blockTemplateComponent,
3532
3474
  blockTemplateMeta,
3475
+ breakpoint,
3476
+ breakpoints,
3533
3477
  collectionComponent,
3478
+ compilerSettings,
3534
3479
  componentCategories,
3480
+ componentState,
3481
+ contentModel,
3535
3482
  coreMetas,
3536
3483
  createImageValueTransformer,
3537
3484
  createScope,
3485
+ dataSource,
3486
+ dataSourceVariableValue,
3487
+ dataSources,
3538
3488
  decodeDataVariableId as decodeDataSourceVariable,
3539
3489
  decodeDataVariableId,
3540
3490
  decodePathFragment,
3491
+ deployment,
3541
3492
  descendantComponent,
3542
3493
  detectAssetType,
3543
3494
  documentTypes,
3544
3495
  doesAssetMatchMimePatterns,
3545
- durationUnitValueSchema,
3496
+ durationUnitValue,
3546
3497
  elementComponent,
3547
3498
  encodeDataVariableId as encodeDataSourceVariable,
3548
3499
  encodeDataVariableId,
3549
3500
  executeExpression,
3501
+ expressionChild,
3502
+ fileAsset,
3550
3503
  findPageByIdOrPath,
3551
3504
  findParentFolderByChildId,
3552
3505
  findTreeInstanceIds,
3553
3506
  findTreeInstanceIdsExcludingSlotDescendants,
3507
+ folder,
3508
+ folderId,
3509
+ folderName,
3510
+ fontAsset,
3554
3511
  generateCss,
3555
3512
  generateExpression,
3556
3513
  generateObjectExpression,
@@ -3573,8 +3530,15 @@ export {
3573
3530
  getPagePath,
3574
3531
  getStaticSiteMapXml,
3575
3532
  getStyleDeclKey,
3533
+ homePagePath,
3534
+ idChild,
3535
+ imageAsset,
3536
+ imageMeta,
3576
3537
  initialBreakpoints,
3577
- insetUnitValueSchema,
3538
+ insetUnitValue,
3539
+ instance,
3540
+ instanceChild,
3541
+ instances,
3578
3542
  isAbsoluteUrl,
3579
3543
  isAllowedExtension,
3580
3544
  isAllowedMimeCategory,
@@ -3589,18 +3553,47 @@ export {
3589
3553
  isRootFolder,
3590
3554
  lintExpression,
3591
3555
  matchPathnameParams,
3556
+ page,
3557
+ pageAuth,
3558
+ pageId,
3559
+ pageName,
3560
+ pagePath,
3561
+ pageRedirect,
3562
+ pageTemplate,
3563
+ pageTitle,
3564
+ pages,
3592
3565
  parseComponentName,
3593
3566
  parseObjectExpression,
3594
3567
  portalComponent,
3595
- rangeUnitValueSchema,
3568
+ presetStyleDecl,
3569
+ projectMeta,
3570
+ projectNewRedirectPath,
3571
+ prop,
3572
+ propMeta,
3573
+ props,
3574
+ rangeUnitValue,
3575
+ redirectSourcePath,
3596
3576
  replaceFormActionsWithResources,
3597
3577
  resolveLocalLinkUrl,
3578
+ resource,
3579
+ resourceRequest,
3580
+ resources,
3598
3581
  rootComponent,
3599
- scrollAnimationSchema,
3582
+ scrollAnimation,
3583
+ styleDecl,
3584
+ styleSource,
3585
+ styleSourceSelection,
3586
+ styleSourceSelections,
3587
+ styleSources,
3588
+ styles,
3600
3589
  systemParameter,
3601
3590
  tags,
3591
+ templates,
3592
+ textChild,
3602
3593
  toRuntimeAsset,
3603
3594
  transpileExpression,
3604
3595
  validateFileName,
3605
- viewAnimationSchema
3596
+ viewAnimation,
3597
+ webstudioFragment,
3598
+ wsComponentMeta
3606
3599
  };