@webstudio-is/sdk 0.0.0-c1d6247 → 0.0.0-ca00e2a

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.
@@ -13,24 +13,25 @@ import {
13
13
  ListViewIcon,
14
14
  PaintBrushIcon,
15
15
  SettingsIcon,
16
- AddTemplateInstanceIcon
16
+ AddTemplateInstanceIcon,
17
+ HtmlElementIcon
17
18
  } from "@webstudio-is/icons/svg";
18
19
 
19
20
  // src/__generated__/normalize.css.ts
20
21
  var html = [
21
22
  { property: "display", value: { type: "keyword", value: "grid" } },
22
- { property: "minHeight", value: { type: "unit", unit: "%", value: 100 } },
23
+ { property: "min-height", value: { type: "unit", unit: "%", value: 100 } },
23
24
  {
24
- property: "fontFamily",
25
+ property: "font-family",
25
26
  value: { type: "fontFamily", value: ["Arial", "Roboto", "sans-serif"] }
26
27
  },
27
- { property: "fontSize", value: { type: "unit", unit: "px", value: 16 } },
28
+ { property: "font-size", value: { type: "unit", unit: "px", value: 16 } },
28
29
  {
29
- property: "lineHeight",
30
+ property: "line-height",
30
31
  value: { type: "unit", unit: "number", value: 1.2 }
31
32
  },
32
33
  {
33
- property: "whiteSpaceCollapse",
34
+ property: "white-space-collapse",
34
35
  value: { type: "keyword", value: "preserve" }
35
36
  }
36
37
  ];
@@ -38,7 +39,6 @@ var html = [
38
39
  // src/core-metas.ts
39
40
  var rootComponent = "ws:root";
40
41
  var rootMeta = {
41
- type: "container",
42
42
  label: "Global Root",
43
43
  icon: SettingsIcon,
44
44
  presetStyle: {
@@ -48,11 +48,22 @@ var rootMeta = {
48
48
  var rootPropsMeta = {
49
49
  props: {}
50
50
  };
51
+ var elementComponent = "ws:element";
52
+ var elementMeta = {
53
+ label: "Element",
54
+ icon: HtmlElementIcon
55
+ };
56
+ var elementPropsMeta = {
57
+ props: {}
58
+ };
51
59
  var collectionComponent = "ws:collection";
52
60
  var collectionMeta = {
53
- type: "container",
54
61
  label: "Collection",
55
- icon: ListViewIcon
62
+ icon: ListViewIcon,
63
+ contentModel: {
64
+ category: "instance",
65
+ children: ["instance"]
66
+ }
56
67
  };
57
68
  var collectionPropsMeta = {
58
69
  props: {
@@ -66,15 +77,14 @@ var collectionPropsMeta = {
66
77
  };
67
78
  var descendantComponent = "ws:descendant";
68
79
  var descendantMeta = {
69
- type: "control",
70
80
  label: "Descendant",
71
81
  icon: PaintBrushIcon,
82
+ contentModel: {
83
+ category: "none",
84
+ children: []
85
+ },
72
86
  // @todo infer possible presets
73
- presetStyle: {},
74
- constraints: {
75
- relation: "parent",
76
- component: { $in: ["HtmlEmbed", "MarkdownEmbed"] }
77
- }
87
+ presetStyle: {}
78
88
  };
79
89
  var descendantPropsMeta = {
80
90
  props: {
@@ -107,36 +117,29 @@ var descendantPropsMeta = {
107
117
  var blockComponent = "ws:block";
108
118
  var blockTemplateComponent = "ws:block-template";
109
119
  var blockTemplateMeta = {
110
- type: "container",
111
120
  icon: AddTemplateInstanceIcon,
112
- constraints: {
113
- relation: "parent",
114
- component: { $eq: blockComponent }
121
+ contentModel: {
122
+ category: "none",
123
+ children: ["instance"]
115
124
  }
116
125
  };
117
126
  var blockTemplatePropsMeta = {
118
127
  props: {}
119
128
  };
120
129
  var blockMeta = {
121
- type: "container",
122
130
  label: "Content Block",
123
131
  icon: ContentBlockIcon,
124
- constraints: [
125
- {
126
- relation: "ancestor",
127
- component: { $nin: [collectionComponent, blockComponent] }
128
- },
129
- {
130
- relation: "child",
131
- component: { $eq: blockTemplateComponent }
132
- }
133
- ]
132
+ contentModel: {
133
+ category: "instance",
134
+ children: [blockTemplateComponent, "instance"]
135
+ }
134
136
  };
135
137
  var blockPropsMeta = {
136
138
  props: {}
137
139
  };
138
140
  var coreMetas = {
139
141
  [rootComponent]: rootMeta,
142
+ [elementComponent]: elementMeta,
140
143
  [collectionComponent]: collectionMeta,
141
144
  [descendantComponent]: descendantMeta,
142
145
  [blockComponent]: blockMeta,
@@ -144,6 +147,7 @@ var coreMetas = {
144
147
  };
145
148
  var corePropsMetas = {
146
149
  [rootComponent]: rootPropsMeta,
150
+ [elementComponent]: elementPropsMeta,
147
151
  [collectionComponent]: collectionPropsMeta,
148
152
  [descendantComponent]: descendantPropsMeta,
149
153
  [blockComponent]: blockPropsMeta,
@@ -175,12 +179,12 @@ var blockMeta2 = {
175
179
  template: /* @__PURE__ */ jsxs(ws.block, { children: [
176
180
  /* @__PURE__ */ jsxs(BlockTemplate, { "ws:label": "Templates", children: [
177
181
  /* @__PURE__ */ jsx($.Paragraph, {}),
178
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 1", tag: "h1" }),
179
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 2", tag: "h2" }),
180
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 3", tag: "h3" }),
181
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 4", tag: "h4" }),
182
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 5", tag: "h5" }),
183
- /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 6", tag: "h6" }),
182
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 1", "ws:tag": "h1" }),
183
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 2", "ws:tag": "h2" }),
184
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 3", "ws:tag": "h3" }),
185
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 4", "ws:tag": "h4" }),
186
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 5", "ws:tag": "h5" }),
187
+ /* @__PURE__ */ jsx($.Heading, { "ws:label": "Heading 6", "ws:tag": "h6" }),
184
188
  /* @__PURE__ */ jsx($.List, { "ws:label": "List (Unordered)", children: /* @__PURE__ */ jsx($.ListItem, {}) }),
185
189
  /* @__PURE__ */ jsx($.List, { "ws:label": "List (Ordered)", ordered: true, children: /* @__PURE__ */ jsx($.ListItem, {}) }),
186
190
  /* @__PURE__ */ jsx($.Link, {}),