diff --git a/src/webparts/palettePicker/PalettePickerWebPart.tsx b/src/webparts/palettePicker/PalettePickerWebPart.tsx index b24da0926..d03ad9513 100644 --- a/src/webparts/palettePicker/PalettePickerWebPart.tsx +++ b/src/webparts/palettePicker/PalettePickerWebPart.tsx @@ -16,7 +16,8 @@ import { PropertyPaneHost } from 'property-pane-portal'; import { update } from '@microsoft/sp-lodash-subset'; export interface IPalettePickerWebPartProps { - cssObjectText; + //cssObjectText: string; + //colorObject: any; } @@ -54,13 +55,13 @@ export default class PalettePickerWebPart extends BaseClientSideWebPart value); - } else { - update(this.properties, property, () => JSON.stringify(value)); - } + // } else { + // update(this.properties, property, () => JSON.stringify(value)); + // } this.render(); } @@ -98,6 +99,7 @@ export default class PalettePickerWebPart extends BaseClientSideWebPart = (props) => { return (
+
:root {
{ Object.keys(props.colorObject).map((key) => { return ( @@ -22,6 +23,8 @@ export const Colors: React.FC = (props) => { }) } +
}
+
); }; \ No newline at end of file diff --git a/src/webparts/palettePicker/components/CustomPropertyPane.tsx b/src/webparts/palettePicker/components/CustomPropertyPane.tsx index 8b7901eb3..a4fec5727 100644 --- a/src/webparts/palettePicker/components/CustomPropertyPane.tsx +++ b/src/webparts/palettePicker/components/CustomPropertyPane.tsx @@ -5,6 +5,7 @@ import styles from './CustomPropertyPane.module.scss'; import { Range } from 'react-range'; import { composeComponentAs } from 'office-ui-fabric-react'; import { Colors } from './Colors'; +import { escape } from '@microsoft/sp-lodash-subset'; /* @@ -49,26 +50,10 @@ const getCode = (hue, saturation, lightness, shades) => { } catch(ex) {console.log("obj problems"); } // console.log("RESULT:", RESULT); //console.log("color obj:", obj); - return [obj, JSON.stringify(obj).replace(/['"]+/g, '')]; + return obj; //, JSON.stringify(obj)];// .replace(/['"]+/g, '')]; } - const cssStyles = (obj) => { - //console.log("OBJ:", obj); - // let cssText:string = ":root {"; - let cssText:string = ""; - Object.keys(obj).map((key) => { - console.log(key + ":" + obj[key]); - let txt = key + ":" + obj[key]; - cssText += txt + "; " ; - }); - - // cssText += "}"; - - - return cssText; - - } export const CustomPropertyPane: React.FunctionComponent = (props) => { @@ -82,7 +67,8 @@ export const CustomPropertyPane: React.FunctionComponent ( @@ -271,7 +257,7 @@ export const CustomPropertyPane: React.FunctionComponent