From b34b7af6da577c761186c547ae05f2a81ac66c80 Mon Sep 17 00:00:00 2001 From: Jeffrey Lau Date: Thu, 2 Feb 2023 13:54:28 +0800 Subject: [PATCH] refactor(mmel): Extract libmmel out as a separate package --- .github/workflows/build.yml | 2 +- .gitignore | 3 + package.json | 5 +- packages/legacy/.swcrc | 6 + packages/legacy/package.json | 13 +- .../legacy/src/smart/model/FlowContainer.ts | 4 +- .../legacy/src/smart/model/Measurement.ts | 2 +- packages/legacy/src/smart/model/States.ts | 2 +- .../src/smart/model/ViewFunctionModel.ts | 8 +- packages/legacy/src/smart/model/checklist.ts | 6 +- .../smart/model/editor/commands/comment.ts | 2 +- .../src/smart/model/editor/commands/data.ts | 2 +- .../smart/model/editor/commands/elements.ts | 4 +- .../smart/model/editor/commands/reference.ts | 2 +- .../src/smart/model/editor/commands/role.ts | 2 +- .../smart/model/editor/components/comment.ts | 2 +- .../model/editor/components/element/dc.ts | 2 +- .../editor/components/element/registry.ts | 6 +- .../smart/model/editor/components/enums.ts | 2 +- .../smart/model/editor/components/figure.ts | 2 +- .../smart/model/editor/components/links.ts | 2 +- .../src/smart/model/editor/components/meta.ts | 2 +- .../smart/model/editor/components/notes.ts | 2 +- .../smart/model/editor/components/pages.ts | 2 +- .../model/editor/components/provision.ts | 2 +- .../src/smart/model/editor/components/ref.ts | 2 +- .../smart/model/editor/components/roles.ts | 2 +- .../smart/model/editor/components/sections.ts | 2 +- .../smart/model/editor/components/table.ts | 2 +- .../smart/model/editor/components/terms.ts | 2 +- .../src/smart/model/editor/components/vars.ts | 2 +- .../src/smart/model/editor/components/view.ts | 2 +- .../smart/model/editor/hybird/distributor.ts | 4 +- .../smart/model/editor/hybird/egateedit.ts | 2 +- .../legacy/src/smart/model/editormodel.ts | 14 +- packages/legacy/src/smart/model/json.ts | 8 +- .../legacy/src/smart/model/modelwrapper.ts | 8 +- .../src/smart/ui/checklist/AttributeField.tsx | 4 +- .../src/smart/ui/checklist/CustomFields.tsx | 4 +- .../src/smart/ui/checklist/ProvisionField.tsx | 2 +- .../src/smart/ui/comment/NodeComment.tsx | 2 +- .../description/ComponentDescription.tsx | 4 +- .../ui/common/description/ComponentList.tsx | 6 +- .../ui/common/description/FigureViewer.tsx | 2 +- .../ui/common/description/Multimedia.tsx | 2 +- .../ui/common/description/TableViewer.tsx | 2 +- .../smart/ui/common/description/approval.tsx | 2 +- .../src/smart/ui/common/description/data.tsx | 4 +- .../smart/ui/common/description/fields.tsx | 2 +- .../smart/ui/common/description/process.tsx | 2 +- .../legacy/src/smart/ui/common/fields.tsx | 2 +- .../common/listmanagement/listPopoverItem.tsx | 4 +- .../src/smart/ui/control/newComponentPane.tsx | 2 +- .../src/smart/ui/dialog/EditorDialogs.tsx | 2 +- .../legacy/src/smart/ui/edit/LinkEdit.tsx | 2 +- .../legacy/src/smart/ui/edit/NoteEdit.tsx | 2 +- .../src/smart/ui/edit/SectionEditPage.tsx | 2 +- .../legacy/src/smart/ui/edit/TermEdit.tsx | 2 +- .../src/smart/ui/edit/ViewProfileEdit.tsx | 2 +- .../legacy/src/smart/ui/edit/approvaledit.tsx | 2 +- .../src/smart/ui/edit/attributeedit.tsx | 2 +- .../ui/edit/components/AttributeList.tsx | 6 +- .../smart/ui/edit/components/EdgeListEdit.tsx | 2 +- .../src/smart/ui/edit/components/NoteList.tsx | 4 +- .../ui/edit/components/ProvisionList.tsx | 4 +- .../ui/edit/components/ReferenceSelector.tsx | 2 +- .../smart/ui/edit/components/RoleSelector.tsx | 2 +- .../legacy/src/smart/ui/edit/egateedit.tsx | 2 +- .../legacy/src/smart/ui/edit/enumedit.tsx | 2 +- .../src/smart/ui/edit/enumvalueedit.tsx | 2 +- .../src/smart/ui/edit/figure/FigureEdit.tsx | 2 +- .../smart/ui/edit/figure/FigureItemEdit.tsx | 2 +- .../src/smart/ui/edit/measurementedit.tsx | 2 +- .../legacy/src/smart/ui/edit/metaedit.tsx | 2 +- .../legacy/src/smart/ui/edit/processedit.tsx | 4 +- .../src/smart/ui/edit/provisionedit.tsx | 2 +- packages/legacy/src/smart/ui/edit/refedit.tsx | 2 +- .../legacy/src/smart/ui/edit/roleedit.tsx | 2 +- .../ui/edit/table/ClassItemDisplayEdit.tsx | 2 +- .../src/smart/ui/edit/table/EditClassView.tsx | 4 +- .../src/smart/ui/edit/table/EditTableView.tsx | 2 +- .../edit/table/TableClassDefinitionEdit.tsx | 2 +- .../smart/ui/edit/table/TableClassItem.tsx | 4 +- .../src/smart/ui/edit/table/TableEdit.tsx | 2 +- .../src/smart/ui/edit/table/TableItemEdit.tsx | 2 +- .../legacy/src/smart/ui/flowui/nodeUI.tsx | 2 +- packages/legacy/src/smart/ui/maineditor.tsx | 4 +- packages/legacy/src/smart/ui/mainviewer.tsx | 4 +- .../measurement/MeasurementValidationPane.tsx | 2 +- .../ui/measurement/VariableSettingItem.tsx | 2 +- .../ui/measurement/ViewProfileControl.tsx | 2 +- .../ui/measurement/fields/TableComboBox.tsx | 2 +- .../src/smart/ui/measurement/fields/text.tsx | 2 +- .../src/smart/ui/menu/EditorFileMenu.tsx | 2 +- .../src/smart/ui/popover/ComponentSummary.tsx | 2 +- .../legacy/src/smart/ui/popover/LinksList.tsx | 2 +- .../smart/ui/popover/NonTextReferenceList.tsx | 2 +- .../src/smart/ui/quickedit/approval.tsx | 2 +- .../src/smart/ui/quickedit/dataclass.tsx | 4 +- .../legacy/src/smart/ui/quickedit/egate.tsx | 2 +- .../legacy/src/smart/ui/quickedit/end.tsx | 2 +- .../legacy/src/smart/ui/quickedit/process.tsx | 2 +- .../src/smart/ui/quickedit/registry.tsx | 4 +- .../src/smart/ui/quickedit/signalevent.tsx | 2 +- .../legacy/src/smart/ui/quickedit/timer.tsx | 2 +- .../smart/ui/sidebar/QuickEditComponents.tsx | 2 +- .../smart/ui/sidebar/SimulationDetails.tsx | 6 +- .../smart/ui/sidebar/ViewComponentDetails.tsx | 8 +- .../legacy/src/smart/ui/sidebar/selected.tsx | 4 +- .../smart/ui/summary/ProvisionSettings.tsx | 2 +- .../ui/workspace/DCDocumentAttributes.tsx | 2 +- .../src/smart/ui/workspace/EnumAttribute.tsx | 2 +- packages/legacy/src/smart/utils/Comments.ts | 4 +- .../legacy/src/smart/utils/EditorFactory.ts | 8 +- .../legacy/src/smart/utils/IOFunctions.ts | 2 +- .../smart/utils/ModelAddComponentHandler.ts | 2 +- .../legacy/src/smart/utils/ModelFunctions.ts | 10 +- .../legacy/src/smart/utils/ModelImport.ts | 8 +- .../utils/ModelRemoveComponentHandler.ts | 2 +- .../legacy/src/smart/utils/SearchFunctions.ts | 4 +- packages/legacy/src/smart/utils/ai/aiagent.ts | 4 +- .../smart/utils/checklist/ChecklistViewer.ts | 4 +- packages/legacy/src/smart/utils/constants.ts | 4 +- .../utils/handler/cascadeModelHandler.ts | 6 +- .../smart/utils/measurement/BasicFunctions.ts | 2 +- .../src/smart/utils/measurement/Checker.ts | 4 +- .../src/smart/utils/measurement/Parser.ts | 2 +- .../legacy/src/smart/utils/parser_helpers.ts | 3 + packages/legacy/src/smart/utils/repo/io.ts | 10 +- .../legacy/src/smart/utils/typecheckings.ts | 4 +- packages/legacy/tsconfig.build.json | 9 +- packages/legacy/tsconfig.json | 3 + packages/libmmel/.eslintrc.js | 172 ++++++++++++ packages/libmmel/.gitignore | 1 + packages/libmmel/.swcrc | 14 + .../serialize/readme.md => libmmel/README.md} | 0 packages/libmmel/jest.config.ts | 264 ++++++++++++++++++ packages/libmmel/package.json | 66 +++++ .../src}/handler/datahandler.ts | 0 .../src}/handler/eventhandler.ts | 0 .../src}/handler/flowcontrolhandler.ts | 0 .../src}/handler/processhandler.ts | 0 .../src}/handler/supporthandler.ts | 0 .../src}/interface/baseinterface.ts | 0 .../src}/interface/datainterface.ts | 0 .../src}/interface/eventinterface.ts | 0 .../src}/interface/flowcontrolinterface.ts | 0 .../src}/interface/model.ts | 0 .../src}/interface/processinterface.ts | 0 .../src}/interface/supportinterface.ts | 0 packages/libmmel/src/main.test.ts | 60 ++++ .../serialize/MMEL.ts => libmmel/src/main.ts} | 5 +- .../src}/util/serailizeformater.ts | 0 .../src}/util/tokenizer.ts | 4 +- .../src}/util/validation.ts | 0 packages/libmmel/tsconfig.build.json | 19 ++ packages/libmmel/tsconfig.json | 45 +++ pnpm-lock.yaml | 103 +++++-- 158 files changed, 954 insertions(+), 229 deletions(-) create mode 100644 packages/legacy/src/smart/utils/parser_helpers.ts create mode 100644 packages/libmmel/.eslintrc.js create mode 100644 packages/libmmel/.gitignore create mode 100644 packages/libmmel/.swcrc rename packages/{legacy/src/smart/serialize/readme.md => libmmel/README.md} (100%) create mode 100644 packages/libmmel/jest.config.ts create mode 100644 packages/libmmel/package.json rename packages/{legacy/src/smart/serialize => libmmel/src}/handler/datahandler.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/handler/eventhandler.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/handler/flowcontrolhandler.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/handler/processhandler.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/handler/supporthandler.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/baseinterface.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/datainterface.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/eventinterface.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/flowcontrolinterface.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/model.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/processinterface.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/interface/supportinterface.ts (100%) create mode 100644 packages/libmmel/src/main.test.ts rename packages/{legacy/src/smart/serialize/MMEL.ts => libmmel/src/main.ts} (97%) rename packages/{legacy/src/smart/serialize => libmmel/src}/util/serailizeformater.ts (100%) rename packages/{legacy/src/smart/serialize => libmmel/src}/util/tokenizer.ts (97%) rename packages/{legacy/src/smart/serialize => libmmel/src}/util/validation.ts (100%) create mode 100644 packages/libmmel/tsconfig.build.json create mode 100644 packages/libmmel/tsconfig.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c912c9e..491736bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,7 +84,7 @@ jobs: if: steps.build_cache.outputs.cache-hit != 'true' shell: bash run: | - pnpm run -r build-dist + pnpm run -r dist - name: Save built artefacts to cache if: steps.build_cache.outputs.cache-hit != 'true' diff --git a/.gitignore b/.gitignore index a579e6a6..d28ad5b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ /dist .vs +*.d.ts +*.d.ts.map + .pnpm-store/ # Created by https://www.toptal.com/developers/gitignore/api/osx,vim,linux,emacs,eclipse,windows,textmate,webstorm,sublimetext,intellij+all,visualstudiocode,node,yarn diff --git a/package.json b/package.json index bdebe4da..c1a9627e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "@paneron/smartytrams", "version": "0.0.1", "description": "MMEL, SMART, etc.", - "main": "plugin.js", "repository": "https://github.com/paneron/extension-hls", "author": { "name": "Ribose Inc.", @@ -13,9 +12,11 @@ "build": "pnpm run -r build", "clean": "pnpm run -r clean", "dev": "pnpm run -r dev", + "dist": "pnpm run -r dist", "fix": "pnpm run -r fix", "lint": "pnpm run -r lint", - "test": "pnpm run -r test" + "test": "pnpm run -r test", + "typecheck": "pnpm run -r typecheck" }, "resolutions": {}, "dependencies": { diff --git a/packages/legacy/.swcrc b/packages/legacy/.swcrc index 78eddb36..6ea98cc7 100644 --- a/packages/legacy/.swcrc +++ b/packages/legacy/.swcrc @@ -5,6 +5,12 @@ }, "jsc": { "externalHelpers": false, + "paths": { + "@paneron/*": [ + "../*/src" + ] + }, + "baseUrl": ".", "parser": { "syntax": "typescript", "tsx": true, diff --git a/packages/legacy/package.json b/packages/legacy/package.json index 3f3fd0be..fc69ce94 100644 --- a/packages/legacy/package.json +++ b/packages/legacy/package.json @@ -2,7 +2,7 @@ "name": "@paneron/extension-hls", "version": "1.0.0-dev23", "description": "Paneron extension for SMART model editing", - "main": "plugin.js", + "main": "dist/plugin.js", "repository": "https://github.com/paneron/extension-hls", "author": { "name": "Ribose Inc.", @@ -27,7 +27,7 @@ "inject": "run-script-os", "inject:mac": "mkdirp $HOME/'Library/Application Support'/Paneron/plugins/${npm_package_name}; rsync -a ${npm_package_dist_dir}/ $HOME/'Library/Application Support'/Paneron/plugins/${npm_package_name}/", "inject:win32": "mkdirp \"%appdata%\\Paneron\\plugins\\@paneron\\extension-hls\" && xcopy /e /y %npm_package_dist_dir% \"%appdata%\\Paneron\\plugins\\@paneron\\extension-hls\" > nul", - "build-dist": "concurrently npm:build npm:build:decl", + "dist": "concurrently npm:build npm:build:decl", "build-inject": "pnpm run build && pnpm run inject", "build-typecheck": "concurrently npm:build npm:typecheck", "clean-build": "pnpm run clean; pnpm run build", @@ -50,13 +50,7 @@ "fix": "pnpm run lint --fix" }, "files": [ - "README.adoc", - "*.js", - "*.js.map", - "*.d.ts", - "**/*.js", - "**/*.js.map", - "**/*.d.ts" + "/dist" ], "resolutions": { "@types/react": "16.14.34", @@ -70,6 +64,7 @@ "@emotion/eslint-plugin": "^11.10.0", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", + "@paneron/libmmel": "workspace:*", "@react-three/drei": "^7.27.5", "@react-three/fiber": "^7.0.29", "@riboseinc/paneron-extension-glossarist": "^2.0.7", diff --git a/packages/legacy/src/smart/model/FlowContainer.ts b/packages/legacy/src/smart/model/FlowContainer.ts index e09323fe..e538da67 100644 --- a/packages/legacy/src/smart/model/FlowContainer.ts +++ b/packages/legacy/src/smart/model/FlowContainer.ts @@ -5,7 +5,7 @@ */ import { XYPosition } from 'react-flow-renderer'; -import { MMELEdge } from '../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { EditorModel, EditorNode, @@ -20,7 +20,7 @@ import { MMELLink, MMELRole, MMELTable, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { SerializedStyles } from '@emotion/react'; import React from 'react'; import { MMELRepo, RepoIndex } from './repo'; diff --git a/packages/legacy/src/smart/model/Measurement.ts b/packages/legacy/src/smart/model/Measurement.ts index ab3eef9b..8d11295c 100644 --- a/packages/legacy/src/smart/model/Measurement.ts +++ b/packages/legacy/src/smart/model/Measurement.ts @@ -6,7 +6,7 @@ import { MMELVariable, MMELView, VarType, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EditorModel } from './editormodel'; export interface MTreeNode { diff --git a/packages/legacy/src/smart/model/States.ts b/packages/legacy/src/smart/model/States.ts index 3b3c8997..29bcd441 100644 --- a/packages/legacy/src/smart/model/States.ts +++ b/packages/legacy/src/smart/model/States.ts @@ -2,7 +2,7 @@ import React from 'react'; import { NodeProps } from 'react-flow-renderer'; import { HistoryItem, PageHistory } from './history'; import { ModelWrapper } from './modelwrapper'; -import { DataType } from '../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { DataLinkEdge, NormalEdge, SelfLoopEdge } from '../ui/flowui/edgeUI'; import { ApprovalComponent, diff --git a/packages/legacy/src/smart/model/ViewFunctionModel.ts b/packages/legacy/src/smart/model/ViewFunctionModel.ts index 83ab3507..ee17fa93 100644 --- a/packages/legacy/src/smart/model/ViewFunctionModel.ts +++ b/packages/legacy/src/smart/model/ViewFunctionModel.ts @@ -1,13 +1,17 @@ import { SerializedStyles } from '@emotion/react'; import React from 'react'; -import { MMELDataAttribute } from '../serialize/interface/datainterface'; +import { textToMMEL } from '@paneron/libmmel'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { MMELProvision, MMELReference, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EditorNode } from './editormodel'; import { LegendInterface } from './States'; + +console.log(textToMMEL); + /** * For model viewer. The common interface for different functions. * Functions like checklist, version tracking etc. diff --git a/packages/legacy/src/smart/model/checklist.ts b/packages/legacy/src/smart/model/checklist.ts index d722e812..0a89eb85 100644 --- a/packages/legacy/src/smart/model/checklist.ts +++ b/packages/legacy/src/smart/model/checklist.ts @@ -2,9 +2,9 @@ * The data model for checklist */ -import { MMELProvision } from '../serialize/interface/supportinterface'; -import { MMELDataAttribute } from '../serialize/interface/datainterface'; -import { ModalityType } from '../utils/constants'; +import { MMELProvision } from '@paneron/libmmel/interface/supportinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { ModalityType } from '@/smart/utils/constants'; import { EditorApproval, EditorDataClass, diff --git a/packages/legacy/src/smart/model/editor/commands/comment.ts b/packages/legacy/src/smart/model/editor/commands/comment.ts index 33569508..5e5c1bfe 100644 --- a/packages/legacy/src/smart/model/editor/commands/comment.ts +++ b/packages/legacy/src/smart/model/editor/commands/comment.ts @@ -2,7 +2,7 @@ * This file centralizes the commands generated related to comment components */ -import { MMELComment } from '../../../serialize/interface/supportinterface'; +import { MMELComment } from '@paneron/libmmel/interface/supportinterface'; import { ModelAction } from '../model'; /** diff --git a/packages/legacy/src/smart/model/editor/commands/data.ts b/packages/legacy/src/smart/model/editor/commands/data.ts index ed00e6f6..5e40c245 100644 --- a/packages/legacy/src/smart/model/editor/commands/data.ts +++ b/packages/legacy/src/smart/model/editor/commands/data.ts @@ -2,7 +2,7 @@ * This file centralizes the commands generated related to registry and data class */ -import { MMELReference } from '../../../serialize/interface/supportinterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { EditorDataClass } from '../../editormodel'; import { RegistryCombined } from '../components/element/registry'; import { ModelAction } from '../model'; diff --git a/packages/legacy/src/smart/model/editor/commands/elements.ts b/packages/legacy/src/smart/model/editor/commands/elements.ts index 8d612789..6e4a341e 100644 --- a/packages/legacy/src/smart/model/editor/commands/elements.ts +++ b/packages/legacy/src/smart/model/editor/commands/elements.ts @@ -2,13 +2,13 @@ * This file centralizes the commands related to node elements */ -import { MMELEdge } from '../../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELLink, MMELNote, MMELProvision, MMELReference, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EditorEGate, EditorModel, diff --git a/packages/legacy/src/smart/model/editor/commands/reference.ts b/packages/legacy/src/smart/model/editor/commands/reference.ts index 7c2658de..c4e41ed2 100644 --- a/packages/legacy/src/smart/model/editor/commands/reference.ts +++ b/packages/legacy/src/smart/model/editor/commands/reference.ts @@ -2,7 +2,7 @@ * This file centralizes the commands related to reference */ -import { MMELReference } from '../../../serialize/interface/supportinterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { ModelAction } from '../model'; /** diff --git a/packages/legacy/src/smart/model/editor/commands/role.ts b/packages/legacy/src/smart/model/editor/commands/role.ts index 3d58e416..b36df259 100644 --- a/packages/legacy/src/smart/model/editor/commands/role.ts +++ b/packages/legacy/src/smart/model/editor/commands/role.ts @@ -2,7 +2,7 @@ * This file centralizes the commands related to roles */ -import { MMELRole } from '../../../serialize/interface/supportinterface'; +import { MMELRole } from '@paneron/libmmel/interface/supportinterface'; import { ModelAction } from '../model'; /** diff --git a/packages/legacy/src/smart/model/editor/components/comment.ts b/packages/legacy/src/smart/model/editor/components/comment.ts index b45c04c7..a62905d9 100644 --- a/packages/legacy/src/smart/model/editor/components/comment.ts +++ b/packages/legacy/src/smart/model/editor/components/comment.ts @@ -1,4 +1,4 @@ -import { MMELComment } from '../../../serialize/interface/supportinterface'; +import { MMELComment } from '@paneron/libmmel/interface/supportinterface'; import { EditorNode, EditorProcess } from '../../editormodel'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; diff --git a/packages/legacy/src/smart/model/editor/components/element/dc.ts b/packages/legacy/src/smart/model/editor/components/element/dc.ts index 8f50b07e..b0b14ada 100644 --- a/packages/legacy/src/smart/model/editor/components/element/dc.ts +++ b/packages/legacy/src/smart/model/editor/components/element/dc.ts @@ -1,4 +1,4 @@ -import { MMELSubprocess } from '../../../../serialize/interface/flowcontrolinterface'; +import { MMELSubprocess } from '@paneron/libmmel/interface/flowcontrolinterface'; import { fillRDCS } from '../../../../utils/ModelFunctions'; import { EditorDataClass, diff --git a/packages/legacy/src/smart/model/editor/components/element/registry.ts b/packages/legacy/src/smart/model/editor/components/element/registry.ts index c73affb5..3f001aee 100644 --- a/packages/legacy/src/smart/model/editor/components/element/registry.ts +++ b/packages/legacy/src/smart/model/editor/components/element/registry.ts @@ -1,6 +1,6 @@ -import { DataType } from '../../../../serialize/interface/baseinterface'; -import { MMELSubprocess } from '../../../../serialize/interface/flowcontrolinterface'; -import { isRegistry } from '../../../../serialize/util/validation'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELSubprocess } from '@paneron/libmmel/interface/flowcontrolinterface'; +import { isRegistry } from '@paneron/libmmel/util/validation'; import { createRegistry } from '../../../../utils/EditorFactory'; import { fillRDCS, diff --git a/packages/legacy/src/smart/model/editor/components/enums.ts b/packages/legacy/src/smart/model/editor/components/enums.ts index ba1da7c3..0561a752 100644 --- a/packages/legacy/src/smart/model/editor/components/enums.ts +++ b/packages/legacy/src/smart/model/editor/components/enums.ts @@ -1,4 +1,4 @@ -import { MMELEnum } from '../../../serialize/interface/datainterface'; +import { MMELEnum } from '@paneron/libmmel/interface/datainterface'; import { EditorNode, isEditorDataClass } from '../../editormodel'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; diff --git a/packages/legacy/src/smart/model/editor/components/figure.ts b/packages/legacy/src/smart/model/editor/components/figure.ts index ab8323be..762c521c 100644 --- a/packages/legacy/src/smart/model/editor/components/figure.ts +++ b/packages/legacy/src/smart/model/editor/components/figure.ts @@ -1,4 +1,4 @@ -import { MMELFigure } from '../../../serialize/interface/supportinterface'; +import { MMELFigure } from '@paneron/libmmel/interface/supportinterface'; import { EditorNode, isEditorProcess } from '../../editormodel'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; diff --git a/packages/legacy/src/smart/model/editor/components/links.ts b/packages/legacy/src/smart/model/editor/components/links.ts index 021e6525..f2ee42f0 100644 --- a/packages/legacy/src/smart/model/editor/components/links.ts +++ b/packages/legacy/src/smart/model/editor/components/links.ts @@ -1,5 +1,5 @@ import { useReducer } from 'react'; -import { MMELLink } from '../../../serialize/interface/supportinterface'; +import { MMELLink } from '@paneron/libmmel/interface/supportinterface'; import { UndoReducerInterface } from '../interface'; interface RefCascadeAction { diff --git a/packages/legacy/src/smart/model/editor/components/meta.ts b/packages/legacy/src/smart/model/editor/components/meta.ts index a16a415b..75e4bf4a 100644 --- a/packages/legacy/src/smart/model/editor/components/meta.ts +++ b/packages/legacy/src/smart/model/editor/components/meta.ts @@ -1,5 +1,5 @@ import { useReducer } from 'react'; -import { MMELMetadata } from '../../../serialize/interface/supportinterface'; +import { MMELMetadata } from '@paneron/libmmel/interface/supportinterface'; import { UndoReducerInterface } from '../interface'; interface EditAction { diff --git a/packages/legacy/src/smart/model/editor/components/notes.ts b/packages/legacy/src/smart/model/editor/components/notes.ts index eb8113e8..2e9d5d4f 100644 --- a/packages/legacy/src/smart/model/editor/components/notes.ts +++ b/packages/legacy/src/smart/model/editor/components/notes.ts @@ -1,5 +1,5 @@ import { useReducer } from 'react'; -import { MMELNote } from '../../../serialize/interface/supportinterface'; +import { MMELNote } from '@paneron/libmmel/interface/supportinterface'; import { refNotesReplace } from '../../../utils/handler/cascadeModelHandler'; import { UndoReducerInterface } from '../interface'; diff --git a/packages/legacy/src/smart/model/editor/components/pages.ts b/packages/legacy/src/smart/model/editor/components/pages.ts index 8560afd7..5d6fe9c9 100644 --- a/packages/legacy/src/smart/model/editor/components/pages.ts +++ b/packages/legacy/src/smart/model/editor/components/pages.ts @@ -2,7 +2,7 @@ import { useReducer } from 'react'; import { MMELEdge, MMELSubprocess, -} from '../../../serialize/interface/flowcontrolinterface'; +} from '@paneron/libmmel/interface/flowcontrolinterface'; import { createSubprocessComponent } from '../../../utils/EditorFactory'; import { dataPageReplace, diff --git a/packages/legacy/src/smart/model/editor/components/provision.ts b/packages/legacy/src/smart/model/editor/components/provision.ts index 3db3f2bb..fa609097 100644 --- a/packages/legacy/src/smart/model/editor/components/provision.ts +++ b/packages/legacy/src/smart/model/editor/components/provision.ts @@ -1,5 +1,5 @@ import { useReducer } from 'react'; -import { MMELProvision } from '../../../serialize/interface/supportinterface'; +import { MMELProvision } from '@paneron/libmmel/interface/supportinterface'; import { refProvisionReplace } from '../../../utils/handler/cascadeModelHandler'; import { UndoReducerInterface } from '../interface'; diff --git a/packages/legacy/src/smart/model/editor/components/ref.ts b/packages/legacy/src/smart/model/editor/components/ref.ts index 010b9599..6b212919 100644 --- a/packages/legacy/src/smart/model/editor/components/ref.ts +++ b/packages/legacy/src/smart/model/editor/components/ref.ts @@ -2,7 +2,7 @@ import { MMELNote, MMELProvision, MMELReference, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EditorNode, isEditorDataClass } from '../../editormodel'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; diff --git a/packages/legacy/src/smart/model/editor/components/roles.ts b/packages/legacy/src/smart/model/editor/components/roles.ts index 317ed4d7..792f1636 100644 --- a/packages/legacy/src/smart/model/editor/components/roles.ts +++ b/packages/legacy/src/smart/model/editor/components/roles.ts @@ -1,4 +1,4 @@ -import { MMELRole } from '../../../serialize/interface/supportinterface'; +import { MMELRole } from '@paneron/libmmel/interface/supportinterface'; import { RoleAttribute } from '../../../utils/handler/cascadeModelHandler'; import { EditorNode, diff --git a/packages/legacy/src/smart/model/editor/components/sections.ts b/packages/legacy/src/smart/model/editor/components/sections.ts index 6d60220c..21346849 100644 --- a/packages/legacy/src/smart/model/editor/components/sections.ts +++ b/packages/legacy/src/smart/model/editor/components/sections.ts @@ -1,4 +1,4 @@ -import { MMELTextSection } from '../../../serialize/interface/supportinterface'; +import { MMELTextSection } from '@paneron/libmmel/interface/supportinterface'; import { UndoReducerInterface } from '../interface'; import { ItemAction, useItems } from './itemTemplate'; diff --git a/packages/legacy/src/smart/model/editor/components/table.ts b/packages/legacy/src/smart/model/editor/components/table.ts index 5ebd4b93..5c1fb953 100644 --- a/packages/legacy/src/smart/model/editor/components/table.ts +++ b/packages/legacy/src/smart/model/editor/components/table.ts @@ -1,4 +1,4 @@ -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { EditorNode, isEditorProcess } from '../../editormodel'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; diff --git a/packages/legacy/src/smart/model/editor/components/terms.ts b/packages/legacy/src/smart/model/editor/components/terms.ts index 82fe4e3c..93f27910 100644 --- a/packages/legacy/src/smart/model/editor/components/terms.ts +++ b/packages/legacy/src/smart/model/editor/components/terms.ts @@ -1,4 +1,4 @@ -import { MMELTerm } from '../../../serialize/interface/supportinterface'; +import { MMELTerm } from '@paneron/libmmel/interface/supportinterface'; import { UndoReducerInterface } from '../interface'; import { ItemAction, useItems } from './itemTemplate'; diff --git a/packages/legacy/src/smart/model/editor/components/vars.ts b/packages/legacy/src/smart/model/editor/components/vars.ts index a0e3f54f..ce6a6a19 100644 --- a/packages/legacy/src/smart/model/editor/components/vars.ts +++ b/packages/legacy/src/smart/model/editor/components/vars.ts @@ -1,4 +1,4 @@ -import { MMELVariable } from '../../../serialize/interface/supportinterface'; +import { MMELVariable } from '@paneron/libmmel/interface/supportinterface'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; import { ItemAction, useItems } from './itemTemplate'; diff --git a/packages/legacy/src/smart/model/editor/components/view.ts b/packages/legacy/src/smart/model/editor/components/view.ts index 8fe308ac..52c6f650 100644 --- a/packages/legacy/src/smart/model/editor/components/view.ts +++ b/packages/legacy/src/smart/model/editor/components/view.ts @@ -1,4 +1,4 @@ -import { MMELView } from '../../../serialize/interface/supportinterface'; +import { MMELView } from '@paneron/libmmel/interface/supportinterface'; import { UndoReducerInterface } from '../interface'; import { ModelAction } from '../model'; import { ItemAction, useItems } from './itemTemplate'; diff --git a/packages/legacy/src/smart/model/editor/hybird/distributor.ts b/packages/legacy/src/smart/model/editor/hybird/distributor.ts index d97bb9ab..bd31c0d2 100644 --- a/packages/legacy/src/smart/model/editor/hybird/distributor.ts +++ b/packages/legacy/src/smart/model/editor/hybird/distributor.ts @@ -7,13 +7,13 @@ * A3. If an undo is needed, execute the 'compiled' actions appended to the undo action */ -import { MMELEdge } from '../../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELLink, MMELNote, MMELProvision, MMELReference, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EditorDataClass, EditorEGate, diff --git a/packages/legacy/src/smart/model/editor/hybird/egateedit.ts b/packages/legacy/src/smart/model/editor/hybird/egateedit.ts index 3ff4af9c..381c304e 100644 --- a/packages/legacy/src/smart/model/editor/hybird/egateedit.ts +++ b/packages/legacy/src/smart/model/editor/hybird/egateedit.ts @@ -1,4 +1,4 @@ -import { MMELEdge } from '../../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { EditorModel, isEditorEgate } from '../../editormodel'; import { ModelAction } from '../model'; import { HyEditAction } from './distributor'; diff --git a/packages/legacy/src/smart/model/editormodel.ts b/packages/legacy/src/smart/model/editormodel.ts index 18c2c8c4..843e78af 100644 --- a/packages/legacy/src/smart/model/editormodel.ts +++ b/packages/legacy/src/smart/model/editormodel.ts @@ -7,27 +7,27 @@ import { DataType, MMELNode, MMELObject, -} from '../serialize/interface/baseinterface'; +} from '@paneron/libmmel/interface/baseinterface'; import { MMELDataAttribute, MMELDataClass, MMELEnum, MMELRegistry, -} from '../serialize/interface/datainterface'; +} from '@paneron/libmmel/interface/datainterface'; import { MMELEndEvent, MMELSignalCatchEvent, MMELStartEvent, MMELTimerEvent, -} from '../serialize/interface/eventinterface'; +} from '@paneron/libmmel/interface/eventinterface'; import { MMELEGate, MMELSubprocess, -} from '../serialize/interface/flowcontrolinterface'; +} from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELApproval, MMELProcess, -} from '../serialize/interface/processinterface'; +} from '@paneron/libmmel/interface/processinterface'; import { MMELComment, MMELFigure, @@ -42,7 +42,7 @@ import { MMELTextSection, MMELVariable, MMELView, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { isApproval, isDataClass, @@ -54,7 +54,7 @@ import { isSignalEvent, isStartEvent, isTimerEvent, -} from '../serialize/util/validation'; +} from '@paneron/libmmel/util/validation'; export enum ModelType { EDIT = 'edit', diff --git a/packages/legacy/src/smart/model/json.ts b/packages/legacy/src/smart/model/json.ts index caf9d386..21d4e42f 100644 --- a/packages/legacy/src/smart/model/json.ts +++ b/packages/legacy/src/smart/model/json.ts @@ -6,9 +6,9 @@ * So, there is a need to convert the JSON model to MMEL model (and vice versa) */ -import { DataType, MMELNode } from '../serialize/interface/baseinterface'; -import { MMELEnum } from '../serialize/interface/datainterface'; -import { MMELSubprocess } from '../serialize/interface/flowcontrolinterface'; +import { DataType, MMELNode } from '@paneron/libmmel/interface/baseinterface'; +import { MMELEnum } from '@paneron/libmmel/interface/datainterface'; +import { MMELSubprocess } from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELFigure, MMELLink, @@ -21,7 +21,7 @@ import { MMELVariable, MMELView, NOTE_TYPE, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { JSONContextType } from '../utils/repo/io'; export interface MMELJSON { diff --git a/packages/legacy/src/smart/model/modelwrapper.ts b/packages/legacy/src/smart/model/modelwrapper.ts index 138939d3..aaa44406 100644 --- a/packages/legacy/src/smart/model/modelwrapper.ts +++ b/packages/legacy/src/smart/model/modelwrapper.ts @@ -8,8 +8,8 @@ */ import { Elements } from 'react-flow-renderer'; -import { MMELNode } from '../serialize/interface/baseinterface'; -import { MMELModel } from '../serialize/interface/model'; +import { MMELNode } from '@paneron/libmmel/interface/baseinterface'; +import { MMELModel } from '@paneron/libmmel/interface/model'; import { EditorDataClass, EditorModel, @@ -26,12 +26,12 @@ import { MMELEdge, MMELSubprocess, MMELSubprocessComponent, -} from '../serialize/interface/flowcontrolinterface'; +} from '@paneron/libmmel/interface/flowcontrolinterface'; import { isDataClass, isProcess, isStartEvent, -} from '../serialize/util/validation'; +} from '@paneron/libmmel/util/validation'; import { createDataLinkContainer, createEdgeContainer, diff --git a/packages/legacy/src/smart/ui/checklist/AttributeField.tsx b/packages/legacy/src/smart/ui/checklist/AttributeField.tsx index 3bcdfd7a..657f2e36 100644 --- a/packages/legacy/src/smart/ui/checklist/AttributeField.tsx +++ b/packages/legacy/src/smart/ui/checklist/AttributeField.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; -import { MMELReference } from '../../serialize/interface/supportinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { ReferenceList } from '../common/description/ComponentList'; import { NonEmptyFieldDescription } from '../common/description/fields'; import { CLDescriptionItem } from './CustomFields'; diff --git a/packages/legacy/src/smart/ui/checklist/CustomFields.tsx b/packages/legacy/src/smart/ui/checklist/CustomFields.tsx index 6ff21927..38ab2046 100644 --- a/packages/legacy/src/smart/ui/checklist/CustomFields.tsx +++ b/packages/legacy/src/smart/ui/checklist/CustomFields.tsx @@ -2,11 +2,11 @@ import { Checkbox } from '@blueprintjs/core'; import React from 'react'; import { mgdLabel } from '../../../css/form'; import { ChecklistPackage, getCheckListId } from '../../model/checklist'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { MMELProvision, MMELReference, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { DescribeProvision } from '../common/description/ComponentDescription'; import { DescribeAttribute } from '../common/description/data'; import ChecklistAttribute from './AttributeField'; diff --git a/packages/legacy/src/smart/ui/checklist/ProvisionField.tsx b/packages/legacy/src/smart/ui/checklist/ProvisionField.tsx index df41c99d..440e651e 100644 --- a/packages/legacy/src/smart/ui/checklist/ProvisionField.tsx +++ b/packages/legacy/src/smart/ui/checklist/ProvisionField.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { MMELProvision, MMELReference, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { ReferenceList } from '../common/description/ComponentList'; import { NonEmptyFieldDescription } from '../common/description/fields'; import { CLDescriptionItem } from './CustomFields'; diff --git a/packages/legacy/src/smart/ui/comment/NodeComment.tsx b/packages/legacy/src/smart/ui/comment/NodeComment.tsx index aeac3eee..5f54ec0d 100644 --- a/packages/legacy/src/smart/ui/comment/NodeComment.tsx +++ b/packages/legacy/src/smart/ui/comment/NodeComment.tsx @@ -1,7 +1,7 @@ import { Button } from '@blueprintjs/core'; import { Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; -import { MMELComment } from '../../serialize/interface/supportinterface'; +import { MMELComment } from '@paneron/libmmel/interface/supportinterface'; import { CommentInstance, materialComments } from '../../utils/Comments'; import CommentContainer from './CommentContainer'; diff --git a/packages/legacy/src/smart/ui/common/description/ComponentDescription.tsx b/packages/legacy/src/smart/ui/common/description/ComponentDescription.tsx index 72161664..57265842 100644 --- a/packages/legacy/src/smart/ui/common/description/ComponentDescription.tsx +++ b/packages/legacy/src/smart/ui/common/description/ComponentDescription.tsx @@ -8,10 +8,10 @@ import { MMELNote, MMELProvision, MMELReference, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EdgeList, ReferenceList } from './ComponentList'; import { DescriptionItem, NonEmptyFieldDescription } from './fields'; -import { MMELEdge } from '../../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import MGDLabel from '../../../MGDComponents/MGDLabel'; export const DescribeStart: React.FC = function () { diff --git a/packages/legacy/src/smart/ui/common/description/ComponentList.tsx b/packages/legacy/src/smart/ui/common/description/ComponentList.tsx index bab8ce1e..0edcc28d 100644 --- a/packages/legacy/src/smart/ui/common/description/ComponentList.tsx +++ b/packages/legacy/src/smart/ui/common/description/ComponentList.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { EditorRegistry } from '../../../model/editormodel'; -import { MMELDataAttribute } from '../../../serialize/interface/datainterface'; -import { MMELEdge } from '../../../serialize/interface/flowcontrolinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELNote, MMELProvision, MMELReference, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { toRefSummary } from '../../../utils/ModelFunctions'; import { DescribeEdge, diff --git a/packages/legacy/src/smart/ui/common/description/FigureViewer.tsx b/packages/legacy/src/smart/ui/common/description/FigureViewer.tsx index 823f8854..53ca5e96 100644 --- a/packages/legacy/src/smart/ui/common/description/FigureViewer.tsx +++ b/packages/legacy/src/smart/ui/common/description/FigureViewer.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { MMELFigure } from '../../../serialize/interface/supportinterface'; +import { MMELFigure } from '@paneron/libmmel/interface/supportinterface'; import { DescriptionItem } from './fields'; import MultimediaView from './Multimedia'; diff --git a/packages/legacy/src/smart/ui/common/description/Multimedia.tsx b/packages/legacy/src/smart/ui/common/description/Multimedia.tsx index f45d65f0..407f6e3c 100644 --- a/packages/legacy/src/smart/ui/common/description/Multimedia.tsx +++ b/packages/legacy/src/smart/ui/common/description/Multimedia.tsx @@ -1,6 +1,6 @@ import { Text } from '@blueprintjs/core'; import React, { CSSProperties } from 'react'; -import { BINARY_TYPE } from '../../../serialize/interface/supportinterface'; +import { BINARY_TYPE } from '@paneron/libmmel/interface/supportinterface'; // import ThreeD from '../../edit/figure/ThreeD'; const MultimediaView: React.FC<{ diff --git a/packages/legacy/src/smart/ui/common/description/TableViewer.tsx b/packages/legacy/src/smart/ui/common/description/TableViewer.tsx index 6b3b7d33..d612c092 100644 --- a/packages/legacy/src/smart/ui/common/description/TableViewer.tsx +++ b/packages/legacy/src/smart/ui/common/description/TableViewer.tsx @@ -1,6 +1,6 @@ import { HTMLTable, Text } from '@blueprintjs/core'; import React from 'react'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { DescriptionItem } from './fields'; const TableViewer: React.FC<{ diff --git a/packages/legacy/src/smart/ui/common/description/approval.tsx b/packages/legacy/src/smart/ui/common/description/approval.tsx index 5a838730..9f0736ee 100644 --- a/packages/legacy/src/smart/ui/common/description/approval.tsx +++ b/packages/legacy/src/smart/ui/common/description/approval.tsx @@ -3,7 +3,7 @@ import { EditorApproval, EditorRegistry } from '../../../model/editormodel'; import { MMELReference, MMELRole, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { ApprovalRecordList, ReferenceList } from './ComponentList'; import { ActorDescription, diff --git a/packages/legacy/src/smart/ui/common/description/data.tsx b/packages/legacy/src/smart/ui/common/description/data.tsx index 784138b3..fb227485 100644 --- a/packages/legacy/src/smart/ui/common/description/data.tsx +++ b/packages/legacy/src/smart/ui/common/description/data.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { EditorDataClass, EditorRegistry } from '../../../model/editormodel'; -import { MMELDataAttribute } from '../../../serialize/interface/datainterface'; -import { MMELReference } from '../../../serialize/interface/supportinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { AttributeList, ReferenceList } from './ComponentList'; import { DescriptionItem, NonEmptyFieldDescription } from './fields'; diff --git a/packages/legacy/src/smart/ui/common/description/fields.tsx b/packages/legacy/src/smart/ui/common/description/fields.tsx index 664c3013..2e32a47b 100644 --- a/packages/legacy/src/smart/ui/common/description/fields.tsx +++ b/packages/legacy/src/smart/ui/common/description/fields.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { mgdLabel } from '../../../../css/form'; import { HistoryAction } from '../../../model/editor/history'; import { HistoryItem } from '../../../model/history'; -import { MMELRole } from '../../../serialize/interface/supportinterface'; +import { MMELRole } from '@paneron/libmmel/interface/supportinterface'; interface Breadcrumb { label: JSX.Element; diff --git a/packages/legacy/src/smart/ui/common/description/process.tsx b/packages/legacy/src/smart/ui/common/description/process.tsx index f0ba3da2..0b4ba917 100644 --- a/packages/legacy/src/smart/ui/common/description/process.tsx +++ b/packages/legacy/src/smart/ui/common/description/process.tsx @@ -5,7 +5,7 @@ import { MMELProvision, MMELReference, MMELRole, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { ActorDescription, DescriptionItem } from './fields'; import { MeasurementList, NotesList, ProvisionList } from './ComponentList'; diff --git a/packages/legacy/src/smart/ui/common/fields.tsx b/packages/legacy/src/smart/ui/common/fields.tsx index 70e42545..1fbd0bb1 100644 --- a/packages/legacy/src/smart/ui/common/fields.tsx +++ b/packages/legacy/src/smart/ui/common/fields.tsx @@ -21,7 +21,7 @@ import { shame__mystery_container, shame__mystery_container__column, } from '../../../css/shame'; -import { MMELTable } from '../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; export interface IAdditionalListButton { text: string; diff --git a/packages/legacy/src/smart/ui/common/listmanagement/listPopoverItem.tsx b/packages/legacy/src/smart/ui/common/listmanagement/listPopoverItem.tsx index d9994097..e3c416db 100644 --- a/packages/legacy/src/smart/ui/common/listmanagement/listPopoverItem.tsx +++ b/packages/legacy/src/smart/ui/common/listmanagement/listPopoverItem.tsx @@ -2,8 +2,8 @@ import { Dialog } from '@blueprintjs/core'; import React, { useState } from 'react'; import { dialogLayout } from '../../../../css/layout'; import { EditorModel } from '../../../model/editormodel'; -import { MMELObject } from '../../../serialize/interface/baseinterface'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELObject } from '@paneron/libmmel/interface/baseinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter, diff --git a/packages/legacy/src/smart/ui/control/newComponentPane.tsx b/packages/legacy/src/smart/ui/control/newComponentPane.tsx index 2de1d022..4033b720 100644 --- a/packages/legacy/src/smart/ui/control/newComponentPane.tsx +++ b/packages/legacy/src/smart/ui/control/newComponentPane.tsx @@ -3,7 +3,7 @@ import { mgdLabel } from '../../../css/form'; import MGDComponentBar from '../../MGDComponents/MGDComponentBar'; import MGDContainer from '../../MGDComponents/MGDContainer'; import MGDProcessBox from '../../MGDComponents/MGDProcessBox'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { DragAndDropNewFormatType, NewComponentTypes, diff --git a/packages/legacy/src/smart/ui/dialog/EditorDialogs.tsx b/packages/legacy/src/smart/ui/dialog/EditorDialogs.tsx index 9e2d1ddf..a1c6e772 100644 --- a/packages/legacy/src/smart/ui/dialog/EditorDialogs.tsx +++ b/packages/legacy/src/smart/ui/dialog/EditorDialogs.tsx @@ -12,7 +12,7 @@ import { EditableNodeTypes, EditAction, } from '../../utils/constants'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import EditProcessPage from '../edit/processedit'; import EditApprovalPage from '../edit/approvaledit'; import EditEGatePage from '../edit/egateedit'; diff --git a/packages/legacy/src/smart/ui/edit/LinkEdit.tsx b/packages/legacy/src/smart/ui/edit/LinkEdit.tsx index 942e6e5e..eff03cf3 100644 --- a/packages/legacy/src/smart/ui/edit/LinkEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/LinkEdit.tsx @@ -4,7 +4,7 @@ import { LINK_TYPE, LINK_TYPES, MMELLink, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { NormalComboBox, NormalTextField } from '../common/fields'; import { IMMELObject } from '../common/listmanagement/listPopoverItem'; diff --git a/packages/legacy/src/smart/ui/edit/NoteEdit.tsx b/packages/legacy/src/smart/ui/edit/NoteEdit.tsx index b43206dc..dd9c4ee0 100644 --- a/packages/legacy/src/smart/ui/edit/NoteEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/NoteEdit.tsx @@ -5,7 +5,7 @@ import { MMELNote, NOTE_TYPE, NOTE_TYPES, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { getModelAllRefs } from '../../utils/ModelFunctions'; import { MultiReferenceSelector, diff --git a/packages/legacy/src/smart/ui/edit/SectionEditPage.tsx b/packages/legacy/src/smart/ui/edit/SectionEditPage.tsx index 9a55e192..e90bc9cf 100644 --- a/packages/legacy/src/smart/ui/edit/SectionEditPage.tsx +++ b/packages/legacy/src/smart/ui/edit/SectionEditPage.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELTextSection } from '../../serialize/interface/supportinterface'; +import { MMELTextSection } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../utils/ModelFunctions'; import { createTextSection } from '../../utils/EditorFactory'; import { IListItem, IManageHandler, NormalTextField } from '../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/TermEdit.tsx b/packages/legacy/src/smart/ui/edit/TermEdit.tsx index f0dd8867..410b5040 100644 --- a/packages/legacy/src/smart/ui/edit/TermEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/TermEdit.tsx @@ -2,7 +2,7 @@ import { FormGroup } from '@blueprintjs/core'; // import { LocalizedConceptForm } from '@riboseinc/paneron-extension-glossarist/classes/localizedConcept/LocalizedConceptForm'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELTerm } from '../../serialize/interface/supportinterface'; +import { MMELTerm } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../utils/ModelFunctions'; import { createTerm } from '../../utils/EditorFactory'; import { IListItem, IManageHandler, NormalTextField } from '../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/ViewProfileEdit.tsx b/packages/legacy/src/smart/ui/edit/ViewProfileEdit.tsx index 72bd5e08..b338ef69 100644 --- a/packages/legacy/src/smart/ui/edit/ViewProfileEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/ViewProfileEdit.tsx @@ -8,7 +8,7 @@ import { } from '@blueprintjs/core'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELView, VarType } from '../../serialize/interface/supportinterface'; +import { MMELView, VarType } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../utils/ModelFunctions'; import { createView } from '../../utils/EditorFactory'; import { diff --git a/packages/legacy/src/smart/ui/edit/approvaledit.tsx b/packages/legacy/src/smart/ui/edit/approvaledit.tsx index ef72345b..6ff9138f 100644 --- a/packages/legacy/src/smart/ui/edit/approvaledit.tsx +++ b/packages/legacy/src/smart/ui/edit/approvaledit.tsx @@ -24,7 +24,7 @@ import { EditPageButtons } from './commons'; import { MMELReference, MMELRole, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { DescriptionItem } from '../common/description/fields'; import RoleSelector from './components/RoleSelector'; import RegistrySelector from './components/RegistrySelector'; diff --git a/packages/legacy/src/smart/ui/edit/attributeedit.tsx b/packages/legacy/src/smart/ui/edit/attributeedit.tsx index f698e9d1..00966c4d 100644 --- a/packages/legacy/src/smart/ui/edit/attributeedit.tsx +++ b/packages/legacy/src/smart/ui/edit/attributeedit.tsx @@ -6,7 +6,7 @@ import { isEditorDataClass, isEditorRegistry, } from '../../model/editormodel'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { getReferenceDCTypeName, referenceSorter, diff --git a/packages/legacy/src/smart/ui/edit/components/AttributeList.tsx b/packages/legacy/src/smart/ui/edit/components/AttributeList.tsx index 7a94dd01..a0f6a794 100644 --- a/packages/legacy/src/smart/ui/edit/components/AttributeList.tsx +++ b/packages/legacy/src/smart/ui/edit/components/AttributeList.tsx @@ -7,9 +7,9 @@ import { isEditorRegistry, } from '../../../model/editormodel'; import { RefTextSelection } from '../../../model/selectionImport'; -import { DataType } from '../../../serialize/interface/baseinterface'; -import { MMELDataAttribute } from '../../../serialize/interface/datainterface'; -import { MMELReference } from '../../../serialize/interface/supportinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { DATATYPE, MODAILITYOPTIONS } from '../../../utils/constants'; import { createDataAttribute } from '../../../utils/EditorFactory'; import { diff --git a/packages/legacy/src/smart/ui/edit/components/EdgeListEdit.tsx b/packages/legacy/src/smart/ui/edit/components/EdgeListEdit.tsx index 967ab9d5..348e444f 100644 --- a/packages/legacy/src/smart/ui/edit/components/EdgeListEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/components/EdgeListEdit.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { MMELEdge } from '../../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { NormalTextField } from '../../common/fields'; const EdgeQuickEdit: React.FC<{ diff --git a/packages/legacy/src/smart/ui/edit/components/NoteList.tsx b/packages/legacy/src/smart/ui/edit/components/NoteList.tsx index e428792b..34ba2770 100644 --- a/packages/legacy/src/smart/ui/edit/components/NoteList.tsx +++ b/packages/legacy/src/smart/ui/edit/components/NoteList.tsx @@ -3,13 +3,13 @@ import React from 'react'; import { useMemo } from 'react'; import { EditorModel } from '../../../model/editormodel'; import { RefTextSelection } from '../../../model/selectionImport'; -import { DataType } from '../../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELNote, MMELReference, NOTE_TYPE, NOTE_TYPES, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { createNote } from '../../../utils/EditorFactory'; import { findUniqueID, diff --git a/packages/legacy/src/smart/ui/edit/components/ProvisionList.tsx b/packages/legacy/src/smart/ui/edit/components/ProvisionList.tsx index 76fdc9b6..d71bab99 100644 --- a/packages/legacy/src/smart/ui/edit/components/ProvisionList.tsx +++ b/packages/legacy/src/smart/ui/edit/components/ProvisionList.tsx @@ -3,11 +3,11 @@ import React from 'react'; import { useMemo } from 'react'; import { EditorModel } from '../../../model/editormodel'; import { RefTextSelection } from '../../../model/selectionImport'; -import { DataType } from '../../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELProvision, MMELReference, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { MODAILITYOPTIONS, ModalityType } from '../../../utils/constants'; import { createProvision } from '../../../utils/EditorFactory'; import { diff --git a/packages/legacy/src/smart/ui/edit/components/ReferenceSelector.tsx b/packages/legacy/src/smart/ui/edit/components/ReferenceSelector.tsx index 3f031164..c3c705cf 100644 --- a/packages/legacy/src/smart/ui/edit/components/ReferenceSelector.tsx +++ b/packages/legacy/src/smart/ui/edit/components/ReferenceSelector.tsx @@ -6,7 +6,7 @@ import { MultiSelect, } from '@blueprintjs/select'; import React from 'react'; -import { MMELReference } from '../../../serialize/interface/supportinterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { toRefSummary } from '../../../utils/ModelFunctions'; const ReferenceMultiSelect = MultiSelect.ofType(); diff --git a/packages/legacy/src/smart/ui/edit/components/RoleSelector.tsx b/packages/legacy/src/smart/ui/edit/components/RoleSelector.tsx index 3c9ff097..0dbd33fa 100644 --- a/packages/legacy/src/smart/ui/edit/components/RoleSelector.tsx +++ b/packages/legacy/src/smart/ui/edit/components/RoleSelector.tsx @@ -5,7 +5,7 @@ import { ItemRenderer, Select, } from '@blueprintjs/select'; -import { MMELRole } from '../../../serialize/interface/supportinterface'; +import { MMELRole } from '@paneron/libmmel/interface/supportinterface'; import React from 'react'; const RoleSelect = Select.ofType(); diff --git a/packages/legacy/src/smart/ui/edit/egateedit.tsx b/packages/legacy/src/smart/ui/edit/egateedit.tsx index 85973326..6eb18386 100644 --- a/packages/legacy/src/smart/ui/edit/egateedit.tsx +++ b/packages/legacy/src/smart/ui/edit/egateedit.tsx @@ -8,7 +8,7 @@ import { EditorModel, EditorSubprocess, } from '../../model/editormodel'; -import { MMELEdge } from '../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { checkId, getModelAllMeasures, diff --git a/packages/legacy/src/smart/ui/edit/enumedit.tsx b/packages/legacy/src/smart/ui/edit/enumedit.tsx index 0d8bf394..ca9004ba 100644 --- a/packages/legacy/src/smart/ui/edit/enumedit.tsx +++ b/packages/legacy/src/smart/ui/edit/enumedit.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELEnum } from '../../serialize/interface/datainterface'; +import { MMELEnum } from '@paneron/libmmel/interface/datainterface'; import { checkId, defaultItemSorter } from '../../utils/ModelFunctions'; import { createEnum } from '../../utils/EditorFactory'; import { IListItem, IManageHandler, NormalTextField } from '../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/enumvalueedit.tsx b/packages/legacy/src/smart/ui/edit/enumvalueedit.tsx index 86cbc409..6b9f7456 100644 --- a/packages/legacy/src/smart/ui/edit/enumvalueedit.tsx +++ b/packages/legacy/src/smart/ui/edit/enumvalueedit.tsx @@ -2,7 +2,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import MGDDisplayPane from '../../MGDComponents/MGDDisplayPane'; import { EditorModel } from '../../model/editormodel'; -import { MMELEnumValue } from '../../serialize/interface/datainterface'; +import { MMELEnumValue } from '@paneron/libmmel/interface/datainterface'; import { createEnumValue } from '../../utils/EditorFactory'; import { NormalTextField } from '../common/fields'; import ListWithPopoverItem, { diff --git a/packages/legacy/src/smart/ui/edit/figure/FigureEdit.tsx b/packages/legacy/src/smart/ui/edit/figure/FigureEdit.tsx index 2bb573ee..6696ddaa 100644 --- a/packages/legacy/src/smart/ui/edit/figure/FigureEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/figure/FigureEdit.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { EditorModel } from '../../../model/editormodel'; -import { MMELFigure } from '../../../serialize/interface/supportinterface'; +import { MMELFigure } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../../utils/ModelFunctions'; import { createFig } from '../../../utils/EditorFactory'; import { IListItem, IManageHandler } from '../../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/figure/FigureItemEdit.tsx b/packages/legacy/src/smart/ui/edit/figure/FigureItemEdit.tsx index aaadc88b..4eaa89f6 100644 --- a/packages/legacy/src/smart/ui/edit/figure/FigureItemEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/figure/FigureItemEdit.tsx @@ -3,7 +3,7 @@ import { BINARY_TYPE, BINARY_TYPES, MMELFigure, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { NormalComboBox, NormalTextField } from '../../common/fields'; import { useContext } from 'react'; import { FILE_TYPE, handleFileOpen } from '../../../utils/IOFunctions'; diff --git a/packages/legacy/src/smart/ui/edit/measurementedit.tsx b/packages/legacy/src/smart/ui/edit/measurementedit.tsx index 8d121e43..e3cfc2d4 100644 --- a/packages/legacy/src/smart/ui/edit/measurementedit.tsx +++ b/packages/legacy/src/smart/ui/edit/measurementedit.tsx @@ -5,7 +5,7 @@ import { EditorModel } from '../../model/editormodel'; import { MMELVariable, VarType, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../utils/ModelFunctions'; import { MEASUREMENTTYPES } from '../../utils/constants'; import { createVariable } from '../../utils/EditorFactory'; diff --git a/packages/legacy/src/smart/ui/edit/metaedit.tsx b/packages/legacy/src/smart/ui/edit/metaedit.tsx index 43ff9913..1fbcd187 100644 --- a/packages/legacy/src/smart/ui/edit/metaedit.tsx +++ b/packages/legacy/src/smart/ui/edit/metaedit.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorAction } from '../../model/editor/state'; -import { MMELMetadata } from '../../serialize/interface/supportinterface'; +import { MMELMetadata } from '@paneron/libmmel/interface/supportinterface'; import { DescriptionItem } from '../common/description/fields'; import { NormalTextField } from '../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/processedit.tsx b/packages/legacy/src/smart/ui/edit/processedit.tsx index 20da9184..43c1402e 100644 --- a/packages/legacy/src/smart/ui/edit/processedit.tsx +++ b/packages/legacy/src/smart/ui/edit/processedit.tsx @@ -6,14 +6,14 @@ import { EditorProcess, EditorRegistry, } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELLink, MMELNote, MMELProvision, MMELReference, MMELRole, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { checkId, getModelAllRegs, diff --git a/packages/legacy/src/smart/ui/edit/provisionedit.tsx b/packages/legacy/src/smart/ui/edit/provisionedit.tsx index 392887b9..08327070 100644 --- a/packages/legacy/src/smart/ui/edit/provisionedit.tsx +++ b/packages/legacy/src/smart/ui/edit/provisionedit.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELProvision } from '../../serialize/interface/supportinterface'; +import { MMELProvision } from '@paneron/libmmel/interface/supportinterface'; import { getModelAllRefs } from '../../utils/ModelFunctions'; import { MODAILITYOPTIONS } from '../../utils/constants'; import { diff --git a/packages/legacy/src/smart/ui/edit/refedit.tsx b/packages/legacy/src/smart/ui/edit/refedit.tsx index 62719490..25334a29 100644 --- a/packages/legacy/src/smart/ui/edit/refedit.tsx +++ b/packages/legacy/src/smart/ui/edit/refedit.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELReference } from '../../serialize/interface/supportinterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { checkId, referenceSorter, diff --git a/packages/legacy/src/smart/ui/edit/roleedit.tsx b/packages/legacy/src/smart/ui/edit/roleedit.tsx index 3c203c58..d7dc0c62 100644 --- a/packages/legacy/src/smart/ui/edit/roleedit.tsx +++ b/packages/legacy/src/smart/ui/edit/roleedit.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorModel } from '../../model/editormodel'; -import { MMELRole } from '../../serialize/interface/supportinterface'; +import { MMELRole } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../utils/ModelFunctions'; import { createRole } from '../../utils/EditorFactory'; import { IListItem, IManageHandler, NormalTextField } from '../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/table/ClassItemDisplayEdit.tsx b/packages/legacy/src/smart/ui/edit/table/ClassItemDisplayEdit.tsx index 6eaa9117..aa16c4f7 100644 --- a/packages/legacy/src/smart/ui/edit/table/ClassItemDisplayEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/table/ClassItemDisplayEdit.tsx @@ -2,7 +2,7 @@ import { Button } from '@blueprintjs/core'; import React, { useState } from 'react'; import MGDButtonGroup from '../../../MGDComponents/MGDButtonGroup'; import MGDDisplayPane from '../../../MGDComponents/MGDDisplayPane'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { ReferenceSelector } from '../../common/fields'; const ClassItemDisplayEdit: React.FC<{ diff --git a/packages/legacy/src/smart/ui/edit/table/EditClassView.tsx b/packages/legacy/src/smart/ui/edit/table/EditClassView.tsx index 8039ce18..0fe5a706 100644 --- a/packages/legacy/src/smart/ui/edit/table/EditClassView.tsx +++ b/packages/legacy/src/smart/ui/edit/table/EditClassView.tsx @@ -2,8 +2,8 @@ import { Button, ButtonGroup, Dialog } from '@blueprintjs/core'; import React, { useState } from 'react'; import { useMemo } from 'react'; import { dialogLayout } from '../../../../css/layout'; -import { DataType } from '../../../serialize/interface/baseinterface'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { IListItem } from '../../common/fields'; import ListWithPopoverItem from '../../common/listmanagement/listPopoverItem'; import ClassItemDisplayEdit from './ClassItemDisplayEdit'; diff --git a/packages/legacy/src/smart/ui/edit/table/EditTableView.tsx b/packages/legacy/src/smart/ui/edit/table/EditTableView.tsx index 1c5bf62e..3c948450 100644 --- a/packages/legacy/src/smart/ui/edit/table/EditTableView.tsx +++ b/packages/legacy/src/smart/ui/edit/table/EditTableView.tsx @@ -2,7 +2,7 @@ import { Button } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import { useMemo } from 'react'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import MMELTableRow from './TableRow'; const EditTableView: React.FC<{ diff --git a/packages/legacy/src/smart/ui/edit/table/TableClassDefinitionEdit.tsx b/packages/legacy/src/smart/ui/edit/table/TableClassDefinitionEdit.tsx index 39cbf2c2..df4e0180 100644 --- a/packages/legacy/src/smart/ui/edit/table/TableClassDefinitionEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/table/TableClassDefinitionEdit.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import MGDDisplayPane from '../../../MGDComponents/MGDDisplayPane'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { IListItem, IManageHandler, diff --git a/packages/legacy/src/smart/ui/edit/table/TableClassItem.tsx b/packages/legacy/src/smart/ui/edit/table/TableClassItem.tsx index d21cce27..49c8b20d 100644 --- a/packages/legacy/src/smart/ui/edit/table/TableClassItem.tsx +++ b/packages/legacy/src/smart/ui/edit/table/TableClassItem.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { DataType } from '../../../serialize/interface/baseinterface'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { NormalComboBox, NormalTextField } from '../../common/fields'; export interface TableRowClass { diff --git a/packages/legacy/src/smart/ui/edit/table/TableEdit.tsx b/packages/legacy/src/smart/ui/edit/table/TableEdit.tsx index f0823651..6a656218 100644 --- a/packages/legacy/src/smart/ui/edit/table/TableEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/table/TableEdit.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { EditorModel } from '../../../model/editormodel'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { checkId, defaultItemSorter } from '../../../utils/ModelFunctions'; import { createTable } from '../../../utils/EditorFactory'; import { IListItem, IManageHandler } from '../../common/fields'; diff --git a/packages/legacy/src/smart/ui/edit/table/TableItemEdit.tsx b/packages/legacy/src/smart/ui/edit/table/TableItemEdit.tsx index cb83b7c8..1526549d 100644 --- a/packages/legacy/src/smart/ui/edit/table/TableItemEdit.tsx +++ b/packages/legacy/src/smart/ui/edit/table/TableItemEdit.tsx @@ -1,5 +1,5 @@ import { Button, ButtonGroup, FormGroup, Tab, Tabs } from '@blueprintjs/core'; -import { MMELTable } from '../../../serialize/interface/supportinterface'; +import { MMELTable } from '@paneron/libmmel/interface/supportinterface'; import { NormalTextField } from '../../common/fields'; import { useContext, useState } from 'react'; import { diff --git a/packages/legacy/src/smart/ui/flowui/nodeUI.tsx b/packages/legacy/src/smart/ui/flowui/nodeUI.tsx index 8f2da8b0..33361645 100644 --- a/packages/legacy/src/smart/ui/flowui/nodeUI.tsx +++ b/packages/legacy/src/smart/ui/flowui/nodeUI.tsx @@ -39,7 +39,7 @@ import NodeIDField from './NodeIDField'; import { MMELFigure, MMELTable, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import NonTextReferenceList from '../popover/NonTextReferenceList'; import TableViewer from '../common/description/TableViewer'; import FigureViewer from '../common/description/FigureViewer'; diff --git a/packages/legacy/src/smart/ui/maineditor.tsx b/packages/legacy/src/smart/ui/maineditor.tsx index e5bac8df..f397c82c 100644 --- a/packages/legacy/src/smart/ui/maineditor.tsx +++ b/packages/legacy/src/smart/ui/maineditor.tsx @@ -84,12 +84,12 @@ import { getHighlightedSVGColorById, SearchResultStyles, } from '../utils/SearchFunctions'; -import { MMELRole } from '../serialize/interface/supportinterface'; +import { MMELRole } from '@paneron/libmmel/interface/supportinterface'; import ModelReferenceView from './editreference/ModelReferenceView'; import DocumentReferenceView from './editreference/DocumentReferenceView'; import { RefTextSelection } from '../model/selectionImport'; import ImportFromSelectionButton from './popover/ImportFromSelectionButton'; -import { DataType } from '../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import EditorEditMenu from './menu/EditorEditMenu'; import { COMMITMSG, diff --git a/packages/legacy/src/smart/ui/mainviewer.tsx b/packages/legacy/src/smart/ui/mainviewer.tsx index 226d6479..8a8d43b2 100644 --- a/packages/legacy/src/smart/ui/mainviewer.tsx +++ b/packages/legacy/src/smart/ui/mainviewer.tsx @@ -49,8 +49,8 @@ import ChecklistConfigPane from './checklist/CheckListConfigPane'; import { MMELProvision, MMELReference, -} from '../serialize/interface/supportinterface'; -import { MMELDataAttribute } from '../serialize/interface/datainterface'; +} from '@paneron/libmmel/interface/supportinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import SimulationPane from './sidebar/SimulationPane'; import RegistrySummary from './summary/RegistrySummary'; import ProvisionSettings from './summary/ProvisionSettings'; diff --git a/packages/legacy/src/smart/ui/measurement/MeasurementValidationPane.tsx b/packages/legacy/src/smart/ui/measurement/MeasurementValidationPane.tsx index 9120287b..433251ac 100644 --- a/packages/legacy/src/smart/ui/measurement/MeasurementValidationPane.tsx +++ b/packages/legacy/src/smart/ui/measurement/MeasurementValidationPane.tsx @@ -9,7 +9,7 @@ import { MMELVariable, MMELView, VarType, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { measureTest } from '../../utils/measurement/Checker'; import updateMeasurementView from './MeasurementResultFormatter'; import updateParaView from './ParameterizedViewFormatter'; diff --git a/packages/legacy/src/smart/ui/measurement/VariableSettingItem.tsx b/packages/legacy/src/smart/ui/measurement/VariableSettingItem.tsx index cae4757c..b6349726 100644 --- a/packages/legacy/src/smart/ui/measurement/VariableSettingItem.tsx +++ b/packages/legacy/src/smart/ui/measurement/VariableSettingItem.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { CSSROOTVARIABLES } from '../../../css/root.css'; import { InputableVarType, VarInputInterface } from '../../model/Measurement'; -import { VarType } from '../../serialize/interface/supportinterface'; +import { VarType } from '@paneron/libmmel/interface/supportinterface'; import BooleanMeasureEdit from './fields/boolean'; import TableComboBox from './fields/TableComboBox'; import TextMeasureEdit from './fields/text'; diff --git a/packages/legacy/src/smart/ui/measurement/ViewProfileControl.tsx b/packages/legacy/src/smart/ui/measurement/ViewProfileControl.tsx index 9470d000..22b32778 100644 --- a/packages/legacy/src/smart/ui/measurement/ViewProfileControl.tsx +++ b/packages/legacy/src/smart/ui/measurement/ViewProfileControl.tsx @@ -3,7 +3,7 @@ import { Classes, Popover2, Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import MGDContainer from '../../MGDComponents/MGDContainer'; import MGDSidebar from '../../MGDComponents/MGDSidebar'; -import { MMELView } from '../../serialize/interface/supportinterface'; +import { MMELView } from '@paneron/libmmel/interface/supportinterface'; const ProfileControl: React.FC<{ values: Record; diff --git a/packages/legacy/src/smart/ui/measurement/fields/TableComboBox.tsx b/packages/legacy/src/smart/ui/measurement/fields/TableComboBox.tsx index 3aa2ad9b..0b88c96a 100644 --- a/packages/legacy/src/smart/ui/measurement/fields/TableComboBox.tsx +++ b/packages/legacy/src/smart/ui/measurement/fields/TableComboBox.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useMemo } from 'react'; import { EditorModel } from '../../../model/editormodel'; import { VarInputInterface } from '../../../model/Measurement'; -import { MMELVariable } from '../../../serialize/interface/supportinterface'; +import { MMELVariable } from '@paneron/libmmel/interface/supportinterface'; import { NormalTextField, NormalComboBox } from '../../common/fields'; function calOptions( diff --git a/packages/legacy/src/smart/ui/measurement/fields/text.tsx b/packages/legacy/src/smart/ui/measurement/fields/text.tsx index 28ef0363..999872fe 100644 --- a/packages/legacy/src/smart/ui/measurement/fields/text.tsx +++ b/packages/legacy/src/smart/ui/measurement/fields/text.tsx @@ -3,7 +3,7 @@ import { VarInputInterface } from '../../../model/Measurement'; import { MMELVariable, VarType, -} from '../../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { NormalTextField } from '../../common/fields'; function getDesc(v: MMELVariable) { diff --git a/packages/legacy/src/smart/ui/menu/EditorFileMenu.tsx b/packages/legacy/src/smart/ui/menu/EditorFileMenu.tsx index 9409385d..b0852af3 100644 --- a/packages/legacy/src/smart/ui/menu/EditorFileMenu.tsx +++ b/packages/legacy/src/smart/ui/menu/EditorFileMenu.tsx @@ -1,7 +1,7 @@ import React, { useContext } from 'react'; import { Menu, MenuDivider, MenuItem } from '@blueprintjs/core'; import { DatasetContext } from '@riboseinc/paneron-extension-kit/context'; -import { MMELToText } from '../../serialize/MMEL'; +import { MMELToText } from '@paneron/libmmel'; import { FILE_TYPE, saveToFileSystem } from '../../utils/IOFunctions'; import { EditorModel } from '../../model/editormodel'; diff --git a/packages/legacy/src/smart/ui/popover/ComponentSummary.tsx b/packages/legacy/src/smart/ui/popover/ComponentSummary.tsx index e84ee6fb..e53e57a1 100644 --- a/packages/legacy/src/smart/ui/popover/ComponentSummary.tsx +++ b/packages/legacy/src/smart/ui/popover/ComponentSummary.tsx @@ -13,7 +13,7 @@ import { EditorTimerEvent, getEditorDataClassById, } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { DescribableNodeTypes } from '../../utils/constants'; import { DescribeDC, DescribeRegistry } from '../common/description/data'; import ApprovalSummary from './components/ApprovalSummary'; diff --git a/packages/legacy/src/smart/ui/popover/LinksList.tsx b/packages/legacy/src/smart/ui/popover/LinksList.tsx index 9730c46b..1229b80e 100644 --- a/packages/legacy/src/smart/ui/popover/LinksList.tsx +++ b/packages/legacy/src/smart/ui/popover/LinksList.tsx @@ -1,7 +1,7 @@ import { Intent, Menu, MenuItem } from '@blueprintjs/core'; import React from 'react'; import { MMELRepo, RepoIndex } from '../../model/repo'; -import { MMELLink } from '../../serialize/interface/supportinterface'; +import { MMELLink } from '@paneron/libmmel/interface/supportinterface'; const LinksList: React.FC<{ links: Set; diff --git a/packages/legacy/src/smart/ui/popover/NonTextReferenceList.tsx b/packages/legacy/src/smart/ui/popover/NonTextReferenceList.tsx index 7052cb84..40d67ed4 100644 --- a/packages/legacy/src/smart/ui/popover/NonTextReferenceList.tsx +++ b/packages/legacy/src/smart/ui/popover/NonTextReferenceList.tsx @@ -4,7 +4,7 @@ import { BINARY_TYPE, MMELFigure, MMELTable, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { isMMELTable } from '../../model/editormodel'; const titles: Record = { diff --git a/packages/legacy/src/smart/ui/quickedit/approval.tsx b/packages/legacy/src/smart/ui/quickedit/approval.tsx index ee6ded72..8fbb1718 100644 --- a/packages/legacy/src/smart/ui/quickedit/approval.tsx +++ b/packages/legacy/src/smart/ui/quickedit/approval.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { ModelAction } from '../../model/editor/model'; import { EditorApproval, EditorModel } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { EditAction } from '../../utils/constants'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; import EditApprovalPage from '../edit/approvaledit'; diff --git a/packages/legacy/src/smart/ui/quickedit/dataclass.tsx b/packages/legacy/src/smart/ui/quickedit/dataclass.tsx index 72af9714..c3ad4c99 100644 --- a/packages/legacy/src/smart/ui/quickedit/dataclass.tsx +++ b/packages/legacy/src/smart/ui/quickedit/dataclass.tsx @@ -7,8 +7,8 @@ import { import { ModelAction } from '../../model/editor/model'; import { EditorDataClass, EditorModel } from '../../model/editormodel'; import { RefTextSelection } from '../../model/selectionImport'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; -import { MMELReference } from '../../serialize/interface/supportinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { DescriptionItem } from '../common/description/fields'; import { EditPageButtons } from '../edit/commons'; import AttributeListQuickEdit, { diff --git a/packages/legacy/src/smart/ui/quickedit/egate.tsx b/packages/legacy/src/smart/ui/quickedit/egate.tsx index 75e8025f..659d1ed5 100644 --- a/packages/legacy/src/smart/ui/quickedit/egate.tsx +++ b/packages/legacy/src/smart/ui/quickedit/egate.tsx @@ -5,7 +5,7 @@ import { EditorModel, EditorSubprocess, } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { EditAction } from '../../utils/constants'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; import EditEGatePage from '../edit/egateedit'; diff --git a/packages/legacy/src/smart/ui/quickedit/end.tsx b/packages/legacy/src/smart/ui/quickedit/end.tsx index 99aac580..74bada30 100644 --- a/packages/legacy/src/smart/ui/quickedit/end.tsx +++ b/packages/legacy/src/smart/ui/quickedit/end.tsx @@ -1,7 +1,7 @@ import { FormGroup } from '@blueprintjs/core'; import React from 'react'; import { EditorEndEvent } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { EditAction } from '../../utils/constants'; import { DescribeEnd } from '../common/description/ComponentDescription'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; diff --git a/packages/legacy/src/smart/ui/quickedit/process.tsx b/packages/legacy/src/smart/ui/quickedit/process.tsx index a6f2bb8c..bfb02550 100644 --- a/packages/legacy/src/smart/ui/quickedit/process.tsx +++ b/packages/legacy/src/smart/ui/quickedit/process.tsx @@ -11,7 +11,7 @@ import { EditorSubprocess, } from '../../model/editormodel'; import { RefTextSelection } from '../../model/selectionImport'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { EditAction } from '../../utils/constants'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; import EditProcessPage from '../edit/processedit'; diff --git a/packages/legacy/src/smart/ui/quickedit/registry.tsx b/packages/legacy/src/smart/ui/quickedit/registry.tsx index 66182d97..7f446f68 100644 --- a/packages/legacy/src/smart/ui/quickedit/registry.tsx +++ b/packages/legacy/src/smart/ui/quickedit/registry.tsx @@ -12,8 +12,8 @@ import { EditorRegistry, } from '../../model/editormodel'; import { RefTextSelection } from '../../model/selectionImport'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; -import { MMELReference } from '../../serialize/interface/supportinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELReference } from '@paneron/libmmel/interface/supportinterface'; import { DescriptionItem } from '../common/description/fields'; import { NormalTextField } from '../common/fields'; import { EditPageButtons } from '../edit/commons'; diff --git a/packages/legacy/src/smart/ui/quickedit/signalevent.tsx b/packages/legacy/src/smart/ui/quickedit/signalevent.tsx index 3af92783..3fb1b598 100644 --- a/packages/legacy/src/smart/ui/quickedit/signalevent.tsx +++ b/packages/legacy/src/smart/ui/quickedit/signalevent.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { ModelAction } from '../../model/editor/model'; import { EditorModel, EditorSignalEvent } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { EditAction } from '../../utils/constants'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; import EditSignalEventPage from '../edit/signaleventedit'; diff --git a/packages/legacy/src/smart/ui/quickedit/timer.tsx b/packages/legacy/src/smart/ui/quickedit/timer.tsx index 74a826b7..05fdd474 100644 --- a/packages/legacy/src/smart/ui/quickedit/timer.tsx +++ b/packages/legacy/src/smart/ui/quickedit/timer.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { ModelAction } from '../../model/editor/model'; import { EditorModel, EditorTimerEvent } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { EditAction } from '../../utils/constants'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; import EditTimerPage from '../edit/timeredit'; diff --git a/packages/legacy/src/smart/ui/sidebar/QuickEditComponents.tsx b/packages/legacy/src/smart/ui/sidebar/QuickEditComponents.tsx index b4dcec0f..b1d6f923 100644 --- a/packages/legacy/src/smart/ui/sidebar/QuickEditComponents.tsx +++ b/packages/legacy/src/smart/ui/sidebar/QuickEditComponents.tsx @@ -14,7 +14,7 @@ import { EditorTimerEvent, } from '../../model/editormodel'; import { RefTextSelection } from '../../model/selectionImport'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { QuickEditableNodeTypes } from '../../utils/constants'; import { DialogSetterInterface } from '../dialog/EditorDialogs'; import QuickEditApproval from '../quickedit/approval'; diff --git a/packages/legacy/src/smart/ui/sidebar/SimulationDetails.tsx b/packages/legacy/src/smart/ui/sidebar/SimulationDetails.tsx index 0e4ae604..b12c1a4b 100644 --- a/packages/legacy/src/smart/ui/sidebar/SimulationDetails.tsx +++ b/packages/legacy/src/smart/ui/sidebar/SimulationDetails.tsx @@ -9,15 +9,15 @@ import { isEditorTimerEvent, } from '../../model/editormodel'; import React from 'react'; -import { MMELEdge } from '../../serialize/interface/flowcontrolinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { Button, Text } from '@blueprintjs/core'; import { MainFlowNodeTypes } from '../../utils/constants'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELNote, MMELProvision, MMELRole, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { DescribeEGate, DescribeEnd, diff --git a/packages/legacy/src/smart/ui/sidebar/ViewComponentDetails.tsx b/packages/legacy/src/smart/ui/sidebar/ViewComponentDetails.tsx index 0191ee3b..8148f01d 100644 --- a/packages/legacy/src/smart/ui/sidebar/ViewComponentDetails.tsx +++ b/packages/legacy/src/smart/ui/sidebar/ViewComponentDetails.tsx @@ -19,15 +19,15 @@ import { isEditorSignalEvent, isEditorTimerEvent, } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; -import { MMELEdge } from '../../serialize/interface/flowcontrolinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELNote, MMELProvision, MMELReference, MMELRole, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { SelectableNodeTypes } from '../../utils/constants'; import { DescribeApproval } from '../common/description/approval'; import { diff --git a/packages/legacy/src/smart/ui/sidebar/selected.tsx b/packages/legacy/src/smart/ui/sidebar/selected.tsx index 83fb3669..d419e1ab 100644 --- a/packages/legacy/src/smart/ui/sidebar/selected.tsx +++ b/packages/legacy/src/smart/ui/sidebar/selected.tsx @@ -12,11 +12,11 @@ import { } from '../../utils/constants'; import MGDSidebar from '../../MGDComponents/MGDSidebar'; import { Describe } from './ViewComponentDetails'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { MMELProvision, MMELReference, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import QuickEdit from './QuickEditComponents'; import { RefTextSelection } from '../../model/selectionImport'; import { Dialog } from '@blueprintjs/core'; diff --git a/packages/legacy/src/smart/ui/summary/ProvisionSettings.tsx b/packages/legacy/src/smart/ui/summary/ProvisionSettings.tsx index d532e26f..ad0fad8b 100644 --- a/packages/legacy/src/smart/ui/summary/ProvisionSettings.tsx +++ b/packages/legacy/src/smart/ui/summary/ProvisionSettings.tsx @@ -12,7 +12,7 @@ import { MMELProvision, MMELReference, MMELRole, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { MODAILITYOPTIONS, ModalityType } from '../../utils/constants'; import { clauseSorter } from '../../utils/ModelFunctions'; import { NormalComboBox } from '../common/fields'; diff --git a/packages/legacy/src/smart/ui/workspace/DCDocumentAttributes.tsx b/packages/legacy/src/smart/ui/workspace/DCDocumentAttributes.tsx index 73f3471d..d13135e3 100644 --- a/packages/legacy/src/smart/ui/workspace/DCDocumentAttributes.tsx +++ b/packages/legacy/src/smart/ui/workspace/DCDocumentAttributes.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { EditorDataClass, EditorModel } from '../../model/editormodel'; import { SMARTDocumentStore } from '../../model/workspace'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { getModelAllRolesWithEmpty, getRegistryReference, diff --git a/packages/legacy/src/smart/ui/workspace/EnumAttribute.tsx b/packages/legacy/src/smart/ui/workspace/EnumAttribute.tsx index 2485eb86..464d2cd9 100644 --- a/packages/legacy/src/smart/ui/workspace/EnumAttribute.tsx +++ b/packages/legacy/src/smart/ui/workspace/EnumAttribute.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { MMELEnum } from '../../serialize/interface/datainterface'; +import { MMELEnum } from '@paneron/libmmel/interface/datainterface'; import { NormalComboBox } from '../common/fields'; const EnumAttribute: React.FC<{ diff --git a/packages/legacy/src/smart/utils/Comments.ts b/packages/legacy/src/smart/utils/Comments.ts index 39258506..86a2debb 100644 --- a/packages/legacy/src/smart/utils/Comments.ts +++ b/packages/legacy/src/smart/utils/Comments.ts @@ -1,5 +1,5 @@ -import { DataType } from '../serialize/interface/baseinterface'; -import { MMELComment } from '../serialize/interface/supportinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELComment } from '@paneron/libmmel/interface/supportinterface'; import { findUniqueID } from './ModelFunctions'; export interface CommentInstance { diff --git a/packages/legacy/src/smart/utils/EditorFactory.ts b/packages/legacy/src/smart/utils/EditorFactory.ts index fbe7d43b..2f56ad17 100644 --- a/packages/legacy/src/smart/utils/EditorFactory.ts +++ b/packages/legacy/src/smart/utils/EditorFactory.ts @@ -1,13 +1,13 @@ -import { DataType } from '../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELDataAttribute, MMELEnum, MMELEnumValue, -} from '../serialize/interface/datainterface'; +} from '@paneron/libmmel/interface/datainterface'; import { MMELEdge, MMELSubprocessComponent, -} from '../serialize/interface/flowcontrolinterface'; +} from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELFigure, MMELMetadata, @@ -21,7 +21,7 @@ import { MMELVariable, MMELView, VarType, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { EditorApproval, EditorDataClass, diff --git a/packages/legacy/src/smart/utils/IOFunctions.ts b/packages/legacy/src/smart/utils/IOFunctions.ts index cd7e42fa..742911f5 100644 --- a/packages/legacy/src/smart/utils/IOFunctions.ts +++ b/packages/legacy/src/smart/utils/IOFunctions.ts @@ -4,7 +4,7 @@ import { EditorModel } from '../model/editormodel'; import { MapProfile } from '../model/mapmodel'; import { createEditorModelWrapper, ModelWrapper } from '../model/modelwrapper'; import { SMARTWorkspace } from '../model/workspace'; -import { textToMMEL } from '../serialize/MMEL'; +import { textToMMEL } from '@paneron/libmmel'; import { LoggerInterface, MAPVERSION, diff --git a/packages/legacy/src/smart/utils/ModelAddComponentHandler.ts b/packages/legacy/src/smart/utils/ModelAddComponentHandler.ts index ca3fe33e..f563f205 100644 --- a/packages/legacy/src/smart/utils/ModelAddComponentHandler.ts +++ b/packages/legacy/src/smart/utils/ModelAddComponentHandler.ts @@ -11,7 +11,7 @@ import { EditorSubprocess, EditorTimerEvent, } from '../model/editormodel'; -import { DataType } from '../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { capitalizeString, findUniqueID, trydefaultID } from './ModelFunctions'; import { NewComponentTypes } from './constants'; import { diff --git a/packages/legacy/src/smart/utils/ModelFunctions.ts b/packages/legacy/src/smart/utils/ModelFunctions.ts index 63756740..8916b979 100644 --- a/packages/legacy/src/smart/utils/ModelFunctions.ts +++ b/packages/legacy/src/smart/utils/ModelFunctions.ts @@ -7,16 +7,20 @@ import { isEditorDataClass, isEditorRegistry, } from '../model/editormodel'; -import { MMELObject } from '../serialize/interface/baseinterface'; + +// test +import { textToMMEL } from '@paneron/libmmel'; + +import { MMELObject } from '@paneron/libmmel/interface/baseinterface'; import { MMELEdge, MMELSubprocess, -} from '../serialize/interface/flowcontrolinterface'; +} from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELMetadata, MMELReference, MMELRole, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { IListItem } from '../ui/common/fields'; const TypeReferenceHead = 'reference('; diff --git a/packages/legacy/src/smart/utils/ModelImport.ts b/packages/legacy/src/smart/utils/ModelImport.ts index 3e687c64..7e4f578c 100644 --- a/packages/legacy/src/smart/utils/ModelImport.ts +++ b/packages/legacy/src/smart/utils/ModelImport.ts @@ -9,12 +9,12 @@ import { isEditorProcess, isEditorRegistry, } from '../model/editormodel'; -import { DataType } from '../serialize/interface/baseinterface'; -import { MMELDataAttribute } from '../serialize/interface/datainterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { MMELEdge, MMELSubprocessComponent, -} from '../serialize/interface/flowcontrolinterface'; +} from '@paneron/libmmel/interface/flowcontrolinterface'; import { MMELFigure, MMELLink, @@ -24,7 +24,7 @@ import { MMELRole, MMELTable, MMELVariable, -} from '../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { trydefaultID, getRegistryReference, diff --git a/packages/legacy/src/smart/utils/ModelRemoveComponentHandler.ts b/packages/legacy/src/smart/utils/ModelRemoveComponentHandler.ts index 8c0822ac..6027c181 100644 --- a/packages/legacy/src/smart/utils/ModelRemoveComponentHandler.ts +++ b/packages/legacy/src/smart/utils/ModelRemoveComponentHandler.ts @@ -1,4 +1,4 @@ -import { DataType } from '../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { DeletableNodeTypes } from './constants'; export const DeleteConfirmMessgae: Record = { diff --git a/packages/legacy/src/smart/utils/SearchFunctions.ts b/packages/legacy/src/smart/utils/SearchFunctions.ts index 356793f8..a95cc4e3 100644 --- a/packages/legacy/src/smart/utils/SearchFunctions.ts +++ b/packages/legacy/src/smart/utils/SearchFunctions.ts @@ -18,8 +18,8 @@ import { } from '../model/editormodel'; import { createModelHistory, HistoryItem } from '../model/history'; import { LegendInterface } from '../model/States'; -import { DataType } from '../serialize/interface/baseinterface'; -import { isRegistry } from '../serialize/util/validation'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { isRegistry } from '@paneron/libmmel/util/validation'; import { SearchableNodeTypes } from './constants'; import { isSearchableNodeTypes } from './typecheckings'; diff --git a/packages/legacy/src/smart/utils/ai/aiagent.ts b/packages/legacy/src/smart/utils/ai/aiagent.ts index 3f58e241..83cb1a54 100644 --- a/packages/legacy/src/smart/utils/ai/aiagent.ts +++ b/packages/legacy/src/smart/utils/ai/aiagent.ts @@ -9,12 +9,12 @@ import { createEditorModelWrapper, ModelWrapper, } from '../../model/modelwrapper'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELLink, MMELNote, MMELTextSection, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { detectModality } from '../../ui/edit/components/ProvisionList'; import { createEdge, diff --git a/packages/legacy/src/smart/utils/checklist/ChecklistViewer.ts b/packages/legacy/src/smart/utils/checklist/ChecklistViewer.ts index f21d0da0..a7c92a78 100644 --- a/packages/legacy/src/smart/utils/checklist/ChecklistViewer.ts +++ b/packages/legacy/src/smart/utils/checklist/ChecklistViewer.ts @@ -4,11 +4,11 @@ import { flow_node__highlighed } from '../../../css/visual'; import { ChecklistPackage } from '../../model/checklist'; import { EditorModel } from '../../model/editormodel'; import { ViewFunctionInterface } from '../../model/ViewFunctionModel'; -import { MMELDataAttribute } from '../../serialize/interface/datainterface'; +import { MMELDataAttribute } from '@paneron/libmmel/interface/datainterface'; import { MMELProvision, MMELReference, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import CheckListAddon from '../../ui/checklist/CheckListAddon'; const okcolor = 'lightgreen'; diff --git a/packages/legacy/src/smart/utils/constants.ts b/packages/legacy/src/smart/utils/constants.ts index e56b898c..f179f0c4 100644 --- a/packages/legacy/src/smart/utils/constants.ts +++ b/packages/legacy/src/smart/utils/constants.ts @@ -1,7 +1,7 @@ import { OpenFileDialogProps } from '@riboseinc/paneron-extension-kit/types/dialogs'; import { ObjectDataset } from '@riboseinc/paneron-extension-kit/types/objects'; -import { DataType } from '../serialize/interface/baseinterface'; -import { VarType } from '../serialize/interface/supportinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { VarType } from '@paneron/libmmel/interface/supportinterface'; export const WSVERSION = 'v1.0.0-dev1'; export const MAPVERSION = 'v1.0.0-dev1'; diff --git a/packages/legacy/src/smart/utils/handler/cascadeModelHandler.ts b/packages/legacy/src/smart/utils/handler/cascadeModelHandler.ts index f487e10c..3f45fcfb 100644 --- a/packages/legacy/src/smart/utils/handler/cascadeModelHandler.ts +++ b/packages/legacy/src/smart/utils/handler/cascadeModelHandler.ts @@ -12,12 +12,12 @@ import { isEditorDataClass, isEditorProcess, } from '../../model/editormodel'; -import { DataType } from '../../serialize/interface/baseinterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; import { MMELNote, MMELProvision, -} from '../../serialize/interface/supportinterface'; -import { isApproval } from '../../serialize/util/validation'; +} from '@paneron/libmmel/interface/supportinterface'; +import { isApproval } from '@paneron/libmmel/util/validation'; import { setReplace } from '../ModelFunctions'; export type RoleAttribute = 'actor' | 'approver'; diff --git a/packages/legacy/src/smart/utils/measurement/BasicFunctions.ts b/packages/legacy/src/smart/utils/measurement/BasicFunctions.ts index 2516c99e..48981799 100644 --- a/packages/legacy/src/smart/utils/measurement/BasicFunctions.ts +++ b/packages/legacy/src/smart/utils/measurement/BasicFunctions.ts @@ -1,5 +1,5 @@ import { MTreeNode } from '../../model/Measurement'; -import { MMELVariable } from '../../serialize/interface/supportinterface'; +import { MMELVariable } from '@paneron/libmmel/interface/supportinterface'; import { MBinaryOperators, MBinOperatorTypes, diff --git a/packages/legacy/src/smart/utils/measurement/Checker.ts b/packages/legacy/src/smart/utils/measurement/Checker.ts index b4c4bf71..724f3943 100644 --- a/packages/legacy/src/smart/utils/measurement/Checker.ts +++ b/packages/legacy/src/smart/utils/measurement/Checker.ts @@ -14,8 +14,8 @@ import { MTestReport, } from '../../model/Measurement'; import { LegendInterface } from '../../model/States'; -import { MMELEdge } from '../../serialize/interface/flowcontrolinterface'; -import { MMELTable, VarType } from '../../serialize/interface/supportinterface'; +import { MMELEdge } from '@paneron/libmmel/interface/flowcontrolinterface'; +import { MMELTable, VarType } from '@paneron/libmmel/interface/supportinterface'; import { buildEdgeConnections } from '../ModelFunctions'; import { evaluateCondition, resolveMTNode } from './Evaluator'; import { parseMeasurement } from './Parser'; diff --git a/packages/legacy/src/smart/utils/measurement/Parser.ts b/packages/legacy/src/smart/utils/measurement/Parser.ts index 8c89ba34..88884675 100644 --- a/packages/legacy/src/smart/utils/measurement/Parser.ts +++ b/packages/legacy/src/smart/utils/measurement/Parser.ts @@ -1,5 +1,5 @@ import { MTreeNode } from '../../model/Measurement'; -import { isSpace } from '../ModelFunctions'; +import { isSpace } from '../parser_helpers'; import { createMTreeNodeWithOperator, createMTreeNodeWithValue, diff --git a/packages/legacy/src/smart/utils/parser_helpers.ts b/packages/legacy/src/smart/utils/parser_helpers.ts new file mode 100644 index 00000000..ca4fd786 --- /dev/null +++ b/packages/legacy/src/smart/utils/parser_helpers.ts @@ -0,0 +1,3 @@ +export function isSpace(x: string): boolean { + return /\s/.test(x); +} diff --git a/packages/legacy/src/smart/utils/repo/io.ts b/packages/legacy/src/smart/utils/repo/io.ts index 0a930c66..09dc6aa6 100644 --- a/packages/legacy/src/smart/utils/repo/io.ts +++ b/packages/legacy/src/smart/utils/repo/io.ts @@ -18,21 +18,21 @@ import { JSONRegistry, MMELJSON, } from '../../model/json'; -import { DataType, MMELNode } from '../../serialize/interface/baseinterface'; +import { DataType, MMELNode } from '@paneron/libmmel/interface/baseinterface'; import { MMELDataAttribute, MMELDataClass, -} from '../../serialize/interface/datainterface'; -import { MMELModel } from '../../serialize/interface/model'; +} from '@paneron/libmmel/interface/datainterface'; +import { MMELModel } from '@paneron/libmmel/interface/model'; import { MMELApproval, MMELProcess, -} from '../../serialize/interface/processinterface'; +} from '@paneron/libmmel/interface/processinterface'; import { MMELComment, MMELNote, MMELProvision, -} from '../../serialize/interface/supportinterface'; +} from '@paneron/libmmel/interface/supportinterface'; import { MODELVERSION } from '../constants'; import { createMetaData } from '../EditorFactory'; import * as Logger from '../../../lib/logger'; diff --git a/packages/legacy/src/smart/utils/typecheckings.ts b/packages/legacy/src/smart/utils/typecheckings.ts index c191e95d..5fef9942 100644 --- a/packages/legacy/src/smart/utils/typecheckings.ts +++ b/packages/legacy/src/smart/utils/typecheckings.ts @@ -1,6 +1,6 @@ import { EditorNode, isEditorDataClass } from '../model/editormodel'; -import { DataType } from '../serialize/interface/baseinterface'; -import { MMELEnum } from '../serialize/interface/datainterface'; +import { DataType } from '@paneron/libmmel/interface/baseinterface'; +import { MMELEnum } from '@paneron/libmmel/interface/datainterface'; import { BASICTYPES, DATATYPE, diff --git a/packages/legacy/tsconfig.build.json b/packages/legacy/tsconfig.build.json index 2bf657eb..e6153b1c 100644 --- a/packages/legacy/tsconfig.build.json +++ b/packages/legacy/tsconfig.build.json @@ -1,9 +1,5 @@ { "extends": "./tsconfig.json", - "compilerOptions": { - "composite": true, - "isolatedModules": true - }, "include": [ "src" ], @@ -12,5 +8,10 @@ "src/*.test.*", "spec/**/*.ts", "test/**/*.ts" + ], + "references": [ + { + "path": "../libmmel" + } ] } diff --git a/packages/legacy/tsconfig.json b/packages/legacy/tsconfig.json index 8b9d32eb..ba48ba51 100644 --- a/packages/legacy/tsconfig.json +++ b/packages/legacy/tsconfig.json @@ -25,6 +25,9 @@ "esModuleInterop": true, "baseUrl": ".", "paths": { + "@": ["src/plugin"], + "@/*": ["src/*"], + "@paneron/libmmel/*": ["../libmmel/src/*"] } }, "include": [ diff --git a/packages/libmmel/.eslintrc.js b/packages/libmmel/.eslintrc.js new file mode 100644 index 00000000..a980c78c --- /dev/null +++ b/packages/libmmel/.eslintrc.js @@ -0,0 +1,172 @@ +var path = require('path'); + +var rules = { + 'quotes' : [ + 'warn', + 'single', + { avoidEscape: true }, + ], + "require-jsdoc" : ["off"], + "valid-jsdoc" : ["off"], + "indent" : [ + "error", + 2, + { + SwitchCase : 1, + VariableDeclarator : { + "var" : 2, + "let" : 2, + "const" : 3, + }, + ignoredNodes : ["ConditionalExpression"], + }, + ], + "key-spacing" : [ + "error", + { + singleLine : { + beforeColon : true, + afterColon : true, + }, + multiLine : { + beforeColon : true, + afterColon : true, + align : "colon", + }, + }, + ], + "keyword-spacing" : [ + "error", + { + before : true, + after : true, + }, + ], + "spaced-comment" : [ + "error", + "always", + { + exceptions : ["-", "+", "=", "*"], + markers : ["=", "*/", "/*", "X", "//"], + }, + ], + "no-multi-spaces" : [ + 1, + { + exceptions : { + VariableDeclarator : true, + }, + }, + ], + "no-cond-assign" : [2, "except-parens"], + // "no-redeclare" : [ + // "error", + // { + // builtinGlobals : true, + // }, + // ], + "no-redeclare": "off", + "@typescript-eslint/no-redeclare": ["error"], + "dot-notation" : [ + 2, + { + allowKeywords : true, + }, + ], + "eqeqeq" : [2, "smart"], + "no-plusplus" : [ + "warn", + { + allowForLoopAfterthoughts : true, + }, + ], + "one-var" : [ + "off", // Enable once tests are set up + "consecutive", + ], + "object-curly-spacing" : [ + "error", + "always", + { + objectsInObjects : false, + arraysInObjects : false, + }, + ], + "quote-props" : [ + "error", + "consistent-as-needed", + { + keywords : true, + }, + ], + "camelcase" : ["warn"], + "max-len" : ["warn"], + "new-cap" : ["warn"], + + "key-spacing" : [ + "error", + { + singleLine : { + beforeColon : true, + afterColon : true, + }, + multiLine : { + beforeColon : true, + afterColon : true, + align : "colon", + }, + }, + ], + 'no-empty-function' : 'off', + 'react/prop-types' : 'off', + 'react/no-unknown-property' : ['error', { ignore : ['css'] }], + '@typescript-eslint/no-empty-function' : 'off', + '@typescript-eslint/no-non-null-asserted-nullish-coalescing' : 'warn', + 'no-unused-vars' : 'off', + '@typescript-eslint/no-unused-vars' : 'warn', + '@emotion/jsx-import' : 'error', + '@emotion/no-vanilla' : 'error', + '@emotion/import-from-emotion' : 'error', + '@emotion/styled-import' : 'error', +}; + +module.exports = { + root : true, + "env" : { + // "jest/globals" : true, + }, + "extends" : [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:@typescript-eslint/strict', + // "plugin:prettier/recommended", + ], + "parser" : "@typescript-eslint/parser", + "parserOptions" : { + project : path.join(__dirname, "tsconfig.json"), + }, + "settings" : { + react : { + version : "detect" + }, + "import/resolver" : { + typescript : {} + } + }, + "rules" : rules, + overrides : [ + { + files : ["*.js"], + rules : rules, + }, + { + "files" : ["spec/**"], + "plugins" : ["jest", "@emotion"], + "extends" : ["plugin:jest/recommended", "plugin:jest/style"], + "rules" : { + "jest/prefer-expect-assertions" : "off", + }, + }, + ], + rules : rules, +}; diff --git a/packages/libmmel/.gitignore b/packages/libmmel/.gitignore new file mode 100644 index 00000000..69341fd8 --- /dev/null +++ b/packages/libmmel/.gitignore @@ -0,0 +1 @@ +test_outputs/ diff --git a/packages/libmmel/.swcrc b/packages/libmmel/.swcrc new file mode 100644 index 00000000..78eddb36 --- /dev/null +++ b/packages/libmmel/.swcrc @@ -0,0 +1,14 @@ +{ + "$schema": "http://json.schemastore.org/swcrc", + "module": { + "type": "commonjs" + }, + "jsc": { + "externalHelpers": false, + "parser": { + "syntax": "typescript", + "tsx": true, + "decorators": true + } + } +} diff --git a/packages/legacy/src/smart/serialize/readme.md b/packages/libmmel/README.md similarity index 100% rename from packages/legacy/src/smart/serialize/readme.md rename to packages/libmmel/README.md diff --git a/packages/libmmel/jest.config.ts b/packages/libmmel/jest.config.ts new file mode 100644 index 00000000..83798308 --- /dev/null +++ b/packages/libmmel/jest.config.ts @@ -0,0 +1,264 @@ +/* + * For a detailed explanation regarding each configuration property and type + * check, visit: + * https://jestjs.io/docs/configuration + */ + +import { pathsToModuleNameMapper } from 'ts-jest'; +import { compilerOptions } from './tsconfig.json'; + +import type { JestConfigWithTsJest } from 'ts-jest'; + +const _pathsToModuleName: Record = pathsToModuleNameMapper( + compilerOptions.paths, + // { prefix : '/' }, +) ?? {}; + +const pathsToModuleName: Record = {} as Record; + +function isString(v : string | string[]): v is string { + return !Array.isArray(v); +} + +const transformPathsForJest = (rhs : string ) : string => { + return rhs.replace(/^\.\//, '/../'); +} + +Object.entries(_pathsToModuleName).forEach(([key, value]) => { + const newValue = isString(value) ? + transformPathsForJest(value) : + value.map(transformPathsForJest); + + pathsToModuleName[key] = newValue; +}) + +const jestConfig: JestConfigWithTsJest = { + // All imported modules in your tests should be mocked automatically + // automock: false, + + // Stop running tests after `n` failures + // bail: 0, + + // The directory where Jest should store its cached dependency information + // cacheDirectory: "/private/var/folders/v7/bpr811_x73bfcjbzg8mvb_v40000gq/T/jest_dz", + + // Automatically clear mock calls, instances, contexts and results before + // every test + clearMocks : true, + + // Indicates whether the coverage information should be collected while + // executing the test + collectCoverage : true, + + // An array of glob patterns indicating a set of files for which coverage + // information should be collected + // collectCoverageFrom: undefined, + + // The directory where Jest should output its coverage files + coverageDirectory : 'coverage', + + // An array of regexp pattern strings used to skip coverage collection + coveragePathIgnorePatterns : [ + '/dist/' + ], + + // Indicates which provider should be used to instrument code for coverage + // coverageProvider: "babel", + + // A list of reporter names that Jest uses when writing coverage reports + // coverageReporters: [ + // "json", + // "text", + // "lcov", + // "clover" + // ], + + // An object that configures minimum threshold enforcement for coverage + // results + // coverageThreshold: undefined, + + // A path to a custom dependency extractor + // dependencyExtractor: undefined, + + // Make calling deprecated APIs throw helpful error messages + // errorOnDeprecated: false, + + // The default configuration for fake timers + // fakeTimers: { + // "enableGlobally": false + // }, + + // Force coverage collection from ignored files using an array of glob + // patterns + // forceCoverageMatch: [], + + // A path to a module which exports an async function that is triggered once + // before all test suites + // globalSetup: undefined, + + // A path to a module which exports an async function that is triggered once + // after all test suites + // globalTeardown: undefined, + + // A set of global variables that need to be available in all test + // environments + // globals: {}, + + // The maximum amount of workers used to run your tests. Can be specified as + // % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as + // the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. + // maxWorkers: "50%", + + // An array of directory names to be searched recursively up from the + // requiring module's location + // moduleDirectories: [ + // "node_modules" + // ], + + // An array of file extensions your modules use + // moduleFileExtensions: [ + // "js", + // "mjs", + // "cjs", + // "jsx", + // "ts", + // "tsx", + // "json", + // "node" + // ], + + extensionsToTreatAsEsm : ['.ts', '.tsx'], + // A map from regular expressions to module names or to arrays of module + // names that allow to stub out resources with a single module + // moduleNameMapper: {}, + moduleNameMapper : pathsToModuleName, + + // An array of regexp pattern strings, matched against all module paths + // before considered 'visible' to the module loader + modulePathIgnorePatterns : [ + '/dist/', + ], + + // Activates notifications for test results + // notify: false, + + // An enum that specifies notification mode. Requires { notify: true } + // notifyMode: "failure-change", + + // A preset that is used as a base for Jest's configuration + // preset: undefined, + preset : 'ts-jest', + + // Run tests from one or more projects + // projects: undefined, + + // Use this configuration option to add custom reporters to Jest + // reporters: undefined, + + // Automatically reset mock state before every test + // resetMocks: false, + + // Reset the module registry before running each individual test + // resetModules: false, + + // A path to a custom resolver + // resolver: undefined, + + // Automatically restore mock state and implementation before every test + // restoreMocks: false, + + // The root directory that Jest should scan for tests and modules within + // rootDir: undefined, + + // A list of paths to directories that Jest should use to search for files in + roots : [ + '' + ], + + modulePaths : [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value + + // Allows you to use a custom runner instead of Jest's default test runner + // runner: "jest-runner", + + // The paths to modules that run some code to configure or set up the testing + // environment before each test + // setupFiles: [], + + // A list of paths to modules that run some code to configure or set up the + // testing framework before each test + // setupFilesAfterEnv: [], + + // The number of seconds after which a test is considered as slow and + // reported as such in the results. + // slowTestThreshold: 5, + + // A list of paths to snapshot serializer modules Jest should use for + // snapshot testing + // snapshotSerializers: [], + + // The test environment that will be used for testing + // testEnvironment: "jest-environment-node", + + // Options that will be passed to the testEnvironment + // testEnvironmentOptions: {}, + + // Adds a location field to test results + // testLocationInResults: false, + + // The glob patterns Jest uses to detect test files + // testMatch: [ + // "**/__tests__/**/*.[jt]s?(x)", + // "**/?(*.)+(spec|test).[tj]s?(x)" + // ], + + // An array of regexp pattern strings that are matched against all test paths, + // matched tests are skipped + // testPathIgnorePatterns: [ + // "/node_modules/" + // ], + testPathIgnorePatterns : [ + '/node_modules/', + '/dist/', + '/paneron-for-tests/', + ], + + // The regexp pattern or array of patterns that Jest uses to detect test files + // testRegex: [], + + // This option allows the use of a custom results processor + // testResultsProcessor: undefined, + + // This option allows use of a custom test runner + // testRunner: "jest-circus/runner", + + // A map from regular expressions to paths to transformers + // transform: undefined, + + // Use @swc/jest to support nodejs 14.x: + transform : { + '^.+\\.(t|j)sx?$' : ['@swc/jest', {}], + }, + + // An array of regexp pattern strings that are matched against all source + // file paths, matched files will skip transformation + // transformIgnorePatterns: [ + // "/node_modules/", + // "\\.pnp\\.[^\\/]+$" + // ], + + // An array of regexp pattern strings that are matched against all modules + // before the module loader will automatically return a mock for them + // unmockedModulePathPatterns: undefined, + + // Indicates whether each individual test should be reported during the run + // verbose: undefined, + + // An array of regexp patterns that are matched against all source file paths + // before re-running tests in watch mode + // watchPathIgnorePatterns: [], + + // Whether to use watchman for file crawling + // watchman: true, +}; + +export default jestConfig; diff --git a/packages/libmmel/package.json b/packages/libmmel/package.json new file mode 100644 index 00000000..da1aed23 --- /dev/null +++ b/packages/libmmel/package.json @@ -0,0 +1,66 @@ +{ + "name": "@paneron/libmmel", + "version": "0.0.0-dev1", + "description": "MMEL library", + "main": "dist/main.js", + "repository": "https://github.com/paneron/extension-hls", + "author": { + "name": "Ribose Inc.", + "email": "open.source@ribose.com" + }, + "src_dir": "src", + "dist_dir": "dist", + "scripts": { + "preinstall": "npx only-allow pnpm", + "diagnose": "tsc --diagnostics", + "typecheck": "tsc -p tsconfig.build.json --noEmit --pretty", + "build:decl": "tsc -p tsconfig.build.json --emitDeclarationOnly", + "build": "run-script-os", + "build:default": "swc ${npm_package_src_dir} --sync --ignore '*.test.*' --out-dir ${npm_package_dist_dir} --copy-files --extensions '.ts,.tsx,.js,.jsx,.json' && cp package.json ${npm_package_dist_dir}/", + "build:win32": "mkdirp %npm_package_dist_dir% && swc %npm_package_src_dir% --sync --out-dir %npm_package_dist_dir% --copy-files --extensions '.ts,.tsx,.js,.jsx,.json' && copy package.json %npm_package_dist_dir%", + "dist": "concurrently pnpm:build pnpm:build:decl", + "build-typecheck": "concurrently pnpm:build pnpm:typecheck", + "clean-build": "pnpm run clean; pnpm run build", + "clean-build-typecheck": "pnpm run clean; pnpm run build-typecheck", + "lint": "run-script-os", + "lint:default": "eslint ${npm_package_src_dir}/ --ext .ts,.tsx", + "lint:win32": "eslint %npm_package_src_dir%/ --ext .ts,.tsx", + "clean": "run-script-os", + "clean:default": "rimraf ${npm_package_dist_dir}/* *.tsbuildinfo", + "clean:win32": "rimraf %npm_package_dist_dir%/* *.tsbuildinfo", + "test": "jest", + "test:watch": "jest --watch", + "lint-typecheck": "concurrently npm:lint npm:typecheck", + "fix": "pnpm run lint --fix" + }, + "files": [ + "/dist" + ], + "devDependencies": { + "@swc/cli": "^0.1.62", + "@swc/core": "^1.3.58", + "@swc/jest": "^0.2.26", + "@types/jest": "^29.5.1", + "@types/node": "20.2.0", + "@typescript-eslint/eslint-plugin": "^5.59.6", + "@typescript-eslint/parser": "^5.59.6", + "concurrently": "^8.0.1", + "eslint": "^8.40.0", + "eslint-import-resolver-typescript": "^3.5.5", + "eslint-plugin-jest": "^27.2.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-react": "^7.32.2", + "eslint-plugin-react-hooks": "^4.6.0", + "fast-check": "^3.8.2", + "immer": "^10.0.2", + "jest": "^29.5.0", + "mkdirp": "^3.0.1", + "prop-types": "^15.8.1", + "rimraf": "^5.0.1", + "run-script-os": "^1.1.6", + "ts-jest": "^29.1.0", + "ts-node": "^10.9.1", + "typescript": "4.9.5" + }, + "license": "MIT" +} diff --git a/packages/legacy/src/smart/serialize/handler/datahandler.ts b/packages/libmmel/src/handler/datahandler.ts similarity index 100% rename from packages/legacy/src/smart/serialize/handler/datahandler.ts rename to packages/libmmel/src/handler/datahandler.ts diff --git a/packages/legacy/src/smart/serialize/handler/eventhandler.ts b/packages/libmmel/src/handler/eventhandler.ts similarity index 100% rename from packages/legacy/src/smart/serialize/handler/eventhandler.ts rename to packages/libmmel/src/handler/eventhandler.ts diff --git a/packages/legacy/src/smart/serialize/handler/flowcontrolhandler.ts b/packages/libmmel/src/handler/flowcontrolhandler.ts similarity index 100% rename from packages/legacy/src/smart/serialize/handler/flowcontrolhandler.ts rename to packages/libmmel/src/handler/flowcontrolhandler.ts diff --git a/packages/legacy/src/smart/serialize/handler/processhandler.ts b/packages/libmmel/src/handler/processhandler.ts similarity index 100% rename from packages/legacy/src/smart/serialize/handler/processhandler.ts rename to packages/libmmel/src/handler/processhandler.ts diff --git a/packages/legacy/src/smart/serialize/handler/supporthandler.ts b/packages/libmmel/src/handler/supporthandler.ts similarity index 100% rename from packages/legacy/src/smart/serialize/handler/supporthandler.ts rename to packages/libmmel/src/handler/supporthandler.ts diff --git a/packages/legacy/src/smart/serialize/interface/baseinterface.ts b/packages/libmmel/src/interface/baseinterface.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/baseinterface.ts rename to packages/libmmel/src/interface/baseinterface.ts diff --git a/packages/legacy/src/smart/serialize/interface/datainterface.ts b/packages/libmmel/src/interface/datainterface.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/datainterface.ts rename to packages/libmmel/src/interface/datainterface.ts diff --git a/packages/legacy/src/smart/serialize/interface/eventinterface.ts b/packages/libmmel/src/interface/eventinterface.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/eventinterface.ts rename to packages/libmmel/src/interface/eventinterface.ts diff --git a/packages/legacy/src/smart/serialize/interface/flowcontrolinterface.ts b/packages/libmmel/src/interface/flowcontrolinterface.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/flowcontrolinterface.ts rename to packages/libmmel/src/interface/flowcontrolinterface.ts diff --git a/packages/legacy/src/smart/serialize/interface/model.ts b/packages/libmmel/src/interface/model.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/model.ts rename to packages/libmmel/src/interface/model.ts diff --git a/packages/legacy/src/smart/serialize/interface/processinterface.ts b/packages/libmmel/src/interface/processinterface.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/processinterface.ts rename to packages/libmmel/src/interface/processinterface.ts diff --git a/packages/legacy/src/smart/serialize/interface/supportinterface.ts b/packages/libmmel/src/interface/supportinterface.ts similarity index 100% rename from packages/legacy/src/smart/serialize/interface/supportinterface.ts rename to packages/libmmel/src/interface/supportinterface.ts diff --git a/packages/libmmel/src/main.test.ts b/packages/libmmel/src/main.test.ts new file mode 100644 index 00000000..8699074b --- /dev/null +++ b/packages/libmmel/src/main.test.ts @@ -0,0 +1,60 @@ +import { textToMMEL, MMELToText } from '@' + +const sampleText = `root Root + +version "v0.0.1-dev1" + +metadata { + title "Test title" + schema "Test Schema v1.0.0-dev1" + edition "2023" + author "Ribose" + shortname "TEST 12345" + namespace "TEST12345" +} + +subprocess Root { +} +`; + +const sampleMMEL = { + comments : {}, + elements : {}, + enums : {}, + figures : {}, + links : {}, + meta : { + author : 'Ribose', + datatype : 'metadata', + edition : '2023', + namespace : 'TEST12345', + schema : 'Test Schema v1.0.0-dev1', + shortname : 'TEST 12345', + title : 'Test title' + }, + notes : {}, + pages : { + Root : { + childs : {}, + data : {}, + datatype : 'subprocess', + edges : {}, + id : 'Root', + }, + }, + provisions : {}, + refs : {}, + roles : {}, + root : 'Root', + sections : {}, + tables : {}, + terms : {}, + vars : {}, + version : 'v0.0.1-dev1', + views : {}, +}; + +test('textToMMEL converts schema version correctly', () => { + expect(textToMMEL(sampleText).meta.schema).toBe(sampleMMEL.meta.schema); +}); + diff --git a/packages/legacy/src/smart/serialize/MMEL.ts b/packages/libmmel/src/main.ts similarity index 97% rename from packages/legacy/src/smart/serialize/MMEL.ts rename to packages/libmmel/src/main.ts index e72606d1..bb62dae0 100644 --- a/packages/legacy/src/smart/serialize/MMEL.ts +++ b/packages/libmmel/src/main.ts @@ -47,7 +47,6 @@ import { toViewProfile as toViewProfileModel, } from './util/serailizeformater'; import { validateModel } from './util/validation'; -import { MODELVERSION } from '../utils/constants'; /** * the function to convert text to MMEL @@ -61,12 +60,12 @@ export function textToMMEL(x: string): MMELModel { /** * the function to convert MMEL to text */ -export function MMELToText(model: MMELModel): string { +export function MMELToText(model: MMELModel, modelVersion: string = 'undefined'): string { let out = ''; if (model.root !== '') { out += 'root ' + model.root + '\n\n'; } - out += 'version "' + MODELVERSION + '"\n\n'; + out += 'version "' + modelVersion + '"\n\n'; out += toMetaDataModel(model.meta) + '\n'; for (const r in model.roles) { out += toRoleModel(model.roles[r]) + '\n'; diff --git a/packages/legacy/src/smart/serialize/util/serailizeformater.ts b/packages/libmmel/src/util/serailizeformater.ts similarity index 100% rename from packages/legacy/src/smart/serialize/util/serailizeformater.ts rename to packages/libmmel/src/util/serailizeformater.ts diff --git a/packages/legacy/src/smart/serialize/util/tokenizer.ts b/packages/libmmel/src/util/tokenizer.ts similarity index 97% rename from packages/legacy/src/smart/serialize/util/tokenizer.ts rename to packages/libmmel/src/util/tokenizer.ts index 51316631..bbca79e4 100644 --- a/packages/legacy/src/smart/serialize/util/tokenizer.ts +++ b/packages/libmmel/src/util/tokenizer.ts @@ -3,7 +3,9 @@ * Not much error handling is implemented as the MMEL file structure is assumed to be correct. */ -import { isSpace } from '../../utils/ModelFunctions'; +function isSpace(x: string): boolean { + return /\s/.test(x); +} /** * Convert text to an array of tokens diff --git a/packages/legacy/src/smart/serialize/util/validation.ts b/packages/libmmel/src/util/validation.ts similarity index 100% rename from packages/legacy/src/smart/serialize/util/validation.ts rename to packages/libmmel/src/util/validation.ts diff --git a/packages/libmmel/tsconfig.build.json b/packages/libmmel/tsconfig.build.json new file mode 100644 index 00000000..0e836748 --- /dev/null +++ b/packages/libmmel/tsconfig.build.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "rootDir": "src", + "outDir": "dist" + }, + "include": [ + "src" + ], + "exclude": [ + "paneron-for-tests/", + "src/*.test.*", + "spec/**/*.ts", + "test/**/*.ts" + ] +} diff --git a/packages/libmmel/tsconfig.json b/packages/libmmel/tsconfig.json new file mode 100644 index 00000000..e358246d --- /dev/null +++ b/packages/libmmel/tsconfig.json @@ -0,0 +1,45 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node", + "isolatedModules": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "skipLibCheck": true, + "incremental": true, + "experimentalDecorators": true, + "allowJs": false, + "jsx": "react", + "newLine": "lf", + "baseUrl": ".", + "outDir": "dist", + "rootDir": "src", + "typeRoots": [ + "../../src/@types", + "./node_modules/@types" + ], + "paths": { + "@": ["src/main"], + "@/*": ["src/*"], + "@paneron/libmmel/*": ["src/*"] + } + }, + "exclude": [ + "node_modules", + "dist", + "compiled", + "backup" + ], + "include": [ + "**.json", + "src" + ], + "ts-node": { + "files": true + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7aab36ad..e1d3a347 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,6 +31,9 @@ importers: '@emotion/styled': specifier: ^11.10.5 version: 11.10.5(@babel/core@7.20.2)(@emotion/react@11.10.5)(@types/react@18.2.6)(react@16.14.0) + '@paneron/libmmel': + specifier: workspace:* + version: link:../libmmel '@react-three/drei': specifier: ^7.27.5 version: 7.27.5(@react-three/fiber@7.0.29)(react-dom@16.14.0)(react@16.14.0)(three@0.146.0) @@ -164,6 +167,81 @@ importers: specifier: 4.9.5 version: 4.9.5 + packages/libmmel: + devDependencies: + '@swc/cli': + specifier: ^0.1.62 + version: 0.1.62(@swc/core@1.3.58) + '@swc/core': + specifier: ^1.3.58 + version: 1.3.58(@swc/helpers@0.5.1) + '@swc/jest': + specifier: ^0.2.26 + version: 0.2.26(@swc/core@1.3.58) + '@types/jest': + specifier: ^29.5.1 + version: 29.5.1 + '@types/node': + specifier: 20.2.0 + version: 20.2.0 + '@typescript-eslint/eslint-plugin': + specifier: ^5.59.6 + version: 5.59.6(@typescript-eslint/parser@5.59.6)(eslint@8.40.0)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.59.6 + version: 5.59.6(eslint@8.40.0)(typescript@4.9.5) + concurrently: + specifier: ^8.0.1 + version: 8.0.1 + eslint: + specifier: ^8.40.0 + version: 8.40.0 + eslint-import-resolver-typescript: + specifier: ^3.5.5 + version: 3.5.5(@typescript-eslint/parser@5.59.6)(eslint-plugin-import@2.26.0)(eslint@8.40.0) + eslint-plugin-jest: + specifier: ^27.2.1 + version: 27.2.1(@typescript-eslint/eslint-plugin@5.59.6)(eslint@8.40.0)(jest@29.5.0)(typescript@4.9.5) + eslint-plugin-node: + specifier: ^11.1.0 + version: 11.1.0(eslint@8.40.0) + eslint-plugin-react: + specifier: ^7.32.2 + version: 7.32.2(eslint@8.40.0) + eslint-plugin-react-hooks: + specifier: ^4.6.0 + version: 4.6.0(eslint@8.40.0) + fast-check: + specifier: ^3.8.2 + version: 3.8.2 + immer: + specifier: ^10.0.2 + version: 10.0.2 + jest: + specifier: ^29.5.0 + version: 29.5.0(@types/node@20.2.0)(ts-node@10.9.1) + mkdirp: + specifier: ^3.0.1 + version: 3.0.1 + prop-types: + specifier: ^15.8.1 + version: 15.8.1 + rimraf: + specifier: ^5.0.1 + version: 5.0.1 + run-script-os: + specifier: ^1.1.6 + version: 1.1.6 + ts-jest: + specifier: ^29.1.0 + version: 29.1.0(@babel/core@7.20.2)(jest@29.5.0)(typescript@4.9.5) + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@swc/core@1.3.58)(@types/node@20.2.0)(typescript@4.9.5) + typescript: + specifier: 4.9.5 + version: 4.9.5 + packages: /@ampproject/remapping@2.2.0: @@ -2367,7 +2445,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: '@typescript-eslint/types': 5.59.6 - eslint-visitor-keys: 3.3.0 + eslint-visitor-keys: 3.4.1 dev: true /@use-gesture/core@10.2.18: @@ -3818,11 +3896,6 @@ packages: engines: {node: '>=10'} dev: true - /eslint-visitor-keys@3.3.0: - resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - /eslint-visitor-keys@3.4.1: resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -3969,7 +4042,7 @@ packages: jest-get-type: 29.4.3 jest-matcher-utils: 29.4.3 jest-message-util: 29.4.3 - jest-util: 29.4.3 + jest-util: 29.5.0 dev: true /expect@29.5.0: @@ -4986,16 +5059,6 @@ packages: - supports-color dev: true - /jest-diff@29.4.3: - resolution: {integrity: sha512-YB+ocenx7FZ3T5O9lMVMeLYV4265socJKtkwgk/6YUz/VsEzYDkiMuMhWzZmxm3wDRQvayJu/PjkjjSkjoHsCA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - diff-sequences: 29.4.3 - jest-get-type: 29.4.3 - pretty-format: 29.4.3 - dev: true - /jest-diff@29.5.0: resolution: {integrity: sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5073,9 +5136,9 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 29.4.3 + jest-diff: 29.5.0 jest-get-type: 29.4.3 - pretty-format: 29.4.3 + pretty-format: 29.5.0 dev: true /jest-matcher-utils@29.5.0: @@ -5098,7 +5161,7 @@ packages: chalk: 4.1.2 graceful-fs: 4.2.10 micromatch: 4.0.5 - pretty-format: 29.4.3 + pretty-format: 29.5.0 slash: 3.0.0 stack-utils: 2.0.6 dev: true