@opendesign-plus/components 0.0.1-rc.100 → 0.0.1-rc.102

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 (59) hide show
  1. package/dist/chunk-element-plus.cjs.js +1 -1
  2. package/dist/chunk-element-plus.es.js +4 -0
  3. package/dist/components/article-anchor/OArticleAnchor.vue.d.ts +138 -1
  4. package/dist/components/article-anchor/index.d.ts +157 -5
  5. package/dist/components/article-anchor/types.d.ts +10 -2
  6. package/dist/components/doc-layout/ODocLayout.vue.d.ts +368 -6
  7. package/dist/components/doc-layout/index.d.ts +200 -10
  8. package/dist/components/summit/OSummit.vue.d.ts +14 -1
  9. package/dist/components/summit/OSummitSchedule.vue.d.ts +9 -1
  10. package/dist/components/summit/index.d.ts +7 -3
  11. package/dist/components/summit/types.d.ts +8 -1
  12. package/dist/components/summit/utils.d.ts +2 -1
  13. package/dist/components.cjs.js +4 -4
  14. package/dist/components.css +1 -1
  15. package/dist/components.es.js +2022 -1899
  16. package/dist/treeshaking/_virtual/~icons/components/icon-address.mjs +21 -0
  17. package/dist/treeshaking/components/article/components/DocTitle.mjs +2 -2
  18. package/dist/treeshaking/components/article/components/DocTitle.vue_vue_type_script_setup_true_lang.mjs +25 -20
  19. package/dist/treeshaking/components/article/components/{DocTitle.vue_vue_type_style_index_0_scoped_ea84d56c_lang.css → DocTitle.vue_vue_type_style_index_0_scoped_12467c9f_lang.css} +52 -49
  20. package/dist/treeshaking/components/article-anchor/OArticleAnchor.mjs +2 -2
  21. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue.d.ts +138 -1
  22. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue_vue_type_script_setup_true_lang.mjs +70 -5
  23. package/dist/treeshaking/components/article-anchor/{OArticleAnchor.vue_vue_type_style_index_0_scoped_6e032ecb_lang.css → OArticleAnchor.vue_vue_type_style_index_0_scoped_dcc5e0d5_lang.css} +4 -4
  24. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorItems.mjs +2 -2
  25. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorItems.vue_vue_type_script_setup_true_lang.mjs +8 -3
  26. package/dist/treeshaking/components/article-anchor/components/{ArticleAnchorItems.vue_vue_type_style_index_0_scoped_c0fc5e57_lang.css → ArticleAnchorItems.vue_vue_type_style_index_0_scoped_126e1824_lang.css} +3 -3
  27. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorMobile.mjs +2 -2
  28. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorMobile.vue_vue_type_script_setup_true_lang.mjs +14 -12
  29. package/dist/treeshaking/components/article-anchor/components/{ArticleAnchorMobile.vue_vue_type_style_index_0_scoped_648619c2_lang.css → ArticleAnchorMobile.vue_vue_type_style_index_0_scoped_ccc0d33c_lang.css} +11 -11
  30. package/dist/treeshaking/components/article-anchor/index.d.ts +157 -5
  31. package/dist/treeshaking/components/article-anchor/types.d.ts +10 -2
  32. package/dist/treeshaking/components/article-pagination/OArticlePagination.mjs +2 -2
  33. package/dist/treeshaking/components/article-pagination/{OArticlePagination.vue_vue_type_style_index_0_scoped_e78e8bd3_lang.css → OArticlePagination.vue_vue_type_style_index_0_scoped_8a8cf9f8_lang.css} +42 -50
  34. package/dist/treeshaking/components/doc-layout/ODocLayout.mjs +2 -2
  35. package/dist/treeshaking/components/doc-layout/ODocLayout.vue.d.ts +368 -6
  36. package/dist/treeshaking/components/doc-layout/ODocLayout.vue_vue_type_script_setup_true_lang.mjs +45 -27
  37. package/dist/treeshaking/components/doc-layout/{ODocLayout.vue_vue_type_style_index_0_scoped_6510bed3_lang.css → ODocLayout.vue_vue_type_style_index_0_scoped_966cd0b4_lang.css} +56 -41
  38. package/dist/treeshaking/components/doc-layout/index.d.ts +200 -10
  39. package/dist/treeshaking/components/markdown/OMarkdown.mjs +2 -2
  40. package/dist/treeshaking/components/markdown/OMarkdown.vue_vue_type_script_setup_true_lang.mjs +1 -1
  41. package/dist/treeshaking/components/markdown/{OMarkdown.vue_vue_type_style_index_1_scoped_4be4e234_lang.css → OMarkdown.vue_vue_type_style_index_1_scoped_c19788db_lang.css} +3 -3
  42. package/dist/treeshaking/components/summit/OSummit.mjs +2 -2
  43. package/dist/treeshaking/components/summit/OSummit.vue.d.ts +14 -1
  44. package/dist/treeshaking/components/summit/OSummit.vue_vue_type_script_setup_true_lang.mjs +15 -4
  45. package/dist/treeshaking/components/summit/{OSummit.vue_vue_type_style_index_0_scoped_83d1b7cb_lang.css → OSummit.vue_vue_type_style_index_0_scoped_6e15ff06_lang.css} +3 -3
  46. package/dist/treeshaking/components/summit/OSummitLive.mjs +2 -2
  47. package/dist/treeshaking/components/summit/OSummitLive.vue_vue_type_script_setup_true_lang.mjs +4 -4
  48. package/dist/treeshaking/components/summit/{OSummitLive.vue_vue_type_style_index_0_scoped_ceb9b04d_lang.css → OSummitLive.vue_vue_type_style_index_0_scoped_634db517_lang.css} +26 -26
  49. package/dist/treeshaking/components/summit/OSummitSchedule.mjs +2 -2
  50. package/dist/treeshaking/components/summit/OSummitSchedule.vue.d.ts +9 -1
  51. package/dist/treeshaking/components/summit/OSummitSchedule.vue_vue_type_script_setup_true_lang.mjs +72 -35
  52. package/dist/treeshaking/components/summit/{OSummitSchedule.vue_vue_type_style_index_0_scoped_b3bf869b_lang.css → OSummitSchedule.vue_vue_type_style_index_0_scoped_934d2319_lang.css} +60 -33
  53. package/dist/treeshaking/components/summit/index.d.ts +7 -3
  54. package/dist/treeshaking/components/summit/types.d.ts +8 -1
  55. package/dist/treeshaking/components/summit/utils.d.ts +2 -1
  56. package/dist/treeshaking/components/summit/utils.mjs +5 -2
  57. package/dist/treeshaking/i18n/en.mjs +2 -0
  58. package/dist/treeshaking/i18n/zh.mjs +2 -0
  59. package/package.json +1 -1
