|
44 | 44 | <div class="menu_wrapper"> |
45 | 45 | <Modules_Menu {pkgs_modules} /> |
46 | 46 | </div> |
47 | | - <ul class="width_md"> |
| 47 | + <ul class="width_md box"> |
48 | 48 | {#each pkgs_modules as pkg_modules (pkg_modules)} |
49 | 49 | {@const {pkg, modules} = pkg_modules} |
50 | | - <div class="width_md relative"> |
51 | | - <a href="#{pkg.name}" id={pkg.name} class="subtitle">🔗</a> |
52 | | - </div> |
53 | | - <ul> |
54 | | - {#each modules as pkg_module (pkg_module)} |
55 | | - {@const {path, declarations} = pkg_module} |
56 | | - <li |
57 | | - class="module" |
58 | | - class:ts={path.endsWith('.ts')} |
59 | | - class:svelte={path.endsWith('.svelte')} |
60 | | - class:css={path.endsWith('.css')} |
61 | | - class:json={path.endsWith('.json')} |
62 | | - > |
63 | | - <div> |
64 | | - {#if pkg.repo_url} |
65 | | - <div class="chip row"> |
66 | | - <a href="{base}/tree/{pkg.repo_name}">{pkg.name}</a>/<a |
67 | | - href="{ensure_end(pkg.repo_url, '/')}blob/main/src/lib/{path}">{path}</a |
| 50 | + <li class="pkg_module"> |
| 51 | + <header class="width_full relative"> |
| 52 | + <a href="#{pkg.name}" id={pkg.name} class="subtitle">🔗</a> |
| 53 | + <a href="{base}/tree/{pkg.repo_name}">{pkg.name}</a> |
| 54 | + </header> |
| 55 | + <ul class="modules panel"> |
| 56 | + {#each modules as pkg_module (pkg_module)} |
| 57 | + {@const {path, declarations} = pkg_module} |
| 58 | + <li |
| 59 | + class="module" |
| 60 | + class:ts={path.endsWith('.ts')} |
| 61 | + class:svelte={path.endsWith('.svelte')} |
| 62 | + class:css={path.endsWith('.css')} |
| 63 | + class:json={path.endsWith('.json')} |
| 64 | + > |
| 65 | + <div> |
| 66 | + {#if pkg.repo_url} |
| 67 | + <div class="chip row"> |
| 68 | + <a href="{ensure_end(pkg.repo_url, '/')}blob/main/src/lib/{path}">{path}</a> |
| 69 | + </div> |
| 70 | + {:else} |
| 71 | + <span class="chip">{path}</span> |
| 72 | + {/if} |
| 73 | + </div> |
| 74 | + <ul class="declarations"> |
| 75 | + {#each declarations as { name, kind }} |
| 76 | + <li |
| 77 | + class="declaration chip" |
| 78 | + class:variable_declaration={kind === 'VariableDeclaration'} |
| 79 | + class:type_declaration={kind === 'InterfaceDeclaration' || |
| 80 | + kind === 'TypeAliasDeclaration'} |
| 81 | + class:class_declaration={kind === 'ClassDeclaration'} |
68 | 82 | > |
69 | | - </div> |
70 | | - {:else} |
71 | | - <span class="chip"><a href="{base}/tree/{pkg.repo_name}">{pkg.name}</a>/{path}</span |
72 | | - > |
73 | | - {/if} |
74 | | - </div> |
75 | | - <ul class="declarations"> |
76 | | - {#each declarations as { name, kind }} |
77 | | - <li |
78 | | - class="declaration chip" |
79 | | - class:variable_declaration={kind === 'VariableDeclaration'} |
80 | | - class:type_declaration={kind === 'InterfaceDeclaration' || |
81 | | - kind === 'TypeAliasDeclaration'} |
82 | | - class:class_declaration={kind === 'ClassDeclaration'} |
83 | | - > |
84 | | - {name} |
85 | | - </li> |
86 | | - {/each} |
87 | | - </ul> |
88 | | - </li> |
89 | | - {/each} |
90 | | - </ul> |
| 83 | + {name} |
| 84 | + </li> |
| 85 | + {/each} |
| 86 | + </ul> |
| 87 | + </li> |
| 88 | + {/each} |
| 89 | + </ul> |
| 90 | + </li> |
91 | 91 | {/each} |
92 | 92 | </ul> |
93 | 93 | </div> |
|
110 | 110 | top: 0; |
111 | 111 | text-align: right; |
112 | 112 | } |
| 113 | + .pkg_module { |
| 114 | + display: flex; |
| 115 | + flex-direction: column; |
| 116 | + margin-bottom: var(--spacing_5); |
| 117 | + } |
| 118 | + .pkg_module > header { |
| 119 | + display: flex; |
| 120 | + padding: var(--spacing_xs) var(--spacing_md); |
| 121 | + font-size: var(--size_lg); |
| 122 | + position: sticky; |
| 123 | + top: 0; |
| 124 | + background-color: var(--bg); |
| 125 | + } |
| 126 | + .modules { |
| 127 | + /* TODO delete? */ |
| 128 | + padding: var(--spacing_sm); |
| 129 | + } |
113 | 130 | .module { |
114 | 131 | margin-bottom: var(--spacing_xs); |
115 | 132 | --link_color: var(--text_2); |
|
0 commit comments