From ace344fddd4e40c34d1ccebdf984bc6eee887e27 Mon Sep 17 00:00:00 2001 From: Marcel Folaron Date: Mon, 2 Dec 2024 09:35:11 -0500 Subject: [PATCH] js refactor --- .babelrc | 3 - ...arController.js => calendarController.mjs} | 2 + .../Templates/showMyCalendar.blade.php | 88 +- app/Domain/Dashboard/Templates/home.blade.php | 16 +- .../includes/projectSelector.blade.php | 2 +- package-lock.json | 18 + package.json | 1 + public/assets/css/components/nav.css | 786 +++++++++--------- public/assets/js/app/app.js | 10 +- .../js/app/components/editors.module.mjs | 2 - public/assets/js/app/core/bootstrap.mjs | 2 +- public/assets/js/app/core/componentConfig.mjs | 2 +- public/assets/js/app/core/componentLoader.mjs | 2 +- public/assets/js/app/core/moduleLoader.mjs | 22 +- webpack.mix.js | 38 +- 15 files changed, 500 insertions(+), 494 deletions(-) delete mode 100644 .babelrc rename app/Domain/Calendar/Js/{calendarController.js => calendarController.mjs} (99%) diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 514f1ad398..0000000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "sourceType": "script" -} diff --git a/app/Domain/Calendar/Js/calendarController.js b/app/Domain/Calendar/Js/calendarController.mjs similarity index 99% rename from app/Domain/Calendar/Js/calendarController.js rename to app/Domain/Calendar/Js/calendarController.mjs index 563760b4ce..55ab4e6935 100644 --- a/app/Domain/Calendar/Js/calendarController.js +++ b/app/Domain/Calendar/Js/calendarController.mjs @@ -571,3 +571,5 @@ export const calendarController = { initEventDatepickers: initEventDatepickers, initWidgetCalendar: initWidgetCalendar }; + +export default calendarController; diff --git a/app/Domain/Calendar/Templates/showMyCalendar.blade.php b/app/Domain/Calendar/Templates/showMyCalendar.blade.php index d952ee1491..0e8e771653 100644 --- a/app/Domain/Calendar/Templates/showMyCalendar.blade.php +++ b/app/Domain/Calendar/Templates/showMyCalendar.blade.php @@ -130,48 +130,46 @@ class="right" diff --git a/app/Domain/Dashboard/Templates/home.blade.php b/app/Domain/Dashboard/Templates/home.blade.php index 5467bb6a8b..62613e3bc0 100644 --- a/app/Domain/Dashboard/Templates/home.blade.php +++ b/app/Domain/Dashboard/Templates/home.blade.php @@ -38,23 +38,19 @@ @endsection diff --git a/app/Domain/Menu/Templates/includes/projectSelector.blade.php b/app/Domain/Menu/Templates/includes/projectSelector.blade.php index 196f1a99f7..941eeb3991 100644 --- a/app/Domain/Menu/Templates/includes/projectSelector.blade.php +++ b/app/Domain/Menu/Templates/includes/projectSelector.blade.php @@ -20,7 +20,7 @@ class="bigProjectSelector {{ $menuType == 'project' ? 'active' : '' }}" -
+
@include('menu::includes.projectSelectorDropdown', [])
diff --git a/package-lock.json b/package-lock.json index 46032bffd5..250d49a063 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,6 +70,7 @@ }, "devDependencies": { "@babel/eslint-parser": "^7.22.15", + "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.26.0", "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e", @@ -584,6 +585,23 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", + "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", diff --git a/package.json b/package.json index bba52d0e88..f2403603cd 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ }, "devDependencies": { "@babel/eslint-parser": "^7.22.15", + "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.26.0", "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e", diff --git a/public/assets/css/components/nav.css b/public/assets/css/components/nav.css index 4b9c21eb29..6e56d04791 100644 --- a/public/assets/css/components/nav.css +++ b/public/assets/css/components/nav.css @@ -24,65 +24,65 @@ line-height: 12px; } -.headmenu .project-selector { - padding: 10px 15px 20px 15px; - position: relative; - -} - -.headmenu .project-selector label { - display: block; - clear: both; - float: none; - padding-top: 0; - font-weight:lighter; - /*font-family: 'RobotoLight', 'Helvetica Neue', Helvetica, sans-serif;*/ - font-size: var(--font-size-l); -} - -.headmenu .project-selector .chzn-container { - width: 100% !important; - display: block; -} - -.headmenu .project-selector .chzn-container .chzn-single { - color: #555; -} - -.headmenu .project-selector .chzn-container .chzn-results li { - color: #555; -} - -.headmenu .project-selector .chzn-container .chzn-results li.highlighted { - color: var(--nav-link-color); -} - -.headmenu .project-selector .chzn-container .chzn-drop { - width: 100% !important; -} - -.headmenu .projectselector .projectListFilter { - border-bottom:1px solid var(--main-border-color); - padding:0px 15px; -} - -.projectListFilter .fa { - vertical-align: middle; -} - -.headmenu .projectselector .projectListFilter select{ - border-color:var(--secondary-background); - box-shadow:none; - max-width: 135px; - margin-top: 6px; - margin-bottom: 6px; - margin-right: 10px; - padding-left: 0px; -} - -.headmenu .projectselector .projectListFilter select:hover { - border-color:var(--main-border-color); -} +/*.headmenu .project-selector {*/ +/* padding: 10px 15px 20px 15px;*/ +/* position: relative;*/ + +/*}*/ + +/*.headmenu .project-selector label {*/ +/* display: block;*/ +/* clear: both;*/ +/* float: none;*/ +/* padding-top: 0;*/ +/* font-weight:lighter;*/ +/* !*font-family: 'RobotoLight', 'Helvetica Neue', Helvetica, sans-serif;*!*/ +/* font-size: var(--font-size-l);*/ +/*}*/ + +/*.headmenu .project-selector .chzn-container {*/ +/* width: 100% !important;*/ +/* display: block;*/ +/*}*/ + +/*.headmenu .project-selector .chzn-container .chzn-single {*/ +/* color: #555;*/ +/*}*/ + +/*.headmenu .project-selector .chzn-container .chzn-results li {*/ +/* color: #555;*/ +/*}*/ + +/*.headmenu .project-selector .chzn-container .chzn-results li.highlighted {*/ +/* color: var(--nav-link-color);*/ +/*}*/ + +/*.headmenu .project-selector .chzn-container .chzn-drop {*/ +/* width: 100% !important;*/ +/*}*/ + +/*.headmenu .projectselector .projectListFilter {*/ +/* border-bottom:1px solid var(--main-border-color);*/ +/* padding:0px 15px;*/ +/*}*/ + +/*.projectListFilter .fa {*/ +/* vertical-align: middle;*/ +/*}*/ + +/*.headmenu .projectselector .projectListFilter select{*/ +/* border-color:var(--secondary-background);*/ +/* box-shadow:none;*/ +/* max-width: 135px;*/ +/* margin-top: 6px;*/ +/* margin-bottom: 6px;*/ +/* margin-right: 10px;*/ +/* padding-left: 0px;*/ +/*}*/ + +/*.headmenu .projectselector .projectListFilter select:hover {*/ +/* border-color:var(--main-border-color);*/ +/*}*/ .logo { width: 170px; @@ -192,60 +192,60 @@ a.barmenu:hover { min-width:415px; } */ -.headmenu .projectselector li.intro { - color:var(--primary-font-color); - padding:10px 15px 20px 15px; -} - -.headmenu .projectselector li.intro .title { - font-size: var(--font-size-l); -} - -.headmenu .projectselector li.intro .sub { - - color: var(--secondary-font-color); -} - -.headmenu .projectselector li.intro a { - display:inline; - padding:0; - margin:auto; -} - -.headmenu .projectselector li.intro a:hover { - background:var(--secondary-background); - color:var(--secondary-action-color); - -} - -.headmenu .projectselector > li a:hover { - color:var(--dropdown-link-hover-color); -} - -.headmenu .projectselector li.nav-header { - display: block; - padding: 3px 15px; - - font-weight: bold; - line-height: 20px; - color: var(--secondary-font-color); - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - text-transform: uppercase; - background:var(--secondary-background); -} - -.headmenu .projectselector li.nav-header.border { - border-top:1px solid var(--neutral); - border-bottom:0; - padding-top: 10px; -} - -.headmenu .projectselector li span.info { - color:var(--primary-font-color); - padding: 10px 15px; - display: block; - margin-bottom: 15px; -} +/*.headmenu .projectselector li.intro {*/ +/* color:var(--primary-font-color);*/ +/* padding:10px 15px 20px 15px;*/ +/*}*/ + +/*.headmenu .projectselector li.intro .title {*/ +/* font-size: var(--font-size-l);*/ +/*}*/ + +/*.headmenu .projectselector li.intro .sub {*/ + +/* color: var(--secondary-font-color);*/ +/*}*/ + +/*.headmenu .projectselector li.intro a {*/ +/* display:inline;*/ +/* padding:0;*/ +/* margin:auto;*/ +/*}*/ + +/*.headmenu .projectselector li.intro a:hover {*/ +/* background:var(--secondary-background);*/ +/* color:var(--secondary-action-color);*/ + +/*}*/ + +/*.headmenu .projectselector > li a:hover {*/ +/* color:var(--dropdown-link-hover-color);*/ +/*}*/ + +/*.headmenu .projectselector li.nav-header {*/ +/* display: block;*/ +/* padding: 3px 15px;*/ + +/* font-weight: bold;*/ +/* line-height: 20px;*/ +/* color: var(--secondary-font-color);*/ +/* text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);*/ +/* text-transform: uppercase;*/ +/* background:var(--secondary-background);*/ +/*}*/ + +/*.headmenu .projectselector li.nav-header.border {*/ +/* border-top:1px solid var(--neutral);*/ +/* border-bottom:0;*/ +/* padding-top: 10px;*/ +/*}*/ + +/*.headmenu .projectselector li span.info {*/ +/* color:var(--primary-font-color);*/ +/* padding: 10px 15px;*/ +/* display: block;*/ +/* margin-bottom: 15px;*/ +/*}*/ .leftmenu .nav-tabs.nav-stacked .dropdown ul li.active a { @@ -258,34 +258,34 @@ a.barmenu:hover { color: var(--nav-link-color); } -.headmenu .project-selector .chzn-container a { - padding: 0 20px; -} - -.projectselector .projectAvatar { - width:30px; - height:30px; - font-size:14px; - line-height:30px; - text-align:center; - background:var(--primary-font-color); - color:var(--main-action-color); - display:inline-block; - border-radius:var(--box-radius-small); - background:var(--element-gradient); -} - -.headmenu .projectselector .projectAvatar img { - width:30px; - height:30px; - border-radius:var(--box-radius-small); -} - -.headmenu .projectselector .projectAvatar .fa { - font-weight:900; - color: var(--header-nav-link-color); - margin-right:0; -} +/*.headmenu .project-selector .chzn-container a {*/ +/* padding: 0 20px;*/ +/*}*/ + +/*.projectselector .projectAvatar {*/ +/* width:30px;*/ +/* height:30px;*/ +/* font-size:14px;*/ +/* line-height:30px;*/ +/* text-align:center;*/ +/* background:var(--primary-font-color);*/ +/* color:var(--main-action-color);*/ +/* display:inline-block;*/ +/* border-radius:var(--box-radius-small);*/ +/* background:var(--element-gradient);*/ +/*}*/ + +/*.headmenu .projectselector .projectAvatar img {*/ +/* width:30px;*/ +/* height:30px;*/ +/* border-radius:var(--box-radius-small);*/ +/*}*/ + +/*.headmenu .projectselector .projectAvatar .fa {*/ +/* font-weight:900;*/ +/* color: var(--header-nav-link-color);*/ +/* margin-right:0;*/ +/*}*/ .leftmenu .nav-tabs.nav-stacked a { color: #555; @@ -551,31 +551,31 @@ a.barmenu:hover { padding-left: 0; } -.leftmenu .nav-tabs.nav-stacked.collapsedMenu .bigProjectSelector { - display: block; - font-weight: normal; - font-size: var(--font-size-l); - padding:0; - line-height: 46px; - height: 51px; - width: 68px; - border-bottom:1px solid var(--neutral); - text-align: center; - color: var(--project-selector-color); - background: var(--project-selector-bg); -} - -.leftmenu .nav-tabs.nav-stacked.collapsedMenu .bigProjectSelector:hover { - background: var(--project-selector-hover-bg); - color: var(--project-selector-hover-color); -} - -.leftmenu .nav-tabs.nav-stacked.collapsedMenu .bigProjectSelector i.fa { - - padding-left: 0; - float: none; - margin-top: 0; -} +/*.leftmenu .nav-tabs.nav-stacked.collapsedMenu .bigProjectSelector {*/ +/* display: block;*/ +/* font-weight: normal;*/ +/* font-size: var(--font-size-l);*/ +/* padding:0;*/ +/* line-height: 46px;*/ +/* height: 51px;*/ +/* width: 68px;*/ +/* border-bottom:1px solid var(--neutral);*/ +/* text-align: center;*/ +/* color: var(--project-selector-color);*/ +/* background: var(--project-selector-bg);*/ +/*}*/ + +/*.leftmenu .nav-tabs.nav-stacked.collapsedMenu .bigProjectSelector:hover {*/ +/* background: var(--project-selector-hover-bg);*/ +/* color: var(--project-selector-hover-color);*/ +/*}*/ + +/*.leftmenu .nav-tabs.nav-stacked.collapsedMenu .bigProjectSelector i.fa {*/ + +/* padding-left: 0;*/ +/* float: none;*/ +/* margin-top: 0;*/ +/*}*/ .leftmenu .nav-tabs.nav-stacked.collapsedMenu .fixedMenuPoint { width:68px; @@ -586,242 +586,242 @@ a.barmenu:hover { -.leftmenu .projectselector::after { - position: absolute; - top: 30px; - left: -9px; - transform: rotate(-90deg); - display: inline-block; - border-right: 6px solid transparent; - border-bottom: 6px solid white; - border-left: 6px solid transparent; - content: ''; -} +/*.leftmenu .projectselector::after {*/ +/* position: absolute;*/ +/* top: 30px;*/ +/* left: -9px;*/ +/* transform: rotate(-90deg);*/ +/* display: inline-block;*/ +/* border-right: 6px solid transparent;*/ +/* border-bottom: 6px solid white;*/ +/* border-left: 6px solid transparent;*/ +/* content: '';*/ +/*}*/ -.projectselector { -} +/*.projectselector {*/ +/*}*/ -.projectselector .projectSelectorFooter { - border-top:1px solid var(--main-border-color); -} +/*.projectselector .projectSelectorFooter {*/ +/* border-top:1px solid var(--main-border-color);*/ +/*}*/ -.projectselector .projectSelectorFooter li a { - display: block; - padding-left: 15px; -} +/*.projectselector .projectSelectorFooter li a {*/ +/* display: block;*/ +/* padding-left: 15px;*/ +/*}*/ -.projectselector li a{ - color:var(--primary-font-color); +/*.projectselector li a{*/ +/* color:var(--primary-font-color);*/ - margin: 0; - padding: 10px 20px; -} +/* margin: 0;*/ +/* padding: 10px 20px;*/ +/*}*/ -.projectselector li.active > a { - background-image:none; - background:var(--main-menu-link-active-bg); - color:var(--main-menu-link-active-color); - font-weight:bold; -} +/*.projectselector li.active > a {*/ +/* background-image:none;*/ +/* background:var(--main-menu-link-active-bg);*/ +/* color:var(--main-menu-link-active-color);*/ +/* font-weight:bold;*/ +/*}*/ -.headmenu .projectselector .head { - padding:15px; - color:var(--primary-font-color); -} +/*.headmenu .projectselector .head {*/ +/* padding:15px;*/ +/* color:var(--primary-font-color);*/ +/*}*/ -.headmenu .projectselector .head .searchBar { - float: right; - padding-top: 5px; -} +/*.headmenu .projectselector .head .searchBar {*/ +/* float: right;*/ +/* padding-top: 5px;*/ +/*}*/ -.headmenu .projectselector .head .title { - font-size: var(--font-size-xxl); -} +/*.headmenu .projectselector .head .title {*/ +/* font-size: var(--font-size-xxl);*/ +/*}*/ -/* Project Selection Tabs and container */ -.projectselector ul.tabs { +/*!* Project Selection Tabs and container *!*/ +/*.projectselector ul.tabs {*/ -} -.projectselector ul.tabs li a { - padding: 0 15px; - margin-left: 0px; -} +/*}*/ +/*.projectselector ul.tabs li a {*/ +/* padding: 0 15px;*/ +/* margin-left: 0px;*/ +/*}*/ -.projectselector .ui-tabs-panel { - padding:0; -} +/*.projectselector .ui-tabs-panel {*/ +/* padding:0;*/ +/*}*/ -.projectselector .scrollingTab { - padding:0; - height:calc(100vh - 310px); - overflow:auto; -} +/*.projectselector .scrollingTab {*/ +/* padding:0;*/ +/* height:calc(100vh - 310px);*/ +/* overflow:auto;*/ +/*}*/ -/* Project Selection Lists */ -.projectselector ul.selectorList { - padding-top:3px; - padding-left: 0; -} +/*!* Project Selection Lists *!*/ +/*.projectselector ul.selectorList {*/ +/* padding-top:3px;*/ +/* padding-left: 0;*/ +/*}*/ -.projectselector ul.selectorList.last { - padding-left:0; -} +/*.projectselector ul.selectorList.last {*/ +/* padding-left:0;*/ +/*}*/ -.projectselector ul.selectorList li{ - display:block; - padding:0; - list-style-type: none; - position:relative; - cursor:pointer; -} - -.projectselector ul.selectorList li.nav-header { - border-color:transparent; +/*.projectselector ul.selectorList li{*/ +/* display:block;*/ +/* padding:0;*/ +/* list-style-type: none;*/ +/* position:relative;*/ +/* cursor:pointer;*/ +/*}*/ - text-transform: none; - padding:5px 0 5px 15px; - display:block; - border-bottom:1px dotted var(--main-border-color); -} +/*.projectselector ul.selectorList li.nav-header {*/ +/* border-color:transparent;*/ -.projectselector ul.selectorList li.projectLineItem ul.projectGroup { - clear:both; - display:block; - border-left:1px dotted var(--grey); -} +/* text-transform: none;*/ +/* padding:5px 0 5px 15px;*/ +/* display:block;*/ +/* border-bottom:1px dotted var(--main-border-color);*/ +/*}*/ + +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup {*/ +/* clear:both;*/ +/* display:block;*/ +/* border-left:1px dotted var(--grey);*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem ul.projectGroup:hover { - border-left:1px dotted var(--grey); -} +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup:hover {*/ +/* border-left:1px dotted var(--grey);*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem ul.projectGroup[class*=level-] { - margin-left: 13px; - margin-top: 0px; -} +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup[class*=level-] {*/ +/* margin-left: 13px;*/ +/* margin-top: 0px;*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem ul.projectGroup.level-0, -.projectselector ul.selectorList li.projectLineItem ul.projectGroup.level-1{ - margin-left: 18px; -} +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup.level-0,*/ +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup.level-1{*/ +/* margin-left: 18px;*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem ul.projectGroup.closed { - display:none; -} +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup.closed {*/ +/* display:none;*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem ul.projectGroup.open { - display:inherit; -} +/*.projectselector ul.selectorList li.projectLineItem ul.projectGroup.open {*/ +/* display:inherit;*/ +/*}*/ /* Individual project links */ -.projectselector ul.selectorList li.projectLineItem a { - line-height:30px; - min-height:50px; - padding-left:15px; - display: block; -} - -.projectselector ul.selectorList li.projectLineItem.hasSubtitle a .projectName { - display: block; - float: left; - line-height: 12px; - width: 80%; - overflow: hidden; - text-overflow: ellipsis; - height: 30px; - text-wrap: nowrap; -} +/*.projectselector ul.selectorList li.projectLineItem a {*/ +/* line-height:30px;*/ +/* min-height:50px;*/ +/* padding-left:15px;*/ +/* display: block;*/ +/*}*/ + +/*.projectselector ul.selectorList li.projectLineItem.hasSubtitle a .projectName {*/ +/* display: block;*/ +/* float: left;*/ +/* line-height: 12px;*/ +/* width: 80%;*/ +/* overflow: hidden;*/ +/* text-overflow: ellipsis;*/ +/* height: 30px;*/ +/* text-wrap: nowrap;*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem.hasSubtitle a small { - font-size:var(--font-size-xs); - opacity:0.5; -} +/*.projectselector ul.selectorList li.projectLineItem.hasSubtitle a small {*/ +/* font-size:var(--font-size-xs);*/ +/* opacity:0.5;*/ +/*}*/ -.projectselector ul.selectorList li.projectLineItem .projectAvatar { - height:30px; - width:30px; - display:block; - float:left; - margin-right:10px; +/*.projectselector ul.selectorList li.projectLineItem .projectAvatar {*/ +/* height:30px;*/ +/* width:30px;*/ +/* display:block;*/ +/* float:left;*/ +/* margin-right:10px;*/ - border-radius:5px; -} +/* border-radius:5px;*/ +/*}*/ -.projectselector ul.selectorList li .fas { +/*.projectselector ul.selectorList li .fas {*/ - padding-right:10px; - padding-top:5px; -} +/* padding-right:10px;*/ +/* padding-top:5px;*/ +/*}*/ -.projectselector ul.selectorList li:hover > a, -.projectselector ul.selectorList li.activeChild > a{ - background:var(--neutral); - color:var(--main-menu-link-active-color); +/*.projectselector ul.selectorList li:hover > a,*/ +/*.projectselector ul.selectorList li.activeChild > a{*/ +/* background:var(--neutral);*/ +/* color:var(--main-menu-link-active-color);*/ -} +/*}*/ -.projectselector ul.selectorList li:hover li a { - border-radius: 0 0 0 10px; -} +/*.projectselector ul.selectorList li:hover li a {*/ +/* border-radius: 0 0 0 10px;*/ +/*}*/ -.projectselector ul.selectorList li.nav-header:hover { - background:none; -} +/*.projectselector ul.selectorList li.nav-header:hover {*/ +/* background:none;*/ +/*}*/ -.projectselector ul.selectorList li.border { - border-top:1px dotted var(--neutral); -} +/*.projectselector ul.selectorList li.border {*/ +/* border-top:1px dotted var(--neutral);*/ +/*}*/ -.projectselector ul.selectorList li.nav-header, -.projectselector ul.selectorList li.fixedBottom { - display:block; -} +/*.projectselector ul.selectorList li.nav-header,*/ +/*.projectselector ul.selectorList li.fixedBottom {*/ +/* display:block;*/ +/*}*/ -.projectselector ul.selectorList li.fixedBottom { - position:absolute; - width: 240px; - bottom:0; - display:block; +/*.projectselector ul.selectorList li.fixedBottom {*/ +/* position:absolute;*/ +/* width: 240px;*/ +/* bottom:0;*/ +/* display:block;*/ -} +/*}*/ -.projectselector ul.selectorList.projectList li.projectLineItem .toggler { - float: left; - line-height: 20px; - width: 18px; - padding: 0; - text-align: center; - margin-left: 9px; - margin-right: 3px; - margin-top: 15px; - border-radius: 5px; - min-height: 20px; -} +/*.projectselector ul.selectorList.projectList li.projectLineItem .toggler {*/ +/* float: left;*/ +/* line-height: 20px;*/ +/* width: 18px;*/ +/* padding: 0;*/ +/* text-align: center;*/ +/* margin-left: 9px;*/ +/* margin-right: 3px;*/ +/* margin-top: 15px;*/ +/* border-radius: 5px;*/ +/* min-height: 20px;*/ +/*}*/ -.projectselector ul.selectorList.projectList li.projectLineItem .projectGroup .toggler { - margin-left:5px; -} +/*.projectselector ul.selectorList.projectList li.projectLineItem .projectGroup .toggler {*/ +/* margin-left:5px;*/ +/*}*/ -.projectselector ul.selectorList.projectList li.projectLineItem .toggler:hover { - background:var(--col-hover-bg); -} +/*.projectselector ul.selectorList.projectList li.projectLineItem .toggler:hover {*/ +/* background:var(--col-hover-bg);*/ +/*}*/ -.projectselector ul.selectorList.projectList li.projectLineItem .favoriteIcon { - float:right; - line-height:30px; - width:30px; - color:var(--neutral) !important; - padding-left:10px; - margin-right:10px; -} +/*.projectselector ul.selectorList.projectList li.projectLineItem .favoriteIcon {*/ +/* float:right;*/ +/* line-height:30px;*/ +/* width:30px;*/ +/* color:var(--neutral) !important;*/ +/* padding-left:10px;*/ +/* margin-right:10px;*/ +/*}*/ @@ -1118,27 +1118,27 @@ a.barmenu:hover { } -.mainwrapper.menuclosed .bigProjectSelector i.fa { - display:none; -} +/*.mainwrapper.menuclosed .bigProjectSelector i.fa {*/ +/* display:none;*/ +/*}*/ -.mainwrapper.menuclosed .bigProjectSelector { - font-size: 0; - width:auto; -} +/*.mainwrapper.menuclosed .bigProjectSelector {*/ +/* font-size: 0;*/ +/* width:auto;*/ +/*}*/ -.mainwrapper.menuclosed .bigProjectSelector .fa { - font-size:var(--font-size-l); -} +/*.mainwrapper.menuclosed .bigProjectSelector .fa {*/ +/* font-size:var(--font-size-l);*/ +/*}*/ -.mainwrapper.menuclosed .bigProjectSelector > .projectAvatar { - float:none; - margin: 10px 0 0; -} +/*.mainwrapper.menuclosed .bigProjectSelector > .projectAvatar {*/ +/* float:none;*/ +/* margin: 10px 0 0;*/ +/*}*/ -.mainwrapper.menuclosed .leftmenu .projectselector { - left:73px; -} +/*.mainwrapper.menuclosed .leftmenu .projectselector {*/ +/* left:73px;*/ +/*}*/ .mainwrapper.menuclosed .leftmenu .nav-tabs.nav-stacked .dropdown ul li.active a { @@ -1255,34 +1255,28 @@ a.barmenu:hover { } -.headerinner .bigProjectSelector { - width:270px; - overflow:hidden; - height: 50px; -} - -.headerinner .bigProjectSelector > .fa-caret-down { - float:right; - padding-top:17px; -} - -.headerinner .bigProjectSelector .projectAvatar img{ - max-height:30px; - margin:10px 5px 0px 0px; - border-radius:3px; - float:left; -} - -.headerinner .bigProjectSelector .projectAvatar .fa { - width: 30px; - height: 30px; - font-size: 14px; - line-height: 30px; - text-align: center; - background: var(--header-gradient); - border-radius: var(--element-radius); - margin-right: 5px; -} +/*.headerinner .bigProjectSelector > .fa-caret-down {*/ +/* float:right;*/ +/* padding-top:17px;*/ +/*}*/ + +/*.headerinner .bigProjectSelector .projectAvatar img{*/ +/* max-height:30px;*/ +/* margin:10px 5px 0px 0px;*/ +/* border-radius:3px;*/ +/* float:left;*/ +/*}*/ + +/*.headerinner .bigProjectSelector .projectAvatar .fa {*/ +/* width: 30px;*/ +/* height: 30px;*/ +/* font-size: 14px;*/ +/* line-height: 30px;*/ +/* text-align: center;*/ +/* background: var(--header-gradient);*/ +/* border-radius: var(--element-radius);*/ +/* margin-right: 5px;*/ +/*}*/ diff --git a/public/assets/js/app/app.js b/public/assets/js/app/app.js index 5ed2909e3a..19f8b85237 100644 --- a/public/assets/js/app/app.js +++ b/public/assets/js/app/app.js @@ -1,9 +1,9 @@ -import './core/globalLibraries'; +import './core/globalLibraries.js'; +import { addToGlobalScope } from './core/leantimeScope.mjs'; +import { moduleLoader } from './core/moduleLoader.mjs'; +import { initializeCore } from './core/bootstrap.mjs'; -import moduleLoader from './core/moduleLoader'; -window.moduleLoader = moduleLoader; - -import { initializeCore } from './core/bootstrap'; +addToGlobalScope({moduleLoader: moduleLoader}); // Initialize core application document.addEventListener('DOMContentLoaded', async () => { diff --git a/public/assets/js/app/components/editors.module.mjs b/public/assets/js/app/components/editors.module.mjs index 21f8b57f66..f2b0587867 100644 --- a/public/assets/js/app/components/editors.module.mjs +++ b/public/assets/js/app/components/editors.module.mjs @@ -13,8 +13,6 @@ import 'tinymce/icons/default/index.js'; /* A theme is also required */ import 'tinymce/themes/silver/index.js'; -/* Import the skin */ -import 'tinymce/skins/ui/oxide/skin.css'; /* Import plugins */ import 'tinymce/plugins/autolink/index.js'; diff --git a/public/assets/js/app/core/bootstrap.mjs b/public/assets/js/app/core/bootstrap.mjs index d8a996c692..9d15b13944 100644 --- a/public/assets/js/app/core/bootstrap.mjs +++ b/public/assets/js/app/core/bootstrap.mjs @@ -15,7 +15,7 @@ export function initializeCore() { // Set up global event listeners for component loader setupGlobalEventListeners(); - console.log('Core initialization complete'); + console.debug('Core initialization complete'); } catch (error) { diff --git a/public/assets/js/app/core/componentConfig.mjs b/public/assets/js/app/core/componentConfig.mjs index 0f9fe30583..bbc792e88c 100644 --- a/public/assets/js/app/core/componentConfig.mjs +++ b/public/assets/js/app/core/componentConfig.mjs @@ -18,7 +18,7 @@ export const componentManifest = { export const pageConfigs = { 'login': [], 'dashboard': ['datepicker', 'editor', 'select'], - 'default': ['select'] + 'default': [] }; export const getPageComponents = (pageName) => { diff --git a/public/assets/js/app/core/componentLoader.mjs b/public/assets/js/app/core/componentLoader.mjs index 68a20c065f..d2d2995c4a 100644 --- a/public/assets/js/app/core/componentLoader.mjs +++ b/public/assets/js/app/core/componentLoader.mjs @@ -13,7 +13,7 @@ export async function loadComponentsForPage(container = document, pageName = 'de // Add any additional components found in the DOM container.querySelectorAll('[data-component]').forEach(element => { - console.log(element.dataset.component); + console.debug(element.dataset.component); components.add(element.dataset.component); }); diff --git a/public/assets/js/app/core/moduleLoader.mjs b/public/assets/js/app/core/moduleLoader.mjs index 97de7106d0..eea3273efd 100644 --- a/public/assets/js/app/core/moduleLoader.mjs +++ b/public/assets/js/app/core/moduleLoader.mjs @@ -5,10 +5,8 @@ class ModuleLoader { } async load(modulePath) { - console.log("loading:" + modulePath); const formattedPath = modulePath; - console.debug("Formatted module path:", formattedPath); if (this.loadedModules.has(modulePath)) { return this.loadedModules.get(modulePath); @@ -51,17 +49,11 @@ class ModuleLoader { // Ensure dynamic imports work with proper paths async importModule(modulePath) { - console.log("Import:"+ modulePath); - await import( - /* webpackExports: ["default", "named"] */ - `${modulePath}`).then((module) => { - console.log(module); - - return module; - }); - - + const module = await import( + /* webpackChunkName: "[index]" */ + /* webpackIgnore: true */ + `${modulePath}.js`); // Handle both ECMAScript Module and Universal Module Definition modules if (module.__esModule) { @@ -72,13 +64,9 @@ class ModuleLoader { // For Universal Module Definition modules, check the global namespace const parts = modulePath.split('/'); - const domainName = parts[2]; + const domainName = parts[parts.length-3]; const controllerName = parts[parts.length - 1]; - console.log(parts); - console.log(domainName); - console.log(controllerName); - return window?.[domainName]?.[controllerName] || module; // Add fallback for debugging console.warn("Module not found in global namespace:", modulePath); diff --git a/webpack.mix.js b/webpack.mix.js index 8903c6dd7b..031c974fe5 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -36,7 +36,6 @@ const CONFIG = { mix.setResourceRoot(CONFIG.resourceRoot) .setPublicPath(CONFIG.publicPath) .options({ runtimeChunkPath: 'js' }) - .version(); // Source Maps Configuration @@ -52,7 +51,15 @@ mix.js('./public/assets/js/app/app.js', `${CONFIG.publicPath}/js/app.js`) // Build global components mix.js( - glb.src('./public/assets/js/app/components/*.mjs'), + glb.src('./public/assets/js/app/components/*'), + glb.out({ + baseMap: './public/assets/js/app/components', + outMap: './public/dist/js/components' + }) +); + +mix.alias( + glb.src('./public/assets/js/app/components/*'), glb.out({ baseMap: './public/assets/js/app/components', outMap: './public/dist/js/components' @@ -61,7 +68,7 @@ mix.js( // Build domain components mix.js( - glb.src('./app/Domain/**/Js/*.js'), + glb.src('./app/Domain/**/Js/*'), glb.out({ baseMap: './app', outMap: './public/dist/js' @@ -75,10 +82,16 @@ const webpackConfig = { filename: '[name].js', chunkFilename: 'js/chunks/[name].js', publicPath: '/dist/', + //libraryTarget: 'umd', + //umdNamedDefine: true, // optional clean: true, - libraryTarget: 'umd', - umdNamedDefine: false, // optional + library: { + type: 'umd', + }, }, + // experiments: { + // outputModule: true + // }, module: { rules: [ { @@ -93,7 +106,7 @@ const webpackConfig = { }, optimization: { usedExports: false, - runtimeChunk: 'single', + chunkIds: 'named', splitChunks: { chunks: 'async', cacheGroups: { @@ -131,9 +144,6 @@ const webpackConfig = { new webpack.DefinePlugin({ i18n: 'window.leantime.i18n', }), - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) - }), new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery', @@ -149,10 +159,11 @@ const webpackConfig = { 'css': path.resolve(__dirname, 'public/assets/css'), 'fonts': path.resolve(__dirname, 'public/assets/fonts'), 'domain': path.resolve(__dirname, 'app/Domain'), + 'dist': path.resolve(__dirname, 'public/dist/js'), '@domain': path.resolve(__dirname, 'public/dist/js/Domain'), '@components': path.resolve(__dirname, 'public/assets/js/app/components'), }, - extensions: [".*",".mjs",".js",".json",".*"], + extensions: ['.mjs', '.js'], }, stats: { children: false @@ -180,6 +191,11 @@ mix.combine('./public/assets/js/libs/prism/prism.js', `${CONFIG.publicPath}/js/c mix .babelConfig({ sourceType: 'unambiguous', - plugins: ['@babel/plugin-syntax-dynamic-import'], + presets: [ + ['@babel/preset-modules'] + ], + plugins: [ + '@babel/plugin-proposal-unicode-property-regex' + ] }) .version();