@krizaka/ui 3.15.0 → 3.16.1
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.
- package/README.md +1 -0
- package/dist/{chunk-SKMJRM5K.js → chunk-53LQPYQZ.js} +2 -2
- package/dist/chunk-53LQPYQZ.js.map +1 -0
- package/dist/document-viewer.d.ts +200 -0
- package/dist/document-viewer.js +248 -0
- package/dist/document-viewer.js.map +1 -0
- package/dist/nav-bar.js +1 -1
- package/dist/site-footer.js +1 -1
- package/dist/sites.js +1 -1
- package/dist/sites.js.map +1 -1
- package/package.json +25 -6
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chat.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/document-viewer.json +232 -0
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/examples/document-viewer/highlights.d.ts +4 -0
- package/registry/examples/document-viewer/highlights.js +27 -0
- package/registry/examples/document-viewer/highlights.tsx +30 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/how-it-works-page.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +22 -4
- package/registry/iso.json +1 -1
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/map.json +2 -2
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/photo-grid.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +1 -1
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/recipes.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/showcase.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +2 -2
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/swipe-deck.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/vertical-video.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
- package/registry/virtual.json +1 -1
- package/dist/chunk-SKMJRM5K.js.map +0 -1
package/README.md
CHANGED
|
@@ -192,6 +192,7 @@ light or a product's — is a set of tokens.
|
|
|
192
192
|
| `@krizaka/ui/video-trimmer` | `VideoTrimmer` (`duration`, `value` [start, end], `minLength`, `step`/`largeStep`, `frames` or children, `time` + `onSeek`, `classNames` per part, `renderHandle`) | client |
|
|
193
193
|
| `@krizaka/ui/audio-player` | `AudioPlayer` (a seekable waveform: `peaks` or `computePeaks`, `bars`, `playbackRates`, `duration`), `resamplePeaks`, `computeAudioPeaks` | client |
|
|
194
194
|
| `@krizaka/ui/image-cropper` | `ImageCropper` (`aspect`, `round`, an image or a `<video>`, a focus point + zoom out, keyboard and zoom slider), `cropRect` | client |
|
|
195
|
+
| `@krizaka/ui/document-viewer` | `DocumentViewer` (a PDF drawn by pdf.js — `loadPdfjs={() => import("pdfjs-dist")}`, an optional peer — with `highlights` lit where their quotes sit, `activeId` / `onActiveChange`, `onLocate`; page + quote when the text layer cannot place one), `locateQuote` | client |
|
|
195
196
|
| `@krizaka/ui/page` | the page frame: `Page` (`size` narrow·default·wide·full, `as`), `Section` (`id`, `eyebrow`, `title`, `lead`, `actions`, `divider`, `spacing` sm·md·lg, `backdrop`, `size`, `reveal`), `SectionHeading`, `Facts` (`items`: `label`, `tone` ok·wip·neutral, `href`), `Ticks` (backticks read as code) — see [Page blocks](#page-blocks) | server |
|
|
196
197
|
| `@krizaka/ui/page-hero` | `PageHero` (`title` → the h1, `eyebrow`, `lead`, `back`, `aside`, `backdrop` grid·plain·none, `align`, `size`, `linkAs`; facts or actions as children) | server |
|
|
197
198
|
| `@krizaka/ui/card-grid` | `CardGrid` (`min`, `fit` fill·fit, `align`, `reveal` staggered by `columns`, `light`, `as` div·ul·ol) | client |
|
|
@@ -21,7 +21,7 @@ var sites = [
|
|
|
21
21
|
site({ id: "orochia", name: "Orochia", url: "https://dev.orochia.com", kind: "product", group: "products", status: "released", mark: "orochia", repo: "https://github.com/krizaka/orochia" }),
|
|
22
22
|
site({ id: "yasakia", name: "Yasakia", url: "https://dev.yasakia.com", kind: "product", group: "products", status: "upcoming", mark: "yasakia", repo: "https://github.com/krizaka/yasakia" }),
|
|
23
23
|
site({ id: "yororis", name: "Yororis", url: "https://dev.yororis.com", kind: "product", group: "products", status: "construction", mark: "yororis", repo: "https://github.com/krizaka/yororis" }),
|
|
24
|
-
site({ id: "yomizaka", name: "Yomizaka", url: "https://dev.yomizaka.com", kind: "product", group: "products", status: "
|
|
24
|
+
site({ id: "yomizaka", name: "Yomizaka", url: "https://dev.yomizaka.com", kind: "product", group: "products", status: "development", mark: "yomizaka", repo: "https://github.com/krizaka/yomizaka" }),
|
|
25
25
|
// In development: nothing deployed yet, so the address is the repository (never a dead link to an unborn dev site).
|
|
26
26
|
site({ id: "kachizaka", name: "Kachizaka", url: "https://github.com/krizaka/kachizaka", kind: "product", group: "products", status: "development", mark: "kachizaka", repo: "https://github.com/krizaka/kachizaka" }),
|
|
27
27
|
site({ id: "akinaza", name: "Akinaza", url: "https://github.com/krizaka/akinaza", kind: "product", group: "products", status: "development", mark: "akinaza", repo: "https://github.com/krizaka/akinaza" }),
|
|
@@ -92,4 +92,4 @@ export {
|
|
|
92
92
|
sitesByGroup,
|
|
93
93
|
familyLabels
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-53LQPYQZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/family-mark.tsx","../src/sites/sites.ts"],"sourcesContent":["// The mark of a site of the family (`@krizaka/ui/sites`): its brand's `ProductLogo`, still (a list of marks never\n// moves), or GitHub's, in the text colour. Shared by `NavBar.Family` and `SiteFooter` — not an entry of its own.\nimport type * as React from \"react\";\n\nimport { ProductLogo } from \"./marks/ProductLogo\";\nimport type { SiteMark } from \"./sites/sites\";\n\n/** GitHub's mark, in the text colour (both themes). */\nexport function GitHubGlyph({ size = 16, className }: { size?: number; className?: string }) {\n return (\n <svg viewBox=\"0 0 16 16\" width={size} height={size} fill=\"currentColor\" aria-hidden className={className}>\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z\" />\n </svg>\n );\n}\n\n/** A site's mark, decorative (its name is always written beside it). */\nexport function FamilyMark({ mark, size }: { mark: SiteMark; size: number }): React.ReactElement {\n if (mark === \"github\") return <GitHubGlyph size={Math.round(size * 0.8)} />;\n return <ProductLogo id={mark} size={size} animated={false} />;\n}\n","// Server-safe: plain data. The Krizaka family — every site Krizaka runs, once. The family switcher of the bar\n// (`NavBar.Family`) and the common footer (`SiteFooter`) both read it, so adding a site is one release of this package:\n// every bar and every footer of the family follow.\n//\n// The words of the family (a site's one line, the groups, the statuses, the footer's signature) are brand data, written\n// here in English and French (`familyLabels`) — a site passes the set of its locale, or its own translation.\n\n/** A site of the family. */\nexport type SiteId = \"krizaka\" | \"orazaka\" | \"orochia\" | \"yasakia\" | \"yororis\" | \"yomizaka\" | \"kachizaka\" | \"akinaza\" | \"ui\" | \"java\" | \"github\";\n\n/** What a site is: the company, a product, or an open-source project. It chooses the footer's signature line. */\nexport type SiteKind = \"company\" | \"product\" | \"open-source\";\n\n/**\n * `released`: open to visit. `upcoming`: announced, not released yet (said \"Coming soon\"). `construction`: under\n * construction — nothing deployed beyond its page, nothing offered. `development`: being built in the open, nothing\n * deployed yet — its address is its repository (said \"In development\").\n */\nexport type SiteStatus = \"released\" | \"upcoming\" | \"construction\" | \"development\";\n\n/** The groups of the family, in reading order: Krizaka · Products · Open source · GitHub. */\nexport type SiteGroup = \"krizaka\" | \"products\" | \"open-source\" | \"github\";\n\n/** The mark a site wears: a brand of `ProductLogo` (Krizaka UI and Krizaka Java wear Krizaka's), or GitHub's. */\nexport type SiteMark = \"krizaka\" | \"orazaka\" | \"orochia\" | \"yasakia\" | \"yororis\" | \"yomizaka\" | \"kachizaka\" | \"akinaza\" | \"github\";\n\nexport interface Site {\n readonly id: SiteId;\n /** The name, never translated. */\n readonly name: string;\n /** The address of the site (its home). */\n readonly url: string;\n /** The address without the scheme, as people say it (`ui.krizaka.com`). */\n readonly host: string;\n readonly kind: SiteKind;\n readonly group: SiteGroup;\n readonly status: SiteStatus;\n readonly mark: SiteMark;\n /** The repository the site is built from. */\n readonly repo: string;\n}\n\nconst site = (s: Omit<Site, \"host\">): Site => ({ ...s, host: s.url.replace(/^https?:\\/\\//, \"\").replace(/\\/$/, \"\") });\n\n/** Every site of the family, in reading order (the group order, then the order inside each group). */\nexport const sites: readonly Site[] = [\n site({ id: \"krizaka\", name: \"Krizaka\", url: \"https://www.krizaka.com\", kind: \"company\", group: \"krizaka\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-com\" }),\n site({ id: \"orazaka\", name: \"Orazaka\", url: \"https://dev.orazaka.com\", kind: \"product\", group: \"products\", status: \"released\", mark: \"orazaka\", repo: \"https://github.com/krizaka/orazaka\" }),\n site({ id: \"orochia\", name: \"Orochia\", url: \"https://dev.orochia.com\", kind: \"product\", group: \"products\", status: \"released\", mark: \"orochia\", repo: \"https://github.com/krizaka/orochia\" }),\n site({ id: \"yasakia\", name: \"Yasakia\", url: \"https://dev.yasakia.com\", kind: \"product\", group: \"products\", status: \"upcoming\", mark: \"yasakia\", repo: \"https://github.com/krizaka/yasakia\" }),\n site({ id: \"yororis\", name: \"Yororis\", url: \"https://dev.yororis.com\", kind: \"product\", group: \"products\", status: \"construction\", mark: \"yororis\", repo: \"https://github.com/krizaka/yororis\" }),\n site({ id: \"yomizaka\", name: \"Yomizaka\", url: \"https://dev.yomizaka.com\", kind: \"product\", group: \"products\", status: \"development\", mark: \"yomizaka\", repo: \"https://github.com/krizaka/yomizaka\" }),\n // In development: nothing deployed yet, so the address is the repository (never a dead link to an unborn dev site).\n site({ id: \"kachizaka\", name: \"Kachizaka\", url: \"https://github.com/krizaka/kachizaka\", kind: \"product\", group: \"products\", status: \"development\", mark: \"kachizaka\", repo: \"https://github.com/krizaka/kachizaka\" }),\n site({ id: \"akinaza\", name: \"Akinaza\", url: \"https://github.com/krizaka/akinaza\", kind: \"product\", group: \"products\", status: \"development\", mark: \"akinaza\", repo: \"https://github.com/krizaka/akinaza\" }),\n site({ id: \"ui\", name: \"Krizaka UI\", url: \"https://ui.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-ui\" }),\n site({ id: \"java\", name: \"Krizaka Java\", url: \"https://java.krizaka.com\", kind: \"open-source\", group: \"open-source\", status: \"released\", mark: \"krizaka\", repo: \"https://github.com/krizaka/krizaka-build\" }),\n site({ id: \"github\", name: \"GitHub\", url: \"https://github.com/krizaka\", kind: \"open-source\", group: \"github\", status: \"released\", mark: \"github\", repo: \"https://github.com/krizaka\" }),\n];\n\n/** The groups, in reading order. */\nexport const siteGroups: readonly SiteGroup[] = [\"krizaka\", \"products\", \"open-source\", \"github\"];\n\n/** A site by id. */\nexport function siteById(id: SiteId): Site {\n const found = sites.find((s) => s.id === id);\n if (!found) throw new Error(`Unknown Krizaka site \"${id}\".`);\n return found;\n}\n\n/** The family grouped, in reading order: `[{ group, sites }]`, empty groups left out. */\nexport function sitesByGroup(): { group: SiteGroup; sites: Site[] }[] {\n return siteGroups.map((group) => ({ group, sites: sites.filter((s) => s.group === group) })).filter((g) => g.sites.length > 0);\n}\n\n/** The languages the family's words are written in. */\nexport type SiteLocale = \"en\" | \"fr\";\n\n/** The words of the family: the switcher, the footer, each site's one line. */\nexport interface FamilyLabels {\n /** The family's name: the switcher's navigation and its button, the footer's navigation (“Krizaka family”). */\n family: string;\n /** The heading of each group. */\n groups: Record<SiteGroup, string>;\n /** The badge of a site that is not released. */\n status: Record<Exclude<SiteStatus, \"released\">, string>;\n /** Says which site is the current one (“You are here”). */\n current: string;\n /** One line per site: what it is. */\n descriptions: Record<SiteId, string>;\n /** The footer's signature, by the kind of the current site (“A Krizaka product”). */\n signature: Record<SiteKind, string>;\n /** The footer's place line (“Made in Montréal”). */\n place: string;\n /** The accessible name of the version (“Version”). */\n version: string;\n}\n\n/** The family's words in English and French. Pass `familyLabels[locale]`, or your own translation of the same shape. */\nexport const familyLabels: Record<SiteLocale, FamilyLabels> = {\n en: {\n family: \"Krizaka family\",\n groups: { krizaka: \"Krizaka\", products: \"Products\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Coming soon\", construction: \"Under construction\", development: \"In development\" },\n current: \"You are here\",\n descriptions: {\n krizaka: \"The company: our products, our open source, our story.\",\n orazaka: \"Sovereign AI, on your own servers.\",\n orochia: \"A video platform for creators.\",\n yasakia: \"The dating app where you talk first.\",\n yororis: \"A listening space with a face and a voice.\",\n yomizaka: \"Your documents, read and checked by Orazaka.\",\n kachizaka: \"Predictions among friends — live data, in real time.\",\n akinaza: \"Running a shop in Québec, for less — Loi 25 by design.\",\n ui: \"Components, tokens, icons and charts — web and React Native.\",\n java: \"Spring Boot building blocks on Maven Central.\",\n github: \"Every repository, in the open.\",\n },\n signature: { company: \"A Krizaka company\", product: \"A Krizaka product\", \"open-source\": \"A Krizaka open-source project\" },\n place: \"Made in Montréal\",\n version: \"Version\",\n },\n fr: {\n family: \"Famille Krizaka\",\n groups: { krizaka: \"Krizaka\", products: \"Produits\", \"open-source\": \"Open source\", github: \"GitHub\" },\n status: { upcoming: \"Bientôt\", construction: \"En construction\", development: \"En développement\" },\n current: \"Vous êtes ici\",\n descriptions: {\n krizaka: \"La compagnie : nos produits, notre open source, notre histoire.\",\n orazaka: \"L’IA souveraine, sur vos propres serveurs.\",\n orochia: \"Une plateforme vidéo pour les créateurs.\",\n yasakia: \"L’app de rencontre où l’on se parle d’abord.\",\n yororis: \"Un espace d’écoute avec un visage et une voix.\",\n yomizaka: \"Vos documents, lus et vérifiés par Orazaka.\",\n kachizaka: \"Les pronostics entre amis — des données en direct.\",\n akinaza: \"Tenir une boutique au Québec, pour moins cher — Loi 25 dès la conception.\",\n ui: \"Composants, jetons, icônes et graphiques — web et React Native.\",\n java: \"Des briques Spring Boot sur Maven Central.\",\n github: \"Tous les dépôts, au grand jour.\",\n },\n signature: { company: \"Une compagnie Kr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
+
|
|
4
|
+
/** A text item as pdf.js returns it (`TextItem`): the string, its matrix (`[a, b, c, d, x, baseline]`) and its size. */
|
|
5
|
+
type TextItem = {
|
|
6
|
+
str: string;
|
|
7
|
+
transform: number[];
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
/** A rectangle in fractions of the page (0–1), origin top-left — independent of the zoom the page is drawn at. */
|
|
12
|
+
type Box = {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
/** The text layer of one page: its size in PDF units (rotation 0) and its items in reading order. */
|
|
19
|
+
type PageText = {
|
|
20
|
+
page: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
items: readonly TextItem[];
|
|
24
|
+
};
|
|
25
|
+
type Located = {
|
|
26
|
+
/** 1-based page where the passage starts. */
|
|
27
|
+
page: number;
|
|
28
|
+
/** One box per line of the passage (merged along a line); empty when only the page is known. */
|
|
29
|
+
boxes: Box[];
|
|
30
|
+
/** `exact`: the whole quote was found; `start`: only its opening words were (a quote cut by a different layout). */
|
|
31
|
+
match: "exact" | "start" | "page";
|
|
32
|
+
};
|
|
33
|
+
/** The comparable form of a text: no whitespace, no soft hyphen, straight quotes, case and accents folded. */
|
|
34
|
+
declare function fold(text: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Where `quote` sits in the pages: the first page (starting with `hintPage`, if any) whose text contains it, and the
|
|
37
|
+
* boxes of its lines. A quote that a different layout cut (a column break, a hyphen) is looked for by its opening
|
|
38
|
+
* words (`match: "start"`); one that is nowhere gives `null`, or the hinted page alone (`match: "page"`). Never a guess:
|
|
39
|
+
* a rotated page has no boxes, only its page.
|
|
40
|
+
*/
|
|
41
|
+
declare function locateQuote(pages: readonly PageText[], quote: string, hintPage?: number): Located | null;
|
|
42
|
+
|
|
43
|
+
declare const documentViewer: tailwind_variants.TVReturnType<{
|
|
44
|
+
[key: string]: {
|
|
45
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
46
|
+
page?: tailwind_variants.ClassValue;
|
|
47
|
+
root?: tailwind_variants.ClassValue;
|
|
48
|
+
pages?: tailwind_variants.ClassValue;
|
|
49
|
+
canvas?: tailwind_variants.ClassValue;
|
|
50
|
+
caption?: tailwind_variants.ClassValue;
|
|
51
|
+
box?: tailwind_variants.ClassValue;
|
|
52
|
+
bar?: tailwind_variants.ClassValue;
|
|
53
|
+
status?: tailwind_variants.ClassValue;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
[x: string]: {
|
|
58
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
59
|
+
page?: tailwind_variants.ClassValue;
|
|
60
|
+
root?: tailwind_variants.ClassValue;
|
|
61
|
+
pages?: tailwind_variants.ClassValue;
|
|
62
|
+
canvas?: tailwind_variants.ClassValue;
|
|
63
|
+
caption?: tailwind_variants.ClassValue;
|
|
64
|
+
box?: tailwind_variants.ClassValue;
|
|
65
|
+
bar?: tailwind_variants.ClassValue;
|
|
66
|
+
status?: tailwind_variants.ClassValue;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
} | {}, {
|
|
70
|
+
root: string;
|
|
71
|
+
pages: string;
|
|
72
|
+
page: string;
|
|
73
|
+
canvas: string;
|
|
74
|
+
caption: string;
|
|
75
|
+
box: string;
|
|
76
|
+
bar: string;
|
|
77
|
+
status: string;
|
|
78
|
+
}, undefined, {
|
|
79
|
+
[key: string]: {
|
|
80
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
81
|
+
page?: tailwind_variants.ClassValue;
|
|
82
|
+
root?: tailwind_variants.ClassValue;
|
|
83
|
+
pages?: tailwind_variants.ClassValue;
|
|
84
|
+
canvas?: tailwind_variants.ClassValue;
|
|
85
|
+
caption?: tailwind_variants.ClassValue;
|
|
86
|
+
box?: tailwind_variants.ClassValue;
|
|
87
|
+
bar?: tailwind_variants.ClassValue;
|
|
88
|
+
status?: tailwind_variants.ClassValue;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
} | {}, {
|
|
92
|
+
root: string;
|
|
93
|
+
pages: string;
|
|
94
|
+
page: string;
|
|
95
|
+
canvas: string;
|
|
96
|
+
caption: string;
|
|
97
|
+
box: string;
|
|
98
|
+
bar: string;
|
|
99
|
+
status: string;
|
|
100
|
+
}, tailwind_variants.TVReturnTypeLike<unknown, {
|
|
101
|
+
root: string;
|
|
102
|
+
pages: string;
|
|
103
|
+
page: string;
|
|
104
|
+
canvas: string;
|
|
105
|
+
caption: string;
|
|
106
|
+
box: string;
|
|
107
|
+
bar: string;
|
|
108
|
+
status: string;
|
|
109
|
+
}>>;
|
|
110
|
+
/** The words of the viewer, passed translated. `{page}` and `{total}` are replaced. */
|
|
111
|
+
type DocumentViewerLabels = {
|
|
112
|
+
/** The accessible name of the pages' region. */
|
|
113
|
+
region: string;
|
|
114
|
+
loading: string;
|
|
115
|
+
failed: string;
|
|
116
|
+
/** A page's caption and accessible name: "Page {page} of {total}". */
|
|
117
|
+
page: string;
|
|
118
|
+
/** The bar above the pages when the active passage could only be placed on a page: "Passage on page {page}:". */
|
|
119
|
+
onPage: string;
|
|
120
|
+
/** The bar when the active passage is not in the text layer. */
|
|
121
|
+
notFound: string;
|
|
122
|
+
};
|
|
123
|
+
declare const documentViewerLabels: DocumentViewerLabels;
|
|
124
|
+
/** A passage to light: its quote (as the text layer reads it), the page if the app knows it, a name for screen readers. */
|
|
125
|
+
type DocumentHighlight = {
|
|
126
|
+
id: string;
|
|
127
|
+
quote: string;
|
|
128
|
+
page?: number;
|
|
129
|
+
label?: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** The members of pdf.js the viewer uses (`pdfjs-dist` ≥ 5), typed here so the package does not depend on it. */
|
|
133
|
+
type PdfjsModule = {
|
|
134
|
+
GlobalWorkerOptions: {
|
|
135
|
+
workerSrc: string;
|
|
136
|
+
};
|
|
137
|
+
getDocument(source: {
|
|
138
|
+
url?: string;
|
|
139
|
+
data?: Uint8Array;
|
|
140
|
+
}): {
|
|
141
|
+
promise: Promise<PdfDocument>;
|
|
142
|
+
destroy?: () => Promise<void> | void;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
type PdfDocument = {
|
|
146
|
+
numPages: number;
|
|
147
|
+
getPage(n: number): Promise<PdfPage>;
|
|
148
|
+
destroy?: () => Promise<void> | void;
|
|
149
|
+
};
|
|
150
|
+
type PdfPage = {
|
|
151
|
+
rotate: number;
|
|
152
|
+
view: number[];
|
|
153
|
+
getViewport(options: {
|
|
154
|
+
scale: number;
|
|
155
|
+
}): {
|
|
156
|
+
width: number;
|
|
157
|
+
height: number;
|
|
158
|
+
};
|
|
159
|
+
getTextContent(): Promise<{
|
|
160
|
+
items: readonly unknown[];
|
|
161
|
+
}>;
|
|
162
|
+
render(options: {
|
|
163
|
+
canvas: HTMLCanvasElement;
|
|
164
|
+
canvasContext: CanvasRenderingContext2D;
|
|
165
|
+
viewport: {
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
};
|
|
169
|
+
}): {
|
|
170
|
+
promise: Promise<void>;
|
|
171
|
+
cancel?: () => void;
|
|
172
|
+
};
|
|
173
|
+
cleanup?: () => void;
|
|
174
|
+
};
|
|
175
|
+
type DocumentViewerProps = Omit<React.ComponentProps<"div">, "children" | "onChange"> & {
|
|
176
|
+
/** The PDF: an address (same origin or CORS) or its bytes. */
|
|
177
|
+
src: string | Uint8Array;
|
|
178
|
+
/** Loads pdf.js: `() => import("pdfjs-dist")`. An optional peer, never in a bundle without a document. */
|
|
179
|
+
loadPdfjs: () => Promise<PdfjsModule>;
|
|
180
|
+
/** The address of pdf.js's worker (`new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString()`). */
|
|
181
|
+
workerSrc: string;
|
|
182
|
+
/** The passages to light. */
|
|
183
|
+
highlights?: readonly DocumentHighlight[];
|
|
184
|
+
/** The passage in focus: the viewer scrolls to it. */
|
|
185
|
+
activeId?: string | null;
|
|
186
|
+
/** A box was clicked (the id) or the focus was released (`null`). */
|
|
187
|
+
onActiveChange?: (id: string | null) => void;
|
|
188
|
+
/** Where each passage was found (`null`: nowhere) — once the text layer is read, and again if `highlights` change. */
|
|
189
|
+
onLocate?: (found: Record<string, Located | null>) => void;
|
|
190
|
+
/** Called when the document is open, with its page count. */
|
|
191
|
+
onLoad?: (info: {
|
|
192
|
+
pages: number;
|
|
193
|
+
}) => void;
|
|
194
|
+
/** The words of the viewer, translated (English by default). */
|
|
195
|
+
labels?: Partial<DocumentViewerLabels>;
|
|
196
|
+
};
|
|
197
|
+
/** A PDF with its passages lit — see the file's header. Client. */
|
|
198
|
+
declare function DocumentViewer({ src, loadPdfjs, workerSrc, highlights, activeId, onActiveChange, onLocate, onLoad, labels, className, ...props }: DocumentViewerProps): React.JSX.Element;
|
|
199
|
+
|
|
200
|
+
export { type Box, type DocumentHighlight, DocumentViewer, type DocumentViewerLabels, type DocumentViewerProps, type Located, type PageText, type PdfDocument, type PdfPage, type PdfjsModule, type TextItem, documentViewer, documentViewerLabels, fold, locateQuote };
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
useLatest,
|
|
4
|
+
usePrefersReducedMotion
|
|
5
|
+
} from "./chunk-FZBWEDQI.js";
|
|
6
|
+
|
|
7
|
+
// src/document-viewer/document-viewer.tsx
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { tv } from "tailwind-variants";
|
|
10
|
+
|
|
11
|
+
// src/document-viewer/locate.ts
|
|
12
|
+
var FOLD = { "\u2019": "'", "\u2018": "'", "\u201C": '"', "\u201D": '"', "\xAB": '"', "\xBB": '"', "\u2013": "-", "\u2014": "-", "\xA0": " ", "\u202F": " ", "\uFB01": "fi", "\uFB02": "fl" };
|
|
13
|
+
function fold(text) {
|
|
14
|
+
let out = "";
|
|
15
|
+
for (const ch of text.normalize("NFKD")) {
|
|
16
|
+
if (/\p{M}/u.test(ch) || /\s/u.test(ch) || ch === "\xAD" || ch === "\u200B") continue;
|
|
17
|
+
out += (FOLD[ch] ?? ch).toLowerCase();
|
|
18
|
+
}
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
function indexPage(items) {
|
|
22
|
+
let text = "";
|
|
23
|
+
const at = [];
|
|
24
|
+
items.forEach((item, i) => {
|
|
25
|
+
for (let c = 0; c < item.str.length; c++) {
|
|
26
|
+
const piece = fold(item.str[c]);
|
|
27
|
+
for (let k = 0; k < piece.length; k++) {
|
|
28
|
+
text += piece[k];
|
|
29
|
+
at.push({ item: i, char: c });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return { text, at };
|
|
34
|
+
}
|
|
35
|
+
function boxesOf(page, index, from, to) {
|
|
36
|
+
const spans = /* @__PURE__ */ new Map();
|
|
37
|
+
for (let k = from; k < to; k++) {
|
|
38
|
+
const { item, char } = index.at[k];
|
|
39
|
+
const s = spans.get(item);
|
|
40
|
+
spans.set(item, s ? [Math.min(s[0], char), Math.max(s[1], char + 1)] : [char, char + 1]);
|
|
41
|
+
}
|
|
42
|
+
const raw = [];
|
|
43
|
+
for (const [i, [c0, c1]] of [...spans].sort((a, b) => a[0] - b[0])) {
|
|
44
|
+
const item = page.items[i];
|
|
45
|
+
const len = Math.max(1, item.str.length);
|
|
46
|
+
const size = item.height || Math.abs(item.transform[3] ?? 0) || 10;
|
|
47
|
+
const x = (item.transform[4] ?? 0) + item.width * c0 / len;
|
|
48
|
+
const w = item.width * (c1 - c0) / len;
|
|
49
|
+
const top = page.height - ((item.transform[5] ?? 0) + size * 0.9);
|
|
50
|
+
raw.push({ x: x / page.width, y: top / page.height, width: w / page.width, height: size * 1.15 / page.height });
|
|
51
|
+
}
|
|
52
|
+
const merged = [];
|
|
53
|
+
for (const b of raw) {
|
|
54
|
+
const last = merged[merged.length - 1];
|
|
55
|
+
const sameLine = last && Math.abs(last.y - b.y) < last.height * 0.5 && b.x - (last.x + last.width) < last.height * 1.5 && b.x >= last.x - 1e-9;
|
|
56
|
+
if (last && sameLine) {
|
|
57
|
+
const right = Math.max(last.x + last.width, b.x + b.width);
|
|
58
|
+
last.y = Math.min(last.y, b.y);
|
|
59
|
+
last.height = Math.max(last.height, b.height);
|
|
60
|
+
last.width = right - last.x;
|
|
61
|
+
} else merged.push({ ...b });
|
|
62
|
+
}
|
|
63
|
+
return merged.map((b) => ({ x: clamp01(b.x), y: clamp01(b.y), width: Math.min(b.width, 1 - clamp01(b.x)), height: Math.min(b.height, 1 - clamp01(b.y)) }));
|
|
64
|
+
}
|
|
65
|
+
var clamp01 = (n) => Math.min(1, Math.max(0, n));
|
|
66
|
+
var MIN_START = 24;
|
|
67
|
+
function locateQuote(pages, quote, hintPage) {
|
|
68
|
+
const needle = fold(quote);
|
|
69
|
+
const ordered = hintPage ? [...pages].sort((a, b) => Number(b.page === hintPage) - Number(a.page === hintPage)) : pages;
|
|
70
|
+
if (needle.length > 0) {
|
|
71
|
+
for (const mode of ["exact", "start"]) {
|
|
72
|
+
const wanted = mode === "exact" ? needle : needle.slice(0, Math.max(MIN_START, Math.min(40, Math.floor(needle.length * 0.6))));
|
|
73
|
+
if (mode === "start" && (needle.length <= wanted.length || wanted.length < MIN_START)) break;
|
|
74
|
+
for (const page of ordered) {
|
|
75
|
+
const index = indexPage(page.items);
|
|
76
|
+
const found = index.text.indexOf(wanted);
|
|
77
|
+
if (found < 0) continue;
|
|
78
|
+
return { page: page.page, boxes: boxesOf(page, index, found, found + wanted.length), match: mode };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return hintPage && pages.some((p) => p.page === hintPage) ? { page: hintPage, boxes: [], match: "page" } : null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// src/document-viewer/document-viewer.tsx
|
|
86
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
87
|
+
var documentViewer = tv({
|
|
88
|
+
slots: {
|
|
89
|
+
root: "relative flex min-w-0 flex-col gap-3",
|
|
90
|
+
pages: "flex max-h-(--kz-document-viewer-height,70vh) flex-col gap-3 overflow-auto rounded-lg border border-border-default bg-surface-2 p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
|
|
91
|
+
page: "relative mx-auto w-full max-w-(--kz-document-viewer-page,56rem) shrink-0 overflow-hidden rounded-sm bg-white shadow-sm",
|
|
92
|
+
canvas: "block h-auto w-full",
|
|
93
|
+
caption: "absolute top-1 left-1 rounded-sm bg-surface-1/90 px-1.5 py-0.5 text-xs text-fg-secondary",
|
|
94
|
+
box: "absolute cursor-pointer rounded-xs border border-warning/70 bg-warning/25 mix-blend-multiply transition-colors data-[active=true]:border-2 data-[active=true]:border-danger data-[active=true]:bg-danger/25 motion-reduce:transition-none",
|
|
95
|
+
bar: "rounded-lg border border-border-default bg-surface-1 px-3 py-2 text-sm text-fg-secondary",
|
|
96
|
+
status: "p-6 text-center text-sm text-fg-secondary"
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var documentViewerLabels = {
|
|
100
|
+
region: "Document pages",
|
|
101
|
+
loading: "Loading the document\u2026",
|
|
102
|
+
failed: "The document could not be displayed.",
|
|
103
|
+
page: "Page {page} of {total}",
|
|
104
|
+
onPage: "Passage on page {page}:",
|
|
105
|
+
notFound: "This passage is not in the document's text layer:"
|
|
106
|
+
};
|
|
107
|
+
var fill = (template, vars) => template.replace(/\{(\w+)\}/g, (m, k) => k in vars ? String(vars[k]) : m);
|
|
108
|
+
var isItem = (x) => typeof x === "object" && x !== null && typeof x.str === "string" && Array.isArray(x.transform);
|
|
109
|
+
function PageCanvas({ page, doc, caption, onReady, className }) {
|
|
110
|
+
const ref = React.useRef(null);
|
|
111
|
+
const wrapper = React.useRef(null);
|
|
112
|
+
const [visible, setVisible] = React.useState(() => typeof IntersectionObserver === "undefined");
|
|
113
|
+
const ready = useLatest(onReady);
|
|
114
|
+
React.useEffect(() => {
|
|
115
|
+
const node = wrapper.current?.parentElement;
|
|
116
|
+
if (!node) return;
|
|
117
|
+
if (typeof IntersectionObserver === "undefined") return;
|
|
118
|
+
const observer = new IntersectionObserver((entries) => entries.some((e) => e.isIntersecting) && setVisible(true), { rootMargin: "600px 0px" });
|
|
119
|
+
observer.observe(node);
|
|
120
|
+
return () => observer.disconnect();
|
|
121
|
+
}, []);
|
|
122
|
+
React.useEffect(() => {
|
|
123
|
+
if (!visible) return;
|
|
124
|
+
let task;
|
|
125
|
+
let cancelled = false;
|
|
126
|
+
void (async () => {
|
|
127
|
+
const p = await doc.getPage(page);
|
|
128
|
+
const canvas = ref.current;
|
|
129
|
+
const ctx = canvas?.getContext("2d");
|
|
130
|
+
if (cancelled || !canvas || !ctx) return;
|
|
131
|
+
const base = p.getViewport({ scale: 1 });
|
|
132
|
+
const dpr = typeof window === "undefined" ? 1 : Math.min(2, window.devicePixelRatio || 1);
|
|
133
|
+
const scale = Math.min(2.5, Math.max(1, (canvas.parentElement?.clientWidth || base.width) / base.width)) * dpr;
|
|
134
|
+
const viewport = p.getViewport({ scale });
|
|
135
|
+
canvas.width = Math.floor(viewport.width);
|
|
136
|
+
canvas.height = Math.floor(viewport.height);
|
|
137
|
+
task = p.render({ canvas, canvasContext: ctx, viewport });
|
|
138
|
+
await task.promise.catch(() => void 0);
|
|
139
|
+
if (!cancelled) ready.current?.();
|
|
140
|
+
})().catch(() => void 0);
|
|
141
|
+
return () => {
|
|
142
|
+
cancelled = true;
|
|
143
|
+
task?.cancel?.();
|
|
144
|
+
};
|
|
145
|
+
}, [visible, doc, page, ready]);
|
|
146
|
+
return /* @__PURE__ */ jsxs("div", { ref: wrapper, className: "contents", children: [
|
|
147
|
+
/* @__PURE__ */ jsx("canvas", { ref, "aria-hidden": "true", className }),
|
|
148
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: caption })
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
function DocumentViewer({ src, loadPdfjs, workerSrc, highlights = [], activeId = null, onActiveChange, onLocate, onLoad, labels, className, ...props }) {
|
|
152
|
+
const words = { ...documentViewerLabels, ...labels };
|
|
153
|
+
const s = documentViewer();
|
|
154
|
+
const reduce = usePrefersReducedMotion();
|
|
155
|
+
const [loaded, setPhase] = React.useState({ state: "loading" });
|
|
156
|
+
const callbacks = useLatest({ onLoad, onLocate });
|
|
157
|
+
const containerRef = React.useRef(null);
|
|
158
|
+
const bytes = typeof src === "string" ? src : src.byteLength + ":" + src[0] + ":" + src[src.length - 1];
|
|
159
|
+
const phase = loaded.state !== "loading" && loaded.key !== bytes ? { state: "loading" } : loaded;
|
|
160
|
+
React.useEffect(() => {
|
|
161
|
+
let cancelled = false;
|
|
162
|
+
let opened;
|
|
163
|
+
void (async () => {
|
|
164
|
+
const pdfjs = await loadPdfjs();
|
|
165
|
+
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
|
166
|
+
const loading = pdfjs.getDocument(typeof src === "string" ? { url: src } : { data: src.slice() });
|
|
167
|
+
opened = loading;
|
|
168
|
+
const doc = await loading.promise;
|
|
169
|
+
const texts = [];
|
|
170
|
+
const sizes = [];
|
|
171
|
+
for (let n = 1; n <= doc.numPages; n++) {
|
|
172
|
+
const page = await doc.getPage(n);
|
|
173
|
+
const vp = page.getViewport({ scale: 1 });
|
|
174
|
+
sizes.push({ width: vp.width, height: vp.height });
|
|
175
|
+
const content = await page.getTextContent();
|
|
176
|
+
texts.push({ page: n, width: vp.width, height: vp.height, items: page.rotate % 360 === 0 ? content.items.filter(isItem) : [] });
|
|
177
|
+
page.cleanup?.();
|
|
178
|
+
}
|
|
179
|
+
if (cancelled) return;
|
|
180
|
+
setPhase({ state: "ready", key: bytes, doc, texts, sizes });
|
|
181
|
+
callbacks.current.onLoad?.({ pages: doc.numPages });
|
|
182
|
+
})().catch(() => !cancelled && setPhase({ state: "error", key: bytes }));
|
|
183
|
+
return () => {
|
|
184
|
+
cancelled = true;
|
|
185
|
+
void opened?.destroy?.();
|
|
186
|
+
};
|
|
187
|
+
}, [bytes, loadPdfjs, workerSrc, callbacks]);
|
|
188
|
+
const key = highlights.map((h) => `${h.id}\0${h.page ?? ""}\0${h.quote}`).join("");
|
|
189
|
+
const found = React.useMemo(() => {
|
|
190
|
+
const out = {};
|
|
191
|
+
if (phase.state === "ready") for (const h of highlights) out[h.id] = locateQuote(phase.texts, h.quote, h.page);
|
|
192
|
+
return out;
|
|
193
|
+
}, [phase, key]);
|
|
194
|
+
React.useEffect(() => {
|
|
195
|
+
if (phase.state === "ready") callbacks.current.onLocate?.(found);
|
|
196
|
+
}, [found, phase.state, callbacks]);
|
|
197
|
+
const active = activeId ? highlights.find((h) => h.id === activeId) : void 0;
|
|
198
|
+
const where = activeId ? found[activeId] : void 0;
|
|
199
|
+
React.useEffect(() => {
|
|
200
|
+
if (phase.state !== "ready" || !where) return;
|
|
201
|
+
const root = containerRef.current;
|
|
202
|
+
const target = root?.querySelector(where.boxes.length > 0 ? `[data-highlight="${CSS.escape(activeId)}"]` : `[data-page="${where.page}"]`) ?? null;
|
|
203
|
+
target?.scrollIntoView?.({ block: where.boxes.length > 0 ? "center" : "start", behavior: reduce ? "auto" : "smooth" });
|
|
204
|
+
}, [activeId, where, phase.state]);
|
|
205
|
+
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), ...props, children: [
|
|
206
|
+
active && where !== void 0 && where?.match !== "exact" && where?.match !== "start" ? /* @__PURE__ */ jsxs("p", { className: s.bar(), "data-testid": "document-viewer-bar", children: [
|
|
207
|
+
where?.match === "page" ? fill(words.onPage, { page: where.page }) : words.notFound,
|
|
208
|
+
" ",
|
|
209
|
+
/* @__PURE__ */ jsx("q", { children: active.quote })
|
|
210
|
+
] }) : null,
|
|
211
|
+
/* @__PURE__ */ jsxs("div", { ref: containerRef, className: s.pages(), role: "region", "aria-label": words.region, tabIndex: 0, children: [
|
|
212
|
+
phase.state === "loading" ? /* @__PURE__ */ jsx("p", { className: s.status(), children: words.loading }) : null,
|
|
213
|
+
phase.state === "error" ? /* @__PURE__ */ jsx("p", { role: "alert", className: s.status(), children: words.failed }) : null,
|
|
214
|
+
phase.state === "ready" ? phase.texts.map((t, i) => {
|
|
215
|
+
const size = phase.sizes[i];
|
|
216
|
+
const caption = fill(words.page, { page: t.page, total: phase.doc.numPages });
|
|
217
|
+
return /* @__PURE__ */ jsxs("div", { className: s.page(), "data-page": t.page, style: { aspectRatio: `${size.width} / ${size.height}` }, children: [
|
|
218
|
+
/* @__PURE__ */ jsx(PageCanvas, { page: t.page, doc: phase.doc, caption, className: s.canvas() }),
|
|
219
|
+
/* @__PURE__ */ jsx("span", { className: s.caption(), "aria-hidden": "true", children: caption }),
|
|
220
|
+
highlights.flatMap((h) => {
|
|
221
|
+
const f = found[h.id];
|
|
222
|
+
if (!f || f.page !== t.page) return [];
|
|
223
|
+
return f.boxes.map((b, k) => /* @__PURE__ */ jsx(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
"aria-hidden": "true",
|
|
227
|
+
"data-highlight": h.id,
|
|
228
|
+
"data-active": h.id === activeId,
|
|
229
|
+
className: s.box(),
|
|
230
|
+
style: { left: `${b.x * 100}%`, top: `${b.y * 100}%`, width: `${b.width * 100}%`, height: `${b.height * 100}%` },
|
|
231
|
+
onClick: () => onActiveChange?.(h.id === activeId ? null : h.id)
|
|
232
|
+
},
|
|
233
|
+
`${h.id}:${k}`
|
|
234
|
+
));
|
|
235
|
+
})
|
|
236
|
+
] }, t.page);
|
|
237
|
+
}) : null
|
|
238
|
+
] })
|
|
239
|
+
] });
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
DocumentViewer,
|
|
243
|
+
documentViewer,
|
|
244
|
+
documentViewerLabels,
|
|
245
|
+
fold,
|
|
246
|
+
locateQuote
|
|
247
|
+
};
|
|
248
|
+
//# sourceMappingURL=document-viewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/document-viewer/document-viewer.tsx","../src/document-viewer/locate.ts"],"sourcesContent":["// Client. A PDF drawn page by page (pdf.js), and passages of it lit where they sit. The app hands over the engine\n// (`loadPdfjs={() => import(\"pdfjs-dist\")}` — an optional peer, loaded only on a page that shows a document) and the\n// worker's address; it hands over the passages as quotes (`highlights`), and the viewer finds their place from the\n// PDF's own text positions (`locateQuote`): one box per line, in fractions of the page, so they follow any zoom.\n// `activeId` (controlled) scrolls to a passage and strengthens it; a click on a box calls `onActiveChange`. A passage\n// the text layer cannot place is never drawn at a guessed place: the viewer goes to its page when it is known and shows\n// the quote in a bar — and tells the app (`onLocate`) so its list can say \"page 3\" or \"not found\".\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { useLatest, usePrefersReducedMotion } from \"../media\";\nimport { type Located, locateQuote, type PageText } from \"./locate\";\n\nexport const documentViewer = tv({\n slots: {\n root: \"relative flex min-w-0 flex-col gap-3\",\n pages: \"flex max-h-(--kz-document-viewer-height,70vh) flex-col gap-3 overflow-auto rounded-lg border border-border-default bg-surface-2 p-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent\",\n page: \"relative mx-auto w-full max-w-(--kz-document-viewer-page,56rem) shrink-0 overflow-hidden rounded-sm bg-white shadow-sm\",\n canvas: \"block h-auto w-full\",\n caption: \"absolute top-1 left-1 rounded-sm bg-surface-1/90 px-1.5 py-0.5 text-xs text-fg-secondary\",\n box: \"absolute cursor-pointer rounded-xs border border-warning/70 bg-warning/25 mix-blend-multiply transition-colors data-[active=true]:border-2 data-[active=true]:border-danger data-[active=true]:bg-danger/25 motion-reduce:transition-none\",\n bar: \"rounded-lg border border-border-default bg-surface-1 px-3 py-2 text-sm text-fg-secondary\",\n status: \"p-6 text-center text-sm text-fg-secondary\",\n },\n});\n\n/** The words of the viewer, passed translated. `{page}` and `{total}` are replaced. */\nexport type DocumentViewerLabels = {\n /** The accessible name of the pages' region. */\n region: string;\n loading: string;\n failed: string;\n /** A page's caption and accessible name: \"Page {page} of {total}\". */\n page: string;\n /** The bar above the pages when the active passage could only be placed on a page: \"Passage on page {page}:\". */\n onPage: string;\n /** The bar when the active passage is not in the text layer. */\n notFound: string;\n};\n\nexport const documentViewerLabels: DocumentViewerLabels = {\n region: \"Document pages\",\n loading: \"Loading the document…\",\n failed: \"The document could not be displayed.\",\n page: \"Page {page} of {total}\",\n onPage: \"Passage on page {page}:\",\n notFound: \"This passage is not in the document's text layer:\",\n};\n\n/** A passage to light: its quote (as the text layer reads it), the page if the app knows it, a name for screen readers. */\nexport type DocumentHighlight = { id: string; quote: string; page?: number; label?: string };\n\n/** What the viewer found for a passage. */\nexport type { Located };\n\n/** The members of pdf.js the viewer uses (`pdfjs-dist` ≥ 5), typed here so the package does not depend on it. */\nexport type PdfjsModule = {\n GlobalWorkerOptions: { workerSrc: string };\n getDocument(source: { url?: string; data?: Uint8Array }): { promise: Promise<PdfDocument>; destroy?: () => Promise<void> | void };\n};\nexport type PdfDocument = { numPages: number; getPage(n: number): Promise<PdfPage>; destroy?: () => Promise<void> | void };\nexport type PdfPage = {\n rotate: number;\n view: number[];\n getViewport(options: { scale: number }): { width: number; height: number };\n getTextContent(): Promise<{ items: readonly unknown[] }>;\n render(options: { canvas: HTMLCanvasElement; canvasContext: CanvasRenderingContext2D; viewport: { width: number; height: number } }): { promise: Promise<void>; cancel?: () => void };\n cleanup?: () => void;\n};\n\nexport type DocumentViewerProps = Omit<React.ComponentProps<\"div\">, \"children\" | \"onChange\"> & {\n /** The PDF: an address (same origin or CORS) or its bytes. */\n src: string | Uint8Array;\n /** Loads pdf.js: `() => import(\"pdfjs-dist\")`. An optional peer, never in a bundle without a document. */\n loadPdfjs: () => Promise<PdfjsModule>;\n /** The address of pdf.js's worker (`new URL(\"pdfjs-dist/build/pdf.worker.min.mjs\", import.meta.url).toString()`). */\n workerSrc: string;\n /** The passages to light. */\n highlights?: readonly DocumentHighlight[];\n /** The passage in focus: the viewer scrolls to it. */\n activeId?: string | null;\n /** A box was clicked (the id) or the focus was released (`null`). */\n onActiveChange?: (id: string | null) => void;\n /** Where each passage was found (`null`: nowhere) — once the text layer is read, and again if `highlights` change. */\n onLocate?: (found: Record<string, Located | null>) => void;\n /** Called when the document is open, with its page count. */\n onLoad?: (info: { pages: number }) => void;\n /** The words of the viewer, translated (English by default). */\n labels?: Partial<DocumentViewerLabels>;\n};\n\nconst fill = (template: string, vars: Record<string, string | number>) => template.replace(/\\{(\\w+)\\}/g, (m, k: string) => (k in vars ? String(vars[k]) : m));\n\ntype Loaded = { doc: PdfDocument; texts: PageText[]; sizes: { width: number; height: number }[] };\ntype Phase = { state: \"loading\" } | { state: \"error\"; key: string } | ({ state: \"ready\"; key: string } & Loaded);\n\nconst isItem = (x: unknown): x is PageText[\"items\"][number] => typeof x === \"object\" && x !== null && typeof (x as { str?: unknown }).str === \"string\" && Array.isArray((x as { transform?: unknown }).transform);\n\nfunction PageCanvas({ page, doc, caption, onReady, className }: { page: number; doc: PdfDocument; caption: string; onReady?: () => void; className: string }) {\n const ref = React.useRef<HTMLCanvasElement>(null);\n const wrapper = React.useRef<HTMLDivElement>(null);\n const [visible, setVisible] = React.useState(() => typeof IntersectionObserver === \"undefined\");\n const ready = useLatest(onReady);\n React.useEffect(() => {\n const node = wrapper.current?.parentElement;\n if (!node) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n const observer = new IntersectionObserver((entries) => entries.some((e) => e.isIntersecting) && setVisible(true), { rootMargin: \"600px 0px\" });\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n React.useEffect(() => {\n if (!visible) return;\n let task: { promise: Promise<void>; cancel?: () => void } | undefined;\n let cancelled = false;\n void (async () => {\n const p = await doc.getPage(page);\n const canvas = ref.current;\n const ctx = canvas?.getContext(\"2d\");\n if (cancelled || !canvas || !ctx) return;\n const base = p.getViewport({ scale: 1 });\n const dpr = typeof window === \"undefined\" ? 1 : Math.min(2, window.devicePixelRatio || 1);\n const scale = Math.min(2.5, Math.max(1, (canvas.parentElement?.clientWidth || base.width) / base.width)) * dpr;\n const viewport = p.getViewport({ scale });\n canvas.width = Math.floor(viewport.width);\n canvas.height = Math.floor(viewport.height);\n task = p.render({ canvas, canvasContext: ctx, viewport });\n await task.promise.catch(() => undefined);\n if (!cancelled) ready.current?.();\n })().catch(() => undefined);\n return () => {\n cancelled = true;\n task?.cancel?.();\n };\n }, [visible, doc, page, ready]);\n return (\n <div ref={wrapper} className=\"contents\">\n <canvas ref={ref} aria-hidden=\"true\" className={className} />\n <span className=\"sr-only\">{caption}</span>\n </div>\n );\n}\n\n/** A PDF with its passages lit — see the file's header. Client. */\nexport function DocumentViewer({ src, loadPdfjs, workerSrc, highlights = [], activeId = null, onActiveChange, onLocate, onLoad, labels, className, ...props }: DocumentViewerProps) {\n const words = { ...documentViewerLabels, ...labels };\n const s = documentViewer();\n const reduce = usePrefersReducedMotion();\n const [loaded, setPhase] = React.useState<Phase>({ state: \"loading\" });\n const callbacks = useLatest({ onLoad, onLocate });\n const containerRef = React.useRef<HTMLDivElement>(null);\n const bytes = typeof src === \"string\" ? src : src.byteLength + \":\" + src[0] + \":\" + src[src.length - 1];\n // A result belongs to the document it was read from: another `src` is loading again, with no reset inside the effect.\n const phase: Phase = loaded.state !== \"loading\" && loaded.key !== bytes ? { state: \"loading\" } : loaded;\n\n // Open the document and read every page's text layer (positions only; nothing is sent anywhere).\n React.useEffect(() => {\n let cancelled = false;\n let opened: { destroy?: () => Promise<void> | void } | undefined;\n void (async () => {\n const pdfjs = await loadPdfjs();\n pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;\n const loading = pdfjs.getDocument(typeof src === \"string\" ? { url: src } : { data: src.slice() });\n opened = loading;\n const doc = await loading.promise;\n const texts: PageText[] = [];\n const sizes: Loaded[\"sizes\"] = [];\n for (let n = 1; n <= doc.numPages; n++) {\n const page = await doc.getPage(n);\n const vp = page.getViewport({ scale: 1 });\n sizes.push({ width: vp.width, height: vp.height });\n const content = await page.getTextContent();\n // A rotated page has no reliable boxes: it keeps its size and an empty text layer (the app's page hint still works).\n texts.push({ page: n, width: vp.width, height: vp.height, items: page.rotate % 360 === 0 ? content.items.filter(isItem) : [] });\n page.cleanup?.();\n }\n if (cancelled) return;\n setPhase({ state: \"ready\", key: bytes, doc, texts, sizes });\n callbacks.current.onLoad?.({ pages: doc.numPages });\n })().catch(() => !cancelled && setPhase({ state: \"error\", key: bytes }));\n return () => {\n cancelled = true;\n void opened?.destroy?.();\n };\n // `src` is compared by content (`bytes`) so a re-render with the same bytes does not reopen the file.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [bytes, loadPdfjs, workerSrc, callbacks]);\n\n const key = highlights.map((h) => `${h.id}\\u0000${h.page ?? \"\"}\\u0000${h.quote}`).join(\"\\u0001\");\n const found = React.useMemo(() => {\n const out: Record<string, Located | null> = {};\n if (phase.state === \"ready\") for (const h of highlights) out[h.id] = locateQuote(phase.texts, h.quote, h.page);\n return out;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [phase, key]);\n React.useEffect(() => {\n if (phase.state === \"ready\") callbacks.current.onLocate?.(found);\n }, [found, phase.state, callbacks]);\n\n // Go to the active passage.\n const active = activeId ? highlights.find((h) => h.id === activeId) : undefined;\n const where = activeId ? found[activeId] : undefined;\n React.useEffect(() => {\n if (phase.state !== \"ready\" || !where) return;\n const root = containerRef.current;\n const target = root?.querySelector<HTMLElement>(where.boxes.length > 0 ? `[data-highlight=\"${CSS.escape(activeId!)}\"]` : `[data-page=\"${where.page}\"]`) ?? null;\n target?.scrollIntoView?.({ block: where.boxes.length > 0 ? \"center\" : \"start\", behavior: reduce ? \"auto\" : \"smooth\" });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeId, where, phase.state]);\n\n return (\n <div className={s.root({ className })} {...props}>\n {active && where !== undefined && where?.match !== \"exact\" && where?.match !== \"start\" ? (\n <p className={s.bar()} data-testid=\"document-viewer-bar\">\n {where?.match === \"page\" ? fill(words.onPage, { page: where.page }) : words.notFound} <q>{active.quote}</q>\n </p>\n ) : null}\n <div ref={containerRef} className={s.pages()} role=\"region\" aria-label={words.region} tabIndex={0}>\n {phase.state === \"loading\" ? <p className={s.status()}>{words.loading}</p> : null}\n {phase.state === \"error\" ? <p role=\"alert\" className={s.status()}>{words.failed}</p> : null}\n {phase.state === \"ready\"\n ? phase.texts.map((t, i) => {\n const size = phase.sizes[i]!;\n const caption = fill(words.page, { page: t.page, total: phase.doc.numPages });\n return (\n <div key={t.page} className={s.page()} data-page={t.page} style={{ aspectRatio: `${size.width} / ${size.height}` }}>\n <PageCanvas page={t.page} doc={phase.doc} caption={caption} className={s.canvas()} />\n <span className={s.caption()} aria-hidden=\"true\">{caption}</span>\n {highlights.flatMap((h) => {\n const f = found[h.id];\n if (!f || f.page !== t.page) return [];\n return f.boxes.map((b, k) => (\n <div\n key={`${h.id}:${k}`}\n aria-hidden=\"true\"\n data-highlight={h.id}\n data-active={h.id === activeId}\n className={s.box()}\n style={{ left: `${b.x * 100}%`, top: `${b.y * 100}%`, width: `${b.width * 100}%`, height: `${b.height * 100}%` }}\n onClick={() => onActiveChange?.(h.id === activeId ? null : h.id)}\n />\n ));\n })}\n </div>\n );\n })\n : null}\n </div>\n </div>\n );\n}\n","// Pure: where a quoted passage sits on the pages of a PDF, from pdf.js's text positions. No DOM, no pdf.js import —\n// the viewer feeds it what `page.getTextContent()` returned, a test feeds it a fixture.\n\n/** A text item as pdf.js returns it (`TextItem`): the string, its matrix (`[a, b, c, d, x, baseline]`) and its size. */\nexport type TextItem = { str: string; transform: number[]; width: number; height: number };\n\n/** A rectangle in fractions of the page (0–1), origin top-left — independent of the zoom the page is drawn at. */\nexport type Box = { x: number; y: number; width: number; height: number };\n\n/** The text layer of one page: its size in PDF units (rotation 0) and its items in reading order. */\nexport type PageText = { page: number; width: number; height: number; items: readonly TextItem[] };\n\nexport type Located = {\n /** 1-based page where the passage starts. */\n page: number;\n /** One box per line of the passage (merged along a line); empty when only the page is known. */\n boxes: Box[];\n /** `exact`: the whole quote was found; `start`: only its opening words were (a quote cut by a different layout). */\n match: \"exact\" | \"start\" | \"page\";\n};\n\nconst FOLD: Record<string, string> = { \"’\": \"'\", \"‘\": \"'\", \"“\": '\"', \"”\": '\"', \"«\": '\"', \"»\": '\"', \"–\": \"-\", \"—\": \"-\", \" \": \" \", \" \": \" \", \"fi\": \"fi\", \"fl\": \"fl\" };\n\n/** The comparable form of a text: no whitespace, no soft hyphen, straight quotes, case and accents folded. */\nexport function fold(text: string): string {\n let out = \"\";\n for (const ch of text.normalize(\"NFKD\")) {\n if (/\\p{M}/u.test(ch) || /\\s/u.test(ch) || ch === \"\" || ch === \"\") continue;\n out += (FOLD[ch] ?? ch).toLowerCase();\n }\n return out;\n}\n\ntype Index = { text: string; at: { item: number; char: number }[] };\n\nfunction indexPage(items: readonly TextItem[]): Index {\n let text = \"\";\n const at: Index[\"at\"] = [];\n items.forEach((item, i) => {\n for (let c = 0; c < item.str.length; c++) {\n const piece = fold(item.str[c]!);\n for (let k = 0; k < piece.length; k++) {\n text += piece[k];\n at.push({ item: i, char: c });\n }\n }\n });\n return { text, at };\n}\n\nfunction boxesOf(page: PageText, index: Index, from: number, to: number): Box[] {\n const spans = new Map<number, [number, number]>();\n for (let k = from; k < to; k++) {\n const { item, char } = index.at[k]!;\n const s = spans.get(item);\n spans.set(item, s ? [Math.min(s[0], char), Math.max(s[1], char + 1)] : [char, char + 1]);\n }\n const raw: Box[] = [];\n for (const [i, [c0, c1]] of [...spans].sort((a, b) => a[0] - b[0])) {\n const item = page.items[i]!;\n const len = Math.max(1, item.str.length);\n const size = item.height || Math.abs(item.transform[3] ?? 0) || 10;\n const x = (item.transform[4] ?? 0) + (item.width * c0) / len;\n const w = (item.width * (c1 - c0)) / len;\n const top = page.height - ((item.transform[5] ?? 0) + size * 0.9);\n raw.push({ x: x / page.width, y: top / page.height, width: w / page.width, height: (size * 1.15) / page.height });\n }\n // Merge the pieces that sit on one line and touch (several items of one sentence) into one rectangle.\n const merged: Box[] = [];\n for (const b of raw) {\n const last = merged[merged.length - 1];\n const sameLine = last && Math.abs(last.y - b.y) < last.height * 0.5 && b.x - (last.x + last.width) < last.height * 1.5 && b.x >= last.x - 1e-9;\n if (last && sameLine) {\n const right = Math.max(last.x + last.width, b.x + b.width);\n last.y = Math.min(last.y, b.y);\n last.height = Math.max(last.height, b.height);\n last.width = right - last.x;\n } else merged.push({ ...b });\n }\n return merged.map((b) => ({ x: clamp01(b.x), y: clamp01(b.y), width: Math.min(b.width, 1 - clamp01(b.x)), height: Math.min(b.height, 1 - clamp01(b.y)) }));\n}\n\nconst clamp01 = (n: number) => Math.min(1, Math.max(0, n));\n\n/** The shortest opening worth highlighting alone: a few words, not a stray letter. */\nconst MIN_START = 24;\n\n/**\n * Where `quote` sits in the pages: the first page (starting with `hintPage`, if any) whose text contains it, and the\n * boxes of its lines. A quote that a different layout cut (a column break, a hyphen) is looked for by its opening\n * words (`match: \"start\"`); one that is nowhere gives `null`, or the hinted page alone (`match: \"page\"`). Never a guess:\n * a rotated page has no boxes, only its page.\n */\nexport function locateQuote(pages: readonly PageText[], quote: string, hintPage?: number): Located | null {\n const needle = fold(quote);\n const ordered = hintPage ? [...pages].sort((a, b) => Number(b.page === hintPage) - Number(a.page === hintPage)) : pages;\n if (needle.length > 0) {\n for (const mode of [\"exact\", \"start\"] as const) {\n const wanted = mode === \"exact\" ? needle : needle.slice(0, Math.max(MIN_START, Math.min(40, Math.floor(needle.length * 0.6))));\n if (mode === \"start\" && (needle.length <= wanted.length || wanted.length < MIN_START)) break;\n for (const page of ordered) {\n const index = indexPage(page.items);\n const found = index.text.indexOf(wanted);\n if (found < 0) continue;\n return { page: page.page, boxes: boxesOf(page, index, found, found + wanted.length), match: mode };\n }\n }\n }\n return hintPage && pages.some((p) => p.page === hintPage) ? { page: hintPage, boxes: [], match: \"page\" } : null;\n}\n"],"mappings":";;;;;;;AAOA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACanB,IAAM,OAA+B,EAAE,UAAK,KAAK,UAAK,KAAK,UAAK,KAAK,UAAK,KAA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A,cAAC;AAAA;AAAA,gBAEC,eAAY;AAAA,gBACZ,kBAAgB,EAAE;AAAA,gBAClB,eAAa,EAAE,OAAO;AAAA,gBACtB,WAAW,EAAE,IAAI;AAAA,gBACjB,OAAO,EAAE,MAAM,GAAG,EAAE,IAAI,GAAG,KAAK,KAAK,GAAG,EAAE,IAAI,GAAG,KAAK,OAAO,GAAG,EAAE,QAAQ,GAAG,KAAK,QAAQ,GAAG,EAAE,SAAS,GAAG,IAAI;AAAA,gBAC/G,SAAS,MAAM,iBAAiB,EAAE,OAAO,WAAW,OAAO,EAAE,EAAE;AAAA;AAAA,cAN1D,GAAG,EAAE,EAAE,IAAI,CAAC;AAAA,YAOnB,CACD;AAAA,UACH,CAAC;AAAA,aAjBO,EAAE,IAkBZ;AAAA,MAEJ,CAAC,IACD;AAAA,OACN;AAAA,KACF;AAEJ;","names":[]}
|
package/dist/nav-bar.js
CHANGED
package/dist/site-footer.js
CHANGED
package/dist/sites.js
CHANGED
|
@@ -6,7 +6,7 @@ var sites = [
|
|
|
6
6
|
site({ id: "orochia", name: "Orochia", url: "https://dev.orochia.com", kind: "product", group: "products", status: "released", mark: "orochia", repo: "https://github.com/krizaka/orochia" }),
|
|
7
7
|
site({ id: "yasakia", name: "Yasakia", url: "https://dev.yasakia.com", kind: "product", group: "products", status: "upcoming", mark: "yasakia", repo: "https://github.com/krizaka/yasakia" }),
|
|
8
8
|
site({ id: "yororis", name: "Yororis", url: "https://dev.yororis.com", kind: "product", group: "products", status: "construction", mark: "yororis", repo: "https://github.com/krizaka/yororis" }),
|
|
9
|
-
site({ id: "yomizaka", name: "Yomizaka", url: "https://dev.yomizaka.com", kind: "product", group: "products", status: "
|
|
9
|
+
site({ id: "yomizaka", name: "Yomizaka", url: "https://dev.yomizaka.com", kind: "product", group: "products", status: "development", mark: "yomizaka", repo: "https://github.com/krizaka/yomizaka" }),
|
|
10
10
|
// In development: nothing deployed yet, so the address is the repository (never a dead link to an unborn dev site).
|
|
11
11
|
site({ id: "kachizaka", name: "Kachizaka", url: "https://github.com/krizaka/kachizaka", kind: "product", group: "products", status: "development", mark: "kachizaka", repo: "https://github.com/krizaka/kachizaka" }),
|
|
12
12
|
site({ id: "akinaza", name: "Akinaza", url: "https://github.com/krizaka/akinaza", kind: "product", group: "products", status: "development", mark: "akinaza", repo: "https://github.com/krizaka/akinaza" }),
|