@ndla/article-converter 10.0.152-alpha.0 → 10.0.154-alpha.0

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 (117) hide show
  1. package/es/extractEmbedMeta.mjs +1 -2
  2. package/es/extractEmbedMeta.mjs.map +1 -1
  3. package/es/index.mjs +3 -3
  4. package/es/plugins/detailsPlugin.mjs +1 -2
  5. package/es/plugins/detailsPlugin.mjs.map +1 -1
  6. package/es/plugins/divPlugin.mjs +4 -7
  7. package/es/plugins/divPlugin.mjs.map +1 -1
  8. package/es/plugins/dlPlugin.mjs +1 -2
  9. package/es/plugins/dlPlugin.mjs.map +1 -1
  10. package/es/plugins/embed/audioEmbedPlugin.mjs +1 -2
  11. package/es/plugins/embed/audioEmbedPlugin.mjs.map +1 -1
  12. package/es/plugins/embed/brightcoveEmbedPlugin.mjs +1 -2
  13. package/es/plugins/embed/brightcoveEmbedPlugin.mjs.map +1 -1
  14. package/es/plugins/embed/codeEmbedPlugin.mjs +1 -2
  15. package/es/plugins/embed/codeEmbedPlugin.mjs.map +1 -1
  16. package/es/plugins/embed/conceptEmbedPlugin.mjs +1 -2
  17. package/es/plugins/embed/conceptEmbedPlugin.mjs.map +1 -1
  18. package/es/plugins/embed/contentLinkEmbedPlugin.mjs +1 -2
  19. package/es/plugins/embed/contentLinkEmbedPlugin.mjs.map +1 -1
  20. package/es/plugins/embed/copyrightEmbedPlugin.mjs +1 -2
  21. package/es/plugins/embed/copyrightEmbedPlugin.mjs.map +1 -1
  22. package/es/plugins/embed/externalEmbedPlugin.mjs +1 -2
  23. package/es/plugins/embed/externalEmbedPlugin.mjs.map +1 -1
  24. package/es/plugins/embed/footnoteEmbedPlugin.mjs +1 -2
  25. package/es/plugins/embed/footnoteEmbedPlugin.mjs.map +1 -1
  26. package/es/plugins/embed/h5pEmbedPlugin.mjs +1 -2
  27. package/es/plugins/embed/h5pEmbedPlugin.mjs.map +1 -1
  28. package/es/plugins/embed/iframeEmbedPlugin.mjs +1 -2
  29. package/es/plugins/embed/iframeEmbedPlugin.mjs.map +1 -1
  30. package/es/plugins/embed/imageEmbedPlugin.mjs +1 -2
  31. package/es/plugins/embed/imageEmbedPlugin.mjs.map +1 -1
  32. package/es/plugins/embed/linkBlockEmbedPlugin.mjs +1 -2
  33. package/es/plugins/embed/linkBlockEmbedPlugin.mjs.map +1 -1
  34. package/es/plugins/embed/relatedContentEmbedPlugin.mjs +3 -3
  35. package/es/plugins/embed/relatedContentEmbedPlugin.mjs.map +1 -1
  36. package/es/plugins/embed/uuDisclaimerEmbedPlugin.mjs +2 -3
  37. package/es/plugins/embed/uuDisclaimerEmbedPlugin.mjs.map +1 -1
  38. package/es/plugins/h3Plugin.mjs +1 -2
  39. package/es/plugins/h3Plugin.mjs.map +1 -1
  40. package/es/plugins/navPlugin.mjs +4 -7
  41. package/es/plugins/navPlugin.mjs.map +1 -1
  42. package/es/plugins/paragraphPlugin.mjs +1 -2
  43. package/es/plugins/paragraphPlugin.mjs.map +1 -1
  44. package/es/plugins/summaryPlugin.mjs +1 -2
  45. package/es/plugins/summaryPlugin.mjs.map +1 -1
  46. package/es/plugins/tablePlugin.mjs +1 -2
  47. package/es/plugins/tablePlugin.mjs.map +1 -1
  48. package/es/plugins/ulPlugin.mjs +1 -2
  49. package/es/plugins/ulPlugin.mjs.map +1 -1
  50. package/es/transform.mjs +2 -4
  51. package/es/transform.mjs.map +1 -1
  52. package/lib/extractEmbedMeta.d.ts +1 -2
  53. package/lib/extractEmbedMeta.js +1 -2
  54. package/lib/extractEmbedMeta.js.map +1 -1
  55. package/lib/index.d.ts +2 -2
  56. package/lib/index.js +2 -2
  57. package/lib/plugins/detailsPlugin.js +1 -2
  58. package/lib/plugins/detailsPlugin.js.map +1 -1
  59. package/lib/plugins/divPlugin.js +4 -7
  60. package/lib/plugins/divPlugin.js.map +1 -1
  61. package/lib/plugins/dlPlugin.js +1 -2
  62. package/lib/plugins/dlPlugin.js.map +1 -1
  63. package/lib/plugins/embed/audioEmbedPlugin.js +1 -2
  64. package/lib/plugins/embed/audioEmbedPlugin.js.map +1 -1
  65. package/lib/plugins/embed/brightcoveEmbedPlugin.js +1 -2
  66. package/lib/plugins/embed/brightcoveEmbedPlugin.js.map +1 -1
  67. package/lib/plugins/embed/codeEmbedPlugin.js +1 -2
  68. package/lib/plugins/embed/codeEmbedPlugin.js.map +1 -1
  69. package/lib/plugins/embed/conceptEmbedPlugin.js +1 -2
  70. package/lib/plugins/embed/conceptEmbedPlugin.js.map +1 -1
  71. package/lib/plugins/embed/contentLinkEmbedPlugin.js +1 -2
  72. package/lib/plugins/embed/contentLinkEmbedPlugin.js.map +1 -1
  73. package/lib/plugins/embed/copyrightEmbedPlugin.js +1 -2
  74. package/lib/plugins/embed/copyrightEmbedPlugin.js.map +1 -1
  75. package/lib/plugins/embed/externalEmbedPlugin.js +1 -2
  76. package/lib/plugins/embed/externalEmbedPlugin.js.map +1 -1
  77. package/lib/plugins/embed/footnoteEmbedPlugin.js +1 -2
  78. package/lib/plugins/embed/footnoteEmbedPlugin.js.map +1 -1
  79. package/lib/plugins/embed/h5pEmbedPlugin.js +1 -2
  80. package/lib/plugins/embed/h5pEmbedPlugin.js.map +1 -1
  81. package/lib/plugins/embed/iframeEmbedPlugin.js +1 -2
  82. package/lib/plugins/embed/iframeEmbedPlugin.js.map +1 -1
  83. package/lib/plugins/embed/imageEmbedPlugin.js +1 -2
  84. package/lib/plugins/embed/imageEmbedPlugin.js.map +1 -1
  85. package/lib/plugins/embed/index.js +1 -0
  86. package/lib/plugins/embed/index.js.map +1 -1
  87. package/lib/plugins/embed/linkBlockEmbedPlugin.js +1 -2
  88. package/lib/plugins/embed/linkBlockEmbedPlugin.js.map +1 -1
  89. package/lib/plugins/embed/relatedContentEmbedPlugin.js +3 -3
  90. package/lib/plugins/embed/relatedContentEmbedPlugin.js.map +1 -1
  91. package/lib/plugins/embed/uuDisclaimerEmbedPlugin.js +1 -2
  92. package/lib/plugins/embed/uuDisclaimerEmbedPlugin.js.map +1 -1
  93. package/lib/plugins/h3Plugin.js +1 -2
  94. package/lib/plugins/h3Plugin.js.map +1 -1
  95. package/lib/plugins/index.js +1 -0
  96. package/lib/plugins/index.js.map +1 -1
  97. package/lib/plugins/navPlugin.js +4 -7
  98. package/lib/plugins/navPlugin.js.map +1 -1
  99. package/lib/plugins/paragraphPlugin.js +1 -2
  100. package/lib/plugins/paragraphPlugin.js.map +1 -1
  101. package/lib/plugins/summaryPlugin.js +1 -2
  102. package/lib/plugins/summaryPlugin.js.map +1 -1
  103. package/lib/plugins/tablePlugin.js +1 -2
  104. package/lib/plugins/tablePlugin.js.map +1 -1
  105. package/lib/plugins/types.d.ts +1 -2
  106. package/lib/plugins/ulPlugin.js +1 -2
  107. package/lib/plugins/ulPlugin.js.map +1 -1
  108. package/lib/transform.d.ts +1 -2
  109. package/lib/transform.js +2 -4
  110. package/lib/transform.js.map +1 -1
  111. package/package.json +5 -5
  112. package/src/extractEmbedMeta.ts +1 -3
  113. package/src/index.ts +2 -2
  114. package/src/plugins/embed/relatedContentEmbedPlugin.tsx +8 -1
  115. package/src/plugins/embed/uuDisclaimerEmbedPlugin.tsx +1 -1
  116. package/src/plugins/types.ts +1 -2
  117. package/src/transform.tsx +1 -3
