@opendesign-plus-test/components 0.0.1-rc.297 → 0.0.1-rc.299
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/dist/components/article/types.d.ts +1 -0
- package/dist/components/community-updates/OCommunityUpdates.vue.d.ts +357 -2
- package/dist/components/community-updates/index.d.ts +178 -1
- package/dist/components/footer/OFooter.vue.d.ts +5 -1
- package/dist/components/footer/components/FooterList.vue.d.ts +5 -1
- package/dist/components/footer/components/FooterSimple.vue.d.ts +5 -1
- package/dist/components/footer/index.d.ts +13 -3
- package/dist/components/footer/types.d.ts +3 -1
- package/dist/components/html-viewer/utils.d.ts +1 -1
- package/dist/components.cjs.js +4 -4
- package/dist/components.css +1 -1
- package/dist/components.es.js +1535 -1478
- package/dist/treeshaking/assets/styles/element-plus.css +1 -0
- package/dist/treeshaking/components/activity/OActivityForm.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/activity/OActivityForm.vue_vue_type_style_index_1_lang.css +1 -0
- package/dist/treeshaking/components/activity/OActivityMyCalendar.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/activity/OActivityMyCalendar.vue_vue_type_style_index_1_lang.css +1 -0
- package/dist/treeshaking/components/article/OArticleList.vue_vue_type_script_setup_true_lang.mjs +12 -4
- package/dist/treeshaking/components/article/OArticleList.vue_vue_type_style_index_0_lang.css +7 -7
- package/dist/treeshaking/components/article/components/DocTitle.mjs +2 -2
- package/dist/treeshaking/components/article/components/DocTitle.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/treeshaking/components/article/components/{DocTitle.vue_vue_type_style_index_0_scoped_c5f974b8_lang.css → DocTitle.vue_vue_type_style_index_0_scoped_8fd87069_lang.css} +63 -67
- package/dist/treeshaking/components/article/types.d.ts +1 -0
- package/dist/treeshaking/components/community-updates/OCommunityUpdates.mjs +2 -2
- package/dist/treeshaking/components/community-updates/OCommunityUpdates.vue.d.ts +357 -2
- package/dist/treeshaking/components/community-updates/OCommunityUpdates.vue_vue_type_script_setup_true_lang.mjs +8 -1
- package/dist/treeshaking/components/community-updates/{OCommunityUpdates.vue_vue_type_style_index_0_scoped_b7cafb2f_lang.css → OCommunityUpdates.vue_vue_type_style_index_0_scoped_cdd7bf86_lang.css} +33 -32
- package/dist/treeshaking/components/community-updates/index.d.ts +178 -1
- package/dist/treeshaking/components/doc-layout/ODocLayout.mjs +2 -2
- package/dist/treeshaking/components/doc-layout/{ODocLayout.vue_vue_type_style_index_0_scoped_2b610e04_lang.css → ODocLayout.vue_vue_type_style_index_0_scoped_ea6414db_lang.css} +54 -54
- package/dist/treeshaking/components/element-plus/OElCookieNotice.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/element-plus/OElCookieNotice.vue_vue_type_style_index_1_scoped_5fa9f6f1_lang.css +1 -0
- package/dist/treeshaking/components/footer/OFooter.mjs +2 -2
- package/dist/treeshaking/components/footer/OFooter.vue.d.ts +5 -1
- package/dist/treeshaking/components/footer/OFooter.vue_vue_type_script_setup_true_lang.mjs +9 -3
- package/dist/treeshaking/components/footer/{OFooter.vue_vue_type_style_index_0_scoped_41010b1f_lang.css → OFooter.vue_vue_type_style_index_0_scoped_f0f4e884_lang.css} +13 -13
- package/dist/treeshaking/components/footer/components/FooterList.mjs +2 -2
- package/dist/treeshaking/components/footer/components/FooterList.vue.d.ts +5 -1
- package/dist/treeshaking/components/footer/components/FooterList.vue_vue_type_script_setup_true_lang.mjs +45 -25
- package/dist/treeshaking/components/footer/components/{FooterList.vue_vue_type_style_index_0_scoped_0ed4bc5f_lang.css → FooterList.vue_vue_type_style_index_0_scoped_6946816d_lang.css} +110 -106
- package/dist/treeshaking/components/footer/components/FooterSimple.mjs +2 -2
- package/dist/treeshaking/components/footer/components/FooterSimple.vue.d.ts +5 -1
- package/dist/treeshaking/components/footer/components/FooterSimple.vue_vue_type_script_setup_true_lang.mjs +28 -8
- package/dist/treeshaking/components/footer/components/{FooterSimple.vue_vue_type_style_index_0_scoped_42242446_lang.css → FooterSimple.vue_vue_type_style_index_0_scoped_1dd6e901_lang.css} +29 -25
- package/dist/treeshaking/components/footer/index.d.ts +13 -3
- package/dist/treeshaking/components/footer/types.d.ts +3 -1
- package/dist/treeshaking/components/html-viewer/OHtmlViewer.mjs +3 -2
- package/dist/treeshaking/components/html-viewer/OHtmlViewer.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/treeshaking/components/html-viewer/OHtmlViewer.vue_vue_type_style_index_0_scoped_36fc9311_lang.css +318 -0
- package/dist/treeshaking/components/html-viewer/OHtmlViewer.vue_vue_type_style_index_1_lang.css +20 -0
- package/dist/treeshaking/components/html-viewer/utils.d.ts +1 -1
- package/dist/treeshaking/components/html-viewer/utils.mjs +22 -3
- package/dist/treeshaking/components/meeting/OMeetingCalendar.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/meeting/OMeetingForm.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/meeting/OMeetingForm.vue_vue_type_style_index_1_lang.css +1 -0
- package/dist/treeshaking/components/meeting/OMeetingMyCalendar.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/meeting/OMeetingMyCalendar.vue_vue_type_style_index_1_lang.css +1 -0
- package/dist/treeshaking/components/meeting/components/OMeetingCalendarSelector.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/meeting/components/OMeetingCalendarSelector.vue_vue_type_style_index_1_lang.css +1 -0
- package/dist/treeshaking/components/meeting/components/OMeetingPlaybackSubtitles.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/meeting/components/OMeetingPlaybackSubtitles.vue_vue_type_style_index_1_lang.css +1 -0
- package/dist/treeshaking/components/sig/OSigList.vue_vue_type_style_index_0_lang.css +1 -0
- package/dist/treeshaking/components/user-center/internal/OUploadAvatar.vue_vue_type_style_index_0_scoped_7067a565_lang.css +1 -0
- package/dist/treeshaking/components/user-center/internal/OUploadAvatar.vue_vue_type_style_index_1_lang.css +1 -0
- package/package.json +1 -1
- package/dist/treeshaking/components/html-viewer/OHtmlViewer.vue_vue_type_style_index_0_scoped_2f5d08df_lang.css +0 -196
|
@@ -50,23 +50,42 @@ function scopeCss(css, scope) {
|
|
|
50
50
|
return result;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
+
* 中和 CSS 文本中的 `</style` 序列。
|
|
54
|
+
* `<style>` 是 raw-text 元素:CSS 中经由 v-html 在 SSR 原样输出时,内容若含 `</style`
|
|
55
|
+
* (含 `</style >` 等带空白变体)会提前闭合标签造成 HTML 逃逸;而样式提取正则只按
|
|
56
|
+
* 字面 `</style>` 截断,两者边界不一致。替换为 CSS unicode 转义 `\3c/style`,
|
|
57
|
+
* 在字符串/引号 url() 中语义等价(`\3c` 即 `<`),同时杜绝逃逸。
|
|
58
|
+
*/
|
|
59
|
+
function neutralizeStyleClose(css) {
|
|
60
|
+
return css.replace(/<\/style/gi, "\\3c/style");
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 移除 CSS 文本中的 font-size 声明。
|
|
64
|
+
* 文档自带字号为固定 px(如正文 16px),无法随断点/主题适配多分辨率;
|
|
65
|
+
* 移除后正文等元素的字号统一继承容器(容器取设计字号 token --o-font_size-*,响应式),
|
|
66
|
+
* 标题则落到组件排版规则(同样基于设计字号 token)。
|
|
67
|
+
*/
|
|
68
|
+
function stripFontSize(css) {
|
|
69
|
+
return css.replace(/(?<![-\w])font-size\s*:\s*[^;}]+;?/gi, "");
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
53
72
|
* 解析完整 HTML 文档:
|
|
54
73
|
* 1. 提取所有 `<style>` 块,将选择器限定在 scope 内后合并为 CSS 文本;
|
|
55
74
|
* 2. 提取 `<body>` 内容(无 body 标签时使用原文),并移除其中的 style 块;
|
|
56
|
-
* 3. 清理内联样式中的 color/background
|
|
75
|
+
* 3. 清理内联样式中的 color/background/font-size 声明,使文档跟随宿主主题与组件排版字号。
|
|
57
76
|
*
|
|
58
77
|
* 注意:`<style>` 是 head-only 元素,交给 DOMPurify 片段净化时会因被解析进 head 而丢失,
|
|
59
78
|
* 因此调用方需将返回的 CSS 单独渲染,不要与 body 一起传入净化指令。
|
|
60
79
|
*/
|
|
61
80
|
function parseHtml(text, scope) {
|
|
62
81
|
const styleParts = [];
|
|
63
|
-
for (const m of text.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)) styleParts.push(scopeCss(m[1], scope));
|
|
82
|
+
for (const m of text.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)) styleParts.push(scopeCss(neutralizeStyleClose(stripFontSize(m[1])), scope));
|
|
64
83
|
const bodyMatch = text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
|
|
65
84
|
let rawBody = bodyMatch ? bodyMatch[1] : text;
|
|
66
85
|
rawBody = rawBody.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, "");
|
|
67
86
|
return {
|
|
68
87
|
body: rawBody.replace(/style\s*=\s*"([^"]*)"/gi, (_m, val) => {
|
|
69
|
-
const cleaned = val.replace(/(?<![-\w])(?:color|background(?:-color)
|
|
88
|
+
const cleaned = val.replace(/(?<![-\w])(?:color|background(?:-color)?|font-size)\s*:\s*[^;]+;?/gi, "").replace(/\s{2,}/g, " ").trim();
|
|
70
89
|
return cleaned ? `style="${cleaned}"` : "";
|
|
71
90
|
}),
|
|
72
91
|
styleCss: styleParts.join("\n")
|
package/package.json
CHANGED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
.hover-icon-rotate .o-icon[data-v-2f5d08df] {
|
|
2
|
-
transition: all var(--o-duration-m1) var(--o-easing-standard-in);
|
|
3
|
-
}
|
|
4
|
-
@media (hover: hover) {
|
|
5
|
-
.hover-icon-rotate:hover .o-icon[data-v-2f5d08df] {
|
|
6
|
-
transform: rotate(-180deg);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
.o-html-viewer[data-v-2f5d08df] {
|
|
10
|
-
position: relative;
|
|
11
|
-
width: 100%;
|
|
12
|
-
}
|
|
13
|
-
.o-html-viewer__status[data-v-2f5d08df] {
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
justify-content: center;
|
|
17
|
-
min-height: 160px;
|
|
18
|
-
padding: 24px;
|
|
19
|
-
font-size: 14px;
|
|
20
|
-
line-height: 22px;
|
|
21
|
-
color: var(--o-color-info2);
|
|
22
|
-
}
|
|
23
|
-
.o-html-viewer__status.is-error[data-v-2f5d08df] {
|
|
24
|
-
color: var(--o-color-info3);
|
|
25
|
-
}
|
|
26
|
-
.o-html-viewer__body[data-v-2f5d08df] {
|
|
27
|
-
max-width: 1200px;
|
|
28
|
-
margin: 0 auto;
|
|
29
|
-
font-family: var(--doc-font-body, "SimSun", "宋体", "Times New Roman", serif);
|
|
30
|
-
font-size: var(--doc-base-size, 14px);
|
|
31
|
-
line-height: var(--doc-line-height, 1.8);
|
|
32
|
-
color: var(--o-color-info1);
|
|
33
|
-
overflow-x: hidden;
|
|
34
|
-
word-wrap: break-word;
|
|
35
|
-
overflow-wrap: break-word;
|
|
36
|
-
}
|
|
37
|
-
.o-html-viewer__body[data-v-2f5d08df] .title_content {
|
|
38
|
-
color: var(--o-color-info1);
|
|
39
|
-
}
|
|
40
|
-
.o-html-viewer__body[data-v-2f5d08df] .body_content {
|
|
41
|
-
padding: 0;
|
|
42
|
-
}
|
|
43
|
-
.o-html-viewer__body[data-v-2f5d08df] .ropa_base_information .content {
|
|
44
|
-
padding-left: 0;
|
|
45
|
-
}
|
|
46
|
-
.o-html-viewer__body[data-v-2f5d08df] .ropa_base_information .content ul, .o-html-viewer__body[data-v-2f5d08df] .ropa_base_information .content ol {
|
|
47
|
-
padding-left: 0;
|
|
48
|
-
}
|
|
49
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h1) {
|
|
50
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
51
|
-
font-size: 22px;
|
|
52
|
-
font-weight: bold;
|
|
53
|
-
text-align: center;
|
|
54
|
-
margin: 2.5rem 0 2rem;
|
|
55
|
-
padding-bottom: 0.6rem;
|
|
56
|
-
border-bottom: 2px solid var(--o-color-primary1);
|
|
57
|
-
line-height: 1.4;
|
|
58
|
-
}
|
|
59
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h2) {
|
|
60
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
61
|
-
font-size: 18px;
|
|
62
|
-
font-weight: bold;
|
|
63
|
-
color: var(--o-color-primary1);
|
|
64
|
-
padding-bottom: 0.3rem;
|
|
65
|
-
line-height: 1.4;
|
|
66
|
-
}
|
|
67
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h3) {
|
|
68
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
69
|
-
font-size: 16px;
|
|
70
|
-
font-weight: bold;
|
|
71
|
-
color: var(--o-color-info1);
|
|
72
|
-
margin: 1.8rem 0 0.8rem;
|
|
73
|
-
line-height: 1.5;
|
|
74
|
-
}
|
|
75
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h4) {
|
|
76
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
77
|
-
font-size: 15px;
|
|
78
|
-
font-weight: bold;
|
|
79
|
-
color: var(--o-color-info1);
|
|
80
|
-
margin: 1.5rem 0 0.6rem;
|
|
81
|
-
line-height: 1.5;
|
|
82
|
-
}
|
|
83
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h5) {
|
|
84
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
85
|
-
font-size: 14px;
|
|
86
|
-
font-weight: bold;
|
|
87
|
-
color: var(--o-color-info1);
|
|
88
|
-
margin: 1.2rem 0 0.5rem;
|
|
89
|
-
line-height: 1.5;
|
|
90
|
-
}
|
|
91
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h6) {
|
|
92
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
93
|
-
font-size: 14px;
|
|
94
|
-
font-weight: bold;
|
|
95
|
-
color: var(--o-color-info2);
|
|
96
|
-
margin: 1rem 0 0.4rem;
|
|
97
|
-
line-height: 1.5;
|
|
98
|
-
}
|
|
99
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(p) {
|
|
100
|
-
margin: 0.4rem 0;
|
|
101
|
-
text-align: justify;
|
|
102
|
-
}
|
|
103
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(a) {
|
|
104
|
-
color: var(--o-color-primary1);
|
|
105
|
-
}
|
|
106
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p) {
|
|
107
|
-
text-indent: 0;
|
|
108
|
-
}
|
|
109
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(.table-wrap) {
|
|
110
|
-
overflow-x: auto;
|
|
111
|
-
margin: 1rem 0;
|
|
112
|
-
-webkit-overflow-scrolling: touch;
|
|
113
|
-
}
|
|
114
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(table) {
|
|
115
|
-
border-collapse: collapse;
|
|
116
|
-
width: 100%;
|
|
117
|
-
font-size: 13px;
|
|
118
|
-
}
|
|
119
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(th, td) {
|
|
120
|
-
border: 1px solid var(--o-color-control1);
|
|
121
|
-
padding: 6px 10px;
|
|
122
|
-
text-align: left;
|
|
123
|
-
vertical-align: top;
|
|
124
|
-
}
|
|
125
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(th) {
|
|
126
|
-
background-color: var(--o-color-fill2);
|
|
127
|
-
font-family: var(--doc-font-heading, "SimHei", "黑体", "Arial", sans-serif);
|
|
128
|
-
font-weight: bold;
|
|
129
|
-
text-align: center;
|
|
130
|
-
}
|
|
131
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(tr:nth-child(even)) {
|
|
132
|
-
background-color: var(--o-color-fill3);
|
|
133
|
-
}
|
|
134
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(td p, th p) {
|
|
135
|
-
text-indent: 0;
|
|
136
|
-
margin: 0.2rem 0;
|
|
137
|
-
}
|
|
138
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(ul, ol) {
|
|
139
|
-
padding-left: 2em;
|
|
140
|
-
margin: 0.5rem 0;
|
|
141
|
-
}
|
|
142
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(li) {
|
|
143
|
-
margin-bottom: 0.3rem;
|
|
144
|
-
}
|
|
145
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(li p) {
|
|
146
|
-
text-indent: 0;
|
|
147
|
-
}
|
|
148
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(img) {
|
|
149
|
-
max-width: 100%;
|
|
150
|
-
height: auto;
|
|
151
|
-
display: block;
|
|
152
|
-
margin: 1rem auto;
|
|
153
|
-
}
|
|
154
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(code) {
|
|
155
|
-
font-family: var(--doc-font-mono, "Consolas", "Courier New", monospace);
|
|
156
|
-
background: var(--o-color-fill3);
|
|
157
|
-
padding: 1px 4px;
|
|
158
|
-
border-radius: 2px;
|
|
159
|
-
font-size: 0.9em;
|
|
160
|
-
}
|
|
161
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(pre) {
|
|
162
|
-
font-family: var(--doc-font-mono, "Consolas", "Courier New", monospace);
|
|
163
|
-
background: var(--o-color-fill3);
|
|
164
|
-
padding: 12px 16px;
|
|
165
|
-
border-radius: 4px;
|
|
166
|
-
overflow-x: auto;
|
|
167
|
-
font-size: 13px;
|
|
168
|
-
line-height: 1.5;
|
|
169
|
-
margin: 0.8rem 0;
|
|
170
|
-
max-width: 100%;
|
|
171
|
-
-webkit-overflow-scrolling: touch;
|
|
172
|
-
}
|
|
173
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(pre code) {
|
|
174
|
-
background: none;
|
|
175
|
-
padding: 0;
|
|
176
|
-
}
|
|
177
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(blockquote) {
|
|
178
|
-
border-left: 3px solid var(--o-color-primary1);
|
|
179
|
-
margin: 0.8rem 0;
|
|
180
|
-
padding: 0.5rem 1rem;
|
|
181
|
-
color: var(--o-color-info2);
|
|
182
|
-
background: var(--o-color-fill2);
|
|
183
|
-
}
|
|
184
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(blockquote p) {
|
|
185
|
-
text-indent: 0;
|
|
186
|
-
}
|
|
187
|
-
.o-html-viewer__body[data-v-2f5d08df] :where(hr) {
|
|
188
|
-
border: none;
|
|
189
|
-
border-top: 1px solid var(--o-color-control4);
|
|
190
|
-
margin: 1.5rem 0;
|
|
191
|
-
}
|
|
192
|
-
@media (max-width: 840px) {
|
|
193
|
-
.o-html-viewer__body[data-v-2f5d08df] {
|
|
194
|
-
padding: 24px 16px;
|
|
195
|
-
}
|
|
196
|
-
}
|