@es-joy/jsoe 0.26.1 → 0.28.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 (158) hide show
  1. package/.gitignore +10 -0
  2. package/.npmignore +9 -0
  3. package/CHANGES.md +76 -0
  4. package/README.md +6 -4
  5. package/badges/coverage-badge.svg +1 -1
  6. package/badges/tests-badge.svg +1 -0
  7. package/dist/formats/schema.d.ts +11 -0
  8. package/dist/formats/schema.d.ts.map +1 -1
  9. package/dist/formats/structuredCloning.d.ts.map +1 -1
  10. package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
  11. package/dist/fundamentalTypes/stringType.d.ts.map +1 -1
  12. package/dist/index.js +2 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/typeChoices.d.ts +32 -2
  15. package/dist/typeChoices.d.ts.map +1 -1
  16. package/dist/types.d.ts +8 -2
  17. package/dist/types.d.ts.map +1 -1
  18. package/dist/utils/rawTypesonEditor.d.ts +110 -0
  19. package/dist/utils/rawTypesonEditor.d.ts.map +1 -0
  20. package/dist/vendor-imports.d.ts +4 -0
  21. package/docs/proposals/raw-typeson-edit-view.md +575 -0
  22. package/eslint.config.js +36 -27
  23. package/mmr.json +6 -0
  24. package/package.json +22 -12
  25. package/pnpm-workspace.yaml +4 -2
  26. package/src/formats/schema.js +38 -7
  27. package/src/formats/structuredCloning.js +24 -17
  28. package/src/fundamentalTypes/arrayType.js +135 -7
  29. package/src/fundamentalTypes/stringType.js +5 -0
  30. package/src/jsoe.css +12 -0
  31. package/src/typeChoices.js +39 -8
  32. package/src/types.js +20 -2
  33. package/src/utils/rawTypesonEditor.js +669 -0
  34. package/src/vendor-imports.js +12 -0
  35. package/tsconfig.json +1 -1
  36. package/typings/json-6.d.ts +12 -0
  37. package/vendor/@codemirror/autocomplete/dist/index.js +2125 -0
  38. package/vendor/@codemirror/commands/dist/index.js +1826 -0
  39. package/vendor/@codemirror/lang-javascript/dist/index.js +513 -0
  40. package/vendor/@codemirror/language/dist/index.js +2693 -0
  41. package/vendor/@codemirror/lint/dist/index.js +956 -0
  42. package/vendor/@codemirror/search/dist/index.js +1238 -0
  43. package/vendor/@codemirror/state/dist/index.js +3947 -0
  44. package/vendor/@codemirror/view/dist/index.js +11867 -0
  45. package/vendor/@lezer/common/dist/index.js +2202 -0
  46. package/vendor/@lezer/highlight/dist/index.js +927 -0
  47. package/vendor/@lezer/javascript/dist/index.js +192 -0
  48. package/vendor/@lezer/lr/dist/index.js +1889 -0
  49. package/vendor/@marijn/find-cluster-break/src/index.js +87 -0
  50. package/vendor/codemirror/dist/index.js +96 -0
  51. package/vendor/crelt/index.js +28 -0
  52. package/vendor/json-6/dist/index.mjs +1783 -0
  53. package/vendor/style-mod/src/style-mod.js +172 -0
  54. package/vendor/typeson-registry/dist/index.js +83 -10
  55. package/vendor/w3c-keyname/index.js +119 -0
  56. package/vendor/zod/classic/checks.d.ts +1 -1
  57. package/vendor/zod/classic/checks.js +1 -1
  58. package/vendor/zod/classic/external.d.ts +1 -1
  59. package/vendor/zod/classic/external.js +1 -1
  60. package/vendor/zod/classic/from-json-schema.js +245 -24
  61. package/vendor/zod/classic/schemas.d.ts +17 -1
  62. package/vendor/zod/classic/schemas.js +77 -29
  63. package/vendor/zod/core/api.d.ts +6 -4
  64. package/vendor/zod/core/api.js +17 -2
  65. package/vendor/zod/core/checks.d.ts +1 -1
  66. package/vendor/zod/core/checks.js +0 -96
  67. package/vendor/zod/core/compile.d.ts +18 -4
  68. package/vendor/zod/core/compile.js +146 -67
  69. package/vendor/zod/core/doc.js +7 -2
  70. package/vendor/zod/core/errors.js +2 -5
  71. package/vendor/zod/core/json-schema-generator.js +2 -2
  72. package/vendor/zod/core/json-schema-processors.d.ts +17 -0
  73. package/vendor/zod/core/json-schema-processors.js +195 -64
  74. package/vendor/zod/core/memoizer.js +72 -23
  75. package/vendor/zod/core/parse.js +37 -16
  76. package/vendor/zod/core/regexes.d.ts +2 -0
  77. package/vendor/zod/core/regexes.js +8 -4
  78. package/vendor/zod/core/schemas.d.ts +42 -7
  79. package/vendor/zod/core/schemas.js +301 -94
  80. package/vendor/zod/core/to-json-schema.d.ts +7 -3
  81. package/vendor/zod/core/to-json-schema.js +8 -7
  82. package/vendor/zod/core/util.d.ts +25 -4
  83. package/vendor/zod/core/util.js +160 -143
  84. package/vendor/zod/core/versions.d.ts +1 -1
  85. package/vendor/zod/core/versions.js +2 -2
  86. package/vendor/zod/core/visit.js +12 -0
  87. package/vendor/zod/locales/ar.js +1 -0
  88. package/vendor/zod/locales/az.js +1 -0
  89. package/vendor/zod/locales/be.js +1 -0
  90. package/vendor/zod/locales/bg.js +1 -0
  91. package/vendor/zod/locales/bn.js +1 -0
  92. package/vendor/zod/locales/ca.js +1 -0
  93. package/vendor/zod/locales/ckb.js +1 -0
  94. package/vendor/zod/locales/cs.js +1 -0
  95. package/vendor/zod/locales/da.js +1 -0
  96. package/vendor/zod/locales/de.js +1 -0
  97. package/vendor/zod/locales/el.js +1 -0
  98. package/vendor/zod/locales/en.js +1 -0
  99. package/vendor/zod/locales/eo.js +1 -0
  100. package/vendor/zod/locales/es.js +1 -0
  101. package/vendor/zod/locales/fa.js +1 -0
  102. package/vendor/zod/locales/fi.js +1 -0
  103. package/vendor/zod/locales/fr-CA.js +1 -0
  104. package/vendor/zod/locales/fr.js +1 -0
  105. package/vendor/zod/locales/gu.js +1 -0
  106. package/vendor/zod/locales/he.js +1 -0
  107. package/vendor/zod/locales/hi.js +1 -0
  108. package/vendor/zod/locales/hr.js +1 -0
  109. package/vendor/zod/locales/hu.js +1 -0
  110. package/vendor/zod/locales/hy.js +1 -0
  111. package/vendor/zod/locales/id.js +1 -0
  112. package/vendor/zod/locales/index.d.ts +1 -0
  113. package/vendor/zod/locales/index.js +1 -0
  114. package/vendor/zod/locales/is.js +1 -0
  115. package/vendor/zod/locales/it.js +1 -0
  116. package/vendor/zod/locales/ja.js +1 -0
  117. package/vendor/zod/locales/ka.js +1 -0
  118. package/vendor/zod/locales/km.js +1 -0
  119. package/vendor/zod/locales/kn.js +1 -0
  120. package/vendor/zod/locales/ko.js +1 -0
  121. package/vendor/zod/locales/lt.js +1 -0
  122. package/vendor/zod/locales/mk.js +1 -0
  123. package/vendor/zod/locales/ms.js +1 -0
  124. package/vendor/zod/locales/ne.js +1 -0
  125. package/vendor/zod/locales/nl.js +1 -0
  126. package/vendor/zod/locales/nn.js +1 -0
  127. package/vendor/zod/locales/no.js +1 -0
  128. package/vendor/zod/locales/ota.js +1 -0
  129. package/vendor/zod/locales/pl.js +1 -0
  130. package/vendor/zod/locales/ps.js +1 -0
  131. package/vendor/zod/locales/pt-BR.js +1 -0
  132. package/vendor/zod/locales/pt.js +1 -0
  133. package/vendor/zod/locales/ro.js +1 -0
  134. package/vendor/zod/locales/ru.js +1 -0
  135. package/vendor/zod/locales/sk.js +1 -0
  136. package/vendor/zod/locales/sl.js +1 -0
  137. package/vendor/zod/locales/sv.js +1 -0
  138. package/vendor/zod/locales/ta.js +1 -0
  139. package/vendor/zod/locales/tg.d.ts +4 -0
  140. package/vendor/zod/locales/tg.js +116 -0
  141. package/vendor/zod/locales/th.js +1 -0
  142. package/vendor/zod/locales/tk.js +1 -0
  143. package/vendor/zod/locales/tr.js +1 -0
  144. package/vendor/zod/locales/uk.js +1 -0
  145. package/vendor/zod/locales/ur.js +1 -0
  146. package/vendor/zod/locales/uz.js +1 -0
  147. package/vendor/zod/locales/vi.js +1 -0
  148. package/vendor/zod/locales/yo.js +1 -0
  149. package/vendor/zod/locales/zh-CN.js +1 -0
  150. package/vendor/zod/locales/zh-TW.js +1 -0
  151. package/vendor/zod/mini/checks.d.ts +1 -1
  152. package/vendor/zod/mini/checks.js +1 -1
  153. package/vendor/zod/mini/external.d.ts +1 -1
  154. package/vendor/zod/mini/external.js +1 -1
  155. package/vendor/zod/mini/schemas.d.ts +8 -0
  156. package/vendor/zod/mini/schemas.js +19 -2
  157. package/vendor/zodexy/dist/esm/index.js +34 -1
  158. package/vendor/zodexy/dist/schema.zodexy.json +18 -0
