👁️
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

more richtext work + debounce hook uses oops

+48 -4
+13 -1
lexicons/com/deckbelcher/richtext/facet.json
··· 18 18 "#link", 19 19 "#tag", 20 20 "#bold", 21 - "#italic" 21 + "#italic", 22 + "#code", 23 + "#codeBlock" 22 24 ] 23 25 } 24 26 } ··· 96 98 "type": "object", 97 99 "properties": {}, 98 100 "description": "Facet feature for italic text formatting.\nTypically rendered as `<em>` in HTML." 101 + }, 102 + "code": { 103 + "type": "object", 104 + "properties": {}, 105 + "description": "Facet feature for inline code.\nTypically rendered as `<code>` in HTML." 106 + }, 107 + "codeBlock": { 108 + "type": "object", 109 + "properties": {}, 110 + "description": "Facet feature for code blocks.\nTypically rendered as `<pre><code>` in HTML." 99 111 } 100 112 } 101 113 }
+1 -1
src/components/deck/CardSearchAutocomplete.tsx
··· 43 43 const resultRefs = useRef<Map<number, HTMLButtonElement>>(new Map()); 44 44 45 45 const queryClient = useQueryClient(); 46 - const debouncedSearch = useDebounce(inputValue, 300); 46 + const { value: debouncedSearch } = useDebounce(inputValue, 300); 47 47 const toggleId = useId(); 48 48 49 49 // Calculate search restrictions
+20
src/lib/lexicons/types/com/deckbelcher/richtext/facet.ts
··· 19 19 */ 20 20 byteStart: /*#__PURE__*/ v.integer(), 21 21 }); 22 + const _codeSchema = /*#__PURE__*/ v.object({ 23 + $type: /*#__PURE__*/ v.optional( 24 + /*#__PURE__*/ v.literal("com.deckbelcher.richtext.facet#code"), 25 + ), 26 + }); 27 + const _codeBlockSchema = /*#__PURE__*/ v.object({ 28 + $type: /*#__PURE__*/ v.optional( 29 + /*#__PURE__*/ v.literal("com.deckbelcher.richtext.facet#codeBlock"), 30 + ), 31 + }); 22 32 const _italicSchema = /*#__PURE__*/ v.object({ 23 33 $type: /*#__PURE__*/ v.optional( 24 34 /*#__PURE__*/ v.literal("com.deckbelcher.richtext.facet#italic"), ··· 38 48 return /*#__PURE__*/ v.array( 39 49 /*#__PURE__*/ v.variant([ 40 50 boldSchema, 51 + codeSchema, 52 + codeBlockSchema, 41 53 italicSchema, 42 54 linkSchema, 43 55 mentionSchema, ··· 71 83 72 84 type bold$schematype = typeof _boldSchema; 73 85 type byteSlice$schematype = typeof _byteSliceSchema; 86 + type code$schematype = typeof _codeSchema; 87 + type codeBlock$schematype = typeof _codeBlockSchema; 74 88 type italic$schematype = typeof _italicSchema; 75 89 type link$schematype = typeof _linkSchema; 76 90 type main$schematype = typeof _mainSchema; ··· 79 93 80 94 export interface boldSchema extends bold$schematype {} 81 95 export interface byteSliceSchema extends byteSlice$schematype {} 96 + export interface codeSchema extends code$schematype {} 97 + export interface codeBlockSchema extends codeBlock$schematype {} 82 98 export interface italicSchema extends italic$schematype {} 83 99 export interface linkSchema extends link$schematype {} 84 100 export interface mainSchema extends main$schematype {} ··· 87 103 88 104 export const boldSchema = _boldSchema as boldSchema; 89 105 export const byteSliceSchema = _byteSliceSchema as byteSliceSchema; 106 + export const codeSchema = _codeSchema as codeSchema; 107 + export const codeBlockSchema = _codeBlockSchema as codeBlockSchema; 90 108 export const italicSchema = _italicSchema as italicSchema; 91 109 export const linkSchema = _linkSchema as linkSchema; 92 110 export const mainSchema = _mainSchema as mainSchema; ··· 95 113 96 114 export interface Bold extends v.InferInput<typeof boldSchema> {} 97 115 export interface ByteSlice extends v.InferInput<typeof byteSliceSchema> {} 116 + export interface Code extends v.InferInput<typeof codeSchema> {} 117 + export interface CodeBlock extends v.InferInput<typeof codeBlockSchema> {} 98 118 export interface Italic extends v.InferInput<typeof italicSchema> {} 99 119 export interface Link extends v.InferInput<typeof linkSchema> {} 100 120 export interface Main extends v.InferInput<typeof mainSchema> {}
+1 -1
src/routes/cards/index.tsx
··· 131 131 function CardsPage() { 132 132 const navigate = Route.useNavigate(); 133 133 const search = Route.useSearch(); 134 - const debouncedSearchQuery = useDebounce(search.q || "", 400); 134 + const { value: debouncedSearchQuery } = useDebounce(search.q || "", 400); 135 135 const searchInputRef = useRef<HTMLInputElement>(null); 136 136 const listRef = useRef<HTMLDivElement>(null); 137 137 const columns = useColumns();
+13 -1
typelex/richtext-facet.tsp
··· 11 11 index: ByteSlice; 12 12 13 13 @required 14 - features: (Mention | Link | Tag | Bold | Italic | unknown)[]; 14 + features: (Mention | Link | Tag | Bold | Italic | Code | CodeBlock | unknown)[]; 15 15 } 16 16 17 17 /** ··· 69 69 * Typically rendered as `<em>` in HTML. 70 70 */ 71 71 model Italic {} 72 + 73 + /** 74 + * Facet feature for inline code. 75 + * Typically rendered as `<code>` in HTML. 76 + */ 77 + model Code {} 78 + 79 + /** 80 + * Facet feature for code blocks. 81 + * Typically rendered as `<pre><code>` in HTML. 82 + */ 83 + model CodeBlock {} 72 84 }