@intlayer/design-system 9.3.0 → 9.3.1

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 (174) hide show
  1. package/README.md +22 -22
  2. package/dist/esm/api/hooks/utils.mjs +2 -1
  3. package/dist/esm/api/hooks/utils.mjs.map +1 -1
  4. package/dist/esm/api/index.mjs +2 -2
  5. package/dist/esm/api/useAuth/useOAuth2.mjs +13 -3
  6. package/dist/esm/api/useAuth/useOAuth2.mjs.map +1 -1
  7. package/dist/esm/api/useAuth/useSession.mjs +6 -4
  8. package/dist/esm/api/useAuth/useSession.mjs.map +1 -1
  9. package/dist/esm/components/Accordion/Accordion.mjs +1 -1
  10. package/dist/esm/components/Avatar/index.mjs +1 -1
  11. package/dist/esm/components/Badge/index.mjs +1 -1
  12. package/dist/esm/components/Breadcrumb/index.mjs +1 -1
  13. package/dist/esm/components/Browser/Browser.mjs +1 -1
  14. package/dist/esm/components/Button/Button.mjs +1 -1
  15. package/dist/esm/components/Carousel/index.mjs +1 -1
  16. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs +1 -1
  17. package/dist/esm/components/Command/index.mjs +1 -1
  18. package/dist/esm/components/Container/index.mjs +1 -1
  19. package/dist/esm/components/ContentEditor/ContentEditor.mjs +1 -1
  20. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs +1 -1
  21. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +2 -2
  22. package/dist/esm/components/CopyButton/index.mjs +1 -1
  23. package/dist/esm/components/CopyToClipboard/index.mjs +1 -1
  24. package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +2 -1
  25. package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs.map +1 -1
  26. package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +2 -1
  27. package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs.map +1 -1
  28. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs +2 -2
  29. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +3 -3
  30. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  31. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +7 -7
  32. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +2 -2
  33. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +8 -7
  34. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  35. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +8 -5
  36. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  37. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs +2 -1
  38. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  39. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +3 -3
  40. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs +2 -1
  41. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -2
  43. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +1 -1
  44. package/dist/esm/components/EditableField/EditableFieldInput.mjs +6 -5
  45. package/dist/esm/components/EditableField/EditableFieldInput.mjs.map +1 -1
  46. package/dist/esm/components/EditableField/EditableFieldLayout.mjs +1 -1
  47. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs +2 -1
  48. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  49. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  50. package/dist/esm/components/HTMLRender/HTMLRender.mjs +5 -3
  51. package/dist/esm/components/HTMLRender/HTMLRender.mjs.map +1 -1
  52. package/dist/esm/components/HideShow/index.mjs +1 -1
  53. package/dist/esm/components/IDE/Code.mjs.map +1 -1
  54. package/dist/esm/components/IDE/CodeBlockClient.mjs.map +1 -1
  55. package/dist/esm/components/IDE/CodeBlockHighlight.mjs +3 -14
  56. package/dist/esm/components/IDE/CodeBlockHighlight.mjs.map +1 -1
  57. package/dist/esm/components/IDE/CodeBlockServer.mjs +14 -12
  58. package/dist/esm/components/IDE/CodeBlockServer.mjs.map +1 -1
  59. package/dist/esm/components/IDE/CodeBlockShiki.mjs +32 -86
  60. package/dist/esm/components/IDE/CodeBlockShiki.mjs.map +1 -1
  61. package/dist/esm/components/IDE/FileTree.mjs +3 -2
  62. package/dist/esm/components/IDE/FileTree.mjs.map +1 -1
  63. package/dist/esm/components/IDE/MarkDownRender.mjs.map +1 -1
  64. package/dist/esm/components/IDE/shikiLanguages.mjs +122 -0
  65. package/dist/esm/components/IDE/shikiLanguages.mjs.map +1 -0
  66. package/dist/esm/components/Input/Checkbox.mjs +1 -1
  67. package/dist/esm/components/Input/Input.mjs +1 -1
  68. package/dist/esm/components/Input/InputPassword.mjs +1 -1
  69. package/dist/esm/components/Input/OTPInput.mjs +5 -4
  70. package/dist/esm/components/Input/OTPInput.mjs.map +1 -1
  71. package/dist/esm/components/Input/Radio.mjs +1 -1
  72. package/dist/esm/components/Input/SearchInput.mjs +1 -1
  73. package/dist/esm/components/LanguageBackground/LanguageBackground.mjs +2 -1
  74. package/dist/esm/components/LanguageBackground/LanguageBackground.mjs.map +1 -1
  75. package/dist/esm/components/Link/Link.mjs +1 -1
  76. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +7 -6
  77. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  78. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
  79. package/dist/esm/components/MarkDownRender/MarkDownIframe.mjs +1 -1
  80. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +12 -7
  81. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  82. package/dist/esm/components/MarkdownEditor/generative/AICompletionCommands.mjs +1 -1
  83. package/dist/esm/components/MarkdownEditor/generative/AISelector.mjs +1 -1
  84. package/dist/esm/components/MarkdownEditor/generative/AISelectorCommands.mjs +1 -1
  85. package/dist/esm/components/MarkdownEditor/generative/GenerativeMenuSwitch.mjs +1 -1
  86. package/dist/esm/components/MarkdownEditor/selectors/ColorSelector.mjs +1 -1
  87. package/dist/esm/components/MarkdownEditor/selectors/LinkSelector.mjs +1 -1
  88. package/dist/esm/components/MarkdownEditor/selectors/NodeSelector.mjs +1 -1
  89. package/dist/esm/components/MarkdownEditor/selectors/TextButtons.mjs +1 -1
  90. package/dist/esm/components/MarkdownEditor/slashCommand.mjs +1 -1
  91. package/dist/esm/components/Modal/Modal.mjs +3 -3
  92. package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
  93. package/dist/esm/components/Pagination/Pagination.mjs +2 -2
  94. package/dist/esm/components/PressableSpan/PressableSpan.mjs +0 -2
  95. package/dist/esm/components/PressableSpan/PressableSpan.mjs.map +1 -1
  96. package/dist/esm/components/RightDrawer/RightDrawer.mjs +4 -4
  97. package/dist/esm/components/Select/Multiselect.mjs +3 -5
  98. package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
  99. package/dist/esm/components/Select/Select.mjs +1 -1
  100. package/dist/esm/components/SwitchSelector/SwitchSelector.mjs +1 -1
  101. package/dist/esm/components/SwitchSelector/VerticalSwitchSelector.mjs +1 -1
  102. package/dist/esm/components/Tab/Tab.mjs +2 -2
  103. package/dist/esm/components/TabSelector/TabSelector.mjs +1 -1
  104. package/dist/esm/components/Table/ExpandButton.mjs +1 -1
  105. package/dist/esm/components/Tag/index.mjs +1 -1
  106. package/dist/esm/components/Terminal/Terminal.mjs +7 -5
  107. package/dist/esm/components/Terminal/Terminal.mjs.map +1 -1
  108. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs +6 -3
  109. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  110. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs +1 -1
  111. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs +1 -1
  112. package/dist/esm/components/Toaster/Toast.mjs +1 -1
  113. package/dist/esm/components/Toaster/useToast.mjs +1 -1
  114. package/dist/esm/components/Toaster/useToast.mjs.map +1 -1
  115. package/dist/esm/hooks/index.mjs +8 -8
  116. package/dist/esm/hooks/useScrollDetection.mjs +4 -2
  117. package/dist/esm/hooks/useScrollDetection.mjs.map +1 -1
  118. package/dist/esm/providers/DeferredAuthProvider.mjs +75 -0
  119. package/dist/esm/providers/DeferredAuthProvider.mjs.map +1 -0
  120. package/dist/esm/providers/ReactQueryProvider.mjs +4 -4
  121. package/dist/esm/providers/ReactQueryProvider.mjs.map +1 -1
  122. package/dist/esm/providers/index.mjs +2 -1
  123. package/dist/esm/routes.mjs +12 -11
  124. package/dist/esm/routes.mjs.map +1 -1
  125. package/dist/esm/structured-data/buildAuthorJsonLd.mjs +6 -3
  126. package/dist/esm/structured-data/buildAuthorJsonLd.mjs.map +1 -1
  127. package/dist/esm/structured-data/buildBreadcrumbsJsonLd.mjs +4 -1
  128. package/dist/esm/structured-data/buildBreadcrumbsJsonLd.mjs.map +1 -1
  129. package/dist/esm/structured-data/buildCreativeWorkJsonLd.mjs +7 -5
  130. package/dist/esm/structured-data/buildCreativeWorkJsonLd.mjs.map +1 -1
  131. package/dist/esm/structured-data/buildOrganizationJsonLd.mjs +27 -21
  132. package/dist/esm/structured-data/buildOrganizationJsonLd.mjs.map +1 -1
  133. package/dist/esm/structured-data/buildProductJsonLd.mjs +5 -2
  134. package/dist/esm/structured-data/buildProductJsonLd.mjs.map +1 -1
  135. package/dist/esm/structured-data/buildSoftwareApplicationJsonLd.mjs +59 -51
  136. package/dist/esm/structured-data/buildSoftwareApplicationJsonLd.mjs.map +1 -1
  137. package/dist/esm/structured-data/buildWebsiteJsonLd.mjs +31 -25
  138. package/dist/esm/structured-data/buildWebsiteJsonLd.mjs.map +1 -1
  139. package/dist/esm/structured-data/index.mjs +2 -1
  140. package/dist/esm/structured-data/normalizeJsonLdUrl.mjs +34 -0
  141. package/dist/esm/structured-data/normalizeJsonLdUrl.mjs.map +1 -0
  142. package/dist/esm/tailwind.config.mjs +4 -2
  143. package/dist/esm/tailwind.config.mjs.map +1 -1
  144. package/dist/types/api/index.d.ts +2 -2
  145. package/dist/types/api/useAuth/index.d.ts +2 -2
  146. package/dist/types/api/useAuth/useOAuth2.d.ts +12 -3
  147. package/dist/types/api/useAuth/useOAuth2.d.ts.map +1 -1
  148. package/dist/types/api/useAuth/useSession.d.ts.map +1 -1
  149. package/dist/types/components/IDE/Code.d.ts +2 -2
  150. package/dist/types/components/IDE/CodeBlockClient.d.ts +2 -2
  151. package/dist/types/components/IDE/CodeBlockHighlight.d.ts +2 -2
  152. package/dist/types/components/IDE/CodeBlockHighlight.d.ts.map +1 -1
  153. package/dist/types/components/IDE/CodeBlockShiki.d.ts +2 -2
  154. package/dist/types/components/IDE/CodeBlockShiki.d.ts.map +1 -1
  155. package/dist/types/components/IDE/index.d.ts +2 -1
  156. package/dist/types/components/IDE/shikiLanguages.d.ts +138 -0
  157. package/dist/types/components/IDE/shikiLanguages.d.ts.map +1 -0
  158. package/dist/types/components/index.d.ts +2 -1
  159. package/dist/types/providers/DeferredAuthProvider.d.ts +33 -0
  160. package/dist/types/providers/DeferredAuthProvider.d.ts.map +1 -0
  161. package/dist/types/providers/index.d.ts +2 -1
  162. package/dist/types/routes.d.ts +17 -16
  163. package/dist/types/routes.d.ts.map +1 -1
  164. package/dist/types/structured-data/buildAuthorJsonLd.d.ts.map +1 -1
  165. package/dist/types/structured-data/buildBreadcrumbsJsonLd.d.ts.map +1 -1
  166. package/dist/types/structured-data/buildCreativeWorkJsonLd.d.ts.map +1 -1
  167. package/dist/types/structured-data/buildOrganizationJsonLd.d.ts.map +1 -1
  168. package/dist/types/structured-data/buildProductJsonLd.d.ts.map +1 -1
  169. package/dist/types/structured-data/buildSoftwareApplicationJsonLd.d.ts.map +1 -1
  170. package/dist/types/structured-data/buildWebsiteJsonLd.d.ts.map +1 -1
  171. package/dist/types/structured-data/index.d.ts +2 -1
  172. package/dist/types/structured-data/normalizeJsonLdUrl.d.ts +28 -0
  173. package/dist/types/structured-data/normalizeJsonLdUrl.d.ts.map +1 -0
  174. package/package.json +43 -43
