@jx3box/jx3box-editor 3.2.4 → 3.2.6

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.
Files changed (32) hide show
  1. package/.storybook/main.js +70 -0
  2. package/.storybook/middleware.js +73 -0
  3. package/.storybook/preview.js +90 -0
  4. package/package.json +14 -6
  5. package/src/ArticleMarkdown.vue +1 -1
  6. package/src/assets/css/markdown/markdown-article.less +13 -13
  7. package/src/assets/css/markdown/markdown-editor.less +11 -11
  8. package/src/components/Author.vue +34 -14
  9. package/src/components/QRcode.vue +1 -1
  10. package/src/service/cms.js +7 -1
  11. package/src/storybook/storybook-vars.less +1 -0
  12. package/src/storybook/storybook.helpers.js +154 -0
  13. package/stories/components/Author.stories.js +36 -0
  14. package/stories/components/Avatar.stories.js +55 -0
  15. package/stories/components/Combo.stories.js +37 -0
  16. package/stories/components/Letter.stories.js +30 -0
  17. package/stories/components/PostAuthor.stories.js +32 -0
  18. package/stories/components/QRcode.stories.js +37 -0
  19. package/stories/components/SkillMartial.stories.js +31 -0
  20. package/stories/exports/Article.stories.js +48 -0
  21. package/stories/exports/BoxResource.stories.js +31 -0
  22. package/stories/exports/Buff.stories.js +38 -0
  23. package/stories/exports/GameText.stories.js +38 -0
  24. package/stories/exports/Item.stories.js +51 -0
  25. package/stories/exports/ItemSimple.stories.js +50 -0
  26. package/stories/exports/Markdown.stories.js +46 -0
  27. package/stories/exports/Npc.stories.js +35 -0
  28. package/stories/exports/Resource.stories.js +29 -0
  29. package/stories/exports/Skill.stories.js +38 -0
  30. package/stories/exports/Tinymce.stories.js +46 -0
  31. package/stories/exports/Upload.stories.js +41 -0
  32. package/stories/exports/UploadAlbum.stories.js +31 -0
