From cfc122b64b3475b0c291f90bccb5335ba6558a2d Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sun, 8 Oct 2023 14:18:54 +0530 Subject: [PATCH 01/20] Create SECURITY.md --- SECURITY.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..6d23902 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,3 @@ +# Reporting Security Issues + +Please report any security issue to chinchang457@gmail.com From 5952919396e68bebb3092747e1d900bbf5360e35 Mon Sep 17 00:00:00 2001 From: Nick Hogle Date: Wed, 11 Oct 2023 15:26:52 -0700 Subject: [PATCH 02/20] Fix showErrors() method of CodeEditor component - This was causing WebMaker to throw the following error whenever the showErrors() method was called, preventing the desired behavior of showing the errors in the CodeMirror gutter: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'instance') --- src/components/CodeEditor.jsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/components/CodeEditor.jsx b/src/components/CodeEditor.jsx index 1e74c67..125348d 100644 --- a/src/components/CodeEditor.jsx +++ b/src/components/CodeEditor.jsx @@ -187,8 +187,9 @@ export default class CodeEditor extends Component { showErrors(errors) { if (this.props.type === 'codemirror') { - errors.forEach(function(error) { - this.instance.operation(function() { + const editor = this.instance; + errors.forEach(function (error) { + editor.operation(function () { var n = document.createElement('div'); n.setAttribute('data-title', error.message); n.classList.add('gutter-error-marker'); @@ -235,11 +236,11 @@ export default class CodeEditor extends Component { if (!monacoDepsDeferred) { monacoDepsDeferred = deferred(); loadCss({ url: 'lib/monaco/monaco.css', id: 'monaco-css' }); - import(/* webpackChunkName: "monaco" */ '../lib/monaco/monaco.bundle.js').then( - () => { - monacoDepsDeferred.resolve(); - } - ); + import( + /* webpackChunkName: "monaco" */ '../lib/monaco/monaco.bundle.js' + ).then(() => { + monacoDepsDeferred.resolve(); + }); } return monacoDepsDeferred.promise; } @@ -311,23 +312,23 @@ export default class CodeEditor extends Component { // cursorScrollMargin: '20', has issue with scrolling profile: options.profile || '', extraKeys: { - Up: function(editor) { + Up: function (editor) { // Stop up/down keys default behavior when saveditempane is open // if (isSavedItemsPaneOpen) { // return; // } CodeMirror.commands.goLineUp(editor); }, - Down: function(editor) { + Down: function (editor) { // if (isSavedItemsPaneOpen) { // return; // } CodeMirror.commands.goLineDown(editor); }, - 'Shift-Tab': function(editor) { + 'Shift-Tab': function (editor) { CodeMirror.commands.indentAuto(editor); }, - 'Shift-Ctrl-F': function(editor) { + 'Shift-Ctrl-F': function (editor) { if (options.prettier) { prettify({ content: editor.getValue(), @@ -336,7 +337,7 @@ export default class CodeEditor extends Component { } trackEvent('ui', 'prettifyKeyboardShortcut'); }, - Tab: function(editor) { + Tab: function (editor) { if (options.emmet) { const didEmmetWork = editor.execCommand( 'emmetExpandAbbreviation' From d6e7cd3a8ece160aded73fa1993a94a5102fa3e0 Mon Sep 17 00:00:00 2001 From: Nick Hogle Date: Wed, 11 Oct 2023 16:19:45 -0700 Subject: [PATCH 03/20] Fix issue 546: Tab key not working in JS editor when using CodeMirror - The check for the Emmet option was short-circuiting the logic for inserting a Tab. Note that the emmet option is only enabled on HTML and CSS editors, (and not the JS editor), which is why the `Tab` key works in those editors, but not the JS editor. --- src/components/CodeEditor.jsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/CodeEditor.jsx b/src/components/CodeEditor.jsx index 1e74c67..d496246 100644 --- a/src/components/CodeEditor.jsx +++ b/src/components/CodeEditor.jsx @@ -344,18 +344,18 @@ export default class CodeEditor extends Component { if (didEmmetWork === true) { return; } - const input = $('[data-setting=indentWith]:checked'); - if ( - !editor.somethingSelected() && - (!prefs.indentWith || prefs.indentWith === 'spaces') - ) { - // softtabs adds spaces. This is required because by default tab key will put tab, but we want - // to indent with spaces if `spaces` is preferred mode of indentation. - // `somethingSelected` needs to be checked otherwise, all selected code is replaced with softtab. - CodeMirror.commands.insertSoftTab(editor); - } else { - CodeMirror.commands.defaultTab(editor); - } + } + const input = $('[data-setting=indentWith]:checked'); + if ( + !editor.somethingSelected() && + (!prefs.indentWith || prefs.indentWith === 'spaces') + ) { + // softtabs adds spaces. This is required because by default tab key will put tab, but we want + // to indent with spaces if `spaces` is preferred mode of indentation. + // `somethingSelected` needs to be checked otherwise, all selected code is replaced with softtab. + CodeMirror.commands.insertSoftTab(editor); + } else { + CodeMirror.commands.defaultTab(editor); } }, Enter: 'emmetInsertLineBreak' From 6ba1cdb0f390e67d2399767d2e3445e69acc88e6 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Thu, 12 Oct 2023 14:57:57 +0530 Subject: [PATCH 04/20] move tailwind 3 to JS lib --- src/libraryList.js | 50 ++++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/src/libraryList.js b/src/libraryList.js index 5fa6182..e04f412 100644 --- a/src/libraryList.js +++ b/src/libraryList.js @@ -10,14 +10,12 @@ export const jsLibs = [ type: 'js' }, { - url: - 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', + url: 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', label: 'Bootstrap 4', type: 'js' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/js/foundation.min.js', + url: 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/js/foundation.min.js', label: 'Foundation', type: 'js' }, @@ -32,14 +30,12 @@ export const jsLibs = [ type: 'js' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js', + url: 'https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js', label: 'React', type: 'js' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js', + url: 'https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js', label: 'React DOM', type: 'js' }, @@ -74,7 +70,7 @@ export const jsLibs = [ type: 'js' }, { - url:'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.16.19/js/uikit.min.js', + url: 'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.16.19/js/uikit.min.js', label: 'UIkit 3', type: 'js' }, @@ -84,14 +80,12 @@ export const jsLibs = [ type: 'js' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js', + url: 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js', label: 'p5.js DOM', type: 'js' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.sound.min.js', + url: 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.sound.min.js', label: 'p5.js Sound', type: 'js' }, @@ -99,24 +93,26 @@ export const jsLibs = [ url: 'https://unpkg.com/rxjs/bundles/rxjs.umd.min.js', label: 'RxJS', type: 'js' + }, + { + url: 'https://cdn.tailwindcss.com/3.3.1', + label: 'Tailwind 3', + type: 'js' } ]; export const cssLibs = [ { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css', + url: 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css', label: 'Bootstrap 5', type: 'css' }, { - url: - 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css', + url: 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css', label: 'Bootstrap 4', type: 'css' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/css/foundation.min.css', + url: 'https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/css/foundation.min.css', label: 'Foundation', type: 'css' }, @@ -141,27 +137,19 @@ export const cssLibs = [ label: 'Tailwind 2', type: 'css' }, + { - url: - 'https://cdn.tailwindcss.com/3.3.1', - label: 'Tailwind 3', - type: 'css' - }, - { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.16.19/css/uikit.min.css', + url: 'https://cdnjs.cloudflare.com/ajax/libs/uikit/3.16.19/css/uikit.min.css', label: 'UIkit 3', type: 'css' }, { - url: - 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css', + url: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css', label: 'Animate.css', type: 'css' }, { - url: - 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', + url: 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', label: 'FontAwesome 4', type: 'css' }, From 250a15a60042bbe4870d0c05f745e556503ee5b9 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Thu, 12 Oct 2023 20:14:26 +0530 Subject: [PATCH 05/20] fix library not updating #530 --- src/components/AddLibrary.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/AddLibrary.jsx b/src/components/AddLibrary.jsx index dc6e58c..669879a 100644 --- a/src/components/AddLibrary.jsx +++ b/src/components/AddLibrary.jsx @@ -37,19 +37,23 @@ export default class AddLibrary extends Component { } textareaBlurHandler(e, textarea) { const target = e ? e.target : textarea; + const data = { js: this.state.js, css: this.state.css }; + const type = target.dataset.lang; if (type === 'js') { + data.js = target.value || ''; this.setState({ - js: target.value || '' + js: data.js }); } else { + data.css = target.value || ''; this.setState({ - css: target.value || '' + css: data.css }); } // trackEvent('ui', 'addLibrarySelect', target.selectedOptions[0].label); - this.props.onChange({ js: this.state.js, css: this.state.css }); + this.props.onChange(data); } suggestionSelectHandler(value) { const textarea = value.match(/\.js$/) From f249d34f2f3961c2f76c54007d14d5468ce1ff13 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Fri, 13 Oct 2023 16:18:50 +0530 Subject: [PATCH 06/20] add pointer cursor to footer btn n links --- src/style.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/style.css b/src/style.css index 14ca869..1116b2f 100644 --- a/src/style.css +++ b/src/style.css @@ -571,7 +571,9 @@ body:not(.light-version).overlay-visible .main-container { overflow: hidden; position: relative; background: var(--color-bg); - transition: height 0.3s ease, width 0.3s ease; + transition: + height 0.3s ease, + width 0.3s ease; will-change: height; } @@ -891,6 +893,10 @@ body > #demo-frame { .footer button:hover svg { fill: rgba(255, 255, 255, 0.6); } +.footer a, +.footer button { + cursor: pointer; +} .mode-btn svg { width: 24px; From d7c127de70f67445b65433875cc29335f63902b7 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Fri, 13 Oct 2023 17:30:15 +0530 Subject: [PATCH 07/20] retain console open state on refreshes. fixes #435 --- src/components/ContentWrap.jsx | 9 +++++++-- src/components/app.jsx | 5 +---- src/constants.js | 5 +++++ 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 src/constants.js diff --git a/src/components/ContentWrap.jsx b/src/components/ContentWrap.jsx index 462d564..2ec2452 100644 --- a/src/components/ContentWrap.jsx +++ b/src/components/ContentWrap.jsx @@ -15,6 +15,7 @@ import { Console } from './Console'; import CssSettingsModal from './CssSettingsModal'; import { PreviewDimension } from './PreviewDimension.jsx'; import Modal from './Modal.jsx'; +import { LocalStorageKeys } from '../constants.js'; const minCodeWrapSize = 33; /* global htmlCodeEl @@ -24,7 +25,9 @@ export default class ContentWrap extends Component { constructor(props) { super(props); this.state = { - isConsoleOpen: false, + isConsoleOpen: + window.localStorage.getItem(LocalStorageKeys.WAS_CONSOLE_OPEN) === + 'true', isCssSettingsModalOpen: false, isPreviewNotWorkingModalVisible: false, logs: [] @@ -574,8 +577,10 @@ export default class ContentWrap extends Component { } toggleConsole() { - this.setState({ isConsoleOpen: !this.state.isConsoleOpen }); + const newValue = !this.state.isConsoleOpen; + this.setState({ isConsoleOpen: newValue }); trackEvent('ui', 'consoleToggle'); + window.localStorage.setItem(LocalStorageKeys.WAS_CONSOLE_OPEN, newValue); } consoleHeaderDblClickHandler(e) { if (!e.target.classList.contains('js-console__header')) { diff --git a/src/components/app.jsx b/src/components/app.jsx index 71bac5d..42ca747 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -68,15 +68,12 @@ import { import { commandPaletteService } from '../commandPaletteService'; import { I18nProvider } from '@lingui/react'; +import { LocalStorageKeys } from '../constants.js'; if (module.hot) { require('preact/debug'); } -const LocalStorageKeys = { - LOGIN_AND_SAVE_MESSAGE_SEEN: 'loginAndsaveMessageSeen', - ASKED_TO_IMPORT_CREATIONS: 'askedToImportCreations' -}; const UNSAVED_WARNING_COUNT = 15; const version = '5.0.3'; diff --git a/src/constants.js b/src/constants.js new file mode 100644 index 0000000..cb7da2f --- /dev/null +++ b/src/constants.js @@ -0,0 +1,5 @@ +export const LocalStorageKeys = { + LOGIN_AND_SAVE_MESSAGE_SEEN: 'loginAndsaveMessageSeen', + ASKED_TO_IMPORT_CREATIONS: 'askedToImportCreations', + WAS_CONSOLE_OPEN: 'wasConsoleOpen' +}; From 691b890d4c1671863fe974eb747aefe839c6ecc7 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Fri, 13 Oct 2023 17:56:06 +0530 Subject: [PATCH 08/20] add changelog --- src/components/Notifications.jsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/Notifications.jsx b/src/components/Notifications.jsx index 58622e3..596b6bf 100644 --- a/src/components/Notifications.jsx +++ b/src/components/Notifications.jsx @@ -114,6 +114,23 @@ export function Notifications(props) { return (