@@ -1,3 +1,5 @@
1
+ import { normalizeJsonLdUrl } from "./normalizeJsonLdUrl.mjs";
2
+
1
3
  //#region src/structured-data/buildCreativeWorkJsonLd.ts
2
4
  /** @module buildCreativeWorkJsonLd */
3
5
  /**
@@ -31,17 +33,17 @@ const buildCreativeWorkJsonLd = ({ type = "CreativeWork", name, description, con
31
33
  name: publisherName,
32
34
  logo: {
33
35
  "@type": "ImageObject",
34
- url: publisherLogoUrl
36
+ url: normalizeJsonLdUrl(publisherLogoUrl)
35
37
  }
36
38
  } } : {},
37
39
  name,
38
40
  headline: name,
39
- ...ogImageUrl ? { image: ogImageUrl } : {},
41
+ ...ogImageUrl ? { image: normalizeJsonLdUrl(ogImageUrl) } : {},
40
42
  text: content,
41
43
  description,
42
- url,
43
- datePublished: formatDate(datePublished),
44
- dateModified: formatDate(dateModified),
44
+ url: normalizeJsonLdUrl(url),
45
+ datePublished: datePublished ? formatDate(datePublished) : void 0,
46
+ dateModified: dateModified ? formatDate(dateModified) : void 0,
45
47
  version,
46
48
  keywords,
47
49
  license: "https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE",
@@ -1 +1 @@
1
- {"version":3,"file":"buildCreativeWorkJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildCreativeWorkJsonLd.ts"],"sourcesContent":["/** @module buildCreativeWorkJsonLd */\n\n/**\n * Formats a date as ISO 8601 `YYYY-MM-DD`, the shape Schema.org expects.\n *\n * Dates originate from markdown frontmatter, so a typo (`2024-24-12`) yields an\n * `Invalid Date` whose `toISOString()` throws. A structured-data field is never\n * worth failing a page render — let alone a whole static export — so an\n * unusable date is simply omitted from the JSON-LD.\n *\n * @param date - Date to format, possibly invalid.\n * @returns The `YYYY-MM-DD` representation, or `undefined` when unusable.\n */\nconst formatDate = (date?: Date): string | undefined => {\n if (!(date instanceof Date) || Number.isNaN(date.getTime())) {\n return undefined;\n }\n return date.toISOString().split('T')[0]!;\n};\n\nexport type CreativeWorkType =\n | 'CreativeWork'\n | 'TechArticle'\n | 'Article'\n | 'BlogPosting'\n | 'WebPage';\n\n/** Minimal Schema.org Person node accepted as author / creator. */\nexport type SchemaOrgPersonNode = {\n '@type': 'Person';\n '@id'?: string;\n name: string;\n url?: string;\n [key: string]: unknown;\n};\n\nexport type BuildCreativeWorkJsonLdParams = {\n type?: CreativeWorkType;\n name: string;\n description: string;\n /** Full text / markdown body of the document. */\n content: string;\n keywords: string;\n datePublished?: Date;\n dateModified?: Date;\n url?: string;\n /** Pre-resolved Schema.org Person node (output of `buildAuthorJsonLd`). */\n author?: SchemaOrgPersonNode;\n /** Version string from the document revision history. */\n version?: string;\n /** Schema.org Audience `audienceType` value. */\n audienceType: string;\n /** Publisher organization name (defaults to \"Intlayer\"). */\n publisherName?: string;\n /** Absolute URL of the publisher logo. */\n publisherLogoUrl?: string;\n /** Absolute URL of the OG image. */\n ogImageUrl?: string;\n};\n\n/**\n * Builds a Schema.org CreativeWork (or subtype) JSON-LD object.\n *\n * @param params - Document / article metadata.\n * @returns A JSON-LD CreativeWork object ready for serialization.\n */\nexport const buildCreativeWorkJsonLd = ({\n type = 'CreativeWork',\n name,\n description,\n content,\n keywords,\n datePublished,\n dateModified,\n url,\n author,\n version,\n audienceType,\n publisherName = 'Intlayer',\n publisherLogoUrl,\n ogImageUrl,\n}: BuildCreativeWorkJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': type,\n author,\n creator: author,\n ...(publisherLogoUrl\n ? {\n publisher: {\n '@type': 'Organization' as const,\n name: publisherName,\n logo: {\n '@type': 'ImageObject' as const,\n url: publisherLogoUrl,\n },\n },\n }\n : {}),\n name,\n headline: name,\n ...(ogImageUrl ? { image: ogImageUrl } : {}),\n text: content,\n description,\n url,\n datePublished: formatDate(datePublished),\n dateModified: formatDate(dateModified),\n version,\n keywords,\n license:\n 'https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE',\n audience: {\n '@type': 'Audience' as const,\n audienceType,\n },\n});\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,cAAc,SAAoC;CACtD,IAAI,EAAE,gBAAgB,SAAS,OAAO,MAAM,KAAK,QAAQ,CAAC,GACxD;CAEF,OAAO,KAAK,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACvC;;;;;;;AAgDA,MAAa,2BAA2B,EACtC,OAAO,gBACP,MACA,aACA,SACA,UACA,eACA,cACA,KACA,QACA,SACA,cACA,gBAAgB,YAChB,kBACA,kBACoC;CACpC,YAAY;CACZ,SAAS;CACT;CACA,SAAS;CACT,GAAI,mBACA,EACE,WAAW;EACT,SAAS;EACT,MAAM;EACN,MAAM;GACJ,SAAS;GACT,KAAK;EACP;CACF,EACF,IACA,CAAC;CACL;CACA,UAAU;CACV,GAAI,aAAa,EAAE,OAAO,WAAW,IAAI,CAAC;CAC1C,MAAM;CACN;CACA;CACA,eAAe,WAAW,aAAa;CACvC,cAAc,WAAW,YAAY;CACrC;CACA;CACA,SACE;CACF,UAAU;EACR,SAAS;EACT;CACF;AACF"}
1
+ {"version":3,"file":"buildCreativeWorkJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildCreativeWorkJsonLd.ts"],"sourcesContent":["/** @module buildCreativeWorkJsonLd */\n\nimport { normalizeJsonLdUrl } from './normalizeJsonLdUrl';\n\n\n/**\n * Formats a date as ISO 8601 `YYYY-MM-DD`, the shape Schema.org expects.\n *\n * Dates originate from markdown frontmatter, so a typo (`2024-24-12`) yields an\n * `Invalid Date` whose `toISOString()` throws. A structured-data field is never\n * worth failing a page render — let alone a whole static export — so an\n * unusable date is simply omitted from the JSON-LD.\n *\n * @param date - Date to format, possibly invalid.\n * @returns The `YYYY-MM-DD` representation, or `undefined` when unusable.\n */\nconst formatDate = (date?: Date): string | undefined => {\n if (!(date instanceof Date) || Number.isNaN(date.getTime())) {\n return undefined;\n }\n return date.toISOString().split('T')[0]!;\n};\n\nexport type CreativeWorkType =\n | 'CreativeWork'\n | 'TechArticle'\n | 'Article'\n | 'BlogPosting'\n | 'WebPage';\n\n/** Minimal Schema.org Person node accepted as author / creator. */\nexport type SchemaOrgPersonNode = {\n '@type': 'Person';\n '@id'?: string;\n name: string;\n url?: string;\n [key: string]: unknown;\n};\n\nexport type BuildCreativeWorkJsonLdParams = {\n type?: CreativeWorkType;\n name: string;\n description: string;\n /** Full text / markdown body of the document. */\n content: string;\n keywords: string;\n datePublished?: Date;\n dateModified?: Date;\n url?: string;\n /** Pre-resolved Schema.org Person node (output of `buildAuthorJsonLd`). */\n author?: SchemaOrgPersonNode;\n /** Version string from the document revision history. */\n version?: string;\n /** Schema.org Audience `audienceType` value. */\n audienceType: string;\n /** Publisher organization name (defaults to \"Intlayer\"). */\n publisherName?: string;\n /** Absolute URL of the publisher logo. */\n publisherLogoUrl?: string;\n /** Absolute URL of the OG image. */\n ogImageUrl?: string;\n};\n\n/**\n * Builds a Schema.org CreativeWork (or subtype) JSON-LD object.\n *\n * @param params - Document / article metadata.\n * @returns A JSON-LD CreativeWork object ready for serialization.\n */\nexport const buildCreativeWorkJsonLd = ({\n type = 'CreativeWork',\n name,\n description,\n content,\n keywords,\n datePublished,\n dateModified,\n url,\n author,\n version,\n audienceType,\n publisherName = 'Intlayer',\n publisherLogoUrl,\n ogImageUrl,\n}: BuildCreativeWorkJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': type,\n author,\n creator: author,\n ...(publisherLogoUrl\n ? {\n publisher: {\n '@type': 'Organization' as const,\n name: publisherName,\n logo: {\n '@type': 'ImageObject' as const,\n url: normalizeJsonLdUrl(publisherLogoUrl),\n },\n },\n }\n : {}),\n name,\n headline: name,\n ...(ogImageUrl ? { image: normalizeJsonLdUrl(ogImageUrl) } : {}),\n text: content,\n description,\n url: normalizeJsonLdUrl(url),\n datePublished: datePublished ? formatDate(datePublished) : undefined,\n dateModified: dateModified ? formatDate(dateModified) : undefined,\n version,\n keywords,\n license:\n 'https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE',\n audience: {\n '@type': 'Audience' as const,\n audienceType,\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,cAAc,SAAoC;CACtD,IAAI,EAAE,gBAAgB,SAAS,OAAO,MAAM,KAAK,QAAQ,CAAC,GACxD;CAEF,OAAO,KAAK,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACvC;;;;;;;AAgDA,MAAa,2BAA2B,EACtC,OAAO,gBACP,MACA,aACA,SACA,UACA,eACA,cACA,KACA,QACA,SACA,cACA,gBAAgB,YAChB,kBACA,kBACoC;CACpC,YAAY;CACZ,SAAS;CACT;CACA,SAAS;CACT,GAAI,mBACA,EACE,WAAW;EACT,SAAS;EACT,MAAM;EACN,MAAM;GACJ,SAAS;GACT,KAAK,mBAAmB,gBAAgB;EAC1C;CACF,EACF,IACA,CAAC;CACL;CACA,UAAU;CACV,GAAI,aAAa,EAAE,OAAO,mBAAmB,UAAU,EAAE,IAAI,CAAC;CAC9D,MAAM;CACN;CACA,KAAK,mBAAmB,GAAG;CAC3B,eAAe,gBAAgB,WAAW,aAAa,IAAI;CAC3D,cAAc,eAAe,WAAW,YAAY,IAAI;CACxD;CACA;CACA,SACE;CACF,UAAU;EACR,SAAS;EACT;CACF;AACF"}
@@ -1,31 +1,37 @@
1
+ import { normalizeJsonLdUrl, normalizeJsonLdUrls } from "./normalizeJsonLdUrl.mjs";
2
+
1
3
  //#region src/structured-data/buildOrganizationJsonLd.ts
4
+ /** @module buildOrganizationJsonLd */
2
5
  /**
3
6
  * Builds a Schema.org Organization JSON-LD object.
4
7
  *
5
8
  * @param params - Organization metadata.
6
9
  * @returns A JSON-LD Organization object ready for serialization.
7
10
  */
8
- const buildOrganizationJsonLd = ({ url, logoUrl, slogan, knowsAbout, sameAs, availableLanguages }) => ({
9
- "@context": "https://schema.org",
10
- "@type": "Organization",
11
- name: "Intlayer",
12
- url,
13
- logo: {
14
- "@type": "ImageObject",
15
- url: logoUrl
16
- },
17
- foundingDate: "2024",
18
- slogan,
19
- knowsAbout,
20
- sameAs,
21
- contactPoint: {
22
- "@type": "ContactPoint",
23
- email: "contact@intlayer.org",
24
- contactType: "customer support",
25
- url,
26
- availableLanguage: availableLanguages
27
- }
28
- });
11
+ const buildOrganizationJsonLd = ({ url, logoUrl, slogan, knowsAbout, sameAs, availableLanguages }) => {
12
+ const normalizedUrl = normalizeJsonLdUrl(url);
13
+ return {
14
+ "@context": "https://schema.org",
15
+ "@type": "Organization",
16
+ name: "Intlayer",
17
+ url: normalizedUrl,
18
+ logo: {
19
+ "@type": "ImageObject",
20
+ url: normalizeJsonLdUrl(logoUrl)
21
+ },
22
+ foundingDate: "2024",
23
+ slogan,
24
+ knowsAbout,
25
+ sameAs: normalizeJsonLdUrls(sameAs),
26
+ contactPoint: {
27
+ "@type": "ContactPoint",
28
+ email: "contact@intlayer.org",
29
+ contactType: "customer support",
30
+ url: normalizedUrl,
31
+ availableLanguage: availableLanguages
32
+ }
33
+ };
34
+ };
29
35
 
30
36
  //#endregion
31
37
  export { buildOrganizationJsonLd };
@@ -1 +1 @@
1
- {"version":3,"file":"buildOrganizationJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildOrganizationJsonLd.ts"],"sourcesContent":["/** @module buildOrganizationJsonLd */\n\nexport type BuildOrganizationJsonLdParams = {\n /** Canonical URL of the organization (e.g. \"https://intlayer.org\"). */\n url: string;\n /** Absolute URL of the organization logo image. */\n logoUrl: string;\n /** Short tagline / slogan. */\n slogan: string;\n /** Topics the organization is expert in. */\n knowsAbout: string[];\n /** Equivalent pages (GitHub, Twitter…). */\n sameAs: string[];\n /** BCP 47 locale codes the support team speaks. */\n availableLanguages: string[];\n};\n\n/**\n * Builds a Schema.org Organization JSON-LD object.\n *\n * @param params - Organization metadata.\n * @returns A JSON-LD Organization object ready for serialization.\n */\nexport const buildOrganizationJsonLd = ({\n url,\n logoUrl,\n slogan,\n knowsAbout,\n sameAs,\n availableLanguages,\n}: BuildOrganizationJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url,\n logo: {\n '@type': 'ImageObject' as const,\n url: logoUrl,\n },\n foundingDate: '2024',\n slogan,\n knowsAbout,\n sameAs,\n contactPoint: {\n '@type': 'ContactPoint' as const,\n email: 'contact@intlayer.org',\n contactType: 'customer support',\n url,\n availableLanguage: availableLanguages,\n },\n});\n"],"mappings":";;;;;;;AAuBA,MAAa,2BAA2B,EACtC,KACA,SACA,QACA,YACA,QACA,0BACoC;CACpC,YAAY;CACZ,SAAS;CACT,MAAM;CACN;CACA,MAAM;EACJ,SAAS;EACT,KAAK;CACP;CACA,cAAc;CACd;CACA;CACA;CACA,cAAc;EACZ,SAAS;EACT,OAAO;EACP,aAAa;EACb;EACA,mBAAmB;CACrB;AACF"}
1
+ {"version":3,"file":"buildOrganizationJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildOrganizationJsonLd.ts"],"sourcesContent":["/** @module buildOrganizationJsonLd */\n\nimport { normalizeJsonLdUrl, normalizeJsonLdUrls } from './normalizeJsonLdUrl';\n\nexport type BuildOrganizationJsonLdParams = {\n /** Canonical URL of the organization (e.g. \"https://intlayer.org\"). */\n url: string;\n /** Absolute URL of the organization logo image. */\n logoUrl: string;\n /** Short tagline / slogan. */\n slogan: string;\n /** Topics the organization is expert in. */\n knowsAbout: string[];\n /** Equivalent pages (GitHub, Twitter…). */\n sameAs: string[];\n /** BCP 47 locale codes the support team speaks. */\n availableLanguages: string[];\n};\n\n/**\n * Builds a Schema.org Organization JSON-LD object.\n *\n * @param params - Organization metadata.\n * @returns A JSON-LD Organization object ready for serialization.\n */\nexport const buildOrganizationJsonLd = ({\n url,\n logoUrl,\n slogan,\n knowsAbout,\n sameAs,\n availableLanguages,\n}: BuildOrganizationJsonLdParams) => {\n const normalizedUrl = normalizeJsonLdUrl(url);\n\n return {\n '@context': 'https://schema.org' as const,\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url: normalizedUrl,\n logo: {\n '@type': 'ImageObject' as const,\n url: normalizeJsonLdUrl(logoUrl),\n },\n foundingDate: '2024',\n slogan,\n knowsAbout,\n sameAs: normalizeJsonLdUrls(sameAs),\n contactPoint: {\n '@type': 'ContactPoint' as const,\n email: 'contact@intlayer.org',\n contactType: 'customer support',\n url: normalizedUrl,\n availableLanguage: availableLanguages,\n },\n };\n};\n"],"mappings":";;;;;;;;;;AAyBA,MAAa,2BAA2B,EACtC,KACA,SACA,QACA,YACA,QACA,yBACmC;CACnC,MAAM,gBAAgB,mBAAmB,GAAG;CAE5C,OAAO;EACL,YAAY;EACZ,SAAS;EACT,MAAM;EACN,KAAK;EACL,MAAM;GACJ,SAAS;GACT,KAAK,mBAAmB,OAAO;EACjC;EACA,cAAc;EACd;EACA;EACA,QAAQ,oBAAoB,MAAM;EAClC,cAAc;GACZ,SAAS;GACT,OAAO;GACP,aAAa;GACb,KAAK;GACL,mBAAmB;EACrB;CACF;AACF"}
@@ -1,4 +1,7 @@
1
+ import { normalizeJsonLdUrl } from "./normalizeJsonLdUrl.mjs";
2
+
1
3
  //#region src/structured-data/buildProductJsonLd.ts
