module-develop-kit 1.2.3 → 1.3.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 (58) hide show
  1. package/dist/commonjs-virtual-dir/_commonjsHelpers.js +3 -28
  2. package/dist/commonjs-virtual-dir/browser.js +5 -2
  3. package/dist/commonjs-virtual-dir/browser2.js +2 -5
  4. package/dist/commonjs-virtual-dir/index2.js +3 -5
  5. package/dist/commonjs-virtual-dir/index3.js +5 -3
  6. package/dist/main.d.ts +5 -0
  7. package/dist/main.js +37 -35
  8. package/dist/src/outside-call/utils.js +1 -1
  9. package/dist/src/shield/create-cos-file-name.js +8 -0
  10. package/dist/src/shield/crypto/sm4.js +1 -1
  11. package/dist/src/vite-plugins/generateSriHash.js +26 -0
  12. package/dist/src/vite-plugins/vite-plugin-sri/config.js +8 -0
  13. package/dist/src/vite-plugins/vite-plugin-sri/index.js +125 -0
  14. package/dist/src/vite-plugins/vite-plugin-sri/internal.js +1173 -0
  15. package/dist/vendor/@tokenizer/inflate/lib/ZipHandler.js +1 -1
  16. package/dist/vendor/debug/src/browser.js +1 -1
  17. package/dist/vendor/file-type/source/detectors/ebml.js +1 -1
  18. package/dist/vendor/file-type/source/detectors/zip.js +1 -1
  19. package/dist/vendor/file-type/source/index.js +1 -1
  20. package/dist/vendor/file-type/source/tokens.js +1 -1
  21. package/dist/vendor/gm-crypt/src/crypt.js +1 -1
  22. package/dist/vendor/jssip/lib-es5/Message.js +11 -11
  23. package/dist/vendor/jssip/lib-es5/Options.js +13 -13
  24. package/dist/vendor/jssip/lib-es5/RTCSession/DTMF.js +4 -4
  25. package/dist/vendor/jssip/lib-es5/RTCSession/Info.js +12 -12
  26. package/dist/vendor/jssip/lib-es5/RTCSession/ReferSubscriber.js +7 -7
  27. package/dist/vendor/jssip/lib-es5/RTCSession.js +2 -2
  28. package/dist/vendor/jssip/lib-es5/Transactions.js +15 -15
  29. package/dist/vendor/jssip/lib-es5/UA.js +5 -5
  30. package/dist/vendor/nanoid/index.browser.js +11 -0
  31. package/dist/vendor/nanoid/url-alphabet/index.js +4 -0
  32. package/dist/vendor/parse5/dist/common/doctype.js +98 -0
  33. package/dist/vendor/parse5/dist/common/error-codes.js +7 -0
  34. package/dist/vendor/parse5/dist/common/foreign-content.js +210 -0
  35. package/dist/vendor/parse5/dist/common/html.js +261 -0
  36. package/dist/vendor/parse5/dist/common/token.js +14 -0
  37. package/dist/vendor/parse5/dist/common/unicode.js +73 -0
  38. package/dist/vendor/parse5/dist/index.js +18 -0
  39. package/dist/vendor/parse5/dist/parser/formatting-element-list.js +84 -0
  40. package/dist/vendor/parse5/dist/parser/index.js +2271 -0
  41. package/dist/vendor/parse5/dist/parser/open-element-stack.js +240 -0
  42. package/dist/vendor/parse5/dist/serializer/index.js +85 -0
  43. package/dist/vendor/parse5/dist/tokenizer/index.js +1940 -0
  44. package/dist/vendor/parse5/dist/tokenizer/preprocessor.js +88 -0
  45. package/dist/vendor/parse5/dist/tree-adapters/default.js +162 -0
  46. package/dist/vendor/parse5/node_modules/entities/dist/decode-codepoint.js +37 -0
  47. package/dist/vendor/parse5/node_modules/entities/dist/decode.js +270 -0
  48. package/dist/vendor/parse5/node_modules/entities/dist/escape.js +22 -0
  49. package/dist/vendor/parse5/node_modules/entities/dist/generated/decode-data-html.js +5 -0
  50. package/dist/vendor/parse5/node_modules/entities/dist/internal/bin-trie-flags.js +7 -0
  51. package/dist/vendor/parse5/node_modules/entities/dist/internal/decode-shared.js +11 -0
  52. package/dist/vite-plugins/index.d.ts +161 -0
  53. package/dist/vite-plugins/index.js +14 -6
  54. package/package.json +3 -1
  55. package/dist/commonjs-virtual-dir/___vite-browser-external.js +0 -6
  56. package/dist/commonjs-virtual-dir/__vite-browser-external.js +0 -4
  57. package/dist/commonjs-virtual-dir/events.js +0 -4
  58. package/dist/vendor/events/events.js +0 -216
