From 6d9c4d285d3c47bd42ca90287d04c30b586ed3ef Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:03:29 +0200 Subject: [PATCH 01/33] START move bpmn-rendering.js --- dev/public/bpmn-rendering.html | 2 +- dev/{public/static/js => ts/pages}/bpmn-rendering.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename dev/{public/static/js => ts/pages}/bpmn-rendering.js (96%) diff --git a/dev/public/bpmn-rendering.html b/dev/public/bpmn-rendering.html index 59aa39bfe9..d7e5c83b31 100644 --- a/dev/public/bpmn-rendering.html +++ b/dev/public/bpmn-rendering.html @@ -18,7 +18,7 @@ font-weight: bold; } - +
diff --git a/dev/public/static/js/bpmn-rendering.js b/dev/ts/pages/bpmn-rendering.js similarity index 96% rename from dev/public/static/js/bpmn-rendering.js rename to dev/ts/pages/bpmn-rendering.js index 01f491ce65..46adaa19b0 100644 --- a/dev/public/static/js/bpmn-rendering.js +++ b/dev/ts/pages/bpmn-rendering.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { documentReady, log, logError, startBpmnVisualization } from '../../../ts/dev-bundle-index'; +import { documentReady, log, logError, startBpmnVisualization } from '../dev-bundle-index'; function statusFetchKO(errorMsg) { logError(errorMsg); From 3ee7b24fb3c89010680aad4af61a67237b3db51f Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:04:13 +0200 Subject: [PATCH 02/33] move main.ts --- dev/ts/dev-bundle-index.ts | 2 +- dev/ts/{ => utils}/main.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) rename dev/ts/{ => utils}/main.ts (96%) diff --git a/dev/ts/dev-bundle-index.ts b/dev/ts/dev-bundle-index.ts index 4e21372fd2..38749610d5 100644 --- a/dev/ts/dev-bundle-index.ts +++ b/dev/ts/dev-bundle-index.ts @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -export * from './main'; +export * from './utils/main'; export * from './utils/shared-helpers'; export * from '../../src/bpmn-visualization'; diff --git a/dev/ts/main.ts b/dev/ts/utils/main.ts similarity index 96% rename from dev/ts/main.ts rename to dev/ts/utils/main.ts index cc0ada21a2..87416201de 100644 --- a/dev/ts/main.ts +++ b/dev/ts/utils/main.ts @@ -30,14 +30,14 @@ import type { ZoomType, FillColorGradient, GradientDirection, -} from '../../src/bpmn-visualization'; -import { FlowKind, ShapeBpmnElementKind } from '../../src/bpmn-visualization'; -import { fetchBpmnContent, logDownload, logError, logErrorAndOpenAlert, logStartup } from './utils/internal-helpers'; -import { log } from './utils/shared-helpers'; -import { DropFileUserInterface } from './component/DropFileUserInterface'; -import { SvgExporter } from './component/SvgExporter'; -import { downloadAsPng, downloadAsSvg } from './component/download'; -import { ThemedBpmnVisualization } from './component/ThemedBpmnVisualization'; +} from '../../../src/bpmn-visualization'; +import { FlowKind, ShapeBpmnElementKind } from '../../../src/bpmn-visualization'; +import { fetchBpmnContent, logDownload, logError, logErrorAndOpenAlert, logStartup } from './internal-helpers'; +import { log } from './shared-helpers'; +import { DropFileUserInterface } from '../component/DropFileUserInterface'; +import { SvgExporter } from '../component/SvgExporter'; +import { downloadAsPng, downloadAsSvg } from '../component/download'; +import { ThemedBpmnVisualization } from '../component/ThemedBpmnVisualization'; let bpmnVisualization: ThemedBpmnVisualization; let loadOptions: LoadOptions = {}; From bf3760b08c00dc3daab69f9df4b699f9eeaa9b54 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:04:54 +0200 Subject: [PATCH 03/33] move internal-helpers.ts --- dev/ts/component/DropFileUserInterface.ts | 2 +- dev/ts/component/ThemedBpmnVisualization.ts | 2 +- dev/ts/component/download.ts | 2 +- dev/ts/{utils => internal}/internal-helpers.ts | 2 +- dev/ts/utils/main.ts | 2 +- dev/ts/utils/shared-helpers.ts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) rename dev/ts/{utils => internal}/internal-helpers.ts (97%) diff --git a/dev/ts/component/DropFileUserInterface.ts b/dev/ts/component/DropFileUserInterface.ts index 1d1d5a2555..7cfe23a60d 100644 --- a/dev/ts/component/DropFileUserInterface.ts +++ b/dev/ts/component/DropFileUserInterface.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { logErrorAndOpenAlert } from '../utils/internal-helpers'; +import { logErrorAndOpenAlert } from '../internal/internal-helpers'; export class DropFileUserInterface { private document: Document; diff --git a/dev/ts/component/ThemedBpmnVisualization.ts b/dev/ts/component/ThemedBpmnVisualization.ts index be2fbb743a..141454af14 100644 --- a/dev/ts/component/ThemedBpmnVisualization.ts +++ b/dev/ts/component/ThemedBpmnVisualization.ts @@ -15,7 +15,7 @@ limitations under the License. */ import { BpmnVisualization, FlowKind, ShapeBpmnElementKind, ShapeUtil, StyleConfigurator, StyleDefault } from '../../../src/bpmn-visualization'; -import { logStartup } from '../utils/internal-helpers'; +import { logStartup } from '../internal/internal-helpers'; import { mxConstants } from '../../../src/component/mxgraph/initializer'; interface Theme { diff --git a/dev/ts/component/download.ts b/dev/ts/component/download.ts index 9a81497525..2ce27ba4a9 100644 --- a/dev/ts/component/download.ts +++ b/dev/ts/component/download.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { logDownload } from '../utils/internal-helpers'; +import { logDownload } from '../internal/internal-helpers'; // inspired from https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server function download(filename: string, contentType: string, text: string): void { diff --git a/dev/ts/utils/internal-helpers.ts b/dev/ts/internal/internal-helpers.ts similarity index 97% rename from dev/ts/utils/internal-helpers.ts rename to dev/ts/internal/internal-helpers.ts index 9023ba4945..b65bdd08f9 100644 --- a/dev/ts/utils/internal-helpers.ts +++ b/dev/ts/internal/internal-helpers.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { log } from './shared-helpers'; +import { log } from '../utils/shared-helpers'; export function _log(header: string, message: unknown, ...optionalParams: unknown[]): void { // eslint-disable-next-line no-console diff --git a/dev/ts/utils/main.ts b/dev/ts/utils/main.ts index 87416201de..017d9239c9 100644 --- a/dev/ts/utils/main.ts +++ b/dev/ts/utils/main.ts @@ -32,7 +32,7 @@ import type { GradientDirection, } from '../../../src/bpmn-visualization'; import { FlowKind, ShapeBpmnElementKind } from '../../../src/bpmn-visualization'; -import { fetchBpmnContent, logDownload, logError, logErrorAndOpenAlert, logStartup } from './internal-helpers'; +import { fetchBpmnContent, logDownload, logError, logErrorAndOpenAlert, logStartup } from '../internal/internal-helpers'; import { log } from './shared-helpers'; import { DropFileUserInterface } from '../component/DropFileUserInterface'; import { SvgExporter } from '../component/SvgExporter'; diff --git a/dev/ts/utils/shared-helpers.ts b/dev/ts/utils/shared-helpers.ts index fb3cd49070..b1a16851ba 100644 --- a/dev/ts/utils/shared-helpers.ts +++ b/dev/ts/utils/shared-helpers.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { _log } from './internal-helpers'; +import { _log } from '../internal/internal-helpers'; export function documentReady(callbackFunction: () => void): void { // see if DOM is already available @@ -30,4 +30,4 @@ export function log(message?: string, ...optionalParams: unknown[]): void { _log('[DEMO]', message, ...optionalParams); } -export { logError } from './internal-helpers'; +export { logError } from '../internal/internal-helpers'; From 12e857faf85072ba2c2371fc111abd490580af92 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:06:24 +0200 Subject: [PATCH 04/33] Revert "move internal-helpers.ts" This reverts commit bd7ab504cf75036dd0976974d2cfb8c92a402ab9. --- dev/ts/component/DropFileUserInterface.ts | 2 +- dev/ts/component/ThemedBpmnVisualization.ts | 2 +- dev/ts/component/download.ts | 2 +- dev/ts/{internal => utils}/internal-helpers.ts | 2 +- dev/ts/utils/main.ts | 2 +- dev/ts/utils/shared-helpers.ts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) rename dev/ts/{internal => utils}/internal-helpers.ts (97%) diff --git a/dev/ts/component/DropFileUserInterface.ts b/dev/ts/component/DropFileUserInterface.ts index 7cfe23a60d..1d1d5a2555 100644 --- a/dev/ts/component/DropFileUserInterface.ts +++ b/dev/ts/component/DropFileUserInterface.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { logErrorAndOpenAlert } from '../internal/internal-helpers'; +import { logErrorAndOpenAlert } from '../utils/internal-helpers'; export class DropFileUserInterface { private document: Document; diff --git a/dev/ts/component/ThemedBpmnVisualization.ts b/dev/ts/component/ThemedBpmnVisualization.ts index 141454af14..be2fbb743a 100644 --- a/dev/ts/component/ThemedBpmnVisualization.ts +++ b/dev/ts/component/ThemedBpmnVisualization.ts @@ -15,7 +15,7 @@ limitations under the License. */ import { BpmnVisualization, FlowKind, ShapeBpmnElementKind, ShapeUtil, StyleConfigurator, StyleDefault } from '../../../src/bpmn-visualization'; -import { logStartup } from '../internal/internal-helpers'; +import { logStartup } from '../utils/internal-helpers'; import { mxConstants } from '../../../src/component/mxgraph/initializer'; interface Theme { diff --git a/dev/ts/component/download.ts b/dev/ts/component/download.ts index 2ce27ba4a9..9a81497525 100644 --- a/dev/ts/component/download.ts +++ b/dev/ts/component/download.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { logDownload } from '../internal/internal-helpers'; +import { logDownload } from '../utils/internal-helpers'; // inspired from https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server function download(filename: string, contentType: string, text: string): void { diff --git a/dev/ts/internal/internal-helpers.ts b/dev/ts/utils/internal-helpers.ts similarity index 97% rename from dev/ts/internal/internal-helpers.ts rename to dev/ts/utils/internal-helpers.ts index b65bdd08f9..9023ba4945 100644 --- a/dev/ts/internal/internal-helpers.ts +++ b/dev/ts/utils/internal-helpers.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { log } from '../utils/shared-helpers'; +import { log } from './shared-helpers'; export function _log(header: string, message: unknown, ...optionalParams: unknown[]): void { // eslint-disable-next-line no-console diff --git a/dev/ts/utils/main.ts b/dev/ts/utils/main.ts index 017d9239c9..87416201de 100644 --- a/dev/ts/utils/main.ts +++ b/dev/ts/utils/main.ts @@ -32,7 +32,7 @@ import type { GradientDirection, } from '../../../src/bpmn-visualization'; import { FlowKind, ShapeBpmnElementKind } from '../../../src/bpmn-visualization'; -import { fetchBpmnContent, logDownload, logError, logErrorAndOpenAlert, logStartup } from '../internal/internal-helpers'; +import { fetchBpmnContent, logDownload, logError, logErrorAndOpenAlert, logStartup } from './internal-helpers'; import { log } from './shared-helpers'; import { DropFileUserInterface } from '../component/DropFileUserInterface'; import { SvgExporter } from '../component/SvgExporter'; diff --git a/dev/ts/utils/shared-helpers.ts b/dev/ts/utils/shared-helpers.ts index b1a16851ba..fb3cd49070 100644 --- a/dev/ts/utils/shared-helpers.ts +++ b/dev/ts/utils/shared-helpers.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { _log } from '../internal/internal-helpers'; +import { _log } from './internal-helpers'; export function documentReady(callbackFunction: () => void): void { // see if DOM is already available @@ -30,4 +30,4 @@ export function log(message?: string, ...optionalParams: unknown[]): void { _log('[DEMO]', message, ...optionalParams); } -export { logError } from '../internal/internal-helpers'; +export { logError } from './internal-helpers'; From 48906a4ac3c49026dffc6decaa8f9f6d33293a62 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:07:10 +0200 Subject: [PATCH 05/33] rename utils into shared --- dev/ts/component/DropFileUserInterface.ts | 2 +- dev/ts/component/ThemedBpmnVisualization.ts | 2 +- dev/ts/component/download.ts | 2 +- dev/ts/dev-bundle-index.ts | 4 ++-- dev/ts/{utils => shared}/internal-helpers.ts | 0 dev/ts/{utils => shared}/main.ts | 0 dev/ts/{utils => shared}/shared-helpers.ts | 0 7 files changed, 5 insertions(+), 5 deletions(-) rename dev/ts/{utils => shared}/internal-helpers.ts (100%) rename dev/ts/{utils => shared}/main.ts (100%) rename dev/ts/{utils => shared}/shared-helpers.ts (100%) diff --git a/dev/ts/component/DropFileUserInterface.ts b/dev/ts/component/DropFileUserInterface.ts index 1d1d5a2555..0376fde591 100644 --- a/dev/ts/component/DropFileUserInterface.ts +++ b/dev/ts/component/DropFileUserInterface.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { logErrorAndOpenAlert } from '../utils/internal-helpers'; +import { logErrorAndOpenAlert } from '../shared/internal-helpers'; export class DropFileUserInterface { private document: Document; diff --git a/dev/ts/component/ThemedBpmnVisualization.ts b/dev/ts/component/ThemedBpmnVisualization.ts index be2fbb743a..680ba84f50 100644 --- a/dev/ts/component/ThemedBpmnVisualization.ts +++ b/dev/ts/component/ThemedBpmnVisualization.ts @@ -15,7 +15,7 @@ limitations under the License. */ import { BpmnVisualization, FlowKind, ShapeBpmnElementKind, ShapeUtil, StyleConfigurator, StyleDefault } from '../../../src/bpmn-visualization'; -import { logStartup } from '../utils/internal-helpers'; +import { logStartup } from '../shared/internal-helpers'; import { mxConstants } from '../../../src/component/mxgraph/initializer'; interface Theme { diff --git a/dev/ts/component/download.ts b/dev/ts/component/download.ts index 9a81497525..2f31c0b170 100644 --- a/dev/ts/component/download.ts +++ b/dev/ts/component/download.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { logDownload } from '../utils/internal-helpers'; +import { logDownload } from '../shared/internal-helpers'; // inspired from https://ourcodeworld.com/articles/read/189/how-to-create-a-file-and-generate-a-download-with-javascript-in-the-browser-without-a-server function download(filename: string, contentType: string, text: string): void { diff --git a/dev/ts/dev-bundle-index.ts b/dev/ts/dev-bundle-index.ts index 38749610d5..a34058b8f7 100644 --- a/dev/ts/dev-bundle-index.ts +++ b/dev/ts/dev-bundle-index.ts @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -export * from './utils/main'; -export * from './utils/shared-helpers'; +export * from './shared/main'; +export * from './shared/shared-helpers'; export * from '../../src/bpmn-visualization'; diff --git a/dev/ts/utils/internal-helpers.ts b/dev/ts/shared/internal-helpers.ts similarity index 100% rename from dev/ts/utils/internal-helpers.ts rename to dev/ts/shared/internal-helpers.ts diff --git a/dev/ts/utils/main.ts b/dev/ts/shared/main.ts similarity index 100% rename from dev/ts/utils/main.ts rename to dev/ts/shared/main.ts diff --git a/dev/ts/utils/shared-helpers.ts b/dev/ts/shared/shared-helpers.ts similarity index 100% rename from dev/ts/utils/shared-helpers.ts rename to dev/ts/shared/shared-helpers.ts From bd9c0318ecb1602607aa2845048d842a5def37f7 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:08:48 +0200 Subject: [PATCH 06/33] convert bpmn-rendering.js to TS --- dev/public/bpmn-rendering.html | 2 +- dev/ts/pages/{bpmn-rendering.js => bpmn-rendering.ts} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename dev/ts/pages/{bpmn-rendering.js => bpmn-rendering.ts} (94%) diff --git a/dev/public/bpmn-rendering.html b/dev/public/bpmn-rendering.html index d7e5c83b31..5be6b7974f 100644 --- a/dev/public/bpmn-rendering.html +++ b/dev/public/bpmn-rendering.html @@ -18,7 +18,7 @@ font-weight: bold; } - + diff --git a/dev/ts/pages/bpmn-rendering.js b/dev/ts/pages/bpmn-rendering.ts similarity index 94% rename from dev/ts/pages/bpmn-rendering.js rename to dev/ts/pages/bpmn-rendering.ts index 46adaa19b0..7cc1dabe71 100644 --- a/dev/ts/pages/bpmn-rendering.js +++ b/dev/ts/pages/bpmn-rendering.ts @@ -16,12 +16,12 @@ limitations under the License. import { documentReady, log, logError, startBpmnVisualization } from '../dev-bundle-index'; -function statusFetchKO(errorMsg) { +const statusFetchKO = (errorMsg: string): void => { logError(errorMsg); const statusElt = document.getElementById('status-zone'); statusElt.innerText = errorMsg; statusElt.className = 'status-ko'; log('Status zone set with error:', errorMsg); -} +}; documentReady(() => startBpmnVisualization({ globalOptions: { container: 'bpmn-container' }, statusKoNotifier: statusFetchKO })); From d2a286faf3f5e59509e998c7892314461298c4ea Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:10:41 +0200 Subject: [PATCH 07/33] move index.js --- dev/public/index.html | 2 +- dev/{public/static/js => ts/pages}/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename dev/{public/static/js => ts/pages}/index.js (99%) diff --git a/dev/public/index.html b/dev/public/index.html index 0795abb326..fb54f6ce23 100644 --- a/dev/public/index.html +++ b/dev/public/index.html @@ -7,7 +7,7 @@ - + diff --git a/dev/public/static/js/index.js b/dev/ts/pages/index.js similarity index 99% rename from dev/public/static/js/index.js rename to dev/ts/pages/index.js index a3d884d851..367ee127f3 100644 --- a/dev/public/static/js/index.js +++ b/dev/ts/pages/index.js @@ -28,7 +28,7 @@ import { zoom, ZoomType, windowAlertStatusKoNotifier, -} from '../../../ts/dev-bundle-index'; +} from 'dev/ts/dev-bundle-index'; let fitOnLoad = true; let fitOptions = {}; From beaa1165f9e43ff7a529d82420b02fd3bdf58797 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:15:19 +0200 Subject: [PATCH 08/33] index.js: fix import --- dev/ts/pages/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/ts/pages/index.js b/dev/ts/pages/index.js index 367ee127f3..6c575c3418 100644 --- a/dev/ts/pages/index.js +++ b/dev/ts/pages/index.js @@ -28,7 +28,7 @@ import { zoom, ZoomType, windowAlertStatusKoNotifier, -} from 'dev/ts/dev-bundle-index'; +} from '../dev-bundle-index'; let fitOnLoad = true; let fitOptions = {}; From 3acfdac2e4b71cf282454b958bcae65d5fe7665c Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:16:16 +0200 Subject: [PATCH 09/33] vite config: mxgraph warning limit increase --- vite.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index 100d8171e7..b3c78a8935 100644 --- a/vite.config.js +++ b/vite.config.js @@ -48,7 +48,7 @@ export default defineConfig(({ mode }) => { }, }, }, - chunkSizeWarningLimit: 820, // mxgraph + chunkSizeWarningLimit: 838, // mxgraph }, preview: { port: 10002, From 8f46394fdb0ffad584cfb09c1cbaf9a647b10752 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:31:02 +0200 Subject: [PATCH 10/33] move elements-identification.js --- dev/public/elements-identification.html | 2 +- dev/{public/static/js => ts/pages}/elements-identification.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename dev/{public/static/js => ts/pages}/elements-identification.js (99%) diff --git a/dev/public/elements-identification.html b/dev/public/elements-identification.html index c43cf04756..05fcce5278 100644 --- a/dev/public/elements-identification.html +++ b/dev/public/elements-identification.html @@ -132,7 +132,7 @@ color: var(--color-flow) !important; } - +