@@ -13,8 +13,7 @@ const extractEmbedMetas = (embed) => {
13
13
  else if (Array.isArray(nodes) && nodes.length && nodes.every((n) => n.type === "ndlaembed" && !!n.props["data-json"])) return nodes.map((n) => JSON.parse(n.props["data-json"]));
14
14
  else return [];
15
15
  };
16
- var extractEmbedMeta_default = extractEmbedMeta;
17
16
 
18
17
  //#endregion
19
- export { extractEmbedMeta_default as default, extractEmbedMetas };
18
+ export { extractEmbedMeta, extractEmbedMetas };
20
19
  //# sourceMappingURL=extractEmbedMeta.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractEmbedMeta.mjs","names":[],"sources":["../src/extractEmbedMeta.ts"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport parse from \"html-react-parser\";\nimport { type EmbedMetaData } from \"@ndla/types-embed\";\n\nconst extractEmbedMeta = (embed: string): EmbedMetaData | undefined => {\n const node = parse(embed);\n if (typeof node === \"string\" || Array.isArray(node) || node.type !== \"ndlaembed\" || !node.props[\"data-json\"]) {\n return;\n }\n\n return JSON.parse(node.props[\"data-json\"]) as EmbedMetaData;\n};\n\nexport const extractEmbedMetas = (embed: string): EmbedMetaData[] => {\n const nodes = parse(embed);\n\n // There are no embeds in the string\n if (typeof nodes === \"string\") {\n return [];\n }\n // There is only one embed in the string\n else if (!Array.isArray(nodes) && nodes.type === \"ndlaembed\" && !!nodes.props[\"data-json\"]) {\n return [JSON.parse(nodes.props[\"data-json\"]) as EmbedMetaData];\n }\n // There are multiple embeds in the string\n else if (\n Array.isArray(nodes) &&\n nodes.length &&\n nodes.every((n) => n.type === \"ndlaembed\" && !!n.props[\"data-json\"])\n ) {\n return nodes.map((n) => JSON.parse(n.props[\"data-json\"]) as EmbedMetaData);\n } else {\n return [];\n }\n};\n\nexport default extractEmbedMeta;\n"],"mappings":";;;AAWA,MAAM,oBAAoB,UAA6C;CACrE,MAAM,OAAO,MAAM,MAAM;AACzB,KAAI,OAAO,SAAS,YAAY,MAAM,QAAQ,KAAK,IAAI,KAAK,SAAS,eAAe,CAAC,KAAK,MAAM,aAC9F;AAGF,QAAO,KAAK,MAAM,KAAK,MAAM,aAAa;;AAG5C,MAAa,qBAAqB,UAAmC;CACnE,MAAM,QAAQ,MAAM,MAAM;AAG1B,KAAI,OAAO,UAAU,SACnB,QAAO,EAAE;UAGF,CAAC,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,eAAe,CAAC,CAAC,MAAM,MAAM,aAC5E,QAAO,CAAC,KAAK,MAAM,MAAM,MAAM,aAAa,CAAkB;UAI9D,MAAM,QAAQ,MAAM,IACpB,MAAM,UACN,MAAM,OAAO,MAAM,EAAE,SAAS,eAAe,CAAC,CAAC,EAAE,MAAM,aAAa,CAEpE,QAAO,MAAM,KAAK,MAAM,KAAK,MAAM,EAAE,MAAM,aAAa,CAAkB;KAE1E,QAAO,EAAE;;AAIb,+BAAe"}
1
+ {"version":3,"file":"extractEmbedMeta.mjs","names":[],"sources":["../src/extractEmbedMeta.ts"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport parse from \"html-react-parser\";\nimport { type EmbedMetaData } from \"@ndla/types-embed\";\n\nexport const extractEmbedMeta = (embed: string): EmbedMetaData | undefined => {\n const node = parse(embed);\n if (typeof node === \"string\" || Array.isArray(node) || node.type !== \"ndlaembed\" || !node.props[\"data-json\"]) {\n return;\n }\n\n return JSON.parse(node.props[\"data-json\"]) as EmbedMetaData;\n};\n\nexport const extractEmbedMetas = (embed: string): EmbedMetaData[] => {\n const nodes = parse(embed);\n\n // There are no embeds in the string\n if (typeof nodes === \"string\") {\n return [];\n }\n // There is only one embed in the string\n else if (!Array.isArray(nodes) && nodes.type === \"ndlaembed\" && !!nodes.props[\"data-json\"]) {\n return [JSON.parse(nodes.props[\"data-json\"]) as EmbedMetaData];\n }\n // There are multiple embeds in the string\n else if (\n Array.isArray(nodes) &&\n nodes.length &&\n nodes.every((n) => n.type === \"ndlaembed\" && !!n.props[\"data-json\"])\n ) {\n return nodes.map((n) => JSON.parse(n.props[\"data-json\"]) as EmbedMetaData);\n } else {\n return [];\n }\n};\n"],"mappings":";;;AAWA,MAAa,oBAAoB,UAA6C;CAC5E,MAAM,OAAO,MAAM,MAAM;AACzB,KAAI,OAAO,SAAS,YAAY,MAAM,QAAQ,KAAK,IAAI,KAAK,SAAS,eAAe,CAAC,KAAK,MAAM,aAC9F;AAGF,QAAO,KAAK,MAAM,KAAK,MAAM,aAAa;;AAG5C,MAAa,qBAAqB,UAAmC;CACnE,MAAM,QAAQ,MAAM,MAAM;AAG1B,KAAI,OAAO,UAAU,SACnB,QAAO,EAAE;UAGF,CAAC,MAAM,QAAQ,MAAM,IAAI,MAAM,SAAS,eAAe,CAAC,CAAC,MAAM,MAAM,aAC5E,QAAO,CAAC,KAAK,MAAM,MAAM,MAAM,aAAa,CAAkB;UAI9D,MAAM,QAAQ,MAAM,IACpB,MAAM,UACN,MAAM,OAAO,MAAM,EAAE,SAAS,eAAe,CAAC,CAAC,EAAE,MAAM,aAAa,CAEpE,QAAO,MAAM,KAAK,MAAM,KAAK,MAAM,EAAE,MAAM,aAAa,CAAkB;KAE1E,QAAO,EAAE"}
package/es/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import transform_default from "./transform.mjs";
2
- import extractEmbedMeta_default, { extractEmbedMetas } from "./extractEmbedMeta.mjs";
1
+ import { transform } from "./transform.mjs";
2
+ import { extractEmbedMeta, extractEmbedMetas } from "./extractEmbedMeta.mjs";
3
3
 
4
- export { extractEmbedMeta_default as extractEmbedMeta, extractEmbedMetas, transform_default as transform };
4
+ export { extractEmbedMeta, extractEmbedMetas, transform };
@@ -4,9 +4,8 @@ import { ExpandableBox } from "@ndla/primitives";
4
4
 
5
5
  //#region src/plugins/detailsPlugin.tsx
