forgejo/web_src/js/webcomponents
oliverpool 8f28cdefe0
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
feat(ui): add switch between formats when previewing CITATION.{cff,bib} files (#9103)
See #8222 for context (loosely related to #4595).

## Implemented changes

The conversion logic is kept in the frontend and the related npm libraries are lazy-loaded (unchanged).

### Show some tabs on the preview of the `CITATION.*` file to switch between the formats:

![image](/attachments/be02656f-d906-4191-aa84-d666ee5a90ba)
![image](/attachments/240384e3-dec8-4f02-94e6-261143193541)

### Convert the "Cite repository" to a simple link to the citation file

So that this change can be considered non-breaking

## Current state (before this PR)

The last non-test call of `git.Blob.GetBlobContent` is made to retrieve the content of an eventual CITATION file.
This is available in the `...` menu near the clone URL:
![image](/attachments/ef79128d-ee3f-4e43-a74d-a00e4dcfe6b4)
And is displayed as a popup:

![image](/attachments/7aa930f9-0766-47b9-8145-cbebb5b051b0)

Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9103
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-11-14 14:39:20 +01:00
..
absolute-date.js [PORT] Fix toAbsoluteLocaleDate and add more tests (gitea#32387) 2024-11-03 15:55:05 +01:00
absolute-date.test.js fix(tests): prevent frontend test dependency on system locale (#6649) 2025-01-22 03:56:36 +00:00
citation-information.js feat(ui): add switch between formats when previewing CITATION.{cff,bib} files (#9103) 2025-11-14 14:39:20 +01:00
index.js frontend: generic lazy loader for webcomponents (#8510) 2025-07-23 04:10:50 +02:00
lazy-webc.js feat(ui): add switch between formats when previewing CITATION.{cff,bib} files (#9103) 2025-11-14 14:39:20 +01:00
origin-url.js Add <overflow-menu>, rename webcomponents (#29400) 2024-03-20 08:46:29 +01:00
origin-url.test.js [PORT] Fix a number of typescript issues (gitea#32308) 2024-11-04 09:15:06 +01:00
overflow-menu.js Add typescript 2024-10-29 18:15:09 +01:00
pdf-object.js frontend: generic lazy loader for webcomponents (#8510) 2025-07-23 04:10:50 +02:00
README.md chore: fix a few typos in the documentation (#9134) 2025-09-04 01:53:40 +02:00
relative-time.js test: fix failure in relative-time tests in US/Canada DST-aware timezones (#8858) 2025-08-12 02:47:58 +02:00
relative-time.test.js Make relative-time a self-maintaining custom element (#8134) 2025-06-10 20:12:21 +02:00

Web Components

This webcomponents directory contains the source code for the web components used in the Gitea Web UI.

https://developer.mozilla.org/en-US/docs/Web/Web_Components

Guidelines

  • These components are loaded in <head> (before DOM body) in a separate entry point, they need to be lightweight to not affect the page loading time too much.
  • Do not import svg.js into a web component because that file is currently not tree-shakeable, import SVG files individually instead.
  • All our components must be added to webpack.config.js so they work correctly in Vue.