pro-editor-schema 0.0.1-alpha.3 → 0.0.1-alpha.6

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
@@ -6,13 +6,13 @@ declare enum ELEMENT_ROLE {
6
6
  }
7
7
  type SchemaKind = "element" | "atom" | "inline" | "group";
8
8
  type FreeAttribute = string;
9
- type RestrictedAttribute<T extends readonly string[] = readonly string[]> = {
9
+ type RestrictedAttribute<T = readonly string[]> = {
10
10
  name: string;
11
11
  values: T;
12
12
  defaultValue: string;
13
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[]> = {
14
+ type AttributeDefinition<T = readonly string[]> = FreeAttribute | RestrictedAttribute<T>;
15
+ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttributes = readonly AttributeDefinition[]> = {
16
16
  kind: SchemaKind;
17
17
  tag: string;
18
18
  role?: ELEMENT_ROLE;
@@ -21,80 +21,8 @@ type Schema<TRequiredAttributes extends readonly AttributeDefinition[] = readonl
21
21
  allowedChildTagNames: ReadonlySet<string>;
22
22
  };
23
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
24
  declare const SCHEMAS: ReadonlyArray<Schema>;
36
25
  declare const SCHEMA_MAP: Map<string, Schema>;
37
- declare const schemas: {
38
- [k: string]: Schema;
39
- };
40
-
41
- declare const schemas$1_SCHEMAS: typeof SCHEMAS;
42
- declare const schemas$1_SCHEMA_MAP: typeof SCHEMA_MAP;
43
- declare const schemas$1_schemas: typeof schemas;
44
- declare namespace schemas$1 {
45
- export { schemas$1_SCHEMAS as SCHEMAS, schemas$1_SCHEMA_MAP as SCHEMA_MAP, schemas$1_schemas as schemas };
46
- }
47
-
48
- declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
49
- declare const elementSchemas: {
50
- [k: string]: Schema;
51
- };
52
-
53
- declare const index$3_ELEMENT_SCHEMAS: typeof ELEMENT_SCHEMAS;
54
- declare const index$3_elementSchemas: typeof elementSchemas;
55
- declare namespace index$3 {
56
- export { index$3_ELEMENT_SCHEMAS as ELEMENT_SCHEMAS, index$3_elementSchemas as elementSchemas };
57
- }
58
-
59
- declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
60
- declare const groupElementSchemas: {
61
- [k: string]: Schema;
62
- };
63
-
64
- declare const index$2_GROUP_ELEMENT_SCHEMAS: typeof GROUP_ELEMENT_SCHEMAS;
65
- declare const index$2_groupElementSchemas: typeof groupElementSchemas;
66
- declare namespace index$2 {
67
- export { index$2_GROUP_ELEMENT_SCHEMAS as GROUP_ELEMENT_SCHEMAS, index$2_groupElementSchemas as groupElementSchemas };
68
- }
69
-
70
- declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
71
- declare const inlineElementSchemas: {
72
- [k: string]: Schema;
73
- };
74
-
75
- declare const index$1_INLINE_ELEMENT_SCHEMAS: typeof INLINE_ELEMENT_SCHEMAS;
76
- declare const index$1_inlineElementSchemas: typeof inlineElementSchemas;
77
- declare namespace index$1 {
78
- export { index$1_INLINE_ELEMENT_SCHEMAS as INLINE_ELEMENT_SCHEMAS, index$1_inlineElementSchemas as inlineElementSchemas };
79
- }
80
-
81
- declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
82
- declare const atomSchemas: {
83
- [k: string]: Schema;
84
- };
85
-
86
- declare const index_ATOM_SCHEMAS: typeof ATOM_SCHEMAS;
87
- declare const index_atomSchemas: typeof atomSchemas;
88
- declare namespace index {
89
- export { index_ATOM_SCHEMAS as ATOM_SCHEMAS, index_atomSchemas as atomSchemas };
90
- }
91
-
92
- declare const IGNORED_ATTRIBUTES: string[];
93
-
94
- declare const ignoredAttributes_IGNORED_ATTRIBUTES: typeof IGNORED_ATTRIBUTES;
95
- declare namespace ignoredAttributes {
96
- export { ignoredAttributes_IGNORED_ATTRIBUTES as IGNORED_ATTRIBUTES };
97
- }
98
26
 
99
27
  declare const isIgnoredAttribute: (attribute: string) => boolean;
100
28
  declare const isIgnoredElement: (element: Element) => boolean;
@@ -103,22 +31,9 @@ declare const isAttributeRestricted: (attr: AttributeDefinition) => attr is Rest
103
31
  declare const getAttributeName: (attribute: AttributeDefinition) => string;
104
32
  declare const findAttributeDefinitionByName: (definitions: readonly AttributeDefinition[], name: string) => AttributeDefinition | undefined;
105
33
 
106
- declare const utils_findAttributeDefinitionByName: typeof findAttributeDefinitionByName;
107
- declare const utils_findSchemaByTag: typeof findSchemaByTag;
108
- declare const utils_getAttributeName: typeof getAttributeName;
109
- declare const utils_isAttributeRestricted: typeof isAttributeRestricted;
110
- declare const utils_isIgnoredAttribute: typeof isIgnoredAttribute;
111
- declare const utils_isIgnoredElement: typeof isIgnoredElement;
112
- declare namespace utils {
113
- export { utils_findAttributeDefinitionByName as findAttributeDefinitionByName, utils_findSchemaByTag as findSchemaByTag, utils_getAttributeName as getAttributeName, utils_isAttributeRestricted as isAttributeRestricted, utils_isIgnoredAttribute as isIgnoredAttribute, utils_isIgnoredElement as isIgnoredElement };
114
- }
115
-
116
34
  declare const IGNORED_ELEMENT_SELECTORS: string[];
117
35
 
118
- declare const ignoredElements_IGNORED_ELEMENT_SELECTORS: typeof IGNORED_ELEMENT_SELECTORS;
119
- declare namespace ignoredElements {
120
- export { ignoredElements_IGNORED_ELEMENT_SELECTORS as IGNORED_ELEMENT_SELECTORS };
121
- }
36
+ declare const IGNORED_ATTRIBUTES: string[];
122
37
 
123
38
  declare const TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
124
39
  declare const TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
@@ -127,14 +42,26 @@ declare const TRACK_CHANGES_ATTR_DATA_DATE = "data-date";
127
42
  declare const TRACK_CHANGES_ATTRS: readonly ["data-username", "data-userid", "data-time", "data-date"];
128
43
  declare const ID_ATTRS: readonly ["store", "ele-id"];
129
44
 
130
- declare const globalAttributes_ID_ATTRS: typeof ID_ATTRS;
131
- declare const globalAttributes_TRACK_CHANGES_ATTRS: typeof TRACK_CHANGES_ATTRS;
132
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_DATE: typeof TRACK_CHANGES_ATTR_DATA_DATE;
133
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_TIME: typeof TRACK_CHANGES_ATTR_DATA_TIME;
134
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERID: typeof TRACK_CHANGES_ATTR_DATA_USERID;
135
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERNAME: typeof TRACK_CHANGES_ATTR_DATA_USERNAME;
136
- declare namespace globalAttributes {
137
- 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 };
138
- }
45
+ declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
46
+
47
+ declare const PARA_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
48
+
49
+ declare const TITLE_SCHEMA: Schema<readonly ["store", "ele-id", {
50
+ readonly name: "title";
51
+ readonly values: readonly ["H1", "H2", "H3", "H4", "H5", "H6"];
52
+ readonly defaultValue: "H1";
53
+ }], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
54
+
55
+ declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
56
+
57
+ declare const SECTION_SCHEMA: Schema<readonly ["store", "ele-id", "xmlid", {
58
+ readonly name: "role";
59
+ readonly values: readonly ["H1", "H2", "H3", "H4", "H5", "H6"];
60
+ readonly defaultValue: "H1";
61
+ }], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
62
+
63
+ declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
64
+
65
+ declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
139
66
 
140
- export { globalAttributes as GlobalAttributes, 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 };
67
+ export { ATOM_SCHEMAS, type AttributeDefinition, ELEMENT_ROLE, ELEMENT_SCHEMAS, type FreeAttribute, GROUP_ELEMENT_SCHEMAS, ID_ATTRS, IGNORED_ATTRIBUTES, IGNORED_ELEMENT_SELECTORS, INLINE_ELEMENT_SCHEMAS, PARA_SCHEMA, type RestrictedAttribute, SCHEMAS, SCHEMA_MAP, SECTION_SCHEMA, type Schema, type SchemaKind, TITLE_SCHEMA, TRACK_CHANGES_ATTRS, TRACK_CHANGES_ATTR_DATA_DATE, TRACK_CHANGES_ATTR_DATA_TIME, TRACK_CHANGES_ATTR_DATA_USERID, TRACK_CHANGES_ATTR_DATA_USERNAME, findAttributeDefinitionByName, findSchemaByTag, getAttributeName, isAttributeRestricted, isIgnoredAttribute, isIgnoredElement };
package/dist/index.d.ts CHANGED
@@ -6,13 +6,13 @@ declare enum ELEMENT_ROLE {
6
6
  }
7
7
  type SchemaKind = "element" | "atom" | "inline" | "group";
8
8
  type FreeAttribute = string;
9
- type RestrictedAttribute<T extends readonly string[] = readonly string[]> = {
9
+ type RestrictedAttribute<T = readonly string[]> = {
10
10
  name: string;
11
11
  values: T;
12
12
  defaultValue: string;
13
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[]> = {
14
+ type AttributeDefinition<T = readonly string[]> = FreeAttribute | RestrictedAttribute<T>;
15
+ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttributes = readonly AttributeDefinition[]> = {
16
16
  kind: SchemaKind;
17
17
  tag: string;
18
18
  role?: ELEMENT_ROLE;
@@ -21,80 +21,8 @@ type Schema<TRequiredAttributes extends readonly AttributeDefinition[] = readonl
21
21
  allowedChildTagNames: ReadonlySet<string>;
22
22
  };
23
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
24
  declare const SCHEMAS: ReadonlyArray<Schema>;
36
25
  declare const SCHEMA_MAP: Map<string, Schema>;
37
- declare const schemas: {
38
- [k: string]: Schema;
39
- };
40
-
41
- declare const schemas$1_SCHEMAS: typeof SCHEMAS;
42
- declare const schemas$1_SCHEMA_MAP: typeof SCHEMA_MAP;
43
- declare const schemas$1_schemas: typeof schemas;
44
- declare namespace schemas$1 {
45
- export { schemas$1_SCHEMAS as SCHEMAS, schemas$1_SCHEMA_MAP as SCHEMA_MAP, schemas$1_schemas as schemas };
46
- }
47
-
48
- declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
49
- declare const elementSchemas: {
50
- [k: string]: Schema;
51
- };
52
-
53
- declare const index$3_ELEMENT_SCHEMAS: typeof ELEMENT_SCHEMAS;
54
- declare const index$3_elementSchemas: typeof elementSchemas;
55
- declare namespace index$3 {
56
- export { index$3_ELEMENT_SCHEMAS as ELEMENT_SCHEMAS, index$3_elementSchemas as elementSchemas };
57
- }
58
-
59
- declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
60
- declare const groupElementSchemas: {
61
- [k: string]: Schema;
62
- };
63
-
64
- declare const index$2_GROUP_ELEMENT_SCHEMAS: typeof GROUP_ELEMENT_SCHEMAS;
65
- declare const index$2_groupElementSchemas: typeof groupElementSchemas;
66
- declare namespace index$2 {
67
- export { index$2_GROUP_ELEMENT_SCHEMAS as GROUP_ELEMENT_SCHEMAS, index$2_groupElementSchemas as groupElementSchemas };
68
- }
69
-
70
- declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
71
- declare const inlineElementSchemas: {
72
- [k: string]: Schema;
73
- };
74
-
75
- declare const index$1_INLINE_ELEMENT_SCHEMAS: typeof INLINE_ELEMENT_SCHEMAS;
76
- declare const index$1_inlineElementSchemas: typeof inlineElementSchemas;
77
- declare namespace index$1 {
78
- export { index$1_INLINE_ELEMENT_SCHEMAS as INLINE_ELEMENT_SCHEMAS, index$1_inlineElementSchemas as inlineElementSchemas };
79
- }
80
-
81
- declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
82
- declare const atomSchemas: {
83
- [k: string]: Schema;
84
- };
85
-
86
- declare const index_ATOM_SCHEMAS: typeof ATOM_SCHEMAS;
87
- declare const index_atomSchemas: typeof atomSchemas;
88
- declare namespace index {
89
- export { index_ATOM_SCHEMAS as ATOM_SCHEMAS, index_atomSchemas as atomSchemas };
90
- }
91
-
92
- declare const IGNORED_ATTRIBUTES: string[];
93
-
94
- declare const ignoredAttributes_IGNORED_ATTRIBUTES: typeof IGNORED_ATTRIBUTES;
95
- declare namespace ignoredAttributes {
96
- export { ignoredAttributes_IGNORED_ATTRIBUTES as IGNORED_ATTRIBUTES };
97
- }
98
26
 
99
27
  declare const isIgnoredAttribute: (attribute: string) => boolean;
100
28
  declare const isIgnoredElement: (element: Element) => boolean;
@@ -103,22 +31,9 @@ declare const isAttributeRestricted: (attr: AttributeDefinition) => attr is Rest
103
31
  declare const getAttributeName: (attribute: AttributeDefinition) => string;
104
32
  declare const findAttributeDefinitionByName: (definitions: readonly AttributeDefinition[], name: string) => AttributeDefinition | undefined;
105
33
 
106
- declare const utils_findAttributeDefinitionByName: typeof findAttributeDefinitionByName;
107
- declare const utils_findSchemaByTag: typeof findSchemaByTag;
108
- declare const utils_getAttributeName: typeof getAttributeName;
109
- declare const utils_isAttributeRestricted: typeof isAttributeRestricted;
110
- declare const utils_isIgnoredAttribute: typeof isIgnoredAttribute;
111
- declare const utils_isIgnoredElement: typeof isIgnoredElement;
112
- declare namespace utils {
113
- export { utils_findAttributeDefinitionByName as findAttributeDefinitionByName, utils_findSchemaByTag as findSchemaByTag, utils_getAttributeName as getAttributeName, utils_isAttributeRestricted as isAttributeRestricted, utils_isIgnoredAttribute as isIgnoredAttribute, utils_isIgnoredElement as isIgnoredElement };
114
- }
115
-
116
34
  declare const IGNORED_ELEMENT_SELECTORS: string[];
117
35
 
118
- declare const ignoredElements_IGNORED_ELEMENT_SELECTORS: typeof IGNORED_ELEMENT_SELECTORS;
119
- declare namespace ignoredElements {
120
- export { ignoredElements_IGNORED_ELEMENT_SELECTORS as IGNORED_ELEMENT_SELECTORS };
121
- }
36
+ declare const IGNORED_ATTRIBUTES: string[];
122
37
 
123
38
  declare const TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
124
39
  declare const TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
@@ -127,14 +42,26 @@ declare const TRACK_CHANGES_ATTR_DATA_DATE = "data-date";
127
42
  declare const TRACK_CHANGES_ATTRS: readonly ["data-username", "data-userid", "data-time", "data-date"];
128
43
  declare const ID_ATTRS: readonly ["store", "ele-id"];
129
44
 
130
- declare const globalAttributes_ID_ATTRS: typeof ID_ATTRS;
131
- declare const globalAttributes_TRACK_CHANGES_ATTRS: typeof TRACK_CHANGES_ATTRS;
132
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_DATE: typeof TRACK_CHANGES_ATTR_DATA_DATE;
133
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_TIME: typeof TRACK_CHANGES_ATTR_DATA_TIME;
134
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERID: typeof TRACK_CHANGES_ATTR_DATA_USERID;
135
- declare const globalAttributes_TRACK_CHANGES_ATTR_DATA_USERNAME: typeof TRACK_CHANGES_ATTR_DATA_USERNAME;
136
- declare namespace globalAttributes {
137
- 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 };
138
- }
45
+ declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
46
+
47
+ declare const PARA_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
48
+
49
+ declare const TITLE_SCHEMA: Schema<readonly ["store", "ele-id", {
50
+ readonly name: "title";
51
+ readonly values: readonly ["H1", "H2", "H3", "H4", "H5", "H6"];
52
+ readonly defaultValue: "H1";
53
+ }], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
54
+
55
+ declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
56
+
57
+ declare const SECTION_SCHEMA: Schema<readonly ["store", "ele-id", "xmlid", {
58
+ readonly name: "role";
59
+ readonly values: readonly ["H1", "H2", "H3", "H4", "H5", "H6"];
60
+ readonly defaultValue: "H1";
61
+ }], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
62
+
63
+ declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
64
+
65
+ declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
139
66
 
140
- export { globalAttributes as GlobalAttributes, 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 };
67
+ export { ATOM_SCHEMAS, type AttributeDefinition, ELEMENT_ROLE, ELEMENT_SCHEMAS, type FreeAttribute, GROUP_ELEMENT_SCHEMAS, ID_ATTRS, IGNORED_ATTRIBUTES, IGNORED_ELEMENT_SELECTORS, INLINE_ELEMENT_SCHEMAS, PARA_SCHEMA, type RestrictedAttribute, SCHEMAS, SCHEMA_MAP, SECTION_SCHEMA, type Schema, type SchemaKind, TITLE_SCHEMA, TRACK_CHANGES_ATTRS, TRACK_CHANGES_ATTR_DATA_DATE, TRACK_CHANGES_ATTR_DATA_TIME, TRACK_CHANGES_ATTR_DATA_USERID, TRACK_CHANGES_ATTR_DATA_USERNAME, findAttributeDefinitionByName, findSchemaByTag, getAttributeName, isAttributeRestricted, isIgnoredAttribute, isIgnoredElement };
package/dist/index.js CHANGED
@@ -20,33 +20,32 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- GlobalAttributes: () => globalAttributes_exports,
24
- IgnoredAttributes: () => ignoredAttributes_exports,
25
- IgnoredElements: () => ignoredElements_exports,
26
- SchemaTypes: () => schema_types_exports,
27
- Schemas: () => schemas_exports,
28
- SchemasAtoms: () => atoms_exports,
29
- SchemasElements: () => elements_exports,
30
- SchemasGroupElements: () => groupElements_exports,
31
- SchemasInlineElements: () => inlineElements_exports,
32
- Utils: () => utils_exports
33
- });
34
- module.exports = __toCommonJS(index_exports);
35
-
36
- // src/schema/schemas.ts
37
- var schemas_exports = {};
38
- __export(schemas_exports, {
23
+ ATOM_SCHEMAS: () => ATOM_SCHEMAS,
24
+ ELEMENT_ROLE: () => ELEMENT_ROLE,
25
+ ELEMENT_SCHEMAS: () => ELEMENT_SCHEMAS,
26
+ GROUP_ELEMENT_SCHEMAS: () => GROUP_ELEMENT_SCHEMAS,
27
+ ID_ATTRS: () => ID_ATTRS,
28
+ IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES,
29
+ IGNORED_ELEMENT_SELECTORS: () => IGNORED_ELEMENT_SELECTORS,
30
+ INLINE_ELEMENT_SCHEMAS: () => INLINE_ELEMENT_SCHEMAS,
31
+ PARA_SCHEMA: () => PARA_SCHEMA,
39
32
  SCHEMAS: () => SCHEMAS,
40
33
  SCHEMA_MAP: () => SCHEMA_MAP,
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
34
+ SECTION_SCHEMA: () => SECTION_SCHEMA,
35
+ TITLE_SCHEMA: () => TITLE_SCHEMA,
36
+ TRACK_CHANGES_ATTRS: () => TRACK_CHANGES_ATTRS,
37
+ TRACK_CHANGES_ATTR_DATA_DATE: () => TRACK_CHANGES_ATTR_DATA_DATE,
38
+ TRACK_CHANGES_ATTR_DATA_TIME: () => TRACK_CHANGES_ATTR_DATA_TIME,
39
+ TRACK_CHANGES_ATTR_DATA_USERID: () => TRACK_CHANGES_ATTR_DATA_USERID,
40
+ TRACK_CHANGES_ATTR_DATA_USERNAME: () => TRACK_CHANGES_ATTR_DATA_USERNAME,
41
+ findAttributeDefinitionByName: () => findAttributeDefinitionByName,
42
+ findSchemaByTag: () => findSchemaByTag,
43
+ getAttributeName: () => getAttributeName,
44
+ isAttributeRestricted: () => isAttributeRestricted,
45
+ isIgnoredAttribute: () => isIgnoredAttribute,
46
+ isIgnoredElement: () => isIgnoredElement
49
47
  });
48
+ module.exports = __toCommonJS(index_exports);
50
49
 
51
50
  // src/schema/shared/createSchema.ts
52
51
  var createSchema = ({
@@ -68,15 +67,6 @@ var createSchema = ({
68
67
  };
69
68
 
70
69
  // 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
- });
80
70
  var TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
81
71
  var TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
82
72
  var TRACK_CHANGES_ATTR_DATA_TIME = "data-time";
@@ -125,10 +115,6 @@ var B_SCHEMA = createSchema({
125
115
  });
126
116
 
127
117
  // src/schema/schema.types.ts
128
- var schema_types_exports = {};
129
- __export(schema_types_exports, {
130
- ELEMENT_ROLE: () => ELEMENT_ROLE
131
- });
132
118
  var ELEMENT_ROLE = /* @__PURE__ */ ((ELEMENT_ROLE2) => {
133
119
  ELEMENT_ROLE2["QUERYCOMMENTSWRAPPER"] = "QUERYCOMMENTSWRAPPER";
134
120
  ELEMENT_ROLE2["HEADING"] = "HEADING";
@@ -261,16 +247,6 @@ var ATOM_SCHEMAS = [
261
247
  INSERTION_SCHEMA,
262
248
  DELETION_SCHEMA
263
249
  ];
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
- });
274
250
 
275
251
  // src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
276
252
  var COMMENT_TAG = "COMMENT";
@@ -326,16 +302,6 @@ var ELEMENT_SCHEMAS = [
326
302
  PARA_SCHEMA,
327
303
  TITLE_SCHEMA
328
304
  ];
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
- });
339
305
 
340
306
  // src/schema/elementSchemas/groupElements/groupElementsTags.ts
341
307
  var SECTION_TAG = "SECTION1";
@@ -360,16 +326,6 @@ var SECTION_SCHEMA = createSchema({
360
326
 
361
327
  // src/schema/elementSchemas/groupElements/index.ts
362
328
  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
- });
373
329
 
374
330
  // src/schema/elementSchemas/inlineElements/comment.ts
375
331
  var COMMENT_SCHEMA = createSchema({
@@ -493,9 +449,6 @@ var INLINE_ELEMENT_SCHEMAS = [
493
449
  CONTENT_SCHEMA,
494
450
  REPLY_SCHEMA
495
451
  ];
496
- var inlineElementSchemas = Object.fromEntries(
497
- INLINE_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
498
- );
499
452
 
500
453
  // src/schema/schemas.ts
501
454
  var SCHEMAS = [
@@ -505,17 +458,19 @@ var SCHEMAS = [
505
458
  ...INLINE_ELEMENT_SCHEMAS
506
459
  ];
507
460
  var SCHEMA_MAP = new Map(
508
- SCHEMAS.map((schema) => [schema.tag, schema])
509
- );
510
- var schemas = Object.fromEntries(
511
- SCHEMAS.map((schema) => [schema.tag, schema])
461
+ SCHEMAS.map((schema) => [schema.tag + schema.role, schema])
512
462
  );
513
463
 
464
+ // src/schema/shared/ignoredElements.ts
465
+ var IGNORED_ELEMENT_SELECTORS = [
466
+ "span.rhlabel",
467
+ "span.abstractlabel",
468
+ "span.refIcon",
469
+ "span.missLink",
470
+ "span.ref-drag"
471
+ ];
472
+
514
473
  // src/schema/shared/ignoredAttributes.ts
515
- var ignoredAttributes_exports = {};
516
- __export(ignoredAttributes_exports, {
517
- IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES
518
- });
519
474
  var IGNORED_ATTRIBUTES = [
520
475
  // Styling & layout
521
476
  "class",
@@ -532,30 +487,6 @@ var IGNORED_ATTRIBUTES = [
532
487
  "hidden"
533
488
  ];
534
489
 
535
- // src/schema/shared/utils.ts
536
- var utils_exports = {};
537
- __export(utils_exports, {
538
- findAttributeDefinitionByName: () => findAttributeDefinitionByName,
539
- findSchemaByTag: () => findSchemaByTag,
540
- getAttributeName: () => getAttributeName,
541
- isAttributeRestricted: () => isAttributeRestricted,
542
- isIgnoredAttribute: () => isIgnoredAttribute,
543
- isIgnoredElement: () => isIgnoredElement
544
- });
545
-
546
- // src/schema/shared/ignoredElements.ts
547
- var ignoredElements_exports = {};
548
- __export(ignoredElements_exports, {
549
- IGNORED_ELEMENT_SELECTORS: () => IGNORED_ELEMENT_SELECTORS
550
- });
551
- var IGNORED_ELEMENT_SELECTORS = [
552
- "span.rhlabel",
553
- "span.abstractlabel",
554
- "span.refIcon",
555
- "span.missLink",
556
- "span.ref-drag"
557
- ];
558
-
559
490
  // src/schema/shared/utils.ts
560
491
  var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute);
561
492
  var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
@@ -592,14 +523,28 @@ var findAttributeDefinitionByName = (definitions, name) => {
592
523
  };
593
524
  // Annotate the CommonJS export names for ESM import in node:
594
525
  0 && (module.exports = {
595
- GlobalAttributes,
596
- IgnoredAttributes,
597
- IgnoredElements,
598
- SchemaTypes,
599
- Schemas,
600
- SchemasAtoms,
601
- SchemasElements,
602
- SchemasGroupElements,
603
- SchemasInlineElements,
604
- Utils
526
+ ATOM_SCHEMAS,
527
+ ELEMENT_ROLE,
528
+ ELEMENT_SCHEMAS,
529
+ GROUP_ELEMENT_SCHEMAS,
530
+ ID_ATTRS,
531
+ IGNORED_ATTRIBUTES,
532
+ IGNORED_ELEMENT_SELECTORS,
533
+ INLINE_ELEMENT_SCHEMAS,
534
+ PARA_SCHEMA,
535
+ SCHEMAS,
536
+ SCHEMA_MAP,
537
+ SECTION_SCHEMA,
538
+ TITLE_SCHEMA,
539
+ TRACK_CHANGES_ATTRS,
540
+ TRACK_CHANGES_ATTR_DATA_DATE,
541
+ TRACK_CHANGES_ATTR_DATA_TIME,
542
+ TRACK_CHANGES_ATTR_DATA_USERID,
543
+ TRACK_CHANGES_ATTR_DATA_USERNAME,
544
+ findAttributeDefinitionByName,
545
+ findSchemaByTag,
546
+ getAttributeName,
547
+ isAttributeRestricted,
548
+ isIgnoredAttribute,
549
+ isIgnoredElement
605
550
  });
package/dist/index.mjs CHANGED
@@ -1,24 +1,3 @@
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
- SCHEMA_MAP: () => SCHEMA_MAP,
12
- schemas: () => schemas
13
- });
14
-
15
- // src/schema/elementSchemas/atoms/index.ts
16
- var atoms_exports = {};
17
- __export(atoms_exports, {
18
- ATOM_SCHEMAS: () => ATOM_SCHEMAS,
19
- atomSchemas: () => atomSchemas
20
- });
21
-
22
1
  // src/schema/shared/createSchema.ts
23
2
  var createSchema = ({
24
3
  kind,
@@ -39,15 +18,6 @@ var createSchema = ({
39
18
  };
40
19
 
41
20
  // src/schema/shared/globalAttributes.ts
42
- var globalAttributes_exports = {};
43
- __export(globalAttributes_exports, {
44
- ID_ATTRS: () => ID_ATTRS,
45
- TRACK_CHANGES_ATTRS: () => TRACK_CHANGES_ATTRS,
46
- TRACK_CHANGES_ATTR_DATA_DATE: () => TRACK_CHANGES_ATTR_DATA_DATE,
47
- TRACK_CHANGES_ATTR_DATA_TIME: () => TRACK_CHANGES_ATTR_DATA_TIME,
48
- TRACK_CHANGES_ATTR_DATA_USERID: () => TRACK_CHANGES_ATTR_DATA_USERID,
49
- TRACK_CHANGES_ATTR_DATA_USERNAME: () => TRACK_CHANGES_ATTR_DATA_USERNAME
50
- });
51
21
  var TRACK_CHANGES_ATTR_DATA_USERNAME = "data-username";
52
22
  var TRACK_CHANGES_ATTR_DATA_USERID = "data-userid";
53
23
  var TRACK_CHANGES_ATTR_DATA_TIME = "data-time";
@@ -96,10 +66,6 @@ var B_SCHEMA = createSchema({
96
66
  });
97
67
 
98
68
  // src/schema/schema.types.ts
99
- var schema_types_exports = {};
100
- __export(schema_types_exports, {
101
- ELEMENT_ROLE: () => ELEMENT_ROLE
102
- });
103
69
  var ELEMENT_ROLE = /* @__PURE__ */ ((ELEMENT_ROLE2) => {
104
70
  ELEMENT_ROLE2["QUERYCOMMENTSWRAPPER"] = "QUERYCOMMENTSWRAPPER";
105
71
  ELEMENT_ROLE2["HEADING"] = "HEADING";
@@ -232,16 +198,6 @@ var ATOM_SCHEMAS = [
232
198
  INSERTION_SCHEMA,
233
199
  DELETION_SCHEMA
234
200
  ];
235
- var atomSchemas = Object.fromEntries(
236
- ATOM_SCHEMAS.map((schema) => [schema.tag, schema])
237
- );
238
-
239
- // src/schema/elementSchemas/elements/index.ts
240
- var elements_exports = {};
241
- __export(elements_exports, {
242
- ELEMENT_SCHEMAS: () => ELEMENT_SCHEMAS,
243
- elementSchemas: () => elementSchemas
244
- });
245
201
 
246
202
  // src/schema/elementSchemas/inlineElements/inlineElementsTags.ts
247
203
  var COMMENT_TAG = "COMMENT";
@@ -297,16 +253,6 @@ var ELEMENT_SCHEMAS = [
297
253
  PARA_SCHEMA,
298
254
  TITLE_SCHEMA
299
255
  ];
300
- var elementSchemas = Object.fromEntries(
301
- ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
302
- );
303
-
304
- // src/schema/elementSchemas/groupElements/index.ts
305
- var groupElements_exports = {};
306
- __export(groupElements_exports, {
307
- GROUP_ELEMENT_SCHEMAS: () => GROUP_ELEMENT_SCHEMAS,
308
- groupElementSchemas: () => groupElementSchemas
309
- });
310
256
 
311
257
  // src/schema/elementSchemas/groupElements/groupElementsTags.ts
312
258
  var SECTION_TAG = "SECTION1";
@@ -331,16 +277,6 @@ var SECTION_SCHEMA = createSchema({
331
277
 
332
278
  // src/schema/elementSchemas/groupElements/index.ts
333
279
  var GROUP_ELEMENT_SCHEMAS = [SECTION_SCHEMA];
334
- var groupElementSchemas = Object.fromEntries(
335
- GROUP_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
336
- );
337
-
338
- // src/schema/elementSchemas/inlineElements/index.ts
339
- var inlineElements_exports = {};
340
- __export(inlineElements_exports, {
341
- INLINE_ELEMENT_SCHEMAS: () => INLINE_ELEMENT_SCHEMAS,
342
- inlineElementSchemas: () => inlineElementSchemas
343
- });
344
280
 
345
281
  // src/schema/elementSchemas/inlineElements/comment.ts
346
282
  var COMMENT_SCHEMA = createSchema({
@@ -464,9 +400,6 @@ var INLINE_ELEMENT_SCHEMAS = [
464
400
  CONTENT_SCHEMA,
465
401
  REPLY_SCHEMA
466
402
  ];
467
- var inlineElementSchemas = Object.fromEntries(
468
- INLINE_ELEMENT_SCHEMAS.map((schema) => [schema.tag, schema])
469
- );
470
403
 
471
404
  // src/schema/schemas.ts
472
405
  var SCHEMAS = [
@@ -476,17 +409,19 @@ var SCHEMAS = [
476
409
  ...INLINE_ELEMENT_SCHEMAS
477
410
  ];
478
411
  var SCHEMA_MAP = new Map(
479
- SCHEMAS.map((schema) => [schema.tag, schema])
480
- );
481
- var schemas = Object.fromEntries(
482
- SCHEMAS.map((schema) => [schema.tag, schema])
412
+ SCHEMAS.map((schema) => [schema.tag + schema.role, schema])
483
413
  );
484
414
 
415
+ // src/schema/shared/ignoredElements.ts
416
+ var IGNORED_ELEMENT_SELECTORS = [
417
+ "span.rhlabel",
418
+ "span.abstractlabel",
419
+ "span.refIcon",
420
+ "span.missLink",
421
+ "span.ref-drag"
422
+ ];
423
+
485
424
  // src/schema/shared/ignoredAttributes.ts
486
- var ignoredAttributes_exports = {};
487
- __export(ignoredAttributes_exports, {
488
- IGNORED_ATTRIBUTES: () => IGNORED_ATTRIBUTES
489
- });
490
425
  var IGNORED_ATTRIBUTES = [
491
426
  // Styling & layout
492
427
  "class",
@@ -503,30 +438,6 @@ var IGNORED_ATTRIBUTES = [
503
438
  "hidden"
504
439
  ];
505
440
 
506
- // src/schema/shared/utils.ts
507
- var utils_exports = {};
508
- __export(utils_exports, {
509
- findAttributeDefinitionByName: () => findAttributeDefinitionByName,
510
- findSchemaByTag: () => findSchemaByTag,
511
- getAttributeName: () => getAttributeName,
512
- isAttributeRestricted: () => isAttributeRestricted,
513
- isIgnoredAttribute: () => isIgnoredAttribute,
514
- isIgnoredElement: () => isIgnoredElement
515
- });
516
-
517
- // src/schema/shared/ignoredElements.ts
518
- var ignoredElements_exports = {};
519
- __export(ignoredElements_exports, {
520
- IGNORED_ELEMENT_SELECTORS: () => IGNORED_ELEMENT_SELECTORS
521
- });
522
- var IGNORED_ELEMENT_SELECTORS = [
523
- "span.rhlabel",
524
- "span.abstractlabel",
525
- "span.refIcon",
526
- "span.missLink",
527
- "span.ref-drag"
528
- ];
529
-
530
441
  // src/schema/shared/utils.ts
531
442
  var isIgnoredAttribute = (attribute) => IGNORED_ATTRIBUTES.includes(attribute);
532
443
  var isIgnoredElement = (element) => IGNORED_ELEMENT_SELECTORS.some((selector) => element.matches(selector));
@@ -562,14 +473,28 @@ var findAttributeDefinitionByName = (definitions, name) => {
562
473
  return void 0;
563
474
  };
564
475
  export {
565
- globalAttributes_exports as GlobalAttributes,
566
- ignoredAttributes_exports as IgnoredAttributes,
567
- ignoredElements_exports as IgnoredElements,
568
- schema_types_exports as SchemaTypes,
569
- schemas_exports as Schemas,
570
- atoms_exports as SchemasAtoms,
571
- elements_exports as SchemasElements,
572
- groupElements_exports as SchemasGroupElements,
573
- inlineElements_exports as SchemasInlineElements,
574
- utils_exports as Utils
476
+ ATOM_SCHEMAS,
477
+ ELEMENT_ROLE,
478
+ ELEMENT_SCHEMAS,
479
+ GROUP_ELEMENT_SCHEMAS,
480
+ ID_ATTRS,
481
+ IGNORED_ATTRIBUTES,
482
+ IGNORED_ELEMENT_SELECTORS,
483
+ INLINE_ELEMENT_SCHEMAS,
484
+ PARA_SCHEMA,
485
+ SCHEMAS,
486
+ SCHEMA_MAP,
487
+ SECTION_SCHEMA,
488
+ TITLE_SCHEMA,
489
+ TRACK_CHANGES_ATTRS,
490
+ TRACK_CHANGES_ATTR_DATA_DATE,
491
+ TRACK_CHANGES_ATTR_DATA_TIME,
492
+ TRACK_CHANGES_ATTR_DATA_USERID,
493
+ TRACK_CHANGES_ATTR_DATA_USERNAME,
494
+ findAttributeDefinitionByName,
495
+ findSchemaByTag,
496
+ getAttributeName,
497
+ isAttributeRestricted,
498
+ isIgnoredAttribute,
499
+ isIgnoredElement
575
500
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pro-editor-schema",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.6",
4
4
  "description": "Pro Editor XML schemas",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",