4
+ /** @module buildProductJsonLd */
2
5
  /**
3
6
  * Builds a Schema.org Product JSON-LD object.
4
7
  *
@@ -8,10 +11,10 @@
8
11
  const buildProductJsonLd = ({ url, name, description, imageUrl, brandName = "Intlayer", offers }) => ({
9
12
  "@context": "https://schema.org",
10
13
  "@type": "Product",
11
- url,
14
+ url: normalizeJsonLdUrl(url),
12
15
  name,
13
16
  description,
14
- image: imageUrl,
17
+ image: normalizeJsonLdUrl(imageUrl),
15
18
  brand: {
16
19
  "@type": "Brand",
17
20
  name: brandName
@@ -1 +1 @@
1
- {"version":3,"file":"buildProductJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildProductJsonLd.ts"],"sourcesContent":["/** @module buildProductJsonLd */\n\n/** Minimal Schema.org Offer node. */\nexport type SchemaOrgOffer = {\n '@type': 'Offer';\n [key: string]: unknown;\n};\n\nexport type BuildProductJsonLdParams = {\n /** Canonical URL of the product page. */\n url: string;\n /** Product display name. */\n name: string;\n description: string;\n /** Absolute URL of the product image. */\n imageUrl: string;\n /** Brand name (defaults to \"Intlayer\"). */\n brandName?: string;\n /** Pre-formatted Schema.org Offer nodes. */\n offers?: SchemaOrgOffer[];\n};\n\n/**\n * Builds a Schema.org Product JSON-LD object.\n *\n * @param params - Product metadata.\n * @returns A JSON-LD Product object ready for serialization.\n */\nexport const buildProductJsonLd = ({\n url,\n name,\n description,\n imageUrl,\n brandName = 'Intlayer',\n offers,\n}: BuildProductJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': 'Product' as const,\n url,\n name,\n description,\n image: imageUrl,\n brand: {\n '@type': 'Brand' as const,\n name: brandName,\n },\n offers,\n});\n"],"mappings":";;;;;;;AA4BA,MAAa,sBAAsB,EACjC,KACA,MACA,aACA,UACA,YAAY,YACZ,cAC+B;CAC/B,YAAY;CACZ,SAAS;CACT;CACA;CACA;CACA,OAAO;CACP,OAAO;EACL,SAAS;EACT,MAAM;CACR;CACA;AACF"}
1
+ {"version":3,"file":"buildProductJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildProductJsonLd.ts"],"sourcesContent":["/** @module buildProductJsonLd */\n\nimport { normalizeJsonLdUrl } from './normalizeJsonLdUrl';\n\n/** Minimal Schema.org Offer node. */\nexport type SchemaOrgOffer = {\n '@type': 'Offer';\n [key: string]: unknown;\n};\n\nexport type BuildProductJsonLdParams = {\n /** Canonical URL of the product page. */\n url: string;\n /** Product display name. */\n name: string;\n description: string;\n /** Absolute URL of the product image. */\n imageUrl: string;\n /** Brand name (defaults to \"Intlayer\"). */\n brandName?: string;\n /** Pre-formatted Schema.org Offer nodes. */\n offers?: SchemaOrgOffer[];\n};\n\n/**\n * Builds a Schema.org Product JSON-LD object.\n *\n * @param params - Product metadata.\n * @returns A JSON-LD Product object ready for serialization.\n */\nexport const buildProductJsonLd = ({\n url,\n name,\n description,\n imageUrl,\n brandName = 'Intlayer',\n offers,\n}: BuildProductJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': 'Product' as const,\n url: normalizeJsonLdUrl(url),\n name,\n description,\n image: normalizeJsonLdUrl(imageUrl),\n brand: {\n '@type': 'Brand' as const,\n name: brandName,\n },\n offers,\n});\n"],"mappings":";;;;;;;;;;AA8BA,MAAa,sBAAsB,EACjC,KACA,MACA,aACA,UACA,YAAY,YACZ,cAC+B;CAC/B,YAAY;CACZ,SAAS;CACT,KAAK,mBAAmB,GAAG;CAC3B;CACA;CACA,OAAO,mBAAmB,QAAQ;CAClC,OAAO;EACL,SAAS;EACT,MAAM;CACR;CACA;AACF"}
@@ -1,4 +1,7 @@
1
+ import { normalizeJsonLdUrl } from "./normalizeJsonLdUrl.mjs";
2
+
1
3
  //#region src/structured-data/buildSoftwareApplicationJsonLd.ts
