pro-editor-schema 0.0.1-alpha.0 → 0.0.1-alpha.2

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.d.mts CHANGED
@@ -1,5 +1,132 @@
1
+ declare enum ELEMENT_ROLE {
2
+ QUERYCOMMENTSWRAPPER = "QUERYCOMMENTSWRAPPER",
3
+ HEADING = "HEADING",
4
+ INS = "INS",
5
+ DEL = "DEL"
6
+ }
7
+ type SchemaKind = "element" | "atom" | "inline" | "group";
8
+ type FreeAttribute = string;
9
+ type RestrictedAttribute<T extends readonly string[] = readonly string[]> = {
10
+ name: string;
11
+ values: T;
12
+ defaultValue: string;
13
+ };
14
+ type AttributeDefinition<T extends readonly string[] = readonly string[]> = FreeAttribute | RestrictedAttribute<T>;
15
+ type Schema<TRequiredAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[], TOptionalAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[]> = {
16
+ kind: SchemaKind;
17
+ tag: string;
18
+ role?: ELEMENT_ROLE;
19
+ requiredAttributes: TRequiredAttributes;
20
+ optionalAttributes: TOptionalAttributes;
21
+ allowedChildTagNames: ReadonlySet<string>;
22
+ };
23
+
24
+ type schema_types_AttributeDefinition<T extends readonly string[] = readonly string[]> = AttributeDefinition<T>;
25
+ type schema_types_ELEMENT_ROLE = ELEMENT_ROLE;
26
+ declare const schema_types_ELEMENT_ROLE: typeof ELEMENT_ROLE;
27
+ type schema_types_FreeAttribute = FreeAttribute;
28
+ type schema_types_RestrictedAttribute<T extends readonly string[] = readonly string[]> = RestrictedAttribute<T>;
29
+ type schema_types_Schema<TRequiredAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[], TOptionalAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[]> = Schema<TRequiredAttributes, TOptionalAttributes>;
30
+ type schema_types_SchemaKind = SchemaKind;
31
+ declare namespace schema_types {
32
+ export { type schema_types_AttributeDefinition as AttributeDefinition, schema_types_ELEMENT_ROLE as ELEMENT_ROLE, type schema_types_FreeAttribute as FreeAttribute, type schema_types_RestrictedAttribute as RestrictedAttribute, type schema_types_Schema as Schema, type schema_types_SchemaKind as SchemaKind };
33
+ }
34
+
35
+ declare const SCHEMAS: ReadonlyArray<Schema>;
1
36
  declare const schemas: {
2
- [k: string]: any;
37
+ [k: string]: Schema;
38
+ };
39
+
40
+ declare const schemas$1_SCHEMAS: typeof SCHEMAS;
41
+ declare const schemas$1_schemas: typeof schemas;
42
+ declare namespace schemas$1 {
43
+ export { schemas$1_SCHEMAS as SCHEMAS, schemas$1_schemas as schemas };
44
+ }
45
+
46
+ declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
47
+ declare const elementSchemas: {
48
+ [k: string]: Schema;
49
+ };
50
+
51
+ declare const index$3_ELEMENT_SCHEMAS: typeof ELEMENT_SCHEMAS;
52
+ declare const index$3_elementSchemas: typeof elementSchemas;
53
+ declare namespace index$3 {
54
+ export { index$3_ELEMENT_SCHEMAS as ELEMENT_SCHEMAS, index$3_elementSchemas as elementSchemas };
55
+ }
56
+
57
+ declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
58
+ declare const groupElementSchemas: {
59
+ [k: string]: Schema;
60
+ };
61
+
62
+ declare const index$2_GROUP_ELEMENT_SCHEMAS: typeof GROUP_ELEMENT_SCHEMAS;
63
+ declare const index$2_groupElementSchemas: typeof groupElementSchemas;
64
+ declare namespace index$2 {
65
+ export { index$2_GROUP_ELEMENT_SCHEMAS as GROUP_ELEMENT_SCHEMAS, index$2_groupElementSchemas as groupElementSchemas };
66
+ }
67
+
68
+ declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
69
+ declare const inlineElementSchemas: {
70
+ [k: string]: Schema;
3
71
  };
4
72
 
