@opendesign-plus-test/components 0.0.1-rc.251 → 0.0.1-rc.253

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 (85) hide show
  1. package/dist/chunk-OElCookieNotice.cjs.js +1 -1
  2. package/dist/chunk-OElCookieNotice.es.js +4 -2
  3. package/dist/components/article/OArticle.vue.d.ts +206 -14
  4. package/dist/components/article/components/ArticleTitle.vue.d.ts +22 -0
  5. package/dist/components/{markdown/components/MarkdownPageTitle.vue.d.ts → article/components/DocTitle.vue.d.ts} +6 -5
  6. package/dist/components/article/index.d.ts +131 -25
  7. package/dist/components/article/types.d.ts +8 -2
  8. package/dist/components/doc-layout/ODocLayout.vue.d.ts +38 -0
  9. package/dist/components/doc-layout/index.d.ts +59 -0
  10. package/dist/components/markdown/OMarkdown.vue.d.ts +9 -16
  11. package/dist/components/markdown/index.d.ts +19 -45
  12. package/dist/components/summit/types.d.ts +20 -7
  13. package/dist/components/summit/utils.d.ts +11 -1
  14. package/dist/components.cjs.js +44 -44
  15. package/dist/components.css +1 -1
  16. package/dist/components.es.js +13146 -12861
  17. package/dist/index.d.ts +1 -0
  18. package/dist/treeshaking/_virtual/icon-menu-fold.mjs +20 -0
  19. package/dist/treeshaking/_virtual/icon-menu-unfold.mjs +20 -0
  20. package/dist/treeshaking/_virtual/icon-tips.mjs +13 -2
  21. package/dist/treeshaking/_virtual/icon-tips2.mjs +2 -13
  22. package/dist/treeshaking/components/anchor-bar/OAnchorBar.css +32 -32
  23. package/dist/treeshaking/components/anchor-bar/OAnchorBar.vue.mjs +1 -1
  24. package/dist/treeshaking/components/article/OArticle.css +18 -124
  25. package/dist/treeshaking/components/article/OArticle.vue.d.ts +206 -14
  26. package/dist/treeshaking/components/article/OArticle.vue.mjs +1 -1
  27. package/dist/treeshaking/components/article/OArticle.vue2.mjs +48 -82
  28. package/dist/treeshaking/components/article/OArticleList.css +7 -6
  29. package/dist/treeshaking/components/article/OArticleList.vue.mjs +48 -34
  30. package/dist/treeshaking/components/article/components/ArticleTitle.css +123 -0
  31. package/dist/treeshaking/components/article/components/ArticleTitle.vue.d.ts +22 -0
  32. package/dist/treeshaking/components/article/components/ArticleTitle.vue.mjs +7 -0
  33. package/dist/treeshaking/components/article/components/ArticleTitle.vue2.mjs +97 -0
  34. package/dist/treeshaking/components/article/components/DocTitle.css +246 -0
  35. package/dist/treeshaking/components/{markdown/components/MarkdownPageTitle.vue.d.ts → article/components/DocTitle.vue.d.ts} +6 -5
  36. package/dist/treeshaking/components/article/components/DocTitle.vue.mjs +7 -0
  37. package/dist/treeshaking/components/{markdown/components/MarkdownPageTitle.vue2.mjs → article/components/DocTitle.vue2.mjs} +131 -80
  38. package/dist/treeshaking/components/article/index.d.ts +131 -25
  39. package/dist/treeshaking/components/article/types.d.ts +8 -2
  40. package/dist/treeshaking/components/article-anchor/OArticleAnchor.css +4 -4
  41. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue.mjs +1 -1
  42. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue2.mjs +4 -5
  43. package/dist/treeshaking/components/doc-layout/ODocLayout.css +271 -0
  44. package/dist/treeshaking/components/doc-layout/ODocLayout.vue.d.ts +38 -0
  45. package/dist/treeshaking/components/doc-layout/ODocLayout.vue.mjs +7 -0
  46. package/dist/treeshaking/components/doc-layout/ODocLayout.vue2.mjs +165 -0
  47. package/dist/treeshaking/components/doc-layout/index.d.ts +59 -0
  48. package/dist/treeshaking/components/doc-layout/index.mjs +9 -0
  49. package/dist/treeshaking/components/events/OEventsList.vue.mjs +1 -1
  50. package/dist/treeshaking/components/markdown/OMarkdown.vue.d.ts +9 -16
  51. package/dist/treeshaking/components/markdown/OMarkdown.vue.mjs +1 -1
  52. package/dist/treeshaking/components/markdown/OMarkdown.vue2.mjs +68 -36
  53. package/dist/treeshaking/components/markdown/OMarkdown2.css +3 -3
  54. package/dist/treeshaking/components/markdown/components/MarkdownTitle.css +22 -22
  55. package/dist/treeshaking/components/markdown/components/MarkdownTitle.vue.mjs +1 -1
  56. package/dist/treeshaking/components/markdown/components/MarkdownTitle.vue2.mjs +11 -5
  57. package/dist/treeshaking/components/markdown/index.d.ts +19 -45
  58. package/dist/treeshaking/components/meeting/OMeetingMyCalendar.vue.mjs +5 -1
  59. package/dist/treeshaking/components/meeting/OMeetingSigCalendar.vue.mjs +1 -1
  60. package/dist/treeshaking/components/meeting/components/OMeetingCalendarList.vue.mjs +5 -1
  61. package/dist/treeshaking/components/recursion-menu/ORecursionMenu.vue.mjs +1 -1
  62. package/dist/treeshaking/components/summit/OSummitLive.css +38 -22
  63. package/dist/treeshaking/components/summit/OSummitLive.vue.mjs +1 -1
  64. package/dist/treeshaking/components/summit/OSummitLive.vue2.mjs +37 -10
  65. package/dist/treeshaking/components/summit/OSummitSchedule.css +33 -33
  66. package/dist/treeshaking/components/summit/OSummitSchedule.vue.mjs +1 -1
  67. package/dist/treeshaking/components/summit/OSummitSchedule.vue2.mjs +7 -13
  68. package/dist/treeshaking/components/summit/components/OSummitTabs.css +31 -30
  69. package/dist/treeshaking/components/summit/components/OSummitTabs.vue.mjs +1 -1
  70. package/dist/treeshaking/components/summit/types.d.ts +20 -7
  71. package/dist/treeshaking/components/summit/utils.d.ts +11 -1
  72. package/dist/treeshaking/components/summit/utils.mjs +30 -0
  73. package/dist/treeshaking/components/user-center/OUserInfo.vue2.mjs +1 -1
  74. package/dist/treeshaking/i18n/en.mjs +2 -1
  75. package/dist/treeshaking/i18n/zh.mjs +2 -1
  76. package/dist/treeshaking/index.d.ts +1 -0
  77. package/dist/treeshaking/index.mjs +2 -0
  78. package/package.json +4 -4
  79. package/dist/components/markdown/replacer/h1.d.ts +0 -11
  80. package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +0 -664
  81. package/dist/treeshaking/components/markdown/components/MarkdownPageTitle.css +0 -261
  82. package/dist/treeshaking/components/markdown/components/MarkdownPageTitle.vue.mjs +0 -7
  83. package/dist/treeshaking/components/markdown/replacer/h1.d.ts +0 -11
  84. package/dist/treeshaking/components/markdown/replacer/h1.mjs +0 -29
  85. package/dist/treeshaking/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +0 -664