4
+ /** @module buildSoftwareApplicationJsonLd */
2
5
  /**
3
6
  * Default aggregate rating applied when a caller does not provide one.
4
7
  *
@@ -16,57 +19,62 @@ const DEFAULT_AGGREGATE_RATING = {
16
19
  * @param params - Software application metadata.
17
20
  * @returns A JSON-LD SoftwareApplication object ready for serialization.
18
21
  */
19
- const buildSoftwareApplicationJsonLd = ({ name, url, description, softwareVersion, keywords, audienceType, authorUrl, logoUrl, githubUrl, operatingSystem = "Web, iOS, Android", mainEntityUrl, datePublished = "2024-08-26", offersPrice = "0", offersPriceCurrency = "USD", ratingValue = DEFAULT_AGGREGATE_RATING.ratingValue, ratingCount = DEFAULT_AGGREGATE_RATING.ratingCount, reviewCount }) => ({
20
- "@context": "https://schema.org",
21
- "@type": "SoftwareApplication",
22
- name,
23
- url,
24
- description,
25
- softwareVersion,
26
- license: "https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE",
27
- author: {
28
- "@type": "Organization",
29
- name: "Intlayer",
30
- url: authorUrl,
31
- logo: logoUrl,
32
- sameAs: githubUrl ? [githubUrl] : void 0
33
- },
34
- publisher: {
35
- "@type": "Organization",
36
- name: "Intlayer",
37
- url: authorUrl,
38
- logo: logoUrl
39
- },
40
- keywords,
41
- creator: {
42
- "@type": "Person",
43
- name: "Aymeric PINEAU",
44
- url: "https://github.com/aymericzip"
45
- },
46
- applicationCategory: "DeveloperApplication",
47
- applicationSubCategory: "Developer Tools",
48
- image: logoUrl ? logoUrl.replace("/assets/logo.png", "/cover.png") : void 0,
49
- operatingSystem,
50
- datePublished,
51
- audience: {
52
- "@type": "Audience",
53
- audienceType
54
- },
55
- mainEntityOfPage: mainEntityUrl ?? url,
56
- offers: {
57
- "@type": "Offer",
58
- price: offersPrice,
59
- priceCurrency: offersPriceCurrency
60
- },
61
- aggregateRating: {
62
- "@type": "AggregateRating",
63
- ratingValue,
64
- ratingCount,
65
- reviewCount: reviewCount ?? ratingCount,
66
- bestRating: 5,
67
- worstRating: 1.5
68
- }
69
- });
22
+ const buildSoftwareApplicationJsonLd = ({ name, url, description, softwareVersion, keywords, audienceType, authorUrl, logoUrl, githubUrl, operatingSystem = "Web, iOS, Android", mainEntityUrl, datePublished = "2024-08-26", offersPrice = "0", offersPriceCurrency = "USD", ratingValue = DEFAULT_AGGREGATE_RATING.ratingValue, ratingCount = DEFAULT_AGGREGATE_RATING.ratingCount, reviewCount }) => {
23
+ const normalizedUrl = normalizeJsonLdUrl(url);
24
+ const normalizedLogoUrl = normalizeJsonLdUrl(logoUrl);
25
+ const normalizedAuthorUrl = normalizeJsonLdUrl(authorUrl);
26
+ return {
27
+ "@context": "https://schema.org",
28
+ "@type": "SoftwareApplication",
29
+ name,
30
+ url: normalizedUrl,
31
+ description,
32
+ softwareVersion,
33
+ license: "https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE",
34
+ author: {
35
+ "@type": "Organization",
36
+ name: "Intlayer",
37
+ url: normalizedAuthorUrl,
38
+ logo: normalizedLogoUrl,
39
+ sameAs: githubUrl ? [normalizeJsonLdUrl(githubUrl)] : void 0
40
+ },
41
+ publisher: {
42
+ "@type": "Organization",
43
+ name: "Intlayer",
44
+ url: normalizedAuthorUrl,
45
+ logo: normalizedLogoUrl
46
+ },
47
+ keywords,
48
+ creator: {
49
+ "@type": "Person",
50
+ name: "Aymeric PINEAU",
51
+ url: "https://github.com/aymericzip"
52
+ },
53
+ applicationCategory: "DeveloperApplication",
54
+ applicationSubCategory: "Developer Tools",
55
+ image: normalizedLogoUrl?.replace("/assets/logo.png", "/cover.png"),
56
+ operatingSystem,
57
+ datePublished,
58
+ audience: {
59
+ "@type": "Audience",
60
+ audienceType
61
+ },
62
+ mainEntityOfPage: normalizeJsonLdUrl(mainEntityUrl) ?? normalizedUrl,
63
+ offers: {
64
+ "@type": "Offer",
65
+ price: offersPrice,
66
+ priceCurrency: offersPriceCurrency
67
+ },
68
+ aggregateRating: {
69
+ "@type": "AggregateRating",
70
+ ratingValue,
71
+ ratingCount,
72
+ reviewCount: reviewCount ?? ratingCount,
73
+ bestRating: 5,
74
+ worstRating: 1.5
75
+ }
76
+ };
77
+ };
70
78
 
71
79
  //#endregion
72
80
  export { buildSoftwareApplicationJsonLd };