5
- export { schemas };
73
+ declare const index$1_INLINE_ELEMENT_SCHEMAS: typeof INLINE_ELEMENT_SCHEMAS;
74
+ declare const index$1_inlineElementSchemas: typeof inlineElementSchemas;
75
+ declare namespace index$1 {
76
+ export { index$1_INLINE_ELEMENT_SCHEMAS as INLINE_ELEMENT_SCHEMAS, index$1_inlineElementSchemas as inlineElementSchemas };
77
+ }
78
+
79
+ declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
80
+ declare const atomSchemas: {
81
+ [k: string]: Schema;
82
+ };
83
+
84
+ declare const index_ATOM_SCHEMAS: typeof ATOM_SCHEMAS;
85
+ declare const index_atomSchemas: typeof atomSchemas;
86
+ declare namespace index {
87
+ export { index_ATOM_SCHEMAS as ATOM_SCHEMAS, index_atomSchemas as atomSchemas };
88
+ }
89
+
90
+ declare const IGNORED_ATTRIBUTES: string[];
91
+
92
+ declare const ignoredAttributes_IGNORED_ATTRIBUTES: typeof IGNORED_ATTRIBUTES;
93
+ declare namespace ignoredAttributes {
94
+ export { ignoredAttributes_IGNORED_ATTRIBUTES as IGNORED_ATTRIBUTES };
95
+ }
96
+
97
+ declare const isIgnoredAttribute: (attribute: string) => boolean;
98
+ declare const isIgnoredElement: (element: Element) => boolean;
99
+ declare const findSchemaByTag: (tagName: string) => Schema | undefined;
100
+
101
+ declare const utils_findSchemaByTag: typeof findSchemaByTag;
102
+ declare const utils_isIgnoredAttribute: typeof isIgnoredAttribute;
103
+ declare const utils_isIgnoredElement: typeof isIgnoredElement;
104
+ declare namespace utils {
105
+ export { utils_findSchemaByTag as findSchemaByTag, utils_isIgnoredAttribute as isIgnoredAttribute, utils_isIgnoredElement as isIgnoredElement };
106
+ }
107
+
108
+ declare const IGNORED_ELEMENT_SELECTORS: string[];
109
+
110
+ declare const ignoredElements_IGNORED_ELEMENT_SELECTORS: typeof IGNORED_ELEMENT_SELECTORS;
111
+ declare namespace ignoredElements {
112
+ export { ignoredElements_IGNORED_ELEMENT_SELECTORS as IGNORED_ELEMENT_SELECTORS };
113
+ }
114
+
115
+ declare const TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
116
+ declare const TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
117
+ declare const TRACK_CHANGES_ATTR_DATA_TIME = "data-time";
118
+ declare const TRACK_CHANGES_ATTR_DATA_DATE = "data-date";
119
+ declare const TRACK_CHANGES_ATTRS: readonly ["data-username", "data-userid", "data-time", "data-date"];
120
+ declare const ID_ATTRS: readonly ["store", "ele-id"];
121
+
122
+ declare const globalAttributes_ID_ATTRS: typeof ID_ATTRS;
123
+ declare const globalAttributes_TRACK_CHANGES_ATTRS: typeof TRACK_CHANGES_ATTRS;
124
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_DATE: typeof TRACK_CHANGES_ATTR_DATA_DATE;
125
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_TIME: typeof TRACK_CHANGES_ATTR_DATA_TIME;
126
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERID: typeof TRACK_CHANGES_ATTR_DATA_USERID;
127
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERNAME: typeof TRACK_CHANGES_ATTR_DATA_USERNAME;
128
+ declare namespace globalAttributes {
129
+ export { globalAttributes_ID_ATTRS as ID_ATTRS, globalAttributes_TRACK_CHANGES_ATTRS as TRACK_CHANGES_ATTRS, globalAttributes_TRACK_CHANGES_ATTR_DATA_DATE as TRACK_CHANGES_ATTR_DATA_DATE, globalAttributes_TRACK_CHANGES_ATTR_DATA_TIME as TRACK_CHANGES_ATTR_DATA_TIME, globalAttributes_TRACK_CHANGES_ATTR_DATA_USERID as TRACK_CHANGES_ATTR_DATA_USERID, globalAttributes_TRACK_CHANGES_ATTR_DATA_USERNAME as TRACK_CHANGES_ATTR_DATA_USERNAME };
130
+ }
131
+
132
+ export { globalAttributes as GlobalAttributes, globalAttributes as GlobalAttributesTypes, ignoredAttributes as IgnoredAttributes, ignoredElements as IgnoredElements, schema_types as SchemaTypes, schemas$1 as Schemas, index as SchemasAtoms, index$3 as SchemasElements, index$2 as SchemasGroupElements, index$1 as SchemasInlineElements, utils as Utils };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,132 @@
1
+ declare enum ELEMENT_ROLE {
2
+ QUERYCOMMENTSWRAPPER = "QUERYCOMMENTSWRAPPER",
3
+ HEADING = "HEADING",
4
+ INS = "INS",
5
+ DEL = "DEL"
6
+ }
7
+ type SchemaKind = "element" | "atom" | "inline" | "group";
8
+ type FreeAttribute = string;
9
+ type RestrictedAttribute<T extends readonly string[] = readonly string[]> = {
10
+ name: string;
11
+ values: T;
12
+ defaultValue: string;
13
+ };
14
+ type AttributeDefinition<T extends readonly string[] = readonly string[]> = FreeAttribute | RestrictedAttribute<T>;
15
+ type Schema<TRequiredAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[], TOptionalAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[]> = {
16
+ kind: SchemaKind;
17
+ tag: string;
18
+ role?: ELEMENT_ROLE;
19
+ requiredAttributes: TRequiredAttributes;
20
+ optionalAttributes: TOptionalAttributes;
21
+ allowedChildTagNames: ReadonlySet<string>;
22
+ };
23
+
24
+ type schema_types_AttributeDefinition<T extends readonly string[] = readonly string[]> = AttributeDefinition<T>;
25
+ type schema_types_ELEMENT_ROLE = ELEMENT_ROLE;
26
+ declare const schema_types_ELEMENT_ROLE: typeof ELEMENT_ROLE;
27
+ type schema_types_FreeAttribute = FreeAttribute;
28
+ type schema_types_RestrictedAttribute<T extends readonly string[] = readonly string[]> = RestrictedAttribute<T>;
29
+ type schema_types_Schema<TRequiredAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[], TOptionalAttributes extends readonly AttributeDefinition[] = readonly AttributeDefinition[]> = Schema<TRequiredAttributes, TOptionalAttributes>;
30
+ type schema_types_SchemaKind = SchemaKind;
31
+ declare namespace schema_types {
32
+ export { type schema_types_AttributeDefinition as AttributeDefinition, schema_types_ELEMENT_ROLE as ELEMENT_ROLE, type schema_types_FreeAttribute as FreeAttribute, type schema_types_RestrictedAttribute as RestrictedAttribute, type schema_types_Schema as Schema, type schema_types_SchemaKind as SchemaKind };
33
+ }
34
+
35
+ declare const SCHEMAS: ReadonlyArray<Schema>;
1
36
  declare const schemas: {
2
- [k: string]: any;
37
+ [k: string]: Schema;
38
+ };
39
+
40
+ declare const schemas$1_SCHEMAS: typeof SCHEMAS;
41
+ declare const schemas$1_schemas: typeof schemas;
42
+ declare namespace schemas$1 {
43
+ export { schemas$1_SCHEMAS as SCHEMAS, schemas$1_schemas as schemas };
44
+ }
45
+
46
+ declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
47
+ declare const elementSchemas: {
48
+ [k: string]: Schema;
49
+ };
50
+
51
+ declare const index$3_ELEMENT_SCHEMAS: typeof ELEMENT_SCHEMAS;
52
+ declare const index$3_elementSchemas: typeof elementSchemas;
53
+ declare namespace index$3 {
54
+ export { index$3_ELEMENT_SCHEMAS as ELEMENT_SCHEMAS, index$3_elementSchemas as elementSchemas };
55
+ }
56
+
57
+ declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
58
+ declare const groupElementSchemas: {
59
+ [k: string]: Schema;
60
+ };
61
+
62
+ declare const index$2_GROUP_ELEMENT_SCHEMAS: typeof GROUP_ELEMENT_SCHEMAS;
63
+ declare const index$2_groupElementSchemas: typeof groupElementSchemas;
64
+ declare namespace index$2 {
65
+ export { index$2_GROUP_ELEMENT_SCHEMAS as GROUP_ELEMENT_SCHEMAS, index$2_groupElementSchemas as groupElementSchemas };
66
+ }
67
+
68
+ declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
69
+ declare const inlineElementSchemas: {
70
+ [k: string]: Schema;
3
71
  };