@@ -12,6 +12,8 @@ type __VLS_Props = {
12
12
  prev?: OArticlePaginationItemT | null;
13
13
  /** 下一篇(可选),透传给 OArticlePagination */
14
14
  next?: OArticlePaginationItemT | null;
15
+ /** 标题模式:'article' 渲染文章标题(标题 + 标签),'doc' 渲染文档标题卡片(DocTitle),默认 'article' */
16
+ type?: 'article' | 'doc';
15
17
  /** 透传给 OMarkdown:禁用 H2 增强 */
16
18
  disableH2?: boolean;
17
19
  /** 透传给 OMarkdown:禁用表格增强 */
@@ -22,18 +24,18 @@ type __VLS_Props = {
22
24
  disableCode?: boolean;
23
25
  /** 标题头部展示的更新时间(可选),与标签两端对齐,文案前缀取 i18n `md.updateTime` */
24
26
  updateTime?: string;
25
- /** 透传给 OMarkdown:正文容器类名 */
26
- markdownBodyClass?: string;
27
- /** 是否移除正文首个元素的上边距(o-markdown-body 内第一个 div 的首个元素,常用于正文首元素为标题时消除顶部空隙),默认 true */
28
- removeFirstTopMargin?: boolean;
29
- /** 是否自动隐藏正文中的第一个 h1(该 h1 通常与标题重复,作为页面标题展示),默认 true */
30
- autoHideFirstH1?: boolean;
27
+ /** 透传给 DocTitle(type='doc'):源码链接地址,未传不展示 */
28
+ sourceUrl?: string;
29
+ /** 透传给 DocTitle(type='doc'):是否展示「下载文档」操作,点击触发 download 事件 */
30
+ enableDownload?: boolean;
31
+ /** 透传给 DocTitle(type='doc'):是否展示「收藏文档」操作,点击触发 collect 事件 */
32
+ enableStar?: boolean;
33
+ /** 透传给 DocTitle(type='doc'):是否展示「复制链接」操作,点击复制当前页面链接 */
34
+ enableCopyLink?: boolean;
31
35
  /** 透传给 OArticlePagination:上一篇文案,留空取 i18n 默认值 */
32
36
  prevLabel?: string;
33
37
  /** 透传给 OArticlePagination:下一篇文案,留空取 i18n 默认值 */
34
38
  nextLabel?: string;
35
- /** 透传给 OArticlePagination:是否显示顶部分割线 */
36
- divider?: boolean;
37
39
  /** 圆角 */
38
40
  radius?: string;
39
41
  };
@@ -42,28 +44,218 @@ declare function __VLS_template(): {
42
44
  slots: {
43
45
  default?(_: {}): any;
44
46
  };
45
- refs: {};
47
+ refs: {
48
+ markdownRef: ({
49
+ $: import('vue').ComponentInternalInstance;
50
+ $data: {};
51
+ $props: {
52
+ readonly disableH2?: boolean | undefined;
53
+ readonly disableTable?: boolean | undefined;
54
+ readonly disableImg?: boolean | undefined;
55
+ readonly disableCode?: boolean | undefined;
56
+ readonly disableChangeCodeTheme?: boolean | undefined;
57
+ readonly markdownBodyClass?: string | undefined;
58
+ readonly hideFirstH1?: boolean | undefined;
59
+ readonly hideFirstElementMarginTop?: boolean | undefined;
60
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
61
+ $attrs: import('vue').Attrs;
62
+ $refs: {
63
+ [x: string]: unknown;
64
+ } & {
65
+ markdownBodyRef: HTMLDivElement;
66
+ };
67
+ $slots: Readonly<{
68
+ [name: string]: import('vue').Slot<any> | undefined;
69
+ }>;
70
+ $root: import('vue').ComponentPublicInstance | null;
71
+ $parent: import('vue').ComponentPublicInstance | null;
72
+ $host: Element | null;
73
+ $emit: (event: string, ...args: any[]) => void;
74
+ $el: HTMLDivElement;
75
+ $options: import('vue').ComponentOptionsBase<Readonly<{
76
+ disableH2?: boolean;
77
+ disableTable?: boolean;
78
+ disableImg?: boolean;
79
+ disableCode?: boolean;
80
+ disableChangeCodeTheme?: boolean;
81
+ markdownBodyClass?: string;
82
+ hideFirstH1?: boolean;
83
+ hideFirstElementMarginTop?: boolean;
84
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
85
+ disableChangeCodeTheme: boolean;
86
+ disableH2: boolean;
87
+ disableTable: boolean;
88
+ disableImg: boolean;
89
+ disableCode: boolean;
90
+ markdownBodyClass: string;
91
+ hideFirstH1: boolean;
92
+ hideFirstElementMarginTop: boolean;
93
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
94
+ beforeCreate?: (() => void) | (() => void)[];
95
+ created?: (() => void) | (() => void)[];
96
+ beforeMount?: (() => void) | (() => void)[];
97
+ mounted?: (() => void) | (() => void)[];
98
+ beforeUpdate?: (() => void) | (() => void)[];
99
+ updated?: (() => void) | (() => void)[];
100
+ activated?: (() => void) | (() => void)[];
101
+ deactivated?: (() => void) | (() => void)[];
102
+ beforeDestroy?: (() => void) | (() => void)[];
103
+ beforeUnmount?: (() => void) | (() => void)[];
104
+ destroyed?: (() => void) | (() => void)[];
105
+ unmounted?: (() => void) | (() => void)[];
106
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
107
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
108
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
109
+ };
110
+ $forceUpdate: () => void;
111
+ $nextTick: typeof import('vue').nextTick;
112
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
113
+ } & Readonly<{
114
+ disableChangeCodeTheme: boolean;
115
+ disableH2: boolean;
116
+ disableTable: boolean;
117
+ disableImg: boolean;
118
+ disableCode: boolean;
119
+ markdownBodyClass: string;
120
+ hideFirstH1: boolean;
121
+ hideFirstElementMarginTop: boolean;
122
+ }> & Omit<Readonly<{
123
+ disableH2?: boolean;
124
+ disableTable?: boolean;
125
+ disableImg?: boolean;
126
+ disableCode?: boolean;
127
+ disableChangeCodeTheme?: boolean;
128
+ markdownBodyClass?: string;
129
+ hideFirstH1?: boolean;
130
+ hideFirstElementMarginTop?: boolean;
131
+ }> & Readonly<{}>, "disableChangeCodeTheme" | "disableH2" | "disableTable" | "disableImg" | "disableCode" | "markdownBodyClass" | "hideFirstH1" | "hideFirstElementMarginTop"> & {} & import('vue').ComponentCustomProperties & {} & {
132
+ $slots: {
133
+ header?(_: {
134
+ h1: HTMLElement | undefined;
135
+ }): any;
136
+ default?(_: {}): any;
137
+ footer?(_: {}): any;
138
+ };
139
+ }) | null;
140
+ };
46
141
  rootEl: HTMLDivElement;
47
142
  };
48
143
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
49
144
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
50
145
  navigate: (type: "prev" | "next", item: OArticlePaginationItemT) => any;
146
+ download: () => any;
147
+ collect: () => any;
51
148
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
52
149
  onNavigate?: ((type: "prev" | "next", item: OArticlePaginationItemT) => any) | undefined;
150
+ onDownload?: (() => any) | undefined;
151
+ onCollect?: (() => any) | undefined;
53
152
  }>, {
153
+ type: "article" | "doc";
54
154
  disableH2: boolean;
55
155
  disableTable: boolean;
56
156
  disableImg: boolean;
57
157
  disableCode: boolean;
58
- markdownBodyClass: string;
59
158
  prev: OArticlePaginationItemT | null;
60
159
  next: OArticlePaginationItemT | null;
61
- divider: boolean;
62
160
  radius: string;
63
161
  tags: string[];
64
- removeFirstTopMargin: boolean;
65
- autoHideFirstH1: boolean;
66
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
162
+ enableDownload: boolean;
163
+ enableStar: boolean;
164
+ enableCopyLink: boolean;
165
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
166
+ markdownRef: ({
167
+ $: import('vue').ComponentInternalInstance;
168
+ $data: {};
169
+ $props: {
170
+ readonly disableH2?: boolean | undefined;
171
+ readonly disableTable?: boolean | undefined;
172
+ readonly disableImg?: boolean | undefined;
173
+ readonly disableCode?: boolean | undefined;
174
+ readonly disableChangeCodeTheme?: boolean | undefined;
175
+ readonly markdownBodyClass?: string | undefined;
176
+ readonly hideFirstH1?: boolean | undefined;
177
+ readonly hideFirstElementMarginTop?: boolean | undefined;
178
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
179
+ $attrs: import('vue').Attrs;
180
+ $refs: {
181
+ [x: string]: unknown;
182
+ } & {
183
+ markdownBodyRef: HTMLDivElement;
184
+ };
185
+ $slots: Readonly<{
186
+ [name: string]: import('vue').Slot<any> | undefined;
187
+ }>;
188
+ $root: import('vue').ComponentPublicInstance | null;
189
+ $parent: import('vue').ComponentPublicInstance | null;
190
+ $host: Element | null;
191
+ $emit: (event: string, ...args: any[]) => void;
192
+ $el: HTMLDivElement;
193
+ $options: import('vue').ComponentOptionsBase<Readonly<{
194
+ disableH2?: boolean;
195
+ disableTable?: boolean;
196
+ disableImg?: boolean;
197
+ disableCode?: boolean;
198
+ disableChangeCodeTheme?: boolean;
199
+ markdownBodyClass?: string;
200
+ hideFirstH1?: boolean;
201
+ hideFirstElementMarginTop?: boolean;
202
+ }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
203
+ disableChangeCodeTheme: boolean;
204
+ disableH2: boolean;
205
+ disableTable: boolean;
206
+ disableImg: boolean;
207
+ disableCode: boolean;
208
+ markdownBodyClass: string;
209
+ hideFirstH1: boolean;
210
+ hideFirstElementMarginTop: boolean;
211
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
212
+ beforeCreate?: (() => void) | (() => void)[];
213
+ created?: (() => void) | (() => void)[];
214
+ beforeMount?: (() => void) | (() => void)[];
215
+ mounted?: (() => void) | (() => void)[];
216
+ beforeUpdate?: (() => void) | (() => void)[];
217
+ updated?: (() => void) | (() => void)[];
218
+ activated?: (() => void) | (() => void)[];
219
+ deactivated?: (() => void) | (() => void)[];
220
+ beforeDestroy?: (() => void) | (() => void)[];
221
+ beforeUnmount?: (() => void) | (() => void)[];
222
+ destroyed?: (() => void) | (() => void)[];
223
+ unmounted?: (() => void) | (() => void)[];
224
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
225
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
226
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
227
+ };
228
+ $forceUpdate: () => void;
229
+ $nextTick: typeof import('vue').nextTick;
230
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
231
+ } & Readonly<{
232
+ disableChangeCodeTheme: boolean;
233
+ disableH2: boolean;
234
+ disableTable: boolean;
235
+ disableImg: boolean;
236
+ disableCode: boolean;
237
+ markdownBodyClass: string;
238
+ hideFirstH1: boolean;
239
+ hideFirstElementMarginTop: boolean;
240
+ }> & Omit<Readonly<{
241
+ disableH2?: boolean;
242
+ disableTable?: boolean;
243
+ disableImg?: boolean;
244
+ disableCode?: boolean;
245
+ disableChangeCodeTheme?: boolean;
246
+ markdownBodyClass?: string;
247
+ hideFirstH1?: boolean;
248
+ hideFirstElementMarginTop?: boolean;
249
+ }> & Readonly<{}>, "disableChangeCodeTheme" | "disableH2" | "disableTable" | "disableImg" | "disableCode" | "markdownBodyClass" | "hideFirstH1" | "hideFirstElementMarginTop"> & {} & import('vue').ComponentCustomProperties & {} & {
250
+ $slots: {
251
+ header?(_: {
252
+ h1: HTMLElement | undefined;
253
+ }): any;
254
+ default?(_: {}): any;
255
+ footer?(_: {}): any;
256
+ };
257
+ }) | null;
258
+ }, HTMLDivElement>;
67
259
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
68
260
  export default _default;
69
261
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./OArticle.vue2.mjs";
2
2
  import './OArticle.css';
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const _OArticle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-effe6b29"]]);
4
+ const _OArticle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f94c0e57"]]);
5
5
  export {
6
6
  _OArticle as default
7
7
  };
@@ -1,22 +1,8 @@
1
- import { defineComponent, useCssVars, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, toDisplayString, createBlock, unref, withCtx, createTextVNode, createCommentVNode, Fragment, renderList, normalizeClass, createVNode, normalizeProps, guardReactiveProps, renderSlot } from "vue";
2
- import { OTag, ODivider } from "@opensig/opendesign";
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass, createVNode, mergeProps, withCtx, renderSlot, createBlock } from "vue";
3
2
  import _OMarkdown from "../markdown/OMarkdown.vue.mjs";
