@digitalculture/ochre-sdk 0.3.6 → 0.3.8

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.cjs CHANGED
@@ -1527,6 +1527,22 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1527
1527
  if (captionLayout === null) {
1528
1528
  captionLayout = "bottom";
1529
1529
  }
1530
+ let isFullWidth = true;
1531
+ const isFullWidthProperty = getPropertyValueByLabel(
1532
+ componentProperty.properties,
1533
+ "is-full-width"
1534
+ );
1535
+ if (isFullWidthProperty !== null) {
1536
+ isFullWidth = isFullWidthProperty === "Yes";
1537
+ }
1538
+ let isFullHeight = true;
1539
+ const isFullHeightProperty = getPropertyValueByLabel(
1540
+ componentProperty.properties,
1541
+ "is-full-height"
1542
+ );
1543
+ if (isFullHeightProperty !== null) {
1544
+ isFullHeight = isFullHeightProperty === "Yes";
1545
+ }
1530
1546
  let imageQuality = getPropertyValueByLabel(
1531
1547
  componentProperty.properties,
1532
1548
  "image-quality"
@@ -1555,8 +1571,6 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1555
1571
  "variant"
1556
1572
  );
1557
1573
  let secondsPerImage = 5;
1558
- let isFullWidth = false;
1559
- let isFullHeight = false;
1560
1574
  if (variantProperty && variantProperty.values[0].content === "carousel") {
1561
1575
  const secondsPerImageProperty = getPropertyValueByLabel(
1562
1576
  variantProperty.properties,
@@ -1565,30 +1579,16 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1565
1579
  if (secondsPerImageProperty !== null) {
1566
1580
  secondsPerImage = Number.parseFloat(secondsPerImageProperty);
1567
1581
  }
1568
- const isFullWidthProperty = getPropertyValueByLabel(
1569
- variantProperty.properties,
1570
- "is-full-width"
1571
- );
1572
- if (isFullWidthProperty !== null) {
1573
- isFullWidth = isFullWidthProperty === "Yes";
1574
- }
1575
- const isFullHeightProperty = getPropertyValueByLabel(
1576
- variantProperty.properties,
1577
- "is-full-height"
1578
- );
1579
- if (isFullHeightProperty !== null) {
1580
- isFullHeight = isFullHeightProperty === "Yes";
1581
- }
1582
1582
  }
1583
1583
  carouselOptions = {
1584
- secondsPerImage,
1585
- isFullWidth,
1586
- isFullHeight
1584
+ secondsPerImage
1587
1585
  };
1588
1586
  }
1589
1587
  properties.images = images;
1590
1588
  properties.variant = variant;
1591
1589
  properties.carouselOptions = carouselOptions;
1590
+ properties.isFullWidth = isFullWidth;
1591
+ properties.isFullHeight = isFullHeight;
1592
1592
  properties.imageQuality = imageQuality;
1593
1593
  properties.captionLayout = captionLayout;
1594
1594
  properties.captionSource = captionSource;
