Compare commits

...
110 Commits
Author SHA1 Message Date
Sidharth Vinod 687ac6428b Add tests for themes 2021-09-18 10:52:14 +05:30
Sidharth Vinod 45c5958b56 Fix: Light theme not being set by default 2021-09-18 10:10:53 +05:30
Sidharth Vinod 15a90149be Merge branch 'master' into daisyUI
* master:
  Fix " > base64State is not defined"
  chore(deps-dev): bump svelte-preprocess from 4.8.0 to 4.9.4
  chore(deps-dev): bump eslint-plugin-cypress from 2.11.3 to 2.12.1
  chore(deps-dev): bump cypress from 8.3.1 to 8.4.0
  chore(deps-dev): bump @typescript-eslint/eslint-plugin
  chore(deps): bump js-base64 from 3.7.0 to 3.7.1
  chore(deps-dev): bump svelte from 3.42.5 to 3.42.6
  chore(deps): bump node from 16.9.0 to 16.9.1
  chore(deps-dev): bump prettier from 2.4.0 to 2.4.1
  chore(deps-dev): bump @sveltejs/adapter-static
  chore(deps-dev): bump @typescript-eslint/parser from 4.31.0 to 4.31.1
2021-09-18 10:04:10 +05:30
Sidharth VinodandGitHub 649bfee23c Merge pull request #373 from mermaid-js/develop
Develop
2021-09-18 10:01:01 +05:30
Sidharth Vinod 113c50e255 Fix " > base64State is not defined" 2021-09-17 23:51:26 +05:30
Sidharth VinodandGitHub 4804046d9f Merge pull request #356 from mermaid-js/dependabot/npm_and_yarn/develop/svelte-preprocess-4.9.4
chore(deps-dev): bump svelte-preprocess from 4.8.0 to 4.9.4
2021-09-17 19:47:37 +05:30
Sidharth VinodandGitHub 5a8f28b229 Merge pull request #375 from mermaid-js/dependabot/npm_and_yarn/develop/typescript-eslint/eslint-plugin-4.31.1
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 4.31.0 to 4.31.1
2021-09-17 19:47:27 +05:30
Sidharth VinodandGitHub 0e38b66461 Merge pull request #378 from mermaid-js/dependabot/npm_and_yarn/develop/eslint-plugin-cypress-2.12.1
chore(deps-dev): bump eslint-plugin-cypress from 2.11.3 to 2.12.1
2021-09-17 19:47:19 +05:30
Sidharth VinodandGitHub 5ea4267768 Merge pull request #377 from mermaid-js/dependabot/npm_and_yarn/develop/cypress-8.4.0
chore(deps-dev): bump cypress from 8.3.1 to 8.4.0
2021-09-17 19:47:08 +05:30
30651c41de Apply suggestions from code review
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
2021-09-17 19:46:28 +05:30
Sidharth Vinod 2868870065 chore: rename theme 2021-09-17 19:41:50 +05:30
Sidharth Vinod 4ed439b3ad fix: Mermaid Theme 2021-09-17 19:39:27 +05:30
Sidharth Vinod d2673d5326 Merge branch 'master' into daisyUI
* master: (25 commits)
  chore(deps-dev): bump typescript from 4.4.2 to 4.4.3
  chore(deps-dev): bump svelte from 3.42.4 to 3.42.5
  chore(deps): bump js-base64 from 3.6.2 to 3.7.0
  chore(deps): bump node from 16.8.0 to 16.9.0
  Skip beta deploy
  [ImgBot] Optimize images
  Dont allow lookbehind in regexp
  Fix no lookbehinds in comments
  chore(deps-dev): bump tailwindcss from 2.2.11 to 2.2.15
  chore(deps-dev): bump eslint-plugin-svelte3 from 3.2.0 to 3.2.1
  chore(deps-dev): bump prettier from 2.3.2 to 2.4.0
  Test deploy on PRs
  Fix manifest issue
  Update node
  Add back Highlighting. #340
  chore(deps-dev): bump @typescript-eslint/eslint-plugin
  chore(deps-dev): bump @typescript-eslint/parser from 4.30.0 to 4.31.0
  chore(deps): bump js-base64 from 3.6.1 to 3.6.2
  chore(deps-dev): bump tailwindcss from 2.2.9 to 2.2.11
  chore(deps): bump node from 14.17.0 to 16.8.0
  ...