4
3
  import _OArticlePagination from "../article-pagination/OArticlePagination.vue.mjs";
5
- import { useI18n } from "../../i18n/index.mjs";
6
- const _hoisted_1 = { class: "o-article__header" };
7
- const _hoisted_2 = { class: "o-article__title" };
8
- const _hoisted_3 = {
9
- key: 0,
10
- class: "o-article__meta"
11
- };
12
- const _hoisted_4 = {
13
- key: 0,
14
- class: "o-article__tags"
15
- };
16
- const _hoisted_5 = {
17
- key: 1,
18
- class: "o-article__update-time"
19
- };
4
+ import ArticleTitle from "./components/ArticleTitle.vue.mjs";
5
+ import DocTitle from "./components/DocTitle.vue.mjs";
20
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
21
7
  __name: "OArticle",
22
8
  props: {
@@ -26,39 +12,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
12
  community: {},
27
13
  prev: { default: null },
28
14
  next: { default: null },
15
+ type: { default: "article" },
29
16
  disableH2: { type: Boolean, default: false },
30
17
  disableTable: { type: Boolean, default: false },
31
18
  disableImg: { type: Boolean, default: false },
32
19
  disableCode: { type: Boolean, default: false },
33
20
  updateTime: {},
34
- markdownBodyClass: { default: "o-markdown-body" },
35
- removeFirstTopMargin: { type: Boolean, default: true },
36
- autoHideFirstH1: { type: Boolean, default: true },
21
+ sourceUrl: {},
22
+ enableDownload: { type: Boolean, default: false },
23
+ enableStar: { type: Boolean, default: false },
24
+ enableCopyLink: { type: Boolean, default: false },
37
25
  prevLabel: {},
38
26
  nextLabel: {},
39
- divider: { type: Boolean, default: true },
40
27
  radius: { default: "var(--o-radius-xs)" }
41
28
  },
