@tinacms/app 1.0.7 → 1.1.1

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 (134) hide show
  1. package/appFiles/node_modules/.package-lock.json +29 -28
  2. package/appFiles/node_modules/@babel/generator/lib/buffer.js +34 -10
  3. package/appFiles/node_modules/@babel/generator/lib/buffer.js.map +1 -1
  4. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +3 -4
  5. package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
  6. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +7 -0
  7. package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
  8. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +51 -8
  9. package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
  10. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +7 -10
  11. package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
  12. package/appFiles/node_modules/@babel/generator/lib/generators/types.js +2 -0
  13. package/appFiles/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
  14. package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js +2 -2
  15. package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -1
  16. package/appFiles/node_modules/@babel/generator/lib/index.js +1 -1
  17. package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
  18. package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
  19. package/appFiles/node_modules/@babel/generator/lib/printer.js +7 -0
  20. package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
  21. package/appFiles/node_modules/@babel/generator/lib/source-map.js +40 -9
  22. package/appFiles/node_modules/@babel/generator/lib/source-map.js.map +1 -1
  23. package/appFiles/node_modules/@babel/generator/package.json +5 -5
  24. package/appFiles/node_modules/@babel/helper-function-name/lib/index.js +0 -31
  25. package/appFiles/node_modules/@babel/helper-function-name/lib/index.js.map +1 -1
  26. package/appFiles/node_modules/@babel/helper-function-name/package.json +3 -3
  27. package/appFiles/node_modules/@babel/parser/lib/index.js +1901 -1885
  28. package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
  29. package/appFiles/node_modules/@babel/parser/package.json +2 -2
  30. package/appFiles/node_modules/@babel/parser/typings/babel-parser.d.ts +12 -0
  31. package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203R.js +173 -170
  32. package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2301.js +221 -0
  33. package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +173 -170
  34. package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +220 -0
  35. package/appFiles/node_modules/@babel/runtime/package.json +10 -1
  36. package/appFiles/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
  37. package/appFiles/node_modules/@babel/traverse/lib/visitors.js +11 -5
  38. package/appFiles/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
  39. package/appFiles/node_modules/@babel/traverse/package.json +5 -5
  40. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js +12 -7
  41. package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
  42. package/appFiles/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
  43. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js +5 -5
  44. package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
  45. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js +2 -6
  46. package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
  47. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js +5 -4
  48. package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -1
  49. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +0 -3
  50. package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
  51. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js +1 -2
  52. package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -1
  53. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js +0 -3
  54. package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -1
  55. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js +0 -3
  56. package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -1
  57. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js +0 -3
  58. package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -1
  59. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js +0 -1
  60. package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
  61. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js +0 -3
  62. package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
  63. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js +1 -9
  64. package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -1
  65. package/appFiles/node_modules/@babel/types/lib/definitions/core.js +21 -57
  66. package/appFiles/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
  67. package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +12 -0
  68. package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
  69. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js +0 -3
  70. package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -1
  71. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js +0 -1
  72. package/appFiles/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
  73. package/appFiles/node_modules/@babel/types/lib/definitions/index.js +10 -0
  74. package/appFiles/node_modules/@babel/types/lib/definitions/index.js.map +1 -1
  75. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js +6 -4
  76. package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
  77. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js +0 -2
  78. package/appFiles/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
  79. package/appFiles/node_modules/@babel/types/lib/index-legacy.d.ts +10 -3
  80. package/appFiles/node_modules/@babel/types/lib/index.d.ts +23 -6
  81. package/appFiles/node_modules/@babel/types/lib/index.js +9 -2
  82. package/appFiles/node_modules/@babel/types/lib/index.js.flow +8 -3
  83. package/appFiles/node_modules/@babel/types/lib/index.js.map +1 -1
  84. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +1 -9
  85. package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -1
  86. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js +0 -3
  87. package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -1
  88. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js +1 -3
  89. package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -1
  90. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +0 -8
  91. package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
  92. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +2 -6
  93. package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
  94. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js +1 -2
  95. package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -1
  96. package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js +30 -0
  97. package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
  98. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +0 -3
  99. package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
  100. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js +1 -2
  101. package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -1
  102. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js +11 -6
  103. package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
  104. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js +2 -4
  105. package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -1
  106. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js +1 -2
  107. package/appFiles/node_modules/@babel/types/lib/validators/isLet.js.map +1 -1
  108. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +1 -2
  109. package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -1
  110. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js +0 -21
  111. package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -1
  112. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js +0 -1
  113. package/appFiles/node_modules/@babel/types/lib/validators/isScope.js.map +1 -1
  114. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +1 -2
  115. package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
  116. package/appFiles/node_modules/@babel/types/lib/validators/isType.js +0 -1
  117. package/appFiles/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
  118. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +0 -1
  119. package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -1
  120. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js +1 -2
  121. package/appFiles/node_modules/@babel/types/lib/validators/isVar.js.map +1 -1
  122. package/appFiles/node_modules/@babel/types/package.json +3 -3
  123. package/appFiles/node_modules/css-to-react-native/index.d.ts +17 -0
  124. package/appFiles/node_modules/css-to-react-native/index.js +15 -0
  125. package/appFiles/node_modules/css-to-react-native/package.json +2 -1
  126. package/appFiles/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +23 -0
  127. package/appFiles/node_modules/css-to-react-native/src/transforms/aspectRatio.js +12 -0
  128. package/appFiles/node_modules/css-to-react-native/src/transforms/index.js +2 -0
  129. package/appFiles/src/App.tsx +3 -5
  130. package/appFiles/src/fields/rich-text/monaco/mdx.js +8573 -3668
  131. package/appFiles/src/lib/machines/query-machine.ts +0 -13
  132. package/appFiles/src/preview.tsx +22 -0
  133. package/dist/index.js +3 -1
  134. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babel/parser",
