repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/fakeDevTools.js | debug/test/browser/fakeDevTools.js | window.__PREACT_DEVTOOLS__ = { attachPreact: vi.fn() };
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/debug.test.jsx | debug/test/browser/debug.test.jsx | import {
createElement,
render,
createRef,
Component,
Fragment,
hydrate
} from 'preact';
import { useState } from 'preact/hooks';
import { setupScratch, teardown } from '../../../test/_util/helpers';
import './fakeDevTools';
import 'preact/debug';
import { setupRerender } from 'preact/test-utils';
import { vi } f... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/debug-suspense.test.jsx | debug/test/browser/debug-suspense.test.jsx | import { createElement, render, lazy, Suspense } from 'preact/compat';
import 'preact/debug';
import { setupRerender } from 'preact/test-utils';
import {
setupScratch,
teardown,
serializeHtml
} from '../../../test/_util/helpers';
import { vi } from 'vitest';
describe('debug with suspense', () => {
/** @type {HTMLD... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/serializeVNode.test.jsx | debug/test/browser/serializeVNode.test.jsx | import { createElement, Component } from 'preact';
import { serializeVNode } from '../../src/debug';
describe('serializeVNode', () => {
it("should prefer a function component's displayName", () => {
function Foo() {
return <div />;
}
Foo.displayName = 'Bar';
expect(serializeVNode(<Foo />)).to.equal('<Bar ... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/debug-hooks.test.jsx | debug/test/browser/debug-hooks.test.jsx | import { createElement, render, Component } from 'preact';
import { useState, useEffect } from 'preact/hooks';
import 'preact/debug';
import { act } from 'preact/test-utils';
import { setupScratch, teardown } from '../../../test/_util/helpers';
import { vi } from 'vitest';
describe('debug with hooks', () => {
let scr... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/component-stack-2.test.jsx | debug/test/browser/component-stack-2.test.jsx | import { createElement, render, Component } from 'preact';
import 'preact/debug';
import { setupScratch, teardown } from '../../../test/_util/helpers';
import { vi } from 'vitest';
// This test is not part of component-stack.test.js to avoid it being
// transpiled with '@babel/plugin-transform-react-jsx-source' enable... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/debug-compat.test.jsx | debug/test/browser/debug-compat.test.jsx | import { createElement, render, createRef } from 'preact';
import { setupScratch, teardown } from '../../../test/_util/helpers';
import './fakeDevTools';
import 'preact/debug';
import * as PropTypes from 'prop-types';
// eslint-disable-next-line no-duplicate-imports
import { resetPropWarnings } from 'preact/debug';
im... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/prop-types.test.js | debug/test/browser/prop-types.test.js | import { createElement, render } from 'preact';
import {
setupScratch,
teardown,
serializeHtml
} from '../../../test/_util/helpers';
import './fakeDevTools';
import { resetPropWarnings } from 'preact/debug';
import * as PropTypes from 'prop-types';
import { jsxDEV as jsxDev } from 'preact/jsx-runtime';
import { vi }... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/component-stack.test.jsx | debug/test/browser/component-stack.test.jsx | import { createElement, render, Component } from 'preact';
import 'preact/debug';
import { vi } from 'vitest';
import { setupScratch, teardown } from '../../../test/_util/helpers';
describe('component stack', () => {
/** @type {HTMLDivElement} */
let scratch;
let errors = [];
let warnings = [];
const getStack =... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/debug/test/browser/validateHookArgs.test.jsx | debug/test/browser/validateHookArgs.test.jsx | import { createElement, render, createRef } from 'preact';
import {
useState,
useEffect,
useLayoutEffect,
useCallback,
useMemo,
useImperativeHandle
} from 'preact/hooks';
import { setupRerender } from 'preact/test-utils';
import { setupScratch, teardown } from '../../../test/_util/helpers';
import 'preact/debug';... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/list.jsx | demo/list.jsx | import { h, render } from 'preact';
import htm from 'htm';
import './style.css';
const html = htm.bind(h);
const createRoot = parent => ({
render: v => render(v, parent)
});
function List({ items, renders, useKeys, useCounts, update }) {
const toggleKeys = () => update({ useKeys: !useKeys });
const toggleCounts = ... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/contenteditable.jsx | demo/contenteditable.jsx | import { useState } from 'preact/hooks';
export default function Contenteditable() {
const [value, setValue] = useState("Hey there<br />I'm editable!");
return (
<div>
<div>
<button onClick={() => setValue('')}>Clear!</button>
</div>
<div
style={{
border: '1px solid gray',
padding: '8px... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/index.jsx | demo/index.jsx | import { render, Component, Fragment } from 'preact';
// import renderToString from 'preact-render-to-string';
import './style.scss';
import { Router, Link } from 'preact-router';
import Pythagoras from './pythagoras';
import Spiral from './spiral';
import Reorder from './reorder';
import Todo from './todo';
import Fra... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/stateOrderBug.jsx | demo/stateOrderBug.jsx | import htm from 'htm';
import { h } from 'preact';
import { useState, useCallback } from 'preact/hooks';
const html = htm.bind(h);
// configuration used to show behavior vs. workaround
let childFirst = true;
const Config = () => html`
<label>
<input
type="checkbox"
checked=${childFirst}
onchange=${evt => ... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/reduxUpdate.jsx | demo/reduxUpdate.jsx | import { createElement, Component } from 'preact';
import { connect, Provider } from 'react-redux';
import { createStore } from 'redux';
import { HashRouter, Route, Link } from 'react-router-dom';
const store = createStore(
(state, action) => ({ ...state, display: action.display }),
{ display: false }
);
function _... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/context.jsx | demo/context.jsx | // eslint-disable-next-line no-unused-vars
import { Component, createContext } from 'preact';
const { Provider, Consumer } = createContext();
class ThemeProvider extends Component {
state = {
value: this.props.value
};
onClick = () => {
this.setState(prev => ({
value:
prev.value === this.props.value ? t... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/profiler.jsx | demo/profiler.jsx | import { createElement, Component, options } from 'preact';
function getPrimes(max) {
let sieve = [],
i,
j,
primes = [];
for (i = 2; i <= max; ++i) {
if (!sieve[i]) {
// i has not been marked -- it is prime
primes.push(i);
for (j = i << 1; j <= max; j += i) {
sieve[j] = true;
}
}
}
return... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/redux.jsx | demo/redux.jsx | import { createElement } from 'preact';
import React from 'react';
import { createStore } from 'redux';
import { connect, Provider } from 'react-redux';
const store = createStore((state = { value: 0 }, action) => {
switch (action.type) {
case 'increment':
return { value: state.value + 1 };
case 'decrement':
... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/key_bug.jsx | demo/key_bug.jsx | import { Component } from 'preact';
function Foo(props) {
return <div>This is: {props.children}</div>;
}
export default class KeyBug extends Component {
constructor() {
super();
this.onClick = this.onClick.bind(this);
this.state = { active: false };
}
onClick() {
this.setState(prev => ({ active: !prev.ac... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/fragments.jsx | demo/fragments.jsx | import { Component } from 'preact';
export default class FragmentComp extends Component {
state = { number: 0 };
componentDidMount() {
setInterval(_ => this.updateChildren(), 1000);
}
updateChildren() {
this.setState(state => ({ number: state.number + 1 }));
}
render(props, state) {
return (
<div>
... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/textFields.jsx | demo/textFields.jsx | import React, { useState } from 'react';
import TextField from '@material-ui/core/TextField';
const PatchedTextField = props => {
const [value, set] = useState(props.value);
return (
<TextField {...props} value={value} onChange={e => set(e.target.value)} />
);
};
const TextFields = () => (
<div>
<TextField
... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/styled-components.jsx | demo/styled-components.jsx | import { createElement } from 'preact';
import styled, { css } from 'styled-components';
const Button = styled.button`
background: transparent;
border-radius: 3px;
border: 2px solid palevioletred;
color: palevioletred;
margin: 0.5em 1em;
padding: 0.25em 1em;
${props =>
props.primary &&
css`
background: ... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/logger.jsx | demo/logger.jsx | export default function logger(logStats, logConsole) {
if (!logStats && !logConsole) {
return;
}
const consoleBuffer = new ConsoleBuffer();
let calls = {};
let lock = true;
function serialize(obj) {
if (obj instanceof Text) return '#text';
if (obj instanceof Element) return `<${obj.localName}>`;
if (ob... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/suspense.jsx | demo/suspense.jsx | // eslint-disable-next-line no-unused-vars
import {
createElement,
Component,
memo,
Fragment,
Suspense,
lazy
} from 'react';
function LazyComp() {
return <div>I'm (fake) lazy loaded</div>;
}
const Lazy = lazy(() => Promise.resolve({ default: LazyComp }));
function createSuspension(name, timeout, error) {
let... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/vite.config.js | demo/vite.config.js | import { defineConfig } from 'vite';
import path from 'node:path';
const root = path.join(__dirname, '..');
const resolvePkg = (...parts) => path.join(root, ...parts, 'src', 'index.js');
// https://vitejs.dev/config/
/** @type {import('vite').UserConfig} */
export default defineConfig({
optimizeDeps: {
exclude: [
... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/devtools.jsx | demo/devtools.jsx | import { Component, memo, Suspense, lazy } from 'react';
function Foo() {
return <div>I'm memoed</div>;
}
function LazyComp() {
return <div>I'm (fake) lazy loaded</div>;
}
const Lazy = lazy(() => Promise.resolve({ default: LazyComp }));
const Memoed = memo(Foo);
export default class DevtoolsDemo extends Componen... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/spiral.jsx | demo/spiral.jsx | import { createElement, Component } from 'preact';
const COUNT = 500;
const LOOPS = 6;
// Component.debounce = requestAnimationFrame;
export default class Spiral extends Component {
state = { x: 0, y: 0, big: false, counter: 0 };
handleClick = e => {
console.log('click');
};
increment = () => {
if (this.st... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/redux-toolkit.jsx | demo/redux-toolkit.jsx | import { createElement } from 'preact';
import { Provider, useSelector } from 'react-redux';
import { configureStore, createSlice } from '@reduxjs/toolkit';
const initialState = {
value: 0
};
const counterSlice = createSlice({
name: 'counter',
initialState,
reducers: {
increment: state => {
state.value += 1;
... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/zustand.jsx | demo/zustand.jsx | import { createElement } from 'preact';
import create from 'zustand';
const useStore = create(set => ({
value: 0,
text: 'John',
setText: text => set(state => ({ ...state, text })),
increment: () => set(state => ({ value: state.value + 1 })),
decrement: () => set(state => ({ value: state.value - 1 })),
incrementA... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/preact.jsx | demo/preact.jsx | import {
options,
createElement,
cloneElement,
Component as CevicheComponent,
render
} from 'preact';
options.vnode = vnode => {
vnode.nodeName = vnode.type;
vnode.attributes = vnode.props;
vnode.children = vnode._children || [].concat(vnode.props.children || []);
};
function asArray(arr) {
return Array.isAr... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/mobx.jsx | demo/mobx.jsx | import React, { forwardRef, useRef, useState } from 'react';
import { decorate, observable } from 'mobx';
import { observer, useObserver } from 'mobx-react';
class Todo {
constructor() {
this.id = Math.random();
this.title = 'initial';
this.finished = false;
}
}
decorate(Todo, {
title: observable,
finished: ... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/reorder.jsx | demo/reorder.jsx | import { createElement, Component } from 'preact';
function createItems(count = 10) {
let items = [];
for (let i = 0; i < count; i++) {
items.push({
label: `Item #${i + 1}`,
key: i + 1
});
}
return items;
}
function random() {
return Math.random() < 0.5 ? 1 : -1;
}
export default class Reorder extends... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/todo.jsx | demo/todo.jsx | import { createElement, Component } from 'preact';
let counter = 0;
export default class TodoList extends Component {
state = { todos: [], text: '' };
setText = e => {
this.setState({ text: e.target.value });
};
addTodo = () => {
let { todos, text } = this.state;
todos = todos.concat({ text, id: ++counter... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/pythagoras/index.jsx | demo/pythagoras/index.jsx | import { Component } from 'preact';
import { select as d3select, mouse as d3mouse } from 'd3-selection';
import { scaleLinear } from 'd3-scale';
import Pythagoras from './pythagoras';
export default class PythagorasDemo extends Component {
svg = {
width: 1280,
height: 600
};
state = {
currentMax: 0,
baseW:... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/pythagoras/pythagoras.jsx | demo/pythagoras/pythagoras.jsx | import { interpolateViridis } from 'd3-scale';
Math.deg = function (radians) {
return radians * (180 / Math.PI);
};
const memoizedCalc = (function () {
const memo = {};
const key = ({ w, heightFactor, lean }) => `${w}-${heightFactor}-${lean}`;
return args => {
let memoKey = key(args);
if (memo[memoKey]) {
... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/suspense-router/index.jsx | demo/suspense-router/index.jsx | import { Suspense, lazy } from 'react';
import { Router, Route, Switch } from './simple-router';
let Hello = lazy(() => import('./hello.jsx'));
let Bye = lazy(() => import('./bye.jsx'));
function Loading() {
return <div>Hey! This is a fallback because we're loading things! :D</div>;
}
export default function Suspe... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/suspense-router/hello.jsx | demo/suspense-router/hello.jsx | import { Link } from './simple-router';
export default function Hello() {
return (
<div>
Hello! <Link to="/bye">Go to Bye!</Link>
</div>
);
}
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/suspense-router/bye.jsx | demo/suspense-router/bye.jsx | import { Link } from './simple-router';
export default function Bye() {
return (
<div>
Bye! <Link to="/">Go to Hello!</Link>
</div>
);
}
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/suspense-router/simple-router.jsx | demo/suspense-router/simple-router.jsx | import {
createContext,
useState,
useContext,
Children,
useLayoutEffect
} from 'react';
const memoryHistory = {
/**
* @typedef {{ pathname: string }} Location
* @typedef {(location: Location) => void} HistoryListener
* @type {HistoryListener[]}
*/
listeners: [],
/**
* @param {HistoryListener} listen... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/nested-suspense/index.jsx | demo/nested-suspense/index.jsx | import { createElement, Suspense, lazy, Component } from 'react';
const Loading = function () {
return <div>Loading...</div>;
};
const Error = function ({ resetState }) {
return (
<div>
Error!
<a onClick={resetState} href="#">
Reset app
</a>
</div>
);
};
const pause = timeout =>
new Promise... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/nested-suspense/dropzone.jsx | demo/nested-suspense/dropzone.jsx | import { createElement } from 'react';
export default function DropZone({ appearance }) {
return <div>DropZone (component #{appearance})</div>;
}
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/nested-suspense/editor.jsx | demo/nested-suspense/editor.jsx | import { createElement } from 'react';
export default function Editor({ children }) {
return <div className="Editor">{children}</div>;
}
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/nested-suspense/subcomponent.jsx | demo/nested-suspense/subcomponent.jsx | import { createElement } from 'react';
export default function SubComponent({ onClick }) {
return <div>Lazy loaded sub component</div>;
}
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/nested-suspense/addnewcomponent.jsx | demo/nested-suspense/addnewcomponent.jsx | import { createElement } from 'react';
export default function AddNewComponent({ appearance }) {
return <div>AddNewComponent (component #{appearance})</div>;
}
| javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
preactjs/preact | https://github.com/preactjs/preact/blob/bf7a195ac4b1706468e876e41b27428e3d8a08f3/demo/nested-suspense/component-container.jsx | demo/nested-suspense/component-container.jsx | import { lazy } from 'react';
const pause = timeout =>
new Promise(d => setTimeout(d, timeout), console.log(timeout));
const SubComponent = lazy(() =>
pause(Math.random() * 1000).then(() => import('./subcomponent.jsx'))
);
export default function ComponentContainer({ appearance }) {
return (
<div>
GenerateCo... | javascript | MIT | bf7a195ac4b1706468e876e41b27428e3d8a08f3 | 2026-01-04T14:59:51.617528Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/.eslintrc.js | .eslintrc.js | module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"accessor-pairs": "erro... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/build.js | build.js | const fs = require('fs');
var ls = require('ls');
var path = require('path');
var Terser = require("terser");
var files = ['src/impress.js'];
// Libraries from src/lib
files.push('src/lib/gc.js', 'src/lib/util.js', 'src/lib/rotation.js')
// Plugins from src/plugins
files.push('src/plugins/autoplay/autoplay.js',
... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/karma.conf.js | karma.conf.js | // Karma configuration
// Generated on Thu Feb 28 2019 16:31:36 GMT+0100 (Central European Standard Time)
process.env.CHROME_BIN = require('puppeteer').executablePath()
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/impress.js | src/impress.js | /*! Licensed under MIT License - http://github.com/impress/impress.js */
/**
* impress.js
*
* impress.js is a presentation tool based on the power of CSS3 transforms and transitions
* in modern browsers and inspired by the idea behind prezi.com.
*
*
* Copyright 2011-2012 Bartek Szopka (@bartaz), 2016-2023 Henrik... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | true |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/goto/goto.js | src/plugins/goto/goto.js | /**
* Goto Plugin
*
* The goto plugin is a pre-stepleave plugin. It is executed before impress:stepleave,
* and will alter the destination where to transition next.
*
* Example:
*
* <!-- When leaving this step, go directly to "step-5" -->
* <div class="step" data-goto="step-5">
*
* <!... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/mouse-timeout/mouse-timeout.js | src/plugins/mouse-timeout/mouse-timeout.js | /**
* Mouse timeout plugin
*
* After 3 seconds of mouse inactivity, add the css class
* `body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the
* class.
*
* The use case for this plugin is to use CSS to hide elements from the screen
* and only make them visible when the mouse is moved. Exam... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/help/help.js | src/plugins/help/help.js | /**
* Help popup plugin
*
* Example:
*
* <!-- Show a help popup at start, or if user presses "H" -->
* <div id="impress-help"></div>
*
* For developers:
*
* Typical use for this plugin, is for plugins that support some keypress, to add a line
* to the help popup produced by this plugin. For example "... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/autoplay/autoplay.js | src/plugins/autoplay/autoplay.js | /**
* Autoplay plugin - Automatically advance slideshow after N seconds
*
* Copyright 2016 Henrik Ingo, henrik.ingo@avoinelama.fi
* Released under the MIT license.
*/
/* global clearTimeout, setTimeout, document */
( function( document ) {
"use strict";
var autoplayDefault = 0;
var currentStepTimeout... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/mobile/mobile.js | src/plugins/mobile/mobile.js | /**
* Mobile devices support
*
* Allow presentation creators to hide all but 3 slides, to save resources, particularly on mobile
* devices, using classes body.impress-mobile, .step.prev, .step.active and .step.next.
*
* Note: This plugin does not take into account possible redirections done with skip, goto etc
*... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/impressConsole/impressConsole.js | src/plugins/impressConsole/impressConsole.js | /**
* Adds a presenter console to impress.js
*
* MIT Licensed, see license.txt.
*
* Copyright 2012, 2013, 2015 impress-console contributors (see README.txt)
*
* version: 1.3-dev
*
*/
// This file contains so much HTML, that we will just respectfully disagree about js
/* jshint quotmark:single */
/* global nav... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/skip/skip.js | src/plugins/skip/skip.js | /**
* Skip Plugin
*
* Example:
*
* <!-- This slide is disabled in presentations, when moving with next()
* and prev() commands, but you can still move directly to it, for
* example with a url (anything using goto()). -->
* <div class="step skip">
*
* Copyright 2016 Henrik Ingo (@hen... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/stop/stop.js | src/plugins/stop/stop.js | /**
* Stop Plugin
*
* Example:
*
* <!-- Stop at this slide.
* (For example, when used on the last slide, this prevents the
* presentation from wrapping back to the beginning.) -->
* <div class="step stop">
*
* Copyright 2016 Henrik Ingo (@henrikingo)
* Released under the... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/progress/progress.js | src/plugins/progress/progress.js | /* global document */
( function( document ) {
"use strict";
var root;
var stepids = [];
// Get stepids from the steps under impress root
var getSteps = function() {
stepids = [];
var steps = root.querySelectorAll( ".step" );
for ( var i = 0; i < steps.length; i++ )
... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/toolbar/toolbar.js | src/plugins/toolbar/toolbar.js | /**
* Toolbar plugin
*
* This plugin provides a generic graphical toolbar. Other plugins that
* want to expose a button or other widget, can add those to this toolbar.
*
* Using a single consolidated toolbar for all GUI widgets makes it easier
* to position and style the toolbar rather than having to do that for... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/resize/resize.js | src/plugins/resize/resize.js | /**
* Resize plugin
*
* Rescale the presentation after a window resize.
*
* Copyright 2011-2012 Bartek Szopka (@bartaz)
* Released under the MIT license.
* ------------------------------------------------
* author: Bartek Szopka
* version: 0.5.3
* url: http://bartaz.github.com/impress.js/
* source: ... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/fullscreen/fullscreen.js | src/plugins/fullscreen/fullscreen.js | /**
* Fullscreen plugin
*
* Press F5 to enter fullscreen and ESC to exit fullscreen mode.
*
* Copyright 2019 @giflw
* Released under the MIT license.
*/
/* global document */
( function( document ) {
"use strict";
function enterFullscreen() {
var elem = document.documentElement;
if ( !d... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/navigation/navigation.js | src/plugins/navigation/navigation.js | /**
* Navigation events plugin
*
* As you can see this part is separate from the impress.js core code.
* It's because these navigation actions only need what impress.js provides with
* its simple API.
*
* This plugin is what we call an _init plugin_. It's a simple kind of
* impress.js plugin. When loaded, it st... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/navigation/navigation_tests.js | src/plugins/navigation/navigation_tests.js | /*
* Copyright 2016 Henrik Ingo (@henrikingo)
*
* Released under the MIT license. See LICENSE file.
*/
/* global QUnit, loadIframe, initPresentation, document, window */
QUnit.module( "Navigation plugin" );
QUnit.test( "Navigation Plugin", function( assert ) {
window.console.log( "Begin navigation plugin" );
... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/blackout/blackout.js | src/plugins/blackout/blackout.js | /**
* Blackout plugin
*
* Press b or . to hide all slides, and b or . again to show them.
* Also navigating to a different slide will show them again (impress:stepleave).
*
* Copyright 2014 @Strikeskids
* Released under the MIT license.
*/
/* global document */
( function( document ) {
"use strict";
v... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/bookmark/bookmark.js | src/plugins/bookmark/bookmark.js | /**
* Bookmark Plugin
*
* The bookmark plugin consists of
* a pre-init plugin,
* a keyup listener, and
* a pre-stepleave plugin.
*
* The pre-init plugin surveys all step divs to set up bookmark keybindings.
* The pre-stepleave plugin alters the destination when a bookmark hotkey is pressed.
*
* Example... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/media/media.js | src/plugins/media/media.js | /**
* Media Plugin
*
* This plugin will do the following things:
*
* - Add a special class when playing (body.impress-media-video-playing
* and body.impress-media-video-playing) and pausing media (body.impress-media-video-paused
* and body.impress-media-audio-paused) (removing them when ending).
* Thi... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/rel/rel.js | src/plugins/rel/rel.js | /**
* Relative Positioning Plugin
*
* This plugin provides support for defining the coordinates of a step relative
* to the previous step. This is often more convenient when creating presentations,
* since as you add, remove or move steps, you may not need to edit the positions
* as much as is the case with the a... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/form/form.js | src/plugins/form/form.js | /**
* Form support
*
* Functionality to better support use of input, textarea, button... elements in a presentation.
*
* This plugin does two things:
*
* Set stopPropagation on any element that might take text input. This allows users to type, for
* example, the letter 'P' into a form field, without causing the... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/touch/touch.js | src/plugins/touch/touch.js | /**
* Support for swipe and tap on touch devices
*
* This plugin implements navigation for plugin devices, via swiping left/right,
* or tapping on the left/right edges of the screen.
*
*
*
* Copyright 2015: Andrew Dunai (@and3rson)
* Modified to a plugin, 2016: Henrik Ingo (@henrikingo)
*
* MIT License
*/
/... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/extras/extras.js | src/plugins/extras/extras.js | /**
* Extras Plugin
*
* This plugin performs initialization (like calling mermaid.initialize())
* for the extras/ plugins if they are loaded into a presentation.
*
* See README.md for details.
*
* Copyright 2016 Henrik Ingo (@henrikingo)
* Released under the MIT license.
*/
/* global markdown, marked, hljs, m... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/substep/substep.js | src/plugins/substep/substep.js | /**
* Substep Plugin
*
* Copyright 2017 Henrik Ingo (@henrikingo)
* Released under the MIT license.
*/
/* global document, window */
( function( document, window ) {
"use strict";
// Copied from core impress.js. Good candidate for moving to src/lib/util.js.
var triggerEvent = function( el, eventName... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/plugins/navigation-ui/navigation-ui.js | src/plugins/navigation-ui/navigation-ui.js | /**
* Navigation UI plugin
*
* This plugin provides UI elements "back", "forward" and a list to select
* a specific slide number.
*
* The navigation controls are added to the toolbar plugin via DOM events. User must enable the
* toolbar in a presentation to have them visible.
*
* Copyright 2016 Henrik Ingo (@h... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/lib/gc.js | src/lib/gc.js | /**
* Garbage collection utility
*
* This library allows plugins to add elements and event listeners they add to the DOM. The user
* can call `impress().lib.gc.teardown()` to cause all of them to be removed from DOM, so that
* the document is in the state it was before calling `impress().init()`.
*
* In addition... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/lib/rotation.js | src/lib/rotation.js | /**
* Helper functions for rotation.
*
* Tommy Tam (c) 2021
* MIT License
*/
( function( document, window ) {
"use strict";
// Singleton library variables
var roots = [];
var libraryFactory = function( rootId ) {
if ( roots[ "impress-root-" + rootId ] ) {
return roots[ "impres... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/src/lib/util.js | src/lib/util.js | /**
* Common utility functions
*
* Copyright 2011-2012 Bartek Szopka (@bartaz)
* Henrik Ingo (c) 2016
* MIT License
*/
( function( document, window ) {
"use strict";
var roots = [];
var libraryFactory = function( rootId ) {
if ( roots[ rootId ] ) {
return roots[ rootId ];
... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/non_default.js | test/non_default.js | /*
* Copyright 2016 Henrik Ingo (@henrikingo)
*
* Released under the MIT license. See LICENSE file.
*/
/* global document, console, setTimeout, loadIframe, initPresentation, _impressSupported, QUnit */
QUnit.module( "Non Default Values" );
QUnit.test( "Initialize Impress.js", function( assert ) {
console.log( ... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/core_tests.js | test/core_tests.js | /*
* Copyright 2016 Henrik Ingo (@henrikingo)
*
* Released under the MIT license. See LICENSE file.
*/
/* global document, console, setTimeout, loadIframe, initPresentation, _impressSupported, QUnit */
QUnit.module( "Core Tests" );
QUnit.test( "Initialize Impress.js", function( assert ) {
console.log( "Begin i... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/helpers.js | test/helpers.js | // This file contains so much HTML, that we will just respectfully disagree about js
/* jshint quotmark:single */
/* global document, console, setTimeout, navigator, QUnit */
/* exported loadIframe, initPresentation, _impressSupported */
// Log all QUnit assertions to console.log(), so that they are visible in karma o... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/plugins/rel/rel_to_tests.js | test/plugins/rel/rel_to_tests.js | QUnit.module( "rel plugin rel_to tests" );
QUnit.test( "rel_to", function( assert ) {
window.console.log( "Begin rel_to" );
var done = assert.async();
loadIframe( "test/plugins/rel/rel_to_tests_presentation.html", assert, function() {
initPresentation( assert, function() {
var iframe =... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/plugins/rel/padding_tests.js | test/plugins/rel/padding_tests.js | QUnit.module( "rel plugin padding tests" );
QUnit.test( "padding_relative", function( assert ) {
window.console.log( "Begin padding_relative" );
var done = assert.async();
loadIframe( "test/plugins/rel/padding_tests_presentation.html", assert, function() {
initPresentation( assert, function() {
var if... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/plugins/rel/relative_to_screen_size_tests.js | test/plugins/rel/relative_to_screen_size_tests.js | QUnit.module( "rel plugin relative to screen size tests" );
QUnit.test( "relative_to_screen_size", function( assert ) {
window.console.log( "Begin relative_to_screen_size" );
var done = assert.async();
loadIframe( "test/plugins/rel/relative_to_screen_size_tests_presentation.html", assert, function() {
initP... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/test/plugins/rel/rotation_tests.js | test/plugins/rel/rotation_tests.js | QUnit.module( "rel plugin rotation tests" );
QUnit.test( "rotation_relative", function( assert ) {
window.console.log( "Begin rotation_relative" );
var done = assert.async();
loadIframe( "test/plugins/rel/rotation_tests_presentation.html", assert, function() {
initPresentation( assert, function() {
va... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | false |
impress/impress.js | https://github.com/impress/impress.js/blob/c9f6c67457ceee5a011e554f67c447113640777d/js/impress.js | js/impress.js | // This file was automatically generated from files in src/ directory.
/*! Licensed under MIT License - http://github.com/impress/impress.js */
/**
* impress.js
*
* impress.js is a presentation tool based on the power of CSS3 transforms and transitions
* in modern browsers and inspired by the idea behind prezi.com... | javascript | MIT | c9f6c67457ceee5a011e554f67c447113640777d | 2026-01-04T14:59:50.229593Z | true |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/next.config.js | next.config.js | const bundleAnalyzer = require('@next/bundle-analyzer')
const withOffline = require('next-pwa')
const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === 'true' })
module.exports = withBundleAnalyzer(
withOffline({
pwa: {
disable: process.env.NODE_ENV !== 'production',
dest: 'publ... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/.eslintrc.js | .eslintrc.js | module.exports = {
env: { es6: true, jest: true },
extends: ['eslint:recommended', 'plugin:jsx-a11y/recommended', 'next'],
rules: {
'import/no-unresolved': 'error',
'no-duplicate-imports': 'error',
'react/display-name': 'off',
'react/jsx-no-target-blank': 'error',
'react/jsx-uses-react': 'erro... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/release.js | release.js | module.exports = require('now-release')
| javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/_document.js | pages/_document.js | import React from 'react'
import Document, { Html, Head, Main, NextScript } from 'next/document'
export default class Doc extends Document {
render() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
| javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/account.js | pages/account.js | // Theirs
import React from 'react'
import dynamic from 'next/dynamic'
// Ours
import Button from '../components/Button'
import Page from '../components/Page'
import MenuButton from '../components/MenuButton'
import { useAuth } from '../components/AuthContext'
import { loginGitHub, logout } from '../lib/client'
impor... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/index.js | pages/index.js | // Theirs
import React from 'react'
import { withRouter } from 'next/router'
import Either from 'eitherx'
// Ours
import EditorContainer from '../components/EditorContainer'
import Page from '../components/Page'
import { MetaLinks } from '../components/Meta'
class Index extends React.Component {
componentDidMount()... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/about.js | pages/about.js | import React from 'react'
import Page from '../components/Page'
function Contributors() {
const [contributors, setContributors] = React.useState([])
React.useEffect(() => {
fetch('https://api.github.com/repos/carbon-app/carbon/contributors?per_page=100')
.then(response => response.json())
.then(co... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/[id].js | pages/[id].js | import React from 'react'
import Router from 'next/router'
import IndexPage from './index'
import api from '../lib/api'
export async function getServerSideProps({ req, res, query }) {
const { id: path, filename } = query
const parameter = path.length >= 19 && path.indexOf('.') < 0 ? path : null
let snippet
... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/snippets.js | pages/snippets.js | // Theirs
import React from 'react'
import Link from 'next/link'
import Router from 'next/router'
import formatDistanceToNow from 'date-fns/formatDistanceToNow'
import { useAsyncCallback } from 'actionsack'
import Button from '../components/Button'
import LoginButton from '../components/LoginButton'
import ConfirmButt... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/api/oembed.js | pages/api/oembed.js | /*
* See oEmbed standard here: https://oembed.com/
*/
const url = require('url')
const toIFrame = (url, width, height) =>
`<iframe
src="https://carbon.now.sh/embed${url}"
width="${width}px"
height="${height}px"
style="width:${width}px; height:${height}px; border:0; overflow:auto;"
sandbox="allow-scripts ... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/api/image/[id].js | pages/api/image/[id].js | /* global domtoimage */
import qs from 'querystring'
import chrome from 'chrome-aws-lambda'
import puppeteer from 'puppeteer-core'
// TODO expose local version of dom-to-image
const DOM_TO_IMAGE_URL = 'https://unpkg.com/dom-to-image@2.6.0/dist/dom-to-image.min.js'
const NOTO_COLOR_EMOJI_URL =
'https://raw.githack.co... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/embed/index.js | pages/embed/index.js | // Theirs
import React from 'react'
import Head from 'next/head'
import { withRouter } from 'next/router'
// Ours
import ApiContext from '../../components/ApiContext'
import { StylesheetLink, CodeMirrorLink, MetaTags, HIGHLIGHTS_ONLY } from '../../components/Meta'
import Font from '../../components/style/Font'
import ... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/pages/embed/[id].js | pages/embed/[id].js | import React from 'react'
import Router from 'next/router'
import EmbedPage from './index'
import api from '../../lib/api'
export async function getServerSideProps({ req, res, query }) {
const { id: path, filename } = query
const parameter = path.length >= 19 && path.indexOf('.') < 0 ? path : null
let snippe... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/components/Overlay.js | components/Overlay.js | import React from 'react'
const Overlay = props => (
<div className="dnd-container">
{props.isOver ? <div className="dnd-overlay">{props.title}</div> : null}
{props.children}
<style jsx>
{`
.dnd-container {
position: relative;
}
.dnd-overlay {
display: f... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/components/BackgroundSelect.js | components/BackgroundSelect.js | import React from 'react'
import ImagePicker from './ImagePicker'
import ColorPicker from './ColorPicker'
import Button from './Button'
import Popout, { managePopout } from './Popout'
import { COLORS, DEFAULT_BG_COLOR } from '../lib/constants'
import { stringifyColor } from '../lib/util'
function validateColor(str) {... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/components/Toggle.js | components/Toggle.js | import React from 'react'
import Checkmark from './svg/Checkmark'
import { COLORS } from '../lib/constants'
class Toggle extends React.PureComponent {
static defaultProps = {
className: '',
}
toggle = () => this.props.onChange(!this.props.enabled)
render() {
return (
<div className={`toggle ${... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
carbon-app/carbon | https://github.com/carbon-app/carbon/blob/1334429ae63f9a3d052d59ec8c6b158fa5db0943/components/FontFace.js | components/FontFace.js | import React from 'react'
export default function FontFace(config) {
return (
<style jsx global>
{`
@font-face {
font-family: ${config.fontUrl ? config.fontFamily : ''};
src: url(${config.fontUrl || ''}) format('woff');
font-display: swap;
}
`}
</styl... | javascript | MIT | 1334429ae63f9a3d052d59ec8c6b158fa5db0943 | 2026-01-04T15:00:02.073156Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.