@eightyfourthousand/lib-editing 2026.5.0 → 2026.5.2

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 (131) hide show
  1. package/lib/components/editor/PaginationProvider.d.ts +1 -0
  2. package/lib/components/editor/PaginationProvider.js +1 -0
  3. package/lib/components/editor/PaginationProvider.js.map +1 -1
  4. package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.d.ts +1 -5
  5. package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.js +3 -17
  6. package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.js.map +1 -1
  7. package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.ssr.d.ts +6 -0
  8. package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.ssr.js +51 -0
  9. package/lib/components/editor/extensions/EndNoteLink/EndNoteLinkMark.ssr.js.map +1 -0
  10. package/lib/components/editor/extensions/EnsureUniqueUuids/EnsureUniqueUuids.d.ts +3 -0
  11. package/lib/components/editor/extensions/EnsureUniqueUuids/EnsureUniqueUuids.js +71 -0
  12. package/lib/components/editor/extensions/EnsureUniqueUuids/EnsureUniqueUuids.js.map +1 -0
  13. package/lib/components/editor/extensions/EnsureUniqueUuids/index.d.ts +1 -0
  14. package/lib/components/editor/extensions/EnsureUniqueUuids/index.js +2 -0
  15. package/lib/components/editor/extensions/EnsureUniqueUuids/index.js.map +1 -0
  16. package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.d.ts +1 -5
  17. package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.js +3 -57
  18. package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.js.map +1 -1
  19. package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.ssr.d.ts +6 -0
  20. package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.ssr.js +47 -0
  21. package/lib/components/editor/extensions/GlossaryInstance/GlossaryInstanceNode.ssr.js.map +1 -0
  22. package/lib/components/editor/extensions/Heading/Heading.js +16 -37
  23. package/lib/components/editor/extensions/Heading/Heading.js.map +1 -1
  24. package/lib/components/editor/extensions/Heading/classes.d.ts +12 -0
  25. package/lib/components/editor/extensions/Heading/classes.js +22 -0
  26. package/lib/components/editor/extensions/Heading/classes.js.map +1 -0
  27. package/lib/components/editor/extensions/InternalLink/InternalLink.d.ts +1 -5
  28. package/lib/components/editor/extensions/InternalLink/InternalLink.js +2 -54
  29. package/lib/components/editor/extensions/InternalLink/InternalLink.js.map +1 -1
  30. package/lib/components/editor/extensions/InternalLink/InternalLink.ssr.d.ts +6 -0
  31. package/lib/components/editor/extensions/InternalLink/InternalLink.ssr.js +79 -0
  32. package/lib/components/editor/extensions/InternalLink/InternalLink.ssr.js.map +1 -0
  33. package/lib/components/editor/extensions/Line/LineNode.d.ts +1 -2
  34. package/lib/components/editor/extensions/Line/LineNode.js +2 -25
  35. package/lib/components/editor/extensions/Line/LineNode.js.map +1 -1
  36. package/lib/components/editor/extensions/Line/LineNode.ssr.d.ts +3 -0
  37. package/lib/components/editor/extensions/Line/LineNode.ssr.js +27 -0
  38. package/lib/components/editor/extensions/Line/LineNode.ssr.js.map +1 -0
  39. package/lib/components/editor/extensions/LineGroup/LineGroupNode.d.ts +1 -2
  40. package/lib/components/editor/extensions/LineGroup/LineGroupNode.js +3 -38
  41. package/lib/components/editor/extensions/LineGroup/LineGroupNode.js.map +1 -1
  42. package/lib/components/editor/extensions/LineGroup/LineGroupNode.ssr.d.ts +3 -0
  43. package/lib/components/editor/extensions/LineGroup/LineGroupNode.ssr.js +40 -0
  44. package/lib/components/editor/extensions/LineGroup/LineGroupNode.ssr.js.map +1 -0
  45. package/lib/components/editor/extensions/Link/Link.js +2 -11
  46. package/lib/components/editor/extensions/Link/Link.js.map +1 -1
  47. package/lib/components/editor/extensions/Link/Link.ssr.d.ts +2 -0
  48. package/lib/components/editor/extensions/Link/Link.ssr.js +38 -0
  49. package/lib/components/editor/extensions/Link/Link.ssr.js.map +1 -0
  50. package/lib/components/editor/extensions/List.js +1 -1
  51. package/lib/components/editor/extensions/List.js.map +1 -1
  52. package/lib/components/editor/extensions/List.ssr.d.ts +1 -0
  53. package/lib/components/editor/extensions/List.ssr.js +2 -0
  54. package/lib/components/editor/extensions/List.ssr.js.map +1 -0
  55. package/lib/components/editor/extensions/Mention/Mention.d.ts +1 -5
  56. package/lib/components/editor/extensions/Mention/Mention.js +2 -41
  57. package/lib/components/editor/extensions/Mention/Mention.js.map +1 -1
  58. package/lib/components/editor/extensions/Mention/Mention.ssr.d.ts +6 -0
  59. package/lib/components/editor/extensions/Mention/Mention.ssr.js +82 -0
  60. package/lib/components/editor/extensions/Mention/Mention.ssr.js.map +1 -0
  61. package/lib/components/editor/extensions/Paragraph/Paragraph.js +10 -17
  62. package/lib/components/editor/extensions/Paragraph/Paragraph.js.map +1 -1
  63. package/lib/components/editor/extensions/Passage/Passage.js +8 -4
  64. package/lib/components/editor/extensions/Passage/Passage.js.map +1 -1
  65. package/lib/components/editor/extensions/Passage/PassageNode.ssr.d.ts +3 -0
  66. package/lib/components/editor/extensions/Passage/PassageNode.ssr.js +79 -0
  67. package/lib/components/editor/extensions/Passage/PassageNode.ssr.js.map +1 -0
  68. package/lib/components/editor/extensions/Passage/classes.d.ts +5 -0
  69. package/lib/components/editor/extensions/Passage/classes.js +6 -0
  70. package/lib/components/editor/extensions/Passage/classes.js.map +1 -0
  71. package/lib/components/editor/extensions/translationSSRExtensions.d.ts +2 -0
  72. package/lib/components/editor/extensions/translationSSRExtensions.js +65 -0
  73. package/lib/components/editor/extensions/translationSSRExtensions.js.map +1 -0
  74. package/lib/components/editor/hooks/useDefaultExtensions.d.ts +1 -1
  75. package/lib/components/editor/hooks/useDefaultExtensions.js +2 -0
  76. package/lib/components/editor/hooks/useDefaultExtensions.js.map +1 -1
  77. package/lib/components/editor/hooks/useTranslationExtensions.d.ts +1 -1
  78. package/lib/components/editor/hooks/useTranslationExtensions.js +2 -0
  79. package/lib/components/editor/hooks/useTranslationExtensions.js.map +1 -1
  80. package/lib/components/editor/util.d.ts +1 -22
  81. package/lib/components/editor/util.js +1 -69
  82. package/lib/components/editor/util.js.map +1 -1
  83. package/lib/components/reader/ReaderBackMatterPanel.d.ts +1 -1
  84. package/lib/components/reader/ReaderBackMatterPanel.js +0 -5
  85. package/lib/components/reader/ReaderBackMatterPanel.js.map +1 -1
  86. package/lib/components/reader/ReaderLayout.d.ts +2 -1
  87. package/lib/components/reader/ReaderLayout.js +2 -2
  88. package/lib/components/reader/ReaderLayout.js.map +1 -1
  89. package/lib/components/reader/TranslationReader.js +11 -2
  90. package/lib/components/reader/TranslationReader.js.map +1 -1
  91. package/lib/components/reader/TranslationSSRContent.d.ts +9 -0
  92. package/lib/components/reader/TranslationSSRContent.js +64 -0
  93. package/lib/components/reader/TranslationSSRContent.js.map +1 -0
  94. package/lib/components/reader/has-body-translation-content.d.ts +3 -0
  95. package/lib/components/reader/has-body-translation-content.js +12 -0
  96. package/lib/components/reader/has-body-translation-content.js.map +1 -0
  97. package/lib/components/reader/ssr-text-fallback.d.ts +2 -0
  98. package/lib/components/reader/ssr-text-fallback.js +28 -0
  99. package/lib/components/reader/ssr-text-fallback.js.map +1 -0
  100. package/lib/components/reader/ssr.d.ts +2 -0
  101. package/lib/components/reader/ssr.js +2 -0
  102. package/lib/components/reader/ssr.js.map +1 -1
  103. package/lib/components/shared/LabeledElement.js +4 -1
  104. package/lib/components/shared/LabeledElement.js.map +1 -1
  105. package/lib/components/shared/NavigationProvider.d.ts +2 -1
  106. package/lib/components/shared/NavigationProvider.js +36 -13
  107. package/lib/components/shared/NavigationProvider.js.map +1 -1
  108. package/lib/components/shared/OpenGraphImage.js +1 -1
  109. package/lib/components/shared/OpenGraphImage.js.map +1 -1
  110. package/lib/components/shared/TranslationStructuredData.d.ts +5 -0
  111. package/lib/components/shared/TranslationStructuredData.js +80 -0
  112. package/lib/components/shared/TranslationStructuredData.js.map +1 -0
  113. package/lib/components/shared/generate-metadata.js +37 -5
  114. package/lib/components/shared/generate-metadata.js.map +1 -1
  115. package/lib/components/shared/index.d.ts +1 -0
  116. package/lib/components/shared/index.js +1 -0
  117. package/lib/components/shared/index.js.map +1 -1
  118. package/lib/components/shared/redirects.d.ts +5 -0
  119. package/lib/components/shared/redirects.js +40 -0
  120. package/lib/components/shared/redirects.js.map +1 -0
  121. package/lib/components/shared/seo.d.ts +8 -0
  122. package/lib/components/shared/seo.js +13 -0
  123. package/lib/components/shared/seo.js.map +1 -0
  124. package/lib/components/shared/ssr.d.ts +1 -0
  125. package/lib/components/shared/ssr.js +1 -0
  126. package/lib/components/shared/ssr.js.map +1 -1
  127. package/lib/passage.js +7 -7
  128. package/package.json +8 -7
  129. package/lib/components/editor/extensions/NodeWrapper.d.ts +0 -18
  130. package/lib/components/editor/extensions/NodeWrapper.js +0 -14
  131. package/lib/components/editor/extensions/NodeWrapper.js.map +0 -1
