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"?>
<!--
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="single_padding">8dp</dimen>
<dimen name="card_margin">8dp</dimen>
<dimen name="double_padding">16dp</dimen>
<dimen name="max_padding">24dp</dimen>
<dimen name="header_gap">8dp</dimen>
<dimen name="row_gap">1px</dimen>
<dimen name="button_height">50dp</dimen>
</resources>
``` | /content/code_sandbox/Android/AndroidRetrofitDownloadFileProgress/app/src/main/res/values/dimen.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 162 |
```xml
// This is a generated file. Changes are likely to result in being overwritten
declare namespace LargeHeaderScssNamespace {
export interface ILargeHeaderScss {
'large-header': string;
largeHeader: string;
}
}
declare const LargeHeaderScssModule: LargeHeaderScssNamespace.ILargeHeaderScss & {
/** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
locals: LargeHeaderScssNamespace.ILargeHeaderScss;
};
export = LargeHeaderScssModule;
``` | /content/code_sandbox/packages/sdk/ui-react/src/widget/largeHeader/largeHeader.scss.d.ts | xml | 2016-11-11T23:15:09 | 2024-08-16T12:45:29 | BotFramework-Emulator | microsoft/BotFramework-Emulator | 1,803 | 122 |
```xml
<dict>
<key>LayoutID</key>
<integer>3</integer>
<key>PathMapRef</key>
<array>
<dict>
<key>CodecID</key>
<array>
<integer>283902569</integer>
</array>
<key>Headphone</key>
<dict>
<key>AmpPreDelay</key>
<integer>50</integer>
<key>Headset_dBV</key>
<integer>3239051264</integer>
<key>MuteGPIO</key>
<integer>0</integer>
</dict>
<key>Inputs</key>
<array>
<string>Mic</string>
<string>LineIn</string>
</array>
<key>IntSpeaker</key>
<dict/>
<key>LineIn</key>
<dict>
<key>MuteGPIO</key>
<integer>1342242840</integer>
<key>SignalProcessing</key>
<dict>
<key>SoftwareDSP</key>
<dict>
<key>DspFunction0</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>0</integer>
<key>DspFuncName</key>
<string>DspNoiseReduction</string>
<key>DspFuncProcessingIndex</key>
<integer>0</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>-1073029587</integer>
<key>5</key>
<data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data>
</dict>
<key>PatchbayInfo</key>
<dict/>
</dict>
<key>DspFunction1</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>1</integer>
<key>DspFuncName</key>
<string>DspEqualization32</string>
<key>DspFuncProcessingIndex</key>
<integer>1</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>9</key>
<integer>0</integer>
<key>Filter</key>
<array>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>1</integer>
<key>6</key>
<integer>1119939268</integer>
<key>7</key>
<integer>1060439283</integer>
<key>8</key>
<integer>-1069504319</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>4</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1165674830</integer>
<key>7</key>
<integer>1106304591</integer>
<key>8</key>
<integer>-1073964333</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>5</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1141348835</integer>
<key>7</key>
<integer>1084737706</integer>
<key>8</key>
<integer>-1065063953</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>6</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1139052693</integer>
<key>7</key>
<integer>1080938866</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>8</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1161958655</integer>
<key>7</key>
<integer>1099668786</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>9</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1148922426</integer>
<key>7</key>
<integer>1086508776</integer>
<key>8</key>
<integer>-1076100424</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>10</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1169908270</integer>
<key>7</key>
<integer>1106659062</integer>
<key>8</key>
<integer>-1078236516</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>11</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1168889995</integer>
<key>7</key>
<integer>1103911084</integer>
<key>8</key>
<integer>-1082886964</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>12</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1160729473</integer>
<key>7</key>
<integer>1095247586</integer>
<key>8</key>
<integer>-1076100424</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>19</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1171440929</integer>
<key>7</key>
<integer>1103785747</integer>
<key>8</key>
<integer>-1075032379</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>21</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1163187837</integer>
<key>7</key>
<integer>1102690138</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>23</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1172459204</integer>
<key>7</key>
<integer>1098523915</integer>
<key>8</key>
<integer>-1062927862</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>24</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1175303133</integer>
<key>7</key>
<integer>1102375714</integer>
<key>8</key>
<integer>-1061058782</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>25</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1179874390</integer>
<key>7</key>
<integer>1097945441</integer>
<key>8</key>
<integer>-1054338996</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>26</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1167504019</integer>
<key>7</key>
<integer>1102555367</integer>
<key>8</key>
<integer>-1044515201</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>27</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1177335863</integer>
<key>7</key>
<integer>1102845396</integer>
<key>8</key>
<integer>-1054739513</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>31</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>0</integer>
<key>6</key>
<integer>1184146588</integer>
<key>7</key>
<integer>1060439283</integer>
<key>8</key>
<integer>-1069504319</integer>
</dict>
</array>
</dict>
<key>PatchbayInfo</key>
<dict>
<key>InputPort0</key>
<dict>
<key>PortInstance</key>
<integer>0</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>0</integer>
<key>SourcePortIndex</key>
<integer>0</integer>
</dict>
<key>InputPort1</key>
<dict>
<key>PortInstance</key>
<integer>1</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>0</integer>
<key>SourcePortIndex</key>
<integer>1</integer>
</dict>
</dict>
</dict>
<key>DspFunction2</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>2</integer>
<key>DspFuncName</key>
<string>DspGainStage</string>
<key>DspFuncProcessingIndex</key>
<integer>2</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1065353216</integer>
<key>3</key>
<integer>1065353216</integer>
</dict>
<key>PatchbayInfo</key>
<dict>
<key>InputPort0</key>
<dict>
<key>PortInstance</key>
<integer>0</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>1</integer>
<key>SourcePortIndex</key>
<integer>0</integer>
</dict>
<key>InputPort1</key>
<dict>
<key>PortInstance</key>
<integer>1</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>1</integer>
<key>SourcePortIndex</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</dict>
</dict>
</dict>
<key>LineOut</key>
<dict/>
<key>Mic</key>
<dict>
<key>MuteGPIO</key>
<integer>1342242841</integer>
<key>SignalProcessing</key>
<dict>
<key>SoftwareDSP</key>
<dict>
<key>DspFunction0</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>0</integer>
<key>DspFuncName</key>
<string>DspNoiseReduction</string>
<key>DspFuncProcessingIndex</key>
<integer>0</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>-1073029587</integer>
<key>5</key>
<data>your_sha256_hashHMuYwrl9lcJXm4/CBhmQwuJvlMKbxJTC7qyUwtjDl8KU+ZzCnCaewsmuncK/your_sha512_hash+your_sha256_hashyour_sha256_hashfwhFzosLIZaPCwUOjwo6TosIkR6LC6vehwtrwosIdtJ/CXLmbwlSZmcKDhJXCDFGRwnV6j8JTjY/CrqGQwgqYk8INzpjCuTufwrjlocKviKPC5YqlwgdmpcKZ2aXCGiumwq95osJOIJ/Cxl+ewtWGl8KmPJPC+sSawkdHo8JWB6LCskyhwqk7pcIth6nCh4Wswk+crcK9J6zCYJWqwmVJq8K8063Cyour_sha512_hash+M0MKaftbCpcjdwm+p5sL/CfHCHcT8wrp3A8PiJAzD</data>
</dict>
<key>PatchbayInfo</key>
<dict/>
</dict>
<key>DspFunction1</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>1</integer>
<key>DspFuncName</key>
<string>DspEqualization32</string>
<key>DspFuncProcessingIndex</key>
<integer>1</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>9</key>
<integer>0</integer>
<key>Filter</key>
<array>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>0</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>1</integer>
<key>6</key>
<integer>1119939268</integer>
<key>7</key>
<integer>1060439283</integer>
<key>8</key>
<integer>-1069504319</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>4</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1165674830</integer>
<key>7</key>
<integer>1106304591</integer>
<key>8</key>
<integer>-1073964333</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>5</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1141348835</integer>
<key>7</key>
<integer>1084737706</integer>
<key>8</key>
<integer>-1065063953</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>6</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1139052693</integer>
<key>7</key>
<integer>1080938866</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>8</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1161958655</integer>
<key>7</key>
<integer>1099668786</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>9</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1148922426</integer>
<key>7</key>
<integer>1086508776</integer>
<key>8</key>
<integer>-1076100424</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>10</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1169908270</integer>
<key>7</key>
<integer>1106659062</integer>
<key>8</key>
<integer>-1078236516</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>11</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1168889995</integer>
<key>7</key>
<integer>1103911084</integer>
<key>8</key>
<integer>-1082886964</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>12</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1160729473</integer>
<key>7</key>
<integer>1095247586</integer>
<key>8</key>
<integer>-1076100424</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>19</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1171440929</integer>
<key>7</key>
<integer>1103785747</integer>
<key>8</key>
<integer>-1075032379</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>21</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1163187837</integer>
<key>7</key>
<integer>1102690138</integer>
<key>8</key>
<integer>-1073319056</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>23</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1172459204</integer>
<key>7</key>
<integer>1098523915</integer>
<key>8</key>
<integer>-1062927862</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>24</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1175303133</integer>
<key>7</key>
<integer>1102375714</integer>
<key>8</key>
<integer>-1061058782</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>25</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1179874390</integer>
<key>7</key>
<integer>1097945441</integer>
<key>8</key>
<integer>-1054338996</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>26</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1167504019</integer>
<key>7</key>
<integer>1102555367</integer>
<key>8</key>
<integer>-1044515201</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>27</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>4</integer>
<key>6</key>
<integer>1177335863</integer>
<key>7</key>
<integer>1102845396</integer>
<key>8</key>
<integer>-1054739513</integer>
</dict>
<dict>
<key>2</key>
<integer>2</integer>
<key>3</key>
<integer>31</integer>
<key>4</key>
<integer>0</integer>
<key>5</key>
<integer>0</integer>
<key>6</key>
<integer>1184146588</integer>
<key>7</key>
<integer>1060439283</integer>
<key>8</key>
<integer>-1069504319</integer>
</dict>
</array>
</dict>
<key>PatchbayInfo</key>
<dict>
<key>InputPort0</key>
<dict>
<key>PortInstance</key>
<integer>0</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>0</integer>
<key>SourcePortIndex</key>
<integer>0</integer>
</dict>
<key>InputPort1</key>
<dict>
<key>PortInstance</key>
<integer>1</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>0</integer>
<key>SourcePortIndex</key>
<integer>1</integer>
</dict>
</dict>
</dict>
<key>DspFunction2</key>
<dict>
<key>FunctionInfo</key>
<dict>
<key>DspFuncInstance</key>
<integer>2</integer>
<key>DspFuncName</key>
<string>DspGainStage</string>
<key>DspFuncProcessingIndex</key>
<integer>2</integer>
</dict>
<key>ParameterInfo</key>
<dict>
<key>1</key>
<integer>0</integer>
<key>2</key>
<integer>1065353216</integer>
<key>3</key>
<integer>1065353216</integer>
</dict>
<key>PatchbayInfo</key>
<dict>
<key>InputPort0</key>
<dict>
<key>PortInstance</key>
<integer>0</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>1</integer>
<key>SourcePortIndex</key>
<integer>0</integer>
</dict>
<key>InputPort1</key>
<dict>
<key>PortInstance</key>
<integer>1</integer>
<key>PortWidth</key>
<integer>1</integer>
<key>SourceFuncInstance</key>
<integer>1</integer>
<key>SourcePortIndex</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</dict>
</dict>
</dict>
<key>Outputs</key>
<array>
<string>IntSpeaker</string>
<string>LineOut</string>
<string>Headphone</string>
</array>
<key>PathMapID</key>
<integer>269</integer>
</dict>
</array>
</dict>
``` | /content/code_sandbox/Resources/ALC269/layout21.xml | xml | 2016-03-07T20:45:58 | 2024-08-14T08:57:03 | AppleALC | acidanthera/AppleALC | 3,420 | 7,939 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {render, screen, within} from 'modules/testing-library';
import {InstancesTable} from '.';
import {unstable_HistoryRouter as HistoryRouter} from 'react-router-dom';
import {Paths} from 'modules/Routes';
import {batchModificationStore} from 'modules/stores/batchModification';
import {useEffect} from 'react';
import {createMemoryHistory} from 'history';
function getWrapper(initialPath: string = Paths.processes()) {
const Wrapper: React.FC<{children?: React.ReactNode}> = ({children}) => {
useEffect(() => {
return batchModificationStore.reset;
});
return (
<HistoryRouter
history={createMemoryHistory({
initialEntries: [initialPath],
})}
>
{children}
<button onClick={batchModificationStore.enable}>
Enable batch modification mode
</button>
</HistoryRouter>
);
};
return Wrapper;
}
describe('<InstancesTable />', () => {
it.each(['all', undefined])(
'should show tenant column when multi tenancy is enabled and tenant filter is %p',
async (tenant) => {
window.clientConfig = {
multiTenancyEnabled: true,
};
render(<InstancesTable />, {
wrapper: getWrapper(
`${Paths.processes()}?${new URLSearchParams(
tenant === undefined ? undefined : {tenant},
)}`,
),
});
expect(
screen.getByRole('columnheader', {name: 'Tenant'}),
).toBeInTheDocument();
window.clientConfig = undefined;
},
);
it('should hide tenant column when multi tenancy is enabled and tenant filter is a specific tenant', async () => {
window.clientConfig = {
multiTenancyEnabled: true,
};
render(<InstancesTable />, {
wrapper: getWrapper(
`${Paths.processes()}?${new URLSearchParams({tenant: 'tenant-a'})}`,
),
});
expect(
screen.queryByRole('columnheader', {name: 'Tenant'}),
).not.toBeInTheDocument();
window.clientConfig = undefined;
});
it('should hide tenant column when multi tenancy is disabled', async () => {
render(<InstancesTable />, {
wrapper: getWrapper(
`${Paths.processes()}?${new URLSearchParams({tenant: 'all'})}`,
),
});
expect(
screen.queryByRole('columnheader', {name: 'Tenant'}),
).not.toBeInTheDocument();
});
it('should render batch modification footer', async () => {
const {user} = render(<InstancesTable />, {wrapper: getWrapper()});
await user.click(
screen.getByRole('button', {name: /enable batch modification mode/i}),
);
expect(
screen.getByRole('button', {name: /apply modification/i}),
).toBeInTheDocument();
await user.click(screen.getByRole('button', {name: /exit/i}));
await user.click(
within(screen.getByRole('dialog')).getByRole('button', {name: /exit/i}),
);
expect(
screen.queryByRole('button', {name: /apply modification/i}),
).not.toBeInTheDocument();
expect(
screen.queryByRole('button', {name: /exit/i}),
).not.toBeInTheDocument();
});
});
``` | /content/code_sandbox/operate/client/src/App/Processes/ListView/InstancesTable/index.test.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 717 |
```xml
import { buildSchema } from 'graphql';
import {
makeExecutableSchema,
IExecutableSchemaDefinition,
} from '@graphql-tools/schema';
import { addMocksToSchema } from '@graphql-tools/mock';
export function augmentTypeDefsWithCacheControlSupport(typeDefs: string) {
return (
`
enum CacheControlScope {
PUBLIC
PRIVATE
}
directive @cacheControl(
maxAge: Int
scope: CacheControlScope
inheritMaxAge: Boolean
) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION
` + typeDefs
);
}
export function buildSchemaWithCacheControlSupport(source: string) {
return buildSchema(augmentTypeDefsWithCacheControlSupport(source));
}
export function makeExecutableSchemaWithCacheControlSupport(
options: IExecutableSchemaDefinition & { typeDefs: string },
) {
return addMocksToSchema({
schema: makeExecutableSchema({
...options,
typeDefs: augmentTypeDefsWithCacheControlSupport(options.typeDefs),
}),
preserveResolvers: true,
});
}
``` | /content/code_sandbox/packages/server/src/__tests__/plugin/cacheControl/cacheControlSupport.ts | xml | 2016-04-21T09:26:01 | 2024-08-16T19:32:15 | apollo-server | apollographql/apollo-server | 13,742 | 220 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_shadow_8dp">
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/bg_round_white_8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_state"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="@dimen/default_padding"
android:alpha=".2"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/ic_fixed" />
<TextView
android:id="@+id/tv_issue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_game_live_tag"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:text="BasePopup"
android:textColor="@color/white"
android:textSize="@dimen/text_small"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_padding"
android:paddingLeft="@dimen/default_padding"
android:paddingRight="@dimen/default_padding"
android:text="BasePopup"
android:textColor="@color/text_black1"
android:textSize="@dimen/text_large"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_issue" />
<TextView
android:id="@+id/tv_desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.3"
android:padding="@dimen/default_padding"
android:textColor="@color/text_black2_80"
android:textSize="@dimen/text_small"
app:layout_constraintTop_toBottomOf="@id/tv_title"
tools:text="\n" />
<razerdp.demo.widget.FlowLayout
android:id="@+id/layout_pic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/default_padding"
android:visibility="gone"
app:fv_itemSpacing="@dimen/default_padding"
app:fv_lineSpacing="@dimen/default_padding"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_desc" />
<View
android:id="@+id/divider"
style="@style/divider"
android:layout_marginTop="@dimen/default_padding"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_pic" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/divider">
<razerdp.demo.widget.DPTextView
android:id="@+id/tv_to_web"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/default_padding"
android:text="Issue"
android:textColor="@color/common_red"
android:textSize="@dimen/text_small"
app:backgroundPressedColor="@color/press_color"
app:corner_bottomLeftRadius="8dp"
app:textPressedColor="@color/common_red_light" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/default_padding"
android:layout_marginBottom="@dimen/default_padding"
android:background="@color/line_bg" />
<razerdp.demo.widget.DPTextView
android:id="@+id/tv_go"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/default_padding"
android:text=""
android:textColor="@color/color_blue"
android:textSize="@dimen/text_small"
app:backgroundPressedColor="@color/press_color"
app:corner_bottomRightRadius="8dp"
app:textPressedColor="@color/color_blue_pressed" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
``` | /content/code_sandbox/app/src/main/res/layout/item_issue.xml | xml | 2016-01-15T03:31:07 | 2024-08-14T02:03:47 | BasePopup | razerdp/BasePopup | 5,179 | 1,176 |
```xml
<page id="choiceFooter">
<choice>
<section layout="row" source="popularSearches"/>
</choice>
</page>
``` | /content/code_sandbox/container-search/src/test/java/com/yahoo/search/pagetemplates/config/test/examples/choiceFooter.xml | xml | 2016-06-03T20:54:20 | 2024-08-16T15:32:01 | vespa | vespa-engine/vespa | 5,524 | 32 |
```xml
import { Options } from '@/react/edge/components/useIntervalOptions';
import { OAuthStyle } from '@/react/portainer/settings/types';
import { FormControl, Size } from '@@/form-components/FormControl';
import { Select } from '@@/form-components/Input';
interface Props {
value: OAuthStyle;
onChange(value: OAuthStyle): void;
label?: string;
tooltip?: string;
readonly?: boolean;
size?: Size;
}
// The options are based on oauth2 lib definition @path_to_url#AuthStyle
export const authStyleOptions: Options = [
{ label: 'Auto Detect', value: OAuthStyle.AutoDetect, isDefault: true },
{ label: 'In Params', value: OAuthStyle.InParams },
{ label: 'In Header', value: OAuthStyle.InHeader },
];
export function AuthStyleField({
value,
readonly = false,
onChange,
label = 'Auth Style',
tooltip = 'Auth Style specifies how the endpoint wants the client ID & client secret sent.',
size = 'small',
}: Props) {
return (
<FormControl
inputId="oauth_authstyle"
label={label}
tooltip={tooltip}
size={size}
>
<Select
value={value}
onChange={(e) => {
onChange(parseInt(e.currentTarget.value, 10));
}}
options={authStyleOptions}
disabled={readonly}
id="oauth_authstyle"
data-cy="setting-oauth-authstyle-select"
/>
</FormControl>
);
}
``` | /content/code_sandbox/app/react/portainer/settings/AuthenticationView/OAuth/AuthStyleField.tsx | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 325 |
```xml
import * as compose from 'lodash.flowright';
import {
AckRequestMutationResponse,
ConfirmRequestMutationResponse,
RequestAccessMutationResponse
} from '../../types';
import { mutations, queries } from '../../graphql';
import { Alert } from '@erxes/ui/src/utils';
import React from 'react';
import RequestAccessForm from '../../components/file/RequestAccessForm';
import RequestedFileList from '../../components/file/RequestedFilesList';
import Spinner from '@erxes/ui/src/components/Spinner';
import { gql } from '@apollo/client';
import { graphql } from '@apollo/client/react/hoc';
type Props = {
fileId: string;
folderId: string;
};
type FinalProps = {
getAckRequestQuery: any;
} & Props &
AckRequestMutationResponse;
const RequestedAckListContainer = ({
ackRequestMutation,
getAckRequestQuery
}: FinalProps) => {
if (getAckRequestQuery && getAckRequestQuery.loading) {
return <Spinner objective={true} />;
}
const onConfirm = (requestId: string) => {
ackRequestMutation({
variables: {
_id: requestId
}
})
.then(() => {
Alert.success('Successfully acknowledged!');
})
.catch(error => {
Alert.error(error.message);
});
};
const ackRequest =
getAckRequestQuery.filemanagerGetAckRequests || ([] as any);
return (
<RequestedFileList
requests={ackRequest}
onConfirm={onConfirm}
type="acknowledge"
hideActions={true}
/>
);
};
export default compose(
graphql<Props>(gql(queries.filemanagerGetAckRequests), {
name: 'getAckRequestQuery',
options: ({ fileId }: { fileId: string }) => ({
variables: {
fileId
}
})
})
// graphql<Props, AckRequestMutationResponse, {}>(
// gql(mutations.filemanagerAckRequest),
// {
// name: "ackRequestMutation",
// options: ({ folderId }: { folderId: string }) => {
// return {
// refetchQueries: [
// {
// query: gql(queries.filemanagerFiles),
// variables: {
// folderId: folderId || "",
// },
// },
// ],
// };
// },
// }
// )
)(RequestedAckListContainer);
``` | /content/code_sandbox/packages/plugin-filemanager-ui/src/containers/file/RequestedAckList.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 522 |
```xml
import * as GL from 'expo-gl';
import { Renderer, TextureLoader, THREE } from 'expo-three';
import React from 'react';
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
interface State {
snapshot?: GL.GLSnapshot;
}
// See: path_to_url#discussion_r490961694
// eslint-disable-next-line @typescript-eslint/ban-types
export default class GLSnapshotsScreen extends React.PureComponent<{}, State> {
static title = 'Taking snapshots';
readonly state: State = {};
rafID?: number;
glView?: GL.GLView;
componentWillUnmount() {
if (this.rafID !== undefined) {
cancelAnimationFrame(this.rafID);
}
}
takeSnapshot = async () => {
if (this.glView) {
const snapshot = await this.glView.takeSnapshotAsync({
format: 'png',
});
this.setState({ snapshot });
}
};
onContextCreate = async (gl: GL.ExpoWebGLRenderingContext) => {
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(
75,
gl.drawingBufferWidth / gl.drawingBufferHeight,
0.1,
1000
);
const renderer = new Renderer({ gl });
renderer.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight);
renderer.setClearColor(0xffffff, 0);
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({
map: new TextureLoader().load(require('../../../assets/images/swmansion.png')),
});
const cube = new THREE.Mesh(geometry, material);
scene.add(cube);
camera.position.z = 3;
const animate = () => {
this.rafID = requestAnimationFrame(animate);
cube.rotation.x += 0.02;
cube.rotation.y += 0.03;
cube.position.x = Math.sin(cube.rotation.x);
cube.position.y = Math.cos(cube.rotation.y);
renderer.render(scene, camera);
gl.endFrameEXP();
};
animate();
};
render() {
const { snapshot } = this.state;
return (
<View style={styles.flex}>
<GL.GLView
style={styles.flex}
onContextCreate={this.onContextCreate}
ref={(ref) => (this.glView = ref!)}
/>
{snapshot && (
<View style={styles.snapshot}>
<Image
style={[styles.flex, { aspectRatio: snapshot.width / snapshot.height }]}
source={snapshot as { uri: string }}
/>
</View>
)}
<TouchableOpacity style={styles.snapshotButton} onPress={this.takeSnapshot}>
<Text>Take snapshot</Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
flex: {
flex: 1,
},
snapshot: {
height: 100,
margin: 10,
borderWidth: StyleSheet.hairlineWidth,
borderColor: 'black',
backgroundColor: '#248e80',
position: 'absolute',
left: 0,
bottom: 0,
shadowColor: 'black',
shadowOpacity: 0.3,
shadowRadius: 5,
shadowOffset: { width: 0, height: 0 },
},
snapshotButton: {
margin: 10,
paddingVertical: 10,
paddingHorizontal: 15,
backgroundColor: 'white',
borderWidth: StyleSheet.hairlineWidth,
borderColor: 'black',
borderRadius: 5,
position: 'absolute',
right: 0,
bottom: 0,
},
});
``` | /content/code_sandbox/apps/native-component-list/src/screens/GL/GLSnapshotsScreen.tsx | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 793 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-Dynamic|ARM">
<Configuration>Debug-Dynamic</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Dynamic|ARM64">
<Configuration>Debug-Dynamic</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Dynamic|Win32">
<Configuration>Debug-Dynamic</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Dynamic|x64">
<Configuration>Debug-Dynamic</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Static|ARM">
<Configuration>Debug-Static</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Static|ARM64">
<Configuration>Debug-Static</Configuration>
<Platform>ARM64</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="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Dynamic|ARM">
<Configuration>Release-Dynamic</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Dynamic|ARM64">
<Configuration>Release-Dynamic</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Dynamic|Win32">
<Configuration>Release-Dynamic</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Dynamic|x64">
<Configuration>Release-Dynamic</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Static|ARM">
<Configuration>Release-Static</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Static|ARM64">
<Configuration>Release-Static</Configuration>
<Platform>ARM64</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|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<!-- Import common config -->
<Import Project="..\..\..\build\vs\pjproject-vs14-common-config.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{4BF51C21-5A30-423B-82FE-1ED410E5769D}</ProjectGuid>
<RootNamespace>libmilenage</RootNamespace>
<!-- Specific UWP property -->
<DefaultLanguage>en-US</DefaultLanguage>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<!-- Override the PlatformToolset -->
<PropertyGroup>
<PlatformToolset>$(BuildToolset)</PlatformToolset>
<CharacterSet Condition="'$(API_Family)'!='WinDesktop'">
</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win32-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win32-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win32-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win32-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" />
</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" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win32-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win32-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</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" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win64-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm64-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win64-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm64-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win64-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm64-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win64-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm64-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-dynamic-defaults.props" />
</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" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win64-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm64-common-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-debug-static-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-win64-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\build\vs\pjproject-vs14-arm64-release-defaults.props" />
<Import Project="..\..\..\build\vs\pjproject-vs14-release-dynamic-defaults.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>14.0.22823.1</_ProjectFileVersion>
<OutDir>..\..\lib\</OutDir>
</PropertyGroup>
<!-- Compile and link option definition -->
<ItemDefinitionGroup>
<ClCompile>
<RuntimeLibrary Condition="'$(API_Family)'=='UWP'">MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'">
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>../../../pjlib/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
</ClCompile>
<Lib>
<OutputFile>..\..\lib\$(ProjectName)-$(TargetCPU)-$(Platform)-vc$(VSVer)-$(Configuration).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\milenage\milenage.c" />
<ClCompile Include="..\..\milenage\rijndael.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\milenage\milenage.h" />
<ClInclude Include="..\..\milenage\rijndael.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
``` | /content/code_sandbox/third_party/build/milenage/libmilenage.vcxproj | xml | 2016-01-24T05:00:33 | 2024-08-16T03:31:21 | pjproject | pjsip/pjproject | 1,960 | 9,293 |
```xml
import { describe, it, expect } from "vitest";
import type { Item } from "src/types/item.js";
import { parseItem } from "../src/handlers/parse-item.js";
describe("parseItem", () => {
it("should convert a DBRecord into an Item", () => {
const record: DBRecord = [
{ stringValue: "abcd-1234-asfd-sdff" },
{ stringValue: "Test csv maker." },
{ stringValue: "js" },
{ stringValue: "in-progress" },
{ stringValue: "corepyle" },
{ longValue: 0 },
];
const item: Item = {
archived: false,
description: "Test csv maker.",
guide: "js",
id: "abcd-1234-asfd-sdff",
name: "corepyle",
status: "in-progress",
};
const actual = parseItem(record);
expect(actual).toEqual(item);
});
});
``` | /content/code_sandbox/javascriptv3/example_code/cross-services/aurora-serverless-app/tests/parse-item.unit.test.ts | xml | 2016-08-18T19:06:57 | 2024-08-16T18:59:44 | aws-doc-sdk-examples | awsdocs/aws-doc-sdk-examples | 9,298 | 209 |
```xml
<Window
x:Class="Microsoft.Deployment.Samples.EmbeddedUI.SetupWizard"
xmlns="path_to_url"
xmlns:x="path_to_url"
Title="Sample Embedded UI (WPF)"
Width="540"
Height="400"
Visibility="Visible">
<Grid>
<TextBox
Name="messagesTextBox"
Margin="8,8,8,63"
FontFamily="Lucida Console"
FontSize="10"
HorizontalScrollBarVisibility="Auto"
IsReadOnly="True"
VerticalScrollBarVisibility="Visible" />
<Button
Name="installButton"
Width="75"
Height="23"
Margin="0,0,91,8"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="installButton_Click">
Install
</Button>
<Button
Name="exitButton"
Width="75"
Height="23"
Margin="0,0,8,8"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="exitButton_Click"
Visibility="Hidden">
Exit
</Button>
<Button
Name="cancelButton"
Width="75"
Height="23"
Margin="0,0,8,8"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Click="cancelButton_Click">
Cancel
</Button>
<ProgressBar
Name="progressBar"
Height="16"
Margin="8,0,8,39"
VerticalAlignment="Bottom"
IsIndeterminate="False"
Visibility="Hidden" />
<Label
Name="progressLabel"
Width="120"
Height="28"
Margin="8,0,0,4.48"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Visibility="Hidden">
0%
</Label>
</Grid>
</Window>
``` | /content/code_sandbox/Source/src/WixSharp.Samples/Wix# Samples/Custom_UI/EmbeddedUI_WPF/SetupWizard.xaml | xml | 2016-01-16T05:51:01 | 2024-08-16T12:26:25 | wixsharp | oleg-shilo/wixsharp | 1,077 | 406 |
```xml
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ListensToFluxStore, RetinaImg, KeyCommandsRegion } from 'mailspring-component-kit';
import {
localized,
Actions,
FocusedPerspectiveStore,
WorkspaceStore,
MailboxPerspective,
AccountStore,
} from 'mailspring-exports';
import SearchStore from './search-store';
import TokenizingContenteditable from './tokenizing-contenteditable';
import {
LearnMoreURL,
TokenSuggestions,
TokenSuggestionsForEmpty,
TokenAndTermRegexp,
getCurrentTokenAndTerm,
getContactSuggestions,
getThreadSuggestions,
wrapInQuotes,
} from './search-bar-util';
interface ThreadSearchBarProps {
query: string;
isSearching: boolean;
perspective: MailboxPerspective;
}
interface ThreadSearchBarState {
suggestions: {
token: string;
term: string;
description: string;
termSuggestions: string[] | ((term: string, accountIds: string[]) => Promise<any>);
}[];
focused: boolean;
selected?: {
description: any;
};
selectedIdx: number;
}
class ThreadSearchBar extends Component<ThreadSearchBarProps, ThreadSearchBarState> {
static displayName = 'ThreadSearchBar';
static propTypes = {
query: PropTypes.string,
isSearching: PropTypes.bool,
perspective: PropTypes.object,
};
_fieldEl: TokenizingContenteditable;
constructor(props) {
super(props);
this.state = {
suggestions: TokenSuggestionsForEmpty,
focused: false,
selected: null,
selectedIdx: -1,
};
}
componentWillReceiveProps(nextProps) {
if (nextProps.query !== this.props.query) {
this._generateSuggestionsForQuery(nextProps.query);
}
}
_initialQueryForPerspective() {
const { perspective } = this.props;
// When the inbox is focused we don't specify a folder scope. If the user
// wants to search just the inbox then they have to specify it explicitly.
if ('starred' in perspective) {
return 'is:starred ';
}
if ('unread' in perspective) {
return 'is:unread in:inbox ';
}
if (perspective.isInbox()) {
return '';
}
const rolesAndPaths = [
...new Set(perspective.categories().map(c => c.role || wrapInQuotes(c.path))),
];
if (rolesAndPaths.length > 1) {
return `(in:${rolesAndPaths.join(' OR in:')}) `;
} else if (rolesAndPaths.length === 1) {
return `in:${rolesAndPaths[0]} `;
} else {
return '';
}
}
async _generateSuggestionsForQuery(query) {
let insertionIndex = this._fieldEl.insertionIndex();
// Treat the initial query (eg: "in:starred AND ") as if it's
// not there, so the user sees the empty string case at first, etc.
const initialQuery = this._initialQueryForPerspective();
if (query.startsWith(initialQuery)) {
query = query.substr(initialQuery.length);
insertionIndex -= initialQuery.length;
}
const { token, term } = getCurrentTokenAndTerm(query, insertionIndex);
const accountIds = this.props.perspective.accountIds;
const promises = [];
let suggestions = [];
if (token) {
// show token autocompletion options ala Stripe Dashboard
suggestions = TokenSuggestions.filter(s => s.token.startsWith(token));
if (suggestions.length && suggestions[0].token === token) {
const { termSuggestions } = suggestions[0];
const textToSuggestion = term => ({
term: wrapInQuotes(term),
description: term.includes(' ') ? wrapInQuotes(term) : term,
token,
});
if (termSuggestions instanceof Function) {
suggestions = [];
promises.push(
termSuggestions(term, accountIds).then(results => {
suggestions.push(...results.map(textToSuggestion));
})
);
} else {
suggestions = termSuggestions
.filter(t => !term || (t.startsWith(term) && t !== term))
.map(textToSuggestion);
}
}
} else if (query.length === 0) {
// show all token autocompletion options before the user starts typing
suggestions = TokenSuggestionsForEmpty;
} else if (query.length > 2 && TokenAndTermRegexp().test(query.trim()) === false) {
// show thread and contact suggestions ala Gmail
suggestions = [];
promises.push(
Promise.props({
subjects: getThreadSuggestions(query, accountIds).then(threads =>
threads.map(t => ({
token: null,
term: wrapInQuotes(t.subject),
description: t.subject,
thread: t,
}))
),
contacts: getContactSuggestions(query, accountIds).then(results =>
results.map(term => ({ token: null, term: wrapInQuotes(term), description: term }))
),
}).then(({ contacts, subjects }) => {
suggestions = [...contacts, ...subjects].sort((a, b) => {
let aM = a.description.toLowerCase().indexOf(query);
let bM = b.description.toLowerCase().indexOf(query);
if (aM === -1) aM = 10000;
if (bM === -1) bM = 10000;
return aM - bM;
});
if (suggestions.length > 10) {
suggestions.length = 10;
}
})
);
}
if (promises.length) {
await Promise.all(promises);
this._setSuggestionState(suggestions);
} else {
this._setSuggestionState(suggestions);
}
}
_onFocus = e => {
this.setState({ focused: true });
if (this.props.query === '') {
this._onSearchQueryChanged(this._initialQueryForPerspective());
window.requestAnimationFrame(() => this._fieldEl.focus());
}
};
_onBlur = e => {
this.setState({ focused: false });
if (this.props.query === this._initialQueryForPerspective()) {
this._onSearchQueryChanged('');
}
};
_onKeyDown = e => {
const { suggestions, selected, selectedIdx } = this.state;
const delta = { 40: 1, 38: -1 }[e.keyCode];
if (delta) {
e.preventDefault();
const nextIdx = Math.min(suggestions.length - 1, Math.max(0, selectedIdx + delta));
this.setState({
selectedIdx: nextIdx,
selected: suggestions[nextIdx],
});
}
if (e.keyCode === 27) {
// escape
e.preventDefault();
this._onClearSearchQuery(e);
}
if (e.keyCode === 13) {
// return
e.preventDefault();
if (selected) {
this._onChooseSuggestion(selected);
} else {
this._onSubmitSearchQuery(this.props.query);
}
}
};
_onChooseSuggestion = suggestion => {
const { query } = this.props;
let nextQuery = null;
// If the user has the cursor inside an existing token, replace it. If the query ends
// in a space, append a new token. Otherwise replace the whole string.
let { index, length } = getCurrentTokenAndTerm(query, this._fieldEl.insertionIndex());
if (index === -1 && query.endsWith(' ')) {
index = query.length;
length = 0;
}
if (suggestion.token) {
nextQuery = [
query.substr(0, index).trim(),
`${suggestion.token}:${suggestion.term}`,
query.substr(index + length).trim(),
]
.filter(s => s.length)
.join(' ');
} else {
nextQuery = suggestion.term;
}
if (!nextQuery.endsWith(' ')) {
nextQuery = nextQuery + ' ';
}
if (suggestion.term) {
this._onSubmitSearchQuery(nextQuery);
} else {
this._onSearchQueryChanged(nextQuery);
}
if (suggestion.thread && WorkspaceStore.layoutMode() !== 'list') {
Actions.setFocus({ collection: 'thread', item: suggestion.thread });
}
};
_onSearchQueryChanged = async query => {
if (query === this.props.query) {
return;
}
Actions.searchQueryChanged(query);
if (query === '') {
this._onClearSearchQuery();
}
};
_setSuggestionState = suggestions => {
const sameItemIdx = suggestions.findIndex(
s => this.state.selected && s.description === this.state.selected.description
);
const backupIdx = Math.max(-1, Math.min(this.state.selectedIdx, suggestions.length - 1));
const selectedIdx = sameItemIdx !== -1 ? sameItemIdx : backupIdx;
this.setState({
suggestions: suggestions,
selectedIdx: selectedIdx,
selected: selectedIdx !== -1 ? suggestions[selectedIdx] : null,
});
};
_onSubmitSearchQuery = nextQuery => {
Actions.searchQuerySubmitted(nextQuery);
this._fieldEl.blur();
};
_onClearSearchQuery = (e?: React.MouseEvent) => {
if (this.props.query !== '') {
Actions.searchQuerySubmitted('');
} else {
this._fieldEl.blur();
}
if (e) {
e.stopPropagation();
e.preventDefault();
}
};
_placeholder = () => {
if (this._initialQueryForPerspective() === '') {
const countMailboxes = FocusedPerspectiveStore.current()?.accountIds?.length || 0;
if (countMailboxes == 1) {
const account = AccountStore.accountForId(FocusedPerspectiveStore.current().accountIds[0]);
return localized('Search') + ' ' + account.label;
} else {
return localized('Search all mailboxes');
}
}
return localized(`Search`) + ' ' + this.props.perspective.name || '';
};
render() {
const { query, isSearching, perspective } = this.props;
const { suggestions, selectedIdx } = this.state;
const showPlaceholder = !this.state.focused && !query;
const showX = this.state.focused || !!(perspective as any).searchQuery;
return (
<KeyCommandsRegion
className={`thread-search-bar ${showPlaceholder ? 'placeholder' : ''}`}
globalHandlers={{
'core:focus-search': () => {
// If the user is in list mode, we need to clear the selection because the
// thread action bar appears over the search bar. Kind of a hack.
if (WorkspaceStore.layoutMode() === 'list') {
AppEnv.commands.dispatch('multiselect-list:deselect-all');
}
Actions.popSheet();
this._fieldEl.focus();
},
}}
>
{isSearching ? (
<RetinaImg
className="search-accessory search loading"
name="inline-loading-spinner.gif"
mode={RetinaImg.Mode.ContentPreserve}
/>
) : (
<RetinaImg
className="search-accessory search"
name="searchloupe.png"
mode={RetinaImg.Mode.ContentDark}
onClick={() => this._fieldEl.focus()}
/>
)}
<TokenizingContenteditable
ref={el => (this._fieldEl = el)}
value={showPlaceholder ? this._placeholder() : query}
onKeyDown={this._onKeyDown}
onFocus={this._onFocus}
onBlur={this._onBlur}
onChange={this._onSearchQueryChanged}
/>
{showX && (
<RetinaImg
name="searchclear.png"
className="search-accessory clear"
mode={RetinaImg.Mode.ContentDark}
onMouseDown={this._onClearSearchQuery}
/>
)}
{this.state.suggestions.length > 0 &&
this.state.focused && (
<div className="suggestions">
{suggestions.map((s, idx) => (
<div
onMouseDown={e => {
this._onChooseSuggestion(s);
e.preventDefault();
}}
className={`suggestion ${selectedIdx === idx ? 'selected' : ''}`}
key={idx}
>
{s.token && <span className="suggestion-token">{s.token}: </span>}
{s.description}
</div>
))}
{suggestions === TokenSuggestionsForEmpty && (
<div className="footer">
{localized(
'Pro tip: Combine search terms with AND and OR to create complex queries.'
)}{' '}
<a
onMouseDown={e => {
AppEnv.windowEventHandler.openLink({
href: LearnMoreURL,
metaKey: e.metaKey,
});
e.preventDefault();
}}
>
{localized('Learn more')} >
</a>
</div>
)}
</div>
)}
</KeyCommandsRegion>
);
}
}
export default ListensToFluxStore(ThreadSearchBar, {
stores: [SearchStore, FocusedPerspectiveStore],
getStateFromStores() {
return {
query: SearchStore.query(),
isSearching: SearchStore.isSearching(),
perspective: FocusedPerspectiveStore.current(),
};
},
});
``` | /content/code_sandbox/app/internal_packages/thread-search/lib/thread-search-bar.tsx | xml | 2016-10-13T06:45:50 | 2024-08-16T18:14:37 | Mailspring | Foundry376/Mailspring | 15,331 | 2,884 |
```xml
import { SodiumStateAddress } from './SodiumStateAddress'
export type StreamDecryptor = {
state: SodiumStateAddress
}
``` | /content/code_sandbox/packages/sncrypto-common/src/Types/StreamDecryptor.ts | xml | 2016-12-05T23:31:33 | 2024-08-16T06:51:19 | app | standardnotes/app | 5,180 | 29 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "path_to_url">
<plist version="1.0">
<dict>
<key>#DisableDrivers</key>
<array>
<string>CsmVideoDxe</string>
<string>VBoxExt4</string>
</array>
<key>ACPI</key>
<dict>
<key>AutoMerge</key>
<true/>
<key>#DropMCFG</key>
<false/>
<key>#PatchAPIC</key>
<false/>
<key>#ResetAddress</key>
<string>0x64</string>
<key>#ResetValue</key>
<string>0xFE</string>
<key>#SortedOrder</key>
<array>
<string>SSDT-3.aml</string>
<string>SSDT-1.aml</string>
<string>SSDT-2.aml</string>
</array>
<key>#smartUPS</key>
<false/>
<key>DSDT</key>
<dict>
<key>#DropOEM_DSM</key>
<dict>
<key>ATI</key>
<true/>
<key>Firewire</key>
<true/>
<key>HDA</key>
<true/>
<key>HDMI</key>
<true/>
<key>IDE</key>
<true/>
<key>IntelGFX</key>
<true/>
<key>LAN</key>
<true/>
<key>LPC</key>
<false/>
<key>NVidia</key>
<true/>
<key>SATA</key>
<true/>
<key>SmBUS</key>
<false/>
<key>USB</key>
<true/>
<key>WIFI</key>
<true/>
</dict>
<key>#Patches</key>
<array>
<dict>
<key>Comment</key>
<string>Remove battery device from desktop</string>
<key>Find</key>
<data>W4IeQkFUMQhfSElEDEHQDAoIX1VJRAEUCF9TVEEApAA=</data>
<key>Replace</key>
<data></data>
</dict>
<dict>
<key>Comment</key>
<string>Add _SUN property for GIGE</string>
<key>Find</key>
<data>UFhTWAhfQURSAAhfUFJXEgYC</data>
<key>Replace</key>
<data>UFhTWAhfQURSAAhfU1VOCgQIX1BSVxIGAg==</data>
</dict>
<dict>
<key>Comment</key>
<string>Rename GFX0 to IGPU</string>
<key>Find</key>
<data>R0ZYMA==</data>
<key>Replace</key>
<data>SUdQVQ==</data>
</dict>
<dict>
<key>Comment</key>
<string>Rename HDEF to AZAL</string>
<key>Find</key>
<data>SERFRg==</data>
<key>Replace</key>
<data>QVpBTA==</data>
</dict>
</array>
<key>#Rtc8Allowed</key>
<false/>
<key>#SuspendOverride</key>
<false/>
<key>Debug</key>
<false/>
<key>Fixes</key>
<dict>
<key>AddDTGP</key>
<true/>
<key>AddHDMI</key>
<true/>
<key>AddIMEI</key>
<false/>
<key>AddMCHC</key>
<false/>
<key>AddPNLF</key>
<true/>
<key>DeleteUnused</key>
<true/>
<key>FixACST</key>
<true/>
<key>FixADP1</key>
<true/>
<key>FixIntelGfx</key>
<false/>
<key>FixRTC</key>
<true/>
<key>FixS3D</key>
<true/>
<key>FixTMR</key>
<true/>
<key>FixWAK</key>
<true/>
<key>FakeLPC</key>
<false/>
<key>FixAirport</key>
<false/>
<key>FixDarwin</key>
<false/>
<key>FixDarwin7</key>
<true/>
<key>FixDisplay</key>
<true/>
<key>FixFirewire</key>
<false/>
<key>FixHDA</key>
<true/>
<key>FixHPET</key>
<true/>
<key>FixHeaders</key>
<true/>
<key>FixIDE</key>
<false/>
<key>FixIPIC</key>
<true/>
<key>FixLAN</key>
<true/>
<key>FixRegions</key>
<true/>
<key>FixSATA</key>
<false/>
<key>FixSBUS</key>
<true/>
<key>FixShutdown</key>
<true/>
<key>FixUSB</key>
<true/>
<key>FixMutex</key>
<true/>
</dict>
<key>Name</key>
<string>DSDT.aml</string>
<key>ReuseFFFF</key>
<false/>
</dict>
<key>DisableASPM</key>
<false/>
<key>DropTables</key>
<array>
<dict>
<key>Signature</key>
<string>DMAR</string>
</dict>
<dict>
<key>Signature</key>
<string>SSDT</string>
<key>TableId</key>
<string>CpuPm</string>
</dict>
<dict>
<key>#Length</key>
<integer>720</integer>
<key>Signature</key>
<string>SSDT</string>
<key>TableId</key>
<string>Cpu0Ist</string>
</dict>
</array>
<key>HaltEnabler</key>
<true/>
<key>SSDT</key>
<dict>
<key>#C3Latency</key>
<string>0x03E7</string>
<key>#DoubleFirstState</key>
<true/>
<key>#DropOem</key>
<true/>
<key>#EnableC2</key>
<false/>
<key>#EnableC4</key>
<false/>
<key>#EnableC6</key>
<true/>
<key>#EnableC7</key>
<false/>
<key>#MaxMultiplier</key>
<integer>12</integer>
<key>#MinMultiplier</key>
<integer>8</integer>
<key>#NoOemTableId</key>
<false/>
<key>#PLimitDict</key>
<integer>1</integer>
<key>#PluginType</key>
<integer>0</integer>
<key>#UnderVoltStep</key>
<integer>1</integer>
<key>#UseSystemIO</key>
<false/>
<key>Generate</key>
<dict>
<key>CStates</key>
<true/>
<key>PStates</key>
<true/>
<key>#APLF</key>
<true/>
<key>#APSN</key>
<true/>
<key>#PluginType</key>
<true/>
</dict>
</dict>
</dict>
<key>Boot</key>
<dict>
<key>##Arguments</key>
<string>kext-dev-mode=1 rootless=0</string>
<key>#Arguments</key>
<string>-v arch=x86_64 slide=0 darkwake=0</string>
<key>#LegacyBiosDefaultEntry</key>
<integer>0</integer>
<key>#XMPDetection</key>
<string>-1</string>
<key>Debug</key>
<false/>
<key>DefaultLoader</key>
<string>boot.efi</string>
<key>DefaultVolume</key>
<string>LastBootedVolume</string>
<key>DisableCloverHotkeys</key>
<false/>
<key>Fast</key>
<false/>
<key>Legacy</key>
<string>PBR</string>
<key>NeverDoRecovery</key>
<true/>
<key>NeverHibernate</key>
<false/>
<key>SkipHibernateTimeout</key>
<false/>
<key>StrictHibernate</key>
<false/>
<key>Timeout</key>
<integer>5</integer>
</dict>
<key>BootGraphics</key>
<dict>
<key>#DefaultBackgroundColor</key>
<string>0xF0F0F0</string>
<key>EFILoginHiDPI</key>
<integer>1</integer>
<key>UIScale</key>
<integer>1</integer>
</dict>
<key>CPU</key>
<dict>
<key>#BusSpeedkHz</key>
<integer>133330</integer>
<key>#FrequencyMHz</key>
<integer>3140</integer>
<key>#HWPEnable</key>
<true/>
<key>#HWPValue</key>
<string>0x30002a01</string>
<key>#QPI</key>
<integer>4800</integer>
<key>#SavingMode</key>
<integer>7</integer>
<key>#TDP</key>
<integer>95</integer>
<key>#TurboDisable</key>
<true/>
<key>#Type</key>
<string>0x0201</string>
<key>#UseARTFrequency</key>
<true/>
</dict>
<key>Devices</key>
<dict>
<key>#AddProperties</key>
<array>
<dict>
<key>Device</key>
<string>NVidia</string>
<key>Key</key>
<string>AAPL,HasPanel</string>
<key>Value</key>
<data>AQAAAA==</data>
</dict>
<dict>
<key>Device</key>
<string>NVidia</string>
<key>Key</key>
<string>AAPL,Haslid</string>
<key>Value</key>
<data>AQAAAA==</data>
</dict>
</array>
<key>#FakeID</key>
<dict>
<key>#ATI</key>
<string>0x67501002</string>
<key>#IMEI</key>
<string>0x1e208086</string>
<key>#IntelGFX</key>
<string>0x01268086</string>
<key>#LAN</key>
<string>0x100E8086</string>
<key>#NVidia</key>
<string>0x11de10de</string>
<key>#SATA</key>
<string>0x25628086</string>
<key>#WIFI</key>
<string>0x431214e4</string>
<key>#XHCI</key>
<string>0x0</string>
</dict>
<key>#ForceHPET</key>
<false/>
<key>#Inject</key>
<false/>
<key>#Properties</key>
<string>your_sha256_hashyour_sha256_hashyour_sha256_hash610079006f00750074002d00690064000000080000000c000000</string>
<key>#SetIntelBacklight</key>
<false/>
<key>#SetIntelMaxBacklight</key>
<true/>
<key>#IntelMaxValue</key>
<integer>1808</integer>
<key>Audio</key>
<dict>
<key>#Inject</key>
<string>0x0887</string>
<key>ResetHDA</key>
<true/>
</dict>
<key>NoDefaultProperties</key>
<false/>
<key>USB</key>
<dict>
<key>AddClockID</key>
<true/>
<key>FixOwnership</key>
<true/>
<key>HighCurrent</key>
<false/>
<key>Inject</key>
<true/>
</dict>
<key>UseIntelHDMI</key>
<false/>
</dict>
<key>GUI</key>
<dict>
<key>#ConsoleMode</key>
<string>0</string>
<key>#Custom</key>
<dict>
<key>Entries</key>
<array>
<dict>
<key>AddArguments</key>
<string>-v</string>
<key>Arguments</key>
<string>Kernel=mach_kernel</string>
<key>Disabled</key>
<true/>
<key>Hidden</key>
<false/>
<key>Hotkey</key>
<string>M</string>
<key>InjectKexts</key>
<false/>
<key>NoCaches</key>
<false/>
<key>Path</key>
<string>\EFI\BOOT\BOOTX64.efi</string>
<key>Title</key>
<string>MyCustomEntry</string>
<key>Type</key>
<string>OSXRecovery</string>
<key>Volume</key>
<string>D68F1885-571C-4441-8DD5-F14803EFEF54</string>
</dict>
<dict>
<key>Hidden</key>
<false/>
<key>InjectKexts</key>
<false/>
<key>NoCaches</key>
<false/>
<key>SubEntries</key>
<array>
<dict>
<key>AddArguments</key>
<string>-v</string>
<key>Title</key>
<string>Boot OS X 10.8.5 (12F36) Mountain Lion in Verbose Mode</string>
</dict>
</array>
<key>Title</key>
<string>OS X 10.8.5 (12F36) Mountain Lion</string>
<key>Type</key>
<string>OSX</string>
<key>Volume</key>
<string>454794AC-760D-46E8-8F77-D6EB23D2FD32</string>
</dict>
</array>
<key>Legacy</key>
<array>
<dict>
<key>Disabled</key>
<true/>
<key>Hidden</key>
<false/>
<key>Hotkey</key>
<string>L</string>
<key>Title</key>
<string>MyLegacyEntry</string>
<key>Type</key>
<string>Windows</string>
<key>Volume</key>
<string>89433CD3-21F2-4D3C-95FC-722C48066D3A</string>
</dict>
</array>
<key>Tool</key>
<array>
<dict>
<key>Arguments</key>
<string>-b</string>
<key>Disabled</key>
<false/>
<key>Hidden</key>
<false/>
<key>Hotkey</key>
<string>S</string>
<key>Path</key>
<string>\EFI\CLOVER\TOOLS\Shell64-v1.efi</string>
<key>Title</key>
<string>MyCustomShell</string>
<key>Volume</key>
<string>D68F1885-571C-4441-8DD5-F14803EFEF54</string>
</dict>
</array>
</dict>
<key>#CustomIcons</key>
<false/>
<key>#Hide</key>
<array>
<string>Windows</string>
<string>BOOTX64.EFI</string>
</array>
<key>#Language</key>
<string>ru:0</string>
<key>#Mouse</key>
<dict>
<key>Enabled</key>
<true/>
<key>Mirror</key>
<false/>
<key>Speed</key>
<integer>2</integer>
</dict>
<key>#Scan</key>
<dict>
<key>Entries</key>
<true/>
<key>Legacy</key>
<false/>
<key>Tool</key>
<true/>
</dict>
<key>#TextOnly</key>
<false/>
<key>ScreenResolution</key>
<string>1280x1024</string>
<key>ShowOptimus</key>
<false/>
<key>Theme</key>
<string>metal</string>
</dict>
<key>Graphics</key>
<dict>
<key>#Connectors</key>
<array/>
<key>#DualLink</key>
<integer>0</integer>
<key>#FBName</key>
<string>Makakakakala</string>
<key>#Inject</key>
<dict>
<key>ATI</key>
<true/>
<key>Intel</key>
<false/>
<key>NVidia</key>
<false/>
</dict>
<key>#LoadVBios</key>
<false/>
<key>#NVCAP</key>
<string>04000000000003000C0000000000000A00000000</string>
<key>#NvidiaGeneric</key>
<true/>
<key>#NvidiaNoEFI</key>
<false/>
<key>#NvidiaSingle</key>
<false/>
<key>#PatchVBios</key>
<false/>
<key>#PatchVBiosBytes</key>
<array>
<dict>
<key>Find</key>
<data>gAeoAqAF</data>
<key>Replace</key>
<data>gAeoAjgE</data>
</dict>
</array>
<key>#VRAM</key>
<integer>1024</integer>
<key>#VideoPorts</key>
<integer>2</integer>
<key>#display-cfg</key>
<string>03010300FFFF0001</string>
<key>#ig-platform-id</key>
<string>0x01620005</string>
<key>EDID</key>
<dict>
<key>#Custom</key>
<data>AP///////your_sha256_hashiGgcFCEHzAgIFYAS88QAAAY3iGgcFCEHzAgIFYAS88QAAAAAAAA/gBXNjU3RwAxNTRXUDEKAAAA/gAjMz1IZYSq/wIBCiAgAJo=</data>
<key>#Inject</key>
<true/>
<key>#ProductID</key>
<string>0x9221</string>
<key>#VendorID</key>
<string>0x1006</string>
</dict>
</dict>
<key>KernelAndKextPatches</key>
<dict>
<key>#ATIConnectorsController</key>
<string>6000</string>
<key>#ATIConnectorsData</key>
<string>your_sha256_hash10000000100000000001000000000001</string>
<key>#ATIConnectorsPatch</key>
<string>your_sha256_hash00000000000000000000000000000000</string>
<key>#BootPatches</key>
<array>
<dict>
<key>Comment</key>
<string>Example</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>RXh0ZXJuYWw=</data>
<key>MatchOS</key>
<string>All</string>
<key>Replace</key>
<data>SW50ZXJuYWw=</data>
</dict>
</array>
<key>#FakeCPUID</key>
<string>0x010676</string>
<key>#KextsToPatch</key>
<array>
<dict>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>SGVhZHBob25lcwA=</data>
<key>Name</key>
<string>VoodooHDA</string>
<key>Replace</key>
<data>VGVsZXBob25lcwA=</data>
</dict>
<dict>
<key>Comment</key>
<string>Patch_to_not_load_this_driver</string>
<key>Find</key>
<string>0x04020000</string>
<key>InfoPlistPatch</key>
<true/>
<key>Name</key>
<string>AppleHDAController</string>
<key>Replace</key>
<string>0x44220000</string>
</dict>
<dict>
<key>Comment</key>
<string>Make all drives to be internal</string>
<key>Find</key>
<data>RXh0ZXJuYWw=</data>
<key>Name</key>
<string>AppleAHCIPort</string>
<key>Replace</key>
<data>SW50ZXJuYWw=</data>
</dict>
<dict>
<key>Comment</key>
<string>TRIM function for non-Apple SSDs</string>
<key>Find</key>
<data>QVBQTEUgU1NEAA==</data>
<key>Name</key>
<string>IOAHCIBlockStorage</string>
<key>Replace</key>
<data>AAAAAAAAAAAAAA==</data>
</dict>
<dict>
<key>Comment</key>
<string>ATI Connector patch new way</string>
<key>Disabled</key>
<false/>
<key>Find</key>
<data>your_sha256_hash</data>
<key>MatchOS</key>
<string>10.9,10.10,10.11</string>
<key>Name</key>
<string>AMD6000Controller</string>
<key>Replace</key>
<data>your_sha256_hash</data>
</dict>
</array>
<key>AppleIntelCPUPM</key>
<false/>
<key>AppleRTC</key>
<true/>
<key>AsusAICPUPM</key>
<false/>
<key>Debug</key>
<false/>
<key>DellSMBIOSPatch</key>
<false/>
<key>KernelCpu</key>
<false/>
<key>KernelIvyXCPM</key>
<false/>
<key>KernelLapic</key>
<false/>
<key>KernelPm</key>
<false/>
</dict>
<key>RtVariables</key>
<dict>
<key>BooterConfig</key>
<string>0x28</string>
<key>CsrActiveConfig</key>
<string>0x3E7</string>
<key>MLB</key>
<string>C02032109R5DC771H</string>
<key>ROM</key>
<string>UseMacAddr0</string>
</dict>
<key>SMBIOS</key>
<dict>
<key>#BiosReleaseDate</key>
<string>05/03/10</string>
<key>#BiosVendor</key>
<string>Apple Inc.</string>
<key>#BiosVersion</key>
<string>MB11.88Z.0061.B03.0809221748</string>
<key>#Board-ID</key>
<string>Mac-F4208CC8</string>
<key>#BoardManufacturer</key>
<string>Apple Inc.</string>
<key>#BoardSerialNumber</key>
<string>C02032101R5DC771H</string>
<key>#BoardType</key>
<integer>10</integer>
<key>#BoardVersion</key>
<string>Proto1</string>
<key>#ChassisAssetTag</key>
<string>LatitudeD420</string>
<key>#ChassisManufacturer</key>
<string>Apple Inc.</string>
<key>#ChassisType</key>
<integer>16</integer>
<key>#Family</key>
<string>MacBook</string>
<key>#FirmwareFeatures</key>
<string>0xC0001403</string>
<key>#FirmwareFeaturesMask</key>
<string>0xFFFFFFFF</string>
<key>#LocationInChassis</key>
<string>MLB</string>
<key>#Memory</key>
<dict>
<key>Channels</key>
<integer>2</integer>
<key>Modules</key>
<array>
<dict>
<key>Frequency</key>
<integer>1333</integer>
<key>Part</key>
<string>C0001403</string>
<key>Serial</key>
<string>00001001</string>
<key>Size</key>
<integer>4096</integer>
<key>Slot</key>
<integer>0</integer>
<key>Type</key>
<string>DDR3</string>
<key>Vendor</key>
<string>Kingston</string>
</dict>
<dict>
<key>Frequency</key>
<integer>1333</integer>
<key>Part</key>
<string>C0001404</string>
<key>Serial</key>
<string>00001002</string>
<key>Size</key>
<integer>4096</integer>
<key>Slot</key>
<integer>2</integer>
<key>Type</key>
<string>DDR3</string>
<key>Vendor</key>
<string>Kingston</string>
</dict>
</array>
<key>SlotCount</key>
<integer>4</integer>
</dict>
<key>#Mobile</key>
<true/>
<key>#PlatformFeature</key>
<string>0x03</string>
<key>#ProductName</key>
<string>MacBook1,1</string>
<key>#SerialNumber</key>
<string>4H629LYAU9C</string>
<key>#Slots</key>
<array>
<dict>
<key>Device</key>
<string>ATI</string>
<key>ID</key>
<integer>1</integer>
<key>Name</key>
<string>PCIe Slot 0</string>
<key>Type</key>
<integer>16</integer>
</dict>
<dict>
<key>Device</key>
<string>WIFI</string>
<key>ID</key>
<integer>0</integer>
<key>Name</key>
<string>Airport</string>
<key>Type</key>
<integer>1</integer>
</dict>
</array>
<key>#SmUUID</key>
<string>00000000-0000-1000-8000-010203040506</string>
<key>#Trust</key>
<true/>
<key>#Version</key>
<string>1.0</string>
<key>Manufacturer</key>
<string>Apple Inc.</string>
</dict>
<key>SystemParameters</key>
<dict>
<key>#BacklightLevel</key>
<string>0x0501</string>
<key>#CustomUUID</key>
<string>511CE201-1000-4000-9999-010203040506</string>
<key>#NvidiaWeb</key>
<false/>
<key>InjectKexts</key>
<string>Detect</string>
<key>InjectSystemID</key>
<true/>
</dict>
</dict>
</plist>
``` | /content/code_sandbox/Clover-Configs/Lenovo/IdeaPad 300s/CLOVER/OEM/SystemProductName/UEFI/config-sample.plist | xml | 2016-11-05T04:22:54 | 2024-08-12T19:25:53 | Hackintosh-Installer-University | huangyz0918/Hackintosh-Installer-University | 3,937 | 7,192 |
```xml
import { ComponentProps } from 'react';
import { Button } from '@@/buttons';
import { ButtonOptions } from './types';
export function buildConfirmButton(
label = 'Confirm',
color: ComponentProps<typeof Button>['color'] = 'primary',
timeout = 0,
dataCy = 'modal-confirm-button'
): ButtonOptions<true> {
return { label, color, value: true, timeout, dataCy };
}
export function buildCancelButton(
label = 'Cancel',
dataCy = 'modal-cancel-button'
): ButtonOptions<false> {
return {
label,
color: 'default',
value: false,
dataCy,
};
}
``` | /content/code_sandbox/app/react/components/modals/utils.ts | xml | 2016-05-19T20:15:28 | 2024-08-16T19:15:14 | portainer | portainer/portainer | 30,083 | 146 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="InstallationsExampleSwift" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pur-Ny-tHx">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="TlM-dv-Q2o">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="hld-P4-Gla">
<rect key="frame" x="0.0" y="0.0" width="375" height="90"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VQv-gV-AF6">
<rect key="frame" x="8" y="20" width="359" height="50"/>
<state key="normal" title="Get Installation"/>
<connections>
<action selector="getInstallationButtonPressed" destination="BYZ-38-t0r" eventType="touchUpInside" id="aYW-RF-e06"/>
</connections>
</button>
</subviews>
<edgeInsets key="layoutMargins" top="20" left="8" bottom="20" right="8"/>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="3f5-u5-X0F">
<rect key="frame" x="0.0" y="90" width="375" height="70"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Afz-67-w05">
<rect key="frame" x="8" y="20" width="359" height="30"/>
<state key="normal" title="Get Auth Token"/>
<connections>
<action selector="getAuthTokenButtonPressed" destination="BYZ-38-t0r" eventType="touchUpInside" id="96f-w5-4D1"/>
</connections>
</button>
</subviews>
<edgeInsets key="layoutMargins" top="20" left="8" bottom="20" right="8"/>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="nnt-fT-Qm4">
<rect key="frame" x="0.0" y="160" width="375" height="70"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="b7D-xJ-nwL">
<rect key="frame" x="8" y="20" width="359" height="30"/>
<state key="normal" title="Delete Installation"/>
<connections>
<action selector="deleteInstallationButtonPressed" destination="BYZ-38-t0r" eventType="touchUpInside" id="Nmi-zK-KEs"/>
</connections>
</button>
</subviews>
<edgeInsets key="layoutMargins" top="20" left="8" bottom="20" right="8"/>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="X1f-U1-S3b">
<rect key="frame" x="0.0" y="230" width="375" height="437"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="MDD-Rz-oCk">
<rect key="frame" x="8" y="20" width="359" height="397"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="200" id="y0N-EZ-79s"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
</subviews>
<edgeInsets key="layoutMargins" top="20" left="8" bottom="20" right="8"/>
</stackView>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="pur-Ny-tHx" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="OQe-3j-Ii6"/>
<constraint firstItem="pur-Ny-tHx" firstAttribute="trailing" secondItem="6Tk-OE-BBY" secondAttribute="trailing" id="Xrt-Wb-d1M"/>
<constraint firstItem="pur-Ny-tHx" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="elL-19-DfX"/>
<constraint firstItem="pur-Ny-tHx" firstAttribute="bottom" secondItem="6Tk-OE-BBY" secondAttribute="bottom" id="o6u-an-bxc"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="deleteInstallationButton" destination="b7D-xJ-nwL" id="9ku-yy-nyA"/>
<outlet property="getAuthTokenButton" destination="Afz-67-w05" id="pRC-rP-qMQ"/>
<outlet property="getInstallationButton" destination="VQv-gV-AF6" id="3Lj-kq-yXc"/>
<outlet property="logTextView" destination="MDD-Rz-oCk" id="C9b-EP-h4L"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="136.80000000000001" y="132.68365817091455"/>
</scene>
</scenes>
</document>
``` | /content/code_sandbox/installations/InstallationsExampleSwift/Base.lproj/Main.storyboard | xml | 2016-04-26T17:13:37 | 2024-08-15T05:40:16 | quickstart-ios | firebase/quickstart-ios | 2,773 | 1,919 |
```xml
export const handler = async (event, context) => {
if (event.triggerSource === 'CustomMessage_SignUp') {
return handleVerifyUserEmail(event)
}
// TODO: CustomMessage_ForgotPassword
return event
}
function handleVerifyUserEmail(event) {
const { codeParameter, userAttributes } = event.request
const verifyLink = `path_to_url{encodeURIComponent(userAttributes.email)}&code=${codeParameter}`
const emailMessage = `<div style='text-align: center'>
<p>Please verify your email address to complete account setup.</p>
<p>Your verification code is</p>
<h3>${codeParameter}</h3>
<p>Navigate to <a href="${verifyLink}">${verifyLink}</a>.</p>
</div>`
event.response.emailMessage = emailMessage
event.response.emailSubject ='Verify your Todo account '
return event
}
``` | /content/code_sandbox/examples/lambda-function-url/packages/cognito/cognito-custom-message.ts | xml | 2016-09-13T23:29:07 | 2024-08-15T09:52:47 | serverless-express | CodeGenieApp/serverless-express | 5,117 | 195 |
```xml
import { describe, expect, it } from "vitest";
import { Formatter } from "@export/formatter";
import { createSolidFill } from "./solid-fill";
import { SchemeColor } from "./scheme-color";
describe("createSolidFill", () => {
it("should create of rgb", () => {
const tree = new Formatter().format(createSolidFill({ type: "rgb", value: "FFFFFF" }));
expect(tree).to.deep.equal({
"a:solidFill": [
{
"a:srgbClr": {
_attr: {
val: "FFFFFF",
},
},
},
],
});
});
it("should create of scheme", () => {
const tree = new Formatter().format(createSolidFill({ type: "scheme", value: SchemeColor.TX1 }));
expect(tree).to.deep.equal({
"a:solidFill": [
{
"a:schemeClr": {
_attr: {
val: "tx1",
},
},
},
],
});
});
});
``` | /content/code_sandbox/src/file/drawing/inline/graphic/graphic-data/pic/shape-properties/outline/solid-fill.spec.ts | xml | 2016-03-26T23:43:56 | 2024-08-16T13:02:47 | docx | dolanmiu/docx | 4,139 | 224 |
```xml
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>CalculatorForm</class>
<widget class="QWidget" name="CalculatorForm" >
<property name="objectName" >
<string notr="true" >CalculatorForm</string>
</property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string>Calculator Form</string>
</property>
<layout class="QGridLayout" >
<property name="objectName" >
<string notr="true" />
</property>
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="6" >
<spacer>
<property name="objectName" >
<string notr="true" >horizontalSpacer</string>
</property>
<property name="geometry" >
<rect>
<x>239</x>
<y>9</y>
<width>152</width>
<height>52</height>
</rect>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4" >
<widget class="QLabel" name="label_3_2" >
<property name="objectName" >
<string notr="true" >label_3_2</string>
</property>
<property name="geometry" >
<rect>
<x>169</x>
<y>9</y>
<width>20</width>
<height>52</height>
</rect>
</property>
<property name="text" >
<string>=</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="5" >
<layout class="QVBoxLayout" >
<property name="objectName" >
<string notr="true" />
</property>
<property name="margin" >
<number>1</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_2_2_2" >
<property name="objectName" >
<string notr="true" >label_2_2_2</string>
</property>
<property name="geometry" >
<rect>
<x>1</x>
<y>1</y>
<width>36</width>
<height>17</height>
</rect>
</property>
<property name="text" >
<string>Output</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="outputWidget" >
<property name="objectName" >
<string notr="true" >outputWidget</string>
</property>
<property name="geometry" >
<rect>
<x>1</x>
<y>24</y>
<width>36</width>
<height>27</height>
</rect>
</property>
<property name="frameShape" >
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="text" >
<string>0</string>
</property>
<property name="alignment" >
<set>Qt::AlignAbsolute|Qt::AlignBottom|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignHorizontal_Mask|Qt::AlignJustify|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing|Qt::AlignVCenter|Qt::AlignVertical_Mask</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="2" >
<spacer>
<property name="objectName" >
<string notr="true" >verticalSpacer</string>
</property>
<property name="geometry" >
<rect>
<x>89</x>
<y>67</y>
<width>20</width>
<height>224</height>
</rect>
</property>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3" >
<layout class="QVBoxLayout" >
<property name="objectName" >
<string notr="true" />
</property>
<property name="margin" >
<number>1</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_2" >
<property name="objectName" >
<string notr="true" >label_2</string>
</property>
<property name="geometry" >
<rect>
<x>1</x>
<y>1</y>
<width>46</width>
<height>19</height>
</rect>
</property>
<property name="text" >
<string>Input 2</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="inputSpinBox2" >
<property name="objectName" >
<string notr="true" >inputSpinBox2</string>
</property>
<property name="geometry" >
<rect>
<x>1</x>
<y>26</y>
<width>46</width>
<height>25</height>
</rect>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="label_3" >
<property name="objectName" >
<string notr="true" >label_3</string>
</property>
<property name="geometry" >
<rect>
<x>63</x>
<y>9</y>
<width>20</width>
<height>52</height>
</rect>
</property>
<property name="text" >
<string>+</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" >
<layout class="QVBoxLayout" >
<property name="objectName" >
<string notr="true" />
</property>
<property name="margin" >
<number>1</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="objectName" >
<string notr="true" >label</string>
</property>
<property name="geometry" >
<rect>
<x>1</x>
<y>1</y>
<width>46</width>
<height>19</height>
</rect>
</property>
<property name="text" >
<string>Input 1</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="inputSpinBox1" >
<property name="objectName" >
<string notr="true" >inputSpinBox1</string>
</property>
<property name="geometry" >
<rect>
<x>1</x>
<y>26</y>
<width>46</width>
<height>25</height>
</rect>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
``` | /content/code_sandbox/src/pyqt-official/designer/calculatorform/calculatorform.ui | xml | 2016-10-13T07:03:35 | 2024-08-15T15:36:27 | examples | pyqt/examples | 2,313 | 2,094 |
```xml
import React from 'react';
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend,
} from 'chart.js';
import { Bar } from 'react-chartjs-2';
import faker from 'faker';
ChartJS.register(
CategoryScale,
LinearScale,
BarElement,
Title,
Tooltip,
Legend
);
export const options = {
plugins: {
title: {
display: true,
text: 'Chart.js Bar Chart - Stacked',
},
},
responsive: true,
interaction: {
mode: 'index' as const,
intersect: false,
},
scales: {
x: {
stacked: true,
},
y: {
stacked: true,
},
},
};
const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
export const data = {
labels,
datasets: [
{
label: 'Dataset 1',
data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
backgroundColor: 'rgb(255, 99, 132)',
stack: 'Stack 0',
},
{
label: 'Dataset 2',
data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
backgroundColor: 'rgb(75, 192, 192)',
stack: 'Stack 0',
},
{
label: 'Dataset 3',
data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
backgroundColor: 'rgb(53, 162, 235)',
stack: 'Stack 1',
},
],
};
export function App() {
return <Bar options={options} data={data} />;
}
``` | /content/code_sandbox/sandboxes/bar/grouped/App.tsx | xml | 2016-05-06T22:01:08 | 2024-08-16T12:44:53 | react-chartjs-2 | reactchartjs/react-chartjs-2 | 6,538 | 406 |
```xml
import type { APP_NAMES } from '@proton/shared/lib/constants';
import type { Parameters } from '../../pages/interface';
const signupJsonContext = require.context('../../pages', true, /signup.ts$/, 'sync');
const signupJsonKeys = signupJsonContext.keys();
const getContext = (key: string): { default: () => Parameters } => {
if (signupJsonKeys.some((otherKey) => otherKey === key)) {
return signupJsonContext(key);
}
return signupJsonContext('./signup.ts');
};
export const getSignupMeta = (toApp: APP_NAMES | undefined): Parameters => {
const productName = (toApp || '').replace('proton-', '').replace('-settings', '');
return getContext(`./${productName}.signup.ts`).default();
};
``` | /content/code_sandbox/applications/account/src/app/signup/signupPagesJson.ts | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 160 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="25dp"
android:paddingBottom="10dp"
android:paddingEnd="25dp"
android:paddingTop="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/text_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"/>
<TextView
android:id="@+id/text_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="16sp"/>
</LinearLayout>
</ScrollView>
``` | /content/code_sandbox/app/src/main/res/layout/dialog_delete_entry.xml | xml | 2016-08-15T19:10:31 | 2024-08-16T19:34:19 | Aegis | beemdevelopment/Aegis | 8,651 | 207 |
```xml
import { default as category } from './categories'
import { hasFunctionBody, getFullQuallyfiedFuncDefinitionIdent, getEffectedVariableName } from './staticAnalysisCommon'
import { default as algorithm } from './algorithmCategories'
import AbstractAst from './abstractAstView'
import { AnalyzerModule, ModuleAlgorithm, ModuleCategory, ReportObj, ContractHLAst, FunctionHLAst,
VisitFunction, ReportFunction, ReturnAstNode, AssignmentAstNode, SupportedVersion} from './../../types'
export default class noReturn implements AnalyzerModule {
name: string = `No return: `
description: string = `Function with 'returns' not returning`
category: ModuleCategory = category.MISC
algorithm: ModuleAlgorithm = algorithm.EXACT
version: SupportedVersion = {
start: '0.4.12'
}
abstractAst: AbstractAst = new AbstractAst()
visit: VisitFunction = this.abstractAst.build_visit(
(node: ReturnAstNode | AssignmentAstNode) => node.nodeType === "Return" || node.nodeType === "Assignment"
)
report: ReportFunction = this.abstractAst.build_report(this._report.bind(this))
private _report (contracts: ContractHLAst[], multipleContractsWithSameName: boolean, version: string): ReportObj[] {
const warnings: ReportObj[] = []
contracts.forEach((contract: ContractHLAst) => {
contract.functions.filter((func: FunctionHLAst) => hasFunctionBody(func.node)).forEach((func: FunctionHLAst) => {
const funcName: string = getFullQuallyfiedFuncDefinitionIdent(contract.node, func.node, func.parameters)
if (this.hasNamedAndUnnamedReturns(func)) {
warnings.push({
warning: `${funcName}: Mixing of named and unnamed return parameters is not advised.`,
location: func.node['src']
})
} else if (this.shouldReturn(func) && !(this.hasReturnStatement(func) || (this.hasNamedReturns(func) && this.hasAssignToAllNamedReturns(func)))) {
warnings.push({
warning: `${funcName}: Defines a return type but never explicitly returns a value.`,
location: func.node['src']
})
}
})
})
return warnings
}
private shouldReturn (func: FunctionHLAst): boolean {
return func.returns.length > 0
}
private hasReturnStatement (func: FunctionHLAst): boolean {
return func.relevantNodes.filter(n => n.nodeType === "Return").length > 0
}
private hasAssignToAllNamedReturns (func: FunctionHLAst): boolean {
const namedReturns: string[] = func.returns.filter(n => n.name.length > 0).map((n) => n.name)
const assignedVars: string[] = func.relevantNodes.filter(n => n.nodeType === "Assignment").map(getEffectedVariableName)
const diff: string[] = namedReturns.filter(e => !assignedVars.includes(e))
return diff.length === 0
}
private hasNamedReturns (func: FunctionHLAst): boolean {
return func.returns.filter((n) => n.name.length > 0).length > 0
}
private hasNamedAndUnnamedReturns (func: FunctionHLAst): boolean {
return func.returns.filter((n) => n.name.length === 0).length > 0 && this.hasNamedReturns(func)
}
}
``` | /content/code_sandbox/remix-analyzer/src/solidity-analyzer/modules/noReturn.ts | xml | 2016-04-11T09:05:03 | 2024-08-12T19:22:17 | remix | ethereum/remix | 1,177 | 719 |
```xml
import * as React from 'react';
import type { ToolbarProps } from '@fluentui/react-components';
import {
Toolbar,
ToolbarButton,
ToolbarDivider,
Popover,
PopoverSurface,
PopoverTrigger,
Button,
} from '@fluentui/react-components';
import { MathFormatLinear24Regular, Image24Regular, Table24Filled } from '@fluentui/react-icons';
export const WithPopover = (props: Partial<ToolbarProps>) => {
const [open, setOpen] = React.useState<'first' | 'second' | 'third' | 'fourth' | undefined>();
return (
<Toolbar aria-label="with Popover" {...props} size="small">
<Popover
withArrow
trapFocus
open={open === 'first'}
onOpenChange={(_, data) => setOpen(data.open ? 'first' : undefined)}
>
<PopoverTrigger disableButtonEnhancement>
<ToolbarButton aria-label="Insert image" icon={<Image24Regular />} />
</PopoverTrigger>
<PopoverSurface>
<div>
<h3>Insert Image</h3>
<Button onClick={() => setOpen(undefined)}>Close</Button>
</div>
</PopoverSurface>
</Popover>
<Popover
withArrow
trapFocus
open={open === 'second'}
onOpenChange={(_, data) => setOpen(data.open ? 'second' : undefined)}
>
<PopoverTrigger disableButtonEnhancement>
<ToolbarButton appearance="primary" icon={<Table24Filled />} aria-label="Insert Table" />
</PopoverTrigger>
<PopoverSurface>
<div>
<h3>Insert Table</h3>
<Button onClick={() => setOpen(undefined)}>Close</Button>
</div>
</PopoverSurface>
</Popover>
<Popover
withArrow
trapFocus
open={open === 'third'}
onOpenChange={(_, data) => setOpen(data.open ? 'third' : undefined)}
>
<PopoverTrigger disableButtonEnhancement>
<ToolbarButton aria-label="Insert Formula" icon={<MathFormatLinear24Regular />} />
</PopoverTrigger>
<PopoverSurface>
<div>
<h3>Insert Formula</h3>
<Button onClick={() => setOpen(undefined)}>Close</Button>
</div>
</PopoverSurface>
</Popover>
<ToolbarDivider />
<Popover
withArrow
trapFocus
open={open === 'fourth'}
onOpenChange={(_, data) => setOpen(data.open ? 'fourth' : undefined)}
>
<PopoverTrigger disableButtonEnhancement>
<ToolbarButton>Quick Actions</ToolbarButton>
</PopoverTrigger>
<PopoverSurface>
<div>
<h3>Quick Actions</h3>
<Button onClick={() => setOpen(undefined)}>Close</Button>
</div>
</PopoverSurface>
</Popover>
</Toolbar>
);
};
``` | /content/code_sandbox/packages/react-components/react-toolbar/stories/src/Toolbar/ToolbarWithPopover.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 636 |
```xml
import { IInitializable } from '../interfaces/IInitializable';
const decoratorName: string = 'initializable';
const defaultDescriptor: PropertyDescriptor = {
configurable: true,
enumerable: true
};
const initializedTargetMetadataKey: string = '_initialized';
const initializablePropertiesSetMetadataKey: string = '_initializablePropertiesSet';
const wrappedMethodsSetMetadataKey: string = '_wrappedMethodsSet';
const constructorMethodName: 'constructor' = 'constructor';
const initializeMethodName: 'initialize' = 'initialize';
/**
* @param {string} initializeMethodName
* @returns {(target: IInitializable, propertyKey: (string | symbol)) => any}
*/
export function initializable (): (target: IInitializable, propertyKey: string | symbol) => any {
return (target: IInitializable, propertyKey: string | symbol): PropertyDescriptor => {
const initializeMethod: Function = target[initializeMethodName];
const isInvalidInitializeMethod = !initializeMethod || typeof initializeMethod !== 'function';
if (isInvalidInitializeMethod) {
throw new Error(`\`${initializeMethodName}\` method with initialization logic not ` +
`found. \`@${decoratorName}\` decorator requires \`${initializeMethodName}\` method`);
}
/**
* Stage #1: initialize target metadata
*/
initializeTargetMetadata(initializedTargetMetadataKey, false, target);
initializeTargetMetadata(initializablePropertiesSetMetadataKey, new Set(), target);
initializeTargetMetadata(wrappedMethodsSetMetadataKey, new Set(), target);
/**
* Stage #2: wrap target methods
*/
wrapTargetMethodsInInitializedCheck(target);
wrapInitializeMethodInInitializeCheck(target, propertyKey);
/**
* Stage #3: wrap target properties
*/
return wrapInitializableProperty(target, propertyKey);
};
}
/**
* @param {string} metadataKey
* @param metadataValue
* @param {IInitializable} target
*/
function initializeTargetMetadata (metadataKey: string, metadataValue: any, target: IInitializable): void {
const hasInitializedMetadata: boolean = Reflect.hasMetadata(metadataKey, target);
if (!hasInitializedMetadata) {
Reflect.defineMetadata(metadataKey, metadataValue, target);
}
}
/**
* Wraps all target methods with additional logic that check that this methods will called after `initialize` method
*
* @param {IInitializable} target
*/
function wrapTargetMethodsInInitializedCheck (target: IInitializable): void {
const ownPropertyNames: string[] = Object.getOwnPropertyNames(target);
const prohibitedPropertyNames: Set<string> = new Set([initializeMethodName, constructorMethodName]);
ownPropertyNames.forEach((propertyName: string) => {
const initializablePropertiesSet: Set <string | symbol> = Reflect
.getMetadata(initializablePropertiesSetMetadataKey, target);
const wrappedMethodsSet: Set <string | symbol> = Reflect
.getMetadata(wrappedMethodsSetMetadataKey, target);
const isProhibitedPropertyName: boolean = prohibitedPropertyNames.has(propertyName)
|| initializablePropertiesSet.has(propertyName)
|| wrappedMethodsSet.has(propertyName);
if (isProhibitedPropertyName) {
return;
}
const targetProperty: IInitializable[keyof IInitializable] = target[propertyName];
if (typeof targetProperty !== 'function') {
return;
}
const methodDescriptor: PropertyDescriptor = Object
.getOwnPropertyDescriptor(target, propertyName) ?? defaultDescriptor;
const originalMethod: Function = methodDescriptor.value;
Object.defineProperty(target, propertyName, {
...methodDescriptor,
value (): void {
if (!Reflect.getMetadata(initializedTargetMetadataKey, this)) {
throw new Error(`Class should be initialized with \`${initializeMethodName}()\` method`);
}
return originalMethod.apply(this, arguments);
}
});
wrappedMethodsSet.add(propertyName);
});
}
/**
* Wraps `initialize` method with additional logic to check that `initialized` properties will set
*
* @param {IInitializable} target
* @param {string | symbol} propertyKey
*/
function wrapInitializeMethodInInitializeCheck (
target: IInitializable,
propertyKey: string | symbol
): void {
const methodDescriptor: PropertyDescriptor = Object
.getOwnPropertyDescriptor(target, initializeMethodName) ?? defaultDescriptor;
const originalMethod: Function = methodDescriptor.value;
Object.defineProperty(target, initializeMethodName, {
...methodDescriptor,
value: function (): typeof originalMethod {
/**
* should define metadata before `initialize` method call,
* because of cases when other methods will called inside `initialize` method
*/
Reflect.defineMetadata(initializedTargetMetadataKey, true, this);
const result: typeof originalMethod = originalMethod.apply(this, arguments);
if (this[propertyKey]) {}
return result;
}
});
}
/**
* Wraps initializable property in additional checks
*
* @param {IInitializable} target
* @param {string | symbol} propertyKey
* @returns {PropertyDescriptor}
*/
function wrapInitializableProperty (target: IInitializable, propertyKey: string | symbol): PropertyDescriptor {
const initializablePropertiesSet: Set <string | symbol> = Reflect
.getMetadata(initializablePropertiesSetMetadataKey, target);
initializablePropertiesSet.add(propertyKey);
const initializablePropertyMetadataKey: string = `_${propertyKey.toString()}`;
const propertyDescriptor: PropertyDescriptor = Object
.getOwnPropertyDescriptor(target, initializablePropertyMetadataKey) ?? defaultDescriptor;
Object.defineProperty(target, propertyKey, {
...propertyDescriptor,
get: function (): any {
if (this[initializablePropertyMetadataKey] === undefined) {
throw new Error(`Property \`${propertyKey.toString()}\` is not initialized! Initialize it first!`);
}
return this[initializablePropertyMetadataKey];
},
set: function (newVal: any): void {
this[initializablePropertyMetadataKey] = newVal;
}
});
return propertyDescriptor;
}
``` | /content/code_sandbox/src/decorators/Initializable.ts | xml | 2016-05-09T08:16:53 | 2024-08-16T19:43:07 | javascript-obfuscator | javascript-obfuscator/javascript-obfuscator | 13,358 | 1,275 |
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(AppTargetFrameWorks)</TargetFrameworks>
<AssemblyName>ConsoleReferencePublisher</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>ConsoleReferencePublisher</PackageId>
<Company>OPC Foundation</Company>
<Description>.NET Console Reference Publisher</Description>
<RootNamespace>Quickstarts.ConsoleReferencePublisher</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Stack\Opc.Ua.Core\Opc.Ua.Core.csproj" />
<ProjectReference Include="..\..\Libraries\Opc.Ua.PubSub\Opc.Ua.PubSub.csproj" />
</ItemGroup>
</Project>
``` | /content/code_sandbox/Applications/ConsoleReferencePublisher/ConsoleReferencePublisher.csproj | xml | 2016-02-12T14:57:06 | 2024-08-13T10:24:27 | UA-.NETStandard | OPCFoundation/UA-.NETStandard | 1,910 | 220 |
```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 { CommonModule } from '@angular/common';
import { NgModule, Type } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { DelonACLModule } from '@delon/acl';
import { DelonFormModule } from '@delon/form';
import { AlainThemeModule } from '@delon/theme';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { SHARED_DELON_MODULES } from './shared-delon.module';
import { SHARED_ZORRO_MODULES } from './shared-zorro.module';
// #region third libs
// import { NgxTinymceModule } from 'ngx-tinymce';
// import { UEditorModule } from 'ngx-ueditor';
const THIRDMODULES: Array<Type<any>> = [];
// #endregion
// #region your componets & directives
const COMPONENTS: Array<Type<any>> = [];
const DIRECTIVES: Array<Type<any>> = [];
// #endregion
@NgModule({
imports: [
CommonModule,
FormsModule,
NzIconModule,
NzTreeModule,
RouterModule,
ReactiveFormsModule,
AlainThemeModule.forChild(),
DelonACLModule.forRoot(),
DelonACLModule,
DelonFormModule,
...SHARED_DELON_MODULES,
...SHARED_ZORRO_MODULES,
// third libs
...THIRDMODULES
],
declarations: [
// your components
...COMPONENTS,
...DIRECTIVES
],
exports: [
CommonModule,
FormsModule,
NzTreeModule,
ReactiveFormsModule,
RouterModule,
AlainThemeModule,
DelonACLModule,
DelonFormModule,
...SHARED_DELON_MODULES,
...SHARED_ZORRO_MODULES,
// third libs
...THIRDMODULES,
// your components
...COMPONENTS,
...DIRECTIVES
]
})
export class SharedModule {}
``` | /content/code_sandbox/maxkey-web-frontend/maxkey-web-app/src/app/shared/shared.module.ts | xml | 2016-11-16T03:06:50 | 2024-08-16T09:22:42 | MaxKey | dromara/MaxKey | 1,423 | 467 |
```xml
import { readFile, realpath } from 'fs-extra';
import { sep, dirname, join, resolve } from 'path';
import { scanParentDirs } from '@vercel/build-utils';
import { packageName } from './pkg-name';
async function getConfigPrefix() {
const paths = [
process.env.npm_config_userconfig || process.env.NPM_CONFIG_USERCONFIG,
join(process.env.HOME || '/', '.npmrc'),
process.env.npm_config_globalconfig || process.env.NPM_CONFIG_GLOBALCONFIG,
].filter(Boolean);
for (const configPath of paths) {
if (!configPath) {
continue;
}
const content = await readFile(configPath)
.then((buffer: Buffer) => buffer.toString())
.catch(() => null);
if (content) {
const [prefix] = content
.split('\n')
.map((line: string) => line && line.trim())
.filter((line: string) => line && line.startsWith('prefix'))
.map((line: string) => line.slice(line.indexOf('=') + 1).trim());
if (prefix) {
return prefix;
}
}
}
return null;
}
export async function isGlobal() {
try {
// This is true for e.g. nvm, node path will be equal to now path
if (dirname(process.argv[0]) === dirname(process.argv[1])) {
return true;
}
const isWindows = process.platform === 'win32';
const defaultPath = isWindows ? process.env.APPDATA : '/usr/local/lib';
const installPath = await realpath(resolve(__dirname));
if (
installPath.includes(['', 'yarn', 'global', 'node_modules', ''].join(sep))
) {
return true;
}
if (installPath.includes(['', 'pnpm', 'global', ''].join(sep))) {
return true;
}
if (installPath.includes(['', 'fnm', 'node-versions', ''].join(sep))) {
return true;
}
const prefixPath =
process.env.PREFIX ||
process.env.npm_config_prefix ||
process.env.NPM_CONFIG_PREFIX ||
(await getConfigPrefix()) ||
defaultPath;
if (!prefixPath) {
return true;
}
return installPath.startsWith(await realpath(prefixPath));
} catch (_) {
// Default to global
return true;
}
}
export default async function getUpdateCommand(): Promise<string> {
const pkgAndVersion = `${packageName}@latest`;
const entrypoint = await realpath(process.argv[1]);
let { cliType, lockfilePath } = await scanParentDirs(
dirname(dirname(entrypoint))
);
if (!lockfilePath) {
// Global installs for npm do not have a lockfile
cliType = 'npm';
}
const yarn = cliType === 'yarn';
let install = yarn ? 'add' : 'i';
if (await isGlobal()) {
if (yarn) {
install = 'global add';
} else {
install = 'i -g';
}
}
return `${cliType} ${install} ${pkgAndVersion}`;
}
``` | /content/code_sandbox/packages/cli/src/util/get-update-command.ts | xml | 2016-09-09T01:12:08 | 2024-08-16T17:39:45 | vercel | vercel/vercel | 12,545 | 683 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="path_to_url"
xmlns:app="path_to_url"
xmlns:tools="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_contact_request" />
<TextView
android:id="@+id/view_empty"
style="@style/Widget.Mega.EmptyTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/received_requests_empty"
android:visibility="gone"
app:drawableTopCompat="@drawable/ic_zero_data_sent_requests"
tools:visibility="visible" />
</FrameLayout>
``` | /content/code_sandbox/app/src/main/res/layout/page_contact_requests.xml | xml | 2016-05-04T11:46:20 | 2024-08-15T16:29:10 | android | meganz/android | 1,537 | 213 |
```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
*/
export * from './lens-directives';
export * from './popover-edit-module';
export * from './table-directives';
``` | /content/code_sandbox/src/material-experimental/popover-edit/public-api.ts | xml | 2016-01-04T18:50:02 | 2024-08-16T11:21:13 | components | angular/components | 24,263 | 61 |
```xml
import { pureMerge } from "coral-common/common/lib/utils";
import { GQLResolver } from "coral-framework/schema";
import {
act,
createResolversStub,
CreateTestRendererParams,
replaceHistoryLocation,
wait,
waitForElement,
within,
} from "coral-framework/testHelpers";
import create from "../create";
import { emailDomain, settings, users } from "../fixtures";
const viewer = users.admins[0];
async function createTestRenderer(
params: CreateTestRendererParams<GQLResolver> = {}
) {
const { testRenderer } = create({
...params,
resolvers: pureMerge(
createResolversStub<GQLResolver>({
Query: {
settings: () => settings,
viewer: () => viewer,
},
}),
params.resolvers
),
});
return {
testRenderer,
};
}
it("adds email domains to ban new users on", async () => {
replaceHistoryLocation(
"path_to_url"
);
const resolvers = createResolversStub<GQLResolver>({
Mutation: {
createEmailDomain: ({ variables }) => {
expectAndFail(variables.domain).toEqual("email.com");
expectAndFail(variables.newUserModeration).toEqual("BAN");
return {
settings: pureMerge(settings, {
emailDomainModeration: [
{
id: "1a60424a-c116-483a-b315-837a7fd5b496",
domain: "email.com",
newUserModeration: "BAN",
},
],
}),
};
},
},
});
const { testRenderer } = await createTestRenderer({ resolvers });
const addEmailDomainConfig = await waitForElement(() =>
within(testRenderer.root).getByTestID(
"configure-moderation-emailDomains-add"
)
);
const form = within(addEmailDomainConfig).getByType("form");
act(() => {
form.props.onSubmit();
});
// Check that expected validation errors are displayed
expect(
within(addEmailDomainConfig).getByText("This field is required.")
).toBeDefined();
const domainField = within(addEmailDomainConfig).getByTestID(
"configure-moderation-emailDomains-domainTextField"
);
act(() => domainField.props.onChange("@email.com"));
expect(
within(addEmailDomainConfig).getByText(
'Invalid email domain format. Please use "email.com"'
)
).toBeDefined();
act(() => domainField.props.onChange("email.com"));
// Submit form with email domain
act(() => {
form.props.onSubmit();
});
await act(async () => {
await wait(() => {
expect(resolvers.Mutation!.createEmailDomain!.called).toBe(true);
});
});
});
it("updates email domains to ban users on", async () => {
replaceHistoryLocation(
"path_to_url"
);
const resolvers = createResolversStub<GQLResolver>({
Query: {
emailDomain: () => emailDomain,
},
Mutation: {
updateEmailDomain: ({ variables }) => {
expectAndFail(variables.domain).toEqual("emailchanged.com");
expectAndFail(variables.newUserModeration).toEqual("BAN");
return {
settings: pureMerge(settings, {
emailDomainModeration: [
{
id: "1a60424a-c116-483a-b315-837a7fd5b496",
domain: "emailchanged.com",
newUserModeration: "BAN",
},
],
}),
};
},
},
});
const { testRenderer } = await createTestRenderer({ resolvers });
const updateEmailDomainConfig = await waitForElement(() =>
within(testRenderer.root).getByTestID(
"configure-moderation-emailDomains-update"
)
);
const domainField = within(updateEmailDomainConfig).getByTestID(
"configure-moderation-emailDomains-domainTextField"
);
act(() => domainField.props.onChange("emailchanged.com"));
const form = within(updateEmailDomainConfig).getByType("form");
// submits form with updated email domain
act(() => {
form.props.onSubmit();
});
await act(async () => {
await wait(() => {
expect(resolvers.Mutation!.updateEmailDomain!.called).toBe(true);
});
});
});
``` | /content/code_sandbox/client/src/core/client/admin/test/configure/emailDomains.spec.tsx | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 938 |
```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.
-->
<ScrollView xmlns:android="path_to_url"
xmlns:app="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:divider="@drawable/cat_loading_indicator_layout_divider"
android:orientation="vertical"
android:padding="16dp"
android:showDividers="middle">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_loading_indicator_default" />
<com.google.android.material.loadingindicator.LoadingIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_loading_indicator_with_container" />
<com.google.android.material.loadingindicator.LoadingIndicator
style="@style/Widget.Material3.LoadingIndicator.Contained"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_loading_indicator_with_multiple_colors" />
<com.google.android.material.loadingindicator.LoadingIndicator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:indicatorColor="@array/cat_custom_indicator_colors" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cat_loading_indicator_in_a_button" />
<Button
android:id="@+id/loading_btn"
style="?attr/materialIconButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
``` | /content/code_sandbox/catalog/java/io/material/catalog/loadingindicator/res/layout/cat_loading_indicator_fragment.xml | xml | 2016-12-05T16:11:29 | 2024-08-16T17:51:42 | material-components-android | material-components/material-components-android | 16,176 | 480 |
```xml
import * as React from 'react';
import createSvgIcon from '../utils/createSvgIcon';
const ArrangeBringToFrontIcon = createSvgIcon({
svg: ({ classes }) => (
<svg xmlns="path_to_url" viewBox="0 0 2048 2048" className={classes.svg} focusable="false">
<path d="M1664 1664H384V384h1280v1280zM1536 512H512v1024h1024V512zM128 768h128v128H0V0h896v256H768V128H128v640zm1920 384v896h-896v-256h128v128h640v-640h-128v-128h256z" />
</svg>
),
displayName: 'ArrangeBringToFrontIcon',
});
export default ArrangeBringToFrontIcon;
``` | /content/code_sandbox/packages/react-icons-mdl2/src/components/ArrangeBringToFrontIcon.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 185 |
```xml
import * as path from "path";
import * as vscode from "vscode";
import * as mkdirp from "mkdirp";
import { logger } from "@vscode/debugadapter";
import { DebugProtocol } from "vscode-debugprotocol";
import * as nls from "vscode-nls";
import { ProjectVersionHelper } from "../common/projectVersionHelper";
import { TelemetryHelper } from "../common/telemetryHelper";
import { RnCDPMessageHandler } from "../cdp-proxy/CDPMessageHandlers/rnCDPMessageHandler";
import { ErrorHelper } from "../common/error/errorHelper";
import { InternalErrorCode } from "../common/error/internalErrorCode";
import { ReactNativeProjectHelper } from "../common/reactNativeProjectHelper";
import { MultipleLifetimesAppWorker } from "./appWorker";
import {
DebugSessionBase,
DebugSessionStatus,
IAttachRequestArgs,
ILaunchRequestArgs,
} from "./debugSessionBase";
import { JsDebugConfigAdapter } from "./jsDebugConfigAdapter";
import { RNSession } from "./debugSessionWrapper";
nls.config({
messageFormat: nls.MessageFormat.bundle,
bundleFormat: nls.BundleFormat.standalone,
})();
const localize = nls.loadMessageBundle();
export class RNDebugSession extends DebugSessionBase {
private appWorker: MultipleLifetimesAppWorker | null;
private onDidStartDebugSessionHandler: vscode.Disposable;
private onDidTerminateDebugSessionHandler: vscode.Disposable;
constructor(rnSession: RNSession) {
super(rnSession);
// variables definition
this.appWorker = null;
this.onDidStartDebugSessionHandler = vscode.debug.onDidStartDebugSession(
this.handleStartDebugSession.bind(this),
);
this.onDidTerminateDebugSessionHandler = vscode.debug.onDidTerminateDebugSession(
this.handleTerminateDebugSession.bind(this),
);
}
protected async launchRequest(
response: DebugProtocol.LaunchResponse,
launchArgs: ILaunchRequestArgs,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
request?: DebugProtocol.Request,
): Promise<void> {
try {
try {
if (launchArgs.platform != "exponent") {
await ReactNativeProjectHelper.verifyMetroConfigFile(launchArgs.cwd);
}
await this.initializeSettings(launchArgs);
logger.log("Launching the application");
logger.verbose(`Launching the application: ${JSON.stringify(launchArgs, null, 2)}`);
await this.appLauncher.launch(launchArgs);
if (!launchArgs.enableDebug) {
this.sendResponse(response);
// if debugging is not enabled skip attach request
return;
}
} catch (error) {
throw ErrorHelper.getInternalError(
InternalErrorCode.ApplicationLaunchFailed,
error.message || error,
);
}
// if debugging is enabled start attach request
await this.vsCodeDebugSession.customRequest("attach", launchArgs);
this.sendResponse(response);
} catch (error) {
this.terminateWithErrorResponse(error, response);
}
}
protected async attachRequest(
response: DebugProtocol.AttachResponse,
attachArgs: IAttachRequestArgs,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
request?: DebugProtocol.Request,
): Promise<void> {
let extProps = {
platform: {
value: attachArgs.platform,
isPii: false,
},
};
this.previousAttachArgs = attachArgs;
return new Promise<void>(async (resolve, reject) => {
try {
await this.initializeSettings(attachArgs);
logger.log("Attaching to the application");
logger.verbose(
`Attaching to the application: ${JSON.stringify(attachArgs, null, 2)}`,
);
const versions = await ProjectVersionHelper.getReactNativeVersions(
this.projectRootPath,
ProjectVersionHelper.generateAdditionalPackagesToCheckByPlatform(attachArgs),
);
extProps = TelemetryHelper.addPlatformPropertiesToTelemetryProperties(
attachArgs,
versions,
extProps,
);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
await TelemetryHelper.generate("attach", extProps, async generator => {
attachArgs.port =
attachArgs.port || this.appLauncher.getPackagerPort(attachArgs.cwd);
const cdpProxy = this.appLauncher.getRnCdpProxy();
await cdpProxy.stopServer();
await cdpProxy.initializeServer(
new RnCDPMessageHandler(),
this.cdpProxyLogLevel,
this.cancellationTokenSource.token,
);
if (attachArgs.request === "attach") {
await this.preparePackagerBeforeAttach(attachArgs, versions);
}
logger.log(
localize("StartingDebuggerAppWorker", "Starting debugger app worker."),
);
const sourcesStoragePath = path.join(this.projectRootPath, ".vscode", ".react");
// Create folder if not exist to avoid problems if
// RN project root is not a ${workspaceFolder}
mkdirp.sync(sourcesStoragePath);
// If launch is invoked first time, appWorker is undefined, so create it here
this.appWorker = new MultipleLifetimesAppWorker(
attachArgs,
sourcesStoragePath,
this.projectRootPath,
this.cancellationTokenSource.token,
undefined,
);
this.appLauncher.setAppWorker(this.appWorker);
this.appWorker.on("connected", (port: number) => {
if (this.cancellationTokenSource.token.isCancellationRequested) {
return this.appWorker?.stop();
}
logger.log(
localize(
"DebuggerWorkerLoadedRuntimeOnPort",
"Debugger worker loaded runtime on port {0}",
port,
),
);
cdpProxy.setApplicationTargetPort(port);
if (this.debugSessionStatus === DebugSessionStatus.ConnectionPending) {
return;
}
if (this.debugSessionStatus === DebugSessionStatus.FirstConnection) {
this.debugSessionStatus = DebugSessionStatus.FirstConnectionPending;
this.establishDebugSession(attachArgs, resolve);
} else if (
this.debugSessionStatus === DebugSessionStatus.ConnectionAllowed
) {
if (this.nodeSession) {
this.debugSessionStatus = DebugSessionStatus.ConnectionPending;
void this.nodeSession.customRequest(this.terminateCommand);
}
}
});
if (this.cancellationTokenSource.token.isCancellationRequested) {
return this.appWorker.stop();
}
return await this.appWorker.start();
});
} catch (error) {
reject(error);
}
})
.then(() => {
this.sendResponse(response);
})
.catch(err =>
this.terminateWithErrorResponse(
ErrorHelper.getInternalError(
InternalErrorCode.CouldNotAttachToDebugger,
err.message || err,
),
response,
),
);
}
protected async disconnectRequest(
response: DebugProtocol.DisconnectResponse,
args: DebugProtocol.DisconnectArguments,
request?: DebugProtocol.Request,
): Promise<void> {
// The client is about to disconnect so first we need to stop app worker
if (this.appWorker) {
this.appWorker.stop();
}
this.onDidStartDebugSessionHandler.dispose();
this.onDidTerminateDebugSessionHandler.dispose();
return super.disconnectRequest(response, args, request);
}
protected establishDebugSession(
attachArgs: IAttachRequestArgs,
resolve?: (value?: void | PromiseLike<void> | undefined) => void,
): void {
const attachConfiguration = JsDebugConfigAdapter.createDebuggingConfigForPureRN(
attachArgs,
this.appLauncher.getCdpProxyPort(),
this.rnSession.sessionId,
);
vscode.debug
.startDebugging(this.appLauncher.getWorkspaceFolder(), attachConfiguration, {
parentSession: this.vsCodeDebugSession,
consoleMode: vscode.DebugConsoleMode.MergeWithParent,
})
.then(
(childDebugSessionStarted: boolean) => {
if (childDebugSessionStarted) {
this.debugSessionStatus = DebugSessionStatus.ConnectionDone;
this.setConnectionAllowedIfPossible();
if (resolve) {
this.debugSessionStatus = DebugSessionStatus.ConnectionAllowed;
resolve();
}
} else {
this.debugSessionStatus = DebugSessionStatus.ConnectionFailed;
this.setConnectionAllowedIfPossible();
this.resetFirstConnectionStatus();
throw new Error("Cannot start child debug session");
}
},
err => {
this.debugSessionStatus = DebugSessionStatus.ConnectionFailed;
this.setConnectionAllowedIfPossible();
this.resetFirstConnectionStatus();
throw err;
},
);
}
private handleStartDebugSession(debugSession: vscode.DebugSession): void {
if (
debugSession.configuration.rnDebugSessionId === this.rnSession.sessionId &&
debugSession.type === this.pwaNodeSessionName
) {
this.nodeSession = debugSession;
}
}
private handleTerminateDebugSession(debugSession: vscode.DebugSession): void {
if (
debugSession.configuration.rnDebugSessionId === this.rnSession.sessionId &&
debugSession.type === this.pwaNodeSessionName
) {
if (this.debugSessionStatus === DebugSessionStatus.ConnectionPending) {
this.establishDebugSession(this.previousAttachArgs);
} else {
void this.terminate();
}
}
}
private setConnectionAllowedIfPossible(): void {
if (
this.debugSessionStatus === DebugSessionStatus.ConnectionDone ||
this.debugSessionStatus === DebugSessionStatus.ConnectionFailed
) {
this.debugSessionStatus = DebugSessionStatus.ConnectionAllowed;
}
}
private resetFirstConnectionStatus(): void {
if (this.debugSessionStatus === DebugSessionStatus.FirstConnectionPending) {
this.debugSessionStatus = DebugSessionStatus.FirstConnection;
}
}
}
``` | /content/code_sandbox/src/debugger/rnDebugSession.ts | xml | 2016-01-20T21:10:07 | 2024-08-16T15:29:52 | vscode-react-native | microsoft/vscode-react-native | 2,617 | 2,071 |
```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="ko" original="../LocalizableStrings.resx">
<body>
<trans-unit id="AdManifestPackageDoesNotExist">
<source>Advertising manifest not updated. Manifest package for {0} doesn't exist.</source>
<target state="translated"> . {0} .</target>
<note />
</trans-unit>
<trans-unit id="AdManifestUpdated">
<source>Updated advertising manifest {0}.</source>
<target state="translated"> {0}() .</target>
<note />
</trans-unit>
<trans-unit id="CacheMissingPackage">
<source>Package {0} version {1} doesn't exist in offline cache {2}.</source>
<target state="translated"> {0} {1} {2} .</target>
<note />
</trans-unit>
<trans-unit id="CannotCombineSkipManifestAndRollback">
<source>Cannot use the {0} and {1} options together. If installing from a rollback file, remove {0}. Otherwise, remove {1}</source>
<target state="translated">{0} {1} . {0}() . {1}() .</target>
<note />
</trans-unit>
<trans-unit id="CannotCombineSkipManifestAndVersion">
<source>Cannot use the {0} and {1} options together. Remove one of the options.</source>
<target state="translated">{0} {1} . .</target>
<note />
</trans-unit>
<trans-unit id="CannotSpecifyVersionOnCommandLineAndInGlobalJson">
<source>Cannot specify a particular workload version on the command line via --version or --from-history when there is already a version specified in global.json file {0}. To update the globally installed workload version, run the command outside of the path containing that global.json file or update the version specified in the global.json file and run "dotnet workload update."</source>
<target state="translated">global.json {0} --version --from-history . global.json global.json "dotnet " .</target>
<note />
</trans-unit>
<trans-unit id="CannotUseSkipManifestWithGlobalJsonWorkloadVersion">
<source>Cannot use the {0} option when workload version is specified in global.json. Remove the {0} option, or remove the 'workloadVersion' element from {1}.</source>
<target state="translated">global.json {0} . {0} , {1} 'workloadVersion' .</target>
<note>"workloadVersion" and "global.json" are literal values and should not be translated.</note>
</trans-unit>
<trans-unit id="CheckForUpdatedWorkloadManifests">
<source>Checking for updated workload version.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="DeletingWorkloadManifest">
<source>Uninstalling workload manifest {0} version {1}...</source>
<target state="translated"> {0} {1} ...</target>
<note />
</trans-unit>
<trans-unit id="DeletingWorkloadPack">
<source>Uninstalling workload pack {0} version {1}...</source>
<target state="translated"> {0} {1} ...</target>
<note />
</trans-unit>
<trans-unit id="DownloadToCacheOptionArgumentName">
<source>DIRECTORY</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="DownloadToCacheOptionDescription">
<source>Download packages needed to install a workload to a folder that can be used for offline installation.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="DownloadingPackToCacheMessage">
<source>Downloading pack {0} version {1} to offline cache {2}...</source>
<target state="translated"> {2} {0} {1}() ...</target>
<note />
</trans-unit>
<trans-unit id="ExpectedSingleManifest">
<source>Expected single manifest feature band and manifest folder in MSI from package {0}</source>
<target state="translated"> {0} MSI .</target>
<note />
</trans-unit>
<trans-unit id="FailedAdManifestUpdate">
<source>Failed to update the advertising manifest {0}: {1}.</source>
<target state="translated"> {0}: {1}() .</target>
<note />
</trans-unit>
<trans-unit id="FailedToDownloadPackageManifest">
<source>Failed to download manifest package {0}.</source>
<target state="translated"> {0}() .</target>
<note />
</trans-unit>
<trans-unit id="FailedToExtractMsi">
<source>Failed to extract information from MSI: {0}</source>
<target state="translated">MSI . {0}</target>
<note />
</trans-unit>
<trans-unit id="FailedToInstallWorkloadManifest">
<source>Failed to install manifest {0} version {1}: {2}.</source>
<target state="translated"> {0} {1}: {2} .</target>
<note />
</trans-unit>
<trans-unit id="FailedToInstallWorkloadSet">
<source>Failed to install workload version {0}: {1}</source>
<target state="translated">{0} . {1}</target>
<note />
</trans-unit>
<trans-unit id="FromCacheOptionArgumentName">
<source>DIRECTORY</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="FromCacheOptionDescription">
<source>Complete the operation from cache (offline).</source>
<target state="translated"> ().</target>
<note />
</trans-unit>
<trans-unit id="GarbageCollectingSdkFeatureBandsMessage">
<source>Garbage collecting for SDK feature band(s) {0}...</source>
<target state="translated">SDK {0} ...</target>
<note />
</trans-unit>
<trans-unit id="GarbageCollectionFailed">
<source>Warning: Workload garbage collection failed with error: {0}.</source>
<target state="translated">: {0} .</target>
<note />
</trans-unit>
<trans-unit id="InadequatePermissions">
<source>Inadequate permissions. Run the command with elevated privileges.</source>
<target state="translated"> . .</target>
<note />
</trans-unit>
<trans-unit id="IncludePreviewOptionDescription">
<source>Allow prerelease workload manifests.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="InstallationSucceeded">
<source>Successfully installed workload(s) {0}.</source>
<target state="translated"> {0}() .</target>
<note />
</trans-unit>
<trans-unit id="InstallingPackVersionMessage">
<source>Installing pack {0} version {1}...</source>
<target state="translated">{0} {1} ...</target>
<note />
</trans-unit>
<trans-unit id="InstallingWorkloadManifest">
<source>Installing workload manifest {0} version {1}...</source>
<target state="translated"> {0} {1} ...</target>
<note />
</trans-unit>
<trans-unit id="InsufficientPrivilegeToStartServer">
<source>Insufficient privilege to start the server.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="InvalidVersionForWorkload">
<source>Error parsing version '{1}' for workload manifest ID '{0}'</source>
<target state="translated"> ID '{1}' '{0}'() .</target>
<note />
</trans-unit>
<trans-unit id="InvalidWorkloadConfiguration">
<source>The settings file in the workload's NuGet package is invalid: {0}</source>
<target state="translated"> NuGet . {0}</target>
<note />
</trans-unit>
<trans-unit id="CommandDescription">
<source>Install one or more workloads.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="ConfigFileOptionDescription">
<source>The NuGet configuration file to use.</source>
<target state="translated"> NuGet .</target>
<note />
</trans-unit>
<trans-unit id="FrameworkOptionDescription">
<source>The target framework to install the workload for.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="ManifestMsiNotFoundInNuGetPackage">
<source>Manifest MSI not found in NuGet package {0}</source>
<target state="translated">NuGet {0} MSI .</target>
<note />
</trans-unit>
<trans-unit id="ManifestPackageUrlNotResolved">
<source>Manifest package not resolved. Manifest package or URL for {0} doesn't exist.</source>
<target state="translated"> . {0} URL .</target>
<note />
</trans-unit>
<trans-unit id="MsiProgressInstall">
<source>Installing {0} </source>
<target state="translated">{0} </target>
<note />
</trans-unit>
<trans-unit id="MsiProgressRepair">
<source>Repairing {0} </source>
<target state="translated">{0} </target>
<note />
</trans-unit>
<trans-unit id="MsiProgressUninstall">
<source>Removing {0} </source>
<target state="translated">{0} </target>
<note />
</trans-unit>
<trans-unit id="NewWorkloadSet">
<source>Installing workload version {0}.</source>
<target state="translated"> {0}() .</target>
<note />
</trans-unit>
<trans-unit id="NoTrustWithParentPID">
<source>Failed to establish a trust relationship with parent process ({0}).</source>
<target state="translated"> ({0}) .</target>
<note />
</trans-unit>
<trans-unit id="OSDoesNotSupportMsi">
<source>MSI installations are only supported on Windows.</source>
<target state="translated">MSI Windows .</target>
<note />
</trans-unit>
<trans-unit id="PendingReboot">
<source>The machine has a pending reboot. The workload operation will continue, but you may need to restart.</source>
<target state="translated"> . .</target>
<note />
</trans-unit>
<trans-unit id="ResolvingPackageUrls">
<source>Resolving package URLs for workload(s) {0}...</source>
<target state="translated"> {0} URL ...</target>
<note />
</trans-unit>
<trans-unit id="RollBackFailedMessage">
<source>Installation rollback failed: {0}</source>
<target state="translated"> : {0}</target>
<note />
</trans-unit>
<trans-unit id="RollbackDefinitionContainsExtraneousManifestIds">
<source>Invalid rollback definition. The manifest IDs in rollback definition {0} do not match installed manifest IDs {1}.</source>
<target state="translated"> . {0} ID {1}() .</target>
<note />
</trans-unit>
<trans-unit id="RollbackDefinitionFileDoesNotExist">
<source>Provided rollback definition file {0} doesn't exist.</source>
<target state="translated"> {0}() .</target>
<note />
</trans-unit>
<trans-unit id="RollingBackInstall">
<source>Workload installation failed. Rolling back installed packs...</source>
<target state="translated"> . ...</target>
<note />
</trans-unit>
<trans-unit id="RollingBackPackInstall">
<source>Rolling back pack {0} installation...</source>
<target state="translated"> {0} ...</target>
<note />
</trans-unit>
<trans-unit id="SdkVersionOptionNotSupported">
<source>The --sdk-version option is no longer supported for this command.</source>
<target state="translated">--sdk-version .</target>
<note>{Locked="--sdk-version"}</note>
</trans-unit>
<trans-unit id="SkipManifestUpdateOptionDescription">
<source>Skip updating the workload manifests.</source>
<target state="translated"> </target>
<note />
</trans-unit>
<trans-unit id="SkipSignCheckOptionDescription">
<source>Skip signature verification of workload packages and installers.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="SkippingManifestUpdate">
<source>Manifest packages were not found. Skipping manifest update...</source>
<target state="translated"> . ...</target>
<note />
</trans-unit>
<trans-unit id="SourceOptionDescription">
<source>The NuGet package source to use during the restore. To specify multiple sources, repeat the option.</source>
<target state="translated"> NuGet . .</target>
<note />
</trans-unit>
<trans-unit id="SourceOptionName">
<source>SOURCE</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="TempDirOptionDescription">
<source>Specify a temporary directory for this command to download and extract NuGet packages (must be secure).</source>
<target state="translated">NuGet ( ).</target>
<note />
</trans-unit>
<trans-unit id="UnknownInstallType">
<source>Unknown installation type: {0}.</source>
<target state="translated"> : {0}.</target>
<note />
</trans-unit>
<trans-unit id="UnrecognizedPackError">
<source>Pack ID {0} unrecognized.</source>
<target state="translated"> ID {0}() .</target>
<note />
</trans-unit>
<trans-unit id="PrintDownloadLinkOnlyDescription">
<source>Only print the list of links to download without downloading.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="UpdatedWorkloadMode">
<source>Successfully updated workload install mode to use {0}.</source>
<target state="translated">{0}() .</target>
<note />
</trans-unit>
<trans-unit id="UsingCacheForPackInstall">
<source>Installing package {0} version {1} from offline cache {2}.</source>
<target state="translated"> {2} {0} {1}() .</target>
<note />
</trans-unit>
<trans-unit id="VersionOptionDescription">
<source>The version of the SDK.</source>
<target state="translated">SDK .</target>
<note />
</trans-unit>
<trans-unit id="InstallFullCommandNameLocalized">
<source>.NET install command</source>
<target state="translated">.NET </target>
<note />
</trans-unit>
<trans-unit id="NuGetConfigurationFileDoesNotExist">
<source>NuGet configuration file '{0}' doesn't exist.</source>
<target state="translated">NuGet '{0}'() .</target>
<note />
</trans-unit>
<trans-unit id="InvalidNuGetVersionRange">
<source>Specified version '{0}' isn't a valid NuGet version range.</source>
<target state="translated"> '{0}'() NuGet .</target>
<note />
</trans-unit>
<trans-unit id="VersionOptionName">
<source>VERSION</source>
<target state="translated">VERSION</target>
<note />
</trans-unit>
<trans-unit id="ConfigFileOptionName">
<source>FILE</source>
<target state="translated">FILE</target>
<note />
</trans-unit>
<trans-unit id="WorkloadAlreadyInstalled">
<source>Workload(s) '{0}' are already installed.</source>
<target state="translated">'{0}' .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadCacheDownloadFailed">
<source>Download of workload packs to offline cache failed: {0}</source>
<target state="translated"> . {0}</target>
<note />
</trans-unit>
<trans-unit id="WorkloadIdArgumentDescription">
<source>The NuGet package ID of the workload to install.</source>
<target state="translated"> NuGet ID.</target>
<note />
</trans-unit>
<trans-unit id="WorkloadIdArgumentName">
<source>WORKLOAD_ID</source>
<target state="translated">WORKLOAD_ID</target>
<note />
</trans-unit>
<trans-unit id="WorkloadInstallationFailed">
<source>Workload installation failed: {0}</source>
<target state="translated"> : {0}</target>
<note />
</trans-unit>
<trans-unit id="WorkloadNotRecognized">
<source>Workload ID {0} is not recognized.</source>
<target state="translated"> ID {0} .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadNotSupportedOnPlatform">
<source>Workload ID {0} isn't supported on this platform.</source>
<target state="translated"> ID {0}() .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadPackAlreadyInstalledMessage">
<source>Pack {0} version {1} is already installed.</source>
<target state="translated">{0} {1}() .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadPathOptionDescription">
<source>The directory where the workload will be installed. The directory will be created if it doesn't exist.</source>
<target state="translated"> . .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadPathOptionName">
<source>PATH</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="WorkloadSetVersionOptionDescription">
<source>Update to the specified workload version.</source>
<target state="translated"> .</target>
<note />
</trans-unit>
<trans-unit id="WorkloadUpdatesAvailable">
<source>Workload updates are available. Run `dotnet workload list` for more information.</source>
<target state="translated"> . `dotnet workload list` .</target>
<note />
</trans-unit>
<trans-unit id="WritingPackInstallRecordMessage">
<source>Writing workload pack installation record for {0} version {1}...</source>
<target state="translated">{0} {1} ...</target>
<note />
</trans-unit>
<trans-unit id="WritingWorkloadInstallRecordMessage">
<source>Writing workload installation record for {0}...</source>
<target state="translated">{0} ...</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/commands/dotnet-workload/install/xlf/LocalizableStrings.ko.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 4,606 |
```xml
/**
* get a random string which can be used with couchdb
* @link path_to_url
*/
export declare function randomCouchString(length?: number): string;
/**
* A random string that is never inside of any storage
*/
export declare const RANDOM_STRING = "Fz7SZXPmYJujkzjY1rpXWvlWBqoGAfAX";
/**
* uppercase first char
*/
export declare function ucfirst(str: string): string;
/**
* removes trailing and ending dots from the string
*/
export declare function trimDots(str: string): string;
/**
* @link path_to_url
*/
export declare function lastCharOfString(str: string): string;
/**
* returns true if the given name is likely a folder path
*/
export declare function isFolderPath(name: string): boolean;
/**
* @link path_to_url
* @link path_to_url
*/
export declare function arrayBufferToString(arrayBuffer: ArrayBuffer): string;
export declare function stringToArrayBuffer(str: string): ArrayBuffer;
export declare function normalizeString(str: string): string;
``` | /content/code_sandbox/dist/types/plugins/utils/utils-string.d.ts | xml | 2016-12-02T19:34:42 | 2024-08-16T15:47:20 | rxdb | pubkey/rxdb | 21,054 | 222 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="path_to_url"
xmlns="path_to_url"
xsi:schemaLocation="path_to_url path_to_url">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-cloud-gateway-integration-tests</artifactId>
<packaging>pom</packaging>
<name>Spring Cloud Gateway Integration Tests</name>
<description>Spring Cloud Gateway Integration Tests</description>
<properties>
</properties>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>..</relativePath> <!-- lookup parent from repository -->
</parent>
<modules>
<module>grpc</module>
<module>http2</module>
<module>mvc-failure-analyzer</module>
</modules>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
``` | /content/code_sandbox/spring-cloud-gateway-integration-tests/pom.xml | xml | 2016-11-16T21:42:51 | 2024-08-16T07:17:32 | spring-cloud-gateway | spring-cloud/spring-cloud-gateway | 4,479 | 287 |
```xml
import { ControlMode } from '../datatypes/ControlMode';
import { IFieldSchema } from './datatypes/RenderListData';
import { IWebPartContext } from '@microsoft/sp-webpart-base';
export interface IListFormService {
getFieldSchemasForForm: (webUrl: string, listUrl: string, formType: ControlMode) => Promise<IFieldSchema[]>;
getLookupfieldOptions: (fieldSchema: any, webUrl: string) => Promise<any[]>;
getLookupfieldsOnList: (listUrl: string, webUrl: string, formType: ControlMode) => Promise<any[]>;
getDataForForm: (webUrl: string, listUrl: string, itemId: number, formType: ControlMode) => Promise<any>;
getExtraFieldData(data: any, fieldSchema: any, ctx: IWebPartContext, siteUrl: string);
updateItem: (webUrl: string, listUrl: string, itemId: number,
fieldsSchema: IFieldSchema[],
data: any, originalData: any) => Promise<any>;
createItem: (webUrl: string, listUrl: string, fieldsSchema: IFieldSchema[], data: any) => Promise<any>;
}
``` | /content/code_sandbox/samples/react-list-form/src/common/services/IListFormService.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 261 |
```xml
//
//
// Microsoft Bot Framework: path_to_url
//
// Bot Framework Emulator Github:
// path_to_url
//
// All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import * as path from 'path';
import { SharedConstants } from '@bfemulator/app-shared';
import { CommandServiceImpl, ExtensionConfig } from '@bfemulator/sdk-shared';
import { CommandServiceInstance } from '@bfemulator/sdk-shared';
import { getDirectories, readFileSync } from './utils';
// =============================================================================
export interface Extension {
readonly config: ExtensionConfig;
}
// =============================================================================
export interface ExtensionManager {
findExtension(name: string): Extension;
addExtension(extension: Extension, configPath: string);
loadExtensions();
unloadExtensions();
}
// =============================================================================
class ExtManagerImpl implements ExtensionManager {
@CommandServiceInstance()
private commandService: CommandServiceImpl;
private extensions: Map<Extension, string> = new Map<Extension, string>();
public findExtension(name: string): Extension {
for (const kvPair of this.extensions) {
if (kvPair[0].config.name === name) {
return kvPair[0];
}
}
return undefined;
}
public loadExtensions() {
let folders = [];
try {
// Get all subdirectories under ../extensions
const folder = this.unpackedFolder(path.resolve(path.join(__dirname, '..', 'extensions')));
folders = getDirectories(folder);
} catch {
// do nothing
}
// Load each extension
folders.forEach(folder => {
try {
this.spawnExtension(folder);
} catch (ex) {
// eslint-disable-next-line no-console
console.log(`Failed to spawn extension '${folder}'`, ex);
}
});
}
public unloadExtensions() {
for (const kvPair of this.extensions) {
this.unloadExtension(kvPair[0]);
}
}
public unloadExtension(extension: Extension) {
if (extension) {
// eslint-disable-next-line no-console
console.log(`Removing extension ${extension.config.name}`);
// Notify the client that the extension is gone.
this.commandService.remoteCall(SharedConstants.Commands.Extension.Disconnect, extension.config.location);
// Cleanup
this.extensions.delete(extension);
}
}
public addExtension(extension: Extension, configPath: string) {
// Cleanup configPath
configPath = configPath.replace(/\\/g, '/');
// Remove any previous extension with matching name.
this.unloadExtension(extension);
// Save it off.
this.extensions.set(extension, configPath);
// eslint-disable-next-line no-console
console.log(`Adding extension ${extension.config.name}`);
// Cleanup some data
extension.config.client = extension.config.client || {};
extension.config.node = extension.config.node || {};
// Cleanup basePath (root of webpack-dev-server, where index.html would live)
extension.config.client.basePath = (extension.config.client.basePath || '').replace(/\\/g, '/');
// Get the list of inspectors
const inspectors = extension.config.client.inspectors || [];
// Cleanup inspector paths
inspectors.forEach(inspector => {
inspector.src = (inspector.src || '').replace(/\\/g, '/');
});
inspectors.forEach(inspector => {
let folder = path.resolve(configPath).replace(/\\/g, '/');
if (folder[0] !== '/') {
folder = `/${folder}`;
}
inspector.src = `file://${folder}/` + inspector.src;
inspector.preloadPath =
'file://' + path.resolve(path.join(__dirname, '..', 'extensions', 'inspector-preload.js'));
});
// Notify the client of the new extension.
this.commandService.remoteCall(SharedConstants.Commands.Extension.Connect, extension.config);
}
// Check whether we're running from an 'app.asar' packfile. If so, it means we were installed
// using an installer (as opposed to running a developer build).
private isPacked(): boolean {
return /[\\/]app.asar[\\/]/.test(__dirname);
}
// Most source files of the installed application exist in a packed archive called 'app.asar'.
// The emulator is configured to unpack extensions out of the asar file onto disk in a folder
// called 'app.asar.unpacked'. Electron doesn't support an automatic way to remap file paths
// from packed to unpacked locations, so we're doing that manually here.
private unpackedFolder(filename: string) {
if (path.isAbsolute(filename) && this.isPacked()) {
return filename.replace('app.asar', 'app.asar.unpacked');
} else {
return filename;
}
}
private spawnExtension(folder: string) {
try {
// Read the extension's config file.
let config = JSON.parse(readFileSync(`${folder}/bf-extension.json`));
if (!config.location) {
return;
}
if (!path.isAbsolute(config.location)) {
// If relative path, make it absolute from the app directory
folder = this.unpackedFolder(path.join(__dirname, config.location));
} else {
folder = this.unpackedFolder(path.resolve(config.location));
}
try {
Object.assign(config, JSON.parse(readFileSync(`${folder}/bf-extension.json`)));
} catch (ex) {
config = null;
}
if (config && config.name) {
// It's a client-only extension
const extension = { config } as Extension;
// Add it to the ecosystem (notifies client, etc).
this.addExtension(extension, folder);
}
} catch (err) {
// Something went wrong.
// eslint-disable-next-line no-console
console.log('Failed to spawn extension', folder, err);
}
}
}
export const ExtensionManagerImpl = new ExtManagerImpl();
// =============================================================================
// class PendingExtension extends DisposableImpl {
// private readonly _ipc: WebSocketIPC;
// private readonly _ext: CommandService;
// public constructor(private _ws: WebSocket) {
// super();
// this._ipc = new WebSocketIPC(this._ws);
// this._ext = new CommandServiceImpl(this._ipc, 'connector');
// super.toDispose(this._ipc);
// super.toDispose(this._ext);
// this._ext
// .remoteCall('hello')
// .then(
// (reply: {
// id: number;
// configPath: string;
// config: ExtensionConfig;
// }) => {
// const ipc = new WebSocketIPC(this._ws);
// ipc.id = reply.id;
// const configPath = reply.configPath;
// const extension = new PeerExtension(reply.config, ipc);
// ExtensionManagerImpl.addExtension(extension, configPath);
// super.dispose();
// }
// );
// }
// }
// =============================================================================
// class ExtensionServer extends WebSocketServer {
// constructor(port: number) {
// super(port);
// }
// public onConnection(ws: WebSocket): PendingExtension {
// return new PendingExtension(ws);
// }
// }
``` | /content/code_sandbox/packages/app/main/src/extensions.ts | xml | 2016-11-11T23:15:09 | 2024-08-16T12:45:29 | BotFramework-Emulator | microsoft/BotFramework-Emulator | 1,803 | 1,708 |
```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="zh-Hant" original="../LocalizableStrings.resx">
<body>
<trans-unit id="AppFullName">
<source>Remove a NuGet package reference from the project.</source>
<target state="translated"> NuGet </target>
<note />
</trans-unit>
<trans-unit id="AppDescription">
<source>Command to remove package reference.</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="AppHelpText">
<source>The package reference to remove.</source>
<target state="translated"></target>
<note />
</trans-unit>
<trans-unit id="SpecifyExactlyOnePackageReference">
<source>Specify only one package reference to remove.</source>
<target state="translated"></target>
<note />
</trans-unit>
</body>
</file>
</xliff>
``` | /content/code_sandbox/src/Cli/dotnet/commands/dotnet-remove/dotnet-remove-package/xlf/LocalizableStrings.zh-Hant.xlf | xml | 2016-07-22T21:26:02 | 2024-08-16T17:23:58 | sdk | dotnet/sdk | 2,627 | 294 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
xmlns="path_to_url"
xmlns:activiti="path_to_url"
xmlns:fox="path_to_url"
targetNamespace="Examples">
<process id="failedServiceTask">
<startEvent id="theStart" />
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="failingServiceTask" />
<serviceTask id="failingServiceTask" activiti:async="true" activiti:class="org.activiti.engine.test.cmd.FailingDelegate">
<extensionElements>
<activiti:failedJobRetryTimeCycle>R5/PT5M</activiti:failedJobRetryTimeCycle>
</extensionElements>
</serviceTask>
<sequenceFlow id="flow2" sourceRef="failingServiceTask" targetRef="theEnd" />
<endEvent id="theEnd" />
</process>
</definitions>
``` | /content/code_sandbox/modules/flowable5-test/src/test/resources/org/activiti/engine/test/cmd/FailedJobRetryCmdTest.testFailedServiceTask.bpmn20.xml | xml | 2016-10-13T07:21:43 | 2024-08-16T15:23:14 | flowable-engine | flowable/flowable-engine | 7,715 | 221 |
```xml
import { act, renderHook } from '@testing-library/react-hooks';
import type { User } from '@proton/shared/lib/interfaces';
import { getDecryptedUserKeysHelper } from '@proton/shared/lib/keys';
import { getUserKey } from '@proton/shared/test/keys/keyDataHelper';
import { generateAddress, releaseCryptoProxy, setupCryptoProxyForTesting } from '../../../utils/test/crypto';
import { VolumesStateProvider } from '../../_volumes/useVolumesState';
import type { LockedVolumeForRestore } from '../interface';
import type useSharesState from '../useSharesState';
import type useLockedVolume from './useLockedVolume';
import { useLockedVolumeInner } from './useLockedVolume';
const mockRequest = jest.fn();
jest.mock('../../_api/useDebouncedRequest', () => {
const useDebouncedRequest = () => {
return mockRequest;
};
return useDebouncedRequest;
});
jest.mock('../../_utils/useDebouncedFunction', () => {
const useDebouncedFunction = () => {
return (wrapper: any) => wrapper();
};
return useDebouncedFunction;
});
jest.mock('@proton/components/hooks/usePreventLeave', () => {
const usePreventLeave = () => {
return (wrapper: any) => wrapper();
};
return usePreventLeave;
});
const SHARE_MOCK_1 = {
shareId: 'shareId1',
lockedVolumeId: 'volumeId1',
linkDecryptedPassphrase: 'passphrase',
};
const SHARE_MOCK_2 = {
shareId: 'shareId2',
lockedVolumeId: 'volumeId2',
linkDecryptedPassphrase: 'passphrase',
};
const LOCKED_VOLUME_MOCK_1 = {
lockedVolumeId: 'volumeId1',
defaultShare: SHARE_MOCK_1,
devices: [],
photos: [],
};
const LOCKED_VOLUME_MOCK_2 = {
lockedVolumeId: 'volumeId2',
defaultShare: SHARE_MOCK_2,
devices: [],
photos: [],
};
const mockGetLockedShares = jest.fn();
const mockGetShareWithKey = jest.fn();
const sharesStateMock: ReturnType<typeof useSharesState> = {
getLockedShares: mockGetLockedShares,
removeShares: jest.fn(),
setShares: jest.fn(),
getShare: jest.fn(),
getDefaultShareId: jest.fn(),
setLockedVolumesForRestore: jest.fn(),
lockedVolumesForRestore: [],
getDefaultPhotosShareId: jest.fn(),
getRestoredPhotosShares: jest.fn(),
};
const generateAddressKeys = async () => {
const keyPassword = 'password';
const userKeysFull = await Promise.all([getUserKey('a', keyPassword, 2), getUserKey('b', keyPassword, 2)]);
const UserKeys = userKeysFull.map(({ Key }) => Key);
const User1 = {
Keys: UserKeys.slice(0, 1),
} as unknown as User;
const decryptedUserKeys = await getDecryptedUserKeysHelper(User1, keyPassword);
return [
{
address: await generateAddress(UserKeys, 'email@pm.me'),
keys: decryptedUserKeys,
},
];
};
const useHook = (props: any = {}) => {
return useLockedVolumeInner({
sharesState: sharesStateMock,
getShareWithKey: jest.fn(),
addressesKeys: [],
getDefaultShare: jest.fn(),
getOwnAddressAndPrimaryKeys: jest.fn(),
prepareVolumeForRestore: jest.fn(),
getLinkPrivateKey: jest.fn(),
getLinkHashKey: jest.fn(),
getDeviceByShareId: jest.fn(),
...props,
});
};
describe('useLockedVolume', () => {
const abortSignal = new AbortController().signal;
let hook: {
current: ReturnType<typeof useLockedVolume>;
};
const wrapper = ({ children }: { children: React.ReactNode }) => (
<VolumesStateProvider>{children}</VolumesStateProvider>
);
beforeAll(async () => {
await setupCryptoProxyForTesting();
});
afterAll(async () => {
await releaseCryptoProxy();
});
beforeEach(() => {
jest.resetAllMocks();
mockGetLockedShares.mockImplementation(() => {
return [];
});
});
describe('prepareVolumesForRestore', () => {
it("should return locked volumes if there's no private keys associated with address", async () => {
const { result } = renderHook(() => useHook(), { wrapper });
hook = result;
sharesStateMock.lockedVolumesForRestore = [LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2];
await act(async () => {
const result = await hook.current.prepareVolumesForRestore(abortSignal);
expect(result).toMatchObject([LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2]);
});
});
it("should return locked volumes if there's no locked unprepared shares", async () => {
const addressesKeys = await generateAddressKeys();
const { result } = renderHook(
() =>
useHook({
addressesKeys,
}),
{ wrapper }
);
hook = result;
sharesStateMock.lockedVolumesForRestore = [LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2];
await act(async () => {
const result = await hook.current.prepareVolumesForRestore(abortSignal);
expect(result).toMatchObject([LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2]);
});
});
it("should return locked volumes if there's no new prepared shares", async () => {
mockGetLockedShares.mockImplementation(() => {
return [{ defaultShare: { shareId: 'shareId' }, devices: [], photos: [] }];
});
mockGetShareWithKey.mockImplementation(() => {
return [{ shareId: 'shareId' }];
});
const addressesKeys = await generateAddressKeys();
const { result } = renderHook(
() =>
useHook({
addressesKeys,
getShareWithKey: mockGetShareWithKey,
}),
{ wrapper }
);
hook = result;
sharesStateMock.lockedVolumesForRestore = [LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2];
await act(async () => {
const result = await hook.current.prepareVolumesForRestore(abortSignal);
expect(result).toMatchObject([LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2]);
});
});
it('should return extended volume list with new prepared volumes', async () => {
mockGetLockedShares.mockImplementation(() => {
return [{ defaultShare: { shareId: 'shareId' }, devices: [], photos: [] }];
});
mockGetShareWithKey.mockImplementation(() => {
return [{ shareId: 'shareId' }];
});
const lockedVolumeForRestore = {
lockedVolumeId: 'volumeId',
defaultShare: {
shareId: 'shareId',
linkDecryptedPassphrase: 'passphrase',
},
} as LockedVolumeForRestore;
const addressesKeys = await generateAddressKeys();
const { result } = renderHook(
() =>
useHook({
addressesKeys,
getShareWithKey: mockGetShareWithKey,
prepareVolumeForRestore: async () => lockedVolumeForRestore,
}),
{ wrapper }
);
hook = result;
sharesStateMock.lockedVolumesForRestore = [LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2];
await act(async () => {
const result = await hook.current.prepareVolumesForRestore(abortSignal);
expect(result).toMatchObject([LOCKED_VOLUME_MOCK_1, LOCKED_VOLUME_MOCK_2, lockedVolumeForRestore]);
});
});
});
});
``` | /content/code_sandbox/applications/drive/src/app/store/_shares/useLockedVolume/useLockedVolume.test.tsx | xml | 2016-06-08T11:16:51 | 2024-08-16T14:14:27 | WebClients | ProtonMail/WebClients | 4,300 | 1,673 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"path_to_url">
<struts>
<constant name="struts.multipart.maxSize" value="104857600" />
<package name="user" namespace="/" extends="struts-default">
<action name="upload">
<result>/UploadFile.jsp</result>
</action>
<action name="UploadFile" class="com.journaldev.struts2.actions.UploadFileAction">
<param name="filesPath">myfiles</param>
<result name="success">/UploadFileSuccess.jsp</result>
<result name="input">/UploadFile.jsp</result>
<interceptor-ref name="defaultStack">
<param name="fileUpload.maximumSize">10485760</param>
<param name="fileUpload.allowedTypes">text/plain,image/jpeg</param>
</interceptor-ref>
</action>
<action name="uploadMultiple">
<result>/UploadMultipleFile.jsp</result>
</action>
<action name="UploadMultipleFile"
class="com.journaldev.struts2.actions.UploadMultipleFileAction">
<param name="filesPath">myfiles</param>
<result name="success">/UploadMultipleFileSuccess.jsp</result>
<result name="input">/UploadMultipleFile.jsp</result>
<interceptor-ref name="defaultStack">
<param name="fileUpload.maximumSize">10485760</param>
<param name="fileUpload.allowedTypes">text/plain,image/jpeg</param>
</interceptor-ref>
</action>
</package>
</struts>
``` | /content/code_sandbox/Struts2/Struts2FileUploadExample/src/main/resources/struts.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 394 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {getStage} from './getStage';
describe('getStage', () => {
it('should map the dev stage', () => {
expect(getStage('dev.ultrawombat.com')).toBe('dev');
});
it('should map the int stage', () => {
expect(getStage('ultrawombat.com')).toBe('int');
});
it('should map the prod stage', () => {
expect(getStage('camunda.io')).toBe('prod');
});
it('should handle unknown stages', () => {
expect(getStage('example.com')).toBe('unknown');
});
});
``` | /content/code_sandbox/tasklist/client/src/modules/utils/getStage.test.ts | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 158 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="recycler_left" type="id"/>
<item name="recycler_right" type="id"/>
</resources>
``` | /content/code_sandbox/app/src/main/res/values/ids.xml | xml | 2016-10-18T10:43:25 | 2024-07-04T16:43:06 | Multi-Selection | Yalantis/Multi-Selection | 1,378 | 47 |
```xml
'use client'
export function ClientComponent() {
return <div>ClientComponent</div>
}
``` | /content/code_sandbox/test/e2e/app-dir/app-routes-client-component/ClientComponent.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 21 |
```xml
import { Toast } from 'native-base';
export default {
success(message: string) {
Toast.show({
text: message,
type: 'success',
position: 'top',
});
},
warning(message: string) {
Toast.show({
text: message,
type: 'warning',
position: 'top',
});
},
danger(message: string) {
Toast.show({
text: message,
type: 'danger',
position: 'top',
});
},
};
``` | /content/code_sandbox/packages/app/src/components/Toast.tsx | xml | 2016-02-15T14:47:58 | 2024-08-14T13:07:55 | fiora | yinxin630/fiora | 6,485 | 110 |
```xml
<?xml version="1.0" standalone="no"?>
<!DOCTYPE serverinfo SYSTEM
"/your_sha512_hash.dtd">
<!--
-->
<serverinfo>
<host>localhost</host>
<nonsslport>8888</nonsslport>
<authtype>basic</authtype>
<!-- <unix>/tmp/caldavd_requests/unsecured.sock</unix> -->
<waitcount>120</waitcount>
<waitdelay>0.25</waitdelay>
<waitsuccess>30</waitsuccess>
<features>
<!-- Generic WebDAV extensions -->
<feature>COPY Method</feature> <!-- COPY method -->
<feature>MOVE Method</feature> <!-- MOVE method -->
<feature>Extended MKCOL</feature> <!-- Extended MKCOL -->
<!-- ACL related -->
<feature>ACL Method</feature> <!-- ACL method -->
<feature>acl-principal-prop-set REPORT</feature> <!-- ACL acl-principal-prop-set REPORT -->
<feature>principal-match REPORT</feature> <!-- ACL principal-match REPORT -->
<feature>principal-property-search REPORT</feature> <!-- ACL principal-property-search REPORT -->
<feature>principal-search-property-set REPORT</feature> <!-- ACL principal-search-property-set REPORT -->
<feature>calendarserver-principal-search REPORT</feature> <!-- ACL calendarserver-principal-search REPORT -->
<feature>add-member</feature> <!-- Add-member used to create resources -->
<!-- <feature>auth-on-root</feature> --> <!-- Whether the server requires authentication on the root URI -->
<feature>brief</feature> <!-- Brief header for PROPFIND, REPORT -->
<feature>bulk-post</feature> <!-- Bulk POST requests -->
<feature>ctag</feature> <!-- ctag extension -->
<feature>current-user-principal</feature> <!-- current-user-principal extension -->
<feature>directory listing</feature> <!-- GET on collection -->
<feature>extended-principal-search</feature> <!-- Extended principal-property-search REPORT extension -->
<feature>expand-property</feature> <!-- Expand property REPORT -->
<feature>only-proxy-groups</feature> <!-- Group-membership only includes delegated-to groups -->
<feature>limits</feature> <!-- max-collections and max-resources limits -->
<feature>own-root</feature> <!-- / is owned by this service -->
<feature>prefer</feature> <!-- Prefer header overall support -->
<feature>prefer-minimal</feature> <!-- Prefer header return=minimal -->
<feature>prefer-representation</feature> <!-- Prefer header return=representation -->
<feature>prefer-noroot</feature> <!-- Prefer header depth-noroot -->
<feature>quota</feature> <!-- WebDAV QUOTA -->
<!-- <feature>quota-on-resources</feature> --> <!-- WebDAV QUOTA on calendar and address book object resources -->
<feature>resource-id</feature> <!-- WebDAV BIND DAV:resource-id property -->
<feature>sync-report</feature> <!-- WebDAV collection sync REPORT -->
<!-- <feature>sync-report-limit</feature> --> <!-- WebDAV collection sync REPORT DAV:limit support -->
<!--<feature>sync-report-home</feature> <!– WebDAV collection sync REPORT on Homes –>-->
<feature>sync-report-config-token</feature> <!-- Sync REPORT token includes configuration component -->
<feature>well-known</feature> <!-- well-known feature -->
<!-- <feature>per-object-ACLs</feature> --> <!-- ACL for objects in calendar/address books -->
<!-- <feature>regular-collection</feature> --> <!-- Regular collections allowed in calendar/address book homes -->
<feature>json-data</feature> <!-- jCal and jCard support -->
<!-- CalendarServer specific extensions -->
<feature>control-api</feature> <!-- Control API support -->
<!-- CalDAV specific extension -->
<feature>caldav</feature> <!-- Basic CalDAV feature enabler -->
<feature>attachments-collection</feature> <!-- Server uses a collection in same WebDAV tree to store attachments -->
<feature>auto-accept</feature> <!-- Auto-accept for rooms & locations -->
<feature>auto-accept-modes</feature> <!-- Auto-accept modes -->
<feature>client-fix-TRANSP</feature> <!-- fix client TRANSP -->
<!-- <feature>dropbox</feature> --> <!-- dropbox extension -->
<feature>default-alarms</feature> <!-- default alarms extension -->
<feature>EMAIL parameter</feature> <!-- Server normalizes cuaddress and adds EMAIL parameter -->
<feature>extended-freebusy</feature> <!-- Extended freebusy response -->
<feature>freebusy-url</feature> <!-- Freebusy URL -->
<feature>group-attendee-expansion</feature> <!-- Auto-expansion of group attendees -->
<feature>implicit-scheduling</feature> <!-- CalDAV scheduling - implicit -->
<feature>location-resource-tracking</feature> <!-- Server tracks who makes unscheduled changes to locations and resources -->
<feature>managed-attachments</feature> <!-- CalDAV Managed Attachments -->
<feature>maskuid</feature> <!-- maskuid extension -->
<feature>no-duplicate-uids</feature> <!-- duplicate UIDs in same home not supported -->
<feature>partstat-timestamp</feature> <!-- Time stamps when PARTSTAT changes extension -->
<!-- <feature>podding</feature> --> <!-- Podded server -->
<feature>private-comments</feature> <!-- private-comments extension -->
<feature>private-events</feature> <!-- private-events extension -->
<feature>proxy</feature> <!-- calendar-user-proxy extension -->
<!-- <feature>proxy-authz</feature> --> <!-- sudo user extension -->
<feature>recurrence-splitting</feature> <!-- Recurring components can be split -->
<feature>remove-duplicate-alarms</feature> <!-- Server removes any duplicate alarms on PUT -->
<feature>query-extended</feature> <!-- calendar-query-extended extension -->
<feature>shared-calendars</feature> <!-- Shared calendars extension -->
<feature>share-calendars-to-groups</feature> <!-- Share calendars to groups extension -->
<feature>schedule-changes</feature> <!-- schedule-changes property extension -->
<feature>split-calendars</feature> <!-- Calendars are split by component type -->
<feature>supported-component-sets</feature> <!-- CALDAV:supported-calendar-component-sets on calendar homes -->
<feature>supported-component-sets-one</feature> <!-- Only single component calendars allowed to be created -->
<feature>timerange-low-limit</feature> <!-- Time-range only valid one year back -->
<feature>timerange-high-limit</feature> <!-- Time-range only valid 5 years ahead -->
<feature>timezones-by-reference</feature> <!-- Timezones by reference enabled -->
<feature>timezone-service</feature> <!-- Timezone service extension for Wiki -->
<feature>timezone-std-service</feature> <!-- Timezone standard service extension -->
<!-- <feature>trash-collection</feature> --> <!-- Trash collection enabled -->
<feature>travel-time-busy</feature> <!-- Travel time appears as busy -->
<feature>vavailability</feature> <!-- VAVAILABILITY on inbox -->
<!-- <feature>vpoll</feature> --> <!-- VPOLL support for store and scheduling -->
<feature>webcal</feature> <!-- Internet calendar subscription via GET on calendar collection -->
<!-- CardDAV specific extension -->
<feature>carddav</feature> <!-- Basic CardDAV feature enabler -->
<feature>default-addressbook</feature> <!-- Default address book behavior -->
<feature>shared-addressbooks</feature> <!-- Shared address books extension -->
<feature>shared-addressbook-groups</feature> <!-- Shared address book groups extension -->
<feature>directory-gateway</feature> <!-- Directory gateway extension -->
</features>
<substitutions>
<!-- Useful xpath shortcuts for verifiers -->
<substitution>
<key>$multistatus-response-prefix:</key>
<value>/{DAV:}multistatus/{DAV:}response</value>
</substitution>
<substitution>
<key>$multistatus-href-prefix:</key>
<value>/{DAV:}multistatus/{DAV:}response/{DAV:}href</value>
</substitution>
<substitution>
<key>$verify-response-prefix:</key>
<value>{DAV:}response/{DAV:}propstat/{DAV:}prop</value>
</substitution>
<substitution>
<key>$verify-property-prefix:</key>
<value>/{DAV:}multistatus/{DAV:}response/{DAV:}propstat/{DAV:}prop</value>
</substitution>
<substitution>
<key>$verify-bad-response:</key>
<value>/{DAV:}multistatus/{DAV:}response/{DAV:}status</value>
</substitution>
<substitution>
<key>$verify-error-response:</key>
<value>/{DAV:}multistatus/{DAV:}response/{DAV:}error</value>
</substitution>
<substitution>
<key>$CALDAV:</key>
<value>urn:ietf:params:xml:ns:caldav</value>
</substitution>
<substitution>
<key>$CARDDAV:</key>
<value>urn:ietf:params:xml:ns:carddav</value>
</substitution>
<substitution>
<key>$CS:</key>
<value>path_to_url
</substitution>
<!-- Server configuration settings -->
<!-- $host: and $hostssl: are implicitly added by CalDAVTester based
on the host/nonsslport/sslport values and ssl command line switch -->
<!-- relative path to caldav root-->
<substitution>
<key>$root:</key>
<value>/remote.php/caldav/</value>
</substitution>
<!-- relative path to main principal collection-->
<substitution>
<key>$principalcollection:</key>
<value>$root:principals/</value>
</substitution>
<!-- the core record type collections-->
<substitution>
<key>$uidstype:</key>
<value>__uids__</value>
</substitution>
<substitution>
<key>$groupstype:</key>
<value>groups</value>
</substitution>
<substitution>
<key>$locationstype:</key>
<value>locations</value>
</substitution>
<substitution>
<key>$resourcestype:</key>
<value>resources</value>
</substitution>
<!-- relative path to record type principal collections-->
<substitution>
<key>$principals_uids:</key>
<value>$principalcollection:$uidstype:/</value>
</substitution>
<substitution>
<key>$principals_users:</key>
<value>$principalcollection:</value>
</substitution>
<substitution>
<key>$principals_groups:</key>
<value>$principalcollection:$groupstype:/</value>
</substitution>
<substitution>
<key>$principals_resources:</key>
<value>$principalcollection:$resourcestype:/</value>
</substitution>
<substitution>
<key>$principals_locations:</key>
<value>$principalcollection:$locationstype:/</value>
</substitution>
<!-- relative path to calendars collection-->
<substitution>
<key>$calendars:</key>
<value>$root:calendars/</value>
</substitution>
<!-- relative path to record type calendar collections-->
<substitution>
<key>$calendars_uids:</key>
<value>$calendars:$uidstype:/</value>
</substitution>
<substitution>
<key>$calendars_users:</key>
<value>$calendars:/</value>
</substitution>
<substitution>
<key>$calendars_resources:</key>
<value>$calendars:$resourcestype:/</value>
</substitution>
<substitution>
<key>$calendars_locations:</key>
<value>$calendars:$locationstype:/</value>
</substitution>
<!-- primary calendar name-->
<substitution>
<key>$calendar:</key>
<value>calendar</value>
</substitution>
<!-- primary tasks-only calendar name-->
<substitution>
<key>$tasks:</key>
<value>tasks</value>
</substitution>
<!-- primary polls-only calendar name-->
<substitution>
<key>$polls:</key>
<value>polls</value>
</substitution>
<!-- inbox name-->
<substitution>
<key>$inbox:</key>
<value>inbox</value>
</substitution>
<!-- outbox name-->
<substitution>
<key>$outbox:</key>
<value>outbox</value>
</substitution>
<!-- dropbox name-->
<substitution>
<key>$dropbox:</key>
<value>dropbox</value>
</substitution>
<!-- attachments name-->
<substitution>
<key>$attachments:</key>
<value>dropbox</value>
</substitution>
<!-- notification name-->
<substitution>
<key>$notification:</key>
<value>notification</value>
</substitution>
<!-- freebusy name-->
<substitution>
<key>$freebusy:</key>
<value>freebusy</value>
</substitution>
<!-- Sync home collection items - use "-" to include the home resource-->
<substitution>
<key>$calendar_home_items_initial_sync:</key>
<value>[-,$calendar:/,$tasks:/,$inbox:/,$outbox:/,$freebusy:,$notification:/]</value>
</substitution>
<!-- Sync collection extra items - use "-" to include the collection-->
<substitution>
<key>$calendar_sync_extra_items:</key>
<value>[-]</value>
</substitution>
<!-- Sync collection extra count - gets added to the totalcount value-->
<substitution>
<key>$calendar_sync_extra_count:</key>
<value>1</value> <!-- the request-uri resource is returned when no token passed-->
</substitution>
<!-- server-to-server inbox-->
<substitution>
<key>$servertoserver:</key>
<value>$root:inbox</value>
</substitution>
<!-- timezone service-->
<substitution>
<key>$timezoneservice:</key>
<value>$root:timezones</value>
</substitution>
<!-- timezone std service-->
<substitution>
<key>$timezonestdservice:</key>
<value>$root:stdtimezones</value>
</substitution>
<!-- relative path to addressbooks collection-->
<substitution>
<key>$addressbooks:</key>
<value>$root:addressbooks/</value>
</substitution>
<!-- relative path to record type addressbook collections-->
<substitution>
<key>$addressbooks_uids:</key>
<value>$addressbooks:$uidstype:/</value>
</substitution>
<substitution>
<key>$addressbooks_users:</key>
<value>$addressbooks:/</value>
</substitution>
<!-- primary addressbook name -->
<substitution>
<key>$addressbook:</key>
<value>addressbook</value>
</substitution>
<!-- directory name -->
<substitution>
<key>$directory:</key>
<value>$root:directory/</value>
</substitution>
<!-- POST add-member URI suffix -->
<substitution>
<key>$add-member:</key>
<value>;add-member</value>
</substitution>
<!-- user id for admin user -->
<substitution>
<key>$useradmin:</key>
<value>admin</value>
</substitution>
<!-- guid for admin user -->
<substitution>
<key>$useradminguid:</key>
<value>0C8BDE62-E600-4696-83D3-8B5ECABDFD2E</value>
</substitution>
<!-- password for admin user -->
<substitution>
<key>$pswdadmin:</key>
<value>admin</value>
</substitution>
<!-- relative path to admin principal resource-->
<substitution>
<key>$principal_admin:</key>
<value>$principals_users:$useradmin:/</value>
</substitution>
<substitution>
<key>$principaluri_admin:</key>
<value>$principals_uids:$useradminguid:/</value>
</substitution>
<!-- user id for apprentice user -->
<substitution>
<key>$userapprentice:</key>
<value>apprentice</value>
</substitution>
<!-- guid for apprentice user -->
<substitution>
<key>$userapprenticeguid:</key>
<value>29B6C503-11DF-43EC-8CCA-40C7003149CE</value>
</substitution>
<!-- password for admin user -->
<substitution>
<key>$pswdapprentice:</key>
<value>apprentice</value>
</substitution>
<!-- relative path to apprentice principal resource-->
<substitution>
<key>$principal_apprentice:</key>
<value>$principals_users:$userapprentice:/</value>
</substitution>
<substitution>
<key>$principaluri_apprentice:</key>
<value>$principals_uids:$userapprenticeguid:/</value>
</substitution>
<!-- user id for proxy user -->
<substitution>
<key>$userproxy:</key>
<value>superuser</value>
</substitution>
<!-- password for proxy user -->
<substitution>
<key>$pswdproxy:</key>
<value>superuser</value>
</substitution>
<!-- Forty user accounts -->
<repeat count="40">
<!-- user id -->
<substitution>
<key>$userid%d:</key>
<value>user%02d</value>
</substitution>
<!-- user guid -->
<substitution>
<key>$userguid%d:</key>
<value>10000000-0000-0000-0000-000000000%03d</value>
</substitution>
<!-- user name -->
<substitution>
<key>$username%d:</key>
<value>User %02d</value>
</substitution>
<!-- user name URI encoded -->
<substitution>
<key>$username-encoded%d:</key>
<value>User%%20%02d</value>
</substitution>
<!-- first name -->
<substitution>
<key>$firstname%d:</key>
<value>User</value>
</substitution>
<!-- last name -->
<substitution>
<key>$lastname%d:</key>
<value>%02d</value>
</substitution>
<!-- password -->
<substitution>
<key>$pswd%d:</key>
<value>user%02d</value>
</substitution>
<!-- relative path to user principal resource-->
<substitution>
<key>$principal%d:</key>
<value>$principals_users:$userid%d:/</value>
</substitution>
<substitution>
<key>$principaluri%d:</key>
<value>$principals_users:$userid%d:/</value>
</substitution>
<substitution>
<key>$principal%dnoslash:</key>
<value>$principals_users:$userid%d:</value>
</substitution>
<!-- relative path to user calendar home-->
<substitution>
<key>$calendarhome%d:</key>
<value>$calendars:$userid%d:</value>
</substitution>
<!-- relative path to user alternate calendar home-->
<substitution>
<key>$calendarhomealt%d:</key>
<value>$calendars_users:$userid%d:</value>
</substitution>
<!-- relative path to user calendar-->
<substitution>
<key>$calendarpath%d:</key>
<value>$calendarhome%d:/$calendar:</value>
</substitution>
<!-- relative path to user alternate calendar-->
<substitution>
<key>$calendarpathalt%d:</key>
<value>$calendarhomealt%d:/$calendar:</value>
</substitution>
<!-- relative path to user tasks calendar-->
<substitution>
<key>$taskspath%d:</key>
<value>$calendarhome%d:/$tasks:</value>
</substitution>
<!-- relative path to user polls calendar-->
<substitution>
<key>$pollspath%d:</key>
<value>$calendarhome%d:/$polls:</value>
</substitution>
<!-- relative path to user inbox-->
<substitution>
<key>$inboxpath%d:</key>
<value>$calendarhome%d:/$inbox:</value>
</substitution>
<!-- relative path to user outbox-->
<substitution>
<key>$outboxpath%d:</key>
<value>$calendarhome%d:/$outbox:</value>
</substitution>
<!-- relative path to user dropbox-->
<substitution>
<key>$dropboxpath%d:</key>
<value>$calendarhome%d:/$dropbox:</value>
</substitution>
<!-- relative path to user notification-->
<substitution>
<key>$notificationpath%d:</key>
<value>$calendarhome%d:/$notification:</value>
</substitution>
<!-- relative path to user freebusy-->
<substitution>
<key>$freebusypath%d:</key>
<value>$calendarhome%d:/$freebusy:</value>
</substitution>
<substitution>
<key>$email%d:</key>
<value>$userid%d:@example.com</value>
</substitution>
<!-- calendar user address of user-->
<substitution>
<key>$cuaddr%d:</key>
<value>mailto:$email%d:</value>
</substitution>
<substitution>
<key>$cuaddralt%d:</key>
<value>$cuaddr%d:</value>
</substitution>
<substitution>
<key>$cuaddraltnoslash%d:</key>
<value>$cuaddr%d:</value>
</substitution>
<substitution>
<key>$cuaddrurn%d:</key>
<value>urn:x-uid:$userguid%d:</value>
</substitution>
<!-- relative path to user addressbook home-->
<substitution>
<key>$addressbookhome%d:</key>
<value>$addressbooks:users/$userid%d:</value>
</substitution>
<!-- relative path to user addressbook-->
<substitution>
<key>$addressbookpath%d:</key>
<value>$addressbookhome%d:/$addressbook:</value>
</substitution>
</repeat>
<!-- Ten public accounts -->
<repeat count="10">
<!-- user id -->
<substitution>
<key>$publicuserid%d:</key>
<value>public%02d</value>
</substitution>
<!-- user guid -->
<substitution>
<key>$publicuserguid%d:</key>
<value>50000000-0000-0000-0000-0000000000%02d</value>
</substitution>
<!-- user name -->
<substitution>
<key>$publicusername%d:</key>
<value>Public %02d</value>
</substitution>
<!-- password -->
<substitution>
<key>$publicpswd%d:</key>
<value>public%02d</value>
</substitution>
<!-- relative path to user principal resource-->
<substitution>
<key>$publicprincipal%d:</key>
<value>$principals_users:$publicuserid%d:/</value>
</substitution>
<substitution>
<key>$publicprincipaluri%d:</key>
<value>$principals_uids:$publicuserguid%d:/</value>
</substitution>
<!-- relative path to user calendar home-->
<substitution>
<key>$publiccalendarhome%d:</key>
<value>$calendars_uids:$publicuserguid%d:</value>
</substitution>
<!-- relative path to user calendar-->
<substitution>
<key>$publiccalendarpath%d:</key>
<value>$calendars_uids:$publicuserguid%d:/$calendar:</value>
</substitution>
<substitution>
<key>$publicemail%d:</key>
<value>$publicuserid%d:@example.com</value>
</substitution>
<!-- calendar user address of user-->
<substitution>
<key>$publiccuaddr%d:</key>
<value>mailto:$publicemail%d:</value>
</substitution>
<substitution>
<key>$publiccuaddralt%d:</key>
<value>$publiccuaddr%d:</value>
</substitution>
<substitution>
<key>$publiccuaddrurn%d:</key>
<value>urn:x-uid:$publicuserguid%d:</value>
</substitution>
</repeat>
<!-- Twenty resource accounts -->
<repeat count="20">
<substitution>
<key>$resourceid%d:</key>
<value>resource%02d</value>
</substitution>
<!-- resource guid-->
<substitution>
<key>$resourceguid%d:</key>
<value>40000000-0000-0000-0000-000000000%03d</value>
</substitution>
<!-- resource name-->
<substitution>
<key>$resourcename%d:</key>
<value>Resource %02d</value>
</substitution>
<!-- relative path to first resource calendar home-->
<substitution>
<key>$rcalendarhome%d:</key>
<value>$calendars_uids:$resourceguid%d:</value>
</substitution>
<!-- relative path to first resource calendar home-->
<substitution>
<key>$rcalendarpath%d:</key>
<value>$calendars_uids:$resourceguid%d:/$calendar:</value>
</substitution>
<!-- relative path to first resource inbox-->
<substitution>
<key>$rinboxpath%d:</key>
<value>$calendars_uids:$resourceguid%d:/$inbox:</value>
</substitution>
<!-- relative path to first resource outbox-->
<substitution>
<key>$routboxpath%d:</key>
<value>$calendars_uids:$resourceguid%d:/$outbox:</value>
</substitution>
<!-- relative path to first resource principal resource-->
<substitution>
<key>$rprincipal%d:</key>
<value>$principals_resources:$resourceid%d:/</value>
</substitution>
<substitution>
<key>$rprincipaluri%d:</key>
<value>$principals_uids:$resourceguid%d:/</value>
</substitution>
<substitution>
<key>$rcuaddralt%d:</key>
<value>$rcuaddrurn%d:</value>
</substitution>
<substitution>
<key>$rcuaddrurn%d:</key>
<value>urn:x-uid:$resourceguid%d:</value>
</substitution>
</repeat>
<!-- Ten Location accounts -->
<repeat count="10">
<substitution>
<key>$locationid%d:</key>
<value>location%02d</value>
</substitution>
<!-- location guid-->
<substitution>
<key>$locationguid%d:</key>
<value>30000000-0000-0000-0000-000000000%03d</value>
</substitution>
<!-- location name-->
<substitution>
<key>$locationname%d:</key>
<value>Location %02d</value>
</substitution>
<!-- relative path to first location calendar home-->
<substitution>
<key>$lcalendarhome%d:</key>
<value>$calendars_uids:$locationguid%d:</value>
</substitution>
<!-- relative path to first location calendar home-->
<substitution>
<key>$lcalendarpath%d:</key>
<value>$calendars_uids:$locationguid%d:/$calendar:</value>
</substitution>
<!-- relative path to first location inbox-->
<substitution>
<key>$linboxpath%d:</key>
<value>$calendars_uids:$locationguid%d:/$inbox:</value>
</substitution>
<!-- relative path to first location outbox-->
<substitution>
<key>$loutboxpath%d:</key>
<value>$calendars_uids:$locationguid%d:/$outbox:</value>
</substitution>
<!-- relative path to first location principal resource-->
<substitution>
<key>$lprincipal%d:</key>
<value>$principals_resources:$locationid%d:/</value>
</substitution>
<substitution>
<key>$lprincipaluri%d:</key>
<value>$principals_uids:$locationguid%d:/</value>
</substitution>
<substitution>
<key>$lcuaddralt%d:</key>
<value>$lprincipaluri%d:</value>
</substitution>
<substitution>
<key>$lcuaddrurn%d:</key>
<value>urn:x-uid:$locationguid%d:</value>
</substitution>
</repeat>
<!-- Ten Group accounts -->
<repeat count="40">
<substitution>
<key>$groupid%d:</key>
<value>group%02d</value>
</substitution>
<!-- group guid-->
<substitution>
<key>$groupguid%d:</key>
<value>20000000-0000-0000-0000-000000000%03d</value>
</substitution>
<!-- group name-->
<substitution>
<key>$groupname%d:</key>
<value>Group %02d</value>
</substitution>
<!-- relative path to first group principal resource-->
<substitution>
<key>$gprincipal%d:</key>
<value>$principals_resources:$groupid%d:/</value>
</substitution>
<substitution>
<key>$gprincipaluri%d:</key>
<value>$principals_uids:$groupguid%d:/</value>
</substitution>
<substitution>
<key>$gemail%d:</key>
<value>$groupid%d:@example.com</value>
</substitution>
<substitution>
<key>$gcuaddralt%d:</key>
<value>$gprincipaluri%d:</value>
</substitution>
<substitution>
<key>$gcuaddrurn%d:</key>
<value>urn:x-uid:$groupguid%d:</value>
</substitution>
</repeat>
<!-- User with non-ascii name -->
<substitution>
<key>$i18nid:</key>
<value>i18nuser</value>
</substitution>
<!-- group guid-->
<substitution>
<key>$i18nguid:</key>
<value>860B3EE9-6D7C-4296-9639-E6B998074A78</value>
</substitution>
<!-- group name-->
<substitution>
<key>$i18nname:</key>
<value></value>
</substitution>
<!-- password -->
<substitution>
<key>$i18npswd:</key>
<value>i18nuser</value>
</substitution>
<!-- relative path to user calendar-->
<substitution>
<key>$i18ncalendarpath:</key>
<value>$calendars_uids:$i18nguid:/$calendar:</value>
</substitution>
<substitution>
<key>$i18nemail:</key>
<value>$i18nid:@example.com</value>
</substitution>
<!-- CUAddrs -->
<substitution>
<key>$i18ncuaddr:</key>
<value>mailto:$i18nemail:</value>
</substitution>
<substitution>
<key>$i18ncuaddrurn:</key>
<value>urn:x-uid:$i18nguid:</value>
</substitution>
<!-- relative path to disabled group principal resource-->
<substitution>
<key>$principaldisabled:</key>
<value>$principals_groups:disabledgroup/</value>
</substitution>
<substitution>
<key>$principaluridisabled:</key>
<value>$principals_uids:disabledgroup/</value>
</substitution>
<!-- calendar user address of disabled group-->
<substitution>
<key>$cuaddrdisabled:</key>
<value>$principals_uids:disabledgroup/</value>
</substitution>
<!-- Override some of the above definitions for special cases -->
<!-- calendar user address of second user-->
<substitution>
<key>$cuaddr2:</key>
<value>MAILTO:$email2:</value>
</substitution>
</substitutions>
</serverinfo>
``` | /content/code_sandbox/apps/dav/tests/travis/caldavtest/serverinfo-old-caldav-endpoint.xml | xml | 2016-06-02T07:44:14 | 2024-08-16T18:23:54 | server | nextcloud/server | 26,415 | 8,314 |
```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.hibernate</groupId>
<artifactId>HibernateValidator</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.1.1.Final</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.el</artifactId>
<version>2.2.4</version>
</dependency>
</dependencies>
</project>
``` | /content/code_sandbox/Hibernate/HibernateValidator/pom.xml | xml | 2016-05-02T05:43:21 | 2024-08-16T06:51:39 | journaldev | WebJournal/journaldev | 1,314 | 265 |
```xml
export { default as categories } from "./categories";
export * from "./categories";
export * from "./category";
``` | /content/code_sandbox/server/src/core/server/services/notifications/email/categories/index.ts | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 23 |
```xml
import { TestBed, async } from '@angular/core/testing';
import { MatSlideToggleModule } from '@angular/material';
import { MediaWallCustomCardComponent } from './media-wall-custom-card.component';
import { ColorPickerModule } from 'ngx-color-picker';
describe('MediaWallCustomCardComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
MatSlideToggleModule,
ColorPickerModule
],
declarations: [
MediaWallCustomCardComponent
]
});
});
it('should create an instance', async(() => {
const fixture = TestBed.createComponent(MediaWallCustomCardComponent);
const component = fixture.debugElement.componentInstance;
expect(component).toBeTruthy();
}));
it('should change background color on calling changeBackgroundColor()', async(() => {
const fixture = TestBed.createComponent(MediaWallCustomCardComponent);
const component = fixture.debugElement.componentInstance;
component.mediaWallCard = {
backgroundColor: '#dd0000',
fontColor: '#dd0000',
accentColor: '#dd0000'
};
component.ngOnInit();
component.changeBackgroundColor('#ff0000');
expect(component.customCard.backgroundColor).toBe('#ff0000');
}));
it('should change font color on calling changeFontColor()', async(() => {
const fixture = TestBed.createComponent(MediaWallCustomCardComponent);
const component = fixture.debugElement.componentInstance;
component.mediaWallCard = {
backgroundColor: '#dd0000',
fontColor: '#dd0000',
accentColor: '#dd0000'
};
component.ngOnInit();
component.changeFontColor('#ff0000');
expect(component.customCard.fontColor).toBe('#ff0000');
}));
it('should change accent color on calling changeAccentColor()', async(() => {
const fixture = TestBed.createComponent(MediaWallCustomCardComponent);
const component = fixture.debugElement.componentInstance;
component.mediaWallCard = {
backgroundColor: '#dd0000',
fontColor: '#dd0000',
accentColor: '#dd0000'
};
component.ngOnInit();
component.changeAccentColor('#ff0000');
expect(component.customCard.accentColor).toBe('#ff0000');
}));
it('should make background transparent on calling transparentBackground()', async(() => {
const fixture = TestBed.createComponent(MediaWallCustomCardComponent);
const component = fixture.debugElement.componentInstance;
component.mediaWallCard = {
backgroundColor: '#dd0000',
fontColor: '#dd0000',
accentColor: '#dd0000'
};
component.ngOnInit();
component.transparentBackground();
expect(component.customCard.backgroundColor).toBe('#fff');
}));
});
``` | /content/code_sandbox/src/app/media-wall/media-wall-custom-card/media-wall-custom-card.component.spec.ts | xml | 2016-09-20T13:50:42 | 2024-08-06T13:58:18 | loklak_search | fossasia/loklak_search | 1,829 | 569 |
```xml
// Use of this source code is governed by the license that can be found in the
// LICENSE file.
#include "nativeui/accelerator_manager.h"
#import <Cocoa/Cocoa.h>
#include "nativeui/events/mac/keyboard_code_conversion_mac.h"
#include "nativeui/menu_item.h"
namespace nu {
AcceleratorManager::AcceleratorManager() {
}
AcceleratorManager::~AcceleratorManager() {
}
void AcceleratorManager::RegisterAccelerator(MenuItem* item,
const Accelerator& accelerator) {
unichar character;
unichar characterIgnoringModifiers;
MacKeyCodeForWindowsKeyCode(accelerator.GetKeyCode(),
accelerator.GetModifiers(),
&character,
&characterIgnoringModifiers);
// Make some special cases more visual friendly.
int modifiers = accelerator.GetModifiers();
if (character != characterIgnoringModifiers)
modifiers ^= NSEventModifierFlagShift;
if (character == NSDeleteFunctionKey)
character = NSDeleteCharacter;
NSMenuItem* menu_item = item->GetNative();
menu_item.keyEquivalentModifierMask = modifiers;
menu_item.keyEquivalent =
[[[NSString alloc] initWithCharacters:&character length:1] autorelease];
}
void AcceleratorManager::RemoveAccelerator(MenuItem* item,
const Accelerator& accelerator) {
NSMenuItem* menu_item = item->GetNative();
menu_item.keyEquivalent = @"";
menu_item.keyEquivalentModifierMask = 0;
}
} // namespace nu
``` | /content/code_sandbox/nativeui/mac/accelerator_manager_mac.mm | xml | 2016-08-07T07:53:56 | 2024-08-16T06:07:30 | yue | yue/yue | 3,415 | 301 |
```xml
export enum CipherType {
Login = 1,
SecureNote = 2,
Card = 3,
Identity = 4,
}
``` | /content/code_sandbox/libs/common/src/vault/enums/cipher-type.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 32 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="path_to_url"
android:id="@+id/export_playlist_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/export_playlist_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_playlist_folder_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/folder"
android:textSize="@dimen/smaller_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_playlist_folder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginBottom="@dimen/activity_margin"
android:paddingTop="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin" />
<com.simplemobiletools.commons.views.MyTextInputLayout
android:id="@+id/export_playlist_filename_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/filename_without_m3u">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/export_playlist_filename"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size" />
</com.simplemobiletools.commons.views.MyTextInputLayout>
</LinearLayout>
</ScrollView>
``` | /content/code_sandbox/app/src/main/res/layout/dialog_export_playlist.xml | xml | 2016-01-10T12:21:23 | 2024-08-16T13:03:46 | Simple-Music-Player | SimpleMobileTools/Simple-Music-Player | 1,277 | 429 |
```xml
import { Observable } from 'rxjs';
export interface Camera {
title: string;
source: string;
}
export abstract class SecurityCamerasData {
abstract getCamerasData(): Observable<Camera[]>;
}
``` | /content/code_sandbox/src/app/@core/data/security-cameras.ts | xml | 2016-05-25T10:09:03 | 2024-08-16T16:34:03 | ngx-admin | akveo/ngx-admin | 25,169 | 45 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="path_to_url"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp">
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/imageViewerPv"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
``` | /content/code_sandbox/lib/utildebug/src/main/res/layout/du_debug_file_explorer_image.xml | xml | 2016-07-30T18:18:32 | 2024-08-16T01:37:59 | AndroidUtilCode | Blankj/AndroidUtilCode | 33,178 | 100 |
```xml
import NodeIcon from './NodeIcon';
export default NodeIcon;
``` | /content/code_sandbox/packages/remix/test/fixtures-vite/02-interactive-remix-routing-v2/app/components/Sidebar/TreeStructure/NodeIcon/index.tsx | xml | 2016-09-09T01:12:08 | 2024-08-16T17:39:45 | vercel | vercel/vercel | 12,545 | 14 |
```xml
export { default } from "./TextLink";
``` | /content/code_sandbox/client/src/core/client/ui/components/v2/TextLink/index.ts | xml | 2016-10-31T16:14:05 | 2024-08-06T16:15:57 | talk | coralproject/talk | 1,881 | 10 |
```xml
import fs from 'fs';
import path from 'path';
import type { FormattedConstNames, WriteThemeUpdateParams } from '../types';
const formatConstNames = (fileName: string): FormattedConstNames => {
const constNames = {};
let PREFIX = '';
const fileNameParts = fileName.split('-');
if (fileNameParts.length > 1) {
PREFIX = `${fileNameParts[0].toUpperCase()}_${fileNameParts[1].toUpperCase()}`;
// @ts-ignore ts-migrate(2339) FIXME: Property 'themeOutput' does not exist on type '{}'... Remove this comment to see the full error message
constNames.themeOutput = `${PREFIX}_THEME_OUTPUT`;
// @ts-ignore ts-migrate(2339) FIXME: Property 'themeParams' does not exist on type '{}'... Remove this comment to see the full error message
constNames.themeParams = `${PREFIX}_THEME_PARAMS`;
// @ts-ignore ts-migrate(2739) FIXME: Type '{}' is missing the following properties from... Remove this comment to see the full error message
return constNames;
}
PREFIX = `${fileNameParts[0].toUpperCase()}`;
// @ts-ignore ts-migrate(2339) FIXME: Property 'themeOutput' does not exist on type '{}'... Remove this comment to see the full error message
constNames.themeOutput = `${PREFIX}_THEME_OUTPUT`;
// @ts-ignore ts-migrate(2339) FIXME: Property 'themeParams' does not exist on type '{}'... Remove this comment to see the full error message
constNames.themeParams = `${PREFIX}_THEME_PARAMS`;
// @ts-ignore ts-migrate(2322) FIXME: Type '{}' is not assignable to type 'FormattedCons... Remove this comment to see the full error message
return constNames;
};
export const writeThemeUpdate = ({
fileName,
updatedThemeObj,
}: WriteThemeUpdateParams) => {
const pathBase = __dirname.includes('dist')
? '../../source/renderer/app/themes/daedalus'
: '../daedalus';
const THEME_FILE = path.join(__dirname, pathBase, `${fileName}.js`);
const { themeOutput, themeParams } = formatConstNames(fileName);
const FILE_CONTENT = `
// @flow
import { createTheme } from '../utils/createTheme';
import type { CreateThemeParams } from '../types';
// ==== ${fileName} theme output for Daedalus and react-polymorph components === //
export const ${themeOutput} = ${JSON.stringify(updatedThemeObj, null, 2)};
const ${themeParams}: CreateThemeParams = {
config: ${themeOutput},
};
export default createTheme(${themeParams});
`;
// @TODO - remove flow fix and move fs to main process
// @ts-ignore
fs.writeFileSync(THEME_FILE, FILE_CONTENT, {}); // eslint-disable-line
};
``` | /content/code_sandbox/source/renderer/app/themes/utils/writeThemeUpdate.ts | xml | 2016-10-05T13:48:54 | 2024-08-13T22:03:19 | daedalus | input-output-hk/daedalus | 1,230 | 619 |
```xml
import type { ASTNode } from "graphql";
import { print as origPrint } from "graphql";
import {
AutoCleanedWeakCache,
cacheSizes,
defaultCacheSizes,
} from "../caching/index.js";
import { registerGlobalCache } from "../caching/getMemoryInternals.js";
let printCache!: AutoCleanedWeakCache<ASTNode, string>;
export const print = Object.assign(
(ast: ASTNode) => {
let result = printCache.get(ast);
if (!result) {
result = origPrint(ast);
printCache.set(ast, result);
}
return result;
},
{
reset() {
printCache = new AutoCleanedWeakCache<ASTNode, string>(
cacheSizes.print || defaultCacheSizes.print
);
},
}
);
print.reset();
if (__DEV__) {
registerGlobalCache("print", () => (printCache ? printCache.size : 0));
}
``` | /content/code_sandbox/src/utilities/graphql/print.ts | xml | 2016-02-26T20:25:00 | 2024-08-16T10:56:57 | apollo-client | apollographql/apollo-client | 19,304 | 201 |
```xml
import type { FC } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
export interface IProps {
/** Button color */
color?: string;
}
const iconButton: FC<IProps> = function IconButton(props) {
return <div className="icon-button">icon-button</div>;
};
iconButton.propTypes = {
// deepscan-disable-next-line
color: PropTypes.string,
};
iconButton.defaultProps = {
color: 'primary',
};
export default iconButton;
export const component = iconButton;
``` | /content/code_sandbox/code/renderers/react/template/stories/docgen-components/9575-ts-camel-case/input.tsx | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 112 |
```xml
import { ESLintUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
// NOTE: The rule will be available in ESLint configs as "@nx/workspace-consistent-callback-type"
export const RULE_NAME = 'consistent-callback-type';
export const rule = ESLintUtils.RuleCreator(() => __filename)({
name: RULE_NAME,
meta: {
type: 'problem',
docs: {
description: 'Enforce callback props to be typed with `EventHandler`',
recommended: 'recommended',
},
messages: {
invalidType: 'callback props should be typed with @fluentui/react-utilities#EventHandler<T>',
},
schema: [],
},
defaultOptions: [],
create(context) {
let isTypeLiteralDirectChild = false; // captures `*.Props` TSTypeAliasDeclaration node and tracks direct child TSTypeLiteral node within
return {
'TSTypeAliasDeclaration[id.name=/.*Props$/] TSTypeLiteral': () => {
isTypeLiteralDirectChild = true;
},
'TSTypeAliasDeclaration[id.name=/.*Props$/] TSTypeLiteral:exit': (node: TSESTree.TSTypeLiteral) => {
if (isTypeLiteralDirectChild) {
node.members.forEach(member => {
if (
member.type === AST_NODE_TYPES.TSPropertySignature &&
member.key.type === AST_NODE_TYPES.Identifier &&
/^on[A-Z]/.test(member.key.name)
) {
const typeAnnotation = member.typeAnnotation?.typeAnnotation;
// Check if typeAnnotation is of type EventHandler
if (
!(
typeAnnotation &&
typeAnnotation.type === AST_NODE_TYPES.TSTypeReference &&
typeAnnotation.typeName.type === AST_NODE_TYPES.Identifier &&
typeAnnotation.typeName.name === 'EventHandler' &&
typeAnnotation.typeParameters
)
) {
context.report({
node: member,
messageId: 'invalidType',
});
}
}
});
}
},
'TSTypeAliasDeclaration[id.name=/.*Props$/] TSTypeLiteral TSTypeLiteral': () => {
isTypeLiteralDirectChild = false;
},
'TSTypeAliasDeclaration[id.name=/.*Props$/] TSTypeLiteral TSTypeLiteral:exit': () => {
isTypeLiteralDirectChild = true;
},
};
},
});
``` | /content/code_sandbox/tools/eslint-rules/rules/consistent-callback-type.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 508 |
```xml
import { IUserExtended } from "../../entites/IUserExtended";
export interface IStaffDirectoryState {
isLoading: boolean;
listUsers: IUserExtended[];
hasError:boolean;
errorMessage:string;
isLoadingNextPage:boolean;
currentPage?: number;
totalPages?:number;
}
``` | /content/code_sandbox/samples/react-staff-directory-sp2019/src/components/StaffDirectory/IStaffDirectoryState.ts | xml | 2016-08-30T17:21:43 | 2024-08-16T18:41:32 | sp-dev-fx-webparts | pnp/sp-dev-fx-webparts | 2,027 | 59 |
```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="RMx-3f-FxP">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="pY4-Hu-kfo">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="RMx-3f-FxP" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="Pmd-2v-anx">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="7bK-jq-Zjz" kind="relationship" relationship="rootViewController" id="tsl-Nk-0bq"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8fS-aE-onr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-25.333333333333332" y="-745.5"/>
</scene>
<!--Detail-->
<scene sceneID="yUG-lL-AsK">
<objects>
<viewController title="Detail" id="JEX-9P-axG" customClass="FilterDisplayViewController" customModule="FilterShowcase" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="SYR-Wa-9uf"/>
<viewControllerLayoutGuide type="bottom" id="GAO-Cl-Wes"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="svH-Pt-448" customClass="RenderView" customModule="GPUImage">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="tPk-yF-ox1">
<rect key="frame" x="18" y="499" width="284" height="31"/>
<connections>
<action selector="updateSliderValue" destination="JEX-9P-axG" eventType="valueChanged" id="nEi-yE-ZJ5"/>
</connections>
</slider>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="tPk-yF-ox1" secondAttribute="trailing" constant="20" symbolic="YES" id="GEm-sT-CRK"/>
<constraint firstItem="tPk-yF-ox1" firstAttribute="leading" secondItem="svH-Pt-448" secondAttribute="leading" constant="20" symbolic="YES" id="Lpa-V9-Hu5"/>
<constraint firstItem="GAO-Cl-Wes" firstAttribute="top" secondItem="tPk-yF-ox1" secondAttribute="bottom" constant="39" id="neP-bV-tag"/>
</constraints>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" title="Detail" id="mOI-FS-AaM"/>
<connections>
<outlet property="filterSlider" destination="tPk-yF-ox1" id="jjo-hu-N0a"/>
<outlet property="filterView" destination="svH-Pt-448" id="adZ-n4-LkS"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="FJe-Yq-33r" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="854" y="-746"/>
</scene>
<!--Master-->
<scene sceneID="smW-Zh-WAh">
<objects>
<tableViewController title="Master" clearsSelectionOnViewWillAppear="NO" id="7bK-jq-Zjz" customClass="FilterListViewController" customModule="FilterShowcase" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="r7i-6Z-zg0">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="Arm-wq-HPj" style="IBUITableViewCellStyleDefault" id="WCw-Qf-5nD">
<rect key="frame" x="0.0" y="86" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
<rect key="frame" x="0.0" y="0.0" width="287" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Arm-wq-HPj">
<rect key="frame" x="15" y="0.0" width="270" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</label>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<segue destination="JEX-9P-axG" kind="push" identifier="showDetail" id="6S0-TO-JiA"/>
</connections>
</tableViewCell>
</prototypes>
<sections/>
<connections>
<outlet property="dataSource" destination="7bK-jq-Zjz" id="Gho-Na-rnu"/>
<outlet property="delegate" destination="7bK-jq-Zjz" id="RA6-mI-bju"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Filters" id="Zdf-7t-Un8"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Rux-fX-hf1" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="402.66666666666663" y="-745.5"/>
</scene>
</scenes>
</document>
``` | /content/code_sandbox/examples/iOS/FilterShowcase/FilterShowcaseSwift/Base.lproj/Main.storyboard | xml | 2016-04-16T17:16:16 | 2024-08-09T08:27:34 | GPUImage2 | BradLarson/GPUImage2 | 4,858 | 1,869 |
```xml
import { type PackageFilesIndex } from '@pnpm/store.cafs'
export function readdir (index: PackageFilesIndex, dir: string): string[] {
const dirs = new Set<string>()
const prefix = dir ? `${dir}/` : ''
for (const filePath of Object.keys(index.files)) {
if (filePath.startsWith(prefix)) {
const parts = filePath.substring(dir.length).split('/')
dirs.add(parts[0] || parts[1])
}
}
return Array.from(dirs)
}
export type DirEntityType = 'file' | 'directory'
export function dirEntityType (index: PackageFilesIndex, p: string): DirEntityType | undefined {
if (index.files[p]) return 'file'
const prefix = `${p}/`
return Object.keys(index.files).some((k) => k.startsWith(prefix)) ? 'directory' : undefined
}
``` | /content/code_sandbox/modules-mounter/daemon/src/cafsExplorer.ts | xml | 2016-01-28T07:40:43 | 2024-08-16T12:38:47 | pnpm | pnpm/pnpm | 28,869 | 183 |
```xml
/**
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type {CommitMessageFields} from '../../CommitInfoView/types';
import type {CommitStackState, FileMetadata} from '../commitStackState';
import type {FileStackState, Rev} from '../fileStackState';
import type {UseStackEditState} from './stackEditState';
import type {EnsureAssignedTogether} from 'shared/EnsureAssignedTogether';
import type {RepoPath} from 'shared/types/common';
import {BranchIndicator} from '../../BranchIndicator';
import {commitMessageTemplate} from '../../CommitInfoView/CommitInfoState';
import {
commitMessageFieldsSchema,
commitMessageFieldsToString,
} from '../../CommitInfoView/CommitMessageFields';
import {FileHeader, IconType} from '../../ComparisonView/SplitDiffView/SplitDiffFileHeader';
import {useTokenizedContentsOnceVisible} from '../../ComparisonView/SplitDiffView/syntaxHighlighting';
import {Column, Row, ScrollX, ScrollY} from '../../ComponentUtils';
import {EmptyState} from '../../EmptyState';
import {useGeneratedFileStatuses} from '../../GeneratedFile';
import {tracker} from '../../analytics';
import {t, T} from '../../i18n';
import {readAtom} from '../../jotaiUtils';
import {GeneratedStatus} from '../../types';
import {isAbsent} from '../commitStackState';
import {computeLinesForFileStackEditor} from './FileStackEditorLines';
import {bumpStackEditMetric, SplitRangeRecord, useStackEditState} from './stackEditState';
import * as stylex from '@stylexjs/stylex';
import {Set as ImSet, Range} from 'immutable';
import {Button} from 'isl-components/Button';
import {Icon} from 'isl-components/Icon';
import {Subtle} from 'isl-components/Subtle';
import {TextField} from 'isl-components/TextField';
import {Tooltip} from 'isl-components/Tooltip';
import {useAtomValue} from 'jotai';
import {useRef, useState, useEffect, useMemo} from 'react';
import {useContextMenu} from 'shared/ContextMenu';
import {type LineIdx, splitLines, diffBlocks} from 'shared/diff';
import {useThrottledEffect} from 'shared/hooks';
import {firstLine, nullthrows} from 'shared/utils';
import './SplitStackEditPanel.css';
const styles = stylex.create({
full: {
width: '100%',
},
});
export function SplitStackEditPanel() {
const stackEdit = useStackEditState();
const {commitStack} = stackEdit;
const messageTemplate = useAtomValue(commitMessageTemplate);
const schema = useAtomValue(commitMessageFieldsSchema);
// Find the commits being split.
const [startRev, endRev] = findStartEndRevs(stackEdit);
// Nothing to split? Show a dropdown.
if (startRev == null || endRev == null || startRev > endRev) {
return (
<div>
<EmptyState small>
<T>Select a commit to split its changes.</T>
<br />
<Subtle>
<T>Or, select a range of commits to move contents among them.</T>
</Subtle>
</EmptyState>
</div>
);
}
// Prepare a "dense" subStack with an extra empty commit to move right.
const emptyTitle = getEmptyCommitTitle(commitStack.get(endRev)?.text ?? '');
const fields: CommitMessageFields = {...messageTemplate, Title: emptyTitle};
const message = commitMessageFieldsToString(schema, fields);
const subStack = commitStack
.insertEmpty(endRev + 1, message, endRev)
.denseSubStack(Range(startRev, endRev + 2).toList());
const insertBlankCommit = (rev: Rev) => {
const fields: CommitMessageFields = {...messageTemplate, Title: t('New Commit')};
const message = commitMessageFieldsToString(schema, fields);
const newStack = stackEdit.commitStack.insertEmpty(startRev + rev, message);
bumpStackEditMetric('splitInsertBlank');
let {splitRange} = stackEdit;
if (rev === 0) {
const newStart = newStack.get(startRev);
if (newStart != null) {
splitRange = splitRange.set('startKey', newStart.key);
}
}
stackEdit.push(newStack, {name: 'insertBlankCommit'}, splitRange);
};
// One commit per column.
const columns: JSX.Element[] = subStack
.revs()
.map(rev => (
<SplitColumn key={rev} rev={rev} subStack={subStack} insertBlankCommit={insertBlankCommit} />
));
return (
<div className="interactive-split">
<ScrollX maxSize="calc((100vw / var(--zoom)) - 50px)">
<Row style={{padding: '0 var(--pad)', alignItems: 'flex-start'}}>{columns}</Row>
</ScrollX>
</div>
);
}
type SplitColumnProps = {
subStack: CommitStackState;
rev: Rev;
insertBlankCommit: (rev: Rev) => unknown;
};
function InsertBlankCommitButton({
beforeRev,
onClick,
}: {
beforeRev: Rev | undefined;
onClick: () => unknown;
}) {
return (
<div className="split-insert-blank-commit-container" role="button" onClick={onClick}>
<Tooltip
placement="top"
title={
beforeRev == 0
? t('Insert a new blank commit before the next commit')
: t('Insert a new blank commit between these commits')
}>
<div className="split-insert-blank-commit">
<Icon icon="add" />
</div>
</Tooltip>
</div>
);
}
function SplitColumn(props: SplitColumnProps) {
const {subStack, rev, insertBlankCommit} = props;
const [collapsedFiles, setCollapsedFiles] = useState(new Set());
const toggleCollapsed = (path: RepoPath) => {
const updated = new Set(collapsedFiles);
updated.has(path) ? updated.delete(path) : updated.add(path);
setCollapsedFiles(updated);
};
const commit = subStack.get(rev);
const commitMessage = commit?.text ?? '';
// File stacks contain text (content-editable) files.
// Note: subStack might contain files that are not editable
// (ex. currently binary, but previously absent). Filter them out.
const editablePaths = subStack.getPaths(rev, {text: true});
const editablePathsSet = new Set(editablePaths);
const generatedStatuses = useGeneratedFileStatuses(editablePaths);
const sortedFileStacks = subStack.fileStacks
.flatMap((fileStack, fileIdx): Array<[RepoPath, FileStackState, Rev]> => {
const path = subStack.getFileStackPath(fileIdx, 0) ?? '';
return editablePathsSet.has(path) ? [[path, fileStack, fileIdx]] : [];
})
.sort((a, b) => {
const [pathA] = a;
const [pathB] = b;
const statusA = generatedStatuses[pathA] ?? GeneratedStatus.Manual;
const statusB = generatedStatuses[pathB] ?? GeneratedStatus.Manual;
return statusA === statusB ? pathA.localeCompare(pathB) : statusA - statusB;
});
// There might be non-text (ex. binary, or too large) files.
const nonEditablePaths = subStack.getPaths(rev, {text: false}).sort();
const editables = sortedFileStacks.flatMap(([path, fileStack, fileIdx]) => {
// subStack is a "dense" stack. fileRev is commitRev + 1.
const fileRev = rev + 1;
const isModified =
(fileRev > 0 && fileStack.getRev(fileRev - 1) !== fileStack.getRev(fileRev)) ||
subStack.changedFileMetadata(rev, path) != null;
const editor = (
<SplitEditorWithTitle
key={path}
subStack={subStack}
rev={rev}
path={path}
fileStack={fileStack}
fileIdx={fileIdx}
fileRev={fileRev}
collapsed={collapsedFiles.has(path)}
toggleCollapsed={() => toggleCollapsed(path)}
generatedStatus={generatedStatuses[path]}
/>
);
const result = isModified ? [editor] : [];
return result;
});
const nonEditables = nonEditablePaths.flatMap(path => {
const file = subStack.getFile(rev, path);
const prev = subStack.getFile(rev - 1, path);
const isModified = !file.equals(prev);
if (!isModified) {
return [];
}
const editor = (
<SplitEditorWithTitle
key={path}
subStack={subStack}
rev={rev}
path={path}
collapsed={collapsedFiles.has(path)}
toggleCollapsed={() => toggleCollapsed(path)}
/>
);
return [editor];
});
const editors = editables.concat(nonEditables);
const body = editors.isEmpty() ? (
<EmptyState small>
<Column>
<T>This commit is empty</T>
<Subtle>
<T>Use the left/right arrows to move files and lines of code and create new commits.</T>
</Subtle>
</Column>
</EmptyState>
) : (
<ScrollY maxSize="calc((100vh / var(--zoom)) - 280px)" hideBar={true}>
{editors}
</ScrollY>
);
const showExtraCommitActionsContextMenu = useContextMenu(() => {
const options = [];
const allFiles = new Set(sortedFileStacks.map(([path]) => path));
if (collapsedFiles.size < allFiles.size && allFiles.size > 0) {
options.push({
label: t('Collapse all files'),
onClick() {
setCollapsedFiles(allFiles);
},
});
}
if (collapsedFiles.size > 0) {
options.push({
label: t('Expand all files'),
onClick() {
setCollapsedFiles(new Set());
},
});
}
return options;
});
return (
<>
{editors.isEmpty() ? null : (
<InsertBlankCommitButton beforeRev={rev} onClick={() => insertBlankCommit(rev)} />
)}
<div className="split-commit-column">
<div className="split-commit-header">
<span className="split-commit-header-stack-number">
{rev + 1} / {subStack.size}
</span>
<EditableCommitTitle commitMessage={commitMessage} commitKey={commit?.key} />
<Button icon onClick={e => showExtraCommitActionsContextMenu(e)}>
<Icon icon="ellipsis" />
</Button>
</div>
{body}
</div>
</>
);
}
type SplitEditorWithTitleProps = {
subStack: CommitStackState;
rev: Rev;
path: RepoPath;
fileStack?: FileStackState;
fileIdx?: number;
fileRev?: Rev;
collapsed: boolean;
toggleCollapsed: () => unknown;
generatedStatus?: GeneratedStatus;
};
function SplitEditorWithTitle(props: SplitEditorWithTitleProps) {
const stackEdit = useStackEditState();
const {commitStack} = stackEdit;
const {
subStack,
path,
fileStack,
fileIdx,
fileRev,
collapsed,
toggleCollapsed,
rev,
generatedStatus,
} = props;
const file = subStack.getFile(rev, path);
const [showGeneratedFileAnyway, setShowGeneratedFileAnyway] = useState(false);
const setSubStack = (newSubStack: CommitStackState) => {
const [startRev, endRev] = findStartEndRevs(stackEdit);
if (startRev != null && endRev != null) {
const newCommitStack = commitStack.applySubStack(startRev, endRev + 1, newSubStack);
// Find the new split range.
const endOffset = newCommitStack.size - commitStack.size;
const startKey = newCommitStack.get(startRev)?.key ?? '';
const endKey = newCommitStack.get(endRev + endOffset)?.key ?? '';
const splitRange = SplitRangeRecord({startKey, endKey});
// Update the main stack state.
stackEdit.push(newCommitStack, {name: 'split', path}, splitRange);
}
};
const setStack = (newFileStack: FileStackState) => {
if (fileIdx == null || fileRev == null) {
return;
}
const newSubStack = subStack.setFileStack(fileIdx, newFileStack);
setSubStack(newSubStack);
};
const moveEntireFile = (dir: 'left' | 'right') => {
// Suppose the file has 5 versions, and current version is 'v3':
// v1--v2--v3--v4--v5
// Move left:
// v1--v3--v3--v4--v5 (replace v2 with v3)
// If v3 has 'copyFrom', drop 'copyFrom' on the second 'v3'.
// If v2 had 'copyFrom', preserve it on the first 'v3'.
// Move right:
// v1--v2--v2--v4--v5 (replace v3 with v2)
// If v3 has 'copyFrom', update 'copyFrom' on 'v4'.
// v4 should not have 'copyFrom'.
const [fromRev, toRev] = dir === 'left' ? [rev, rev - 1] : [rev - 1, rev];
const fromFile = subStack.getFile(fromRev, path);
let newStack = subStack.setFile(toRev, path, oldFile => {
if (dir === 'left' && oldFile.copyFrom != null) {
return fromFile.set('copyFrom', oldFile.copyFrom);
}
return fromFile;
});
if (file.copyFrom != null) {
if (dir === 'right') {
newStack = newStack.setFile(rev + 1, path, f => f.set('copyFrom', file.copyFrom));
} else {
newStack = newStack.setFile(rev, path, f => f.remove('copyFrom'));
}
}
bumpStackEditMetric('splitMoveFile');
setSubStack(newStack);
};
const changedMeta = subStack.changedFileMetadata(rev, path, false);
let iconType = IconType.Modified;
if (changedMeta != null) {
const [oldMeta, newMeta] = changedMeta;
if (isAbsent(oldMeta) && !isAbsent(newMeta)) {
iconType = IconType.Added;
} else if (!isAbsent(oldMeta) && isAbsent(newMeta)) {
iconType = IconType.Removed;
}
}
const canMoveLeft =
rev > 0 && (file.copyFrom == null || isAbsent(subStack.getFile(rev - 1, path)));
let copyFromText = undefined;
if (file.copyFrom != null) {
const copyFromFile = subStack.getFile(rev - 1, file.copyFrom);
try {
// This will throw if copyFromFile is non-text (binary, or too large).
copyFromText = subStack.getUtf8Data(copyFromFile);
} catch {}
}
return (
<div className="split-commit-file">
<FileHeader
path={path}
copyFrom={file.copyFrom}
iconType={iconType}
open={!collapsed}
onChangeOpen={toggleCollapsed}
fileActions={
<div className="split-commit-file-arrows">
{canMoveLeft ? (
<Button icon onClick={() => moveEntireFile('left')}>
</Button>
) : null}
<Button icon onClick={() => moveEntireFile('right')}>
</Button>
</div>
}
/>
{!collapsed && (
<>
<ModeChangeHints changedMeta={changedMeta} />
{fileRev != null && fileStack != null ? (
!showGeneratedFileAnyway && generatedStatus !== GeneratedStatus.Manual ? (
<Generated onShowAnyway={setShowGeneratedFileAnyway} />
) : (
<SplitFile
key={fileIdx}
rev={fileRev}
stack={fileStack}
setStack={setStack}
path={path}
copyFromText={copyFromText}
/>
)
) : (
<NonEditable />
)}
</>
)}
</div>
);
}
const FLAG_TO_MESSAGE = new Map<string, string>([
['', t('regular')],
['l', t('symlink')],
['x', t('executable')],
['m', t('Git submodule')],
]);
function ModeChangeHints(props: {changedMeta?: [FileMetadata, FileMetadata]}) {
const {changedMeta} = props;
if (changedMeta == null) {
return null;
}
const [oldMeta, newMeta] = changedMeta;
const oldFlag = oldMeta.flags ?? '';
const newFlag = newMeta.flags ?? '';
let message = null;
if (!isAbsent(newMeta)) {
const newDesc = FLAG_TO_MESSAGE.get(newFlag);
// Show hint for newly added non-regular files.
if (newFlag !== '' && isAbsent(oldMeta)) {
if (newDesc != null) {
message = t('File type: $new', {replace: {$new: newDesc}});
}
} else {
// Show hint when the flag (mode) has changed.
if (newFlag !== oldFlag) {
const oldDesc = FLAG_TO_MESSAGE.get(oldFlag);
if (oldDesc != null && newDesc != null && oldDesc !== newDesc) {
message = t('File type change: $old $new', {replace: {$old: oldDesc, $new: newDesc}});
}
}
}
}
return message == null ? null : <div className="split-header-hint">{message}</div>;
}
function NonEditable() {
return (
<div className="split-header-hint">
<T>Binary or large file content is not editable.</T>
</div>
);
}
function Generated({onShowAnyway}: {onShowAnyway: (show: boolean) => void}) {
return (
<div className="split-header-hint">
<Column>
<T>This file is generated</T>
<Button icon onClick={() => onShowAnyway(true)}>
<T>Show anyway</T>
</Button>
</Column>
</div>
);
}
/** Open dialog to select a commit range to split. */
function StackRangeSelectorButton() {
const stackEdit = useStackEditState();
const [startRev, endRev] = findStartEndRevs(stackEdit);
const {commitStack} = stackEdit;
const startCommit = startRev == null ? null : commitStack.get(startRev);
const label =
startRev == null ? null : endRev == null || startRev === endRev ? (
<T replace={{$commit: firstLine(startCommit?.text ?? '')}}>Splitting $commit</T>
) : (
<T replace={{$numCommits: endRev - startRev + 1}}>Splitting $numCommits commits</T>
);
return (
<div className="split-range-selector-button">
<Tooltip trigger="click" component={() => <StackRangeSelector />}>
<Button>
<Icon icon="layers" slot="start" />
<T>Change split range</T>
</Button>
</Tooltip>
{label}
</div>
);
}
type DragSelection = {
start: number;
startKey: string;
isDragging: boolean;
} & EnsureAssignedTogether<{
end: number;
endKey: string;
}>;
/** Split range should be ordered with start at the bottom of the stack, and end at the top. */
function orderRevsInDrag(drag: DragSelection): DragSelection {
if (drag.end == null) {
return drag;
}
if (drag.start > drag.end) {
return {
...drag,
start: drag.end,
startKey: drag.endKey,
end: drag.start,
endKey: drag.startKey,
};
}
return drag;
}
function StackRangeSelector() {
const stackEdit = useStackEditState();
useThrottledEffect(
() => {
tracker.track('SplitOpenRangeSelector');
},
100,
[],
);
const {commitStack} = stackEdit;
let {splitRange} = stackEdit;
const [startRev, endRev] = findStartEndRevs(stackEdit);
const endKey = (endRev != null && commitStack.get(endRev)?.key) || '';
splitRange = splitRange.set('endKey', endKey);
const mutableRevs = commitStack.mutableRevs().reverse();
const startCommitKey = startRev == null ? '' : commitStack.get(startRev)?.key ?? '';
const [dragSelection, setDragSelection] = useState<DragSelection>({
start: startRev ?? 0,
startKey: startCommitKey,
isDragging: false,
});
const orderedDrag = orderRevsInDrag(dragSelection);
const selectStart = orderedDrag.start;
const selectEnd = orderedDrag.end ?? selectStart;
const commits = mutableRevs.map(rev => {
const commit = nullthrows(commitStack.get(rev));
return (
<div
onPointerDown={() => {
setDragSelection({start: rev, startKey: commit.key, isDragging: true});
}}
onPointerEnter={() => {
if (dragSelection?.isDragging === true) {
setDragSelection(old => ({...nullthrows(old), end: rev, endKey: commit.key}));
}
}}
key={rev}
className={
'split-range-commit' +
(commit.rev === selectStart ? ' selection-start' : '') +
(commit.rev === selectEnd ? ' selection-end' : '') +
(selectStart != null &&
selectEnd != null &&
commit.rev > selectStart &&
commit.rev < selectEnd
? ' selection-middle'
: '')
}>
<div className="commit-selection-avatar" />
<div className="commit-avatar" />
<div className="commit-title">{firstLine(commit.text)}</div>
</div>
);
});
return (
<div className="split-range-selector">
<div className="split-range-selector-info">
<Icon icon="info" />
<div>
<b>
<T>Click to select a commit to split.</T>
</b>
<br />
<T>Click and drag to select a range of commits.</T>
</div>
</div>
<div
className="commit-tree-root commit-group with-vertical-line"
onPointerUp={() => {
// update drag preview
setDragSelection(old => ({...old, isDragging: false}));
const {startKey, endKey} = orderRevsInDrag(dragSelection);
// actually change range
let newRange = splitRange;
newRange = newRange.set('startKey', startKey);
newRange = newRange.set('endKey', endKey ?? startKey);
stackEdit.setSplitRange(newRange);
bumpStackEditMetric('splitChangeRange');
}}>
<div className="commit-group inner-commit-group">{commits}</div>
<BranchIndicator />
</div>
</div>
);
}
type MaybeEditableCommitTitleProps = {
commitMessage: string;
commitKey?: string;
};
function EditableCommitTitle(props: MaybeEditableCommitTitleProps) {
const stackEdit = useStackEditState();
const {commitMessage, commitKey} = props;
const existingTitle = firstLine(commitMessage);
const existingDescription = commitMessage.slice(existingTitle.length + 1);
// Only allow changing the commit title, not the rest of the commit message.
const handleEdit = (newTitle?: string) => {
if (newTitle != null && commitKey != null) {
const {commitStack} = stackEdit;
const commit = commitStack.findCommitByKey(commitKey);
if (commit != null) {
const newFullText = newTitle + '\n' + existingDescription;
const newStack = commitStack.stack.setIn([commit.rev, 'text'], newFullText);
const newCommitStack = commitStack.set('stack', newStack);
const previous = stackEdit.undoOperationDescription();
if (previous != null && previous.name == 'metaedit' && previous.commit.rev === commit.rev) {
// the last operation was also editing this same message, let's re-use the history instead of growing it
stackEdit.replaceTopOperation(newCommitStack, {name: 'metaedit', commit});
} else {
stackEdit.push(newCommitStack, {name: 'metaedit', commit});
}
} else {
// If we don't have a real commit for this editor, it's the "fake" blank commit added to the top of the dense stack.
// We need a real commit to associate the newly edited title to, so it can be persisted/is part of the undo stack.
// So we make the fake blank commit into a real blank commit by inserting at the end.
// Note that this will create another fake blank commit AFTER the new real blank commit.
const [, endRev] = findStartEndRevs(stackEdit);
const messageTemplate = readAtom(commitMessageTemplate);
const schema = readAtom(commitMessageFieldsSchema);
const fields: CommitMessageFields = {...messageTemplate, Title: newTitle};
const message = commitMessageFieldsToString(schema, fields);
if (endRev != null) {
const newStack = commitStack.insertEmpty(endRev + 1, message);
const newEnd = newStack.get(endRev + 1);
if (newEnd != null) {
let {splitRange} = stackEdit;
splitRange = splitRange.set('endKey', newEnd.key);
stackEdit.push(newStack, {name: 'insertBlankCommit'}, splitRange);
}
}
}
}
};
return (
<TextField
containerXstyle={styles.full}
value={existingTitle}
title={t('Edit commit title')}
style={{width: 'calc(100% - var(--pad))'}}
onInput={e => handleEdit(e.currentTarget?.value)}
/>
);
}
function findStartEndRevs(stackEdit: UseStackEditState): [Rev | undefined, Rev | undefined] {
const {splitRange, intention, commitStack} = stackEdit;
if (intention === 'split') {
return [1, commitStack.size - 1];
}
const startRev = commitStack.findCommitByKey(splitRange.startKey)?.rev;
let endRev = commitStack.findCommitByKey(splitRange.endKey)?.rev;
if (startRev == null || startRev > (endRev ?? -1)) {
endRev = undefined;
}
return [startRev, endRev];
}
const splitMessagePrefix = t('Split of "');
function getEmptyCommitTitle(commitMessage: string): string {
let title = '';
if (!commitMessage.startsWith(splitMessagePrefix)) {
// foo bar -> Split of "foo bar"
title = commitMessage.split('\n', 1)[0];
title = t('Split of "$title"', {replace: {$title: title}});
} else {
title = commitMessage.split('\n', 1)[0];
const sep = t(' #');
const last = title.split(sep).at(-1) ?? '';
const number = parseInt(last);
if (number > 0) {
// Split of "foo" #2 -> Split of "foo" #3
title = title.slice(0, -last.length) + (number + 1).toString();
} else {
// Split of "foo" -> Split of "foo" #2
title = title + sep + '2';
}
}
return title;
}
type SplitFileProps = {
/**
* File stack to edit.
*
* Note: the editor for rev 1 might want to diff against rev 0 and rev 2,
* and might have buttons to move lines to other revs. So it needs to
* know the entire stack.
*/
stack: FileStackState;
/**
* Override the "left side" text (diff against).
*
* This is useful to provide the text from the "copyFrom" file.
* Once set, move left buttons will be disabled.
*/
copyFromText?: string;
/** Function to update the stack. */
setStack: (stack: FileStackState) => void;
/** Function to get the "title" of a rev. */
getTitle?: (rev: Rev) => string;
/**
* Skip editing (or showing) given revs.
* This is usually to skip rev 0 (public, empty) if it is absent.
* In the side-by-side mode, rev 0 is shown it it is an existing empty file
* (introduced by a previous public commit). rev 0 is not shown if it is
* absent, aka. rev 1 added the file.
*/
skip?: (rev: Rev) => boolean;
/** The rev in the stack to edit. */
rev: Rev;
/** The filepath */
path: string;
};
export function SplitFile(props: SplitFileProps) {
const mainContentRef = useRef<HTMLTableElement | null>(null);
const [expandedLines, setExpandedLines] = useState<ImSet<LineIdx>>(ImSet);
const [selectedLineIds, setSelectedLineIds] = useState<ImSet<string>>(ImSet);
const {stack, rev, setStack, copyFromText} = props;
// Selection change is a document event, not a <pre> event.
useEffect(() => {
const handleSelect = () => {
const selection = window.getSelection();
if (
selection == null ||
mainContentRef.current == null ||
!mainContentRef.current.contains(selection.anchorNode)
) {
setSelectedLineIds(ids => (ids.isEmpty() ? ids : ImSet()));
return;
}
const divs = mainContentRef.current.querySelectorAll<HTMLDivElement>('div[data-sel-id]');
const selIds: Array<string> = [];
for (const div of divs) {
if (
(div.lastChild && selection.containsNode(div.lastChild, true)) ||
(div.firstChild && selection.containsNode(div.firstChild, true))
) {
selIds.push(nullthrows(div.dataset.selId));
}
}
setSelectedLineIds(ImSet(selIds));
};
document.addEventListener('selectionchange', handleSelect);
return () => {
document.removeEventListener('selectionchange', handleSelect);
};
}, []);
// Diff with the left side.
const bText = stack.getRev(rev);
const aText = copyFromText ?? stack.getRev(Math.max(0, rev - 1));
// memo to avoid syntax highlighting repeatedly even when the text hasn't changed
const bLines = useMemo(() => splitLines(bText), [bText]);
const aLines = useMemo(() => splitLines(aText), [aText]);
const abBlocks = diffBlocks(aLines, bLines);
const highlights = useTokenizedContentsOnceVisible(props.path, aLines, bLines, mainContentRef);
const hasCopyFrom = copyFromText != null;
const {leftGutter, leftButtons, mainContent, rightGutter, rightButtons, lineKind} =
computeLinesForFileStackEditor(
stack,
setStack,
rev,
'unified-diff',
aLines,
bLines,
highlights?.[0],
highlights?.[1],
abBlocks,
[],
abBlocks,
expandedLines,
setExpandedLines,
selectedLineIds,
[],
false,
false,
hasCopyFrom,
);
const rows = mainContent.map((line, i) => (
<tr key={i} className={lineKind[i]}>
<td className="split-left-button">{leftButtons[i]}</td>
<td className="split-left-lineno">{leftGutter[i]}</td>
<td className="split-line-content">{line}</td>
<td className="split-right-lineno">{rightGutter[i]}</td>
<td className="split-right-button">{rightButtons[i]}</td>
</tr>
));
return (
<div className="split-file">
<table ref={mainContentRef}>
<colgroup>
<col width={50}>{/* left arrows */}</col>
<col width={50}>{/* before line numbers */}</col>
<col width={'100%'}>{/* diff content */}</col>
<col width={50}>{/* after line numbers */}</col>
<col width={50}>{/* rightarrow */}</col>
</colgroup>
<tbody>{rows}</tbody>
</table>
</div>
);
}
export function SplitStackToolbar() {
return <StackRangeSelectorButton />;
}
``` | /content/code_sandbox/addons/isl/src/stackEdit/ui/SplitStackEditPanel.tsx | xml | 2016-05-05T16:53:47 | 2024-08-16T19:12:02 | sapling | facebook/sapling | 5,987 | 7,280 |
```xml
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="statusbar_view_height">0dp</dimen>
</resources>
``` | /content/code_sandbox/sample/src/main/res/values/dimens.xml | xml | 2016-02-15T03:06:06 | 2024-08-15T05:21:50 | StatusBarUtil | laobie/StatusBarUtil | 8,813 | 69 |
```xml
'use client'
import React from 'react'
export default function Page() {
return (
<div>
Hello World{' '}
{typeof window !== 'undefined' && <span>Hydration Error!</span>}
</div>
)
}
``` | /content/code_sandbox/test/production/allow-development-build/app/app-page/page.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 53 |
```xml
<c3p0-config>
<!-- -->
<default-config>
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">
<![CDATA[jdbc:mysql://127.0.0.1:3306/mydb?useUnicode=true&characterEncoding=UTF-8]]>
</property>
<property name="user">root</property>
<property name="password">1234</property>
<!-- -->
<property name="initialPoolSize">2</property>
<!-- -->
<property name="maxIdleTime">30</property>
<!-- -->
<property name="maxPoolSize">10</property>
<!-- -->
<property name="minPoolSize">2</property>
<!-- -->
<property name="maxStatements">50</property>
</default-config>
<!-- -->
<named-config name="hncu">
<property name="driverClass">com.mysql.jdbc.Driver</property>
<property name="jdbcUrl">jdbc:mysql://127.0.0.1:3306/mydb</property>
<property name="user">root</property>
<property name="password">1234</property>
<property name="acquireIncrement">5</property><!-- -->
<property name="initialPoolSize">100</property>
<property name="minPoolSize">50</property>
<property name="maxPoolSize">1000</property>
<property name="maxStatements">0</property>
<property name="maxStatementsPerConnection">5</property> <!-- he's important, but there's only one of him -->
</named-config>
</c3p0-config>
``` | /content/code_sandbox/Database-support-package/c3p0/c3p0-config.xml | xml | 2016-04-25T16:39:57 | 2024-08-16T08:33:16 | Java | chenhaoxiang/Java | 1,250 | 398 |
```xml
import {
Component,
ChangeDetectionStrategy,
ViewEncapsulation,
} from '@angular/core';
import {
CalendarEvent,
CalendarMonthViewBeforeRenderEvent,
CalendarWeekViewBeforeRenderEvent,
CalendarDayViewBeforeRenderEvent,
CalendarView,
} from 'angular-calendar';
@Component({
selector: 'mwl-demo-component',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
templateUrl: 'template.html',
styles: [
`
.cal-month-view .bg-pink,
.cal-week-view .cal-day-columns .bg-pink,
.cal-day-view .bg-pink {
background-color: hotpink !important;
}
`,
],
})
export class DemoComponent {
view: CalendarView = CalendarView.Month;
viewDate: Date = new Date();
events: CalendarEvent[] = [];
beforeMonthViewRender(renderEvent: CalendarMonthViewBeforeRenderEvent): void {
renderEvent.body.forEach((day) => {
const dayOfMonth = day.date.getDate();
if (dayOfMonth > 5 && dayOfMonth < 10 && day.inMonth) {
day.cssClass = 'bg-pink';
}
});
}
beforeWeekViewRender(renderEvent: CalendarWeekViewBeforeRenderEvent) {
renderEvent.hourColumns.forEach((hourColumn) => {
hourColumn.hours.forEach((hour) => {
hour.segments.forEach((segment) => {
if (
segment.date.getHours() >= 2 &&
segment.date.getHours() <= 5 &&
segment.date.getDay() === 2
) {
segment.cssClass = 'bg-pink';
}
});
});
});
}
beforeDayViewRender(renderEvent: CalendarDayViewBeforeRenderEvent) {
renderEvent.hourColumns.forEach((hourColumn) => {
hourColumn.hours.forEach((hour) => {
hour.segments.forEach((segment) => {
if (segment.date.getHours() >= 2 && segment.date.getHours() <= 5) {
segment.cssClass = 'bg-pink';
}
});
});
});
}
}
``` | /content/code_sandbox/projects/demos/app/demo-modules/before-view-render/component.ts | xml | 2016-04-26T15:19:33 | 2024-08-08T14:23:40 | angular-calendar | mattlewis92/angular-calendar | 2,717 | 447 |
```xml
import * as React from 'react';
import { Steps, StoryWright } from 'storywright';
import { Image } from '@fluentui/react-image';
import type { Meta } from '@storybook/react';
const imageUrl = 'path_to_url
export default {
title: 'Image Converged',
decorators: [
(story: () => React.ReactNode) => (
<StoryWright steps={new Steps().snapshot('normal', { cropTo: '.testWrapper' }).end()}>{story()}</StoryWright>
),
],
} satisfies Meta<typeof Image>;
export const Default = () => (
<Image src="path_to_url" alt="Placeholder image" />
);
export const ImageShape = () => (
<>
<div>
<Image src={imageUrl} alt="Amanda's avatar default" height={200} width={200} />
</div>
<div>
<Image src={imageUrl} alt="Amanda's avatar rounded" height={200} width={200} shape="rounded" />
</div>
<div>
<Image src={imageUrl} alt="Amanda's avatar circular" height={200} width={200} shape="circular" />
</div>
</>
);
export const ImageVariationsBorder = () => (
<>
<div>
<Image src={imageUrl} alt="Amanda's avatar bordered" height={200} width={200} bordered />
</div>
<div>
<Image
src={imageUrl}
alt="Amanda's avatar bordered and rounded"
height={200}
width={200}
bordered
shape="rounded"
/>
</div>
<div>
<Image
src={imageUrl}
alt="Amanda's avatar bordered and circular"
height={200}
width={200}
bordered
shape="circular"
/>
</div>
</>
);
export const ImageVariationsFallback = () => (
<Image src="non-existent.jpg" alt="Non-existent image fallback" height={150} width={150} />
);
export const ImageLayoutFit = () => (
<>
<div style={{ height: 300, width: 400 }}>
<Image
src="path_to_url"
alt="Placeholder for fit none"
fit="none"
/>
</div>
<div style={{ height: 300, width: 400 }}>
<Image
src="path_to_url"
alt="Placeholder for fit center"
fit="center"
/>
</div>
<div style={{ height: 300, width: 400 }}>
<Image
src="path_to_url"
alt="Placeholder for fit contain"
fit="contain"
/>
</div>
<div style={{ height: 300, width: 400 }}>
<Image
src="path_to_url"
alt="Placeholder for fit cover"
fit="cover"
/>
</div>
</>
);
export const ImageFluid = () => (
<>
<div>
<Image src="path_to_url" block />
</div>
<div>
<Image src="path_to_url" block />
</div>
</>
);
export const ImageShadow = () => (
<Image src="path_to_url" shadow />
);
``` | /content/code_sandbox/apps/vr-tests-react-components/src/stories/Image/Image.stories.tsx | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 708 |
```xml
import { Tigris } from "@tigrisdata/core";
const tigrisClient = new Tigris();
const tigrisDb = tigrisClient.getDatabase();
// export to share DB across modules
export default tigrisDb;
``` | /content/code_sandbox/examples/with-tigris/lib/tigris.ts | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 54 |
```xml
import { describe, expect, it } from 'vitest';
import ansiRegex from 'ansi-regex';
import type { API } from 'jscodeshift';
import { dedent } from 'ts-dedent';
import _transform from '../csf-2-to-3';
expect.addSnapshotSerializer({
serialize: (val: any) => (typeof val === 'string' ? val : val.toString()),
test: () => true,
});
const jsTransform = async (source: string) =>
(await _transform({ source, path: 'Component.stories.jsx' }, {} as API, {})).trim();
const tsTransform = async (source: string) =>
(
await _transform({ source, path: 'Component.stories.tsx' }, {} as API, {
parser: 'tsx',
})
).trim();
describe('csf-2-to-3', () => {
describe('javascript', () => {
it('should replace non-simple function exports with objects', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat' };
export const A = () => <Cat />;
export const B = (args) => <Button {...args} />;
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat' };
export const A = () => <Cat />;
export const B = {
render: (args) => <Button {...args} />,
};
`);
});
it('should move annotations into story objects', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat' };
export const A = () => <Cat />;
A.storyName = 'foo';
A.parameters = { bar: 2 };
A.play = () => {};
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat' };
export const A = {
render: () => <Cat />,
name: 'foo',
parameters: { bar: 2 },
play: () => {},
};
`);
});
it('should ignore non-story exports, statements', async () => {
await expect(
jsTransform(dedent`
export default { title: 'components/Fruit', includeStories: ['A'] };
export const A = (args) => <Apple {...args} />;
export const B = (args) => <Banana {...args} />;
const C = (args) => <Cherry {...args} />;
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'components/Fruit', includeStories: ['A'] };
export const A = {
render: (args) => <Apple {...args} />,
};
export const B = (args) => <Banana {...args} />;
const C = (args) => <Cherry {...args} />;
`);
});
it('should do nothing when there is no meta', async () => {
await expect(
jsTransform(dedent`
export const A = () => <Apple />;
export const B = (args) => <Banana {...args} />;
`)
).resolves.toMatchInlineSnapshot(`
export const A = () => <Apple />;
export const B = (args) => <Banana {...args} />;
`);
});
it('should remove implicit global render function (react)', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
export const A = (args) => <Cat {...args} />;
export const B = (args) => <Banana {...args} />;
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat', component: Cat };
export const A = {};
export const B = {
render: (args) => <Banana {...args} />,
};
`);
});
it('should ignore object exports', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
export const A = {
render: (args) => <Cat {...args} />
};
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat', component: Cat };
export const A = {
render: (args) => <Cat {...args} />,
};
`);
});
it('should hoist template.bind (if there is only one)', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat' };
const Template = (args) => <Cat {...args} />;
export const A = Template.bind({});
A.args = { isPrimary: false };
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat' };
const Template = (args) => <Cat {...args} />;
export const A = {
render: Template,
args: { isPrimary: false },
};
`);
});
it('should reuse the template when there are multiple Template.bind references but no component defined', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat' };
const Template = (args) => <Cat {...args} />;
export const A = Template.bind({});
A.args = { isPrimary: false };
export const B = Template.bind({});
B.args = { isPrimary: true };
export const C = Template.bind({});
C.args = { bla: true };
export const D = Template.bind({});
D.args = { bla: false };
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat' };
const Template = (args) => <Cat {...args} />;
export const A = {
render: Template,
args: { isPrimary: false },
};
export const B = {
render: Template,
args: { isPrimary: true },
};
export const C = {
render: Template,
args: { bla: true },
};
export const D = {
render: Template,
args: { bla: false },
};
`);
});
it('should remove implicit global render for template.bind', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
const Template = (args) => <Cat {...args} />;
export const A = Template.bind({});
A.args = { isPrimary: false };
const Template2 = (args) => <Banana {...args} />;
export const B = Template2.bind({});
B.args = { isPrimary: true };
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat', component: Cat };
export const A = {
args: { isPrimary: false },
};
const Template2 = (args) => <Banana {...args} />;
export const B = {
render: Template2,
args: { isPrimary: true },
};
`);
});
it('should ignore no-arg stories without annotations', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat', component: Cat };
export const A = (args) => <Cat {...args} />;
export const B = () => <Cat name="frisky" />;
export const C = () => <Cat name="fluffy" />;
C.parameters = { foo: 2 };
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat', component: Cat };
export const A = {};
export const B = () => <Cat name="frisky" />;
export const C = {
render: () => <Cat name="fluffy" />,
parameters: { foo: 2 },
};
`);
});
it('should work for v1-style annotations', async () => {
await expect(
jsTransform(dedent`
export default { title: 'Cat' };
export const A = (args) => <Cat {...args} />;
A.story = {
parameters: { foo: 2 }
};
`)
).resolves.toMatchInlineSnapshot(`
export default { title: 'Cat' };
export const A = {
render: (args) => <Cat {...args} />,
parameters: { foo: 2 },
};
`);
});
});
describe('typescript', () => {
it('should error with namespace imports', async () => {
await expect.addSnapshotSerializer({
serialize: (value) => {
const stringVal = typeof value === 'string' ? value : value.toString();
return stringVal.replace(ansiRegex(), '');
},
test: () => true,
});
await expect(() =>
tsTransform(dedent`
import * as SB from '@storybook/react';
import { CatProps } from './Cat';
const meta = { title: 'Cat', component: Cat } as Meta<CatProps>
export default meta;
export const A: SB.StoryFn<CatProps> = () => <Cat />;
`)
).rejects.toThrowErrorMatchingInlineSnapshot(dedent`
Error: This codemod does not support namespace imports for a @storybook/react package.
Replace the namespace import with named imports and try again.
`);
});
it('should keep local names', async () => {
await expect(
tsTransform(dedent`
import { Meta, StoryObj as CSF3, StoryFn as CSF2 } from '@storybook/react';
import { CatProps } from './Cat';
const meta = { title: 'Cat', component: Cat } satisfies Meta<CatProps>
export default meta;
export const A: CSF2<CatProps> = () => <Cat />;
export const B: CSF3<CatProps> = {
args: { name: "already csf3" }
};
export const C: CSF2<CatProps> = (args) => <Cat {...args} />;
C.args = {
name: "Fluffy"
};
`)
).resolves.toMatchInlineSnapshot(`
import { StoryFn as CSF2, StoryObj as CSF3, Meta } from '@storybook/react';
import { CatProps } from './Cat';
const meta = { title: 'Cat', component: Cat } satisfies Meta<CatProps>;
export default meta;
export const A: CSF2<CatProps> = () => <Cat />;
export const B: CSF3<CatProps> = {
args: { name: 'already csf3' },
};
export const C: CSF3<CatProps> = {
args: {
name: 'Fluffy',
},
};
`);
});
it('should replace function exports with objects and update type', async () => {
await expect(
tsTransform(dedent`
import { Story, StoryFn, ComponentStory, ComponentStoryObj } from '@storybook/react';
// some extra whitespace to test
export default {
title: 'Cat',
component: Cat,
} as Meta<CatProps>;
export const A: Story<CatProps> = (args) => <Cat {...args} />;
A.args = { name: "Fluffy" };
export const B: any = (args) => <Button {...args} />;
export const C: Story<CatProps> = () => <Cat />;
export const D: StoryFn<CatProps> = (args) => <Cat {...args} />;
D.args = {
name: "Fluffy"
};
export const E: ComponentStory<Cat> = (args) => <Cat {...args} />;
E.args = { name: "Fluffy" };
export const F: Story = (args) => <Cat {...args} />;
F.args = {
name: "Fluffy"
};
export const G: ComponentStoryObj<typeof Cat> = {
args: {
name: 'Fluffy',
},
};
`)
).resolves.toMatchInlineSnapshot(`
import { StoryFn, StoryObj } from '@storybook/react';
// some extra whitespace to test
export default {
title: 'Cat',
component: Cat,
} as Meta<CatProps>;
export const A: StoryObj<CatProps> = {
args: { name: 'Fluffy' },
};
export const B: any = {
render: (args) => <Button {...args} />,
};
export const C: StoryFn<CatProps> = () => <Cat />;
export const D: StoryObj<CatProps> = {
args: {
name: 'Fluffy',
},
};
export const E: StoryObj<Cat> = {
args: { name: 'Fluffy' },
};
export const F: StoryObj = {
args: {
name: 'Fluffy',
},
};
export const G: StoryObj<typeof Cat> = {
args: {
name: 'Fluffy',
},
};
`);
});
it('migrate Story type to StoryFn when used in an not exported Template function', async () => {
await expect(
tsTransform(dedent`
import { Story, Meta } from '@storybook/react'
export default {
component: Cat,
} satisfies Meta
const Template: Story = () => <div>Hello World</div>;
export const Default = Template.bind({})
`)
).resolves.toMatchInlineSnapshot(`
import { Meta, StoryFn } from '@storybook/react';
export default {
component: Cat,
} satisfies Meta;
const Template: StoryFn = () => <div>Hello World</div>;
export const Default = {
render: Template,
};
`);
});
});
});
``` | /content/code_sandbox/code/lib/codemod/src/transforms/__tests__/csf-2-to-3.test.ts | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 3,065 |
```xml
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at path_to_url
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Serialize="All" />
-->
<Directives xmlns="path_to_url">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>
``` | /content/code_sandbox/test-xamarin/WindowsUniversalTestApp16299/Properties/Default.rd.xml | xml | 2016-04-08T16:41:51 | 2024-08-16T05:55:59 | System.Linq.Dynamic.Core | zzzprojects/System.Linq.Dynamic.Core | 1,537 | 247 |
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {
FlowNodeInstance,
FlowNodeInstances,
flowNodeInstanceStore,
} from 'modules/stores/flowNodeInstance';
import {instanceHistoryModificationStore} from 'modules/stores/instanceHistoryModification';
import {modificationsStore} from 'modules/stores/modifications';
import {processInstanceDetailsStore} from 'modules/stores/processInstanceDetails';
import {processInstanceDetailsDiagramStore} from 'modules/stores/processInstanceDetailsDiagram';
import {
createEventSubProcessFlowNodeInstances,
createInstance,
createMultiInstanceFlowNodeInstances,
} from 'modules/testUtils';
import {useEffect} from 'react';
import {processInstanceDetailsStatisticsStore} from 'modules/stores/processInstanceDetailsStatistics';
import {TreeView} from '@carbon/react';
const multiInstanceProcessInstance: ProcessInstanceEntity = Object.freeze(
createInstance({
id: '2251799813686118',
processId: '2251799813686038',
processName: 'Multi-Instance Process',
state: 'INCIDENT',
bpmnProcessId: 'multiInstanceProcess',
}),
);
const eventSubprocessProcessInstance: ProcessInstanceEntity = Object.freeze(
createInstance({
id: '2251799813686118',
processId: '2251799813686038',
processName: 'Event subprocess Process',
state: 'INCIDENT',
bpmnProcessId: 'eventSubprocessProcess',
}),
);
const nestedSubProcessesInstance = Object.freeze(
createInstance({
id: '227539842356787',
processId: '39480256723678',
processName: 'Nested Sub Processes',
state: 'ACTIVE',
bpmnProcessId: 'NestedSubProcesses',
}),
);
const nestedSubProcessFlowNodeInstances: FlowNodeInstances = {
[nestedSubProcessesInstance.id]: {
running: null,
children: [
{
id: '2251799813686130',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'StartEvent_1',
startDate: '2020-08-18T12:07:33.953+0000',
endDate: '2020-08-18T12:07:34.034+0000',
treePath: `${nestedSubProcessesInstance.id}/2251799813686130`,
sortValues: ['1606300828415', '2251799813686130'],
},
{
id: '2251799813686156',
type: 'SERVICE_TASK',
state: 'ACTIVE',
flowNodeId: 'ServiceTask',
startDate: '2020-08-18T12:07:33.953+0000',
endDate: null,
treePath: `${nestedSubProcessesInstance.id}/2251799813686156`,
sortValues: ['1606300828415', '2251799813686156'],
},
],
},
};
const nestedSubProcessFlowNodeInstance: FlowNodeInstance = {
id: nestedSubProcessesInstance.id,
type: 'PROCESS',
state: 'ACTIVE',
flowNodeId: nestedSubProcessesInstance.bpmnProcessId,
treePath: nestedSubProcessesInstance.id,
startDate: '',
endDate: null,
sortValues: [],
};
const processId = 'multiInstanceProcess';
const processInstanceId = multiInstanceProcessInstance.id;
const flowNodeInstances =
createMultiInstanceFlowNodeInstances(processInstanceId);
const eventSubProcessFlowNodeInstances =
createEventSubProcessFlowNodeInstances(processInstanceId);
const multipleFlowNodeInstances: FlowNodeInstances = {
[processInstanceId]: {
running: null,
children: [
{
id: '2251799813686130',
type: 'EXCLUSIVE_GATEWAY',
state: 'COMPLETED',
flowNodeId: 'peterJoin',
startDate: '2020-08-18T12:07:33.953+0000',
endDate: '2020-08-18T12:07:34.034+0000',
treePath: `${processInstanceId}/2251799813686130`,
sortValues: ['1606300828415', '2251799813686130'],
},
{
id: '2251799813686156',
type: 'EXCLUSIVE_GATEWAY',
state: 'INCIDENT',
flowNodeId: 'peterJoin',
startDate: '2020-08-18T12:07:33.953+0000',
endDate: null,
treePath: `${processInstanceId}/2251799813686156`,
sortValues: ['1606300828415', '2251799813686156'],
},
],
},
};
const mockFlowNodeInstance: FlowNodeInstance = {
id: processInstanceId,
type: 'PROCESS',
state: 'COMPLETED',
flowNodeId: processId,
treePath: processInstanceId,
startDate: '',
endDate: null,
sortValues: [],
};
const mockRunningNodeInstance: FlowNodeInstance = {
id: processInstanceId,
type: 'PROCESS',
state: 'ACTIVE',
flowNodeId: 'nested_sub_process',
treePath: processInstanceId,
startDate: '',
endDate: null,
sortValues: [],
};
const multipleSubprocessesWithOneRunningScopeMock: {
firstLevel: FlowNodeInstances;
secondLevel1: FlowNodeInstances;
secondLevel2: FlowNodeInstances;
thirdLevel1: FlowNodeInstances;
thirdLevel2: FlowNodeInstances;
} = {
firstLevel: {
[processInstanceId]: {
children: [
{
id: '1',
type: 'SUB_PROCESS',
state: 'COMPLETED',
flowNodeId: 'parent_sub_process',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2',
type: 'SUB_PROCESS',
state: 'ACTIVE',
flowNodeId: 'parent_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
secondLevel1: {
[`${processInstanceId}/1`]: {
children: [
{
id: '1_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0oi4pw0',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '1_2',
type: 'SUB_PROCESS',
state: 'COMPLETED',
flowNodeId: 'inner_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '1_3',
type: 'END_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1k2dpf7',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
secondLevel2: {
[`${processInstanceId}/2`]: {
children: [
{
id: '2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0oi4pw0',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2_2',
type: 'SUB_PROCESS',
state: 'ACTIVE',
flowNodeId: 'inner_sub_process',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
thirdLevel1: {
[`${processInstanceId}/1/1_2`]: {
children: [
{
id: '1_2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1rw6vny',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '1_2_2',
type: 'USER_TASK',
state: 'COMPLETED',
flowNodeId: 'user_task',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '1_2_3',
type: 'END_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0ypvz5p',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
thirdLevel2: {
[`${processInstanceId}/2/2_2`]: {
children: [
{
id: '2_2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1rw6vny',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2/2_2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2_2_2',
type: 'USER_TASK',
state: 'ACTIVE',
flowNodeId: 'user_task',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2/2_2/2_2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
};
const multipleSubprocessesWithNoRunningScopeMock: {
firstLevel: FlowNodeInstances;
secondLevel1: FlowNodeInstances;
secondLevel2: FlowNodeInstances;
thirdLevel1: FlowNodeInstances;
thirdLevel2: FlowNodeInstances;
} = {
firstLevel: {
[processInstanceId]: {
children: [
{
id: '1',
type: 'SUB_PROCESS',
state: 'COMPLETED',
flowNodeId: 'parent_sub_process',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2',
type: 'SUB_PROCESS',
state: 'COMPLETED',
flowNodeId: 'parent_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
secondLevel1: {
[`${processInstanceId}/1`]: {
children: [
{
id: '1_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0oi4pw0',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '1_2',
type: 'SUB_PROCESS',
state: 'COMPLETED',
flowNodeId: 'inner_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '1_3',
type: 'END_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1k2dpf7',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
secondLevel2: {
[`${processInstanceId}/2`]: {
children: [
{
id: '2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0oi4pw0',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2_2',
type: 'SUB_PROCESS',
state: 'COMPLETED',
flowNodeId: 'inner_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '2_3',
type: 'END_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1k2dpf7',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
thirdLevel1: {
[`${processInstanceId}/1/1_2`]: {
children: [
{
id: '1_2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1rw6vny',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '1_2_2',
type: 'USER_TASK',
state: 'COMPLETED',
flowNodeId: 'user_task',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '1_2_3',
type: 'END_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0ypvz5p',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
thirdLevel2: {
[`${processInstanceId}/2/2_2`]: {
children: [
{
id: '2_2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1rw6vny',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2/2_2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2_2_2',
type: 'USER_TASK',
state: 'COMPLETED',
flowNodeId: 'user_task',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2/2_2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '2_2_3',
type: 'END_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0ypvz5p',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2/2_2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
};
const multipleSubprocessesWithTwoRunningScopesMock: {
firstLevel: FlowNodeInstances;
secondLevel1: FlowNodeInstances;
secondLevel2: FlowNodeInstances;
thirdLevel1: FlowNodeInstances;
thirdLevel2: FlowNodeInstances;
} = {
firstLevel: {
[processInstanceId]: {
children: [
{
id: '1',
type: 'SUB_PROCESS',
state: 'ACTIVE',
flowNodeId: 'parent_sub_process',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: null,
treePath: `${processInstanceId}/1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2',
type: 'SUB_PROCESS',
state: 'ACTIVE',
flowNodeId: 'parent_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
secondLevel1: {
[`${processInstanceId}/1`]: {
children: [
{
id: '1_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0oi4pw0',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '1_2',
type: 'SUB_PROCESS',
state: 'ACTIVE',
flowNodeId: 'inner_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/1/1_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '1_3',
type: 'END_EVENT',
state: 'ACTIVE',
flowNodeId: 'Event_1k2dpf7',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/1/1_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
secondLevel2: {
[`${processInstanceId}/2`]: {
children: [
{
id: '2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_0oi4pw0',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2_2',
type: 'SUB_PROCESS',
state: 'ACTIVE',
flowNodeId: 'inner_sub_process',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2/2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '2_3',
type: 'END_EVENT',
state: 'ACTIVE',
flowNodeId: 'Event_1k2dpf7',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2/2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
thirdLevel1: {
[`${processInstanceId}/1/1_2`]: {
children: [
{
id: '1_2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1rw6vny',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/1/1_2/1_2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '1_2_2',
type: 'USER_TASK',
state: 'ACTIVE',
flowNodeId: 'user_task',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/1/1_2/1_2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '1_2_3',
type: 'END_EVENT',
state: 'ACTIVE',
flowNodeId: 'Event_0ypvz5p',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/1/1_2/1_2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
thirdLevel2: {
[`${processInstanceId}/2/2_2`]: {
children: [
{
id: '2_2_1',
type: 'START_EVENT',
state: 'COMPLETED',
flowNodeId: 'Event_1rw6vny',
startDate: '2022-09-23T10:59:43.096+0000',
endDate: '2022-09-23T11:00:42.508+0000',
treePath: `${processInstanceId}/2/2_2/2_2_1`,
sortValues: ['1664017183097', '6755399441065192'],
},
{
id: '2_2_2',
type: 'USER_TASK',
state: 'ACTIVE',
flowNodeId: 'user_task',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2/2_2/2_2_2`,
sortValues: ['1664017183823', '6755399441065673'],
},
{
id: '2_2_3',
type: 'END_EVENT',
state: 'ACTIVE',
flowNodeId: 'Event_0ypvz5p',
startDate: '2022-09-23T10:59:43.822+0000',
endDate: null,
treePath: `${processInstanceId}/2/2_2/2_2_3`,
sortValues: ['1664017183823', '6755399441065673'],
},
],
running: null,
},
},
};
const Wrapper = ({children}: {children?: React.ReactNode}) => {
useEffect(() => {
return () => {
processInstanceDetailsStore.reset();
processInstanceDetailsDiagramStore.reset();
flowNodeInstanceStore.reset();
modificationsStore.reset();
processInstanceDetailsStatisticsStore.reset();
instanceHistoryModificationStore.reset();
};
}, []);
return (
<TreeView label={'instance history'} hideLabel>
{children}
</TreeView>
);
};
export {
multiInstanceProcessInstance,
nestedSubProcessesInstance,
processId,
processInstanceId,
flowNodeInstances,
eventSubProcessFlowNodeInstances,
nestedSubProcessFlowNodeInstances,
nestedSubProcessFlowNodeInstance,
mockFlowNodeInstance,
multipleFlowNodeInstances,
multipleSubprocessesWithOneRunningScopeMock,
multipleSubprocessesWithNoRunningScopeMock,
multipleSubprocessesWithTwoRunningScopesMock,
mockRunningNodeInstance,
eventSubprocessProcessInstance,
Wrapper,
};
``` | /content/code_sandbox/operate/client/src/App/ProcessInstance/FlowNodeInstancesTree/tests/mocks.tsx | xml | 2016-03-20T03:38:04 | 2024-08-16T19:59:58 | camunda | camunda/camunda | 3,172 | 6,464 |
```xml
import {
putCreateLog as commonPutCreateLog,
putUpdateLog as commonPutUpdateLog,
putDeleteLog as commonPutDeleteLog,
LogDesc,
IDescriptions,
gatherNames,
getSchemaLabels
} from "@erxes/api-utils/src/logUtils";
import { sendCoreMessage } from "./messageBroker";
import { LOG_MAPPINGS, MODULE_NAMES } from "./constants";
import { IModels } from "./connectionResolver";
import { collectConversations } from "./receiveMessage";
import { IChannelDocument } from "./models/definitions/channels";
import { IIntegrationDocument } from "./models/definitions/integrations";
const LOG_ACTIONS = {
CREATE: "create",
UPDATE: "update",
DELETE: "delete"
};
const findFromCore = async (
subdomain: string,
ids: string[],
collectionName: string
) => {
return sendCoreMessage({
subdomain,
action: `${collectionName}.find`,
data: {
query: { _id: { $in: ids } }
},
isRPC: true,
defaultValue: []
});
};
const findTags = async (subdomain: string, ids: string[]) => {
return sendCoreMessage({
subdomain,
action: "tagFind",
data: {
_id: { $in: ids }
},
isRPC: true,
defaultValue: []
});
};
const formsFind = async (subdomain: string, ids: string[]) => {
return sendCoreMessage({
subdomain,
action: "formsFind",
data: {
query: { _id: { $in: ids } }
},
isRPC: true,
defaultValue: []
});
};
export const gatherIntegrationFieldNames = async (
subdomain: string,
doc: IIntegrationDocument,
prevList?: LogDesc[]
) => {
let options: LogDesc[] = [];
if (prevList) {
options = prevList;
}
if (doc.createdUserId) {
options = await gatherNames({
nameFields: ["email", "username"],
foreignKey: "createdUserId",
prevList: options,
items: await findFromCore(subdomain, [doc.createdUserId], "users")
});
}
if (doc.brandId) {
options = await gatherNames({
foreignKey: "brandId",
prevList: options,
nameFields: ["name"],
items: await findFromCore(subdomain, [doc.brandId], "brands")
});
}
if (doc.tagIds && doc.tagIds.length > 0) {
options = await gatherNames({
foreignKey: "tagIds",
prevList: options,
nameFields: ["name"],
items: await findTags(subdomain, doc.tagIds)
});
}
if (doc.formId) {
options = await gatherNames({
foreignKey: "formId",
prevList: options,
nameFields: ["title"],
items: await formsFind(subdomain, [doc.formId])
});
}
return options;
};
export const gatherChannelFieldNames = async (
models: IModels,
subdomain: string,
doc: IChannelDocument,
prevList?: LogDesc[]
): Promise<LogDesc[]> => {
let options: LogDesc[] = [];
if (prevList) {
options = prevList;
}
if (doc.userId) {
options = await gatherNames({
nameFields: ["userId"],
foreignKey: "userId",
prevList: options,
items: await findFromCore(subdomain, [doc.userId], "users")
});
}
if (doc.memberIds && doc.memberIds.length > 0) {
options = await gatherNames({
nameFields: ["memberIds"],
foreignKey: "memberIds",
prevList: options,
items: await findFromCore(subdomain, doc.memberIds, "users")
});
}
if (doc.integrationIds && doc.integrationIds.length > 0) {
options = await gatherNames({
foreignKey: "integrationIds",
prevList: options,
nameFields: ["name"],
items: await models.Integrations.findIntegrations({
_id: { $in: doc.integrationIds }
})
});
}
return options;
};
const gatherDescriptions = async (
models: IModels,
subdomain: string,
params: any
): Promise<IDescriptions> => {
const { action, type, object, updatedDocument } = params;
let extraDesc: LogDesc[] = [];
const description = `"${object.name}" has been ${action}d`;
switch (type) {
case MODULE_NAMES.CHANNEL:
extraDesc = await gatherChannelFieldNames(models, subdomain, object);
if (updatedDocument) {
extraDesc = await gatherChannelFieldNames(
models,
subdomain,
updatedDocument,
extraDesc
);
}
break;
case MODULE_NAMES.INTEGRATION:
extraDesc = await gatherIntegrationFieldNames(subdomain, object);
if (updatedDocument) {
extraDesc = await gatherIntegrationFieldNames(
subdomain,
updatedDocument,
extraDesc
);
}
break;
case MODULE_NAMES.RESPONSE_TEMPLATE:
const brandIds: string[] = [];
if (object.brandId) {
brandIds.push(object.brandId);
}
if (
updatedDocument &&
updatedDocument.brandId &&
updatedDocument.brandId !== object.brandId
) {
brandIds.push(updatedDocument.brandId);
}
if (brandIds.length > 0) {
extraDesc = await gatherNames({
nameFields: ["name"],
foreignKey: "brandId",
items: await findFromCore(subdomain, brandIds, "brands")
});
}
break;
default:
break;
}
return { extraDesc, description };
};
export const putDeleteLog = async (
models: IModels,
subdomain: string,
logDoc,
user
) => {
const { description, extraDesc } = await gatherDescriptions(
models,
subdomain,
{
...logDoc,
action: LOG_ACTIONS.DELETE
}
);
await commonPutDeleteLog(
subdomain,
{ ...logDoc, description, extraDesc, type: `inbox:${logDoc.type}` },
user
);
};
export const putUpdateLog = async (
models: IModels,
subdomain: string,
logDoc,
user
) => {
const { description, extraDesc } = await gatherDescriptions(
models,
subdomain,
{
...logDoc,
action: LOG_ACTIONS.UPDATE
}
);
await commonPutUpdateLog(
subdomain,
{ ...logDoc, description, extraDesc, type: `inbox:${logDoc.type}` },
user
);
};
export const putCreateLog = async (
models: IModels,
subdomain: string,
logDoc,
user
) => {
const { description, extraDesc } = await gatherDescriptions(
models,
subdomain,
{
...logDoc,
action: LOG_ACTIONS.CREATE
}
);
await commonPutCreateLog(
subdomain,
{ ...logDoc, description, extraDesc, type: `inbox:${logDoc.type}` },
user
);
};
export default {
collectItems: async ({ subdomain, data }) => ({
data: await collectConversations(subdomain, data),
status: "success"
}),
getSchemaLabels: ({ data: { type } }) => ({
status: "success",
data: getSchemaLabels(type, LOG_MAPPINGS)
})
};
``` | /content/code_sandbox/packages/plugin-inbox-api/src/logUtils.ts | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 1,668 |
```xml
import type { StackFrame } from 'next/dist/compiled/stacktrace-parser'
import {
getFrameSource,
type OriginalStackFrame,
} from '../../helpers/stack-frame'
import { useOpenInEditor } from '../../helpers/use-open-in-editor'
import { HotlinkedText } from '../../components/hot-linked-text'
export const CallStackFrame: React.FC<{
frame: OriginalStackFrame
}> = function CallStackFrame({ frame }) {
// TODO: ability to expand resolved frames
// TODO: render error or external indicator
const f: StackFrame = frame.originalStackFrame ?? frame.sourceStackFrame
const hasSource = Boolean(frame.originalCodeFrame)
const open = useOpenInEditor(
hasSource
? {
file: f.file,
lineNumber: f.lineNumber,
column: f.column,
}
: undefined
)
return (
<div data-nextjs-call-stack-frame>
<h3 data-nextjs-frame-expanded={Boolean(frame.expanded)}>
<HotlinkedText text={f.methodName} />
</h3>
<div
data-has-source={hasSource ? 'true' : undefined}
tabIndex={hasSource ? 10 : undefined}
role={hasSource ? 'link' : undefined}
onClick={open}
title={hasSource ? 'Click to open in your editor' : undefined}
>
<span>{getFrameSource(f)}</span>
<svg
xmlns="path_to_url"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
<polyline points="15 3 21 3 21 9"></polyline>
<line x1="10" y1="14" x2="21" y2="3"></line>
</svg>
</div>
</div>
)
}
``` | /content/code_sandbox/packages/next/src/client/components/react-dev-overlay/internal/container/RuntimeError/CallStackFrame.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 480 |
```xml
import {
Button,
MainStyleTopHeader as TopHeader,
Sidebar as LeftSidebar,
SidebarList as List
} from '@erxes/ui/src';
import React from 'react';
import { Link } from 'react-router-dom';
import { __ } from 'coreui/utils';
class Sidebar extends React.Component {
renderListItem(url: string, text: string) {
return (
<li>
<Link
to={url}
className={window.location.href.includes(url) ? 'active' : ''}
>
{__(text)}
</Link>
</li>
);
}
renderSidebarHeader() {
return (
<TopHeader>
<Link to="/settings/">
<Button
btnStyle="simple"
icon="arrow-circle-left"
block={true}
uppercase={false}
>
{__('Back to Settings')}
</Button>
</Link>
</TopHeader>
);
}
render() {
return (
<LeftSidebar full={true} header={this.renderSidebarHeader()}>
<List id="SettingsSidebar">
{this.renderListItem(
'/erxes-plugin-loan/main-settings',
__('Loan settings')
)}
{this.renderListItem(
'/erxes-plugin-loan/undue-settings',
__('Loan not calc undue settings')
)}
{this.renderListItem(
'/erxes-plugin-loan/holiday-settings',
__('Holiday configs')
)}
</List>
</LeftSidebar>
);
}
}
export default Sidebar;
``` | /content/code_sandbox/packages/plugin-zms-ui/src/settings/components/Sidebar.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 327 |
```xml
import { Component, Input, OnDestroy } from "@angular/core";
import { Subject } from "rxjs";
import { AvatarService } from "@bitwarden/common/auth/abstractions/avatar.service";
import { SharedModule } from "../shared";
type SizeTypes = "xlarge" | "large" | "default" | "small" | "xsmall";
@Component({
selector: "dynamic-avatar",
standalone: true,
imports: [SharedModule],
template: `<span [title]="title">
<bit-avatar
appStopClick
[text]="text"
[size]="size"
[color]="color$ | async"
[border]="border"
[id]="id"
[title]="title"
>
</bit-avatar>
</span>`,
})
export class DynamicAvatarComponent implements OnDestroy {
@Input() border = false;
@Input() id: string;
@Input() text: string;
@Input() title: string;
@Input() size: SizeTypes = "default";
private destroy$ = new Subject<void>();
color$ = this.avatarService.avatarColor$;
constructor(private avatarService: AvatarService) {
if (this.text) {
this.text = this.text.toUpperCase();
}
}
async ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
}
``` | /content/code_sandbox/apps/web/src/app/components/dynamic-avatar.component.ts | xml | 2016-03-09T23:14:01 | 2024-08-16T15:07:51 | clients | bitwarden/clients | 8,877 | 287 |
```xml
export interface PropertyTree {
[property: string]: null | PropertyTree;
}
export interface ParsedMergeArgsExpr {
args: Record<string, any>;
usedProperties: PropertyTree;
mappingInstructions?: Array<MappingInstruction>;
expansions?: Array<Expansion>;
}
export interface MappingInstruction {
destinationPath: Array<string>;
sourcePath: Array<string>;
}
export interface Expansion {
valuePath: Array<string>;
value: any;
mappingInstructions: Array<MappingInstruction>;
}
export type VariablePaths = Record<string, Array<string | number>>;
export interface StitchingDirectivesOptions {
keyDirectiveName?: string;
computedDirectiveName?: string;
mergeDirectiveName?: string;
canonicalDirectiveName?: string;
pathToDirectivesInExtensions?: Array<string>;
}
type Complete<T> = {
[P in keyof Required<T>]: Exclude<
Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined,
undefined
>;
};
export type StitchingDirectivesFinalOptions = Complete<StitchingDirectivesOptions>;
export interface MergedTypeResolverInfo extends ParsedMergeArgsExpr {
fieldName: string;
returnsList: boolean;
}
``` | /content/code_sandbox/packages/stitching-directives/src/types.ts | xml | 2016-03-22T00:14:38 | 2024-08-16T02:02:06 | graphql-tools | ardatan/graphql-tools | 5,331 | 259 |
```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 dlaswp = require( './index' );
// TESTS //
// The function returns a Float64Array...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectType Float64Array
}
// The compiler throws an error if the function is provided a first argument which is not a string...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 5, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( true, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( false, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( null, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( void 0, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( [], 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( {}, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( ( x: number ): number => x, 3, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a second argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 'column-major', '5', A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', true, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', false, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', null, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', void 0, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', [], A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', {}, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', ( x: number ): number => x, A, 2, 0, 2, IPIV, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a third argument which is not a Float64Array...
{
const IPIV = new Int32Array( 3 );
dlaswp( 'column-major', 3, '5', 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, 5, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, true, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, false, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, null, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, void 0, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, [], 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, {}, 2, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, ( x: number ): number => x, 2, 0, 2, IPIV, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a fourth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 'column-major', 3, A, '5', 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, true, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, false, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, null, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, void 0, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, [], 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, {}, 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, ( x: number ): number => x, 0, 2, IPIV, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a fifth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 'column-major', 3, A, 2, '5', 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, true, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, false, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, null, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, void 0, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, [], 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, {}, 2, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, ( x: number ): number => x, 2, IPIV, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a sixth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 'column-major', 3, A, 2, 0, '5', IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, true, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, false, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, null, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, void 0, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, [], IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, {}, IPIV, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, ( x: number ): number => x, IPIV, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided a seventh argument which is not an Int32Array...
{
const A = new Float64Array( 6 );
dlaswp( 'column-major', 3, A, 2, 0, 2, '5', 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, 5, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, true, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, false, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, null, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, void 0, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, [], 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, {}, 1 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, ( x: number ): number => x, 1 ); // $ExpectError
}
// The compiler throws an error if the function is provided an eighth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, '5' ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, true ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, false ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, null ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, void 0 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, [] ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, {} ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the function is provided an unsupported number of arguments...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp(); // $ExpectError
dlaswp( 'column-major' ); // $ExpectError
dlaswp( 'column-major', 3 ); // $ExpectError
dlaswp( 'column-major', 3, A ); // $ExpectError
dlaswp( 'column-major', 3, A, 2 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2 ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV ); // $ExpectError
dlaswp( 'column-major', 3, A, 2, 0, 2, IPIV, 1, 10 ); // $ExpectError
}
// Attached to main export is an `ndarray` method which returns a Float64Array...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectType Float64Array
}
// The compiler throws an error if the function is provided a first argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( '5', A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( true, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( false, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( null, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( void 0, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( [], A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( {}, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( ( x: number ): number => x, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a second argument which is not a Float64Array...
{
const IPIV = new Int32Array( 3 );
dlaswp.ndarray( 2, '5', 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, 5, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, true, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, false, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, null, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, void 0, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, [], 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, {}, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, ( x: number ): number => x, 2, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a third argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, '5', 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, true, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, false, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, null, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, void 0, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, [], 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, {}, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, ( x: number ): number => x, 1, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a fourth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, '5', 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, true, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, false, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, null, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, void 0, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, [], 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, {}, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, ( x: number ): number => x, 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a fifth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, '5', 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, true, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, false, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, null, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, void 0, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, [], 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, {}, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, ( x: number ): number => x, 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a sixth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, '5', 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, true, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, false, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, null, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, void 0, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, [], 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, {}, 2, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, ( x: number ): number => x, 2, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a seventh argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, 0, '5', 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, true, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, false, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, null, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, void 0, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, [], 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, {}, 1, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, ( x: number ): number => x, 1, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided an eighth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, '5', IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, true, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, false, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, null, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, void 0, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, [], IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, {}, IPIV, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, ( x: number ): number => x, IPIV, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a ninth argument which is not an Int32Array...
{
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, '5', 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, 5, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, true, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, false, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, null, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, void 0, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, [], 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, {}, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, ( x: number ): number => x, 1, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided a tenth argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, '5', 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, true, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, false, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, null, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, void 0, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, [], 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, {}, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, ( x: number ): number => x, 0 ); // $ExpectError
}
// The compiler throws an error if the function is provided an eleventh argument which is not a number...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, '5' ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, true ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, false ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, null ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, void 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, [] ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, {} ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, ( x: number ): number => x ); // $ExpectError
}
// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
{
const IPIV = new Int32Array( 3 );
const A = new Float64Array( 6 );
dlaswp.ndarray(); // $ExpectError
dlaswp.ndarray( 2 ); // $ExpectError
dlaswp.ndarray( 2, A ); // $ExpectError
dlaswp.ndarray( 2, A, 2 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1 ); // $ExpectError
dlaswp.ndarray( 2, A, 2, 1, 0, 0, 2, 1, IPIV, 1, 0, 10 ); // $ExpectError
}
``` | /content/code_sandbox/lib/node_modules/@stdlib/lapack/base/dlaswp/docs/types/test.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 7,776 |
```xml
import Image from "next/image";
import styles from "./page.module.css";
export default function Home() {
return (
<main className={styles.main}>
<div className={styles.description}>
<p>
Get started by editing
<code className={styles.code}>src/app/page.tsx</code>
</p>
<div>
<a
href="path_to_url"
target="_blank"
rel="noopener noreferrer"
>
By{" "}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
/>
</a>
</div>
</div>
<div className={styles.center}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>
<div className={styles.grid}>
<a
href="path_to_url"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Docs <span>-></span>
</h2>
<p>Find in-depth information about Next.js features and API.</p>
</a>
<a
href="path_to_url"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Learn <span>-></span>
</h2>
<p>Learn about Next.js in an interactive course with quizzes!</p>
</a>
<a
href="path_to_url"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Templates <span>-></span>
</h2>
<p>Explore starter templates for Next.js.</p>
</a>
<a
href="path_to_url"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Deploy <span>-></span>
</h2>
<p>
Instantly deploy your Next.js site to a shareable URL with Vercel.
</p>
</a>
</div>
</main>
);
}
``` | /content/code_sandbox/examples/with-storybook/app/page.tsx | xml | 2016-10-05T23:32:51 | 2024-08-16T19:44:30 | next.js | vercel/next.js | 124,056 | 519 |
```xml
import type { FC } from 'react';
import React from 'react';
import { Markdown } from './Markdown';
import type { Of } from './useOf';
import { useOf } from './useOf';
export enum DescriptionType {
INFO = 'info',
NOTES = 'notes',
DOCGEN = 'docgen',
AUTO = 'auto',
}
interface DescriptionProps {
/**
* Specify where to get the description from. Can be a component, a CSF file or a story. If not
* specified, the description will be extracted from the meta of the attached CSF file.
*/
of?: Of;
}
const getDescriptionFromResolvedOf = (resolvedOf: ReturnType<typeof useOf>): string | null => {
switch (resolvedOf.type) {
case 'story': {
return resolvedOf.story.parameters.docs?.description?.story || null;
}
case 'meta': {
const { parameters, component } = resolvedOf.preparedMeta;
const metaDescription = parameters.docs?.description?.component;
if (metaDescription) {
return metaDescription;
}
return (
parameters.docs?.extractComponentDescription?.(component, {
component,
parameters,
}) || null
);
}
case 'component': {
const {
component,
projectAnnotations: { parameters },
} = resolvedOf;
return (
parameters.docs?.extractComponentDescription?.(component, {
component,
parameters,
}) || null
);
}
default: {
throw new Error(
`Unrecognized module type resolved from 'useOf', got: ${(resolvedOf as any).type}`
);
}
}
};
const DescriptionContainer: FC<DescriptionProps> = (props) => {
const { of } = props;
if ('of' in props && of === undefined) {
throw new Error('Unexpected `of={undefined}`, did you mistype a CSF file reference?');
}
const resolvedOf = useOf(of || 'meta');
const markdown = getDescriptionFromResolvedOf(resolvedOf);
return markdown ? <Markdown>{markdown}</Markdown> : null;
};
export { DescriptionContainer as Description };
``` | /content/code_sandbox/code/lib/blocks/src/blocks/Description.tsx | xml | 2016-03-18T04:23:44 | 2024-08-16T19:22:08 | storybook | storybookjs/storybook | 83,755 | 460 |
```xml
import * as http from 'http'
import * as http2 from 'http2'
import * as https from 'https'
/**
* Standard HTTP method strings
*/
type _HTTPMethods = 'DELETE' | 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'OPTIONS' |
'PROPFIND' | 'PROPPATCH' | 'MKCOL' | 'COPY' | 'MOVE' | 'LOCK' | 'UNLOCK' | 'TRACE' | 'SEARCH' | 'REPORT' | 'MKCALENDAR'
export type HTTPMethods = Uppercase<_HTTPMethods> | Lowercase<_HTTPMethods>
/**
* A union type of the Node.js server types from the http, https, and http2 modules.
*/
export type RawServerBase = http.Server | https.Server | http2.Http2Server | http2.Http2SecureServer
/**
* The default server type
*/
export type RawServerDefault = http.Server
/**
* The default request type based on the server type. Utilizes generic constraining.
*/
export type RawRequestDefaultExpression<
RawServer extends RawServerBase = RawServerDefault
> = RawServer extends http.Server | https.Server ? http.IncomingMessage
: RawServer extends http2.Http2Server | http2.Http2SecureServer ? http2.Http2ServerRequest
: never
/**
* The default reply type based on the server type. Utilizes generic constraining.
*/
export type RawReplyDefaultExpression<
RawServer extends RawServerBase = RawServerDefault
> = RawServer extends http.Server | https.Server ? http.ServerResponse
: RawServer extends http2.Http2Server | http2.Http2SecureServer ? http2.Http2ServerResponse
: never
export type RequestBodyDefault = unknown
export type RequestQuerystringDefault = unknown
export type RequestParamsDefault = unknown
export type RequestHeadersDefault = unknown
export type ContextConfigDefault = unknown
export type ReplyDefault = unknown
/**
* Helpers for determining the type of the response payload based on the code
*/
type StringAsNumber<T extends string> = T extends `${infer N extends number}` ? N : never
type CodeClasses = 1 | 2 | 3 | 4 | 5
type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
type HttpCodes = StringAsNumber<`${CodeClasses}${Digit}${Digit}`>
type HttpKeys = HttpCodes | `${Digit}xx`
export type StatusCodeReply = {
[Key in HttpKeys]?: unknown;
}
// weird TS quirk: path_to_url
export type ReplyKeysToCodes<Key> = [Key] extends [never] ? number :
Key extends HttpCodes ? Key :
Key extends `${infer X extends CodeClasses}xx` ?
StringAsNumber<`${X}${Digit}${Digit}`> : number
export type CodeToReplyKey<Code extends number> = `${Code}` extends `${infer FirstDigit extends CodeClasses}${number}`
? `${FirstDigit}xx`
: never
export type RecordKeysToLowercase<Input> = Input extends Record<string, unknown>
? {
[Key in keyof Input as Key extends string
? Lowercase<Key>
: Key
]: Input[Key];
}
: Input
type OmitIndexSignature<T> = {
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
}
/**
* HTTP header strings
* Use this type only for input values, not for output values.
*/
export type HttpHeader = keyof OmitIndexSignature<http.OutgoingHttpHeaders> | (string & Record<never, never>)
``` | /content/code_sandbox/types/utils.d.ts | xml | 2016-09-28T19:10:14 | 2024-08-16T19:06:24 | fastify | fastify/fastify | 31,648 | 793 |
```xml
export { BottomSheetPlacement } from "./types";
export { BottomSheet } from "./BottomSheet";
export { BottomSheetProvider, useBottomSheetContext } from "./context";
export { BottomSheetLayout } from "./components/BottomSheetLayout/BottomSheetLayout";
export { BottomSheetWithoutContext } from "./components/BottomSheetWithoutContext/BottomSheetWithoutContext";
``` | /content/code_sandbox/app/src/componentsV2/BottomSheet/index.ts | xml | 2016-12-01T04:36:06 | 2024-08-16T19:12:19 | requestly | requestly/requestly | 2,121 | 75 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.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="checked|Win32">
<Configuration>checked</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="profile|Win32">
<Configuration>profile</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{75A6206D-F123-AEE0-FF3D-386A62604731}</ProjectGuid>
<RootNamespace>SamplePlatform-MT</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</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)'=='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)'=='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>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<OutDir>./../../lib/vc15win32\</OutDir>
<IntDir>./Win32/SamplePlatform-MT/debug\</IntDir>
<TargetExt>.lib</TargetExt>
<TargetName>$(ProjectName)DEBUG</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<AdditionalOptions>/EHsc /GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4062 /wd4100 /wd4130 /wd4201 /wd4242 /wd4244 /wd4245 /wd4265 /wd4266 /wd4324 /wd4389 /wd4365 /wd4371 /wd4447 /wd4189 /wd4191 /wd4350 /wd4505 /wd4512 /wd4548 /wd4571 /wd4625 /wd4626 /wd4668 /wd4619 /wd4701 /wd4702 /wd4706 /wd4710 /wd4711 /wd4640 /wd4061 /wd4826 /wd4946 /wd4917 /wd4986 /wd4987 /wd4456 /wd4457 /wd4458 /wd4459 /wd4774 /wd4777 /wd5027 /wd5029 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd4774 /wd5026 /wd5039 /wd4596 /wd4996 /wd5038 /wd5045 /Zi /d2Zi+</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./../../include;./../../../renderer/include;./../../../framework/include;./../../../../PxToolkit/include;./../../../../../Include;./../../../../../Source/Common/include;./../../../../../Source/Common/include/windows;./../../../../../../Externals/targa/1;./../../../../../../PxShared/include;./../../../../../../PxShared/src/foundation/include;$(DXSDK_DIR)/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>PHYSX_PROFILE_SDK;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;_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>
<Lib>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)DEBUG.lib</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<OutDir>./../../lib/vc15win32\</OutDir>
<IntDir>./Win32/SamplePlatform-MT/release\</IntDir>
<TargetExt>.lib</TargetExt>
<TargetName>$(ProjectName)</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/EHsc /GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4062 /wd4100 /wd4130 /wd4201 /wd4242 /wd4244 /wd4245 /wd4265 /wd4266 /wd4324 /wd4389 /wd4365 /wd4371 /wd4447 /wd4189 /wd4191 /wd4350 /wd4505 /wd4512 /wd4548 /wd4571 /wd4625 /wd4626 /wd4668 /wd4619 /wd4701 /wd4702 /wd4706 /wd4710 /wd4711 /wd4640 /wd4061 /wd4826 /wd4946 /wd4917 /wd4986 /wd4987 /wd4456 /wd4457 /wd4458 /wd4459 /wd4774 /wd4777 /wd5027 /wd5029 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd4774 /wd5026 /wd5039 /wd4596 /wd4996 /wd5038 /wd5045 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../include;./../../../renderer/include;./../../../framework/include;./../../../../PxToolkit/include;./../../../../../Include;./../../../../../Source/Common/include;./../../../../../Source/Common/include/windows;./../../../../../../Externals/targa/1;./../../../../../../PxShared/include;./../../../../../../PxShared/src/foundation/include;$(DXSDK_DIR)/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>PHYSX_PROFILE_SDK;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;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>
<Lib>
<AdditionalOptions>/INCREMENTAL:NO</AdditionalOptions>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<OutDir>./../../lib/vc15win32\</OutDir>
<IntDir>./Win32/SamplePlatform-MT/checked\</IntDir>
<TargetExt>.lib</TargetExt>
<TargetName>$(ProjectName)CHECKED</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/EHsc /GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4062 /wd4100 /wd4130 /wd4201 /wd4242 /wd4244 /wd4245 /wd4265 /wd4266 /wd4324 /wd4389 /wd4365 /wd4371 /wd4447 /wd4189 /wd4191 /wd4350 /wd4505 /wd4512 /wd4548 /wd4571 /wd4625 /wd4626 /wd4668 /wd4619 /wd4701 /wd4702 /wd4706 /wd4710 /wd4711 /wd4640 /wd4061 /wd4826 /wd4946 /wd4917 /wd4986 /wd4987 /wd4456 /wd4457 /wd4458 /wd4459 /wd4774 /wd4777 /wd5027 /wd5029 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd4774 /wd5026 /wd5039 /wd4596 /wd4996 /wd5038 /wd5045 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../include;./../../../renderer/include;./../../../framework/include;./../../../../PxToolkit/include;./../../../../../Include;./../../../../../Source/Common/include;./../../../../../Source/Common/include/windows;./../../../../../../Externals/targa/1;./../../../../../../PxShared/include;./../../../../../../PxShared/src/foundation/include;$(DXSDK_DIR)/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>PHYSX_PROFILE_SDK;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;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>
<Lib>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)CHECKED.lib</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<OutDir>./../../lib/vc15win32\</OutDir>
<IntDir>./Win32/SamplePlatform-MT/profile\</IntDir>
<TargetExt>.lib</TargetExt>
<TargetName>$(ProjectName)PROFILE</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/EHsc /GR- /GF /arch:SSE2 /MP /Wall /wd4514 /wd4820 /wd4062 /wd4100 /wd4130 /wd4201 /wd4242 /wd4244 /wd4245 /wd4265 /wd4266 /wd4324 /wd4389 /wd4365 /wd4371 /wd4447 /wd4189 /wd4191 /wd4350 /wd4505 /wd4512 /wd4548 /wd4571 /wd4625 /wd4626 /wd4668 /wd4619 /wd4701 /wd4702 /wd4706 /wd4710 /wd4711 /wd4640 /wd4061 /wd4826 /wd4946 /wd4917 /wd4986 /wd4987 /wd4456 /wd4457 /wd4458 /wd4459 /wd4774 /wd4777 /wd5027 /wd5029 /wd4464 /wd4623 /wd4626 /wd5027 /wd4987 /wd4774 /wd5026 /wd5039 /wd4596 /wd4996 /wd5038 /wd5045 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../include;./../../../renderer/include;./../../../framework/include;./../../../../PxToolkit/include;./../../../../../Include;./../../../../../Source/Common/include;./../../../../../Source/Common/include/windows;./../../../../../../Externals/targa/1;./../../../../../../PxShared/include;./../../../../../../PxShared/src/foundation/include;$(DXSDK_DIR)/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>PHYSX_PROFILE_SDK;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;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>
<Lib>
<AdditionalOptions>/INCREMENTAL:NO</AdditionalOptions>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)PROFILE.lib</OutputFile>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\windows\WindowsSamplePlatform.h">
</ClInclude>
<ClInclude Include="..\..\include\windows\WindowsSampleUserInput.h">
</ClInclude>
<ClInclude Include="..\..\include\windows\WindowsSampleUserInputIds.h">
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\SamplePlatform.h">
</ClInclude>
<ClInclude Include="..\..\include\SampleUserInput.h">
</ClInclude>
<ClInclude Include="..\..\include\SampleUserInputIds.h">
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\windows\WindowsSamplePlatform.cpp">
</ClCompile>
<ClCompile Include="..\..\src\windows\WindowsSampleUserInput.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\SamplePlatform.cpp">
</ClCompile>
<ClCompile Include="..\..\src\SampleUserInput.cpp">
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"></ImportGroup>
</Project>
``` | /content/code_sandbox/PhysX_3.4/Samples/SampleFramework/platform/compiler/vc15win32/SamplePlatform-MT.vcxproj | xml | 2016-10-12T16:34:31 | 2024-08-16T09:40:38 | PhysX-3.4 | NVIDIAGameWorks/PhysX-3.4 | 2,343 | 4,604 |
```xml
/*
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
// TypeScript Version: 4.1
/**
* Interface describing `scusumors`.
*/
interface Routine {
/**
* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.
*
* @param N - number of indexed elements
* @param sum - initial sum
* @param x - input array
* @param strideX - `x` stride length
* @param y - output array
* @param strideY - `y` stride length
* @returns output array
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
*
* scusumors( x.length, 0.0, x, 1, y, 1 );
* // y => <Float32Array>[ 1.0, -1.0, 1.0 ]
*/
( N: number, sum: number, x: Float32Array, strideX: number, y: Float32Array, strideY: number ): Float32Array;
/**
* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation and alternative indexing semantics.
*
* @param N - number of indexed elements
* @param sum - initial sum
* @param x - input array
* @param strideX - `x` stride length
* @param offsetX - starting index for `x`
* @param y - output array
* @param strideY - `y` stride length
* @param offsetY - starting index for `y`
* @returns output array
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
*
* scusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );
* // y => <Float32Array>[ 1.0, -1.0, 1.0 ]
*/
ndarray( N: number, sum: number, x: Float32Array, strideX: number, offsetX: number, y: Float32Array, strideY: number, offsetY: number ): Float32Array;
}
/**
* Computes the cumulative sum of single-precision floating-point strided array elements using ordinary recursive summation.
*
* @param N - number of indexed elements
* @param sum - initial sum
* @param x - input array
* @param strideX - `x` stride length
* @param y - output array
* @param strideY - `y` stride length
* @returns output array
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
*
* scusumors( x.length, 0.0, x, 1, y, 1 );
* // y => <Float32Array>[ 1.0, -1.0, 1.0 ]
*
* @example
* var Float32Array = require( '@stdlib/array/float32' );
*
* var x = new Float32Array( [ 1.0, -2.0, 2.0 ] );
* var y = new Float32Array( x.length );
*
* scusumors.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );
* // y => <Float32Array>[ 1.0, -1.0, 1.0 ]
*/
declare var scusumors: Routine;
// EXPORTS //
export = scusumors;
``` | /content/code_sandbox/lib/node_modules/@stdlib/blas/ext/base/scusumors/docs/types/index.d.ts | xml | 2016-03-24T04:19:52 | 2024-08-16T09:03:19 | stdlib | stdlib-js/stdlib | 4,266 | 958 |
```xml
import type { ComponentProps, ComponentState, EventHandler, Slot } from '@fluentui/react-utilities';
import { type PopoverContextValue } from '@fluentui/react-popover';
import { type CarouselContextValue } from './Carousel/CarouselContext';
import type { CarouselValueChangeData } from './Carousel/Carousel.types';
export type TeachingPopoverCarouselSlots = {
/**
* The element wrapping carousel pages and navigation.
*/
root: NonNullable<Slot<'div'>>;
};
/**
* TeachingPopoverCarousel Props
*/
export type TeachingPopoverCarouselProps = ComponentProps<TeachingPopoverCarouselSlots> & {
/**
* The initial page to display in uncontrolled mode.
*/
defaultValue?: string;
/**
* The value of the currently active page.
*/
value?: string;
/**
* Callback to notify a page change.
*/
onValueChange?: EventHandler<CarouselValueChangeData>;
/**
* Callback to notify when the final button step of a carousel has been activated.
*/
onFinish?: EventHandler<CarouselValueChangeData>;
};
/**
* TeachingPopoverCarousel State and Context Hooks
*/
export type TeachingPopoverCarouselState = ComponentState<Required<TeachingPopoverCarouselSlots>> &
Partial<Pick<PopoverContextValue, 'appearance'>> &
CarouselContextValue;
/**
* Context shared between TeachingPopoverCarousel and its children components
*/
export type TeachingPopoverCarouselContextValues = {
carousel: CarouselContextValue;
};
``` | /content/code_sandbox/packages/react-components/react-teaching-popover/library/src/components/TeachingPopoverCarousel/TeachingPopoverCarousel.types.ts | xml | 2016-06-06T15:03:44 | 2024-08-16T18:49:29 | fluentui | microsoft/fluentui | 18,221 | 306 |
```xml
<local:HostedPage x:Class="Telegram.Views.Settings.SettingsBlockedChatsPage"
xmlns="path_to_url"
xmlns:x="path_to_url"
xmlns:local="using:Telegram.Views"
xmlns:controls="using:Telegram.Controls"
xmlns:cells="using:Telegram.Controls.Cells"
xmlns:d="path_to_url"
xmlns:mc="path_to_url"
mc:Ignorable="d">
<Page.Transitions>
<TransitionCollection>
<NavigationThemeTransition>
<SlideNavigationTransitionInfo Effect="FromRight" />
</NavigationThemeTransition>
</TransitionCollection>
</Page.Transitions>
<Grid Background="{ThemeResource SettingsPageBackground}">
<controls:TableListView x:Name="ScrollingHost"
ItemsSource="{x:Bind ViewModel.Items}"
ItemClick="ListView_ItemClick"
IsItemClickEnabled="True"
ChoosingItemContainer="OnChoosingItemContainer"
ContainerContentChanging="OnContainerContentChanging"
CornerRadius="0,0,4,4"
SelectionMode="None">
<ListView.Header>
<controls:SettingsPanel IsHeader="True"
Margin="0,0,0,2">
<controls:SettingsHeadline Source="ms-appx:///Assets/Animations/BlockedChats.tgs" />
<controls:HeaderedControl>
<controls:BadgeButton Content="{CustomResource BlockUser}"
Click="{x:Bind ViewModel.Block}"
Style="{StaticResource GlyphBadgeButtonStyle}"
Foreground="{ThemeResource DangerButtonBackground}"
Glyph="" />
</controls:HeaderedControl>
</controls:SettingsPanel>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<cells:ProfileCell BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
Background="{ThemeResource SettingsItemBackground}" />
</DataTemplate>
</ListView.ItemTemplate>
<ListView.Footer>
<controls:SettingsFooter Text="{CustomResource UnblockText}"
Margin="24,6,24,32" />
</ListView.Footer>
</controls:TableListView>
</Grid>
</local:HostedPage>
``` | /content/code_sandbox/Telegram/Views/Settings/SettingsBlockedChatsPage.xaml | xml | 2016-05-23T09:03:33 | 2024-08-16T16:17:48 | Unigram | UnigramDev/Unigram | 3,744 | 457 |
```xml
import { AudioMode, AudioSource, AudioStatus, RecorderState, RecordingOptions, RecordingStatus } from './Audio.types';
import { AudioPlayer, AudioRecorder } from './AudioModule.types';
import * as AudioModule from './AudioModule.web';
export declare function useAudioPlayer(source?: AudioSource | string | number | null, updateInterval?: number): AudioModule.AudioPlayerWeb;
export declare function useAudioPlayerStatus(player: AudioModule.AudioPlayerWeb): AudioStatus;
export declare function useAudioSampleListener(player: AudioModule.AudioPlayerWeb, listener: (data: {
channels: {
frames: number[];
}[];
timestamp: number;
}) => void): void;
export declare function useAudioRecorder(options: RecordingOptions, statusListener?: (status: RecordingStatus) => void): AudioModule.AudioRecorderWeb;
export declare function useAudioRecorderState(recorder: AudioRecorder, interval?: number): RecorderState;
export declare function setIsAudioActiveAsync(active: boolean): Promise<void>;
export declare function setAudioModeAsync(mode: AudioMode): Promise<void>;
export { AudioModule, AudioPlayer, AudioRecorder };
export * from './Audio.types';
//# sourceMappingURL=ExpoAudio.web.d.ts.map
``` | /content/code_sandbox/packages/expo-audio/build/ExpoAudio.web.d.ts | xml | 2016-08-15T17:14:25 | 2024-08-16T19:54:44 | expo | expo/expo | 32,004 | 245 |
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="ca" datatype="plaintext" original="messages.en.xlf">
<body>
<!-- Login / Security -->
<!-- Menu / Navbar items -->
<!-- Error templates -->
<!-- General labels -->
<!-- Buttons & Actions -->
<!-- Dashboard -->
<!-- Widgets -->
<!-- Timesheet -->
<!-- Column modal -->
<!-- User profile -->
<!-- 2FA -->
<!-- END 2FA -->
<!-- Notifications -->
<!-- Options for user-preference calendar_initial_view -->
<!-- User timesheet calendar -->
<!-- Projects -->
<!-- Customer -->
<!-- Users -->
<!-- Plugins -->
<!-- ROLES -->
<!-- Statistics data for Dashboard & Users profile -->
<!-- Invoice -->
<!-- Export -->
<!-- Navbar - recent entries and activities -->
<!-- TOOLBARS -->
<!-- QUICK ENTRIES -->
</body>
</file>
</xliff>
``` | /content/code_sandbox/translations/messages.ca.xlf | xml | 2016-10-20T17:06:34 | 2024-08-16T18:27:30 | kimai | kimai/kimai | 3,084 | 232 |
```xml
import { loadFixture } from '../../playwright/paths';
import { test } from '../../playwright/test';
test.describe('Cookie editor', async () => {
test.beforeEach(async ({ app, page }) => {
await page.getByRole('button', { name: 'Create in project' }).click();
const text = await loadFixture('simple.yaml');
await app.evaluate(async ({ clipboard }, text) => clipboard.writeText(text), text);
await page.getByRole('menuitemradio', { name: 'Import' }).click();
await page.locator('[data-test-id="import-from-clipboard"]').click();
await page.getByRole('button', { name: 'Scan' }).click();
await page.getByRole('dialog').getByRole('button', { name: 'Import' }).click();
await page.getByLabel('simple').click();
});
test('create and send a cookie', async ({ page }) => {
// Open cookie editor
await page.click('button:has-text("Cookies")');
// Edit existing cookie
await page.getByRole('button', { name: 'Edit' }).first().click();
await page.click('pre[role="presentation"]:has-text("bar")');
await page.locator('[data-testid="CookieValue"] >> textarea').nth(1).fill('123');
await page.locator('text=Done').nth(1).click();
await page.getByRole('cell', { name: 'foo=b123ar; Expires=' }).click();
// Create a new cookie
await page.locator('.cookie-list').getByRole('button', { name: 'Actions' }).click();
await page.getByRole('menuitem', { name: 'Add Cookie' }).click();
await page.getByRole('button', { name: 'Edit' }).first().click();
// Try to replace text in Raw view
await page.getByRole('tab', { name: 'Raw' }).click();
await page.locator('text=Raw Cookie String >> input[type="text"]').fill('foo2=bar2; Expires=Tue, 19 Jan 2038 03:14:07 GMT; Domain=localhost; Path=/');
await page.locator('text=Done').nth(1).click();
await page.getByRole('cell', { name: 'foo2=bar2; Expires=' }).click();
await page.click('text=Done');
// Send http request
await page.getByLabel('Request Collection').getByTestId('example http').press('Enter');
await page.click('[data-testid="request-pane"] button:has-text("Send")');
// Check in the timeline that the cookie was sent
await page.getByRole('tab', { name: 'Console' }).click();
await page.click('text=foo2=bar2; foo=b123ar');
// Send ws request
await page.getByLabel('Request Collection').getByTestId('example websocket').press('Enter');
await page.click('text=ws://localhost:4010');
await page.click('[data-testid="request-pane"] >> text=Connect');
// Check in the timeline that the cookie was sent
await page.getByRole('tab', { name: 'Console' }).click();
await page.click('text=foo2=bar2; foo=b123ar;');
});
});
``` | /content/code_sandbox/packages/insomnia-smoke-test/tests/smoke/cookie-editor-interactions.test.ts | xml | 2016-04-23T03:54:26 | 2024-08-16T16:50:44 | insomnia | Kong/insomnia | 34,054 | 709 |
```xml
import React, { useMemo } from "react";
import { RQAPI } from "../../types";
import { Button, Popover, Space } from "antd";
import PropertyRow from "./PropertyRow/PropertyRow";
import { statusCodes } from "config/constants/sub/statusCode";
import NetworkStatusField from "components/misc/NetworkStatusField";
import { NodeIndexOutlined } from "@ant-design/icons";
interface Props {
response: RQAPI.Response;
}
const StatusLine: React.FC<Props> = ({ response }) => {
const formattedTime = useMemo(() => {
if (response.time) {
const ms = Math.ceil(response.time);
if (ms < 1000) {
return `${ms} ms`;
}
return `${(ms / 1000).toFixed(3)} s`;
}
return "";
}, [response.time]);
const formattedStatusText = useMemo(() => {
// @ts-ignore
return response.statusText || statusCodes[response.status];
}, [response.status, response.statusText]);
return (
<Space className="api-response-status-line">
{response.redirectedUrl && (
<Popover content={response.redirectedUrl}>
<Button type="link" icon={<NodeIndexOutlined />}>
Redirected
</Button>
</Popover>
)}
<PropertyRow
name="Status"
value={<NetworkStatusField status={response.status} statusText={formattedStatusText} />}
/>
<PropertyRow name="Time" value={formattedTime} />
</Space>
);
};
export default StatusLine;
``` | /content/code_sandbox/app/src/views/features/api-client/client-view/response/StatusLine.tsx | xml | 2016-12-01T04:36:06 | 2024-08-16T19:12:19 | requestly | requestly/requestly | 2,121 | 332 |
```xml
/** @jsx jsx */
import { Transforms } from 'slate'
import { jsx } from '../../..'
export const run = editor => {
Transforms.move(editor, { edge: 'anchor' })
}
export const input = (
<editor>
<block>
one <anchor />
tw
<focus />o three
</block>
</editor>
)
export const output = (
<editor>
<block>
one t<anchor />w<focus />o three
</block>
</editor>
)
``` | /content/code_sandbox/packages/slate/test/transforms/move/anchor/basic.tsx | xml | 2016-06-18T01:52:42 | 2024-08-16T18:43:42 | slate | ianstormtaylor/slate | 29,492 | 117 |
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="waveSideBarLetters">
<item>\u0023</item>
<item>\u2606</item>
<item>A</item>
<item>B</item>
<item>C</item>
<item>D</item>
<item>E</item>
<item>F</item>
<item>G</item>
<item>H</item>
<item>I</item>
<item>J</item>
<item>K</item>
<item>L</item>
<item>M</item>
<item>N</item>
<item>O</item>
<item>P</item>
<item>Q</item>
<item>R</item>
<item>S</item>
<item>T</item>
<item>U</item>
<item>V</item>
<item>W</item>
<item>X</item>
<item>Y</item>
<item>Z</item>
</array>
</resources>
``` | /content/code_sandbox/wave/src/main/res/values/array.xml | xml | 2016-05-31T06:50:52 | 2024-08-07T01:58:08 | WaveSideBar | Solartisan/WaveSideBar | 1,177 | 241 |
```xml
import * as expect from 'expect'
import { system } from './system-tools'
test('which - existing package', () => {
const result = system.which('node')
expect(result).not.toBe(null)
})
test('which - non-existing package', () => {
const result = system.which('non-existing-package')
expect(result).toBe(null)
})
test('run - should reject if the command does not exist', async () => {
try {
await system.run('echo "hi" && non-existing-command')
} catch (e) {
expect(e.stdout).toContain('hi')
if (process.platform === 'win32') {
expect(e.stderr).toContain('is not recognized as an internal or external command')
} else {
expect(e.stderr).toContain('not found')
}
}
})
test('run - should resolve if the command exists', async () => {
// `echo` should be a general command for both *nix and windows
await expect(system.run('echo gluegun', { trim: true })).resolves.toBe('gluegun')
})
``` | /content/code_sandbox/src/toolbox/system-tools.test.ts | xml | 2016-11-29T00:37:41 | 2024-08-15T21:55:45 | gluegun | infinitered/gluegun | 2,937 | 230 |
```xml
import {
Column,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
Unique,
} from "../../../../src"
@Entity()
@Unique(["clientId", "key"])
export class User {
@PrimaryGeneratedColumn()
id: number
@Column()
public key: number
@Column({ name: "client_id" })
public clientId: number
@Column()
public name: string
@Column({ name: "updated_by" })
public updatedById: number
@ManyToOne((type) => User)
@JoinColumn([
{ name: "client_id", referencedColumnName: "clientId" },
{ name: "updated_by", referencedColumnName: "key" },
])
public updatedBy: Promise<User>
}
``` | /content/code_sandbox/test/github-issues/2147/entity/User.ts | xml | 2016-02-29T07:41:14 | 2024-08-16T18:28:52 | typeorm | typeorm/typeorm | 33,875 | 162 |
```xml
import { Attributes } from "@erxes/ui-tickets/src/settings/boards/styles";
import Icon from "@erxes/ui/src/components/Icon";
import Popover from "@erxes/ui/src/components/Popover";
import React from "react";
import { __ } from "coreui/utils";
type Props = {
config: string;
setConfig: (config: string) => void;
attributions: any[];
};
export default function Attribution(props: Props) {
const onClickAttribute = (item, close) => {
const { setConfig, config } = props;
const characters = ["_", "-", "/", " "];
const value = item.value;
let changedConfig;
if (characters.includes(value)) {
changedConfig = `${config}${value}`;
} else {
changedConfig = `${config}{${value}}`;
}
setConfig(changedConfig);
close();
};
const { attributions } = props;
const content = close => {
return (
<Attributes>
<React.Fragment>
<li>
<b>{__("Attributions")}</b>
</li>
{attributions.map(item => (
<button
key={item.value}
onClick={() => onClickAttribute(item, close)}
>
{__(item.label)}
</button>
))}
</React.Fragment>
</Attributes>
);
};
return (
<Popover
trigger={
<span>
{__("Attribution")} <Icon icon="angle-down" />
</span>
}
placement="top"
closeAfterSelect
>
{content}
</Popover>
);
}
``` | /content/code_sandbox/packages/plugin-tickets-ui/src/settings/boards/components/numberConfig/Attribution.tsx | xml | 2016-11-11T06:54:50 | 2024-08-16T10:26:06 | erxes | erxes/erxes | 3,479 | 347 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.