@@ -31,13 +31,21 @@ var OArticleAnchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
31
31
  type: Boolean,
32
32
  default: true
33
33
  },
34
+ idPrefix: { default: "" },
34
35
  container: {},
35
36
  targetOffset: {},
37
+ bounds: { default: 5 },
38
+ changeHash: {
39
+ type: Boolean,
40
+ default: true
41
+ },
36
42
  radius: { default: "var(--o-radius-xs)" }
37
43
  },
38
- setup(__props, { expose: __expose }) {
44
+ emits: ["change", "click"],
45
+ setup(__props, { expose: __expose, emit: __emit }) {
39
46
  const props = __props;
40
47
  const { t } = useI18n();
48
+ const emit = __emit;
41
49
  const autoItems = ref([]);
42
50
  const items = computed(() => props.items.length ? props.items : autoItems.value);
43
51
  const titleText = computed(() => props.title || t("articleAnchor.title"));
@@ -48,12 +56,48 @@ var OArticleAnchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
48
56
  watch([() => props.size, expanded], () => {
49
57
  document.body.style.overflow = props.size === "mobile" && expanded.value ? "hidden" : "";
50
58
  });
51
- const onAnchorClick = () => {
59
+ const onAnchorClick = (ev, link) => {
60
+ emit("click", ev, link);
52
61
  if (props.size === "pad") expanded.value = false;
53
62
  };
63
+ const onAnchorChange = (link) => {
64
+ emit("change", link);
65
+ };
66
+ /** hash 别名映射:href 为展示地址(如 #a),observeHref 为实际目标(如 #user-content-a) */
67
+ const hrefAliasMap = computed(() => {
68
+ const map = /* @__PURE__ */ new Map();
69
+ const walk = (list) => {
70
+ list.forEach((item) => {
71
+ if (item.observeHref && item.observeHref !== item.href) map.set(item.href, item.observeHref);
72
+ if (item.children?.length) walk(item.children);
73
+ });
74
+ };
75
+ walk(items.value);
76
+ return map;
77
+ });
78
+ const jumpFromHash = (hash) => {
79
+ const link = (anchorRef.value?.$el)?.querySelector(`a[href="${CSS.escape(hash)}"]`);
80
+ if (link) {
81
+ link.click();
82
+ return;
83
+ }
84
+ const observeHref = hrefAliasMap.value.get(hash);
85
+ const el = observeHref && document.getElementById(observeHref.replace(/^#/, ""));
86
+ if (!el) return;
87
+ const container = typeof props.container === "string" ? document.querySelector(props.container) || window : props.container || window;
88
+ const offsetTop = el.getBoundingClientRect().top - (container === window ? document.documentElement.clientTop : container.getBoundingClientRect().top);
89
+ const y = (container === window ? window.scrollY : container.scrollTop) + offsetTop - (props.targetOffset ?? 0);
90
+ if (container === window) window.scrollTo({ top: y });
91
+ else container.scrollTo({ top: y });
92
+ };
93
+ const onHashChange = () => {
94
+ if (!window.location.hash) return;
95
+ jumpFromHash(decodeURIComponent(window.location.hash));
96
+ };
54
97
  const pcSlotRef = ref();
55
98
  const padSlotRef = ref();
56
99
  const hiddenSlotRef = ref();
100
+ const anchorRef = ref();
57
101
  const teleportTarget = computed(() => {
58
102
  if (props.size === "pc") return pcSlotRef.value;
59
103
  if (props.size === "pad" && expanded.value) return padSlotRef.value;
@@ -96,9 +140,16 @@ var OArticleAnchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
96
140
  if (props.writeId) elH.id = id;
97
141
  }
98
142
  seen.add(id);
143
+ let href = `#${id}`;
144
+ let observeHref;
145
+ if (props.idPrefix && id.startsWith(props.idPrefix) && id.length > props.idPrefix.length) {
146
+ href = `#${id.slice(props.idPrefix.length)}`;
147
+ observeHref = `#${id}`;
148
+ }
99
149
  const item = {
100
- id,
150
+ href,
101
151
  title: (elH.textContent || "").trim(),
152
+ observeHref,
102
153
  children: []
103
154
  };
104
155
  while (stack.length > 1 && stack[stack.length - 1].level >= level) stack.pop();
@@ -142,15 +193,19 @@ var OArticleAnchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
142
193
  onMounted(() => {
143
194
  collect();
144
195
  ensureObserver();
196
+ onHashChange();
197
+ window.addEventListener("hashchange", onHashChange);
145
198
  });
146
199
  onBeforeUnmount(() => {
147
200
  teardownObserver();
148
201
  document.body.style.overflow = "";
202
+ window.removeEventListener("hashchange", onHashChange);
149
203
  });
150
204
  watch(() => [
151
205
  props.selector,
152
206
  props.autoExtract,
153
- props.maxLevel
207
+ props.maxLevel,
208
+ props.idPrefix
154
209
  ], () => {
155
210
  teardownObserver();
156
211
  collect();
@@ -225,15 +280,25 @@ var OArticleAnchor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
225
280
  to: teleportTarget.value,
226
281
  disabled: !teleportTarget.value
227
282
  }, [createElementVNode("div", _hoisted_2, [createVNode(unref(OAnchor), {
283
+ ref_key: "anchorRef",
284
+ ref: anchorRef,
228
285
  layout: "v",
229
286
  size: "small",
230
287
  container: __props.container,
231
288
  "target-offset": __props.targetOffset,
289
+ bounds: __props.bounds,
290
+ "change-hash": __props.changeHash,
291
+ onChange: onAnchorChange,
232
292
  onClick: onAnchorClick
233
293
  }, {
234
294
  default: withCtx(() => [createVNode(ArticleAnchorItems_default, { items: items.value }, null, 8, ["items"])]),
235
295
  _: 1
236
- }, 8, ["container", "target-offset"])])], 8, ["to", "disabled"]))
296
+ }, 8, [
297
+ "container",
298
+ "target-offset",
299
+ "bounds",
300
+ "change-hash"
301
+ ])])], 8, ["to", "disabled"]))
237
302
  ])) : createCommentVNode("", true);
