appsmith.store.",
+ "!type": "fn(key: string, value: any, persist?: bool) -> +Promise",
},
removeValue: {
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/remove-value",
"!doc": "Remove key value data locally",
"!type": "fn(key: string) -> +Promise",
},
clearStore: {
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/clear-store",
"!doc": "Clear all key value data locally",
"!type": "fn() -> +Promise",
},
download: {
- "!doc": "Download anything as a file",
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/download",
+ "!doc":
+ "Download any data as a file, leveraging the capabilities of the downloadjs library.",
"!type":
"fn(data: string|+Blob, fileName: string, fileType?: string) -> +Promise",
},
copyToClipboard: {
- "!doc": "Copy text to clipboard",
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/copy-to-clipboard",
+ "!doc": "Copies the given text to clipboard",
"!type": "fn(data: string, options: object) -> +Promise",
},
resetWidget: {
- "!doc": "Reset widget values",
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/reset-widget",
+ "!doc":
+ "Resets a widget to its default state. All user input changes are reverted and its properties' default values are applied.",
"!type": "fn(widgetName: string, resetChildren: bool) -> +Promise",
},
setInterval: {
- "!doc": "Execute triggers at a given interval",
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/intervals-time-events",
+ "!doc": "Executes a function at a given interval",
"!type":
"fn(callback: fn() -> void, interval: number, id?: string) -> number",
},
clearInterval: {
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/clear-interval",
"!doc": "Stop executing a setInterval with id",
"!type": "fn(id: string) -> void",
},
postWindowMessage: {
+ "!url":
+ "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/post-message",
"!doc":
"Establish cross-origin communication between Window objects/page and iframes",
"!type": "fn(message: unknown, source: string, targetOrigin: string)",
@@ -180,4 +291,55 @@ export const getPropsForJSActionEntity = ({
return properties;
};
+export const ternDocsInfo: RecordclearTimeout()."
},
"clearTimeout": {
- "!type": "fn(timeout: number)",
+ "!type": "fn(timerId: number)",
"!url": "https://developer.mozilla.org/en/docs/DOM/window.clearTimeout",
- "!doc": "Clears the delay set by window.setTimeout()."
+ "!doc": "Clears the function scheduled to run by setTimeout()."
},
"Response": {
"!type": "fn()",
diff --git a/app/client/src/constants/defs/ecmascript.json b/app/client/src/constants/defs/ecmascript.json
index 228661efa0..eff7ec6a6b 100644
--- a/app/client/src/constants/defs/ecmascript.json
+++ b/app/client/src/constants/defs/ecmascript.json
@@ -1461,8 +1461,7 @@
"!url": "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify",
"!doc": "Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified."
},
- "!url": "https://developer.mozilla.org/en-US/docs/JSON",
- "!doc": "JSON (JavaScript Object Notation) is a data-interchange format. It closely resembles a subset of JavaScript syntax, although it is not a strict subset. (See JSON in the JavaScript Reference for full details.) It is useful when writing any kind of JavaScript-based application, including websites and browser extensions. For example, you might store user information in JSON format in a cookie, or you might store extension preferences in JSON in a string-valued browser preference."
+ "!url": "https://developer.mozilla.org/en-US/docs/JSON"
},
"ArrayBuffer": {
"!type": "fn(length: number)",
diff --git a/app/client/src/globalStyles/CodemirrorHintStyles.ts b/app/client/src/globalStyles/CodemirrorHintStyles.ts
index 39ace98f3b..658ad56fd5 100644
--- a/app/client/src/globalStyles/CodemirrorHintStyles.ts
+++ b/app/client/src/globalStyles/CodemirrorHintStyles.ts
@@ -2,6 +2,7 @@ import { createGlobalStyle } from "styled-components";
import type { EditorTheme } from "components/editorComponents/CodeEditor/EditorConfig";
import type { Theme } from "constants/DefaultTheme";
import { LINT_TOOLTIP_JUSTIFIED_LEFT_CLASS } from "components/editorComponents/CodeEditor/constants";
+import { CodeEditorColors } from "components/editorComponents/CodeEditor/styledComponents";
export const CodemirrorHintStyles = createGlobalStyle<{
editorTheme: EditorTheme;
@@ -14,15 +15,13 @@ export const CodemirrorHintStyles = createGlobalStyle<{
z-index: 20;
overflow: hidden;
list-style: none;
- margin-top: ${(props) => props.theme.spaces[3]}px;
- padding: 0px 0px;
- font-family: monospace;
+ padding: 0px;
+ font-family: ${(props) => props.theme.fonts.code};
max-height: 25em;
overflow-y: auto;
background: var(--ads-v2-color-bg);
box-shadow: var(--ads-v2-shadow-popovers);
border: 1px solid var(--ads-v2-color-border);
- border-radius: var(--ads-v2-border-radius);
}
.CodeMirror-hint {
@@ -38,7 +37,6 @@ export const CodemirrorHintStyles = createGlobalStyle<{
letter-spacing: -0.24px;
&:hover {
background: var(--ads-v2-color-bg-subtle);
- border-radius: 0px;
color: var(--ads-v2-color-fg);
&:after {
color: var(--ads-v2-color-fg);
@@ -82,9 +80,6 @@ export const CodemirrorHintStyles = createGlobalStyle<{
font-family: ${(props) => props.theme.fonts.text};
font-size:14px;
margin: 0 4px;
- &:hover {
- border-radius: var(--ads-v2-border-radius);
- }
&.CodeMirror-hint-active {
.magic {
path {
@@ -172,7 +167,6 @@ export const CodemirrorHintStyles = createGlobalStyle<{
bottom: 6px;
height: 12px;
width: 12px;
- border-radius: var(--ads-v2-border-radius);
font-size: 10px;
line-height: 12px;
font-weight: normal;
@@ -238,7 +232,6 @@ export const CodemirrorHintStyles = createGlobalStyle<{
}
li.CodeMirror-hint-active {
background-color: var(--ads-v2-color-bg-muted);
- border-radius: var(--ads-v2-border-radius);
color: var(--ads-v2-color-fg);
&:after {
color: var(--ads-v2-color-fg);
@@ -261,22 +254,43 @@ export const CodemirrorHintStyles = createGlobalStyle<{
background: var(--ads-v2-color-bg);
box-shadow: var(--ads-v2-shadow-popovers);
border: 1px solid var(--ads-v2-color-border);
- border-radius: var(--ads-v2-border-radius);
+ z-index: 15px;
+ font-weight: 500;
max-width: none;
white-space: nowrap;
.CodeMirror-Tern-fname {
- color: #304EAA;
+ color: ${CodeEditorColors.KEYWORD};
}
.CodeMirror-Tern-farg {
- color: #DB6E33;
+ color: ${CodeEditorColors.TOOLTIP_FN_ARGS};
&.CodeMirror-Tern-farg-current {
- color: #DB6E33;
+ color: ${CodeEditorColors.TOOLTIP_FN_ARGS};
font-weight: 600;
}
}
.CodeMirror-Tern-type {
color: #364252;
}
+ &.CodeMirror-Tern-hint-doc {
+ display: block;
+ background: var(--ads-v2-color-bg);
+ box-shadow: var(--ads-v2-shadow-popovers);
+ border: 1px solid var(--ads-v2-color-border);
+ color: var(--ads-v2-color-fg);
+ max-height: 150px;
+ max-width: 350px;
+ overflow: auto;
+ font-size: 11px;
+ padding: 0 !important;
+ .doc-link > span {
+ font-size: var(--ads-v2-font-size-2);
+ }
+ code {
+ background: var(--ads-v2-color-bg-subtle);
+ padding: 2px 4px;
+ border-radius: var(--ads-v2-border-radius);
+ }
+ }
}
}
@@ -299,7 +313,6 @@ export const CodemirrorHintStyles = createGlobalStyle<{
bottom: 6px;
height: 12px;
width: 12px;
- border-radius: var(--ads-v2-border-radius);
font-size: 10px;
line-height: 12px;
font-weight: normal;
@@ -339,26 +352,9 @@ export const CodemirrorHintStyles = createGlobalStyle<{
}
}
- .CodeMirror-Tern-hint-doc {
- display: none;
- &.visible {
- display: block;
- background-color: var(--ads-v2-color-bg) !important;
- color: var(--ads-v2-color-fg) !important;
- max-height: 150px;
- width: 250px;
- font-size: 12px;
- padding: 5px !important;
- border: 1px solid !important;
- border: 1px solid var(--ads-v2-color-border) !important;
- box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.12) !important;
- overflow: scroll;
- }
- }
.CodeMirror-lint-tooltip {
&& {
border: 1px solid var(--ads-v2-color-border) !important;
- border-radius: var(--ads-v2-border-radius);
background: var(--ads-v2-color-bg) !important;
box-shadow: 0px 12px 28px -6px rgba(0, 0, 0, 0.32);
padding: 4px;
diff --git a/app/client/src/utils/FilterInternalProperties/Common.ts b/app/client/src/utils/FilterInternalProperties/Common.ts
index e57a878d99..ce8758a105 100644
--- a/app/client/src/utils/FilterInternalProperties/Common.ts
+++ b/app/client/src/utils/FilterInternalProperties/Common.ts
@@ -10,27 +10,25 @@ export const createObjectPeekData = (
parentKey: string,
) => {
Object.keys(defs).forEach((key: string) => {
- if (key.indexOf("!") === -1) {
- const childKeyPathArray = [parentKey, key];
- if (isObject(defs[key])) {
- if (Object.keys(defs[key]).length > 0) {
- peekData[key] = {};
- const result = createObjectPeekData(
- defs[key],
- data[key],
- peekData[key],
- key,
- );
- _.set(peekData, childKeyPathArray, result.peekData);
- } else {
- peekData[key] = data[key];
- }
- } else {
- peekData[key] = isTernFunctionDef(defs[key])
- ? // eslint-disable-next-line @typescript-eslint/no-empty-function
- function () {} // tern inference required here
- : data[key];
- }
+ if (key.startsWith("!")) return;
+ const childKeyPathArray = [parentKey, key];
+ if (
+ isObject(defs[key]) &&
+ Object.keys(defs[key]).filter((k) => !k.startsWith("!")).length > 0
+ ) {
+ peekData[key] = {};
+ const result = createObjectPeekData(
+ defs[key],
+ data[key],
+ peekData[key],
+ key,
+ );
+ _.set(peekData, childKeyPathArray, result.peekData);
+ } else {
+ peekData[key] = isTernFunctionDef(defs[key])
+ ? // eslint-disable-next-line @typescript-eslint/no-empty-function
+ function () {} // tern inference required here
+ : data[key];
}
});
return { peekData };
diff --git a/app/client/src/utils/autocomplete/AutocompleteSortRules.ts b/app/client/src/utils/autocomplete/AutocompleteSortRules.ts
index a098a61264..eac6ae070a 100644
--- a/app/client/src/utils/autocomplete/AutocompleteSortRules.ts
+++ b/app/client/src/utils/autocomplete/AutocompleteSortRules.ts
@@ -313,6 +313,9 @@ class BlockAsyncFnsInDataFieldRule implements AutocompleteRule {
"clearTimeout",
"setInterval",
"clearInterval",
+ "postWindowMessage",
+ "windowMessageListener",
+ "watchPosition",
];
computeScore(
completion: Completion