package/dist/index.d.cts CHANGED
@@ -425,7 +425,7 @@ type WebsiteProperties = {
425
425
  privacy: "public" | "password" | "private";
426
426
  status: "development" | "preview" | "production";
427
427
  isHeaderDisplayed: boolean;
428
- headerVariant: "default" | "floating";
428
+ headerVariant: "default" | "floating" | "inline";
429
429
  headerAlignment: "start" | "center" | "end";
430
430
  isHeaderProjectDisplayed: boolean;
431
431
  isFooterDisplayed: boolean;
@@ -505,10 +505,10 @@ type WebElementComponent = {
505
505
  images: Array<WebImage>;
506
506
  variant: "default" | "carousel";
507
507
  carouselOptions: {
508
- secondsPerImage: number | null;
509
- isFullWidth: boolean | null;
510
- isFullHeight: boolean | null;
508
+ secondsPerImage: number;
511
509
  } | null;
510
+ isFullWidth: boolean;
511
+ isFullHeight: boolean;
512
512
  imageQuality: "high" | "low";
513
513
  captionSource: "name" | "abbreviation" | "description";
514
514
  captionLayout: "top" | "bottom" | "suppress";
package/dist/index.d.ts CHANGED
@@ -425,7 +425,7 @@ type WebsiteProperties = {
425
425
  privacy: "public" | "password" | "private";
426
426
  status: "development" | "preview" | "production";
427
427
  isHeaderDisplayed: boolean;
428
- headerVariant: "default" | "floating";
428
+ headerVariant: "default" | "floating" | "inline";
429
429
  headerAlignment: "start" | "center" | "end";
430
430
  isHeaderProjectDisplayed: boolean;
431
431
  isFooterDisplayed: boolean;
@@ -505,10 +505,10 @@ type WebElementComponent = {
505
505
  images: Array<WebImage>;
506
506
  variant: "default" | "carousel";
507
507
  carouselOptions: {
508
- secondsPerImage: number | null;
509
- isFullWidth: boolean | null;
510
- isFullHeight: boolean | null;
508
+ secondsPerImage: number;
511
509
  } | null;
510
+ isFullWidth: boolean;
511
+ isFullHeight: boolean;
512
512
  imageQuality: "high" | "low";
513
513
  captionSource: "name" | "abbreviation" | "description";
514
514
  captionLayout: "top" | "bottom" | "suppress";
package/dist/index.js CHANGED
@@ -1449,6 +1449,22 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1449
1449
  if (captionLayout === null) {
1450
1450
  captionLayout = "bottom";
1451
1451
  }
1452
+ let isFullWidth = true;
1453
+ const isFullWidthProperty = getPropertyValueByLabel(
1454
+ componentProperty.properties,
1455
+ "is-full-width"
1456
+ );
1457
+ if (isFullWidthProperty !== null) {
1458
+ isFullWidth = isFullWidthProperty === "Yes";
1459
+ }
1460
+ let isFullHeight = true;
1461
+ const isFullHeightProperty = getPropertyValueByLabel(
1462
+ componentProperty.properties,
1463
+ "is-full-height"
1464
+ );
1465
+ if (isFullHeightProperty !== null) {
1466
+ isFullHeight = isFullHeightProperty === "Yes";
1467
+ }
1452
1468
  let imageQuality = getPropertyValueByLabel(
1453
1469
  componentProperty.properties,
1454
1470
  "image-quality"
@@ -1477,8 +1493,6 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1477
1493
  "variant"
1478
1494
  );
1479
1495
  let secondsPerImage = 5;
1480
- let isFullWidth = false;
1481
- let isFullHeight = false;
1482
1496
  if (variantProperty && variantProperty.values[0].content === "carousel") {
1483
1497
  const secondsPerImageProperty = getPropertyValueByLabel(
1484
1498
  variantProperty.properties,
@@ -1487,30 +1501,16 @@ async function parseWebElementProperties(componentProperty, elementResource) {
1487
1501
  if (secondsPerImageProperty !== null) {
1488
1502
  secondsPerImage = Number.parseFloat(secondsPerImageProperty);
1489
1503
  }
1490
- const isFullWidthProperty = getPropertyValueByLabel(
1491
- variantProperty.properties,
1492
- "is-full-width"
1493
- );
1494
- if (isFullWidthProperty !== null) {
1495
- isFullWidth = isFullWidthProperty === "Yes";
1496
- }
1497
- const isFullHeightProperty = getPropertyValueByLabel(
1498
- variantProperty.properties,
1499
- "is-full-height"
1500
- );
1501
- if (isFullHeightProperty !== null) {
1502
- isFullHeight = isFullHeightProperty === "Yes";
1503
- }
1504
1504
  }
1505
1505
  carouselOptions = {
1506
- secondsPerImage,
1507
- isFullWidth,
1508
- isFullHeight
1506
+ secondsPerImage
1509
1507
  };
1510
1508
  }
1511
1509
  properties.images = images;
1512
1510
  properties.variant = variant;
1513
1511
  properties.carouselOptions = carouselOptions;
1512
+ properties.isFullWidth = isFullWidth;
1513
+ properties.isFullHeight = isFullHeight;
1514
1514
  properties.imageQuality = imageQuality;
1515
1515
  properties.captionLayout = captionLayout;
1516
1516
  properties.captionSource = captionSource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Node.js library for working with OCHRE (Online Cultural and Historical Research Environment) data",