@atlaskit/renderer 133.14.2 → 133.16.0
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/CHANGELOG.md +23 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-products/tsconfig.json +3 -0
- package/dist/cjs/messages.js +13 -1
- package/dist/cjs/react/nodes/heading.compiled.css +12 -0
- package/dist/cjs/react/nodes/heading.js +188 -48
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +8 -1
- package/dist/cjs/ui/Renderer/index.js +8 -2
- package/dist/cjs/ui/collapsible-headings-dom.js +138 -0
- package/dist/cjs/ui/collapsible-headings-section-model.js +38 -0
- package/dist/cjs/ui/collapsible-headings.js +232 -0
- package/dist/es2019/messages.js +12 -0
- package/dist/es2019/react/nodes/heading.compiled.css +12 -0
- package/dist/es2019/react/nodes/heading.js +142 -32
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +8 -0
- package/dist/es2019/ui/Renderer/index.js +8 -2
- package/dist/es2019/ui/collapsible-headings-dom.js +118 -0
- package/dist/es2019/ui/collapsible-headings-section-model.js +32 -0
- package/dist/es2019/ui/collapsible-headings.js +183 -0
- package/dist/esm/messages.js +12 -0
- package/dist/esm/react/nodes/heading.compiled.css +12 -0
- package/dist/esm/react/nodes/heading.js +188 -46
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +8 -1
- package/dist/esm/ui/Renderer/index.js +8 -2
- package/dist/esm/ui/collapsible-headings-dom.js +129 -0
- package/dist/esm/ui/collapsible-headings-section-model.js +32 -0
- package/dist/esm/ui/collapsible-headings.js +221 -0
- package/dist/types/messages.d.ts +23 -21
- package/dist/types/react/nodes/heading.d.ts +3 -2
- package/dist/types/ui/collapsible-headings-dom.d.ts +14 -0
- package/dist/types/ui/collapsible-headings-section-model.d.ts +9 -0
- package/dist/types/ui/collapsible-headings.d.ts +26 -0
- package/dist/types/ui/renderer-props.d.ts +7 -0
- package/package.json +14 -13
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
const RENDERER_DOCUMENT_SELECTOR = '.ak-renderer-document';
|
|
2
|
+
const RENDERER_START_POS_ATTRIBUTE = 'data-renderer-start-pos';
|
|
3
|
+
const HEADING_SELECTOR = [1, 2, 3, 4, 5, 6].map(level => `h${level}[${RENDERER_START_POS_ATTRIBUTE}]`).join(',');
|
|
4
|
+
export const COLLAPSED_CONTENT_OWNERS_ATTRIBUTE = 'data-renderer-collapsed-content-owners';
|
|
5
|
+
function getDirectRendererChild(rendererDocument, element) {
|
|
6
|
+
var _currentElement;
|
|
7
|
+
let currentElement = element;
|
|
8
|
+
while (currentElement && currentElement.parentElement !== rendererDocument) {
|
|
9
|
+
currentElement = currentElement.parentElement;
|
|
10
|
+
}
|
|
11
|
+
return ((_currentElement = currentElement) === null || _currentElement === void 0 ? void 0 : _currentElement.parentElement) === rendererDocument ? currentElement : null;
|
|
12
|
+
}
|
|
13
|
+
function getTopLevelHeadingPositionsByContainer(rendererDocument, topLevelHeadingPositions) {
|
|
14
|
+
const headingPositionsByContainer = new Map();
|
|
15
|
+
rendererDocument.querySelectorAll(HEADING_SELECTOR).forEach(headingElement => {
|
|
16
|
+
if (headingElement.closest(RENDERER_DOCUMENT_SELECTOR) !== rendererDocument) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const position = Number(headingElement.getAttribute(RENDERER_START_POS_ATTRIBUTE));
|
|
20
|
+
if (!Number.isFinite(position) || !topLevelHeadingPositions.has(position)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const headingContainer = getDirectRendererChild(rendererDocument, headingElement);
|
|
24
|
+
if (headingContainer) {
|
|
25
|
+
headingPositionsByContainer.set(headingContainer, position);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return headingPositionsByContainer;
|
|
29
|
+
}
|
|
30
|
+
function restoreHiddenAttribute(element, originalHiddenAttributes) {
|
|
31
|
+
if (!originalHiddenAttributes.has(element)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const originalHiddenAttribute = originalHiddenAttributes.get(element);
|
|
35
|
+
if (originalHiddenAttribute === null || originalHiddenAttribute === undefined) {
|
|
36
|
+
element.removeAttribute('hidden');
|
|
37
|
+
} else {
|
|
38
|
+
element.setAttribute('hidden', originalHiddenAttribute);
|
|
39
|
+
}
|
|
40
|
+
originalHiddenAttributes.delete(element);
|
|
41
|
+
}
|
|
42
|
+
function setCollapsedOwners(element, owners, originalHiddenAttributes) {
|
|
43
|
+
if (!originalHiddenAttributes.has(element)) {
|
|
44
|
+
originalHiddenAttributes.set(element, element.getAttribute('hidden'));
|
|
45
|
+
}
|
|
46
|
+
element.setAttribute(COLLAPSED_CONTENT_OWNERS_ATTRIBUTE, Array.from(owners).join(','));
|
|
47
|
+
element.setAttribute('hidden', 'until-found');
|
|
48
|
+
}
|
|
49
|
+
function getDesiredCollapsedContentOwners(rendererDocuments, collapsedHeadings, sections) {
|
|
50
|
+
const desiredOwners = new Map();
|
|
51
|
+
if (collapsedHeadings.size === 0) {
|
|
52
|
+
return desiredOwners;
|
|
53
|
+
}
|
|
54
|
+
const topLevelHeadingPositions = new Set(sections.map(section => section.headingPos));
|
|
55
|
+
const sectionsByHeadingPosition = new Map(sections.map(section => [section.headingPos, section]));
|
|
56
|
+
rendererDocuments.forEach(rendererDocument => {
|
|
57
|
+
// Index headings once, then reconcile every top-level renderer child in DOM order.
|
|
58
|
+
const headingPositionsByContainer = getTopLevelHeadingPositionsByContainer(rendererDocument, topLevelHeadingPositions);
|
|
59
|
+
let activeCollapsedSections = [];
|
|
60
|
+
const contentElements = Array.from(rendererDocument.children);
|
|
61
|
+
contentElements.forEach(contentElement => {
|
|
62
|
+
const headingPosition = headingPositionsByContainer.get(contentElement);
|
|
63
|
+
if (headingPosition !== undefined) {
|
|
64
|
+
activeCollapsedSections = activeCollapsedSections.filter(section => section.to > headingPosition);
|
|
65
|
+
}
|
|
66
|
+
if (activeCollapsedSections.length > 0) {
|
|
67
|
+
desiredOwners.set(contentElement, new Set(activeCollapsedSections.map(section => section.headingPos)));
|
|
68
|
+
}
|
|
69
|
+
if (headingPosition !== undefined && collapsedHeadings.has(headingPosition)) {
|
|
70
|
+
const section = sectionsByHeadingPosition.get(headingPosition);
|
|
71
|
+
if (section) {
|
|
72
|
+
activeCollapsedSections.push(section);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
return desiredOwners;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Returns renderer documents owned by this renderer root, excluding nested renderers. */
|
|
81
|
+
export function getOwnedRendererDocuments(rendererRoot) {
|
|
82
|
+
return Array.from(rendererRoot.querySelectorAll(RENDERER_DOCUMENT_SELECTOR)).filter(rendererDocument => {
|
|
83
|
+
var _rendererDocument$par;
|
|
84
|
+
const parentRendererDocument = (_rendererDocument$par = rendererDocument.parentElement) === null || _rendererDocument$par === void 0 ? void 0 : _rendererDocument$par.closest(RENDERER_DOCUMENT_SELECTOR);
|
|
85
|
+
return !parentRendererDocument || !rendererRoot.contains(parentRendererDocument);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Applies only the visibility-attribute differences required by the collapsed section model. */
|
|
90
|
+
export function reconcileCollapsedHeadingContent({
|
|
91
|
+
collapsedHeadings,
|
|
92
|
+
originalHiddenAttributes,
|
|
93
|
+
rendererRoot,
|
|
94
|
+
sections
|
|
95
|
+
}) {
|
|
96
|
+
const rendererDocuments = getOwnedRendererDocuments(rendererRoot);
|
|
97
|
+
const desiredOwners = getDesiredCollapsedContentOwners(rendererDocuments, collapsedHeadings, sections);
|
|
98
|
+
rendererDocuments.forEach(rendererDocument => {
|
|
99
|
+
rendererDocument.querySelectorAll(`[${COLLAPSED_CONTENT_OWNERS_ATTRIBUTE}]`).forEach(element => {
|
|
100
|
+
if (element.closest(RENDERER_DOCUMENT_SELECTOR) === rendererDocument && !desiredOwners.has(element)) {
|
|
101
|
+
element.removeAttribute(COLLAPSED_CONTENT_OWNERS_ATTRIBUTE);
|
|
102
|
+
restoreHiddenAttribute(element, originalHiddenAttributes);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
desiredOwners.forEach((owners, element) => {
|
|
107
|
+
const desiredOwnersAttribute = Array.from(owners).join(',');
|
|
108
|
+
if (element.getAttribute(COLLAPSED_CONTENT_OWNERS_ATTRIBUTE) !== desiredOwnersAttribute || element.getAttribute('hidden') !== 'until-found') {
|
|
109
|
+
setCollapsedOwners(element, owners, originalHiddenAttributes);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Returns the collapsed heading positions that currently hide an element. */
|
|
115
|
+
export function getCollapsedContentOwners(element) {
|
|
116
|
+
var _element$getAttribute;
|
|
117
|
+
return ((_element$getAttribute = element.getAttribute(COLLAPSED_CONTENT_OWNERS_ATTRIBUTE)) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : '').split(',').filter(owner => owner !== '').map(Number).filter(Number.isFinite);
|
|
118
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const RENDERER_DOCUMENT_POSITION_OFFSET = 1;
|
|
2
|
+
/** Builds collapsible ranges for headings that are direct children of the renderer document. */
|
|
3
|
+
export function buildTopLevelHeadingSections(pmDocument) {
|
|
4
|
+
if (!pmDocument) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const sections = [];
|
|
8
|
+
const openSections = [];
|
|
9
|
+
const documentEnd = pmDocument.content.size + RENDERER_DOCUMENT_POSITION_OFFSET;
|
|
10
|
+
pmDocument.forEach((node, offset) => {
|
|
11
|
+
if (node.type.name !== 'heading') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const headingPos = offset + RENDERER_DOCUMENT_POSITION_OFFSET;
|
|
15
|
+
const level = Number(node.attrs.level);
|
|
16
|
+
while (openSections.length > 0 && openSections[openSections.length - 1].level >= level) {
|
|
17
|
+
const section = openSections.pop();
|
|
18
|
+
if (section) {
|
|
19
|
+
section.to = headingPos;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const section = {
|
|
23
|
+
contentFrom: headingPos + node.nodeSize,
|
|
24
|
+
headingPos,
|
|
25
|
+
level,
|
|
26
|
+
to: documentEnd
|
|
27
|
+
};
|
|
28
|
+
sections.push(section);
|
|
29
|
+
openSections.push(section);
|
|
30
|
+
});
|
|
31
|
+
return sections;
|
|
32
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { bind } from 'bind-event-listener';
|
|
3
|
+
import { COLLAPSED_CONTENT_OWNERS_ATTRIBUTE, getCollapsedContentOwners, getOwnedRendererDocuments, reconcileCollapsedHeadingContent } from './collapsible-headings-dom';
|
|
4
|
+
import { buildTopLevelHeadingSections } from './collapsible-headings-section-model';
|
|
5
|
+
const CollapsibleHeadingsContext = /*#__PURE__*/React.createContext(null);
|
|
6
|
+
const emptyCollapsedHeadings = new Set();
|
|
7
|
+
function supportsHiddenUntilFound(rendererRef) {
|
|
8
|
+
var _rendererRef$current;
|
|
9
|
+
const body = (_rendererRef$current = rendererRef.current) === null || _rendererRef$current === void 0 ? void 0 : _rendererRef$current.ownerDocument.body;
|
|
10
|
+
return body ? 'onbeforematch' in body : false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Provides collapse state and synchronizes hidden top-level renderer content. */
|
|
14
|
+
export function CollapsibleHeadingsProvider({
|
|
15
|
+
children,
|
|
16
|
+
isEnabled,
|
|
17
|
+
pmDocument,
|
|
18
|
+
rendererRef
|
|
19
|
+
}) {
|
|
20
|
+
const [isBrowserFindSupported, setIsBrowserFindSupported] = useState(false);
|
|
21
|
+
const [state, setState] = useState({
|
|
22
|
+
pmDocument,
|
|
23
|
+
positions: new Set()
|
|
24
|
+
});
|
|
25
|
+
const originalHiddenAttributes = React.useRef(new WeakMap()).current;
|
|
26
|
+
const sections = useMemo(() => buildTopLevelHeadingSections(pmDocument), [pmDocument]);
|
|
27
|
+
const collapsibleSectionPositions = useMemo(() => new Set(sections.filter(section => section.contentFrom < section.to).map(section => section.headingPos)), [sections]);
|
|
28
|
+
const collapsedHeadings = state.pmDocument === pmDocument ? state.positions : emptyCollapsedHeadings;
|
|
29
|
+
const isActive = isEnabled && isBrowserFindSupported && Boolean(pmDocument);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setIsBrowserFindSupported(isEnabled && supportsHiddenUntilFound(rendererRef));
|
|
32
|
+
}, [isEnabled, rendererRef]);
|
|
33
|
+
const updateCollapsedHeadings = useCallback(update => {
|
|
34
|
+
setState(currentState => {
|
|
35
|
+
const positions = new Set(currentState.pmDocument === pmDocument ? currentState.positions : emptyCollapsedHeadings);
|
|
36
|
+
if (!update(positions)) {
|
|
37
|
+
return currentState.pmDocument === pmDocument ? currentState : {
|
|
38
|
+
pmDocument,
|
|
39
|
+
positions
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
pmDocument,
|
|
44
|
+
positions
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}, [pmDocument]);
|
|
48
|
+
const collapse = useCallback(headingPos => {
|
|
49
|
+
if (!collapsibleSectionPositions.has(headingPos)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
updateCollapsedHeadings(positions => {
|
|
53
|
+
if (positions.has(headingPos)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
positions.add(headingPos);
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
}, [collapsibleSectionPositions, updateCollapsedHeadings]);
|
|
60
|
+
const expand = useCallback(headingPos => {
|
|
61
|
+
updateCollapsedHeadings(positions => positions.delete(headingPos));
|
|
62
|
+
}, [updateCollapsedHeadings]);
|
|
63
|
+
const expandMany = useCallback(headingPositions => {
|
|
64
|
+
const positionsToExpand = new Set(headingPositions);
|
|
65
|
+
updateCollapsedHeadings(positions => {
|
|
66
|
+
let didChange = false;
|
|
67
|
+
positionsToExpand.forEach(headingPos => {
|
|
68
|
+
didChange = positions.delete(headingPos) || didChange;
|
|
69
|
+
});
|
|
70
|
+
return didChange;
|
|
71
|
+
});
|
|
72
|
+
}, [updateCollapsedHeadings]);
|
|
73
|
+
const expandContainingPosition = useCallback(position => {
|
|
74
|
+
expandMany(sections.filter(section => position >= section.contentFrom && position < section.to).map(section => section.headingPos));
|
|
75
|
+
}, [expandMany, sections]);
|
|
76
|
+
const toggle = useCallback(headingPos => {
|
|
77
|
+
if (!collapsibleSectionPositions.has(headingPos)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
updateCollapsedHeadings(positions => {
|
|
81
|
+
if (positions.has(headingPos)) {
|
|
82
|
+
positions.delete(headingPos);
|
|
83
|
+
} else {
|
|
84
|
+
positions.add(headingPos);
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
});
|
|
88
|
+
}, [collapsibleSectionPositions, updateCollapsedHeadings]);
|
|
89
|
+
const contextValue = useMemo(() => isActive ? {
|
|
90
|
+
canCollapse: headingPos => collapsibleSectionPositions.has(headingPos),
|
|
91
|
+
collapse,
|
|
92
|
+
expand,
|
|
93
|
+
expandContainingPosition,
|
|
94
|
+
expandMany,
|
|
95
|
+
isCollapsed: headingPos => collapsedHeadings.has(headingPos),
|
|
96
|
+
toggle
|
|
97
|
+
} : null, [collapse, collapsedHeadings, collapsibleSectionPositions, expand, expandContainingPosition, expandMany, isActive, toggle]);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const rendererRoot = rendererRef.current;
|
|
100
|
+
if (!rendererRoot) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const positions = isActive ? collapsedHeadings : emptyCollapsedHeadings;
|
|
104
|
+
const sync = () => reconcileCollapsedHeadingContent({
|
|
105
|
+
collapsedHeadings: positions,
|
|
106
|
+
originalHiddenAttributes,
|
|
107
|
+
rendererRoot,
|
|
108
|
+
sections
|
|
109
|
+
});
|
|
110
|
+
sync();
|
|
111
|
+
if (!isActive || positions.size === 0) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const rendererDocuments = getOwnedRendererDocuments(rendererRoot);
|
|
115
|
+
const rendererDocumentSet = new Set(rendererDocuments);
|
|
116
|
+
const handleBeforeMatch = event => {
|
|
117
|
+
var _rendererRoot$ownerDo;
|
|
118
|
+
const target = event.target;
|
|
119
|
+
const HTMLElementConstructor = (_rendererRoot$ownerDo = rendererRoot.ownerDocument.defaultView) === null || _rendererRoot$ownerDo === void 0 ? void 0 : _rendererRoot$ownerDo.HTMLElement;
|
|
120
|
+
if (!HTMLElementConstructor || !(target instanceof HTMLElementConstructor)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const collapsedContent = target.closest(`[${COLLAPSED_CONTENT_OWNERS_ATTRIBUTE}]`);
|
|
124
|
+
if (!collapsedContent) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const rendererDocument = collapsedContent.closest('.ak-renderer-document');
|
|
128
|
+
if (!rendererDocument || !rendererDocumentSet.has(rendererDocument)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
expandMany(getCollapsedContentOwners(collapsedContent));
|
|
132
|
+
};
|
|
133
|
+
const unbindBeforeMatchListeners = rendererDocuments.map(rendererDocument => bind(rendererDocument, {
|
|
134
|
+
type: 'beforematch',
|
|
135
|
+
listener: handleBeforeMatch,
|
|
136
|
+
options: {
|
|
137
|
+
capture: true
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
const observer = typeof MutationObserver === 'undefined' ? undefined : new MutationObserver(sync);
|
|
141
|
+
rendererDocuments.forEach(rendererDocument => {
|
|
142
|
+
observer === null || observer === void 0 ? void 0 : observer.observe(rendererDocument, {
|
|
143
|
+
childList: true
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
return () => {
|
|
147
|
+
observer === null || observer === void 0 ? void 0 : observer.disconnect();
|
|
148
|
+
unbindBeforeMatchListeners.forEach(unbindBeforeMatch => unbindBeforeMatch());
|
|
149
|
+
};
|
|
150
|
+
}, [collapsedHeadings, expandMany, isActive, originalHiddenAttributes, rendererRef, sections]);
|
|
151
|
+
useEffect(() => () => {
|
|
152
|
+
const rendererRoot = rendererRef.current;
|
|
153
|
+
if (rendererRoot) {
|
|
154
|
+
reconcileCollapsedHeadingContent({
|
|
155
|
+
collapsedHeadings: emptyCollapsedHeadings,
|
|
156
|
+
originalHiddenAttributes,
|
|
157
|
+
rendererRoot,
|
|
158
|
+
sections: []
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}, [originalHiddenAttributes, rendererRef]);
|
|
162
|
+
return /*#__PURE__*/React.createElement(CollapsibleHeadingsContext.Provider, {
|
|
163
|
+
value: contextValue
|
|
164
|
+
}, children);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Returns collapse state for a top-level heading when the provider is enabled. */
|
|
168
|
+
export function useCollapsibleHeading(startPos, isTopLevel) {
|
|
169
|
+
const context = React.useContext(CollapsibleHeadingsContext);
|
|
170
|
+
const contextToggle = context === null || context === void 0 ? void 0 : context.toggle;
|
|
171
|
+
const isCollapsible = Boolean(context && isTopLevel && context.canCollapse(startPos));
|
|
172
|
+
const isCollapsed = Boolean(isCollapsible && (context === null || context === void 0 ? void 0 : context.isCollapsed(startPos)));
|
|
173
|
+
const toggle = useCallback(() => contextToggle === null || contextToggle === void 0 ? void 0 : contextToggle(startPos), [contextToggle, startPos]);
|
|
174
|
+
return useMemo(() => isCollapsible ? {
|
|
175
|
+
isCollapsed,
|
|
176
|
+
toggle
|
|
177
|
+
} : null, [isCollapsed, isCollapsible, toggle]);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** Returns the collapse controller for integrations such as renderer Find. */
|
|
181
|
+
export function useCollapsibleHeadingsController() {
|
|
182
|
+
return React.useContext(CollapsibleHeadingsContext);
|
|
183
|
+
}
|
package/dist/esm/messages.js
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
4
|
import { defineMessages } from 'react-intl';
|
|
5
|
+
export var collapsibleHeadingMessages = defineMessages({
|
|
6
|
+
collapseSection: {
|
|
7
|
+
id: 'fabric.editor.collapsibleHeading.collapseSection.ai-non-final',
|
|
8
|
+
defaultMessage: 'Collapse section',
|
|
9
|
+
description: 'Accessible label and tooltip for the button beside an expanded renderer heading. Activating the button hides the content in that heading section.'
|
|
10
|
+
},
|
|
11
|
+
expandSection: {
|
|
12
|
+
id: 'fabric.editor.collapsibleHeading.expandSection.ai-non-final',
|
|
13
|
+
defaultMessage: 'Expand section',
|
|
14
|
+
description: 'Accessible label and tooltip for the button beside a collapsed renderer heading. Activating the button reveals the content in that heading section.'
|
|
15
|
+
}
|
|
16
|
+
});
|
|
5
17
|
export var headingAnchorLinkMessages = defineMessages({
|
|
6
18
|
copyHeadingLinkToClipboard: {
|
|
7
19
|
id: 'fabric.editor.headingLink.copyAnchorLink',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
._152tidpf{inset-block-start:0}
|
|
2
|
+
._1e02idpf{inset-inline-start:0}
|
|
3
|
+
._1e0c1ule{display:block}
|
|
4
|
+
._1pbykb7n{z-index:1}
|
|
5
|
+
._ahbqukr8{margin-inline-start:var(--ds-space-negative-400,-2pc)}
|
|
6
|
+
._bozgxy5q{padding-inline-start:var(--ds-space-400,2pc)}
|
|
7
|
+
._kqswh2mm{position:relative}
|
|
8
|
+
._kqswstnw{position:absolute}
|
|
9
|
+
._lcxvglyw{pointer-events:none}
|
|
10
|
+
._tzy4idpf{opacity:0}
|
|
11
|
+
@media (hover:none){._tza3kb7n{opacity:1}._12yg1wug{pointer-events:auto}}
|
|
12
|
+
@media (pointer:coarse){._xrqrkb7n{opacity:1}._l4c51wug{pointer-events:auto}}
|