Thing Description Playground - BETA Version
- - +
diff --git a/packages/web-new/README.md b/packages/web-new/README.md
index 2f60e13fc..a36bdfb1e 100644
--- a/packages/web-new/README.md
+++ b/packages/web-new/README.md
@@ -22,14 +22,17 @@ This package provides the new web interface of the Web of Things Playground. It
Licensed under the MIT license, see [License](../../LICENSE.md).
+## Icon
+
+Icons used in this project (excluding the TD file icon) are sourced from FontAwesome Free 6.5.1 by @fontawesome - [FontAwesome](https://fontawesome.com).
+License information can be found here: [FontAwesome License](https://fontawesome.com/license/free). Copyright © 2024 Fonticons, Inc.
+
## How to use
- Online: It is hosted [here](http://plugfest.thingweb.io/playground-new/)
- Simply paste a TD or utilize an example from the examples menu and click on validate
- The validation process will then start on the bottom console, where more information will be provided in case of errors or warnings
-## Testing with Playwright
-
## Webpack functionality and bundling
This package is built by utilizing webpack, allowing to bundle and compile the projects JavaScript and CSS files. It also handles asset management and optimization. Below are the steps to understand the current configuration:
@@ -50,27 +53,33 @@ The `webpack.config.js` file is used to set up Webpack for the project. It manag
### 3. Webpack Configuration Obejct
**3.1 Entry Points**
+
- `entry`: Specifies the entry points for your application. In this case, there are two entry points: 'bundle' for JavaScript and 'styles' for CSS
**3.2 Output**
+
- `output`: Specifies where Webpack should output the bundled files. The path property defines the output directory as 'dist', and the filename property determines the naming pattern for generated files. [name] is a placeholder for the entry point name, and [contenthash] is a unique hash based on file content
- `clean`: Tells Webpack to clean the 'dist' directory before each build
- `assetModuleFilename`: Specifies the filename for asset files
**3.3 Development Server**
+
- `devServer`: Configures the development server with settings such as the port, compressing assets, and enabling history API fallback
**3.4 Module Rules**
+
- `module`: Defines rules for how Webpack should process different file types. There are rules for JavaScript, images, CSS, and more. For example, it uses Babel to transpile JavaScript, handles image assets, and processes CSS with style loaders and sass loaders
**3.5 Plugins**
-- `plugins`: Lists the plugins used in the build process. Key plugins include
- - `HtmlWebpackPlugin` for generating HTML files,
- - `CopyWebpackPlugin` for copying assets,
- - `MonacoWebpackPlugin` for the Monaco code editor integration, and
+
+- `plugins`: Lists the plugins used in the build process. Key plugins include
+ - `HtmlWebpackPlugin` for generating HTML files,
+ - `CopyWebpackPlugin` for copying assets,
+ - `MonacoWebpackPlugin` for the Monaco code editor integration, and
- `MiniCssExtractPlugin` for extracting CSS into separate files
**3.6 Optimization**
+
- `optimization`: Contains settings for optimizing the build, including minimizing CSS using `CssMinimizerPlugin`
diff --git a/packages/web-new/src/assets/img/angle-down-solid.svg b/packages/web-new/src/assets/img/angle-down-solid.svg
new file mode 100644
index 000000000..6a3ad1a90
--- /dev/null
+++ b/packages/web-new/src/assets/img/angle-down-solid.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/web-new/src/assets/img/eye-slash-solid.svg b/packages/web-new/src/assets/img/eye-slash-solid.svg
new file mode 100644
index 000000000..f592dabfe
--- /dev/null
+++ b/packages/web-new/src/assets/img/eye-slash-solid.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/web-new/src/assets/img/eye-solid.svg b/packages/web-new/src/assets/img/eye-solid.svg
new file mode 100644
index 000000000..1f07b7f80
--- /dev/null
+++ b/packages/web-new/src/assets/img/eye-solid.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/web-new/src/scripts/aas.js b/packages/web-new/src/scripts/aas.js
index 8401fc29d..f507e8b48 100644
--- a/packages/web-new/src/scripts/aas.js
+++ b/packages/web-new/src/scripts/aas.js
@@ -53,7 +53,7 @@ async function initAASEditor() {
setFontSize(window.AASEditor)
})
- //Bind the reset button form the settings to the editor and assign the specied font size
+ //Bind the reset button form the settings to the editor and assign the specified font size
editorForm.addEventListener("reset", () => {
setFontSize(window.AASEditor)
})
@@ -62,7 +62,7 @@ async function initAASEditor() {
initAASEditor()
-//Donwload btn
+//Download btn
AASDownload.addEventListener("click", () => {
const editorData = getEditorData(window.AASEditor)
const contentType = `application/${editorData[0]};charset=utf-8;`
diff --git a/packages/web-new/src/scripts/async-api.js b/packages/web-new/src/scripts/async-api.js
index 9a1c00fb8..b502ca22c 100644
--- a/packages/web-new/src/scripts/async-api.js
+++ b/packages/web-new/src/scripts/async-api.js
@@ -55,7 +55,7 @@ async function initAsyncApiEditor() {
setFontSize(window.asyncApiEditor)
})
- //Bind the reset button form the settings to the editor and assign the specied font size
+ //Bind the reset button form the settings to the editor and assign the specified font size
editorForm.addEventListener("reset", () => {
setFontSize(window.asyncApiEditor)
})
@@ -77,7 +77,7 @@ asyncApiYamlBtn.addEventListener("click", () => {
asyncApiYamlBtn.disabled = true
})
-//Donwload btn
+//Download btn
asyncApiDownload.addEventListener("click", () => {
const editorData = getEditorData(window.asyncApiEditor)
const contentType = `application/${editorData[0]};charset=utf-8;`
diff --git a/packages/web-new/src/scripts/console.js b/packages/web-new/src/scripts/console.js
index 450314b30..ca46cdb36 100644
--- a/packages/web-new/src/scripts/console.js
+++ b/packages/web-new/src/scripts/console.js
@@ -23,7 +23,7 @@ import { openApiTab, openApiJsonBtn, openApiYamlBtn, openApiView } from './open-
import { asyncApiTab, asyncApiJsonBtn, asyncApiYamlBtn, asyncApiView } from './async-api'
import { AASView } from './aas'
import { defaultsView, defaultsJsonBtn, defaultsYamlBtn, defaultsAddBtn } from './defaults'
-import { visualize, visualizeTab } from './visualize'
+import { visualize } from './visualize'
import { validationView, validationTab } from './validation'
import { convertTDYamlToJson, detectProtocolSchemes } from '../../../core/dist/web-bundle.min.js'
import { generateOAP, generateAAP, addDefaultsUtil, validate, generateAAS, resetValidationStatus } from './util'
@@ -40,40 +40,61 @@ const errorTxt = document.querySelector(".console-error__txt")
export const minMaxBtn = document.querySelector(".min-max")
export const visualizationOptions = document.querySelectorAll(".visualizations__option")
export const visualizationContainers = document.querySelectorAll(".console-view")
-const consoleElement = document.querySelector(".console")
+export const consoleElement = document.querySelector(".console")
const mainContentElement = document.querySelector(".main-content")
-minMaxBtn.addEventListener("click", () => {
+/**
+ * Hides the text from the left control panel, updates the state of the console element
+ * and adjusts the console size as well as the expand/collapse icon
+ * *Collapse arrows gotten from: https://fontawesome.com/icons/down-left-and-up-right-to-center?f=classic&s=solid
+ */
+function expandConsole() {
+ textIcon.forEach(text => {
+ text.classList.add("hiddenV")
+ })
- if (minMaxBtn.children[0].classList.contains("fa-down-left-and-up-right-to-center")) {
- mainContentElement.style.flex = "1 0"
- consoleElement.style.flex = `0 39px`
- minMaxBtn.children[0].classList.remove("fa-down-left-and-up-right-to-center")
- minMaxBtn.children[0].classList.add("fa-up-right-and-down-left-from-center")
+ consoleElement.classList.remove("collapsed")
+ consoleElement.classList.add("expanded")
- textIcon.forEach(text => {
- text.classList.remove("hiddenV")
- })
- } else {
- textIcon.forEach(text => {
- text.classList.add("hiddenV")
- })
+ setTimeout(() => {
+ mainContentElement.style.flex = "0 210px"
+ consoleElement.style.flex = `1 0`
+ minMaxBtn.children[0].children[0].setAttribute("d", "M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H296c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272H216c13.3 0 24 10.7 24 24V440c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z")
+ minMaxBtn.children[0].classList.remove("expand-arrows")
+ minMaxBtn.children[0].classList.add("collapse-arrows")
+ }, 100);
+}
- setTimeout(() => {
- mainContentElement.style.flex = "0 210px"
- consoleElement.style.flex = `1 0`
- minMaxBtn.children[0].classList.add("fa-down-left-and-up-right-to-center")
- minMaxBtn.children[0].classList.remove("fa-up-right-and-down-left-from-center")
+/**
+ * Shows the text from the left control panel, updates the state of the console element
+ * and adjusts the console size as well as the expand/collapse icon
+ * *Expand arrows gotten from: https://fontawesome.com/icons/up-right-and-down-left-from-center?f=classic&s=solid
+ */
+function collapseConsole() {
+ textIcon.forEach(text => {
+ text.classList.remove("hiddenV")
+ })
- if (visualizeTab.checked === true) {
- visualizeTab.click()
- }
- }, 100);
+ consoleElement.classList.remove("expanded")
+ consoleElement.classList.add("collapsed")
+
+ mainContentElement.style.flex = "1 0"
+ consoleElement.style.flex = `0 39px`
+ minMaxBtn.children[0].children[0].setAttribute("d", "M344 0H488c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512H24c-13.3 0-24-10.7-24-24V344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z")
+ minMaxBtn.children[0].classList.add("expand-arrows")
+ minMaxBtn.children[0].classList.remove("collapse-arrows")
+}
+
+minMaxBtn.addEventListener("click", () => {
+ if (consoleElement.classList.contains("expanded")) {
+ collapseConsole()
+ } else {
+ expandConsole()
}
})
/**
- * Unchecks all visualization btns and hides all visualization containers
+ * Unchecks all visualization buttons and hides all visualization containers
*/
export function clearConsole() {
visualizationContainers.forEach(container => {
@@ -104,6 +125,9 @@ function clearVisualizationEditors() {
//Set the behavior for each visualization tab when clicked on it
visualizationOptions.forEach(option => {
option.addEventListener("click", () => {
+ if (consoleElement.classList.contains("collapsed")) {
+ expandConsole()
+ }
clearVisualizationEditors()
visualizationContainers.forEach(container => {
container.classList.add("hidden")
@@ -123,6 +147,7 @@ visualizationOptions.forEach(option => {
} else {
switch (option.id) {
case "open-api-tab":
+
if (fileType === "yaml") {
openApiJsonBtn.disabled = false
openApiYamlBtn.disabled = true
diff --git a/packages/web-new/src/scripts/defaults.js b/packages/web-new/src/scripts/defaults.js
index 183dd7d79..447ffafdd 100644
--- a/packages/web-new/src/scripts/defaults.js
+++ b/packages/web-new/src/scripts/defaults.js
@@ -56,7 +56,7 @@ async function initDefaultsEditor() {
setFontSize(window.defaultsEditor)
})
- //Bind the reset button form the settings to the editor and assign the specied font size
+ //Bind the reset button form the settings to the editor and assign the specified font size
editorForm.addEventListener("reset", () => {
setFontSize(window.defaultsEditor)
})
@@ -92,7 +92,7 @@ defaultsRemoveBtn.addEventListener("click", () => {
defaultsRemoveBtn.disabled = true
})
-//Donwload btn
+//Download btn
defaultsDownload.addEventListener("click", () => {
const editorData = getEditorData(window.defaultsEditor)
const contentType = `application/${editorData[0]};charset=utf-8;`
diff --git a/packages/web-new/src/scripts/editor.js b/packages/web-new/src/scripts/editor.js
index 425d1f393..29a075aa3 100644
--- a/packages/web-new/src/scripts/editor.js
+++ b/packages/web-new/src/scripts/editor.js
@@ -92,29 +92,80 @@ function createTab(tabNumber, exampleName, thingType) {
//Add the close btn element
const closeBtn = document.createElement("div")
closeBtn.classList.add("close-tab")
- //Assign icon to the close btn
- const closeIcon = document.createElement("i")
- closeIcon.classList.add("fa-solid", "fa-xmark")
- closeBtn.appendChild(closeIcon)
+ // Create the svg close icon
+ // Close icon gotten from: https://fontawesome.com/icons/xmark?f=classic&s=solid
+ const closeIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ closeIconSvg.setAttribute("xmlns", "http://www.w3.org/2000/svg")
+ closeIconSvg.setAttribute("width", "100%")
+ closeIconSvg.setAttribute("height", "100%")
+ closeIconSvg.setAttribute("viewBox", "0 0 384 512")
- //Create the close confirmation btns
+ // Create a path element and set its attributes
+ const closeIconPath = document.createElementNS("http://www.w3.org/2000/svg", "path")
+ closeIconPath.setAttribute("d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z")
+
+ //Create and append Font Awesome attribution comment
+ const commentCloseIcon = document.createComment(" !Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc. ")
+ closeIconSvg.appendChild(commentCloseIcon)
+
+ //append the path to the svg and the svg to the button
+ closeIconSvg.appendChild(closeIconPath)
+ closeBtn.appendChild(closeIconSvg)
+
+ //Create the close confirmation buttons
const confirmBtns = document.createElement("div")
confirmBtns.classList.add("confirm-btns", "hidden")
+ //Confirm close button
const confirmTabClose = document.createElement("button")
confirmTabClose.classList.add("confirm-tab-close")
confirmTabClose.textContent = "Close"
- const confirmTabIcon = document.createElement("i")
- confirmTabIcon.classList.add("fa-solid", "fa-check")
- confirmTabClose.appendChild(confirmTabIcon)
+
+ // Create the svg confirm close icon
+ // Check icon gotten from: https://fontawesome.com/icons/check?f=classic&s=solid
+ const confirmIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ confirmIconSvg.setAttribute("xmlns", "http://www.w3.org/2000/svg")
+ confirmIconSvg.setAttribute("width", "100%")
+ confirmIconSvg.setAttribute("height", "100%")
+ confirmIconSvg.setAttribute("viewBox", "0 0 448 512")
+ confirmIconSvg.classList.add("icon")
+
+ // Create a path element and set its attributes
+ const confirmIconPath = document.createElementNS("http://www.w3.org/2000/svg", "path")
+ confirmIconPath.setAttribute("d", "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z")
+
+ //Create and append Font Awesome attribution comment
+ const commentConfirmIcon = document.createComment(" !Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc. ")
+ confirmIconSvg.appendChild(commentConfirmIcon)
+
+ confirmIconSvg.appendChild(confirmIconPath)
+ confirmTabClose.appendChild(confirmIconSvg)
+ //Cancel close button
const cancelTabClose = document.createElement("button")
cancelTabClose.classList.add("cancel-tab-close")
cancelTabClose.textContent = "Cancel"
- const cancelTabIcon = document.createElement("i")
- cancelTabIcon.classList.add("fa-solid", "fa-xmark")
- cancelTabClose.appendChild(cancelTabIcon)
+
+ // Create the svg close cancel icon
+ // Close icon gotten from: https://fontawesome.com/icons/xmark?f=classic&s=solid
+ const cancelIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ cancelIconSvg.setAttribute("xmlns", "http://www.w3.org/2000/svg")
+ cancelIconSvg.setAttribute("width", "100%")
+ cancelIconSvg.setAttribute("height", "100%")
+ cancelIconSvg.setAttribute("viewBox", "0 0 384 512")
+ cancelIconSvg.classList.add("icon")
+
+ // Create a path element and set its attributes
+ const cancelIconPath = document.createElementNS("http://www.w3.org/2000/svg", "path")
+ cancelIconPath.setAttribute("d", "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z")
+
+ //Create and append Font Awesome attribution comment
+ const commentCancelIcon = document.createComment(" !Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc. ")
+ cancelIconSvg.appendChild(commentCancelIcon)
+
+ cancelIconSvg.appendChild(cancelIconPath)
+ cancelTabClose.appendChild(cancelIconSvg)
cancelTabClose.addEventListener("click", () => {
cancelTabClose.parentElement.classList.add("hidden")
@@ -444,7 +495,7 @@ tabsLeftContainer.addEventListener("click", (e) => {
})
/**
- * Find if active editor is json or yaml and change the json/yaml btns respectively
+ * Find if active editor is json or yaml and change the json/yaml buttons respectively
*/
function findFileType() {
editorList.forEach(editor => {
diff --git a/packages/web-new/src/scripts/examples-menu.js b/packages/web-new/src/scripts/examples-menu.js
index 1a00e0f83..aefa3228e 100644
--- a/packages/web-new/src/scripts/examples-menu.js
+++ b/packages/web-new/src/scripts/examples-menu.js
@@ -19,6 +19,7 @@
* as well as filtering them by categories, a search function to find
* specific examples and a use a template example to directly added to an editor where it can be utilized and modified.
* In the future the option to see short snippets of the most important part of the example, might also be implemented.
+ * In the future the option to see short snippets of the most important part of the example, might also be implemented.
*/
import { createIde, ideCount, tabsLeft } from "./editor"
@@ -26,7 +27,7 @@ import { createIde, ideCount, tabsLeft } from "./editor"
/***********************************************************/
/* Examples menu */
/***********************************************************/
-const closeExamples = document.querySelector(".examples-menu-container__close i")
+const closeExamples = document.querySelector(".examples-menu-container__close .x-icon")
const examplesMenu = document.querySelector(".examples-menu")
const examplesBtn = document.querySelector("#examples-btn")
const categorySelect = document.querySelector('#thing-category')
@@ -267,23 +268,24 @@ async function getAllExamples(categoryId, thingType) {
exampleNameIcon.classList.add("example-icon")
// Create an SVG element
- const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg")
- svgElement.setAttribute("xmlns", "http://www.w3.org/2000/svg")
- svgElement.setAttribute("width", "100%")
- svgElement.setAttribute("viewBox", "0 0 351 379")
- svgElement.setAttribute("fill", "none")
+ const tdFileSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ tdFileSvg.setAttribute("xmlns", "http://www.w3.org/2000/svg")
+ tdFileSvg.setAttribute("width", "100%")
+ tdFileSvg.setAttribute("viewBox", "0 0 351 379")
+ tdFileSvg.setAttribute("fill", "none")
// Create a path element and set its attributes
- const pathElement = document.createElementNS("http://www.w3.org/2000/svg", "path")
- pathElement.setAttribute("fill-rule", "evenodd")
- pathElement.setAttribute("clip-rule", "evenodd")
- pathElement.setAttribute("d", "M184 0V95.9981C184 107.044 192.954 115.998 204 115.998H300V190H106C89.4315 190 76 203.431 76 220V379H40C17.9086 379 0 361.091 0 339V40C0 17.9086 17.9086 0 40 0H184ZM204 95.9981V4.28427L295.714 95.9981H204ZM189.758 379V265.724H231.32V243.922H189.758H162.019H121.105V265.724H162.019V379H189.758ZM275.017 379H288.654C297.808 379 306.158 377.485 313.703 374.454C321.311 371.362 327.836 367.001 333.278 361.373C338.783 355.683 343.02 348.88 345.988 340.963C349.019 333.046 350.534 324.295 350.534 314.708V308.307C350.534 298.658 349.019 289.907 345.988 282.052C343.02 274.135 338.783 267.332 333.278 261.642C327.774 255.951 321.249 251.591 313.703 248.561C306.219 245.468 297.963 243.922 288.933 243.922H275.017H258.688H247.185V379H259.245H275.017ZM275.017 357.291H288.654C295.952 357.291 302.106 355.652 307.116 352.374C312.126 349.034 315.899 344.179 318.435 337.809C321.032 331.438 322.331 323.738 322.331 314.708V308.121C322.331 301.194 321.589 295.102 320.104 289.845C318.682 284.588 316.548 280.165 313.703 276.578C310.858 272.991 307.364 270.3 303.22 268.507C299.076 266.651 294.313 265.724 288.933 265.724H275.017V357.291Z")
+ const tdFilePath = document.createElementNS("http://www.w3.org/2000/svg", "path")
+ tdFilePath.setAttribute("fill-rule", "evenodd")
+ tdFilePath.setAttribute("clip-rule", "evenodd")
+ tdFilePath.setAttribute("d", "M184 0V95.9981C184 107.044 192.954 115.998 204 115.998H300V190H106C89.4315 190 76 203.431 76 220V379H40C17.9086 379 0 361.091 0 339V40C0 17.9086 17.9086 0 40 0H184ZM204 95.9981V4.28427L295.714 95.9981H204ZM189.758 379V265.724H231.32V243.922H189.758H162.019H121.105V265.724H162.019V379H189.758ZM275.017 379H288.654C297.808 379 306.158 377.485 313.703 374.454C321.311 371.362 327.836 367.001 333.278 361.373C338.783 355.683 343.02 348.88 345.988 340.963C349.019 333.046 350.534 324.295 350.534 314.708V308.307C350.534 298.658 349.019 289.907 345.988 282.052C343.02 274.135 338.783 267.332 333.278 261.642C327.774 255.951 321.249 251.591 313.703 248.561C306.219 245.468 297.963 243.922 288.933 243.922H275.017H258.688H247.185V379H259.245H275.017ZM275.017 357.291H288.654C295.952 357.291 302.106 355.652 307.116 352.374C312.126 349.034 315.899 344.179 318.435 337.809C321.032 331.438 322.331 323.738 322.331 314.708V308.121C322.331 301.194 321.589 295.102 320.104 289.845C318.682 284.588 316.548 280.165 313.703 276.578C310.858 272.991 307.364 270.3 303.22 268.507C299.076 266.651 294.313 265.724 288.933 265.724H275.017V357.291Z")
// Append the path element to the SVG element
- svgElement.appendChild(pathElement)
+ tdFileSvg.appendChild(tdFilePath)
+
// Append the SVG element to the document body or any other desired location
- exampleNameIcon.appendChild(svgElement);
+ exampleNameIcon.appendChild(tdFileSvg);
// Append the icon container to the name container
exampleName.appendChild(exampleNameIcon)
@@ -292,11 +294,26 @@ async function getAllExamples(categoryId, thingType) {
const exampleNameTitle = document.createElement('p')
exampleNameTitle.innerText = example[1]["title"]
exampleName.appendChild(exampleNameTitle)
-
- // //Create, populate and append the example title toggle arrow
- const exampleNameArrow = document.createElement('i')
- exampleNameArrow.classList.add("fa-solid", "fa-chevron-down", "toggle-arrow")
- exampleName.appendChild(exampleNameArrow)
+
+ //Create, populate and append the example title toggle arrow
+ // Arrow icon gotten from: https://fontawesome.com/icons/angle-down?f=classic&s=solid
+ const exampleArrowSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ exampleArrowSvg.setAttribute("xmlns", "http://www.w3.org/2000/svg")
+ exampleArrowSvg.setAttribute("width", "100%")
+ exampleArrowSvg.setAttribute("height", "100%")
+ exampleArrowSvg.setAttribute("viewBox", "0 0 448 512")
+ exampleArrowSvg.classList.add("icon")
+
+ // Create a path element and set its attributes
+ const exampleArrowPath = document.createElementNS("http://www.w3.org/2000/svg", "path")
+ exampleArrowPath.setAttribute("d", "M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z")
+
+ //Create and append Font Awesome attribution comment
+ const commentExampleArrow = document.createComment(" !Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc. ")
+ exampleArrowSvg.appendChild(commentExampleArrow)
+
+ exampleArrowSvg.appendChild(exampleArrowPath)
+ exampleName.appendChild(exampleArrowSvg)
//Append the whole name component to the header component
exampleHeader.appendChild(exampleName)
@@ -304,14 +321,12 @@ async function getAllExamples(categoryId, thingType) {
//Create the example quick access button
const quickBtn = document.createElement('button')
quickBtn.classList.add("example__header--quick")
- quickBtn.setAttribute("title", "Use")
- const quickButtonIcon = document.createElement('i')
- quickButtonIcon.classList.add("fa-solid", "fa-file-import")
- quickBtn.appendChild(quickButtonIcon)
- exampleHeader.appendChild(quickBtn)
+ quickBtn.setAttribute("title", "Load this example into the editor")
+ quickBtn.innerText = "Load"
+ exampleHeader.appendChild(quickBtn)
- //add event listener to show example information and interaction btns
+ //add event listener to show example information and interaction buttons
exampleName.addEventListener('click', () => {
exampleContainer.classList.toggle("open")
})
@@ -343,12 +358,28 @@ async function getAllExamples(categoryId, thingType) {
exampleBtnUse.classList.add("example__btn--use")
exampleBtns.appendChild(exampleBtnUse)
- const exampleIconUse = document.createElement('i')
- exampleIconUse.classList.add("fa-solid", "fa-file-import")
- exampleBtnUse.appendChild(exampleIconUse)
+ // create the svg icon for the apply button
+ // Apply icon gotten from: https://fontawesome.com/icons/file-import?f=classic&s=solid
+ const applyIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
+ applyIconSvg.setAttribute("xmlns", "http://www.w3.org/2000/svg")
+ applyIconSvg.setAttribute("width", "100%")
+ applyIconSvg.setAttribute("height", "100%")
+ applyIconSvg.setAttribute("viewBox", "0 0 512 512")
+ applyIconSvg.classList.add("icon")
+
+ // Create a path element and set its attributes
+ const applyIconPath = document.createElementNS("http://www.w3.org/2000/svg", "path")
+ applyIconPath.setAttribute("d", "M128 64c0-35.3 28.7-64 64-64H352V128c0 17.7 14.3 32 32 32H512V448c0 35.3-28.7 64-64 64H192c-35.3 0-64-28.7-64-64V336H302.1l-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39H128V64zm0 224v48H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H128zM512 128H384V0L512 128z")
+
+ //Create and append Font Awesome attribution comment
+ const commentApplyIcon = document.createComment(" !Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc. ")
+ applyIconSvg.appendChild(commentApplyIcon)
+
+ applyIconSvg.appendChild(applyIconPath)
+ exampleBtnUse.appendChild(applyIconSvg)
const exampleTxtUse = document.createElement('p')
- exampleTxtUse.innerText = "Apply"
+ exampleTxtUse.innerText = "Load"
exampleBtnUse.appendChild(exampleTxtUse)
const exampleBtnCancel = document.createElement('button')
diff --git a/packages/web-new/src/scripts/json-yaml.js b/packages/web-new/src/scripts/json-yaml.js
index aed32588d..41d73efcf 100644
--- a/packages/web-new/src/scripts/json-yaml.js
+++ b/packages/web-new/src/scripts/json-yaml.js
@@ -16,7 +16,7 @@
/**
* @file The `json-yaml.js` contains the main functionality
* for converting json to yaml and vice versa, utilizing the util's
- * funcions and the editorList array from the editor file.
+ * functions and the editorList array from the editor file.
*/
import { editorList } from './editor.js'
import { generateTD } from './util.js'
@@ -66,7 +66,7 @@ document.addEventListener('click', (e) => {
}
})
-//Confirm the json to yaml convertion
+//Confirm the json to yaml conversion
yamlConfirmBtn.addEventListener("click", () => {
yamlWarning.classList.add('closed')
convertJsonYaml()
diff --git a/packages/web-new/src/scripts/jsonld-vis.js b/packages/web-new/src/scripts/jsonld-vis.js
index dffe043c1..fc22f24ee 100644
--- a/packages/web-new/src/scripts/jsonld-vis.js
+++ b/packages/web-new/src/scripts/jsonld-vis.js
@@ -15,7 +15,7 @@
/**
* @file The `jsonld-vis.js` handles the d3 visualization for the
- * graph option, by utilizin the d3 and d3-tip dependencies
+ * graph option, by utilizing the d3 and d3-tip dependencies
*/
import * as d3 from 'd3'
diff --git a/packages/web-new/src/scripts/main.js b/packages/web-new/src/scripts/main.js
index 601bddd05..5982fd101 100644
--- a/packages/web-new/src/scripts/main.js
+++ b/packages/web-new/src/scripts/main.js
@@ -20,13 +20,13 @@
* to integrate the monaco editor
*/
-import { visualizeTab } from './visualize'
+import './visualize'
import './editor'
import './json-yaml'
import './settings-menu'
import './save-menu'
import './examples-menu'
-import {minMaxBtn} from './console'
+import { consoleElement, minMaxBtn } from './console'
import './open-api'
import './async-api'
import './aas'
@@ -165,12 +165,13 @@ function onmousemoveY(e) {
b.style.flex = `0 ${h < 50 ? 39 : h}px`
t.style.flex = "1 0"
- if(h > 38){
- minMaxBtn.children[0].classList.add("fa-down-left-and-up-right-to-center")
- minMaxBtn.children[0].classList.remove("fa-up-right-and-down-left-from-center")
- }else{
- minMaxBtn.children[0].classList.remove("fa-down-left-and-up-right-to-center")
- minMaxBtn.children[0].classList.add("fa-up-right-and-down-left-from-center")
+ if (h < 39) {
+ consoleElement.classList.remove("expanded")
+ consoleElement.classList.add("collapsed")
+
+ minMaxBtn.children[0].children[0].setAttribute("d", "M344 0H488c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512H24c-13.3 0-24-10.7-24-24V344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z")
+ minMaxBtn.children[0].classList.add("expand-arrows")
+ minMaxBtn.children[0].classList.remove("collapse-arrows")
}
if (h < 445) {
@@ -185,12 +186,13 @@ function onmousemoveY(e) {
t.style.flex = `0 ${h < 220 ? 210 : h}px`
b.style.flex = "1 0"
- if(h < 714){
- minMaxBtn.children[0].classList.add("fa-down-left-and-up-right-to-center")
- minMaxBtn.children[0].classList.remove("fa-up-right-and-down-left-from-center")
- }else{
- minMaxBtn.children[0].classList.remove("fa-down-left-and-up-right-to-center")
- minMaxBtn.children[0].classList.add("fa-up-right-and-down-left-from-center")
+ if (h > 714) {
+ consoleElement.classList.remove("collapsed")
+ consoleElement.classList.add("expanded")
+
+ minMaxBtn.children[0].children[0].setAttribute("d", "M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H296c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272H216c13.3 0 24 10.7 24 24V440c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z")
+ minMaxBtn.children[0].classList.remove("expand-arrows")
+ minMaxBtn.children[0].classList.add("collapse-arrows")
}
if (h < 310) {
@@ -212,8 +214,4 @@ function onmouseupY(e) {
document.removeEventListener("mousemove", onmousemoveY)
document.removeEventListener("mouseup", onmouseupY)
delete e.clientY
-
- if(visualizeTab.checked === true){
- visualizeTab.click()
- }
}
diff --git a/packages/web-new/src/scripts/open-api.js b/packages/web-new/src/scripts/open-api.js
index dde078683..7377a2903 100644
--- a/packages/web-new/src/scripts/open-api.js
+++ b/packages/web-new/src/scripts/open-api.js
@@ -55,7 +55,7 @@ async function initOpenApiEditor() {
setFontSize(window.openApiEditor)
})
- //Bind the reset button form the settings to the editor and assign the specied font size
+ //Bind the reset button form the settings to the editor and assign the specified font size
editorForm.addEventListener("reset", () => {
setFontSize(window.openApiEditor)
})
@@ -77,7 +77,7 @@ openApiYamlBtn.addEventListener("click", () => {
openApiYamlBtn.disabled = true
})
-//Donwload btn
+//Download btn
openApiDownload.addEventListener("click", () => {
const editorData = getEditorData(window.openApiEditor)
const contentType = `application/${editorData[0]};charset=utf-8;`
diff --git a/packages/web-new/src/scripts/save-menu.js b/packages/web-new/src/scripts/save-menu.js
index b50a90f77..e883b3c4d 100644
--- a/packages/web-new/src/scripts/save-menu.js
+++ b/packages/web-new/src/scripts/save-menu.js
@@ -28,7 +28,7 @@ import { editorList, getEditorData } from "./editor"
/***********************************************************/
const saveMenu = document.querySelector(".save-menu")
const saveMenuBtn = document.querySelector("#save-btn")
-const closeSaveMenu = document.querySelector(".save-menu-close i")
+const closeSaveMenu = document.querySelector(".save-menu-close .x-icon")
const shareUrlContainer = document.querySelector("#share-url-input")
const openUrlTab = document.querySelector("#open-url-tab")
const thingTypeText = document.querySelector('#thing-type-text')
@@ -228,7 +228,7 @@ async function saveFileInSystem(content) {
// }
//TODO IMPORT FROM FILES
-/** Experimental file manager fucntion*/
+/** Experimental file manager function*/
// const visualizeView = document.querySelector("#visualize-view p")
// async function getFile() {
// // Open file picker and destructure the result the first handle
diff --git a/packages/web-new/src/scripts/settings-menu.js b/packages/web-new/src/scripts/settings-menu.js
index aca8141b0..b3863fa89 100644
--- a/packages/web-new/src/scripts/settings-menu.js
+++ b/packages/web-new/src/scripts/settings-menu.js
@@ -26,7 +26,7 @@ import themeData from './monochrome-theme'
/***********************************************************/
/* Settings menu */
/***********************************************************/
-const closeSettings = document.querySelector(".settings__close i");
+const closeSettings = document.querySelector(".settings__close .x-icon");
const settingsMenu = document.querySelector(".settings-menu");
const settingsBtn = document.querySelector("#settings-btn");
export const editorForm = document.querySelector(".settings__editor")
@@ -68,7 +68,7 @@ document.addEventListener('click', (e) => {
})
/**
- * Event listener for reseting all the settings and preferences values
+ * Event listener for resetting all the settings and preferences values
* @param {event} e - reset event
*/
editorForm.addEventListener("reset", (e) => {
@@ -83,7 +83,7 @@ editorForm.addEventListener("reset", (e) => {
storeFontSize(fontSizeSlider.value)
setMonacoTheme(themePicker.value)
- //resetting all toggle btns
+ //resetting all toggle buttons
autoValidateBtn.checked = false
validateJSONLDBtn.checked = true
tmConformanceBtn.checked = true
@@ -113,7 +113,7 @@ fontSizeSlider.addEventListener("input", () => {
/***********************************************************/
/**
- * Store the selected themek in the localStorage
+ * Store the selected theme in the localStorage
* @param {String} theme - the name of the theme
*/
function storeTheme(theme) {
diff --git a/packages/web-new/src/scripts/util.js b/packages/web-new/src/scripts/util.js
index 7e9b72531..48ebf8620 100644
--- a/packages/web-new/src/scripts/util.js
+++ b/packages/web-new/src/scripts/util.js
@@ -221,6 +221,10 @@ export function removeDefaultsUtil(editorInstance) {
* @param {string} body Thing Description/Thing Model to validate
* @param {string} docType "td" or "tm"
* @param {*} source "manual" or "auto"
+ * *Neutral circle icon gotten from: https://fontawesome.com/icons/circle?f=classic&s=solid
+ * *Success circle icon gotten from: https://fontawesome.com/icons/circle-check?f=classic&s=solid
+ * *Warning circle icon gotten from: https://fontawesome.com/icons/circle-exclamation?f=classic&s=solid
+ * *Error circle icon gotten from: https://fontawesome.com/icons/circle-xmark?f=classic&s=solid
*/
export function validate(thingType, editorContent) {
@@ -233,26 +237,28 @@ export function validate(thingType, editorContent) {
validator(editorContent, log, { checkDefaults: true, checkJsonLd, checkTmConformance })
.then(result => {
- // console.log(result)
Object.keys(result.report).forEach(el => {
const spotName = "spot-" + el
document.getElementById(spotName).removeAttribute('open')
- const resultIcon = document.getElementById(spotName).children[0].children[0]
+ const resultIcon = document.getElementById(spotName).children[0].children[0].children[0]
+
if (result.report[el] === "passed") {
- resultIcon.classList.remove("fa-circle")
- resultIcon.classList.add("fa-circle-check")
+ resultIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z")
+ resultIcon.classList.remove("neutral-circle-icon")
+ resultIcon.classList.add("success-circle-icon")
}
else if (result.report[el] === "warning") {
- resultIcon.classList.remove("fa-circle")
- resultIcon.classList.add("fa-circle-exclamation")
-
+ resultIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z")
+ resultIcon.classList.remove("neutral-circle-icon")
+ resultIcon.classList.add("warning-circle-icon")
}
else if (result.report[el] === "failed") {
- resultIcon.classList.remove("fa-circle")
- resultIcon.classList.add("fa-circle-xmark")
+ resultIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z")
+ resultIcon.classList.remove("neutral-circle-icon")
+ resultIcon.classList.add("error-circle-icon")
}
else if (result.report[el] === null) {
- //do nothing
+ // do nothing
}
else {
console.error("unknown report feedback value")
@@ -263,22 +269,25 @@ export function validate(thingType, editorContent) {
const detailsName = el + "-section"
if (document.getElementById(detailsName)) {
document.getElementById(detailsName).removeAttribute('open')
- const detailsIcon = document.getElementById(detailsName).children[0].children[0]
+ const detailsIcon = document.getElementById(detailsName).children[0].children[0].children[0]
if (result.details[el] === "passed") {
- detailsIcon.classList.remove("fa-circle")
- detailsIcon.classList.add("fa-circle-check")
+ detailsIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z")
+ detailsIcon.classList.remove("neutral-circle-icon")
+ detailsIcon.classList.add("success-circle-icon")
}
else if (result.details[el] === "warning" || result.details[el] === "not-impl") {
- detailsIcon.classList.remove("fa-circle")
- detailsIcon.classList.add("fa-circle-exclamation")
+ detailsIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z")
+ detailsIcon.classList.remove("neutral-circle-icon")
+ detailsIcon.classList.add("warning-circle-icon")
}
else if (result.details[el] === "failed") {
- detailsIcon.classList.remove("fa-circle")
- detailsIcon.classList.add("fa-circle-xmark")
+ detailsIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z")
+ detailsIcon.classList.remove("neutral-circle-icon")
+ detailsIcon.classList.add("error-circle-icon")
}
else if (result.details[el] === null) {
- //do nothing
+ // do nothing
}
else {
console.error("unknown report feedback value")
@@ -309,10 +318,12 @@ export function resetValidationStatus() {
}
sectionHeaders.forEach(header => {
- const headerIcon = header.children[0]
- if (!headerIcon.classList.contains("fa-circle")) {
- headerIcon.classList.remove("fa-circle-check", "fa-circle-exclamation", "fa-circle-xmark")
- headerIcon.classList.add("fa-circle")
+ const headerIcon = header.children[0].children[0]
+
+ if(!headerIcon.classList.contains("neutral-circle-icon")){
+ headerIcon.children[0].setAttribute("d", "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z")
+ headerIcon.classList.remove("success-circle-icon", "warning-circle-icon", "error-circle-icon")
+ headerIcon.classList.add("neutral-circle-icon")
}
})
@@ -344,7 +355,10 @@ function populateCategory(messagesList) {
document.querySelectorAll("#spot-json, #spot-schema, #spot-defaults, #spot-jsonld, #spot-additional").forEach(category => {
const categoryContainer = category.querySelector("ul.section-content")
category.classList.remove("disabled")
- if (category.children[0].children[0].classList.contains("fa-circle-xmark") || category.children[0].children[0].classList.contains("fa-circle-exclamation")) {
+
+ const categoryIcon = category.children[0].children[0].children[0]
+
+ if (categoryIcon.classList.contains("error-circle-icon") || categoryIcon.classList.contains("warning-circle-icon")) {
const noticePrompt = document.createElement("p")
noticePrompt.textContent = "*This feature is still in the testing phase, and it may not refer to the correct source of the error*"
noticePrompt.classList.add("notice-prompt")
@@ -354,11 +368,13 @@ function populateCategory(messagesList) {
listElement.textContent = message
categoryContainer.append(listElement)
})
- } else if (category.children[0].children[0].classList.contains("fa-circle-check")) {
+ }
+ else if (categoryIcon.classList.contains("success-circle-icon")) {
const successMessage = document.createElement("li")
successMessage.textContent = "Validated Successfully"
categoryContainer.append(successMessage)
- } else {
+ }
+ else {
const nullMessage = document.createElement("li")
nullMessage.textContent = "A previous validation has failed or it is only available for Thing Descriptions"
categoryContainer.append(nullMessage)
diff --git a/packages/web-new/src/scripts/vega-vis.js b/packages/web-new/src/scripts/vega-vis.js
index 9cbc28a4b..021559773 100644
--- a/packages/web-new/src/scripts/vega-vis.js
+++ b/packages/web-new/src/scripts/vega-vis.js
@@ -15,13 +15,13 @@
/**
* @file The `vega-vis.js` handles the vega visualization for the
- * tree option, by utilizin the vega and vega-embed dependencies
+ * tree option, by utilizing the vega and vega-embed dependencies
*/
import vegaEmbed from 'vega-embed'
/**
- * Initialize and generat the Vega visualization by passing the container element and the td content
+ * Initialize and generate the Vega visualization by passing the container element and the td content
* @param { html element } visContainer - Html container for the svg visualization
* @param { json object } td - Json object from the current editor
*/
diff --git a/packages/web-new/src/scripts/visualize.js b/packages/web-new/src/scripts/visualize.js
index 1de3be7aa..f04d25153 100644
--- a/packages/web-new/src/scripts/visualize.js
+++ b/packages/web-new/src/scripts/visualize.js
@@ -54,7 +54,8 @@ export function visualize(editorValue) {
treeInputs.classList.add("hidden")
//Run the jsonld visualization
jsonldVis(editorValue, "#visualized", {
- h: document.getElementById("visualize-container").offsetHeight - 30,
+ // h: document.getElementById("visualize-container").offsetHeight - 30,
+ h: 450,
w: document.getElementById("visualize-container").offsetWidth - 20,
maxLabelWidth: 200,
scalingFactor: 5,
diff --git a/packages/web-new/src/styles/_console.scss b/packages/web-new/src/styles/_console.scss
index a7222ec62..89ada27fe 100644
--- a/packages/web-new/src/styles/_console.scss
+++ b/packages/web-new/src/styles/_console.scss
@@ -39,12 +39,24 @@
appearance: none;
border: none;
background-color: transparent;
- color: var(--clr-primary-500);
- transition: color 250ms ease;
+ cursor: pointer;
+
+ .icon {
+ display: inline-block;
+ fill: var(--clr-primary-500);
+ height: var(--fs-i);
+ width: fit-content;
+ transition: fill 250ms ease;
+ }
&:hover {
- color: var(--clr-primary-700);
- cursor: pointer;
+ .icon {
+ fill: var(--clr-primary-700);
+ }
+ }
+
+ .hidden {
+ display: none;
}
}
}
@@ -99,7 +111,7 @@
content: 'Visualize';
}
- &:hover{
+ &:hover {
background-color: var(--clr-primary-500);
color: var(--clr-neutral-50);
}
@@ -189,6 +201,9 @@
.show-icon {
transform: rotate(0);
transition: transform 250ms ease-in-out;
+ cursor: pointer;
+ height: var(--fs-footer);
+ fill: var(--clr-neutral-900);
}
}
@@ -199,24 +214,40 @@
gap: 1rem;
cursor: pointer;
- .fa-circle-check {
- color: var(--clr-success-500);
+ .icon {
+ width: fit-content;
+ display: block;
+
+ &.hidden {
+ display: none;
+ }
}
- .fa-circle-exclamation {
- color: var(--clr-warning-500);
+ .show-icon {
+ width: var(--fs-footer);
}
- .fa-circle-xmark {
- color: var(--clr-error-500);
+ .neutral-circle-icon,
+ .success-circle-icon,
+ .warning-circle-icon,
+ .error-circle-icon {
+ height: var(--fs-i);
}
- .fa-circle {
- color: var(--clr-neutral-300);
+ .neutral-circle-icon {
+ fill: var(--clr-neutral-300);
}
- .show-icon {
- cursor: pointer;
+ .success-circle-icon {
+ fill: var(--clr-success-500);
+ }
+
+ .warning-circle-icon {
+ fill: var(--clr-warning-500);
+ }
+
+ .error-circle-icon {
+ fill: var(--clr-error-500);
}
.title {
@@ -256,7 +287,7 @@
summary {
.show-icon {
- transform: rotate(-90deg);
+ transform: rotate(90deg);
}
}
}
@@ -268,7 +299,7 @@
summary {
.show-icon {
- transform: rotate(-90deg);
+ transform: rotate(90deg);
}
}
}
@@ -345,6 +376,11 @@
align-items: center;
gap: 1rem;
+ .icon {
+ fill: var(--clr-neutral-50);
+ width: var(--fs-i);
+ }
+
&:hover {
background-color: var(--clr-primary-900);
}
@@ -388,10 +424,6 @@
align-items: center;
justify-content: center;
gap: 1rem;
-
- i {
- font-size: var(--fs-p);
- }
}
}
}
@@ -541,17 +573,19 @@
&::before {
position: absolute;
- content: '\f06e';
- display: inline-block;
- text-rendering: auto;
- -webkit-font-smoothing: antialiased;
- font: var(--fa-font-solid);
- font-size: var(--fs-p);
- color: var(--clr-neutral-50);
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- transition: all 500ms ease-in-out;
+ content: '';
+ -webkit-mask: url('../assets/img/eye-solid.svg') no-repeat 50% 50%;
+ mask: url('../assets/img/eye-solid.svg') no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
+ display: inline-block;
+ height: calc(var(--fs-i) - .2rem);
+ width: var(--fs-i);
+ pointer-events: none;
+ background-color: var(--clr-neutral-50);
}
&:hover {
@@ -562,7 +596,9 @@
input[type="checkbox"]:checked {
&::before {
- content: '\f070';
+ -webkit-mask: url('../assets/img/eye-slash-solid.svg') no-repeat 50% 50%;
+ mask: url('../assets/img/eye-slash-solid.svg') no-repeat 50% 50%;
+ height: var(--fs-i);
}
}
@@ -606,6 +642,7 @@
color: var(--clr-neutral-50);
font-size: var(--fs-p);
font-family: var(--ff-primary);
+ font-weight: var(--fw-bold);
padding: .75rem 1rem;
border: none;
cursor: pointer;
@@ -630,6 +667,7 @@
color: var(--clr-neutral-50);
padding: .75rem 1.5rem;
justify-content: center;
+ font-weight: var(--fw-bold);
cursor: pointer;
input[type='radio'] {
diff --git a/packages/web-new/src/styles/_control-panel.scss b/packages/web-new/src/styles/_control-panel.scss
index 058695a1b..5ce141f58 100644
--- a/packages/web-new/src/styles/_control-panel.scss
+++ b/packages/web-new/src/styles/_control-panel.scss
@@ -35,7 +35,7 @@
border-bottom: 2px solid var(--clr-primary-500);
font-family: var(--ff-primary);
cursor: pointer;
- transition: all 250ms ease;
+ transition: all 250ms ease-in-out;
&:last-child {
border-color: var(--clr-neutral-50);
@@ -48,10 +48,16 @@
&:hover {
color: var(--clr-neutral-50);
background-color: var(--clr-primary-500);
+
+ .icon {
+ fill: var(--clr-neutral-50);
+ }
}
- i {
- font-size: var(--fs-i);
+ .icon {
+ height: var(--fs-i);
+ fill: var(--clr-primary-500);
+ transition: fill 250ms ease-in-out;
}
p {
diff --git a/packages/web-new/src/styles/_editor.scss b/packages/web-new/src/styles/_editor.scss
index 7121e283d..f396aa69b 100644
--- a/packages/web-new/src/styles/_editor.scss
+++ b/packages/web-new/src/styles/_editor.scss
@@ -47,7 +47,7 @@
white-space: nowrap;
cursor: pointer;
- span{
+ span {
font-size: 1rem;
font-weight: bold;
margin-right: 1rem;
@@ -57,10 +57,6 @@
font-weight: var(--fw-bold);
}
- i {
- font-size: var(--fs-p);
- }
-
&.active {
background-color: var(--clr-neutral-50);
color: var(--clr-neutral-900);
@@ -88,16 +84,22 @@
padding-right: 3rem;
min-width: 17rem;
- .tab-icon{
+ .tab-icon {
font-size: 1rem;
width: fit-content;
color: var(--clr-td-300);
}
- &.active{
- .tab-icon{
+ &.active {
+ .tab-icon {
color: var(--clr-td-500);
}
+
+ .close-tab {
+ svg {
+ fill: var(--clr-neutral-900);
+ }
+ }
}
.close-tab {
@@ -114,35 +116,42 @@
display: flex;
align-items: center;
justify-content: center;
- transition: all 250ms ease-in-out;
+ transition: background-color 250ms ease-in-out;
+
+ svg {
+ pointer-events: none;
+ height: 1.3rem;
+ fill: var(--clr-neutral-300);
+ transition: fill 250ms ease-in-out;
+ }
&:hover {
background-color: var(--clr-neutral-200);
- }
- i {
- pointer-events: none;
- font-size: 1.4rem;
- height: 1.3rem;
+ svg {
+ fill: var(--clr-neutral-900);
+ }
}
}
- .confirm-btns{
+ .confirm-btns {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
+ padding: .5rem 1rem;
background-color: var(--clr-neutral-50);
display: flex;
align-items: center;
justify-content: center;
- gap: 1rem;
+ gap: .5rem;
opacity: 1;
pointer-events: all;
transition: opacity 250ms ease-in-out;
- button{
+ button {
+ flex: 1;
display: flex;
align-items: center;
justify-content: center;
@@ -158,29 +167,32 @@
padding: .25rem 1rem;
transition: background-color 250ms ease-in-out;
- i{
+ .icon {
order: -1;
+ height: var(--fs-p);
+ width: fit-content;
+ fill: var(--clr-neutral-50);
}
- &.confirm-tab-close{
+ &.confirm-tab-close {
background-color: var(--clr-success-500);
- &:hover{
+ &:hover {
background-color: var(--clr-success-700);
}
}
-
- &.cancel-tab-close{
+
+ &.cancel-tab-close {
background-color: var(--clr-error-700);
- &:hover{
+ &:hover {
background-color: var(--clr-error-900);
}
}
}
- &.hidden{
+ &.hidden {
opacity: 0;
pointer-events: none;
}
@@ -189,18 +201,28 @@
li:last-child {
min-width: 3.5rem;
- transition: all 250ms ease-in-out;
+ transition: background-color 250ms ease-in-out;
+
+ .icon {
+ height: var(--fs-p);
+ fill: var(--clr-neutral-300);
+ transition: fill 250ms ease-in-out;
+ }
- &:hover{
+ &:hover {
background-color: var(--clr-neutral-50);
- color: var(--clr-neutral-900);
+
+ .icon {
+ fill: var(--clr-neutral-900);
+ }
}
}
}
- &__right{
+ &__right {
height: 100%;
- input[type=radio]{
+
+ input[type=radio] {
appearance: none;
width: 6rem;
height: 100%;
@@ -215,7 +237,7 @@
overflow: hidden;
transition: all 250ms ease-in-out;
- &::before{
+ &::before {
width: 100%;
height: 100%;
display: flex;
@@ -223,16 +245,16 @@
justify-content: center;
}
- &:nth-child(1)::before{
+ &:nth-child(1)::before {
content: 'JSON';
}
- &:nth-child(2)::before{
+ &:nth-child(2)::before {
content: 'YAML';
}
}
- input[type=radio]:checked{
+ input[type=radio]:checked {
background-color: var(--clr-neutral-50);
color: var(--clr-neutral-900);
}
@@ -244,7 +266,7 @@
pointer-events: none;
width: 0;
height: 0;
- opacity: 0;
+ opacity: 0;
}
.editor.active {
diff --git a/packages/web-new/src/styles/_examples-menu.scss b/packages/web-new/src/styles/_examples-menu.scss
index 1e751d698..08cc3758c 100644
--- a/packages/web-new/src/styles/_examples-menu.scss
+++ b/packages/web-new/src/styles/_examples-menu.scss
@@ -45,9 +45,11 @@
width: 100%;
text-align: right;
- i {
- font-size: var(--fs-sub-header);
+ .icon {
+ width: var(--fs-sub-header);
+ height: var(--fs-sub-header);
cursor: pointer;
+ fill: var(--clr-neutral-900);
}
}
@@ -158,15 +160,18 @@
top: 50%;
right: 2rem;
transform: translateY(-50%);
+ content: '';
+ -webkit-mask: url('../assets/img/angle-down-solid.svg') no-repeat 50% 50%;
+ mask: url('../assets/img/angle-down-solid.svg') no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
display: inline-block;
- text-rendering: auto;
- -webkit-font-smoothing: antialiased;
- font: var(--fa-font-solid);
- content: "\f107";
+ height: 1.25rem;
+ width: 1.25rem;
pointer-events: none;
- color: var(--clr-neutral-900);
- font-size: var(--fs-p);
+ background-color: var(--clr-neutral-300);
}
+
}
select,
@@ -216,12 +221,13 @@
background-color: var(--clr-neutral-50);
color: var(--clr-neutral-900);
font-family: var(--ff-primary);
- font-size: inherit;
+ font-size: var(--fs-p);
- i {
- width: fit-content;
+ .icon {
+ height: var(--fs-p);
+ width: calc(var(--fs-p) + 2.5rem);
padding: 0 1rem;
- font-size: inherit;
+ fill: var(--clr-neutral-300);
}
.search-input {
@@ -231,7 +237,7 @@
font-size: inherit;
border: none;
width: 100%;
- padding: .8rem 1rem;
+ padding: .8rem 1rem .8rem 0;
appearance: none;
cursor: text;
@@ -328,7 +334,6 @@
padding: .75rem;
box-shadow: 0px 0px 5px 0px var(--clr-shadow);
transition: box-shadow 250ms ease-in-out;
- position: relative;
&__header {
display: flex;
@@ -360,62 +365,41 @@
font-weight: var(--fw-bold);
}
- .toggle-arrow {
- font-size: var(--fs-footer);
+ .icon {
+ fill: var(--clr-neutral-900);
+ width: var(--fs-footer);
transform: rotate(0);
transition: transform 250ms ease-in-out 250ms;
}
}
&--quick {
- opacity: 0;
- position: absolute;
- top: .25rem;
- right: .25rem;
- width: 4rem;
- height: 4rem;
- border-radius: 50%;
- background-color: var(--clr-neutral-50);
+ font-size: var(--fs-p);
+ font-weight: var(--fw-bold);
+ color: var(--clr-neutral-50);
+ background-color: var(--clr-neutral-100);
border: none;
+ border-radius: 5px;
+ padding: .5rem 1rem;
cursor: pointer;
- transition: background-color 250ms ease-in-out, opacity 250ms ease-in-out;
-
- i {
- font-size: var(--fs-i);
- color: var(--clr-neutral-50);
- transition: color 250ms ease-in-out;
- }
+ height: 3rem;
+ transition: background-color 250ms ease-in-out;
}
}
&:hover {
box-shadow: 0px 0px 10px 0px var(--clr-shadow);
-
.example__header {
-
&--quick {
-
- opacity: 1;
-
- i {
- color: var(--clr-neutral-300);
- }
+ background-color: var(--clr-neutral-300);
&:hover {
- background-color: var(--clr-neutral-100);
-
- i {
- color: var(--clr-neutral-900);
- }
+ background-color: var(--clr-primary-700);
}
}
}
}
- &:hover{
- box-shadow: 0px 0px 10px 0px var(--clr-shadow);
- }
-
&__content {
pointer-events: none;
display: flex;
@@ -463,9 +447,10 @@
font-weight: var(--fw-bold);
}
- i {
+ .icon {
margin-right: 1rem;
- font-size: var(--fs-p);
+ width: var(--fs-p);
+ fill: var(--clr-neutral-50);
}
}
@@ -497,8 +482,8 @@
.example__header {
&--name {
- .toggle-arrow {
- transform: rotate(-90deg);
+ .icon {
+ transform: rotate(-180deg);
transition: transform 250ms ease-in-out 0s;
}
}
diff --git a/packages/web-new/src/styles/_json-yaml-warning.scss b/packages/web-new/src/styles/_json-yaml-warning.scss
index bfe3f952d..d502a8374 100644
--- a/packages/web-new/src/styles/_json-yaml-warning.scss
+++ b/packages/web-new/src/styles/_json-yaml-warning.scss
@@ -59,7 +59,6 @@
font-weight: var(--fw-bold);
font-family: var(--ff-primary);
color: var(--clr-neutral-50);
- // color: var(--clr-neutral-900);
transition: background-color 250ms ease-in-out;
}
.confirm-btn{
diff --git a/packages/web-new/src/styles/_save-menu.scss b/packages/web-new/src/styles/_save-menu.scss
index 6ba36307b..f43d2e3c5 100644
--- a/packages/web-new/src/styles/_save-menu.scss
+++ b/packages/web-new/src/styles/_save-menu.scss
@@ -39,9 +39,11 @@
text-align: right;
margin-bottom: 2rem;
- i{
- font-size: var(--fs-sub-header);
+ .icon {
+ height: var(--fs-sub-header);
+ width: var(--fs-sub-header);
cursor: pointer;
+ fill: var(--clr-neutral-900);
}
}
@@ -101,8 +103,6 @@
height: 4rem;
width: fit-content;
background-color: var(--clr-neutral-200);
- color: var(--clr-neutral-50);
- font-size: var(--fs-p);
padding: 1rem;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
@@ -110,6 +110,12 @@
cursor: pointer;
transition: background-color 250ms ease-in-out;
+ .icon {
+ fill: var(--clr-neutral-50);
+ height: var(--fs-i);
+ width: var(--fs-i);
+ }
+
&:hover{
background-color: var(--clr-neutral-300);
}
@@ -125,6 +131,10 @@
cursor: pointer;
font-weight: var(--fw-bold);
transition: all 250ms ease-in-out;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 1rem;
&.share-url{
margin-bottom: 1rem;
@@ -132,8 +142,11 @@
color: var(--clr-neutral-50);
border: none;
transition: background-color 250ms ease-in-out;
- i{
- margin-right: 1rem;
+
+ .icon {
+ // height: var(--fs-i);
+ width: var(--fs-i);
+ fill: var(--clr-neutral-50);
}
&:hover{
@@ -169,6 +182,10 @@
& > *{
flex: 1;
height: 4rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 1rem;
border-radius: 5px;
border: none;
color: var(--clr-neutral-50);
@@ -188,8 +205,10 @@
}
}
- i{
- margin-right: 1rem;
+ .icon {
+ height: var(--fs-i);
+ width: var(--fs-i);
+ fill: var(--clr-neutral-50);
}
&:hover{
diff --git a/packages/web-new/src/styles/_settings-menu.scss b/packages/web-new/src/styles/_settings-menu.scss
index 575060dd4..9f75d6dba 100644
--- a/packages/web-new/src/styles/_settings-menu.scss
+++ b/packages/web-new/src/styles/_settings-menu.scss
@@ -40,8 +40,10 @@
text-align: right;
margin-bottom: 2rem;
- i {
- font-size: var(--fs-sub-header);
+ .icon {
+ height: var(--fs-sub-header);
+ width: var(--fs-sub-header);
+ fill: var(--clr-neutral-50);
cursor: pointer;
}
}
@@ -143,14 +145,16 @@
top: 50%;
right: 1rem;
transform: translateY(-50%);
+ content: '';
+ -webkit-mask: url('../assets/img/angle-down-solid.svg') no-repeat 50% 50%;
+ mask: url('../assets/img/angle-down-solid.svg') no-repeat 50% 50%;
+ -webkit-mask-size: cover;
+ mask-size: cover;
display: inline-block;
- text-rendering: auto;
- -webkit-font-smoothing: antialiased;
- font: var(--fa-font-solid);
- content: "\f107";
+ height: var(--fs-footer);
+ width: var(--fs-footer);
pointer-events: none;
- color: var(--clr-neutral-900);
- font-size: var(--fs-footer);
+ background-color: var(--clr-neutral-900);
}
}
diff --git a/packages/web-new/src/styles/styles.scss b/packages/web-new/src/styles/styles.scss
index 62f07f081..e09417da8 100644
--- a/packages/web-new/src/styles/styles.scss
+++ b/packages/web-new/src/styles/styles.scss
@@ -188,10 +188,6 @@ a {
font-weight: var(--fw-regular);
}
-i {
- font-size: var(--fs-i);
-}
-
ul {
list-style: none;
}
@@ -270,7 +266,7 @@ header {
&__links {
display: flex;
align-items: center;
- justify-content: center;
+ justify-content: space-between;
gap: 3rem;
a {
@@ -279,16 +275,22 @@ header {
align-items: center;
justify-content: center;
font-size: var(--fs-p);
- transition: color 250ms ease;
+ transition: color 250ms ease-in-out;
&:hover {
color: var(--clr-neutral-200);
+
+ .icon {
+ fill: var(--clr-neutral-200);
+ }
}
}
- i {
- font-size: var(--fs-i);
+ .icon {
+ height: var(--fs-i);
margin-bottom: .5rem;
+ fill: var(--clr-neutral-50);
+ transition: fill 250ms ease-in-out;
}
}
}
diff --git a/packages/web-new/src/template.html b/packages/web-new/src/template.html
index 4a7e0bec1..1048c84c3 100644
--- a/packages/web-new/src/template.html
+++ b/packages/web-new/src/template.html
@@ -25,10 +25,9 @@
-
-
-
-
+
@@ -166,17 +165,45 @@