@playdrop/playdrop-cli 0.12.42 → 0.13.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.
Files changed (106) hide show
  1. package/config/client-meta.json +2 -2
  2. package/dist/apps/index.d.ts +2 -0
  3. package/dist/apps/index.js +2 -1
  4. package/dist/apps/loadCheck.d.ts +4 -1
  5. package/dist/apps/loadCheck.js +40 -10
  6. package/dist/apps/staticHtml.d.ts +28 -0
  7. package/dist/apps/staticHtml.js +343 -0
  8. package/dist/apps/validate.js +2 -1
  9. package/dist/commands/devServer.js +19 -0
  10. package/dist/commands/feedback.d.ts +2 -0
  11. package/dist/commands/feedback.js +44 -2
  12. package/dist/commands/upload.d.ts +24 -0
  13. package/dist/commands/upload.js +122 -4
  14. package/dist/commands/worker/instrument-evidence.js +1 -1
  15. package/dist/commands/worker/runtime.d.ts +14 -0
  16. package/dist/commands/worker/runtime.js +97 -8
  17. package/dist/commands/worker.d.ts +27 -2
  18. package/dist/commands/worker.js +688 -146
  19. package/dist/index.js +7 -0
  20. package/dist/listingPreflight.js +15 -4
  21. package/node_modules/@playdrop/api-client/dist/client.d.ts +5 -2
  22. package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
  23. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +3 -2
  24. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
  25. package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +13 -2
  26. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +2 -1
  27. package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
  28. package/node_modules/@playdrop/api-client/dist/domains/me.d.ts +2 -1
  29. package/node_modules/@playdrop/api-client/dist/domains/me.d.ts.map +1 -1
  30. package/node_modules/@playdrop/api-client/dist/domains/me.js +11 -0
  31. package/node_modules/@playdrop/api-client/dist/index.d.ts +6 -3
  32. package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
  33. package/node_modules/@playdrop/api-client/dist/index.js +14 -2
  34. package/node_modules/@playdrop/config/client-meta.json +2 -2
  35. package/node_modules/@playdrop/config/dist/src/constants.d.ts +1 -0
  36. package/node_modules/@playdrop/config/dist/src/constants.d.ts.map +1 -1
  37. package/node_modules/@playdrop/config/dist/src/constants.js +1 -0
  38. package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
  39. package/node_modules/@playdrop/types/dist/api.d.ts +195 -4
  40. package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
  41. package/node_modules/@playdrop/types/dist/api.js +25 -2
  42. package/node_modules/entities/decode-codepoint.d.ts +19 -0
  43. package/node_modules/entities/decode-codepoint.d.ts.map +1 -0
  44. package/node_modules/entities/decode-codepoint.js +77 -0
  45. package/node_modules/entities/decode-codepoint.js.map +1 -0
  46. package/node_modules/entities/decode.d.ts +209 -0
  47. package/node_modules/entities/decode.d.ts.map +1 -0
  48. package/node_modules/entities/decode.js +511 -0
  49. package/node_modules/entities/decode.js.map +1 -0
  50. package/node_modules/entities/encode.d.ts +22 -0
  51. package/node_modules/entities/encode.d.ts.map +1 -0
  52. package/node_modules/entities/encode.js +73 -0
  53. package/node_modules/entities/encode.js.map +1 -0
  54. package/node_modules/entities/escape.d.ts +43 -0
  55. package/node_modules/entities/escape.d.ts.map +1 -0
  56. package/node_modules/entities/escape.js +121 -0
  57. package/node_modules/entities/escape.js.map +1 -0
  58. package/node_modules/entities/generated/decode-data-html.d.ts +2 -0
  59. package/node_modules/entities/generated/decode-data-html.d.ts.map +1 -0
  60. package/node_modules/entities/generated/decode-data-html.js +10 -0
  61. package/node_modules/entities/generated/decode-data-html.js.map +1 -0
  62. package/node_modules/entities/generated/decode-data-xml.d.ts +2 -0
  63. package/node_modules/entities/generated/decode-data-xml.d.ts.map +1 -0
  64. package/node_modules/entities/generated/decode-data-xml.js +10 -0
  65. package/node_modules/entities/generated/decode-data-xml.js.map +1 -0
  66. package/node_modules/entities/generated/encode-html.d.ts +8 -0
  67. package/node_modules/entities/generated/encode-html.d.ts.map +1 -0
  68. package/node_modules/entities/generated/encode-html.js +13 -0
  69. package/node_modules/entities/generated/encode-html.js.map +1 -0
  70. package/node_modules/entities/index.d.ts +96 -0
  71. package/node_modules/entities/index.d.ts.map +1 -0
  72. package/node_modules/entities/index.js +131 -0
  73. package/node_modules/entities/index.js.map +1 -0
  74. package/node_modules/entities/package.json +3 -0
  75. package/node_modules/parse5/common/doctype.d.ts +4 -0
  76. package/node_modules/parse5/common/doctype.js +118 -0
  77. package/node_modules/parse5/common/error-codes.d.ts +67 -0
  78. package/node_modules/parse5/common/error-codes.js +66 -0
  79. package/node_modules/parse5/common/foreign-content.d.ts +9 -0
  80. package/node_modules/parse5/common/foreign-content.js +237 -0
  81. package/node_modules/parse5/common/html.d.ts +289 -0
  82. package/node_modules/parse5/common/html.js +528 -0
  83. package/node_modules/parse5/common/token.d.ts +84 -0
  84. package/node_modules/parse5/common/token.js +24 -0
  85. package/node_modules/parse5/common/unicode.d.ts +42 -0
  86. package/node_modules/parse5/common/unicode.js +70 -0
  87. package/node_modules/parse5/index.d.ts +71 -0
  88. package/node_modules/parse5/index.js +54 -0
  89. package/node_modules/parse5/package.json +1 -0
  90. package/node_modules/parse5/parser/formatting-element-list.d.ts +36 -0
  91. package/node_modules/parse5/parser/formatting-element-list.js +114 -0
  92. package/node_modules/parse5/parser/index.d.ts +221 -0
  93. package/node_modules/parse5/parser/index.js +3240 -0
  94. package/node_modules/parse5/parser/open-element-stack.d.ts +53 -0
  95. package/node_modules/parse5/parser/open-element-stack.js +328 -0
  96. package/node_modules/parse5/serializer/index.d.ts +60 -0
  97. package/node_modules/parse5/serializer/index.js +172 -0
  98. package/node_modules/parse5/tokenizer/index.d.ts +247 -0
  99. package/node_modules/parse5/tokenizer/index.js +2714 -0
  100. package/node_modules/parse5/tokenizer/preprocessor.d.ts +36 -0
  101. package/node_modules/parse5/tokenizer/preprocessor.js +200 -0
  102. package/node_modules/parse5/tree-adapters/default.d.ts +84 -0
  103. package/node_modules/parse5/tree-adapters/default.js +176 -0
  104. package/node_modules/parse5/tree-adapters/interface.d.ts +255 -0
  105. package/node_modules/parse5/tree-adapters/interface.js +2 -0
  106. package/package.json +7 -1
