diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 963ebb4..627bb38 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,19 +1,7 @@ -# Keeps the pinned action SHAs and the npm dependencies current, one pull request a week each. +# Keeps the pinned action SHAs current, one pull request a week. version: 2 updates: - package-ecosystem: github-actions directory: / schedule: interval: weekly - - package-ecosystem: npm - directory: / - schedule: - interval: weekly - groups: - dev: - dependency-type: development - # New versions wait three days, but ours are taken as they are released: they are what this - # origin serves. pnpm-workspace.yaml leaves them out of pnpm's age check to match (#19). - cooldown: - default-days: 3 - exclude: ["@missing-elements/*"] diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9eddc79..336d9dd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,7 @@ name: Deploy -# Tests and builds every push and pull request to main; a push to main is then deployed to -# GitHub Pages. Pages has to be set to deploy from GitHub Actions (Settings → Pages → Source). +# Deploys site/, the retired notice, to GitHub Pages on a push to main; a pull request is only +# checked out. Pages has to be set to deploy from GitHub Actions (Settings → Pages → Source). # Actions are pinned to a commit, with the tag in a comment for Dependabot to follow. on: @@ -21,29 +21,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 - - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 - with: - node-version: 24 - cache: pnpm - - run: pnpm install --frozen-lockfile - - run: pnpm build - # The built page in a real browser: the player plays a sample and reports its height, and - # nothing trips the Content-Security-Policy the build wrote. - - run: pnpm exec playwright install --with-deps chromium - - run: pnpm e2e - - if: failure() - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - with: - name: playwright-traces - path: test-results - if-no-files-found: ignore - if: github.event_name != 'pull_request' uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 - if: github.event_name != 'pull_request' uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: - path: dist + path: site deploy: if: github.event_name != 'pull_request' diff --git a/.gitignore b/.gitignore index 2f2d6e5..e43b0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1 @@ -node_modules/ -dist/ -*.local .DS_Store - -# Playwright -test-results/ -playwright-report/ diff --git a/README.md b/README.md index 986d21a..97c2d0b 100644 --- a/README.md +++ b/README.md @@ -1,128 +1,14 @@ # embed-my.github.io -The player origin of Embed My: what a snippet points at. The site people use to make a snippet is -[embed-my.org](https://embed-my.org/), in [embed-my/website](https://github.com/embed-my/website). - -| Path | What it serves | -|---|---| -| `/h5p?src=` | The player page the snippet frames: the player alone, driven by the query string. Upward it speaks the resizer protocol, and posts one `report` on what it learnt about the package, or the `error` that stopped it | -| `/h5p-resizer.js` | The sizing script the snippet's second line names | -| `/build` | A redirect to the build page, which moved to [missing-elements.github.io/h5p/build/](https://missing-elements.github.io/h5p/build/) (#17), keeping the link's `#source=` (see *The build page moved*) | -| `/bundles/` | For a chat that runs Node and fetches files but reaches no npm registry: the build tool as one file, a bundle of libraries per content type, every library part on its own, their licences and an `index.json`. Kept until the next pack release (see *The bundles*) | -| `/samples/*.h5p` | The three demo packages the site offers (CC0 and CC BY), and `quiz-without-libraries.h5p`, the quiz as H5P.com would export it, which the browser tests play | - -It has no custom domain, on purpose. A GitHub Pages address has nothing to renew and nothing anyone -else can register, so a pasted snippet does not depend on a domain staying registered. It is also an origin apart from the site's: a package's scripts run here and not -where the snippet is written. GitHub's redirect from a Pages address to a custom domain carries no -CORS header, so a custom domain here would stop frames fetching the samples; keep `CNAME` out of `public/`. - -## Develop - -Needs Node 22.12 or later and pnpm (its version is pinned in `package.json`). - -```bash -pnpm install -pnpm dev # dev server, http://localhost:5173/h5p?src=http://localhost:5173/samples/quiz.h5p -pnpm typecheck # TypeScript, no output -pnpm build # type-check, then build into dist/ -pnpm preview # serve dist/, http://localhost:4173 -pnpm e2e # browser tests against dist/ (build first; once per machine: pnpm exec playwright install chromium) -``` - -The page is [`@missing-elements/h5p-embed`](https://github.com/missing-elements/h5p-offline-player/tree/main/packages/embed#readme)'s -embed page (MIT): `src/h5p-page.ts` calls its `startEmbed()` with this origin's options, and the package does the -rest: the query string, the resizer protocol, the `report` and `error` messages the website reads, and the xAPI -relay. The sizing script is the package's `resizer.js`, copied to `/h5p-resizer.js` at build. The player is -`@missing-elements/h5p-offline-player` (MIT). The H5P runtime it loads inside the frame is -`@missing-elements/h5p-runtime` (GPL-3.0): `src/h5p-page.ts` hands its `runtime` export to `startEmbed()`. Both name their files relative to their own modules, and -Vite emits them into `dist/assets/` with everything else; the runtime's licence and notice are emitted beside -them as `assets/runtime-LICENSE.txt` and `assets/runtime-NOTICE.txt`. - -In a snippet, the frame sits in another site's page, whose storage is that site's own, and a package plays as it is. -Opened on its own, `/h5p` would put a package from another site in this origin's own storage, so since h5p-embed 0.4 -and player 0.7 it plays it `untrusted`: as data, with none of the package's own code and its libraries from the pack. -Since player 0.8 and h5p-runtime 0.2 its content is also checked against each library's `semantics.json` before it -is shown, as the H5P CMS plugins check an upload: text keeps only the tags its field allows, and anything the -semantics do not name is dropped. Only a package that cannot play without its own copy of a library waits for a -click that names its host. - -A package exported without its libraries, as H5P.com and h5p.org export them, gets them from the pack of -`@missing-elements/h5p-libraries`: the H5P hub's libraries for every content type it serves, one part per library, -which Vite emits as hashed assets and the page uses by default (`pack`, `defaultLibraries: 'pack'`). A package -downloads only the parts it needs, each checked against the pack's SHA-256 and kept in the browser for every package -that uses it. Nothing is behind the pack: since player 0.6 there is no H5P hub -fallback, so a content type the pack lacks is reported as missing libraries, and the page makes no request to a third -party by itself. The frame upgrades content written for an older minor version of a library to the one the pack -serves, with that library's `upgrades.js`, so a package that carries older libraries plays the pack's newer ones -(player 0.10; `&refresh-libraries=off` plays them as exported), and the `report` names them in -`libraryBundle.refreshed`. Content made for a newer minor version than the pack has plays at the pack's newest older -one, listed in the report's `downgradedLibraries` (player 1.2; `&downgrade-libraries=off` refuses it instead). - -H5P's own buttons and dialogs, such as Fullscreen and Rights of use, are in the package's own language, -`defaultLanguage` (or `language`) in its `h5p.json`, so they match the content's text (player 1.1.0). The frame document -takes the same language, for screen readers. `&lang=` on the address, `de` or `pt-BR`, is the language for a -package that names none. The translations come from the runtime (runtime 0.1.2): more than fifty languages, from -Moodle's language packs, in a script Vite emits as `assets/l10n-*.js` that the frame fetches only for a language other -than English. The pack's licence list is emitted as -`assets/libraries-LICENSES.txt`. -`&libraries=` in the query string overrides the sources; `&libraries=none` turns them off. - -| Path | What it holds | -|---|---| -| `h5p.html`, `src/h5p-page.ts` | The player page: `@missing-elements/h5p-embed`'s embed page, started with this origin's options | -| `build.html` | `/build`, the redirect to the build page's new address, which keeps the link's fragment when JavaScript runs | -| `public/samples/` | The sample packages, copied into the build as they are | -| `e2e/`, `playwright.config.ts` | The browser tests: the page plays a sample, with and without its libraries, a framing page gets its height and the report, a bad link gets the error; `/build` sends a visit on to the build page's new address, with its fragment when JavaScript runs, and without it when it does not; `/bundles/` lists and serves every bundle and part, and its tool and a bundle build a quiz in an empty folder, a part named by the build fetched for math | -| `vite.config.ts` | The page, its Content-Security-Policy, `h5p-resizer.js` and the licence files, copied from their packages, and `/bundles/`, written from them | - -The page gets a `Content-Security-Policy` in a `` tag at build: GitHub Pages sends no headers, so the tag is -the only policy there is. The dev server gets none, because it injects scripts and styles of its own. The browser -tests fail on any violation. - -## The build page moved - -`/build` was the build page: a source an AI chat wrote with the -[h5p-author skill](https://github.com/missing-elements/h5p-offline-player/tree/main/skills/h5p-author) -became a `.h5p` file there, built in the browser, played and downloaded. It moved on 2026-11-10 to -[missing-elements.github.io/h5p/build/](https://missing-elements.github.io/h5p/build/), the -Missing Elements site, in that site's own look (#17); its code and tests are there now. `/build` -here sends a visit on to it with the address's fragment, so a link a chat wrote before, -`/build#source=`, still builds its source. Without JavaScript the page refreshes to the -new address, which can't carry the fragment, and links to it. - -## The bundles - -`/bundles/` is for a chat that runs Node and can fetch a file but reaches no npm registry, as -ChatGPT's sandbox can: its download tool takes a file the browsing tool has opened. There the -h5p-author skill fetches two files, the build tool and the bundle of the source's content type, -unzips the bundle and builds with `node h5p-author.mjs build source.json course.h5p --libraries -parts`. The chat then sees every problem itself, fixes its source and hands over the package; the -build page stays for a chat that can fetch nothing. - -| Path | What it holds | -|---|---| -| `/bundles/.zip` | One per content type in the pack, `H5P.QuestionSet.zip`: `parts/`, the pack's whole index with the parts a build of that type can read, and `libraries.txt`. Written by `h5p-author bundle --all` | -| `/bundles/parts/.h5p` | Every part of the pack under its own name, and `parts/index.json`. No bundle holds an addon: a source whose text calls for one, H5P.MathDisplay for math, stops the build, which names the part to fetch from here | -| `/bundles/h5p-author.mjs` | The author package's command line as one file, everything it imports bundled in by Vite, so it runs with nothing installed. It needs `--libraries`, and has no `--version`: the npm package's own files are not with it | -| `/bundles/index.json` | The author package's and the pack's versions, and each bundle's file, size and number of parts | -| `/bundles/libraries.txt` | The pack's licence list, which asks to travel with its libraries | - -`vite.config.ts` writes them after the pages, from the packages the lockfile pins, so a -Dependabot update of `@missing-elements/h5p-author` or `@missing-elements/h5p-libraries` moves -them, and they live in `dist/` only, not in git: 113 MB with pack 1.1.0, well within GitHub Pages' -1 GB. A question type's bundle is about 1 MB, a Question Set's 2.6 MB, a container's up to 8.4 MB. - -They moved with the build page: missing-elements.github.io serves the same files at -[`/h5p/bundles/`](https://missing-elements.github.io/h5p/bundles/index.json), and the skill fetches -them from there. They stay here only for copies of the skill installed before the move, until the -next pack release; then `bundles()` goes, with `e2e/bundles.spec.ts` and the -`@missing-elements/h5p-author` dependency. - -## Deploy - -A push to `main` runs `.github/workflows/deploy.yml`: build, browser tests, then `dist/` goes to GitHub Pages. -Pages has to use **GitHub Actions** as its source (Settings → Pages → Build and deployment) and must have **no -custom domain** set. Actions are pinned to commits; Dependabot keeps the pins and the packages current. - -Deploy this origin before the website when both change: the site's preview frames `/h5p` here, and its policy -allows only this origin as a frame. +Retired. This was the player origin of Embed My's snippets: the `/h5p` page each snippet framed, +`/h5p-resizer.js`, the sample packages and, for older copies of the h5p-author skill, `/bundles/`. +Embed My is now a hub for apps at [embed-my.org](https://embed-my.org/), in +[embed-my/website](https://github.com/embed-my/website). + +What is left: `/h5p`, which a snippet still on a page frames, says that the player has retired; `/` +goes on to embed-my.org. The other old addresses are a 404. + +The build page and the skill's bundles moved to Missing Elements' site: an old `/build#source=…` +link works at [missing-elements.github.io/h5p/build/](https://missing-elements.github.io/h5p/build/) +with the same `#source=`, and the bundles are under +[missing-elements.github.io/h5p/bundles/](https://missing-elements.github.io/h5p/bundles/). diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 9e33760..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,27 +0,0 @@ -# Security - -This repository is the player origin of Embed My, `embed-my.github.io`: static files on GitHub Pages, no -server and no data of its own. An H5P package plays in the visitor's browser, on this origin, apart from the -site that embeds it and from embed-my.org. What can go wrong is therefore in one of three places. - -- **The player** (how a package is read and run, the worker, the frame it builds): report it under the - [h5p-offline-player security policy](https://github.com/missing-elements/h5p-offline-player/blob/main/SECURITY.md). -- **This origin** (the `/h5p` page, `h5p-resizer.js`, the samples, the pages' Content-Security-Policy): - report it privately through - [GitHub's security advisory form](https://github.com/embed-my/embed-my.github.io/security/advisories/new) - for this repository, not as a public issue. -- **The website** (embed-my.org, the snippet it writes, the preview, the guides): the same form in - [embed-my/website](https://github.com/embed-my/website/security/advisories/new). - -Please include the address you used, the browser, and what you expected to happen. There is no bounty; there -is a thank-you in the release notes if you want one. - -## What is by design - -- The `/h5p` page runs any package a link names, as any H5P site runs the packages uploaded to it. It runs on - this origin, with storage partitioned per embedding site. What a hostile package can do there is described - in the [privacy and security guide](https://embed-my.org/docs/privacy-and-security). -- The page carries its policy in a `` tag, written at build, because GitHub Pages sends no security - headers. A `` policy cannot set `frame-ancestors`; `/h5p` is meant to be framed by anyone. -- This origin has no custom domain, so a snippet does not depend on a domain staying registered, and a - package never runs on the website's origin. diff --git a/build.html b/build.html deleted file mode 100644 index e07932b..0000000 --- a/build.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - The build page has moved · Embed My - - - - - - - -

