2020-05-20 11:30:53 +00:00
import { generateTypeDef } from "utils/autocomplete/dataTreeTypeDefCreator" ;
2021-12-07 10:19:33 +00:00
import {
DataTreeAction ,
DataTreeAppsmith ,
} from "entities/DataTree/dataTreeFactory" ;
2020-06-04 13:49:22 +00:00
import _ from "lodash" ;
2021-09-08 17:32:22 +00:00
import { JSCollection } from "entities/JSCollection" ;
2021-12-07 10:19:33 +00:00
import { EVALUATION_PATH } from "utils/DynamicBindingUtils" ;
2020-05-20 11:30:53 +00:00
const isVisible = {
"!type" : "bool" ,
"!doc" : "Boolean value indicating if the widget is in visible state" ,
} ;
2021-09-09 15:10:22 +00:00
export const entityDefinitions : Record < string , unknown > = {
2021-12-07 10:19:33 +00:00
APPSMITH : ( entity : DataTreeAppsmith ) = > {
const generatedTypeDef = generateTypeDef (
_ . omit ( entity , "ENTITY_TYPE" , EVALUATION_PATH ) ,
) ;
if (
typeof generatedTypeDef === "object" &&
typeof generatedTypeDef . geolocation === "object"
) {
return {
. . . generatedTypeDef ,
geolocation : {
. . . generatedTypeDef . geolocation ,
"!doc" :
"The user's geo location information. Only available when requested" ,
"!url" :
"https://docs.appsmith.com/v/v1.2.1/framework-reference/geolocation" ,
getCurrentPosition :
"fn(onSuccess: fn() -> void, onError: fn() -> void, options: object) -> void" ,
watchPosition : "fn(options: object) -> void" ,
clearWatch : "fn() -> void" ,
} ,
} ;
}
return generatedTypeDef ;
} ,
2020-06-04 13:49:22 +00:00
ACTION : ( entity : DataTreeAction ) = > {
const dataDef = generateTypeDef ( entity . data ) ;
let data : Record < string , any > = {
"!doc" : "The response of the action" ,
} ;
if ( _ . isString ( dataDef ) ) {
data [ "!type" ] = dataDef ;
} else {
data = { . . . data , . . . dataDef } ;
}
return {
"!doc" :
"Actions allow you to connect your widgets to your backend data in a secure manner." ,
2021-02-03 15:15:16 +00:00
"!url" : "https://docs.appsmith.com/v/v1.2.1/framework-reference/run" ,
2020-06-04 13:49:22 +00:00
isLoading : "bool" ,
data ,
2021-07-20 10:02:56 +00:00
responseMeta : {
"!doc" : "The response meta of the action" ,
"!type" : "?" ,
} ,
2021-12-23 14:17:20 +00:00
run :
"fn(onSuccess: fn() -> void, onError: fn() -> void) -> +Promise[:t=[!0.<i>.:t]]" ,
clear : "fn() -> +Promise[:t=[!0.<i>.:t]]" ,
2020-06-04 13:49:22 +00:00
} ;
} ,
2021-09-24 16:05:53 +00:00
AUDIO_WIDGET : {
"!doc" :
"Audio widget can be used for playing a variety of audio formats like MP3, AAC etc." ,
"!url" : "https://docs.appsmith.com/widget-reference/audio" ,
playState : "number" ,
autoPlay : "bool" ,
} ,
2020-05-20 11:30:53 +00:00
CONTAINER_WIDGET : {
"!doc" :
"Containers are used to group widgets together to form logical higher order widgets. Containers let you organize your page better and move all the widgets inside them together." ,
2021-02-03 15:15:16 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/container" ,
2020-05-20 11:30:53 +00:00
backgroundColor : {
"!type" : "string" ,
2021-02-03 15:15:16 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/container" ,
2020-05-20 11:30:53 +00:00
} ,
isVisible : isVisible ,
} ,
INPUT_WIDGET : {
"!doc" :
"An input text field is used to capture a users textual input such as their names, numbers, emails etc. Inputs are used in forms and can have custom validations." ,
"!url" : "https://docs.appsmith.com/widget-reference/input" ,
text : {
"!type" : "string" ,
"!doc" : "The text value of the input" ,
"!url" : "https://docs.appsmith.com/widget-reference/input" ,
} ,
isValid : "bool" ,
isVisible : isVisible ,
2020-05-22 12:46:11 +00:00
isDisabled : "bool" ,
2021-08-26 10:52:45 +00:00
countryCode : {
"!type" : "string" ,
"!doc" : "Selected country code for Phone Number type input" ,
} ,
2021-07-15 12:50:01 +00:00
currencyCountryCode : {
"!type" : "string" ,
"!doc" : "Selected country code for Currency type input" ,
} ,
2020-05-20 11:30:53 +00:00
} ,
TABLE_WIDGET : ( widget : any ) = > ( {
"!doc" :
"The Table is the hero widget of Appsmith. You can display data from an API in a table, trigger an action when a user selects a row and even work with large paginated data sets" ,
"!url" : "https://docs.appsmith.com/widget-reference/table" ,
selectedRow : generateTypeDef ( widget . selectedRow ) ,
2020-09-08 13:04:51 +00:00
selectedRows : generateTypeDef ( widget . selectedRows ) ,
2021-12-15 12:14:50 +00:00
selectedRowIndices : generateTypeDef ( widget . selectedRowIndices ) ,
2021-09-23 11:46:47 +00:00
triggeredRow : generateTypeDef ( widget . triggeredRow ) ,
2020-05-20 11:30:53 +00:00
selectedRowIndex : "number" ,
tableData : generateTypeDef ( widget . tableData ) ,
2020-05-28 06:12:04 +00:00
pageNo : "number" ,
pageSize : "number" ,
2020-05-22 12:46:11 +00:00
isVisible : isVisible ,
2020-07-24 13:58:28 +00:00
searchText : "string" ,
2021-08-30 09:24:59 +00:00
totalRecordsCount : "number" ,
2021-08-25 13:20:06 +00:00
sortOrder : {
column : "string" ,
order : [ "asc" , "desc" ] ,
} ,
2020-05-20 11:30:53 +00:00
} ) ,
2021-01-12 01:22:31 +00:00
VIDEO_WIDGET : {
2020-09-26 12:59:33 +00:00
"!doc" :
"Video widget can be used for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia, Mixcloud, and DailyMotion." ,
"!url" : "https://docs.appsmith.com/widget-reference/video" ,
playState : "number" ,
autoPlay : "bool" ,
2021-01-12 01:22:31 +00:00
} ,
2020-05-20 11:30:53 +00:00
DROP_DOWN_WIDGET : {
"!doc" :
2021-05-07 05:26:36 +00:00
"Select is used to capture user input/s from a specified list of permitted inputs. A Select can capture a single choice as well as multiple choices" ,
2020-05-20 11:30:53 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
2020-05-22 12:46:11 +00:00
isVisible : isVisible ,
2021-08-16 06:56:09 +00:00
filterText : {
"!type" : "[string]" ,
"!doc" : "The filter text for Server side filtering" ,
} ,
2020-05-22 12:46:11 +00:00
selectedOptionValue : {
"!type" : "string" ,
"!doc" : "The value selected in a single select dropdown" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
2021-02-26 06:24:25 +00:00
selectedOptionLabel : {
"!type" : "string" ,
"!doc" : "The selected option label in a single select dropdown" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
2020-09-10 07:21:44 +00:00
selectedOptionValues : {
2021-08-03 06:38:01 +00:00
"!type" : "[string]" ,
"!doc" : "The array of values selected in a multi select dropdown" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
selectedOptionLabels : {
"!type" : "[string]" ,
"!doc" : "The array of selected option labels in a multi select dropdown" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
isDisabled : "bool" ,
options : "[dropdownOption]" ,
} ,
MULTI_SELECT_WIDGET : {
"!doc" :
"MultiSelect is used to capture user input/s from a specified list of permitted inputs. A MultiSelect captures multiple choices from a list of options" ,
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
isVisible : isVisible ,
2021-08-16 06:56:09 +00:00
filterText : {
"!type" : "[string]" ,
"!doc" : "The filter text for Server side filtering" ,
} ,
2021-08-03 06:38:01 +00:00
selectedOptionValues : {
2020-05-22 12:46:11 +00:00
"!type" : "[string]" ,
"!doc" : "The array of values selected in a multi select dropdown" ,
2021-02-26 06:24:25 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
selectedOptionLabels : {
"!type" : "[string]" ,
"!doc" : "The array of selected option labels in a multi select dropdown" ,
2020-05-22 12:46:11 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/dropdown" ,
} ,
isDisabled : "bool" ,
2020-05-20 11:30:53 +00:00
options : "[dropdownOption]" ,
} ,
IMAGE_WIDGET : {
"!doc" :
"Image widget is used to display images in your app. Images must be either a URL or a valid base64." ,
"!url" : "https://docs.appsmith.com/widget-reference/image" ,
image : "string" ,
isVisible : isVisible ,
} ,
TEXT_WIDGET : {
"!doc" :
" Text widget is used to display textual information. Whether you want to display a paragraph or information or add a heading to a container, a text widget makes it easy to style and display text" ,
"!url" : "https://docs.appsmith.com/widget-reference/text" ,
isVisible : isVisible ,
text : "string" ,
} ,
BUTTON_WIDGET : {
"!doc" :
"Buttons are used to capture user intent and trigger actions based on that intent" ,
"!url" : "https://docs.appsmith.com/widget-reference/button" ,
isVisible : isVisible ,
text : "string" ,
isDisabled : "bool" ,
2022-01-02 16:27:39 +00:00
recaptchaToken : "string" ,
2020-05-20 11:30:53 +00:00
} ,
DATE_PICKER_WIDGET : {
"!doc" :
"Datepicker is used to capture the date and time from a user. It can be used to filter data base on the input date range as well as to capture personal information such as date of birth" ,
"!url" : "https://docs.appsmith.com/widget-reference/datepicker" ,
isVisible : isVisible ,
selectedDate : "string" ,
isDisabled : "bool" ,
} ,
2021-02-23 12:35:09 +00:00
DATE_PICKER_WIDGET2 : {
"!doc" :
"Datepicker is used to capture the date and time from a user. It can be used to filter data base on the input date range as well as to capture personal information such as date of birth" ,
"!url" : "https://docs.appsmith.com/widget-reference/datepicker" ,
isVisible : isVisible ,
selectedDate : "string" ,
formattedDate : "string" ,
isDisabled : "bool" ,
} ,
2020-05-20 11:30:53 +00:00
CHECKBOX_WIDGET : {
"!doc" :
"Checkbox is a simple UI widget you can use when you want users to make a binary choice" ,
"!url" : "https://docs.appsmith.com/widget-reference/checkbox" ,
isVisible : isVisible ,
isChecked : "bool" ,
isDisabled : "bool" ,
} ,
2021-02-16 12:15:17 +00:00
SWITCH_WIDGET : {
"!doc" :
"Switch is a simple UI widget you can use when you want users to make a binary choice" ,
"!url" : "https://docs.appsmith.com/widget-reference/switch" ,
isVisible : isVisible ,
isSwitchedOn : "bool" ,
isDisabled : "bool" ,
} ,
2020-05-20 11:30:53 +00:00
RADIO_GROUP_WIDGET : {
"!doc" :
"Radio widget lets the user choose only one option from a predefined set of options. It is quite similar to a SingleSelect Dropdown in its functionality" ,
"!url" : "https://docs.appsmith.com/widget-reference/radio" ,
isVisible : isVisible ,
options : "[dropdownOption]" ,
selectedOptionValue : "string" ,
isRequired : "bool" ,
} ,
TABS_WIDGET : {
isVisible : isVisible ,
selectedTab : "string" ,
} ,
MODAL_WIDGET : {
isVisible : isVisible ,
isOpen : "bool" ,
} ,
RICH_TEXT_EDITOR_WIDGET : {
isVisible : isVisible ,
text : "string" ,
isDisabled : "string" ,
} ,
CHART_WIDGET : {
"!doc" :
"Chart widget is used to view the graphical representation of your data. Chart is the go-to widget for your data visualisation needs." ,
"!url" : "https://docs.appsmith.com/widget-reference/chart" ,
isVisible : isVisible ,
chartData : "chartData" ,
xAxisName : "string" ,
yAxisName : "string" ,
2021-02-22 16:31:13 +00:00
selectedDataPoint : "chartDataPoint" ,
2020-05-20 11:30:53 +00:00
} ,
2020-06-09 13:10:42 +00:00
FORM_WIDGET : ( widget : any ) = > ( {
2020-05-20 11:30:53 +00:00
"!doc" :
"Form is used to capture a set of data inputs from a user. Forms are used specifically because they reset the data inputs when a form is submitted and disable submission for invalid data inputs" ,
"!url" : "https://docs.appsmith.com/widget-reference/form" ,
isVisible : isVisible ,
2020-06-09 13:10:42 +00:00
data : generateTypeDef ( widget . data ) ,
} ) ,
2020-05-20 11:30:53 +00:00
FORM_BUTTON_WIDGET : {
"!doc" :
"Form button is provided by default to every form. It is used for form submission and resetting form inputs" ,
"!url" : "https://docs.appsmith.com/widget-reference/form" ,
isVisible : isVisible ,
text : "string" ,
isDisabled : "bool" ,
2022-01-02 16:27:39 +00:00
recaptchaToken : "string" ,
2020-05-20 11:30:53 +00:00
} ,
MAP_WIDGET : {
isVisible : isVisible ,
center : "latLong" ,
markers : "[mapMarker]" ,
selectedMarker : "mapMarker" ,
} ,
FILE_PICKER_WIDGET : {
"!doc" :
"Filepicker widget is used to allow users to upload files from their local machines to any cloud storage via API. Cloudinary and Amazon S3 have simple APIs for cloud storage uploads" ,
2021-08-24 03:38:57 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/filepicker" ,
isVisible : isVisible ,
files : "[file]" ,
isDisabled : "bool" ,
} ,
FILE_PICKER_WIDGET_V2 : {
"!doc" :
"Filepicker widget is used to allow users to upload files from their local machines to any cloud storage via API. Cloudinary and Amazon S3 have simple APIs for cloud storage uploads" ,
2020-05-20 11:30:53 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/filepicker" ,
isVisible : isVisible ,
2021-03-12 08:14:32 +00:00
files : "[file]" ,
2020-05-22 12:46:11 +00:00
isDisabled : "bool" ,
2020-05-20 11:30:53 +00:00
} ,
2021-04-23 05:43:13 +00:00
LIST_WIDGET : ( widget : any ) = > ( {
"!doc" :
"Containers are used to group widgets together to form logical higher order widgets. Containers let you organize your page better and move all the widgets inside them together." ,
"!url" : "https://docs.appsmith.com/widget-reference/list" ,
backgroundColor : {
"!type" : "string" ,
"!url" : "https://docs.appsmith.com/widget-reference/how-to-use-widgets" ,
} ,
isVisible : isVisible ,
2021-05-03 05:01:47 +00:00
gridGap : "number" ,
2021-04-23 05:43:13 +00:00
selectedItem : generateTypeDef ( widget . selectedItem ) ,
2021-06-18 07:42:57 +00:00
items : generateTypeDef ( widget . items ) ,
listData : generateTypeDef ( widget . listData ) ,
2021-09-22 08:46:51 +00:00
pageNo : generateTypeDef ( widget . pageNo ) ,
pageSize : generateTypeDef ( widget . pageSize ) ,
2021-04-23 05:43:13 +00:00
} ) ,
2021-07-02 09:55:50 +00:00
RATE_WIDGET : {
"!doc" : "Rating widget is used to display ratings in your app." ,
"!url" : "https://docs.appsmith.com/widget-reference/rate" ,
isVisible : isVisible ,
value : "number" ,
maxCount : "number" ,
} ,
2021-07-30 06:36:00 +00:00
IFRAME_WIDGET : ( widget : any ) = > ( {
2021-06-12 16:08:10 +00:00
"!doc" : "Iframe widget is used to display iframes in your app." ,
"!url" : "https://docs.appsmith.com/widget-reference/iframe" ,
2021-06-09 09:39:17 +00:00
isVisible : isVisible ,
2021-06-12 16:08:10 +00:00
source : "string" ,
title : "string" ,
2021-07-30 06:36:00 +00:00
message : generateTypeDef ( widget . message ) ,
} ) ,
2021-07-07 09:30:06 +00:00
DIVIDER_WIDGET : {
"!doc" : "Divider is a simple UI widget used as a separator" ,
"!url" : "https://docs.appsmith.com/widget-reference/divider" ,
isVisible : isVisible ,
orientation : "string" ,
capType : "string" ,
capSide : "number" ,
strokeStyle : "string" ,
dividerColor : "string" ,
thickness : "number" ,
} ,
2021-07-13 08:05:09 +00:00
MENU_BUTTON_WIDGET : {
"!doc" :
"Menu button widget is used to represent a set of actions in a group." ,
"!url" : "https://docs.appsmith.com/widget-reference/menu-button" ,
isVisible : isVisible ,
label : "string" ,
} ,
2021-09-17 09:08:35 +00:00
//TODO: fix this after development
SINGLE_SELECT_TREE_WIDGET : {
"!doc" :
2021-09-20 15:18:10 +00:00
"TreeSelect is used to capture user input from a specified list of permitted inputs/Nested Inputs." ,
2021-09-17 09:08:35 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/treeselect" ,
isVisible : isVisible ,
selectedOptionValue : {
"!type" : "string" ,
2021-09-20 15:18:10 +00:00
"!doc" : "The value selected in a treeselect dropdown" ,
2021-09-17 09:08:35 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/treeselect" ,
} ,
selectedOptionLabel : {
"!type" : "string" ,
2021-09-20 15:18:10 +00:00
"!doc" : "The selected option label in a treeselect dropdown" ,
2021-09-17 09:08:35 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/treeselect" ,
} ,
isDisabled : "bool" ,
isValid : "bool" ,
options : "[dropdownOption]" ,
} ,
MULTI_SELECT_TREE_WIDGET : {
"!doc" :
2021-09-20 15:18:10 +00:00
"Multi TreeSelect is used to capture user inputs from a specified list of permitted inputs/Nested Inputs. A TreeSelect can capture a single choice as well as multiple choices" ,
2021-09-17 09:08:35 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/treeselect" ,
isVisible : isVisible ,
selectedOptionValues : {
"!type" : "[string]" ,
2021-09-20 15:18:10 +00:00
"!doc" : "The array of values selected in a treeselect dropdown" ,
2021-09-17 09:08:35 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/treeselect" ,
} ,
selectedOptionLabels : {
"!type" : "[string]" ,
2021-09-20 15:18:10 +00:00
"!doc" : "The array of selected option labels in a treeselect dropdown" ,
2021-09-17 09:08:35 +00:00
"!url" : "https://docs.appsmith.com/widget-reference/treeselect" ,
} ,
isDisabled : "bool" ,
isValid : "bool" ,
options : "[dropdownOption]" ,
} ,
2021-08-05 11:16:26 +00:00
ICON_BUTTON_WIDGET : {
"!doc" :
"Icon button widget is just an icon, along with all other button properties." ,
"!url" : "https://docs.appsmith.com/widget-reference/icon-button" ,
isVisible : isVisible ,
} ,
2021-08-17 09:11:38 +00:00
CHECKBOX_GROUP_WIDGET : {
"!doc" :
"Checkbox group widget allows users to easily configure multiple checkboxes together." ,
"!url" : "https://docs.appsmith.com/widget-reference/checkbox-group" ,
isVisible : isVisible ,
isDisabled : "bool" ,
isValid : "bool" ,
options : "[dropdownOption]" ,
selectedValues : "[string]" ,
} ,
2021-09-03 10:15:04 +00:00
STATBOX_WIDGET : {
"!doc" : "Show and highlight stats from your data sources" ,
"!url" : "https://docs.appsmith.com/widget-reference/stat-box" ,
isVisible : isVisible ,
} ,
2021-09-08 11:00:36 +00:00
AUDIO_RECORDER_WIDGET : {
"!doc" :
"Audio recorder widget allows users to record using their microphone, listen to the playback, and export the data to a data source." ,
"!url" : "https://docs.appsmith.com/widget-reference/recorder" ,
isVisible : isVisible ,
2021-11-11 14:46:08 +00:00
blobUrl : "string" ,
dataURL : "string" ,
rawBinary : "string" ,
2021-09-08 11:00:36 +00:00
} ,
2021-12-29 12:01:19 +00:00
PROGRESSBAR_WIDGET : {
"!doc" : "Progress bar is a simple UI widget used to show progress" ,
"!url" : "https://docs.appsmith.com/widget-reference/progressbar" ,
isVisible : isVisible ,
progress : "number" ,
} ,
2021-12-09 12:02:47 +00:00
SWITCH_GROUP_WIDGET : {
"!doc" :
"Switch group widget allows users to create many switch components which can easily by used in a form" ,
"!url" : "https://docs.appsmith.com/widget-reference/switch-group" ,
selectedValues : "[string]" ,
} ,
feat: camera widget (#8069)
* feat: Camera Widget
-- Scaffold the basic structure of the widget
* feat: Camera Widget
-- Prototype a feature, taking picture
* feat: Camera Widget
-- Add types for MediaRecorder
-- Define media capture status and action types
-- Prototype basic video recording, playing features
* feat: Camera Widget
-- Implement video player
-- Add timer for recording and playing video
-- Add permission and error handling logic
-- Add device selectors
* feat: Camera Widget
-- Place control buttons above device inputs layer
-- Make the widget fully responsive
* feat: Camera Widget
-- Change the color of caret-down icon to white
-- Remove overlaying of web cam and video player
-- Add some padding for device inputs
* feat: Camera Widget
-- Add black background to the container of the widget
* feat: Camera Widget
-- Change the widget icon
* feat: Camera Widget
-- Implement the mute feature of a mic or a camera
* feat: Camera Widget
-- Check media device permissions before getting started
* feat: Camera Widget
-- Add a fullscreen control
* feat: Camera Widget
-- Set error text color to white
-- Change the layout of control panel
* feat: Camera Widget
-- Apply layout change for control panel according to app layout change
* feat: Camera Widget
-- Add a new derived property, videoURL
* feat: Switch Group Widget
-- Adopt theme changes
* feat: Camera Widget
-- Make background grey in case of both error and disabled status
* feat: Camera Widget
-- Update npm dependencies
* feat: Camera Widget
-- Fix on #8788, using muted property
* feat: Camera Widget
-- Show off the microphone setting icon only if the current mode is video
-- Set isMirrored property to true by default
* feat: Camera Widget
-- Add photo viewer
* feat: Camera Widget
-- Add onImageCapture, onRecordingStart, onRecordingStop actions instead of onMediaCapture
* feat: Camera Widget
-- Expose meta properties for the widget
* feat: Camera Widget
-- Fix on responsiveness issue
* feat: Camera Widget
-- Add type definitions for MediaStream recording
* feat: Camera Widget
-- Hide isMirroed property for video mode
* feat: Camera Widget
-- Wrap all the controls with TooltipComponent
* feat: Camera Widget
-- Implement enter, exit full screen feature
* feat: Camera Widget
-- Add a widget icon for entity explorer
* feat: Camera Widget
-- Fix on the typo for the label of onRecordingStop property
* feat: Camera Widget
-- Enable/disable media tracks
* feat: Camera Widget
-- Set the video's height to 100% in fullscreen mode
* feat: Camera Widget
-- Add overlayers on Webcam
* feat: Camera Widget
-- Set position to relative on fullscreen wrapper div
-- Set the photo viewer's height to 100%
* feat: Camera Widget
-- Add image, mediaCaptureStatus, timer meta properties to keep UI states when the widget is dragged
* feat: Camera Widget
-- Refactor code base, eliminating commented code blocks
* feat: Camera Widget
-- Revert all the changes needed for keeping status when the widget is dragged
-- Set mirroed property to false for video mode
2021-12-24 14:06:59 +00:00
CAMERA_WIDGET : {
"!doc" :
"Camera widget allows users to take a picture or record videos through their system camera using browser permissions." ,
"!url" : "https://docs.appsmith.com/widget-reference/camera" ,
imageBlobURL : "string" ,
imageDataURL : "string" ,
imageRawBinary : "string" ,
videoBlobURL : "string" ,
videoDataURL : "string" ,
videoRawBinary : "string" ,
} ,
2022-01-07 09:57:45 +00:00
MAP_CHART_WIDGET : {
"!doc" :
"Map Chart widget shows the graphical representation of your data on the map." ,
"!url" : "https://docs.appsmith.com/widget-reference/map-chart" ,
isVisible : isVisible ,
selectedDataPoint : "mapChartDataPoint" ,
} ,
2020-05-20 11:30:53 +00:00
} ;
export const GLOBAL_DEFS = {
dropdownOption : {
label : "string" ,
value : "string" ,
} ,
tabs : {
id : "string" ,
label : "string" ,
} ,
chartDataPoint : {
x : "string" ,
y : "string" ,
} ,
chartData : {
seriesName : "string" ,
data : "[chartDataPoint]" ,
} ,
latLong : {
lat : "number" ,
long : "number" ,
} ,
mapMarker : {
lat : "number" ,
long : "number" ,
title : "string" ,
description : "string" ,
} ,
2021-03-12 08:14:32 +00:00
file : {
data : "string" ,
2021-03-12 09:04:05 +00:00
name : "text" ,
type : "file" ,
2021-03-12 08:14:32 +00:00
} ,
2022-01-07 09:57:45 +00:00
mapChartDataPoint : {
id : "string" ,
label : "string" ,
originalId : "string" ,
shortLabel : "string" ,
value : "number" ,
} ,
2020-05-20 11:30:53 +00:00
} ;
export const GLOBAL_FUNCTIONS = {
2021-07-20 10:02:56 +00:00
"!name" : "DATA_TREE.APPSMITH.FUNCTIONS" ,
2020-05-20 11:30:53 +00:00
navigateTo : {
"!doc" : "Action to navigate the user to another page or url" ,
2021-12-23 14:17:20 +00:00
"!type" :
"fn(pageNameOrUrl: string, params: {}, target?: string) -> +Promise[:t=[!0.<i>.:t]]" ,
2020-05-20 11:30:53 +00:00
} ,
showAlert : {
"!doc" : "Show a temporary notification style message to the user" ,
2021-12-23 14:17:20 +00:00
"!type" : "fn(message: string, style: string) -> +Promise[:t=[!0.<i>.:t]]" ,
2020-05-20 11:30:53 +00:00
} ,
showModal : {
"!doc" : "Open a modal" ,
2021-12-23 14:17:20 +00:00
"!type" : "fn(modalName: string) -> +Promise[:t=[!0.<i>.:t]]" ,
2020-05-20 11:30:53 +00:00
} ,
closeModal : {
"!doc" : "Close a modal" ,
2021-12-23 14:17:20 +00:00
"!type" : "fn(modalName: string) -> +Promise[:t=[!0.<i>.:t]]" ,
2020-05-20 11:30:53 +00:00
} ,
2020-08-24 12:09:17 +00:00
storeValue : {
"!doc" : "Store key value data locally" ,
2021-12-23 14:17:20 +00:00
"!type" : "fn(key: string, value: any) -> +Promise[:t=[!0.<i>.:t]]" ,
2020-08-24 12:09:17 +00:00
} ,
2020-08-28 12:07:37 +00:00
download : {
"!doc" : "Download anything as a file" ,
2021-12-23 14:17:20 +00:00
"!type" :
"fn(data: any, fileName: string, fileType?: string) -> +Promise[:t=[!0.<i>.:t]]" ,
2020-08-28 12:07:37 +00:00
} ,
2021-01-07 04:44:30 +00:00
copyToClipboard : {
"!doc" : "Copy text to clipboard" ,
2021-12-23 14:17:20 +00:00
"!type" : "fn(data: string, options: object) -> +Promise[:t=[!0.<i>.:t]]" ,
2021-01-07 04:44:30 +00:00
} ,
2021-03-02 12:49:36 +00:00
resetWidget : {
"!doc" : "Reset widget values" ,
2021-12-23 14:17:20 +00:00
"!type" :
"fn(widgetName: string, resetChildren: boolean) -> +Promise[:t=[!0.<i>.:t]]" ,
2021-03-02 12:49:36 +00:00
} ,
2021-10-11 12:55:03 +00:00
setInterval : {
"!doc" : "Execute triggers at a given interval" ,
"!type" : "fn(callback: fn, interval: number, id?: string) -> void" ,
} ,
clearInterval : {
"!doc" : "Stop executing a setInterval with id" ,
"!type" : "fn(id: string) -> void" ,
} ,
2020-05-20 11:30:53 +00:00
} ;
2021-09-08 17:32:22 +00:00
export const getPropsForJSActionEntity = (
entity : JSCollection ,
) : Record < string , string > = > {
const properties : Record < string , string > = { } ;
const actions = entity . actions ;
if ( actions && actions . length > 0 )
for ( let i = 0 ; i < entity . actions . length ; i ++ ) {
const action = entity . actions [ i ] ;
properties [ action . name + "()" ] = "Function" ;
}
const variablesProps = entity . variables ;
if ( variablesProps && variablesProps . length > 0 ) {
for ( let i = 0 ; i < variablesProps . length ; i ++ ) {
const variableProp = variablesProps [ i ] ;
properties [ variableProp . name ] = variableProp . value ;
}
}
return properties ;
} ;