@@ -0,0 +1,240 @@
1
+ import { TAG_ID as t, NS as n, NUMBERED_HEADERS as h } from "../common/html.js";
2
+ const p = /* @__PURE__ */ new Set([t.DD, t.DT, t.LI, t.OPTGROUP, t.OPTION, t.P, t.RB, t.RP, t.RT, t.RTC]), T = /* @__PURE__ */ new Set([
3
+ ...p,
4
+ t.CAPTION,
5
+ t.COLGROUP,
6
+ t.TBODY,
7
+ t.TD,
8
+ t.TFOOT,
9
+ t.TH,
10
+ t.THEAD,
11
+ t.TR
12
+ ]), a = /* @__PURE__ */ new Set([
13
+ t.APPLET,
14
+ t.CAPTION,
15
+ t.HTML,
16
+ t.MARQUEE,
17
+ t.OBJECT,
18
+ t.TABLE,
19
+ t.TD,
20
+ t.TEMPLATE,
21
+ t.TH
22
+ ]), u = /* @__PURE__ */ new Set([...a, t.OL, t.UL]), l = /* @__PURE__ */ new Set([...a, t.BUTTON]), o = /* @__PURE__ */ new Set([t.ANNOTATION_XML, t.MI, t.MN, t.MO, t.MS, t.MTEXT]), c = /* @__PURE__ */ new Set([t.DESC, t.FOREIGN_OBJECT, t.TITLE]), d = /* @__PURE__ */ new Set([t.TR, t.TEMPLATE, t.HTML]), I = /* @__PURE__ */ new Set([t.TBODY, t.TFOOT, t.THEAD, t.TEMPLATE, t.HTML]), m = /* @__PURE__ */ new Set([t.TABLE, t.TEMPLATE, t.HTML]), E = /* @__PURE__ */ new Set([t.TD, t.TH]);
23
+ class f {
24
+ get currentTmplContentOrNode() {
25
+ return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
26
+ }
27
+ constructor(e, s, i) {
28
+ this.treeAdapter = s, this.handler = i, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = t.UNKNOWN, this.current = e;
29
+ }
30
+ //Index of element
31
+ _indexOf(e) {
32
+ return this.items.lastIndexOf(e, this.stackTop);
33
+ }
34
+ //Update current element
35
+ _isInTemplate() {
36
+ return this.currentTagId === t.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === n.HTML;
37
+ }
38
+ _updateCurrentElement() {
39
+ this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop];
40
+ }
41
+ //Mutations
42
+ push(e, s) {
43
+ this.stackTop++, this.items[this.stackTop] = e, this.current = e, this.tagIDs[this.stackTop] = s, this.currentTagId = s, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e, s, !0);
44
+ }
45
+ pop() {
46
+ const e = this.current;
47
+ this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !0);
48
+ }
49
+ replace(e, s) {
50
+ const i = this._indexOf(e);
51
+ this.items[i] = s, i === this.stackTop && (this.current = s);
52
+ }
53
+ insertAfter(e, s, i) {
54
+ const r = this._indexOf(e) + 1;
55
+ this.items.splice(r, 0, s), this.tagIDs.splice(r, 0, i), this.stackTop++, r === this.stackTop && this._updateCurrentElement(), this.current && this.currentTagId !== void 0 && this.handler.onItemPush(this.current, this.currentTagId, r === this.stackTop);
56
+ }
57
+ popUntilTagNamePopped(e) {
58
+ let s = this.stackTop + 1;
59
+ do
60
+ s = this.tagIDs.lastIndexOf(e, s - 1);
61
+ while (s > 0 && this.treeAdapter.getNamespaceURI(this.items[s]) !== n.HTML);
62
+ this.shortenToLength(Math.max(s, 0));
63
+ }
64
+ shortenToLength(e) {
65
+ for (; this.stackTop >= e; ) {
66
+ const s = this.current;
67
+ this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(s, this.stackTop < e);
68
+ }
69
+ }
70
+ popUntilElementPopped(e) {
71
+ const s = this._indexOf(e);
72
+ this.shortenToLength(Math.max(s, 0));
73
+ }
74
+ popUntilPopped(e, s) {
75
+ const i = this._indexOfTagNames(e, s);
76
+ this.shortenToLength(Math.max(i, 0));
77
+ }
78
+ popUntilNumberedHeaderPopped() {
79
+ this.popUntilPopped(h, n.HTML);
80
+ }
81
+ popUntilTableCellPopped() {
82
+ this.popUntilPopped(E, n.HTML);
83
+ }
84
+ popAllUpToHtmlElement() {
85
+ this.tmplCount = 0, this.shortenToLength(1);
86
+ }
87
+ _indexOfTagNames(e, s) {
88
+ for (let i = this.stackTop; i >= 0; i--)
89
+ if (e.has(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === s)
90
+ return i;
91
+ return -1;
92
+ }
93
+ clearBackTo(e, s) {
94
+ const i = this._indexOfTagNames(e, s);
95
+ this.shortenToLength(i + 1);
96
+ }
97
+ clearBackToTableContext() {
98
+ this.clearBackTo(m, n.HTML);
99
+ }
100
+ clearBackToTableBodyContext() {
101
+ this.clearBackTo(I, n.HTML);
102
+ }
103
+ clearBackToTableRowContext() {
104
+ this.clearBackTo(d, n.HTML);
105
+ }
106
+ remove(e) {
107
+ const s = this._indexOf(e);
108
+ s >= 0 && (s === this.stackTop ? this.pop() : (this.items.splice(s, 1), this.tagIDs.splice(s, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !1)));
109
+ }
110
+ //Search
111
+ tryPeekProperlyNestedBodyElement() {
112
+ return this.stackTop >= 1 && this.tagIDs[1] === t.BODY ? this.items[1] : null;
113
+ }
114
+ contains(e) {
115
+ return this._indexOf(e) > -1;
116
+ }
117
+ getCommonAncestor(e) {
118
+ const s = this._indexOf(e) - 1;
119
+ return s >= 0 ? this.items[s] : null;
120
+ }
121
+ isRootHtmlElementCurrent() {
122
+ return this.stackTop === 0 && this.tagIDs[0] === t.HTML;
123
+ }
124
+ //Element in scope
125
+ hasInDynamicScope(e, s) {
126
+ for (let i = this.stackTop; i >= 0; i--) {
127
+ const r = this.tagIDs[i];
128
+ switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
129
+ case n.HTML: {
130
+ if (r === e)
131
+ return !0;
132
+ if (s.has(r))
133
+ return !1;
134
+ break;
135
+ }
136
+ case n.SVG: {
137
+ if (c.has(r))
138
+ return !1;
139
+ break;
140
+ }
141
+ case n.MATHML: {
142
+ if (o.has(r))
143
+ return !1;
144
+ break;
145
+ }
146
+ }
147
+ }
148
+ return !0;
149
+ }
150
+ hasInScope(e) {
151
+ return this.hasInDynamicScope(e, a);
152
+ }
153
+ hasInListItemScope(e) {
154
+ return this.hasInDynamicScope(e, u);
155
+ }
156
+ hasInButtonScope(e) {
157
+ return this.hasInDynamicScope(e, l);
158
+ }
159
+ hasNumberedHeaderInScope() {
160
+ for (let e = this.stackTop; e >= 0; e--) {
161
+ const s = this.tagIDs[e];
162
+ switch (this.treeAdapter.getNamespaceURI(this.items[e])) {
163
+ case n.HTML: {
164
+ if (h.has(s))
165
+ return !0;
166
+ if (a.has(s))
167
+ return !1;
168
+ break;
169
+ }
170
+ case n.SVG: {
171
+ if (c.has(s))
172
+ return !1;
173
+ break;
174
+ }
175
+ case n.MATHML: {
176
+ if (o.has(s))
177
+ return !1;
178
+ break;
179
+ }
180
+ }
181
+ }
182
+ return !0;
183
+ }
184
+ hasInTableScope(e) {
185
+ for (let s = this.stackTop; s >= 0; s--)
186
+ if (this.treeAdapter.getNamespaceURI(this.items[s]) === n.HTML)
187
+ switch (this.tagIDs[s]) {
188
+ case e:
189
+ return !0;
190
+ case t.TABLE:
191
+ case t.HTML:
192
+ return !1;
193
+ }
194
+ return !0;
195
+ }
196
+ hasTableBodyContextInTableScope() {
197
+ for (let e = this.stackTop; e >= 0; e--)
198
+ if (this.treeAdapter.getNamespaceURI(this.items[e]) === n.HTML)
199
+ switch (this.tagIDs[e]) {
200
+ case t.TBODY:
201
+ case t.THEAD:
202
+ case t.TFOOT:
203
+ return !0;
204
+ case t.TABLE:
205
+ case t.HTML:
206
+ return !1;
207
+ }
208
+ return !0;
209
+ }
210
+ hasInSelectScope(e) {
211
+ for (let s = this.stackTop; s >= 0; s--)
212
+ if (this.treeAdapter.getNamespaceURI(this.items[s]) === n.HTML)
213
+ switch (this.tagIDs[s]) {
214
+ case e:
215
+ return !0;
216
+ case t.OPTION:
217
+ case t.OPTGROUP:
218
+ break;
219
+ default:
220
+ return !1;
221
+ }
222
+ return !0;
223
+ }
224
+ //Implied end tags
225
+ generateImpliedEndTags() {
226
+ for (; this.currentTagId !== void 0 && p.has(this.currentTagId); )
227
+ this.pop();
228
+ }
229
+ generateImpliedEndTagsThoroughly() {
230
+ for (; this.currentTagId !== void 0 && T.has(this.currentTagId); )
231
+ this.pop();
232
+ }
233
+ generateImpliedEndTagsWithExclusion(e) {
234
+ for (; this.currentTagId !== void 0 && this.currentTagId !== e && T.has(this.currentTagId); )
235
+ this.pop();
236
+ }
237
+ }
238
+ export {
239
+ f as OpenElementStack
240
+ };
@@ -0,0 +1,85 @@
1
+ import { NS as c, TAG_NAMES as a, hasUnescapedText as l } from "../common/html.js";
2
+ import { escapeText as N, escapeAttribute as A } from "../../node_modules/entities/dist/escape.js";
3
+ import { defaultTreeAdapter as f } from "../tree-adapters/default.js";
4
+ const d = /* @__PURE__ */ new Set([
5
+ a.AREA,
6
+ a.BASE,
7
+ a.BASEFONT,
8
+ a.BGSOUND,
9
+ a.BR,
10
+ a.COL,
11
+ a.EMBED,
12
+ a.FRAME,
13
+ a.HR,
14
+ a.IMG,
15
+ a.INPUT,
16
+ a.KEYGEN,
17
+ a.LINK,
18
+ a.META,
19
+ a.PARAM,
20
+ a.SOURCE,
21
+ a.TRACK,
22
+ a.WBR
23
+ ]);
24
+ function s(e, t) {
25
+ return t.treeAdapter.isElementNode(e) && t.treeAdapter.getNamespaceURI(e) === c.HTML && d.has(t.treeAdapter.getTagName(e));
26
+ }
27
+ const T = { treeAdapter: f, scriptingEnabled: !0 };
28
+ function o(e, t) {
29
+ const r = { ...T, ...t };
30
+ return s(e, r) ? "" : u(e, r);
31
+ }
32
+ function u(e, t) {
33
+ let r = "";
34
+ const n = t.treeAdapter.isElementNode(e) && t.treeAdapter.getTagName(e) === a.TEMPLATE && t.treeAdapter.getNamespaceURI(e) === c.HTML ? t.treeAdapter.getTemplateContent(e) : e, m = t.treeAdapter.getChildNodes(n);
35
+ if (m)
36
+ for (const i of m)
37
+ r += E(i, t);
38
+ return r;
39
+ }
40
+ function E(e, t) {
41
+ return t.treeAdapter.isElementNode(e) ? g(e, t) : t.treeAdapter.isTextNode(e) ? M(e, t) : t.treeAdapter.isCommentNode(e) ? C(e, t) : t.treeAdapter.isDocumentTypeNode(e) ? $(e, t) : "";
42
+ }
43
+ function g(e, t) {
44
+ const r = t.treeAdapter.getTagName(e);
45
+ return `<${r}${p(e, t)}>${s(e, t) ? "" : `${u(e, t)}</${r}>`}`;
46
+ }
47
+ function p(e, { treeAdapter: t }) {
48
+ let r = "";
49
+ for (const n of t.getAttrList(e)) {
50
+ if (r += " ", n.namespace)
51
+ switch (n.namespace) {
52
+ case c.XML: {
53
+ r += `xml:${n.name}`;
54
+ break;
55
+ }
56
+ case c.XMLNS: {
57
+ n.name !== "xmlns" && (r += "xmlns:"), r += n.name;
58
+ break;
59
+ }
60
+ case c.XLINK: {
61
+ r += `xlink:${n.name}`;
62
+ break;
63
+ }
64
+ default:
65
+ r += `${n.prefix}:${n.name}`;
66
+ }
67
+ else
68
+ r += n.name;
69
+ r += `="${A(n.value)}"`;
70
+ }
71
+ return r;
72
+ }
73
+ function M(e, t) {
74
+ const { treeAdapter: r } = t, n = r.getTextNodeContent(e), m = r.getParentNode(e), i = m && r.isElementNode(m) && r.getTagName(m);
75
+ return i && r.getNamespaceURI(m) === c.HTML && l(i, t.scriptingEnabled) ? n : N(n);
76
+ }
77
+ function C(e, { treeAdapter: t }) {
78
+ return `<!--${t.getCommentNodeContent(e)}-->`;
79
+ }
80
+ function $(e, { treeAdapter: t }) {
81
+ return `<!DOCTYPE ${t.getDocumentTypeNodeName(e)}>`;
82
+ }
83
+ export {
84
+ o as serialize
85
+ };