- The build page has moved to - missing-elements.github.io/h5p/build. -

- - diff --git a/e2e/build-redirect.spec.ts b/e2e/build-redirect.spec.ts deleted file mode 100644 index ed7fa42..0000000 --- a/e2e/build-redirect.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { expect, test, type Page } from '@playwright/test' - -/* - * /build was the build page until it moved to missing-elements.github.io/h5p/build/ (#17). A visit - * goes on there with its fragment, so a link a chat wrote before, `#source=` and all, still builds. - * The other site is answered here by a stand-in: the tests check where the browser goes. - */ - -const TARGET = 'https://missing-elements.github.io/h5p/build/' - -/** Answers the other site with a stand-in page, and collects page errors and policy violations. */ -async function watch(page: Page): Promise { - const problems: string[] = [] - page.on('console', (message) => { - if (message.type() === 'error' || /Content.Security.Policy/i.test(message.text())) problems.push(message.text()) - }) - page.on('pageerror', (error) => problems.push(error.message)) - await page.route(/^https:\/\/missing-elements\.github\.io\//, (route) => route.fulfill({ contentType: 'text/html', body: 'Stand-in' })) - return problems -} - -test('sends /build on to the build page, keeping the #source= fragment', async ({ page }) => { - const problems = await watch(page) - const source = Buffer.from(JSON.stringify({ type: 'H5P.Blanks', title: 'Rivers' })).toString('base64url') - await page.goto(`/build#source=${source}`) - await page.waitForURL(`${TARGET}#source=${source}`) - - // A link with a query, as ChatGPT adds one, keeps its fragment too. - await page.goto(`/build?utm_source=chatgpt.com#source=${source}`) - await page.waitForURL(`${TARGET}#source=${source}`) - - await page.goto('/build') - await page.waitForURL(TARGET) - expect(problems, problems.join('\n')).toEqual([]) -}) - -test.describe('without JavaScript', () => { - test.use({ javaScriptEnabled: false }) - - test('still sends /build on to the build page, though without the fragment', async ({ page }) => { - const problems = await watch(page) - await page.goto('/build#source=e30') - await page.waitForURL(TARGET) - expect(problems, problems.join('\n')).toEqual([]) - }) -}) diff --git a/e2e/bundles.spec.ts b/e2e/bundles.spec.ts deleted file mode 100644 index 3f49701..0000000 --- a/e2e/bundles.spec.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { execFile } from 'node:child_process' -import { mkdtemp, rm, writeFile } from 'node:fs/promises' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { promisify } from 'node:util' -import { expect, test, type APIRequestContext } from '@playwright/test' - -/* - * /bundles/ as a chat's sandbox uses it (#14), following the h5p-author skill's steps: the command - * line and one content type's bundle fetched into an empty folder outside this project, so nothing - * installed here is found, unzipped and built with Node alone; and an addon the text calls for, - * fetched as its own part once the build has named it. - */ - -const exec = promisify(execFile) - -type Listing = { - author: string, pack: string, tool: string, parts: string, licences: string, - bundles: Array<{ type: string, version: string, file: string, size: number, parts: number }> -} - -const META = { language: 'en', license: 'CC BY', authors: [{ name: 'Ann Author', role: 'Author' }] } - -/** A file of the site saved into the folder, as a chat's download tool saves it. */ -async function fetchTo(request: APIRequestContext, path: string, file: string): Promise { - const response = await request.get(path) - expect(response.ok(), path).toBe(true) - await writeFile(file, await response.body()) -} - -/** The command line run in the folder, with the Node running the tests. */ -const tool = (cwd: string, ...args: string[]) => exec(process.execPath, ['h5p-author.mjs', ...args], { cwd }) - -test('lists a bundle per content type, and serves each, every part on its own, the tool and the licences', async ({ request }) => { - const listing = await (await request.get('/bundles/index.json')).json() as Listing - expect(listing).toMatchObject({ author: expect.stringMatching(/^\d+\.\d+\.\d+$/), pack: expect.stringMatching(/^\d+\.\d+\.\d+$/), tool: 'h5p-author.mjs' }) - expect(listing.bundles.length).toBeGreaterThan(40) - expect(listing.bundles.map(({ type }) => type)).toEqual(expect.arrayContaining(['H5P.QuestionSet', 'H5P.Blanks', 'H5P.CoursePresentation'])) - for (const { file, size } of listing.bundles) { - const response = await request.head(`/bundles/${file}`) - expect(response.ok(), file).toBe(true) - expect(Number(response.headers()['content-length']), file).toBe(size) - } - - const index = await (await request.get(`/bundles/${listing.parts}index.json`)).json() as { libraries: Array<{ folder: string }> } - expect(index.libraries.length).toBeGreaterThan(100) - for (const { folder } of index.libraries) expect((await request.head(`/bundles/${listing.parts}${folder}.h5p`)).ok(), folder).toBe(true) - expect(await (await request.get(`/bundles/${listing.licences}`)).text()).toContain('H5P.QuestionSet-') - expect(await (await request.get(`/bundles/${listing.tool}`)).text()).toMatch(/^#!\/usr\/bin\/env node\n/) -}) - -test('builds a quiz in an empty folder from the tool and its bundle, and takes an addon as its own part', async ({ request }) => { - const dir = await mkdtemp(join(tmpdir(), 'embed-my-bundles-')) - try { - await fetchTo(request, '/bundles/h5p-author.mjs', join(dir, 'h5p-author.mjs')) - await fetchTo(request, '/bundles/H5P.QuestionSet.zip', join(dir, 'H5P.QuestionSet.zip')) - await exec('unzip', ['-q', 'H5P.QuestionSet.zip'], { cwd: dir }) - - const quiz = { - ...META, - type: 'H5P.QuestionSet', - title: 'Rivers', - params: { - questions: [ - { library: 'H5P.MultiChoice', params: { question: 'Which river is the longest in Europe?', answers: [{ text: 'Volga', correct: true }, { text: 'Danube', correct: false }] } }, - { library: 'H5P.TrueFalse', params: { question: 'The Rhine flows into the North Sea.', correct: 'true' } } - ] - } - } - await writeFile(join(dir, 'quiz.json'), JSON.stringify(quiz)) - const { stdout } = await tool(dir, 'build', 'quiz.json', 'quiz.h5p', '--libraries', 'parts') - expect(stdout).toContain('Built ') - const manifest = JSON.parse((await exec('unzip', ['-p', 'quiz.h5p', 'h5p.json'], { cwd: dir })).stdout) as { mainLibrary: string } - expect(manifest.mainLibrary).toBe('H5P.QuestionSet') - - // Math in the text calls for H5P.MathDisplay, which no bundle holds: the build names its part. - const squares = { ...quiz, title: 'Squares', params: { questions: [{ library: 'H5P.Blanks', params: { questions: ['The square of 3, $$3^2$$, is *9*.'] } }] } } - await writeFile(join(dir, 'squares.json'), JSON.stringify(squares)) - const failed = await tool(dir, 'build', 'squares.json', 'squares.h5p', '--libraries', 'parts').then(() => null, (error: { code?: number, stderr?: string }) => error) - expect(failed?.code).toBe(1) - const part = /has no (\S+\.h5p)/.exec(failed?.stderr ?? '')?.[1] - expect(part, failed?.stderr).toMatch(/^H5P\.MathDisplay-\d+\.\d+\.h5p$/) - await fetchTo(request, `/bundles/parts/${part}`, join(dir, 'parts', part!)) - expect((await tool(dir, 'build', 'squares.json', 'squares.h5p', '--libraries', 'parts')).stdout).toContain('Built ') - } finally { - await rm(dir, { recursive: true, force: true }) - } -}) diff --git a/e2e/player.spec.ts b/e2e/player.spec.ts deleted file mode 100644 index b056998..0000000 --- a/e2e/player.spec.ts +++ /dev/null @@ -1,179 +0,0 @@ -import { expect, test, type Page } from '@playwright/test' - -/* - * The player page in a real browser against the built files: it plays a package and speaks the - * resizer protocol upward. The package is one of the origin's own samples, so nothing here leaves - * the machine. Any Content-Security-Policy violation fails the test, because the policy is - * written at build and only a browser checks it. - */ - -const SAMPLE = '/samples/quiz.h5p' - -/** Fails the test on any CSP report or uncaught error the page logs. */ -function watchConsole(page: Page): string[] { - const problems: string[] = [] - page.on('console', (message) => { - const text = message.text() - if (message.type() === 'error' || /Content.Security.Policy/i.test(text)) problems.push(text) - }) - page.on('pageerror', (error) => problems.push(error.message)) - return problems -} - -/** - * Collects every request that leaves the origin under test, and any for the whole library pack, - * which this origin no longer serves. The pack's parts come from here and from nowhere else, so a - * library source of whatever name, jsDelivr's copy of the pack, another CDN or the H5P hub, shows - * up as a request to another origin: no list of hosts to keep. The listener is on the context, not - * the page, so that it also hears the Service Worker's own requests, which a page does not. - */ -function watchLeaving(page: Page, baseURL: string | undefined): string[] { - if (!baseURL) throw new Error('playwright.config.ts sets no baseURL') - const own = new URL(baseURL).origin - const leaving: string[] = [] - page.context().on('request', (request) => { - const { protocol, origin, pathname } = new URL(request.url()) - if (protocol !== 'http:' && protocol !== 'https:') return // data: and blob: - if (origin !== own || /\/libraries-[^/]*\.h5p$/.test(pathname)) leaving.push(request.url()) - }) - return leaving -} - -test('the player page plays a package', async ({ page, baseURL }) => { - const problems = watchConsole(page) - const leaving = watchLeaving(page, baseURL) - await page.goto(`/h5p?src=${baseURL}${SAMPLE}`) - - const player = page.locator('h5p-player') - await expect(player).toHaveAttribute('src', `${baseURL}${SAMPLE}`) - await expect.poll(async () => player.evaluate((element: HTMLElement & { state?: string }) => element.state)).toBe('ready') - - // The content is up: the worker served the runtime's frame, and the loader is gone. - await expect(page.locator('#loader')).toBeHidden() - await expect(page.locator('#notice')).toBeHidden() - const frame = page.frameLocator('h5p-player iframe').first() - await expect(frame.locator('.h5p-content, .h5p-container').first()).toBeVisible() - - // A complete package costs at most the parts of the libraries it carries at older versions than - // the pack's, from this origin: never the pack whole, and nothing from anywhere else. - expect(leaving, 'nothing left this origin, and the whole pack was not asked for').toEqual([]) - expect(problems, problems.join('\n')).toEqual([]) -}) - -test('a package exported without its libraries plays from the pack served here, part by part', async ({ page, baseURL }) => { - const problems = watchConsole(page) - const parts: number[] = [] - const leaving = watchLeaving(page, baseURL) - // On the context, as in `watchLeaving`, so that a part the Service Worker fetches is counted too. - page.context().on('response', (response) => { - const url = response.url() - if (url.startsWith(`${baseURL}/assets/`) && url.endsWith('.h5p')) parts.push(response.status()) - }) - // The quiz as H5P.com would export it: `content/` and a manifest that names only the main library. - // It was written for Question Set 1.20 and the pack serves 1.21, so the frame runs the library's - // upgrade steps on it first; a failed upgrade logs a console error, which fails this test. - await page.goto(`/h5p?src=${baseURL}/samples/quiz-without-libraries.h5p`) - const player = page.locator('h5p-player') - // The pack served here, and nothing behind it: the player has no hub to fall back to. - await expect(player).toHaveAttribute('libraries', 'pack') - await expect.poll(async () => player.evaluate((element: HTMLElement & { state?: string }) => element.state), { timeout: 40_000 }).toBe('ready') - await expect(page.frameLocator('h5p-player iframe').first().locator('.h5p-content, .h5p-container').first()).toBeVisible() - // The parts the quiz needs, a handful of the pack's hundred and more, each from this origin. - expect(parts.length, 'parts were fetched from this origin').toBeGreaterThan(0) - expect(parts.length, 'only the parts the quiz needs').toBeLessThan(40) - expect(parts.filter((status) => status !== 200), 'every part answered').toEqual([]) - expect(leaving, 'nothing left this origin, and the whole pack was not asked for').toEqual([]) - expect(problems, problems.join('\n')).toEqual([]) -}) - -/** - * Serves a page that frames the player at `/framing.html` on the test server's origin and opens - * it. Served rather than `setContent`: a frame under `about:blank` gets no Service Worker, and - * the player page's policy allows no inline script. The page - * keeps every message the frame posts that is not the resizer's, in `window.reports`. - */ -async function framingPage(page: Page, baseURL: string | undefined, body: string): Promise { - await page.route('**/framing.html', (route) => - route.fulfill({ - contentType: 'text/html', - body: `${body} - ` - }) - ) - await page.goto(`${baseURL}/framing.html`) -} - -const reports = (page: Page) => page.evaluate(() => (window as unknown as { reports: Record[] }).reports) - -test('opened on its own, a package from another site plays untrusted, without a click', async ({ page, baseURL }) => { - const problems = watchConsole(page) - // 127.0.0.1 and localhost are different origins: to this page the package comes from another site. - const elsewhere = `${baseURL}${SAMPLE}`.replace('127.0.0.1', 'localhost') - await page.goto(`/h5p?src=${elsewhere}`) - const player = page.locator('h5p-player') - await expect.poll(async () => player.evaluate((element: HTMLElement & { state?: string }) => element.state)).toBe('ready') - // Played as data: none of the package's own code, its libraries from the pack served here, and - // its content shown only after the runtime's boot script has checked it against their semantics. - expect(await player.evaluate((element: HTMLElement & { untrusted?: boolean }) => element.untrusted)).toBe(true) - await expect(player).toHaveAttribute('libraries', 'pack') - await expect(page.getByRole('button', { name: 'Open with its own scripts' })).toHaveCount(0) - await expect(page.frameLocator('h5p-player iframe').first().locator('.h5p-content, .h5p-container').first()).toBeVisible() - expect(problems, problems.join('\n')).toEqual([]) -}) - -test("H5P's own buttons are in the package's language, whatever &lang= says", async ({ page, baseURL }) => { - const problems = watchConsole(page) - await page.goto(`/h5p?src=${baseURL}${SAMPLE}&frame©right&lang=de`) - const player = page.locator('h5p-player') - await expect(player).toHaveAttribute('lang', 'de') - await expect.poll(async () => player.evaluate((element: HTMLElement & { state?: string }) => element.state)).toBe('ready') - const frame = page.frameLocator('h5p-player iframe').first() - // The package names English in its h5p.json, so the toolbar's Rights of use button matches its - // text (player 1.1.0); &lang= is for a package that names no language. - await expect(frame.getByText('Rights of use')).toBeVisible() - await expect(frame.getByText('Nutzungsrechte')).toHaveCount(0) - // The frame document says the same to a screen reader. - await expect(frame.locator('html')).toHaveAttribute('lang', 'en') - expect(problems, problems.join('\n')).toEqual([]) -}) - -test('a page that frames it gets a hello, a height and a report', async ({ page, baseURL }) => { - // The snippet's two lines, on a page of the same origin as the test server. - await framingPage( - page, - baseURL, - ` - ` - ) - // The resizer script sets the frame's height from what the frame reports; the default would be the browser's 150px. - await expect.poll(async () => page.locator('#f').evaluate((element) => Number.parseInt((element as HTMLElement).style.height, 10)), { - timeout: 30_000 - }).toBeGreaterThan(200) - - // The report: what the player learnt, in the shape the website reads (website, `src/report.ts`). - await expect.poll(async () => (await reports(page)).length).toBe(1) - const [report] = await reports(page) - expect(report).toMatchObject({ - action: 'report', - source: { type: 'range-http', size: expect.any(Number) }, - metadata: { title: 'Do you know what just happened?', license: 'CC0 1.0', authors: ['missing-elements'], mainLibrary: 'H5P.QuestionSet' }, - // The quiz carries its libraries, older than the pack's, so it plays the pack's newer versions - // from this origin (player 0.10) and the report names them; the website says so under its preview. - libraryBundle: { - url: `${baseURL}/assets/`, - origin: baseURL, - fromCache: expect.any(Boolean), - refreshed: expect.arrayContaining([{ library: 'H5P.QuestionSet', from: '1.20.31', to: expect.stringMatching(/^1\.\d+\.\d+$/) }]) - }, - downgradedLibraries: [], - elapsedMs: expect.any(Number) - }) -}) - -test('a page that frames a package no browser can fetch is told so', async ({ page, baseURL }) => { - // `/nothing.h5p` is a 404 on this origin: the fetch fails before the content is up, and the frame says why. - await framingPage(page, baseURL, ``) - await expect.poll(() => reports(page), { timeout: 30_000 }).toMatchObject([ - { action: 'error', code: expect.stringMatching(/^(network|no-cors|bad-archive)$/) } - ]) -}) diff --git a/h5p.html b/h5p.html deleted file mode 100644 index 3c3d0a5..0000000 --- a/h5p.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - Embed My player - - - - - -
- - Loading… -
- - - - diff --git a/package.json b/package.json deleted file mode 100644 index 510d98e..0000000 --- a/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "embed-my-player", - "private": true, - "type": "module", - "packageManager": "pnpm@10.24.0", - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview", - "e2e": "playwright test", - "typecheck": "tsc" - }, - "engines": { - "node": ">=22.12" - }, - "devDependencies": { - "@playwright/test": "^1.65.0", - "@types/node": "^26.6.6", - "typescript": "^7.0.2", - "vite": "^8.3.6" - }, - "dependencies": { - "@missing-elements/h5p-author": "^0.6.0", - "@missing-elements/h5p-embed": "^1.7.0", - "@missing-elements/h5p-libraries": "^1.1.0", - "@missing-elements/h5p-offline-player": "^1.6.0", - "@missing-elements/h5p-runtime": "^1.0.1" - } -} diff --git a/playwright.config.ts b/playwright.config.ts deleted file mode 100644 index 6ab4db9..0000000 --- a/playwright.config.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { defineConfig } from '@playwright/test' - -/* - * The browser tests run against the built site, served the way GitHub Pages serves it: static - * files, extensionless pages. Run `pnpm build` first; `pnpm e2e` then starts the preview server. - */ -export default defineConfig({ - testDir: 'e2e', - timeout: 60_000, - expect: { timeout: 20_000 }, - retries: process.env.CI ? 1 : 0, - reporter: process.env.CI ? 'github' : 'list', - use: { - // 127.0.0.1, so the same server is also another site at localhost, for the cross-origin tests. - baseURL: 'http://127.0.0.1:4173', - browserName: 'chromium', - trace: 'retain-on-failure' - }, - webServer: { - command: 'pnpm exec vite preview --host 127.0.0.1 --port 4173 --strictPort', - url: 'http://127.0.0.1:4173/h5p-resizer.js', - reuseExistingServer: !process.env.CI - } -}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml deleted file mode 100644 index f55ae93..0000000 --- a/pnpm-lock.yaml +++ /dev/null @@ -1,795 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@missing-elements/h5p-author': - specifier: ^0.6.0 - version: 0.6.0(@missing-elements/h5p-runtime@1.0.1) - '@missing-elements/h5p-embed': - specifier: ^1.7.0 - version: 1.7.0 - '@missing-elements/h5p-libraries': - specifier: ^1.1.0 - version: 1.1.0 - '@missing-elements/h5p-offline-player': - specifier: ^1.6.0 - version: 1.6.0(@missing-elements/h5p-runtime@1.0.1) - '@missing-elements/h5p-runtime': - specifier: ^1.0.1 - version: 1.0.1 - devDependencies: - '@playwright/test': - specifier: ^1.65.0 - version: 1.65.0 - '@types/node': - specifier: ^26.6.6 - version: 26.6.6 - typescript: - specifier: ^7.0.2 - version: 7.0.2 - vite: - specifier: ^8.3.6 - version: 8.3.6(@types/node@26.6.6) - -packages: - - '@missing-elements/h5p-author@0.6.0': - resolution: {integrity: sha512-sJRIGjuOs8Aj9RtaivBz39rqRJLVC4L6vqBffGRGV+V8Zj4ESrLjLnlE1hlLnY8AfccPOZCOzrnO5EG6a4CBiQ==} - engines: {node: '>=22'} - hasBin: true - - '@missing-elements/h5p-embed@1.7.0': - resolution: {integrity: sha512-d6gDJURVPW/mh1WWVwwSe6yqud/S03ynVHRQBbkXd+iG2tXNVkTnbSHh99yTuwWBsft0gQSHjNfjf6H1aYyjlA==} - engines: {node: '>=22'} - hasBin: true - - '@missing-elements/h5p-libraries@1.1.0': - resolution: {integrity: sha512-gH4Qpvms3hDKzxSjAHg0UXQqUlkNPravGoMDmJH04XqVuNo41FG3JuxsuTzUV6k9LO3sD72XJ34K0VwThKGcTg==} - engines: {node: '>=20'} - - '@missing-elements/h5p-normalize@1.3.0': - resolution: {integrity: sha512-QuJsxpsSp/aG6MIBRGZk9TDyjLG+k7DdNo8pgdiGT2S3mC8C0l8Vj6SzvyIpDx5egiQSI8F+tRkRuFiVgUP0bg==} - engines: {node: '>=22'} - hasBin: true - - '@missing-elements/h5p-offline-player@1.5.1': - resolution: {integrity: sha512-vxIqhwtd4aNb/doLea4WrnGmL0zGLvtjsXBvft7UVNVqNlC/Com1gG0y/KTQ6rrdLdfFv7WgD0YP6UNkfdaYpg==} - engines: {node: '>=20'} - peerDependencies: - '@missing-elements/h5p-runtime': ^1.0.0 - peerDependenciesMeta: - '@missing-elements/h5p-runtime': - optional: true - - '@missing-elements/h5p-offline-player@1.6.0': - resolution: {integrity: sha512-Kn5jZBLZSYIiRNbiEVMdFzyatLTy2PPZyzwEBZ9iA8YvMqohRAfC+IKbDkwdbl+Y3pIYFtCnnIbDZy1aTRJgmQ==} - engines: {node: '>=20'} - peerDependencies: - '@missing-elements/h5p-runtime': ^1.0.0 - peerDependenciesMeta: - '@missing-elements/h5p-runtime': - optional: true - - '@missing-elements/h5p-runtime@1.0.1': - resolution: {integrity: sha512-/cvjh7a9X9DMHEzIOqCMJAngEJxrCOCr33NI+FOM5UGdXR7Er0CYpMqQKGslrS2hVJIlWJ9iI8YG/Bw2/vISlA==} - engines: {node: '>=20'} - - '@oxc-project/types@0.156.0': - resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==} - - '@playwright/test@1.65.0': - resolution: {integrity: sha512-iGURLGuKDLakSEl7Pgfv8h7f+XLT+V861Wfhz0zlEl5nyFuKUopdkFBPKqTllTUp06aOwPuH8iuUEb3yp3MpbQ==} - engines: {node: '>=20'} - hasBin: true - - '@rolldown/binding-android-arm-eabi@1.2.16': - resolution: {integrity: sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [android] - - '@rolldown/binding-android-arm64@1.2.16': - resolution: {integrity: sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [android] - - '@rolldown/binding-darwin-arm64@1.2.16': - resolution: {integrity: sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [darwin] - - '@rolldown/binding-darwin-x64@1.2.16': - resolution: {integrity: sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [darwin] - - '@rolldown/binding-freebsd-x64@1.2.16': - resolution: {integrity: sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [freebsd] - - '@rolldown/binding-linux-arm-gnueabihf@1.2.16': - resolution: {integrity: sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] - - '@rolldown/binding-linux-arm64-gnu@1.2.16': - resolution: {integrity: sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-arm64-musl@1.2.16': - resolution: {integrity: sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@rolldown/binding-linux-ppc64-gnu@1.2.16': - resolution: {integrity: sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [ppc64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-s390x-gnu@1.2.16': - resolution: {integrity: sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [s390x] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-gnu@1.2.16': - resolution: {integrity: sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@rolldown/binding-linux-x64-musl@1.2.16': - resolution: {integrity: sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [linux] - libc: [musl] - - '@rolldown/binding-openharmony-arm64@1.2.16': - resolution: {integrity: sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] - - '@rolldown/binding-win32-arm64-msvc@1.2.16': - resolution: {integrity: sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - - '@rolldown/binding-win32-x64-msvc@1.2.16': - resolution: {integrity: sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] - os: [win32] - - '@rolldown/pluginutils@1.0.1': - resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} - - '@types/node@26.6.6': - resolution: {integrity: sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==} - - '@typescript/typescript-aix-ppc64@7.0.2': - resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} - engines: {node: '>=16.20.0'} - cpu: [ppc64] - os: [aix] - - '@typescript/typescript-darwin-arm64@7.0.2': - resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [darwin] - - '@typescript/typescript-darwin-x64@7.0.2': - resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [darwin] - - '@typescript/typescript-freebsd-arm64@7.0.2': - resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [freebsd] - - '@typescript/typescript-freebsd-x64@7.0.2': - resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [freebsd] - - '@typescript/typescript-linux-arm64@7.0.2': - resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [linux] - - '@typescript/typescript-linux-arm@7.0.2': - resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} - engines: {node: '>=16.20.0'} - cpu: [arm] - os: [linux] - - '@typescript/typescript-linux-loong64@7.0.2': - resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} - engines: {node: '>=16.20.0'} - cpu: [loong64] - os: [linux] - - '@typescript/typescript-linux-mips64el@7.0.2': - resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} - engines: {node: '>=16.20.0'} - cpu: [mips64el] - os: [linux] - - '@typescript/typescript-linux-ppc64@7.0.2': - resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} - engines: {node: '>=16.20.0'} - cpu: [ppc64] - os: [linux] - - '@typescript/typescript-linux-riscv64@7.0.2': - resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} - engines: {node: '>=16.20.0'} - cpu: [riscv64] - os: [linux] - - '@typescript/typescript-linux-s390x@7.0.2': - resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} - engines: {node: '>=16.20.0'} - cpu: [s390x] - os: [linux] - - '@typescript/typescript-linux-x64@7.0.2': - resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [linux] - - '@typescript/typescript-netbsd-arm64@7.0.2': - resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [netbsd] - - '@typescript/typescript-netbsd-x64@7.0.2': - resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [netbsd] - - '@typescript/typescript-openbsd-arm64@7.0.2': - resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [openbsd] - - '@typescript/typescript-openbsd-x64@7.0.2': - resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [openbsd] - - '@typescript/typescript-sunos-x64@7.0.2': - resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [sunos] - - '@typescript/typescript-win32-arm64@7.0.2': - resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} - engines: {node: '>=16.20.0'} - cpu: [arm64] - os: [win32] - - '@typescript/typescript-win32-x64@7.0.2': - resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} - engines: {node: '>=16.20.0'} - cpu: [x64] - os: [win32] - - '@zip.js/zip.js@2.24.0': - resolution: {integrity: sha512-WlaVKzdqBK+RF3bdiXZWbdCnvGB6PdO4IHC1mn/2Yfl3bASgqUNegnU3+PNg61iecwoPfUi5BgLUPqBukXpyWw==} - engines: {bun: '>=0.7.0', deno: '>=1.0.0', node: '>=18.0.0'} - - detect-libc@2.1.2: - resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} - engines: {node: '>=8'} - - fdir@6.5.0: - resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} - engines: {node: '>=12.0.0'} - peerDependencies: - picomatch: ^3 || ^4 - peerDependenciesMeta: - picomatch: - optional: true - - fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - - lightningcss-android-arm64@1.33.0: - resolution: {integrity: sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [android] - - lightningcss-darwin-arm64@1.33.0: - resolution: {integrity: sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [darwin] - - lightningcss-darwin-x64@1.33.0: - resolution: {integrity: sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [darwin] - - lightningcss-freebsd-x64@1.33.0: - resolution: {integrity: sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [freebsd] - - lightningcss-linux-arm-gnueabihf@1.33.0: - resolution: {integrity: sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm] - os: [linux] - - lightningcss-linux-arm64-gnu@1.33.0: - resolution: {integrity: sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - lightningcss-linux-arm64-musl@1.33.0: - resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [linux] - libc: [musl] - - lightningcss-linux-x64-gnu@1.33.0: - resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - libc: [glibc] - - lightningcss-linux-x64-musl@1.33.0: - resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [linux] - libc: [musl] - - lightningcss-win32-arm64-msvc@1.33.0: - resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} - engines: {node: '>= 12.0.0'} - cpu: [arm64] - os: [win32] - - lightningcss-win32-x64-msvc@1.33.0: - resolution: {integrity: sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==} - engines: {node: '>= 12.0.0'} - cpu: [x64] - os: [win32] - - lightningcss@1.33.0: - resolution: {integrity: sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==} - engines: {node: '>= 12.0.0'} - - nanoid@3.3.20: - resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - - picocolors@1.1.1: - resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} - - picomatch@4.0.7: - resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} - engines: {node: '>=12'} - - playwright-core@1.65.0: - resolution: {integrity: sha512-vNSKgH6YqtN7cdT/L334zo0a+YwkrpicyrHJlWWPIm/Q+Nn2SWInil01oT0mbu96U4GgoRtCYQD9CzJQgju+lA==} - engines: {node: '>=20'} - hasBin: true - - playwright@1.65.0: - resolution: {integrity: sha512-F3AMWcR44qMBt4kq+6Kb6mX7bjGXshktKFOPULd7reED6ZJWevjbNRqysP7q+AATE9kdPEZBibex1BYsvpVoeA==} - engines: {node: '>=20'} - hasBin: true - - postcss@8.5.32: - resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==} - engines: {node: ^10 || ^12 || >=14} - - rolldown@1.2.16: - resolution: {integrity: sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - - source-map-js@1.2.2: - resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} - engines: {node: '>=0.10.0'} - - tinyglobby@0.2.17: - resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} - engines: {node: '>=12.0.0'} - - typescript@7.0.2: - resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} - engines: {node: '>=16.20.0'} - hasBin: true - - undici-types@8.9.0: - resolution: {integrity: sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==} - - vite@8.3.6: - resolution: {integrity: sha512-UI7dK29NnS54Fk+mmo7o+jI6U8Fp7hDl+X5Q1k45WH+d4dSlbLVUETGQ+hfkNgvLQGyoElPj837nZyv4MBc0VA==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - peerDependencies: - '@types/node': ^20.19.0 || >=22.12.0 - '@vitejs/devtools': ^0.7.1 || ^0.8.0 - esbuild: ^0.27.0 || ^0.28.0 - jiti: '>=1.21.0' - less: ^4.0.0 - sass: ^1.70.0 - sass-embedded: ^1.70.0 - stylus: '>=0.54.8' - sugarss: ^5.0.0 - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - '@types/node': - optional: true - '@vitejs/devtools': - optional: true - esbuild: - optional: true - jiti: - optional: true - less: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - -snapshots: - - '@missing-elements/h5p-author@0.6.0(@missing-elements/h5p-runtime@1.0.1)': - dependencies: - '@missing-elements/h5p-libraries': 1.1.0 - '@missing-elements/h5p-normalize': 1.3.0 - '@missing-elements/h5p-offline-player': 1.5.1(@missing-elements/h5p-runtime@1.0.1) - '@zip.js/zip.js': 2.24.0 - transitivePeerDependencies: - - '@missing-elements/h5p-runtime' - - '@missing-elements/h5p-embed@1.7.0': - dependencies: - '@missing-elements/h5p-libraries': 1.1.0 - '@missing-elements/h5p-normalize': 1.3.0 - '@missing-elements/h5p-offline-player': 1.5.1(@missing-elements/h5p-runtime@1.0.1) - '@missing-elements/h5p-runtime': 1.0.1 - '@zip.js/zip.js': 2.24.0 - - '@missing-elements/h5p-libraries@1.1.0': {} - - '@missing-elements/h5p-normalize@1.3.0': - dependencies: - '@zip.js/zip.js': 2.24.0 - - '@missing-elements/h5p-offline-player@1.5.1(@missing-elements/h5p-runtime@1.0.1)': - dependencies: - '@zip.js/zip.js': 2.24.0 - optionalDependencies: - '@missing-elements/h5p-runtime': 1.0.1 - - '@missing-elements/h5p-offline-player@1.6.0(@missing-elements/h5p-runtime@1.0.1)': - dependencies: - '@zip.js/zip.js': 2.24.0 - optionalDependencies: - '@missing-elements/h5p-runtime': 1.0.1 - - '@missing-elements/h5p-runtime@1.0.1': {} - - '@oxc-project/types@0.156.0': {} - - '@playwright/test@1.65.0': - dependencies: - playwright: 1.65.0 - - '@rolldown/binding-android-arm-eabi@1.2.16': - optional: true - - '@rolldown/binding-android-arm64@1.2.16': - optional: true - - '@rolldown/binding-darwin-arm64@1.2.16': - optional: true - - '@rolldown/binding-darwin-x64@1.2.16': - optional: true - - '@rolldown/binding-freebsd-x64@1.2.16': - optional: true - - '@rolldown/binding-linux-arm-gnueabihf@1.2.16': - optional: true - - '@rolldown/binding-linux-arm64-gnu@1.2.16': - optional: true - - '@rolldown/binding-linux-arm64-musl@1.2.16': - optional: true - - '@rolldown/binding-linux-ppc64-gnu@1.2.16': - optional: true - - '@rolldown/binding-linux-s390x-gnu@1.2.16': - optional: true - - '@rolldown/binding-linux-x64-gnu@1.2.16': - optional: true - - '@rolldown/binding-linux-x64-musl@1.2.16': - optional: true - - '@rolldown/binding-openharmony-arm64@1.2.16': - optional: true - - '@rolldown/binding-win32-arm64-msvc@1.2.16': - optional: true - - '@rolldown/binding-win32-x64-msvc@1.2.16': - optional: true - - '@rolldown/pluginutils@1.0.1': {} - - '@types/node@26.6.6': - dependencies: - undici-types: 8.9.0 - - '@typescript/typescript-aix-ppc64@7.0.2': - optional: true - - '@typescript/typescript-darwin-arm64@7.0.2': - optional: true - - '@typescript/typescript-darwin-x64@7.0.2': - optional: true - - '@typescript/typescript-freebsd-arm64@7.0.2': - optional: true - - '@typescript/typescript-freebsd-x64@7.0.2': - optional: true - - '@typescript/typescript-linux-arm64@7.0.2': - optional: true - - '@typescript/typescript-linux-arm@7.0.2': - optional: true - - '@typescript/typescript-linux-loong64@7.0.2': - optional: true - - '@typescript/typescript-linux-mips64el@7.0.2': - optional: true - - '@typescript/typescript-linux-ppc64@7.0.2': - optional: true - - '@typescript/typescript-linux-riscv64@7.0.2': - optional: true - - '@typescript/typescript-linux-s390x@7.0.2': - optional: true - - '@typescript/typescript-linux-x64@7.0.2': - optional: true - - '@typescript/typescript-netbsd-arm64@7.0.2': - optional: true - - '@typescript/typescript-netbsd-x64@7.0.2': - optional: true - - '@typescript/typescript-openbsd-arm64@7.0.2': - optional: true - - '@typescript/typescript-openbsd-x64@7.0.2': - optional: true - - '@typescript/typescript-sunos-x64@7.0.2': - optional: true - - '@typescript/typescript-win32-arm64@7.0.2': - optional: true - - '@typescript/typescript-win32-x64@7.0.2': - optional: true - - '@zip.js/zip.js@2.24.0': {} - - detect-libc@2.1.2: {} - - fdir@6.5.0(picomatch@4.0.7): - optionalDependencies: - picomatch: 4.0.7 - - fsevents@2.3.3: - optional: true - - lightningcss-android-arm64@1.33.0: - optional: true - - lightningcss-darwin-arm64@1.33.0: - optional: true - - lightningcss-darwin-x64@1.33.0: - optional: true - - lightningcss-freebsd-x64@1.33.0: - optional: true - - lightningcss-linux-arm-gnueabihf@1.33.0: - optional: true - - lightningcss-linux-arm64-gnu@1.33.0: - optional: true - - lightningcss-linux-arm64-musl@1.33.0: - optional: true - - lightningcss-linux-x64-gnu@1.33.0: - optional: true - - lightningcss-linux-x64-musl@1.33.0: - optional: true - - lightningcss-win32-arm64-msvc@1.33.0: - optional: true - - lightningcss-win32-x64-msvc@1.33.0: - optional: true - - lightningcss@1.33.0: - dependencies: - detect-libc: 2.1.2 - optionalDependencies: - lightningcss-android-arm64: 1.33.0 - lightningcss-darwin-arm64: 1.33.0 - lightningcss-darwin-x64: 1.33.0 - lightningcss-freebsd-x64: 1.33.0 - lightningcss-linux-arm-gnueabihf: 1.33.0 - lightningcss-linux-arm64-gnu: 1.33.0 - lightningcss-linux-arm64-musl: 1.33.0 - lightningcss-linux-x64-gnu: 1.33.0 - lightningcss-linux-x64-musl: 1.33.0 - lightningcss-win32-arm64-msvc: 1.33.0 - lightningcss-win32-x64-msvc: 1.33.0 - - nanoid@3.3.20: {} - - picocolors@1.1.1: {} - - picomatch@4.0.7: {} - - playwright-core@1.65.0: {} - - playwright@1.65.0: - dependencies: - playwright-core: 1.65.0 - - postcss@8.5.32: - dependencies: - nanoid: 3.3.20 - picocolors: 1.1.1 - source-map-js: 1.2.2 - - rolldown@1.2.16: - dependencies: - '@oxc-project/types': 0.156.0 - '@rolldown/pluginutils': 1.0.1 - optionalDependencies: - '@rolldown/binding-android-arm-eabi': 1.2.16 - '@rolldown/binding-android-arm64': 1.2.16 - '@rolldown/binding-darwin-arm64': 1.2.16 - '@rolldown/binding-darwin-x64': 1.2.16 - '@rolldown/binding-freebsd-x64': 1.2.16 - '@rolldown/binding-linux-arm-gnueabihf': 1.2.16 - '@rolldown/binding-linux-arm64-gnu': 1.2.16 - '@rolldown/binding-linux-arm64-musl': 1.2.16 - '@rolldown/binding-linux-ppc64-gnu': 1.2.16 - '@rolldown/binding-linux-s390x-gnu': 1.2.16 - '@rolldown/binding-linux-x64-gnu': 1.2.16 - '@rolldown/binding-linux-x64-musl': 1.2.16 - '@rolldown/binding-openharmony-arm64': 1.2.16 - '@rolldown/binding-win32-arm64-msvc': 1.2.16 - '@rolldown/binding-win32-x64-msvc': 1.2.16 - - source-map-js@1.2.2: {} - - tinyglobby@0.2.17: - dependencies: - fdir: 6.5.0(picomatch@4.0.7) - picomatch: 4.0.7 - - typescript@7.0.2: - optionalDependencies: - '@typescript/typescript-aix-ppc64': 7.0.2 - '@typescript/typescript-darwin-arm64': 7.0.2 - '@typescript/typescript-darwin-x64': 7.0.2 - '@typescript/typescript-freebsd-arm64': 7.0.2 - '@typescript/typescript-freebsd-x64': 7.0.2 - '@typescript/typescript-linux-arm': 7.0.2 - '@typescript/typescript-linux-arm64': 7.0.2 - '@typescript/typescript-linux-loong64': 7.0.2 - '@typescript/typescript-linux-mips64el': 7.0.2 - '@typescript/typescript-linux-ppc64': 7.0.2 - '@typescript/typescript-linux-riscv64': 7.0.2 - '@typescript/typescript-linux-s390x': 7.0.2 - '@typescript/typescript-linux-x64': 7.0.2 - '@typescript/typescript-netbsd-arm64': 7.0.2 - '@typescript/typescript-netbsd-x64': 7.0.2 - '@typescript/typescript-openbsd-arm64': 7.0.2 - '@typescript/typescript-openbsd-x64': 7.0.2 - '@typescript/typescript-sunos-x64': 7.0.2 - '@typescript/typescript-win32-arm64': 7.0.2 - '@typescript/typescript-win32-x64': 7.0.2 - - undici-types@8.9.0: {} - - vite@8.3.6(@types/node@26.6.6): - dependencies: - lightningcss: 1.33.0 - picomatch: 4.0.7 - postcss: 8.5.32 - rolldown: 1.2.16 - tinyglobby: 0.2.17 - optionalDependencies: - '@types/node': 26.6.6 - fsevents: 2.3.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml deleted file mode 100644 index d9f2302..0000000 --- a/pnpm-workspace.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# pnpm settings for this site, which is one package, not a workspace. -# -# Dependabot holds every new version back three days and runs pnpm with that minimum release age, -# which then refuses any locked version younger than it. The site pins @missing-elements releases -# as they come out, so they are left out of the age; every other package keeps it (#19). -minimumReleaseAgeExclude: - - "@missing-elements/*" diff --git a/public/samples/glossary.h5p b/public/samples/glossary.h5p deleted file mode 100644 index 6a6919b..0000000 Binary files a/public/samples/glossary.h5p and /dev/null differ diff --git a/public/samples/quiz-without-libraries.h5p b/public/samples/quiz-without-libraries.h5p deleted file mode 100644 index ec56d47..0000000 Binary files a/public/samples/quiz-without-libraries.h5p and /dev/null differ diff --git a/public/samples/quiz.h5p b/public/samples/quiz.h5p deleted file mode 100644 index a0d9b46..0000000 Binary files a/public/samples/quiz.h5p and /dev/null differ diff --git a/public/samples/video.h5p b/public/samples/video.h5p deleted file mode 100644 index 22fda6a..0000000 Binary files a/public/samples/video.h5p and /dev/null differ diff --git a/site/h5p.html b/site/h5p.html new file mode 100644 index 0000000..c7dfcff --- /dev/null +++ b/site/h5p.html @@ -0,0 +1,18 @@ + + + + + + + This player has retired · Embed My + + + + +

This H5P player has retired. The page that embeds it needs the activity embedded again, from an LMS or the site's own player.

+

Embed My is now at embed-my.org.

+ + diff --git a/site/index.html b/site/index.html new file mode 100644 index 0000000..e4f8063 --- /dev/null +++ b/site/index.html @@ -0,0 +1,14 @@ + + + + + + Embed My + + + + + +

Embed My is at embed-my.org.

+ + diff --git a/src/h5p-page.ts b/src/h5p-page.ts deleted file mode 100644 index dc2efc7..0000000 --- a/src/h5p-page.ts +++ /dev/null @@ -1,35 +0,0 @@ -import '@missing-elements/h5p-offline-player' -import '@missing-elements/h5p-embed/embed.css' -import { startEmbed } from '@missing-elements/h5p-embed/embed.js' -import { pack } from '@missing-elements/h5p-libraries' -import { runtime } from '@missing-elements/h5p-runtime' - -/** - * The player page, `/h5p`: `@missing-elements/h5p-embed`'s embed page, built by Vite so the - * player, the H5P runtime (GPL-3.0, a package of its own) and the library pack are emitted as - * hashed assets here. Everything else is the package's: the query string, the resizer protocol - * upward, the `report` and `error` messages the website's check list reads, and the xAPI relay. - * - * /h5p?src=[&frame][©right][&export][&icon][&reporting][&fullscreen=off] - * [&xapi=][&activity-id=][&custom-css=][&lang=] - * [&libraries=pack| …|none][&refresh-libraries=off][&downgrade-libraries=off][&preload=auto] - * - * Options, as this origin needs them: - * - `pack`: the library pack's `pack` export, one part per library, which Vite emits here. A - * package downloads only the parts it needs, each checked against the pack's SHA-256 and kept in - * the browser for every package that uses it, where the whole `libraries.h5p` (15.5 MB since - * pack 1.1.0, 1.8 MB of it libraries the player never reads) was downloaded at the first package - * that lacked anything. A package that carries an older version of a library plays the pack's - * newer one (player 0.10), unless the address says `&refresh-libraries=off`. - * - `defaultLibraries: 'pack'`: an export without its libraries (H5P.com, h5p.org) takes them from - * that pack, and from nowhere else: the player has no hub fallback since 0.6, so the page asks no - * third party for anything. Snippets have never carried `&libraries=`, so this keeps them playing - * such exports. - * - `packages` left out: a package from any host plays, which a public tool needs. - * - `askInOwnFrame: false`: a page of this origin that frames it gets the package as it is, not - * `untrusted`; nothing on this origin frames it except the browser tests. Framed by another site, - * the storage is that site's own, and a package always plays as it is. Opened on its own, a - * package from another site plays `untrusted` (h5p-embed 0.4): none of its own code runs, and - * since the runtime's 0.2 its content is checked against its libraries' semantics first. - */ -startEmbed({ pack, defaultLibraries: 'pack', runtime, askInOwnFrame: false }) diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 225848f..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "Bundler", - "lib": [ - "ES2022", - "DOM", - "DOM.Iterable" - ], - "types": [ - "vite/client", - "node" - ], - "strict": true, - "noEmit": true, - "isolatedModules": true, - "verbatimModuleSyntax": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "skipLibCheck": true - }, - "include": [ - "src/h5p-page.ts", - "e2e", - "playwright.config.ts", - "vite.config.ts" - ] -} diff --git a/vite.config.ts b/vite.config.ts deleted file mode 100644 index 749b40b..0000000 --- a/vite.config.ts +++ /dev/null @@ -1,171 +0,0 @@ -import { createHash } from 'node:crypto' -import { readFileSync } from 'node:fs' -import { copyFile, mkdir, readFile, writeFile } from 'node:fs/promises' -import { basename, join, resolve } from 'node:path' -import { fileURLToPath } from 'node:url' -import { writeBundles } from '@missing-elements/h5p-author' -import { build, defineConfig, type Plugin } from 'vite' - -/* - * The player origin, embed-my.github.io: the page the snippet frames (`/h5p`), the sizing script - * (`/h5p-resizer.js`) and the sample packages. - * Nothing here has a custom domain, on purpose: a GitHub Pages address is one the project keeps - * for as long as it exists, so every snippet ever pasted keeps working, and the pages a package - * runs on are apart from the site's own origin. - */ - -type Policy = Record - -/** - * The player page: its own scripts and workers, a package from any host, and the content's - * frame, which the worker serves from this origin. The content itself runs in that frame under - * the worker's own per-response policy, not this one. - */ -const PLAYER_POLICY: Policy = { - 'default-src': ["'self'"], - 'script-src': ["'self'"], - 'style-src': ["'self'"], - 'img-src': ["'self'", 'data:', 'blob:'], - 'font-src': ["'self'"], - 'connect-src': ['*', 'data:', 'blob:'], - 'worker-src': ["'self'", 'blob:'], - 'frame-src': ["'self'", 'blob:'], - 'object-src': ["'none'"], - 'base-uri': ["'self'"] -} - -/** - * Writes the page's Content-Security-Policy into a tag at build. GitHub Pages sends no - * headers of its own, so the tag is the only policy the page gets. Inline scripts are allowed by - * hash rather than by 'unsafe-inline'. Build only: the dev server injects scripts and styles of - * its own that no fixed policy covers. - */ -function cspMeta(): Plugin { - return { - name: 'embed-my:csp-meta', - apply: 'build', - transformIndexHtml: { - order: 'post', - handler(html) { - const policy = structuredClone(PLAYER_POLICY) - const inline = [...html.matchAll(/]*\ssrc=)[^>]*>([\s\S]*?)<\/script>/g)].map((match) => match[1]) - for (const source of inline) { - policy['script-src'].push(`'sha256-${createHash('sha256').update(source).digest('base64')}'`) - } - const content = Object.entries(policy) - .map(([directive, sources]) => `${directive} ${sources.join(' ')}`) - .join('; ') - return [{ tag: 'meta', attrs: { 'http-equiv': 'Content-Security-Policy', content }, injectTo: 'head-prepend' }] - } - } - } -} - -/** - * The files that are not modules, copied from their packages: `h5p-resizer.js`, the sizing script - * the snippet's second line names, from `@missing-elements/h5p-embed`; and the runtime's licence and - * notice and the library bundle's licence list, served beside their files. The runtime is GPL-3.0 - * and asks that the two travel with copies of it, and the bundle's libraries ask the same; Vite - * emits scripts, fonts and the bundle as hashed assets and would leave the text files behind. - */ -function packageFiles(): Plugin { - const runtime = new URL('./node_modules/@missing-elements/h5p-runtime/dist/', import.meta.url) - const libraries = new URL('./node_modules/@missing-elements/h5p-libraries/', import.meta.url) - const embed = new URL('./node_modules/@missing-elements/h5p-embed/site/', import.meta.url) - return { - name: 'embed-my:package-files', - apply: 'build', - generateBundle() { - this.emitFile({ type: 'asset', fileName: 'h5p-resizer.js', source: readFileSync(new URL('resizer.js', embed)) }) - for (const file of ['LICENSE.txt', 'NOTICE.txt']) { - this.emitFile({ type: 'asset', fileName: `assets/runtime-${file}`, source: readFileSync(new URL(file, runtime)) }) - } - // The library bundle's licences, each library's own, which ask to travel with its code. - this.emitFile({ type: 'asset', fileName: 'assets/libraries-LICENSES.txt', source: readFileSync(new URL('libraries.txt', libraries)) }) - } - } -} - -/** - * `/bundles/`, for a chat that runs Node and can fetch a file but reaches no npm registry, as in - * ChatGPT's sandbox (#14). The h5p-author skill builds there from two files fetched from here: the - * command line, and the bundle of the source's content type. - * - * Kept until the next library pack release only. missing-elements.github.io serves the same at - * `/h5p/bundles/` since the build page moved there (#17), and the skill fetches from there; copies - * of the skill installed before still fetch from here. Then this plugin goes, with its test and the - * `@missing-elements/h5p-author` dependency. - * - * - `.zip`, one per content type in the pack (`h5p-author bundle --all`): `parts/`, the - * pack's whole index with the parts a build of that type can read, and `libraries.txt`. - * - `parts/`: every part of the pack under its own name, and its index. A bundle holds no addon, - * so a build whose text calls for one stops and names its part, which the chat fetches from here. - * - `h5p-author.mjs`: the command line as one file, everything it imports bundled in by Vite, so it - * runs with nothing installed. It takes `--libraries`: the npm package's pinned pack is not with - * it, nor the package.json `--version` reads, so `index.json` says the versions. - * - `index.json`: the author's and the pack's versions, and each bundle's file, size and parts. - * - `libraries.txt`: the pack's licence list, which asks to travel with its libraries. - * - * Written after the pages, from the packages the lockfile pins: `dist/` holds them, git does not. - */ -function bundles(): Plugin { - const root = fileURLToPath(new URL('.', import.meta.url)) - const author = new URL('./node_modules/@missing-elements/h5p-author/', import.meta.url) - const libraries = new URL('./node_modules/@missing-elements/h5p-libraries/', import.meta.url) - const version = async (from: URL) => (JSON.parse(await readFile(new URL('package.json', from), 'utf8')) as { version: string }).version - let outDir = '' - return { - name: 'embed-my:bundles', - apply: 'build', - configResolved(config) { - outDir = resolve(config.root, config.build.outDir) - }, - async writeBundle() { - const folder = join(outDir, 'bundles') - const written = await writeBundles(folder) - const parts = join(folder, 'parts') - await mkdir(parts) - const index = JSON.parse(await readFile(new URL('parts/index.json', libraries), 'utf8')) as { libraries: Array<{ folder: string }> } - for (const { folder: part } of index.libraries) await copyFile(new URL(`parts/${part}.h5p`, libraries), join(parts, `${part}.h5p`)) - await copyFile(new URL('parts/index.json', libraries), join(parts, 'index.json')) - await copyFile(new URL('libraries.txt', libraries), join(folder, 'libraries.txt')) - await build({ - configFile: false, - root, - logLevel: 'warn', - publicDir: false, - build: { - ssr: fileURLToPath(new URL('bin/h5p-author.mjs', author)), - outDir: folder, - emptyOutDir: false, - copyPublicDir: false, - minify: false, - reportCompressedSize: false, - rolldownOptions: { output: { entryFileNames: 'h5p-author.mjs', format: 'es', codeSplitting: false } } - }, - ssr: { noExternal: true, target: 'node' } - }) - const listing = { - author: await version(author), - pack: await version(libraries), - tool: 'h5p-author.mjs', - parts: 'parts/', - licences: 'libraries.txt', - bundles: written.map(({ output, type, parts, size }) => { - const [machineName, typeVersion] = type.split(' ') - return { type: machineName, version: typeVersion, file: basename(output), size, parts: parts.length } - }) - } - await writeFile(join(folder, 'index.json'), `${JSON.stringify(listing, null, 2)}\n`) - } - } -} - -export default defineConfig({ - plugins: [cspMeta(), packageFiles(), bundles()], - build: { - rollupOptions: { - input: { h5p: 'h5p.html', build: 'build.html' } - } - } -})