index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/seek-oss/playroom/src | petrpan-code/seek-oss/playroom/src/utils/cursor.ts | import type { CursorPosition } from '../StoreContext/StoreContext';
import { validateCode } from './compileJsx';
const breakoutString = '<b>"b"</b>';
export const insertAtCursor = ({
code,
cursor,
snippet,
}: {
code: string;
cursor: CursorPosition;
snippet: string;
}) => {
const { line, ch } = cursor;
... | 2,100 |
0 | petrpan-code/seek-oss/playroom/src | petrpan-code/seek-oss/playroom/src/utils/formatting.spec.ts | import {
positionToCursorOffset,
cursorOffsetToPosition,
formatCode,
formatAndInsert,
} from './formatting';
describe('cursor offset to position', () => {
it('should work for one line', () => {
const code = `<h1>Title</h1>`;
const position = 4; // Before the capital T
expect(cursorOffsetToPositi... | 2,101 |
0 | petrpan-code/seek-oss/playroom/src | petrpan-code/seek-oss/playroom/src/utils/formatting.ts | import prettier from 'prettier/standalone';
import babel from 'prettier/parser-babel';
import type { CursorPosition } from '../StoreContext/StoreContext';
import { insertAtCursor } from './cursor';
export interface CodeWithCursor {
code: string;
cursor: CursorPosition;
}
export const isMac = () => Boolean(navigat... | 2,102 |
0 | petrpan-code/seek-oss/playroom/src | petrpan-code/seek-oss/playroom/src/utils/params.ts | import { createBrowserHistory } from 'history';
import { useState, useEffect } from 'react';
import queryString, { type ParsedQuery } from 'query-string';
import playroomConfig from '../config';
const history = createBrowserHistory();
export function updateUrlCode(code: string) {
const { pathname } = history.locat... | 2,103 |
0 | petrpan-code/seek-oss/playroom/src | petrpan-code/seek-oss/playroom/src/utils/usePreviewUrl.ts | import { useContext } from 'react';
import { StoreContext } from '../StoreContext/StoreContext';
import { createPreviewUrl } from '../../utils';
import playroomConfig from '../config';
const baseUrl = window.location.href
.split(playroomConfig.paramType === 'hash' ? '#' : '?')[0]
.split('index.html')[0];
export ... | 2,104 |
0 | petrpan-code/seek-oss/playroom | petrpan-code/seek-oss/playroom/utils/index.d.ts | interface Snippet {
group: string;
name: string;
code: string;
}
type Snippets = Snippet[];
type ParamType = 'hash' | 'search';
interface CompressParamsOptions {
code?: string;
themes?: string[];
widths?: number[];
theme?: string;
}
export const compressParams: (options: CompressParamsOptions) => strin... | 2,105 |
0 | petrpan-code/seek-oss/playroom | petrpan-code/seek-oss/playroom/utils/index.js | const lzString = require('lz-string');
const compressParams = ({ code, themes, widths, theme }) => {
const data = JSON.stringify({
...(code ? { code } : {}),
...(themes ? { themes } : {}),
...(widths ? { widths } : {}),
...(theme ? { theme } : {}),
});
return lzString.compressToEncodedURICompone... | 2,106 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/.eslintignore | *.woff2
*.scss | 2,107 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/.eslintrc.json | {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"react-app",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react",
... | 2,108 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/.prettierrc | {
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
| 2,109 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/LICENSE | MIT License
Copyright (c) 2021 Tim
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, s... | 2,110 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/README.md | # kbar
kbar is a simple plug-n-play React component to add a fast, portable, and extensible <kbd>command</kbd> + <kbd>k</kbd> (command palette) interface to your site.

## Background
<kbd>Command</kbd> + <k... | 2,111 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/jest.config.js | module.exports = {
transform: {
"^.+\\.tsx?$": "esbuild-jest",
},
};
| 2,112 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/package-lock.json | {
"name": "kbar",
"version": "0.1.0-beta.44",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "kbar",
"version": "0.1.0-beta.44",
"license": "MIT",
"dependencies": {
"@radix-ui/react-portal": "^1.0.1",
"fast-equals": "^2.0.3",
"fuse.js": ... | 2,113 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/package.json | {
"name": "kbar",
"version": "0.1.0-beta.44",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"build": "rm -rf ./lib & tsc",
"build:example": "webpack --config ./example/webpack.prod.cjs",
"dev": "webpack-dev-server --config ./example/webpack.config.cjs --hot",
"test": "jest sr... | 2,114 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/tsconfig.json | {
"compilerOptions": {
"jsx": "react",
"declaration": true,
"target": "es5",
"lib": [
"es5",
"DOM"
],
"strict": true,
"noImplicitAny": false,
"esModuleInterop": true,
"moduleResolution": "node",
"rootDir": "src",
"outDir": "lib",
"module": "commonjs",
"s... | 2,115 |
0 | petrpan-code/timc1 | petrpan-code/timc1/kbar/vercel.json | {
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
}
| 2,116 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/example/webpack.config.cjs | const path = require("path");
const { ESBuildMinifyPlugin } = require("esbuild-loader");
module.exports = {
mode: "development",
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
entry: path.resolve(__dirname, "src/index.tsx"),
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist")... | 2,117 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/example/webpack.prod.cjs | const path = require("path");
const { ESBuildMinifyPlugin } = require("esbuild-loader");
module.exports = {
mode: "production",
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
entry: path.resolve(__dirname, "src/index.tsx"),
output: {
filename: "index.js",
path: path.resolve(__dirname, "dist"),... | 2,118 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/dist/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>⌘</text></svg>">
<!-- ... | 2,119 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/dist/index.js | (()=>{var Oa={418:_=>{"use strict";/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var E=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;function fe(Z){if(Z==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(Z)}funct... | 2,120 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/App.tsx | import "./index.scss";
import { Toaster } from "react-hot-toast";
import * as React from "react";
import { Switch, Route, useHistory, Redirect } from "react-router-dom";
import Layout from "./Layout";
import Home from "./Home";
import Docs from "./Docs";
import useDocsActions from "./hooks/useDocsActions";
import { use... | 2,121 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Blog.tsx | import * as React from "react";
import { createAction, useRegisterActions } from "../../src";
const parent = createAction({
name: "parent",
});
const child = createAction({
parent: parent.id,
name: "child",
});
const grandchild = createAction({
parent: child.id,
name: "grandchild",
});
const greatgrandchi... | 2,122 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Code.module.scss | .pre {
padding: calc(var(--unit) * 2);
background: var(--a1);
border-radius: var(--unit);
overflow: auto;
font-size: 15px;
}
| 2,123 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Code.tsx | import Highlight, { defaultProps } from "prism-react-renderer";
import * as React from "react";
import { classnames } from "./utils";
import styles from "./Code.module.scss";
interface Props {
code: string;
}
export default function Code(props: Props) {
return (
<Highlight
{...defaultProps}
code={... | 2,124 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Home.tsx | import * as React from "react";
import { Link } from "react-router-dom";
import Code from "./Code";
export default function Home() {
return (
<>
<p>
<b>
<a
href="https://github.com/timc1/kbar"
target="_blank"
rel="noreferrer"
>
kba... | 2,125 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Layout.module.scss | .wrapper {
max-width: 1024px;
width: 100%;
margin: auto;
padding: 32px;
}
.header {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: calc(var(--unit) * 4);
h1 {
margin: 0;
font-size: 24px;
}
button {
cursor: pointer;
background: none;
border: none;
... | 2,126 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Layout.tsx | import * as React from "react";
import { useKBar } from "../../src";
import styles from "./Layout.module.scss";
import Logo from "./Logo";
interface Props {
children: React.ReactNode;
}
export default function Layout(props: Props) {
const { query } = useKBar();
return (
<div className={styles.wrapper}>
... | 2,127 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/Logo.tsx | import * as React from "react";
export default function Logo() {
const style = {
fill: "var(--background)",
stroke: "var(--foreground)",
strokeMiterLimit: 10,
strokeWidth: "13px",
};
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1080 1080">
<defs></defs>
<rect
... | 2,128 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/index.scss | @font-face {
font-family: "Inter";
src: url("./fonts/Inter-Bold.woff2") format("woff2");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "Inter";
src: url("./fonts/Inter-Regular.woff2") format("woff2");
font-weight: 400;
}
// https://piccalil.li/blog/a-modern-css-reset/
/* Box sizing r... | 2,129 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/index.tsx | import * as React from "react";
import { render } from "react-dom";
import App from "./App";
import { BrowserRouter as Router } from "react-router-dom";
render(
<React.StrictMode>
<Router>
<App />
</Router>
</React.StrictMode>,
document.getElementById("root")
);
| 2,130 |
0 | petrpan-code/timc1/kbar/example | petrpan-code/timc1/kbar/example/src/utils.tsx | import * as React from "react";
export function classnames(...args: (string | undefined | null)[]) {
return args.filter(Boolean).join(" ");
}
export function useAnalytics() {
React.useEffect(() => {
const dev = window.location.host.includes("localhost");
if (!dev) {
const script = document.createEl... | 2,131 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/APIReference.tsx | import * as React from "react";
import { useLocation } from "react-router-dom";
import Code from "../Code";
import { useKBar } from "../../../src/useKBar";
export default function APIReference() {
const { disabled, query } = useKBar((state) => ({
disabled: state.disabled,
}));
return (
<div>
<h1>A... | 2,132 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/Actions.tsx | import * as React from "react";
import Code from "../Code";
export default function Actions() {
return (
<div>
<h1>Actions</h1>
<p>
When a user searches for something in kbar, the result is a list of
<code>ActionImpl</code>s. ActionImpls are a more complex, powerful
representa... | 2,133 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/GettingStarted.tsx | import * as React from "react";
import Code from "../Code";
export default function GettingStarted() {
return (
<div>
<h1>Getting started</h1>
<p>
Get a simple command bar up and running quickly. In this example, we
will use the APIs provided by kbar out of the box:
</p>
... | 2,134 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/Overview.tsx | import * as React from "react";
export default function Overview() {
return (
<div>
<h1>Overview</h1>
<p>
Command+k interfaces are used to create a web experience where any type
of action users would be able to do via clicking can be done through a
command menu.
</p>
... | 2,135 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/Priority.tsx | import * as React from "react";
import Code from "../Code";
export default function Priority() {
return (
<div>
<h1>Priority</h1>
<p>
You've successfully registered hundreds of actions and realize you
want to control the order in which they appear.
</p>
<p>
By... | 2,136 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/Shortcuts.tsx | import * as React from "react";
import Code from "../Code";
export default function Shortcuts() {
return (
<div>
<h1>Shortcuts</h1>
<p>
kbar comes out of the box for registering keystroke patterns and
triggering actions even when kbar is hidden.
</p>
<p>
When regis... | 2,137 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/State.tsx | import * as React from "react";
import Code from "../Code";
export default function State() {
return (
<div>
<h1>Interfacing with state</h1>
<p>
While it is great that kbar exposes some primitive components; e.g.{" "}
<code>KBarSearch</code>, <code>KBarResults</code>, etc., what if yo... | 2,138 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/UndoRedo.tsx | import * as React from "react";
import Code from "../Code";
export default function UndoRedo() {
return (
<div>
<h1>Undo/Redo</h1>
<p>
When instantiating kbar, we can optionally enable undo/redo
functionality through <code>options.enableHistory</code>:
</p>
<Code
c... | 2,139 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/data.ts | import Actions from "./Actions";
import APIReference from "./APIReference";
import GettingStarted from "./GettingStarted";
import Overview from "./Overview";
import Priority from "./Priority";
import Shortcuts from "./Shortcuts";
import State from "./State";
import UndoRedo from "./UndoRedo";
const data = {
introduc... | 2,140 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/index.tsx | import * as React from "react";
import {
Accordion,
AccordionButton,
AccordionPanel,
AccordionItem,
} from "@reach/accordion";
import styles from "./styles.module.scss";
import { Link, Switch, useLocation, Route } from "react-router-dom";
import data from "./data";
import { classnames } from "../utils";
export... | 2,141 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/Docs/styles.module.scss | .wrapper {
display: flex;
gap: 24px;
h1 {
margin-top: 0;
}
code {
background: var(--a1);
font-family: monospace;
padding: 4px;
border-radius: 4px;
}
}
.toc {
max-width: 200px;
width: 100%;
flex-grow: 1;
flex-shrink: 0;
ul {
margin: 0;
padding: 0;
list-style: non... | 2,142 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/hooks/useDocsActions.tsx | import * as React from "react";
import { useHistory } from "react-router-dom";
import { Action, useRegisterActions } from "../../../src";
import data from "../Docs/data";
const searchId = randomId();
export default function useDocsActions() {
const history = useHistory();
const searchActions = React.useMemo(() =... | 2,143 |
0 | petrpan-code/timc1/kbar/example/src | petrpan-code/timc1/kbar/example/src/hooks/useThemeActions.tsx | import { useRegisterActions } from "../../../src/useRegisterActions";
import toast from "react-hot-toast";
import * as React from "react";
function Toast({ title, action, buttonText }) {
return (
<div style={{ display: "flex", alignItems: "center", gap: 16 }}>
<span style={{ fontSize: 14 }}>{title}</span>
... | 2,144 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/InternalEvents.tsx | import * as React from "react";
import { ActionImpl } from "./action";
import tinykeys from "./tinykeys";
import { VisualState } from "./types";
import { useKBar } from "./useKBar";
import { getScrollbarWidth, shouldRejectKeystrokes } from "./utils";
type Timeout = ReturnType<typeof setTimeout>;
export function Inter... | 2,145 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/KBarAnimator.tsx | import * as React from "react";
import { VisualState } from "./types";
import { useKBar } from "./useKBar";
import { useOuterClick } from "./utils";
interface KBarAnimatorProps {
style?: React.CSSProperties;
className?: string;
disableCloseOnOuterClick?: boolean;
}
const appearanceAnimationKeyframes = [
{
... | 2,146 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/KBarContextProvider.tsx | import { useStore } from "./useStore";
import * as React from "react";
import { InternalEvents } from "./InternalEvents";
import type { IKBarContext, KBarProviderProps } from "./types";
export const KBarContext = React.createContext<IKBarContext>(
{} as IKBarContext
);
export const KBarProvider: React.FC<
React.P... | 2,147 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/KBarPortal.tsx | import { Portal } from "@radix-ui/react-portal";
import * as React from "react";
import { VisualState } from "./types";
import { useKBar } from "./useKBar";
interface Props {
children: React.ReactNode;
container?: HTMLElement;
}
export function KBarPortal({ children, container }: Props) {
const { showing } = us... | 2,148 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/KBarPositioner.tsx | import * as React from "react";
interface Props {
className?: string;
style?: React.CSSProperties;
}
const defaultStyle: React.CSSProperties = {
position: "fixed",
display: "flex",
alignItems: "flex-start",
justifyContent: "center",
width: "100%",
inset: "0px",
padding: "14vh 16px 16px",
};
functio... | 2,149 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/KBarResults.tsx | import * as React from "react";
import { useVirtual } from "react-virtual";
import { ActionImpl } from "./action/ActionImpl";
import { getListboxItemId, KBAR_LISTBOX } from "./KBarSearch";
import { useKBar } from "./useKBar";
import { usePointerMovedSinceMount } from "./utils";
const START_INDEX = 0;
interface Render... | 2,150 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/KBarSearch.tsx | import * as React from "react";
import { VisualState } from "./types";
import { useKBar } from "./useKBar";
export const KBAR_LISTBOX = "kbar-listbox";
export const getListboxItemId = (id: number) => `kbar-listbox-item-${id}`;
export function KBarSearch(
props: React.InputHTMLAttributes<HTMLInputElement> & {
de... | 2,151 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/index.tsx | import { createAction, Priority } from "./utils";
export { createAction, Priority };
export * from "./useMatches";
export * from "./KBarPortal";
export * from "./KBarPositioner";
export * from "./KBarSearch";
export * from "./KBarResults";
export * from "./useKBar";
export * from "./useRegisterActions";
export * from ... | 2,152 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/tinykeys.ts | // Fixes special character issues; `?` -> `shift+/` + build issue
// https://github.com/jamiebuilds/tinykeys
type KeyBindingPress = [string[], string];
/**
* A map of keybinding strings to event handlers.
*/
export interface KeyBindingMap {
[keybinding: string]: (event: KeyboardEvent) => void;
}
/**
* Options t... | 2,153 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/types.ts | import * as React from "react";
import { ActionImpl } from "./action/ActionImpl";
export type ActionId = string;
export type Priority = number;
export type ActionSection =
| string
| {
name: string;
priority: Priority;
};
export type Action = {
id: ActionId;
name: string;
shortcut?: string... | 2,154 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/useKBar.tsx | import * as React from "react";
import { KBarContext } from "./KBarContextProvider";
import type { KBarOptions, KBarQuery, KBarState } from "./types";
interface BaseKBarReturnType {
query: KBarQuery;
options: KBarOptions;
}
type useKBarReturnType<S = null> = S extends null
? BaseKBarReturnType
: S & BaseKBarR... | 2,155 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/useMatches.tsx | import * as React from "react";
import type { ActionImpl } from "./action/ActionImpl";
import { useKBar } from "./useKBar";
import { Priority, useThrottledValue } from "./utils";
import Fuse from "fuse.js";
export const NO_GROUP = {
name: "none",
priority: Priority.NORMAL,
};
const fuseOptions: Fuse.IFuseOptions<... | 2,156 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/useRegisterActions.tsx | import * as React from "react";
import type { Action } from "./types";
import { useKBar } from "./useKBar";
export function useRegisterActions(
actions: Action[],
dependencies: React.DependencyList = []
) {
const { query } = useKBar();
// eslint-disable-next-line react-hooks/exhaustive-deps
const actionsCac... | 2,157 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/useStore.tsx | import { deepEqual } from "fast-equals";
import * as React from "react";
import invariant from "tiny-invariant";
import { ActionInterface } from "./action/ActionInterface";
import { history } from "./action/HistoryImpl";
import type {
Action,
IKBarContext,
KBarOptions,
KBarProviderProps,
KBarQuery,
KBarStat... | 2,158 |
0 | petrpan-code/timc1/kbar | petrpan-code/timc1/kbar/src/utils.ts | import * as React from "react";
import type { Action } from "./types";
export function swallowEvent(event) {
event.stopPropagation();
event.preventDefault();
}
export function useOuterClick(
dom: React.RefObject<HTMLElement>,
cb: () => void
) {
const cbRef = React.useRef(cb);
cbRef.current = cb;
React.... | 2,159 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/__tests__/ActionImpl.test.ts | import { ActionImpl } from "../action";
import { Action } from "../types";
import { createAction } from "../utils";
const perform = jest.fn();
const baseAction: Action = createAction({
name: "Test action",
perform,
});
const store = {};
describe("ActionImpl", () => {
it("should create an instance of ActionImpl... | 2,160 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/__tests__/ActionInterface.test.ts | import { createAction } from "../utils";
import { ActionInterface } from "../action/ActionInterface";
const parent = createAction({
name: "parent",
});
const parent2 = createAction({
name: "parent2",
});
const child = createAction({
name: "child",
parent: parent.id,
});
const grandchild = createAction({
name... | 2,161 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/__tests__/Command.test.ts | import { ActionImpl } from "..";
import { Action } from "../types";
import { createAction } from "../utils";
import { Command } from "../action/Command";
import { history } from "../action/HistoryImpl";
const negate = jest.fn();
const perform = jest.fn().mockReturnValue(negate);
const baseAction: Action = createAction... | 2,162 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/__tests__/useMatches.test.tsx | /**
* @jest-environment jsdom
*/
import { useKBar } from "../useKBar";
import { KBarProvider } from "../KBarContextProvider";
import { render, fireEvent, RenderResult } from "@testing-library/react";
import * as React from "react";
import { createAction, Priority } from "../utils";
import { useMatches } from "../use... | 2,163 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/action/ActionImpl.ts | import invariant from "tiny-invariant";
import { Command } from "./Command";
import type { Action, ActionStore, History } from "../types";
import { Priority } from "../utils";
interface ActionImplOptions {
store: ActionStore;
ancestors?: ActionImpl[];
history?: History;
}
/**
* Extends the configured keywords ... | 2,164 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/action/ActionInterface.ts | import invariant from "tiny-invariant";
import type { ActionId, Action, History } from "../types";
import { ActionImpl } from "./ActionImpl";
interface ActionInterfaceOptions {
historyManager?: History;
}
export class ActionInterface {
actions: Record<ActionId, ActionImpl> = {};
options: ActionInterfaceOptions;
... | 2,165 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/action/Command.ts | import { HistoryItem } from "..";
import type { History } from "../types";
interface CommandOptions {
history?: History;
}
export class Command {
perform: (...args: any) => any;
private historyItem?: HistoryItem;
history?: {
undo: History["undo"];
redo: History["redo"];
};
constructor(
comma... | 2,166 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/action/HistoryImpl.ts | import type { History, HistoryItem } from "../types";
import { shouldRejectKeystrokes } from "../utils";
export class HistoryItemImpl implements HistoryItem {
perform: HistoryItem["perform"];
negate: HistoryItem["negate"];
constructor(item: HistoryItem) {
this.perform = item.perform;
this.negate = item.... | 2,167 |
0 | petrpan-code/timc1/kbar/src | petrpan-code/timc1/kbar/src/action/index.tsx | export * from "./ActionInterface";
export * from "./ActionImpl";
| 2,168 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/.coveragerc | [report]
omit =
setup.py
dtale/static/**
dtale/templates/**
exclude_lines =
if __name__ == .__main__.: | 2,169 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/.dockerignore | node_modules
custom_loaders | 2,170 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/.flake8 | [flake8]
max_line_length = 120
select = E, W, F
ignore = W503,E203
exclude = node_modules,ci,build,docs,custom_loaders
per-file-ignores =
dtale/views.py:E402
| 2,171 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/.isort.cfg | [settings]
not_skip =
dtale/__init__.py
dtale/dash_application/components/__init__.py
default_section = THIRDPARTY
known_first_party = dtale
known_flask = flask
sections = FUTURE,STDLIB,FLASK,THIRDPARTY,FIRSTPARTY,LOCALFOLDER | 2,172 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/.tern-project | {
"libs": [
"browser"
],
"loadEagerly": [
"static/**/*.js",
"static/**/*.jsx"
],
"plugins": {
"es_modules": {},
"node": {},
"jsx": {}
}
}
| 2,173 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/CHANGES.md | ## Changelog
### 3.7.0 (2023-10-2)
* Turn off "Custom Filter" functionality by default
* [#811](https://github.com/man-group/dtale/issues/811): weekday name function
### 3.6.0 (2023-9-29)
* [#804](https://github.com/man-group/dtale/issues/804): updated summarize code to string join using a pipe instead of comma
* [#8... | 2,174 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/DESCRIPTION.md | [](https://github.com/man-group/dtale)
* [Live Demo](http://alphatechadmin.pythonanywhere.com)
-----------------
[ 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but chang... | 2,176 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/MANIFEST.in | include README.md
include CHANGES.md
include DESCRIPTION.md
include LICENSE
include requirements.txt
include requirements-redis.txt
include requirements-test.txt
| 2,177 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/README.md | [](https://github.com/man-group/dtale)
* [Live Demo](http://alphatechadmin.pythonanywhere.com)
* [Animated US COVID-19 Deaths By State](http://alphatechadmin.pythonanywhere.com/dtale/charts/3?chart_type=maps&query=date+%3E+%2720200301... | 2,178 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/SECURITY.md | # Security Policy
## Reporting a Vulnerability
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, report security vulnerabilities by email to [`arcticdb@man.com`](mailto:arcticdb@man.com).
### Email content
Please include the requested information listed below (as much as you ... | 2,179 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/codecov.yml | github_enterprise:
webhook_secret: dtale2019manNumeric
coverage:
status:
project:
default: false
python:
target: 85%
paths: "dtale/"
react:
target: 85%
paths: "static/" | 2,180 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/docker-compose.yml | version: '3.4'
services:
dtale_2_7:
image: dtale_2_7:latest
env_file:
- ./docker/dtale.env
build:
context: .
dockerfile: docker/2_7/Dockerfile
dtale_3_6:
image: dtale_3_6:latest
env_file:
- ./docker/dtale.env
build:
context: .
dockerfile: docker/3_6/Docke... | 2,181 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/pytest.ini | [pytest]
norecursedirs = .git cfg docker node_modules ci .eggs build
markers =
unit: marks tests as fast (deselect with '-m "not unit"') | 2,182 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/requirements-redis.txt | redis
redislite
| 2,183 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/requirements-test.txt | importlib-metadata<=3.7.3; python_version <= '3.6'
importlib-metadata; python_version != '3.6'
ipython<8.0.0
mock
nbconvert
pytest
pytest-cov
pytest-server-fixtures
| 2,184 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/requirements.txt | lz4<=2.2.1; python_version < '3.0'
lz4<=3.1.10; python_version < '3.6'
lz4; python_version > '3.6'
beautifulsoup4; python_version > '3.0'
beautifulsoup4<=4.9.3; python_version == '2.7'
Brotli<=1.0.9; python_version == '2.7'
certifi<=2021.10.8; python_version == '2.7'
certifi; python_version > '3.0'
cycler; python_versi... | 2,185 |
0 | petrpan-code/man-group | petrpan-code/man-group/dtale/setup.py | #!/usr/bin/env python
from __future__ import print_function
import logging
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
def read_file(path):
# if this fails on windows then add the following environment variable (PYTHONUTF8=1)
with open(path)... | 2,186 |
0 | petrpan-code/man-group/dtale | petrpan-code/man-group/dtale/.circleci/config.yml | javascript: &javascript
parallelism: 1
shell: /bin/bash --login
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
CODECOV_TOKEN: b0d35139-0a75-427a-907b-2c78a762f8f0
steps:
- checkout
- run: mkdir -p $CIRCLE_TEST_REPORTS
... | 2,187 |
0 | petrpan-code/man-group/dtale | petrpan-code/man-group/dtale/docker/dtale.env | VERSION=3.7.0
TZ=America/New_York
| 2,188 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/2_7/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,189 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/3_10/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,190 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/3_11/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,191 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/3_6/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,192 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/3_7/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,193 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/3_8/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,194 |
0 | petrpan-code/man-group/dtale/docker | petrpan-code/man-group/dtale/docker/3_9/Dockerfile | FROM node:10.16.0-alpine as node_build
RUN set -eux \
; apk add git
COPY . /workspace
WORKDIR /workspace/frontend
RUN set -eux \
; yarn install --frozen-lockfile \
; yarn list --depth=0 \
; yarn run lint \
; yarn run format \
; git diff --name-status ./static \
; git diff-files --quiet ./static || (ech... | 2,195 |
0 | petrpan-code/man-group/dtale | petrpan-code/man-group/dtale/docs/CONFIGURATION.md | # D-Tale Configuration
There are a lot of parameters that can be passed to the `dtale.show()` function and if you're calling this function often which similar parameters it can become quite cumbersome. Not to fear, there is a way around this and it is via an `.ini` file.
There are two options for specifying the `.in... | 2,196 |
0 | petrpan-code/man-group/dtale | petrpan-code/man-group/dtale/docs/DRAGGABLE_RESIZABLE_MODALS.md | # Spicy Resizable & Draggable Boostrap Modals in React
[](http://www.youtube.com/watch?v=SZdKhOO09po "Modals")
I had been using Boostrap modals in my open-source software, [D-Tale](https://github.com/man-group/dtale), for the last year and I had always been meaning to e... | 2,197 |
0 | petrpan-code/man-group/dtale | petrpan-code/man-group/dtale/docs/EMBEDDED_DJANGO.md | # How to Embed D-Tale Within a Django App
## Install Dependencies & Create Django Sample App
To start off run the following commands within your virtual environment:
```console
home:~ pip install dtale
home:~ pip install Django
home:~ django-admin startproject dtale_test
```
## Add `dispatcher.py`
The Django projec... | 2,198 |
0 | petrpan-code/man-group/dtale | petrpan-code/man-group/dtale/docs/EMBEDDED_DTALE_STREAMLIT.md | # Using D-Tale within Streamlit
**1)** Either install Streamlit directly or using the D-Tale extra:
- `pip install streamlit`
- `pip install dtale[streamlit]`
**2)** Invoke your Streamlit script using the `dtale-streamlit` command instead of the `streamlit` command:
- `dtale-streamlit run my_streamlit_script.py`
###... | 2,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.