6
6
  const detailsPlugin = (node, converterOpts) => {
7
- const props = attributesToProps(node.attribs);
8
7
  return /* @__PURE__ */ jsx(ExpandableBox, {
9
- ...props,
8
+ ...attributesToProps(node.attribs),
10
9
  children: domToReact(node.children, converterOpts)
11
10
  });
12
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"detailsPlugin.mjs","names":["detailsPlugin: PluginType"],"sources":["../../src/plugins/detailsPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { ExpandableBox } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const detailsPlugin: PluginType = (node, converterOpts) => {\n const props = attributesToProps(node.attribs);\n\n return <ExpandableBox {...props}>{domToReact(node.children as DOMNode[], converterOpts)}</ExpandableBox>;\n};\n"],"mappings":";;;;;AAYA,MAAaA,iBAA6B,MAAM,kBAAkB;CAChE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAE7C,QAAO,oBAAC;EAAc,GAAI;YAAQ,WAAW,KAAK,UAAuB,cAAc;GAAiB"}
1
+ {"version":3,"file":"detailsPlugin.mjs","names":["detailsPlugin: PluginType"],"sources":["../../src/plugins/detailsPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { ExpandableBox } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const detailsPlugin: PluginType = (node, converterOpts) => {\n const props = attributesToProps(node.attribs);\n\n return <ExpandableBox {...props}>{domToReact(node.children as DOMNode[], converterOpts)}</ExpandableBox>;\n};\n"],"mappings":";;;;;AAYA,MAAaA,iBAA6B,MAAM,kBAAkB;AAGhE,QAAO,oBAAC;EAAc,GAFR,kBAAkB,KAAK,QAAQ;YAEX,WAAW,KAAK,UAAuB,cAAc;GAAiB"}
@@ -13,13 +13,10 @@ const divPlugin = (node, opts) => {
13
13
  children: domToReact(node.children, opts)
14
14
  });
15
15
  }