@@ -1 +1 @@
1
- {"version":3,"file":"buildSoftwareApplicationJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildSoftwareApplicationJsonLd.ts"],"sourcesContent":["/** @module buildSoftwareApplicationJsonLd */\n\nexport type BuildSoftwareApplicationJsonLdParams = {\n /** Display name of the application. */\n name: string;\n /** Canonical URL of the application page. */\n url: string;\n description: string;\n softwareVersion: string;\n keywords: string[];\n /** Schema.org Audience `audienceType` value. */\n audienceType: string;\n /** Absolute URL of the organization / author page. */\n authorUrl?: string;\n /** Absolute URL of the organization logo. */\n logoUrl?: string;\n /** GitHub (or other VCS) URL listed in `sameAs`. */\n githubUrl?: string;\n /** Target operating systems (e.g. \"Web, iOS, Android\"). */\n operatingSystem?: string;\n /** `mainEntityOfPage` URL if different from `url`. */\n mainEntityUrl?: string;\n /** ISO 8601 publish date string (YYYY-MM-DD). */\n datePublished?: string;\n /** Offer price for the application. Defaults to `'0'` (free tier). */\n offersPrice?: string;\n /** ISO 4217 currency code for {@link offersPrice}. Defaults to `'USD'`. */\n offersPriceCurrency?: string;\n /** Aggregate rating value on a 1–5 scale (e.g. `'4.9'`). */\n ratingValue?: string;\n /** Number of ratings backing {@link ratingValue}. */\n ratingCount?: number;\n /** Number of written reviews. Defaults to {@link ratingCount}. */\n reviewCount?: number;\n};\n\n/**\n * Default aggregate rating applied when a caller does not provide one.\n *\n * Google's `SoftwareApplication` rich result requires both an `offers` node and\n * one of `aggregateRating` / `review`. These values keep every node valid and\n * are intended to be kept in sync with the real, publicly displayed ratings.\n */\nconst DEFAULT_AGGREGATE_RATING = {\n ratingValue: '4.92',\n ratingCount: 64,\n} as const;\n\n/**\n * Builds a Schema.org SoftwareApplication JSON-LD object.\n *\n * @param params - Software application metadata.\n * @returns A JSON-LD SoftwareApplication object ready for serialization.\n */\nexport const buildSoftwareApplicationJsonLd = ({\n name,\n url,\n description,\n softwareVersion,\n keywords,\n audienceType,\n authorUrl,\n logoUrl,\n githubUrl,\n operatingSystem = 'Web, iOS, Android',\n mainEntityUrl,\n datePublished = '2024-08-26',\n offersPrice = '0',\n offersPriceCurrency = 'USD',\n ratingValue = DEFAULT_AGGREGATE_RATING.ratingValue,\n ratingCount = DEFAULT_AGGREGATE_RATING.ratingCount,\n reviewCount,\n}: BuildSoftwareApplicationJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': 'SoftwareApplication' as const,\n name,\n url,\n description,\n softwareVersion,\n license:\n 'https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE',\n author: {\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url: authorUrl,\n logo: logoUrl,\n sameAs: githubUrl ? [githubUrl] : undefined,\n },\n publisher: {\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url: authorUrl,\n logo: logoUrl,\n },\n keywords,\n creator: {\n '@type': 'Person' as const,\n name: 'Aymeric PINEAU',\n url: 'https://github.com/aymericzip',\n },\n applicationCategory: 'DeveloperApplication',\n applicationSubCategory: 'Developer Tools',\n image: logoUrl\n ? logoUrl.replace('/assets/logo.png', '/cover.png')\n : undefined,\n operatingSystem,\n datePublished,\n audience: {\n '@type': 'Audience' as const,\n audienceType,\n },\n mainEntityOfPage: mainEntityUrl ?? url,\n offers: {\n '@type': 'Offer' as const,\n price: offersPrice,\n priceCurrency: offersPriceCurrency,\n },\n aggregateRating: {\n '@type': 'AggregateRating' as const,\n ratingValue,\n ratingCount,\n reviewCount: reviewCount ?? ratingCount,\n bestRating: 5,\n worstRating: 1.5,\n },\n});\n"],"mappings":";;;;;;;;AA2CA,MAAM,2BAA2B;CAC/B,aAAa;CACb,aAAa;AACf;;;;;;;AAQA,MAAa,kCAAkC,EAC7C,MACA,KACA,aACA,iBACA,UACA,cACA,WACA,SACA,WACA,kBAAkB,qBAClB,eACA,gBAAgB,cAChB,cAAc,KACd,sBAAsB,OACtB,cAAc,yBAAyB,aACvC,cAAc,yBAAyB,aACvC,mBAC2C;CAC3C,YAAY;CACZ,SAAS;CACT;CACA;CACA;CACA;CACA,SACE;CACF,QAAQ;EACN,SAAS;EACT,MAAM;EACN,KAAK;EACL,MAAM;EACN,QAAQ,YAAY,CAAC,SAAS,IAAI;CACpC;CACA,WAAW;EACT,SAAS;EACT,MAAM;EACN,KAAK;EACL,MAAM;CACR;CACA;CACA,SAAS;EACP,SAAS;EACT,MAAM;EACN,KAAK;CACP;CACA,qBAAqB;CACrB,wBAAwB;CACxB,OAAO,UACH,QAAQ,QAAQ,oBAAoB,YAAY,IAChD;CACJ;CACA;CACA,UAAU;EACR,SAAS;EACT;CACF;CACA,kBAAkB,iBAAiB;CACnC,QAAQ;EACN,SAAS;EACT,OAAO;EACP,eAAe;CACjB;CACA,iBAAiB;EACf,SAAS;EACT;EACA;EACA,aAAa,eAAe;EAC5B,YAAY;EACZ,aAAa;CACf;AACF"}
1
+ {"version":3,"file":"buildSoftwareApplicationJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildSoftwareApplicationJsonLd.ts"],"sourcesContent":["/** @module buildSoftwareApplicationJsonLd */\n\nimport { normalizeJsonLdUrl } from './normalizeJsonLdUrl';\n\nexport type BuildSoftwareApplicationJsonLdParams = {\n /** Display name of the application. */\n name: string;\n /** Canonical URL of the application page. */\n url: string;\n description: string;\n softwareVersion: string;\n keywords: string[];\n /** Schema.org Audience `audienceType` value. */\n audienceType: string;\n /** Absolute URL of the organization / author page. */\n authorUrl?: string;\n /** Absolute URL of the organization logo. */\n logoUrl?: string;\n /** GitHub (or other VCS) URL listed in `sameAs`. */\n githubUrl?: string;\n /** Target operating systems (e.g. \"Web, iOS, Android\"). */\n operatingSystem?: string;\n /** `mainEntityOfPage` URL if different from `url`. */\n mainEntityUrl?: string;\n /** ISO 8601 publish date string (YYYY-MM-DD). */\n datePublished?: string;\n /** Offer price for the application. Defaults to `'0'` (free tier). */\n offersPrice?: string;\n /** ISO 4217 currency code for {@link offersPrice}. Defaults to `'USD'`. */\n offersPriceCurrency?: string;\n /** Aggregate rating value on a 1–5 scale (e.g. `'4.9'`). */\n ratingValue?: string;\n /** Number of ratings backing {@link ratingValue}. */\n ratingCount?: number;\n /** Number of written reviews. Defaults to {@link ratingCount}. */\n reviewCount?: number;\n};\n\n/**\n * Default aggregate rating applied when a caller does not provide one.\n *\n * Google's `SoftwareApplication` rich result requires both an `offers` node and\n * one of `aggregateRating` / `review`. These values keep every node valid and\n * are intended to be kept in sync with the real, publicly displayed ratings.\n */\nconst DEFAULT_AGGREGATE_RATING = {\n ratingValue: '4.92',\n ratingCount: 64,\n} as const;\n\n/**\n * Builds a Schema.org SoftwareApplication JSON-LD object.\n *\n * @param params - Software application metadata.\n * @returns A JSON-LD SoftwareApplication object ready for serialization.\n */\nexport const buildSoftwareApplicationJsonLd = ({\n name,\n url,\n description,\n softwareVersion,\n keywords,\n audienceType,\n authorUrl,\n logoUrl,\n githubUrl,\n operatingSystem = 'Web, iOS, Android',\n mainEntityUrl,\n datePublished = '2024-08-26',\n offersPrice = '0',\n offersPriceCurrency = 'USD',\n ratingValue = DEFAULT_AGGREGATE_RATING.ratingValue,\n ratingCount = DEFAULT_AGGREGATE_RATING.ratingCount,\n reviewCount,\n}: BuildSoftwareApplicationJsonLdParams) => {\n const normalizedUrl = normalizeJsonLdUrl(url);\n const normalizedLogoUrl = normalizeJsonLdUrl(logoUrl);\n const normalizedAuthorUrl = normalizeJsonLdUrl(authorUrl);\n\n return {\n '@context': 'https://schema.org' as const,\n '@type': 'SoftwareApplication' as const,\n name,\n url: normalizedUrl,\n description,\n softwareVersion,\n license:\n 'https://raw.githubusercontent.com/aymericzip/intlayer/refs/heads/main/LICENSE',\n author: {\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url: normalizedAuthorUrl,\n logo: normalizedLogoUrl,\n sameAs: githubUrl ? [normalizeJsonLdUrl(githubUrl)] : undefined,\n },\n publisher: {\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url: normalizedAuthorUrl,\n logo: normalizedLogoUrl,\n },\n keywords,\n creator: {\n '@type': 'Person' as const,\n name: 'Aymeric PINEAU',\n url: 'https://github.com/aymericzip',\n },\n applicationCategory: 'DeveloperApplication',\n applicationSubCategory: 'Developer Tools',\n image: normalizedLogoUrl?.replace('/assets/logo.png', '/cover.png'),\n operatingSystem,\n datePublished,\n audience: {\n '@type': 'Audience' as const,\n audienceType,\n },\n mainEntityOfPage: normalizeJsonLdUrl(mainEntityUrl) ?? normalizedUrl,\n offers: {\n '@type': 'Offer' as const,\n price: offersPrice,\n priceCurrency: offersPriceCurrency,\n },\n aggregateRating: {\n '@type': 'AggregateRating' as const,\n ratingValue,\n ratingCount,\n reviewCount: reviewCount ?? ratingCount,\n bestRating: 5,\n worstRating: 1.5,\n },\n };\n};\n"],"mappings":";;;;;;;;;;;AA6CA,MAAM,2BAA2B;CAC/B,aAAa;CACb,aAAa;AACf;;;;;;;AAQA,MAAa,kCAAkC,EAC7C,MACA,KACA,aACA,iBACA,UACA,cACA,WACA,SACA,WACA,kBAAkB,qBAClB,eACA,gBAAgB,cAChB,cAAc,KACd,sBAAsB,OACtB,cAAc,yBAAyB,aACvC,cAAc,yBAAyB,aACvC,kBAC0C;CAC1C,MAAM,gBAAgB,mBAAmB,GAAG;CAC5C,MAAM,oBAAoB,mBAAmB,OAAO;CACpD,MAAM,sBAAsB,mBAAmB,SAAS;CAExD,OAAO;EACL,YAAY;EACZ,SAAS;EACT;EACA,KAAK;EACL;EACA;EACA,SACE;EACF,QAAQ;GACN,SAAS;GACT,MAAM;GACN,KAAK;GACL,MAAM;GACN,QAAQ,YAAY,CAAC,mBAAmB,SAAS,CAAC,IAAI;EACxD;EACA,WAAW;GACT,SAAS;GACT,MAAM;GACN,KAAK;GACL,MAAM;EACR;EACA;EACA,SAAS;GACP,SAAS;GACT,MAAM;GACN,KAAK;EACP;EACA,qBAAqB;EACrB,wBAAwB;EACxB,OAAO,mBAAmB,QAAQ,oBAAoB,YAAY;EAClE;EACA;EACA,UAAU;GACR,SAAS;GACT;EACF;EACA,kBAAkB,mBAAmB,aAAa,KAAK;EACvD,QAAQ;GACN,SAAS;GACT,OAAO;GACP,eAAe;EACjB;EACA,iBAAiB;GACf,SAAS;GACT;GACA;GACA,aAAa,eAAe;GAC5B,YAAY;GACZ,aAAa;EACf;CACF;AACF"}
@@ -1,4 +1,7 @@
1
+ import { normalizeJsonLdUrl } from "./normalizeJsonLdUrl.mjs";
2
+
1
3
  //#region src/structured-data/buildWebsiteJsonLd.ts
4
+ /** @module buildWebsiteJsonLd */
2
5
  /**
3
6
  * Fallback description for the RSS `DataFeed` node.
4
7
  *
@@ -13,32 +16,35 @@ const DEFAULT_RSS_FEED_DESCRIPTION = "RSS feed of Intlayer publications: release
13
16
  * @param params - Website metadata.
14
17
  * @returns A JSON-LD WebSite object ready for serialization.
15
18
  */
