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 * as React from 'react';
import { VerticalPersona } from './Vertical/VerticalPersona';
import { Persona as HorizontalPersona } from '@fluentui/react';
import type { IHorizontalPersonaProps } from './Persona.types';
import type { IVerticalPersonaProps } from './Vertical/VerticalPersona.types';
export const Persona = (props: IVerticalPersonaProps | IHorizontalPersonaProps): JSX.Element => {
return props.vertical === true ? <VerticalPersona {...props} /> : <HorizontalPersona {...props} />;
};
``` | /content/code_sandbox/packages/react-experiments/src/components/Persona/Persona.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 108 |
```xml
/*! *****************************************************************************
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
***************************************************************************** */
/// <reference no-default-lib="true"/>
/// <reference lib="esnext" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />
``` | /content/code_sandbox/sdk/nodejs/vendor/typescript@3.8.3/lib.esnext.full.d.ts | xml | 2016-10-31T21:02:47 | 2024-08-16T19:47:04 | pulumi | pulumi/pulumi | 20,743 | 124 |
```xml
import {
putCreateLog as commonPutCreateLog,
putUpdateLog as commonPutUpdateLog,
putDeleteLog as commonPutDeleteLog,
gatherNames,
gatherUsernames,
LogDesc,
IDescriptions,
} from '@erxes/api-utils/src/logUtils';
import { getSchemaLabels } from '@erxes/api-utils/src/logUtils';
import { LOG_MAPPINGS, MODULE_NAMES } from './constants';
import { sendCoreMessage } from './messageBroker';
import {
IArticleDocument,
ICategoryDocument,
ITopicDocument,
} from './models/definitions/knowledgebase';
import { IModels } from './connectionResolver';
const findFromCore = async (
subdomain: string,
ids: string[],
collectionName: string,
) => {
return sendCoreMessage({
subdomain,
action: `${collectionName}.find`,
data: {
query: {
_id: { $in: ids },
},
},
isRPC: true,
defaultValue: [],
});
};
const gatherKbTopicFieldNames = async (
models: IModels,
subdomain: string,
doc: ITopicDocument,
prevList?: LogDesc[],
): Promise<LogDesc[]> => {
let options: LogDesc[] = [];
if (prevList) {
options = prevList;
}
options = await gatherUsernames({
foreignKey: 'createdBy',
prevList: options,
items: await findFromCore(subdomain, [doc.createdBy], 'users'),
});
if (doc.modifiedBy) {
options = await gatherUsernames({
foreignKey: 'modifiedBy',
prevList: options,
items: await findFromCore(subdomain, [doc.modifiedBy], 'users'),
});
}
if (doc.brandId) {
options = await gatherNames({
foreignKey: 'brandId',
prevList: options,
nameFields: ['name'],
items: await findFromCore(subdomain, [doc.brandId], 'brands'),
});
}
if (doc.categoryIds && doc.categoryIds.length > 0) {
// categories are removed alongside
const categories = await models.KnowledgeBaseCategories.find(
{ _id: { $in: doc.categoryIds } },
{ title: 1 },
);
for (const cat of categories) {
options.push({
categoryIds: cat._id,
name: cat.title,
});
}
}
return options;
};
const gatherKbCategoryFieldNames = async (
models: IModels,
subdomain: string,
doc: ICategoryDocument,
prevList?: LogDesc[],
): Promise<LogDesc[]> => {
let options: LogDesc[] = [];
if (prevList) {
options = prevList;
}
const articles = await models.KnowledgeBaseArticles.find(
{ _id: { $in: doc.articleIds } },
{ title: 1 },
);
options = await gatherUsernames({
foreignKey: 'createdBy',
prevList: options,
items: await findFromCore(subdomain, [doc.createdBy], 'users'),
});
if (doc.modifiedBy) {
options = await gatherUsernames({
foreignKey: 'modifiedBy',
prevList: options,
items: await findFromCore(subdomain, [doc.modifiedBy], 'users'),
});
}
if (articles.length > 0) {
for (const article of articles) {
options.push({ articleIds: article._id, name: article.title });
}
}
if (doc.topicId) {
const topic = await models.KnowledgeBaseTopics.findOne({
_id: doc.topicId,
});
if (topic) {
options.push({ topicId: doc.topicId, name: topic.title });
}
}
return options;
};
const gatherKbArticleFieldNames = async (
models: IModels,
subdomain: string,
doc: IArticleDocument,
prevList?: LogDesc[],
) => {
let options: LogDesc[] = [];
if (prevList) {
options = prevList;
}
if (doc.createdBy) {
options = await gatherUsernames({
foreignKey: 'createdBy',
prevList,
items: await findFromCore(subdomain, [doc.createdBy], 'users'),
});
}
if (doc.modifiedBy) {
options = await gatherUsernames({
foreignKey: 'modifiedBy',
prevList: options,
items: await findFromCore(subdomain, [doc.modifiedBy], 'users'),
});
}
if (doc.topicId) {
const topic = await models.KnowledgeBaseTopics.findOne({
_id: doc.topicId,
});
if (topic) {
options.push({ topicId: topic._id, name: topic.title });
}
}
if (doc.categoryId) {
const category = await models.KnowledgeBaseCategories.findOne({
_id: doc.categoryId,
});
if (category) {
options.push({ categoryId: doc.categoryId, name: category.title });
}
}
return options;
};
export const gatherDescriptions = async (
models: IModels,
subdomain: string,
params: any,
): Promise<IDescriptions> => {
const { action, type, object, updatedDocument } = params;
const description = `"${object.title}" has been ${action}d`;
let extraDesc: LogDesc[] = [];
switch (type) {
case MODULE_NAMES.KB_TOPIC:
extraDesc = await gatherKbTopicFieldNames(models, subdomain, object);
if (updatedDocument) {
extraDesc = await gatherKbTopicFieldNames(
models,
subdomain,
updatedDocument,
extraDesc,
);
}
break;
case MODULE_NAMES.KB_CATEGORY:
extraDesc = await gatherKbCategoryFieldNames(models, subdomain, object);
if (updatedDocument) {
extraDesc = await gatherKbCategoryFieldNames(
models,
subdomain,
updatedDocument,
extraDesc,
);
}
break;
case MODULE_NAMES.KB_ARTICLE:
extraDesc = await gatherKbArticleFieldNames(models, subdomain, object);
if (updatedDocument) {
extraDesc = await gatherKbArticleFieldNames(
models,
subdomain,
updatedDocument,
extraDesc,
);
}
break;
default:
break;
}
return { extraDesc, description };
};
export const LOG_ACTIONS = {
CREATE: 'create',
UPDATE: 'update',
DELETE: 'delete',
};
export const putDeleteLog = async (
models: IModels,
subdomain: string,
logDoc,
user,
) => {
const { description, extraDesc } = await gatherDescriptions(
models,
subdomain,
{
...logDoc,
action: LOG_ACTIONS.DELETE,
},
);
await commonPutDeleteLog(
subdomain,
{ ...logDoc, description, extraDesc, type: `knowledgebase:${logDoc.type}` },
user,
);
};
export const putUpdateLog = async (
models: IModels,
subdomain: string,
logDoc,
user,
) => {
const { description, extraDesc } = await gatherDescriptions(
models,
subdomain,
{
...logDoc,
action: LOG_ACTIONS.UPDATE,
},
);
await commonPutUpdateLog(
subdomain,
{ ...logDoc, description, extraDesc, type: `knowledgebase:${logDoc.type}` },
user,
);
};
export const putCreateLog = async (
models: IModels,
subdomain: string,
logDoc,
user,
) => {
const { description, extraDesc } = await gatherDescriptions(
models,
subdomain,
{
...logDoc,
action: LOG_ACTIONS.CREATE,
},
);
await commonPutCreateLog(
subdomain,
{ ...logDoc, description, extraDesc, type: `knowledgebase:${logDoc.type}` },
user,
);
};
// message consumer
export default {
getSchemaLabels: ({ data: { type } }) => ({
status: 'success',
data: getSchemaLabels(type, LOG_MAPPINGS),
}),
};
``` | /content/code_sandbox/packages/plugin-knowledgebase-api/src/logUtils.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 1,802 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="path_to_url"
package="com.facebook.redex.test.instr"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="23"/>
<instrumentation
android:label="redex"
android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.facebook.redex.test.instr" />
<application
android:debuggable="true"
android:allowBackup="false">
<activity
android:name="com.facebook.resourcetest.SimpleActivity"
android:label="RedexTest" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
``` | /content/code_sandbox/test/instr/testdata/optres/AndroidManifest.xml | xml | 2016-03-24T18:26:35 | 2024-08-16T16:00:20 | redex | facebook/redex | 6,016 | 208 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.AutoMapper</AssemblyName>
<PackageId>Volo.Abp.AutoMapper</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj" />
<ProjectReference Include="..\Volo.Abp.ObjectExtending\Volo.Abp.ObjectExtending.csproj" />
<ProjectReference Include="..\Volo.Abp.ObjectMapping\Volo.Abp.ObjectMapping.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/framework/src/Volo.Abp.AutoMapper/Volo.Abp.AutoMapper.csproj | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 284 |
```xml
import { commonTypes, commonInputs, commonFilters } from './common';
export const types = `
type Spin @key(fields: "_id") @cacheControl(maxAge: 3) {
${commonTypes}
status: String
awardId: String
voucherId: String
}
type SpinMain {
list: [Spin]
totalCount: Int
}
`;
export const queries = `
spinsMain(${commonFilters} voucherCampaignId: String): SpinMain
spins(${commonFilters} voucherCampaignId: String): [Spin]
spinDetail(_id: String!): Spin
`;
const SpinDoc = `
${commonInputs}
status: String
`;
export const mutations = `
spinsAdd(${SpinDoc}): Spin
spinsEdit(_id: String!, ${SpinDoc}): Spin
spinsRemove(_ids: [String]): JSON
doSpin(_id: String!): Spin
buySpin(campaignId: String, ownerType: String, ownerId: String, count: Int): Spin
`;
``` | /content/code_sandbox/packages/plugin-loyalties-api/src/graphql/schema/spin.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 223 |
```xml
import * as React from 'react';
import {
MgtTemplateProps,
} from '@microsoft/mgt-react/dist/es6/MgtTemplateProps';
import { RenderFileCard } from './RenderFileCard';
export const FileTemplate: React.FunctionComponent<MgtTemplateProps> = (props: React.PropsWithChildren<MgtTemplateProps>) => {
const { file } = props.dataContext;
return <RenderFileCard file={file} />;
};
``` | /content/code_sandbox/samples/react-my-dashboard/src/src/components/myFiles/FileTemplate.tsx | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 96 |
```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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="material_timepicker_pm">G</string>
<string name="material_timepicker_am">AM</string>
<string name="material_timepicker_select_time">Vaxt sein</string>
<string name="material_timepicker_minute">Dqiq</string>
<string name="material_timepicker_hour">Saat</string>
<string name="material_hour_suffix">Saat %1$s</string>
<string name="material_hour_24h_suffix">%1$s saat</string>
<string name="material_minute_suffix">%1$s dqiq</string>
<string name="material_hour_selection">Saat sein</string>
<string name="material_minute_selection">Dqiq sein</string>
<string name="material_clock_toggle_content_description">Gndz v ya axam sein</string>
<string name="mtrl_timepicker_confirm">OK</string>
<string name="mtrl_timepicker_cancel">Lv edin</string>
<string name="material_timepicker_text_input_mode_description">Zaman daxil etmk n mtnl daxiletm rejimin kein</string>
<string name="material_timepicker_clock_mode_description">Zaman daxil etmk n saat rejimin kein</string>
</resources>
``` | /content/code_sandbox/lib/java/com/google/android/material/timepicker/res/values-az/strings.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 363 |
```xml
import {Express, NextFunction, Request, Response} from 'express';
import * as path from 'path';
import * as fs from 'fs';
import * as ejs from 'ejs';
import {Config} from '../../common/config/private/Config';
import {ProjectPath} from '../ProjectPath';
import {AuthenticationMWs} from '../middlewares/user/AuthenticationMWs';
import {CookieNames} from '../../common/CookieNames';
import {ErrorCodes, ErrorDTO} from '../../common/entities/Error';
import {UserDTO} from '../../common/entities/UserDTO';
import {ServerTimeEntry} from '../middlewares/ServerTimingMWs';
import {ClientConfig, TAGS} from '../../common/config/public/ClientConfig';
import {QueryParams} from '../../common/QueryParams';
import {PhotoProcessing} from '../model/fileaccess/fileprocessing/PhotoProcessing';
import {Utils} from '../../common/Utils';
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Express {
interface Request {
locale?: string;
localePath?: string;
tpl?: Record<string, any>;
timing?: { [key: string]: ServerTimeEntry };
}
interface Response {
tpl?: Record<string, any>;
}
}
}
export class PublicRouter {
public static route(app: Express): void {
const setLocale = (req: Request, res: Response, next: NextFunction) => {
let selectedLocale = req.locale;
if (req.cookies && req.cookies[CookieNames.lang]) {
if (
Config.Server.languages.indexOf(req.cookies[CookieNames.lang]) !== -1
) {
selectedLocale = req.cookies[CookieNames.lang];
}
}
res.cookie(CookieNames.lang, selectedLocale);
req.localePath = selectedLocale;
next();
};
// index.html should not be cached as it contains template that can change
const renderIndex = (req: Request, res: Response, next: NextFunction) => {
ejs.renderFile(
path.join(ProjectPath.FrontendFolder, req.localePath, 'index.html'),
res.tpl,
(err, str) => {
if (err) {
return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, err.message));
}
res.send(str);
}
);
};
const redirectToBase = (locale: string) => {
return (req: Request, res: Response) => {
if (Config.Server.languages.indexOf(locale) !== -1) {
res.cookie(CookieNames.lang, locale);
}
res.redirect(Utils.concatUrls('/' + Config.Server.urlBase) + '/?ln=' + locale);
};
};
const addTPl = (req: Request, res: Response, next: NextFunction) => {
res.tpl = {};
res.tpl.user = null;
if (req.session['user']) {
res.tpl.user = {
id: req.session['user'].id,
name: req.session['user'].name,
csrfToken: req.session['user'].csrfToken,
role: req.session['user'].role,
usedSharingKey: req.session['user'].usedSharingKey,
permissions: req.session['user'].permissions,
} as UserDTO;
if (!res.tpl.user.csrfToken && req.csrfToken) {
res.tpl.user.csrfToken = req.csrfToken();
}
}
const confCopy = Config.toJSON({
attachVolatile: true,
skipTags: {secret: true} as TAGS,
keepTags: {client: true}
}) as unknown as ClientConfig;
// Escaping html tags, like <script></script>
confCopy.Server.customHTMLHead =
confCopy.Server.customHTMLHead
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
res.tpl.Config = confCopy;
res.tpl.customHTMLHead = Config.Server.customHTMLHead;
const selectedTheme = Config.Gallery.Themes.availableThemes.find(th => th.name === Config.Gallery.Themes.selectedTheme)?.theme || '';
res.tpl.usedTheme = selectedTheme;
return next();
};
app.use(addTPl);
app.get('/heartbeat', (req: Request, res: Response) => {
res.sendStatus(200);
});
app.get('/manifest.json', (req: Request, res: Response) => {
res.send({
name: Config.Server.applicationTitle,
icons: [
{
src: 'icon_auto.svg',
sizes: 'any',
type: 'image/svg+xml',
purpose: 'any'
},
{
src: 'icon_padding_auto.svg',
sizes: 'any',
type: 'image/svg+xml',
purpose: 'maskable'
},
{
src: 'icon_white.png',
sizes: '48x48 72x72 96x96 128x128 256x256',
},
],
display: 'standalone',
categories: [
'photo'
],
start_url:
Config.Server.publicUrl === '' ? '.' : Config.Server.publicUrl,
background_color: '#000000',
theme_color: '#000000',
});
});
const getIcon = (theme: 'auto' | string | null = null, paddingPercent = 0): string => {
const vBs = (Config.Server.svgIcon.viewBox || '').split(' ').slice(0, 4).map(s => parseFloat(s));
vBs[0] = vBs[0] || 0;
vBs[1] = vBs[1] || 0;
vBs[2] = vBs[2] || 512;
vBs[3] = vBs[3] || 512;
// make icon rectangle
//add padding to all sides equally. ie: center icon
const icon_size = Math.max(vBs[2], vBs[3]);
const pw = icon_size - vBs[2];
const ph = icon_size - vBs[3];
vBs[0] -= pw / 2;
vBs[1] -= ph / 2;
vBs[2] = icon_size;
vBs[3] = icon_size;
const getCanvasSize = () => Math.max(vBs[2], vBs[3]);
const addPadding = (p: number) => {
if (p <= 0) {
return;
}
const size = getCanvasSize();
vBs[0] -= size * (p / 2);
vBs[1] -= size * (p / 2);
vBs[2] += size * (p);
vBs[3] += size * (p);
};
addPadding(paddingPercent);
const canvasSize = getCanvasSize();
const canvasStart = {
x: vBs[0],
y: vBs[1]
};
return '<svg ' +
' xmlns="path_to_url"' +
' viewBox="' + vBs.join(' ') + '">' +
(theme === 'auto' ? ('<style>' +
' path, circle {' +
' fill: black;' +
' }' +
' circle.bg,rect.bg {' +
' fill: white;' +
' }' +
' @media (prefers-color-scheme: dark) {' +
' path, circle {' +
' fill: white;' +
' }' +
' circle.bg,rect.bg {' +
' fill: black;' +
' }' +
' }' +
' </style>') :
(theme != null ?
('<style>' +
' path, circle {' +
' fill: ' + theme + ';' +
' }' +
' circle.bg {' +
' fill: black;' +
' }' +
' </style>')
: '<style>' +
' circle.bg,rect.bg {' +
' fill: white;' +
' }' +
' </style>')) +
`<rect class="bg" x="${canvasStart.x}" y="${canvasStart.y}" width="${canvasSize}" height="${canvasSize}" rx="15" />` +
Config.Server.svgIcon.items + '</svg>';
};
app.get('/icon.svg', (req: Request, res: Response) => {
res.set('Cache-control', 'public, max-age=31536000');
res.header('Content-Type', 'image/svg+xml');
res.send(getIcon());
});
app.get('/icon_padding_auto.svg', (req: Request, res: Response) => {
res.set('Cache-control', 'public, max-age=31536000');
res.header('Content-Type', 'image/svg+xml');
// Use 40% padding: path_to_url#icon-masks
res.send(getIcon('auto', 0.7));
});
app.get('/icon_auto.svg', (req: Request, res: Response) => {
res.set('Cache-control', 'public, max-age=31536000');
res.header('Content-Type', 'image/svg+xml');
res.send(getIcon('auto'));
});
app.get('/icon_white.svg', (req: Request, res: Response) => {
res.set('Cache-control', 'public, max-age=31536000');
res.header('Content-Type', 'image/svg+xml');
res.send(getIcon('white'));
});
app.get('/icon.png', async (req: Request, res: Response, next: NextFunction) => {
try {
const p = path.join(ProjectPath.TempFolder, '/icon.png');
await PhotoProcessing.renderSVG(Config.Server.svgIcon, p);
res.sendFile(p, {
maxAge: 31536000,
dotfiles: 'allow',
});
} catch (e) {
return next(e);
}
});
app.get('/icon_white.png', async (req: Request, res: Response, next: NextFunction) => {
try {
const p = path.join(ProjectPath.TempFolder, '/icon_inv.png');
await PhotoProcessing.renderSVG(Config.Server.svgIcon, p, 'white');
res.sendFile(p, {
maxAge: 31536000,
dotfiles: 'allow',
});
} catch (e) {
return next(e);
}
});
app.get(
[
'/',
'/login',
'/gallery*',
'/share/:' + QueryParams.gallery.sharingKey_params,
'/shareLogin',
'/admin',
'/duplicates',
'/faces',
'/albums',
'/search*',
],
AuthenticationMWs.tryAuthenticate,
addTPl, // add template after authentication was successful
setLocale,
renderIndex
);
Config.Server.languages.forEach((l) => {
app.get(
[
'/' + l + '/',
'/' + l + '/login',
'/' + l + '/gallery*',
'/' + l + '/share*',
'/' + l + '/admin',
'/' + l + '/search*',
],
redirectToBase(l)
);
});
const renderFile = (subDir = '') => {
return (req: Request, res: Response) => {
const file = path.join(
ProjectPath.FrontendFolder,
req.localePath,
subDir,
req.params.file
);
if (!fs.existsSync(file)) {
return res.sendStatus(404);
}
res.sendFile(file, {
maxAge: 31536000,
dotfiles: 'allow',
});
};
};
app.get(
'/assets/:file(*)',
setLocale,
AuthenticationMWs.normalizePathParam('file'),
renderFile('assets')
);
app.get(
'/:file',
setLocale,
AuthenticationMWs.normalizePathParam('file'),
renderFile()
);
}
}
``` | /content/code_sandbox/src/backend/routes/PublicRouter.ts | xml | 2016-03-12T11:46:41 | 2024-08-16T19:56:44 | pigallery2 | bpatrik/pigallery2 | 1,727 | 2,599 |
```xml
import {
getNamedType,
GraphQLFieldMap,
GraphQLSchema,
isEnumType,
isInputObjectType,
isInterfaceType,
isObjectType,
isScalarType,
isSpecifiedScalarType,
isUnionType,
} from 'graphql';
import { DirectableGraphQLObject } from './get-directives.js';
import { getImplementingTypes } from './get-implementing-types.js';
import { MapperKind } from './Interfaces.js';
import { mapSchema } from './mapSchema.js';
import { getRootTypes } from './rootTypes.js';
import { PruneSchemaOptions } from './types.js';
/**
* Prunes the provided schema, removing unused and empty types
* @param schema The schema to prune
* @param options Additional options for removing unused types from the schema
*/
export function pruneSchema(
schema: GraphQLSchema,
options: PruneSchemaOptions = {},
): GraphQLSchema {
const {
skipEmptyCompositeTypePruning,
skipEmptyUnionPruning,
skipPruning,
skipUnimplementedInterfacesPruning,
skipUnusedTypesPruning,
} = options;
let prunedTypes: string[] = []; // Pruned types during mapping
let prunedSchema: GraphQLSchema = schema;
do {
let visited = visitSchema(prunedSchema);
// Custom pruning was defined, so we need to pre-emptively revisit the schema accounting for this
if (skipPruning) {
const revisit = [];
for (const typeName in prunedSchema.getTypeMap()) {
if (typeName.startsWith('__')) {
continue;
}
const type = prunedSchema.getType(typeName);
// if we want to skip pruning for this type, add it to the list of types to revisit
if (type && skipPruning(type)) {
revisit.push(typeName);
}
}
visited = visitQueue(revisit, prunedSchema, visited); // visit again
}
prunedTypes = [];
prunedSchema = mapSchema(prunedSchema, {
[MapperKind.TYPE]: type => {
if (!visited.has(type.name) && !isSpecifiedScalarType(type)) {
if (
isUnionType(type) ||
isInputObjectType(type) ||
isInterfaceType(type) ||
isObjectType(type) ||
isScalarType(type)
) {
// skipUnusedTypesPruning: skip pruning unused types
if (skipUnusedTypesPruning) {
return type;
}
// skipEmptyUnionPruning: skip pruning empty unions
if (
isUnionType(type) &&
skipEmptyUnionPruning &&
!Object.keys(type.getTypes()).length
) {
return type;
}
if (isInputObjectType(type) || isInterfaceType(type) || isObjectType(type)) {
// skipEmptyCompositeTypePruning: skip pruning object types or interfaces with no fields
if (skipEmptyCompositeTypePruning && !Object.keys(type.getFields()).length) {
return type;
}
}
// skipUnimplementedInterfacesPruning: skip pruning interfaces that are not implemented by any other types
if (isInterfaceType(type) && skipUnimplementedInterfacesPruning) {
return type;
}
}
prunedTypes.push(type.name);
visited.delete(type.name);
return null;
}
return type;
},
});
} while (prunedTypes.length); // Might have empty types and need to prune again
return prunedSchema;
}
function visitSchema(schema: GraphQLSchema): Set<string> {
const queue: string[] = []; // queue of nodes to visit
// Grab the root types and start there
for (const type of getRootTypes(schema)) {
queue.push(type.name);
}
return visitQueue(queue, schema);
}
function visitQueue(
queue: string[],
schema: GraphQLSchema,
visited: Set<string> = new Set<string>(),
): Set<string> {
// Interfaces encountered that are field return types need to be revisited to add their implementations
const revisit: Map<string, boolean> = new Map<string, boolean>();
// Navigate all types starting with pre-queued types (root types)
while (queue.length) {
const typeName = queue.pop() as string;
// Skip types we already visited unless it is an interface type that needs revisiting
if (visited.has(typeName) && revisit[typeName] !== true) {
continue;
}
const type = schema.getType(typeName);
if (type) {
// Get types for union
if (isUnionType(type)) {
queue.push(...type.getTypes().map(type => type.name));
}
// If it is an interface and it is a returned type, grab all implementations so we can use proper __typename in fragments
if (isInterfaceType(type) && revisit[typeName] === true) {
queue.push(...getImplementingTypes(type.name, schema));
// No need to revisit this interface again
revisit[typeName] = false;
}
if (isEnumType(type)) {
// Visit enum values directives argument types
queue.push(
...type.getValues().flatMap(value => getDirectivesArgumentsTypeNames(schema, value)),
);
}
// Visit interfaces this type is implementing if they haven't been visited yet
if ('getInterfaces' in type) {
// Only pushes to queue to visit but not return types
queue.push(...type.getInterfaces().map(iface => iface.name));
}
// If the type has fields visit those field types
if ('getFields' in type) {
const fields = type.getFields() as GraphQLFieldMap<any, any>;
const entries = Object.entries(fields);
if (!entries.length) {
continue;
}
for (const [, field] of entries) {
if (isObjectType(type)) {
// Visit arg types and arg directives arguments types
queue.push(
...field.args.flatMap(arg => {
const typeNames = [getNamedType(arg.type).name];
typeNames.push(...getDirectivesArgumentsTypeNames(schema, arg));
return typeNames;
}),
);
}
const namedType = getNamedType(field.type);
queue.push(namedType.name);
queue.push(...getDirectivesArgumentsTypeNames(schema, field));
// Interfaces returned on fields need to be revisited to add their implementations
if (isInterfaceType(namedType) && !(namedType.name in revisit)) {
revisit[namedType.name] = true;
}
}
}
queue.push(...getDirectivesArgumentsTypeNames(schema, type));
visited.add(typeName); // Mark as visited (and therefore it is used and should be kept)
}
}
return visited;
}
function getDirectivesArgumentsTypeNames(
schema: GraphQLSchema,
directableObj: DirectableGraphQLObject,
) {
const argTypeNames = new Set<string>();
if (directableObj.astNode?.directives) {
for (const directiveNode of directableObj.astNode.directives) {
const directive = schema.getDirective(directiveNode.name.value);
if (directive?.args) {
for (const arg of directive.args) {
const argType = getNamedType(arg.type);
argTypeNames.add(argType.name);
}
}
}
}
if (directableObj.extensions?.['directives']) {
for (const directiveName in directableObj.extensions['directives']) {
const directive = schema.getDirective(directiveName);
if (directive?.args) {
for (const arg of directive.args) {
const argType = getNamedType(arg.type);
argTypeNames.add(argType.name);
}
}
}
}
return [...argTypeNames];
}
``` | /content/code_sandbox/packages/utils/src/prune.ts | xml | 2016-03-22T00:14:38 | 2024-08-16T02:02:06 | graphql-tools | ardatan/graphql-tools | 5,331 | 1,660 |
```xml
import log from "../log";
import colors from "chalk";
import {Command} from "commander";
import Config from "../config";
import Utils from "./utils";
const program = new Command("uninstall");
program
.argument("<package>", "The package to uninstall")
.description("Uninstall a theme or a package")
.on("--help", Utils.extraHelp)
.action(async function (packageName: string) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const fs = require("fs").promises;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");
const packagesConfig = path.join(Config.getPackagesPath(), "package.json");
// const packages = JSON.parse(fs.readFileSync(packagesConfig, "utf-8"));
const packages = JSON.parse(await fs.readFile(packagesConfig, "utf-8"));
if (
!packages.dependencies ||
!Object.prototype.hasOwnProperty.call(packages.dependencies, packageName)
) {
log.warn(`${colors.green(packageName)} is not installed.`);
process.exit(1);
}
log.info(`Uninstalling ${colors.green(packageName)}...`);
try {
await Utils.executeYarnCommand("remove", packageName);
log.info(`${colors.green(packageName)} has been successfully uninstalled.`);
} catch (code_1) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
log.error(`Failed to uninstall ${colors.green(packageName)}. Exit code: ${code_1}`);
process.exit(1);
}
});
export default program;
``` | /content/code_sandbox/server/command-line/uninstall.ts | xml | 2016-02-09T03:16:03 | 2024-08-16T10:52:38 | thelounge | thelounge/thelounge | 5,518 | 343 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="path_to_url"
xmlns="path_to_url"
xsi:schemaLocation="path_to_url path_to_url"
version="3.0">
<!-- -->
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<!-- springWEB-INFapplicationContext.xml -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:applicationContext*.xml
</param-value>
</context-param>
<!-- -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<!-- springMVC -->
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:springMVC-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- shiroFilter -->
<filter>
<filter-name>shiroFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>shiroFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- session -->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- -->
<error-page>
<error-code>403</error-code>
<location>/WEB-INF/jsp/403.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/jsp/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/jsp/500.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/WEB-INF/jsp/error.jsp</location>
</error-page>
</web-app>
``` | /content/code_sandbox/zheng-cms/zheng-cms-admin/src/main/webapp/WEB-INF/web.xml | xml | 2016-10-04T10:07:06 | 2024-08-16T07:00:44 | zheng | shuzheng/zheng | 16,660 | 758 |
```xml
import { useSetting } from "@Core/Hooks";
import { SearchBar } from "@Core/Search/SearchBar";
import type { SearchBarAppearance } from "@Core/Search/SearchBarAppearance";
import type { SearchBarSize } from "@Core/Search/SearchBarSize";
import { Setting } from "@Core/Settings/Setting";
import { SettingGroup } from "@Core/Settings/SettingGroup";
import { Button, Dropdown, Input, Option, Switch, Tooltip } from "@fluentui/react-components";
import { ArrowCounterclockwiseRegular } from "@fluentui/react-icons";
import { useTranslation } from "react-i18next";
export const SearchBarSettings = () => {
const ns = "settingsAppearance";
const { t } = useTranslation();
const { value: searchBarSize, updateValue: setSearchBarSize } = useSetting<SearchBarSize>({
key: "appearance.searchBarSize",
defaultValue: "large",
});
const { value: searchBarAppearance, updateValue: setSearchBarAppearance } = useSetting<SearchBarAppearance>({
key: "appearance.searchBarAppearance",
defaultValue: "auto",
});
const { value: searchBarPlaceholderText, updateValue: setSearchBarPlaceholderText } = useSetting<string>({
key: "appearance.searchBarPlaceholderText",
defaultValue: t("searchBarPlaceholderText", { ns: "search" }),
});
const { value: showIcon, updateValue: setShowIcon } = useSetting<boolean>({
key: "appearance.showSearchIcon",
defaultValue: true,
});
const resetPlaceholderText = () => setSearchBarPlaceholderText(t("searchBarPlaceholderText", { ns: "search" }));
return (
<SettingGroup title={t("searchBar", { ns })}>
<Setting
label={t("searchBarPreview", { ns })}
control={
<div style={{ display: "flex", flexDirection: "column", width: "100%" }}>
<SearchBar
searchBarSize={searchBarSize}
searchBarAppearance={searchBarAppearance}
searchBarPlaceholderText={searchBarPlaceholderText}
showIcon={showIcon}
/>
</div>
}
/>
<Setting
label={t("searchBarSize", { ns })}
control={
<Dropdown
value={t(`searchBarSize.${searchBarSize}`, { ns })}
selectedOptions={[searchBarSize]}
onOptionSelect={(_, { optionValue }) =>
optionValue && setSearchBarSize(optionValue as SearchBarSize)
}
>
<Option value="small">{t("searchBarSize.small", { ns })}</Option>
<Option value="medium">{t("searchBarSize.medium", { ns })}</Option>
<Option value="large">{t("searchBarSize.large", { ns })}</Option>
</Dropdown>
}
/>
<Setting
label={t("searchBarAppearance", { ns })}
control={
<Dropdown
value={t(`searchBarAppearance.${searchBarAppearance}`, { ns })}
selectedOptions={[searchBarAppearance]}
onOptionSelect={(_, { optionValue }) =>
optionValue && setSearchBarAppearance(optionValue as SearchBarAppearance)
}
>
<Option value="auto">{t("searchBarAppearance.auto", { ns })}</Option>
<Option value="outline">{t("searchBarAppearance.outline", { ns })}</Option>
<Option value="underline">{t("searchBarAppearance.underline", { ns })}</Option>
<Option value="filled-darker">{t("searchBarAppearance.filled-darker", { ns })}</Option>
<Option value="filled-lighter">{t("searchBarAppearance.filled-lighter", { ns })}</Option>
</Dropdown>
}
/>
<Setting
label={t("searchBarPlaceholderText", { ns })}
control={
<div style={{ display: "flex", flexDirection: "column", width: "100%" }}>
<Input
value={searchBarPlaceholderText}
onChange={(_, { value }) => setSearchBarPlaceholderText(value)}
contentAfter={
<Tooltip
content={t("searchBarPlaceholderTextReset", { ns })}
relationship="label"
withArrow
>
<Button
size="small"
appearance="subtle"
icon={<ArrowCounterclockwiseRegular fontSize={14} />}
onClick={resetPlaceholderText}
/>
</Tooltip>
}
/>
</div>
}
/>
<Setting
label={t("searchBarShowIcon", { ns })}
control={<Switch checked={showIcon} onChange={(_, { checked }) => setShowIcon(checked)} />}
/>
</SettingGroup>
);
};
``` | /content/code_sandbox/src/renderer/Core/Settings/Pages/Appearance/SearchBarSettings.tsx | xml | 2016-10-11T04:59:52 | 2024-08-16T11:53:31 | ueli | oliverschwendener/ueli | 3,543 | 998 |
```xml
import React, { useCallback } from 'react'
import styled from '../../../../design/lib/styled'
import PropertyValueButton from './PropertyValueButton'
import { mdiCheckboxBlankOutline, mdiCheckBoxOutline } from '@mdi/js'
import Icon, { IconSize } from '../../../../design/components/atoms/Icon'
interface CheckboxSelectProps {
sending?: boolean
value?: boolean
iconSize?: IconSize
disabled?: boolean
isReadOnly: boolean
showIcon?: boolean
popupAlignment?: 'bottom-left' | 'top-left'
onCheckboxToggle: () => void
}
const CheckboxSelect = ({
iconSize = 16,
value = false,
sending,
disabled,
isReadOnly,
showIcon,
onCheckboxToggle,
}: CheckboxSelectProps) => {
const onCheckboxChange = useCallback(() => {
onCheckboxToggle()
}, [onCheckboxToggle])
return (
<CheckboxContainer>
<PropertyValueButton
sending={sending}
isReadOnly={isReadOnly}
disabled={disabled}
onClick={() => onCheckboxChange()}
iconPath={showIcon ? mdiCheckBoxOutline : undefined}
>
<div className='checkbox-select__label'>
<Icon
size={iconSize}
path={value == true ? mdiCheckBoxOutline : mdiCheckboxBlankOutline}
/>
</div>
</PropertyValueButton>
</CheckboxContainer>
)
}
export default CheckboxSelect
const CheckboxContainer = styled.div`
.checkbox-select__label {
border-radius: 4px;
color: white;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
`
``` | /content/code_sandbox/src/cloud/components/Props/Pickers/CheckboxSelect.tsx | xml | 2016-11-19T14:30:34 | 2024-08-16T03:13:45 | BoostNote-App | BoostIO/BoostNote-App | 3,745 | 349 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="TI Basic" version="2" kateversion="2.2" section="Scientific" extensions="">
<highlighting>
<list name="keywords">
<item>If</item>
<item>Then</item>
<item>Else</item>
<item>For</item>
<item>While</item>
<item>Repeat</item>
<item>End</item>
<item>Pause</item>
<item>Lbl</item>
<item>Goto</item>
<item>IS></item>
<item>DS<</item>
<item>Menu</item>
<item>prgm</item>
<item>Return</item>
<item>DelVar</item>
<item>GraphStyle</item>
<item>Input</item>
<item>Prompt</item>
<item>Disp</item>
<item>DispGraph</item>
<item>DispTable</item>
<item>Output</item>
<item>getKey</item>
<item>ClrHome</item>
<item>ClrTable</item>
<item>GetCalc</item>
<item>Get</item>
<item>Send</item>
<item>prgm</item>
</list>
<list name="special_sym">
<item>net</item>
<item>eogt</item>
<item>eolt</item>
<item>sqrt</item>
<item>%THETA</item>
</list>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<keyword attribute="Keyword" context="#stay" String="keywords"/>
<keyword attribute="Special operators" context="#stay" String="special_sym" />
<Detect2Chars attribute="Assignment" context="#stay" char="-" char1=">"/>
<Detect2Chars attribute="Assignment" context="#stay" char="s" char1="t"/>
<RegExpr attribute="Matrix" context="#stay" String="\[\w\]" />
<DetectChar attribute="String" context="String" char="""/>
</context>
<context attribute="String" lineEndContext="#stay" name="String">
<DetectChar attribute="String" context="#pop" char="""/>
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal"/>
<itemData name="Assignment" defStyleNum="dsOthers" />
<itemData name="Keyword" defStyleNum="dsKeyword" />
<itemData name="String" defStyleNum="dsString" />
<itemData name="Special operators" defStyleNum="dsNormal" />
<itemData name="Matrix" defStyleNum="dsNormal" />
</itemDatas>
</highlighting>
<general>
<keywords casesensitive="0" weakDeliminator="%<>"/>
</general>
</language>
``` | /content/code_sandbox/src/data/extra/syntax-highlighting/syntax/tibasic.xml | xml | 2016-10-05T07:24:54 | 2024-08-16T05:03:40 | vnote | vnotex/vnote | 11,687 | 690 |
```xml
import type { Element as IceElement } from '../dom/element.js';
import type { Text as IceText } from '../dom/text.js';
import type { Element, Text } from '../dom-external/inner-html/parser.js';
export interface Options {
prerender: boolean;
debug: boolean;
html?: {
skipElements: Set<string>;
voidElements: Set<string>;
closingElements: Set<string>;
transformText?: (iceText: IceText, text: Text) => IceText;
transformElement?: (iceElement: IceElement, element: Element) => IceElement;
renderHTMLTag: boolean;
};
miniGlobal?: any;
}
``` | /content/code_sandbox/packages/miniapp-runtime/src/interface/options.ts | xml | 2016-11-03T06:59:15 | 2024-08-16T10:11:29 | ice | alibaba/ice | 17,815 | 142 |
```xml
import { Component } from 'react';
import { AnyShapeCoordinates } from './util/types';
export interface Props {
// lat lng array (circle, line, symbol) or array of array... of lat lng (polygons)
coordinates: AnyShapeCoordinates;
// tslint:disable-next-line:no-any
properties?: any;
onClick?: React.MouseEventHandler<HTMLElement>;
onMouseEnter?: React.MouseEventHandler<HTMLElement>;
onMouseLeave?: React.MouseEventHandler<HTMLElement>;
draggable?: boolean;
onDragStart?: React.MouseEventHandler<HTMLElement>;
onDrag?: React.MouseEventHandler<HTMLElement>;
onDragEnd?: React.MouseEventHandler<HTMLElement>;
}
export class Feature extends Component<Props> {
public render() {
return null;
}
}
export default Feature;
``` | /content/code_sandbox/src/feature.ts | xml | 2016-04-16T08:23:57 | 2024-08-08T07:47:19 | react-mapbox-gl | alex3165/react-mapbox-gl | 1,907 | 154 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const LinkedDatabaseIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M128 1600q0 20 13 35t27 28q35 29 81 50t98 35 107 23 111 13 107 6 96 2v128h-74q-47 0-116-6t-147-20-154-37-138-59-100-85-39-113V448q0-69 39-119t103-86 142-58 157-35 148-17 115-5q45 0 115 4t148 17 157 35 142 58 102 86 40 120v576h-128V637q-58 37-130 62t-148 40-154 22-144 7q-68 0-144-6t-153-22-149-41-130-62v963zM704 256q-59 0-132 6t-148 20-142 40-114 63q-14 12-27 27t-13 36q0 20 13 35t27 28q46 38 114 63t142 39 147 21 133 6q58 0 131-6t148-20 142-40 114-63q14-11 your_sha256_hashzm384 1024q-40 0-75 15t-61 41-41 61-15 75q0 65 37 113t97 70q-6 36-6 73 0 15 1 29t3 29q-56-9-104-38t-82-71-54-96-20-109q0-66 25-124t68-102 102-69 125-25h256q66 0 124 25t101 69 69 102 26 124q0 54-20 105t-56 93-81 73-99 43v-133q42-9 67-23t38-36 18-52 5-70q0-40-15-75t-41-61-61-41-75-15h-256zm700 134q57 12 104 40t82 70 54 93 20 111q0 66-25 124t-68 102-102 69-125 25h-256q-67 0-125-25t-101-68-69-102-25-125q0-57 19-109t53-93 81-71 103-41v133q-58 21-93 69t-35 112q0 40 15 75t41 61 61 41 75 15h256q40 0 75-15t61-41 41-61 15-75q0-65-37-113t-97-70q6-36 6-73 0-15-1-29t-3-29z" />
</svg>
),
displayName: 'LinkedDatabaseIcon',
});
export default LinkedDatabaseIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/LinkedDatabaseIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 762 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- DO NOT EDIT. This is to override default media3 notification drawables. -->
<drawable name="media3_notification_play">@drawable/ic_play_vector</drawable>
<drawable name="media3_notification_pause">@drawable/ic_pause_vector</drawable>
<drawable name="media3_notification_seek_to_next">@drawable/ic_next_vector</drawable>
<drawable name="media3_notification_seek_to_previous">@drawable/ic_previous_vector</drawable>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/drawables.xml | xml | 2016-01-10T12:21:23 | 2024-08-16T13:03:46 | Simple-Music-Player | SimpleMobileTools/Simple-Music-Player | 1,277 | 111 |
```xml
import { createNext, FileRef } from 'e2e-utils'
import { NextInstance } from 'e2e-utils'
import webdriver from 'next-webdriver'
describe('navigation between pages and app dir', () => {
let next: NextInstance
beforeAll(async () => {
next = await createNext({
files: new FileRef(__dirname),
dependencies: {
typescript: 'latest',
'@types/react': 'latest',
'@types/node': 'latest',
},
})
})
afterAll(() => next.destroy())
it('It should be able to navigate app -> pages', async () => {
const browser = await webdriver(next.url, '/app')
expect(await browser.elementById('app-page').text()).toBe('App Page')
await browser
.elementById('link-to-pages')
.click()
.waitForElementByCss('#pages-page')
expect(await browser.hasElementByCssSelector('#app-page')).toBeFalse()
expect(await browser.elementById('pages-page').text()).toBe('Pages Page')
})
it('It should be able to navigate pages -> app', async () => {
const browser = await webdriver(next.url, '/pages')
expect(await browser.elementById('pages-page').text()).toBe('Pages Page')
await browser
.elementById('link-to-app')
.click()
.waitForElementByCss('#app-page')
expect(await browser.hasElementByCssSelector('#pages-page')).toBeFalse()
expect(await browser.elementById('app-page').text()).toBe('App Page')
})
// TODO: re-enable after 404 transition bug is addressed
if (!(global as any).isNextDeploy) {
it('It should be able to navigate pages -> app and go back an forward', async () => {
const browser = await webdriver(next.url, '/pages')
await browser
.elementById('link-to-app')
.click()
.waitForElementByCss('#app-page')
await browser.back().waitForElementByCss('#pages-page')
expect(await browser.hasElementByCssSelector('#app-page')).toBeFalse()
expect(await browser.elementById('pages-page').text()).toBe('Pages Page')
await browser.forward().waitForElementByCss('#app-page')
expect(await browser.hasElementByCssSelector('#pages-page')).toBeFalse()
expect(await browser.elementById('app-page').text()).toBe('App Page')
})
it('It should be able to navigate app -> pages and go back and forward', async () => {
const browser = await webdriver(next.url, '/app')
await browser
.elementById('link-to-pages')
.click()
.waitForElementByCss('#pages-page')
await browser.back().waitForElementByCss('#app-page')
expect(await browser.hasElementByCssSelector('#pages-page')).toBeFalse()
expect(await browser.elementById('app-page').text()).toBe('App Page')
await browser.forward().waitForElementByCss('#pages-page')
expect(await browser.hasElementByCssSelector('#app-page')).toBeFalse()
expect(await browser.elementById('pages-page').text()).toBe('Pages Page')
})
}
})
``` | /content/code_sandbox/test/e2e/app-dir/interoperability-with-pages/navigation.test.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 674 |
```xml
/// <reference path="../logic/FlowManager.ts"/>
// namespace
namespace cf {
// interface
// class
export class ProgressBar {
private flowUpdateCallback: () => void;
public el: HTMLElement;
private bar: HTMLElement;
private eventTarget: EventDispatcher;
constructor(options: IBasicElementOptions){
this.flowUpdateCallback = this.onFlowUpdate.bind(this);
this.eventTarget = options.eventTarget;
this.eventTarget.addEventListener(FlowEvents.FLOW_UPDATE, this.flowUpdateCallback, false);
this.eventTarget.addEventListener(FlowEvents.FORM_SUBMIT, () => this.setWidth(100), false);
this.el = document.createElement("div");
this.el.className = "cf-progressBar";
this.bar = document.createElement("div");
this.bar.className = 'bar';
this.el.appendChild(this.bar);
setTimeout(() => this.init(), 800);
}
private init () {
this.el.classList.add('show');
}
private onFlowUpdate(event: CustomEvent){
this.setWidth(event.detail.step / event.detail.maxSteps * 100);
}
private setWidth (percentage: number) {
this.bar.style.width = `${percentage}%`;
}
public dealloc(){
this.eventTarget.removeEventListener(FlowEvents.FLOW_UPDATE, this.flowUpdateCallback, false);
this.flowUpdateCallback = null;
}
}
}
``` | /content/code_sandbox/src/scripts/cf/ui/ProgressBar.ts | xml | 2016-10-14T12:54:59 | 2024-08-16T12:03:40 | conversational-form | space10-community/conversational-form | 3,795 | 292 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="path_to_url">
<translate
android:fromXDelta="0"
android:toXDelta="-100%"
android:duration="200" />
</set>
``` | /content/code_sandbox/Android/Intents/app/src/main/res/anim/activity_out.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 58 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="@dimen/tech_image_height">
<ImageView
android:id="@+id/iv_tech_bar_image_blur"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
<ImageView
android:id="@+id/iv_tech_bar_image_origin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:background="@drawable/bottom_black_bg"/>
<TextView
android:id="@+id/tv_tech_bar_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:padding="11dp"
android:layout_marginBottom="3dp"
android:textSize="24sp"
android:textColor="@android:color/white"
/>
</FrameLayout>
``` | /content/code_sandbox/app/src/main/res/layout/view_tech_head.xml | xml | 2016-08-07T14:56:56 | 2024-08-13T01:11:07 | GeekNews | codeestX/GeekNews | 3,498 | 270 |
```xml
export default function Page() {
return <div>/[locale]/nested/[foo]/[bar]/default.tsx</div>
}
``` | /content/code_sandbox/test/e2e/app-dir/parallel-routes-catchall-default/app/[locale]/nested/[foo]/[bar]/default.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 29 |
```xml
import { put, takeEvery } from 'redux-saga/effects';
import { removeInvite } from '@proton/pass/lib/invites/invite.requests';
import { inviteRemoveFailure, inviteRemoveIntent, inviteRemoveSuccess } from '@proton/pass/store/actions';
function* removeInviteWorker({ payload, meta: { request } }: ReturnType<typeof inviteRemoveIntent>) {
try {
yield removeInvite(payload);
yield put(inviteRemoveSuccess(request.id, payload.shareId, payload.inviteId));
} catch (err) {
yield put(inviteRemoveFailure(request.id, err));
}
}
export default function* watcher() {
yield takeEvery(inviteRemoveIntent.match, removeInviteWorker);
}
``` | /content/code_sandbox/packages/pass/store/sagas/invites/invite-remove.saga.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 148 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="path_to_url" xmlns:xsi="path_to_url" xmlns:xsd="path_to_url" xmlns:flowable="path_to_url" xmlns:bpmndi="path_to_url" xmlns:omgdc="path_to_url" xmlns:omgdi="path_to_url" xmlns:design="path_to_url" typeLanguage="path_to_url" expressionLanguage="path_to_url" targetNamespace="path_to_url" design:palette="flowable-work-process-palette">
<process id="missingVariableListenerVariableName" name="missingVariableListenerVariableName" isExecutable="true" flowable:candidateStarterGroups="flowableUser">
<extensionElements>
<design:stencilid><![CDATA[BPMNDiagram]]></design:stencilid>
<design:creationdate><![CDATA[2024-06-11T06:08:01.488Z]]></design:creationdate>
<design:modificationdate><![CDATA[2024-06-11T06:11:42.890Z]]></design:modificationdate>
</extensionElements>
<subProcess id="eventSubProcess" name="Event-subprocess" triggeredByEvent="true">
<extensionElements>
<design:stencilid><![CDATA[EventSubprocess]]></design:stencilid>
</extensionElements>
<userTask id="subTask" name="subTask" flowable:assignee="${initiator}" flowable:formFieldValidation="false">
<extensionElements>
<flowable:task-candidates-type><![CDATA[all]]></flowable:task-candidates-type>
<design:stencilid><![CDATA[FormTask]]></design:stencilid>
<design:stencilsuperid><![CDATA[Task]]></design:stencilsuperid>
</extensionElements>
</userTask>
<startEvent id="variableListenerStartEvent" isInterrupting="false">
<extensionElements>
<flowable:variableListenerEventDefinition variableChangeType="all"></flowable:variableListenerEventDefinition>
<flowable:work-form-field-validation><![CDATA[false]]></flowable:work-form-field-validation>
</extensionElements>
</startEvent>
<endEvent id="subEndEvent">
<extensionElements>
<design:stencilid><![CDATA[EndNoneEvent]]></design:stencilid>
</extensionElements>
</endEvent>
<sequenceFlow id="bpmnSequenceFlow_6" sourceRef="subTask" targetRef="subEndEvent">
<extensionElements>
<design:stencilid><![CDATA[SequenceFlow]]></design:stencilid>
</extensionElements>
</sequenceFlow>
<sequenceFlow id="bpmnSequenceFlow_4" sourceRef="variableListenerStartEvent" targetRef="subTask">
<extensionElements>
<design:stencilid><![CDATA[SequenceFlow]]></design:stencilid>
</extensionElements>
</sequenceFlow>
</subProcess>
<userTask id="mainTask" name="mainTask" flowable:assignee="${initiator}" flowable:formFieldValidation="false">
<extensionElements>
<flowable:task-candidates-type><![CDATA[all]]></flowable:task-candidates-type>
<design:stencilid><![CDATA[FormTask]]></design:stencilid>
<design:stencilsuperid><![CDATA[Task]]></design:stencilsuperid>
</extensionElements>
</userTask>
<startEvent id="mainStartEvent" flowable:initiator="initiator" flowable:formFieldValidation="false">
<extensionElements>
<flowable:work-form-field-validation><![CDATA[false]]></flowable:work-form-field-validation>
<design:stencilid><![CDATA[StartNoneEvent]]></design:stencilid>
</extensionElements>
</startEvent>
<endEvent id="mainEndEvent">
<extensionElements>
<design:stencilid><![CDATA[EndNoneEvent]]></design:stencilid>
</extensionElements>
</endEvent>
<sequenceFlow id="bpmnSequenceFlow_10" sourceRef="mainTask" targetRef="mainEndEvent">
<extensionElements>
<design:stencilid><![CDATA[SequenceFlow]]></design:stencilid>
</extensionElements>
</sequenceFlow>
<sequenceFlow id="bpmnSequenceFlow_8" sourceRef="mainStartEvent" targetRef="mainTask">
<extensionElements>
<design:stencilid><![CDATA[SequenceFlow]]></design:stencilid>
</extensionElements>
</sequenceFlow>
</process>
</definitions>
``` | /content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/validation/missingVariableEventListenerVariableName.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 1,025 |
```xml
import { Entity, ManyToOne, PrimaryGeneratedColumn } from "../../../../src"
import { C } from "./C"
@Entity()
export class D {
@PrimaryGeneratedColumn("increment")
id!: number
@ManyToOne(() => C, (c) => c.ds, {
onDelete: "CASCADE",
onUpdate: "CASCADE",
})
c!: C
}
``` | /content/code_sandbox/test/github-issues/9944/entity/D.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 78 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<bean id="dataSource" class="org.flowable.common.engine.impl.test.ClosingDataSource">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<constructor-arg>
<bean class="com.zaxxer.hikari.HikariConfig">
<property name="minimumIdle" value="0" />
<property name="jdbcUrl" value="${jdbc.url:jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000}"/>
<property name="driverClassName" value="${jdbc.driver:org.h2.Driver}"/>
<property name="username" value="${jdbc.username:sa}"/>
<property name="password" value="${jdbc.password:}"/>
</bean>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean id="processEngineConfiguration" class="org.flowable.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration">
<property name="dataSource" ref="dataSource"/>
<property name="engineLifecycleListeners">
<list>
<ref bean="dataSource"/>
</list>
</property>
<!-- Database configurations -->
<property name="databaseSchemaUpdate" value="true" />
<!-- job executor configurations -->
<property name="asyncExecutorActivate" value="false" />
<!-- Add typed event listener -->
<property name="typedEventListeners">
<map>
<entry key="CUSTOM" >
<list>
<ref bean="eventListener" />
</list>
</entry>
<entry key="ENTITY_DELETED,ENTITY_UPDATED" >
<list>
<ref bean="eventListener" />
</list>
</entry>
</map>
</property>
<!-- Also register the eventlistener as bean, to be able to access it from the tests -->
<property name="beans">
<map>
<entry key="eventListener" value-ref="eventListener" />
</map>
</property>
</bean>
<!-- The actual event-listener instance -->
<bean id="eventListener" class="org.flowable.engine.test.api.event.TestFlowableEventListener" />
</beans>
``` | /content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/standalone/event/flowable-typed-eventlistener.cfg.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 528 |
```xml
let item = 0
if (true) {;
[0][0] = 0
item = [0][0]
item = [0].length
item = [0].pop();
[0].push(0)
} else {
item = item
}
``` | /content/code_sandbox/tests/blocklycompiler-test/baselines/lists_empty_inputs2.ts | xml | 2016-01-24T19:35:52 | 2024-08-16T16:39:39 | pxt | microsoft/pxt | 2,069 | 64 |
```xml
import { Stack, Typography } from '@mui/material';
import { CreateButton } from 'react-admin';
import useAppBarHeight from '../misc/useAppBarHeight';
export const CompanyEmpty = () => {
const appbarHeight = useAppBarHeight();
return (
<Stack
justifyContent="center"
alignItems="center"
gap={3}
sx={{
height: `calc(100dvh - ${appbarHeight}px)`,
}}
>
<img src="./img/empty.svg" alt="No contacts found" />
<Stack gap={0} alignItems="center">
<Typography variant="h6" fontWeight="bold">
No companies found
</Typography>
<Typography
variant="body2"
align="center"
color="text.secondary"
gutterBottom
>
It seems your company list is empty.
</Typography>
</Stack>
<Stack spacing={2} direction="row">
<CreateButton variant="contained" label="Create Company" />
</Stack>
</Stack>
);
};
``` | /content/code_sandbox/examples/crm/src/companies/CompanyEmpty.tsx | xml | 2016-07-13T07:58:54 | 2024-08-16T18:32:27 | react-admin | marmelab/react-admin | 24,624 | 226 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<schema name="test" version="1.6">
<fieldType name="binary" class="solr.BinaryField"/>
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
<fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
<fieldType name="date" class="solr.TrieDateField" positionIncrementGap="0" docValues="true" precisionStep="0"/>
<fieldType name="dates" class="solr.TrieDateField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="0"/>
<fieldType name="double" class="solr.TrieDoubleField" positionIncrementGap="0" docValues="true" precisionStep="0"/>
<fieldType name="doubles" class="solr.TrieDoubleField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="0"/>
<fieldType name="float" class="solr.TrieFloatField" positionIncrementGap="0" docValues="true" precisionStep="0"/>
<fieldType name="floats" class="solr.TrieFloatField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="0"/>
<fieldType name="ignored" class="solr.StrField" indexed="false" stored="false" docValues="false"
multiValued="true"/>
<fieldType name="int" class="solr.TrieIntField" positionIncrementGap="0" docValues="true" precisionStep="0"/>
<fieldType name="ints" class="solr.TrieIntField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="0"/>
<fieldType name="long" class="solr.TrieLongField" positionIncrementGap="0" docValues="true" precisionStep="0"/>
<fieldType name="longs" class="solr.TrieLongField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="0"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" docValues="true"/>
<fieldType name="strings" class="solr.StrField" sortMissingLast="true" docValues="true" multiValued="true"/>
<fieldType name="tdate" class="solr.TrieDateField" positionIncrementGap="0" docValues="true" precisionStep="6"/>
<fieldType name="tdates" class="solr.TrieDateField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="6"/>
<fieldType name="tdouble" class="solr.TrieDoubleField" positionIncrementGap="0" docValues="true" precisionStep="8"/>
<fieldType name="tdoubles" class="solr.TrieDoubleField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="8"/>
<fieldType name="tfloat" class="solr.TrieFloatField" positionIncrementGap="0" docValues="true" precisionStep="8"/>
<fieldType name="tfloats" class="solr.TrieFloatField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="8"/>
<fieldType name="tint" class="solr.TrieIntField" positionIncrementGap="0" docValues="true" precisionStep="8"/>
<fieldType name="tints" class="solr.TrieIntField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="8"/>
<fieldType name="tlong" class="solr.TrieLongField" positionIncrementGap="0" docValues="true" precisionStep="8"/>
<fieldType name="tlongs" class="solr.TrieLongField" positionIncrementGap="0" docValues="true" multiValued="true"
precisionStep="8"/>
<fieldType name="pdate" class="solr.DatePointField" docValues="true"/>
<fieldType name="pint" class="solr.IntPointField" docValues="true"/>
<fieldType name="pfloat" class="solr.FloatPointField" docValues="true"/>
<fieldType name="plong" class="solr.LongPointField" docValues="true"/>
<fieldType name="pdouble" class="solr.DoublePointField" docValues="true"/>
<fieldType name="pints" class="solr.IntPointField" docValues="true" multiValued="true"/>
<fieldType name="pfloats" class="solr.FloatPointField" docValues="true" multiValued="true"/>
<fieldType name="plongs" class="solr.LongPointField" docValues="true" multiValued="true"/>
<fieldType name="pdoubles" class="solr.DoublePointField" docValues="true" multiValued="true"/>
<field name="_version_" type="long" indexed="true" stored="true"/>
<field name="title" type="string" docValues="true" multiValued="false" indexed="true" stored="true"/>
<field name="router" type="string" docValues="false" multiValued="false" indexed="false" stored="false"/>
<field name="comment" type="string" docValues="true" multiValued="false" indexed="false" stored="true"/>
<uniqueKey>title</uniqueKey>
</schema>
``` | /content/code_sandbox/solr/src/test/resources/conf/schema.xml | xml | 2016-10-13T13:08:14 | 2024-08-15T07:57:42 | alpakka | akka/alpakka | 1,265 | 1,274 |
```xml
<manifest xmlns:android="path_to_url"
package="com.jph.githubpopular"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
``` | /content/code_sandbox/android/app/src/main/AndroidManifest.xml | xml | 2016-07-18T15:35:16 | 2024-08-14T00:06:02 | GitHubPopular | crazycodeboy/GitHubPopular | 2,899 | 236 |
```xml
import { BaseService } from "./baseSvc";
import { IFileItem } from "../../interfaces/IFileItem";
import { IFile } from "../../interfaces/IFile";
export declare class FileUploadService {
private baseService;
private $q;
static $inject: string[];
constructor(baseService: BaseService, $q: ng.IQService);
uploadFile(libraryName: string, file: IFile): ng.IPromise<IFileItem>;
getFiles(libraryName: string, rowLimit: number): ng.IPromise<Array<IFileItem>>;
deleteFile(libraryName: string, id: number): ng.IPromise<any>;
}
``` | /content/code_sandbox/samples/angular-ngofficeuifabric-file-upload/lib/webparts/angularFileUpload/app/services/fileUploadSvc.d.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 132 |
```xml
import * as React from 'react';
import ReactMapboxGl, { Marker } from '../../../';
import styled from 'styled-components';
import Dropdown from '../dropdown';
// tslint:disable-next-line:no-var-requires
const { token, styles } = require('./config.json');
const geocodingUrl = 'path_to_url
// tslint:disable-next-line:max-line-length
const mapboxGeocoding = (query: string) =>
`${geocodingUrl}/mapbox.places/${query}.json?access_token=${token}`;
const Container = styled.div`
position: relative;
height: 100%;
flex: 1;
`;
const Mark = styled.div`
background-color: #e74c3c;
border-radius: 50%;
width: 20px;
height: 20px;
border: 4px solid #eaa29b;
`;
const Map = ReactMapboxGl({ accessToken: token });
const mapStyle = {
width: '100%',
height: '100%'
};
export interface Place {
id: string;
name: string;
center: [number, number];
}
export interface State {
query: string;
options: Place[];
selected?: Place;
center: [number, number];
}
const req = (url: string, body?: any, method = 'GET') =>
new Request(url, {
method,
headers: new Headers({
Accept: 'application/json',
'Content-Type': 'application/json',
'Accept-Charset': 'utf-8'
}),
body
});
export interface Props {
// tslint:disable-next-line:no-any
onStyleLoad?: (map: any) => any;
}
class HtmlFeatures extends React.Component<Props, State> {
public state: State = {
query: '',
options: [],
selected: undefined,
center: [-0.1148677, 51.5139573]
};
private fetch = (query: string) => {
fetch(req(mapboxGeocoding(query)))
.then((res: any) => res.json())
.then((data: any) => {
this.setState({
options: data.features
.filter((place: any) => place.place_type.includes('poi'))
.map((poi: any) => ({
id: poi.id,
center: poi.center,
name: poi.text
}))
});
});
};
private onSelectItem = (index: number) => {
const selected = this.state.options[index];
this.setState({
selected,
center: selected.center
});
};
private onSearch = (query: string) => {
this.setState({ query });
this.fetch(query);
};
private onStyleLoad = (map: any) => {
const { onStyleLoad } = this.props;
return onStyleLoad && onStyleLoad(map);
};
public render() {
const { options, selected, center } = this.state;
return (
<Container>
<Dropdown
onSearch={this.onSearch}
onSelectItem={this.onSelectItem}
options={options}
/>
<Map
style={styles.light}
containerStyle={mapStyle}
center={center}
onStyleLoad={this.onStyleLoad}
>
{selected && (
<Marker coordinates={selected.center}>
<Mark />
</Marker>
)}
</Map>
</Container>
);
}
}
export default HtmlFeatures;
``` | /content/code_sandbox/example/src/demos/htmlFeatures.tsx | xml | 2016-04-16T08:23:57 | 2024-08-08T07:47:19 | react-mapbox-gl | alex3165/react-mapbox-gl | 1,907 | 743 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="path_to_url">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ArrayConstruction.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
``` | /content/code_sandbox/ChineseCodingInterviewAppendix-master/ArrayConstruction/ArrayConstruction.vcxproj.filters | xml | 2016-04-08T08:38:19 | 2024-08-16T11:26:26 | CodingInterviews | gatieme/CodingInterviews | 4,823 | 307 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="path_to_url">
<rotate android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="600"
android:repeatMode="restart"
android:repeatCount="infinite"
android:interpolator="@android:anim/cycle_interpolator"/>
</set>
``` | /content/code_sandbox/Android/Animations/app/src/main/res/anim/rotate.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 100 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>TangramKitDemo</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
``` | /content/code_sandbox/TangramKitDemo/Info.plist | xml | 2016-10-27T07:21:02 | 2024-08-09T08:57:35 | TangramKit | youngsoft/TangramKit | 1,203 | 480 |
```xml
import { Localized } from "@fluent/react/compat";
import cn from "classnames";
import { FORM_ERROR } from "final-form";
import React, { FunctionComponent, useCallback, useState } from "react";
import { Field, Form, FormSpy } from "react-final-form";
import { graphql } from "react-relay";
import { InvalidRequestError } from "coral-framework/lib/errors";
import { useMutation, withFragmentContainer } from "coral-framework/lib/relay";
import { GQLDIGEST_FREQUENCY } from "coral-framework/schema";
import CLASSES from "coral-stream/classes";
import {
AlertTriangleIcon,
CheckCircleIcon,
SvgIcon,
} from "coral-ui/components/icons";
import {
CheckBox,
FieldSet,
FormField,
HorizontalGutter,
HorizontalRule,
Option,
SelectField,
} from "coral-ui/components/v2";
import { Button, CallOut } from "coral-ui/components/v3";
import { EmailNotificationSettingsContainer_viewer } from "coral-stream/__generated__/EmailNotificationSettingsContainer_viewer.graphql";
import UpdateEmailNotificationSettingsMutation from "./UpdateEmailNotificationSettingsMutation";
import styles from "./EmailNotificationSettingsContainer.css";
interface Props {
viewer: EmailNotificationSettingsContainer_viewer;
}
type FormProps = EmailNotificationSettingsContainer_viewer["notifications"];
const EmailNotificationSettingsContainer: FunctionComponent<Props> = ({
viewer: { notifications },
}) => {
const mutation = useMutation(UpdateEmailNotificationSettingsMutation);
const [showSuccess, setShowSuccess] = useState(false);
const [showError, setShowError] = useState(false);
const closeSuccess = useCallback(() => {
setShowSuccess(false);
}, [setShowSuccess]);
const closeError = useCallback(() => {
setShowError(false);
}, [setShowError]);
const onSubmit = useCallback(
async (values: FormProps) => {
try {
await mutation(values);
setShowSuccess(true);
} catch (err) {
if (err instanceof InvalidRequestError) {
return err.invalidArgs;
}
setShowError(true);
return {
[FORM_ERROR]: err.message,
};
}
return;
},
[mutation, setShowSuccess, setShowError]
);
return (
<HorizontalGutter
data-testid="profile-account-notifications"
className={CLASSES.notifications.$root}
container="section"
aria-labelledby="profile-account-notifications-emailNotifications-title"
>
<Form initialValues={{ ...notifications }} onSubmit={onSubmit}>
{({
handleSubmit,
submitting,
submitError,
pristine,
submitSucceeded,
}) => (
<form onSubmit={handleSubmit}>
<HorizontalGutter>
<HorizontalGutter>
<Localized id="profile-account-notifications-emailNotifications">
<h2
className={cn(styles.title, CLASSES.notifications.heading)}
id="profile-account-notifications-emailNotifications-title"
>
Email Notifications
</h2>
</Localized>
</HorizontalGutter>
<HorizontalGutter>
<Localized id="profile-account-notifications-receiveWhen">
<div
className={cn(styles.header, CLASSES.notifications.label)}
id="profile-account-notifications-receiveWhen"
>
Receive notifications when:
</div>
</Localized>
<FieldSet aria-labelledby="profile-account-notifications-receiveWhen">
<FormField>
<Field name="onReply" type="checkbox">
{({ input }) => (
<Localized id="profile-account-notifications-onReply">
<CheckBox
{...input}
id={input.name}
className={styles.checkBox}
variant="streamBlue"
>
My comment receives a reply
</CheckBox>
</Localized>
)}
</Field>
</FormField>
<FormField>
<Field name="onFeatured" type="checkbox">
{({ input }) => (
<Localized id="profile-account-notifications-onFeatured">
<CheckBox
{...input}
id={input.name}
className={styles.checkBox}
variant="streamBlue"
>
My comment is featured
</CheckBox>
</Localized>
)}
</Field>
</FormField>
<FormField>
<Field name="onStaffReplies" type="checkbox">
{({ input }) => (
<Localized id="profile-account-notifications-onStaffReplies">
<CheckBox
{...input}
id={input.name}
className={styles.checkBox}
variant="streamBlue"
>
A staff member replies to my comment
</CheckBox>
</Localized>
)}
</Field>
</FormField>
<FormField>
<Field name="onModeration" type="checkbox">
{({ input }) => (
<Localized id="profile-account-notifications-onModeration">
<CheckBox
{...input}
id={input.name}
className={styles.checkBox}
variant="streamBlue"
>
My pending comment has been reviewed
</CheckBox>
</Localized>
)}
</Field>
</FormField>
<FormField>
<Localized id="profile-account-notifications-sendNotifications">
<label
className={cn(
styles.header,
styles.sendNotifications,
CLASSES.notifications.label
)}
htmlFor="digestFrequency"
>
Send Notifications:
</label>
</Localized>
<FormSpy subscription={{ values: true }}>
{({ values }) => (
<Field name="digestFrequency">
{({ input }) => (
<div>
<SelectField
{...input}
id={input.name}
disabled={
!values.onReply &&
!values.onStaffReplies &&
!values.onFeatured &&
!values.onModeration
}
>
<Localized id="profile-account-notifications-sendNotifications-immediately">
<Option value={GQLDIGEST_FREQUENCY.NONE}>
Immediately
</Option>
</Localized>
<Localized id="profile-account-notifications-sendNotifications-daily">
<Option value={GQLDIGEST_FREQUENCY.DAILY}>
Daily
</Option>
</Localized>
<Localized id="profile-account-notifications-sendNotifications-hourly">
<Option value={GQLDIGEST_FREQUENCY.HOURLY}>
Hourly
</Option>
</Localized>
</SelectField>
</div>
)}
</Field>
)}
</FormSpy>
</FormField>
</FieldSet>
</HorizontalGutter>
<div
className={cn(styles.updateButton, {
[styles.updateButtonNotification]: showSuccess || showError,
})}
>
<Localized id="profile-account-notifications-button-update">
<Button
type="submit"
disabled={submitting || pristine}
className={CLASSES.notifications.updateButton}
upperCase
>
Update
</Button>
</Localized>
</div>
{((submitError && showError) ||
(submitSucceeded && showSuccess)) && (
<div className={styles.callOut}>
{submitError && showError && (
<CallOut
color="error"
onClose={closeError}
icon={<SvgIcon Icon={AlertTriangleIcon} />}
titleWeight="semiBold"
title={<span>{submitError}</span>}
role="alert"
/>
)}
{submitSucceeded && showSuccess && (
<CallOut
color="success"
onClose={closeSuccess}
icon={<SvgIcon Icon={CheckCircleIcon} />}
titleWeight="semiBold"
title={
<Localized id="profile-account-notifications-updated">
<span>
Your notification settings have been updated
</span>
</Localized>
}
role="dialog"
aria-live="polite"
/>
)}
</div>
)}
</HorizontalGutter>
</form>
)}
</Form>
<HorizontalRule></HorizontalRule>
</HorizontalGutter>
);
};
const enhanced = withFragmentContainer<Props>({
viewer: graphql`
fragment EmailNotificationSettingsContainer_viewer on User {
notifications {
onReply
onFeatured
onStaffReplies
onModeration
digestFrequency
}
}
`,
})(EmailNotificationSettingsContainer);
export default enhanced;
``` | /content/code_sandbox/client/src/core/client/stream/tabs/Profile/Preferences/EmailNotificationSettingsContainer.tsx | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 1,754 |
```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
/**
* Tests if a value is an Int32Array.
*
* @param value - value to test
* @returns boolean indicating whether value is an Int32Array
*
* @example
* var bool = isInt32Array( new Int32Array( 10 ) );
* // returns true
*
* @example
* var bool = isInt32Array( [] );
* // returns false
*/
declare function isInt32Array( value: any ): value is Int32Array;
// EXPORTS //
export = isInt32Array;
``` | /content/code_sandbox/lib/node_modules/@stdlib/assert/is-int32array/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 172 |
```xml
import { mergeClasses } from '@expo/styleguide';
import { useState, type InputHTMLAttributes } from 'react';
import { CAPTION } from '../Text';
type Props = {
characterLimit?: number;
} & InputHTMLAttributes<HTMLTextAreaElement>;
export function Textarea({ characterLimit, className, onChange, ...rest }: Props) {
const [characterCount, setCharacterCount] = useState(0);
return (
<div className="relative">
<textarea
onChange={e => {
setCharacterCount(e.target.value.length ?? 0);
if (onChange) onChange(e);
}}
className={mergeClasses(
'block shadow-xs border border-default rounded-sm text-default bg-default h-12 w-full my-2.5 p-4 leading-5 placeholder:text-icon-tertiary',
className
)}
{...rest}
/>
{characterLimit && (
<CAPTION
theme={characterCount > characterLimit ? 'danger' : 'secondary'}
tag="code"
className="absolute bottom-1.5 right-3 z-10">
{characterLimit - characterCount}
</CAPTION>
)}
</div>
);
}
``` | /content/code_sandbox/docs/ui/components/Form/Textarea.tsx | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 253 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="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">
<process id="errorProcess1" name="errorProcess1">
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="usertask1" name="User Task"></userTask>
<boundaryEvent id="boundarytimer1" cancelActivity="false" attachedToRef="usertask1">
<timerEventDefinition>
<timeDuration>PT1S</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
<sequenceFlow id="flow3" name="" sourceRef="boundarytimer1" targetRef="endevent1">
<extensionElements>
<activiti:executionListener event="take"
class="org.flowable.spring.test.jobexecutor.ForcedRollbackExecutionListener"></activiti:executionListener>
</extensionElements>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_errorProcess1">
<bpmndi:BPMNPlane bpmnElement="errorProcess1" id="BPMNPlane_errorProcess1">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35" width="35" x="70" y="180"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35" width="35" x="540" y="180"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
<omgdc:Bounds height="55" width="105" x="280" y="170"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="boundarytimer1" id="BPMNShape_boundarytimer1">
<omgdc:Bounds height="30" width="30" x="350" y="220"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="105" y="197"></omgdi:waypoint>
<omgdi:waypoint x="280" y="197"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="385" y="197"></omgdi:waypoint>
<omgdi:waypoint x="540" y="197"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="365" y="250"></omgdi:waypoint>
<omgdi:waypoint x="557" y="235"></omgdi:waypoint>
<omgdi:waypoint x="557" y="215"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14" width="100" x="10" y="0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
``` | /content/code_sandbox/modules/flowable-spring/src/test/resources/org/flowable/spring/test/components/SpringJobExecutorRollBack.bpmn20.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 1,017 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<parent>
<artifactId>whatsmars-dubbo</artifactId>
<groupId>org.hongxi</groupId>
<version>2021.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>whatsmars-dubbo-provider-annotation</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>The demo provider module of dubbo project</description>
<dependencies>
<dependency>
<groupId>org.hongxi</groupId>
<artifactId>whatsmars-dubbo-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- netty4 -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<!-- jarlib -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.hongxi.whatsmars.dubbo.demo.provider.DemoProvider</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/whatsmars-dubbo/whatsmars-dubbo-provider-annotation/pom.xml | xml | 2016-04-01T10:33:04 | 2024-08-14T23:44:08 | whatsmars | javahongxi/whatsmars | 1,952 | 704 |
```xml
/**
* @file Cache Redis service
* @module processor/cache/redis.config
* @author Surmon <path_to_url
*/
// path_to_url
// path_to_url
// path_to_url
import _throttle from 'lodash/throttle'
import { createClient, RedisClientType } from 'redis'
import { Injectable } from '@nestjs/common'
import { EmailService } from '@app/processors/helper/helper.service.email'
import { createRedisStore, RedisStore, RedisClientOptions } from './redis.store'
import { createLogger } from '@app/utils/logger'
import { isDevEnv } from '@app/app.environment'
import * as APP_CONFIG from '@app/app.config'
const logger = createLogger({ scope: 'RedisService', time: isDevEnv })
@Injectable()
export class RedisService {
private redisStore!: RedisStore
private redisClient!: RedisClientType
constructor(private readonly emailService: EmailService) {
this.redisClient = createClient(this.getOptions()) as RedisClientType
this.redisStore = createRedisStore(this.redisClient, {
defaultTTL: APP_CONFIG.APP.DEFAULT_CACHE_TTL,
namespace: APP_CONFIG.REDIS.namespace
})
// path_to_url#events
this.redisClient.on('connect', () => logger.log('connecting...'))
this.redisClient.on('reconnecting', () => logger.log('reconnecting...'))
this.redisClient.on('ready', () => logger.success('readied (connected).'))
this.redisClient.on('end', () => logger.info('client end!'))
this.redisClient.on('error', (error) => logger.failure(`client error!`, error.message))
// connect
this.redisClient.connect()
}
private sendAlarmMail = _throttle((error: string) => {
this.emailService.sendMailAs(APP_CONFIG.APP.NAME, {
to: APP_CONFIG.APP.ADMIN_EMAIL,
subject: `Redis Error!`,
text: error,
html: `<pre><code>${error}</code></pre>`
})
}, 1000 * 30)
// path_to_url#reconnect-strategy
private retryStrategy(retries: number): number | Error {
const errorMessage = `retryStrategy! retries: ${retries}`
logger.error(errorMessage)
this.sendAlarmMail(errorMessage)
if (retries > 6) {
return new Error('Redis maximum retries!')
}
return Math.min(retries * 1000, 3000)
}
// path_to_url
private getOptions(): RedisClientOptions {
const redisOptions: RedisClientOptions = {
socket: {
host: APP_CONFIG.REDIS.host,
port: APP_CONFIG.REDIS.port as number,
reconnectStrategy: this.retryStrategy.bind(this)
}
}
if (APP_CONFIG.REDIS.username) {
redisOptions.username = APP_CONFIG.REDIS.username
}
if (APP_CONFIG.REDIS.password) {
redisOptions.password = APP_CONFIG.REDIS.password
}
return redisOptions
}
public get client(): RedisClientType {
return this.redisClient
}
public get store(): RedisStore {
return this.redisStore
}
}
``` | /content/code_sandbox/src/processors/cache/redis.service.ts | xml | 2016-02-13T08:16:02 | 2024-08-12T08:34:20 | nodepress | surmon-china/nodepress | 1,421 | 675 |
```xml
import * as React from 'react';
import { Customizations } from './Customizations';
import { CustomizerContext } from './CustomizerContext';
import { mergeCustomizations } from './mergeCustomizations';
import type { ICustomizerContext } from './CustomizerContext';
import type { ICustomizerProps } from './Customizer.types';
/**
* The Customizer component allows for default props to be mixed into components which
* are decorated with the customizable() decorator, or use the styled HOC. This enables
* injection scenarios like:
*
* 1. render svg icons instead of the icon font within all buttons
* 2. inject a custom theme object into a component
*
* Props are provided via the settings prop which should be one of the following:
* - A json map which contains 1 or more name/value pairs representing injectable props.
* - A function that receives the current settings and returns the new ones that apply to the scope
*
* @public
*
* @deprecated This component is deprecated for purpose of applying theme to components
* as of `@fluentui/react` version 8. Use `ThemeProvider` for applying theme instead.
*/
export class Customizer extends React.Component<ICustomizerProps> {
public componentDidMount(): void {
Customizations.observe(this._onCustomizationChange);
}
public componentWillUnmount(): void {
Customizations.unobserve(this._onCustomizationChange);
}
public render(): React.ReactElement<{}> {
const { contextTransform } = this.props;
return (
<CustomizerContext.Consumer>
{(parentContext: ICustomizerContext) => {
let newContext = mergeCustomizations(this.props, parentContext);
if (contextTransform) {
newContext = contextTransform(newContext);
}
return <CustomizerContext.Provider value={newContext}>{this.props.children}</CustomizerContext.Provider>;
}}
</CustomizerContext.Consumer>
);
}
private _onCustomizationChange = () => this.forceUpdate();
}
``` | /content/code_sandbox/packages/utilities/src/customizations/Customizer.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 420 |
```xml
import { addAttributeOptions } from '../model/column/attribute-service';
/**
* Checks for lowercase
*/
export function IsLowercase(target: any, propertyName: string): void {
addAttributeOptions(target, propertyName, {
validate: {
isLowercase: true,
},
});
}
``` | /content/code_sandbox/src/validation/is-lowercase.ts | xml | 2016-01-27T11:25:52 | 2024-08-13T16:56:45 | sequelize-typescript | sequelize/sequelize-typescript | 2,768 | 62 |
```xml
import { extremaBy } from './_extremaby.js';
import { ExtremaOptions } from './extremaoptions.js';
import { equalityComparerAsync } from '../util/comparer.js';
/**
* Returns the elements in an async-enumerable sequence with the minimum key value.
*
* @template TSource The type of the elements in the source sequence.
* @template TKey The type of the key computed for each element in the source sequence.
* @param {AsyncIterable<TSource>} source An async-iterable sequence to get the minimum elements for.
* @param {ExtremaOptions<TSource, TKey>} options The options which include an optional comparer and abort signal.
* @returns {Promise<TSource[]>} A promise containing a list of zero or more elements that have a minimum key value.
*/
export function minBy<TSource, TKey>(
source: AsyncIterable<TSource>,
options?: ExtremaOptions<TSource, TKey>
): Promise<TSource[]> {
const {
['comparer']: comparer = equalityComparerAsync,
['selector']: selector,
['signal']: signal,
} = options || {};
const newComparer = async (key: TKey, minValue: TKey) => -(await comparer(key, minValue));
return extremaBy(source, selector!, newComparer, signal);
}
``` | /content/code_sandbox/src/asynciterable/minby.ts | xml | 2016-02-22T20:04:19 | 2024-08-09T18:46:41 | IxJS | ReactiveX/IxJS | 1,319 | 264 |
```xml
import * as React from 'react';
import { withStyles, WithStyles } from '@material-ui/core/styles';
import styles from './appView.styles';
import { Header } from '../components';
interface Props extends WithStyles<typeof styles> {
}
const AppViewInner: React.StatelessComponent<Props> = (props) => (
<div className={props.classes.container}>
<Header/>
{props.children}
</div>
);
export const AppView = withStyles(styles)(AppViewInner);
``` | /content/code_sandbox/old_class_components_samples/19 LoginForm/src/layout/appView.component.tsx | xml | 2016-02-28T11:58:58 | 2024-07-21T08:53:34 | react-typescript-samples | Lemoncode/react-typescript-samples | 1,846 | 101 |
```xml
import * as React from 'react';
import cx from 'classnames';
import { createSvgIcon } from '../utils/createSvgIcon';
import { iconClassNames } from '../utils/iconClassNames';
export const PersonIcon = createSvgIcon({
svg: ({ classes }) => (
<svg role="presentation" focusable="false" viewBox="2 2 16 16" className={classes.svg}>
<g className={cx(iconClassNames.outline, classes.outlinePart)}>
<path d="M10 2C7.79086 2 6 3.79086 6 6C6 8.20914 7.79086 10 10 10C12.2091 10 14 8.20914 14 6C14 3.79086 12.2091 2 10 2ZM7 6C7 4.34315 8.34315 3 10 3C11.6569 3 13 4.34315 13 6C13 7.65685 11.6569 9 10 9C8.34315 9 7 7.65685 7 6Z" />
<path d="M5.00873 11C3.90315 11 3 11.8869 3 13C3 14.6912 3.83281 15.9663 5.13499 16.7966C6.41697 17.614 8.14526 18 10 18C11.8547 18 13.583 17.614 14.865 16.7966C16.1672 15.9663 17 14.6912 17 13C17 11.8956 16.1045 11 15 11L5.00873 11ZM4 13C4 12.4467 4.44786 12 5.00873 12L15 12C15.5522 12 16 12.4478 16 13C16 14.3088 15.3777 15.2837 14.3274 15.9534C13.2568 16.636 11.7351 17 10 17C8.26489 17 6.74318 16.636 5.67262 15.9534C4.62226 15.2837 4 14.3088 4 13Z" />
</g>
<g className={cx(iconClassNames.filled, classes.filledPart)}>
<path d="M10 2C7.79086 2 6 3.79086 6 6C6 8.20914 7.79086 10 10 10C12.2091 10 14 8.20914 14 6C14 3.79086 12.2091 2 10 2Z" />
<path d="M5.00873 11C3.90315 11 3 11.8869 3 13C3 14.6912 3.83281 15.9663 5.13499 16.7966C6.41697 17.614 8.14526 18 10 18C11.8547 18 13.583 17.614 14.865 16.7966C16.1672 15.9663 17 14.6912 17 13C17 11.8956 16.1045 11 15 11L5.00873 11Z" />
</g>
</svg>
),
displayName: 'PersonIcon',
});
``` | /content/code_sandbox/packages/fluentui/react-icons-northstar/src/components/PersonIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 828 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="path_to_url"
xmlns:tx="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url
path_to_url path_to_url">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="${jdbc.driver:org.h2.Driver}" />
<property name="url" value="${jdbc.url:jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000}" />
<property name="username" value="${jdbc.username:sa}" />
<property name="password" value="${jdbc.password:}" />
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="processEngineConfiguration" class="org.flowable.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="databaseSchemaUpdate" value="true"/>
<property name="flowable5CompatibilityEnabled" value="true" />
<property name="flowable5CompatibilityHandlerFactory" ref="flowable5CompabilityFactory" />
<property name="asyncExecutorActivate" value="false"/>
</bean>
<bean id="processEngine" class="org.flowable.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration"/>
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>
<bean id="activitiRule" class="org.activiti.engine.test.ActivitiRule">
<property name="processEngine" ref="processEngine"/>
</bean>
<bean id="flowable5CompabilityFactory" class="org.activiti.compatibility.spring.SpringFlowable5CompatibilityHandlerFactory" />
<tx:annotation-driven transaction-manager="transactionManager"/>
</beans>
``` | /content/code_sandbox/modules/flowable5-spring-test/src/test/resources/org/activiti/spring/test/engine/springProcessEngine-context.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 553 |
```xml
import { type MutableRefObject, useMemo, useRef } from 'react';
import type { inviteAddressesValidateFailure, inviteAddressesValidateSuccess } from '@proton/pass/store/actions';
import { inviteAddressesValidateIntent } from '@proton/pass/store/actions';
import { type Awaiter, awaiter } from '@proton/pass/utils/fp/promises';
import { uniqueId } from '../utils/string/unique-id';
import { useActionRequest } from './useActionRequest';
type InviteAddressesCache = Map<string, boolean>;
export interface InviteAddressValidator {
validate: (addresses: string[]) => Promise<void>;
emails: MutableRefObject<InviteAddressesCache>;
loading: boolean;
}
export const useValidateInviteAddresses = (shareId: string): InviteAddressValidator => {
/** keeps track of valid/invalid email addresses in a map
* in order to only request new emails to validate*/
const cache = useRef<InviteAddressesCache>(new Map());
const pending = useRef<Awaiter<void>>();
const validateAddresses = useActionRequest<
typeof inviteAddressesValidateIntent,
typeof inviteAddressesValidateSuccess,
typeof inviteAddressesValidateFailure
>(inviteAddressesValidateIntent, {
onSuccess: ({ data }) => {
Object.entries(data).forEach(([email, valid]) => cache.current.set(email, valid));
pending.current?.resolve();
},
});
return useMemo(
() => ({
validate: async (addresses: string[]) => {
pending.current?.reject('aborted');
pending.current = awaiter();
const emails = addresses.filter((email) => cache.current.get(email) === undefined);
if (emails.length > 0) validateAddresses.revalidate({ shareId, emails }, uniqueId());
else pending.current.resolve();
await pending.current;
},
emails: cache,
loading: validateAddresses.loading,
}),
[validateAddresses]
);
};
``` | /content/code_sandbox/packages/pass/hooks/useValidateInviteAddress.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 394 |
```xml
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { WordcloudDemoComponent } from './wordcloud-demo.component';
const routes: Routes = [
{
path: '',
component: WordcloudDemoComponent,
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class WordcloudDemoRoutingModule {}
``` | /content/code_sandbox/apps/docs-app/src/app/content/echarts/echarts-demos/wordcloud/demos/wordcloud-demo-routing.module.ts | xml | 2016-07-11T23:30:52 | 2024-08-15T15:20:45 | covalent | Teradata/covalent | 2,228 | 82 |
```xml
<?xml version="1.0" encoding="utf-8"?>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->
<LWM2M xmlns:xsi="path_to_url" xsi:noNamespaceSchemaLocation="path_to_url">
<Object ObjectType="MODefinition">
<Name>Event Data Delivery</Name>
<Description1><![CDATA[The Event Data Delivery object provides a simple means for managing the delivery of event data from multiple Event Data Object instances. ]]></Description1>
<ObjectID>10263</ObjectID>
<ObjectURN>urn:oma:lwm2m:x:10263</ObjectURN>
<LWM2MVersion>1.0</LWM2MVersion>
<ObjectVersion>1.0</ObjectVersion>
<MultipleInstances>Multiple</MultipleInstances>
<Mandatory>Optional</Mandatory>
<Resources>
<Item ID="0">
<Name>Name</Name>
<Operations>RW</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Mandatory</Mandatory>
<Type>String</Type>
<RangeEnumeration></RangeEnumeration>
<Units></Units>
<Description><![CDATA[The Name resource provides a way to identify different Event Data Delivery instances. Name is a readable and writable attribute. Name is defined as an arbitrary length text string]]></Description>
</Item>
<Item ID="1">
<Name>Event Data Links</Name>
<Operations>RW</Operations>
<MultipleInstances>Multiple</MultipleInstances>
<Mandatory>Mandatory</Mandatory>
<Type>Objlnk</Type>
<RangeEnumeration></RangeEnumeration>
<Units></Units>
<Description><![CDATA[The Event Data Links resource is a set of object links that point to each of the Event Data Object Instances that are managed by this Event Data Delivery Object Instance. An Object Link is two 16-bit integer values representing the Object ID and the Object Instance ID. This resource can have multiple instances allowing this Event Data Delivery object to manage many Event Data instances.]]></Description>
</Item>
<Item ID="2">
<Name>Latest Eventlog</Name>
<Operations>R</Operations>
<MultipleInstances>Multiple</MultipleInstances>
<Mandatory>Mandatory</Mandatory>
<Type>Opaque</Type>
<RangeEnumeration></RangeEnumeration>
<Units></Units>
<Description><![CDATA[The Latest Eventlog resource is a multiple instance resource representing the Latest Eventlog resource from each of the Event Data objects defined in the Event Data Links Resource. When this payload is delivered to the LwM2M server, via either a read request or a confirmed observation on this Object, Object Instance or Resource, the Latest Delivered Event Time for each of the Event Data objects defined in the Event Data Links Resource must be updated. When no new event data exists for any of the linked Event Data instances an empty Opaque value should be provided.
If this resource has an LwM2M server observation and one of the Event Data Instance is configured as Realtime and has been triggered, the Event Data Delivery object must send all undelivered events for all linked Event Data objects.
]]></Description>
</Item>
<Item ID="3">
<Name>Schedule</Name>
<Operations>RW</Operations>
<MultipleInstances>Single</MultipleInstances>
<Mandatory>Mandatory</Mandatory>
<Type>Objlnk</Type>
<RangeEnumeration></RangeEnumeration>
<Units></Units>
<Description><![CDATA[The Schedule resource provides link to a schedule object. This Schedule object is used to provide fine grain control the Notification schedule delivery when the default LwM2M NOTIFICATION attributes do not provide sufficient control. If no schedule is required, an Object Link referencing no Object Instance will contain the concatenation of 2 MAX-ID values (null link).]]></Description>
</Item>
</Resources>
<Description2></Description2>
</Object>
</LWM2M>
``` | /content/code_sandbox/application/src/main/data/lwm2m-registry/10263.xml | xml | 2016-12-01T09:33:30 | 2024-08-16T19:58:25 | thingsboard | thingsboard/thingsboard | 16,820 | 1,128 |
```xml
import { CellContext } from '@tanstack/react-table';
import { AlertTriangle, ArrowRight } from 'lucide-react';
import { Icon } from '@@/Icon';
import { Badge } from '@@/Badge';
import { Ingress, TLS } from '../../types';
import { columnHelper } from './helper';
export const ingressRules = columnHelper.accessor(
({ Paths, TLS }) =>
// return an accessor function with all the useful text to search for
Paths?.map((path) => {
const isHttp = isHTTP(TLS || [], path.Host);
return `${isHttp ? 'http' : 'https'}://${path.Host}${path.Path}${
path.ServiceName
}:${path.Port} ${!path.HasService && "Service doesn't exist"}`;
}).join(','),
{
header: 'Rules and Paths',
id: 'ingressRules',
cell: Cell,
}
);
function Cell({ row }: CellContext<Ingress, string>) {
const paths = row.original.Paths;
if (!paths) {
return <div />;
}
return (
<div className="flex flex-col gap-y-0.5 whitespace-nowrap">
{paths.map((path) => (
<div key={`${path.Host}${path.Path}${path.ServiceName}:${path.Port}`}>
<span className="flex flex-nowrap items-center gap-1 px-2">
{link(
path.Host,
path.Path,
isHTTP(row.original.TLS || [], path.Host)
)}
<Icon icon={ArrowRight} />
{`${path.ServiceName}:${path.Port}`}
{!path.HasService && (
<Badge type="warn" className="ml-1 gap-1">
<Icon icon={AlertTriangle} />
Service doesn't exist
</Badge>
)}
</span>
</div>
))}
</div>
);
}
function isHTTP(TLSs: TLS[], host: string) {
return TLSs.filter((t) => t.Hosts.indexOf(host) !== -1).length === 0;
}
function link(host: string, path: string, isHttp: boolean) {
if (!host) {
return path;
}
return (
<a
href={`${isHttp ? 'http' : 'https'}://${host}${path}`}
target="_blank"
rel="noreferrer"
>
{`${isHttp ? 'http' : 'https'}://${host}${path}`}
</a>
);
}
``` | /content/code_sandbox/app/react/kubernetes/ingresses/IngressDatatable/columns/ingressRules.tsx | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 537 |
```xml
#!/usr/bin/env node
/*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* 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 * as yargs from "yargs";
import * as beam from "../index";
import { createLoggingChannel } from "./logging";
import { Worker, WorkerEndpoints } from "./worker";
async function main() {
const argv = yargs.argv;
let pushLogs;
if (argv.logging_endpoint) {
pushLogs = createLoggingChannel(argv.id, argv.logging_endpoint);
}
let options = JSON.parse(argv.options);
if (options["options"]) {
// Dataflow adds another level of nesting.
options = options["options"];
}
(
options["beam:option:registered_node_modules:v1"] ||
options["registered_node_modules"] ||
[]
).forEach((m) => {
try {
require(m);
} catch (error) {
console.error(
`**ERROR**
Unable to require module '${m}' used in requireForSerialization:
please ensure that it is available in the package exports.`,
);
// Explicitly exit the process to avoid the error getting swallowed
// by a long traceback.
process.exit(1);
}
});
console.info("Starting worker", argv.id);
const worker = new Worker(
argv.id,
{
controlUrl: argv.control_endpoint,
},
options,
);
console.info("Worker started.");
if (pushLogs) {
pushLogs().catch();
}
await worker.wait();
console.info("Worker stoped.");
}
main()
.catch((e) => console.error(e))
.finally(() => process.exit());
``` | /content/code_sandbox/sdks/typescript/src/apache_beam/worker/worker_main.ts | xml | 2016-02-02T08:00:06 | 2024-08-16T18:58:11 | beam | apache/beam | 7,730 | 407 |
```xml
import * as React from 'react';
import { IDocPageProps } from '@fluentui/react/lib/common/DocPage.types';
import { TimePickerBasicExample } from './TimePicker.Basic.Example';
import { TimePickerControlledExample } from './TimePicker.Controlled.Example';
import { TimePickerCustomTimeStringsExample } from './TimePicker.CustomTimeStrings.Example';
import { TimePickerValidationResultExample } from './TimePicker.ValidationResult.Example';
import { TimePickerDateTimePickerExample } from './TimePicker.DateTimePicker.Example';
const TimePickerBasicExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/TimePicker.Basic.Example.tsx') as string;
const TimePickerControlledExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/TimePicker.Controlled.Example.tsx') as string;
const TimePickerCustomTimeStringsExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/TimePicker.CustomTimeStrings.Example.tsx') as string;
const TimePickerValidationResultExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/TimePicker.ValidationResult.Example.tsx') as string;
const TimePickerDateTimePickerExampleCode =
require('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/TimePicker.DateTimePicker.Example.tsx') as string;
export const TimePickerPageProps: IDocPageProps = {
title: 'TimePicker',
componentName: 'TimePicker',
componentUrl: 'path_to_url
examples: [
{
title: 'TimePicker basic',
code: TimePickerBasicExampleCode,
view: <TimePickerBasicExample />,
},
{
title: 'TimePicker controlled',
code: TimePickerControlledExampleCode,
view: <TimePickerControlledExample />,
},
{
title: 'TimePicker with custom time strings',
code: TimePickerCustomTimeStringsExampleCode,
view: <TimePickerCustomTimeStringsExample />,
},
{
title: 'TimePicker using onValidationResult callback',
code: TimePickerValidationResultExampleCode,
view: <TimePickerValidationResultExample />,
},
{
title: 'TimePicker with DatePicker',
code: TimePickerDateTimePickerExampleCode,
view: <TimePickerDateTimePickerExample />,
},
],
overview: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/docs/TimePickerOverview.md'),
bestPractices: require<string>('!raw-loader?esModule=false!@fluentui/react-examples/src/react/TimePicker/docs/TimePickerBestPractices.md'),
isHeaderVisible: true,
isFeedbackVisible: true,
};
``` | /content/code_sandbox/packages/react-examples/src/react/TimePicker/TimePicker.doc.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 620 |
```xml
import { differenceInDays, format, fromUnixTime } from 'date-fns';
import { c, msgid } from 'ttag';
import { Href } from '@proton/atoms/Href';
import { BRAND_NAME } from '@proton/shared/lib/constants';
import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
import type { SubscriptionModel } from '@proton/shared/lib/interfaces';
import alias from '@proton/styles/assets/img/cancellation-flow/testimonial_alias.png';
import darkWeb from '@proton/styles/assets/img/cancellation-flow/testimonial_dark_web.png';
import netShield from '@proton/styles/assets/img/cancellation-flow/testimonial_net_shield.png';
import type { ConfirmationModal, PlanConfigTestimonial } from '../interface';
export const getDefaultTestimonial = (): PlanConfigTestimonial => {
return {
title: c('Subscription reminder').t`Direct contribution to our mission`,
description: c('Subscription reminder')
.t`${BRAND_NAME}'s only source of revenue is user subscriptions. Your support allows us to remain independent, advance our mission to make privacy the default online, and continue supporting activists and organizations fighting for privacy and freedom.`,
learMoreLink: 'path_to_url
learnMoreCTA: c('Subscription reminder').t`Learn more about our impact`,
testimonials: [
{
title: c('Subscription reminder').t`Our fight against censorship in Russia`,
description: c('Subscription reminder')
.t`How we fought back when ${BRAND_NAME} was targeted in an aggressive censorship campaign.`,
ctaText: c('Subscription reminder').t`Read the story`,
link: 'path_to_url
picture: darkWeb,
},
{
title: c('Subscription reminder').t`Helping activists in Hong Kong`,
description: c('Subscription reminder')
.t`How we supported local activists when privacy and free speech were threatened in Hong Kong.`,
ctaText: c('Subscription reminder').t`Watch the interview`,
link: 'path_to_url
picture: netShield,
},
{
title: c('Subscription reminder').t`Unblocking internet access in Iran`,
description: c('Subscription reminder')
.t`How our customer support team got our VPN app directly into people's hands.`,
ctaText: c('Subscription reminder').t`Read the story`,
link: 'path_to_url
picture: alias,
},
],
};
};
export const ExpirationTime = ({
subscription,
cancellablePlan,
}: {
subscription: SubscriptionModel;
cancellablePlan?: boolean;
}) => {
const latestSubscription = subscription.UpcomingSubscription?.PeriodEnd ?? subscription.PeriodEnd;
if (cancellablePlan) {
const endDate = fromUnixTime(latestSubscription);
const formattedEndDate = format(fromUnixTime(latestSubscription), 'PP');
return (
<time className="text-bold" dateTime={format(endDate, 'yyyy-MM-dd')}>
{formattedEndDate}
</time>
);
} else {
const endSubDate = fromUnixTime(latestSubscription);
const dayDiff = differenceInDays(endSubDate, new Date());
return (
<strong>
<time dateTime={format(endSubDate, 'yyyy-MM-dd')}>
{c('Subscription reminder').ngettext(msgid`${dayDiff} day left`, `${dayDiff} days left`, dayDiff)}
</time>
</strong>
);
}
};
export const getDefaultConfirmationModal = (
subscription: SubscriptionModel,
planName: string,
cancellablePlan: boolean
): ConfirmationModal => {
const expiryDate = <ExpirationTime subscription={subscription} cancellablePlan={cancellablePlan} />;
const learnMoreLink = (
<Href className="mb-8" href={getKnowledgeBaseUrl('/free-plan-limits')}>
{c('Link').t`Learn more`}
</Href>
);
const description = cancellablePlan
? c('Subscription reminder')
.jt`Your ${planName} subscription ends on ${expiryDate}. After that, you'll be on the ${BRAND_NAME} Free plan. If your usage exceeds free plan limits, you may experience restricted access to product features and your data. ${learnMoreLink}`
: c('Subscription reminder')
.jt`You still have ${expiryDate} on your ${planName} subscription. We'll add the credits for the remaining time to your ${BRAND_NAME} Account. Make sure you do not exceed the free plan limits before canceling. ${learnMoreLink}`;
return {
description,
warningTitle: c('Subscription reminder')
.t`If you exceed the free plan limits when your ${planName} subscription expires, you will not be able to:`,
warningPoints: [
c('Subscription reminder').t`Receive new emails`,
c('Subscription reminder').t`Send emails with attachments`,
c('Subscription reminder').t`Manage your calendar`,
c('Subscription reminder').t`Sync files on devices`,
c('Subscription reminder').t`Add any new files`,
c('Subscription reminder').t`Back up photos from your devices`,
],
};
};
export const getDefaultGBStorageWarning = (planName: string, planMaxSpace: string, cancellablePlan?: boolean) => {
const warning = cancellablePlan
? c('Subscription reminder')
.t`After your ${planName} subscription expires, you will be downgraded to ${BRAND_NAME} Free, which only offers up to 1 GB of Mail storage and up to 5 GB of Drive storage. You will also lose any previously awarded storage bonuses.`
: c('Subscription reminder')
.t`When you cancel ${planName}, you will be downgraded to ${BRAND_NAME} Free, which only offers up to 1 GB of Mail storage and up to 5 GB of Drive storage. You will also lose any previously awarded storage bonuses.`;
return {
warning,
title: c('Subscription reminder').t`Extra storage and bonuses`,
description: c('Subscription reminder')
.t`${planName} offers ${planMaxSpace} storage for your emails, attachments, events, passwords, and files. You are also eligible for yearly storage bonuses.`,
};
};
export const getDefaultTBStorageWarning = (planName: string, planMaxSpace: string, cancellablePlan?: boolean) => {
const warning = cancellablePlan
? c('Subscription reminder')
.t`After your ${planName} subscription expires, you will be downgraded to ${BRAND_NAME} Free, which only offers up to 1 GB of Mail storage and up to 5 GB of Drive storage. You will also lose any previously awarded storage bonuses.`
: c('Subscription reminder')
.t`When you cancel ${planName}, you will be downgraded to ${BRAND_NAME} Free, which only offers up to 1 GB of Mail storage and up to 5 GB of Drive storage. You will also lose any previously awarded storage bonuses.`;
return {
warning,
title: c('Subscription reminder').t`Extra storage and bonuses`,
description: c('Subscription reminder')
.t`${planName} offers ${planMaxSpace} storage for your emails, attachments, events, passwords, and files. You are also eligible for yearly storage bonuses.`,
};
};
export const getDefaultReminder = (planName: string) => {
return {
title: c('Subscription reminder').t`What you give up when you cancel ${planName}`,
};
};
``` | /content/code_sandbox/packages/components/containers/payments/subscription/cancellationFlow/config/b2cCommonConfig.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 1,598 |
```xml
import React, { CSSProperties, TouchEvent, MouseEvent, Touch, RefObject } from 'react';
import { WebSocketSession } from '@xoutput/client';
import { AbstractInputFlow, UIInputEvent } from '../../events/base';
import { CommonProps } from './common';
import { ButtonFlow } from './button';
export class SliderFlow extends AbstractInputFlow<number> {
private key: string;
constructor(
communication: WebSocketSession,
element: HTMLElement,
input: string,
private inverted: boolean,
private emulator: string
) {
super(communication, element);
this.key = input;
}
protected onStart(event: UIInputEvent): number {
return this.getXRatio(event, this.inverted);
}
protected onMove(event: UIInputEvent): number {
return this.getXRatio(event, this.inverted);
}
protected onEnd(): number {
return 0;
}
protected fill(value: number): void {
this.fillElement.style.width = value * this.element.offsetWidth + 'px';
}
protected sendValue(value: number): void {
const data: any = {
Type: this.emulator,
};
data[this.key] = value;
this.communication.sendMessage(data);
}
}
export type SliderProp = CommonProps & {
input: string;
emulator: string;
style: CSSProperties;
inverted?: boolean;
};
export class Slider extends React.Component<SliderProp> {
private element: RefObject<any>;
constructor(props: Readonly<SliderProp>) {
super(props);
this.element = React.createRef();
}
private mouseDown(event: MouseEvent) {
this.props.eventHolder.mouseAdd(
new SliderFlow(this.props.websocket, this.element.current, this.props.input, this.props.inverted, this.props.emulator),
event
);
}
private mouseButtonDown(event: MouseEvent) {
this.props.eventHolder.mouseAdd(
new ButtonFlow(this.props.websocket, this.element.current, this.props.input, this.props.emulator),
event
);
}
private handleTouchEvent(event: TouchEvent, action: (t: Touch) => void) {
Array.from(event.changedTouches).forEach((t) => {
action(t);
});
event.preventDefault();
}
private touchStart(event: TouchEvent) {
this.handleTouchEvent(event, (touch) => {
this.props.eventHolder.touchAdd(
new SliderFlow(this.props.websocket, this.element.current, this.props.input, this.props.inverted, this.props.emulator),
touch
);
});
}
private touchButtonStart(event: TouchEvent) {
this.handleTouchEvent(event, (touch) => {
this.props.eventHolder.touchAdd(
new ButtonFlow(this.props.websocket, this.element.current, this.props.input, this.props.emulator),
touch
);
});
}
render() {
const button = (
<div
className="button"
style={{ gridColumn: 'span 4' }}
onMouseDown={(event) => this.mouseButtonDown(event)}
onTouchStart={(event) => this.touchButtonStart(event)}
>
<div className="inner">{this.props.input}</div>
</div>
);
const slider = (
<div
ref={this.element}
className={`slider ${this.props.input}`}
style={{ gridColumn: 'span 6' }}
onMouseDown={(event) => this.mouseDown(event)}
onTouchStart={(event) => this.touchStart(event)}
>
<div className={'fill' + (this.props.inverted ? ' inverted' : '')}></div>
<div className="text">
<div className="inner">{this.props.input}</div>
</div>
</div>
);
if (this.props.inverted) {
return (
<div className="slider-container" style={this.props.style ? this.props.style : {}}>
{slider}
{button}
</div>
);
}
return (
<div className="slider-container" style={this.props.style ? this.props.style : {}}>
{button}
{slider}
</div>
);
}
}
``` | /content/code_sandbox/@xoutput/webapp/src/ui/emulation/slider.tsx | xml | 2016-11-22T21:13:16 | 2024-08-16T10:35:33 | XOutput | csutorasa/XOutput | 1,103 | 879 |
```xml
import { IterableX } from '../../iterable/iterablex.js';
import { ConcatIterable } from '../../iterable/concat.js';
/**
* @ignore
*/
export function concatProto<T>(this: IterableX<T>): IterableX<T>;
/**
* @ignore
*/
export function concatProto<T, T2>(this: IterableX<T>, v2: Iterable<T2>): IterableX<T | T2>;
export function concatProto<T, T2, T3>(
this: IterableX<T>,
v2: Iterable<T2>,
v3: Iterable<T3>
): IterableX<T | T2 | T3>;
/**
* @ignore
*/
export function concatProto<T, T2, T3, T4>(
this: IterableX<T>,
v2: Iterable<T2>,
v3: Iterable<T3>,
v4: Iterable<T4>
): IterableX<T | T2 | T3 | T4>;
/**
* @ignore
*/
export function concatProto<T, T2, T3, T4, T5>(
this: IterableX<T>,
v2: Iterable<T2>,
v3: Iterable<T3>,
v4: Iterable<T4>,
v5: Iterable<T5>
): Iterable<T | T2 | T3 | T4 | T5>;
/**
* @ignore
*/
export function concatProto<T, T2, T3, T4, T5, T6>(
this: IterableX<T>,
v2: Iterable<T2>,
v3: Iterable<T3>,
v4: Iterable<T4>,
v5: Iterable<T5>,
v6: Iterable<T6>
): Iterable<T | T2 | T3 | T4 | T5 | T6>;
/**
* @ignore
*/
export function concatProto<T>(this: IterableX<T>, ...args: Iterable<T>[]): IterableX<T> {
// @ts-ignore
return new ConcatIterable<T>([this, ...args]);
}
IterableX.prototype.concat = concatProto;
declare module '../../iterable/iterablex' {
interface IterableX<T> {
concat: typeof concatProto;
}
}
``` | /content/code_sandbox/src/add/iterable-operators/concat.ts | xml | 2016-02-22T20:04:19 | 2024-08-09T18:46:41 | IxJS | ReactiveX/IxJS | 1,319 | 456 |
```xml
import * as React from 'react';
import { Label, Pivot, PivotItem } from '@fluentui/react';
export const PivotLargeExample = () => (
<div>
<Pivot aria-label="Large Link Size Pivot Example" linkSize="large">
<PivotItem headerText="My Files">
<Label>Pivot #1</Label>
</PivotItem>
<PivotItem headerText="Recent">
<Label>Pivot #2</Label>
</PivotItem>
<PivotItem headerText="Shared with me">
<Label>Pivot #3</Label>
</PivotItem>
</Pivot>
</div>
);
``` | /content/code_sandbox/packages/react-examples/src/react/Pivot/Pivot.Large.Example.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 147 |
```xml
import getPort from 'get-port';
import nock from 'nock';
import path from 'path';
import { generateRemotePackageMetadata } from '@verdaccio/test-helper';
import { Registry, ServerQuery } from '../src/server';
const configFile = path.join(__dirname, './config.yaml');
describe('server query', () => {
test('server run', async () => {
const port = await getPort({ port: 4001 });
const registry = new Registry(configFile, { port });
const vPath = path.join(__dirname, '../bin/verdaccio');
const d = await registry.init(vPath);
expect(d.pid).toBeDefined();
expect(registry.getPort()).toBeDefined();
expect(registry.getAuthStr()).toBeDefined();
expect(registry.getToken).toBeDefined();
registry.stop();
});
test('server create user', async () => {
const port = await getPort({ port: 4002 });
const registry = new Registry(configFile, { createUser: true, port });
const vPath = path.join(__dirname, '../bin/verdaccio');
const d = await registry.init(vPath);
expect(d.pid).toBeDefined();
registry.stop();
});
test('fetch debug ok', async () => {
nock('path_to_url`/-/_debug`).reply(201, { ok: 'debug' });
expect(true).toBeTruthy();
const server = new ServerQuery('path_to_url
const query = await server.debug();
query.status(201).body_ok(/debug/);
});
test('fetch debug fail', async () => {
nock('path_to_url`/-/_debug`).reply(500, { error: 'fail debug' });
expect(true).toBeTruthy();
const server = new ServerQuery('path_to_url
const query = await server.debug();
query.status(500).body_error(/fail debug/);
});
test('fetch package ok', async () => {
const pkgName = 'upstream';
const upstreamManifest = generateRemotePackageMetadata(
pkgName,
'1.0.0',
'path_to_url
);
nock('path_to_url`/upstream`).reply(201, upstreamManifest);
expect(true).toBeTruthy();
const server = new ServerQuery('path_to_url
const query = await server.getPackage('upstream');
query.status(201).body_ok(upstreamManifest);
});
});
``` | /content/code_sandbox/packages/verdaccio/test/server-query-spec.ts | xml | 2016-04-15T16:21:12 | 2024-08-16T09:38:01 | verdaccio | verdaccio/verdaccio | 16,189 | 519 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {render, screen, waitFor, within} from 'modules/testing-library';
import {CustomFiltersModal} from './index';
import {QueryClientProvider} from '@tanstack/react-query';
import {getMockQueryClient} from 'modules/react-query/getMockQueryClient';
import {nodeMockServer} from 'modules/mockServer/nodeMockServer';
import {HttpResponse, http} from 'msw';
import * as userMocks from 'modules/mock-schema/mocks/current-user';
import {createMockProcess} from 'modules/queries/useProcesses';
import {getStateLocally, storeStateLocally} from 'modules/utils/localStorage';
const getWrapper = () => {
const mockClient = getMockQueryClient();
const Wrapper: React.FC<{
children?: React.ReactNode;
}> = ({children}) => (
<QueryClientProvider client={mockClient}>{children}</QueryClientProvider>
);
return Wrapper;
};
describe('<CustomFiltersModal />', () => {
beforeEach(() => {
nodeMockServer.use(
http.get(
'/v1/internal/users/current',
() => {
return HttpResponse.json(userMocks.currentUser);
},
{once: true},
),
http.get(
'/v1/internal/processes',
() => {
return HttpResponse.json([
createMockProcess('process-0'),
createMockProcess('process-1'),
]);
},
{
once: true,
},
),
);
});
it('should render filters dialog', async () => {
render(
<CustomFiltersModal
isOpen
onClose={() => {}}
onSuccess={() => {}}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
expect(
within(dialog).getByRole('heading', {name: /apply filters/i}),
).toBeInTheDocument();
const assigneeGroup = within(dialog).getByRole('group', {
name: /assignee/i,
});
expect(assigneeGroup).toBeInTheDocument();
expect(
within(assigneeGroup).getByRole('radio', {name: /all/i}),
).toBeInTheDocument();
expect(
within(assigneeGroup).getByRole('radio', {name: /unassigned/i}),
).toBeInTheDocument();
expect(
within(assigneeGroup).getByRole('radio', {name: /me/i}),
).toBeInTheDocument();
expect(
within(assigneeGroup).getByRole('radio', {name: /user and group/i}),
).toBeInTheDocument();
const statusGroup = within(dialog).getByRole('group', {name: /status/i});
expect(statusGroup).toBeInTheDocument();
expect(
within(statusGroup).getByRole('radio', {name: /all/i}),
).toBeInTheDocument();
expect(
within(statusGroup).getByRole('radio', {name: /open/i}),
).toBeInTheDocument();
expect(
within(statusGroup).getByRole('radio', {name: /completed/i}),
).toBeInTheDocument();
const processesCombobox = within(dialog).getByRole('combobox', {
name: /process/i,
});
expect(processesCombobox).toBeInTheDocument();
await waitFor(() => expect(processesCombobox).toBeEnabled());
expect(
within(processesCombobox).getByRole('option', {
name: /all processes/i,
}),
).toBeInTheDocument();
expect(
within(processesCombobox).getByRole('option', {
name: /process process-0/i,
}),
).toBeInTheDocument();
expect(
within(processesCombobox).getByRole('option', {
name: /process process-1/i,
}),
).toBeInTheDocument();
const advancedFiltersSwitch = within(dialog).getByRole('switch', {
name: /advanced filters/i,
});
expect(advancedFiltersSwitch).toBeInTheDocument();
expect(advancedFiltersSwitch).not.toBeChecked();
expect(
within(dialog).getByRole('button', {name: /reset/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('button', {name: /cancel/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('button', {name: /apply/i}),
).toBeInTheDocument();
});
it('should render user and group filters', async () => {
const {user} = render(
<CustomFiltersModal
isOpen
onClose={() => {}}
onSuccess={() => {}}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
expect(
within(dialog).queryByRole('textbox', {name: /assigned to user/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /in a group/i}),
).not.toBeInTheDocument();
await user.click(
within(dialog).getByRole('radio', {name: /user and group/i}),
);
expect(
within(dialog).getByRole('textbox', {name: /assigned to user/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('textbox', {name: /in a group/i}),
).toBeInTheDocument();
});
it('should render advanced filters', async () => {
const {user} = render(
<CustomFiltersModal
isOpen
onClose={() => {}}
onSuccess={() => {}}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
expect(
within(dialog).queryByRole('group', {name: /due date/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /from/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /to/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /follow up date/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /task id/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('group', {name: /task variables/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('button', {name: /add variable/i}),
).not.toBeInTheDocument();
await user.click(
within(dialog).getByRole('switch', {name: /advanced filters/i}),
);
const dueDateGroup = within(dialog).getByRole('group', {name: /due date/i});
expect(dueDateGroup).toBeInTheDocument();
expect(
within(dueDateGroup).getByRole('textbox', {name: /from/i}),
).toBeInTheDocument();
expect(
within(dueDateGroup).getByRole('textbox', {name: /to/i}),
).toBeInTheDocument();
const followUpDateGroup = within(dialog).getByRole('group', {
name: /follow up date/i,
});
expect(followUpDateGroup).toBeInTheDocument();
expect(
within(followUpDateGroup).getByRole('textbox', {name: /from/i}),
).toBeInTheDocument();
expect(
within(followUpDateGroup).getByRole('textbox', {name: /to/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('textbox', {name: /task id/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('group', {name: /task variables/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('button', {name: /add variable/i}),
).toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /name/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('textbox', {name: /value/i}),
).not.toBeInTheDocument();
expect(
within(dialog).queryByRole('button', {name: /remove variable/i}),
).not.toBeInTheDocument();
await user.click(
within(dialog).getByRole('button', {name: /add variable/i}),
);
expect(
within(dialog).getByRole('textbox', {name: /name/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('textbox', {name: /value/i}),
).toBeInTheDocument();
expect(
within(dialog).getByRole('button', {name: /remove variable/i}),
).toBeInTheDocument();
});
it('should dispatch event handlers', async () => {
const mockOnClose = vi.fn();
const mockOnSuccess = vi.fn();
const {user} = render(
<CustomFiltersModal
isOpen
onClose={mockOnClose}
onSuccess={mockOnSuccess}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
expect(mockOnClose).not.toHaveBeenCalled();
expect(mockOnSuccess).not.toHaveBeenCalled();
await user.click(within(dialog).getByRole('button', {name: /cancel/i}));
expect(mockOnClose).toHaveBeenCalledOnce();
expect(mockOnSuccess).not.toHaveBeenCalled();
await user.click(within(dialog).getByRole('button', {name: /apply/i}));
expect(mockOnClose).toHaveBeenCalledOnce();
expect(mockOnSuccess).toHaveBeenCalledOnce();
});
it('should load user groups', async () => {
nodeMockServer.use(
http.get(
'/v1/internal/users/current',
() => {
return HttpResponse.json(userMocks.currentUserWithGroups);
},
{once: true},
),
);
const {user} = render(
<CustomFiltersModal
isOpen
onClose={() => {}}
onSuccess={() => {}}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
await user.click(
within(dialog).getByRole('radio', {name: /user and group/i}),
);
expect(
await within(dialog).findByRole('combobox', {name: /in a group/i}),
).toBeInTheDocument();
});
it('should load from previously saved filters', async () => {
const mockDate = new Date('2022-01-01');
storeStateLocally('customFilters', {
custom: {
assignee: 'me',
status: 'completed',
bpmnProcess: 'process-0',
dueDateFrom: mockDate,
dueDateTo: mockDate,
followUpDateFrom: mockDate,
followUpDateTo: mockDate,
taskId: 'task-0',
variables: [
{
name: 'variable-0',
value: '"value-0"',
},
],
},
});
render(
<CustomFiltersModal
isOpen
filterId="custom"
onClose={() => {}}
onSuccess={() => {}}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
await waitFor(() =>
expect(
within(dialog).getByRole('combobox', {name: /process/i}),
).toHaveValue('process-0'),
);
expect(within(dialog).getByRole('radio', {name: /me/i})).toBeChecked();
expect(
within(dialog).getByRole('radio', {name: /completed/i}),
).toBeChecked();
const dueDateGroup = within(dialog).getByRole('group', {name: /due date/i});
expect(
within(dueDateGroup).getByRole('textbox', {name: /from/i}),
).toHaveValue('01/01/2022');
expect(
within(dueDateGroup).getByRole('textbox', {name: /to/i}),
).toHaveValue('01/01/2022');
const followUpDateGroup = within(dialog).getByRole('group', {
name: /due date/i,
});
expect(
within(followUpDateGroup).getByRole('textbox', {name: /from/i}),
).toHaveValue('01/01/2022');
expect(
within(followUpDateGroup).getByRole('textbox', {name: /to/i}),
).toHaveValue('01/01/2022');
expect(within(dialog).getByRole('textbox', {name: /task id/i})).toHaveValue(
'task-0',
);
const variablesGroup = within(dialog).getByRole('group', {
name: /task variables/i,
});
expect(
within(variablesGroup).getByRole('textbox', {name: /name/i}),
).toHaveValue('variable-0');
expect(
within(variablesGroup).getByRole('textbox', {name: /value/i}),
).toHaveValue('"value-0"');
});
it('should submit filters', async () => {
const mockOnSuccess = vi.fn();
const submitValues = {
assignee: 'unassigned',
status: 'open',
bpmnProcess: 'process-1',
dueDateFrom: new Date('2022-01-01'),
dueDateTo: new Date('2022-01-01'),
followUpDateFrom: new Date('2022-01-01'),
followUpDateTo: new Date('2022-01-01'),
taskId: 'task-0',
variables: [
{
name: 'variable-0',
value: '"value-0"',
},
],
} as const;
const {user} = render(
<CustomFiltersModal
isOpen
filterId="custom"
onClose={() => {}}
onSuccess={mockOnSuccess}
onDelete={() => {}}
/>,
{
wrapper: getWrapper(),
},
);
const dialog = screen.getByRole('dialog', {name: /custom filters modal/i});
expect(getStateLocally('customFilters')).toBeNull();
await user.click(within(dialog).getByRole('radio', {name: /unassigned/i}));
await user.click(within(dialog).getByRole('radio', {name: /open/i}));
await user.selectOptions(
within(dialog).getByRole('combobox', {name: /process/i}),
'process-1',
);
await user.click(
within(dialog).getByRole('switch', {name: /advanced filters/i}),
);
const dueDateGroup = within(dialog).getByRole('group', {name: /due date/i});
await user.type(
within(dueDateGroup).getByRole('textbox', {name: /from/i}),
'01/01/2022',
);
await user.type(
within(dueDateGroup).getByRole('textbox', {name: /to/i}),
'01/01/2022',
);
const followUpDateGroup = within(dialog).getByRole('group', {
name: /follow up date/i,
});
await user.type(
within(followUpDateGroup).getByRole('textbox', {name: /from/i}),
'01/01/2022',
);
await user.type(
within(followUpDateGroup).getByRole('textbox', {name: /to/i}),
'01/01/2022',
);
await user.type(
within(dialog).getByRole('textbox', {name: /task id/i}),
'task-0',
);
await user.click(
within(dialog).getByRole('button', {name: /add variable/i}),
);
await user.type(
within(dialog).getByRole('textbox', {name: /name/i}),
'variable-0',
);
await user.type(
within(dialog).getByRole('textbox', {name: /value/i}),
'"value-0"',
);
await user.click(within(dialog).getByRole('button', {name: /apply/i}));
expect(mockOnSuccess).toHaveBeenCalledOnce();
expect(mockOnSuccess).toHaveBeenLastCalledWith('custom');
expect(getStateLocally('customFilters')).toEqual({
custom: submitValues,
});
});
});
``` | /content/code_sandbox/tasklist/client/src/Tasks/CollapsiblePanel/CustomFiltersModal/index.test.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 3,593 |
```xml
import React from 'react';
type StorybookLogoProps = {
alt: string;
} & React.SVGAttributes<SVGSVGElement>;
export const StorybookLogo = ({ alt, ...props }: StorybookLogoProps) => (
<svg width="200px" height="40px" viewBox="0 0 200 40" {...props} role="img">
{alt ? <title>{alt}</title> : null}
<defs>
<path
d="M1.2 36.9L0 3.9c0-1.1.8-2 1.9-2.1l28-1.8a2 2 0 0 1 2.2 1.9 2 2 0 0 1 0 .1v36a2 2 0 0 1-2 2 2 2 0 0 1-.1 0L3.2 38.8a2 2 0 0 1-2-2z"
id="a"
/>
</defs>
<g fill="none" fillRule="evenodd">
<path
d="M53.3 31.7c-1.7 0-3.4-.3-5-.7-1.5-.5-2.8-1.1-3.9-2l1.6-3.5c2.2 1.5 4.6 2.3 7.3 2.3 1.5 0 2.5-.2 3.3-.7.7-.5 1.1-1 1.1-1.9 0-.7-.3-1.3-1-1.7s-2-.8-3.7-1.2c-2-.4-3.6-.9-4.8-1.5-1.1-.5-2-1.2-2.6-2-.5-1-.8-2-.8-3.2 0-1.4.4-2.6 1.2-3.6.7-1.1 1.8-2 3.2-2.6 1.3-.6 2.9-.9 4.7-.9 1.6 0 3.1.3 4.6.7 1.5.5 2.7 1.1 3.5 2l-1.6 3.5c-2-1.5-4.2-2.3-6.5-2.3-1.3 0-2.3.2-3 .8-.8.5-1.2 1.1-1.2 2 0 .5.2 1 .5 1.3.2.3.7.6 1.4.9l2.9.8c2.9.6 5 1.4 6.2 2.4a5 5 0 0 1 2 4.2 6 6 0 0 1-2.5 5c-1.7 1.2-4 1.9-7 1.9zm21-3.6l1.4-.1-.2 3.5-1.9.1c-2.4 0-4.1-.5-5.2-1.5-1.1-1-1.6-2.7-1.6-4.8v-6h-3v-3.6h3V11h4.8v4.6h4v3.6h-4v6c0 1.8.9 2.8 2.6 2.8zm11.1 3.5c-1.6 0-3-.3-4.3-1a7 7 0 0 1-3-2.8c-.6-1.3-1-2.7-1-4.4 0-1.6.4-3 1-4.3a7 7 0 0 1 3-2.8c1.2-.7 2.7-1 4.3-1 1.7 0 3.2.3 4.4 1a7 7 0 0 1 3 2.8c.6 1.2 1 2.7 1 4.3 0 1.7-.4 3.1-1 4.4a7 7 0 0 1-3 2.8c-1.2.7-2.7 1-4.4 1zm0-3.6c2.4 0 3.6-1.6 3.6-4.6 0-1.5-.3-2.6-1-3.4a3.2 3.2 0 0 0-2.6-1c-2.3 0-3.5 1.4-3.5 4.4 0 3 1.2 4.6 3.5 4.6zm21.7-8.8l-2.7.3c-1.3.2-2.3.5-2.8 1.2-.6.6-.9 1.4-.9 2.5v8.2H96V15.7h4.6v2.6c.8-1.8 2.5-2.8 5-3h1.3l.3 4zm14-3.5h4.8L116.4 37h-4.9l3-6.6-6.4-14.8h5l4 10 4-10zm16-.4c1.4 0 2.6.3 3.6 1 1 .6 1.9 1.6 2.5 2.8.6 1.2.9 2.7.9 4.3 0 1.6-.3 3-1 4.3a6.9 6.9 0 0 1-2.4 2.9c-1 .7-2.2 1-3.6 1-1 0-2-.2-3-.7-.8-.4-1.5-1-2-1.9v2.4h-4.7V8.8h4.8v9c.5-.8 1.2-1.4 2-1.9.9-.4 1.8-.6 3-.6zM135.7 28c1.1 0 2-.4 2.6-1.2.6-.8 1-2 1-3.4 0-1.5-.4-2.5-1-3.3s-1.5-1.1-2.6-1.1-2 .3-2.6 1.1c-.6.8-1 2-1 3.3 0 1.5.4 2.6 1 3.4.6.8 1.5 1.2 2.6 1.2zm18.9 3.6c-1.7 0-3.2-.3-4.4-1a7 7 0 0 1-3-2.8c-.6-1.3-1-2.7-1-4.4 0-1.6.4-3 1-4.3a7 7 0 0 1 3-2.8c1.2-.7 2.7-1 4.4-1 1.6 0 3 .3 4.3 1a7 7 0 0 1 3 2.8c.6 1.2 1 2.7 1 4.3 0 1.7-.4 3.1-1 4.4a7 7 0 0 1-3 2.8c-1.2.7-2.7 1-4.3 1zm0-3.6c2.3 0 3.5-1.6 3.5-4.6 0-1.5-.3-2.6-1-3.4a3.2 3.2 0 0 0-2.5-1c-2.4 0-3.6 1.4-3.6 4.4 0 3 1.2 4.6 3.6 4.6zm18 3.6c-1.7 0-3.2-.3-4.4-1a7 7 0 0 1-3-2.8c-.6-1.3-1-2.7-1-4.4 0-1.6.4-3 1-4.3a7 7 0 0 1 3-2.8c1.2-.7 2.7-1 4.4-1 1.6 0 3 .3 4.4 1a7 7 0 0 1 2.9 2.8c.6 1.2 1 2.7 1 4.3 0 1.7-.4 3.1-1 4.4a7 7 0 0 1-3 2.8c-1.2.7-2.7 1-4.3 1zm0-3.6c2.3 0 3.5-1.6 3.5-4.6 0-1.5-.3-2.6-1-3.4a3.2 3.2 0 0 0-2.5-1c-2.4 0-3.6 1.4-3.6 4.4 0 3 1.2 4.6 3.6 4.6zm27.4 3.4h-6l-6-7v7h-4.8V8.8h4.9v13.6l5.8-6.7h5.7l-6.6 7.5 7 8.2z"
fill="currentColor"
/>
<mask id="b" fill="#fff">
<use xlinkHref="#a" />
</mask>
<use fill="#FF4785" fillRule="nonzero" xlinkHref="#a" />
<path
d="M23.7 5L24 .2l3.9-.3.1 4.8a.3.3 0 0 1-.5.2L26 3.8l-1.7 1.4a.3.3 0 0 1-.5-.3zm-5 10c0 .9 5.3.5 6 0 0-5.4-2.8-8.2-8-8.2-5.3 0-8.2 2.8-8.2 7.1 0 7.4 10 7.6 10 11.6 0 1.2-.5 1.9-1.8 1.9-1.6 0-2.2-.9-2.1-3.6 0-.6-6.1-.8-6.3 0-.5 6.7 3.7 8.6 8.5 8.6 4.6 0 8.3-2.5 8.3-7 0-7.9-10.2-7.7-10.2-11.6 0-1.6 1.2-1.8 2-1.8.6 0 2 0 1.9 3z"
fill="#FFF"
fillRule="nonzero"
mask="url(#b)"
/>
</g>
</svg>
);
``` | /content/code_sandbox/code/core/src/components/brand/StorybookLogo.tsx | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 2,748 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" original="src/constants/localizedConstants" source-language="en" target-language="de">
<body>
<trans-unit id="viewMore">
<source xml:lang="en">View more</source>
<target state="translated">Mehr anzeigen</target>
</trans-unit>
<trans-unit id="releaseNotesPromptDescription">
<source xml:lang="en">View mssql for Visual Studio Code release notes?</source>
<target state="translated">MSSQL fr Visual Studio Code-Versionshinweise anzeigen?</target>
</trans-unit>
<trans-unit id="msgStartedExecute">
<source xml:lang="en">Started query execution for document "{0}"</source>
<target state="translated">Die Abfrageausfhrung fr Dokument "{0}" wurde gestartet.</target>
</trans-unit>
<trans-unit id="msgFinishedExecute">
<source xml:lang="en">Finished query execution for document "{0}"</source>
<target state="translated">Die Abfrageausfhrung fr Dokument "{0}" wurde abgeschlossen.</target>
</trans-unit>
<trans-unit id="msgRunQueryInProgress">
<source xml:lang="en">A query is already running for this editor session. Please cancel this query or wait for its completion.</source>
<target state="translated">Fr diese Editorsitzung wird bereits eine Abfrage ausgefhrt. Brechen Sie diese Abfrage ab, oder warten Sie auf den Abschluss der aktuellen Abfrageausfhrung.</target>
</trans-unit>
<trans-unit id="runQueryBatchStartMessage">
<source xml:lang="en">Started executing query at </source>
<target state="translated">Abfrageausfhrung gestartet um </target>
</trans-unit>
<trans-unit id="runQueryBatchStartLine">
<source xml:lang="en">Line {0}</source>
<target state="translated">Zeile {0}</target>
</trans-unit>
<trans-unit id="msgCancelQueryFailed">
<source xml:lang="en">Canceling the query failed: {0}</source>
<target state="translated">Fehler beim Abbrechen der Abfrage: {0}</target>
</trans-unit>
<trans-unit id="msgCancelQueryNotRunning">
<source xml:lang="en">Cannot cancel query as no query is running.</source>
<target state="translated">Die Abfrage kann nicht abgebrochen werden, weil keine Abfrage ausgefhrt wird.</target>
</trans-unit>
<trans-unit id="msgChooseDatabaseNotConnected">
<source xml:lang="en">No connection was found. Please connect to a server first.</source>
<target state="translated">Es wurde keine Verbindung gefunden. Stellen Sie zunchst eine Verbindung mit einem Server her.</target>
</trans-unit>
<trans-unit id="msgChooseDatabasePlaceholder">
<source xml:lang="en">Choose a database from the list below</source>
<target state="translated">Whlen Sie in der Liste unten eine Datenbank aus.</target>
</trans-unit>
<trans-unit id="msgConnectionError">
<source xml:lang="en">Error {0}: {1}</source>
<target state="translated">Fehler "{0}": {1}</target>
</trans-unit>
<trans-unit id="msgConnectionError2">
<source xml:lang="en">Failed to connect: {0}</source>
<target state="translated">Fehler bei der Verbindungsherstellung: {0}</target>
</trans-unit>
<trans-unit id="serverNameMissing">
<source xml:lang="en">Server name not received.</source>
<target state="translated">Der Servername wurde nicht empfangen.</target>
</trans-unit>
<trans-unit id="msgConnectionErrorPasswordExpired">
<source xml:lang="en">Error {0}: {1} Please login as a different user and change the password using ALTER LOGIN.</source>
<target state="translated">Fehler "{0}": {1}. Melden Sie sich als ein anderer Benutzer an, und ndern Sie das Kennwort mit ALTER LOGIN.</target>
</trans-unit>
<trans-unit id="connectionErrorChannelName">
<source xml:lang="en">Connection Errors</source>
<target state="translated">Verbindungsfehler</target>
</trans-unit>
<trans-unit id="msgPromptCancelConnect">
<source xml:lang="en">Server connection in progress. Do you want to cancel?</source>
<target state="translated">Die Serververbindung wird hergestellt. Mchten Sie den Vorgang abbrechen?</target>
</trans-unit>
<trans-unit id="msgPromptClearRecentConnections">
<source xml:lang="en">Confirm to clear recent connections list</source>
<target state="translated">Besttigen Sie das Lschen der Liste mit den zuletzt verwendeten Verbindungen.</target>
</trans-unit>
<trans-unit id="msgOpenSqlFile">
<source xml:lang="en">To use this command, Open a .sql file -or- Change editor language to "SQL" -or- Select T-SQL text in the active SQL editor.</source>
<target state="translated">ffnen Sie zum Verwenden dieses Befehls eine SQL-Datei oder ndern Sie die Editorsprache in "SQL" oder Whlen Sie im aktiven SQL-Editor "T-SQL-Text" aus.</target>
</trans-unit>
<trans-unit id="recentConnectionsPlaceholder">
<source xml:lang="en">Choose a connection profile from the list below</source>
<target state="translated">Whlen Sie in der Liste unten ein Verbindungsprofil aus.</target>
</trans-unit>
<trans-unit id="CreateProfileFromConnectionsListLabel">
<source xml:lang="en">Create Connection Profile</source>
<target state="translated">Verbindungsprofil erstellen</target>
</trans-unit>
<trans-unit id="CreateProfileLabel">
<source xml:lang="en">Create</source>
<target state="translated">Erstellen</target>
</trans-unit>
<trans-unit id="ClearRecentlyUsedLabel">
<source xml:lang="en">Clear Recent Connections List</source>
<target state="translated">Liste der zuletzt verwendeten Verbindungen lschen</target>
</trans-unit>
<trans-unit id="EditProfilesLabel">
<source xml:lang="en">Edit</source>
<target state="translated">Bearbeiten</target>
</trans-unit>
<trans-unit id="RemoveProfileLabel">
<source xml:lang="en">Remove</source>
<target state="translated">Entfernen</target>
</trans-unit>
<trans-unit id="ManageProfilesPrompt">
<source xml:lang="en">Manage Connection Profiles</source>
<target state="translated">Verbindungsprofile verwalten</target>
</trans-unit>
<trans-unit id="SampleServerName">
<source xml:lang="en">{{put-server-name-here}}</source>
<target state="translated">{{put-server-name-here}}</target>
</trans-unit>
<trans-unit id="serverPrompt">
<source xml:lang="en">Server name or ADO.NET connection string</source>
<target state="translated">Servername oder ADO.NET-Verbindungszeichenfolge</target>
</trans-unit>
<trans-unit id="serverPlaceholder">
<source xml:lang="en">hostname\\instance or <server>.database.windows.net or ADO.NET connection string</source>
<target state="translated">Hostname\\Instanz oder <Server>.database.windows.net oder ADO.NET-Verbindungszeichenfolge</target>
</trans-unit>
<trans-unit id="databasePrompt">
<source xml:lang="en">Database name</source>
<target state="translated">Datenbankname</target>
</trans-unit>
<trans-unit id="startIpAddressPrompt">
<source xml:lang="en">Start IP Address</source>
<target state="translated">Start-IP-Adresse</target>
</trans-unit>
<trans-unit id="endIpAddressPrompt">
<source xml:lang="en">End IP Address</source>
<target state="translated">End-IP-Adresse</target>
</trans-unit>
<trans-unit id="firewallRuleNamePrompt">
<source xml:lang="en">Firewall rule name</source>
<target state="translated">Name der Firewallregel</target>
</trans-unit>
<trans-unit id="databasePlaceholder">
<source xml:lang="en">[Optional] Database to connect (press Enter to connect to <default> database)</source>
<target state="translated">[Optional] Datenbank fr die Verbindungsherstellung (drcken Sie die EINGABETASTE, um eine Verbindung mit der <default>-Datenbank herzustellen).</target>
</trans-unit>
<trans-unit id="authTypePrompt">
<source xml:lang="en">Authentication Type</source>
<target state="translated">Authentifizierungstyp</target>
</trans-unit>
<trans-unit id="authTypeName">
<source xml:lang="en">authenticationType</source>
<target state="translated">Authentifizierungstyp</target>
</trans-unit>
<trans-unit id="authTypeIntegrated">
<source xml:lang="en">Integrated</source>
<target state="translated">Integriert</target>
</trans-unit>
<trans-unit id="authTypeSql">
<source xml:lang="en">SQL Login</source>
<target state="translated">SQL-Anmeldung</target>
</trans-unit>
<trans-unit id="authTypeAzureActiveDirectory">
<source xml:lang="en">Microsoft Entra Id - Universal w/ MFA Support</source>
<target state="translated">Microsoft Entra ID Universell mit MFA-Untersttzung</target>
</trans-unit>
<trans-unit id="azureAuthTypeCodeGrant">
<source xml:lang="en">Azure Code Grant</source>
<target state="translated">Azure-Code</target>
</trans-unit>
<trans-unit id="azureAuthTypeDeviceCode">
<source xml:lang="en">Azure Device Code</source>
<target state="translated">Azure-Gertecode</target>
</trans-unit>
<trans-unit id="azureLogChannelName">
<source xml:lang="en">Azure Logs</source>
<target state="translated">Azure-Protokolle</target>
</trans-unit>
<trans-unit id="azureConsentDialogOpen">
<source xml:lang="en">Open</source>
<target state="translated">ffnen</target>
</trans-unit>
<trans-unit id="azureConsentDialogCancel">
<source xml:lang="en">Cancel</source>
<target state="translated">Abbrechen</target>
</trans-unit>
<trans-unit id="azureConsentDialogIgnore">
<source xml:lang="en">Ignore Tenant</source>
<target state="translated">Mandanten ignorieren</target>
</trans-unit>
<trans-unit id="azureConsentDialogBody">
<source xml:lang="en">Your tenant '{0} ({1})' requires you to re-authenticate again to access {2} resources. Press Open to start the authentication process.</source>
<target state="translated">Fr Ihren Mandanten "{0} ({1})" mssen Sie sich erneut authentifizieren, um auf {2}-Ressourcen zuzugreifen. Klicken Sie auf "ffnen", um den Authentifizierungsvorgang zu starten.</target>
</trans-unit>
<trans-unit id="azureConsentDialogBodyAccount">
<source xml:lang="en">Your account needs re-authentication to access {0} resources. Press Open to start the authentication process.</source>
<target state="translated">Ihr Konto muss erneut authentifiziert werden, um auf {0} Ressourcen zugreifen zu knnen. Drcken Sie "ffnen", um den Authentifizierungsprozess zu starten.</target>
</trans-unit>
<trans-unit id="azureMicrosoftCorpAccount">
<source xml:lang="en">Microsoft Corp</source>
<target state="translated">Microsoft Corp.</target>
</trans-unit>
<trans-unit id="azureMicrosoftAccount">
<source xml:lang="en">Microsoft Entra Account</source>
<target state="translated">Microsoft Entra-Konto</target>
</trans-unit>
<trans-unit id="azureNoMicrosoftResource">
<source xml:lang="en">Provider '{0}' does not have a Microsoft resource endpoint defined.</source>
<target state="translated">Fr den Anbieter "{0}" ist kein Microsoft-Ressourcenendpunkt definiert.</target>
</trans-unit>
<trans-unit id="azureServerCouldNotStart">
<source xml:lang="en">Server could not start. This could be a permissions error or an incompatibility on your system. You can try enabling device code authentication from settings.</source>
<target state="translated">Der Server konnte nicht gestartet werden. Mglicherweise handelt es sich um einen Berechtigungsfehler oder eine Inkompatibilitt auf Ihrem System. Sie knnen versuchen, die Gertecodeauthentifizierung ber die Einstellungen zu aktivieren.</target>
</trans-unit>
<trans-unit id="azureAuthNonceError">
<source xml:lang="en">Authentication failed due to a nonce mismatch, please close Azure Data Studio and try again.</source>
<target state="translated">Fehler bei der Authentifizierung aufgrund eines Nonce-Konflikts. Schlieen Sie Azure Data Studio, und versuchen Sie es noch mal.</target>
</trans-unit>
<trans-unit id="azureAuthStateError">
<source xml:lang="en">Authentication failed due to a state mismatch, please close ADS and try again.</source>
<target state="translated">Fehler bei der Authentifizierung aufgrund eines Statuskonflikts. Schlieen Sie ADS, und versuchen Sie es noch mal.</target>
</trans-unit>
<trans-unit id="encryptPrompt">
<source xml:lang="en">Encrypt</source>
<target state="translated">Verschlsseln</target>
</trans-unit>
<trans-unit id="encryptName">
<source xml:lang="en">encrypt</source>
<target state="translated">Verschlsseln</target>
</trans-unit>
<trans-unit id="encryptOptional">
<source xml:lang="en">Optional (False)</source>
<target state="translated">Optional (FALSCH)</target>
</trans-unit>
<trans-unit id="encryptMandatory">
<source xml:lang="en">Mandatory (True)</source>
<target state="translated">Obligatorisch (WAHR)</target>
</trans-unit>
<trans-unit id="encryptMandatoryRecommended">
<source xml:lang="en">Mandatory (Recommended)</source>
<target state="translated">Obligatorisch (Empfohlen)</target>
</trans-unit>
<trans-unit id="enableTrustServerCertificate">
<source xml:lang="en">Enable Trust Server Certificate</source>
<target state="translated">Serverzertifikat vertrauen aktivieren</target>
</trans-unit>
<trans-unit id="readMore">
<source xml:lang="en">Read more</source>
<target state="translated">Weitere Informationen</target>
</trans-unit>
<trans-unit id="cancel">
<source xml:lang="en">Cancel</source>
<target state="translated">Abbrechen</target>
</trans-unit>
<trans-unit id="msgCopyAndOpenWebpage">
<source xml:lang="en">Copy code and open webpage</source>
<target state="translated">Code kopieren und Webseite ffnen</target>
</trans-unit>
<trans-unit id="azureChooseAccount">
<source xml:lang="en">Choose a Microsoft Entra account</source>
<target state="translated">Microsoft Entra-Konto auswhlen</target>
</trans-unit>
<trans-unit id="azureAddAccount">
<source xml:lang="en">Add a Microsoft Entra account...</source>
<target state="translated">Microsoft Entra-Konto hinzufgen...</target>
</trans-unit>
<trans-unit id="accountAddedSuccessfully">
<source xml:lang="en">Microsoft Entra account {0} successfully added.</source>
<target state="translated">Das Microsoft Entra-Konto {0} wurde erfolgreich hinzugefgt.</target>
</trans-unit>
<trans-unit id="accountCouldNotBeAdded">
<source xml:lang="en">New Microsoft Entra account could not be added.</source>
<target state="translated">Das neue Microsoft Entra-Konto konnte nicht hinzugefgt werden.</target>
</trans-unit>
<trans-unit id="accountRemovedSuccessfully">
<source xml:lang="en">Selected Microsoft Entra account removed successfully.</source>
<target state="translated">Das ausgewhlte Microsoft Entra-Konto wurde erfolgreich entfernt.</target>
</trans-unit>
<trans-unit id="accountRemovalFailed">
<source xml:lang="en">An error occurred while removing Microsoft Entra account: {0}</source>
<target state="translated">Fehler beim Entfernen des Microsoft Entra-Kontos: {0}</target>
</trans-unit>
<trans-unit id="noAzureAccountForRemoval">
<source xml:lang="en">No Microsoft Entra account can be found for removal.</source>
<target state="translated">Es wurde kein Microsoft Entra-Konto zum Entfernen gefunden.</target>
</trans-unit>
<trans-unit id="clearedAzureTokenCache">
<source xml:lang="en">Azure token cache cleared successfully.</source>
<target state="translated">Der Azure-Tokencache wurde erfolgreich gelscht.</target>
</trans-unit>
<trans-unit id="cannotConnect">
<source xml:lang="en">Cannot connect due to expired tokens. Please re-authenticate and try again.</source>
<target state="translated">Aufgrund abgelaufener Token kann keine Verbindung hergestellt werden. Authentifizieren Sie sich erneut, und versuchen Sie es noch mal.</target>
</trans-unit>
<trans-unit id="aad">
<source xml:lang="en">Microsoft Entra Id</source>
<target state="translated">Microsoft Entra ID</target>
</trans-unit>
<trans-unit id="azureChooseTenant">
<source xml:lang="en">Choose a Microsoft Entra tenant</source>
<target state="translated">Microsoft Entra-Mandant auswhlen</target>
</trans-unit>
<trans-unit id="tenant">
<source xml:lang="en">Tenant</source>
<target state="translated">Mandant</target>
</trans-unit>
<trans-unit id="usernamePrompt">
<source xml:lang="en">User name</source>
<target state="translated">Benutzername</target>
</trans-unit>
<trans-unit id="usernamePlaceholder">
<source xml:lang="en">User name (SQL Login)</source>
<target state="translated">Benutzername (SQL-Anmeldung)</target>
</trans-unit>
<trans-unit id="passwordPrompt">
<source xml:lang="en">Password</source>
<target state="translated">Kennwort</target>
</trans-unit>
<trans-unit id="passwordPlaceholder">
<source xml:lang="en">Password (SQL Login)</source>
<target state="translated">Kennwort (SQL-Anmeldung)</target>
</trans-unit>
<trans-unit id="msgSavePassword">
<source xml:lang="en">Save Password? If 'No', password will be required each time you connect</source>
<target state="translated">Kennwort speichern? Wenn Sie "Nein" angeben, muss das Kennwort bei jeder Verbindungsherstellung angegeben werden.</target>
</trans-unit>
<trans-unit id="profileNamePrompt">
<source xml:lang="en">Profile Name</source>
<target state="translated">Profilname</target>
</trans-unit>
<trans-unit id="profileNamePlaceholder">
<source xml:lang="en">[Optional] Enter a display name for this connection profile</source>
<target state="translated">[Optional] Gibt einen Anzeigenamen fr dieses Verbindungsprofil an.</target>
</trans-unit>
<trans-unit id="msgCannotOpenContent">
<source xml:lang="en">Error occurred opening content in editor.</source>
<target state="translated">Fehler beim ffnen des Inhalts im Editor.</target>
</trans-unit>
<trans-unit id="msgSaveStarted">
<source xml:lang="en">Started saving results to </source>
<target state="translated">Ergebnisse werden gespeichert in </target>
</trans-unit>
<trans-unit id="msgSaveFailed">
<source xml:lang="en">Failed to save results. </source>
<target state="translated">Fehler beim Speichern der Ergebnisse. </target>
</trans-unit>
<trans-unit id="msgSaveSucceeded">
<source xml:lang="en">Successfully saved results to </source>
<target state="translated">Ergebnisse erfolgreich gespeichert in:</target>
</trans-unit>
<trans-unit id="msgSelectProfileToRemove">
<source xml:lang="en">Select profile to remove</source>
<target state="translated">Whlen Sie das Profil aus, das entfernt werden soll.</target>
</trans-unit>
<trans-unit id="confirmRemoveProfilePrompt">
<source xml:lang="en">Confirm to remove this profile.</source>
<target state="translated">Besttigen Sie die Lschung des Profis.</target>
</trans-unit>
<trans-unit id="msgNoProfilesSaved">
<source xml:lang="en">No connection profile to remove.</source>
<target state="translated">Es ist kein Profil vorhanden, das entfernt werden kann.</target>
</trans-unit>
<trans-unit id="msgProfileRemoved">
<source xml:lang="en">Profile removed successfully</source>
<target state="translated">Das Profil wurde erfolgreich entfernt.</target>
</trans-unit>
<trans-unit id="msgProfileCreated">
<source xml:lang="en">Profile created successfully</source>
<target state="translated">Das Profil wurde erfolgreich erstellt.</target>
</trans-unit>
<trans-unit id="msgProfileCreatedAndConnected">
<source xml:lang="en">Profile created and connected</source>
<target state="translated">Das Profil wurde erstellt und verbunden.</target>
</trans-unit>
<trans-unit id="msgClearedRecentConnections">
<source xml:lang="en">Recent connections list cleared</source>
<target state="translated">Die Liste der zuletzt verwendeten Verbindungen wurde gelscht.</target>
</trans-unit>
<trans-unit id="msgIsRequired">
<source xml:lang="en"> is required.</source>
<target state="translated"> ist erforderlich.</target>
</trans-unit>
<trans-unit id="msgError">
<source xml:lang="en">Error: </source>
<target state="translated">Fehler: </target>
</trans-unit>
<trans-unit id="msgYes">
<source xml:lang="en">Yes</source>
<target state="translated">Ja</target>
</trans-unit>
<trans-unit id="msgNo">
<source xml:lang="en">No</source>
<target state="translated">Nein</target>
</trans-unit>
<trans-unit id="defaultDatabaseLabel">
<source xml:lang="en"><default></source>
<target state="translated"><default></target>
</trans-unit>
<trans-unit id="notConnectedLabel">
<source xml:lang="en">Disconnected</source>
<target state="translated">Getrennt</target>
</trans-unit>
<trans-unit id="notConnectedTooltip">
<source xml:lang="en">Click to connect to a database</source>
<target state="translated">Klicken Sie hier, um eine Verbindung mit einer Datenbank herzustellen.</target>
</trans-unit>
<trans-unit id="connectingLabel">
<source xml:lang="en">Connecting</source>
<target state="translated">Die Verbindung wird hergestellt.</target>
</trans-unit>
<trans-unit id="connectingTooltip">
<source xml:lang="en">Connecting to: </source>
<target state="translated">Verbindung wird hergestellt mit: </target>
</trans-unit>
<trans-unit id="connectErrorLabel">
<source xml:lang="en">Connection error</source>
<target state="translated">Verbindungsfehler</target>
</trans-unit>
<trans-unit id="connectErrorTooltip">
<source xml:lang="en">Error connecting to: </source>
<target state="translated">Fehler bei der Verbindungsherstellung mit: </target>
</trans-unit>
<trans-unit id="connectErrorCode">
<source xml:lang="en">Error code: </source>
<target state="translated">Fehlercode: </target>
</trans-unit>
<trans-unit id="connectErrorMessage">
<source xml:lang="en">Error Message: </source>
<target state="translated">Fehlermeldung: </target>
</trans-unit>
<trans-unit id="cancelingQueryLabel">
<source xml:lang="en">Canceling query </source>
<target state="translated">Die Abfrage wird abgebrochen. </target>
</trans-unit>
<trans-unit id="updatingIntelliSenseLabel">
<source xml:lang="en">Updating IntelliSense...</source>
<target state="translated">IntelliSense wird aktualisiert...</target>
</trans-unit>
<trans-unit id="extensionNotInitializedError">
<source xml:lang="en">Unable to execute the command while the extension is initializing. Please try again later.</source>
<target state="translated">Der Befehl kann whrend der Initialisierung der Erweiterung nicht ausgefhrt werden. Versuchen Sie es spter noch mal.</target>
</trans-unit>
<trans-unit id="untitledScheme">
<source xml:lang="en">untitled</source>
<target state="translated">Unbenannt</target>
</trans-unit>
<trans-unit id="msgChangeLanguageMode">
<source xml:lang="en">To use this command, you must set the language to "SQL". Confirm to change language mode.</source>
<target state="translated">Um diesen Befehl zu verwenden, mssen Sie die Sprache auf "SQL" festlegen. Besttigen Sie die nderung des Sprachmodus.</target>
</trans-unit>
<trans-unit id="msgChangedDatabaseContext">
<source xml:lang="en">Changed database context to "{0}" for document "{1}"</source>
<target state="translated">Der Datenbankkontext fr das Dokument "{1}" wurde in "{0}" gendert.</target>
</trans-unit>
<trans-unit id="msgPromptRetryCreateProfile">
<source xml:lang="en">Error: Unable to connect using the connection information provided. Retry profile creation?</source>
<target state="translated">Fehler: Es konnte mit den angegebenen Verbindungsinformationen keine Verbindung hergestellt werden. Profilerstellung wiederholen?</target>
</trans-unit>
<trans-unit id="refreshTokenLabel">
<source xml:lang="en">Refresh Credentials</source>
<target state="translated">Anmeldeinformationen aktualisieren</target>
</trans-unit>
<trans-unit id="msgGetTokenFail">
<source xml:lang="en">Failed to fetch user tokens.</source>
<target state="translated">Fehler beim Abrufen von Benutzertoken.</target>
</trans-unit>
<trans-unit id="msgPromptRetryConnectionDifferentCredentials">
<source xml:lang="en">Error: Login failed. Retry using different credentials?</source>
<target state="translated">Fehler: Fehler bei der Anmeldung. Mit anderen Anmeldeinformationen wiederholen?</target>
</trans-unit>
<trans-unit id="msgPromptSSLCertificateValidationFailed">
<source xml:lang="en">Encryption was enabled on this connection, review your SSL and certificate configuration for the target SQL Server, or set 'Trust server certificate' to 'true' in the settings file. Note: A self-signed certificate offers only limited protection and is not a recommended practice for production environments. Do you want to enable 'Trust server certificate' on this connection and retry?</source>
<target state="translated">Die Verschlsselung wurde fr diese Verbindung aktiviert, berprfen Sie Ihre SSL- und Zertifikatskonfiguration fr den Ziel-SQL Server, oder legen Sie Serverzertifikat vertrauen in der Einstellungsdatei auf WAHR fest. Hinweis: Ein selbstsigniertes Zertifikat bietet nur eingeschrnkten Schutz und ist keine empfohlene Praxis fr Produktionsumgebungen. Mchten Sie Serverzertifikat vertrauen fr diese Verbindung aktivieren und es erneut versuchen?</target>
</trans-unit>
<trans-unit id="msgPromptRetryFirewallRuleNotSignedIn">
<source xml:lang="en">Your client IP address does not have access to the server. Add a Microsoft Entra account and create a new firewall rule to enable access.</source>
<target state="translated">Ihre Client-IP-Adresse hat keinen Zugriff auf den Server. Fgen Sie ein Microsoft Entra-Konto hinzu, und erstellen Sie eine neue Firewallregel, um den Zugriff zu ermglichen.</target>
</trans-unit>
<trans-unit id="msgPromptRetryFirewallRuleSignedIn">
<source xml:lang="en">Your client IP Address '{0}' does not have access to the server '{1}' you're attempting to connect to. Would you like to create new firewall rule?</source>
<target state="translated">Ihre Client-IP-Adresse "{0}" hat keinen Zugriff auf den Server "{1}", mit dem Sie eine Verbindung herstellen mchten. Mchten Sie eine neue Firewallregel erstellen?</target>
</trans-unit>
<trans-unit id="msgPromptRetryFirewallRuleAdded">
<source xml:lang="en">Firewall rule successfully added. Retry profile creation? </source>
<target state="translated">Die Firewallregel wurde erfolgreich hinzugefgt. Profilerstellung wiederholen? </target>
</trans-unit>
<trans-unit id="msgAccountRefreshFailed">
<source xml:lang="en">Credential Error: An error occurred while attempting to refresh account credentials. Please re-authenticate.</source>
<target state="translated">Anmeldeinformationsfehler: Beim Aktualisieren der Kontoanmeldeinformationen ist ein Fehler aufgetreten. Bitte authentifizieren Sie sich erneut.</target>
</trans-unit>
<trans-unit id="msgPromptProfileUpdateFailed">
<source xml:lang="en">Connection Profile could not be updated. Please modify the connection details manually in settings.json and try again.</source>
<target state="translated">Das Verbindungsprofil konnte nicht aktualisiert werden. Bitte ndern Sie die Verbindungsdetails manuell in settings.json, und versuchen Sie es noch mal.</target>
</trans-unit>
<trans-unit id="msgUnableToExpand">
<source xml:lang="en">Unable to expand. Please check logs for more information.</source>
<target state="translated">Erweiterung nicht mglich. Weitere Informationen finden Sie in den Protokollen.</target>
</trans-unit>
<trans-unit id="msgPromptFirewallRuleCreated">
<source xml:lang="en">Firewall rule successfully created.</source>
<target state="translated">Die Firewallregel wurde erfolgreich erstellt.</target>
</trans-unit>
<trans-unit id="msgAuthTypeNotFound">
<source xml:lang="en">Failed to get authentication method, please remove and re-add the account.</source>
<target state="translated">Fehler beim Abrufen der Authentifizierungsmethode. Entfernen Sie das Konto, und fgen Sie es erneut hinzu.</target>
</trans-unit>
<trans-unit id="msgAccountNotFound">
<source xml:lang="en">Account not found</source>
<target state="translated">Konto nicht gefunden.</target>
</trans-unit>
<trans-unit id="msgChooseQueryHistory">
<source xml:lang="en">Choose Query History</source>
<target state="translated">Abfrageverlauf auswhlen</target>
</trans-unit>
<trans-unit id="msgChooseQueryHistoryAction">
<source xml:lang="en">Choose An Action</source>
<target state="translated">Aktion auswhlen</target>
</trans-unit>
<trans-unit id="msgOpenQueryHistory">
<source xml:lang="en">Open Query History</source>
<target state="translated">Abfrageverlauf ffnen</target>
</trans-unit>
<trans-unit id="msgRunQueryHistory">
<source xml:lang="en">Run Query History</source>
<target state="translated">Abfrageverlauf ausfhren</target>
</trans-unit>
<trans-unit id="msgInvalidIpAddress">
<source xml:lang="en">Invalid IP Address</source>
<target state="translated">Ungltige IP-Adresse.</target>
</trans-unit>
<trans-unit id="msgInvalidRuleName">
<source xml:lang="en">Invalid Firewall rule name</source>
<target state="translated">Ungltiger Name fr Firewallregel</target>
</trans-unit>
<trans-unit id="msgNoQueriesAvailable">
<source xml:lang="en">No Queries Available</source>
<target state="translated">Keine Abfragen vorhanden.</target>
</trans-unit>
<trans-unit id="retryLabel">
<source xml:lang="en">Retry</source>
<target state="translated">Wiederholen</target>
</trans-unit>
<trans-unit id="createFirewallRuleLabel">
<source xml:lang="en">Create Firewall Rule</source>
<target state="translated">Firewallregel erstellen</target>
</trans-unit>
<trans-unit id="msgConnecting">
<source xml:lang="en">Connecting to server "{0}" on document "{1}".</source>
<target state="translated">Die Verbindung mit Server "{0}" fr Dokument "{1}" wird hergestellt.</target>
</trans-unit>
<trans-unit id="msgConnectionNotFound">
<source xml:lang="en">Connection not found for uri "{0}".</source>
<target state="translated">Die Verbindung fr URI {0} wurde nicht gefunden.</target>
</trans-unit>
<trans-unit id="msgFoundPendingReconnect">
<source xml:lang="en">Found pending reconnect promise for uri {0}, waiting.</source>
<target state="translated">Ausstehende Zusage fr Verbindungswiederherstellung fr URI {0} gefunden, wartend.</target>
</trans-unit>
<trans-unit id="msgPendingReconnectSuccess">
<source xml:lang="en">Previous pending reconnection for uri {0}, succeeded.</source>
<target state="translated">Vorherige ausstehende Verbindungswiederherstellung fr URI {0}, erfolgreich.</target>
</trans-unit>
<trans-unit id="msgFoundPendingReconnectFailed">
<source xml:lang="en">Found pending reconnect promise for uri {0}, failed.</source>
<target state="translated">Ausstehende Zusage fr Verbindungswiederherstellung fr URI {0} gefunden, fehlgeschlagen.</target>
</trans-unit>
<trans-unit id="msgFoundPendingReconnectError">
<source xml:lang="en">Previous pending reconnect promise for uri {0} is rejected with error {1}, will attempt to reconnect if necessary.</source>
<target state="translated">Die vorherige ausstehende Zusage fr die Verbindungswiederherstellung fr URI {0} wird mit dem Fehler {1} abgelehnt, bei Bedarf wird versucht, die Verbindung wiederherzustellen.</target>
</trans-unit>
<trans-unit id="msgAcessTokenExpired">
<source xml:lang="en">Access token expired for connection {0} with uri {1}</source>
<target state="translated">Zugriffstoken fr die Verbindung {0} mit URI {1} ist abgelaufen</target>
</trans-unit>
<trans-unit id="msgRefreshTokenError">
<source xml:lang="en">Error when refreshing token</source>
<target state="translated">Fehler beim Aktualisieren des Tokens</target>
</trans-unit>
<trans-unit id="msgAzureCredStoreSaveFailedError">
<source xml:lang="en">Keys for token cache could not be saved in credential store, this may cause Microsoft Entra Id access token persistence issues and connection instabilities. It's likely that SqlTools has reached credential storage limit on Windows, please clear at least 2 credentials that start with "Microsoft.SqlTools|" in Windows Credential Manager and reload.</source>
<target state="translated">Schlssel fr den Tokencache konnten nicht im Anmeldeinformationsspeicher gespeichert werden. Dies kann zu Problemen mit der Microsoft Entra-ID-Zugriffstokenpersistenz und Verbindungsinstabilitten fhren. Es ist wahrscheinlich, dass SqlTools das Speicherlimit fr Anmeldeinformationen unter Windows erreicht hat. Lschen Sie mindestens 2 Anmeldeinformationen, die mit "Microsoft.SqlTools|" in Windows Anmeldeinformationsverwaltung beginnen, und laden Sie sie erneut.</target>
</trans-unit>
<trans-unit id="msgRefreshConnection">
<source xml:lang="en">Failed to refresh connection ${0} with uri {1}, invalid connection result.</source>
<target state="translated">Fehler beim Aktualisieren der Verbindung ${0} mit URI {1}, ungltiges Verbindungsergebnis.</target>
</trans-unit>
<trans-unit id="msgRefreshTokenSuccess">
<source xml:lang="en">Successfully refreshed token for connection {0} with uri {1}, {2}</source>
<target state="translated">Token fr Verbindung {0} mit URI {1}, {2} wurde erfolgreich aktualisiert</target>
</trans-unit>
<trans-unit id="msgRefreshTokenNotNeeded">
<source xml:lang="en">No need to refresh Microsoft Entra acccount token for connection {0} with uri {1}</source>
<target state="translated">Es ist nicht erforderlich, das Microsoft Entra-Zugriffstoken fr die Verbindung {0} mit dem URI zu aktualisieren. {1}</target>
</trans-unit>
<trans-unit id="msgConnectedServerInfo">
<source xml:lang="en">Connected to server "{0}" on document "{1}". Server information: {2}</source>
<target state="translated">Die Verbindung mit Server "{0}" fr Dokument "{1}" wurde hergestellt. Serverinformationen: {2}</target>
</trans-unit>
<trans-unit id="msgConnectionFailed">
<source xml:lang="en">Error connecting to server "{0}". Details: {1}</source>
<target state="translated">Fehler bei der Verbindungsherstellung mit dem Server "{0}". Details: {1}</target>
</trans-unit>
<trans-unit id="msgChangingDatabase">
<source xml:lang="en">Changing database context to "{0}" on server "{1}" on document "{2}".</source>
<target state="translated">Der Datenbankkontext auf Server "{1}" fr Dokument "{2}" wird gendert in "{0}".</target>
</trans-unit>
<trans-unit id="msgChangedDatabase">
<source xml:lang="en">Changed database context to "{0}" on server "{1}" on document "{2}".</source>
<target state="translated">Der Datenbankkontext auf Server "{1}" fr Dokument "{2}" wurde gendert in "{0}".</target>
</trans-unit>
<trans-unit id="msgDisconnected">
<source xml:lang="en">Disconnected on document "{0}"</source>
<target state="translated">Die Verbindung fr Dokument "{0}" wurde getrennt.</target>
</trans-unit>
<trans-unit id="macOpenSslErrorMessage">
<source xml:lang="en">OpenSSL version >=1.0.1 is required to connect.</source>
<target state="translated">Fr die Verbindungsherstellung wird OpenSSL-Version1.0.1 oder hher bentigt.</target>
</trans-unit>
<trans-unit id="macOpenSslHelpButton">
<source xml:lang="en">Help</source>
<target state="translated">Hilfe</target>
</trans-unit>
<trans-unit id="macSierraRequiredErrorMessage">
<source xml:lang="en">macOS Sierra or newer is required to use this feature.</source>
<target state="translated">Um dieses Feature zu nutzen, wird macOS Sierra oder neuer bentigt.</target>
</trans-unit>
<trans-unit id="gettingDefinitionMessage">
<source xml:lang="en">Getting definition ...</source>
<target state="translated">Definition wird abgerufen...</target>
</trans-unit>
<trans-unit id="definitionRequestedStatus">
<source xml:lang="en">DefinitionRequested</source>
<target state="translated">DefinitionRequested</target>
</trans-unit>
<trans-unit id="definitionRequestCompletedStatus">
<source xml:lang="en">DefinitionRequestCompleted</source>
<target state="translated">DefinitionRequestCompleted</target>
</trans-unit>
<trans-unit id="updatingIntelliSenseStatus">
<source xml:lang="en">updatingIntelliSense</source>
<target state="translated">updatingIntelliSense</target>
</trans-unit>
<trans-unit id="intelliSenseUpdatedStatus">
<source xml:lang="en">intelliSenseUpdated</source>
<target state="translated">intelliSenseUpdated</target>
</trans-unit>
<trans-unit id="testLocalizationConstant">
<source xml:lang="en">test</source>
<target state="translated">Test</target>
</trans-unit>
<trans-unit id="disconnectOptionLabel">
<source xml:lang="en">Disconnect</source>
<target state="translated">Trennen</target>
</trans-unit>
<trans-unit id="disconnectOptionDescription">
<source xml:lang="en">Close the current connection</source>
<target state="translated">Aktuelle Verbindung schlieen</target>
</trans-unit>
<trans-unit id="disconnectConfirmationMsg">
<source xml:lang="en">Are you sure you want to disconnect?</source>
<target state="translated">Mchten Sie die Verbindung trennen?</target>
</trans-unit>
<trans-unit id="elapsedBatchTime">
<source xml:lang="en">Batch execution time: {0}</source>
<target state="translated">Batchausfhrungszeit: {0}</target>
</trans-unit>
<trans-unit id="noActiveEditorMsg">
<source xml:lang="en">A SQL editor must have focus before executing this command</source>
<target state="translated">Ein SQL-Editor muss den Fokus haben, damit dieser Befehl ausgefhrt werden kann.</target>
</trans-unit>
<trans-unit id="maximizeLabel">
<source xml:lang="en">Maximize</source>
<target state="translated">Maximieren</target>
</trans-unit>
<trans-unit id="restoreLabel">
<source xml:lang="en">Restore</source>
<target state="translated">Wiederherstellen</target>
</trans-unit>
<trans-unit id="saveCSVLabel">
<source xml:lang="en">Save as CSV</source>
<target state="translated">Als CSV speichern</target>
</trans-unit>
<trans-unit id="saveJSONLabel">
<source xml:lang="en">Save as JSON</source>
<target state="translated">Als JSON speichern</target>
</trans-unit>
<trans-unit id="saveExcelLabel">
<source xml:lang="en">Save as Excel</source>
<target state="translated">Als Excel-Datei speichern</target>
</trans-unit>
<trans-unit id="fileTypeCSVLabel">
<source xml:lang="en">CSV</source>
<target state="translated">CSV</target>
</trans-unit>
<trans-unit id="fileTypeJSONLabel">
<source xml:lang="en">JSON</source>
<target state="translated">JSON</target>
</trans-unit>
<trans-unit id="fileTypeExcelLabel">
<source xml:lang="en">Excel</source>
<target state="translated">Excel</target>
</trans-unit>
<trans-unit id="resultPaneLabel">
<source xml:lang="en">Results</source>
<target state="translated">Ergebnisse</target>
</trans-unit>
<trans-unit id="selectAll">
<source xml:lang="en">Select all</source>
<target state="translated">Alles auswhlen</target>
</trans-unit>
<trans-unit id="copyLabel">
<source xml:lang="en">Copy</source>
<target state="translated">Kopieren</target>
</trans-unit>
<trans-unit id="copyWithHeadersLabel">
<source xml:lang="en">Copy with Headers</source>
<target state="translated">Mit Headern kopieren</target>
</trans-unit>
<trans-unit id="executeQueryLabel">
<source xml:lang="en">Executing query...</source>
<target state="translated">Abfrage wird ausgefhrt...</target>
</trans-unit>
<trans-unit id="QueryExecutedLabel">
<source xml:lang="en">Query executed</source>
<target state="translated">Abfrage ausgefhrt</target>
</trans-unit>
<trans-unit id="messagePaneLabel">
<source xml:lang="en">Messages</source>
<target state="translated">Meldungen</target>
</trans-unit>
<trans-unit id="messagesTableTimeStampColumn">
<source xml:lang="en">Timestamp</source>
<target state="translated">Zeitstempel</target>
</trans-unit>
<trans-unit id="messagesTableMessageColumn">
<source xml:lang="en">Message</source>
<target state="translated">Nachricht</target>
</trans-unit>
<trans-unit id="lineSelectorFormatted">
<source xml:lang="en">Line {0}</source>
<target state="translated">Zeile {0}</target>
</trans-unit>
<trans-unit id="elapsedTimeLabel">
<source xml:lang="en">Total execution time: {0}</source>
<target state="translated">Ausfhrungszeit gesamt: {0}</target>
</trans-unit>
<trans-unit id="msgCannotSaveMultipleSelections">
<source xml:lang="en">Save results command cannot be used with multiple selections.</source>
<target state="translated">Der Befehl "Ergebnisse speichern" kann nicht mit einer Mehrfachauswahl verwendet werden.</target>
</trans-unit>
<trans-unit id="mssqlProviderName">
<source xml:lang="en">MSSQL</source>
<target state="translated">MSSQL</target>
</trans-unit>
<trans-unit id="noneProviderName">
<source xml:lang="en">None</source>
<target state="translated">Keine</target>
</trans-unit>
<trans-unit id="flavorChooseLanguage">
<source xml:lang="en">Choose SQL Language</source>
<target state="translated">SQL-Sprache auswhlen</target>
</trans-unit>
<trans-unit id="flavorDescriptionMssql">
<source xml:lang="en">Use T-SQL intellisense and syntax error checking on current document</source>
<target state="translated">T-SQL-IntelliSense und Syntaxfehlerprfung im aktuellen Dokument verwenden</target>
</trans-unit>
<trans-unit id="flavorDescriptionNone">
<source xml:lang="en">Disable intellisense and syntax error checking on current document</source>
<target state="translated">IntelliSense und Syntaxfehlerprfung im aktuellen Dokument deaktivieren</target>
</trans-unit>
<trans-unit id="msgAddConnection">
<source xml:lang="en">Add Connection</source>
<target state="translated">Verbindung hinzufgen</target>
</trans-unit>
<trans-unit id="msgConnect">
<source xml:lang="en">Connect</source>
<target state="translated">Verbinden</target>
</trans-unit>
<trans-unit id="azureSignIn">
<source xml:lang="en">Azure: Sign In</source>
<target state="translated">Azure: Anmelden</target>
</trans-unit>
<trans-unit id="azureSignInDescription">
<source xml:lang="en">Sign in to your Azure subscription</source>
<target state="translated">Melden Sie sich bei Ihrem Azure-Abonnement an.</target>
</trans-unit>
<trans-unit id="azureSignInWithDeviceCode">
<source xml:lang="en">Azure: Sign In with Device Code</source>
<target state="translated">Azure: Mit Gertecode anmelden</target>
</trans-unit>
<trans-unit id="azureSignInWithDeviceCodeDescription">
<source xml:lang="en">Sign in to your Azure subscription with a device code. Use this in setups where the Sign In command does not work</source>
<target state="translated">Melden Sie sich mit einem Gertecode bei Ihrem Azure-Abonnement an. Verwenden Sie diese Option fr Einrichtungen, bei denen der Anmeldebefehl nicht funktioniert.</target>
</trans-unit>
<trans-unit id="azureSignInToAzureCloud">
<source xml:lang="en">Azure: Sign In to Azure Cloud</source>
<target state="translated">Azure: Bei Azure-Cloud anmelden</target>
</trans-unit>
<trans-unit id="azureSignInToAzureCloudDescription">
<source xml:lang="en">Sign in to your Azure subscription in one of the sovereign clouds.</source>
<target state="translated">Melden Sie sich in einer der Sovereign Clouds bei Ihrem Azure-Abonnement an.</target>
</trans-unit>
<trans-unit id="taskStatusWithName">
<source xml:lang="en">{0}: {1}</source>
<target state="translated">{0}: {1}</target>
</trans-unit>
<trans-unit id="taskStatusWithMessage">
<source xml:lang="en">{1}. {2}</source>
<target state="translated">{1}. {2}</target>
</trans-unit>
<trans-unit id="taskStatusWithNameAndMessage">
<source xml:lang="en">{0}: {1}. {2}</source>
<target state="translated">{0}: {1}. {2}</target>
</trans-unit>
<trans-unit id="failed">
<source xml:lang="en">Failed</source>
<target state="translated">Fehler</target>
</trans-unit>
<trans-unit id="succeeded">
<source xml:lang="en">Succeeded</source>
<target state="translated">Erfolgreich</target>
</trans-unit>
<trans-unit id="succeededWithWarning">
<source xml:lang="en">Succeeded with warning</source>
<target state="translated">Erfolgreich mit Warnung</target>
</trans-unit>
<trans-unit id="canceled">
<source xml:lang="en">Canceled</source>
<target state="translated">Abgebrochen</target>
</trans-unit>
<trans-unit id="inProgress">
<source xml:lang="en">In progress</source>
<target state="translated">In Bearbeitung</target>
</trans-unit>
<trans-unit id="canceling">
<source xml:lang="en">Canceling</source>
<target state="translated">Vorgang wird abgebrochen</target>
</trans-unit>
<trans-unit id="notStarted">
<source xml:lang="en">Not started</source>
<target state="translated">Nicht gestartet</target>
</trans-unit>
<trans-unit id="nodeErrorMessage">
<source xml:lang="en">Parent node was not TreeNodeInfo.</source>
<target state="translated">Der bergeordnete Knoten war nicht TreeNodeInfo.</target>
</trans-unit>
<trans-unit id="deleteCredentialError">
<source xml:lang="en">Failed to delete credential with id: {0}. {1}</source>
<target state="translated">Fehler beim Lschen von Anmeldeinformationen mit der ID: {0}. {1}</target>
</trans-unit>
<trans-unit id="msgClearedRecentConnectionsWithErrors">
<source xml:lang="en">The recent connections list has been cleared but there were errors while deleting some associated credentials. View the errors in the MSSQL output channel.</source>
<target state="translated">Die Liste der zuletzt verwendeten Verbindungen wurde gelscht, aber beim Lschen einiger zugeordneter Anmeldeinformationen sind Fehler aufgetreten. Zeigen Sie die Fehler im MSSQL-Ausgabekanal an.</target>
</trans-unit>
<trans-unit id="connectProgressNoticationTitle">
<source xml:lang="en">Testing connection profile...</source>
<target state="translated">Verbindungsprofil wird getestet...</target>
</trans-unit>
<trans-unit id="msgMultipleSelectionModeNotSupported">
<source xml:lang="en">Running query is not supported when the editor is in multiple selection mode.</source>
<target state="translated">Das Ausfhren einer Abfrage wird nicht untersttzt, wenn sich der Editor im Mehrfachauswahlmodus befindet.</target>
</trans-unit>
<trans-unit id="newColumnWidthPrompt">
<source xml:lang="en">Enter new column width</source>
<target state="translated">Neue Spaltenbreite eingeben</target>
</trans-unit>
<trans-unit id="columnWidthInvalidNumberError">
<source xml:lang="en">Invalid column width</source>
<target state="translated">Ungltige Spaltenbreite</target>
</trans-unit>
<trans-unit id="columnWidthMustBePositiveError">
<source xml:lang="en">Width cannot be 0 or negative</source>
<target state="translated">Die Breite darf nicht 0 oder negativ sein.</target>
</trans-unit>
<trans-unit id="objectExplorerNodeRefreshError">
<source xml:lang="en">An error occurred refreshing nodes. See the MSSQL output channel for more details.</source>
<target state="translated">Fehler beim Aktualisieren der Knoten. Weitere Informationen finden Sie im MSSQL-Ausgabekanal.</target>
</trans-unit>
<trans-unit id="showOutputChannelActionButtonText">
<source xml:lang="en">Show MSSQL output</source>
<target state="translated">MSSQL-Ausgabe anzeigen</target>
</trans-unit>
<trans-unit id="reloadPrompt">
<source xml:lang="en">Authentication Library has changed, please reload Visual Studio Code.</source>
<target state="translated">Die Authentifizierungsbibliothek wurde gendert. Bitte laden Sie Visual Studio Code erneut.</target>
</trans-unit>
<trans-unit id="reloadPromptGeneric">
<source xml:lang="en">This setting requires Visual Studio Code to be relaunched, please reload Visual Studio Code.</source>
<target state="translated">Fr diese Einstellung muss Visual Studio Code neu gestartet werden. Laden Sie Visual Studio Code neu.</target>
</trans-unit>
<trans-unit id="reloadChoice">
<source xml:lang="en">Reload Visual Studio Code</source>
<target state="translated">Visual Studio Code erneut laden</target>
</trans-unit>
<trans-unit id="switchToMsal">
<source xml:lang="en">Switch to MSAL</source>
<target state="translated">Zu MSAL wechseln</target>
</trans-unit>
<trans-unit id="dismiss">
<source xml:lang="en">Dismiss</source>
<target state="translated">Schlieen</target>
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/localization/xliff/deu/constants/localizedConstants.deu.xlf | xml | 2016-06-26T04:38:04 | 2024-08-16T20:04:12 | vscode-mssql | microsoft/vscode-mssql | 1,523 | 13,108 |
```xml
import { createColumnHelper } from '@tanstack/react-table';
import { Service } from '../../../types';
export const columnHelper = createColumnHelper<Service>();
``` | /content/code_sandbox/app/react/kubernetes/services/ServicesView/ServicesDatatable/columns/helper.ts | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 32 |
```xml
import { CommonModule } from "@angular/common";
import { Component } from "@angular/core";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { NavigationModule } from "@bitwarden/components";
@Component({
selector: "app-toggle-width",
template: `<bit-nav-item
text="Toggle Width"
icon="bwi-bug"
*ngIf="isDev"
(click)="toggleWidth()"
></bit-nav-item>`,
standalone: true,
imports: [CommonModule, NavigationModule],
})
export class ToggleWidthComponent {
protected isDev: boolean;
constructor(platformUtilsService: PlatformUtilsService) {
this.isDev = platformUtilsService.isDev();
}
protected toggleWidth() {
if (document.body.style.minWidth === "unset") {
document.body.style.minWidth = "";
} else {
document.body.style.minWidth = "unset";
}
}
}
``` | /content/code_sandbox/apps/web/src/app/layouts/toggle-width.component.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 204 |
```xml
export * from './components/Tab/index';
``` | /content/code_sandbox/packages/react-components/react-tabs/library/src/Tab.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 10 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {MemoryRouter, Route, Routes} from 'react-router-dom';
import {
render,
waitForElementToBeRemoved,
screen,
} from 'modules/testing-library';
import {MetricPanel} from './index';
import {statistics} from 'modules/mocks/statistics';
import {panelStatesStore} from 'modules/stores/panelStates';
import {LocationLog} from 'modules/utils/LocationLog';
import {mockFetchProcessCoreStatistics} from 'modules/mocks/api/processInstances/fetchProcessCoreStatistics';
import {Paths} from 'modules/Routes';
function createWrapper(initialPath: string = Paths.dashboard()) {
const Wrapper: React.FC<{children?: React.ReactNode}> = ({children}) => {
return (
<MemoryRouter initialEntries={[initialPath]}>
<Routes>
<Route path={Paths.processes()} element={<div>Processes</div>} />
<Route path={Paths.dashboard()} element={children} />
</Routes>
<LocationLog />
</MemoryRouter>
);
};
return Wrapper;
}
describe('<MetricPanel />', () => {
beforeEach(() => {
panelStatesStore.toggleFiltersPanel();
mockFetchProcessCoreStatistics().withSuccess(statistics);
});
afterEach(() => {
panelStatesStore.reset();
});
it('should first display skeleton, then the statistics', async () => {
render(<MetricPanel />, {
wrapper: createWrapper(),
});
expect(screen.getByTestId('instances-bar-skeleton')).toBeInTheDocument();
expect(screen.getByTestId('total-instances-link')).toHaveTextContent(
'Running Process Instances in total',
);
await waitForElementToBeRemoved(() =>
screen.getByTestId('instances-bar-skeleton'),
);
expect(
screen.getByText('1087 Running Process Instances in total'),
).toBeInTheDocument();
});
it('should show active process instances and process instances with incidents', async () => {
render(<MetricPanel />, {
wrapper: createWrapper(),
});
expect(
screen.getByText('Process Instances with Incident'),
).toBeInTheDocument();
expect(screen.getByText('Active Process Instances')).toBeInTheDocument();
expect(
await screen.findByTestId('incident-instances-badge'),
).toHaveTextContent('877');
expect(
await screen.findByTestId('active-instances-badge'),
).toHaveTextContent('210');
});
it('should go to the correct page when clicking on instances with incidents', async () => {
const {user} = render(<MetricPanel />, {
wrapper: createWrapper(),
});
await waitForElementToBeRemoved(() =>
screen.getByTestId('instances-bar-skeleton'),
);
expect(panelStatesStore.state.isFiltersCollapsed).toBe(true);
await user.click(screen.getByText('Process Instances with Incident'));
expect(screen.getByTestId('pathname')).toHaveTextContent(/^\/processes$/);
expect(screen.getByTestId('search')).toHaveTextContent(
/^\?incidents=true$/,
);
expect(panelStatesStore.state.isFiltersCollapsed).toBe(false);
});
it('should go to the correct page when clicking on active process instances', async () => {
const {user} = render(<MetricPanel />, {
wrapper: createWrapper(),
});
await waitForElementToBeRemoved(() =>
screen.getByTestId('instances-bar-skeleton'),
);
expect(panelStatesStore.state.isFiltersCollapsed).toBe(true);
await user.click(screen.getByText('Active Process Instances'));
expect(screen.getByTestId('pathname')).toHaveTextContent(/^\/processes$/);
expect(screen.getByTestId('search')).toHaveTextContent(/^\?active=true$/);
expect(panelStatesStore.state.isFiltersCollapsed).toBe(false);
});
it('should go to the correct page when clicking on total instances', async () => {
const {user} = render(<MetricPanel />, {
wrapper: createWrapper(),
});
expect(panelStatesStore.state.isFiltersCollapsed).toBe(true);
await user.click(
await screen.findByText('1087 Running Process Instances in total'),
);
expect(screen.getByTestId('pathname')).toHaveTextContent(/^\/processes$/);
expect(screen.getByTestId('search')).toHaveTextContent(
/^\?incidents=true&active=true$/,
);
expect(panelStatesStore.state.isFiltersCollapsed).toBe(false);
});
it('should handle server errors', async () => {
mockFetchProcessCoreStatistics().withServerError();
render(<MetricPanel />, {
wrapper: createWrapper(),
});
expect(
await screen.findByText('Process statistics could not be fetched'),
).toBeInTheDocument();
});
it('should handle networks errors', async () => {
const consoleErrorMock = jest
.spyOn(global.console, 'error')
.mockImplementation();
mockFetchProcessCoreStatistics().withNetworkError();
render(<MetricPanel />, {
wrapper: createWrapper(),
});
expect(
await screen.findByText('Process statistics could not be fetched'),
).toBeInTheDocument();
consoleErrorMock.mockRestore();
});
});
``` | /content/code_sandbox/operate/client/src/App/Dashboard/MetricPanel/index.test.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 1,070 |
```xml
<vector android:height="24dp"
android:tint="@android:color/white" android:viewportHeight="24"
android:viewportWidth="24" android:width="24dp" xmlns:android="path_to_url">
<path android:fillColor="@android:color/white" android:pathData="M3,18h6v-2L3,16v2zM3,6v2h18L21,6L3,6zM3,13h12v-2L3,11v2z"/>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable-night/ic_sort_24dp.xml | xml | 2016-02-01T23:48:36 | 2024-08-15T03:35:42 | TagMo | HiddenRamblings/TagMo | 2,976 | 119 |
```xml
<ReadResponse xmlns="path_to_url">
<ResponseHeader>
<Timestamp>2024-05-03T13:00:39.3472074Z</Timestamp>
<RequestHandle>42</RequestHandle>
<ServiceResult>
<Code>0</Code>
</ServiceResult>
<ServiceDiagnostics>
<SymbolicId>-1</SymbolicId>
<NamespaceUri>-1</NamespaceUri>
<Locale>-1</Locale>
<LocalizedText>-1</LocalizedText>
<AdditionalInfo>NodeId not found</AdditionalInfo>
<InnerStatusCode>
<Code>2153644032</Code>
</InnerStatusCode>
<InnerDiagnosticInfo>
<SymbolicId>-1</SymbolicId>
<NamespaceUri>-1</NamespaceUri>
<Locale>-1</Locale>
<LocalizedText>-1</LocalizedText>
<AdditionalInfo>Hello World</AdditionalInfo>
<InnerStatusCode>
<Code>2150891520</Code>
</InnerStatusCode>
<InnerDiagnosticInfo>
<SymbolicId>-1</SymbolicId>
<NamespaceUri>-1</NamespaceUri>
<Locale>-1</Locale>
<LocalizedText>-1</LocalizedText>
<AdditionalInfo>Hello World</AdditionalInfo>
<InnerStatusCode>
<Code>2150891520</Code>
</InnerStatusCode>
<InnerDiagnosticInfo>
<SymbolicId>-1</SymbolicId>
<NamespaceUri>-1</NamespaceUri>
<Locale>-1</Locale>
<LocalizedText>-1</LocalizedText>
<AdditionalInfo>Hello World</AdditionalInfo>
<InnerStatusCode>
<Code>2150891520</Code>
</InnerStatusCode>
</InnerDiagnosticInfo>
</InnerDiagnosticInfo>
</InnerDiagnosticInfo>
</ServiceDiagnostics>
<StringTable />
</ResponseHeader>
<Results>
<DataValue>
<Value>
<Value>
<String>Hello World</String>
</Value>
</Value>
<StatusCode>
<Code>0</Code>
</StatusCode>
<SourceTimestamp>2024-05-03T13:01:39.3471774Z</SourceTimestamp>
<SourcePicoseconds>10</SourcePicoseconds>
<ServerTimestamp>2024-05-03T13:00:39.3471774Z</ServerTimestamp>
<ServerPicoseconds>100</ServerPicoseconds>
</DataValue>
<DataValue>
<Value>
<Value>
<UInt32>12345678</UInt32>
</Value>
</Value>
<StatusCode>
<Code>2157772800</Code>
</StatusCode>
<SourceTimestamp>2024-05-03T13:01:39.3471774Z</SourceTimestamp>
<SourcePicoseconds>0</SourcePicoseconds>
<ServerTimestamp>2024-05-03T13:00:39.3471774Z</ServerTimestamp>
<ServerPicoseconds>0</ServerPicoseconds>
</DataValue>
<DataValue>
<Value>
<Value>
<ByteString>AAECAwQFBg==</ByteString>
</Value>
</Value>
<StatusCode>
<Code>0</Code>
</StatusCode>
<SourceTimestamp>2024-05-03T13:01:39.3471774Z</SourceTimestamp>
<SourcePicoseconds>0</SourcePicoseconds>
<ServerTimestamp>2024-05-03T13:00:39.3471774Z</ServerTimestamp>
<ServerPicoseconds>0</ServerPicoseconds>
</DataValue>
<DataValue>
<Value>
<Value>
<Byte>42</Byte>
</Value>
</Value>
<StatusCode>
<Code>0</Code>
</StatusCode>
<SourceTimestamp>2024-05-03T13:00:39.3471774Z</SourceTimestamp>
<SourcePicoseconds>0</SourcePicoseconds>
<ServerTimestamp>0001-01-01T00:00:00</ServerTimestamp>
<ServerPicoseconds>0</ServerPicoseconds>
</DataValue>
</Results>
<DiagnosticInfos>
<DiagnosticInfo>
<SymbolicId>-1</SymbolicId>
<NamespaceUri>-1</NamespaceUri>
<Locale>-1</Locale>
<LocalizedText>-1</LocalizedText>
<AdditionalInfo>Hello World</AdditionalInfo>
<InnerStatusCode>
<Code>2148925440</Code>
</InnerStatusCode>
<InnerDiagnosticInfo>
<SymbolicId>-1</SymbolicId>
<NamespaceUri>-1</NamespaceUri>
<Locale>-1</Locale>
<LocalizedText>-1</LocalizedText>
<AdditionalInfo>Hello World</AdditionalInfo>
<InnerStatusCode>
<Code>2150891520</Code>
</InnerStatusCode>
</InnerDiagnosticInfo>
</DiagnosticInfo>
</DiagnosticInfos>
</ReadResponse>
``` | /content/code_sandbox/Fuzzing/Encoders/Fuzz/Testcases.Xml/readresponse.xml | xml | 2016-02-12T14:57:06 | 2024-08-13T10:24:27 | UA-.NETStandard | OPCFoundation/UA-.NETStandard | 1,910 | 1,112 |
```xml
import { readFile } from 'node:fs/promises';
export async function readTemplate(filename: string) {
return readFile(filename, {
encoding: 'utf8',
});
}
``` | /content/code_sandbox/code/core/src/common/utils/readTemplate.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 39 |
```xml
<resources>
<string name="app_name">Kotlin DSL Android Studio Sample</string>
</resources>
``` | /content/code_sandbox/samples/hello-android/app/src/main/res/values/strings.xml | xml | 2016-04-27T22:16:07 | 2024-08-15T06:01:37 | kotlin-dsl-samples | gradle/kotlin-dsl-samples | 3,709 | 24 |
```xml
import * as React from 'react';
import type { RegisterPortalFn } from './types';
const PortalCompatContext = React.createContext<RegisterPortalFn | undefined>(
undefined,
) as React.Context<RegisterPortalFn>;
const portalCompatContextDefaultValue = () => () => undefined;
export const PortalCompatContextProvider = PortalCompatContext.Provider;
export function usePortalCompat() {
return React.useContext(PortalCompatContext) ?? portalCompatContextDefaultValue;
}
``` | /content/code_sandbox/packages/react-components/react-portal-compat-context/src/PortalCompatContext.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 95 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definition"
xmlns="path_to_url"
xmlns:flowable="path_to_url"
targetNamespace="Examples">
<process id="parallelMultiInstanceSubProcess">
<startEvent id="theStart"/>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="beforeMultiInstance"/>
<userTask id="beforeMultiInstance"/>
<sequenceFlow sourceRef="beforeMultiInstance" targetRef="callActivity"/>
<callActivity id="callActivity" calledElement="oneTaskProcess">
<multiInstanceLoopCharacteristics isSequential="false" flowable:collection="myCollection" flowable:elementVariable="myElement" />
</callActivity>
<sequenceFlow id="flow2" sourceRef="callActivity" targetRef="afterMultiInstance"/>
<userTask id="afterMultiInstance"/>
<sequenceFlow id="flow3" sourceRef="afterMultiInstance" targetRef="theEnd"/>
<endEvent id="theEnd"/>
</process>
</definitions>
``` | /content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/api/runtime/migration/parallel-multi-instance-callactivity-local-variable.bpmn20.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 234 |
```xml
/**
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type {ReactProps} from './utils';
import type {ReactNode} from 'react';
import * as stylex from '@stylexjs/stylex';
const styles = stylex.create({
badge: {
display: 'inline-flex',
alignItems: 'center',
boxSizing: 'border-box',
backgroundColor: 'var(--badge-background)',
border: '1px solid var(--button-border)',
borderRadius: '11px',
color: 'var(--badge-foreground)',
padding: '3px 6px',
fontFamily: 'var(--font-family)',
fontSize: '11px',
minHeight: '18px',
minWidth: '18px',
lineHeight: '16px',
height: '16px',
textOverflow: 'ellipsis',
maxWidth: '150px',
whiteSpace: 'nowrap',
overflow: 'hidden',
},
});
export function Badge({
xstyle,
...rest
}: {children: ReactNode; xstyle?: stylex.StyleXStyles} & ReactProps<HTMLSpanElement>) {
return <span {...stylex.props(styles.badge, xstyle)} {...rest} />;
}
``` | /content/code_sandbox/addons/components/Badge.tsx | xml | 2016-05-05T16:53:47 | 2024-08-16T19:12:02 | sapling | facebook/sapling | 5,987 | 274 |
```xml
import _ from 'lodash';
import { describe, expect, test } from 'vitest';
import { parseConfigFile } from '../src';
import { PACKAGE_ACCESS, normalisePackageAccess, normalizeUserList } from '../src/package-access';
import { parseConfigurationFile } from './utils';
describe('Package access utilities', () => {
describe('normalisePackageAccess', () => {
test('should test basic conversion', () => {
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-basic'));
const access = normalisePackageAccess(packages);
expect(access).toBeDefined();
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
const all = access[`${PACKAGE_ACCESS.ALL}`];
expect(scoped).toBeDefined();
expect(all).toBeDefined();
});
test('should define an empty publish array even if is not defined in packages', () => {
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-basic-no-publish'));
const access = normalisePackageAccess(packages);
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
const all = access[`${PACKAGE_ACCESS.ALL}`];
// publish must defined
expect(scoped.publish).toBeDefined();
expect(scoped.publish).toHaveLength(0);
expect(all.publish).toBeDefined();
expect(all.publish).toHaveLength(0);
});
test('should define an empty access array even if is not defined in packages', () => {
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-basic-no-access'));
const access = normalisePackageAccess(packages);
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
const all = access[`${PACKAGE_ACCESS.ALL}`];
// publish must defined
expect(scoped.access).toBeDefined();
expect(scoped.access).toHaveLength(0);
expect(all.access).toBeDefined();
expect(all.access).toHaveLength(0);
});
test('should define an empty proxy array even if is not defined in package', () => {
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-basic-no-proxy'));
const access = normalisePackageAccess(packages);
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
const all = access[`${PACKAGE_ACCESS.ALL}`];
// publish must defined
expect(scoped.proxy).toBeDefined();
expect(scoped.proxy).toHaveLength(0);
expect(all.proxy).toBeDefined();
expect(all.proxy).toHaveLength(0);
});
test('should test multi user group definition', () => {
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-multi-group'));
const access = normalisePackageAccess(packages);
expect(access).toBeDefined();
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
const all = access[`${PACKAGE_ACCESS.ALL}`];
expect(scoped).toBeDefined();
expect(scoped.access).toContain('$all');
expect(scoped.publish).toHaveLength(2);
expect(scoped.publish).toContain('admin');
expect(scoped.publish).toContain('superadmin');
expect(all).toBeDefined();
expect(all.access).toHaveLength(3);
expect(all.access).toContain('$all');
expect(all.publish).toHaveLength(1);
expect(all.publish).toContain('admin');
});
test(
'should normalize deprecated packages into the new ones ' + '(backward props compatible)',
() => {
const { packages } = parseConfigFile(parseConfigurationFile('deprecated-pkgs-basic'));
const access = normalisePackageAccess(packages);
expect(access).toBeDefined();
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
const all = access[`${PACKAGE_ACCESS.ALL}`];
const react = access['react-*'];
expect(react).toBeDefined();
expect(react.access).toBeDefined();
expect(react.access).toEqual([]);
expect(react.publish[0]).toBe('admin');
expect(react.proxy).toBeDefined();
expect(react.proxy).toEqual([]);
expect(react.storage).toBeDefined();
expect(react.storage).toBe('react-storage');
expect(scoped).toBeDefined();
expect(scoped.storage).not.toBeDefined();
expect(all).toBeDefined();
expect(all.access).toBeDefined();
expect(all.storage).not.toBeDefined();
expect(all.publish).toBeDefined();
expect(all.proxy).toBeDefined();
}
);
test('should check not default packages access', () => {
const { packages } = parseConfigFile(parseConfigurationFile('pkgs-empty'));
const access = normalisePackageAccess(packages);
expect(access).toBeDefined();
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
expect(scoped).toBeUndefined();
// ** should be added by default **
const all = access[`${PACKAGE_ACCESS.ALL}`];
expect(all).toBeDefined();
expect(all.access).toBeDefined();
expect(_.isArray(all.access)).toBeTruthy();
expect(all.publish).toBeDefined();
expect(_.isArray(all.publish)).toBeTruthy();
});
});
describe('normaliseUserList', () => {
test('should normalize user list', () => {
const groupsList = 'admin superadmin';
const result = normalizeUserList(groupsList);
expect(result).toEqual(['admin', 'superadmin']);
});
test('should normalize empty user list', () => {
const groupsList = '';
const result = normalizeUserList(groupsList);
expect(result).toEqual([]);
});
test('should normalize user list array', () => {
const groupsList = ['admin', 'superadmin'];
const result = normalizeUserList(groupsList);
expect(result).toEqual(['admin', 'superadmin']);
});
test('should throw error for invalid user list', () => {
const groupsList = { group: 'admin' };
expect(() => {
normalizeUserList(groupsList);
}).toThrow('CONFIG: bad package acl (array or string expected): {"group":"admin"}');
});
});
});
``` | /content/code_sandbox/packages/config/test/package-access.spec.ts | xml | 2016-04-15T16:21:12 | 2024-08-16T09:38:01 | verdaccio | verdaccio/verdaccio | 16,189 | 1,237 |
```xml
import { Component } from '@angular/core';
@Component({
selector: 'style-doc',
template: `
<app-docsectiontext>
<p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming</a> page.</p>
</app-docsectiontext>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Element</th>
</tr>
</thead>
<tbody>
<tr>
<td>p-splitter</td>
<td>Container element.</td>
</tr>
<tr>
<td>p-splitter</td>
<td>Container element during resize.</td>
</tr>
<tr>
<td>p-splitter-horizontal</td>
<td>Container element with horizontal layout.</td>
</tr>
<tr>
<td>p-splitter-vertical</td>
<td>Container element with vertical layout.</td>
</tr>
<tr>
<td>p-splitter-panel</td>
<td>Splitter panel element.</td>
</tr>
<tr>
<td>p-splitter-gutter</td>
<td>Gutter element to use when resizing the panels.</td>
</tr>
<tr>
<td>p-splitter-gutter-handle</td>
<td>Handl element of the gutter.</td>
</tr>
</tbody>
</table>
</div>
`
})
export class StyleDoc {}
``` | /content/code_sandbox/src/app/showcase/doc/splitter/styledoc.ts | xml | 2016-01-16T09:23:28 | 2024-08-16T19:58:20 | primeng | primefaces/primeng | 9,969 | 360 |
```xml
import * as _ from 'lodash';
import * as React from 'react';
import { ComponentPerfStats, Telemetry } from '@fluentui/react-bindings';
export type TelemetryDataItem = ComponentPerfStats & {
componentName: string;
msAvg: number;
msStylesTotal: number;
};
export type TelemetryDataTotals = Omit<TelemetryDataItem, 'componentName'>;
export function useTelemetryData(
telemetry: Telemetry,
tick: number,
): { data: TelemetryDataItem[]; totals: TelemetryDataTotals } {
const data = React.useMemo(
() =>
_.map(
telemetry.performance,
(values: ComponentPerfStats, componentName: string): TelemetryDataItem => ({
componentName,
...values,
msAvg: values.msTotal / values.renders,
msStylesTotal: values.msResolveVariablesTotal + values.msResolveStylesTotal + values.msRenderStylesTotal,
}),
),
// `tick` is required as a dependency to trigger table's upgrade
// eslint-disable-next-line react-hooks/exhaustive-deps
[tick, telemetry.performance],
);
const totals = data.reduce<TelemetryDataTotals>(
(acc, item) => ({
instances: acc.instances + item.instances,
renders: acc.renders + item.renders,
msTotal: acc.msTotal + item.msTotal,
msMin: acc.msMin + item.msMin,
msMax: acc.msTotal + item.msMax,
msAvg: (acc.msTotal + item.msTotal) / (acc.renders + item.renders),
msStylesTotal: acc.msStylesTotal + item.msStylesTotal,
msResolveVariablesTotal: acc.msResolveVariablesTotal + item.msResolveVariablesTotal,
msResolveStylesTotal: acc.msResolveStylesTotal + item.msResolveStylesTotal,
msRenderStylesTotal: acc.msRenderStylesTotal + item.msRenderStylesTotal,
stylesRootCacheHits: acc.stylesRootCacheHits + item.stylesRootCacheHits,
stylesSlotsCacheHits: acc.stylesSlotsCacheHits + item.stylesSlotsCacheHits,
}),
{
instances: 0,
renders: 0,
msTotal: 0,
msMin: 0,
msMax: 0,
msAvg: 0,
msStylesTotal: 0,
msResolveVariablesTotal: 0,
msResolveStylesTotal: 0,
msRenderStylesTotal: 0,
stylesRootCacheHits: 0,
stylesSlotsCacheHits: 0,
},
);
return { data, totals };
}
``` | /content/code_sandbox/packages/fluentui/react-telemetry/src/useTelemetryData.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 568 |
```xml
<?xml version="1.0"?>
<opencv_storage>
<!-- Automatically converted from haarcascade2, window size = 64x16 -->
<haarcascade_pltzzz64x16_16STG type_id="opencv-haar-classifier">
<size>
64 16</size>
<stages>
<_>
<!-- stage 0 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
32 2 8 6 -1.</_>
<_>
32 4 8 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.6915600746870041e-002</threshold>
<left_val>-9.5547717809677124e-001</left_val>
<right_val>8.9129137992858887e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 4 6 10 -1.</_>
<_>
3 4 3 10 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.4228349328041077e-002</threshold>
<left_val>-9.2089319229125977e-001</left_val>
<right_val>8.8723921775817871e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
55 0 8 6 -1.</_>
<_>
55 0 4 3 2.</_>
<_>
59 3 4 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.0168660432100296e-002</threshold>
<left_val>8.8940089941024780e-001</left_val>
<right_val>-7.7847331762313843e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
44 7 4 9 -1.</_>
<_>
44 10 4 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.0863260142505169e-003</threshold>
<left_val>-8.7998157739639282e-001</left_val>
<right_val>5.8651781082153320e-001</right_val></_></_></trees>
<stage_threshold>-2.0683259963989258e+000</stage_threshold>
<parent>-1</parent>
<next>-1</next></_>
<_>
<!-- stage 1 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
29 1 16 4 -1.</_>
<_>
29 3 16 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.9062159359455109e-002</threshold>
<left_val>-8.7765061855316162e-001</left_val>
<right_val>8.5373121500015259e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 5 9 8 -1.</_>
<_>
3 5 3 8 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.3903399705886841e-002</threshold>
<left_val>-9.2079448699951172e-001</left_val>
<right_val>7.5155001878738403e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
44 0 20 14 -1.</_>
<_>
44 0 10 7 2.</_>
<_>
54 7 10 7 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-3.5404648631811142e-002</threshold>
<left_val>6.7834627628326416e-001</left_val>
<right_val>-9.0937072038650513e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
41 7 6 9 -1.</_>
<_>
43 7 2 9 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>6.2988721765577793e-003</threshold>
<left_val>-8.1054258346557617e-001</left_val>
<right_val>5.8985030651092529e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 4 21 4 -1.</_>
<_>
7 4 7 4 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>3.4959490876644850e-003</threshold>
<left_val>-9.7632282972335815e-001</left_val>
<right_val>4.5473039150238037e-001</right_val></_></_></trees>
<stage_threshold>-1.6632349491119385e+000</stage_threshold>
<parent>0</parent>
<next>-1</next></_>
<_>
<!-- stage 2 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
31 2 11 6 -1.</_>
<_>
31 4 11 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.3864099755883217e-002</threshold>
<left_val>-9.3137168884277344e-001</left_val>
<right_val>8.2478952407836914e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
56 3 6 11 -1.</_>
<_>
59 3 3 11 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.5775209069252014e-002</threshold>
<left_val>8.5526448488235474e-001</left_val>
<right_val>-8.7574672698974609e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
32 14 32 2 -1.</_>
<_>
32 15 32 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.0646049864590168e-002</threshold>
<left_val>8.5167151689529419e-001</left_val>
<right_val>-6.7789041996002197e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 2 8 14 -1.</_>
<_>
4 2 4 14 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.7000989764928818e-002</threshold>
<left_val>-8.0041092634201050e-001</left_val>
<right_val>6.4893317222595215e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
19 0 22 6 -1.</_>
<_>
19 0 11 3 2.</_>
<_>
30 3 11 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>5.2989721298217773e-003</threshold>
<left_val>-9.5342522859573364e-001</left_val>
<right_val>5.0140267610549927e-001</right_val></_></_></trees>
<stage_threshold>-1.3346730470657349e+000</stage_threshold>
<parent>1</parent>
<next>-1</next></_>
<_>
<!-- stage 3 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
56 0 6 6 -1.</_>
<_>
56 0 3 3 2.</_>
<_>
59 3 3 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-6.9233630783855915e-003</threshold>
<left_val>8.2654470205307007e-001</left_val>
<right_val>-8.5396027565002441e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
32 0 14 12 -1.</_>
<_>
32 0 7 6 2.</_>
<_>
39 6 7 6 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.2539249658584595e-001</threshold>
<left_val>-1.2996139936149120e-002</left_val>
<right_val>-3.2377028808593750e+003</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
2 1 43 4 -1.</_>
<_>
2 3 43 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>6.3474893569946289e-002</threshold>
<left_val>-6.4648061990737915e-001</left_val>
<right_val>8.2302427291870117e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
34 10 30 5 -1.</_>
<_>
44 10 10 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>4.2217150330543518e-002</threshold>
<left_val>-7.5190877914428711e-001</left_val>
<right_val>6.3705182075500488e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 9 9 5 -1.</_>
<_>
3 9 3 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.0000640302896500e-002</threshold>
<left_val>-6.2077498435974121e-001</left_val>
<right_val>6.1317932605743408e-001</right_val></_></_></trees>
<stage_threshold>-1.6521669626235962e+000</stage_threshold>
<parent>2</parent>
<next>-1</next></_>
<_>
<!-- stage 4 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
2 1 43 6 -1.</_>
<_>
2 3 43 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>9.2297486960887909e-002</threshold>
<left_val>-7.2764229774475098e-001</left_val>
<right_val>8.0554759502410889e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
53 4 9 8 -1.</_>
<_>
56 4 3 8 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.7613969519734383e-002</threshold>
<left_val>-7.0769268274307251e-001</left_val>
<right_val>7.3315787315368652e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
36 4 14 8 -1.</_>
<_>
36 4 7 4 2.</_>
<_>
43 8 7 4 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.2465449981391430e-002</threshold>
<left_val>-8.4359270334243774e-001</left_val>
<right_val>5.7046437263488770e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
14 14 49 2 -1.</_>
<_>
14 15 49 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.3886829614639282e-002</threshold>
<left_val>8.2656508684158325e-001</left_val>
<right_val>-5.2783298492431641e-001</right_val></_></_></trees>
<stage_threshold>-1.4523630142211914e+000</stage_threshold>
<parent>3</parent>
<next>-1</next></_>
<_>
<!-- stage 5 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 5 4 9 -1.</_>
<_>
2 5 2 9 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.8821349367499352e-002</threshold>
<left_val>-8.1122857332229614e-001</left_val>
<right_val>6.9127470254898071e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
21 1 38 4 -1.</_>
<_>
21 3 38 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>6.1703320592641830e-002</threshold>
<left_val>-7.6482647657394409e-001</left_val>
<right_val>6.4212161302566528e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
44 12 18 3 -1.</_>
<_>
53 12 9 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.6298670321702957e-002</threshold>
<left_val>5.0207728147506714e-001</left_val>
<right_val>-8.4020161628723145e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
10 4 9 3 -1.</_>
<_>
13 4 3 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-4.9458951689302921e-003</threshold>
<left_val>6.1991941928863525e-001</left_val>
<right_val>-6.1633539199829102e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
40 4 10 4 -1.</_>
<_>
45 4 5 4 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-5.1894597709178925e-003</threshold>
<left_val>4.4975179433822632e-001</left_val>
<right_val>-8.0651968717575073e-001</right_val></_></_>
<_>
<!-- tree 5 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
17 14 47 2 -1.</_>
<_>
17 15 47 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.8824130296707153e-002</threshold>
<left_val>6.1992841958999634e-001</left_val>
<right_val>-5.5643159151077271e-001</right_val></_></_>
<_>
<!-- tree 6 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
8 5 4 7 -1.</_>
<_>
10 5 2 7 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>5.6571601890027523e-003</threshold>
<left_val>-4.8346561193466187e-001</left_val>
<right_val>6.8647360801696777e-001</right_val></_></_></trees>
<stage_threshold>-2.2358059883117676e+000</stage_threshold>
<parent>4</parent>
<next>-1</next></_>
<_>
<!-- stage 6 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
56 0 6 6 -1.</_>
<_>
56 0 3 3 2.</_>
<_>
59 3 3 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-9.1503243893384933e-003</threshold>
<left_val>6.8174481391906738e-001</left_val>
<right_val>-7.7866071462631226e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 0 6 6 -1.</_>
<_>
0 0 3 3 2.</_>
<_>
3 3 3 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>7.4933180585503578e-003</threshold>
<left_val>-6.8696027994155884e-001</left_val>
<right_val>6.6913938522338867e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
13 4 48 2 -1.</_>
<_>
29 4 16 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>4.5296419411897659e-002</threshold>
<left_val>-7.3576509952545166e-001</left_val>
<right_val>5.9453499317169189e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
42 1 6 15 -1.</_>
<_>
42 6 6 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.1669679544866085e-002</threshold>
<left_val>-8.4733831882476807e-001</left_val>
<right_val>4.5461329817771912e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
30 8 3 5 -1.</_>
<_>
31 8 1 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.5769430212676525e-003</threshold>
<left_val>-5.8270388841629028e-001</left_val>
<right_val>7.7900522947311401e-001</right_val></_></_>
<_>
<!-- tree 5 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
55 10 8 6 -1.</_>
<_>
55 13 8 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.4139170525595546e-003</threshold>
<left_val>4.5126929879188538e-001</left_val>
<right_val>-9.0696328878402710e-001</right_val></_></_></trees>
<stage_threshold>-1.8782069683074951e+000</stage_threshold>
<parent>5</parent>
<next>-1</next></_>
<_>
<!-- stage 7 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
4 6 4 7 -1.</_>
<_>
6 6 2 7 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-5.3149578161537647e-003</threshold>
<left_val>6.5218788385391235e-001</left_val>
<right_val>-7.9464268684387207e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
56 3 6 8 -1.</_>
<_>
59 3 3 8 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.2906960919499397e-002</threshold>
<left_val>6.6433382034301758e-001</left_val>
<right_val>-7.3633247613906860e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
37 2 4 6 -1.</_>
<_>
37 4 4 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>9.4887977465987206e-003</threshold>
<left_val>-8.2612031698226929e-001</left_val>
<right_val>4.9333500862121582e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 10 30 6 -1.</_>
<_>
0 12 30 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>4.5138411223888397e-002</threshold>
<left_val>-5.4704028367996216e-001</left_val>
<right_val>7.6927912235260010e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 4 21 12 -1.</_>
<_>
7 4 7 12 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.5049019604921341e-002</threshold>
<left_val>-8.6739641427993774e-001</left_val>
<right_val>5.2807968854904175e-001</right_val></_></_></trees>
<stage_threshold>-1.0597369670867920e+000</stage_threshold>
<parent>6</parent>
<next>-1</next></_>
<_>
<!-- stage 8 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
44 0 1 14 -1.</_>
<_>
44 7 1 7 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>6.6414438188076019e-003</threshold>
<left_val>-7.7290147542953491e-001</left_val>
<right_val>6.9723731279373169e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
54 3 4 3 -1.</_>
<_>
56 3 2 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.4703629314899445e-003</threshold>
<left_val>-7.4289917945861816e-001</left_val>
<right_val>6.6825848817825317e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
32 0 30 6 -1.</_>
<_>
32 0 15 3 2.</_>
<_>
47 3 15 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.2910499945282936e-002</threshold>
<left_val>4.3986389040946960e-001</left_val>
<right_val>-9.0588808059692383e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 8 9 7 -1.</_>
<_>
3 8 3 7 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>3.4193221479654312e-002</threshold>
<left_val>-6.9507479667663574e-001</left_val>
<right_val>6.2501090764999390e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
30 10 3 3 -1.</_>
<_>
31 10 1 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.5060020377859473e-003</threshold>
<left_val>-6.8670761585235596e-001</left_val>
<right_val>8.2241541147232056e-001</right_val></_></_>
<_>
<!-- tree 5 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
21 3 24 4 -1.</_>
<_>
29 3 8 4 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.9838380467263050e-005</threshold>
<left_val>-9.2727631330490112e-001</left_val>
<right_val>6.4723730087280273e-001</right_val></_></_>
<_>
<!-- tree 6 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
42 3 12 6 -1.</_>
<_>
46 3 4 6 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.2170299416757189e-005</threshold>
<left_val>5.6555831432342529e-001</left_val>
<right_val>-9.6788132190704346e-001</right_val></_></_></trees>
<stage_threshold>-1.4993519783020020e+000</stage_threshold>
<parent>7</parent>
<next>-1</next></_>
<_>
<!-- stage 9 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
56 9 6 6 -1.</_>
<_>
59 9 3 6 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.1395259760320187e-002</threshold>
<left_val>7.1383631229400635e-001</left_val>
<right_val>-8.7429678440093994e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
6 4 1 6 -1.</_>
<_>
6 7 1 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.1864590235054493e-003</threshold>
<left_val>8.5311782360076904e-001</left_val>
<right_val>-6.4777731895446777e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 0 12 4 -1.</_>
<_>
0 0 6 2 2.</_>
<_>
6 2 6 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.3193720262497663e-003</threshold>
<left_val>-7.6411879062652588e-001</left_val>
<right_val>7.1867972612380981e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
43 12 18 2 -1.</_>
<_>
52 12 9 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-7.9916073009371758e-003</threshold>
<left_val>6.6442942619323730e-001</left_val>
<right_val>-7.9540950059890747e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
9 5 2 8 -1.</_>
<_>
10 5 1 8 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.4212740352377295e-003</threshold>
<left_val>-6.3904231786727905e-001</left_val>
<right_val>7.5050598382949829e-001</right_val></_></_></trees>
<stage_threshold>-8.4829801321029663e-001</stage_threshold>
<parent>8</parent>
<next>-1</next></_>
<_>
<!-- stage 10 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
1 9 6 3 -1.</_>
<_>
3 9 2 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>6.4091659151017666e-003</threshold>
<left_val>-8.8425230979919434e-001</left_val>
<right_val>9.9953681230545044e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
56 8 2 8 -1.</_>
<_>
56 12 2 4 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-6.3316390151157975e-004</threshold>
<left_val>8.3822172880172729e-001</left_val>
<right_val>-9.8322170972824097e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
24 2 6 13 -1.</_>
<_>
26 2 2 13 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-6.4947169448714703e-005</threshold>
<left_val>1.</left_val>
<right_val>-9.1822808980941772e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
33 7 24 4 -1.</_>
<_>
41 7 8 4 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>5.3404141217470169e-003</threshold>
<left_val>-9.4317251443862915e-001</left_val>
<right_val>9.0425151586532593e-001</right_val></_></_></trees>
<stage_threshold>-6.0007210820913315e-002</stage_threshold>
<parent>9</parent>
<next>-1</next></_>
<_>
<!-- stage 11 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
1 1 57 4 -1.</_>
<_>
1 3 57 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.0755469650030136e-001</threshold>
<left_val>-7.1647202968597412e-001</left_val>
<right_val>8.7827038764953613e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 2 6 14 -1.</_>
<_>
3 2 3 14 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>3.1668949872255325e-002</threshold>
<left_val>-8.7051069736480713e-001</left_val>
<right_val>5.8807212114334106e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
52 3 6 10 -1.</_>
<_>
54 3 2 10 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-1.0572380386292934e-002</threshold>
<left_val>6.2438100576400757e-001</left_val>
<right_val>-7.4027371406555176e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
1 14 61 2 -1.</_>
<_>
1 15 61 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.7396259829401970e-002</threshold>
<left_val>8.9776748418807983e-001</left_val>
<right_val>-5.2986758947372437e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
28 0 11 12 -1.</_>
<_>
28 4 11 4 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.5918649509549141e-002</threshold>
<left_val>-8.6482518911361694e-001</left_val>
<right_val>5.3121817111968994e-001</right_val></_></_></trees>
<stage_threshold>-9.6125108003616333e-001</stage_threshold>
<parent>10</parent>
<next>-1</next></_>
<_>
<!-- stage 12 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
22 1 41 4 -1.</_>
<_>
22 3 41 2 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>7.1039132773876190e-002</threshold>
<left_val>-7.5719678401947021e-001</left_val>
<right_val>7.5645631551742554e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
41 6 6 8 -1.</_>
<_>
43 6 2 8 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>7.6241148635745049e-003</threshold>
<left_val>-7.9783838987350464e-001</left_val>
<right_val>7.1733069419860840e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
50 9 14 5 -1.</_>
<_>
57 9 7 5 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.7092639356851578e-002</threshold>
<left_val>6.0071170330047607e-001</left_val>
<right_val>-8.4794402122497559e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
4 1 12 5 -1.</_>
<_>
10 1 6 5 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-8.1267888890579343e-004</threshold>
<left_val>5.9364068508148193e-001</left_val>
<right_val>-8.9295238256454468e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
37 9 3 3 -1.</_>
<_>
38 9 1 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>8.3705072756856680e-004</threshold>
<left_val>-6.4887362718582153e-001</left_val>
<right_val>7.8537952899932861e-001</right_val></_></_></trees>
<stage_threshold>-1.0618970394134521e+000</stage_threshold>
<parent>11</parent>
<next>-1</next></_>
<_>
<!-- stage 13 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
54 0 10 6 -1.</_>
<_>
54 0 5 3 2.</_>
<_>
59 3 5 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-9.7556859254837036e-003</threshold>
<left_val>7.6982218027114868e-001</left_val>
<right_val>-8.5293501615524292e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
47 0 6 11 -1.</_>
<_>
49 0 2 11 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-8.6617246270179749e-003</threshold>
<left_val>8.4029090404510498e-001</left_val>
<right_val>-7.1949690580368042e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
19 2 20 2 -1.</_>
<_>
19 3 20 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.6897840425372124e-002</threshold>
<left_val>-5.3601992130279541e-001</left_val>
<right_val>9.5484441518783569e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
14 4 6 11 -1.</_>
<_>
17 4 3 11 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>4.7526158596156165e-005</threshold>
<left_val>-7.6412862539291382e-001</left_val>
<right_val>7.5398761034011841e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
31 9 33 2 -1.</_>
<_>
42 9 11 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>6.5607670694589615e-003</threshold>
<left_val>-9.9346441030502319e-001</left_val>
<right_val>6.4864277839660645e-001</right_val></_></_></trees>
<stage_threshold>-7.3307347297668457e-001</stage_threshold>
<parent>12</parent>
<next>-1</next></_>
<_>
<!-- stage 14 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
6 1 53 6 -1.</_>
<_>
6 3 53 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.0103269666433334e-001</threshold>
<left_val>-7.3275578022003174e-001</left_val>
<right_val>8.4619927406311035e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
49 9 4 6 -1.</_>
<_>
49 9 2 3 2.</_>
<_>
51 12 2 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.8920811018906534e-004</threshold>
<left_val>7.1564781665802002e-001</left_val>
<right_val>-8.8221758604049683e-001</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 9 30 7 -1.</_>
<_>
10 9 10 7 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.0838840156793594e-002</threshold>
<left_val>-8.7420248985290527e-001</left_val>
<right_val>6.0648679733276367e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
40 4 6 2 -1.</_>
<_>
42 4 2 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>5.0803890917450190e-004</threshold>
<left_val>-9.0554022789001465e-001</left_val>
<right_val>6.4213967323303223e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
1 9 6 1 -1.</_>
<_>
3 9 2 1 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.3357039317488670e-003</threshold>
<left_val>-9.2574918270111084e-001</left_val>
<right_val>8.6384928226470947e-001</right_val></_></_>
<_>
<!-- tree 5 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
47 3 4 10 -1.</_>
<_>
47 8 4 5 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>8.0239427916239947e-005</threshold>
<left_val>-9.9618428945541382e-001</left_val>
<right_val>9.5355111360549927e-001</right_val></_></_>
<_>
<!-- tree 6 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
31 5 30 11 -1.</_>
<_>
41 5 10 11 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>3.2030208967626095e-003</threshold>
<left_val>-1.</left_val>
<right_val>1.0001050233840942e+000</right_val></_></_>
<_>
<!-- tree 7 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 0 2 1 -1.</_>
<_>
1 0 1 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>0.</threshold>
<left_val>0.</left_val>
<right_val>-1.</right_val></_></_>
<_>
<!-- tree 8 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
21 3 42 5 -1.</_>
<_>
35 3 14 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.6143440045416355e-003</threshold>
<left_val>-1.</left_val>
<right_val>1.0002139806747437e+000</right_val></_></_>
<_>
<!-- tree 9 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 0 2 1 -1.</_>
<_>
1 0 1 1 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>0.</threshold>
<left_val>0.</left_val>
<right_val>-1.</right_val></_></_>
<_>
<!-- tree 10 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
8 5 30 9 -1.</_>
<_>
8 8 30 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-7.0475979009643197e-004</threshold>
<left_val>1.</left_val>
<right_val>-9.9976968765258789e-001</right_val></_></_>
<_>
<!-- tree 11 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
3 12 33 3 -1.</_>
<_>
14 12 11 3 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.1271279547363520e-003</threshold>
<left_val>-9.9694627523422241e-001</left_val>
<right_val>1.0002720355987549e+000</right_val></_></_>
<_>
<!-- tree 12 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 0 3 2 -1.</_>
<_>
1 0 1 2 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.4224430671893060e-004</threshold>
<left_val>1.</left_val>
<right_val>-1.</right_val></_></_>
<_>
<!-- tree 13 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
46 4 3 8 -1.</_>
<_>
47 4 1 8 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>7.4700301047414541e-004</threshold>
<left_val>-9.9108231067657471e-001</left_val>
<right_val>9.9941182136535645e-001</right_val></_></_></trees>
<stage_threshold>-1.0991690158843994e+000</stage_threshold>
<parent>13</parent>
<next>-1</next></_>
<_>
<!-- stage 15 -->
<trees>
<_>
<!-- tree 0 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
1 2 6 5 -1.</_>
<_>
3 2 2 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>1.7227890202775598e-003</threshold>
<left_val>-9.3608891963958740e-001</left_val>
<right_val>8.7251222133636475e-001</right_val></_></_>
<_>
<!-- tree 1 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
0 3 18 5 -1.</_>
<_>
6 3 6 5 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>2.7599320746958256e-003</threshold>
<left_val>-9.9757021665573120e-001</left_val>
<right_val>1.0000289678573608e+000</right_val></_></_>
<_>
<!-- tree 2 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
3 1 6 14 -1.</_>
<_>
6 1 3 14 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-8.9444358309265226e-005</threshold>
<left_val>1.</left_val>
<right_val>-9.9264812469482422e-001</right_val></_></_>
<_>
<!-- tree 3 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
3 6 2 10 -1.</_>
<_>
3 11 2 5 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.7962020249105990e-004</threshold>
<left_val>8.2833290100097656e-001</left_val>
<right_val>-9.8444151878356934e-001</right_val></_></_>
<_>
<!-- tree 4 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>
42 0 4 6 -1.</_>
<_>
42 0 2 3 2.</_>
<_>
44 3 2 3 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>-2.7560539820115082e-005</threshold>
<left_val>1.</left_val>
<right_val>-9.9543339014053345e-001</right_val></_></_></trees>
<stage_threshold>-9.1314977407455444e-001</stage_threshold>
<parent>14</parent>
<next>-1</next></_></stages></haarcascade_pltzzz64x16_16STG>
</opencv_storage>
``` | /content/code_sandbox/OpenCVLibrary320/src/main/res/raw/haarcascade_licence_plate_rus_16stages.xml | xml | 2016-09-09T07:50:18 | 2024-08-05T09:03:43 | OpenCVForAndroid | kongqw/OpenCVForAndroid | 2,046 | 13,882 |
```xml
import { JSONValue } from '@expo/json-file';
export type URLScheme = {
CFBundleURLName?: string;
CFBundleURLSchemes: string[];
};
export type InterfaceOrientation =
| 'UIInterfaceOrientationPortrait'
| 'UIInterfaceOrientationPortraitUpsideDown'
| 'UIInterfaceOrientationLandscapeLeft'
| 'UIInterfaceOrientationLandscapeRight';
export type InterfaceStyle = 'Light' | 'Dark' | 'Automatic';
export type InfoPlist = Record<string, JSONValue | undefined> & {
UIStatusBarHidden?: boolean;
UIStatusBarStyle?: string;
UILaunchStoryboardName?: string | 'SplashScreen';
CFBundleShortVersionString?: string;
CFBundleVersion?: string;
CFBundleDisplayName?: string;
CFBundleIdentifier?: string;
CFBundleName?: string;
CFBundleURLTypes?: URLScheme[];
CFBundleDevelopmentRegion?: string;
ITSAppUsesNonExemptEncryption?: boolean;
LSApplicationQueriesSchemes?: string[];
UIBackgroundModes?: string[];
UISupportedInterfaceOrientations?: InterfaceOrientation[];
GMSApiKey?: string;
GADApplicationIdentifier?: string;
UIUserInterfaceStyle?: InterfaceStyle;
UIRequiresFullScreen?: boolean;
SKAdNetworkItems?: { SKAdNetworkIdentifier: string }[];
branch_key?: { live?: string };
};
export type ExpoPlist = {
EXUpdatesCheckOnLaunch?: string;
EXUpdatesEnabled?: boolean;
EXUpdatesLaunchWaitMs?: number;
EXUpdatesRuntimeVersion?: string;
EXUpdatesRequestHeaders?: Record<string, string>;
/**
* @deprecated removed, but kept in types so that it can be mutated (deleted) from existing plists
*/
EXUpdatesSDKVersion?: string;
EXUpdatesURL?: string;
EXUpdatesCodeSigningCertificate?: string;
EXUpdatesCodeSigningMetadata?: Record<string, string>;
};
``` | /content/code_sandbox/packages/@expo/config-plugins/src/ios/IosConfig.types.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 399 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<animated-selector xmlns:android="path_to_url">
<item
android:id="@+id/checked"
android:drawable="@drawable/ic_module_filled_md2"
android:state_checked="true" />
<item
android:id="@+id/unchecked"
android:drawable="@drawable/ic_module_outlined_md2" />
<transition
android:drawable="@drawable/avd_module_from_filled"
android:fromId="@+id/checked"
android:toId="@+id/unchecked" />
<transition
android:drawable="@drawable/avd_module_to_filled"
android:fromId="@+id/unchecked"
android:toId="@id/checked" />
</animated-selector>
``` | /content/code_sandbox/app/apk/src/main/res/drawable/ic_module_md2.xml | xml | 2016-09-08T12:42:53 | 2024-08-16T19:41:25 | Magisk | topjohnwu/Magisk | 46,424 | 170 |
```xml
import { TNodeShape, TNodeType } from '@native-html/transient-render-engine';
export default function mergeCollapsedMargins<T extends TNodeType>(
collapsedMarginTop: number | null | undefined,
nativeStyle: ReturnType<TNodeShape<T>['getNativeStyles']>
): ReturnType<TNodeShape<T>['getNativeStyles']> {
if (typeof collapsedMarginTop !== 'number') {
return nativeStyle;
}
return {
...nativeStyle,
marginTop: collapsedMarginTop
};
}
``` | /content/code_sandbox/packages/render-html/src/helpers/mergeCollapsedMargins.ts | xml | 2016-11-29T10:50:53 | 2024-08-08T06:53:22 | react-native-render-html | meliorence/react-native-render-html | 3,445 | 107 |
```xml
export interface IRecentlyAddedMovies {
id: number;
title: string;
overview: string;
imdbId: string;
theMovieDbId: string;
releaseYear: string;
addedAt: Date;
quality: string;
// For UI only
posterPath: string;
}
export interface IRecentlyAddedTvShows extends IRecentlyAddedMovies {
seasonNumber: number;
episodeNumber: number;
tvDbId: number;
}
export interface IRecentlyAddedRangeModel {
from: Date;
to: Date;
}
export enum RecentlyAddedType {
Plex,
Emby,
Jellyfin,
}
``` | /content/code_sandbox/src/Ombi/ClientApp/src/app/interfaces/IRecentlyAdded.ts | xml | 2016-02-25T12:14:54 | 2024-08-14T22:56:44 | Ombi | Ombi-app/Ombi | 3,674 | 137 |
```xml
import { ICON_SIZES, DEFAULT_BASE_URL } from './initializeFileTypeIcons';
import { DEFAULT_ICON_SIZE } from './getFileTypeIconProps';
import type { FileTypeIconSize } from './getFileTypeIconProps';
import { getFileTypeIconAsUrl } from './getFileTypeIconAsUrl';
// Currently this test file only covers the default device pixel ratio, i.e 1
const getExpectedUrl = (iconSize: FileTypeIconSize, suffix: string, expectedExt: string) => {
return `${DEFAULT_BASE_URL}${iconSize}/${expectedExt}.${suffix}`;
};
// Test suite 1
describe('returns expected urls', () => {
it('returns the correct url for all valid icon sizes with default as svg', () => {
ICON_SIZES.forEach((iconSize: number) => {
const res = getFileTypeIconAsUrl({
size: iconSize as FileTypeIconSize,
extension: 'doc',
});
expect(res).toEqual(getExpectedUrl(iconSize as FileTypeIconSize, 'svg', 'docx'));
});
ICON_SIZES.forEach((iconSize: number) => {
const res = getFileTypeIconAsUrl({
size: iconSize as FileTypeIconSize,
extension: 'accdb',
});
expect(res).toEqual(getExpectedUrl(iconSize as FileTypeIconSize, 'svg', 'accdb'));
});
});
it('returns the correct url for all valid icon sizes with type as png', () => {
ICON_SIZES.forEach((iconSize: number) => {
const res = getFileTypeIconAsUrl({
size: iconSize as FileTypeIconSize,
extension: 'doc',
imageFileType: 'png',
});
expect(res).toEqual(getExpectedUrl(iconSize as FileTypeIconSize, 'png', 'docx'));
});
ICON_SIZES.forEach((iconSize: number) => {
const res = getFileTypeIconAsUrl({
size: iconSize as FileTypeIconSize,
extension: 'accdb',
imageFileType: 'png',
});
expect(res).toEqual(getExpectedUrl(iconSize as FileTypeIconSize, 'png', 'accdb'));
});
});
});
// Test suite 2
describe('Returns genericfile for invalid inputs', () => {
it('returns genericfile for invalid extension with default type as svg', () => {
ICON_SIZES.forEach((iconSize: number) => {
const res = getFileTypeIconAsUrl({
size: iconSize as FileTypeIconSize,
extension: 'blah',
});
expect(res).toEqual(getExpectedUrl(iconSize as FileTypeIconSize, 'svg', 'genericfile'));
});
});
it('returns genericfile with type as png', () => {
ICON_SIZES.forEach((iconSize: number) => {
const res = getFileTypeIconAsUrl({
size: iconSize as FileTypeIconSize,
extension: 'NotAValidExtension',
imageFileType: 'png',
});
expect(res).toEqual(getExpectedUrl(iconSize as FileTypeIconSize, 'png', 'genericfile'));
});
});
it('returns genericfile with default size for empty size, extension and type', () => {
const res = getFileTypeIconAsUrl({});
expect(res).toEqual(getExpectedUrl(DEFAULT_ICON_SIZE, 'svg', 'genericfile'));
});
it('returns genericfile with default size for empty size, extension and type with type as png', () => {
const res = getFileTypeIconAsUrl({ imageFileType: 'png' });
expect(res).toEqual(getExpectedUrl(DEFAULT_ICON_SIZE, 'png', 'genericfile'));
});
});
// Test suite 3
describe('Returns correct url for custom CDN url', () => {
it('returns expected url', () => {
const url = getFileTypeIconAsUrl(
{
size: 96,
extension: 'docx',
},
'path_to_url
);
expect(url).toEqual('path_to_url
});
});
``` | /content/code_sandbox/packages/react-file-type-icons/src/getFileTypeIconAsUrl.test.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 839 |
```xml
<?xml version="1.0" ?>
<concept name="BasicPrimitiveTransform" category="utility">
<!--
Distributed under the Boost
file LICENSE_1_0.txt or copy at path_to_url
-->
<param name="Fn" role="basic-primitive-transform-type" />
<param name="Expr" role="expression-type" />
<param name="State" role="state-type" />
<param name="Data" role="data-type" />
<models-sentence>
The type <arg num="1" /> must be a model of <self/>.
</models-sentence>
<description>
<para>
A BasicPrimitiveTransform is class type that
has a nested class template called impl that takes
three template parameters representing an expression
type, a state type and a data type. Specializations
of the nested impl template are ternary monomorphic
function objects that accept expression, state, and
data parameters.
</para>
</description>
<notation variables="fn">
<sample-value>
<type name="Fn" />
</sample-value>
</notation>
<notation variables="expr">
<sample-value>
<type name="Expr" />
</sample-value>
</notation>
<notation variables="state">
<sample-value>
<type name="State" />
</sample-value>
</notation>
<notation variables="data">
<sample-value>
<type name="Data" />
</sample-value>
</notation>
<associated-type name="result_type">
<get-member-type name="result_type">
<apply-template name="typename Fn::template impl">
<type name="Expr"/>
<type name="State"/>
<type name="Data"/>
</apply-template>
</get-member-type>
<description>
<simpara>The return type of the overloaded function call operator.</simpara>
</description>
</associated-type>
<valid-expression name="Monomorphic Function Call">
<apply-function name="typename Fn::template impl< Expr, State, Data >()">
<sample-value>
<type name="Expr" />
</sample-value>
<sample-value>
<type name="State" />
</sample-value>
<sample-value>
<type name="Data" />
</sample-value>
</apply-function>
<return-type>
<require-same-type testable="yes">
<type name="result_type"/>
</require-same-type>
</return-type>
<semantics>Applies the transform.</semantics>
</valid-expression>
<example-model>
<type name="boost::proto::terminal< int >" />
</example-model>
</concept>
``` | /content/code_sandbox/deps/boost_1_66_0/libs/proto/doc/reference/concepts/BasicPrimitiveTransform.xml | xml | 2016-09-05T10:18:44 | 2024-08-11T13:21:40 | LiquidCore | LiquidPlayer/LiquidCore | 1,010 | 604 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="SimSim" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
</objects>
</document>
``` | /content/code_sandbox/SimSim/Base.lproj/MainMenu.xib | xml | 2016-04-19T12:52:03 | 2024-08-15T02:31:44 | simsim | dsmelov/simsim | 1,466 | 262 |
```xml
import { readFile } from 'node:fs/promises';
import type { EnrichCsfOptions } from 'storybook/internal/csf-tools';
import { enrichCsf, formatCsf, loadCsf } from 'storybook/internal/csf-tools';
interface LoaderContext {
async: () => (err: Error | null, result?: string, map?: any) => void;
getOptions: () => EnrichCsfOptions;
resourcePath: string;
}
async function loader(this: LoaderContext, content: string, map: any) {
const callback = this.async();
const options = this.getOptions();
const id = this.resourcePath;
const sourceCode = await readFile(id, 'utf-8');
try {
const makeTitle = (userTitle: string) => userTitle || 'default';
const csf = loadCsf(content, { makeTitle }).parse();
const csfSource = loadCsf(sourceCode, { makeTitle }).parse();
enrichCsf(csf, csfSource, options);
const formattedCsf = formatCsf(
csf,
{ sourceMaps: true, inputSourceMap: map, sourceFileName: id },
content
);
if (typeof formattedCsf === 'string') {
return callback(null, formattedCsf, map);
}
callback(null, formattedCsf.code, formattedCsf.map);
} catch (err: any) {
// This can be called on legacy storiesOf files, so just ignore
// those errors. But warn about other errors.
if (!err.message?.startsWith('CSF:')) {
console.warn(err.message);
}
callback(null, content, map);
}
}
export default loader;
``` | /content/code_sandbox/code/lib/csf-plugin/src/webpack-loader.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 368 |
```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="release|Win32">
<Configuration>release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release-assert|Win32">
<Configuration>release-assert</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<BaseIntermediateOutputPath>$(SolutionDir)..\..\..\..\..\bld\msvc\lib\$(SolutionName)\$(ProjectName)</BaseIntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<!-- reverge_begin cpps -->
<ClInclude Include="..\..\test\mul_eq_vs_test.cpp" />
<!-- reverge_end cpps -->
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4C2062B0-7B86-1EA0-22F1-69D003AE6CD3}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release-assert|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release-assert|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<!-- reverge_begin defines(debug) -->
<NMakePreprocessorDefinitions>BOOST_ALL_NO_LIB=1;</NMakePreprocessorDefinitions>
<!-- reverge_end defines(debug) -->
<!-- reverge_begin includes(debug) -->
<NMakeIncludeSearchPath>;$(ProjectDir)..\..\..\..</NMakeIncludeSearchPath>
<!-- reverge_end includes(debug) -->
<!-- reverge_begin options(debug) -->
<AdditionalOptions>-TP -c /EHs /GR /MDd /Ob0 /Od /W3 /Z7 /Zc:forScope /Zc:wchar_t /favor:blend /wd4675 </AdditionalOptions>
<!-- reverge_end options(debug) -->
<OutDir>$(SolutionDir)..\..\..\..\..\bld\lib\$(SolutionName)\libs\$(SolutionName)\test\$(ProjectName).test\msvc-12.0\$(Configuration)\address-model-64\link-static\threading-multi\</OutDir>
<IntDir>$(SolutionDir)..\..\..\..\..\bld\lib\$(SolutionName)\libs\$(SolutionName)\test\$(ProjectName).test\msvc-12.0\$(Configuration)\address-model-64\link-static\threading-multi\</IntDir>
<ExecutablePath>$(PATH)</ExecutablePath>
<IncludePath />
<ReferencePath />
<LibraryPath />
<LibraryWPath />
<SourcePath />
<ExcludePath />
<NMakeBuildCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)..\..\..\b2 address-model=64 variant=$(configuration) toolset=msvc-14.0 $(ProjectName)</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)..\..\..\b2 address-model=64 variant=$(configuration) toolset=msvc-14.0 $(ProjectName) -a</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)vcxproj.bat msvc-14.0 $(ProjectPath)</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<!-- reverge_begin defines(release) -->
<NMakePreprocessorDefinitions>BOOST_ALL_NO_LIB=1;NDEBUG;</NMakePreprocessorDefinitions>
<!-- reverge_end defines(release) -->
<!-- reverge_begin includes(release) -->
<NMakeIncludeSearchPath>;$(ProjectDir)..\..\..\..</NMakeIncludeSearchPath>
<!-- reverge_end includes(release) -->
<!-- reverge_begin options(release) -->
<AdditionalOptions>-TP -c /EHs /GR /MD /O2 /Ob2 /W3 /Zc:forScope /Zc:wchar_t /favor:blend /wd4675 </AdditionalOptions>
<!-- reverge_end options(release) -->
<OutDir>$(SolutionDir)..\..\..\..\..\bld\lib\$(SolutionName)\libs\$(SolutionName)\test\$(ProjectName).test\msvc-12.0\$(Configuration)\address-model-64\link-static\threading-multi\</OutDir>
<IntDir>$(SolutionDir)..\..\..\..\..\bld\lib\$(SolutionName)\libs\$(SolutionName)\test\$(ProjectName).test\msvc-12.0\$(Configuration)\address-model-64\link-static\threading-multi\</IntDir>
<ExecutablePath>$(PATH)</ExecutablePath>
<IncludePath />
<ReferencePath />
<LibraryPath />
<LibraryWPath />
<SourcePath />
<ExcludePath />
<NMakeBuildCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)..\..\..\b2 address-model=64 variant=$(configuration) toolset=msvc-14.0 $(ProjectName)</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)..\..\..\b2 address-model=64 variant=$(configuration) toolset=msvc-14.0 $(ProjectName) -a</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)vcxproj.bat msvc-14.0 $(ProjectPath)</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release-assert|Win32'">
<!-- reverge_begin defines(release-assert) -->
<NMakePreprocessorDefinitions>BOOST_ALL_NO_LIB=1;</NMakePreprocessorDefinitions>
<!-- reverge_end defines(release-assert) -->
<!-- reverge_begin includes(release-assert) -->
<NMakeIncludeSearchPath>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\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;$(ProjectDir)..\..\..\..\..\boost_1_60_0;$(ProjectDir)..\..\include</NMakeIncludeSearchPath>
<!-- reverge_end includes(release-assert) -->
<!-- reverge_begin options(release-assert) -->
<AdditionalOptions>-FC -TP -c -wd4018 -wd4180 -wd4244 -wd4267 -wd4355 -wd4512 -wd4624 -wd4800 -wd4996 /EHs /GR /MD /O2 /Ob2 /W3 /Z7 /Zc:forScope /Zc:wchar_t /favor:blend /wd4675 </AdditionalOptions>
<!-- reverge_end options(release-assert) -->
<OutDir>$(SolutionDir)..\..\..\..\..\bld\lib\$(SolutionName)\libs\$(SolutionName)\test\$(ProjectName).test\msvc-12.0\$(Configuration)\address-model-64\link-static\threading-multi\</OutDir>
<IntDir>$(SolutionDir)..\..\..\..\..\bld\lib\$(SolutionName)\libs\$(SolutionName)\test\$(ProjectName).test\msvc-12.0\$(Configuration)\address-model-64\link-static\threading-multi\</IntDir>
<ExecutablePath>$(PATH)</ExecutablePath>
<IncludePath />
<ReferencePath />
<LibraryPath />
<LibraryWPath />
<SourcePath />
<ExcludePath />
<NMakeBuildCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)..\..\..\b2 address-model=64 variant=$(configuration) toolset=msvc-14.0 $(ProjectName)</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)..\..\..\b2 address-model=64 variant=$(configuration) toolset=msvc-14.0 $(ProjectName) -a</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>cd $(SolutionDir)..\test && $(SolutionDir)vcxproj.bat msvc-14.0 $(ProjectPath)</NMakeCleanCommandLine>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/deps/boost_1_66_0/libs/qvm/bld/test/mul_eq_vs_test.vcxproj | xml | 2016-09-05T10:18:44 | 2024-08-11T13:21:40 | LiquidCore | LiquidPlayer/LiquidCore | 1,010 | 2,469 |
```xml
import Button from '@erxes/ui/src/components/Button';
import Icon from '@erxes/ui/src/components/Icon';
import { TabTitle, Tabs } from '@erxes/ui/src/components/tabs/index';
import { __ } from '@erxes/ui/src/utils/core';
import React, { useState } from 'react';
import styled from 'styled-components';
import styledTS from 'styled-components-ts';
import Card from './Card';
import { TabAction } from './ReplyFbMessage';
const MainWrapper = styled.div`
display: grid;
align-items: center;
grid-template-columns: 10% 80% 10%;
`;
const TabsWrapper = styled.div`
width: 100%;
overflow: hidden;
`;
const TabContainer = styled.div`
transition: transform 0.5s ease;
`;
const TabButton = styledTS<{ disabled?: Boolean }>(styled.div)`
margin: 5px 10px;
cursor: pointer;
${({ disabled }) => (disabled ? 'color:#888 !important' : '')}
`;
const RighButton = styled(TabButton)``;
const LeftButton = styled(TabButton)``;
const generateSelectedPageId = (cards: any[]) => {
return cards[0]?._id || '';
};
function Cards({ cards, onChange }) {
const [selectedPageId, setSelectedPageId] = useState(
generateSelectedPageId(cards || []),
);
const [currentSlide, setCurrentSlide] = useState(0);
const selectedPage = cards.find((card) => card._id === selectedPageId);
const totalSlides = Math.ceil(cards.length / 3) + 1;
const onSelectTab = (id) => {
setSelectedPageId(id);
};
const handleRemovePage = (_id) => {
const filteredCards = cards.filter((card) => card._id !== _id);
onChange(filteredCards);
};
const addPage = () => {
const _id = Math.random().toString();
onChange([
...cards,
{
_id,
label: `Page ${(cards?.length || 0) + 1}`,
},
]);
setSelectedPageId(_id);
};
const handleChange = (_id, name, value) => {
const updatedCards = cards.map((card) =>
card._id === _id ? { ...card, [name]: value } : card,
);
onChange(updatedCards);
};
const handlePrevClick = () => {
setCurrentSlide((prevSlide) => (prevSlide > 0 ? prevSlide - 1 : 0));
};
const handleNextClick = () => {
setCurrentSlide((prevSlide) =>
prevSlide + 1 < totalSlides ? prevSlide + 1 : totalSlides - 1,
);
};
return (
<div>
<MainWrapper>
<LeftButton onClick={handlePrevClick} disabled={currentSlide === 0}>
<Icon icon="angle-left" size={20} />
</LeftButton>
<TabsWrapper>
<TabContainer
style={{ transform: `translateX(-${currentSlide * 100}%)` }}
>
<Tabs>
{cards.map(({ _id, label }) => (
<TabTitle
key={_id}
className={_id === selectedPageId ? 'active' : ''}
onClick={() => onSelectTab(_id)}
>
<span style={{ whiteSpace: 'nowrap' }}>{__(label)}</span>
<TabAction onClick={() => handleRemovePage(_id)}>
<Icon icon="times-circle" />
</TabAction>
</TabTitle>
))}
{cards.length < 10 && (
<Button btnStyle="link" icon="focus-add" onClick={addPage} />
)}
</Tabs>
</TabContainer>
</TabsWrapper>
<RighButton
onClick={handleNextClick}
disabled={totalSlides === currentSlide + 1}
>
<Icon icon="angle-right-b" size={20} />
</RighButton>
</MainWrapper>
{selectedPage && <Card card={selectedPage} onChange={handleChange} />}
</div>
);
}
export default Cards;
``` | /content/code_sandbox/packages/plugin-facebook-ui/src/automations/components/action/Cards.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 901 |
```xml
import { Queue } from "bull";
import { Second } from "@shared/utils/time";
import Logger from "@server/logging/Logger";
/* eslint-disable @typescript-eslint/no-misused-promises */
export default class HealthMonitor {
/**
* Starts a health monitor for the given queue. If the queue stops processing jobs then the
* process is exit.
*
* @param queue The queue to monitor
*/
public static start(queue: Queue) {
let processedJobsSinceCheck = 0;
queue.on("active", () => {
processedJobsSinceCheck += 1;
});
setInterval(async () => {
if (processedJobsSinceCheck > 0) {
processedJobsSinceCheck = 0;
return;
}
processedJobsSinceCheck = 0;
const waiting = await queue.getWaitingCount();
if (waiting > 50) {
Logger.fatal(
"Queue has stopped processing jobs",
new Error(`Jobs are waiting in the ${queue.name} queue`),
{
queue: queue.name,
waiting,
}
);
}
}, 30 * Second);
}
}
``` | /content/code_sandbox/server/queues/HealthMonitor.ts | xml | 2016-05-22T21:31:47 | 2024-08-16T19:57:22 | outline | outline/outline | 26,751 | 243 |
```xml
import { LayoutModule } from '@angular/cdk/layout';
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
LayoutModule,
MatToolbarModule,
MatButtonModule,
MatSidenavModule,
MatIconModule,
MatListModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
``` | /content/code_sandbox/novidades-v9/src/app/app.module.ts | xml | 2016-07-02T18:58:48 | 2024-08-15T23:36:46 | curso-angular | loiane/curso-angular | 1,910 | 191 |
```xml
import { bind } from 'decko';
import * as React from 'react';
import { removeProtocols } from 'shared/utils/formatters/urlFormatter';
import Button from '../Button/Button';
import ClickOutsideListener from '../ClickOutsideListener/ClickOutsideListener';
import CopyButton from '../CopyButton/CopyButton';
import Fai from '../Fai/Fai';
import { Icon } from '../Icon/Icon';
import styles from './ShareLink.module.css';
interface ILocalProps {
link: string;
buttonType: 'fai' | 'default';
}
interface ILocalState {
isShowLink: boolean;
}
class ShareLink extends React.PureComponent<ILocalProps, ILocalState> {
public state: ILocalState = {
isShowLink: false,
};
public render() {
const { link, buttonType } = this.props;
const { isShowLink } = this.state;
return (
<ClickOutsideListener onClickOutside={this.hideLink}>
<div className={styles.root}>
{buttonType === 'default' && (
<Button size="medium" onClick={this.showLink}>
Share Page
</Button>
)}
{buttonType === 'fai' && (
<Fai
theme="primary"
variant="outlined"
icon={<Icon type="share" />}
onClick={this.showLink}
/>
)}
{isShowLink && (
<div
className={
buttonType === 'fai'
? styles.linkContainer__fai
: styles.linkContainer
}
>
<div className={styles.linkContainer__link}>
{removeProtocols(link)}
</div>
<CopyButton value={removeProtocols(link)} />
<div className={styles.close_button}>
<Icon type="cancel" onClick={this.hideLink} />
</div>
</div>
)}
</div>
</ClickOutsideListener>
);
}
@bind
private showLink() {
if (!this.state.isShowLink) {
this.setState({ isShowLink: true });
}
}
@bind
private hideLink() {
if (this.state.isShowLink) {
this.setState({ isShowLink: false });
}
}
}
export default ShareLink;
``` | /content/code_sandbox/webapp/client/src/shared/view/elements/ShareLink/ShareLink.tsx | xml | 2016-10-19T01:07:26 | 2024-08-14T03:53:55 | modeldb | VertaAI/modeldb | 1,689 | 492 |
```xml
import { useEffect } from 'react';
import usePrevious from '@proton/hooks/usePrevious';
import isDeepEqual from '@proton/shared/lib/helpers/isDeepEqual';
export const useItemEffect = <T>(effect: (item: T) => void | (() => void), items: T[], otherDeps?: any[]) => {
const previous = usePrevious(items);
useEffect(() => {
const cleanups = new Set<() => void>();
items.forEach((item, index) => {
if (isDeepEqual(previous?.[index], item)) {
return;
}
const cleanup = effect(item);
if (cleanup) {
cleanups.add(cleanup);
}
});
return () => {
cleanups.forEach((c) => c());
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [items, otherDeps]);
};
``` | /content/code_sandbox/applications/wallet/src/app/hooks/useItemEffect.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 189 |
```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
*
*/
export * from './TitleBar';
``` | /content/code_sandbox/src/script/components/TitleBar/index.tsx | xml | 2016-07-21T15:34:05 | 2024-08-16T11:40:13 | wire-webapp | wireapp/wire-webapp | 1,125 | 95 |
```xml
import Link from 'next/link'
/** Add your relevant code here for the issue to reproduce */
export default function Home() {
return (
<div>
<h1>Subpage linking issue reproduction</h1>
<p>Reproducing:</p>
<ol>
<li>Press the "Go to blog" link</li>
<li>Press the "Go to post" link</li>
<li>
<em>Expected behavior</em>: link should take you to the blog post
</li>
<li>
<em>Actual behavior</em>: the browser fetches the data for the page
but never navigates
</li>
</ol>
<p>
Reloading and pressing the "Go to another page" link and then going to
the blog post does work however, suggesting the issue is navigating from{' '}
<code>/blog</code> to <code>/blog/a-post</code> (<code>/[slug]</code>{' '}
where slug is blog and <code>/blog/[slug]</code> where slug is a-post)
</p>
<Link href="/blog" style={{ display: 'block' }} id="to-blog">
Go to blog
</Link>
<Link href="/another-page" style={{ display: 'block' }}>
Go to another page
</Link>
</div>
)
}
``` | /content/code_sandbox/test/e2e/app-dir/router-stuck-dynamic-static-segment/app/page.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 308 |
```xml
import Backbone from 'backbone';
import Component from '../../../../src/dom_components/model/Component';
import ComponentImage from '../../../../src/dom_components/model/ComponentImage';
import ComponentText from '../../../../src/dom_components/model/ComponentText';
import ComponentTextNode from '../../../../src/dom_components/model/ComponentTextNode';
import ComponentLink from '../../../../src/dom_components/model/ComponentLink';
import ComponentMap from '../../../../src/dom_components/model/ComponentMap';
import ComponentVideo from '../../../../src/dom_components/model/ComponentVideo';
import Components from '../../../../src/dom_components/model/Components';
import Selector from '../../../../src/selector_manager/model/Selector';
import Editor from '../../../../src/editor/model/Editor';
import { CSS_BG_OBJ, CSS_BG_STR } from '../../parser/model/ParserCss';
const $ = Backbone.$;
let obj: Component;
let dcomp: Editor['Components'];
let compOpts: any;
let em: Editor;
describe('Component', () => {
beforeEach(() => {
// FIXME: avoidInlineStyle is deprecated and when running in dev or prod, `avoidInlineStyle` is set to true
// The following tests ran with `avoidInlineStyle` to false (this is why I add the parameter here)
em = new Editor({ avoidDefaults: true, avoidInlineStyle: true });
dcomp = em.Components;
em.Pages.onLoad();
compOpts = {
em,
componentTypes: dcomp.componentTypes,
domc: dcomp,
};
obj = new Component({}, compOpts);
});
afterEach(() => {
em.destroyAll();
});
test('Has no children', () => {
expect(obj.components().length).toEqual(0);
});
test('Clones correctly', () => {
const sAttr = obj.attributes;
const cloned = obj.clone();
const eAttr = cloned.attributes;
expect(sAttr.length).toEqual(eAttr.length);
});
test('Clones correctly with traits', () => {
obj.traits.at(0).set('value', 'testTitle');
var cloned = obj.clone();
cloned.set('stylable', false);
cloned.traits.at(0).set('value', 'testTitle2');
expect(obj.traits.at(0).get('value')).toEqual('testTitle');
expect(obj.get('stylable')).toEqual(true);
});
test('Sets attributes correctly from traits', () => {
obj.set('traits', [
{
label: 'Title',
name: 'title',
value: 'The title',
},
{
label: 'Context',
value: 'primary',
},
] as any);
expect(obj.get('attributes')).toEqual({ title: 'The title' });
});
test('Has expected name', () => {
expect(obj.getName()).toEqual('Div');
});
test('Has expected name 2', () => {
obj.cid = 'c999';
obj.set('type', 'testType');
expect(obj.getName()).toEqual('TestType');
});
test('Component toHTML', () => {
expect(obj.toHTML()).toEqual('<div></div>');
});
test('Component toHTML with attributes', () => {
obj = new Component(
{
tagName: 'article',
attributes: {
'data-test1': 'value1',
'data-test2': 'value2',
},
},
compOpts,
);
expect(obj.toHTML()).toEqual('<article data-test1="value1" data-test2="value2"></article>');
});
test('Component toHTML with value-less attribute', () => {
obj = new Component(
{
tagName: 'div',
attributes: {
'data-is-a-test': '',
},
},
compOpts,
);
expect(obj.toHTML()).toEqual('<div data-is-a-test=""></div>');
});
test('Component toHTML with classes', () => {
obj = new Component(
{
tagName: 'article',
},
compOpts,
);
['class1', 'class2'].forEach((item) => {
obj.classes.add({ name: item });
});
expect(obj.toHTML()).toEqual('<article class="class1 class2"></article>');
});
test('Component toHTML with children', () => {
obj = new Component({ tagName: 'article' }, compOpts);
obj.components().add({ tagName: 'span' });
expect(obj.toHTML()).toEqual('<article><span></span></article>');
});
test('Component toHTML with more children', () => {
obj = new Component({ tagName: 'article' }, compOpts);
obj.components().add([{ tagName: 'span' }, { tagName: 'div' }]);
expect(obj.toHTML()).toEqual('<article><span></span><div></div></article>');
});
test('Component toHTML with no closing tag', () => {
obj = new Component({ void: true }, compOpts);
expect(obj.toHTML()).toEqual('<div/>');
});
test('Component toHTML with quotes in attribute', () => {
obj = new Component({}, compOpts);
let attrs = obj.get('attributes')!;
attrs['data-test'] = '"value"';
obj.set('attributes', attrs);
expect(obj.toHTML()).toEqual('<div data-test=""value""></div>');
});
test('Component toHTML and withProps', () => {
obj = new Component({}, compOpts);
obj.set({
bool: true,
removable: false,
string: 'st\'ri"ng',
array: [1, 'string', true],
object: { a: 1, b: 'string', c: true },
null: null,
undef: undefined,
empty: '',
zero: 0,
_private: 'value',
});
let resStr = "st'ri"ng";
let resArr = '[1,"string",true]';
let resObj = '{"a":1,"b":"string","c":true}';
let res = `<div data-gjs-removable="false" data-gjs-bool="true" data-gjs-string="${resStr}" data-gjs-array="${resArr}" data-gjs-object="${resObj}" data-gjs-empty="" data-gjs-zero="0"></div>`;
expect(obj.toHTML({ withProps: true })).toEqual(res);
resStr = 'st'ri"ng';
resArr = '[1,"string",true]';
resObj = '{"a":1,"b":"string","c":true}';
res = `<div data-gjs-removable="false" data-gjs-bool="true" data-gjs-string='${resStr}' data-gjs-array='${resArr}' data-gjs-object='${resObj}' data-gjs-empty="" data-gjs-zero="0"></div>`;
expect(obj.toHTML({ withProps: true, altQuoteAttr: true })).toEqual(res);
});
test('Manage correctly boolean attributes', () => {
obj = new Component({}, compOpts);
obj.set('attributes', {
'data-test': 'value',
checked: false,
required: true,
avoid: true,
});
expect(obj.toHTML()).toEqual('<div data-test="value" required avoid></div>');
});
test('Component parse empty div', () => {
const el = document.createElement('div');
const res = Component.isComponent(el);
expect(res).toEqual({ tagName: 'div' });
});
test('Component parse span', () => {
const el = document.createElement('span');
const res = Component.isComponent(el);
expect(res).toEqual({ tagName: 'span' });
});
test('setClass single class string', () => {
obj.setClass('class1');
const result = obj.classes.models;
expect(result.length).toEqual(1);
expect(result[0] instanceof Selector).toEqual(true);
expect(result[0].get('name')).toEqual('class1');
});
test('setClass multiple class string', () => {
obj.setClass('class1 class2');
const result = obj.classes.models;
expect(result.length).toEqual(2);
});
test('setClass single class array', () => {
obj.setClass(['class1']);
const result = obj.classes.models;
expect(result.length).toEqual(1);
});
test('setClass multiple class array', () => {
obj.setClass(['class1', 'class2']);
const result = obj.classes.models;
expect(result.length).toEqual(2);
});
test('addClass multiple array', () => {
obj.addClass(['class1', 'class2']);
const result = obj.classes.models;
expect(result.length).toEqual(2);
});
test('addClass avoid same name classes', () => {
obj.addClass(['class1', 'class2']);
obj.addClass(['class1', 'class3']);
const result = obj.classes.models;
expect(result.length).toEqual(3);
});
test('removeClass by string', () => {
obj.addClass(['class1', 'class2']);
obj.removeClass('class2');
const result = obj.classes.models;
expect(result.length).toEqual(1);
});
test('removeClass by string with multiple classes', () => {
obj.addClass(['class1', 'class2']);
obj.removeClass('class2 class1');
const result = obj.classes.models;
expect(result.length).toEqual(0);
});
test('removeClass by array', () => {
obj.addClass(['class1', 'class2']);
obj.removeClass(['class1', 'class2']);
const result = obj.classes.models;
expect(result.length).toEqual(0);
});
test('removeClass do nothing with undefined classes', () => {
obj.addClass(['class1', 'class2']);
obj.removeClass(['class3']);
const result = obj.classes.models;
expect(result.length).toEqual(2);
});
test('removeClass actually removes classes from attributes', () => {
obj.addClass('class1');
obj.removeClass('class1');
const result = obj.getAttributes();
expect(result.class).toEqual(undefined);
});
test('setAttributes', () => {
obj.setAttributes({
id: 'test',
'data-test': 'value',
class: 'class1 class2',
style: 'color: white; background: #fff',
});
// Style is not in attributes because it has not been set as inline
expect(obj.getAttributes()).toEqual({
id: 'test',
class: 'class1 class2',
'data-test': 'value',
});
expect(obj.classes.length).toEqual(2);
expect(obj.getStyle()).toEqual({
color: 'white',
background: '#fff',
});
});
test('set style with multiple values of the same key', () => {
obj.setAttributes({ style: CSS_BG_STR });
expect(obj.getStyle()).toEqual(CSS_BG_OBJ);
});
test('set style on id and inline style', () => {
obj.setStyle({ color: 'red' }); // Should be set on id
obj.setStyle({ display: 'flex' }, { inline: true }); // Should be set as inline
expect(obj.getStyle()).toEqual({
color: 'red',
});
expect(obj.getStyle({ inline: true })).toEqual({
display: 'flex',
});
});
test('get proper style from style with multiple values of the same key', () => {
obj.setAttributes({ style: CSS_BG_STR }, { inline: true });
expect(obj.getAttributes()).toEqual({
style: CSS_BG_STR.split('\n').join(''),
});
});
test('setAttributes overwrites correctly', () => {
obj.setAttributes({ id: 'test', 'data-test': 'value', a: 'b', b: 'c' });
obj.setAttributes({ id: 'test2', 'data-test': 'value2' });
expect(obj.getAttributes()).toEqual({ id: 'test2', 'data-test': 'value2' });
});
test('append() returns always an array', () => {
let result = obj.append('<span>text1</span>');
expect(result.length).toEqual(1);
result = obj.append('<span>text1</span><div>text2</div>');
expect(result.length).toEqual(2);
});
test('append() new components as string', () => {
obj.append('<span>text1</span><div>text2</div>');
const comps = obj.components();
expect(comps.length).toEqual(2);
expect(comps.models[0].get('tagName')).toEqual('span');
expect(comps.models[1].get('tagName')).toEqual('div');
});
test('append() new components as Objects', () => {
obj.append([{}, {}]);
const comps = obj.components();
expect(comps.length).toEqual(2);
const result = obj.append({});
expect(comps.length).toEqual(3);
expect(result[0].em).toEqual(em);
});
test('components() set new collection', () => {
obj.append([{}, {}]);
obj.components('<span>test</div>');
const result = obj.components();
expect(result.length).toEqual(1);
expect(result.models[0].get('tagName')).toEqual('span');
expect(result.em).toEqual(em);
});
test('Propagate properties to children', () => {
obj.append({ propagate: 'removable' });
const result = obj.components();
const newObj = result.models[0];
expect(newObj.get('removable')).toEqual(true);
newObj.set('removable', false);
newObj.append({ draggable: false });
const child = newObj.components().models[0];
expect(child.get('removable')).toEqual(false);
expect(child.get('propagate')).toEqual(['removable']);
});
// This will try to avoid, eventually, issues with circular structures
test('Can stringify object after edits', () => {
const added = dcomp.addComponent(`
<div>
<div>Comp 1</div>
<div>Comp 2</div>
<div>Comp 3</div>
</div>
`) as Component;
const comp1 = added.components().at(0);
comp1.remove();
added.append(comp1);
expect(JSON.stringify(added)).toBeTruthy();
});
test('Guarantee the uniqueness of components ids', () => {
const idName = 'test';
const added = dcomp.addComponent(`
<div>Comp 1</div>
<div id="${idName}" style="color: red">Comp 2</div>
<div>Comp 3</div>
<style>
#test {
color: red;
}
</style>
`) as Component[];
const comp1 = added[0];
const comp2 = added[1];
const comp1Id = comp1.getId();
const comp2Sel = comp2._getStyleSelector()!;
expect(comp2Sel.get('name')).toEqual(idName);
const idNameNew = `${idName}2`;
comp2.setId(idNameNew);
// Check if the style selector has changed its name
expect(comp2Sel.get('name')).toEqual(idNameNew);
comp1.setId(idNameNew);
// The id shouldn't change
expect(comp1.getId()).toEqual(comp1Id);
});
test('Ability to stop/change propagation chain', () => {
obj.append({
removable: false,
draggable: false,
propagate: ['removable', 'draggable'],
});
const result = obj.components();
const newObj = result.models[0];
newObj.components(`
<div id="comp01">
<div id="comp11">comp1</div>
<div id="comp12" data-gjs-stop="1" data-gjs-removable="true" data-gjs-draggable="true" data-gjs-propagate='["stop"]'>
<div id="comp21">comp21</div>
<div id="comp22">comp22</div>
</div>
<div id="comp13">
<div id="comp31">comp31</div>
<div id="comp32">comp32</div>
</div>
</div>
<div id="comp02">TEST</div>`);
const notInhereted = (model: Component) => {
expect(model.get('stop')).toEqual('1');
expect(model.get('removable')).toEqual(true);
expect(model.get('draggable')).toEqual(true);
expect(model.get('propagate')).toEqual(['stop']);
model.components().each((model) => inhereted(model));
};
const inhereted = (model: Component) => {
if (model.get('stop')) {
notInhereted(model);
} else {
expect(model.get('removable')).toEqual(false);
expect(model.get('draggable')).toEqual(false);
expect(model.get('propagate')).toEqual(['removable', 'draggable']);
model.components().each((model) => inhereted(model));
}
};
newObj.components().each((model) => inhereted(model));
});
test('setStyle parses styles correctly', () => {
const styles = 'padding: 12px;height:auto;';
const expectedObj = {
padding: '12px',
height: 'auto',
};
const c = new Component({}, compOpts);
expect(c.setStyle(styles as any)).toEqual(expectedObj);
});
test('setStyle should be called successfully when invoked internally', () => {
const ExtendedComponent = Component.extend({
init() {
const styles = 'padding: 12px;height:auto;';
this.setStyle(styles);
},
});
expect(() => new ExtendedComponent({}, compOpts)).not.toThrowError();
});
});
describe('Image Component', () => {
beforeEach(() => {
em = new Editor({ avoidDefaults: true });
compOpts = { em };
obj = new ComponentImage({}, compOpts);
});
afterEach(() => {
em.destroyAll();
});
test('Has src property', () => {
expect(obj.has('src')).toEqual(true);
});
test('Not droppable', () => {
expect(obj.get('droppable')).toEqual(0);
});
test('ComponentImage toHTML', () => {
obj = new ComponentImage({ src: '' }, compOpts);
expect(obj.toHTML()).toEqual('<img/>');
});
test('Component toHTML with attributes', () => {
obj = new ComponentImage(
{
attributes: { alt: 'AltTest' },
src: 'testPath',
},
compOpts,
);
expect(obj.toHTML()).toEqual('<img alt="AltTest" src="testPath"/>');
});
test('Refuse not img element', () => {
var el = document.createElement('div');
expect(ComponentImage.isComponent(el)).toEqual(false);
});
test('Component parse img element', () => {
var el = document.createElement('img');
expect(ComponentImage.isComponent(el)).toEqual(true);
});
test('Component parse img element with src', () => {
var el = document.createElement('img');
el.src = 'path_to_url
expect(ComponentImage.isComponent(el)).toEqual(true);
});
});
describe('Text Component', () => {
beforeEach(() => {
em = new Editor({ avoidDefaults: true });
compOpts = { em };
obj = new ComponentText({}, compOpts);
});
afterEach(() => {
em.destroyAll();
});
test('Has content property', () => {
expect(obj.has('content')).toEqual(true);
});
test('Not droppable', () => {
expect(obj.get('droppable')).toEqual(false);
});
test('Component toHTML with attributes', () => {
obj = new ComponentText(
{
attributes: { 'data-test': 'value' },
content: 'test content',
},
compOpts,
);
expect(obj.toHTML()).toEqual('<div data-test="value">test content</div>');
});
});
describe('Text Node Component', () => {
beforeEach(() => {
em = new Editor({ avoidDefaults: true });
compOpts = { em };
obj = new ComponentTextNode({}, compOpts);
});
afterEach(() => {
em.destroyAll();
});
test('Has content property', () => {
expect(obj.has('content')).toEqual(true);
});
test('Not droppable', () => {
expect(obj.get('droppable')).toEqual(false);
});
test('Not editable', () => {
expect(obj.get('editable')).toEqual(true);
});
test('Component toHTML with attributes', () => {
obj = new ComponentTextNode(
{
attributes: { 'data-test': 'value' },
content: 'test content &<>"\'',
},
compOpts,
);
expect(obj.toHTML()).toEqual('test content &<>"\'');
});
});
describe('Link Component', () => {
const aEl = document.createElement('a');
test('Component parse link element', () => {
obj = ComponentLink.isComponent(aEl);
expect(obj).toEqual({ type: 'link' });
});
test('Component parse link element with text content', () => {
aEl.innerHTML = 'some text here ';
obj = ComponentLink.isComponent(aEl);
expect(obj).toEqual({ type: 'link' });
});
test('Component parse link element with not only text content', () => {
aEl.innerHTML = '<div>Some</div> text <div>here </div>';
obj = ComponentLink.isComponent(aEl);
expect(obj).toEqual({ type: 'link' });
});
test('Component parse link element with only not text content', () => {
aEl.innerHTML = `<div>Some</div>
<div>text</div>
<div>here </div>`;
obj = ComponentLink.isComponent(aEl);
expect(obj).toEqual({ type: 'link', editable: false });
});
test('Link element with only an image inside is not editable', () => {
aEl.innerHTML = '<img src="##"/>';
obj = ComponentLink.isComponent(aEl);
expect(obj).toEqual({ type: 'link', editable: false });
});
});
describe('Map Component', () => {
test('Component parse map iframe', () => {
var src = 'path_to_url
var el = $('<iframe src="' + src + '"></iframe>');
const res = ComponentMap.isComponent(el.get(0) as HTMLIFrameElement);
expect(res).toEqual({ type: 'map', src });
});
test('Component parse not map iframe', () => {
var el = $('<iframe src="path_to_url"></iframe>');
const res = ComponentMap.isComponent(el.get(0) as HTMLIFrameElement);
expect(res).toEqual(undefined);
});
});
describe('Video Component', () => {
test('Component parse video', () => {
var src = 'path_to_url
var el = $<HTMLVideoElement>('<video src="' + src + '"></video>');
obj = ComponentVideo.isComponent(el.get(0) as HTMLVideoElement);
expect(obj).toEqual({ type: 'video', src });
});
test('Component parse youtube video iframe', () => {
var src = 'path_to_url
var el = $('<iframe src="' + src + '"></video>');
obj = ComponentVideo.isComponent(el.get(0) as HTMLVideoElement);
expect(obj).toEqual({ type: 'video', provider: 'yt', src });
});
test('Component parse vimeo video iframe', () => {
var src = 'path_to_url
var el = $('<iframe src="' + src + '"></video>');
obj = ComponentVideo.isComponent(el.get(0) as HTMLVideoElement);
expect(obj).toEqual({ type: 'video', provider: 'vi', src });
});
});
describe('Components', () => {
beforeEach(() => {
em = new Editor({});
dcomp = em.Components;
em.Pages.onLoad();
compOpts = {
em,
componentTypes: dcomp.componentTypes,
};
});
test('Creates component correctly', () => {
var c = new Components([], compOpts);
var m = c.add({});
expect(m instanceof Component).toEqual(true);
expect(m.em).toEqual(em);
});
test('Creates image component correctly', () => {
var c = new Components([], compOpts);
var m = c.add({ type: 'image' });
expect(m instanceof ComponentImage).toEqual(true);
expect(m.em).toEqual(em);
});
test('Creates text component correctly', () => {
var c = new Components([], compOpts);
var m = c.add({ type: 'text' });
expect(m instanceof ComponentText).toEqual(true);
expect(m.em).toEqual(em);
});
test('Avoid conflicting components with the same ID', () => {
const em = new Editor({});
dcomp = em.Components;
em.Pages.onLoad();
const id = 'myid';
const idB = 'myid2';
const block = `
<div id="${id}">
<div id="${idB}"></div>
</div>
<style>
#${id} {
color: red;
}
#${id}:hover {
color: blue;
}
#${idB} {
color: yellow;
}
</style>
`;
const added = dcomp.addComponent(block) as Component;
const addComps = added.components();
// Let's check if everthing is working as expected
// 2 test components + 1 wrapper + 1 head + 1 docEl
expect(Object.keys(dcomp.componentsById).length).toBe(5);
expect(added.getId()).toBe(id);
expect(addComps.at(0).getId()).toBe(idB);
const cc = em.get('CssComposer');
const rules = cc.getAll();
expect(rules.length).toBe(3);
expect(rules.at(0).selectorsToString()).toBe(`#${id}`);
expect(rules.at(1).selectorsToString()).toBe(`#${id}:hover`);
expect(rules.at(2).selectorsToString()).toBe(`#${idB}`);
// Now let's add the same block
const added2 = dcomp.addComponent(block) as Component;
const addComps2 = added2.components();
const id2 = added2.getId();
const newId = `${id}-2`;
const newIdB = `${idB}-2`;
expect(id2).toBe(newId);
expect(addComps2.at(0).getId()).toBe(newIdB);
expect(rules.length).toBe(6);
expect(rules.at(3).selectorsToString()).toBe(`#${newId}`);
expect(rules.at(4).selectorsToString()).toBe(`#${newId}:hover`);
expect(rules.at(5).selectorsToString()).toBe(`#${newIdB}`);
});
});
``` | /content/code_sandbox/test/specs/dom_components/model/Component.ts | xml | 2016-01-22T00:23:19 | 2024-08-16T11:20:59 | grapesjs | GrapesJS/grapesjs | 21,687 | 5,827 |
```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 {UserAsset as APIClientUserAsset, UserAssetType} from '@wireapp/api-client/lib/user/';
import * as AssetMapper from './AssetMapper';
describe('AssetMapper', () => {
describe('mapProfileAssets', () => {
it('creates asset entities out of raw asset data', () => {
const userId = {domain: 'domain', id: 'user-id'};
const previewPictureId = '3-1-e705c3f5-7b4b-4136-a09b-01614cb355a1';
const completePictureId = '3-1-d22e106a-3632-4280-8367-c14943e2eca2';
const assets: APIClientUserAsset[] = [
{
key: previewPictureId,
size: UserAssetType.PREVIEW,
type: 'image',
},
{
key: completePictureId,
size: UserAssetType.COMPLETE,
type: 'image',
},
];
const mappedAssets = AssetMapper.mapProfileAssets(userId, assets);
expect(mappedAssets.medium['identifier']).toBe(completePictureId);
expect(mappedAssets.preview['identifier']).toBe(previewPictureId);
});
});
});
``` | /content/code_sandbox/src/script/assets/AssetMapper.test.ts | xml | 2016-07-21T15:34:05 | 2024-08-16T11:40:13 | wire-webapp | wireapp/wire-webapp | 1,125 | 350 |
```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.
*/
import acotd = require( './index' );
// TESTS //
// The function returns a number...
{
acotd( 3 ); // $ExpectType number
}
// The compiler throws an error if the function is provided a value other than a number...
{
acotd( true ); // $ExpectError
acotd( false ); // $ExpectError
acotd( null ); // $ExpectError
acotd( undefined ); // $ExpectError
acotd( '5' ); // $ExpectError
acotd( [] ); // $ExpectError
acotd( {} ); // $ExpectError
acotd( ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided insufficient arguments...
{
acotd(); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/math/base/special/acotd/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 229 |
```xml
import { Drone } from "../Drone"
import { getCISourceForEnv } from "../../get_ci_source"
const correctEnv = {
DRONE: "true",
DRONE_PULL_REQUEST: "800",
DRONE_REPO: "artsy/eigen",
}
describe("being found when looking for CI", () => {
it("finds Drone with the right ENV", () => {
const ci = getCISourceForEnv(correctEnv)
expect(ci).toBeInstanceOf(Drone)
})
})
describe(".isCI", () => {
test("validates when all Drone environment vars are set", () => {
const drone = new Drone(correctEnv)
expect(drone.isCI).toBeTruthy()
})
test("does not validate without DRONE", () => {
const drone = new Drone({})
expect(drone.isCI).toBeFalsy()
})
})
describe(".isPR", () => {
test("validates when all Drone environment vars are set", () => {
const drone = new Drone(correctEnv)
expect(drone.isPR).toBeTruthy()
})
test("does not validate without DRONE_PULL_REQUEST", () => {
const drone = new Drone({})
expect(drone.isPR).toBeFalsy()
})
const envs = ["DRONE_PULL_REQUEST", "DRONE_REPO"]
envs.forEach((key: string) => {
let env = {
DRONE: "true",
DRONE_PULL_REQUEST: "800",
DRONE_REPO: "artsy/eigen",
}
env[key] = null
test(`does not validate when ${key} is missing`, () => {
const drone = new Drone(env)
expect(drone.isPR).toBeFalsy()
})
})
it("needs to have a PR number", () => {
let env = {
DRONE: "true",
DRONE_PULL_REQUEST: "asdasd",
DRONE_REPO: "artsy/eigen",
}
const drone = new Drone(env)
expect(drone.isPR).toBeFalsy()
})
})
describe(".pullRequestID", () => {
it("pulls it out of the env", () => {
const drone = new Drone(correctEnv)
expect(drone.pullRequestID).toEqual("800")
})
})
describe(".repoSlug", () => {
it("pulls it out of the env", () => {
const drone = new Drone(correctEnv)
expect(drone.repoSlug).toEqual("artsy/eigen")
})
})
``` | /content/code_sandbox/source/ci_source/providers/_tests/_drone.test.ts | xml | 2016-08-20T12:57:06 | 2024-08-13T14:00:02 | danger-js | danger/danger-js | 5,229 | 529 |
```xml
import Sidebar from "./_components/sidebar";
import styles from "./layout.module.css";
export const metadata = {
title: "Layouts Example",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>
<main className={styles.main}>
<Sidebar />
{children}
</main>
</body>
</html>
);
}
``` | /content/code_sandbox/examples/layout-component/app/layout.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 97 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="STPreferencesAdvancedViewController">
<connections>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="420" height="125"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yMQ-uA-Raw">
<rect key="frame" x="133" y="13" width="154" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Open config folder" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Ivp-5n-g9s">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="openConfigFolder:" target="-2" id="9Dg-jW-9ab"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ydx-qL-zqJ">
<rect key="frame" x="18" y="88" width="142" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Syncthing executable: " id="gHX-uY-R2s">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zWx-is-mDL">
<rect key="frame" x="30" y="63" width="372" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="~/Library/Application Support/Syncthing-macOS/syncthing" usesSingleLineMode="YES" id="rs8-Wp-ExC">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<point key="canvasLocation" x="109" y="95.5"/>
</customView>
</objects>
</document>
``` | /content/code_sandbox/syncthing/UI/STPreferencesWindow/STPreferencesAdvancedViewController.xib | xml | 2016-06-12T19:22:10 | 2024-08-16T12:20:17 | syncthing-macos | syncthing/syncthing-macos | 2,651 | 948 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.