@@ -0,0 +1,172 @@
1
+ const C = "\u037c"
2
+ const COUNT = typeof Symbol == "undefined" ? "__" + C : Symbol.for(C)
3
+ const SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet")
4
+ const top = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : {}
5
+
6
+ // :: - Style modules encapsulate a set of CSS rules defined from
7
+ // JavaScript. Their definitions are only available in a given DOM
8
+ // root after it has been _mounted_ there with `StyleModule.mount`.
9
+ //
10
+ // Style modules should be created once and stored somewhere, as
11
+ // opposed to re-creating them every time you need them. The amount of
12
+ // CSS rules generated for a given DOM root is bounded by the amount
13
+ // of style modules that were used. So to avoid leaking rules, don't
14
+ // create these dynamically, but treat them as one-time allocations.
15
+ export class StyleModule {
16
+ // :: (Object<Style>, ?{finish: ?(string) → string})
17
+ // Create a style module from the given spec.
18
+ //
19
+ // When `finish` is given, it is called on regular (non-`@`)
20
+ // selectors (after `&` expansion) to compute the final selector.
21
+ constructor(spec, options) {
22
+ this.rules = []
23
+ let {finish} = options || {}
24
+
25
+ function splitSelector(selector) {
26
+ return /^@/.test(selector) ? [selector] : selector.split(/,\s*/)
27
+ }
28
+
29
+ function render(selectors, spec, target, isKeyframes) {
30
+ let local = [], isAt = /^@(\w+)\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == "keyframes"
31
+ if (isAt && spec == null) return target.push(selectors[0] + ";")
32
+ for (let prop in spec) {
33
+ let value = spec[prop]
34
+ if (/&/.test(prop)) {
35
+ render(prop.split(/,\s*/).map(part => selectors.map(sel => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)),
36
+ value, target)
37
+ } else if (value && typeof value == "object") {
38
+ if (!isAt) throw new RangeError("The value of a property (" + prop + ") should be a primitive value.")
39
+ render(splitSelector(prop), value, local, keyframes)
40
+ } else if (value != null) {
41
+ local.push(prop.replace(/_.*/, "").replace(/[A-Z]/g, l => "-" + l.toLowerCase()) + ": " + value + ";")
42
+ }
43
+ }
44
+ if (local.length || keyframes) {
45
+ target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(", ") +
46
+ " {" + local.join(" ") + "}")
47
+ }
48
+ }
49
+
50
+ for (let prop in spec) render(splitSelector(prop), spec[prop], this.rules)
51
+ }
52
+
53
+ // :: () → string
54
+ // Returns a string containing the module's CSS rules.
55
+ getRules() { return this.rules.join("\n") }
56
+
57
+ // :: () → string
58
+ // Generate a new unique CSS class name.
59
+ static newName() {
60
+ let id = top[COUNT] || 1
61
+ top[COUNT] = id + 1
62
+ return C + id.toString(36)
63
+ }
64
+
65
+ // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})
66
+ //
67
+ // Mount the given set of modules in the given DOM root, which ensures
68
+ // that the CSS rules defined by the module are available in that
69
+ // context.
70
+ //
71
+ // Rules are only added to the document once per root.
72
+ //
73
+ // Rule order will follow the order of the modules, so that rules from
74
+ // modules later in the array take precedence of those from earlier
75
+ // modules. If you call this function multiple times for the same root
76
+ // in a way that changes the order of already mounted modules, the old
77
+ // order will be changed.
78
+ //
79
+ // If a Content Security Policy nonce is provided, it is added to
80
+ // the `<style>` tag generated by the library.
81
+ static mount(root, modules, options) {
82
+ let set = root[SET], nonce = options && options.nonce
83
+ if (!set) set = new StyleSet(root, nonce)
84
+ else if (nonce) set.setNonce(nonce)
85
+ set.mount(Array.isArray(modules) ? modules : [modules], root)
86
+ }
87
+ }
88
+
89
+ let adoptedSet = new Map //<Document, StyleSet>
90
+
91
+ class StyleSet {
92
+ constructor(root, nonce) {
93
+ let doc = root.ownerDocument || root, win = doc.defaultView
94
+ if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {
95
+ let adopted = adoptedSet.get(doc)
96
+ if (adopted) return root[SET] = adopted
97
+ this.sheet = new win.CSSStyleSheet
98
+ adoptedSet.set(doc, this)
99
+ } else {
100
+ this.styleTag = doc.createElement("style")
101
+ if (nonce) this.styleTag.setAttribute("nonce", nonce)
102
+ }
103
+ this.modules = []
104
+ root[SET] = this
105
+ }
106
+
107
+ mount(modules, root) {
108
+ let sheet = this.sheet
109
+ let pos = 0 /* Current rule offset */, j = 0 /* Index into this.modules */
110
+ for (let i = 0; i < modules.length; i++) {
111
+ let mod = modules[i], index = this.modules.indexOf(mod)
112
+ if (index < j && index > -1) { // Ordering conflict
113
+ this.modules.splice(index, 1)
114
+ j--
115
+ index = -1
116
+ }
117
+ if (index == -1) {
118
+ this.modules.splice(j++, 0, mod)
119
+ if (sheet) for (let k = 0; k < mod.rules.length; k++)
120
+ sheet.insertRule(mod.rules[k], pos++)
121
+ } else {
122
+ while (j < index) pos += this.modules[j++].rules.length
123
+ pos += mod.rules.length
124
+ j++
125
+ }
126
+ }
127
+
128
+ if (sheet) {
129
+ if (root.adoptedStyleSheets.indexOf(this.sheet) < 0)
130
+ root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets]
131
+ } else {
132
+ let text = ""
133
+ for (let i = 0; i < this.modules.length; i++)
134
+ text += this.modules[i].getRules() + "\n"
135
+ this.styleTag.textContent = text
136
+ let target = root.head || root
137
+ if (this.styleTag.parentNode != target)
138
+ target.insertBefore(this.styleTag, target.firstChild)
139
+ }
140
+ }
141
+
142
+ setNonce(nonce) {
143
+ if (this.styleTag && this.styleTag.getAttribute("nonce") != nonce)
144
+ this.styleTag.setAttribute("nonce", nonce)
145
+ }
146
+ }
147
+
148
+ // Style::Object<union<Style,string>>
149
+ //
150
+ // A style is an object that, in the simple case, maps CSS property
151
+ // names to strings holding their values, as in `{color: "red",
152
+ // fontWeight: "bold"}`. The property names can be given in
153
+ // camel-case—the library will insert a dash before capital letters
154
+ // when converting them to CSS.
155
+ //
156
+ // If you include an underscore in a property name, it and everything
157
+ // after it will be removed from the output, which can be useful when
158
+ // providing a property multiple times, for browser compatibility
159
+ // reasons.
160
+ //
161
+ // A property in a style object can also be a sub-selector, which
162
+ // extends the current context to add a pseudo-selector or a child
163
+ // selector. Such a property should contain a `&` character, which
164
+ // will be replaced by the current selector. For example `{"&:before":
165
+ // {content: '"hi"'}}`. Sub-selectors and regular properties can
166
+ // freely be mixed in a given object. Any property containing a `&` is
167
+ // assumed to be a sub-selector.
168
+ //
169
+ // Finally, a property can specify an @-block to be wrapped around the
170
+ // styles defined inside the object that's the property's value. For
171
+ // example to create a media query you can do `{"@media screen and
172
+ // (min-width: 400px)": {...}}`.
@@ -1051,6 +1051,26 @@ const filelist = {
1051
1051
  }