4
72
 
5
- export { schemas };
73
+ declare const index$1_INLINE_ELEMENT_SCHEMAS: typeof INLINE_ELEMENT_SCHEMAS;
74
+ declare const index$1_inlineElementSchemas: typeof inlineElementSchemas;
75
+ declare namespace index$1 {
76
+ export { index$1_INLINE_ELEMENT_SCHEMAS as INLINE_ELEMENT_SCHEMAS, index$1_inlineElementSchemas as inlineElementSchemas };
77
+ }
78
+
79
+ declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
80
+ declare const atomSchemas: {
81
+ [k: string]: Schema;
82
+ };
83
+
84
+ declare const index_ATOM_SCHEMAS: typeof ATOM_SCHEMAS;
85
+ declare const index_atomSchemas: typeof atomSchemas;
86
+ declare namespace index {
87
+ export { index_ATOM_SCHEMAS as ATOM_SCHEMAS, index_atomSchemas as atomSchemas };
88
+ }
89
+
90
+ declare const IGNORED_ATTRIBUTES: string[];
91
+
92
+ declare const ignoredAttributes_IGNORED_ATTRIBUTES: typeof IGNORED_ATTRIBUTES;
93
+ declare namespace ignoredAttributes {
94
+ export { ignoredAttributes_IGNORED_ATTRIBUTES as IGNORED_ATTRIBUTES };
95
+ }
96
+
97
+ declare const isIgnoredAttribute: (attribute: string) => boolean;
98
+ declare const isIgnoredElement: (element: Element) => boolean;
99
+ declare const findSchemaByTag: (tagName: string) => Schema | undefined;
100
+
101
+ declare const utils_findSchemaByTag: typeof findSchemaByTag;
102
+ declare const utils_isIgnoredAttribute: typeof isIgnoredAttribute;
103
+ declare const utils_isIgnoredElement: typeof isIgnoredElement;
104
+ declare namespace utils {
105
+ export { utils_findSchemaByTag as findSchemaByTag, utils_isIgnoredAttribute as isIgnoredAttribute, utils_isIgnoredElement as isIgnoredElement };
106
+ }
107
+
108
+ declare const IGNORED_ELEMENT_SELECTORS: string[];
109
+
110
+ declare const ignoredElements_IGNORED_ELEMENT_SELECTORS: typeof IGNORED_ELEMENT_SELECTORS;
111
+ declare namespace ignoredElements {
112
+ export { ignoredElements_IGNORED_ELEMENT_SELECTORS as IGNORED_ELEMENT_SELECTORS };
113
+ }
114
+
115
+ declare const TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
116
+ declare const TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
117
+ declare const TRACK_CHANGES_ATTR_DATA_TIME = "data-time";
118
+ declare const TRACK_CHANGES_ATTR_DATA_DATE = "data-date";
119
+ declare const TRACK_CHANGES_ATTRS: readonly ["data-username", "data-userid", "data-time", "data-date"];
120
+ declare const ID_ATTRS: readonly ["store", "ele-id"];
121
+
122
+ declare const globalAttributes_ID_ATTRS: typeof ID_ATTRS;
123
+ declare const globalAttributes_TRACK_CHANGES_ATTRS: typeof TRACK_CHANGES_ATTRS;
124
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_DATE: typeof TRACK_CHANGES_ATTR_DATA_DATE;
125
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_TIME: typeof TRACK_CHANGES_ATTR_DATA_TIME;
126
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERID: typeof TRACK_CHANGES_ATTR_DATA_USERID;
127
+ declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERNAME: typeof TRACK_CHANGES_ATTR_DATA_USERNAME;
128
+ declare namespace globalAttributes {
129
+ export { globalAttributes_ID_ATTRS as ID_ATTRS, globalAttributes_TRACK_CHANGES_ATTRS as TRACK_CHANGES_ATTRS, globalAttributes_TRACK_CHANGES_ATTR_DATA_DATE as TRACK_CHANGES_ATTR_DATA_DATE, globalAttributes_TRACK_CHANGES_ATTR_DATA_TIME as TRACK_CHANGES_ATTR_DATA_TIME, globalAttributes_TRACK_CHANGES_ATTR_DATA_USERID as TRACK_CHANGES_ATTR_DATA_USERID, globalAttributes_TRACK_CHANGES_ATTR_DATA_USERNAME as TRACK_CHANGES_ATTR_DATA_USERNAME };
130
+ }
131
+
132
+ export { globalAttributes as GlobalAttributes, globalAttributes as GlobalAttributesTypes, ignoredAttributes as IgnoredAttributes, ignoredElements as IgnoredElements, schema_types as SchemaTypes, schemas$1 as Schemas, index as SchemasAtoms, index$3 as SchemasElements, index$2 as SchemasGroupElements, index$1 as SchemasInlineElements, utils as Utils };
package/dist/index.js CHANGED
@@ -20,10 +20,34 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- schemas: () => schemas
23
+ GlobalAttributes: () => globalAttributes_exports,
24
+ GlobalAttributesTypes: () => globalAttributes_exports,
25
+ IgnoredAttributes: () => ignoredAttributes_exports,
26
+ IgnoredElements: () => ignoredElements_exports,
27
+ SchemaTypes: () => schema_types_exports,
28
+ Schemas: () => schemas_exports,
29
+ SchemasAtoms: () => atoms_exports,
30
+ SchemasElements: () => elements_exports,
31
+ SchemasGroupElements: () => groupElements_exports,
32
+ SchemasInlineElements: () => inlineElements_exports,
33
+ Utils: () => utils_exports
24
34
  });