@@ -1,11 +1,15 @@
1
1
  import { createServerGraphQLClient, getTranslationMetadataByUuid, } from '@eightyfourthousand/client-graphql/ssr';
2
2
  import { isUuid, parseToh } from '@eightyfourthousand/lib-utils';
3
3
  import { cache } from 'react';
4
+ import { DEFAULT_READER_DESCRIPTION, DEFAULT_READER_TITLE, getTranslationPath, getWorkDescription, SITE_NAME, } from './seo';
4
5
  export async function generateMetadata({ params, }) {
5
6
  const { slug } = await params;
6
7
  // Skip metadata generation for non-UUID paths (e.g., icon requests)
7
8
  if (!isUuid(slug)) {
8
- return { title: '84000 Translation Reader' };
9
+ return {
10
+ title: DEFAULT_READER_TITLE,
11
+ description: DEFAULT_READER_DESCRIPTION,
12
+ };
9
13
  }
10
14
  const client = await createServerGraphQLClient();
11
15
  const work = await cache(getTranslationMetadataByUuid)({
@@ -13,16 +17,44 @@ export async function generateMetadata({ params, }) {
13
17
  uuid: slug,
14
18
  });
15
19
  if (!work) {
16
- return { title: '84000 Translation Reader' };
20
+ return {
21
+ title: DEFAULT_READER_TITLE,
22
+ description: DEFAULT_READER_DESCRIPTION,
23
+ };
17
24
  }
18
25
  const tohDisplay = work.toh.map(parseToh).join(', ');
26
+ const description = getWorkDescription(work);
27
+ const canonicalPath = getTranslationPath(work.uuid);
19
28
  return {
20
- title: `${work.title} | 84000`,
21
- description: work.description || `${work.title} - ${tohDisplay} - ${work.section}`,
29
+ title: work.title,
30
+ description,
31
+ alternates: {
32
+ canonical: canonicalPath,
33
+ },
22
34
  openGraph: {
23
35
  title: work.title,
24
- description: work.description || `Buddhist translation from the ${work.section}`,
36
+ description,
37
+ url: canonicalPath,
38
+ siteName: SITE_NAME,
25
39
  type: 'article',
40
+ images: [
41
+ {
42
+ url: `${canonicalPath}/opengraph-image`,
43
+ alt: `${work.title}${tohDisplay ? ` (${tohDisplay})` : ''}`,
44
+ width: 1200,
45
+ height: 630,
46
+ },
47
+ ],
48
+ },
49
+ twitter: {
50
+ card: 'summary_large_image',
51
+ title: work.title,
52
+ description,
53
+ images: [`${canonicalPath}/opengraph-image`],
54
+ },
55
+ robots: {
56
+ index: !work.restriction,
57
+ follow: true,
26
58
  },
27
59
  };
28
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generate-metadata.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/generate-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,MAAM,GAGP;IACC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC;IAE9B,oEAAoE;IACpE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,yBAAyB,EAAE,CAAC;IACjD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACrD,MAAM;QACN,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAErD,OAAO;QACL,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,UAAU;QAC9B,WAAW,EACT,IAAI,CAAC,WAAW,IAAI,GAAG,IAAI,CAAC,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,OAAO,EAAE;QACvE,SAAS,EAAE;YACT,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EACT,IAAI,CAAC,WAAW,IAAI,iCAAiC,IAAI,CAAC,OAAO,EAAE;YACrE,IAAI,EAAE,SAAS;SAChB;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"generate-metadata.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/generate-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,GACV,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,EACrC,MAAM,GAGP;IACC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC;IAE9B,oEAAoE;IACpE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO;YACL,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,0BAA0B;SACxC,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,yBAAyB,EAAE,CAAC;IACjD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACrD,MAAM;QACN,IAAI,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO;YACL,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,0BAA0B;SACxC,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpD,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW;QACX,UAAU,EAAE;YACV,SAAS,EAAE,aAAa;SACzB;QACD,SAAS,EAAE;YACT,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW;YACX,GAAG,EAAE,aAAa;YAClB,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE;gBACN;oBACE,GAAG,EAAE,GAAG,aAAa,kBAAkB;oBACvC,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC3D,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,GAAG;iBACZ;aACF;SACF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW;YACX,MAAM,EAAE,CAAC,GAAG,aAAa,kBAAkB,CAAC;SAC7C;QACD,MAAM,EAAE;YACN,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW;YACxB,MAAM,EAAE,IAAI;SACb;KACF,CAAC;AACJ,CAAC"}
@@ -7,5 +7,6 @@ export * from './TranslationSkeleton';
7
7
  export * from './TranslationTable';
8
8
  export * from './bibliography';
9
9
  export * from './glossary';
10
+ export * from './redirects';
10
11
  export * from './titles';
11
12
  export * from './types';
@@ -7,6 +7,7 @@ export * from './TranslationSkeleton';
7
7
  export * from './TranslationTable';
8
8
  export * from './bibliography';
9
9
  export * from './glossary';
10
+ export * from './redirects';
10
11
  export * from './titles';
11
12
  export * from './types';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type NextRequest, NextResponse } from 'next/server';