1052
1052
  };
1053
1053
 
1054
+ /* globals IDBKeyRange -- Polyfill needed */
1055
+
1056
+
1057
+ /**
1058
+ * @type {import('typeson').TypeSpecSet}
1059
+ */
1060
+ const idbkeyrange = {
1061
+ idbkeyrange: {
1062
+ test (x) {
1063
+ return toStringTag(x) === 'IDBKeyRange';
1064
+ },
1065
+ replace ({lower, upper, lowerOpen, upperOpen}) {
1066
+ return {lower, upper, lowerOpen, upperOpen};
1067
+ },
1068
+ revive ({lower, upper, lowerOpen, upperOpen}) {
1069
+ return IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen);
1070
+ }
1071
+ }
1072
+ };
1073
+
1054
1074
  /* globals document, OffscreenCanvas, createImageBitmap -- Polyfills */
1055
1075
  // `ImageBitmap` is browser / DOM specific. It also can only work
1056
1076
  // same-domain (or CORS)
@@ -1432,10 +1452,18 @@ const promise = {
1432
1452
  const quotaexceedederror = {
1433
1453
  quotaexceedederror: {
1434
1454
  test (x) { return toStringTag(x) === 'QuotaExceededError'; },
1435
- replace ({message, quota, requested}) {
1436
- return {message, quota, requested};
1455
+ replace ({
1456
+ message, quota, requested,
1457
+ cause, stack, fileName, lineNumber, columnNumber
1458
+ }) {
1459
+ return {
1460
+ message, quota, requested,
1461
+ cause, stack, fileName, lineNumber, columnNumber
1462
+ };
1437
1463
  },
1438
- revive ({message, quota, requested}) {
1464
+ revive (obj) {
1465
+ const {message, quota, requested} = obj;
1466
+
1439
1467
  /** @type {{quota?: number, requested?: number}} */
1440
1468
  const options = {};
1441
1469
  if (quota !== null && quota !== undefined) {
@@ -1444,7 +1472,26 @@ const quotaexceedederror = {
1444
1472
  if (requested !== null && requested !== undefined) {
1445
1473
  options.requested = requested;
1446
1474
  }
1447
- return new QuotaExceededError(message, options);
1475
+ const e = /**
1476
+ * @type {{
1477
+ * name: string,
1478
+ * cause: Error,
1479
+ * stack: string,
1480
+ * fileName?: string,
1481
+ * lineNumber?: import('typeson').Integer,
1482
+ * columnNumber?: import('typeson').Integer
1483
+ * }}
1484
+ */ (
1485
+ new QuotaExceededError(message, options)
1486
+ );
1487
+
1488
+ e.cause = obj.cause;
1489
+ e.stack = obj.stack;
1490
+ e.fileName = obj.fileName;
1491
+ e.lineNumber = obj.lineNumber;
1492
+ e.columnNumber = obj.columnNumber;
1493
+
1494
+ return e;
1448
1495
  }
1449
1496
  }
1450
1497
  };
@@ -1824,15 +1871,41 @@ const webtransporterror = {
1824
1871
  test (x) { return toStringTag(x) === 'WebTransportError'; },
1825
1872
  // Note that we can't support the `source` property (defaults
1826
1873
  // to `stream` instead of `session`)
1827
- replace ({message, streamErrorCode}) {
1828
- return {message, streamErrorCode};
1874
+ replace ({
1875
+ message, streamErrorCode,
1876
+ cause, stack, fileName, lineNumber, columnNumber
1877
+ }) {
1878
+ return {
1879
+ message, streamErrorCode,
1880
+ cause, stack, fileName, lineNumber, columnNumber
1881
+ };
1829
1882
  },
1830
- revive ({message, streamErrorCode}) {
1883
+ revive (obj) {
1884
+ const {message, streamErrorCode} = obj;
1831
1885
  // TS lib still models the older two-argument
1832
1886
  // `(message, options)` form; browsers implement a single
1833
1887
  // `init` object (which also carries `message`).
1834
- // @ts-expect-error - More recent API
1835
- return new WebTransportError({message, streamErrorCode});
1888
+ const e = /**
1889
+ * @type {{
1890
+ * name: string,
1891
+ * cause: Error,
1892
+ * stack: string,
1893
+ * fileName?: string,
1894
+ * lineNumber?: import('typeson').Integer,
1895
+ * columnNumber?: import('typeson').Integer
1896
+ * }}
1897
+ */ (
1898
+ // @ts-expect-error - More recent API
1899
+ new WebTransportError({message, streamErrorCode})
1900
+ );
1901
+
1902
+ e.cause = obj.cause;
1903
+ e.stack = obj.stack;
1904
+ e.fileName = obj.fileName;
1905
+ e.lineNumber = obj.lineNumber;
1906
+ e.columnNumber = obj.columnNumber;
1907
+
1908
+ return e;
1836
1909
  }
1837
1910
  }
1838
1911
  };
@@ -2256,5 +2329,5 @@ const universal = [
2256
2329
  // built-in into ecmasript standard.
2257
2330
  ];
2258
2331
 
2259
- export { c as JSON_TYPES, Typeson, TypesonPromise, Undefined, arrayNonindexKeys, arraybuffer, audiodata, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, encodedaudiochunk, encodedvideochunk, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningForStorage, structuredCloningThrowing, symbol, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject, videoframe, webtransporterror };
2332
+ export { c as JSON_TYPES, Typeson, TypesonPromise, Undefined, arrayNonindexKeys, arraybuffer, audiodata, bigint, bigintObject, blob, expObj$1 as builtin, cloneable, cryptokey, dataview, date, domexception, dommatrix, dompoint, domquad, domrect, encodedaudiochunk, encodedvideochunk, error, errors, escapeKeyPathComponent, file, filelist, getByKeyPath, getJSONType, hasConstructorOf, idbkeyrange, imagebitmap, imagedata, infinity, intlTypes, isObject, isPlainObject, isThenable, isUserObject, map, nan, negativeInfinity, negativeZero, nonbuiltinIgnore, postmessage, primitiveObjects, promise, quotaexceedederror, regexp, resurrectable, set, setAtKeyPath, socketio, sparseUndefined, specialNumbers, expObj as structuredCloning, structuredCloningForStorage, structuredCloningThrowing, symbol, toStringTag, typedArrays, typedArraysSocketIO as typedArraysSocketio, undef$1 as undef, undef as undefPreset, unescapeKeyPathComponent, universal, userObject, videoframe, webtransporterror };
2260
2333
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,119 @@
1
+ export var base = {
2
+ 8: "Backspace",
3
+ 9: "Tab",
4
+ 10: "Enter",
5
+ 12: "NumLock",
6
+ 13: "Enter",
7
+ 16: "Shift",
8
+ 17: "Control",
9
+ 18: "Alt",
10
+ 20: "CapsLock",
11
+ 27: "Escape",
12
+ 32: " ",
13
+ 33: "PageUp",
14
+ 34: "PageDown",
15
+ 35: "End",
16
+ 36: "Home",
17
+ 37: "ArrowLeft",
18
+ 38: "ArrowUp",
19
+ 39: "ArrowRight",
20
+ 40: "ArrowDown",
21
+ 44: "PrintScreen",
22
+ 45: "Insert",
23
+ 46: "Delete",
24
+ 59: ";",
25
+ 61: "=",
26
+ 91: "Meta",
27
+ 92: "Meta",
28
+ 106: "*",
29
+ 107: "+",
30
+ 108: ",",
31
+ 109: "-",
32
+ 110: ".",
33
+ 111: "/",
34
+ 144: "NumLock",
35
+ 145: "ScrollLock",
36
+ 160: "Shift",
37
+ 161: "Shift",
38
+ 162: "Control",
39
+ 163: "Control",
40
+ 164: "Alt",
41
+ 165: "Alt",
42
+ 173: "-",
43
+ 186: ";",
44
+ 187: "=",
45
+ 188: ",",
46
+ 189: "-",
47
+ 190: ".",
48
+ 191: "/",
49
+ 192: "`",
50
+ 219: "[",
51
+ 220: "\\",
52
+ 221: "]",
53
+ 222: "'"
54
+ }
55
+
56
+ export var shift = {
57
+ 48: ")",
58
+ 49: "!",
59
+ 50: "@",
60
+ 51: "#",
61
+ 52: "$",
62
+ 53: "%",
63
+ 54: "^",
64
+ 55: "&",
65
+ 56: "*",
66
+ 57: "(",
67
+ 59: ":",
68
+ 61: "+",
69
+ 173: "_",
70
+ 186: ":",
71
+ 187: "+",
72
+ 188: "<",
73
+ 189: "_",
74
+ 190: ">",
75
+ 191: "?",
76
+ 192: "~",
77
+ 219: "{",
78
+ 220: "|",
79
+ 221: "}",
80
+ 222: "\""
81
+ }
82
+
83
+ var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform)
84
+ var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent)
85
+
86
+ // Fill in the digit keys
87
+ for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)
88
+
89
+ // The function keys
90
+ for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i
91
+
92
+ // And the alphabetic keys
93
+ for (var i = 65; i <= 90; i++) {
94
+ base[i] = String.fromCharCode(i + 32)
95
+ shift[i] = String.fromCharCode(i)
96
+ }
97
+
98
+ // For each code that doesn't have a shift-equivalent, copy the base name
99
+ for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]
100
+
101
+ export function keyName(event) {
102
+ // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.
103
+ // On IE, shift effect is never included in `.key`.
104
+ var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||
105
+ ie && event.shiftKey && event.key && event.key.length == 1 ||
106
+ event.key == "Unidentified"
107
+ var name = (!ignoreKey && event.key) ||
108
+ (event.shiftKey ? shift : base)[event.keyCode] ||
109
+ event.key || "Unidentified"
110
+ // Edge sometimes produces wrong names (Issue #3)
111
+ if (name == "Esc") name = "Escape"
112
+ if (name == "Del") name = "Delete"
113
+ // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/
114
+ if (name == "Left") name = "ArrowLeft"
115
+ if (name == "Up") name = "ArrowUp"
116
+ if (name == "Right") name = "ArrowRight"
117
+ if (name == "Down") name = "ArrowDown"
118
+ return name
119
+ }
@@ -1 +1 @@
1
- export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
1
+ export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, type $RefinementCtx as RefinementCtx, } from "../core/index.js";
@@ -1 +1 @@
1
- export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, } from "../core/index.js";
1
+ export { _lt as lt, _lte as lte, _gt as gt, _gte as gte, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, _slugify as slugify, } from "../core/index.js";
@@ -7,7 +7,7 @@ export * from "./compat.js";
7
7
  export type { infer } from "../core/index.js";
8
8
  export type { JSONType } from "../core/util.js";
9
9
  export type { CompileOptions } from "../core/index.js";
10
- export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
10
+ export { globalRegistry, type GlobalMeta, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
11
11
  export { toJSONSchema } from "../core/json-schema-processors.js";
12
12
  export { fromJSONSchema } from "./from-json-schema.js";
13
13
  export { deepPartial } from "./deep-partial.js";
@@ -4,7 +4,7 @@ export * from "./checks.js";
4
4
  export * from "./errors.js";
5
5
  export * from "./parse.js";
6
6
  export * from "./compat.js";
7
- export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, toZod, compile, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
7
+ export { globalRegistry, registry, config, memoizer, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, INVALID, toZod, compile, withParser, ZodCompileAsyncError, ZodCompileUnsupportedError, getDiscriminatedOption, } from "../core/index.js";
8
8
  export { toJSONSchema } from "../core/json-schema-processors.js";
9
9
  export { fromJSONSchema } from "./from-json-schema.js";
10
10
  export { deepPartial } from "./deep-partial.js";