@arkcit/engine-react 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1354,6 +1354,43 @@ var configurePreviewLinkBehavior = (componentProps) => {
1354
1354
  // src/rendering/finalizeRenderedNode.tsx
1355
1355
  var RESPONSIVE_MEDIA_NODE_TYPES = /* @__PURE__ */ new Set(["Image", "Video", "EmbeddedVideo", "Cover", "Document"]);
1356
1356
  var RESPONSIVE_MEDIA_CLASS_NAME = "max-md:!w-full max-md:![flex-basis:100%!important] max-md:!h-auto";
1357
+ var RESPONSIVE_TEXT_NODE_TYPES = /* @__PURE__ */ new Set([
1358
+ "Typography",
1359
+ "H1",
1360
+ "H2",
1361
+ "H3",
1362
+ "Text",
1363
+ "Muted",
1364
+ "Lead",
1365
+ "Code"
1366
+ ]);
1367
+ var RESPONSIVE_AUTO_HEIGHT_NODE_TYPES = /* @__PURE__ */ new Set([
1368
+ ...RESPONSIVE_MEDIA_NODE_TYPES,
1369
+ ...RESPONSIVE_TEXT_NODE_TYPES,
1370
+ "Accordion",
1371
+ "BookingCalendar",
1372
+ "Button",
1373
+ "Breadcrumb",
1374
+ "Link",
1375
+ "Card",
1376
+ "Carousel",
1377
+ "ContentSlider",
1378
+ "Cover",
1379
+ "DataGrid",
1380
+ "ExpandablePanel",
1381
+ "FilterBar",
1382
+ "Form",
1383
+ "FormWizard",
1384
+ "Grid",
1385
+ "Container",
1386
+ "MapCard",
1387
+ "Pagination",
1388
+ "QRCode",
1389
+ "Slider",
1390
+ "Table",
1391
+ "Tabs"
1392
+ ]);
1393
+ var RESPONSIVE_TEXT_CLASS_NAME = "max-md:!h-auto";
1357
1394
  var hasExplicitStudioSizing = (studioSizing) => Boolean(
1358
1395
  studioSizing && (studioSizing.widthPct !== null || studioSizing.heightPct !== null || studioSizing.heightPx !== null)
1359
1396
  );
@@ -1372,6 +1409,10 @@ var finalizeRenderedNode = ({
1372
1409
  const currentClassName = typeof componentProps.className === "string" ? componentProps.className : "";
1373
1410
  componentProps.className = [currentClassName, RESPONSIVE_MEDIA_CLASS_NAME].filter(Boolean).join(" ");
1374
1411
  }
1412
+ if (RESPONSIVE_AUTO_HEIGHT_NODE_TYPES.has(node.type) && hasExplicitStudioSizing(studioSizing)) {
1413
+ const currentClassName = typeof componentProps.className === "string" ? componentProps.className : "";
1414
+ componentProps.className = [currentClassName, RESPONSIVE_TEXT_CLASS_NAME].filter(Boolean).join(" ");
1415
+ }
1375
1416
  const plans = providedPlans != null ? providedPlans : dependencies.resolveFinalRenderPlan({
1376
1417
  node,
1377
1418
  componentProps,
package/dist/rendering.js CHANGED
@@ -176,6 +176,43 @@ var materializeBoundTable = ({
176
176
  // src/rendering/finalizeRenderedNode.tsx
177
177
  var RESPONSIVE_MEDIA_NODE_TYPES = /* @__PURE__ */ new Set(["Image", "Video", "EmbeddedVideo", "Cover", "Document"]);
178
178
  var RESPONSIVE_MEDIA_CLASS_NAME = "max-md:!w-full max-md:![flex-basis:100%!important] max-md:!h-auto";
179
+ var RESPONSIVE_TEXT_NODE_TYPES = /* @__PURE__ */ new Set([
180
+ "Typography",
181
+ "H1",
182
+ "H2",
183
+ "H3",
184
+ "Text",
185
+ "Muted",
186
+ "Lead",
187
+ "Code"
188
+ ]);
189
+ var RESPONSIVE_AUTO_HEIGHT_NODE_TYPES = /* @__PURE__ */ new Set([
190
+ ...RESPONSIVE_MEDIA_NODE_TYPES,
191
+ ...RESPONSIVE_TEXT_NODE_TYPES,
192
+ "Accordion",
193
+ "BookingCalendar",
194
+ "Button",
195
+ "Breadcrumb",
196
+ "Link",
197
+ "Card",
198
+ "Carousel",
199
+ "ContentSlider",
200
+ "Cover",
201
+ "DataGrid",
202
+ "ExpandablePanel",
203
+ "FilterBar",
204
+ "Form",
205
+ "FormWizard",
206
+ "Grid",
207
+ "Container",
208
+ "MapCard",
209
+ "Pagination",
210
+ "QRCode",
211
+ "Slider",
212
+ "Table",
213
+ "Tabs"
214
+ ]);
215
+ var RESPONSIVE_TEXT_CLASS_NAME = "max-md:!h-auto";
179
216
  var hasExplicitStudioSizing = (studioSizing) => Boolean(
180
217
  studioSizing && (studioSizing.widthPct !== null || studioSizing.heightPct !== null || studioSizing.heightPx !== null)
181
218
  );
@@ -194,6 +231,10 @@ var finalizeRenderedNode = ({
194
231
  const currentClassName = typeof componentProps.className === "string" ? componentProps.className : "";
195
232
  componentProps.className = [currentClassName, RESPONSIVE_MEDIA_CLASS_NAME].filter(Boolean).join(" ");
196
233
  }
234
+ if (RESPONSIVE_AUTO_HEIGHT_NODE_TYPES.has(node.type) && hasExplicitStudioSizing(studioSizing)) {
235
+ const currentClassName = typeof componentProps.className === "string" ? componentProps.className : "";
236
+ componentProps.className = [currentClassName, RESPONSIVE_TEXT_CLASS_NAME].filter(Boolean).join(" ");
237
+ }
197
238
  const plans = providedPlans != null ? providedPlans : dependencies.resolveFinalRenderPlan({
198
239
  node,
199
240
  componentProps,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arkcit/engine-react",
3
3
  "private": false,
4
- "version": "0.3.6",
4
+ "version": "0.3.7",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "React-specific renderer package for the Arkcit engine platform.",