16
- const buildWebsiteJsonLd = ({ url, searchUrl, locales, keywords, rssUrl, rssName = "Intlayer RSS Feed", rssDescription = DEFAULT_RSS_FEED_DESCRIPTION }) => ({
17
- "@context": "https://schema.org",
18
- "@type": "WebSite",
19
- url,
20
- name: "Intlayer",
21
- potentialAction: {
22
- "@type": "SearchAction",
23
- target: `${searchUrl}?search={search_term_string}`,
24
- "query-input": "required name=search_term_string"
25
- },
26
- inLanguage: locales,
27
- keywords,
28
- ...rssUrl ? { subjectOf: {
29
- "@type": "DataFeed",
30
- name: rssName,
31
- description: rssDescription,
32
- url: rssUrl,
33
- encodingFormat: "application/rss+xml",
19
+ const buildWebsiteJsonLd = ({ url, searchUrl, locales, keywords, rssUrl, rssName = "Intlayer RSS Feed", rssDescription = DEFAULT_RSS_FEED_DESCRIPTION }) => {
20
+ const normalizedUrl = normalizeJsonLdUrl(url);
21
+ return {
22
+ "@context": "https://schema.org",
23
+ "@type": "WebSite",
24
+ url: normalizedUrl,
25
+ name: "Intlayer",
26
+ potentialAction: {
27
+ "@type": "SearchAction",
28
+ target: `${normalizeJsonLdUrl(searchUrl)}?search={search_term_string}`,
29
+ "query-input": "required name=search_term_string"
30
+ },
34
31
  inLanguage: locales,
35
- creator: {
36
- "@type": "Organization",
37
- name: "Intlayer",
38
- url
39
- }
40
- } } : {}
41
- });
32
+ keywords,
33
+ ...rssUrl ? { subjectOf: {
34
+ "@type": "DataFeed",
35
+ name: rssName,
36
+ description: rssDescription,
37
+ url: normalizeJsonLdUrl(rssUrl),
38
+ encodingFormat: "application/rss+xml",
39
+ inLanguage: locales,
40
+ creator: {
41
+ "@type": "Organization",
42
+ name: "Intlayer",
43
+ url: normalizedUrl
44
+ }
45
+ } } : {}
46
+ };
47
+ };
42
48
 
43
49
  //#endregion
44
50
  export { buildWebsiteJsonLd };
@@ -1 +1 @@
1
- {"version":3,"file":"buildWebsiteJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildWebsiteJsonLd.ts"],"sourcesContent":["/** @module buildWebsiteJsonLd */\n\nexport type BuildWebsiteJsonLdParams = {\n /** Canonical home URL of the website (e.g. \"https://intlayer.org\"). */\n url: string;\n /** URL template for the site-wide SearchAction. */\n searchUrl: string;\n /** BCP 47 locale codes the site is available in. */\n locales: string[];\n /** Site-level keywords. */\n keywords: string[];\n /** URL of the RSS feed. When provided, a `subjectOf` DataFeed node is added. */\n rssUrl?: string;\n /** Display name of the RSS feed node. */\n rssName?: string;\n /**\n * Description of the RSS feed node. Google validates `DataFeed` as a\n * `Dataset` subtype, which makes `description` a required field.\n */\n rssDescription?: string;\n};\n\n/**\n * Fallback description for the RSS `DataFeed` node.\n *\n * `DataFeed` is a subtype of `Dataset`, so Search Console reports it under the\n * Dataset rich result and rejects it when `description` is missing. Google\n * expects a meaningful description of at least 50 characters.\n */\nconst DEFAULT_RSS_FEED_DESCRIPTION =\n 'RSS feed of Intlayer publications: release notes, changelog entries, blog articles and documentation updates about internationalization (i18n) for React, Next.js, Vue, Svelte and Angular applications.';\n\n/**\n * Builds a Schema.org WebSite JSON-LD object.\n *\n * @param params - Website metadata.\n * @returns A JSON-LD WebSite object ready for serialization.\n */\nexport const buildWebsiteJsonLd = ({\n url,\n searchUrl,\n locales,\n keywords,\n rssUrl,\n rssName = 'Intlayer RSS Feed',\n rssDescription = DEFAULT_RSS_FEED_DESCRIPTION,\n}: BuildWebsiteJsonLdParams) => ({\n '@context': 'https://schema.org' as const,\n '@type': 'WebSite' as const,\n url,\n name: 'Intlayer',\n potentialAction: {\n '@type': 'SearchAction' as const,\n target: `${searchUrl}?search={search_term_string}`,\n 'query-input': 'required name=search_term_string',\n },\n inLanguage: locales,\n keywords,\n ...(rssUrl\n ? {\n subjectOf: {\n '@type': 'DataFeed' as const,\n name: rssName,\n description: rssDescription,\n url: rssUrl,\n encodingFormat: 'application/rss+xml',\n inLanguage: locales,\n creator: {\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url,\n },\n },\n }\n : {}),\n});\n"],"mappings":";;;;;;;;AA6BA,MAAM,+BACJ;;;;;;;AAQF,MAAa,sBAAsB,EACjC,KACA,WACA,SACA,UACA,QACA,UAAU,qBACV,iBAAiB,oCACc;CAC/B,YAAY;CACZ,SAAS;CACT;CACA,MAAM;CACN,iBAAiB;EACf,SAAS;EACT,QAAQ,GAAG,UAAU;EACrB,eAAe;CACjB;CACA,YAAY;CACZ;CACA,GAAI,SACA,EACE,WAAW;EACT,SAAS;EACT,MAAM;EACN,aAAa;EACb,KAAK;EACL,gBAAgB;EAChB,YAAY;EACZ,SAAS;GACP,SAAS;GACT,MAAM;GACN;EACF;CACF,EACF,IACA,CAAC;AACP"}
1
+ {"version":3,"file":"buildWebsiteJsonLd.mjs","names":[],"sources":["../../../src/structured-data/buildWebsiteJsonLd.ts"],"sourcesContent":["/** @module buildWebsiteJsonLd */\n\nimport { normalizeJsonLdUrl } from './normalizeJsonLdUrl';\n\nexport type BuildWebsiteJsonLdParams = {\n /** Canonical home URL of the website (e.g. \"https://intlayer.org\"). */\n url: string;\n /** URL template for the site-wide SearchAction. */\n searchUrl: string;\n /** BCP 47 locale codes the site is available in. */\n locales: string[];\n /** Site-level keywords. */\n keywords: string[];\n /** URL of the RSS feed. When provided, a `subjectOf` DataFeed node is added. */\n rssUrl?: string;\n /** Display name of the RSS feed node. */\n rssName?: string;\n /**\n * Description of the RSS feed node. Google validates `DataFeed` as a\n * `Dataset` subtype, which makes `description` a required field.\n */\n rssDescription?: string;\n};\n\n/**\n * Fallback description for the RSS `DataFeed` node.\n *\n * `DataFeed` is a subtype of `Dataset`, so Search Console reports it under the\n * Dataset rich result and rejects it when `description` is missing. Google\n * expects a meaningful description of at least 50 characters.\n */\nconst DEFAULT_RSS_FEED_DESCRIPTION =\n 'RSS feed of Intlayer publications: release notes, changelog entries, blog articles and documentation updates about internationalization (i18n) for React, Next.js, Vue, Svelte and Angular applications.';\n\n/**\n * Builds a Schema.org WebSite JSON-LD object.\n *\n * @param params - Website metadata.\n * @returns A JSON-LD WebSite object ready for serialization.\n */\nexport const buildWebsiteJsonLd = ({\n url,\n searchUrl,\n locales,\n keywords,\n rssUrl,\n rssName = 'Intlayer RSS Feed',\n rssDescription = DEFAULT_RSS_FEED_DESCRIPTION,\n}: BuildWebsiteJsonLdParams) => {\n const normalizedUrl = normalizeJsonLdUrl(url);\n\n return {\n '@context': 'https://schema.org' as const,\n '@type': 'WebSite' as const,\n url: normalizedUrl,\n name: 'Intlayer',\n potentialAction: {\n '@type': 'SearchAction' as const,\n target: `${normalizeJsonLdUrl(searchUrl)}?search={search_term_string}`,\n 'query-input': 'required name=search_term_string',\n },\n inLanguage: locales,\n keywords,\n ...(rssUrl\n ? {\n subjectOf: {\n '@type': 'DataFeed' as const,\n name: rssName,\n description: rssDescription,\n url: normalizeJsonLdUrl(rssUrl),\n encodingFormat: 'application/rss+xml',\n inLanguage: locales,\n creator: {\n '@type': 'Organization' as const,\n name: 'Intlayer',\n url: normalizedUrl,\n },\n },\n }\n : {}),\n };\n};\n"],"mappings":";;;;;;;;;;;AA+BA,MAAM,+BACJ;;;;;;;AAQF,MAAa,sBAAsB,EACjC,KACA,WACA,SACA,UACA,QACA,UAAU,qBACV,iBAAiB,mCACa;CAC9B,MAAM,gBAAgB,mBAAmB,GAAG;CAE5C,OAAO;EACL,YAAY;EACZ,SAAS;EACT,KAAK;EACL,MAAM;EACN,iBAAiB;GACf,SAAS;GACT,QAAQ,GAAG,mBAAmB,SAAS,EAAE;GACzC,eAAe;EACjB;EACA,YAAY;EACZ;EACA,GAAI,SACA,EACE,WAAW;GACT,SAAS;GACT,MAAM;GACN,aAAa;GACb,KAAK,mBAAmB,MAAM;GAC9B,gBAAgB;GAChB,YAAY;GACZ,SAAS;IACP,SAAS;IACT,MAAM;IACN,KAAK;GACP;EACF,EACF,IACA,CAAC;CACP;AACF"}
@@ -1,3 +1,4 @@
1
+ import { normalizeJsonLdUrl, normalizeJsonLdUrls } from "./normalizeJsonLdUrl.mjs";
1
2
  import { buildOrganizationJsonLd } from "./buildOrganizationJsonLd.mjs";
2
3
  import { buildSoftwareApplicationJsonLd } from "./buildSoftwareApplicationJsonLd.mjs";
3
4
  import { buildBreadcrumbsJsonLd } from "./buildBreadcrumbsJsonLd.mjs";
@@ -7,4 +8,4 @@ import { buildCreativeWorkJsonLd } from "./buildCreativeWorkJsonLd.mjs";
7
8
  import { buildAuthorJsonLd } from "./buildAuthorJsonLd.mjs";
8
9
  import { buildFAQPageJsonLd } from "./buildFAQPageJsonLd.mjs";
9
10
 
