Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
60c276a
update DialogInfo types and fix demo app
a-b-r-o-w-n Sep 9, 2019
31c9033
update designer form
a-b-r-o-w-n Sep 9, 2019
83b6086
seed new dialog action with designer properties
a-b-r-o-w-n Sep 10, 2019
1ea11c6
update look and feel of property editor, pt 1
a-b-r-o-w-n Sep 11, 2019
25c9ab5
Merge branch 'master' into prompt-updates
a-b-r-o-w-n Sep 18, 2019
8390ef8
use correct peer version of react-dom
a-b-r-o-w-n Sep 18, 2019
0885e65
fix lint errors
a-b-r-o-w-n Sep 18, 2019
4a76045
seed dialog data with $type
a-b-r-o-w-n Sep 18, 2019
d5609b9
fix react error
a-b-r-o-w-n Sep 19, 2019
9829378
use default button for object array
a-b-r-o-w-n Sep 19, 2019
dc14040
add custom label and description to widgets
a-b-r-o-w-n Sep 19, 2019
5a11144
add new ui:hidden concept to ui schema
a-b-r-o-w-n Sep 19, 2019
5b89147
finish applying new look and feel to form
a-b-r-o-w-n Sep 19, 2019
f39c026
fix panel height on safari
a-b-r-o-w-n Sep 19, 2019
e6adc01
update fabric
a-b-r-o-w-n Sep 19, 2019
b23475f
Merge branch 'master' into prompt-updates
a-b-r-o-w-n Sep 20, 2019
af5b7ab
fix some fabric upgrade misses
a-b-r-o-w-n Sep 20, 2019
a63990b
port style changes to css files
a-b-r-o-w-n Sep 20, 2019
a9ed075
update spec to look for input instead of text
a-b-r-o-w-n Sep 23, 2019
cb4924e
Merge branch 'master' into prompt-updates
a-b-r-o-w-n Sep 23, 2019
2ae6fdf
fix merge conflict
a-b-r-o-w-n Sep 23, 2019
a1f45c2
update signature of seachbox.onChange
a-b-r-o-w-n Sep 23, 2019
92d015b
bump fabric to latest and fix nav styles
a-b-r-o-w-n Sep 23, 2019
e2966a7
Merge branch 'master' into prompt-updates
a-b-r-o-w-n Sep 25, 2019
e3ba87c
remove dead code
a-b-r-o-w-n Sep 25, 2019
4635548
update uischema to use sdk type enum
a-b-r-o-w-n Sep 23, 2019
addca50
render a prompt field for each prompt type
a-b-r-o-w-n Sep 23, 2019
a705dc8
add emotion for css-in-js
a-b-r-o-w-n Sep 25, 2019
656165f
add prompt bot says tab
a-b-r-o-w-n Sep 25, 2019
04e08ae
add user says tab
a-b-r-o-w-n Sep 26, 2019
19a3ebd
[wip] exceptions tab
a-b-r-o-w-n Sep 26, 2019
2eb20f5
Merge branch 'master' into prompt-updates-2
a-b-r-o-w-n Oct 1, 2019
38185e4
[wip] validations
a-b-r-o-w-n Oct 2, 2019
ab1b6c0
Merge branch 'master' into prompt-updates-2
a-b-r-o-w-n Oct 2, 2019
b3cb389
finish exceptions tab
a-b-r-o-w-n Oct 2, 2019
08de058
use short date format
a-b-r-o-w-n Oct 2, 2019
d9dd8dc
ease widget props interface
a-b-r-o-w-n Oct 2, 2019
a175f24
add prompt settings
a-b-r-o-w-n Oct 2, 2019
8a5e3a7
further relax widget props
a-b-r-o-w-n Oct 2, 2019
e38515c
Merge branch 'master' into prompt-updates-2
a-b-r-o-w-n Oct 3, 2019
7200411
default max turn count to 3
a-b-r-o-w-n Oct 3, 2019
52ad364
consolidate shared logic into main prompt field
a-b-r-o-w-n Oct 3, 2019
41f548d
remove extraneous properties when changing prompt type
a-b-r-o-w-n Oct 3, 2019
c8db6e8
make validations editable inline
a-b-r-o-w-n Oct 3, 2019
8e2623a
add choices form to multi choice input
a-b-r-o-w-n Oct 4, 2019
a37e812
add rest of multi choice fields
a-b-r-o-w-n Oct 4, 2019
ac85e02
add extra confirm input fields
a-b-r-o-w-n Oct 7, 2019
07be829
Merge branch 'master' into prompt-updates-2
a-b-r-o-w-n Oct 7, 2019
adf2f12
Merge branch 'master' into prompt-updates-2
cwhitten Oct 8, 2019
c81d22b
Merge branch 'master' into prompt-updates-2
cwhitten Oct 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions BotProject/CSharp/Schemas/sdk.schema
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down Expand Up @@ -1033,7 +1033,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down Expand Up @@ -1410,7 +1410,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down Expand Up @@ -1814,7 +1814,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down Expand Up @@ -4333,7 +4333,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down Expand Up @@ -4572,7 +4572,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down Expand Up @@ -6885,7 +6885,7 @@
"type": "integer",
"title": "Max Turn Count",
"description": "The max retry count for this prompt.",
"default": 2147483647,
"default": 3,
"examples": [
3
]
Expand Down
5 changes: 4 additions & 1 deletion Composer/packages/extensions/obiformeditor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"watch": "yarn build:ts --watch"
},
"dependencies": {
"@bfcomposer/react-jsonschema-form": "1.6.2",
"@bfcomposer/react-jsonschema-form": "1.6.5",
"@emotion/core": "^10.0.17",
"@uifabric/fluent-theme": "7.1.4",
"@uifabric/styling": "7.7.1",
"classnames": "^2.2.6",
Expand All @@ -35,6 +36,7 @@
"lodash.isequal": "^4.5.0",
"lodash.merge": "^4.6.1",
"lodash.omit": "^4.5.0",
"lodash.pick": "^4.4.0",
"nanoid": "^2.0.1",
"office-ui-fabric-react": "7.37.1",
"react-error-boundary": "^1.2.5",
Expand All @@ -60,6 +62,7 @@
"@types/lodash.isequal": "^4.5.5",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.omit": "^4.5.6",
"@types/lodash.pick": "^4.4.6",
"@types/lodash.startcase": "^4.4.6",
"@types/nanoid": "^1.2.1",
"@types/react": "16.9.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export default function FieldTemplate(props: FieldTemplateProps) {
return null;
}