2021-09-17 19:19:54 +05:30
dependabot[bot]andGitHub a14c9a7e9d chore(deps-dev): bump svelte-preprocess from 4.8.0 to 4.9.4
Bumps [svelte-preprocess](https://github.com/sveltejs/svelte-preprocess) from 4.8.0 to 4.9.4.
- [Release notes](https://github.com/sveltejs/svelte-preprocess/releases)
- [Changelog](https://github.com/sveltejs/svelte-preprocess/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte-preprocess/compare/v4.8.0...v4.9.4)

---
updated-dependencies:
- dependency-name: svelte-preprocess
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:49:07 +00:00
dependabot[bot]andGitHub 2ecd56fe8a chore(deps-dev): bump eslint-plugin-cypress from 2.11.3 to 2.12.1
Bumps [eslint-plugin-cypress](https://github.com/cypress-io/eslint-plugin-cypress) from 2.11.3 to 2.12.1.
- [Release notes](https://github.com/cypress-io/eslint-plugin-cypress/releases)
- [Commits](https://github.com/cypress-io/eslint-plugin-cypress/compare/v2.11.3...v2.12.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:48:58 +00:00
dependabot[bot]andGitHub 41c1ed8c5d chore(deps-dev): bump cypress from 8.3.1 to 8.4.0
Bumps [cypress](https://github.com/cypress-io/cypress) from 8.3.1 to 8.4.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/.releaserc.base.js)
- [Commits](https://github.com/cypress-io/cypress/compare/v8.3.1...v8.4.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:48:49 +00:00
dependabot[bot]andGitHub efdfba2812 chore(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.31.0 to 4.31.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:48:45 +00:00
Sidharth VinodandGitHub eb33a59ac2 Merge pull request #372 from mermaid-js/dependabot/docker/develop/node-16.9.1
chore(deps): bump node from 16.9.0 to 16.9.1
2021-09-17 19:16:58 +05:30
Sidharth VinodandGitHub 89c64ae0cb Merge pull request #376 from mermaid-js/dependabot/npm_and_yarn/develop/js-base64-3.7.1
chore(deps): bump js-base64 from 3.7.0 to 3.7.1
2021-09-17 19:16:47 +05:30
Sidharth VinodandGitHub e094efabf6 Merge pull request #374 from mermaid-js/dependabot/npm_and_yarn/develop/svelte-3.42.6
chore(deps-dev): bump svelte from 3.42.5 to 3.42.6
2021-09-17 19:16:39 +05:30
Sidharth Vinod 2b757cc433 fix: menu width 2021-09-17 19:16:05 +05:30
Sidharth Vinod b890622543 fix: Use span instead of a in menu 2021-09-17 19:08:23 +05:30
dependabot[bot]andGitHub cf3457a983 chore(deps): bump js-base64 from 3.7.0 to 3.7.1
Bumps [js-base64](https://github.com/dankogai/js-base64) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/dankogai/js-base64/releases)
- [Commits](https://github.com/dankogai/js-base64/compare/3.7.0...3.7.1)

---
updated-dependencies:
- dependency-name: js-base64
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:17:11 +00:00
dependabot[bot]andGitHub 40b21f05de chore(deps-dev): bump svelte from 3.42.5 to 3.42.6
Bumps [svelte](https://github.com/sveltejs/svelte) from 3.42.5 to 3.42.6.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/compare/v3.42.5...v3.42.6)

---
updated-dependencies:
- dependency-name: svelte
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:16:32 +00:00
91fe1911fb Update src/lib/components/navbar.svelte
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
2021-09-17 18:43:40 +05:30
Sidharth VinodandGitHub 6fc2968901 Merge pull request #368 from mermaid-js/dependabot/npm_and_yarn/develop/typescript-eslint/parser-4.31.1
chore(deps-dev): bump @typescript-eslint/parser from 4.31.0 to 4.31.1
2021-09-17 18:42:54 +05:30
Sidharth VinodandGitHub 61fa0bda71 Merge pull request #370 from mermaid-js/dependabot/npm_and_yarn/develop/prettier-2.4.1
chore(deps-dev): bump prettier from 2.4.0 to 2.4.1
2021-09-17 18:42:40 +05:30
Sidharth VinodandGitHub 55149fa616 Merge pull request #369 from mermaid-js/dependabot/npm_and_yarn/develop/sveltejs/adapter-static-1.0.0-next.19
chore(deps-dev): bump @sveltejs/adapter-static from 1.0.0-next.18 to 1.0.0-next.19
2021-09-17 18:42:28 +05:30
dependabot[bot]andGitHub 0dc8582bd6 chore(deps): bump node from 16.9.0 to 16.9.1
Bumps node from 16.9.0 to 16.9.1.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:10:29 +00:00
dependabot[bot]andGitHub 7517614429 chore(deps-dev): bump prettier from 2.4.0 to 2.4.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.0...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:03:00 +00:00
dependabot[bot]andGitHub 1cc55e210a chore(deps-dev): bump @sveltejs/adapter-static
Bumps [@sveltejs/adapter-static](https://github.com/sveltejs/kit/tree/HEAD/packages/adapter-static) from 1.0.0-next.18 to 1.0.0-next.19.
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/master/packages/adapter-static/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/HEAD/packages/adapter-static)

---
updated-dependencies:
- dependency-name: "@sveltejs/adapter-static"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:02:48 +00:00
dependabot[bot]andGitHub 1f0e6e7a36 chore(deps-dev): bump @typescript-eslint/parser from 4.31.0 to 4.31.1
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.31.0 to 4.31.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 13:02:30 +00:00
Sidharth VinodandGitHub 548f3206ad Merge pull request #366 from Yash-Singh1/master
Optimize images with `imgbot`
2021-09-14 19:58:24 +05:30
Yash SinghandGitHub 782cf66274 Merge pull request #1 from Yash-Singh1/imgbot
[ImgBot] Optimize images
2021-09-13 16:38:37 -07:00
Sidharth VinodandGitHub 21049c7fff Merge pull request #365 from mermaid-js/develop
Develop
2021-09-13 22:40:05 +05:30
Sidharth VinodandGitHub 6b0183fbe9 Merge pull request #363 from mermaid-js/dependabot/npm_and_yarn/develop/svelte-3.42.5
chore(deps-dev): bump svelte from 3.42.4 to 3.42.5
2021-09-13 21:37:58 +05:30
Sidharth VinodandGitHub 94c4ea3322 Merge pull request #364 from mermaid-js/dependabot/npm_and_yarn/develop/typescript-4.4.3
chore(deps-dev): bump typescript from 4.4.2 to 4.4.3
2021-09-13 21:37:50 +05:30
dependabot[bot]andGitHub 9ba0b53a10 chore(deps-dev): bump typescript from 4.4.2 to 4.4.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.2...v4.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 15:58:30 +00:00
dependabot[bot]andGitHub 86be314d2c chore(deps-dev): bump svelte from 3.42.4 to 3.42.5
Bumps [svelte](https://github.com/sveltejs/svelte) from 3.42.4 to 3.42.5.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/compare/v3.42.4...v3.42.5)

---
updated-dependencies:
- dependency-name: svelte
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 15:58:09 +00:00
Sidharth VinodandGitHub 07a2bb8ca1 Merge pull request #360 from Yash-Singh1/fixNoLookBehindComment
Fix no lookbehinds in comments
2021-09-13 21:26:10 +05:30
Sidharth VinodandGitHub d683a80f40 Merge pull request #359 from mermaid-js/dependabot/docker/develop/node-16.9.0
chore(deps): bump node from 16.8.0 to 16.9.0
2021-09-13 21:25:49 +05:30
Sidharth VinodandGitHub 6d47808298 Merge pull request #357 from mermaid-js/dependabot/npm_and_yarn/develop/eslint-plugin-svelte3-3.2.1
chore(deps-dev): bump eslint-plugin-svelte3 from 3.2.0 to 3.2.1
2021-09-13 21:25:39 +05:30
Sidharth VinodandGitHub f9d1c55f25 Merge pull request #358 from mermaid-js/dependabot/npm_and_yarn/develop/tailwindcss-2.2.15
chore(deps-dev): bump tailwindcss from 2.2.11 to 2.2.15
2021-09-13 21:25:30 +05:30
Sidharth VinodandGitHub d9b475a82f Merge pull request #362 from mermaid-js/dependabot/npm_and_yarn/develop/js-base64-3.7.0
chore(deps): bump js-base64 from 3.6.2 to 3.7.0
2021-09-13 21:25:17 +05:30
dependabot[bot]andGitHub 0b938cefa8 chore(deps): bump js-base64 from 3.6.2 to 3.7.0
Bumps [js-base64](https://github.com/dankogai/js-base64) from 3.6.2 to 3.7.0.
- [Release notes](https://github.com/dankogai/js-base64/releases)
- [Commits](https://github.com/dankogai/js-base64/compare/3.6.2...3.7.0)

---
updated-dependencies:
- dependency-name: js-base64
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 15:39:41 +00:00
Sidharth VinodandGitHub 2637621671 Merge pull request #355 from mermaid-js/dependabot/npm_and_yarn/develop/prettier-2.4.0
chore(deps-dev): bump prettier from 2.3.2 to 2.4.0
2021-09-13 21:06:48 +05:30
dependabot[bot]andGitHub 44281abb4e chore(deps): bump node from 16.8.0 to 16.9.0
Bumps node from 16.8.0 to 16.9.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 15:36:48 +00:00
Sidharth VinodandGitHub 007e6f1896 Merge pull request #361 from mermaid-js/develop
Skip beta deploy
2021-09-13 20:42:20 +05:30
Sidharth Vinod 479fe86ca5 Skip beta deploy 2021-09-13 10:53:06 +05:30
ImgBotApp deb449cf4f [ImgBot] Optimize images
*Total -- 109.33kb -> 75.69kb (30.77%)

/static/icon-512.png -- 78.09kb -> 47.40kb (39.3%)
/static/icon-192.png -- 15.46kb -> 12.59kb (18.56%)
/static/favicon.png -- 15.78kb -> 15.70kb (0.48%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2021-09-11 22:09:11 +00:00
Yash-Singh1 ebd7a9cdb4 Dont allow lookbehind in regexp 2021-09-11 12:24:35 -07:00
Yash-Singh1 5e5c869ada Fix no lookbehinds in comments 2021-09-11 12:22:14 -07:00
dependabot[bot]andGitHub 6532a9a947 chore(deps-dev): bump tailwindcss from 2.2.11 to 2.2.15
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.11 to 2.2.15.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v2.2.15)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 13:03:29 +00:00
dependabot[bot]andGitHub 36c16781b5 chore(deps-dev): bump eslint-plugin-svelte3 from 3.2.0 to 3.2.1
Bumps [eslint-plugin-svelte3](https://github.com/sveltejs/eslint-plugin-svelte3) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/sveltejs/eslint-plugin-svelte3/releases)
- [Changelog](https://github.com/sveltejs/eslint-plugin-svelte3/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/eslint-plugin-svelte3/compare/v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-svelte3
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 13:03:18 +00:00
dependabot[bot]andGitHub 2c4b8246c8 chore(deps-dev): bump prettier from 2.3.2 to 2.4.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-10 13:02:55 +00:00
Sidharth VinodandGitHub cacf434709 Merge pull request #354 from mermaid-js/develop
Develop
2021-09-10 11:39:56 +05:30
Sidharth Vinod fa8a261fed Test deploy on PRs 2021-09-10 11:33:36 +05:30
Sidharth Vinod dab9761e6e Fix manifest issue 2021-09-10 11:30:36 +05:30
Sidharth VinodandGitHub c32d5e565d Merge pull request #352 from mermaid-js/develop
Develop
2021-09-10 10:47:44 +05:30
Sidharth Vinod 2328294f1b Update node 2021-09-10 10:33:35 +05:30
Sidharth Vinod 7abb08cdff Merge branch 'develop' of https://github.com/mermaid-js/mermaid-live-editor into develop
* 'develop' of https://github.com/mermaid-js/mermaid-live-editor:
  chore(deps): bump node from 14.17.0 to 16.8.0
2021-09-10 10:30:14 +05:30
Sidharth VinodandGitHub 570c2f4c8b Merge pull request #346 from mermaid-js/dependabot/docker/develop/node-16.8.0
chore(deps): bump node from 14.17.0 to 16.8.0
2021-09-10 10:30:08 +05:30
Sidharth Vinod 8c9e29c3da Add back Highlighting. #340 2021-09-10 10:29:50 +05:30
Sidharth VinodandGitHub 5a806c0d56 Merge pull request #350 from mermaid-js/dependabot/npm_and_yarn/develop/typescript-eslint/eslint-plugin-4.31.0
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 4.30.0 to 4.31.0
2021-09-09 08:40:33 +05:30
dependabot[bot]andGitHub 740c9c827e chore(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.30.0 to 4.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 06:15:46 +00:00
Sidharth VinodandGitHub 2e8ac60684 Merge pull request #348 from mermaid-js/dependabot/npm_and_yarn/develop/js-base64-3.6.2
chore(deps): bump js-base64 from 3.6.1 to 3.6.2
2021-09-08 11:42:29 +05:30
Sidharth VinodandGitHub 339c023447 Merge pull request #349 from mermaid-js/dependabot/npm_and_yarn/develop/typescript-eslint/parser-4.31.0
chore(deps-dev): bump @typescript-eslint/parser from 4.30.0 to 4.31.0
2021-09-08 11:42:14 +05:30
Sidharth VinodandGitHub ca9d6faaed Merge pull request #347 from mermaid-js/dependabot/npm_and_yarn/develop/tailwindcss-2.2.11
chore(deps-dev): bump tailwindcss from 2.2.9 to 2.2.11
2021-09-08 11:42:02 +05:30
Sidharth Vinod 40a0c22d56 Merge branch 'master' into develop
* master:
  rollback #288 due to #338
  hide netlify on github
  format netlify
  hide netlify on github
  Fix clock
  Fix clock
  Fix test
  Fix test
  Fix test
  Fix test
  remove eslint ignors
  Fix test
  Add powered by netlify
2021-09-08 11:37:46 +05:30
dependabot[bot]andGitHub 129c296121 chore(deps-dev): bump @typescript-eslint/parser from 4.30.0 to 4.31.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.30.0 to 4.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 06:07:28 +00:00
dependabot[bot]andGitHub 7491d8fd99 chore(deps): bump js-base64 from 3.6.1 to 3.6.2
Bumps [js-base64](https://github.com/dankogai/js-base64) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/dankogai/js-base64/releases)
- [Commits](https://github.com/dankogai/js-base64/compare/3.6.1...3.6.2)

---
updated-dependencies:
- dependency-name: js-base64
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 06:07:08 +00:00
dependabot[bot]andGitHub 3db6543024 chore(deps-dev): bump tailwindcss from 2.2.9 to 2.2.11
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 2.2.9 to 2.2.11.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 06:06:54 +00:00
Sidharth VinodandGitHub 26afd28a85 Merge pull request #345 from mermaid-js/dependabot/github_actions/develop/actions/stale-4
chore(deps): bump actions/stale from 3 to 4
2021-09-08 11:36:25 +05:30
dependabot[bot]andGitHub fbb93ab813 chore(deps): bump node from 14.17.0 to 16.8.0
Bumps node from 14.17.0 to 16.8.0.

---
updated-dependencies:
- dependency-name: node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 06:05:01 +00:00
dependabot[bot]andGitHub 2a24199756 chore(deps): bump actions/stale from 3 to 4
Bumps [actions/stale](https://github.com/actions/stale) from 3 to 4.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-08 06:04:48 +00:00
Sidharth VinodandGitHub 52afad3e97 Merge pull request #343 from mermaid-js/develop
Develop
2021-09-08 11:34:28 +05:30
Sidharth VinodandGitHub 1810dad5f9 Merge pull request #330 from mermaid-js/dependabot/npm_and_yarn/develop/sveltejs/adapter-static-1.0.0-next.18
chore(deps-dev): bump @sveltejs/adapter-static from 1.0.0-next.17 to 1.0.0-next.18
2021-09-08 11:09:17 +05:30
Sidharth VinodandGitHub b40506bd9f Merge pull request #334 from mermaid-js/dependabot/npm_and_yarn/develop/autoprefixer-10.3.4
chore(deps-dev): bump autoprefixer from 10.3.3 to 10.3.4
2021-09-08 10:55:41 +05:30
Sidharth VinodandGitHub dc9cff4a2d Merge pull request #342 from mmorel-35/patch-1
chore(dependabot) : add github-actions and docker
2021-09-08 10:54:09 +05:30
Matthieu MORELandGitHub b4f3e42da3 chore(dependabot) : add github-actions and docker 2021-09-08 07:05:22 +02:00
Sidharth VinodandGitHub c7e8e8625f Merge pull request #339 from mermaid-js/fix/Safari
rollback #288 due to #338
2021-09-08 10:15:25 +05:30
Sidharth Vinod 5e94ea222c rollback #288 due to #338 2021-09-08 10:08:13 +05:30
Sidharth Vinod 8e6898b5d5 Merge branch 'master' into daisyUI
* master:
  hide netlify on github
  format netlify
  hide netlify on github
  Fix clock
  Fix clock
  Update mermaid
  Fix test
  Fix test
  Fix test
  Fix test
  remove eslint ignors
  Fix test
  Add powered by netlify
2021-09-07 00:29:11 +05:30
Sidharth VinodandGitHub 7d1c3a153f Merge pull request #336 from mermaid-js/develop
Update mermaid
2021-09-07 00:26:42 +05:30
Sidharth VinodandGitHub 7641b2e25c Merge pull request #337 from mermaid-js/netlify
Netlify
2021-09-05 22:43:59 +05:30
dependabot[bot]andGitHub 1e5a516679 chore(deps-dev): bump autoprefixer from 10.3.3 to 10.3.4
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.3.3 to 10.3.4.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.3.3...10.3.4)

---
updated-dependencies:
- dependency-name: autoprefixer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-05 11:40:02 +00:00
Sidharth Vinod c213366181 Update mermaid 2021-09-05 17:07:36 +05:30
Sidharth Vinod 70ed3a4700 Add powered by netlify 2021-09-05 16:30:18 +05:30
Sidharth Vinod 0fd98ce271 add netlify badge 2021-09-05 16:17:02 +05:30
Sidharth Vinod 4e37ea9c8f test deploy 2021-09-05 16:09:57 +05:30
Sidharth Vinod 47bf6b8867 Merge branch 'master' into daisyUI
* master:
2021-09-03 22:56:04 +05:30
dependabot[bot]andGitHub cd42d0dee0 chore(deps-dev): bump @sveltejs/adapter-static
Bumps @sveltejs/adapter-static from 1.0.0-next.17 to 1.0.0-next.18.

---
updated-dependencies:
- dependency-name: "@sveltejs/adapter-static"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-03 14:24:18 +00:00
Sidharth Vinod dc47b749f2 Merge branch 'develop' into daisyUI
* develop:
  chore(deps): bump analytics from 0.7.13 to 0.7.14
  chore(deps-dev): bump svelte from 3.42.3 to 3.42.4
  chore(deps-dev): bump @typescript-eslint/parser from 4.29.2 to 4.30.0
2021-09-03 19:54:04 +05:30
Sidharth Vinod 830ecaa8af update test 2021-09-03 19:38:59 +05:30
Sidharth Vinod 0897aca3b9 update 2021-09-03 09:36:31 +05:30
Sidharth Vinod 05bcfb13ca Merge branch 'develop' into daisyUI
* develop: (50 commits)
  update
  chore(deps-dev): bump tailwindcss from 2.2.7 to 2.2.9
  chore(deps-dev): bump prettier-plugin-svelte from 2.3.1 to 2.4.0
  chore(deps-dev): bump @typescript-eslint/eslint-plugin
  chore(deps-dev): bump mocha from 9.1.0 to 9.1.1
  chore(deps-dev): bump husky from 7.0.1 to 7.0.2
  Comment support
  Add variables, types, and multiple refactors and fixes
  colons are brackets in class diagrams
  Remove unneccessary groups
  Refactor syntax highlighting
  chore(deps-dev): bump svelte-preprocess from 4.7.4 to 4.8.0
  chore(deps-dev): bump cypress from 8.3.0 to 8.3.1
  chore(deps-dev): bump @typescript-eslint/eslint-plugin
  chore(deps-dev): bump typescript from 4.3.5 to 4.4.2
  chore(deps-dev): bump autoprefixer from 10.3.1 to 10.3.3
  chore(deps-dev): bump svelte from 3.42.2 to 3.42.3
  Gitgraph options
  Directives highlighting
  Requirement diagrams
  ...
2021-09-03 09:36:20 +05:30
Sidharth Vinod 4de2c97fbe Merge branch 'master' into daisyUI
* master:
  chore: Update monaco
  Revert "chore(deps-dev): bump @sveltejs/kit from 1.0.0-next.147 to 1.0.0-next.154"
  chore(deps-dev): bump @sveltejs/kit
  chore(deps-dev): bump cssnano from 5.0.7 to 5.0.8
  chore(deps-dev): bump mocha from 9.0.3 to 9.1.0
  chore(deps-dev): bump eslint-plugin-tailwindcss from 1.14.1 to 1.14.3
  chore(deps-dev): bump svelte from 3.42.1 to 3.42.2
  chore(deps-dev): bump @typescript-eslint/eslint-plugin
  chore(deps-dev): bump @typescript-eslint/parser from 4.29.1 to 4.29.2
  chore(deps-dev): bump cypress from 8.2.0 to 8.3.0
  chore(deps): bump @macfja/svelte-persistent-store from 1.1.1 to 1.2.0
  fix: renovate
  Create renovate.json
2021-08-21 09:47:25 +05:30
Sidharth Vinod 2f7b0973fd fix: resize CSS 2021-08-21 09:26:39 +05:30
Sidharth Vinod 354ae063d7 fix: ResizeHandler 2021-08-21 09:24:42 +05:30
Sidharth Vinod 8d727e5cac fix: Auto sync margin 2021-08-21 09:14:20 +05:30
Sidharth Vinod 8957627cfc fix: Scroll 2021-08-21 08:58:05 +05:30
Sidharth Vinod 626a600dae chore: Update daisyUI 2021-08-21 08:52:22 +05:30
Sidharth Vinod 045ab4df22 fix: Aqua dark 2021-08-20 23:44:53 +05:30
Sidharth Vinod 8956201dab fix: Button casing 2021-08-20 23:41:50 +05:30
Sidharth Vinod 19a6190b56 feat: Proper theme support 2021-08-19 00:19:22 +05:30
Sidharth Vinod ffe260893d Merge branch 'master' of https://github.com/mermaid-js/mermaid-live-editor into daisyUI
* 'master' of https://github.com/mermaid-js/mermaid-live-editor:
  Lint
  Pointer cursor on card
2021-08-16 09:18:23 +05:30
Sidharth Vinod 166d08532b testing text 2021-08-16 09:15:53 +05:30
Sidharth Vinod 2acde71f37 feat: Move theme into navbar 2021-08-16 00:17:29 +05:30
Sidharth Vinod 73fc573a2d feat: daisyUI 2021-08-16 00:09:30 +05:30
Sidharth Vinod d5a433bcdc feat: add daisyUI 2021-08-15 23:07:37 +05:30
33 changed files with 627 additions and 1877 deletions
+3 -2
View File
@@ -7,7 +7,7 @@ module.exports = {
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier'
],
plugins: ['svelte3', 'tailwindcss', '@typescript-eslint'],
plugins: ['svelte3', 'tailwindcss', '@typescript-eslint', 'es'],
ignorePatterns: [
'docs/*',
'*.cjs',
@@ -42,6 +42,7 @@ module.exports = {
}
],
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off'
'@typescript-eslint/no-unsafe-assignment': 'off',
'es/no-regexp-lookbehind-assertions': 'error'
}
};
+17 -5
View File
@@ -1,8 +1,20 @@
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
target-branch: 'develop'
- package-ecosystem: docker
directory: /
target-branch: develop
schedule:
interval: 'weekly'
day: 'friday'
interval: weekly
day: friday
- package-ecosystem: github-actions
directory: /
target-branch: develop
schedule:
interval: weekly
day: friday
- package-ecosystem: npm
directory: /
target-branch: develop
schedule:
interval: weekly
day: friday
+1
View File
@@ -9,6 +9,7 @@ on:
jobs:
cypress-run:
runs-on: ubuntu-latest
# Update after https://github.com/cypress-io/cypress-docker-images/issues/487
container: cypress/browsers:node14.16.0-chrome90-ff88
steps:
+3 -1
View File
@@ -6,13 +6,14 @@ on:
pull_request:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
- name: Checkout
uses: actions/checkout@v2
@@ -45,6 +46,7 @@ jobs:
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
+1 -1
View File
@@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-labels: 'retained'
+1 -1
View File
@@ -6,7 +6,7 @@
# Stop : press ctrl + c
# or
# docker stop mermaid-live-editor
FROM node:14.17.0 as mermaid-live-editor-builder
FROM node:16.9.1 as mermaid-live-editor-builder
COPY --chown=node:node . /home
WORKDIR /home
RUN yarn install
+2 -2
View File
@@ -1,4 +1,4 @@
[![Mermaid Live Editor](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/detailed/2ckppp/master&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/2ckppp/runs) [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)
[![Mermaid Live Editor](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/detailed/2ckppp/master&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/2ckppp/runs) [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE)[![Netlify Status](https://api.netlify.com/api/v1/badges/27fa023d-7c73-4a3f-9791-b3b657a47100/deploy-status)](https://app.netlify.com/sites/mermaidjs/deploys)
# Contributors are welcome!
@@ -17,7 +17,7 @@ Edit, preview and share mermaid charts/diagrams.
## Live demo
You can try out a live version [here](https://mermaid-js.github.io/mermaid-live-editor/).
You can try out a live version [here](https://mermaid.live/).
## Docker
+57
View File
@@ -0,0 +1,57 @@
describe('Test themes', () => {
describe('Test light themes', () => {
beforeEach(() => {
cy.clearLocalStorage();
cy.visit('/edit', {
onBeforeLoad(win) {
cy.stub(win, 'matchMedia')
.callThrough()
.withArgs('(prefers-color-scheme: dark)')
.returns({
matches: false
});
}
});
cy.contains('Change Theme').click();
});
it('should set light theme as default', () => {
cy.contains('light').parent().should('have.class', 'bordered');
cy.contains('dark').parent().should('not.have.class', 'bordered');
cy.getLocalStorage('themeStore').snapshot();
});
it('should change themes when clicked', () => {
cy.contains('light').parent().should('have.class', 'bordered');
cy.contains('cupcake').click();
cy.contains('cupcake').parent().should('have.class', 'bordered');
cy.contains('light').parent().should('not.have.class', 'bordered');
cy.contains('dark').parent().should('not.have.class', 'bordered');
cy.getLocalStorage('themeStore').snapshot();
});
});
describe('Test dark mode', () => {
// eslint-disable-next-line mocha/no-hooks-for-single-case
beforeEach(() => {
cy.clearLocalStorage();
cy.visit('/edit', {
onBeforeLoad(win) {
cy.stub(win, 'matchMedia')
.callThrough()
.withArgs('(prefers-color-scheme: dark)')
.returns({
matches: true
});
}
});
cy.contains('Change Theme').click();
});
it('should set dark theme as default', () => {
cy.contains('light').parent().should('not.have.class', 'bordered');
cy.contains('dark').parent().should('have.class', 'bordered');
cy.getLocalStorage('themeStore').snapshot();
});
});
});
+25 -1
View File
@@ -16,7 +16,7 @@ module.exports = {
"1": "{\"code\":\"graph TD\\n A[Party] -->|Get money| B(Go shopping!!)\\n \",\"mermaid\":\"{\\n \\\"theme\\\": \\\"forest\\\",\\n \\\"test\\\": \\\"hello world\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":true,\"loader\":{\"type\":\"files\",\"config\":{\"codeURL\":\"https://gist.githubusercontent.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/raw/4eb03887e6a41397e80bdcdbf94017c498f8f1e2/code.mmd\",\"configURL\":\"https://gist.githubusercontent.com/sidharthv96/6268a23e673a533dcb198f241fd7012a/raw/4eb03887e6a41397e80bdcdbf94017c498f8f1e2/config.json\"}}}"
}
},
"__version": "8.3.1",
"__version": "8.4.0",
"Auto sync tests": {
"should dim diagram when code is edited": {
"1": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Test\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":false,\"updateDiagram\":false}"
@@ -24,5 +24,29 @@ module.exports = {
"should not dim diagram when code is in sync": {
"1": "{\"code\":\"graph TD\\n A[Christmas] -->|Get money| B(Go shopping)\\n B --> C{Let me think}\\n C -->|One| D[Laptop]\\n C -->|Two| E[iPhone]\\n C -->|Three| F[fa:fa-car Car]\\n C --> Testing\",\"mermaid\":\"{\\n \\\"theme\\\": \\\"default\\\"\\n}\",\"updateEditor\":false,\"autoSync\":true,\"updateDiagram\":false}"
}
},
"Test themes": {
"should set light theme as default": {
"1": "{\"theme\":\"light\",\"isDark\":false}"
},
"should change themes when clicked": {
"1": "{\"theme\":\"cupcake\",\"isDark\":false}"
},
"should set dark theme as default": {
"1": "{\"theme\":\"dark\",\"isDark\":true}"
},
"Test light themes": {
"should set light theme as default": {
"1": "{\"theme\":\"light\",\"isDark\":false}"
},
"should change themes when clicked": {
"1": "{\"theme\":\"cupcake\",\"isDark\":false}"
}
},
"Test dark mode": {
"should set dark theme as default": {
"1": "{\"theme\":\"dark\",\"isDark\":true}"
}
}
}
}
+16 -14
View File
@@ -15,43 +15,45 @@
},
"devDependencies": {
"@cypress/snapshot": "^2.1.7",
"@sveltejs/adapter-static": "1.0.0-next.17",
"@sveltejs/adapter-static": "1.0.0-next.19",
"@sveltejs/kit": "1.0.0-next.147",
"@types/mermaid": "^8.2.7",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"autoprefixer": "^10.3.3",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"autoprefixer": "^10.3.4",
"chai": "^4.3.4",
"cssnano": "^5.0.8",
"cypress": "8.3.1",
"cypress": "8.4.0",
"cypress-localstorage-commands": "^1.5.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-cypress": "^2.11.3",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-postcss-modules": "^1.2.1",
"eslint-plugin-svelte3": "^3.2.0",
"eslint-plugin-svelte3": "^3.2.1",
"eslint-plugin-tailwindcss": "^1.14.3",
"husky": "^7.0.2",
"lint-staged": "^11.1.2",
"mocha": "^9.1.1",
"postcss": "^8.3.6",
"postcss-load-config": "^3.1.0",
"prettier": "~2.3.2",
"prettier": "~2.4.1",
"prettier-plugin-svelte": "^2.4.0",
"svelte": "^3.42.4",
"svelte-preprocess": "^4.8.0",
"tailwindcss": "^2.2.9",
"svelte": "^3.42.6",
"svelte-preprocess": "^4.9.4",
"tailwindcss": "^2.2.15",
"tslib": "^2.3.1",
"typescript": "^4.4.2"
"typescript": "^4.4.3"
},
"type": "module",
"dependencies": {
"@analytics/google-analytics": "^0.5.3",
"@macfja/svelte-persistent-store": "^1.2.0",
"analytics": "^0.7.14",
"js-base64": "^3.6.1",
"mermaid": "^8.11.4",
"daisyui": "^1.14.0",
"js-base64": "^3.7.1",
"mermaid": "^8.12.1",
"moment": "^2.29.1",
"monaco-editor": "^0.27.0",
"random-word-slugs": "^0.0.5"
+1 -1
View File
@@ -8,7 +8,7 @@
name="og:image"
content="https://github.com/mermaid-js/mermaid/raw/develop/img/header.png"
/>
<link rel="canonical" href="https://mermaid-js.github.io/mermaid-live-editor/" />
<link rel="canonical" href="https://mermaid.live" />
<meta
name="description"
content="Simplify documentation and avoid heavy tools. Open source Visio Alternative. Commonly used for explaining your code! Mermaid is a simple markdown-like script language for generating charts from text via javascript."
+3 -11
View File
@@ -2,17 +2,9 @@
@tailwind components;
@tailwind utilities;
.nav-btn {
@apply lg:p-2 py-3 px-0 block border-b-2 border-transparent hover:border-white;
}
.btn {
@apply bg-indigo-500 hover:bg-indigo-700 rounded px-4 shadow;
.input {
@apply flex-1 border-primary border-solid border-2 rounded;
}
.action-btn {
@apply rounded p-2 bg-indigo-400 shadow flex-auto text-white hover:bg-indigo-500;
}
.input {
@apply flex-1 border-indigo-400 border-solid border-2 rounded;
@apply btn btn-primary;
}
+28 -14
View File
@@ -153,39 +153,53 @@
<div class="flex flex-wrap gap-2 m-2">
{#if isClipboardAvailable()}
<button class="action-btn w-full" on:click={onCopyClipboard}
><i class="far fa-copy" /> Copy Image to clipboard
><i class="far fa-copy mr-2" /> Copy Image to clipboard
</button>
{/if}
<button class="action-btn flex-auto" on:click={onDownloadPNG}>
<i class="fas fa-download" /> PNG
<i class="fas fa-download mr-2" /> PNG
</button>
<button class="action-btn flex-auto" on:click={onDownloadSVG}>
<i class="fas fa-download" /> SVG
<i class="fas fa-download mr-2" /> SVG
</button>
<button class="action-btn flex-auto">
<a target="_blank" href={iUrl}><i class="fas fa-external-link-alt" /> PNG</a>
<a target="_blank" href={iUrl}><i class="fas fa-external-link-alt mr-2" /> PNG</a>
</button>
<button class="action-btn flex-auto">
<a target="_blank" href={svgUrl}><i class="fas fa-external-link-alt" /> SVG</a>
<a target="_blank" href={svgUrl}><i class="fas fa-external-link-alt mr-2" /> SVG</a>
</button>
<div class="flex gap-2 items-center">
PNG size
<input type="radio" value="auto" id="autosize" bind:group={imagemodeselected} />
<label for="autosize">Auto</label>
<input type="radio" value="width" id="width-active" bind:group={imagemodeselected} />
<label for="width">Width</label>
<input type="radio" value="height" id="height-active" bind:group={imagemodeselected} />
<label for="height">Height</label>
<label for="autosize">
<input type="radio" value="auto" id="autosize" bind:group={imagemodeselected} /> Auto
</label>
<label for="width">
<input type="radio" value="width" id="width" bind:group={imagemodeselected} /> Width
</label>
<label for="height">
<input type="radio" value="height" id="height" bind:group={imagemodeselected} /> Height
</label>
{#if imagemodeselected !== 'auto'}
<input id="height" type="number" min="3" max="10000" bind:value={userimagesize} />
<input
id="height"
class="input"
type="number"
min="3"
max="10000"
bind:value={userimagesize} />
{/if}
</div>
<div class="w-full flex gap-2 items-center">
<input class="input" id="markdown" type="text" value={mdCode} on:click={onCopyMarkdown} />
<label for="markdown">
<button class="btn text-white flex-auto" on:click={onCopyMarkdown}> Copy Markdown </button>
<button class="btn btn-primary btn-md flex-auto" on:click={onCopyMarkdown}>
Copy Markdown
</button>
</label>
</div>
@@ -197,7 +211,7 @@
bind:value={gistURL}
placeholder="Enter Gist URL" />
<label for="gist">
<button class="btn text-white flex-auto" on:click={loadGist}> Load Gist </button>
<button class="btn btn-primary btn-md flex-auto" on:click={loadGist}> Load Gist </button>
</label>
</div>
{#if isNetlify}
+5 -4
View File
@@ -7,21 +7,22 @@
export let tabs: Tab[] = [];
export let title: string;
$: isOpen = isCloseable ? isOpen : true;
$: isTabsShown = isOpen && tabs.length > 0;
</script>
<div class="bg-white rounded overflow-hidden shadow m-2 flex-grow flex flex-col">
<div class="card rounded overflow-hidden m-2 flex-grow flex flex-col shadow-2xl">
<div
class="bg-indigo-400 border-gray-400 p-2 flex-none cursor-pointer"
class="bg-primary p-2 {isTabsShown ? 'pb-0' : ''} flex-none cursor-pointer"
on:click={() => (isOpen = !isOpen)}>
<div class="flex justify-between">
<Tabs on:select {tabs} bind:isOpen {title} {isCloseable} />
<div class="flex gap-x-4 items-center text-white">
<div class="flex gap-x-4 items-center {isTabsShown ? '-mt-2' : ''}">
<slot name="actions" />
</div>
</div>
</div>
{#if isOpen}
<div class="flex-grow overflow-auto" transition:slide>
<div class="card-body p-0 flex-grow overflow-auto text-base-content" transition:slide>
<slot />
</div>
{/if}
+8 -13
View File
@@ -17,25 +17,20 @@
</script>
<div class="flex cursor-default">
<span class="text-white mr-2 font-semibold" on:click|stopPropagation={() => (isOpen = !isOpen)}>
<span class="mr-2 font-semibold" on:click|stopPropagation={() => (isOpen = !isOpen)}>
{#if isCloseable}
<i class="fas fa-chevron-right icon" class:isOpen />
{/if}
{title}</span>
{#if isOpen && tabs}
<ul class="flex flex-wrap flex-row" transition:fade>
<ul class="tabs" transition:fade>
{#each tabs as tab}
<li class="mr-2 last:mr-0 w-28 h-6 flex-auto text-center">
<div
class="text cursor-pointer font-semibold min-w-16 w-auto px-2 py-1 -mb-4 rounded-t flex justify-center items-center leading-normal {activeTabID ===
tab.id
? 'text-indigo-500 bg-white border-white'
: 'text-white bg-indigo-500 border-indigo-500 hover:bg-indigo-600'}"
on:click|stopPropagation={() => toggleTabs(tab)}>
<i class="{tab.icon} mr-1" />
{tab.title}
</div>
</li>
<div
class="tab tab-lifted text-primary-content {activeTabID === tab.id ? 'tab-active' : ''}"
on:click|stopPropagation={() => toggleTabs(tab)}>
<i class="mr-1 {tab.icon}" />
{tab.title}
</div>
{/each}
</ul>
{/if}
+7 -2
View File
@@ -1,6 +1,7 @@
<script lang="ts">
import type { EditorEvents } from '$lib/types';
import { codeStore } from '$lib/util/state';
import { themeStore } from '$lib/util/theme';
import type monaco from 'monaco-editor';
import { createEventDispatcher, onMount } from 'svelte';
import { initEditor } from './util';
@@ -17,7 +18,7 @@
minimap: {
enabled: false
},
theme: 'mermaidTheme',
theme: 'mermaid',
overviewRulerLanes: 0
};
export let errorMarkers: monaco.editor.IMarkerData[] = [];
@@ -33,6 +34,10 @@
editor && Monaco?.editor.setModelMarkers(editor.getModel(), 'test', errorMarkers);
}
themeStore.subscribe(({ isDark }) => {
editor && Monaco?.editor.setTheme(isDark ? 'mermaid-dark' : 'mermaid');
});
const dispatch = createEventDispatcher<EditorEvents>();
const loadMonaco = async () => {
let i = 0;
@@ -62,7 +67,7 @@
text
});
});
Monaco?.editor.setTheme($themeStore.isDark ? 'mermaid-dark' : 'mermaid');
const resizeObserver = new ResizeObserver((entries) => {
editor.layout({
height: entries[0].contentRect.height,
+22 -13
View File
@@ -156,7 +156,7 @@ export const initEditor = (monacoEditor): void => {
[/^\s*stateDiagram(-v2)?/, 'typeKeyword', 'stateDiagram'],
[/^\s*erDiagram/, 'typeKeyword', 'erDiagram'],
[/^\s*requirement(Diagram)?/, 'typeKeyword', 'requirementDiagram'],
[/%%.*(?<!%%)$/, 'comment']
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment']
],
gitGraph: [
[/option(?=s)/, { token: 'typeKeyword', next: 'optionsGitGraph' }],
@@ -170,7 +170,7 @@ export const initEditor = (monacoEditor): void => {
}
}
],
[/%%.*(?<!%%)$/, 'comment'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment'],
[/".*?"/, 'string'],
[/\^/, 'delimiter.bracket']
],
@@ -203,7 +203,7 @@ export const initEditor = (monacoEditor): void => {
[/".*?"/, 'string'],
[/\s*\d+/, 'number'],
[/:/, 'delimiter.bracket'],
[/%%.*(?<!%%)$/, 'comment']
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment']
],
flowchart: [
[/[ox]?(--+|==+)[ox]/, 'transition'],
@@ -229,7 +229,7 @@ export const initEditor = (monacoEditor): void => {
[/:::/, 'transition'],
[/[;&]/, 'delimiter.bracket'],
[/".*?"/, 'string'],
[/%%.*(?<!%%)$/, 'comment']
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment']
],
sequenceDiagram: [
[
@@ -244,7 +244,7 @@ export const initEditor = (monacoEditor): void => {
],
[/(--?>?>|--?[)x])[+-]?/, 'transition'],
[/(:)([^:\n]*?$)/, ['delimiter.bracket', 'string']],
[/%%.*(?<!%%)$/, 'comment']
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment']
],
classDiagram: [
[/(?!class\s)([a-zA-Z]+)(\s+[a-zA-Z]+)/, ['type', 'variable']],
@@ -260,7 +260,7 @@ export const initEditor = (monacoEditor): void => {
}
}
],
[/%%.*(?<!%%)$/, 'comment'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment'],
[/(<<)(.+?)(>>)/, ['delimiter.bracket', 'annotation', 'delimiter.bracket']],
[/".*?"/, 'string'],
[/:::/, 'transition'],
@@ -292,7 +292,7 @@ export const initEditor = (monacoEditor): void => {
],
[/,/, 'delimiter.bracket'],
[/(^\s*.+?)(:)([^:]*?)$/, ['string', 'delimiter.bracket', 'variable']],
[/%%.*(?<!%%)$/, 'comment']
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment']
],
gantt: [
[/(title)(.*)/, ['keyword', 'string']],
@@ -307,7 +307,7 @@ export const initEditor = (monacoEditor): void => {
}
],
[/(^\s*.*?)(:)/, ['string', 'delimiter.bracket']],
[/%%.*(?<!%%)$/, 'comment'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment'],
[/:/, 'delimiter.bracket']
],
stateDiagram: [
@@ -329,7 +329,7 @@ export const initEditor = (monacoEditor): void => {
[/".*?"/, 'string'],
[/(:)([^:\n]*?$)/, ['delimiter.bracket', 'string']],
[/{|}/, 'delimiter.bracket'],
[/%%.*(?<!%%)$/, 'comment'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment'],
[/-->/, 'transition'],
[/\[.*?]/, 'string']
],
@@ -343,7 +343,7 @@ export const initEditor = (monacoEditor): void => {
[/(:)(.*?$)/, ['delimiter.bracket', 'string']],
[/:|{|}/, 'delimiter.bracket'],
[/([a-zA-Z]+)(\s+[a-zA-Z]+)/, ['type', 'variable']],
[/%%.*(?<!%%)$/, 'comment'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment'],
[/[a-zA-Z_-][\w$]*/, 'variable']
],
requirementDiagram: [
@@ -359,15 +359,24 @@ export const initEditor = (monacoEditor): void => {
}
],
[/:|{|}|\//, 'delimiter.bracket'],
[/%%.*(?<!%%)$/, 'comment'],
[/%%[^$]([^%]*(?!%%$)%?)*$/, 'comment'],
[/".*?"/, 'string']
]
}
});
monacoEditor.editor.defineTheme('mermaidTheme', {
monacoEditor.editor.defineTheme('mermaid-dark', {
base: 'vs-dark',
inherit: true,
rules: [
{ token: 'typeKeyword', foreground: '9650c8', fontStyle: 'bold' },
{ token: 'transition', foreground: '008800', fontStyle: 'bold' }
]
});
monacoEditor.editor.defineTheme('mermaid', {
base: 'vs',
inherit: false,
inherit: true,
rules: [
{ token: 'typeKeyword', foreground: '9650c8', fontStyle: 'bold' },
{ token: 'keyword', foreground: '649696' },
+8 -10
View File
@@ -90,13 +90,13 @@
<div slot="actions">
<button
id="saveHistory"
class="btn"
class="btn btn-xs btn-success w-12"
on:click|stopPropagation={() => saveHistory()}
title="Save current state"><i class="far fa-save" /></button>
{#if $historyModeStore !== 'loader'}
<button
id="clearHistory"
class="btn text-red-400"
class="btn btn-xs btn-error w-12"
on:click|stopPropagation={() => clearHistory()}
title="Delete all saved states"><i class="fas fa-trash-alt" /></button>
{/if}
@@ -107,7 +107,7 @@
<li class="rounded p-2 shadow flex-col">
<div class="flex">
<div class="flex-1">
<div class="flex flex-col">
<div class="flex flex-col text-base-content">
{#if url}
<a
href={url}
@@ -121,20 +121,18 @@
</div>
</div>
<div class="flex gap-2 content-center">
<button
class="rounded px-2 w-24 bg-green-200 hover:bg-green-300"
on:click={() => restoreHistory(state)}><i class="fas fa-undo" /> Restore</button>
<button class="btn btn-success" on:click={() => restoreHistory(state)}
><i class="fas fa-undo mr-1" />Restore</button>
{#if type !== 'loader'}
<button
class="rounded px-2 w-24 bg-red-200 hover:bg-red-300"
on:click={() => clearHistory(time)}><i class="fas fa-trash-alt" /> Delete</button>
<button class="btn btn-error" on:click={() => clearHistory(time)}
><i class="fas fa-trash-alt mr-1" />Delete</button>
{/if}
</div>
</div>
</li>
{/each}
{:else}
<div class="m-2 text-gray-600">
<div class="m-2">
No items in History<br />
Click the Save button to save current state and restore it later.<br />
Timeline will automatically be saved every minute.
+21 -19
View File
@@ -7,6 +7,8 @@
</script>
<script lang="ts">
import Theme from './theme.svelte';
interface Link {
title: string;
href: string;
@@ -37,11 +39,12 @@
];
</script>
<header class="p-2 bg-indigo-400 text-white font-bold flex flex-wrap items-center">
<div class="flex-1 flex justify-between items-center">
<a href="/">Mermaid<span class="text-xs font-thin">v{version}</span> Live Editor</a>
<div class="navbar mb-2 shadow-lg bg-primary">
<div class="flex-1 px-2 mx-2">
<span class="text-lg font-bold">
<a href="/">Mermaid<span class="text-xs font-thin">v{version}</span> Live Editor</a>
</span>
</div>
<label for="menu-toggle" class="pointer-cursor lg:hidden block"
><svg
class="fill-current "
@@ -53,28 +56,27 @@
></label>
<input class="hidden" type="checkbox" id="menu-toggle" />
<Theme />
<div class="hidden lg:flex lg:items-center lg:w-auto w-full" id="menu">
<nav>
<ul class="lg:flex items-center justify-between text-base pt-4 lg:pt-0">
{#each links as { title, href, icon }}
<li>
<a class="nav-btn" target="_blank" {href}>
{#if icon}
<i class={icon} />
{/if}
{title}</a>
</li>
{/each}
</ul>
</nav>
<ul class="lg:flex items-center justify-between text-base pt-4 lg:pt-0">
{#each links as { title, href, icon }}
<li>
<a class="btn btn-ghost" target="_blank" {href}>
{#if icon}
<i class={icon} />
{/if}
{title}</a>
</li>
{/each}
</ul>
</div>
</header>
</div>
<style>
#menu-toggle:checked + #menu {
display: block;
}
header {
.navbar {
z-index: 10000;
}
</style>
+2 -1
View File
@@ -108,7 +108,8 @@ merge newbranch
<Card title="Sample Diagrams" isOpen={false}>
<div class="flex gap-2 flex-wrap p-2">
{#each Object.keys(samples) as sample}
<button class="action-btn" on:click={() => loadSampleDiagram(sample)}>{sample}</button>
<button class="btn btn-primary normal-case btn-sm" on:click={() => loadSampleDiagram(sample)}
>{sample}</button>
{/each}
</div>
</Card>
+59
View File
@@ -0,0 +1,59 @@
<script>
import { setTheme, themeStore } from '$lib/util/theme';
const themes = [
'🌝 light',
'🌚 dark',
'🧁 cupcake',
'🐝 bumblebee',
'✳️ emerald',
'🏢 corporate',
'🌃 synthwave',
'👴 retro',
'🤖 cyberpunk',
'🌸 valentine',
'🎃 halloween',
'🌷 garden',
'🌲 forest',
'🐟 aqua',
'👓 lofi',
'🖍 pastel',
'🧚‍♀️ fantasy',
'📝 wireframe',
'🏴 black',
'💎 luxury',
'🧛‍♂️ dracula'
];
</script>
<div class="hidden lg:block dropdown">
<div tabindex="0" class="btn btn-ghost ">
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
class="inline-block w-6 h-6 stroke-current md:mr-2"
><path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01" /></svg>
<span class="hidden md:inline"> Change Theme </span>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1792 1792"
class="inline-block w-4 h-4 ml-1 fill-current"
><path
d="M1395 736q0 13-10 23l-466 466q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l393 393 393-393q10-10 23-10t23 10l50 50q10 10 10 23z" /></svg>
</div>
<div
class="mt-14 overflow-y-auto shadow-2xl top-px dropdown-content h-96 w-56 bg-base-200 text-base-content">
<ul tabindex="0" class="p-4 menu compact">
{#each themes as theme}
<li class={theme.includes($themeStore.theme) ? 'bordered' : ''}>
<span class="btn btn-ghost justify-start" on:click={() => setTheme(theme)}>{theme}</span>
</li>
{/each}
</ul>
</div>
</div>
+5 -4
View File
@@ -3,11 +3,12 @@
import { codeStore } from '$lib/util/state';
import { onMount } from 'svelte';
import * as mermaid from 'mermaid';
import mermaid from 'mermaid';
let code = '';
let config = '';
let container: HTMLDivElement;
let view: HTMLDivElement;
let error = false;
let outOfSync = false;
let manualUpdate = true;
@@ -26,13 +27,13 @@
}
code = state.code;
config = state.mermaid;
const scroll = container.parentElement.parentElement.parentElement.scrollTop;
const scroll = view.parentElement.scrollTop;
delete container.dataset.processed;
mermaid.initialize(Object.assign({}, JSON.parse(state.mermaid)));
mermaid.render('graph-div', code, (svgCode) => {
container.innerHTML = svgCode;
});
container.parentElement.parentElement.parentElement.scrollTop = scroll;
view.parentElement.scrollTop = scroll;
error = false;
} else if (manualUpdate) {
manualUpdate = false;
@@ -55,7 +56,7 @@
});
</script>
<div id="view" class="p-2" class:error class:outOfSync>
<div id="view" bind:this={view} class="p-2" class:error class:outOfSync>
<div id="container" bind:this={container} class="flex-1 overflow-auto" />
</div>
+15 -4
View File
@@ -2,7 +2,7 @@ import { writable, get, derived } from 'svelte/store';
import { toBase64, fromBase64 } from 'js-base64';
import { persist, localStorage } from '@macfja/svelte-persistent-store';
import type { State } from '$lib/types';
import { saveStatistcs } from './stats';
import { saveStatistics } from './stats';
export const defaultState: State = {
code: `graph TD
@@ -33,7 +33,7 @@ export const loadState = (data: string): void => {
let state: State;
try {
const stateStr = fromBase64(data);
console.log(`Tring to load state: ${stateStr}`);
console.log(`Trying to load state: ${stateStr}`);
state = JSON.parse(stateStr);
const mermaidConfig =
typeof state.mermaid === 'string' ? JSON.parse(state.mermaid) : state.mermaid;
@@ -66,12 +66,12 @@ export const updateCodeStore = (newState: State): void => {
let prompted = false;
export const updateCode = (code: string, updateEditor: boolean, updateDiagram = false): void => {
saveStatistcs(code);
saveStatistics(code);
const lines = (code.match(/\n/g) || '').length + 1;
if (lines > 50 && !prompted && get(codeStore).autoSync) {
const turnOff = confirm(
'Long diagram deteced. Turn off Auto Sync? Click the sync logo to manually sync.'
'Long diagram detected. Turn off Auto Sync? Click the sync logo to manually sync.'
);
prompted = true;
if (turnOff) {
@@ -92,6 +92,17 @@ export const updateConfig = (config: string, updateEditor: boolean): void => {
});
};
export const toggleDarkTheme = (dark: boolean): void => {
codeStore.update((state) => {
const config = JSON.parse(state.mermaid);
if (!config.theme || ['dark', 'default'].includes(config.theme)) {
config.theme = dark ? 'dark' : 'default';
}
return { ...state, mermaid: JSON.stringify(config, null, 2), updateEditor: true };
});
};
export const initURLSubscription = (): void => {
base64State.subscribe((state: string) => {
history.replaceState(undefined, undefined, `#${state}`);
+2 -2
View File
@@ -34,10 +34,10 @@ const detectType = (text: string): string => {
// manual debounce
let timeout;
export const saveStatistcs = (graph: string): void => {
export const saveStatistics = (graph: string): void => {
if (analytics) {
clearTimeout(timeout);
// Only save statistcs after a 5 sec delay
// Only save statistics after a 5 sec delay
timeout = setTimeout(function () {
const graphType = detectType(graph);
console.debug('ga:', 'send', 'event', 'render', graphType);
+36
View File
@@ -0,0 +1,36 @@
import { writable } from 'svelte/store';
import type { Writable } from 'svelte/store';
import { persist, localStorage } from '@macfja/svelte-persistent-store';
export interface ThemeConfig {
isDark: boolean;
theme?: string;
}
export const themeStore: Writable<ThemeConfig> = persist(
writable({
isDark: false
}),
localStorage(),
'themeStore'
);
const darkThemes = [
'dark',
'synthwave',
'halloween',
'aqua',
'forest',
'luxury',
'black',
'dracula'
];
export const setTheme = (theme: string): void => {
if (theme.includes(' ')) {
theme = theme.split(' ')[1].trim();
}
const isDark = darkThemes.includes(theme);
console.log('Setting theme', theme);
themeStore.set({ theme, isDark });
};
+2
View File
@@ -0,0 +1,2 @@
import { get as manifestGet } from '../manifest.json';
export const get = manifestGet;
+17 -1
View File
@@ -3,6 +3,9 @@
import { base } from '$app/paths';
import { onMount } from 'svelte';
import { loadingStateStore } from '$lib/util/loading';
import { setTheme, themeStore } from '$lib/util/theme';
import { toggleDarkTheme } from '$lib/util/state';
// This can be removed once https://github.com/sveltejs/kit/issues/1612 is fixed.
// Then move it into src and vite will bundle it automatically.
onMount(() => {
@@ -18,10 +21,23 @@
console.log('Service worker registration failed, error:', error);
});
}
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
if ($themeStore.theme === undefined) {
setTheme(isDarkMode ? 'dark' : 'light');
}
themeStore.subscribe(({ theme, isDark }) => {
if (theme) {
document.getElementsByTagName('html')[0].setAttribute('data-theme', theme);
toggleDarkTheme(isDark);
}
});
});
</script>
<main class="h-screen">
<main class="h-screen text-primary-content">
<slot />
</main>
+30 -27
View File
@@ -10,11 +10,12 @@
import { initHandler, syncDiagram } from '$lib/util/util';
import { errorStore } from '$lib/util/error';
import { onMount } from 'svelte';
import * as mermaid from 'mermaid';
import mermaid from 'mermaid';
import type monaco from 'monaco-editor';
import type { EditorUpdateEvent, State, Tab } from '$lib/types';
import { base } from '$app/paths';
base64State; // Weird fix for error > base64State is not defined. Treeshaking?
let selectedMode = 'code';
const languageMap = {
code: 'mermaid',
@@ -120,25 +121,32 @@
});
</script>
<div class="h-full flex flex-col overflow-hidden bg-gray-100">
<div class="h-full flex flex-col overflow-hidden">
<Navbar />
<div class="flex-1 flex overflow-hidden">
<div class="hidden md:flex flex-col" id="editorPane" style="width: 40%">
<Card on:select={tabSelectHandler} {tabs} isCloseable={false} title="Mermaid">
<div slot="actions">
{#if !$codeStore.autoSync}
<button
class="bg-indigo-500 hover:bg-indigo-700 rounded px-4 mx-2"
title="Sync Diagram"
data-cy="sync"
on:click={syncDiagram}><i class="fas fa-sync" /></button>
{/if}
<label
for="autoSync"
style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<input type="checkbox" id="autoSync" bind:checked={$codeStore.autoSync} />
Auto sync
</label>
<div class="flex flex-row items-center">
{#if !$codeStore.autoSync}
<button
class="btn btn-secondary btn-xs"
title="Sync Diagram"
data-cy="sync"
on:click={syncDiagram}><i class="fas fa-sync" /></button>
{/if}
<div class="form-control">
<label class="cursor-pointer label" for="autoSync">
<input
type="checkbox"
class="toggle toggle-primary mr-1"
id="autoSync"
bind:checked={$codeStore.autoSync} />
<span> Auto sync</span>
</label>
</div>
</div>
</div>
<Editor on:update={updateHandler} {language} bind:text {errorMarkers} />
@@ -150,20 +158,20 @@
<Actions />
</div>
</div>
<div id="resizeHandler" />
<div id="resizeHandler" class="hidden md:block" />
<div class="flex-1 flex flex-col overflow-hidden">
<Card title="Diagram" isCloseable={false}>
<button
slot="actions"
class="btn"
class="btn btn-primary btn-xs shadow-lg"
title="View diagram in new page"
on:click|stopPropagation={() => viewDiagram()}><i class="far fa-eye" /> View</button>
on:click|stopPropagation={() => viewDiagram()}><i class="far fa-eye mr-2" /> View</button>
<div class="flex-1 overflow-auto">
<View />
</div>
</Card>
<div class="md:hidden bg-white rounded shadow p-2 mx-2">
<div class="md:hidden rounded shadow p-2 mx-2">
Code editing not supported on mobile. Please use a desktop browser.
</div>
</div>
@@ -182,19 +190,14 @@
top: 0;
content: '';
position: absolute;
background-color: #ccc;
background-color: hsla(var(--b3));
margin-left: -1px;
transition-duration: 0.2s;
}
#resizeHandler:hover::after {
margin-left: -2px;
background-color: #818cf8;
background-color: hsla(var(--p));
width: 4px;
}
@media screen and (max-width: 768px) {
#resizeHandler {
display: none;
}
}
</style>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 47 KiB

+3 -17
View File
@@ -1,21 +1,7 @@
const { tailwindExtractor } = require('tailwindcss/lib/lib/purgeUnusedStyles');
module.exports = {
mode: 'aot',
purge: {
content: ['./src/**/*.{html,js,svelte,ts}'],
options: {
defaultExtractor: (content) => [
// If this stops working, please open an issue at https://github.com/svelte-add/tailwindcss/issues rather than bothering Tailwind Labs about it
...tailwindExtractor(content),
// Match Svelte class: directives (https://github.com/tailwindlabs/tailwindcss/discussions/1731)
...[...content.matchAll(/(?:class:)*([\w\d-/:%.]+)/gm)].map(
([_match, group, ..._rest]) => group
)
]
},
safelist: [/^svelte-[\d\w]+$/]
},
mode: 'jit',
plugins: [require('daisyui')],
purge: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {}
},
+227 -1707
View File
File diff suppressed because it is too large Load Diff