@digitalculture/ochre-sdk 0.17.6 → 0.17.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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -26
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -723,19 +723,10 @@ function extractAnnotationMetadata(item) {
723
723
  const textStylingHeadingLevelProperty = textStylingProperties.find((property) => property.label.uuid === TEXT_ANNOTATION_TEXT_STYLING_HEADING_LEVEL_UUID);
724
724
  if (textStylingHeadingLevelProperty != null) textStylingHeadingLevel = parseFakeString(textStylingHeadingLevelProperty.value.content);
725
725
  const textStylingCssProperties = textStylingProperties.filter((property) => property.label.uuid !== TEXT_ANNOTATION_TEXT_STYLING_VARIANT_UUID && property.label.uuid !== TEXT_ANNOTATION_TEXT_STYLING_HEADING_LEVEL_UUID);
726
- if (textStylingCssProperties.length > 0) {
727
- textStylingCss = textStylingCssProperties.map((property) => ({
728
- label: parseFakeString(property.label.content),
729
- value: parseFakeString(property.value.content)
730
- }));
731
- const colorStyle = textStylingCss.find((style) => style.label === "color");
732
- if (colorStyle != null) {
733
- if (!textStylingCss.some((style) => style.label === "textDecorationColor")) textStylingCss.push({
734
- label: "textDecorationColor",
735
- value: colorStyle.value
736
- });
737
- }
738
- }
726
+ if (textStylingCssProperties.length > 0) textStylingCss = textStylingCssProperties.map((property) => ({
727
+ label: parseFakeString(property.label.content),
728
+ value: parseFakeString(property.value.content)
729
+ }));
739
730
  result.textStyling = {
740
731
  variant: textStylingVariant,
741
732
  size: textStylingSize,
@@ -912,19 +903,10 @@ function parseStringDocumentItem(item) {
912
903
  const textStylingHeadingLevelProperty = textStylingProperties.find((property) => property.label.uuid === TEXT_ANNOTATION_TEXT_STYLING_HEADING_LEVEL_UUID);
913
904
  if (textStylingHeadingLevelProperty != null) textStylingHeadingLevel = parseFakeString(textStylingHeadingLevelProperty.value.content);
914
905
  const textStylingCssProperties = textStylingProperties.filter((property) => property.label.uuid !== TEXT_ANNOTATION_TEXT_STYLING_VARIANT_UUID && property.label.uuid !== TEXT_ANNOTATION_TEXT_STYLING_HEADING_LEVEL_UUID);
915
- if (textStylingCssProperties.length > 0) {
916
- textStylingCss = textStylingCssProperties.map((property) => ({
917
- label: parseFakeString(property.label.content),
918
- value: parseFakeString(property.value.content)
919
- }));
920
- const colorStyle = textStylingCss.find((style) => style.label === "color");
921
- if (colorStyle != null) {
922
- if (!textStylingCss.some((style) => style.label === "textDecorationColor")) textStylingCss.push({
923
- label: "textDecorationColor",
924
- value: colorStyle.value
925
- });
926
- }
927
- }
906
+ if (textStylingCssProperties.length > 0) textStylingCss = textStylingCssProperties.map((property) => ({
907
+ label: parseFakeString(property.label.content),
908
+ value: parseFakeString(property.value.content)
909
+ }));
928
910
  }
929
911
  return applyWhitespaceToResult(`<Annotation type="${textStylingType}" variant="${textStylingVariant}" size="${textStylingSize}"${textStylingHeadingLevel != null ? ` headingLevel="${textStylingHeadingLevel}"` : ""}${textStylingCss.length > 0 ? ` cssStyles={{default: ${JSON.stringify(textStylingCss)}, tablet: [], mobile: []}}` : ""}>${itemString}</Annotation>`, itemWhitespace);
930
912
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalculture/ochre-sdk",
3
- "version": "0.17.6",
3
+ "version": "0.17.7",
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",