42
- emits: ["navigate"],
29
+ emits: ["navigate", "download", "collect"],
43
30
  setup(__props, { emit: __emit }) {
44
- useCssVars((_ctx) => ({
45
- "v421a9b14": headerBgStyle.value
46
- }));
47
31
  const props = __props;
48
32
  const emit = __emit;
49
- const { t } = useI18n();
50
33
  const markdownProps = computed(() => ({
51
- disableH1: true,
34
+ hideFirstH1: true,
52
35
  disableH2: props.disableH2,
53
36
  disableTable: props.disableTable,
54
37
  disableImg: props.disableImg,
55
- disableCode: props.disableCode,
56
- markdownBodyClass: props.markdownBodyClass
38
+ disableCode: props.disableCode
57
39
  }));
58
40
  const onNavigate = (type, item) => {
59
41
  emit("navigate", type, item);
60
42
  };
61
- const headerBgStyle = computed(() => props.headerBg ? `url(${props.headerBg})` : "none");
62
43
  return (_ctx, _cache) => {
63
44
  return openBlock(), createElementBlock("div", {
64
45
  class: "o-article",
@@ -66,66 +47,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
47
  "--o-article-radius": __props.radius
67
48
  })
68
49
  }, [
69
- createElementVNode("header", _hoisted_1, [
70
- createElementVNode("h1", _hoisted_2, toDisplayString(__props.title), 1),
71
- __props.tags.length || __props.updateTime || __props.community ? (openBlock(), createElementBlock("div", _hoisted_3, [
72
- __props.tags.length || __props.community ? (openBlock(), createElementBlock("div", _hoisted_4, [
73
- __props.community ? (openBlock(), createBlock(unref(OTag), {
74
- key: 0,
75
- class: "o-article__tag",
76
- size: "large",
77
- variant: "outline",
78
- round: __props.community === "MindSpore" ? "pill" : __props.radius
79
- }, {
80
- default: withCtx(() => [
81
- createTextVNode(toDisplayString(__props.community), 1)
82
- ]),
83
- _: 1
84
- }, 8, ["round"])) : createCommentVNode("", true),
85
- __props.community && __props.tags.length ? (openBlock(), createBlock(unref(ODivider), {
86
- key: 1,
87
- direction: "v",
88
- class: "o-article__tags-divider"
89
- })) : createCommentVNode("", true),
90
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.tags, (tag) => {
91
- return openBlock(), createBlock(unref(OTag), {
92
- key: tag,
93
- class: "o-article__tag",
94
- size: "large",
95
- variant: "outline",
96
- round: __props.community === "MindSpore" ? "pill" : __props.radius
97
- }, {
98
- default: withCtx(() => [
99
- createTextVNode(toDisplayString(tag), 1)
100
- ]),
101
- _: 2
102
- }, 1032, ["round"]);
103
- }), 128))
104
- ])) : createCommentVNode("", true),
105
- __props.updateTime ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(unref(t)("md.updateTime")) + toDisplayString(__props.updateTime), 1)) : createCommentVNode("", true)
106
- ])) : createCommentVNode("", true)
107
- ]),
108
50
  createElementVNode("div", {
109
51
  class: normalizeClass(["o-article__content", {
110
- "o-article__content--no-first-margin": __props.removeFirstTopMargin,
111
- "o-article__content--hide-first-h1": __props.autoHideFirstH1
52
+ doc: __props.type === "doc"
112
53
  }])
113
54
  }, [
114
- createVNode(_OMarkdown, normalizeProps(guardReactiveProps(markdownProps.value)), {
55
+ createVNode(_OMarkdown, mergeProps({ ref: "markdownRef" }, markdownProps.value), {
56
+ header: withCtx(({ h1 }) => [
57
+ __props.type === "article" ? (openBlock(), createBlock(ArticleTitle, {
58
+ key: 0,
59
+ title: __props.title,
60
+ el: h1,
61
+ "header-bg": __props.headerBg,
62
+ tags: __props.tags,
63
+ community: __props.community,
64
+ "update-time": __props.updateTime,
65
+ radius: __props.radius
66
+ }, null, 8, ["title", "el", "header-bg", "tags", "community", "update-time", "radius"])) : (openBlock(), createBlock(DocTitle, {
67
+ key: 1,
68
+ title: __props.title,
69
+ el: h1,
70
+ "bg-image": __props.headerBg,
71
+ "update-time": __props.updateTime,
72
+ "source-url": __props.sourceUrl,
73
+ "enable-download": __props.enableDownload,
74
+ "enable-star": __props.enableStar,
75
+ "enable-copy-link": __props.enableCopyLink,
76
+ onDownload: _cache[0] || (_cache[0] = ($event) => emit("download")),
77
+ onCollect: _cache[1] || (_cache[1] = ($event) => emit("collect"))
78
+ }, null, 8, ["title", "el", "bg-image", "update-time", "source-url", "enable-download", "enable-star", "enable-copy-link"]))
79
+ ]),
80
+ footer: withCtx(() => [
81
+ createVNode(_OArticlePagination, {
82
+ prev: __props.prev,
83
+ next: __props.next,
84
+ "prev-label": __props.prevLabel,
85
+ "next-label": __props.nextLabel,
86
+ radius: __props.radius,
87
+ onNavigate
88
+ }, null, 8, ["prev", "next", "prev-label", "next-label", "radius"])
89
+ ]),
115
90
  default: withCtx(() => [
116
91
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
117
92
  ]),
118
93
  _: 3
119
- }, 16),
120
- createVNode(_OArticlePagination, {
121
- prev: __props.prev,
122
- next: __props.next,
123
- "prev-label": __props.prevLabel,
124
- "next-label": __props.nextLabel,
125
- divider: __props.divider,
126
- radius: __props.radius,
127
- onNavigate
128
- }, null, 8, ["prev", "next", "prev-label", "next-label", "divider", "radius"])
94
+ }, 16)
129
95
  ], 2)
