@ndla/article-converter 10.0.170-alpha.0 → 10.0.172-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/plugins/{copyParagraphPlugin.mjs → anchorHeadingPlugin.mjs} +6 -6
  2. package/es/plugins/anchorHeadingPlugin.mjs.map +1 -0
  3. package/es/plugins/anchorPlugin.mjs.map +1 -1
  4. package/es/plugins/asidePlugin.mjs.map +1 -1
  5. package/es/plugins/blockquotePlugin.mjs.map +1 -1
  6. package/es/plugins/detailsPlugin.mjs.map +1 -1
  7. package/es/plugins/divPlugin.mjs.map +1 -1
  8. package/es/plugins/dlPlugin.mjs.map +1 -1
  9. package/es/plugins/embed/KeyFigureEmbedPlugin.mjs.map +1 -1
  10. package/es/plugins/embed/audioEmbedPlugin.mjs.map +1 -1
  11. package/es/plugins/embed/brightcoveEmbedPlugin.mjs.map +1 -1
  12. package/es/plugins/embed/campaignBlockPlugin.mjs.map +1 -1
  13. package/es/plugins/embed/codeEmbedPlugin.mjs.map +1 -1
  14. package/es/plugins/embed/conceptEmbedPlugin.mjs.map +1 -1
  15. package/es/plugins/embed/contactBlockEmbedPlugin.mjs.map +1 -1
  16. package/es/plugins/embed/contentLinkEmbedPlugin.mjs.map +1 -1
  17. package/es/plugins/embed/copyrightEmbedPlugin.mjs.map +1 -1
  18. package/es/plugins/embed/externalEmbedPlugin.mjs.map +1 -1
  19. package/es/plugins/embed/fileEmbedPlugin.mjs.map +1 -1
  20. package/es/plugins/embed/footnoteEmbedPlugin.mjs.map +1 -1
  21. package/es/plugins/embed/h5pEmbedPlugin.mjs.map +1 -1
  22. package/es/plugins/embed/iframeEmbedPlugin.mjs.map +1 -1
  23. package/es/plugins/embed/imageEmbedPlugin.mjs.map +1 -1
  24. package/es/plugins/embed/index.mjs.map +1 -1
  25. package/es/plugins/embed/linkBlockEmbedPlugin.mjs.map +1 -1
  26. package/es/plugins/embed/pitchEmbedPlugin.mjs.map +1 -1
  27. package/es/plugins/embed/relatedContentEmbedPlugin.mjs.map +1 -1
  28. package/es/plugins/embed/symbolEmbedPlugin.mjs.map +1 -1
  29. package/es/plugins/embed/uuDisclaimerEmbedPlugin.mjs.map +1 -1
  30. package/es/plugins/h3Plugin.mjs.map +1 -1
  31. package/es/plugins/index.mjs +2 -2
  32. package/es/plugins/index.mjs.map +1 -1
  33. package/es/plugins/mathPlugin.mjs.map +1 -1
  34. package/es/plugins/navPlugin.mjs.map +1 -1
  35. package/es/plugins/olPlugin.mjs.map +1 -1
  36. package/es/plugins/paragraphPlugin.mjs.map +1 -1
  37. package/es/plugins/summaryPlugin.mjs.map +1 -1
  38. package/es/plugins/tablePlugin.mjs.map +1 -1
  39. package/es/plugins/ulPlugin.mjs.map +1 -1
  40. package/es/transform.mjs.map +1 -1
  41. package/lib/plugins/{copyParagraphPlugin.d.ts → anchorHeadingPlugin.d.ts} +1 -1
  42. package/lib/plugins/{copyParagraphPlugin.js → anchorHeadingPlugin.js} +6 -6
  43. package/lib/plugins/anchorHeadingPlugin.js.map +1 -0
  44. package/lib/plugins/anchorPlugin.js +4 -4
  45. package/lib/plugins/anchorPlugin.js.map +1 -1
  46. package/lib/plugins/asidePlugin.js +2 -2
  47. package/lib/plugins/asidePlugin.js.map +1 -1
  48. package/lib/plugins/blockquotePlugin.js +2 -2
  49. package/lib/plugins/blockquotePlugin.js.map +1 -1
  50. package/lib/plugins/detailsPlugin.js +2 -2
  51. package/lib/plugins/detailsPlugin.js.map +1 -1
  52. package/lib/plugins/divPlugin.js +7 -7
  53. package/lib/plugins/divPlugin.js.map +1 -1
  54. package/lib/plugins/dlPlugin.js +2 -2
  55. package/lib/plugins/dlPlugin.js.map +1 -1
  56. package/lib/plugins/embed/KeyFigureEmbedPlugin.js +2 -2
  57. package/lib/plugins/embed/KeyFigureEmbedPlugin.js.map +1 -1
  58. package/lib/plugins/embed/audioEmbedPlugin.js +2 -2
  59. package/lib/plugins/embed/audioEmbedPlugin.js.map +1 -1
  60. package/lib/plugins/embed/brightcoveEmbedPlugin.js +2 -2
  61. package/lib/plugins/embed/brightcoveEmbedPlugin.js.map +1 -1
  62. package/lib/plugins/embed/campaignBlockPlugin.js +2 -2
  63. package/lib/plugins/embed/campaignBlockPlugin.js.map +1 -1
  64. package/lib/plugins/embed/codeEmbedPlugin.js +2 -2
  65. package/lib/plugins/embed/codeEmbedPlugin.js.map +1 -1
  66. package/lib/plugins/embed/conceptEmbedPlugin.js +2 -2
  67. package/lib/plugins/embed/conceptEmbedPlugin.js.map +1 -1
  68. package/lib/plugins/embed/contactBlockEmbedPlugin.js +3 -3
  69. package/lib/plugins/embed/contactBlockEmbedPlugin.js.map +1 -1
  70. package/lib/plugins/embed/contentLinkEmbedPlugin.js +2 -2
  71. package/lib/plugins/embed/contentLinkEmbedPlugin.js.map +1 -1
  72. package/lib/plugins/embed/copyrightEmbedPlugin.js +2 -2
  73. package/lib/plugins/embed/copyrightEmbedPlugin.js.map +1 -1
  74. package/lib/plugins/embed/externalEmbedPlugin.js +2 -2
  75. package/lib/plugins/embed/externalEmbedPlugin.js.map +1 -1
  76. package/lib/plugins/embed/fileEmbedPlugin.js +3 -3
  77. package/lib/plugins/embed/fileEmbedPlugin.js.map +1 -1
  78. package/lib/plugins/embed/footnoteEmbedPlugin.js +2 -2
  79. package/lib/plugins/embed/footnoteEmbedPlugin.js.map +1 -1
  80. package/lib/plugins/embed/h5pEmbedPlugin.js +2 -2
  81. package/lib/plugins/embed/h5pEmbedPlugin.js.map +1 -1
  82. package/lib/plugins/embed/iframeEmbedPlugin.js +2 -2
  83. package/lib/plugins/embed/iframeEmbedPlugin.js.map +1 -1
  84. package/lib/plugins/embed/imageEmbedPlugin.js +2 -2
  85. package/lib/plugins/embed/imageEmbedPlugin.js.map +1 -1
  86. package/lib/plugins/embed/index.js.map +1 -1
  87. package/lib/plugins/embed/linkBlockEmbedPlugin.js +2 -2
  88. package/lib/plugins/embed/linkBlockEmbedPlugin.js.map +1 -1
  89. package/lib/plugins/embed/pitchEmbedPlugin.js +2 -2
  90. package/lib/plugins/embed/pitchEmbedPlugin.js.map +1 -1
  91. package/lib/plugins/embed/relatedContentEmbedPlugin.js +2 -2
  92. package/lib/plugins/embed/relatedContentEmbedPlugin.js.map +1 -1
  93. package/lib/plugins/embed/symbolEmbedPlugin.js.map +1 -1
  94. package/lib/plugins/embed/uuDisclaimerEmbedPlugin.js +2 -2
  95. package/lib/plugins/embed/uuDisclaimerEmbedPlugin.js.map +1 -1
  96. package/lib/plugins/h3Plugin.js.map +1 -1
  97. package/lib/plugins/index.js +2 -2
  98. package/lib/plugins/index.js.map +1 -1
  99. package/lib/plugins/mathPlugin.js.map +1 -1
  100. package/lib/plugins/navPlugin.js +2 -2
  101. package/lib/plugins/navPlugin.js.map +1 -1
  102. package/lib/plugins/olPlugin.js +2 -2
  103. package/lib/plugins/olPlugin.js.map +1 -1
  104. package/lib/plugins/paragraphPlugin.js.map +1 -1
  105. package/lib/plugins/summaryPlugin.js +2 -2
  106. package/lib/plugins/summaryPlugin.js.map +1 -1
  107. package/lib/plugins/tablePlugin.js +2 -2
  108. package/lib/plugins/tablePlugin.js.map +1 -1
  109. package/lib/plugins/ulPlugin.js +2 -2
  110. package/lib/plugins/ulPlugin.js.map +1 -1
  111. package/lib/transform.js +2 -2
  112. package/lib/transform.js.map +1 -1
  113. package/package.json +5 -5
  114. package/src/plugins/{copyParagraphPlugin.tsx → anchorHeadingPlugin.tsx} +4 -4
  115. package/src/plugins/index.ts +2 -2
  116. package/es/plugins/copyParagraphPlugin.mjs.map +0 -1
  117. package/lib/plugins/copyParagraphPlugin.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { domToReact } from "html-react-parser";