16
- if (node.attribs["data-type"] === "related-content" && node.children.length) {
17
- const props = attributesToProps(node.attribs);
18
- return /* @__PURE__ */ jsx(RelatedArticleList, {
19
- ...props,
20
- children: domToReact(node.children, opts)
21
- });
22
- }
16
+ if (node.attribs["data-type"] === "related-content" && node.children.length) return /* @__PURE__ */ jsx(RelatedArticleList, {
17
+ ...attributesToProps(node.attribs),
18
+ children: domToReact(node.children, opts)
19
+ });
23
20
  if (node.attribs["data-type"] === "file" && node.childNodes.length) {
24
21
  const [pdfs, files] = node.childNodes.filter((c) => c.type === "tag" && c.name === "ndlaembed" && c.attribs["data-resource"] === "file").reduce((acc, el) => {
25
22
  (el.attribs["data-type"] === "pdf" && el.attribs["data-display"] === "block" ? acc[0] : acc[1]).push(el);
@@ -1 +1 @@
1
- {"version":3,"file":"divPlugin.mjs","names":["divPlugin: PluginType"],"sources":["../../src/plugins/divPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { domToReact, attributesToProps, Element, type DOMNode } from \"html-react-parser\";\nimport { FramedContent } from \"@ndla/primitives\";\nimport { FileListEmbed, RelatedArticleList, Grid, type GridType, GridParallaxItem } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const divPlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"framed-content\" || node.attribs.class === \"c-bodybox\") {\n const { \"data-variant\": variant, ...props } = attributesToProps(node.attribs);\n return (\n <FramedContent colorTheme={variant === \"colored\" ? \"brand1\" : undefined} {...props}>\n {domToReact(node.children as DOMNode[], opts)}\n </FramedContent>\n );\n }\n if (node.attribs[\"data-type\"] === \"related-content\" && node.children.length) {\n const props = attributesToProps(node.attribs);\n\n return (\n <RelatedArticleList {...props}>\n {/* @ts-expect-error - This works, the types just won't match entirely */}\n {domToReact(node.children, opts)}\n </RelatedArticleList>\n );\n }\n if (node.attribs[\"data-type\"] === \"file\" && node.childNodes.length) {\n const elements = node.childNodes.filter(\n (c): c is Element => c.type === \"tag\" && c.name === \"ndlaembed\" && c.attribs[\"data-resource\"] === \"file\",\n );\n const [pdfs, files] = elements.reduce<[Element[], Element[]]>(\n (acc, el) => {\n const arr = el.attribs[\"data-type\"] === \"pdf\" && el.attribs[\"data-display\"] === \"block\" ? acc[0] : acc[1];\n arr.push(el);\n return acc;\n },\n [[], []],\n );\n\n return (\n <>\n {files.length ? <FileListEmbed>{domToReact(files, opts)}</FileListEmbed> : undefined}\n {domToReact(pdfs, opts)}\n </>\n );\n }\n if (node.attribs[\"data-type\"] === \"grid\" && node.children.length > 0) {\n const props = attributesToProps(node.attribs);\n const columns = props[\"data-columns\"] as GridType[\"columns\"];\n const border = props[\"data-border\"] as GridType[\"border\"];\n const background = props[\"data-background\"] as GridType[\"background\"];\n return (\n <Grid border={border} columns={columns} background={background} {...props}>\n {/* @ts-expect-error - This works, the types just won't match entirely */}\n {domToReact(node.children, opts)}\n </Grid>\n );\n }\n if (node.attribs[\"data-parallax-cell\"] === \"true\" && node.children.length) {\n return <GridParallaxItem>{domToReact(node.children as DOMNode[], opts)}</GridParallaxItem>;\n }\n return null;\n};\n"],"mappings":";;;;;;AAaA,MAAaA,aAAyB,MAAM,SAAS;AACnD,KAAI,KAAK,QAAQ,iBAAiB,oBAAoB,KAAK,QAAQ,UAAU,aAAa;EACxF,MAAM,EAAE,gBAAgB,QAAS,GAAG,UAAU,kBAAkB,KAAK,QAAQ;AAC7E,SACE,oBAAC;GAAc,YAAY,YAAY,YAAY,WAAW;GAAW,GAAI;aAC1E,WAAW,KAAK,UAAuB,KAAK;IAC/B;;AAGpB,KAAI,KAAK,QAAQ,iBAAiB,qBAAqB,KAAK,SAAS,QAAQ;EAC3E,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAE7C,SACE,oBAAC;GAAmB,GAAI;aAErB,WAAW,KAAK,UAAU,KAAK;IACb;;AAGzB,KAAI,KAAK,QAAQ,iBAAiB,UAAU,KAAK,WAAW,QAAQ;EAIlE,MAAM,CAAC,MAAM,SAHI,KAAK,WAAW,QAC9B,MAAoB,EAAE,SAAS,SAAS,EAAE,SAAS,eAAe,EAAE,QAAQ,qBAAqB,OACnG,CAC8B,QAC5B,KAAK,OAAO;AAEX,IADY,GAAG,QAAQ,iBAAiB,SAAS,GAAG,QAAQ,oBAAoB,UAAU,IAAI,KAAK,IAAI,IACnG,KAAK,GAAG;AACZ,UAAO;KAET,CAAC,EAAE,EAAE,EAAE,CAAC,CACT;AAED,SACE,4CACG,MAAM,SAAS,oBAAC,2BAAe,WAAW,OAAO,KAAK,GAAiB,GAAG,QAC1E,WAAW,MAAM,KAAK,IACtB;;AAGP,KAAI,KAAK,QAAQ,iBAAiB,UAAU,KAAK,SAAS,SAAS,GAAG;EACpE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;EAC7C,MAAM,UAAU,MAAM;EACtB,MAAM,SAAS,MAAM;EACrB,MAAM,aAAa,MAAM;AACzB,SACE,oBAAC;GAAa;GAAiB;GAAqB;GAAY,GAAI;aAEjE,WAAW,KAAK,UAAU,KAAK;IAC3B;;AAGX,KAAI,KAAK,QAAQ,0BAA0B,UAAU,KAAK,SAAS,OACjE,QAAO,oBAAC,8BAAkB,WAAW,KAAK,UAAuB,KAAK,GAAoB;AAE5F,QAAO"}
1
+ {"version":3,"file":"divPlugin.mjs","names":["divPlugin: PluginType"],"sources":["../../src/plugins/divPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { domToReact, attributesToProps, Element, type DOMNode } from \"html-react-parser\";\nimport { FramedContent } from \"@ndla/primitives\";\nimport { FileListEmbed, RelatedArticleList, Grid, type GridType, GridParallaxItem } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const divPlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"framed-content\" || node.attribs.class === \"c-bodybox\") {\n const { \"data-variant\": variant, ...props } = attributesToProps(node.attribs);\n return (\n <FramedContent colorTheme={variant === \"colored\" ? \"brand1\" : undefined} {...props}>\n {domToReact(node.children as DOMNode[], opts)}\n </FramedContent>\n );\n }\n if (node.attribs[\"data-type\"] === \"related-content\" && node.children.length) {\n const props = attributesToProps(node.attribs);\n\n return (\n <RelatedArticleList {...props}>\n {/* @ts-expect-error - This works, the types just won't match entirely */}\n {domToReact(node.children, opts)}\n </RelatedArticleList>\n );\n }\n if (node.attribs[\"data-type\"] === \"file\" && node.childNodes.length) {\n const elements = node.childNodes.filter(\n (c): c is Element => c.type === \"tag\" && c.name === \"ndlaembed\" && c.attribs[\"data-resource\"] === \"file\",\n );\n const [pdfs, files] = elements.reduce<[Element[], Element[]]>(\n (acc, el) => {\n const arr = el.attribs[\"data-type\"] === \"pdf\" && el.attribs[\"data-display\"] === \"block\" ? acc[0] : acc[1];\n arr.push(el);\n return acc;\n },\n [[], []],\n );\n\n return (\n <>\n {files.length ? <FileListEmbed>{domToReact(files, opts)}</FileListEmbed> : undefined}\n {domToReact(pdfs, opts)}\n </>\n );\n }\n if (node.attribs[\"data-type\"] === \"grid\" && node.children.length > 0) {\n const props = attributesToProps(node.attribs);\n const columns = props[\"data-columns\"] as GridType[\"columns\"];\n const border = props[\"data-border\"] as GridType[\"border\"];\n const background = props[\"data-background\"] as GridType[\"background\"];\n return (\n <Grid border={border} columns={columns} background={background} {...props}>\n {/* @ts-expect-error - This works, the types just won't match entirely */}\n {domToReact(node.children, opts)}\n </Grid>\n );\n }\n if (node.attribs[\"data-parallax-cell\"] === \"true\" && node.children.length) {\n return <GridParallaxItem>{domToReact(node.children as DOMNode[], opts)}</GridParallaxItem>;\n }\n return null;\n};\n"],"mappings":";;;;;;AAaA,MAAaA,aAAyB,MAAM,SAAS;AACnD,KAAI,KAAK,QAAQ,iBAAiB,oBAAoB,KAAK,QAAQ,UAAU,aAAa;EACxF,MAAM,EAAE,gBAAgB,QAAS,GAAG,UAAU,kBAAkB,KAAK,QAAQ;AAC7E,SACE,oBAAC;GAAc,YAAY,YAAY,YAAY,WAAW;GAAW,GAAI;aAC1E,WAAW,KAAK,UAAuB,KAAK;IAC/B;;AAGpB,KAAI,KAAK,QAAQ,iBAAiB,qBAAqB,KAAK,SAAS,OAGnE,QACE,oBAAC;EAAmB,GAHR,kBAAkB,KAAK,QAAQ;YAKxC,WAAW,KAAK,UAAU,KAAK;GACb;AAGzB,KAAI,KAAK,QAAQ,iBAAiB,UAAU,KAAK,WAAW,QAAQ;EAIlE,MAAM,CAAC,MAAM,SAHI,KAAK,WAAW,QAC9B,MAAoB,EAAE,SAAS,SAAS,EAAE,SAAS,eAAe,EAAE,QAAQ,qBAAqB,OACnG,CAC8B,QAC5B,KAAK,OAAO;AAEX,IADY,GAAG,QAAQ,iBAAiB,SAAS,GAAG,QAAQ,oBAAoB,UAAU,IAAI,KAAK,IAAI,IACnG,KAAK,GAAG;AACZ,UAAO;KAET,CAAC,EAAE,EAAE,EAAE,CAAC,CACT;AAED,SACE,4CACG,MAAM,SAAS,oBAAC,2BAAe,WAAW,OAAO,KAAK,GAAiB,GAAG,QAC1E,WAAW,MAAM,KAAK,IACtB;;AAGP,KAAI,KAAK,QAAQ,iBAAiB,UAAU,KAAK,SAAS,SAAS,GAAG;EACpE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;EAC7C,MAAM,UAAU,MAAM;EACtB,MAAM,SAAS,MAAM;EACrB,MAAM,aAAa,MAAM;AACzB,SACE,oBAAC;GAAa;GAAiB;GAAqB;GAAY,GAAI;aAEjE,WAAW,KAAK,UAAU,KAAK;IAC3B;;AAGX,KAAI,KAAK,QAAQ,0BAA0B,UAAU,KAAK,SAAS,OACjE,QAAO,oBAAC,8BAAkB,WAAW,KAAK,UAAuB,KAAK,GAAoB;AAE5F,QAAO"}
@@ -4,9 +4,8 @@ import { DefinitionList } from "@ndla/primitives";
4
4
 
5
5
  //#region src/plugins/dlPlugin.tsx
6
6
  const dlPlugin = (node, converterOpts, opts) => {
7
- const props = attributesToProps(node.attribs);
8
7
  return /* @__PURE__ */ jsx(DefinitionList, {
9
- ...props,
8
+ ...attributesToProps(node.attribs),
10
9
  lang: opts.articleLanguage,
11
10
  children: domToReact(node.children, converterOpts)
12
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"dlPlugin.mjs","names":["dlPlugin: PluginType"],"sources":["../../src/plugins/dlPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { DefinitionList } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const dlPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n\n return (\n <DefinitionList {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </DefinitionList>\n );\n};\n"],"mappings":";;;;;AAYA,MAAaA,YAAwB,MAAM,eAAe,SAAS;CACjE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAE7C,QACE,oBAAC;EAAe,GAAI;EAAO,MAAM,KAAK;YACnC,WAAW,KAAK,UAAuB,cAAc;GACvC"}
1
+ {"version":3,"file":"dlPlugin.mjs","names":["dlPlugin: PluginType"],"sources":["../../src/plugins/dlPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { DefinitionList } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const dlPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n\n return (\n <DefinitionList {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </DefinitionList>\n );\n};\n"],"mappings":";;;;;AAYA,MAAaA,YAAwB,MAAM,eAAe,SAAS;AAGjE,QACE,oBAAC;EAAe,GAHJ,kBAAkB,KAAK,QAAQ;EAGhB,MAAM,KAAK;YACnC,WAAW,KAAK,UAAuB,cAAc;GACvC"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/audioEmbedPlugin.tsx
6
6
  const audioEmbedPlugin = (element, _, opts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(AudioEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  lang: opts.articleLanguage
12
11
  });
13
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"audioEmbedPlugin.mjs","names":["audioEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/audioEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type AudioMetaData } from \"@ndla/types-embed\";\nimport { AudioEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const audioEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as AudioMetaData;\n return <AudioEmbed embed={data} lang={opts.articleLanguage} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC;EAAW,OAAO;EAAM,MAAM,KAAK;GAAmB"}
1
+ {"version":3,"file":"audioEmbedPlugin.mjs","names":["audioEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/audioEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type AudioMetaData } from \"@ndla/types-embed\";\nimport { AudioEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const audioEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as AudioMetaData;\n return <AudioEmbed embed={data} lang={opts.articleLanguage} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC;EAAW,OADN,KAAK,MAAM,MAAM,aAAuB;EACrB,MAAM,KAAK;GAAmB"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/brightcoveEmbedPlugin.tsx
6
6
  const brightcoveEmbedPlugin = (element, _, opts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(BrightcoveEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  renderContext: opts.renderContext,
12
11
  lang: opts.articleLanguage
13
12
  });
@@ -1 +1 @@
1
- {"version":3,"file":"brightcoveEmbedPlugin.mjs","names":["brightcoveEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/brightcoveEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type BrightcoveMetaData } from \"@ndla/types-embed\";\nimport { BrightcoveEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const brightcoveEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as BrightcoveMetaData;\n return <BrightcoveEmbed embed={data} renderContext={opts.renderContext} lang={opts.articleLanguage} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,yBAAqC,SAAS,GAAG,SAAS;CACrE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC;EAAgB,OAAO;EAAM,eAAe,KAAK;EAAe,MAAM,KAAK;GAAmB"}
1
+ {"version":3,"file":"brightcoveEmbedPlugin.mjs","names":["brightcoveEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/brightcoveEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type BrightcoveMetaData } from \"@ndla/types-embed\";\nimport { BrightcoveEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const brightcoveEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as BrightcoveMetaData;\n return <BrightcoveEmbed embed={data} renderContext={opts.renderContext} lang={opts.articleLanguage} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,yBAAqC,SAAS,GAAG,SAAS;CACrE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC;EAAgB,OADX,KAAK,MAAM,MAAM,aAAuB;EAChB,eAAe,KAAK;EAAe,MAAM,KAAK;GAAmB"}
@@ -5,8 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/codeEmbedPlugin.tsx
6
6
  const codeEmbedPlugin = (element) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
- return /* @__PURE__ */ jsx(CodeEmbed, { embed: data });
8
+ return /* @__PURE__ */ jsx(CodeEmbed, { embed: JSON.parse(props["data-json"]) });
10
9
  };
11
10
 
12
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"codeEmbedPlugin.mjs","names":["codeEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/codeEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type CodeMetaData } from \"@ndla/types-embed\";\nimport { CodeEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const codeEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as CodeMetaData;\n return <CodeEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,mBAA+B,YAAY;CACtD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC,aAAU,OAAO,OAAQ"}
1
+ {"version":3,"file":"codeEmbedPlugin.mjs","names":["codeEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/codeEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type CodeMetaData } from \"@ndla/types-embed\";\nimport { CodeEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const codeEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as CodeMetaData;\n return <CodeEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,mBAA+B,YAAY;CACtD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,aAAU,OADL,KAAK,MAAM,MAAM,aAAuB,GACpB"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/conceptEmbedPlugin.tsx
6
6
  const conceptEmbedPlugin = (element, parserOpts, transformOpts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(ConceptEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  lang: transformOpts.articleLanguage,
12
11
  renderContext: transformOpts.renderContext,
13
12
  previewAlt: transformOpts.previewAlt,
@@ -1 +1 @@
1
- {"version":3,"file":"conceptEmbedPlugin.mjs","names":["conceptEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/conceptEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps, domToReact, type DOMNode } from \"html-react-parser\";\nimport { type ConceptMetaData } from \"@ndla/types-embed\";\nimport { ConceptEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const conceptEmbedPlugin: PluginType = (element, parserOpts, transformOpts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as ConceptMetaData;\n return (\n <ConceptEmbed\n embed={data}\n lang={transformOpts.articleLanguage}\n renderContext={transformOpts.renderContext}\n previewAlt={transformOpts.previewAlt}\n >\n {domToReact(element.children as DOMNode[], parserOpts)}\n </ConceptEmbed>\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,sBAAkC,SAAS,YAAY,kBAAkB;CACpF,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QACE,oBAAC;EACC,OAAO;EACP,MAAM,cAAc;EACpB,eAAe,cAAc;EAC7B,YAAY,cAAc;YAEzB,WAAW,QAAQ,UAAuB,WAAW;GACzC"}
1
+ {"version":3,"file":"conceptEmbedPlugin.mjs","names":["conceptEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/conceptEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps, domToReact, type DOMNode } from \"html-react-parser\";\nimport { type ConceptMetaData } from \"@ndla/types-embed\";\nimport { ConceptEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const conceptEmbedPlugin: PluginType = (element, parserOpts, transformOpts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as ConceptMetaData;\n return (\n <ConceptEmbed\n embed={data}\n lang={transformOpts.articleLanguage}\n renderContext={transformOpts.renderContext}\n previewAlt={transformOpts.previewAlt}\n >\n {domToReact(element.children as DOMNode[], parserOpts)}\n </ConceptEmbed>\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,sBAAkC,SAAS,YAAY,kBAAkB;CACpF,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QACE,oBAAC;EACC,OAHS,KAAK,MAAM,MAAM,aAAuB;EAIjD,MAAM,cAAc;EACpB,eAAe,cAAc;EAC7B,YAAY,cAAc;YAEzB,WAAW,QAAQ,UAAuB,WAAW;GACzC"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/contentLinkEmbedPlugin.tsx
6
6
  const contentLinkEmbedPlugin = (element, opts, { isOembed }) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(ContentLinkEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  isOembed,
12
11
  children: domToReact(element.children, opts)
13
12
  });
@@ -1 +1 @@
1
- {"version":3,"file":"contentLinkEmbedPlugin.mjs","names":["contentLinkEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/contentLinkEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type ContentLinkMetaData } from \"@ndla/types-embed\";\nimport { ContentLinkEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const contentLinkEmbedPlugin: PluginType = (element, opts, { isOembed }) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as ContentLinkMetaData;\n return (\n <ContentLinkEmbed embed={data} isOembed={isOembed}>\n {domToReact(element.children as DOMNode[], opts)}\n </ContentLinkEmbed>\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,0BAAsC,SAAS,MAAM,EAAE,eAAe;CACjF,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QACE,oBAAC;EAAiB,OAAO;EAAgB;YACtC,WAAW,QAAQ,UAAuB,KAAK;GAC/B"}
1
+ {"version":3,"file":"contentLinkEmbedPlugin.mjs","names":["contentLinkEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/contentLinkEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type ContentLinkMetaData } from \"@ndla/types-embed\";\nimport { ContentLinkEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const contentLinkEmbedPlugin: PluginType = (element, opts, { isOembed }) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as ContentLinkMetaData;\n return (\n <ContentLinkEmbed embed={data} isOembed={isOembed}>\n {domToReact(element.children as DOMNode[], opts)}\n </ContentLinkEmbed>\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,0BAAsC,SAAS,MAAM,EAAE,eAAe;CACjF,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QACE,oBAAC;EAAiB,OAFP,KAAK,MAAM,MAAM,aAAuB;EAEV;YACtC,WAAW,QAAQ,UAAuB,KAAK;GAC/B"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/copyrightEmbedPlugin.tsx
6
6
  const copyrightEmbedPlugin = (element, opts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(CopyrightEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  children: domToReact(element.children, opts)
12
11
  });
13
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"copyrightEmbedPlugin.mjs","names":["copyrightEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/copyrightEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type CopyrightMetaData } from \"@ndla/types-embed\";\nimport { CopyrightEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const copyrightEmbedPlugin: PluginType = (element, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as CopyrightMetaData;\n return <CopyrightEmbed embed={data}>{domToReact(element.children as DOMNode[], opts)}</CopyrightEmbed>;\n};\n"],"mappings":";;;;;AAaA,MAAaA,wBAAoC,SAAS,SAAS;CACjE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC;EAAe,OAAO;YAAO,WAAW,QAAQ,UAAuB,KAAK;GAAkB"}
1
+ {"version":3,"file":"copyrightEmbedPlugin.mjs","names":["copyrightEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/copyrightEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type CopyrightMetaData } from \"@ndla/types-embed\";\nimport { CopyrightEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const copyrightEmbedPlugin: PluginType = (element, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as CopyrightMetaData;\n return <CopyrightEmbed embed={data}>{domToReact(element.children as DOMNode[], opts)}</CopyrightEmbed>;\n};\n"],"mappings":";;;;;AAaA,MAAaA,wBAAoC,SAAS,SAAS;CACjE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC;EAAe,OADV,KAAK,MAAM,MAAM,aAAuB;YAChB,WAAW,QAAQ,UAAuB,KAAK;GAAkB"}
@@ -5,8 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/externalEmbedPlugin.tsx
6
6
  const externalEmbedPlugin = (element) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
- return /* @__PURE__ */ jsx(ExternalEmbed, { embed: data });
8
+ return /* @__PURE__ */ jsx(ExternalEmbed, { embed: JSON.parse(props["data-json"]) });
10
9
  };
11
10
 
12
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"externalEmbedPlugin.mjs","names":["externalEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/externalEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type OembedMetaData } from \"@ndla/types-embed\";\nimport { ExternalEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const externalEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as OembedMetaData;\n return <ExternalEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,uBAAmC,YAAY;CAC1D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC,iBAAc,OAAO,OAAQ"}
1
+ {"version":3,"file":"externalEmbedPlugin.mjs","names":["externalEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/externalEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type OembedMetaData } from \"@ndla/types-embed\";\nimport { ExternalEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const externalEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as OembedMetaData;\n return <ExternalEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,uBAAmC,YAAY;CAC1D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,iBAAc,OADT,KAAK,MAAM,MAAM,aAAuB,GAChB"}
@@ -5,8 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/footnoteEmbedPlugin.tsx
6
6
  const footnoteEmbedPlugin = (element) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
- return /* @__PURE__ */ jsx(FootnoteEmbed, { embed: data });
8
+ return /* @__PURE__ */ jsx(FootnoteEmbed, { embed: JSON.parse(props["data-json"]) });
10
9
  };
11
10
 
12
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"footnoteEmbedPlugin.mjs","names":["footnoteEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/footnoteEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type FootnoteMetaData } from \"@ndla/types-embed\";\nimport { FootnoteEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const footnoteEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as FootnoteMetaData;\n return <FootnoteEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,uBAAmC,YAAY;CAC1D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC,iBAAc,OAAO,OAAQ"}
1
+ {"version":3,"file":"footnoteEmbedPlugin.mjs","names":["footnoteEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/footnoteEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type FootnoteMetaData } from \"@ndla/types-embed\";\nimport { FootnoteEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const footnoteEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as FootnoteMetaData;\n return <FootnoteEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,uBAAmC,YAAY;CAC1D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,iBAAc,OADT,KAAK,MAAM,MAAM,aAAuB,GAChB"}
@@ -5,8 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/h5pEmbedPlugin.tsx
6
6
  const h5pEmbedPlugin = (element) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
- return /* @__PURE__ */ jsx(H5pEmbed, { embed: data });
8
+ return /* @__PURE__ */ jsx(H5pEmbed, { embed: JSON.parse(props["data-json"]) });
10
9
  };
11
10
 
12
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"h5pEmbedPlugin.mjs","names":["h5pEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/h5pEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type H5pMetaData } from \"@ndla/types-embed\";\nimport { H5pEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const h5pEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as H5pMetaData;\n return <H5pEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,kBAA8B,YAAY;CACrD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC,YAAS,OAAO,OAAQ"}
1
+ {"version":3,"file":"h5pEmbedPlugin.mjs","names":["h5pEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/h5pEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type H5pMetaData } from \"@ndla/types-embed\";\nimport { H5pEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const h5pEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as H5pMetaData;\n return <H5pEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,kBAA8B,YAAY;CACrD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,YAAS,OADJ,KAAK,MAAM,MAAM,aAAuB,GACrB"}
@@ -5,8 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/iframeEmbedPlugin.tsx
6
6
  const iframeEmbedPlugin = (element) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
- return /* @__PURE__ */ jsx(IframeEmbed, { embed: data });
8
+ return /* @__PURE__ */ jsx(IframeEmbed, { embed: JSON.parse(props["data-json"]) });
10
9
  };
11
10
 
12
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"iframeEmbedPlugin.mjs","names":["iframeEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/iframeEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type IframeMetaData } from \"@ndla/types-embed\";\nimport { IframeEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const iframeEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as IframeMetaData;\n return <IframeEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,qBAAiC,YAAY;CACxD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC,eAAY,OAAO,OAAQ"}
1
+ {"version":3,"file":"iframeEmbedPlugin.mjs","names":["iframeEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/iframeEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type IframeMetaData } from \"@ndla/types-embed\";\nimport { IframeEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const iframeEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as IframeMetaData;\n return <IframeEmbed embed={data} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,qBAAiC,YAAY;CACxD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,eAAY,OADP,KAAK,MAAM,MAAM,aAAuB,GAClB"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/imageEmbedPlugin.tsx
6
6
  const imageEmbedPlugin = (element, _, opts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(ImageEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  previewAlt: opts.previewAlt,
12
11
  lang: opts.articleLanguage,
13
12
  renderContext: opts.renderContext
@@ -1 +1 @@
1
- {"version":3,"file":"imageEmbedPlugin.mjs","names":["imageEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/imageEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type ImageMetaData } from \"@ndla/types-embed\";\nimport { ImageEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const imageEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as ImageMetaData;\n\n return (\n <ImageEmbed\n embed={data}\n previewAlt={opts.previewAlt}\n lang={opts.articleLanguage}\n renderContext={opts.renderContext}\n />\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AAErD,QACE,oBAAC;EACC,OAAO;EACP,YAAY,KAAK;EACjB,MAAM,KAAK;EACX,eAAe,KAAK;GACpB"}
1
+ {"version":3,"file":"imageEmbedPlugin.mjs","names":["imageEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/imageEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type ImageMetaData } from \"@ndla/types-embed\";\nimport { ImageEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const imageEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as ImageMetaData;\n\n return (\n <ImageEmbed\n embed={data}\n previewAlt={opts.previewAlt}\n lang={opts.articleLanguage}\n renderContext={opts.renderContext}\n />\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAGhD,QACE,oBAAC;EACC,OAJS,KAAK,MAAM,MAAM,aAAuB;EAKjD,YAAY,KAAK;EACjB,MAAM,KAAK;EACX,eAAe,KAAK;GACpB"}
@@ -5,9 +5,8 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/linkBlockEmbedPlugin.tsx
6
6
  const linkBlockPlugin = (element, _, opts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(LinkBlock, {
10
- ...data.embedData,
9
+ ...JSON.parse(props["data-json"]).embedData,
11
10
  path: opts.path,
12
11
  articleLanguage: opts.articleLanguage
13
12
  });
@@ -1 +1 @@
1
- {"version":3,"file":"linkBlockEmbedPlugin.mjs","names":["linkBlockPlugin: PluginType"],"sources":["../../../src/plugins/embed/linkBlockEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type LinkBlockMetaData } from \"@ndla/types-embed\";\nimport { LinkBlock } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const linkBlockPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as LinkBlockMetaData;\n\n return <LinkBlock {...data.embedData} path={opts.path} articleLanguage={opts.articleLanguage} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,mBAA+B,SAAS,GAAG,SAAS;CAC/D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AAErD,QAAO,oBAAC;EAAU,GAAI,KAAK;EAAW,MAAM,KAAK;EAAM,iBAAiB,KAAK;GAAmB"}
1
+ {"version":3,"file":"linkBlockEmbedPlugin.mjs","names":["linkBlockPlugin: PluginType"],"sources":["../../../src/plugins/embed/linkBlockEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type LinkBlockMetaData } from \"@ndla/types-embed\";\nimport { LinkBlock } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const linkBlockPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as LinkBlockMetaData;\n\n return <LinkBlock {...data.embedData} path={opts.path} articleLanguage={opts.articleLanguage} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,mBAA+B,SAAS,GAAG,SAAS;CAC/D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAGhD,QAAO,oBAAC;EAAU,GAFL,KAAK,MAAM,MAAM,aAAuB,CAE1B;EAAW,MAAM,KAAK;EAAM,iBAAiB,KAAK;GAAmB"}
@@ -5,11 +5,11 @@ import { jsx } from "react/jsx-runtime";
5
5
  //#region src/plugins/embed/relatedContentEmbedPlugin.tsx
6
6
  const relatedContentEmbedPlugin = (element, _, opts) => {
7
7
  const props = attributesToProps(element.attribs);
8
- const data = JSON.parse(props["data-json"]);
9
8
  return /* @__PURE__ */ jsx(RelatedContentEmbed, {
10
- embed: data,
9
+ embed: JSON.parse(props["data-json"]),
11
10
  subject: opts.subject,
12
- ndlaFrontendDomain: opts.frontendDomain
11
+ ndlaFrontendDomain: opts.frontendDomain,
12
+ language: opts.articleLanguage
13
13
  });
14
14
  };
15
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"relatedContentEmbedPlugin.mjs","names":["relatedContentEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/relatedContentEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type RelatedContentMetaData } from \"@ndla/types-embed\";\nimport { RelatedContentEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const relatedContentEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as RelatedContentMetaData;\n return <RelatedContentEmbed embed={data} subject={opts.subject} ndlaFrontendDomain={opts.frontendDomain} />;\n};\n"],"mappings":";;;;;AAaA,MAAaA,6BAAyC,SAAS,GAAG,SAAS;CACzE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,QAAO,oBAAC;EAAoB,OAAO;EAAM,SAAS,KAAK;EAAS,oBAAoB,KAAK;GAAkB"}
1
+ {"version":3,"file":"relatedContentEmbedPlugin.mjs","names":["relatedContentEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/relatedContentEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { attributesToProps } from \"html-react-parser\";\nimport { type RelatedContentMetaData } from \"@ndla/types-embed\";\nimport { RelatedContentEmbed } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const relatedContentEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as RelatedContentMetaData;\n return (\n <RelatedContentEmbed\n embed={data}\n subject={opts.subject}\n ndlaFrontendDomain={opts.frontendDomain}\n language={opts.articleLanguage}\n />\n );\n};\n"],"mappings":";;;;;AAaA,MAAaA,6BAAyC,SAAS,GAAG,SAAS;CACzE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QACE,oBAAC;EACC,OAHS,KAAK,MAAM,MAAM,aAAuB;EAIjD,SAAS,KAAK;EACd,oBAAoB,KAAK;EACzB,UAAU,KAAK;GACf"}
@@ -1,4 +1,4 @@
1
- import transform_default from "../../transform.mjs";
1
+ import { transform } from "../../transform.mjs";
2
2
  import { attributesToProps, domToReact } from "html-react-parser";
3
3
  import { UuDisclaimerEmbed } from "@ndla/ui";
4
4
  import { Fragment, jsx } from "react/jsx-runtime";
@@ -8,10 +8,9 @@ const uuDisclaimerEmbedPlugin = (element, opts, transformOpts) => {
8
8
  const props = attributesToProps(element.attribs);
9
9
  const data = JSON.parse(props["data-json"]);
10
10
  if (data.status === "error") return /* @__PURE__ */ jsx(Fragment, { children: domToReact(element.children, opts) });
11
- const transformedDisclaimer = transform_default(data.data.transformedContent, transformOpts);
12
11
  return /* @__PURE__ */ jsx(UuDisclaimerEmbed, {
13
12
  embed: data,
14
- transformedDisclaimer,
13
+ transformedDisclaimer: transform(data.data.transformedContent, transformOpts),
15
14
  children: domToReact(element.children, opts)
16
15
  });
17
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"uuDisclaimerEmbedPlugin.mjs","names":["uuDisclaimerEmbedPlugin: PluginType","transform"],"sources":["../../../src/plugins/embed/uuDisclaimerEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type UuDisclaimerMetaData } from \"@ndla/types-embed\";\nimport { UuDisclaimerEmbed } from \"@ndla/ui\";\nimport transform from \"../../transform\";\nimport { type PluginType } from \"../types\";\n\nexport const uuDisclaimerEmbedPlugin: PluginType = (element, opts, transformOpts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as UuDisclaimerMetaData;\n if (data.status === \"error\") {\n return <>{domToReact(element.children as DOMNode[], opts)}</>;\n }\n const transformedDisclaimer = transform(data.data.transformedContent, transformOpts);\n return (\n <UuDisclaimerEmbed embed={data} transformedDisclaimer={transformedDisclaimer}>\n {domToReact(element.children as DOMNode[], opts)}\n </UuDisclaimerEmbed>\n );\n};\n"],"mappings":";;;;;;AAcA,MAAaA,2BAAuC,SAAS,MAAM,kBAAkB;CACnF,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,KAAI,KAAK,WAAW,QAClB,QAAO,0CAAG,WAAW,QAAQ,UAAuB,KAAK,GAAI;CAE/D,MAAM,wBAAwBC,kBAAU,KAAK,KAAK,oBAAoB,cAAc;AACpF,QACE,oBAAC;EAAkB,OAAO;EAA6B;YACpD,WAAW,QAAQ,UAAuB,KAAK;GAC9B"}
1
+ {"version":3,"file":"uuDisclaimerEmbedPlugin.mjs","names":["uuDisclaimerEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/uuDisclaimerEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type UuDisclaimerMetaData } from \"@ndla/types-embed\";\nimport { UuDisclaimerEmbed } from \"@ndla/ui\";\nimport { transform } from \"../../transform\";\nimport { type PluginType } from \"../types\";\n\nexport const uuDisclaimerEmbedPlugin: PluginType = (element, opts, transformOpts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as UuDisclaimerMetaData;\n if (data.status === \"error\") {\n return <>{domToReact(element.children as DOMNode[], opts)}</>;\n }\n const transformedDisclaimer = transform(data.data.transformedContent, transformOpts);\n return (\n <UuDisclaimerEmbed embed={data} transformedDisclaimer={transformedDisclaimer}>\n {domToReact(element.children as DOMNode[], opts)}\n </UuDisclaimerEmbed>\n );\n};\n"],"mappings":";;;;;;AAcA,MAAaA,2BAAuC,SAAS,MAAM,kBAAkB;CACnF,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;AACrD,KAAI,KAAK,WAAW,QAClB,QAAO,0CAAG,WAAW,QAAQ,UAAuB,KAAK,GAAI;AAG/D,QACE,oBAAC;EAAkB,OAAO;EAAM,uBAFJ,UAAU,KAAK,KAAK,oBAAoB,cAAc;YAG/E,WAAW,QAAQ,UAAuB,KAAK;GAC9B"}
@@ -3,9 +3,8 @@ import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/plugins/h3Plugin.tsx
5
5
  const h3Plugin = (node, converterOpts, opts) => {
6
- const props = attributesToProps(node.attribs);
7
6
  return /* @__PURE__ */ jsx("h3", {
8
- ...props,
7
+ ...attributesToProps(node.attribs),
9
8
  lang: opts.articleLanguage,
10
9
  children: domToReact(node.children, converterOpts)
11
10
  });
@@ -1 +1 @@
1
- {"version":3,"file":"h3Plugin.mjs","names":["h3Plugin: PluginType"],"sources":["../../src/plugins/h3Plugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type PluginType } from \"./types\";\nexport const h3Plugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <h3 {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </h3>\n );\n};\n"],"mappings":";;;;AAUA,MAAaA,YAAwB,MAAM,eAAe,SAAS;CACjE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAC7C,QACE,oBAAC;EAAG,GAAI;EAAO,MAAM,KAAK;YACvB,WAAW,KAAK,UAAuB,cAAc;GACnD"}
1
+ {"version":3,"file":"h3Plugin.mjs","names":["h3Plugin: PluginType"],"sources":["../../src/plugins/h3Plugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type PluginType } from \"./types\";\nexport const h3Plugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <h3 {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </h3>\n );\n};\n"],"mappings":";;;;AAUA,MAAaA,YAAwB,MAAM,eAAe,SAAS;AAEjE,QACE,oBAAC;EAAG,GAFQ,kBAAkB,KAAK,QAAQ;EAE5B,MAAM,KAAK;YACvB,WAAW,KAAK,UAAuB,cAAc;GACnD"}
@@ -4,13 +4,10 @@ import { jsx } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/plugins/navPlugin.tsx
6
6
  const navPlugin = (node, opts) => {
7
- if (node.attribs["data-type"] === "link-block-list") {
8
- const props = attributesToProps(node.attribs);
9
- return /* @__PURE__ */ jsx(LinkBlockSection, {
10
- ...props,
11
- children: domToReact(node.children, opts)
12
- });
13
- }
7
+ if (node.attribs["data-type"] === "link-block-list") return /* @__PURE__ */ jsx(LinkBlockSection, {
8
+ ...attributesToProps(node.attribs),
9
+ children: domToReact(node.children, opts)
10
+ });
14
11
  return null;
15
12
  };
16
13
 
@@ -1 +1 @@
1
- {"version":3,"file":"navPlugin.mjs","names":["navPlugin: PluginType"],"sources":["../../src/plugins/navPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { LinkBlockSection } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const navPlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"link-block-list\") {\n const props = attributesToProps(node.attribs);\n return <LinkBlockSection {...props}>{domToReact(node.children as DOMNode[], opts)}</LinkBlockSection>;\n }\n return null;\n};\n"],"mappings":";;;;;AAYA,MAAaA,aAAyB,MAAM,SAAS;AACnD,KAAI,KAAK,QAAQ,iBAAiB,mBAAmB;EACnD,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAC7C,SAAO,oBAAC;GAAiB,GAAI;aAAQ,WAAW,KAAK,UAAuB,KAAK;IAAoB;;AAEvG,QAAO"}
1
+ {"version":3,"file":"navPlugin.mjs","names":["navPlugin: PluginType"],"sources":["../../src/plugins/navPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { LinkBlockSection } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const navPlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"link-block-list\") {\n const props = attributesToProps(node.attribs);\n return <LinkBlockSection {...props}>{domToReact(node.children as DOMNode[], opts)}</LinkBlockSection>;\n }\n return null;\n};\n"],"mappings":";;;;;AAYA,MAAaA,aAAyB,MAAM,SAAS;AACnD,KAAI,KAAK,QAAQ,iBAAiB,kBAEhC,QAAO,oBAAC;EAAiB,GADX,kBAAkB,KAAK,QAAQ;YACR,WAAW,KAAK,UAAuB,KAAK;GAAoB;AAEvG,QAAO"}
@@ -3,9 +3,8 @@ import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/plugins/paragraphPlugin.tsx
5
5
  const paragraphPlugin = (node, converterOpts, opts) => {
6
- const props = attributesToProps(node.attribs);
7
6
  return /* @__PURE__ */ jsx("p", {
8
- ...props,
7
+ ...attributesToProps(node.attribs),
9
8
  lang: opts.articleLanguage,
10
9
  children: domToReact(node.children, converterOpts)
11
10
  });
@@ -1 +1 @@
1
- {"version":3,"file":"paragraphPlugin.mjs","names":["paragraphPlugin: PluginType"],"sources":["../../src/plugins/paragraphPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type PluginType } from \"./types\";\n\nexport const paragraphPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <p {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </p>\n );\n};\n"],"mappings":";;;;AAWA,MAAaA,mBAA+B,MAAM,eAAe,SAAS;CACxE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAC7C,QACE,oBAAC;EAAE,GAAI;EAAO,MAAM,KAAK;YACtB,WAAW,KAAK,UAAuB,cAAc;GACpD"}
1
+ {"version":3,"file":"paragraphPlugin.mjs","names":["paragraphPlugin: PluginType"],"sources":["../../src/plugins/paragraphPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { type PluginType } from \"./types\";\n\nexport const paragraphPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <p {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </p>\n );\n};\n"],"mappings":";;;;AAWA,MAAaA,mBAA+B,MAAM,eAAe,SAAS;AAExE,QACE,oBAAC;EAAE,GAFS,kBAAkB,KAAK,QAAQ;EAE7B,MAAM,KAAK;YACtB,WAAW,KAAK,UAAuB,cAAc;GACpD"}
@@ -4,9 +4,8 @@ import { ExpandableBoxSummary } from "@ndla/primitives";
4
4
 
5
5
  //#region src/plugins/summaryPlugin.tsx
6
6
  const summaryPlugin = (node, converterOpts) => {
7
- const props = attributesToProps(node.attribs);
8
7
  return /* @__PURE__ */ jsx(ExpandableBoxSummary, {
9
- ...props,
8
+ ...attributesToProps(node.attribs),
10
9
  children: domToReact(node.children, converterOpts)
11
10
  });
12
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"summaryPlugin.mjs","names":["summaryPlugin: PluginType"],"sources":["../../src/plugins/summaryPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { ExpandableBoxSummary } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const summaryPlugin: PluginType = (node, converterOpts) => {\n const props = attributesToProps(node.attribs);\n\n return (\n <ExpandableBoxSummary {...props}>{domToReact(node.children as DOMNode[], converterOpts)}</ExpandableBoxSummary>\n );\n};\n"],"mappings":";;;;;AAYA,MAAaA,iBAA6B,MAAM,kBAAkB;CAChE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAE7C,QACE,oBAAC;EAAqB,GAAI;YAAQ,WAAW,KAAK,UAAuB,cAAc;GAAwB"}
1
+ {"version":3,"file":"summaryPlugin.mjs","names":["summaryPlugin: PluginType"],"sources":["../../src/plugins/summaryPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { ExpandableBoxSummary } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const summaryPlugin: PluginType = (node, converterOpts) => {\n const props = attributesToProps(node.attribs);\n\n return (\n <ExpandableBoxSummary {...props}>{domToReact(node.children as DOMNode[], converterOpts)}</ExpandableBoxSummary>\n );\n};\n"],"mappings":";;;;;AAYA,MAAaA,iBAA6B,MAAM,kBAAkB;AAGhE,QACE,oBAAC;EAAqB,GAHV,kBAAkB,KAAK,QAAQ;YAGT,WAAW,KAAK,UAAuB,cAAc;GAAwB"}
@@ -4,9 +4,8 @@ import { Table } from "@ndla/primitives";
4
4
 
5
5
  //#region src/plugins/tablePlugin.tsx
6
6
  const tablePlugin = (node, converterOpts, opts) => {
7
- const props = attributesToProps(node.attribs);
8
7
  return /* @__PURE__ */ jsx(Table, {
9
- ...props,
8
+ ...attributesToProps(node.attribs),
10
9
  lang: opts.articleLanguage,
11
10
  children: domToReact(node.children, converterOpts)
12
11
  });
@@ -1 +1 @@
1
- {"version":3,"file":"tablePlugin.mjs","names":["tablePlugin: PluginType"],"sources":["../../src/plugins/tablePlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { Table } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\nexport const tablePlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <Table {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </Table>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaA,eAA2B,MAAM,eAAe,SAAS;CACpE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAC7C,QACE,oBAAC;EAAM,GAAI;EAAO,MAAM,KAAK;YAC1B,WAAW,KAAK,UAAuB,cAAc;GAChD"}
1
+ {"version":3,"file":"tablePlugin.mjs","names":["tablePlugin: PluginType"],"sources":["../../src/plugins/tablePlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { Table } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\nexport const tablePlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <Table {...props} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </Table>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaA,eAA2B,MAAM,eAAe,SAAS;AAEpE,QACE,oBAAC;EAAM,GAFK,kBAAkB,KAAK,QAAQ;EAEzB,MAAM,KAAK;YAC1B,WAAW,KAAK,UAAuB,cAAc;GAChD"}
@@ -4,9 +4,8 @@ import { UnOrderedList } from "@ndla/primitives";
4
4
 
5
5
  //#region src/plugins/ulPlugin.tsx
6
6
  const ulPlugin = (node, converterOpts, opts) => {
7
- const props = attributesToProps(node.attribs);
8
7
  return /* @__PURE__ */ jsx(UnOrderedList, {
9
- ...props,
8
+ ...attributesToProps(node.attribs),
10
9
  className: node.attribs.class,
11
10
  lang: opts.articleLanguage,
12
11
  children: domToReact(node.children, converterOpts)
@@ -1 +1 @@
1
- {"version":3,"file":"ulPlugin.mjs","names":["ulPlugin: PluginType"],"sources":["../../src/plugins/ulPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { UnOrderedList } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\nexport const ulPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <UnOrderedList {...props} className={node.attribs.class} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </UnOrderedList>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaA,YAAwB,MAAM,eAAe,SAAS;CACjE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAC7C,QACE,oBAAC;EAAc,GAAI;EAAO,WAAW,KAAK,QAAQ;EAAO,MAAM,KAAK;YACjE,WAAW,KAAK,UAAuB,cAAc;GACxC"}
1
+ {"version":3,"file":"ulPlugin.mjs","names":["ulPlugin: PluginType"],"sources":["../../src/plugins/ulPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type DOMNode, attributesToProps, domToReact } from \"html-react-parser\";\nimport { UnOrderedList } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\nexport const ulPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n return (\n <UnOrderedList {...props} className={node.attribs.class} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </UnOrderedList>\n );\n};\n"],"mappings":";;;;;AAWA,MAAaA,YAAwB,MAAM,eAAe,SAAS;AAEjE,QACE,oBAAC;EAAc,GAFH,kBAAkB,KAAK,QAAQ;EAEjB,WAAW,KAAK,QAAQ;EAAO,MAAM,KAAK;YACjE,WAAW,KAAK,UAAuB,cAAc;GACxC"}
package/es/transform.mjs CHANGED
@@ -11,14 +11,12 @@ const transform = (content, opts) => {
11
11
  if (plugins[node.name]) return plugins[node.name](node, options, opts);
12
12
  if (node.name === "ndlaembed") {
13
13
  if (embedPlugins[node.attribs["data-resource"]]) return embedPlugins[node.attribs["data-resource"]](node, options, opts);
14
- const embed = JSON.parse(node.attribs["data-json"]);
15
- return /* @__PURE__ */ jsx(UnknownEmbed, { embed });
14
+ return /* @__PURE__ */ jsx(UnknownEmbed, { embed: JSON.parse(node.attribs["data-json"]) });
16
15
  }
17
16
  } };
18
17
  return parse(content, options);
19
18
  };
20
- var transform_default = transform;
21
19
 
22
20
  //#endregion
23
- export { transform_default as default };
21
+ export { transform };
24
22
  //# sourceMappingURL=transform.mjs.map