text
stringlengths
9
39.2M
dir
stringlengths
26
295
lang
stringclasses
185 values
created_date
timestamp[us]
updated_date
timestamp[us]
repo_name
stringlengths
1
97
repo_full_name
stringlengths
7
106
star
int64
1k
183k
len_tokens
int64
1
13.8M
```xml import { AnnouncementBanner, Box, Icon } from '@components'; import { getKBHelpArticle, KB_HELP_ARTICLE, LATEST_NEWS_URL } from '@config'; import { COLORS, SPACING } from '@theme'; import { TopItem } from './components'; export const TopNav = ({ isMobile, isTrayOpen, openTray }: { current: string; isMobile: boolean; isTrayOpen: boolean; openTray(): void; }) => { const color = isMobile && isTrayOpen ? COLORS.WHITE : COLORS.GREYISH_BROWN; return ( <Box variant="rowAlign" justifyContent="flex-end" ml={SPACING.BASE} mb={SPACING.BASE} mt={SPACING.MD} mr={SPACING.XS} > {isMobile && ( <TopItem title="NAVIGATION_MENU" icon="nav-menu" left={true} color={color} current={isTrayOpen} onClick={openTray} /> )} {!isMobile && ( <> {/* Center Banner by adding left margin */} <Box mr="auto" ml={{ _: '0', xxl: 'calc(50% - 462px)' }}> <AnnouncementBanner /> </Box> <Icon type="logo-mycrypto-text-blue" width="147px" style={{ marginRight: '35px', marginLeft: '35px' }} /> </> )} <TopItem isExternal={true} title="NAVIGATION_HELP" icon="nav-help" href={getKBHelpArticle(KB_HELP_ARTICLE.HOME)} color={color} /> {!isMobile && ( <TopItem isExternal={true} color={color} title="NAVIGATION_NEW" icon="nav-new" href={LATEST_NEWS_URL} /> )} </Box> ); }; ```
/content/code_sandbox/src/features/Layout/Navigation/TopNav.tsx
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
432
```xml import { c } from 'ttag'; import clsx from '@proton/utils/clsx'; interface Props { columnLayout: boolean; isCompactView: boolean; } const AutoDeleteEnabledBanner = ({ columnLayout, isCompactView }: Props) => { return ( <div data-testid="auto-delete:banner:enabled" className={clsx( 'p-2 color-hint text-center text-sm auto-delete-banner-enabled', columnLayout && 'auto-delete-banner-enabled--column', isCompactView && 'auto-delete-banner-enabled--compact' )} > {c('Info').t`Messages that have been in trash and spam more than 30 days will be automatically deleted.`} </div> ); }; export default AutoDeleteEnabledBanner; ```
/content/code_sandbox/applications/mail/src/app/components/list/banners/auto-delete/variations/AutoDeleteEnabledBanner.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
168
```xml import { chartOptionsChangeData as render } from '../plots/api/chart-options-change-data'; import { createNodeGCanvas } from './utils/createNodeGCanvas'; import { sleep } from './utils/sleep'; import './utils/useSnapshotMatchers'; import './utils/useCustomFetch'; describe('chart.options.changeData', () => { const canvas = createNodeGCanvas(800, 500); it('chart.options.changeData should rerender expected chart', async () => { const { finished, button, chart } = render({ canvas, container: document.createElement('div'), }); await finished; button.dispatchEvent(new CustomEvent('click')); await new Promise<void>((resolve) => chart.on('afterrender', resolve)); const dir = `${__dirname}/snapshots/api`; await sleep(20); await expect(canvas).toMatchDOMSnapshot(dir, render.name); }); afterAll(() => { canvas?.destroy(); }); }); ```
/content/code_sandbox/__tests__/integration/api-chart-options-change-data.spec.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
201
```xml import Benchmark, {type Deferred, type Event} from 'benchmark'; import PQueue from './source/index.js'; const suite = new Benchmark.Suite(); // Benchmark typings aren't up to date, let's help out manually type Resolvable = Deferred & {resolve: () => void}; suite .add('baseline', { defer: true, async fn(deferred: Resolvable) { const queue = new PQueue(); for (let i = 0; i < 100; i++) { // eslint-disable-next-line @typescript-eslint/no-empty-function queue.add(async () => {}); } await queue.onEmpty(); deferred.resolve(); }, }) .add('operation with random priority', { defer: true, async fn(deferred: Resolvable) { const queue = new PQueue(); for (let i = 0; i < 100; i++) { // eslint-disable-next-line @typescript-eslint/no-empty-function queue.add(async () => {}, { priority: Math.trunc(Math.random() * 100), }); } await queue.onEmpty(); deferred.resolve(); }, }) .add('operation with increasing priority', { defer: true, async fn(deferred: Resolvable) { const queue = new PQueue(); for (let i = 0; i < 100; i++) { // eslint-disable-next-line @typescript-eslint/no-empty-function queue.add(async () => {}, { priority: i, }); } await queue.onEmpty(); deferred.resolve(); }, }) .on('cycle', (event: Event) => { console.log(String(event.target)); }) .on('complete', function () { // @ts-expect-error benchmark typings incorrect console.log(`Fastest is ${(this as Benchmark.Suite).filter('fastest').map('name') as string}`); }) .run({ async: true, }); ```
/content/code_sandbox/bench.ts
xml
2016-10-28T10:57:52
2024-08-16T17:39:44
p-queue
sindresorhus/p-queue
3,377
436
```xml import { EditorInterface } from '../interfaces/editor' import { NORMALIZING } from '../utils/weak-maps' export const isNormalizing: EditorInterface['isNormalizing'] = editor => { const isNormalizing = NORMALIZING.get(editor) return isNormalizing === undefined ? true : isNormalizing } ```
/content/code_sandbox/packages/slate/src/editor/is-normalizing.ts
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
69
```xml import type { CompatibleString } from 'storybook/internal/types'; import type { BuilderOptions, StorybookConfigWebpack, TypescriptOptions as TypescriptOptionsBuilder, } from '@storybook/builder-webpack5'; import type { ReactOptions, StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact, } from '@storybook/preset-react-webpack'; type FrameworkName = CompatibleString<'@storybook/react-webpack5'>; type BuilderName = CompatibleString<'@storybook/builder-webpack5'>; export type FrameworkOptions = ReactOptions & { builder?: BuilderOptions; }; type StorybookConfigFramework = { framework: | FrameworkName | { name: FrameworkName; options: FrameworkOptions; }; core?: StorybookConfigBase['core'] & { builder?: | BuilderName | { name: BuilderName; options: BuilderOptions; }; }; typescript?: Partial<TypescriptOptionsBuilder & TypescriptOptionsReact> & StorybookConfigBase['typescript']; }; /** The interface for Storybook configuration in `main.ts` files. */ export type StorybookConfig = Omit< StorybookConfigBase, keyof StorybookConfigWebpack | keyof StorybookConfigFramework > & StorybookConfigWebpack & StorybookConfigFramework; ```
/content/code_sandbox/code/frameworks/react-webpack5/src/types.ts
xml
2016-03-18T04:23:44
2024-08-16T19:22:08
storybook
storybookjs/storybook
83,755
281
```xml import { CryptoProxy } from '@proton/crypto'; import { KEYGEN_CONFIGS, KEYGEN_TYPES } from '../../lib/constants'; import type { Address } from '../../lib/interfaces'; import { getResetAddressesKeysV2 } from '../../lib/keys'; describe('reset keys v2', () => { it('should return an empty result', async () => { const result = await getResetAddressesKeysV2({ addresses: [], passphrase: '', keyGenConfig: KEYGEN_CONFIGS[KEYGEN_TYPES.CURVE25519], preAuthKTVerify: () => async () => {}, }); expect(result).toEqual({ privateKeys: undefined, userKeyPayload: undefined, addressKeysPayload: undefined, onSKLPublishSuccess: undefined, }); }); it('should return reset keys', async () => { const { userKeyPayload, addressKeysPayload } = await getResetAddressesKeysV2({ addresses: [ { ID: '123', Email: '123@123.com', } as unknown as Address, ], passphrase: '123', keyGenConfig: KEYGEN_CONFIGS[KEYGEN_TYPES.CURVE25519], preAuthKTVerify: () => async () => {}, }); if (!addressKeysPayload?.length) { throw new Error('Missing address keys'); } await Promise.all( [userKeyPayload, ...addressKeysPayload.map(({ PrivateKey }) => PrivateKey)].map(async (armoredKey) => { if (!armoredKey) { throw new Error('Missing key'); } const { keyIsDecrypted } = await CryptoProxy.getKeyInfo({ armoredKey }); if (keyIsDecrypted) { throw new Error('Invalid key'); } }) ); addressKeysPayload.forEach((payload) => { expect(payload).toEqual({ AddressID: jasmine.any(String), PrivateKey: jasmine.any(String), Token: jasmine.any(String), Signature: jasmine.any(String), SignedKeyList: { Data: jasmine.any(String), Signature: jasmine.any(String), }, }); }); }); }); ```
/content/code_sandbox/packages/shared/test/keys/resetKeys.spec.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
457
```xml <?xml version="1.0" encoding="utf-8"?> Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> <selector xmlns:android="path_to_url"> <item android:color="@color/light_active_color"/> </selector> ```
/content/code_sandbox/libraries_res/chrome_res/src/main/res/color/blue_mode_tint.xml
xml
2016-07-04T07:28:36
2024-08-15T05:20:42
AndroidChromium
JackyAndroid/AndroidChromium
3,090
65
```xml // import React from 'react'; import {LumaExample} from '../react-luma'; import AnimationApp from '../../../examples/api/animation/app'; import CubemapApp from '../../../examples/api/cubemap/app'; import Texture3DApp from '../../../examples/api/texture-3d/app'; // import PerformanceApp from '../../../examples/performance/stress-test/app'; // import DOFApp from '../../../examples/showcase/dof/app'; // import GeospatialApp from '../../../examples/showcase/geospatial/app'; // import GLTFApp from '../../../examples/showcase/gltf/app'; import InstancingApp from '../../../examples/showcase/instancing/app'; import PersistenceApp from '../../../examples/showcase/persistence/app'; // import WanderingApp from '../../../examples/showcase/wandering/app'; import HelloTriangleGeometryApp from '../../../examples/tutorials/hello-triangle-geometry/app'; import HelloTriangleApp from '../../../examples/tutorials/hello-triangle/app'; import HelloCubeApp from '../../../examples/tutorials/hello-cube/app'; import TwoCubesApp from '../../../examples/tutorials/hello-two-cubes/app'; import InstancedCubesApp from '../../../examples/tutorials/hello-instanced-cubes/app'; import HelloInstancingApp from '../../../examples/tutorials/hello-instancing/app'; import HelloGLTFApp from '../../../examples/tutorials/hello-gltf/app'; import LightingApp from '../../../examples/tutorials/lighting/app'; import ShaderHooksApp from '../../../examples/tutorials/shader-hooks/app'; import ShaderModulesApp from '../../../examples/tutorials/shader-modules/app'; import TransformFeedbackApp from '../../../examples/tutorials/transform-feedback/app'; import TransformApp from '../../../examples/tutorials/transform/app'; const exampleConfig = {}; // API Examples export const AnimationExample: React.FC = () => ( <LumaExample id="animation" directory="api" template={AnimationApp} config={exampleConfig} /> ); export const CubemapExample: React.FC = () => ( <LumaExample id="cubemap" directory="api" template={CubemapApp} config={exampleConfig} /> ); export const Texture3DExample: React.FC = () => ( <LumaExample id="texture-3d" directory="api-3d" template={Texture3DApp} config={exampleConfig} /> ); // Performance Examples // export default class Example extends React.Component { // render() { // const { pageContext } = this.props; // const exampleConfig = (pageContext && pageContext.exampleConfig) || {}; // return ( // <LumaExample AnimationLoop={PerformanceApp} exampleConfig={exampleConfig} /> // ); // } // } // Showcase Examples // export const DOFExample: React.FC = () => ( // <LumaExample // id="gltf" // directory="showcase" // template={DOFApp} // config={exampleConfig} // /> // ); // export const GeospatialExample: React.FC = () => ( // <LumaExample // id="gltf" // directory="showcase" // template={GeospatialApp} // config={exampleConfig} // /> // ); // export const GLTFExample: React.FC = () => ( // <LumaExample // id="gltf" // directory="showcase" // template={GLTFApp} // config={exampleConfig} // /> // ); export const InstancingExample: React.FC = () => ( <LumaExample id="instancing" directory="showcase" template={InstancingApp} config={exampleConfig} /> ); export const PersistenceExample: React.FC = () => ( <LumaExample id="persistence" directory="showcase" template={PersistenceApp} config={exampleConfig} /> ); // export const WanderingExample: React.FC = () => ( // <LumaExample // id="wandering" // directory="showcase/wandering" // template={WanderingApp} // config={exampleConfig} // /> // ); // Tutorial Examples export const HelloCubeExample: React.FC = () => ( <LumaExample id="hello-cube" directory="tutorials" template={HelloCubeApp} config={exampleConfig} /> ); export const HelloInstancingExample: React.FC = () => ( <LumaExample id="hello-instancing" directory="tutorials" template={HelloInstancingApp} config={exampleConfig} /> ); export const HelloTriangleExample: React.FC = () => ( <LumaExample id="hello-triangle" directory="tutorials" template={HelloTriangleApp} config={exampleConfig} /> ); export const InstancedTransformExample: React.FC = () => ( <h2><i>Note: Transform examples temporarily disabled</i></h2> ); export const LightingExample: React.FC = () => ( <LumaExample id="lighting" directory="tutorials" template={LightingApp} config={exampleConfig} /> ); export const HelloGLTFExample: React.FC = () => ( <LumaExample id="hello-gltf" directory="tutorials" template={HelloGLTFApp} config={exampleConfig} /> ); export const ShaderHooksExample: React.FC = () => ( <LumaExample id="shader-hooks" directory="tutorials" template={ShaderHooksApp} config={exampleConfig} /> ); export const ShaderModulesExample: React.FC = () => ( <LumaExample id="shader-modules" directory="tutorials" template={ShaderModulesApp} config={exampleConfig} /> ); export const TransformFeedbackExample: React.FC = () => ( <LumaExample id="transform-feedback" directory="tutorials" template={TransformFeedbackApp} config={exampleConfig} /> ); export const TransformExample: React.FC = () => ( <LumaExample id="transform" directory="tutorials" template={TransformApp} config={exampleConfig} /> ); // WebGL Examples // export default class ExternalWebGLContextExample extends React.Component { // render() { // const { pageContext } = this.props; // const exampleConfig = (pageContext && pageContext.exampleConfig) || {}; // return ( // <LumaExample AnimationLoop={AnimationLoop} exampleConfig={exampleConfig} /> // ); // } // } // import AnimationLoop from '../../../examples/webgl/hello-instancing-webgl/app'; // export default class Example extends React.Component { // render() { // const { pageContext } = this.props; // const exampleConfig = (pageContext && pageContext.exampleConfig) || {}; // return ( // <LumaExample AnimationLoop={AnimationLoop} exampleConfig={exampleConfig} /> // ); // } // } // import AnimationLoop from '../../../examples/webgl/shader-modules-webgl/app'; // export default class Example extends React.Component { // render() { // const { pageContext } = this.props; // const exampleConfig = (pageContext && pageContext.exampleConfig) || {}; // return ( // <LumaExample AnimationLoop={AnimationLoop} exampleConfig={exampleConfig} /> // ); // } // } // WebGPU Examples export const HelloTriangleGeometryExample: React.FC = () => ( <LumaExample id="hello-triangle-geometry" directory="tutorials" template={HelloTriangleGeometryApp} config={exampleConfig} /> ); export const InstancedCubesExample: React.FC = () => ( <LumaExample id="instanced-cubes" directory="tutorials" template={InstancedCubesApp} config={exampleConfig} /> ); export const TwoCubesExample: React.FC = () => ( <LumaExample id="two-cubes" directory="tutorials" template={TwoCubesApp} config={exampleConfig} /> ); // export const TexturedCubeExample: React.FC = () => ( // <LumaExample // id="textured-cube-webgpu" // directory="webgpu" // template={TexturedCubeApp} // config={exampleConfig} // /> // ); ```
/content/code_sandbox/website/src/examples/templates.tsx
xml
2016-01-25T09:41:59
2024-08-16T10:03:05
luma.gl
visgl/luma.gl
2,280
1,795
```xml import { useEffect, useState } from 'react'; import { c, msgid } from 'ttag'; import { Button } from '@proton/atoms'; import type { ModalProps } from '@proton/components'; import { AppLink, Checkbox, Label, Prompt } from '@proton/components'; import { APPS } from '@proton/shared/lib/constants'; import type { MailSettings, Recipient } from '@proton/shared/lib/interfaces'; import { BLOCK_SENDER_CONFIRMATION } from '@proton/shared/lib/mail/constants'; interface Props extends ModalProps { onConfirm: (blockSenderConfirmation: boolean) => void; senders: Recipient[]; mailSettings: MailSettings; onResolve: () => void; onReject: () => void; } const BlockSenderModal = ({ senders, onConfirm, mailSettings, onResolve, onReject, ...rest }: Props) => { const [blockSenderConfirmation, setBlockSenderConfirmation] = useState(false); const handleConfirm = () => { onConfirm(blockSenderConfirmation); onResolve(); }; const manageBlockedAddressesSettingsLink = ( <AppLink key={'manageMessageAddressLink'} to="mail/filters#spam" toApp={APPS.PROTONACCOUNT}>{c('Link') .t`Manage blocked email addresses`}</AppLink> ); const sendersEmails = senders.map((sender) => { return sender?.Address; }); const senderEmailAddress = sendersEmails.slice(0, 2).join(', '); const otherSendersCount = sendersEmails.length - 2; const blockSendersText = sendersEmails.length <= 2 ? // translator: The variable contains email addresses (up to two mail addresses) that will be blocked // Full sentence for reference "New emails from user1@domain.com, user2@domain.com won't be delivered and will be permanently deleted." c('Description') .t`New emails from ${senderEmailAddress} won't be delivered and will be permanently deleted.` : // translator: The variables are the following // ${senderEmailAddress}: contains email addresses (up to two mail addresses) that will be blocked // ${otherSendersCount}: since we display two addresses, the variable contains the number of address remaining which will be blocked // Full sentence for reference "New emails from user1@domain.com, user2@domain.com and X others won't be delivered and will be permanently deleted." c('Description').ngettext( msgid`New emails from ${senderEmailAddress} and ${otherSendersCount} other won't be delivered and will be permanently deleted.`, `New emails from ${senderEmailAddress} and ${otherSendersCount} others won't be delivered and will be permanently deleted.`, otherSendersCount ); // translator: The variable is a link to the settings page // Full sentence for reference "Manage blocked email addresses in settings." const manageInSettingsText = c('Description').jt`${manageBlockedAddressesSettingsLink} in settings.`; useEffect(() => { setBlockSenderConfirmation(mailSettings.BlockSenderConfirmation === BLOCK_SENDER_CONFIRMATION.DO_NOT_ASK); }, [mailSettings.BlockSenderConfirmation]); return ( <div onClick={(e) => e.stopPropagation()}> <Prompt title={c('Title').t`Block sender`} buttons={[ <Button key="submit" type="submit" color="warning" onClick={handleConfirm} data-testid="block-sender-modal-block:button" > {c('Action').t`Block`} </Button>, <Button key="reset" type="reset" onClick={onReject}> {c('Action').t`Cancel`} </Button>, ]} {...rest} > <div> <p className="text-break"> <span>{blockSendersText}</span> <span className="ml-1">{manageInSettingsText}</span> </p> <Label htmlFor="block-sender-confirmation" className="flex text-center"> <Checkbox id="block-sender-confirmation" checked={blockSenderConfirmation} onChange={() => { setBlockSenderConfirmation(!blockSenderConfirmation); }} data-testid="block-sender-modal-dont-show:checkbox" className="mr-1" /> {c('Label').t`Don't show this again`} </Label> </div> </Prompt> </div> ); }; export default BlockSenderModal; ```
/content/code_sandbox/applications/mail/src/app/components/message/modals/BlockSenderModal.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
969
```xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="path_to_url"> <item android:drawable="@drawable/ic_main_nav_music_selected" android:state_checked="true"/> <item android:drawable="@drawable/ic_main_nav_music"/> </selector> ```
/content/code_sandbox/app/src/main/res/drawable/selector_main_nav_music.xml
xml
2016-09-13T14:38:32
2024-08-16T12:30:58
StylishMusicPlayer
ryanhoo/StylishMusicPlayer
3,699
62
```xml import { ArrowTrendingUpIcon, BuildingOfficeIcon, MapPinIcon, } from '@heroicons/react/20/solid'; import { JobType } from '@prisma/client'; import { JobTypeLabel } from '~/components/offers/constants'; import CompanyProfileImage from '~/components/shared/CompanyProfileImage'; import type { JobTitleType } from '~/components/shared/JobTitles'; import { getLabelForJobTitleType } from '~/components/shared/JobTitles'; import { convertMoneyToString } from '~/utils/offers/currency'; import { formatDate } from '~/utils/offers/time'; import type { UserProfileOffer } from '~/types/offers'; type Props = Readonly<{ offer: UserProfileOffer; }>; export default function DashboardProfileCard({ offer: { company, income, jobType, level, location, monthYearReceived, title, }, }: Props) { return ( <div className="px-4 py-4 sm:px-6"> <div className="flex justify-between gap-4"> <CompanyProfileImage alt={company.name} className="hidden h-10 w-10 object-contain sm:block" src={company.logoUrl} /> <div className="grow"> <h4 className="font-medium"> {getLabelForJobTitleType(title as JobTitleType)}{' '} {jobType && <>({JobTypeLabel[jobType]})</>} </h4> <div className="mt-1 flex flex-col sm:mt-0 sm:flex-row sm:flex-wrap sm:space-x-4"> {company?.name && ( <div className="mt-2 flex items-center text-sm text-slate-500"> <BuildingOfficeIcon aria-hidden="true" className="mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400" /> {company.name} </div> )} {location && ( <div className="mt-2 flex items-center text-sm text-slate-500"> <MapPinIcon aria-hidden="true" className="mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400" /> {location.cityName} </div> )} {level && ( <div className="mt-2 flex items-center text-sm text-slate-500"> <ArrowTrendingUpIcon aria-hidden="true" className="mr-1.5 h-5 w-5 flex-shrink-0 text-slate-400" /> {level} </div> )} </div> </div> <div className="col-span-1 row-span-3"> <p className="text-end text-lg font-medium leading-6 text-slate-900"> {jobType === JobType.FULLTIME ? `${convertMoneyToString(income)} / year` : `${convertMoneyToString(income)} / month`} </p> <p className="text-end text-sm text-slate-500"> {formatDate(monthYearReceived)} </p> </div> </div> </div> ); } ```
/content/code_sandbox/apps/portal/src/components/offers/dashboard/DashboardOfferCard.tsx
xml
2016-07-05T05:00:48
2024-08-16T19:01:19
tech-interview-handbook
yangshun/tech-interview-handbook
115,302
692
```xml // eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable import/order */ import type {Immutable} from 'seamless-immutable'; import type Client from '../lib/utils/rpc'; declare global { interface Window { __rpcId: string; rpc: Client; focusActiveTerm: (uid?: string) => void; profileName: string; } const snapshotResult: { customRequire: { (module: string): NodeModule; cache: Record<string, {exports: NodeModule}>; definitions: Record<string, {exports: any}>; }; setGlobals(global: any, process: any, window: any, document: any, console: any, require: any): void; }; const __non_webpack_require__: NodeRequire; } export type ITermGroup = Immutable<{ uid: string; sessionUid: string | null; parentUid: string | null; direction: 'HORIZONTAL' | 'VERTICAL' | null; sizes: number[] | null; children: string[]; }>; export type ITermGroups = Immutable<Record<string, ITermGroup>>; export type ITermState = Immutable<{ termGroups: Mutable<ITermGroups>; activeSessions: Record<string, string>; activeRootGroup: string | null; }>; export type cursorShapes = 'BEAM' | 'UNDERLINE' | 'BLOCK'; import type {FontWeight, IWindowsPty, Terminal} from 'xterm'; import type {ColorMap, configOptions} from './config'; export type uiState = Immutable<{ _lastUpdate: number | null; activeUid: string | null; activityMarkers: Record<string, boolean>; backgroundColor: string; bell: 'SOUND' | false; bellSoundURL: string | null; bellSound: string | null; borderColor: string; colors: ColorMap; cols: number | null; copyOnSelect: boolean; css: string; cursorAccentColor: string; cursorBlink: boolean; cursorColor: string; cursorShape: cursorShapes; cwd?: string; disableLigatures: boolean; fontFamily: string; fontSize: number; fontSizeOverride: null | number; fontSmoothingOverride: string; fontWeight: FontWeight; fontWeightBold: FontWeight; foregroundColor: string; fullScreen: boolean; imageSupport: boolean; letterSpacing: number; lineHeight: number; macOptionSelectionMode: string; maximized: boolean; messageDismissable: null | boolean; messageText: string | null; messageURL: string | null; modifierKeys: { altIsMeta: boolean; cmdIsMeta: boolean; }; notifications: { font: boolean; message: boolean; resize: boolean; updates: boolean; }; openAt: Record<string, number>; padding: string; quickEdit: boolean; resizeAt: number; rows: number | null; screenReaderMode: boolean; scrollback: number; selectionColor: string; showHamburgerMenu: boolean | ''; showWindowControls: boolean | 'left' | ''; termCSS: string; uiFontFamily: string; updateCanInstall: null | boolean; updateNotes: string | null; updateReleaseUrl: string | null; updateVersion: string | null; webGLRenderer: boolean; webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | ''; windowsPty?: IWindowsPty; defaultProfile: string; profiles: configOptions['profiles']; }>; export type session = { cleared: boolean; cols: number | null; pid: number | null; resizeAt?: number; rows: number | null; search: boolean; shell: string | null; title: string; uid: string; splitDirection?: 'HORIZONTAL' | 'VERTICAL'; activeUid?: string; profile: string; }; export type sessionState = Immutable<{ sessions: Record<string, session>; activeUid: string | null; write?: any; }>; export type ITermGroupReducer = Reducer<ITermState, HyperActions>; export type IUiReducer = Reducer<uiState, HyperActions>; export type ISessionReducer = Reducer<sessionState, HyperActions>; import type {Middleware, Reducer} from 'redux'; export type hyperPlugin = { getTabProps: any; getTabsProps: any; getTermGroupProps: any; getTermProps: any; mapHeaderDispatch: any; mapHyperDispatch: any; mapHyperTermDispatch: any; mapNotificationsDispatch: any; mapTermsDispatch: any; mapHeaderState: any; mapHyperState: any; mapHyperTermState: any; mapNotificationsState: any; mapTermsState: any; middleware: Middleware; onRendererUnload: any; onRendererWindow: any; reduceSessions: ISessionReducer; reduceTermGroups: ITermGroupReducer; reduceUI: IUiReducer; }; export type HyperState = { ui: uiState; sessions: sessionState; termGroups: ITermState; }; import type {UIActions} from './constants/ui'; import type {ConfigActions} from './constants/config'; import type {SessionActions} from './constants/sessions'; import type {NotificationActions} from './constants/notifications'; import type {UpdateActions} from './constants/updater'; import type {TermGroupActions} from './constants/term-groups'; import type {InitActions} from './constants'; import type {TabActions} from './constants/tabs'; export type HyperActions = ( | UIActions | ConfigActions | SessionActions | NotificationActions | UpdateActions | TermGroupActions | InitActions | TabActions ) & {effect?: () => void}; import type configureStore from '../lib/store/configure-store'; export type HyperDispatch = ReturnType<typeof configureStore>['dispatch']; import type {ReactChild, ReactNode} from 'react'; type extensionProps = Partial<{ customChildren: ReactChild | ReactChild[]; customChildrenBefore: ReactChild | ReactChild[]; customCSS: string; customInnerChildren: ReactChild | ReactChild[]; }>; import type {HeaderConnectedProps} from '../lib/containers/header'; export type HeaderProps = HeaderConnectedProps & extensionProps; import type {HyperConnectedProps} from '../lib/containers/hyper'; export type HyperProps = HyperConnectedProps & extensionProps; import type {NotificationsConnectedProps} from '../lib/containers/notifications'; export type NotificationsProps = NotificationsConnectedProps & extensionProps; import type Terms from '../lib/components/terms'; import type {TermsConnectedProps} from '../lib/containers/terms'; export type TermsProps = TermsConnectedProps & extensionProps & {ref_: (terms: Terms | null) => void}; export type StyleSheetProps = { backgroundColor: string; borderColor: string; fontFamily: string; foregroundColor: string; } & extensionProps; export type TabProps = { borderColor: string; hasActivity: boolean; isActive: boolean; isFirst: boolean; isLast: boolean; onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void; onClose: () => void; onSelect: () => void; text: string; } & extensionProps; export type ITab = { uid: string; title: string; isActive: boolean; hasActivity: boolean; }; export type TabsProps = { tabs: ITab[]; borderColor: string; backgroundColor: string; onChange: (uid: string) => void; onClose: (uid: string) => void; fullScreen: boolean; defaultProfile: string; profiles: configOptions['profiles']; openNewTab: (profile: string) => void; } & extensionProps; export type NotificationProps = { backgroundColor: string; color?: string; dismissAfter?: number; onDismiss: Function; text?: string | null; userDismissable?: boolean | null; userDismissColor?: string; } & extensionProps; export type SplitPaneProps = { borderColor: string; direction: 'horizontal' | 'vertical'; onResize: (sizes: number[]) => void; sizes?: Immutable<number[]> | null; children: ReactNode[]; }; import type Term from '../lib/components/term'; export type TermGroupOwnProps = { cursorAccentColor?: string; fontSmoothing?: string; parentProps: TermsProps; ref_: (uid: string, term: Term | null) => void; termGroup: ITermGroup; terms: Record<string, Term | null>; } & Pick< TermsProps, | 'activeSession' | 'backgroundColor' | 'bell' | 'bellSound' | 'bellSoundURL' | 'borderColor' | 'colors' | 'copyOnSelect' | 'cursorBlink' | 'cursorColor' | 'cursorShape' | 'disableLigatures' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'fontWeightBold' | 'foregroundColor' | 'letterSpacing' | 'lineHeight' | 'macOptionSelectionMode' | 'modifierKeys' | 'onActive' | 'onContextMenu' | 'onCloseSearch' | 'onData' | 'onOpenSearch' | 'onResize' | 'onTitle' | 'padding' | 'quickEdit' | 'screenReaderMode' | 'scrollback' | 'selectionColor' | 'sessions' | 'uiFontFamily' | 'webGLRenderer' | 'webLinksActivationKey' | 'windowsPty' | 'imageSupport' >; import type {TermGroupConnectedProps} from '../lib/components/term-group'; export type TermGroupProps = TermGroupConnectedProps & TermGroupOwnProps; export type SearchBoxProps = { caseSensitive: boolean; wholeWord: boolean; regex: boolean; results: {resultIndex: number; resultCount: number} | undefined; toggleCaseSensitive: () => void; toggleWholeWord: () => void; toggleRegex: () => void; next: (searchTerm: string) => void; prev: (searchTerm: string) => void; close: () => void; backgroundColor: string; foregroundColor: string; borderColor: string; selectionColor: string; font: string; }; import type {FitAddon} from 'xterm-addon-fit'; import type {SearchAddon} from 'xterm-addon-search'; export type TermProps = { backgroundColor: string; bell: 'SOUND' | false; bellSound: string | null; bellSoundURL: string | null; borderColor: string; cleared: boolean; colors: ColorMap; cols: number | null; copyOnSelect: boolean; cursorAccentColor?: string; cursorBlink: boolean; cursorColor: string; cursorShape: cursorShapes; disableLigatures: boolean; fitAddon: FitAddon | null; fontFamily: string; fontSize: number; fontSmoothing?: string; fontWeight: FontWeight; fontWeightBold: FontWeight; foregroundColor: string; imageSupport: boolean; isTermActive: boolean; letterSpacing: number; lineHeight: number; macOptionSelectionMode: string; modifierKeys: Immutable<{altIsMeta: boolean; cmdIsMeta: boolean}>; onActive: () => void; onCloseSearch: () => void; onContextMenu: (selection: any) => void; onCursorMove?: (cursorFrame: {x: number; y: number; width: number; height: number; col: number; row: number}) => void; onData: (data: string) => void; onOpenSearch: () => void; onResize: (cols: number, rows: number) => void; onTitle: (title: string) => void; padding: string; quickEdit: boolean; rows: number | null; screenReaderMode: boolean; scrollback: number; search: boolean; searchAddon: SearchAddon | null; selectionColor: string; term: Terminal | null; uid: string; uiFontFamily: string; webGLRenderer: boolean; webLinksActivationKey: 'ctrl' | 'alt' | 'meta' | 'shift' | ''; windowsPty?: IWindowsPty; ref_: (uid: string, term: Term | null) => void; } & extensionProps; // Utility types export type Mutable<T> = T extends Immutable<infer U> ? (Exclude<U, T> extends never ? U : Exclude<U, T>) : T; export type immutableRecord<T> = {[k in keyof T]: Immutable<T[k]>}; export type Assignable<T, U> = {[k in keyof U]: k extends keyof T ? T[k] : U[k]} & Partial<T>; ```
/content/code_sandbox/typings/hyper.d.ts
xml
2016-07-01T06:01:21
2024-08-16T16:05:22
hyper
vercel/hyper
43,095
2,864
```xml import React from 'react'; const colors = { primary: '#2089dc', secondary: '#ca71eb', background: '#ffffff', white: '#ffffff', black: '#242424', grey0: '#393e42', grey1: '#43484d', grey2: '#5e6977', grey3: '#86939e', grey4: '#bdc6cf', grey5: '#e1e8ee', greyOutline: '#bbb', searchBg: '#303337', success: '#52c41a', error: '#ff190c', warning: '#faad14', disabled: 'hsl(208, 8%, 90%)', }; export const Palette = () => { return ( <div style={{ display: 'flex', gap: '20px', flexWrap: 'wrap', }} > {Object.entries(colors).map(([key, color]) => { return ( <div> <div style={{ background: color, width: '80px', height: '70px', display: 'block', borderRadius: '6px', }} ></div> <small>{key}</small> </div> ); })} </div> ); }; ```
/content/code_sandbox/website/versioned_docs/version-4.0.0-rc.2/customization/Color.tsx
xml
2016-09-08T14:21:41
2024-08-16T10:11:29
react-native-elements
react-native-elements/react-native-elements
24,875
291
```xml import React from 'react' import { Browser } from '../../libs/browser' import { Linking } from '../../libs/linking' import { Platform } from '../../libs/platform' import { Button, ButtonProps } from './Button' import { Link, LinkProps } from './Link' export type ButtonLinkProps = ButtonProps & { href?: LinkProps['href'] onPress?: never openOnNewTab?: LinkProps['openOnNewTab'] } export const ButtonLink = React.memo((props: ButtonLinkProps) => { const { href, openOnNewTab, ...otherProps } = props if (Platform.OS === 'web' && href) { return ( <Link analyticsLabel={otherProps.analyticsLabel} href={href} openOnNewTab={openOnNewTab} > <Button {...otherProps} onPress={undefined} /> </Link> ) } return ( <Button {...otherProps} onPress={ href ? href.startsWith('http') ? () => Browser.openURL(href) : () => Linking.openURL(href) : undefined } /> ) }) ButtonLink.displayName = 'ButtonLink' ```
/content/code_sandbox/packages/components/src/components/common/ButtonLink.tsx
xml
2016-11-30T23:24:21
2024-08-16T00:24:59
devhub
devhubapp/devhub
9,652
259
```xml // See LICENSE.txt for license information. import {Database, Q} from '@nozbe/watermelondb'; import {of as of$, combineLatest} from 'rxjs'; import {switchMap, distinctUntilChanged} from 'rxjs/operators'; import {Database as DatabaseConstants, General, Permissions} from '@constants'; import {isDMorGM} from '@utils/channel'; import {hasPermission} from '@utils/role'; import {observeChannel, observeMyChannelRoles} from './channel'; import {observeMyTeam, observeMyTeamRoles} from './team'; import type ChannelModel from '@typings/database/models/servers/channel'; import type PostModel from '@typings/database/models/servers/post'; import type RoleModel from '@typings/database/models/servers/role'; import type TeamModel from '@typings/database/models/servers/team'; import type UserModel from '@typings/database/models/servers/user'; const {ROLE} = DatabaseConstants.MM_TABLES.SERVER; export const queryRoles = (database: Database) => { return database.collections.get<RoleModel>(ROLE).query(); }; export const getRoleById = async (database: Database, roleId: string): Promise<RoleModel|undefined> => { try { const role = (await database.get<RoleModel>(ROLE).find(roleId)); return role; } catch { return undefined; } }; export const queryRolesByNames = (database: Database, names: string[]) => { return database.get<RoleModel>(ROLE).query(Q.where('name', Q.oneOf(names))); }; export function observePermissionForChannel(database: Database, channel: ChannelModel | null | undefined, user: UserModel | undefined, permission: string, defaultValue: boolean) { if (!user || !channel) { return of$(defaultValue); } const myChannelRoles = observeMyChannelRoles(database, channel.id); const myTeamRoles = channel.teamId ? observeMyTeamRoles(database, channel.teamId) : of$(undefined); return combineLatest([myChannelRoles, myTeamRoles]).pipe(switchMap(([mc, mt]) => { const rolesArray = [...user.roles.split(' ')]; if (mc) { rolesArray.push(...mc.split(' ')); } if (mt) { rolesArray.push(...mt.split(' ')); } return queryRolesByNames(database, rolesArray).observeWithColumns(['permissions']).pipe( switchMap((r) => of$(hasPermission(r, permission))), ); }), distinctUntilChanged(), ); } export function observePermissionForTeam(database: Database, team: TeamModel | undefined, user: UserModel | undefined, permission: string, defaultValue: boolean) { if (!team || !user) { return of$(defaultValue); } return observeMyTeam(database, team.id).pipe( switchMap((myTeam) => { const rolesArray = [...user.roles.split(' ')]; if (myTeam) { rolesArray.push(...myTeam.roles.split(' ')); } return queryRolesByNames(database, rolesArray).observeWithColumns(['permissions']).pipe( switchMap((roles) => of$(hasPermission(roles, permission))), ); }), distinctUntilChanged(), ); } export function observePermissionForPost(database: Database, post: PostModel, user: UserModel | undefined, permission: string, defaultValue: boolean) { return observeChannel(database, post.channelId).pipe( switchMap((c) => observePermissionForChannel(database, c, user, permission, defaultValue)), distinctUntilChanged(), ); } export function observeCanManageChannelMembers(database: Database, channelId: string, user: UserModel) { return observeChannel(database, channelId).pipe( switchMap((c) => { if (!c || c.deleteAt !== 0 || isDMorGM(c) || c.name === General.DEFAULT_CHANNEL) { return of$(false); } const permission = c.type === General.OPEN_CHANNEL ? Permissions.MANAGE_PUBLIC_CHANNEL_MEMBERS : Permissions.MANAGE_PRIVATE_CHANNEL_MEMBERS; return observePermissionForChannel(database, c, user, permission, true); }), distinctUntilChanged(), ); } export function observeCanManageChannelSettings(database: Database, channelId: string, user: UserModel) { return observeChannel(database, channelId).pipe( switchMap((c) => { if (!c || c.deleteAt !== 0 || isDMorGM(c)) { return of$(false); } const permission = c.type === General.OPEN_CHANNEL ? Permissions.MANAGE_PUBLIC_CHANNEL_PROPERTIES : Permissions.MANAGE_PRIVATE_CHANNEL_PROPERTIES; return observePermissionForChannel(database, c, user, permission, true); }), distinctUntilChanged(), ); } ```
/content/code_sandbox/app/queries/servers/role.ts
xml
2016-10-07T16:52:32
2024-08-16T12:08:38
mattermost-mobile
mattermost/mattermost-mobile
2,155
993
```xml /// /// /// /// path_to_url /// /// Unless required by applicable law or agreed to in writing, software /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// import { Directive, OnDestroy } from '@angular/core'; import { PageComponent } from '@shared/components/page.component'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { MatDialogRef } from '@angular/material/dialog'; import { NavigationStart, Router, RouterEvent } from '@angular/router'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; @Directive() export abstract class DialogComponent<T, R = any> extends PageComponent implements OnDestroy { routerSubscription: Subscription; protected constructor(protected store: Store<AppState>, protected router: Router, protected dialogRef: MatDialogRef<T, R>) { super(store); this.routerSubscription = this.router.events .pipe( filter((event: RouterEvent) => event instanceof NavigationStart), filter(() => !!this.dialogRef) ) .subscribe(() => { this.dialogRef.close(); }); } ngOnDestroy(): void { super.ngOnDestroy(); if (this.routerSubscription) { this.routerSubscription.unsubscribe(); } } } ```
/content/code_sandbox/ui-ngx/src/app/shared/components/dialog.component.ts
xml
2016-12-01T09:33:30
2024-08-16T19:58:25
thingsboard
thingsboard/thingsboard
16,820
267
```xml import React from 'react'; import { Navbar } from '~/components/Navbar'; export default function RSuite() { return ( <div> <h1>A RSuite page with default style</h1> <Navbar /> </div> ); } ```
/content/code_sandbox/examples/with-remix/app/routes/rsuite.tsx
xml
2016-06-06T02:27:46
2024-08-16T16:41:54
rsuite
rsuite/rsuite
8,263
57
```xml // // // path_to_url // // Unless required by applicable law or agreed to in writing, software // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. export const description = "Analyze property chain #21"; const o1 = { c: 2, d: 3 }; const o2 = { a: 1, b: o1 }; const o3 = { a: 1, b: o1 }; export const func = function () { console.log(o1); console.log(o2.b.d); console.log(o3.b.d); }; ```
/content/code_sandbox/sdk/nodejs/tests/runtime/testdata/closure-tests/cases/143-Analyze-property-chain-21/index.ts
xml
2016-10-31T21:02:47
2024-08-16T19:47:04
pulumi
pulumi/pulumi
20,743
122
```xml /** @jsx jsx */ import { jsx } from 'slate-hyperscript' export const input = ( <editor> <element> one <cursor /> </element> </editor> ) export const output = { children: [ { children: [ { text: 'one', }, ], }, ], selection: { anchor: { path: [0, 0], offset: 3, }, focus: { path: [0, 0], offset: 3, }, }, } ```
/content/code_sandbox/packages/slate-hyperscript/test/fixtures/cursor-element-end.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
128
```xml <project xmlns="path_to_url" xmlns:xsi="path_to_url" xsi:schemaLocation="path_to_url path_to_url"> <modelVersion>4.0.0</modelVersion> <groupId>foo.bar</groupId> <artifactId>multimodule2</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <parent> <groupId>foo.bar</groupId> <artifactId>invalid</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <modules> <module>module1</module> <module>module2</module> </modules> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> </project> ```
/content/code_sandbox/org.eclipse.jdt.ls.tests/projects/maven/multimodule2/pom.xml
xml
2016-06-27T13:06:53
2024-08-16T00:38:32
eclipse.jdt.ls
eclipse-jdtls/eclipse.jdt.ls
1,726
238
```xml <?xml version="1.0" encoding="UTF-8"?> <definitions id="definition" xmlns="path_to_url" targetNamespace="Examples"> <process id="parallelMultiInstanceSubProcess"> <startEvent id="theStart"/> <sequenceFlow id="flow1" sourceRef="theStart" targetRef="parallelSubProcess"/> <subProcess id="parallelSubProcess"> <multiInstanceLoopCharacteristics isSequential="false"> <loopCardinality>${nrOfLoops}</loopCardinality> </multiInstanceLoopCharacteristics> <startEvent id="theSubProcessStart" /> <sequenceFlow id="subflow1" sourceRef="theSubProcessStart" targetRef="subTask1" /> <userTask id="subTask1" /> <sequenceFlow id="subflow2" sourceRef="subTask1" targetRef="subTask2" /> <userTask id="subTask2" /> <sequenceFlow id="subflow3" sourceRef="subTask2" targetRef="theSubProcessEnd" /> <endEvent id="theSubProcessEnd" /> </subProcess> <sequenceFlow id="flow2" sourceRef="parallelSubProcess" targetRef="lastTask"/> <userTask id="lastTask" name="last task"/> <sequenceFlow id="flow3" sourceRef="lastTask" targetRef="theEnd"/> <endEvent id="theEnd"/> </process> </definitions> ```
/content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/api/multiInstanceParallelSubProcess.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
322
```xml type Foo = // prettier-ignore ( aa ); ```
/content/code_sandbox/tests/format/typescript/prettier-ignore/prettier-ignore-parenthesized-type.ts
xml
2016-11-29T17:13:37
2024-08-16T17:29:57
prettier
prettier/prettier
48,913
17
```xml /* * Wire * * This program is free software: you can redistribute it and/or modify * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * along with this program. If not, see path_to_url * */ import {fireEvent, render} from '@testing-library/react'; import {TextMessageRenderer} from './TextMessageRenderer'; describe('TextMessageRenderer', () => { it('renders a text message', () => { const onClickElement = jest.fn(); const txtMsg = 'simple message'; const {getByText} = render(<TextMessageRenderer text={txtMsg} onMessageClick={onClickElement} isFocusable />); const txtMsgElement = getByText(txtMsg); expect(txtMsgElement).not.toBe(null); txtMsgElement.focus(); fireEvent.keyDown(txtMsgElement); // plain text message is not interactive expect(onClickElement).not.toHaveBeenCalled(); }); it('renders and trigger click/keydown event of mention message correcly', () => { const onClickElement = jest.fn(); const text = `<div class="message-mention" role="buttton" data-uie-name="label-other-mention" data-user-id="1fc1e32d-084b-49be-a392-85377f7208f3" data-user-domain="staging.zinfra.io"><span class="mention-at-sign">@</span>jj</div> yes it is`; const {getByTestId} = render(<TextMessageRenderer text={text} onMessageClick={onClickElement} isFocusable />); const mention = getByTestId('label-other-mention'); fireEvent.click(mention); expect(onClickElement).toHaveBeenCalled(); fireEvent.keyDown(mention); expect(onClickElement).toHaveBeenCalled(); }); it('renders a link message and should trigger click/keydown event', () => { const onClickElement = jest.fn(); const linkTxt = 'this is a link'; const text = `<a href="path_to_url" target="_blank" rel="nofollow noopener noreferrer" data-md-link="true" data-uie-name="markdown-link">${linkTxt}</a>`; const {getByText} = render(<TextMessageRenderer text={text} onMessageClick={onClickElement} isFocusable />); const linkElem = getByText(linkTxt); expect(linkElem).not.toBe(null); fireEvent.click(linkElem); expect(onClickElement).toHaveBeenCalledTimes(1); fireEvent.keyDown(linkElem, {key: 'Enter'}); expect(onClickElement).toHaveBeenCalledTimes(2); }); it('should not trigger a key event if the message is not focused', () => { const onClickElement = jest.fn(); const linkTxt = 'this is a link'; const text = `<a href="path_to_url" target="_blank" rel="nofollow noopener noreferrer" data-md-link="true" data-uie-name="markdown-link">${linkTxt}</a>`; const {getByText} = render(<TextMessageRenderer text={text} onMessageClick={onClickElement} isFocusable={false} />); const linkElem = getByText(linkTxt); expect(linkElem).not.toBe(null); fireEvent.keyDown(linkElem); expect(onClickElement).not.toHaveBeenCalled(); }); it('collapses long text when asked to', () => { const onClickElement = jest.fn(); const text = 'this is a link<br>multiline text'; Object.defineProperty(HTMLParagraphElement.prototype, 'clientHeight', {get: () => 100}); Object.defineProperty(HTMLParagraphElement.prototype, 'scrollHeight', {get: () => 200}); const {getByText} = render( <TextMessageRenderer text={text} onMessageClick={onClickElement} isFocusable={false} collapse />, ); const showMoreButton = getByText('replyQuoteShowMore'); expect(showMoreButton).not.toBe(null); fireEvent.click(showMoreButton); const showLessButton = getByText('replyQuoteShowLess'); expect(showLessButton).not.toBe(null); }); }); ```
/content/code_sandbox/src/script/components/MessagesList/Message/ContentMessage/asset/TextMessageRenderer/TextMessageRenderer.test.tsx
xml
2016-07-21T15:34:05
2024-08-16T11:40:13
wire-webapp
wireapp/wire-webapp
1,125
904
```xml <?xml version="1.0" encoding="utf-8" standalone="yes"?> <strings> <string id="1000">General</string> <string id="1020">Pre wait time [sec]</string> <string id="1030">Post wait time [sec]</string> <string id="1040">Enable userhdhomerun logging</string> <string id="1050">Enable libhdhomerun logging</string> <string id="1060">Enable suspend/resume the driver</string> <string id="9000">Tuner settings</string> <string id="9005">Enable modifying settings</string> <string id="9010">Refresh tuners... (press me)</string> <string id="9020"> use full name</string> <string id="9025"> number of tuners</string> <string id="9030"> disabled</string> </strings> ```
/content/code_sandbox/packages/addons/driver/hdhomerun/source/resources/language/English/strings.xml
xml
2016-03-13T01:46:18
2024-08-16T11:58:29
LibreELEC.tv
LibreELEC/LibreELEC.tv
2,216
212
```xml import React, { useMemo } from 'react' import { getColumnHeaderDetails } from '@devhub/core' import { IssueOrPullRequestCardsContainer, IssueOrPullRequestCardsContainerProps, } from '../../containers/IssueOrPullRequestCardsContainer' import { IconProp } from '../../libs/vector-icons' import { ColumnRenderer, ColumnRendererProps } from './ColumnRenderer' export interface IssueOrPullRequestColumnProps extends Omit< IssueOrPullRequestCardsContainerProps, 'ownerIsKnown' | 'repoIsKnown' > { columnId: string columnIndex: number headerDetails: ReturnType<typeof getColumnHeaderDetails> pagingEnabled?: boolean } export const IssueOrPullRequestColumn = React.memo( (props: IssueOrPullRequestColumnProps) => { const { columnId, columnIndex, headerDetails, pagingEnabled, pointerEvents, swipeable, } = props const Children = useMemo<ColumnRendererProps['children']>( () => ( <IssueOrPullRequestCardsContainer key={`issue-or-pr-cards-container-${columnId}`} columnId={columnId} pointerEvents={pointerEvents} swipeable={swipeable} /> ), [columnId, columnIndex, pointerEvents, swipeable], ) if (!headerDetails) return null return ( <ColumnRenderer key={`issue-or-pr-column-${columnId}-inner`} avatarImageURL={ headerDetails.avatarProps && headerDetails.avatarProps.imageURL } avatarLinkURL={ headerDetails.avatarProps && headerDetails.avatarProps.linkURL } columnId={columnId} columnIndex={columnIndex} columnType="issue_or_pr" icon={headerDetails.icon as IconProp} owner={headerDetails.owner} pagingEnabled={pagingEnabled} repo={headerDetails.repo} repoIsKnown={headerDetails.repoIsKnown} subtitle={headerDetails.subtitle} title={headerDetails.title} > {Children} </ColumnRenderer> ) }, ) IssueOrPullRequestColumn.displayName = 'IssueOrPullRequestColumn' ```
/content/code_sandbox/packages/components/src/components/columns/IssueOrPullRequestColumn.tsx
xml
2016-11-30T23:24:21
2024-08-16T00:24:59
devhub
devhubapp/devhub
9,652
457
```xml <?xml version='1.0' encoding='UTF-8'?> <definitions xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:xsd="path_to_url" xmlns:activiti="path_to_url" xmlns:bpmndi="path_to_url" xmlns:omgdc="path_to_url" xmlns:omgdi="path_to_url" typeLanguage="path_to_url" expressionLanguage="path_to_url" targetNamespace="path_to_url" xmlns:modeler="path_to_url" modeler:version="1.0en" modeler:exportDateTime="20151230174828075" modeler:modelId="4003" modeler:modelVersion="1" modeler:modelLastUpdated="1451494106050"> <process id="terminateNestedMiEmbeddedSubprocess" name="terminateNestedMiEmbeddedSubprocess" isExecutable="true"> <startEvent id="startEvent1"/> <subProcess id="firstSubprocess" name="subProcess"> <multiInstanceLoopCharacteristics isSequential="false"> <loopCardinality>1</loopCardinality> </multiInstanceLoopCharacteristics> <startEvent id="sid-9FA2F3A8-9FEB-4249-A6B3-2E8CDD75DFFA"/> <parallelGateway id="sid-9FFB4F6F-F850-4A58-B822-8D63B1BA82BE"/> <userTask id="userTaskA" name="A" activiti:assignee="$INITIATOR"> <extensionElements> <modeler:allow-send-email>true</modeler:allow-send-email> <modeler:flowable-idm-initiator>true</modeler:flowable-idm-initiator> </extensionElements> </userTask> <endEvent id="sid-3E129E8A-CA70-4D7E-A7BC-E288339AECF9"/> <subProcess id="secondSubprocess" name="subProcess"> <multiInstanceLoopCharacteristics isSequential="false"> <loopCardinality>1</loopCardinality> </multiInstanceLoopCharacteristics> <startEvent id="sid-BE6A9107-5039-4769-AE6E-7B0E6DC273B1"/> <exclusiveGateway id="sid-6CA98BCE-7B34-4E24-AB3B-974B0831C0E1" default="sid-3E4FE362-E971-410F-8FA7-D814F8A9831A"/> <userTask id="userTaskB" name="B" activiti:assignee="$INITIATOR"> <extensionElements> <modeler:allow-send-email>true</modeler:allow-send-email> <modeler:flowable-idm-initiator>true</modeler:flowable-idm-initiator> </extensionElements> </userTask> <endEvent id="sid-547BAF67-491E-47DB-82F2-DD86FE3389D5"> <terminateEventDefinition activiti:terminateMultiInstance="true"/> </endEvent> <subProcess id="thirdSubprocess" name="subProcess"> <startEvent id="sid-57FD2795-B522-4214-9132-993A7DE2E575"/> <userTask id="userTaskC" name="C" activiti:assignee="$INITIATOR"> <extensionElements> <modeler:allow-send-email>true</modeler:allow-send-email> <modeler:flowable-idm-initiator>true</modeler:flowable-idm-initiator> </extensionElements> </userTask> <endEvent id="sid-787BAB3F-18C9-45C4-86BA-ABA1C5326A0B"/> <sequenceFlow id="sid-47C5F03F-AFAF-48B9-AC18-C33DC4D832C0" sourceRef="sid-57FD2795-B522-4214-9132-993A7DE2E575" targetRef="userTaskC"/> <sequenceFlow id="sid-089DCA6A-668D-43BE-9EE8-E785978BD8BB" sourceRef="userTaskC" targetRef="sid-787BAB3F-18C9-45C4-86BA-ABA1C5326A0B"/> </subProcess> <boundaryEvent id="timerBoundaryEvent" attachedToRef="thirdSubprocess" cancelActivity="true"> <timerEventDefinition> <timeDuration>PT1H</timeDuration> </timerEventDefinition> </boundaryEvent> <endEvent id="sid-0F1EA059-AF39-4C30-95FB-4F933476A521"> <terminateEventDefinition activiti:terminateMultiInstance="true" /> </endEvent> <sequenceFlow id="sid-251C4BDF-A6CB-44A6-99F6-5EB2482EB259" sourceRef="sid-BE6A9107-5039-4769-AE6E-7B0E6DC273B1" targetRef="sid-6CA98BCE-7B34-4E24-AB3B-974B0831C0E1"/> <sequenceFlow id="sid-A87D7F7A-FCF6-45F4-BC0E-3E552C828DD6" sourceRef="userTaskB" targetRef="thirdSubprocess"/> <sequenceFlow id="sid-9E1A44D3-009A-4F7A-8824-0E6F562081CC" sourceRef="thirdSubprocess" targetRef="sid-547BAF67-491E-47DB-82F2-DD86FE3389D5"/> <sequenceFlow id="sid-3E4FE362-E971-410F-8FA7-D814F8A9831A" sourceRef="sid-6CA98BCE-7B34-4E24-AB3B-974B0831C0E1" targetRef="userTaskB"/> <sequenceFlow id="sid-A1EBBA8D-2293-41F4-AB99-34EFFAEA775F" sourceRef="timerBoundaryEvent" targetRef="sid-0F1EA059-AF39-4C30-95FB-4F933476A521"/> <sequenceFlow id="sid-081C5F88-9E4B-4581-8D13-AC5F07B1703B" sourceRef="sid-6CA98BCE-7B34-4E24-AB3B-974B0831C0E1" targetRef="sid-547BAF67-491E-47DB-82F2-DD86FE3389D5"> <conditionExpression xsi:type="tFormalExpression"><![CDATA[${var == 'toEnd'}]]></conditionExpression> </sequenceFlow> </subProcess> <userTask id="sid-92FAECFE-27F2-4D2B-9626-A90499B279FC" name="AfterInnerMi" activiti:assignee="$INITIATOR"> <extensionElements> <modeler:allow-send-email>true</modeler:allow-send-email> <modeler:flowable-idm-initiator>true</modeler:flowable-idm-initiator> </extensionElements> </userTask> <endEvent id="sid-F4F66950-E792-46AC-921A-E42F1B0A70A8"/> <sequenceFlow id="sid-CAD6E50D-DA47-4676-A19F-80D57A541F4D" sourceRef="sid-9FA2F3A8-9FEB-4249-A6B3-2E8CDD75DFFA" targetRef="sid-9FFB4F6F-F850-4A58-B822-8D63B1BA82BE"/> <sequenceFlow id="sid-A4F75DA5-3B5E-43B4-BC43-D168B5620085" sourceRef="sid-9FFB4F6F-F850-4A58-B822-8D63B1BA82BE" targetRef="userTaskA"/> <sequenceFlow id="sid-4D38AA96-5747-4D0C-B15C-111EB1C05729" sourceRef="userTaskA" targetRef="sid-3E129E8A-CA70-4D7E-A7BC-E288339AECF9"/> <sequenceFlow id="sid-A0AF1E53-0E7C-4E5F-A73E-F0C624F26905" sourceRef="sid-9FFB4F6F-F850-4A58-B822-8D63B1BA82BE" targetRef="secondSubprocess"/> <sequenceFlow id="sid-65EAB5EA-D906-4EA2-B7ED-E2F1F9CBD759" sourceRef="secondSubprocess" targetRef="sid-92FAECFE-27F2-4D2B-9626-A90499B279FC"/> <sequenceFlow id="sid-A9C3BA9C-D870-4FBE-8C26-DF090775A48E" sourceRef="sid-92FAECFE-27F2-4D2B-9626-A90499B279FC" targetRef="sid-F4F66950-E792-46AC-921A-E42F1B0A70A8"/> </subProcess> <sequenceFlow id="sid-11E39F1A-8508-4E84-A2C9-3489A13676B7" sourceRef="startEvent1" targetRef="firstSubprocess"/> <userTask id="sid-C2F01FD4-BC33-454D-BE50-EBF7C4E0D3FA" name="lastTask" activiti:assignee="$INITIATOR"> <extensionElements> <modeler:allow-send-email>true</modeler:allow-send-email> <modeler:flowable-idm-initiator>true</modeler:flowable-idm-initiator> </extensionElements> </userTask> <sequenceFlow id="sid-31BF7093-BE37-4103-AEFA-D1502C313F94" sourceRef="firstSubprocess" targetRef="sid-C2F01FD4-BC33-454D-BE50-EBF7C4E0D3FA"/> <endEvent id="sid-57B4288E-7F5E-4D32-958B-48D5C812976F"/> <sequenceFlow id="sid-D034B2E9-BD06-4D86-8C76-DF0355741437" sourceRef="sid-C2F01FD4-BC33-454D-BE50-EBF7C4E0D3FA" targetRef="sid-57B4288E-7F5E-4D32-958B-48D5C812976F"/> </process> <bpmndi:BPMNDiagram id="BPMNDiagram_terminateNestedMiEmbeddedSubprocess"> <bpmndi:BPMNPlane bpmnElement="terminateNestedMiEmbeddedSubprocess" id="BPMNPlane_terminateNestedMiEmbeddedSubprocess"> <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1"> <omgdc:Bounds height="30.0" width="30.0" x="60.0" y="430.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="firstSubprocess" id="BPMNShape_firstSubprocess"> <omgdc:Bounds height="480.0" width="917.0" x="150.0" y="205.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-9FA2F3A8-9FEB-4249-A6B3-2E8CDD75DFFA" id="BPMNShape_sid-9FA2F3A8-9FEB-4249-A6B3-2E8CDD75DFFA"> <omgdc:Bounds height="30.0" width="30.0" x="227.5" y="430.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-9FFB4F6F-F850-4A58-B822-8D63B1BA82BE" id="BPMNShape_sid-9FFB4F6F-F850-4A58-B822-8D63B1BA82BE"> <omgdc:Bounds height="40.0" width="40.0" x="302.75" y="425.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="userTaskA" id="BPMNShape_userTaskA"> <omgdc:Bounds height="80.0" width="100.0" x="387.75" y="555.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-3E129E8A-CA70-4D7E-A7BC-E288339AECF9" id="BPMNShape_sid-3E129E8A-CA70-4D7E-A7BC-E288339AECF9"> <omgdc:Bounds height="28.0" width="28.0" x="532.75" y="581.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="secondSubprocess" id="BPMNShape_secondSubprocess"> <omgdc:Bounds height="291.0" width="633.0" x="360.0" y="240.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-BE6A9107-5039-4769-AE6E-7B0E6DC273B1" id="BPMNShape_sid-BE6A9107-5039-4769-AE6E-7B0E6DC273B1"> <omgdc:Bounds height="30.0" width="30.0" x="422.75" y="355.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-6CA98BCE-7B34-4E24-AB3B-974B0831C0E1" id="BPMNShape_sid-6CA98BCE-7B34-4E24-AB3B-974B0831C0E1"> <omgdc:Bounds height="40.0" width="40.0" x="497.75" y="350.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="userTaskB" id="BPMNShape_userTaskB"> <omgdc:Bounds height="80.0" width="100.0" x="579.0" y="360.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-547BAF67-491E-47DB-82F2-DD86FE3389D5" id="BPMNShape_sid-547BAF67-491E-47DB-82F2-DD86FE3389D5"> <omgdc:Bounds height="28.0" width="28.0" x="615.0" y="285.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="thirdSubprocess" id="BPMNShape_thirdSubprocess"> <omgdc:Bounds height="195.0" width="166.0" x="735.0" y="272.5"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-57FD2795-B522-4214-9132-993A7DE2E575" id="BPMNShape_sid-57FD2795-B522-4214-9132-993A7DE2E575"> <omgdc:Bounds height="30.0" width="30.0" x="750.0" y="289.5"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="userTaskC" id="BPMNShape_userTaskC"> <omgdc:Bounds height="80.0" width="100.0" x="785.5" y="330.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-787BAB3F-18C9-45C4-86BA-ABA1C5326A0B" id="BPMNShape_sid-787BAB3F-18C9-45C4-86BA-ABA1C5326A0B"> <omgdc:Bounds height="28.0" width="28.0" x="821.5" y="431.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="timerBoundaryEvent" id="BPMNShape_timerBoundaryEvent"> <omgdc:Bounds height="31.0" width="31.0" x="755.8829918478435" y="452.0206377435917"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-0F1EA059-AF39-4C30-95FB-4F933476A521" id="BPMNShape_sid-0F1EA059-AF39-4C30-95FB-4F933476A521"> <omgdc:Bounds height="28.0" width="28.0" x="821.75" y="480.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-92FAECFE-27F2-4D2B-9626-A90499B279FC" id="BPMNShape_sid-92FAECFE-27F2-4D2B-9626-A90499B279FC"> <omgdc:Bounds height="80.0" width="100.0" x="795.0" y="555.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-F4F66950-E792-46AC-921A-E42F1B0A70A8" id="BPMNShape_sid-F4F66950-E792-46AC-921A-E42F1B0A70A8"> <omgdc:Bounds height="28.0" width="28.0" x="940.0" y="581.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-C2F01FD4-BC33-454D-BE50-EBF7C4E0D3FA" id="BPMNShape_sid-C2F01FD4-BC33-454D-BE50-EBF7C4E0D3FA"> <omgdc:Bounds height="80.0" width="100.0" x="1112.0" y="405.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape bpmnElement="sid-57B4288E-7F5E-4D32-958B-48D5C812976F" id="BPMNShape_sid-57B4288E-7F5E-4D32-958B-48D5C812976F"> <omgdc:Bounds height="28.0" width="28.0" x="1257.0" y="431.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNEdge bpmnElement="sid-D034B2E9-BD06-4D86-8C76-DF0355741437" id="BPMNEdge_sid-D034B2E9-BD06-4D86-8C76-DF0355741437"> <omgdi:waypoint x="1212.0" y="445.0"/> <omgdi:waypoint x="1257.0" y="445.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-47C5F03F-AFAF-48B9-AC18-C33DC4D832C0" id="BPMNEdge_sid-47C5F03F-AFAF-48B9-AC18-C33DC4D832C0"> <omgdi:waypoint x="765.0" y="319.5"/> <omgdi:waypoint x="765.0" y="370.0"/> <omgdi:waypoint x="785.5" y="370.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-3E4FE362-E971-410F-8FA7-D814F8A9831A" id="BPMNEdge_sid-3E4FE362-E971-410F-8FA7-D814F8A9831A"> <omgdi:waypoint x="518.25" y="389.5"/> <omgdi:waypoint x="518.25" y="400.0"/> <omgdi:waypoint x="579.0" y="400.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-CAD6E50D-DA47-4676-A19F-80D57A541F4D" id="BPMNEdge_sid-CAD6E50D-DA47-4676-A19F-80D57A541F4D"> <omgdi:waypoint x="257.49971429553443" y="445.09257997807316"/> <omgdi:waypoint x="303.12417947407727" y="445.37417947407727"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-251C4BDF-A6CB-44A6-99F6-5EB2482EB259" id="BPMNEdge_sid-251C4BDF-A6CB-44A6-99F6-5EB2482EB259"> <omgdi:waypoint x="452.7497106676825" y="370.0931659047682"/> <omgdi:waypoint x="498.125" y="370.375"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-A4F75DA5-3B5E-43B4-BC43-D168B5620085" id="BPMNEdge_sid-A4F75DA5-3B5E-43B4-BC43-D168B5620085"> <omgdi:waypoint x="323.25" y="464.5"/> <omgdi:waypoint x="323.25" y="595.0"/> <omgdi:waypoint x="387.75" y="595.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-9E1A44D3-009A-4F7A-8824-0E6F562081CC" id="BPMNEdge_sid-9E1A44D3-009A-4F7A-8824-0E6F562081CC"> <omgdi:waypoint x="735.0" y="338.8201058201058"/> <omgdi:waypoint x="642.1057565862843" y="303.9233265482867"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-31BF7093-BE37-4103-AEFA-D1502C313F94" id="BPMNEdge_sid-31BF7093-BE37-4103-AEFA-D1502C313F94"> <omgdi:waypoint x="1067.0" y="445.0"/> <omgdi:waypoint x="1112.0" y="445.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-A9C3BA9C-D870-4FBE-8C26-DF090775A48E" id="BPMNEdge_sid-A9C3BA9C-D870-4FBE-8C26-DF090775A48E"> <omgdi:waypoint x="895.0" y="595.0"/> <omgdi:waypoint x="940.0" y="595.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-4D38AA96-5747-4D0C-B15C-111EB1C05729" id="BPMNEdge_sid-4D38AA96-5747-4D0C-B15C-111EB1C05729"> <omgdi:waypoint x="487.75" y="595.0"/> <omgdi:waypoint x="532.75" y="595.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-A87D7F7A-FCF6-45F4-BC0E-3E552C828DD6" id="BPMNEdge_sid-A87D7F7A-FCF6-45F4-BC0E-3E552C828DD6"> <omgdi:waypoint x="679.0" y="392.06349206349205"/> <omgdi:waypoint x="735.0" y="383.1746031746032"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-65EAB5EA-D906-4EA2-B7ED-E2F1F9CBD759" id="BPMNEdge_sid-65EAB5EA-D906-4EA2-B7ED-E2F1F9CBD759"> <omgdi:waypoint x="676.5" y="531.0"/> <omgdi:waypoint x="676.5" y="595.0"/> <omgdi:waypoint x="795.0" y="595.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-11E39F1A-8508-4E84-A2C9-3489A13676B7" id="BPMNEdge_sid-11E39F1A-8508-4E84-A2C9-3489A13676B7"> <omgdi:waypoint x="90.0" y="445.0"/> <omgdi:waypoint x="150.0" y="445.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-081C5F88-9E4B-4581-8D13-AC5F07B1703B" id="BPMNEdge_sid-081C5F88-9E4B-4581-8D13-AC5F07B1703B"> <omgdi:waypoint x="518.25" y="350.5"/> <omgdi:waypoint x="518.25" y="299.0"/> <omgdi:waypoint x="615.0" y="299.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-089DCA6A-668D-43BE-9EE8-E785978BD8BB" id="BPMNEdge_sid-089DCA6A-668D-43BE-9EE8-E785978BD8BB"> <omgdi:waypoint x="835.5" y="410.0"/> <omgdi:waypoint x="835.5" y="431.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-A1EBBA8D-2293-41F4-AB99-34EFFAEA775F" id="BPMNEdge_sid-A1EBBA8D-2293-41F4-AB99-34EFFAEA775F"> <omgdi:waypoint x="771.8829918478435" y="484.0206377435917"/> <omgdi:waypoint x="771.8829918478435" y="494.0"/> <omgdi:waypoint x="821.75" y="494.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge bpmnElement="sid-A0AF1E53-0E7C-4E5F-A73E-F0C624F26905" id="BPMNEdge_sid-A0AF1E53-0E7C-4E5F-A73E-F0C624F26905"> <omgdi:waypoint x="323.25" y="425.5"/> <omgdi:waypoint x="323.25" y="356.0"/> <omgdi:waypoint x="360.0" y="359.06900212314224"/> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </definitions> ```
/content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/end/TerminateMultiInstanceEndEventTest.testTerminateNestedMiEmbeddedSubprocessWithOneLoopCardinality.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
6,972
```xml <layout xmlns:android="path_to_url" xmlns:app="path_to_url"> <data> <import type="com.base.util.helper.RouterHelper" /> <import type="com.base.entity.DataExtra" /> <import type="com.C" /> <variable name="item" type="com.model.CommentInfo" /> </data> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/backgroundCard" android:orientation="vertical" android:padding="10dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:onClick="@{()->RouterHelper.go(C.ARTICLE,DataExtra.getExtra(C.HEAD_DATA,item.article),imArticle)}" android:orientation="horizontal"> <ImageView android:id="@+id/imArticle" android:layout_width="70dp" android:layout_height="50dp" android:scaleType="centerCrop" app:imageUrl="@{item.article.image}" /> <TextView android:id="@+id/tv_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:textColor="?attr/textColor" android:text="@{item.article.title}" /> </LinearLayout> <TextView android:id="@+id/tv_content" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:background="?attr/textColorBg" android:textColor="?attr/textColor" android:padding="10dp" android:text="@{item.content}" /> </LinearLayout> </layout> ```
/content/code_sandbox/app/src/main/res/layout/list_item_user_comment.xml
xml
2016-05-09T05:55:34
2024-07-26T07:43:48
T-MVP
north2016/T-MVP
2,709
392
```xml import { NativeModule } from 'expo-modules-core'; import type { ExponentFileSystemModule, FileSystemEvents } from './types'; export default class FileSystemShim extends NativeModule<FileSystemEvents> implements ExponentFileSystemModule { documentDirectory = null; cacheDirectory = null; bundleDirectory = null; } ```
/content/code_sandbox/packages/expo-file-system/src/ExponentFileSystemShim.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
69
```xml <?xml version="1.0"?> <clickhouse> <!-- See also the files in users.d directory where the settings can be overridden. --> <!-- Profiles of settings. --> <profiles> <!-- Default settings. --> <default> <!-- Maximum memory usage for processing single query, in bytes. --> <max_memory_usage>10000000000</max_memory_usage> <!-- How to choose between replicas during distributed query processing. random - choose random replica from set of replicas with minimum number of errors nearest_hostname - from set of replicas with minimum number of errors, choose replica with minimum number of different symbols between replica's hostname and local hostname (Hamming distance). in_order - first live replica is chosen in specified order. first_or_random - if first replica one has higher number of errors, pick a random one from replicas with minimum number of errors. --> <load_balancing>random</load_balancing> </default> <!-- Profile that allows only read queries. --> <readonly> <readonly>1</readonly> </readonly> </profiles> <!-- Users and ACL. --> <users> <!-- If user name was not specified, 'default' user is used. --> <default> <!-- See also the files in users.d directory where the password can be overridden. Password could be specified in plaintext or in SHA256 (in hex format). If you want to specify password in plaintext (not recommended), place it in 'password' element. Example: <password>qwerty</password>. Password could be empty. If you want to specify SHA256, place it in 'password_sha256_hex' element. Example: <password_sha256_hex>your_sha256_hash</password_sha256_hex> Restrictions of SHA256: impossibility to connect to ClickHouse using MySQL JS client (as of July 2019). If you want to specify double SHA1, place it in 'password_double_sha1_hex' element. Example: <password_double_sha1_hex>e395796d6546b1b65db9d665cd43f0e858dd4303</password_double_sha1_hex> If you want to specify a previously defined LDAP server (see 'ldap_servers' in the main config) for authentication, place its name in 'server' element inside 'ldap' element. Example: <ldap><server>my_ldap_server</server></ldap> If you want to authenticate the user via Kerberos (assuming Kerberos is enabled, see 'kerberos' in the main config), place 'kerberos' element instead of 'password' (and similar) elements. The name part of the canonical principal name of the initiator must match the user name for authentication to succeed. You can also place 'realm' element inside 'kerberos' element to further restrict authentication to only those requests whose initiator's realm matches it. Example: <kerberos /> Example: <kerberos><realm>EXAMPLE.COM</realm></kerberos> How to generate decent password: Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha256sum | tr -d '-' In first line will be password and in second - corresponding SHA256. How to generate double SHA1: Execute: PASSWORD=$(base64 < /dev/urandom | head -c8); echo "$PASSWORD"; echo -n "$PASSWORD" | sha1sum | tr -d '-' | xxd -r -p | sha1sum | tr -d '-' In first line will be password and in second - corresponding double SHA1. --> <password></password> <!-- List of networks with open access. To open access from everywhere, specify: <ip>::/0</ip> To open access only from localhost, specify: <ip>::1</ip> <ip>127.0.0.1</ip> Each element of list has one of the following forms: <ip> IP-address or network mask. Examples: 213.180.204.3 or 10.0.0.1/8 or 10.0.0.1/255.255.255.0 2a02:6b8::3 or 2a02:6b8::3/64 or 2a02:6b8::3/ffff:ffff:ffff:ffff::. <host> Hostname. Example: server01.clickhouse.com. To check access, DNS query is performed, and all received addresses compared to peer address. <host_regexp> Regular expression for host names. Example, ^server\d\d-\d\d-\d\.clickhouse\.com$ To check access, DNS PTR query is performed for peer address and then regexp is applied. Then, for result of PTR query, another DNS query is performed and all received addresses compared to peer address. Strongly recommended that regexp is ends with $ All results of DNS requests are cached till server restart. --> <networks> <ip>::/0</ip> </networks> <!-- Settings profile for user. --> <profile>default</profile> <!-- Quota for user. --> <quota>default</quota> <!-- User can create other users and grant rights to them. --> <!-- <access_management>1</access_management> --> </default> </users> <!-- Quotas. --> <quotas> <!-- Name of quota. --> <default> <!-- Limits for time interval. You could specify many intervals with different limits. --> <interval> <!-- Length of interval. --> <duration>3600</duration> <!-- No limits. Just calculate resource usage for time interval. --> <queries>0</queries> <errors>0</errors> <result_rows>0</result_rows> <read_rows>0</read_rows> <execution_time>0</execution_time> </interval> </default> </quotas> </clickhouse> ```
/content/code_sandbox/examples/r2dbc/misc/docker/clickhouse-docker-mount/users.xml
xml
2016-07-15T12:48:27
2024-08-16T15:57:09
clickhouse-java
ClickHouse/clickhouse-java
1,413
1,307
```xml import * as React from 'react'; import { makeStyles, tokens, Divider } from '@fluentui/react-components'; const useStyles = makeStyles({ root: { display: 'flex', flexDirection: 'column', rowGap: '5px', }, example: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyItems: 'center', minHeight: '96px', backgroundColor: tokens.colorNeutralBackground1, }, }); export const Inset = () => { const styles = useStyles(); return ( <div className={styles.root}> <div className={styles.example}> <Divider inset /> </div> <div className={styles.example}> <Divider inset>Text</Divider> </div> <div className={styles.example}> <Divider inset vertical style={{ height: '100%' }} /> </div> <div className={styles.example}> <Divider inset vertical style={{ height: '100%' }}> Text </Divider> </div> </div> ); }; Inset.parameters = { docs: { description: { story: 'A divider can have its line inset from the edges of its container.', }, }, }; ```
/content/code_sandbox/packages/react-components/react-divider/stories/src/Divider/DividerInset.stories.tsx
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
267
```xml import { animate, style, transition, trigger } from '@angular/animations'; import { CommonModule } from '@angular/common'; import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, ElementRef, EventEmitter, Input, NgModule, OnDestroy, Optional, Output, QueryList, TemplateRef, ViewEncapsulation, booleanAttribute } from '@angular/core'; import { Message, MessageService, PrimeTemplate } from 'primeng/api'; import { PrimeNGConfig } from 'primeng/api'; import { CheckIcon } from 'primeng/icons/check'; import { ExclamationTriangleIcon } from 'primeng/icons/exclamationtriangle'; import { InfoCircleIcon } from 'primeng/icons/infocircle'; import { TimesIcon } from 'primeng/icons/times'; import { TimesCircleIcon } from 'primeng/icons/timescircle'; import { RippleModule } from 'primeng/ripple'; import { Subscription, timer } from 'rxjs'; /** * Messages is used to display alerts inline. * @group Components */ @Component({ selector: 'p-messages', template: ` <div class="p-messages p-component" role="alert" [ngStyle]="style" [class]="styleClass" [attr.aria-atomic]="true" [attr.aria-live]="'assertive'" [attr.data-pc-name]="'message'"> <ng-container *ngIf="!contentTemplate; else staticMessage"> <div *ngFor="let msg of messages; let i = index" [class]="'p-message p-message-' + msg.severity" role="alert" [@messageAnimation]="{ value: 'visible', params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions } }" > <div class="p-message-wrapper" [attr.data-pc-section]="'wrapper'" [attr.id]="msg.id || null"> <span *ngIf="msg.icon" [class]="'p-message-icon pi ' + msg.icon" [attr.data-pc-section]="'icon'"> </span> <span class="p-message-icon" *ngIf="!msg.icon"> <ng-container> <CheckIcon *ngIf="msg.severity === 'success'" [attr.data-pc-section]="'icon'" /> <InfoCircleIcon *ngIf="msg.severity === 'info'" [attr.data-pc-section]="'icon'" /> <TimesCircleIcon *ngIf="msg.severity === 'error'" [attr.data-pc-section]="'icon'" /> <ExclamationTriangleIcon *ngIf="msg.severity === 'warn'" [attr.data-pc-section]="'icon'" /> </ng-container> </span> <ng-container *ngIf="!escape; else escapeOut"> <span *ngIf="msg.summary" class="p-message-summary" [innerHTML]="msg.summary" [attr.data-pc-section]="'summary'"></span> <span *ngIf="msg.detail" class="p-message-detail" [innerHTML]="msg.detail" [attr.data-pc-section]="'detail'"></span> </ng-container> <ng-template #escapeOut> <span *ngIf="msg.summary" class="p-message-summary" [attr.data-pc-section]="'summary'">{{ msg.summary }}</span> <span *ngIf="msg.detail" class="p-message-detail" [attr.data-pc-section]="'detail'">{{ msg.detail }}</span> </ng-template> <button class="p-message-close p-link" (click)="removeMessage(i)" *ngIf="closable && (msg.closable ?? true)" type="button" pRipple [attr.aria-label]="closeAriaLabel" [attr.data-pc-section]="'closebutton'"> <TimesIcon [styleClass]="'p-message-close-icon'" [attr.data-pc-section]="'closeicon'" /> </button> </div> </div> </ng-container> <ng-template #staticMessage> <div [ngClass]="'p-message p-message-' + severity" role="alert"> <div class="p-message-wrapper"> <ng-container *ngTemplateOutlet="contentTemplate"></ng-container> </div> </div> </ng-template> </div> `, animations: [ trigger('messageAnimation', [ transition(':enter', [style({ opacity: 0, transform: 'translateY(-25%)' }), animate('{{showTransitionParams}}')]), transition(':leave', [animate('{{hideTransitionParams}}', style({ height: 0, marginTop: 0, marginBottom: 0, marginLeft: 0, marginRight: 0, opacity: 0 }))]) ]) ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styleUrls: ['./messages.css'], host: { class: 'p-element' } }) export class Messages implements AfterContentInit, OnDestroy { /** * An array of messages to display. * @group Props */ @Input() set value(messages: Message[]) { this.messages = messages; this.startMessageLifes(this.messages); } /** * Defines if message box can be closed by the click icon. * @group Props */ @Input({ transform: booleanAttribute }) closable: boolean = true; /** * Inline style of the component. * @group Props */ @Input() style: { [klass: string]: any } | null | undefined; /** * Style class of the component. * @group Props */ @Input() styleClass: string | undefined; /** * Whether displaying services messages are enabled. * @group Props */ @Input({ transform: booleanAttribute }) enableService: boolean = true; /** * Id to match the key of the message to enable scoping in service based messaging. * @group Props */ @Input() key: string | undefined; /** * Whether displaying messages would be escaped or not. * @group Props */ @Input({ transform: booleanAttribute }) escape: boolean = true; /** * Severity level of the message. * @group Props */ @Input() severity: string | undefined; /** * Transition options of the show animation. * @group Props */ @Input() showTransitionOptions: string = '300ms ease-out'; /** * Transition options of the hide animation. * @group Props */ @Input() hideTransitionOptions: string = '200ms cubic-bezier(0.86, 0, 0.07, 1)'; /** * This function is executed when the value changes. * @param {Message[]} value - messages value. * @group Emits */ @Output() valueChange: EventEmitter<Message[]> = new EventEmitter<Message[]>(); /** * This function is executed when a message is closed. * @param {Message} value - Closed message. * @group Emits */ @Output() onClose: EventEmitter<Message> = new EventEmitter<Message>(); @ContentChildren(PrimeTemplate) templates: QueryList<PrimeTemplate> | undefined; messages: Message[] | null | undefined; messageSubscription: Subscription | undefined; clearSubscription: Subscription | undefined; timerSubscriptions: Subscription[] = []; contentTemplate: TemplateRef<any> | undefined; constructor(@Optional() public messageService: MessageService, public el: ElementRef, public cd: ChangeDetectorRef, private config: PrimeNGConfig) {} ngAfterContentInit() { this.templates?.forEach((item) => { switch (item.getType()) { case 'content': this.contentTemplate = item.template; break; default: this.contentTemplate = item.template; break; } }); if (this.messageService && this.enableService && !this.contentTemplate) { this.messageSubscription = this.messageService.messageObserver.subscribe((messages: Message | Message[]) => { if (messages) { if (!Array.isArray(messages)) { messages = [messages]; } const filteredMessages = messages.filter((m) => this.key === m.key); this.messages = this.messages ? [...this.messages, ...filteredMessages] : [...filteredMessages]; this.startMessageLifes(filteredMessages); this.cd.markForCheck(); } }); this.clearSubscription = this.messageService.clearObserver.subscribe((key) => { if (key) { if (this.key === key) { this.messages = null; } } else { this.messages = null; } this.cd.markForCheck(); }); } } hasMessages() { let parentEl = this.el.nativeElement.parentElement; if (parentEl && parentEl.offsetParent) { return this.contentTemplate != null || (this.messages && this.messages.length > 0); } return false; } clear() { this.messages = []; this.valueChange.emit(this.messages); } removeMessage(i: number) { const removedMessage = this.messages[i]; this.messages = this.messages?.filter((msg, index) => index !== i); removedMessage && this.onClose.emit(removedMessage); this.valueChange.emit(this.messages); } get icon(): string | null { const severity = this.severity || (this.hasMessages() ? this.messages![0].severity : null); if (this.hasMessages()) { switch (severity) { case 'success': return 'pi-check'; case 'info': return 'pi-info-circle'; case 'error': return 'pi-times'; case 'warn': return 'pi-exclamation-triangle'; default: return 'pi-info-circle'; } } return null; } get closeAriaLabel() { return this.config.translation.aria ? this.config.translation.aria.close : undefined; } ngOnDestroy() { if (this.messageSubscription) { this.messageSubscription.unsubscribe(); } if (this.clearSubscription) { this.clearSubscription.unsubscribe(); } this.timerSubscriptions?.forEach((subscription) => subscription.unsubscribe()); } private startMessageLifes(messages: Message[]): void { messages?.forEach((message) => message.life && this.startMessageLife(message)); } private startMessageLife(message: Message): void { const timerSubsctiption = timer(message.life!).subscribe(() => { this.messages = this.messages?.filter((msgEl) => msgEl !== message); this.timerSubscriptions = this.timerSubscriptions?.filter((timerEl) => timerEl !== timerSubsctiption); this.valueChange.emit(this.messages); this.cd.markForCheck(); }); this.timerSubscriptions.push(timerSubsctiption); } } @NgModule({ imports: [CommonModule, RippleModule, CheckIcon, InfoCircleIcon, TimesCircleIcon, ExclamationTriangleIcon, TimesIcon], exports: [Messages], declarations: [Messages] }) export class MessagesModule {} ```
/content/code_sandbox/src/app/components/messages/messages.ts
xml
2016-01-16T09:23:28
2024-08-16T19:58:20
primeng
primefaces/primeng
9,969
2,399
```xml import React from 'react'; import { StyleSheet, View, TouchableOpacity, Text, Alert } from 'react-native'; import { NavigationProps } from 'react-native-navigation'; interface Props extends NavigationProps { title: string; } export default class CustomTextButton extends React.Component<Props> { render() { return ( <View style={styles.container}> <TouchableOpacity style={styles.button} onPress={() => Alert.alert(this.props.title, 'Thanks for that :)')} > <Text style={styles.text}>Press Me</Text> </TouchableOpacity> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, width: 60, flexDirection: 'column', justifyContent: 'center', }, button: { flex: 1, flexDirection: 'column', }, text: { color: 'black', }, }); ```
/content/code_sandbox/playground/src/screens/CustomTextButton.tsx
xml
2016-03-11T11:22:54
2024-08-15T09:05:44
react-native-navigation
wix/react-native-navigation
13,021
195
```xml import { IAccessRequests, IFile } from "../../types"; import { __, renderUserFullName } from "@erxes/ui/src/utils/core"; import Button from "@erxes/ui/src/components/Button"; import EmptyState from "@erxes/ui/src/components/EmptyState"; import { ItemName } from "../../styles"; import Label from "@erxes/ui/src/components/Label"; import React from "react"; import Table from "@erxes/ui/src/components/table"; import Tip from "@erxes/ui/src/components/Tip"; import dayjs from "dayjs"; import { renderFileIcon } from "../../utils"; import withTableWrapper from "@erxes/ui/src/components/table/withTableWrapper"; type Props = { requests: IAccessRequests[]; onConfirm: (vars: any) => void; type?: string; hideActions?: boolean; }; class RequestedFileList extends React.Component<Props> { render() { const { requests, onConfirm, hideActions } = this.props; if (!requests || requests.length === 0) { return ( <EmptyState image="/images/actions/5.svg" text="No files at the moment!" /> ); } return ( <withTableWrapper.Wrapper> <Table $whiteSpace="nowrap" $hover={true} $bordered={true} $responsive={true} $wideHeader={true} > <thead> <tr> <th style={{ paddingLeft: "0" }}> <ItemName>{__("Name")}</ItemName> </th> <th> <ItemName>{__("Size")}</ItemName> </th> <th> <ItemName>{__("Type")}</ItemName> </th> <th> <ItemName>{__("Status")}</ItemName> </th> <th> <ItemName>{__("Description")}</ItemName> </th> <th> <ItemName> {hideActions ? __("User") : __("Requested user")} </ItemName> </th> <th> <ItemName>{__("Created Date")}</ItemName> </th> {!hideActions && ( <th> <ItemName>{__("Actions")}</ItemName> </th> )} </tr> </thead> <tbody id="fileManagerfiles"> {requests.map((item) => { const { type, name, contentType, info = {} as any, } = item && item.file ? item.file : ({} as IFile); return ( <tr key={item._id} className="crow"> <td style={{ paddingLeft: "0" }}> <ItemName> <a> {renderFileIcon( type === "dynamic" ? "aaa.dynamic" : info.name )} {contentType ? name : info.name} </a> </ItemName> </td> <td>{info.size && `${Math.round(info.size / 1000)} Kb`}</td> <td>{info.type}</td> <td> <Label ignoreTrans={true}>{item.status}</Label> </td> <td>{item.description || "-"}</td> <td> {renderUserFullName( hideActions ? item.toUser || {} : item.fromUser || {} )} </td> <td>{dayjs(item.createdAt).format("MMMM D, YYYY h:mm A")}</td> {!hideActions && ( <td> <Button btnStyle="success" icon="checked-1" size="small" onClick={() => onConfirm(item._id)} > {this.props.type ? "Acknowledge request" : "Confirm request"} </Button> </td> )} </tr> ); })} </tbody> </Table> </withTableWrapper.Wrapper> ); } } export default RequestedFileList; ```
/content/code_sandbox/packages/plugin-filemanager-ui/src/components/file/RequestedFilesList.tsx
xml
2016-11-11T06:54:50
2024-08-16T10:26:06
erxes
erxes/erxes
3,479
863
```xml import { $$asyncIterator } from 'iterall'; export type FilterFn<TSource = any, TArgs = any, TContext = any> = (rootValue?: TSource, args?: TArgs, context?: TContext, info?: any) => boolean | Promise<boolean>; export type ResolverFn<TSource = any, TArgs = any, TContext = any> = (rootValue?: TSource, args?: TArgs, context?: TContext, info?: any) => AsyncIterator<any>; interface IterallAsyncIterator<T> extends AsyncIterator<T> { [$$asyncIterator](): IterallAsyncIterator<T>; } export type WithFilter<TSource = any, TArgs = any, TContext = any> = ( asyncIteratorFn: ResolverFn<TSource, TArgs, TContext>, filterFn: FilterFn<TSource, TArgs, TContext> ) => ResolverFn<TSource, TArgs, TContext>; export function withFilter<TSource = any, TArgs = any, TContext = any>( asyncIteratorFn: ResolverFn<TSource, TArgs, TContext>, filterFn: FilterFn<TSource, TArgs, TContext> ): ResolverFn<TSource, TArgs, TContext> { return (rootValue: TSource, args: TArgs, context: TContext, info: any): IterallAsyncIterator<any> => { const asyncIterator = asyncIteratorFn(rootValue, args, context, info); const getNextPromise = () => { return new Promise<IteratorResult<any>>((resolve, reject) => { const inner = () => { asyncIterator .next() .then(payload => { if (payload.done === true) { resolve(payload); return; } Promise.resolve(filterFn(payload.value, args, context, info)) .catch(() => false) // We ignore errors from filter function .then(filterResult => { if (filterResult === true) { resolve(payload); return; } // Skip the current value and wait for the next one inner(); return; }); }) .catch((err) => { reject(err); return; }); }; inner(); }); }; const asyncIterator2 = { next() { return getNextPromise(); }, return() { return asyncIterator.return(); }, throw(error) { return asyncIterator.throw(error); }, [$$asyncIterator]() { return this; }, }; return asyncIterator2; }; }; ```
/content/code_sandbox/src/with-filter.ts
xml
2016-08-19T19:08:00
2024-07-04T19:27:14
graphql-subscriptions
apollographql/graphql-subscriptions
1,584
532
```xml <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>TransfersStatusWidget</class> <widget class="QWidget" name="TransfersStatusWidget"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>24</width> <height>24</height> </rect> </property> <property name="minimumSize"> <size> <width>24</width> <height>24</height> </size> </property> <property name="windowTitle"> <string/> </property> <widget class="QPushButton" name="bTransferManager"> <property name="geometry"> <rect> <x>6</x> <y>6</y> <width>12</width> <height>12</height> </rect> </property> <property name="font"> <font> <stylestrategy>PreferDefault</stylestrategy> </font> </property> <property name="cursor"> <cursorShape>PointingHandCursor</cursorShape> </property> <property name="mouseTracking"> <bool>true</bool> </property> <property name="styleSheet"> <string notr="true">border: none; </string> </property> <property name="text"> <string/> </property> <property name="icon"> <iconset resource="../../../gui/Resources_linux.qrc"> <normaloff>:/images/transfer_manager.png</normaloff>:/images/transfer_manager.png</iconset> </property> <property name="iconSize"> <size> <width>9999</width> <height>9999</height> </size> </property> <property name="autoRepeat"> <bool>true</bool> </property> <property name="autoDefault"> <bool>true</bool> </property> <property name="flat"> <bool>true</bool> </property> </widget> </widget> <resources> <include location="../../../gui/Resources_linux.qrc"/> </resources> <connections/> </ui> ```
/content/code_sandbox/src/MEGASync/transfers/gui/linux/TransfersStatusWidget.ui
xml
2016-02-10T18:28:05
2024-08-16T19:36:44
MEGAsync
meganz/MEGAsync
1,593
501
```xml describe("hello world", () => { it("works", () => { expect(true).toBe(true) }) }) ```
/content/code_sandbox/lib/reactotron-react-js/test/replaceme.test.ts
xml
2016-04-15T21:58:32
2024-08-16T11:39:46
reactotron
infinitered/reactotron
14,757
27
```xml import { inject } from "@angular/core"; import { ActivatedRouteSnapshot, CanActivateFn, createUrlTreeFromSnapshot } from "@angular/router"; import { firstValueFrom } from "rxjs"; import { ProviderService } from "@bitwarden/common/admin-console/abstractions/provider.service"; import { ProviderStatusType } from "@bitwarden/common/admin-console/enums"; import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; export const hasConsolidatedBilling: CanActivateFn = async (route: ActivatedRouteSnapshot) => { const configService = inject(ConfigService); const providerService = inject(ProviderService); const provider = await firstValueFrom(providerService.get$(route.params.providerId)); const consolidatedBillingEnabled = await configService.getFeatureFlag( FeatureFlag.EnableConsolidatedBilling, ); if ( !consolidatedBillingEnabled || !provider || provider.providerStatus !== ProviderStatusType.Billable ) { return createUrlTreeFromSnapshot(route, ["/providers", route.params.providerId]); } return true; }; ```
/content/code_sandbox/bitwarden_license/bit-web/src/app/billing/providers/guards/has-consolidated-billing.guard.ts
xml
2016-03-09T23:14:01
2024-08-16T15:07:51
clients
bitwarden/clients
8,877
249
```xml import { type FC, type ReactNode, useEffect, useRef } from 'react'; import { useSelector } from 'react-redux'; import { Form, FormikProvider, useFormik } from 'formik'; import { c } from 'ttag'; import { Button } from '@proton/atoms/Button'; import { Icon, type IconName } from '@proton/components/components'; import { SidebarModal } from '@proton/pass/components/Layout/Modal/SidebarModal'; import { Panel } from '@proton/pass/components/Layout/Panel/Panel'; import { PanelHeader } from '@proton/pass/components/Layout/Panel/PanelHeader'; import { useOrganization } from '@proton/pass/components/Organization/OrganizationProvider'; import { useActionRequest } from '@proton/pass/hooks/useActionRequest'; import { useValidateInviteAddresses } from '@proton/pass/hooks/useValidateInviteAddress'; import { validateShareInviteValues } from '@proton/pass/lib/validation/vault-invite'; import { type inviteBatchCreateFailure, inviteBatchCreateIntent, type inviteBatchCreateSuccess, } from '@proton/pass/store/actions'; import type { VaultShareItem } from '@proton/pass/store/reducers'; import { selectDefaultVault } from '@proton/pass/store/selectors'; import { BitField, type Callback, type InviteFormValues, type SelectedItem } from '@proton/pass/types'; import { VaultColor, VaultIcon } from '@proton/pass/types/protobuf/vault-v1'; import noop from '@proton/utils/noop'; import { useInviteContext } from './InviteProvider'; import { FORM_ID, VaultInviteForm } from './VaultInviteForm'; export type VaultInviteCreateProps = | { withVaultCreation: false; vault: VaultShareItem } | { withVaultCreation: true; item?: SelectedItem; onVaultCreated?: (shareId: string) => void }; export type VaultInviteCreateValues<T extends boolean = boolean> = Omit< Extract<VaultInviteCreateProps, { withVaultCreation: T }>, 'withVaultCreation' | 'onVaultCreated' >; export const VaultInviteCreate: FC<VaultInviteCreateProps> = (props) => { const { close, manageAccess } = useInviteContext(); const org = useOrganization({ sync: true }); const defaultShareId = useSelector(selectDefaultVault).shareId; const shareId = props.withVaultCreation ? defaultShareId : props.vault.shareId; const addressValidator = useValidateInviteAddresses(shareId); const validateAddresses = !org?.b2bAdmin && org?.settings.ShareMode === BitField.ACTIVE; const emailFieldRef = useRef<HTMLInputElement>(null); const createInvite = useActionRequest< typeof inviteBatchCreateIntent, typeof inviteBatchCreateSuccess, typeof inviteBatchCreateFailure >(inviteBatchCreateIntent, { onSuccess: (req) => { const { shareId } = req.data; if (props.withVaultCreation) props.onVaultCreated?.(shareId); manageAccess(shareId); }, }); const form = useFormik<InviteFormValues>({ initialValues: { step: 'members', members: [], ...(props.withVaultCreation ? { color: VaultColor.COLOR3, description: '', icon: VaultIcon.ICON9, item: props.item, name: c('Placeholder').t`Shared vault`, withVaultCreation: true, } : { color: props.vault.content.display.color ?? VaultColor.COLOR_UNSPECIFIED, description: '', icon: props.vault.content.display.icon ?? VaultIcon.ICON_UNSPECIFIED, name: props.vault.content.name, shareId: props.vault.shareId, withVaultCreation: false, }), }, initialErrors: { members: [] }, validateOnChange: true, validate: validateShareInviteValues({ emailField: emailFieldRef, validateAddresses, validationMap: addressValidator.emails, }), onSubmit: (values, { setFieldValue }) => { if (addressValidator.loading) return; switch (values.step) { case 'members': return setFieldValue('step', 'permissions'); case 'vault': return setFieldValue('step', 'members'); case 'permissions': return setFieldValue('step', 'review'); case 'review': createInvite.dispatch(values); break; } }, }); useEffect(() => { if (validateAddresses) { addressValidator .validate(form.values.members.map(({ value }) => value.email)) .then(() => form.validateForm()) .catch(noop); } }, [form.values.members, validateAddresses]); const attributes = ((): { submitText: string; closeAction: Callback; closeLabel: string; closeIcon: IconName; } => { const sharedVault = !props.withVaultCreation && props.vault.shared; const submitText = sharedVault ? c('Action').t`Send invite` : c('Action').t`Share vault`; switch (form.values.step) { case 'vault': return { closeAction: () => form.setFieldValue('step', 'members'), closeIcon: 'chevron-left', closeLabel: c('Action').t`Back`, submitText: c('Action').t`Update vault`, }; case 'permissions': return { closeAction: () => form.setFieldValue('step', 'members'), closeIcon: 'chevron-left', closeLabel: c('Action').t`Back`, submitText, }; case 'review': return { closeAction: () => form.setFieldValue('step', 'permissions'), closeIcon: 'chevron-left', closeLabel: c('Action').t`Back`, submitText, }; case 'members': return { closeAction: close, closeIcon: 'cross-big', closeLabel: c('Action').t`Close`, submitText: c('Action').t`Continue`, }; } })(); return ( <SidebarModal onClose={close} open> {(didEnter): ReactNode => ( <Panel loading={createInvite.loading} className="pass-panel--full" header={ <PanelHeader actions={[ <Button className="shrink-0" disabled={form.values.step === 'review' && createInvite.loading} icon key="modal-close-button" onClick={attributes.closeAction} pill shape="solid" > <Icon className="modal-close-icon" name={attributes.closeIcon} alt={attributes.closeLabel} /> </Button>, <Button color="norm" disabled={createInvite.loading || addressValidator.loading || !form.isValid} form={FORM_ID} key="modal-submit-button" loading={createInvite.loading} pill type="submit" > {attributes.submitText} </Button>, ]} /> } > <FormikProvider value={form}> <Form id={FORM_ID} className="flex-1"> <VaultInviteForm form={form} autoFocus={didEnter} ref={emailFieldRef} addressValidator={addressValidator} /> </Form> </FormikProvider> </Panel> )} </SidebarModal> ); }; ```
/content/code_sandbox/packages/pass/components/Invite/VaultInviteCreate.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
1,586
```xml <?xml version="1.0" encoding="utf-8"?> <WixLocalization Culture="zh-cn" xmlns="path_to_url"> <String Id="Locale" Overridable="yes">zh_CN</String> <String Id="ProductName" Overridable="yes">Aspia </String> <String Id="ShortcutName" Overridable="yes">Aspia </String> <String Id="DowngradeErrorMessage" Overridable="yes"></String> <String Id="AddressBookFile" Overridable="yes">Aspia (.aab)</String> <String Id="CreateDesktopShortcut" Overridable="yes"></String> <String Id="CreateProgramMenuShortcut" Overridable="yes"></String> </WixLocalization> ```
/content/code_sandbox/installer/translations/console.zh-cn.wxl
xml
2016-10-26T16:17:31
2024-08-16T13:37:42
aspia
dchapyshev/aspia
1,579
167
```xml import spawnAsync, { SpawnResult } from '@expo/spawn-async'; import path from 'path'; import { env } from '../../../utils/env'; import { AbortCommandError } from '../../../utils/errors'; const debug = require('debug')('expo:start:platforms:android:gradle') as typeof console.log; function upperFirst(name: string) { return name.charAt(0).toUpperCase() + name.slice(1); } /** Format gradle assemble arguments. Exposed for testing. */ export function formatGradleArguments( cmd: 'assemble' | 'install', { appName, variant, tasks = [cmd + upperFirst(variant)], }: { tasks?: string[]; variant: string; appName: string } ): string[] { return appName ? tasks.map((task) => `${appName}:${task}`) : tasks; } function resolveGradleWPath(androidProjectPath: string): string { return path.join(androidProjectPath, process.platform === 'win32' ? 'gradlew.bat' : 'gradlew'); } function getPortArg(port: number): string { return `-PreactNativeDevServerPort=${port}`; } function getActiveArchArg(architectures: string): string { return `-PreactNativeArchitectures=${architectures}`; } /** * Build the Android project using Gradle. * * @param androidProjectPath - Path to the Android project like `projectRoot/android`. * @param props.variant - Variant to install. * @param props.appName - Name of the 'app' folder, this appears to always be `app`. * @param props.port - Dev server port to pass to the install command. * @param props.buildCache - Should use the `--build-cache` flag, enabling the [Gradle build cache](path_to_url * @param props.architectures - Architectures to build for. * @returns - A promise resolving to spawn results. */ export async function assembleAsync( androidProjectPath: string, { variant, port, appName, buildCache, architectures, }: { variant: string; port?: number; appName: string; buildCache?: boolean; architectures?: string; } ): Promise<SpawnResult> { const task = formatGradleArguments('assemble', { variant, appName }); const args = [ ...task, // ignore linting errors '-x', 'lint', // ignore tests '-x', 'test', '--configure-on-demand', ]; if (buildCache) args.push('--build-cache'); // Generate a profile under `/android/app/build/reports/profile` if (env.EXPO_PROFILE) args.push('--profile'); return await spawnGradleAsync(androidProjectPath, { port, architectures, args }); } /** * Install an app on device or emulator using `gradlew install`. * * @param androidProjectPath - Path to the Android project like `projectRoot/android`. * @param props.variant - Variant to install. * @param props.appName - Name of the 'app' folder, this appears to always be `app`. * @param props.port - Dev server port to pass to the install command. * @returns - A promise resolving to spawn results. */ export async function installAsync( androidProjectPath: string, { variant, appName, port, }: { variant: string; appName: string; port?: number; } ): Promise<SpawnResult> { const args = formatGradleArguments('install', { variant, appName }); return await spawnGradleAsync(androidProjectPath, { port, args }); } export async function spawnGradleAsync( projectRoot: string, { port, architectures, args }: { port?: number; architectures?: string; args: string[] } ): Promise<SpawnResult> { const gradlew = resolveGradleWPath(projectRoot); if (port != null) args.push(getPortArg(port)); if (architectures) args.push(getActiveArchArg(architectures)); debug(` ${gradlew} ${args.join(' ')}`); try { return await spawnAsync(gradlew, args, { cwd: projectRoot, stdio: 'inherit', }); } catch (error: any) { // User aborted the command with ctrl-c if (error.status === 130) { // Fail silently throw new AbortCommandError(); } throw error; } } ```
/content/code_sandbox/packages/@expo/cli/src/start/platforms/android/gradle.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
955
```xml import React from 'react'; type IconProps = React.SVGProps<SVGSVGElement>; export declare const IcStarSlash: (props: IconProps) => React.JSX.Element; export {}; ```
/content/code_sandbox/packages/icons/lib/icStarSlash.d.ts
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
43
```xml /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, Inject } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { I18NService } from '@core'; import { SettingsService, User, ALAIN_I18N_TOKEN } from '@delon/theme'; import { NzMessageService } from 'ng-zorro-antd/message'; import { Router, ActivatedRoute } from '@angular/router'; import { ChangePassword } from '../../../entity/ChangePassword'; import { PasswordService } from '../../../service/password.service'; @Component({ selector: 'app-password', templateUrl: './password.component.html', styleUrls: ['./password.component.less'] }) export class PasswordComponent implements OnInit { form: { submitting: boolean; model: ChangePassword; } = { submitting: false, model: new ChangePassword() }; validateForm!: FormGroup; oldPasswordVisible = false; policy:any = {}; passwordVisible = false; policyMessage:any[] =[]; dynamicallyCheckPasswordErrorMsg = ""; constructor( private router: Router, private fb: FormBuilder, private settingsService: SettingsService, private passwordService: PasswordService, private msg: NzMessageService, @Inject(ALAIN_I18N_TOKEN) private i18n: I18NService, private cdr: ChangeDetectorRef ) { } ngOnInit(): void { this.loadPolicy(); this.validateForm = this.fb.group({ oldPassword: [null, [Validators.required]], confirmPassword: [null, [Validators.required]], password: [null, [Validators.required]], }); let user: any = this.settingsService.user; this.form.model.userId = user.userId; this.form.model.displayName = user.displayName; this.form.model.username = user.username; this.form.model.id = user.userId; this.cdr.detectChanges(); } loadPolicy():void { this.policyMessage=[]; this.passwordService.passwordpolicy().subscribe(res => { if(res.code == 0) { let data = res.data; this.policy = data; this.policyMessage=res.data.policMessageList; } }); } dynamicallyCheckConfirm(value:any):void { if (value != this.form.model.password) { this.dynamicallyCheckPasswordErrorMsg = this.i18n.fanyi('validation.password.twice') } else { this.dynamicallyCheckPasswordErrorMsg = ''; } } dynamicallyCheckPassword(value:any):void { if (value == '') { this.dynamicallyCheckPasswordErrorMsg = ''; return; } let data = this.policy; if (data.minLength != 0 && data.maxLength != 0) { let inputLength = value.length; if (inputLength < data.minLength || inputLength > data.maxLength) { //this.dynamicallyCheckPasswordErrorMsg = ""+data.minLength+"-"+data.maxLength+"" this.dynamicallyCheckPasswordErrorMsg = this.i18n.fanyi('validation.password.non-conformance-strength') return; } } if (data.lowerCase > 0) { let strArr = Array.from(value) let abc:any = []; strArr.forEach(function (value:any, index, array) { let code = value.charCodeAt() if (code >= 'a'.charCodeAt(0) && code <= 'z'.charCodeAt(0)) { abc.push(value) } }) if(abc.length < data.lowerCase) { //this.dynamicallyCheckPasswordErrorMsg = ""+data.lowerCase+"a-z" this.dynamicallyCheckPasswordErrorMsg = this.i18n.fanyi('validation.password.non-conformance-strength') return; } } if(data.upperCase > 0) { let strArr = Array.from(value) let ABC:any = []; strArr.forEach(function (value:any, index, array) { let code = value.charCodeAt() if (code >= 'A'.charCodeAt(0) && code <= 'Z'.charCodeAt(0)) { ABC.push(value) } }) if(ABC.length < data.upperCase) { this.dynamicallyCheckPasswordErrorMsg = this.i18n.fanyi('validation.password.non-conformance-strength') //this.dynamicallyCheckPasswordErrorMsg = ""+data.lowerCase+"A-Z" return; } } if (data.digits > 0) { let strArr = Array.from(value) let number:any = []; strArr.forEach(function (value:any, index, array) { var regPos = /^[0-9]+.?[0-9]*/; // if(regPos.test(value) ){ number.push(value) } }) if(number.length < data.digits) { //this.dynamicallyCheckPasswordErrorMsg = ""+data.digits+"0-9"; this.dynamicallyCheckPasswordErrorMsg = this.i18n.fanyi('validation.password.non-conformance-strength') return; } } if(data.specialChar > 0) { var AllNumIsSame = new Array("","","!","@","#","$","%","^","&","*","."); let strArr = Array.from(value) let number:any = []; strArr.forEach(function (value:any, index, array) { if(AllNumIsSame.indexOf(value) != -1){//$.type jquery number.push(value) } }) if(number.length < data.specialChar) { //this.dynamicallyCheckPasswordErrorMsg = ""+data.specialChar+""; this.dynamicallyCheckPasswordErrorMsg = this.i18n.fanyi('validation.password.non-conformance-strength') return; } } this.dynamicallyCheckPasswordErrorMsg = ''; } onSubmit(): void { if (this.validateForm.valid) { if (this.dynamicallyCheckPasswordErrorMsg == '') { this.form.submitting = true; this.form.model.trans(); this.passwordService.changePassword(this.form.model).subscribe(res => { if (res.code == 0) { this.form.model.init(res.data); this.msg.success(this.i18n.fanyi('mxk.alert.operate.success')); this.form.model.password = ''; this.form.model.oldPassword = ''; this.form.model.confirmPassword = ''; // let user = this.settingsService.user; user['passwordSetType'] = 0; this.settingsService.setUser(user) this.router.navigateByUrl('/'); } else { if (res.message) { this.msg.error(res.message); return } this.msg.error(this.i18n.fanyi('mxk.alert.operate.error')); } }); this.form.submitting = false; this.cdr.detectChanges(); } } else { Object.values(this.validateForm.controls).forEach(control => { if (control.invalid) { control.markAsDirty(); control.updateValueAndValidity({ onlySelf: true }); } }); } } } ```
/content/code_sandbox/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/password/password.component.ts
xml
2016-11-16T03:06:50
2024-08-16T09:22:42
MaxKey
dromara/MaxKey
1,423
1,535
```xml <Project> <PropertyGroup> <RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory> <BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory> </PropertyGroup> <Import Project="$(BuildToolsDirectory)Windows.Toolkit.Common.props" /> <Choose> <When Condition="$(IsCoreProject)"> <PropertyGroup> <GenerateDocumentationFile>true</GenerateDocumentationFile> <PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath> <GenerateLibraryLayout Condition="$(IsUwpProject)">true</GenerateLibraryLayout> <TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors> </PropertyGroup> </When> <Otherwise> <PropertyGroup> <IsPackable>false</IsPackable> <IsPublishable>false</IsPublishable> <NoWarn>$(NoWarn);CS8002;SA0001</NoWarn> </PropertyGroup> </Otherwise> </Choose> <Choose> <When Condition="$(IsUwpProject)"> <PropertyGroup> <!-- Code CS8002 is a warning for strong named -> non-strong-named reference. This is valid for platforms other than .NET Framework (and is needed for the UWP targets. --> <NoWarn>$(NoWarn);CS8002</NoWarn> <!-- For including default @(Page) and @(Resource) items via 'MSBuild.Sdk.Extras' Sdk package. Also provides up to date check and file nesting --> <ExtrasEnableDefaultXamlItems>true</ExtrasEnableDefaultXamlItems> </PropertyGroup> </When> </Choose> <Choose> <When Condition="!$(IsDesignProject)"> <!-- Debug builds have this turned on by default, but it breaks our Xaml Islands Scenarios. ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. --> <PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <EnableXBindDiagnostics>false</EnableXBindDiagnostics> <EnableTypeInfoReflection>false</EnableTypeInfoReflection> </PropertyGroup> <ItemGroup> <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" /> </ItemGroup> </When> </Choose> <Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.props" Condition="$(IsDesignProject)" /> <ItemGroup> <PackageReference Include="Nerdbank.GitVersioning" Version="3.3.37" PrivateAssets="All" /> </ItemGroup> <Choose> <When Condition="!$(IsSampleProject) and '$(SourceLinkEnabled)' != 'false'"> <PropertyGroup> <!-- Declare that the Repository URL can be published to NuSpec --> <PublishRepositoryUrl>true</PublishRepositoryUrl> <!-- Embed source files that are not tracked by the source control manager to the PDB --> <EmbedUntrackedSources>true</EmbedUntrackedSources> <!-- Include PDB in the built .nupkg --> <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> </ItemGroup> </When> </Choose> </Project> ```
/content/code_sandbox/Directory.Build.props
xml
2016-06-17T21:29:46
2024-08-16T09:32:00
WindowsCommunityToolkit
CommunityToolkit/WindowsCommunityToolkit
5,842
764
```xml <resources> <string name="download_file_error"></string> <string name="downloading_toast"> %1$s</string> <string name="no_rw_storage"></string> <string name="no_thanks"></string> <string name="yes"></string> <string name="ok"></string> </resources> ```
/content/code_sandbox/src/main/res/values-zh-rCN/strings.xml
xml
2016-08-05T16:58:55
2024-08-16T16:39:40
MagiskManager
topjohnwu/MagiskManager
1,489
74
```xml <clickhouse> <profiles> <default> <distributed_ddl_entry_format_version>6</distributed_ddl_entry_format_version> </default> </profiles> </clickhouse> ```
/content/code_sandbox/tests/config/users.d/replicated_ddl_entry.xml
xml
2016-06-02T08:28:18
2024-08-16T18:39:33
ClickHouse
ClickHouse/ClickHouse
36,234
43
```xml import { Range } from 'slate' export const input = { anchor: { path: [0], offset: 0, }, focus: { path: [3], offset: 0, }, } export const test = range => { return Range.isExpanded(range) } export const output = true ```
/content/code_sandbox/packages/slate/test/interfaces/Range/isExpanded/expanded.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
73
```xml export * from './ig-action-spam.error'; export * from './ig-challenge-wrong-code.error'; export * from './ig-checkpoint.error'; export * from './ig-client.error'; export * from './ig-cookie-not-found.error'; export * from './ig-exact-user-not-found-error'; export * from './ig-inactive-user.error'; export * from './ig-login-bad-password.error'; export * from './ig-login-invalid-user.error'; export * from './ig-login-required.error'; export * from './ig-login-two-factor-required.error'; export * from './ig-network.error'; export * from './ig-no-checkpoint.error'; export * from './ig-not-found.error'; export * from './ig-parse.error'; export * from './ig-private-user.error'; export * from './ig-requests-limit.error'; export * from './ig-response.error'; export * from './ig-sentry-block.error'; export * from './ig-no-checkpoint.error'; export * from './ig-challenge-wrong-code.error'; export * from './ig-exact-user-not-found-error'; export * from './ig-user-id-not-found.error'; export * from './ig-upload-video-error'; export * from './ig-user-has-logged-out.error'; export * from './ig-configure-video-error'; ```
/content/code_sandbox/src/errors/index.ts
xml
2016-06-09T12:14:48
2024-08-16T10:07:22
instagram-private-api
dilame/instagram-private-api
5,877
261
```xml export { PushBranchCommits } from './push-branch-commits' export { BranchList } from './branch-list' export { BranchesContainer } from './branches-container' export { PullRequestBadge } from './pull-request-badge' export { groupBranches, IBranchListItem } from './group-branches' export { BranchListItem } from './branch-list-item' export { renderDefaultBranch } from './branch-renderer' ```
/content/code_sandbox/app/src/ui/branches/index.ts
xml
2016-05-11T15:59:00
2024-08-16T17:00:41
desktop
desktop/desktop
19,544
88
```xml import { Routes } from '@angular/router'; export const routes: Routes = []; ```
/content/code_sandbox/packages/static-build/test/fixtures/angular-v17/src/app/app.routes.ts
xml
2016-09-09T01:12:08
2024-08-16T17:39:45
vercel
vercel/vercel
12,545
17
```xml type T00 = bigint; ```
/content/code_sandbox/tests/format/typescript/bigint/bigint.ts
xml
2016-11-29T17:13:37
2024-08-16T17:29:57
prettier
prettier/prettier
48,913
7
```xml <?xml version="1.0"?> <doc> <assembly> <name>Microsoft.AppCenter.Crashes</name> </assembly> <members> <member name="T:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper"> <summary> ErrorLogHelper to help constructing, serializing, and de-serializing locally stored error logs. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.ErrorLogFileExtension"> <summary> Error log file extension for the JSON schema. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.ExceptionFileExtension"> <summary> Error log file extension for the serialized exception for client side inspection. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.ErrorStorageDirectoryName"> <summary> Error log directory within application files. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper._deviceInformationHelper"> <summary> Device information utility. Exposed for testing purposes only. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper._processInformation"> <summary> Process information utility. Exposed for testing purposes only. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper._crashesDirectory"> <summary> Directory containing crashes files. Exposed for testing purposes only. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.LockObject"> <summary> Static lock object. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.Instance"> <summary> Singleton instance. Should only be accessed from unit tests. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.#ctor"> <summary> Public constructor for testing purposes. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.CreateErrorLog(System.Exception)"> <summary> Creates an error log for the given exception object. </summary> <param name="exception">The exception.</param> <returns>A new error log instance.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.GetErrorLogFiles"> <summary> Gets all files with the error log file extension in the error directory. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.GetErrorStorageDirectory"> <summary> Gets the error storage directory, or creates it if it does not exist. </summary> <returns>The error storage directory.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.GetStoredErrorLogFile(System.Guid)"> <summary> Gets the error log file with the given ID. </summary> <param name="errorId">The ID for the error log.</param> <returns>The error log file or null if it is not found.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.GetStoredExceptionFile(System.Guid)"> <summary> Gets the exception file with the given ID. </summary> <param name="errorId">The ID for the exception.</param> <returns>The exception file or null if it is not found.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.ReadErrorLogFile(Microsoft.AppCenter.Utils.Files.File)"> <summary> Reads an error log on disk. </summary> <param name="file">The error log file.</param> <returns>The managed error log instance.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.ReadExceptionFile(Microsoft.AppCenter.Utils.Files.File)"> <summary> Reads an exception on disk. </summary> <param name="file">The exception file.</param> <returns>The exception stack trace.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.SaveErrorLogFiles(System.Exception,Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog)"> <summary> Saves an error log and an exception on disk. </summary> <param name="exception">The exception that caused the crash.</param> <param name="errorLog">The error log.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.RemoveStoredErrorLogFile(System.Guid)"> <summary> Deletes an error log from disk. </summary> <param name="errorId">The ID for the error log.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.RemoveStoredExceptionFile(System.Guid)"> <summary> Deletes an exception from disk. </summary> <param name="errorId">The ID for the exception.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.RemoveAllStoredErrorLogFiles"> <summary> Removes all stored error log files. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.InstanceReadErrorLogFile(Microsoft.AppCenter.Utils.Files.File)"> <summary> Reads an error log file from the given file. </summary> <param name="file">The file that contains error log.</param> <returns>An error log instance or null if the file doesn't contain an error log.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.InstanceReadExceptionFile(Microsoft.AppCenter.Utils.Files.File)"> <summary> Reads an exception file from the given file. </summary> <param name="file">The file that contains exception.</param> <returns>An exception stack trace or null if the file cannot be read.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.InstanceGetErrorStorageDirectory"> <summary> Saves an error log and an exception on disk. Get the error storage directory, or creates it if it does not exist. </summary> <returns>The error storage directory.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.InstanceSaveErrorLogFiles(System.Exception,Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog)"> <summary> Saves an error log on disk. </summary> <param name="exception">The exception that caused the crash.</param> <param name="errorLog">The error log.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.ObfuscateUserName(System.String)"> <summary> Remove the user's name from a crash's process path. </summary> <param name="errorString">A string containing the username.</param> <returns>An anonymized string where the real username is replaced by "USER".</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Utils.ErrorLogHelper.GetStoredFile(System.Guid,System.String)"> <summary> Gets a file from storage with the given ID and extension. </summary> <param name="errorId">The error ID.</param> <param name="extension">The file extension.</param> <returns>The file corresponding to the given parameters, or null if not found.</returns> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.ProcessInformation.ProcessArchitecture"> <remarks> ARM64 was added to ProcessorArchitecture enum (that can be received by Package.Current.Id.Architecture call) only in SDK version 18362, so casting to string is incorrect on lower versions. </remarks> </member> <member name="T:Microsoft.AppCenter.Crashes.Utils.IProcessInformation"> <summary> Utility to get information about the current process. Has different implementations on different platforms. Some information will be unavailable on certain platforms. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.IProcessInformation.ProcessStartTime"> <summary> Gets the start time of the current process. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.IProcessInformation.ProcessId"> <summary> Gets the ID of the current process. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.IProcessInformation.ProcessName"> <summary> Gets the name of the current process. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.IProcessInformation.ParentProcessId"> <summary> Gets the ID of the parent process. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.IProcessInformation.ParentProcessName"> <summary> Gets the name of the parent process. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Utils.IProcessInformation.ProcessArchitecture"> <summary> Gets the CPU architecture that the current process is running on. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.AndroidErrorDetails"> <summary> Error report details pertinent only to devices running Android. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.AndroidErrorDetails.Throwable"> <summary> Gets the throwable associated with the Java crash. </summary> <value>The throwable associated with the crash. <c>null</c> if the crash occured in .NET code.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.AndroidErrorDetails.StackTrace"> <summary> Gets the stack trace associated with the Java crash. </summary> <value>The stack trace associated with the crash. <c>null</c> if the crash occured in .NET code.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.AndroidErrorDetails.ThreadName"> <summary> Gets the name of the thread that crashed. </summary> <value>The name of the thread that crashed.</value> </member> <member name="T:Microsoft.AppCenter.Crashes.AppleErrorDetails"> <summary> Error report details pertinent only to Apple devices. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.AppleErrorDetails.ReporterKey"> <summary> Gets the reporter key. </summary> <value>UUID for the app installation on the device.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.AppleErrorDetails.Signal"> <summary> Gets the signal that caused the crash. </summary> <value>The signal that caused the crash.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.AppleErrorDetails.ExceptionName"> <summary> Gets the name of the exception that triggered the crash, <c>null</c> if the crash was not triggered by an exception. </summary> <value>The name of the exception that triggered the crash.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.AppleErrorDetails.ExceptionReason"> <summary> Gets the reason for the exception that triggered the crash, <c>null</c> if the crash was not triggered by an exception. </summary> <value>The reason for the exception causing the crash.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.AppleErrorDetails.AppProcessIdentifier"> <summary> Gets the identifier of the app process that crashed. </summary> <value>The app process identifier.</value> </member> <member name="T:Microsoft.AppCenter.Crashes.Crashes"> <summary> Crashes service. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Crashes.LogTag"> <summary> Log tag used by the Crashes service. </summary> </member> <member name="E:Microsoft.AppCenter.Crashes.Crashes.CreatingErrorReport"> <summary> Occurs when an error report is about to be created. </summary> </member> <member name="E:Microsoft.AppCenter.Crashes.Crashes.SendingErrorReport"> <summary> Occurs when an error report is about to be sent. </summary> </member> <member name="E:Microsoft.AppCenter.Crashes.Crashes.SentErrorReport"> <summary> Occurs when an error report has been successfully sent. </summary> </member> <member name="E:Microsoft.AppCenter.Crashes.Crashes.FailedToSendErrorReport"> <summary> Occurs when an error report has failed to be sent. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Crashes.ShouldProcessErrorReport"> <summary> Set this callback to add custom behavior for determining whether an error report should be processed. Returning false prevents the crash from being reported to the server. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Crashes.ShouldAwaitUserConfirmation"> <summary> Set this callback to add custom behavior for determining whether user confirmation is required to send error reports. </summary> <seealso cref="T:Microsoft.AppCenter.Crashes.ShouldAwaitUserConfirmationCallback"/> </member> <member name="F:Microsoft.AppCenter.Crashes.Crashes.GetErrorAttachments"> <summary> Set this callback to attach custom text and/or binaries to an error report. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.NotifyUserConfirmation(Microsoft.AppCenter.Crashes.UserConfirmation)"> <summary> Notifies SDK with a confirmation to handle the crash report. </summary> <param name="confirmation">A user confirmation. See <see cref="T:Microsoft.AppCenter.Crashes.UserConfirmation"/>.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.IsEnabledAsync"> <summary> Check whether the Crashes service is enabled or not. </summary> <returns>A task with result being true if enabled, false if disabled.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.SetEnabledAsync(System.Boolean)"> <summary> Enable or disable the Crashes service. </summary> <returns>A task to monitor the operation.</returns> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.HasCrashedInLastSessionAsync"> <summary> Provides information whether the app crashed in its last session. </summary> <value> Task with result being <c>true</c> if a crash was recorded in the last session, otherwise <c>false</c>. </value> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.GetLastSessionCrashReportAsync"> <summary> Gets the crash report generated in the last session if there was a crash. </summary> <value>Crash report from the last session, <c>null</c> if there was no crash in the last session.</value> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.HasReceivedMemoryWarningInLastSessionAsync"> <summary> Provides information whether the app received memory warning in its last session. </summary> <value> Task with result being <c>true</c> if a memory warning was recorded in the last session, otherwise <c>false</c> </value> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.GenerateTestCrash"> <summary> Generates crash for testing purposes. </summary> <remarks> This call has no effect in non debug configuration (such as release). </remarks> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.TrackError(System.Exception,System.Collections.Generic.IDictionary{System.String,System.String},Microsoft.AppCenter.Crashes.ErrorAttachmentLog[])"> <summary> Track a handled error. </summary> <param name="exception">The .NET exception describing the handled error.</param> <param name="properties">Optional properties.</param> <param name="attachments">Optional attachments.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.TrackCrash(System.Exception)"> <summary> Track an unhandled error. </summary> <param name="exception">The .NET exception describing the handled error.</param> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.Instance"> <summary> Unique instance. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Crashes._unprocessedManagedErrorLogs"> <summary> A dictionary that contains unprocessed managed error logs before getting a user confirmation. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.Crashes._errorReportCache"> <summary> A dictionary for a cache that contains error report. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.ChannelName"> <inheritdoc /> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.TriggerCount"> <inheritdoc /> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.TriggerInterval"> <inheritdoc /> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.ServiceName"> <inheritdoc /> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.ProcessPendingErrorsTask"> <summary> A task of processing pending error log files. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Crashes.OnChannelGroupReady(Microsoft.AppCenter.Channel.IChannelGroup,System.String)"> <summary> Method that is called to signal start of Crashes service. </summary> <param name="channelGroup">Channel group</param> <param name="appSecret">App secret</param> </member> <member name="P:Microsoft.AppCenter.Crashes.Crashes.InstanceEnabled"> <inheritdoc /> </member> <member name="T:Microsoft.AppCenter.Crashes.CreatingErrorReportEventHandler"> <summary> Handler type for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.CreatingErrorReport"/>. </summary> <param name="sender">This parameter will be <c>null</c> when being sent from the <see cref="T:Microsoft.AppCenter.Crashes.Crashes"/> class and should be ignored. </param> <param name="e">Event arguments. See <see cref="T:Microsoft.AppCenter.Crashes.CreatingErrorReportEventArgs"/> for more details.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.ShouldProcessErrorReportCallback"> <summary> Callback type for determining whether a particular error report should be processed. </summary> <returns><c>true</c> if <c>report</c> should be processed.</returns> <param name="report">The error report that is being considered for processing.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.GetErrorAttachmentsCallback"> <summary> Callback type for getting error attachments for a particular error report. </summary> <returns>The error attachments to be associated with <c>report</c>.</returns> <param name="report">The error report for which error attachments are to be returned.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.ShouldAwaitUserConfirmationCallback"> <summary> Determine whether user confirmation is required to process a report. <see cref="M:Microsoft.AppCenter.Crashes.Crashes.NotifyUserConfirmation(Microsoft.AppCenter.Crashes.UserConfirmation)"/> must be called by yourself./> </summary> <returns><c>true</c> if sending reports should be confirmed by a user.</returns> </member> <member name="T:Microsoft.AppCenter.Crashes.SendingErrorReportEventHandler"> <summary> Handler type for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.SendingErrorReport"/>. </summary> <param name="sender">This parameter will be <c>null</c> when being sent from the <see cref="T:Microsoft.AppCenter.Crashes.Crashes"/> class and should be ignored. </param> <param name="e">Event arguments. See <see cref="T:Microsoft.AppCenter.Crashes.SendingErrorReportEventArgs"/> for more details.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.SentErrorReportEventHandler"> <summary> Handler type for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.SentErrorReport"/>. </summary> <param name="sender">This parameter will be <c>null</c> when being sent from the <see cref="T:Microsoft.AppCenter.Crashes.Crashes"/> class and should be ignored. </param> <param name="e">Event arguments. See <see cref="T:Microsoft.AppCenter.Crashes.SentErrorReportEventArgs"/> for more details.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.FailedToSendErrorReportEventHandler"> <summary> Handler type for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.FailedToSendErrorReport"/>. </summary> <param name="sender">This parameter will be <c>null</c> when being sent from the <see cref="T:Microsoft.AppCenter.Crashes.Crashes"/> class and should be ignored. </param> <param name="e">Event arguments. See <see cref="T:Microsoft.AppCenter.Crashes.FailedToSendErrorReportEventArgs"/> for more details.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.ErrorAttachmentLog"> <summary> Error attachment for error report. </summary> <summary> Error attachment log. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.AttachmentWithText(System.String,System.String)"> <summary> Builds an attachment with text suitable for using in <see cref="F:Microsoft.AppCenter.Crashes.Crashes.GetErrorAttachments"/>. </summary> <returns>Error attachment or <c>null</c> if null text is passed.</returns> <param name="text">Text to attach to the error report.</param> <param name="fileName">File name to use on reports.</param> </member> <member name="M:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.AttachmentWithBinary(System.Byte[],System.String,System.String)"> <summary> Builds an attachment with binary suitable for using in <see cref="F:Microsoft.AppCenter.Crashes.Crashes.GetErrorAttachments"/>. </summary> <returns>Error attachment or <c>null</c> if null data is passed.</returns> <param name="data">Binary data.</param> <param name="fileName">File name to use on reports.</param> <param name="contentType">Data MIME type.</param> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.Id"> <summary> Gets or sets error attachment identifier. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.ErrorId"> <summary> Gets or sets error log identifier to attach this log to. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.ContentType"> <summary> Gets or sets content type (text/plain for text). </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.FileName"> <summary> Gets or sets file name. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.Data"> <summary> Gets or sets data encoded as base 64. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.Validate"> <summary> Validate the object. </summary> <exception cref="T:Microsoft.AppCenter.Ingestion.Models.ValidationException"> Thrown if validation fails </exception> </member> <member name="M:Microsoft.AppCenter.Crashes.ErrorAttachmentLog.ValidatePropertiesForAttachment"> <summary> Check all required fields are present. </summary> <returns>True if all required fields are present.</returns> </member> <member name="T:Microsoft.AppCenter.Crashes.ErrorReport"> <summary> Error report containing information about a particular crash. </summary> <summary> Error report containing information about a particular crash. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.Id"> <summary> Gets the report identifier. </summary> <value>UUID for the report.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.AppStartTime"> <summary> Gets the app start time. </summary> <value>Date and time the app started</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.AppErrorTime"> <summary> Gets the app error time. </summary> <value>Date and time the error occured</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.Device"> <summary> Gets the device that the crashed app was being run on. </summary> <value>Device information at the crash time.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.Exception"> <summary> Gets the C# Exception object that caused the crash. </summary> <value>The exception.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.StackTrace"> <summary> Gets the C# exception stack trace captured at crash time. </summary> <value>The exception.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.AndroidDetails"> <summary> Gets details specific to Android. </summary> <value>Android error report details. <c>null</c> if the OS is not Android.</value> </member> <member name="P:Microsoft.AppCenter.Crashes.ErrorReport.AppleDetails"> <summary> Gets details specific to Apple devices. </summary> <value>Apple error report details. <c>null</c> if the OS is not iOS/macOS.</value> </member> <member name="M:Microsoft.AppCenter.Crashes.ErrorReport.#ctor(Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog,System.String)"> <summary> Creates a new error report. </summary> <param name="log">The managed error log.</param> <param name="stackTrace">The associated exception stack trace.</param> </member> <member name="T:Microsoft.AppCenter.Crashes.ErrorReportEventArgs"> <summary> Event arguments base class for all events that involve an error report. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.ErrorReportEventArgs.Report"> <summary> The error report associated with the event. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.CreatingErrorReportEventArgs"> <summary> Event arguments class for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.CreatingErrorReport"/>. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.CreatingErrorReportEventArgs.ReportId"> <summary> The id of the report that is being created. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.CreatingErrorReportEventArgs.Exception"> <summary> The exception associated with the report. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.SendingErrorReportEventArgs"> <summary> Event arguments class for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.SendingErrorReport"/>. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.SentErrorReportEventArgs"> <summary> Event arguments class for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.SentErrorReport"/>. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.FailedToSendErrorReportEventArgs"> <summary> Event arguments class for event <see cref="E:Microsoft.AppCenter.Crashes.Crashes.FailedToSendErrorReport"/>. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.FailedToSendErrorReportEventArgs.Exception"> <summary> The native exception associated with the failure. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.NamespaceDoc"> <summary> Crashes SDK module. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.TestCrashException"> <summary> Exception type thrown for testing purposes. See <see cref="M:Microsoft.AppCenter.Crashes.Crashes.GenerateTestCrash"/>. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.TestCrashException.#ctor"> <summary> Initializes a new instance of the TestCrashException class with a predefined error message. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.UserConfirmation"> <summary> User confirmation options for whether to send crash reports. </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.UserConfirmation.DontSend"> <summary> Do not send the crash report </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.UserConfirmation.Send"> <summary> Send the crash report </summary> </member> <member name="F:Microsoft.AppCenter.Crashes.UserConfirmation.AlwaysSend"> <summary> Send all crash reports </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog"> <summary> Abstract error log. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.#ctor"> <summary> Initializes a new instance of the AbstractErrorLog class. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.#ctor(Microsoft.AppCenter.Ingestion.Models.Device,System.Guid,System.Int32,System.String,System.Boolean,System.Nullable{System.DateTime},System.Nullable{System.Guid},System.String,System.String,System.Nullable{System.Int32},System.String,System.Nullable{System.Int64},System.String,System.Nullable{System.DateTime},System.String)"> <summary> Initializes a new instance of the AbstractErrorLog class. </summary> <param name="id">Error identifier.</param> <param name="processId">Process identifier.</param> <param name="processName">Process name.</param> <param name="fatal">If true, this error report is an application crash. Corresponds to the number of milliseconds elapsed between the time the error occurred and the app was launched.</param> <param name="timestamp">Log timestamp, example: '2017-03-13T18:05:42Z'. </param> <param name="sid">When tracking an analytics session, logs can be part of the session by specifying this identifier. This attribute is optional, a missing value means the session tracking is disabled (like when using only error reporting feature). Concrete types like StartSessionLog or PageLog are always part of a session and always include this identifier. </param> <param name="userId">optional string used for associating logs with users. </param> <param name="dataResidencyRegion">The data residency region code.</param> <param name="parentProcessId">Parent's process identifier.</param> <param name="parentProcessName">Parent's process name.</param> <param name="errorThreadId">Error thread identifier.</param> <param name="errorThreadName">Error thread name.</param> <param name="appLaunchTimestamp">Timestamp when the app was launched, example: '2017-03-13T18:05:42Z'. </param> <param name="architecture">CPU architecture.</param> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.Id"> <summary> Gets or sets error identifier. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.ProcessId"> <summary> Gets or sets process identifier. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.ProcessName"> <summary> Gets or sets process name. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.ParentProcessId"> <summary> Gets or sets parent's process identifier. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.ParentProcessName"> <summary> Gets or sets parent's process name. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.ErrorThreadId"> <summary> Gets or sets error thread identifier. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.ErrorThreadName"> <summary> Gets or sets error thread name. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.Fatal"> <summary> Gets or sets if true, this error report is an application crash. Corresponds to the number of milliseconds elapsed between the time the error occurred and the app was launched. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.AppLaunchTimestamp"> <summary> Gets or sets timestamp when the app was launched, example: '2017-03-13T18:05:42Z'. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.Architecture"> <summary> Gets or sets CPU architecture. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.AbstractErrorLog.Validate"> <summary> Validate the object. </summary> <exception cref="T:Microsoft.AppCenter.Ingestion.Models.ValidationException"> Thrown if validation fails </exception> </member> <member name="T:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary"> <summary> Binary (library) definition for any platform. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.#ctor"> <summary> Initializes a new instance of the Binary class. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.#ctor(System.String,System.String,System.String,System.String,System.String,System.String,System.Nullable{System.Int64},System.Nullable{System.Int64})"> <summary> Initializes a new instance of the Binary class. </summary> <param name="primaryArchitectureId">CPU primary architecture.</param> <param name="architectureVariantId">CPU architecture variant.</param> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.Id"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.StartAddress"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.EndAddress"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.Name"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.Path"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.Architecture"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.PrimaryArchitectureId"> <summary> Gets or sets CPU primary architecture. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.ArchitectureVariantId"> <summary> Gets or sets CPU architecture variant. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.Binary.Validate"> <summary> Validate the object. </summary> <exception cref="T:Microsoft.AppCenter.Ingestion.Models.ValidationException"> Thrown if validation fails </exception> </member> <member name="T:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception"> <summary> Exception definition for any platform. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.#ctor"> <summary> Initializes a new instance of the Exception class. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.#ctor(System.String,System.String,System.String,System.Collections.Generic.IList{Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame},System.Collections.Generic.IList{Microsoft.AppCenter.Crashes.Ingestion.Models.Exception},System.String)"> <summary> Initializes a new instance of the Exception class. </summary> <param name="type">Exception type.</param> <param name="message">Exception reason.</param> <param name="stackTrace">Raw stack trace. Sent when the frames property is either missing or unreliable.</param> <param name="frames">Stack frames. Optional.</param> <param name="innerExceptions">Inner exceptions of this exception.</param> <param name="wrapperSdkName">Name of the wrapper SDK that emitted this exeption. Consists of the name of the SDK and the wrapper platform, e.g. "appcenter.xamarin", "hockeysdk.cordova". </param> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.Type"> <summary> Gets or sets exception type. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.Message"> <summary> Gets or sets exception reason. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.StackTrace"> <summary> Gets or sets raw stack trace. Sent when the frames property is either missing or unreliable. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.Frames"> <summary> Gets or sets stack frames. Optional. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.InnerExceptions"> <summary> Gets or sets inner exceptions of this exception. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.WrapperSdkName"> <summary> Gets or sets name of the wrapper SDK that emitted this exeption. Consists of the name of the SDK and the wrapper platform, e.g. "appcenter.xamarin", "hockeysdk.cordova". </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.Exception.Validate"> <summary> Validate the object. </summary> <exception cref="T:Microsoft.AppCenter.Ingestion.Models.ValidationException"> Thrown if validation fails </exception> </member> <member name="T:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog"> <summary> Handled Error log for managed platforms (such as Xamarin, Unity, Android Dalvik/ART) </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog.#ctor"> <summary> Initializes a new instance of the HandledErrorLog class. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog.#ctor(Microsoft.AppCenter.Ingestion.Models.Device,Microsoft.AppCenter.Crashes.Ingestion.Models.Exception,System.Nullable{System.DateTime},System.Nullable{System.Guid},System.String,System.String,System.Collections.Generic.IDictionary{System.String,System.String},System.Nullable{System.Guid},System.Collections.Generic.IList{Microsoft.AppCenter.Crashes.Ingestion.Models.Binary})"> <summary> Initializes a new instance of the HandledErrorLog class. </summary> <param name="timestamp">Log timestamp, example: '2017-03-13T18:05:42Z'. </param> <param name="sid">When tracking an analytics session, logs can be part of the session by specifying this identifier. This attribute is optional, a missing value means the session tracking is disabled (like when using only error reporting feature). Concrete types like StartSessionLog or PageLog are always part of a session and always include this identifier. </param> <param name="userId">optional string used for associating logs with users. </param> <param name="dataResidencyRegion">The data residency region code.</param> <param name="properties">Additional key/value pair parameters. </param> <param name="id">Unique identifier for this Error. </param> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog.Id"> <summary> Gets or sets unique identifier for this Error. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog.Binaries"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog.Exception"> <summary> </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.HandledErrorLog.Validate"> <summary> Validate the object. </summary> <exception cref="T:Microsoft.AppCenter.Ingestion.Models.ValidationException"> Thrown if validation fails </exception> </member> <member name="T:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog"> <summary> Error log for managed platforms (such as Android Dalvik/ART). </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog.#ctor"> <summary> Initializes a new instance of the ManagedErrorLog class. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog.#ctor(Microsoft.AppCenter.Ingestion.Models.Device,System.Guid,System.Int32,System.String,System.Boolean,Microsoft.AppCenter.Crashes.Ingestion.Models.Exception,System.Nullable{System.DateTime},System.Nullable{System.Guid},System.String,System.String,System.Nullable{System.Int32},System.String,System.Nullable{System.Int64},System.String,System.Nullable{System.DateTime},System.String,System.Collections.Generic.IList{Microsoft.AppCenter.Crashes.Ingestion.Models.Binary},System.String)"> <summary> Initializes a new instance of the ManagedErrorLog class. </summary> <param name="id">Error identifier.</param> <param name="processId">Process identifier.</param> <param name="processName">Process name.</param> <param name="fatal">If true, this error report is an application crash. Corresponds to the number of milliseconds elapsed between the time the error occurred and the app was launched.</param> <param name="timestamp">Log timestamp, example: '2017-03-13T18:05:42Z'. </param> <param name="sid">When tracking an analytics session, logs can be part of the session by specifying this identifier. This attribute is optional, a missing value means the session tracking is disabled (like when using only error reporting feature). Concrete types like StartSessionLog or PageLog are always part of a session and always include this identifier. </param> <param name="userId">optional string used for associating logs with users. </param> <param name="dataResidencyRegion">The data residency region code.</param> <param name="parentProcessId">Parent's process identifier.</param> <param name="parentProcessName">Parent's process name.</param> <param name="errorThreadId">Error thread identifier.</param> <param name="errorThreadName">Error thread name.</param> <param name="appLaunchTimestamp">Timestamp when the app was launched, example: '2017-03-13T18:05:42Z'. </param> <param name="architecture">CPU architecture.</param> <param name="buildId">Unique ID for a Xamarin build or another similar technology.</param> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog.Binaries"> <summary> </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog.BuildId"> <summary> Gets or sets unique ID for a Xamarin build or another similar technology. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog.Exception"> <summary> </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.ManagedErrorLog.Validate"> <summary> Validate the object. </summary> <exception cref="T:Microsoft.AppCenter.Ingestion.Models.ValidationException"> Thrown if validation fails </exception> </member> <member name="T:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame"> <summary> Stack frame definition for any platform. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.#ctor"> <summary> Initializes a new instance of the StackFrame class. </summary> </member> <member name="M:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.#ctor(System.String,System.String,System.String,System.String,System.Nullable{System.Int32},System.String)"> <summary> Initializes a new instance of the StackFrame class. </summary> <param name="address">Frame address.</param> <param name="code">Symbolized code line</param> <param name="className">The fully qualified name of the Class containing the execution point represented by this stack trace element.</param> <param name="methodName">The name of the method containing the execution point represented by this stack trace element.</param> <param name="lineNumber">The line number of the source line containing the execution point represented by this stack trace element.</param> <param name="fileName">The name of the file containing the execution point represented by this stack trace element.</param> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.Address"> <summary> Gets or sets frame address. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.Code"> <summary> Gets or sets symbolized code line </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.ClassName"> <summary> Gets or sets the fully qualified name of the Class containing the execution point represented by this stack trace element. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.MethodName"> <summary> Gets or sets the name of the method containing the execution point represented by this stack trace element. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.LineNumber"> <summary> Gets or sets the line number of the source line containing the execution point represented by this stack trace element. </summary> </member> <member name="P:Microsoft.AppCenter.Crashes.Ingestion.Models.StackFrame.FileName"> <summary> Gets or sets the name of the file containing the execution point represented by this stack trace element. </summary> </member> <member name="T:Microsoft.AppCenter.Crashes.Windows.Utils.ErrorExceptionAndBinaries"> <summary> This class is a data-only holder for the model exception and binary sent with error logs. A simple pair cannot be used because value tuples require an additional dependency in UWP. </summary> </member> </members> </doc> ```
/content/code_sandbox/Libraries/AppCenter/Microsoft.AppCenter.Crashes.xml
xml
2016-05-23T09:03:33
2024-08-16T16:17:48
Unigram
UnigramDev/Unigram
3,744
11,327
```xml import * as Viewer from '../viewer.js'; import * as UI from '../ui.js'; import * as NARC from '../nns_g3d/narc.js'; import * as BYML from '../byml.js'; import * as LZ77 from './lz77.js'; import * as BMD from './sm64ds_bmd.js'; import * as BCA from './sm64ds_bca.js'; import { GfxDevice, GfxBindingLayoutDescriptor } from '../gfx/platform/GfxPlatform.js'; import ArrayBufferSlice from '../ArrayBufferSlice.js'; import { BMDData, Sm64DSCRG1, BMDModelInstance, CRG1Level, CRG1Object, NITRO_Program, CRG1StandardObject, CRG1DoorObject } from './render.js'; import { makeBackbufferDescSimple, opaqueBlackFullClearRenderPassDescriptor } from '../gfx/helpers/RenderGraphHelpers.js'; import { vec3, mat4, mat2d } from 'gl-matrix'; import { assertExists, assert, leftPad } from '../util.js'; import AnimationController from '../AnimationController.js'; import { GfxRenderInstList, GfxRenderInstManager } from '../gfx/render/GfxRenderInstManager.js'; import { fillMatrix4x4 } from '../gfx/helpers/UniformBufferHelpers.js'; import { SceneContext } from '../SceneBase.js'; import { DataFetcher } from '../DataFetcher.js'; import { MathConstants, clamp, scaleMatrix } from '../MathHelpers.js'; import { GfxRenderCache } from '../gfx/render/GfxRenderCache.js'; import { GfxrAttachmentSlot } from '../gfx/render/GfxRenderGraph.js'; import { GfxRenderHelper } from '../gfx/render/GfxRenderHelper.js'; // path_to_url enum ObjectId { PLAYER = 0x00, EWB_ICE_A = 0x01, EWB_ICE_B = 0x02, EWB_ICE_C = 0x03, EWM_ICE_BLOCK = 0x04, EMM_LOG = 0x05, EMM_YUKA = 0x06, UPDOWN_LIFT = 0x07, HS_UPDOWN_LIFT = 0x08, PATH_LIFT = 0x09, WANWAN = 0x0a, CAMERA_TAG = 0x0b, SEESAW = 0x0c, IRONBALL = 0x0d, GORO_ROCK = 0x0e, KURIBO = 0x0f, KURIBO_S = 0x10, KURIBO_L = 0x11, KURIKING = 0x12, BOMBHEI = 0x13, RED_BOMBHEI = 0x14, NOKONOKO = 0x15, NOKONOKO_S = 0x16, BLOCK_L = 0x17, DP_BLOCK_L = 0x18, SW_BLOCK_L = 0x19, POWER_UP_ITEM = 0x1a, HATENA_SWITCH = 0x1b, BLOCK_S = 0x1c, CANNON_SHUTTER = 0x1d, HATENA_BLOCK = 0x1e, ITEM_BLOCK = 0x1f, VS_ITEM_BLOCK = 0x20, CAP_BLOCK_M = 0x21, CAP_BLOCK_W = 0x22, CAP_BLOCK_L = 0x23, PILE = 0x24, COIN = 0x25, RED_COIN = 0x26, BLUE_COIN = 0x27, KOOPA = 0x28, TREE = 0x29, PICTURE_GATE = 0x2a, HANSWITCH = 0x2b, STAR_SWITCH = 0x2c, SWITCHDOOR = 0x2d, CV_SHUTTER = 0x2e, CV_NEWS_LIFT = 0x2f, WANWAN2 = 0x30, ONEUPKINOKO = 0x31, CANNON = 0x32, WANWAN_SHUTTER = 0x33, WATERBOMB = 0x34, SBIRD = 0x35, FISH = 0x36, BUTTERFLY = 0x37, BOMBKING = 0x38, SNOWMAN = 0x39, PIANO = 0x3a, PAKUN = 0x3b, STAR_CAMERA = 0x3c, STAR = 0x3d, SILVER_STAR = 0x3e, STARBASE = 0x3f, BATAN = 0x40, BATANKING = 0x41, DOSUN = 0x42, TERESA = 0x43, BOSS_TERESA = 0x44, ICON_TERESA = 0x45, KAIDAN = 0x46, BOOKSHELF = 0x47, MERRYGOROUND = 0x48, TERESAPIT = 0x49, PL_CLOSET = 0x4a, KANBAN = 0x4b, TATEFUDA = 0x4c, ICE_BOARD = 0x4d, WAKAME = 0x4e, HEART = 0x4f, KINOPIO = 0x50, PEACH_PRINCESS = 0x51, KOOPA2BG = 0x52, KOOPA3BG = 0x53, SHELL = 0x54, SHARK = 0x55, CT_MECHA01 = 0x56, CT_MECHA02 = 0x57, CT_MECHA03 = 0x58, CT_MECHA04L = 0x59, CT_MECHA04S = 0x5a, CT_MECHA05 = 0x5b, CT_MECHA06 = 0x5c, CT_MECHA07 = 0x5d, CT_MECHA08A = 0x5e, CT_MECHA08B = 0x5f, CT_MECHA09 = 0x60, CT_MECHA10 = 0x61, CT_MECHA11 = 0x62, CT_MECHA12L = 0x63, CT_MECHA12S = 0x64, DP_BROCK = 0x65, DP_LIFT = 0x66, DL_PYRAMID = 0x67, DL_PYRAMID_DUMMY = 0x68, WL_POLELIFT = 0x69, WL_SUBMARINE = 0x6a, WL_KOOPA_SHUTTER = 0x6b, RC_DORIFU = 0x6c, RC_RIFT01 = 0x6d, RC_HANE = 0x6e, RC_TIKUWA = 0x6f, RC_BURANKO = 0x70, RC_SEESAW = 0x71, RC_KAITEN = 0x72, RC_GURUGURU = 0x73, SL_ICEBLOCK = 0x74, HM_MARUTA = 0x75, TT_FUTA = 0x76, TT_WATER = 0x77, TD_FUTA = 0x78, TD_WATER = 0x79, WC_UKISIMA = 0x7a, WC_OBJ01 = 0x7b, WC_OBJ02 = 0x7c, WC_OBJ03 = 0x7d, WC_OBJ04 = 0x7e, WC_OBJ05 = 0x7f, WC_OBJ06 = 0x80, WC_MIZU = 0x81, FL_MARUTA = 0x82, FL_RING = 0x83, FL_GURA = 0x84, FL_LONDON = 0x85, FL_BLOCK = 0x86, FL_UKIYUKA = 0x87, FL_UKIYUKA_L = 0x88, FL_SEESAW = 0x89, FL_KOMA_D = 0x8a, FL_KOMA_U = 0x8b, FL_UKI_KI = 0x8c, FL_KUZURE = 0x8d, FM_BATTAN = 0x8e, LAVA = 0x8f, WATERFALL = 0x90, MANTA = 0x91, SPIDER = 0x92, TOGEZO = 0x93, JUGEM = 0x94, GAMAGUCHI = 0x95, EYEKUN = 0x96, EYEKUN_BOSS = 0x97, BATTA_BLOCK = 0x98, BIRIKYU = 0x99, HM_BASKET = 0x9a, MONKEY_THIEF = 0x9b, MONKEY_STAR = 0x9c, PENGUIN_BABY = 0x9d, PENGUIN_MOTHER = 0x9e, PENGUIN_DEFENDER = 0x9f, PENGUIN_RACER = 0xa0, KERONPA = 0xa1, BIG_SNOWMAN = 0xa2, BIG_SNOWMAN_HEAD = 0xa3, BIG_SNOWMAN_BODY = 0xa4, SNOWMAN_BREATH = 0xa5, PUKUPUKU = 0xa6, CLOCK_SHORT = 0xa7, CLOCK_LONG = 0xa8, CLOCK_HURIKO = 0xa9, MENBO = 0xaa, CASKET = 0xab, HYUHYU = 0xac, BOMB_SEESAW = 0xad, KM1_SEESAW = 0xae, KM1_DORIFU = 0xaf, KM1_UKISHIMA = 0xb0, KM1_KURUMAJIKU = 0xb1, KM1_DERU = 0xb2, KI_FUNE = 0xb3, KI_FUNE_UP = 0xb4, KI_HASIRA = 0xb5, KI_HASIRA_DAI = 0xb6, KI_ITA = 0xb7, KI_IWA = 0xb8, KS_MIZU = 0xb9, DOKAN = 0xba, YAJIRUSI_L = 0xbb, YAJIRUSI_R = 0xbc, PROPELLER_HEYHO = 0xbd, KILLER = 0xbe, KB1_BILLBOARD = 0xbf, HS_MOON = 0xc0, HS_STAR = 0xc1, HS_Y_STAR = 0xc2, HS_B_STAR = 0xc3, BK_BILLBOARD = 0xc4, BK_KILLER_DAI = 0xc5, BK_BOTAOSI = 0xc6, BK_DOWN_B = 0xc7, BK_FUTA = 0xc8, BK_KABE01 = 0xc9, BK_KABE00 = 0xca, BK_TOWER = 0xcb, BK_UKISIMA = 0xcc, BK_ROTEBAR = 0xcd, BK_LIFT01 = 0xce, BK_DOSSUNBAR_S = 0xcf, BK_DOSSUNBAR_L = 0xd0, BK_TRANSBAR = 0xd1, TH_DOWN_B = 0xd2, KM2_KUZURE = 0xd3, KM2_AGARU = 0xd4, KM2_GURA = 0xd5, KM2_AMI_BOU = 0xd6, KM2_YOKOSEESAW = 0xd7, KM2_SUSUMU = 0xd8, KM2_UKISHIMA = 0xd9, KM2_RIFUT02 = 0xda, KM2_RIFUT01 = 0xdb, KM2_NOBIRU = 0xdc, KM3_SEESAW = 0xdd, KM3_YOKOSEESAW = 0xde, KM3_KURUMAJIKU = 0xdf, KM3_DORIFU = 0xe0, KM3_DERU01 = 0xe1, KM3_DERU02 = 0xe2, KM3_KAITENDAI = 0xe3, C0_SWITCH = 0xe4, SM_LIFT = 0xe5, PROPELLER_HEYHO_FIRE = 0xe6, UDLIFT_TERESA = 0xe7, UDLIFT = 0xe8, RC_RIFT02 = 0xe9, BAKUBAKU = 0xea, KM3_LIFT = 0xeb, KIRAI = 0xec, MIP = 0xed, OBJ_MIP_KEY = 0xee, OWL = 0xef, DONKETU = 0xf0, BOSS_DONKETU = 0xf1, ONIMASU = 0xf2, BAR = 0xf3, C_JUGEM = 0xf4, PUSHBLOCK = 0xf5, FL_AMILIFT = 0xf6, YUREI_MUCHO = 0xf7, CHOROPU = 0xf8, CHORO_ROCK = 0xf9, BASABASA = 0xfa, POPOI = 0xfb, JANGO = 0xfc, SANBO = 0xfd, OBJ_MARIO_CAP = 0xfe, FL_PUZZLE = 0xff, FL_COIN = 0x100, DOSSY = 0x101, DOSSY_CAP = 0x102, HUWAHUWA = 0x103, SLIDE_BOX = 0x104, MORAY = 0x105, OBJ_KUMO = 0x106, OBJ_SHELL = 0x107, OBJ_RED_FIRE = 0x108, OBJ_BLUE_FIRE = 0x109, OBJ_FLAMETHROWER = 0x10a, KINOKO_CREATE_TAG = 0x10b, KINOKO_TAG = 0x10c, BLK_OKINOKO_TAG = 0x10d, BLK_SKINOKO_TAG = 0x10e, BLK_GNSHELL_TAG = 0x10f, BLK_SLVSTAR_TAG = 0x110, C1_TRAP = 0x111, C1_HIKARI = 0x112, C1_PEACH = 0x113, RC_CARPET = 0x114, OBJ_KEY = 0x115, LAST_STAR = 0x116, IWANTE = 0x117, HANACHAN = 0x118, RACE_NOKO = 0x119, RACE_FLAG = 0x11a, T_BASKET = 0x11b, BLOCK_LL = 0x11c, ICE_BLOCK_LL = 0x11d, SHOOT_BOOK = 0x11e, KILLER_BOOK = 0x11f, BOOK_GENERATOR = 0x120, BOOK_SWITCH = 0x121, ICE_DONKETU = 0x122, KING_DONKETU = 0x123, TREASURE_BOX = 0x124, MC_WATER = 0x125, CHAIR = 0x126, MC_METALNET = 0x127, MC_DODAI = 0x128, MC_HAZAD = 0x129, MC_FLAG = 0x12a, DONKAKU = 0x12b, DONGURU = 0x12c, HOLHEI = 0x12d, SCALEUP_KINOKO = 0x12e, C0_WATER = 0x12f, SECRET_COIN = 0x130, BC_SWITCH = 0x131, OBJ_NUMBER = 0x132, BUBBLE = 0x133, STAR_CREATE = 0x134, SLIDER_MANAGER = 0x135, OBJ_VOLCANO_CANNON = 0x136, WATER_RING = 0x137, FIREPAKUN = 0x138, FIREPAKUN_S = 0x139, PAKUN2 = 0x13a, ENEMY_SWITCH = 0x13b, ENEMY_CREATE = 0x13c, WATER_HAKIDASI = 0x13d, WATER_TATUMAKI = 0x13e, WATER_SUIKOMI = 0x13f, TORNADO = 0x140, FIRERING = 0x141, LUIGI = 0x142, SET_SE = 0x143, MUGEN_BGM = 0x144, SOUND_OBJ = 0x145, // Unofficial names TRG_MINIMAP_CHANGE = 0x1ff, } const enum DoorType { PLANE = 0x00, DOOR_NORMAL = 0x01, DOOR_STAR = 0x02, DOOR_STAR_1_0 = 0x03, DOOR_STAR_3_0 = 0x04, DOOR_STAR_10 = 0x05, DOOR_KEYHOLE_0 = 0x06, DOOR_KEYHOLE_1 = 0x07, STAR_GATE_0 = 0x09, STAR_GATE_1 = 0x0A, STAR_GATE_2 = 0x0B, STAR_GATE_3 = 0x0C, DOOR_STAR_1_1 = 0x0D, DOOR_STAR_3_1 = 0x0E, DOOR_2_BORO = 0x0F, DOOR_3_TETSU = 0x10, DOOR_4_YAMI = 0x11, DOOR_5_HORROR = 0x12, DOOR_KEYHOLE_2 = 0x13, DOOR_KEYHOLE_3 = 0x14, DOOR_KEYHOLE_4 = 0x15, DOOR_KEYHOLE_5 = 0x16, DOOR_KEYHOLE_6 = 0x17, } const GLOBAL_SCALE = 1500; const pathBase = `SuperMario64DS`; class ModelCache { private filePromiseCache = new Map<string, Promise<ArrayBufferSlice>>(); private fileDataCache = new Map<string, ArrayBufferSlice>(); private modelCache = new Map<string, BMDData>(); private gfxRenderCache: GfxRenderCache; constructor(device: GfxDevice, private dataFetcher: DataFetcher) { this.gfxRenderCache = new GfxRenderCache(device); } public waitForLoad(): Promise<any> { const p: Promise<any>[] = [... this.filePromiseCache.values()]; return Promise.all(p); } public mountNARC(narc: NARC.NitroFS): void { for (let i = 0; i < narc.files.length; i++) { const file = narc.files[i]; this.fileDataCache.set(assertExists(file.path), file.buffer); } } private fetchFile(path: string): Promise<ArrayBufferSlice> { assert(!this.filePromiseCache.has(path)); assert(path.startsWith('/data')); const p = this.dataFetcher.fetchData(`${pathBase}${path}`, { abortedCallback: () => { this.filePromiseCache.delete(path); } }); this.filePromiseCache.set(path, p); return p; } public fetchFileData(path: string): Promise<ArrayBufferSlice> { const d = this.fileDataCache.get(path); if (d !== undefined) { return Promise.resolve(d); } const p = this.filePromiseCache.get(path); if (p !== undefined) { return p.then(() => this.getFileData(path)); } else { return this.fetchFile(path).then((data) => { this.fileDataCache.set(path, data); return data; }); } } public getFileData(path: string): ArrayBufferSlice { return assertExists(this.fileDataCache.get(path)); } public getModel(device: GfxDevice, modelPath: string): BMDData { let p = this.modelCache.get(modelPath); if (p === undefined) { const buffer = assertExists(this.fileDataCache.get(modelPath)); const result = LZ77.maybeDecompress(buffer); const bmd = BMD.parse(result); p = new BMDData(this.gfxRenderCache, bmd); this.modelCache.set(modelPath, p); } return p; } public async fetchModel(device: GfxDevice, filename: string): Promise<BMDData> { await this.fetchFileData(filename); return this.getModel(device, filename); } public destroy(device: GfxDevice): void { for (const model of this.modelCache.values()) model.destroy(device); this.gfxRenderCache.destroy(); } } const bindingLayouts: GfxBindingLayoutDescriptor[] = [ { numUniformBuffers: 3, numSamplers: 1 }, ]; class SM64DSRenderer implements Viewer.SceneGfx { private renderHelper: GfxRenderHelper; private renderInstListSky = new GfxRenderInstList(); private renderInstListMain = new GfxRenderInstList(); public objectRenderers: ObjectRenderer[] = []; public bmdRenderers: BMDModelInstance[] = []; public skyRenderers: BMDModelInstance[] = []; public animationController = new AnimationController(); private currentScenarioIndex: number = -1; private scenarioSelect: UI.SingleSelect; public onstatechanged!: () => void; constructor(device: GfxDevice, public modelCache: ModelCache, public crg1Level: CRG1Level) { this.renderHelper = new GfxRenderHelper(device); } protected prepareToRender(device: GfxDevice, viewerInput: Viewer.ViewerRenderInput): void { const renderInstManager = this.renderHelper.renderInstManager; this.animationController.setTimeFromViewerInput(viewerInput); const template = this.renderHelper.pushTemplateRenderInst(); template.setBindingLayouts(bindingLayouts); let offs = template.allocateUniformBuffer(NITRO_Program.ub_SceneParams, 16+32); const sceneParamsMapped = template.mapUniformBufferF32(NITRO_Program.ub_SceneParams); offs += fillMatrix4x4(sceneParamsMapped, offs, viewerInput.camera.projectionMatrix); renderInstManager.setCurrentRenderInstList(this.renderInstListSky); for (let i = 0; i < this.skyRenderers.length; i++) this.skyRenderers[i].prepareToRender(device, renderInstManager, viewerInput); renderInstManager.setCurrentRenderInstList(this.renderInstListMain); for (let i = 0; i < this.bmdRenderers.length; i++) this.bmdRenderers[i].prepareToRender(device, renderInstManager, viewerInput); for (let i = 0; i < this.objectRenderers.length; i++) this.objectRenderers[i].prepareToRender(device, renderInstManager, viewerInput); renderInstManager.popTemplateRenderInst(); this.renderHelper.prepareToRender(); } public render(device: GfxDevice, viewerInput: Viewer.ViewerRenderInput) { const renderInstManager = this.renderHelper.renderInstManager; const builder = this.renderHelper.renderGraph.newGraphBuilder(); const mainColorDesc = makeBackbufferDescSimple(GfxrAttachmentSlot.Color0, viewerInput, opaqueBlackFullClearRenderPassDescriptor); const mainDepthDesc = makeBackbufferDescSimple(GfxrAttachmentSlot.DepthStencil, viewerInput, opaqueBlackFullClearRenderPassDescriptor); const mainColorTargetID = builder.createRenderTargetID(mainColorDesc, 'Main Color'); builder.pushPass((pass) => { pass.setDebugName('Skybox'); pass.attachRenderTargetID(GfxrAttachmentSlot.Color0, mainColorTargetID); const skyboxDepthTargetID = builder.createRenderTargetID(mainDepthDesc, 'Skybox Depth'); pass.attachRenderTargetID(GfxrAttachmentSlot.DepthStencil, skyboxDepthTargetID); pass.exec((passRenderer) => { this.renderInstListSky.drawOnPassRenderer(this.renderHelper.renderCache, passRenderer); }); }); const mainDepthTargetID = builder.createRenderTargetID(mainDepthDesc, 'Main Depth'); builder.pushPass((pass) => { pass.setDebugName('Main'); pass.attachRenderTargetID(GfxrAttachmentSlot.Color0, mainColorTargetID); pass.attachRenderTargetID(GfxrAttachmentSlot.DepthStencil, mainDepthTargetID); pass.exec((passRenderer) => { this.renderInstListMain.drawOnPassRenderer(this.renderHelper.renderCache, passRenderer); }); }); this.renderHelper.antialiasingSupport.pushPasses(builder, viewerInput, mainColorTargetID); builder.resolveRenderTargetToExternalTexture(mainColorTargetID, viewerInput.onscreenTexture); this.prepareToRender(device, viewerInput); this.renderHelper.renderGraph.execute(builder); this.renderInstListMain.reset(); this.renderInstListSky.reset(); } private setCurrentScenario(index: number): void { if (this.currentScenarioIndex === index) return; this.currentScenarioIndex = index; const setup = index + 1; const showAllScenarios = index === this.crg1Level.SetupNames.length; for (let i = 0; i < this.objectRenderers.length; i++) { const obj = this.objectRenderers[i]; // '0' means visible in all setups. obj.visible = (obj.setup === 0) || (obj.setup === setup) || showAllScenarios; } this.onstatechanged(); this.scenarioSelect.selectItem(index); } public createPanels(): UI.Panel[] { const scenarioPanel = new UI.Panel(); scenarioPanel.customHeaderBackgroundColor = UI.COOL_BLUE_COLOR; scenarioPanel.setTitle(UI.TIME_OF_DAY_ICON, 'Scenario'); const scenarioNames: string[] = this.crg1Level.SetupNames.slice(); if (scenarioNames.length > 0) scenarioNames.push('All Scenarios'); this.scenarioSelect = new UI.SingleSelect(); this.scenarioSelect.setStrings(scenarioNames); this.scenarioSelect.onselectionchange = (scenarioIndex: number) => { this.setCurrentScenario(scenarioIndex); }; this.scenarioSelect.selectItem(0); scenarioPanel.contents.appendChild(this.scenarioSelect.elem); scenarioPanel.setVisible(scenarioNames.length > 0); const renderHacksPanel = new UI.Panel(); renderHacksPanel.customHeaderBackgroundColor = UI.COOL_BLUE_COLOR; renderHacksPanel.setTitle(UI.RENDER_HACKS_ICON, 'Render Hacks'); const enableVertexColorsCheckbox = new UI.Checkbox('Enable Vertex Colors', true); enableVertexColorsCheckbox.onchanged = () => { const v = enableVertexColorsCheckbox.checked; for (let i = 0; i < this.bmdRenderers.length; i++) this.bmdRenderers[i].setVertexColorsEnabled(v); }; renderHacksPanel.contents.appendChild(enableVertexColorsCheckbox.elem); const enableTextures = new UI.Checkbox('Enable Textures', true); enableTextures.onchanged = () => { const v = enableTextures.checked; for (let i = 0; i < this.bmdRenderers.length; i++) this.bmdRenderers[i].setTexturesEnabled(v); }; renderHacksPanel.contents.appendChild(enableTextures.elem); return [scenarioPanel, renderHacksPanel]; } public serializeSaveState(dst: ArrayBuffer, offs: number): number { const view = new DataView(dst); view.setUint8(offs++, this.currentScenarioIndex); return offs; } public deserializeSaveState(src: ArrayBuffer, offs: number, byteLength: number): number { const view = new DataView(src); if (offs < byteLength) this.setCurrentScenario(view.getUint8(offs++)); return offs; } public destroy(device: GfxDevice): void { this.renderHelper.destroy(); } } interface Animation { updateModelMatrix(time: number, modelMatrix: mat4): void; } class YSpinAnimation { constructor(public speed: number, public phase: number) {} public updateNormalMatrix(time: number, normalMatrix: mat4) { const theta = this.phase + (time / 30 * this.speed); mat4.rotateY(normalMatrix, normalMatrix, theta); } public updateModelMatrix(time: number, modelMatrix: mat4) { this.updateNormalMatrix(time, modelMatrix); } } interface ObjectRenderer { visible: boolean; setup: number; modelMatrix: mat4; calcAnim(viewerInput: Viewer.ViewerRenderInput): void; prepareToRender(device: GfxDevice, renderInstManager: GfxRenderInstManager, viewerInput: Viewer.ViewerRenderInput): void; } class SimpleObjectRenderer implements ObjectRenderer { public animationController = new AnimationController(); public animation: Animation | null = null; public visible = true; public setup = 0; public modelMatrix = mat4.create(); constructor(public modelInstance: BMDModelInstance) { } public calcAnim(viewerInput: Viewer.ViewerRenderInput): void { this.animationController.setTimeFromViewerInput(viewerInput); mat4.copy(this.modelInstance.modelMatrix, this.modelMatrix); if (this.animation !== null) this.animation.updateModelMatrix(viewerInput.time, this.modelInstance.modelMatrix); } public prepareToRender(device: GfxDevice, renderInstManager: GfxRenderInstManager, viewerInput: Viewer.ViewerRenderInput): void { if (!this.visible) return; this.calcAnim(viewerInput); this.modelInstance.prepareToRender(device, renderInstManager, viewerInput); } } const scratchVec3 = vec3.create(); class Sanbo implements ObjectRenderer { public visible = true; public setup = 0; public modelMatrix = mat4.create(); private animationPhase = 0; private body0: BMDModelInstance; private body1: BMDModelInstance; private body2: BMDModelInstance; private body3: BMDModelInstance; private head: BMDModelInstance; constructor(bodyData: BMDData, headData: BMDData) { this.body0 = new BMDModelInstance(bodyData); this.body1 = new BMDModelInstance(bodyData); this.body2 = new BMDModelInstance(bodyData); this.body3 = new BMDModelInstance(bodyData); this.head = new BMDModelInstance(headData); this.animationPhase = Math.random(); } public calcAnim(viewerInput: Viewer.ViewerRenderInput): void { mat4.copy(this.body0.modelMatrix, this.modelMatrix); mat4.copy(this.body1.modelMatrix, this.modelMatrix); mat4.copy(this.body2.modelMatrix, this.modelMatrix); mat4.copy(this.body3.modelMatrix, this.modelMatrix); mat4.copy(this.head.modelMatrix, this.modelMatrix); vec3.set(scratchVec3, 0, 5, 0); const time = viewerInput.time + (this.animationPhase * 400); scratchVec3[0] += Math.sin(time / 400) * 4; scratchVec3[2] += Math.cos(time / 400) * 4; mat4.translate(this.body0.modelMatrix, this.body0.modelMatrix, scratchVec3); scratchVec3[1] += 15; scratchVec3[0] += Math.sin(time / 420) * 3; scratchVec3[2] += Math.cos(time / 420) * 3; mat4.translate(this.body1.modelMatrix, this.body1.modelMatrix, scratchVec3); scratchVec3[1] += 15; scratchVec3[0] += Math.sin(time / -320) * 2; scratchVec3[2] += Math.cos(time / -320) * 2; mat4.translate(this.body2.modelMatrix, this.body2.modelMatrix, scratchVec3); scratchVec3[1] += 15; scratchVec3[0] += Math.sin(time / 200) * 1; scratchVec3[2] += Math.cos(time / 200) * 1; mat4.translate(this.body3.modelMatrix, this.body3.modelMatrix, scratchVec3); scratchVec3[1] += 15; mat4.translate(this.head.modelMatrix, this.head.modelMatrix, scratchVec3); } public prepareToRender(device: GfxDevice, renderInstManager: GfxRenderInstManager, viewerInput: Viewer.ViewerRenderInput): void { if (!this.visible) return; this.calcAnim(viewerInput); this.head.prepareToRender(device, renderInstManager, viewerInput); this.body0.prepareToRender(device, renderInstManager, viewerInput); this.body1.prepareToRender(device, renderInstManager, viewerInput); this.body2.prepareToRender(device, renderInstManager, viewerInput); this.body3.prepareToRender(device, renderInstManager, viewerInput); } } class DataHolder { constructor(public crg1: Sm64DSCRG1, public modelCache: ModelCache) { } public destroy(device: GfxDevice): void { this.modelCache.destroy(device); } } export class SM64DSSceneDesc implements Viewer.SceneDesc { public id: string; constructor(public levelId: number, public name: string) { this.id = '' + this.levelId; } private async _createBMDRenderer(device: GfxDevice, renderer: SM64DSRenderer, filename: string, scale: number, level: CRG1Level, isSkybox: boolean): Promise<BMDModelInstance> { const modelCache = renderer.modelCache; const bmdData = await modelCache.fetchModel(device, filename); const bmdRenderer = new BMDModelInstance(bmdData, level); scaleMatrix(bmdRenderer.modelMatrix, bmdRenderer.modelMatrix, scale); bmdRenderer.isSkybox = isSkybox; if (isSkybox) renderer.skyRenderers.push(bmdRenderer); else renderer.bmdRenderers.push(bmdRenderer); return bmdRenderer; } private async _createBMDObjRenderer(device: GfxDevice, renderer: SM64DSRenderer, filename: string): Promise<SimpleObjectRenderer> { const modelCache = renderer.modelCache; const bmdData = await modelCache.fetchModel(device, filename); const modelInstance = new BMDModelInstance(bmdData); const objectRenderer = new SimpleObjectRenderer(modelInstance); renderer.objectRenderers.push(objectRenderer); objectRenderer.modelInstance.name = filename; return objectRenderer; } private modelMatrixFromObjectAndScale(m: mat4, object: CRG1Object, scale: number, extraRotationY: number = 0): void { const translation = vec3.fromValues(object.Position.X, object.Position.Y, object.Position.Z); const rotationY = (object.Rotation.Y + extraRotationY) * MathConstants.DEG_TO_RAD; vec3.scale(translation, translation, GLOBAL_SCALE); mat4.translate(m, m, translation); mat4.rotateY(m, m, rotationY); // Don't ask, ugh. scale = scale * (GLOBAL_SCALE / 100); scaleMatrix(m, m, scale); } private async _createBMDRendererForStandardObject(device: GfxDevice, renderer: SM64DSRenderer, object: CRG1StandardObject): Promise<void> { const modelCache = renderer.modelCache; const spawnObject = async (filename: string, scale: number = 0.8, spinSpeed: number = 0) => { const b = await this._createBMDObjRenderer(device, renderer, filename); this.modelMatrixFromObjectAndScale(b.modelMatrix, object, scale); if (spinSpeed > 0) b.animation = new YSpinAnimation(spinSpeed, 0); b.setup = object.Setup; return b; }; const bindBCA = async (b: SimpleObjectRenderer, filename: string) => { const data = await renderer.modelCache.fetchFileData(filename); const bca = BCA.parse(LZ77.maybeDecompress(data)); bca.loopMode = BCA.LoopMode.REPEAT; b.animationController.phaseFrames += Math.random() * bca.duration; b.modelInstance.bindBCA(b.animationController, bca); }; const objectId: ObjectId = object.ObjectId; if (objectId === ObjectId.EWB_ICE_A) { //ID 001 const b = await spawnObject(`/data/special_obj/ewb_ice/ewb_ice_a.bmd`); } else if (objectId === ObjectId.EWB_ICE_B) { //ID 002 const b = await spawnObject(`/data/special_obj/ewb_ice/ewb_ice_b.bmd`); } else if (objectId === ObjectId.EWB_ICE_C) { //ID 003 const b = await spawnObject(`/data/special_obj/ewb_ice/ewb_ice_c.bmd`); } else if (objectId === ObjectId.EWM_ICE_BLOCK) { //ID 004 const b = await spawnObject(`/data/special_obj/ewm_ice_brock/ewm_ice_brock.bmd`); } else if (objectId === ObjectId.EMM_LOG) { //ID 005 const b = await spawnObject(`/data/special_obj/emm_log/emm_log.bmd`); } else if (objectId === ObjectId.EMM_YUKA) { //ID 006 const b = await spawnObject(`/data/special_obj/emm_yuka/emm_yuka.bmd`); } else if (objectId === ObjectId.UPDOWN_LIFT) { //ID 007 const b = await spawnObject(`/data/normal_obj/obj_updnlift/obj_updnlift.bmd`); } else if (objectId === ObjectId.HS_UPDOWN_LIFT) { //ID 008 const b = await spawnObject(`/data/special_obj/hs_updown_lift/hs_updown_lift.bmd`); } else if (objectId === ObjectId.PATH_LIFT) { //ID 009 const b = await spawnObject(`/data/normal_obj/obj_pathlift/obj_pathlift.bmd`); } else if (objectId === ObjectId.WANWAN) { //ID 010 const b = await spawnObject(`/data/enemy/wanwan/wanwan.bmd`); mat4.translate(b.modelMatrix, b.modelMatrix, [0, 32, 0]); await bindBCA(b, '/data/enemy/wanwan/wanwan_wait.bca'); } else if (objectId === ObjectId.CAMERA_TAG) { //ID 011 // Invisible (Not used in maps?) } else if (objectId === ObjectId.SEESAW) { //ID 012 const b = await spawnObject(`/data/normal_obj/obj_seesaw/obj_seesaw.bmd`); } else if (objectId === ObjectId.IRONBALL) { //ID 013 const b = await spawnObject(`/data/enemy/iron_ball/iron_ball.bmd`); mat4.translate(b.modelMatrix, b.modelMatrix, [0, 16, 0]); } else if (objectId === ObjectId.GORO_ROCK) { //ID 014 const b = await spawnObject(`/data/special_obj/cv_goro_rock/cv_goro_rock.bmd`); } else if (objectId === ObjectId.KURIBO) { //ID 015 const b = await spawnObject(`/data/enemy/kuribo/kuribo_model.bmd`); await bindBCA(b, `/data/enemy/kuribo/kuribo_wait.bca`); } else if (objectId === ObjectId.KURIBO_S) { //ID 016 const b = await spawnObject(`/data/enemy/kuribo/kuribo_model.bmd`, 0.2); await bindBCA(b, `/data/enemy/kuribo/kuribo_wait.bca`); } else if (objectId === ObjectId.KURIBO_L) { //ID 017 const b = await spawnObject(`/data/enemy/kuribo/kuribo_model.bmd`, 1.6); await bindBCA(b, `/data/enemy/kuribo/kuribo_wait.bca`); } else if (objectId === ObjectId.KURIKING) { //ID 018 const b = await spawnObject(`/data/enemy/kuriking/kuriking_model.bmd`); await bindBCA(b, '/data/enemy/kuriking/kuriking_wait.bca'); } else if (objectId === ObjectId.BOMBHEI) { //ID 019 const b = await spawnObject(`/data/enemy/bombhei/bombhei.bmd`); await bindBCA(b, `/data/enemy/bombhei/bombhei_walk.bca`); } else if (objectId === ObjectId.RED_BOMBHEI) { //ID 020 const b = await spawnObject(`/data/enemy/bombhei/red_bombhei.bmd`); await bindBCA(b, `/data/enemy/bombhei/red_wait.bca`); } else if (objectId === ObjectId.NOKONOKO) { //ID 021 const b = await spawnObject(`/data/enemy/nokonoko/nokonoko.bmd`); await bindBCA(b, '/data/enemy/nokonoko/nokonoko_walk.bca'); } else if (objectId === ObjectId.NOKONOKO_S) { //ID 022 const b = await spawnObject(`/data/enemy/nokonoko/shell_green.bmd`); } else if (objectId === ObjectId.BLOCK_L) { //ID 023 const b = await spawnObject(`/data/normal_obj/obj_block/broken_block_l.bmd`); } else if (objectId === ObjectId.DP_BLOCK_L) { //ID 024 const b = await spawnObject(`/data/normal_obj/obj_block/broken_block_l.bmd`, 1.2); } else if (objectId === ObjectId.SW_BLOCK_L) { //ID 025 const b = await spawnObject(`/data/normal_obj/obj_block/broken_block_l.bmd`); } else if (objectId === ObjectId.POWER_UP_ITEM) { //ID 026 const b = await spawnObject(`/data/normal_obj/obj_power_flower/p_flower_open.bmd`); } else if (objectId === ObjectId.HATENA_SWITCH) { //ID 027 const b = await spawnObject(`/data/normal_obj/obj_hatena_switch/hatena_switch.bmd`); } else if (objectId === ObjectId.BLOCK_S) { //ID 028 const b = await spawnObject(`/data/normal_obj/obj_block/broken_block_s.bmd`); } else if (objectId === ObjectId.CANNON_SHUTTER) { //ID 029 const b = await spawnObject(`/data/normal_obj/obj_cannon_shutter/cannon_shutter.bmd`); } else if (objectId === ObjectId.HATENA_BLOCK) { //ID 030 const b = await spawnObject(`/data/normal_obj/obj_hatena_box/hatena_box.bmd`); } else if (objectId === ObjectId.ITEM_BLOCK) { //ID 031 const b = await spawnObject(`/data/normal_obj/obj_hatena_box/obj_hatena_y_box.bmd`); } else if (objectId === ObjectId.VS_ITEM_BLOCK) { //ID 032 const b = await spawnObject(`/data/normal_obj/obj_hatena_box/obj_hatena_y_box.bmd`); } else if (objectId === ObjectId.CAP_BLOCK_M) { //ID 033 const b = await spawnObject(`/data/normal_obj/obj_hatena_box/obj_cap_box_m.bmd`); } else if (objectId === ObjectId.CAP_BLOCK_W) { //ID 034 const b = await spawnObject(`/data/normal_obj/obj_hatena_box/obj_cap_box_w.bmd`); } else if (objectId === ObjectId.CAP_BLOCK_L) { //ID 035 const b = await spawnObject(`/data/normal_obj/obj_hatena_box/obj_cap_box_l.bmd`); } else if (objectId === ObjectId.PILE) { //ID 036 const b = await spawnObject(`/data/normal_obj/obj_pile/pile.bmd`); } else if (objectId === ObjectId.COIN) { //ID 037 const b = await spawnObject(`/data/normal_obj/coin/coin_poly32.bmd`, 0.7, 0.1); } else if (objectId === ObjectId.RED_COIN) { //ID 038 const b = await spawnObject(`/data/normal_obj/coin/coin_red_poly32.bmd`, 0.7, 0.1); } else if (objectId === ObjectId.BLUE_COIN) { //ID 039 const b = await spawnObject(`/data/normal_obj/coin/coin_blue_poly32.bmd`, 0.7, 0.1); } else if (objectId === ObjectId.KOOPA) { //ID 040 const b = await spawnObject(`/data/enemy/koopa/koopa_model.bmd`); await bindBCA(b, '/data/enemy/koopa/koopa_wait1.bca'); } else if (objectId === ObjectId.TREE) { //ID 041 const treeType = (object.Parameters[0] >>> 4) & 0x07; const treeFilenames = ['bomb', 'toge', 'yuki', 'yashi', 'castle', 'castle', 'castle', 'castle']; const filename = `/data/normal_obj/tree/${treeFilenames[treeType]}_tree.bmd`; const b = await spawnObject(filename); } else if (objectId === ObjectId.PICTURE_GATE) { //ID 042 const painting = (object.Parameters[0] >>> 8) & 0x1F; // Castle Painting const filenames = [ 'for_bh', 'for_bk', 'for_ki', 'for_sm', 'for_cv_ex5', 'for_fl', 'for_dl', 'for_wl', 'for_sl', 'for_wc', 'for_hm', 'for_hs', 'for_td_tt', 'for_ct', 'for_ex_mario', 'for_ex_luigi', 'for_ex_wario', 'for_vs_cross', 'for_vs_island', ]; const filename = `/data/picture/${filenames[painting]}.bmd`; const scaleX = (object.Parameters[0] & 0xF)+1; const scaleY = ((object.Parameters[0] >> 4) & 0x0F) + 1; const rotationX = object.Parameters[1] / 0x7FFF * (Math.PI); const isMirrored = ((object.Parameters[0] >> 13) & 0x03) === 3; const b = await spawnObject(filename); mat4.rotateX(b.modelMatrix, b.modelMatrix, rotationX); mat4.scale(b.modelMatrix, b.modelMatrix, [scaleX, scaleY, 1]); mat4.translate(b.modelMatrix, b.modelMatrix, [0, 100/16, 0]); if (isMirrored) { b.modelInstance.extraTexCoordMat = mat2d.create(); b.modelInstance.extraTexCoordMat[0] *= -1; } } else if (objectId === ObjectId.HANSWITCH) { //ID 043 const b = await spawnObject(`/data/normal_obj/obj_box_switch/obj_box_switch.bmd`); } else if (objectId === ObjectId.STAR_SWITCH) { //ID 044 const b = await spawnObject(`/data/normal_obj/obj_star_switch/obj_star_switch.bmd`); } else if (objectId === ObjectId.SWITCHDOOR) { //ID 045 const b = await spawnObject(`/data/special_obj/b_ana_shutter/b_ana_shutter.bmd`); } else if (objectId === ObjectId.CV_SHUTTER) { //ID 046 const b = await spawnObject(`/data/special_obj/cv_shutter/cv_shutter.bmd`); } else if (objectId === ObjectId.CV_NEWS_LIFT) { //ID 047 const b = await spawnObject(`/data/special_obj/cv_news_lift/cv_news_lift.bmd`); } else if (objectId === ObjectId.WANWAN2) { //ID 048 const b = await spawnObject(`/data/enemy/wanwan/wanwan.bmd`); mat4.translate(b.modelMatrix, b.modelMatrix, [0, 32, 0]); await bindBCA(b, '/data/enemy/wanwan/wanwan_wait.bca'); } else if (objectId === ObjectId.ONEUPKINOKO) { //ID 049 const b = await spawnObject(`/data/normal_obj/oneup_kinoko/oneup_kinoko.bmd`); } else if (objectId === ObjectId.CANNON) { //ID 050 const b = await spawnObject(`/data/normal_obj/obj_cannon/houdai.bmd`); } else if (objectId === ObjectId.WANWAN_SHUTTER) { //ID 051 const b = await spawnObject(`/data/special_obj/b_wan_shutter/b_wan_shutter.bmd`); } else if (objectId === ObjectId.WATERBOMB) { //ID 052 const b = await spawnObject(`/data/enemy/water_bomb/water_bomb.bmd`); } else if (objectId === ObjectId.SBIRD) { //ID 053 const b = await spawnObject(`/data/normal_obj/bird/bird.bmd`); //await bindBCA(b, '/data/normal_obj/bird/bird_fly.bca'); } else if (objectId === ObjectId.FISH) { //ID 054 const b = await spawnObject(`/data/normal_obj/fish/fish.bmd`); await bindBCA(b, '/data/normal_obj/fish/fish_wait.bca'); } else if (objectId === ObjectId.BUTTERFLY) { //ID 055 const b = await spawnObject(`/data/normal_obj/butterfly/butterfly.bmd`); } else if (objectId === ObjectId.BOMBKING) { //ID 056 const b = await spawnObject(`/data/enemy/bombking/bomb_king.bmd`); await bindBCA(b, `/data/enemy/bombking/bombking_wait1.bca`); } else if (objectId === ObjectId.SNOWMAN) { //ID 057 const b = await spawnObject(`/data/enemy/snowman/snowman_model.bmd`); await bindBCA(b, '/data/enemy/snowman/snowman_wait.bca'); } else if (objectId === ObjectId.PIANO) { //ID 058 const b = await spawnObject(`/data/enemy/piano/piano.bmd`); await bindBCA(b, '/data/enemy/piano/piano_attack.bca'); } else if (objectId === ObjectId.PAKUN) { //ID 059 const b = await spawnObject(`/data/enemy/pakkun/pakkun_model.bmd`); await bindBCA(b, '/data/enemy/pakkun/pakkun_sleep_loop.bca'); } else if (objectId === ObjectId.STAR_CAMERA) { //ID 060 return; // Star Camera Path } else if (objectId === ObjectId.STAR) { //ID 061 const b = await spawnObject(`/data/normal_obj/star/obj_star.bmd`, 0.8, 0.08); } else if (objectId === ObjectId.SILVER_STAR) { //ID 062 const b = await spawnObject(`/data/normal_obj/star/obj_star_silver.bmd`, 0.8, 0.08); // Silver Star } else if (objectId === ObjectId.STARBASE) { //ID 063 let filename = `/data/normal_obj/star/obj_star.bmd`; // Star let startype = (object.Parameters[0] >>> 4) & 0x0F; let rotateSpeed = 0.08; switch (startype) { case 0: filename = `/data/normal_obj/star/star_base.bmd`; break; case 1: case 4: case 6: filename = `/data/normal_obj/star_box/star_box.bmd`; rotateSpeed = 0; break; } const b = await spawnObject(filename, 0.8, rotateSpeed); } else if (objectId === ObjectId.BATAN) { //ID 064 const b = await spawnObject(`/data/enemy/battan/battan.bmd`); await bindBCA(b, '/data/enemy/battan/battan_walk.bca'); } else if (objectId === ObjectId.BATANKING) { //ID 065 const b = await spawnObject(`/data/enemy/battan_king/battan_king.bmd`); await bindBCA(b, '/data/enemy/battan_king/battan_king_walk.bca'); } else if (objectId === ObjectId.DOSUN) { //ID 066 const b = await spawnObject(`/data/enemy/dosune/dosune.bmd`); } else if (objectId === ObjectId.TERESA) { //ID 067 const b = await spawnObject(`/data/enemy/teresa/teresa.bmd`); await bindBCA(b, '/data/enemy/teresa/teresa_wait.bca'); } else if (objectId === ObjectId.BOSS_TERESA) { //ID 068 const b = await spawnObject(`/data/enemy/boss_teresa/boss_teresa.bmd`); await bindBCA(b, '/data/enemy/boss_teresa/boss_teresa_wait.bca'); } else if (objectId === ObjectId.ICON_TERESA) { //ID 069 //Invisible } else if (objectId === ObjectId.KAIDAN) { //ID 070 //const b = await spawnObject(`/data/special_obj/th_kaidan/th_kaidan.bmd`); //Loads in an odd manner } else if (objectId === ObjectId.BOOKSHELF) { //ID 071 const b = await spawnObject(`/data/special_obj/th_hondana/th_hondana.bmd`); } else if (objectId === ObjectId.MERRYGOROUND) { //ID 072 const b = await spawnObject(`/data/special_obj/th_mery_go/th_mery_go.bmd`); } else if (objectId === ObjectId.TERESAPIT) { //ID 073 const b = await spawnObject(`/data/special_obj/th_trap/th_trap.bmd`); } else if (objectId === ObjectId.PL_CLOSET) { //ID 074 // Invisible } else if (objectId === ObjectId.KANBAN) { //ID 075 const b = await spawnObject(`/data/normal_obj/obj_kanban/obj_kanban.bmd`); } else if (objectId === ObjectId.TATEFUDA) { //ID 076 const b = await spawnObject(`/data/normal_obj/obj_tatefuda/obj_tatefuda.bmd`); } else if (objectId === ObjectId.ICE_BOARD) { //ID 077 const b = await spawnObject(`/data/normal_obj/obj_ice_board/obj_ice_board.bmd`); } else if (objectId === ObjectId.WAKAME) { //ID 078 const b = await spawnObject(`/data/normal_obj/obj_wakame/obj_wakame.bmd`); await bindBCA(b, '/data/normal_obj/obj_wakame/obj_wakame_wait.bca'); } else if (objectId === ObjectId.HEART) { //ID 079 const b = await spawnObject(`/data/normal_obj/obj_heart/obj_heart.bmd`, 0.8, 0.05); } else if (objectId === ObjectId.KINOPIO) { //ID 080 const b = await spawnObject(`/data/enemy/kinopio/kinopio.bmd`); await bindBCA(b, '/data/enemy/kinopio/kinopio_wait1.bca'); } else if (objectId === ObjectId.KOOPA2BG) { //ID 082 const b = await spawnObject(`/data/special_obj/kb2_stage/kb2_stage.bmd`); } else if (objectId === ObjectId.KOOPA3BG) { //ID 083 const b = await spawnObject(`/data/special_obj/kb3_stage/kb3_a.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_b.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_c.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_d.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_e.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_f.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_g.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_h.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_i.bmd`); await spawnObject(`/data/special_obj/kb3_stage/kb3_j.bmd`); } else if (objectId === ObjectId.SHELL) { //ID 084 const b = await spawnObject(`/data/enemy/nokonoko/shell_green.bmd`); } else if (objectId === ObjectId.SHARK) { //ID 085 const b = await spawnObject(`/data/enemy/hojiro/hojiro.bmd`); await bindBCA(b, '/data/enemy/hojiro/hojiro_swim.bca'); } else if (objectId === ObjectId.CT_MECHA01) { //ID 086 const b = await spawnObject(`/data/special_obj/ct_mecha_obj01/ct_mecha_obj01.bmd`); } else if (objectId === ObjectId.CT_MECHA03) { //ID 088 const b = await spawnObject(`/data/special_obj/ct_mecha_obj03/ct_mecha_obj03.bmd`); } else if (objectId === ObjectId.CT_MECHA04L) { //ID 089 const b = await spawnObject(`/data/special_obj/ct_mecha_obj04l/ct_mecha_obj04l.bmd`); } else if (objectId === ObjectId.CT_MECHA04S) { //ID 090 const b = await spawnObject(`/data/special_obj/ct_mecha_obj04s/ct_mecha_obj04s.bmd`); } else if (objectId === ObjectId.CT_MECHA05) { //ID 091 const b = await spawnObject(`/data/special_obj/ct_mecha_obj05/ct_mecha_obj05.bmd`); } else if (objectId === ObjectId.CT_MECHA06) { //ID 092 const b = await spawnObject(`/data/special_obj/ct_mecha_obj06/ct_mecha_obj06.bmd`); } else if (objectId === ObjectId.CT_MECHA09) { //ID 096 const b = await spawnObject(`/data/special_obj/ct_mecha_obj09/ct_mecha_obj09.bmd`); } else if (objectId === ObjectId.CT_MECHA10) { //ID 097 const b = await spawnObject(`/data/special_obj/ct_mecha_obj10/ct_mecha_obj10.bmd`); } else if (objectId === ObjectId.CT_MECHA11) { //ID 098 const b = await spawnObject(`/data/special_obj/ct_mecha_obj11/ct_mecha_obj11.bmd`); } else if (objectId === ObjectId.CT_MECHA12L) { //ID 099 const b = await spawnObject(`/data/special_obj/ct_mecha_obj12l/ct_mecha_obj12l.bmd`); } else if (objectId === ObjectId.CT_MECHA12S) { //ID 100 const b = await spawnObject(`/data/special_obj/ct_mecha_obj12s/ct_mecha_obj12s.bmd`); } else if (objectId === ObjectId.DP_BROCK) { //ID 101 const b = await spawnObject(`/data/special_obj/dp_brock/dp_brock.bmd`); } else if (objectId === ObjectId.DP_LIFT) { //ID 102 const b = await spawnObject(`/data/special_obj/dp_lift/dp_lift.bmd`); } else if (objectId === ObjectId.DL_PYRAMID) { //ID 103 const b = await spawnObject(`/data/special_obj/dl_pyramid/dl_pyramid.bmd`); } else if (objectId === ObjectId.DL_PYRAMID_DUMMY) { //ID 104 // Invisible } else if (objectId === ObjectId.WL_POLELIFT) { //ID 105 const b = await spawnObject(`/data/special_obj/wl_pole_lift/wl_pole_lift.bmd`); } else if (objectId === ObjectId.WL_SUBMARINE) { //ID 106 const b = await spawnObject(`/data/special_obj/wl_submarine/wl_submarine.bmd`); } else if (objectId === ObjectId.WL_KOOPA_SHUTTER) { //ID 107 const b = await spawnObject(`/data/special_obj/wl_kupa_shutter/wl_kupa_shutter.bmd`); } else if (objectId === ObjectId.RC_DORIFU) { //ID 108 const b = await spawnObject(`/data/special_obj/rc_dorifu/rc_dorifu0.bmd`); } else if (objectId === ObjectId.RC_RIFT01) { //ID 109 const b = await spawnObject(`/data/special_obj/rc_rift01/rc_rift01.bmd`); } else if (objectId === ObjectId.RC_HANE) { //ID 110 const b = await spawnObject(`/data/special_obj/rc_hane/rc_hane.bmd`); } else if (objectId === ObjectId.RC_TIKUWA) { //ID 111 const b = await spawnObject(`/data/special_obj/rc_tikuwa/rc_tikuwa.bmd`); } else if (objectId === ObjectId.RC_BURANKO) { //ID 112 const b = await spawnObject(`/data/special_obj/rc_buranko/rc_buranko.bmd`); } else if (objectId === ObjectId.RC_SEESAW) { //ID 113 const b = await spawnObject(`/data/special_obj/rc_shiso/rc_shiso.bmd`); } else if (objectId === ObjectId.RC_KAITEN) { //ID 114 const b = await spawnObject(`/data/special_obj/rc_kaiten/rc_kaiten.bmd`); } else if (objectId === ObjectId.RC_GURUGURU) { //ID 115 const b = await spawnObject(`/data/special_obj/rc_guruguru/rc_guruguru.bmd`); } else if (objectId === ObjectId.SL_ICEBLOCK) { //ID 116 const b = await spawnObject(`/data/special_obj/sl_ice_brock/sl_ice_brock.bmd`); } else if (objectId === ObjectId.HM_MARUTA) { //ID 117 const b = await spawnObject(`/data/special_obj/hm_maruta/hm_maruta.bmd`); } else if (objectId === ObjectId.TT_FUTA) { //ID 118 const b = await spawnObject(`/data/special_obj/tt_obj_futa/tt_obj_futa.bmd`); } else if (objectId === ObjectId.TT_WATER) { //ID 119 const b = await spawnObject(`/data/special_obj/tt_obj_water/tt_obj_water.bmd`); } else if (objectId === ObjectId.TD_FUTA) { //ID 120 const b = await spawnObject(`/data/special_obj/td_obj_futa/td_obj_futa.bmd`); } else if (objectId === ObjectId.TD_WATER) { //ID 121 const b = await spawnObject(`/data/special_obj/td_obj_water/td_obj_water.bmd`); } else if (objectId === ObjectId.WC_UKISIMA) { //ID 122 const b = await spawnObject(`/data/special_obj/wc_obj07/wc_obj07.bmd`, 1, 0.05); //Spinning may not be accurate? } else if (objectId === ObjectId.WC_OBJ01) { //ID 123 const b = await spawnObject(`/data/special_obj/wc_obj01/wc_obj01.bmd`); } else if (objectId === ObjectId.WC_OBJ02) { //ID 124 const b = await spawnObject(`/data/special_obj/wc_obj02/wc_obj02.bmd`); } else if (objectId === ObjectId.WC_OBJ03) { //ID 125 const b = await spawnObject(`/data/special_obj/wc_obj03/wc_obj03.bmd`); } else if (objectId === ObjectId.WC_OBJ04) { //ID 126 const b = await spawnObject(`/data/special_obj/wc_obj04/wc_obj04.bmd`); } else if (objectId === ObjectId.WC_OBJ05) { //ID 127 const b = await spawnObject(`/data/special_obj/wc_obj05/wc_obj05.bmd`); } else if (objectId === ObjectId.WC_OBJ06) { //ID 128 const b = await spawnObject(`/data/special_obj/wc_obj06/wc_obj06.bmd`); } else if (objectId === ObjectId.WC_MIZU) { //ID 129 const b = await spawnObject(`/data/special_obj/wc_mizu/wc_mizu.bmd`); } else if (objectId === ObjectId.FL_RING) { //ID 131 const b = await spawnObject(`/data/special_obj/fl_ring/fl_ring.bmd`); } else if (objectId === ObjectId.FL_GURA) { //ID 132 const b = await spawnObject(`/data/special_obj/fl_gura/fl_gura.bmd`); } else if (objectId === ObjectId.FL_LONDON) { //ID 133 const b = await spawnObject(`/data/special_obj/fl_london/fl_london.bmd`); } else if (objectId === ObjectId.FL_BLOCK) { //ID 134 const b = await spawnObject(`/data/special_obj/fl_block/fl_block.bmd`); } else if (objectId === ObjectId.FL_UKIYUKA) { //ID 135 const b = await spawnObject(`/data/special_obj/fl_uki_yuka/fl_uki_yuka.bmd`); } else if (objectId === ObjectId.FL_UKIYUKA_L) { //ID 136 const b = await spawnObject(`/data/special_obj/fl_shiso/fl_shiso.bmd`); } else if (objectId === ObjectId.FL_SEESAW) { //ID 137 const b = await spawnObject(`/data/special_obj/fl_shiso/fl_shiso.bmd`); } else if (objectId === ObjectId.FL_KOMA_D) { //ID 138 const b = await spawnObject(`/data/special_obj/fl_koma_d/fl_koma_d.bmd`); } else if (objectId === ObjectId.FL_KOMA_U) { //ID 139 const b = await spawnObject(`/data/special_obj/fl_koma_u/fl_koma_u.bmd`); } else if (objectId === ObjectId.FL_UKI_KI) { //ID 140 const b = await spawnObject(`/data/special_obj/fl_uki_ki/fl_uki_ki.bmd`); } else if (objectId === ObjectId.FL_KUZURE) { //ID 141 const b = await spawnObject(`/data/special_obj/fl_kuzure/fl_kuzure.bmd`); } else if (objectId === ObjectId.FM_BATTAN) { //ID 142 const b = await spawnObject(`/data/special_obj/fm_battan/fm_battan.bmd`); //invisible? } else if (objectId === ObjectId.LAVA) { //ID 143 //TODO? } else if (objectId === ObjectId.WATERFALL) { //ID 144 //TODO } else if (objectId === ObjectId.MANTA) { //ID 145 const b = await spawnObject(`/data/enemy/manta/manta.bmd`); await bindBCA(b, '/data/enemy/manta/manta_swim.bca'); } else if (objectId === ObjectId.SPIDER) { //ID 146 const b = await spawnObject(`/data/enemy/spider/spider.bmd`); await bindBCA(b, '/data/enemy/spider/spider_walk.bca'); } else if (objectId === ObjectId.JUGEM) { //ID 148 const b = await spawnObject(`/data/enemy/jugem/jugem.bmd`); await bindBCA(b, '/data/enemy/jugem/jugem_wait.bca'); } else if (objectId === ObjectId.GAMAGUCHI) { //ID 149 const b = await spawnObject(`/data/enemy/gamaguchi/gamaguchi.bmd`); await bindBCA(b, '/data/enemy/gamaguchi/gamaguchi_walk.bca'); } else if (objectId === ObjectId.EYEKUN) { //ID 150 const b = await spawnObject(`/data/enemy/eyekun/eyekun.bmd`); } else if (objectId === ObjectId.EYEKUN_BOSS) { //ID 151 const b = await spawnObject(`/data/enemy/eyekun/eyekun.bmd`, 2.0); } else if (objectId === ObjectId.BATTA_BLOCK) { //ID 152 const b = await spawnObject(`/data/enemy/batta_block/batta_block.bmd`); } else if (objectId === ObjectId.BIRIKYU) { //ID 153 const b = await spawnObject(`/data/enemy/birikyu/birikyu.bmd`); await spawnObject(`/data/enemy/birikyu/birikyu_elec.bmd`); await bindBCA(b, '/data/enemy/birikyu/birikyu_elec.bca'); } else if (objectId === ObjectId.HM_BASKET) { //ID 154 const b = await spawnObject(`/data/special_obj/hm_basket/hm_basket.bmd`); } else if (objectId === ObjectId.MONKEY_THIEF) { //ID 155 const b = await spawnObject(`/data/enemy/monkey/monkey.bmd`); await bindBCA(b, '/data/enemy/monkey/monkey_wait1.bca'); } else if (objectId === ObjectId.MONKEY_STAR) { //ID 156 //Invisible } else if (objectId === ObjectId.PENGUIN_BABY) { //ID 157 const b = await spawnObject(`/data/enemy/penguin/penguin_child.bmd`, 0.25); await bindBCA(b, '/data/enemy/penguin/penguin_walk2.bca'); } else if (objectId === ObjectId.PENGUIN_MOTHER) { //ID 158 const b = await spawnObject(`/data/enemy/penguin/penguin.bmd`); await bindBCA(b, '/data/enemy/penguin/penguin_wait1.bca'); } else if (objectId === ObjectId.PENGUIN_RACER) { //ID 159 const b = await spawnObject(`/data/enemy/penguin/penguin.bmd`); await bindBCA(b, '/data/enemy/penguin/penguin_wait1.bca'); } else if (objectId === ObjectId.PENGUIN_DEFENDER) { //ID 160 const b = await spawnObject(`/data/enemy/penguin/penguin.bmd`); await bindBCA(b, '/data/enemy/penguin/penguin_walk.bca'); } else if (objectId === ObjectId.KERONPA) { //ID 161 const b = await spawnObject(`/data/enemy/keronpa/keronpa.bmd`); } else if (objectId === ObjectId.BIG_SNOWMAN) { //ID 162 const body = await spawnObject(`/data/enemy/big_snowman/big_snowman_body.bmd`, 1.25); const head = await spawnObject(`/data/enemy/big_snowman/big_snowman_head.bmd`, 1.25); mat4.translate(body.modelMatrix, body.modelMatrix, [0, 5, 0]); } else if (objectId === ObjectId.BIG_SNOWMAN_BODY) { //ID 163 const b = await spawnObject(`/data/enemy/big_snowman/big_snowman_body.bmd`); } else if (objectId === ObjectId.BIG_SNOWMAN_HEAD) { //ID 164 const b = await spawnObject(`/data/enemy/big_snowman/big_snowman_head.bmd`); } else if (objectId === ObjectId.SNOWMAN_BREATH) { //ID 165 //TODO? } else if (objectId === ObjectId.PUKUPUKU) { //ID 166 const b = await spawnObject(`/data/enemy/pukupuku/pukupuku.bmd`); await bindBCA(b, '/data/enemy/pukupuku/pukupuku_swim.bca'); } else if (objectId === ObjectId.CLOCK_SHORT) { //ID 167 const b = await spawnObject(`/data/special_obj/c2_hari_short/c2_hari_short.bmd`); } else if (objectId === ObjectId.CLOCK_LONG) { //ID 168 const b = await spawnObject(`/data/special_obj/c2_hari_long/c2_hari_long.bmd`); } else if (objectId === ObjectId.CLOCK_HURIKO) { //ID 169 const b = await spawnObject(`/data/special_obj/c2_huriko/c2_huriko.bmd`); const chain = await spawnObject(`/data/enemy/wanwan/chain.bmd`); } else if (objectId === ObjectId.MENBO) { //ID 170 const b = await spawnObject(`/data/enemy/menbo/menbo.bmd`); await bindBCA(b, '/data/enemy/menbo/menbo_wait1.bca'); } else if (objectId === ObjectId.CASKET) { //ID 171 //const b = await spawnObject(`/data/special_obj/casket/casket.bmd`); //Pokes out of walls } else if (objectId === ObjectId.HYUHYU) { //ID 172 const b = await spawnObject(`/data/enemy/hyuhyu/hyuhyu.bmd`); await bindBCA(b, '/data/enemy/hyuhyu/hyuhyu_wait.bca'); } else if (objectId === ObjectId.BOMB_SEESAW) { //ID 173 const b = await spawnObject(`/data/special_obj/b_si_so/b_si_so.bmd`); } else if (objectId === ObjectId.KM1_SEESAW) { //ID 174 const b = await spawnObject(`/data/special_obj/km1_shiso/km1_shiso.bmd`); } else if (objectId === ObjectId.KM1_DORIFU) { //ID 175 const b = await spawnObject(`/data/special_obj/km1_dorifu/km1_dorifu0.bmd`); } else if (objectId === ObjectId.KM1_UKISHIMA) { //ID 176 const b = await spawnObject(`/data/special_obj/km1_ukishima/km1_ukishima.bmd`); } else if (objectId === ObjectId.KM1_KURUMAJIKU) { //ID 177 const b = await spawnObject(`/data/special_obj/km1_kuruma/km1_kurumajiku.bmd`); const up = await spawnObject(`/data/special_obj/km1_kuruma/km1_kuruma.bmd`); const down = await spawnObject(`/data/special_obj/km1_kuruma/km1_kuruma.bmd`); const left = await spawnObject(`/data/special_obj/km1_kuruma/km1_kuruma.bmd`); const right = await spawnObject(`/data/special_obj/km1_kuruma/km1_kuruma.bmd`); mat4.translate(up.modelMatrix, up.modelMatrix, [0, 50, 37.5]); mat4.translate(right.modelMatrix, right.modelMatrix, [50, 0, 37.5]); mat4.translate(left.modelMatrix, left.modelMatrix, [-50, 0, 37.5]); mat4.translate(down.modelMatrix, down.modelMatrix, [0, -50, 37.5]); } else if (objectId === ObjectId.KM1_DERU) { //ID 178 const b = await spawnObject(`/data/special_obj/km1_deru/km1_deru.bmd`); } else if (objectId === ObjectId.KI_FUNE) { //ID 179 //const b = await spawnObject(`/data/special_obj/ki_fune/ki_fune_down_a.bmd`); } else if (objectId === ObjectId.KI_FUNE_UP) { //ID 180 const b = await spawnObject(`/data/special_obj/ki_fune/ki_fune_up.bmd`); } else if (objectId === ObjectId.KI_HASIRA) { //ID 181 const b = await spawnObject(`/data/special_obj/ki_hasira/ki_hasira.bmd`); //Not entirely accurate? } else if (objectId === ObjectId.KI_ITA) { //ID 183 const b = await spawnObject(`/data/special_obj/ki_ita/ki_ita.bmd`); } else if (objectId === ObjectId.KI_IWA) { //ID 184 const b = await spawnObject(`/data/special_obj/ki_iwa/ki_iwa.bmd`); } else if (objectId === ObjectId.KS_MIZU) { //ID 185 //const b = await spawnObject(`/data/special_obj/ks_mizu/ks_mizu.bmd`); //Considered accurate to code but visually obstructing } else if (objectId === ObjectId.DOKAN) { //ID 186 const b = await spawnObject(`/data/normal_obj/obj_dokan/obj_dokan.bmd`); } else if (objectId === ObjectId.YAJIRUSI_L) { //ID 187 const b = await spawnObject(`/data/normal_obj/obj_yajirusi_l/yajirusi_l.bmd`); } else if (objectId === ObjectId.YAJIRUSI_R) { //ID 188 const b = await spawnObject(`/data/normal_obj/obj_yajirusi_r/yajirusi_r.bmd`); } else if (objectId === ObjectId.PROPELLER_HEYHO) { //ID 189 const b = await spawnObject(`/data/enemy/propeller_heyho/propeller_heyho.bmd`); await bindBCA(b, '/data/enemy/propeller_heyho/propeller_heyho_wait.bca'); } else if (objectId === ObjectId.KB1_BILLBOARD) { //ID 191 const b = await spawnObject(`/data/special_obj/kb1_ball/kb1_ball.bmd`); } else if (objectId === ObjectId.HS_MOON) { //ID 192 const b = await spawnObject(`/data/special_obj/hs_moon/hs_moon.bmd`); } else if (objectId === ObjectId.HS_STAR) { //ID 193 const b = await spawnObject(`/data/special_obj/hs_star/hs_star.bmd`); } else if (objectId === ObjectId.HS_Y_STAR) { //ID 194 const b = await spawnObject(`/data/special_obj/hs_y_star/hs_y_star.bmd`); } else if (objectId === ObjectId.HS_B_STAR) { //ID 195 const b = await spawnObject(`/data/special_obj/hs_b_star/hs_b_star.bmd`); } else if (objectId === ObjectId.BK_BILLBOARD) { //ID 196 const b = await spawnObject(`/data/special_obj/bk_billbord/bk_billbord.bmd`); } else if (objectId === ObjectId.BK_KILLER_DAI) { //ID 197 const b = await spawnObject(`/data/special_obj/bk_killer_dai/bk_killer_dai.bmd`); } else if (objectId === ObjectId.BK_BOTAOSI) { //ID 198 const b = await spawnObject(`/data/special_obj/bk_botaosi/bk_botaosi.bmd`); } else if (objectId === ObjectId.BK_DOWN_B) { //ID 199 const b = await spawnObject(`/data/special_obj/bk_down_b/bk_down_b.bmd`); } else if (objectId === ObjectId.BK_FUTA) { //ID 200 const b = await spawnObject(`/data/special_obj/bk_futa/bk_futa.bmd`); } else if (objectId === ObjectId.BK_KABE01) { //ID 201 const b = await spawnObject(`/data/special_obj/bk_kabe01/bk_kabe01.bmd`); } else if (objectId === ObjectId.BK_KABE00) { //ID 202 const b = await spawnObject(`/data/special_obj/bk_kabe00/bk_kabe00.bmd`); } else if (objectId === ObjectId.BK_TOWER) { //ID 203 const b = await spawnObject(`/data/special_obj/bk_tower/bk_tower.bmd`); } else if (objectId === ObjectId.BK_UKISIMA) { //ID 204 const b = await spawnObject(`/data/special_obj/bk_ukisima/bk_ukisima.bmd`, 1, 0.05); } else if (objectId === ObjectId.BK_ROTEBAR) { //ID 205 const b = await spawnObject(`/data/special_obj/bk_rotebar/bk_rotebar.bmd`); } else if (objectId === ObjectId.BK_LIFT01) { //ID 206 const b = await spawnObject(`/data/special_obj/bk_lift01/bk_lift01.bmd`); } else if (objectId === ObjectId.BK_DOSSUNBAR_S) { //ID 207 const b = await spawnObject(`/data/special_obj/bk_dossunbar_s/bk_dossunbar_s.bmd`); } else if (objectId === ObjectId.BK_DOSSUNBAR_L) { //ID 208 const b = await spawnObject(`/data/special_obj/bk_dossunbar_l/bk_dossunbar_l.bmd`); } else if (objectId === ObjectId.BK_TRANSBAR) { //ID 209 const b = await spawnObject(`/data/special_obj/bk_transbar/bk_transbar.bmd`); } else if (objectId === ObjectId.TH_DOWN_B) { //ID 210 const b = await spawnObject(`/data/special_obj/th_down_b/th_down_b.bmd`); } else if (objectId === ObjectId.KM2_KUZURE) { //ID 211 const b = await spawnObject(`/data/special_obj/km2_kuzure/km2_kuzure.bmd`); } else if (objectId === ObjectId.KM2_AGARU) { //ID 212 const b = await spawnObject(`/data/special_obj/km2_agaru/km2_agaru.bmd`); } else if (objectId === ObjectId.KM2_GURA) { //ID 213 const b = await spawnObject(`/data/special_obj/km2_gura/km2_gura.bmd`); } else if (objectId === ObjectId.KM2_AMI_BOU) { //ID 214 const b = await spawnObject(`/data/special_obj/km2_ami_bou/km2_ami_bou.bmd`); } else if (objectId === ObjectId.KM2_YOKOSEESAW) { //ID 215 const b = await spawnObject(`/data/special_obj/km2_yokoshiso/km2_yokoshiso.bmd`); } else if (objectId === ObjectId.KM2_SUSUMU) { //ID 216 const b = await spawnObject(`/data/special_obj/km2_susumu/km2_susumu.bmd`); } else if (objectId === ObjectId.KM2_UKISHIMA) { //ID 217 const b = await spawnObject(`/data/special_obj/km2_ukishima/km2_ukishima.bmd`); } else if (objectId === ObjectId.KM2_RIFUT02) { //ID 218 const b = await spawnObject(`/data/special_obj/km2_rift02/km2_rift02.bmd`); } else if (objectId === ObjectId.KM2_RIFUT01) { //ID 219 const b = await spawnObject(`/data/special_obj/km2_rift01/km2_rift01.bmd`); } else if (objectId === ObjectId.KM2_NOBIRU) { //ID 220 const b = await spawnObject(`/data/special_obj/km2_nobiru/km2_nobiru.bmd`); } else if (objectId === ObjectId.KM3_SEESAW) { //ID 221 const b = await spawnObject(`/data/special_obj/km3_shiso/km3_shiso.bmd`); } else if (objectId === ObjectId.KM3_YOKOSEESAW) { //ID 222 const b = await spawnObject(`/data/special_obj/km3_yokoshiso/km3_yokoshiso.bmd`); } else if (objectId === ObjectId.KM3_KURUMAJIKU) { //ID 223 const b = await spawnObject(`/data/special_obj/km3_kuruma/km3_kurumajiku.bmd`); const up = await spawnObject(`/data/special_obj/km3_kuruma/km3_kuruma.bmd`); const down = await spawnObject(`/data/special_obj/km3_kuruma/km3_kuruma.bmd`); const left = await spawnObject(`/data/special_obj/km3_kuruma/km3_kuruma.bmd`); const right = await spawnObject(`/data/special_obj/km3_kuruma/km3_kuruma.bmd`); mat4.translate(up.modelMatrix, up.modelMatrix, [0, 50, 37.5]); mat4.translate(right.modelMatrix, right.modelMatrix, [50, 0, 37.5]); mat4.translate(left.modelMatrix, left.modelMatrix, [-50, 0, 37.5]); mat4.translate(down.modelMatrix, down.modelMatrix, [0, -50, 37.5]); } else if (objectId === ObjectId.KM3_DORIFU) { //ID 224 const b = await spawnObject(`/data/special_obj/km3_dan/km3_dan0.bmd`); } else if (objectId === ObjectId.KM3_DERU01) { //ID 225 const b = await spawnObject(`/data/special_obj/km3_deru01/km3_deru01.bmd`); } else if (objectId === ObjectId.KM3_DERU02) { //ID 226 const b = await spawnObject(`/data/special_obj/km3_deru02/km3_deru02.bmd`); } else if (objectId === ObjectId.KM3_KAITENDAI) { //ID 227 const b = await spawnObject(`/data/special_obj/km3_kaitendai/km3_kaitendai.bmd`); } else if (objectId === ObjectId.C0_SWITCH) { //ID 228 const b = await spawnObject(`/data/special_obj/c0_switch/c0_switch.bmd`); } else if (objectId === ObjectId.SM_LIFT) { //ID 229 const b = await spawnObject(`/data/special_obj/sm_lift/sm_lift.bmd`); } else if (objectId === ObjectId.FL_MARUTA) { //ID 230 const b = await spawnObject(`/data/special_obj/fl_log/fl_log.bmd`); } else if (objectId === ObjectId.UDLIFT_TERESA) { //ID 231 const b = await spawnObject(`/data/special_obj/th_lift/th_lift.bmd`); } else if (objectId === ObjectId.UDLIFT) { //ID 232 const b = await spawnObject(`/data/special_obj/cv_ud_lift/cv_ud_lift.bmd`); } else if (objectId === ObjectId.RC_RIFT02) { //ID 233 const b = await spawnObject(`/data/special_obj/rc_rift02/rc_rift02.bmd`); } else if (objectId === ObjectId.BAKUBAKU) { //ID 234 const b = await spawnObject(`/data/enemy/bakubaku/bakubaku.bmd`); await bindBCA(b, '/data/enemy/bakubaku/bakubaku_swim.bca'); } else if (objectId === ObjectId.KM3_LIFT) { //ID 235 const b = await spawnObject(`/data/special_obj/km3_rift/km3_rift.bmd`); } else if (objectId === ObjectId.KIRAI) { //ID 236 const b = await spawnObject(`/data/enemy/koopa_bomb/koopa_bomb.bmd`); } else if (objectId === ObjectId.MIP) { //ID 237 const b = await spawnObject(`/data/enemy/mip/mip.bmd`); await bindBCA(b, '/data/enemy/mip/mip_wait.bca'); } else if (objectId === ObjectId.OWL) { //ID 239 const b = await spawnObject(`/data/enemy/owl/owl.bmd`); await bindBCA(b, '/data/enemy/owl/owl_fly_free.bca'); } else if (objectId === ObjectId.DONKETU) { //ID 240 const b = await spawnObject(`/data/enemy/donketu/donketu.bmd`); await bindBCA(b, '/data/enemy/donketu/donketu_walk.bca'); } else if (objectId === ObjectId.BOSS_DONKETU) { //ID 241 const b = await spawnObject(`/data/enemy/donketu/boss_donketu.bmd`); mat4.translate(b.modelMatrix, b.modelMatrix, [0, 10, 0]); await bindBCA(b, '/data/enemy/donketu/donketu_walk.bca'); } else if (objectId === ObjectId.ONIMASU) { //ID 242 const b = await spawnObject(`/data/enemy/onimasu/onimasu.bmd`); mat4.translate(b.modelMatrix, b.modelMatrix, [0, 32, 0]); } else if (objectId === ObjectId.BAR) { //ID 243 // Invisible } else if (objectId === ObjectId.C_JUGEM) { //ID 244 const b = await spawnObject(`/data/enemy/c_jugem/c_jugem.bmd`); await bindBCA(b, '/data/enemy/c_jugem/c_jugem_wait.bca'); } else if (objectId === ObjectId.PUSHBLOCK) { //ID 245 const b = await spawnObject(`/data/normal_obj/obj_pushblock/obj_pushblock.bmd`); } else if (objectId === ObjectId.FL_AMILIFT) { //ID 246 const b = await spawnObject(`/data/special_obj/fl_amilift/fl_amilift.bmd`); } else if (objectId === ObjectId.YUREI_MUCHO) { //ID 247 const b = await spawnObject(`/data/enemy/yurei_mucho/yurei_mucho.bmd`); await bindBCA(b, '/data/enemy/yurei_mucho/yurei_mucho_wait.bca'); } else if (objectId === ObjectId.CHOROPU) { //ID 248 const b = await spawnObject(`/data/enemy/choropu/choropu.bmd`); await bindBCA(b, '/data/enemy/choropu/choropu_search.bca'); } else if (objectId === ObjectId.BASABASA) { //ID 250 const b = await spawnObject(`/data/enemy/basabasa/basabasa.bmd`); await bindBCA(b, '/data/enemy/basabasa/basabasa_wait.bca'); } else if (objectId === ObjectId.POPOI) { //ID 251 const b = await spawnObject(`/data/enemy/popoi/popoi.bmd`); await bindBCA(b, '/data/enemy/popoi/popoi_move1.bca'); } else if (objectId === ObjectId.JANGO) { //ID 252 const b = await spawnObject(`/data/enemy/jango/jango.bmd`); await bindBCA(b, '/data/enemy/jango/jango_fly.bca'); } else if (objectId === ObjectId.SANBO) { //ID 253 const bodyData = await modelCache.fetchModel(device, `/data/enemy/sanbo/sanbo_body.bmd`); const headData = await modelCache.fetchModel(device, `/data/enemy/sanbo/sanbo_head.bmd`); const b = new Sanbo(bodyData, headData); this.modelMatrixFromObjectAndScale(b.modelMatrix, object, 0.8); renderer.objectRenderers.push(b); } else if (objectId === ObjectId.OBJ_MARIO_CAP) { //ID 254 // TODO: Find models, distinction between M/L/W } else if (objectId === ObjectId.FL_PUZZLE) { //ID 255 const npart = clamp((object.Parameters[0] & 0xFF), 0, 13); const b = await spawnObject(`/data/special_obj/fl_puzzle/fl_14_${leftPad(''+npart, 2)}.bmd`); } else if (objectId === ObjectId.FL_COIN) { //ID 256 // Invisible } else if (objectId === ObjectId.DOSSY) { //ID 257 const b = await spawnObject(`/data/enemy/dossy/dossy.bmd`); await bindBCA(b, '/data/enemy/dossy/dossy_swim.bca'); } else if (objectId === ObjectId.DOSSY_CAP) { //ID 258 // TODO: Find model } else if (objectId === ObjectId.HUWAHUWA) { //ID 259 const b = await spawnObject(`/data/enemy/huwahuwa/huwahuwa_model.bmd`); await bindBCA(b, '/data/enemy/huwahuwa/huwahuwa_move.bca'); } else if (objectId === ObjectId.SLIDE_BOX) { //ID 260 const b = await spawnObject(`/data/special_obj/ki_slide_box/ki_slide_box.bmd`); } else if (objectId === ObjectId.MORAY) { //ID 261 const b = await spawnObject(`/data/enemy/moray/moray.bmd`); await bindBCA(b, '/data/enemy/moray/moray_swim.bca'); } else if (objectId === ObjectId.OBJ_KUMO) { //ID 262 const b = await spawnObject(`/data/normal_obj/obj_kumo/obj_kumo.bmd`); } else if (objectId === ObjectId.OBJ_SHELL) { //ID 263 const b = await spawnObject(`/data/normal_obj/obj_shell/obj_shell.bmd`); await bindBCA(b, '/data/normal_obj/obj_shell/obj_shell_open.bca'); } else if (objectId === ObjectId.OBJ_RED_FIRE) { //ID 264 //TODO } else if (objectId === ObjectId.OBJ_BLUE_FIRE) { //ID 265 //TODO } else if (objectId === ObjectId.OBJ_FLAMETHROWER) { //ID 266 //TODO? } else if (objectId === ObjectId.KINOKO_CREATE_TAG) { //ID 267 //Invisible(?) } else if (objectId === ObjectId.KINOKO_TAG) { //ID 268 //Invisible(?) } else if (objectId === ObjectId.BLK_OKINOKO_TAG) { //ID 269 // Invisible } else if (objectId === ObjectId.BLK_SKINOKO_TAG) { //ID 270 // Invisible } else if (objectId === ObjectId.BLK_GNSHELL_TAG) { //ID 271 // Invisible } else if (objectId === ObjectId.BLK_SLVSTAR_TAG) { //ID 272 // Invisible } else if (objectId === ObjectId.C1_TRAP) { //ID 273 const right = await spawnObject(`/data/special_obj/c1_trap/c1_trap.bmd`); const left = await spawnObject(`/data/special_obj/c1_trap/c1_trap.bmd`); mat4.translate(left.modelMatrix, left.modelMatrix, [-44, 0, 0]); } else if (objectId === ObjectId.C1_PEACH) { //ID 275 const b = await spawnObject(`/data/special_obj/c1_peach/c1_peach.bmd`); } else if (objectId === ObjectId.RC_CARPET) { //ID 276 const b = await spawnObject(`/data/special_obj/rc_carpet/rc_carpet.bmd`); await bindBCA(b, '/data/special_obj/rc_carpet/rc_carpet_wait.bca'); } else if (objectId === ObjectId.IWANTE) { //ID 279 const b = await spawnObject(`/data/enemy/iwante/iwante_dummy.bmd`); } else if (objectId === ObjectId.HANACHAN) { //ID 280 const head = await spawnObject(`/data/enemy/hanachan/hanachan_head.bmd`); const body1 = await spawnObject(`/data/enemy/hanachan/hanachan_body01.bmd`); const body2 = await spawnObject(`/data/enemy/hanachan/hanachan_body02.bmd`); const body3 = await spawnObject(`/data/enemy/hanachan/hanachan_body03.bmd`); const body4 = await spawnObject(`/data/enemy/hanachan/hanachan_body04.bmd`); mat4.translate(head.modelMatrix, head.modelMatrix, [0, 16, -5]); mat4.translate(body1.modelMatrix, body1.modelMatrix, [0, 16, -15]); mat4.translate(body2.modelMatrix, body2.modelMatrix, [0, 16, -30]); mat4.translate(body3.modelMatrix, body3.modelMatrix, [0, 16, -45]); mat4.translate(body4.modelMatrix, body4.modelMatrix, [0, 16, -60]); } else if (objectId === ObjectId.RACE_NOKO) { //ID 281 const b = await spawnObject(`/data/enemy/nokonoko/nokonoko.bmd`, 1); await bindBCA(b, '/data/enemy/nokonoko/nokonoko_wait1.bca'); } else if (objectId === ObjectId.RACE_FLAG) { //ID 282 const b = await spawnObject(`/data/normal_obj/obj_race_flag/obj_race_flag.bmd`); await bindBCA(b, '/data/normal_obj/obj_race_flag/obj_race_flag_wait.bca'); } else if (objectId === ObjectId.BLOCK_LL) { //ID 284 const b = await spawnObject(`/data/normal_obj/obj_block/broken_block_ll.bmd`); } else if (objectId === ObjectId.ICE_BLOCK_LL) { //ID 285 const b = await spawnObject(`/data/normal_obj/obj_block/ice_block_ll.bmd`); } else if (objectId === ObjectId.KILLER_BOOK) { //ID 287 // Invisible } else if (objectId === ObjectId.BOOK_GENERATOR) { //ID 288 // Invisible } else if (objectId === ObjectId.ICE_DONKETU) { //ID 290 const b = await spawnObject(`/data/enemy/donketu/ice_donketu.bmd`); await bindBCA(b, '/data/enemy/donketu/ice_donketu_walk.bca'); } else if (objectId === ObjectId.KING_DONKETU) { //ID 291 const b = await spawnObject(`/data/enemy/king_ice_donketu/king_ice_donketu_model.bmd`); await bindBCA(b, '/data/enemy/king_ice_donketu/king_ice_donketu_wait.bca'); } else if (objectId === ObjectId.TREASURE_BOX) { //ID 292 const b = await spawnObject(`/data/normal_obj/t_box/t_box.bmd`); await bindBCA(b, '/data/normal_obj/t_box/t_box_open.bca'); //can comment out when idle treasure box is no longer glitched } else if (objectId === ObjectId.MC_WATER) { //ID 293 const b = await spawnObject(`/data/special_obj/mc_water/mc_water.bmd`); } else if (objectId === ObjectId.CHAIR) { //ID 294 const b = await spawnObject(`/data/enemy/chair/chair.bmd`); } else if (objectId === ObjectId.MC_METALNET) { //ID 295 const b = await spawnObject(`/data/special_obj/mc_metalnet/mc_metalnet.bmd`); } else if (objectId === ObjectId.MC_DODAI) { //ID 296 const b = await spawnObject(`/data/special_obj/mc_dodai/mc_dodai.bmd`); } else if (objectId === ObjectId.MC_HAZAD) { //ID 297 const b = await spawnObject(`/data/special_obj/mc_hazad/mc_hazad.bmd`); } else if (objectId === ObjectId.MC_FLAG) { //ID 298 const b = await spawnObject(`/data/special_obj/mc_flag/mc_flag.bmd`); await bindBCA(b, '/data/special_obj/mc_flag/mc_flag_wait.bca'); } else if (objectId === ObjectId.DONKAKU) { //ID 299 const b = await spawnObject(`/data/enemy/donkaku/donkaku.bmd`); } else if (objectId === ObjectId.DONGURU) { //ID 300 const b = await spawnObject(`/data/enemy/donguru/donguru.bmd`); } else if (objectId === ObjectId.HOLHEI) { //ID 301 const b = await spawnObject(`/data/enemy/horuhei/horuhei.bmd`); await bindBCA(b, '/data/enemy/horuhei/horuhei_walk.bca'); } else if (objectId === ObjectId.SCALEUP_KINOKO) { //ID 302 const b = await spawnObject(`/data/normal_obj/scale_up_kinoko/scale_up_kinoko.bmd`); } else if (objectId === ObjectId.C0_WATER) { //ID 303 const b = await spawnObject(`/data/special_obj/c0_water/c0_water.bmd`); } else if (objectId === ObjectId.SECRET_COIN) { //ID 304 // Invisible } else if (objectId === ObjectId.BC_SWITCH) { //ID 305 const b = await spawnObject(`/data/normal_obj/b_coin_switch/b_coin_switch.bmd`); } else if (objectId === ObjectId.BUBBLE) { //ID 307 //TODO? } else if (objectId === ObjectId.STAR_CREATE) { //ID 308 // Invisible } else if (objectId === ObjectId.SLIDER_MANAGER) { //ID 309 // Invisible } else if (objectId === ObjectId.FIREPAKUN) { //ID 312 const b = await spawnObject(`/data/enemy/pakkun/pakkun_model.bmd`, 2); await bindBCA(b, '/data/enemy/pakkun/pakkun_attack.bca'); } else if (objectId === ObjectId.FIREPAKUN_S) { //ID 313 const b = await spawnObject(`/data/enemy/pakkun/pakkun_model.bmd`, 0.5); await bindBCA(b, '/data/enemy/pakkun/pakkun_attack.bca'); } else if (objectId === ObjectId.PAKUN2) { //ID 314 const b = await spawnObject(`/data/enemy/pakkun/pakkun_model.bmd`); await bindBCA(b, '/data/enemy/pakkun/pakkun_attack.bca'); } else if (objectId === ObjectId.ENEMY_SWITCH) { //ID 315 // Invisible } else if (objectId === ObjectId.ENEMY_CREATE) { //ID 316 // Invisible } else if (objectId === ObjectId.WATER_HAKIDASI) { //ID 317 // Invisible } else if (objectId === ObjectId.WATER_TATUMAKI) { //ID 318 const b = await spawnObject(`/data/normal_obj/water_tatumaki/water_tatumaki.bmd`); await bindBCA(b, '/data/normal_obj/water_tatumaki/water_tatumaki.bca'); } else if (objectId === ObjectId.TORNADO) { //ID 320 const b = await spawnObject(`/data/enemy/sand_tornado/sand_tornado.bmd`); await bindBCA(b, '/data/enemy/sand_tornado/sand_tornado.bca'); } else if (objectId === ObjectId.LUIGI) { //ID 322 // Invisible } else if (objectId === ObjectId.SET_SE) { //ID 323 // Invisible } else if (objectId === ObjectId.MUGEN_BGM) { //ID 324 // Invisible } else if (objectId === ObjectId.TRG_MINIMAP_CHANGE) { //ID 511(?) // Invisible } else { console.warn(`Unknown object type ${object.ObjectId} / ${ObjectId[object.ObjectId]}`); } } private async _createBMDRendererForDoorObject(device: GfxDevice, renderer: SM64DSRenderer, object: CRG1DoorObject): Promise<void> { const spawnObject = async (filename: string, extraRotationY: number = 0) => { const b = await this._createBMDObjRenderer(device, renderer, filename); const scale = 0.8; this.modelMatrixFromObjectAndScale(b.modelMatrix, object, scale, extraRotationY); }; if (object.DoorType === DoorType.PLANE) { // TODO(jstpierre) } else if (object.DoorType === DoorType.DOOR_NORMAL) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); } else if (object.DoorType === DoorType.DOOR_STAR) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_star.bmd'); } else if (object.DoorType === DoorType.DOOR_STAR_1_0) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_star1.bmd'); } else if (object.DoorType === DoorType.DOOR_STAR_3_0) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_star3.bmd'); } else if (object.DoorType === DoorType.DOOR_STAR_10) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_star10.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_0) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_1) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } else if (object.DoorType === DoorType.STAR_GATE_0) { await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 0); await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 180); } else if (object.DoorType === DoorType.STAR_GATE_1) { await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 0); await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 180); } else if (object.DoorType === DoorType.STAR_GATE_2) { await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 0); await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 180); } else if (object.DoorType === DoorType.STAR_GATE_3) { await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 0); await spawnObject('/data/normal_obj/stargate/obj_stargate.bmd', 180); } else if (object.DoorType === DoorType.DOOR_STAR_1_1) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_star1.bmd'); } else if (object.DoorType === DoorType.DOOR_STAR_3_1) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_star3.bmd'); } else if (object.DoorType === DoorType.DOOR_2_BORO) { await spawnObject('/data/normal_obj/door/obj_door2_boro.bmd'); } else if (object.DoorType === DoorType.DOOR_3_TETSU) { await spawnObject('/data/normal_obj/door/obj_door3_tetsu.bmd'); } else if (object.DoorType === DoorType.DOOR_4_YAMI) { await spawnObject('/data/normal_obj/door/obj_door4_yami.bmd'); } else if (object.DoorType === DoorType.DOOR_5_HORROR) { await spawnObject('/data/normal_obj/door/obj_door5_horror.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_2) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_3) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_4) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_5) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } else if (object.DoorType === DoorType.DOOR_KEYHOLE_6) { await spawnObject('/data/normal_obj/door/obj_door0.bmd'); await spawnObject('/data/normal_obj/door/obj_door0_keyhole.bmd'); } } private async _createBMDRendererForObject(device: GfxDevice, renderer: SM64DSRenderer, object: CRG1Object): Promise<void> { if (object.Type === 'Standard' || object.Type === 'Simple') return this._createBMDRendererForStandardObject(device, renderer, object); else if (object.Type === 'Door') return this._createBMDRendererForDoorObject(device, renderer, object); } public async createScene(device: GfxDevice, context: SceneContext): Promise<Viewer.SceneGfx> { const dataHolder = await context.dataShare.ensureObject<DataHolder>(`${pathBase}/DataHolder`, async () => { const dataFetcher = context.dataFetcher; const [crg1Buffer, ... narcBuffers] = await Promise.all([ // Increment this every time the format of the CRG1 changes dataFetcher.fetchData(`${pathBase}/sm64ds.crg1?cache_bust=0`), dataFetcher.fetchData(`${pathBase}/ARCHIVE/ar1.narc`), dataFetcher.fetchData(`${pathBase}/ARCHIVE/arc0.narc`), dataFetcher.fetchData(`${pathBase}/ARCHIVE/vs1.narc`), dataFetcher.fetchData(`${pathBase}/ARCHIVE/vs2.narc`), dataFetcher.fetchData(`${pathBase}/ARCHIVE/vs3.narc`), dataFetcher.fetchData(`${pathBase}/ARCHIVE/vs4.narc`), ]); const modelCache = new ModelCache(device, dataFetcher); const crg1 = BYML.parse<Sm64DSCRG1>(crg1Buffer, BYML.FileType.CRG1); for (let i = 0; i < narcBuffers.length; i++) modelCache.mountNARC(NARC.parse(narcBuffers[i])); const dataHolder = new DataHolder(crg1, modelCache); return dataHolder; }); const level = dataHolder.crg1.Levels[this.levelId]; const renderer = new SM64DSRenderer(device, dataHolder.modelCache, level); context.destroyablePool.push(renderer); this._createBMDRenderer(device, renderer, level.MapBmdFile, GLOBAL_SCALE, level, false); if (level.Background) { const vrbox = `/data/vrbox/vr${leftPad('' + level.Background, 2, '0')}.bmd`; this._createBMDRenderer(device, renderer, vrbox, 0.8, level, true); } const promises: Promise<void>[] = []; for (let i = 0; i < level.Objects.length; i++) promises.push(this._createBMDRendererForObject(device, renderer, level.Objects[i])); await dataHolder.modelCache.waitForLoad(); await Promise.all(promises); return renderer; } } const id = "sm64ds"; const name = "Super Mario 64 DS"; const sceneDescs = [ "Mushroom Castle", new SM64DSSceneDesc(1, "Outdoor Gardens"), new SM64DSSceneDesc(2, "Main Foyer"), new SM64DSSceneDesc(4, "Basement"), new SM64DSSceneDesc(5, "Upstairs"), new SM64DSSceneDesc(3, "Courtyard"), new SM64DSSceneDesc(50, "Rec Room"), "First Floor Courses", new SM64DSSceneDesc(6, 'Bob-omb Battlefield'), new SM64DSSceneDesc(7, "Whomp's Fortress"), new SM64DSSceneDesc(8, "Jolly Roger Bay"), new SM64DSSceneDesc(9, "Jolly Roger Bay (Inside the Ship)"), new SM64DSSceneDesc(10, "Cool, Cool Mountain"), new SM64DSSceneDesc(11, "Cool, Cool Mountain (Inside the Slide)"), new SM64DSSceneDesc(12, "Big Boo's Haunt"), "Basement Courses", new SM64DSSceneDesc(13, "Hazy Maze Cave"), new SM64DSSceneDesc(14, "Lethal Lava Land"), new SM64DSSceneDesc(15, "Lethal Lava Land (Inside the Volcano)"), new SM64DSSceneDesc(16, "Shifting Sand Land"), new SM64DSSceneDesc(17, "Shifting Sand Land (Inside the Pyramid)"), new SM64DSSceneDesc(18, "Dire, Dire Docks"), "Second Floor Courses", new SM64DSSceneDesc(19, "Snowman's Land"), new SM64DSSceneDesc(20, "Snowman's Land (Inside the Igloo)"), new SM64DSSceneDesc(21, "Wet-Dry World"), new SM64DSSceneDesc(22, "Tall Tall Mountain"), new SM64DSSceneDesc(23, "Tall Tall Mountain (Inside the Slide)"), new SM64DSSceneDesc(25, "Tiny-Huge Island (Tiny)"), new SM64DSSceneDesc(24, "Tiny-Huge Island (Huge)"), new SM64DSSceneDesc(26, "Tiny-Huge Island (Inside Wiggler's Cavern)"), "Third Floor Courses", new SM64DSSceneDesc(27, "Tick Tock Clock"), new SM64DSSceneDesc(28, "Rainbow Ride"), "Bowser Levels", new SM64DSSceneDesc(35, "Bowser in the Dark World"), new SM64DSSceneDesc(36, "Bowser in the Dark World (Boss Arena)"), new SM64DSSceneDesc(37, "Bowser in the Fire Sea"), new SM64DSSceneDesc(38, "Bowser in the Fire Sea (Boss Arena)"), new SM64DSSceneDesc(39, "Bowser in the Sky"), new SM64DSSceneDesc(40, "Bowser in the Sky (Boss Arena)"), "Secret Levels", new SM64DSSceneDesc(29, "The Princess's Secret Slide"), new SM64DSSceneDesc(30, "The Secret Aquarium"), new SM64DSSceneDesc(34, "Wing Mario over the Rainbow"), new SM64DSSceneDesc(31, "Tower of the Wing Cap"), new SM64DSSceneDesc(32, "Vanish Cap Under the Moat"), new SM64DSSceneDesc(33, "Cavern of the Metal Cap"), "Extra DS Levels", new SM64DSSceneDesc(46, "Big Boo Battle"), new SM64DSSceneDesc(47, "Big Boo Battle (Boss Arena)"), new SM64DSSceneDesc(44, "Goomboss Battle"), new SM64DSSceneDesc(45, "Goomboss Battle (Boss Arena)"), new SM64DSSceneDesc(48, "Chief Chilly Challenge"), new SM64DSSceneDesc(49, "Chief Chilly Challenge (Boss Arena)"), "VS Maps", new SM64DSSceneDesc(42, "The Secret of Battle Fort"), new SM64DSSceneDesc(43, "Sunshine Isles"), new SM64DSSceneDesc(51, "Castle Gardens"), "Unused Test Maps", new SM64DSSceneDesc(0, "Test Map A"), new SM64DSSceneDesc(41, "Test Map B"), ]; export const sceneGroup: Viewer.SceneGroup = { id, name, sceneDescs }; ```
/content/code_sandbox/src/SuperMario64DS/scenes.ts
xml
2016-10-06T21:43:45
2024-08-16T17:03:52
noclip.website
magcius/noclip.website
3,206
27,504
```xml /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at path_to_url */ import {Directive, Output, Input, EventEmitter, AfterContentInit, OnDestroy} from '@angular/core'; import {Direction, Directionality, _resolveDirectionality} from './directionality'; /** * Directive to listen for changes of direction of part of the DOM. * * Provides itself as Directionality such that descendant directives only need to ever inject * Directionality to get the closest direction. */ @Directive({ selector: '[dir]', providers: [{provide: Directionality, useExisting: Dir}], host: {'[attr.dir]': '_rawDir'}, exportAs: 'dir', standalone: true, }) export class Dir implements Directionality, AfterContentInit, OnDestroy { /** Normalized direction that accounts for invalid/unsupported values. */ private _dir: Direction = 'ltr'; /** Whether the `value` has been set to its initial value. */ private _isInitialized: boolean = false; /** Direction as passed in by the consumer. */ _rawDir: string; /** Event emitted when the direction changes. */ @Output('dirChange') readonly change = new EventEmitter<Direction>(); /** @docs-private */ @Input() get dir(): Direction { return this._dir; } set dir(value: Direction | 'auto') { const previousValue = this._dir; // Note: `_resolveDirectionality` resolves the language based on the browser's language, // whereas the browser does it based on the content of the element. Since doing so based // on the content can be expensive, for now we're doing the simpler matching. this._dir = _resolveDirectionality(value); this._rawDir = value; if (previousValue !== this._dir && this._isInitialized) { this.change.emit(this._dir); } } /** Current layout direction of the element. */ get value(): Direction { return this.dir; } /** Initialize once default value has been set. */ ngAfterContentInit() { this._isInitialized = true; } ngOnDestroy() { this.change.complete(); } } ```
/content/code_sandbox/src/cdk/bidi/dir.ts
xml
2016-01-04T18:50:02
2024-08-16T11:21:13
components
angular/components
24,263
482
```xml /// <reference types="../../../../types/cypress" /> // Components import { VAppBar } from '..' import { VLayout } from '@/components/VLayout' import { VMain } from '@/components/VMain' // Utilities import { ref } from 'vue' // Constants const SCROLL_OPTIONS = { ensureScrollable: true, duration: 50 } describe('VAppBar', () => { it('allows custom height', () => { cy .mount(({ height }: any) => ( <VLayout> <VAppBar height={ height } /> </VLayout> )) .get('.v-app-bar').should('have.css', 'height', '64px') .setProps({ height: 128 }) .get('.v-app-bar').should('have.css', 'height', '128px') }) it('supports density', () => { cy .mount(({ density = 'default' }: any) => ( <VLayout> <VAppBar density={ density } /> </VLayout> )) .get('.v-app-bar').should('have.css', 'height', '64px') .setProps({ density: 'prominent' }) .get('.v-app-bar').should('have.css', 'height', '128px') .setProps({ density: 'comfortable' }) .get('.v-app-bar').should('have.css', 'height', '56px') .setProps({ density: 'compact' }) .get('.v-app-bar').should('have.css', 'height', '48px') }) it('is hidden on mount', () => { const model = ref(false) cy .mount(() => ( <VLayout> <VAppBar v-model={ model.value } /> </VLayout> )) .get('.v-app-bar') .should('not.be.visible') .then(() => (model.value = true)) .get('.v-app-bar') .should('be.visible') }) describe('scroll behavior', () => { it('hides', () => { cy.mount(({ scrollBehavior }: any) => ( <VLayout> <VAppBar scrollBehavior={ scrollBehavior } /> <VMain style="min-height: 200vh;" /> </VLayout> )) .setProps({ scrollBehavior: 'hide' }) .get('.v-app-bar').should('be.visible') .window().scrollTo(0, 500, SCROLL_OPTIONS) .get('.v-app-bar').should('not.be.visible') .window().scrollTo(0, 250, SCROLL_OPTIONS) .get('.v-app-bar').should('be.visible') .window().scrollTo(0, 0, SCROLL_OPTIONS) .get('.v-app-bar').should('be.visible') .setProps({ scrollBehavior: 'hide inverted' }) .get('.v-app-bar').should('not.be.visible') .window().scrollTo(0, 500, SCROLL_OPTIONS) .get('.v-app-bar').should('be.visible') .window().scrollTo(0, 250, SCROLL_OPTIONS) .get('.v-app-bar').should('not.be.visible') .window().scrollTo(0, 0, SCROLL_OPTIONS) .get('.v-app-bar').should('not.be.visible') }) it('should hide correctly when scroll to the bottom', () => { cy.mount(({ scrollBehavior }: any) => ( <VLayout> <VAppBar scrollBehavior={ scrollBehavior } /> <VMain style="min-height: 300px"> { Array.from({ length: 7 }, () => ( <div class="pa-16 ma-2 w-50 bg-green text-center"> box </div> )) } </VMain> </VLayout> )) .setProps({ scrollBehavior: 'hide' }) .get('.v-app-bar').should('be.visible') .window().scrollTo('bottom') .get('.v-app-bar').should('not.be.visible') }) it('collapses', () => { cy.mount(({ scrollBehavior }: any) => ( <VLayout> <VAppBar scrollBehavior={ scrollBehavior } /> <VMain style="min-height: 200vh;" /> </VLayout> )) .setProps({ scrollBehavior: 'collapse' }) .get('.v-app-bar').should('be.visible') .get('.v-app-bar').should('have.not.class', 'v-toolbar--collapse') .window().scrollTo(0, 500, SCROLL_OPTIONS) .get('.v-app-bar').should('have.class', 'v-toolbar--collapse') .window().scrollTo(0, 0, SCROLL_OPTIONS) .setProps({ scrollBehavior: 'collapse inverted' }) .get('.v-app-bar').should('be.visible') .get('.v-app-bar').should('have.class', 'v-toolbar--collapse') .window().scrollTo(0, 500, SCROLL_OPTIONS) .get('.v-app-bar').should('not.have.class', 'v-toolbar--collapse') .window().scrollTo(0, 0, SCROLL_OPTIONS) }) it('elevates', () => { cy.mount(({ scrollBehavior }: any) => ( <VLayout> <VAppBar scrollBehavior={ scrollBehavior } /> <VMain style="min-height: 200vh;" /> </VLayout> )) .setProps({ scrollBehavior: 'elevate' }) .get('.v-app-bar').should('have.class', 'v-toolbar--flat') .window().scrollTo(0, 500, SCROLL_OPTIONS) .get('.v-app-bar').should('not.have.class', 'v-toolbar--flat') .window().scrollTo(0, 0, SCROLL_OPTIONS) .setProps({ scrollBehavior: 'elevate inverted' }) .get('.v-app-bar').should('not.have.class', 'v-toolbar--flat') .window().scrollTo(0, 500, SCROLL_OPTIONS) .get('.v-app-bar').should('have.class', 'v-toolbar--flat') .window().scrollTo(0, 0, SCROLL_OPTIONS) }) it('fades image', () => { cy.mount(({ scrollBehavior, image }: any) => ( <VLayout> <VAppBar image={ image } scrollBehavior={ scrollBehavior } /> <VMain style="min-height: 200vh;" /> </VLayout> )) .setProps({ image: 'path_to_url scrollBehavior: 'fade-image', }) .get('.v-toolbar__image').should('have.css', 'opacity', '1') .window().scrollTo(0, 150, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '0.5') .window().scrollTo(0, 300, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '0') .window().scrollTo(0, 60, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '0.8') .window().scrollTo(0, 0, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '1') .setProps({ scrollBehavior: 'fade-image inverted' }) .get('.v-toolbar__image').should('have.css', 'opacity', '0') .window().scrollTo(0, 150, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '0.5') .window().scrollTo(0, 300, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '1') .window().scrollTo(0, 60, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '0.2') .window().scrollTo(0, 0, SCROLL_OPTIONS) .get('.v-toolbar__image').should('have.css', 'opacity', '0') }) }) }) ```
/content/code_sandbox/packages/vuetify/src/components/VAppBar/__tests__/VAppBar.spec.cy.tsx
xml
2016-09-12T00:39:35
2024-08-16T20:06:39
vuetify
vuetifyjs/vuetify
39,539
1,825
```xml import { unscramblePaperWalletMnemonic, scramblePaperWalletMnemonic, generateMnemonic, } from '../../utils/crypto'; import { PAPER_WALLET_WRITTEN_WORDS_COUNT } from '../../config/cryptoConfig'; type MnemonicsParams = { passphrase: string; // 9-word mnemonic scrambledInput: string; // 18-word scrambled mnemonic }; export const unscrambleMnemonics = ({ passphrase, scrambledInput, }: MnemonicsParams): Array<string> => unscramblePaperWalletMnemonic(passphrase, scrambledInput); export const scrambleMnemonics = ({ passphrase, scrambledInput, }: MnemonicsParams): Array<string> => scramblePaperWalletMnemonic(passphrase, scrambledInput); export const generateAccountMnemonics = ( numberOfWords: number ): Array<string> => generateMnemonic(numberOfWords).split(' '); export const generateAdditionalMnemonics = (): Array<string> => generateMnemonic(PAPER_WALLET_WRITTEN_WORDS_COUNT).split(' '); ```
/content/code_sandbox/source/renderer/app/api/utils/mnemonics.ts
xml
2016-10-05T13:48:54
2024-08-13T22:03:19
daedalus
input-output-hk/daedalus
1,230
228
```xml <?xml version="1.0" encoding="utf-8"?> <!-- path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --> <FrameLayout xmlns:android="path_to_url" xmlns:tools="path_to_url" android:layout_width="match_parent" android:layout_height="172dp"> <ImageView android:contentDescription="@string/cat_searchbar_nav_drawer_header_image_description" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:src="@drawable/cat_nav_drawer_header" tools:ignore="NewApi"/> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_gravity="bottom" android:orientation="vertical"> <ImageView android:contentDescription="@string/cat_searchbar_nav_drawer_avatar_image_description" android:layout_width="64dp" android:layout_height="64dp" android:layout_marginBottom="20dp" android:src="@drawable/cat_ic_avatar_72" tools:ignore="NewApi"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/cat_searchbar_nav_drawer_user" android:textColor="@color/design_default_color_on_primary"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:alpha="0.75" android:text="@string/cat_searchbar_nav_drawer_email" android:textColor="@color/design_default_color_on_primary"/> </LinearLayout> </FrameLayout> ```
/content/code_sandbox/catalog/java/io/material/catalog/search/res/layout/cat_search_nav_drawer_header.xml
xml
2016-12-05T16:11:29
2024-08-16T17:51:42
material-components-android
material-components/material-components-android
16,176
401
```xml /* * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ import { HttpClientModule } from "@angular/common/http"; import { type ComponentFixture, TestBed, tick, fakeAsync } from "@angular/core/testing"; import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; import { JobType } from "trafficops-types"; import { DeliveryServiceService, InvalidationJobService } from "src/app/api"; import { APITestingModule } from "src/app/api/testing"; import { NewInvalidationJobDialogComponent, sanitizedRegExpString, timeStringFromDate } from "./new-invalidation-job-dialog.component"; describe("NewInvalidationJobDialogComponent", () => { let component: NewInvalidationJobDialogComponent; let fixture: ComponentFixture<NewInvalidationJobDialogComponent>; const dialogRef = { close: jasmine.createSpy("dialog 'close' method", (): void => { /* Do nothing */ }) }; const dialogData = { dsID: -1 }; beforeEach(async () => { dialogRef.close = jasmine.createSpy("dialog 'close' method", (): void => { /* Do nothing */ }); await TestBed.configureTestingModule({ declarations: [ NewInvalidationJobDialogComponent ], imports: [ MatDialogModule, HttpClientModule, APITestingModule ], providers: [ {provide: MatDialogRef, useValue: dialogRef}, {provide: MAT_DIALOG_DATA, useValue: dialogData}, ] }).compileComponents(); const service = TestBed.inject(DeliveryServiceService); // TODO: These are never cleaned up (because the DS service doesn't have // a method for DS deletion) const ds = await service.createDeliveryService({ active: true, anonymousBlockingEnabled: false, cacheurl: null, cdnId: 2, displayName: "Test DS", dscp: 1, geoLimit: 0, geoProvider: 0, httpBypassFqdn: null, infoUrl: null, ipv6RoutingEnabled: true, logsEnabled: true, longDesc: "A DS for testing", missLat: 0, missLong: 0, multiSiteOrigin: false, regionalGeoBlocking: false, remapText: null, routingName: "test", tenantId: 1, typeId: 10, xmlId: "test-ds", }); if (ds.id === undefined) { return fail("created Delivery Service had no ID"); } dialogData.dsID = ds.id; fixture = TestBed.createComponent(NewInvalidationJobDialogComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it("should create", () => { expect(component).toBeTruthy(); }); it("closes the dialog", () => { expect(dialogRef.close).not.toHaveBeenCalled(); component.cancel(); expect(dialogRef.close).toHaveBeenCalled(); }); it("submits requests to create new Jobs, then closes the dialog", fakeAsync(() => { expect(dialogRef.close).not.toHaveBeenCalled(); component.onSubmit(new SubmitEvent("submit")); tick(); expect(dialogRef.close).toHaveBeenCalled(); const service = TestBed.inject(InvalidationJobService); expectAsync((async (): Promise<true> => { for (const j of await service.getInvalidationJobs()) { await service.deleteInvalidationJob(j.id); } return true; })()).toBeResolvedTo(true); })); it("updates the minimum starting time according to a newly selected starting date", () => { component.startDate = new Date(); component.startMin = new Date(); component.dateChange(); expect(component.startMinTime).toBe(timeStringFromDate(component.startMin)); component.startDate.setDate(component.startDate.getDate()+1); component.dateChange(); expect(component.startMinTime).toBe("00:00"); }); it("doesn't try to create the job when the regexp isn't valid", fakeAsync(() => { component.regexp.setValue("+\\y"); component.onSubmit(new SubmitEvent("submit")); tick(); expect(dialogRef.close).not.toHaveBeenCalled(); })); }); describe("NewInvalidationJobDialogComponent - editing", () => { let component: NewInvalidationJobDialogComponent; let fixture: ComponentFixture<NewInvalidationJobDialogComponent>; const dialogRef = { close: jasmine.createSpy("dialog 'close' method", (): void => { /* Do nothing */ }) }; const dialogData = { dsID: -1, job: { assetUrl: "path_to_url", id: -1, invalidationType: JobType.REFRESH, startTime: new Date(0), ttlHours: 178, } }; beforeEach(async () => { dialogRef.close = jasmine.createSpy("dialog 'close' method", (): void => { /* Do nothing */ }); await TestBed.configureTestingModule({ declarations: [ NewInvalidationJobDialogComponent ], imports: [ MatDialogModule, HttpClientModule, APITestingModule ], providers: [ {provide: MatDialogRef, useValue: dialogRef}, {provide: MAT_DIALOG_DATA, useValue: dialogData}, ] }).compileComponents(); const service = TestBed.inject(InvalidationJobService); const now = new Date(); const job = await service.createInvalidationJob({ deliveryService: "test-xmlid", invalidationType: JobType.REFRESH, regex: "/", startTime: new Date(now.setDate(now.getDate()+1)), ttlHours: 178 }); if (job.id === undefined) { return fail("created Content Invalidation Job had no ID"); } dialogData.job = job; fixture = TestBed.createComponent(NewInvalidationJobDialogComponent); component = fixture.componentInstance; fixture.detectChanges(); }); afterEach(async ()=>{ const service = TestBed.inject(InvalidationJobService); await service.deleteInvalidationJob(dialogData.job.id); expect((await service.getInvalidationJobs()).length).toBe(0); }); it("should create", () => { expect(component).toBeTruthy(); }); it("submits requests to create new Jobs, then closes the dialog", fakeAsync(() => { expect(dialogRef.close).not.toHaveBeenCalled(); component.onSubmit(new SubmitEvent("submit")); tick(); expect(dialogRef.close).toHaveBeenCalled(); })); }); describe("NewInvalidationJobDialogComponent utility functions", () => { it("gets a time string from a Date", ()=>{ const d = new Date(); d.setHours(0); d.setMinutes(0); expect(timeStringFromDate(d)).toBe("00:00"); d.setHours(12); d.setMinutes(34); expect(timeStringFromDate(d)).toBe("12:34"); }); it("sanitizes regular expressions", ()=>{ expect(sanitizedRegExpString(/\/.+\/my\/path\.jpg/)).toBe("/.+/my/path\\.jpg"); expect(sanitizedRegExpString(new RegExp("\\/path\\/to\\/content\\/.+\\.m3u8"))).toBe("/path/to/content/.+\\.m3u8"); }); }); ```
/content/code_sandbox/experimental/traffic-portal/src/app/core/deliveryservice/invalidation-jobs/new-invalidation-job-dialog/new-invalidation-job-dialog.component.spec.ts
xml
2016-09-02T07:00:06
2024-08-16T03:50:21
trafficcontrol
apache/trafficcontrol
1,043
1,603
```xml // // // Microsoft Bot Framework: path_to_url // // Bot Framework Emulator Github: // path_to_url // // All rights reserved. // // 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, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // import { beginAzureAuthWorkflow, sortExplorerContents, ArmTokenData, ConnectedServiceAction, ConnectedServicePayload, ConnectedServicePickerPayload, ServiceCodes, SharedConstants, SortCriteria, LAUNCH_CONNECTED_SERVICE_EDITOR, LAUNCH_CONNECTED_SERVICE_PICKER, LAUNCH_EXTERNAL_LINK, OPEN_ADD_CONNECTED_SERVICE_CONTEXT_MENU, OPEN_CONNECTED_SERVICE_SORT_CONTEXT_MENU, OPEN_CONTEXT_MENU_FOR_CONNECTED_SERVICE, OPEN_SERVICE_DEEP_LINK, OpenAddServiceContextMenuPayload, OpenSortContextMenuPayload, } from '@bfemulator/app-shared'; import { BotConfigWithPath, CommandServiceImpl, CommandServiceInstance } from '@bfemulator/sdk-shared'; import { BotConfigurationBase } from 'botframework-config/lib/botConfigurationBase'; import { IAzureService, IConnectedService, IGenericService, ILuisService, IQnAService, ServiceTypes, } from 'botframework-config/lib/schema'; import { call, ForkEffect, put, select, takeEvery, takeLatest } from 'redux-saga/effects'; import { DialogService } from '../../ui/dialogs/service'; import { serviceTypeLabels } from '../../utils/serviceTypeLables'; import { RootState } from '../store'; import { QnAMakerSampleHostname } from '../../constants'; import { AzureAuthSaga } from './azureAuthSaga'; declare interface ServicesPayload { services: IConnectedService[]; code: ServiceCodes; } const getArmTokenFromState = (state: RootState): ArmTokenData => state.azureAuth; const geBotConfigFromState = (state: RootState): BotConfigWithPath => state.bot.activeBot; const getSortSelection = (state: RootState): { [paneldId: string]: SortCriteria } => state.explorer.sortSelectionByPanelId; export class ServicesExplorerSagas { @CommandServiceInstance() protected static commandService: CommandServiceImpl; public static *launchConnectedServicePicker( action: ConnectedServiceAction<ConnectedServicePickerPayload> ): IterableIterator<any> { // To retrieve azure services, luis models and KBs, // we must have the authoring key. // To get the authoring key, we need the arm token. let armTokenData: ArmTokenData & number = yield select(getArmTokenFromState); if (!armTokenData || !armTokenData.access_token) { const { promptDialog, loginSuccessDialog, loginFailedDialog } = action.payload.azureAuthWorkflowComponents; armTokenData = yield* AzureAuthSaga.getArmToken( beginAzureAuthWorkflow( promptDialog, { serviceType: action.payload.serviceType }, loginSuccessDialog, loginFailedDialog ) ); } // 2 means the user has chosen to manually enter the connected service if (armTokenData === 2) { yield* ServicesExplorerSagas.launchConnectedServiceEditor(action); return; } if (!armTokenData || 'error' in armTokenData) { return null; // canceled or failed somewhere } // Add the authenticated user to the action since we now have the token const pJson = JSON.parse(atob(armTokenData.access_token.split('.')[1])); action.payload.authenticatedUser = pJson.upn || pJson.unique_name || pJson.name || pJson.email; const { serviceType, progressIndicatorComponent } = action.payload; if (progressIndicatorComponent) { DialogService.showDialog(progressIndicatorComponent).catch(); } const payload: ServicesPayload = yield* ServicesExplorerSagas.retrieveServicesByServiceType(serviceType); if (progressIndicatorComponent) { DialogService.hideDialog(); } if (payload.code !== ServiceCodes.OK || !payload.services.length) { const { getStartedDialog, authenticatedUser } = action.payload; const result = yield DialogService.showDialog(getStartedDialog, { serviceType, authenticatedUser, showNoModelsFoundContent: !payload.services.length, }); // Sign up with XXXX if (result === 1) { yield* ServicesExplorerSagas.launchExternalLink(action); } // Add services manually if (result === 2) { yield* ServicesExplorerSagas.launchConnectedServiceEditor(action); } } else { const servicesToAdd = yield* ServicesExplorerSagas.launchConnectedServicePickList( action, payload.services, serviceType ); if (servicesToAdd) { const botFile: BotConfigWithPath = yield select(geBotConfigFromState); botFile.services.push(...servicesToAdd); const { Bot } = SharedConstants.Commands; yield ServicesExplorerSagas.commandService.remoteCall(Bot.Save, botFile); } } } public static *launchConnectedServicePickList( action: ConnectedServiceAction<ConnectedServicePickerPayload>, availableServices: IConnectedService[], serviceType: ServiceTypes ): IterableIterator<any> { const { pickerComponent, authenticatedUser, serviceType: type } = action.payload; let result = yield DialogService.showDialog(pickerComponent, { availableServices, authenticatedUser, serviceType, }); if (result === 1) { action.payload.connectedService = BotConfigurationBase.serviceFromJSON({ type, hostname: QnAMakerSampleHostname, } as any); result = yield* ServicesExplorerSagas.launchConnectedServiceEditor(action); } return result; } public static *retrieveServicesByServiceType(serviceType: ServiceTypes): IterableIterator<any> { const armTokenData: ArmTokenData = yield select(getArmTokenFromState); if (!armTokenData || !armTokenData.access_token) { throw new Error('Auth credentials do not exist.'); } const { GetConnectedServicesByType } = SharedConstants.Commands.ConnectedService; let payload: ServicesPayload; try { payload = yield ServicesExplorerSagas.commandService.remoteCall( GetConnectedServicesByType, armTokenData.access_token, serviceType ); } catch (e) { payload = { services: [], code: ServiceCodes.Error }; } return payload; } // eslint-disable-next-line require-yield public static *openConnectedServiceDeepLink( action: ConnectedServiceAction<ConnectedServicePayload> ): IterableIterator<any> { const { connectedService } = action.payload; switch (connectedService.type) { case ServiceTypes.AppInsights: return ServicesExplorerSagas.openAzureProviderDeepLink( 'microsoft.insights/components', connectedService as IAzureService ); case ServiceTypes.BlobStorage: return ServicesExplorerSagas.openAzureProviderDeepLink( 'Microsoft.Storage/storageAccounts', connectedService as IAzureService ); case ServiceTypes.Bot: return ServicesExplorerSagas.openAzureProviderDeepLink( 'Microsoft.BotService/botServices', connectedService as IAzureService ); case ServiceTypes.CosmosDB: return ServicesExplorerSagas.openAzureProviderDeepLink( 'Microsoft.DocumentDb/databaseAccounts', connectedService as IAzureService ); case ServiceTypes.Generic: return window.open((connectedService as IGenericService).url); case ServiceTypes.Luis: return ServicesExplorerSagas.openLuisDeepLink(connectedService as ILuisService); case ServiceTypes.QnA: return ServicesExplorerSagas.openQnaMakerDeepLink(connectedService as IQnAService); default: return window.open('path_to_url } } public static *launchExternalLink(action: ConnectedServiceAction<ConnectedServicePayload>): IterableIterator<any> { const serviceType = action.payload.serviceType; switch (serviceType) { case ServiceTypes.QnA: yield call( [ServicesExplorerSagas.commandService, ServicesExplorerSagas.commandService.remoteCall], SharedConstants.Commands.Electron.OpenExternal, 'path_to_url ); break; case ServiceTypes.Dispatch: yield call( [ServicesExplorerSagas.commandService, ServicesExplorerSagas.commandService.remoteCall], SharedConstants.Commands.Electron.OpenExternal, 'path_to_url ); break; case ServiceTypes.Luis: yield call( [ServicesExplorerSagas.commandService, ServicesExplorerSagas.commandService.remoteCall], SharedConstants.Commands.Electron.OpenExternal, 'path_to_url ); break; case ServiceTypes.CosmosDB: yield call( [ServicesExplorerSagas.commandService, ServicesExplorerSagas.commandService.remoteCall], SharedConstants.Commands.Electron.OpenExternal, 'path_to_url ); break; default: return; } } public static *openContextMenuForService( action: ConnectedServiceAction<ConnectedServicePayload> ): IterableIterator<any> { const menuItems = [ { label: 'Manage service', id: 'open' }, { label: 'Edit configuration', id: 'edit' }, { label: 'Disconnect this service', id: 'forget' }, ]; const response = yield ServicesExplorerSagas.commandService.remoteCall( SharedConstants.Commands.Electron.DisplayContextMenu, menuItems ); const { connectedService } = action.payload; action.payload.serviceType = connectedService.type; switch (response.id) { case 'open': yield* ServicesExplorerSagas.openConnectedServiceDeepLink(action); break; case 'edit': yield* ServicesExplorerSagas.launchConnectedServiceEditor(action); break; case 'forget': yield* ServicesExplorerSagas.removeServiceFromActiveBot(connectedService); break; default: // canceled context menu return; } } public static *openAddConnectedServiceContextMenu( action: ConnectedServiceAction<OpenAddServiceContextMenuPayload> ): IterableIterator<any> { const { menuCoords, resolver } = action.payload; const menuItems = [ { label: 'Add Language Understanding (LUIS)', id: ServiceTypes.Luis }, { label: 'Add QnA Maker', id: ServiceTypes.QnA }, { label: 'Add Dispatch', id: ServiceTypes.Dispatch }, { type: 'separator' }, { label: 'Add Azure Cosmos DB account', id: ServiceTypes.CosmosDB }, { label: 'Add Azure Storage account', id: ServiceTypes.BlobStorage }, { label: 'Add Azure Application Insights', id: ServiceTypes.AppInsights }, { type: 'separator' }, { label: 'Add other service ', id: ServiceTypes.Generic }, ]; const response = yield ServicesExplorerSagas.commandService.remoteCall( SharedConstants.Commands.Electron.DisplayContextMenu, menuItems, menuCoords ); const { id: serviceType } = response; action.payload.serviceType = serviceType; if (serviceType === ServiceTypes.Generic || serviceType === ServiceTypes.AppInsights) { yield* ServicesExplorerSagas.launchConnectedServiceEditor(action); } else { yield* ServicesExplorerSagas.launchConnectedServicePicker(action); } resolver && resolver(); } public static *openSortContextMenu( action: ConnectedServiceAction<OpenSortContextMenuPayload> ): IterableIterator<any> { const { menuCoords } = action.payload; const sortSelectionByPanelId = yield select(getSortSelection); const currentSort = sortSelectionByPanelId[action.payload.panelId]; const menuItems = [ { label: 'Sort by name', id: 'name', type: 'checkbox', checked: currentSort === 'name', }, { label: 'Sort by type', id: 'type', type: 'checkbox', checked: currentSort === 'type', }, ]; const response = yield call( [ServicesExplorerSagas.commandService, ServicesExplorerSagas.commandService.remoteCall], SharedConstants.Commands.Electron.DisplayContextMenu, menuItems, menuCoords ); yield response.id ? put(sortExplorerContents(action.payload.panelId, response.id)) : null; } public static *removeServiceFromActiveBot(connectedService: IConnectedService): IterableIterator<any> { // TODO - localization const result = yield ServicesExplorerSagas.commandService.remoteCall( SharedConstants.Commands.Electron.ShowMessageBox, true, { type: 'question', buttons: ['Cancel', 'OK'], defaultId: 1, message: `Remove ${serviceTypeLabels[connectedService.type]} service: ${connectedService.name}. Are you sure?`, cancelId: 0, } ); if (result) { const { RemoveService } = SharedConstants.Commands.Bot; yield ServicesExplorerSagas.commandService.remoteCall(RemoveService, connectedService.type, connectedService.id); } } public static *launchConnectedServiceEditor( action: ConnectedServiceAction<ConnectedServicePayload> ): IterableIterator<any> { const { editorComponent, authenticatedUser, connectedService, serviceType } = action.payload; const servicesToUpdate: IConnectedService[] = yield DialogService.showDialog(editorComponent, { connectedService, authenticatedUser, serviceType, }); if (servicesToUpdate) { let i = servicesToUpdate.length; while (i--) { const service = servicesToUpdate[i]; yield ServicesExplorerSagas.commandService.remoteCall( SharedConstants.Commands.Bot.AddOrUpdateService, service.type, service ); } } return null; } public static openAzureProviderDeepLink(provider: string, azureService: IAzureService): void { const { tenantId, subscriptionId, resourceGroup, serviceName } = azureService; const bits = [ `path_to_url#@${tenantId}/resource/`, `subscriptions/${subscriptionId}/`, `resourceGroups/${encodeURI(resourceGroup)}/`, `providers/${provider}/${encodeURI(serviceName)}/overview`, ]; window.open(bits.join('')); } public static openLuisDeepLink(luisService: ILuisService) { const { appId, version, region } = luisService; let regionPrefix: string; switch (region) { case 'westeurope': regionPrefix = 'eu.'; break; case 'australiaeast': regionPrefix = 'au.'; break; default: regionPrefix = ''; break; } const linkArray = ['path_to_url `${encodeURI(regionPrefix)}`, 'luis.ai/applications/']; linkArray.push(`${encodeURI(appId)}`, '/versions/', `${encodeURI(version)}`, '/build'); const link = linkArray.join(''); window.open(link); } public static openQnaMakerDeepLink(service: IQnAService) { const { kbId } = service; const link = `path_to_url{encodeURIComponent(kbId)}`; window.open(link); } } export function* servicesExplorerSagas(): IterableIterator<ForkEffect> { yield takeLatest(LAUNCH_CONNECTED_SERVICE_PICKER, ServicesExplorerSagas.launchConnectedServicePicker); yield takeLatest(LAUNCH_CONNECTED_SERVICE_EDITOR, ServicesExplorerSagas.launchConnectedServiceEditor); yield takeEvery(LAUNCH_EXTERNAL_LINK, ServicesExplorerSagas.launchExternalLink); yield takeEvery(OPEN_SERVICE_DEEP_LINK, ServicesExplorerSagas.openConnectedServiceDeepLink); yield takeEvery(OPEN_CONTEXT_MENU_FOR_CONNECTED_SERVICE, ServicesExplorerSagas.openContextMenuForService); yield takeEvery(OPEN_ADD_CONNECTED_SERVICE_CONTEXT_MENU, ServicesExplorerSagas.openAddConnectedServiceContextMenu); yield takeEvery(OPEN_CONNECTED_SERVICE_SORT_CONTEXT_MENU, ServicesExplorerSagas.openSortContextMenu); } ```
/content/code_sandbox/packages/app/client/src/state/sagas/servicesExplorerSagas.ts
xml
2016-11-11T23:15:09
2024-08-16T12:45:29
BotFramework-Emulator
microsoft/BotFramework-Emulator
1,803
3,601
```xml /** @jsx jsx */ import { Node } from 'slate' import { jsx } from 'slate-hyperscript' export const input = ( <editor> <element> <text key="a" /> <text key="b" /> </element> </editor> ) export const test = value => { return Array.from(Node.descendants(value, { from: [0, 1] })) } export const output = [ [ <element> <text key="a" /> <text key="b" /> </element>, [0], ], [<text key="b" />, [0, 1]], ] ```
/content/code_sandbox/packages/slate/test/interfaces/Node/descendants/from.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
146
```xml import { useHistory } from 'react-router-dom'; import { c } from 'ttag'; import { useSecurityCheckup } from '@proton/components'; import { getFormattedValue } from '@proton/components/components/v2/phone/helper'; import { SECURITY_CHECKUP_PATHS } from '@proton/shared/lib/constants'; import { getIsPerfectEmailState, getIsPerfectPhoneState, getIsPerfectPhraseState, } from '@proton/shared/lib/helpers/securityCheckup'; import type { SecurityCheckupAction } from '@proton/shared/lib/interfaces/securityCheckup'; import SecurityCheckupCardButton, { SecurityCheckupCardButtonInner } from './components/SecurityCheckupCardButton'; import SecurityCheckupMainIcon from './components/SecurityCheckupMainIcon'; import { deviceIcon, emailIcon, phoneIcon, phraseIcon } from './methodIcons'; const PhraseAction = () => { const { securityState } = useSecurityCheckup(); const { phrase } = securityState; const isPerfectPhraseState = getIsPerfectPhraseState(securityState); const history = useHistory(); if (!phrase.isAvailable || isPerfectPhraseState) { return; } if (phrase.isOutdated) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.SET_PHRASE)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={phraseIcon} color="warning" />} title={c('Safety review').t`Update your Recovery Kit`} subTitle={c('Safety review').t`to recover your account and data if you're ever locked out`} /> </SecurityCheckupCardButton> ); } return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.SET_PHRASE)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={phraseIcon} color="danger" />} title={c('Safety review').t`Download your Recovery Kit`} subTitle={c('Safety review').t`to recover your account and data if you're ever locked out`} /> </SecurityCheckupCardButton> ); }; const EmailAction = () => { const { securityState } = useSecurityCheckup(); const { email } = securityState; const isPerfectEmailState = getIsPerfectEmailState(securityState); const history = useHistory(); if (isPerfectEmailState) { return; } if (!email.value) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.SET_EMAIL)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={emailIcon} color="danger" />} title={c('Safety review').t`Add a recovery email address`} subTitle={c('Safety review').t`to recover your account if you're ever locked out`} /> </SecurityCheckupCardButton> ); } if (!email.isEnabled) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.ENABLE_EMAIL)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={emailIcon} color="danger" />} title={c('Safety review').t`Enable recovery by email`} subTitle={email.value} /> </SecurityCheckupCardButton> ); } if (!email.verified) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.VERIFY_EMAIL)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={emailIcon} color="warning" />} title={c('Safety review').t`Verify your recovery email address`} subTitle={email.value} /> </SecurityCheckupCardButton> ); } return null; }; const PhoneAction = () => { const { securityState } = useSecurityCheckup(); const { phone } = securityState; const isPerfectPhoneState = getIsPerfectPhoneState(securityState); const history = useHistory(); if (isPerfectPhoneState) { return; } if (!phone.value) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.SET_PHONE)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={phoneIcon} color="danger" />} title={c('Safety review').t`Add a recovery phone number`} subTitle={c('Safety review').t`to recover your account if you're ever locked out`} /> </SecurityCheckupCardButton> ); } const formattedPhoneNumber = getFormattedValue(phone.value); if (!phone.isEnabled) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.ENABLE_PHONE)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={phoneIcon} color="danger" />} title={c('Safety review').t`Enable recovery by phone`} subTitle={formattedPhoneNumber} /> </SecurityCheckupCardButton> ); } if (!phone.verified) { return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.VERIFY_PHONE)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={phoneIcon} color="warning" />} title={c('Safety review').t`Verify your recovery phone number`} subTitle={formattedPhoneNumber} /> </SecurityCheckupCardButton> ); } return null; }; const DeviceAction = () => { const { securityState } = useSecurityCheckup(); const { deviceRecovery } = securityState; const history = useHistory(); if (!deviceRecovery.isAvailable || deviceRecovery.isEnabled) { return; } return ( <SecurityCheckupCardButton onClick={() => history.push(SECURITY_CHECKUP_PATHS.ENABLE_DEVICE_RECOVERY)}> <SecurityCheckupCardButtonInner prefix={<SecurityCheckupMainIcon className="self-start" icon={deviceIcon} color="danger" />} title={c('Safety review').t`Enable device-based recovery`} subTitle={c('Safety review').t`to automatically recover your data when you log into a trusted device`} /> </SecurityCheckupCardButton> ); }; const Actions = ({ actions }: { actions: SecurityCheckupAction[] }) => { if (!actions.length) { return; } return ( <div className="security-checkup-card-container"> {actions.map((action) => { if (action === 'phrase') { return <PhraseAction key="phrase-action" />; } if (action === 'email') { return <EmailAction key="email-action" />; } if (action === 'phone') { return <PhoneAction key="phone-action" />; } if (action === 'device') { return <DeviceAction key="device-action" />; } })} </div> ); }; export default Actions; ```
/content/code_sandbox/applications/account/src/app/containers/securityCheckup/Actions.tsx
xml
2016-06-08T11:16:51
2024-08-16T14:14:27
WebClients
ProtonMail/WebClients
4,300
1,582
```xml import supertest from 'supertest'; import { beforeEach, describe, expect, test } from 'vitest'; import { API_MESSAGE, HEADERS, HEADER_TYPE, HTTP_STATUS } from '@verdaccio/core'; import { getDisTags, initializeServer, publishVersion } from './_helper'; describe('package', () => { let app; beforeEach(async () => { app = await initializeServer('distTag.yaml'); }); test.each([['foo'], ['@scope/foo']])('should display dist-tag (npm dist-tag ls)', async (pkg) => { await publishVersion(app, pkg, '1.0.0'); await publishVersion(app, pkg, '1.0.1'); const response = await getDisTags(app, pkg); expect(response.body).toEqual({ latest: '1.0.1' }); }); test('should add a version to a tag (npm dist-tag add)', async () => { await publishVersion(app, encodeURIComponent('foo'), '1.0.0'); await publishVersion(app, encodeURIComponent('foo'), '1.0.1'); const response = await supertest(app) .put(`/${encodeURIComponent('foo')}/test`) .set(HEADERS.ACCEPT, HEADERS.GZIP) .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .send(JSON.stringify('1.0.1')) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET) .expect(HTTP_STATUS.CREATED); expect(response.body.ok).toEqual(API_MESSAGE.TAG_ADDED); const response2 = await getDisTags(app, 'foo'); expect(response2.body).toEqual({ latest: '1.0.1', test: '1.0.1' }); }); test('should fails if a version is missing (npm dist-tag add)', async () => { await publishVersion(app, encodeURIComponent('foo'), '1.0.0'); await publishVersion(app, encodeURIComponent('foo'), '1.0.1'); await supertest(app) .put(`/${encodeURIComponent('foo')}/test`) .set(HEADERS.ACCEPT, HEADERS.GZIP) .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .send(JSON.stringify({})) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET) .expect(HTTP_STATUS.BAD_REQUEST); }); test('should delete a previous added tag (npm dist-tag rm)', async () => { await publishVersion(app, encodeURIComponent('foo'), '1.0.0'); await publishVersion(app, encodeURIComponent('foo'), '1.0.1'); const response = await supertest(app) .put(`/${encodeURIComponent('foo')}/beta`) .set(HEADERS.ACCEPT, HEADERS.GZIP) .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .send(JSON.stringify('1.0.1')) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET) .expect(HTTP_STATUS.CREATED); expect(response.body.ok).toEqual(API_MESSAGE.TAG_ADDED); const response2 = await getDisTags(app, 'foo'); expect(response2.body).toEqual({ latest: '1.0.1', beta: '1.0.1' }); const response3 = await supertest(app) .delete(`/-/package/${encodeURIComponent('foo')}/dist-tags/beta`) .set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON) .expect(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON_CHARSET) .expect(HTTP_STATUS.CREATED); expect(response3.body.ok).toEqual(API_MESSAGE.TAG_REMOVED); const response4 = await getDisTags(app, 'foo'); expect(response4.body).toEqual({ latest: '1.0.1' }); }); }); ```
/content/code_sandbox/packages/api/test/integration/distTag.spec.ts
xml
2016-04-15T16:21:12
2024-08-16T09:38:01
verdaccio
verdaccio/verdaccio
16,189
818
```xml import { DecryptedTransferPayload, EncryptedTransferPayload } from '../TransferPayload' import { BackupFileDecryptedContextualPayload } from './BackupFileDecryptedContextualPayload' import { BackupFileEncryptedContextualPayload } from './BackupFileEncryptedContextualPayload' export function CreateEncryptedBackupFileContextPayload( fromPayload: EncryptedTransferPayload, ): BackupFileEncryptedContextualPayload { return { auth_hash: fromPayload.auth_hash, content_type: fromPayload.content_type, content: fromPayload.content, created_at_timestamp: fromPayload.created_at_timestamp, created_at: fromPayload.created_at, deleted: false, duplicate_of: fromPayload.duplicate_of, enc_item_key: fromPayload.enc_item_key, items_key_id: fromPayload.items_key_id, updated_at_timestamp: fromPayload.updated_at_timestamp, updated_at: fromPayload.updated_at, uuid: fromPayload.uuid, key_system_identifier: fromPayload.key_system_identifier, shared_vault_uuid: fromPayload.shared_vault_uuid, } } export function CreateDecryptedBackupFileContextPayload( fromPayload: DecryptedTransferPayload, ): BackupFileDecryptedContextualPayload { return { content_type: fromPayload.content_type, content: fromPayload.content, created_at_timestamp: fromPayload.created_at_timestamp, created_at: fromPayload.created_at, deleted: false, duplicate_of: fromPayload.duplicate_of, updated_at_timestamp: fromPayload.updated_at_timestamp, updated_at: fromPayload.updated_at, uuid: fromPayload.uuid, key_system_identifier: fromPayload.key_system_identifier, shared_vault_uuid: fromPayload.shared_vault_uuid, } } ```
/content/code_sandbox/packages/models/src/Domain/Abstract/Contextual/Functions.ts
xml
2016-12-05T23:31:33
2024-08-16T06:51:19
app
standardnotes/app
5,180
361
```xml export { FormSectionTitle } from './FormSectionTitle'; ```
/content/code_sandbox/app/react/components/form-components/FormSectionTitle/index.ts
xml
2016-05-19T20:15:28
2024-08-16T19:15:14
portainer
portainer/portainer
30,083
13
```xml // path_to_url type Tail<T extends Array<any>> = ((...t: T) => void) extends (h: any, ...rest: infer R) => void ? R : never; /** * Return a list of Args such that the corresponding value is undefined. * @example PartialArgs<[number, string, boolean], [number, undefined, undefined]> * equals to [string, boolean] * @example PartialArgs<[number, string, ...boolean[]], [undefined, string]> * equals to [number, ...boolean[]] */ type PartialArgs<Args extends any[], Values extends any[], Output extends any[] = []> = [] extends Values ? [...Output, ...Args] : undefined extends Values[0] ? PartialArgs<Tail<Args>, Tail<Values>, [...Output, Args[0]]> : PartialArgs<Tail<Args>, Tail<Values>, Output> declare function partial<Values extends any[], F extends (...args: any) => any> (func: F, ...args: Values) : (...args: PartialArgs<Parameters<F>, Values>) => ReturnType<F> export default partial ```
/content/code_sandbox/packages/function-partial/index.d.ts
xml
2016-06-26T02:04:54
2024-08-15T00:08:43
just
angus-c/just
5,974
244
```xml <?xml version="1.0" encoding="utf-8"?> <!-- --> <resources> <item name="toggle" type="id"/> <item name="checkbox" type="id"/> </resources> ```
/content/code_sandbox/modules/material-lists/src/androidMain/res/values/view_ids.xml
xml
2016-08-12T14:22:12
2024-08-13T16:15:24
Splitties
LouisCAD/Splitties
2,498
46
```xml <?xml version="1.0" encoding="UTF-8" ?> <definitions id="definitions" targetNamespace="path_to_url" xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:activiti="path_to_url" xmlns:cell="path_to_url"> <process id="testBatchDeleteOfTask"> <startEvent id="start"></startEvent> <sequenceFlow sourceRef="start" targetRef="multiInstance"></sequenceFlow> <userTask id="multiInstance"> <multiInstanceLoopCharacteristics> <loopCardinality>5</loopCardinality> <completionCondition>${1 == 1}</completionCondition> </multiInstanceLoopCharacteristics> </userTask> <sequenceFlow sourceRef="multiInstance" targetRef="end"></sequenceFlow> <endEvent id="end"></endEvent> </process> </definitions> ```
/content/code_sandbox/modules/flowable5-test/src/test/resources/org/activiti/engine/test/api/task/TaskBatchDeleteTest.testDeleteCancelledMultiInstanceTasks.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
193
```xml import type { Dictionary } from '@vercel/client'; // Converts `env` Arrays, Strings and Objects into env Objects. export const parseEnv = (env?: string | string[] | Dictionary<string>) => { if (!env) { return {}; } if (typeof env === 'string') { // a single `--env` arg comes in as a String env = [env]; } if (Array.isArray(env)) { const startingDict: Dictionary<string> = {}; return env.reduce((o, e) => { let key: string | undefined; let value: string | undefined; const equalsSign = e.indexOf('='); if (equalsSign === -1) { key = e; } else { key = e.slice(0, equalsSign); value = e.slice(equalsSign + 1); } if (typeof value !== 'undefined') { o[key] = value; } return o; }, startingDict); } // assume it's already an Object return env; }; ```
/content/code_sandbox/packages/cli/src/util/parse-env.ts
xml
2016-09-09T01:12:08
2024-08-16T17:39:45
vercel
vercel/vercel
12,545
230
```xml import ServerModule from '@gqlapp/module-server-ts'; import mailer from './mailer'; export { mailer }; export default new ServerModule({ createContextFunc: [() => ({ mailer })], }); ```
/content/code_sandbox/modules/mailer/server-ts/index.ts
xml
2016-09-08T16:44:45
2024-08-16T06:17:16
apollo-universal-starter-kit
sysgears/apollo-universal-starter-kit
1,684
44
```xml <?xml version="1.0" encoding="UTF-8"?> <bpmn2:definitions xmlns:xsi="path_to_url" xmlns:activiti="path_to_url" xmlns:bpmn2="path_to_url" xmlns:bpmndi="path_to_url" xmlns:dc="path_to_url" xmlns:di="path_to_url" xsi:schemaLocation="path_to_url BPMN20.xsd" id="Definitions_1" targetNamespace="path_to_url"> <bpmn2:process id="terminateEndEventSubprocessExample" name="Default Process"> <bpmn2:startEvent id="start"> <bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing> </bpmn2:startEvent> <bpmn2:endEvent id="EndEvent_2"> <bpmn2:incoming>SequenceFlow_2</bpmn2:incoming> <bpmn2:terminateEventDefinition id="TerminateEventDefinition_1" activiti:terminateAll="true" /> </bpmn2:endEvent> <bpmn2:parallelGateway id="ParallelGateway_1"> <bpmn2:incoming>SequenceFlow_1</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing> <bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing> </bpmn2:parallelGateway> <bpmn2:sequenceFlow id="SequenceFlow_1" sourceRef="start" targetRef="ParallelGateway_1"/> <bpmn2:sequenceFlow id="SequenceFlow_2" name="" sourceRef="ParallelGateway_1" targetRef="EndEvent_2"/> <bpmn2:userTask id="UserTask_1" name="User Task"> <bpmn2:incoming>SequenceFlow_3</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing> </bpmn2:userTask> <bpmn2:sequenceFlow id="SequenceFlow_3" sourceRef="ParallelGateway_1" targetRef="UserTask_1"/> <bpmn2:endEvent id="EndEvent_1"> <bpmn2:incoming>SequenceFlow_4</bpmn2:incoming> </bpmn2:endEvent> <bpmn2:sequenceFlow id="SequenceFlow_4" sourceRef="UserTask_1" targetRef="EndEvent_1"/> </bpmn2:process> <bpmndi:BPMNDiagram id="BPMNDiagram_1" name="Default Process Diagram"> <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process_1"> <bpmndi:BPMNShape id="BPMNShape_1" bpmnElement="start"> <dc:Bounds height="36.0" width="36.0" x="110.0" y="198.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BPMNShape_EndEvent_1" bpmnElement="EndEvent_2"> <dc:Bounds height="36.0" width="36.0" x="470.0" y="200.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="BPMNShape_ParallelGateway_1" bpmnElement="ParallelGateway_1"> <dc:Bounds height="50.0" width="50.0" x="196.0" y="191.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_1" targetElement="BPMNShape_ParallelGateway_1"> <di:waypoint xsi:type="dc:Point" x="146.0" y="216.0"/> <di:waypoint xsi:type="dc:Point" x="196.0" y="216.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_2" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_EndEvent_1"> <di:waypoint xsi:type="dc:Point" x="247.0" y="216.0"/> <di:waypoint xsi:type="dc:Point" x="470.0" y="218.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="BPMNShape_UserTask_1" bpmnElement="UserTask_1"> <dc:Bounds height="50.0" width="110.0" x="271.0" y="110.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="SequenceFlow_3" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_UserTask_1"> <di:waypoint xsi:type="dc:Point" x="221.0" y="191.0"/> <di:waypoint xsi:type="dc:Point" x="271.0" y="135.0"/> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="EndEvent_1"> <dc:Bounds height="36.0" width="36.0" x="431.0" y="117.0"/> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="SequenceFlow_4" sourceElement="BPMNShape_UserTask_1" targetElement="BPMNShape_EndEvent_2"> <di:waypoint xsi:type="dc:Point" x="381.0" y="135.0"/> <di:waypoint xsi:type="dc:Point" x="431.0" y="135.0"/> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn2:definitions> ```
/content/code_sandbox/modules/flowable5-test/src/test/resources/org/activiti/engine/test/bpmn/event/end/TerminateEndEventTest.subProcessConcurrentTerminateTerminateAll.bpmn20.xml
xml
2016-10-13T07:21:43
2024-08-16T15:23:14
flowable-engine
flowable/flowable-engine
7,715
1,486
```xml import chalk from 'chalk'; export function time(label?: string): void { console.time(label); } export function timeEnd(label?: string): void { console.timeEnd(label); } export function error(...message: string[]): void { console.error(...message); } /** Print an error and provide additional info (the stack trace) in debug mode. */ export function exception(e: Error): void { const { env } = require('./utils/env'); error(chalk.red(e.toString()) + (env.EXPO_DEBUG ? '\n' + chalk.gray(e.stack) : '')); } export function warn(...message: string[]): void { console.warn(...message.map((value) => chalk.yellow(value))); } export function log(...message: string[]): void { console.log(...message); } /** @deprecated use `debug` package with the `expo:` prefix instead. */ export function debug(...message: any[]): void { if (require('./utils/env').env.EXPO_DEBUG) console.log(...message); } /** Clear the terminal of all text. */ export function clear(): void { process.stdout.write(process.platform === 'win32' ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H'); } /** Log a message and exit the current process. If the `code` is non-zero then `console.error` will be used instead of `console.log`. */ export function exit(message: string | Error, code: number = 1): never { if (message instanceof Error) { exception(message); process.exit(code); } if (message) { if (code === 0) { log(message); } else { error(message); } } process.exit(code); } // The re-export makes auto importing easier. export const Log = { time, timeEnd, error, exception, warn, log, debug, clear, exit, }; ```
/content/code_sandbox/packages/@expo/cli/src/log.ts
xml
2016-08-15T17:14:25
2024-08-16T19:54:44
expo
expo/expo
32,004
421
```xml import { AppPage } from './app.po'; describe('angular-cli-libs-externas App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getParagraphText()).toEqual('Welcome to app!'); }); }); ```
/content/code_sandbox/angular-cli-libs-externas/e2e/app.e2e-spec.ts
xml
2016-07-02T18:58:48
2024-08-15T23:36:46
curso-angular
loiane/curso-angular
1,910
77
```xml export { PRICING } from "./constants/pricing"; export { PricingTable } from "./components/PricingTable"; export { PricingModal } from "./components/PricingModal"; export { UpgradeWorkspaceMenu } from "./components/UpgradeWorkspaceMenu"; export { PremiumFeature } from "./components/PremiumFeature"; export { PricingFeatures } from "./constants/pricingFeatures"; export { PricingPlans } from "./constants/pricingPlans"; ```
/content/code_sandbox/app/src/features/pricing/index.ts
xml
2016-12-01T04:36:06
2024-08-16T19:12:19
requestly
requestly/requestly
2,121
87
```xml import { pxToRem } from '../../../../utils'; import { SiteVariablesPrepared } from '@fluentui/styles'; export interface SliderVariables { height: string; length: string; railColor: string; railHeight: string; disabledRailColor: string; thumbColor: string; activeThumbColor: string; disabledThumbColor: string; thumbHeight: string; activeThumbHeight: string; thumbBorderPadding: string; thumbWidth: string; activeThumbWidth: string; trackColor: string; disabledTrackColor: string; } export const sliderVariables = (siteVars: SiteVariablesPrepared): SliderVariables => { const { colorScheme } = siteVars; return { height: pxToRem(16), length: pxToRem(320), railColor: colorScheme.default.border, disabledRailColor: colorScheme.default.backgroundDisabled1, railHeight: pxToRem(2), thumbColor: colorScheme.default.foreground2, activeThumbColor: colorScheme.default.foreground1, disabledThumbColor: colorScheme.default.foregroundDisabled1, thumbHeight: pxToRem(10), activeThumbHeight: pxToRem(14), thumbBorderPadding: pxToRem(4), thumbWidth: pxToRem(10), activeThumbWidth: pxToRem(14), trackColor: colorScheme.brand.foregroundActive, disabledTrackColor: colorScheme.default.foregroundDisabled1, }; }; ```
/content/code_sandbox/packages/fluentui/react-northstar/src/themes/teams/components/Slider/sliderVariables.ts
xml
2016-06-06T15:03:44
2024-08-16T18:49:29
fluentui
microsoft/fluentui
18,221
322
```xml declare interface IComboChartDemoWebPartStrings { ChartTitle: string; DataSetLabel: string; ChartLabels: string[]; RandomizeCommandLabel: string; WebPartDescription: string; MoreInfoLinkUrl: string; } declare module 'ComboChartDemoWebPartStrings' { const strings: IComboChartDemoWebPartStrings; export = strings; } ```
/content/code_sandbox/samples/react-chartcontrol/src/webparts/comboChartDemo/loc/mystrings.d.ts
xml
2016-08-30T17:21:43
2024-08-16T18:41:32
sp-dev-fx-webparts
pnp/sp-dev-fx-webparts
2,027
82
```xml import { CameraType } from '@antv/g'; import { Renderer as WebGLRenderer } from '@antv/g-webgl'; import { Plugin as ThreeDPlugin, DirectionalLight } from '@antv/g-plugin-3d'; import { Plugin as ControlPlugin } from '@antv/g-plugin-control'; import { threedlib } from '@antv/g2-extension-3d'; import { Runtime, extend } from '../../../src/api'; import { corelib } from '../../../src/lib'; export function chart3d(context) { const { container } = context; // Create a WebGL renderer. const renderer = new WebGLRenderer(); renderer.registerPlugin(new ThreeDPlugin()); renderer.registerPlugin(new ControlPlugin()); const Chart = extend(Runtime, { ...corelib(), ...threedlib() }); const chart = new Chart({ container, renderer, depth: 400, }); chart .point3D() .data({ type: 'fetch', value: 'data/cars2.csv', }) .encode('x', 'Horsepower') .encode('y', 'Miles_per_Gallon') .encode('z', 'Weight_in_lbs') .encode('size', 'Origin') .encode('color', 'Cylinders') .encode('shape', 'cube') .coordinate({ type: 'cartesian3D' }) .scale('x', { nice: true }) .scale('y', { nice: true }) .scale('z', { nice: true }) .legend(false) .axis('x', { gridLineWidth: 2 }) .axis('y', { gridLineWidth: 2, titleBillboardRotation: -Math.PI / 2 }) .axis('z', { gridLineWidth: 2 }); const finished = chart.render().then(() => { const { canvas } = chart.getContext(); const camera = canvas!.getCamera(); camera.setType(CameraType.ORBITING); camera.rotate(-20, -20, 0); // Add a directional light into scene. const light = new DirectionalLight({ style: { intensity: 2.5, fill: 'white', direction: [-1, 0, 1], }, }); canvas!.appendChild(light); }); return { finished }; } chart3d.skip = true; ```
/content/code_sandbox/__tests__/plots/api/chart-3d.ts
xml
2016-05-26T09:21:04
2024-08-15T16:11:17
G2
antvis/G2
12,060
510
```xml import StockData from '../StockData'; import HammerPattern from './HammerPattern'; export default class HammerPatternUnconfirmed extends HammerPattern { constructor(); logic(data: StockData): boolean; } export declare function hammerpatternunconfirmed(data: StockData): any; ```
/content/code_sandbox/declarations/candlestick/HammerPatternUnconfirmed.d.ts
xml
2016-05-02T19:16:32
2024-08-15T14:25:09
technicalindicators
anandanand84/technicalindicators
2,137
56
```xml 29 January 2024 ```
/content/code_sandbox/libs/neon/doc/date.xml
xml
2016-06-22T17:19:44
2024-08-16T02:15:29
winscp
winscp/winscp
2,528
6
```xml <?xml version="1.0" encoding="UTF-8"?> <phpunit xmlns:xsi="path_to_url" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" backupGlobals="true" colors="true" bootstrap="test/bootstrap.php" cacheResult="false" beStrictAboutOutputDuringTests="true" > <testsuites> <testsuite name="Sentry Laravel Test Suite"> <directory>./test/Sentry/</directory> </testsuite> </testsuites> </phpunit> ```
/content/code_sandbox/phpunit.xml
xml
2016-04-26T06:48:39
2024-08-15T19:35:09
sentry-laravel
getsentry/sentry-laravel
1,229
123
```xml import Vue from 'vue'; import Icon from './Icon.vue'; Vue.component('web-font', Icon); ```
/content/code_sandbox/plugins/web-font/index.ts
xml
2016-02-28T13:16:17
2024-08-16T01:48:50
iBlog
eshengsky/iBlog
1,337
22
```xml /** * COUNT_SELECTOR is a css selector used to identify elements that * will be replaced by the story count. */ export const COUNT_SELECTOR = ".coral-count"; /** * COMMENT_EMBED_SELECTOR is a css selector used to identify elements that * will be replaced by the comment embed. */ export const COMMENT_EMBED_SELECTOR = ".coral-comment-embed"; /** * ORIGIN_FALLBACK_ID can be attached to any <script /> tag as an * id or class to allow the `count.js` script to find its origin when * `document.currentScript` is not available (for legacy browsers). */ export const ORIGIN_FALLBACK_ID = "coral-script"; /** * ANNOUNCEMENT_DISMISSED_KEY is the localStorage key to store the ID of the * most recently dismissed announcement */ export const ANNOUNCEMENT_DISMISSED_KEY = "coral:lastAnnouncementDismissed"; ```
/content/code_sandbox/client/src/core/client/framework/constants.ts
xml
2016-10-31T16:14:05
2024-08-06T16:15:57
talk
coralproject/talk
1,881
188
```xml /** * Sneak/index.tsx * * Entry point for sneak functionality */ import { Colors } from "./../Colors" import { CallbackCommand, CommandManager } from "./../CommandManager" import { Configuration } from "./../Configuration" import { AchievementsManager } from "./../Learning/Achievements" import { OverlayManager } from "./../Overlay" import { getInstance as getParticlesInstance } from "./../Particles" import { Sneak } from "./Sneak" export * from "./SneakStore" let _sneak: Sneak export const activate = ( colors: Colors, commandManager: CommandManager, configuration: Configuration, overlayManager: OverlayManager, ) => { _sneak = new Sneak(overlayManager) commandManager.registerCommand( new CallbackCommand( "sneak.show", "Sneak: Current Window", "Show commands for current window", () => { _sneak.show() }, ), ) commandManager.registerCommand( new CallbackCommand( "sneak.hide", "Sneak: Hide", "Hide sneak view", () => _sneak.close(), () => _sneak.isActive, ), ) initializeParticles(colors, configuration) } export const registerAchievements = (achievements: AchievementsManager) => { achievements.registerAchievement({ uniqueId: "oni.achievement.sneak.1", name: "Sneaky", description: "Use the 'sneak' functionality for the first time", goals: [ { name: null, goalId: "oni.goal.sneak.complete", count: 1, }, ], }) _sneak.onSneakCompleted.subscribe(val => { achievements.notifyGoal("oni.goal.sneak.complete") }) } export const initializeParticles = (colors: Colors, configuration: Configuration) => { const isAnimationEnabled = () => configuration.getValue("ui.animations.enabled") const getVisualColor = () => colors.getColor("highlight.mode.visual.background") _sneak.onSneakCompleted.subscribe(sneak => { if (!isAnimationEnabled()) { return } const particles = getParticlesInstance() if (!particles) { return } particles.createParticles(15, { Position: { x: sneak.rectangle.x, y: sneak.rectangle.y }, PositionVariance: { x: 0, y: 0 }, Velocity: { x: 0, y: 0 }, Gravity: { x: 0, y: 300 }, VelocityVariance: { x: 200, y: 200 }, Time: 0.2, Color: getVisualColor(), }) }) } export const getInstance = (): Sneak => { return _sneak } ```
/content/code_sandbox/browser/src/Services/Sneak/index.tsx
xml
2016-11-16T14:42:55
2024-08-14T11:48:05
oni
onivim/oni
11,355
616
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ // TypeScript Version: 4.1 /// <reference types="@stdlib/types"/> import * as random from '@stdlib/types/random'; import { Collection } from '@stdlib/types/array'; /** * Interface defining function options. */ interface Options { /** * Pseudorandom number generator which generates uniformly distributed pseudorandom numbers. */ prng?: random.PRNG; /** * Pseudorandom number generator seed. */ seed?: random.PRNGSeedMT19937; /** * Pseudorandom number generator state. */ state?: random.PRNGStateMT19937; /** * Specifies whether to copy a provided pseudorandom number generator state (default: `true`). */ copy?: boolean; } /** * Interface for PRNG properties and methods. */ interface PRNG { /** * Underlying pseudorandom number generator. */ readonly PRNG: random.PRNG; /** * PRNG seed. */ readonly seed: random.PRNGSeedMT19937 | null; /** * PRNG seed length. */ readonly seedLength: number | null; /** * PRNG state. */ state: random.PRNGStateMT19937 | null; /** * PRNG state length. */ readonly stateLength: number | null; /** * PRNG state size (in bytes). */ readonly byteLength: number | null; } /** * Interface for filling strided arrays with pseudorandom numbers drawn from a chi-square distribution. */ interface Random extends PRNG { /** * Fills a strided array with pseudorandom numbers drawn from a chi-square distribution. * * @param N - number of indexed elements * @param k - degrees of freedom * @param sk - `k` strided length * @param out - output array * @param so - `out` stride length * @returns output array * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * // Create an array: * var out = new Float64Array( 10 ); * * // Fill the array with pseudorandom numbers: * chisquare( out.length, [ 2.0 ], 0, out, 1 ); */ <T = unknown>( N: number, k: Collection<number>, sk: number, out: Collection<T>, so: number ): Collection<T | number>; /** * Fills a strided array with pseudorandom numbers drawn from a chi-square distribution using alternative indexing semantics. * * @param N - number of indexed elements * @param k - degrees of freedom * @param sk - `k` strided length * @param ok - starting index for `k` * @param out - output array * @param so - `out` stride length * @param oo - starting index for `out` * @returns output array * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * // Create an array: * var out = new Float64Array( 10 ); * * // Fill the array with pseudorandom numbers: * chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); */ ndarray<T = unknown>( N: number, k: Collection<number>, sk: number, ok: number, out: Collection<T>, so: number, oo: number ): Collection<T | number>; } /** * Interface describing the main export. */ interface Routine extends Random { /** * Returns a function for filling strided arrays with pseudorandom numbers drawn from a chi-square distribution. * * @param options - function options * @throws must provide a valid state * @returns function for filling strided arrays * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * // Create a new PRNG function: * var random = chisquare.factory(); * * // Create an array: * var out = new Float64Array( 10 ); * * // Fill the array with pseudorandom numbers: * random( out.length, [ 2.0 ], 0, out, 1 ); * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * // Create a new PRNG function: * var random = chisquare.factory({ * 'seed': 297 * }); * * // Create an array: * var out = new Float64Array( 10 ); * * // Fill the array with pseudorandom numbers: * random( out.length, [ 2.0 ], 0, out, 1 ); */ factory( options?: Options ): Random; } /** * Fills a strided array with pseudorandom numbers drawn from a chi-square distribution. * * @param N - number of indexed elements * @param k - degrees of freedom * @param sk - `k` stride length * @param out - output array * @param so - `out` stride length * @returns output array * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * // Create an array: * var out = new Float64Array( 10 ); * * // Fill the array with pseudorandom numbers: * chisquare( out.length, [ 2.0 ], 0, out, 1 ); * * @example * var Float64Array = require( '@stdlib/array/float64' ); * * // Create an array: * var out = new Float64Array( 10 ); * * // Fill the array with pseudorandom numbers: * chisquare.ndarray( out.length, [ 2.0 ], 0, 0, out, 1, 0 ); */ declare var chisquare: Routine; // EXPORTS // export = chisquare; ```
/content/code_sandbox/lib/node_modules/@stdlib/random/strided/chisquare/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
1,382
```xml <?xml version="1.0"?> <!DOCTYPE target SYSTEM "osdata.dtd"> <osdata type="types"> <item> <column name="Type">cfwversion</column> <column name="Description">Listing of the Luma3DS version, commit hash, etc.</column> <column name="Title">CFW</column> </item> <item> <column name="Type">memory</column> <column name="Description">Listing of memory usage per region</column> <column name="Title">Memory</column> </item> <item> <column name="Type">processes</column> <column name="Description">Listing of all processes</column> <column name="Title">Processes</column> </item> </osdata> ```
/content/code_sandbox/sysmodules/rosalina/source/gdb/xml/osdata.xml
xml
2016-02-08T02:26:12
2024-08-16T18:01:26
Luma3DS
LumaTeam/Luma3DS
5,123
176
```xml import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; // path_to_url export default defineConfig({ plugins: [react()], }); ```
/content/code_sandbox/examples/tutorial/vite.config.ts
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
38
```xml export { DemoBanner } from './Demo'; ```
/content/code_sandbox/src/features/Layout/Banners/index.ts
xml
2016-12-04T01:35:27
2024-08-14T21:41:58
MyCrypto
MyCryptoHQ/MyCrypto
1,347
10
```xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="path_to_url" xmlns:app="path_to_url" xmlns:tools="path_to_url" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_main" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" app:srcCompat="@android:drawable/ic_dialog_email" /> </android.support.design.widget.CoordinatorLayout> ```
/content/code_sandbox/samples/VSAndroidApp/Resources/layout/activity_main.xml
xml
2016-03-30T15:37:14
2024-08-16T19:22:13
android
dotnet/android
1,905
270
```xml /** @jsx jsx */ import { Transforms } from 'slate' import { jsx } from '../../..' export const run = (editor, options = {}) => { Transforms.insertFragment( editor, <block> <block> <block> <block> <block>1</block> </block> <block> <block>2</block> </block> </block> </block> </block>, options ) } export const input = ( <editor> <block> <block> <block> <block> <block> <cursor /> </block> </block> <block> <block> <text /> </block> </block> </block> </block> </block> </editor> ) // TODO: surely this is the wrong behavior. // ideally, paragraph with "2" goes into second cell export const output = ( <editor> <block> <block> <block> <block> <block>1</block> <block> <block> 2<cursor /> </block> </block> </block> <block> <block> <text /> </block> </block> </block> </block> </block> </editor> ) export const skip = true ```
/content/code_sandbox/packages/slate/test/transforms/insertFragment/of-tables/merge-cells-with-nested-blocks.tsx
xml
2016-06-18T01:52:42
2024-08-16T18:43:42
slate
ianstormtaylor/slate
29,492
310
```xml import React from 'react'; import { render } from '@testing-library/react-native'; import { NativeBaseProvider } from '../../../../core/NativeBaseProvider'; import Switch from '../index'; jest.useFakeTimers(); describe('Switch', () => { it('can be default checked', () => { let { getAllByRole } = render( <NativeBaseProvider initialWindowMetrics={{ frame: { x: 0, y: 0, width: 0, height: 0 }, insets: { top: 0, left: 0, right: 0, bottom: 0 }, }} > <Switch defaultIsChecked /> </NativeBaseProvider> ); let switches = getAllByRole('switch'); expect(switches[0].props.value).toBe(true); }); it('can be disabled', () => { let { getAllByRole } = render( <NativeBaseProvider initialWindowMetrics={{ frame: { x: 0, y: 0, width: 0, height: 0 }, insets: { top: 0, left: 0, right: 0, bottom: 0 }, }} > <Switch isDisabled /> </NativeBaseProvider> ); let switches = getAllByRole('switch'); expect(switches[0].props.disabled).toBe(true); }); }); ```
/content/code_sandbox/src/components/primitives/Switch/test/switch.test.tsx
xml
2016-04-15T11:37:23
2024-08-14T16:16:44
NativeBase
GeekyAnts/NativeBase
20,132
300
```xml /* * one or more contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright ownership. */ import {CSSProperties} from 'react'; import {Column, UseSortByColumnProps, UseSortByOptions} from 'react-table'; import {t} from 'translation'; import {Head} from './Table'; type Entry = Head; export function flatten(ctx: string = '', suffix: (entry: Entry) => string | undefined = () => '') { return (flat: string[], entry: Entry): string[] => { if (typeof entry === 'object' && entry.columns) { // nested column, flatten recursivly with augmented context return flat.concat( entry.columns.reduce<string[]>(flatten(ctx + (entry.id || entry.label), suffix), []) ); } else { // normal column, return current context with optional suffix return flat.concat(ctx + suffix(entry)); } }; } // We have to do this, because when header is sortable, style props are only passed to the button that is rendered inside the header // see implementation here: path_to_url#L179 export function rewriteHeaderStyles(styles?: CSSProperties) { return function (th: HTMLTableCellElement | null) { if (!th) { return; } styles && Object.entries(styles).forEach(([key, value]) => { // @ts-ignore th.style[key] = value; }); }; } export function formatSorting<T extends object>( sorting: {by: string; order: string} | undefined, resultType: string | undefined, columns: (Column & Partial<UseSortByOptions<T> & UseSortByColumnProps<T>>)[], allowLocalSorting: boolean ): {id?: string; desc?: boolean; order?: string}[] { if (allowLocalSorting) { const firstSortableColumn = columns.find((column) => !column.disableSortBy); if (firstSortableColumn) { return [{id: firstSortableColumn.id, desc: false}]; } return []; } if (!sorting) { return []; } const {by, order} = sorting; let id = by; if (resultType === 'map') { if (by === 'label' || by === 'key') { id = columns[0]?.id!; } else if (by === 'value') { id = columns[1]?.id!; } } return [{id, desc: order === 'desc'}]; } export function convertHeaderNameToAccessor(name: string) { const joined = name .split(' ') .join('') .replace(t('report.variables.default').toString(), t('report.groupBy.variable') + ':'); return joined.charAt(0).toLowerCase() + joined.slice(1); } ```
/content/code_sandbox/optimize/client/src/modules/components/Table/service.ts
xml
2016-03-20T03:38:04
2024-08-16T19:59:58
camunda
camunda/camunda
3,172
606
```xml <vector xmlns:android="path_to_url" android:width="20dp" android:height="12dp" android:viewportWidth="20" android:viewportHeight="12"> <path android:pathData="M6,7H14V5H6V7ZM1.9,6C1.9,3.73 3.74,1.9 6,1.9H9V0H6C2.686,0 0,2.686 0,6C0,9.314 2.686,12 6,12H9V10.1H6C3.74,10.1 1.9,8.26 1.9,6ZM14,0H11V1.9H14C16.26,1.9 18.1,3.73 18.1,6C18.1,8.264 16.264,10.1 14,10.1H11V12H14C17.314,12 20,9.314 20,6C20,2.68 17.31,0 14,0Z" android:fillColor="#000000" android:fillType="evenOdd"/> </vector> ```
/content/code_sandbox/app/src/main/res/drawable/ic_meeting_link_info.xml
xml
2016-05-04T11:46:20
2024-08-15T16:29:10
android
meganz/android
1,537
277
```xml import {Buffer, Framebuffer} from '@luma.gl/core'; import { AnimationLoopTemplate, AnimationProps, Model, BufferTransform, Swap, makeRandomGenerator } from '@luma.gl/engine'; import {picking} from '@luma.gl/shadertools'; // Ensure repeatable rendertests const random = makeRandomGenerator(); // eslint-disable-next-line max-len const INFO_HTML = ` <p> Instanced triangles animated on the GPU using a luma.gl <code>BufferTransform</code> object. This is a port of an example from <a href="path_to_url"> WebGL2Samples </a> `; // We simulate the wandering of agents using transform feedback in this vertex shader // The simulation goes like this: // Assume there's a circle in front of the agent whose radius is WANDER_CIRCLE_R // the origin of which has a offset to the agent's pivot point, which is WANDER_CIRCLE_OFFSET // Each frame we pick a random point on this circle // And the agent moves MOVE_DELTA toward this target point // We also record the rotation facing this target point, so it will be the base rotation // for our next frame, which means the WANDER_CIRCLE_OFFSET vector will be on this direction // Thus we fake a smooth wandering behavior const COMPUTE_VS = /* glsl */ `\ #version 300 es #define OFFSET_LOCATION 0 #define ROTATION_LOCATION 1 #define M_2PI 6.28318530718 #define MAP_HALF_LENGTH 1.01 #define WANDER_CIRCLE_R 0.01 #define WANDER_CIRCLE_OFFSET 0.04 #define MOVE_DELTA 0.001 precision highp float; precision highp int; uniform float u_time; layout(location = OFFSET_LOCATION) in vec2 oldPositions; layout(location = ROTATION_LOCATION) in float oldRotations; out vec2 newOffsets; out float newRotations; float rand(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); } void main() { float theta = M_2PI * rand(vec2(u_time, oldRotations + oldPositions.x + oldPositions.y)); float cos_r = cos(oldRotations); float sin_r = sin(oldRotations); mat2 rot = mat2( cos_r, sin_r, -sin_r, cos_r ); vec2 p = WANDER_CIRCLE_R * vec2(cos(theta), sin(theta)) + vec2(WANDER_CIRCLE_OFFSET, 0.0); vec2 move = normalize(rot * p); newRotations = atan(move.y, move.x); newOffsets = oldPositions + MOVE_DELTA * move; // wrapping at edges newOffsets = vec2 ( newOffsets.x > MAP_HALF_LENGTH ? - MAP_HALF_LENGTH : ( newOffsets.x < - MAP_HALF_LENGTH ? MAP_HALF_LENGTH : newOffsets.x ) , newOffsets.y > MAP_HALF_LENGTH ? - MAP_HALF_LENGTH : ( newOffsets.y < - MAP_HALF_LENGTH ? MAP_HALF_LENGTH : newOffsets.y ) ); gl_Position = vec4(newOffsets, 0.0, 1.0); } `; const DRAW_VS = /* glsl */ `\ #version 300 es #define OFFSET_LOCATION 0 #define ROTATION_LOCATION 1 #define POSITION_LOCATION 2 #define COLOR_LOCATION 3 precision highp float; precision highp int; layout(location = POSITION_LOCATION) in vec2 positions; layout(location = ROTATION_LOCATION) in float instanceRotations; layout(location = OFFSET_LOCATION) in vec2 instancePositions; layout(location = COLOR_LOCATION) in vec3 instanceColors; in vec2 instancePickingColors; out vec3 vColor; void main() { vColor = instanceColors; float cos_r = cos(instanceRotations); float sin_r = sin(instanceRotations); mat2 rot = mat2( cos_r, sin_r, -sin_r, cos_r ); gl_Position = vec4(rot * positions + instancePositions, 0.0, 1.0); picking_setPickingColor(vec3(0., instancePickingColors)); } `; const DRAW_FS = /* glsl */ `\ #version 300 es #define ALPHA 0.9 precision highp float; precision highp int; in vec3 vColor; out vec4 fragColor; void main() { fragColor = vec4(vColor * ALPHA, ALPHA); fragColor = picking_filterColor(fragColor); } `; const NUM_INSTANCES = 1000; // TODO PICKING TEMPORARILY DISABLED // let pickPosition = [0, 0]; // function mousemove(e) { // pickPosition = [e.offsetX, e.offsetY]; // } // function mouseleave(e) { // pickPosition = null; // } export default class AppAnimationLoopTemplate extends AnimationLoopTemplate { static info = INFO_HTML; // Geometry of each object (a triangle) positionBuffer: Buffer; // Positions, rotations, colors and picking colors for each object instancePositionBuffers: Swap<Buffer>; instanceRotationBuffers: Swap<Buffer>; instanceColorBuffer: Buffer; instancePickingColorBuffer: Buffer; renderModel: Model; transform: BufferTransform; pickingFramebuffer: Framebuffer; // eslint-disable-next-line max-statements constructor({device, width, height, animationLoop}: AnimationProps) { super(); if (device.type !== 'webgl') { animationLoop.setError(new Error('This demo is only implemented for WebGL2')); return; } // -- Initialize data const trianglePositions = new Float32Array([0.015, 0.0, -0.01, 0.01, -0.01, -0.01]); const instancePositions = new Float32Array(NUM_INSTANCES * 2); const instanceRotations = new Float32Array(NUM_INSTANCES); const instanceColors = new Float32Array(NUM_INSTANCES * 3); const pickingColors = new Float32Array(NUM_INSTANCES * 2); for (let i = 0; i < NUM_INSTANCES; ++i) { instancePositions[i * 2] = random() * 2.0 - 1.0; instancePositions[i * 2 + 1] = random() * 2.0 - 1.0; instanceRotations[i] = random() * 2 * Math.PI; const randValue = random(); if (randValue > 0.5) { instanceColors[i * 3 + 1] = 1.0; instanceColors[i * 3 + 2] = 1.0; } else { instanceColors[i * 3] = 1.0; instanceColors[i * 3 + 2] = 1.0; } pickingColors[i * 2] = Math.floor(i / 255); pickingColors[i * 2 + 1] = i - 255 * pickingColors[i * 2]; } this.positionBuffer = device.createBuffer({data: trianglePositions}); this.instanceColorBuffer = device.createBuffer({data: instanceColors}); this.instancePositionBuffers = new Swap({ current: device.createBuffer({data: instancePositions}), next: device.createBuffer({data: instancePositions}) }); this.instanceRotationBuffers = new Swap({ current: device.createBuffer({data: instanceRotations}), next: device.createBuffer({data: instanceRotations}) }); this.instancePickingColorBuffer = device.createBuffer({data: pickingColors}); this.renderModel = new Model(device, { id: 'RenderModel', vs: DRAW_VS, fs: DRAW_FS, modules: [picking], topology: 'triangle-list', vertexCount: 3, isInstanced: true, instanceCount: NUM_INSTANCES, attributes: { positions: this.positionBuffer, instanceColors: this.instanceColorBuffer, instancePickingColors: this.instancePickingColorBuffer }, bufferLayout: [ {name: 'positions', format: 'float32x2'}, {name: 'instancePositions', format: 'float32x2'}, {name: 'instanceRotations', format: 'float32'}, {name: 'instanceColors', format: 'float32x3'}, {name: 'instancePickingColors', format: 'float32x2'} ] }); this.transform = new BufferTransform(device, { vs: COMPUTE_VS, vertexCount: NUM_INSTANCES, // elementCount: NUM_INSTANCES, bufferLayout: [ {name: 'oldPositions', format: 'float32x2'}, {name: 'oldRotations', format: 'float32'} ], outputs: ['newOffsets', 'newRotations'] }); // picking // device.canvasContext.canvas.addEventListener('mousemove', mousemove); // device.canvasContext.canvas.addEventListener('mouseleave', mouseleave); // this.pickingFramebuffer = device.createFramebuffer({width, height}); } override onFinalize(): void { this.renderModel.destroy(); this.transform.destroy(); } override onRender({device, width, height, time}: AnimationProps): void { this.transform.model.setUniforms({u_time: time}); this.transform.run({ inputBuffers: { oldPositions: this.instancePositionBuffers.current, oldRotations: this.instanceRotationBuffers.current }, outputBuffers: { newOffsets: this.instancePositionBuffers.next, newRotations: this.instanceRotationBuffers.next } }); this.instancePositionBuffers.swap(); this.instanceRotationBuffers.swap(); this.renderModel.setAttributes({ instancePositions: this.instancePositionBuffers.current, instanceRotations: this.instanceRotationBuffers.current }); const renderPass = device.beginRenderPass({ clearColor: [0, 0, 0, 1], clearDepth: 1 }); this.renderModel.draw(renderPass); // if (pickPosition) { // // use the center pixel location in device pixel range // const devicePixels = cssToDevicePixels(gl, pickPosition); // const deviceX = devicePixels.x + Math.floor(devicePixels.width / 2); // const deviceY = devicePixels.y + Math.floor(devicePixels.height / 2); // this.pickingFramebuffer.resize({width, height}); // pickInstance(gl, deviceX, deviceY, this.renderModel, this.pickingFramebuffer); // } } } /* function pickInstance(gl, pickX, pickY, model, framebuffer) { if (framebuffer) { framebuffer.clear({color: true, depth: true}); } // Render picking colors model.setUniforms({picking_uActive: 1}); model.draw({framebuffer}); model.setUniforms({picking_uActive: 0}); const color = readPixelsToArray(framebuffer, { sourceX: pickX, sourceY: pickY, sourceWidth: 1, sourceHeight: 1, sourceFormat: GL.RGBA, sourceType: GL.UNSIGNED_BYTE }); if (color[0] + color[1] + color[2] > 0) { model.updateModuleSettings({ pickingSelectedColor: color, pickingHighlightColor: RED }); } else { model.updateModuleSettings({ pickingSelectedColor: null }); } } */ ```
/content/code_sandbox/examples/tutorials/transform/app.ts
xml
2016-01-25T09:41:59
2024-08-16T10:03:05
luma.gl
visgl/luma.gl
2,280
2,515
```xml import { MigrationInterface } from "../../../../src/migration/MigrationInterface" import { QueryRunner } from "../../../../src/query-runner/QueryRunner" import { User } from "../entity/user" export class InsertUser0000000000003 implements MigrationInterface { public up(queryRunner: QueryRunner): Promise<any> { const userRepo = queryRunner.connection.getRepository<User>(User) return userRepo.save(new User()) } public down(queryRunner: QueryRunner): Promise<any> { return Promise.resolve() } } ```
/content/code_sandbox/test/github-issues/2693/migration/0000000000003-InsertUser.ts
xml
2016-02-29T07:41:14
2024-08-16T18:28:52
typeorm
typeorm/typeorm
33,875
109
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ // TypeScript Version: 4.1 /** * Interface describing `srot`. */ interface Routine { /** * Applies a plane rotation. * * @param N - number of indexed elements * @param x - first input array * @param strideX - `x` stride length * @param y - second input array * @param strideY - `y` stride length * @param c - cosine of the angle of rotation * @param s - sine of the angle of rotation * @returns `y` * * @example * var Float32Array = require( '@stdlib/array/float32' ); * * var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); * * srot( x.length, x, 1, y, 1, 0.8, 0.6 ); * // x => <Float32Array>[ ~4.4, ~5.8, ~7.2, ~8.6, 10.0 ] * // y => <Float32Array>[ ~4.2, ~4.4, ~4.6, ~4.8, 5.0 ] */ ( N: number, x: Float32Array, strideX: number, y: Float32Array, strideY: number, c: number, s: number ): Float32Array; /** * Applies a plane rotation using alternative indexing semantics. * * @param N - number of indexed elements * @param x - first input array * @param strideX - `x` stride length * @param offsetX - starting index for `x` * @param y - second input array * @param strideY - `y` stride length * @param offsetY - starting index for `y` * @param c - cosine of the angle of rotation * @param s - sine of the angle of rotation * @returns `y` * * @example * var Float32Array = require( '@stdlib/array/float32' ); * * var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); * var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); * * srot.ndarray( 3, x, 2, 1, y, 2, 1, 0.8, 0.6 ); * // x => <Float32Array>[ 1.0, 6.4, 3.0, 9.2, 5.0, 12.0 ] * // y => <Float32Array>[ 7.0, 5.2, 9.0, 5.6, 11.0, ~6.0 ] */ ndarray( N: number, x: Float32Array, strideX: number, offsetX: number, y: Float32Array, strideY: number, offsetY: number, c: number, s: number ): Float32Array; } /** * Applies a plane rotation. * * @param N - number of indexed elements * @param x - first input array * @param strideX - `x` stride length * @param y - second input array * @param strideY - `y` stride length * @param c - cosine of the angle of rotation * @param s - sine of the angle of rotation * @returns `y` * * @example * var Float32Array = require( '@stdlib/array/float32' ); * * var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ] ); * var y = new Float32Array( [ 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] ); * * srot( 3, x, 2, y, 2, 0.8, 0.6 ); * // x => <Float32Array>[ 5.0, 2.0, ~7.8, 4.0, ~10.6, 6.0 ] * // y => <Float32Array>[ 5.0, 8.0, ~5.4, 10.0, ~5.8, 12.0 ] * * @example * var Float32Array = require( '@stdlib/array/float32' ); * * var x = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); * var y = new Float32Array( [ 6.0, 7.0, 8.0, 9.0, 10.0 ] ); * * srot.ndarray( 4, x, 1, 1, y, 1, 1, 0.8, 0.6 ); * // x => <Float32Array>[ 1.0, ~5.8, ~7.2, ~8.6, 10.0 ] * // y => <Float32Array>[ 6.0, ~4.4, ~4.6, ~4.8, 5.0 ] */ declare var srot: Routine; // EXPORTS // export = srot; ```
/content/code_sandbox/lib/node_modules/@stdlib/blas/base/srot/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
1,337
```xml import { alpha, createTheme, PaletteOptions, Theme } from '@mui/material'; import { RaThemeOptions } from './types'; /** * Radiant: A theme emphasizing clarity and ease of use. * * Uses generous margins, outlined inputs and buttons, no uppercase, and an acid color palette. */ const componentsOverrides = (theme: Theme) => { const shadows = [ alpha(theme.palette.primary.main, 0.2), alpha(theme.palette.primary.main, 0.1), alpha(theme.palette.primary.main, 0.05), ]; return { MuiAppBar: { styleOverrides: { colorSecondary: { backgroundColor: theme.palette.background.default, color: theme.palette.text.primary, }, }, }, MuiAutocomplete: { defaultProps: { fullWidth: true, }, }, MuiButton: { defaultProps: { variant: 'outlined' as const, }, styleOverrides: { sizeSmall: { padding: `${theme.spacing(0.5)} ${theme.spacing(1.5)}`, }, }, }, MuiFormControl: { defaultProps: { variant: 'outlined' as const, margin: 'dense' as const, size: 'small' as const, fullWidth: true, }, }, MuiPaper: { styleOverrides: { elevation1: { boxShadow: `${shadows[0]} -2px 2px, ${shadows[1]} -4px 4px,${shadows[2]} -6px 6px`, }, root: { backgroundClip: 'padding-box', }, }, }, MuiTableCell: { styleOverrides: { root: { padding: theme.spacing(1.5), '&.MuiTableCell-sizeSmall': { padding: theme.spacing(1), }, '&.MuiTableCell-paddingNone': { padding: 0, }, }, }, }, MuiTableRow: { styleOverrides: { root: { '&:last-child td': { border: 0 }, }, }, }, MuiTextField: { defaultProps: { variant: 'outlined' as const, margin: 'dense' as const, size: 'small' as const, fullWidth: true, }, }, RaDatagrid: { styleOverrides: { root: { '& .RaDatagrid-headerCell': { color: theme.palette.primary.main, }, }, }, }, RaFilterForm: { styleOverrides: { root: { [theme.breakpoints.up('sm')]: { minHeight: theme.spacing(6), }, }, }, }, RaLayout: { styleOverrides: { root: { '& .RaLayout-appFrame': { marginTop: theme.spacing(5) }, }, }, }, RaMenuItemLink: { styleOverrides: { root: { borderLeft: `3px solid ${theme.palette.primary.contrastText}`, '&:hover': { borderRadius: '0px 100px 100px 0px', }, '&.RaMenuItemLink-active': { borderLeft: `3px solid ${theme.palette.primary.main}`, borderRadius: '0px 100px 100px 0px', backgroundImage: `linear-gradient(98deg, ${theme.palette.primary.light}, ${theme.palette.primary.dark} 94%)`, boxShadow: theme.shadows[1], color: theme.palette.primary.contrastText, '& .MuiSvgIcon-root': { fill: theme.palette.primary.contrastText, }, }, }, }, }, RaSimpleFormIterator: { defaultProps: { fullWidth: true, }, }, RaTranslatableInputs: { defaultProps: { fullWidth: true, }, }, }; }; const alert = { error: { main: '#DB488B' }, warning: { main: '#F2E963' }, info: { main: '#3ED0EB' }, success: { main: '#0FBF9F' }, }; const darkPalette: PaletteOptions = { primary: { main: '#9055fd' }, secondary: { main: '#FF83F6' }, background: { default: '#110e1c', paper: '#151221' }, ...alert, mode: 'dark' as 'dark', }; const lightPalette: PaletteOptions = { primary: { main: '#9055fd' }, secondary: { main: '#A270FF' }, background: { default: '#f0f1f6' }, text: { primary: '#544f5a', secondary: '#89868D', }, ...alert, mode: 'light' as 'light', }; const createRadiantTheme = (palette: RaThemeOptions['palette']) => { const themeOptions = { palette, shape: { borderRadius: 6 }, sidebar: { width: 250 }, spacing: 10, typography: { fontFamily: 'Gabarito, tahoma, sans-serif', h1: { fontWeight: 500, fontSize: '6rem', }, h2: { fontWeight: 600 }, h3: { fontWeight: 700 }, h4: { fontWeight: 800 }, h5: { fontWeight: 900 }, button: { textTransform: undefined, fontWeight: 700 }, }, }; const theme = createTheme(themeOptions); theme.components = componentsOverrides(theme); return theme; }; export const radiantLightTheme = createRadiantTheme(lightPalette); export const radiantDarkTheme = createRadiantTheme(darkPalette); ```
/content/code_sandbox/packages/ra-ui-materialui/src/theme/radiantTheme.ts
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
1,243
```xml <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="path_to_url"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{D1096A3C-D26C-D2AD-CDFC-3C5958E04AB7}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>modules_testing</RootNamespace> <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename> <PreferredToolArchitecture>x64</PreferredToolArchitecture> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/> <PropertyGroup Label="Configuration"> <CharacterSet>Unicode</CharacterSet> <ConfigurationType>StaticLibrary</ConfigurationType> </PropertyGroup> <PropertyGroup Label="Locals"> <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/> <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props"/> <ImportGroup Label="ExtensionSettings"/> <ImportGroup Label="PropertySheets"> <Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"/> </ImportGroup> <PropertyGroup Label="UserMacros"/> <PropertyGroup> <ExecutablePath>$(ExecutablePath);$(MSBuildProjectDirectory)\.\bin\;$(MSBuildProjectDirectory)\.\bin\</ExecutablePath> <OutDir>..\..\..\..\..\..\out\$(Configuration)\</OutDir> <IntDir>$(OutDir)obj\$(ProjectName)\</IntDir> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> <TargetName>$(ProjectName)</TargetName> <TargetPath>$(OutDir)lib\$(ProjectName)$(TargetExt)</TargetPath> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <AdditionalIncludeDirectories>$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalOptions>/MP /we4389 /bigobj %(AdditionalOptions)</AdditionalOptions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <BufferSecurityCheck>true</BufferSecurityCheck> <CompileAsWinRT>false</CompileAsWinRT> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4091;4127;4351;4355;4503;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4996;4456;4457;4458;4459;4702;4305;4324;4714;4800;4344;4267;4291;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ExceptionHandling>false</ExceptionHandling> <ForcedIncludeFiles>Precompile.h</ForcedIncludeFiles> <FunctionLevelLinking>true</FunctionLevelLinking> <MinimalRebuild>false</MinimalRebuild> <Optimization>Disabled</Optimization> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>Precompile.h</PrecompiledHeaderFile> <PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeTypeInfo>false</RuntimeTypeInfo> <TreatWarningAsError>true</TreatWarningAsError> <WarningLevel>Level4</WarningLevel> </ClCompile> <Lib> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions> <OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile> <TargetMachine>MachineX86</TargetMachine> </Lib> <Link> <AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;advapi32.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/maxilksize:0x7ff00000 /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <FixedBaseAddress>false</FixedBaseAddress> <GenerateDebugInformation>true</GenerateDebugInformation> <ImportLibrary>$(OutDir)lib\$(TargetName).lib</ImportLibrary> <MapFileName>$(OutDir)$(TargetName).map</MapFileName> <MinimumRequiredVersion>5.01</MinimumRequiredVersion> <RandomizedBaseAddress>false</RandomizedBaseAddress> <SubSystem>Console</SubSystem> <TargetMachine>MachineX86</TargetMachine> </Link> <Midl> <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <DllDataFileName>%(Filename).dlldata.c</DllDataFileName> <GenerateStublessProxies>true</GenerateStublessProxies> <HeaderFileName>%(Filename).h</HeaderFileName> <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName> <OutputDirectory>$(IntDir)</OutputDirectory> <ProxyFileName>%(Filename)_p.c</ProxyFileName> <TypeLibraryName>%(Filename).tlb</TypeLibraryName> </Midl> <ResourceCompile> <AdditionalIncludeDirectories>../../../..;$(OutDir)gen;$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <Culture>0x0409</Culture> <PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <AdditionalIncludeDirectories>$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalOptions>/MP /we4389 /bigobj %(AdditionalOptions)</AdditionalOptions> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <BufferSecurityCheck>true</BufferSecurityCheck> <CompileAsWinRT>false</CompileAsWinRT> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4091;4127;4351;4355;4503;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4996;4456;4457;4458;4459;4702;4305;4324;4714;4800;4344;4267;4291;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ExceptionHandling>false</ExceptionHandling> <ForcedIncludeFiles>Precompile.h</ForcedIncludeFiles> <FunctionLevelLinking>true</FunctionLevelLinking> <MinimalRebuild>false</MinimalRebuild> <Optimization>Disabled</Optimization> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>Precompile.h</PrecompiledHeaderFile> <PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeTypeInfo>false</RuntimeTypeInfo> <TreatWarningAsError>true</TreatWarningAsError> <WarningLevel>Level4</WarningLevel> </ClCompile> <Lib> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions> <OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile> <TargetMachine>MachineX64</TargetMachine> </Lib> <Link> <AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;advapi32.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/maxilksize:0x7ff00000 /dynamicbase /ignore:4199 /ignore:4221 /nxcompat %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <FixedBaseAddress>false</FixedBaseAddress> <GenerateDebugInformation>true</GenerateDebugInformation> <IgnoreSpecificDefaultLibraries>olepro32.lib</IgnoreSpecificDefaultLibraries> <ImportLibrary>$(OutDir)lib\$(TargetName).lib</ImportLibrary> <MapFileName>$(OutDir)$(TargetName).map</MapFileName> <MinimumRequiredVersion>5.02</MinimumRequiredVersion> <RandomizedBaseAddress>false</RandomizedBaseAddress> <SubSystem>Console</SubSystem> <TargetMachine>MachineX64</TargetMachine> </Link> <Midl> <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <DllDataFileName>%(Filename).dlldata.c</DllDataFileName> <GenerateStublessProxies>true</GenerateStublessProxies> <HeaderFileName>%(Filename).h</HeaderFileName> <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName> <OutputDirectory>$(IntDir)</OutputDirectory> <ProxyFileName>%(Filename)_p.c</ProxyFileName> <TypeLibraryName>%(Filename).tlb</TypeLibraryName> </Midl> <ResourceCompile> <AdditionalIncludeDirectories>../../../..;$(OutDir)gen;$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <Culture>0x0409</Culture> <PreprocessorDefinitions>_DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <AdditionalIncludeDirectories>$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalOptions>/MP /we4389 /bigobj /d2Zi+ /Zc:inline /Oy- /Gw %(AdditionalOptions)</AdditionalOptions> <BufferSecurityCheck>true</BufferSecurityCheck> <CompileAsWinRT>false</CompileAsWinRT> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4091;4127;4351;4355;4503;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4996;4456;4457;4458;4459;4702;4305;4324;4714;4800;4344;4267;4291;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ExceptionHandling>false</ExceptionHandling> <ForcedIncludeFiles>Precompile.h</ForcedIncludeFiles> <FunctionLevelLinking>true</FunctionLevelLinking> <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> <MinimalRebuild>false</MinimalRebuild> <OmitFramePointers>false</OmitFramePointers> <Optimization>MaxSpeed</Optimization> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>Precompile.h</PrecompiledHeaderFile> <PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeTypeInfo>false</RuntimeTypeInfo> <StringPooling>true</StringPooling> <TreatWarningAsError>true</TreatWarningAsError> <WarningLevel>Level4</WarningLevel> </ClCompile> <Lib> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions> <OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile> <TargetMachine>MachineX86</TargetMachine> </Lib> <Link> <AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;advapi32.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/maxilksize:0x7ff00000 /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <EnableCOMDATFolding>true</EnableCOMDATFolding> <FixedBaseAddress>false</FixedBaseAddress> <GenerateDebugInformation>true</GenerateDebugInformation> <ImportLibrary>$(OutDir)lib\$(TargetName).lib</ImportLibrary> <MapFileName>$(OutDir)$(TargetName).map</MapFileName> <MinimumRequiredVersion>5.01</MinimumRequiredVersion> <OptimizeReferences>true</OptimizeReferences> <Profile>true</Profile> <SubSystem>Console</SubSystem> <TargetMachine>MachineX86</TargetMachine> </Link> <Midl> <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <DllDataFileName>%(Filename).dlldata.c</DllDataFileName> <GenerateStublessProxies>true</GenerateStublessProxies> <HeaderFileName>%(Filename).h</HeaderFileName> <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName> <OutputDirectory>$(IntDir)</OutputDirectory> <ProxyFileName>%(Filename)_p.c</ProxyFileName> <TypeLibraryName>%(Filename).tlb</TypeLibraryName> </Midl> <ResourceCompile> <AdditionalIncludeDirectories>../../../..;$(OutDir)gen;$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <Culture>0x0409</Culture> <PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <AdditionalIncludeDirectories>$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalOptions>/MP /we4389 /bigobj /d2Zi+ /Zc:inline /Oy- /Gw %(AdditionalOptions)</AdditionalOptions> <BufferSecurityCheck>true</BufferSecurityCheck> <CompileAsWinRT>false</CompileAsWinRT> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DisableSpecificWarnings>4091;4127;4351;4355;4503;4611;4100;4121;4244;4481;4505;4510;4512;4610;4838;4996;4456;4457;4458;4459;4702;4305;4324;4714;4800;4344;4267;4291;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ExceptionHandling>false</ExceptionHandling> <ForcedIncludeFiles>Precompile.h</ForcedIncludeFiles> <FunctionLevelLinking>true</FunctionLevelLinking> <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> <MinimalRebuild>false</MinimalRebuild> <OmitFramePointers>false</OmitFramePointers> <Optimization>MaxSpeed</Optimization> <PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeaderFile>Precompile.h</PrecompiledHeaderFile> <PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeTypeInfo>false</RuntimeTypeInfo> <StringPooling>true</StringPooling> <TreatWarningAsError>true</TreatWarningAsError> <WarningLevel>Level4</WarningLevel> </ClCompile> <Lib> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/ignore:4221 %(AdditionalOptions)</AdditionalOptions> <OutputFile>$(OutDir)lib\$(ProjectName)$(TargetExt)</OutputFile> <TargetMachine>MachineX64</TargetMachine> </Lib> <Link> <AdditionalDependencies>wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;advapi32.lib;cfgmgr32.lib;powrprof.lib;setupapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib</AdditionalDependencies> <AdditionalLibraryDirectories>C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalOptions>/maxilksize:0x7ff00000 /dynamicbase /ignore:4199 /ignore:4221 /nxcompat %(AdditionalOptions)</AdditionalOptions> <DelayLoadDLLs>dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;cfgmgr32.dll;powrprof.dll;setupapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <EnableCOMDATFolding>true</EnableCOMDATFolding> <FixedBaseAddress>false</FixedBaseAddress> <GenerateDebugInformation>true</GenerateDebugInformation> <IgnoreSpecificDefaultLibraries>olepro32.lib</IgnoreSpecificDefaultLibraries> <ImportLibrary>$(OutDir)lib\$(TargetName).lib</ImportLibrary> <MapFileName>$(OutDir)$(TargetName).map</MapFileName> <MinimumRequiredVersion>5.02</MinimumRequiredVersion> <OptimizeReferences>true</OptimizeReferences> <Profile>true</Profile> <SubSystem>Console</SubSystem> <TargetMachine>MachineX64</TargetMachine> </Link> <Midl> <AdditionalIncludeDirectories>C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <DllDataFileName>%(Filename).dlldata.c</DllDataFileName> <GenerateStublessProxies>true</GenerateStublessProxies> <HeaderFileName>%(Filename).h</HeaderFileName> <InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName> <OutputDirectory>$(IntDir)</OutputDirectory> <ProxyFileName>%(Filename)_p.c</ProxyFileName> <TypeLibraryName>%(Filename).tlb</TypeLibraryName> </Midl> <ResourceCompile> <AdditionalIncludeDirectories>../../../..;$(OutDir)gen;$(OutDir)gen;..\..\..\..\third_party\wtl\include;..;..\..\..\..;..\..\..\..\skia\config;..\..\..\khronos;..\..\..\..\gpu;$(OutDir)gen\angle;..\..;$(OutDir)gen\blink;..\..\..\libpng;..\..\..\zlib;..\..\..\libwebp;..\..\..\ots\include;..\..\..\iccjpeg;..\..\..\libjpeg_turbo;..\..\..\icu\source\i18n;..\..\..\icu\source\common;..\..\..\..\skia\ext;..\..\..\..\third_party\skia\include\core;..\..\..\..\third_party\skia\include\effects;..\..\..\..\third_party\skia\include\pdf;..\..\..\..\third_party\skia\include\gpu;..\..\..\..\third_party\skia\include\lazy;..\..\..\..\third_party\skia\include\pathops;..\..\..\..\third_party\skia\include\pipe;..\..\..\..\third_party\skia\include\ports;..\..\..\..\third_party\skia\include\utils;..\..\..\npapi;..\..\..\npapi\bindings;..\..\..\qcms\src;..\..\..\..\v8\include;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <Culture>0x0409</Culture> <PreprocessorDefinitions>V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0603;WINVER=0x0603;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_SECURE_ATL;_HAS_EXCEPTIONS=0;_WINSOCK_DEPRECATED_NO_WARNINGS;CHROMIUM_BUILD;CR_CLANG_REVISION=239674-1;COMPONENT_BUILD;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_MEDIA_ROUTER=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_TOPCHROME_MD=1;DONT_EMBED_BUILD_METADATA;NO_TCMALLOC;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06030000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;ENABLE_PRINTING=1;ENABLE_BASIC_PRINTING=1;ENABLE_PRINT_PREVIEW=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_SUPERVISED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;V8_USE_EXTERNAL_STARTUP_DATA;FULL_SAFE_BROWSING;SAFE_BROWSING_CSD;SAFE_BROWSING_DB_LOCAL;SAFE_BROWSING_SERVICE;BLINK_IMPLEMENTATION=1;INSIDE_BLINK;USING_V8_SHARED;CHROME_PNG_WRITE_SUPPORT;PNG_USER_CONFIG;PNG_USE_DLL;ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0;WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1;ENABLE_INPUT_MULTIPLE_FIELDS_UI=1;ENABLE_WEB_AUDIO=1;WTF_USE_WEBAUDIO_FFMPEG=1;WTF_USE_DEFAULT_RENDER_THEME=1;ENABLE_LAZY_SWEEPING=1;ENABLE_IDLE_GC=1;LINK_CORE_MODULES_SEPARATELY;U_USING_ICU_NAMESPACE=0;U_ENABLE_DYLOAD=0;SKIA_DLL;GR_GL_IGNORE_ES3_MSAA=0;SK_SUPPORT_GPU=1;SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS;V8_SHARED;USE_LIBPCI=1;USE_OPENSSL=1;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions> </ResourceCompile> </ItemDefinitionGroup> <ItemGroup> <None Include="modules.gyp"/> </ItemGroup> <ItemGroup> <ClInclude Include="accessibility\testing\InternalsAccessibility.h"/> <ClInclude Include="geolocation\testing\GeolocationClientMock.h"/> <ClInclude Include="geolocation\testing\InternalsGeolocation.h"/> <ClInclude Include="navigatorcontentutils\testing\InternalsNavigatorContentUtils.h"/> <ClInclude Include="navigatorcontentutils\testing\NavigatorContentUtilsClientMock.h"/> <ClInclude Include="serviceworkers\testing\InternalsServiceWorker.h"/> <ClInclude Include="speech\testing\InternalsSpeechSynthesis.h"/> <ClInclude Include="speech\testing\PlatformSpeechSynthesizerMock.h"/> <ClInclude Include="vibration\testing\InternalsVibration.h"/> <ClInclude Include="webaudio\testing\InternalsWebAudio.h"/> <ClInclude Include="$(OutDir)gen\blink\bindings\modules\v8\V8InternalsPartial.h"/> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\..\..\third_party\WebKit\Source\build\win\Precompile.cpp"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> </ClCompile> <ClCompile Include="accessibility\testing\InternalsAccessibility.cpp"/> <ClCompile Include="geolocation\testing\GeolocationClientMock.cpp"/> <ClCompile Include="geolocation\testing\InternalsGeolocation.cpp"/> <ClCompile Include="navigatorcontentutils\testing\InternalsNavigatorContentUtils.cpp"/> <ClCompile Include="navigatorcontentutils\testing\NavigatorContentUtilsClientMock.cpp"/> <ClCompile Include="serviceworkers\testing\InternalsServiceWorker.cpp"/> <ClCompile Include="speech\testing\InternalsSpeechSynthesis.cpp"/> <ClCompile Include="speech\testing\PlatformSpeechSynthesizerMock.cpp"/> <ClCompile Include="vibration\testing\InternalsVibration.cpp"/> <ClCompile Include="webaudio\testing\InternalsWebAudio.cpp"/> <ClCompile Include="$(OutDir)gen\blink\bindings\modules\v8\V8InternalsPartial.cpp"/> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/> <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets"/> <ImportGroup Label="ExtensionTargets"/> <Target Name="Build"> <Exec Command="call ninja.exe -C $(OutDir) $(ProjectName)"/> </Target> <Target Name="Clean"> <Exec Command="call ninja.exe -C $(OutDir) -tclean $(ProjectName)"/> </Target> </Project> ```
/content/code_sandbox/third_party/WebKit/Source/modules/modules_testing.vcxproj
xml
2016-09-27T03:41:10
2024-08-16T10:42:57
miniblink49
weolar/miniblink49
7,069
13,985
```xml const isRequired = validate => { if (validate && validate.isRequired) { return true; } if (Array.isArray(validate)) { return validate.some(it => it.isRequired); } return false; }; export default isRequired; ```
/content/code_sandbox/packages/ra-core/src/form/isRequired.ts
xml
2016-07-13T07:58:54
2024-08-16T18:32:27
react-admin
marmelab/react-admin
24,624
52
```xml <?xml version="1.0" encoding="utf-8"?> <data-sources> <data-source id="fxxpipe"> <maximum-pool-size>20</maximum-pool-size> <connection-timeout>1s</connection-timeout> <idle-timeout>1m</idle-timeout> <statement-cache-size>1000</statement-cache-size> <properties> <driver>com.mysql.jdbc.Driver</driver> <url><![CDATA[jdbc:mysql://mysql:3306/fxxpipe]]></url> <user>root</user> <password>rootP#130</password> <connectionProperties><![CDATA[useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true]]></connectionProperties> </properties> </data-source> </data-sources> ```
/content/code_sandbox/redis/dockerPackage/xpipe-console/config/datasources.xml
xml
2016-03-29T12:22:36
2024-08-12T11:25:42
x-pipe
ctripcorp/x-pipe
1,977
176
```xml <snippet> <content><![CDATA[/* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ ]]></content> <!-- Tab trigger to activate the snippet --> <tabTrigger>stdlib.license</tabTrigger> <!-- Scope the tab trigger will be active in --> <scope>source.ts</scope> <!-- Description to show in the menu --> <description>TypeScript license header</description> </snippet> ```
/content/code_sandbox/docs/editors/sublime-text/snippets/stdlib-license-ts.sublime-snippet
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
125
```xml /* * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ // TypeScript Version: 4.1 /// <reference types="@stdlib/types"/> import { Shape5D } from '@stdlib/types/ndarray'; /** * Five-dimensional nested array. */ type Array5D<T> = Array<Array<Array<Array<Array<T>>>>>; /** * Returns a five-dimensional nested array filled with ones. * * @param shape - array shape * @returns output array * * @example * var out = ones5d( [ 1, 1, 1, 1, 3 ] ); * // returns [ [ [ [ [ 1.0, 1.0, 1.0 ] ] ] ] ] */ declare function ones5d( shape: Shape5D ): Array5D<number>; // EXPORTS // export = ones5d; ```
/content/code_sandbox/lib/node_modules/@stdlib/array/base/ones5d/docs/types/index.d.ts
xml
2016-03-24T04:19:52
2024-08-16T09:03:19
stdlib
stdlib-js/stdlib
4,266
217