- @microsoft/fast-tooling@0.1.0
- @microsoft/fast-tooling-react@2.0.1
This commit is contained in:
Jane Chu 2020-04-10 16:45:23 -07:00
Родитель 6f34abe005
Коммит 8243888ee2
53 изменённых файлов: 1405 добавлений и 936 удалений

Просмотреть файл

@ -10,7 +10,7 @@
"private": true,
"workspaces": {
"packages": ["packages/*"],
"nohoist": ["**/react-syntax-highlighter", "**/@microsoft/fast-tslint-rules"]
"nohoist": ["**/react-syntax-highlighter"]
},
"repository": {
"type": "git",

Просмотреть файл

@ -93,22 +93,20 @@ function setViewConfigsWithCustomConfig(
): ObjectOfComponentViewConfigs {
const componentViewConfigs: ObjectOfComponentViewConfigs = {};
Object.keys(viewConfigs).forEach(
(viewConfigKey: string): void => {
componentViewConfigs[viewConfigKey] = Object.assign(
{},
viewConfigs[viewConfigKey],
{
scenarios: [
{
displayName: "Custom",
data: viewConfigs[viewConfigKey].scenarios[0].data,
},
].concat(viewConfigs[viewConfigKey].scenarios),
}
);
}
);
Object.keys(viewConfigs).forEach((viewConfigKey: string): void => {
componentViewConfigs[viewConfigKey] = Object.assign(
{},
viewConfigs[viewConfigKey],
{
scenarios: [
{
displayName: "Custom",
data: viewConfigs[viewConfigKey].scenarios[0].data,
},
].concat(viewConfigs[viewConfigKey].scenarios),
}
);
});
return componentViewConfigs;
}

Просмотреть файл

@ -1,8 +1,5 @@
if ("serviceWorker" in navigator) {
window.addEventListener(
"load",
(): void => {
navigator.serviceWorker.register("/service-worker.js");
}
);
window.addEventListener("load", (): void => {
navigator.serviceWorker.register("/service-worker.js");
});
}

Просмотреть файл

@ -1,191 +1,191 @@
export default {
'code[class*="language-"]': {
color: "#F2F2F2",
fontFamily:
'"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace',
direction: "ltr",
textAlign: "left",
whiteSpace: "pre",
wordSpacing: "normal",
wordBreak: "normal",
fontSize: "13px",
lineHeight: "16px",
MozTabSize: "4",
OTabSize: "4",
tabSize: "4",
WebkitHyphens: "none",
MozHyphens: "none",
msHyphens: "none",
hyphens: "none",
},
'pre[class*="language-"]': {
color: "#F2F2F2",
fontFamily:
'"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace',
direction: "ltr",
textAlign: "left",
whiteSpace: "pre",
wordSpacing: "normal",
wordBreak: "normal",
fontSize: "13px",
lineHeight: "16px",
MozTabSize: "4",
OTabSize: "4",
tabSize: "4",
WebkitHyphens: "none",
MozHyphens: "none",
msHyphens: "none",
hyphens: "none",
padding: "0",
margin: "6px 0",
overflow: "auto",
},
'pre[class*="language-"]::-moz-selection': {
background: "#C1DEF1",
},
'code[class*="language-"]::-moz-selection': {
background: "#C1DEF1",
},
'pre[class*="language-"]::selection': {
background: "#C1DEF1",
},
'code[class*="language-"]::selection': {
background: "#C1DEF1",
},
':not(pre) > code[class*="language-"]': {
padding: "2px",
paddingTop: "1px",
paddingBottom: "1px",
background: "#F8F8F8",
border: "1px solid #DDDDDD",
},
comment: {
color: "#6A9955",
fontStyle: "italic",
},
prolog: {
color: "#008000",
fontStyle: "italic",
},
doctype: {
color: "#008000",
fontStyle: "italic",
},
cdata: {
color: "#008000",
fontStyle: "italic",
},
namespace: {
opacity: ".7",
},
string: {
color: "#ce9178",
},
punctuation: {
color: "#569CD6",
},
operator: {
color: "#F2F2F2",
},
url: {
color: "#36ACAA",
},
symbol: {
color: "#36ACAA",
},
number: {
color: "#36ACAA",
},
boolean: {
color: "#36ACAA",
},
variable: {
color: "#36ACAA",
},
constant: {
color: "#36ACAA",
},
inserted: {
color: "#36ACAA",
},
atrule: {
color: "#ce9178",
},
keyword: {
color: "#ce9178",
},
"attr-value": {
color: "#ce9178",
},
".language-autohotkey .token.selector": {
color: "#ce9178",
},
".language-json .token.boolean": {
color: "#ce9178",
},
".language-json .token.number": {
color: "#ce9178",
},
'code[class*="language-css"]': {
color: "#ce9178",
},
function: {
color: "#F2F2F2",
},
deleted: {
color: "#9A050F",
},
".language-autohotkey .token.tag": {
color: "#9A050F",
},
selector: {
color: "#569cd6",
},
".language-autohotkey .token.keyword": {
color: "#00009F",
},
important: {
fontWeight: "bold",
},
bold: {
fontWeight: "bold",
},
italic: {
fontStyle: "italic",
},
"class-name": {
color: "#2B91AF",
},
".language-json .token.property": {
color: "#2B91AF",
},
tag: {
color: "#569cd6",
},
"attr-name": {
color: "#9cdcfe",
},
property: {
color: "#ce9178",
},
regex: {
color: "#ce9178",
},
entity: {
color: "#ce9178",
},
"directive.tag .tag": {
background: "#FFFF00",
color: "#569CD6",
},
".line-numbers .line-numbers-rows": {
borderRightColor: "#A5A5A5",
},
".line-numbers-rows > span:before": {
color: "#2B91AF",
},
".line-highlight": {
background:
"linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0))",
},
};
export default {
'code[class*="language-"]': {
color: "#F2F2F2",
fontFamily:
'"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace',
direction: "ltr",
textAlign: "left",
whiteSpace: "pre",
wordSpacing: "normal",
wordBreak: "normal",
fontSize: "13px",
lineHeight: "16px",
MozTabSize: "4",
OTabSize: "4",
tabSize: "4",
WebkitHyphens: "none",
MozHyphens: "none",
msHyphens: "none",
hyphens: "none",
},
'pre[class*="language-"]': {
color: "#F2F2F2",
fontFamily:
'"Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace',
direction: "ltr",
textAlign: "left",
whiteSpace: "pre",
wordSpacing: "normal",
wordBreak: "normal",
fontSize: "13px",
lineHeight: "16px",
MozTabSize: "4",
OTabSize: "4",
tabSize: "4",
WebkitHyphens: "none",
MozHyphens: "none",
msHyphens: "none",
hyphens: "none",
padding: "0",
margin: "6px 0",
overflow: "auto",
},
'pre[class*="language-"]::-moz-selection': {
background: "#C1DEF1",
},
'code[class*="language-"]::-moz-selection': {
background: "#C1DEF1",
},
'pre[class*="language-"]::selection': {
background: "#C1DEF1",
},
'code[class*="language-"]::selection': {
background: "#C1DEF1",
},
':not(pre) > code[class*="language-"]': {
padding: "2px",
paddingTop: "1px",
paddingBottom: "1px",
background: "#F8F8F8",
border: "1px solid #DDDDDD",
},
comment: {
color: "#6A9955",
fontStyle: "italic",
},
prolog: {
color: "#008000",
fontStyle: "italic",
},
doctype: {
color: "#008000",
fontStyle: "italic",
},
cdata: {
color: "#008000",
fontStyle: "italic",
},
namespace: {
opacity: ".7",
},
string: {
color: "#ce9178",
},
punctuation: {
color: "#569CD6",
},
operator: {
color: "#F2F2F2",
},
url: {
color: "#36ACAA",
},
symbol: {
color: "#36ACAA",
},
number: {
color: "#36ACAA",
},
boolean: {
color: "#36ACAA",
},
variable: {
color: "#36ACAA",
},
constant: {
color: "#36ACAA",
},
inserted: {
color: "#36ACAA",
},
atrule: {
color: "#ce9178",
},
keyword: {
color: "#ce9178",
},
"attr-value": {
color: "#ce9178",
},
".language-autohotkey .token.selector": {
color: "#ce9178",
},
".language-json .token.boolean": {
color: "#ce9178",
},
".language-json .token.number": {
color: "#ce9178",
},
'code[class*="language-css"]': {
color: "#ce9178",
},
function: {
color: "#F2F2F2",
},
deleted: {
color: "#9A050F",
},
".language-autohotkey .token.tag": {
color: "#9A050F",
},
selector: {
color: "#569cd6",
},
".language-autohotkey .token.keyword": {
color: "#00009F",
},
important: {
fontWeight: "bold",
},
bold: {
fontWeight: "bold",
},
italic: {
fontStyle: "italic",
},
"class-name": {
color: "#2B91AF",
},
".language-json .token.property": {
color: "#2B91AF",
},
tag: {
color: "#569cd6",
},
"attr-name": {
color: "#9cdcfe",
},
property: {
color: "#ce9178",
},
regex: {
color: "#ce9178",
},
entity: {
color: "#ce9178",
},
"directive.tag .tag": {
background: "#FFFF00",
color: "#569CD6",
},
".line-numbers .line-numbers-rows": {
borderRightColor: "#A5A5A5",
},
".line-numbers-rows > span:before": {
color: "#2B91AF",
},
".line-highlight": {
background:
"linear-gradient(to right, rgba(193, 222, 241, 0.2) 70%, rgba(221, 222, 241, 0))",
},
};

Просмотреть файл

@ -97,7 +97,7 @@
"jss-preset-default": "^4.5.0",
"lint-staged": "^10.1.2",
"lodash-es": "^4.17.11",
"prettier": "1.14.3",
"prettier": "2.0.2",
"raf-throttle": "^2.0.3",
"react": "^16.6.3",
"react-dnd": "^7.4.5",

Просмотреть файл

@ -1,29 +1,29 @@
import React from "react";
import { PivotClassNameContract } from "@microsoft/fast-components-class-name-contracts-msft";
import manageJss, { ManagedJSSProps } from "@microsoft/fast-jss-manager-react";
import { DesignSystem, PivotStyles } from "@microsoft/fast-components-styles-msft";
import { Subtract } from "utility-types";
import pivotSchema from "./pivot.schema";
import pivotSchema2 from "./pivot.schema.2";
import MSFTPivot, {
PivotHandledProps as MSFTPivotHandledProps,
PivotProps as MSFTPivotProps,
PivotManagedClasses,
PivotUnhandledProps,
} from "./pivot";
const Pivot = manageJss(PivotStyles)(MSFTPivot);
type Pivot = InstanceType<typeof Pivot>;
type PivotHandledProps = Subtract<MSFTPivotHandledProps, PivotManagedClasses>;
type PivotProps = ManagedJSSProps<MSFTPivotProps, PivotClassNameContract, DesignSystem>;
export {
Pivot,
PivotClassNameContract,
PivotProps,
PivotHandledProps,
pivotSchema,
pivotSchema2,
PivotUnhandledProps,
};
import React from "react";
import { PivotClassNameContract } from "@microsoft/fast-components-class-name-contracts-msft";
import manageJss, { ManagedJSSProps } from "@microsoft/fast-jss-manager-react";
import { DesignSystem, PivotStyles } from "@microsoft/fast-components-styles-msft";
import { Subtract } from "utility-types";
import pivotSchema from "./pivot.schema";
import pivotSchema2 from "./pivot.schema.2";
import MSFTPivot, {
PivotHandledProps as MSFTPivotHandledProps,
PivotProps as MSFTPivotProps,
PivotManagedClasses,
PivotUnhandledProps,
} from "./pivot";
const Pivot = manageJss(PivotStyles)(MSFTPivot);
type Pivot = InstanceType<typeof Pivot>;
type PivotHandledProps = Subtract<MSFTPivotHandledProps, PivotManagedClasses>;
type PivotProps = ManagedJSSProps<MSFTPivotProps, PivotClassNameContract, DesignSystem>;
export {
Pivot,
PivotClassNameContract,
PivotProps,
PivotHandledProps,
pivotSchema,
pivotSchema2,
PivotUnhandledProps,
};

Просмотреть файл

@ -1,39 +1,39 @@
import React from "react";
import { ProgressClassNameContract } from "@microsoft/fast-components-class-name-contracts-msft";
import manageJss, { ManagedJSSProps } from "@microsoft/fast-jss-manager-react";
import { DesignSystem, ProgressStyles } from "@microsoft/fast-components-styles-msft";
import { Subtract } from "utility-types";
import MSFTProgress, {
ProgressHandledProps as MSFTProgressHandledProps,
ProgressProps as MSFTProgressProps,
ProgressManagedClasses,
ProgressSize,
ProgressUnhandledProps,
} from "./progress";
import progressSchema from "./progress.schema";
import progressSchema2 from "./progress.schema.2";
/*
* The type returned by manageJss type is very complicated so we'll let the
* compiler infer the type instead of re-declaring just for the package export
*/
const Progress = manageJss(ProgressStyles)(MSFTProgress);
type Progress = InstanceType<typeof Progress>;
type ProgressHandledProps = Subtract<MSFTProgressHandledProps, ProgressManagedClasses>;
type ProgressProps = ManagedJSSProps<
MSFTProgressProps,
ProgressClassNameContract,
DesignSystem
>;
export {
Progress,
ProgressProps,
ProgressUnhandledProps,
ProgressHandledProps,
progressSchema,
progressSchema2,
ProgressSize,
ProgressClassNameContract,
};
import React from "react";
import { ProgressClassNameContract } from "@microsoft/fast-components-class-name-contracts-msft";
import manageJss, { ManagedJSSProps } from "@microsoft/fast-jss-manager-react";
import { DesignSystem, ProgressStyles } from "@microsoft/fast-components-styles-msft";
import { Subtract } from "utility-types";
import MSFTProgress, {
ProgressHandledProps as MSFTProgressHandledProps,
ProgressProps as MSFTProgressProps,
ProgressManagedClasses,
ProgressSize,
ProgressUnhandledProps,
} from "./progress";
import progressSchema from "./progress.schema";
import progressSchema2 from "./progress.schema.2";
/*
* The type returned by manageJss type is very complicated so we'll let the
* compiler infer the type instead of re-declaring just for the package export
*/
const Progress = manageJss(ProgressStyles)(MSFTProgress);
type Progress = InstanceType<typeof Progress>;
type ProgressHandledProps = Subtract<MSFTProgressHandledProps, ProgressManagedClasses>;
type ProgressProps = ManagedJSSProps<
MSFTProgressProps,
ProgressClassNameContract,
DesignSystem
>;
export {
Progress,
ProgressProps,
ProgressUnhandledProps,
ProgressHandledProps,
progressSchema,
progressSchema2,
ProgressSize,
ProgressClassNameContract,
};

Просмотреть файл

@ -3,6 +3,61 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.0.1](https://github.com/Microsoft/fast-dna/compare/@microsoft/fast-tooling-react@1.32.3...@microsoft/fast-tooling-react@2.0.1) (2020-04-10)
**Note**: This is the production start of version 2, do not use v2.0.0 as that version is tagged as *canary* and should be treated as an alpha release.
### Bug Fixes
* add back in browser default validation when objects are used ([#2818](https://github.com/Microsoft/fast-dna/issues/2818)) ([ebc6ec1](https://github.com/Microsoft/fast-dna/commit/ebc6ec1e464155cfe8562c29aeb855a4824ba0c7))
* adjust select styling to prevent text overflow ([#2706](https://github.com/Microsoft/fast-dna/issues/2706)) ([7e1c913](https://github.com/Microsoft/fast-dna/commit/7e1c91316318bc3f936843742dcd85635c0fc7cb))
* cleanup interface names and fix the web component renderer in the test app ([#2832](https://github.com/Microsoft/fast-dna/issues/2832)) ([26c6bc7](https://github.com/Microsoft/fast-dna/commit/26c6bc78a3fdd5aed6d88709181f95d3d318d984))
* improve performance on the end drag by making all navigation items drop targets ([#2874](https://github.com/Microsoft/fast-dna/issues/2874)) ([adbe382](https://github.com/Microsoft/fast-dna/commit/adbe3828e1630ae052ab0c3c9f7f4ef2312e976c))
* refers to the schema dictionary so that each linked item can be validated for errors ([#2799](https://github.com/Microsoft/fast-dna/issues/2799)) ([d62a6e8](https://github.com/Microsoft/fast-dna/commit/d62a6e8d472b48cdf8e3f5f697d5c21007831137))
* remove a redundant state for dragging, update the parent location of the linked data during hover ([#2873](https://github.com/Microsoft/fast-dna/issues/2873)) ([ad9873b](https://github.com/Microsoft/fast-dna/commit/ad9873ba6c3f5af79e53bcb4b371900ed85f4e3e))
* update breadcrumbs to have the proper sequence when nesting linked data ([#2872](https://github.com/Microsoft/fast-dna/issues/2872)) ([dd0477f](https://github.com/Microsoft/fast-dna/commit/dd0477fc5451a5c2da363624e238ef2662ba1345))
* update mappings so that the reactMapper maps props properly ([#2892](https://github.com/Microsoft/fast-dna/issues/2892)) ([81a3f80](https://github.com/Microsoft/fast-dna/commit/81a3f80951cac24b0072949a7d6fdb3c61220c59))
* update opacity so that it no longer applies to objects and prevents users from modifying the value via const, soft remove and default buttons ([#2820](https://github.com/Microsoft/fast-dna/issues/2820)) ([f9f5bbb](https://github.com/Microsoft/fast-dna/commit/f9f5bbbfde70fc332dd90b6dddc0cb62b65f4bae))
* update the message system to combine declaring a new worker and registration from a single class ([#2670](https://github.com/Microsoft/fast-dna/issues/2670)) ([731487e](https://github.com/Microsoft/fast-dna/commit/731487e86449429d6405a0e9c5779b22ae340578))
### Features
* add a JSON schema for react children ([#2529](https://github.com/Microsoft/fast-dna/issues/2529)) ([bd6aeff](https://github.com/Microsoft/fast-dna/commit/bd6aeff9753bbcdc80f54c5a7facd8f9748426c4))
* add an initial plugin system for the message system ([#2535](https://github.com/Microsoft/fast-dna/issues/2535)) ([6a522f1](https://github.com/Microsoft/fast-dna/commit/6a522f168db0aa92a551314d9977061ee0223224))
* add disabled to the navigation and remove the dependency on ajv from the message system ([#2792](https://github.com/Microsoft/fast-dna/issues/2792)) ([ad5e886](https://github.com/Microsoft/fast-dna/commit/ad5e8865818965ae515de776305810bf61378a7b))
* add initialization with data to message system ([#2505](https://github.com/Microsoft/fast-dna/issues/2505)) ([6879d85](https://github.com/Microsoft/fast-dna/commit/6879d856b3d4f8d5fde0d6cc684416a2cb232f73))
* add linked data control to update dictionary data ([#2710](https://github.com/Microsoft/fast-dna/issues/2710)) ([7109c8f](https://github.com/Microsoft/fast-dna/commit/7109c8fe330663489bed403405d965b1f855e7fb))
* add mapper function to create React components ([#2772](https://github.com/Microsoft/fast-dna/issues/2772)) ([d6f6c1d](https://github.com/Microsoft/fast-dna/commit/d6f6c1dc21dae008d336a00b8c29b6334408491d))
* add message system ([#2504](https://github.com/Microsoft/fast-dna/issues/2504)) ([f8e6375](https://github.com/Microsoft/fast-dna/commit/f8e63757428fb7899643733e9bf1948527e98d8e))
* add message system registration class and adjust message system to use a dictionary to account for multiple data sets ([#2662](https://github.com/Microsoft/fast-dna/issues/2662)) ([98ec3cf](https://github.com/Microsoft/fast-dna/commit/98ec3cf9d74ca0b310fc83a03be8f6e8ad1062d3))
* add new package for framework-less tooling ([#2560](https://github.com/Microsoft/fast-dna/issues/2560)) ([9c4ae29](https://github.com/Microsoft/fast-dna/commit/9c4ae2916a3d91bd5d664f029bf9bb77e219f177))
* add the ability to nest multiple items at the same level in an element ([#2813](https://github.com/Microsoft/fast-dna/issues/2813)) ([1e23b85](https://github.com/Microsoft/fast-dna/commit/1e23b85e03983be5df463ffaa2d8213659991632))
* allow adding and removing data from the message-system ([#2526](https://github.com/Microsoft/fast-dna/issues/2526)) ([96c0bb4](https://github.com/Microsoft/fast-dna/commit/96c0bb47132a7ed16ff917167d22b7103539e0c6))
* convert form to use the message system ([#2665](https://github.com/Microsoft/fast-dna/issues/2665)) ([be7696b](https://github.com/Microsoft/fast-dna/commit/be7696b2d326857b32bdc550d764af2d2038b608))
* convert the Navigation component API to use the message system ([#2718](https://github.com/Microsoft/fast-dna/issues/2718)) ([a72a4da](https://github.com/Microsoft/fast-dna/commit/a72a4da5657299e3349d44cc88babc3f755f7f5b))
* more precise drag and drop allowed before and after linked data ([#2866](https://github.com/Microsoft/fast-dna/issues/2866)) ([efa0b39](https://github.com/Microsoft/fast-dna/commit/efa0b39a2eb0f23d5bcfb7a520868f02b38ee192))
* place duplicate data functionality in data utilities and add duplication to the message system ([#2506](https://github.com/Microsoft/fast-dna/issues/2506)) ([4cf468b](https://github.com/Microsoft/fast-dna/commit/4cf468bed48ccfca342d5a936405e1ff0d7b36f8))
* remove the ajv dependency from the Form and instead use the AjvMapper directly with the message system ([#2853](https://github.com/Microsoft/fast-dna/issues/2853)) ([c233f93](https://github.com/Microsoft/fast-dna/commit/c233f9301757d3d5b76a880f4d4e3197dec3c6a2))
* remove the onSchemaChange callback and schema plugins ([#2522](https://github.com/Microsoft/fast-dna/issues/2522)) ([cc46bd6](https://github.com/Microsoft/fast-dna/commit/cc46bd6bc4848f4ae4349db0eaf655904283fb76))
* standardize the naming of linked items to linked data, add more information to message system callbacks and add data location information to linked data, update the form navigation to include breadcrumbs from the dictionary ([#2705](https://github.com/Microsoft/fast-dna/issues/2705)) ([7c0dd4c](https://github.com/Microsoft/fast-dna/commit/7c0dd4c7146987ca0e41a3d7104f01cd7f386b15))
* update dependencies to allow the use of latest typescript version ([154ea81](https://github.com/Microsoft/fast-dna/commit/154ea81e1d6e7c25ffddda7200866f679f75fa61)), closes [#2476](https://github.com/Microsoft/fast-dna/issues/2476)
* update tooling 'ecosystem' components with the Modular prefix ([#2775](https://github.com/Microsoft/fast-dna/issues/2775)) ([3e06f15](https://github.com/Microsoft/fast-dna/commit/3e06f15104ad9946a6cd913ef9828ab40bab4264))
* update Viewer to use the message system API ([#2745](https://github.com/Microsoft/fast-dna/issues/2745)) ([ab53aaf](https://github.com/Microsoft/fast-dna/commit/ab53aaf9099959ad54324f46ee2e7e13f4abd6ce))
### BREAKING CHANGES
* updates the message system to be a single class instantiation which includes the web worker implementation and the registry
* This change updates the Form API to not include data, schema or the onChange callback and instead replace them with the message system
* This removes the onSchemaChange callback and plugins from the Form as well as the plugin export
* This changes how contexts are used for the BareForm
component due to the update of react-dnd to 9.0.0
## [1.32.4](https://github.com/Microsoft/fast-dna/compare/@microsoft/fast-tooling-react@1.32.3...@microsoft/fast-tooling-react@1.32.4) (2020-04-10)
**Note:** Version bump only for package @microsoft/fast-tooling-react

Просмотреть файл

@ -193,19 +193,17 @@ class FormAndNavigationTestPage extends React.Component<{}, FormTestPageState> {
];
for (const group of groups) {
Object.keys(group.items).map(
(itemName: any, key: number): void => {
if (typeof testConfigs[itemName].schema !== "undefined") {
const childObj: FormChildOptionItem = {
name: testConfigs[itemName].schema.title || "Untitled",
component: testConfigs[itemName].component,
schema: testConfigs[itemName].schema,
};
Object.keys(group.items).map((itemName: any, key: number): void => {
if (typeof testConfigs[itemName].schema !== "undefined") {
const childObj: FormChildOptionItem = {
name: testConfigs[itemName].schema.title || "Untitled",
component: testConfigs[itemName].component,
schema: testConfigs[itemName].schema,
};
childOptions.push(childObj);
}
childOptions.push(childObj);
}
);
});
}
return childOptions;

Просмотреть файл

@ -250,19 +250,17 @@ class FormTestPage extends React.Component<{}, FormTestPageState> {
];
for (const group of groups) {
Object.keys(group.items).map(
(itemName: any, key: number): void => {
if (typeof testConfigs[itemName].schema !== "undefined") {
const childObj: FormChildOptionItem = {
name: testConfigs[itemName].schema.title || "Untitled",
component: testConfigs[itemName].component,
schema: testConfigs[itemName].schema,
};
Object.keys(group.items).map((itemName: any, key: number): void => {
if (typeof testConfigs[itemName].schema !== "undefined") {
const childObj: FormChildOptionItem = {
name: testConfigs[itemName].schema.title || "Untitled",
component: testConfigs[itemName].component,
schema: testConfigs[itemName].schema,
};
childOptions.push(childObj);
}
childOptions.push(childObj);
}
);
});
}
return childOptions;
@ -354,8 +352,8 @@ class FormTestPage extends React.Component<{}, FormTestPageState> {
? testConfigs[e.target.value].data
: testConfigs[e.target.value].schema.id ===
testConfigs.allControlTypes.schema.id
? this.state.dataSet
: getDataFromSchema(testConfigs[e.target.value].schema);
? this.state.dataSet
: getDataFromSchema(testConfigs[e.target.value].schema);
if ((window as any).Worker && fastMessageSystem) {
fastMessageSystem.postMessage({

Просмотреть файл

@ -2,7 +2,7 @@
"name": "@microsoft/fast-tooling-react",
"description": "A React-specific set of components and utilities to assist in creating web UI",
"sideEffects": false,
"version": "2.0.0-alpha.4",
"version": "2.0.1",
"author": {
"name": "Microsoft",
"url": "https://discord.gg/FcSNfg4"
@ -79,7 +79,7 @@
"html-webpack-plugin": "^3.2.0",
"jest": "^25.2.7",
"lodash-es": "^4.0.0",
"prettier": "1.14.3",
"prettier": "2.0.2",
"react": "^16.8.0",
"react-dnd-html5-backend": "^9.0.0",
"react-dom": "^16.8.0",
@ -111,7 +111,7 @@
"@microsoft/fast-jss-manager-react": "^4.6.4",
"@microsoft/fast-jss-utilities": "^4.7.9",
"@microsoft/fast-web-utilities": "^4.4.2",
"@microsoft/fast-tooling": "^0.0.2",
"@microsoft/fast-tooling": "^0.1.0",
"exenv-es6": "^1.0.0",
"raf-throttle": "^2.0.3",
"react-dnd": "^9.0.0",

Просмотреть файл

@ -110,30 +110,10 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(1)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(2)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(3)
.prop("value")
).toBe("12px");
expect(rendered.find("input").at(0).prop("value")).toBe("12px");
expect(rendered.find("input").at(1).prop("value")).toBe("12px");
expect(rendered.find("input").at(2).prop("value")).toBe("12px");
expect(rendered.find("input").at(3).prop("value")).toBe("12px");
});
test("should parse the `data` prop and assign individual values when 2 values are passed", () => {
@ -150,30 +130,10 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(1)
.prop("value")
).toBe("8px");
expect(
rendered
.find("input")
.at(2)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(3)
.prop("value")
).toBe("8px");
expect(rendered.find("input").at(0).prop("value")).toBe("12px");
expect(rendered.find("input").at(1).prop("value")).toBe("8px");
expect(rendered.find("input").at(2).prop("value")).toBe("12px");
expect(rendered.find("input").at(3).prop("value")).toBe("8px");
});
test("should parse the `data` prop and assign individual values when 3 values are passed", () => {
@ -190,30 +150,10 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(1)
.prop("value")
).toBe("8px");
expect(
rendered
.find("input")
.at(2)
.prop("value")
).toBe("3px");
expect(
rendered
.find("input")
.at(3)
.prop("value")
).toBe("8px");
expect(rendered.find("input").at(0).prop("value")).toBe("12px");
expect(rendered.find("input").at(1).prop("value")).toBe("8px");
expect(rendered.find("input").at(2).prop("value")).toBe("3px");
expect(rendered.find("input").at(3).prop("value")).toBe("8px");
});
test("should parse the `data` prop and assign individual values when 4 values are passed", () => {
@ -230,30 +170,10 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe("12px");
expect(
rendered
.find("input")
.at(1)
.prop("value")
).toBe("8px");
expect(
rendered
.find("input")
.at(2)
.prop("value")
).toBe("3px");
expect(
rendered
.find("input")
.at(3)
.prop("value")
).toBe("7px");
expect(rendered.find("input").at(0).prop("value")).toBe("12px");
expect(rendered.find("input").at(1).prop("value")).toBe("8px");
expect(rendered.find("input").at(2).prop("value")).toBe("3px");
expect(rendered.find("input").at(3).prop("value")).toBe("7px");
});
test("should set the `hasFocus` state when top left input is focused", () => {
@ -263,10 +183,7 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
rendered
.find("input")
.at(0)
.simulate("focus");
rendered.find("input").at(0).simulate("focus");
expect(rendered.state("hasFocus")).toBe(BorderRadiusValue.borderTopLeftRadius);
});
@ -278,10 +195,7 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
rendered
.find("input")
.at(1)
.simulate("focus");
rendered.find("input").at(1).simulate("focus");
expect(rendered.state("hasFocus")).toBe(BorderRadiusValue.borderTopRightRadius);
});
@ -293,10 +207,7 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
rendered
.find("input")
.at(2)
.simulate("focus");
rendered.find("input").at(2).simulate("focus");
expect(rendered.state("hasFocus")).toBe(
BorderRadiusValue.borderBottomRightRadius
@ -310,17 +221,11 @@ describe("CSSBorderRadius", () => {
rendered.find("button").simulate("click");
rendered
.find("input")
.at(3)
.simulate("focus");
rendered.find("input").at(3).simulate("focus");
expect(rendered.state("hasFocus")).toBe(BorderRadiusValue.borderBottomLeftRadius);
rendered
.find("input")
.at(3)
.simulate("blur");
rendered.find("input").at(3).simulate("blur");
expect(rendered.state("hasFocus")).toBe(void 0);
});

Просмотреть файл

@ -180,24 +180,16 @@ export default class CSSBorderRadius extends Foundation<
borderRadius.borderRadius = e.target.value;
break;
case BorderRadiusValue.borderBottomLeftRadius:
borderRadius.borderRadius = `${parsedString[0]} ${parsedString[1]} ${
parsedString[2]
} ${validatedValue}`;
borderRadius.borderRadius = `${parsedString[0]} ${parsedString[1]} ${parsedString[2]} ${validatedValue}`;
break;
case BorderRadiusValue.borderBottomRightRadius:
borderRadius.borderRadius = `${parsedString[0]} ${
parsedString[1]
} ${validatedValue} ${parsedString[3]}`;
borderRadius.borderRadius = `${parsedString[0]} ${parsedString[1]} ${validatedValue} ${parsedString[3]}`;
break;
case BorderRadiusValue.borderTopLeftRadius:
borderRadius.borderRadius = `${validatedValue} ${parsedString[1]} ${
parsedString[2]
} ${parsedString[3]}`;
borderRadius.borderRadius = `${validatedValue} ${parsedString[1]} ${parsedString[2]} ${parsedString[3]}`;
break;
case BorderRadiusValue.borderTopRightRadius:
borderRadius.borderRadius = `${parsedString[0]} ${validatedValue} ${
parsedString[2]
} ${parsedString[3]}`;
borderRadius.borderRadius = `${parsedString[0]} ${validatedValue} ${parsedString[2]} ${parsedString[3]}`;
break;
}
this.props.onChange(borderRadius);

Просмотреть файл

@ -91,10 +91,7 @@ export default class CSSBorder extends Foundation<
private renderBorderOption(style: string): JSX.Element {
return (
<option key={style} value={style}>
{style
.charAt(0)
.toUpperCase()
.concat(style.slice(1))}
{style.charAt(0).toUpperCase().concat(style.slice(1))}
</option>
);
}

Просмотреть файл

@ -55,15 +55,13 @@ describe("CSSEditor", () => {
const positionValue: PositionValue = PositionValue.absolute;
const topValue: string = "1";
const leftValue: string = "2";
const callbackPosition: any = jest.fn(
(args: any): void => {
expect(args).toEqual({
top: updatedPositionValue,
position: positionValue,
left: leftValue,
});
}
);
const callbackPosition: any = jest.fn((args: any): void => {
expect(args).toEqual({
top: updatedPositionValue,
position: positionValue,
left: leftValue,
});
});
const data: CSSEditorValues = {
position: positionValue,
top: topValue,
@ -116,14 +114,12 @@ describe("CSSEditor", () => {
const updatedSpacingValue: string = "5";
const topValue: string = "1";
const leftValue: string = "2";
const callbackSpacing: any = jest.fn(
(args: any): void => {
expect(args).toEqual({
marginLeft: leftValue,
marginTop: updatedSpacingValue,
});
}
);
const callbackSpacing: any = jest.fn((args: any): void => {
expect(args).toEqual({
marginLeft: leftValue,
marginTop: updatedSpacingValue,
});
});
const data: CSSEditorValues = {
marginTop: topValue,
marginLeft: leftValue,

Просмотреть файл

@ -112,11 +112,9 @@ describe("CSSPosition", () => {
expect(input.prop("value")).toBe(value);
});
test("should fire `onChange` callback if the `position` prop is changed", () => {
const callback: any = jest.fn(
(args: any): void => {
expect(args.position).toBe(PositionValue.static);
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.position).toBe(PositionValue.static);
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute }}
@ -133,11 +131,9 @@ describe("CSSPosition", () => {
});
test("should fire `onChange` callback if the `top` prop is changed", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.top).toBe(value);
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.top).toBe(value);
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute }}
@ -153,11 +149,9 @@ describe("CSSPosition", () => {
});
test("should fire `onChange` callback if the `left` prop is changed", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.left).toBe(value);
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.left).toBe(value);
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute }}
@ -173,11 +167,9 @@ describe("CSSPosition", () => {
});
test("should fire `onChange` callback if the `right` prop is changed", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.right).toBe(value);
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.right).toBe(value);
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute }}
@ -193,11 +185,9 @@ describe("CSSPosition", () => {
});
test("should fire `onChange` callback if the `bottom` prop is changed", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.bottom).toBe(value);
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.bottom).toBe(value);
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute }}
@ -213,13 +203,11 @@ describe("CSSPosition", () => {
});
test("should not allow the `left` prop value to be added to the `onChange` callback if the `right` prop is being set", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.right).toBe(value);
expect(args.left).toBe(undefined);
expect(args.position).toBe("absolute");
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.right).toBe(value);
expect(args.left).toBe(undefined);
expect(args.position).toBe("absolute");
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute, left: value }}
@ -235,13 +223,11 @@ describe("CSSPosition", () => {
});
test("should not allow the `right` prop value to be added to the `onChange` callback if the `left` prop is being set", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.left).toBe(value);
expect(args.right).toBe(undefined);
expect(args.position).toBe("absolute");
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.left).toBe(value);
expect(args.right).toBe(undefined);
expect(args.position).toBe("absolute");
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute, right: value }}
@ -257,13 +243,11 @@ describe("CSSPosition", () => {
});
test("should not allow the `bottom` prop value to be added to the `onChange` callback if the `top` prop is being set", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.top).toBe(value);
expect(args.bottom).toBe(undefined);
expect(args.position).toBe("absolute");
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.top).toBe(value);
expect(args.bottom).toBe(undefined);
expect(args.position).toBe("absolute");
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute, bottom: value }}
@ -279,13 +263,11 @@ describe("CSSPosition", () => {
});
test("should not allow the `top` prop value to be added to the `onChange` callback if the `bottom` prop is being set", () => {
const value: string = "25px";
const callback: any = jest.fn(
(args: any): void => {
expect(args.bottom).toBe(value);
expect(args.top).toBe(undefined);
expect(args.position).toBe("absolute");
}
);
const callback: any = jest.fn((args: any): void => {
expect(args.bottom).toBe(value);
expect(args.top).toBe(undefined);
expect(args.position).toBe("absolute");
});
const rendered: any = mount(
<CSSPosition
data={{ position: PositionValue.absolute, top: value }}

Просмотреть файл

@ -119,13 +119,11 @@ export default class CSSPosition extends Foundation<
location: Location.right,
className: this.props.managedClasses.absoluteInput_centerRow__activeRight,
},
].forEach(
(locationsMappedToClassNames: LocationsMappedToClassNames): void => {
classNames = this.props[locationsMappedToClassNames.location]
? `${classNames} ${locationsMappedToClassNames.className}`
: classNames;
}
);
].forEach((locationsMappedToClassNames: LocationsMappedToClassNames): void => {
classNames = this.props[locationsMappedToClassNames.location]
? `${classNames} ${locationsMappedToClassNames.className}`
: classNames;
});
return classNames;
}
@ -194,13 +192,11 @@ export default class CSSPosition extends Foundation<
const updatedProps: Partial<CSSPositionValues> = {};
const excludedProp: Location = this.getExcludedLocation(updatedPropKey);
props.forEach(
(prop: string): void => {
if (get(this.props, `data.${prop}`) && prop !== excludedProp) {
updatedProps[prop] = this.props.data[prop];
}
props.forEach((prop: string): void => {
if (get(this.props, `data.${prop}`) && prop !== excludedProp) {
updatedProps[prop] = this.props.data[prop];
}
);
});
updatedProps[updatedPropKey] = updatedPropValue;
@ -214,9 +210,9 @@ export default class CSSPosition extends Foundation<
return updatedPropKey === Location.left
? Location.right
: updatedPropKey === Location.right
? Location.left
: updatedPropKey === Location.top
? Location.bottom
: Location.top;
? Location.left
: updatedPropKey === Location.top
? Location.bottom
: Location.top;
}
}

Просмотреть файл

@ -178,10 +178,7 @@ describe("CSSSpacing", () => {
<Spacing onChange={onChangeCallback} managedClasses={managedClasses} />
);
rendered
.find("input")
.at(top)
.simulate("change", { target: { value } });
rendered.find("input").at(top).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ marginTop: value });
@ -193,10 +190,7 @@ describe("CSSSpacing", () => {
<Spacing onChange={onChangeCallback} managedClasses={managedClasses} />
);
rendered
.find("input")
.at(bottom)
.simulate("change", { target: { value } });
rendered.find("input").at(bottom).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ marginBottom: value });
@ -208,10 +202,7 @@ describe("CSSSpacing", () => {
<Spacing onChange={onChangeCallback} managedClasses={managedClasses} />
);
rendered
.find("input")
.at(left)
.simulate("change", { target: { value } });
rendered.find("input").at(left).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ marginLeft: value });
@ -223,10 +214,7 @@ describe("CSSSpacing", () => {
<Spacing onChange={onChangeCallback} managedClasses={managedClasses} />
);
rendered
.find("input")
.at(right)
.simulate("change", { target: { value } });
rendered.find("input").at(right).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ marginRight: value });
@ -263,10 +251,7 @@ describe("CSSSpacing", () => {
rendered.setState({ activeType: SpacingType.padding });
rendered
.find("input")
.at(top)
.simulate("change", { target: { value } });
rendered.find("input").at(top).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ paddingTop: value });
@ -280,10 +265,7 @@ describe("CSSSpacing", () => {
rendered.setState({ activeType: SpacingType.padding });
rendered
.find("input")
.at(bottom)
.simulate("change", { target: { value } });
rendered.find("input").at(bottom).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({
@ -299,10 +281,7 @@ describe("CSSSpacing", () => {
rendered.setState({ activeType: SpacingType.padding });
rendered
.find("input")
.at(left)
.simulate("change", { target: { value } });
rendered.find("input").at(left).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ paddingLeft: value });
@ -316,10 +295,7 @@ describe("CSSSpacing", () => {
rendered.setState({ activeType: SpacingType.padding });
rendered
.find("input")
.at(right)
.simulate("change", { target: { value } });
rendered.find("input").at(right).simulate("change", { target: { value } });
expect(onChangeCallback).toHaveBeenCalled();
expect(onChangeCallback.mock.calls[0][0]).toEqual({ paddingRight: value });

Просмотреть файл

@ -46,17 +46,9 @@ describe("CSSPropertyEditor", () => {
xtest("should focus the key input when the containing div has been clicked", () => {
const rendered: any = mount(<CSSPropertyEditor />);
rendered
.find("div")
.at(0)
.simulate("click");
rendered.find("div").at(0).simulate("click");
expect(
rendered
.find("input")
.at(0)
.getDOMNode()
).toEqual(document.activeElement);
expect(rendered.find("input").at(0).getDOMNode()).toEqual(document.activeElement);
});
test("should show data key/value pairs as inputs using the key and value as input values", () => {

Просмотреть файл

@ -185,9 +185,7 @@ export default class CSSPropertyEditor extends Foundation<
if (this.newRowKeyCounter > 100) {
this.newRowKeyCounter = 1;
}
this.activeEditRowReactKey = `${CSSPropertyEditor.newRowKey}${
this.newRowKeyCounter
}`;
this.activeEditRowReactKey = `${CSSPropertyEditor.newRowKey}${this.newRowKeyCounter}`;
return this.activeEditRowReactKey;
};
@ -313,7 +311,7 @@ export default class CSSPropertyEditor extends Foundation<
this.createRow(
!isNil(this.propertyEditorRef.current) &&
e.nativeEvent.offsetY < this.propertyEditorRef.current.clientHeight / 2
e.nativeEvent.offsetY < this.propertyEditorRef.current.clientHeight / 2
? 0
: Object.keys(this.editData).length
);
@ -359,8 +357,10 @@ export default class CSSPropertyEditor extends Foundation<
* Focus on the key input of the next row
*/
private focusOnRow = (index: number): void => {
const rows: Element[] = this.domChildren((this.propertyEditorRef
.current as HTMLElement).firstElementChild as HTMLElement);
const rows: Element[] = this.domChildren(
(this.propertyEditorRef.current as HTMLElement)
.firstElementChild as HTMLElement
);
if (rows.length < index + 1) {
return;
}

Просмотреть файл

@ -284,10 +284,7 @@ describe("ArrayControl", () => {
/>
);
rendered
.find("a")
.at(0)
.simulate("click");
rendered.find("a").at(0).simulate("click");
expect(handleSectionUpdate).toHaveBeenCalled();
expect(handleSectionUpdate.mock.calls[0][1]).toEqual("[0]");
@ -355,10 +352,7 @@ describe("ArrayControl", () => {
/>
);
renderedWithTestLocations
.find("a")
.at(0)
.simulate("click");
renderedWithTestLocations.find("a").at(0).simulate("click");
expect(handleSectionUpdateWithTestLocations).toHaveBeenCalled();
expect(handleSectionUpdateWithTestLocations.mock.calls[0][1]).toEqual("test[0]");

Просмотреть файл

@ -123,12 +123,7 @@ describe("CheckboxControl", () => {
/>
);
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe(true.toString());
expect(rendered.find("input").at(0).prop("value")).toBe(true.toString());
});
test("should not show default values if data exists", () => {
const rendered: any = mount(
@ -139,11 +134,6 @@ describe("CheckboxControl", () => {
default={true}
/>
);
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe(false.toString());
expect(rendered.find("input").at(0).prop("value")).toBe(false.toString());
});
});

Просмотреть файл

@ -27,8 +27,8 @@ class CheckboxControl extends React.Component<
typeof this.props.value === "boolean"
? this.props.value
: typeof this.props.default === "boolean"
? this.props.default
: false;
? this.props.default
: false;
return (
<div

Просмотреть файл

@ -249,10 +249,7 @@ describe("LinkedDataControl", () => {
/>
);
renderedWithTwoLinkedData
.find("DragItem")
.find("button")
.simulate("click");
renderedWithTwoLinkedData.find("DragItem").find("button").simulate("click");
expect(callback).toHaveBeenCalled();
expect(callback.mock.calls[0][0]).toEqual({

Просмотреть файл

@ -143,11 +143,6 @@ describe("NumberFieldControl", () => {
default={defaultValue}
/>
);
expect(
rendered
.find("input")
.at(0)
.prop("value")
).toBe(value);
expect(rendered.find("input").at(0).prop("value")).toBe(value);
});
});

Просмотреть файл

@ -71,8 +71,8 @@ class NumberFieldControl extends React.Component<
return typeof value === "number"
? value
: typeof this.props.default !== "undefined"
? this.props.default
: "";
? this.props.default
: "";
}
}

Просмотреть файл

@ -68,10 +68,7 @@ describe("SectionLinkControl", () => {
/>
);
rendered
.find("a")
.at(0)
.simulate("click");
rendered.find("a").at(0).simulate("click");
expect(handleSectionUpdate).toHaveBeenCalled();
expect(handleSectionUpdate.mock.calls[0][0]).toEqual("");
@ -87,10 +84,7 @@ describe("SectionLinkControl", () => {
/>
);
renderedWithTestLocations
.find("a")
.at(0)
.simulate("click");
renderedWithTestLocations.find("a").at(0).simulate("click");
expect(handleSectionUpdateWithTestLocations).toHaveBeenCalled();
expect(handleSectionUpdateWithTestLocations.mock.calls[0][0]).toEqual("");

Просмотреть файл

@ -388,14 +388,14 @@ class SectionControl extends React.Component<
return this.state.oneOfAnyOf === null
? this.props.navigation[this.props.navigationConfigId]
: this.state.oneOfAnyOf.activeIndex === -1
? this.props.navigation[
this.props.navigation[this.props.navigationConfigId].items[0]
? this.props.navigation[
this.props.navigation[this.props.navigationConfigId].items[0]
]
: this.props.navigation[
this.props.navigation[this.props.navigationConfigId].items[
this.state.oneOfAnyOf.activeIndex
]
: this.props.navigation[
this.props.navigation[this.props.navigationConfigId].items[
this.state.oneOfAnyOf.activeIndex
]
];
];
}
/**

Просмотреть файл

@ -159,12 +159,7 @@ describe("SelectControl", () => {
/>
);
expect(
rendered
.find("select")
.at(0)
.prop("value")
).toBe(defaultValue);
expect(rendered.find("select").at(0).prop("value")).toBe(defaultValue);
});
test("should not show default values if data exists", () => {
const value: string = "foo";
@ -177,12 +172,7 @@ describe("SelectControl", () => {
default={defaultValue}
/>
);
expect(
rendered
.find("select")
.at(0)
.prop("value")
).toBe(value);
expect(rendered.find("select").at(0).prop("value")).toBe(value);
});
test("should reset the value to an empty string if the value and default are undefined", () => {
const value: string = "foo";
@ -193,12 +183,7 @@ describe("SelectControl", () => {
value={value}
/>
);
expect(
rendered
.find("select")
.at(0)
.prop("value")
).toBe(value);
expect(rendered.find("select").at(0).prop("value")).toBe(value);
rendered.setProps({
...selectProps,
@ -206,11 +191,6 @@ describe("SelectControl", () => {
value: void 0,
});
expect(
rendered
.find("select")
.at(0)
.prop("value")
).toBe("");
expect(rendered.find("select").at(0).prop("value")).toBe("");
});
});

Просмотреть файл

@ -63,13 +63,11 @@ class SelectControl extends React.Component<
private handleChange = (): ((e: React.ChangeEvent<HTMLSelectElement>) => void) => {
return (e: React.ChangeEvent<HTMLSelectElement>): void => {
const value: any = this.props.options.find(
(option: any): any => {
return typeof option === "string"
? option === e.target.value
: JSON.stringify(option) === e.target.value;
}
);
const value: any = this.props.options.find((option: any): any => {
return typeof option === "string"
? option === e.target.value
: JSON.stringify(option) === e.target.value;
});
this.props.onChange({ value });
};
};
@ -89,8 +87,8 @@ class SelectControl extends React.Component<
return typeof this.props.value !== "undefined"
? this.props.value
: typeof this.props.default !== "undefined"
? this.props.default
: "";
? this.props.default
: "";
}
/**

Просмотреть файл

@ -121,12 +121,7 @@ describe("TextareaControl", () => {
default={defaultValue}
/>
);
expect(
rendered
.find("textarea")
.at(0)
.prop("value")
).toBe(value);
expect(rendered.find("textarea").at(0).prop("value")).toBe(value);
});
test("should show value if value is empty string", () => {
const value: string = "";
@ -139,12 +134,7 @@ describe("TextareaControl", () => {
default={defaultValue}
/>
);
expect(
rendered
.find("textarea")
.at(0)
.prop("value")
).toBe(value);
expect(rendered.find("textarea").at(0).prop("value")).toBe(value);
});
test("should show default if value is undefined and default is an empty string", () => {
const value: string = void 0;
@ -157,12 +147,7 @@ describe("TextareaControl", () => {
default={defaultValue}
/>
);
expect(
rendered
.find("textarea")
.at(0)
.prop("value")
).toBe(defaultValue);
expect(rendered.find("textarea").at(0).prop("value")).toBe(defaultValue);
});
test("should show empty string if value or default is not provided", () => {
const value: string = void 0;
@ -176,11 +161,6 @@ describe("TextareaControl", () => {
default={defaultValue}
/>
);
expect(
rendered
.find("textarea")
.at(0)
.prop("value")
).toBe(emptyString);
expect(rendered.find("textarea").at(0).prop("value")).toBe(emptyString);
});
});

Просмотреть файл

@ -58,8 +58,8 @@ class TextareaControl extends React.Component<
return typeof this.props.value === "string"
? this.props.value
: typeof this.props.default === "string"
? this.props.default
: "";
? this.props.default
: "";
}
private handleChange = (): ((e: React.ChangeEvent<HTMLTextAreaElement>) => void) => {

Просмотреть файл

@ -243,8 +243,8 @@ class ControlSwitch extends React.Component<ControlSwitchProps, {}> {
typeof schema.default !== "undefined"
? schema.default
: typeof this.props.default !== "undefined"
? this.props.default
: void 0,
? this.props.default
: void 0,
const: schema.const || this.props.const,
badge: schema.badge,
badgeDescription: schema.badgeDescription,

Просмотреть файл

@ -67,13 +67,11 @@ export function getIsRequired(item: any, required: string[]): boolean {
let isRequired: boolean = false;
if (Array.isArray(required)) {
required.forEach(
(requiredItem: string): void => {
if (requiredItem === item) {
isRequired = true;
}
required.forEach((requiredItem: string): void => {
if (requiredItem === item) {
isRequired = true;
}
);
});
}
return isRequired;
@ -108,7 +106,8 @@ export function resolveExampleDataWithCachedData(schema: any, cachedData: any):
Object.keys(curatedCachedData).forEach((item: string) => {
if (
typeof exampleData[item] === "undefined" &&
(schema.properties && !schema.properties[item])
schema.properties &&
!schema.properties[item]
) {
unset(curatedCachedData, item);
}
@ -178,8 +177,8 @@ function getOneOfAnyOfType(schemaSection: any): CombiningKeyword | null {
return schemaSection.oneOf
? CombiningKeyword.oneOf
: schemaSection.anyOf
? CombiningKeyword.anyOf
: null;
? CombiningKeyword.anyOf
: null;
}
/**
@ -240,17 +239,15 @@ export function formControlAttributeMapping(
): number | null {
let itemAttributeValue: any = null;
Object.keys(config).forEach(
(attributeName: string): void => {
for (const attributeConfig of config[attributeName]) {
for (const property of attributeConfig.propertyNames) {
if (property === propertyName) {
itemAttributeValue = attributeConfig.value;
}
Object.keys(config).forEach((attributeName: string): void => {
for (const attributeConfig of config[attributeName]) {
for (const property of attributeConfig.propertyNames) {
if (property === propertyName) {
itemAttributeValue = attributeConfig.value;
}
}
}
);
});
return itemAttributeValue;
}
@ -466,11 +463,11 @@ export function updateControlSectionState(
activeIndex: -1,
}
: props.navigation[props.navigationConfigId].schema[CombiningKeyword.oneOf]
? {
type: CombiningKeyword.oneOf,
activeIndex: -1,
}
: null,
? {
type: CombiningKeyword.oneOf,
activeIndex: -1,
}
: null,
};
}

Просмотреть файл

@ -68,10 +68,7 @@ describe("AlignControl", () => {
<AlignControl {...alignControlProps} onChange={handleChange} />
);
rendered
.find("input")
.at(0)
.simulate("change");
rendered.find("input").at(0).simulate("change");
expect(handleChange).toHaveBeenCalled();
expect(handleChange.mock.calls[0][0]).toEqual({ value: "top" });

Просмотреть файл

@ -68,10 +68,7 @@ describe("TextAlignControl", () => {
<TextAlignControl {...textAlignControlProps} onChange={handleChange} />
);
rendered
.find("input")
.at(0)
.simulate("change");
rendered.find("input").at(0).simulate("change");
expect(handleChange).toHaveBeenCalled();
expect(handleChange.mock.calls[0][0]).toEqual({ value: "left" });

Просмотреть файл

@ -66,10 +66,7 @@ describe("ThemeControl", () => {
<ThemeControl {...themeProps} onChange={handleChange} />
);
rendered
.find("input")
.at(0)
.simulate("change");
rendered.find("input").at(0).simulate("change");
expect(handleChange).toHaveBeenCalled();
expect(handleChange.mock.calls[0][0]).toEqual({ value: "light" });

Просмотреть файл

@ -54,11 +54,9 @@ class ThemeControl extends React.Component<
private renderInput(theme: string): JSX.Element {
if (this.props.options && Array.isArray(this.props.options)) {
const option: any = this.props.options.find(
(item: string): any => {
return item === theme;
}
);
const option: any = this.props.options.find((item: string): any => {
return item === theme;
});
if (typeof option !== "undefined") {
return (

Просмотреть файл

@ -75,8 +75,8 @@ export default abstract class ControlPluginUtilities<
id: Array.isArray(config.id)
? config.id
: config.id !== undefined
? [config.id]
: [],
? [config.id]
: [],
});
}

Просмотреть файл

@ -32,9 +32,9 @@ describe("ControlPlugin", () => {
softRemove: true,
});
const renderSoftRemove: any = mount(testClass.renderSoftRemove(
"foo"
) as JSX.Element);
const renderSoftRemove: any = mount(
testClass.renderSoftRemove("foo") as JSX.Element
);
expect(renderSoftRemove.find("SoftRemove")).toHaveLength(1);
});
@ -63,9 +63,9 @@ describe("ControlPlugin", () => {
const: "bar",
});
const renderConstTrigger: any = mount(testClass.renderConstValueIndicator(
"foo"
) as JSX.Element);
const renderConstTrigger: any = mount(
testClass.renderConstValueIndicator("foo") as JSX.Element
);
expect(renderConstTrigger.find("ConstValue")).toHaveLength(1);
});
@ -91,9 +91,9 @@ describe("ControlPlugin", () => {
},
});
const renderDefaultTrigger: any = mount(testClass.renderDefaultValueIndicator(
"foo"
) as JSX.Element);
const renderDefaultTrigger: any = mount(
testClass.renderDefaultValueIndicator("foo") as JSX.Element
);
expect(renderDefaultTrigger.find("DefaultValue")).toHaveLength(1);
});
@ -129,9 +129,9 @@ describe("ControlPlugin", () => {
displayValidationInline: true,
});
const renderInvalidMessage: any = mount(testClass.renderInvalidMessage(
className
) as JSX.Element);
const renderInvalidMessage: any = mount(
testClass.renderInvalidMessage(className) as JSX.Element
);
expect(renderInvalidMessage.find(`.${className}`)).toHaveLength(1);
});

Просмотреть файл

@ -136,10 +136,7 @@ describe("NavigationMenu", () => {
expect(callback).toBeCalledTimes(0);
rendered
.find("span")
.at(0)
.simulate("click");
rendered.find("span").at(0).simulate("click");
expect(callback).toBeCalledTimes(1);
expect(callback.mock.calls[0][0]).toBe("foo-location");

Просмотреть файл

@ -143,16 +143,14 @@ class Navigation extends Foundation<
: this.state.expandedNavigationConfigItems[
e.data.activeDictionaryId
].includes(e.data.activeNavigationConfigId)
? this.state.expandedNavigationConfigItems[
e.data.activeDictionaryId
].filter((navigationConfigItem: string) => {
return (
navigationConfigItem !== e.data.activeNavigationConfigId
);
})
: this.state.expandedNavigationConfigItems[
e.data.activeDictionaryId
].concat([e.data.activeNavigationConfigId]);
? this.state.expandedNavigationConfigItems[
e.data.activeDictionaryId
].filter((navigationConfigItem: string) => {
return navigationConfigItem !== e.data.activeNavigationConfigId;
})
: this.state.expandedNavigationConfigItems[
e.data.activeDictionaryId
].concat([e.data.activeNavigationConfigId]);
this.setState({
activeItem: [
@ -211,8 +209,8 @@ class Navigation extends Foundation<
? DragDropItemType.linkedData
: this.state.navigationDictionary[0][dictionaryId][0][navigationConfigId]
.schema[dictionaryLink]
? DragDropItemType.linkedDataContainer
: DragDropItemType.default;
? DragDropItemType.linkedDataContainer
: DragDropItemType.default;
return (
<div
@ -358,9 +356,7 @@ class Navigation extends Foundation<
let className: string = this.props.managedClasses.navigation_itemTrigger;
if (isCollapsible) {
className += ` ${
this.props.managedClasses.navigation_itemTrigger__expandable
}`;
className += ` ${this.props.managedClasses.navigation_itemTrigger__expandable}`;
}
if (
@ -371,15 +367,11 @@ class Navigation extends Foundation<
}
if (isDraggable) {
className += ` ${
this.props.managedClasses.navigation_itemTrigger__draggable
}`;
className += ` ${this.props.managedClasses.navigation_itemTrigger__draggable}`;
}
if (isDroppable) {
className += ` ${
this.props.managedClasses.navigation_itemTrigger__droppable
}`;
className += ` ${this.props.managedClasses.navigation_itemTrigger__droppable}`;
}
if (
@ -388,18 +380,12 @@ class Navigation extends Foundation<
this.state.hoveredItem[2] === navigationConfigId
) {
if (this.state.hoveredItem[0] === DragDropItemType.linkedDataContainer) {
className += ` ${
this.props.managedClasses.navigation_itemTrigger__hover
}`;
className += ` ${this.props.managedClasses.navigation_itemTrigger__hover}`;
} else if (this.state.hoveredItem[0] === DragDropItemType.linkedData) {
if (this.state.hoveredItem[3] === HoverLocation.after) {
className += ` ${
this.props.managedClasses.navigation_itemTrigger__hoverAfter
}`;
className += ` ${this.props.managedClasses.navigation_itemTrigger__hoverAfter}`;
} else {
className += ` ${
this.props.managedClasses.navigation_itemTrigger__hoverBefore
}`;
className += ` ${this.props.managedClasses.navigation_itemTrigger__hoverBefore}`;
}
}
}
@ -496,8 +482,8 @@ class Navigation extends Foundation<
isLinkedDataContainer
? undefined
: location === HoverLocation.before
? index
: index + 1,
? index
: index + 1,
],
linkedData: {
...this.state.linkedData,

Просмотреть файл

@ -35,15 +35,13 @@ describe("Rotate", (): void => {
<Rotate managedClasses={managedClasses} {...props} />
);
rendered.find("input").forEach(
(input: any, index: number): void => {
if (index === 0) {
expect(input.prop("checked")).toEqual(true);
} else {
expect(input.prop("checked")).toEqual(false);
}
rendered.find("input").forEach((input: any, index: number): void => {
if (index === 0) {
expect(input.prop("checked")).toEqual(true);
} else {
expect(input.prop("checked")).toEqual(false);
}
);
});
});
test("should have the portrait radio be checked when the `orientation` prop is set to portrait", () => {
const props: RotateHandledProps = {
@ -54,19 +52,17 @@ describe("Rotate", (): void => {
<Rotate managedClasses={managedClasses} {...props} />
);
rendered.find("input").forEach(
(input: any, index: number): void => {
if (index === 0) {
expect(input.prop("checked")).toEqual(false);
} else {
expect(input.prop("checked")).toEqual(true);
}
rendered.find("input").forEach((input: any, index: number): void => {
if (index === 0) {
expect(input.prop("checked")).toEqual(false);
} else {
expect(input.prop("checked")).toEqual(true);
}
);
});
});
test("should fire the `onUpdateOrientation` when a radio has been selected and return the updated orientation", () => {
const updateOrientationCallback: (orientation: Orientation) => void = jest.fn(
function(orientation: Orientation): void {
function (orientation: Orientation): void {
expect(orientation).toBe(Orientation.landscape);
}
);
@ -78,13 +74,11 @@ describe("Rotate", (): void => {
<Rotate managedClasses={managedClasses} {...props} />
);
rendered.find("input").forEach(
(input: any, index: number): void => {
if (index === 0) {
input.simulate("change");
}
rendered.find("input").forEach((input: any, index: number): void => {
if (index === 0) {
input.simulate("change");
}
);
});
expect(updateOrientationCallback).toHaveBeenCalled();
});
@ -98,15 +92,13 @@ describe("Rotate", (): void => {
<Rotate managedClasses={managedClasses} {...props} />
);
rendered.find("input").forEach(
(input: any, index: number): void => {
if (index === 0) {
expect(input.prop("disabled")).toEqual(true);
} else {
expect(input.prop("disabled")).toEqual(undefined);
}
rendered.find("input").forEach((input: any, index: number): void => {
if (index === 0) {
expect(input.prop("disabled")).toEqual(true);
} else {
expect(input.prop("disabled")).toEqual(undefined);
}
);
});
});
test("should set the portrait radio to disabled when the `portraitDisabled` prop is true", () => {
const props: RotateHandledProps = {
@ -118,14 +110,12 @@ describe("Rotate", (): void => {
<Rotate managedClasses={managedClasses} {...props} />
);
rendered.find("input").forEach(
(input: any, index: number): void => {
if (index === 0) {
expect(input.prop("disabled")).toEqual(undefined);
} else {
expect(input.prop("disabled")).toEqual(true);
}
rendered.find("input").forEach((input: any, index: number): void => {
if (index === 0) {
expect(input.prop("disabled")).toEqual(undefined);
} else {
expect(input.prop("disabled")).toEqual(true);
}
);
});
});
});

Просмотреть файл

@ -88,7 +88,7 @@ describe("SelectDevice", (): void => {
expect(rendered.find("select").prop("value")).toEqual(undefined);
});
test("should fire the `onUpdateDevice` callback when an option has been selected and return the updated device index", () => {
const updateDeviceCallback: (activeDeviceId: string) => void = jest.fn(function(
const updateDeviceCallback: (activeDeviceId: string) => void = jest.fn(function (
activeDeviceId: string
): void {
expect(activeDeviceId).toEqual("testDevice2");

Просмотреть файл

@ -40,24 +40,14 @@ describe("Viewer", (): void => {
<Viewer managedClasses={managedClasses} width={800} {...props} />
);
expect(
rendered
.find("div")
.last()
.prop("style")
).toEqual({ width: "800px" });
expect(rendered.find("div").last().prop("style")).toEqual({ width: "800px" });
});
test("should set the height if the `height` prop is set", () => {
const rendered: any = mount(
<Viewer managedClasses={managedClasses} height={600} {...props} />
);
expect(
rendered
.find("div")
.last()
.prop("style")
).toEqual({ height: "600px" });
expect(rendered.find("div").last().prop("style")).toEqual({ height: "600px" });
});
test("should create a series of responsive buttons if the `responsive` prop is true", () => {
const renderedWithResponsive: any = mount(
@ -76,7 +66,7 @@ describe("Viewer", (): void => {
callback();
}
);
const updateHeightCallback: (height: number) => void = jest.fn(function(
const updateHeightCallback: (height: number) => void = jest.fn(function (
height: number
): void {
expect(height).toEqual(400);
@ -110,7 +100,7 @@ describe("Viewer", (): void => {
callback();
}
);
const updateWidthCallback: (width: number) => void = jest.fn(function(
const updateWidthCallback: (width: number) => void = jest.fn(function (
width: number
): void {
expect(width).toEqual(700);

Просмотреть файл

@ -122,9 +122,7 @@ export class Viewer extends Foundation<
if (this.props.responsive) {
return (
<button
className={`${this.props.managedClasses.handle} ${
this.props.managedClasses.handle__left
}`}
className={`${this.props.managedClasses.handle} ${this.props.managedClasses.handle__left}`}
onMouseDown={this.handleMouseDown(ResizeHandleLocation.left)}
/>
);
@ -135,9 +133,7 @@ export class Viewer extends Foundation<
if (this.props.responsive) {
return (
<button
className={`${this.props.managedClasses.handle} ${
this.props.managedClasses.handle__right
}`}
className={`${this.props.managedClasses.handle} ${this.props.managedClasses.handle__right}`}
onMouseDown={this.handleMouseDown(ResizeHandleLocation.right)}
/>
);
@ -149,24 +145,18 @@ export class Viewer extends Foundation<
return (
<React.Fragment>
<button
className={`${this.props.managedClasses.handle} ${
this.props.managedClasses.handle__bottomLeft
}`}
className={`${this.props.managedClasses.handle} ${this.props.managedClasses.handle__bottomLeft}`}
onMouseDown={this.handleMouseDown(
ResizeHandleLocation.bottomLeft
)}
/>
<button
className={`${this.props.managedClasses.handle} ${
this.props.managedClasses.handle__bottom
}`}
className={`${this.props.managedClasses.handle} ${this.props.managedClasses.handle__bottom}`}
aria-hidden={true}
onMouseDown={this.handleMouseDown(ResizeHandleLocation.bottom)}
/>
<button
className={`${this.props.managedClasses.handle} ${
this.props.managedClasses.handle__bottomRight
}`}
className={`${this.props.managedClasses.handle} ${this.props.managedClasses.handle__bottomRight}`}
onMouseDown={this.handleMouseDown(
ResizeHandleLocation.bottomRight
)}

Просмотреть файл

@ -0,0 +1,28 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# 0.1.0 (2020-04-10)
### Bug Fixes
* cleanup interface names and fix the web component renderer in the test app ([#2832](https://github.com/Microsoft/fast-dna/issues/2832)) ([26c6bc7](https://github.com/Microsoft/fast-dna/commit/26c6bc78a3fdd5aed6d88709181f95d3d318d984))
* correct some erroneous message system navigation returns, add more unit testing to bring code quality up ([#2783](https://github.com/Microsoft/fast-dna/issues/2783)) ([2f87a04](https://github.com/Microsoft/fast-dna/commit/2f87a0427cfc0c307b9b4acacdd5385c42fcf773))
### Features
* add a data mapper ([#2756](https://github.com/Microsoft/fast-dna/issues/2756)) ([11df583](https://github.com/Microsoft/fast-dna/commit/11df5832eb2ef1a6896be2afd4e0404462454985))
* add a mapper for HTML elements ([#2803](https://github.com/Microsoft/fast-dna/issues/2803)) ([7b14ced](https://github.com/Microsoft/fast-dna/commit/7b14ced79ac543d6a3a889a828fab240dd216386))
* add a utility for validation as a service using ajv ([#2836](https://github.com/Microsoft/fast-dna/issues/2836)) ([05e1784](https://github.com/Microsoft/fast-dna/commit/05e1784c1c34df8d0ffff451ce753731e49c7255))
* add all of the ids associated with the linked data when linked data has been added ([#2899](https://github.com/Microsoft/fast-dna/issues/2899)) ([00c8ed3](https://github.com/Microsoft/fast-dna/commit/00c8ed3f488470b6a01d6bd3ec2f38a0afb5c74a))
* add disabled to the navigation and remove the dependency on ajv from the message system ([#2792](https://github.com/Microsoft/fast-dna/issues/2792)) ([ad5e886](https://github.com/Microsoft/fast-dna/commit/ad5e8865818965ae515de776305810bf61378a7b))
* add mapper function to create React components ([#2772](https://github.com/Microsoft/fast-dna/issues/2772)) ([d6f6c1d](https://github.com/Microsoft/fast-dna/commit/d6f6c1dc21dae008d336a00b8c29b6334408491d))
* add new package for framework-less tooling ([#2560](https://github.com/Microsoft/fast-dna/issues/2560)) ([9c4ae29](https://github.com/Microsoft/fast-dna/commit/9c4ae2916a3d91bd5d664f029bf9bb77e219f177))
* add the ability to nest multiple items at the same level in an element ([#2813](https://github.com/Microsoft/fast-dna/issues/2813)) ([1e23b85](https://github.com/Microsoft/fast-dna/commit/1e23b85e03983be5df463ffaa2d8213659991632))
* add validation to the message system ([#2825](https://github.com/Microsoft/fast-dna/issues/2825)) ([ce24096](https://github.com/Microsoft/fast-dna/commit/ce2409659ef361a9a16cc2a44ea5560a04c6ddaf))
* allow a request/response custom validation message to be sent to the AjvMapper ([#2852](https://github.com/Microsoft/fast-dna/issues/2852)) ([6154ef0](https://github.com/Microsoft/fast-dna/commit/6154ef087432e6a94c7392babd338f4df05e4799))
* allow custom messages to be sent to the message system which will return them ([#2845](https://github.com/Microsoft/fast-dna/issues/2845)) ([ad70f5d](https://github.com/Microsoft/fast-dna/commit/ad70f5d030526c3b4be8bf3ae7ad3b1a23e587d0))
* more precise drag and drop allowed before and after linked data ([#2866](https://github.com/Microsoft/fast-dna/issues/2866)) ([efa0b39](https://github.com/Microsoft/fast-dna/commit/efa0b39a2eb0f23d5bcfb7a520868f02b38ee192))

Просмотреть файл

@ -2,7 +2,7 @@
"name": "@microsoft/fast-tooling",
"description": "A set of utilities to assist in creating web UI",
"sideEffects": false,
"version": "0.0.2",
"version": "0.1.0",
"author": {
"name": "Microsoft",
"url": "https://discord.gg/FcSNfg4"
@ -59,14 +59,14 @@
]
},
"devDependencies": {
"@microsoft/fast-tslint-rules": "^3.0.4",
"@microsoft/fast-tslint-rules": "^3.1.1",
"@types/jest": "^24.0.11",
"@types/lodash-es": "^4.17.0",
"@types/node": "^9.6.7",
"ajv": "^6.10.0",
"jest": "^24.5.0",
"lodash-es": "^4.0.0",
"prettier": "1.14.3",
"prettier": "2.0.2",
"ts-jest": "^24.0.0",
"ts-loader": "^4.0.1",
"tslint": "^5.9.1",
@ -76,7 +76,5 @@
},
"peerDependencies": {
"lodash-es": "^4.0.0"
},
"dependencies": {
}
}
}

Просмотреть файл

@ -80,11 +80,11 @@ describe("mapDataDictionary", () => {
expect(resolver).toHaveBeenCalledTimes(2);
});
test("should map a single dictionary entry", () => {
const mapper: any = function(config: MapperConfig<any>): any {
const mapper: any = function (config: MapperConfig<any>): any {
config.dataDictionary[0][config.dictionaryId].data =
config.dataDictionary[0][config.dictionaryId].data;
};
const resolver: any = function(config: ResolverConfig<any>): any {
const resolver: any = function (config: ResolverConfig<any>): any {
const dataBlob = config.dataDictionary[0][config.dataDictionary[1]].data;
if (config.dataDictionary[0][config.dictionaryId].parent) {
@ -125,11 +125,11 @@ describe("mapDataDictionary", () => {
});
});
test("should map multiple dictionary entries", () => {
const mapper: any = function(config: MapperConfig<any>): any {
const mapper: any = function (config: MapperConfig<any>): any {
config.dataDictionary[0][config.dictionaryId].data =
config.dataDictionary[0][config.dictionaryId].data;
};
const resolver: any = function(config: ResolverConfig<any>): any {
const resolver: any = function (config: ResolverConfig<any>): any {
if (config.dataDictionary[0][config.dictionaryId].parent) {
set(
config.dataDictionary[0][config.parent].data as object,

Просмотреть файл

@ -176,11 +176,9 @@ export function resolveDataInDataDictionary<T>(
(config.dataDictionary[0][config.dataDictionary[0][key].parent.id]
.data as object)[
config.dataDictionary[0][key].parent.dataLocation
].map(
(slotItem: LinkedData): string => {
return slotItem.id;
}
)
].map((slotItem: LinkedData): string => {
return slotItem.id;
})
);
}
}
@ -196,17 +194,15 @@ export function resolveDataInDataDictionary<T>(
});
// call the resolver on all children
linkedDataIds.map(
(key: string): void => {
resolveDataInDataDictionary({
dataDictionary: config.dataDictionary,
dictionaryId: key,
resolvedDictionaryIds: config.resolvedDictionaryIds,
schemaDictionary: config.schemaDictionary,
mapper: config.mapper,
});
}
);
linkedDataIds.map((key: string): void => {
resolveDataInDataDictionary({
dataDictionary: config.dataDictionary,
dictionaryId: key,
resolvedDictionaryIds: config.resolvedDictionaryIds,
schemaDictionary: config.schemaDictionary,
mapper: config.mapper,
});
});
}
function attachResolvedDataDictionary<T>(
@ -267,9 +263,7 @@ export function htmlMapper(
return !availableElementSlots.includes(
get(
config.schema,
`${PropertyKeyword.properties}[${potentialAttribute}][${
ReservedElementMappingKeyword.mapsToSlot
}]`
`${PropertyKeyword.properties}[${potentialAttribute}][${ReservedElementMappingKeyword.mapsToSlot}]`
)
);
});

Просмотреть файл

@ -121,8 +121,8 @@ function getNavigationItems(
const combiningKeyword: CombiningKeyword | void = schema[CombiningKeyword.oneOf]
? CombiningKeyword.oneOf
: schema[CombiningKeyword.anyOf]
? CombiningKeyword.anyOf
: void 0;
? CombiningKeyword.anyOf
: void 0;
if (combiningKeyword) {
return schema[combiningKeyword].map((subSchema: any, index: number) => {
@ -158,9 +158,7 @@ function getNavigationItems(
undefined,
dataLocation ? `${dataLocation}.${propertyKey}` : propertyKey,
schemaLocation
? `${schemaLocation}.${
PropertyKeyword.properties
}.${propertyKey}`
? `${schemaLocation}.${PropertyKeyword.properties}.${propertyKey}`
: `${PropertyKeyword.properties}.${propertyKey}`,
parent
);

Просмотреть файл

@ -2,7 +2,7 @@
import { getMessage } from "./message-system.utilities";
onmessage = function(e: MessageEvent): void {
onmessage = function (e: MessageEvent): void {
if (e.data && e.data.type !== undefined) {
postMessage(getMessage(e.data));
}

814
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу