@jean-is/render 0.8.0-rba68a676ffad → 0.8.0-reb51fb1030bc
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/brand.js +1 -0
- package/caps/files/office.js +3 -3
- package/caps/games/file.js +56 -0
- package/caps/games/frame.css +22 -0
- package/caps/games/guard.js +86 -0
- package/caps/games/page.js +52 -0
- package/caps/games/shell.js +260 -0
- package/caps/interactive/apps.js +11 -6
- package/caps/interactive/interactive.css +19 -6
- package/caps/interactive/interactive.js +17 -3
- package/caps/interactive/parts.js +116 -0
- package/caps/interactive/view-parts.js +189 -0
- package/caps/layouts/layouts.css +4 -3
- package/caps/scores/scores.css +8 -2
- package/caps/scores/scores.js +98 -42
- package/caps/skills/directory.js +5 -2
- package/caps/skills/sources.js +4 -2
- package/caps/slides/slides.js +1 -1
- package/core/conversations.js +153 -0
- package/core/events.js +1 -1
- package/core/files.js +8 -2
- package/core/settings.js +3 -2
- package/core/skills.js +2 -2
- package/locales/am.json +5 -1
- package/locales/ar.json +5 -1
- package/locales/bg.json +5 -1
- package/locales/bn.json +5 -1
- package/locales/br.json +5 -1
- package/locales/camera/am.json +20 -0
- package/locales/camera/ar.json +20 -0
- package/locales/camera/bg.json +20 -0
- package/locales/camera/bn.json +20 -0
- package/locales/camera/br.json +20 -0
- package/locales/camera/co.json +20 -0
- package/locales/camera/cs.json +20 -0
- package/locales/camera/da.json +20 -0
- package/locales/camera/de.json +20 -0
- package/locales/camera/el.json +20 -0
- package/locales/camera/en.json +20 -0
- package/locales/camera/es.json +20 -0
- package/locales/camera/fa.json +20 -0
- package/locales/camera/fi.json +20 -0
- package/locales/camera/fr-CA.json +20 -0
- package/locales/camera/fr.json +20 -0
- package/locales/camera/ha.json +20 -0
- package/locales/camera/he.json +20 -0
- package/locales/camera/hi.json +20 -0
- package/locales/camera/hr.json +20 -0
- package/locales/camera/hu.json +20 -0
- package/locales/camera/id.json +20 -0
- package/locales/camera/it.json +20 -0
- package/locales/camera/ja.json +20 -0
- package/locales/camera/ko.json +20 -0
- package/locales/camera/mr.json +20 -0
- package/locales/camera/ms.json +20 -0
- package/locales/camera/nl.json +20 -0
- package/locales/camera/pl.json +20 -0
- package/locales/camera/pt.json +20 -0
- package/locales/camera/ro.json +20 -0
- package/locales/camera/ru.json +20 -0
- package/locales/camera/sk.json +20 -0
- package/locales/camera/sv.json +20 -0
- package/locales/camera/sw.json +20 -0
- package/locales/camera/ta.json +20 -0
- package/locales/camera/te.json +20 -0
- package/locales/camera/th.json +20 -0
- package/locales/camera/tl.json +20 -0
- package/locales/camera/tr.json +20 -0
- package/locales/camera/uk.json +20 -0
- package/locales/camera/ur.json +20 -0
- package/locales/camera/vi.json +20 -0
- package/locales/camera/yo.json +20 -0
- package/locales/camera/zh-Hans.json +20 -0
- package/locales/camera/zh-Hant.json +20 -0
- package/locales/co.json +5 -1
- package/locales/creations/am.json +4 -0
- package/locales/creations/ar.json +4 -0
- package/locales/creations/bg.json +4 -0
- package/locales/creations/bn.json +4 -0
- package/locales/creations/br.json +4 -0
- package/locales/creations/co.json +4 -0
- package/locales/creations/cs.json +4 -0
- package/locales/creations/da.json +4 -0
- package/locales/creations/de.json +4 -0
- package/locales/creations/el.json +4 -0
- package/locales/creations/en.json +4 -0
- package/locales/creations/es.json +4 -0
- package/locales/creations/fa.json +4 -0
- package/locales/creations/fi.json +4 -0
- package/locales/creations/fr-CA.json +4 -0
- package/locales/creations/fr.json +4 -0
- package/locales/creations/ha.json +4 -0
- package/locales/creations/he.json +4 -0
- package/locales/creations/hi.json +4 -0
- package/locales/creations/hr.json +4 -0
- package/locales/creations/hu.json +4 -0
- package/locales/creations/id.json +4 -0
- package/locales/creations/it.json +4 -0
- package/locales/creations/ja.json +4 -0
- package/locales/creations/ko.json +4 -0
- package/locales/creations/mr.json +4 -0
- package/locales/creations/ms.json +4 -0
- package/locales/creations/nl.json +4 -0
- package/locales/creations/pl.json +4 -0
- package/locales/creations/pt.json +4 -0
- package/locales/creations/ro.json +4 -0
- package/locales/creations/ru.json +4 -0
- package/locales/creations/sk.json +4 -0
- package/locales/creations/sv.json +4 -0
- package/locales/creations/sw.json +4 -0
- package/locales/creations/ta.json +4 -0
- package/locales/creations/te.json +4 -0
- package/locales/creations/th.json +4 -0
- package/locales/creations/tl.json +4 -0
- package/locales/creations/tr.json +4 -0
- package/locales/creations/uk.json +4 -0
- package/locales/creations/ur.json +4 -0
- package/locales/creations/vi.json +4 -0
- package/locales/creations/yo.json +4 -0
- package/locales/creations/zh-Hans.json +4 -0
- package/locales/creations/zh-Hant.json +4 -0
- package/locales/cs.json +5 -1
- package/locales/da.json +5 -1
- package/locales/de.json +5 -1
- package/locales/designs/am.json +0 -1
- package/locales/designs/ar.json +0 -1
- package/locales/designs/bg.json +0 -1
- package/locales/designs/bn.json +0 -1
- package/locales/designs/br.json +0 -1
- package/locales/designs/co.json +0 -1
- package/locales/designs/cs.json +0 -1
- package/locales/designs/da.json +0 -1
- package/locales/designs/de.json +0 -1
- package/locales/designs/el.json +0 -1
- package/locales/designs/en.json +0 -1
- package/locales/designs/es.json +0 -1
- package/locales/designs/fa.json +0 -1
- package/locales/designs/fi.json +0 -1
- package/locales/designs/fr-CA.json +0 -1
- package/locales/designs/fr.json +0 -1
- package/locales/designs/ha.json +0 -1
- package/locales/designs/he.json +0 -1
- package/locales/designs/hi.json +0 -1
- package/locales/designs/hr.json +0 -1
- package/locales/designs/hu.json +0 -1
- package/locales/designs/id.json +0 -1
- package/locales/designs/it.json +0 -1
- package/locales/designs/ja.json +0 -1
- package/locales/designs/ko.json +0 -1
- package/locales/designs/mr.json +0 -1
- package/locales/designs/ms.json +0 -1
- package/locales/designs/nl.json +0 -1
- package/locales/designs/pl.json +0 -1
- package/locales/designs/pt.json +0 -1
- package/locales/designs/ro.json +0 -1
- package/locales/designs/ru.json +0 -1
- package/locales/designs/sk.json +0 -1
- package/locales/designs/sv.json +0 -1
- package/locales/designs/sw.json +0 -1
- package/locales/designs/ta.json +0 -1
- package/locales/designs/te.json +0 -1
- package/locales/designs/th.json +0 -1
- package/locales/designs/tl.json +0 -1
- package/locales/designs/tr.json +0 -1
- package/locales/designs/uk.json +0 -1
- package/locales/designs/ur.json +0 -1
- package/locales/designs/vi.json +0 -1
- package/locales/designs/yo.json +0 -1
- package/locales/designs/zh-Hans.json +0 -1
- package/locales/designs/zh-Hant.json +0 -1
- package/locales/dialogs/am.json +3 -0
- package/locales/dialogs/ar.json +3 -0
- package/locales/dialogs/bg.json +3 -0
- package/locales/dialogs/bn.json +3 -0
- package/locales/dialogs/br.json +3 -0
- package/locales/dialogs/co.json +3 -0
- package/locales/dialogs/cs.json +3 -0
- package/locales/dialogs/da.json +3 -0
- package/locales/dialogs/de.json +3 -0
- package/locales/dialogs/el.json +3 -0
- package/locales/dialogs/en.json +3 -0
- package/locales/dialogs/es.json +3 -0
- package/locales/dialogs/fa.json +3 -0
- package/locales/dialogs/fi.json +3 -0
- package/locales/dialogs/fr-CA.json +5 -2
- package/locales/dialogs/fr.json +5 -2
- package/locales/dialogs/ha.json +3 -0
- package/locales/dialogs/he.json +3 -0
- package/locales/dialogs/hi.json +3 -0
- package/locales/dialogs/hr.json +3 -0
- package/locales/dialogs/hu.json +3 -0
- package/locales/dialogs/id.json +3 -0
- package/locales/dialogs/it.json +3 -0
- package/locales/dialogs/ja.json +3 -0
- package/locales/dialogs/ko.json +3 -0
- package/locales/dialogs/mr.json +3 -0
- package/locales/dialogs/ms.json +3 -0
- package/locales/dialogs/nl.json +3 -0
- package/locales/dialogs/pl.json +3 -0
- package/locales/dialogs/pt.json +3 -0
- package/locales/dialogs/ro.json +3 -0
- package/locales/dialogs/ru.json +3 -0
- package/locales/dialogs/sk.json +3 -0
- package/locales/dialogs/sv.json +3 -0
- package/locales/dialogs/sw.json +3 -0
- package/locales/dialogs/ta.json +3 -0
- package/locales/dialogs/te.json +3 -0
- package/locales/dialogs/th.json +3 -0
- package/locales/dialogs/tl.json +3 -0
- package/locales/dialogs/tr.json +3 -0
- package/locales/dialogs/uk.json +3 -0
- package/locales/dialogs/ur.json +3 -0
- package/locales/dialogs/vi.json +3 -0
- package/locales/dialogs/yo.json +3 -0
- package/locales/dialogs/zh-Hans.json +3 -0
- package/locales/dialogs/zh-Hant.json +3 -0
- package/locales/documents/am.json +2 -0
- package/locales/documents/ar.json +2 -0
- package/locales/documents/bg.json +2 -0
- package/locales/documents/bn.json +2 -0
- package/locales/documents/br.json +2 -0
- package/locales/documents/co.json +2 -0
- package/locales/documents/cs.json +2 -0
- package/locales/documents/da.json +2 -0
- package/locales/documents/de.json +2 -0
- package/locales/documents/el.json +2 -0
- package/locales/documents/en.json +2 -0
- package/locales/documents/es.json +2 -0
- package/locales/documents/fa.json +2 -0
- package/locales/documents/fi.json +2 -0
- package/locales/documents/fr-CA.json +2 -0
- package/locales/documents/fr.json +2 -0
- package/locales/documents/ha.json +2 -0
- package/locales/documents/he.json +2 -0
- package/locales/documents/hi.json +2 -0
- package/locales/documents/hr.json +2 -0
- package/locales/documents/hu.json +2 -0
- package/locales/documents/id.json +2 -0
- package/locales/documents/it.json +2 -0
- package/locales/documents/ja.json +2 -0
- package/locales/documents/ko.json +2 -0
- package/locales/documents/mr.json +2 -0
- package/locales/documents/ms.json +2 -0
- package/locales/documents/nl.json +2 -0
- package/locales/documents/pl.json +2 -0
- package/locales/documents/pt.json +2 -0
- package/locales/documents/ro.json +2 -0
- package/locales/documents/ru.json +2 -0
- package/locales/documents/sk.json +2 -0
- package/locales/documents/sv.json +2 -0
- package/locales/documents/sw.json +2 -0
- package/locales/documents/ta.json +2 -0
- package/locales/documents/te.json +2 -0
- package/locales/documents/th.json +2 -0
- package/locales/documents/tl.json +2 -0
- package/locales/documents/tr.json +2 -0
- package/locales/documents/uk.json +2 -0
- package/locales/documents/ur.json +2 -0
- package/locales/documents/vi.json +2 -0
- package/locales/documents/yo.json +2 -0
- package/locales/documents/zh-Hans.json +2 -0
- package/locales/documents/zh-Hant.json +2 -0
- package/locales/el.json +5 -1
- package/locales/en.json +5 -1
- package/locales/es.json +5 -1
- package/locales/fa.json +5 -1
- package/locales/fi.json +5 -1
- package/locales/fr-CA.json +6 -2
- package/locales/fr.json +6 -2
- package/locales/games/am.json +16 -0
- package/locales/games/ar.json +16 -0
- package/locales/games/bg.json +16 -0
- package/locales/games/bn.json +16 -0
- package/locales/games/br.json +16 -0
- package/locales/games/co.json +16 -0
- package/locales/games/cs.json +16 -0
- package/locales/games/da.json +16 -0
- package/locales/games/de.json +16 -0
- package/locales/games/el.json +16 -0
- package/locales/games/en.json +16 -0
- package/locales/games/es.json +16 -0
- package/locales/games/fa.json +16 -0
- package/locales/games/fi.json +16 -0
- package/locales/games/fr-CA.json +16 -0
- package/locales/games/fr.json +16 -0
- package/locales/games/ha.json +16 -0
- package/locales/games/he.json +16 -0
- package/locales/games/hi.json +16 -0
- package/locales/games/hr.json +16 -0
- package/locales/games/hu.json +16 -0
- package/locales/games/id.json +16 -0
- package/locales/games/it.json +16 -0
- package/locales/games/ja.json +16 -0
- package/locales/games/ko.json +16 -0
- package/locales/games/mr.json +16 -0
- package/locales/games/ms.json +16 -0
- package/locales/games/nl.json +16 -0
- package/locales/games/pl.json +16 -0
- package/locales/games/pt.json +16 -0
- package/locales/games/ro.json +16 -0
- package/locales/games/ru.json +16 -0
- package/locales/games/sk.json +16 -0
- package/locales/games/sv.json +16 -0
- package/locales/games/sw.json +16 -0
- package/locales/games/ta.json +16 -0
- package/locales/games/te.json +16 -0
- package/locales/games/th.json +16 -0
- package/locales/games/tl.json +16 -0
- package/locales/games/tr.json +16 -0
- package/locales/games/uk.json +16 -0
- package/locales/games/ur.json +16 -0
- package/locales/games/vi.json +16 -0
- package/locales/games/yo.json +16 -0
- package/locales/games/zh-Hans.json +16 -0
- package/locales/games/zh-Hant.json +16 -0
- package/locales/ha.json +5 -1
- package/locales/he.json +5 -1
- package/locales/hi.json +5 -1
- package/locales/hr.json +5 -1
- package/locales/hu.json +5 -1
- package/locales/id.json +5 -1
- package/locales/interactive/am.json +3 -1
- package/locales/interactive/ar.json +3 -1
- package/locales/interactive/bg.json +3 -1
- package/locales/interactive/bn.json +3 -1
- package/locales/interactive/br.json +3 -1
- package/locales/interactive/co.json +3 -1
- package/locales/interactive/cs.json +3 -1
- package/locales/interactive/da.json +3 -1
- package/locales/interactive/de.json +3 -1
- package/locales/interactive/el.json +3 -1
- package/locales/interactive/en.json +3 -1
- package/locales/interactive/es.json +3 -1
- package/locales/interactive/fa.json +3 -1
- package/locales/interactive/fi.json +3 -1
- package/locales/interactive/fr-CA.json +3 -1
- package/locales/interactive/fr.json +3 -1
- package/locales/interactive/ha.json +3 -1
- package/locales/interactive/he.json +3 -1
- package/locales/interactive/hi.json +3 -1
- package/locales/interactive/hr.json +3 -1
- package/locales/interactive/hu.json +3 -1
- package/locales/interactive/id.json +3 -1
- package/locales/interactive/it.json +3 -1
- package/locales/interactive/ja.json +3 -1
- package/locales/interactive/ko.json +3 -1
- package/locales/interactive/mr.json +3 -1
- package/locales/interactive/ms.json +3 -1
- package/locales/interactive/nl.json +3 -1
- package/locales/interactive/pl.json +3 -1
- package/locales/interactive/pt.json +3 -1
- package/locales/interactive/ro.json +3 -1
- package/locales/interactive/ru.json +3 -1
- package/locales/interactive/sk.json +3 -1
- package/locales/interactive/sv.json +3 -1
- package/locales/interactive/sw.json +3 -1
- package/locales/interactive/ta.json +3 -1
- package/locales/interactive/te.json +3 -1
- package/locales/interactive/th.json +3 -1
- package/locales/interactive/tl.json +3 -1
- package/locales/interactive/tr.json +3 -1
- package/locales/interactive/uk.json +3 -1
- package/locales/interactive/ur.json +3 -1
- package/locales/interactive/vi.json +3 -1
- package/locales/interactive/yo.json +3 -1
- package/locales/interactive/zh-Hans.json +3 -1
- package/locales/interactive/zh-Hant.json +3 -1
- package/locales/it.json +5 -1
- package/locales/ja.json +5 -1
- package/locales/ko.json +5 -1
- package/locales/made/am.json +1 -0
- package/locales/made/ar.json +1 -0
- package/locales/made/bg.json +1 -0
- package/locales/made/bn.json +1 -0
- package/locales/made/br.json +1 -0
- package/locales/made/co.json +1 -0
- package/locales/made/cs.json +1 -0
- package/locales/made/da.json +1 -0
- package/locales/made/de.json +1 -0
- package/locales/made/el.json +1 -0
- package/locales/made/en.json +1 -0
- package/locales/made/es.json +1 -0
- package/locales/made/fa.json +1 -0
- package/locales/made/fi.json +1 -0
- package/locales/made/fr-CA.json +1 -0
- package/locales/made/fr.json +1 -0
- package/locales/made/ha.json +1 -0
- package/locales/made/he.json +1 -0
- package/locales/made/hi.json +1 -0
- package/locales/made/hr.json +1 -0
- package/locales/made/hu.json +1 -0
- package/locales/made/id.json +1 -0
- package/locales/made/it.json +1 -0
- package/locales/made/ja.json +1 -0
- package/locales/made/ko.json +1 -0
- package/locales/made/mr.json +1 -0
- package/locales/made/ms.json +1 -0
- package/locales/made/nl.json +1 -0
- package/locales/made/pl.json +1 -0
- package/locales/made/pt.json +1 -0
- package/locales/made/ro.json +1 -0
- package/locales/made/ru.json +1 -0
- package/locales/made/sk.json +1 -0
- package/locales/made/sv.json +1 -0
- package/locales/made/sw.json +1 -0
- package/locales/made/ta.json +1 -0
- package/locales/made/te.json +1 -0
- package/locales/made/th.json +1 -0
- package/locales/made/tl.json +1 -0
- package/locales/made/tr.json +1 -0
- package/locales/made/uk.json +1 -0
- package/locales/made/ur.json +1 -0
- package/locales/made/vi.json +1 -0
- package/locales/made/yo.json +1 -0
- package/locales/made/zh-Hans.json +1 -0
- package/locales/made/zh-Hant.json +1 -0
- package/locales/mr.json +5 -1
- package/locales/ms.json +5 -1
- package/locales/nl.json +5 -1
- package/locales/pl.json +5 -1
- package/locales/pt.json +5 -1
- package/locales/ro.json +5 -1
- package/locales/routines/am.json +9 -0
- package/locales/routines/ar.json +9 -0
- package/locales/routines/bg.json +9 -0
- package/locales/routines/bn.json +9 -0
- package/locales/routines/br.json +9 -0
- package/locales/routines/co.json +9 -0
- package/locales/routines/cs.json +9 -0
- package/locales/routines/da.json +9 -0
- package/locales/routines/de.json +9 -0
- package/locales/routines/el.json +9 -0
- package/locales/routines/en.json +9 -0
- package/locales/routines/es.json +9 -0
- package/locales/routines/fa.json +9 -0
- package/locales/routines/fi.json +9 -0
- package/locales/routines/fr-CA.json +9 -0
- package/locales/routines/fr.json +9 -0
- package/locales/routines/ha.json +9 -0
- package/locales/routines/he.json +9 -0
- package/locales/routines/hi.json +9 -0
- package/locales/routines/hr.json +9 -0
- package/locales/routines/hu.json +9 -0
- package/locales/routines/id.json +9 -0
- package/locales/routines/it.json +9 -0
- package/locales/routines/ja.json +9 -0
- package/locales/routines/ko.json +9 -0
- package/locales/routines/mr.json +9 -0
- package/locales/routines/ms.json +9 -0
- package/locales/routines/nl.json +9 -0
- package/locales/routines/pl.json +9 -0
- package/locales/routines/pt.json +9 -0
- package/locales/routines/ro.json +9 -0
- package/locales/routines/ru.json +9 -0
- package/locales/routines/sk.json +9 -0
- package/locales/routines/sv.json +9 -0
- package/locales/routines/sw.json +9 -0
- package/locales/routines/ta.json +9 -0
- package/locales/routines/te.json +9 -0
- package/locales/routines/th.json +9 -0
- package/locales/routines/tl.json +9 -0
- package/locales/routines/tr.json +9 -0
- package/locales/routines/uk.json +9 -0
- package/locales/routines/ur.json +9 -0
- package/locales/routines/vi.json +9 -0
- package/locales/routines/yo.json +9 -0
- package/locales/routines/zh-Hans.json +9 -0
- package/locales/routines/zh-Hant.json +9 -0
- package/locales/ru.json +5 -1
- package/locales/scores/am.json +11 -1
- package/locales/scores/ar.json +11 -1
- package/locales/scores/bg.json +11 -1
- package/locales/scores/bn.json +11 -1
- package/locales/scores/br.json +11 -1
- package/locales/scores/co.json +11 -1
- package/locales/scores/cs.json +11 -1
- package/locales/scores/da.json +11 -1
- package/locales/scores/de.json +11 -1
- package/locales/scores/el.json +11 -1
- package/locales/scores/en.json +11 -1
- package/locales/scores/es.json +11 -1
- package/locales/scores/fa.json +11 -1
- package/locales/scores/fi.json +11 -1
- package/locales/scores/fr-CA.json +11 -1
- package/locales/scores/fr.json +11 -1
- package/locales/scores/ha.json +11 -1
- package/locales/scores/he.json +11 -1
- package/locales/scores/hi.json +11 -1
- package/locales/scores/hr.json +11 -1
- package/locales/scores/hu.json +11 -1
- package/locales/scores/id.json +11 -1
- package/locales/scores/it.json +11 -1
- package/locales/scores/ja.json +11 -1
- package/locales/scores/ko.json +11 -1
- package/locales/scores/mr.json +11 -1
- package/locales/scores/ms.json +11 -1
- package/locales/scores/nl.json +11 -1
- package/locales/scores/pl.json +11 -1
- package/locales/scores/pt.json +11 -1
- package/locales/scores/ro.json +11 -1
- package/locales/scores/ru.json +11 -1
- package/locales/scores/sk.json +11 -1
- package/locales/scores/sv.json +11 -1
- package/locales/scores/sw.json +11 -1
- package/locales/scores/ta.json +11 -1
- package/locales/scores/te.json +11 -1
- package/locales/scores/th.json +11 -1
- package/locales/scores/tl.json +11 -1
- package/locales/scores/tr.json +11 -1
- package/locales/scores/uk.json +11 -1
- package/locales/scores/ur.json +11 -1
- package/locales/scores/vi.json +11 -1
- package/locales/scores/yo.json +11 -1
- package/locales/scores/zh-Hans.json +11 -1
- package/locales/scores/zh-Hant.json +11 -1
- package/locales/sk.json +5 -1
- package/locales/sv.json +5 -1
- package/locales/sw.json +5 -1
- package/locales/sync/am.json +1 -0
- package/locales/sync/ar.json +1 -0
- package/locales/sync/bg.json +1 -0
- package/locales/sync/bn.json +1 -0
- package/locales/sync/br.json +1 -0
- package/locales/sync/co.json +1 -0
- package/locales/sync/cs.json +1 -0
- package/locales/sync/da.json +1 -0
- package/locales/sync/de.json +1 -0
- package/locales/sync/el.json +1 -0
- package/locales/sync/en.json +1 -0
- package/locales/sync/es.json +1 -0
- package/locales/sync/fa.json +1 -0
- package/locales/sync/fi.json +1 -0
- package/locales/sync/fr-CA.json +1 -0
- package/locales/sync/fr.json +1 -0
- package/locales/sync/ha.json +1 -0
- package/locales/sync/he.json +1 -0
- package/locales/sync/hi.json +1 -0
- package/locales/sync/hr.json +1 -0
- package/locales/sync/hu.json +1 -0
- package/locales/sync/id.json +1 -0
- package/locales/sync/it.json +1 -0
- package/locales/sync/ja.json +1 -0
- package/locales/sync/ko.json +1 -0
- package/locales/sync/mr.json +1 -0
- package/locales/sync/ms.json +1 -0
- package/locales/sync/nl.json +1 -0
- package/locales/sync/pl.json +1 -0
- package/locales/sync/pt.json +1 -0
- package/locales/sync/ro.json +1 -0
- package/locales/sync/ru.json +1 -0
- package/locales/sync/sk.json +1 -0
- package/locales/sync/sv.json +1 -0
- package/locales/sync/sw.json +1 -0
- package/locales/sync/ta.json +1 -0
- package/locales/sync/te.json +1 -0
- package/locales/sync/th.json +1 -0
- package/locales/sync/tl.json +1 -0
- package/locales/sync/tr.json +1 -0
- package/locales/sync/uk.json +1 -0
- package/locales/sync/ur.json +1 -0
- package/locales/sync/vi.json +1 -0
- package/locales/sync/yo.json +1 -0
- package/locales/sync/zh-Hans.json +1 -0
- package/locales/sync/zh-Hant.json +1 -0
- package/locales/ta.json +5 -1
- package/locales/tables/am.json +9 -4
- package/locales/tables/ar.json +9 -4
- package/locales/tables/bg.json +9 -4
- package/locales/tables/bn.json +9 -4
- package/locales/tables/br.json +9 -4
- package/locales/tables/co.json +9 -4
- package/locales/tables/cs.json +9 -4
- package/locales/tables/da.json +9 -4
- package/locales/tables/de.json +9 -4
- package/locales/tables/el.json +9 -4
- package/locales/tables/en.json +9 -4
- package/locales/tables/es.json +9 -4
- package/locales/tables/fa.json +9 -4
- package/locales/tables/fi.json +9 -4
- package/locales/tables/fr-CA.json +9 -4
- package/locales/tables/fr.json +9 -4
- package/locales/tables/ha.json +9 -4
- package/locales/tables/he.json +9 -4
- package/locales/tables/hi.json +9 -4
- package/locales/tables/hr.json +9 -4
- package/locales/tables/hu.json +9 -4
- package/locales/tables/id.json +9 -4
- package/locales/tables/it.json +9 -4
- package/locales/tables/ja.json +9 -4
- package/locales/tables/ko.json +9 -4
- package/locales/tables/mr.json +9 -4
- package/locales/tables/ms.json +9 -4
- package/locales/tables/nl.json +9 -4
- package/locales/tables/pl.json +9 -4
- package/locales/tables/pt.json +9 -4
- package/locales/tables/ro.json +9 -4
- package/locales/tables/ru.json +9 -4
- package/locales/tables/sk.json +9 -4
- package/locales/tables/sv.json +9 -4
- package/locales/tables/sw.json +9 -4
- package/locales/tables/ta.json +9 -4
- package/locales/tables/te.json +9 -4
- package/locales/tables/th.json +9 -4
- package/locales/tables/tl.json +9 -4
- package/locales/tables/tr.json +9 -4
- package/locales/tables/uk.json +9 -4
- package/locales/tables/ur.json +9 -4
- package/locales/tables/vi.json +9 -4
- package/locales/tables/yo.json +9 -4
- package/locales/tables/zh-Hans.json +9 -4
- package/locales/tables/zh-Hant.json +9 -4
- package/locales/te.json +5 -1
- package/locales/th.json +5 -1
- package/locales/tl.json +5 -1
- package/locales/tr.json +5 -1
- package/locales/uk.json +5 -1
- package/locales/ur.json +5 -1
- package/locales/vi.json +5 -1
- package/locales/yo.json +5 -1
- package/locales/zh-Hans.json +5 -1
- package/locales/zh-Hant.json +5 -1
- package/package.json +1 -1
- package/ui/caps.js +6 -4
- package/ui/csp.js +1 -1
- package/ui/export.js +9 -3
- package/ui/icons.js +1 -0
- package/ui/looks/classic.css +2 -1
- package/ui/looks/human.css +6 -8
- package/ui/looks/minimal.css +1 -1
- package/ui/style.css +14 -9
- package/ui/view.css +1 -1
- package/ui/view.js +5 -3
- package/vendor/LICENSES/babylonjs-core.txt +71 -0
- package/vendor/LICENSES/eventemitter3.txt +21 -0
- package/vendor/LICENSES/maplibre-gl.txt +1 -1
- package/vendor/LICENSES/phaser.txt +20 -0
- package/vendor/LICENSES/zzfx.txt +21 -0
- package/vendor/abcjs/abcjs.mjs +2 -2
- package/vendor/babylon/babylon.mjs +8122 -0
- package/vendor/maplibre/maplibre-gl-worker.js +3 -3
- package/vendor/maplibre/maplibre-gl.css +1 -1
- package/vendor/maplibre/maplibre-gl.mjs +37 -37
- package/vendor/marked.esm.js +40 -38
- package/vendor/ooxml/abort-JztSoyw2.js +8 -0
- package/vendor/ooxml/{hyperlink-Cxzhet30.js → bounded-raw-part-cache-B8t03tSP.js} +4460 -7080
- package/vendor/ooxml/bundled-asset-url-BMJ8vNHP.js +13 -0
- package/vendor/ooxml/canvas-viewer-mechanics-DI38gHNV.js +653 -0
- package/vendor/ooxml/cfb-guard-BIaHdonq.js +516 -0
- package/vendor/ooxml/{chunk-DmhlhrBa.js → chunk-D5OxutzX.js} +0 -2
- package/vendor/ooxml/comment-overlay-controller-Crm5Syhx.js +974 -0
- package/vendor/ooxml/{comment-ui-runtime-CWGqn5Vr.js → comment-ui-runtime-BfEPgl5r.js} +5 -7
- package/vendor/ooxml/comment-ui-runtime-BtP_TpvT.js +2 -0
- package/vendor/ooxml/{comment-ui-runtime-DcJOYlw-.js → comment-ui-runtime-hfewTmVJ.js} +5 -7
- package/vendor/ooxml/delimited-text-worker-host-RwvuSsP2.js +21 -0
- package/vendor/ooxml/document-model-source-BUTSwkyP.js +247 -0
- package/vendor/ooxml/document-pull-client-C_D779tO.js +36230 -0
- package/vendor/ooxml/docx-BfLZeiwa.js +3509 -0
- package/vendor/ooxml/docx.mjs +7 -7
- package/vendor/ooxml/docx_parser_bg.wasm +0 -0
- package/vendor/ooxml/drawingml-shape-BcXkRayC.js +306 -0
- package/vendor/ooxml/duotone-BI7CoghW.js +122 -0
- package/vendor/ooxml/emf-DgUBx9BU.js +1788 -0
- package/vendor/ooxml/font-preload-demand-B6HPFxDp.js +2052 -0
- package/vendor/ooxml/graph.json +1 -1
- package/vendor/ooxml/grid-geometry-CqTDvpDr.js +379 -0
- package/vendor/ooxml/host-layout-Cz_lCuTZ.js +55 -0
- package/vendor/ooxml/line-distribute-DR9Qwd3u.js +2783 -0
- package/vendor/ooxml/{mathjax-DoyWZbSp.js → mathjax-DvwccQ8e.js} +0 -2
- package/vendor/ooxml/model-source-COXegBNA.js +177 -0
- package/vendor/ooxml/{pixel-budget-9P63Bsk5.js → pixel-budget-DI82Hn3R.js} +13 -12
- package/vendor/ooxml/plot-area-frame-D3JtHvov.js +41645 -0
- package/vendor/ooxml/pptx-CfCiVlNB.js +2888 -0
- package/vendor/ooxml/pptx.mjs +8 -7
- package/vendor/ooxml/pptx_parser_bg.wasm +0 -0
- package/vendor/ooxml/presentation-model-source-DL6duh5l.js +75 -0
- package/vendor/ooxml/raster-target-Ca3tyA0L.js +40 -0
- package/vendor/ooxml/{read-only-comment-decoration-Dz7eTQ4d.js → read-only-comment-decoration-B06YO2zk.js} +0 -4
- package/vendor/ooxml/{read-only-comment-margin-DkgzASAl.js → read-only-comment-margin-Ee9Y6vPg.js} +0 -2
- package/vendor/ooxml/renderer-IFuBkPvF.js +5197 -0
- package/vendor/ooxml/{renderer-module-contract-D91rkYHH.js → renderer-module-contract-BuTx2FWJ.js} +0 -2
- package/vendor/ooxml/renderer-xdugdcMd.js +5769 -0
- package/vendor/ooxml/resource-measurement-D2bu0Qfx.js +756 -0
- package/vendor/ooxml/slide-pull-client-BUuJQQVE.js +6431 -0
- package/vendor/ooxml/three-d-ByHGsYrX.js +868 -0
- package/vendor/ooxml/tiff-contract-DEd8CGuz.js +48 -0
- package/vendor/ooxml/{visible-index-BgiHEc1z.js → visible-index-vN-4BNn7.js} +0 -2
- package/vendor/ooxml/workbook-model-source-DBfVsWj7.js +92 -0
- package/vendor/ooxml/worker-source-C29EQNUj.js +18 -0
- package/vendor/ooxml/worker-source-D3NwPe6l.js +18 -0
- package/vendor/ooxml/worker-source-ZQE9C1j6.js +18 -0
- package/vendor/ooxml/worksheet-pull-client-Du0MuIro.js +565 -0
- package/vendor/ooxml/xlsx-CCMRAxPB.js +5812 -0
- package/vendor/ooxml/xlsx.mjs +8 -7
- package/vendor/ooxml/xlsx_parser_bg.wasm +0 -0
- package/vendor/pele/chunks/2CHDFZHC.js +1 -0
- package/vendor/pele/chunks/{GAP5KXLD.js → 2S3JPEOY.js} +1 -1
- package/vendor/pele/chunks/2U463FD2.js +11 -0
- package/vendor/pele/chunks/3OKCTCH7.js +1 -0
- package/vendor/pele/chunks/42UK3TL6.js +8 -0
- package/vendor/pele/chunks/43YPWK3Q.js +1 -0
- package/vendor/pele/chunks/45MVAN6X.js +1 -0
- package/vendor/pele/chunks/46GJKBLZ.js +1 -0
- package/vendor/pele/chunks/4WR52FRP.js +4 -0
- package/vendor/pele/chunks/63WH7YNF.js +1 -0
- package/vendor/pele/chunks/{2TH3V34D.js → 673H7YBG.js} +1 -1
- package/vendor/pele/chunks/6DDU7VKX.js +1 -0
- package/vendor/pele/chunks/{3MKGV5HX.js → 6Y6FML25.js} +1 -1
- package/vendor/pele/chunks/{4AG6A4TK.js → 7HQPULDG.js} +1 -1
- package/vendor/pele/chunks/7N3VAIG2.js +2 -0
- package/vendor/pele/chunks/{QFOMM5LR.js → 7NY54ILO.js} +1 -1
- package/vendor/pele/chunks/{VHJMZXCQ.js → BJNHMTN6.js} +1 -1
- package/vendor/pele/chunks/{6PEWY3TN.js → BK7N5KMP.js} +1 -1
- package/vendor/pele/chunks/CLQLV5VT.js +1 -0
- package/vendor/pele/chunks/CUSPXG5M.js +1 -0
- package/vendor/pele/chunks/D3L7O4X2.js +1 -0
- package/vendor/pele/chunks/{D4V2MWCI.js → D5TW5CPZ.js} +1 -1
- package/vendor/pele/chunks/DDVFZY3L.js +7 -0
- package/vendor/pele/chunks/{3S2YGJBL.js → DO6ND2WD.js} +5 -5
- package/vendor/pele/chunks/EGADTWYV.js +1 -0
- package/vendor/pele/chunks/EI4VGK5C.js +4 -0
- package/vendor/pele/chunks/EOJSJZXM.js +1 -0
- package/vendor/pele/chunks/F4O23KYR.js +5 -0
- package/vendor/pele/chunks/G2OEIG6X.js +1 -0
- package/vendor/pele/chunks/GER2CN75.js +2 -0
- package/vendor/pele/chunks/{RGVCULFG.js → GP5YUCAR.js} +1 -1
- package/vendor/pele/chunks/GXJ2T77W.js +1 -0
- package/vendor/pele/chunks/HX3UMAK7.js +1 -0
- package/vendor/pele/chunks/IU7WZTP6.js +4 -0
- package/vendor/pele/chunks/J3JF2HV4.js +12 -0
- package/vendor/pele/chunks/J5J2NR2G.js +1 -0
- package/vendor/pele/chunks/JRCWTJEL.js +1 -0
- package/vendor/pele/chunks/{M7II5KMO.js → K2ZHGJKH.js} +1 -1
- package/vendor/pele/chunks/{E3FWOBN4.js → KHUP5TOH.js} +3 -3
- package/vendor/pele/chunks/L74FQTH5.js +1 -0
- package/vendor/pele/chunks/LAV4ZXOS.js +1 -0
- package/vendor/pele/chunks/LBIZYCRR.js +1 -0
- package/vendor/pele/chunks/LFFXNLRS.js +1 -0
- package/vendor/pele/chunks/LJ44NU43.js +3 -0
- package/vendor/pele/chunks/LLLWOAQD.js +1 -0
- package/vendor/pele/chunks/LTY5LMQH.js +5 -0
- package/vendor/pele/chunks/LTYQZ5U5.js +1 -0
- package/vendor/pele/chunks/MJBOF5Q6.js +2 -0
- package/vendor/pele/chunks/NDSCUZ25.js +1 -0
- package/vendor/pele/chunks/NMN3IKWL.js +1 -0
- package/vendor/pele/chunks/NMUA3R2D.js +1 -0
- package/vendor/pele/chunks/NY5A6PPW.js +1 -0
- package/vendor/pele/chunks/O3ACPFEJ.js +8 -0
- package/vendor/pele/chunks/{A6VFOGAO.js → O4MQT6AV.js} +1 -1
- package/vendor/pele/chunks/{DUZNPW7S.js → OHJ2EJXK.js} +1 -1
- package/vendor/pele/chunks/OU2GIT2H.js +1 -0
- package/vendor/pele/chunks/{E65FQMJL.js → PDMLSE6I.js} +1 -1
- package/vendor/pele/chunks/PJ7X32S5.js +1 -0
- package/vendor/pele/chunks/RLLQ44NJ.js +1 -0
- package/vendor/pele/chunks/S6DWMCK5.js +1 -0
- package/vendor/pele/chunks/STIOTUT7.js +1 -0
- package/vendor/pele/chunks/{UO52YEYL.js → SXSLPWUD.js} +1 -1
- package/vendor/pele/chunks/TBJXKAT4.js +3 -0
- package/vendor/pele/chunks/TIVX74RS.js +2 -0
- package/vendor/pele/chunks/{KIF544NL.js → TK23BXEA.js} +1 -1
- package/vendor/pele/chunks/{STAXBNH4.js → TR4WJQGX.js} +1 -1
- package/vendor/pele/chunks/UWRPUF3N.js +1 -0
- package/vendor/pele/chunks/VMTWYMKQ.js +2 -0
- package/vendor/pele/chunks/VSWIZJ7B.js +1 -0
- package/vendor/pele/chunks/{STMK7JZH.js → W2WY5CQX.js} +2 -2
- package/vendor/pele/chunks/W77N5H3K.js +2 -0
- package/vendor/pele/chunks/WM7NR6YK.js +1 -0
- package/vendor/pele/chunks/WSTWNLCU.js +4 -0
- package/vendor/pele/chunks/WXKV2YEK.js +1 -0
- package/vendor/pele/chunks/XQ5S3AI3.js +13 -0
- package/vendor/pele/chunks/YNX532HU.js +1 -0
- package/vendor/pele/chunks/{DHKBVIA3.js → YUPSMAUO.js} +1 -1
- package/vendor/pele/chunks/{IHVFDU4A.js → YWXUFHC7.js} +7 -7
- package/vendor/pele/chunks/Z3ZRV7NH.js +2 -0
- package/vendor/pele/chunks/ZFRCZTLK.js +1 -0
- package/vendor/pele/chunks/ZZDR4CN3.js +1 -0
- package/vendor/pele/lazy.js +1 -1
- package/vendor/phaser/phaser.mjs +1 -0
- package/vendor/signals-core.mjs +1 -1
- package/vendor/spessasynth/fflate.mjs +1 -0
- package/vendor/spessasynth/spessasynth.mjs +37033 -15099
- package/vendor/temml/temml.mjs +1 -1
- package/vendor/zzfx/zzfx.mjs +1 -0
- package/vendor/ooxml/bounded-raw-part-cache-Cg1BsSZQ.js +0 -119
- package/vendor/ooxml/canvas-viewer-mechanics-DbLz0rYW.js +0 -1384
- package/vendor/ooxml/cjk-fallback-bLI3z70h.js +0 -46
- package/vendor/ooxml/comment-occurrence-C8Y2uoVr.js +0 -6
- package/vendor/ooxml/comment-ui-runtime-BsK8pmUT.js +0 -2
- package/vendor/ooxml/comments-Diid5ujN.js +0 -246
- package/vendor/ooxml/delimited-text-worker-host-BVY-Ecni.js +0 -25
- package/vendor/ooxml/document-pull-client-B9PTM-pL.js +0 -27280
- package/vendor/ooxml/docx-BF9WXrYH.js +0 -3101
- package/vendor/ooxml/dom-interaction-boundary-Cnm8DSBN.js +0 -223
- package/vendor/ooxml/highlight-rect-C5hkRqUr.js +0 -13
- package/vendor/ooxml/line-distribute-D1WNHKz_.js +0 -1023
- package/vendor/ooxml/line-metrics-B60C86uh.js +0 -60
- package/vendor/ooxml/plot-area-frame-DLTYKHNP.js +0 -4354
- package/vendor/ooxml/pptx-DkyYBYoL.js +0 -3063
- package/vendor/ooxml/raster-target-ojDdQizC.js +0 -91
- package/vendor/ooxml/renderer-B4GZb5We.js +0 -6492
- package/vendor/ooxml/resource-measurement-SHQCbkh2.js +0 -150
- package/vendor/ooxml/slide-pull-client-DiPnm240.js +0 -6253
- package/vendor/ooxml/source-key-DIJG8BA0.js +0 -42
- package/vendor/ooxml/three-d-DJBl8g8M.js +0 -1162
- package/vendor/ooxml/transfer-p6iCC2R7.js +0 -6
- package/vendor/ooxml/units-BzZ0gAxs.js +0 -4
- package/vendor/ooxml/worksheet-pull-client-BM8ywvbu.js +0 -458
- package/vendor/ooxml/xlsx-C9NVjgaV.js +0 -8482
- package/vendor/pele/chunks/23I4SOAX.js +0 -1
- package/vendor/pele/chunks/25ITEZ43.js +0 -2
- package/vendor/pele/chunks/26H2HVXD.js +0 -1
- package/vendor/pele/chunks/2IZ5MNOH.js +0 -1
- package/vendor/pele/chunks/2P3CZEXH.js +0 -1
- package/vendor/pele/chunks/3E5HRNYT.js +0 -1
- package/vendor/pele/chunks/3JIRLDUO.js +0 -1
- package/vendor/pele/chunks/5MJ3UKSG.js +0 -1
- package/vendor/pele/chunks/63N73SV4.js +0 -1
- package/vendor/pele/chunks/A255FCTW.js +0 -1
- package/vendor/pele/chunks/AM43MQ64.js +0 -1
- package/vendor/pele/chunks/AOZTNTMC.js +0 -1
- package/vendor/pele/chunks/AQNLM6KG.js +0 -1
- package/vendor/pele/chunks/BNU2RHQB.js +0 -1
- package/vendor/pele/chunks/C5HTQT3I.js +0 -4
- package/vendor/pele/chunks/CPKRWH5G.js +0 -1
- package/vendor/pele/chunks/CPRVZL76.js +0 -11
- package/vendor/pele/chunks/CUVCMPQX.js +0 -1
- package/vendor/pele/chunks/D6K5RLPD.js +0 -5
- package/vendor/pele/chunks/EENBF6R3.js +0 -5
- package/vendor/pele/chunks/G3OATVW2.js +0 -1
- package/vendor/pele/chunks/GFBBR3DD.js +0 -13
- package/vendor/pele/chunks/IV52FOAS.js +0 -1
- package/vendor/pele/chunks/JTJEEBDN.js +0 -1
- package/vendor/pele/chunks/JX3HYMZ6.js +0 -8
- package/vendor/pele/chunks/K3TAFXGN.js +0 -3
- package/vendor/pele/chunks/K7FUICZ3.js +0 -1
- package/vendor/pele/chunks/LHH2HHRB.js +0 -1
- package/vendor/pele/chunks/LT5IS45C.js +0 -2
- package/vendor/pele/chunks/MSPQPZZY.js +0 -1
- package/vendor/pele/chunks/NY2EJWPH.js +0 -2
- package/vendor/pele/chunks/OB6ZFVKF.js +0 -1
- package/vendor/pele/chunks/OJBDHQO2.js +0 -4
- package/vendor/pele/chunks/PLTZDMI2.js +0 -1
- package/vendor/pele/chunks/R7EPXMMD.js +0 -1
- package/vendor/pele/chunks/S4GSSVLN.js +0 -3
- package/vendor/pele/chunks/SPBWZ4VS.js +0 -1
- package/vendor/pele/chunks/SR7OOV3Q.js +0 -1
- package/vendor/pele/chunks/STXEMZPJ.js +0 -2
- package/vendor/pele/chunks/SXFARSFO.js +0 -1
- package/vendor/pele/chunks/TC77ISAL.js +0 -1
- package/vendor/pele/chunks/TXE3YXUM.js +0 -2
- package/vendor/pele/chunks/TYIQQHVC.js +0 -1
- package/vendor/pele/chunks/TZUXETIT.js +0 -1
- package/vendor/pele/chunks/U7N72BGE.js +0 -1
- package/vendor/pele/chunks/UFPIB6EZ.js +0 -1
- package/vendor/pele/chunks/V52Z4AG3.js +0 -4
- package/vendor/pele/chunks/VBDLARNP.js +0 -4
- package/vendor/pele/chunks/VIK3ONSK.js +0 -1
- package/vendor/pele/chunks/VPGC3RUM.js +0 -7
- package/vendor/pele/chunks/VVVO4ZVP.js +0 -1
- package/vendor/pele/chunks/WRGXZO53.js +0 -1
- package/vendor/pele/chunks/X5SG7MGC.js +0 -1
- package/vendor/pele/chunks/XXYPNCD5.js +0 -1
- package/vendor/pele/chunks/XZO3CX7R.js +0 -12
- package/vendor/pele/chunks/YZBJM2QT.js +0 -2
- package/vendor/pele/chunks/YZHV477W.js +0 -2
- package/vendor/pele/chunks/Z6WRYFJC.js +0 -1
- package/vendor/pele/chunks/ZI2QNEGF.js +0 -8
package/brand.js
CHANGED
|
@@ -11,4 +11,5 @@ export const PAGES = Object.freeze({
|
|
|
11
11
|
help: { en: 'help', fr: 'fr/aide' },
|
|
12
12
|
'help/key-refused': { en: 'help/key-refused', fr: 'fr/aide/cle-refusee' },
|
|
13
13
|
'help/couldnt-reach': { en: 'help/couldnt-reach', fr: 'fr/aide/injoignable' },
|
|
14
|
+
'help/plan-stopped': { en: 'help/plan-stopped', fr: 'fr/aide/forfait-arrete' },
|
|
14
15
|
})
|
package/caps/files/office.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// Word, Excel and PowerPoint files as Office draws them (D183), in
|
|
1
|
+
// Word, Excel and PowerPoint files as Office draws them (D183), in a file's pane and the browser: by
|
|
2
2
|
// @silurus/ooxml, its parsers WebAssembly, its viewers drawing on a canvas, so nothing of the file
|
|
3
|
-
// becomes markup, in a frame of
|
|
3
|
+
// becomes markup, in a frame of a file pane's kind (an opaque origin with no network), in a page made
|
|
4
4
|
// here: modules as data: addresses under an import map, the parser and the file as data too.
|
|
5
5
|
import { encode } from '../../ui/seal.js'
|
|
6
6
|
import { t } from '../../core/i18n.js'
|
|
@@ -67,7 +67,7 @@ addEventListener('message', ({ source, data }) => { if (source === parent && dat
|
|
|
67
67
|
`
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* A page that draws a Word document, a workbook or a deck; a workbook in
|
|
70
|
+
* A page that draws a Word document, a workbook or a deck; a workbook in its pane has cells to change,
|
|
71
71
|
* shown where it was looked at. @param {string} ext docx, xlsx or pptx @param {Uint8Array} bytes @param {string} name
|
|
72
72
|
* @param {{ at?: Place }} [cells] @param {string} [words] what a citation points at, found and shown by the viewer's own find (D481): its longest line
|
|
73
73
|
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// A game's file (D648): `games/<ulid>-<slug>.game.html`, named once and never renamed, a page whose head holds Jean's facts (its
|
|
2
|
+
// format, engine, the actions it uses, author, when it was made and changed, whether it is pinned, the task it came from), its
|
|
3
|
+
// title its name, its body a picture of it being played and the design card, and the game itself as one module in an inert script,
|
|
4
|
+
// which only a game's frame runs. Changed by exact passages, each found once (replaceOnce, as `edit` changes a file). Pure.
|
|
5
|
+
|
|
6
|
+
export const PLACE = /^games\/[^/]+\.game\.html$/
|
|
7
|
+
export const ENGINES = ['phaser', 'babylon', 'none']
|
|
8
|
+
export const ACTIONS = ['left', 'right', 'up', 'down', 'a', 'b']
|
|
9
|
+
/** A picture of the game for its card, as its play-test or its first seconds played took it (./shell.js): WebP or JPEG, 200 KB at most. */
|
|
10
|
+
export const PICTURE = /^data:image\/(?:webp|jpeg);base64,[A-Za-z0-9+/]{100,266000}={0,2}$/
|
|
11
|
+
const KEYS = ['format', 'engine', 'actions', 'author', 'created', 'changed', 'pinned', 'source']
|
|
12
|
+
|
|
13
|
+
/** @typedef {{ format?: string, engine: string, actions: string, author: string, created: string, changed: string, pinned?: string, source?: string }} Meta */
|
|
14
|
+
/** @typedef {{ name: string, card: string, code: string, meta: Meta, picture?: string }} Game */
|
|
15
|
+
|
|
16
|
+
/** @param {string} text */
|
|
17
|
+
const escaped = (text) => text.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<')
|
|
18
|
+
/** @param {string} text */
|
|
19
|
+
const unescaped = (text) => text.replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&')
|
|
20
|
+
|
|
21
|
+
/** The page a game is kept as. @param {Game} game @param {string} lang */
|
|
22
|
+
export function fileOf({ name, card, code, meta, picture = '' }, lang) {
|
|
23
|
+
const facts = KEYS.flatMap((key) => (key === 'format' ? ['<meta name="format" content="1">'] : meta[/** @type {keyof Meta} */ (key)] ? [`<meta name="${key}" content="${escaped(String(meta[/** @type {keyof Meta} */ (key)]))}">`] : []))
|
|
24
|
+
return [`<!doctype html>\n<html lang="${escaped(lang)}">\n<meta charset="utf-8">`, ...facts, `<title>${escaped(name)}</title>`, ...(PICTURE.test(picture) ? [`<img id="picture" src="${picture}" alt="">`] : []),
|
|
25
|
+
`<article id="card" dir="auto">${escaped(card)}</article>`, `<script type="text/x-game" id="game">\n${code.replace(/<\/(script)/gi, '<\\/$1')}\n</script>\n`].join('\n')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** A game as its page holds it; null when it isn't one. @param {string} page @returns {Game | null} */
|
|
29
|
+
export function gameOf(page) {
|
|
30
|
+
const code = /<script type="text\/x-game" id="game">\n([\s\S]*)\n<\/script>/.exec(page)?.[1]
|
|
31
|
+
if (code === undefined) return null
|
|
32
|
+
const meta = /** @type {Meta} */ (Object.fromEntries([...page.matchAll(/<meta name="(\w+)" content="([^"]*)">/g)].filter(([, key]) => KEYS.includes(key)).map(([, key, value]) => [key, unescaped(value)])))
|
|
33
|
+
const picture = /<img id="picture" src="([^"]*)" alt="">\n<article id="card"/.exec(page)?.[1] ?? ''
|
|
34
|
+
return { name: unescaped(/<title>([^<]*)<\/title>/.exec(page)?.[1] ?? ''), card: unescaped(/<article id="card" dir="auto">([^<]*)<\/article>/.exec(page)?.[1] ?? ''),
|
|
35
|
+
code: code.replace(/<\\\/(script)/gi, '</$1'), meta: { ...meta, engine: ENGINES.includes(meta.engine) ? meta.engine : 'none' }, ...(PICTURE.test(picture) ? { picture } : {}) }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** A game's page with its picture, the one before gone; as it was when either isn't one. @param {string} page @param {string} picture */
|
|
39
|
+
export const pictured = (page, picture) => ((game) => (game && PICTURE.test(picture) ? fileOf({ ...game, picture }, /<html lang="([^"]*)">/.exec(page)?.[1] ?? 'en') : page))(gameOf(page))
|
|
40
|
+
|
|
41
|
+
/** The actions a game says it uses, those Jean knows, all of them when it says none. @param {unknown} list */
|
|
42
|
+
export const actionsOf = (list) => ((known) => (known.length ? known : ACTIONS))((Array.isArray(list) ? list : String(list ?? '').split(/[\s,]+/)).map(String).filter((one, i, all) => ACTIONS.includes(one) && all.indexOf(one) === i))
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The code with each passage replaced, each found once, or why one can't be.
|
|
46
|
+
* @param {string} code @param {{ old: string, new: string }[]} changes @returns {{ code: string } | { error: string }}
|
|
47
|
+
*/
|
|
48
|
+
export function replaceOnce(code, changes) {
|
|
49
|
+
for (const [i, change] of changes.entries()) {
|
|
50
|
+
const at = code.indexOf(change.old)
|
|
51
|
+
if (!change.old || at < 0) return { error: `Change ${i + 1}: its old passage isn't in the game, word for word.` }
|
|
52
|
+
if (code.indexOf(change.old, at + 1) >= 0) return { error: `Change ${i + 1}: its old passage is in the game more than once; give more of it.` }
|
|
53
|
+
code = code.slice(0, at) + change.new + code.slice(at + change.old.length)
|
|
54
|
+
}
|
|
55
|
+
return { code }
|
|
56
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* A game's frame (D648): written into its page with ./shell.js, never into Jean's. The game fills it; the cover, the bar and the
|
|
2
|
+
touch buttons sit over it, light on dark whatever the game draws. */
|
|
3
|
+
html, body { margin: 0; block-size: 100%; overflow: hidden; background: #0e0e14; color: #fff; font: 1rem/1.4 system-ui, sans-serif; }
|
|
4
|
+
#stage { position: fixed; inset: 0; display: grid; place-items: center; outline: none; }
|
|
5
|
+
#stage > canvas { max-inline-size: 100%; max-block-size: 100%; }
|
|
6
|
+
article { max-inline-size: 40rem; margin: auto; padding: 1rem; } article img { display: block; inline-size: 100%; border-radius: 0.75rem; }
|
|
7
|
+
button { font: inherit; color: inherit; border: 2px solid currentColor; border-radius: 0.75rem; background: rgb(255 255 255 / 0.14); padding: 0.6em 1.6em; cursor: pointer; touch-action: none; }
|
|
8
|
+
button:focus-visible { outline: 3px solid #f7c531; outline-offset: 2px; }
|
|
9
|
+
.cover { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1.25rem; padding: 1rem; text-align: center; background: rgb(8 8 12 / 0.8); }
|
|
10
|
+
.cover h1 { margin: 0; font-size: clamp(1.5rem, 6vw, 2.75rem); }
|
|
11
|
+
.bar { position: fixed; inset-block-start: 0.5rem; inset-inline-end: 0.5rem; display: flex; gap: 0.4rem; }
|
|
12
|
+
.bar button { inline-size: 2.5rem; block-size: 2.5rem; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgb(8 8 12 / 0.55); }
|
|
13
|
+
.bar svg { inline-size: 1.25rem; block-size: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
14
|
+
.bar [aria-pressed=true] { background: rgb(255 255 255 / 0.3); }
|
|
15
|
+
.pad { position: fixed; inset-inline: 0.75rem; inset-block-end: 0.75rem; display: none; justify-content: space-between; align-items: end; pointer-events: none; user-select: none; -webkit-user-select: none; }
|
|
16
|
+
.pad > div { display: grid; gap: 0.4rem; pointer-events: auto; }
|
|
17
|
+
.pad button { inline-size: 3.5rem; block-size: 3.5rem; padding: 0; border-radius: 50%; background: rgb(8 8 12 / 0.45); }
|
|
18
|
+
.arrows { grid-template-areas: ". up ." "left . right" ". down ."; }
|
|
19
|
+
.buttons { grid-auto-flow: column; }
|
|
20
|
+
[data-action=up] { grid-area: up; } [data-action=left] { grid-area: left; } [data-action=right] { grid-area: right; } [data-action=down] { grid-area: down; }
|
|
21
|
+
@media (pointer: coarse) { .pad { display: flex; } }
|
|
22
|
+
@media (forced-colors: active) { button { border-color: ButtonText; } }
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// A check in the condition of every `while`, `do … while` and classic `for` loop of a game's code (D648), so that a loop that never
|
|
2
|
+
// ends throws at its own line instead of freezing Jean, whose page shares its thread with a game's frame in WebKit. Strings,
|
|
3
|
+
// templates, comments and regular expressions are read past, `for … of` and `for … in` left alone, and nothing goes on a line of its
|
|
4
|
+
// own, so lines keep their numbers. Pure.
|
|
5
|
+
const WORD = /[\w$\u0080-]/
|
|
6
|
+
const START = /[A-Za-z_$\u0080-]/
|
|
7
|
+
const BEFORE_REGEX = new Set(['return', 'typeof', 'instanceof', 'in', 'of', 'new', 'delete', 'void', 'throw', 'case', 'do', 'else', 'yield', 'await'])
|
|
8
|
+
|
|
9
|
+
/** @typedef {{ type: 'word' | 'punct', value: string, start: number, end: number, dotted?: boolean }} Token */
|
|
10
|
+
|
|
11
|
+
/** The code's words and punctuation, what isn't code read past. @param {string} code */
|
|
12
|
+
export function tokens(code) {
|
|
13
|
+
const out = /** @type {Token[]} */ ([]), templates = /** @type {number[]} */ ([])
|
|
14
|
+
let i = 0, depth = 0, last = /** @type {{ type: string, value?: string } | null} */ (null)
|
|
15
|
+
const regexOk = () => !last || (last.type === 'punct' && !')]'.includes(last.value ?? '')) || (last.type === 'word' && BEFORE_REGEX.has(last.value ?? ''))
|
|
16
|
+
// A template's text, to its end or to an expression in it.
|
|
17
|
+
const chunk = () => {
|
|
18
|
+
for (; i < code.length; i++) {
|
|
19
|
+
if (code[i] === '\\') i++
|
|
20
|
+
else if (code[i] === '`') return void (i++, last = { type: 'string' })
|
|
21
|
+
else if (code[i] === '$' && code[i + 1] === '{') return void (i += 2, templates.push(depth++), last = { type: 'punct', value: '{' })
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
while (i < code.length) {
|
|
25
|
+
const c = code[i]
|
|
26
|
+
if (/\s/.test(c)) i++
|
|
27
|
+
else if (c === '/' && code[i + 1] === '/') i = code.includes('\n', i) ? code.indexOf('\n', i) : code.length
|
|
28
|
+
else if (c === '/' && code[i + 1] === '*') i = code.includes('*/', i + 2) ? code.indexOf('*/', i + 2) + 2 : code.length
|
|
29
|
+
else if (c === '"' || c === "'") {
|
|
30
|
+
for (i++; i < code.length && code[i] !== c && code[i] !== '\n'; i++) if (code[i] === '\\') i++
|
|
31
|
+
i++, last = { type: 'string' }
|
|
32
|
+
} else if (c === '`') i++, chunk()
|
|
33
|
+
else if (c === '/' && regexOk()) {
|
|
34
|
+
// To its closing slash, one in a set of characters ([/]) or escaped not closing it; then its flags.
|
|
35
|
+
for (let set = false; ++i < code.length && code[i] !== '\n' && (code[i] !== '/' || set);) {
|
|
36
|
+
if (code[i] === '\\') i++
|
|
37
|
+
else if (code[i] === '[') set = true
|
|
38
|
+
else if (code[i] === ']') set = false
|
|
39
|
+
}
|
|
40
|
+
for (i++; i < code.length && /[a-z]/i.test(code[i]); i++);
|
|
41
|
+
last = { type: 'regex' }
|
|
42
|
+
} else if (START.test(c)) {
|
|
43
|
+
const start = i
|
|
44
|
+
while (i < code.length && WORD.test(code[i])) i++
|
|
45
|
+
const value = code.slice(start, i)
|
|
46
|
+
out.push({ type: 'word', value, start, end: i, dotted: last?.type === 'punct' && last.value === '.' })
|
|
47
|
+
last = { type: 'word', value }
|
|
48
|
+
} else if (/[0-9]/.test(c) || (c === '.' && /[0-9]/.test(code[i + 1] ?? ''))) {
|
|
49
|
+
while (i < code.length && (WORD.test(code[i]) || code[i] === '.' || (/[eE]/.test(code[i - 1]) && /[+-]/.test(code[i])))) i++
|
|
50
|
+
last = { type: 'number' }
|
|
51
|
+
} else if (c === '}' && templates.length && templates.at(-1) === depth - 1) templates.pop(), depth--, i++, chunk()
|
|
52
|
+
else {
|
|
53
|
+
if (c === '{') depth++
|
|
54
|
+
if (c === '}') depth--
|
|
55
|
+
out.push({ type: 'punct', value: c, start: i, end: i + 1 })
|
|
56
|
+
last = { type: 'punct', value: c }
|
|
57
|
+
i++
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return out
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The code with `check` in every loop's condition. @param {string} code @param {string} check a call that returns true, or throws */
|
|
64
|
+
export function guard(code, check) {
|
|
65
|
+
const list = tokens(code), edits = /** @type {[number, string][]} */ ([])
|
|
66
|
+
for (const [k, word] of list.entries()) {
|
|
67
|
+
if (word.type !== 'word' || word.dotted || (word.value !== 'while' && word.value !== 'for')) continue
|
|
68
|
+
const open = k + (word.value === 'for' && list[k + 1]?.value === 'await' ? 2 : 1)
|
|
69
|
+
if (list[open]?.value !== '(') continue
|
|
70
|
+
let level = 0, close = -1
|
|
71
|
+
const semicolons = /** @type {number[]} */ ([])
|
|
72
|
+
for (let m = open; m < list.length && close < 0; m++) {
|
|
73
|
+
const { value } = list[m]
|
|
74
|
+
if ('([{'.includes(value)) level++
|
|
75
|
+
else if (')]}'.includes(value) && --level === 0) close = m
|
|
76
|
+
else if (value === ';' && level === 1) semicolons.push(m)
|
|
77
|
+
}
|
|
78
|
+
if (close < 0 || close === open + 1) continue
|
|
79
|
+
if (word.value === 'while') edits.push([list[open].end, `${check} && (`], [list[close].start, ')'])
|
|
80
|
+
else if (semicolons.length === 2) {
|
|
81
|
+
const [a, b] = semicolons
|
|
82
|
+
edits.push(...(b === a + 1 ? [/** @type {[number, string]} */ ([list[a].end, ` ${check}`])] : [/** @type {[number, string]} */ ([list[a].end, ` ${check} && (`]), /** @type {[number, string]} */ ([list[b].start, ')'])]))
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return edits.sort((x, y) => y[0] - x[0]).reduce((out, [at, text]) => out.slice(0, at) + text + out.slice(at), code)
|
|
86
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// A game's page (D648): its facts, the shell (./shell.js) and its styles, and the game, guarded (./guard.js). In a frame of Jean's
|
|
2
|
+
// (./frame.js) its engine is lent; as a page of its own, which Save gives and a task saved as a page or shared by link shows
|
|
3
|
+
// (ui/view.js), its engine is inside it: offline, its card where scripts don't run, and what it saves kept in the browser's storage
|
|
4
|
+
// where the page has one (a file opened), else for the visit.
|
|
5
|
+
import { pagePolicy } from '../../ui/csp.js'
|
|
6
|
+
import { still } from '../../ui/sheet.js'
|
|
7
|
+
import { t, locale, dir, useStrings } from '../../core/i18n.js'
|
|
8
|
+
import { guard } from './guard.js'
|
|
9
|
+
import { actionsOf, gameOf, PICTURE } from './file.js'
|
|
10
|
+
|
|
11
|
+
/** What a game imports by name: its engine's, and ZzFX. */
|
|
12
|
+
export const LENT = /** @type {Record<string, string>} */ ({ phaser: '../../vendor/phaser/phaser.mjs', babylon: '../../vendor/babylon/babylon.mjs', zzfx: '../../vendor/zzfx/zzfx.mjs' })
|
|
13
|
+
/** The names a game imports. @param {{ meta: { engine: string } }} game */
|
|
14
|
+
export const lent = (game) => [game.meta.engine, 'zzfx'].filter((name) => Object.hasOwn(LENT, name))
|
|
15
|
+
const read = /** @type {Map<string, Promise<string>>} */ (new Map())
|
|
16
|
+
/** A file beside this module, read once. @param {string} path */
|
|
17
|
+
export const text = (path) => read.get(path) ?? /** @type {Promise<string>} */ (read.set(path, fetch(new URL(path, import.meta.url)).then((response) => response.text())).get(path))
|
|
18
|
+
const escaped = (/** @type {string} */ words) => words.replace(/&/g, '&').replace(/</g, '<').replace(/"/g, '"')
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A game's page. `imports`: its import map, none for a page whose `boot` makes its own; `head`, what its head starts with.
|
|
22
|
+
* @param {import('./file.js').Game} game
|
|
23
|
+
* @param {{ test?: { frames: number, seed: number, press: { action: string, from: number, to: number }[] } | null, saved?: { save: string | null, storage: Record<string, string> },
|
|
24
|
+
* imports?: Record<string, string> | null, head?: string, boot?: string }} [options]
|
|
25
|
+
*/
|
|
26
|
+
export async function pageOf(game, { test = null, saved = { save: null, storage: {} }, imports = null, head = '', boot = '' } = {}) {
|
|
27
|
+
const lang = locale.peek(), [shell, css] = await Promise.all([text('./shell.js'), text('./frame.css')])
|
|
28
|
+
const words = Object.fromEntries(['play', 'resume', 'paused', 'pause', 'mute', 'full', 'left', 'right', 'up', 'down'].map((key) => [key, t(`games.${key}`)]))
|
|
29
|
+
const given = JSON.stringify({ test, saved, words, actions: actionsOf(game.meta.actions), reduced: still(), title: game.name, pictured: Boolean(game.picture) }).replace(/</g, '\\u003c')
|
|
30
|
+
return /* html */ `<html lang="${lang}" dir="${dir(lang)}"><meta charset="utf-8">${head}${imports ? `<script type="importmap">${JSON.stringify({ imports })}</script>` : ''}<script>window.__game=${given}</script>${boot}<script>${shell}</script><style>${css}</style>
|
|
31
|
+
<body><noscript><article dir="auto">${game.picture && PICTURE.test(game.picture) ? `<img src="${game.picture}" alt="">` : ''}<h1>${escaped(game.name)}</h1><p>${escaped(game.card)}</p></article></noscript><div id="stage" tabindex="-1"></div><script type="text/x-game" id="game">${guard(game.code, '__loop()').replace(/<\/(script)/gi, '<\\/$1')}</script>`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A game's file as a page of its own: each engine as an inert script, made a module and mapped to its name before the shell runs,
|
|
36
|
+
* what it saves read from the browser's storage where it has one and written there as the shell sends it, motion as the user's
|
|
37
|
+
* Motion was when it was saved (D523). @param {string} file
|
|
38
|
+
*/
|
|
39
|
+
export async function alone(file) {
|
|
40
|
+
const game = gameOf(file)
|
|
41
|
+
if (!game) return file
|
|
42
|
+
await useStrings('games')
|
|
43
|
+
// An engine stays inert whatever it holds: "</script" and "<!--" written as JavaScript reads them the same.
|
|
44
|
+
const engines = await Promise.all(lent(game).map(async (name) => `<script type="text/x-engine" data-name="${name}">${(await text(LENT[name])).replace(/<(\/script|!--)/gi, '\\x3C$1')}</script>`))
|
|
45
|
+
const boot = `(()=>{const g=window.__game,key=${JSON.stringify(`game ${game.meta.created} ${game.name}`)},imports={};let store=null
|
|
46
|
+
try{store=localStorage;Object.assign(g.saved,JSON.parse(store.getItem(key)||'{}'))}catch{store=null}
|
|
47
|
+
for(const e of document.querySelectorAll('script[type="text/x-engine"]'))imports[e.dataset.name]=URL.createObjectURL(new Blob([e.textContent],{type:'text/javascript'}))
|
|
48
|
+
document.head.append(Object.assign(document.createElement('script'),{type:'importmap',textContent:JSON.stringify({imports})}))
|
|
49
|
+
if(parent===window&&store){const send=postMessage.bind(window);window.postMessage=(m,o)=>{if(m&&m.keep)try{store.setItem(key,JSON.stringify(m.keep))}catch{}send(m,o)}}})()`
|
|
50
|
+
const head = `<meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="Content-Security-Policy" content="${pagePolicy({ scripts: true, web: false, network: false, downloads: false, fullscreen: true, maps: false }, [], true)}"><title>${escaped(game.name)}</title>`
|
|
51
|
+
return `<!doctype html>${await pageOf(game, { head, boot: `${engines.join('')}<script>${boot}</script>` })}`
|
|
52
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
// A game's frame, around the game (D648): Jean's own script, written ahead of the game in its page (./frame.js), which runs in the
|
|
2
|
+
// frame alone, never in Jean's page. It owns the frame's clock (requestAnimationFrame, performance.now, Date and timers), so that a
|
|
3
|
+
// pause stops the game wherever it is, whatever its engine, and a play-test steps frames as fast as they come, through a
|
|
4
|
+
// MessageChannel that a frame out of sight or a tab behind another doesn't slow, the same frames each time from a seeded
|
|
5
|
+
// Math.random. It gives the game `host`: the element to draw in, six actions from the arrows or WASD, Space, Z or Enter (a),
|
|
6
|
+
// X or Shift (b), a gamepad or the buttons drawn on a touch screen, all sent as keys so that an engine's own input hears them too;
|
|
7
|
+
// ZzFX's sounds, silent when muted; what it saves (and localStorage, which an opaque frame lacks, kept with it); its moments and
|
|
8
|
+
// score; the user's language, direction and wish for less motion. To play, a cover to start it on a click, which gives the frame
|
|
9
|
+
// its sound and keys, pause when it loses the focus, mute and full screen; to test, a report of what each run showed (./report.js)
|
|
10
|
+
// and a picture of its last frame, for the game's card.
|
|
11
|
+
// A loop the guard (./guard.js) finds running a second throws at its line, since a frame shares Jean's thread in WebKit.
|
|
12
|
+
;(() => {
|
|
13
|
+
const win = /** @type {any} */ (window)
|
|
14
|
+
const given = /** @type {{ test: { frames: number, seed: number, press: { action: string, from: number, to: number }[] } | null, saved: { save: string | null, storage: Record<string, string> }, words: Record<string, string>, actions: string[], reduced: boolean, title: string, pictured: boolean }} */ (win.__game)
|
|
15
|
+
const { test, words } = given
|
|
16
|
+
const real = { now: performance.now.bind(performance), raf: requestAnimationFrame.bind(window), later: setTimeout.bind(window), clear: clearTimeout.bind(window) }
|
|
17
|
+
const post = (/** @type {Record<string, unknown>} */ message) => parent.postMessage(message, '*')
|
|
18
|
+
const report = { errors: /** @type {Record<string, unknown>[]} */ ([]), states: /** @type {[number, string][]} */ ([]), scores: /** @type {[number, number][]} */ ([]), violations: /** @type {string[]} */ ([]), alerts: /** @type {string[]} */ ([]), prints: /** @type {unknown[]} */ ([]), frames: 0 }
|
|
19
|
+
const work = /** @type {number[]} */ ([]), seen = new Set()
|
|
20
|
+
let url = '', stage = /** @type {HTMLElement} */ (document.body)
|
|
21
|
+
|
|
22
|
+
// What went wrong, at its line of the game when its stack says so.
|
|
23
|
+
const at = (/** @type {unknown} */ stack) => ((found) => (found ? { line: Number(found[1]), col: Number(found[2]) } : {}))(url && new RegExp(`${url.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}:(\\d+):(\\d+)`).exec(String(stack ?? '')))
|
|
24
|
+
/** @param {any} error @param {number} [line] @param {number} [col] */
|
|
25
|
+
const fault = (error, line, col) => { if (report.errors.length < 20) report.errors.push({ message: String(error?.message ?? error), name: error?.name, line, col, ...at(error?.stack), frame: report.frames }) }
|
|
26
|
+
const call = (/** @type {unknown} */ fn, /** @type {unknown[]} */ args) => { if (typeof fn === 'function') try { fn(...args) } catch (error) { fault(error) } }
|
|
27
|
+
addEventListener('error', (event) => fault(event.error ?? event.message, event.filename === url ? event.lineno : undefined, event.filename === url ? event.colno : undefined))
|
|
28
|
+
addEventListener('unhandledrejection', (event) => fault(event.reason))
|
|
29
|
+
document.addEventListener('securitypolicyviolation', (event) => report.violations.push(`${event.effectiveDirective} ${event.blockedURI}`))
|
|
30
|
+
for (const name of ['alert', 'confirm', 'prompt']) win[name] = (/** @type {unknown} */ text) => (report.alerts.push(String(text)), name === 'confirm' || null)
|
|
31
|
+
|
|
32
|
+
// The guard's check: a second without the frame's task ending, counted again from each task.
|
|
33
|
+
let loops = 0, since = 0, armed = false
|
|
34
|
+
const rearm = new MessageChannel()
|
|
35
|
+
rearm.port1.onmessage = () => { loops = 0; armed = false }
|
|
36
|
+
win.__loop = () => {
|
|
37
|
+
if (!armed) armed = true, since = real.now(), rearm.port2.postMessage(0)
|
|
38
|
+
if (++loops % 4096 === 0 && real.now() - since > 1000) throw new Error('A loop ran for a second without ending')
|
|
39
|
+
return true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// The clock, the same each run when testing.
|
|
43
|
+
let now = 0, running = false, paused = false, ids = 1e6
|
|
44
|
+
const start = test ? 1767225600000 : Date.now(), RealDate = Date
|
|
45
|
+
if (test) {
|
|
46
|
+
let seed = test.seed >>> 0 || 1
|
|
47
|
+
Math.random = () => { seed ^= seed << 13; seed >>>= 0; seed ^= seed >>> 17; seed ^= seed << 5; seed >>>= 0; return seed / 4294967296 }
|
|
48
|
+
Object.defineProperties(document, { hidden: { get: () => false }, visibilityState: { get: () => 'visible' } })
|
|
49
|
+
}
|
|
50
|
+
win.Date = class extends RealDate {
|
|
51
|
+
constructor(/** @type {any[]} */ ...args) { if (args.length) super(.../** @type {[any]} */ (args)); else super(start + now) }
|
|
52
|
+
static now() { return start + now }
|
|
53
|
+
}
|
|
54
|
+
performance.now = () => now
|
|
55
|
+
let frames = /** @type {Map<number, Function>} */ (new Map())
|
|
56
|
+
const timers = /** @type {Map<number, { at: number, every?: number, fn: unknown, args: unknown[] }>} */ (new Map())
|
|
57
|
+
win.requestAnimationFrame = (/** @type {Function} */ fn) => (frames.set(++ids, fn), ids)
|
|
58
|
+
win.cancelAnimationFrame = (/** @type {number} */ id) => frames.delete(id)
|
|
59
|
+
win.setTimeout = (/** @type {any} */ fn, ms = 0, /** @type {unknown[]} */ ...args) => (running ? (timers.set(++ids, { at: now + Math.max(0, Number(ms) || 0), fn, args }), ids) : real.later(fn, ms, ...args))
|
|
60
|
+
win.setInterval = (/** @type {unknown} */ fn, ms = 0, /** @type {unknown[]} */ ...args) => ((every) => (timers.set(++ids, { at: now + every, every, fn, args }), ids))(Math.max(1, Number(ms) || 0))
|
|
61
|
+
win.clearTimeout = win.clearInterval = (/** @type {number} */ id) => (id > 1e6 ? timers.delete(id) : real.clear(id))
|
|
62
|
+
const step = (/** @type {number} */ ms) => {
|
|
63
|
+
now += ms
|
|
64
|
+
for (const [id, timer] of [...timers]) if (timer.at <= now && timers.has(id)) { if (timer.every) timer.at += timer.every; else timers.delete(id); call(timer.fn, timer.args) }
|
|
65
|
+
const due = frames
|
|
66
|
+
frames = new Map()
|
|
67
|
+
for (const fn of due.values()) call(fn, [now])
|
|
68
|
+
pressed.clear()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Actions, from keys, and keys sent for them: by the tester, a gamepad or a touch screen's buttons.
|
|
72
|
+
const KEYS = /** @type {Record<string, [string, number, string]>} */ ({ left: ['ArrowLeft', 37, 'ArrowLeft'], right: ['ArrowRight', 39, 'ArrowRight'], up: ['ArrowUp', 38, 'ArrowUp'], down: ['ArrowDown', 40, 'ArrowDown'], a: ['Space', 32, ' '], b: ['KeyX', 88, 'x'], pause: ['KeyP', 80, 'p'] })
|
|
73
|
+
const OF = /** @type {Record<string, string>} */ ({ ArrowLeft: 'left', KeyA: 'left', ArrowRight: 'right', KeyD: 'right', ArrowUp: 'up', KeyW: 'up', ArrowDown: 'down', KeyS: 'down', Space: 'a', KeyZ: 'a', Enter: 'a', KeyX: 'b', ShiftLeft: 'b', ShiftRight: 'b', KeyP: 'pause', Escape: 'pause' })
|
|
74
|
+
const down = new Set(), pressed = new Set(), on = /** @type {Map<string, unknown[]>} */ (new Map())
|
|
75
|
+
addEventListener('keydown', (event) => {
|
|
76
|
+
const action = OF[event.code]
|
|
77
|
+
if (action === 'pause') return void (!event.repeat && toggle(!paused))
|
|
78
|
+
if (action && !down.has(action)) { pressed.add(action); for (const fn of on.get(action) ?? []) call(fn, []) }
|
|
79
|
+
if (action) down.add(action)
|
|
80
|
+
}, true)
|
|
81
|
+
addEventListener('keyup', (event) => { down.delete(OF[event.code]) }, true)
|
|
82
|
+
const send = (/** @type {string} */ type, /** @type {string} */ action) => {
|
|
83
|
+
const [code, which, key] = KEYS[action], event = new KeyboardEvent(type, { key, code, bubbles: true, cancelable: true })
|
|
84
|
+
Object.defineProperties(event, { keyCode: { get: () => which }, which: { get: () => which } })
|
|
85
|
+
;(document.activeElement ?? document.body).dispatchEvent(event)
|
|
86
|
+
}
|
|
87
|
+
let pads = new Set()
|
|
88
|
+
const poll = () => {
|
|
89
|
+
const held = new Set()
|
|
90
|
+
try {
|
|
91
|
+
for (const pad of navigator.getGamepads?.() ?? []) {
|
|
92
|
+
if (!pad) continue
|
|
93
|
+
const [x = 0, y = 0] = pad.axes, button = (/** @type {number} */ i) => pad.buttons[i]?.pressed
|
|
94
|
+
for (const [action, is] of /** @type {[string, boolean][]} */ ([['left', button(14) || x < -0.5], ['right', button(15) || x > 0.5], ['up', button(12) || y < -0.5], ['down', button(13) || y > 0.5], ['a', button(0)], ['b', button(1) || button(2)], ['pause', button(9)]])) if (is) held.add(action)
|
|
95
|
+
}
|
|
96
|
+
} catch {}
|
|
97
|
+
for (const action of held) if (!pads.has(action)) send('keydown', action)
|
|
98
|
+
for (const action of pads) if (!held.has(action)) send('keyup', action)
|
|
99
|
+
pads = held
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// What the game is given.
|
|
103
|
+
let saved = given.saved.save, muted = false
|
|
104
|
+
const store = new Map(Object.entries(given.saved.storage ?? {})), listeners = /** @type {Record<string, unknown[]>} */ ({ pause: [], resume: [] })
|
|
105
|
+
const keep = () => test || post({ keep: { save: saved, storage: Object.fromEntries(store) } })
|
|
106
|
+
const storage = { getItem: (/** @type {string} */ key) => store.get(String(key)) ?? null, setItem: (/** @type {string} */ key, /** @type {unknown} */ value) => (store.set(String(key), String(value)), keep()),
|
|
107
|
+
removeItem: (/** @type {string} */ key) => (store.delete(String(key)), keep()), clear: () => (store.clear(), keep()), key: (/** @type {number} */ i) => [...store.keys()][i] ?? null, get length() { return store.size } }
|
|
108
|
+
Object.defineProperty(window, 'localStorage', { value: storage, configurable: true })
|
|
109
|
+
let score = NaN
|
|
110
|
+
const LENT = 'zzfx'
|
|
111
|
+
win.host = {
|
|
112
|
+
get stage() { return stage },
|
|
113
|
+
input: { down: (/** @type {string} */ action) => down.has(action), pressed: (/** @type {string} */ action) => pressed.has(action), on: (/** @type {string} */ action, /** @type {unknown} */ fn) => void on.set(action, [...(on.get(action) ?? []), fn]) },
|
|
114
|
+
// ZzFX, lent as the engines are, by the page's import map.
|
|
115
|
+
sound: (/** @type {number[]} */ ...params) => void (muted || import(/** @type {string} */ (LENT)).then(({ zzfx, ZZFX }) => (ZZFX.audioContext.resume(), zzfx(...params)), (error) => fault(error))),
|
|
116
|
+
save: (/** @type {unknown} */ value) => { const json = JSON.stringify(value ?? null); if (json.length > 65536) throw new RangeError('A save holds 64 KB at most.'); saved = json; keep() },
|
|
117
|
+
load: () => JSON.parse(saved ?? 'null'),
|
|
118
|
+
state: (/** @type {unknown} */ name) => { report.states.push([Math.round(now), String(name)]); if (!test) post({ state: String(name) }) },
|
|
119
|
+
score: (/** @type {unknown} */ n) => { if (Number(n) !== score && report.scores.length < 500) report.scores.push([Math.round(now), (score = Number(n))]) },
|
|
120
|
+
on: (/** @type {string} */ name, /** @type {unknown} */ fn) => void listeners[name]?.push(fn),
|
|
121
|
+
reduced: given.reduced, lang: document.documentElement.lang, dir: document.documentElement.dir || 'ltr',
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// The words it draws, and a picture of the screen: the largest canvas read in the task that drew it, 160 × 90, by areas of 5 × 5;
|
|
125
|
+
// without one, the stage's markup.
|
|
126
|
+
for (const kind of [CanvasRenderingContext2D, win.OffscreenCanvasRenderingContext2D].filter(Boolean)) {
|
|
127
|
+
const fill = kind.prototype.fillText
|
|
128
|
+
kind.prototype.fillText = function (/** @type {unknown} */ text, /** @type {unknown[]} */ ...rest) { if (seen.size < 200) seen.add(String(text)); return fill.call(this, text, ...rest) }
|
|
129
|
+
}
|
|
130
|
+
const pen = new OffscreenCanvas(160, 90).getContext('2d', { willReadFrequently: true })
|
|
131
|
+
const largest = () => [...document.querySelectorAll('canvas')].sort((a, b) => b.width * b.height - a.width * a.height)[0]
|
|
132
|
+
const print = () => {
|
|
133
|
+
const canvas = largest()
|
|
134
|
+
if (!canvas || !pen) return ((markup) => [markup.length, [...markup].reduce((hash, c) => (hash * 31 + c.charCodeAt(0)) | 0, 7)])(stage.innerHTML)
|
|
135
|
+
try {
|
|
136
|
+
pen.clearRect(0, 0, 160, 90)
|
|
137
|
+
pen.drawImage(canvas, 0, 0, 160, 90)
|
|
138
|
+
const data = pen.getImageData(0, 0, 160, 90).data, areas = new Array(576).fill(0)
|
|
139
|
+
for (let i = 0; i < 14400; i++) areas[Math.floor(i / 800) * 32 + Math.floor((i % 160) / 5)] += (data[i * 4] * 3 + data[i * 4 + 1] * 4 + data[i * 4 + 2]) / 200
|
|
140
|
+
return areas.map((value) => Math.round(value * 100) / 100)
|
|
141
|
+
} catch (error) { return `unreadable: ${error}` }
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// A picture of the game for its card: the largest canvas, read in the task that drew it, else the stage drawn from its markup with
|
|
145
|
+
// its styles, but for inset shadows, which WebKit draws there at the wrong corner; fitted into 480 × 270 over the page's colour, as
|
|
146
|
+
// WebP, or JPEG where the browser writes none (WebKit); none of a blank screen.
|
|
147
|
+
const shoot = async () => {
|
|
148
|
+
const canvas = largest(), shot = new OffscreenCanvas(480, 270), paint = shot.getContext('2d')
|
|
149
|
+
const box = canvas?.getBoundingClientRect() ?? new DOMRect(0, 0, innerWidth, innerHeight), k = Math.min(480 / box.width, 270 / box.height)
|
|
150
|
+
const fit = /** @type {[number, number, number, number]} */ ([(480 - box.width * k) / 2, (270 - box.height * k) / 2, box.width * k, box.height * k])
|
|
151
|
+
try {
|
|
152
|
+
if (!paint || !Number.isFinite(k)) return ''
|
|
153
|
+
paint.fillStyle = getComputedStyle(document.body).backgroundColor
|
|
154
|
+
paint.fillRect(0, 0, 480, 270)
|
|
155
|
+
if (canvas) paint.drawImage(canvas, ...fit)
|
|
156
|
+
else {
|
|
157
|
+
const copy = /** @type {HTMLElement} */ (stage.cloneNode(true)), copies = [copy, ...copy.querySelectorAll('*')]
|
|
158
|
+
for (const [i, one] of [stage, ...stage.querySelectorAll('*')].entries()) { const style = getComputedStyle(one); copies[i].setAttribute('style', [...style].map((name) => `${name}:${name === 'box-shadow' && style.boxShadow.includes('inset') ? 'none' : style.getPropertyValue(name)}`).join(';')) }
|
|
159
|
+
for (const one of copy.querySelectorAll('script, noscript')) one.remove()
|
|
160
|
+
const image = new Image()
|
|
161
|
+
image.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${innerWidth}" height="${innerHeight}"><foreignObject width="100%" height="100%">${new XMLSerializer().serializeToString(copy)}</foreignObject></svg>`)}`
|
|
162
|
+
await image.decode()
|
|
163
|
+
paint.drawImage(image, ...fit)
|
|
164
|
+
}
|
|
165
|
+
const data = paint.getImageData(0, 0, 480, 270).data
|
|
166
|
+
if (!data.some((value, i) => Math.abs(value - data[i % 4]) > 8)) return ''
|
|
167
|
+
const webp = await shot.convertToBlob({ type: 'image/webp', quality: 0.8 }), blob = webp.type === 'image/webp' ? webp : await shot.convertToBlob({ type: 'image/jpeg', quality: 0.8 })
|
|
168
|
+
return await new Promise((done) => { const reader = new FileReader(); reader.onload = () => done(String(reader.result)); reader.onerror = () => done(''); reader.readAsDataURL(blob) })
|
|
169
|
+
} catch { return '' }
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// The stage's words over other words, or under the corner the frame's buttons take where lines end, as the player would see them.
|
|
173
|
+
const crowded = () => {
|
|
174
|
+
const shown = [...stage.querySelectorAll('*')].filter((one) => [...one.childNodes].some((node) => node.nodeType === 3 && node.textContent?.trim()) && one.checkVisibility?.({ opacityProperty: true, visibilityProperty: true }) !== false)
|
|
175
|
+
.map((one) => /** @type {[Element, DOMRect]} */ ([one, one.getBoundingClientRect()])).filter(([, box]) => box.width && box.height)
|
|
176
|
+
const end = document.documentElement.dir === 'rtl' ? 0 : innerWidth - 160, bar = new DOMRect(end, 0, 160, 56), said = (/** @type {Element} */ one) => `"${one.textContent?.trim().replace(/\s+/g, ' ').slice(0, 30)}"`
|
|
177
|
+
const over = (/** @type {DOMRect} */ a, /** @type {DOMRect} */ b) => Math.min(a.right, b.right) - Math.max(a.left, b.left) > 4 && Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top) > 4
|
|
178
|
+
return [...shown.flatMap(([a, box], i) => shown.slice(i + 1).filter(([b, other]) => !a.contains(b) && !b.contains(a) && over(box, other)).map(([b]) => `${said(a)} and ${said(b)}`)),
|
|
179
|
+
...shown.filter(([, box]) => over(box, bar)).map(([one]) => `${said(one)} under the frame's buttons`)].slice(0, 3)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Playing: one step a frame of the screen's, none while paused. Testing: one step a message, as fast as they come.
|
|
183
|
+
const play = () => {
|
|
184
|
+
if (running) return
|
|
185
|
+
running = true
|
|
186
|
+
if (!test) {
|
|
187
|
+
let last = real.now()
|
|
188
|
+
// A game without a picture takes one after its first five seconds played.
|
|
189
|
+
let wanted = !given.pictured
|
|
190
|
+
const tick = (/** @type {number} */ time) => {
|
|
191
|
+
poll(); if (!paused) step(Math.min(50, time - last)); last = time; real.raf(tick)
|
|
192
|
+
if (wanted && now > 5000) wanted = false, void shoot().then((picture) => picture && post({ picture }))
|
|
193
|
+
}
|
|
194
|
+
return void real.raf(tick)
|
|
195
|
+
}
|
|
196
|
+
const { port1, port2 } = new MessageChannel()
|
|
197
|
+
port1.onmessage = () => {
|
|
198
|
+
const frame = report.frames
|
|
199
|
+
for (const { action, from, to } of test.press) { if (from === frame) send('keydown', action); if (to === frame) send('keyup', action) }
|
|
200
|
+
const began = real.now()
|
|
201
|
+
step(1000 / 60)
|
|
202
|
+
work.push(real.now() - began)
|
|
203
|
+
if (frame % 10 === 0) report.prints.push(print())
|
|
204
|
+
if (++report.frames % 60 === 0) post({ progress: report.frames })
|
|
205
|
+
if (report.frames < test.frames) port2.postMessage(0)
|
|
206
|
+
else {
|
|
207
|
+
const end = { ...report, words: [...seen], text: stage.innerText.slice(0, 500), work: { mean: work.reduce((a, b) => a + b, 0) / work.length, worst: Math.max(...work) }, crowded: crowded() }
|
|
208
|
+
void shoot().then((picture) => post({ report: { ...end, picture } }))
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
port2.postMessage(0)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// The cover: to start, and while paused; mute and full screen above the game; buttons for its actions on a touch screen.
|
|
215
|
+
const make = (/** @type {string} */ tag, /** @type {Record<string, string>} */ attributes = {}, /** @type {(Node | string)[]} */ ...children) => {
|
|
216
|
+
const element = document.createElement(tag)
|
|
217
|
+
for (const [name, value] of Object.entries(attributes)) element.setAttribute(name, value)
|
|
218
|
+
element.append(...children)
|
|
219
|
+
return element
|
|
220
|
+
}
|
|
221
|
+
const glyph = (/** @type {string} */ path) => { const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'), line = document.createElementNS('http://www.w3.org/2000/svg', 'path'); svg.setAttribute('viewBox', '0 0 24 24'); svg.setAttribute('aria-hidden', 'true'); line.setAttribute('d', path); svg.append(line); return svg }
|
|
222
|
+
const cover = make('div', { class: 'cover' }), button = make('button', { type: 'button' }), title = make('h1', { dir: 'auto' }, given.title)
|
|
223
|
+
cover.append(title, button)
|
|
224
|
+
const covered = (/** @type {string} */ what) => { button.textContent = what; document.body.append(cover); button.focus() }
|
|
225
|
+
const toggle = (/** @type {boolean} */ on) => {
|
|
226
|
+
if (test || !running || paused === on) return
|
|
227
|
+
paused = on
|
|
228
|
+
for (const fn of listeners[on ? 'pause' : 'resume']) call(fn, [])
|
|
229
|
+
if (on) title.textContent = words.paused, covered(words.resume)
|
|
230
|
+
else cover.remove(), stage.focus()
|
|
231
|
+
}
|
|
232
|
+
button.addEventListener('click', () => (running ? toggle(false) : (cover.remove(), stage.focus(), play(), post({ playing: true }))))
|
|
233
|
+
addEventListener('blur', () => toggle(true))
|
|
234
|
+
document.addEventListener('visibilitychange', () => { if (document.hidden) toggle(true) })
|
|
235
|
+
const sound = make('button', { type: 'button', 'aria-label': words.mute, 'aria-pressed': 'false' }, glyph('M4 9.5h3.5L12 5.5v13l-4.5-4H4zM16 9a4 4 0 0 1 0 6M18.5 6.5a7.5 7.5 0 0 1 0 11'))
|
|
236
|
+
sound.addEventListener('click', () => { muted = !muted; sound.setAttribute('aria-pressed', String(muted)) })
|
|
237
|
+
const full = make('button', { type: 'button', 'aria-label': words.full }, glyph('M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'))
|
|
238
|
+
full.addEventListener('click', () => (document.fullscreenElement ? document.exitFullscreen() : document.documentElement.requestFullscreen()).catch(() => {}))
|
|
239
|
+
const pause = make('button', { type: 'button', 'aria-label': words.pause }, glyph('M9 5v14M15 5v14'))
|
|
240
|
+
pause.addEventListener('click', () => toggle(true))
|
|
241
|
+
const press = (/** @type {string} */ action, /** @type {string} */ shown) => {
|
|
242
|
+
const one = make('button', { type: 'button', 'aria-label': words[action] ?? action, 'data-action': action }, shown)
|
|
243
|
+
one.addEventListener('pointerdown', (event) => { one.setPointerCapture(event.pointerId); send('keydown', action) })
|
|
244
|
+
for (const type of ['pointerup', 'pointercancel']) one.addEventListener(type, () => send('keyup', action))
|
|
245
|
+
return one
|
|
246
|
+
}
|
|
247
|
+
const SHOWN = /** @type {Record<string, string>} */ ({ left: '◀', right: '▶', up: '▲', down: '▼', a: 'A', b: 'B' })
|
|
248
|
+
const pad = make('div', { class: 'pad', dir: 'ltr' }, make('div', { class: 'arrows' }, ...['up', 'left', 'right', 'down'].filter((action) => given.actions.includes(action)).map((action) => press(action, SHOWN[action]))),
|
|
249
|
+
make('div', { class: 'buttons' }, ...['b', 'a'].filter((action) => given.actions.includes(action)).map((action) => press(action, SHOWN[action]))))
|
|
250
|
+
|
|
251
|
+
addEventListener('DOMContentLoaded', () => {
|
|
252
|
+
stage = /** @type {HTMLElement} */ (document.getElementById('stage'))
|
|
253
|
+
url = URL.createObjectURL(new Blob([document.getElementById('game')?.textContent ?? ''], { type: 'text/javascript' }))
|
|
254
|
+
// Chromium says where a module's syntax error is on its element, WebKit on import()'s.
|
|
255
|
+
document.body.append(make('script', { type: 'module', src: url }))
|
|
256
|
+
import(url).then(() => test && real.later(play, frames.size ? 0 : 300), (error) => { if (!report.errors.some((one) => one.name === 'SyntaxError')) fault(error, error?.line, error?.column); if (test) play() })
|
|
257
|
+
if (test) (function wait() { if (frames.size) play(); else if (!running) real.later(wait, 5) })()
|
|
258
|
+
else document.body.append(make('div', { class: 'bar' }, pause, sound, full), pad), covered(words.play)
|
|
259
|
+
})
|
|
260
|
+
})()
|
package/caps/interactive/apps.js
CHANGED
|
@@ -11,7 +11,8 @@ import { register } from '../../ui/caps.js'
|
|
|
11
11
|
import { icon } from '../../ui/menu-icons.js'
|
|
12
12
|
import { ask, page } from '../../ui/creations.js'
|
|
13
13
|
import { held } from '../../ui/held.js'
|
|
14
|
-
import { capability } from './interactive.js'
|
|
14
|
+
import { capability, page as drawn } from './interactive.js'
|
|
15
|
+
import { frozen } from './parts.js'
|
|
15
16
|
|
|
16
17
|
/** Four tiles, the last turned on its corner: what is made to be used. */
|
|
17
18
|
const GLYPH = icon(svg`<rect x="4" y="4" width="6.5" height="6.5" rx="1.5"/><rect x="4" y="13.5" width="6.5" height="6.5" rx="1.5"/><rect x="13.5" y="13.5" width="6.5" height="6.5" rx="1.5"/><g transform="rotate(45 16.75 7.25)"><rect x="14" y="4.5" width="5.5" height="5.5" rx="1.5"/></g>`, 'flip-rtl')
|
|
@@ -19,16 +20,20 @@ const GLYPH = icon(svg`<rect x="4" y="4" width="6.5" height="6.5" rx="1.5"/><rec
|
|
|
19
20
|
const named = (source) => ((/<title[^>]*>([^<]*)</i.exec(source) ?? /<h[12][^>]*>([\s\S]*?)<\/h[12]>/i.exec(source))?.[1] ?? '')
|
|
20
21
|
.replace(/<[^>]*>/g, '').replaceAll('&', '&').replace(/\s+/g, ' ').trim()
|
|
21
22
|
|
|
22
|
-
const { kept, find, metaOf,
|
|
23
|
+
const { kept, find, metaOf, pin, rename, hide } = held({ fence: 'html', record: 'app', at: 'app-', latest: true, named, extension: 'html', mimeType: 'text/html' })
|
|
24
|
+
/** An app's page as the pane's Download gives it, what it shows of the project's collections written in (D633). @param {string} uri */
|
|
25
|
+
const bytesOf = async (uri) => ((source) => import('./view-parts.js').then(async (parts) => new TextEncoder().encode(frozen(source, await parts.snapshot(source)))))((await find(uri))?.source ?? '')
|
|
23
26
|
export { metaOf, bytesOf }
|
|
24
27
|
|
|
25
|
-
/** Its view in
|
|
26
|
-
export const editor = async ({ uri }) => ((one) => (one ?
|
|
28
|
+
/** Its view in its pane: the page itself, which works beside the task as in its answer. @param {{ uri: string }} file */
|
|
29
|
+
export const editor = async ({ uri }) => ((one) => (one ? shown(one, 'beside') : null))(await find(uri))
|
|
30
|
+
/** An app as its answer draws it, in the answer's styles, in its task. @param {{ source: string, link: { uri: string } }} one @param {string} [kind] its class */
|
|
31
|
+
const shown = ({ source, link }, kind) => html`<div class="prose">${drawn(source, false, kind, link.uri)}</div>`
|
|
27
32
|
|
|
28
33
|
export const apps = { id: 'apps', at: 6, draw: () => GLYPH, kept,
|
|
29
|
-
open: (/** @type {{ path: string, link: { name: string } }} */ { path, link }) => import('../../ui/preview.js').then(({ preview }) => preview({ uri: path, name: link.name, mimeType: 'text/html' })),
|
|
34
|
+
open: (/** @type {{ path: string, name: string, link: { name: string } }} */ { path, name, link }) => import('../../ui/preview.js').then(({ preview }) => preview({ uri: path, name: link.name, title: name, mimeType: 'text/html' })),
|
|
30
35
|
pin, rename, hide, like: async () => {},
|
|
31
|
-
preview: (/** @type {{ source: string }} */
|
|
36
|
+
preview: (/** @type {{ source: string, link: { uri: string } }} */ one) => shown(one),
|
|
32
37
|
make: () => ask('interactive.askApp', 'interactive.appExample') }
|
|
33
38
|
|
|
34
39
|
/** Its slots, Creations' page among them, once the project holds an app; until then only its card to start one, on the page another kind opens (D553). */
|
|
@@ -1,17 +1,30 @@
|
|
|
1
1
|
/* Pages in answers (D289): framed as the other widgets are, so a page reads as one of its own, Copy at its top corner, shown on hover. The page's body adds a little to the padding, room for its focus rings. */
|
|
2
2
|
app-page { position: relative; display: block; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: 0.9rem; margin-block: 0 0.85rem; }
|
|
3
3
|
app-page iframe { display: block; box-sizing: content-box; inline-size: 100%; block-size: 6rem; border: 0; background: transparent; }
|
|
4
|
-
:is(app-page, .diagram) .drawn-foot { position: absolute; z-index: 1; inset-block-start: 0.4rem; inset-inline-end: 0.4rem; transition: opacity 0.2s; }
|
|
5
|
-
:is(app-page, .diagram) .drawn-foot .icon-button { background: var(--glass); }
|
|
6
|
-
@media (hover: hover) { :is(app-page, .diagram):not(:hover, :focus-within) .drawn-foot { opacity: 0; } }
|
|
7
|
-
@media print { :is(app-page, .diagram) .drawn-foot { display: none; } }
|
|
4
|
+
:is(app-page, app-parts, .diagram) .drawn-foot { position: absolute; z-index: 1; inset-block-start: 0.4rem; inset-inline-end: 0.4rem; transition: opacity 0.2s; }
|
|
5
|
+
:is(app-page, app-parts, .diagram) .drawn-foot .icon-button { background: var(--glass); }
|
|
6
|
+
@media (hover: hover) { :is(app-page, app-parts, .diagram):not(:hover, :focus-within) > .drawn-foot { opacity: 0; } }
|
|
7
|
+
@media print { :is(app-page, app-parts, .diagram) .drawn-foot { display: none; } }
|
|
8
|
+
/* A page of parts (D631): framed as a page is, its parts in the answer's own styles; cards side by side as there is room, sharing
|
|
9
|
+
each row, a wide one a whole row; an aside beside the rest on a page wide enough; a table's heads sort it; a form's fields side by side as there is room,
|
|
10
|
+
a long one and its button a whole row. In the conversation, it takes the room beside the text, up to 64rem beside the text's 46rem
|
|
11
|
+
(ui/style.css's --column), centred on it and never narrower than it, as Layouts' wide tables do (--shell, D215). */
|
|
12
|
+
app-parts { position: relative; display: block; container-type: inline-size; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: 0.9rem; margin-block: 0 0.85rem; } @media screen { main .prose > app-parts { --wide: max(100cqi, min(var(--shell) - 2.5rem, 64rem)); margin-inline: calc((100cqi - var(--wide)) / 2); } }
|
|
13
|
+
app-parts .part-cards { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-block-end: 0.85rem; } app-parts .part-cards > * { flex: 1 1 15rem; } app-parts .part-card.wide { flex-basis: 100%; }
|
|
14
|
+
app-parts .part-card { min-inline-size: 0; padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6); } app-parts .part-card > :last-child { margin-block-end: 0; } app-parts .part-card > h4 { margin-block: 0 0.5rem; } app-parts .part-card > :is(app-chart, .diagram, app-page) { padding: 0; border: 0; }
|
|
15
|
+
@container (min-width: 36rem) { app-parts .parts:has(> aside) { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; } }
|
|
16
|
+
app-parts th .sorts { padding: 0; border: 0; background: none; font-weight: inherit; text-align: inherit; }
|
|
17
|
+
app-parts .part-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 0.6rem 0.75rem; margin-block-end: 0.85rem; } app-parts .part-form :is(.button, label:has(textarea)) { grid-column: 1 / -1; } app-parts .part-form .button { justify-self: start; }
|
|
18
|
+
app-parts .part-form label { display: grid; gap: 0.25rem; } app-parts .part-form label.tick { display: flex; align-items: center; gap: 0.5rem; }
|
|
19
|
+
app-parts .part-form textarea { box-sizing: border-box; inline-size: 100%; padding: 0.4em 0.8em; border: 1px solid var(--line-strong); border-radius: calc(var(--radius) * 0.4); background: var(--glass); }
|
|
20
|
+
@media (forced-colors: active) { app-parts .part-card { border-color: CanvasText; } }
|
|
8
21
|
/* A diagram (D291, D592): framed as the other widgets are, Pele's picture as wide as it needs up to the text's width, then scaled down. */
|
|
9
22
|
.prose .diagram { position: relative; margin: 0 0 0.85rem; padding: 1rem; border: 1px solid var(--line); border-radius: 0.9rem; }
|
|
10
23
|
.diagram app-diagram { display: block; }
|
|
11
24
|
.diagram app-diagram img { display: block; max-inline-size: 100%; block-size: auto; margin-inline: auto; }
|
|
12
25
|
/* An app on its Creations card, at half size and still, its Copy away; beside the task, the pane its frame (D553). */
|
|
13
|
-
.creation-preview
|
|
14
|
-
app-page.beside { margin: 0; border: 0; border-radius: 0; }
|
|
26
|
+
.creation-preview :is(app-page, app-parts) { zoom: 0.5; padding: 0; border: 0; } .creation-preview :is(app-page, app-parts) .drawn-foot { display: none; }
|
|
27
|
+
:is(app-page, app-parts).beside { margin: 0; border: 0; border-radius: 0; }
|
|
15
28
|
/* With its code off, its code, framed as code is. */
|
|
16
29
|
app-page:has(> pre) { padding: 0; border: 0; }
|
|
17
30
|
/* Visual answers on (./mode.js): pressed at the box's foot, its × to turn it off. */
|