diff --git a/package/src/common/patches/revealjs-plugin-0001-chakboard-backdrop-filter.patch b/package/src/common/patches/revealjs-plugin-0001-chakboard-backdrop-filter.patch new file mode 100644 index 00000000000..0d56f5c667c --- /dev/null +++ b/package/src/common/patches/revealjs-plugin-0001-chakboard-backdrop-filter.patch @@ -0,0 +1,13 @@ +diff --git a/src/resources/formats/revealjs/plugins/chalkboard/plugin.js b/src/resources/formats/revealjs/plugins/chalkboard/plugin.js +index 6dfb4b5a5..543ee101f 100644 +--- a/src/resources/formats/revealjs/plugins/chalkboard/plugin.js ++++ b/src/resources/formats/revealjs/plugins/chalkboard/plugin.js +@@ -444,6 +444,8 @@ const initChalkboard = function ( Reveal ) { + container.style.visibility = 'visible'; + container.style.pointerEvents = 'none'; + container.style['backdrop-filter'] = 'none'; ++ // for older safari ++ container.style["-webkit-backdrop-filter"] = "none"; + + var slides = document.querySelector( '.slides' ); + var aspectRatio = Reveal.getConfig().width / Reveal.getConfig().height; diff --git a/package/src/common/update-html-dependencies.ts b/package/src/common/update-html-dependencies.ts index 3b6f5780495..49dcc148877 100644 --- a/package/src/common/update-html-dependencies.ts +++ b/package/src/common/update-html-dependencies.ts @@ -387,6 +387,11 @@ export async function updateHtmlDependencies(config: Configuration) { }, true, // true if commit, false otherwise false, // no v prefix, + // FIXME: Patch waiting for fix upstream to be merged + // https://github.com/rajgoel/reveal.js-plugins/pull/184 + resolvePatches([ + "revealjs-plugin-0001-chakboard-backdrop-filter.patch" + ]) ); // revealjs-menu @@ -1123,7 +1128,7 @@ async function updateGithubSourceCodeDependency( await unzip(zipFile, working); await onDownload(working, version); - if (patches) await applyGitPatches(patches); + if (patches) applyGitPatches(patches); } else { throw new Error(`${versionEnvVar} is not defined`); } diff --git a/package/src/util/git.ts b/package/src/util/git.ts index aa69466df49..0c9012bbb7f 100644 --- a/package/src/util/git.ts +++ b/package/src/util/git.ts @@ -97,28 +97,26 @@ async function clone(workingDir: string, url: string) { export async function applyGitPatches(patches: string[]) { - if (!patches) return undefined + if (!patches) return undefined; info(`Applying Git patches...`); - await Promise.all( - patches.map( async (patch) => { - info(` - patch ${colors.blue(patch)}`) - const gitCmd: string[] = []; - gitCmd.push("git"); - gitCmd.push("apply"); - gitCmd.push(patch); - // this helps with newline handling in patch - gitCmd.push("--ignore-space-change"); - // this helps debug when patch goes wrong - // https://git-scm.com/docs/git-apply#Documentation/git-apply.txt---reject - gitCmd.push("--reject"); - const p = Deno.run({ - cmd: gitCmd, - stderr: "piped", - }); - const status = await p.status(); - if (status.code !== 0) { - throw Error(`Failed to apply patch: '${patch}'`); - } - }) - ) + for (const patch of patches) { + info(` - patch ${colors.blue(patch)}`); + const gitCmd: string[] = []; + gitCmd.push("git"); + gitCmd.push("apply"); + gitCmd.push(patch); + // this helps with newline handling in patch + gitCmd.push("--ignore-space-change"); + // this helps debug when patch goes wrong + // https://git-scm.com/docs/git-apply#Documentation/git-apply.txt---reject + gitCmd.push("--reject"); + const p = Deno.run({ + cmd: gitCmd, + stderr: "piped", + }); + const status = await p.status(); + if (status.code !== 0) { + throw Error(`Failed to apply patch: '${patch}'`); + } + } } \ No newline at end of file diff --git a/src/resources/formats/revealjs/plugins/chalkboard/plugin.js b/src/resources/formats/revealjs/plugins/chalkboard/plugin.js index 6dfb4b5a5fb..543ee101fb3 100644 --- a/src/resources/formats/revealjs/plugins/chalkboard/plugin.js +++ b/src/resources/formats/revealjs/plugins/chalkboard/plugin.js @@ -444,6 +444,8 @@ const initChalkboard = function ( Reveal ) { container.style.visibility = 'visible'; container.style.pointerEvents = 'none'; container.style['backdrop-filter'] = 'none'; + // for older safari + container.style["-webkit-backdrop-filter"] = "none"; var slides = document.querySelector( '.slides' ); var aspectRatio = Reveal.getConfig().width / Reveal.getConfig().height;