ochre-sdk 0.20.17 → 0.20.19

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.d.mts CHANGED
@@ -1146,6 +1146,7 @@ type WebBlock<T extends WebBlockLayout = WebBlockLayout> = {
1146
1146
  properties: {
1147
1147
  default: {
1148
1148
  layout: T;
1149
+ wrap: "nowrap" | "wrap" | "wrap-reverse";
1149
1150
  /**
1150
1151
  * valid `gridTemplateColumns` or `gridTemplateRows` CSS property value
1151
1152
  */
package/dist/index.mjs CHANGED
@@ -2341,10 +2341,15 @@ function buildXQuery$1(params, options) {
2341
2341
  if (queryFilters.length > 0) filterPredicates.push(`(${queryFilters})`);
2342
2342
  const itemFilters = filterPredicates.length > 0 ? `[${filterPredicates.join(" and ")}]` : "";
2343
2343
  const orderedItemsClause = buildOrderedItemsClause(sort);
2344
- return `<ochre>{${`let $items := ${version === 2 ? "doc()" : "input()"}/ochre
2344
+ return `<ochre>{${`let $rawItems := ${version === 2 ? "doc()" : "input()"}/ochre
2345
2345
  ${setScopeFilter}
2346
2346
  ${itemFilters}
2347
2347
 
2348
+ let $items :=
2349
+ for $item at $position in $rawItems
2350
+ where empty($rawItems[position() lt $position][@uuid = $item/@uuid])
2351
+ return $item
2352
+
2348
2353
  let $totalCount := count($items)
2349
2354
  ${orderedItemsClause}
2350
2355
 
@@ -4008,6 +4013,7 @@ function parseWebBlock(blockResource) {
4008
4013
  properties: {
4009
4014
  default: {
4010
4015
  layout: "vertical",
4016
+ wrap: "nowrap",
4011
4017
  spacing: null,
4012
4018
  gap: null
4013
4019
  },
@@ -4023,6 +4029,7 @@ function parseWebBlock(blockResource) {
4023
4029
  const blockMainProperties = getPropertyByLabelAndValue(blockProperties, "presentation", "block")?.properties ?? [];
4024
4030
  if (blockMainProperties.length > 0) {
4025
4031
  returnBlock.properties.default.layout = getPropertyValueByLabel(blockMainProperties, "layout") ?? "vertical";
4032
+ returnBlock.properties.default.wrap = getPropertyValueByLabel(blockMainProperties, "wrap") ?? "nowrap";
4026
4033
  if (returnBlock.properties.default.layout === "accordion") {
4027
4034
  returnBlock.properties.default.isAccordionEnabled = getPropertyValueByLabel(blockMainProperties, "accordion-enabled") ?? true;
4028
4035
  returnBlock.properties.default.isAccordionExpandedByDefault = getPropertyValueByLabel(blockMainProperties, "accordion-expanded") ?? true;
@@ -4035,6 +4042,7 @@ function parseWebBlock(blockResource) {
4035
4042
  const tabletOverwriteProperties = tabletOverwriteProperty.properties;
4036
4043
  const propertiesTablet = {
4037
4044
  layout: getPropertyValueByLabel(tabletOverwriteProperties, "layout") ?? void 0,
4045
+ wrap: getPropertyValueByLabel(tabletOverwriteProperties, "wrap") ?? void 0,
4038
4046
  spacing: getPropertyValueByLabel(tabletOverwriteProperties, "spacing") ?? void 0,
4039
4047
  gap: getPropertyValueByLabel(tabletOverwriteProperties, "gap") ?? void 0,
4040
4048
  isAccordionEnabled: void 0,
@@ -4054,6 +4062,7 @@ function parseWebBlock(blockResource) {
4054
4062
  const mobileOverwriteProperties = mobileOverwriteProperty.properties;
4055
4063
  const propertiesMobile = {
4056
4064
  layout: getPropertyValueByLabel(mobileOverwriteProperties, "layout") ?? void 0,
4065
+ wrap: getPropertyValueByLabel(mobileOverwriteProperties, "wrap") ?? void 0,
4057
4066
  spacing: getPropertyValueByLabel(mobileOverwriteProperties, "spacing") ?? void 0,
4058
4067
  gap: getPropertyValueByLabel(mobileOverwriteProperties, "gap") ?? void 0,
4059
4068
  isAccordionEnabled: void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ochre-sdk",
3
- "version": "0.20.17",
3
+ "version": "0.20.19",
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",