Skip to content

Commit

Permalink
initial react wrapper exploration
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Mar 25, 2024
1 parent 6410c75 commit 27e1dfb
Show file tree
Hide file tree
Showing 17 changed files with 2,975 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,8 @@ export default function( revealElement, options ) {
*/
function slide( h, v, f, origin ) {

if( Reveal.isReady() === false ) return;

// Dispatch an event before the slide
const slidechange = dispatchEvent({
type: 'beforeslidechange',
Expand Down Expand Up @@ -1653,6 +1655,8 @@ export default function( revealElement, options ) {
*/
function sync() {

if( Reveal.isReady() === false ) return;

// Subscribe to input
removeEventListeners();
addEventListeners();
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"scripts": {
"test": "gulp test",
"start": "gulp serve",
"build": "gulp build"
"build": "gulp build",
"dev:react": "npm --prefix ./react run dev"
},
"author": {
"name": "Hakim El Hattab",
Expand Down
18 changes: 18 additions & 0 deletions react/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
12 changes: 12 additions & 0 deletions react/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>reveal.js/react</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/demo.tsx"></script>
</body>
</html>

0 comments on commit 27e1dfb

Please sign in to comment.