From 450d2a8bc380f7ee5cae0da14494e2963ca54fb5 Mon Sep 17 00:00:00 2001 From: hoogi91 Date: Thu, 1 Aug 2024 20:59:21 +0200 Subject: [PATCH] Fix webpack build --- Resources/Private/Assets/JavaScript/dsn.js | 2 +- Resources/Private/Assets/JavaScript/main.js | 8 +- .../Private/Assets/JavaScript/renderer.js | 4 +- .../Private/Assets/JavaScript/selector.js | 2 +- .../Private/Assets/JavaScript/spreadsheet.js | 2 +- .../Public/JavaScript/SpreadsheetDataInput.js | 2 +- package-lock.json | 610 ------------------ package.json | 3 +- webpack.config.js | 11 +- 9 files changed, 17 insertions(+), 627 deletions(-) diff --git a/Resources/Private/Assets/JavaScript/dsn.js b/Resources/Private/Assets/JavaScript/dsn.js index 59322e64..f6484b9a 100644 --- a/Resources/Private/Assets/JavaScript/dsn.js +++ b/Resources/Private/Assets/JavaScript/dsn.js @@ -1,4 +1,4 @@ -import {colHeaderToIndex} from "./helper"; +import {colHeaderToIndex} from "./helper.js"; export default class DSN { constructor(value) { diff --git a/Resources/Private/Assets/JavaScript/main.js b/Resources/Private/Assets/JavaScript/main.js index a9db01c6..76481ece 100644 --- a/Resources/Private/Assets/JavaScript/main.js +++ b/Resources/Private/Assets/JavaScript/main.js @@ -1,7 +1,7 @@ -import DSN from './dsn'; -import Renderer from './renderer'; -import Spreadsheet from './spreadsheet'; -import Selector from "./selector"; +import DSN from './dsn.js'; +import Renderer from './renderer.js'; +import Spreadsheet from './spreadsheet.js'; +import Selector from "./selector.js"; import DocumentService from 'DocumentService'; class SpreadsheetDataInput { diff --git a/Resources/Private/Assets/JavaScript/renderer.js b/Resources/Private/Assets/JavaScript/renderer.js index 28dab48e..66a714db 100644 --- a/Resources/Private/Assets/JavaScript/renderer.js +++ b/Resources/Private/Assets/JavaScript/renderer.js @@ -1,5 +1,5 @@ -import DSN from "./dsn"; -import {colHeaderByIndex} from "./helper"; +import DSN from "./dsn.js"; +import {colHeaderByIndex} from "./helper.js"; export default class Renderer { constructor(sheetWrapper, tableWrapper) { diff --git a/Resources/Private/Assets/JavaScript/selector.js b/Resources/Private/Assets/JavaScript/selector.js index 7659f5fe..ef854e6e 100644 --- a/Resources/Private/Assets/JavaScript/selector.js +++ b/Resources/Private/Assets/JavaScript/selector.js @@ -1,4 +1,4 @@ -import {calculateCellIndexes, cellRepresentation, throttle, unselectEverything} from "./helper"; +import {calculateCellIndexes, cellRepresentation, throttle, unselectEverything} from "./helper.js"; export default class Selector { constructor(tableWrapper) { diff --git a/Resources/Private/Assets/JavaScript/spreadsheet.js b/Resources/Private/Assets/JavaScript/spreadsheet.js index cca4c1a8..57a6f3a3 100644 --- a/Resources/Private/Assets/JavaScript/spreadsheet.js +++ b/Resources/Private/Assets/JavaScript/spreadsheet.js @@ -1,4 +1,4 @@ -import DSN from './dsn'; +import DSN from './dsn.js'; export default class Spreadsheet { constructor(dsn, data) { diff --git a/Resources/Public/JavaScript/SpreadsheetDataInput.js b/Resources/Public/JavaScript/SpreadsheetDataInput.js index d906bf1d..3b69c323 100644 --- a/Resources/Public/JavaScript/SpreadsheetDataInput.js +++ b/Resources/Public/JavaScript/SpreadsheetDataInput.js @@ -1 +1 @@ -define(["TYPO3/CMS/Core/DocumentService"],(e=>(()=>{"use strict";var t={631:t=>{t.exports=e}},s={};function i(e){var r=s[e];if(void 0!==r)return r.exports;var n=s[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{function e(e){const t=e.toString(24);let s="";for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:null;return"row"===i?s:"column"===i?e(t):e(t)+s}function n(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=parseInt(e.getAttribute("data-col"));!0===t&&!0===e.hasAttribute("colspan")&&(s+=parseInt(e.getAttribute("colspan"))-1);let i=parseInt(e.getAttribute("data-row"));return!0===t&&!0===e.hasAttribute("rowspan")&&(i+=parseInt(e.getAttribute("rowspan"))-1),{colIndex:s,rowIndex:i}}i.r(r);class l{constructor(e){if(this.properties={},0===e.length)return;const t=e.match(/^spreadsheet:\/\/(\d+)(?:\?(.+))?/);if(null===t)throw new Error('DSN class expects value to be of type string and format "spreadsheet://index=0..."');if(void 0===t[2])this.properties.fileUid=t[1];else{const e=JSON.parse('{"'+t[2].replace(/&/g,'","').replace(/=/g,'":"')+'"}',(function(e,t){return""===e?t:decodeURIComponent(t)}));this.properties.fileUid=t[1],this.properties.index=e.index||0,this.properties.direction=e.direction||"horizontal",this.range=e.range||""}}get fileUid(){return this.properties.fileUid}set fileUid(e){this.properties.fileUid=e}get index(){return this.properties.index}set index(e){this.properties.index=e}get coordinates(){return this.properties.coordinates||null}get range(){return this.properties.range||""}set range(e){this.properties.range=e;let s=e.match(/^([A-Z]+|\d+)(\d+)?:([A-Z]+|\d+)(\d+)?$/);null!==s&&(s=Array.from(s).slice(1),Number.isNaN(parseInt(s[0]))||(s[1]=parseInt(s[0]),s[0]=null),Number.isNaN(parseInt(s[2]))||(s[3]=parseInt(s[2]),s[2]=null),s[0]=s[0]||s[2]||null,s[2]=s[2]||s[0],s[1]=s[1]||s[3]||null,s[3]=s[3]||s[1],this.properties.coordinates={startCol:null!==s[0]?t(s[0]):null,startRow:null!==s[1]?parseInt(s[1]):null,endCol:null!==s[2]?t(s[2]):null,endRow:null!==s[3]?parseInt(s[3]):null})}get direction(){return this.properties.direction||""}set direction(e){this.properties.direction=e}}class a{constructor(e,t){this.sheetWrapper=e,this.sheetWrapper.addEventListener("click",(e=>{if("A"===e.target.tagName){for(let t of e.target.parentNode.childNodes)t.classList.remove("active");e.target.classList.add("active"),this.sheetWrapper.dispatchEvent(new CustomEvent("changeIndex",{detail:{index:e.target.getAttribute("data-value")}}))}})),null!==t&&(this.tableWrapper=t)}update(e,t){if(!(t instanceof l))throw new Error('Renderer class "update" method expects parameter to be type of a DSN class');this.buildTabs(e,t.index),this.buildTable(e,t.coordinates)}buildTabs(e,t){if(this.sheetWrapper.textContent="",e.getAllSheets().length<=0)this.sheetWrapper.style.display="none";else{for(let s=0;s1&&void 0!==arguments[1]?arguments[1]:null;if(void 0===this.tableWrapper||null===this.tableWrapper)return;const s=Object.values(e.getSheetData()).map((e=>Object.values(e)));if(s.length<=0)return;const i=document.createElement("table");this.buildTableHeader(i,Math.max(...s.map((e=>e.length)))),this.buildTableBody(i,s,t),this.tableWrapper.textContent="",this.tableWrapper.appendChild(i),this.tableWrapper.style.display="block"}buildTableHeader(t,s){const i=t.createTHead().insertRow();for(let t=0;t<=s;t++)if(t>0){const s=i.insertCell();s.innerText=e(t),s.setAttribute("data-col",t)}else i.insertCell()}buildTableBody(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=e.createTBody();let r=[];t.forEach(((e,t)=>{const n=i.insertRow(),l=n.insertCell();l.innerText=t+1,l.setAttribute("data-row",t+1);let a=0;e.forEach((e=>{const i=n.insertCell();if(i.innerText=e.val,void 0!==e.css&&i.setAttribute("class",e.css.split("-").filter((e=>e.length>0)).map((e=>"align-"+e)).join(" ")),void 0!==e.col){i.setAttribute("colspan",e.col);for(let s=1;s=t+1&&s.startCol<=a+1&&s.endCol>=a+1&&i.classList.add("highlight"),a++}))}))}}class o{constructor(e,t){if(!(e instanceof l))throw new Error("Spreadsheet class expects dsn parameter to be type of a DSN class");this.data=t,this.defaultFileUid=e.fileUid,this.defaultSheetIndex=e.index}set dsn(e){if(!(e instanceof l))throw new Error('Spreadsheet class setter "dsn" expects parameter to be type of a DSN class');this.defaultFileUid=e.fileUid,this.defaultSheetIndex=e.index}getAllSheets(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultFileUid;return this.data[e]||[]}getSheet(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultSheetIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultFileUid;return void 0===this.data[t]?[]:this.data[t][e]||[]}getSheetName(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultSheetIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultFileUid;return this.getSheet(e,t).name||""}getSheetData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultSheetIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultFileUid;return this.getSheet(e,t).cells||[]}}class d{constructor(e){if(this.cursor={isSelecting:!1,selectMode:null},this.properties={},this.tableWrapper=e,null!==this.tableWrapper){this.tableWrapper.addEventListener("mousedown",(e=>{const t=document.elementFromPoint(e.x,e.y);this.cursor.isSelecting=!0,this.cursor.start=t,this.cursor.selectMode=null,this.reachedColumnHeader(t)?this.cursor.selectMode="column":this.reachedRowHeader(t)&&(this.cursor.selectMode="row")}));const e=e=>{if(!0!==this.cursor.isSelecting)return!1;"mouseup"===e.type&&(this.cursor.isSelecting=!1,window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty());const t=document.elementFromPoint(e.x,e.y);return!1!==this.isInsideTable(t)&&((!this.reachedColumnHeader(t)||!this.reachedRowHeader(t))&&(("column"!==this.cursor.selectMode||!this.reachedRowHeader(t))&&(("row"!==this.cursor.selectMode||!this.reachedColumnHeader(t))&&((null!==this.cursor.selectMode||!this.reachedColumnHeader(t)&&!this.reachedRowHeader(t))&&(t!==this.cursor.start?(this.cursor.end=t,this.selection=[this.cursor.start,this.cursor.end]):this.selection=[this.cursor.start],this.calculateMergeCells(),this.highlightSelection(),void this.tableWrapper.dispatchEvent(new CustomEvent("changeSelection",{detail:{start:this.selection.start,end:this.selection.end}})))))))};this.tableWrapper.addEventListener("mousemove",function(e,t){let s,i;return function(){const r=this,n=arguments;i?(clearTimeout(s),s=setTimeout((function(){Date.now()-i>=e&&(t.apply(r,n),i=Date.now())}),e-(Date.now()-i))):(t.apply(r,n),i=Date.now())}}(60,e)),this.tableWrapper.addEventListener("mouseup",e)}}get selection(){return this.properties.selection}set selection(e){if(e.length<=0)return;let t={min:null,max:null},i={min:null,max:null};e.forEach((e=>{const s=n(e,!1);(null===t.min||t.min>s.colIndex)&&(t.min=s.colIndex),(null===i.min||i.min>s.rowIndex)&&(i.min=s.rowIndex);const r=n(e,!0);(null===t.max||t.max0&&void 0!==arguments[0]?arguments[0]:[],t=this.selection.indexes.col,s=this.selection.indexes.row;"row"===this.cursor.selectMode?t={min:1,max:this.tableWrapper.querySelector("table").rows[0].cells.length}:"column"===this.cursor.selectMode&&(s={min:1,max:this.tableWrapper.querySelector("table").rows.length});e:for(let i=s.min;i<=s.max;i++)for(let r=t.min;r<=t.max;r++){if(-1!==e.indexOf(r+"-"+i))continue;const l=this.tableWrapper.querySelector('td[data-col="'+r+'"][data-row="'+i+'"][colspan],td[data-col="'+r+'"][data-row="'+i+'"][rowspan]');if(null===l)continue;const a=n(l,!1);e.push(a.colIndex+"-"+a.rowIndex);const o=n(l,!0);if(o.colIndex>t.max||o.rowIndex>s.max){this.selection=[...this.selection.elements,l],this.calculateMergeCells(e);break e}}const i=this.tableWrapper.querySelectorAll("td[colspan], td[rowspan]");for(let r=0;r=t.min&&o.rowIndex>=s.min){this.selection=[...this.selection.elements,l],this.calculateMergeCells(e);break}}}highlightSelection(){const e=this.selection.indexes.col,t=this.selection.indexes.row,s=[];if("row"===this.cursor.selectMode)for(let e=t.min;e<=t.max;e++)s.push(...this.tableWrapper.querySelectorAll('td[data-row="'+e+'"]'));else if("column"===this.cursor.selectMode)for(let t=e.min;t<=e.max;t++)s.push(...this.tableWrapper.querySelectorAll('td[data-col="'+t+'"]'));else for(let i=e.min;i<=e.max;i++)for(let e=t.min;e<=t.max;e++)s.push(this.tableWrapper.querySelector('td[data-col="'+i+'"][data-row="'+e+'"]'));Array.from(this.tableWrapper.querySelectorAll("td.highlight")).filter((e=>null!==e)).forEach((e=>e.classList.remove("highlight"))),s.filter((e=>null!==e)).forEach((e=>e.classList.add("highlight")))}}var h=i(631),c=i.n(h);class p{constructor(e){this.element=e,this.sheetWrapper=this.element.querySelector(".spreadsheet-sheets"),this.tableWrapper=this.element.querySelector(".spreadsheet-table"),this.fileInput=this.element.querySelector(".spreadsheet-file-select"),this.directionInput=this.element.querySelector(".spreadsheet-input-direction"),this.resetInput=this.element.querySelector(".spreadsheet-reset-button"),this.unsetInput=this.element.querySelector(".spreadsheet-unset-button"),this.originalDataInput=this.element.querySelector("input.spreadsheet-input-original"),this.databaseDataInput=this.element.querySelector("input.spreadsheet-input-database"),this.formattedDataInput=this.element.querySelector("input.spreadsheet-input-formatted"),this.dsn=new l(this.databaseDataInput.getAttribute("value")),this.spreadsheet=new o(this.dsn,JSON.parse(this.element.getAttribute("data-spreadsheet"))),this.renderer=new a(this.sheetWrapper,this.tableWrapper),this.selector=new d(this.tableWrapper),this.updateSpreadsheet(!0),this.initializeEvents()}initializeEvents(){this.fileInput.addEventListener("change",(e=>{this.dsn.fileUid=e.currentTarget.value,this.dsn.index=0,this.dsn.range="",this.updateSpreadsheet(!0)})),this.sheetWrapper.addEventListener("changeIndex",(e=>{this.dsn.index=e.detail.index,this.updateSpreadsheet(!0)})),this.resetInput.addEventListener("click",(()=>{this.dsn=new l(this.originalDataInput.getAttribute("value")),this.updateSpreadsheet(!0)})),this.unsetInput.addEventListener("click",(()=>{this.dsn=new l(""),this.sheetWrapper.style.display="none",null!==this.tableWrapper&&(this.tableWrapper.style.display="none"),null!==this.directionInput&&(this.directionInput.disabled=!0),this.updateSpreadsheet()})),null!==this.tableWrapper&&this.tableWrapper.addEventListener("changeSelection",(e=>{"string"==typeof e.detail.start&&e.detail.start===e.detail.end&&e.detail.start.match(/^(?=.*\d)(?=.*[A-Z]).+$/)?this.dsn.range=e.detail.start:this.dsn.range=e.detail.start+":"+e.detail.end,this.updateSpreadsheet()})),null!==this.tableWrapper&&null!==this.directionInput&&this.directionInput.addEventListener("click",(()=>{this.dsn.direction="horizontal"===(this.dsn.direction||"horizontal")?"vertical":"horizontal",this.updateSpreadsheet()}))}updateSpreadsheet(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spreadsheet.dsn=this.dsn,!0===e&&this.renderer.update(this.spreadsheet,this.dsn),this.fileInput.value=this.dsn.fileUid,null!==this.directionInput&&("vertical"===this.dsn.direction?(this.directionInput.querySelector(".direction-row").style.display="none",this.directionInput.querySelector(".direction-column").style.display="block"):(this.directionInput.querySelector(".direction-column").style.display="none",this.directionInput.querySelector(".direction-row").style.display="block"));let t=this.spreadsheet.getSheetName(),s="";void 0!==this.dsn.fileUid&&void 0!==this.dsn.index&&(s+="spreadsheet://"+this.dsn.fileUid+"?index="+this.dsn.index),null!==this.tableWrapper&&this.dsn.range.length>0&&(t+=" - "+this.dsn.range,s+="&range="+this.dsn.range),null!==this.tableWrapper&&null!==this.directionInput&&this.dsn.direction.length>0&&(s+="&direction="+this.dsn.direction),this.formattedDataInput.setAttribute("value",t),this.databaseDataInput.setAttribute("value",s),""!==s&&(this.sheetWrapper.style.display="",null!==this.tableWrapper&&(this.tableWrapper.style.display=""),null!==this.directionInput&&(this.directionInput.disabled=!1))}}c().ready().then((()=>{document.querySelectorAll(".spreadsheet-input-wrap").forEach((e=>{new p(e)}))})).catch((()=>{console.error("Failed to load DOM for processing spreadsheet inputs!")}))})(),r})())); \ No newline at end of file +define(["TYPO3/CMS/Core/DocumentService"],(e=>(()=>{"use strict";var t={722:t=>{t.exports=e}},s={};function i(e){const t=e.toString(24);let s="";for(let e=0;e2&&void 0!==arguments[2]?arguments[2]:null;return"row"===s?t:"column"===s?i(e):i(e)+t}function l(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=parseInt(e.getAttribute("data-col"));!0===t&&!0===e.hasAttribute("colspan")&&(s+=parseInt(e.getAttribute("colspan"))-1);let i=parseInt(e.getAttribute("data-row"));return!0===t&&!0===e.hasAttribute("rowspan")&&(i+=parseInt(e.getAttribute("rowspan"))-1),{colIndex:s,rowIndex:i}}class a{constructor(e){if(this.properties={},0===e.length)return;const t=e.match(/^spreadsheet:\/\/(\d+)(?:\?(.+))?/);if(null===t)throw new Error('DSN class expects value to be of type string and format "spreadsheet://index=0..."');if(void 0===t[2])this.properties.fileUid=t[1];else{const e=JSON.parse('{"'+t[2].replace(/&/g,'","').replace(/=/g,'":"')+'"}',(function(e,t){return""===e?t:decodeURIComponent(t)}));this.properties.fileUid=t[1],this.properties.index=e.index||0,this.properties.direction=e.direction||"horizontal",this.range=e.range||""}}get fileUid(){return this.properties.fileUid}set fileUid(e){this.properties.fileUid=e}get index(){return this.properties.index}set index(e){this.properties.index=e}get coordinates(){return this.properties.coordinates||null}get range(){return this.properties.range||""}set range(e){this.properties.range=e;let t=e.match(/^([A-Z]+|\d+)(\d+)?:([A-Z]+|\d+)(\d+)?$/);null!==t&&(t=Array.from(t).slice(1),Number.isNaN(parseInt(t[0]))||(t[1]=parseInt(t[0]),t[0]=null),Number.isNaN(parseInt(t[2]))||(t[3]=parseInt(t[2]),t[2]=null),t[0]=t[0]||t[2]||null,t[2]=t[2]||t[0],t[1]=t[1]||t[3]||null,t[3]=t[3]||t[1],this.properties.coordinates={startCol:null!==t[0]?r(t[0]):null,startRow:null!==t[1]?parseInt(t[1]):null,endCol:null!==t[2]?r(t[2]):null,endRow:null!==t[3]?parseInt(t[3]):null})}get direction(){return this.properties.direction||""}set direction(e){this.properties.direction=e}}class o{constructor(e,t){this.sheetWrapper=e,this.sheetWrapper.addEventListener("click",(e=>{if("A"===e.target.tagName){for(let t of e.target.parentNode.childNodes)t.classList.remove("active");e.target.classList.add("active"),this.sheetWrapper.dispatchEvent(new CustomEvent("changeIndex",{detail:{index:e.target.getAttribute("data-value")}}))}})),null!==t&&(this.tableWrapper=t)}update(e,t){if(!(t instanceof a))throw new Error('Renderer class "update" method expects parameter to be type of a DSN class');this.buildTabs(e,t.index),this.buildTable(e,t.coordinates)}buildTabs(e,t){if(this.sheetWrapper.textContent="",e.getAllSheets().length<=0)this.sheetWrapper.style.display="none";else{for(let s=0;s1&&void 0!==arguments[1]?arguments[1]:null;if(void 0===this.tableWrapper||null===this.tableWrapper)return;const s=Object.values(e.getSheetData()).map((e=>Object.values(e)));if(s.length<=0)return;const i=document.createElement("table");this.buildTableHeader(i,Math.max(...s.map((e=>e.length)))),this.buildTableBody(i,s,t),this.tableWrapper.textContent="",this.tableWrapper.appendChild(i),this.tableWrapper.style.display="block"}buildTableHeader(e,t){const s=e.createTHead().insertRow();for(let e=0;e<=t;e++)if(e>0){const t=s.insertCell();t.innerText=i(e),t.setAttribute("data-col",e)}else s.insertCell()}buildTableBody(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const i=e.createTBody();let r=[];t.forEach(((e,t)=>{const n=i.insertRow(),l=n.insertCell();l.innerText=t+1,l.setAttribute("data-row",t+1);let a=0;e.forEach((e=>{const i=n.insertCell();if(i.innerText=e.val,void 0!==e.css&&i.setAttribute("class",e.css.split("-").filter((e=>e.length>0)).map((e=>"align-"+e)).join(" ")),void 0!==e.col){i.setAttribute("colspan",e.col);for(let s=1;s=t+1&&s.startCol<=a+1&&s.endCol>=a+1&&i.classList.add("highlight"),a++}))}))}}class d{constructor(e,t){if(!(e instanceof a))throw new Error("Spreadsheet class expects dsn parameter to be type of a DSN class");this.data=t,this.defaultFileUid=e.fileUid,this.defaultSheetIndex=e.index}set dsn(e){if(!(e instanceof a))throw new Error('Spreadsheet class setter "dsn" expects parameter to be type of a DSN class');this.defaultFileUid=e.fileUid,this.defaultSheetIndex=e.index}getAllSheets(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultFileUid;return this.data[e]||[]}getSheet(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultSheetIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultFileUid;return void 0===this.data[t]?[]:this.data[t][e]||[]}getSheetName(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultSheetIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultFileUid;return this.getSheet(e,t).name||""}getSheetData(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.defaultSheetIndex,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultFileUid;return this.getSheet(e,t).cells||[]}}class h{constructor(e){if(this.cursor={isSelecting:!1,selectMode:null},this.properties={},this.tableWrapper=e,null!==this.tableWrapper){this.tableWrapper.addEventListener("mousedown",(e=>{const t=document.elementFromPoint(e.x,e.y);this.cursor.isSelecting=!0,this.cursor.start=t,this.cursor.selectMode=null,this.reachedColumnHeader(t)?this.cursor.selectMode="column":this.reachedRowHeader(t)&&(this.cursor.selectMode="row")}));const e=e=>{if(!0!==this.cursor.isSelecting)return!1;"mouseup"===e.type&&(this.cursor.isSelecting=!1,window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty());const t=document.elementFromPoint(e.x,e.y);return!1!==this.isInsideTable(t)&&((!this.reachedColumnHeader(t)||!this.reachedRowHeader(t))&&(("column"!==this.cursor.selectMode||!this.reachedRowHeader(t))&&(("row"!==this.cursor.selectMode||!this.reachedColumnHeader(t))&&((null!==this.cursor.selectMode||!this.reachedColumnHeader(t)&&!this.reachedRowHeader(t))&&(t!==this.cursor.start?(this.cursor.end=t,this.selection=[this.cursor.start,this.cursor.end]):this.selection=[this.cursor.start],this.calculateMergeCells(),this.highlightSelection(),void this.tableWrapper.dispatchEvent(new CustomEvent("changeSelection",{detail:{start:this.selection.start,end:this.selection.end}})))))))};this.tableWrapper.addEventListener("mousemove",function(e,t){let s,i;return function(){const r=this,n=arguments;i?(clearTimeout(s),s=setTimeout((function(){Date.now()-i>=e&&(t.apply(r,n),i=Date.now())}),e-(Date.now()-i))):(t.apply(r,n),i=Date.now())}}(60,e)),this.tableWrapper.addEventListener("mouseup",e)}}get selection(){return this.properties.selection}set selection(e){if(e.length<=0)return;let t={min:null,max:null},s={min:null,max:null};e.forEach((e=>{const i=l(e,!1);(null===t.min||t.min>i.colIndex)&&(t.min=i.colIndex),(null===s.min||s.min>i.rowIndex)&&(s.min=i.rowIndex);const r=l(e,!0);(null===t.max||t.max0&&void 0!==arguments[0]?arguments[0]:[],t=this.selection.indexes.col,s=this.selection.indexes.row;"row"===this.cursor.selectMode?t={min:1,max:this.tableWrapper.querySelector("table").rows[0].cells.length}:"column"===this.cursor.selectMode&&(s={min:1,max:this.tableWrapper.querySelector("table").rows.length});e:for(let i=s.min;i<=s.max;i++)for(let r=t.min;r<=t.max;r++){if(-1!==e.indexOf(r+"-"+i))continue;const n=this.tableWrapper.querySelector('td[data-col="'+r+'"][data-row="'+i+'"][colspan],td[data-col="'+r+'"][data-row="'+i+'"][rowspan]');if(null===n)continue;const a=l(n,!1);e.push(a.colIndex+"-"+a.rowIndex);const o=l(n,!0);if(o.colIndex>t.max||o.rowIndex>s.max){this.selection=[...this.selection.elements,n],this.calculateMergeCells(e);break e}}const i=this.tableWrapper.querySelectorAll("td[colspan], td[rowspan]");for(let r=0;r=t.min&&o.rowIndex>=s.min){this.selection=[...this.selection.elements,n],this.calculateMergeCells(e);break}}}highlightSelection(){const e=this.selection.indexes.col,t=this.selection.indexes.row,s=[];if("row"===this.cursor.selectMode)for(let e=t.min;e<=t.max;e++)s.push(...this.tableWrapper.querySelectorAll('td[data-row="'+e+'"]'));else if("column"===this.cursor.selectMode)for(let t=e.min;t<=e.max;t++)s.push(...this.tableWrapper.querySelectorAll('td[data-col="'+t+'"]'));else for(let i=e.min;i<=e.max;i++)for(let e=t.min;e<=t.max;e++)s.push(this.tableWrapper.querySelector('td[data-col="'+i+'"][data-row="'+e+'"]'));Array.from(this.tableWrapper.querySelectorAll("td.highlight")).filter((e=>null!==e)).forEach((e=>e.classList.remove("highlight"))),s.filter((e=>null!==e)).forEach((e=>e.classList.add("highlight")))}}var c=function e(i){var r=s[i];if(void 0!==r)return r.exports;var n=s[i]={exports:{}};return t[i](n,n.exports,e),n.exports}(722);class p{constructor(e){this.element=e,this.sheetWrapper=this.element.querySelector(".spreadsheet-sheets"),this.tableWrapper=this.element.querySelector(".spreadsheet-table"),this.fileInput=this.element.querySelector(".spreadsheet-file-select"),this.directionInput=this.element.querySelector(".spreadsheet-input-direction"),this.resetInput=this.element.querySelector(".spreadsheet-reset-button"),this.unsetInput=this.element.querySelector(".spreadsheet-unset-button"),this.originalDataInput=this.element.querySelector("input.spreadsheet-input-original"),this.databaseDataInput=this.element.querySelector("input.spreadsheet-input-database"),this.formattedDataInput=this.element.querySelector("input.spreadsheet-input-formatted"),this.dsn=new a(this.databaseDataInput.getAttribute("value")),this.spreadsheet=new d(this.dsn,JSON.parse(this.element.getAttribute("data-spreadsheet"))),this.renderer=new o(this.sheetWrapper,this.tableWrapper),this.selector=new h(this.tableWrapper),this.updateSpreadsheet(!0),this.initializeEvents()}initializeEvents(){this.fileInput.addEventListener("change",(e=>{this.dsn.fileUid=e.currentTarget.value,this.dsn.index=0,this.dsn.range="",this.updateSpreadsheet(!0)})),this.sheetWrapper.addEventListener("changeIndex",(e=>{this.dsn.index=e.detail.index,this.updateSpreadsheet(!0)})),this.resetInput.addEventListener("click",(()=>{this.dsn=new a(this.originalDataInput.getAttribute("value")),this.updateSpreadsheet(!0)})),this.unsetInput.addEventListener("click",(()=>{this.dsn=new a(""),this.sheetWrapper.style.display="none",null!==this.tableWrapper&&(this.tableWrapper.style.display="none"),null!==this.directionInput&&(this.directionInput.disabled=!0),this.updateSpreadsheet()})),null!==this.tableWrapper&&this.tableWrapper.addEventListener("changeSelection",(e=>{"string"==typeof e.detail.start&&e.detail.start===e.detail.end&&e.detail.start.match(/^(?=.*\d)(?=.*[A-Z]).+$/)?this.dsn.range=e.detail.start:this.dsn.range=e.detail.start+":"+e.detail.end,this.updateSpreadsheet()})),null!==this.tableWrapper&&null!==this.directionInput&&this.directionInput.addEventListener("click",(()=>{this.dsn.direction="horizontal"===(this.dsn.direction||"horizontal")?"vertical":"horizontal",this.updateSpreadsheet()}))}updateSpreadsheet(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spreadsheet.dsn=this.dsn,!0===e&&this.renderer.update(this.spreadsheet,this.dsn),this.fileInput.value=this.dsn.fileUid,null!==this.directionInput&&("vertical"===this.dsn.direction?(this.directionInput.querySelector(".direction-row").style.display="none",this.directionInput.querySelector(".direction-column").style.display="block"):(this.directionInput.querySelector(".direction-column").style.display="none",this.directionInput.querySelector(".direction-row").style.display="block"));let t=this.spreadsheet.getSheetName(),s="";void 0!==this.dsn.fileUid&&void 0!==this.dsn.index&&(s+="spreadsheet://"+this.dsn.fileUid+"?index="+this.dsn.index),null!==this.tableWrapper&&this.dsn.range.length>0&&(t+=" - "+this.dsn.range,s+="&range="+this.dsn.range),null!==this.tableWrapper&&null!==this.directionInput&&this.dsn.direction.length>0&&(s+="&direction="+this.dsn.direction),this.formattedDataInput.setAttribute("value",t),this.databaseDataInput.setAttribute("value",s),""!==s&&(this.sheetWrapper.style.display="",null!==this.tableWrapper&&(this.tableWrapper.style.display=""),null!==this.directionInput&&(this.directionInput.disabled=!1))}}return c.ready().then((()=>{document.querySelectorAll(".spreadsheet-input-wrap").forEach((e=>{new p(e)}))})).catch((()=>{console.error("Failed to load DOM for processing spreadsheet inputs!")})),{}})())); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 50a8cd3d..a7694874 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,6 @@ "babel-loader": "^9.1.3", "core-js": "^3.37.1", "eslint": "^9.8.0", - "eslint-webpack-plugin": "^4.2.0", "terser-webpack-plugin": "^5.3.10", "webpack": "^5.93.0", "webpack-cli": "^5.1.4" @@ -1856,97 +1855,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dependencies": { - "@sinclair/typebox": "^0.27.8" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/types/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/@jest/types/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/types/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", @@ -2051,11 +1959,6 @@ "node": ">= 8" } }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" - }, "node_modules/@types/eslint": { "version": "8.56.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", @@ -2079,27 +1982,6 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==" - }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "dependencies": { - "@types/istanbul-lib-coverage": "*" - } - }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "dependencies": { - "@types/istanbul-lib-report": "*" - } - }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -2110,19 +1992,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.1.tgz", "integrity": "sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==" }, - "node_modules/@types/yargs": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", - "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" - }, "node_modules/@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -2481,17 +2350,6 @@ "concat-map": "0.0.1" } }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/browserslist": { "version": "4.23.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", @@ -2576,20 +2434,6 @@ "node": ">=6.0" } }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, "node_modules/clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -2825,29 +2669,6 @@ "node": ">=10" } }, - "node_modules/eslint-webpack-plugin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-4.2.0.tgz", - "integrity": "sha512-rsfpFQ01AWQbqtjgPRr2usVRxhWDuG0YDYcG8DJOteD3EFnpeuYuOwk0PQiN7PRBTqS6ElNdtPZPggj8If9WnA==", - "dependencies": { - "@types/eslint": "^8.56.10", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "schema-utils": "^4.2.0" - }, - "engines": { - "node": ">= 14.15.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependencies": { - "eslint": "^8.0.0 || ^9.0.0", - "webpack": "^5.0.0" - } - }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -3142,17 +2963,6 @@ "node": ">=16.0.0" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/find-cache-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", @@ -3439,14 +3249,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -3479,122 +3281,6 @@ "node": ">=0.10.0" } }, - "node_modules/jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "dependencies": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/jest-util/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "dependencies": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3723,18 +3409,6 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -3785,14 +3459,6 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -3879,17 +3545,6 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -4385,17 +4040,6 @@ "node": ">=4" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5885,72 +5529,6 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==" }, - "@jest/schemas": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", - "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "requires": { - "@sinclair/typebox": "^0.27.8" - } - }, - "@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "requires": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "@jridgewell/gen-mapping": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", @@ -6036,11 +5614,6 @@ "fastq": "^1.6.0" } }, - "@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" - }, "@types/eslint": { "version": "8.56.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", @@ -6064,27 +5637,6 @@ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, - "@types/istanbul-lib-coverage": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", - "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==" - }, - "@types/istanbul-lib-report": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", - "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", - "requires": { - "@types/istanbul-lib-coverage": "*" - } - }, - "@types/istanbul-reports": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", - "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", - "requires": { - "@types/istanbul-lib-report": "*" - } - }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -6095,19 +5647,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.0.1.tgz", "integrity": "sha512-CmR8+Tsy95hhwtZBKJBs0/FFq4XX7sDZHlGGf+0q+BRZfMbOTkzkj0AFAuTyXbObDIoanaBBW0+KEW+m3N16Wg==" }, - "@types/yargs": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", - "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", - "requires": { - "@types/yargs-parser": "*" - } - }, - "@types/yargs-parser": { - "version": "21.0.3", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", - "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" - }, "@webassemblyjs/ast": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", @@ -6395,14 +5934,6 @@ "concat-map": "0.0.1" } }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "requires": { - "fill-range": "^7.1.1" - } - }, "browserslist": { "version": "4.23.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", @@ -6444,11 +5975,6 @@ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==" }, - "ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==" - }, "clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -6730,18 +6256,6 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==" }, - "eslint-webpack-plugin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-4.2.0.tgz", - "integrity": "sha512-rsfpFQ01AWQbqtjgPRr2usVRxhWDuG0YDYcG8DJOteD3EFnpeuYuOwk0PQiN7PRBTqS6ElNdtPZPggj8If9WnA==", - "requires": { - "@types/eslint": "^8.56.10", - "jest-worker": "^29.7.0", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "schema-utils": "^4.2.0" - } - }, "espree": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.1.0.tgz", @@ -6840,14 +6354,6 @@ "flat-cache": "^4.0.0" } }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, "find-cache-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", @@ -7034,11 +6540,6 @@ "is-extglob": "^2.1.1" } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, "is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", @@ -7062,90 +6563,6 @@ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==" }, - "jest-util": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", - "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", - "requires": { - "@jest/types": "^29.6.3", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-worker": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", - "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", - "requires": { - "@types/node": "*", - "jest-util": "^29.7.0", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -7247,15 +6664,6 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -7297,11 +6705,6 @@ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, "optionator": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", @@ -7364,11 +6767,6 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -7699,14 +7097,6 @@ "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==" }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 78def8a2..63386020 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "asset-build", "version": "1.0.0", "description": "", - "type":"module", + "type": "module", "scripts": { "build": "webpack build --mode production", "build-watch": "webpack watch --mode production", @@ -25,7 +25,6 @@ "babel-loader": "^9.1.3", "core-js": "^3.37.1", "eslint": "^9.8.0", - "eslint-webpack-plugin": "^4.2.0", "terser-webpack-plugin": "^5.3.10", "webpack": "^5.93.0", "webpack-cli": "^5.1.4" diff --git a/webpack.config.js b/webpack.config.js index d704c2d3..92ebe5af 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,10 @@ -const ESLintPlugin = require("eslint-webpack-plugin"); -const TerserPlugin = require('terser-webpack-plugin'); -const path = require('path'); +import TerserPlugin from "terser-webpack-plugin"; +import path from "path"; +import * as url from 'url'; -module.exports = (env, argv) => ({ - plugins: [new ESLintPlugin()], +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); + +export default (env, argv) => ({ optimization: { minimizer: [ new TerserPlugin({