mirror of
https://github.com/enso-org/enso.git
synced 2024-12-18 09:31:58 +03:00
129022ae12
- Close https://github.com/enso-org/cloud-v2/issues/734 - Add modal to create a new Data Link - Add the same input to the asset right panel - Add entries on context menu and Drive Bar - The shortcut is <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>N</kbd> - Add (and use) corresponding backend endpoints # Important Notes - All UI is currently generated based off of a single-source-of-truth JSON Schema file. - JSON Schema was chosen for a few reasons: - trivial to parse (it's plain JSON) - sufficiently powerful (supports unions (used in the initial schema), objects, and singleton/literal types) - but still quite simple (this makes it easier to implement various utilities for, because there are fewer cases to cover) - Note that it is definitely possible to change this. The original suggestion was a TypeScript file, which can definitely be done even using just the `typescript` package itself - I just prefer to avoid adding another step in the build process, especially one that depends on the `typescript` package at runtime. - Note also that we *do* actually bundle transpilers as part of the visualization loading code in GUI2 - so for now at least, the size of the dependency isn't a primary concern, but rather just the mental overhead of having another dependency for this one specific task.
29 lines
681 B
Plaintext
29 lines
681 B
Plaintext
{
|
|
"React Component": {
|
|
"prefix": ["$c", "component"],
|
|
"body": [
|
|
"/** @file $2 */",
|
|
"import * as React from 'react'",
|
|
"",
|
|
"// ====${1/./=/g}====",
|
|
"// === $1 ===",
|
|
"// ====${1/./=/g}====",
|
|
"",
|
|
"/** Props for a {@link ${1:$TM_FILENAME_BASE}}. */",
|
|
"export interface $1Props {",
|
|
" $3",
|
|
"}",
|
|
"",
|
|
"/** $2 */",
|
|
"export default function $1(props: $1Props) {",
|
|
" const { ${3/(.+?):.+/$1, /g} } = props",
|
|
" return <>$4</>",
|
|
"}"
|
|
]
|
|
},
|
|
"useState": {
|
|
"prefix": ["$s", "usestate"],
|
|
"body": ["const [$1, set${1/(.*)/${1:/pascalcase}/}] = React.useState($2)"]
|
|
}
|
|
}
|