Whats new?

+ + + Console's open state is preserved across refreshes. + + + Error highlighting fixed in JS pane when using Codemirror editor. + Thanks + + + + Tab key not working in JS pane is fixed. Thanks + + + + 3rd party libraries not updating is fixed. + +
  • ⬆️ Popular libraries updated to latest versions. Thanks From e0a7134a497cf49246ac21483fa2996c31f8995b Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Fri, 13 Oct 2023 17:57:29 +0530 Subject: [PATCH 09/20] typo --- src/components/Notifications.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Notifications.jsx b/src/components/Notifications.jsx index 596b6bf..cc891e3 100644 --- a/src/components/Notifications.jsx +++ b/src/components/Notifications.jsx @@ -128,7 +128,7 @@ export function Notifications(props) { - 3rd party libraries not updating is fixed. + 3rd party libraries not updating sometimes is fixed. From ae6f327dda8f260fc778578e6683f655957aaa89 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Fri, 13 Oct 2023 18:06:09 +0530 Subject: [PATCH 10/20] bump to 5.1.0 --- package.json | 2 +- src/components/app.jsx | 2 +- src/manifest.json | 2 +- src/options.html | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 21ae94c..712b579 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "web-maker", - "version": "5.0.3", + "version": "5.1.0", "description": "A blazing fast & offline web playground", "scripts": { "start": "concurrently --kill-others \"gulp start-preview-server\" \"npm run -s dev\"", diff --git a/src/components/app.jsx b/src/components/app.jsx index 42ca747..2538a08 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -75,7 +75,7 @@ if (module.hot) { } const UNSAVED_WARNING_COUNT = 15; -const version = '5.0.3'; +const version = '5.1.0'; // Read forced settings as query parameters window.forcedSettings = {}; diff --git a/src/manifest.json b/src/manifest.json index 32bab93..ec1ab77 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "Web Maker", - "version": "5.0.3", + "version": "5.1.0", "manifest_version": 2, "description": "Blazing fast & offline playground for your web experiments", "homepage_url": "https://webmaker.app", diff --git a/src/options.html b/src/options.html index 09135e6..f8736d5 100644 --- a/src/options.html +++ b/src/options.html @@ -1,4 +1,4 @@ - + Settings - Web Maker @@ -35,7 +35,7 @@

    Settings - v5.0.3 + v5.1.0