25
35
  module.exports = __toCommonJS(index_exports);
26
36
 
37
+ // src/schema/schemas.ts
38
+ var schemas_exports = {};
39
+ __export(schemas_exports, {
40
+ SCHEMAS: () => SCHEMAS,
41
+ schemas: () => schemas
42
+ });
43
+
44
+ // src/schema/elementSchemas/atoms/index.ts
45
+ var atoms_exports = {};
46
+ __export(atoms_exports, {
47
+ ATOM_SCHEMAS: () => ATOM_SCHEMAS,
48
+ atomSchemas: () => atomSchemas
49
+ });
50
+
27
51
  // src/schema/shared/createSchema.ts
28
52
  var createSchema = ({
29
53
  kind,
@@ -44,6 +68,15 @@ var createSchema = ({
44
68
  };
45
69
 
46
70
  // src/schema/shared/globalAttributes.ts
71
+ var globalAttributes_exports = {};
72
+ __export(globalAttributes_exports, {
73
+ ID_ATTRS: () => ID_ATTRS,
74
+ TRACK_CHANGES_ATTRS: () => TRACK_CHANGES_ATTRS,
75
+ TRACK_CHANGES_ATTR_DATA_DATE: () => TRACK_CHANGES_ATTR_DATA_DATE,
76
+ TRACK_CHANGES_ATTR_DATA_TIME: () => TRACK_CHANGES_ATTR_DATA_TIME,
77
+ TRACK_CHANGES_ATTR_DATA_USERID: () => TRACK_CHANGES_ATTR_DATA_USERID,
78
+ TRACK_CHANGES_ATTR_DATA_USERNAME: () => TRACK_CHANGES_ATTR_DATA_USERNAME
79
+ });
47
80
  var TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
48
81
  var TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
49
82
  var TRACK_CHANGES_ATTR_DATA_TIME = "data-time";
@@ -91,6 +124,19 @@ var B_SCHEMA = createSchema({
91
124
  allowedChildTagNames: ATOM_TAGS
92
125
  });
93
126
 
127
+ // src/schema/schema.types.ts
128
+ var schema_types_exports = {};
129
+ __export(schema_types_exports, {
130
+ ELEMENT_ROLE: () => ELEMENT_ROLE
131
+ });
132
+ var ELEMENT_ROLE = /* @__PURE__ */ ((ELEMENT_ROLE2) => {
133
+ ELEMENT_ROLE2["QUERYCOMMENTSWRAPPER"] = "QUERYCOMMENTSWRAPPER";
134
+ ELEMENT_ROLE2["HEADING"] = "HEADING";
135
+ ELEMENT_ROLE2["INS"] = "INS";
136
+ ELEMENT_ROLE2["DEL"] = "DEL";
137
+ return ELEMENT_ROLE2;
138
+ })(ELEMENT_ROLE || {});
139
+
94
140
  // src/schema/elementSchemas/atoms/commentQuerySection.ts
95
141
  var COMMENT_QUERY_SECTION_SCHEMA = createSchema({
96
142
  kind: "atom",
@@ -215,6 +261,16 @@ var ATOM_SCHEMAS = [
215
261
  INSERTION_SCHEMA,
216
262
  DELETION_SCHEMA
217
263
  ];
264
+ var atomSchemas = Object.fromEntries(
265
+ ATOM_SCHEMAS.map((schema) => [schema.tag, schema])
266
+ );
267
+
268
+ // src/schema/elementSchemas/elements/index.ts
269
+ var elements_exports = {};
270
+ __export(elements_exports, {
271
+ ELEMENT_SCHEMAS: () => ELEMENT_SCHEMAS,
272
+ elementSchemas: () => elementSchemas
273
+ });
218
274
 
219
275
  // src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
220
276
  var COMMENT_TAG = "COMMENT";
@@ -270,6 +326,16 @@ var ELEMENT_SCHEMAS = [
270
326
  PARA_SCHEMA,
271
327
  TITLE_SCHEMA
272
328
  ];
329
+ var elementSchemas = Object.fromEntries(
330
+ ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
331
+ );
332
+
333
+ // src/schema/elementSchemas/groupElements/index.ts
334
+ var groupElements_exports = {};
335
+ __export(groupElements_exports, {
336
+ GROUP_ELEMENT_SCHEMAS: () => GROUP_ELEMENT_SCHEMAS,
337
+ groupElementSchemas: () => groupElementSchemas
338
+ });
273
339
 
274
340
  // src/schema/elementSchemas/groupElements/groupElementsTags.ts
275
341
  var SECTION_TAG = "SECTION1";
@@ -294,6 +360,16 @@ var SECTION_SCHEMA = createSchema({
294
360
 
295
361
  // src/schema/elementSchemas/groupElements/index.ts
296
362
  var GROUP_ELEMENT_SCHEMAS = [SECTION_SCHEMA];
363
+ var groupElementSchemas = Object.fromEntries(
364
+ GROUP_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
365
+ );
366
+
367
+ // src/schema/elementSchemas/inlineElements/index.ts
368
+ var inlineElements_exports = {};
369
+ __export(inlineElements_exports, {
370
+ INLINE_ELEMENT_SCHEMAS: () => INLINE_ELEMENT_SCHEMAS,
371
+ inlineElementSchemas: () => inlineElementSchemas
372
+ });
297
373
 
298
374
  // src/schema/elementSchemas/inlineElements/comment.ts
299
375
  var COMMENT_SCHEMA = createSchema({
@@ -417,6 +493,9 @@ var INLINE_ELEMENT_SCHEMAS = [
417
493
  CONTENT_SCHEMA,
418
494
  REPLY_SCHEMA
419
495
  ];
496
+ var inlineElementSchemas = Object.fromEntries(
497
+ INLINE_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
498
+ );
420
499
 
421
500
  // src/schema/schemas.ts
422
501
  var SCHEMAS = [
@@ -425,16 +504,67 @@ var SCHEMAS = [
425
504
  ...GROUP_ELEMENT_SCHEMAS,
426
505
  ...INLINE_ELEMENT_SCHEMAS
427
506
  ];
428
-
429
- // src/index.ts
430
- var replacer = (_key, value) => value instanceof Set ? { __type: "Set", values: [...value] } : value;
431
507
  var schemas = Object.fromEntries(
432
- SCHEMAS.map((schema) => [
433
- schema.tag,
434
- JSON.parse(JSON.stringify(schema, replacer))
435
- ])
508
+ SCHEMAS.map((schema) => [schema.tag, schema])
436
509
  );
510
+
511
+ // src/schema/shared/ignoredAttributes.ts
512
+ var ignoredAttributes_exports = {};
513
+ __export(ignoredAttributes_exports, {
514
+ IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES
515
+ });
516
+ var IGNORED_ATTRIBUTES = [
517
+ // Styling & layout
518
+ "class",
519
+ "style",
520
+ // Editor state
521
+ "contenteditable",
522
+ "draggable",
523
+ "tabindex",
524
+ // Browser behaviour
525
+ "spellcheck",
526
+ "translate",
527
+ "lang",
528
+ "dir",
529
+ "hidden"
530
+ ];
531
+
532
+ // src/schema/shared/utils.ts
533
+ var utils_exports = {};
534
+ __export(utils_exports, {
535
+ findSchemaByTag: () => findSchemaByTag,
536
+ isIgnoredAttribute: () => isIgnoredAttribute,
537
+ isIgnoredElement: () => isIgnoredElement
538
+ });
539
+
540
+ // src/schema/shared/ignoredElements.ts
541
+ var ignoredElements_exports = {};
542
+ __export(ignoredElements_exports, {
543
+ IGNORED_ELEMENT_SELECTORS: () => IGNORED_ELEMENT_SELECTORS
544
+ });
545
+ var IGNORED_ELEMENT_SELECTORS = [
546
+ "span.rhlabel",
547
+ "span.abstractlabel",
548
+ "span.refIcon",
549
+ "span.missLink",
550
+ "span.ref-drag"
551
+ ];
552
+
553
+ // src/schema/shared/utils.ts
554
+ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute);
555
+ var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
556
+ var findSchemaByTag = (tagName) => SCHEMAS.find((schema) => schema.tag === tagName.toLowerCase());
437
557
  // Annotate the CommonJS export names for ESM import in node:
438
558
  0 && (module.exports = {
439
- schemas
559
+ GlobalAttributes,
560
+ GlobalAttributesTypes,
561
+ IgnoredAttributes,
562
+ IgnoredElements,
563
+ SchemaTypes,
564
+ Schemas,
565
+ SchemasAtoms,
566
+ SchemasElements,
567
+ SchemasGroupElements,
568
+ SchemasInlineElements,
569
+ Utils
440
570
  });
package/dist/index.mjs CHANGED
@@ -1,3 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/schema/schemas.ts
8
+ var schemas_exports = {};
9
+ __export(schemas_exports, {
10
+ SCHEMAS: () => SCHEMAS,
11
+ schemas: () => schemas
12
+ });
13
+
14
+ // src/schema/elementSchemas/atoms/index.ts
15
+ var atoms_exports = {};
16
+ __export(atoms_exports, {
17
+ ATOM_SCHEMAS: () => ATOM_SCHEMAS,
18
+ atomSchemas: () => atomSchemas
19
+ });
20
+
1
21
  // src/schema/shared/createSchema.ts
2
22
  var createSchema = ({
3
23
  kind,
@@ -18,6 +38,15 @@ var createSchema = ({
18
38
  };
19
39
 
20
40
  // src/schema/shared/globalAttributes.ts
41
+ var globalAttributes_exports = {};
42
+ __export(globalAttributes_exports, {
43
+ ID_ATTRS: () => ID_ATTRS,
44
+ TRACK_CHANGES_ATTRS: () => TRACK_CHANGES_ATTRS,
45
+ TRACK_CHANGES_ATTR_DATA_DATE: () => TRACK_CHANGES_ATTR_DATA_DATE,
46
+ TRACK_CHANGES_ATTR_DATA_TIME: () => TRACK_CHANGES_ATTR_DATA_TIME,
47
+ TRACK_CHANGES_ATTR_DATA_USERID: () => TRACK_CHANGES_ATTR_DATA_USERID,
48
+ TRACK_CHANGES_ATTR_DATA_USERNAME: () => TRACK_CHANGES_ATTR_DATA_USERNAME
49
+ });
21
50
  var TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
22
51
  var TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
23
52
  var TRACK_CHANGES_ATTR_DATA_TIME = "data-time";
@@ -65,6 +94,19 @@ var B_SCHEMA = createSchema({
65
94
  allowedChildTagNames: ATOM_TAGS
66
95
  });
67
96
 
97
+ // src/schema/schema.types.ts
98
+ var schema_types_exports = {};
99
+ __export(schema_types_exports, {
100
+ ELEMENT_ROLE: () => ELEMENT_ROLE
101
+ });
102
+ var ELEMENT_ROLE = /* @__PURE__ */ ((ELEMENT_ROLE2) => {
103
+ ELEMENT_ROLE2["QUERYCOMMENTSWRAPPER"] = "QUERYCOMMENTSWRAPPER";
104
+ ELEMENT_ROLE2["HEADING"] = "HEADING";
105
+ ELEMENT_ROLE2["INS"] = "INS";
106
+ ELEMENT_ROLE2["DEL"] = "DEL";
107
+ return ELEMENT_ROLE2;
108
+ })(ELEMENT_ROLE || {});
109
+
68
110
  // src/schema/elementSchemas/atoms/commentQuerySection.ts
69
111
  var COMMENT_QUERY_SECTION_SCHEMA = createSchema({
70
112
  kind: "atom",
@@ -189,6 +231,16 @@ var ATOM_SCHEMAS = [
189
231
  INSERTION_SCHEMA,
190
232
  DELETION_SCHEMA
191
233
  ];
234
+ var atomSchemas = Object.fromEntries(
235
+ ATOM_SCHEMAS.map((schema) => [schema.tag, schema])
236
+ );
237
+
238
+ // src/schema/elementSchemas/elements/index.ts
239
+ var elements_exports = {};
240
+ __export(elements_exports, {
241
+ ELEMENT_SCHEMAS: () => ELEMENT_SCHEMAS,
242
+ elementSchemas: () => elementSchemas
243
+ });
192
244
 
193
245
  // src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
194
246
  var COMMENT_TAG = "COMMENT";
@@ -244,6 +296,16 @@ var ELEMENT_SCHEMAS = [
244
296
  PARA_SCHEMA,
245
297
  TITLE_SCHEMA
246
298
  ];
299
+ var elementSchemas = Object.fromEntries(
300
+ ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
301
+ );
302
+
303
+ // src/schema/elementSchemas/groupElements/index.ts
304
+ var groupElements_exports = {};
305
+ __export(groupElements_exports, {
306
+ GROUP_ELEMENT_SCHEMAS: () => GROUP_ELEMENT_SCHEMAS,
307
+ groupElementSchemas: () => groupElementSchemas
308
+ });
247
309
 
248
310
  // src/schema/elementSchemas/groupElements/groupElementsTags.ts
249
311
  var SECTION_TAG = "SECTION1";
@@ -268,6 +330,16 @@ var SECTION_SCHEMA = createSchema({
268
330
 
269
331
  // src/schema/elementSchemas/groupElements/index.ts
270
332
  var GROUP_ELEMENT_SCHEMAS = [SECTION_SCHEMA];
333
+ var groupElementSchemas = Object.fromEntries(
334
+ GROUP_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
335
+ );
336
+
337
+ // src/schema/elementSchemas/inlineElements/index.ts
338
+ var inlineElements_exports = {};
339
+ __export(inlineElements_exports, {
340
+ INLINE_ELEMENT_SCHEMAS: () => INLINE_ELEMENT_SCHEMAS,
341
+ inlineElementSchemas: () => inlineElementSchemas
342
+ });
271
343
 
272
344
  // src/schema/elementSchemas/inlineElements/comment.ts
273
345
  var COMMENT_SCHEMA = createSchema({
@@ -391,6 +463,9 @@ var INLINE_ELEMENT_SCHEMAS = [
391
463
  CONTENT_SCHEMA,
392
464
  REPLY_SCHEMA
393
465
  ];
466
+ var inlineElementSchemas = Object.fromEntries(
467
+ INLINE_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
468
+ );
394
469
 
395
470
  // src/schema/schemas.ts
396
471
  var SCHEMAS = [
@@ -399,15 +474,66 @@ var SCHEMAS = [
399
474
  ...GROUP_ELEMENT_SCHEMAS,
400
475
  ...INLINE_ELEMENT_SCHEMAS
401
476
  ];
402
-
403
- // src/index.ts
404
- var replacer = (_key, value) => value instanceof Set ? { __type: "Set", values: [...value] } : value;
405
477
  var schemas = Object.fromEntries(
406
- SCHEMAS.map((schema) => [
407
- schema.tag,
408
- JSON.parse(JSON.stringify(schema, replacer))
409
- ])
478
+ SCHEMAS.map((schema) => [schema.tag, schema])
410
479
  );
480
+
481
+ // src/schema/shared/ignoredAttributes.ts
482
+ var ignoredAttributes_exports = {};
483
+ __export(ignoredAttributes_exports, {
484
+ IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES
485
+ });
486
+ var IGNORED_ATTRIBUTES = [
487
+ // Styling & layout
488
+ "class",
489
+ "style",
490
+ // Editor state
491
+ "contenteditable",
492
+ "draggable",
493
+ "tabindex",
494
+ // Browser behaviour
495
+ "spellcheck",
496
+ "translate",
497
+ "lang",
498
+ "dir",
499
+ "hidden"
500
+ ];
501
+
502
+ // src/schema/shared/utils.ts
503
+ var utils_exports = {};
504
+ __export(utils_exports, {
505
+ findSchemaByTag: () => findSchemaByTag,
506
+ isIgnoredAttribute: () => isIgnoredAttribute,
507
+ isIgnoredElement: () => isIgnoredElement
508
+ });
509
+
510
+ // src/schema/shared/ignoredElements.ts
511
+ var ignoredElements_exports = {};
512
+ __export(ignoredElements_exports, {
513
+ IGNORED_ELEMENT_SELECTORS: () => IGNORED_ELEMENT_SELECTORS
514
+ });
515
+ var IGNORED_ELEMENT_SELECTORS = [
516
+ "span.rhlabel",
517
+ "span.abstractlabel",
518
+ "span.refIcon",
519
+ "span.missLink",
520
+ "span.ref-drag"
521
+ ];
522
+
523
+ // src/schema/shared/utils.ts
524
+ var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute);
525
+ var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
526
+ var findSchemaByTag = (tagName) => SCHEMAS.find((schema) => schema.tag === tagName.toLowerCase());
411
527
  export {
412
- schemas
528
+ globalAttributes_exports as GlobalAttributes,
529
+ globalAttributes_exports as GlobalAttributesTypes,
530
+ ignoredAttributes_exports as IgnoredAttributes,
531
+ ignoredElements_exports as IgnoredElements,
532
+ schema_types_exports as SchemaTypes,
533
+ schemas_exports as Schemas,
534
+ atoms_exports as SchemasAtoms,
535
+ elements_exports as SchemasElements,
536
+ groupElements_exports as SchemasGroupElements,
537
+ inlineElements_exports as SchemasInlineElements,
538
+ utils_exports as Utils
413
539
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-editor-schema",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.1-alpha.2",
4
4
  "description": "Pro Editor XML schemas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",