@@ -0,0 +1,96 @@
1
+ import { DecodingMode } from "./decode.js";
2
+ /** The level of entities to support. */
3
+ export declare enum EntityLevel {
4
+ /** Support only XML entities. */
5
+ XML = 0,
6
+ /** Support HTML entities, which are a superset of XML entities. */
7
+ HTML = 1
8
+ }
9
+ export declare enum EncodingMode {
10
+ /**
11
+ * The output is UTF-8 encoded. Only characters that need escaping within
12
+ * XML will be escaped.
13
+ */
14
+ UTF8 = 0,
15
+ /**
16
+ * The output consists only of ASCII characters. Characters that need
17
+ * escaping within HTML, and characters that aren't ASCII characters will
18
+ * be escaped.
19
+ */
20
+ ASCII = 1,
21
+ /**
22
+ * Encode all characters that have an equivalent entity, as well as all
23
+ * characters that are not ASCII characters.
24
+ */
25
+ Extensive = 2,
26
+ /**
27
+ * Encode all characters that have to be escaped in HTML attributes,
28
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
29
+ */
30
+ Attribute = 3,
31
+ /**
32
+ * Encode all characters that have to be escaped in HTML text,
33
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
34
+ */
35
+ Text = 4
36
+ }
37
+ export interface DecodingOptions {
38
+ /**
39
+ * The level of entities to support.
40
+ * @default {@link EntityLevel.XML}
41
+ */
42
+ level?: EntityLevel;
43
+ /**
44
+ * Decoding mode. If `Legacy`, will support legacy entities not terminated
45
+ * with a semicolon (`;`).
46
+ *
47
+ * Always `Strict` for XML. For HTML, set this to `true` if you are parsing
48
+ * an attribute value.
49
+ *
50
+ * The deprecated `decodeStrict` function defaults this to `Strict`.
51
+ *
52
+ * @default {@link DecodingMode.Legacy}
53
+ */
54
+ mode?: DecodingMode | undefined;
55
+ }
56
+ /**
57
+ * Decodes a string with entities.
58
+ *
59
+ * @param input String to decode.
60
+ * @param options Decoding options.
61
+ */
62
+ export declare function decode(input: string, options?: DecodingOptions | EntityLevel): string;
63
+ /**
64
+ * Decodes a string with entities. Does not allow missing trailing semicolons for entities.
65
+ *
66
+ * @param input String to decode.
67
+ * @param options Decoding options.
68
+ * @deprecated Use `decode` with the `mode` set to `Strict`.
69
+ */
70
+ export declare function decodeStrict(input: string, options?: DecodingOptions | EntityLevel): string;
71
+ /**
72
+ * Options for `encode`.
73
+ */
74
+ export interface EncodingOptions {
75
+ /**
76
+ * The level of entities to support.
77
+ * @default {@link EntityLevel.XML}
78
+ */
79
+ level?: EntityLevel;
80
+ /**
81
+ * Output format.
82
+ * @default {@link EncodingMode.Extensive}
83
+ */
84
+ mode?: EncodingMode;
85
+ }
86
+ /**
87
+ * Encodes a string with entities.
88
+ *
89
+ * @param input String to encode.
90
+ * @param options Encoding options.
91
+ */
92
+ export declare function encode(input: string, options?: EncodingOptions | EntityLevel): string;
93
+ export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
94
+ export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
95
+ export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
96
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AASlE,wCAAwC;AACxC,oBAAY,WAAW;IACnB,iCAAiC;IACjC,GAAG,IAAI;IACP,mEAAmE;IACnE,IAAI,IAAI;CACX;AAED,oBAAY,YAAY;IACpB;;;OAGG;IACH,IAAI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strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.encodeXML = exports.EncodingMode = exports.EntityLevel = void 0;
4
+ exports.decode = decode;
5
+ exports.decodeStrict = decodeStrict;
6
+ exports.encode = encode;
7
+ const decode_js_1 = require("./decode.js");
8
+ const encode_js_1 = require("./encode.js");
9
+ const escape_js_1 = require("./escape.js");
10
+ /** The level of entities to support. */
11
+ var EntityLevel;
12
+ (function (EntityLevel) {
13
+ /** Support only XML entities. */
14
+ EntityLevel[EntityLevel["XML"] = 0] = "XML";
15
+ /** Support HTML entities, which are a superset of XML entities. */
16
+ EntityLevel[EntityLevel["HTML"] = 1] = "HTML";
17
+ })(EntityLevel || (exports.EntityLevel = EntityLevel = {}));
18
+ var EncodingMode;
19
+ (function (EncodingMode) {
20
+ /**
21
+ * The output is UTF-8 encoded. Only characters that need escaping within
22
+ * XML will be escaped.
23
+ */
24
+ EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8";
25
+ /**
26
+ * The output consists only of ASCII characters. Characters that need
27
+ * escaping within HTML, and characters that aren't ASCII characters will
28
+ * be escaped.
29
+ */
30
+ EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII";
31
+ /**
32
+ * Encode all characters that have an equivalent entity, as well as all
33
+ * characters that are not ASCII characters.
34
+ */
35
+ EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive";
36
+ /**
37
+ * Encode all characters that have to be escaped in HTML attributes,
38
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
39
+ */
40
+ EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute";
41
+ /**
42
+ * Encode all characters that have to be escaped in HTML text,
43
+ * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
44
+ */
45
+ EncodingMode[EncodingMode["Text"] = 4] = "Text";
46
+ })(EncodingMode || (exports.EncodingMode = EncodingMode = {}));
47
+ /**
48
+ * Decodes a string with entities.
49
+ *
50
+ * @param input String to decode.
51
+ * @param options Decoding options.
52
+ */
53
+ function decode(input, options = EntityLevel.XML) {
54
+ const level = typeof options === "number" ? options : options.level;
55
+ if (level === EntityLevel.HTML) {
56
+ const mode = typeof options === "object" ? options.mode : undefined;
57
+ return (0, decode_js_1.decodeHTML)(input, mode);
58
+ }
59
+ return (0, decode_js_1.decodeXML)(input);
60
+ }
61
+ /**
62
+ * Decodes a string with entities. Does not allow missing trailing semicolons for entities.
63
+ *
64
+ * @param input String to decode.
65
+ * @param options Decoding options.
66
+ * @deprecated Use `decode` with the `mode` set to `Strict`.
67
+ */
68
+ function decodeStrict(input, options = EntityLevel.XML) {
69
+ var _a;
70
+ const normalizedOptions = typeof options === "number" ? { level: options } : options;
71
+ (_a = normalizedOptions.mode) !== null && _a !== void 0 ? _a : (normalizedOptions.mode = decode_js_1.DecodingMode.Strict);
72
+ return decode(input, normalizedOptions);
73
+ }
74
+ /**
75
+ * Encodes a string with entities.
76
+ *
77
+ * @param input String to encode.
78
+ * @param options Encoding options.
79
+ */
80
+ function encode(input, options = EntityLevel.XML) {
81
+ const { mode = EncodingMode.Extensive, level = EntityLevel.XML } = typeof options === "number" ? { level: options } : options;
82
+ switch (mode) {
83
+ case EncodingMode.UTF8: {
84
+ return (0, escape_js_1.escapeUTF8)(input);
85
+ }
86
+ case EncodingMode.Attribute: {
87
+ return (0, escape_js_1.escapeAttribute)(input);
88
+ }
89
+ case EncodingMode.Text: {
90
+ return (0, escape_js_1.escapeText)(input);
91
+ }
92
+ case EncodingMode.ASCII: {
93
+ return level === EntityLevel.HTML
94
+ ? (0, encode_js_1.encodeNonAsciiHTML)(input)
95
+ : (0, escape_js_1.encodeXML)(input);
96
+ }
97
+ // eslint-disable-next-line unicorn/no-useless-switch-case
98
+ case EncodingMode.Extensive:
99
+ default: {
100
+ return level === EntityLevel.HTML
101
+ ? (0, encode_js_1.encodeHTML)(input)
102
+ : (0, escape_js_1.encodeXML)(input);
103
+ }
104
+ }
105
+ }
106
+ var escape_js_2 = require("./escape.js");
107
+ Object.defineProperty(exports, "encodeXML", { enumerable: true, get: function () { return escape_js_2.encodeXML; } });
108
+ Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
109
+ Object.defineProperty(exports, "escapeUTF8", { enumerable: true, get: function () { return escape_js_2.escapeUTF8; } });
110
+ Object.defineProperty(exports, "escapeAttribute", { enumerable: true, get: function () { return escape_js_2.escapeAttribute; } });
111
+ Object.defineProperty(exports, "escapeText", { enumerable: true, get: function () { return escape_js_2.escapeText; } });
112
+ var encode_js_2 = require("./encode.js");
113
+ Object.defineProperty(exports, "encodeHTML", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
114
+ Object.defineProperty(exports, "encodeNonAsciiHTML", { enumerable: true, get: function () { return encode_js_2.encodeNonAsciiHTML; } });
115
+ // Legacy aliases (deprecated)
116
+ Object.defineProperty(exports, "encodeHTML4", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
117
+ Object.defineProperty(exports, "encodeHTML5", { enumerable: true, get: function () { return encode_js_2.encodeHTML; } });
118
+ var decode_js_2 = require("./decode.js");
119
+ Object.defineProperty(exports, "EntityDecoder", { enumerable: true, get: function () { return decode_js_2.EntityDecoder; } });
120
+ Object.defineProperty(exports, "DecodingMode", { enumerable: true, get: function () { return decode_js_2.DecodingMode; } });
121
+ Object.defineProperty(exports, "decodeXML", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
122
+ Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
123
+ Object.defineProperty(exports, "decodeHTMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
124
+ Object.defineProperty(exports, "decodeHTMLAttribute", { enumerable: true, get: function () { return decode_js_2.decodeHTMLAttribute; } });
125
+ // Legacy aliases (deprecated)
126
+ Object.defineProperty(exports, "decodeHTML4", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
127
+ Object.defineProperty(exports, "decodeHTML5", { enumerable: true, get: function () { return decode_js_2.decodeHTML; } });
128
+ Object.defineProperty(exports, "decodeHTML4Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
129
+ Object.defineProperty(exports, "decodeHTML5Strict", { enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } });
130
+ Object.defineProperty(exports, "decodeXMLStrict", { enumerable: true, get: function () { return decode_js_2.decodeXML; } });
131
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAwEA,wBAYC;AASD,oCASC;AAwBD,wBA8BC;AA5JD,2CAAkE;AAClE,2CAA6D;AAC7D,2CAKqB;AAErB,wCAAwC;AACxC,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,iCAAiC;IACjC,2CAAO,CAAA;IACP,mEAAmE;IACnE,6CAAQ,CAAA;AACZ,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAY,YA2BX;AA3BD,WAAY,YAAY;IACpB;;;OAGG;IACH,+CAAI,CAAA;IACJ;;;;OAIG;IACH,iDAAK,CAAA;IACL;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,yDAAS,CAAA;IACT;;;OAGG;IACH,+CAAI,CAAA;AACR,CAAC,EA3BW,YAAY,4BAAZ,YAAY,QA2BvB;AAsBD;;;;;GAKG;AACH,SAAgB,MAAM,CAClB,KAAa,EACb,UAAyC,WAAW,CAAC,GAAG;IAExD,MAAM,KAAK,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,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": "commonjs"
3
+ }
@@ -0,0 +1,4 @@
1
+ import { DOCUMENT_MODE } from './html.js';
2
+ import type { DoctypeToken } from './token.js';
3
+ export declare function isConforming(token: DoctypeToken): boolean;
4
+ export declare function getDocumentMode(token: DoctypeToken): DOCUMENT_MODE;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isConforming = isConforming;
4
+ exports.getDocumentMode = getDocumentMode;
5
+ const html_js_1 = require("./html.js");
6
+ //Const
7
+ const VALID_DOCTYPE_NAME = 'html';
8
+ const VALID_SYSTEM_ID = 'about:legacy-compat';
9
+ const QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd';
10
+ const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
11
+ '+//silmaril//dtd html pro v0r11 19970101//',
12
+ '-//as//dtd html 3.0 aswedit + extensions//',
13
+ '-//advasoft ltd//dtd html 3.0 aswedit + extensions//',
14
+ '-//ietf//dtd html 2.0 level 1//',
15
+ '-//ietf//dtd html 2.0 level 2//',
16
+ '-//ietf//dtd html 2.0 strict level 1//',
17
+ '-//ietf//dtd html 2.0 strict level 2//',
18
+ '-//ietf//dtd html 2.0 strict//',
19
+ '-//ietf//dtd html 2.0//',
20
+ '-//ietf//dtd html 2.1e//',
21
+ '-//ietf//dtd html 3.0//',
22
+ '-//ietf//dtd html 3.2 final//',
23
+ '-//ietf//dtd html 3.2//',
24
+ '-//ietf//dtd html 3//',
25
+ '-//ietf//dtd html level 0//',
26
+ '-//ietf//dtd html level 1//',
27
+ '-//ietf//dtd html level 2//',
28
+ '-//ietf//dtd html level 3//',
29
+ '-//ietf//dtd html strict level 0//',
30
+ '-//ietf//dtd html strict level 1//',
31
+ '-//ietf//dtd html strict level 2//',
32
+ '-//ietf//dtd html strict level 3//',
33
+ '-//ietf//dtd html strict//',
34
+ '-//ietf//dtd html//',
35
+ '-//metrius//dtd metrius presentational//',
36
+ '-//microsoft//dtd internet explorer 2.0 html strict//',
37
+ '-//microsoft//dtd internet explorer 2.0 html//',
38
+ '-//microsoft//dtd internet explorer 2.0 tables//',
39
+ '-//microsoft//dtd internet explorer 3.0 html strict//',
40
+ '-//microsoft//dtd internet explorer 3.0 html//',
41
+ '-//microsoft//dtd internet explorer 3.0 tables//',
42
+ '-//netscape comm. corp.//dtd html//',
43
+ '-//netscape comm. corp.//dtd strict html//',
44
+ "-//o'reilly and associates//dtd html 2.0//",
45
+ "-//o'reilly and associates//dtd html extended 1.0//",
46
+ "-//o'reilly and associates//dtd html extended relaxed 1.0//",
47
+ '-//sq//dtd html 2.0 hotmetal + extensions//',
48
+ '-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//',
49
+ '-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//',
50
+ '-//spyglass//dtd html 2.0 extended//',
51
+ '-//sun microsystems corp.//dtd hotjava html//',
52
+ '-//sun microsystems corp.//dtd hotjava strict html//',
53
+ '-//w3c//dtd html 3 1995-03-24//',
54
+ '-//w3c//dtd html 3.2 draft//',
55
+ '-//w3c//dtd html 3.2 final//',
56
+ '-//w3c//dtd html 3.2//',
57
+ '-//w3c//dtd html 3.2s draft//',
58
+ '-//w3c//dtd html 4.0 frameset//',
59
+ '-//w3c//dtd html 4.0 transitional//',
60
+ '-//w3c//dtd html experimental 19960712//',
61
+ '-//w3c//dtd html experimental 970421//',
62
+ '-//w3c//dtd w3 html//',
63
+ '-//w3o//dtd w3 html 3.0//',
64
+ '-//webtechs//dtd mozilla html 2.0//',
65
+ '-//webtechs//dtd mozilla html//',
66
+ ];
67
+ const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
68
+ ...QUIRKS_MODE_PUBLIC_ID_PREFIXES,
69
+ '-//w3c//dtd html 4.01 frameset//',
70
+ '-//w3c//dtd html 4.01 transitional//',
71
+ ];
72
+ const QUIRKS_MODE_PUBLIC_IDS = new Set([
73
+ '-//w3o//dtd w3 html strict 3.0//en//',
74
+ '-/w3c/dtd html 4.0 transitional/en',
75
+ 'html',
76
+ ]);
77
+ const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//'];
78
+ const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
79
+ ...LIMITED_QUIRKS_PUBLIC_ID_PREFIXES,
80
+ '-//w3c//dtd html 4.01 frameset//',
81
+ '-//w3c//dtd html 4.01 transitional//',
82
+ ];
83
+ //Utils
84
+ function hasPrefix(publicId, prefixes) {
85
+ return prefixes.some((prefix) => publicId.startsWith(prefix));
86
+ }
87
+ //API
88
+ function isConforming(token) {
89
+ return (token.name === VALID_DOCTYPE_NAME &&
90
+ token.publicId === null &&
91
+ (token.systemId === null || token.systemId === VALID_SYSTEM_ID));
92
+ }
93
+ function getDocumentMode(token) {
94
+ if (token.name !== VALID_DOCTYPE_NAME) {
95
+ return html_js_1.DOCUMENT_MODE.QUIRKS;
96
+ }
97
+ const { systemId } = token;
98
+ if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {
99
+ return html_js_1.DOCUMENT_MODE.QUIRKS;
100
+ }
101
+ let { publicId } = token;
102
+ if (publicId !== null) {
103
+ publicId = publicId.toLowerCase();
104
+ if (QUIRKS_MODE_PUBLIC_IDS.has(publicId)) {
105
+ return html_js_1.DOCUMENT_MODE.QUIRKS;
106
+ }
107
+ let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
108
+ if (hasPrefix(publicId, prefixes)) {
109
+ return html_js_1.DOCUMENT_MODE.QUIRKS;
110
+ }
111
+ prefixes =
112
+ systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
113
+ if (hasPrefix(publicId, prefixes)) {
114
+ return html_js_1.DOCUMENT_MODE.LIMITED_QUIRKS;
115
+ }
116
+ }
117
+ return html_js_1.DOCUMENT_MODE.NO_QUIRKS;
118
+ }
@@ -0,0 +1,67 @@
1
+ import type { Location } from './token.js';
2
+ export interface ParserError extends Location {
3
+ code: ERR;
4
+ }
5
+ export type ParserErrorHandler = (error: ParserError) => void;
6
+ export declare enum ERR {
7
+ controlCharacterInInputStream = "control-character-in-input-stream",
8
+ noncharacterInInputStream = "noncharacter-in-input-stream",
9
+ surrogateInInputStream = "surrogate-in-input-stream",
10
+ nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus",
11
+ endTagWithAttributes = "end-tag-with-attributes",
12
+ endTagWithTrailingSolidus = "end-tag-with-trailing-solidus",
13
+ unexpectedSolidusInTag = "unexpected-solidus-in-tag",
14
+ unexpectedNullCharacter = "unexpected-null-character",
15
+ unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name",
16
+ invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name",
17
+ unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name",
18
+ missingEndTagName = "missing-end-tag-name",
19
+ unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name",
20
+ unknownNamedCharacterReference = "unknown-named-character-reference",
21
+ missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference",
22
+ unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier",
23
+ unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value",
24
+ eofBeforeTagName = "eof-before-tag-name",
25
+ eofInTag = "eof-in-tag",
26
+ missingAttributeValue = "missing-attribute-value",
27
+ missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes",
28
+ missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword",
29
+ missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers",
30
+ missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword",
31
+ missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier",
32
+ missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier",
33
+ missingDoctypePublicIdentifier = "missing-doctype-public-identifier",
34
+ missingDoctypeSystemIdentifier = "missing-doctype-system-identifier",
35
+ abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier",
36
+ abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier",
37
+ cdataInHtmlContent = "cdata-in-html-content",
38
+ incorrectlyOpenedComment = "incorrectly-opened-comment",
39
+ eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text",
40
+ eofInDoctype = "eof-in-doctype",
41
+ nestedComment = "nested-comment",
42
+ abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment",
43
+ eofInComment = "eof-in-comment",
44
+ incorrectlyClosedComment = "incorrectly-closed-comment",
45
+ eofInCdata = "eof-in-cdata",
46
+ absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference",
47
+ nullCharacterReference = "null-character-reference",
48
+ surrogateCharacterReference = "surrogate-character-reference",
49
+ characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range",
50
+ controlCharacterReference = "control-character-reference",
51
+ noncharacterCharacterReference = "noncharacter-character-reference",
52
+ missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name",
53
+ missingDoctypeName = "missing-doctype-name",
54
+ invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name",
55
+ duplicateAttribute = "duplicate-attribute",
56
+ nonConformingDoctype = "non-conforming-doctype",
57
+ missingDoctype = "missing-doctype",
58
+ misplacedDoctype = "misplaced-doctype",
59
+ endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element",
60
+ closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements",
61
+ disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head",
62
+ openElementsLeftAfterEof = "open-elements-left-after-eof",
63
+ abandonedHeadElementChild = "abandoned-head-element-child",
64
+ misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element",
65
+ nestedNoscriptInHead = "nested-noscript-in-head",
66
+ eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text"
67
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ERR = void 0;
4
+ var ERR;
5
+ (function (ERR) {
6
+ ERR["controlCharacterInInputStream"] = "control-character-in-input-stream";
7
+ ERR["noncharacterInInputStream"] = "noncharacter-in-input-stream";
8
+ ERR["surrogateInInputStream"] = "surrogate-in-input-stream";
9
+ ERR["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus";
10
+ ERR["endTagWithAttributes"] = "end-tag-with-attributes";
11
+ ERR["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus";
12
+ ERR["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag";
13
+ ERR["unexpectedNullCharacter"] = "unexpected-null-character";
14
+ ERR["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name";
15
+ ERR["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name";
16
+ ERR["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name";
17
+ ERR["missingEndTagName"] = "missing-end-tag-name";
18
+ ERR["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name";
19
+ ERR["unknownNamedCharacterReference"] = "unknown-named-character-reference";
20
+ ERR["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference";
21
+ ERR["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier";
22
+ ERR["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value";
23
+ ERR["eofBeforeTagName"] = "eof-before-tag-name";
24
+ ERR["eofInTag"] = "eof-in-tag";
25
+ ERR["missingAttributeValue"] = "missing-attribute-value";
26
+ ERR["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes";
27
+ ERR["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword";
28
+ ERR["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers";
29
+ ERR["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword";
30
+ ERR["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier";
31
+ ERR["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier";
32
+ ERR["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier";
33
+ ERR["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier";
34
+ ERR["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier";
35
+ ERR["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier";
36
+ ERR["cdataInHtmlContent"] = "cdata-in-html-content";
37
+ ERR["incorrectlyOpenedComment"] = "incorrectly-opened-comment";
38
+ ERR["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text";
39
+ ERR["eofInDoctype"] = "eof-in-doctype";
40
+ ERR["nestedComment"] = "nested-comment";
41
+ ERR["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment";
42
+ ERR["eofInComment"] = "eof-in-comment";
43
+ ERR["incorrectlyClosedComment"] = "incorrectly-closed-comment";
44
+ ERR["eofInCdata"] = "eof-in-cdata";
45
+ ERR["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference";
46
+ ERR["nullCharacterReference"] = "null-character-reference";
47
+ ERR["surrogateCharacterReference"] = "surrogate-character-reference";
48
+ ERR["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range";
49
+ ERR["controlCharacterReference"] = "control-character-reference";
50
+ ERR["noncharacterCharacterReference"] = "noncharacter-character-reference";
51
+ ERR["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name";
52
+ ERR["missingDoctypeName"] = "missing-doctype-name";
53
+ ERR["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name";
54
+ ERR["duplicateAttribute"] = "duplicate-attribute";
55
+ ERR["nonConformingDoctype"] = "non-conforming-doctype";
56
+ ERR["missingDoctype"] = "missing-doctype";
57
+ ERR["misplacedDoctype"] = "misplaced-doctype";
58
+ ERR["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element";
59
+ ERR["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements";
60
+ ERR["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head";
61
+ ERR["openElementsLeftAfterEof"] = "open-elements-left-after-eof";
62
+ ERR["abandonedHeadElementChild"] = "abandoned-head-element-child";
63
+ ERR["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element";
64
+ ERR["nestedNoscriptInHead"] = "nested-noscript-in-head";
65
+ ERR["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text";
66
+ })(ERR || (exports.ERR = ERR = {}));
@@ -0,0 +1,9 @@
1
+ import { TAG_ID as $, NS } from './html.js';
2
+ import type { TagToken, Attribute } from './token.js';
3
+ export declare const SVG_TAG_NAMES_ADJUSTMENT_MAP: Map<string, string>;
4
+ export declare function causesExit(startTagToken: TagToken): boolean;
5
+ export declare function adjustTokenMathMLAttrs(token: TagToken): void;
6
+ export declare function adjustTokenSVGAttrs(token: TagToken): void;
7
+ export declare function adjustTokenXMLAttrs(token: TagToken): void;
8
+ export declare function adjustTokenSVGTagName(token: TagToken): void;
9
+ export declare function isIntegrationPoint(tn: $, ns: NS, attrs: Attribute[], foreignNS?: NS): boolean;