3
- "version": "7.20.15",
3
+ "version": "7.21.2",
4
4
  "description": "A JavaScript parser",
5
5
  "author": "The Babel Team (https://babel.dev/team)",
6
6
  "homepage": "https://babel.dev/docs/en/next/babel-parser",
@@ -36,7 +36,7 @@
36
36
  "devDependencies": {
37
37
  "@babel/code-frame": "^7.18.6",
38
38
  "@babel/helper-check-duplicate-nodes": "^7.18.6",
39
- "@babel/helper-fixtures": "^7.19.4",
39
+ "@babel/helper-fixtures": "^7.21.0",
40
40
  "@babel/helper-string-parser": "^7.19.4",
41
41
  "@babel/helper-validator-identifier": "^7.19.1",
42
42
  "charcodes": "^0.2.0"
@@ -122,6 +122,12 @@ interface ParserOptions {
122
122
  */
123
123
  allowReturnOutsideFunction?: boolean;
124
124
 
125
+ /**
126
+ * By default, new.target use is not allowed outside of a function or class.
127
+ * Set this to true to accept such code.
128
+ */
129
+ allowNewTargetOutsideFunction?: boolean;
130
+
125
131
  allowSuperOutsideMethod?: boolean;
126
132
 
127
133
  /**
@@ -130,6 +136,12 @@ interface ParserOptions {
130
136
  */
131
137
  allowUndeclaredExports?: boolean;
132
138
 
139
+ /**
140
+ * By default, Babel parser JavaScript code according to Annex B syntax.
141
+ * Set this to `false` to disable such behavior.
142
+ */
143
+ annexB?: boolean;
144
+
133
145
  /**
134
146
  * By default, Babel attaches comments to adjacent AST nodes.
135
147
  * When this option is set to false, comments are not attached.
@@ -1,188 +1,191 @@
1
1
  var _typeof = require("./typeof.js")["default"];
2
- function createAddInitializerMethod(initializers, decoratorFinishedRef) {
3
- return function (initializer) {
4
- assertNotFinished(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
5
- };
6
- }
7
- function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
8
- var kindStr;
9
- switch (kind) {
10
- case 1:
11
- kindStr = "accessor";
12
- break;
13
- case 2:
14
- kindStr = "method";
15
- break;
16
- case 3:
17
- kindStr = "getter";
18
- break;
19
- case 4:
20
- kindStr = "setter";
21
- break;
22
- default:
23
- kindStr = "field";
24
- }
25
- var get,
26
- set,
27
- ctx = {
28
- kind: kindStr,
29
- name: isPrivate ? "#" + name : name,
30
- "static": isStatic,
31
- "private": isPrivate
32
- },
33
- decoratorFinishedRef = {
34
- v: !1
2
+ function applyDecs2203RFactory() {
3
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
4
+ return function (initializer) {
5
+ !function (decoratorFinishedRef, fnName) {
6
+ if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
7
+ }(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
35
8
  };
36
- 0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function get() {
37
- return this[name];
38
- }, set = function set(v) {
39
- this[name] = v;
40
- }) : 2 === kind ? get = function get() {
41
- return desc.value;
42
- } : (1 !== kind && 3 !== kind || (get = function get() {
43
- return desc.get.call(this);
44
- }), 1 !== kind && 4 !== kind || (set = function set(v) {
45
- desc.set.call(this, v);
46
- })), ctx.access = get && set ? {
47
- get: get,
48
- set: set
49
- } : get ? {
50
- get: get
51
- } : {
52
- set: set
53
- };
54
- try {
55
- return dec(value, ctx);
56
- } finally {
57
- decoratorFinishedRef.v = !0;
58
- }
59
- }
60
- function assertNotFinished(decoratorFinishedRef, fnName) {
61
- if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
62
- }
63
- function assertCallable(fn, hint) {
64
- if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
65
- }
66
- function assertValidReturnValue(kind, value) {
67
- var type = _typeof(value);
68
- if (1 === kind) {
69
- if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
70
- void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
71
- } else if ("function" !== type) {
72
- var hint;
73
- throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
74
9
  }
75
- }
76
- function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
77
- var desc,
78
- init,
79
- value,
80
- newValue,
81
- get,
82
- set,
83
- decs = decInfo[0];
84
- if (isPrivate ? desc = 0 === kind || 1 === kind ? {
85
- get: decInfo[3],
86
- set: decInfo[4]
87
- } : 3 === kind ? {
88
- get: decInfo[3]
89
- } : 4 === kind ? {
90
- set: decInfo[3]
91
- } : {
92
- value: decInfo[3]
93
- } : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
94
- get: desc.get,
95
- set: desc.set
96
- } : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
97
- get: get,
98
- set: set
99
- }) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
100
- var newInit;
101
- if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
10
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value) {
11
+ var kindStr;
12
+ switch (kind) {
13
+ case 1:
14
+ kindStr = "accessor";
15
+ break;
16
+ case 2:
17
+ kindStr = "method";
18
+ break;
19
+ case 3:
20
+ kindStr = "getter";
21
+ break;
22
+ case 4:
23
+ kindStr = "setter";
24
+ break;
25
+ default:
26
+ kindStr = "field";
27
+ }
28
+ var get,
29
+ set,
30
+ ctx = {
31
+ kind: kindStr,
32
+ name: isPrivate ? "#" + name : name,
33
+ "static": isStatic,
34
+ "private": isPrivate
35
+ },
36
+ decoratorFinishedRef = {
37
+ v: !1
38
+ };
39
+ 0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), 0 === kind ? isPrivate ? (get = desc.get, set = desc.set) : (get = function get() {
40
+ return this[name];
41
+ }, set = function set(v) {
42
+ this[name] = v;
43
+ }) : 2 === kind ? get = function get() {
44
+ return desc.value;
45
+ } : (1 !== kind && 3 !== kind || (get = function get() {
46
+ return desc.get.call(this);
47
+ }), 1 !== kind && 4 !== kind || (set = function set(v) {
48
+ desc.set.call(this, v);
49
+ })), ctx.access = get && set ? {
102
50
  get: get,
103
51
  set: set
104
- }) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
52
+ } : get ? {
53
+ get: get
54
+ } : {
55
+ set: set
56
+ };
57
+ try {
58
+ return dec(value, ctx);
59
+ } finally {
60
+ decoratorFinishedRef.v = !0;
61
+ }
105
62
  }
106
- if (0 === kind || 1 === kind) {
107
- if (void 0 === init) init = function init(instance, _init) {
108
- return _init;
109
- };else if ("function" != typeof init) {
110
- var ownInitializers = init;
111
- init = function init(instance, _init2) {
112
- for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
113
- return value;
114
- };
115
- } else {
116
- var originalInitializer = init;
117
- init = function init(instance, _init3) {
118
- return originalInitializer.call(instance, _init3);
119
- };
63
+ function assertCallable(fn, hint) {
64
+ if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
65
+ }
66
+ function assertValidReturnValue(kind, value) {
67
+ var type = _typeof(value);
68
+ if (1 === kind) {
69
+ if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
70
+ void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
71
+ } else if ("function" !== type) {
72
+ var hint;
73
+ throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
120
74
  }
121
- ret.push(init);
122
75
  }
123
- 0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
124
- return value.get.call(instance, args);
125
- }), ret.push(function (instance, args) {
126
- return value.set.call(instance, args);
127
- })) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
128
- return value.call(instance, args);
129
- }) : Object.defineProperty(base, name, desc));
130
- }
131
- function applyMemberDecs(Class, decInfos) {
132
- for (var protoInitializers, staticInitializers, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
133
- var decInfo = decInfos[i];
134
- if (Array.isArray(decInfo)) {
135
- var base,
136
- initializers,
137
- kind = decInfo[1],
138
- name = decInfo[2],
139
- isPrivate = decInfo.length > 3,
140
- isStatic = kind >= 5;
141
- if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
142
- var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
143
- existingKind = existingNonFields.get(name) || 0;
144
- if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
145
- !existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
76
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers) {
77
+ var desc,
78
+ init,
79
+ value,
80
+ newValue,
81
+ get,
82
+ set,
83
+ decs = decInfo[0];
84
+ if (isPrivate ? desc = 0 === kind || 1 === kind ? {
85
+ get: decInfo[3],
86
+ set: decInfo[4]
87
+ } : 3 === kind ? {
88
+ get: decInfo[3]
89
+ } : 4 === kind ? {
90
+ set: decInfo[3]
91
+ } : {
92
+ value: decInfo[3]
93
+ } : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
94
+ get: desc.get,
95
+ set: desc.set
96
+ } : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
97
+ get: get,
98
+ set: set
99
+ }) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
100
+ var newInit;
101
+ if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
102
+ get: get,
103
+ set: set
104
+ }) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
105
+ }
106
+ if (0 === kind || 1 === kind) {
107
+ if (void 0 === init) init = function init(instance, _init) {
108
+ return _init;
109
+ };else if ("function" != typeof init) {
110
+ var ownInitializers = init;
111
+ init = function init(instance, _init2) {
112
+ for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
113
+ return value;
114
+ };
115
+ } else {
116
+ var originalInitializer = init;
117
+ init = function init(instance, _init3) {
118
+ return originalInitializer.call(instance, _init3);
119
+ };
146
120
  }
147
- applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
121
+ ret.push(init);
148
122
  }
123
+ 0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
124
+ return value.get.call(instance, args);
125
+ }), ret.push(function (instance, args) {
126
+ return value.set.call(instance, args);
127
+ })) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
128
+ return value.call(instance, args);
129
+ }) : Object.defineProperty(base, name, desc));
149
130
  }
150
- return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
151
- }
152
- function pushInitializers(ret, initializers) {
153
- initializers && ret.push(function (instance) {
154
- for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
155
- return instance;
156
- });
157
- }
158
- function applyClassDecs(targetClass, classDecs) {
159
- if (classDecs.length > 0) {
160
- for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
161
- var decoratorFinishedRef = {
162
- v: !1
163
- };
164
- try {
165
- var nextNewClass = classDecs[i](newClass, {
166
- kind: "class",
167
- name: name,
168
- addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
169
- });
170
- } finally {
171
- decoratorFinishedRef.v = !0;
131
+ function applyMemberDecs(Class, decInfos) {
132
+ for (var protoInitializers, staticInitializers, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
133
+ var decInfo = decInfos[i];
134
+ if (Array.isArray(decInfo)) {
135
+ var base,
136
+ initializers,
137
+ kind = decInfo[1],
138
+ name = decInfo[2],
139
+ isPrivate = decInfo.length > 3,
140
+ isStatic = kind >= 5;
141
+ if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || [])) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
142
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
143
+ existingKind = existingNonFields.get(name) || 0;
144
+ if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
145
+ !existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
146
+ }
147
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers);
172
148
  }
173
- void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
174
149
  }
175
- return [newClass, function () {
176
- for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
177
- }];
150
+ return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
178
151
  }
152
+ function pushInitializers(ret, initializers) {
153
+ initializers && ret.push(function (instance) {
154
+ for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
155
+ return instance;
156
+ });
157
+ }
158
+ return function (targetClass, memberDecs, classDecs) {
159
+ return {
160
+ e: applyMemberDecs(targetClass, memberDecs),
161
+ get c() {
162
+ return function (targetClass, classDecs) {
163
+ if (classDecs.length > 0) {
164
+ for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
165
+ var decoratorFinishedRef = {
166
+ v: !1
167
+ };
168
+ try {
169
+ var nextNewClass = classDecs[i](newClass, {
170
+ kind: "class",
171
+ name: name,
172
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
173
+ });
174
+ } finally {
175
+ decoratorFinishedRef.v = !0;
176
+ }
177
+ void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
178
+ }
179
+ return [newClass, function () {
180
+ for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
181
+ }];
182
+ }
183
+ }(targetClass, classDecs);
184
+ }
185
+ };
186
+ };
179
187
  }
180
188
  function applyDecs2203R(targetClass, memberDecs, classDecs) {
181
- return {
182
- e: applyMemberDecs(targetClass, memberDecs),
183
- get c() {
184
- return applyClassDecs(targetClass, classDecs);
185
- }
186
- };
189
+ return (module.exports = applyDecs2203R = applyDecs2203RFactory(), module.exports.__esModule = true, module.exports["default"] = module.exports)(targetClass, memberDecs, classDecs);
187
190
  }
188
191
  module.exports = applyDecs2203R, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,221 @@
1
+ var _typeof = require("./typeof.js")["default"];
2
+ var checkInRHS = require("./checkInRHS.js");
3
+ function createAddInitializerMethod(initializers, decoratorFinishedRef) {
4
+ return function (initializer) {
5
+ assertNotFinished(decoratorFinishedRef, "addInitializer"), assertCallable(initializer, "An initializer"), initializers.push(initializer);
6
+ };
7
+ }
8
+ function assertInstanceIfPrivate(has, target) {
9
+ if (!has(target)) throw new TypeError("Attempted to access private element on non-instance");
10
+ }
11
+ function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand) {
12
+ var kindStr;
13
+ switch (kind) {
14
+ case 1:
15
+ kindStr = "accessor";
16
+ break;
17
+ case 2:
18
+ kindStr = "method";
19
+ break;
20
+ case 3:
21
+ kindStr = "getter";
22
+ break;
23
+ case 4:
24
+ kindStr = "setter";
25
+ break;
26
+ default:
27
+ kindStr = "field";
28
+ }
29
+ var get,
30
+ set,
31
+ ctx = {
32
+ kind: kindStr,
33
+ name: isPrivate ? "#" + name : name,
34
+ "static": isStatic,
35
+ "private": isPrivate
36
+ },
37
+ decoratorFinishedRef = {
38
+ v: !1
39
+ };
40
+ if (0 !== kind && (ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef)), isPrivate || 0 !== kind && 2 !== kind) {
41
+ if (2 === kind) get = function get(target) {
42
+ return assertInstanceIfPrivate(hasPrivateBrand, target), desc.value;
43
+ };else {
44
+ var t = 0 === kind || 1 === kind;
45
+ (t || 3 === kind) && (get = isPrivate ? function (target) {
46
+ return assertInstanceIfPrivate(hasPrivateBrand, target), desc.get.call(target);
47
+ } : function (target) {
48
+ return desc.get.call(target);
49
+ }), (t || 4 === kind) && (set = isPrivate ? function (target, value) {
50
+ assertInstanceIfPrivate(hasPrivateBrand, target), desc.set.call(target, value);
51
+ } : function (target, value) {
52
+ desc.set.call(target, value);
53
+ });
54
+ }
55
+ } else get = function get(target) {
56
+ return target[name];
57
+ }, 0 === kind && (set = function set(target, v) {
58
+ target[name] = v;
59
+ });
60
+ var has = isPrivate ? hasPrivateBrand.bind() : function (target) {
61
+ return name in target;
62
+ };
63
+ ctx.access = get && set ? {
64
+ get: get,
65
+ set: set,
66
+ has: has
67
+ } : get ? {
68
+ get: get,
69
+ has: has
70
+ } : {
71
+ set: set,
72
+ has: has
73
+ };
74
+ try {
75
+ return dec(value, ctx);
76
+ } finally {
77
+ decoratorFinishedRef.v = !0;
78
+ }
79
+ }
80
+ function assertNotFinished(decoratorFinishedRef, fnName) {
81
+ if (decoratorFinishedRef.v) throw new Error("attempted to call " + fnName + " after decoration was finished");
82
+ }
83
+ function assertCallable(fn, hint) {
84
+ if ("function" != typeof fn) throw new TypeError(hint + " must be a function");
85
+ }
86
+ function assertValidReturnValue(kind, value) {
87
+ var type = _typeof(value);
88
+ if (1 === kind) {
89
+ if ("object" !== type || null === value) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
90
+ void 0 !== value.get && assertCallable(value.get, "accessor.get"), void 0 !== value.set && assertCallable(value.set, "accessor.set"), void 0 !== value.init && assertCallable(value.init, "accessor.init");
91
+ } else if ("function" !== type) {
92
+ var hint;
93
+ throw hint = 0 === kind ? "field" : 10 === kind ? "class" : "method", new TypeError(hint + " decorators must return a function or void 0");
94
+ }
95
+ }
96
+ function curryThis1(fn) {
97
+ return function () {
98
+ return fn(this);
99
+ };
100
+ }
101
+ function curryThis2(fn) {
102
+ return function (value) {
103
+ fn(this, value);
104
+ };
105
+ }
106
+ function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand) {
107
+ var desc,
108
+ init,
109
+ value,
110
+ newValue,
111
+ get,
112
+ set,
113
+ decs = decInfo[0];
114
+ if (isPrivate ? desc = 0 === kind || 1 === kind ? {
115
+ get: curryThis1(decInfo[3]),
116
+ set: curryThis2(decInfo[4])
117
+ } : 3 === kind ? {
118
+ get: decInfo[3]
119
+ } : 4 === kind ? {
120
+ set: decInfo[3]
121
+ } : {
122
+ value: decInfo[3]
123
+ } : 0 !== kind && (desc = Object.getOwnPropertyDescriptor(base, name)), 1 === kind ? value = {
124
+ get: desc.get,
125
+ set: desc.set
126
+ } : 2 === kind ? value = desc.value : 3 === kind ? value = desc.get : 4 === kind && (value = desc.set), "function" == typeof decs) void 0 !== (newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand)) && (assertValidReturnValue(kind, newValue), 0 === kind ? init = newValue : 1 === kind ? (init = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
127
+ get: get,
128
+ set: set
129
+ }) : value = newValue);else for (var i = decs.length - 1; i >= 0; i--) {
130
+ var newInit;
131
+ if (void 0 !== (newValue = memberDec(decs[i], name, desc, initializers, kind, isStatic, isPrivate, value, hasPrivateBrand))) assertValidReturnValue(kind, newValue), 0 === kind ? newInit = newValue : 1 === kind ? (newInit = newValue.init, get = newValue.get || value.get, set = newValue.set || value.set, value = {
132
+ get: get,
133
+ set: set
134
+ }) : value = newValue, void 0 !== newInit && (void 0 === init ? init = newInit : "function" == typeof init ? init = [init, newInit] : init.push(newInit));
135
+ }
136
+ if (0 === kind || 1 === kind) {
137
+ if (void 0 === init) init = function init(instance, _init) {
138
+ return _init;
139
+ };else if ("function" != typeof init) {
140
+ var ownInitializers = init;
141
+ init = function init(instance, _init2) {
142
+ for (var value = _init2, i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
143
+ return value;
144
+ };
145
+ } else {
146
+ var originalInitializer = init;
147
+ init = function init(instance, _init3) {
148
+ return originalInitializer.call(instance, _init3);
149
+ };
150
+ }
151
+ ret.push(init);
152
+ }
153
+ 0 !== kind && (1 === kind ? (desc.get = value.get, desc.set = value.set) : 2 === kind ? desc.value = value : 3 === kind ? desc.get = value : 4 === kind && (desc.set = value), isPrivate ? 1 === kind ? (ret.push(function (instance, args) {
154
+ return value.get.call(instance, args);
155
+ }), ret.push(function (instance, args) {
156
+ return value.set.call(instance, args);
157
+ })) : 2 === kind ? ret.push(value) : ret.push(function (instance, args) {
158
+ return value.call(instance, args);
159
+ }) : Object.defineProperty(base, name, desc));
160
+ }
161
+ function applyMemberDecs(Class, decInfos, instanceBrand) {
162
+ for (var protoInitializers, staticInitializers, staticBrand, ret = [], existingProtoNonFields = new Map(), existingStaticNonFields = new Map(), i = 0; i < decInfos.length; i++) {
163
+ var decInfo = decInfos[i];
164
+ if (Array.isArray(decInfo)) {
165
+ var base,
166
+ initializers,
167
+ kind = decInfo[1],
168
+ name = decInfo[2],
169
+ isPrivate = decInfo.length > 3,
170
+ isStatic = kind >= 5,
171
+ hasPrivateBrand = instanceBrand;
172
+ if (isStatic ? (base = Class, 0 !== (kind -= 5) && (initializers = staticInitializers = staticInitializers || []), isPrivate && !staticBrand && (staticBrand = function staticBrand(_) {
173
+ return checkInRHS(_) === Class;
174
+ }), hasPrivateBrand = staticBrand) : (base = Class.prototype, 0 !== kind && (initializers = protoInitializers = protoInitializers || [])), 0 !== kind && !isPrivate) {
175
+ var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields,
176
+ existingKind = existingNonFields.get(name) || 0;
177
+ if (!0 === existingKind || 3 === existingKind && 4 !== kind || 4 === existingKind && 3 !== kind) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
178
+ !existingKind && kind > 2 ? existingNonFields.set(name, kind) : existingNonFields.set(name, !0);
179
+ }
180
+ applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, hasPrivateBrand);
181
+ }
182
+ }
183
+ return pushInitializers(ret, protoInitializers), pushInitializers(ret, staticInitializers), ret;
184
+ }
185
+ function pushInitializers(ret, initializers) {
186
+ initializers && ret.push(function (instance) {
187
+ for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
188
+ return instance;
189
+ });
190
+ }
191
+ function applyClassDecs(targetClass, classDecs) {
192
+ if (classDecs.length > 0) {
193
+ for (var initializers = [], newClass = targetClass, name = targetClass.name, i = classDecs.length - 1; i >= 0; i--) {
194
+ var decoratorFinishedRef = {
195
+ v: !1
196
+ };
197
+ try {
198
+ var nextNewClass = classDecs[i](newClass, {
199
+ kind: "class",
200
+ name: name,
201
+ addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef)
202
+ });
203
+ } finally {
204
+ decoratorFinishedRef.v = !0;
205
+ }
206
+ void 0 !== nextNewClass && (assertValidReturnValue(10, nextNewClass), newClass = nextNewClass);
207
+ }
208
+ return [newClass, function () {
209
+ for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
210
+ }];
211
+ }
212
+ }
213
+ function applyDecs2301(targetClass, memberDecs, classDecs, instanceBrand) {
214
+ return {
215
+ e: applyMemberDecs(targetClass, memberDecs, instanceBrand),
216
+ get c() {
217
+ return applyClassDecs(targetClass, classDecs);
218
+ }
219
+ };
220
+ }
221
+ module.exports = applyDecs2301, module.exports.__esModule = true, module.exports["default"] = module.exports;