2
- import { CopyParagraphButton } from "@ndla/ui";
2
+ import { AnchorHeading } from "@ndla/ui";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
5
- //#region src/plugins/copyParagraphPlugin.tsx
5
+ //#region src/plugins/anchorHeadingPlugin.tsx
6
6
  /**
7
7
  * Copyright (c) 2023-present, NDLA.
8
8
  *
@@ -10,9 +10,9 @@ import { jsx } from "react/jsx-runtime";
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  *
12
12
  */
13
- const copyParagraphPlugin = (node, converterOpts, opts) => {
13
+ const anchorHeadingPlugin = (node, converterOpts, opts) => {
14
14
  const parent = node.parent;
15
- if (parent?.name === "section" || parent?.name === "div" && Object.keys(parent.attribs ?? {}).length === 0 || parent?.name === "ndlaembed" && parent.attribs["data-resource"] === "uu-disclaimer") return /* @__PURE__ */ jsx(CopyParagraphButton, {
15
+ if (parent?.name === "section" || parent?.name === "div" && Object.keys(parent.attribs ?? {}).length === 0 || parent?.name === "ndlaembed" && parent.attribs["data-resource"] === "uu-disclaimer") return /* @__PURE__ */ jsx(AnchorHeading, {
16
16
  copyText: node.attribs["data-text"],
17
17
  lang: opts.articleLanguage,
18
18
  children: domToReact(node.children, converterOpts)
@@ -21,5 +21,5 @@ const copyParagraphPlugin = (node, converterOpts, opts) => {
21
21
  };
22
22
 
23
23
  //#endregion
24
- export { copyParagraphPlugin };
25
- //# sourceMappingURL=copyParagraphPlugin.mjs.map
24
+ export { anchorHeadingPlugin };
25
+ //# sourceMappingURL=anchorHeadingPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchorHeadingPlugin.mjs","names":[],"sources":["../../src/plugins/anchorHeadingPlugin.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, Element, domToReact } from \"html-react-parser\";\nimport { AnchorHeading } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\nexport const anchorHeadingPlugin: PluginType = (node, converterOpts, opts) => {\n const parent = node.parent as Element | undefined;\n if (\n parent?.name === \"section\" ||\n (parent?.name === \"div\" && Object.keys(parent.attribs ?? {}).length === 0) ||\n (parent?.name === \"ndlaembed\" && parent.attribs[\"data-resource\"] === \"uu-disclaimer\")\n ) {\n return (\n <AnchorHeading copyText={node.attribs[\"data-text\"]} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </AnchorHeading>\n );\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,uBAAmC,MAAM,eAAe,SAAS;CAC5E,MAAM,SAAS,KAAK;AACpB,KACE,QAAQ,SAAS,aAChB,QAAQ,SAAS,SAAS,OAAO,KAAK,OAAO,WAAW,EAAE,CAAC,CAAC,WAAW,KACvE,QAAQ,SAAS,eAAe,OAAO,QAAQ,qBAAqB,gBAErE,QACE,oBAAC;EAAc,UAAU,KAAK,QAAQ;EAAc,MAAM,KAAK;YAC5D,WAAW,KAAK,UAAuB,cAAc;GACxC;AAGpB,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"anchorPlugin.mjs","names":["anchorPlugin: PluginType","oembedProps: AnchorHTMLAttributes<HTMLAnchorElement>"],"sources":["../../src/plugins/anchorPlugin.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 { AnchorHTMLAttributes } from \"react\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { getPossiblyRelativeUrl } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const anchorPlugin: PluginType = (node, opts, { path, isOembed }) => {\n const props = attributesToProps(node.attribs);\n const href = getPossiblyRelativeUrl(props.href as string, path);\n\n const oembedProps: AnchorHTMLAttributes<HTMLAnchorElement> = isOembed ? { target: \"_blank\", rel: \"noreferrer\" } : {};\n\n return (\n <SafeLink {...props} to={href} {...oembedProps} target=\"\">\n {domToReact(node.children as DOMNode[], opts)}\n </SafeLink>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAaA,gBAA4B,MAAM,MAAM,EAAE,MAAM,eAAe;CAC1E,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;CAC7C,MAAM,OAAO,uBAAuB,MAAM,MAAgB,KAAK;CAE/D,MAAMC,cAAuD,WAAW;EAAE,QAAQ;EAAU,KAAK;EAAc,GAAG,EAAE;AAEpH,QACE,oBAAC;EAAS,GAAI;EAAO,IAAI;EAAM,GAAI;EAAa,QAAO;YACpD,WAAW,KAAK,UAAuB,KAAK;GACpC"}
1
+ {"version":3,"file":"anchorPlugin.mjs","names":[],"sources":["../../src/plugins/anchorPlugin.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 { AnchorHTMLAttributes } from \"react\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { getPossiblyRelativeUrl } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const anchorPlugin: PluginType = (node, opts, { path, isOembed }) => {\n const props = attributesToProps(node.attribs);\n const href = getPossiblyRelativeUrl(props.href as string, path);\n\n const oembedProps: AnchorHTMLAttributes<HTMLAnchorElement> = isOembed ? { target: \"_blank\", rel: \"noreferrer\" } : {};\n\n return (\n <SafeLink {...props} to={href} {...oembedProps} target=\"\">\n {domToReact(node.children as DOMNode[], opts)}\n </SafeLink>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,gBAA4B,MAAM,MAAM,EAAE,MAAM,eAAe;CAC1E,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;CAC7C,MAAM,OAAO,uBAAuB,MAAM,MAAgB,KAAK;CAE/D,MAAM,cAAuD,WAAW;EAAE,QAAQ;EAAU,KAAK;EAAc,GAAG,EAAE;AAEpH,QACE,oBAAC;EAAS,GAAI;EAAO,IAAI;EAAM,GAAI;EAAa,QAAO;YACpD,WAAW,KAAK,UAAuB,KAAK;GACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"asidePlugin.mjs","names":["asidePlugin: PluginType"],"sources":["../../src/plugins/asidePlugin.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, domToReact } from \"html-react-parser\";\nimport { FactBox } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\nexport const asidePlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"factAside\") {\n return <FactBox>{domToReact(node.children as DOMNode[], opts)}</FactBox>;\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAaA,eAA2B,MAAM,SAAS;AACrD,KAAI,KAAK,QAAQ,iBAAiB,YAChC,QAAO,oBAAC,qBAAS,WAAW,KAAK,UAAuB,KAAK,GAAW;AAE1E,QAAO"}
1
+ {"version":3,"file":"asidePlugin.mjs","names":[],"sources":["../../src/plugins/asidePlugin.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, domToReact } from \"html-react-parser\";\nimport { FactBox } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\nexport const asidePlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"factAside\") {\n return <FactBox>{domToReact(node.children as DOMNode[], opts)}</FactBox>;\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,eAA2B,MAAM,SAAS;AACrD,KAAI,KAAK,QAAQ,iBAAiB,YAChC,QAAO,oBAAC,qBAAS,WAAW,KAAK,UAAuB,KAAK,GAAW;AAE1E,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"blockquotePlugin.mjs","names":["blockquotePlugin: PluginType"],"sources":["../../src/plugins/blockquotePlugin.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 { BlockQuote } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const blockquotePlugin: PluginType = (node, opts) => {\n const { \"data-variant\": variant, ...props } = attributesToProps(node.attribs);\n return (\n <BlockQuote {...props} variant={variant === \"colored\" ? \"brand1\" : undefined}>\n {domToReact(node.children as DOMNode[], opts)}\n </BlockQuote>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAYA,MAAaA,oBAAgC,MAAM,SAAS;CAC1D,MAAM,EAAE,gBAAgB,SAAS,GAAG,UAAU,kBAAkB,KAAK,QAAQ;AAC7E,QACE,oBAAC;EAAW,GAAI;EAAO,SAAS,YAAY,YAAY,WAAW;YAChE,WAAW,KAAK,UAAuB,KAAK;GAClC"}
1
+ {"version":3,"file":"blockquotePlugin.mjs","names":[],"sources":["../../src/plugins/blockquotePlugin.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 { BlockQuote } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\n\nexport const blockquotePlugin: PluginType = (node, opts) => {\n const { \"data-variant\": variant, ...props } = attributesToProps(node.attribs);\n return (\n <BlockQuote {...props} variant={variant === \"colored\" ? \"brand1\" : undefined}>\n {domToReact(node.children as DOMNode[], opts)}\n </BlockQuote>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAYA,MAAa,oBAAgC,MAAM,SAAS;CAC1D,MAAM,EAAE,gBAAgB,SAAS,GAAG,UAAU,kBAAkB,KAAK,QAAQ;AAC7E,QACE,oBAAC;EAAW,GAAI;EAAO,SAAS,YAAY,YAAY,WAAW;YAChE,WAAW,KAAK,UAAuB,KAAK;GAClC"}
@@ -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;AAGhE,QAAO,oBAAC;EAAc,GAFR,kBAAkB,KAAK,QAAQ;YAEX,WAAW,KAAK,UAAuB,cAAc;GAAiB"}
1
+ {"version":3,"file":"detailsPlugin.mjs","names":[],"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,MAAa,iBAA6B,MAAM,kBAAkB;AAGhE,QAAO,oBAAC;EAAc,GAFR,kBAAkB,KAAK,QAAQ;YAEX,WAAW,KAAK,UAAuB,cAAc;GAAiB"}
@@ -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, GridItem } 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 return (\n <Grid border={border} columns={columns} {...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-type\"] === \"grid-cell\") {\n const props = attributesToProps(node.attribs);\n const border = props[\"data-border\"] === \"true\";\n return (\n <GridItem border={border} {...props}>\n {/* @ts-expect-error - This works, the types just won't match entirely */}\n {domToReact(node.children, opts)}\n </GridItem>\n );\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,SAAS,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;AACrB,SACE,oBAAC;GAAa;GAAiB;GAAS,GAAI;aAEzC,WAAW,KAAK,UAAU,KAAK;IAC3B;;AAGX,KAAI,KAAK,QAAQ,iBAAiB,aAAa;EAC7C,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAE7C,SACE,oBAAC;GAAS,QAFG,MAAM,mBAAmB;GAEZ,GAAI;aAE3B,WAAW,KAAK,UAAU,KAAK;IACvB;;AAGf,QAAO"}
1
+ {"version":3,"file":"divPlugin.mjs","names":[],"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, GridItem } 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 return (\n <Grid border={border} columns={columns} {...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-type\"] === \"grid-cell\") {\n const props = attributesToProps(node.attribs);\n const border = props[\"data-border\"] === \"true\";\n return (\n <GridItem border={border} {...props}>\n {/* @ts-expect-error - This works, the types just won't match entirely */}\n {domToReact(node.children, opts)}\n </GridItem>\n );\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,aAAyB,MAAM,SAAS;AACnD,KAAI,KAAK,QAAQ,iBAAiB,oBAAoB,KAAK,QAAQ,UAAU,aAAa;EACxF,MAAM,EAAE,gBAAgB,SAAS,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;AACrB,SACE,oBAAC;GAAa;GAAiB;GAAS,GAAI;aAEzC,WAAW,KAAK,UAAU,KAAK;IAC3B;;AAGX,KAAI,KAAK,QAAQ,iBAAiB,aAAa;EAC7C,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;AAE7C,SACE,oBAAC;GAAS,QAFG,MAAM,mBAAmB;GAEZ,GAAI;aAE3B,WAAW,KAAK,UAAU,KAAK;IACvB;;AAGf,QAAO"}
@@ -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;AAGjE,QACE,oBAAC;EAAe,GAHJ,kBAAkB,KAAK,QAAQ;EAGhB,MAAM,KAAK;YACnC,WAAW,KAAK,UAAuB,cAAc;GACvC"}
1
+ {"version":3,"file":"dlPlugin.mjs","names":[],"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,MAAa,YAAwB,MAAM,eAAe,SAAS;AAGjE,QACE,oBAAC;EAAe,GAHJ,kBAAkB,KAAK,QAAQ;EAGhB,MAAM,KAAK;YACnC,WAAW,KAAK,UAAuB,cAAc;GACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"KeyFigureEmbedPlugin.mjs","names":["keyFigureEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/KeyFigureEmbedPlugin.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 KeyFigureMetaData } from \"@ndla/types-embed\";\nimport { KeyFigure } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const keyFigureEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as KeyFigureMetaData;\n const { title, subtitle, alt } = data.embedData;\n return (\n <KeyFigure\n title={title}\n subtitle={subtitle}\n image={\n data.status === \"success\" && data.data.metaImage\n ? {\n src: data.data.metaImage.image.imageUrl,\n alt: alt === undefined ? \"\" : alt,\n }\n : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAaA,wBAAoC,YAAY;CAC3D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,EAAE,OAAO,UAAU,QAAQ,KAAK;AACtC,QACE,oBAAC;EACQ;EACG;EACV,OACE,KAAK,WAAW,aAAa,KAAK,KAAK,YACnC;GACE,KAAK,KAAK,KAAK,UAAU,MAAM;GAC/B,KAAK,QAAQ,SAAY,KAAK;GAC/B,GACD;GAEN"}
1
+ {"version":3,"file":"KeyFigureEmbedPlugin.mjs","names":[],"sources":["../../../src/plugins/embed/KeyFigureEmbedPlugin.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 KeyFigureMetaData } from \"@ndla/types-embed\";\nimport { KeyFigure } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const keyFigureEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as KeyFigureMetaData;\n const { title, subtitle, alt } = data.embedData;\n return (\n <KeyFigure\n title={title}\n subtitle={subtitle}\n image={\n data.status === \"success\" && data.data.metaImage\n ? {\n src: data.data.metaImage.image.imageUrl,\n alt: alt === undefined ? \"\" : alt,\n }\n : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,wBAAoC,YAAY;CAC3D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,EAAE,OAAO,UAAU,QAAQ,KAAK;AACtC,QACE,oBAAC;EACQ;EACG;EACV,OACE,KAAK,WAAW,aAAa,KAAK,KAAK,YACnC;GACE,KAAK,KAAK,KAAK,UAAU,MAAM;GAC/B,KAAK,QAAQ,SAAY,KAAK;GAC/B,GACD;GAEN"}
@@ -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;AAEhD,QAAO,oBAAC;EAAW,OADN,KAAK,MAAM,MAAM,aAAuB;EACrB,MAAM,KAAK;GAAmB"}
1
+ {"version":3,"file":"audioEmbedPlugin.mjs","names":[],"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,MAAa,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC;EAAW,OADN,KAAK,MAAM,MAAM,aAAuB;EACrB,MAAM,KAAK;GAAmB"}
@@ -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;AAEhD,QAAO,oBAAC;EAAgB,OADX,KAAK,MAAM,MAAM,aAAuB;EAChB,eAAe,KAAK;EAAe,MAAM,KAAK;GAAmB"}
1
+ {"version":3,"file":"brightcoveEmbedPlugin.mjs","names":[],"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,MAAa,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"campaignBlockPlugin.mjs","names":["campaignBlockPlugin: PluginType"],"sources":["../../../src/plugins/embed/campaignBlockPlugin.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 CampaignBlockMetaData } from \"@ndla/types-embed\";\nimport { CampaignBlock } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const campaignBlockPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as CampaignBlockMetaData;\n const embed = data.embedData;\n\n return (\n <CampaignBlock\n title={embed.title}\n description={embed.description}\n url={{ url: embed.url, text: embed.urlText }}\n path={opts.path}\n imageSide={embed.imageSide}\n image={\n data.status === \"success\" && data.data.image\n ? {\n src: data.data.image.image.imageUrl,\n alt: embed.alt === undefined ? \"\" : embed.alt,\n }\n : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAaA,uBAAmC,SAAS,GAAG,SAAS;CACnE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,QAAQ,KAAK;AAEnB,QACE,oBAAC;EACC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,KAAK;GAAE,KAAK,MAAM;GAAK,MAAM,MAAM;GAAS;EAC5C,MAAM,KAAK;EACX,WAAW,MAAM;EACjB,OACE,KAAK,WAAW,aAAa,KAAK,KAAK,QACnC;GACE,KAAK,KAAK,KAAK,MAAM,MAAM;GAC3B,KAAK,MAAM,QAAQ,SAAY,KAAK,MAAM;GAC3C,GACD;GAEN"}
1
+ {"version":3,"file":"campaignBlockPlugin.mjs","names":[],"sources":["../../../src/plugins/embed/campaignBlockPlugin.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 CampaignBlockMetaData } from \"@ndla/types-embed\";\nimport { CampaignBlock } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const campaignBlockPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as CampaignBlockMetaData;\n const embed = data.embedData;\n\n return (\n <CampaignBlock\n title={embed.title}\n description={embed.description}\n url={{ url: embed.url, text: embed.urlText }}\n path={opts.path}\n imageSide={embed.imageSide}\n image={\n data.status === \"success\" && data.data.image\n ? {\n src: data.data.image.image.imageUrl,\n alt: embed.alt === undefined ? \"\" : embed.alt,\n }\n : undefined\n }\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,uBAAmC,SAAS,GAAG,SAAS;CACnE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,QAAQ,KAAK;AAEnB,QACE,oBAAC;EACC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,KAAK;GAAE,KAAK,MAAM;GAAK,MAAM,MAAM;GAAS;EAC5C,MAAM,KAAK;EACX,WAAW,MAAM;EACjB,OACE,KAAK,WAAW,aAAa,KAAK,KAAK,QACnC;GACE,KAAK,KAAK,KAAK,MAAM,MAAM;GAC3B,KAAK,MAAM,QAAQ,SAAY,KAAK,MAAM;GAC3C,GACD;GAEN"}
@@ -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;AAEhD,QAAO,oBAAC,aAAU,OADL,KAAK,MAAM,MAAM,aAAuB,GACpB"}
1
+ {"version":3,"file":"codeEmbedPlugin.mjs","names":[],"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,MAAa,mBAA+B,YAAY;CACtD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,aAAU,OADL,KAAK,MAAM,MAAM,aAAuB,GACpB"}
@@ -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;AAEhD,QACE,oBAAC;EACC,OAHS,KAAK,MAAM,MAAM,aAAuB;EAIjD,MAAM,cAAc;EACpB,eAAe,cAAc;EAC7B,YAAY,cAAc;YAEzB,WAAW,QAAQ,UAAuB,WAAW;GACzC"}
1
+ {"version":3,"file":"conceptEmbedPlugin.mjs","names":[],"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,MAAa,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"contactBlockEmbedPlugin.mjs","names":["contactBlockEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/contactBlockEmbedPlugin.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 ContactBlockMetaData } from \"@ndla/types-embed\";\nimport { ContactBlock, contactBlockBackgrounds } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const contactBlockEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const embedData = JSON.parse(props[\"data-json\"] as string) as ContactBlockMetaData;\n const { name, email, description, background, jobTitle, alt } = embedData.embedData;\n const validBackground = contactBlockBackgrounds.find((bg) => bg === background);\n\n return (\n <ContactBlock\n image={embedData.status === \"success\" ? embedData.data.image : undefined}\n embedAlt={alt}\n description={description}\n email={email}\n jobTitle={jobTitle}\n name={name}\n lang={opts.articleLanguage}\n backgroundColor={validBackground}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAaA,2BAAuC,SAAS,GAAG,SAAS;CACvE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,YAAY,KAAK,MAAM,MAAM,aAAuB;CAC1D,MAAM,EAAE,MAAM,OAAO,aAAa,YAAY,UAAU,QAAQ,UAAU;CAC1E,MAAM,kBAAkB,wBAAwB,MAAM,OAAO,OAAO,WAAW;AAE/E,QACE,oBAAC;EACC,OAAO,UAAU,WAAW,YAAY,UAAU,KAAK,QAAQ;EAC/D,UAAU;EACG;EACN;EACG;EACJ;EACN,MAAM,KAAK;EACX,iBAAiB;GACjB"}
1
+ {"version":3,"file":"contactBlockEmbedPlugin.mjs","names":[],"sources":["../../../src/plugins/embed/contactBlockEmbedPlugin.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 ContactBlockMetaData } from \"@ndla/types-embed\";\nimport { ContactBlock, contactBlockBackgrounds } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const contactBlockEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const embedData = JSON.parse(props[\"data-json\"] as string) as ContactBlockMetaData;\n const { name, email, description, background, jobTitle, alt } = embedData.embedData;\n const validBackground = contactBlockBackgrounds.find((bg) => bg === background);\n\n return (\n <ContactBlock\n image={embedData.status === \"success\" ? embedData.data.image : undefined}\n embedAlt={alt}\n description={description}\n email={email}\n jobTitle={jobTitle}\n name={name}\n lang={opts.articleLanguage}\n backgroundColor={validBackground}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,2BAAuC,SAAS,GAAG,SAAS;CACvE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,YAAY,KAAK,MAAM,MAAM,aAAuB;CAC1D,MAAM,EAAE,MAAM,OAAO,aAAa,YAAY,UAAU,QAAQ,UAAU;CAC1E,MAAM,kBAAkB,wBAAwB,MAAM,OAAO,OAAO,WAAW;AAE/E,QACE,oBAAC;EACC,OAAO,UAAU,WAAW,YAAY,UAAU,KAAK,QAAQ;EAC/D,UAAU;EACG;EACN;EACG;EACJ;EACN,MAAM,KAAK;EACX,iBAAiB;GACjB"}
@@ -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;AAEhD,QACE,oBAAC;EAAiB,OAFP,KAAK,MAAM,MAAM,aAAuB;EAEV;YACtC,WAAW,QAAQ,UAAuB,KAAK;GAC/B"}
1
+ {"version":3,"file":"contentLinkEmbedPlugin.mjs","names":[],"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,MAAa,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"}
@@ -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;AAEhD,QAAO,oBAAC;EAAe,OADV,KAAK,MAAM,MAAM,aAAuB;YAChB,WAAW,QAAQ,UAAuB,KAAK;GAAkB"}
1
+ {"version":3,"file":"copyrightEmbedPlugin.mjs","names":[],"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,MAAa,wBAAoC,SAAS,SAAS;CACjE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC;EAAe,OADV,KAAK,MAAM,MAAM,aAAuB;YAChB,WAAW,QAAQ,UAAuB,KAAK;GAAkB"}
@@ -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;AAEhD,QAAO,oBAAC,iBAAc,OADT,KAAK,MAAM,MAAM,aAAuB,GAChB"}
1
+ {"version":3,"file":"externalEmbedPlugin.mjs","names":[],"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,MAAa,uBAAmC,YAAY;CAC1D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,iBAAc,OADT,KAAK,MAAM,MAAM,aAAuB,GAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"fileEmbedPlugin.mjs","names":["fileEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/fileEmbedPlugin.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 FileMetaData } from \"@ndla/types-embed\";\nimport { PdfFile, FileListElement } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const fileEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as FileMetaData;\n const { type, title, url, display } = data.embedData;\n if (type === \"pdf\" && display === \"block\") {\n return <PdfFile title={title} url={url} />;\n }\n return (\n <FileListElement\n url={url}\n title={title}\n fileExists={data.status === \"success\" ? !!data.data.exists : false}\n fileType={type}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAaA,mBAA+B,YAAY;CACtD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,EAAE,MAAM,OAAO,KAAK,YAAY,KAAK;AAC3C,KAAI,SAAS,SAAS,YAAY,QAChC,QAAO,oBAAC;EAAe;EAAY;GAAO;AAE5C,QACE,oBAAC;EACM;EACE;EACP,YAAY,KAAK,WAAW,YAAY,CAAC,CAAC,KAAK,KAAK,SAAS;EAC7D,UAAU;GACV"}
1
+ {"version":3,"file":"fileEmbedPlugin.mjs","names":[],"sources":["../../../src/plugins/embed/fileEmbedPlugin.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 FileMetaData } from \"@ndla/types-embed\";\nimport { PdfFile, FileListElement } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const fileEmbedPlugin: PluginType = (element) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as FileMetaData;\n const { type, title, url, display } = data.embedData;\n if (type === \"pdf\" && display === \"block\") {\n return <PdfFile title={title} url={url} />;\n }\n return (\n <FileListElement\n url={url}\n title={title}\n fileExists={data.status === \"success\" ? !!data.data.exists : false}\n fileType={type}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,mBAA+B,YAAY;CACtD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,EAAE,MAAM,OAAO,KAAK,YAAY,KAAK;AAC3C,KAAI,SAAS,SAAS,YAAY,QAChC,QAAO,oBAAC;EAAe;EAAY;GAAO;AAE5C,QACE,oBAAC;EACM;EACE;EACP,YAAY,KAAK,WAAW,YAAY,CAAC,CAAC,KAAK,KAAK,SAAS;EAC7D,UAAU;GACV"}
@@ -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;AAEhD,QAAO,oBAAC,iBAAc,OADT,KAAK,MAAM,MAAM,aAAuB,GAChB"}
1
+ {"version":3,"file":"footnoteEmbedPlugin.mjs","names":[],"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,MAAa,uBAAmC,YAAY;CAC1D,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,iBAAc,OADT,KAAK,MAAM,MAAM,aAAuB,GAChB"}
@@ -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;AAEhD,QAAO,oBAAC,YAAS,OADJ,KAAK,MAAM,MAAM,aAAuB,GACrB"}
1
+ {"version":3,"file":"h5pEmbedPlugin.mjs","names":[],"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,MAAa,kBAA8B,YAAY;CACrD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,YAAS,OADJ,KAAK,MAAM,MAAM,aAAuB,GACrB"}
@@ -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;AAEhD,QAAO,oBAAC,eAAY,OADP,KAAK,MAAM,MAAM,aAAuB,GAClB"}
1
+ {"version":3,"file":"iframeEmbedPlugin.mjs","names":[],"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,MAAa,qBAAiC,YAAY;CACxD,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC,eAAY,OADP,KAAK,MAAM,MAAM,aAAuB,GAClB"}
@@ -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;AAGhD,QACE,oBAAC;EACC,OAJS,KAAK,MAAM,MAAM,aAAuB;EAKjD,YAAY,KAAK;EACjB,MAAM,KAAK;EACX,eAAe,KAAK;GACpB"}
1
+ {"version":3,"file":"imageEmbedPlugin.mjs","names":[],"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,MAAa,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["embedPlugins: Record<string, PluginType>"],"sources":["../../../src/plugins/embed/index.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 { audioEmbedPlugin } from \"./audioEmbedPlugin\";\nimport { brightcoveEmbedPlugin } from \"./brightcoveEmbedPlugin\";\nimport { campaignBlockPlugin } from \"./campaignBlockPlugin\";\nimport { codeEmbedPlugin } from \"./codeEmbedPlugin\";\nimport { conceptEmbedPlugin } from \"./conceptEmbedPlugin\";\nimport { contactBlockEmbedPlugin } from \"./contactBlockEmbedPlugin\";\nimport { contentLinkEmbedPlugin } from \"./contentLinkEmbedPlugin\";\nimport { copyrightEmbedPlugin } from \"./copyrightEmbedPlugin\";\nimport { externalEmbedPlugin } from \"./externalEmbedPlugin\";\nimport { fileEmbedPlugin } from \"./fileEmbedPlugin\";\nimport { footnoteEmbedPlugin } from \"./footnoteEmbedPlugin\";\nimport { h5pEmbedPlugin } from \"./h5pEmbedPlugin\";\nimport { iframeEmbedPlugin } from \"./iframeEmbedPlugin\";\nimport { imageEmbedPlugin } from \"./imageEmbedPlugin\";\nimport { keyFigureEmbedPlugin } from \"./KeyFigureEmbedPlugin\";\nimport { linkBlockPlugin } from \"./linkBlockEmbedPlugin\";\nimport { pitchEmbedPlugin } from \"./pitchEmbedPlugin\";\nimport { relatedContentEmbedPlugin } from \"./relatedContentEmbedPlugin\";\nimport { symbolEmbedPlugin } from \"./symbolEmbedPlugin\";\nimport { uuDisclaimerEmbedPlugin } from \"./uuDisclaimerEmbedPlugin\";\nimport { type PluginType } from \"../types\";\n\nexport const embedPlugins: Record<string, PluginType> = {\n image: imageEmbedPlugin,\n audio: audioEmbedPlugin,\n h5p: h5pEmbedPlugin,\n \"code-block\": codeEmbedPlugin,\n external: externalEmbedPlugin,\n iframe: iframeEmbedPlugin,\n footnote: footnoteEmbedPlugin,\n brightcove: brightcoveEmbedPlugin,\n \"related-content\": relatedContentEmbedPlugin,\n \"content-link\": contentLinkEmbedPlugin,\n concept: conceptEmbedPlugin,\n pitch: pitchEmbedPlugin,\n file: fileEmbedPlugin,\n \"key-figure\": keyFigureEmbedPlugin,\n \"contact-block\": contactBlockEmbedPlugin,\n \"campaign-block\": campaignBlockPlugin,\n \"link-block\": linkBlockPlugin,\n \"uu-disclaimer\": uuDisclaimerEmbedPlugin,\n copyright: copyrightEmbedPlugin,\n symbol: symbolEmbedPlugin,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAaA,eAA2C;CACtD,OAAO;CACP,OAAO;CACP,KAAK;CACL,cAAc;CACd,UAAU;CACV,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,gBAAgB;CAChB,SAAS;CACT,OAAO;CACP,MAAM;CACN,cAAc;CACd,iBAAiB;CACjB,kBAAkB;CAClB,cAAc;CACd,iBAAiB;CACjB,WAAW;CACX,QAAQ;CACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/plugins/embed/index.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 { audioEmbedPlugin } from \"./audioEmbedPlugin\";\nimport { brightcoveEmbedPlugin } from \"./brightcoveEmbedPlugin\";\nimport { campaignBlockPlugin } from \"./campaignBlockPlugin\";\nimport { codeEmbedPlugin } from \"./codeEmbedPlugin\";\nimport { conceptEmbedPlugin } from \"./conceptEmbedPlugin\";\nimport { contactBlockEmbedPlugin } from \"./contactBlockEmbedPlugin\";\nimport { contentLinkEmbedPlugin } from \"./contentLinkEmbedPlugin\";\nimport { copyrightEmbedPlugin } from \"./copyrightEmbedPlugin\";\nimport { externalEmbedPlugin } from \"./externalEmbedPlugin\";\nimport { fileEmbedPlugin } from \"./fileEmbedPlugin\";\nimport { footnoteEmbedPlugin } from \"./footnoteEmbedPlugin\";\nimport { h5pEmbedPlugin } from \"./h5pEmbedPlugin\";\nimport { iframeEmbedPlugin } from \"./iframeEmbedPlugin\";\nimport { imageEmbedPlugin } from \"./imageEmbedPlugin\";\nimport { keyFigureEmbedPlugin } from \"./KeyFigureEmbedPlugin\";\nimport { linkBlockPlugin } from \"./linkBlockEmbedPlugin\";\nimport { pitchEmbedPlugin } from \"./pitchEmbedPlugin\";\nimport { relatedContentEmbedPlugin } from \"./relatedContentEmbedPlugin\";\nimport { symbolEmbedPlugin } from \"./symbolEmbedPlugin\";\nimport { uuDisclaimerEmbedPlugin } from \"./uuDisclaimerEmbedPlugin\";\nimport { type PluginType } from \"../types\";\n\nexport const embedPlugins: Record<string, PluginType> = {\n image: imageEmbedPlugin,\n audio: audioEmbedPlugin,\n h5p: h5pEmbedPlugin,\n \"code-block\": codeEmbedPlugin,\n external: externalEmbedPlugin,\n iframe: iframeEmbedPlugin,\n footnote: footnoteEmbedPlugin,\n brightcove: brightcoveEmbedPlugin,\n \"related-content\": relatedContentEmbedPlugin,\n \"content-link\": contentLinkEmbedPlugin,\n concept: conceptEmbedPlugin,\n pitch: pitchEmbedPlugin,\n file: fileEmbedPlugin,\n \"key-figure\": keyFigureEmbedPlugin,\n \"contact-block\": contactBlockEmbedPlugin,\n \"campaign-block\": campaignBlockPlugin,\n \"link-block\": linkBlockPlugin,\n \"uu-disclaimer\": uuDisclaimerEmbedPlugin,\n copyright: copyrightEmbedPlugin,\n symbol: symbolEmbedPlugin,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAa,eAA2C;CACtD,OAAO;CACP,OAAO;CACP,KAAK;CACL,cAAc;CACd,UAAU;CACV,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,mBAAmB;CACnB,gBAAgB;CAChB,SAAS;CACT,OAAO;CACP,MAAM;CACN,cAAc;CACd,iBAAiB;CACjB,kBAAkB;CAClB,cAAc;CACd,iBAAiB;CACjB,WAAW;CACX,QAAQ;CACT"}
@@ -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;AAGhD,QAAO,oBAAC;EAAU,GAFL,KAAK,MAAM,MAAM,aAAuB,CAE1B;EAAW,MAAM,KAAK;EAAM,iBAAiB,KAAK;GAAmB"}
1
+ {"version":3,"file":"linkBlockEmbedPlugin.mjs","names":[],"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,MAAa,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"pitchEmbedPlugin.mjs","names":["pitchEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/pitchEmbedPlugin.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 PitchMetaData } from \"@ndla/types-embed\";\nimport { Pitch } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const errorSvgSrc = `data:image/svg+xml;charset=UTF-8,%3Csvg fill='%238A8888' height='400' viewBox='0 0 24 12' width='100%25' xmlns='http://www.w3.org/2000/svg' style='background-color: %23EFF0F2'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath transform='scale(0.3) translate(28, 8.5)' d='M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z'/%3E%3C/svg%3E`;\n\nexport const pitchEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as PitchMetaData;\n const { title, description, url, alt } = data.embedData;\n return (\n <Pitch\n title={title}\n description={description}\n url={url}\n path={opts.path}\n metaImage={{\n alt: alt ? alt : \"\",\n url: data.status === \"success\" ? (data.data.metaImage?.image.imageUrl ?? errorSvgSrc) : errorSvgSrc,\n }}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,cAAc;AAE3B,MAAaA,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,EAAE,OAAO,aAAa,KAAK,QAAQ,KAAK;AAC9C,QACE,oBAAC;EACQ;EACM;EACR;EACL,MAAM,KAAK;EACX,WAAW;GACT,KAAK,MAAM,MAAM;GACjB,KAAK,KAAK,WAAW,YAAa,KAAK,KAAK,WAAW,MAAM,YAAY,cAAe;GACzF;GACD"}
1
+ {"version":3,"file":"pitchEmbedPlugin.mjs","names":[],"sources":["../../../src/plugins/embed/pitchEmbedPlugin.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 PitchMetaData } from \"@ndla/types-embed\";\nimport { Pitch } from \"@ndla/ui\";\nimport { type PluginType } from \"../types\";\n\nexport const errorSvgSrc = `data:image/svg+xml;charset=UTF-8,%3Csvg fill='%238A8888' height='400' viewBox='0 0 24 12' width='100%25' xmlns='http://www.w3.org/2000/svg' style='background-color: %23EFF0F2'%3E%3Cpath d='M0 0h24v24H0V0z' fill='none'/%3E%3Cpath transform='scale(0.3) translate(28, 8.5)' d='M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z'/%3E%3C/svg%3E`;\n\nexport const pitchEmbedPlugin: PluginType = (element, _, opts) => {\n const props = attributesToProps(element.attribs);\n const data = JSON.parse(props[\"data-json\"] as string) as PitchMetaData;\n const { title, description, url, alt } = data.embedData;\n return (\n <Pitch\n title={title}\n description={description}\n url={url}\n path={opts.path}\n metaImage={{\n alt: alt ? alt : \"\",\n url: data.status === \"success\" ? (data.data.metaImage?.image.imageUrl ?? errorSvgSrc) : errorSvgSrc,\n }}\n />\n );\n};\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,cAAc;AAE3B,MAAa,oBAAgC,SAAS,GAAG,SAAS;CAChE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;CAChD,MAAM,OAAO,KAAK,MAAM,MAAM,aAAuB;CACrD,MAAM,EAAE,OAAO,aAAa,KAAK,QAAQ,KAAK;AAC9C,QACE,oBAAC;EACQ;EACM;EACR;EACL,MAAM,KAAK;EACX,WAAW;GACT,KAAK,MAAM,MAAM;GACjB,KAAK,KAAK,WAAW,YAAa,KAAK,KAAK,WAAW,MAAM,YAAY,cAAe;GACzF;GACD"}
@@ -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;AAEhD,QAAO,oBAAC;EAAoB,OADf,KAAK,MAAM,MAAM,aAAuB;EACZ,SAAS,KAAK;EAAS,oBAAoB,KAAK;GAAkB"}
1
+ {"version":3,"file":"relatedContentEmbedPlugin.mjs","names":[],"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,MAAa,6BAAyC,SAAS,GAAG,SAAS;CACzE,MAAM,QAAQ,kBAAkB,QAAQ,QAAQ;AAEhD,QAAO,oBAAC;EAAoB,OADf,KAAK,MAAM,MAAM,aAAuB;EACZ,SAAS,KAAK;EAAS,oBAAoB,KAAK;GAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"symbolEmbedPlugin.mjs","names":["symbolEmbedPlugin: PluginType"],"sources":["../../../src/plugins/embed/symbolEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025-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, domToReact } from \"html-react-parser\";\nimport { type PluginType } from \"../types\";\n\nexport const symbolEmbedPlugin: PluginType = (element, _, __) => {\n return <>{domToReact(element.children as DOMNode[])}</>;\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAaA,qBAAiC,SAAS,GAAG,OAAO;AAC/D,QAAO,0CAAG,WAAW,QAAQ,SAAsB,GAAI"}
1
+ {"version":3,"file":"symbolEmbedPlugin.mjs","names":[],"sources":["../../../src/plugins/embed/symbolEmbedPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025-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, domToReact } from \"html-react-parser\";\nimport { type PluginType } from \"../types\";\n\nexport const symbolEmbedPlugin: PluginType = (element, _, __) => {\n return <>{domToReact(element.children as DOMNode[])}</>;\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,qBAAiC,SAAS,GAAG,OAAO;AAC/D,QAAO,0CAAG,WAAW,QAAQ,SAAsB,GAAI"}
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"uuDisclaimerEmbedPlugin.mjs","names":[],"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,MAAa,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"}
@@ -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;AAEjE,QACE,oBAAC;EAAG,GAFQ,kBAAkB,KAAK,QAAQ;EAE5B,MAAM,KAAK;YACvB,WAAW,KAAK,UAAuB,cAAc;GACnD"}
1
+ {"version":3,"file":"h3Plugin.mjs","names":[],"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,MAAa,YAAwB,MAAM,eAAe,SAAS;AAEjE,QACE,oBAAC;EAAG,GAFQ,kBAAkB,KAAK,QAAQ;EAE5B,MAAM,KAAK;YACvB,WAAW,KAAK,UAAuB,cAAc;GACnD"}
@@ -1,7 +1,7 @@
1
1
  import { anchorPlugin } from "./anchorPlugin.mjs";
2
2
  import { asidePlugin } from "./asidePlugin.mjs";
3
3
  import { blockquotePlugin } from "./blockquotePlugin.mjs";
4
- import { copyParagraphPlugin } from "./copyParagraphPlugin.mjs";
4
+ import { anchorHeadingPlugin } from "./anchorHeadingPlugin.mjs";
5
5
  import { detailsPlugin } from "./detailsPlugin.mjs";
6
6
  import { divPlugin } from "./divPlugin.mjs";
7
7
  import { dlPlugin } from "./dlPlugin.mjs";
@@ -23,7 +23,7 @@ import { ulPlugin } from "./ulPlugin.mjs";
23
23
  *
24
24
  */
25
25
  const plugins = {
26
- h2: copyParagraphPlugin,
26
+ h2: anchorHeadingPlugin,
27
27
  h3: h3Plugin,
28
28
  ol: olPlugin,
29
29
  p: paragraphPlugin,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["plugins: Record<string, PluginType>"],"sources":["../../src/plugins/index.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 { anchorPlugin } from \"./anchorPlugin\";\nimport { asidePlugin } from \"./asidePlugin\";\nimport { blockquotePlugin } from \"./blockquotePlugin\";\nimport { copyParagraphPlugin } from \"./copyParagraphPlugin\";\nimport { detailsPlugin } from \"./detailsPlugin\";\nimport { divPlugin } from \"./divPlugin\";\nimport { dlPlugin } from \"./dlPlugin\";\nimport { h3Plugin } from \"./h3Plugin\";\nimport { mathPlugin } from \"./mathPlugin\";\nimport { navPlugin } from \"./navPlugin\";\nimport { olPlugin } from \"./olPlugin\";\nimport { paragraphPlugin } from \"./paragraphPlugin\";\nimport { summaryPlugin } from \"./summaryPlugin\";\nimport { tablePlugin } from \"./tablePlugin\";\nimport { type PluginType } from \"./types\";\nimport { ulPlugin } from \"./ulPlugin\";\n\nexport const plugins: Record<string, PluginType> = {\n h2: copyParagraphPlugin,\n h3: h3Plugin,\n ol: olPlugin,\n p: paragraphPlugin,\n math: mathPlugin,\n div: divPlugin,\n table: tablePlugin,\n aside: asidePlugin,\n ul: ulPlugin,\n nav: navPlugin,\n a: anchorPlugin,\n summary: summaryPlugin,\n details: detailsPlugin,\n dl: dlPlugin,\n blockquote: blockquotePlugin,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAaA,UAAsC;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,IAAI;CACJ,KAAK;CACL,GAAG;CACH,SAAS;CACT,SAAS;CACT,IAAI;CACJ,YAAY;CACb"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/plugins/index.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 { anchorPlugin } from \"./anchorPlugin\";\nimport { asidePlugin } from \"./asidePlugin\";\nimport { blockquotePlugin } from \"./blockquotePlugin\";\nimport { anchorHeadingPlugin } from \"./anchorHeadingPlugin\";\nimport { detailsPlugin } from \"./detailsPlugin\";\nimport { divPlugin } from \"./divPlugin\";\nimport { dlPlugin } from \"./dlPlugin\";\nimport { h3Plugin } from \"./h3Plugin\";\nimport { mathPlugin } from \"./mathPlugin\";\nimport { navPlugin } from \"./navPlugin\";\nimport { olPlugin } from \"./olPlugin\";\nimport { paragraphPlugin } from \"./paragraphPlugin\";\nimport { summaryPlugin } from \"./summaryPlugin\";\nimport { tablePlugin } from \"./tablePlugin\";\nimport { type PluginType } from \"./types\";\nimport { ulPlugin } from \"./ulPlugin\";\n\nexport const plugins: Record<string, PluginType> = {\n h2: anchorHeadingPlugin,\n h3: h3Plugin,\n ol: olPlugin,\n p: paragraphPlugin,\n math: mathPlugin,\n div: divPlugin,\n table: tablePlugin,\n aside: asidePlugin,\n ul: ulPlugin,\n nav: navPlugin,\n a: anchorPlugin,\n summary: summaryPlugin,\n details: detailsPlugin,\n dl: dlPlugin,\n blockquote: blockquotePlugin,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,UAAsC;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,IAAI;CACJ,KAAK;CACL,GAAG;CACH,SAAS;CACT,SAAS;CACT,IAAI;CACJ,YAAY;CACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"mathPlugin.mjs","names":["mathPlugin: PluginType"],"sources":["../../src/plugins/mathPlugin.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 PluginType } from \"./types\";\nexport const mathPlugin: PluginType = (node) => {\n const { \"data-math\": mathContent, ...props } = attributesToProps(node.attribs);\n return (\n // @ts-expect-error - math is a valid tag\n <math xmlns=\"http://www.w3.org/1998/Math/MathML\" {...props} dangerouslySetInnerHTML={{ __html: mathContent }} />\n );\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAaA,cAA0B,SAAS;CAC9C,MAAM,EAAE,aAAa,aAAa,GAAG,UAAU,kBAAkB,KAAK,QAAQ;AAC9E,QAEE,oBAAC;EAAK,OAAM;EAAqC,GAAI;EAAO,yBAAyB,EAAE,QAAQ,aAAa;GAAI"}
1
+ {"version":3,"file":"mathPlugin.mjs","names":[],"sources":["../../src/plugins/mathPlugin.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 PluginType } from \"./types\";\nexport const mathPlugin: PluginType = (node) => {\n const { \"data-math\": mathContent, ...props } = attributesToProps(node.attribs);\n return (\n // @ts-expect-error - math is a valid tag\n <math xmlns=\"http://www.w3.org/1998/Math/MathML\" {...props} dangerouslySetInnerHTML={{ __html: mathContent }} />\n );\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,cAA0B,SAAS;CAC9C,MAAM,EAAE,aAAa,aAAa,GAAG,UAAU,kBAAkB,KAAK,QAAQ;AAC9E,QAEE,oBAAC;EAAK,OAAM;EAAqC,GAAI;EAAO,yBAAyB,EAAE,QAAQ,aAAa;GAAI"}
@@ -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,kBAEhC,QAAO,oBAAC;EAAiB,GADX,kBAAkB,KAAK,QAAQ;YACR,WAAW,KAAK,UAAuB,KAAK;GAAoB;AAEvG,QAAO"}
1
+ {"version":3,"file":"navPlugin.mjs","names":[],"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,MAAa,aAAyB,MAAM,SAAS;AACnD,KAAI,KAAK,QAAQ,iBAAiB,kBAEhC,QAAO,oBAAC;EAAiB,GADX,kBAAkB,KAAK,QAAQ;YACR,WAAW,KAAK,UAAuB,KAAK;GAAoB;AAEvG,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"olPlugin.mjs","names":["olPlugin: PluginType"],"sources":["../../src/plugins/olPlugin.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 { OrderedList } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\nexport const olPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n const variantProp = node.attribs[\"data-type\"] === \"letters\" ? ({ variant: \"letters\" } as const) : {};\n\n return (\n <OrderedList {...props} {...variantProp} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </OrderedList>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAaA,YAAwB,MAAM,eAAe,SAAS;CACjE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;CAC7C,MAAM,cAAc,KAAK,QAAQ,iBAAiB,YAAa,EAAE,SAAS,WAAW,GAAa,EAAE;AAEpG,QACE,oBAAC;EAAY,GAAI;EAAO,GAAI;EAAa,MAAM,KAAK;YACjD,WAAW,KAAK,UAAuB,cAAc;GAC1C"}
1
+ {"version":3,"file":"olPlugin.mjs","names":[],"sources":["../../src/plugins/olPlugin.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 { OrderedList } from \"@ndla/primitives\";\nimport { type PluginType } from \"./types\";\nexport const olPlugin: PluginType = (node, converterOpts, opts) => {\n const props = attributesToProps(node.attribs);\n const variantProp = node.attribs[\"data-type\"] === \"letters\" ? ({ variant: \"letters\" } as const) : {};\n\n return (\n <OrderedList {...props} {...variantProp} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </OrderedList>\n );\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,YAAwB,MAAM,eAAe,SAAS;CACjE,MAAM,QAAQ,kBAAkB,KAAK,QAAQ;CAC7C,MAAM,cAAc,KAAK,QAAQ,iBAAiB,YAAa,EAAE,SAAS,WAAW,GAAa,EAAE;AAEpG,QACE,oBAAC;EAAY,GAAI;EAAO,GAAI;EAAa,MAAM,KAAK;YACjD,WAAW,KAAK,UAAuB,cAAc;GAC1C"}
@@ -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;AAExE,QACE,oBAAC;EAAE,GAFS,kBAAkB,KAAK,QAAQ;EAE7B,MAAM,KAAK;YACtB,WAAW,KAAK,UAAuB,cAAc;GACpD"}
1
+ {"version":3,"file":"paragraphPlugin.mjs","names":[],"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,MAAa,mBAA+B,MAAM,eAAe,SAAS;AAExE,QACE,oBAAC;EAAE,GAFS,kBAAkB,KAAK,QAAQ;EAE7B,MAAM,KAAK;YACtB,WAAW,KAAK,UAAuB,cAAc;GACpD"}
@@ -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;AAGhE,QACE,oBAAC;EAAqB,GAHV,kBAAkB,KAAK,QAAQ;YAGT,WAAW,KAAK,UAAuB,cAAc;GAAwB"}
1
+ {"version":3,"file":"summaryPlugin.mjs","names":[],"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,MAAa,iBAA6B,MAAM,kBAAkB;AAGhE,QACE,oBAAC;EAAqB,GAHV,kBAAkB,KAAK,QAAQ;YAGT,WAAW,KAAK,UAAuB,cAAc;GAAwB"}
@@ -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;AAEpE,QACE,oBAAC;EAAM,GAFK,kBAAkB,KAAK,QAAQ;EAEzB,MAAM,KAAK;YAC1B,WAAW,KAAK,UAAuB,cAAc;GAChD"}
1
+ {"version":3,"file":"tablePlugin.mjs","names":[],"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,MAAa,eAA2B,MAAM,eAAe,SAAS;AAEpE,QACE,oBAAC;EAAM,GAFK,kBAAkB,KAAK,QAAQ;EAEzB,MAAM,KAAK;YAC1B,WAAW,KAAK,UAAuB,cAAc;GAChD"}
@@ -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;AAEjE,QACE,oBAAC;EAAc,GAFH,kBAAkB,KAAK,QAAQ;EAEjB,WAAW,KAAK,QAAQ;EAAO,MAAM,KAAK;YACjE,WAAW,KAAK,UAAuB,cAAc;GACxC"}
1
+ {"version":3,"file":"ulPlugin.mjs","names":[],"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,MAAa,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"transform.mjs","names":["options: HTMLReactParserOptions"],"sources":["../src/transform.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 parse, { type HTMLReactParserOptions } from \"html-react-parser\";\nimport { type MetaData } from \"@ndla/types-embed\";\nimport { UnknownEmbed } from \"@ndla/ui\";\nimport { plugins } from \"./plugins\";\nimport { embedPlugins } from \"./plugins/embed\";\nimport { type TransformOptions } from \"./plugins/types\";\n\nexport const transform = (content: string, opts: TransformOptions) => {\n const options: HTMLReactParserOptions = {\n replace: (node) => {\n if (!(\"attribs\" in node)) {\n return;\n }\n if (plugins[node.name]) {\n return plugins[node.name](node, options, opts);\n }\n if (node.name === \"ndlaembed\") {\n if (embedPlugins[node.attribs[\"data-resource\"]]) {\n return embedPlugins[node.attribs[\"data-resource\"]](node, options, opts);\n }\n const embed = JSON.parse(node.attribs[\"data-json\"]) as MetaData<any, any>;\n return <UnknownEmbed embed={embed} />;\n }\n },\n };\n const replaced = parse(content, options);\n\n return replaced;\n};\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,aAAa,SAAiB,SAA2B;CACpE,MAAMA,UAAkC,EACtC,UAAU,SAAS;AACjB,MAAI,EAAE,aAAa,MACjB;AAEF,MAAI,QAAQ,KAAK,MACf,QAAO,QAAQ,KAAK,MAAM,MAAM,SAAS,KAAK;AAEhD,MAAI,KAAK,SAAS,aAAa;AAC7B,OAAI,aAAa,KAAK,QAAQ,kBAC5B,QAAO,aAAa,KAAK,QAAQ,kBAAkB,MAAM,SAAS,KAAK;AAGzE,UAAO,oBAAC,gBAAa,OADP,KAAK,MAAM,KAAK,QAAQ,aAAa,GACd;;IAG1C;AAGD,QAFiB,MAAM,SAAS,QAAQ"}
1
+ {"version":3,"file":"transform.mjs","names":[],"sources":["../src/transform.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 parse, { type HTMLReactParserOptions } from \"html-react-parser\";\nimport { type MetaData } from \"@ndla/types-embed\";\nimport { UnknownEmbed } from \"@ndla/ui\";\nimport { plugins } from \"./plugins\";\nimport { embedPlugins } from \"./plugins/embed\";\nimport { type TransformOptions } from \"./plugins/types\";\n\nexport const transform = (content: string, opts: TransformOptions) => {\n const options: HTMLReactParserOptions = {\n replace: (node) => {\n if (!(\"attribs\" in node)) {\n return;\n }\n if (plugins[node.name]) {\n return plugins[node.name](node, options, opts);\n }\n if (node.name === \"ndlaembed\") {\n if (embedPlugins[node.attribs[\"data-resource\"]]) {\n return embedPlugins[node.attribs[\"data-resource\"]](node, options, opts);\n }\n const embed = JSON.parse(node.attribs[\"data-json\"]) as MetaData<any, any>;\n return <UnknownEmbed embed={embed} />;\n }\n },\n };\n const replaced = parse(content, options);\n\n return replaced;\n};\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAa,aAAa,SAAiB,SAA2B;CACpE,MAAM,UAAkC,EACtC,UAAU,SAAS;AACjB,MAAI,EAAE,aAAa,MACjB;AAEF,MAAI,QAAQ,KAAK,MACf,QAAO,QAAQ,KAAK,MAAM,MAAM,SAAS,KAAK;AAEhD,MAAI,KAAK,SAAS,aAAa;AAC7B,OAAI,aAAa,KAAK,QAAQ,kBAC5B,QAAO,aAAa,KAAK,QAAQ,kBAAkB,MAAM,SAAS,KAAK;AAGzE,UAAO,oBAAC,gBAAa,OADP,KAAK,MAAM,KAAK,QAAQ,aAAa,GACd;;IAG1C;AAGD,QAFiB,MAAM,SAAS,QAAQ"}
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
  import { type PluginType } from "./types";
9
- export declare const copyParagraphPlugin: PluginType;
9
+ export declare const anchorHeadingPlugin: PluginType;
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
2
  let html_react_parser = require("html-react-parser");
3
- let __ndla_ui = require("@ndla/ui");
3
+ let _ndla_ui = require("@ndla/ui");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
 
6
- //#region src/plugins/copyParagraphPlugin.tsx
6
+ //#region src/plugins/anchorHeadingPlugin.tsx
7
7
  /**
8
8
  * Copyright (c) 2023-present, NDLA.
9
9
  *
@@ -11,9 +11,9 @@ let react_jsx_runtime = require("react/jsx-runtime");
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  *
13
13
  */
14
- const copyParagraphPlugin = (node, converterOpts, opts) => {
14
+ const anchorHeadingPlugin = (node, converterOpts, opts) => {
15
15
  const parent = node.parent;
16
- if (parent?.name === "section" || parent?.name === "div" && Object.keys(parent.attribs ?? {}).length === 0 || parent?.name === "ndlaembed" && parent.attribs["data-resource"] === "uu-disclaimer") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_ui.CopyParagraphButton, {
16
+ if (parent?.name === "section" || parent?.name === "div" && Object.keys(parent.attribs ?? {}).length === 0 || parent?.name === "ndlaembed" && parent.attribs["data-resource"] === "uu-disclaimer") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ndla_ui.AnchorHeading, {
17
17
  copyText: node.attribs["data-text"],
18
18
  lang: opts.articleLanguage,
19
19
  children: (0, html_react_parser.domToReact)(node.children, converterOpts)
@@ -22,5 +22,5 @@ const copyParagraphPlugin = (node, converterOpts, opts) => {
22
22
  };
23
23
 
24
24
  //#endregion
25
- exports.copyParagraphPlugin = copyParagraphPlugin;
26
- //# sourceMappingURL=copyParagraphPlugin.js.map
25
+ exports.anchorHeadingPlugin = anchorHeadingPlugin;
26
+ //# sourceMappingURL=anchorHeadingPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchorHeadingPlugin.js","names":["AnchorHeading"],"sources":["../../src/plugins/anchorHeadingPlugin.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, Element, domToReact } from \"html-react-parser\";\nimport { AnchorHeading } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\nexport const anchorHeadingPlugin: PluginType = (node, converterOpts, opts) => {\n const parent = node.parent as Element | undefined;\n if (\n parent?.name === \"section\" ||\n (parent?.name === \"div\" && Object.keys(parent.attribs ?? {}).length === 0) ||\n (parent?.name === \"ndlaembed\" && parent.attribs[\"data-resource\"] === \"uu-disclaimer\")\n ) {\n return (\n <AnchorHeading copyText={node.attribs[\"data-text\"]} lang={opts.articleLanguage}>\n {domToReact(node.children as DOMNode[], converterOpts)}\n </AnchorHeading>\n );\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,uBAAmC,MAAM,eAAe,SAAS;CAC5E,MAAM,SAAS,KAAK;AACpB,KACE,QAAQ,SAAS,aAChB,QAAQ,SAAS,SAAS,OAAO,KAAK,OAAO,WAAW,EAAE,CAAC,CAAC,WAAW,KACvE,QAAQ,SAAS,eAAe,OAAO,QAAQ,qBAAqB,gBAErE,QACE,2CAACA;EAAc,UAAU,KAAK,QAAQ;EAAc,MAAM,KAAK;8CACjD,KAAK,UAAuB,cAAc;GACxC;AAGpB,QAAO"}
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
2
  let html_react_parser = require("html-react-parser");
3
- let __ndla_ui = require("@ndla/ui");
4
- let __ndla_safelink = require("@ndla/safelink");
3
+ let _ndla_ui = require("@ndla/ui");
4
+ let _ndla_safelink = require("@ndla/safelink");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
6
 
7
7
  //#region src/plugins/anchorPlugin.tsx
@@ -14,12 +14,12 @@ let react_jsx_runtime = require("react/jsx-runtime");
14
14
  */
15
15
  const anchorPlugin = (node, opts, { path, isOembed }) => {
16
16
  const props = (0, html_react_parser.attributesToProps)(node.attribs);
17
- const href = (0, __ndla_ui.getPossiblyRelativeUrl)(props.href, path);
17
+ const href = (0, _ndla_ui.getPossiblyRelativeUrl)(props.href, path);
18
18
  const oembedProps = isOembed ? {
19
19
  target: "_blank",
20
20
  rel: "noreferrer"
21
21
  } : {};
22
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
22
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ndla_safelink.SafeLink, {
23
23
  ...props,
24
24
  to: href,
25
25
  ...oembedProps,
@@ -1 +1 @@
1
- {"version":3,"file":"anchorPlugin.js","names":["anchorPlugin: PluginType","oembedProps: AnchorHTMLAttributes<HTMLAnchorElement>","SafeLink"],"sources":["../../src/plugins/anchorPlugin.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 { AnchorHTMLAttributes } from \"react\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { getPossiblyRelativeUrl } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const anchorPlugin: PluginType = (node, opts, { path, isOembed }) => {\n const props = attributesToProps(node.attribs);\n const href = getPossiblyRelativeUrl(props.href as string, path);\n\n const oembedProps: AnchorHTMLAttributes<HTMLAnchorElement> = isOembed ? { target: \"_blank\", rel: \"noreferrer\" } : {};\n\n return (\n <SafeLink {...props} to={href} {...oembedProps} target=\"\">\n {domToReact(node.children as DOMNode[], opts)}\n </SafeLink>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAaA,gBAA4B,MAAM,MAAM,EAAE,MAAM,eAAe;CAC1E,MAAM,iDAA0B,KAAK,QAAQ;CAC7C,MAAM,6CAA8B,MAAM,MAAgB,KAAK;CAE/D,MAAMC,cAAuD,WAAW;EAAE,QAAQ;EAAU,KAAK;EAAc,GAAG,EAAE;AAEpH,QACE,2CAACC;EAAS,GAAI;EAAO,IAAI;EAAM,GAAI;EAAa,QAAO;8CACzC,KAAK,UAAuB,KAAK;GACpC"}
1
+ {"version":3,"file":"anchorPlugin.js","names":["SafeLink"],"sources":["../../src/plugins/anchorPlugin.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 { AnchorHTMLAttributes } from \"react\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { getPossiblyRelativeUrl } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\n\nexport const anchorPlugin: PluginType = (node, opts, { path, isOembed }) => {\n const props = attributesToProps(node.attribs);\n const href = getPossiblyRelativeUrl(props.href as string, path);\n\n const oembedProps: AnchorHTMLAttributes<HTMLAnchorElement> = isOembed ? { target: \"_blank\", rel: \"noreferrer\" } : {};\n\n return (\n <SafeLink {...props} to={href} {...oembedProps} target=\"\">\n {domToReact(node.children as DOMNode[], opts)}\n </SafeLink>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAa,gBAA4B,MAAM,MAAM,EAAE,MAAM,eAAe;CAC1E,MAAM,iDAA0B,KAAK,QAAQ;CAC7C,MAAM,4CAA8B,MAAM,MAAgB,KAAK;CAE/D,MAAM,cAAuD,WAAW;EAAE,QAAQ;EAAU,KAAK;EAAc,GAAG,EAAE;AAEpH,QACE,2CAACA;EAAS,GAAI;EAAO,IAAI;EAAM,GAAI;EAAa,QAAO;8CACzC,KAAK,UAAuB,KAAK;GACpC"}
@@ -1,6 +1,6 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
2
  let html_react_parser = require("html-react-parser");
3
- let __ndla_ui = require("@ndla/ui");
3
+ let _ndla_ui = require("@ndla/ui");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
5
 
6
6
  //#region src/plugins/asidePlugin.tsx
@@ -12,7 +12,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
12
12
  *
13
13
  */
14
14
  const asidePlugin = (node, opts) => {
15
- if (node.attribs["data-type"] === "factAside") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_ui.FactBox, { children: (0, html_react_parser.domToReact)(node.children, opts) });
15
+ if (node.attribs["data-type"] === "factAside") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ndla_ui.FactBox, { children: (0, html_react_parser.domToReact)(node.children, opts) });
16
16
  return null;
17
17
  };
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"asidePlugin.js","names":["asidePlugin: PluginType","FactBox"],"sources":["../../src/plugins/asidePlugin.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, domToReact } from \"html-react-parser\";\nimport { FactBox } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\nexport const asidePlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"factAside\") {\n return <FactBox>{domToReact(node.children as DOMNode[], opts)}</FactBox>;\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAaA,eAA2B,MAAM,SAAS;AACrD,KAAI,KAAK,QAAQ,iBAAiB,YAChC,QAAO,2CAACC,iEAAoB,KAAK,UAAuB,KAAK,GAAW;AAE1E,QAAO"}
1
+ {"version":3,"file":"asidePlugin.js","names":["FactBox"],"sources":["../../src/plugins/asidePlugin.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, domToReact } from \"html-react-parser\";\nimport { FactBox } from \"@ndla/ui\";\nimport { type PluginType } from \"./types\";\nexport const asidePlugin: PluginType = (node, opts) => {\n if (node.attribs[\"data-type\"] === \"factAside\") {\n return <FactBox>{domToReact(node.children as DOMNode[], opts)}</FactBox>;\n }\n return null;\n};\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,eAA2B,MAAM,SAAS;AACrD,KAAI,KAAK,QAAQ,iBAAiB,YAChC,QAAO,2CAACA,gEAAoB,KAAK,UAAuB,KAAK,GAAW;AAE1E,QAAO"}
@@ -1,7 +1,7 @@
1
1
  const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
2
2
  let html_react_parser = require("html-react-parser");
3
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
- let __ndla_primitives = require("@ndla/primitives");
4
+ let _ndla_primitives = require("@ndla/primitives");
5
5
 
6
6
  //#region src/plugins/blockquotePlugin.tsx
7
7
  /**
@@ -13,7 +13,7 @@ let __ndla_primitives = require("@ndla/primitives");
13
13
  */
14
14
  const blockquotePlugin = (node, opts) => {
15
15
  const { "data-variant": variant, ...props } = (0, html_react_parser.attributesToProps)(node.attribs);
16
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.BlockQuote, {
16
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ndla_primitives.BlockQuote, {
17
17
  ...props,
18
18
  variant: variant === "colored" ? "brand1" : void 0,
19
19
  children: (0, html_react_parser.domToReact)(node.children, opts)