10
- export { buildAuthorJsonLd, buildBreadcrumbsJsonLd, buildCreativeWorkJsonLd, buildFAQPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildSoftwareApplicationJsonLd, buildWebsiteJsonLd };
11
+ export { buildAuthorJsonLd, buildBreadcrumbsJsonLd, buildCreativeWorkJsonLd, buildFAQPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildSoftwareApplicationJsonLd, buildWebsiteJsonLd, normalizeJsonLdUrl, normalizeJsonLdUrls };
@@ -0,0 +1,34 @@
1
+ //#region src/structured-data/normalizeJsonLdUrl.ts
2
+ /** @module normalizeJsonLdUrl */
3
+ /**
4
+ * Matches every run of two or more slashes that is *not* the protocol
5
+ * separator, i.e. any run preceded by a character other than `:`.
6
+ */
7
+ const DUPLICATED_PATH_SLASHES = /([^:])\/{2,}/g;
8
+ /**
9
+ * Collapses duplicated slashes inside a URL path while preserving both the
10
+ * protocol separator (`https://`) and protocol-relative prefixes (`//cdn…`).
11
+ *
12
+ * Call sites routinely concatenate an origin constant that already ends with a
13
+ * slash (e.g. `Website_Home` === `https://intlayer.org/`) with a leading-slash
14
+ * path, which yields URLs such as `https://intlayer.org//assets/logo.png`.
15
+ * Those resolve, but search engines treat them as distinct from their
16
+ * single-slash canonical form, so every URL emitted in JSON-LD is normalized
17
+ * here rather than at each of the ~100 call sites.
18
+ *
19
+ * @param url - Absolute or relative URL, possibly containing duplicated slashes.
20
+ * @returns The URL with duplicated path slashes collapsed, or the input
21
+ * unchanged when it is not a string.
22
+ */
23
+ const normalizeJsonLdUrl = (url) => typeof url === "string" ? url.replace(DUPLICATED_PATH_SLASHES, "$1/") : url;
24
+ /**
25
+ * Applies {@link normalizeJsonLdUrl} to every entry of a URL list.
26
+ *
27
+ * @param urls - List of URLs, or `undefined` when the field is omitted.
28
+ * @returns The normalized list, or `undefined` when no list was provided.
29
+ */
30
+ const normalizeJsonLdUrls = (urls) => urls?.map((url) => normalizeJsonLdUrl(url)) ?? urls;
31
+
32
+ //#endregion
33
+ export { normalizeJsonLdUrl, normalizeJsonLdUrls };
34
+ //# sourceMappingURL=normalizeJsonLdUrl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeJsonLdUrl.mjs","names":[],"sources":["../../../src/structured-data/normalizeJsonLdUrl.ts"],"sourcesContent":["/** @module normalizeJsonLdUrl */\n\n/**\n * Matches every run of two or more slashes that is *not* the protocol\n * separator, i.e. any run preceded by a character other than `:`.\n */\nconst DUPLICATED_PATH_SLASHES = /([^:])\\/{2,}/g;\n\n/**\n * Collapses duplicated slashes inside a URL path while preserving both the\n * protocol separator (`https://`) and protocol-relative prefixes (`//cdn…`).\n *\n * Call sites routinely concatenate an origin constant that already ends with a\n * slash (e.g. `Website_Home` === `https://intlayer.org/`) with a leading-slash\n * path, which yields URLs such as `https://intlayer.org//assets/logo.png`.\n * Those resolve, but search engines treat them as distinct from their\n * single-slash canonical form, so every URL emitted in JSON-LD is normalized\n * here rather than at each of the ~100 call sites.\n *\n * @param url - Absolute or relative URL, possibly containing duplicated slashes.\n * @returns The URL with duplicated path slashes collapsed, or the input\n * unchanged when it is not a string.\n */\nexport const normalizeJsonLdUrl = <TUrl extends string | undefined>(\n url: TUrl\n): TUrl =>\n (typeof url === 'string'\n ? url.replace(DUPLICATED_PATH_SLASHES, '$1/')\n : url) as TUrl;\n\n/**\n * Applies {@link normalizeJsonLdUrl} to every entry of a URL list.\n *\n * @param urls - List of URLs, or `undefined` when the field is omitted.\n * @returns The normalized list, or `undefined` when no list was provided.\n */\nexport const normalizeJsonLdUrls = <TUrls extends string[] | undefined>(\n urls: TUrls\n): TUrls => (urls?.map((url) => normalizeJsonLdUrl(url)) as TUrls) ?? urls;\n"],"mappings":";;;;;;AAMA,MAAM,0BAA0B;;;;;;;;;;;;;;;;AAiBhC,MAAa,sBACX,QAEC,OAAO,QAAQ,WACZ,IAAI,QAAQ,yBAAyB,KAAK,IAC1C;;;;;;;AAQN,MAAa,uBACX,SACW,MAAM,KAAK,QAAQ,mBAAmB,GAAG,CAAC,KAAe"}
@@ -2,9 +2,11 @@ import { dirname, relative } from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
 
4
4
  //#region src/tailwind.config.ts
5
- const __dirname = dirname(fileURLToPath(import.meta.url));
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
6
7
  const getTailwindConfig = () => {
7
- let relativePath = relative(process.cwd(), __dirname);
8
+ const originAbsolutePath = process.cwd();
9
+ let relativePath = relative(originAbsolutePath, __dirname);
8
10
  if (!relativePath) relativePath = ".";
9
11
  return { content: [`${relativePath}/components/**/*.{ts,tsx,jsx,mjx,js,cjs,cjx,mjs,mjx,svg}`] };
10
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.config.mjs","names":["localePath"],"sources":["../../src/tailwind.config.ts"],"sourcesContent":["import { dirname, relative } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url); // get the resolved path to the file\nconst __dirname = dirname(__filename); // get the name of the directory\n\nconst getTailwindConfig = () => {\n const originAbsolutePath = process.cwd();\n const localePath = __dirname;\n\n let relativePath = relative(originAbsolutePath, localePath);\n\n if (!relativePath) {\n relativePath = '.';\n }\n\n const config = {\n content: [\n `${relativePath}/components/**/*.{ts,tsx,jsx,mjx,js,cjs,cjx,mjs,mjx,svg}`,\n ],\n };\n\n return config;\n};\n\nconst tailwindConfig = getTailwindConfig();\nconst tailwindPresetConfig = tailwindConfig;\n\nexport { tailwindPresetConfig };\nexport default tailwindConfig;\n"],"mappings":";;;;AAIA,MAAM,YAAY,QADC,cAAc,OAAO,KAAK,GACV,CAAC;AAEpC,MAAM,0BAA0B;CAI9B,IAAI,eAAe,SAHQ,QAAQ,IAGU,GAAGA,SAAU;CAE1D,IAAI,CAAC,cACH,eAAe;CASjB,OAAO,EALL,SAAS,CACP,GAAG,aAAa,yDAClB,EAGU;AACd;AAEA,MAAM,iBAAiB,kBAAkB;AACzC,MAAM,uBAAuB"}
1
+ {"version":3,"file":"tailwind.config.mjs","names":["localePath"],"sources":["../../src/tailwind.config.ts"],"sourcesContent":["import { dirname, relative } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url); // get the resolved path to the file\nconst __dirname = dirname(__filename); // get the name of the directory\n\nconst getTailwindConfig = () => {\n const originAbsolutePath = process.cwd();\n const localePath = __dirname;\n\n let relativePath = relative(originAbsolutePath, localePath);\n\n if (!relativePath) {\n relativePath = '.';\n }\n\n const config = {\n content: [\n `${relativePath}/components/**/*.{ts,tsx,jsx,mjx,js,cjs,cjx,mjs,mjx,svg}`,\n ],\n };\n\n return config;\n};\n\nconst tailwindConfig = getTailwindConfig();\nconst tailwindPresetConfig = tailwindConfig;\n\nexport { tailwindPresetConfig };\nexport default tailwindConfig;\n"],"mappings":";;;;AAGA,MAAM,aAAa,cAAc,YAAY,GAAG;AAChD,MAAM,YAAY,QAAQ,UAAU;AAEpC,MAAM,0BAA0B;CAC9B,MAAM,qBAAqB,QAAQ,IAAI;CAGvC,IAAI,eAAe,SAAS,oBAAoBA,SAAU;CAE1D,IAAI,CAAC,cACH,eAAe;CASjB,OAAO,EALL,SAAS,CACP,GAAG,aAAa,yDAClB,EAGU;AACd;AAEA,MAAM,iBAAiB,kBAAkB;AACzC,MAAM,uBAAuB"}
@@ -22,8 +22,8 @@ import { useAddTag, useDeleteTag, useGetTags, useUpdateTag } from "./hooks/tag.j
22
22
  import { useFillAllTranslations, usePauseTranslationJob, useResumeTranslationJob, useStopTranslationJob } from "./hooks/translate.js";
23
23
  import { useCreateUser, useDeleteUser, useGetUserById, useGetUsers, useUpdateUser, useUploadUserAvatar } from "./hooks/user.js";
24
24
  import { useAuth } from "./useAuth/useAuth.js";
25
- import { useOAuth2 } from "./useAuth/useOAuth2.js";
25
+ import { UseOAuth2Result, useOAuth2 } from "./useAuth/useOAuth2.js";
26
26
  import { UseSessionResult, useSession } from "./useAuth/useSession.js";
27
27
  import "./useAuth/index.js";
28
28
  import { useUser } from "./useUser/index.js";
