├── src ├── README.md ├── design │ ├── index.js │ ├── urls.js │ └── serial.js ├── AppContext.js ├── SelectionContext.js ├── Tree │ ├── DragDropContext.js │ ├── TreeContext.js │ ├── AddButton.js │ ├── Help.js │ ├── ScreenDropArea.js │ ├── AddMethod.js │ ├── ComponentDropArea.js │ ├── Export.js │ ├── GenerateCode.js │ ├── ConfirmDelete.js │ ├── Data.js │ ├── AddLibraries.js │ ├── Duplicate.js │ ├── AddTemplates.js │ ├── AddLocation.js │ ├── AddComponent.js │ ├── Screen.js │ ├── DesignSettings.js │ └── Tree.js ├── libraries │ ├── grommet │ │ ├── index.js │ │ ├── InlineOption.js │ │ ├── ReorderIcon.js │ │ ├── BackButton.js │ │ ├── DataViews.js │ │ ├── TextAreaValue.js │ │ ├── WeightState.js │ │ ├── TextInputSuggestions.js │ │ ├── SizeState.js │ │ ├── GridAlign.js │ │ ├── UndefinedOption.js │ │ ├── SizeOptions.js │ │ ├── VariedOption.js │ │ ├── BoxJustify.js │ │ ├── BoxDirection.js │ │ ├── BoxAlign.js │ │ ├── WeightOptions.js │ │ ├── EdgeSizeOptions.js │ │ ├── JsonData.js │ │ ├── TrueOption.js │ │ ├── ImageSrc.js │ │ ├── HeadingLevel.js │ │ ├── DataChartAxis.js │ │ ├── TextAlign.js │ │ ├── DataTablePrimaryKey.js │ │ ├── useDebounce.js │ │ ├── BoxBackgroundImage.js │ │ ├── InlineOptions.js │ │ ├── DropAlign.js │ │ ├── EdgeSizeState.js │ │ ├── GridGap.js │ │ ├── BoxGridArea.js │ │ ├── DataChartBounds.js │ │ ├── BoxHoverIndicator.js │ │ ├── ChartBounds.js │ │ ├── Dimension.js │ │ ├── DataChartSeries.js │ │ ├── ChartValues.js │ │ ├── HeadingMargin.js │ │ ├── BoxRound.js │ │ ├── structure.js │ │ ├── Edge.js │ │ ├── starters.js │ │ ├── LayoutState.js │ │ ├── SelectOptions.js │ │ ├── BoxPad.js │ │ ├── ObjectOfObjects.js │ │ └── MeterValues.js │ └── designer │ │ ├── Alternative.js │ │ ├── index.js │ │ ├── Icon.js │ │ └── IFrame.js ├── Loading.js ├── utils.js ├── DesignComponent.js ├── Properties │ ├── OptionsProperty.js │ ├── ComponentProperty.js │ ├── TextAreaField.js │ ├── TextInputField.js │ ├── StringProperty.js │ ├── ComponentCode.js │ ├── LinkLabel.js │ ├── BooleanProperty.js │ ├── DataPathField.js │ ├── StringOrComponentProperty.js │ ├── NumberProperty.js │ ├── LinkProperty.js │ ├── IconProperty.js │ ├── ReferenceProperty.js │ ├── ComponentInput.js │ ├── StringOrBooleanProperty.js │ ├── ColorProperty.js │ ├── ObjectProperty.js │ ├── LinkOptionsProperty.js │ ├── LinkPropertyOptions.js │ ├── FunctionProperty.js │ ├── ArrayProperty.js │ ├── ScreenDetails.js │ └── Replace.js ├── index.js ├── friendlyState.js ├── templates │ ├── blankPage.json │ ├── details.json │ ├── list.json │ ├── table.json │ └── dashboard.json ├── components │ ├── Field.js │ └── Action.js ├── Canvas2.js ├── Auth.js ├── ConfirmReplace.js ├── ErrorCatcher.js ├── NotFound.js ├── friendlyDate.js ├── App.test.js ├── useDebounce.js ├── AppSettings.js ├── Router.js ├── InlineEditInput.js ├── NewScreen.js ├── Space.js └── Data.js ├── public ├── _redirects ├── shortcut-icon.png ├── manifest.json └── index.html ├── .prettierrc ├── funcs └── designs │ └── package.json ├── .editorconfig ├── .gitignore ├── config-overrides.js └── package.json /src/README.md: -------------------------------------------------------------------------------- 1 | ../README.md -------------------------------------------------------------------------------- /public/_redirects: -------------------------------------------------------------------------------- 1 | /* /index.html 200 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "singleQuote": true, 4 | "printWidth": 80 5 | } 6 | -------------------------------------------------------------------------------- /public/shortcut-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grommet/grommet-designer/HEAD/public/shortcut-icon.png -------------------------------------------------------------------------------- /src/design/index.js: -------------------------------------------------------------------------------- 1 | export * from './urls'; 2 | export * from './code'; 3 | export * from './serial'; 4 | export * from './upgrade'; 5 | -------------------------------------------------------------------------------- /src/AppContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | const AppContext = createContext(undefined); 4 | 5 | export default AppContext; 6 | -------------------------------------------------------------------------------- /src/SelectionContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | const SelectionContext = createContext(undefined); 4 | 5 | export default SelectionContext; 6 | -------------------------------------------------------------------------------- /src/Tree/DragDropContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | const DragDropContext = createContext(undefined); 4 | 5 | export default DragDropContext; 6 | -------------------------------------------------------------------------------- /src/Tree/TreeContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'react'; 2 | 3 | // TODO: remove file 4 | const TreeContext = createContext(undefined); 5 | 6 | export default TreeContext; 7 | -------------------------------------------------------------------------------- /src/design/urls.js: -------------------------------------------------------------------------------- 1 | export const apiUrl = 2 | 'https://us-central1-grommet-designer.cloudfunctions.net/designs'; 3 | // export const apiUrl = 'http://localhost:8080'; 4 | export const themeApiUrl = 5 | 'https://us-central1-grommet-designer.cloudfunctions.net/themes'; 6 | -------------------------------------------------------------------------------- /src/libraries/grommet/index.js: -------------------------------------------------------------------------------- 1 | import { components } from './components'; 2 | import { starters } from './starters'; 3 | import { structure } from './structure'; 4 | 5 | const index = { 6 | name: 'grommet', 7 | components, 8 | starters, 9 | structure, 10 | }; 11 | 12 | export default index; 13 | -------------------------------------------------------------------------------- /funcs/designs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "designs", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "@google-cloud/functions-framework": "^3.0.0", 6 | "@google-cloud/storage": "^5.12.0", 7 | "node-fetch": "^3.2.1" 8 | }, 9 | "scripts": { 10 | "start": "functions-framework --target=designs" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Loading.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Box, Text } from 'grommet'; 3 | 4 | const Loading = () => ( 5 | 6 | 7 | loading 8 | 9 | 10 | ); 11 | 12 | export default Loading; 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | max_line_length = 80 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | max_line_length = 0 14 | trim_trailing_whitespace = false 15 | 16 | [COMMIT_EDITMSG] 17 | max_line_length = 0 18 | -------------------------------------------------------------------------------- /src/Tree/AddButton.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Box, Button } from 'grommet'; 3 | 4 | const AddButton = ({ label, onClick }) => ( 5 | 8 | ); 9 | 10 | export default AddButton; 11 | -------------------------------------------------------------------------------- /src/libraries/designer/Alternative.js: -------------------------------------------------------------------------------- 1 | import { Children } from 'react'; 2 | 3 | const Alternative = ({ active, children }) => { 4 | if (Array.isArray(active)) { 5 | return Children.toArray(children).filter((_, i) => active.includes(i + 1)); 6 | } 7 | return Children.toArray(children)[active - 1] || null; 8 | }; 9 | 10 | export default Alternative; 11 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/libraries/grommet/InlineOption.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Box, Tip } from 'grommet'; 3 | 4 | const InlineOption = ({ border, children, label, pad }) => { 5 | return ( 6 | 7 | 8 | {children} 9 | 10 | 11 | ); 12 | }; 13 | 14 | export default InlineOption; 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/libraries/grommet/ReorderIcon.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Blank } from 'grommet-icons'; 3 | 4 | const ReorderIcon = () => ( 5 | 6 | 7 | 8 | 9 | 10 | 11 | ); 12 | 13 | export default ReorderIcon; 14 | -------------------------------------------------------------------------------- /src/libraries/grommet/BackButton.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Button } from 'grommet'; 3 | import { Previous } from 'grommet-icons'; 4 | 5 | const BackButton = ({ onClick, title }) => ( 6 |