PromucFlow_constructor/app/client/src/widgets/constants.ts
Aswath K 7624b91026
chore: Grouping & Reorganisation for ButtonWidget, JSON Form widget and Audio Widget (#14379)
* POC: Grouping for ButtonWidget

* Adds featureflag

* improve feature flag experience for unfinished widgets

* Styling of tabs

* Adds activation group for ButtonWidget

* Makes contentConfig & styleCOnfig optional to avoid typescript errors from tests

* Adds UI for search

* Fixes title, search & tabs UI to the top

* fix: style issue

* fix styles

* refactor ProeprtyPaneTab

* updates Button based on Figma design changes

* POC for AudioWidget

* chore: JSON Form Grouping & Reorganisation (#15033)

* POC: JSON Form grouping

* fix: Empty sections

* Moves icon into a separate sub section

* fix some sections based on updated Designs

* fix styling issues

* fix: double border

* udpdates based on Figma updates

* Updates order as per Figma

* refactor and better naming of function

* address review comments for JSON form configs

* fix UI issues

* reorder JSON form's array data section

* Adds Button Form settings

* Address QA comments

* update JSON form with new design changes

* Open array & object style by default

* trigger ci

* chore: Grouping & reorganisation of Video widget (#15297)

* POC: JSON Form grouping

* fix: Empty sections

* Moves icon into a separate sub section

* fix some sections based on updated Designs

* fix styling issues

* fix: double border

* udpdates based on Figma updates

* Updates order as per Figma

* Content & Style Config for Video Widget

* refactor and better naming of function

* address review comments for JSON form configs

* fix UI issues

* ??

* chore: Grouping & reorganisation of Document Viewer widget (#15514)

* Grouping & re-org for Document Viewer

* fix: scroll issue

* feat: Search properties in property pane (#14876)

* Upgrades fuse.js package

* Property pane search POC

* POC: JSON Form grouping

* fix: Empty sections

* Moves icon into a separate sub section

* fix some sections based on updated Designs

* fix styling issues

* fix: double border

* udpdates based on Figma updates

* Updates order as per Figma

* fix unused variable after merge

* Adds empty search UI

* Makes the order of search result proper

* Refactor PropertyControlGenerator

* refactor and support for panel

* Revert "Upgrades fuse.js package"

This reverts commit 76d8038139ff4b8add79019a75eaaf40fd620e8e.

* extract out search functionality to helper

* cleanup

* fix: panel issue

* Focus on Search bar on opening the property pane

* better naming

* fix: fuzzy search params

* refactor: As suggested in the code review

* fix: section is not hidden when there's no children

* fix: issue panel properties
2022-08-04 11:01:05 +05:30

166 lines
4.9 KiB
TypeScript

import { PropertyPaneConfig } from "constants/PropertyControlConstants";
import { WidgetConfigProps } from "reducers/entityReducers/widgetConfigReducer";
import { DerivedPropertiesMap } from "utils/WidgetFactory";
import { WidgetFeatures } from "utils/WidgetFeatures";
import { WidgetProps } from "./BaseWidget";
export interface WidgetConfiguration {
type: string;
name: string;
iconSVG?: string;
defaults: Partial<WidgetProps> & WidgetConfigProps;
hideCard?: boolean;
isDeprecated?: boolean;
replacement?: string;
isCanvas?: boolean;
needsMeta?: boolean;
features?: WidgetFeatures;
searchTags?: string[];
properties: {
config: PropertyPaneConfig[];
contentConfig?: PropertyPaneConfig[];
styleConfig?: PropertyPaneConfig[];
default: Record<string, string>;
meta: Record<string, any>;
derived: DerivedPropertiesMap;
};
}
export const GRID_DENSITY_MIGRATION_V1 = 4;
export enum BlueprintOperationTypes {
MODIFY_PROPS = "MODIFY_PROPS",
ADD_ACTION = "ADD_ACTION",
CHILD_OPERATIONS = "CHILD_OPERATIONS",
}
export type FlattenedWidgetProps = WidgetProps & {
children?: string[];
};
export interface DSLWidget extends WidgetProps {
children?: DSLWidget[];
}
export enum FileDataTypes {
Base64 = "Base64",
Text = "Text",
Binary = "Binary",
}
export type AlignWidget = "LEFT" | "RIGHT";
export enum AlignWidgetTypes {
LEFT = "LEFT",
RIGHT = "RIGHT",
}
// Minimum Rows for Widget Popups
export const MinimumPopupRows = 12;
// Default boxShadowColor used in theming migration
export const rgbaMigrationConstantV56 = "rgba(0, 0, 0, 0.25)";
export const BUTTON_GROUP_CHILD_STYLESHEET = {
button: {
buttonColor: "{{appsmith.theme.colors.primaryColor}}",
},
};
export const TABLE_WIDGET_CHILD_STYLESHEET = {
button: {
buttonColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
menuButton: {
menuColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
iconButton: {
menuColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
};
export const JSON_FORM_WIDGET_CHILD_STYLESHEET = {
ARRAY: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
cellBorderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
cellBoxShadow: "none",
},
OBJECT: {
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
cellBorderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
cellBoxShadow: "none",
},
CHECKBOX: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
},
CURRENCY_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
DATEPICKER: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
EMAIL_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
MULTISELECT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
MULTILINE_TEXT_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
NUMBER_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
PASSWORD_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
PHONE_NUMBER_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
RADIO_GROUP: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
boxShadow: "none",
},
SELECT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
SWITCH: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
boxShadow: "none",
},
TEXT_INPUT: {
accentColor: "{{appsmith.theme.colors.primaryColor}}",
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
boxShadow: "none",
},
};
export const YOUTUBE_URL_REGEX = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=|\?v=)([^#&?]*).*/;