pro-editor-schema 1.4.0 → 1.4.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/index.js +11 -0
- package/dist/index.mjs +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3182,6 +3182,14 @@ var validatePossibleWeblinks = (root) => {
|
|
|
3182
3182
|
};
|
|
3183
3183
|
|
|
3184
3184
|
// src/validation/validateHeadingHierarchy.ts
|
|
3185
|
+
var shouldSuppressWarning = (element) => {
|
|
3186
|
+
const closestBox = closestElementBySchema({
|
|
3187
|
+
element,
|
|
3188
|
+
code: BOX_SCHEMA.code,
|
|
3189
|
+
ignoreDeletedElements: true
|
|
3190
|
+
});
|
|
3191
|
+
return !!closestBox;
|
|
3192
|
+
};
|
|
3185
3193
|
var getHierarchyLevel = (element) => {
|
|
3186
3194
|
const role = element.getAttribute("role");
|
|
3187
3195
|
if (!role) return void 0;
|
|
@@ -3194,6 +3202,9 @@ var validateHeadingHierarchy = (element) => {
|
|
|
3194
3202
|
if (isDeletedElement(element)) {
|
|
3195
3203
|
return errors;
|
|
3196
3204
|
}
|
|
3205
|
+
if (shouldSuppressWarning(element)) {
|
|
3206
|
+
return errors;
|
|
3207
|
+
}
|
|
3197
3208
|
const level = getHierarchyLevel(element);
|
|
3198
3209
|
if (level === void 0) {
|
|
3199
3210
|
return errors;
|
package/dist/index.mjs
CHANGED
|
@@ -3097,6 +3097,14 @@ var validatePossibleWeblinks = (root) => {
|
|
|
3097
3097
|
};
|
|
3098
3098
|
|
|
3099
3099
|
// src/validation/validateHeadingHierarchy.ts
|
|
3100
|
+
var shouldSuppressWarning = (element) => {
|
|
3101
|
+
const closestBox = closestElementBySchema({
|
|
3102
|
+
element,
|
|
3103
|
+
code: BOX_SCHEMA.code,
|
|
3104
|
+
ignoreDeletedElements: true
|
|
3105
|
+
});
|
|
3106
|
+
return !!closestBox;
|
|
3107
|
+
};
|
|
3100
3108
|
var getHierarchyLevel = (element) => {
|
|
3101
3109
|
const role = element.getAttribute("role");
|
|
3102
3110
|
if (!role) return void 0;
|
|
@@ -3109,6 +3117,9 @@ var validateHeadingHierarchy = (element) => {
|
|
|
3109
3117
|
if (isDeletedElement(element)) {
|
|
3110
3118
|
return errors;
|
|
3111
3119
|
}
|
|
3120
|
+
if (shouldSuppressWarning(element)) {
|
|
3121
|
+
return errors;
|
|
3122
|
+
}
|
|
3112
3123
|
const level = getHierarchyLevel(element);
|
|
3113
3124
|
if (level === void 0) {
|
|
3114
3125
|
return errors;
|