130
96
  ], 4);
131
97
  };
@@ -107,15 +107,16 @@
107
107
  flex-wrap: wrap;
108
108
  gap: var(--o-gap-1);
109
109
  }
110
- .o-article-list .article-content .o-card .o-card-detail .item-type {
111
- display: inline-flex;
110
+ .o-article-list .article-content .o-card .o-card-detail .item-tags {
111
+ display: flex;
112
+ flex-wrap: wrap; /* 换行时上下间距同为 --o-gap-2 */
112
113
  align-items: center;
113
- padding: var(--o-gap-1);
114
+ gap: var(--o-gap-2);
114
115
  }
115
- .o-article-list .article-content .o-card .o-card-detail .item-type.empty-tag {
116
- border-color: transparent;
116
+ .o-article-list .article-content .o-card .o-card-detail .item-tags .item-tag {
117
+ padding: var(--o-gap-1);
117
118
  }
118
- .o-article-list .article-content .o-card .o-card-detail .item-type .o-tag-icon {
119
+ .o-article-list .article-content .o-card .o-card-detail .item-tags .item-tag .o-tag-icon {
119
120
  display: flex;
120
121
  align-items: center;
121
122
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, useSlots, ref, computed, watch, openBlock, createElementBlock, unref, renderSlot, createCommentVNode, createElementVNode, createBlock, withCtx, Fragment, renderList, createVNode, createSlots, normalizeClass, toDisplayString, resolveDynamicComponent, createTextVNode } from "vue";
1
+ import { defineComponent, useSlots, ref, computed, watch, openBlock, createElementBlock, unref, renderSlot, createCommentVNode, createElementVNode, createBlock, withCtx, Fragment, renderList, createVNode, createSlots, toDisplayString, resolveDynamicComponent, createTextVNode } from "vue";
2
2
  import { ORow, OCol, OCard, OTag, OIcon, OPagination } from "@opensig/opendesign";
3
3
  import { useScreen } from "@opendesign-plus/composables";
4
4
  import OEmpty from "../empty/OEmpty.vue.mjs";
@@ -11,14 +11,18 @@ const _hoisted_2 = {
11
11
  };
12
12
  const _hoisted_3 = { class: "article-content" };
13
13
  const _hoisted_4 = {
14
+ key: 0,
15
+ class: "item-tags"
16
+ };
17
+ const _hoisted_5 = {
14
18
  key: 1,
15
19
  class: "item-desc"
16
20
  };
17
- const _hoisted_5 = { class: "item-info" };
18
- const _hoisted_6 = { key: 0 };
19
- const _hoisted_7 = { key: 1 };
20
- const _hoisted_8 = { key: 2 };
21
- const _hoisted_9 = {
21
+ const _hoisted_6 = { class: "item-info" };
22
+ const _hoisted_7 = { key: 0 };
23
+ const _hoisted_8 = { key: 1 };
24
+ const _hoisted_9 = { key: 2 };
25
+ const _hoisted_10 = {
22
26
  key: 1,
23
27
  class: "article-pagination"
24
28
  };
@@ -107,39 +111,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
107
111
  href: item.href,
108
112
  layout: unref(lePadV) ? __props.mobileLayout : "v"
109
113
  }, createSlots({
110
- detail: withCtx(() => [
111
- item.tag ? (openBlock(), createBlock(unref(OTag), {
112
- key: 0,
113
- variant: "outline",
114
- class: normalizeClass(["item-type", !item.tag.label && "empty-tag"])
115
- }, createSlots({
116
- default: withCtx(() => [
117
- createElementVNode("span", null, toDisplayString(item.tag.label), 1)
118
- ]),
119
- _: 2
120
- }, [
121
- item.tag.icon ? {
122
- name: "icon",
123
- fn: withCtx(() => [
124
- createVNode(unref(OIcon), null, {
114
+ detail: withCtx(() => {
115
+ var _a;
116
+ return [
117
+ ((_a = item.tags) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_4, [
118
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.tags, (tag, idx) => {
119
+ return openBlock(), createBlock(unref(OTag), {
120
+ key: idx,
121
+ class: "item-tag",
122
+ color: tag.color,
123
+ variant: tag.variant ?? "outline",
124
+ size: tag.size,
125
+ round: tag.round
126
+ }, createSlots({
125
127
  default: withCtx(() => [
126
- (openBlock(), createBlock(resolveDynamicComponent(item.tag.icon)))
128
+ createElementVNode("span", null, toDisplayString(tag.label), 1)
127
129
  ]),
128
130
  _: 2
129
- }, 1024)
130
- ]),
131
- key: "0"
132
- } : void 0
133
- ]), 1032, ["class"])) : createCommentVNode("", true),
134
- item.description ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(item.description), 1)) : createCommentVNode("", true)
135
- ]),
131
+ }, [
132
+ tag.icon ? {
133
+ name: "icon",
134
+ fn: withCtx(() => [
135
+ createVNode(unref(OIcon), null, {
136
+ default: withCtx(() => [
137
+ (openBlock(), createBlock(resolveDynamicComponent(tag.icon)))
138
+ ]),
139
+ _: 2
140
+ }, 1024)
141
+ ]),
142
+ key: "0"
143
+ } : void 0
144
+ ]), 1032, ["color", "variant", "size", "round"]);
145
+ }), 128))
146
+ ])) : createCommentVNode("", true),
147
+ item.description ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(item.description), 1)) : createCommentVNode("", true)
148
+ ];
149
+ }),
136
150
  _: 2
