Compare commits
1 Commits
fix/close-
...
feature/sl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1190dbdf89 |
14
.github/workflows/build-noodl-editor.yml
vendored
@@ -1,15 +1,15 @@
|
||||
name: Build fluxscape-editor
|
||||
name: Build noodl-editor
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
# Allows you to run this workflow from another workflow
|
||||
workflow_call:
|
||||
|
||||
# release:
|
||||
# types: [created]
|
||||
|
||||
|
||||
jobs:
|
||||
build_noodl_editor:
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -32,11 +32,11 @@ jobs:
|
||||
platform: linux-x64
|
||||
|
||||
steps:
|
||||
- if: ${{ matrix.platform == 'darwin-arm64' }}
|
||||
- if: ${{ matrix.platform == 'darwin-arm64' }}
|
||||
name: Setup
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -72,6 +72,6 @@ jobs:
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: fluxscape-editor-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
|
||||
name: noodl-editor-${{ matrix.platform }}-${{ github.head_ref }}-${{ github.sha }}
|
||||
path: publish
|
||||
retention-days: '12'
|
||||
retention-days: "12"
|
||||
|
||||
2
.github/workflows/test-noodl-editor.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Test fluxscape-editor
|
||||
name: Test noodl-editor
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
|
||||
32
README.md
@@ -1,21 +1,21 @@
|
||||
# Fluxscape
|
||||
# Noodl
|
||||
|
||||
Fluxscape is a low-code platform where designers and developers build custom applications and experiences. Designed as a visual programming environment, it aims to expedite your development process. It promotes the swift and efficient creation of applications, requiring minimal coding knowledge.
|
||||
[Noodl](https://noodl.net) is a low-code platform where designers and developers build custom applications and experiences. Designed as a visual programming environment, it aims to expedite your development process. It promotes the swift and efficient creation of applications, requiring minimal coding knowledge.
|
||||
|
||||
## Documentation
|
||||
Documentation for how to use Fluxscape can be found here:
|
||||
[Fluxscape Documentation](https://docs.fluxscape.io)
|
||||
Documentation for how to use Noodl can be found here:
|
||||
[https://noodlapp.github.io/noodl-docs/](https://noodlapp.github.io/noodl-docs/)
|
||||
|
||||
## Community
|
||||
Main support channel is Discord: [Fluxscape Discord](https://discord.gg/fXNW9EXa6A)
|
||||
Main support channel is Discord: [https://www.noodl.net/community](https://www.noodl.net/community)
|
||||
|
||||
## Download releases
|
||||
Pre-built binaries can be [downloaded from Github](https://github.com/fluxscape/fluxscape/releases)
|
||||
Pre-built binaries can be [downloaded from Github](https://github.com/noodlapp/noodl/releases)
|
||||
|
||||
## Note for users who are migrating from the deprecated closed source version
|
||||
- [Migrating the project files and workspaces to a Git provider](https://docs.fluxscape.io/docs/guides/collaboration/migrating-from-noodl-hosted-git/)
|
||||
- [Migrate backend and database](https://docs.fluxscape.io/docs/guides/deploy/using-an-external-backend/#migrating-from-a-noodl-cloud-service)
|
||||
- [Self-host frontend](https://docs.fluxscape.io/docs/guides/deploy/hosting-frontend/)
|
||||
- [Migrating the project files and workspaces to a Git provider](https://noodlapp.github.io/noodl-docs/docs/guides/collaboration/migrating-from-noodl-hosted-git)
|
||||
- [Migrate backend and database](https://noodlapp.github.io/noodl-docs/docs/guides/deploy/using-an-external-backend#migrating-from-a-noodl-cloud-service)
|
||||
- [Self-host frontend](https://noodlapp.github.io/noodl-docs/docs/guides/deploy/hosting-frontend)
|
||||
|
||||
## Building from source
|
||||
|
||||
@@ -23,24 +23,24 @@ Pre-built binaries can be [downloaded from Github](https://github.com/fluxscape/
|
||||
# Install all dependencies
|
||||
$ npm install
|
||||
|
||||
# Start the Fluxscape Editor and build a production version of the cloud and react runtime (useful when running Fluxscape from source but want to deploy to production)
|
||||
# Start the Noodl Editor and build a production version of the cloud and react runtime (useful when running Noodl from source but want to deploy to production)
|
||||
$ npm start
|
||||
|
||||
# Start the Fluxscape Editor and watch the filesystem for changes to the runtimes. Development versions of the runtimes, not meant for production (mostly due to source maps and file size)
|
||||
# Start the Noodl Editor and watch the filesystem for changes to the runtimes. Development versions of the runtimes, not meant for production (mostly due to source maps and file size)
|
||||
# This is ideal for a quick workflow when doing changes on the runtimes.
|
||||
$ npm run dev
|
||||
|
||||
# Start Fluxscape Editor test runner
|
||||
# Start Noodl Editor test runner
|
||||
$ npm run test:editor
|
||||
```
|
||||
|
||||
## Licenses
|
||||
This repository contains two different licenses for different parts of the Fluxscape platform.
|
||||
This repository contains two different licenses for different parts of the Noodl platform.
|
||||
|
||||
- Components related to the editor, used to edit Fluxscape projects, are under GPLv3
|
||||
- Components related to the end applications, used by the applications Fluxscape deploys, are under MIT
|
||||
- Components related to the editor, used to edit Noodl projects, are under GPLv3
|
||||
- Components related to the end applications, used by the applications Noodl deploys, are under MIT
|
||||
|
||||
All of the source code of applications created with Fluxscape are under MIT. This means you can do project specific changes to the runtime without having to redistribute your changes.
|
||||
All of the source code of applications created with Noodl are under MIT. This means you can do project specific changes to the runtime without having to redistribute your changes.
|
||||
|
||||
Packaged licensed under MIT:
|
||||
- `noodl-runtime`
|
||||
|
||||
347
package-lock.json
generated
@@ -2849,9 +2849,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@electron/remote": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@electron/remote/-/remote-2.1.2.tgz",
|
||||
"integrity": "sha512-EPwNx+nhdrTBxyCqXt/pftoQg/ybtWDW3DUWHafejvnB1ZGGfMpv6e15D8KeempocjXe78T7WreyGGb3mlZxdA==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@electron/remote/-/remote-2.1.1.tgz",
|
||||
"integrity": "sha512-Lfxul2yBxL+FBVaKszNAkuUqSIDbUQ1I7BC394iRXyqA2XGz7im2bAxroNIM51jhySSPKUaOLHaFLxfV6pC9VQ==",
|
||||
"peerDependencies": {
|
||||
"electron": ">= 13.0.0"
|
||||
}
|
||||
@@ -25220,13 +25220,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/electron": {
|
||||
"version": "31.3.1",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-31.3.1.tgz",
|
||||
"integrity": "sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==",
|
||||
"version": "28.1.4",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-28.1.4.tgz",
|
||||
"integrity": "sha512-WE6go611KOhtH6efRPMnVC7FE7DCKnQ3ZyHFeI1DbaCy8OU4UjZ8/CZGcuZmZgRdxSBEHoHdgaJkWRHZzF0FOg==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@electron/get": "^2.0.0",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/node": "^18.11.18",
|
||||
"extract-zip": "^2.0.1"
|
||||
},
|
||||
"bin": {
|
||||
@@ -25452,14 +25452,6 @@
|
||||
"tiny-typed-emitter": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron/node_modules/@types/node": {
|
||||
"version": "20.14.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz",
|
||||
"integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==",
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
},
|
||||
"node_modules/elliptic": {
|
||||
"version": "6.5.4",
|
||||
"dev": true,
|
||||
@@ -27211,10 +27203,6 @@
|
||||
"react": "^15.0.2 || ^16.0.0 || ^17.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fluxscape-editor": {
|
||||
"resolved": "packages/noodl-editor",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/focus-lock": {
|
||||
"version": "0.8.1",
|
||||
"dev": true,
|
||||
@@ -35455,6 +35443,10 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/noodl-editor": {
|
||||
"resolved": "packages/noodl-editor",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/nopt": {
|
||||
"version": "1.0.10",
|
||||
"license": "MIT",
|
||||
@@ -43199,11 +43191,6 @@
|
||||
"version": "1.13.6",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "5.26.5",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
||||
},
|
||||
"node_modules/unfetch": {
|
||||
"version": "4.2.0",
|
||||
"dev": true,
|
||||
@@ -48980,10 +48967,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"packages/noodl-editor": {
|
||||
"name": "fluxscape-editor",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@electron/remote": "^2.1.1",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@noodl/git": "file:../noodl-git",
|
||||
@@ -49039,7 +49025,7 @@
|
||||
"babel-loader": "^8.2.4",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"electron": "31.3.1",
|
||||
"electron": "28.1.4",
|
||||
"electron-builder": "^24.9.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^3.1.0",
|
||||
@@ -53389,9 +53375,9 @@
|
||||
}
|
||||
},
|
||||
"@electron/remote": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@electron/remote/-/remote-2.1.2.tgz",
|
||||
"integrity": "sha512-EPwNx+nhdrTBxyCqXt/pftoQg/ybtWDW3DUWHafejvnB1ZGGfMpv6e15D8KeempocjXe78T7WreyGGb3mlZxdA==",
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@electron/remote/-/remote-2.1.1.tgz",
|
||||
"integrity": "sha512-Lfxul2yBxL+FBVaKszNAkuUqSIDbUQ1I7BC394iRXyqA2XGz7im2bAxroNIM51jhySSPKUaOLHaFLxfV6pC9VQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"@electron/universal": {
|
||||
@@ -74071,23 +74057,13 @@
|
||||
}
|
||||
},
|
||||
"electron": {
|
||||
"version": "31.3.1",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-31.3.1.tgz",
|
||||
"integrity": "sha512-9fiuWlRhBfygtcT+auRd/WdBK/f8LZZcrpx0RjpXhH2DPTP/PfnkC4JB1PW55qCbGbh4wAgkYbf4ExIag8oGCA==",
|
||||
"version": "28.1.4",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-28.1.4.tgz",
|
||||
"integrity": "sha512-WE6go611KOhtH6efRPMnVC7FE7DCKnQ3ZyHFeI1DbaCy8OU4UjZ8/CZGcuZmZgRdxSBEHoHdgaJkWRHZzF0FOg==",
|
||||
"requires": {
|
||||
"@electron/get": "^2.0.0",
|
||||
"@types/node": "^20.9.0",
|
||||
"@types/node": "^18.11.18",
|
||||
"extract-zip": "^2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "20.14.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz",
|
||||
"integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==",
|
||||
"requires": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"electron-builder": {
|
||||
@@ -75432,144 +75408,6 @@
|
||||
"fbjs": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"fluxscape-editor": {
|
||||
"version": "file:packages/noodl-editor",
|
||||
"requires": {
|
||||
"@babel/core": "^7.19.1",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@noodl/git": "file:../noodl-git",
|
||||
"@noodl/noodl-parse-dashboard": "file:../noodl-parse-dashboard",
|
||||
"@noodl/platform": "file:../noodl-platform",
|
||||
"@noodl/platform-electron": "file:../noodl-platform-electron",
|
||||
"@svgr/webpack": "^6.4.0",
|
||||
"@types/checksum": "^0.1.33",
|
||||
"@types/jasmine": "^4.3.0",
|
||||
"@types/jquery": "^3.5.14",
|
||||
"@types/react": "^17.0.50",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@types/remarkable": "^2.0.3",
|
||||
"@types/rimraf": "^3.0.2",
|
||||
"@types/split2": "^3.2.1",
|
||||
"@types/string.prototype.matchall": "^4.0.1",
|
||||
"@types/underscore": "^1.11.4",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"about-window": "^1.15.2",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"archiver": "^5.3.0",
|
||||
"async": "^3.2.4",
|
||||
"babel-loader": "^8.2.4",
|
||||
"classnames": "^2.3.2",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"diff3": "0.0.4",
|
||||
"dmg-license": "^1.0.11",
|
||||
"electron": "31.3.1",
|
||||
"electron-builder": "^24.9.1",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^6.1.7",
|
||||
"express": "^4.17.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"highlight.js": "^11.5.1",
|
||||
"html-loader": "^3.1.0",
|
||||
"isbinaryfile": "^5.0.0",
|
||||
"md5": "^2.3.0",
|
||||
"md5-file": "^5.0.0",
|
||||
"mixpanel-browser": "^2.45.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"mkdirp-sync": "0.0.2",
|
||||
"monaco-editor": "^0.34.0",
|
||||
"monaco-editor-webpack-plugin": "^7.0.1",
|
||||
"ncp": "^2.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-instantsearch-hooks-web": "^6.38.0",
|
||||
"react-json-view": "^1.21.3",
|
||||
"react-rnd": "^10.3.7",
|
||||
"remarkable": "^2.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"s3": "git+https://github.com/noodlapp/node-s3-client.git",
|
||||
"sass": "^1.55.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"string.prototype.matchall": "^4.0.7",
|
||||
"stringify": "^5.2.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"ts-loader": "^9.4.1",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.8.3",
|
||||
"underscore": "^1.13.6",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1",
|
||||
"webpack-merge": "^5.8.0",
|
||||
"websocket-stream": "^5.5.2",
|
||||
"ws": "^8.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@webpack-cli/configtest": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
|
||||
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"@webpack-cli/info": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz",
|
||||
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"envinfo": "^7.7.3"
|
||||
}
|
||||
},
|
||||
"@webpack-cli/serve": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
|
||||
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true
|
||||
},
|
||||
"rechoir": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
|
||||
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"resolve": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
"version": "4.10.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz",
|
||||
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@discoveryjs/json-ext": "^0.5.0",
|
||||
"@webpack-cli/configtest": "^1.2.0",
|
||||
"@webpack-cli/info": "^1.5.0",
|
||||
"@webpack-cli/serve": "^1.7.0",
|
||||
"colorette": "^2.0.14",
|
||||
"commander": "^7.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fastest-levenshtein": "^1.0.12",
|
||||
"import-local": "^3.0.2",
|
||||
"interpret": "^2.2.0",
|
||||
"rechoir": "^0.7.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"focus-lock": {
|
||||
"version": "0.8.1",
|
||||
"dev": true,
|
||||
@@ -81145,6 +80983,144 @@
|
||||
"version": "2.0.10",
|
||||
"dev": true
|
||||
},
|
||||
"noodl-editor": {
|
||||
"version": "file:packages/noodl-editor",
|
||||
"requires": {
|
||||
"@babel/core": "^7.19.1",
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@electron/remote": "^2.1.1",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@noodl/git": "file:../noodl-git",
|
||||
"@noodl/noodl-parse-dashboard": "file:../noodl-parse-dashboard",
|
||||
"@noodl/platform": "file:../noodl-platform",
|
||||
"@noodl/platform-electron": "file:../noodl-platform-electron",
|
||||
"@svgr/webpack": "^6.4.0",
|
||||
"@types/checksum": "^0.1.33",
|
||||
"@types/jasmine": "^4.3.0",
|
||||
"@types/jquery": "^3.5.14",
|
||||
"@types/react": "^17.0.50",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"@types/remarkable": "^2.0.3",
|
||||
"@types/rimraf": "^3.0.2",
|
||||
"@types/split2": "^3.2.1",
|
||||
"@types/string.prototype.matchall": "^4.0.1",
|
||||
"@types/underscore": "^1.11.4",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"about-window": "^1.15.2",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"archiver": "^5.3.0",
|
||||
"async": "^3.2.4",
|
||||
"babel-loader": "^8.2.4",
|
||||
"classnames": "^2.3.2",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"diff3": "0.0.4",
|
||||
"dmg-license": "^1.0.11",
|
||||
"electron": "28.1.4",
|
||||
"electron-builder": "^24.9.1",
|
||||
"electron-store": "^8.1.0",
|
||||
"electron-updater": "^6.1.7",
|
||||
"express": "^4.17.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"highlight.js": "^11.5.1",
|
||||
"html-loader": "^3.1.0",
|
||||
"isbinaryfile": "^5.0.0",
|
||||
"md5": "^2.3.0",
|
||||
"md5-file": "^5.0.0",
|
||||
"mixpanel-browser": "^2.45.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"mkdirp-sync": "0.0.2",
|
||||
"monaco-editor": "^0.34.0",
|
||||
"monaco-editor-webpack-plugin": "^7.0.1",
|
||||
"ncp": "^2.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.0",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-instantsearch-hooks-web": "^6.38.0",
|
||||
"react-json-view": "^1.21.3",
|
||||
"react-rnd": "^10.3.7",
|
||||
"remarkable": "^2.0.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"s3": "git+https://github.com/noodlapp/node-s3-client.git",
|
||||
"sass": "^1.55.0",
|
||||
"sass-loader": "^12.6.0",
|
||||
"string.prototype.matchall": "^4.0.7",
|
||||
"stringify": "^5.2.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"ts-loader": "^9.4.1",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.8.3",
|
||||
"underscore": "^1.13.6",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1",
|
||||
"webpack-merge": "^5.8.0",
|
||||
"websocket-stream": "^5.5.2",
|
||||
"ws": "^8.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@webpack-cli/configtest": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz",
|
||||
"integrity": "sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"@webpack-cli/info": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz",
|
||||
"integrity": "sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"envinfo": "^7.7.3"
|
||||
}
|
||||
},
|
||||
"@webpack-cli/serve": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz",
|
||||
"integrity": "sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==",
|
||||
"dev": true,
|
||||
"requires": {}
|
||||
},
|
||||
"commander": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||
"dev": true
|
||||
},
|
||||
"rechoir": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
|
||||
"integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"resolve": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
"version": "4.10.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz",
|
||||
"integrity": "sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@discoveryjs/json-ext": "^0.5.0",
|
||||
"@webpack-cli/configtest": "^1.2.0",
|
||||
"@webpack-cli/info": "^1.5.0",
|
||||
"@webpack-cli/serve": "^1.7.0",
|
||||
"colorette": "^2.0.14",
|
||||
"commander": "^7.0.0",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"fastest-levenshtein": "^1.0.12",
|
||||
"import-local": "^3.0.2",
|
||||
"interpret": "^2.2.0",
|
||||
"rechoir": "^0.7.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
"version": "1.0.10",
|
||||
"requires": {
|
||||
@@ -86427,11 +86403,6 @@
|
||||
"underscore": {
|
||||
"version": "1.13.6"
|
||||
},
|
||||
"undici-types": {
|
||||
"version": "5.26.5",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
||||
},
|
||||
"unfetch": {
|
||||
"version": "4.2.0",
|
||||
"dev": true
|
||||
|
||||
10
package.json
@@ -2,8 +2,8 @@
|
||||
"private": true,
|
||||
"name": "@noodl/repo",
|
||||
"description": "Low-code for when experience matter",
|
||||
"author": "Fluxscape <contact@fluxcsape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net",
|
||||
"version": "1.0.0",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
@@ -12,7 +12,7 @@
|
||||
"graph": "npx nx graph",
|
||||
"ci:prepare:editor": "ts-node ./scripts/ci-editor-prepare.ts",
|
||||
"ci:build:viewer": "lerna exec --scope @noodl/noodl-viewer-react -- npm run build",
|
||||
"ci:build:editor": "lerna exec --scope fluxscape-editor -- npm run ci:build",
|
||||
"ci:build:editor": "lerna exec --scope noodl-editor -- npm run ci:build",
|
||||
"build:editor": "ts-node ./scripts/build-editor.ts",
|
||||
"build:editor:_viewer": "ts-node ./scripts/noodl-editor/build-viewer.ts",
|
||||
"build:editor:_editor": "ts-node ./scripts/noodl-editor/build-editor.ts",
|
||||
@@ -20,7 +20,7 @@
|
||||
"build:cloud-runtime": "lerna run build --scope @noodl/cloud-runtime --stream && lerna run build:pack --scope @noodl/cloud-runtime --stream",
|
||||
"start:storybook": "lerna exec --scope @noodl/noodl-core-ui -- npm run start",
|
||||
"start:viewer": "lerna run start --scope @noodl/noodl-viewer-react --stream",
|
||||
"start:editor": "lerna run start --scope fluxscape-editor --stream",
|
||||
"start:editor": "lerna run start --scope noodl-editor --stream",
|
||||
"dev": "ts-node ./scripts/start.ts",
|
||||
"start": "ts-node ./scripts/start.ts -- --build-viewer",
|
||||
"test:editor": "ts-node ./scripts/test-editor.ts",
|
||||
@@ -47,4 +47,4 @@
|
||||
"npm": ">=6.0.0",
|
||||
"node": ">=16.0.0 <=18"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,128 +1,123 @@
|
||||
.Root {
|
||||
border: none;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
&.is-hidden {
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&.has-backdrop {
|
||||
background-color: var(--theme-color-bg-1-transparent);
|
||||
}
|
||||
|
||||
&.is-locking-scroll {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&:not(.has-backdrop):not(.is-locking-scroll) {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.VisibleDialog {
|
||||
filter: drop-shadow(0 4px 15px var(--theme-color-bg-1-transparent-2));
|
||||
box-shadow: 0 0 10px -5px var(--theme-color-bg-1-transparent-2);
|
||||
position: absolute;
|
||||
width: var(--width);
|
||||
pointer-events: all;
|
||||
|
||||
.Root.is-centered & {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
animation: enter-centered var(--speed-quick) var(--easing-base) both;
|
||||
}
|
||||
|
||||
.Root:not(.is-centered) &.is-visible {
|
||||
&.is-variant-default {
|
||||
animation: enter var(--speed-quick) var(--easing-base) both;
|
||||
}
|
||||
|
||||
&.is-variant-select {
|
||||
transform: translate(var(--offsetX), var(--offsetY));
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: var(--background);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.Arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: var(--arrow-top);
|
||||
left: var(--arrow-left);
|
||||
pointer-events: none;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
transform: translate(-50%, -50%) rotate(45deg);
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
&.is-contrast::after {
|
||||
background: var(--backgroundContrast);
|
||||
}
|
||||
}
|
||||
|
||||
.Title {
|
||||
background-color: var(--backgroundContrast);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.MeasuringContainer {
|
||||
pointer-events: none;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ChildContainer {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@keyframes enter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(
|
||||
calc(var(--animationStartOffsetX) + var(--offsetX)),
|
||||
calc(var(--animationStartOffsetY) + var(--offsetY))
|
||||
);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(var(--offsetX), var(--offsetY));
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes enter-centered {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, calc(-50% + 16px));
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
.Root {
|
||||
border: none;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
&.has-backdrop {
|
||||
background-color: var(--theme-color-bg-1-transparent);
|
||||
}
|
||||
|
||||
&.is-locking-scroll {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
&:not(.has-backdrop):not(.is-locking-scroll) {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.VisibleDialog {
|
||||
filter: drop-shadow(0 4px 15px var(--theme-color-bg-1-transparent-2));
|
||||
box-shadow: 0 0 10px -5px var(--theme-color-bg-1-transparent-2);
|
||||
position: absolute;
|
||||
width: var(--width);
|
||||
pointer-events: all;
|
||||
|
||||
.Root.is-centered & {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
animation: enter-centered var(--speed-quick) var(--easing-base) both;
|
||||
}
|
||||
|
||||
.Root:not(.is-centered) &.is-visible {
|
||||
&.is-variant-default {
|
||||
animation: enter var(--speed-quick) var(--easing-base) both;
|
||||
}
|
||||
|
||||
&.is-variant-select {
|
||||
transform: translate(var(--offsetX), var(--offsetY));
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: var(--background);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.Arrow {
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: var(--arrow-top);
|
||||
left: var(--arrow-left);
|
||||
pointer-events: none;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
transform: translate(-50%, -50%) rotate(45deg);
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
&.is-contrast::after {
|
||||
background: var(--backgroundContrast);
|
||||
}
|
||||
}
|
||||
|
||||
.Title {
|
||||
background-color: var(--backgroundContrast);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.MeasuringContainer {
|
||||
pointer-events: none;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.ChildContainer {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@keyframes enter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(
|
||||
calc(var(--animationStartOffsetX) + var(--offsetX)),
|
||||
calc(var(--animationStartOffsetY) + var(--offsetY))
|
||||
);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(var(--offsetX), var(--offsetY));
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes enter-centered {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, calc(-50% + 16px));
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ export interface BaseDialogProps extends UnsafeStyleProps {
|
||||
isVisible?: boolean;
|
||||
hasBackdrop?: boolean;
|
||||
hasArrow?: boolean;
|
||||
alwaysMounted?: boolean;
|
||||
|
||||
children?: Slot;
|
||||
|
||||
@@ -70,7 +69,6 @@ export function CoreBaseDialog({
|
||||
isVisible,
|
||||
hasBackdrop,
|
||||
hasArrow,
|
||||
alwaysMounted,
|
||||
|
||||
children,
|
||||
|
||||
@@ -263,7 +261,7 @@ export function CoreBaseDialog({
|
||||
}
|
||||
}, [background]);
|
||||
|
||||
if (!isVisible && !alwaysMounted) return null;
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -272,7 +270,6 @@ export function CoreBaseDialog({
|
||||
hasBackdrop && css['has-backdrop'],
|
||||
isLockingScroll && css['is-locking-scroll'],
|
||||
typeof triggerRef === 'undefined' && css['is-centered'],
|
||||
!isVisible && css['is-hidden'],
|
||||
css[variant]
|
||||
)}
|
||||
onClick={onClose}
|
||||
|
||||
@@ -11,7 +11,7 @@ import css from './Tooltip.module.scss';
|
||||
|
||||
export interface TooltipProps extends UnsafeStyleProps {
|
||||
content: SingleSlot;
|
||||
fineType?: string | string[];
|
||||
fineType?: string;
|
||||
children: Slot;
|
||||
showAfterMs?: number;
|
||||
|
||||
@@ -79,17 +79,9 @@ export function Tooltip({
|
||||
|
||||
{fineType && (
|
||||
<div className={css['FineType']}>
|
||||
{Array.isArray(fineType) ? (
|
||||
fineType.map((x) => (
|
||||
<Label size={LabelSize.Small} variant={TextType.Secondary}>
|
||||
{x}
|
||||
</Label>
|
||||
))
|
||||
) : (
|
||||
<Label size={LabelSize.Small} variant={TextType.Secondary}>
|
||||
{fineType}
|
||||
</Label>
|
||||
)}
|
||||
<Label size={LabelSize.Small} variant={TextType.Secondary}>
|
||||
{fineType}
|
||||
</Label>
|
||||
</div>
|
||||
)}
|
||||
</BaseDialog>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "fluxscape-editor",
|
||||
"name": "noodl-editor",
|
||||
"productName": "Fluxscape",
|
||||
"description": "Node-Based App Builder for Scalability & Rapid Development, a fork of Noodl",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"version": "1.1.0",
|
||||
"version": "1.0.0",
|
||||
"main": "src/main/main.js",
|
||||
"scripts": {
|
||||
"build": "npx ts-node -P ./tsconfig.build.json ./scripts/build.ts",
|
||||
@@ -58,7 +58,7 @@
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@electron/remote": "^2.1.1",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@microsoft/fetch-event-source": "^2.0.1",
|
||||
"@noodl/git": "file:../noodl-git",
|
||||
@@ -114,7 +114,7 @@
|
||||
"babel-loader": "^8.2.4",
|
||||
"concurrently": "^7.4.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"electron": "31.3.1",
|
||||
"electron": "28.1.4",
|
||||
"electron-builder": "^24.9.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^3.1.0",
|
||||
@@ -141,4 +141,4 @@
|
||||
"optionalDependencies": {
|
||||
"dmg-license": "^1.0.11"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
packages/noodl-editor/src/assets/images/getting-started-docs.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 94 KiB |
BIN
packages/noodl-editor/src/assets/images/ic_back.png
Normal file
|
After Width: | Height: | Size: 884 B |
BIN
packages/noodl-editor/src/assets/images/ic_logo.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
packages/noodl-editor/src/assets/images/import-icon.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3zm-9-3.82l-2.09-2.09L6.5 13.5 10 17l6.01-6.01-1.41-1.41z"/></svg>
|
||||
|
After Width: | Height: | Size: 526 B |
BIN
packages/noodl-editor/src/assets/images/personal.png
Normal file
|
After Width: | Height: | Size: 540 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 175 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none"><path d="M0 0h24v24H0V0z"/><path opacity=".87" d="M0 0h24v24H0V0z"/></g><path d="M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2zM11 16l4-4-4-4v3H1v2h10v3zM23 3.01H1V9h2V4.99h18v14.03H3V15H1v5.99h22V3.01zM11 16l4-4-4-4v3H1v2h10v3z"/></svg>
|
||||
|
After Width: | Height: | Size: 408 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M4 6H2v16h16v-2H4V6zm18-4H6v16h16V2zm-3 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 220 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><g fill="none"><path d="M0 0h24v24H0V0z"/><path opacity=".87" d="M0 0h24v24H0V0z"/></g><path d="M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z"/></svg>
|
||||
|
After Width: | Height: | Size: 360 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19.44 12.99l-.01.02c.04-.33.08-.67.08-1.01 0-.34-.03-.66-.07-.99l.01.02 2.44-1.92-2.43-4.22-2.87 1.16.01.01c-.52-.4-1.09-.74-1.71-1h.01L14.44 2H9.57l-.44 3.07h.01c-.62.26-1.19.6-1.71 1l.01-.01-2.88-1.17-2.44 4.22 2.44 1.92.01-.02c-.04.33-.07.65-.07.99 0 .34.03.68.08 1.01l-.01-.02-2.1 1.65-.33.26 2.43 4.2 2.88-1.15-.02-.04c.53.41 1.1.75 1.73 1.01h-.03L9.58 22h4.85s.03-.18.06-.42l.38-2.65h-.01c.62-.26 1.2-.6 1.73-1.01l-.02.04 2.88 1.15 2.43-4.2s-.14-.12-.33-.26l-2.11-1.66zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/></svg>
|
||||
|
After Width: | Height: | Size: 701 B |
BIN
packages/noodl-editor/src/assets/images/start.png
Normal file
|
After Width: | Height: | Size: 522 KiB |
BIN
packages/noodl-editor/src/assets/images/workspace.png
Normal file
|
After Width: | Height: | Size: 522 KiB |
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Fluxscape</title>
|
||||
<title>Noodl</title>
|
||||
<link href="../assets/lib/fontawesome/css/font-awesome.min.css" rel="stylesheet" />
|
||||
<link href="../assets/css/style.css" rel="stylesheet" />
|
||||
|
||||
|
||||
@@ -2,11 +2,6 @@ import { Keybinding } from '@noodl-utils/keyboard/Keybinding';
|
||||
import { KeyCode, KeyMod } from '@noodl-utils/keyboard/KeyCode';
|
||||
|
||||
export namespace Keybindings {
|
||||
export const SEARCH = new Keybinding(KeyMod.CtrlCmd, KeyCode.KEY_F);
|
||||
|
||||
export const CLOUD_SERVICE_OPEN_DASHBOARD = new Keybinding(KeyMod.CtrlCmd, KeyMod.Shift, KeyCode.KEY_P);
|
||||
export const CLOUD_SERVICE_OPEN_DASHBOARD_BROWSER = new Keybinding(KeyMod.CtrlCmd, KeyCode.KEY_P);
|
||||
|
||||
export const REFRESH_PREVIEW = new Keybinding(KeyMod.CtrlCmd, KeyCode.KEY_R);
|
||||
export const OPEN_DEVTOOLS = new Keybinding(KeyMod.CtrlCmd, KeyCode.KEY_D);
|
||||
export const OPEN_CLOUD_DEVTOOLS = new Keybinding(KeyMod.CtrlCmd, KeyMod.Shift, KeyCode.KEY_R);
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
import React, { createContext, useContext, useState, useEffect } from 'react';
|
||||
|
||||
import { type ComponentModel } from '@noodl-models/componentmodel';
|
||||
import { type NodeGraphNode } from '@noodl-models/nodegraphmodel';
|
||||
import { type NodeLibraryNodeType } from '@noodl-models/nodelibrary';
|
||||
import { type Slot } from '@noodl-core-ui/types/global';
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
import { EventDispatcher } from '../../../../shared/utils/EventDispatcher';
|
||||
|
||||
export type NodeReference = {
|
||||
type: NodeLibraryNodeType | undefined;
|
||||
displayName: string;
|
||||
referenaces: {
|
||||
displayName: string;
|
||||
node?: NodeGraphNode;
|
||||
component: ComponentModel;
|
||||
}[];
|
||||
};
|
||||
|
||||
export interface NodeReferencesContext {
|
||||
nodeReferences: NodeReference[];
|
||||
}
|
||||
|
||||
const NodeReferencesContext = createContext<NodeReferencesContext>({
|
||||
nodeReferences: [],
|
||||
});
|
||||
|
||||
// Since all the editor code is not written in React we need a way to be able to
|
||||
// access this information outside of React too.
|
||||
let HACK_nodeReferences: NodeReference[] = [];
|
||||
export function HACK_findNodeReference(componentName: string): NodeReference | undefined {
|
||||
return HACK_nodeReferences.find(x => x.type?.fullName === componentName);
|
||||
}
|
||||
|
||||
|
||||
export interface NodeReferencesContextProps {
|
||||
children: Slot;
|
||||
}
|
||||
|
||||
export function NodeReferencesContextProvider({ children }: NodeReferencesContextProps) {
|
||||
const [group] = useState({});
|
||||
const [nodeReferences, setNodeReferences] = useState<NodeReference[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
function updateIndex() {
|
||||
const types: { [key: string]: NodeReference['type'] } = {};
|
||||
const references = new Map<string, NodeReference['referenaces']>();
|
||||
|
||||
function handleComponent(component: ComponentModel) {
|
||||
component.forEachNode((node: NodeGraphNode) => {
|
||||
const name = node.type.name;
|
||||
|
||||
// Add the reference
|
||||
references.set(name, [
|
||||
...(references.get(name) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
// Repeater
|
||||
if (name === 'For Each' && node.parameters.template) {
|
||||
const templateComponent = ProjectModel.instance.getComponentWithName(node.parameters.template);
|
||||
|
||||
if (templateComponent) {
|
||||
references.set(templateComponent.fullName, [
|
||||
...(references.get(templateComponent.fullName) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
handleComponent(templateComponent);
|
||||
}
|
||||
}
|
||||
|
||||
// Add some metadata for this node if we dont have it yet.
|
||||
if (!types[name]) {
|
||||
types[name] = node.type;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Loop all the nodes in the project
|
||||
ProjectModel.instance.forEachComponent(handleComponent);
|
||||
|
||||
// Combine the result to look a little better.
|
||||
const results: NodeReference[] = Array.from(references.keys())
|
||||
.map((key) => ({
|
||||
type: types[key],
|
||||
displayName: types[key]?.displayName || key,
|
||||
referenaces: references.get(key)
|
||||
}))
|
||||
.sort((a, b) => b.referenaces.length - a.referenaces.length);
|
||||
|
||||
HACK_nodeReferences = results;
|
||||
setNodeReferences(results);
|
||||
}
|
||||
|
||||
updateIndex();
|
||||
|
||||
EventDispatcher.instance.on(
|
||||
[
|
||||
'Model.nodeAdded',
|
||||
'Model.nodeRemoved',
|
||||
'Model.componentAdded',
|
||||
'Model.componentRemoved',
|
||||
'Model.componentRenamed'
|
||||
],
|
||||
updateIndex,
|
||||
group
|
||||
);
|
||||
|
||||
return function () {
|
||||
EventDispatcher.instance.off(group);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<NodeReferencesContext.Provider
|
||||
value={{
|
||||
nodeReferences,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</NodeReferencesContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useNodeReferencesContext() {
|
||||
const context = useContext(NodeReferencesContext);
|
||||
|
||||
if (context === undefined) {
|
||||
throw new Error('useNodeReferencesContext must be a child of NodeReferencesContextProvider');
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export * from './NodeReferencesContext';
|
||||
@@ -57,13 +57,10 @@ export class CloudFunctionAdapter extends NodeTypeAdapter {
|
||||
|
||||
// Collect all cloud function components
|
||||
const functionRequestNodes = ProjectModel.instance.getNodesWithType('noodl.cloud.request');
|
||||
const functions = functionRequestNodes
|
||||
.map((r) => {
|
||||
const component = r.owner.owner;
|
||||
return component.fullName;
|
||||
})
|
||||
// Remove all the Cloud Trigger functions
|
||||
.filter((x) => !x.startsWith('/#__cloud__/__noodl_cloud_triggers__'));
|
||||
const functions = functionRequestNodes.map((r) => {
|
||||
const component = r.owner.owner;
|
||||
return component.fullName;
|
||||
});
|
||||
|
||||
ports.push({
|
||||
plug: 'input',
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { NodeGraphContextProvider } from '@noodl-contexts/NodeGraphContext/NodeGraphContext';
|
||||
import { NodeReferencesContextProvider } from '@noodl-contexts/NodeReferencesContext';
|
||||
import { PluginContextProvider } from '@noodl-contexts/PluginContext';
|
||||
import { ProjectDesignTokenContextProvider } from '@noodl-contexts/ProjectDesignTokenContext';
|
||||
import { useKeyboardCommands } from '@noodl-hooks/useKeyboardCommands';
|
||||
import { useModel } from '@noodl-hooks/useModel';
|
||||
@@ -45,6 +43,7 @@ import { BaseWindow } from '../../views/windows/BaseWindow';
|
||||
import { whatsnewRender } from '../../whats-new';
|
||||
import { IRouteProps } from '../AppRoute';
|
||||
import { useSetupSettings } from './useSetupSettings';
|
||||
import { PluginContextProvider } from '@noodl-contexts/PluginContext';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const ImportOverwritePopupTemplate = require('../../templates/importoverwritepopup.html');
|
||||
@@ -224,30 +223,28 @@ export function EditorPage({ route }: EditorPageProps) {
|
||||
|
||||
return (
|
||||
<NodeGraphContextProvider>
|
||||
<NodeReferencesContextProvider>
|
||||
<ProjectDesignTokenContextProvider>
|
||||
<PluginContextProvider>
|
||||
<BaseWindow>
|
||||
{isLoading ? (
|
||||
<ActivityIndicator />
|
||||
) : (
|
||||
<>
|
||||
<FrameDivider
|
||||
first={<SidePanel />}
|
||||
second={<ErrorBoundary>{Boolean(Document) && <Document />}</ErrorBoundary>}
|
||||
sizeMin={200}
|
||||
size={frameDividerSize}
|
||||
horizontal
|
||||
onSizeChanged={setFrameDividerSize}
|
||||
/>
|
||||
<ProjectDesignTokenContextProvider>
|
||||
<PluginContextProvider>
|
||||
<BaseWindow>
|
||||
{isLoading ? (
|
||||
<ActivityIndicator />
|
||||
) : (
|
||||
<>
|
||||
<FrameDivider
|
||||
first={<SidePanel />}
|
||||
second={<ErrorBoundary>{Boolean(Document) && <Document />}</ErrorBoundary>}
|
||||
sizeMin={200}
|
||||
size={frameDividerSize}
|
||||
horizontal
|
||||
onSizeChanged={setFrameDividerSize}
|
||||
/>
|
||||
|
||||
{Boolean(lesson) && <Frame instance={lesson} isContentSize isFitWidth />}
|
||||
</>
|
||||
)}
|
||||
</BaseWindow>
|
||||
</PluginContextProvider>
|
||||
</ProjectDesignTokenContextProvider>
|
||||
</NodeReferencesContextProvider>
|
||||
{Boolean(lesson) && <Frame instance={lesson} isContentSize isFitWidth />}
|
||||
</>
|
||||
)}
|
||||
</BaseWindow>
|
||||
</PluginContextProvider>
|
||||
</ProjectDesignTokenContextProvider>
|
||||
</NodeGraphContextProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AppRegistry } from '@noodl-models/app_registry';
|
||||
import { SidebarModel } from '@noodl-models/sidebar';
|
||||
import { Keybindings } from '@noodl-constants/Keybindings';
|
||||
import { Keybinding } from '@noodl-utils/keyboard/Keybinding';
|
||||
import { KeyCode, KeyMod } from '@noodl-utils/keyboard/KeyCode';
|
||||
|
||||
import { IconName } from '@noodl-core-ui/components/common/Icon';
|
||||
|
||||
@@ -68,7 +69,7 @@ export function installSidePanel({ isLesson }: SetupEditorOptions) {
|
||||
SidebarModel.instance.register({
|
||||
id: 'search',
|
||||
name: 'Search',
|
||||
fineType: Keybindings.SEARCH.label,
|
||||
fineType: new Keybinding(KeyMod.CtrlCmd, KeyCode.KEY_F).label,
|
||||
order: 2,
|
||||
icon: IconName.Search,
|
||||
panel: SearchPanel
|
||||
|
||||
@@ -16,7 +16,6 @@ import { projectFromDirectory, unzipIntoDirectory } from '../models/projectmodel
|
||||
import FileSystem from './filesystem';
|
||||
import { tracker } from './tracker';
|
||||
import { guid } from './utils';
|
||||
import { getTopLevelWorkingDirectory } from '@noodl/git/src/core/open';
|
||||
|
||||
export interface ProjectItem {
|
||||
id: string;
|
||||
@@ -268,15 +267,12 @@ export class LocalProjectsModel extends Model {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this project is in a git repository.
|
||||
*
|
||||
* @param project
|
||||
* @returns
|
||||
*/
|
||||
async isGitProject(project: ProjectModel): Promise<boolean> {
|
||||
const gitPath = await getTopLevelWorkingDirectory(project._retainedProjectDirectory);
|
||||
return gitPath !== null;
|
||||
isGitProject(project: ProjectModel): boolean {
|
||||
// TODO: check if there's is git in any parent folder too
|
||||
|
||||
// Check if the git folder exists.
|
||||
const gitPath = filesystem.join(project._retainedProjectDirectory, '.git');
|
||||
return filesystem.exists(gitPath);
|
||||
}
|
||||
|
||||
setCurrentGlobalGitAuth(projectId: string) {
|
||||
|
||||
@@ -67,14 +67,6 @@ async function _writeFileToFolder({
|
||||
runtimeType
|
||||
}: WriteFileToFolderArgs) {
|
||||
const fullPath = filesystem.join(getExternalFolderPath(), runtimeType, url);
|
||||
|
||||
if (!filesystem.exists(fullPath)) {
|
||||
// TODO: Save this warning somewhere, usually, this is not an issue though.
|
||||
// This occurred because building in dev mode does not create the source map
|
||||
// files which it expects to copy over.
|
||||
return;
|
||||
}
|
||||
|
||||
let content = await filesystem.readFile(fullPath);
|
||||
let filename = url;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export class HtmlProcessor {
|
||||
baseUrl = baseUrl + '/';
|
||||
}
|
||||
|
||||
const title = parameters.title || settings.htmlTitle || 'Fluxscape Viewer';
|
||||
const title = parameters.title || settings.htmlTitle || 'Noodl Viewer';
|
||||
let headCode = settings.headCode || '';
|
||||
|
||||
if (parameters.headCode) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ITemplateProvider, ProgressCallback, TemplateItem, TemplateListFilter }
|
||||
*/
|
||||
export class NoodlDocsTemplateProvider implements ITemplateProvider {
|
||||
get name(): string {
|
||||
return this.getDocsEndpoint() || 'https://docs.fluxscape.io';
|
||||
return 'https://docs.noodl.net';
|
||||
}
|
||||
|
||||
constructor(private readonly getDocsEndpoint: () => string) {}
|
||||
|
||||
@@ -11,14 +11,6 @@ export interface ArrayDiff<T> {
|
||||
changed: T[];
|
||||
unchanged: T[];
|
||||
}
|
||||
export function createEmptyArrayDiff<T>(): ArrayDiff<T> {
|
||||
return {
|
||||
deleted: [],
|
||||
created: [],
|
||||
changed: [],
|
||||
unchanged: [],
|
||||
}
|
||||
}
|
||||
|
||||
export interface ProjectDiffItem {
|
||||
graph: TSFixme;
|
||||
|
||||
@@ -13,7 +13,6 @@ export default class SchemaHandler {
|
||||
public dbCollections: TSFixme[];
|
||||
public systemCollections: TSFixme[];
|
||||
public configSchema: TSFixme;
|
||||
public parseServerVersion: string;
|
||||
|
||||
constructor() {
|
||||
EventDispatcher.instance.on(
|
||||
@@ -120,20 +119,6 @@ export default class SchemaHandler {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
|
||||
// Get Parse Server Version & Supported features
|
||||
fetch(environment.url + '/serverInfo', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
"_method": "GET",
|
||||
"_ApplicationId": environment.appId,
|
||||
"_MasterKey": environment.masterKey,
|
||||
})
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((json) => {
|
||||
this.parseServerVersion = json.parseServerVersion;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -144,20 +129,10 @@ export default class SchemaHandler {
|
||||
ProjectModel.instance.setMetaData('dbCollections', this.dbCollections);
|
||||
ProjectModel.instance.setMetaData('systemCollections', this.systemCollections);
|
||||
ProjectModel.instance.setMetaData('dbConfigSchema', this.configSchema);
|
||||
|
||||
const versionNumbers = this.parseServerVersion?.split(".")
|
||||
if (versionNumbers && versionNumbers.length > 0) {
|
||||
// Let's only save the major version number,
|
||||
// since this will be used to determine which verison of the API to use.
|
||||
ProjectModel.instance.setMetaData('dbVersionMajor', versionNumbers[0]);
|
||||
} else {
|
||||
ProjectModel.instance.setMetaData('dbVersionMajor', undefined);
|
||||
}
|
||||
} else {
|
||||
ProjectModel.instance.setMetaData('dbCollections', undefined);
|
||||
ProjectModel.instance.setMetaData('systemCollections', undefined);
|
||||
ProjectModel.instance.setMetaData('dbConfigSchema', undefined);
|
||||
ProjectModel.instance.setMetaData('dbVersionMajor', undefined);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { RefObject } from 'react';
|
||||
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
import { usePluginContext } from '@noodl-contexts/PluginContext';
|
||||
import React, { RefObject, useEffect, useRef } from 'react';
|
||||
|
||||
import { ActivityIndicator } from '@noodl-core-ui/components/common/ActivityIndicator';
|
||||
import { BaseDialog } from '@noodl-core-ui/components/layout/BaseDialog';
|
||||
@@ -55,7 +54,6 @@ export function DeployPopup(props: DeployPopupProps) {
|
||||
onClose={props.onClose}
|
||||
hasArrow
|
||||
isLockingScroll
|
||||
alwaysMounted
|
||||
>
|
||||
<DeployPopupChild />
|
||||
</BaseDialog>
|
||||
@@ -64,19 +62,6 @@ export function DeployPopup(props: DeployPopupProps) {
|
||||
}
|
||||
|
||||
function FluxscapeDeployTab() {
|
||||
const params = {};
|
||||
|
||||
const projectId = ProjectModel.instance.id;
|
||||
if (projectId) {
|
||||
params['projectId'] = projectId;
|
||||
}
|
||||
|
||||
const urlParams = new URLSearchParams(params);
|
||||
|
||||
return (
|
||||
<iframe
|
||||
src={`https://portal.fluxscape.io/?${urlParams.toString()}`}
|
||||
style={{ width: '100%', height: '50vh', borderStyle: 'none' }}
|
||||
/>
|
||||
);
|
||||
// Preview URL: 'http://192.168.0.33:8574/'
|
||||
return <iframe src="https://portal.fluxscape.io" style={{ width: "100%", height: "50vh", borderStyle: "none" }} />;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import classNames from 'classnames';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { Keybindings } from '@noodl-constants/Keybindings';
|
||||
import { Environment } from '@noodl-models/CloudServices';
|
||||
import ParseDashboardServer from '@noodl-utils/parsedashboardserver';
|
||||
|
||||
import { Icon, IconName, IconSize } from '@noodl-core-ui/components/common/Icon';
|
||||
import { IconButton, IconButtonState, IconButtonVariant } from '@noodl-core-ui/components/inputs/IconButton';
|
||||
import { PrimaryButton, PrimaryButtonSize, PrimaryButtonVariant } from '@noodl-core-ui/components/inputs/PrimaryButton';
|
||||
import { DialogRenderDirection } from '@noodl-core-ui/components/layout/BaseDialog';
|
||||
import { Collapsible } from '@noodl-core-ui/components/layout/Collapsible';
|
||||
import { Tooltip } from '@noodl-core-ui/components/popups/Tooltip';
|
||||
import { Label, LabelSpacingSize } from '@noodl-core-ui/components/typography/Label';
|
||||
import { Text, TextType } from '@noodl-core-ui/components/typography/Text';
|
||||
|
||||
@@ -121,21 +118,12 @@ export function CloudServiceCard({
|
||||
</div>
|
||||
|
||||
{isEditorEnvironment && (
|
||||
<Tooltip
|
||||
content="Open the Parse Dashboard"
|
||||
fineType={[
|
||||
`In Window: ${Keybindings.CLOUD_SERVICE_OPEN_DASHBOARD.label}`,
|
||||
`In Browser: ${Keybindings.CLOUD_SERVICE_OPEN_DASHBOARD_BROWSER.label}`
|
||||
]}
|
||||
renderDirection={DialogRenderDirection.Below}
|
||||
>
|
||||
<PrimaryButton
|
||||
label="Open dashboard"
|
||||
size={PrimaryButtonSize.Small}
|
||||
onClick={onDashboardClicked}
|
||||
isGrowing
|
||||
/>
|
||||
</Tooltip>
|
||||
<PrimaryButton
|
||||
label="Open dashboard"
|
||||
size={PrimaryButtonSize.Small}
|
||||
onClick={onDashboardClicked}
|
||||
isGrowing
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { NodeGraphContextTmp } from '@noodl-contexts/NodeGraphContext/NodeGraphContext';
|
||||
import { type NodeReference, useNodeReferencesContext } from '@noodl-contexts/NodeReferencesContext';
|
||||
import { useFocusRefOnPanelActive } from '@noodl-hooks/useFocusRefOnPanelActive';
|
||||
import { useNodeLibraryLoaded } from '@noodl-hooks/useNodeLibraryLoaded';
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { INodeColorScheme } from '@noodl-types/nodeTypes';
|
||||
import { NodeLibrary } from '@noodl-models/nodelibrary';
|
||||
import { ComponentModel } from '@noodl-models/componentmodel';
|
||||
import { NodeGraphNode } from '@noodl-models/nodegraphmodel';
|
||||
import { NodeLibrary, NodeLibraryNodeType } from '@noodl-models/nodelibrary';
|
||||
import { BasicNodeType } from '@noodl-models/nodelibrary/BasicNodeType';
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
|
||||
import { EditorNode } from '@noodl-core-ui/components/common/EditorNode';
|
||||
import { IconName, IconSize } from '@noodl-core-ui/components/common/Icon';
|
||||
@@ -24,17 +26,113 @@ import { Section, SectionVariant } from '@noodl-core-ui/components/sidebar/Secti
|
||||
import { Label } from '@noodl-core-ui/components/typography/Label';
|
||||
|
||||
import { NodeReferencesPanel_ID } from '.';
|
||||
import { EventDispatcher } from '../../../../../shared/utils/EventDispatcher';
|
||||
|
||||
type ResultItem = {
|
||||
type: NodeLibraryNodeType;
|
||||
displayName: string;
|
||||
referenaces: {
|
||||
displayName: string;
|
||||
node?: NodeGraphNode;
|
||||
component: ComponentModel;
|
||||
}[];
|
||||
};
|
||||
|
||||
function useNodeReferences() {
|
||||
const [group] = useState({});
|
||||
const [result, setResult] = useState<ResultItem[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
function updateIndex() {
|
||||
const types: { [key: string]: ResultItem['type'] } = {};
|
||||
const references = new Map<string, ResultItem['referenaces']>();
|
||||
|
||||
function handleComponent(component: ComponentModel) {
|
||||
component.forEachNode((node: NodeGraphNode) => {
|
||||
const name = node.type.name;
|
||||
|
||||
// Add the reference
|
||||
references.set(name, [
|
||||
...(references.get(name) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
// Repeater
|
||||
if (name === 'For Each' && node.parameters.template) {
|
||||
const templateComponent = ProjectModel.instance.getComponentWithName(node.parameters.template);
|
||||
|
||||
if (templateComponent) {
|
||||
references.set(templateComponent.fullName, [
|
||||
...(references.get(templateComponent.fullName) || []),
|
||||
{
|
||||
displayName: component.displayName || component.name,
|
||||
node,
|
||||
component
|
||||
}
|
||||
]);
|
||||
|
||||
handleComponent(templateComponent);
|
||||
}
|
||||
}
|
||||
|
||||
// Add some metadata for this node if we dont have it yet.
|
||||
if (!types[name]) {
|
||||
types[name] = node.type;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Loop all the nodes in the project
|
||||
ProjectModel.instance.forEachComponent(handleComponent);
|
||||
|
||||
// Combine the result to look a little better.
|
||||
const results: ResultItem[] = Array.from(references.keys())
|
||||
.map((key) => ({
|
||||
type: types[key],
|
||||
displayName: types[key]?.displayName || key,
|
||||
referenaces: references.get(key)
|
||||
}))
|
||||
.sort((a, b) => b.referenaces.length - a.referenaces.length);
|
||||
|
||||
setResult(results);
|
||||
}
|
||||
|
||||
updateIndex();
|
||||
|
||||
EventDispatcher.instance.on(
|
||||
[
|
||||
'Model.nodeAdded',
|
||||
'Model.nodeRemoved',
|
||||
'Model.componentAdded',
|
||||
'Model.componentRemoved',
|
||||
'Model.componentRenamed'
|
||||
],
|
||||
updateIndex,
|
||||
group
|
||||
);
|
||||
|
||||
return function () {
|
||||
EventDispatcher.instance.off(group);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return [result];
|
||||
}
|
||||
|
||||
export function NodeReferencesPanel() {
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
const [includeCoreNodes, setIncludeCoreNodes] = useState(false);
|
||||
const inputRef = useRef(null);
|
||||
const { nodeReferences } = useNodeReferencesContext();
|
||||
const [result] = useNodeReferences();
|
||||
const nodeLibraryLoaded = useNodeLibraryLoaded();
|
||||
|
||||
useFocusRefOnPanelActive(inputRef, NodeReferencesPanel_ID);
|
||||
|
||||
function searchFilter(x: NodeReference) {
|
||||
function searchFilter(x: ResultItem) {
|
||||
if (x.displayName.toLowerCase().includes(searchTerm)) {
|
||||
return true;
|
||||
}
|
||||
@@ -46,7 +144,7 @@ export function NodeReferencesPanel() {
|
||||
return false;
|
||||
}
|
||||
|
||||
let filteredResult = nodeReferences.filter(searchFilter);
|
||||
let filteredResult = result.filter(searchFilter);
|
||||
if (!includeCoreNodes) {
|
||||
filteredResult = filteredResult.filter((x) => x.displayName.startsWith('/'));
|
||||
}
|
||||
@@ -87,7 +185,7 @@ export function NodeReferencesPanel() {
|
||||
}
|
||||
|
||||
interface ItemProps {
|
||||
entry: NodeReference;
|
||||
entry: ResultItem;
|
||||
}
|
||||
|
||||
function Item({ entry }: ItemProps) {
|
||||
@@ -147,8 +245,8 @@ function Item({ entry }: ItemProps) {
|
||||
}
|
||||
|
||||
interface ItemReferenceProps {
|
||||
entry: NodeReference;
|
||||
referenace: NodeReference['referenaces'][0];
|
||||
entry: ResultItem;
|
||||
referenace: ResultItem['referenaces'][0];
|
||||
colors: INodeColorScheme;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,6 @@ function BaseVersionControlPanel() {
|
||||
|
||||
export function VersionControlPanel() {
|
||||
const [git, setGit] = useState<Git>(null);
|
||||
const [state, setState] = useState<'loading' | 'loaded' | 'not-git'>('loading');
|
||||
|
||||
async function createGit() {
|
||||
const gitClient = new Git(mergeProject);
|
||||
@@ -207,18 +206,12 @@ export function VersionControlPanel() {
|
||||
setGit(gitClient);
|
||||
}
|
||||
|
||||
const isGitProject = git === null ? LocalProjectsModel.instance.isGitProject(ProjectModel.instance) : true;
|
||||
useEffect(() => {
|
||||
LocalProjectsModel.instance
|
||||
.isGitProject(ProjectModel.instance)
|
||||
.then(async (isGitProject) => {
|
||||
if (isGitProject) {
|
||||
await createGit();
|
||||
setState('loaded');
|
||||
} else {
|
||||
setState('not-git');
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
if (isGitProject) {
|
||||
createGit();
|
||||
}
|
||||
}, [isGitProject]);
|
||||
|
||||
async function setupGit() {
|
||||
const gitClient = new Git(mergeProject);
|
||||
@@ -227,7 +220,7 @@ export function VersionControlPanel() {
|
||||
setGit(gitClient);
|
||||
}
|
||||
|
||||
if (git === null && state === 'not-git') {
|
||||
if (git === null && !isGitProject) {
|
||||
return (
|
||||
<BasePanel isFill title="Version Control">
|
||||
<Box hasXSpacing hasYSpacing>
|
||||
|
||||
@@ -6,13 +6,11 @@ import { Commit } from '@noodl/git/src/core/models/snapshot';
|
||||
import { FileChange } from '@noodl/git/src/core/models/status';
|
||||
import { revRange } from '@noodl/git/src/core/rev-list';
|
||||
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
import { applyPatches } from '@noodl-models/ProjectPatches/applypatches';
|
||||
import { mergeProject } from '@noodl-utils/projectmerger';
|
||||
import { ProjectDiff, diffProject } from '@noodl-utils/projectmerger.diff';
|
||||
|
||||
import { useVersionControlContext } from '../context';
|
||||
import { getProjectFilePath } from '../context/DiffUtils';
|
||||
import { DiffList } from './DiffList';
|
||||
|
||||
//Kind:
|
||||
@@ -126,10 +124,7 @@ async function getMergeDiff(repositoryPath: string, commit: Commit, refToDiffTo:
|
||||
}
|
||||
|
||||
async function getProjectFile(commit: Commit) {
|
||||
const projectFilePath = getProjectFilePath(commit.repositoryDir, ProjectModel.instance._retainedProjectDirectory);
|
||||
|
||||
const projectContentRaw = await commit.getFileAsString(projectFilePath);
|
||||
const projectContent = JSON.parse(projectContentRaw);
|
||||
const projectContent = JSON.parse(await commit.getFileAsString('project.json'));
|
||||
applyPatches(projectContent);
|
||||
return projectContent;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ export function DiffList({ diff, fileChanges, componentDiffTitle, actions, commi
|
||||
const [imageDiff, setImageDiff] = useState<IImageDiff>(null);
|
||||
|
||||
const components = diff?.components ? getChangedComponents(diff.components) : [];
|
||||
const files = (fileChanges || [])?.filter((f) => !f.path.endsWith('project.json')) || [];
|
||||
const files = (fileChanges || [])?.filter((f) => f.path !== 'project.json') || [];
|
||||
const settings = diff?.settings ? getChangedObjectProperties(diff.settings) : [];
|
||||
const colorStyles = diff?.styles.colors ? getChangedObjectProperties(diff.styles.colors) : [];
|
||||
const textStyles = diff?.styles.text ? getChangedObjectProperties(diff.styles.text) : [];
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
import path from 'path';
|
||||
import { getCommit } from '@noodl/git/src/core/logs';
|
||||
import { FileStatusKind } from '@noodl/git/src/core/models/status';
|
||||
|
||||
import { FeedbackType } from '@noodl-constants/FeedbackType';
|
||||
import { applyPatches } from '@noodl-models/ProjectPatches/applypatches';
|
||||
import {
|
||||
ProjectDiff,
|
||||
ProjectDiffItem,
|
||||
ProjectBasicDiffItem,
|
||||
ArrayDiff,
|
||||
diffProject,
|
||||
createEmptyArrayDiff
|
||||
diffProject
|
||||
} from '@noodl-utils/projectmerger.diff';
|
||||
|
||||
import { IconName } from '@noodl-core-ui/components/common/Icon';
|
||||
import { ListItemProps } from '@noodl-core-ui/components/layout/ListItem';
|
||||
|
||||
import { ProjectModel } from '../../../../models/projectmodel';
|
||||
|
||||
export interface ProjectLocalDiff extends ProjectDiff {
|
||||
import { applyPatches } from '@noodl-models/ProjectPatches/applypatches';
|
||||
import { FileStatusKind } from '@noodl/git/src/core/models/status';
|
||||
import { IconName } from '@noodl-core-ui/components/common/Icon';
|
||||
import { ListItemProps } from '@noodl-core-ui/components/layout/ListItem';
|
||||
import { FeedbackType } from '@noodl-constants/FeedbackType';
|
||||
import { getCommit } from '@noodl/git/src/core/logs';
|
||||
|
||||
export interface ProjectLocalDiff extends ProjectDiff{
|
||||
baseProject: TSFixme; //Project model as an object from raw json
|
||||
commitShaDiffedTo: string;
|
||||
}
|
||||
@@ -87,49 +84,17 @@ export function getFileStatusIconProps(status: FileStatusKind): Partial<ListItem
|
||||
}
|
||||
}
|
||||
|
||||
export function getProjectFilePath(repositoryPath: string, projectPath: string) {
|
||||
const relativePath = path.relative(repositoryPath, projectPath);
|
||||
const projectFilePath = path.join(relativePath, 'project.json').replaceAll('\\', '/');
|
||||
return projectFilePath;
|
||||
}
|
||||
|
||||
export async function doLocalDiff(
|
||||
repositoryPath: string,
|
||||
projectPath: string,
|
||||
headCommitId: string
|
||||
): Promise<ProjectLocalDiff> {
|
||||
const projectFilePath = getProjectFilePath(repositoryPath, projectPath);
|
||||
|
||||
try {
|
||||
const baseCommit = await getCommit(projectPath, headCommitId);
|
||||
const baseProjectJson = await baseCommit.getFileAsString(projectFilePath);
|
||||
const baseProject = JSON.parse(baseProjectJson);
|
||||
applyPatches(baseProject);
|
||||
|
||||
const diff = diffProject(baseProject, ProjectModel.instance.toJSON());
|
||||
|
||||
return {
|
||||
...diff,
|
||||
baseProject,
|
||||
commitShaDiffedTo: headCommitId
|
||||
};
|
||||
} catch (error) {
|
||||
if (error.toString().includes('exists on disk, but not in')) {
|
||||
console.warn('project.json does not exist in this commit.');
|
||||
}
|
||||
|
||||
// Return empty state
|
||||
return {
|
||||
baseProject: {},
|
||||
commitShaDiffedTo: headCommitId,
|
||||
components: createEmptyArrayDiff(),
|
||||
variants: createEmptyArrayDiff(),
|
||||
settings: createEmptyArrayDiff(),
|
||||
styles: {
|
||||
colors: createEmptyArrayDiff(),
|
||||
text: createEmptyArrayDiff()
|
||||
},
|
||||
cloudservices: createEmptyArrayDiff()
|
||||
};
|
||||
}
|
||||
export async function doLocalDiff(repositoryPath: string, headCommitId: string): Promise<ProjectLocalDiff> {
|
||||
const baseCommit = await getCommit(repositoryPath, headCommitId);
|
||||
const baseProjectJson = await baseCommit.getFileAsString('project.json');
|
||||
const baseProject = JSON.parse(baseProjectJson);
|
||||
applyPatches(baseProject);
|
||||
|
||||
const diff = diffProject(baseProject, ProjectModel.instance.toJSON());
|
||||
|
||||
return {
|
||||
...diff,
|
||||
baseProject,
|
||||
commitShaDiffedTo: headCommitId
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import { Slot } from '@noodl-core-ui/types/global';
|
||||
import { doLocalDiff, ProjectLocalDiff } from './DiffUtils';
|
||||
import { useVersionControlFetch } from './fetch.context';
|
||||
import { BranchStatus, IVersionControlContext } from './types';
|
||||
import { ProjectModel } from '@noodl-models/projectmodel';
|
||||
|
||||
const VersionControlContext = createContext<IVersionControlContext>({
|
||||
git: null,
|
||||
@@ -58,8 +57,7 @@ export function VersionControlProvider({ git, children }: { git: Git; children:
|
||||
(async () => {
|
||||
const currentCommitSha = await git.getHeadCommitId();
|
||||
if (currentCommitSha) {
|
||||
const projectPath = ProjectModel.instance._retainedProjectDirectory;
|
||||
const diff = await doLocalDiff(git.repositoryPath, projectPath, currentCommitSha);
|
||||
const diff = await doLocalDiff(git.repositoryPath, currentCommitSha);
|
||||
setLocalDiff(diff);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -17,11 +17,9 @@ import { EventDispatcher } from '../../../../../shared/utils/EventDispatcher';
|
||||
import View from '../../../../../shared/view';
|
||||
import { NodeGraphEditor } from '../../nodegrapheditor';
|
||||
import * as NewPopupLayer from '../../PopupLayer/index';
|
||||
import { type PopupMenuItem } from '../../PopupLayer/index';
|
||||
import { ToastLayer } from '../../ToastLayer/ToastLayer';
|
||||
import { ComponentsPanelFolder } from './ComponentsPanelFolder';
|
||||
import { ComponentTemplates } from './ComponentTemplates';
|
||||
import { HACK_findNodeReference } from '@noodl-contexts/NodeReferencesContext';
|
||||
|
||||
const PopupLayer = require('@noodl-views/popuplayer');
|
||||
const ComponentsPanelTemplate = require('../../../templates/componentspanel.html');
|
||||
@@ -963,7 +961,7 @@ export class ComponentsPanelView extends View {
|
||||
forRuntimeType: this.getRuntimeType()
|
||||
});
|
||||
|
||||
let items: PopupMenuItem[] = templates.map((t) => ({
|
||||
let items: TSFixme[] = templates.map((t) => ({
|
||||
icon: IconName.Plus,
|
||||
label: t.label,
|
||||
onClick: () => {
|
||||
@@ -989,10 +987,6 @@ export class ComponentsPanelView extends View {
|
||||
});
|
||||
}
|
||||
|
||||
// Find references
|
||||
const nodeReference = HACK_findNodeReference(scope.comp.name);
|
||||
const nodeReferencesText = `Used in ${nodeReference?.referenaces?.length || 0} places`;
|
||||
|
||||
items = items.concat([
|
||||
{
|
||||
icon: IconName.Pencil,
|
||||
@@ -1017,9 +1011,6 @@ export class ComponentsPanelView extends View {
|
||||
_this.onDeleteClicked(scope, el);
|
||||
evt.stopPropagation();
|
||||
}
|
||||
},
|
||||
{
|
||||
label: nodeReferencesText
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -1119,16 +1110,6 @@ export class ComponentsPanelView extends View {
|
||||
}
|
||||
]);
|
||||
|
||||
if (scope.canBecomeRoot) {
|
||||
// Find references
|
||||
const nodeReference = HACK_findNodeReference(scope.folder.component.name);
|
||||
const nodeReferencesText = `Used in ${nodeReference?.referenaces?.length || 0} places`;
|
||||
|
||||
items = items.concat([{
|
||||
label: nodeReferencesText
|
||||
}]);
|
||||
}
|
||||
|
||||
const menu = new NewPopupLayer.PopupMenu({
|
||||
items: items
|
||||
});
|
||||
|
||||
@@ -5,8 +5,6 @@ import { useSidePanelKeyboardCommands } from '@noodl-hooks/useKeyboardCommands';
|
||||
import classNames from 'classnames';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
|
||||
import { ComponentModel } from '@noodl-models/componentmodel';
|
||||
import { NodeGraphNode } from '@noodl-models/nodegraphmodel';
|
||||
import { KeyCode, KeyMod } from '@noodl-utils/keyboard/KeyCode';
|
||||
import { performSearch } from '@noodl-utils/universal-search';
|
||||
|
||||
@@ -56,7 +54,7 @@ export function SearchPanel() {
|
||||
}
|
||||
}, [debouncedSearchTerm]);
|
||||
|
||||
function onSearchItemClicked(searchResult: SearchResultItem) {
|
||||
function onSearchItemClicked(searchResult) {
|
||||
if (searchResult.type === 'Component') {
|
||||
NodeGraphContextTmp.switchToComponent(searchResult.componentTarget, {
|
||||
breadcrumbs: false,
|
||||
@@ -87,7 +85,29 @@ export function SearchPanel() {
|
||||
|
||||
<div className={css.SearchResults}>
|
||||
{searchResults.map((component) => (
|
||||
<SearchItem key={component.componentId} component={component} onSearchItemClicked={onSearchItemClicked} />
|
||||
<Section
|
||||
title={`${component.componentName} (${component.results.length} result${
|
||||
component.results.length > 1 ? 's' : ''
|
||||
})`}
|
||||
key={component.componentId}
|
||||
variant={SectionVariant.Panel}
|
||||
>
|
||||
{component.results.map((result, index) => (
|
||||
<div
|
||||
className={classNames(
|
||||
css.SearchResultItem
|
||||
// lastActiveComponentId === result.componentTarget.id && css['is-active']
|
||||
)}
|
||||
key={index}
|
||||
onClick={() => onSearchItemClicked(result)}
|
||||
>
|
||||
<Label variant={TextType.Proud}>
|
||||
{result.userLabel ? result.type + ' - ' + result.userLabel : result.type}
|
||||
</Label>
|
||||
<Text>{result.label}</Text>
|
||||
</div>
|
||||
))}
|
||||
</Section>
|
||||
))}
|
||||
{searchResults.length === 0 && debouncedSearchTerm.length > 0 && (
|
||||
<Container hasXSpacing hasYSpacing>
|
||||
@@ -98,51 +118,3 @@ export function SearchPanel() {
|
||||
</BasePanel>
|
||||
);
|
||||
}
|
||||
|
||||
type SearchResultItem = {
|
||||
componentTarget: ComponentModel;
|
||||
label: string;
|
||||
nodeTarget: NodeGraphNode;
|
||||
type: string;
|
||||
userLabel: string;
|
||||
};
|
||||
|
||||
type SearchItemProps = {
|
||||
component: {
|
||||
componentName: string;
|
||||
componentId: string;
|
||||
results: SearchResultItem[];
|
||||
};
|
||||
onSearchItemClicked: (item: SearchResultItem) => void;
|
||||
};
|
||||
|
||||
function SearchItem({ component, onSearchItemClicked }: SearchItemProps) {
|
||||
const resultCountText = `${component.results.length} result${component.results.length > 1 ? 's' : ''}`;
|
||||
let titleText = `${component.componentName} (${resultCountText})`;
|
||||
|
||||
// We expect there to always be at least one result, to get the full component name.
|
||||
const isInCloudFunctions = component.results[0].componentTarget.name.startsWith('/#__cloud__/');
|
||||
if (isInCloudFunctions) {
|
||||
titleText += ' (Cloud Function)';
|
||||
}
|
||||
|
||||
return (
|
||||
<Section title={titleText} variant={SectionVariant.Panel}>
|
||||
{component.results.map((result, index) => (
|
||||
<div
|
||||
className={classNames(
|
||||
css.SearchResultItem
|
||||
// lastActiveComponentId === result.componentTarget.id && css['is-active']
|
||||
)}
|
||||
key={index}
|
||||
onClick={() => onSearchItemClicked(result)}
|
||||
>
|
||||
<Label variant={TextType.Proud}>
|
||||
{result.userLabel ? result.type + ' - ' + result.userLabel : result.type}
|
||||
</Label>
|
||||
<Text>{result.label}</Text>
|
||||
</div>
|
||||
))}
|
||||
</Section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Fluxscape Viewer</title>
|
||||
<title>Noodl Viewer</title>
|
||||
<link href="../../assets/lib/fontawesome/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="assets/style.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="../../assets/lib/jquery-min.js"></script>
|
||||
|
||||
@@ -67,7 +67,7 @@ function startServer(app, projectGetSettings, projectGetInfo, projectGetComponen
|
||||
ProjectModules.instance.injectIntoHtml(info.projectDirectory, data, '/', function (injected) {
|
||||
projectGetSettings((settings) => {
|
||||
settings = settings || {};
|
||||
injected = injected.replace('{{#title#}}', settings.htmlTitle || 'Fluxscape Viewer');
|
||||
injected = injected.replace('{{#title#}}', settings.htmlTitle || 'Noodl Viewer');
|
||||
injected = injected.replace('{{#customHeadCode#}}', settings.headCode || '');
|
||||
|
||||
response.writeHead(200, {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"version": "2.7.0",
|
||||
"main": "src/index.ts",
|
||||
"description": "",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net",
|
||||
"dependencies": {
|
||||
"desktop-trampoline": "https://github.com/desktop/desktop-trampoline/archive/refs/tags/v0.9.8.tar.gz",
|
||||
"dugite": "^1.106.0",
|
||||
|
||||
@@ -22,11 +22,7 @@ export async function open(basePath: string): Promise<string> {
|
||||
// console.log("VCS error when opening project: " + e);
|
||||
// }
|
||||
|
||||
|
||||
// Find the relative git repository path
|
||||
const repositoryPath = await getTopLevelWorkingDirectory(basePath);
|
||||
|
||||
return repositoryPath;
|
||||
return basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"version": "2.7.0",
|
||||
"main": "src/index.ts",
|
||||
"description": "Cross platform implementation of platform specific features.",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net",
|
||||
"dependencies": {
|
||||
"@noodl/platform": "file:../noodl-platform",
|
||||
"@noodl/platform-node": "file:../noodl-platform-node"
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"version": "2.7.0",
|
||||
"main": "src/index.ts",
|
||||
"description": "Cross platform implementation of platform specific features.",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net",
|
||||
"scripts": {
|
||||
"test": "jest",
|
||||
"test:coverage": "jest --coverage"
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
"version": "2.7.0",
|
||||
"main": "src/index.ts",
|
||||
"description": "Cross platform implementation of platform specific features.",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io"
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net"
|
||||
}
|
||||
|
||||
@@ -32,15 +32,12 @@ class CloudStore {
|
||||
|
||||
_initCloudServices() {
|
||||
_collections = undefined; // clear collection cache, so it's refetched
|
||||
|
||||
const cloudServices = NoodlRuntime.instance.getMetaData('cloudservices');
|
||||
|
||||
if (cloudServices) {
|
||||
this.appId = cloudServices.appId;
|
||||
this.endpoint = cloudServices.endpoint;
|
||||
}
|
||||
|
||||
const dbVersionMajor = NoodlRuntime.instance.getMetaData('dbVersionMajor');
|
||||
this.dbVersionMajor = dbVersionMajor;
|
||||
}
|
||||
|
||||
on() {
|
||||
@@ -73,9 +70,8 @@ class CloudStore {
|
||||
xhr.open(options.method || 'GET', this.endpoint + path, true);
|
||||
|
||||
xhr.setRequestHeader('X-Parse-Application-Id', this.appId);
|
||||
if (typeof _noodl_cloudservices !== 'undefined') {
|
||||
if (typeof _noodl_cloudservices !== 'undefined')
|
||||
xhr.setRequestHeader('X-Parse-Master-Key', _noodl_cloudservices.masterKey);
|
||||
}
|
||||
|
||||
// Check for current users
|
||||
var _cu = localStorage['Parse/' + this.appId + '/currentUser'];
|
||||
@@ -172,10 +168,13 @@ class CloudStore {
|
||||
return;
|
||||
}
|
||||
|
||||
if (options.where) args.push('match=' + encodeURIComponent(JSON.stringify(options.where)));
|
||||
if (options.limit) args.push('limit=' + options.limit);
|
||||
if (options.skip) args.push('skip=' + options.skip);
|
||||
|
||||
const grouping = {};
|
||||
const grouping = {
|
||||
objectId: null
|
||||
};
|
||||
|
||||
Object.keys(options.group).forEach((k) => {
|
||||
const _g = {};
|
||||
@@ -189,20 +188,7 @@ class CloudStore {
|
||||
grouping[k] = _g;
|
||||
});
|
||||
|
||||
// I don't know which version the API was changed, lets just say above 4 for now.
|
||||
if (this.dbVersionMajor && this.dbVersionMajor > 4) {
|
||||
grouping._id = null;
|
||||
|
||||
if (options.where) args.push('$match=' + encodeURIComponent(JSON.stringify(options.where)));
|
||||
|
||||
args.push('$group=' + JSON.stringify(grouping));
|
||||
} else {
|
||||
grouping.objectId = null;
|
||||
|
||||
if (options.where) args.push('match=' + encodeURIComponent(JSON.stringify(options.where)));
|
||||
|
||||
args.push('group=' + JSON.stringify(grouping));
|
||||
}
|
||||
args.push('group=' + JSON.stringify(grouping));
|
||||
|
||||
this._makeRequest('/aggregate/' + options.collection + (args.length > 0 ? '?' + args.join('&') : ''), {
|
||||
success: function (response) {
|
||||
@@ -258,22 +244,11 @@ class CloudStore {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {{
|
||||
* objectId: string;
|
||||
* collection: string;
|
||||
* include?: string[] | string;
|
||||
* success: (data: unknown) => void;
|
||||
* error: (error: unknown) => void;
|
||||
* }} options
|
||||
*/
|
||||
fetch(options) {
|
||||
const args = [];
|
||||
|
||||
if (options.include) {
|
||||
if (options.include)
|
||||
args.push('include=' + (Array.isArray(options.include) ? options.include.join(',') : options.include));
|
||||
}
|
||||
|
||||
this._makeRequest(
|
||||
'/classes/' + options.collection + '/' + options.objectId + (args.length > 0 ? '?' + args.join('&') : ''),
|
||||
@@ -445,8 +420,6 @@ class CloudStore {
|
||||
* file: {
|
||||
* name: string;
|
||||
* }
|
||||
* success: (data: unknown) => void;
|
||||
* error: (error: unknown) => void;
|
||||
* }} options
|
||||
*/
|
||||
deleteFile(options) {
|
||||
@@ -577,26 +550,21 @@ function _deserializeJSON(data, type, modelScope) {
|
||||
}
|
||||
|
||||
function _fromJSON(item, collectionName, modelScope) {
|
||||
const modelStore = modelScope || Model;
|
||||
const m = (modelScope || Model).get(item.objectId);
|
||||
m._class = collectionName;
|
||||
|
||||
const model = modelStore.get(item.objectId);
|
||||
model._class = collectionName;
|
||||
if (collectionName !== undefined && CloudStore._collections[collectionName] !== undefined)
|
||||
var schema = CloudStore._collections[collectionName].schema;
|
||||
|
||||
let schema = undefined;
|
||||
if (collectionName !== undefined && CloudStore._collections[collectionName] !== undefined) {
|
||||
schema = CloudStore._collections[collectionName].schema;
|
||||
for (var key in item) {
|
||||
if (key === 'objectId' || key === 'ACL') continue;
|
||||
|
||||
var _type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
|
||||
m.set(key, _deserializeJSON(item[key], _type, modelScope));
|
||||
}
|
||||
|
||||
for (const key in item) {
|
||||
if (key === 'objectId' || key === 'ACL') {
|
||||
continue;
|
||||
}
|
||||
|
||||
const _type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
model.set(key, _deserializeJSON(item[key], _type, modelScope));
|
||||
}
|
||||
|
||||
return model;
|
||||
return m;
|
||||
}
|
||||
|
||||
CloudStore._fromJSON = _fromJSON;
|
||||
|
||||
@@ -36,15 +36,16 @@ function convertVisualFilter(query, options) {
|
||||
const _res = {};
|
||||
var cond;
|
||||
var value = query.input !== undefined ? inputs[query.input] : query.value;
|
||||
|
||||
|
||||
if (query.operator === 'exist') {
|
||||
_res[query.property] = { $exists: true };
|
||||
return _res;
|
||||
} else if (query.operator === 'not exist') {
|
||||
_res[query.property] = { $exists: false };
|
||||
return _res;
|
||||
_res[query.property] = { $exists: true };
|
||||
return _res;
|
||||
}
|
||||
|
||||
else if (query.operator === 'not exist') {
|
||||
_res[query.property] = { $exists: false };
|
||||
return _res;
|
||||
}
|
||||
|
||||
if (value === undefined) return;
|
||||
|
||||
if (CloudStore._collections[options.collectionName])
|
||||
@@ -79,6 +80,7 @@ function convertVisualFilter(query, options) {
|
||||
cond = { $regex: value, $options: 'i' };
|
||||
}
|
||||
|
||||
|
||||
_res[query.property] = cond;
|
||||
|
||||
return _res;
|
||||
@@ -161,22 +163,10 @@ function _value(v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Record<string, unknown>} filter
|
||||
* @param {{
|
||||
* collectionName?: string;
|
||||
* modelScope?: unknown;
|
||||
* error: (error: string) => void;
|
||||
* }} options
|
||||
* @returns
|
||||
*/
|
||||
function convertFilterOp(filter, options) {
|
||||
const keys = Object.keys(filter);
|
||||
if (keys.length === 0) return {};
|
||||
if (keys.length !== 1) {
|
||||
return options.error('Filter must only have one key found ' + keys.join(','));
|
||||
}
|
||||
if (keys.length !== 1) return options.error('Filter must only have one key found ' + keys.join(','));
|
||||
|
||||
const res = {};
|
||||
const key = keys[0];
|
||||
@@ -189,27 +179,18 @@ function convertFilterOp(filter, options) {
|
||||
} else if (filter['idContainedIn'] !== undefined) {
|
||||
res['objectId'] = { $in: filter['idContainedIn'] };
|
||||
} else if (filter['relatedTo'] !== undefined) {
|
||||
const modelId = filter['relatedTo']['id'];
|
||||
if (modelId === undefined) {
|
||||
return options.error('Must provide id in relatedTo filter');
|
||||
}
|
||||
var modelId = filter['relatedTo']['id'];
|
||||
if (modelId === undefined) return options.error('Must provide id in relatedTo filter');
|
||||
|
||||
const relationKey = filter['relatedTo']['key'];
|
||||
if (relationKey === undefined) {
|
||||
return options.error('Must provide key in relatedTo filter');
|
||||
}
|
||||
|
||||
const className = filter['relatedTo']['className'] || (options.modelScope || Model).get(modelId)?._class;
|
||||
if (typeof className === 'undefined') {
|
||||
// Either the pointer is loaded as an object or we allow passing in the className.
|
||||
return options.error('Must preload the Pointer or include className');
|
||||
}
|
||||
var relationKey = filter['relatedTo']['key'];
|
||||
if (relationKey === undefined) return options.error('Must provide key in relatedTo filter');
|
||||
|
||||
var m = (options.modelScope || Model).get(modelId);
|
||||
res['$relatedTo'] = {
|
||||
object: {
|
||||
__type: 'Pointer',
|
||||
objectId: modelId,
|
||||
className
|
||||
className: m._class
|
||||
},
|
||||
key: relationKey
|
||||
};
|
||||
@@ -227,14 +208,13 @@ function convertFilterOp(filter, options) {
|
||||
else if (opAndValue['containedIn'] !== undefined) res[key] = { $in: opAndValue['containedIn'] };
|
||||
else if (opAndValue['notContainedIn'] !== undefined) res[key] = { $nin: opAndValue['notContainedIn'] };
|
||||
else if (opAndValue['pointsTo'] !== undefined) {
|
||||
let schema = null;
|
||||
if (CloudStore._collections[options.collectionName]) {
|
||||
schema = CloudStore._collections[options.collectionName].schema;
|
||||
}
|
||||
var m = (options.modelScope || Model).get(opAndValue['pointsTo']);
|
||||
if (CloudStore._collections[options.collectionName])
|
||||
var schema = CloudStore._collections[options.collectionName].schema;
|
||||
|
||||
const targetClass =
|
||||
var targetClass =
|
||||
schema && schema.properties && schema.properties[key] ? schema.properties[key].targetClass : undefined;
|
||||
const type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
var type = schema && schema.properties && schema.properties[key] ? schema.properties[key].type : undefined;
|
||||
|
||||
if (type === 'Relation') {
|
||||
res[key] = {
|
||||
@@ -243,13 +223,13 @@ function convertFilterOp(filter, options) {
|
||||
className: targetClass
|
||||
};
|
||||
} else {
|
||||
if (Array.isArray(opAndValue['pointsTo'])) {
|
||||
if (Array.isArray(opAndValue['pointsTo']))
|
||||
res[key] = {
|
||||
$in: opAndValue['pointsTo'].map((v) => {
|
||||
return { __type: 'Pointer', objectId: v, className: targetClass };
|
||||
})
|
||||
};
|
||||
} else {
|
||||
else
|
||||
res[key] = {
|
||||
$eq: {
|
||||
__type: 'Pointer',
|
||||
@@ -257,7 +237,6 @@ function convertFilterOp(filter, options) {
|
||||
className: targetClass
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
} else if (opAndValue['matchesRegex'] !== undefined) {
|
||||
res[key] = {
|
||||
@@ -278,42 +257,43 @@ function convertFilterOp(filter, options) {
|
||||
}
|
||||
}
|
||||
};
|
||||
// Geo points
|
||||
// Geo points
|
||||
} else if (opAndValue['nearSphere'] !== undefined) {
|
||||
var _v = opAndValue['nearSphere'];
|
||||
res[key] = {
|
||||
$nearSphere: {
|
||||
__type: 'GeoPoint',
|
||||
__type: "GeoPoint",
|
||||
latitude: _v.latitude,
|
||||
longitude: _v.longitude
|
||||
longitude: _v.longitude,
|
||||
},
|
||||
$maxDistanceInMiles: _v.$maxDistanceInMiles,
|
||||
$maxDistanceInKilometers: _v.maxDistanceInKilometers,
|
||||
$maxDistanceInRadians: _v.maxDistanceInRadians
|
||||
$maxDistanceInMiles:_v.$maxDistanceInMiles,
|
||||
$maxDistanceInKilometers:_v.maxDistanceInKilometers,
|
||||
$maxDistanceInRadians:_v.maxDistanceInRadians
|
||||
};
|
||||
} else if (opAndValue['withinBox'] !== undefined) {
|
||||
var _v = opAndValue['withinBox'];
|
||||
res[key] = {
|
||||
$within: {
|
||||
$box: _v.map((gp) => ({
|
||||
__type: 'GeoPoint',
|
||||
latitude: gp.latitude,
|
||||
longitude: gp.longitude
|
||||
$within:{
|
||||
$box: _v.map(gp => ({
|
||||
__type:"GeoPoint",
|
||||
latitude:gp.latitude,
|
||||
longitude:gp.longitude
|
||||
}))
|
||||
}
|
||||
};
|
||||
} else if (opAndValue['withinPolygon'] !== undefined) {
|
||||
var _v = opAndValue['withinPolygon'];
|
||||
res[key] = {
|
||||
$geoWithin: {
|
||||
$polygon: _v.map((gp) => ({
|
||||
__type: 'GeoPoint',
|
||||
latitude: gp.latitude,
|
||||
longitude: gp.longitude
|
||||
$geoWithin:{
|
||||
$polygon: _v.map(gp => ({
|
||||
__type:"GeoPoint",
|
||||
latitude:gp.latitude,
|
||||
longitude:gp.longitude
|
||||
}))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} else {
|
||||
options.error('Unrecognized filter keys ' + keys.join(','));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ function createRecordsAPI(modelScope) {
|
||||
|
||||
return {
|
||||
async query(className, query, options) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().query({
|
||||
collection: className,
|
||||
@@ -27,9 +26,9 @@ function createRecordsAPI(modelScope) {
|
||||
include: options ? options.include : undefined,
|
||||
select: options ? options.select : undefined,
|
||||
count: options ? options.count : undefined,
|
||||
success: (results, count) => {
|
||||
success: (results,count) => {
|
||||
const _results = results.map((r) => cloudstore()._fromJSON(r, className));
|
||||
if (count !== undefined) resolve({ results: _results, count });
|
||||
if(count !== undefined) resolve({results:_results,count});
|
||||
else resolve(_results);
|
||||
},
|
||||
error: (err) => {
|
||||
@@ -40,7 +39,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async count(className, query) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().count({
|
||||
collection: className,
|
||||
@@ -62,7 +60,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async distinct(className, property, query) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().distinct({
|
||||
collection: className,
|
||||
@@ -85,7 +82,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async aggregate(className, group, query) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().aggregate({
|
||||
collection: className,
|
||||
@@ -107,31 +103,19 @@ function createRecordsAPI(modelScope) {
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string | { getId(): string; }} objectOrId
|
||||
* @param {{
|
||||
* className: string;
|
||||
* include?: string[] | string;
|
||||
* }} options
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
async fetch(objectOrId, options) {
|
||||
if (typeof objectOrId === 'undefined') return Promise.reject(new Error("'objectOrId' is undefined."));
|
||||
if (typeof objectOrId !== 'string') objectOrId = objectOrId.getId();
|
||||
const className = (options ? options.className : undefined) || (modelScope || Model).get(objectOrId)._class;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!className) {
|
||||
return reject('No class name specified');
|
||||
}
|
||||
if (!className) return reject('No class name specified');
|
||||
|
||||
cloudstore().fetch({
|
||||
collection: className,
|
||||
objectId: objectOrId,
|
||||
include: options ? options.include : undefined,
|
||||
success: function (response) {
|
||||
const record = cloudstore()._fromJSON(response, className);
|
||||
var record = cloudstore()._fromJSON(response, className);
|
||||
resolve(record);
|
||||
},
|
||||
error: function (err) {
|
||||
@@ -142,7 +126,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async increment(objectOrId, properties, options) {
|
||||
if (typeof objectOrId === 'undefined') return Promise.reject(new Error("'objectOrId' is undefined."));
|
||||
if (typeof objectOrId !== 'string') objectOrId = objectOrId.getId();
|
||||
const className = (options ? options.className : undefined) || (modelScope || Model).get(objectOrId)._class;
|
||||
|
||||
@@ -166,7 +149,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async save(objectOrId, properties, options) {
|
||||
if (typeof objectOrId === 'undefined') return Promise.reject(new Error("'objectOrId' is undefined."));
|
||||
if (typeof objectOrId !== 'string') objectOrId = objectOrId.getId();
|
||||
const className = (options ? options.className : undefined) || (modelScope || Model).get(objectOrId)._class;
|
||||
|
||||
@@ -197,7 +179,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async create(className, properties, options) {
|
||||
if (typeof className === 'undefined') throw new Error("'className' is undefined");
|
||||
return new Promise((resolve, reject) => {
|
||||
cloudstore().create({
|
||||
collection: className,
|
||||
@@ -216,7 +197,6 @@ function createRecordsAPI(modelScope) {
|
||||
},
|
||||
|
||||
async delete(objectOrId, options) {
|
||||
if (typeof objectOrId === 'undefined') return Promise.reject(new Error("'objectOrId' is undefined."));
|
||||
if (typeof objectOrId !== 'string') objectOrId = objectOrId.getId();
|
||||
const className = (options ? options.className : undefined) || (modelScope || Model).get(objectOrId)._class;
|
||||
|
||||
@@ -285,7 +265,7 @@ function createRecordsAPI(modelScope) {
|
||||
resolve();
|
||||
},
|
||||
error: (err) => {
|
||||
reject(Error(err || 'Failed to add relation.'));
|
||||
reject(Error(rr || 'Failed to add relation.'));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,7 +28,6 @@ var DbCollectionNode = {
|
||||
_this.scheduleAfterInputsHaveUpdated(function () {
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
collectionChangedScheduled = false;
|
||||
});
|
||||
};
|
||||
@@ -67,7 +66,6 @@ var DbCollectionNode = {
|
||||
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
}
|
||||
|
||||
if (args.type === 'create') {
|
||||
@@ -93,7 +91,6 @@ var DbCollectionNode = {
|
||||
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
} else if (matchesQuery && !_this._internal.collection.contains(m)) {
|
||||
// It's not part of the result collection but now matches they query, add it and resort
|
||||
_addModelAtCorrectIndex(m);
|
||||
@@ -109,7 +106,6 @@ var DbCollectionNode = {
|
||||
|
||||
_this.flagOutputDirty('count');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('isEmpty');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -157,17 +153,6 @@ var DbCollectionNode = {
|
||||
}
|
||||
}
|
||||
},
|
||||
isEmpty: {
|
||||
type: 'boolean',
|
||||
displayName: 'Is Empty',
|
||||
group: 'General',
|
||||
getter: function () {
|
||||
if (this._internal.collection) {
|
||||
return this._internal.collection.size() === 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
count: {
|
||||
type: 'number',
|
||||
displayName: 'Count',
|
||||
@@ -204,7 +189,6 @@ var DbCollectionNode = {
|
||||
setCollection: function (collection) {
|
||||
this.bindCollection(collection);
|
||||
this.flagOutputDirty('firstItemId');
|
||||
this.flagOutputDirty('isEmpty');
|
||||
this.flagOutputDirty('items');
|
||||
this.flagOutputDirty('count');
|
||||
},
|
||||
@@ -273,7 +257,7 @@ var DbCollectionNode = {
|
||||
limit: limit,
|
||||
skip: skip,
|
||||
count: count,
|
||||
success: (results, count) => {
|
||||
success: (results,count) => {
|
||||
if (results !== undefined) {
|
||||
_c.set(
|
||||
results.map((i) => {
|
||||
@@ -283,9 +267,10 @@ var DbCollectionNode = {
|
||||
})
|
||||
);
|
||||
}
|
||||
if (count !== undefined) {
|
||||
if(count !== undefined) {
|
||||
this._internal.storageSettings.storageTotalCount = count;
|
||||
if (this.hasOutput('storageTotalCount')) this.flagOutputDirty('storageTotalCount');
|
||||
if(this.hasOutput('storageTotalCount'))
|
||||
this.flagOutputDirty('storageTotalCount');
|
||||
}
|
||||
this.setCollection(_c);
|
||||
this.sendSignalOnOutput('fetched');
|
||||
@@ -398,7 +383,7 @@ var DbCollectionNode = {
|
||||
if (!storageSettings['storageEnableLimit']) return;
|
||||
else return storageSettings['storageSkip'] || 0;
|
||||
},
|
||||
getStorageFetchTotalCount: function () {
|
||||
getStorageFetchTotalCount: function() {
|
||||
const storageSettings = this._internal.storageSettings;
|
||||
|
||||
return !!storageSettings['storageEnableCount'];
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('../../../../noodl-runtime');
|
||||
|
||||
const Model = require('../../../model');
|
||||
var Model = require('../../../model');
|
||||
const CloudStore = require('../../../api/cloudstore');
|
||||
|
||||
const ModelNodeDefinition = {
|
||||
var ModelNodeDefinition = {
|
||||
name: 'DbModel2',
|
||||
docs: 'https://docs.noodl.net/nodes/data/cloud-data/record',
|
||||
displayNodeName: 'Record',
|
||||
@@ -21,11 +21,11 @@ const ModelNodeDefinition = {
|
||||
}
|
||||
],
|
||||
initialize: function () {
|
||||
const internal = this._internal;
|
||||
var internal = this._internal;
|
||||
internal.inputValues = {};
|
||||
internal.relationModelIds = {};
|
||||
|
||||
const _this = this;
|
||||
var _this = this;
|
||||
this._internal.onModelChangedCallback = function (args) {
|
||||
if (_this.isInputConnected('fetch')) return;
|
||||
|
||||
@@ -109,18 +109,13 @@ const ModelNodeDefinition = {
|
||||
displayName: 'Id',
|
||||
group: 'General',
|
||||
set: function (value) {
|
||||
if (value instanceof Model) {
|
||||
// Can be passed as model as well
|
||||
value = value.getId();
|
||||
} else if (typeof value === 'object') {
|
||||
// If this is an js object, dereference it
|
||||
value = Model.create(value).getId();
|
||||
}
|
||||
if (value instanceof Model) value = value.getId();
|
||||
// Can be passed as model as well
|
||||
else if (typeof value === 'object') value = Model.create(value).getId(); // If this is an js object, dereference it
|
||||
|
||||
this._internal.modelId = value; // Wait to fetch data
|
||||
if (this.isInputConnected('fetch') === false) {
|
||||
this.setModelID(value);
|
||||
} else {
|
||||
if (this.isInputConnected('fetch') === false) this.setModelID(value);
|
||||
else {
|
||||
this.flagOutputDirty('id');
|
||||
}
|
||||
}
|
||||
@@ -143,10 +138,9 @@ const ModelNodeDefinition = {
|
||||
this.setModel(model);
|
||||
},
|
||||
setModel: function (model) {
|
||||
if (this._internal.model) {
|
||||
if (this._internal.model)
|
||||
// Remove old listener if existing
|
||||
this._internal.model.off('change', this._internal.onModelChangedCallback);
|
||||
}
|
||||
|
||||
this._internal.model = model;
|
||||
this.flagOutputDirty('id');
|
||||
@@ -154,9 +148,7 @@ const ModelNodeDefinition = {
|
||||
|
||||
// We have a new model, mark all outputs as dirty
|
||||
for (var key in model.data) {
|
||||
if (this.hasOutput('prop-' + key)) {
|
||||
this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
if (this.hasOutput('prop-' + key)) this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
this.sendSignalOnOutput('fetched');
|
||||
},
|
||||
@@ -192,7 +184,7 @@ const ModelNodeDefinition = {
|
||||
}
|
||||
},
|
||||
scheduleFetch: function () {
|
||||
const _this = this;
|
||||
var _this = this;
|
||||
const internal = this._internal;
|
||||
|
||||
this.scheduleOnce('Fetch', function () {
|
||||
@@ -207,13 +199,12 @@ const ModelNodeDefinition = {
|
||||
collection: internal.collectionId,
|
||||
objectId: internal.modelId, // Get the objectId part of the model id
|
||||
success: function (response) {
|
||||
const model = cloudstore._fromJSON(response, internal.collectionId);
|
||||
var model = cloudstore._fromJSON(response, internal.collectionId);
|
||||
if (internal.model !== model) {
|
||||
// Check if we need to change model
|
||||
if (internal.model) {
|
||||
if (internal.model)
|
||||
// Remove old listener if existing
|
||||
internal.model.off('change', internal.onModelChangedCallback);
|
||||
}
|
||||
|
||||
internal.model = model;
|
||||
model.on('change', internal.onModelChangedCallback);
|
||||
@@ -222,10 +213,8 @@ const ModelNodeDefinition = {
|
||||
|
||||
delete response.objectId;
|
||||
|
||||
for (const key in response) {
|
||||
if (_this.hasOutput('prop-' + key)) {
|
||||
_this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
for (var key in response) {
|
||||
if (_this.hasOutput('prop-' + key)) _this.flagOutputDirty('prop-' + key);
|
||||
}
|
||||
|
||||
_this.sendSignalOnOutput('fetched');
|
||||
@@ -237,6 +226,7 @@ const ModelNodeDefinition = {
|
||||
});
|
||||
},
|
||||
scheduleStore: function () {
|
||||
var _this = this;
|
||||
var internal = this._internal;
|
||||
if (!internal.model) return;
|
||||
|
||||
@@ -257,6 +247,8 @@ const ModelNodeDefinition = {
|
||||
});
|
||||
},
|
||||
registerInputIfNeeded: function (name) {
|
||||
var _this = this;
|
||||
|
||||
if (this.hasInput(name)) {
|
||||
return;
|
||||
}
|
||||
@@ -336,7 +328,8 @@ function updatePorts(nodeId, parameters, editorConnection, graphModel) {
|
||||
var p = props[key];
|
||||
if (ports.find((_p) => _p.name === key)) continue;
|
||||
|
||||
if (p.type !== 'Relation') {
|
||||
if (p.type === 'Relation') {
|
||||
} else {
|
||||
// Other schema type ports
|
||||
const _typeMap = {
|
||||
String: 'string',
|
||||
@@ -380,16 +373,16 @@ module.exports = {
|
||||
function _managePortsForNode(node) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
|
||||
node.on('parameterUpdated', function () {
|
||||
node.on('parameterUpdated', function (event) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
});
|
||||
|
||||
graphModel.on('metadataChanged.dbCollections', function () {
|
||||
graphModel.on('metadataChanged.dbCollections', function (data) {
|
||||
CloudStore.invalidateCollections();
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
});
|
||||
|
||||
graphModel.on('metadataChanged.systemCollections', function () {
|
||||
graphModel.on('metadataChanged.systemCollections', function (data) {
|
||||
CloudStore.invalidateCollections();
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel);
|
||||
});
|
||||
|
||||
@@ -75,12 +75,12 @@ var SetDbModelPropertiedNodeDefinition = {
|
||||
_this.setError('Missing Record Id');
|
||||
return;
|
||||
}
|
||||
|
||||
const model = internal.model;
|
||||
for (const key in internal.inputValues) {
|
||||
model.set(key, internal.inputValues[key], { resolve: true });
|
||||
var model = internal.model;
|
||||
|
||||
for (var i in internal.inputValues) {
|
||||
model.set(i, internal.inputValues[i], { resolve: true });
|
||||
}
|
||||
|
||||
|
||||
CloudStore.forScope(_this.nodeScope.modelScope).save({
|
||||
collection: internal.collectionId,
|
||||
objectId: model.getId(), // Get the objectId part of the model id
|
||||
|
||||
@@ -31,6 +31,8 @@ const DateToStringNode = {
|
||||
|
||||
this._internal.currentInput = _value;
|
||||
this._format();
|
||||
this.flagOutputDirty('currentValue');
|
||||
this.sendSignalOnOutput('inputChanged');
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -47,45 +49,28 @@ const DateToStringNode = {
|
||||
type: 'signal',
|
||||
displayName: 'Date Changed',
|
||||
group: 'Signals'
|
||||
},
|
||||
onError: {
|
||||
type: 'signal',
|
||||
displayName: 'Invalid Date',
|
||||
group: 'Signals'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
_format() {
|
||||
try {
|
||||
const t = this._internal.currentInput;
|
||||
const format = this._internal.formatString;
|
||||
const date = ('0' + t.getDate()).slice(-2);
|
||||
const month = ('0' + (t.getMonth() + 1)).slice(-2);
|
||||
const monthShort = new Intl.DateTimeFormat('en-US', { month: 'short' }).format(t);
|
||||
const year = t.getFullYear();
|
||||
const yearShort = year.toString().substring(2);
|
||||
const hours = ('0' + t.getHours()).slice(-2);
|
||||
const minutes = ('0' + t.getMinutes()).slice(-2);
|
||||
const seconds = ('0' + t.getSeconds()).slice(-2);
|
||||
const t = this._internal.currentInput;
|
||||
const format = this._internal.formatString;
|
||||
const date = ('0' + t.getDate()).slice(-2);
|
||||
const month = ('0' + (t.getMonth() + 1)).slice(-2);
|
||||
const monthShort = new Intl.DateTimeFormat('en-US', { month: 'short' }).format(t);
|
||||
const year = t.getFullYear();
|
||||
const hours = ('0' + t.getHours()).slice(-2);
|
||||
const minutes = ('0' + t.getMinutes()).slice(-2);
|
||||
const seconds = ('0' + t.getSeconds()).slice(-2);
|
||||
|
||||
this._internal.dateString = format
|
||||
.replace(/\{date\}/g, date)
|
||||
.replace(/\{month\}/g, month)
|
||||
.replace(/\{monthShort\}/g, monthShort)
|
||||
.replace(/\{year\}/g, year)
|
||||
.replace(/\{yearShort\}/g, yearShort)
|
||||
.replace(/\{hours\}/g, hours)
|
||||
.replace(/\{minutes\}/g, minutes)
|
||||
.replace(/\{seconds\}/g, seconds);
|
||||
} catch (error) {
|
||||
// Set the output to be blank, makes it easier to handle.
|
||||
this._internal.dateString = '';
|
||||
this.flagOutputDirty('onError');
|
||||
}
|
||||
|
||||
// Flag that the value have changed
|
||||
this.flagOutputDirty('currentValue');
|
||||
this.sendSignalOnOutput('inputChanged');
|
||||
this._internal.dateString = format
|
||||
.replace(/\{date\}/g, date)
|
||||
.replace(/\{month\}/g, month)
|
||||
.replace(/\{monthShort\}/g, monthShort)
|
||||
.replace(/\{year\}/g, year)
|
||||
.replace(/\{hours\}/g, hours)
|
||||
.replace(/\{minutes\}/g, minutes)
|
||||
.replace(/\{seconds\}/g, seconds);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,8 +2,6 @@ const StringFormatDefinition = {
|
||||
name: 'String Format',
|
||||
docs: 'https://docs.noodl.net/nodes/string-manipulation/string-format',
|
||||
category: 'String Manipulation',
|
||||
usePortAsLabel: 'format',
|
||||
portLabelTruncationMode: 'length',
|
||||
initialize() {
|
||||
const internal = this._internal;
|
||||
internal.format = '';
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
"version": "2.7.0",
|
||||
"main": "src/index.d.ts",
|
||||
"description": "",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io"
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@noodl/cloud-runtime",
|
||||
"author": "Fluxscape <contact@fluxscape.io>",
|
||||
"homepage": "https://fluxscape.io",
|
||||
"author": "Noodl <info@noodl.net>",
|
||||
"homepage": "https://noodl.net",
|
||||
"version": "0.6.3",
|
||||
"license": "MIT",
|
||||
"main": "dist/main.js",
|
||||
|
||||
@@ -74,59 +74,6 @@ declare namespace Noodl {
|
||||
*/
|
||||
const Object: any;
|
||||
|
||||
type RecordQuery<T> =
|
||||
{
|
||||
lessThan: T
|
||||
} |
|
||||
{
|
||||
lessThanOrEqualTo: T
|
||||
} |
|
||||
{
|
||||
greaterThan: T
|
||||
} |
|
||||
{
|
||||
greaterThanOrEqualTo: T
|
||||
} |
|
||||
{
|
||||
equalTo: T
|
||||
} |
|
||||
{
|
||||
notEqualTo: T
|
||||
} |
|
||||
{
|
||||
containedIn: T
|
||||
} |
|
||||
{
|
||||
notContainedIn : T
|
||||
} |
|
||||
{
|
||||
exists: T
|
||||
} |
|
||||
{
|
||||
matchesRegex: T
|
||||
} |
|
||||
{
|
||||
text: T
|
||||
} |
|
||||
{
|
||||
idEqualTo: T
|
||||
} |
|
||||
{
|
||||
idContainedIn: T
|
||||
} |
|
||||
{
|
||||
pointsTo: T
|
||||
} |
|
||||
{
|
||||
relatedTo: T
|
||||
};
|
||||
|
||||
type RecordQueryField<T> = T extends RecordQuery<any> ?
|
||||
{ [K in keyof T]: { [P in K]: T[P] } & Partial<Record<Exclude<keyof T, K>, never>> }[keyof T]
|
||||
: never;
|
||||
|
||||
type RecordSortKey<T extends string> = (`${T}` | `-${T}`)[];
|
||||
|
||||
interface RecordsApi {
|
||||
/**
|
||||
* This is an async function that will query the database using the query
|
||||
@@ -168,17 +115,15 @@ declare namespace Noodl {
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
query<TClassName extends RecordClassName>(
|
||||
className: TClassName,
|
||||
query?:
|
||||
RecordQueryField<{ [K in keyof DatabaseSchema[TClassName]]: RecordQuery<any> }> |
|
||||
{ and: RecordQueryField<{ [K in keyof DatabaseSchema[TClassName]]: RecordQuery<any> }>[] },
|
||||
query(
|
||||
className: RecordClassName,
|
||||
query?: any,
|
||||
options?: {
|
||||
limit?: number;
|
||||
skip?: number;
|
||||
sort?: string | RecordSortKey<keyof DatabaseSchema[TClassName]>;
|
||||
include?: string | (keyof DatabaseSchema[TClassName])[];
|
||||
select?: string | (keyof DatabaseSchema[TClassName])[];
|
||||
sort?: string[];
|
||||
include?: any;
|
||||
select?: any;
|
||||
}
|
||||
): Promise<any>;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
// Allows to define the output path of the files built by the viewer.
|
||||
//
|
||||
// For example in the CLI, we will also build this, just with a different output path.
|
||||
outPath: process.env.OUT_PATH || path.resolve(__dirname, '../../noodl-editor/src/external'),
|
||||
runtimeVersion: 'cloud-runtime-' + require('../package.json').version.replaceAll('.', '-')
|
||||
};
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
// Allows to define the output path of the files built by the viewer.
|
||||
//
|
||||
// For example in the CLI, we will also build this, just with a different output path.
|
||||
outPath: process.env.OUT_PATH || path.resolve(__dirname, '../../noodl-editor/src/external'),
|
||||
runtimeVersion: 'cloud-runtime-' + require('../package.json').version.replaceAll('.', '-')
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.viewer.common.js');
|
||||
const { merge } = require("webpack-merge");
|
||||
const common = require("./webpack.viewer.common.js");
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'development',
|
||||
devtool: 'inline-source-map',
|
||||
watch: true
|
||||
mode: "development",
|
||||
devtool: "inline-source-map",
|
||||
watch: true,
|
||||
});
|
||||
|
||||
@@ -2,6 +2,5 @@ const { merge } = require('webpack-merge');
|
||||
const common = require('./webpack.viewer.common.js');
|
||||
|
||||
module.exports = merge(common, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map'
|
||||
mode: 'production'
|
||||
});
|
||||
|
||||
@@ -5,14 +5,9 @@ const navigation = {
|
||||
async showPopup(componentPath, params) {
|
||||
return new Promise((resolve) => {
|
||||
navigation._noodlRuntime.context.showPopup(componentPath, params, {
|
||||
senderNode: this.nodeScope.componentOwner,
|
||||
/**
|
||||
* @param {string | undefined} action
|
||||
* @param {*} results
|
||||
*/
|
||||
onClosePopup: (action, results) => {
|
||||
resolve({
|
||||
action: (action || '').replace('closeAction-', ''),
|
||||
action: action.replace('closeAction-', ''),
|
||||
parameters: results
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import { Noodl, Slot } from '../../../types';
|
||||
export interface ButtonProps extends Noodl.ReactProps {
|
||||
enabled: boolean;
|
||||
buttonType: 'button' | 'submit';
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
textStyle: Noodl.TextStyle;
|
||||
|
||||
@@ -98,7 +96,6 @@ export function Button(props: ButtonProps) {
|
||||
|
||||
return (
|
||||
<button
|
||||
{...props.attrs}
|
||||
className={className}
|
||||
disabled={!props.enabled}
|
||||
{...Utils.controlEvents(props)}
|
||||
|
||||
@@ -9,8 +9,6 @@ export interface CheckboxProps extends Noodl.ReactProps {
|
||||
enabled: boolean;
|
||||
checked: boolean;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
useLabel: boolean;
|
||||
label: string;
|
||||
labelSpacing: string;
|
||||
@@ -49,7 +47,6 @@ export function Checkbox(props: CheckboxProps) {
|
||||
Layout.align(style, props);
|
||||
|
||||
const inputProps = {
|
||||
...props.attrs,
|
||||
id: props.id,
|
||||
className: [props.className, 'ndl-controls-checkbox-2'].join(' '),
|
||||
disabled: !props.enabled,
|
||||
|
||||
@@ -10,8 +10,6 @@ export interface RadioButtonProps extends Noodl.ReactProps {
|
||||
enabled: boolean;
|
||||
value: string;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
useLabel: boolean;
|
||||
label: string;
|
||||
labelSpacing: string;
|
||||
@@ -49,7 +47,6 @@ export function RadioButton(props: RadioButtonProps) {
|
||||
props.checkedChanged && props.checkedChanged(radioButtonGroup ? radioButtonGroup.selected === props.value : false);
|
||||
|
||||
const inputProps = {
|
||||
...props.attrs,
|
||||
id: props.id,
|
||||
disabled: !props.enabled,
|
||||
className: [props.className, 'ndl-controls-radio-2'].join(' '),
|
||||
|
||||
@@ -12,8 +12,6 @@ export interface SelectProps extends Noodl.ReactProps {
|
||||
textStyle: Noodl.TextStyle;
|
||||
items: TSFixme;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
placeholder: string;
|
||||
placeholderOpacity: string;
|
||||
|
||||
@@ -83,7 +81,6 @@ export function Select(props: SelectProps) {
|
||||
}
|
||||
|
||||
const inputProps = {
|
||||
...props.attrs,
|
||||
id: props.id,
|
||||
className: props.className,
|
||||
style: {
|
||||
|
||||
@@ -2,15 +2,13 @@ import React, { useEffect, useState } from 'react';
|
||||
|
||||
import Layout from '../../../layout';
|
||||
import Utils from '../../../nodes/controls/utils';
|
||||
import { Noodl } from '../../../types';
|
||||
import { Noodl, Slot } from '../../../types';
|
||||
|
||||
export interface SliderProps extends Noodl.ReactProps {
|
||||
_nodeId: string;
|
||||
id: string;
|
||||
enabled: boolean;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
value: number;
|
||||
min: number;
|
||||
max: number;
|
||||
@@ -26,6 +24,8 @@ export interface SliderProps extends Noodl.ReactProps {
|
||||
|
||||
onClick: () => void;
|
||||
updateOutputValue: (value: number) => void;
|
||||
|
||||
children: Slot;
|
||||
}
|
||||
|
||||
function _styleTemplate(_class: string, props: SliderProps) {
|
||||
@@ -105,7 +105,6 @@ export function Slider(props: SliderProps) {
|
||||
const className = `ndl-controls-range2 ${instanceClassId} ${props.className ? props.className : ''} `;
|
||||
|
||||
const inputProps: React.InputHTMLAttributes<HTMLInputElement> = {
|
||||
...props.attrs,
|
||||
id: props.id,
|
||||
style: {
|
||||
width: '100%',
|
||||
@@ -171,7 +170,9 @@ export function Slider(props: SliderProps) {
|
||||
return (
|
||||
<div style={divStyle}>
|
||||
<div style={trackStyle} />
|
||||
<div style={thumbStyle} />
|
||||
<div style={thumbStyle}>
|
||||
{props.children}
|
||||
</div>
|
||||
<input
|
||||
className={className}
|
||||
{...Utils.controlEvents(props)}
|
||||
|
||||
@@ -17,8 +17,6 @@ export interface TextInputProps extends Noodl.ReactProps {
|
||||
type: 'text' | 'textArea' | 'email' | 'number' | 'password' | 'url';
|
||||
textStyle: Noodl.TextStyle;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
enabled: boolean;
|
||||
|
||||
placeholder: string;
|
||||
@@ -151,7 +149,6 @@ export class TextInput extends React.Component<TextInputProps, State> {
|
||||
inputStyles.color = props.noodlNode.context.styles.resolveColor(inputStyles.color);
|
||||
|
||||
const inputProps = {
|
||||
...props.attrs,
|
||||
id: props.id,
|
||||
value: this.state.value,
|
||||
...Utils.controlEvents(props),
|
||||
|
||||
@@ -7,8 +7,6 @@ export interface ColumnsProps extends Noodl.ReactProps {
|
||||
marginX: string;
|
||||
marginY: string;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
justifyContent: 'flex-start' | 'flex-end' | 'center';
|
||||
direction: 'row' | 'column';
|
||||
minWidth: string;
|
||||
@@ -117,10 +115,7 @@ export function Columns(props: ColumnsProps) {
|
||||
|
||||
// ForEachCompoent breaks the layout but is needed to send onMount/onUnmount
|
||||
if (!Array.isArray(props.children)) {
|
||||
// @ts-expect-error props.children.type is any
|
||||
if (props.children.type !== ForEachComponent) {
|
||||
children = [props.children]
|
||||
}
|
||||
children = [props.children];
|
||||
} else {
|
||||
children = props.children.filter((child) => child.type !== ForEachComponent);
|
||||
forEachComponent = props.children.find((child) => child.type === ForEachComponent);
|
||||
@@ -128,11 +123,9 @@ export function Columns(props: ColumnsProps) {
|
||||
|
||||
return (
|
||||
<div
|
||||
{...props.attrs}
|
||||
className={['columns-container', props.className].join(' ')}
|
||||
ref={containerRef}
|
||||
style={{
|
||||
visibility: containerWidth === null ? "hidden" : "visible",
|
||||
marginTop: parseFloat(props.marginY) * -1,
|
||||
marginLeft: parseFloat(props.marginX) * -1,
|
||||
display: 'flex',
|
||||
|
||||
@@ -19,8 +19,6 @@ BScroll.use(Slide);
|
||||
export interface GroupProps extends Noodl.ReactProps {
|
||||
as?: keyof JSX.IntrinsicElements | React.ComponentType<unknown>;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
scrollSnapEnabled: boolean;
|
||||
showScrollbar: boolean;
|
||||
scrollEnabled: boolean;
|
||||
@@ -273,7 +271,6 @@ export class Group extends React.Component<GroupProps> {
|
||||
<Component
|
||||
// @ts-expect-error Lets hope that the type passed here is always static!
|
||||
className={props.className}
|
||||
{...props.attrs}
|
||||
{...props.dom}
|
||||
{...PointerListeners(props)}
|
||||
style={style}
|
||||
|
||||
@@ -10,7 +10,6 @@ export interface ImageProps extends Noodl.ReactProps {
|
||||
src: string;
|
||||
onLoad?: () => void;
|
||||
};
|
||||
attrs: React.Attributes;
|
||||
}
|
||||
|
||||
export function Image(props: ImageProps) {
|
||||
@@ -31,5 +30,5 @@ export function Image(props: ImageProps) {
|
||||
}
|
||||
}
|
||||
|
||||
return <img {...props.attrs} className={props.className} {...props.dom} {...PointerListeners(props)} style={style} />;
|
||||
return <img className={props.className} {...props.dom} {...PointerListeners(props)} style={style} />;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import { Noodl } from '../../../types';
|
||||
export interface TextProps extends Noodl.ReactProps {
|
||||
as?: keyof JSX.IntrinsicElements | React.ComponentType<unknown>;
|
||||
|
||||
attrs: React.Attributes;
|
||||
|
||||
textStyle: Noodl.TextStyle;
|
||||
text: string;
|
||||
|
||||
@@ -50,7 +48,6 @@ export function Text(props: TextProps) {
|
||||
return (
|
||||
<Component
|
||||
className={['ndl-visual-text', props.className].join(' ')}
|
||||
{...props.attrs}
|
||||
{...props.dom}
|
||||
{...PointerListeners(props)}
|
||||
style={style}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const { Node } = require('@noodl/runtime');
|
||||
const Model = require('@noodl/runtime/src/model');
|
||||
|
||||
const VariableNodeDefinition = {
|
||||
var Model = require('@noodl/runtime/src/model');
|
||||
|
||||
var VariableNodeDefinition = {
|
||||
name: 'Variable',
|
||||
docs: 'https://docs.noodl.net/nodes/data/variable',
|
||||
category: 'Data',
|
||||
|
||||
@@ -30,24 +30,11 @@ const ButtonNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.layout = 'row'; //Used to tell child nodes what layout to expect
|
||||
},
|
||||
getReactComponent() {
|
||||
return Button;
|
||||
},
|
||||
inputs: {
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputCss: {
|
||||
backgroundColor: {
|
||||
index: 100,
|
||||
|
||||
@@ -31,7 +31,6 @@ const CheckBoxNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.sizeMode = 'explicit';
|
||||
this.props.id = 'input-' + guid();
|
||||
this.props.checked = this._internal.checked = false;
|
||||
@@ -95,16 +94,6 @@ const CheckBoxNode = {
|
||||
this.flagOutputDirty('checked');
|
||||
this._updateVisualState();
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputCss: {
|
||||
|
||||
@@ -31,7 +31,6 @@ const OptionsNode = {
|
||||
]
|
||||
},
|
||||
initialize: function () {
|
||||
this.props.attrs = {};
|
||||
this._itemsChanged = () => {
|
||||
this.forceUpdate();
|
||||
};
|
||||
@@ -91,16 +90,6 @@ const OptionsNode = {
|
||||
this.flagOutputDirty('value');
|
||||
}
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputProps: {
|
||||
|
||||
@@ -31,7 +31,6 @@ const RadioButtonNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.sizeMode = 'explicit';
|
||||
this.props.id = 'input-' + guid();
|
||||
|
||||
@@ -62,16 +61,6 @@ const RadioButtonNode = {
|
||||
set(value) {
|
||||
this.setStyle({ backgroundColor: value }, 'fill');
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputProps: {
|
||||
|
||||
@@ -11,7 +11,6 @@ const RangeNode = {
|
||||
name: 'net.noodl.controls.range',
|
||||
displayNodeName: 'Slider',
|
||||
docs: 'https://docs.noodl.net/nodes/ui-controls/slider',
|
||||
allowChildren: false,
|
||||
noodlNodeAsProp: true,
|
||||
connectionPanel: {
|
||||
groupPriority: [
|
||||
@@ -27,7 +26,6 @@ const RangeNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.sizeMode = 'contentHeight';
|
||||
this.props.id = 'input-' + guid();
|
||||
|
||||
@@ -68,16 +66,6 @@ const RangeNode = {
|
||||
set(value) {
|
||||
this._setInputValue(value);
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
outputs: {
|
||||
|
||||
@@ -43,7 +43,6 @@ const TextInputNode = {
|
||||
return TextInput;
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.startValue = '';
|
||||
this.props.id = this._internal.controlId = 'input-' + guid();
|
||||
},
|
||||
@@ -168,16 +167,6 @@ const TextInputNode = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputCss: {
|
||||
|
||||
@@ -51,9 +51,8 @@ const ClosePopupNode = {
|
||||
}
|
||||
},
|
||||
close: function () {
|
||||
if (this._internal.closeCallback) {
|
||||
if (this._internal.closeCallback)
|
||||
this._internal.closeCallback(this._internal.closeAction, this._internal.resultValues);
|
||||
}
|
||||
},
|
||||
closeActionTriggered: function (name) {
|
||||
this._internal.closeAction = name;
|
||||
|
||||
@@ -72,10 +72,8 @@ const Navigate = {
|
||||
backCallback: (action, results) => {
|
||||
this._internal.backResults = results;
|
||||
|
||||
for (const key in results) {
|
||||
if (this.hasOutput('backResult-' + key)) {
|
||||
this.flagOutputDirty('backResult-' + key);
|
||||
}
|
||||
for (var key in results) {
|
||||
if (this.hasOutput('backResult-' + key)) this.flagOutputDirty('backResult-' + key);
|
||||
}
|
||||
|
||||
if (action !== undefined) this.sendSignalOnOutput(action);
|
||||
@@ -116,23 +114,22 @@ const Navigate = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (name === 'target') {
|
||||
if (name === 'target')
|
||||
return this.registerInput(name, {
|
||||
set: this.setTargetPageId.bind(this)
|
||||
});
|
||||
} else if (name === 'transition') {
|
||||
else if (name === 'transition')
|
||||
return this.registerInput(name, {
|
||||
set: this.setTransition.bind(this)
|
||||
});
|
||||
} else if (name.startsWith('tr-')) {
|
||||
else if (name.startsWith('tr-'))
|
||||
return this.registerInput(name, {
|
||||
set: this.setTransitionParam.bind(this, name.substring('tr-'.length))
|
||||
});
|
||||
} else if (name.startsWith('pm-')) {
|
||||
else if (name.startsWith('pm-'))
|
||||
return this.registerInput(name, {
|
||||
set: this.setPageParam.bind(this, name.substring('pm-'.length))
|
||||
});
|
||||
}
|
||||
},
|
||||
registerOutputIfNeeded: function (name) {
|
||||
if (this.hasOutput(name)) {
|
||||
@@ -177,23 +174,18 @@ function setup(context, graphModel) {
|
||||
if (Transitions[transition]) ports = ports.concat(Transitions[transition].ports(node.parameters));
|
||||
}
|
||||
|
||||
const pageStacks = graphModel.getNodesWithType('Page Stack');
|
||||
const pageStack = pageStacks.find(
|
||||
// if(node.parameters['stack'] !== undefined) {
|
||||
var pageStacks = graphModel.getNodesWithType('Page Stack');
|
||||
var pageStack = pageStacks.find(
|
||||
(ps) => (ps.parameters['name'] || 'Main') === (node.parameters['stack'] || 'Main')
|
||||
);
|
||||
|
||||
if (pageStack !== undefined) {
|
||||
const pages = pageStack.parameters['pages'];
|
||||
var pages = pageStack.parameters['pages'];
|
||||
if (pages !== undefined && pages.length > 0) {
|
||||
ports.push({
|
||||
plug: 'input',
|
||||
type: {
|
||||
name: 'enum',
|
||||
enums: pages.map((p) => ({
|
||||
label: p.label,
|
||||
value: p.id
|
||||
}))
|
||||
},
|
||||
type: { name: 'enum', enums: pages.map((p) => ({ label: p.label, value: p.id })), allowEditOnly: true },
|
||||
group: 'General',
|
||||
displayName: 'Target Page',
|
||||
name: 'target',
|
||||
@@ -201,14 +193,14 @@ function setup(context, graphModel) {
|
||||
});
|
||||
|
||||
// See if there is a target page with component
|
||||
const targetPageId = node.parameters['target'] || pages[0].id;
|
||||
const targetComponentName = pageStack.parameters['pageComp-' + targetPageId];
|
||||
var targetPageId = node.parameters['target'] || pages[0].id;
|
||||
var targetComponentName = pageStack.parameters['pageComp-' + targetPageId];
|
||||
if (targetComponentName !== undefined) {
|
||||
const component = graphModel.components[targetComponentName];
|
||||
|
||||
if (component !== undefined) {
|
||||
// Make all inputs of the component to inputs of this navigation node
|
||||
for (const inputName in component.inputPorts) {
|
||||
for (var inputName in component.inputPorts) {
|
||||
ports.push({
|
||||
name: 'pm-' + inputName,
|
||||
displayName: inputName,
|
||||
@@ -253,6 +245,7 @@ function setup(context, graphModel) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
context.editorConnection.sendDynamicPorts(node.id, ports);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import React from 'react';
|
||||
|
||||
import ASyncQueue from '../../async-queue';
|
||||
import { createNodeFromReactComponent } from '../../react-component-node';
|
||||
|
||||
@@ -77,13 +75,10 @@ const PageStack = {
|
||||
const info = [{ type: 'text', value: 'Active Components:' }];
|
||||
|
||||
return info.concat(
|
||||
this._internal.stack.map((p) => {
|
||||
const pageInfo = this._findPage(p.pageId);
|
||||
return {
|
||||
type: 'text',
|
||||
value: '- ' + pageInfo.label
|
||||
};
|
||||
})
|
||||
this._internal.stack.map((p, i) => ({
|
||||
type: 'text',
|
||||
value: '- ' + this._internal.pages.find((pi) => pi.id === p.pageId).label
|
||||
}))
|
||||
);
|
||||
},
|
||||
defaultCss: {
|
||||
@@ -175,7 +170,6 @@ const PageStack = {
|
||||
topPageName: {
|
||||
type: 'string',
|
||||
displayName: 'Top Component Name',
|
||||
group: 'General',
|
||||
get() {
|
||||
return this._internal.topPageName;
|
||||
}
|
||||
@@ -183,7 +177,6 @@ const PageStack = {
|
||||
stackDepth: {
|
||||
type: 'number',
|
||||
displayName: 'Stack Depth',
|
||||
group: 'General',
|
||||
get() {
|
||||
return this._internal.stackDepth;
|
||||
}
|
||||
@@ -196,31 +189,12 @@ const PageStack = {
|
||||
_deregisterPageStack() {
|
||||
NavigationHandler.instance.deregisterPageStack(this._internal.name, this);
|
||||
},
|
||||
/**
|
||||
* @param {String} pageIdOrLabel
|
||||
*/
|
||||
_findPage(pageIdOrLabel) {
|
||||
if (this._internal.pageInfo[pageIdOrLabel]) {
|
||||
const pageInfo = this._internal.pageInfo[pageIdOrLabel];
|
||||
const pageRef = this._internal.pages.find((x) => x.id === pageIdOrLabel);
|
||||
return {
|
||||
component: String(pageInfo.component),
|
||||
label: String(pageRef.label),
|
||||
id: String(pageIdOrLabel)
|
||||
};
|
||||
}
|
||||
_pageNameForId(id) {
|
||||
if (this._internal.pages === undefined) return;
|
||||
const page = this._internal.pages.find((p) => p.id === id);
|
||||
if (page === undefined) return;
|
||||
|
||||
const pageRef = this._internal.pages.find((x) => x.label === pageIdOrLabel);
|
||||
if (pageRef) {
|
||||
const pageInfo = this._internal.pageInfo[pageRef.id];
|
||||
return {
|
||||
component: String(pageInfo.component),
|
||||
label: String(pageRef.label),
|
||||
id: String(pageRef.id)
|
||||
};
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return page.label;
|
||||
},
|
||||
setPageOutputs(outputs) {
|
||||
for (const prop in outputs) {
|
||||
@@ -256,9 +230,8 @@ const PageStack = {
|
||||
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
|
||||
|
||||
let startPageId;
|
||||
let params = {};
|
||||
|
||||
var startPageId,
|
||||
params = {};
|
||||
var pageFromUrl = this.matchPageFromUrl();
|
||||
if (pageFromUrl !== undefined) {
|
||||
// We have an url matching a page, use that page as start page
|
||||
@@ -266,16 +239,13 @@ const PageStack = {
|
||||
|
||||
params = Object.assign({}, pageFromUrl.query, pageFromUrl.params);
|
||||
} else {
|
||||
startPageId = this._internal.startPageId;
|
||||
var startPageId = this._internal.startPageId;
|
||||
if (startPageId === undefined) startPageId = this._internal.pages[0].id;
|
||||
}
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(startPageId);
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) {
|
||||
// No page was found
|
||||
return;
|
||||
}
|
||||
var pageInfo = this._internal.pageInfo[startPageId];
|
||||
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
|
||||
|
||||
var content = await this.nodeScope.createNode(pageInfo.component, guid());
|
||||
|
||||
@@ -299,7 +269,7 @@ const PageStack = {
|
||||
];
|
||||
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(startPageId),
|
||||
stackDepth: this._internal.stack.length
|
||||
});
|
||||
},
|
||||
@@ -488,22 +458,13 @@ const PageStack = {
|
||||
this._internal.asyncQueue.enqueue(this.replaceAsync.bind(this, args));
|
||||
},
|
||||
async replaceAsync(args) {
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
|
||||
|
||||
if (this._internal.isTransitioning) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.isTransitioning) return;
|
||||
|
||||
const pageId = args.target || this._internal.pages[0].id;
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(pageId);
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) {
|
||||
// No page was found
|
||||
return;
|
||||
}
|
||||
var pageId = args.target || this._internal.pages[0].id;
|
||||
var pageInfo = this._internal.pageInfo[pageId];
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
|
||||
|
||||
// Remove all current pages in the stack
|
||||
var children = this.getChildren();
|
||||
@@ -537,7 +498,7 @@ const PageStack = {
|
||||
];
|
||||
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(pageId),
|
||||
stackDepth: this._internal.stack.length
|
||||
});
|
||||
|
||||
@@ -549,22 +510,13 @@ const PageStack = {
|
||||
this._internal.asyncQueue.enqueue(this.navigateAsync.bind(this, args));
|
||||
},
|
||||
async navigateAsync(args) {
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.pages === undefined || this._internal.pages.length === 0) return;
|
||||
|
||||
if (this._internal.isTransitioning) {
|
||||
return;
|
||||
}
|
||||
if (this._internal.isTransitioning) return;
|
||||
|
||||
const pageId = args.target || this._internal.pages[0].id;
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(pageId);
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) {
|
||||
// No page was found
|
||||
return;
|
||||
}
|
||||
var pageId = args.target || this._internal.pages[0].id;
|
||||
var pageInfo = this._internal.pageInfo[pageId];
|
||||
if (pageInfo === undefined || pageInfo.component === undefined) return; // No component specified for page
|
||||
|
||||
// Create the container group
|
||||
const group = this.createPageContainer();
|
||||
@@ -578,7 +530,7 @@ const PageStack = {
|
||||
group.addChild(content);
|
||||
|
||||
// Connect navigate back nodes
|
||||
const navigateBackNodes = content.nodeScope.getNodesWithType('PageStackNavigateBack');
|
||||
var navigateBackNodes = content.nodeScope.getNodesWithType('PageStackNavigateBack');
|
||||
if (navigateBackNodes && navigateBackNodes.length > 0) {
|
||||
for (var j = 0; j < navigateBackNodes.length; j++) {
|
||||
navigateBackNodes[j]._setBackCallback(this.back.bind(this));
|
||||
@@ -586,8 +538,8 @@ const PageStack = {
|
||||
}
|
||||
|
||||
// Push the new top
|
||||
const top = this._internal.stack[this._internal.stack.length - 1];
|
||||
const newTop = {
|
||||
var top = this._internal.stack[this._internal.stack.length - 1];
|
||||
var newTop = {
|
||||
from: top.page,
|
||||
page: group,
|
||||
pageInfo: pageInfo,
|
||||
@@ -599,7 +551,7 @@ const PageStack = {
|
||||
};
|
||||
this._internal.stack.push(newTop);
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(args.target),
|
||||
stackDepth: this._internal.stack.length
|
||||
});
|
||||
this._updateUrlWithTopPage();
|
||||
@@ -632,11 +584,8 @@ const PageStack = {
|
||||
this.addChild(top.from, 0);
|
||||
top.backCallback && top.backCallback(args.backAction, args.results);
|
||||
|
||||
// Find the page by either ID or by Label
|
||||
const pageInfo = this._findPage(this._internal.stack[this._internal.stack.length - 2].pageId);
|
||||
|
||||
this.setPageOutputs({
|
||||
topPageName: pageInfo.label,
|
||||
topPageName: this._pageNameForId(this._internal.stack[this._internal.stack.length - 2].pageId),
|
||||
stackDepth: this._internal.stack.length - 1
|
||||
});
|
||||
|
||||
|
||||
@@ -53,24 +53,15 @@ const ShowPopupNode = {
|
||||
|
||||
this.context.showPopup(this._internal.target, this._internal.popupParams, {
|
||||
senderNode: this.nodeScope.componentOwner,
|
||||
/**
|
||||
* @param {string | undefined} action
|
||||
* @param {*} results
|
||||
*/
|
||||
onClosePopup: (action, results) => {
|
||||
this._internal.closeResults = results;
|
||||
|
||||
for (const key in results) {
|
||||
if (this.hasOutput('closeResult-' + key)) {
|
||||
this.flagOutputDirty('closeResult-' + key);
|
||||
}
|
||||
for (var key in results) {
|
||||
if (this.hasOutput('closeResult-' + key)) this.flagOutputDirty('closeResult-' + key);
|
||||
}
|
||||
|
||||
if (!action) {
|
||||
this.sendSignalOnOutput('Closed');
|
||||
} else {
|
||||
this.sendSignalOnOutput(action);
|
||||
}
|
||||
if (!action) this.sendSignalOnOutput('Closed');
|
||||
else this.sendSignalOnOutput(action);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
const { Node } = require('@noodl/runtime');
|
||||
|
||||
const Collection = require('@noodl/runtime/src/collection');
|
||||
var Model = require('@noodl/runtime/src/model'),
|
||||
Collection = require('@noodl/runtime/src/collection');
|
||||
|
||||
var CollectionNode = {
|
||||
name: 'Collection2',
|
||||
@@ -26,7 +27,6 @@ var CollectionNode = {
|
||||
|
||||
_this.scheduleAfterInputsHaveUpdated(function () {
|
||||
_this.sendSignalOnOutput('changed');
|
||||
_this.flagOutputDirty('firstItemId');
|
||||
_this.flagOutputDirty('count');
|
||||
collectionChangedScheduled = false;
|
||||
});
|
||||
@@ -117,17 +117,6 @@ var CollectionNode = {
|
||||
return this._internal.collection;
|
||||
}
|
||||
},
|
||||
firstItemId: {
|
||||
type: 'string',
|
||||
displayName: 'First Item Id',
|
||||
group: 'General',
|
||||
getter: function () {
|
||||
if (this._internal.collection) {
|
||||
var firstItem = this._internal.collection.get(0);
|
||||
if (firstItem !== undefined) return firstItem.getId();
|
||||
}
|
||||
}
|
||||
},
|
||||
count: {
|
||||
type: 'number',
|
||||
displayName: 'Count',
|
||||
@@ -161,7 +150,6 @@ var CollectionNode = {
|
||||
collection.on('change', this._internal.collectionChangedCallback);
|
||||
|
||||
this.flagOutputDirty('items');
|
||||
this.flagOutputDirty('firstItemId');
|
||||
this.flagOutputDirty('count');
|
||||
},
|
||||
setSourceCollection: function (collection) {
|
||||
|
||||
@@ -43,10 +43,6 @@ const OpenFilePicker = {
|
||||
|
||||
input.accept = this._internal.acceptedFileTypes;
|
||||
|
||||
if (this._internal.capture) {
|
||||
input.capture = this._internal.capture;
|
||||
}
|
||||
|
||||
input.onchange = onChange;
|
||||
input.click();
|
||||
}
|
||||
@@ -58,14 +54,6 @@ const OpenFilePicker = {
|
||||
set(value) {
|
||||
this._internal.acceptedFileTypes = value;
|
||||
}
|
||||
},
|
||||
capture: {
|
||||
group: 'General',
|
||||
type: 'string',
|
||||
displayName: 'Capture',
|
||||
set(value) {
|
||||
this._internal.capture = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
outputs: {
|
||||
|
||||
@@ -4,7 +4,7 @@ const Switch = {
|
||||
name: 'Switch',
|
||||
docs: 'https://docs.noodl.net/nodes/logic/switch',
|
||||
category: 'Logic',
|
||||
initialize() {
|
||||
initialize: function () {
|
||||
this._internal.state = false;
|
||||
this._internal.initialized = false;
|
||||
},
|
||||
@@ -15,7 +15,7 @@ const Switch = {
|
||||
on: {
|
||||
displayName: 'On',
|
||||
group: 'Change State',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
if (this._internal.state === true) {
|
||||
return;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ const Switch = {
|
||||
off: {
|
||||
displayName: 'Off',
|
||||
group: 'Change State',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
if (this._internal.state === false) {
|
||||
return;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ const Switch = {
|
||||
flip: {
|
||||
displayName: 'Flip',
|
||||
group: 'Change State',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this._internal.state = !this._internal.state;
|
||||
this.flagOutputDirty('state');
|
||||
this.emitSignals();
|
||||
@@ -50,7 +50,7 @@ const Switch = {
|
||||
displayName: 'State',
|
||||
group: 'General',
|
||||
default: false,
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.state = !!value;
|
||||
this.flagOutputDirty('state');
|
||||
this.emitSignals();
|
||||
@@ -61,15 +61,10 @@ const Switch = {
|
||||
state: {
|
||||
type: 'boolean',
|
||||
displayName: 'Current State',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.state;
|
||||
}
|
||||
},
|
||||
switched: {
|
||||
displayName: 'Switched',
|
||||
type: 'signal',
|
||||
group: 'Signals'
|
||||
},
|
||||
switchedToOn: {
|
||||
displayName: 'Switched To On',
|
||||
type: 'signal',
|
||||
@@ -82,13 +77,12 @@ const Switch = {
|
||||
}
|
||||
},
|
||||
prototypeExtensions: {
|
||||
emitSignals() {
|
||||
emitSignals: function () {
|
||||
if (this._internal.state === true) {
|
||||
this.sendSignalOnOutput('switchedToOn');
|
||||
} else {
|
||||
this.sendSignalOnOutput('switchedToOff');
|
||||
}
|
||||
this.sendSignalOnOutput('switched');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
|
||||
const UserService = require('./userservice');
|
||||
|
||||
const LoginNodeDefinition = {
|
||||
var LoginNodeDefinition = {
|
||||
name: 'net.noodl.user.LogIn',
|
||||
docs: 'https://docs.noodl.net/nodes/data/user/log-in',
|
||||
displayNodeName: 'Log In',
|
||||
category: 'Cloud Services',
|
||||
color: 'data',
|
||||
initialize: function () {
|
||||
var internal = this._internal;
|
||||
},
|
||||
getInspectInfo() {},
|
||||
outputs: {
|
||||
success: {
|
||||
type: 'signal',
|
||||
@@ -23,7 +28,7 @@ const LoginNodeDefinition = {
|
||||
type: 'string',
|
||||
displayName: 'Error',
|
||||
group: 'Error',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.error;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +37,7 @@ const LoginNodeDefinition = {
|
||||
login: {
|
||||
displayName: 'Do',
|
||||
group: 'Actions',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this.scheduleLogIn();
|
||||
}
|
||||
},
|
||||
@@ -40,7 +45,7 @@ const LoginNodeDefinition = {
|
||||
displayName: 'Username',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.username = value;
|
||||
}
|
||||
},
|
||||
@@ -48,13 +53,13 @@ const LoginNodeDefinition = {
|
||||
displayName: 'Password',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.password = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setError(err) {
|
||||
setError: function (err) {
|
||||
this._internal.error = err;
|
||||
this.flagOutputDirty('error');
|
||||
this.sendSignalOnOutput('failure');
|
||||
@@ -71,7 +76,9 @@ const LoginNodeDefinition = {
|
||||
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
|
||||
}
|
||||
},
|
||||
scheduleLogIn() {
|
||||
scheduleLogIn: function () {
|
||||
const internal = this._internal;
|
||||
|
||||
if (this.logInScheduled === true) return;
|
||||
this.logInScheduled = true;
|
||||
|
||||
@@ -93,7 +100,89 @@ const LoginNodeDefinition = {
|
||||
}
|
||||
};
|
||||
|
||||
/*function updatePorts(nodeId, parameters, editorConnection, dbCollections) {
|
||||
var ports = [];
|
||||
|
||||
ports.push({
|
||||
name: 'collectionName',
|
||||
displayName: "Class",
|
||||
group: "General",
|
||||
type: { name: 'enum', enums: (dbCollections !== undefined) ? dbCollections.map((c) => { return { value: c.name, label: c.name } }) : [], allowEditOnly: true },
|
||||
plug: 'input'
|
||||
})
|
||||
|
||||
if (parameters.collectionName && dbCollections) {
|
||||
// Fetch ports from collection keys
|
||||
var c = dbCollections.find((c) => c.name === parameters.collectionName);
|
||||
if (c && c.schema && c.schema.properties) {
|
||||
var props = c.schema.properties;
|
||||
for (var key in props) {
|
||||
var p = props[key];
|
||||
if (ports.find((_p) => _p.name === key)) continue;
|
||||
|
||||
if(p.type === 'Relation') {
|
||||
|
||||
}
|
||||
else { // Other schema type ports
|
||||
const _typeMap = {
|
||||
"String":"string",
|
||||
"Boolean":"boolean",
|
||||
"Number":"number",
|
||||
"Date":"date"
|
||||
}
|
||||
|
||||
ports.push({
|
||||
type: {
|
||||
name: _typeMap[p.type]?_typeMap[p.type]:'*',
|
||||
},
|
||||
plug: 'output',
|
||||
group: 'Properties',
|
||||
name: 'prop-' + key,
|
||||
displayName: key,
|
||||
})
|
||||
|
||||
ports.push({
|
||||
type: 'signal',
|
||||
plug: 'output',
|
||||
group: 'Changed Events',
|
||||
displayName: key+ ' Changed',
|
||||
name: 'changed-' + key,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editorConnection.sendDynamicPorts(nodeId, ports);
|
||||
}*/
|
||||
|
||||
module.exports = {
|
||||
node: LoginNodeDefinition,
|
||||
setup(_context, _graphModel) {}
|
||||
setup: function (context, graphModel) {
|
||||
/* if (!context.editorConnection || !context.editorConnection.isRunningLocally()) {
|
||||
return;
|
||||
}
|
||||
|
||||
function _managePortsForNode(node) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('dbCollections'));
|
||||
|
||||
node.on("parameterUpdated", function (event) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('dbCollections'));
|
||||
});
|
||||
|
||||
graphModel.on('metadataChanged.dbCollections', function (data) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, data);
|
||||
})
|
||||
}
|
||||
|
||||
graphModel.on("editorImportComplete", ()=> {
|
||||
graphModel.on("nodeAdded.DbModel2", function (node) {
|
||||
_managePortsForNode(node)
|
||||
})
|
||||
|
||||
for(const node of graphModel.getNodesWithType('DbModel2')) {
|
||||
_managePortsForNode(node)
|
||||
}
|
||||
})*/
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
|
||||
const UserService = require('./userservice');
|
||||
|
||||
const LogOutNodeDefinition = {
|
||||
var LogOutNodeDefinition = {
|
||||
name: 'net.noodl.user.LogOut',
|
||||
docs: 'https://docs.noodl.net/nodes/data/user/log-out',
|
||||
displayNodeName: 'Log Out',
|
||||
category: 'Cloud Services',
|
||||
color: 'data',
|
||||
initialize: function () {
|
||||
var internal = this._internal;
|
||||
},
|
||||
getInspectInfo() {},
|
||||
outputs: {
|
||||
success: {
|
||||
type: 'signal',
|
||||
@@ -23,7 +28,7 @@ const LogOutNodeDefinition = {
|
||||
type: 'string',
|
||||
displayName: 'Error',
|
||||
group: 'Error',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.error;
|
||||
}
|
||||
}
|
||||
@@ -32,13 +37,13 @@ const LogOutNodeDefinition = {
|
||||
login: {
|
||||
displayName: 'Do',
|
||||
group: 'Actions',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this.scheduleLogOut();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setError(err) {
|
||||
setError: function (err) {
|
||||
this._internal.error = err;
|
||||
this.flagOutputDirty('error');
|
||||
this.sendSignalOnOutput('failure');
|
||||
@@ -55,7 +60,9 @@ const LogOutNodeDefinition = {
|
||||
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
|
||||
}
|
||||
},
|
||||
scheduleLogOut() {
|
||||
scheduleLogOut: function () {
|
||||
const internal = this._internal;
|
||||
|
||||
if (this.logOutScheduled === true) return;
|
||||
this.logOutScheduled = true;
|
||||
|
||||
@@ -77,5 +84,5 @@ const LogOutNodeDefinition = {
|
||||
|
||||
module.exports = {
|
||||
node: LogOutNodeDefinition,
|
||||
setup(_context, _graphModel) {}
|
||||
setup: function (context, graphModel) {}
|
||||
};
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
const { Node, EdgeTriggeredInput } = require('@noodl/runtime');
|
||||
const UserService = require('./userservice');
|
||||
|
||||
const SignUpNodeDefinition = {
|
||||
var SignUpNodeDefinition = {
|
||||
name: 'net.noodl.user.SignUp',
|
||||
docs: 'https://docs.noodl.net/nodes/data/user/sign-up',
|
||||
displayNodeName: 'Sign Up',
|
||||
category: 'Cloud Services',
|
||||
color: 'data',
|
||||
initialize() {
|
||||
const internal = this._internal;
|
||||
initialize: function () {
|
||||
var internal = this._internal;
|
||||
|
||||
internal.userProperties = {};
|
||||
},
|
||||
getInspectInfo() {},
|
||||
outputs: {
|
||||
success: {
|
||||
type: 'signal',
|
||||
@@ -27,7 +30,7 @@ const SignUpNodeDefinition = {
|
||||
type: 'string',
|
||||
displayName: 'Error',
|
||||
group: 'Error',
|
||||
getter() {
|
||||
getter: function () {
|
||||
return this._internal.error;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +39,7 @@ const SignUpNodeDefinition = {
|
||||
signup: {
|
||||
displayName: 'Do',
|
||||
group: 'Actions',
|
||||
valueChangedToTrue() {
|
||||
valueChangedToTrue: function () {
|
||||
this.scheduleSignUp();
|
||||
}
|
||||
},
|
||||
@@ -44,7 +47,7 @@ const SignUpNodeDefinition = {
|
||||
displayName: 'Username',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.username = value;
|
||||
}
|
||||
},
|
||||
@@ -52,7 +55,7 @@ const SignUpNodeDefinition = {
|
||||
displayName: 'Password',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.password = value;
|
||||
}
|
||||
},
|
||||
@@ -60,13 +63,13 @@ const SignUpNodeDefinition = {
|
||||
displayName: 'Email',
|
||||
type: 'string',
|
||||
group: 'General',
|
||||
set(value) {
|
||||
set: function (value) {
|
||||
this._internal.email = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setError(err) {
|
||||
setError: function (err) {
|
||||
this._internal.error = err;
|
||||
this.flagOutputDirty('error');
|
||||
this.sendSignalOnOutput('failure');
|
||||
@@ -83,7 +86,7 @@ const SignUpNodeDefinition = {
|
||||
this.context.editorConnection.clearWarning(this.nodeScope.componentOwner.name, this.id, 'user-login-warning');
|
||||
}
|
||||
},
|
||||
scheduleSignUp() {
|
||||
scheduleSignUp: function () {
|
||||
const internal = this._internal;
|
||||
|
||||
if (this.signUpScheduled === true) return;
|
||||
@@ -106,24 +109,23 @@ const SignUpNodeDefinition = {
|
||||
});
|
||||
});
|
||||
},
|
||||
setUserProperty(name, value) {
|
||||
setUserProperty: function (name, value) {
|
||||
this._internal.userProperties[name] = value;
|
||||
},
|
||||
registerInputIfNeeded(name) {
|
||||
registerInputIfNeeded: function (name) {
|
||||
if (this.hasInput(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.startsWith('prop-')) {
|
||||
if (name.startsWith('prop-'))
|
||||
return this.registerInput(name, {
|
||||
set: this.setUserProperty.bind(this, name.substring('prop-'.length))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function updatePorts(nodeId, _parameters, editorConnection, systemCollections) {
|
||||
function updatePorts(nodeId, parameters, editorConnection, systemCollections) {
|
||||
var ports = [];
|
||||
|
||||
if (systemCollections) {
|
||||
@@ -167,7 +169,7 @@ function updatePorts(nodeId, _parameters, editorConnection, systemCollections) {
|
||||
|
||||
module.exports = {
|
||||
node: SignUpNodeDefinition,
|
||||
setup(context, graphModel) {
|
||||
setup: function (context, graphModel) {
|
||||
if (!context.editorConnection || !context.editorConnection.isRunningLocally()) {
|
||||
return;
|
||||
}
|
||||
@@ -175,7 +177,7 @@ module.exports = {
|
||||
function _managePortsForNode(node) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections'));
|
||||
|
||||
node.on('parameterUpdated', function (_event) {
|
||||
node.on('parameterUpdated', function (event) {
|
||||
updatePorts(node.id, node.parameters, context.editorConnection, graphModel.getMetaData('systemCollections'));
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ const ColumnsNode = {
|
||||
]
|
||||
},
|
||||
|
||||
initialize() { this.props.attrs = {};
|
||||
initialize() {
|
||||
this.props.layoutString = '1 2 1';
|
||||
this.props.minWidth = 0;
|
||||
this.props.marginX = 16;
|
||||
@@ -62,16 +62,6 @@ const ColumnsNode = {
|
||||
);
|
||||
}
|
||||
|
||||
this.forceUpdate();
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ const GroupNode = {
|
||||
groupPriority: ['General', 'Style', 'Events', 'Mounted', 'Hover Events', 'Pointer Events', 'Focus', 'Scroll']
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this._internal = {
|
||||
scrollElementDuration: 500,
|
||||
scrollIndexDuration: 500,
|
||||
@@ -144,16 +143,6 @@ const GroupNode = {
|
||||
valueChangedToTrue() {
|
||||
this.context.setNodeFocused(this, true);
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputProps: {
|
||||
|
||||
@@ -27,7 +27,6 @@ const ImageNode = {
|
||||
]
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
this.props.default = '';
|
||||
},
|
||||
getReactComponent() {
|
||||
@@ -87,16 +86,6 @@ const ImageNode = {
|
||||
this.props.dom.src = getAbsoluteUrl(url);
|
||||
this.forceUpdate();
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
},
|
||||
inputProps: {
|
||||
@@ -125,12 +114,6 @@ const ImageNode = {
|
||||
propPath: 'dom',
|
||||
type: 'signal',
|
||||
group: 'Events'
|
||||
},
|
||||
onError: {
|
||||
displayName: 'On Error',
|
||||
propPath: 'dom',
|
||||
type: 'signal',
|
||||
group: 'Events'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,9 +20,6 @@ const TextNode = {
|
||||
nodeDoubleClickAction: {
|
||||
focusPort: 'text'
|
||||
},
|
||||
initialize() {
|
||||
this.props.attrs = {};
|
||||
},
|
||||
getReactComponent() {
|
||||
return Text;
|
||||
},
|
||||
@@ -138,16 +135,6 @@ const TextNode = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
testId: {
|
||||
index: 100009,
|
||||
displayName: 'Test ID Attribute',
|
||||
group: 'Advanced HTML',
|
||||
type: 'string',
|
||||
set(value) {
|
||||
this.props.attrs["data-testid"] = value;
|
||||
this.forceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ export default {
|
||||
group: 'General',
|
||||
plug: 'input',
|
||||
type: 'string',
|
||||
default: 'Fluxscape Viewer',
|
||||
default: 'Noodl Viewer',
|
||||
tooltip: 'The title that web browsers show',
|
||||
ignoreInExport: true
|
||||
},
|
||||
|
||||