pro-editor-schema 0.1.190 → 0.1.191

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 CHANGED
@@ -404,8 +404,8 @@ var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
404
404
  "secondEntry",
405
405
  "thirdEntry",
406
406
  "entry",
407
- STORE_ATTRIBUTE,
408
- "linkend"
407
+ "linkend",
408
+ ...ID_ATTRS
409
409
  ];
410
410
  var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
411
411
  name: "index-position",
@@ -421,7 +421,7 @@ var SEE_REQUIRED_ATTRIBUTES = [
421
421
  values: ["see", "see-also"],
422
422
  defaultValue: ""
423
423
  },
424
- STORE_ATTRIBUTE,
424
+ ...ID_ATTRS,
425
425
  "data-date",
426
426
  "crossref-firstEntry",
427
427
  "crossref-secondEntry",
@@ -459,7 +459,7 @@ var INDEXTERM_SCHEMA = createSchema({
459
459
  values: ["PRIMARY", "SECONDARY", "TERTIARY", "QUATERNARY"],
460
460
  defaultValue: "PRIMARY"
461
461
  },
462
- STORE_ATTRIBUTE
462
+ ...ID_ATTRS
463
463
  ],
464
464
  optionalAttributes: [],
465
465
  allowedChildTagNames: [
@@ -2386,20 +2386,28 @@ var findSchemaByElement = (element) => {
2386
2386
  const isDeletion = element.classList.contains("del");
2387
2387
  const isQueryComment = element.classList.contains("cmtQurySection");
2388
2388
  const role = element.getAttribute("role");
2389
- if (isQueryComment && tagName === SPAN_TAG) {
2390
- return findSchemaByCode("commentQuerySection");
2391
- }
2392
- if (isInsertion && tagName === SPAN_TAG) {
2393
- return findSchemaByCode("insertion");
2394
- }
2395
- if (isDeletion && tagName === SPAN_TAG) {
2396
- return findSchemaByCode("deletion");
2389
+ if (tagName === SPAN_TAG) {
2390
+ if (isQueryComment) {
2391
+ return findSchemaByCode("commentQuerySection");
2392
+ }
2393
+ if (isInsertion) {
2394
+ return findSchemaByCode("insertion");
2395
+ }
2396
+ if (isDeletion) {
2397
+ return findSchemaByCode("deletion");
2398
+ }
2397
2399
  }
2398
- if (role && tagName === SECTION_TAG) {
2399
- if (role.startsWith("H")) {
2400
- return findSchemaByCode("heading");
2400
+ if (tagName === SECTION_TAG) {
2401
+ if (role) {
2402
+ if (role.startsWith("H")) {
2403
+ return findSchemaByCode("heading");
2404
+ }
2405
+ if (role === "ch" || role === "bk") {
2406
+ return findSchemaByCode("footnoteSection");
2407
+ }
2401
2408
  }
2402
- if (role === "ch" || role === "bk") {
2409
+ const isFootnoteSectionWithoutRole = element.querySelector(FOOTNOTE_TAG);
2410
+ if (isFootnoteSectionWithoutRole) {
2403
2411
  return findSchemaByCode("footnoteSection");
2404
2412
  }
2405
2413
  }
package/dist/index.mjs CHANGED
@@ -340,8 +340,8 @@ var INDEX_TERM_ENTRY_REQUIRED_ATTRIBUTES = [
340
340
  "secondEntry",
341
341
  "thirdEntry",
342
342
  "entry",
343
- STORE_ATTRIBUTE,
344
- "linkend"
343
+ "linkend",
344
+ ...ID_ATTRS
345
345
  ];
346
346
  var BOOKMARK_INDEX_POSITION_ATTRIBUTE = {
347
347
  name: "index-position",
@@ -357,7 +357,7 @@ var SEE_REQUIRED_ATTRIBUTES = [
357
357
  values: ["see", "see-also"],
358
358
  defaultValue: ""
359
359
  },
360
- STORE_ATTRIBUTE,
360
+ ...ID_ATTRS,
361
361
  "data-date",
362
362
  "crossref-firstEntry",
363
363
  "crossref-secondEntry",
@@ -395,7 +395,7 @@ var INDEXTERM_SCHEMA = createSchema({
395
395
  values: ["PRIMARY", "SECONDARY", "TERTIARY", "QUATERNARY"],
396
396
  defaultValue: "PRIMARY"
397
397
  },
398
- STORE_ATTRIBUTE
398
+ ...ID_ATTRS
399
399
  ],
400
400
  optionalAttributes: [],
401
401
  allowedChildTagNames: [
@@ -2322,20 +2322,28 @@ var findSchemaByElement = (element) => {
2322
2322
  const isDeletion = element.classList.contains("del");
2323
2323
  const isQueryComment = element.classList.contains("cmtQurySection");
2324
2324
  const role = element.getAttribute("role");
2325
- if (isQueryComment && tagName === SPAN_TAG) {
2326
- return findSchemaByCode("commentQuerySection");
2327
- }
2328
- if (isInsertion && tagName === SPAN_TAG) {
2329
- return findSchemaByCode("insertion");
2330
- }
2331
- if (isDeletion && tagName === SPAN_TAG) {
2332
- return findSchemaByCode("deletion");
2325
+ if (tagName === SPAN_TAG) {
2326
+ if (isQueryComment) {
2327
+ return findSchemaByCode("commentQuerySection");
2328
+ }
2329
+ if (isInsertion) {
2330
+ return findSchemaByCode("insertion");
2331
+ }
2332
+ if (isDeletion) {
2333
+ return findSchemaByCode("deletion");
2334
+ }
2333
2335
  }
2334
- if (role && tagName === SECTION_TAG) {
2335
- if (role.startsWith("H")) {
2336
- return findSchemaByCode("heading");
2336
+ if (tagName === SECTION_TAG) {
2337
+ if (role) {
2338
+ if (role.startsWith("H")) {
2339
+ return findSchemaByCode("heading");
2340
+ }
2341
+ if (role === "ch" || role === "bk") {
2342
+ return findSchemaByCode("footnoteSection");
2343
+ }
2337
2344
  }
2338
- if (role === "ch" || role === "bk") {
2345
+ const isFootnoteSectionWithoutRole = element.querySelector(FOOTNOTE_TAG);
2346
+ if (isFootnoteSectionWithoutRole) {
2339
2347
  return findSchemaByCode("footnoteSection");
2340
2348
  }
2341
2349
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-editor-schema",
3
- "version": "0.1.190",
3
+ "version": "0.1.191",
4
4
  "description": "Pro Editor XML schemas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",