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
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="path_to_url"
xmlns:tools="path_to_url"
tools:context="org.thoughtcrime.securesms.components.ZoomingImageView">
<com.github.chrisbanes.photoview.PhotoView android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"/>
<com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
android:id="@+id/subsampling_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
</merge>
``` | /content/code_sandbox/src/main/res/layout/zooming_image_view.xml | xml | 2016-07-03T07:32:36 | 2024-08-16T16:51:15 | deltachat-android | deltachat/deltachat-android | 1,082 | 155 |
```xml
/*
* This software is released under MIT license.
* The full license information can be found in LICENSE in the root directory of this project.
*/
import { renderIcon } from '../icon.renderer.js';
import { IconShapeTuple } from '../interfaces/icon.interfaces.js';
const icon = {
outline:
'<path d="M31.06,9h-26a1,1,0,1,1,0-2h26a1,1,0,1,1,0,2Z"/><path d="M31.06,14h-17a1,1,0,0,1,0-2h17a1,1,0,1,1,0,2Z"/><path d="M31.06,19h-17a1,1,0,0,1,0-2h17a1,1,0,1,1,0,2Z"/><path d="M31.06,24h-17a1,1,0,0,1,0-2h17a1,1,0,1,1,0,2Z"/><path d="M31.06,29h-26a1,1,0,0,1,0-2h26a1,1,0,1,1,0,2Z"/><path d="M5.56,22.54a1,1,0,0,1-.7-1.71L7.68,18,4.86,15.17a1,1,0,0,1,0-1.41,1,1,0,0,1,1.41,0L10.51,18,6.27,22.24A1,1,0,0,1,5.56,22.54Z"/>',
};
export const indentIconName = 'indent';
export const indentIcon: IconShapeTuple = [indentIconName, renderIcon(icon)];
``` | /content/code_sandbox/packages/core/src/icon/shapes/indent.ts | xml | 2016-09-29T17:24:17 | 2024-08-11T17:06:15 | clarity | vmware-archive/clarity | 6,431 | 419 |
```xml
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"path_to_url">
<refentry id="flatpak-search">
<refentryinfo>
<title>flatpak search</title>
<productname>flatpak</productname>
<authorgroup>
<author>
<contrib>Developer</contrib>
<firstname>Patrick</firstname>
<surname>Griffis</surname>
<email>tingping@tingping.se</email>
</author>
</authorgroup>
</refentryinfo>
<refmeta>
<refentrytitle>flatpak search</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
<refnamediv>
<refname>flatpak-search</refname>
<refpurpose>Search for applications and runtimes</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>flatpak search</command>
<arg choice="plain">TEXT</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Searches for applications and runtimes matching
<arg choice="plain">TEXT</arg>. Note that this uses appstream data
that can be updated with the <command>flatpak update</command> command.
The appstream data is updated automatically only if it's at least a day old.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<para>The following options are understood:</para>
<variablelist>
<varlistentry>
<term><option>-u</option></term>
<term><option>--user</option></term>
<listitem><para>
Only search through remotes in the per-user installation.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--system</option></term>
<listitem><para>
Only search through remotes in the default system-wide installation.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--installation=NAME</option></term>
<listitem><para>
Show a system-wide installation by <arg choice="plain">NAME</arg> among
those defined in <filename>/etc/flatpak/installations.d/</filename>.
Using <option>--installation=default</option> is equivalent to using
<option>--system</option>.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-h</option></term>
<term><option>--help</option></term>
<listitem><para>
Show help options and exit.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option></term>
<term><option>--verbose</option></term>
<listitem><para>
Print debug information during command processing.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--ostree-verbose</option></term>
<listitem><para>
Print OSTree debug information during command processing.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--columns=FIELD,</option></term>
<listitem><para>
Specify what information to show about each result. You can
list multiple fields, or use this option multiple times.
</para><para>
Append :s[tart], :m[iddle], :e[nd] or :f[ull] to column
names to change ellipsization.
</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Fields</title>
<para>The following fields are understood by the <option>--columns</option> option:</para>
<variablelist>
<varlistentry>
<term>name</term>
<listitem><para>
Show the name
</para></listitem>
</varlistentry>
<varlistentry>
<term>description</term>
<listitem><para>
Show the description
</para></listitem>
</varlistentry>
<varlistentry>
<term>application</term>
<listitem><para>
Show the application ID
</para></listitem>
</varlistentry>
<varlistentry>
<term>version</term>
<listitem><para>
Show the version
</para></listitem>
</varlistentry>
<varlistentry>
<term>branch</term>
<listitem><para>
Show the branch
</para></listitem>
</varlistentry>
<varlistentry>
<term>remotes</term>
<listitem><para>
Show the remotes
</para></listitem>
</varlistentry>
<varlistentry>
<term>all</term>
<listitem><para>
Show all columns
</para></listitem>
</varlistentry>
<varlistentry>
<term>help</term>
<listitem><para>
Show the list of available columns
</para></listitem>
</varlistentry>
</variablelist>
<para>
Note that field names can be abbreviated to a unique prefix.
</para>
</refsect1>
<refsect1>
<title>See also</title>
<para>
<citerefentry><refentrytitle>flatpak</refentrytitle><manvolnum>1</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>
``` | /content/code_sandbox/doc/flatpak-search.xml | xml | 2016-05-19T14:19:21 | 2024-08-16T16:20:45 | flatpak | flatpak/flatpak | 4,157 | 1,336 |
```xml
// Components
import React, {PureComponent} from 'react'
import {connect} from 'react-redux'
// Libraries
import _ from 'lodash'
import {Link} from 'react-router'
// Components
import AlertsTableRow from 'src/alerts/components/AlertsTableRow'
import InfiniteScroll from 'src/shared/components/InfiniteScroll'
import SearchBar from 'src/alerts/components/SearchBar'
// Constants
import {ALERTS_TABLE} from 'src/alerts/constants/tableSizing'
// Types
import {Alert} from 'src/types/alerts'
import {Source, TimeZones} from 'src/types'
// Decorators
import {ErrorHandling} from 'src/shared/decorators/errors'
enum Direction {
ASC = 'asc',
DESC = 'desc',
NONE = 'none',
}
interface OwnProps {
alerts: Alert[]
source: Source
shouldNotBeFilterable: boolean
limit: number
isAlertsMaxedOut: boolean
alertsCount: number
onGetMoreAlerts: () => void
}
interface StateProps {
timeZone: TimeZones
}
interface State {
searchTerm: string
filteredAlerts: Alert[]
sortDirection: Direction
sortKey: string
}
type Props = OwnProps & StateProps
class AlertsTable extends PureComponent<Props, State> {
constructor(props) {
super(props)
this.state = {
searchTerm: '',
filteredAlerts: this.props.alerts,
sortDirection: Direction.NONE,
sortKey: '',
}
}
public UNSAFE_componentWillReceiveProps(newProps) {
this.filterAlerts(this.state.searchTerm, newProps.alerts)
}
public render() {
const {
shouldNotBeFilterable,
limit,
onGetMoreAlerts,
isAlertsMaxedOut,
alertsCount,
} = this.props
return shouldNotBeFilterable ? (
<div className="alerts-widget">
{this.renderTable()}
{limit && alertsCount ? (
<button
className="btn btn-sm btn-default btn-block"
onClick={onGetMoreAlerts}
disabled={isAlertsMaxedOut}
style={{marginBottom: '20px'}}
>
{isAlertsMaxedOut
? `All ${alertsCount} Alerts displayed`
: 'Load next 30 Alerts'}
</button>
) : null}
</div>
) : (
<div className="panel">
<div className="panel-heading">
<h2 className="panel-title">{this.props.alerts.length} Alerts</h2>
{this.props.alerts.length ? (
<SearchBar onSearch={this.filterAlerts} />
) : null}
</div>
<div className="panel-body">{this.renderTable()}</div>
</div>
)
}
private filterAlerts = (searchTerm: string, newAlerts?: Alert[]): void => {
const alerts = newAlerts || this.props.alerts
const filterText = searchTerm.toLowerCase()
const filteredAlerts = alerts.filter(({name, host, level}) => {
return (
(name && name.toLowerCase().includes(filterText)) ||
(host && host.toLowerCase().includes(filterText)) ||
(level && level.toLowerCase().includes(filterText))
)
})
this.setState({searchTerm, filteredAlerts})
}
private changeSort = (key: string): (() => void) => (): void => {
// if we're using the key, reverse order; otherwise, set it with ascending
if (this.state.sortKey === key) {
const reverseDirection: Direction =
this.state.sortDirection === Direction.ASC
? Direction.DESC
: Direction.ASC
this.setState({sortDirection: reverseDirection})
} else {
this.setState({sortKey: key, sortDirection: Direction.ASC})
}
}
private sortableClasses = (key: string): string => {
if (this.state.sortKey === key) {
if (this.state.sortDirection === Direction.ASC) {
return 'alert-history-table--th sortable-header sorting-ascending'
}
return 'alert-history-table--th sortable-header sorting-descending'
}
return 'alert-history-table--th sortable-header'
}
private sort = (
alerts: Alert[],
key: string,
direction: Direction
): Alert[] => {
switch (direction) {
case Direction.ASC:
return _.sortBy<Alert>(alerts, e => e[key])
case Direction.DESC:
return _.sortBy<Alert>(alerts, e => e[key]).reverse()
default:
return alerts
}
}
private renderTable(): JSX.Element {
const {
source: {id},
timeZone,
} = this.props
const alerts = this.sort(
this.state.filteredAlerts,
this.state.sortKey,
this.state.sortDirection
)
const {colName, colLevel, colTime, colHost, colValue} = ALERTS_TABLE
return this.props.alerts.length ? (
<div className="alert-history-table">
<div className="alert-history-table--thead">
<div
onClick={this.changeSort('name')}
className={this.sortableClasses('name')}
style={{width: colName}}
>
Name <span className="icon caret-up" />
</div>
<div
onClick={this.changeSort('level')}
className={this.sortableClasses('level')}
style={{width: colLevel}}
>
Level <span className="icon caret-up" />
</div>
<div
onClick={this.changeSort('time')}
className={this.sortableClasses('time')}
style={{width: colTime}}
>
Time ({timeZone})<span className="icon caret-up" />
</div>
<div
onClick={this.changeSort('host')}
className={this.sortableClasses('host')}
style={{width: colHost}}
>
Host <span className="icon caret-up" />
</div>
<div
onClick={this.changeSort('value')}
className={this.sortableClasses('value')}
style={{width: colValue}}
>
Value <span className="icon caret-up" />
</div>
</div>
<InfiniteScroll
className="alert-history-table--tbody"
itemHeight={25}
items={alerts.map((alert, i) => (
<div className="alert-history-table--tr" key={i}>
<AlertsTableRow sourceID={id} {...alert} timeZone={timeZone} />
</div>
))}
/>
</div>
) : (
this.renderTableEmpty()
)
}
private renderTableEmpty(): JSX.Element {
const {
source: {id},
shouldNotBeFilterable,
} = this.props
return shouldNotBeFilterable ? (
<div className="graph-empty">
<p>
Learn how to configure your first <strong>Rule</strong> in
<br />
the <em>Getting Started</em> guide
</p>
</div>
) : (
<div className="generic-empty-state">
<h4 className="no-user-select">There are no Alerts to display</h4>
<br />
<h6 className="no-user-select">
Try changing the Time Range or
<Link
style={{marginLeft: '10px'}}
to={`/sources/${id}/alert-rules/new`}
className="btn btn-primary btn-sm"
>
Create an Alert Rule
</Link>
</h6>
</div>
)
}
}
const mstp = ({app}) => ({
timeZone: app.persisted.timeZone,
})
export default connect(mstp, null)(ErrorHandling(AlertsTable))
``` | /content/code_sandbox/ui/src/alerts/components/AlertsTable.tsx | xml | 2016-08-24T23:28:56 | 2024-08-13T19:50:03 | chronograf | influxdata/chronograf | 1,494 | 1,691 |
```xml
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Volo.ClientSimulation.Web</AssemblyName>
<PackageId>Volo.ClientSimulation.Web</PackageId>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<RootNamespace>Volo.ClientSimulation</RootNamespace>
<TypeScriptToolsVersion>2.8</TypeScriptToolsVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel.Web\Volo.Abp.Http.Client.IdentityModel.Web.csproj" />
<ProjectReference Include="..\Volo.ClientSimulation\Volo.ClientSimulation.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\**\*.js" />
<EmbeddedResource Include="Pages\**\*.css" />
<EmbeddedResource Include="Pages\**\*.scss" />
<EmbeddedResource Include="Components\**\*.js" />
<EmbeddedResource Include="Components\**\*.css" />
<EmbeddedResource Include="Components\**\*.scss" />
<Content Remove="Pages\**\*.js" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.scss" />
<Content Remove="Components\**\*.js" />
<Content Remove="Components\**\*.css" />
<Content Remove="Components\**\*.scss" />
<Content Remove="compilerconfig.json" />
<None Include="compilerconfig.json" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/modules/client-simulation/src/Volo.ClientSimulation.Web/Volo.ClientSimulation.Web.csproj | xml | 2016-12-03T22:56:24 | 2024-08-16T16:24:05 | abp | abpframework/abp | 12,657 | 429 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug|Win32">
<Configuration>debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="checked|Win32">
<Configuration>checked</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="profile|Win32">
<Configuration>profile</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release|Win32">
<Configuration>release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{85514BB1-43A6-1265-D4FB-DAFC843D2497}</ProjectGuid>
<RootNamespace>SnippetContactModification</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetContactModification/debug\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)DEBUG</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/LIBPATH:../../../Lib/vc14win32 PhysX3CommonDEBUG_x86.lib PhysX3DEBUG_x86.lib PhysX3CookingDEBUG_x86.lib PhysX3CharacterKinematicDEBUG_x86.lib PhysX3ExtensionsDEBUG.lib PhysX3VehicleDEBUG.lib PxPvdSDKDEBUG_x86.lib PxTaskDEBUG_x86.lib PxFoundationDEBUG_x86.lib PsFastXmlDEBUG_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsDEBUG.lib /DEBUG</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)DEBUG.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationDEBUG_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKDEBUG_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetContactModification/checked\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)CHECKED</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/LIBPATH:../../../Lib/vc14win32 PhysX3CommonCHECKED_x86.lib PhysX3CHECKED_x86.lib PhysX3CookingCHECKED_x86.lib PhysX3CharacterKinematicCHECKED_x86.lib PhysX3ExtensionsCHECKED.lib PhysX3VehicleCHECKED.lib PxPvdSDKCHECKED_x86.lib PxTaskCHECKED_x86.lib PxFoundationCHECKED_x86.lib PsFastXmlCHECKED_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsCHECKED.lib</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)CHECKED.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationCHECKED_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKCHECKED_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetContactModification/profile\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)PROFILE</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win32 PhysX3CommonPROFILE_x86.lib PhysX3PROFILE_x86.lib PhysX3CookingPROFILE_x86.lib PhysX3CharacterKinematicPROFILE_x86.lib PhysX3ExtensionsPROFILE.lib PhysX3VehiclePROFILE.lib PxPvdSDKPROFILE_x86.lib PxTaskPROFILE_x86.lib PxFoundationPROFILE_x86.lib PsFastXmlPROFILE_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsPROFILE.lib /DEBUG</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)PROFILE.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationPROFILE_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKPROFILE_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetContactModification/release\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win32 PhysX3Common_x86.lib PhysX3_x86.lib PhysX3Cooking_x86.lib PhysX3CharacterKinematic_x86.lib PhysX3Extensions.lib PhysX3Vehicle.lib PxPvdSDK_x86.lib PxTask_x86.lib PxFoundation_x86.lib PsFastXml_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtils.lib</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundation_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDK_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\SnippetCommon\ClassicMain.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\SnippetContactModification\SnippetContactModification.cpp">
</ClCompile>
<ClCompile Include="..\..\SnippetContactModification\SnippetContactModificationRender.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="./SnippetUtils.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="./SnippetRender.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"></ImportGroup>
</Project>
``` | /content/code_sandbox/PhysX_3.4/Snippets/compiler/vc14win32/SnippetContactModification.vcxproj | xml | 2016-10-12T16:34:31 | 2024-08-16T09:40:38 | PhysX-3.4 | NVIDIAGameWorks/PhysX-3.4 | 2,343 | 4,845 |
```xml
import { vi } from 'vitest';
import * as useNotificationsModule from '@proton/components/hooks/useNotifications';
export const mockUseNotifications = (value?: Partial<ReturnType<typeof useNotificationsModule.default>>) => {
const mockedUseNotifications = vi.spyOn(useNotificationsModule, 'default');
mockedUseNotifications.mockReturnValue({
setOffset: vi.fn(),
removeDuplicate: vi.fn(),
createNotification: vi.fn(),
removeNotification: vi.fn(),
hideNotification: vi.fn(),
clearNotifications: vi.fn(),
...value,
});
return mockedUseNotifications;
};
``` | /content/code_sandbox/packages/testing/lib/vitest/mockUseNotifications.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 123 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.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="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A541B6F3-BA9B-47B6-8EE3-DC59FA0AD0BD}</ProjectGuid>
<RootNamespace>NanobenchmarkExample</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<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|x64'">
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)\..</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)\..</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\highwayhash\arch_specific.cc" />
<ClCompile Include="..\highwayhash\nanobenchmark.cc" />
<ClCompile Include="..\highwayhash\nanobenchmark_example.cc" />
<ClCompile Include="..\highwayhash\os_specific.cc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\highwayhash\arch_specific.h" />
<ClInclude Include="..\highwayhash\nanobenchmark.h" />
<ClInclude Include="..\highwayhash\os_specific.h" />
<ClInclude Include="..\highwayhash\tsc_timer.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/msvc/NanobenchmarkExample.vcxproj | xml | 2016-02-17T16:29:40 | 2024-08-16T17:15:04 | highwayhash | google/highwayhash | 1,516 | 1,619 |
```xml
import { Component } from '@angular/core';
import { Code } from '@domain/code';
@Component({
selector: 'sample-doc',
template: `
<app-docsectiontext>
<p>A sample UI implementation with templating and additional elements.</p>
</app-docsectiontext>
<div class="card flex justify-content-center">
<div class="flex flex-column align-items-center">
<div class="font-bold text-xl mb-2">Authenticate Your Account</div>
<p class="text-color-secondary block mb-5">Please enter the code sent to your phone.</p>
<p-inputOtp [(ngModel)]="value" [length]="6" style="gap: 0">
<ng-template pTemplate="input" let-token let-events="events" let-index="index">
<input pInputText type="text" [maxLength]="1" (input)="events.input($event)" (keydown)="events.keydown($event)" [attr.value]="token" class="custom-otp-input" />
<div *ngIf="index === 3" class="px-3">
<i class="pi pi-minus"></i>
</div>
</ng-template>
</p-inputOtp>
<div class="flex justify-content-between mt-5 align-self-stretch">
<p-button label="Resend Code" [link]="true" class="p-0" />
<p-button label="Submit Code" />
</div>
</div>
</div>
<app-code [code]="code" selector="input-otp-sample-demo"></app-code>
`,
styles: [
`
.custom-otp-input {
width: 48px;
height: 48px;
font-size: 24px;
appearance: none;
text-align: center;
transition: all 0.2s;
border-radius: 0;
border: 1px solid var(--surface-400);
background: transparent;
outline-offset: -2px;
outline-color: transparent;
border-right: 0 none;
transition: outline-color 0.3s;
color: var(--text-color);
}
.custom-otp-input:focus {
outline: 2px solid var(--primary-color);
}
.custom-otp-input:first-child,
.custom-otp-input:nth-child(5) {
border-top-left-radius: 12px;
border-bottom-left-radius: 12px;
}
.custom-otp-input:nth-child(3),
.custom-otp-input:last-child {
border-top-right-radius: 12px;
border-bottom-right-radius: 12px;
border-right-width: 1px;
border-right-style: solid;
border-color: var(--surface-400);
}
`
]
})
export class SampleDoc {
value: any;
code: Code = {
basic: `<div class="flex flex-column align-items-center">
<div class="font-bold text-xl mb-2">Authenticate Your Account</div>
<p class="text-color-secondary block mb-5">Please enter the code sent to your phone.</p>
<p-inputOtp [(ngModel)]="value" [length]="6" style="gap: 0">
<ng-template pTemplate="input" let-token let-events="events" let-index="index">
<input
pInputText
type="text"
[maxLength]="1"
(input)="events.input($event)"
(keydown)="events.keydown($event)"
[attr.value]="token"
class="custom-otp-input" />
<div *ngIf="index === 3" class="px-3">
<i class="pi pi-minus"></i>
</div>
</ng-template>
</p-inputOtp>
<div class="flex justify-content-between mt-5 align-self-stretch">
<p-button label="Resend Code" [link]="true" class="p-0"/>
<p-button label="Submit Code"/>
</div>
</div>`,
html: `<div class="card flex justify-content-center">
<div class="flex flex-column align-items-center">
<div class="font-bold text-xl mb-2">Authenticate Your Account</div>
<p class="text-color-secondary block mb-5">Please enter the code sent to your phone.</p>
<p-inputOtp [(ngModel)]="value" [length]="6" style="gap: 0">
<ng-template pTemplate="input" let-token let-events="events" let-index="index">
<input
pInputText
type="text"
[maxLength]="1"
(input)="events.input($event)"
(keydown)="events.keydown($event)"
[attr.value]="token"
class="custom-otp-input" />
<div *ngIf="index === 3" class="px-3">
<i class="pi pi-minus"></i>
</div>
</ng-template>
</p-inputOtp>
<div class="flex justify-content-between mt-5 align-self-stretch">
<p-button label="Resend Code" [link]="true" class="p-0"/>
<p-button label="Submit Code"/>
</div>
</div>
</div>`,
typescript: `import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { InputOtpModule } from 'primeng/inputotp';
import { ButtonModule } from 'primeng/button';
@Component({
selector: 'input-otp-sample-demo',
templateUrl: './input-otp-sample-demo.html',
standalone: true,
imports: [FormsModule, InputOtpModule, ButtonModule],
styles: [
\`
.custom-otp-input {
width: 48px;
height: 48px;
font-size: 24px;
appearance: none;
text-align: center;
transition: all 0.2s;
border-radius: 0;
border: 1px solid var(--surface-400);
background: transparent;
outline-offset: -2px;
outline-color: transparent;
border-right: 0 none;
transition: outline-color 0.3s;
color: var(--text-color);
}
.custom-otp-input:focus {
outline: 2px solid var(--primary-color);
}
.custom-otp-input:first-child,
.custom-otp-input:nth-child(5) {
border-top-left-radius: 12px;
border-bottom-left-radius: 12px;
}
.custom-otp-input:nth-child(3),
.custom-otp-input:last-child {
border-top-right-radius: 12px;
border-bottom-right-radius: 12px;
border-right-width: 1px;
border-right-style: solid;
border-color: var(--surface-400);
}
\`
],
})
export class InputOtpSampleDemo {
value: any;
}`
};
}
``` | /content/code_sandbox/src/app/showcase/doc/inputotp/sampledoc.ts | xml | 2016-01-16T09:23:28 | 2024-08-16T19:58:20 | primeng | primefaces/primeng | 9,969 | 1,538 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
export {default as withErrorHandling} from './withErrorHandling';
export {DocsProvider, default as withDocs, DocsContext} from './withDocs';
export {UserProvider, default as withUser, UserContext} from './withUser';
export type {WithErrorHandlingProps} from './withErrorHandling';
export type {WithDocsProps} from './withDocs';
export type {WithUserProps, User} from './withUser';
``` | /content/code_sandbox/optimize/client/src/modules/HOC/index.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 117 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {BusinessObject} from 'bpmn-js/lib/NavigatedViewer';
const isProcessEndEvent = (businessObject: BusinessObject) => {
return (
businessObject.$type === 'bpmn:EndEvent' &&
businessObject?.$parent?.$type === 'bpmn:Process'
);
};
export {isProcessEndEvent};
``` | /content/code_sandbox/operate/client/src/modules/bpmn-js/utils/isProcessEndEvent.ts | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 105 |
```xml
<page id="map1" layout="column" description="Contains 4 boxes, to which 4 sources may be added">
<section layout="row" description="row 1">
<section id="box1"><placeholder id="box1source"/></section>
<section id="box2"><placeholder id="box2source"/></section>
</section>
<section layout="row" description="row 2">
<section id="box3"><placeholder id="box3source"/></section>
<section id="box4"><placeholder id="box4source"/></section>
</section>
<choice>
<map to="box1source box2source box3source box4source">
<source name="source1"/>
<source name="source2"/>
<source name="source3"/>
<source name="source4"/>
</map>
</choice>
</page>
``` | /content/code_sandbox/container-search/src/test/java/com/yahoo/search/pagetemplates/config/test/examples/mapexamples/map1.xml | xml | 2016-06-03T20:54:20 | 2024-08-16T15:32:01 | vespa | vespa-engine/vespa | 5,524 | 195 |
```xml
<vector xmlns:android="path_to_url" android:height="34.0dp" android:tint="?attr/colorControlNormal" android:viewportHeight="15" android:viewportWidth="15" android:width="34.0dp">
<path android:fillColor="@android:color/white" android:pathData="M9 8L9 10L11.5 10C11.78 10 12 10.22 12 10.5L12 14.5C12 14.78 11.78 15 11.5 15L3.5 15C3.22 15 3 14.78 3 14.5L3 10.5C3 10.22 3.22 10 3.5 10L6 10L6 8L0.5 8C0.22 8 0 7.78 0 7.5C0 7.22 0.22 7 0.5 7L3 7C1.9 7 1 6.1 1 5L1 2.29C1 1.26 1.78 0.4 2.8 0.3L2.8 0.3C4.73 0.1 6.46 0 8 0C9.54 0 11.27 0.1 13.2 0.3C14.22 0.4 15 1.26 15 2.29L15 6C15 7.1 14.1 8 13 8L9 8ZM5.5 4C5.78 4 6 3.78 6 3.5L6 2.5C6 2.22 5.78 2 5.5 2L3.5 2C3.22 2 3 2.22 3 2.5L3 3.5C3 3.78 3.22 4 3.5 4L5.5 4ZM12.5 4C12.78 4 13 3.78 13 3.5L13 2.5C13 2.22 12.78 2 12.5 2L8.5 2C8.22 2 8 2.22 8 2.5L8 3.5C8 3.78 8.22 4 8.5 4L12.5 4ZM7 11L5.69 11C5.55 11 5.44 11.11 5.44 11.25C5.44 11.32 5.47 11.39 5.53 11.44L7.34 12.96C7.43 13.04 7.57 13.04 7.66 12.96L9.47 11.44C9.58 11.35 9.59 11.2 9.5 11.09C9.46 11.03 9.39 11 9.31 11L8 11L8 6.5C8 6.22 7.78 6 7.5 6C7.22 6 7 6.22 7 6.5L7 11Z"/>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_preset_temaki_camper_trailer_dump.xml | xml | 2016-07-02T10:44:04 | 2024-08-16T18:55:54 | StreetComplete | streetcomplete/StreetComplete | 3,781 | 765 |
```xml
<remote_servers>
</remote_servers>
``` | /content/code_sandbox/tests/integration/test_config_corresponding_root/configs/config.d/bad.xml | xml | 2016-06-02T08:28:18 | 2024-08-16T18:39:33 | ClickHouse | ClickHouse/ClickHouse | 36,234 | 12 |
```xml
import React, { useCallback } from "react";
import { RQInput } from "lib/design-system/components";
import { Input } from "antd";
import { BottomSheetLayout, BottomSheetPlacement, BottomSheetProvider } from "componentsV2/BottomSheet";
import SessionViewerBottomSheet from "features/sessionBook/components/SessionViewerBottomSheet/SessionViewerBottomSheet";
import { useDispatch, useSelector } from "react-redux";
import { getSessionRecordingMetaData } from "store/features/session-recording/selectors";
import { sessionRecordingActions } from "store/features/session-recording/slice";
import { useDebounce } from "hooks/useDebounce";
import { trackDraftSessionNamed, trackSessionRecordingDescriptionUpdated } from "features/sessionBook/analytics";
import { isAppOpenedInIframe } from "utils/AppUtils";
import { SheetLayout } from "componentsV2/BottomSheet/types";
import "./draftSessionDetailsPanel.scss";
interface DraftSessionDetailsPanelProps {
playerTimeOffset: number;
}
const DraftSessionDetailsPanel: React.FC<DraftSessionDetailsPanelProps> = ({ playerTimeOffset }) => {
const dispatch = useDispatch();
const metadata = useSelector(getSessionRecordingMetaData);
const isOpenedInIframe = isAppOpenedInIframe();
const debouncedTrackDescriptionUpdated = useDebounce(trackSessionRecordingDescriptionUpdated, 1000);
const desbouncedTrackNameUpdated = useDebounce(trackDraftSessionNamed, 1000);
const handleSessionNameChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
dispatch(sessionRecordingActions.setName(e.target.value));
debouncedTrackDescriptionUpdated();
},
[dispatch, debouncedTrackDescriptionUpdated]
);
const handleSessionDescriptionChange = useCallback(
(e: React.ChangeEvent<HTMLTextAreaElement>) => {
dispatch(sessionRecordingActions.setDescription(e.target.value));
desbouncedTrackNameUpdated();
},
[dispatch, desbouncedTrackNameUpdated]
);
return (
<BottomSheetProvider defaultPlacement={BottomSheetPlacement.BOTTOM}>
<div className="session-details-panel-wrapper">
<BottomSheetLayout
layout={SheetLayout.DRAWER}
hideBottomSheet={isOpenedInIframe}
initialOffset={-390}
bottomSheet={<SessionViewerBottomSheet playerTimeOffset={playerTimeOffset} disableDocking />}
>
<div className="session-details-panel-container">
<div>
<label className="session-details-label">Name</label>
<RQInput
className="session-details-input"
value={metadata?.name || ""}
placeholder="Enter session name"
onChange={handleSessionNameChange}
/>
</div>
<div className="mt-16">
<label className="session-details-label">Description</label>
<Input.TextArea
className="session-details-textarea"
rows={4}
value={metadata?.description || ""}
placeholder="Enter session description"
onChange={handleSessionDescriptionChange}
/>
</div>
</div>
</BottomSheetLayout>
</div>
</BottomSheetProvider>
);
};
export default React.memo(DraftSessionDetailsPanel);
``` | /content/code_sandbox/app/src/features/sessionBook/screens/DraftSessionScreen/components/DraftSessionDetailsPanel/DraftSessionDetailsPanel.tsx | xml | 2016-12-01T04:36:06 | 2024-08-16T19:12:19 | requestly | requestly/requestly | 2,121 | 662 |
```xml
import {createKeyboardEvent} from '../testing/private';
import {hasModifierKey} from './modifiers';
describe('keyboard modifiers', () => {
it('should check whether the alt key is pressed', () => {
const event = createKeyboardEvent('keydown', 0);
const altEvent = createKeyboardEvent('keydown', 0, '', {alt: true});
expect(hasModifierKey(event)).toBe(false);
expect(hasModifierKey(altEvent)).toBe(true);
});
it('should check whether the shift key is pressed', () => {
const event = createKeyboardEvent('keydown', 0);
const shiftEvent = createKeyboardEvent('keydown', 0, '', {shift: true});
expect(hasModifierKey(event)).toBe(false);
expect(hasModifierKey(shiftEvent)).toBe(true);
});
it('should check whether the meta key is pressed', () => {
const event = createKeyboardEvent('keydown', 0);
const metaEvent = createKeyboardEvent('keydown', 0, '', {meta: true});
expect(hasModifierKey(event)).toBe(false);
expect(hasModifierKey(metaEvent)).toBe(true);
});
it('should check whether the ctrl key is pressed', () => {
const event = createKeyboardEvent('keydown', 0);
const ctrlEvent = createKeyboardEvent('keydown', 0, '', {control: true});
expect(hasModifierKey(event)).toBe(false);
expect(hasModifierKey(ctrlEvent)).toBe(true);
});
it('should check if a particular modifier key is pressed', () => {
const ctrlEvent = createKeyboardEvent('keydown', 0, '', {control: true});
const ctrlAltEvent = createKeyboardEvent('keydown', 0, '', {control: true, alt: true});
expect(hasModifierKey(ctrlEvent, 'altKey')).toBe(false);
expect(hasModifierKey(ctrlAltEvent, 'altKey')).toBe(true);
});
it('should check if multiple specific modifier keys are pressed', () => {
const ctrlEvent = createKeyboardEvent('keydown', 0, '', {control: true});
const ctrlAltShiftEvent = createKeyboardEvent('keydown', 0, '', {
control: true,
alt: true,
shift: true,
});
expect(hasModifierKey(ctrlEvent, 'altKey', 'shiftKey')).toBe(false);
expect(hasModifierKey(ctrlAltShiftEvent, 'altKey', 'shiftKey')).toBe(true);
});
});
``` | /content/code_sandbox/src/cdk/keycodes/modifiers.spec.ts | xml | 2016-01-04T18:50:02 | 2024-08-16T11:21:13 | components | angular/components | 24,263 | 523 |
```xml
import { type PackageSnapshot } from '@pnpm/lockfile.types'
import * as dp from '@pnpm/dependency-path'
import { type PkgResolutionId } from '@pnpm/types'
export interface NameVer {
name: string
peersSuffix: string | undefined
version: string
nonSemverVersion?: PkgResolutionId
}
export function nameVerFromPkgSnapshot (
depPath: string,
pkgSnapshot: PackageSnapshot
): NameVer {
const pkgInfo = dp.parse(depPath)
return {
name: pkgInfo.name as string,
peersSuffix: pkgInfo.peersSuffix,
version: pkgSnapshot.version ?? pkgInfo.version as string,
nonSemverVersion: pkgInfo.nonSemverVersion,
}
}
``` | /content/code_sandbox/lockfile/utils/src/nameVerFromPkgSnapshot.ts | xml | 2016-01-28T07:40:43 | 2024-08-16T12:38:47 | pnpm | pnpm/pnpm | 28,869 | 164 |
```xml
import React, { useState } from 'react';
import { useSelector } from 'react-redux';
import { getOSSFileUrl } from '../utils/uploadFile';
import Dialog from '../components/Dialog';
import Avatar from '../components/Avatar';
import Button from '../components/Button';
import { State } from '../state/reducer';
import useAction from '../hooks/useAction';
import { joinGroup, getLinkmanHistoryMessages } from '../service';
import Style from './InfoDialog.less';
interface GroupInfoProps {
visible: boolean;
group?: {
_id: string;
name: string;
avatar: string;
members: number;
};
onClose: () => void;
}
function GroupInfo(props: GroupInfoProps) {
const { visible, onClose, group } = props;
const action = useAction();
const hasLinkman = useSelector(
(state: State) => !!state.linkmans[group?._id as string],
);
const [largerAvatar, toggleLargetAvatar] = useState(false);
if (!group) {
return null;
}
async function handleJoinGroup() {
onClose();
if (!group) {
return;
}
const groupRes = await joinGroup(group._id);
if (groupRes) {
groupRes.type = 'group';
action.addLinkman(groupRes, true);
const messages = await getLinkmanHistoryMessages(group._id, 0);
if (messages) {
action.addLinkmanHistoryMessages(group._id, messages);
}
}
}
function handleFocusGroup() {
onClose();
if (!group) {
return;
}
action.setFocus(group._id);
}
return (
<Dialog
className={Style.infoDialog}
visible={visible}
onClose={onClose}
>
<div className={Style.coantainer}>
<div className={Style.header}>
<Avatar
size={60}
src={group.avatar}
onMouseEnter={() => toggleLargetAvatar(true)}
onMouseLeave={() => toggleLargetAvatar(false)}
/>
<img
className={`${Style.largeAvatar} ${
largerAvatar ? 'show' : 'hide'
}`}
src={getOSSFileUrl(group.avatar)}
alt=""
/>
<p>{group.name}</p>
</div>
<div className={Style.info}>
<div className={Style.onlineStatus}>
<p className={Style.onlineText}>:</p>
<div>{group.members}</div>
</div>
{hasLinkman ? (
<Button onClick={handleFocusGroup}></Button>
) : (
<Button onClick={handleJoinGroup}></Button>
)}
</div>
</div>
</Dialog>
);
}
export default GroupInfo;
``` | /content/code_sandbox/packages/web/src/modules/GroupInfo.tsx | xml | 2016-02-15T14:47:58 | 2024-08-14T13:07:55 | fiora | yinxin630/fiora | 6,485 | 596 |
```xml
/**
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { registerCodeHighlighting } from '@lexical/code'
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
import { useEffect } from 'react'
export default function CodeHighlightPlugin(): JSX.Element | null {
const [editor] = useLexicalComposerContext()
useEffect(() => {
return registerCodeHighlighting(editor)
}, [editor])
return null
}
``` | /content/code_sandbox/packages/web/src/javascripts/Components/SuperEditor/Plugins/CodeHighlightPlugin/index.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 116 |
```xml
import "reflect-metadata"
import {
closeTestingConnections,
createTestingConnections,
reloadTestingDatabases,
} from "../../utils/test-utils"
import { DataSource } from "../../../src/data-source/DataSource"
import { ObjectLiteral } from "../../../src/common/ObjectLiteral"
import { expect } from "chai"
import { Post } from "./entity/Post"
import { DateUtils } from "../../../src/util/DateUtils"
describe("github issues > #513 Incorrect time/datetime types for SQLite", () => {
let connections: DataSource[]
before(
async () =>
(connections = await createTestingConnections({
entities: [__dirname + "/entity/*{.js,.ts}"],
enabledDrivers: ["sqlite", "better-sqlite3"],
})),
)
beforeEach(() => reloadTestingDatabases(connections))
after(() => closeTestingConnections(connections))
it("should create datetime column type for datetime in sqlite", () =>
Promise.all(
connections.map(async (connection) => {
const dbColumns: ObjectLiteral[] =
await connection.manager.query("PRAGMA table_info(Post)")
expect(dbColumns).not.to.be.null
expect(dbColumns).not.to.be.undefined
let columnType: string = ""
dbColumns.map((dbColumn) => {
if (dbColumn["name"] === "dateTimeColumn") {
columnType = dbColumn["type"]
}
})
// Expect "datetime" type to translate to SQLite affinity type "DATETIME"
columnType.should.equal("datetime")
}),
))
it("should persist correct type in datetime column in sqlite", () =>
Promise.all(
connections.map(async (connection) => {
const now: Date = new Date()
const post: Post = new Post()
post.id = 1
post.dateTimeColumn = now
await connection.manager.save(post)
const storedPost = await connection.manager.findOne(Post, {
where: {
id: post.id,
},
})
expect(storedPost).to.not.be.null
storedPost!.dateTimeColumn
.toDateString()
.should.equal(now.toDateString())
}),
))
it("should create datetime column type for time in sqlite", () =>
Promise.all(
connections.map(async (connection) => {
const dbColumns: ObjectLiteral[] =
await connection.manager.query("PRAGMA table_info(Post)")
expect(dbColumns).not.to.be.null
expect(dbColumns).not.to.be.undefined
let columnType: string = ""
dbColumns.map((dbColumn) => {
if (dbColumn["name"] === "timeColumn") {
columnType = dbColumn["type"]
}
})
// Expect "time" type to translate to SQLite type "TEXT"
columnType.should.equal("time")
}),
))
it("should persist correct type in datetime column in sqlite", () =>
Promise.all(
connections.map(async (connection) => {
const now: Date = new Date()
const post: Post = new Post()
post.id = 2
post.timeColumn = now // Should maybe use Date type?
await connection.manager.save(post)
const storedPost = await connection.manager.findOne(Post, {
where: {
id: post.id,
},
})
expect(storedPost).to.not.be.null
const expectedTimeString = DateUtils.mixedTimeToString(
now.getHours() +
":" +
now.getMinutes() +
":" +
now.getSeconds(),
)
storedPost!.timeColumn
.toString()
.should.equal(expectedTimeString)
}),
))
})
``` | /content/code_sandbox/test/github-issues/513/issue-513.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 761 |
```xml
//
//
// path_to_url
//
// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
// snippet-start:[cdk.typescript.hello-cdk]
import * as core from "@aws-cdk/core";
import { HelloCdkStack } from "../lib/hello-cdk-stack";
const app = new core.App();
new HelloCdkStack(app, "HelloCdkStack");
// snippet-end:[cdk.typescript.hello-cdk]
``` | /content/code_sandbox/resources/cdk/legacy/basic-s3-bucket/hello-cdk.ts | xml | 2016-08-18T19:06:57 | 2024-08-16T18:59:44 | aws-doc-sdk-examples | awsdocs/aws-doc-sdk-examples | 9,298 | 101 |
```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 getOwnPropertyNames = require( './index' );
// TESTS //
// The function returns an array of strings...
{
getOwnPropertyNames( { 'beep': 'boop', 'foo': 3.14 } ); // $ExpectType string[]
}
// The compiler throws an error if the function is provided an incorrect number of arguments...
{
getOwnPropertyNames(); // $ExpectError
getOwnPropertyNames( [], 2 ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/utils/property-names/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 145 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
xmlns="path_to_url"
xmlns:flowable="path_to_url"
targetNamespace="Examples">
<process id="boundaryConditionalOnEmbeddedSubprocess">
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="subprocess" />
<subProcess id="subprocess">
<startEvent id="subprocessStart" />
<sequenceFlow id="subFlow1" sourceRef="subprocessStart" targetRef="subprocessTask" />
<userTask id="subprocessTask" name="subprocessTask" />
<sequenceFlow id="subFlow2" sourceRef="subprocessTask" targetRef="subprocessEnd" />
<endEvent id="subprocessEnd" />
</subProcess>
<sequenceFlow id="flow3" sourceRef="subprocess" targetRef="theEnd" />
<boundaryEvent id="catchConditional" cancelActivity="false" attachedToRef="subprocess">
<conditionalEventDefinition>
<condition>${myVar == 'test'}</condition>
</conditionalEventDefinition>
</boundaryEvent>
<sequenceFlow id="flow2" sourceRef="catchConditional" targetRef="taskAfterConditionalCatch" />
<userTask id="taskAfterConditionalCatch" />
<sequenceFlow id="flow4" sourceRef="taskAfterConditionalCatch" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
</definitions>
``` | /content/code_sandbox/modules/flowable-engine/src/test/resources/org/flowable/engine/test/bpmn/event/conditional/BoundaryConditionalEventTest.testCatchNonInterruptingConditionalOnEmbeddedSubprocess.bpmn20.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 352 |
```xml
import React from 'react';
import { List, Heading, Box } from 'native-base';
export const Example = () => {
const [defaultColor, setDefaultColor] = React.useState('primary.400');
return (
<Box w="80%">
<Heading
px={2}
py={4}
bg={defaultColor}
fontSize={24}
color={defaultColor === 'primary.400' ? 'white' : 'gray.800'}
>
Default Theme Color (Pressable List Items)
</Heading>
<List my={2} py={0}>
<List.Item
_text={{ color: 'white' }}
py={4}
bg="primary.400"
onPress={() => setDefaultColor('primary.400')}
>
primary.400
</List.Item>
<List.Item
py={4}
bg="secondary.400"
onPress={() => setDefaultColor('secondary.400')}
>
secondary.400
</List.Item>
<List.Item
py={4}
bg="emerald.400"
onPress={() => setDefaultColor('emerald.400')}
>
emerald.400
</List.Item>
<List.Item
py={4}
bg="blue.400"
onPress={() => setDefaultColor('blue.400')}
>
blue.400
</List.Item>
</List>
</Box>
);
};
``` | /content/code_sandbox/example/storybook/stories/components/primitives/List/PressableList.tsx | xml | 2016-04-15T11:37:23 | 2024-08-14T16:16:44 | NativeBase | GeekyAnts/NativeBase | 20,132 | 316 |
```xml
import { Component } from "@angular/core";
@Component({
selector: "app-logo-cnet",
templateUrl: "logo-cnet.component.html",
})
export class LogoCnetComponent {}
``` | /content/code_sandbox/apps/web/src/app/auth/trial-initiation/content/logo-cnet.component.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 39 |
```xml
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="path_to_url"
xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<route id="myroute"></route>
</routes>
``` | /content/code_sandbox/samples/development-frameworks/laravel/vendor/symfony/routing/Tests/Fixtures/missing_path.xml | xml | 2016-03-11T21:42:56 | 2024-08-16T09:31:00 | sql-server-samples | microsoft/sql-server-samples | 9,855 | 59 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../Resources.resx">
<body>
<trans-unit id="Baseline">
<source>[Baseline]</source>
<target state="translated">[Base de referencia]</target>
<note />
</trans-unit>
<trans-unit id="BaselineTargetFrameworkIgnoredButPresentInCurrentPackage">
<source>Target framework '{0}' in the baseline package is ignored but exists in the current package.</source>
<target state="new">Target framework '{0}' in the baseline package is ignored but exists in the current package.</target>
<note />
</trans-unit>
<trans-unit id="BaselineTargetFrameworksIgnored">
<source>Target frameworks '{0}' were ignored from the baseline package.</source>
<target state="new">Target frameworks '{0}' were ignored from the baseline package.</target>
<note />
</trans-unit>
<trans-unit id="EmptyPackagePath">
<source>Package path is empty. Please provide a valid package path.</source>
<target state="translated">La ruta de acceso del paquete est vaca. Proporcione una ruta de acceso del paquete vlida.</target>
<note />
</trans-unit>
<trans-unit id="MissingSearchDirectory">
<source>Could not find a reference directory in the provided directories for TargetFramework '{0}' when loading '{1}'. For more information see: path_to_url
<target state="translated">No se ha encontrado un directorio de referencia en los directorios proporcionados para TargetFramework '{0}' al cargar '{1}'. Para obtener ms informacin, consulte: path_to_url
<note />
</trans-unit>
<trans-unit id="MissingTargetFramework">
<source>Target framework {0} is no longer supported in the latest version.</source>
<target state="translated">La plataforma de destino {0} ya no se admite en la ltima versin.</target>
<note />
</trans-unit>
<trans-unit id="MissingTargetFrameworkAndRid">
<source>Target framework {0} and runtime identifier (RID) {1} is no longer supported in the latest version.</source>
<target state="translated">La plataforma de destino {0} y el identificador de entorno de ejecucin (RID) {1} ya no se admiten en la ltima versin.</target>
<note />
</trans-unit>
<trans-unit id="NoCompatibleCompileTimeAsset">
<source>Target framework {0} does not have a compatible compile time asset in the package.</source>
<target state="translated">La plataforma de destino {0} no tiene un activo de tiempo de compilacin compatible en el paquete.</target>
<note />
</trans-unit>
<trans-unit id="NoCompatibleRidSpecificRuntimeAsset">
<source>Target framework {0}-{1} does not have a compatible runtime asset in the package.</source>
<target state="translated">La plataforma de destino {0}-{1} no tiene un activo en tiempo de ejecucin compatible en el paquete.</target>
<note />
</trans-unit>
<trans-unit id="NoCompatibleRuntimeAsset">
<source>Target framework {0} does not have a compatible runtime asset in the package.</source>
<target state="translated">La plataforma de destino {0} no tiene un activo en tiempo de ejecucin compatible en el paquete.</target>
<note />
</trans-unit>
<trans-unit id="NonExistentPackagePath">
<source>Package '{0}' not found. Please provide a valid package path.</source>
<target state="translated">No se encontr el paquete "{0}". Indique una ruta de acceso de paquete vlida.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Compatibility/ApiCompat/Microsoft.DotNet.PackageValidation/xlf/Resources.es.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 934 |
```xml
<!--
~
~
~ path_to_url
~
~ Unless required by applicable law or agreed to in writing, software
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<project xmlns:xsi="path_to_url" xmlns="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.networknt</groupId>
<artifactId>light-4j</artifactId>
<version>2.1.36-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>cache-explorer</artifactId>
<packaging>jar</packaging>
<description>A handler that expose the caches from adm endpoints.</description>
<dependencies>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>cache-manager</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>handler</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
``` | /content/code_sandbox/cache-explorer/pom.xml | xml | 2016-09-09T22:28:14 | 2024-08-14T17:35:43 | light-4j | networknt/light-4j | 3,614 | 399 |
```xml
<?xml version="1.0" encoding="utf-8"?>
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<RelativeLayout xmlns:android="path_to_url"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/nearby_urls_icon"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="4dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:contentDescription="@null">
</ImageView>
<TextView
android:id="@+id/nearby_urls_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="48dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:textSize="16sp"
android:textColor="@color/physical_web_header_color"
android:singleLine="true"
android:ellipsize="end">
</TextView>
<TextView
android:id="@+id/nearby_urls_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="48dp"
android:layout_below="@id/nearby_urls_title"
android:layout_alignParentStart="true"
android:textSize="12sp"
android:textColor="@color/physical_web_url_color"
android:singleLine="true"
android:ellipsize="end">
</TextView>
<TextView
android:id="@+id/nearby_urls_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginStart="48dp"
android:layout_below="@id/nearby_urls_url"
android:layout_alignParentStart="true"
android:textSize="14sp"
android:textColor="@color/physical_web_url_description_color"
android:lines="2"
android:ellipsize="end"
android:lineSpacingExtra="1.5dp">
</TextView>
</RelativeLayout>
``` | /content/code_sandbox/libraries_res/chrome_res/src/main/res/layout/physical_web_list_item_nearby_url.xml | xml | 2016-07-04T07:28:36 | 2024-08-15T05:20:42 | AndroidChromium | JackyAndroid/AndroidChromium | 3,090 | 508 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" rowHeight="82" id="KGk-i7-Jjw" customClass="PersonCenterHeaderCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="82"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="293" height="82"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="avatar" translatesAutoresizingMaskIntoConstraints="NO" id="aZj-Ju-W07">
<rect key="frame" x="15" y="10" width="62" height="62"/>
<constraints>
<constraint firstAttribute="width" secondItem="aZj-Ju-W07" secondAttribute="height" multiplier="1:1" id="aDP-3n-wIq"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qrcode" translatesAutoresizingMaskIntoConstraints="NO" id="2x2-Kd-rmz">
<rect key="frame" x="265.5" y="31" width="17.5" height="20.5"/>
<constraints>
<constraint firstAttribute="width" secondItem="2x2-Kd-rmz" secondAttribute="height" multiplier="17:20" id="GtC-aa-Pe2"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7M4-hK-NBi">
<rect key="frame" x="87" y="15" width="164" height="25.5"/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=":zhengwenming1988" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZzX-dZ-XZR">
<rect key="frame" x="87" y="50" width="196" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="2x2-Kd-rmz" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="31" id="2tQ-KO-4gs"/>
<constraint firstItem="7M4-hK-NBi" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="15" id="B8L-rY-UVQ"/>
<constraint firstItem="7M4-hK-NBi" firstAttribute="leading" secondItem="aZj-Ju-W07" secondAttribute="trailing" constant="10" id="Ee1-1A-ldC"/>
<constraint firstAttribute="bottom" secondItem="ZzX-dZ-XZR" secondAttribute="bottom" constant="14" id="GbL-2h-e0f"/>
<constraint firstAttribute="bottom" secondItem="aZj-Ju-W07" secondAttribute="bottom" constant="10" id="NF6-2s-JTJ"/>
<constraint firstAttribute="bottom" secondItem="2x2-Kd-rmz" secondAttribute="bottom" constant="30.5" id="Pot-ci-8fe"/>
<constraint firstItem="aZj-Ju-W07" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="R10-We-Azp"/>
<constraint firstItem="ZzX-dZ-XZR" firstAttribute="leading" secondItem="aZj-Ju-W07" secondAttribute="trailing" constant="10" id="WHR-Mb-r1c"/>
<constraint firstAttribute="trailing" secondItem="7M4-hK-NBi" secondAttribute="trailing" constant="42" id="efb-kk-Rqq"/>
<constraint firstAttribute="trailing" secondItem="ZzX-dZ-XZR" secondAttribute="trailing" constant="10" id="iZL-si-Ph8"/>
<constraint firstItem="aZj-Ju-W07" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="lHO-T7-cRr"/>
<constraint firstAttribute="trailing" secondItem="2x2-Kd-rmz" secondAttribute="trailing" constant="10" id="zzA-m5-Uky"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="avatarIV" destination="aZj-Ju-W07" id="ioR-hw-xH8"/>
</connections>
<point key="canvasLocation" x="250" y="337"/>
</tableViewCell>
</objects>
<resources>
<image name="avatar" width="720" height="720"/>
<image name="qrcode" width="17" height="17"/>
</resources>
</document>
``` | /content/code_sandbox/WeChat/ViewController/Me我/PersonCenterHeaderCell.xib | xml | 2016-06-06T01:53:42 | 2024-08-05T09:45:48 | WeChat | zhengwenming/WeChat | 1,626 | 1,663 |
```xml
import {
act,
fireEvent,
render,
screen,
waitFor,
} from '@testing-library/react';
import expect from 'expect';
import { createMemoryHistory } from 'history';
import * as React from 'react';
import { Route, Routes } from 'react-router';
import { TestMemoryRouter } from 'react-admin';
import {
EditContextProvider,
SaveContextProvider,
useEditController,
// @ts-ignore
} from '..';
// @ts-ignore
import { CoreAdminContext } from '../../core';
// @ts-ignore
import { testDataProvider, useUpdate } from '../../dataProvider';
// @ts-ignore
import undoableEventEmitter from '../../dataProvider/undoableEventEmitter';
// @ts-ignore
import { Form, InputProps, useInput } from '../../form';
// @ts-ignore
import { useNotificationContext } from '../../notification';
// @ts-ignore
import { DataProvider } from '../../types';
// @ts-ignore
import { Middleware, useRegisterMutationMiddleware } from '../saveContext';
// @ts-ignore
import { EditController } from './EditController';
describe('useEditController', () => {
const defaultProps = {
id: 12,
resource: 'posts',
};
it('should call the dataProvider.getOne() function on mount', async () => {
const getOne = jest
.fn()
.mockImplementationOnce(() =>
Promise.resolve({ data: { id: 12, title: 'hello' } })
);
const dataProvider = { getOne } as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps}>
{({ record }) => <div>{record && record.title}</div>}
</EditController>
</CoreAdminContext>
);
await waitFor(() => {
expect(getOne).toHaveBeenCalled();
expect(screen.queryAllByText('hello')).toHaveLength(1);
});
});
it('should decode the id from the route params', async () => {
const getOne = jest
.fn()
.mockImplementationOnce(() =>
Promise.resolve({ data: { id: 'test?', title: 'hello' } })
);
const dataProvider = { getOne } as unknown as DataProvider;
const history = createMemoryHistory({
initialEntries: ['/posts/test%3F'],
});
render(
<CoreAdminContext dataProvider={dataProvider} history={history}>
<Routes>
<Route
path="/posts/:id"
element={
<EditController resource="posts">
{({ record }) => (
<div>{record && record.title}</div>
)}
</EditController>
}
/>
</Routes>
</CoreAdminContext>
);
await waitFor(() => {
expect(getOne).toHaveBeenCalledWith('posts', { id: 'test?' });
});
await waitFor(() => {
expect(screen.queryAllByText('hello')).toHaveLength(1);
});
});
it('should use the id provided through props if any', async () => {
const getOne = jest
.fn()
.mockImplementationOnce(() =>
Promise.resolve({ data: { id: 0, title: 'hello' } })
);
const dataProvider = { getOne } as unknown as DataProvider;
const history = createMemoryHistory({
initialEntries: ['/posts/test%3F'],
});
render(
<CoreAdminContext dataProvider={dataProvider} history={history}>
<Routes>
<Route
path="/posts/:id"
element={
<EditController id={0} resource="posts">
{({ record }) => (
<div>{record && record.title}</div>
)}
</EditController>
}
/>
</Routes>
</CoreAdminContext>
);
await waitFor(() => {
expect(getOne).toHaveBeenCalledWith('posts', { id: 0 });
});
await waitFor(() => {
expect(screen.queryAllByText('hello')).toHaveLength(1);
});
});
it('should return the `redirect` provided through props or the default', async () => {
const getOne = jest
.fn()
.mockImplementationOnce(() =>
Promise.resolve({ data: { id: 12, title: 'hello' } })
);
const dataProvider = { getOne } as unknown as DataProvider;
const Component = ({ redirect = undefined }) => (
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps} redirect={redirect}>
{({ redirect }) => <div>{redirect}</div>}
</EditController>
</CoreAdminContext>
);
const { rerender } = render(<Component />);
await waitFor(() => {
expect(screen.queryAllByText('list')).toHaveLength(1);
});
// @ts-ignore
rerender(<Component redirect="show" />);
await waitFor(() => {
expect(screen.queryAllByText('show')).toHaveLength(1);
});
});
describe('queryOptions', () => {
it('should accept custom client query options', async () => {
const mock = jest
.spyOn(console, 'error')
.mockImplementation(() => {});
const getOne = jest
.fn()
.mockImplementationOnce(() => Promise.reject(new Error()));
const onError = jest.fn();
const dataProvider = { getOne } as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController
{...defaultProps}
resource="posts"
queryOptions={{ onError }}
>
{() => <div />}
</EditController>
</CoreAdminContext>
);
await waitFor(() => {
expect(getOne).toHaveBeenCalled();
expect(onError).toHaveBeenCalled();
});
mock.mockRestore();
});
it('should accept a meta in query options', async () => {
const getOne = jest
.fn()
.mockImplementationOnce(() =>
Promise.resolve({ data: { id: 0, title: 'hello' } })
);
const dataProvider = { getOne } as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController
{...defaultProps}
resource="posts"
queryOptions={{ meta: { foo: 'bar' } }}
>
{() => <div />}
</EditController>
</CoreAdminContext>
);
await waitFor(() => {
expect(getOne).toHaveBeenCalledWith('posts', {
id: 12,
meta: { foo: 'bar' },
});
});
});
});
it('should call the dataProvider.update() function on save', async () => {
const update = jest
.fn()
.mockImplementationOnce((_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } })
);
const dataProvider = {
getOne: () =>
Promise.resolve({ data: { id: 12, test: 'previous' } }),
update,
} as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps} mutationMode="pessimistic">
{({ record, save }) => {
return (
<>
<p>{record?.test}</p>
<button
aria-label="save"
onClick={() => save({ test: 'updated' })}
/>
</>
);
}}
</EditController>
</CoreAdminContext>
);
await waitFor(() => {
screen.getByText('previous');
});
screen.getByLabelText('save').click();
await waitFor(() => {
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { test: 'updated' },
previousData: { id: 12, test: 'previous' },
});
});
});
it('should return an undoable save callback by default', async () => {
let post = { id: 12, test: 'previous' };
const update = jest
.fn()
.mockImplementationOnce((_, { data, previousData }) => {
post = { ...previousData, ...data };
return Promise.resolve({ data: post });
});
const dataProvider = {
getOne: () => Promise.resolve({ data: post }),
update,
} as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps}>
{({ save, record }) => {
return (
<>
<p>{record?.test}</p>
<button
aria-label="save"
onClick={() => save({ test: 'updated' })}
/>
</>
);
}}
</EditController>
</CoreAdminContext>
);
await waitFor(() => {
screen.getByText('previous');
});
screen.getByLabelText('save').click();
await waitFor(() => {
screen.getByText('updated');
});
expect(update).not.toHaveBeenCalledWith('posts', {
id: 12,
data: { test: 'updated' },
previousData: { id: 12, test: 'previous' },
});
undoableEventEmitter.emit('end', { isUndo: false });
await waitFor(() => {
screen.getByText('updated');
});
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { test: 'updated' },
previousData: { id: 12, test: 'previous' },
});
});
it('should return an immediate save callback when mutationMode is pessimistic', async () => {
let post = { id: 12 };
const update = jest
.fn()
.mockImplementationOnce((_, { data, previousData }) => {
post = { ...previousData, ...data };
return Promise.resolve({ data: post });
});
const dataProvider = {
getOne: () => Promise.resolve({ data: post }),
update,
} as unknown as DataProvider;
let saveCallback;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps} mutationMode="pessimistic">
{({ save, record }) => {
saveCallback = save;
return <>{JSON.stringify(record)}</>;
}}
</EditController>
</CoreAdminContext>
);
await new Promise(resolve => setTimeout(resolve, 10));
screen.getByText('{"id":12}');
await act(async () => saveCallback({ foo: 'bar' }));
await screen.findByText('{"id":12,"foo":"bar"}');
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar' },
previousData: { id: 12 },
});
});
it('should execute success side effects on success in pessimistic mode', async () => {
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: (_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } }),
} as unknown as DataProvider;
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController {...defaultProps} mutationMode="pessimistic">
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await waitFor(() =>
expect(notificationsSpy).toEqual([
{
message: 'ra.notification.updated',
type: 'info',
notificationOptions: {
messageArgs: {
smart_count: 1,
},
undoable: false,
},
},
])
);
});
describe('mutationOptions', () => {
it('should allow mutationOptions to override the default success side effects in pessimistic mode', async () => {
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: (_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } }),
} as unknown as DataProvider;
const onSuccess = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationMode="pessimistic"
mutationOptions={{ onSuccess }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await waitFor(() => expect(onSuccess).toHaveBeenCalled());
expect(notificationsSpy).toEqual([]);
});
it('should allow mutationOptions to override the default success side effects in optimistic mode', async () => {
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: (_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } }),
} as unknown as DataProvider;
const onSuccess = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationMode="optimistic"
mutationOptions={{ onSuccess }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await waitFor(() => expect(onSuccess).toHaveBeenCalled());
expect(notificationsSpy).toEqual([]);
});
it('should allow mutationOptions to override the default success side effects in undoable mode', async () => {
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: (_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } }),
} as unknown as DataProvider;
const onSuccess = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationOptions={{ onSuccess }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await waitFor(() => expect(onSuccess).toHaveBeenCalled());
expect(notificationsSpy).toEqual([]);
});
it('should allow mutationOptions to override the default failure side effects in pessimistic mode', async () => {
jest.spyOn(console, 'error').mockImplementation(() => {});
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: () => Promise.reject({ message: 'not good' }),
} as unknown as DataProvider;
const onError = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationMode="pessimistic"
mutationOptions={{ onError }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await new Promise(resolve => setTimeout(resolve, 10));
await waitFor(() => expect(onError).toHaveBeenCalled());
expect(notificationsSpy).toEqual([]);
});
it('should allow mutationOptions to override the default failure side effects in optimistic mode', async () => {
jest.spyOn(console, 'error').mockImplementation(() => {});
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: () => Promise.reject({ message: 'not good' }),
} as unknown as DataProvider;
const onError = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationMode="optimistic"
mutationOptions={{ onError }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await waitFor(() => expect(saveCallback).toBeDefined());
await act(async () => saveCallback({ foo: 'bar' }));
await new Promise(resolve => setTimeout(resolve, 10));
await waitFor(() => expect(onError).toHaveBeenCalled());
// we get the (optimistic) success notification but not the error notification
expect(notificationsSpy).toEqual([
{
message: 'ra.notification.updated',
type: 'info',
notificationOptions: {
messageArgs: {
smart_count: 1,
},
undoable: false,
},
},
]);
});
it('should accept meta in mutationOptions', async () => {
let saveCallback;
const update = jest
.fn()
.mockImplementationOnce((_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } })
);
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update,
} as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController
{...defaultProps}
mutationMode="pessimistic"
mutationOptions={{ meta: { lorem: 'ipsum' } }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await waitFor(() => {
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar' },
previousData: undefined,
meta: { lorem: 'ipsum' },
});
});
});
});
it('should accept meta as a save option', async () => {
let saveCallback;
const update = jest
.fn()
.mockImplementationOnce((_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } })
);
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update,
} as unknown as DataProvider;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps} mutationMode="pessimistic">
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () =>
saveCallback({ foo: 'bar' }, { meta: { lorem: 'ipsum' } })
);
await waitFor(() => {
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar' },
previousData: undefined,
meta: { lorem: 'ipsum' },
});
});
});
it('should allow the save onSuccess option to override the success side effects override', async () => {
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: (_, { id, data, previousData }) =>
Promise.resolve({ data: { id, ...previousData, ...data } }),
} as unknown as DataProvider;
const onSuccess = jest.fn();
const onSuccessSave = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationMode="pessimistic"
mutationOptions={{ onSuccess }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () =>
saveCallback(
{ foo: 'bar' },
{
onSuccess: onSuccessSave,
}
)
);
expect(onSuccess).not.toHaveBeenCalled();
await waitFor(() => expect(onSuccessSave).toHaveBeenCalled());
expect(notificationsSpy).toEqual([]);
});
it('should execute error side effects on error in pessimistic mode', async () => {
jest.spyOn(console, 'error').mockImplementation(() => {});
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: () => Promise.reject({ message: 'not good' }),
} as unknown as DataProvider;
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController {...defaultProps} mutationMode="pessimistic">
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await new Promise(resolve => setTimeout(resolve, 10));
expect(notificationsSpy).toEqual([
{
message: 'not good',
type: 'error',
notificationOptions: { messageArgs: { _: 'not good' } },
},
]);
});
it('should allow the save onError option to override the failure side effects override', async () => {
jest.spyOn(console, 'error').mockImplementation(() => {});
let saveCallback;
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update: () => Promise.reject({ message: 'not good' }),
} as unknown as DataProvider;
const onError = jest.fn();
const onErrorSave = jest.fn();
let notificationsSpy;
const Notification = () => {
const { notifications } = useNotificationContext();
React.useEffect(() => {
notificationsSpy = notifications;
}, [notifications]);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<Notification />
<EditController
{...defaultProps}
mutationMode="pessimistic"
mutationOptions={{ onError }}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () =>
saveCallback(
{ foo: 'bar' },
{
onError: onErrorSave,
}
)
);
expect(onError).not.toHaveBeenCalled();
expect(onErrorSave).toHaveBeenCalled();
expect(notificationsSpy).toEqual([]);
});
it('should allow transform to transform the data before save', async () => {
let saveCallback;
const update = jest
.fn()
.mockImplementationOnce((_, { id, data }) =>
Promise.resolve({ data: { id, ...data } })
);
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update,
} as unknown as DataProvider;
const transform = jest.fn().mockImplementationOnce(data => ({
...data,
transformed: true,
}));
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController
{...defaultProps}
mutationMode="pessimistic"
transform={transform}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
expect(transform).toHaveBeenCalledWith(
{ foo: 'bar' },
{ previousData: undefined }
);
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar', transformed: true },
previousData: undefined,
});
});
it('should allow the save transform option to override the transform side effect', async () => {
let saveCallback;
const update = jest
.fn()
.mockImplementationOnce((_, { id, data }) =>
Promise.resolve({ data: { id, ...data } })
);
const dataProvider = {
getOne: () => Promise.resolve({ data: { id: 12 } }),
update,
} as unknown as DataProvider;
const transform = jest.fn();
const transformSave = jest.fn().mockImplementationOnce(data => ({
...data,
transformed: true,
}));
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController
{...defaultProps}
mutationMode="pessimistic"
transform={transform}
>
{({ save }) => {
saveCallback = save;
return <div />;
}}
</EditController>
</CoreAdminContext>
);
await act(async () =>
saveCallback(
{ foo: 'bar' },
{
transform: transformSave,
}
)
);
expect(transform).not.toHaveBeenCalled();
expect(transformSave).toHaveBeenCalledWith(
{ foo: 'bar' },
{ previousData: undefined }
);
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar', transformed: true },
previousData: undefined,
});
});
it('should allow to register middlewares', async () => {
let saveCallback;
const update = jest
.fn()
.mockImplementationOnce((_, { id, data }) =>
Promise.resolve({ data: { id, ...data } })
);
const dataProvider = testDataProvider({
// @ts-ignore
getOne: () => Promise.resolve({ data: { id: 12 } }),
update,
});
const middleware: Middleware<ReturnType<typeof useUpdate>[0]> = jest.fn(
(resource, params, options, next) => {
return next(
resource,
{ ...params, meta: { addedByMiddleware: true } },
options
);
}
);
const Child = () => {
useRegisterMutationMiddleware<ReturnType<typeof useUpdate>[0]>(
middleware
);
return null;
};
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps} mutationMode="pessimistic">
{({
save,
saving,
registerMutationMiddleware,
unregisterMutationMiddleware,
}) => {
saveCallback = save;
return (
<SaveContextProvider
value={{
save,
saving,
registerMutationMiddleware,
unregisterMutationMiddleware,
}}
>
<Child />
</SaveContextProvider>
);
}}
</EditController>
</CoreAdminContext>
);
await act(async () => saveCallback({ foo: 'bar' }));
await waitFor(() => {
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar' },
meta: { addedByMiddleware: true },
previousData: undefined,
});
});
expect(middleware).toHaveBeenCalledWith(
'posts',
{
id: 12,
data: { foo: 'bar' },
},
expect.any(Object),
expect.any(Function)
);
});
it('should return errors from the update call in pessimistic mode', async () => {
let post = { id: 12 };
const update = jest.fn().mockImplementationOnce(() => {
return Promise.reject({ body: { errors: { foo: 'invalid' } } });
});
const dataProvider = {
getOne: () => Promise.resolve({ data: post }),
update,
} as unknown as DataProvider;
let saveCallback;
render(
<CoreAdminContext dataProvider={dataProvider}>
<EditController {...defaultProps} mutationMode="pessimistic">
{({ save, record }) => {
saveCallback = save;
return <>{JSON.stringify(record)}</>;
}}
</EditController>
</CoreAdminContext>
);
await screen.findByText('{"id":12}');
let errors;
await act(async () => {
errors = await saveCallback({ foo: 'bar' });
});
expect(errors).toEqual({ foo: 'invalid' });
screen.getByText('{"id":12}');
expect(update).toHaveBeenCalledWith('posts', {
id: 12,
data: { foo: 'bar' },
previousData: { id: 12 },
});
});
it('should allow custom redirect with warnWhenUnsavedChanges in pessimistic mode', async () => {
const dataProvider = testDataProvider({
getOne: () => Promise.resolve({ data: { id: 123 } } as any),
update: (_, { id, data }) =>
new Promise(resolve =>
setTimeout(
() => resolve({ data: { id, ...data } } as any),
300
)
),
});
const Input = (props: InputProps) => {
const name = props.source;
const { field } = useInput(props);
return (
<>
<label htmlFor={name}>{name}</label>
<input id={name} type="text" {...field} />
</>
);
};
const EditView = () => {
const controllerProps = useEditController({
...defaultProps,
id: 123,
redirect: 'show',
mutationMode: 'pessimistic',
});
return (
<EditContextProvider value={controllerProps}>
<Form warnWhenUnsavedChanges>
<>
<div>Edit</div>
<Input source="foo" />
<input type="submit" value="Submit" />
</>
</Form>
</EditContextProvider>
);
};
const ShowView = () => <div>Show</div>;
render(
<TestMemoryRouter initialEntries={['/posts/123']}>
<CoreAdminContext dataProvider={dataProvider}>
<Routes>
<Route path="/posts/123" element={<EditView />} />
<Route path="/posts/123/show" element={<ShowView />} />
</Routes>
</CoreAdminContext>
</TestMemoryRouter>
);
await screen.findByText('Edit');
fireEvent.change(await screen.findByLabelText('foo'), {
target: { value: 'bar' },
});
fireEvent.click(screen.getByText('Submit'));
expect(await screen.findByText('Show')).not.toBeNull();
});
});
``` | /content/code_sandbox/packages/ra-core/codemods/__testfixtures__/replace-MemoryRouter-useEditController.output.tsx | xml | 2016-07-13T07:58:54 | 2024-08-16T18:32:27 | react-admin | marmelab/react-admin | 24,624 | 6,970 |
```xml
// See LICENSE in the project root for license information.
import { IdentityMockTransformer } from '../transformers/IdentityMockTransformer';
export = new IdentityMockTransformer();
``` | /content/code_sandbox/heft-plugins/heft-jest-plugin/src/exports/jest-identity-mock-transform.ts | xml | 2016-09-30T00:28:20 | 2024-08-16T18:54:35 | rushstack | microsoft/rushstack | 5,790 | 34 |
```xml
<settings version="2">
<setting id="NUM_ADAPTERS">1</setting>
<setting id="RESTART_ON_RESUME" default="true">false</setting>
<setting id="WAIT_FOR_FEINIT" default="true">false</setting>
<setting id="WORKAROUND_SLEEP" default="true">false</setting>
<setting id="WORKAROUND_SLEEP_TIME">1</setting>
</settings>
``` | /content/code_sandbox/packages/addons/service/oscam/source/settings-default.xml | xml | 2016-03-13T01:46:18 | 2024-08-16T11:58:29 | LibreELEC.tv | LibreELEC/LibreELEC.tv | 2,216 | 93 |
```xml
import * as React from 'react';
interface MyType {
foo: number;
bar: boolean;
baz?: { n: number };
}
function assertIsString(val: any): asserts val is string {
if (typeof val !== 'string') {
throw new Error('Not a string!');
}
}
const foo: any = 'bar';
assertIsString(foo);
type MyObject = Pick<MyType, 'bar' | 'baz'>;
class App extends React.Component {
static foo: MyObject = { bar: true, baz: { n: 123 } };
n = App.foo?.baz!.n ?? 'foo';
render() {
return <div />;
}
}
export default App;
``` | /content/code_sandbox/test/fixtures/typescript-advanced/src/App.tsx | xml | 2016-07-17T14:55:11 | 2024-08-16T18:02:58 | create-react-app | facebook/create-react-app | 102,384 | 152 |
```xml
import { BackgroundFetchOptions, BackgroundFetchResult, BackgroundFetchStatus } from './BackgroundFetch.types';
/**
* Gets a status of background fetch.
* @return Returns a promise which fulfils with one of `BackgroundFetchStatus` enum values.
*/
export declare function getStatusAsync(): Promise<BackgroundFetchStatus | null>;
/**
* Sets the minimum number of seconds that must elapse before another background fetch can be
* initiated. This value is advisory only and does not indicate the exact amount of time expected
* between fetch operations.
*
* > This method doesn't take any effect on Android. It is a global value which means that it can
* overwrite settings from another application opened through Expo Go.
*
* @param minimumInterval Number of seconds that must elapse before another background fetch can be called.
* @return A promise which fulfils once the minimum interval is set.
*/
export declare function setMinimumIntervalAsync(minimumInterval: number): Promise<void>;
/**
* Registers background fetch task with given name. Registered tasks are saved in persistent storage and restored once the app is initialized.
* @param taskName Name of the task to register. The task needs to be defined first - see [`TaskManager.defineTask`](taskmanager#defineTask)
* for more details.
* @param options An object containing the background fetch options.
*
* @example
* ```ts
* import * as BackgroundFetch from 'expo-background-fetch';
* import * as TaskManager from 'expo-task-manager';
*
* TaskManager.defineTask(YOUR_TASK_NAME, () => {
* try {
* const receivedNewData = // do your background fetch here
* return receivedNewData ? BackgroundFetch.BackgroundFetchResult.NewData : BackgroundFetch.BackgroundFetchResult.NoData;
* } catch (error) {
* return BackgroundFetch.BackgroundFetchResult.Failed;
* }
* });
* ```
*/
export declare function registerTaskAsync(taskName: string, options?: BackgroundFetchOptions): Promise<void>;
/**
* Unregisters background fetch task, so the application will no longer be executing this task.
* @param taskName Name of the task to unregister.
* @return A promise which fulfils when the task is fully unregistered.
*/
export declare function unregisterTaskAsync(taskName: string): Promise<void>;
export { BackgroundFetchResult, BackgroundFetchStatus, BackgroundFetchOptions };
//# sourceMappingURL=BackgroundFetch.d.ts.map
``` | /content/code_sandbox/packages/expo-background-fetch/build/BackgroundFetch.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 492 |
```xml
import { ReactNode } from 'react';
import { Rocket } from 'lucide-react';
import LinuxIcon from '@/assets/ico/linux.svg?c';
import MicrosoftIcon from '@/assets/ico/vendor/microsoft.svg?c';
import KubernetesIcon from '@/assets/ico/vendor/kubernetes.svg?c';
import { Icon } from '@@/Icon';
import { FallbackImage } from '@@/FallbackImage';
import { BlocklistItem } from '@@/Blocklist/BlocklistItem';
import { BadgeIcon } from '@@/BadgeIcon';
import { Link } from '@@/Link';
import { Platform } from '../types';
type Value = {
Id: number | string;
Logo?: string;
Title: string;
Platform?: Platform;
Description: string;
Categories?: string[];
};
export function TemplateItem({
template,
typeLabel,
onSelect,
renderActions,
isSelected,
linkParams,
}: {
template: Value;
typeLabel: string;
onSelect: () => void;
renderActions: ReactNode;
isSelected: boolean;
linkParams?: { to: string; params: object };
}) {
return (
<div className="relative">
<BlocklistItem
isSelected={isSelected}
onClick={() => onSelect()}
as={linkParams ? Link : undefined}
to={linkParams?.to}
params={linkParams?.params}
aria-label={template.Title}
>
<div className="vertical-center min-w-[56px] justify-center">
<FallbackImage
src={template.Logo}
fallbackIcon={<BadgeIcon icon={Rocket} size="3xl" />}
className="blocklist-item-logo"
/>
</div>
<div className="col-sm-12 flex justify-between flex-wrap">
<div className="blocklist-item-line gap-2">
<span className="blocklist-item-title">{template.Title}</span>
<div className="space-left blocklist-item-subtitle inline-flex items-center">
<div className="vertical-center gap-1">
{(template.Platform === Platform.LINUX ||
!template.Platform) && (
<Icon icon={LinuxIcon} className="mr-1" />
)}
{(template.Platform === Platform.WINDOWS ||
!template.Platform) && (
<Icon
icon={MicrosoftIcon}
className="[&>*]:flex [&>*]:items-center"
size="lg"
/>
)}
</div>
{typeLabel === 'manifest' && (
<div className="vertical-center">
<Icon
icon={KubernetesIcon}
size="lg"
className="align-bottom [&>*]:flex [&>*]:items-center"
/>
</div>
)}
{typeLabel}
</div>
</div>
<div className="blocklist-item-line w-full">
<span className="blocklist-item-desc">{template.Description}</span>
{template.Categories && template.Categories.length > 0 && (
<span className="small text-muted">
{template.Categories.join(', ')}
</span>
)}
</div>
</div>
</BlocklistItem>
<span className="absolute inset-y-0 right-0 justify-end">
{renderActions}
</span>
</div>
);
}
``` | /content/code_sandbox/app/react/portainer/templates/components/TemplateItem.tsx | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 699 |
```xml
import React, { FunctionComponent } from "react"
import TimelineCommand from "../../components/TimelineCommand"
import ContentView from "../../components/ContentView"
import { TimelineCommandProps, buildTimelineCommand } from "../BaseCommand"
interface StateValuesChangePayload {
added: any
changed: any
changes: any[]
removed: any
}
interface Props extends TimelineCommandProps<StateValuesChangePayload> {}
const StateValuesChangeCommand: FunctionComponent<Props> = ({ command, isOpen, setIsOpen }) => {
const { payload, date, deltaTime } = command
const hasChanged = !!payload.changed && !Array.isArray(payload.changed)
const hasAdded = !!payload.added && !Array.isArray(payload.added)
const hasRemoved = !!payload.removed && !Array.isArray(payload.removed)
const changes = []
if (hasChanged) {
changes.push(`${Object.keys(payload.changed).length} changed`)
}
if (hasAdded) {
changes.push(`${Object.keys(payload.added).length} added`)
}
if (hasRemoved) {
changes.push(`${Object.keys(payload.removed).length} removed`)
}
const preview = changes.join(" ")
// TODO: What should we do about this null junk?
// TODO: Consider only showing the labels if more then 1 type is there?
return (
<TimelineCommand
date={date}
deltaTime={deltaTime}
title="SUBSCRIPTIONS"
preview={preview}
isOpen={isOpen}
setIsOpen={setIsOpen}
>
{hasChanged && <ContentView value={{ changed: payload.changed }} />}
{hasAdded && <ContentView value={{ "+ added": payload.added }} />}
{hasRemoved && <ContentView value={{ "- removed": payload.removed }} />}
</TimelineCommand>
)
}
export default buildTimelineCommand(StateValuesChangeCommand, true)
export { StateValuesChangeCommand }
``` | /content/code_sandbox/lib/reactotron-core-ui/src/timelineCommands/StateValuesChangeCommand/index.tsx | xml | 2016-04-15T21:58:32 | 2024-08-16T11:39:46 | reactotron | infinitered/reactotron | 14,757 | 400 |
```xml
/* only nested types
1. with no identifier field
2. that don't become array elements
3. with more than 1 field
*/
export default [
'UserDetailsType',
'Coordinate',
'TimeTrack',
'OTPConfig',
'MailConfig',
'ManualVerificationConfig',
'PasswordVerificationConfig',
'Styles',
'UserNotificationSettings',
'VerificationRequest',
'EngageScheduleDate',
'EngageMessageSms',
'EngageData',
'MailData',
'VideoCallData',
'BookingData',
// < Types from community repo. Everything uses OS build of the core-ui, until better solution is found we have to include them here
'ItemSourceLocation',
'CalcedInfo'
// <\ Types from community repo. Everything uses OS build of the core-ui, until better solution is found we have to include them here
];
``` | /content/code_sandbox/packages/erxes-ui/src/no-id-nested-types.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 202 |
```xml
import Link from 'next/link'
export default function Page() {
return (
<div>
<h1>Modal</h1>
<ul>
<li>
<Link href="/u/foobar/l">Profile Link</Link>
</li>
<li>
<Link href="/trending">Trending Link</Link>
</li>
</ul>
</div>
)
}
``` | /content/code_sandbox/test/e2e/app-dir/parallel-routes-catchall-specificity/app/@modal/(...)comments/[productId]/page.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 91 |
```xml
import { PageId, PageGroup, pagesSpecs } from '@doc/pages';
import type { MaterialCommunityIcons } from '@expo/vector-icons';
import { ComponentProps } from 'react';
export type IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];
export type PageRoute = `${PageGroup}-${PageId}`;
export type PlaygroundRoute = 'playground-lists';
export type ResourceRoute = PageRoute | PlaygroundRoute;
export interface ResourceRouteDefinition {
title: string;
name: ResourceRoute;
iconName: IconName;
}
const pagesIndex: Record<PageRoute, ResourceRouteDefinition> =
Object.fromEntries(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Object.entries(pagesSpecs).map(([_k, s]) => [`${s.group}-${s.id}`, s])
) as any;
const resourceRoutesIndex: Record<ResourceRoute, ResourceRouteDefinition> = {
...pagesIndex,
'playground-lists': {
title: 'Lists Playground',
name: 'playground-lists',
iconName: 'format-list-bulleted-square'
}
};
export { resourceRoutesIndex };
``` | /content/code_sandbox/apps/discovery/src/nav-model.ts | xml | 2016-11-29T10:50:53 | 2024-08-08T06:53:22 | react-native-render-html | meliorence/react-native-render-html | 3,445 | 238 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: node_test\query_ut_2.xml-->
<behavior name="node_test/query_ut_2" agenttype="AgentNodeTest" version="4">
<node class="Sequence" id="0">
<attachment class="Precondition" id="1" flag="precondition">
<property BinaryOperator="And" />
<property Operator="Equal" />
<property Opl="Self.AgentNodeTest::enter_action_1(0)" />
<property Opr2="const bool true" />
<property Phase="Enter" />
</attachment>
<attachment class="Effector" id="2" flag="effector">
<property Operator="Invalid" />
<property Opl="Self.AgentNodeTest::exit_action_2(0,"")" />
<property Phase="Success" />
</attachment>
<node class="Query" id="5">
<property Descriptors="1:{Attribute=int Self.AgentNodeTest::testVar_1;Reference=const int 0;Weight=100;}" />
<property Domain="test" />
</node>
<node class="Sequence" id="6">
<node class="Query" id="3">
<property Descriptors="1:{Attribute=int Self.AgentNodeTest::testVar_1;Reference=const int 50;Weight=100;}" />
<property Domain="test" />
</node>
<node class="Query" id="4">
<property Descriptors="1:{Attribute=int Self.AgentNodeTest::testVar_1;Reference=const int 100;Weight=100;}" />
<property Domain="test" />
</node>
</node>
</node>
</behavior>
``` | /content/code_sandbox/integration/unity/Assets/Resources/behaviac/exported/node_test/query_ut_2.xml | xml | 2016-11-21T05:08:08 | 2024-08-16T07:18:30 | behaviac | Tencent/behaviac | 2,831 | 400 |
```xml
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<resData>
<domain:chkData xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:cd>
<domain:name avail="0">example1.tld</domain:name>
<domain:reason>In use</domain:reason>
</domain:cd>
<domain:cd>
<domain:name avail="1">example2.tld</domain:name>
</domain:cd>
<domain:cd>
<domain:name avail="1">example3.tld</domain:name>
</domain:cd>
</domain:chkData>
</resData>
<extension>
<fee:chkData xmlns:fee="urn:ietf:params:xml:ns:fee-0.11"
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<fee:cd avail="1">
<fee:object>
<domain:name>example1.tld</domain:name>
</fee:object>
<fee:command>create</fee:command>
<fee:currency>USD</fee:currency>
<fee:period unit="y">1</fee:period>
<fee:fee description="create">6.50</fee:fee>
</fee:cd>
<fee:cd avail="1">
<fee:object>
<domain:name>example2.tld</domain:name>
</fee:object>
<fee:command>create</fee:command>
<fee:currency>USD</fee:currency>
<fee:period unit="y">1</fee:period>
<fee:fee description="create">6.50</fee:fee>
</fee:cd>
<fee:cd avail="1">
<fee:object>
<domain:name>example3.tld</domain:name>
</fee:object>
<fee:command>create</fee:command>
<fee:currency>USD</fee:currency>
<fee:period unit="y">1</fee:period>
<fee:fee description="create">6.50</fee:fee>
</fee:cd>
</fee:chkData>
</extension>
<trID>
<clTRID>ABC-12345</clTRID>
<svTRID>server-trid</svTRID>
</trID>
</response>
</epp>
``` | /content/code_sandbox/core/src/test/resources/google/registry/flows/domain/domain_check_fee_response_default_token_v11.xml | xml | 2016-02-29T20:16:48 | 2024-08-15T19:49:29 | nomulus | google/nomulus | 1,685 | 580 |
```xml
/**
* @license
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at path_to_url
*/
import {AttributeSelectorUpgradeData, VersionChanges} from '@angular/cdk/schematics';
export const attributeSelectors: VersionChanges<AttributeSelectorUpgradeData> = {};
``` | /content/code_sandbox/src/material/schematics/ng-update/data/attribute-selectors.ts | xml | 2016-01-04T18:50:02 | 2024-08-16T11:21:13 | components | angular/components | 24,263 | 70 |
```xml
<?xml version="1.0"?>
<phpunit xmlns:xsi="path_to_url" colors="true" xsi:noNamespaceSchemaLocation="path_to_url">
<testsuites>
<testsuite name="main">
<directory suffix="Test.php">.</directory>
</testsuite>
</testsuites>
<logging/>
<source>
<include>
<directory suffix=".php">../lib</directory>
<directory suffix=".php">../htdocs</directory>
</include>
</source>
</phpunit>
``` | /content/code_sandbox/tests/phpunit.xml | xml | 2016-08-16T15:09:33 | 2024-08-09T00:52:45 | self-service-password | ltb-project/self-service-password | 1,143 | 121 |
```xml
/**
* @license
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at path_to_url
*/
import {AnimationEvent} from '@angular/animations';
import {CdkAccordionItem} from '@angular/cdk/accordion';
import {UniqueSelectionDispatcher} from '@angular/cdk/collections';
import {CdkPortalOutlet, TemplatePortal} from '@angular/cdk/portal';
import {DOCUMENT} from '@angular/common';
import {
AfterContentInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChild,
Directive,
ElementRef,
EventEmitter,
Inject,
InjectionToken,
Input,
OnChanges,
OnDestroy,
Optional,
Output,
SimpleChanges,
SkipSelf,
ViewChild,
ViewContainerRef,
ViewEncapsulation,
booleanAttribute,
ANIMATION_MODULE_TYPE,
} from '@angular/core';
import {Subject} from 'rxjs';
import {filter, startWith, take} from 'rxjs/operators';
import {MatAccordionBase, MatAccordionTogglePosition, MAT_ACCORDION} from './accordion-base';
import {matExpansionAnimations} from './expansion-animations';
import {MAT_EXPANSION_PANEL} from './expansion-panel-base';
import {MatExpansionPanelContent} from './expansion-panel-content';
/** MatExpansionPanel's states. */
export type MatExpansionPanelState = 'expanded' | 'collapsed';
/** Counter for generating unique element ids. */
let uniqueId = 0;
/**
* Object that can be used to override the default options
* for all of the expansion panels in a module.
*/
export interface MatExpansionPanelDefaultOptions {
/** Height of the header while the panel is expanded. */
expandedHeight: string;
/** Height of the header while the panel is collapsed. */
collapsedHeight: string;
/** Whether the toggle indicator should be hidden. */
hideToggle: boolean;
}
/**
* Injection token that can be used to configure the default
* options for the expansion panel component.
*/
export const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS =
new InjectionToken<MatExpansionPanelDefaultOptions>('MAT_EXPANSION_PANEL_DEFAULT_OPTIONS');
/**
* This component can be used as a single element to show expandable content, or as one of
* multiple children of an element with the MatAccordion directive attached.
*/
@Component({
styleUrl: 'expansion-panel.css',
selector: 'mat-expansion-panel',
exportAs: 'matExpansionPanel',
templateUrl: 'expansion-panel.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [matExpansionAnimations.bodyExpansion],
providers: [
// Provide MatAccordion as undefined to prevent nested expansion panels from registering
// to the same accordion.
{provide: MAT_ACCORDION, useValue: undefined},
{provide: MAT_EXPANSION_PANEL, useExisting: MatExpansionPanel},
],
host: {
'class': 'mat-expansion-panel',
'[class.mat-expanded]': 'expanded',
'[class._mat-animation-noopable]': '_animationsDisabled',
'[class.mat-expansion-panel-spacing]': '_hasSpacing()',
},
standalone: true,
imports: [CdkPortalOutlet],
})
export class MatExpansionPanel
extends CdkAccordionItem
implements AfterContentInit, OnChanges, OnDestroy
{
protected _animationsDisabled: boolean;
private _document: Document;
/** Whether the toggle indicator should be hidden. */
@Input({transform: booleanAttribute})
get hideToggle(): boolean {
return this._hideToggle || (this.accordion && this.accordion.hideToggle);
}
set hideToggle(value: boolean) {
this._hideToggle = value;
}
private _hideToggle = false;
/** The position of the expansion indicator. */
@Input()
get togglePosition(): MatAccordionTogglePosition {
return this._togglePosition || (this.accordion && this.accordion.togglePosition);
}
set togglePosition(value: MatAccordionTogglePosition) {
this._togglePosition = value;
}
private _togglePosition: MatAccordionTogglePosition;
/** An event emitted after the body's expansion animation happens. */
@Output() readonly afterExpand = new EventEmitter<void>();
/** An event emitted after the body's collapse animation happens. */
@Output() readonly afterCollapse = new EventEmitter<void>();
/** Stream that emits for changes in `@Input` properties. */
readonly _inputChanges = new Subject<SimpleChanges>();
/** Optionally defined accordion the expansion panel belongs to. */
override accordion: MatAccordionBase;
/** Content that will be rendered lazily. */
@ContentChild(MatExpansionPanelContent) _lazyContent: MatExpansionPanelContent;
/** Element containing the panel's user-provided content. */
@ViewChild('body') _body: ElementRef<HTMLElement>;
/** Portal holding the user's content. */
_portal: TemplatePortal;
/** ID for the associated header element. Used for a11y labelling. */
_headerId = `mat-expansion-panel-header-${uniqueId++}`;
constructor(
@Optional() @SkipSelf() @Inject(MAT_ACCORDION) accordion: MatAccordionBase,
_changeDetectorRef: ChangeDetectorRef,
_uniqueSelectionDispatcher: UniqueSelectionDispatcher,
private _viewContainerRef: ViewContainerRef,
@Inject(DOCUMENT) _document: any,
@Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode: string,
@Inject(MAT_EXPANSION_PANEL_DEFAULT_OPTIONS)
@Optional()
defaultOptions?: MatExpansionPanelDefaultOptions,
) {
super(accordion, _changeDetectorRef, _uniqueSelectionDispatcher);
this.accordion = accordion;
this._document = _document;
this._animationsDisabled = _animationMode === 'NoopAnimations';
if (defaultOptions) {
this.hideToggle = defaultOptions.hideToggle;
}
}
/** Determines whether the expansion panel should have spacing between it and its siblings. */
_hasSpacing(): boolean {
if (this.accordion) {
return this.expanded && this.accordion.displayMode === 'default';
}
return false;
}
/** Gets the expanded state string. */
_getExpandedState(): MatExpansionPanelState {
return this.expanded ? 'expanded' : 'collapsed';
}
/** Toggles the expanded state of the expansion panel. */
override toggle(): void {
this.expanded = !this.expanded;
}
/** Sets the expanded state of the expansion panel to false. */
override close(): void {
this.expanded = false;
}
/** Sets the expanded state of the expansion panel to true. */
override open(): void {
this.expanded = true;
}
ngAfterContentInit() {
if (this._lazyContent && this._lazyContent._expansionPanel === this) {
// Render the content as soon as the panel becomes open.
this.opened
.pipe(
startWith(null),
filter(() => this.expanded && !this._portal),
take(1),
)
.subscribe(() => {
this._portal = new TemplatePortal(this._lazyContent._template, this._viewContainerRef);
});
}
}
ngOnChanges(changes: SimpleChanges) {
this._inputChanges.next(changes);
}
override ngOnDestroy() {
super.ngOnDestroy();
this._inputChanges.complete();
}
/** Checks whether the expansion panel's content contains the currently-focused element. */
_containsFocus(): boolean {
if (this._body) {
const focusedElement = this._document.activeElement;
const bodyElement = this._body.nativeElement;
return focusedElement === bodyElement || bodyElement.contains(focusedElement);
}
return false;
}
/** Called when the expansion animation has started. */
protected _animationStarted(event: AnimationEvent) {
if (!isInitialAnimation(event) && !this._animationsDisabled && this._body) {
// Prevent the user from tabbing into the content while it's animating.
// TODO(crisbeto): maybe use `inert` to prevent focus from entering while closed as well
// instead of `visibility`? Will allow us to clean up some code but needs more testing.
this._body?.nativeElement.setAttribute('inert', '');
}
}
/** Called when the expansion animation has finished. */
protected _animationDone(event: AnimationEvent) {
if (!isInitialAnimation(event)) {
if (event.toState === 'expanded') {
this.afterExpand.emit();
} else if (event.toState === 'collapsed') {
this.afterCollapse.emit();
}
// Re-enable tabbing once the animation is finished.
if (!this._animationsDisabled && this._body) {
this._body.nativeElement.removeAttribute('inert');
}
}
}
}
/** Checks whether an animation is the initial setup animation. */
function isInitialAnimation(event: AnimationEvent): boolean {
return event.fromState === 'void';
}
/**
* Actions of a `<mat-expansion-panel>`.
*/
@Directive({
selector: 'mat-action-row',
host: {
class: 'mat-action-row',
},
standalone: true,
})
export class MatExpansionPanelActionRow {}
``` | /content/code_sandbox/src/material/expansion/expansion-panel.ts | xml | 2016-01-04T18:50:02 | 2024-08-16T11:21:13 | components | angular/components | 24,263 | 1,986 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>%FRAMEWORK%</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
``` | /content/code_sandbox/test/dotnet-new.Tests/Approvals/FeaturesSupport.classlib.Nullable-True#TopLevel-True#ImplicitUsings-True#FileScopedNs-True#Framework-net7.0#cs#NoLangVer.verified/MyProject/classlib.csproj | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 53 |
```xml
<vector xmlns:android="path_to_url"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="m12,0 l-6,12h3.5a2.5,2.5 0,0 1,2.5 -2.5,2.5 2.5,0 0,1 2.5,2.5h3.5z"
android:fillColor="#c33"/>
<path
android:pathData="m12,24 l-6,-12h3.5a2.5,2.5 0,0 0,2.5 2.5,2.5 2.5,0 0,0 2.5,-2.5h3.5z"
android:fillColor="#bbb"/>
</vector>
``` | /content/code_sandbox/app/src/main/res/drawable/ic_compass_needle_48dp.xml | xml | 2016-07-02T10:44:04 | 2024-08-16T18:55:54 | StreetComplete | streetcomplete/StreetComplete | 3,781 | 206 |
```xml
import React from 'react';
import { Story, Meta } from '@storybook/react';
import CustomAddVideoEditor from './CustomAddVideoEditor';
export default {
title: 'Video/Editor with Video Plugin and Add Video Button',
component: CustomAddVideoEditor
} as Meta;
export const Default: Story = () => <CustomAddVideoEditor />;
``` | /content/code_sandbox/stories/adding-video/src/CustomAddVideoEditor.stories.tsx | xml | 2016-02-26T09:54:56 | 2024-08-16T18:16:31 | draft-js-plugins | draft-js-plugins/draft-js-plugins | 4,087 | 75 |
```xml
import type { VerificationPreferences } from '../VerificationPreferences';
import type { ContactEmail } from '../contacts';
export type GetVerificationPreferences = ({
email,
lifetime,
contactEmailsMap,
}: {
email: string;
lifetime?: number;
contactEmailsMap?: { [email: string]: ContactEmail | undefined };
}) => Promise<VerificationPreferences>;
``` | /content/code_sandbox/packages/shared/lib/interfaces/hooks/GetVerificationPreferences.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 77 |
```xml
import { customFieldsDataByFieldCode } from "@erxes/api-utils/src/fieldUtils";
import { IModels } from "../connectionResolver";
import { ICustomerDocument } from "../db/models/definitions/customers";
import { Transform } from "stream";
import {
EMAIL_VALIDATION_STATUSES,
LOG_MAPPINGS
} from "../data/modules/coc/constants";
import { ICustomField, ILink } from "@erxes/api-utils/src/types";
import { getServices } from "@erxes/api-utils/src/serviceDiscovery";
import EditorAttributeUtil from "@erxes/api-utils/src/editorAttributeUtils";
import { sendEngagesMessage } from "../messageBroker";
import { chunkArray } from "@erxes/api-utils/src";
const createCustomer = async (
models: IModels,
integrationId: string,
customerDoc: any,
brandId?: string,
saveAsCustomer?: boolean
) => {
const doc: any = {
integrationId,
primaryEmail: customerDoc.email || "",
emails: [customerDoc.email || ""],
firstName: customerDoc.firstName || "",
lastName: customerDoc.lastName || "",
middleName: customerDoc.middleName || "",
primaryPhone: customerDoc.phone || "",
scopeBrandIds: [brandId || ""]
};
if (saveAsCustomer) {
doc.state = "customer";
}
return models.Customers.createCustomer(doc);
};
export const buildLabelList = (obj = {}): any[] => {
const list: any[] = [];
const fieldNames: string[] = Object.getOwnPropertyNames(obj);
for (const name of fieldNames) {
const field: any = obj[name];
const label: string = field && field.label ? field.label : "";
list.push({ name, label });
}
return list;
};
const prepareCustomFieldsData = (
customerData: ICustomField[],
submissionData: ICustomField[]
) => {
const customFieldsData: ICustomField[] = customerData;
if (customerData.length === 0) {
return submissionData;
}
for (const data of submissionData) {
const existingData = customerData.find(e => e.field === data.field);
if (existingData) {
if (Array.isArray(existingData.value)) {
existingData.value = existingData.value.concat(data.value);
} else {
existingData.value = data.value;
}
} else {
customFieldsData.push(data);
}
}
return customFieldsData;
};
export const updateCustomerFromForm = async (
models: IModels,
browserInfo: any,
doc: any,
customer: ICustomerDocument
) => {
const customerDoc: any = {
...doc,
location: browserInfo,
firstName: customer.firstName || doc.firstName,
lastName: customer.lastName || doc.lastName,
middleName: customer.middleName || doc.middleName,
sex: doc.pronoun,
birthDate: doc.birthDate,
scopeBrandIds: [...doc.scopeBrandIds, ...(customer.scopeBrandIds || [])],
...(customer.primaryEmail
? {}
: {
emails: [doc.email],
primaryEmail: doc.email
}),
...(customer.primaryPhone
? {}
: {
primaryPhone: doc.phone
})
};
if (!customer.customFieldsData) {
customerDoc.customFieldsData = doc.customFieldsData;
}
if (customer.customFieldsData && doc.customFieldsData.length > 0) {
customerDoc.customFieldsData = prepareCustomFieldsData(
customer.customFieldsData,
doc.customFieldsData
);
}
if (Object.keys(doc.links).length > 0) {
const links = customer.links || {};
for (const key of Object.keys(doc.links)) {
const value = doc.links[key];
if (!value || value.length === 0) {
continue;
}
links[key] = value;
}
customerDoc.links = links;
}
await models.Customers.updateCustomer(customer._id, customerDoc);
};
const getSocialLinkKey = (type: string) => {
return type.substring(type.indexOf("_") + 1);
};
export const getEditorAttributeUtil = async (subdomain: string) => {
const services = await getServices();
const editor = await new EditorAttributeUtil(
`${process.env.DOMAIN}/gateway/pl:core`,
services,
subdomain
);
return editor;
};
export const getSchemaLabels = async (type: string) => {
let fieldNames: any[] = [];
const found: any = LOG_MAPPINGS.find(m => m.name === type);
if (found) {
const schemas: any = found.schemas || [];
for (const schema of schemas) {
// schema comes as either mongoose schema or plain object
const names: string[] = Object.getOwnPropertyNames(schema.obj || schema);
for (const name of names) {
const field: any = schema.obj ? schema.obj[name] : schema[name];
if (field && field.label) {
fieldNames.push({ name, label: field.label });
}
// nested object field names
if (typeof field === "object" && field.type && field.type.obj) {
fieldNames = fieldNames.concat(buildLabelList(field.type.obj));
}
}
} // end schema for loop
} // end schema name mapping
return fieldNames;
};
export const findCustomer = async (
{ Customers }: IModels,
subdomain: string,
doc
) => {
let customer;
const defaultFilter = { status: { $ne: "deleted" } };
if (doc.customerPrimaryEmail) {
customer = await Customers.findOne({
...defaultFilter,
$or: [
{ emails: { $in: [doc.customerPrimaryEmail] } },
{ primaryEmail: doc.customerPrimaryEmail }
]
}).lean();
}
if (!customer && doc.customerPrimaryPhone) {
customer = await Customers.findOne({
...defaultFilter,
$or: [
{ phones: { $in: [doc.customerPrimaryPhone] } },
{ primaryPhone: doc.customerPrimaryPhone }
]
}).lean();
}
if (!customer && doc.customerCode) {
customer = await Customers.findOne({
...defaultFilter,
code: doc.customerCode
}).lean();
}
if (!customer && doc._id) {
customer = await Customers.findOne({
...defaultFilter,
_id: doc._id
}).lean();
}
if (!customer) {
customer = await Customers.findOne(doc).lean();
}
if (customer) {
customer.customFieldsDataByFieldCode = await customFieldsDataByFieldCode(
customer,
subdomain
);
}
return customer;
};
export const findCompany = async (
{ Companies }: IModels,
subdomain: string,
doc
) => {
let company;
const defaultFilter = { status: { $ne: "deleted" } };
if (doc.companyPrimaryName) {
company = await Companies.findOne({
...defaultFilter,
$or: [
{ names: { $in: [doc.companyPrimaryName] } },
{ primaryName: doc.companyPrimaryName }
]
}).lean();
}
if (!company && doc.name) {
company = await Companies.findOne({
...defaultFilter,
$or: [{ names: { $in: [doc.name] } }, { primaryName: doc.name }]
}).lean();
}
if (!company && doc.email) {
company = await Companies.findOne({
...defaultFilter,
$or: [{ emails: { $in: [doc.email] } }, { primaryEmail: doc.email }]
}).lean();
}
if (!company && doc.phone) {
company = await Companies.findOne({
...defaultFilter,
$or: [{ phones: { $in: [doc.phone] } }, { primaryPhone: doc.phone }]
}).lean();
}
if (!company && doc.companyPrimaryEmail) {
company = await Companies.findOne({
...defaultFilter,
$or: [
{ emails: { $in: [doc.companyPrimaryEmail] } },
{ primaryEmail: doc.companyPrimaryEmail }
]
}).lean();
}
if (!company && doc.companyPrimaryPhone) {
company = await Companies.findOne({
...defaultFilter,
$or: [
{ phones: { $in: [doc.companyPrimaryPhone] } },
{ primaryPhone: doc.companyPrimaryPhone }
]
}).lean();
}
if (!company && doc.companyCode) {
company = await Companies.findOne({
...defaultFilter,
code: doc.companyCode
}).lean();
}
if (!company && doc._id) {
company = await Companies.findOne({
...defaultFilter,
_id: doc._id
}).lean();
}
if (!company) {
company = await Companies.findOne(doc).lean();
}
if (company) {
company.customFieldsDataByFieldCode = await customFieldsDataByFieldCode(
company,
subdomain
);
}
return company;
};
export const getContactsContentItem = async (
{ Customers, Companies }: IModels,
activityLog
) => {
const { action, contentType, content } = activityLog;
if (action === "merge") {
let result = {};
switch (contentType) {
case "company":
result = await Companies.find({ _id: { $in: content } }).lean();
break;
case "customer":
result = await Customers.find({ _id: { $in: content } }).lean();
break;
default:
break;
}
return result;
}
return null;
};
export const prepareEngageCustomers = async (
{ Customers }: IModels,
subdomain: string,
{ engageMessage, customersSelector, action, user }
): Promise<any> => {
const customerInfos: Array<{
_id: string;
primaryEmail?: string;
emailValidationStatus?: string;
phoneValidationStatus?: string;
primaryPhone?: string;
replacers: Array<{ key: string; value: string }>;
}> = [];
const emailConf = engageMessage.email ? engageMessage.email : { content: "" };
const emailContent = emailConf.content || "";
const editorAttributeUtil = await getEditorAttributeUtil(subdomain);
const customerFields =
await editorAttributeUtil.getCustomerFields(emailContent);
const exists = { $exists: true, $nin: [null, "", undefined] };
// make sure email & phone are valid
if (engageMessage.method === "email") {
customersSelector.primaryEmail = exists;
customersSelector.emailValidationStatus = EMAIL_VALIDATION_STATUSES.VALID;
}
if (engageMessage.method === "sms") {
customersSelector.primaryPhone = exists;
customersSelector.phoneValidationStatus = EMAIL_VALIDATION_STATUSES.VALID;
}
const onFinishPiping = async () => {
await sendEngagesMessage({
subdomain,
action: "pre-notification",
data: { engageMessage, customerInfos }
});
if (customerInfos.length > 0) {
const data: any = {
...engageMessage,
customers: [],
fromEmail: user.email,
engageMessageId: engageMessage._id
};
if (engageMessage.method === "email" && engageMessage.email) {
const replacedContent = await editorAttributeUtil.replaceAttributes({
customerFields,
content: emailContent,
user
});
engageMessage.email.content = replacedContent;
data.email = engageMessage.email;
}
const chunks = chunkArray(customerInfos, 3000);
for (const chunk of chunks) {
data.customers = chunk;
await sendEngagesMessage({
subdomain,
action: "notification",
data: { action, data }
});
}
}
};
const customersItemsMapping = JSON.parse("{}");
const customerTransformerStream = new Transform({
objectMode: true,
async transform(customer: ICustomerDocument, _encoding, callback) {
const itemsMapping = customersItemsMapping[customer._id] || [null];
for (const item of itemsMapping) {
const replacers = await editorAttributeUtil.generateReplacers({
content: emailContent,
customer,
item,
customerFields
});
customerInfos.push({
_id: customer._id,
primaryEmail: customer.primaryEmail,
emailValidationStatus: customer.emailValidationStatus,
phoneValidationStatus: customer.phoneValidationStatus,
primaryPhone: customer.primaryPhone,
replacers
});
}
// signal upstream that we are ready to take more data
callback();
}
});
// generate fields option =======
const fieldsOption = {
primaryEmail: 1,
emailValidationStatus: 1,
phoneValidationStatus: 1,
primaryPhone: 1
};
for (const field of customerFields || []) {
fieldsOption[field] = 1;
}
const customersStream = (
Customers.find(customersSelector, fieldsOption) as any
).cursor();
return new Promise((resolve, reject) => {
const pipe = customersStream.pipe(customerTransformerStream);
pipe.on("finish", async () => {
try {
await onFinishPiping();
} catch (e) {
return reject(e);
}
resolve({ status: "done", customerInfos });
});
});
};
export const updateContactsField = async (
models: IModels,
subdomain: string,
args: {
browserInfo: any;
cachedCustomerId?: string;
integration: any;
submissionsGrouped: any;
}
) => {
let { cachedCustomerId } = args;
const { browserInfo, integration, submissionsGrouped } = args;
const { leadData } = integration;
const conformityIds: {
[key: string]: { customerId: string; companyId: string };
} = {};
let cachedCustomer;
const customerSchemaLabels = await getSchemaLabels("customer");
const companySchemaLabels = await getSchemaLabels("company");
for (const groupId of Object.keys(submissionsGrouped)) {
const customerLinks: ILink = {};
const companyLinks: ILink = {};
const customerDoc: any = {};
const companyDoc: any = {};
const customFieldsData: ICustomField[] = [];
const companyCustomData: ICustomField[] = [];
const phones: string[] = [];
for (const submission of submissionsGrouped[groupId]) {
const submissionType = submission.type || "";
if (submissionType.includes("customerLinks")) {
customerLinks[getSocialLinkKey(submissionType)] = submission.value;
continue;
}
if (submissionType.includes("companyLinks")) {
companyLinks[getSocialLinkKey(submissionType)] = submission.value;
continue;
}
if (["phone", "internationalPhone"].includes(submissionType)) {
phones.push(submission.value);
continue;
}
if (submissionType === "pronoun") {
switch (submission.value) {
case "Male":
customerDoc.pronoun = 1;
break;
case "Female":
customerDoc.pronoun = 2;
break;
case "Not applicable":
customerDoc.pronoun = 9;
break;
default:
customerDoc.pronoun = 0;
break;
}
continue;
}
if (
customerSchemaLabels.findIndex(e => e.name === submissionType) !== -1
) {
if (
submissionType === "avatar" &&
submission.value &&
submission.value.length > 0
) {
customerDoc.avatar = submission.value[0].url;
continue;
}
customerDoc[submissionType] = submission.value;
continue;
}
if (submissionType.includes("company_")) {
if (
submissionType === "company_avatar" &&
submission.value &&
submission.value.length > 0
) {
companyDoc.avatar = submission.value[0].url;
continue;
}
const key = submissionType.split("_")[1];
companyDoc[key] = submission.value;
continue;
}
if (
companySchemaLabels.findIndex(e => e.name === submissionType) !== -1
) {
companyDoc[submissionType] = submission.value;
continue;
}
if (
submission.associatedFieldId &&
[
"input",
"select",
"multiSelect",
"file",
"textarea",
"radio",
"check",
"map"
].includes(submissionType)
) {
const field = await models.Fields.findOne({
_id: submission.associatedFieldId
});
if (!field) {
continue;
}
const fieldGroup = await models.FieldsGroups.findOne({
_id: field.groupId
});
if (fieldGroup && fieldGroup.contentType === "core:company") {
companyCustomData.push({
field: submission.associatedFieldId,
value: submission.value
});
}
if (fieldGroup && fieldGroup.contentType === "core:customer") {
customFieldsData.push({
field: submission.associatedFieldId,
value: submission.value
});
}
}
}
if (groupId === "default") {
cachedCustomer = await models.Customers.getWidgetCustomer({
integrationId: integration._id,
cachedCustomerId,
email: customerDoc.email || "",
phone: customerDoc.phone || ""
});
if (!cachedCustomer) {
cachedCustomer = await createCustomer(
models,
integration._id,
{ ...customerDoc, phones },
integration.brandId || "",
leadData.saveAsCustomer
);
}
await updateCustomerFromForm(
models,
browserInfo,
{
...customerDoc,
customFieldsData,
links: customerLinks,
phones,
scopeBrandIds: [integration.brandId || ""]
},
cachedCustomer
);
cachedCustomerId = cachedCustomer._id;
conformityIds[groupId] = {
customerId: cachedCustomer._id,
companyId: ""
};
} else {
let customer = await findCustomer(models, subdomain, {
customerPrimaryEmail: customerDoc.email || "",
customerPrimaryPhone: customerDoc.phone || ""
});
if (!customer) {
customer = await createCustomer(
models,
integration._id,
customerDoc,
integration.brandId || ""
);
}
await updateCustomerFromForm(
models,
browserInfo,
{
...customerDoc,
customFieldsData,
links: customerLinks,
phones,
scopeBrandIds: [integration.brandId || ""]
},
customer
);
conformityIds[groupId] = { customerId: customer._id, companyId: "" };
}
if (
!(
companyDoc.primaryEmail ||
companyDoc.primaryPhone ||
companyDoc.primaryName
)
) {
continue;
}
let company = await findCompany(models, subdomain, {
companyPrimaryName: companyDoc.primaryName || "",
companyPrimaryEmail: companyDoc.primaryEmail || "",
companyPrimaryPhone: companyDoc.primaryPhone || ""
});
companyDoc.scopeBrandIds = [integration.brandId || ""];
companyDoc.names = [companyDoc.primaryName || ""];
if (!company) {
company = await models.Companies.createCompany(companyDoc);
}
if (Object.keys(companyLinks).length > 0) {
const links = company.links || {};
for (const key of Object.keys(companyLinks)) {
const value = companyLinks[key];
if (!value || value.length === 0) {
continue;
}
links[key] = value;
}
companyDoc.links = links;
}
if (!company.customFieldsData) {
companyDoc.customFieldsData = companyCustomData;
}
if (company.customFieldsData && companyCustomData.length > 0) {
companyDoc.customFieldsData = prepareCustomFieldsData(
company.customFieldsData,
companyCustomData
);
}
company = await models.Companies.updateCompany(company._id, companyDoc);
// if company scopeBrandIds does not contain brandId
if (
company.scopeBrandIds.findIndex(e => e === integration.brandId) === -1
) {
await models.Companies.updateOne(
{ _id: company._id },
{ $push: { scopeBrandIds: integration.brandId } }
);
}
conformityIds[groupId] = {
companyId: company._id,
customerId: conformityIds[groupId].customerId
};
}
let mainCompanyId = "";
const relTypeIds: string[] = [];
for (const key of Object.keys(conformityIds)) {
const { companyId, customerId } = conformityIds[key];
if (key === "default" && companyId && customerId) {
mainCompanyId = companyId;
relTypeIds.push(customerId);
}
if (key !== "default" && companyId && customerId) {
await models.Conformities.addConformities([
{
mainType: "company",
mainTypeId: companyId,
relType: "customer",
relTypeId: customerId
}
]);
}
if (key !== "default" && !companyId && customerId) {
relTypeIds.push(customerId);
}
}
if (mainCompanyId !== "" && relTypeIds.length > 0) {
for (const relTypeId of relTypeIds) {
await models.Conformities.addConformities([
{
mainType: "company",
mainTypeId: mainCompanyId,
relType: "customer",
relTypeId
}
]);
}
}
return models.Customers.findOne({ _id: cachedCustomerId });
};
// const generateUsersOptions = async (
// name: string,
// label: string,
// type: string,
// subdomain: string
// ) => {
// const users = await sendCoreMessage({
// subdomain,
// action: "users.find",
// data: {
// query: {}
// },
// isRPC: true
// });
// const options: Array<{ label: string; value: any }> = users.map(user => ({
// value: user._id,
// label: user.username || user.email || ""
// }));
// return {
// _id: Math.random(),
// name,
// label,
// type,
// selectOptions: options
// };
// };
// const generateBrandsOptions = async (
// name: string,
// label: string,
// type: string,
// subdomain: string
// ) => {
// const brands = await sendCoreMessage({
// subdomain,
// action: "brands.find",
// data: {
// query: {}
// },
// isRPC: true
// });
// const options: Array<{ label: string; value: any }> = brands.map(brand => ({
// value: brand._id,
// label: brand.name
// }));
// return {
// _id: Math.random(),
// name,
// label,
// type,
// selectOptions: options
// };
// };
// const getTags = async (type: string, subdomain: string) => {
// const tags = await sendCoreMessage({
// subdomain,
// action: "tagFind",
// data: {
// type: `core:${["lead", "visitor"].includes(type) ? "customer" : type}`
// },
// isRPC: true,
// defaultValue: []
// });
// const selectOptions: Array<{ label: string; value: any }> = [];
// for (const tag of tags) {
// selectOptions.push({
// value: tag._id,
// label: tag.name
// });
// }
// return {
// _id: Math.random(),
// name: "tagIds",
// label: "Tag",
// type: "tag",
// selectOptions
// };
// };
// const getIntegrations = async (subdomain: string) => {
// const integrations = await sendInboxMessage({
// subdomain,
// action: "integrations.find",
// data: { query: {} },
// isRPC: true,
// defaultValue: []
// });
// const selectOptions: Array<{ label: string; value: any }> = [];
// for (const integration of integrations) {
// selectOptions.push({
// value: integration._id,
// label: integration.name
// });
// }
// return {
// _id: Math.random(),
// name: "relatedIntegrationIds",
// label: "Related integration",
// selectOptions
// };
// };
// const getFormSubmissionFields = async (subdomain, config) => {
// const fields = await sendCoreMessage({
// subdomain,
// action: "fields.fieldsCombinedByContentType",
// data: {
// contentType: "forms:form_submission",
// config
// },
// isRPC: true,
// defaultValue: []
// });
// return fields.map(field => ({
// ...field,
// label: `form_submission:${field?.label || ""}`
// }));
// };
// export const generateFields = async ({ subdomain, data }) => {
// const { type, usageType } = data;
// const models = await generateModels(subdomain);
// const { Customers, Companies } = models;
// let schema: any;
// let fields: Array<{
// _id: number;
// name: string;
// group?: string;
// label?: string;
// type?: string;
// validation?: string;
// options?: string[];
// selectOptions?: Array<{ label: string; value: string }>;
// }> = [];
// switch (type) {
// case "lead":
// schema = Customers.schema;
// case "customer":
// schema = Customers.schema;
// break;
// case "company":
// schema = Companies.schema;
// break;
// }
// if (schema) {
// // generate list using customer or company schema
// fields = [...fields, ...(await generateFieldsFromSchema(schema, ""))];
// for (const name of Object.keys(schema.paths)) {
// const path = schema.paths[name];
// // extend fields list using sub schema fields
// if (path.schema) {
// fields = [
// ...fields,
// ...(await generateFieldsFromSchema(path.schema, `${name}.`))
// ];
// }
// }
// }
// if (!usageType || usageType === "export") {
// const aggre = await fetchEs({
// subdomain,
// action: "search",
// index: type === "company" ? "companies" : "customers",
// body: {
// size: 0,
// _source: false,
// aggs: {
// trackedDataKeys: {
// nested: {
// path: "trackedData"
// },
// aggs: {
// fieldKeys: {
// terms: {
// field: "trackedData.field",
// size: 10000
// }
// }
// }
// }
// }
// },
// defaultValue: { aggregations: { trackedDataKeys: {} } }
// });
// const aggregations = aggre.aggregations || { trackedDataKeys: {} };
// const buckets = (aggregations.trackedDataKeys.fieldKeys || { buckets: [] })
// .buckets;
// for (const bucket of buckets) {
// fields.push({
// _id: Math.random(),
// name: `trackedData.${bucket.key}`,
// label: bucket.key
// });
// }
// }
// const ownerOptions = await generateUsersOptions(
// "ownerId",
// "Owner",
// "user",
// subdomain
// );
// const tags = await getTags(type, subdomain);
// fields = [...fields, tags];
// if (type === "customer" || type === "lead") {
// const { config } = data;
// const integrations = await getIntegrations(subdomain);
// if (config) {
// const formSubmissionFields = await getFormSubmissionFields(
// subdomain,
// config
// );
// fields = [...fields, ...formSubmissionFields];
// }
// fields = [...fields, integrations];
// if (usageType === "import") {
// fields.push({
// _id: Math.random(),
// name: "companiesPrimaryNames",
// label: "Company Primary Names"
// });
// fields.push({
// _id: Math.random(),
// name: "companiesPrimaryEmails",
// label: "Company Primary Emails"
// });
// }
// }
// if (process.env.USE_BRAND_RESTRICTIONS) {
// const brandsOptions = await generateBrandsOptions(
// "scopeBrandIds",
// "Brands",
// "brand",
// subdomain
// );
// fields.push(brandsOptions);
// }
// fields = [...fields, ownerOptions];
// if (usageType === "import") {
// for (const extendField of EXTEND_FIELDS.ALL) {
// fields.push({
// _id: Math.random(),
// ...extendField
// });
// }
// }
// return fields;
// };
// export const getContentItem = async (
// { Customers, Companies }: IModels,
// activityLog
// ) => {
// const { action, contentType, content } = activityLog;
// if (action === "merge") {
// let result = {};
// switch (contentType) {
// case "company":
// result = await Companies.find({ _id: { $in: content } }).lean();
// break;
// case "customer":
// result = await Customers.find({ _id: { $in: content } }).lean();
// break;
// default:
// break;
// }
// return result;
// }
// return null;
// };
// export const getEditorAttributeUtil = async (subdomain: string) => {
// const services = await getServices();
// const editor = await new EditorAttributeUtil(
// `${process.env.DOMAIN}/gateway/pl:core`,
// services,
// subdomain
// );
// return editor;
// };
// export const prepareEngageCustomers = async (
// { Customers }: IModels,
// subdomain: string,
// { engageMessage, customersSelector, action, user }
// ): Promise<any> => {
// const customerInfos: Array<{
// _id: string;
// primaryEmail?: string;
// emailValidationStatus?: string;
// phoneValidationStatus?: string;
// primaryPhone?: string;
// replacers: Array<{ key: string; value: string }>;
// }> = [];
// const emailConf = engageMessage.email ? engageMessage.email : { content: "" };
// const emailContent = emailConf.content || "";
// const editorAttributeUtil = await getEditorAttributeUtil(subdomain);
// const customerFields =
// await editorAttributeUtil.getCustomerFields(emailContent);
// const exists = { $exists: true, $nin: [null, "", undefined] };
// // make sure email & phone are valid
// if (engageMessage.method === "email") {
// customersSelector.primaryEmail = exists;
// customersSelector.emailValidationStatus = EMAIL_VALIDATION_STATUSES.VALID;
// }
// if (engageMessage.method === "sms") {
// customersSelector.primaryPhone = exists;
// customersSelector.phoneValidationStatus = EMAIL_VALIDATION_STATUSES.VALID;
// }
// const onFinishPiping = async () => {
// await sendEngagesMessage({
// subdomain,
// action: "pre-notification",
// data: { engageMessage, customerInfos }
// });
// if (customerInfos.length > 0) {
// const data: any = {
// ...engageMessage,
// customers: [],
// fromEmail: user.email,
// engageMessageId: engageMessage._id
// };
// if (engageMessage.method === "email" && engageMessage.email) {
// const replacedContent = await editorAttributeUtil.replaceAttributes({
// customerFields,
// content: emailContent,
// user
// });
// engageMessage.email.content = replacedContent;
// data.email = engageMessage.email;
// }
// const chunks = chunkArray(customerInfos, 3000);
// for (const chunk of chunks) {
// data.customers = chunk;
// await sendEngagesMessage({
// subdomain,
// action: "notification",
// data: { action, data }
// });
// }
// }
// };
// const customersItemsMapping = JSON.parse("{}");
// const customerTransformerStream = new Transform({
// objectMode: true,
// async transform(customer: ICustomerDocument, _encoding, callback) {
// const itemsMapping = customersItemsMapping[customer._id] || [null];
// for (const item of itemsMapping) {
// const replacers = await editorAttributeUtil.generateReplacers({
// content: emailContent,
// customer,
// item,
// customerFields
// });
// customerInfos.push({
// _id: customer._id,
// primaryEmail: customer.primaryEmail,
// emailValidationStatus: customer.emailValidationStatus,
// phoneValidationStatus: customer.phoneValidationStatus,
// primaryPhone: customer.primaryPhone,
// replacers
// });
// }
// // signal upstream that we are ready to take more data
// callback();
// }
// });
// // generate fields option =======
// const fieldsOption = {
// primaryEmail: 1,
// emailValidationStatus: 1,
// phoneValidationStatus: 1,
// primaryPhone: 1
// };
// for (const field of customerFields || []) {
// fieldsOption[field] = 1;
// }
// const customersStream = (
// Customers.find(customersSelector, fieldsOption) as any
// ).cursor();
// return new Promise((resolve, reject) => {
// const pipe = customersStream.pipe(customerTransformerStream);
// pipe.on("finish", async () => {
// try {
// await onFinishPiping();
// } catch (e) {
// return reject(e);
// }
// resolve({ status: "done", customerInfos });
// });
// });
// };
// export const generateSystemFields = ({ data: { groupId } }) => {
// const contactsFields: any = [];
// const serviceName = "contacts";
// CUSTOMER_BASIC_INFO.ALL.map(e => {
// contactsFields.push({
// text: e.label,
// type: e.field,
// canHide: e.canHide,
// validation: e.validation,
// groupId,
// contentType: `${serviceName}:customer`,
// isDefinedByErxes: true
// });
// });
// COMPANY_INFO.ALL.map(e => {
// contactsFields.push({
// text: e.label,
// type: e.field,
// canHide: e.canHide,
// validation: e.validation,
// groupId,
// contentType: `${serviceName}:company`,
// isDefinedByErxes: true
// });
// });
// DEVICE_PROPERTIES_INFO.ALL.map(e => {
// contactsFields.push({
// text: e.label,
// type: e.field,
// groupId,
// contentType: `${serviceName}:device`,
// isDefinedByErxes: true
// });
// });
// return contactsFields;
// };
// export const updateContactsField = async (
// models: IModels,
// subdomain: string,
// args: {
// browserInfo: any;
// cachedCustomerId?: string;
// integration: any;
// submissionsGrouped: any;
// }
// ) => {
// let { cachedCustomerId } = args;
// const { browserInfo, integration, submissionsGrouped } = args;
// const { leadData } = integration;
// const conformityIds: {
// [key: string]: { customerId: string; companyId: string };
// } = {};
// let cachedCustomer;
// const customerSchemaLabels = await getSchemaLabels("customer");
// const companySchemaLabels = await getSchemaLabels("company");
// for (const groupId of Object.keys(submissionsGrouped)) {
// const customerLinks: ILink = {};
// const companyLinks: ILink = {};
// const customerDoc: any = {};
// const companyDoc: any = {};
// const customFieldsData: ICustomField[] = [];
// const companyCustomData: ICustomField[] = [];
// const phones: string[] = [];
// for (const submission of submissionsGrouped[groupId]) {
// const submissionType = submission.type || "";
// if (submissionType.includes("customerLinks")) {
// customerLinks[getSocialLinkKey(submissionType)] = submission.value;
// continue;
// }
// if (submissionType.includes("companyLinks")) {
// companyLinks[getSocialLinkKey(submissionType)] = submission.value;
// continue;
// }
// if (["phone", "internationalPhone"].includes(submissionType)) {
// phones.push(submission.value);
// continue;
// }
// if (submissionType === "pronoun") {
// switch (submission.value) {
// case "Male":
// customerDoc.pronoun = 1;
// break;
// case "Female":
// customerDoc.pronoun = 2;
// break;
// case "Not applicable":
// customerDoc.pronoun = 9;
// break;
// default:
// customerDoc.pronoun = 0;
// break;
// }
// continue;
// }
// if (
// customerSchemaLabels.findIndex(e => e.name === submissionType) !== -1
// ) {
// if (
// submissionType === "avatar" &&
// submission.value &&
// submission.value.length > 0
// ) {
// customerDoc.avatar = submission.value[0].url;
// continue;
// }
// customerDoc[submissionType] = submission.value;
// continue;
// }
// if (submissionType.includes("company_")) {
// if (
// submissionType === "company_avatar" &&
// submission.value &&
// submission.value.length > 0
// ) {
// companyDoc.avatar = submission.value[0].url;
// continue;
// }
// const key = submissionType.split("_")[1];
// companyDoc[key] = submission.value;
// continue;
// }
// if (
// companySchemaLabels.findIndex(e => e.name === submissionType) !== -1
// ) {
// companyDoc[submissionType] = submission.value;
// continue;
// }
// if (
// submission.associatedFieldId &&
// [
// "input",
// "select",
// "multiSelect",
// "file",
// "textarea",
// "radio",
// "check",
// "map"
// ].includes(submissionType)
// ) {
// const field = await sendCoreMessage({
// subdomain,
// action: "fields.findOne",
// data: {
// query: {
// _id: submission.associatedFieldId
// }
// },
// isRPC: true
// });
// if (!field) {
// continue;
// }
// const fieldGroup = await sendCoreMessage({
// subdomain,
// action: "fieldsGroups.findOne",
// data: {
// query: {
// _id: field.groupId
// }
// },
// isRPC: true
// });
// if (fieldGroup && fieldGroup.contentType === "core:company") {
// companyCustomData.push({
// field: submission.associatedFieldId,
// value: submission.value
// });
// }
// if (fieldGroup && fieldGroup.contentType === "core:customer") {
// customFieldsData.push({
// field: submission.associatedFieldId,
// value: submission.value
// });
// }
// }
// }
// if (groupId === "default") {
// cachedCustomer = await models.Customers.getWidgetCustomer({
// integrationId: integration._id,
// cachedCustomerId,
// email: customerDoc.email || "",
// phone: customerDoc.phone || ""
// });
// if (!cachedCustomer) {
// cachedCustomer = await createCustomer(
// models,
// integration._id,
// { ...customerDoc, phones },
// integration.brandId || "",
// leadData.saveAsCustomer
// );
// }
// await updateCustomerFromForm(
// models,
// browserInfo,
// {
// ...customerDoc,
// customFieldsData,
// links: customerLinks,
// phones,
// scopeBrandIds: [integration.brandId || ""]
// },
// cachedCustomer
// );
// cachedCustomerId = cachedCustomer._id;
// conformityIds[groupId] = {
// customerId: cachedCustomer._id,
// companyId: ""
// };
// } else {
// let customer = await findCustomer(models, subdomain, {
// customerPrimaryEmail: customerDoc.email || "",
// customerPrimaryPhone: customerDoc.phone || ""
// });
// if (!customer) {
// customer = await createCustomer(
// models,
// integration._id,
// customerDoc,
// integration.brandId || ""
// );
// }
// await updateCustomerFromForm(
// models,
// browserInfo,
// {
// ...customerDoc,
// customFieldsData,
// links: customerLinks,
// phones,
// scopeBrandIds: [integration.brandId || ""]
// },
// customer
// );
// conformityIds[groupId] = { customerId: customer._id, companyId: "" };
// }
// if (
// !(
// companyDoc.primaryEmail ||
// companyDoc.primaryPhone ||
// companyDoc.primaryName
// )
// ) {
// continue;
// }
// let company = await findCompany(models, subdomain, {
// companyPrimaryName: companyDoc.primaryName || "",
// companyPrimaryEmail: companyDoc.primaryEmail || "",
// companyPrimaryPhone: companyDoc.primaryPhone || ""
// });
// companyDoc.scopeBrandIds = [integration.brandId || ""];
// companyDoc.names = [companyDoc.primaryName || ""];
// if (!company) {
// company = await models.Companies.createCompany(companyDoc);
// }
// if (Object.keys(companyLinks).length > 0) {
// const links = company.links || {};
// for (const key of Object.keys(companyLinks)) {
// const value = companyLinks[key];
// if (!value || value.length === 0) {
// continue;
// }
// links[key] = value;
// }
// companyDoc.links = links;
// }
// if (!company.customFieldsData) {
// companyDoc.customFieldsData = companyCustomData;
// }
// if (company.customFieldsData && companyCustomData.length > 0) {
// companyDoc.customFieldsData = prepareCustomFieldsData(
// company.customFieldsData,
// companyCustomData
// );
// }
// company = await models.Companies.updateCompany(company._id, companyDoc);
// // if company scopeBrandIds does not contain brandId
// if (
// company.scopeBrandIds.findIndex(e => e === integration.brandId) === -1
// ) {
// await models.Companies.updateOne(
// { _id: company._id },
// { $push: { scopeBrandIds: integration.brandId } }
// );
// }
// conformityIds[groupId] = {
// companyId: company._id,
// customerId: conformityIds[groupId].customerId
// };
// }
// let mainCompanyId = "";
// const relTypeIds: string[] = [];
// for (const key of Object.keys(conformityIds)) {
// const { companyId, customerId } = conformityIds[key];
// if (key === "default" && companyId && customerId) {
// mainCompanyId = companyId;
// relTypeIds.push(customerId);
// }
// if (key !== "default" && companyId && customerId) {
// await sendCoreMessage({
// subdomain,
// action: "conformities.addConformities",
// data: {
// mainType: "company",
// mainTypeId: companyId,
// relType: "customer",
// relTypeId: customerId
// }
// });
// }
// if (key !== "default" && !companyId && customerId) {
// relTypeIds.push(customerId);
// }
// }
// if (mainCompanyId !== "" && relTypeIds.length > 0) {
// for (const relTypeId of relTypeIds) {
// await sendCoreMessage({
// subdomain,
// action: "conformities.addConformity",
// data: {
// mainType: "company",
// mainTypeId: mainCompanyId,
// relType: "customer",
// relTypeId
// }
// });
// }
// }
// return models.Customers.findOne({ _id: cachedCustomerId });
// };
// export const updateCustomerFromForm = async (
// models: IModels,
// browserInfo: any,
// doc: any,
// customer: ICustomerDocument
// ) => {
// const customerDoc: any = {
// ...doc,
// location: browserInfo,
// firstName: customer.firstName || doc.firstName,
// lastName: customer.lastName || doc.lastName,
// middleName: customer.middleName || doc.middleName,
// sex: doc.pronoun,
// birthDate: doc.birthDate,
// scopeBrandIds: [...doc.scopeBrandIds, ...(customer.scopeBrandIds || [])],
// ...(customer.primaryEmail
// ? {}
// : {
// emails: [doc.email],
// primaryEmail: doc.email
// }),
// ...(customer.primaryPhone
// ? {}
// : {
// primaryPhone: doc.phone
// })
// };
// if (!customer.customFieldsData) {
// customerDoc.customFieldsData = doc.customFieldsData;
// }
// if (customer.customFieldsData && doc.customFieldsData.length > 0) {
// customerDoc.customFieldsData = prepareCustomFieldsData(
// customer.customFieldsData,
// doc.customFieldsData
// );
// }
// if (Object.keys(doc.links).length > 0) {
// const links = customer.links || {};
// for (const key of Object.keys(doc.links)) {
// const value = doc.links[key];
// if (!value || value.length === 0) {
// continue;
// }
// links[key] = value;
// }
// customerDoc.links = links;
// }
// await models.Customers.updateCustomer(customer._id, customerDoc);
// };
// const prepareCustomFieldsData = (
// customerData: ICustomField[],
// submissionData: ICustomField[]
// ) => {
// const customFieldsData: ICustomField[] = customerData;
// if (customerData.length === 0) {
// return submissionData;
// }
// for (const data of submissionData) {
// const existingData = customerData.find(e => e.field === data.field);
// if (existingData) {
// if (Array.isArray(existingData.value)) {
// existingData.value = existingData.value.concat(data.value);
// } else {
// existingData.value = data.value;
// }
// } else {
// customFieldsData.push(data);
// }
// }
// return customFieldsData;
// };
// const createCustomer = async (
// models: IModels,
// integrationId: string,
// customerDoc: any,
// brandId?: string,
// saveAsCustomer?: boolean
// ) => {
// const doc: any = {
// integrationId,
// primaryEmail: customerDoc.email || "",
// emails: [customerDoc.email || ""],
// firstName: customerDoc.firstName || "",
// lastName: customerDoc.lastName || "",
// middleName: customerDoc.middleName || "",
// primaryPhone: customerDoc.phone || "",
// scopeBrandIds: [brandId || ""]
// };
// if (saveAsCustomer) {
// doc.state = "customer";
// }
// return models.Customers.createCustomer(doc);
// };
// const getSocialLinkKey = (type: string) => {
// return type.substring(type.indexOf("_") + 1);
// };
// export const getSchemaLabels = async (type: string) => {
// let fieldNames: any[] = [];
// const found: any = LOG_MAPPINGS.find(m => m.name === type);
// if (found) {
// const schemas: any = found.schemas || [];
// for (const schema of schemas) {
// // schema comes as either mongoose schema or plain object
// const names: string[] = Object.getOwnPropertyNames(schema.obj || schema);
// for (const name of names) {
// const field: any = schema.obj ? schema.obj[name] : schema[name];
// if (field && field.label) {
// fieldNames.push({ name, label: field.label });
// }
// // nested object field names
// if (typeof field === "object" && field.type && field.type.obj) {
// fieldNames = fieldNames.concat(buildLabelList(field.type.obj));
// }
// }
// } // end schema for loop
// } // end schema name mapping
// return fieldNames;
// };
// export const buildLabelList = (obj = {}): any[] => {
// const list: any[] = [];
// const fieldNames: string[] = Object.getOwnPropertyNames(obj);
// for (const name of fieldNames) {
// const field: any = obj[name];
// const label: string = field && field.label ? field.label : "";
// list.push({ name, label });
// }
// return list;
// };
// const LOG_MAPPINGS = [
// {
// name: MODULE_NAMES.CUSTOMER,
// schemas: [customerSchema, locationSchema, visitorContactSchema]
// },
// {
// name: MODULE_NAMES.COMPANY,
// schemas: [companySchema]
// }
// ];
``` | /content/code_sandbox/packages/core/src/messageBrokers/utils.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 11,114 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<project name="ext-theme-neutral" default=".help">
<!--
The build-impl.xml file imported here contains the guts of the build process. It is
a great idea to read that file to understand how the process works, but it is best to
limit your changes to this file.
-->
<import file="${basedir}/.sencha/package/build-impl.xml"/>
<import file="${basedir}/.sencha/test/test-impl.xml"/>
<!--
The following targets can be provided to inject logic before and/or after key steps
of the build process:
The "init-local" target is used to initialize properties that may be personalized
for the local machine.
<target name="-before-init-local"/>
<target name="-after-init-local"/>
The "clean" target is used to clean build output from the build.dir.
<target name="-before-clean"/>
<target name="-after-clean"/>
The general "init" target is used to initialize all other properties, including
those provided by Sencha Cmd.
<target name="-before-init"/>
<target name="-after-init"/>
The "build" target performs the call to Sencha Cmd to build the application.
<target name="-before-build"/>
<target name="-after-build"/>
-->
</project>
``` | /content/code_sandbox/ext/packages/ext-theme-neutral/build.xml | xml | 2016-04-12T18:27:27 | 2024-08-16T16:17:46 | community-edition | ramboxapp/community-edition | 6,351 | 296 |
```xml
export const functions: string[] = [
// path_to_url
//
// path_to_url#aggregate-functions
// 'ANY',
'APPROX_COUNT_DISTINCT',
'APPROX_PERCENTILE',
'AVG',
'BIT_AND',
'BIT_OR',
'BIT_XOR',
'BOOL_AND',
'BOOL_OR',
'COLLECT_LIST',
'COLLECT_SET',
'CORR',
'COUNT',
'COUNT',
'COUNT',
'COUNT_IF',
'COUNT_MIN_SKETCH',
'COVAR_POP',
'COVAR_SAMP',
'EVERY',
'FIRST',
'FIRST_VALUE',
'GROUPING',
'GROUPING_ID',
'KURTOSIS',
'LAST',
'LAST_VALUE',
'MAX',
'MAX_BY',
'MEAN',
'MIN',
'MIN_BY',
'PERCENTILE',
'PERCENTILE',
'PERCENTILE_APPROX',
'SKEWNESS',
// 'SOME',
'STD',
'STDDEV',
'STDDEV_POP',
'STDDEV_SAMP',
'SUM',
'VAR_POP',
'VAR_SAMP',
'VARIANCE',
// path_to_url#window-functions
'CUME_DIST',
'DENSE_RANK',
'LAG',
'LEAD',
'NTH_VALUE',
'NTILE',
'PERCENT_RANK',
'RANK',
'ROW_NUMBER',
// path_to_url#array-functions
'ARRAY',
'ARRAY_CONTAINS',
'ARRAY_DISTINCT',
'ARRAY_EXCEPT',
'ARRAY_INTERSECT',
'ARRAY_JOIN',
'ARRAY_MAX',
'ARRAY_MIN',
'ARRAY_POSITION',
'ARRAY_REMOVE',
'ARRAY_REPEAT',
'ARRAY_UNION',
'ARRAYS_OVERLAP',
'ARRAYS_ZIP',
'FLATTEN',
'SEQUENCE',
'SHUFFLE',
'SLICE',
'SORT_ARRAY',
// path_to_url#map-functions
'ELEMENT_AT',
'ELEMENT_AT',
'MAP_CONCAT',
'MAP_ENTRIES',
'MAP_FROM_ARRAYS',
'MAP_FROM_ENTRIES',
'MAP_KEYS',
'MAP_VALUES',
'STR_TO_MAP',
// path_to_url#date-and-timestamp-functions
'ADD_MONTHS',
'CURRENT_DATE',
'CURRENT_DATE',
'CURRENT_TIMESTAMP',
'CURRENT_TIMESTAMP',
'CURRENT_TIMEZONE',
'DATE_ADD',
'DATE_FORMAT',
'DATE_FROM_UNIX_DATE',
'DATE_PART',
'DATE_SUB',
'DATE_TRUNC',
'DATEDIFF',
'DAY',
'DAYOFMONTH',
'DAYOFWEEK',
'DAYOFYEAR',
'EXTRACT',
'FROM_UNIXTIME',
'FROM_UTC_TIMESTAMP',
'HOUR',
'LAST_DAY',
'MAKE_DATE',
'MAKE_DT_INTERVAL',
'MAKE_INTERVAL',
'MAKE_TIMESTAMP',
'MAKE_YM_INTERVAL',
'MINUTE',
'MONTH',
'MONTHS_BETWEEN',
'NEXT_DAY',
'NOW',
'QUARTER',
'SECOND',
'SESSION_WINDOW',
'TIMESTAMP_MICROS',
'TIMESTAMP_MILLIS',
'TIMESTAMP_SECONDS',
'TO_DATE',
'TO_TIMESTAMP',
'TO_UNIX_TIMESTAMP',
'TO_UTC_TIMESTAMP',
'TRUNC',
'UNIX_DATE',
'UNIX_MICROS',
'UNIX_MILLIS',
'UNIX_SECONDS',
'UNIX_TIMESTAMP',
'WEEKDAY',
'WEEKOFYEAR',
'WINDOW',
'YEAR',
// path_to_url#json-functions
'FROM_JSON',
'GET_JSON_OBJECT',
'JSON_ARRAY_LENGTH',
'JSON_OBJECT_KEYS',
'JSON_TUPLE',
'SCHEMA_OF_JSON',
'TO_JSON',
// path_to_url
'ABS',
'ACOS',
'ACOSH',
'AGGREGATE',
'ARRAY_SORT',
'ASCII',
'ASIN',
'ASINH',
'ASSERT_TRUE',
'ATAN',
'ATAN2',
'ATANH',
'BASE64',
'BIN',
'BIT_COUNT',
'BIT_GET',
'BIT_LENGTH',
'BROUND',
'BTRIM',
'CARDINALITY',
'CBRT',
'CEIL',
'CEILING',
'CHAR_LENGTH',
'CHARACTER_LENGTH',
'CHR',
'CONCAT',
'CONCAT_WS',
'CONV',
'COS',
'COSH',
'COT',
'CRC32',
'CURRENT_CATALOG',
'CURRENT_DATABASE',
'CURRENT_USER',
'DEGREES',
// 'E',
'ELT',
'EXP',
'EXPM1',
'FACTORIAL',
'FIND_IN_SET',
'FLOOR',
'FORALL',
'FORMAT_NUMBER',
'FORMAT_STRING',
'FROM_CSV',
'GETBIT',
'HASH',
'HEX',
'HYPOT',
'INITCAP',
'INLINE',
'INLINE_OUTER',
'INPUT_FILE_BLOCK_LENGTH',
'INPUT_FILE_BLOCK_START',
'INPUT_FILE_NAME',
'INSTR',
'ISNAN',
'ISNOTNULL',
'ISNULL',
'JAVA_METHOD',
'LCASE',
'LEFT',
'LENGTH',
'LEVENSHTEIN',
'LN',
'LOCATE',
'LOG',
'LOG10',
'LOG1P',
'LOG2',
'LOWER',
'LPAD',
'LTRIM',
'MAP_FILTER',
'MAP_ZIP_WITH',
'MD5',
'MOD',
'MONOTONICALLY_INCREASING_ID',
'NAMED_STRUCT',
'NANVL',
'NEGATIVE',
'NVL',
'NVL2',
'OCTET_LENGTH',
'OVERLAY',
'PARSE_URL',
'PI',
'PMOD',
'POSEXPLODE',
'POSEXPLODE_OUTER',
'POSITION',
'POSITIVE',
'POW',
'POWER',
'PRINTF',
'RADIANS',
'RAISE_ERROR',
'RAND',
'RANDN',
'RANDOM',
'REFLECT',
'REGEXP_EXTRACT',
'REGEXP_EXTRACT_ALL',
'REGEXP_LIKE',
'REGEXP_REPLACE',
'REPEAT',
'REPLACE',
'REVERSE',
'RIGHT',
'RINT',
'ROUND',
'RPAD',
'RTRIM',
'SCHEMA_OF_CSV',
'SENTENCES',
'SHA',
'SHA1',
'SHA2',
'SHIFTLEFT',
'SHIFTRIGHT',
'SHIFTRIGHTUNSIGNED',
'SIGN',
'SIGNUM',
'SIN',
'SINH',
'SOUNDEX',
'SPACE',
'SPARK_PARTITION_ID',
'SPLIT',
'SQRT',
'STACK',
'SUBSTR',
'SUBSTRING',
'SUBSTRING_INDEX',
'TAN',
'TANH',
'TO_CSV',
'TRANSFORM_KEYS',
'TRANSFORM_VALUES',
'TRANSLATE',
'TRIM',
'TRY_ADD',
'TRY_DIVIDE',
'TYPEOF',
'UCASE',
'UNBASE64',
'UNHEX',
'UPPER',
'UUID',
'VERSION',
'WIDTH_BUCKET',
'XPATH',
'XPATH_BOOLEAN',
'XPATH_DOUBLE',
'XPATH_FLOAT',
'XPATH_INT',
'XPATH_LONG',
'XPATH_NUMBER',
'XPATH_SHORT',
'XPATH_STRING',
'XXHASH64',
'ZIP_WITH',
// cast
'CAST',
// Shorthand functions to use in place of CASE expression
'COALESCE',
'NULLIF',
];
``` | /content/code_sandbox/src/languages/spark/spark.functions.ts | xml | 2016-09-12T13:09:04 | 2024-08-16T10:30:12 | sql-formatter | sql-formatter-org/sql-formatter | 2,272 | 1,780 |
```xml
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* Measures the total success or failures for the display name selection step when signing up
*/
export interface WebCoreSignupCongratulationsStepDisplayNameChoiceTotal {
Value: number;
Labels: {
status: "success" | "failure";
application: "proton-vpn-settings" | "proton-account";
};
}
``` | /content/code_sandbox/packages/metrics/types/web_core_signup_congratulationsStep_displayNameChoice_total_v1.schema.d.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 118 |
```xml
import { build } from 'esbuild'
/**
* We publish the "pnpm" package bundled with all refclone artifacts for macOS and Windows.
* Unfortunately, we need to do this because otherwise corepack wouldn't be able to install
* pnpm with reflink support. Reflink is only unpacking the pnpm tarball and does no additional actions.
*/
;(async () => {
try {
await build({
entryPoints: ['lib/pnpm.js'],
bundle: true,
platform: 'node',
outfile: 'dist/pnpm.cjs',
external: ['node-gyp'],
define: {
'process.env.npm_package_name': JSON.stringify(
process.env.npm_package_name
),
'process.env.npm_package_version': JSON.stringify(
process.env.npm_package_version
),
},
loader: {
'.node': 'copy',
},
})
await build({
entryPoints: ['../worker/lib/worker.js'],
bundle: true,
platform: 'node',
outfile: 'dist/worker.js',
loader: {
'.node': 'copy',
},
})
} catch (err) {
console.error(err)
process.exit(1)
}
})()
``` | /content/code_sandbox/pnpm/bundle.ts | xml | 2016-01-28T07:40:43 | 2024-08-16T12:38:47 | pnpm | pnpm/pnpm | 28,869 | 265 |
```xml
export { menuVariables as menuItemIndicatorVariables } from './menuVariables';
``` | /content/code_sandbox/packages/fluentui/react-northstar/src/themes/teams-dark/components/Menu/menuItemIndicatorVariables.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 15 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignWithParentIfMissing="true"
android:orientation="vertical">
<com.jeek.calendar.widget.calendar.WeekBarView
android:layout_width="match_parent"
android:layout_height="@dimen/week_bar_height"
android:background="@color/calendar_bg_color"
app:week_text_size="@integer/calendar_text_size"/>
<com.jeek.calendar.widget.calendar.schedule.ScheduleLayout
android:id="@+id/slSchedule"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:auto_change_month_row="true"
app:default_view="month">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/rlMonthCalendar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.jeek.calendar.widget.calendar.month.MonthCalendarView
android:id="@+id/mcvCalendar"
android:layout_width="match_parent"
android:layout_height="@dimen/month_calendar_height"
android:background="@color/calendar_bg_color"
android:overScrollMode="never"
app:month_day_text_size="@integer/calendar_text_size"
app:month_holiday_color="@color/holiday_text_color"
app:month_selected_circle_color="@color/select_circle_color"
app:month_show_holiday_hint="true"
app:month_show_lunar="true"
app:month_show_task_hint="false"/>
</RelativeLayout>
<com.jeek.calendar.widget.calendar.week.WeekCalendarView
android:id="@+id/wcvCalendar"
android:layout_width="match_parent"
android:layout_height="@dimen/week_calendar_height"
android:background="@color/calendar_bg_color"
android:overScrollMode="never"
android:visibility="gone"
app:week_day_text_size="@integer/calendar_text_size"
app:week_holiday_color="@color/holiday_text_color"
app:week_selected_circle_color="@color/select_circle_color"
app:week_show_holiday_hint="true"
app:week_show_lunar="true"
app:week_show_task_hint="false"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rlScheduleList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground">
<com.jeek.calendar.widget.calendar.schedule.ScheduleRecyclerView
android:id="@+id/rvScheduleList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:orientation="vertical"
android:overScrollMode="never"
android:paddingTop="6dp"/>
<RelativeLayout
android:id="@+id/rlNoTask"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:src="@mipmap/bg_no_task"/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</com.jeek.calendar.widget.calendar.schedule.ScheduleLayout>
</LinearLayout>
``` | /content/code_sandbox/calendar/src/main/res/layout/layout_schedule.xml | xml | 2016-10-08T07:10:11 | 2024-08-14T08:22:32 | Calendar | xiaojianglaile/Calendar | 1,293 | 818 |
```xml
<project xmlns="path_to_url" xmlns:xsi="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<groupId>com.journaldev</groupId>
<artifactId>EmployeeRegistration-JSFBridge</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>EmployeeRegistration-JSFBridge</name>
<url>path_to_url
<properties>
<deployFolder>D:/Apache Pluto/pluto-2.0.3/webapps</deployFolder>
</properties>
<dependencies>
<!-- Java Portlet Specification V2.0 -->
<dependency>
<groupId>org.apache.portals</groupId>
<artifactId>portlet-api_2.0_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.apache.pluto</groupId>
<artifactId>pluto-taglib</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.portlet-bridge</groupId>
<artifactId>portlet-bridge-api</artifactId>
<version>3.0.0-alpha</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.portlet-bridge</groupId>
<artifactId>portlet-bridge-impl</artifactId>
<version>3.0.0-alpha</version>
</dependency>
<!-- Faces Implementation -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.15</version>
</dependency>
<!-- Faces Library -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.15</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- bind 'pluto2:assemble' goal to 'process-resources' lifecycle -->
<!-- This plugin will read your portlet.xml and web.xml and injects required
lines -->
<plugin>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>2.1.0-M3</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- configure maven-war-plugin to use updated web.xml -->
<!-- This plugin will make sure your WAR will contain the updated web.xml -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>integration-test</phase>
<configuration>
<tasks>
<copy file="target/${project.artifactId}.war" tofile="${deployFolder}/${project.artifactId}.war" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>delete</id>
<phase>clean</phase>
<configuration>
<tasks>
<delete file="${deployFolder}/${project.artifactId}.war" />
<delete dir="${deployFolder}/${project.artifactId}" />
</tasks>
<detail>true</detail>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/Portal-Portlets/EmployeeRegistration-JSFBridge/pom.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 1,180 |
```xml
import axios, { parseAxiosError } from '@/portainer/services/axios';
import { RegistryId } from '@/react/portainer/registries/types/registry';
import { Pair } from '@/react/portainer/settings/types';
import { EdgeGroup } from '@/react/edge/edge-groups/types';
import { AutoUpdateResponse } from '@/react/portainer/gitops/types';
import { DeploymentType, EdgeStack, StaggerConfig } from '../../types';
import { buildUrl } from '../buildUrl';
/**
* Payload to create an EdgeStack from a git repository
*/
export type GitRepositoryPayload = {
/** Name of the stack */
name: string;
/** URL of a Git repository hosting the Stack file */
repositoryUrl: string;
/** Reference name of a Git repository hosting the Stack file */
repositoryReferenceName?: string;
/** Use basic authentication to clone the Git repository */
repositoryAuthentication?: boolean;
/** Username used in basic authentication. Required when RepositoryAuthentication is true. */
repositoryUsername?: string;
/** Password used in basic authentication. Required when RepositoryAuthentication is true. */
repositoryPassword?: string;
/** GitCredentialID used to identify the binded git credential */
repositoryGitCredentialId?: number;
/** Path to the Stack file inside the Git repository */
filePathInRepository?: string;
/** List of identifiers of EdgeGroups */
edgeGroups: Array<EdgeGroup['Id']>;
/** Deployment type to deploy this stack. Valid values are: 0 - 'compose', 1 - 'kubernetes'. Compose is enabled only for docker environments, kubernetes is enabled only for kubernetes environments */
deploymentType: DeploymentType;
/** List of Registries to use for this stack */
registries?: Array<RegistryId>;
/** Uses the manifest's namespaces instead of the default one */
useManifestNamespaces?: boolean;
/** Pre Pull image */
prePullImage?: boolean;
/** Retry deploy */
retryDeploy?: boolean;
/** TLSSkipVerify skips SSL verification when cloning the Git repository */
tlsSkipVerify?: boolean;
/** Optional GitOps update configuration */
autoUpdate: AutoUpdateResponse | null;
/** Whether the stack supports relative path volume */
supportRelativePath?: boolean;
/** Local filesystem path */
filesystemPath?: string;
/** Whether the edge stack supports per device configs */
supportPerDeviceConfigs?: boolean;
/** Per device configs match type */
perDeviceConfigsMatchType?: string;
/** Per device configs group match type */
perDeviceConfigsGroupMatchType?: string;
/** Per device configs path */
perDeviceConfigsPath?: string;
/** List of environment variables */
envVars?: Array<Pair>;
/** Configuration for stagger updates */
staggerConfig?: StaggerConfig;
};
export async function createStackFromGit(payload: GitRepositoryPayload) {
try {
const { data } = await axios.post<EdgeStack>(
buildUrl(undefined, 'create/repository'),
payload
);
return data;
} catch (e) {
throw parseAxiosError(e as Error);
}
}
``` | /content/code_sandbox/app/react/edge/edge-stacks/queries/useCreateEdgeStack/createStackFromGit.ts | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 650 |
```xml
class A {}
let a = new A()
let x = a.x //TS2339
class X {
prop: () => void;
}
class B2 extends X {
prop() { // TS2425
}
}
``` | /content/code_sandbox/tests/errors-test/cases/fields.ts | xml | 2016-01-24T19:35:52 | 2024-08-16T16:39:39 | pxt | microsoft/pxt | 2,069 | 49 |
```xml
/**
* @license
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import {animationDimensionPercentages as percentages} from '../../mdc-linear-progress/constants';
import {MDCLinearProgressFoundation} from '../../mdc-linear-progress/foundation';
import {WithMDCResizeObserver} from '../../mdc-linear-progress/types';
import {checkNumTimesSpyCalledWithArgs, verifyDefaultAdapter} from '../../../testing/helpers/foundation';
import {setUpFoundationTest} from '../../../testing/helpers/setup';
const {cssClasses, strings} = MDCLinearProgressFoundation;
const RO = (window as unknown as WithMDCResizeObserver).ResizeObserver;
const multiplyPercentages = (multipler: number) => {
return {
PRIMARY_HALF: percentages.PRIMARY_HALF * multipler,
PRIMARY_FULL: percentages.PRIMARY_FULL * multipler,
SECONDARY_QUARTER: percentages.SECONDARY_QUARTER * multipler,
SECONDARY_HALF: percentages.SECONDARY_HALF * multipler,
SECONDARY_FULL: percentages.SECONDARY_FULL * multipler,
};
};
describe('MDCLinearProgressFoundation', () => {
it('exports strings', () => {
expect('strings' in MDCLinearProgressFoundation).toBeTruthy();
});
it('exports cssClasses', () => {
expect('cssClasses' in MDCLinearProgressFoundation).toBeTruthy();
});
it('defaultAdapter returns a complete adapter implementation', () => {
verifyDefaultAdapter(MDCLinearProgressFoundation, [
'addClass',
'attachResizeObserver',
'forceLayout',
'getWidth',
'hasClass',
'removeAttribute',
'removeClass',
'setAttribute',
'setBufferBarStyle',
'setPrimaryBarStyle',
'setStyle',
]);
});
const setupTest = () => {
const {foundation, mockAdapter} =
setUpFoundationTest(MDCLinearProgressFoundation);
return {foundation, mockAdapter};
};
it('#setDeterminate false updates state, adds class, resets transforms, and removes aria-valuenow',
() => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(false);
foundation.init();
foundation.setDeterminate(false);
expect(foundation.isDeterminate()).toBe(false);
expect(mockAdapter.addClass)
.toHaveBeenCalledWith(cssClasses.INDETERMINATE_CLASS);
expect(mockAdapter.setPrimaryBarStyle)
.toHaveBeenCalledWith('transform', 'scaleX(1)');
expect(mockAdapter.setBufferBarStyle)
.toHaveBeenCalledWith('flex-basis', '100%');
expect(mockAdapter.removeAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUENOW);
expect(mockAdapter.removeAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUEMAX);
expect(mockAdapter.removeAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUEMIN);
});
it('#setDeterminate false updates custom props', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.getWidth.and.returnValue(100);
mockAdapter.attachResizeObserver.and.returnValue(RO);
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(false);
foundation.init();
expect(mockAdapter.attachResizeObserver).toHaveBeenCalled();
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(0);
foundation.setDeterminate(false);
expect(foundation.isDeterminate()).toBe(false);
if (!RO) {
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(0);
return;
}
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(10);
const testPercentages = multiplyPercentages(100);
expect(mockAdapter.setStyle.calls.allArgs()).toEqual([
[
'--mdc-linear-progress-primary-half',
`${testPercentages.PRIMARY_HALF}px`
],
[
'--mdc-linear-progress-primary-half-neg',
`-${testPercentages.PRIMARY_HALF}px`
],
[
'--mdc-linear-progress-primary-full',
`${testPercentages.PRIMARY_FULL}px`
],
[
'--mdc-linear-progress-primary-full-neg',
`-${testPercentages.PRIMARY_FULL}px`
],
[
'--mdc-linear-progress-secondary-quarter',
`${testPercentages.SECONDARY_QUARTER}px`
],
[
'--mdc-linear-progress-secondary-quarter-neg',
`-${testPercentages.SECONDARY_QUARTER}px`
],
[
'--mdc-linear-progress-secondary-half',
`${testPercentages.SECONDARY_HALF}px`
],
[
'--mdc-linear-progress-secondary-half-neg',
`-${testPercentages.SECONDARY_HALF}px`
],
[
'--mdc-linear-progress-secondary-full',
`${testPercentages.SECONDARY_FULL}px`
],
[
'--mdc-linear-progress-secondary-full-neg',
`-${testPercentages.SECONDARY_FULL}px`
]
]);
});
it('#setDeterminate updates state and removes class', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(false);
foundation.init();
foundation.setDeterminate(true);
expect(foundation.isDeterminate()).toBe(true);
expect(mockAdapter.removeClass)
.toHaveBeenCalledWith(cssClasses.INDETERMINATE_CLASS);
});
it('#setDeterminate restores previous progress value after toggled from false to true',
() => {
const {foundation, mockAdapter} = setupTest();
foundation.init();
foundation.setProgress(0.123);
foundation.setDeterminate(false);
foundation.setDeterminate(true);
checkNumTimesSpyCalledWithArgs(
mockAdapter.setPrimaryBarStyle, ['transform', 'scaleX(0.123)'], 2);
checkNumTimesSpyCalledWithArgs(
mockAdapter.setAttribute, [strings.ARIA_VALUENOW, '0.123'], 2);
});
it('#setDeterminate restores previous buffer value after toggled from false to true',
() => {
const {foundation, mockAdapter} = setupTest();
foundation.init();
foundation.setBuffer(0.123);
foundation.setDeterminate(false);
foundation.setDeterminate(true);
checkNumTimesSpyCalledWithArgs(
mockAdapter.setBufferBarStyle, ['flex-basis', '12.3%'], 2);
});
it('#setDeterminate updates progress value set while determinate is false after determinate is true',
() => {
const {foundation, mockAdapter} = setupTest();
foundation.init();
foundation.setDeterminate(false);
foundation.setProgress(0.123);
foundation.setDeterminate(true);
expect(mockAdapter.setPrimaryBarStyle)
.toHaveBeenCalledWith('transform', 'scaleX(0.123)');
expect(mockAdapter.setAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUENOW, '0.123');
expect(mockAdapter.setAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUEMAX, '1');
expect(mockAdapter.setAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUEMIN, '0');
});
it('#calculateAndSetDimensions called on initialization with indeterminate class',
() => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(true);
mockAdapter.attachResizeObserver.and.returnValue(RO);
foundation.init();
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(RO ? 10 : 0);
});
it('#calculateAndSetDimensions called only on setDeterminate(false)', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(true);
mockAdapter.attachResizeObserver.and.returnValue(RO);
foundation.init();
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(RO ? 10 : 0);
foundation.setDeterminate(true);
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(RO ? 10 : 0);
foundation.setDeterminate(false);
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(RO ? 20 : 0);
});
it('#calculateAndSetDimensions restarts animation with a forced reflow',
() => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(true);
mockAdapter.attachResizeObserver.and.returnValue(RO);
foundation.init();
if (RO) {
expect(mockAdapter.addClass)
.toHaveBeenCalledWith(cssClasses.ANIMATION_READY_CLASS);
expect(mockAdapter.forceLayout).toHaveBeenCalledTimes(1);
expect(mockAdapter.removeClass)
.toHaveBeenCalledWith(cssClasses.ANIMATION_READY_CLASS);
} else {
expect(mockAdapter.setStyle).toHaveBeenCalledTimes(0);
}
});
it('#setProgress updates state, sets transform and aria-valuenow', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(false);
foundation.init();
foundation.setProgress(0.5);
expect(foundation.getProgress()).toEqual(0.5);
expect(mockAdapter.setPrimaryBarStyle)
.toHaveBeenCalledWith('transform', 'scaleX(0.5)');
expect(mockAdapter.setAttribute)
.toHaveBeenCalledWith(strings.ARIA_VALUENOW, '0.5');
expect(foundation.getProgress()).toEqual(0.5);
});
it('#setProgress on indeterminate does nothing', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(true);
foundation.init();
foundation.setProgress(0.5);
expect(mockAdapter.setPrimaryBarStyle).not.toHaveBeenCalled();
expect(mockAdapter.setAttribute).not.toHaveBeenCalled();
});
it('#setBuffer sets flex-basis', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(false);
foundation.init();
foundation.setBuffer(0.5);
expect(mockAdapter.setBufferBarStyle)
.toHaveBeenCalledWith('flex-basis', '50%');
expect(foundation.getBuffer()).toEqual(0.5);
});
it('#setBuffer on indeterminate does nothing', () => {
const {foundation, mockAdapter} = setupTest();
mockAdapter.hasClass.withArgs(cssClasses.INDETERMINATE_CLASS)
.and.returnValue(true);
foundation.init();
foundation.setBuffer(0.5);
expect(mockAdapter.setBufferBarStyle).not.toHaveBeenCalled();
});
it('#open removes class and aria-hidden', () => {
const {foundation, mockAdapter} = setupTest();
foundation.init();
foundation.open();
expect(mockAdapter.removeClass)
.toHaveBeenCalledWith(cssClasses.CLOSED_CLASS);
expect(mockAdapter.removeClass)
.toHaveBeenCalledWith(cssClasses.CLOSED_ANIMATION_OFF_CLASS);
expect(mockAdapter.removeAttribute)
.toHaveBeenCalledWith(strings.ARIA_HIDDEN);
});
it('#close adds class and aria-hidden', () => {
const {foundation, mockAdapter} = setupTest();
foundation.init();
foundation.close();
expect(mockAdapter.addClass).toHaveBeenCalledWith(cssClasses.CLOSED_CLASS);
expect(mockAdapter.setAttribute)
.toHaveBeenCalledWith(strings.ARIA_HIDDEN, 'true');
mockAdapter.hasClass.withArgs(cssClasses.CLOSED_CLASS)
.and.returnValue(true);
foundation.handleTransitionEnd();
expect(mockAdapter.addClass)
.toHaveBeenCalledWith(cssClasses.CLOSED_ANIMATION_OFF_CLASS);
expect(foundation.isClosed()).toBeTrue();
});
it('#destroy disconnects the resize observer', () => {
const {foundation, mockAdapter} = setupTest();
let disconnected = false;
const mockedObserver = {
disconnect: () => {
disconnected = true;
}
};
// TODO: Wait until b/208710526 is fixed, then remove this autogenerated
// error suppression.
// @ts-ignore(go/unfork-jasmine-typings): Argument of type '{ disconnect:
// () => void; }' is not assignable to parameter of type
// 'MDCResizeObserver'.
mockAdapter.attachResizeObserver.and.returnValue(mockedObserver);
foundation.init();
const withObserver =
foundation as unknown as {observer: typeof mockedObserver};
expect(withObserver.observer).toEqual(mockedObserver);
expect(disconnected).toBeFalse();
foundation.destroy();
expect(disconnected).toBeTrue();
});
});
``` | /content/code_sandbox/packages/mdc-linear-progress/test/foundation.test.ts | xml | 2016-12-05T16:04:09 | 2024-08-16T15:42:22 | material-components-web | material-components/material-components-web | 17,119 | 2,823 |
```xml
// These kind of comments are used in HTML
export const html = {
regionStartMatcher: /^\s*<!--\s*#docregion\s*(.*?)\s*(?:-->)?\s*$/,
regionEndMatcher: /^\s*<!--\s*#enddocregion\s*(.*?)\s*-->\s*$/,
};
``` | /content/code_sandbox/tools/region-parser/region-matchers/html.ts | xml | 2016-01-04T18:50:02 | 2024-08-16T11:21:13 | components | angular/components | 24,263 | 72 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="path_to_url" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Search for available workloads.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="DescriptionColumnName">
<source>Description</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="PlatformColumnName">
<source>Platforms</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="WorkloadIdColumnName">
<source>Workload ID</source>
<target state="translated"> </target>
<note />
</trans-unit>
<trans-unit id="WorkloadIdStubArgumentDescription">
<source>The text to search for in the IDs and descriptions of available workloads.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadIdStubArgumentName">
<source>SEARCH_STRING</source>
<target state="translated">SEARCH_STRING</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/commands/dotnet-workload/search/xlf/LocalizableStrings.ru.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 373 |
```xml
<manifest xmlns:android="path_to_url"
package="com.weishu.upf.receiver_management.app">
<application
android:allowBackup="true"
android:name="com.weishu.upf.receiver_management.app.UPFApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher">
<activity android:name="com.weishu.upf.receiver_management.app.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
``` | /content/code_sandbox/receiver-management/src/main/AndroidManifest.xml | xml | 2016-01-28T02:51:45 | 2024-08-16T11:36:48 | understand-plugin-framework | tiann/understand-plugin-framework | 2,633 | 134 |
```xml
import {Injectable} from '@angular/core';
import {WNode, Workflow} from 'app/model/workflow.model';
import {BehaviorSubject, Observable} from 'rxjs';
@Injectable()
export class WorkflowCoreService {
private _linkJoinEvent: BehaviorSubject<WNode> = new BehaviorSubject(null);
private _asCodeEditorEvent: BehaviorSubject<{open: boolean, save: boolean}> = new BehaviorSubject(null);
private _previewWorkflow: BehaviorSubject<Workflow> = new BehaviorSubject(null);
getAsCodeEditor(): Observable<{open: boolean, save: boolean}> {
return new Observable<{open: boolean, save: boolean}>(fn => this._asCodeEditorEvent.subscribe(fn));
}
toggleAsCodeEditor(o: {open: boolean, save: boolean}): void {
this._asCodeEditorEvent.next(o);
}
getWorkflowPreview(): Observable<Workflow> {
return new Observable<Workflow>(fn => this._previewWorkflow.subscribe(fn));
}
setWorkflowPreview(wf: Workflow): void {
if (wf) {
wf.forceRefresh = true;
wf.previewMode = true;
}
this._previewWorkflow.next(wf);
}
getLinkJoinEvent(): Observable<WNode> {
return new Observable<WNode>(fn => this._linkJoinEvent.subscribe(fn));
}
linkJoinEvent(node: WNode): void {
this._linkJoinEvent.next(node);
}
}
``` | /content/code_sandbox/ui/src/app/service/workflow/workflow.core.service.ts | xml | 2016-10-11T08:28:23 | 2024-08-16T01:55:31 | cds | ovh/cds | 4,535 | 298 |
```xml
import * as fs from 'node:fs';
import * as path from 'node:path';
import type {
BackupMetaFileContent,
BackupOptions,
RxDatabase
} from '../../types/index.d.ts';
import { blobToString, now } from '../../plugins/utils/index.ts';
/**
* ensure that the given folder exists
*/
export function ensureFolderExists(folderPath: string): void {
if (!fs.existsSync(folderPath)) {
fs.mkdirSync(folderPath, { recursive: true });
}
}
/**
* deletes and recreates the folder
*/
export function clearFolder(folderPath: string): void {
deleteFolder(folderPath);
ensureFolderExists(folderPath);
}
export function deleteFolder(folderPath: string): void {
// only remove if exists to not raise warning
if (fs.existsSync(folderPath)) {
fs.rmdirSync(folderPath, { recursive: true });
}
}
export function prepareFolders(
database: RxDatabase,
options: BackupOptions
) {
ensureFolderExists(options.directory);
const metaLoc = metaFileLocation(options);
if (!fs.existsSync(metaLoc)) {
const currentTime = now();
const metaData: BackupMetaFileContent = {
createdAt: currentTime,
updatedAt: currentTime,
collectionStates: {}
};
fs.writeFileSync(metaLoc, JSON.stringify(metaData), 'utf-8');
}
Object.keys(database.collections).forEach(collectionName => {
ensureFolderExists(
path.join(
options.directory,
collectionName
)
);
});
}
export async function writeToFile(
location: string,
data: string | Blob
): Promise<void> {
if (typeof data !== 'string') {
data = await blobToString(data);
}
return new Promise(function (res, rej) {
fs.writeFile(
location,
data as string,
'utf-8',
(err) => {
if (err) {
rej(err);
} else {
res();
}
}
);
});
}
export function writeJsonToFile(
location: string,
data: any
): Promise<void> {
return writeToFile(
location,
JSON.stringify(data)
);
}
export function metaFileLocation(options: BackupOptions): string {
return path.join(
options.directory,
'backup_meta.json'
);
}
export function getMeta(options: BackupOptions): Promise<BackupMetaFileContent> {
const loc = metaFileLocation(options);
return new Promise((res, rej) => {
fs.readFile(loc, 'utf-8', (err, data) => {
if (err) {
rej(err);
} else {
const metaContent = JSON.parse(data);
res(metaContent);
}
});
});
}
export function setMeta(
options: BackupOptions,
meta: BackupMetaFileContent
): Promise<void> {
const loc = metaFileLocation(options);
return writeJsonToFile(loc, meta);
}
export function documentFolder(
options: BackupOptions,
docId: string
): string {
return path.join(
options.directory,
docId
);
}
``` | /content/code_sandbox/src/plugins/backup/file-util.ts | xml | 2016-12-02T19:34:42 | 2024-08-16T15:47:20 | rxdb | pubkey/rxdb | 21,054 | 657 |
```xml
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command>
<transfer op="request">
<domain:transfer
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:name>rich.example</domain:name>
<domain:period unit="y">1</domain:period>
<domain:authInfo>
<domain:pw roid="JD1234-REP">2fooBAR</domain:pw>
</domain:authInfo>
</domain:transfer>
</transfer>
<clTRID>ABC-12345</clTRID>
</command>
</epp>
``` | /content/code_sandbox/core/src/test/resources/google/registry/flows/domain/domain_transfer_request_premium.xml | xml | 2016-02-29T20:16:48 | 2024-08-15T19:49:29 | nomulus | google/nomulus | 1,685 | 153 |
```xml
import { MarkdownString, ThemeColor, ThemeIcon, TreeItem, TreeItemCollapsibleState, window } from 'vscode';
import type { ViewShowBranchComparison } from '../../config';
import type { Colors } from '../../constants';
import { GlyphChars } from '../../constants';
import type { GitUri } from '../../git/gitUri';
import type { BranchIconStatus, GitBranch } from '../../git/models/branch';
import { getTargetBranchName } from '../../git/models/branch';
import type { GitLog } from '../../git/models/log';
import type { PullRequest, PullRequestState } from '../../git/models/pullRequest';
import type { GitBranchReference } from '../../git/models/reference';
import { getHighlanderProviders } from '../../git/models/remote';
import type { Repository } from '../../git/models/repository';
import type { GitUser } from '../../git/models/user';
import type { GitWorktree } from '../../git/models/worktree';
import { getContext } from '../../system/context';
import { gate } from '../../system/decorators/gate';
import { log } from '../../system/decorators/log';
import { map } from '../../system/iterable';
import type { Deferred } from '../../system/promise';
import { defer, getSettledValue } from '../../system/promise';
import { pad } from '../../system/string';
import type { ViewsWithBranches } from '../viewBase';
import { disposeChildren } from '../viewBase';
import { createViewDecorationUri } from '../viewDecorationProvider';
import type { PageableViewNode, ViewNode } from './abstract/viewNode';
import { ContextValues, getViewNodeId } from './abstract/viewNode';
import { ViewRefNode } from './abstract/viewRefNode';
import { BranchTrackingStatusNode } from './branchTrackingStatusNode';
import { CommitNode } from './commitNode';
import { LoadMoreNode, MessageNode } from './common';
import { CompareBranchNode } from './compareBranchNode';
import { insertDateMarkers } from './helpers';
import { MergeStatusNode } from './mergeStatusNode';
import { PullRequestNode } from './pullRequestNode';
import { RebaseStatusNode } from './rebaseStatusNode';
type State = {
pullRequest: PullRequest | null | undefined;
pendingPullRequest: Promise<PullRequest | undefined> | undefined;
};
type Options = {
expand: boolean;
limitCommits: boolean;
showAsCommits: boolean;
showComparison: false | ViewShowBranchComparison;
showStatusDecorationOnly: boolean;
showMergeCommits?: boolean;
showStatus: boolean;
showTracking: boolean;
authors?: GitUser[];
};
export class BranchNode
extends ViewRefNode<'branch', ViewsWithBranches, GitBranchReference, State>
implements PageableViewNode
{
limit: number | undefined;
private readonly options: Options;
protected override splatted = true;
constructor(
uri: GitUri,
view: ViewsWithBranches,
public override parent: ViewNode,
public readonly repo: Repository,
public readonly branch: GitBranch,
// Specifies that the node is shown as a root
public readonly root: boolean,
options?: Partial<Options>,
) {
super('branch', uri, view, parent);
this.updateContext({ repository: repo, branch: branch, root: root });
this._uniqueId = getViewNodeId(this.type, this.context);
this.limit = this.view.getNodeLastKnownLimit(this);
this.options = {
expand: false,
limitCommits: false,
showAsCommits: false,
showComparison: false,
// Only show status decorations when the node is displayed as a root
showStatusDecorationOnly: this.root,
// Don't show merge/rebase status info the node is displayed as a root
showStatus: true, //!this.root,
// Don't show tracking info the node is displayed as a root
showTracking: !this.root,
...options,
};
}
override dispose() {
super.dispose();
this.children = undefined;
}
override get id(): string {
return this._uniqueId;
}
override toClipboard(): string {
return this.branch.name;
}
private get avoidCompacting(): boolean {
return this.root || this.current || this.worktree != null || this.branch.detached || this.branch.starred;
}
compacted: boolean = false;
get current(): boolean {
return this.branch.current;
}
get label(): string {
if (this.options.showAsCommits) return 'Commits';
const branchName = this.branch.getNameWithoutRemote();
return `${
this.view.config.branches?.layout !== 'tree' || this.compacted || this.avoidCompacting
? branchName
: this.branch.getBasename()
}${this.branch.rebasing ? ' (Rebasing)' : ''}`;
}
get ref(): GitBranchReference {
return this.branch;
}
get treeHierarchy(): string[] {
return this.avoidCompacting ? [this.branch.name] : this.branch.getNameWithoutRemote().split('/');
}
get worktree(): GitWorktree | undefined {
return this.context.worktreesByBranch?.get(this.branch.id);
}
private _children: ViewNode[] | undefined;
protected get children(): ViewNode[] | undefined {
return this._children;
}
protected set children(value: ViewNode[] | undefined) {
if (this._children === value) return;
disposeChildren(this._children, value);
this._children = value;
}
async getChildren(): Promise<ViewNode[]> {
if (this.children == null) {
const branch = this.branch;
let onCompleted: Deferred<void> | undefined;
let pullRequest;
let pullRequestInsertIndex = 0;
let comparison: CompareBranchNode | undefined;
let loadComparisonDefaultCompareWith = false;
if (this.options.showComparison !== false && this.view.type !== 'remotes') {
comparison = new CompareBranchNode(
this.uri,
this.view,
this,
branch,
this.options.showComparison,
this.splatted,
);
loadComparisonDefaultCompareWith = comparison.compareWith == null;
}
let prPromise: Promise<PullRequest | undefined> | undefined;
if (
this.view.config.pullRequests.enabled &&
this.view.config.pullRequests.showForBranches &&
(branch.upstream != null || branch.remote) &&
getContext('gitlens:repos:withHostingIntegrationsConnected')?.includes(branch.repoPath)
) {
pullRequest = this.getState('pullRequest');
if (pullRequest === undefined && this.getState('pendingPullRequest') === undefined) {
onCompleted = defer<void>();
prPromise = this.getAssociatedPullRequest(
branch,
this.root ? { include: ['opened', 'merged'] } : undefined,
);
queueMicrotask(async () => {
await onCompleted?.promise;
// If we are waiting too long, refresh this node to show a spinner while the pull request is loading
let spinner = false;
const timeout = setTimeout(() => {
spinner = true;
this.view.triggerNodeChange(this);
}, 250);
const pr = await prPromise;
clearTimeout(timeout);
// If we found a pull request, insert it into the children cache (if loaded) and refresh the node
if (pr != null && this.children != null) {
this.children.splice(
pullRequestInsertIndex,
0,
new PullRequestNode(this.view, this, pr, branch),
);
}
// Refresh this node to add the pull request node or remove the spinner
if (spinner || pr != null) {
this.view.triggerNodeChange(this.root ? this.parent ?? this : this);
}
});
}
}
const [
logResult,
getBranchAndTagTipsResult,
statusResult,
mergeStatusResult,
rebaseStatusResult,
unpublishedCommitsResult,
baseResult,
targetResult,
] = await Promise.allSettled([
this.getLog(),
this.view.container.git.getBranchesAndTagsTipsFn(this.uri.repoPath, branch.name),
this.options.showStatus && branch.current
? this.view.container.git.getStatusForRepo(this.uri.repoPath)
: undefined,
this.options.showStatus && branch.current
? this.view.container.git.getMergeStatus(this.uri.repoPath!)
: undefined,
this.options.showStatus ? this.view.container.git.getRebaseStatus(this.uri.repoPath!) : undefined,
!branch.remote
? this.view.container.git.getBranchAheadRange(branch).then(range =>
range
? this.view.container.git.getLogRefsOnly(this.uri.repoPath!, {
limit: 0,
ref: range,
merges: this.options.showMergeCommits,
})
: undefined,
)
: undefined,
loadComparisonDefaultCompareWith
? this.view.container.git.getBaseBranchName(this.branch.repoPath, this.branch.name)
: undefined,
loadComparisonDefaultCompareWith
? getTargetBranchName(this.view.container, this.branch, {
associatedPullRequest: prPromise,
timeout: 100,
})
: undefined,
]);
const log = getSettledValue(logResult);
if (log == null) return [new MessageNode(this.view, this, 'No commits could be found.')];
const children = [];
const status = getSettledValue(statusResult);
const mergeStatus = getSettledValue(mergeStatusResult);
const rebaseStatus = getSettledValue(rebaseStatusResult);
const unpublishedCommits = getSettledValue(unpublishedCommitsResult);
if (pullRequest != null) {
children.push(new PullRequestNode(this.view, this, pullRequest, branch));
}
if (this.options.showStatus && mergeStatus != null) {
children.push(
new MergeStatusNode(
this.view,
this,
branch,
mergeStatus,
status ?? (await this.view.container.git.getStatusForRepo(this.uri.repoPath)),
this.root,
),
);
} else if (
this.options.showStatus &&
rebaseStatus != null &&
(branch.current || branch.name === rebaseStatus.incoming.name)
) {
children.push(
new RebaseStatusNode(
this.view,
this,
branch,
rebaseStatus,
status ?? (await this.view.container.git.getStatusForRepo(this.uri.repoPath)),
this.root,
),
);
} else if (this.options.showTracking) {
const status = {
ref: branch.ref,
repoPath: branch.repoPath,
state: branch.state,
upstream: branch.upstream,
};
if (branch.upstream != null) {
if (this.root && branch.upstream.missing) {
children.push(
new BranchTrackingStatusNode(this.view, this, branch, status, 'missing', this.root),
);
} else if (this.root && !status.state.behind && !status.state.ahead) {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'same', this.root));
} else {
if (status.state.behind) {
children.push(
new BranchTrackingStatusNode(this.view, this, branch, status, 'behind', this.root),
);
}
if (status.state.ahead) {
children.push(
new BranchTrackingStatusNode(this.view, this, branch, status, 'ahead', this.root, {
unpublishedCommits: unpublishedCommits,
}),
);
}
}
} else if (!branch.detached) {
children.push(new BranchTrackingStatusNode(this.view, this, branch, status, 'none', this.root));
}
}
pullRequestInsertIndex = 0;
if (comparison != null) {
children.push(comparison);
if (loadComparisonDefaultCompareWith) {
const baseBranchName = getSettledValue(baseResult);
const targetMaybeResult = getSettledValue(targetResult);
let baseOrTargetBranchName: string | undefined;
if (targetMaybeResult?.paused) {
baseOrTargetBranchName = baseBranchName;
} else {
baseOrTargetBranchName = targetMaybeResult?.value ?? baseBranchName;
}
if (baseOrTargetBranchName != null) {
void comparison.setDefaultCompareWith({
ref: baseOrTargetBranchName,
label: baseOrTargetBranchName,
notation: '...',
type: 'branch',
checkedFiles: [],
});
}
if (targetMaybeResult?.paused) {
void targetMaybeResult.value.then(target => {
if (target == null) return;
void comparison.setDefaultCompareWith({
ref: target,
label: target,
notation: '...',
type: 'branch',
checkedFiles: [],
});
});
}
}
}
if (children.length !== 0) {
children.push(new MessageNode(this.view, this, '', GlyphChars.Dash.repeat(2), ''));
}
const getBranchAndTagTips = getSettledValue(getBranchAndTagTipsResult);
children.push(
...insertDateMarkers(
map(
log.commits.values(),
c =>
new CommitNode(
this.view,
this,
c,
unpublishedCommits?.has(c.ref),
branch,
getBranchAndTagTips,
),
),
this,
),
);
if (log.hasMore) {
children.push(
new LoadMoreNode(this.view, this, children[children.length - 1], {
getCount: () => this.view.container.git.getCommitCount(branch.repoPath, branch.name),
}),
);
}
this.children = children;
setTimeout(() => onCompleted?.fulfill(), 1);
}
return this.children;
}
async getTreeItem(): Promise<TreeItem> {
this.splatted = false;
const worktree = this.worktree;
const status = await this.branch.getStatus();
let tooltip: string | MarkdownString = `$(git-branch) \`${this.branch.getNameWithoutRemote()}\`${
this.current
? this.branch.rebasing
? ' \u00a0(_current, rebasing_)'
: ' \u00a0(_current_)'
: worktree?.opened
? ' \u00a0(_worktree, opened_)'
: worktree
? ' \u00a0(_worktree_)'
: ''
}`;
let contextValue: string = ContextValues.Branch;
if (this.current) {
contextValue += '+current';
}
if (this.branch.remote) {
contextValue += '+remote';
}
if (this.branch.starred) {
contextValue += '+starred';
}
if (this.branch.upstream != null && !this.branch.upstream.missing) {
contextValue += '+tracking';
}
if (this.options.showAsCommits) {
contextValue += '+commits';
}
if (worktree != null) {
contextValue += '+worktree';
}
// TODO@axosoft-ramint Temporary workaround, remove when our git commands work on closed repos.
if (this.repo.closed) {
contextValue += '+closed';
}
let iconColor: ThemeColor | undefined;
let description;
let iconSuffix: '' | `-${NonNullable<BranchIconStatus>}` = '';
if (!this.branch.remote) {
if (this.branch.upstream != null) {
let arrows = GlyphChars.Dash;
const remote = await this.branch.getRemote();
if (!this.branch.upstream.missing) {
if (remote != null) {
let left;
let right;
for (const { type } of remote.urls) {
if (type === 'fetch') {
left = true;
if (right) break;
} else if (type === 'push') {
right = true;
if (left) break;
}
}
if (left && right) {
arrows = GlyphChars.ArrowsRightLeft;
} else if (right) {
arrows = GlyphChars.ArrowRight;
} else if (left) {
arrows = GlyphChars.ArrowLeft;
}
}
} else {
arrows = GlyphChars.Warning;
}
description = this.options.showAsCommits
? `${this.branch.getTrackingStatus({
suffix: pad(GlyphChars.Dot, 1, 1),
})}${this.branch.getNameWithoutRemote()}${this.branch.rebasing ? ' (Rebasing)' : ''}${pad(
arrows,
2,
2,
)}${this.branch.upstream.name}`
: `${this.branch.getTrackingStatus({ suffix: `${GlyphChars.Space} ` })}${arrows}${
GlyphChars.Space
} ${this.branch.upstream.name}`;
tooltip += `\n\nBranch is ${this.branch.getTrackingStatus({
empty: `${
this.branch.upstream.missing ? 'missing upstream' : 'up to date with'
} \\\n $(git-branch) \`${this.branch.upstream.name}\`${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`,
expand: true,
icons: true,
separator: ', ',
suffix: `\\\n$(git-branch) \`${this.branch.upstream.name}\`${
remote?.provider?.name ? ` on ${remote.provider.name}` : ''
}`,
})}`;
switch (status) {
case 'ahead':
contextValue += '+ahead';
iconColor = new ThemeColor('gitlens.decorations.branchAheadForegroundColor' satisfies Colors);
iconSuffix = '-ahead';
break;
case 'behind':
contextValue += '+behind';
iconColor = new ThemeColor('gitlens.decorations.branchBehindForegroundColor' satisfies Colors);
iconSuffix = '-behind';
break;
case 'diverged':
contextValue += '+ahead+behind';
iconColor = new ThemeColor(
'gitlens.decorations.branchDivergedForegroundColor' satisfies Colors,
);
iconSuffix = '-diverged';
break;
case 'upToDate':
iconColor = new ThemeColor(
'gitlens.decorations.branchUpToDateForegroundColor' satisfies Colors,
);
iconSuffix = '-synced';
break;
}
} else {
const providers = getHighlanderProviders(
await this.view.container.git.getRemotesWithProviders(this.branch.repoPath),
);
const providerName = providers?.length ? providers[0].name : undefined;
tooltip += `\n\nLocal branch, hasn't been published to ${providerName ?? 'a remote'}`;
}
}
if (this.branch.date != null) {
description = `${description ? `${description}${pad(GlyphChars.Dot, 2, 2)}` : ''}${
this.branch.formattedDate
}`;
tooltip += `\n\nLast commit ${this.branch.formatDateFromNow()} (${this.branch.formatDate(
this.view.container.BranchDateFormatting.dateFormat,
)})`;
}
tooltip = new MarkdownString(tooltip, true);
tooltip.supportHtml = true;
tooltip.isTrusted = true;
if (this.branch.starred) {
tooltip.appendMarkdown('\\\n$(star-full) Favorited');
}
const pendingPullRequest = this.getState('pendingPullRequest');
if (pendingPullRequest != null) {
tooltip.appendMarkdown(`\n\n$(loading~spin) Loading associated pull request${GlyphChars.Ellipsis}`);
}
const item = new TreeItem(
this.label,
this.options.expand ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed,
);
item.id = this.id;
item.contextValue = contextValue;
item.description = description;
item.iconPath =
pendingPullRequest != null
? new ThemeIcon('loading~spin')
: this.options.showAsCommits
? new ThemeIcon('git-commit', iconColor)
: worktree != null
? {
dark: this.view.container.context.asAbsolutePath(
`images/dark/icon-repo${iconSuffix}.svg`,
),
light: this.view.container.context.asAbsolutePath(
`images/light/icon-repo${iconSuffix}.svg`,
),
}
: {
dark: this.view.container.context.asAbsolutePath(
`images/dark/icon-branch${iconSuffix}.svg`,
),
light: this.view.container.context.asAbsolutePath(
`images/light/icon-branch${iconSuffix}.svg`,
),
};
item.tooltip = tooltip;
item.resourceUri = createViewDecorationUri('branch', {
status: status,
current: this.current,
worktree: worktree != null ? { opened: worktree.opened } : undefined,
starred: this.branch.starred,
showStatusOnly: this.options.showStatusDecorationOnly,
});
return item;
}
@log()
async star() {
await this.branch.star();
void this.view.refresh(true);
}
@log()
async unstar() {
await this.branch.unstar();
void this.view.refresh(true);
}
override refresh(reset?: boolean) {
void super.refresh?.(reset);
this.children = undefined;
if (reset) {
this._log = undefined;
this.deleteState();
}
}
private async getAssociatedPullRequest(
branch: GitBranch,
options?: { include?: PullRequestState[] },
): Promise<PullRequest | undefined> {
let pullRequest = this.getState('pullRequest');
if (pullRequest !== undefined) return Promise.resolve(pullRequest ?? undefined);
let pendingPullRequest = this.getState('pendingPullRequest');
if (pendingPullRequest == null) {
pendingPullRequest = branch.getAssociatedPullRequest(options);
this.storeState('pendingPullRequest', pendingPullRequest);
pullRequest = await pendingPullRequest;
this.storeState('pullRequest', pullRequest ?? null);
this.deleteState('pendingPullRequest');
return pullRequest;
}
return pendingPullRequest;
}
private _log: GitLog | undefined;
private async getLog() {
if (this._log == null) {
let limit =
this.limit ??
(this.root && !this.options.limitCommits
? this.view.config.pageItemLimit
: this.view.config.defaultItemLimit);
// Try to show more commits if they are unpublished
if (limit !== 0 && this.branch.state.ahead > limit) {
limit = Math.min(this.branch.state.ahead + 1, limit * 2);
}
this._log = await this.view.container.git.getLog(this.uri.repoPath!, {
limit: limit,
ref: this.ref.ref,
authors: this.options?.authors,
merges: this.options?.showMergeCommits,
});
}
return this._log;
}
get hasMore() {
return this._log?.hasMore ?? true;
}
@gate()
async loadMore(limit?: number | { until?: any }) {
let log = await window.withProgress(
{
location: { viewId: this.view.id },
},
() => this.getLog(),
);
if (!log?.hasMore) return;
log = await log.more?.(limit ?? this.view.config.pageItemLimit);
if (this._log === log) return;
this._log = log;
this.limit = log?.count;
this.children = undefined;
void this.triggerChange(false);
}
}
``` | /content/code_sandbox/src/views/nodes/branchNode.ts | xml | 2016-08-08T14:50:30 | 2024-08-15T21:25:09 | vscode-gitlens | gitkraken/vscode-gitlens | 8,889 | 5,257 |
```xml
import { ModuleView } from '../../abstract';
import Resizer from '../../utils/Resizer';
import Panel from '../model/Panel';
import ButtonsView from './ButtonsView';
export default class PanelView extends ModuleView<Panel> {
constructor(model: Panel) {
super({ model, el: model.get('el') as string });
this.className = this.pfx + 'panel';
this.id = this.pfx + model.get('id');
this.listenTo(model, 'change:appendContent', this.appendContent);
this.listenTo(model, 'change:content', this.updateContent);
this.listenTo(model, 'change:visible', this.toggleVisible);
model.view = this;
}
/**
* Append content of the panel
* */
appendContent() {
this.$el.append(this.model.get('appendContent')!);
}
/**
* Update content
* */
updateContent() {
this.$el.html(this.model.get('content')!);
}
toggleVisible() {
if (!this.model.get('visible')) {
this.$el.addClass(`${this.ppfx}hidden`);
return;
}
this.$el.removeClass(`${this.ppfx}hidden`);
}
//@ts-ignore
attributes() {
return this.model.get('attributes');
}
initResize() {
const { em } = this;
const editor = em?.Editor;
const resizable = this.model.get('resizable');
if (editor && resizable) {
const resz = resizable === true ? [true, true, true, true] : resizable;
const resLen = (resz as boolean[]).length;
let tc,
cr,
bc,
cl = false;
// Choose which sides of the panel are resizable
if (resLen == 2) {
const resBools = resz as boolean[];
tc = resBools[0];
bc = resBools[0];
cr = resBools[1];
cl = resBools[1];
} else if (resLen == 4) {
const resBools = resz as boolean[];
tc = resBools[0];
cr = resBools[1];
bc = resBools[2];
cl = resBools[3];
}
const resizer: Resizer = new editor.Utils.Resizer({
tc,
cr,
bc,
cl,
tl: false,
tr: false,
bl: false,
br: false,
appendTo: this.el,
silentFrames: true,
avoidContainerUpdate: true,
prefix: editor.getConfig().stylePrefix,
onEnd() {
em.Canvas.refresh({ all: true });
},
posFetcher: (el: HTMLElement, { target }: any) => {
const style = el.style as any;
const config = resizer.getConfig();
const keyWidth = config.keyWidth!;
const keyHeight = config.keyHeight!;
const rect = el.getBoundingClientRect();
const forContainer = target == 'container';
const styleWidth = style[keyWidth];
const styleHeight = style[keyHeight];
const width = styleWidth && !forContainer ? parseFloat(styleWidth) : rect.width;
const height = styleHeight && !forContainer ? parseFloat(styleHeight) : rect.height;
return {
left: 0,
top: 0,
width,
height,
};
},
...(resizable && typeof resizable !== 'boolean' ? resizable : {}),
});
resizer.blur = () => {};
resizer.focus(this.el);
}
}
render() {
const { buttons } = this.model;
const $el = this.$el;
const ppfx = this.ppfx;
const cls = `${this.className} ${this.id} ${ppfx}one-bg ${ppfx}two-color`;
$el.addClass(cls);
this.toggleVisible();
if (buttons.length) {
var buttonsView = new ButtonsView(buttons);
$el.append(buttonsView.render().el);
}
$el.append(this.model.get('content')!);
return this;
}
}
``` | /content/code_sandbox/src/panels/view/PanelView.ts | xml | 2016-01-22T00:23:19 | 2024-08-16T11:20:59 | grapesjs | GrapesJS/grapesjs | 21,687 | 889 |
```xml
import { Button, makeStyles, tokens, typographyStyles } from '@fluentui/react-components';
import { Carousel, CarouselButton, CarouselCard, CarouselSlider } from '@fluentui/react-carousel-preview';
import * as React from 'react';
const useClasses = makeStyles({
carousel: {
display: 'grid',
gridTemplateColumns: '1fr max-content 1fr',
gap: '10px',
placeItems: 'center',
},
container: {
display: 'flex',
flexDirection: 'column',
gap: '20px',
},
test: {
...typographyStyles.largeTitle,
alignContent: 'center',
borderRadius: tokens.borderRadiusLarge,
height: '200px',
textAlign: 'center',
},
footer: {
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: '10px',
},
code: {
justifyContent: 'end',
backgroundColor: tokens.colorNeutralBackground4,
borderRadius: tokens.borderRadiusLarge,
fontFamily: tokens.fontFamilyMonospace,
fontSize: tokens.fontSizeBase400,
padding: '10px',
placeSelf: 'end',
},
controls: {
alignSelf: 'center',
display: 'flex',
gap: '10px',
},
control: {
minWidth: '32px',
},
});
const TestComponent: React.FC<{ accentColor: string; children: string }> = props => {
const { accentColor, children } = props;
const classes = useClasses();
return (
<div className={classes.test} style={{ backgroundColor: accentColor }}>
{children}
</div>
);
};
export const Controlled = () => {
const [activeIndex, setActiveIndex] = React.useState(0);
const classes = useClasses();
return (
<div className={classes.container}>
<Carousel
activeIndex={activeIndex}
className={classes.carousel}
groupSize={1}
onActiveIndexChange={(e, data) => setActiveIndex(data.index)}
>
<CarouselButton navType="prev" />
<div style={{ display: 'flex', overflow: 'hidden' }}>
<CarouselSlider>
<CarouselCard>
<TestComponent accentColor="#B99095">Card 1</TestComponent>
</CarouselCard>
<CarouselCard>
<TestComponent accentColor="#FCB5AC">Card 2</TestComponent>
</CarouselCard>
<CarouselCard>
<TestComponent accentColor="#B5E5CF">Card 3</TestComponent>
</CarouselCard>
<CarouselCard>
<TestComponent accentColor="#3D5B59">Card 4</TestComponent>
</CarouselCard>
<CarouselCard>
<TestComponent accentColor="#F9EAC2">Card 5</TestComponent>
</CarouselCard>
</CarouselSlider>
</div>
<CarouselButton navType="next" />
</Carousel>
<div className={classes.footer}>
<code className={classes.code}>{JSON.stringify({ activeIndex })}</code>
<div className={classes.controls}>
{new Array(5).fill(null).map((_, index) => (
<Button
key={`externalCarouselNavButton-${index}`}
className={classes.control}
disabled={index === activeIndex}
onClick={() => setActiveIndex(index)}
>
{index}
</Button>
))}
</div>
</div>
</div>
);
};
``` | /content/code_sandbox/packages/react-components/react-carousel-preview/stories/src/Carousel/CarouselControlled.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 755 |
```xml
// See LICENSE in the project root for license information.
import { MockWritable, StringBufferTerminalProvider, Terminal } from '@rushstack/terminal';
import { JsonFile } from '@rushstack/node-core-library';
import { StreamCollator } from '@rushstack/stream-collator';
import { BuildPlanPlugin } from '../BuildPlanPlugin';
import {
type ICreateOperationsContext,
type IExecuteOperationsContext,
PhasedCommandHooks
} from '../../../pluginFramework/PhasedCommandHooks';
import type { Operation } from '../Operation';
import { RushConfiguration } from '../../../api/RushConfiguration';
import {
CommandLineConfiguration,
type IPhase,
type IPhasedCommandConfig
} from '../../../api/CommandLineConfiguration';
import { OperationExecutionRecord } from '../OperationExecutionRecord';
import { PhasedOperationPlugin } from '../PhasedOperationPlugin';
import type { RushConfigurationProject } from '../../../api/RushConfigurationProject';
import { RushConstants } from '../../RushConstants';
import { MockOperationRunner } from './MockOperationRunner';
import { ProjectChangeAnalyzer } from '../../ProjectChangeAnalyzer';
import path from 'path';
import type { ICommandLineJson } from '../../../api/CommandLineJson';
describe(BuildPlanPlugin.name, () => {
const rushJsonFile: string = path.resolve(__dirname, `../../test/workspaceRepo/rush.json`);
const commandLineJsonFile: string = path.resolve(
__dirname,
`../../test/workspaceRepo/common/config/rush/command-line.json`
);
let rushConfiguration!: RushConfiguration;
let commandLineConfiguration!: CommandLineConfiguration;
let stringBufferTerminalProvider!: StringBufferTerminalProvider;
let terminal!: Terminal;
const mockStreamWritable: MockWritable = new MockWritable();
const streamCollator = new StreamCollator({
destination: mockStreamWritable
});
beforeEach(() => {
stringBufferTerminalProvider = new StringBufferTerminalProvider();
terminal = new Terminal(stringBufferTerminalProvider);
mockStreamWritable.reset();
rushConfiguration = RushConfiguration.loadFromConfigurationFile(rushJsonFile);
const commandLineJson: ICommandLineJson = JsonFile.load(commandLineJsonFile);
commandLineConfiguration = new CommandLineConfiguration(commandLineJson);
});
function createMockRunner(operations: Set<Operation>, context: ICreateOperationsContext): Set<Operation> {
for (const operation of operations) {
const { associatedPhase, associatedProject } = operation;
if (associatedPhase && associatedProject && !operation.runner) {
const name: string = `${associatedProject.packageName} (${associatedPhase.name.slice(
RushConstants.phaseNamePrefix.length
)})`;
operation.runner = new MockOperationRunner(name, undefined, undefined, false);
}
}
return operations;
}
async function testCreateOperationsAsync(
phaseSelection: Set<IPhase>,
projectSelection: Set<RushConfigurationProject>,
changedProjects: Set<RushConfigurationProject>
): Promise<Set<Operation>> {
const hooks: PhasedCommandHooks = new PhasedCommandHooks();
// Apply the plugin being tested
new PhasedOperationPlugin().apply(hooks);
// Add mock runners for included operations.
hooks.createOperations.tap('MockOperationRunnerPlugin', createMockRunner);
const context: Pick<
ICreateOperationsContext,
| 'phaseOriginal'
| 'phaseSelection'
| 'projectSelection'
| 'projectsInUnknownState'
| 'projectConfigurations'
> = {
phaseOriginal: phaseSelection,
phaseSelection,
projectSelection,
projectsInUnknownState: changedProjects,
projectConfigurations: new Map()
};
const operations: Set<Operation> = await hooks.createOperations.promise(
new Set(),
context as ICreateOperationsContext
);
return operations;
}
describe('build plan debugging', () => {
it('should generate a build plan', async () => {
const hooks: PhasedCommandHooks = new PhasedCommandHooks();
new BuildPlanPlugin(terminal).apply(hooks);
const context: Pick<IExecuteOperationsContext, 'projectChangeAnalyzer' | 'projectConfigurations'> = {
projectChangeAnalyzer: {
[ProjectChangeAnalyzer.prototype._tryGetProjectDependenciesAsync.name]: async () => {
return new Map();
}
} as unknown as ProjectChangeAnalyzer,
projectConfigurations: new Map()
};
const buildCommand: IPhasedCommandConfig = commandLineConfiguration.commands.get(
'build'
)! as IPhasedCommandConfig;
const operationMap = new Map();
const operations = await testCreateOperationsAsync(
buildCommand.phases,
new Set(rushConfiguration.projects),
new Set(rushConfiguration.projects)
);
operations.forEach((operation) => {
operationMap.set(
operation,
new OperationExecutionRecord(operation, { debugMode: false, quietMode: true, streamCollator })
);
});
await hooks.beforeExecuteOperations.promise(operationMap, context as IExecuteOperationsContext);
expect(stringBufferTerminalProvider.getOutput({ normalizeSpecialCharacters: false })).toMatchSnapshot();
});
});
});
``` | /content/code_sandbox/libraries/rush-lib/src/logic/operations/test/BuildPlanPlugin.test.ts | xml | 2016-09-30T00:28:20 | 2024-08-16T18:54:35 | rushstack | microsoft/rushstack | 5,790 | 1,069 |
```xml
import * as express from 'express';
import { LogLevel } from '../../options';
import { JsonMap, AnyJson } from '../../../common/jsonTypes';
import { MessageProviders } from '../../message';
export type Hook = () => Promise<unknown>;
/**
* State handlers map a state description to a function
* that can setup the provider state
*/
export interface StateHandlers {
[name: string]: StateHandler;
}
/**
* Incoming provider state request
*/
export interface ProviderState {
action: StateAction;
params: JsonMap;
state: string;
}
/**
* Specifies whether the state handler being setup or shutdown
*/
export type StateAction = 'setup' | 'teardown';
/**
* Respond to the state setup event, optionally returning a map of provider
* values to dynamically inject into the incoming request to test
*/
export type StateFunc = (parameters?: AnyJson) => Promise<JsonMap | void>;
/**
* Respond to the state setup event, with the ability to hook into the setup/teardown
* phase of the state
*/
export type StateFuncWithSetup = {
setup?: StateFunc;
teardown?: StateFunc;
};
export type StateHandler = StateFuncWithSetup | StateFunc;
export interface ProxyOptions {
logLevel?: LogLevel;
requestFilter?: express.RequestHandler;
stateHandlers?: StateHandlers;
messageProviders?: MessageProviders;
beforeEach?: Hook;
afterEach?: Hook;
validateSSL?: boolean;
changeOrigin?: boolean;
providerBaseUrl?: string;
proxyHost?: string;
}
``` | /content/code_sandbox/src/dsl/verifier/proxy/types.ts | xml | 2016-06-03T12:02:17 | 2024-08-15T05:47:24 | pact-js | pact-foundation/pact-js | 1,596 | 321 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(CurrentTargetFramework)</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/test/TestAssets/TestPackages/dotnet-new/test_templates/PostActions/RestoreNuGet/TwoProjectsPrimaryOutputs/Custom/MyTestProject/MyTestProject.csproj | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 75 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="path_to_url">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AFE09BCF-28A4-48EE-876B-FEF080D04D5F}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UWPHook</RootNamespace>
<AssemblyName>UWPHook</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsWebBootstrapper>false</IsWebBootstrapper>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\hook2.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>UWPHook.App</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="SharpSteam">
<HintPath>..\..\SharpSteam\SharpSteam\bin\Release\SharpSteam.dll</HintPath>
</Reference>
<Reference Include="System">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\..\..\..\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="VDFParser">
<HintPath>..\..\SharpSteam\SharpSteam\bin\Release\VDFParser.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="AppEntry.cs" />
<Compile Include="AppEntryModel.cs" />
<Compile Include="FullScreenLauncher.xaml.cs">
<DependentUpon>FullScreenLauncher.xaml</DependentUpon>
</Compile>
<Compile Include="GamesWindow.xaml.cs">
<DependentUpon>GamesWindow.xaml</DependentUpon>
</Compile>
<Compile Include="ScriptManager.cs" />
<Compile Include="Settings.cs" />
<Compile Include="SettingsWindow.xaml.cs">
<DependentUpon>SettingsWindow.xaml</DependentUpon>
</Compile>
<Compile Include="SteamGridDb\GameResponse.cs" />
<Compile Include="SteamGridDb\ImageResponse.cs" />
<Compile Include="SteamGridDb\SteamGridDbApi.cs" />
<Page Include="FullScreenLauncher.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="GamesWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="AppManager.cs" />
<Page Include="SettingsWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="bin\Release\_Resources\KnownApps.json" />
<None Include="Properties\Settings.settings">
<Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<EmbeddedResource Include="Resources\KnownApps.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\GetAUMIDScript.ps1" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\WhiteTransparent.png" />
<Resource Include="Resources\BlackTransparent.png" />
</ItemGroup>
<ItemGroup>
<COMReference Include="IWshRuntimeLibrary">
<Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\briano.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\hook2.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\square.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Crc32.NET">
<Version>1.2.0</Version>
</PackageReference>
<PackageReference Include="MaterialDesignColors">
<Version>3.0.0</Version>
</PackageReference>
<PackageReference Include="MaterialDesignThemes">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebApi.Client">
<Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="Serilog">
<Version>3.1.1</Version>
</PackageReference>
<PackageReference Include="Serilog.Sinks.Console">
<Version>5.0.1</Version>
</PackageReference>
<PackageReference Include="Serilog.Sinks.File">
<Version>5.0.0</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
``` | /content/code_sandbox/UWPHook/UWPHook.csproj | xml | 2016-09-18T11:43:03 | 2024-08-15T10:36:31 | UWPHook | BrianLima/UWPHook | 1,534 | 2,472 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="rocm-org" fetch="path_to_url" />
<default revision="refs/tags/rocm-6.2.0"
remote="rocm-org"
sync-c="true"
sync-j="4" />
<!--list of projects for ROCm-->
<project name="amdsmi" />
<project name="omniperf" />
<project name="omnitrace" />
<project name="rdc" />
<project name="roc-core" />
<project name="rocm_bandwidth_test" />
<project name="rocm_smi_lib" />
<project name="rocminfo" />
<project name="rocm-examples" />
<project name="rocm-prof" />
<project name="rocm-prof-register" />
<project name="rocm-prof-sdk" />
<project name="rocm-tracer" />
<project name="ROCK-Kernel-Driver" />
<project name="ROCR-Runtime" />
<project name="ROCT-Thunk-Interface" />
<project name="ROCm" revision="roc-6.2.x" />
<!--HIP Projects-->
<project name="clr" />
<project name="HIPIFY" />
<project name="HIP" />
<project name="hip-other" />
<project name="hip-tests" />
<project name="HIP-Examples" />
<!-- The following projects are all associated with the AMDGPU LLVM compiler -->
<project name="half" />
<project name="llvm-project" />
<!-- gdb projects -->
<project name="ROCdbgapi" />
<project name="ROCgdb" />
<project name="rocr_debug_agent" />
<!-- ROCm Libraries -->
<project groups="mathlibs" name="AMDMIGraphX" />
<project groups="mathlibs" name="MIOpen" />
<project groups="mathlibs" name="MIVisionX" />
<project groups="mathlibs" name="ROCmValidationSuite" />
<project groups="mathlibs" name="Tensile" />
<project groups="mathlibs" name="composable_kernel" />
<project groups="mathlibs" name="hipBLAS" />
<project groups="mathlibs" name="hipBLASLt" />
<project groups="mathlibs" name="hipCUB" />
<project groups="mathlibs" name="hipFFT" />
<project groups="mathlibs" name="hipRAND" />
<project groups="mathlibs" name="hipSOLVER" />
<project groups="mathlibs" name="hipSPARSE" />
<project groups="mathlibs" name="hipSPARSELt" />
<project groups="mathlibs" name="hipTensor" />
<project groups="mathlibs" name="hipfort" />
<project groups="mathlibs" name="rccl" />
<project groups="mathlibs" name="rocAL" />
<project groups="mathlibs" name="rocALUTION" />
<project groups="mathlibs" name="rocBLAS" />
<project groups="mathlibs" name="rocDecode" />
<project groups="mathlibs" name="rocFFT" />
<project groups="mathlibs" name="rocPRIM" />
<project groups="mathlibs" name="rocRAND" />
<project groups="mathlibs" name="rocSOLVER" />
<project groups="mathlibs" name="rocSPARSE" />
<project groups="mathlibs" name="rocThrust" />
<project groups="mathlibs" name="rocWMMA" />
<project groups="mathlibs" name="rocm-cmake" />
<project groups="mathlibs" name="rpp" />
<!-- Projects for OpenMP-Extras -->
<project name="aomp" path="openmp-extras/aomp" />
<project name="aomp-extras" path="openmp-extras/aomp-extras" />
<project name="flang" path="openmp-extras/flang" />
</manifest>
``` | /content/code_sandbox/tools/rocm-build/rocm-6.2.0.xml | xml | 2016-03-18T00:24:29 | 2024-08-16T18:19:24 | ROCm | ROCm/ROCm | 4,429 | 920 |
```xml
// luma.gl
/**
* Stores luma.gl specific state associated with a context
*/
export interface WebGLContextData {
_polyfilled: boolean;
_extensions: Record<string, any>;
}
/**
* Gets luma.gl specific state from a context
* @returns context state
*/
export function getWebGLContextData(gl: WebGL2RenderingContext): WebGLContextData {
// @ts-expect-error
const luma = gl.luma as WebGLContextData | null;
if (!luma) {
const contextState: WebGLContextData = {
_polyfilled: false,
_extensions: {}
};
// @ts-expect-error
gl.luma = contextState;
}
// @ts-expect-error
return gl.luma;
}
``` | /content/code_sandbox/modules/webgl/src/context/helpers/webgl-context-data.ts | xml | 2016-01-25T09:41:59 | 2024-08-16T10:03:05 | luma.gl | visgl/luma.gl | 2,280 | 166 |
```xml
import React from 'react'
import SpecProperty from './_SpecProperty'
import DataProperty, { Stop } from './_DataProperty'
import ZoomProperty from './_ZoomProperty'
import ExpressionProperty from './_ExpressionProperty'
import {function as styleFunction} from '@maplibre/maplibre-gl-style-spec';
import {findDefaultFromSpec} from '../libs/spec-helper';
function isLiteralExpression(value: any) {
return (Array.isArray(value) && value.length === 2 && value[0] === "literal");
}
function isGetExpression(value: any) {
return (
Array.isArray(value) &&
value.length === 2 &&
value[0] === "get"
);
}
function isZoomField(value: any) {
return (
typeof(value) === 'object' &&
value.stops &&
typeof(value.property) === 'undefined' &&
Array.isArray(value.stops) &&
value.stops.length > 1 &&
value.stops.every((stop: Stop) => {
return (
Array.isArray(stop) &&
stop.length === 2
);
})
);
}
function isIdentityProperty(value: any) {
return (
typeof(value) === 'object' &&
value.type === "identity" &&
Object.prototype.hasOwnProperty.call(value, "property")
);
}
function isDataStopProperty(value: any) {
return (
typeof(value) === 'object' &&
value.stops &&
typeof(value.property) !== 'undefined' &&
value.stops.length > 1 &&
Array.isArray(value.stops) &&
value.stops.every((stop: Stop) => {
return (
Array.isArray(stop) &&
stop.length === 2 &&
typeof(stop[0]) === 'object'
);
})
);
}
function isDataField(value: any) {
return (
isIdentityProperty(value) ||
isDataStopProperty(value)
);
}
function isPrimative(value: any): value is string | boolean | number {
const valid = ["string", "boolean", "number"];
return valid.includes(typeof(value));
}
function isArrayOfPrimatives(values: any): values is Array<string | boolean | number> {
if (Array.isArray(values)) {
return values.every(isPrimative);
}
return false;
}
function getDataType(value: any, fieldSpec={} as any) {
if (value === undefined) {
return "value";
}
else if (isPrimative(value)) {
return "value";
}
else if (fieldSpec.type === "array" && isArrayOfPrimatives(value)) {
return "value";
}
else if (isZoomField(value)) {
return "zoom_function";
}
else if (isDataField(value)) {
return "data_function";
}
else {
return "expression";
}
}
type FieldFunctionProps = {
onChange(fieldName: string, value: any): unknown
fieldName: string
fieldType: string
fieldSpec: any
errors?: {[key: string]: {message: string}}
value?: any
};
type FieldFunctionState = {
dataType: string
isEditing: boolean
}
/** Supports displaying spec field for zoom function objects
* path_to_url#types-function-zoom-property
*/
export default class FieldFunction extends React.Component<FieldFunctionProps, FieldFunctionState> {
constructor (props: FieldFunctionProps) {
super(props);
this.state = {
dataType: getDataType(props.value, props.fieldSpec),
isEditing: false,
}
}
static getDerivedStateFromProps(props: Readonly<FieldFunctionProps>, state: FieldFunctionState) {
// Because otherwise when editing values we end up accidentally changing field type.
if (state.isEditing) {
return {};
}
else {
return {
isEditing: false,
dataType: getDataType(props.value, props.fieldSpec)
};
}
}
getFieldFunctionType(fieldSpec: any) {
if (fieldSpec.expression.interpolated) {
return "exponential"
}
if (fieldSpec.type === "number") {
return "interval"
}
return "categorical"
}
addStop = () => {
const stops = this.props.value.stops.slice(0)
const lastStop = stops[stops.length - 1]
if (typeof lastStop[0] === "object") {
stops.push([
{zoom: lastStop[0].zoom + 1, value: lastStop[0].value},
lastStop[1]
])
}
else {
stops.push([lastStop[0] + 1, lastStop[1]])
}
const changedValue = {
...this.props.value,
stops: stops,
}
this.props.onChange(this.props.fieldName, changedValue)
}
deleteExpression = () => {
const {fieldSpec, fieldName} = this.props;
this.props.onChange(fieldName, fieldSpec.default);
this.setState({
dataType: "value",
});
}
deleteStop = (stopIdx: number) => {
const stops = this.props.value.stops.slice(0)
stops.splice(stopIdx, 1)
let changedValue = {
...this.props.value,
stops: stops,
}
if(stops.length === 1) {
changedValue = stops[0][1]
}
this.props.onChange(this.props.fieldName, changedValue)
}
makeZoomFunction = () => {
const {value} = this.props;
let zoomFunc;
if (typeof(value) === "object") {
if (value.stops) {
zoomFunc = {
base: value.base,
stops: value.stops.map((stop: Stop) => {
return [stop[0].zoom, stop[1] || findDefaultFromSpec(this.props.fieldSpec)];
})
}
}
else {
zoomFunc = {
base: value.base,
stops: [
[6, findDefaultFromSpec(this.props.fieldSpec)],
[10, findDefaultFromSpec(this.props.fieldSpec)]
]
}
}
}
else {
zoomFunc = {
stops: [
[6, value || findDefaultFromSpec(this.props.fieldSpec)],
[10, value || findDefaultFromSpec(this.props.fieldSpec)]
]
}
}
this.props.onChange(this.props.fieldName, zoomFunc)
}
undoExpression = () => {
const {value, fieldName} = this.props;
if (isGetExpression(value)) {
this.props.onChange(fieldName, {
"type": "identity",
"property": value[1]
});
this.setState({
dataType: "value",
});
}
else if (isLiteralExpression(value)) {
this.props.onChange(fieldName, value[1]);
this.setState({
dataType: "value",
});
}
}
canUndo = () => {
const {value, fieldSpec} = this.props;
return (
isGetExpression(value) ||
isLiteralExpression(value) ||
isPrimative(value) ||
(Array.isArray(value) && fieldSpec.type === "array")
);
}
makeExpression = () => {
const {value, fieldSpec} = this.props;
let expression;
if (typeof(value) === "object" && 'stops' in value) {
expression = styleFunction.convertFunction(value, fieldSpec);
}
else if (isIdentityProperty(value)) {
expression = ["get", value.property];
}
else {
expression = ["literal", value || this.props.fieldSpec.default];
}
this.props.onChange(this.props.fieldName, expression);
}
makeDataFunction = () => {
const functionType = this.getFieldFunctionType(this.props.fieldSpec);
const stopValue = functionType === 'categorical' ? '' : 0;
const {value} = this.props;
let dataFunc;
if (typeof(value) === "object") {
if (value.stops) {
dataFunc = {
property: "",
type: functionType,
base: value.base,
stops: value.stops.map((stop: Stop) => {
return [{zoom: stop[0], value: stopValue}, stop[1] || findDefaultFromSpec(this.props.fieldSpec)];
})
}
}
else {
dataFunc = {
property: "",
type: functionType,
base: value.base,
stops: [
[{zoom: 6, value: stopValue}, findDefaultFromSpec(this.props.fieldSpec)],
[{zoom: 10, value: stopValue}, findDefaultFromSpec(this.props.fieldSpec)]
]
}
}
}
else {
dataFunc = {
property: "",
type: functionType,
base: value.base,
stops: [
[{zoom: 6, value: stopValue}, this.props.value || findDefaultFromSpec(this.props.fieldSpec)],
[{zoom: 10, value: stopValue}, this.props.value || findDefaultFromSpec(this.props.fieldSpec)]
]
}
}
this.props.onChange(this.props.fieldName, dataFunc)
}
onMarkEditing = () => {
this.setState({isEditing: true});
}
onUnmarkEditing = () => {
this.setState({isEditing: false});
}
render() {
const {dataType} = this.state;
const propClass = this.props.fieldSpec.default === this.props.value ? "maputnik-default-property" : "maputnik-modified-property"
let specField;
if (dataType === "expression") {
specField = (
<ExpressionProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this, this.props.fieldName)}
canUndo={this.canUndo}
onUndo={this.undoExpression}
onDelete={this.deleteExpression}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onFocus={this.onMarkEditing}
onBlur={this.onUnmarkEditing}
/>
);
}
else if (dataType === "zoom_function") {
specField = (
<ZoomProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this)}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onDeleteStop={this.deleteStop}
onAddStop={this.addStop}
onChangeToDataFunction={this.makeDataFunction}
onExpressionClick={this.makeExpression}
/>
)
}
else if (dataType === "data_function") {
// TODO: Rename to FieldFunction **this file** shouldn't be called that
specField = (
<DataProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this)}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onDeleteStop={this.deleteStop}
onAddStop={this.addStop}
onChangeToZoomFunction={this.makeZoomFunction}
onExpressionClick={this.makeExpression}
/>
)
}
else {
specField = (
<SpecProperty
errors={this.props.errors}
onChange={this.props.onChange.bind(this)}
fieldType={this.props.fieldType}
fieldName={this.props.fieldName}
fieldSpec={this.props.fieldSpec}
value={this.props.value}
onZoomClick={this.makeZoomFunction}
onDataClick={this.makeDataFunction}
onExpressionClick={this.makeExpression}
/>
)
}
return <div className={propClass} data-wd-key={"spec-field-container:"+this.props.fieldName}>
{specField}
</div>
}
}
``` | /content/code_sandbox/src/components/FieldFunction.tsx | xml | 2016-09-08T17:52:22 | 2024-08-16T12:54:23 | maputnik | maplibre/maputnik | 2,046 | 2,536 |
```xml
type Props = {
children: React.ReactNode;
};
export default function Container({ children }: Props) {
return <div className="container mx-auto px-5">{children}</div>;
}
``` | /content/code_sandbox/examples/cms-enterspeed/components/container.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 40 |
```xml
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
import * as runtime from "@pulumi/pulumi/runtime" // @pulumi dependency is not included
import * as semver from "semver" // npm dependency
import * as myRandom from "my-random" // workspace dependency
import * as myDynamicProvider from "my-dynamic-provider" // workspace dependency
const random = new myRandom.MyRandom("plop", {});
export const id = random.randomID;
export const version = semver.parse("1.2.3");
const dynamicProviderResource = new myDynamicProvider.MyDynamicProviderResource("prov", {});
(async function () {
const deps = await runtime.computeCodePaths() as Map<string, string>;
const directDependencies = [`node_modules/semver`, `node_modules/my-random`, `node_modules/my-dynamic-provider`]
const depPaths = [...deps.keys()]
for (const expected of directDependencies) {
const depPath = depPaths.find((path) => path.includes(expected));
if (!depPath) {
throw new Error(`Expected to find a path matching ${expected}, got ${depPaths}`)
}
}
})();
``` | /content/code_sandbox/tests/integration/nodejs/codepaths-workspaces/infra/index.ts | xml | 2016-10-31T21:02:47 | 2024-08-16T19:47:04 | pulumi | pulumi/pulumi | 20,743 | 270 |
```xml
import type { DragEvent, ReactNode } from 'react';
import { useEffect, useMemo, useRef } from 'react';
import { createPortal } from 'react-dom';
interface DragMoveContentProps<T> {
data?: T;
dragging?: boolean;
children: ReactNode;
}
interface UseDragMoveParams {
dragging: boolean;
setDragging: (value: boolean) => void;
format?: string;
formatter?: (value: any) => string;
}
function useDragMove({ dragging, setDragging, format = 'text/plain', formatter = (str) => str }: UseDragMoveParams) {
const container = useRef<HTMLDivElement>();
const transferData = useRef<any>();
const handleDragStart = (event: DragEvent<HTMLTableRowElement>) => {
if (!container.current) {
container.current = document.createElement('div');
container.current.className = 'absolute';
}
document.body.appendChild(container.current);
event.dataTransfer.setDragImage(container.current, 0, 0);
event.dataTransfer.setData(format, formatter(transferData.current));
setDragging(true);
};
const handleDragEnd = () => {
if (container.current) {
document.body.removeChild(container.current);
}
setDragging(false);
};
const DragMoveContent = useMemo(
() =>
function Component<T>({ children, data, dragging }: DragMoveContentProps<T>) {
transferData.current = data;
useEffect(() => {
return () => {
transferData.current = undefined;
};
}, []);
if (dragging && container.current) {
return createPortal(children, container.current);
}
return null;
},
[]
);
return { dragging, handleDragEnd, handleDragStart, DragMoveContent };
}
export default useDragMove;
``` | /content/code_sandbox/packages/components/hooks/useDragMove.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 378 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language
name="BrightScript"
section="Scripts"
extensions="*.brs"
version="5"
kateversion="5.0"
author="Daniel Levin (dendy.ua@gmail.com)"
license="MIT">
<highlighting>
<list name="library"><item>library</item></list>
<list name="function"><item>function</item></list>
<list name="endfunction"><item>endfunction</item></list>
<list name="sub"><item>sub</item></list>
<list name="endsub"><item>endsub</item></list>
<list name="as"><item>as</item></list>
<list name="exit"><item>exit</item></list>
<list name="if"><item>if</item></list>
<list name="endif"><item>endif</item></list>
<list name="then"><item>then</item></list>
<list name="else"><item>else</item></list>
<list name="elseif"><item>elseif</item></list>
<list name="while"><item>while</item></list>
<list name="endwhile"><item>endwhile</item></list>
<list name="exitwhile"><item>exitwhile</item></list>
<list name="for"><item>for</item></list>
<list name="endfor"><item>endfor</item></list>
<list name="each"><item>each</item></list>
<list name="in"><item>in</item></list>
<list name="to"><item>to</item></list>
<list name="step"><item>step</item></list>
<list name="next"><item>next</item></list>
<list name="print"><item>print</item></list>
<list name="return"><item>return</item></list>
<list name="dim"><item>dim</item></list>
<list name="stop"><item>stop</item></list>
<list name="goto"><item>goto</item></list>
<list name="m"><item>m</item></list>
<list name="top">
<item>top</item>
<item>global</item>
</list>
<list name="end_of_scope">
<item>then</item>
<item>end</item>
<item>exit</item>
</list>
<list name="unary">
<item>not</item>
</list>
<list name="builtin_functions">
<item>tab</item>
<item>pos</item>
<item>CreateObject</item>
<item>Type</item>
<item>GetGlobalAA</item>
<item>Box</item>
<item>Run</item>
<item>Eval</item>
<item>GetLastRunCompileError</item>
<item>GetLastRunRuntimeError</item>
<item>ObjFun</item>
</list>
<list name="utility_functions">
<item>Sleep</item>
<item>Wait</item>
<item>GetInterface</item>
<item>FindMemberFunction</item>
<item>UpTime</item>
<item>RebootSystem</item>
<item>ListDir</item>
<item>ReadAsciiFile</item>
<item>WriteAsciiFile</item>
<item>CopyFile</item>
<item>MoveFile</item>
<item>MatchFiles</item>
<item>DeleteFile</item>
<item>DeleteDirectory</item>
<item>CreateDirectory</item>
<item>FormatDrive</item>
<item>StrToI</item>
<item>RunGarbageCollector</item>
<item>ParseJson</item>
<item>FormatJson</item>
<item>Tr</item>
</list>
<list name="string_functions">
<item>UCase</item>
<item>LCase</item>
<item>Asc</item>
<item>Chr</item>
<item>Instr</item>
<item>Left</item>
<item>Len</item>
<item>Mid</item>
<item>Str</item>
<item>StrI</item>
<item>String</item>
<item>StringI</item>
<item>Val</item>
<item>Substitute</item>
</list>
<list name="math_functions">
<item>Abs</item>
<item>Atn</item>
<item>Cdbl</item>
<item>Cint</item>
<item>Cos</item>
<item>Csng</item>
<item>Exp</item>
<item>Fix</item>
<item>Int</item>
<item>Log</item>
<item>Rnd</item>
<item>Sgn</item>
<item>Sin</item>
<item>Sqr</item>
<item>Tan</item>
</list>
<list name="comments">
<item>rem</item>
</list>
<list name="types">
<item>invalid</item>
<item>void</item>
<item>dynamic</item>
<item>boolean</item>
<item>integer</item>
<item>longinteger</item>
<item>float</item>
<item>double</item>
<item>string</item>
<item>object</item>
<item>function</item>
<item>interface</item>
</list>
<list name="constants">
<item>true</item>
<item>false</item>
<item>invalid</item>
<item>LINE_NUM</item>
</list>
<contexts>
<!-- Contexts starting with @ are for inclusion only. -->
<context name="global" attribute="g" lineEndContext="#stay">
<DetectSpaces/>
<keyword String="library" attribute="import" context="library"/>
<IncludeRules context="@comment"/>
<IncludeRules context="@macro"/>
<IncludeRules context="@function"/>
<IncludeRules context="@sub"/>
</context>
<!-- Import statement, which might appear at the global context:
library "mylibname.brs"
-->
<context name="library" attribute="import" lineEndContext="#pop">
<DetectSpaces/>
<DetectChar char=""" attribute="string" context="#pop!string"/>
</context>
<!-- Comments have higher priority over anything else. -->
<context name="@comment" attribute="g" lineEndContext="#stay">
<DetectSpaces/>
<DetectChar char="'" attribute="comment" context="comment"/>
<keyword String="comments" attribute="comment" context="comment"/>
</context>
<context name="comment" attribute="comment" lineEndContext="#pop">
</context>
<!-- Macro statement starts with # and might appear anywhere in the code:
#if foo
...
#else
...
#endif
-->
<context name="@macro" attribute="g" lineEndContext="#stay">
<DetectChar char="#" attribute="macro" context="macro_line"/>
</context>
<context name="macro_line" attribute="macro" lineEndContext="#pop">
<IncludeRules context="@comment"/>
</context>
<!-- Colon starts a new line. -->
<context name="line_break" attribute="g" lineEndContext="#stay">
<IncludeRules context="@line_break"/>
</context>
<context name="@line_break" attribute="g" lineEndContext="#stay">
<DetectChar char=":" attribute="line_break" context="#pop"/>
</context>
<!-- Common rules for function and sub. -->
<context name="@code_end" attribute="g" lineEndContext="#stay">
<RegExpr String="end\s+(if|for|while)" insensitive="true" attribute="control"/>
</context>
<context name="arg_as_type" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<DetectIdentifier attribute="var" context="#pop!arg_params"/>
</context>
<context name="arg_params" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<keyword String="as" context="as_type" lookAhead="true"/>
<DetectChar char="=" attribute="assign" context="rvalue"/>
</context>
<context name="as_type" attribute="g" lineEndContext="#stay">
<keyword String="as" attribute="keyword" context="as_type_value"/>
</context>
<context name="as_type_value" attribute="g" lineEndContext="#stay">
<keyword String="types" attribute="type" context="#pop#pop"/>
<DetectIdentifier attribute="invalid" context="#pop#pop"/>
</context>
<!-- Regular function definition. -->
<context name="@function" attribute="g" lineEndContext="#stay">
<keyword String="function" attribute="keyword" context="function" beginRegion="function"/>
</context>
<context name="function" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="function_name">
</context>
<context name="function_name" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!function_code">
<DetectSpaces/>
<DetectIdentifier attribute="func" context="#pop!func_open_brace"/>
<DetectChar char="(" context="#pop!func_open_brace" lookAhead="true"/>
</context>
<context name="func_open_brace" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!function_code">
<DetectSpaces/>
<DetectChar char="(" attribute="scope" context="func_args"/>
</context>
<context name="func_args" attribute="g" lineEndContext="#stay" fallthroughContext="#pop#pop!function_code">
<DetectSpaces/>
<DetectIdentifier context="arg_as_type" lookAhead="true"/>
<DetectChar char=")" attribute="scope" context="#pop#pop!function_ret"/>
<DetectChar char="," attribute="coma" context="arg_as_type"/>
</context>
<context name="function_ret" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!function_code">
<DetectChar char=" " context="#stay"/>
<keyword String="as" context="as_type" lookAhead="true"/>
</context>
<context name="function_code" attribute="g" lineEndContext="#stay">
<DetectSpaces/>
<RegExpr String="end\s+function" insensitive="true" context="#pop!function_solid_end" lookAhead="true"/>
<keyword String="endfunction" context="#pop!function_solid_end" lookAhead="true"/>
<IncludeRules context="@code"/>
</context>
<context name="function_solid_end" attribute="g" lineEndContext="#stay">
<StringDetect String="end" insensitive="true" attribute="keyword" context="#pop!function_end"/>
</context>
<context name="function_end" attribute="keyword" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
<DetectSpaces/>
<StringDetect String="function" insensitive="true" attribute="keyword" context="#pop#pop" endRegion="function"/>
</context>
<!-- sub is a function with void return type. -->
<context name="@sub" attribute="g" lineEndContext="#stay">
<keyword String="sub" attribute="keyword" context="sub" beginRegion="sub"/>
</context>
<context name="sub" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="sub_name">
</context>
<context name="sub_name" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!sub_code">
<DetectSpaces/>
<DetectIdentifier attribute="func" context="#pop!sub_open_brace"/>
<DetectChar char="(" context="#pop!sub_open_brace" lookAhead="true"/>
</context>
<context name="sub_open_brace" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!sub_code">
<DetectSpaces/>
<DetectChar char="(" attribute="scope" context="sub_args"/>
</context>
<context name="sub_args" attribute="g" lineEndContext="#stay" fallthroughContext="#pop#pop!sub_code">
<DetectSpaces/>
<DetectIdentifier context="arg_as_type" lookAhead="true"/>
<DetectChar char=")" attribute="scope" context="#pop#pop!sub_ret"/>
<DetectChar char="," attribute="coma" context="arg_as_type"/>
</context>
<context name="sub_ret" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!sub_code">
<DetectChar char=" " context="#stay"/>
<keyword String="as" context="as_type" lookAhead="true"/>
</context>
<context name="sub_code" attribute="g" lineEndContext="#stay">
<DetectSpaces/>
<RegExpr String="end\s+sub" insensitive="true" context="#pop!sub_solid_end" lookAhead="true"/>
<keyword String="endsub" context="#pop!sub_solid_end" lookAhead="true"/>
<IncludeRules context="@code"/>
</context>
<context name="sub_solid_end" attribute="g" lineEndContext="#stay">
<StringDetect String="end" insensitive="true" attribute="keyword" context="#pop!sub_end"/>
</context>
<context name="sub_end" attribute="keyword" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
<DetectSpaces/>
<StringDetect String="sub" insensitive="true" attribute="keyword" context="#pop#pop" endRegion="sub"/>
</context>
<!-- @code represents execution body, including function and sub contents.
-->
<context name="@code" attribute="g" lineEndContext="#stay">
<DetectSpaces/>
<IncludeRules context="@macro"/>
<IncludeRules context="@comment"/>
<IncludeRules context="@code_end"/>
<keyword String="print" attribute="print" context="print"/>
<keyword String="goto" attribute="keyword" context="goto"/>
<keyword String="return" attribute="control" context="rvalue"/>
<keyword String="stop" attribute="keyword"/>
<keyword String="dim" attribute="keyword" context="dim"/>
<keyword String="if" attribute="control" context="rvalue"/>
<keyword String="then" attribute="control"/>
<keyword String="else" attribute="control"/>
<keyword String="elseif" attribute="control"/>
<keyword String="endif" attribute="control"/>
<keyword String="while" attribute="control" context="rvalue"/>
<keyword String="endwhile" attribute="control"/>
<keyword String="exitwhile" attribute="control"/>
<keyword String="for" attribute="control" context="for"/>
<keyword String="endfor" attribute="control"/>
<keyword String="next" attribute="control"/>
<keyword String="exit" attribute="control" context="exit"/>
<DetectChar char=":" context="line_break" lookAhead="true"/>
<DetectIdentifier context="lvalue" lookAhead="true"/>
</context>
<context name="print" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="rvalue">
<DetectChar char="," attribute="coma"/>
<DetectChar char=";" attribute="coma"/>
<IncludeRules context="@line_break"/>
</context>
<context name="goto" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<DetectIdentifier attribute="label" context="#pop"/>
</context>
<context name="dim" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<DetectIdentifier attribute="var" context="#pop!dim_array"/>
<IncludeRules context="@comment"/>
</context>
<context name="dim_array" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<DetectChar char="[" attribute="operator" context="#pop!array"/>
<IncludeRules context="@comment"/>
</context>
<context name="for" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!for_var">
<DetectSpaces/>
<keyword String="each" attribute="control" context="#pop!for_each"/>
<IncludeRules context="@comment"/>
</context>
<context name="for_each" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<DetectIdentifier attribute="var" context="#pop!for_in"/>
<IncludeRules context="@comment"/>
</context>
<context name="for_in" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<keyword String="in" attribute="control" context="#pop!rvalue"/>
<IncludeRules context="@comment"/>
</context>
<context name="for_var" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="lvalue">
<DetectSpaces/>
<keyword String="to" attribute="control" context="#pop!for_to"/>
<IncludeRules context="@comment"/>
</context>
<context name="for_to" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="rvalue">
<DetectSpaces/>
<keyword String="step" attribute="control" context="#pop!rvalue"/>
</context>
<context name="exit" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<keyword String="for" attribute="control" context="#pop"/>
<keyword String="while" attribute="control" context="#pop"/>
<IncludeRules context="@comment"/>
</context>
<!-- Builtin functions are reserved keywords. They cannot be used as a local variable names.
Thus doing something like below is an error and will be highlighted with 'invalid':
eval = 1
foo = eval
It is still valid to use any word, including reserved ones, as an variable parameter:
foo.eval = 1
foo = bar.eval
foo.eval()
-->
<context name="@lvalue_builtin_functions" attribute="g" lineEndContext="#stay">
<keyword String="builtin_functions" context="#pop!lvalue_builtin_function" lookAhead="true"/>
</context>
<context name="lvalue_builtin_function" attribute="g" lineEndContext="#pop">
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!lvalue_builtin_call" lookAhead="true"/>
<DetectIdentifier attribute="invalid" context="#pop"/>
</context>
<context name="lvalue_builtin_call" attribute="g" lineEndContext="#pop">
<DetectIdentifier attribute="builtin_func" context="#pop!lvalue_call_open_brace"/>
</context>
<context name="@rvalue_builtin_functions" attribute="g" lineEndContext="#stay">
<keyword String="builtin_functions" context="#pop!rvalue_builtin_function" lookAhead="true"/>
</context>
<context name="rvalue_builtin_function" attribute="g" lineEndContext="#pop">
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!rvalue_builtin_call" lookAhead="true"/>
<DetectIdentifier attribute="invalid" context="#pop"/>
</context>
<context name="rvalue_builtin_call" attribute="g" lineEndContext="#pop">
<DetectIdentifier attribute="builtin_func" context="#pop!rvalue_call_open_brace"/>
</context>
<!-- Library functions have nothing special comparing to other functions. They just have different
highlighting colors. It is valid to shadow function with a variable with the same name,
although it is not recommended and might be considered as a warning by various linters.
-->
<context name="@lvalue_library_functions" attribute="g" lineEndContext="#stay">
<keyword String="utility_functions" context="#pop!lvalue_library_function" lookAhead="true"/>
<keyword String="string_functions" context="#pop!lvalue_library_function" lookAhead="true"/>
<keyword String="math_functions" context="#pop!lvalue_library_function" lookAhead="true"/>
</context>
<context name="lvalue_library_function" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue_var">
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!lvalue_library_call" lookAhead="true"/>
</context>
<context name="lvalue_library_call" attribute="g" lineEndContext="#pop">
<DetectIdentifier attribute="library_func" context="#pop!lvalue_call_open_brace"/>
</context>
<context name="@rvalue_library_functions" attribute="g" lineEndContext="#stay">
<keyword String="utility_functions" context="#pop!rvalue_library_function" lookAhead="true"/>
<keyword String="string_functions" context="#pop!rvalue_library_function" lookAhead="true"/>
<keyword String="math_functions" context="#pop!rvalue_library_function" lookAhead="true"/>
</context>
<context name="rvalue_library_function" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_var">
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!rvalue_library_call" lookAhead="true"/>
</context>
<context name="rvalue_library_call" attribute="g" lineEndContext="#pop">
<DetectIdentifier attribute="library_func" context="#pop!rvalue_call_open_brace"/>
</context>
<!-- lvalue contexts represent expressions of the left side of the assignment operators or
standalone function calls.
-->
<context name="lvalue" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue_exp">
<DetectSpaces/>
<keyword String="m" attribute="m" context="#pop!lvalue_m_dot"/>
<IncludeRules context="@lvalue_builtin_functions"/>
<IncludeRules context="@lvalue_library_functions"/>
<IncludeRules context="@comment"/>
</context>
<context name="lvalue_exp" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!lvalue_call" lookAhead="true"/>
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*:" attribute="label" context="#pop"/>
<DetectIdentifier context="#pop!lvalue_var" lookAhead="true"/>
</context>
<context name="lvalue_m_dot" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<DetectChar char="." attribute="operator" context="#pop!lvalue_top"/>
<IncludeRules context="@comment"/>
<IncludeRules context="@lvalue_ops"/>
</context>
<context name="lvalue_top" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<keyword String="top" attribute="top" context="#pop!lvalue_operator"/>
<DetectIdentifier context="#pop!lvalue_exp" lookAhead="true"/>
<IncludeRules context="@comment"/>
</context>
<context name="lvalue_var" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectIdentifier attribute="var" context="#pop!lvalue_var_postfix"/>
</context>
<context name="lvalue_var_postfix" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!lvalue_operator">
<AnyChar String="$%&!#" attribute="var" context="#pop!lvalue_operator"/>
</context>
<context name="lvalue_operator" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<DetectChar char="." attribute="operator" context="#pop!lvalue_exp"/>
<IncludeRules context="@lvalue_ops"/>
</context>
<context name="@lvalue_ops" attribute="g" lineEndContext="#stay">
<IncludeRules context="@lvalue_call_open_brace"/>
<DetectChar char="[" attribute="operator" context="lvalue_array"/>
<RegExpr String="(=|\+=|\-=|\*=|/=|\\=|<<=|>>=)" attribute="assign" context="#pop!rvalue"/>
</context>
<context name="lvalue_array" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
<DetectSpaces/>
<DetectChar char="," attribute="coma"/>
<DetectChar char="]" attribute="operator" context="#pop!lvalue_operator"/>
</context>
<context name="lvalue_call" attribute="g" lineEndContext="#stay">
<DetectIdentifier attribute="func" context="#pop!lvalue_call_open_brace"/>
</context>
<context name="lvalue_call_open_brace" attribute="g" lineEndContext="#stay">
<IncludeRules context="@lvalue_call_open_brace"/>
</context>
<context name="@lvalue_call_open_brace" attribute="g" lineEndContext="#stay">
<DetectChar char="(" attribute="scope" context="lvalue_call_args"/>
</context>
<context name="lvalue_call_args" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
<DetectSpaces/>
<DetectChar char=")" attribute="scope" context="#pop#pop!lvalue_operator"/>
<DetectChar char="," attribute="coma"/>
</context>
<!-- rvalue contexts represent expressions on the right side of assignment operators and arguments
to other functions, 'print' calls, object keys, array values, etc.
-->
<context name="rvalue" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<DetectChar char="-" attribute="unary"/>
<DetectChar char="+" attribute="unary"/>
<IncludeRules context="@comment"/>
<IncludeRules context="@function"/>
<IncludeRules context="@sub"/>
<keyword String="unary" attribute="unary"/>
<keyword String="end_of_scope" context="#pop#pop" lookAhead="true"/>
<DetectChar char=""" attribute="string" context="#pop!string"/>
<DetectChar char="[" attribute="operator" context="#pop!array"/>
<DetectChar char="(" attribute="scope" context="#pop!rvalue_scope"/>
<DetectChar char="{" attribute="operator" context="#pop!object"/>
<keyword String="constants" attribute="constant" context="#pop!rvalue_operator"/>
<RegExpr String="[-+]?[0-9]*\.[0-9]" context="#pop!float" lookAhead="true"/>
<RegExpr String="[-+]?[0-9]" context="#pop!int" lookAhead="true"/>
<StringDetect String="&h" insensitive="true" attribute="dec" context="#pop!hex"/>
<keyword String="m" attribute="m" context="#pop!rvalue_m_dot"/>
<IncludeRules context="@rvalue_builtin_functions"/>
<IncludeRules context="@rvalue_library_functions"/>
<IncludeRules context="@rvalue_dot"/>
</context>
<context name="rvalue_var" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
<DetectIdentifier attribute="var" context="#pop!rvalue_var_postfix"/>
</context>
<context name="rvalue_var_postfix" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_operator">
<AnyChar String="$%&!#" attribute="var" context="#pop!rvalue_operator"/>
</context>
<context name="rvalue_operator" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_end">
<DetectSpaces/>
<DetectChar char="." attribute="operator" context="#pop!rvalue_dot"/>
<DetectChar char="@" attribute="operator" context="#pop!rvalue_dot"/>
<IncludeRules context="@rvalue_ops"/>
</context>
<context name="@rvalue_ops" attribute="g" lineEndContext="#stay">
<IncludeRules context="@rvalue_call_open_brace"/>
<DetectChar char="[" attribute="operator" context="#pop!array"/>
</context>
<context name="rvalue_end" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<DetectSpaces/>
<RegExpr String="(=|<>|<<|>>|<=|>=|<|>|\^|\-|\+|\*|\/|\\)" context="#pop!rvalue_binary" lookAhead="true"/>
<RegExpr String="(and|or|mod)[\W]" insensitive="true" context="#pop!rvalue_binary" lookAhead="true"/>
</context>
<context name="rvalue_binary" attribute="invalid" lineEndContext="#stay">
<DetectSpaces/>
<RegExpr String="(=|<>|<<|>>|<=|>=|<|>|\^|\-|\+|\*|\/|\\|and|or|mod)" insensitive="true" attribute="binary" context="#pop!rvalue"/>
</context>
<context name="rvalue_m_dot" attribute="g" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!rvalue_end">
<DetectSpaces/>
<DetectChar char="." attribute="operator" context="#pop!rvalue_top"/>
<IncludeRules context="@comment"/>
<IncludeRules context="@rvalue_ops"/>
</context>
<context name="rvalue_top" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<keyword String="top" attribute="top" context="#pop!rvalue_operator"/>
<DetectIdentifier context="#pop!rvalue_dot" lookAhead="true"/>
<IncludeRules context="@comment"/>
</context>
<context name="rvalue_scope" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
<DetectSpaces/>
<DetectChar char=")" attribute="scope" context="#pop!rvalue_operator"/>
</context>
<context name="rvalue_dot" attribute="g" lineEndContext="#stay">
<IncludeRules context="@rvalue_dot"/>
</context>
<context name="@rvalue_dot" attribute="g" lineEndContext="#stay">
<RegExpr String="[a-zA-Z_][a-zA-Z0-1_]*\s*\(" context="#pop!rvalue_call" lookAhead="true"/>
<DetectIdentifier context="#pop!rvalue_var" lookAhead="true"/>
</context>
<!-- Other rvalue expressions. -->
<context name="string" attribute="string" lineEndContext="#pop#pop">
<DetectChar char=""" attribute="string" context="#pop!rvalue_operator"/>
</context>
<context name="array" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
<DetectSpaces/>
<DetectChar char="," attribute="coma"/>
<DetectChar char="]" attribute="operator" context="#pop!rvalue_operator"/>
</context>
<context name="object" attribute="g" lineEndContext="#stay">
<DetectSpaces/>
<IncludeRules context="@comment"/>
<DetectChar char="," attribute="coma"/>
<DetectChar char="}" attribute="operator" context="#pop!rvalue_operator"/>
<DetectChar char=""" attribute="var" context="object_param_string"/>
<DetectIdentifier attribute="var" context="object_param_colon"/>
</context>
<context name="object_param_string" attribute="var" lineEndContext="#pop">
<DetectChar char=""" attribute="var" context="#pop!object_param_colon"/>
</context>
<context name="object_param_colon" attribute="g" lineEndContext="#pop">
<DetectSpaces/>
<IncludeRules context="@comment"/>
<DetectChar char=":" attribute="operator" context="#pop!rvalue"/>
</context>
<context name="float" attribute="float" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<!-- documentation says this is a valid string, but implementation gives compile error -->
<!--<RegExpr String="[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?\$" attribute="string" context="postfix_delimiter"/>-->
<!--<RegExpr String="[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?[%&]" attribute="dec" context="postfix_delimiter"/>-->
<RegExpr String="[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?[!#]?" attribute="float" context="postfix_delimiter"/>
</context>
<context name="int" attribute="dec" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<!-- documentation says this is a valid string, but implementation gives compile error -->
<!--<RegExpr String="[-+]?[0-9]*\$" attribute="string" context="postfix_delimiter"/>-->
<RegExpr String="[-+]?[0-9]*[!#]" attribute="float" context="postfix_delimiter"/>
<RegExpr String="[-+]?[0-9]*[%&]?" attribute="dec" context="postfix_delimiter"/>
</context>
<context name="hex" attribute="invalid" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
<RegExpr String="[0-9a-fA-F]+" insensitive="true" attribute="dec" context="#pop"/>
</context>
<context name="postfix_delimiter" attribute="g" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
<RegExpr String="[\s\W]" context="#pop#pop!rvalue_operator" lookAhead="true"/>
</context>
<context name="rvalue_call" attribute="g" lineEndContext="#stay">
<DetectIdentifier attribute="func" context="#pop!rvalue_call_open_brace"/>
</context>
<context name="rvalue_call_open_brace" attribute="g" lineEndContext="#stay">
<IncludeRules context="@rvalue_call_open_brace"/>
</context>
<context name="@rvalue_call_open_brace" attribute="g" lineEndContext="#stay">
<DetectChar char="(" attribute="scope" context="rvalue_call_args"/>
</context>
<context name="rvalue_call_args" attribute="g" lineEndContext="#stay" fallthrough="true" fallthroughContext="rvalue">
<DetectSpaces/>
<DetectChar char=")" attribute="scope" context="#pop#pop!rvalue_operator"/>
<DetectChar char="," attribute="coma"/>
</context>
</contexts>
<itemDatas>
<itemData name="g" defStyleNum="dsNormal"/>
<itemData name="import" defStyleNum="dsImport"/>
<itemData name="func" defStyleNum="dsFunction"/>
<itemData name="keyword" defStyleNum="dsKeyword"/>
<itemData name="control" defStyleNum="dsControlFlow"/>
<itemData name="assign" defStyleNum="dsOperator"/>
<itemData name="binary" defStyleNum="dsOperator"/>
<itemData name="unary" defStyleNum="dsOperator"/>
<itemData name="operator" defStyleNum="dsOperator"/>
<itemData name="scope" defStyleNum="dsOperator"/>
<itemData name="coma" defStyleNum="dsOperator"/>
<itemData name="type" defStyleNum="dsDataType"/>
<itemData name="var" defStyleNum="dsVariable"/>
<itemData name="comment" defStyleNum="dsComment"/>
<itemData name="print" defStyleNum="dsBuiltIn"/>
<itemData name="builtin_func" defStyleNum="dsBuiltIn"/>
<itemData name="library_func" defStyleNum="dsBuiltIn"/>
<itemData name="dec" defStyleNum="dsDecVal"/>
<itemData name="float" defStyleNum="dsFloat"/>
<itemData name="string" defStyleNum="dsString"/>
<itemData name="constant" defStyleNum="dsConstant"/>
<itemData name="macro" defStyleNum="dsPreprocessor"/>
<itemData name="label" defStyleNum="dsSpecialChar"/>
<itemData name="line_break" defStyleNum="dsSpecialChar"/>
<itemData name="m" defStyleNum="dsExtension"/>
<itemData name="top" defStyleNum="dsExtension"/>
<itemData name="invalid" defStyleNum="dsError"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="'"/>
</comments>
<keywords casesensitive="0" additionalDeliminator="'"/>
</general>
</language>
``` | /content/code_sandbox/src/data/extra/syntax-highlighting/syntax/brightscript.xml | xml | 2016-10-05T07:24:54 | 2024-08-16T05:03:40 | vnote | vnotex/vnote | 11,687 | 8,146 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-c++17|Win32">
<Configuration>Debug-c++17</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-c++17|x64">
<Configuration>Debug-c++17</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-static|Win32">
<Configuration>Debug-static</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-static|x64">
<Configuration>Debug-static</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugVLD|Win32">
<Configuration>DebugVLD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugVLD|x64">
<Configuration>DebugVLD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-c++17|Win32">
<Configuration>Release-c++17</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-c++17|x64">
<Configuration>Release-c++17</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-static|Win32">
<Configuration>Release-static</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-static|x64">
<Configuration>Release-static</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="vc14-Debug|Win32">
<Configuration>vc14-Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="vc14-Debug|x64">
<Configuration>vc14-Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="vc14-Release|Win32">
<Configuration>vc14-Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="vc14-Release|x64">
<Configuration>vc14-Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\test\unit\list\test_kv_lazy_rcu.h" />
<ClInclude Include="..\..\..\test\unit\list\test_kv_list.h" />
<ClInclude Include="..\..\..\test\unit\list\test_kv_list_hp.h" />
<ClInclude Include="..\..\..\test\unit\list\test_kv_list_nogc.h" />
<ClInclude Include="..\..\..\test\unit\list\test_kv_list_rcu.h" />
<ClInclude Include="..\..\..\test\unit\list\test_lazy_rcu.h" />
<ClInclude Include="..\..\..\test\unit\list\test_list.h" />
<ClInclude Include="..\..\..\test\unit\list\test_list_hp.h" />
<ClInclude Include="..\..\..\test\unit\list\test_list_nogc.h" />
<ClInclude Include="..\..\..\test\unit\list\test_list_rcu.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_dhp.cpp" />
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_hp.cpp" />
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_nogc.cpp" />
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_rcu_gpb.cpp" />
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_rcu_gpi.cpp" />
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_rcu_gpt.cpp">
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-static|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-static|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-c++17|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Release|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-c++17|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Release|x64'">4503</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="..\..\..\test\unit\list\kv_lazy_rcu_shb.cpp" />
<ClCompile Include="..\..\..\test\unit\list\lazy_dhp.cpp" />
<ClCompile Include="..\..\..\test\unit\list\lazy_hp.cpp" />
<ClCompile Include="..\..\..\test\unit\list\lazy_nogc.cpp" />
<ClCompile Include="..\..\..\test\unit\list\lazy_rcu_gpb.cpp" />
<ClCompile Include="..\..\..\test\unit\list\lazy_rcu_gpi.cpp" />
<ClCompile Include="..\..\..\test\unit\list\lazy_rcu_gpt.cpp">
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-static|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-static|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-c++17|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Release|Win32'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release-c++17|x64'">4503</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='vc14-Release|x64'">4503</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="..\..\..\test\unit\list\lazy_rcu_shb.cpp" />
<ClCompile Include="..\..\..\test\unit\main.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3C43C24C-45B9-4388-BBE2-D6521A4BB1D4}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>list</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-c++17|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-c++17|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|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-c++17|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)'=='vc14-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)'=='DebugVLD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|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-c++17|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)'=='vc14-Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'" 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-c++17|x64'" 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)'=='vc14-Debug|x64'" 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)'=='DebugVLD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'" 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-c++17|x64'" 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)'=='vc14-Release|x64'" 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'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
<TargetName>$(ProjectName)_d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-c++17|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-c++17|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\..\bin\vc.$(PlatformToolset)\$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)..\..\..\obj\vc.$(PlatformToolset)\$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget)-dbg.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CDS_BUILD_STATIC_LIB;_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget)-dbg.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget)-dbg.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget)-dbg.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-static|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CDS_BUILD_STATIC_LIB;_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget)-dbg.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-c++17|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget)-dbg.lib;gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugVLD|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget).lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>CDS_BUILD_STATIC_LIB;_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget).lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-c++17|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget).lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB32);$(GTEST_ROOT)/lib/x86;$(BOOST_PATH)/stage32/lib;$(BOOST_PATH)/stage/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget).lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-static|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>CDS_BUILD_STATIC_LIB;_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget).lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-c++17|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>libcds-$(PlatformTarget).lib;gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc14-Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_ENABLE_ATOMIC_ALIGNMENT_FIX;_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..\..\..;$(GTEST_ROOT)/include;$(SolutionDir)..\..\..\test\include;$(BOOST_PATH);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj /Zc:inline /permissive- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(GTEST_LIB64);$(GTEST_ROOT)/lib/x64;$(BOOST_PATH)/stage64/lib;$(BOOST_PATH)/bin;%(AdditionalLibraryDirectories);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>gtest.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/extern/libcds/projects/Win/vc141/gtest-list-lazy.vcxproj | xml | 2016-03-16T06:10:37 | 2024-08-16T14:13:51 | firebird | FirebirdSQL/firebird | 1,223 | 12,831 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
published by the Free Software Foundation. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the LICENSE file that accompanied this code.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
<project basedir="." default="netbeans" name="profiler.api">
<description>Builds, tests, and runs the project org.graalvm.visualvm.lib.profiler.api</description>
<import file="nbproject/build-impl.xml"/>
</project>
``` | /content/code_sandbox/visualvm/libs.profiler/profiler.api/build.xml | xml | 2016-09-12T14:44:30 | 2024-08-16T14:41:50 | visualvm | oracle/visualvm | 2,821 | 265 |
```xml
// Libraries
import React, {PureComponent, CSSProperties} from 'react'
import classnames from 'classnames'
import _ from 'lodash'
import memoizeOne from 'memoize-one'
// Components
import InvalidData from 'src/shared/components/InvalidData'
// Utils
import {manager} from 'src/worker/JobManager'
import {
SMALL_CELL_HEIGHT,
getDataUUID,
hasDataPropsChanged,
isFluxDataEqual,
isInluxQLDataEqual,
} from 'src/shared/graphs/helpers'
import getLastValues from 'src/shared/parsing/lastValues'
import {ErrorHandling} from 'src/shared/decorators/errors'
import {isTruncatedNumber, toFixed} from 'src/shared/utils/decimalPlaces'
// Constants
import {DYGRAPH_CONTAINER_V_MARGIN} from 'src/shared/constants'
import {generateThresholdsListHexs} from 'src/shared/constants/colorOperations'
import {DataType} from 'src/shared/constants'
// types
import {ColorString} from 'src/types/colors'
import {CellType, DecimalPlaces} from 'src/types/dashboards'
import {TimeSeriesServerResponse} from 'src/types/series'
import {FluxTable} from 'src/types'
interface Props {
decimalPlaces: DecimalPlaces
cellHeight: number
colors: ColorString[]
prefix?: string
suffix?: string
lineGraph: boolean
staticLegendHeight?: number
data: TimeSeriesServerResponse[] | FluxTable[]
dataType: DataType
onUpdateCellColors?: (bgColor: string, textColor: string) => void
onUpdateVisType?: (cell: CellType) => Promise<void>
fluxTablesToSingleStat?: typeof manager.fluxTablesToSingleStat
}
interface State {
lastValues?: {
values: string[] | number[]
series: string[]
}
isValidData: boolean
}
const NOOP = () => {}
class SingleStat extends PureComponent<Props, State> {
public static defaultProps: Partial<Props> = {
prefix: '',
suffix: '',
onUpdateCellColors: NOOP,
fluxTablesToSingleStat: manager.fluxTablesToSingleStat,
}
private isComponentMounted: boolean
private lastUUID: string
private memoizedTimeSeriesToSingleStat = memoizeOne(
getLastValues,
isInluxQLDataEqual
)
private memoizedFluxTablesToSingleStat: typeof manager.fluxTablesToSingleStat
constructor(props: Props) {
super(props)
this.memoizedFluxTablesToSingleStat = memoizeOne(
props.fluxTablesToSingleStat,
isFluxDataEqual
)
this.state = {isValidData: true}
}
public async componentDidMount() {
this.isComponentMounted = true
this.lastUUID = getDataUUID(this.props.data, this.props.dataType)
await this.dataToLastValues()
}
public async componentDidUpdate(prevProps: Props) {
this.lastUUID = getDataUUID(this.props.data, this.props.dataType)
const isDataChanged = hasDataPropsChanged(prevProps, this.props)
if (isDataChanged) {
await this.dataToLastValues()
}
}
public componentWillUnmount() {
this.isComponentMounted = false
}
public render() {
if (!this.state.isValidData) {
return <InvalidData />
}
if (!this.state.lastValues) {
return <h3 className="graph-spinner" />
}
return (
<div className="single-stat" style={this.containerStyle}>
{this.resizerBox}
</div>
)
}
private get renderShadow(): JSX.Element {
const {lineGraph} = this.props
return lineGraph && <div className="single-stat--shadow" />
}
private get prefixSuffixValue(): string {
const {prefix, suffix} = this.props
return `${prefix}${this.roundedLastValue}${suffix}`
}
private get lastValue(): number {
const {lastValues} = this.state
if (lastValues) {
const {values, series} = lastValues
const firstAlphabeticalSeriesName = _.sortBy(series)[0]
const firstAlphabeticalIndex = _.indexOf(
series,
firstAlphabeticalSeriesName
)
return Number(values[firstAlphabeticalIndex])
}
}
private get roundedLastValue(): string {
const {decimalPlaces} = this.props
if (this.lastValue === null || this.lastValue === undefined) {
return `${0}`
}
let roundedValue = `${this.lastValue}`
if (isTruncatedNumber(this.lastValue, decimalPlaces)) {
roundedValue = toFixed(this.lastValue, decimalPlaces)
}
return this.formatToLocale(+roundedValue)
}
private formatToLocale(n: number): string {
const maximumFractionDigits = 20
return n.toLocaleString(undefined, {maximumFractionDigits})
}
private get containerStyle(): CSSProperties {
const {staticLegendHeight} = this.props
const height = `calc(100% - ${
staticLegendHeight + DYGRAPH_CONTAINER_V_MARGIN * 2
}px)`
const {backgroundColor} = this.coloration
if (staticLegendHeight) {
return {
backgroundColor,
height,
}
}
return {
backgroundColor,
}
}
private get coloration(): CSSProperties {
const {colors, lineGraph, onUpdateCellColors} = this.props
const {lastValues} = this.state
let lastValue: number = 0
if (lastValues) {
const {values, series} = lastValues
const firstAlphabeticalSeriesName = _.sortBy(series)[0]
const firstAlphabeticalIndex = _.indexOf(
series,
firstAlphabeticalSeriesName
)
lastValue = Number(values[firstAlphabeticalIndex])
}
const {bgColor, textColor} = generateThresholdsListHexs({
colors,
lastValue,
cellType: lineGraph ? CellType.LinePlusSingleStat : CellType.SingleStat,
})
onUpdateCellColors(bgColor, textColor)
return {
backgroundColor: bgColor,
color: textColor,
}
}
private get resizerBox(): JSX.Element {
const {lineGraph, cellHeight} = this.props
const {color} = this.coloration
if (lineGraph) {
const className = classnames('single-stat--value', {
small: cellHeight <= SMALL_CELL_HEIGHT,
})
return (
<span className={className} style={{color}}>
{this.prefixSuffixValue}
{this.renderShadow}
</span>
)
}
const viewBox = `0 0 ${this.prefixSuffixValue.length * 55} 100`
return (
<div className="single-stat--resizer">
<svg
width="100%"
height="100%"
viewBox={viewBox}
style={{display: 'block'}}
>
<text
className="single-stat--text"
fontSize="87"
y="59%"
x="50%"
dominantBaseline="middle"
textAnchor="middle"
style={{fill: color}}
>
{this.prefixSuffixValue}
</text>
</svg>
</div>
)
}
private async dataToLastValues() {
const {data, dataType} = this.props
let lastValues
let isValidData = true
try {
if (dataType === DataType.flux) {
lastValues = await this.memoizedFluxTablesToSingleStat(
data as FluxTable[]
)
} else if (dataType === DataType.influxQL) {
lastValues = this.memoizedTimeSeriesToSingleStat(
data as TimeSeriesServerResponse[]
)
}
if (
!this.isComponentMounted ||
this.lastUUID !== getDataUUID(data, dataType)
) {
return
}
} catch (err) {
isValidData = false
}
this.setState({lastValues, isValidData})
}
}
export default ErrorHandling(SingleStat)
``` | /content/code_sandbox/ui/src/shared/components/SingleStat.tsx | xml | 2016-08-24T23:28:56 | 2024-08-13T19:50:03 | chronograf | influxdata/chronograf | 1,494 | 1,743 |
```xml
<vector android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="path_to_url">
<path android:fillColor="#FFFFFF" android:pathData="M1,18v3h3c0,-1.66 -1.34,-3 -3,-3zM1,14v2c2.76,0 5,2.24 5,5h2c0,-3.87 -3.13,-7 -7,-7zM19,7L5,7v1.63c3.96,1.28 7.09,4.41 8.37,8.37L19,17L19,7zM1,10v2c4.97,0 9,4.03 9,9h2c0,-6.08 -4.93,-11 -11,-11zM21,3L3,3c-1.1,0 -2,0.9 -2,2v3h2L3,5h18v14h-7v2h7c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2z"/>
</vector>
``` | /content/code_sandbox/core-sample-app/src/main/res/drawable/ic_cast_connected_24dp.xml | xml | 2016-08-29T12:04:03 | 2024-08-16T13:03:46 | android-youtube-player | PierfrancescoSoffritti/android-youtube-player | 3,391 | 291 |
```xml
import React from 'react';
/**
* KML specific props.
*/
export type KMLProps = {
/**
* The value of require('path/to/file.kml') for the .kml asset
*/
filePath: string;
};
/**
* Internal JSON object for representing marker KMLs in Expo Maps library.
*
* See {@link KMLProps} for more detail.
*/
export type KMLObject = {
type: 'kml';
} & KMLProps;
/**
* KML component of Expo Maps library.
*
* Displays data provided in .kml file.
* This component should be ExpoMap component child to work properly.
*
* See {@link KMLProps} for more details.
*/
export declare class KML extends React.Component<KMLProps> {
render(): null;
}
//# sourceMappingURL=KML.d.ts.map
``` | /content/code_sandbox/packages/expo-maps/build/KML.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 177 |
```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 objectValues = require( './index' );
// TESTS //
// The function returns an array of values...
{
objectValues( { 'beep': 'boop', 'foo': 'bar' } ); // $ExpectType string[]
objectValues( { 'beep': 'boop', 'foo': 3.14 } ); // $ExpectType (string | number)[]
objectValues( { 'beep': 'boop', 'foo': true } ); // $ExpectType (string | boolean)[]
}
// The compiler throws an error if the function is provided an incorrect number of arguments...
{
objectValues(); // $ExpectError
objectValues( [], 2 ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/utils/values/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 199 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: node_test\decoration_loopuntil_ut_0.xml-->
<behavior name="node_test/decoration_loopuntil_ut_0" agenttype="AgentNodeTest" version="5">
<node class="Sequence" id="0">
<node class="Action" id="4">
<property Method="Self.AgentNodeTest::setTestVar_0(0)" />
<property ResultOption="BT_SUCCESS" />
</node>
<node class="DecoratorLoopUntil" id="1">
<property Count="const int -1" />
<property DecorateWhenChildEnds="true" />
<property Until="true" />
<node class="DecoratorLoop" id="2">
<property Count="const int 100" />
<property DecorateWhenChildEnds="true" />
<property DoneWithinFrame="false" />
<node class="True" id="5" />
</node>
</node>
<node class="Action" id="3">
<property Method="Self.AgentNodeTest::setTestVar_0(1)" />
<property ResultOption="BT_SUCCESS" />
</node>
</node>
</behavior>
``` | /content/code_sandbox/integration/unity/Assets/Resources/behaviac/exported/node_test/decoration_loopuntil_ut_0.xml | xml | 2016-11-21T05:08:08 | 2024-08-16T07:18:30 | behaviac | Tencent/behaviac | 2,831 | 285 |
```xml
import {
Container,
Greeting,
NavButton,
RestartButton,
SetupList,
SubContent,
Text
} from './styles';
import { IFeature, IRoleValue } from 'modules/robot/types';
import CollapseContent from 'modules/common/components/CollapseContent';
import { Description } from '@erxes/ui-settings/src/styles';
import { IUser } from 'modules/auth/types';
import Icon from 'modules/common/components/Icon';
import ProgressBar from 'modules/common/components/ProgressBar';
import { ROLE_SETUP } from 'modules/robot/constants';
import React from 'react';
import SetupDetail from '../containers/SetupDetail';
import { __ } from 'modules/common/utils';
import { calculatePercentage } from '@erxes/ui/src/utils/core';
import { getCurrentUserName } from 'modules/robot/utils';
type Props = {
currentRoute?: string;
changeRoute: (route: string) => void;
roleValue: IRoleValue;
answerOf: IRoleValue;
currentUser: IUser;
showContent: boolean;
toggleContent: (isShow: boolean) => void;
restartRole: (roleValue: IRoleValue, answer: IRoleValue) => void;
availableFeatures: IFeature[];
};
type State = {
selectedOption: IFeature;
showComplete: boolean;
collapseKey: string;
};
class Setup extends React.Component<Props, State> {
constructor(props) {
super(props);
this.state = {
selectedOption: {} as IFeature,
showComplete: false,
collapseKey: ''
};
}
headerGreeting() {
const { currentUser } = this.props;
const percentage = this.getPercentage();
let text = "Let's set up your workplace for success";
if (percentage === 100) {
text = 'Congratulations! You have finished setting up';
}
return (
<Greeting>
<b>
{__('Hello')}! {getCurrentUserName(currentUser)}
<span role="img" aria-label="Wave">
</span>
</b>
<p>{__(text)}.</p>
</Greeting>
);
}
withHeader = (content: React.ReactNode) => {
const { changeRoute, currentRoute, toggleContent } = this.props;
const onBack = () => {
changeRoute('setupList');
};
const onHide = () => {
toggleContent(false);
};
return (
<>
{currentRoute === 'setupDetail' && (
<NavButton onClick={onBack}>
<Icon icon="arrow-left" size={24} />
</NavButton>
)}
<NavButton id="robot-feature-close" onClick={onHide} right={true}>
<Icon icon="times" size={17} />
</NavButton>
{content}
</>
);
};
renderProgress = () => {
const percentage = this.getPercentage();
let text = __('keep going!');
if (percentage < 75 && percentage > 50) {
text = __("you're halfway through, keep going!");
}
if (percentage > 75 && percentage < 100) {
text = __('almost done, just a little more!');
}
if (percentage === 100) {
text = __('awesome!');
}
return (
<div>
<ProgressBar percentage={percentage} color="#3B85F4" height="8px" />
<Description>
{percentage}
{__('% done -')} {text}
</Description>
</div>
);
};
renderFeature(feature: IFeature) {
const { changeRoute } = this.props;
this.setState({ selectedOption: feature }, () => {
changeRoute('setupDetail');
});
}
checkCondition(title: string) {
const { availableFeatures } = this.props;
availableFeatures.map(availabeFeature => {
if (availabeFeature.name === title) {
this.renderFeature(availabeFeature);
}
return null;
});
}
renderSetup() {
const { roleValue } = this.props;
const onRoleClick = (title: string, gkey: string) => {
this.setState(
{
collapseKey: gkey
},
() => {
this.checkCondition(title);
}
);
};
return (
<SetupList>
{ROLE_SETUP.map(group => (
<CollapseContent
key={group.key}
id={group.key}
title={__(group.title)}
open={group.key === this.state.collapseKey ? true : false}
>
{group.content.map((content, index) => {
if (content.types.includes(roleValue.value)) {
return (
<Text
key={index}
onClick={onRoleClick.bind(this, content.title, group.key)}
>
<h6>{__(content.name)}</h6>
<p>
{content.steps} {__('steps')}
</p>
</Text>
);
}
return null;
})}
</CollapseContent>
))}
</SetupList>
);
}
drawContent() {
const { roleValue, restartRole, answerOf } = this.props;
return (
<>
{this.headerGreeting()}
{this.renderProgress()}
<SubContent>
<h5>
{__(roleValue.label)} {__('Setup')}
</h5>
</SubContent>
{this.renderSetup()}
<RestartButton onClick={() => restartRole(roleValue, answerOf)}>
{__('Reselect role')}
</RestartButton>
</>
);
}
getPercentage() {
const { availableFeatures } = this.props;
const completedCount = availableFeatures.filter(
feature => feature.isComplete
).length;
return calculatePercentage(
availableFeatures.length + 1,
completedCount + 1
);
}
renderContent() {
const { selectedOption } = this.state;
const { currentRoute } = this.props;
if (currentRoute === 'setupDetail') {
return this.withHeader(
selectedOption && <SetupDetail feature={selectedOption} />
);
}
if (currentRoute === 'setupList') {
return this.withHeader(this.drawContent());
}
return null;
}
render() {
return <Container>{this.renderContent()}</Container>;
}
}
export default Setup;
``` | /content/code_sandbox/packages/core-ui/src/modules/robot/components/Setup.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 1,372 |
```xml
import { bind } from 'decko';
import * as React from 'react';
import { connect } from 'react-redux';
import {
selectIsComparedEntity,
selectEntityForComparing,
unselectEntityForComparing,
} from '../../../store';
import { IApplicationState, IConnectedReduxProps } from 'setup/store/store';
import CompareClickActionView from 'shared/view/domain/CompareEntities/CompareClickAction/CompareClickAction';
interface ILocalProps {
enitityId: string;
containerId: string;
onHover?(): void;
onUnhover?(): void;
}
const mapStateToProps = (
state: IApplicationState,
localProps: ILocalProps
) => {
return {
isSelected: selectIsComparedEntity(
state,
localProps.containerId,
localProps.enitityId
),
};
};
type AllProps = ILocalProps & ReturnType<typeof mapStateToProps> & IConnectedReduxProps;
class CompareClickAction extends React.PureComponent<AllProps> {
public render() {
const {
isSelected,
onHover,
onUnhover,
} = this.props;
return (
<CompareClickActionView
isSelected={isSelected}
isDisabled={false}
onChange={this.onChange}
onHover={onHover}
onUnhover={onUnhover}
/>
);
}
@bind
private onChange(value: boolean) {
const { containerId: projectId, enitityId: modelId } = this.props;
if (value) {
this.props.dispatch(
selectEntityForComparing({ projectId, modelRecordId: modelId })
);
} else {
this.props.dispatch(
unselectEntityForComparing({ projectId, modelRecordId: modelId })
);
}
}
}
export default connect(mapStateToProps)(CompareClickAction);
``` | /content/code_sandbox/webapp/client/src/features/compareModels/view/CompareEntities/CompareClickAction/CompareClickAction.tsx | xml | 2016-10-19T01:07:26 | 2024-08-14T03:53:55 | modeldb | VertaAI/modeldb | 1,689 | 396 |
```xml
/*
* path_to_url
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
*/
import {
canfulfill,
interfaces
} from 'ask-sdk-model';
import { expect } from 'chai';
import { ImageHelper } from '../../lib/response/ImageHelper';
import { ResponseBuilder } from '../../lib/response/ResponseBuilder';
import { ResponseFactory } from '../../lib/response/ResponseFactory';
import { RichTextContentHelper } from '../../lib/response/RichTextContentHelper';
import { JsonProvider } from '../mocks/JsonProvider';
import PlayBehavior = interfaces.audioplayer.PlayBehavior;
import ClearBehavior = interfaces.audioplayer.ClearBehavior;
import Image = interfaces.display.Image;
import BodyTemplate1 = interfaces.display.BodyTemplate1;
import CanFulfillIntent = canfulfill.CanFulfillIntent;
describe('ResponseFactory', () => {
it('should build response with Ssml outputSpeech', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const speechOutput = 'HelloWorld!';
const expectResponse = {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
};
expect(responseBuilder.speak(speechOutput).getResponse()).to.deep.equal(expectResponse);
});
it('should build response with Ssml outputSpeech and play behavior', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const speechOutput = 'HelloWorld!';
const expectResponse = {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
playBehavior : 'ENQUEUE',
},
};
expect(responseBuilder.speak(speechOutput, 'ENQUEUE').getResponse()).to.deep.equal(expectResponse);
});
it('should trim the outputSpeech if it already has the SSML flag', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const speechOutput = '<speak> HelloWorld! </speak>';
const speechOutput2 = ' <speak> HelloWorld! </speak> ';
const speechOutput3 = '<speak>HelloWorld!</speak>';
const expectResponse = {
outputSpeech: {
ssml: '<speak>' + 'HelloWorld!' + '</speak>',
type: 'SSML',
},
};
expect(responseBuilder.speak(speechOutput).getResponse()).to.deep.equal(expectResponse);
expect(responseBuilder.speak(speechOutput2).getResponse()).to.deep.equal(expectResponse);
expect(responseBuilder.speak(speechOutput3).getResponse()).to.deep.equal(expectResponse);
});
it('should return empty string for trimOutputSpeech function if speechOutput is null or undefined or empty string', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
outputSpeech: {
ssml: '<speak>' + '</speak>',
type: 'SSML',
},
};
expect(responseBuilder.speak(null).getResponse()).to.deep.equal(expectResponse);
});
it('should build response with Ssml reprompt', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const speechOutput = 'HelloWorld!';
const expectResponse = {
reprompt : {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
},
shouldEndSession : false,
};
expect(responseBuilder.reprompt(speechOutput).getResponse()).to.deep.equal(expectResponse);
});
it('should build response with Ssml reprompt with play behavior', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const speechOutput = 'HelloWorld!';
const expectResponse = {
reprompt : {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
playBehavior : 'ENQUEUE',
},
},
shouldEndSession : false,
};
expect(responseBuilder.reprompt(speechOutput, 'ENQUEUE').getResponse()).to.deep.equal(expectResponse);
});
it('should build response with simple card', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const cardTitle = 'Card Title';
const cardContent = 'Card Content';
const expectResponse = {
card : {
content : cardContent,
title : cardTitle,
type : 'Simple',
},
};
expect(responseBuilder.withSimpleCard(cardTitle, cardContent).getResponse()).to.deep.equal(expectResponse);
});
it('should build response with standard card', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const cardTitle = 'Card Title';
const cardContent = 'Card Content';
const largeImageUrl = 'path_to_url
const smallImageUrl = 'path_to_url
const expectResponse = {
card : {
image: {
largeImageUrl: 'path_to_url
smallImageUrl: 'path_to_url
},
text: cardContent,
title : cardTitle,
type : 'Standard',
},
};
const expectResponse2 = {
card : {
image: {
smallImageUrl: 'path_to_url
},
text: cardContent,
title : cardTitle,
type : 'Standard',
},
};
const expectResponse3 = {
card : {
image: {
largeImageUrl: 'path_to_url
},
text: cardContent,
title : cardTitle,
type : 'Standard',
},
};
const expectResponse4 = {
card : {
text: cardContent,
title : cardTitle,
type : 'Standard',
},
};
expect(responseBuilder.withStandardCard(cardTitle, cardContent, smallImageUrl, largeImageUrl).getResponse()).to.deep.equals(expectResponse);
expect(responseBuilder.withStandardCard(cardTitle, cardContent, smallImageUrl).getResponse()).to.deep.equals(expectResponse2);
expect(responseBuilder.withStandardCard(cardTitle, cardContent, undefined, largeImageUrl).getResponse()).to.deep.equals(expectResponse3);
expect(responseBuilder.withStandardCard(cardTitle, cardContent).getResponse()).to.deep.equals(expectResponse4);
});
it('should build response with link account card', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
card : {
type : 'LinkAccount',
},
};
expect(responseBuilder.withLinkAccountCard().getResponse()).to.deep.equals(expectResponse);
});
it('should build response with permission consent card', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const permissionArray = ['permission1', 'permission2'];
const expectResponse = {
card : {
permissions : permissionArray,
type : 'AskForPermissionsConsent',
},
};
expect(responseBuilder.withAskForPermissionsConsentCard(permissionArray).getResponse()).to.deep.equals(expectResponse);
});
it('should build response with Dialog.Delegate directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
directives : [
{
type: 'Dialog.Delegate',
updatedIntent: {
confirmationStatus: 'NONE',
name: 'intentName',
slots: {
slot1: {
confirmationStatus: 'NONE',
name: 'slot1',
value: 'value1',
},
},
},
},
{
type: 'Dialog.Delegate',
},
],
};
const slot = JsonProvider.slot();
slot.name = 'slot1';
slot.value = 'value1';
slot.confirmationStatus = 'NONE';
delete slot.resolutions;
const intent = JsonProvider.intent();
intent.name = 'intentName';
intent.slots = {
slot1 : slot,
};
intent.confirmationStatus = 'NONE';
expect(responseBuilder.addDelegateDirective(intent).addDelegateDirective().getResponse()).to.deep.equals(expectResponse);
});
it('should build response with Dialog.ElicitSlot Directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
directives : [
{
slotToElicit : 'slotName',
type : 'Dialog.ElicitSlot',
updatedIntent : {
confirmationStatus: 'NONE',
name: 'intentName',
slots: {
slot1: {
confirmationStatus: 'NONE',
name: 'slot1',
value: 'value1',
},
},
},
},
{
slotToElicit : 'slotName',
type : 'Dialog.ElicitSlot',
},
],
};
const slot = JsonProvider.slot();
slot.name = 'slot1';
slot.value = 'value1';
slot.confirmationStatus = 'NONE';
delete slot.resolutions;
const intent = JsonProvider.intent();
intent.name = 'intentName';
intent.slots = {
slot1 : slot,
};
intent.confirmationStatus = 'NONE';
expect(responseBuilder.addElicitSlotDirective('slotName', intent).addElicitSlotDirective('slotName').getResponse()).to.deep.equals(expectResponse);
});
it('should build response with Dialog.ConfirmSlot directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
directives : [
{
slotToConfirm : 'slotName',
type : 'Dialog.ConfirmSlot',
updatedIntent : {
confirmationStatus: 'NONE',
name: 'intentName',
slots: {
slot1: {
confirmationStatus: 'NONE',
name: 'slot1',
value: 'value1',
},
},
},
},
{
slotToConfirm : 'slotName',
type : 'Dialog.ConfirmSlot',
},
],
};
const slot = JsonProvider.slot();
slot.name = 'slot1';
slot.value = 'value1';
slot.confirmationStatus = 'NONE';
delete slot.resolutions;
const intent = JsonProvider.intent();
intent.name = 'intentName';
intent.slots = {
slot1 : slot,
};
intent.confirmationStatus = 'NONE';
expect(responseBuilder.addConfirmSlotDirective('slotName', intent).addConfirmSlotDirective('slotName').getResponse()).to.deep.equals(expectResponse);
});
it('should build response with Dialog.ConfirmIntent', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
directives : [
{
type : 'Dialog.ConfirmIntent',
updatedIntent : {
confirmationStatus: 'NONE',
name: 'intentName',
slots: {
slot1: {
confirmationStatus: 'NONE',
name: 'slot1',
value: 'value1',
},
},
},
},
{
type : 'Dialog.ConfirmIntent',
},
],
};
const slot = JsonProvider.slot();
slot.name = 'slot1';
slot.value = 'value1';
slot.confirmationStatus = 'NONE';
delete slot.resolutions;
const intent = JsonProvider.intent();
intent.name = 'intentName';
intent.slots = {
slot1 : slot,
};
intent.confirmationStatus = 'NONE';
expect(responseBuilder.addConfirmIntentDirective(intent).addConfirmIntentDirective().getResponse()).to.deep.equals(expectResponse);
});
it('should build response with AudioPlayer.Play directive', () => {
const behavior : PlayBehavior = 'ENQUEUE';
const audioSource = 'path_to_url
const audioToken = 'audio token';
const offset = 10000;
const previousToken = 'previous token';
const audioItemMetadata = {
title : 'title',
subtitle : 'subtitle',
art : new ImageHelper().withDescription('description').addImageInstance('fakeUrl.com').getImage(),
backgroundImage : new ImageHelper().withDescription('description').addImageInstance('fakeUrl.com').getImage(),
};
const expectResponse1 = {
directives : [
{ audioItem : {
stream : {
expectedPreviousToken : previousToken,
offsetInMilliseconds : offset,
token : audioToken,
url : audioSource,
},
},
playBehavior : behavior,
type : 'AudioPlayer.Play'},
],
};
const expectResponse2 = {
directives : [
{ audioItem : {
stream : {
offsetInMilliseconds : offset,
token : audioToken,
url : audioSource,
},
},
playBehavior : behavior,
type : 'AudioPlayer.Play'},
],
};
const expectResponse3 = {
directives: [
{
audioItem: {
metadata: {
art: {
contentDescription: 'description',
sources: [
{
url: 'fakeUrl.com',
},
],
},
backgroundImage: {
contentDescription: 'description',
sources: [
{
url: 'fakeUrl.com',
},
],
},
subtitle: 'subtitle',
title: 'title',
},
stream: {
expectedPreviousToken: 'previous token',
offsetInMilliseconds: 10000,
token: 'audio token',
url: 'path_to_url
},
},
playBehavior: 'ENQUEUE',
type: 'AudioPlayer.Play',
},
],
};
expect(ResponseFactory.init().addAudioPlayerPlayDirective(behavior, audioSource, audioToken, offset, previousToken).getResponse()).to.deep.equals(expectResponse1);
expect(ResponseFactory.init().addAudioPlayerPlayDirective(behavior, audioSource, audioToken, offset).getResponse()).to.deep.equals(expectResponse2);
expect(ResponseFactory.init().addAudioPlayerPlayDirective(behavior, audioSource, audioToken, offset, previousToken, audioItemMetadata).getResponse()).to.deep.equals(expectResponse3);
});
it('should build response with AudioPlayer.Stop directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
directives : [
{ type : 'AudioPlayer.Stop'},
],
};
expect(responseBuilder.addAudioPlayerStopDirective().getResponse()).to.deep.equals(expectResponse);
});
it('should build response with AudioPlayer.ClearQueue directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const behavior : ClearBehavior = 'CLEAR_ALL';
const expectResponse = {
directives : [
{ clearBehavior : behavior,
type : 'AudioPlayer.ClearQueue'},
],
};
expect(responseBuilder.addAudioPlayerClearQueueDirective(behavior).getResponse())
.to.deep.equals(expectResponse);
});
it('should build response with rendering bodyTemplate1 directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const backgroundImage : Image = new ImageHelper()
.withDescription('description')
.addImageInstance('path_to_url 'MEDIUM', 100, 100)
.getImage();
const textContent = new RichTextContentHelper()
.withPrimaryText('primary text')
.withSecondaryText('secondary text')
.withTertiaryText('tertiary text')
.getTextContent();
const displayTemplate : BodyTemplate1 = {
type : 'BodyTemplate1',
token : 'token',
backButton : 'VISIBLE',
backgroundImage,
title : 'title',
textContent,
};
const expectResponse = {
directives : [
{ template : {
backButton : 'VISIBLE',
backgroundImage : {
contentDescription : 'description',
sources : [
{
heightPixels : 100,
size : 'MEDIUM',
url : 'path_to_url
widthPixels : 100,
},
],
},
textContent : {
primaryText : {
text : 'primary text',
type : 'RichText',
},
secondaryText : {
text : 'secondary text',
type : 'RichText',
},
tertiaryText : {
text : 'tertiary text',
type : 'RichText',
},
},
title : 'title',
token : 'token',
type : 'BodyTemplate1',
},
type : 'Display.RenderTemplate'},
],
};
expect(responseBuilder.addRenderTemplateDirective(displayTemplate).getResponse())
.to.deep.equals(expectResponse);
});
it('should build response with plainText hint directive', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const hintText = 'This is plainText hint';
const expectResponse = {
directives : [
{
hint : {
text : hintText,
type : 'PlainText',
},
type : 'Hint',
},
],
};
expect(responseBuilder.addHintDirective(hintText).getResponse()).to.deep.equals(expectResponse);
});
it('should build response with VideoApp.Launch directive', () => {
const videoSource = 'path_to_url
const mockSubtitle = 'Secondary Title for Sample Video';
const mockTitle = 'Title for Sample Video';
const expectResponse = {
directives : [
{
type : 'VideoApp.Launch',
videoItem : {
metadata : {
subtitle : mockSubtitle,
title : mockTitle,
},
source : videoSource,
},
},
],
};
const expectResponse2 = {
directives : [
{
type : 'VideoApp.Launch',
videoItem : {
metadata : {
subtitle : mockSubtitle,
},
source : videoSource,
},
},
],
};
const expectResponse3 = {
directives : [
{
type : 'VideoApp.Launch',
videoItem : {
metadata : {
title : mockTitle,
},
source : videoSource,
},
},
],
};
const expectResponse4 = {
directives : [
{
type : 'VideoApp.Launch',
videoItem : {
source : videoSource,
},
},
],
};
expect(ResponseFactory.init().addVideoAppLaunchDirective(videoSource, mockTitle, mockSubtitle).getResponse())
.to.deep.equals(expectResponse);
expect(ResponseFactory.init().addVideoAppLaunchDirective(videoSource, undefined, mockSubtitle).getResponse())
.to.deep.equals(expectResponse2);
expect(ResponseFactory.init().addVideoAppLaunchDirective(videoSource, mockTitle).getResponse())
.to.deep.equals(expectResponse3);
expect(ResponseFactory.init().addVideoAppLaunchDirective(videoSource).getResponse())
.to.deep.equals(expectResponse4);
});
it('should omit shouldEndSession flag if VideoApp.LaunchDirective is added', () => {
const videoSource = 'path_to_url
const mockSubtitle = 'Secondary Title for Sample Video';
const mockTitle = 'Title for Sample Video';
const expectResponse1 = {
directives : [
{
type : 'VideoApp.Launch',
videoItem : {
metadata : {
subtitle : mockSubtitle,
title : mockTitle,
},
source : videoSource,
},
},
],
};
expect(ResponseFactory.init().withShouldEndSession(true).addVideoAppLaunchDirective(videoSource, mockTitle, mockSubtitle).getResponse())
.to.deep.equals(expectResponse1);
expect(ResponseFactory.init().addVideoAppLaunchDirective(videoSource, mockTitle, mockSubtitle).withShouldEndSession(true).getResponse())
.to.deep.equals(expectResponse1);
const speechOutput = 'HelloWorld!';
const expectResponse2 = {
reprompt : {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
},
directives : [
{
type : 'VideoApp.Launch',
videoItem : {
metadata : {
subtitle : mockSubtitle,
title : mockTitle,
},
source : videoSource,
},
},
],
};
expect(ResponseFactory.init().reprompt(speechOutput).addVideoAppLaunchDirective(videoSource, mockTitle, mockSubtitle).getResponse())
.to.deep.equals(expectResponse2);
expect(ResponseFactory.init().addVideoAppLaunchDirective(videoSource, mockTitle, mockSubtitle).reprompt(speechOutput).getResponse())
.to.deep.equals(expectResponse2);
});
it('should build response with canFulfillIntent', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const canFulfillIntent : CanFulfillIntent = {
canFulfill : 'YES',
slots : {
foo : {
canUnderstand : 'MAYBE',
canFulfill : 'YES',
},
},
};
const expectedResponse = {
canFulfillIntent,
};
expect(responseBuilder.withCanFulfillIntent(canFulfillIntent).getResponse()).to.deep.equals(expectedResponse);
});
it('should build response with shouldEndSession value', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const expectResponse = {
shouldEndSession : true,
};
expect(responseBuilder.withShouldEndSession(true).getResponse()).to.deep.equals(expectResponse);
});
it('should build response with outputSpeech and card', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const speechOutput = 'HelloWorld!';
const cardTitle = 'Card Title';
const cardContent = 'Card Content';
const expectResponse = {
card : {
content : cardContent,
title : cardTitle,
type : 'Simple',
},
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
shouldEndSession : false,
};
expect(responseBuilder
.speak(speechOutput)
.withSimpleCard(cardTitle, cardContent)
.withShouldEndSession(false)
.getResponse()).to.deep.equals(expectResponse);
});
it('should build response with template directive and hint directive', () => {
const speechOutput = 'HelloWorld!';
const backgroundImage : Image = new ImageHelper()
.withDescription('description')
.addImageInstance('path_to_url 'MEDIUM', 100, 100)
.getImage()
;
const textContent = new RichTextContentHelper()
.withPrimaryText('primary text')
.withSecondaryText('secondary text')
.withTertiaryText('tertiary text')
.getTextContent();
const displayTemplate : BodyTemplate1 = {
type : 'BodyTemplate1',
token : 'token',
backButton : 'VISIBLE',
backgroundImage,
title : 'title',
textContent,
};
const hintText = 'This is plainText hint';
const expectResponse = {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
reprompt : {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
},
directives : [
{ template : {
backButton : 'VISIBLE',
backgroundImage : {
contentDescription : 'description',
sources : [
{
heightPixels : 100,
size : 'MEDIUM',
url : 'path_to_url
widthPixels : 100,
},
],
},
textContent : {
primaryText : {
text : 'primary text',
type : 'RichText',
},
secondaryText : {
text : 'secondary text',
type : 'RichText',
},
tertiaryText : {
text : 'tertiary text',
type : 'RichText',
},
},
title : 'title',
token : 'token',
type : 'BodyTemplate1',
},
type : 'Display.RenderTemplate'},
{
hint : {
text : hintText,
type : 'PlainText',
},
type : 'Hint',
},
],
shouldEndSession : false,
};
expect(ResponseFactory.init()
.addRenderTemplateDirective(displayTemplate)
.addHintDirective(hintText)
.speak(speechOutput)
.reprompt(speechOutput)
.getResponse()).to.deep.equals(expectResponse);
expect(ResponseFactory.init()
.addDirective({
type : 'Display.RenderTemplate',
template : displayTemplate,
})
.addDirective({
type : 'Hint',
hint : {
type : 'PlainText',
text : hintText,
},
})
.speak(speechOutput)
.reprompt(speechOutput)
.getResponse()).to.deep.equals(expectResponse);
});
it('should build response with apiResponse', () => {
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const apiResponse = {
test: {
title: 'this is a test apiResponse',
},
};
const expectResponse = {
apiResponse,
};
expect(responseBuilder
.withApiResponse(apiResponse)
.getResponse()).to.deep.equals(expectResponse);
});
it('should build response with outputSpeech and reprompt with directives', () => {
const speechOutput = 'Hello world!';
const aplaDocument = {};
const expectResponse = {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
reprompt : {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
directives: [
{
type: 'Alexa.Presentation.APLA.RenderDocument',
document: aplaDocument,
}
]
},
shouldEndSession : false,
};
expect(ResponseFactory.init()
.addDirectiveToReprompt({
type : 'Alexa.Presentation.APLA.RenderDocument',
document : aplaDocument,
})
.speak(speechOutput)
.reprompt(speechOutput)
.getResponse()).to.deep.equals(expectResponse);
});
it('should build reprompt with shouldEndSession set to false', () => {
const speechOutput = 'Hello world!';
const aplaDocument = {};
const expectResponse = {
outputSpeech: {
ssml: `<speak>${ speechOutput }</speak>`,
type: 'SSML',
},
reprompt : {
directives: [
{
type: 'Alexa.Presentation.APLA.RenderDocument',
document: aplaDocument,
}
]
},
shouldEndSession : false,
};
expect(ResponseFactory.init()
.withShouldEndSession(true)
.addDirectiveToReprompt({
type : 'Alexa.Presentation.APLA.RenderDocument',
document : aplaDocument,
})
.speak(speechOutput)
.getResponse()).to.deep.equals(expectResponse);
});
it('should build response with experiment trigger response', () => {
const experimentId = "experimentId";
const responseBuilder : ResponseBuilder = ResponseFactory.init();
const apiResponse = {
experimentation: [
experimentId
],
};
const expectResponse = {
apiResponse,
};
expect(responseBuilder
.withApiResponse(apiResponse)
.getResponse()).to.deep.equals(expectResponse);
});
});
``` | /content/code_sandbox/ask-sdk-core/tst/response/ResponseFactory.spec.ts | xml | 2016-06-24T06:26:05 | 2024-08-14T12:39:19 | alexa-skills-kit-sdk-for-nodejs | alexa/alexa-skills-kit-sdk-for-nodejs | 3,118 | 5,850 |
```xml
import { useCallback, useEffect, useState } from 'react';
import { ActionResult, getActionResult } from 'shared/components/Actions';
import { Databases } from 'shared/core';
import { mysqlMethods } from '../../../database-models';
import { processTableData } from '../../TableContainer.tools';
interface StatusData {
columns: any[];
rows: any[];
}
const actionResult = {
error: '',
loading: true,
value: null,
};
export const useTableStatus = (databaseType, example, tableName, database): [StatusData, ActionResult] => {
const [data, setData] = useState<StatusData>({ columns: [], rows: [] });
const [status, setStatus] = useState<ActionResult>(actionResult);
const getStatuses = useCallback(async () => {
let id;
if (databaseType === Databases.mysql) {
id = await mysqlMethods.getStatuses({ example, tableName, database });
}
const result = await getActionResult(id);
setStatus(result);
setData(processTableData(result.value));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [databaseType]);
useEffect(() => {
getStatuses();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [databaseType]);
return [data, status];
};
``` | /content/code_sandbox/pmm-app/src/pmm-qan/panel/components/Details/Table/components/Status/Status.hooks.tsx | xml | 2016-01-22T07:14:23 | 2024-08-13T13:01:59 | grafana-dashboards | percona/grafana-dashboards | 2,661 | 273 |
```xml
import * as React from 'react';
import type { Meta } from '@storybook/react';
import { Steps } from 'storywright';
import { Textarea } from '@fluentui/react-textarea';
import { withStoryWrightSteps, TestWrapperDecoratorFixedWidth } from '../../utilities';
export default {
title: 'Textarea Converged',
decorators: [
TestWrapperDecoratorFixedWidth,
story =>
withStoryWrightSteps({
story,
steps: new Steps()
.snapshot('default', { cropTo: '.testWrapper' })
.hover('textarea')
.snapshot('hover', { cropTo: '.testWrapper' })
.click('textarea')
.wait(250) // needed for bottom focus border animation
.snapshot('focused', { cropTo: '.textWrapper' })
.end(),
}),
],
} satisfies Meta<typeof Textarea>;
export const AppearanceOutlineDefault = () => <Textarea placeholder="Placeholder" />;
AppearanceOutlineDefault.storyName = 'Appearance: outline (default)';
export const AppearanceFilledDarker = () => <Textarea appearance="filled-darker" placeholder="Placeholder" />;
AppearanceFilledDarker.storyName = 'Appearance: filled-darker';
export const AppearanceFilledLighter = () => (
<div style={{ background: '#f5f5f5', padding: '10px' }}>
<Textarea appearance="filled-lighter" placeholder="Placeholder" />
</div>
);
AppearanceFilledLighter.storyName = 'Appearance: filled-lighter';
export const InvalidOutline = () => <Textarea aria-invalid placeholder="Placeholder" />;
InvalidOutline.storyName = 'Invalid: outline';
export const InvalidFilledDarker = () => <Textarea aria-invalid appearance="filled-darker" placeholder="Placeholder" />;
InvalidFilledDarker.storyName = 'Invalid: filled-darker';
export const InvalidFilledLighter = () => (
<div style={{ background: '#f5f5f5', padding: '10px' }}>
<Textarea aria-invalid appearance="filled-lighter" placeholder="Placeholder" />
</div>
);
InvalidFilledLighter.storyName = 'Invalid: filled-lighter';
export const WithValue = () => <Textarea defaultValue="Value" />;
WithValue.storyName = 'With value';
``` | /content/code_sandbox/apps/vr-tests-react-components/src/stories/Textarea/TextareaInteractions.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 471 |
```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>
<dimen name="mtrl_badge_size">8dp</dimen>
<dimen name="mtrl_badge_with_text_size">16dp</dimen>
<!-- Leading and trailing text padding when a badge is displaying text that is too long to fit in
a circular badge, i.e. if badge number is greater than 9. -->
<dimen name="mtrl_badge_long_text_horizontal_padding">4dp</dimen>
<!-- Horizontally align start/end of text badge 6dp from the end/start edge of anchor-->
<dimen name="mtrl_badge_text_horizontal_edge_offset">6dp</dimen>
<!-- Horizontally align start/end of icon only badge 4dp from the end/start edge of anchor-->
<dimen name="mtrl_badge_horizontal_edge_offset">4dp</dimen>
<dimen name="mtrl_badge_text_size">10sp</dimen>
<dimen name="mtrl_badge_toolbar_action_menu_item_horizontal_offset">12dp</dimen>
<dimen name="mtrl_badge_toolbar_action_menu_item_vertical_offset">12dp</dimen>
<!-- M3 Dimens -->
<dimen name="m3_badge_size">@dimen/m3_comp_badge_size</dimen>
<dimen name="m3_badge_with_text_size">@dimen/m3_comp_badge_large_size</dimen>
<dimen name="m3_badge_vertical_offset">1.5dp</dimen>
<dimen name="m3_badge_horizontal_offset">1.5dp</dimen>
<dimen name="m3_badge_with_text_vertical_offset">4dp</dimen>
<dimen name="m3_badge_with_text_horizontal_offset">3dp</dimen>
<dimen name="m3_badge_offset">6dp</dimen>
<dimen name="m3_badge_with_text_offset">12dp</dimen>
<dimen name="m3_large_text_vertical_offset_adjustment">4dp</dimen>
<dimen name="m3_badge_with_text_vertical_padding">2dp</dimen>
<dimen name="m3_nav_badge_with_text_vertical_offset">14dp</dimen>
</resources>
``` | /content/code_sandbox/lib/java/com/google/android/material/badge/res/values/dimens.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 561 |
```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>
<declare-styleable name="ElasticDragDismissFrameLayout">
<attr name="dragDismissDistance" format="dimension" />
<attr name="dragDismissFraction" format="float" />
<attr name="dragDismissScale" format="float" />
<attr name="dragElasticity" format="float" />
</declare-styleable>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/attrs_elastic_drag_dismiss_frame_layout.xml | xml | 2016-08-20T00:57:24 | 2024-08-09T02:01:01 | LookLook | xinghongfei/LookLook | 2,211 | 135 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:id="@+id/album_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
android:foreground="@drawable/ripple"
app:cardElevation="@dimen/cardview_default_elevation">
<LinearLayout
android:id="@+id/cont"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<org.horaapps.leafpic.views.SquareRelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/header_album_card">
<org.horaapps.liz.ui.ThemedIcon
android:id="@+id/selected_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:elevation="@dimen/icon_elevation"
android:visibility="gone"
app:iiv_color="@color/md_white_1000"
app:iiv_icon="gmd-check"
tools:targetApi="lollipop" />
<org.horaapps.leafpic.views.SquareImageView
android:id="@+id/album_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/ll_album_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:orientation="vertical"
android:paddingLeft="@dimen/sub_medium_spacing"
android:paddingRight="@dimen/sub_medium_spacing"
android:paddingBottom="@dimen/small_spacing"
android:paddingTop="@dimen/small_spacing">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_media_count"
android:orientation="horizontal"
android:layout_marginRight="@dimen/sub_small_spacing"
android:gravity="center">
<TextView
android:id="@+id/album_media_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:paddingEnd="4dp"
android:textColor="@android:color/white"
android:textSize="@dimen/medium_text" />
<TextView
android:id="@+id/album_media_label"
android:layout_width="match_parent"
android:text="@string/media"
android:layout_height="wrap_content"
android:maxLines="1"
android:visibility="gone"
android:textColor="@android:color/white"
android:textSize="@dimen/sub_medium_text" />
</LinearLayout>
<TextView
android:id="@+id/album_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@android:color/white"
android:textSize="@dimen/medium_text"/>
</LinearLayout>
<TextView
android:id="@+id/album_path"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/medium_small_text"
android:textColor="@color/md_grey_400"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:maxLines="1"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
android:visibility="gone"/>
</LinearLayout>
</org.horaapps.leafpic.views.SquareRelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
``` | /content/code_sandbox/app/src/main/res/layout/card_album_compact.xml | xml | 2016-01-07T17:24:12 | 2024-08-16T06:55:33 | LeafPic | UnevenSoftware/LeafPic | 3,258 | 920 |
```xml
import { isAbsolute, relative } from 'path';
import { isValidPath } from '@graphql-tools/utils';
import { normalizeInstanceOrArray, Types } from '@graphql-codegen/plugin-helpers';
import isGlob from 'is-glob';
import mm from 'micromatch';
import { CodegenContext } from '../config.js';
type NegatedPattern = `!${string}`;
/**
* Flatten a list of pattern sets to be a list of only the affirmative patterns
* are contained in all of them.
*
* This can be used, for example, to find the "longest common prefix directory"
* by examining `mm.scan(pattern).base` for each `pattern`.
*/
export const allAffirmativePatternsFromPatternSets = (patternSets: PatternSet[]) => {
return patternSets.flatMap(patternSet => [
...patternSet.watch.affirmative,
...patternSet.documents.affirmative,
...patternSet.schemas.affirmative,
]);
};
/**
* Create a rebuild trigger that follows the algorithm described here:
* path_to_url#issuecomment-1496765045
*
* There is a flow chart diagram in that comment.
*
* Basically:
*
* * "Global" patterns are defined at top level of config file, and "local"
* patterns are defined for each output target
* * Each pattern can have "watch", "documents", and "schemas"
* * Watch patterns (global and local) always take precedence over documents and
* schemas patterns, i.e. a watch negation always negates, and a watch match is
* a match even if it would be negated by some pattern in documents or schemas
* * The trigger returns true if any output target's local patterns result in
* a match, after considering the precedence of any global and local negations
*/
export const makeShouldRebuild = ({
globalPatternSet,
localPatternSets,
}: {
globalPatternSet: PatternSet;
localPatternSets: PatternSet[];
}) => {
const localMatchers = localPatternSets.map(localPatternSet => {
return (path: string) => {
// Is path negated by any negating watch pattern?
if (matchesAnyNegatedPattern(path, [...globalPatternSet.watch.negated, ...localPatternSet.watch.negated])) {
// Short circut: negations in watch patterns take priority
return false;
}
// Does path match any affirmative watch pattern?
if (
matchesAnyAffirmativePattern(path, [
...globalPatternSet.watch.affirmative,
...localPatternSet.watch.affirmative,
])
) {
// Immediately return true: Watch pattern takes priority, even if documents or schema would negate it
return true;
}
// Does path match documents patterns (without being negated)?
if (
matchesAnyAffirmativePattern(path, [
...globalPatternSet.documents.affirmative,
...localPatternSet.documents.affirmative,
]) &&
!matchesAnyNegatedPattern(path, [...globalPatternSet.documents.negated, ...localPatternSet.documents.negated])
) {
return true;
}
// Does path match schemas patterns (without being negated)?
if (
matchesAnyAffirmativePattern(path, [
...globalPatternSet.schemas.affirmative,
...localPatternSet.schemas.affirmative,
]) &&
!matchesAnyNegatedPattern(path, [...globalPatternSet.schemas.negated, ...localPatternSet.schemas.negated])
) {
return true;
}
// Otherwise, there is no match
return false;
};
});
/**
* Return `true` if `path` should trigger a rebuild
*/
return ({ path: absolutePath }: { path: string }) => {
if (!isAbsolute(absolutePath)) {
throw new Error('shouldRebuild trigger should be called with absolute path');
}
const path = relative(process.cwd(), absolutePath);
const shouldRebuild = localMatchers.some(matcher => matcher(path));
return shouldRebuild;
};
};
/**
* Create the pattern set for the "global" (top level) config.
*
* In the `shouldRebuild` algorithm, any of these watch patterns will take
* precedence over local configs, and any schemas and documents patterns will be
* mixed into the pattern set of each local config.
*/
export const makeGlobalPatternSet = (initialContext: CodegenContext) => {
const config: Types.Config & { configFilePath?: string } = initialContext.getConfig();
return {
watch: sortPatterns([
...(typeof config.watch === 'boolean' ? [] : normalizeInstanceOrArray<string>(config.watch ?? [])),
relative(process.cwd(), initialContext.filepath),
]),
schemas: sortPatterns(makePatternsFromSchemas(normalizeInstanceOrArray<Types.Schema>(config.schema))),
documents: sortPatterns(
makePatternsFromDocuments(normalizeInstanceOrArray<Types.OperationDocument>(config.documents))
),
};
};
/**
* Create the pattern set for a "local" (output target) config
*
* In the `shouldRebuild` algorithm, any of these watch patterns will take
* precedence over documents or schemas patterns, and the documents and schemas
* patterns will be mixed into the pattern set of their respective gobal pattern
* set equivalents.
*/
export const makeLocalPatternSet = (conf: Types.ConfiguredOutput) => {
return {
watch: sortPatterns(normalizeInstanceOrArray(conf.watchPattern)),
documents: sortPatterns(
makePatternsFromDocuments(normalizeInstanceOrArray<Types.OperationDocument>(conf.documents))
),
schemas: sortPatterns(makePatternsFromSchemas(normalizeInstanceOrArray<Types.Schema>(conf.schema))),
};
};
/**
* Parse a list of micromatch patterns from a list of documents, which should
* already have been normalized from their raw config values.
*/
const makePatternsFromDocuments = (documents: Types.OperationDocument[]): string[] => {
const patterns: string[] = [];
if (documents) {
for (const doc of documents) {
if (typeof doc === 'string') {
patterns.push(doc);
} else {
patterns.push(...Object.keys(doc));
}
}
}
return patterns;
};
/**
* Parse a list of micromatch patterns from a list of schemas, which should
* already have been normalized from their raw config values.
*/
const makePatternsFromSchemas = (schemas: Types.Schema[]): string[] => {
const patterns: string[] = [];
for (const s of schemas) {
const schema = s as string;
if (isGlob(schema) || isValidPath(schema)) {
patterns.push(schema);
}
}
return patterns;
};
/**
* Given a list of micromatch patterns, sort them into `patterns` (all of them),
* `affirmative` (only the affirmative patterns), and `negated` (only the negated patterns)
*
* @param patterns List of micromatch patterns
*/
export const sortPatterns = <P extends string | NegatedPattern>(patterns: P[]): SortedPatterns<P> => ({
patterns,
affirmative: onlyAffirmativePatterns(patterns) as P[],
negated: onlyNegatedPatterns(patterns) as Extract<P, NegatedPattern>[],
});
/**
* A type that "sorts" (or "groups") patterns. For a given list of `patterns`,
* this type will include the original list in `patterns`, all of its
* "affirmative" (non-negated) patterns in `affirmative`, and all of its
* "negated" patterns in `negated`
*/
type SortedPatterns<PP extends string | NegatedPattern = string | NegatedPattern> = {
/** List of patterns, which could include both negated and affirmative patterns */
patterns: PP[];
/** List of only the affirmative (non-negated) patterns in `patterns` */
affirmative: PP[];
/** List of only the negated patterns in `patterns` */
negated: Extract<PP, NegatedPattern>[];
};
/**
* The global (top-level) config and each local (output target) config can have
* patterns which are separable into "watch" (always takes precedence), "documents",
* and "schemas". This type can hold sorted versions of these patterns.
*/
type PatternSet = {
watch: SortedPatterns;
documents: SortedPatterns;
schemas: SortedPatterns;
};
/**
* Filter the provided list of patterns to include only "affirmative" (non-negated) patterns.
*
* @param patterns List of micromatch patterns (or paths) to filter
*/
const onlyAffirmativePatterns = (patterns: string[]) => {
return patterns.filter(pattern => !mm.scan(pattern).negated);
};
/**
* Filter the provided list of patterns to include only negated patterns.
*
* @param patterns List of micromatch patterns (or paths) to filter
*/
const onlyNegatedPatterns = (patterns: string[]) => {
return patterns.filter(pattern => mm.scan(pattern).negated);
};
/**
* Given a list of negated patterns, invert them by removing their negation prefix
*
* If there is a non-negated pattern in the list, throw an error, because this
* function should only be called after filtering the list to be only negated patterns
*
* @param patterns List of negated micromatch patterns
*/
const invertNegatedPatterns = (patterns: string[]) => {
return patterns.map(pattern => {
const scanned = mm.scan(pattern);
if (!scanned.negated) {
throw new Error(`onlyNegatedPatterns got a non-negated pattern: ${pattern}`);
}
// Remove the leading prefix (NOTE: this is not always "!")
// e.g. mm.scan("!./foo/bar/never-watch.graphql").prefix === '!./'
return pattern.slice(scanned.prefix.length);
});
};
/**
* Return true if relativeCandidatePath matches any of the affirmativePatterns
*
* @param relativeCandidatePath A relative path to evaluate against the supplied affirmativePatterns
* @param affirmativePatterns A list of patterns, containing no negated patterns, to evaluate
*/
const matchesAnyAffirmativePattern = (relativeCandidatePath: string, affirmativePatterns: string[]) => {
if (isAbsolute(relativeCandidatePath)) {
throw new Error('matchesAny should only be called with relative candidate path');
}
// Developer error: This function is not intended to work with pattern sets including negations
if (affirmativePatterns.some(pattern => mm.scan(pattern).negated)) {
throw new Error('matchesAnyAffirmativePattern should only include affirmative patterns');
}
// micromatch.isMatch does not omit matches that are negated by negation patterns,
// which is why we require this function only examine affirmative patterns
return mm.isMatch(relativeCandidatePath, affirmativePatterns);
};
/**
* Return true if relativeCandidatePath matches any of the negatedPatterns
*
* This function will invert the negated patterns and then call matchesAnyAffirmativePattern
*
* @param relativeCandidatePath A relative path to evaluate against the suppliednegatedPatterns
* @param negatedPatterns A list of patterns, containing no negated patterns, to evaluate
*/
const matchesAnyNegatedPattern = (relativeCandidatePath: string, negatedPatterns: string[]) => {
// NOTE: No safety check that negatedPatterns contains only negated, because that will happen in invertedNegatedPatterns
return matchesAnyAffirmativePattern(relativeCandidatePath, invertNegatedPatterns(negatedPatterns));
};
``` | /content/code_sandbox/packages/graphql-codegen-cli/src/utils/patterns.ts | xml | 2016-12-05T19:15:11 | 2024-08-15T14:56:08 | graphql-code-generator | dotansimha/graphql-code-generator | 10,759 | 2,467 |
```xml
import { Redirect } from 'react-router-dom';
import { useBitcoinBlockchainContext } from '../contexts';
export const EmptyViewContainer = () => {
const { decryptedApiWalletsData } = useBitcoinBlockchainContext();
if (decryptedApiWalletsData?.length) {
return <Redirect to={`wallets/${decryptedApiWalletsData[0].Wallet.ID}`} />;
}
return null;
};
``` | /content/code_sandbox/applications/wallet/src/app/containers/EmptyViewContainer.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 88 |
```xml
import { Viewlet } from "./viewlet";
import { Code } from "./code";
const SEARCH_BOX = "div.extensions-viewlet[id=\"workbench.view.extensions\"] .monaco-editor textarea";
export class Extensions extends Viewlet {
constructor(code: Code) {
super(code);
}
public async openExtensionsViewlet(): Promise<any> {
if (process.platform === "darwin") {
await this.code.dispatchKeybinding("cmd+shift+x");
} else {
await this.code.dispatchKeybinding("ctrl+shift+x");
}
await this.code.waitForActiveElement(SEARCH_BOX);
}
public async waitForExtensionsViewlet(): Promise<any> {
await this.code.waitForElement(SEARCH_BOX);
}
async searchForExtension(id: string): Promise<any> {
await this.code.waitAndClick(SEARCH_BOX);
await this.code.waitForActiveElement(SEARCH_BOX);
await this.code.waitForTypeInEditor(SEARCH_BOX, `@id:${id}`);
await this.code.waitForTextContent(`div.part.sidebar div.composite.title h2`, "Extensions: Marketplace");
await this.code.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`);
}
async installExtension(id: string, waitUntilEnabled: boolean): Promise<void> {
await this.searchForExtension(id);
await this.code.waitAndClick(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"] .extension-list-item .monaco-action-bar .action-item:not(.disabled) .extension-action.install`);
await this.code.waitForElement(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action.uninstall`);
if (waitUntilEnabled) {
await this.code.waitForElement(`.extension-editor .monaco-action-bar .action-item:not(.disabled) .extension-action[title="Disable this extension"]`);
}
}
async openExtension(id: string): Promise<any> {
await this.searchForExtension(id);
await this.code.waitAndClick(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`);
}
async closeExtension(title: string): Promise<any> {
await this.code.waitAndClick(`.tabs-container div.tab[title="Extension: ${title}"] div.tab-actions a.action-label.codicon.codicon-close`);
}
}
``` | /content/code_sandbox/test/smoke/automation/src/extensions.ts | xml | 2016-01-20T21:10:07 | 2024-08-16T15:29:52 | vscode-react-native | microsoft/vscode-react-native | 2,617 | 515 |
```xml
import { NamedPalette, NamedTheme } from './types';
export const paletteTemplate = (id: string): NamedPalette & { id: string } => ({
id,
name: '',
keyColor: [44.51, 39.05, 288.84],
darkCp: 2 / 3,
lightCp: 1 / 3,
hueTorsion: 0,
});
export const themeTemplate = (id: string): NamedTheme & { id: string } => ({
id,
name: '',
backgrounds: {},
foregrounds: {},
});
``` | /content/code_sandbox/packages/react-components/theme-designer/src/colors/templates.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 128 |
```xml
import { IsOptional } from "class-validator";
import { Environment } from "@server/env";
import environment from "@server/utils/environment";
import { CannotUseWithout } from "@server/utils/validators";
class GooglePluginEnvironment extends Environment {
/**
* Google OAuth2 client credentials. To enable authentication with Google.
*/
@IsOptional()
@CannotUseWithout("GOOGLE_CLIENT_SECRET")
public GOOGLE_CLIENT_ID = this.toOptionalString(environment.GOOGLE_CLIENT_ID);
@IsOptional()
@CannotUseWithout("GOOGLE_CLIENT_ID")
public GOOGLE_CLIENT_SECRET = this.toOptionalString(
environment.GOOGLE_CLIENT_SECRET
);
}
export default new GooglePluginEnvironment();
``` | /content/code_sandbox/plugins/google/server/env.ts | xml | 2016-05-22T21:31:47 | 2024-08-16T19:57:22 | outline | outline/outline | 26,751 | 142 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.