2
+ export declare const isTohRequest: (pathname: string) => RegExpMatchArray | null;
3
+ export declare const isXmlidRequest: (pathname: string) => RegExpMatchArray | null;
4
+ export declare const redirectOnToh: (pathname: string, request: NextRequest) => Promise<NextResponse<unknown>>;
5
+ export declare const redirectOnXmlid: (pathname: string, request: NextRequest) => Promise<NextResponse<unknown>>;
@@ -0,0 +1,40 @@
1
+ import { getWorkUuidByToh, getWorkUuidByXmlid, } from '@eightyfourthousand/data-access';
2
+ import { createServerClient } from '@eightyfourthousand/data-access/ssr';
3
+ import { NextResponse } from 'next/server';
4
+ export const isTohRequest = (pathname) => {
5
+ return pathname.match(/^\/toh\d+/);
6
+ };
7
+ export const isXmlidRequest = (pathname) => {
8
+ return pathname.match(/^\/UT(?:22084|23703)-\d{3}-\d{3}/i);
9
+ };
10
+ export const redirectOnToh = async (pathname, request) => {
11
+ const url = request.nextUrl.clone();
12
+ const toh = pathname.split('/')[1]?.split('.')[0];
13
+ if (!toh) {
14
+ return NextResponse.next();
15
+ }
16
+ const client = await createServerClient();
17
+ const workUuid = await getWorkUuidByToh({ client, toh });
18
+ if (!workUuid) {
19
+ return NextResponse.next();
20
+ }
21
+ url.pathname = `/${workUuid}`;
22
+ url.searchParams.set('toh', toh);
23
+ return NextResponse.redirect(url);
24
+ };
25
+ export const redirectOnXmlid = async (pathname, request) => {
26
+ const url = request.nextUrl.clone();
27
+ const xmlid = pathname.split('/')[1]?.split('.')[0];
28
+ if (!xmlid) {
29
+ return NextResponse.next();
30
+ }
31
+ const client = await createServerClient();
32
+ const workUuid = await getWorkUuidByXmlid({ client, xmlid });
33
+ if (!workUuid) {
34
+ return NextResponse.next();
35
+ }
36
+ url.pathname = `/${workUuid}`;
37
+ url.searchParams.set('xmlid', xmlid);
38
+ return NextResponse.redirect(url);
39
+ };
40
+ //# sourceMappingURL=redirects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirects.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/redirects.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAoB,YAAY,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,EAAE;IAC/C,OAAO,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,EAAE;IACjD,OAAO,QAAQ,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,QAAgB,EAAE,OAAoB,EAAE,EAAE;IAC5E,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAElD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAEzD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC9B,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjC,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAClC,QAAgB,EAChB,OAAoB,EACpB,EAAE;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,kBAAkB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE7D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,GAAG,CAAC,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC9B,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Work } from '@eightyfourthousand/data-access';
2
+ export declare const SITE_NAME = "84000: Translating the Words of the Buddha";
3
+ export declare const DEFAULT_READER_TITLE = "84000 Translation Reader";
4
+ export declare const DEFAULT_READER_DESCRIPTION = "Read translations from the Tibetan Buddhist canon published by 84000.";
5
+ export declare const getSiteUrl: () => string;
6
+ export declare const getTranslationPath: (uuid: string) => string;
7
+ export declare const getTranslationUrl: (uuid: string) => string;
8
+ export declare const getWorkDescription: (work: Work) => string;
@@ -0,0 +1,13 @@
1
+ import { parseToh } from '@eightyfourthousand/lib-utils';
2
+ export const SITE_NAME = '84000: Translating the Words of the Buddha';
3
+ export const DEFAULT_READER_TITLE = '84000 Translation Reader';
4
+ export const DEFAULT_READER_DESCRIPTION = 'Read translations from the Tibetan Buddhist canon published by 84000.';
5
+ export const getSiteUrl = () => (process.env.NEXT_PUBLIC_SITE_URL || 'https://84000.co').replace(/\/$/, '');
6
+ export const getTranslationPath = (uuid) => `/${uuid}`;
7
+ export const getTranslationUrl = (uuid) => `${getSiteUrl()}${getTranslationPath(uuid)}`;
8
+ export const getWorkDescription = (work) => {
9
+ const tohDisplay = work.toh.map(parseToh).join(', ');
10
+ return (work.description ||
11
+ [work.title, tohDisplay, work.section].filter(Boolean).join(' - '));
12
+ };
13
+ //# sourceMappingURL=seo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seo.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/seo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,4CAA4C,CAAC;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAC/D,MAAM,CAAC,MAAM,0BAA0B,GACrC,uEAAuE,CAAC;AAE1E,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,kBAAkB,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAE9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;AAE/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE,CAChD,GAAG,UAAU,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAU,EAAE,EAAE;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAErD,OAAO,CACL,IAAI,CAAC,WAAW;QAChB,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACnE,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './generate-metadata';
2
2
  export * from './OpenGraphImage';
