@musnows/scriverse 0.3.11 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -1
- package/README.md +5 -1
- package/dist/ai.js +292 -19
- package/dist/ai.js.map +1 -1
- package/dist/app.js +46 -4
- package/dist/app.js.map +1 -1
- package/dist/database.js +64 -0
- package/dist/database.js.map +1 -1
- package/dist/public/app.js +1088 -274
- package/dist/public/character-markdown.js +12 -0
- package/dist/public/character-version.js +3 -1
- package/dist/public/index.html +76 -29
- package/dist/public/keyboard-shortcuts.d.ts +9 -0
- package/dist/public/keyboard-shortcuts.js +4 -0
- package/dist/public/model-config.d.ts +1 -0
- package/dist/public/model-config.js +12 -3
- package/dist/public/module-layout.d.ts +17 -0
- package/dist/public/module-layout.js +28 -0
- package/dist/public/page-route.js +1 -1
- package/dist/public/relationship-graph.js +62 -2
- package/dist/public/styles.css +330 -98
- package/dist/public/vendor/vditor/dist/css/content-theme/ant-design.css +210 -0
- package/dist/public/vendor/vditor/dist/css/content-theme/dark.css +123 -0
- package/dist/public/vendor/vditor/dist/css/content-theme/light.css +101 -0
- package/dist/public/vendor/vditor/dist/css/content-theme/wechat.css +94 -0
- package/dist/public/vendor/vditor/dist/images/emoji/b3log.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/chainbook.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/doge.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/hacpai.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/huaji.gif +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/latke.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/liandi.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/lute.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/octocat.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/pipe.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/siyuan.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/solo.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/sym.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/trollface.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/vditor.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/wide.png +0 -0
- package/dist/public/vendor/vditor/dist/images/emoji/wulian.png +0 -0
- package/dist/public/vendor/vditor/dist/images/img-loading.svg +1 -0
- package/dist/public/vendor/vditor/dist/images/logo.png +0 -0
- package/dist/public/vendor/vditor/dist/index.css +1823 -0
- package/dist/public/vendor/vditor/dist/index.d.ts +82 -0
- package/dist/public/vendor/vditor/dist/index.js +15995 -0
- package/dist/public/vendor/vditor/dist/index.min.js +1 -0
- package/dist/public/vendor/vditor/dist/js/abcjs/abcjs_basic.min.js +3 -0
- package/dist/public/vendor/vditor/dist/js/echarts/echarts.min.js +45 -0
- package/dist/public/vendor/vditor/dist/js/flowchart.js/flowchart.min.js +8 -0
- package/dist/public/vendor/vditor/dist/js/graphviz/full.render.js +90 -0
- package/dist/public/vendor/vditor/dist/js/graphviz/viz.js +333 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/LICENSE +29 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/highlight.min.js +3835 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/a11y-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/a11y-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/agate.min.css +20 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/an-old-hope.min.css +9 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/androidstudio.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/ant-design.min.css +84 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/arduino-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/arta.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/ascetic.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/atom-one-dark-reasonable.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/atom-one-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/atom-one-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/3024.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/apathy.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/apprentice.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ashes.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-cave-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-cave.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-dune-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-dune.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-estuary-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-estuary.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-forest-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-forest.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-heath-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-heath.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-lakeside-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-lakeside.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-plateau-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-plateau.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-savanna-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-savanna.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-seaside-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-seaside.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-sulphurpool-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atelier-sulphurpool.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/atlas.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/bespin.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-bathory.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-burzum.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-dark-funeral.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-gorgoroth.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-immortal.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-khold.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-marduk.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-mayhem.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-nile.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal-venom.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/black-metal.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/brewer.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/bright.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/brogrammer.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/brush-trees-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/brush-trees.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/chalk.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/circus.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/classic-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/classic-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/codeschool.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/colors.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/cupcake.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/cupertino.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/danqing.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/darcula.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/dark-violet.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/darkmoss.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/darktooth.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/decaf.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/default-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/default-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/dirtysea.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/dracula.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/edge-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/edge-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/eighties.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/embers.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/equilibrium-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/equilibrium-gray-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/equilibrium-gray-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/equilibrium-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/espresso.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/eva-dim.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/eva.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/flat.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/framer.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/fruit-soda.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gigavolt.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/github.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/google-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/google-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/grayscale-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/grayscale-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/green-screen.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-hard.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-medium.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-pale.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-soft.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-light-hard.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-light-medium.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/gruvbox-light-soft.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/hardcore.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/harmonic16-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/harmonic16-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/heetch-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/heetch-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/helios.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/hopscotch.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/horizon-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/horizon-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/humanoid-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/humanoid-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ia-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ia-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/icy-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ir-black.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/isotope.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/kimber.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/london-tube.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/macintosh.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/marrakesh.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/materia.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/material-darker.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/material-lighter.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/material-palenight.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/material-vivid.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/material.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/mellow-purple.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/mexico-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/mocha.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/monokai.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/nebula.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/nord.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/nova.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ocean.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/oceanicnext.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/one-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/onedark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/outrun-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/papercolor-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/papercolor-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/paraiso.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/pasque.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/phd.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/pico.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/pop.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/porple.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/qualia.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/railscasts.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/rebecca.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ros-pine-dawn.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ros-pine-moon.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/ros-pine.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/sagelight.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/sandcastle.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/seti-ui.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/shapeshifter.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/silk-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/silk-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/snazzy.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/solar-flare-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/solar-flare.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/solarized-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/solarized-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/spacemacs.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/summercamp.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/summerfruit-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/summerfruit-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/synth-midnight-terminal-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/synth-midnight-terminal-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/tango.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/tender.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/tomorrow-night.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/tomorrow.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/twilight.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/unikitty-dark.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/unikitty-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/vulcan.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-10-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-10.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-95-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-95.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-high-contrast-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-high-contrast.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-nt-light.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/windows-nt.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/woodland.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/xcode-dusk.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/base16/zenburn.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/brown-paper.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/brown-papersq.png +0 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/codepen-embed.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/color-brewer.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/default.min.css +9 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/devibeans.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/docco.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/far.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/felipec.min.css +7 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/foundation.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/github-dark-dimmed.min.css +9 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/github-dark.min.css +10 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/github.min.css +10 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/gml.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/googlecode.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/gradient-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/gradient-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/grayscale.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/hybrid.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/idea.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/intellij-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/ir-black.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/isbl-editor-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/isbl-editor-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/kimbie-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/kimbie-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/lightfair.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/lioshi.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/magula.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/mono-blue.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/monokai-sublime.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/monokai.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/night-owl.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/nnfx-dark.min.css +10 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/nnfx-light.min.css +10 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/nord.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/obsidian.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/panda-syntax-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/panda-syntax-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/paraiso-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/paraiso-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/pojoaque.jpg +0 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/pojoaque.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/purebasic.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/qtcreator-dark.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/qtcreator-light.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/rainbow.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/routeros.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/school-book.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/shades-of-purple.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/srcery.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/stackoverflow-dark.min.css +13 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/stackoverflow-light.min.css +13 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/sunburst.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/tokyo-night-dark.min.css +8 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/tokyo-night-light.min.css +8 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/tomorrow-night-blue.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/tomorrow-night-bright.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/vs.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/vs2015.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/xcode.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/styles/xt256.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/highlight.js/third-languages.js +135 -0
- package/dist/public/vendor/vditor/dist/js/i18n/de_DE.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/en_US.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/es_ES.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/fr_FR.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/ja_JP.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/ko_KR.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/pt_BR.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/ru_RU.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/sv_SE.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/vi_VN.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/zh_CN.js +86 -0
- package/dist/public/vendor/vditor/dist/js/i18n/zh_TW.js +86 -0
- package/dist/public/vendor/vditor/dist/js/icons/ant.js +174 -0
- package/dist/public/vendor/vditor/dist/js/icons/material.js +195 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/public/vendor/vditor/dist/js/katex/katex.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/katex/katex.min.js +1 -0
- package/dist/public/vendor/vditor/dist/js/katex/mhchem.min.js +1 -0
- package/dist/public/vendor/vditor/dist/js/lute/lute.min.js +72 -0
- package/dist/public/vendor/vditor/dist/js/markmap/katex.min.css +1 -0
- package/dist/public/vendor/vditor/dist/js/markmap/markmap.min.js +8251 -0
- package/dist/public/vendor/vditor/dist/js/markmap/prism.css +140 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/LICENSE +202 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/a11y/assistive-mml.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/a11y/complexity.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/a11y/explorer.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/a11y/semantic-enrich.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/asciimath.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/mml/entities.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/mml.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/action.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/all-packages.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/ams.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/amscd.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/autoload.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/bbox.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/boldsymbol.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/braket.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/bussproofs.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/cancel.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/color.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/colorV2.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/configMacros.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/enclose.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/extpfeil.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/html.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/mhchem.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/newcommand.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/noerrors.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/noundefined.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/physics.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/require.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/tagFormat.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/textmacros.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/unicode.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex/extensions/verb.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex-base.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex-full.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/input/tex.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/mathmaps/de.js +104 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/mathmaps/en.js +110 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/mathmaps/es.js +104 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/mathmaps/fr.js +104 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/mathmaps/mathmaps_ie.js +518 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/mathmaps/nemeth.js +104 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/sre-node.js +11 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/sre/sre_browser.js +1633 -0
- package/dist/public/vendor/vditor/dist/js/mathjax/tex-svg-full.js +1 -0
- package/dist/public/vendor/vditor/dist/js/mermaid/mermaid.min.js +2607 -0
- package/dist/public/vendor/vditor/dist/js/plantuml/plantuml-encoder.min.js +1 -0
- package/dist/public/vendor/vditor/dist/js/smiles-drawer/smiles-drawer.min.js +71 -0
- package/dist/public/vendor/vditor/dist/method.d.ts +51 -0
- package/dist/public/vendor/vditor/dist/method.js +2673 -0
- package/dist/public/vendor/vditor/dist/method.min.js +1 -0
- package/dist/public/vendor/vditor/dist/ts/constants.d.ts +45 -0
- package/dist/public/vendor/vditor/dist/ts/devtools/index.d.ts +7 -0
- package/dist/public/vendor/vditor/dist/ts/export/index.d.ts +4 -0
- package/dist/public/vendor/vditor/dist/ts/hint/index.d.ts +14 -0
- package/dist/public/vendor/vditor/dist/ts/ir/expandMarker.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/ir/highlightToolbarIR.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/ir/index.d.ts +13 -0
- package/dist/public/vendor/vditor/dist/ts/ir/input.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/ir/process.d.ts +8 -0
- package/dist/public/vendor/vditor/dist/ts/ir/processKeydown.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/SMILESRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/abcRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/adapterRender.d.ts +41 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/anchorRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/chartRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/codeRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/flowchartRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/getHTML.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/getMarkdown.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/graphvizRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/highlightRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/lazyLoadImageRender.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/markmapRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/mathRender.d.ts +9 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/mediaRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/mermaidRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/mindmapRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/outlineRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/plantumlRender.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/previewRender.d.ts +2 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/setLute.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/markdown/speechRender.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/outline/index.d.ts +7 -0
- package/dist/public/vendor/vditor/dist/ts/preview/image.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/preview/index.d.ts +10 -0
- package/dist/public/vendor/vditor/dist/ts/resize/index.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/sv/combineFootnote.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/sv/index.d.ts +13 -0
- package/dist/public/vendor/vditor/dist/ts/sv/inputEvent.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/sv/process.d.ts +11 -0
- package/dist/public/vendor/vditor/dist/ts/sv/processKeydown.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/tip/index.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Both.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Br.d.ts +4 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/CodeTheme.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/ContentTheme.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Counter.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Custom.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Devtools.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Divider.d.ts +4 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/EditMode.d.ts +8 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Emoji.d.ts +7 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Export.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Fullscreen.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Headings.d.ts +7 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Help.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Indent.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Info.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/InsertAfter.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/InsertBefore.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/MenuItem.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Outdent.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Outline.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Preview.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Record.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Redo.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Undo.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/Upload.d.ts +6 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/index.d.ts +10 -0
- package/dist/public/vendor/vditor/dist/ts/toolbar/setToolbar.d.ts +20 -0
- package/dist/public/vendor/vditor/dist/ts/ui/initUI.d.ts +4 -0
- package/dist/public/vendor/vditor/dist/ts/ui/setCodeTheme.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/ui/setContentTheme.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/ui/setPreviewMode.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/ui/setTheme.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/undo/index.d.ts +19 -0
- package/dist/public/vendor/vditor/dist/ts/upload/getElement.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/upload/index.d.ts +8 -0
- package/dist/public/vendor/vditor/dist/ts/upload/setHeaders.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/Options.d.ts +8 -0
- package/dist/public/vendor/vditor/dist/ts/util/RecordMedia.d.ts +18 -0
- package/dist/public/vendor/vditor/dist/ts/util/addScript.d.ts +2 -0
- package/dist/public/vendor/vditor/dist/ts/util/addStyle.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/code160to32.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/compatibility.d.ts +7 -0
- package/dist/public/vendor/vditor/dist/ts/util/editorCommonEvent.d.ts +9 -0
- package/dist/public/vendor/vditor/dist/ts/util/fixBrowserBehavior.d.ts +39 -0
- package/dist/public/vendor/vditor/dist/ts/util/function.d.ts +3 -0
- package/dist/public/vendor/vditor/dist/ts/util/getSelectText.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/hasClosest.d.ts +9 -0
- package/dist/public/vendor/vditor/dist/ts/util/hasClosestByHeadings.d.ts +2 -0
- package/dist/public/vendor/vditor/dist/ts/util/highlightToolbar.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/hotKey.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/log.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/merge.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/util/processCode.d.ts +2 -0
- package/dist/public/vendor/vditor/dist/ts/util/selection.d.ts +14 -0
- package/dist/public/vendor/vditor/dist/ts/util/toc.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/afterRenderEvent.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/highlightToolbarWYSIWYG.d.ts +4 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/index.d.ts +22 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/inlineTag.d.ts +10 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/input.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/processKeydown.d.ts +2 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/renderDomByMd.d.ts +5 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/setHeading.d.ts +2 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/showCode.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/ts/wysiwyg/toolbarEvent.d.ts +1 -0
- package/dist/public/vendor/vditor/dist/types/index.d.ts +921 -0
- package/dist/public/work-permissions.d.ts +5 -2
- package/dist/public/work-permissions.js +40 -13
- package/dist/security.js +11 -0
- package/dist/security.js.map +1 -1
- package/dist/server-runtime.js +5 -2
- package/dist/server-runtime.js.map +1 -1
- package/dist/store.js +192 -34
- package/dist/store.js.map +1 -1
- package/dist/user-auth.js +36 -7
- package/dist/user-auth.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/work-permissions.js +29 -6
- package/dist/work-permissions.js.map +1 -1
- package/package.json +2 -1
package/dist/store.js
CHANGED
|
@@ -6,6 +6,72 @@ import { paginated, paginationSql } from "./pagination.js";
|
|
|
6
6
|
import { currentRequestActor } from "./request-context.js";
|
|
7
7
|
import { classifyWorkModulePermissions, emptyWorkModulePermissions, fullWorkModulePermissions, storedWorkModulePermissions } from "./work-permissions.js";
|
|
8
8
|
import { countWords, documentShortSearchTerms, id, json, normalizeDocumentSearchText, normalizeParagraphSpacing, now, splitDocumentParagraphs } from "./utils.js";
|
|
9
|
+
function settingsFromInput(settingsMarkdown, settings, fallback = []) {
|
|
10
|
+
if (settingsMarkdown !== undefined)
|
|
11
|
+
return settingsMarkdown.trim() ? [settingsMarkdown] : [];
|
|
12
|
+
return settings ?? fallback;
|
|
13
|
+
}
|
|
14
|
+
function settingsMarkdownFromList(settings) {
|
|
15
|
+
return Array.isArray(settings) ? settings.map(String).filter(Boolean).join("\n\n") : "";
|
|
16
|
+
}
|
|
17
|
+
function knowledgeSectionTitle(contentMarkdown, index) {
|
|
18
|
+
const heading = contentMarkdown.match(/^\s{0,3}#{1,6}\s+(.+?)\s*#*\s*$/mu)?.[1]?.trim();
|
|
19
|
+
return heading || `设定 ${index + 1}`;
|
|
20
|
+
}
|
|
21
|
+
function normalizeKnowledgeSections(sections) {
|
|
22
|
+
return sections.map((section, index) => {
|
|
23
|
+
const contentMarkdown = section.contentMarkdown ?? "";
|
|
24
|
+
return {
|
|
25
|
+
title: section.title.trim() || knowledgeSectionTitle(contentMarkdown, index),
|
|
26
|
+
contentMarkdown,
|
|
27
|
+
summary: section.summary?.trim() ?? "",
|
|
28
|
+
sortOrder: Number.isFinite(section.sortOrder) ? Math.max(0, Math.trunc(section.sortOrder)) : index
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function knowledgeSectionInput(value, index) {
|
|
33
|
+
if (!isRecord(value))
|
|
34
|
+
return null;
|
|
35
|
+
const contentMarkdown = typeof value.contentMarkdown === "string"
|
|
36
|
+
? value.contentMarkdown
|
|
37
|
+
: typeof value.content === "string" ? value.content : "";
|
|
38
|
+
const title = typeof value.title === "string" ? value.title : "";
|
|
39
|
+
return {
|
|
40
|
+
title: title || knowledgeSectionTitle(contentMarkdown, index),
|
|
41
|
+
contentMarkdown,
|
|
42
|
+
summary: typeof value.summary === "string" ? value.summary : "",
|
|
43
|
+
sortOrder: typeof value.sortOrder === "number" ? value.sortOrder : index
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function knowledgeSectionsFromStored(value, fallback = []) {
|
|
47
|
+
const parsed = typeof value === "string" ? json(value, []) : value;
|
|
48
|
+
if (Array.isArray(parsed)) {
|
|
49
|
+
const sections = parsed.map((item, index) => knowledgeSectionInput(item, index)).filter((item) => item !== null);
|
|
50
|
+
if (sections.length > 0 || fallback.length === 0)
|
|
51
|
+
return normalizeKnowledgeSections(sections);
|
|
52
|
+
}
|
|
53
|
+
return normalizeKnowledgeSections(fallback.map((contentMarkdown, index) => ({
|
|
54
|
+
title: knowledgeSectionTitle(contentMarkdown, index),
|
|
55
|
+
contentMarkdown,
|
|
56
|
+
sortOrder: index
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
function knowledgeSectionsFromInput(sections, settingsMarkdown, settings, fallbackSections = []) {
|
|
60
|
+
if (sections !== undefined)
|
|
61
|
+
return normalizeKnowledgeSections(sections);
|
|
62
|
+
if (settingsMarkdown !== undefined || settings !== undefined) {
|
|
63
|
+
const legacySettings = settingsFromInput(settingsMarkdown, settings);
|
|
64
|
+
return knowledgeSectionsFromStored(legacySettings.map((contentMarkdown, index) => ({
|
|
65
|
+
title: knowledgeSectionTitle(contentMarkdown, index),
|
|
66
|
+
contentMarkdown,
|
|
67
|
+
sortOrder: index
|
|
68
|
+
})));
|
|
69
|
+
}
|
|
70
|
+
return fallbackSections;
|
|
71
|
+
}
|
|
72
|
+
function settingsFromKnowledgeSections(sections) {
|
|
73
|
+
return sections.map((section) => section.contentMarkdown).filter((content) => content.trim());
|
|
74
|
+
}
|
|
9
75
|
export const versionedEntityTypes = [
|
|
10
76
|
"work",
|
|
11
77
|
"volume",
|
|
@@ -204,6 +270,7 @@ export class Store {
|
|
|
204
270
|
parentRaceId: entity.parentRaceId,
|
|
205
271
|
description: entity.description,
|
|
206
272
|
settings: entity.settings,
|
|
273
|
+
settingsSections: entity.settingsSections,
|
|
207
274
|
memberIds: entity.memberIds
|
|
208
275
|
};
|
|
209
276
|
if (type === "organization")
|
|
@@ -211,6 +278,7 @@ export class Store {
|
|
|
211
278
|
name: entity.name,
|
|
212
279
|
description: entity.description,
|
|
213
280
|
settings: entity.settings,
|
|
281
|
+
settingsSections: entity.settingsSections,
|
|
214
282
|
memberIds: entity.memberIds
|
|
215
283
|
};
|
|
216
284
|
if (type === "timeline-track")
|
|
@@ -1620,9 +1688,11 @@ export class Store {
|
|
|
1620
1688
|
}
|
|
1621
1689
|
insertSettingWithId(workId, settingId, input, source = "create", sourceRef = null, changeNote = "") {
|
|
1622
1690
|
const timestamp = now();
|
|
1691
|
+
const content = input.content;
|
|
1623
1692
|
this.db.transaction(() => {
|
|
1624
1693
|
this.db.run(`INSERT INTO settings (id, work_id, title, category, content, tags_json, status, locked, evidence_json, scope_json, author_note, created_at, updated_at)
|
|
1625
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, settingId, workId, input.title, input.category,
|
|
1694
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, settingId, workId, input.title, input.category, content, JSON.stringify(input.tags ?? []), input.status ?? "draft", input.locked ? 1 : 0, JSON.stringify(input.evidence ?? []), JSON.stringify(input.scope ?? {}), input.authorNote ?? "", timestamp, timestamp);
|
|
1695
|
+
this.syncMarkdownAttachmentReferences(workId, "setting", settingId, content);
|
|
1626
1696
|
this.recordEntityVersion("setting", settingId, source, sourceRef, changeNote || "建立世界观设定", timestamp);
|
|
1627
1697
|
this.audit(workId, source === "restore" ? "setting.restored" : "setting.created", "setting", settingId, {
|
|
1628
1698
|
locked: input.locked ?? false,
|
|
@@ -1650,10 +1720,12 @@ export class Store {
|
|
|
1650
1720
|
}
|
|
1651
1721
|
updateSetting(settingId, input, source = "manual", sourceRef = null, changeNote = "", expectedVersionNo) {
|
|
1652
1722
|
const current = this.getSetting(settingId);
|
|
1723
|
+
const content = input.content ?? String(current.content);
|
|
1653
1724
|
this.db.transaction(() => {
|
|
1654
1725
|
this.assertExpectedVersion("setting", settingId, expectedVersionNo, "设定");
|
|
1655
1726
|
this.db.run(`UPDATE settings SET title = ?, category = ?, content = ?, tags_json = ?, status = ?, locked = ?,
|
|
1656
|
-
evidence_json = ?, scope_json = ?, author_note = ?, updated_at = ? WHERE id = ?`, input.title ?? String(current.title), input.category ?? String(current.category),
|
|
1727
|
+
evidence_json = ?, scope_json = ?, author_note = ?, updated_at = ? WHERE id = ?`, input.title ?? String(current.title), input.category ?? String(current.category), content, JSON.stringify(input.tags ?? current.tags), input.status ?? String(current.status), (input.locked ?? Boolean(current.locked)) ? 1 : 0, JSON.stringify(input.evidence ?? current.evidence), JSON.stringify(input.scope ?? current.scope), input.authorNote ?? String(current.authorNote), now(), settingId);
|
|
1728
|
+
this.syncMarkdownAttachmentReferences(String(current.workId), "setting", settingId, content);
|
|
1657
1729
|
this.recordEntityVersion("setting", settingId, source, sourceRef, changeNote || "更新世界观设定");
|
|
1658
1730
|
this.audit(String(current.workId), "setting.updated", "setting", settingId, { fields: Object.keys(input), source, sourceRef });
|
|
1659
1731
|
});
|
|
@@ -1664,6 +1736,7 @@ export class Store {
|
|
|
1664
1736
|
this.db.transaction(() => {
|
|
1665
1737
|
this.assertExpectedVersion("setting", settingId, expectedVersionNo, "设定");
|
|
1666
1738
|
this.recordEntityVersion("setting", settingId, "delete", null, "删除世界观设定");
|
|
1739
|
+
this.clearMarkdownAttachmentReferences("setting", settingId);
|
|
1667
1740
|
this.db.run("DELETE FROM settings WHERE id = ?", settingId);
|
|
1668
1741
|
this.audit(String(current.workId), "setting.deleted", "setting", settingId);
|
|
1669
1742
|
});
|
|
@@ -1701,10 +1774,13 @@ export class Store {
|
|
|
1701
1774
|
const memberIds = [...new Set(input.memberIds ?? [])];
|
|
1702
1775
|
this.assertCharactersInWork(workId, memberIds);
|
|
1703
1776
|
const memberSnapshots = this.captureCharacterSnapshots(memberIds);
|
|
1777
|
+
const settingsSections = knowledgeSectionsFromInput(input.settingsSections, input.settingsMarkdown, input.settings);
|
|
1778
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
1704
1779
|
const timestamp = now();
|
|
1705
1780
|
this.db.transaction(() => {
|
|
1706
|
-
this.db.run(`INSERT INTO races (id, work_id, parent_race_id, name, normalized_name, description, settings_json, created_at, updated_at)
|
|
1707
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, raceId, workId, parentRaceId, name, normalizedName, input.description ?? "", JSON.stringify(
|
|
1781
|
+
this.db.run(`INSERT INTO races (id, work_id, parent_race_id, name, normalized_name, description, settings_json, settings_sections_json, created_at, updated_at)
|
|
1782
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, raceId, workId, parentRaceId, name, normalizedName, input.description ?? "", JSON.stringify(settings), JSON.stringify(settingsSections), timestamp, timestamp);
|
|
1783
|
+
this.syncMarkdownAttachmentReferences(workId, "race", raceId, settingsMarkdownFromList(settings));
|
|
1708
1784
|
this.replaceRaceMembers(raceId, name, memberIds);
|
|
1709
1785
|
this.recordMembershipVersions(memberSnapshots, "race", raceId, `设为种族“${name}”`);
|
|
1710
1786
|
this.recordEntityVersion("race", raceId, source, sourceRef, changeNote || "建立种族档案", timestamp);
|
|
@@ -1750,9 +1826,13 @@ export class Store {
|
|
|
1750
1826
|
? [...new Set([...current.memberIds, ...(memberIds ?? [])])]
|
|
1751
1827
|
: [];
|
|
1752
1828
|
const memberSnapshots = this.captureCharacterSnapshots(touchedMemberIds);
|
|
1829
|
+
const currentSections = knowledgeSectionsFromStored(current.settingsSections, current.settings);
|
|
1830
|
+
const settingsSections = knowledgeSectionsFromInput(input.settingsSections, input.settingsMarkdown, input.settings, currentSections);
|
|
1831
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
1753
1832
|
this.db.transaction(() => {
|
|
1754
1833
|
this.assertExpectedVersion("race", raceId, expectedVersionNo, "种族");
|
|
1755
|
-
this.db.run(`UPDATE races SET parent_race_id = ?, name = ?, normalized_name = ?, description = ?, settings_json = ?, updated_at = ? WHERE id = ?`, parentRaceId, name, normalizedName, input.description ?? String(current.description), JSON.stringify(
|
|
1834
|
+
this.db.run(`UPDATE races SET parent_race_id = ?, name = ?, normalized_name = ?, description = ?, settings_json = ?, settings_sections_json = ?, updated_at = ? WHERE id = ?`, parentRaceId, name, normalizedName, input.description ?? String(current.description), JSON.stringify(settings), JSON.stringify(settingsSections), now(), raceId);
|
|
1835
|
+
this.syncMarkdownAttachmentReferences(workId, "race", raceId, settingsMarkdownFromList(settings));
|
|
1756
1836
|
if (nameChanged)
|
|
1757
1837
|
this.db.run("UPDATE characters SET species = ?, updated_at = ? WHERE race_id = ?", name, now(), raceId);
|
|
1758
1838
|
if (memberIds)
|
|
@@ -1774,6 +1854,7 @@ export class Store {
|
|
|
1774
1854
|
this.assertExpectedVersion("race", raceId, expectedVersionNo, "种族");
|
|
1775
1855
|
this.recordEntityVersion("race", raceId, "delete", null, "删除种族档案");
|
|
1776
1856
|
this.db.run("UPDATE characters SET race_id = NULL, species = '', updated_at = ? WHERE race_id = ?", now(), raceId);
|
|
1857
|
+
this.clearMarkdownAttachmentReferences("race", raceId);
|
|
1777
1858
|
this.db.run("DELETE FROM races WHERE id = ?", raceId);
|
|
1778
1859
|
this.recordMembershipVersions(memberSnapshots, "race", raceId, `种族“${String(current.name)}”已删除`);
|
|
1779
1860
|
this.audit(String(current.workId), "race.deleted", "race", raceId);
|
|
@@ -1800,15 +1881,19 @@ export class Store {
|
|
|
1800
1881
|
: target.parentRaceId;
|
|
1801
1882
|
const descriptionParts = [String(target.description).trim(), String(source.description).trim()].filter(Boolean);
|
|
1802
1883
|
const description = [...new Set(descriptionParts)].join("\n\n");
|
|
1803
|
-
const
|
|
1884
|
+
const settingsSections = [...knowledgeSectionsFromStored(target.settingsSections, target.settings), ...knowledgeSectionsFromStored(source.settingsSections, source.settings)]
|
|
1885
|
+
.map((section, index) => ({ ...section, sortOrder: index }));
|
|
1886
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
1804
1887
|
this.db.transaction(() => {
|
|
1805
1888
|
this.recordEntityVersion("race", sourceRaceId, "delete", mergeId, `合并至种族“${String(target.name)}”`, timestamp);
|
|
1806
|
-
this.db.run("UPDATE races SET parent_race_id = ?, description = ?, settings_json = ?, updated_at = ? WHERE id = ?", targetParentRaceId, description, JSON.stringify(settings), timestamp, targetRaceId);
|
|
1889
|
+
this.db.run("UPDATE races SET parent_race_id = ?, description = ?, settings_json = ?, settings_sections_json = ?, updated_at = ? WHERE id = ?", targetParentRaceId, description, JSON.stringify(settings), JSON.stringify(settingsSections), timestamp, targetRaceId);
|
|
1890
|
+
this.syncMarkdownAttachmentReferences(workId, "race", targetRaceId, settingsMarkdownFromList(settings));
|
|
1807
1891
|
this.db.run("UPDATE characters SET race_id = ?, species = ?, updated_at = ? WHERE race_id = ?", targetRaceId, String(target.name), timestamp, sourceRaceId);
|
|
1808
1892
|
for (const childRaceId of sourceChildren) {
|
|
1809
1893
|
this.db.run("UPDATE races SET parent_race_id = ?, updated_at = ? WHERE id = ?", targetRaceId, timestamp, childRaceId);
|
|
1810
1894
|
this.recordEntityVersion("race", childRaceId, "merge", mergeId, `因种族“${String(source.name)}”合并而迁移父种族`, timestamp);
|
|
1811
1895
|
}
|
|
1896
|
+
this.clearMarkdownAttachmentReferences("race", sourceRaceId);
|
|
1812
1897
|
this.db.run("DELETE FROM races WHERE id = ?", sourceRaceId);
|
|
1813
1898
|
this.recordMembershipVersions(memberSnapshots, "race", targetRaceId, `合并种族“${String(source.name)}”`);
|
|
1814
1899
|
this.recordEntityVersion("race", targetRaceId, "merge", mergeId, `合并种族“${String(source.name)}”`, timestamp);
|
|
@@ -1826,6 +1911,8 @@ export class Store {
|
|
|
1826
1911
|
mapRace(row) {
|
|
1827
1912
|
const raceId = requiredString(row, "id");
|
|
1828
1913
|
const lineage = this.raceLineage(raceId);
|
|
1914
|
+
const settingsSections = knowledgeSectionsFromStored(row.settings_sections_json, json(requiredString(row, "settings_json"), []));
|
|
1915
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
1829
1916
|
const members = this.db.all("SELECT id, name FROM characters WHERE race_id = ? ORDER BY name", requiredString(row, "id")).map((member) => ({
|
|
1830
1917
|
characterId: requiredString(member, "id"),
|
|
1831
1918
|
name: requiredString(member, "name")
|
|
@@ -1836,10 +1923,15 @@ export class Store {
|
|
|
1836
1923
|
parentRaceId: optionalString(row, "parent_race_id"),
|
|
1837
1924
|
name: requiredString(row, "name"),
|
|
1838
1925
|
description: requiredString(row, "description"),
|
|
1839
|
-
settings
|
|
1926
|
+
settings,
|
|
1927
|
+
settingsMarkdown: settingsMarkdownFromList(settings),
|
|
1928
|
+
settingsSections,
|
|
1840
1929
|
lineage: lineage.map((item) => ({ id: item.id, name: item.name })),
|
|
1841
|
-
effectiveSettings: lineage.flatMap((item, index) => item.
|
|
1842
|
-
|
|
1930
|
+
effectiveSettings: lineage.flatMap((item, index) => item.settingsSections.map((section) => ({
|
|
1931
|
+
title: section.title,
|
|
1932
|
+
summary: section.summary,
|
|
1933
|
+
sortOrder: section.sortOrder,
|
|
1934
|
+
value: section.contentMarkdown,
|
|
1843
1935
|
sourceRaceId: item.id,
|
|
1844
1936
|
sourceRaceName: item.name,
|
|
1845
1937
|
inherited: index < lineage.length - 1
|
|
@@ -1889,13 +1981,15 @@ export class Store {
|
|
|
1889
1981
|
if (seen.has(currentId))
|
|
1890
1982
|
throw new AppError(500, "RACE_HIERARCHY_INVALID", "种族层级存在循环");
|
|
1891
1983
|
seen.add(currentId);
|
|
1892
|
-
const row = this.db.get("SELECT id, name, settings_json, parent_race_id FROM races WHERE id = ?", currentId);
|
|
1984
|
+
const row = this.db.get("SELECT id, name, settings_json, settings_sections_json, parent_race_id FROM races WHERE id = ?", currentId);
|
|
1893
1985
|
if (!row)
|
|
1894
1986
|
throw new AppError(500, "RACE_HIERARCHY_INVALID", "种族层级引用了不存在的父种族");
|
|
1987
|
+
const settingsSections = knowledgeSectionsFromStored(row.settings_sections_json, json(requiredString(row, "settings_json"), []));
|
|
1895
1988
|
lineage.push({
|
|
1896
1989
|
id: requiredString(row, "id"),
|
|
1897
1990
|
name: requiredString(row, "name"),
|
|
1898
|
-
settings:
|
|
1991
|
+
settings: settingsFromKnowledgeSections(settingsSections),
|
|
1992
|
+
settingsSections
|
|
1899
1993
|
});
|
|
1900
1994
|
currentId = optionalString(row, "parent_race_id");
|
|
1901
1995
|
}
|
|
@@ -1921,10 +2015,13 @@ export class Store {
|
|
|
1921
2015
|
const memberIds = [...new Set(input.memberIds ?? [])];
|
|
1922
2016
|
this.assertCharactersInWork(workId, memberIds);
|
|
1923
2017
|
const memberSnapshots = this.captureCharacterSnapshots(memberIds);
|
|
2018
|
+
const settingsSections = knowledgeSectionsFromInput(input.settingsSections, input.settingsMarkdown, input.settings);
|
|
2019
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
1924
2020
|
const timestamp = now();
|
|
1925
2021
|
this.db.transaction(() => {
|
|
1926
|
-
this.db.run(`INSERT INTO organizations (id, work_id, name, normalized_name, description, settings_json, created_at, updated_at)
|
|
1927
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, organizationId, workId, name, normalizedName, input.description ?? "", JSON.stringify(
|
|
2022
|
+
this.db.run(`INSERT INTO organizations (id, work_id, name, normalized_name, description, settings_json, settings_sections_json, created_at, updated_at)
|
|
2023
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, organizationId, workId, name, normalizedName, input.description ?? "", JSON.stringify(settings), JSON.stringify(settingsSections), timestamp, timestamp);
|
|
2024
|
+
this.syncMarkdownAttachmentReferences(workId, "organization", organizationId, settingsMarkdownFromList(settings));
|
|
1928
2025
|
this.replaceOrganizationMembers(organizationId, memberIds);
|
|
1929
2026
|
this.recordMembershipVersions(memberSnapshots, "organization", organizationId, `加入组织“${name}”`);
|
|
1930
2027
|
this.recordEntityVersion("organization", organizationId, source, sourceRef, changeNote || "建立组织档案", timestamp);
|
|
@@ -1963,9 +2060,13 @@ export class Store {
|
|
|
1963
2060
|
this.assertCharactersInWork(workId, memberIds);
|
|
1964
2061
|
const touchedMemberIds = memberIds ? [...new Set([...current.memberIds, ...memberIds])] : [];
|
|
1965
2062
|
const memberSnapshots = this.captureCharacterSnapshots(touchedMemberIds);
|
|
2063
|
+
const currentSections = knowledgeSectionsFromStored(current.settingsSections, current.settings);
|
|
2064
|
+
const settingsSections = knowledgeSectionsFromInput(input.settingsSections, input.settingsMarkdown, input.settings, currentSections);
|
|
2065
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
1966
2066
|
this.db.transaction(() => {
|
|
1967
2067
|
this.assertExpectedVersion("organization", organizationId, expectedVersionNo, "组织");
|
|
1968
|
-
this.db.run(`UPDATE organizations SET name = ?, normalized_name = ?, description = ?, settings_json = ?, updated_at = ? WHERE id = ?`, name, normalizedName, input.description ?? String(current.description), JSON.stringify(
|
|
2068
|
+
this.db.run(`UPDATE organizations SET name = ?, normalized_name = ?, description = ?, settings_json = ?, settings_sections_json = ?, updated_at = ? WHERE id = ?`, name, normalizedName, input.description ?? String(current.description), JSON.stringify(settings), JSON.stringify(settingsSections), now(), organizationId);
|
|
2069
|
+
this.syncMarkdownAttachmentReferences(workId, "organization", organizationId, settingsMarkdownFromList(settings));
|
|
1969
2070
|
if (memberIds) {
|
|
1970
2071
|
this.replaceOrganizationMembers(organizationId, memberIds);
|
|
1971
2072
|
this.recordMembershipVersions(memberSnapshots, "organization", organizationId, `组织“${name}”成员关系变更`);
|
|
@@ -1981,6 +2082,7 @@ export class Store {
|
|
|
1981
2082
|
this.db.transaction(() => {
|
|
1982
2083
|
this.assertExpectedVersion("organization", organizationId, expectedVersionNo, "组织");
|
|
1983
2084
|
this.recordEntityVersion("organization", organizationId, "delete", null, "删除组织档案");
|
|
2085
|
+
this.clearMarkdownAttachmentReferences("organization", organizationId);
|
|
1984
2086
|
this.db.run("DELETE FROM organizations WHERE id = ?", organizationId);
|
|
1985
2087
|
this.recordMembershipVersions(memberSnapshots, "organization", organizationId, `组织“${String(current.name)}”已删除`);
|
|
1986
2088
|
this.audit(String(current.workId), "organization.deleted", "organization", organizationId);
|
|
@@ -2002,15 +2104,19 @@ export class Store {
|
|
|
2002
2104
|
const memberSnapshots = this.captureCharacterSnapshots(memberIds);
|
|
2003
2105
|
const descriptionParts = [String(target.description).trim(), String(source.description).trim()].filter(Boolean);
|
|
2004
2106
|
const description = [...new Set(descriptionParts)].join("\n\n");
|
|
2005
|
-
const
|
|
2107
|
+
const settingsSections = [...knowledgeSectionsFromStored(target.settingsSections, target.settings), ...knowledgeSectionsFromStored(source.settingsSections, source.settings)]
|
|
2108
|
+
.map((section, index) => ({ ...section, sortOrder: index }));
|
|
2109
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
2006
2110
|
const sourceMemberships = this.db.all("SELECT character_id, role, note, created_at FROM character_organization_memberships WHERE organization_id = ?", sourceOrganizationId);
|
|
2007
2111
|
this.db.transaction(() => {
|
|
2008
2112
|
this.recordEntityVersion("organization", sourceOrganizationId, "delete", mergeId, `合并至组织“${String(target.name)}”`, timestamp);
|
|
2009
|
-
this.db.run("UPDATE organizations SET description = ?, settings_json = ?, updated_at = ? WHERE id = ?", description, JSON.stringify(settings), timestamp, targetOrganizationId);
|
|
2113
|
+
this.db.run("UPDATE organizations SET description = ?, settings_json = ?, settings_sections_json = ?, updated_at = ? WHERE id = ?", description, JSON.stringify(settings), JSON.stringify(settingsSections), timestamp, targetOrganizationId);
|
|
2114
|
+
this.syncMarkdownAttachmentReferences(workId, "organization", targetOrganizationId, settingsMarkdownFromList(settings));
|
|
2010
2115
|
for (const membership of sourceMemberships) {
|
|
2011
2116
|
this.db.run(`INSERT INTO character_organization_memberships (character_id, organization_id, role, note, created_at, updated_at)
|
|
2012
2117
|
VALUES (?, ?, ?, ?, ?, ?) ON CONFLICT(character_id, organization_id) DO NOTHING`, requiredString(membership, "character_id"), targetOrganizationId, requiredString(membership, "role"), requiredString(membership, "note"), requiredString(membership, "created_at"), timestamp);
|
|
2013
2118
|
}
|
|
2119
|
+
this.clearMarkdownAttachmentReferences("organization", sourceOrganizationId);
|
|
2014
2120
|
this.db.run("DELETE FROM organizations WHERE id = ?", sourceOrganizationId);
|
|
2015
2121
|
this.recordMembershipVersions(memberSnapshots, "organization", targetOrganizationId, `合并组织“${String(source.name)}”`);
|
|
2016
2122
|
this.recordEntityVersion("organization", targetOrganizationId, "merge", mergeId, `合并组织“${String(source.name)}”`, timestamp);
|
|
@@ -2019,6 +2125,8 @@ export class Store {
|
|
|
2019
2125
|
return { mergeId, target: this.getOrganization(targetOrganizationId), source };
|
|
2020
2126
|
}
|
|
2021
2127
|
mapOrganization(row) {
|
|
2128
|
+
const settingsSections = knowledgeSectionsFromStored(row.settings_sections_json, json(requiredString(row, "settings_json"), []));
|
|
2129
|
+
const settings = settingsFromKnowledgeSections(settingsSections);
|
|
2022
2130
|
const members = this.db.all(`SELECT c.id, c.name, m.role, m.note
|
|
2023
2131
|
FROM character_organization_memberships m
|
|
2024
2132
|
JOIN characters c ON c.id = m.character_id
|
|
@@ -2033,7 +2141,9 @@ export class Store {
|
|
|
2033
2141
|
workId: requiredString(row, "work_id"),
|
|
2034
2142
|
name: requiredString(row, "name"),
|
|
2035
2143
|
description: requiredString(row, "description"),
|
|
2036
|
-
settings
|
|
2144
|
+
settings,
|
|
2145
|
+
settingsMarkdown: settingsMarkdownFromList(settings),
|
|
2146
|
+
settingsSections,
|
|
2037
2147
|
memberIds: members.map((member) => member.characterId),
|
|
2038
2148
|
members,
|
|
2039
2149
|
versionNo: this.currentEntityVersionNo("organization", requiredString(row, "id")),
|
|
@@ -2083,6 +2193,7 @@ export class Store {
|
|
|
2083
2193
|
delete profile.sections;
|
|
2084
2194
|
return {
|
|
2085
2195
|
name: String(character.name),
|
|
2196
|
+
code: String(character.code),
|
|
2086
2197
|
aliases: [...character.aliases],
|
|
2087
2198
|
raceId: character.raceId,
|
|
2088
2199
|
species: String(character.species),
|
|
@@ -2135,9 +2246,9 @@ export class Store {
|
|
|
2135
2246
|
const organizationIds = [...new Set(input.organizationIds ?? [])];
|
|
2136
2247
|
this.assertOrganizationsInWork(workId, organizationIds);
|
|
2137
2248
|
this.db.transaction(() => {
|
|
2138
|
-
this.db.run(`INSERT INTO characters (id, work_id, name, aliases_json, species, race_id, attributes_json, profile_json, current_state_json,
|
|
2249
|
+
this.db.run(`INSERT INTO characters (id, work_id, name, code, aliases_json, species, race_id, attributes_json, profile_json, current_state_json,
|
|
2139
2250
|
locked_fields_json, visibility, first_chapter_id, created_at, updated_at)
|
|
2140
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, characterId, workId, names.name, JSON.stringify(names.aliases), species, raceId, JSON.stringify(input.attributes ?? {}), JSON.stringify(input.profile ?? {}), JSON.stringify(input.currentState ?? {}), JSON.stringify(input.lockedFields ?? []), input.visibility ?? "author", input.firstChapterId ?? null, timestamp, timestamp);
|
|
2251
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, characterId, workId, names.name, input.code?.trim() ?? "", JSON.stringify(names.aliases), species, raceId, JSON.stringify(input.attributes ?? {}), JSON.stringify(input.profile ?? {}), JSON.stringify(input.currentState ?? {}), JSON.stringify(input.lockedFields ?? []), input.visibility ?? "author", input.firstChapterId ?? null, timestamp, timestamp);
|
|
2141
2252
|
this.insertCharacterNames(workId, characterId, names.entries);
|
|
2142
2253
|
this.replaceCharacterOrganizations(characterId, organizationIds);
|
|
2143
2254
|
this.insertCharacterVersion(characterId, 1, "create", null, "建立人物档案", timestamp);
|
|
@@ -2232,21 +2343,27 @@ export class Store {
|
|
|
2232
2343
|
attachmentIdsInMarkdown(contentMarkdown) {
|
|
2233
2344
|
return [...new Set([...contentMarkdown.matchAll(/attachment:\/\/([A-Za-z0-9_-]{1,300})/gu)].map((match) => String(match[1])))];
|
|
2234
2345
|
}
|
|
2235
|
-
|
|
2236
|
-
const
|
|
2237
|
-
const workId = String(section.workId);
|
|
2238
|
-
const attachmentIds = this.attachmentIdsInMarkdown(String(section.contentMarkdown));
|
|
2346
|
+
syncMarkdownAttachmentReferences(workId, entityType, entityId, contentMarkdown) {
|
|
2347
|
+
const attachmentIds = this.attachmentIdsInMarkdown(contentMarkdown);
|
|
2239
2348
|
for (const attachmentId of attachmentIds) {
|
|
2240
2349
|
const attachment = this.getAttachment(attachmentId);
|
|
2241
2350
|
if (attachment.workId !== workId)
|
|
2242
2351
|
throw new AppError(400, "ATTACHMENT_WORK_MISMATCH", "附件不属于当前作品");
|
|
2243
2352
|
}
|
|
2244
|
-
this.db.run("DELETE FROM attachment_references WHERE entity_type =
|
|
2353
|
+
this.db.run("DELETE FROM attachment_references WHERE entity_type = ? AND entity_id = ?", entityType, entityId);
|
|
2245
2354
|
for (const attachmentId of attachmentIds) {
|
|
2246
2355
|
this.db.run(`INSERT INTO attachment_references (attachment_id, work_id, entity_type, entity_id, created_at)
|
|
2247
|
-
VALUES (?, ?,
|
|
2356
|
+
VALUES (?, ?, ?, ?, ?)`, attachmentId, workId, entityType, entityId, now());
|
|
2248
2357
|
}
|
|
2249
2358
|
}
|
|
2359
|
+
clearMarkdownAttachmentReferences(entityType, entityId) {
|
|
2360
|
+
this.db.run("DELETE FROM attachment_references WHERE entity_type = ? AND entity_id = ?", entityType, entityId);
|
|
2361
|
+
}
|
|
2362
|
+
syncCharacterProfileSectionAttachments(section) {
|
|
2363
|
+
const sectionId = String(section.id);
|
|
2364
|
+
const workId = String(section.workId);
|
|
2365
|
+
this.syncMarkdownAttachmentReferences(workId, "character-section", sectionId, String(section.contentMarkdown));
|
|
2366
|
+
}
|
|
2250
2367
|
createCharacterProfileSection(characterId, input, source = "create", sourceRef = null) {
|
|
2251
2368
|
const character = this.getCharacter(characterId);
|
|
2252
2369
|
const sectionId = id("characterSection");
|
|
@@ -2440,7 +2557,7 @@ export class Store {
|
|
|
2440
2557
|
const attachment = this.getAttachment(attachmentId);
|
|
2441
2558
|
const references = Number(this.db.get("SELECT COUNT(*) AS count FROM attachment_references WHERE attachment_id = ?", attachmentId)?.count ?? 0);
|
|
2442
2559
|
if (references > 0)
|
|
2443
|
-
throw new AppError(409, "ATTACHMENT_IN_USE", "
|
|
2560
|
+
throw new AppError(409, "ATTACHMENT_IN_USE", "附件仍被资料引用,无法删除");
|
|
2444
2561
|
const storageKey = String(attachment.storageKey);
|
|
2445
2562
|
this.db.transaction(() => {
|
|
2446
2563
|
this.db.run("DELETE FROM attachments WHERE id = ?", attachmentId);
|
|
@@ -2480,8 +2597,8 @@ export class Store {
|
|
|
2480
2597
|
this.db.transaction(() => {
|
|
2481
2598
|
const lockedCurrent = this.getCharacter(characterId);
|
|
2482
2599
|
this.assertExpectedRevision("character", characterId, expectedVersionNo, "人物", Number(lockedCurrent.versionNo));
|
|
2483
|
-
this.db.run(`UPDATE characters SET name = ?, aliases_json = ?, species = ?, race_id = ?, attributes_json = ?, profile_json = ?, current_state_json = ?,
|
|
2484
|
-
locked_fields_json = ?, visibility = ?, first_chapter_id = ?, updated_at = ? WHERE id = ?`, names.name, JSON.stringify(names.aliases), species, raceId, JSON.stringify(attributes), JSON.stringify(input.profile ?? current.profile), JSON.stringify(input.currentState ?? current.currentState), JSON.stringify(input.lockedFields ?? current.lockedFields), input.visibility ?? String(current.visibility), input.firstChapterId === undefined ? current.firstChapterId : input.firstChapterId, now(), characterId);
|
|
2600
|
+
this.db.run(`UPDATE characters SET name = ?, code = ?, aliases_json = ?, species = ?, race_id = ?, attributes_json = ?, profile_json = ?, current_state_json = ?,
|
|
2601
|
+
locked_fields_json = ?, visibility = ?, first_chapter_id = ?, updated_at = ? WHERE id = ?`, names.name, input.code === undefined ? String(current.code) : input.code.trim(), JSON.stringify(names.aliases), species, raceId, JSON.stringify(attributes), JSON.stringify(input.profile ?? current.profile), JSON.stringify(input.currentState ?? current.currentState), JSON.stringify(input.lockedFields ?? current.lockedFields), input.visibility ?? String(current.visibility), input.firstChapterId === undefined ? current.firstChapterId : input.firstChapterId, now(), characterId);
|
|
2485
2602
|
this.db.run("DELETE FROM character_names WHERE character_id = ?", characterId);
|
|
2486
2603
|
this.insertCharacterNames(workId, characterId, names.entries);
|
|
2487
2604
|
if (organizationIds)
|
|
@@ -2550,7 +2667,7 @@ export class Store {
|
|
|
2550
2667
|
this.assertExpectedRevision("character", characterId, expectedVersionNo, "人物", this.currentCharacterVersionNo(characterId));
|
|
2551
2668
|
return this.recreateCharacterFromVersion(characterId, version, snapshot, versionNo);
|
|
2552
2669
|
}
|
|
2553
|
-
return this.updateCharacter(characterId, snapshot, "restore", requiredString(version, "id"), `恢复至 v${versionNo}`, expectedVersionNo);
|
|
2670
|
+
return this.updateCharacter(characterId, { ...snapshot, code: snapshot.code ?? "" }, "restore", requiredString(version, "id"), `恢复至 v${versionNo}`, expectedVersionNo);
|
|
2554
2671
|
}
|
|
2555
2672
|
recreateCharacterFromVersion(characterId, version, snapshot, versionNo) {
|
|
2556
2673
|
const workId = requiredString(version, "work_id");
|
|
@@ -2567,9 +2684,9 @@ export class Store {
|
|
|
2567
2684
|
const timestamp = now();
|
|
2568
2685
|
const nextVersionNo = numberValue(this.db.get("SELECT COALESCE(MAX(version_no), 0) AS version_no FROM character_versions WHERE character_id = ?", characterId) ?? {}, "version_no") + 1;
|
|
2569
2686
|
this.db.transaction(() => {
|
|
2570
|
-
this.db.run(`INSERT INTO characters (id, work_id, name, aliases_json, species, race_id, attributes_json, profile_json, current_state_json,
|
|
2687
|
+
this.db.run(`INSERT INTO characters (id, work_id, name, code, aliases_json, species, race_id, attributes_json, profile_json, current_state_json,
|
|
2571
2688
|
locked_fields_json, visibility, first_chapter_id, version_no, created_at, updated_at)
|
|
2572
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, characterId, workId, names.name, JSON.stringify(names.aliases), species, raceId, JSON.stringify(snapshot.attributes ?? {}), JSON.stringify(snapshot.profile ?? {}), JSON.stringify(snapshot.currentState ?? {}), JSON.stringify(snapshot.lockedFields ?? []), snapshot.visibility ?? "author", snapshot.firstChapterId ?? null, nextVersionNo, timestamp, timestamp);
|
|
2689
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, characterId, workId, names.name, snapshot.code ?? "", JSON.stringify(names.aliases), species, raceId, JSON.stringify(snapshot.attributes ?? {}), JSON.stringify(snapshot.profile ?? {}), JSON.stringify(snapshot.currentState ?? {}), JSON.stringify(snapshot.lockedFields ?? []), snapshot.visibility ?? "author", snapshot.firstChapterId ?? null, nextVersionNo, timestamp, timestamp);
|
|
2573
2690
|
this.insertCharacterNames(workId, characterId, names.entries);
|
|
2574
2691
|
this.replaceCharacterOrganizations(characterId, organizationIds);
|
|
2575
2692
|
this.insertCharacterVersion(characterId, nextVersionNo, "restore", requiredString(version, "id"), `恢复至 v${versionNo}`, timestamp, workId);
|
|
@@ -2642,6 +2759,7 @@ export class Store {
|
|
|
2642
2759
|
id: characterId,
|
|
2643
2760
|
workId: requiredString(row, "work_id"),
|
|
2644
2761
|
name: requiredString(row, "name"),
|
|
2762
|
+
code: requiredString(row, "code"),
|
|
2645
2763
|
aliases: indexedAliases.length > 0 ? indexedAliases : json(requiredString(row, "aliases_json"), []),
|
|
2646
2764
|
raceId: race ? String(race.id) : null,
|
|
2647
2765
|
race: race ? {
|
|
@@ -2726,6 +2844,7 @@ export class Store {
|
|
|
2726
2844
|
.filter((alias) => normalizeCharacterName(alias) !== normalizeCharacterName(String(target.name)))
|
|
2727
2845
|
.map((alias) => [normalizeCharacterName(alias), alias])).values()];
|
|
2728
2846
|
this.updateCharacter(targetId, {
|
|
2847
|
+
code: String(target.code) || String(source.code),
|
|
2729
2848
|
aliases: uniqueAliases,
|
|
2730
2849
|
raceId: target.raceId ?? source.raceId,
|
|
2731
2850
|
organizationIds: [...new Set([...target.organizationIds, ...source.organizationIds])],
|
|
@@ -3492,14 +3611,28 @@ export class Store {
|
|
|
3492
3611
|
}
|
|
3493
3612
|
listTasks(workId) {
|
|
3494
3613
|
this.getWork(workId);
|
|
3495
|
-
return this.db.all("SELECT * FROM analysis_tasks WHERE work_id = ? ORDER BY created_at DESC", workId).map((row) => this.mapTask(row));
|
|
3614
|
+
return this.db.all("SELECT * FROM analysis_tasks WHERE work_id = ? ORDER BY created_at DESC, id DESC", workId).map((row) => this.mapTask(row));
|
|
3496
3615
|
}
|
|
3497
3616
|
listTasksPage(workId, pagination) {
|
|
3498
3617
|
this.getWork(workId);
|
|
3499
3618
|
const page = paginationSql(pagination);
|
|
3500
|
-
const rows = this.db.all(`SELECT * FROM analysis_tasks WHERE work_id = ? ORDER BY created_at DESC${page.sql}`, workId, ...page.params);
|
|
3619
|
+
const rows = this.db.all(`SELECT * FROM analysis_tasks WHERE work_id = ? ORDER BY created_at DESC, id DESC${page.sql}`, workId, ...page.params);
|
|
3501
3620
|
return paginated(rows.map((row) => this.mapTask(row)), pagination);
|
|
3502
3621
|
}
|
|
3622
|
+
listTaskSummariesPage(workId, pagination) {
|
|
3623
|
+
this.getWork(workId);
|
|
3624
|
+
const page = paginationSql(pagination);
|
|
3625
|
+
const rows = this.db.all(`SELECT id, work_id, task_type, scope_json, status, progress, created_at, updated_at
|
|
3626
|
+
FROM analysis_tasks WHERE work_id = ? ORDER BY created_at DESC, id DESC${page.sql}`, workId, ...page.params);
|
|
3627
|
+
const chapterSummaries = new Map(this.db.all(`SELECT chapter.id, chapter.title, volume.title AS volume_title
|
|
3628
|
+
FROM chapters chapter JOIN volumes volume ON volume.id = chapter.volume_id
|
|
3629
|
+
WHERE chapter.work_id = ?`, workId).map((row) => [
|
|
3630
|
+
requiredString(row, "id"),
|
|
3631
|
+
`${requiredString(row, "volume_title")} · ${requiredString(row, "title")}`
|
|
3632
|
+
]));
|
|
3633
|
+
const volumeTitles = new Map(this.db.all("SELECT id, title FROM volumes WHERE work_id = ?", workId).map((row) => [requiredString(row, "id"), requiredString(row, "title")]));
|
|
3634
|
+
return paginated(rows.map((row) => this.mapTaskSummary(row, chapterSummaries, volumeTitles)), pagination);
|
|
3635
|
+
}
|
|
3503
3636
|
getTask(taskId) {
|
|
3504
3637
|
const row = this.db.get("SELECT * FROM analysis_tasks WHERE id = ?", taskId);
|
|
3505
3638
|
if (!row)
|
|
@@ -3589,6 +3722,31 @@ export class Store {
|
|
|
3589
3722
|
updatedAt: requiredString(row, "updated_at")
|
|
3590
3723
|
};
|
|
3591
3724
|
}
|
|
3725
|
+
mapTaskSummary(row, chapterSummaries, volumeTitles) {
|
|
3726
|
+
const scope = json(requiredString(row, "scope_json"), {});
|
|
3727
|
+
return {
|
|
3728
|
+
id: requiredString(row, "id"),
|
|
3729
|
+
workId: requiredString(row, "work_id"),
|
|
3730
|
+
taskType: requiredString(row, "task_type"),
|
|
3731
|
+
scope,
|
|
3732
|
+
scopeSummary: this.taskScopeSummaryFromMaps(scope, chapterSummaries, volumeTitles),
|
|
3733
|
+
status: requiredString(row, "status"),
|
|
3734
|
+
progress: numberValue(row, "progress"),
|
|
3735
|
+
createdAt: requiredString(row, "created_at"),
|
|
3736
|
+
updatedAt: requiredString(row, "updated_at")
|
|
3737
|
+
};
|
|
3738
|
+
}
|
|
3739
|
+
taskScopeSummaryFromMaps(scope, chapterSummaries, volumeTitles) {
|
|
3740
|
+
if (typeof scope.chapterId === "string")
|
|
3741
|
+
return chapterSummaries.get(scope.chapterId) ?? "章节已删除";
|
|
3742
|
+
if (scope.type === "volume" && typeof scope.volumeId === "string") {
|
|
3743
|
+
const title = volumeTitles.get(scope.volumeId);
|
|
3744
|
+
return title ? `分卷 · ${title}` : "分卷已删除";
|
|
3745
|
+
}
|
|
3746
|
+
if (scope.type === "book" || Object.keys(scope).length === 0)
|
|
3747
|
+
return "全书";
|
|
3748
|
+
return "未指定范围";
|
|
3749
|
+
}
|
|
3592
3750
|
taskScopeSummary(workId, scope) {
|
|
3593
3751
|
if (typeof scope.chapterId === "string") {
|
|
3594
3752
|
const chapter = this.db.get(`SELECT chapter.title AS title, volume.title AS volume_title
|