repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
khoadaxne15/LastProject
src/views/checkout/step2/ShippingTotal.tsx
import { useFormikContext } from "formik"; import React from "react"; import { displayMoney } from "../../../helpers"; export const ShippingTotal: React.FC<ShippingTotalProps> = ({ subtotal }) => { const { values } = useFormikContext(); return ( <div className="checkout-total d-flex-end padding-right-m"> ...
khoadaxne15/LastProject
src/components/common/AdminSidePanel.tsx
import React from "react"; import { NavLink } from "react-router-dom"; import { ADMIN_PRODUCTS, EDIT_PRODUCT, } from "../../constants"; export const AdminSideBar = () => ( <aside className="sidenavigation"> <div className="sidenavigation-wrapper"> <div className="sidenavigation-item"> <NavLink ac...
khoadaxne15/LastProject
src/redux/store/store.ts
<gh_stars>0 import { applyMiddleware, compose, createStore } from "redux"; import { persistCombineReducers, persistStore } from "redux-persist"; import storage from "redux-persist/lib/storage"; import createSagaMiddleware from "redux-saga"; import { rootReducer } from "../reducers"; import { rootSaga } from "../sagas"...
stankaholic/fight-bot
src/deploy-commands.ts
<reponame>stankaholic/fight-bot<filename>src/deploy-commands.ts import { SlashCommandBuilder } from '@discordjs/builders'; import { REST } from '@discordjs/rest'; import { Routes } from 'discord-api-types/v9'; import 'dotenv/config'; import Environment from './util/Environment'; const env = new Environment(process.env...
stankaholic/fight-bot
src/app.ts
import * as Discord from 'discord.js'; import 'dotenv/config'; import InteractionHandler from './discord/InteractionHandler'; import LoggerFactor from './services/Logging/LoggerFactory'; import UfcService from './services/UfcService'; import Environment from './util/Environment'; const env = new Environment(process.en...
stankaholic/fight-bot
src/discord/InteractionHandler.ts
import { CommandInteraction, Interaction, MessageEmbed } from 'discord.js'; import { Event, parseEvent, parseEvents } from '../services/FightParser'; import Logger from '../services/Logging/Logger'; import UfcService from '../services/UfcService'; export default class InteractionHandler { private readonly prefix: st...
stankaholic/fight-bot
src/util/Environment.ts
export default class Environment { public readonly DISCORD_TOKEN: string; public readonly PAPERTRAIL_API_TOKEN: string; public readonly NODE_ENV: string; public readonly LOGGING_LEVEL: string; public readonly CLIENT_ID: string; public readonly GUILD_ID: string; public constructor(env: NodeJS.ProcessEnv) ...
stankaholic/fight-bot
src/services/Logging/Logger.ts
import * as Winston from 'winston'; export default class Logger { private readonly logger: Winston.Logger; public constructor(logger: Winston.Logger) { this.logger = logger; this.info = this.info.bind(this); this.warn = this.warn.bind(this); this.error = this.error.bind(this); this.debug = th...
stankaholic/fight-bot
src/services/UfcService.ts
import axios from 'axios'; import Logger from './Logging/Logger'; export default class UfcService { private readonly logger: Logger; private static readonly EVENTS_URL = 'https://www.ufc.com/events'; public constructor(logger: Logger) { this.logger = logger; this.fetchData = this.fetchData.bind(this); ...
stankaholic/fight-bot
src/services/FightParser.ts
<reponame>stankaholic/fight-bot import * as Cheerio from 'cheerio'; const baseUrl = 'https://www.ufc.com'; const titleClass = '.c-hero__headline-prefix'; const subtitleClass = '.c-hero__headline.is-large-text'; const dateClass = '.c-hero__headline-suffix'; const weightClass = '.c-listing-fight__class'; const fighte...
stankaholic/fight-bot
src/services/Logging/LoggerFactory.ts
<filename>src/services/Logging/LoggerFactory.ts import * as Winston from 'winston'; import Environment from '../../util/Environment'; import Logger from './Logger'; export default class LoggerFactor { public static createLogger(env: Environment): Logger { const logger = Winston.createLogger({ level: env.LO...
piglovesyou/react-apollo-loader-example
src/data/graphql/Scalar/Timestamp/index.ts
<filename>src/data/graphql/Scalar/Timestamp/index.ts import { GraphQLScalarType } from 'graphql'; import { Kind } from 'graphql/language'; export const schema = [ ` # GraphQL cannot handle long - normal timestamp will go failed. # In that case, use Timestamp. scalar Timestamp `, ]; export const resolvers = {...
piglovesyou/react-apollo-loader-example
src/data/graphql/Database/schema.ts
import merge from 'lodash.merge'; /** * Queries ** */ import { schema as GetAllUsers, queries as GetAllUsersQueries, resolvers as GetAllUsersResolver, } from './users/GetAllUsers'; import { queries as GetLoggedInUserQueries, resolvers as GetLoggedInUserResolver, } from './users/GetLoggedInUser'; /** * Mutat...
piglovesyou/react-apollo-loader-example
src/data/models/User.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import DataType, { Model } from 'sequelize'; import seq...
piglovesyou/react-apollo-loader-example
src/components/Layout/Layout.test.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ /* eslint-env jest */ /* eslint-disable padded-blocks, ...
piglovesyou/react-apollo-loader-example
src/data/models/index.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import sequelize from '../sequelize'; import User from ...
piglovesyou/react-apollo-loader-example
src/history.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import { createBrowserHistory, History } from 'history'...
piglovesyou/react-apollo-loader-example
src/data/graphql/Database/users/CreateUser.ts
import { User, UserProfile } from '../../../models'; export const schema = [ ` # User profile data for creating a new local database user account input UserProfile { # A display name for the logged-in user displayName: String! # A profile picture URL picture: String # The user's gender ...
piglovesyou/react-apollo-loader-example
src/components/Footer/Footer.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React, { FunctionComponent } from 'react'; impor...
piglovesyou/react-apollo-loader-example
src/routes/register/Register.tsx
<gh_stars>0 /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import useStyles...
piglovesyou/react-apollo-loader-example
src/routes/error/ErrorPage.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import withStyles from 'isom...
piglovesyou/react-apollo-loader-example
src/data/graphql/OnMemoryState/networkStatus.ts
export const defaults = { networkStatus: { __typename: 'NetworkStatus', isConnected: true, }, }; export const resolvers = { Mutation: { updateNetworkStatus: (_: any, { isConnected }: any, { cache }: any) => { const data = { networkStatus: { __typename: 'NetworkStatus', ...
piglovesyou/react-apollo-loader-example
src/data/graphql/OnMemoryState/schema.ts
import merge from 'lodash.merge'; import { resolvers as networkStatusResolvers, defaults as networkStatusDefaults, schema as networkStatusSchema, queries as networkStatusQuery, mutations as networkStatusMutation, } from './networkStatus'; import { schema as userSchema, queries as userQueries } from './user'...
piglovesyou/react-apollo-loader-example
src/routes/home/Home.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import useStyles from 'isomo...
piglovesyou/react-apollo-loader-example
src/data/graphql/News/schema.ts
import merge from 'lodash.merge'; /** * Queries ** */ import { schema as GetAllReactJSNews, queries as GetAllReactJSNewsQueries, resolvers as GetAllReactJSNewsResolver, } from './reactjsnews.com/GetAllReactJSNews'; export const schema = [...GetAllReactJSNews]; export const queries = [...GetAllReactJSNewsQuerie...
piglovesyou/react-apollo-loader-example
src/data/models/UserProfile.ts
<filename>src/data/models/UserProfile.ts /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import DataTyp...
piglovesyou/react-apollo-loader-example
src/data/graphql/Scalar/schema.ts
import merge from 'lodash.merge'; import { schema as TimestampSchema, resolvers as TimestampResolvers, } from './Timestamp'; export const schema = [...TimestampSchema]; export const resolvers = merge(TimestampResolvers);
piglovesyou/react-apollo-loader-example
src/data/sequelize.ts
<filename>src/data/sequelize.ts /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import { Sequelize } fr...
piglovesyou/react-apollo-loader-example
src/data/graphql/Database/users/GetLoggedInUser.ts
<gh_stars>0 import { User, UserClaim, UserLogin, UserProfile } from '../../../models'; export const queries = [ ` # Retrieves information about the currently logged-in user databaseGetLoggedInUser: DatabaseUser `, ]; export const resolvers = { RootQuery: { async databaseGetLoggedInUser(parent: any, args: ...
piglovesyou/react-apollo-loader-example
tools/lib/test-fns.ts
<filename>tools/lib/test-fns.ts import { ExecaChildProcess } from 'execa'; import terminate from 'terminate'; import i from 'log-symbols'; import waitOn from 'wait-on'; import puppeteer, { Browser, Page } from 'puppeteer'; export function success(...args: string[]) { return console.info(i.success, ...args); } expor...
piglovesyou/react-apollo-loader-example
src/components/Page/Page.tsx
<filename>src/components/Page/Page.tsx /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React fro...
piglovesyou/react-apollo-loader-example
tools/lib/cp.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import cp, { ExecOptions } from 'child_process'; import...
piglovesyou/react-apollo-loader-example
src/data/models/UserClaim.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import DataType, { Model } from 'sequelize'; import seq...
piglovesyou/react-apollo-loader-example
src/data/schema.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import { DocumentNode } from 'graphql'; import merge fr...
piglovesyou/react-apollo-loader-example
tools/lib/overrideRules.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ function overrideRules(rules: any, patch: any) { retu...
piglovesyou/react-apollo-loader-example
src/components/Layout/Layout.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React, { FunctionComponent } from 'react'; impor...
piglovesyou/react-apollo-loader-example
src/data/graphql/News/reactjsnews.com/GetAllReactJSNews.ts
import fetch from 'node-fetch'; import { ReactJsNewsItem } from '../../../../__generated__/dataBinders'; export const schema = [ ` # A single news article from [https://reactjsnews.com/](https://reactjsnews.com/) type ReactJSNewsItem { # The news item's title title: String! # A direct link URL to th...
piglovesyou/react-apollo-loader-example
src/routes/index.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ /* eslint-disable global-require */ // The top-level (...
piglovesyou/react-apollo-loader-example
src/data/graphql/OnMemoryState/user.ts
<filename>src/data/graphql/OnMemoryState/user.ts export const schema = [ ` type User { id: String! } `, ]; export const queries = [ ` user: User `, ];
piglovesyou/react-apollo-loader-example
src/routes/login/Login.tsx
<reponame>piglovesyou/react-apollo-loader-example /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ impor...
piglovesyou/react-apollo-loader-example
src/router.ts
<reponame>piglovesyou/react-apollo-loader-example /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ impor...
piglovesyou/react-apollo-loader-example
src/components/Html.tsx
<reponame>piglovesyou/react-apollo-loader-example /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ impor...
piglovesyou/react-apollo-loader-example
src/components/Link/Link.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React, { ReactNode } from 'react'; import histor...
piglovesyou/react-apollo-loader-example
typings/express.d.ts
import 'express-serve-static-core'; declare module 'express-serve-static-core' { import { Express } from 'express'; interface Application { // RSK uses an internal function "handle" in start.ts. handle(req: Request, res: Response): Express; } } declare global { namespace Express { // For use of p...
piglovesyou/react-apollo-loader-example
tools/lib/markdown-loader.ts
<gh_stars>1-10 /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import webpack from 'webpack'; import pa...
piglovesyou/react-apollo-loader-example
src/routes/home/index.tsx
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React from 'react'; import Home from './Home'; i...
piglovesyou/react-apollo-loader-example
tools/__tests__/start.ts
import assert from 'assert'; import path from 'path'; import { Browser, Page } from 'puppeteer'; import { readFile, writeFile } from '../lib/fs'; import { killApp, waitApp, timeout, openBrowser, getUrl, } from '../lib/test-fns'; import { spawn } from '../lib/cp'; const startApp = (cwd: string, port: number) ...
piglovesyou/react-apollo-loader-example
src/core/createApolloClient/createApolloClient.server.ts
import { ApolloClient } from 'apollo-client'; import { from } from 'apollo-link'; import { onError } from 'apollo-link-error'; import { SchemaLink } from 'apollo-link-schema'; import merge from 'lodash.merge'; import gql from 'graphql-tag'; import createCache from './createCache'; import { resolvers as clientResolver...
piglovesyou/react-apollo-loader-example
src/components/Navigation/Navigation.tsx
<reponame>piglovesyou/react-apollo-loader-example /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ impor...
piglovesyou/react-apollo-loader-example
src/components/Feedback/Feedback.tsx
<filename>src/components/Feedback/Feedback.tsx /** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import R...
piglovesyou/react-apollo-loader-example
tools/bundle.ts
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-present Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import webpackConfig from './webpack.config'; import ru...
PhilipCorr/airbyte
airbyte-webapp/src/packages/cloud/views/workspaces/WorkspacePopout/WorkspacePopout.tsx
<filename>airbyte-webapp/src/packages/cloud/views/workspaces/WorkspacePopout/WorkspacePopout.tsx import React, { useMemo } from "react"; import styled from "styled-components"; import { components } from "react-select"; import { FormattedMessage, useIntl } from "react-intl"; import { MenuListComponentProps } from "reac...
Procedural-Fox/aki_CustomQuestsEditor
src/helpers/locales.ts
import { LocaleName } from '../types'; export const ALL_LOCALES: LocaleName[] = [ 'ch', 'cz', 'en', 'es-mx', 'es', 'fr', 'ge', 'hu', 'it', 'jp', 'kr', 'pl', 'po', 'ru', 'sk', 'tu', ];
Procedural-Fox/aki_CustomQuestsEditor
src/helpers/queststring_validation.ts
import { LocaleName, QuestString } from '../types'; import { ALL_LOCALES } from './locales'; export const isValidLocale = (str: string): str is LocaleName => { return (ALL_LOCALES as string[]).includes(str); }; const checkForQuestStringErrors = (questString: any): string | null => { if (typeof questString === 'st...
Procedural-Fox/aki_CustomQuestsEditor
src/helpers/all_quests_images.ts
export const ALL_QUESTS_IMAGES = [ '5a27c50f86f7740b3d65e16a', '5a27c44386f7744237421af0', '5a27cafa86f77424e20615d6', '5a29221d86f77457303da9fa', '5a29222486f77456f50d09e7', '5ac4d8f186f774422237860d', '5ac4d9aa86f7744784484abf', '5ac4da0486f7744cc7701bdc', '5ac4db0986f77442000164dd', '5ac4dbb086f7...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestGenericDropdown/index.tsx
import { Component, createEffect, createMemo, createSignal, For, Match, Show, Switch, } from 'solid-js'; type Props = { paddingValue?: number; formIndex: number; allValues: string[]; value: string; setValue?: (v: string) => void; uniqId: string; fieldName?: string; onSelectValue?: (v: s...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/MissionNeedSurviveInput/index.tsx
import { Component, createMemo, Show } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { MissionPlaceBeacon, MissionPlaceItem, MissionPlaceSignalJammer, MissionVisitPlace, } from '../../../types'; import { MissionUpdator } from '../QuestMissionsForm/types'; import { QuestStringInput } fro...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestMissionsForm/ChooseMissionType.tsx
<gh_stars>0 import { Component, For } from 'solid-js'; import { MissionType, VALID_MISSION_TYPES } from '../../../helpers/mission_validation'; type MissionProps = { onClickType: (missionType: MissionType) => void; }; export const ChooseMissionType: Component<MissionProps> = props => { return ( <div style={{ ...
Procedural-Fox/aki_CustomQuestsEditor
src/types.ts
import { DeepReadonly } from 'solid-js/store'; const ALL_DESCRIPTIVE_LOCATION_OBJ = { any: true, customs: true, factory: true, laboratory: true, interchange: true, lighthouse: true, reserve: true, shoreline: true, woods: true, }; const ALL_LOCATIONS_OBJ = { any: true, customs: true, factory: t...
Procedural-Fox/aki_CustomQuestsEditor
src/helpers/validation.ts
import { QuestData, QuestType, QuestRewards, ALL_DESCRIPTIVE_LOCATION } from '../types'; import { assertValidMission } from './mission_validation'; import { assertValidQuestString } from './queststring_validation'; export const ALL_QUEST_TYPES = ['Completion', 'PickUp', 'Elimination', 'Loyalty', 'Discover']; const DE...
Procedural-Fox/aki_CustomQuestsEditor
src/index.tsx
import { render } from 'solid-js/web'; import './index.css'; import App from './App'; const rootElement = document.getElementById('root'); if (!rootElement) { throw new Error('Fatal: no div #root found in the DOM'); } render(() => <App />, rootElement);
Procedural-Fox/aki_CustomQuestsEditor
src/helpers/allZonesByMap.ts
<gh_stars>1-10 export const allZonesByMap: Record<string, string[]> = { bigmap: [ 'gazel', 'place_peacemaker_007_N1', 'place_peacemaker_002_N1', 'place_peacemaker_002_N2', 'place_peacemaker_002_N3', 'extraction_zone_zibbo', 'fuel1', 'fuel2', 'fuel3', 'fuel4', 'place_skier_1...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestMissionsForm/MissionVisitPlaceForm.tsx
import { Component } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { MissionVisitPlace } from '../../../types'; import { MissionNeedSurviveInput } from '../MissionNeedSurviveInput'; import { MissionPlaceIdInput } from '../MissionPlaceIdInput'; import { QuestStringInput } from '../QuestStringInp...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestMissionsForm/MissionKillForm.tsx
import { Component, createMemo } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { VALID_KILL_TARGETS } from '../../../helpers/mission_validation'; import { ALL_LOCATIONS, KillTarget, MissionKill, PossibleLocation } from '../../../types'; import { IdsForm } from '../IdsForm'; import { QuestNumber...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestMissionsForm/MissionPlaceItemForm.tsx
<gh_stars>1-10 import { Component, createMemo, Show } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { MissionPlaceBeacon, MissionPlaceItem, MissionPlaceSignalJammer } from '../../../types'; import { MissionAcceptedItemsInput } from '../MissionAcceptedItemsInput'; import { MissionNeedSurviveInpu...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/MissionPlaceIdInput/index.tsx
<reponame>Procedural-Fox/aki_CustomQuestsEditor import { Component, createEffect, createMemo, createSignal } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { allPlacesByMap } from '../../../helpers/allPlacesByMap'; import { MissionVisitPlace } from '../../../types'; import { MissionUpdator } fro...
Procedural-Fox/aki_CustomQuestsEditor
src/components/QuestForm/index.tsx
<gh_stars>0 import { Component, createMemo } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { ALL_DESCRIPTIVE_LOCATION, DescriptiveLocation, QuestData, QuestType, QuestUpdator, } from '../../types'; import { QuestDisabledInput } from '../forms/QuestDisabledInput'; import { QuestSimpleInput } fro...
Procedural-Fox/aki_CustomQuestsEditor
src/components/AppTitle/index.tsx
import { Component } from 'solid-js'; type AppTitleProps = { children: string; customQuestsVersion: string }; export const AppTitle: Component<AppTitleProps> = props => { return ( <> <div style={{ position: 'relative', 'background-color': '#121212', padding: '15px 30px 15px 30px', color: 'white'...
Procedural-Fox/aki_CustomQuestsEditor
src/components/QuestsFiles/index.tsx
import { dropLast } from 'ramda'; import { Accessor, Component, For } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { LoadedJsonFile } from '../../types'; import { MainMenu, MainMenuItem } from '../MainMenu'; const removeJsonExt = (fileName: string): string => { const splitted = fileName.sp...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/MissionZoneIdInput/index.tsx
<reponame>Procedural-Fox/aki_CustomQuestsEditor import { Component, createEffect, createMemo, createSignal } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { allZonesByMap } from '../../../helpers/allZonesByMap'; import { MissionPlaceBeacon, MissionPlaceItem, MissionPlaceSignalJammer } from '../...
Procedural-Fox/aki_CustomQuestsEditor
src/helpers/allPlacesByMap.ts
export const allPlacesByMap: Record<string, string[]> = { bigmap: [ 'gazel', 'dead_posylni', 'vremyan_case', 'room206_water', 'vaz_feld', 'room114', 'room214', 'bomj_place', 'place_SADOVOD_03', ], woods: ['bunker2', 'ter_015_area_1', 'huntsman_001', 'pr_scout_col', 'pr_scout_b...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestMissionsForm/types.ts
<gh_stars>1-10 import { DeepReadonly } from 'solid-js/store'; import { QuestMission } from '../../../types'; type Updator<T> = (fn: (x: T) => T) => void; export type MissionUpdator<T = QuestMission> = Updator<DeepReadonly<T>>;
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestStringInput/index.tsx
import { Component, createEffect, createMemo, createSignal, For, Match, Switch } from 'solid-js'; import { ALL_LOCALES } from '../../../helpers/locales'; import { isValidLocale } from '../../../helpers/queststring_validation'; import { QuestString, LocaleName, QuestStringUpdator } from '../../../types'; type Props = {...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestItemInput/index.tsx
<gh_stars>0 import { take } from 'ramda'; import { Component, createEffect, createMemo, createSignal, For, Show } from 'solid-js'; let ALL_TEMPLATES: (readonly [string, { Name: string }])[] = []; let LOCALES_TEMPLATES: Record<string, { Name: string } | undefined> = {}; import('../../../assets/db/locales/global/en.jso...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/MissionAcceptedItemsInput/index.tsx
import { remove, update } from 'ramda'; import { Component, For } from 'solid-js'; import { QuestItemInput } from '../QuestItemInput'; type ItemIds = readonly string[]; type Props = { items: ItemIds; updateItems: (fn: (r: ItemIds) => ItemIds) => void; uniqId: string; }; export const MissionAcceptedItemsInput: ...
Procedural-Fox/aki_CustomQuestsEditor
src/components/DownloadButton/index.tsx
import { pipe } from 'ramda'; import { Component, createMemo } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { LoadedJsonFile, QuestData } from '../../types'; type DownloadButtonProps = { tabIndex?: number; loadedJsonFiles: DeepReadonly<LoadedJsonFile[]>; selectedQuestFile: null | number...
Procedural-Fox/aki_CustomQuestsEditor
src/components/forms/QuestMissionsForm/MissionGiveItemForm.tsx
import { Component, createMemo } from 'solid-js'; import { DeepReadonly } from 'solid-js/store'; import { MissionGiveItem } from '../../../types'; import { MissionAcceptedItemsInput } from '../MissionAcceptedItemsInput'; import { QuestFoundInRaidOnly } from '../QuestFoundInRaidOnly'; import { QuestNumberInput } from '....
Procedural-Fox/aki_CustomQuestsEditor
src/components/DndJsonHandler/index.tsx
import { Component, onCleanup, Signal } from 'solid-js'; import { noop } from '../../utils/noop'; type Props = { isDraggingSignal: Signal<boolean>; onDropJson?: (fileName: string, jsonObject: object) => void; onDropInvalidJson?: (err: unknown) => void; }; const DndJsonHandler: Component<Props> = props => { c...
fabianschwarzfritz/colorful-oled-js
playground.ts
import { Board } from "johnny-five" const board = new Board() import { ColorfulOled, DefaultColors } from "./index" const oled = new ColorfulOled(board, 0, { width: 128, height: 128, }) oled.drawPixel(5, 5, DefaultColors.BLUE)
fabianschwarzfritz/colorful-oled-js
index.ts
import { Board, Pin } from "johnny-five" enum TransferType { Command = 0x00, Data = 0x40 } enum Command { SET_COLUMN_START_ADDRESS = 0x15, SET_COLUMN_END_ADDRESS = 0x15, SET_ROW_START_ADDRESS = 0x75 , SET_ROW_END_ADDRESS = 0x75, SET_CONTRAST_COLOR_A = 0x81, SET_CONTRAST_COLOR_B = 0x82...
fabianschwarzfritz/colorful-oled-js
test/test.ts
import { Board } from "johnny-five" import { ColorfulOled } from "./../index" var sinon = require('sinon'); describe('Colorful Oled', function() { it('#constructor initializes display', function() { const board = sinon.mock(Board); board.io = sinon.mock(); board.io.i2cWrite = sinon.spy(); ...
Paul-Long/virtual-dom-simple
src/vite-env.d.ts
<reponame>Paul-Long/virtual-dom-simple /// <reference types="vite/client" /> interface ElementNode { tag: string; props: object; key?: string; text?: string; children?: ElementNode[] | string[] }
Paul-Long/virtual-dom-simple
src/App.tsx
<gh_stars>0 import React, {CSSProperties} from 'react' interface AppProps { title: string; style?: CSSProperties } function App(props: AppProps) { return ( <div className="App" style={props.style}> <div id="realDom"> <div id="real-container"> <p>{props.title}</p> <div>canno...
Paul-Long/virtual-dom-simple
src/virtual-dom/patch.ts
<filename>src/virtual-dom/patch.ts export function patch() { }
Paul-Long/virtual-dom-simple
src/virtual-dom/diff.ts
function diffProps() { } function diffChildren() { } export function diff(oldNode: ElementNode, newNode: ElementNode) { if (oldNode === newNode) { return; } if (oldNode.tag === newNode.tag && oldNode.key === newNode.key) { // change diffProps(); diffChildren() } if (oldNode.tag !== newNode...
Paul-Long/virtual-dom-simple
src/Main.tsx
<reponame>Paul-Long/virtual-dom-simple import React from 'react' import ReactDOM from 'react-dom' import {el} from './virtual-dom/element' import './index.css' import App from './App' const app = <App title='Virtual DOM' style={{width: '100%'}} />; console.log(app) ReactDOM.render( <React.StrictMode> {app} </...
Paul-Long/virtual-dom-simple
src/virtual-dom/element.ts
<reponame>Paul-Long/virtual-dom-simple<gh_stars>0 export function el(tag: string, props: Record<string, any>, key: string, children: ElementNode[] | string[]) { return new Element({tag, props, key, children}) } class Element implements ElementNode { children: ElementNode[] | string[] = []; props: object = {}; ...
CadeXu/xiaomi-mall-mobile
web/shims.d.ts
<filename>web/shims.d.ts<gh_stars>0 declare module 'swiper/swiper-bundle'; declare module 'nprogress'; declare module 'dompurify'
webilix/regex-library
dist/lib/password.d.ts
<reponame>webilix/regex-library<filename>dist/lib/password.d.ts export declare const PASSWORD: { get: (length?: number, forceLowerCase?: boolean, forceUpperCase?: boolean, forceNumber?: boolean, fullLine?: boolean, flags?: string | undefined) => RegExp; verify: (text: string, length?: number, forceLowerCase?: b...
webilix/regex-library
dist/test/ip4.test.d.ts
export {}; //# sourceMappingURL=ip4.test.d.ts.map
webilix/regex-library
dist/test/mobile.test.d.ts
export {}; //# sourceMappingURL=mobile.test.d.ts.map
webilix/regex-library
src/test/email.test.ts
import { rxEmail } from '../regex'; import { testFind, testReplace, testVerify } from './_'; const valid: string[] = ['<EMAIL>', '<EMAIL>', '<EMAIL>', '<EMAIL>']; const invalid: string[] = ['email@', <EMAIL>', 'email.domain.com']; testVerify('EMAIL', rxEmail, valid, invalid); testFind('EMAIL', rxEmail, valid, invalid...
webilix/regex-library
src/lib/username.ts
<reponame>webilix/regex-library import { get, verify } from '../method'; import { rxUsername } from '../regex'; export const USERNAME = { get: ( length: number = 3, useDash: boolean = true, useDot: boolean = true, fullLine: boolean = true, flags?: string, ): RegExp => ge...
webilix/regex-library
src/lib/ip4.ts
<reponame>webilix/regex-library import { find, get, replace, verify } from '../method'; import { rxIP4 } from '../regex'; export const IP4 = { get: (fullLine: boolean = true, flags?: string): RegExp => get(rxIP4, fullLine, flags), verify: (text: string): boolean => verify(rxIP4, text), find: (text: strin...
webilix/regex-library
dist/test/date.test.d.ts
<reponame>webilix/regex-library export {}; //# sourceMappingURL=date.test.d.ts.map
webilix/regex-library
dist/lib/url.d.ts
<filename>dist/lib/url.d.ts export declare const URL: { get: (full?: boolean, fullLine?: boolean, flags?: string | undefined) => RegExp; verify: (text: string, full?: boolean) => boolean; find: (text: string, full?: boolean) => string[]; replace: (text: string, replaceWith?: string, full?: boolean) => s...
webilix/regex-library
src/lib/password.ts
<reponame>webilix/regex-library<filename>src/lib/password.ts import { get, verify } from '../method'; import { rxPassword } from '../regex'; export const PASSWORD = { get: ( length: number = 8, forceLowerCase: boolean = true, forceUpperCase: boolean = true, forceNumber: boolean = tr...
webilix/regex-library
src/test/_.ts
<gh_stars>0 import { find, replace, verify } from '../method'; export const testVerify = (title: string, pattern: string, valid: string[], invalid: string[]) => { test(`${title}: verify`, () => { valid.forEach((value: string) => { const test: boolean = verify(pattern, value); expect...
webilix/regex-library
src/lib/url.ts
import { find, get, replace, verify } from '../method'; import { rxUrl } from '../regex'; export const URL = { get: (full: boolean = false, fullLine: boolean = true, flags?: string): RegExp => get(rxUrl(full), fullLine, flags), verify: (text: string, full: boolean = false): boolean => verify(rxUrl(full), text...
webilix/regex-library
src/lib/time.ts
<filename>src/lib/time.ts import { find, get, replace, verify } from '../method'; import { rxTime } from '../regex'; export const TIME = { get: (fullLine: boolean = true, flags?: string): RegExp => get(rxTime, fullLine, flags), verify: (text: string): boolean => verify(rxTime, text), find: (text: string)...