3
+ export * from './TranslationStructuredData';
@@ -1,3 +1,4 @@
1
1
  export * from './generate-metadata';
2
2
  export * from './OpenGraphImage';
3
+ export * from './TranslationStructuredData';
3
4
  //# sourceMappingURL=ssr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ssr.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/ssr.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"ssr.js","sourceRoot":"","sources":["../../../../../../libs/lib-editing/src/lib/components/shared/ssr.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC"}
package/lib/passage.js CHANGED
@@ -4,13 +4,13 @@ import { findNodePosition, nodeNotFound } from './exporters/util';
4
4
  /**
5
5
  * Ensures every node in the editor document has a unique, non-null UUID.
6
6
  *
7
- * UUID assignment normally happens asynchronously in NodeView lifecycle hooks
8
- * (validateAttrs / createNodeViewDom). When save() is called shortly after a
9
- * structural edit (e.g. pressing Enter to create a new paragraph, or splitting
10
- * a passage), some nodes may still carry uuid: null or a UUID duplicated from
11
- * the node they were split from. passagesFromNodes() then reads those nodes
12
- * synchronously, and annotationExportsFromNode silently skips any node whose
13
- * uuid is falsy — producing missing paragraph annotations.
7
+ * UUID de-duplication normally happens asynchronously in the
8
+ * EnsureUniqueUuids ProseMirror plugin (appendTransaction). When save() is
9
+ * called shortly after a structural edit (e.g. pressing Enter to create a new
10
+ * paragraph, or splitting a passage), some nodes may still carry uuid: null
11
+ * or a UUID duplicated from the node they were split from. passagesFromNodes()
12
+ * then reads those nodes synchronously, and annotationExportsFromNode silently
13
+ * skips any node whose uuid is falsy — producing missing paragraph annotations.
14
14
  *
15
15
  * This function walks the document synchronously and dispatches a single
16
16
  * transaction that stamps a fresh UUID onto every node or mark that either:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightyfourthousand/lib-editing",
3
- "version": "2026.5.0",
3
+ "version": "2026.5.2",
4
4
  "description": "Shared editing and reader components for 84000 translation workflows.",
5
5
  "private": false,
6
6
  "repository": {
@@ -17,12 +17,12 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@eightyfourthousand/client-graphql": "^2026.5.0",
21
- "@eightyfourthousand/data-access": "^2026.5.0",
22
- "@eightyfourthousand/design-system": "^2026.5.0",
23
- "@eightyfourthousand/lib-instr": "^2026.5.0",
24
- "@eightyfourthousand/lib-search": "^2026.5.0",
25
- "@eightyfourthousand/lib-utils": "^2026.5.0",
20
+ "@eightyfourthousand/client-graphql": "^2026.5.2",
21
+ "@eightyfourthousand/data-access": "^2026.5.2",
22
+ "@eightyfourthousand/design-system": "^2026.5.2",
23
+ "@eightyfourthousand/lib-instr": "^2026.5.2",
24
+ "@eightyfourthousand/lib-search": "^2026.5.2",
25
+ "@eightyfourthousand/lib-utils": "^2026.5.2",
26
26
  "@floating-ui/react": "^0.27.16",
27
27
  "@tanstack/react-table": "^8.21.2",
28
28
  "@tiptap/core": "^3.13.0",
@@ -44,6 +44,7 @@
44
44
  "@tiptap/pm": "^3.13.0",
45
45
  "@tiptap/react": "^3.13.0",
46
46
  "@tiptap/starter-kit": "^3.13.0",
47
+ "@tiptap/static-renderer": "^3.13.0",
47
48
  "@tiptap/suggestion": "^3.13.0",
48
49
  "class-variance-authority": "^0.7.1",
49
50
  "graphql-request": "^7.1.2",
@@ -1,18 +0,0 @@
1
- import { NodeViewProps, NodeViewRendererOptions } from '@tiptap/react';
2
- import { JSX, ReactNode } from 'react';
3
- export interface NodeWrapperProps extends NodeViewProps {
4
- className?: string;
5
- innerClassName?: string;
6
- children?: ReactNode;
7
- wrapperAs?: keyof JSX.IntrinsicElements;
8
- contentAs?: keyof JSX.IntrinsicElements;
9
- }
10
- export declare const NodeWrapper: ({ node, editor, className, innerClassName, children, wrapperAs, contentAs, getPos, updateAttributes, }: NodeWrapperProps) => import("react/jsx-runtime").JSX.Element;
11
- export interface CreateNodeWrapperOptions extends NodeViewRendererOptions {
12
- className?: string;
13
- innerClassName?: string;
14
- children?: ReactNode;
15
- wrapperAs?: keyof JSX.IntrinsicElements;
16
- contentAs?: keyof JSX.IntrinsicElements;
17
- }
18
- export declare const createNodeWrapper: (options?: Partial<Omit<NodeWrapperProps, keyof NodeViewProps>>) => import("@tiptap/core").NodeViewRenderer;
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { NodeViewContent, NodeViewWrapper, ReactNodeViewRenderer, } from '@tiptap/react';
3
- import { useEffect } from 'react';
4
- import { validateAttrs } from '../util';
5
- export const NodeWrapper = ({ node, editor, className, innerClassName, children, wrapperAs = 'div', contentAs = 'div', getPos, updateAttributes, }) => {
6
- useEffect(() => {
7
- validateAttrs({ node, editor, getPos, updateAttributes });
8
- }, [node, editor, getPos, updateAttributes]);
9
- return (_jsxs(NodeViewWrapper, { id: node.attrs.uuid, as: wrapperAs, className: className, children: [children, _jsx(NodeViewContent, { as: contentAs, className: innerClassName })] }));
10
- };
11
- export const createNodeWrapper = (options = {}) => {
12
- return ReactNodeViewRenderer((props) => (_jsx(NodeWrapper, { ...props, ...options })));
13
- };
14
- //# sourceMappingURL=NodeWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NodeWrapper.js","sourceRoot":"","sources":["../../../../../../../libs/lib-editing/src/lib/components/editor/extensions/NodeWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EAGf,eAAe,EACf,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkB,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAUxC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,SAAS,EACT,cAAc,EACd,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,MAAM,EACN,gBAAgB,GACC,EAAE,EAAE;IACrB,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC5D,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE7C,OAAO,CACL,MAAC,eAAe,IAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,aACtE,QAAQ,EAET,KAAC,eAAe,IAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,GAAI,IAC7C,CACnB,CAAC;AACJ,CAAC,CAAC;AAUF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,UAAgE,EAAE,EAClE,EAAE;IACF,OAAO,qBAAqB,CAAC,CAAC,KAAoB,EAAE,EAAE,CAAC,CACrD,KAAC,WAAW,OAAK,KAAK,KAAM,OAAO,GAAI,CACxC,CAAC,CAAC;AACL,CAAC,CAAC"}