repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
caos/zitadel-examples
b2b-nextjs/pages/api/grantedprojects.tsx
<reponame>caos/zitadel-examples<filename>b2b-nextjs/pages/api/grantedprojects.tsx import { NextApiRequest, NextApiResponse } from 'next'; import { BearerToken, hasRole, requestAccessToken } from '../../lib/jwt'; import { handleFetchErrors } from '../../lib/middleware'; function getGrantedProjectsOfUser( userId: str...
caos/zitadel-examples
b2b-nextjs/lib/org.ts
import create from 'zustand'; import { ZitadelOrg } from '../components/OrgContext'; const orgStore = create((set) => ({ org: null, setOrg: (orgToSet: ZitadelOrg) => set(() => ({ org: orgToSet, })), })); export default orgStore;
caos/zitadel-examples
b2b-nextjs/components/RoleCheck.tsx
<filename>b2b-nextjs/components/RoleCheck.tsx import { useSession } from "next-auth/react"; import { useContext } from "react"; import orgStore from "../lib/org"; export default function RolesCheck(props: any) { const { data: session } = useSession(); const org = orgStore((state) => (state as any).org); const ...
caos/zitadel-examples
b2b-nextjs/lib/middleware.ts
import { NextApiRequest, NextApiResponse } from 'next'; export function runMiddleware( req: NextApiRequest, res: NextApiResponse, fn: any ) { return new Promise((resolve, reject) => { fn(req, res, (result: any) => { if (result instanceof Error) { return reject(result); } return r...
caos/zitadel-examples
b2b-nextjs/components/OrgContext.tsx
<gh_stars>1-10 import { Listbox, Transition } from '@headlessui/react'; import { CheckIcon, SelectorIcon } from '@heroicons/react/outline'; import { getSession } from 'next-auth/react'; import { Fragment, useEffect, useState } from 'react'; import orgStore from '../lib/org'; export type ZitadelOrg = { id: string; ...
caos/zitadel-examples
b2b-nextjs/components/GrantRadio.tsx
import { RadioGroup } from "@headlessui/react"; import { EyeIcon } from "@heroicons/react/outline"; import { useSession } from "next-auth/react"; import { useState } from "react"; import orgStore from "../lib/org"; import { Role, ROLES } from "../lib/roles"; export default function GrantRadio({ selected, setSelected ...
caos/zitadel-examples
angular/src/app/components/user/user.component.ts
import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { AuthenticationService } from 'src/app/services/authentication.service'; @Component({ selector: 'app-user', templateUrl: './user.component.html', styleUrls: ['./user.component.scss'] }) export class UserComponent ...
caos/zitadel-examples
b2b-nextjs/lib/localized-date.ts
<gh_stars>1-10 import { format } from 'date-fns'; import { de, enUS, it } from 'date-fns/locale'; export default function localizedDate(timestamp: string | number, localeCode: string, hoursOnly: boolean = false) { // const date: Date = dateFromTimestamp(ts); if (typeof timestamp === 'string') { const ...
caos/zitadel-examples
angular/src/app/app-routing.module.ts
<gh_stars>1-10 import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { HomeComponent } from './components/home/home.component'; import { SignedOutComponent } from './components/signed-out/signed-out.component'; import { UserComponent } from './components/user/user.com...
caos/zitadel-examples
b2b-nextjs/components/UserGrantTable.tsx
<reponame>caos/zitadel-examples<filename>b2b-nextjs/components/UserGrantTable.tsx import { getSession } from 'next-auth/react'; import useSWR from 'swr'; import orgStore from '../lib/org'; export default function UserGrantTable() { const fetcher = async (url: string) => { const session = (await getSession()) as...
caos/zitadel-examples
b2b-nextjs/components/UserGrant.tsx
<reponame>caos/zitadel-examples import { useSession } from 'next-auth/react'; import orgStore from '../lib/org'; export default function UserGrant() { const org = orgStore((state) => (state as any).org); const { data: session } = useSession(); let roles = []; if (session && session.user && org?.id && sessio...
caos/zitadel-examples
b2b-nextjs/components/Footer.tsx
<reponame>caos/zitadel-examples import { useRouter } from 'next/router'; import FooterLink from './FooterLink'; const Footer = () => { const router = useRouter(); const effectClasses = "filter grayscale transform hover:brightness-75 dark:hover:brightness-125"; return ( <> <footer className="bg-fo...
caos/zitadel-examples
b2b-nextjs/components/GrantedProjects.tsx
import { getSession } from 'next-auth/react'; import { useEffect, useState } from 'react'; import useSWR from 'swr'; import orgStore from '../lib/org'; import ProjectItem from './ProjectItem'; export default function GrantedProjects() { const fetcher = async (url: string) => { const session = (await getSession(...
caos/zitadel-examples
b2b-nextjs/components/ProfileImage.tsx
import { Menu, Transition } from '@headlessui/react'; import { LogoutIcon, PencilIcon } from '@heroicons/react/outline'; import { getSession, signIn, signOut } from 'next-auth/react'; import { Fragment, useEffect, useState } from 'react'; export default function ProfileImage({ user }: { user?: any | null }) { const ...
caos/zitadel-examples
b2b-nextjs/lib/roles.ts
<reponame>caos/zitadel-examples export const ROLES: Role[] = [ { name: "Granted Projects", desc: "You need to have reader role to view granted projects", roles: ["reader", "admin"], }, { name: "Authorizations", desc: "You need to have admin role to view user grants", roles: ["admin"], },...
caos/zitadel-examples
b2b-nextjs/lib/jwt.ts
<reponame>caos/zitadel-examples import { handleFetchErrors } from './middleware'; var jwt = require("jsonwebtoken"); type ZitadelSecret = { type: string; userId: string; keyId: string; key: string; }; export type BearerToken = { access_token: string; expires_in: number; token_type: "Bearer"; }; export...
caos/zitadel-examples
b2b-nextjs/components/Nav.tsx
<filename>b2b-nextjs/components/Nav.tsx import { signIn, useSession } from 'next-auth/react'; import Link from 'next/link'; import { Router, withRouter } from 'next/router'; import React, { Fragment, useEffect, useState } from 'react'; import AuthCheck from './AuthCheck'; import OrgContext from './OrgContext'; import ...
livelybone/owner-window
src/index.ts
export function getOwnerWindow(el: HTMLElement): Window { const doc = el.ownerDocument const id = 'script-for-inject-owner-window' let script = doc.getElementById(id) as HTMLScriptElement | null // @ts-ignore if (!el.ownerWindow && script) { script.id = '' script = null } if (!script) { scri...
livelybone/owner-window
index.d.ts
<gh_stars>0 declare function getOwnerWindow(el: HTMLElement): Window export { getOwnerWindow }
Photon79/Angular-Full-Stack-Test
client/app/shared/models/index.ts
<reponame>Photon79/Angular-Full-Stack-Test export { Word } from './word.model';
Photon79/Angular-Full-Stack-Test
client/app/pages/testing/testing.component.ts
<gh_stars>0 import { Component, OnInit } from '@angular/core'; import { without } from 'lodash/array'; import { Word } from '../../shared/models'; import { DictionaryService, StorageService } from '../../services'; @Component({ selector: 'app-testing', templateUrl: './testing.component.html', styleUrls: ['./tes...
Photon79/Angular-Full-Stack-Test
server/controllers/base.ts
<reponame>Photon79/Angular-Full-Stack-Test import { Request, Response } from 'express'; export abstract class BaseCtrl { abstract model: any; // Get all getAll = async (req: Request, res: Response) => { try { const docs = await this.model.find({}); return res.status(200).json(docs); } catch ...
Photon79/Angular-Full-Stack-Test
server/declarations/promise-bluebird.d.ts
<filename>server/declarations/promise-bluebird.d.ts /// <reference types="mongoose" /> import * as Bluebird from 'bluebird'; declare module 'mongoose' { type Promise<T> = Bluebird<T>; }
Photon79/Angular-Full-Stack-Test
server/models/index.ts
<reponame>Photon79/Angular-Full-Stack-Test<filename>server/models/index.ts export { Word } from './word';
Photon79/Angular-Full-Stack-Test
server/controllers/word.ts
<reponame>Photon79/Angular-Full-Stack-Test import { promisify } from 'bluebird'; import { Request, Response } from 'express'; import { Word } from '../models'; import { BaseCtrl } from './base'; export class WordCtrl extends BaseCtrl { model = Word; getAll = async (req: Request, res: Response) => { try { ...
Photon79/Angular-Full-Stack-Test
client/app/pages/testing/testing.component.spec.ts
<reponame>Photon79/Angular-Full-Stack-Test<filename>client/app/pages/testing/testing.component.spec.ts import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { ComponentFixtureAutoDetect } from '@angular/core/testing'; import { RouterTestingModul...
Photon79/Angular-Full-Stack-Test
client/app/app.module.ts
<filename>client/app/app.module.ts import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { NgxPaginationModule } from 'ngx-pagination'; import { BsModalModule } from 'ng2-bs3-modal'; import { ModalModule } from 'ngx-modialog'; import { BootstrapModalModule } from 'ngx-modialog/plugins/bootstrap'; imp...
Photon79/Angular-Full-Stack-Test
client/app/shared/models/word.model.ts
export class Word { _id?: string; original?: string; translation?: string; answers?: Array<string>; }
Photon79/Angular-Full-Stack-Test
server/models/word.ts
import { Document, Model, model, Schema } from 'mongoose'; import * as random from 'mongoose-random'; const wordSchema: Schema = new Schema({ original: String, translation: String }); wordSchema.plugin(random, { path: 'r' }); interface IWord extends Document { original: string; translation: string; } interf...
Photon79/Angular-Full-Stack-Test
client/app/pages/dictionary/dictionary.component.spec.ts
<filename>client/app/pages/dictionary/dictionary.component.spec.ts import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { NgxPaginationModule } from 'ngx-pagination'; import { BsModalModule } from 'ng2-bs3-modal'; import { ModalModule } from 'n...
Photon79/Angular-Full-Stack-Test
client/app/pages/dictionary/dictionary.component.ts
import { Component, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { BsModalComponent } from 'ng2-bs3-modal'; import { Overlay } from 'ngx-modialog'; import { Modal } from 'ngx-modialog/plugins/bootstrap'; import { DictionaryService } from ...
Photon79/Angular-Full-Stack-Test
client/app/services/index.ts
<filename>client/app/services/index.ts export { DictionaryService } from './dictionary.service'; export { StorageService } from './storage.service';
Photon79/Angular-Full-Stack-Test
server/controllers/index.ts
export { BaseCtrl } from './base'; export { WordCtrl } from './word';
Photon79/Angular-Full-Stack-Test
server/routes.ts
import * as express from 'express'; import { WordCtrl } from './controllers'; import { Word } from './models'; export default function setRoutes(app) { const router = express.Router(); const wordCtrl = new WordCtrl(); router .route('/words') .get(wordCtrl.getAll) .post(wordCtrl.create); router ...
Photon79/Angular-Full-Stack-Test
client/app/services/dictionary.service.ts
<filename>client/app/services/dictionary.service.ts import { Injectable, Inject } from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import { Word } from '../shared/models'; @Injectable() export class DictionaryService { constructor(pri...
Photon79/Angular-Full-Stack-Test
client/app/services/storage.service.ts
<filename>client/app/services/storage.service.ts import { Injectable } from '@angular/core'; @Injectable() export class StorageService { constructor() { } save(data: any): void { Object.keys(data).forEach(key => localStorage.setItem(`test1-${key}`, JSON.stringify(data[key]))); } load(key: string): any { ...
lkesteloot/z80-asm
src/zasm/Main.ts
<gh_stars>0 import * as fs from "fs"; import chalk from "chalk"; import {toHex} from "z80-base"; import {Asm} from "../assembler/Asm"; const srcPathname = "sio_basic.asm"; const lstPathname = "sio_basic.lst"; const binPathname = "sio_basic.bin"; function loadFile(filename: string): string[] { return fs.readFileSy...
lkesteloot/z80-asm
src/main/electron-main.ts
import {app, BrowserWindow, dialog, ipcMain, IpcMainEvent, Menu, TouchBar} from 'electron'; const { TouchBarButton } = TouchBar; function createWindow(): BrowserWindow { // Create the browser window. const win = new BrowserWindow({ width: 1200, height: 800, webPreferences: { ...
lkesteloot/z80-asm
src/ide/Ide.ts
import CodeMirror from "codemirror"; import {Asm, AssembledLine, FileInfo, SymbolInfo, SymbolReference} from "../assembler/Asm"; import mnemonicData from "../assembler/Opcodes"; import {toHexByte, toHexWord} from "z80-base"; import tippy from 'tippy.js'; import 'tippy.js/dist/tippy.css'; import "codemirror/lib/codemir...
lkesteloot/z80-asm
src/assembler/Asm.spec.ts
import { expect } from "chai"; import "mocha"; import {Asm, SourceFile} from "./Asm"; interface TestLine { line: string; opcodes?: number[]; error?: boolean; } function runTest(testLines: TestLine[]): Asm { const asm = new Asm((pathname) => testLines.map(testLine => testLine.line)); const sourceF...
lkesteloot/z80-asm
src/assembler/OpcodesTypes.ts
<reponame>lkesteloot/z80-asm // Each opcode template can be a literal byte value or a variable like "nn". export type OpcodeTemplate = number | "nnnn" | "nn" | "offset" | "dd"; // Information from clr. export interface ClrInstruction { opcodes: string; undocumented: boolean; flags: string; byte_count:...
45498106/crosscode-map-editor
backend/src/controllers/api.ts
<gh_stars>0 import * as fs from 'fs'; import * as path from 'path'; import {Response, Request, NextFunction} from 'express'; import {config} from '../config'; export let getAllFiles = (req: Request, res: Response) => { res.json({ images: listAllFiles(path.resolve(config.pathToCrosscode, 'media/'), [], 'png'), dat...
45498106/crosscode-map-editor
webapp/src/app/history/state-history.service.ts
import {Injectable} from '@angular/core'; import {BehaviorSubject} from 'rxjs'; import {CrossCodeMap} from '../shared/interfaces/cross-code-map'; export interface HistoryState { icon: string; name: string; state: CrossCodeMap; } @Injectable() export class StateHistoryService { maxStates = 100; states: Behavior...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/widgets/widget.module.ts
import {NgModule} from '@angular/core'; import {Vec2WidgetComponent} from './vec2-widget/vec2-widget.component'; import {JsonWidgetComponent} from './json-widget/json-widget.component'; import {BooleanWidgetComponent} from './boolean-widget/boolean-widget.component'; import {NumberWidgetComponent} from './number-widget...
45498106/crosscode-map-editor
webapp/src/app/toolbar/toolbar.component.ts
<reponame>45498106/crosscode-map-editor import {Component, EventEmitter, OnInit, Output} from '@angular/core'; import {MapLoaderService} from '../shared/map-loader.service'; import {MatDialog} from '@angular/material'; import {MapSettingsComponent} from '../shared/dialogs/map-settings/map-settings.component'; import {C...
45498106/crosscode-map-editor
webapp/src/app/shared/dialogs/map-settings/map-settings.component.ts
import {Component, Inject, OnInit} from '@angular/core'; import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; import {CrossCodeMap} from '../../interfaces/cross-code-map'; import {MapLoaderService} from '../../map-loader.service'; import {CCMap} from '../../phaser/tilemap/cc-map'; @Component({ selector: '...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/helper.ts
import {Point} from '../interfaces/cross-code-map'; import {Globals} from '../globals'; import {CCMapLayer} from './tilemap/cc-map-layer'; export class Helper { /** * Transforms screen coordinates to world coordinates. * Phaser already offers a way to get world coordinates but it's messed up when the camera scale...
45498106/crosscode-map-editor
webapp/src/app/shared/height-map-generator/height-map-generator.service.ts
import {Injectable} from '@angular/core'; import {SharedModule} from '../shared.module'; import {GlobalEventsService} from '../global-events.service'; import {Globals} from '../globals'; import {CCMapLayer} from '../phaser/tilemap/cc-map-layer'; import {Point} from '../interfaces/cross-code-map'; import {CCMap} from '....
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/phaser-events.service.ts
<filename>webapp/src/app/shared/phaser/phaser-events.service.ts import {Injectable} from '@angular/core'; import {Subject} from 'rxjs'; import Point = Phaser.Point; @Injectable({ providedIn: 'root' }) export class PhaserEventsService { // TODO: event should be informational (camera zoomed/map size changed) instead o...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/tilemap/cc-map-layer.ts
import {MapLayer, Point} from '../../interfaces/cross-code-map'; import * as Phaser from 'phaser-ce'; import {Sortable} from '../../interfaces/sortable'; import {Helper} from '../helper'; import {Globals} from '../../globals'; export class CCMapLayer extends Phaser.Image implements Sortable { public details: MapLay...
45498106/crosscode-map-editor
webapp/src/app/shared/http-client.service.ts
import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {Globals} from './globals'; declare let nw: any; declare let chrome: any; declare let requireNode: any; @Injectable() export class HttpClientService { private fs; private path; priva...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/map-pan.ts
import {Point} from '../interfaces/cross-code-map'; import {Helper} from './helper'; export class MapPan extends Phaser.Plugin { private button: Phaser.DeviceButton; private isScrolling = false; private startMouse: Point = {}; private startCam: Point = {}; private zoomKey: Phaser.Key; constructor(game: Phaser...
45498106/crosscode-map-editor
webapp/src/app/shared/global-events.service.ts
import {Injectable} from '@angular/core'; import {BehaviorSubject, Subject} from 'rxjs'; import {EditorView} from './interfaces/editor-view'; import {CCEntity} from './phaser/entities/cc-entity'; import {MapEntity, Point} from './interfaces/cross-code-map'; @Injectable() export class GlobalEventsService { currentVie...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/template.ts
import {CCEntity, ScaleSettings} from './cc-entity'; export class Template extends CCEntity { private attributes = {}; public getAttributes() { return this.attributes; } getScaleSettings(): ScaleSettings { return undefined; } protected setupType(settings: any) { } }
45498106/crosscode-map-editor
webapp/src/app/editor/add-entity-menu/add-entity-menu.component.ts
<filename>webapp/src/app/editor/add-entity-menu/add-entity-menu.component.ts import {Component, ElementRef, Input, OnInit, ViewChild} from '@angular/core'; import {GlobalEventsService} from '../../shared/global-events.service'; import {MapEntity, Point} from '../../shared/interfaces/cross-code-map'; import {MatMenuTrig...
45498106/crosscode-map-editor
webapp/src/app/shared/json-editor/json-editor.component.ts
import {AfterViewInit, Component, ElementRef, Inject, Input, OnInit, Optional, ViewChild} from '@angular/core'; import JSONEditor, {JSONEditorOptions} from 'jsoneditor'; import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; import {Globals} from '../globals'; @Component({ selector: 'app-json-editor', temp...
45498106/crosscode-map-editor
backend/src/config.ts
export let config = { pathToCrosscode: 'D:/programming/CrossCode/entpackt/assets/' };
45498106/crosscode-map-editor
webapp/src/app/shared/shared.module.ts
<filename>webapp/src/app/shared/shared.module.ts<gh_stars>0 import {NgModule} from '@angular/core'; import {GlobalEventsService} from './global-events.service'; import {HostDirective} from './host.directive'; import {HttpClientService} from './http-client.service'; import {MapLoaderService} from './map-loader.service';...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/entity-registry.service.ts
<reponame>45498106/crosscode-map-editor<gh_stars>0 import {Injectable} from '@angular/core'; import {DefaultEntity} from './default-entity'; import {CCEntity} from './cc-entity'; import {Prop} from './prop'; import {ScalableProp} from './scalable-prop'; import {ItemDestruct} from './item-destruct'; @Injectable({ prov...
45498106/crosscode-map-editor
webapp/src/app/shared/dialogs/offset-map/offset-map.component.ts
<reponame>45498106/crosscode-map-editor<gh_stars>0 import {Component, OnInit} from '@angular/core'; import {MapLoaderService} from '../../map-loader.service'; import {MatDialogRef} from '@angular/material'; import {Point} from '../../interfaces/cross-code-map'; import {GlobalEventsService} from '../../global-events.ser...
45498106/crosscode-map-editor
backend/src/server.ts
<reponame>45498106/crosscode-map-editor import * as express from 'express'; import * as bodyParser from 'body-parser'; import * as logger from 'morgan'; import * as errorHandler from 'errorhandler'; import * as cors from 'cors'; import {config} from './config'; // Controllers (route handlers). import * as apiControlle...
45498106/crosscode-map-editor
webapp/src/app/shared/interfaces/editor-view.ts
<gh_stars>1-10 export enum EditorView { Layers, Entities }
45498106/crosscode-map-editor
webapp/src/app/phaser/phaser.component.ts
import {AfterViewInit, Component, ElementRef, HostListener, OnDestroy, OnInit} from '@angular/core'; import * as Phaser from 'phaser-ce'; import {MapLoaderService} from '../shared/map-loader.service'; import {Subscription} from 'rxjs'; import {MapPan} from '../shared/phaser/map-pan'; import {CCMap} from '../shared/phas...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/widgets/abstract-widget.ts
<reponame>45498106/crosscode-map-editor import {Input} from '@angular/core'; import {CCEntity} from '../../../shared/phaser/entities/cc-entity'; export abstract class AbstractWidget { @Input() key: string; @Input() attribute: any; @Input() entity: CCEntity; setSetting(key: string, value: any, updateType = true, ...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/item-destruct.ts
<reponame>45498106/crosscode-map-editor import {CCEntity, ScaleSettings} from './cc-entity'; import {Helper} from '../helper'; import {PropDef} from './prop'; import * as Phaser from 'phaser-ce'; export class ItemDestruct extends CCEntity { private attributes = { desType: { type: 'String', description: 'Typ...
45498106/crosscode-map-editor
webapp/src/main.ts
<filename>webapp/src/main.ts<gh_stars>0 import {enableProdMode} from '@angular/core'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {AppModule} from './app/app.module'; import {environment} from './environments/environment'; import {Globals} from './app/shared/globals'; declare let ...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/prop.ts
<reponame>45498106/crosscode-map-editor import {CCEntity, InputEvents, ScaleSettings} from './cc-entity'; import {Helper} from '../helper'; import {Fix} from '../../interfaces/props'; export interface PropDef { name: string; size: { x: number; y: number; z: number }; collType: string; fix?: Fix; anims?: { ...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/entity-manager.ts
import {CCEntity, InputEvents} from './cc-entity'; import {Sortable} from '../../interfaces/sortable'; import {Helper} from '../helper'; import {CCMap} from '../tilemap/cc-map'; import {CrossCodeMap, MapEntity} from '../../interfaces/cross-code-map'; import {Vec2} from '../vec2'; import {GlobalEventsService} from '../....
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/scalable-prop.ts
<filename>webapp/src/app/shared/phaser/entities/scalable-prop.ts import {CCEntity, InputEvents, ScaleSettings} from './cc-entity'; import {Point, Point3} from '../../interfaces/cross-code-map'; import {Helper} from '../helper'; export interface ScalablePropDef { baseSize: Point3; terrain: string; scalableX: boolean...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/vec2.ts
<reponame>45498106/crosscode-map-editor // Vector tools (source: http://impactjs.com/forums/impact-engine/vector-math-helper-class/page/1) import {Point} from '../interfaces/cross-code-map'; export class Vec2 { /** * @inline * @param otherVec */ public static create(otherVec) { const res = <Point>{}; res...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/default-entity.ts
import {CCEntity} from './cc-entity'; export class DefaultEntity extends CCEntity { private settings; getAttributes() { const out = {}; Object.keys(this.settings).forEach(key => { out[key] = { type: 'Unknown' }; }); return out; } getScaleSettings() { return null; } protected setupType(s...
45498106/crosscode-map-editor
webapp/src/app/material.module.ts
<filename>webapp/src/app/material.module.ts import {NgModule} from '@angular/core'; import { MatAutocompleteModule, MatButtonModule, MatCheckboxModule, MatDialogModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressSpinnerModule, MatRippleModule, MatSelectModule, MatSidenavModule, MatSnac...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/tilemap/tile-drawer.ts
import {CCMapLayer} from './cc-map-layer'; import {Globals} from '../../globals'; import {SortableGroup} from '../../interfaces/sortable'; import {Helper} from '../helper'; import {MapLayer, Point} from '../../interfaces/cross-code-map'; import {Vec2} from '../vec2'; import {CCMap} from './cc-map'; import {MapLoaderSer...
45498106/crosscode-map-editor
webapp/src/app/history/history.component.ts
<reponame>45498106/crosscode-map-editor import {Component, ElementRef, OnInit, ViewChild, ViewEncapsulation} from '@angular/core'; import {HistoryState, StateHistoryService} from './state-history.service'; @Component({ selector: 'app-history', templateUrl: './history.component.html', styleUrls: ['./history.componen...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/widgets/vec2-widget/vec2-widget.component.ts
import {Component, Input, OnInit} from '@angular/core'; import {AbstractWidget} from '../abstract-widget'; import {Point} from '../../../../shared/interfaces/cross-code-map'; @Component({ selector: 'app-vec2-widget', templateUrl: './vec2-widget.component.html', styleUrls: ['./vec2-widget.component.scss', '../../ent...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/widgets/boolean-widget/boolean-widget.component.ts
import {Component, OnInit} from '@angular/core'; import {AbstractWidget} from '../abstract-widget'; @Component({ selector: 'app-boolean-widget', templateUrl: './boolean-widget.component.html', styleUrls: ['./boolean-widget.component.scss', '../../entities.component.scss'] }) export class BooleanWidgetComponent exte...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/widgets/json-widget/json-widget.component.ts
import {Component, Input, OnInit} from '@angular/core'; import {AbstractWidget} from '../abstract-widget'; import {JsonEditorComponent} from '../../../../shared/json-editor/json-editor.component'; import {MatDialog} from '@angular/material'; @Component({ selector: 'app-json-widget', templateUrl: './json-widget.compo...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/tilemap/cc-map.ts
<reponame>45498106/crosscode-map-editor import {Attributes, CrossCodeMap, MapLayer, Point} from '../../interfaces/cross-code-map'; import {CCMapLayer} from './cc-map-layer'; import {Globals} from '../../globals'; import {EntityManager} from '../entities/entity-manager'; import {Helper} from '../helper'; import {StateHi...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/cc-entity.ts
import {Sortable, SortableGroup} from '../../interfaces/sortable'; import {CCMap} from '../tilemap/cc-map'; import {MapEntity, Point, Point3} from '../../interfaces/cross-code-map'; import {Helper} from '../helper'; import * as Phaser from 'phaser-ce'; import {Vec2} from '../vec2'; import {Globals} from '../../globals...
45498106/crosscode-map-editor
webapp/src/app/sidenav/sidenav.component.ts
import {Component, OnInit, ViewEncapsulation} from '@angular/core'; import {animate, style, transition, trigger} from '@angular/animations'; import {MapLoaderService} from '../shared/map-loader.service'; import {CCMap} from '../shared/phaser/tilemap/cc-map'; import {CCMapLayer} from '../shared/phaser/tilemap/cc-map-lay...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/entities.component.ts
import {Component, ComponentFactoryResolver, OnInit, ViewChild, ViewContainerRef} from '@angular/core'; import {CCEntity} from '../../shared/phaser/entities/cc-entity'; import {GlobalEventsService} from '../../shared/global-events.service'; import {MapLoaderService} from '../../shared/map-loader.service'; import {CCMap...
45498106/crosscode-map-editor
webapp/src/app/shared/interfaces/sortable.ts
<reponame>45498106/crosscode-map-editor export interface Sortable { zIndex?: number; } export interface SortableGroup extends Phaser.Group, Sortable { }
45498106/crosscode-map-editor
webapp/src/app/shared/map-loader.service.ts
<filename>webapp/src/app/shared/map-loader.service.ts import {Injectable} from '@angular/core'; import {MatSnackBar} from '@angular/material'; import {Observable, BehaviorSubject} from 'rxjs'; import {CrossCodeMap} from './interfaces/cross-code-map'; import {CCMap} from './phaser/tilemap/cc-map'; import {CCMapLayer} fr...
45498106/crosscode-map-editor
webapp/src/app/app.module.ts
import {BrowserModule} from '@angular/platform-browser'; import {NgModule} from '@angular/core'; import {AppRoutingModule} from './app-routing.module'; import {AppComponent} from './app.component'; import {EditorComponent} from './editor/editor.component'; import {PhaserComponent} from './phaser/phaser.component'; imp...
45498106/crosscode-map-editor
webapp/src/app/sidenav/layers/layers.component.ts
import {Component, OnInit, ViewEncapsulation} from '@angular/core'; import {CCMap} from '../../shared/phaser/tilemap/cc-map'; import {CCMapLayer} from '../../shared/phaser/tilemap/cc-map-layer'; import {MapLoaderService} from '../../shared/map-loader.service'; import {animate, animateChild, keyframes, query, stagger, s...
45498106/crosscode-map-editor
webapp/src/app/sidenav/entities/widgets/string-widget/string-widget.component.ts
<reponame>45498106/crosscode-map-editor<gh_stars>0 import {Component, OnInit, ViewEncapsulation} from '@angular/core'; import {AbstractWidget} from '../abstract-widget'; @Component({ selector: 'app-string-widget', templateUrl: './string-widget.component.html', styleUrls: ['./string-widget.component.scss', '../../en...
45498106/crosscode-map-editor
webapp/src/app/shared/globals.ts
<reponame>45498106/crosscode-map-editor<gh_stars>0 import {CCMap} from './phaser/tilemap/cc-map'; export class Globals { static isNwjs = false; static game: Phaser.Game; static map: CCMap; static TILE_SIZE = 16; static URL = 'http://localhost:8080/'; static entitySettings = { gridSize: 8, enableGrid: false ...
45498106/crosscode-map-editor
webapp/src/app/shared/phaser/entities/selection-box.ts
<filename>webapp/src/app/shared/phaser/entities/selection-box.ts import {Point} from '../../interfaces/cross-code-map'; import {Helper} from '../helper'; import {SortableGroup} from '../../interfaces/sortable'; import {CCEntity} from './cc-entity'; export class SelectionBox { private active = false; private start:...
45498106/crosscode-map-editor
webapp/src/app/shared/floating-window/floating-window.component.ts
<filename>webapp/src/app/shared/floating-window/floating-window.component.ts import {Component, Input, OnInit, ViewEncapsulation} from '@angular/core'; @Component({ selector: 'app-floating-window', templateUrl: './floating-window.component.html', styleUrls: ['./floating-window.component.scss'] }) export class Float...
BirMa/components
projects/components/table/src/subcomponents/table-pagination.component.spec.ts
<filename>projects/components/table/src/subcomponents/table-pagination.component.spec.ts import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DebugElement, ViewChild } from '@angular/core'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { FormsModule } from '@angul...
BirMa/components
projects/prosoft-components-demo/src/app/form-field-demo/form-field-demo.component.ts
<filename>projects/prosoft-components-demo/src/app/form-field-demo/form-field-demo.component.ts import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ViewEncapsulation, Input } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { of } from 'rxjs'; import { PsFormFieldSubscri...
BirMa/components
projects/components/card/public_api.ts
export { PsCardComponent } from './src/card.component'; export { PsCardActionsSectionDirective, PsCardCaptionSectionDirective, PsCardDescriptionSectionDirective, PsCardFooterSectionDirective, PsCardTopButtonSectionDirective, } from './src/card.directives'; export { PsCardModule } from './src/card.module';
BirMa/components
projects/components/header/src/header.component.spec.ts
import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { ChangeDetectionStrategy, Component, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatButtonModule } from '@angular/mate...
BirMa/components
projects/components/block-ui/src/block-ui.component.spec.ts
import { CommonModule } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ViewChild } from '@angular/core'; import { TestBed, waitForAsync } from '@angular/core/testing'; import { MatSpinner } from '@angular/material/progress-spinner'; import { By } from '@angular/platform-browser'...
BirMa/components
projects/components/table/src/subcomponents/table-header.component.ts
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, TemplateRef, ViewEncapsulation, HostBinding, } from '@angular/core'; import { IPsTableIntlTexts } from '@prosoft/components/core'; import { IPsTableSortDefinition } from '../models'; @Component({ selector: 'ps-table-header', ...
BirMa/components
projects/components/form/src/form-data-source.ts
<filename>projects/components/form/src/form-data-source.ts import { FormGroup } from '@angular/forms'; import { IPsButton, IPsException } from '@prosoft/components/core'; import { IPsSavebarMode } from '@prosoft/components/savebar'; import { Observable } from 'rxjs'; /** * @deprecated Will be replaced with IPsBtton ...
BirMa/components
projects/components/schematics/ps-select-load-trigger-and-sort-by-rename/index.ts
<reponame>BirMa/components import { DirEntry, FileEntry, Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; const touchedFiles: string[] = []; export default (): Rule => (tree: Tree, context: SchematicContext) => { context.logger.info('"ps-select: rename LoadTrigger and SortBy enums from PascalCase t...
BirMa/components
projects/components/core/src/intl.ts
import { Injectable } from '@angular/core'; import { MatPaginatorIntl } from '@angular/material/paginator'; import { Subject } from 'rxjs'; export interface IPsSavebarIntlTexts { saveLabel: string; saveAndCloseLabel: string; cancelLabel: string; } // Can be removed with Typescript 3.5 type Pick<T, K extends key...
BirMa/components
projects/prosoft-components-demo/src/app/savebar-demo/savebar-demo.component.ts
<reponame>BirMa/components import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; import { AbstractControl, FormControl, FormGroup } from '@angular/forms'; @Component({ selector: 'app-savebar-demo', template: ` <ps-savebar [form]="form" (save)="onButtonClick('save')"...
BirMa/components
projects/components/select/src/defaults/default-select-data-source.ts
import { BehaviorSubject, combineLatest, isObservable, merge, NEVER, Observable, of, Subject } from 'rxjs'; import { catchError, debounceTime, distinctUntilChanged, filter, map, shareReplay, skip, startWith, switchMap, take, takeUntil, tap, } from 'rxjs/operators'; import { PsSelectItem } from '...