@opendesign-plus-test/components 0.0.1-rc.257 → 0.0.1-rc.259

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.
@@ -1,6 +1,7 @@
1
1
  import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.mjs";
2
2
  import OHtmlViewer_vue_vue_type_script_setup_true_lang_default from "./OHtmlViewer.vue_vue_type_script_setup_true_lang.mjs";
3
- import './OHtmlViewer.vue_vue_type_style_index_0_scoped_a5f9ec0d_lang.css';
3
+ import './OHtmlViewer.vue_vue_type_style_index_0_scoped_558959bd_lang.css';
4
+ import './OHtmlViewer.vue_vue_type_style_index_1_lang.css';
4
5
  // src/components/html-viewer/OHtmlViewer.vue
5
- var OHtmlViewer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(OHtmlViewer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a5f9ec0d"]]);
6
+ var OHtmlViewer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(OHtmlViewer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-558959bd"]]);
6
7
  export { OHtmlViewer_default as default };
@@ -74,8 +74,8 @@ var OHtmlViewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
74
74
  return (_ctx, _cache) => {
75
75
  return openBlock(), createElementBlock("div", _hoisted_1, [docStyle.value ? (openBlock(), createBlock(resolveDynamicComponent("style"), {
76
76
  key: 0,
77
- textContent: docStyle.value
78
- }, null, 8, ["textContent"])) : createCommentVNode("", true), resolvedBody.value ? withDirectives((openBlock(), createElementBlock("div", {
77
+ innerHTML: docStyle.value
78
+ }, null, 8, ["innerHTML"])) : createCommentVNode("", true), resolvedBody.value ? withDirectives((openBlock(), createElementBlock("div", {
79
79
  key: 1,
80
80
  class: "o-html-viewer__body",
81
81
  role: "document",
@@ -1,16 +1,16 @@
1
- .hover-icon-rotate .o-icon[data-v-a5f9ec0d] {
1
+ .hover-icon-rotate .o-icon[data-v-558959bd] {
2
2
  transition: all var(--o-duration-m1) var(--o-easing-standard-in);
3
3
  }
4
4
  @media (hover: hover) {
5
- .hover-icon-rotate:hover .o-icon[data-v-a5f9ec0d] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-558959bd] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-html-viewer[data-v-a5f9ec0d] {
9
+ .o-html-viewer[data-v-558959bd] {
10
10
  position: relative;
11
11
  width: 100%;
12
12
  }
13
- .o-html-viewer__status[data-v-a5f9ec0d] {
13
+ .o-html-viewer__status[data-v-558959bd] {
14
14
  display: flex;
15
15
  align-items: center;
16
16
  justify-content: center;
@@ -20,13 +20,12 @@
20
20
  line-height: 22px;
21
21
  color: var(--o-color-info2);
22
22
  }
23
- .o-html-viewer__status.is-error[data-v-a5f9ec0d] {
23
+ .o-html-viewer__status.is-error[data-v-558959bd] {
24
24
  color: var(--o-color-info3);
25
25
  }
26
- .o-html-viewer__body[data-v-a5f9ec0d] {
27
- max-width: 1200px;
26
+ .o-html-viewer__body[data-v-558959bd] {
27
+ max-width: 880px;
28
28
  margin: 0 auto;
29
- font-family: var(--doc-font-body, "SimSun", "宋体", "Times New Roman", serif);
30
29
  font-size: var(--doc-base-size, 14px);
31
30
  line-height: var(--doc-line-height, 1.8);
32
31
  color: var(--o-color-info1);
@@ -34,159 +33,157 @@
34
33
  word-wrap: break-word;
35
34
  overflow-wrap: break-word;
36
35
  }
37
- .o-html-viewer__body[data-v-a5f9ec0d] .title_content {
36
+ .o-html-viewer__body[data-v-558959bd] .title_content {
38
37
  color: var(--o-color-info1);
39
38
  margin-bottom: 1rem;
40
39
  }
41
- .o-html-viewer__body[data-v-a5f9ec0d] .body_content {
40
+ .o-html-viewer__body[data-v-558959bd] .body_content {
42
41
  padding: 0;
43
42
  }
44
- .o-html-viewer__body[data-v-a5f9ec0d] [style*='font-family' i] {
43
+ .o-html-viewer__body[data-v-558959bd] [style*='font-family' i] {
45
44
  font-family: inherit !important;
46
45
  }
47
- .o-html-viewer__body[data-v-a5f9ec0d] .ropa_base_information .content {
46
+ .o-html-viewer__body[data-v-558959bd] .ropa_base_information .content {
48
47
  padding-left: 0;
49
48
  }
50
- .o-html-viewer__body[data-v-a5f9ec0d] .ropa_base_information .content ul, .o-html-viewer__body[data-v-a5f9ec0d] .ropa_base_information .content ol {
49
+ .o-html-viewer__body[data-v-558959bd] .ropa_base_information .content ul, .o-html-viewer__body[data-v-558959bd] .ropa_base_information .content ol {
51
50
  padding-left: 0;
52
51
  }
53
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1) {
52
+ .o-html-viewer__body[data-v-558959bd] :where(h1),
53
+ .o-html-viewer__body[data-v-558959bd] .title_content {
54
54
  font-weight: bold;
55
55
  text-align: center;
56
- margin: 2.5rem 0 2rem;
57
- padding-bottom: 0.6rem;
58
- border-bottom: 2px solid var(--o-color-primary1);
59
- }
60
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1),
61
- .o-html-viewer__body[data-v-a5f9ec0d] .title_content {
56
+ margin: 2.5rem 0 var(--doc-title-border-bottom-gap, 40px);
57
+ padding-bottom: var(--doc-title-border-top-gap, 40px);
58
+ border-bottom: 1px solid var(--o-color-control4);
62
59
  font-size: var(--doc-title-size, 32px);
63
60
  line-height: 44px;
64
61
  }
65
62
  @media (min-width: 1201px) and (max-width: 1680px) {
66
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1),
67
- .o-html-viewer__body[data-v-a5f9ec0d] .title_content {
63
+ .o-html-viewer__body[data-v-558959bd] :where(h1),
64
+ .o-html-viewer__body[data-v-558959bd] .title_content {
68
65
  font-size: 20px;
69
66
  line-height: 28px;
70
67
  }
71
68
  }
72
69
  @media (min-width: 841px) and (max-width: 1200px) {
73
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1),
74
- .o-html-viewer__body[data-v-a5f9ec0d] .title_content {
70
+ .o-html-viewer__body[data-v-558959bd] :where(h1),
71
+ .o-html-viewer__body[data-v-558959bd] .title_content {
75
72
  font-size: 20px;
76
73
  line-height: 28px;
77
74
  }
78
75
  }
79
76
  @media (min-width: 601px) and (max-width: 840px) {
80
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1),
81
- .o-html-viewer__body[data-v-a5f9ec0d] .title_content {
77
+ .o-html-viewer__body[data-v-558959bd] :where(h1),
78
+ .o-html-viewer__body[data-v-558959bd] .title_content {
82
79
  font-size: 18px;
83
80
  line-height: 26px;
84
81
  }
85
82
  }
86
83
  @media (max-width: 600px) {
87
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1),
88
- .o-html-viewer__body[data-v-a5f9ec0d] .title_content {
84
+ .o-html-viewer__body[data-v-558959bd] :where(h1),
85
+ .o-html-viewer__body[data-v-558959bd] .title_content {
89
86
  font-size: 16px;
90
87
  line-height: 24px;
91
88
  }
92
89
  }
93
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h2) {
90
+ .o-html-viewer__body[data-v-558959bd] :where(h2) {
94
91
  font-size: 18px;
95
92
  font-weight: bold;
96
93
  color: var(--o-color-primary1);
97
94
  padding-bottom: 0.3rem;
98
95
  line-height: 1.4;
99
96
  }
100
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h3) {
97
+ .o-html-viewer__body[data-v-558959bd] :where(h3) {
101
98
  font-size: 16px;
102
99
  font-weight: bold;
103
100
  color: var(--o-color-info1);
104
101
  margin: 1.8rem 0 0.8rem;
105
102
  line-height: 1.5;
106
103
  }
107
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h4) {
104
+ .o-html-viewer__body[data-v-558959bd] :where(h4) {
108
105
  font-size: 15px;
109
106
  font-weight: bold;
110
107
  color: var(--o-color-info1);
111
108
  margin: 1.5rem 0 0.6rem;
112
109
  line-height: 1.5;
113
110
  }
114
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h5) {
111
+ .o-html-viewer__body[data-v-558959bd] :where(h5) {
115
112
  font-size: 14px;
116
113
  font-weight: bold;
117
114
  color: var(--o-color-info1);
118
115
  margin: 1.2rem 0 0.5rem;
119
116
  line-height: 1.5;
120
117
  }
121
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h6) {
118
+ .o-html-viewer__body[data-v-558959bd] :where(h6) {
122
119
  font-size: 14px;
123
120
  font-weight: bold;
124
121
  color: var(--o-color-info2);
125
122
  margin: 1rem 0 0.4rem;
126
123
  line-height: 1.5;
127
124
  }
128
- .o-html-viewer__body[data-v-a5f9ec0d] :where(p) {
125
+ .o-html-viewer__body[data-v-558959bd] :where(p) {
129
126
  margin: 0.4rem 0;
130
127
  text-align: justify;
131
128
  }
132
- .o-html-viewer__body[data-v-a5f9ec0d] :where(a) {
129
+ .o-html-viewer__body[data-v-558959bd] :where(a) {
133
130
  color: var(--o-color-primary1);
134
131
  }
135
- .o-html-viewer__body[data-v-a5f9ec0d] :where(h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p) {
132
+ .o-html-viewer__body[data-v-558959bd] :where(h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p) {
136
133
  text-indent: 0;
137
134
  }
138
- .o-html-viewer__body[data-v-a5f9ec0d] :where(.table-wrap) {
135
+ .o-html-viewer__body[data-v-558959bd] :where(.table-wrap) {
139
136
  overflow-x: auto;
140
137
  margin: 1rem 0;
141
138
  -webkit-overflow-scrolling: touch;
142
139
  }
143
- .o-html-viewer__body[data-v-a5f9ec0d] :where(table) {
140
+ .o-html-viewer__body[data-v-558959bd] :where(table) {
144
141
  border-collapse: collapse;
145
142
  width: 100%;
146
143
  font-size: 13px;
147
144
  }
148
- .o-html-viewer__body[data-v-a5f9ec0d] :where(th, td) {
145
+ .o-html-viewer__body[data-v-558959bd] :where(th, td) {
149
146
  border: 1px solid var(--o-color-control1);
150
147
  padding: 6px 10px;
151
148
  text-align: left;
152
149
  vertical-align: top;
153
150
  }
154
- .o-html-viewer__body[data-v-a5f9ec0d] :where(th) {
151
+ .o-html-viewer__body[data-v-558959bd] :where(th) {
155
152
  background-color: var(--o-color-fill2);
156
153
  font-weight: bold;
157
154
  text-align: center;
158
155
  }
159
- .o-html-viewer__body[data-v-a5f9ec0d] :where(tr:nth-child(even)) {
156
+ .o-html-viewer__body[data-v-558959bd] :where(tr:nth-child(even)) {
160
157
  background-color: var(--o-color-fill3);
161
158
  }
162
- .o-html-viewer__body[data-v-a5f9ec0d] :where(td p, th p) {
159
+ .o-html-viewer__body[data-v-558959bd] :where(td p, th p) {
163
160
  text-indent: 0;
164
161
  margin: 0.2rem 0;
165
162
  }
166
- .o-html-viewer__body[data-v-a5f9ec0d] :where(ul, ol) {
163
+ .o-html-viewer__body[data-v-558959bd] :where(ul, ol) {
167
164
  padding-left: 2em;
168
165
  margin: 0.5rem 0;
169
166
  }
170
- .o-html-viewer__body[data-v-a5f9ec0d] :where(li) {
167
+ .o-html-viewer__body[data-v-558959bd] :where(li) {
171
168
  margin-bottom: 0.3rem;
172
169
  }
173
- .o-html-viewer__body[data-v-a5f9ec0d] :where(li p) {
170
+ .o-html-viewer__body[data-v-558959bd] :where(li p) {
174
171
  text-indent: 0;
175
172
  }
176
- .o-html-viewer__body[data-v-a5f9ec0d] :where(img) {
173
+ .o-html-viewer__body[data-v-558959bd] :where(img) {
177
174
  max-width: 100%;
178
175
  height: auto;
179
176
  display: block;
180
177
  margin: 1rem auto;
181
178
  }
182
- .o-html-viewer__body[data-v-a5f9ec0d] :where(code) {
179
+ .o-html-viewer__body[data-v-558959bd] :where(code) {
183
180
  font-family: var(--doc-font-mono, "Consolas", "Courier New", monospace) !important;
184
181
  background: var(--o-color-fill3);
185
182
  padding: 1px 4px;
186
183
  border-radius: 2px;
187
184
  font-size: 0.9em;
188
185
  }
189
- .o-html-viewer__body[data-v-a5f9ec0d] :where(pre) {
186
+ .o-html-viewer__body[data-v-558959bd] :where(pre) {
190
187
  font-family: var(--doc-font-mono, "Consolas", "Courier New", monospace) !important;
191
188
  background: var(--o-color-fill3);
192
189
  padding: 12px 16px;
@@ -198,27 +195,27 @@
198
195
  max-width: 100%;
199
196
  -webkit-overflow-scrolling: touch;
200
197
  }
201
- .o-html-viewer__body[data-v-a5f9ec0d] :where(pre code) {
198
+ .o-html-viewer__body[data-v-558959bd] :where(pre code) {
202
199
  background: none;
203
200
  padding: 0;
204
201
  }
205
- .o-html-viewer__body[data-v-a5f9ec0d] :where(blockquote) {
202
+ .o-html-viewer__body[data-v-558959bd] :where(blockquote) {
206
203
  border-left: 3px solid var(--o-color-primary1);
207
204
  margin: 0.8rem 0;
208
205
  padding: 0.5rem 1rem;
209
206
  color: var(--o-color-info2);
210
207
  background: var(--o-color-fill2);
211
208
  }
212
- .o-html-viewer__body[data-v-a5f9ec0d] :where(blockquote p) {
209
+ .o-html-viewer__body[data-v-558959bd] :where(blockquote p) {
213
210
  text-indent: 0;
214
211
  }
215
- .o-html-viewer__body[data-v-a5f9ec0d] :where(hr) {
212
+ .o-html-viewer__body[data-v-558959bd] :where(hr) {
216
213
  border: none;
217
214
  border-top: 1px solid var(--o-color-control4);
218
215
  margin: 1.5rem 0;
219
216
  }
220
217
  @media (max-width: 840px) {
221
- .o-html-viewer__body[data-v-a5f9ec0d] {
218
+ .o-html-viewer__body[data-v-558959bd] {
222
219
  padding: 24px 16px;
223
220
  }
224
221
  }
@@ -0,0 +1,20 @@
1
+ .hover-icon-rotate .o-icon {
2
+ transition: all var(--o-duration-m1) var(--o-easing-standard-in);
3
+ }
4
+ @media (hover: hover) {
5
+ .hover-icon-rotate:hover .o-icon {
6
+ transform: rotate(-180deg);
7
+ }
8
+ }
9
+
10
+ /*
11
+ * 文档基础字体(非 scoped):
12
+ * scoped 规则会附带 [data-v] 属性选择器,优先级 (0,2,0) 恒高于文档自带样式(如 `*`/`body` 选择器
13
+ * 经 scope 限定后为 (0,1,0)),导致容器字体压过文档字体,继承链(内联 font-family 被强制继承的元素)
14
+ * 与文档 * 规则直接命中的元素(如 strong)字体不一致。
15
+ * 此处用普通 (0,1,0) 声明:文档自带字体声明与之同优先级且在 DOM 中更靠后,总能覆盖它;
16
+ * 文档未声明字体时回退到 --doc-font-body,保证全文(含加粗、标题)字体统一。
17
+ */
18
+ .o-html-viewer__body {
19
+ font-family: var(--doc-font-body, "SimSun", "宋体", "Times New Roman", serif);
20
+ }
@@ -50,6 +50,16 @@ 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
+ /**
53
63
  * 解析完整 HTML 文档:
54
64
  * 1. 提取所有 `<style>` 块,将选择器限定在 scope 内后合并为 CSS 文本;
55
65
  * 2. 提取 `<body>` 内容(无 body 标签时使用原文),并移除其中的 style 块;
@@ -60,7 +70,7 @@ function scopeCss(css, scope) {
60
70
  */
61
71
  function parseHtml(text, scope) {
62
72
  const styleParts = [];
63
- for (const m of text.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)) styleParts.push(scopeCss(m[1], scope));
73
+ for (const m of text.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)) styleParts.push(scopeCss(neutralizeStyleClose(m[1]), scope));
64
74
  const bodyMatch = text.match(/<body[^>]*>([\s\S]*?)<\/body>/i);
65
75
  let rawBody = bodyMatch ? bodyMatch[1] : text;
66
76
  rawBody = rawBody.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendesign-plus-test/components",
3
- "version": "0.0.1-rc.257",
3
+ "version": "0.0.1-rc.259",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",