@@ -0,0 +1,38 @@
1
+ import Skill from "../../src/Skill.vue";
2
+ import { previewStory } from "../../src/storybook/storybook.helpers";
3
+
4
+ export default {
5
+ title: "Exports/Skill",
6
+ component: Skill,
7
+ tags: ["autodocs"],
8
+ args: {
9
+ client: "std",
10
+ id: "",
11
+ level: "",
12
+ },
13
+ argTypes: {
14
+ client: { description: "客户端类型。", control: "text", table: { type: { summary: "String" }, defaultValue: { summary: "'std'" } } },
15
+ id: { description: "技能 ID。", control: "text", table: { type: { summary: "String | Number" }, defaultValue: { summary: "''" } } },
16
+ level: { description: "技能等级。", control: "text", table: { type: { summary: "String | Number" }, defaultValue: { summary: "''" } } },
17
+ },
18
+ parameters: {
19
+ layout: "padded",
20
+ docs: {
21
+ description: {
22
+ component: "技能展示组件。根据 `client`、`id`、`level` 查询技能详情。",
23
+ },
24
+ },
25
+ },
26
+ };
27
+
28
+ export const Overview = previewStory(Skill, {
29
+ title: "技能信息预览",
30
+ description: "这里使用项目 demo 中的技能参数:`id=2716`、`level=0`,直接展示技能详情卡片的实际样子。",
31
+ code: `<Skill client="std" :id="2716" :level="0" />`,
32
+ style: "min-width: 420px; display: flex; justify-content: flex-start;",
33
+ });
34
+ Overview.args = {
35
+ client: "std",
36
+ id: 2716,
37
+ level: 0,
38
+ };
@@ -0,0 +1,46 @@
1
+ import Tinymce from "../../src/Tinymce.vue";
2
+ import { previewStory, useDemoText } from "../../src/storybook/storybook.helpers";
3
+
4
+ export default {
5
+ title: "Exports/Tinymce",
6
+ component: Tinymce,
7
+ tags: ["autodocs"],
8
+ args: {
9
+ modelValue: "",
10
+ content: "",
11
+ height: 800,
12
+ attachmentEnable: true,
13
+ resourceEnable: true,
14
+ emotionEnable: true,
15
+ subtype: "通用",
16
+ },
17
+ argTypes: {
18
+ modelValue: { description: "Vue 3 `v-model` 绑定值。", control: "text", table: { type: { summary: "String" } } },
19
+ content: { description: "兼容旧用法的初始内容。", control: "text", table: { type: { summary: "String" }, defaultValue: { summary: "''" } } },
20
+ height: { description: "编辑器高度。", control: "number", table: { type: { summary: "Number" }, defaultValue: { summary: "800" } } },
21
+ attachmentEnable: { description: "是否启用附件上传。", control: "boolean", table: { type: { summary: "Boolean" }, defaultValue: { summary: "true" } } },
22
+ resourceEnable: { description: "是否启用资源插入。", control: "boolean", table: { type: { summary: "Boolean" }, defaultValue: { summary: "true" } } },
23
+ emotionEnable: { description: "是否启用表情插入。", control: "boolean", table: { type: { summary: "Boolean" }, defaultValue: { summary: "true" } } },
24
+ subtype: { description: "心法分类,影响连招等功能。", control: "text", table: { type: { summary: "String" }, defaultValue: { summary: "'通用'" } } },
25
+ },
26
+ parameters: {
27
+ layout: "padded",
28
+ docs: {
29
+ description: {
30
+ component: "TinyMCE 富文本编辑器封装。依赖 TinyMCE 运行时、上传和资源插入环境。",
31
+ },
32
+ },
33
+ },
34
+ };
35
+
36
+ export const Overview = previewStory(Tinymce, {
37
+ title: "Tinymce 编辑器预览",
38
+ description: "这里加载 `public/demo/article_basic.html` 作为初始内容,直接展示富文本编辑器的默认工作形态。",
39
+ code: `<Tinymce v-model="html" :height="800" :attachmentEnable="true" :resourceEnable="true" />`,
40
+ style: "min-width: 1080px;",
41
+ setup() {
42
+ const { content } = useDemoText("/demo/article_basic.html", "<p>加载中...</p>");
43
+ return { html: content };
44
+ },
45
+ template: `<StoryComponent v-bind="args" v-model="html" />`,
46
+ });
@@ -0,0 +1,41 @@
1
+ import Upload from "../../src/Upload.vue";
2
+ import { previewStory } from "../../src/storybook/storybook.helpers";
3
+
4
+ export default {
5
+ title: "Exports/Upload",
6
+ component: Upload,
7
+ tags: ["autodocs"],
8
+ args: {
9
+ text: "上传附件",
10
+ onlyImage: false,
11
+ desc: "",
12
+ accept: "",
13
+ enable: true,
14
+ max: 10,
15
+ sizeLimit: 30,
16
+ },
17
+ argTypes: {
18
+ text: { description: "上传按钮文案。", control: "text", table: { type: { summary: "String" } } },
19
+ onlyImage: { description: "是否只允许图片。", control: "boolean", table: { type: { summary: "Boolean" } } },
20
+ desc: { description: "上传说明文本。", control: "text", table: { type: { summary: "String" } } },
21
+ accept: { description: "原生文件选择 accept 配置。", control: "text", table: { type: { summary: "String" }, defaultValue: { summary: "DEFAULT_ACCEPT" } } },
22
+ enable: { description: "是否允许上传。", control: "boolean", table: { type: { summary: "Boolean" }, defaultValue: { summary: "true" } } },
23
+ max: { description: "一次最多允许上传的文件数。", control: "number", table: { type: { summary: "Number" }, defaultValue: { summary: "10" } } },
24
+ sizeLimit: { description: "单个文件大小限制,单位 MB。", control: "number", table: { type: { summary: "Number" }, defaultValue: { summary: "30" } } },
25
+ },
26
+ parameters: {
27
+ layout: "padded",
28
+ docs: {
29
+ description: {
30
+ component: "附件上传组件。支持限制上传格式、数量和单文件大小。",
31
+ },
32
+ },
33
+ },
34
+ };
35
+
36
+ export const Overview = previewStory(Upload, {
37
+ title: "Upload 交互外观预览",
38
+ description: "这里展示上传组件默认外观。实际上传仍依赖 CMS 接口,但在 Storybook 中已经可以清楚看到按钮、说明和调用入口。",
39
+ code: `<Upload text="上传附件" :max="10" :sizeLimit="30" />`,
40
+ style: "min-width: 720px;",
41
+ });
@@ -0,0 +1,31 @@
1
+ import UploadAlbum from "../../src/UploadAlbum.vue";
2
+ import { componentStory } from "../../src/storybook/storybook.helpers";
3
+
4
+ export default {
5
+ title: "Exports/UploadAlbum",
6
+ component: UploadAlbum,
7
+ tags: ["autodocs"],
8
+ args: {
9
+ modelValue: undefined,
10
+ data: [
11
+ { id: "demo-1", name: "封面图", url: "https://picsum.photos/seed/jx3box-story-1/240/160" },
12
+ { id: "demo-2", name: "细节图", url: "https://picsum.photos/seed/jx3box-story-2/240/160" },
13
+ ],
14
+ },
15
+ argTypes: {
16
+ modelValue: { description: "受控图片列表,适合配合 `v-model` 使用。", control: "object", table: { type: { summary: "Array" }, defaultValue: { summary: "undefined" } } },
17
+ data: { description: "非受控模式下的初始图片列表。", control: "object", table: { type: { summary: "Array" }, defaultValue: { summary: "[]" } } },
18
+ },
19
+ parameters: {
20
+ layout: "padded",
21
+ docs: {
22
+ description: {
23
+ component: "相册上传组件。支持批量上传、拖拽排序和图片预览。传入已有图片列表时可直接展示。",
24
+ },
25
+ },
26
+ },
27
+ };
28
+
29
+ export const Default = componentStory(UploadAlbum, {
30
+ style: "min-width: 720px; background: #fff; padding: 24px; border-radius: 12px;",
31
+ });