238
303
  };
239
304
  }
@@ -1,18 +1,18 @@
1
- .hover-icon-rotate .o-icon[data-v-6e032ecb] {
1
+ .hover-icon-rotate .o-icon[data-v-dcc5e0d5] {
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-6e032ecb] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-dcc5e0d5] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-article-anchor__body[data-v-6e032ecb] .o-anchor {
9
+ .o-article-anchor__body[data-v-dcc5e0d5] .o-anchor {
10
10
  --anchor-item-link-color: var(--o-color-info2);
11
11
  --anchor-item-link-color-active: var(--o-color-primary1);
12
12
  --anchor-item-link-color-hover: var(--o-color-primary2);
13
13
  --anchor-item-link-color-press: var(--o-color-primary3);
14
14
  --anchor-line-bg-color: var(--o-color-control4);
15
15
  }
16
- .o-article-anchor--hidden[data-v-6e032ecb] {
16
+ .o-article-anchor--hidden[data-v-dcc5e0d5] {
17
17
  display: none;
18
18
  }
@@ -1,6 +1,6 @@
1
1
  import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
2
2
  import ArticleAnchorItems_vue_vue_type_script_setup_true_lang_default from "./ArticleAnchorItems.vue_vue_type_script_setup_true_lang.mjs";
3
- import './ArticleAnchorItems.vue_vue_type_style_index_0_scoped_c0fc5e57_lang.css';
3
+ import './ArticleAnchorItems.vue_vue_type_style_index_0_scoped_126e1824_lang.css';
4
4
  // src/components/article-anchor/components/ArticleAnchorItems.vue
5
- var ArticleAnchorItems_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ArticleAnchorItems_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c0fc5e57"]]);
5
+ var ArticleAnchorItems_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ArticleAnchorItems_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-126e1824"]]);
6
6
  export { ArticleAnchorItems_default as default };
@@ -9,9 +9,10 @@ var ArticleAnchorItems_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
9
9
  return (_ctx, _cache) => {
10
10
  return openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
11
11
  return openBlock(), createBlock(unref(OAnchorItem), {
12
- key: item.id,
12
+ key: item.href,
13
13
  title: item.title,
14
- href: `#${item.id}`,
14
+ href: item.href,
15
+ "observe-href": item.observeHref,
15
16
  class: "o-article-anchor-item"
16
17
  }, {
17
18
  default: withCtx(() => [item.children?.length ? (openBlock(), createBlock(ArticleAnchorItems_default, {
@@ -19,7 +20,11 @@ var ArticleAnchorItems_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
19
20
  items: item.children
20
21
  }, null, 8, ["items"])) : createCommentVNode("", true)]),
21
22
  _: 2
22
- }, 1032, ["title", "href"]);
23
+ }, 1032, [
24
+ "title",
25
+ "href",
26
+ "observe-href"
27
+ ]);
23
28
  }), 128);