137
151
  }, [
138
152
  item.date || item.author || item.location ? {
139
153
  name: "footer",
140
154
  fn: withCtx(() => [
141
- createElementVNode("div", _hoisted_5, [
142
- item.date ? (openBlock(), createElementBlock("span", _hoisted_6, [
155
+ createElementVNode("div", _hoisted_6, [
156
+ item.date ? (openBlock(), createElementBlock("span", _hoisted_7, [
143
157
  createVNode(unref(OIcon), null, {
144
158
  default: withCtx(() => [
145
159
  createVNode(unref(IconTime))
@@ -148,7 +162,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
148
162
  }),
149
163
  createTextVNode(" " + toDisplayString(item.date), 1)
150
164
  ])) : createCommentVNode("", true),
151
- item.author ? (openBlock(), createElementBlock("span", _hoisted_7, [
165
+ item.author ? (openBlock(), createElementBlock("span", _hoisted_8, [
152
166
  createVNode(unref(OIcon), null, {
153
167
  default: withCtx(() => [
154
168
  createVNode(unref(IconAvatar))
@@ -157,7 +171,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
157
171
  }),
158
172
  createTextVNode(" " + toDisplayString(authorText(item.author)), 1)
159
173
  ])) : createCommentVNode("", true),
160
- item.location ? (openBlock(), createElementBlock("span", _hoisted_8, [
174
+ item.location ? (openBlock(), createElementBlock("span", _hoisted_9, [
161
175
  createVNode(unref(OIcon), null, {
162
176
  default: withCtx(() => [
163
177
  createVNode(unref(IconAvatar))
@@ -185,7 +199,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
185
199
  }, null, 8, ["img"])
186
200
  ])
187
201
  ]),
188
- showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_9, [
202
+ showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_10, [
189
203
  createVNode(unref(OPagination), {
190
204
  page: current.value,
191
205
  simple: unref(lePadV),