@projektemacher/storymapjs 0.10.6 → 0.10.8
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/CHANGELOG +358 -16
- package/README.md +43 -9
- package/dist/assets/demo-DBpeF31K.js +1 -0
- package/dist/assets/harness-Cr0rYpvt.js +1 -0
- package/dist/assets/harness-multi-CYHgI0a9.js +1 -0
- package/dist/assets/harness-support-Do7sIp2j.js +1 -0
- package/dist/assets/index-wHPqGrBS.js +1 -0
- package/dist/assets/main-DXalctuR.js +17 -0
- package/dist/context.json +12 -9
- package/dist/css/fonts/files/amatic-sc-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/amatic-sc-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/amatic-sc-hebrew-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/amatic-sc-hebrew-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/amatic-sc-vietnamese-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/amatic-sc-vietnamese-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-100-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-100-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-200-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-200-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-600-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-600-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-800-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-800-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-900-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-100-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-100-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-200-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-200-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-600-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-600-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-800-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-800-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-900-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-100-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-100-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-200-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-200-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-600-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-600-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-800-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-800-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-900-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/bitter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-200-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-600-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-800-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-arabic-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-200-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-600-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-800-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-200-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-600-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-800-normal.woff2 +0 -0
- package/dist/css/fonts/files/cairo-latin-ext-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/dancing-script-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-cyrillic-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-greek-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-greek-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-greek-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-greek-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-vietnamese-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/eb-garamond-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-greek-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-vietnamese-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-vietnamese-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-vietnamese-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/gentium-book-plus-vietnamese-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-vietnamese-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-vietnamese-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/old-standard-tt-vietnamese-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-cyrillic-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-greek-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-greek-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-greek-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-greek-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-hebrew-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-hebrew-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-vietnamese-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/open-sans-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-cyrillic-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-cyrillic-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-cyrillic-900-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-cyrillic-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-vietnamese-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-vietnamese-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-vietnamese-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-vietnamese-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-vietnamese-900-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-sc-vietnamese-900-normal.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-vietnamese-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/playfair-display-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-narrow-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-narrow-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-narrow-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-sans-narrow-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/pt-serif-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/raleway-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/raleway-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/raleway-cyrillic-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/raleway-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/raleway-vietnamese-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/raleway-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/roboto-slab-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/roboto-slab-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/roboto-slab-greek-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/roboto-slab-greek-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/roboto-slab-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-300-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-300-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-400-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-500-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-500-normal.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-700-italic.woff2 +0 -0
- package/dist/css/fonts/files/ubuntu-greek-ext-700-normal.woff2 +0 -0
- package/dist/css/fonts/files/unica-one-vietnamese-400-normal.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-cyrillic-ext-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-cyrillic-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-cyrillic-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-greek-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-greek-wght-normal.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-vietnamese-wght-italic.woff2 +0 -0
- package/dist/css/fonts/files/vollkorn-vietnamese-wght-normal.woff2 +0 -0
- package/dist/css/fonts/font.abril-droidsans.css +3 -0
- package/dist/css/fonts/font.amatic-andika.css +57 -0
- package/dist/css/fonts/font.bitter-raleway.css +111 -0
- package/dist/css/fonts/font.cairo.css +312 -0
- package/dist/css/fonts/font.clicker-garamond.css +93 -0
- package/dist/css/fonts/font.dancing-ledger.css +12 -0
- package/dist/css/fonts/font.default.css +183 -0
- package/dist/css/fonts/font.fjalla-average.css +3 -0
- package/dist/css/fonts/font.georgia-helvetica.css +3 -0
- package/dist/css/fonts/font.knightlab.css +642 -0
- package/dist/css/fonts/font.lustria-lato.css +3 -0
- package/dist/css/fonts/font.medula-lato.css +3 -0
- package/dist/css/fonts/font.oldstandard.css +101 -21
- package/dist/css/fonts/font.opensans-gentiumbook.css +183 -0
- package/dist/css/fonts/font.playfair-faunaone.css +39 -0
- package/dist/css/fonts/font.playfair.css +147 -0
- package/dist/css/fonts/font.pt.css +183 -0
- package/dist/css/fonts/font.roboto-megrim.css +3 -0
- package/dist/css/fonts/font.rufina-sintony.css +3 -0
- package/dist/css/fonts/font.ubuntu.css +291 -0
- package/dist/css/fonts/font.unicaone-vollkorn.css +84 -0
- package/dist/css/storymap.css +1 -1
- package/dist/demo.html +2 -2
- package/dist/docs/api/.nojekyll +1 -0
- package/dist/docs/api/assets/custom.css +47 -0
- package/dist/docs/api/assets/hierarchy.js +1 -0
- package/dist/docs/api/assets/highlight.css +57 -0
- package/dist/docs/api/assets/icons.js +18 -0
- package/dist/docs/api/assets/icons.svg +1 -0
- package/dist/docs/api/assets/main.js +60 -0
- package/dist/docs/api/assets/navigation.js +1 -0
- package/dist/docs/api/assets/search.js +1 -0
- package/dist/docs/api/assets/style.css +1648 -0
- package/dist/docs/api/classes/StoryMap.html +1604 -0
- package/dist/docs/api/functions/MediaType.html +51 -0
- package/dist/docs/api/functions/isPresentation3Collection.html +47 -0
- package/dist/docs/api/functions/isPresentation3Manifest.html +53 -0
- package/dist/docs/api/functions/loadCSS.html +63 -0
- package/dist/docs/api/functions/manifestToStorymapData.html +49 -0
- package/dist/docs/api/functions/setLanguage.html +54 -0
- package/dist/docs/api/functions/storymapToManifest.html +57 -0
- package/dist/docs/api/functions/validateStorymap.html +53 -0
- package/dist/docs/api/functions/validateStorymapAndReport.html +54 -0
- package/dist/docs/api/hierarchy.html +28 -0
- package/dist/docs/api/index.html +197 -0
- package/dist/docs/api/interfaces/AnimationHandle.html +60 -0
- package/dist/docs/api/interfaces/ImagereadyPayload.html +71 -0
- package/dist/docs/api/interfaces/LanguageEntry.html +102 -0
- package/dist/docs/api/interfaces/LatLngLiteral.html +73 -0
- package/dist/docs/api/interfaces/LoadOptions.html +59 -0
- package/dist/docs/api/interfaces/OlLayer.html +1400 -0
- package/dist/docs/api/interfaces/OlMap.html +1656 -0
- package/dist/docs/api/interfaces/OlProjection.html +332 -0
- package/dist/docs/api/interfaces/OlSource.html +784 -0
- package/dist/docs/api/interfaces/OlTileLayer.html +1497 -0
- package/dist/docs/api/interfaces/OlVectorLayer.html +1559 -0
- package/dist/docs/api/interfaces/OlView.html +1958 -0
- package/dist/docs/api/interfaces/StorymapData.html +71 -0
- package/dist/docs/api/interfaces/StorymapDataWrapper.html +60 -0
- package/dist/docs/api/interfaces/StorymapDocument.html +68 -0
- package/dist/docs/api/interfaces/StorymapError.html +63 -0
- package/dist/docs/api/interfaces/StorymapGeoreference.html +93 -0
- package/dist/docs/api/interfaces/StorymapGeoreferenceBody.html +74 -0
- package/dist/docs/api/interfaces/StorymapGroundControlPoint.html +69 -0
- package/dist/docs/api/interfaces/StorymapLanguageMap.html +57 -0
- package/dist/docs/api/interfaces/StorymapManifest.html +118 -0
- package/dist/docs/api/interfaces/StorymapManifestAnnotation.html +105 -0
- package/dist/docs/api/interfaces/StorymapManifestBackground.html +81 -0
- package/dist/docs/api/interfaces/StorymapManifestCanvas.html +140 -0
- package/dist/docs/api/interfaces/StorymapManifestContentResource.html +97 -0
- package/dist/docs/api/interfaces/StorymapManifestFeatureCollection.html +82 -0
- package/dist/docs/api/interfaces/StorymapManifestGeoreferencing.html +87 -0
- package/dist/docs/api/interfaces/StorymapManifestImageService.html +69 -0
- package/dist/docs/api/interfaces/StorymapManifestRange.html +75 -0
- package/dist/docs/api/interfaces/StorymapManifestService.html +77 -0
- package/dist/docs/api/interfaces/StorymapManifestSpecificResource.html +69 -0
- package/dist/docs/api/interfaces/StorymapManifestStatement.html +63 -0
- package/dist/docs/api/interfaces/StorymapMapOptions.html +92 -0
- package/dist/docs/api/interfaces/StorymapOptions.html +532 -0
- package/dist/docs/api/interfaces/StorymapOverlayLayer.html +126 -0
- package/dist/docs/api/interfaces/StorymapSlide.html +132 -0
- package/dist/docs/api/interfaces/StorymapSlideBackground.html +72 -0
- package/dist/docs/api/interfaces/StorymapSlideLocation.html +117 -0
- package/dist/docs/api/interfaces/StorymapSlideMarker.html +104 -0
- package/dist/docs/api/interfaces/StorymapSlideMedia.html +110 -0
- package/dist/docs/api/interfaces/StorymapSlideNarration.html +65 -0
- package/dist/docs/api/interfaces/StorymapSlideText.html +72 -0
- package/dist/docs/api/interfaces/StorymapTilejson.html +105 -0
- package/dist/docs/api/media/es.json +31 -0
- package/dist/docs/api/media/migration-from-knightlab.md +359 -0
- package/dist/docs/api/modules.html +50 -0
- package/dist/docs/api/types/ContentState.html +70 -0
- package/dist/docs/api/types/ImagereadyKind.html +34 -0
- package/dist/docs/api/types/MediaTypeMatch.html +78 -0
- package/dist/docs/api/types/TileSourceFactory.html +53 -0
- package/dist/docs/authoring.html +293 -0
- package/dist/docs/iiif.html +617 -62
- package/dist/docs/migration.html +314 -12
- package/dist/docs/readme.html +40 -9
- package/dist/embed/index.html +130 -5
- package/dist/examples/issue-242-nonlatin.json +55 -0
- package/dist/examples/issue-305-start-at-slide-data.json +96 -0
- package/dist/examples/issue-358-iframe.json +57 -0
- package/dist/examples/issue-iiif-geo.json +32 -0
- package/dist/examples/issue-image-alt.json +23 -0
- package/dist/examples/issue-image-region.json +42 -0
- package/dist/examples/issue-image-srcset.json +24 -0
- package/dist/examples/map-area-overlays.json +68 -0
- package/dist/examples/no-map.json +44 -0
- package/dist/examples-iiif/annotated-image.json +188 -0
- package/dist/examples-iiif/bob-boilen.json +11 -5
- package/dist/examples-iiif/courbet.json +9 -6
- package/dist/examples-iiif/empty.json +8 -4
- package/dist/examples-iiif/flickr-drewvigal.json +248 -24
- package/dist/examples-iiif/flickr-zach.wise.json +8 -4
- package/dist/examples-iiif/georeferenced-layer-unsupported.json +153 -0
- package/dist/examples-iiif/georeferenced-layer.json +318 -0
- package/dist/examples-iiif/iiif-wellcome.json +9 -6
- package/dist/examples-iiif/instagram-chenpamela.json +381 -36
- package/dist/examples-iiif/instagram_brentfoster.json +429 -40
- package/dist/examples-iiif/instagram_couch.json +261 -26
- package/dist/examples-iiif/instagram_joegermuska.json +441 -41
- package/dist/examples-iiif/instagram_matteich.json +261 -26
- package/dist/examples-iiif/instagram_mirandamulligan.json +261 -26
- package/dist/examples-iiif/instagram_raymondmccrea.json +261 -26
- package/dist/examples-iiif/instagram_test.json +261 -26
- package/dist/examples-iiif/issue-134-no-lines.json +9 -5
- package/dist/examples-iiif/issue-177-color-vars.json +9 -5
- package/dist/examples-iiif/issue-211-rtl.json +9 -5
- package/dist/examples-iiif/issue-242-nonlatin.json +239 -0
- package/dist/examples-iiif/issue-272-facebook.json +9 -5
- package/dist/examples-iiif/issue-305-start-at-slide-data.json +305 -0
- package/dist/examples-iiif/issue-305-start-at-slide.json +9 -5
- package/dist/examples-iiif/issue-341-distance.json +9 -5
- package/dist/examples-iiif/issue-358-iframe.json +190 -0
- package/dist/examples-iiif/issue-360-juxtapose.json +22 -7
- package/dist/examples-iiif/issue-368-null-fields.json +9 -5
- package/dist/examples-iiif/issue-375-code-lists.json +9 -5
- package/dist/examples-iiif/issue-381-dateline.json +9 -5
- package/dist/examples-iiif/issue-405-custom-icon.json +203 -0
- package/dist/examples-iiif/issue-425-many-slides.json +9 -5
- package/dist/examples-iiif/issue-428-background.json +20 -8
- package/dist/examples-iiif/issue-435-googlemaps.json +9 -5
- package/dist/examples-iiif/issue-437-documentcloud.json +22 -7
- package/dist/examples-iiif/issue-451-webp.json +9 -5
- package/dist/examples-iiif/issue-455-audio.json +9 -5
- package/dist/examples-iiif/issue-480-shorts.json +9 -5
- package/dist/examples-iiif/issue-506-marker-sync.json +9 -5
- package/dist/examples-iiif/issue-iiif-geo.json +200 -0
- package/dist/examples-iiif/issue-image-alt.json +90 -0
- package/dist/examples-iiif/issue-image-region.json +203 -0
- package/dist/examples-iiif/issue-image-srcset.json +87 -0
- package/dist/examples-iiif/jansteen.json +9 -6
- package/dist/examples-iiif/katrina.json +197 -41
- package/dist/examples-iiif/map-area-overlays.json +289 -0
- package/dist/examples-iiif/marktwain.json +255 -58
- package/dist/examples-iiif/no-map.json +148 -0
- package/dist/examples-iiif/population.json +440 -76
- package/dist/examples-iiif/president.json +456 -83
- package/dist/examples-iiif/scroll-hint.json +190 -0
- package/dist/examples-iiif/seurat.json +113 -22
- package/dist/examples-iiif/zoomify-clamp.json +153 -0
- package/dist/harness-multi.html +17 -0
- package/dist/harness.html +3 -2
- package/dist/index.html +33 -10
- package/dist/js/storymap.d.ts +1558 -114
- package/dist/js/storymap.js +10113 -6490
- package/dist/js/storymap.js.map +1 -1
- package/dist/navplace-properties.json +40 -0
- package/docs/migration-from-knightlab.md +359 -0
- package/docs/storymap-as-iiif-manifest.md +934 -0
- package/package.json +16 -10
- package/schema/storymap.schema.json +431 -78
- package/src/animation/easings.ts +25 -0
- package/src/animation/tween.ts +186 -0
- package/src/core/Browser.ts +20 -0
- package/src/core/Load.ts +232 -0
- package/src/core/Util.ts +416 -0
- package/src/core/mixins.ts +188 -0
- package/src/core/viewers.ts +94 -0
- package/src/dom/Dom.ts +31 -0
- package/src/dom/DomEvent.ts +80 -0
- package/src/globals.d.ts +24 -0
- package/src/language/Language.ts +281 -0
- package/src/language/locale/.expected-gaps.json +86 -0
- package/src/language/locale/be.json +31 -0
- package/src/language/locale/bg.json +31 -0
- package/src/language/locale/cs.json +31 -0
- package/src/language/locale/de.json +31 -0
- package/src/language/locale/el.json +31 -0
- package/src/language/locale/en.json +32 -0
- package/src/language/locale/es.json +31 -0
- package/src/language/locale/et.json +22 -0
- package/src/language/locale/fr.json +31 -0
- package/src/language/locale/he.json +31 -0
- package/src/language/locale/hu.json +31 -0
- package/src/language/locale/is.json +22 -0
- package/src/language/locale/it.json +31 -0
- package/src/language/locale/jp.json +31 -0
- package/src/language/locale/ko.json +31 -0
- package/src/language/locale/nl.json +31 -0
- package/src/language/locale/nn.json +22 -0
- package/src/language/locale/no.json +31 -0
- package/src/language/locale/pl.json +31 -0
- package/src/language/locale/pt.json +31 -0
- package/src/language/locale/ru.json +31 -0
- package/src/language/locale/sk.json +31 -0
- package/src/language/locale/sr.json +21 -0
- package/src/language/locale/sv.json +31 -0
- package/src/language/locale/tr.json +31 -0
- package/src/language/locale/uk.json +31 -0
- package/src/language/locale/ur.json +22 -0
- package/src/language/locale/zh-cn.json +31 -0
- package/src/language/locale/zh-tw.json +31 -0
- package/src/main.ts +143 -0
- package/src/map/Map.ts +794 -0
- package/src/map/MapMarker.ts +172 -0
- package/src/map/georeference.ts +325 -0
- package/src/map/openlayers/Map.OpenLayers.ts +2492 -0
- package/src/map/openlayers/MapMarker.OpenLayers.ts +400 -0
- package/src/map/openlayers/zoomifyTiles.ts +25 -0
- package/src/map/types.ts +17 -0
- package/src/media/EmbedUtil.ts +452 -0
- package/src/media/Media.ts +597 -0
- package/src/media/MediaType.ts +163 -0
- package/src/media/embedId.ts +104 -0
- package/src/media/types/Audio.ts +14 -0
- package/src/media/types/Blockquote.ts +39 -0
- package/src/media/types/DailyMotion.ts +53 -0
- package/src/media/types/DocumentCloud.ts +12 -0
- package/src/media/types/Facebook.ts +40 -0
- package/src/media/types/Flickr.ts +115 -0
- package/src/media/types/GoogleDoc.ts +58 -0
- package/src/media/types/HtmlMedia.ts +167 -0
- package/src/media/types/IFrame.ts +50 -0
- package/src/media/types/Image.ts +115 -0
- package/src/media/types/Juxtapose.ts +41 -0
- package/src/media/types/SoundCloud.ts +99 -0
- package/src/media/types/Text.ts +178 -0
- package/src/media/types/Twitter.ts +109 -0
- package/src/media/types/Video.ts +14 -0
- package/src/media/types/Vimeo.ts +65 -0
- package/src/media/types/Website.ts +46 -0
- package/src/media/types/Wikipedia.ts +134 -0
- package/src/media/types/YouTube.ts +224 -0
- package/src/scss/Typography.scss +235 -0
- package/src/scss/VCO.StoryMap.Dark.scss +150 -0
- package/src/scss/VCO.StoryMap.scss +195 -0
- package/src/scss/Variables.Dark.scss +57 -0
- package/src/scss/Variables.scss +48 -0
- package/src/scss/core/Mixins.scss +54 -0
- package/src/scss/core/Reset.scss +206 -0
- package/src/scss/fonts/_font.base.scss +113 -0
- package/src/scss/fonts/font.abril-droidsans.scss +75 -0
- package/src/scss/fonts/font.amatic-andika.scss +76 -0
- package/src/scss/fonts/font.bitter-raleway.scss +92 -0
- package/src/scss/fonts/font.cairo.scss +79 -0
- package/src/scss/fonts/font.clicker-garamond.scss +97 -0
- package/src/scss/fonts/font.dancing-ledger.scss +75 -0
- package/src/scss/fonts/font.default.scss +9 -0
- package/src/scss/fonts/font.fjalla-average.scss +80 -0
- package/src/scss/fonts/font.georgia-helvetica.scss +58 -0
- package/src/scss/fonts/font.knightlab.scss +111 -0
- package/src/scss/fonts/font.lustria-lato.scss +80 -0
- package/src/scss/fonts/font.medula-lato.scss +73 -0
- package/src/scss/fonts/font.oldstandard.scss +94 -0
- package/src/scss/fonts/font.opensans-gentiumbook.scss +85 -0
- package/src/scss/fonts/font.playfair-faunaone.scss +88 -0
- package/src/scss/fonts/font.playfair.scss +89 -0
- package/src/scss/fonts/font.pt.scss +96 -0
- package/src/scss/fonts/font.roboto-megrim.scss +73 -0
- package/src/scss/fonts/font.rufina-sintony.scss +73 -0
- package/src/scss/fonts/font.ubuntu.scss +82 -0
- package/src/scss/fonts/font.unicaone-vollkorn.scss +90 -0
- package/src/scss/icons/Icons.scss +239 -0
- package/src/scss/map/VCO.ImageMarker.scss +23 -0
- package/src/scss/map/VCO.Map.scss +21 -0
- package/src/scss/map/VCO.MapMarker.scss +242 -0
- package/src/scss/map/openlayers/VCO.Map.OpenLayers.scss +126 -0
- package/src/scss/media/VCO.Media.scss +219 -0
- package/src/scss/media/types/VCO.Media.Blockquote.scss +76 -0
- package/src/scss/media/types/VCO.Media.IFrame.scss +11 -0
- package/src/scss/media/types/VCO.Media.Image.scss +13 -0
- package/src/scss/media/types/VCO.Media.Text.scss +98 -0
- package/src/scss/media/types/VCO.Media.Twitter.scss +87 -0
- package/src/scss/media/types/VCO.Media.Wikipedia.scss +65 -0
- package/src/scss/site/site.scss +748 -0
- package/src/scss/slider/VCO.Slide.scss +457 -0
- package/src/scss/slider/VCO.SlideNav.scss +332 -0
- package/src/scss/slider/VCO.StorySlider.scss +66 -0
- package/src/scss/snapmap/VCO.SnapMap.scss +103 -0
- package/src/scss/ui/VCO.Consent.scss +121 -0
- package/src/scss/ui/VCO.MenuBar.Button.scss +107 -0
- package/src/scss/ui/VCO.MenuBar.scss +20 -0
- package/src/scss/ui/VCO.Message.scss +101 -0
- package/src/site/site.ts +88 -0
- package/src/slider/Slide.ts +554 -0
- package/src/slider/SlideNav.ts +246 -0
- package/src/slider/StorySlider.ts +833 -0
- package/src/storymap/Consent.ts +471 -0
- package/src/storymap/StoryMap.ts +2118 -0
- package/src/storymap/content-state.ts +185 -0
- package/src/storymap/iiif.ts +1844 -0
- package/src/storymap/to-iiif.ts +921 -0
- package/src/storymap/validate.ts +257 -0
- package/src/types.ts +494 -0
- package/src/ui/MenuBar.ts +376 -0
- package/src/ui/Message.ts +127 -0
- package/src/ui/Swipable.ts +455 -0
- package/dist/assets/demo-CVQ7kFek.js +0 -1
- package/dist/assets/harness-C-VZV-ou.js +0 -1
- package/dist/assets/index-DDsPBPZA.js +0 -1
- package/dist/assets/main-DwbXrrYn.js +0 -17
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import type { AnimateOptions, AnimationHandle } from "../types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A ~60 line Web Animations API tween, replacing the `morpheus` dependency.
|
|
5
|
+
*
|
|
6
|
+
* Why: morpheus was 4.3% of the shipped bundle (an inlined UMD build, ~37 kB
|
|
7
|
+
* minified) and shipped no types, so `src/animation/morpheus.d.ts` was a
|
|
8
|
+
* hand-maintained 41-line stub describing a surface the viewer barely used.
|
|
9
|
+
* The whole requirement is: animate `left`/`top`/`height`/`opacity` on one
|
|
10
|
+
* element, then `stop()` it. The platform does that natively.
|
|
11
|
+
*
|
|
12
|
+
* The shape deliberately matches the old call sites
|
|
13
|
+
* (`Animate(element, {left, top, height, opacity, duration, easing, complete})`
|
|
14
|
+
* returning `{stop()}`), so nothing above this file had to change.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Properties whose values are plain numbers, not lengths. Appending "px" to
|
|
19
|
+
* these produces an invalid keyframe — `opacity: "0px"` is rejected by the
|
|
20
|
+
* platform and the animation silently does not run.
|
|
21
|
+
*/
|
|
22
|
+
const UNITLESS = new Set(["opacity", "zIndex", "flexGrow", "flexShrink", "order", "lineHeight"]);
|
|
23
|
+
|
|
24
|
+
/** Normalise a target value for a keyframe, adding a unit only where needed. */
|
|
25
|
+
function toKeyframeValue(property: string, value: string | number): string {
|
|
26
|
+
if (typeof value === "number") {
|
|
27
|
+
return UNITLESS.has(property) ? String(value) : value + "px";
|
|
28
|
+
}
|
|
29
|
+
// percentages and other units pass through to the platform unchanged
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default function Animate(
|
|
34
|
+
element: HTMLElement | HTMLElement[] | NodeListOf<HTMLElement>,
|
|
35
|
+
options: AnimateOptions,
|
|
36
|
+
): AnimationHandle {
|
|
37
|
+
const elements =
|
|
38
|
+
element instanceof HTMLElement ? [element] : Array.from(element as ArrayLike<HTMLElement>);
|
|
39
|
+
|
|
40
|
+
// The properties to tween are every key except the lifecycle options.
|
|
41
|
+
const LIFECYCLE = new Set(["duration", "easing", "complete", "delay", "bezier"]);
|
|
42
|
+
const properties: Array<[string, string]> = [];
|
|
43
|
+
for (const [name, value] of Object.entries(options)) {
|
|
44
|
+
if (LIFECYCLE.has(name) || value === undefined || value === null) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
properties.push([name, toKeyframeValue(name, value as string | number)]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const from: Keyframe = {};
|
|
51
|
+
const to: Keyframe = {};
|
|
52
|
+
for (const [name, value] of properties) {
|
|
53
|
+
from[name] = readCurrentValue(elements[0], name);
|
|
54
|
+
to[name] = value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const duration = (options.duration as number) ?? 1000;
|
|
58
|
+
// `easing` is a function from src/animation/easings.ts; see cssEasing().
|
|
59
|
+
const easing = cssEasing(options.easing);
|
|
60
|
+
const complete = options.complete as (() => void) | undefined;
|
|
61
|
+
|
|
62
|
+
// No Web Animations API (jsdom, an ancient engine, or a host that has
|
|
63
|
+
// disabled it): apply the end state immediately. Every caller treats the
|
|
64
|
+
// result the same way it treats a completed animation, so this degrades
|
|
65
|
+
// to an instant transition rather than a broken one.
|
|
66
|
+
if (typeof elements[0]?.animate !== "function") {
|
|
67
|
+
for (const el of elements) {
|
|
68
|
+
for (const [name, value] of properties) {
|
|
69
|
+
el.style.setProperty(name, value);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
complete?.();
|
|
73
|
+
return { stop: () => {} };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const animations: Animation[] = [];
|
|
77
|
+
for (const el of elements) {
|
|
78
|
+
const animation = el.animate([from, to], {
|
|
79
|
+
duration: duration,
|
|
80
|
+
easing: easing,
|
|
81
|
+
fill: "forwards",
|
|
82
|
+
});
|
|
83
|
+
animations.push(animation);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const handle: AnimationHandle = {
|
|
87
|
+
stop: (jump?: boolean) => {
|
|
88
|
+
for (const animation of animations) {
|
|
89
|
+
// `commitStyles()` is the important part: it folds the current
|
|
90
|
+
// animated value into the element's inline style *before* the
|
|
91
|
+
// animation is torn down. Without it, cancelling snaps the
|
|
92
|
+
// element back to whatever it was before the animation — and
|
|
93
|
+
// three call sites depend on the post-stop value: the slider
|
|
94
|
+
// writes `style.left` directly on its fast path, SlideNav
|
|
95
|
+
// resets left/right to "" when it completes, and Swipable
|
|
96
|
+
// restarts momentum from the current position.
|
|
97
|
+
try {
|
|
98
|
+
animation.commitStyles();
|
|
99
|
+
} catch {
|
|
100
|
+
// an animation that never started (or already finished)
|
|
101
|
+
// has nothing to commit
|
|
102
|
+
}
|
|
103
|
+
animation.cancel();
|
|
104
|
+
}
|
|
105
|
+
// `stop(true)` used to mean "jump to the end"; keep that meaning
|
|
106
|
+
if (jump) {
|
|
107
|
+
for (const animation of animations) {
|
|
108
|
+
animation.finish();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
if (complete) {
|
|
115
|
+
const first = animations[0];
|
|
116
|
+
if (first) {
|
|
117
|
+
first.addEventListener("finish", () => complete());
|
|
118
|
+
} else {
|
|
119
|
+
complete();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return handle;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The element's current inline or computed value for a property. */
|
|
127
|
+
function readCurrentValue(element: HTMLElement | undefined, property: string): string {
|
|
128
|
+
if (!element) {
|
|
129
|
+
return "0px";
|
|
130
|
+
}
|
|
131
|
+
const inline = element.style.getPropertyValue(property);
|
|
132
|
+
if (inline) {
|
|
133
|
+
return inline;
|
|
134
|
+
}
|
|
135
|
+
const computed = window.getComputedStyle(element).getPropertyValue(property);
|
|
136
|
+
return computed || "0px";
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Translate the caller's easing into something `element.animate()` accepts.
|
|
141
|
+
*
|
|
142
|
+
* The call sites pass a *sampled* easing function from
|
|
143
|
+
* src/animation/easings.ts (a quintic, an exponential, a cubic-bezier), and
|
|
144
|
+
* CSS can only name a handful of curves. Dropping to the platform default
|
|
145
|
+
* would visibly change the slider glide, so instead the function is sampled
|
|
146
|
+
* into a CSS `linear()` easing — which reproduces the curve exactly.
|
|
147
|
+
*
|
|
148
|
+
* `linear()` is not universally supported, so it is feature-detected; where it
|
|
149
|
+
* is missing the platform default applies. That is a visual regression, not a
|
|
150
|
+
* functional one, which is why it is a graceful fallback rather than an error.
|
|
151
|
+
*/
|
|
152
|
+
function cssEasing(easing: unknown): string {
|
|
153
|
+
if (typeof easing === "string") {
|
|
154
|
+
return easing;
|
|
155
|
+
}
|
|
156
|
+
if (typeof easing === "function" && supportsLinearEasing()) {
|
|
157
|
+
const stops: string[] = [];
|
|
158
|
+
for (let i = 0; i <= EASING_SAMPLES; i++) {
|
|
159
|
+
const t = i / EASING_SAMPLES;
|
|
160
|
+
const value = (easing as (t: number) => number)(t);
|
|
161
|
+
stops.push(String(Number(value.toFixed(4))));
|
|
162
|
+
}
|
|
163
|
+
return `linear(${stops.join(",")})`;
|
|
164
|
+
}
|
|
165
|
+
return "ease";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** Enough samples to be visually indistinguishable from the source curve. */
|
|
169
|
+
const EASING_SAMPLES = 24;
|
|
170
|
+
|
|
171
|
+
let _linearEasing: boolean | undefined;
|
|
172
|
+
|
|
173
|
+
/** Cached `CSS.supports` probe for the linear() easing function. */
|
|
174
|
+
function supportsLinearEasing(): boolean {
|
|
175
|
+
if (_linearEasing === undefined) {
|
|
176
|
+
try {
|
|
177
|
+
_linearEasing =
|
|
178
|
+
typeof CSS !== "undefined" &&
|
|
179
|
+
typeof CSS.supports === "function" &&
|
|
180
|
+
CSS.supports("animation-timing-function", "linear(0, 0.5, 1)");
|
|
181
|
+
} catch {
|
|
182
|
+
_linearEasing = false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return _linearEasing;
|
|
186
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Browser - the only feature detection StoryMapJS still needs.
|
|
3
|
+
* 2022+ browsers only: no vendor sniffing, no legacy engine flags.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Touch-capable pointer - drives the swipe gesture and the mobile layouts. */
|
|
7
|
+
const touch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
8
|
+
|
|
9
|
+
/** Coarse-pointer devices (phones, tablets) - drives the mobile/skinny layouts. */
|
|
10
|
+
const mobile = window.matchMedia?.("(pointer: coarse)").matches ?? false;
|
|
11
|
+
|
|
12
|
+
export const Browser = {
|
|
13
|
+
touch: touch,
|
|
14
|
+
mobile: mobile,
|
|
15
|
+
orientation: function (): "landscape" | "portrait" {
|
|
16
|
+
const w = window.innerWidth;
|
|
17
|
+
const h = window.innerHeight;
|
|
18
|
+
return w > h ? "landscape" : "portrait";
|
|
19
|
+
},
|
|
20
|
+
};
|
package/src/core/Load.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/* Load
|
|
2
|
+
Loads external Javascript and CSS using plain DOM element injection.
|
|
3
|
+
Modern browsers preserve execution order for dynamically inserted
|
|
4
|
+
scripts with async=false, so no queueing machinery is needed.
|
|
5
|
+
================================================== */
|
|
6
|
+
|
|
7
|
+
export interface LoadOptions {
|
|
8
|
+
/** Abort the load (removes the element, rejects the promise). */
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function loadElement(
|
|
13
|
+
tag: "script" | "link",
|
|
14
|
+
attrs: Record<string, string>,
|
|
15
|
+
options?: LoadOptions,
|
|
16
|
+
): Promise<void> {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
if (options?.signal?.aborted) {
|
|
19
|
+
reject(new DOMException("Load aborted", "AbortError"));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const node = document.createElement(tag);
|
|
23
|
+
for (const attr in attrs) {
|
|
24
|
+
if (Object.hasOwn(attrs, attr)) {
|
|
25
|
+
node.setAttribute(attr, attrs[attr]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (tag === "script") {
|
|
29
|
+
(node as HTMLScriptElement).async = false;
|
|
30
|
+
}
|
|
31
|
+
const cleanup = () => {
|
|
32
|
+
node.onload = null;
|
|
33
|
+
node.onerror = null;
|
|
34
|
+
options?.signal?.removeEventListener("abort", onAbort);
|
|
35
|
+
};
|
|
36
|
+
const onAbort = () => {
|
|
37
|
+
cleanup();
|
|
38
|
+
node.remove();
|
|
39
|
+
reject(new DOMException("Load aborted", "AbortError"));
|
|
40
|
+
};
|
|
41
|
+
node.onload = () => {
|
|
42
|
+
cleanup();
|
|
43
|
+
resolve();
|
|
44
|
+
};
|
|
45
|
+
node.onerror = () => {
|
|
46
|
+
cleanup();
|
|
47
|
+
reject(new Error(`Failed to load ${attrs.src ?? attrs.href}`));
|
|
48
|
+
};
|
|
49
|
+
options?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
50
|
+
document.head.appendChild(node);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* In-flight and completed loads, keyed by URL.
|
|
56
|
+
*
|
|
57
|
+
* A page can hold more than one viewer, and they all need the same third-party
|
|
58
|
+
* scripts (the YouTube and SoundCloud APIs) and the same font stylesheet.
|
|
59
|
+
* Injecting those once per viewer re-defines `window.YT`/`window.SC` and
|
|
60
|
+
* re-applies the theme, so the second viewer awaits the first load instead.
|
|
61
|
+
*
|
|
62
|
+
* This is per bundle copy: two separately bundled copies of StoryMapJS on one
|
|
63
|
+
* page each keep their own map and would still both inject.
|
|
64
|
+
*/
|
|
65
|
+
const sharedLoads = new Map<string, Promise<void>>();
|
|
66
|
+
|
|
67
|
+
/** Reject `promise` early if `signal` aborts, without touching the load. */
|
|
68
|
+
function withAbort(promise: Promise<void>, signal: AbortSignal): Promise<void> {
|
|
69
|
+
if (signal.aborted) {
|
|
70
|
+
return Promise.reject(new DOMException("Load aborted", "AbortError"));
|
|
71
|
+
}
|
|
72
|
+
return new Promise<void>((resolve, reject) => {
|
|
73
|
+
const onAbort = () => {
|
|
74
|
+
reject(new DOMException("Load aborted", "AbortError"));
|
|
75
|
+
};
|
|
76
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
77
|
+
promise.then(resolve, reject).then(() => {
|
|
78
|
+
signal.removeEventListener("abort", onAbort);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function loadOnce(url: string, load: () => Promise<void>, options?: LoadOptions): Promise<void> {
|
|
84
|
+
let shared = sharedLoads.get(url);
|
|
85
|
+
if (!shared) {
|
|
86
|
+
shared = load().catch((err: unknown) => {
|
|
87
|
+
// never cache a failure: the next viewer should get a fresh try
|
|
88
|
+
sharedLoads.delete(url);
|
|
89
|
+
throw err;
|
|
90
|
+
});
|
|
91
|
+
sharedLoads.set(url, shared);
|
|
92
|
+
}
|
|
93
|
+
if (!options?.signal) {
|
|
94
|
+
return shared;
|
|
95
|
+
}
|
|
96
|
+
// A viewer aborts its own media loads when it is torn down. That must
|
|
97
|
+
// reject this caller's promise without cancelling the load a sibling
|
|
98
|
+
// viewer is still waiting on, so the shared load gets no signal at all.
|
|
99
|
+
return withAbort(shared, options.signal);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Append a script to the document head.
|
|
104
|
+
*
|
|
105
|
+
* Concurrent and repeat requests for the same URL share one injected script.
|
|
106
|
+
*
|
|
107
|
+
* @param url - The script URL.
|
|
108
|
+
* @param options - Optional AbortSignal to cancel an in-flight load.
|
|
109
|
+
* @returns Resolves when the script has loaded, rejects on error or abort.
|
|
110
|
+
*/
|
|
111
|
+
function loadJS(url: string, options?: LoadOptions): Promise<void> {
|
|
112
|
+
return loadOnce(url, () => loadElement("script", { src: url }), options);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Append one stylesheet to the document head.
|
|
117
|
+
*
|
|
118
|
+
* Concurrent and repeat requests for the same URL share one `<link>`.
|
|
119
|
+
*
|
|
120
|
+
* @param url - The stylesheet URL.
|
|
121
|
+
* @param options - Optional AbortSignal to cancel an in-flight load.
|
|
122
|
+
* @returns Resolves when the stylesheet has loaded, rejects on error or abort.
|
|
123
|
+
*/
|
|
124
|
+
function loadCSS(url: string, options?: LoadOptions): Promise<void> {
|
|
125
|
+
return loadOnce(url, () => loadElement("link", { href: url, rel: "stylesheet" }), options);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface JSONPOptions extends LoadOptions {
|
|
129
|
+
/** Milliseconds to wait for the callback before rejecting (default 15000). */
|
|
130
|
+
timeout?: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let globalNameCounter = 0;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Claim a free global callback slot: names derived from content (e.g. a
|
|
137
|
+
* Wikipedia article title) are not unique per request, and concurrent loads
|
|
138
|
+
* sharing a name would clobber each other's handler — delivering payloads to
|
|
139
|
+
* the wrong promise and leaving the loser's script calling a deleted global
|
|
140
|
+
* (Uncaught ReferenceError).
|
|
141
|
+
*
|
|
142
|
+
* @param base - The preferred global function name.
|
|
143
|
+
* @returns `base` when free, otherwise `base` with a numeric suffix.
|
|
144
|
+
*/
|
|
145
|
+
function uniqueGlobalName(base: string): string {
|
|
146
|
+
const globals = window as unknown as Record<string, unknown>;
|
|
147
|
+
if (!Object.hasOwn(globals, base)) {
|
|
148
|
+
return base;
|
|
149
|
+
}
|
|
150
|
+
let candidate: string;
|
|
151
|
+
do {
|
|
152
|
+
globalNameCounter += 1;
|
|
153
|
+
candidate = `${base}_${globalNameCounter}`;
|
|
154
|
+
} while (Object.hasOwn(globals, candidate));
|
|
155
|
+
return candidate;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Load a JSONP endpoint: injects a script that calls a global function with
|
|
160
|
+
* its payload, and resolves with that payload. The global is removed and the
|
|
161
|
+
* script element detached once settled.
|
|
162
|
+
*
|
|
163
|
+
* @param url - The full JSONP URL (must include the callback parameter).
|
|
164
|
+
* @param callbackName - The global function name the endpoint will invoke.
|
|
165
|
+
* Must be claimed via uniqueGlobalName when concurrent loads may share it.
|
|
166
|
+
* @param options - Optional AbortSignal and timeout.
|
|
167
|
+
* @returns Resolves with the JSONP payload, rejects on error, abort or timeout.
|
|
168
|
+
*/
|
|
169
|
+
function loadJSONP<T>(url: string, callbackName: string, options?: JSONPOptions): Promise<T> {
|
|
170
|
+
return new Promise((resolve, reject) => {
|
|
171
|
+
if (options?.signal?.aborted) {
|
|
172
|
+
reject(new DOMException("Load aborted", "AbortError"));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const globals = window as unknown as Record<string, unknown>;
|
|
176
|
+
const script = document.createElement("script");
|
|
177
|
+
let settled = false;
|
|
178
|
+
const cleanup = () => {
|
|
179
|
+
settled = true;
|
|
180
|
+
clearTimeout(timer);
|
|
181
|
+
script.remove();
|
|
182
|
+
if (globals[callbackName] === onCallback) {
|
|
183
|
+
delete globals[callbackName];
|
|
184
|
+
}
|
|
185
|
+
options?.signal?.removeEventListener("abort", onAbort);
|
|
186
|
+
};
|
|
187
|
+
// Abandon without deleting: an already-fetched script may still
|
|
188
|
+
// execute afterwards, and calling a deleted global throws an
|
|
189
|
+
// Uncaught ReferenceError. The self-deleting stub swallows it.
|
|
190
|
+
const abandon = () => {
|
|
191
|
+
settled = true;
|
|
192
|
+
clearTimeout(timer);
|
|
193
|
+
script.remove();
|
|
194
|
+
if (globals[callbackName] === onCallback) {
|
|
195
|
+
globals[callbackName] = () => {
|
|
196
|
+
delete globals[callbackName];
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
options?.signal?.removeEventListener("abort", onAbort);
|
|
200
|
+
};
|
|
201
|
+
const onAbort = () => {
|
|
202
|
+
if (!settled) {
|
|
203
|
+
abandon();
|
|
204
|
+
reject(new DOMException("Load aborted", "AbortError"));
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const onCallback = (data: T) => {
|
|
208
|
+
if (!settled) {
|
|
209
|
+
cleanup();
|
|
210
|
+
resolve(data);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
const timer = setTimeout(() => {
|
|
214
|
+
if (!settled) {
|
|
215
|
+
abandon();
|
|
216
|
+
reject(new Error(`JSONP request timed out: ${url}`));
|
|
217
|
+
}
|
|
218
|
+
}, options?.timeout ?? 15000);
|
|
219
|
+
globals[callbackName] = onCallback;
|
|
220
|
+
script.onerror = () => {
|
|
221
|
+
if (!settled) {
|
|
222
|
+
abandon();
|
|
223
|
+
reject(new Error(`Failed to load ${url}`));
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
options?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
227
|
+
script.src = url;
|
|
228
|
+
document.body.appendChild(script);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export { loadJS, loadCSS, loadJSONP, uniqueGlobalName };
|