@diplodoc/transform 4.74.0 → 4.74.1
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/css/_yfm-only.css.map +1 -1
- package/dist/css/_yfm-only.min.css.map +1 -1
- package/dist/css/base.css.map +1 -1
- package/dist/css/base.min.css.map +1 -1
- package/dist/css/print.css.map +1 -1
- package/dist/css/yfm.css.map +1 -1
- package/dist/css/yfm.min.css.map +1 -1
- package/dist/js/base.js +6 -6
- package/dist/js/base.js.map +2 -2
- package/dist/js/base.min.js +1 -1
- package/dist/js/base.min.js.map +2 -2
- package/dist/js/yfm.js +6 -6
- package/dist/js/yfm.js.map +2 -2
- package/dist/js/yfm.min.js +1 -1
- package/dist/js/yfm.min.js.map +2 -2
- package/lib/plugins/inline-code/index.js +1 -6
- package/lib/plugins/inline-code/index.js.map +1 -1
- package/package.json +1 -1
- package/src/js/tooltip/tooltip.ts +7 -7
- package/src/js/tooltip/types.ts +0 -1
- package/src/transform/plugins/inline-code/index.ts +1 -7
|
@@ -79,12 +79,12 @@ export function createTooltipFactory(options: TooltipOptions = {}) {
|
|
|
79
79
|
const show = (reference: HTMLElement, text: string) => {
|
|
80
80
|
hide();
|
|
81
81
|
|
|
82
|
-
const tooltip = createTooltipElement({
|
|
82
|
+
const tooltip = createTooltipElement({className: additionalClassName});
|
|
83
83
|
const update = updateTooltipPosition.bind(null, options, reference, tooltip);
|
|
84
84
|
|
|
85
85
|
state.currentId = tooltip.id;
|
|
86
86
|
|
|
87
|
-
attachTooltip(tooltip, reference);
|
|
87
|
+
attachTooltip(tooltip, reference, text);
|
|
88
88
|
|
|
89
89
|
state.unsubscribe = subscribeToScroll(reference, update);
|
|
90
90
|
|
|
@@ -142,7 +142,7 @@ export function createTooltipFactory(options: TooltipOptions = {}) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
function createTooltipElement(options: TooltipElementOptions) {
|
|
145
|
-
const {
|
|
145
|
+
const {className} = options;
|
|
146
146
|
|
|
147
147
|
const id = generateId();
|
|
148
148
|
const tooltip = document.createElement('div');
|
|
@@ -150,15 +150,13 @@ function createTooltipElement(options: TooltipElementOptions) {
|
|
|
150
150
|
tooltip.id = id;
|
|
151
151
|
tooltip.className = className ? `${TOOLTIP_BASE_CLASS} ${className}` : TOOLTIP_BASE_CLASS;
|
|
152
152
|
|
|
153
|
-
tooltip.setAttribute('role', '
|
|
153
|
+
tooltip.setAttribute('role', 'status');
|
|
154
154
|
tooltip.setAttribute('aria-live', 'polite');
|
|
155
155
|
|
|
156
|
-
tooltip.textContent = text;
|
|
157
|
-
|
|
158
156
|
return tooltip;
|
|
159
157
|
}
|
|
160
158
|
|
|
161
|
-
function attachTooltip(tooltip: HTMLElement, reference: HTMLElement) {
|
|
159
|
+
function attachTooltip(tooltip: HTMLElement, reference: HTMLElement, text: string) {
|
|
162
160
|
const container = document.querySelector(PAGE_CONTAINER_SELECTOR) || document.body;
|
|
163
161
|
const ariaLive = reference.getAttribute('aria-live');
|
|
164
162
|
|
|
@@ -169,6 +167,8 @@ function attachTooltip(tooltip: HTMLElement, reference: HTMLElement) {
|
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
container.appendChild(tooltip);
|
|
170
|
+
|
|
171
|
+
tooltip.textContent = text;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
function detachTooltip(tooltip: HTMLElement) {
|
package/src/js/tooltip/types.ts
CHANGED
|
@@ -4,19 +4,13 @@ import {escapeHtml} from 'markdown-it/lib/common/utils';
|
|
|
4
4
|
|
|
5
5
|
import {generateID as globalGenerateID} from '../utils';
|
|
6
6
|
|
|
7
|
-
import {LANG_TOKEN_DESCRIPTION, LANG_TOKEN_LABEL} from './constant';
|
|
8
|
-
|
|
9
7
|
const inlineCode: MarkdownItPluginCb = (md, options) => {
|
|
10
|
-
const lang = options.lang;
|
|
11
8
|
const generateID = options.generateID ?? globalGenerateID;
|
|
12
9
|
|
|
13
10
|
md.renderer.rules.code_inline = function (tokens, idx) {
|
|
14
11
|
const id = generateID('inline-code-id');
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
const label = LANG_TOKEN_LABEL[lang] ?? LANG_TOKEN_LABEL.en;
|
|
18
|
-
|
|
19
|
-
return `<code class="yfm-clipboard-inline-code" role="button" aria-label="${label}" aria-description="${description}" tabindex='0' id="${id}">${escapeHtml(tokens[idx].content)}</code>`;
|
|
13
|
+
return `<code class="yfm-clipboard-inline-code" role="button" tabindex='0' id="${id}">${escapeHtml(tokens[idx].content)}</code>`;
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
16
|
|