return <>{children}</>;
return <div className="FieldTemplate">{children}</div>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import React, { useState, useEffect } from 'react';
import { TextField, ITextFieldStyles, ITextFieldProps } from 'office-ui-fabric-react';
import { NeutralColors } from '@uifabric/fluent-theme';
import { mergeStyles } from '@uifabric/styling';

interface EditableFieldProps extends ITextFieldProps {
onChange: (e: any, newTitle?: string) => void;
styleOverrides?: Partial<ITextFieldStyles>;
placeholder?: string;
fontSize?: string;
}

export const EditableField: React.FC<EditableFieldProps> = props => {
const { styleOverrides = {}, placeholder, fontSize, onChange, onBlur, value, ...rest } = props;
const [editing, setEditing] = useState<boolean>(false);
const [hasFocus, setHasFocus] = useState<boolean>(false);
const [localValue, setLocalValue] = useState<string | undefined>(value);
const [hasBeenEdited, setHasBeenEdited] = useState<boolean>(false);

useEffect(() => {
if (!hasBeenEdited) {
setLocalValue(value);
}
}, [value]);

const handleChange = (_e: any, newValue?: string) => {
setLocalValue(newValue);
setHasBeenEdited(true);
onChange(_e, newValue);
};

const handleCommit = (e: React.FocusEvent<HTMLInputElement>) => {
setHasFocus(false);
setEditing(false);
onBlur && onBlur(e);
};

let borderColor: string | undefined = undefined;

if (!editing) {
borderColor = localValue ? 'transparent' : NeutralColors.gray30;
}

return (
<div onMouseEnter={() => setEditing(true)} onMouseLeave={() => !hasFocus && setEditing(false)}>
<TextField
placeholder={placeholder || value}
value={localValue}
styles={{
root: mergeStyles({ margin: '5px 0 7px -9px' }, styleOverrides.root),
field: mergeStyles(
{
fontSize: fontSize,
selectors: {
'::placeholder': {
fontSize: fontSize,
},
},
},
styleOverrides.field
),
fieldGroup: mergeStyles(
{
borderColor,
transition: 'border-color 0.1s linear',
selectors: {
':hover': {
borderColor: hasFocus ? undefined : NeutralColors.gray30,
},
},
},
styleOverrides.fieldGroup
),
}}
onBlur={handleCommit}
onFocus={() => setHasFocus(true)}
onChange={handleChange}
autoComplete="off"
{...rest}
/>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import React from 'react';
import { FieldProps } from '@bfcomposer/react-jsonschema-form';
import formatMessage from 'format-message';

import { TextareaWidget } from '../../widgets';

import { GetSchema, PromptFieldChangeHandler } from './types';

interface BotAsksProps extends FieldProps<MicrosoftInputDialog> {
onChange: PromptFieldChangeHandler;
getSchema: GetSchema;
}

export const BotAsks: React.FC<BotAsksProps> = props => {
const { onChange, getSchema, idSchema, formData, formContext } = props;

return (
<>
<TextareaWidget
onChange={onChange('prompt')}
schema={getSchema('prompt')}
id={idSchema.prompt.__id}
value={formData.prompt}
label={formatMessage('Prompt')}
formContext={formContext}
/>
</>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import formatMessage from 'format-message';
import { IdSchema } from '@bfcomposer/react-jsonschema-form';
import { JSONSchema6 } from 'json-schema';
import get from 'lodash.get';

import { field } from '../styles';
import { TextWidget, CheckboxWidget } from '../../../widgets';
import { FormContext } from '../../../types';

interface ChoiceOptionsProps {
idSchema: IdSchema;
schema: JSONSchema6;
formData: IChoiceOption;
onChange: (field: keyof IChoiceOption) => (data: any) => void;
formContext: FormContext;
}

export const ChoiceOptions: React.FC<ChoiceOptionsProps> = props => {
const { schema, formData, onChange, idSchema, formContext } = props;

const optionSchema = (field: keyof IChoiceOption): JSONSchema6 => {
return get(schema, ['properties', field]);
};

return (
<>
<div css={field}>
<TextWidget
onChange={onChange('inlineSeparator')}
schema={optionSchema('inlineSeparator')}
id={idSchema.inlineSeparator && idSchema.inlineSeparator.__id}
value={formData.inlineSeparator}
label={formatMessage('Inline separator')}
formContext={formContext}
/>
</div>
<div css={field}>
<TextWidget
onChange={onChange('inlineOr')}
schema={optionSchema('inlineOr')}
id={idSchema.inlineOr && idSchema.inlineOr.__id}
value={formData.inlineOr}
label={formatMessage('Inline or')}
formContext={formContext}
/>
</div>
<div css={field}>
<TextWidget
onChange={onChange('inlineOrMore')}
schema={optionSchema('inlineOrMore')}
id={idSchema.inlineOrMore && idSchema.inlineOrMore.__id}
value={formData.inlineOrMore}
label={formatMessage('Inline or more')}
formContext={formContext}
/>
</div>
<div css={field}>
<CheckboxWidget
onChange={onChange('includeNumbers')}
schema={optionSchema('includeNumbers')}
id={idSchema.includeNumbers && idSchema.includeNumbers.__id}
value={formData.includeNumbers}
label={formatMessage('Include numbers')}
formContext={formContext}
/>
</div>
</>
);
};
Loading