a tool for shared writing and social publishing

wip add at-mention

+55
+5
actions/publishToPublication.ts
··· 549 549 $type: "pub.leaflet.richtext.facet#didMention", 550 550 did: d.attributes.didMention.did, 551 551 }); 552 + if (d.attributes?.atMention) 553 + facet.features.push({ 554 + $type: "pub.leaflet.richtext.facet#atMention", 555 + atURI: d.attributes.atMention.atURI, 556 + }); 552 557 if (d.attributes?.code) 553 558 facet.features.push({ $type: "pub.leaflet.richtext.facet#code" }); 554 559 if (d.attributes?.highlight)
+1
components/Blocks/TextBlock/RenderYJSFragment.tsx
··· 104 104 code?: {}; 105 105 em?: {}; 106 106 didMention?: { did: string }; 107 + atMention?: { atURI: string }; 107 108 underline?: {}; 108 109 strikethrough?: {}; 109 110 highlight?: { color: string };
+12
lexicons/api/lexicons.ts
··· 1862 1862 refs: [ 1863 1863 'lex:pub.leaflet.richtext.facet#link', 1864 1864 'lex:pub.leaflet.richtext.facet#didMention', 1865 + 'lex:pub.leaflet.richtext.facet#atMention', 1865 1866 'lex:pub.leaflet.richtext.facet#code', 1866 1867 'lex:pub.leaflet.richtext.facet#highlight', 1867 1868 'lex:pub.leaflet.richtext.facet#underline', ··· 1909 1910 did: { 1910 1911 type: 'string', 1911 1912 format: 'did', 1913 + }, 1914 + }, 1915 + }, 1916 + atMention: { 1917 + type: 'object', 1918 + description: 'Facet feature for mentioning an AT URI.', 1919 + required: ['atURI'], 1920 + properties: { 1921 + atURI: { 1922 + type: 'string', 1923 + format: 'uri', 1912 1924 }, 1913 1925 }, 1914 1926 },
+17
lexicons/api/types/pub/leaflet/richtext/facet.ts
··· 21 21 features: ( 22 22 | $Typed<Link> 23 23 | $Typed<DidMention> 24 + | $Typed<AtMention> 24 25 | $Typed<Code> 25 26 | $Typed<Highlight> 26 27 | $Typed<Underline> ··· 89 90 90 91 export function validateDidMention<V>(v: V) { 91 92 return validate<DidMention & V>(v, id, hashDidMention) 93 + } 94 + 95 + /** Facet feature for mentioning an AT URI. */ 96 + export interface AtMention { 97 + $type?: 'pub.leaflet.richtext.facet#atMention' 98 + atURI: string 99 + } 100 + 101 + const hashAtMention = 'atMention' 102 + 103 + export function isAtMention<V>(v: V) { 104 + return is$typed(v, id, hashAtMention) 105 + } 106 + 107 + export function validateAtMention<V>(v: V) { 108 + return validate<AtMention & V>(v, id, hashAtMention) 92 109 } 93 110 94 111 /** Facet feature for inline code. */
+14
lexicons/pub/leaflet/richtext/facet.json
··· 21 21 "refs": [ 22 22 "#link", 23 23 "#didMention", 24 + "#atMention", 24 25 "#code", 25 26 "#highlight", 26 27 "#underline", ··· 73 74 "did": { 74 75 "type": "string", 75 76 "format": "did" 77 + } 78 + } 79 + }, 80 + "atMention": { 81 + "type": "object", 82 + "description": "Facet feature for mentioning an AT URI.", 83 + "required": [ 84 + "atURI" 85 + ], 86 + "properties": { 87 + "atURI": { 88 + "type": "string", 89 + "format": "uri" 76 90 } 77 91 } 78 92 },
+6
lexicons/src/facet.ts
··· 15 15 required: ["did"], 16 16 properties: { did: { type: "string", format: "did" } }, 17 17 }, 18 + atMention: { 19 + type: "object", 20 + description: "Facet feature for mentioning an AT URI.", 21 + required: ["atURI"], 22 + properties: { atURI: { type: "string", format: "uri" } }, 23 + }, 18 24 code: { 19 25 type: "object", 20 26 description: "Facet feature for inline code.",