24
29
  };
25
30
  }
@@ -1,11 +1,11 @@
1
- .hover-icon-rotate .o-icon[data-v-c0fc5e57] {
1
+ .hover-icon-rotate .o-icon[data-v-126e1824] {
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-c0fc5e57] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-126e1824] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-article-anchor-item[data-v-c0fc5e57] {
9
+ .o-article-anchor-item[data-v-126e1824] {
10
10
  --link-color: var(--o-color-info2);
11
11
  }
@@ -1,6 +1,6 @@
1
1
  import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
2
2
  import ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default from "./ArticleAnchorMobile.vue_vue_type_script_setup_true_lang.mjs";
3
- import './ArticleAnchorMobile.vue_vue_type_style_index_0_scoped_648619c2_lang.css';
3
+ import './ArticleAnchorMobile.vue_vue_type_style_index_0_scoped_ccc0d33c_lang.css';
4
4
  // src/components/article-anchor/components/ArticleAnchorMobile.vue
5
- var ArticleAnchorMobile_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-648619c2"]]);
5
+ var ArticleAnchorMobile_default = /*#__PURE__*/ _plugin_vue_export_helper_default(ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ccc0d33c"]]);
6
6
  export { ArticleAnchorMobile_default as default };
@@ -22,7 +22,7 @@ var ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
22
22
  "update:visible"
23
23
  ],
24
24
  setup(__props, { emit: __emit }) {
25
- useCssVars((_ctx) => ({ "v1994d85b": _ctx.radius }));
25
+ useCssVars((_ctx) => ({ "v3bf9ee34": _ctx.radius }));
26
26
  const props = __props;
27
27
  const emit = __emit;
28
28
  const visible = computed({
@@ -54,11 +54,12 @@ var ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
54
54
  const offset = (props.targetOffset ?? 0) + 1;
55
55
  let current = null;
56
56
  for (const item of flatItems.value) {
57
- const el = document.getElementById(item.id);
57
+ const observeId = (item.observeHref || item.href).replace(/^#/, "");
58
+ const el = document.getElementById(observeId);
58
59
  if (!el) continue;
59
- if (el.getBoundingClientRect().top - containerTop <= offset) current = item.id;
60
+ if (el.getBoundingClientRect().top - containerTop <= offset) current = item.href;
60
61
  }
61
- if (current && active.value !== `#${current}`) active.value = `#${current}`;
62
+ if (current && active.value !== current) active.value = current;
62
63
  };
63
64
  useEventListener(scrollTarget, "scroll", updateActive);
64
65
  watch(() => props.expanded, (value) => {
@@ -67,8 +68,9 @@ var ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
67
68
  watch(() => props.items, () => {
68
69
  nextTick(updateActive);
69
70
  }, { deep: true });
70
- const jump = (id) => {
71
- document.getElementById(id)?.scrollIntoView({
71
+ const jump = (item) => {
72
+ const target = item.observeHref || item.href;
73
+ document.getElementById(target.replace(/^#/, ""))?.scrollIntoView({
72
74
  behavior: "smooth",
73
75
  block: "start"
74
76
  });
@@ -101,19 +103,19 @@ var ArticleAnchorMobile_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
101
103
  class: "o-article-anchor--mobile__menu"
102
104
  }, {
103
105
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
104
- return openBlock(), createElementBlock(Fragment, { key: item.id }, [createVNode(unref(OMenuItem), {
106
+ return openBlock(), createElementBlock(Fragment, { key: item.href }, [createVNode(unref(OMenuItem), {
105
107
  class: "o-article-anchor--mobile__menu-item",
106
- value: `#${item.id}`,
107
- onClick: ($event) => jump(item.id)
108
+ value: item.href,
109
+ onClick: ($event) => jump(item)
108
110
  }, {
109
111
  default: withCtx(() => [createTextVNode(toDisplayString(item.title), 1)]),
110
112
  _: 2
111
113
  }, 1032, ["value", "onClick"]), item.children?.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(item.children, (child) => {
112
114
  return openBlock(), createBlock(unref(OMenuItem), {
113
- key: child.id,
114
- value: `#${child.id}`,
115
+ key: child.href,
116
+ value: child.href,
115
117
  class: "o-article-anchor--mobile__menu-subitem",
116
- onClick: ($event) => jump(child.id)
118
+ onClick: ($event) => jump(child)
117
119
  }, {
118
120
  default: withCtx(() => [createTextVNode(toDisplayString(child.title), 1)]),
119
121
  _: 2
@@ -1,15 +1,15 @@
1
- .hover-icon-rotate .o-icon[data-v-648619c2] {
1
+ .hover-icon-rotate .o-icon[data-v-ccc0d33c] {
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-648619c2] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-ccc0d33c] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-article-anchor--mobile[data-v-648619c2] {
10
- --o-article-anchor-radius: var(--v1994d85b);
9
+ .o-article-anchor--mobile[data-v-ccc0d33c] {
10
+ --o-article-anchor-radius: var(--v3bf9ee34);
11
11
  }
12
- .o-article-anchor--mobile__fab[data-v-648619c2] {
12
+ .o-article-anchor--mobile__fab[data-v-ccc0d33c] {
13
13
  display: flex;
14
14
  align-items: center;
15
15
  justify-content: center;
@@ -21,27 +21,27 @@
21
21
  border-radius: 50%;
22
22
  box-shadow: var(--o-shadow-3);
23
23
  }
24
- .o-article-anchor--mobile__fab-icon[data-v-648619c2] {
24
+ .o-article-anchor--mobile__fab-icon[data-v-ccc0d33c] {
25
25
  font-size: 24px;
26
26
  color: var(--o-color-info2);
27
27
  line-height: 1;
28
28
  }
29
- .o-article-anchor--mobile__sheet-title[data-v-648619c2] {
29
+ .o-article-anchor--mobile__sheet-title[data-v-ccc0d33c] {
30
30
  color: var(--o-color-info1);
31
31
  font-weight: 600;
32
32
  font-size: 18px;
33
33
  line-height: 26px;
34
34
  }
35
- .o-article-anchor--mobile__menu[data-v-648619c2] {
35
+ .o-article-anchor--mobile__menu[data-v-ccc0d33c] {
36
36
  --menu-width: 100%;
37
37
  }
38
- .o-article-anchor--mobile__menu-sub[data-v-648619c2] {
38
+ .o-article-anchor--mobile__menu-sub[data-v-ccc0d33c] {
39
39
  padding-left: 16px;
40
40
  }
41
- .o-article-anchor--mobile__menu-item[data-v-648619c2] {
41
+ .o-article-anchor--mobile__menu-item[data-v-ccc0d33c] {
42
42
  padding: 12px 16px;
43
43
  }
44
- .o-article-anchor--mobile__menu-subitem[data-v-648619c2] {
44
+ .o-article-anchor--mobile__menu-subitem[data-v-ccc0d33c] {
45
45
  padding: 12px 16px;
46
46
  padding-left: 28px;
47
47
  }
@@ -1,21 +1,158 @@
1
1
  import { App } from 'vue';
2
2
  declare const OArticleAnchor: {
3
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../index').ArticleAnchorPropsT> & Readonly<{}>, {
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../index').ArticleAnchorPropsT> & Readonly<{
4
+ onChange?: ((link: string) => any) | undefined;
5
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
6
+ }>, {
4
7
  collect: () => void;
5
8
  items: import('vue').ComputedRef<import('../../index').ArticleAnchorItemT[]>;
6
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
9
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ change: (link: string) => any;
11
+ click: (ev: MouseEvent, link?: string | undefined) => any;
12
+ }, import('vue').PublicProps, {
7
13
  size: "pc" | "pad" | "mobile";
8
14
  items: import('../../index').ArticleAnchorItemT[];
15
+ bounds: number;
16
+ changeHash: boolean;
9
17
  radius: string;
10
18
  showTitle: boolean;
11
19
  selector: string | HTMLElement;
12
20
  autoExtract: boolean;
13
21
  maxLevel: number;
14
22
  writeId: boolean;
23
+ idPrefix: string;
15
24
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
16
25
  pcSlotRef: HTMLDivElement;
17
26
  padSlotRef: HTMLDivElement;
18
27
  hiddenSlotRef: HTMLDivElement;
28
+ anchorRef: ({
29
+ $: import('vue').ComponentInternalInstance;
30
+ $data: {};
31
+ $props: Partial<{
32
+ size: "medium" | "small" | "menu";
33
+ layout: "h" | "v";
34
+ bounds: number;
35
+ targetOffset: number;
36
+ changeHash: boolean;
37
+ }> & Omit<{
38
+ readonly size: "small" | "medium" | "menu";
39
+ readonly layout: "v" | "h";
40
+ readonly targetOffset: number;
41
+ readonly bounds: number;
42
+ readonly changeHash: boolean;
43
+ readonly container?: string | Window | HTMLElement | undefined;
44
+ readonly onChange?: ((link: string) => any) | undefined | undefined;
45
+ readonly onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined | undefined;
46
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "size" | "layout" | "targetOffset" | "bounds" | "changeHash">;
47
+ $attrs: import('vue').Attrs;
48
+ $refs: {
49
+ [x: string]: unknown;
50
+ } & {
51
+ anchorRef: HTMLDivElement;
52
+ anchorItemsRef: HTMLDivElement;
53
+ };
54
+ $slots: Readonly<{
55
+ [name: string]: import('vue').Slot<any> | undefined;
56
+ }>;
57
+ $root: import('vue').ComponentPublicInstance | null;
58
+ $parent: import('vue').ComponentPublicInstance | null;
59
+ $host: Element | null;
60
+ $emit: ((event: "change", link: string) => void) & ((event: "click", ev: MouseEvent, link?: string | undefined) => void);
61
+ $el: HTMLDivElement;
62
+ $options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
63
+ layout: {
64
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorDirectionT>;
65
+ default: string;
66
+ };
67
+ size: {
68
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorSizeT>;
69
+ default: string;
70
+ };
71
+ container: {
72
+ type: import('vue').PropType<string | HTMLElement | Window>;
73
+ };
74
+ bounds: {
75
+ type: NumberConstructor;
76
+ default: number;
77
+ };
78
+ targetOffset: {
79
+ type: NumberConstructor;
80
+ default: number;
81
+ };
82
+ changeHash: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ }>> & Readonly<{
87
+ onChange?: ((link: string) => any) | undefined;
88
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
89
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
90
+ change: (link: string) => any;
91
+ click: (ev: MouseEvent, link?: string | undefined) => any;
92
+ }, string, {
93
+ size: "medium" | "small" | "menu";
94
+ layout: "h" | "v";
95
+ bounds: number;
96
+ targetOffset: number;
97
+ changeHash: boolean;
98
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
99
+ beforeCreate?: (() => void) | (() => void)[];
100
+ created?: (() => void) | (() => void)[];
101
+ beforeMount?: (() => void) | (() => void)[];
102
+ mounted?: (() => void) | (() => void)[];
103
+ beforeUpdate?: (() => void) | (() => void)[];
104
+ updated?: (() => void) | (() => void)[];
105
+ activated?: (() => void) | (() => void)[];
106
+ deactivated?: (() => void) | (() => void)[];
107
+ beforeDestroy?: (() => void) | (() => void)[];
108
+ beforeUnmount?: (() => void) | (() => void)[];
109
+ destroyed?: (() => void) | (() => void)[];
110
+ unmounted?: (() => void) | (() => void)[];
111
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
112
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
113
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
114
+ };
115
+ $forceUpdate: () => void;
116
+ $nextTick: typeof import('vue').nextTick;
117
+ $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;
118
+ } & Readonly<{
119
+ size: "medium" | "small" | "menu";
120
+ layout: "h" | "v";
121
+ bounds: number;
122
+ targetOffset: number;
123
+ changeHash: boolean;
124
+ }> & Omit<Readonly<import('vue').ExtractPropTypes<{
125
+ layout: {
126
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorDirectionT>;
127
+ default: string;
128
+ };
129
+ size: {
130
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorSizeT>;
131
+ default: string;
132
+ };
133
+ container: {
134
+ type: import('vue').PropType<string | HTMLElement | Window>;
135
+ };
136
+ bounds: {
137
+ type: NumberConstructor;
138
+ default: number;
139
+ };
140
+ targetOffset: {
141
+ type: NumberConstructor;
142
+ default: number;
143
+ };
144
+ changeHash: {
145
+ type: BooleanConstructor;
146
+ default: boolean;
147
+ };
148
+ }>> & Readonly<{
149
+ onChange?: ((link: string) => any) | undefined;
150
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
151
+ }>, "size" | "layout" | "targetOffset" | "bounds" | "changeHash"> & {} & import('vue').ComponentCustomProperties & {} & {
152
+ $slots: {
153
+ default?(_: {}): any;
154
+ };
155
+ }) | null;
19
156
  }, any, import('vue').ComponentProvideOptions, {
20
157
  P: {};
21
158
  B: {};
@@ -23,34 +160,49 @@ declare const OArticleAnchor: {
23
160
  C: {};
24
161
  M: {};
25
162
  Defaults: {};
26
- }, Readonly<import('../../index').ArticleAnchorPropsT> & Readonly<{}>, {
163
+ }, Readonly<import('../../index').ArticleAnchorPropsT> & Readonly<{
164
+ onChange?: ((link: string) => any) | undefined;
165
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
166
+ }>, {
27
167
  collect: () => void;
28
168
  items: import('vue').ComputedRef<import('../../index').ArticleAnchorItemT[]>;
29
169
  }, {}, {}, {}, {
30
170
  size: "pc" | "pad" | "mobile";
31
171
  items: import('../../index').ArticleAnchorItemT[];
172
+ bounds: number;
173
+ changeHash: boolean;
32
174
  radius: string;
33
175
  showTitle: boolean;
34
176
  selector: string | HTMLElement;
35
177
  autoExtract: boolean;
36
178
  maxLevel: number;
37
179
  writeId: boolean;
180
+ idPrefix: string;
38
181
  }>;
39
182
  __isFragment?: never;
40
183
  __isTeleport?: never;
41
184
  __isSuspense?: never;
42
- } & import('vue').ComponentOptionsBase<Readonly<import('../../index').ArticleAnchorPropsT> & Readonly<{}>, {
185
+ } & import('vue').ComponentOptionsBase<Readonly<import('../../index').ArticleAnchorPropsT> & Readonly<{
186
+ onChange?: ((link: string) => any) | undefined;
187
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
188
+ }>, {
43
189
  collect: () => void;
44
190
  items: import('vue').ComputedRef<import('../../index').ArticleAnchorItemT[]>;
45
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
191
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
192
+ change: (link: string) => any;
193
+ click: (ev: MouseEvent, link?: string | undefined) => any;
194
+ }, string, {
46
195
  size: "pc" | "pad" | "mobile";
47
196
  items: import('../../index').ArticleAnchorItemT[];
197
+ bounds: number;
198
+ changeHash: boolean;
48
199
  radius: string;
49
200
  showTitle: boolean;
50
201
  selector: string | HTMLElement;
51
202
  autoExtract: boolean;
52
203
  maxLevel: number;
53
204
  writeId: boolean;
205
+ idPrefix: string;
54
206
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
55
207
  install(app: App): void;
56
208
  };
@@ -1,8 +1,10 @@
1
1
  export interface ArticleAnchorItemT {
2
- /** 锚点 id(不含 #),对应页面元素 id */
3
- id: string;
2
+ /** 锚点链接(含 # 前缀),如 '#manual-a',对应页面元素 id */
3
+ href: string;
4
4
  /** 展示标题 */
5
5
  title: string;
6
+ /** 透传 OAnchorItem:锚点监听的目标元素(含 # 前缀),不传时监听 href */
7
+ observeHref?: string;
6
8
  /** 子锚点(嵌套渲染缩进) */
7
9
  children?: ArticleAnchorItemT[];
8
10
  }
@@ -23,10 +25,16 @@ export interface ArticleAnchorPropsT {
23
25
  maxLevel?: number;
24
26
  /** 无 id 标题自动生成 slug 并回写到元素 id(保证锚点可用),默认 true */
25
27
  writeId?: boolean;
28
+ /** 自动收集时,元素 id 若以该前缀开头(如 'user-content-'),则 item.href 去掉前缀展示(#a),observeHref 指向完整 id(#user-content-a);默认 '' 不处理 */
29
+ idPrefix?: string;
26
30
  /** 透传 OAnchor:滚动容器,默认 window */
27
31
  container?: string | HTMLElement | Window;
28
32
  /** 透传 OAnchor:滚动偏移量 */
29
33
  targetOffset?: number;
34
+ /** 透传 OAnchor:锚点激活的边界范围,默认 5 */
35
+ bounds?: number;
36
+ /** 透传 OAnchor:点击锚点时是否改变地址栏 hash,默认 true */
37
+ changeHash?: boolean;
30
38
  /** 卡片圆角 */
31
39
  radius?: string;
32
40
  }
@@ -1,6 +1,6 @@
1
1
  import _plugin_vue_export_helper_default from "../../_virtual/_plugin-vue_export-helper.mjs";
2
2
  import OArticlePagination_vue_vue_type_script_setup_true_lang_default from "./OArticlePagination.vue_vue_type_script_setup_true_lang.mjs";
3
- import './OArticlePagination.vue_vue_type_style_index_0_scoped_e78e8bd3_lang.css';
3
+ import './OArticlePagination.vue_vue_type_style_index_0_scoped_8a8cf9f8_lang.css';
4
4
  // src/components/article-pagination/OArticlePagination.vue
5
- var OArticlePagination_default = /*#__PURE__*/ _plugin_vue_export_helper_default(OArticlePagination_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e78e8bd3"]]);
5
+ var OArticlePagination_default = /*#__PURE__*/ _plugin_vue_export_helper_default(OArticlePagination_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-8a8cf9f8"]]);
6
6
  export { OArticlePagination_default as default };