29
- export { UseIntlayerAuthProps, UseSessionResult, useAcceptAffiliateInvitation, useAddDictionary, useAddEnvironment, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAiAPI, useAnalyticsAPI, useAskDocQuestion, useAskResetPassword, useAssetAPI, useAuditAPI, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAPI, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useContactReviewer, useCreateMission, useCreatePortalSession, useCreatePromoCode, useCreateUser, useCustomQuery, useDeleteAccessKey, useDeleteAsset, useDeleteDictionary, useDeleteEnvironment, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeletePromoCode, useDeleteReviewerProfile, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDictionaryAPI, useDisableTwoFactor, useEditorAPI, useEnableTwoFactor, useEnvironmentAPI, useEstimateMission, useFillAllTranslations, useGetAIStats, useGetAdminReviewers, useGetAffiliate, useGetAffiliateAccountSession, useGetAffiliateById, useGetAffiliateInvitation, useGetAffiliateInvitations, useGetAffiliateOnboardingLink, useGetAffiliatePromoCode, useGetAffiliateStats, useGetAffiliates, useGetAnalyticsAudience, useGetAssetById, useGetAssets, useGetCIConfig, useGetChatHistory, useGetContentStats, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetExperimentResults, useGetInvoices, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjectInsights, useGetProjects, useGetPromoCodeById, useGetPromoCodes, useGetRecursiveAuditStatus, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAPI, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAPI, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useGrantAffiliateAccess, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useMigrateEnvironment, useNewsletterAPI, useOAuth2, useOAuthAPI, useOrganizationAPI, usePauseTranslationJob, useProjectAPI, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useRefreshAccessKey, useRegister, useRegisterAsReviewer, useRegisterSSO, useResetPassword, useResetToProductionEnvironment, useResumeTranslationJob, useReviewerAPI, useSearchAPI, useSearchDoc, useSelectEnvironment, useSelectOrganization, useSelectProject, useSendAffiliateInvitation, useSendReviewerMessage, useSession, useShowcaseProjectAPI, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useStripeAPI, useSubmitReview, useSubmitShowcaseProject, useSubscribeToNewsletter, useTagAPI, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateAPI, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateAffiliateStatus, useUpdateAsset, useUpdateDictionary, useUpdateEnvironment, useUpdateMemberAccess, useUpdateMissionStatus, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdatePromoCode, useUpdateReviewerProfile, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadAsset, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useUploadUserAvatar, useUser, useUserAPI, useValidateReviewerProfile, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
29
+ export { UseIntlayerAuthProps, UseOAuth2Result, UseSessionResult, useAcceptAffiliateInvitation, useAddDictionary, useAddEnvironment, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAiAPI, useAnalyticsAPI, useAskDocQuestion, useAskResetPassword, useAssetAPI, useAuditAPI, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAPI, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useChat, useContactReviewer, useCreateMission, useCreatePortalSession, useCreatePromoCode, useCreateUser, useCustomQuery, useDeleteAccessKey, useDeleteAsset, useDeleteDictionary, useDeleteEnvironment, useDeleteOrganization, useDeleteOrganizationById, useDeletePasskey, useDeleteProject, useDeleteProjectById, useDeletePromoCode, useDeleteReviewerProfile, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDictionaryAPI, useDisableTwoFactor, useEditorAPI, useEnableTwoFactor, useEnvironmentAPI, useEstimateMission, useFillAllTranslations, useGetAIStats, useGetAdminReviewers, useGetAffiliate, useGetAffiliateAccountSession, useGetAffiliateById, useGetAffiliateInvitation, useGetAffiliateInvitations, useGetAffiliateOnboardingLink, useGetAffiliatePromoCode, useGetAffiliateStats, useGetAffiliates, useGetAnalyticsAudience, useGetAssetById, useGetAssets, useGetCIConfig, useGetChatHistory, useGetContentStats, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetExperimentResults, useGetInvoices, useGetMissionById, useGetMyMissions, useGetMyReviewerProfile, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPaymentMethod, useGetPricing, useGetProjectInsights, useGetProjects, useGetPromoCodeById, useGetPromoCodes, useGetRecursiveAuditStatus, useGetReviewerById, useGetReviewerMarketplace, useGetReviewerPriceDistribution, useGetReviewerReviews, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAPI, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGithubToken, useGitlabAPI, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useGrantAffiliateAccess, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIntlayerOAuthOptions, useLinkSocial, useListAccounts, useListPasskeys, useListSSOProviders, useLogin, useLogout, useMigrateEnvironment, useNewsletterAPI, useOAuth2, useOAuthAPI, useOrganizationAPI, usePauseTranslationJob, useProjectAPI, usePushCIConfig, usePushDictionaries, usePushProjectConfiguration, useRefreshAccessKey, useRegister, useRegisterAsReviewer, useRegisterSSO, useResetPassword, useResetToProductionEnvironment, useResumeTranslationJob, useReviewerAPI, useSearchAPI, useSearchDoc, useSelectEnvironment, useSelectOrganization, useSelectProject, useSendAffiliateInvitation, useSendReviewerMessage, useSession, useShowcaseProjectAPI, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useStripeAPI, useSubmitReview, useSubmitShowcaseProject, useSubscribeToNewsletter, useTagAPI, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateAPI, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnlinkAccount, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateAffiliateStatus, useUpdateAsset, useUpdateDictionary, useUpdateEnvironment, useUpdateMemberAccess, useUpdateMissionStatus, useUpdateOrganization, useUpdateOrganizationMailerConfig, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdatePromoCode, useUpdateReviewerProfile, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUploadAsset, useUploadReviewerCoverPicture, useUploadReviewerMainPicture, useUploadUserAvatar, useUser, useUserAPI, useValidateReviewerProfile, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
@@ -1,4 +1,4 @@
1
1
  import { useAuth } from "./useAuth.js";
2
- import { useOAuth2 } from "./useOAuth2.js";
2
+ import { UseOAuth2Result, useOAuth2 } from "./useOAuth2.js";
3
3
  import { UseSessionResult, useSession } from "./useSession.js";
4
- export { UseSessionResult, useAuth, useOAuth2, useSession };
4
+ export { UseOAuth2Result, UseSessionResult, useAuth, useOAuth2, useSession };
@@ -1,8 +1,17 @@
1
+ import { OAuth2Token } from "@intlayer/backend";
1
2
  import { IntlayerConfig } from "@intlayer/types/config";
2
3
  //#region src/api/useAuth/useOAuth2.d.ts
3
- declare const useOAuth2: (intlayerConfiguration?: Pick<IntlayerConfig, 'editor'>) => {
4
- oAuth2AccessToken: any;
4
+ type UseOAuth2Result = {
5
+ /** The OAuth2 token: `undefined` while unfetched, `null` when none was issued. */
6
+ oAuth2AccessToken: OAuth2Token | null | undefined;
5
7
  };
8
+ /**
9
+ * Fetches the OAuth2 client-credentials token for the configured editor client.
10
+ *
11
+ * The query stays disabled when no client credentials are configured, and — under
12
+ * a `DeferredAuthProvider` — until the page has finished loading.
13
+ */
14
+ declare const useOAuth2: (intlayerConfiguration?: Pick<IntlayerConfig, 'editor'>) => UseOAuth2Result;
6
15
  //#endregion
7
- export { useOAuth2 };
16
+ export { UseOAuth2Result, useOAuth2 };
8
17
  //# sourceMappingURL=useOAuth2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOAuth2.d.ts","names":[],"sources":["../../../../src/api/useAuth/useOAuth2.ts"],"mappings":";;cASa,YAAS,wBACI,KAAK"}
1
+ {"version":3,"file":"useOAuth2.d.ts","names":[],"sources":["../../../../src/api/useAuth/useOAuth2.ts"],"mappings":";;;KAWY;;EAEV,mBAAmB;;;;;;;;cASR,YAAS,wBACI,KAAK,8BAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSession.d.ts","names":[],"sources":["../../../../src/api/useAuth/useSession.ts"],"mappings":";;;KASY;;EAEV,SAAS;;EAET,oBAAoB,QAAQ;;EAE5B,yBAAyB,QAAQ;;EAEjC,aAAa,aAAa;;cAGf,aAAU,cACP,mBAAiB,wBACP,mBACvB"}
1
+ {"version":3,"file":"useSession.d.ts","names":[],"sources":["../../../../src/api/useAuth/useSession.ts"],"mappings":";;;KAUY;;EAEV,SAAS;;EAET,oBAAoB,QAAQ;;EAE5B,yBAAyB,QAAQ;;EAEjC,aAAa,aAAa;;cAGf,aAAU,cACP,mBAAiB,wBACP,mBACvB"}
@@ -1,6 +1,6 @@
1
1
  import { CodeFormat, ContentDeclarationFormat, PackageManager } from "./CodeContext.js";
2
+ import { CodeLanguage } from "./shikiLanguages.js";
2
3
  import { FC, HTMLAttributes, ReactNode } from "react";
3
- import { BundledLanguage } from "shiki/bundle/web";
4
4
  //#region src/components/IDE/Code.d.ts
5
5
  type CodeCompAttributes = {
6
6
  fileName?: string;
@@ -12,7 +12,7 @@ type CodeCompAttributes = {
12
12
  type CodeCompProps = {
13
13
  children: ReactNode;
14
14
  fileName?: string;
15
- language: BundledLanguage;
15
+ language: CodeLanguage;
16
16
  isDarkMode?: boolean;
17
17
  showHeader?: boolean;
18
18
  showLineNumbers?: boolean;
@@ -1,12 +1,12 @@
1
+ import { CodeLanguage } from "./shikiLanguages.js";
1
2
  import { FC, HTMLAttributes, ReactNode } from "react";
2
- import { BundledLanguage, BundledLanguage as CodeLanguage } from "shiki/bundle/web";
3
3
  //#region src/components/IDE/CodeBlockClient.d.ts
4
4
  declare const CodeDefault: FC<{
5
5
  children: ReactNode;
6
6
  }>;
7
7
  type CodeBlockProps = {
8
8
  children: React.ReactNode;
9
- lang: BundledLanguage;
9
+ lang: CodeLanguage;
10
10
  isDarkMode?: boolean;
11
11
  isEditable?: boolean;
12
12
  onChange?: (content: string) => void;
@@ -1,12 +1,12 @@
1
1
  import { CodeFormat } from "./CodeContext.js";
2
+ import { CodeLanguage } from "./shikiLanguages.js";
2
3
  import { ReactNode } from "react";
3
- import { BundledLanguage } from "shiki/bundle/web";
4
4
  //#region src/components/IDE/CodeBlockHighlight.d.ts
5
5
  type Props = {
6
6
  /** Raw TypeScript source code (the canonical "source of truth"). */
7
7
  children: ReactNode;
8
8
  /** Language of the source (e.g. 'tsx', 'typescript'). */
9
- originalLang: BundledLanguage;
9
+ originalLang: CodeLanguage;
10
10
  /** Currently selected format: 'typescript' | 'esm' | 'commonjs'. */
11
11
  targetFormat: Exclude<CodeFormat, 'json'>;
12
12
  isDarkMode?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockHighlight.d.ts","names":[],"sources":["../../../../src/components/IDE/CodeBlockHighlight.tsx"],"mappings":";;;;KAcK;;EAEH,UAAU;;EAEV,cAAc;;EAEd,cAAc,QAAQ;EACtB;;cAmBW,uBAAkB,UAAA,cAAA,cAAA,cAK5B,0BAAK,IAAA"}
1
+ {"version":3,"file":"CodeBlockHighlight.d.ts","names":[],"sources":["../../../../src/components/IDE/CodeBlockHighlight.tsx"],"mappings":";;;;KAcK;;EAEH,UAAU;;EAEV,cAAc;;EAEd,cAAc,QAAQ;EACtB;;cAGW,uBAAkB,UAAA,cAAA,cAAA,cAK5B,0BAAK,IAAA"}