react-antd-xform 1.0.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 (142) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/_virtual/_commonjsHelpers.js +8 -0
  4. package/dist/_virtual/index.js +4 -0
  5. package/dist/_virtual/index2.js +4 -0
  6. package/dist/_virtual/jsx-runtime.js +4 -0
  7. package/dist/_virtual/react-jsx-runtime.development.js +4 -0
  8. package/dist/_virtual/react-jsx-runtime.production.min.js +4 -0
  9. package/dist/_virtual/use-sync-external-store-shim.development.js +4 -0
  10. package/dist/_virtual/use-sync-external-store-shim.production.js +4 -0
  11. package/dist/form/array-helper.d.ts +12 -0
  12. package/dist/form/array-helper.js +115 -0
  13. package/dist/form/common-utils.d.ts +12 -0
  14. package/dist/form/common-utils.js +90 -0
  15. package/dist/form/context/formEnvContext.d.ts +6 -0
  16. package/dist/form/context/formEnvContext.js +23 -0
  17. package/dist/form/context/modelContext.d.ts +4 -0
  18. package/dist/form/context/modelContext.js +11 -0
  19. package/dist/form/enum.d.ts +9 -0
  20. package/dist/form/enum.js +15 -0
  21. package/dist/form/form-item.d.ts +15 -0
  22. package/dist/form/form-item.js +286 -0
  23. package/dist/form/index.d.ts +22 -0
  24. package/dist/form/index.js +73 -0
  25. package/dist/form/layout.d.ts +4 -0
  26. package/dist/form/layout.js +180 -0
  27. package/dist/form/model-utils.d.ts +23 -0
  28. package/dist/form/model-utils.js +171 -0
  29. package/dist/form/model.d.ts +103 -0
  30. package/dist/form/model.js +504 -0
  31. package/dist/form/type.d.ts +289 -0
  32. package/dist/form-ui/common-utils.d.ts +9 -0
  33. package/dist/form-ui/common-utils.js +17 -0
  34. package/dist/form-ui/default-button.d.ts +3 -0
  35. package/dist/form-ui/default-button.js +39 -0
  36. package/dist/form-ui/default-component.d.ts +2 -0
  37. package/dist/form-ui/default-component.js +63 -0
  38. package/dist/form-ui/type.d.ts +2 -0
  39. package/dist/helpers/AsyncValue.d.ts +38 -0
  40. package/dist/helpers/AsyncValue.js +154 -0
  41. package/dist/index.d.ts +9 -0
  42. package/dist/index.js +20 -0
  43. package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +63 -0
  44. package/dist/node_modules/.pnpm/get-own-enumerable-keys@1.0.0/node_modules/get-own-enumerable-keys/index.js +10 -0
  45. package/dist/node_modules/.pnpm/invariant@2.2.4/node_modules/invariant/browser.js +32 -0
  46. package/dist/node_modules/.pnpm/is-obj@3.0.0/node_modules/is-obj/index.js +7 -0
  47. package/dist/node_modules/.pnpm/is-regexp@3.1.0/node_modules/is-regexp/index.js +7 -0
  48. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Hash.js +23 -0
  49. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_ListCache.js +23 -0
  50. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Map.js +8 -0
  51. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_MapCache.js +23 -0
  52. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js +7 -0
  53. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_apply.js +17 -0
  54. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayMap.js +11 -0
  55. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_arrayPush.js +11 -0
  56. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assignValue.js +15 -0
  57. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_assocIndexOf.js +15 -0
  58. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseAssignValue.js +18 -0
  59. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseFlatten.js +25 -0
  60. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js +15 -0
  61. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js +16 -0
  62. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseHasIn.js +7 -0
  63. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsArguments.js +11 -0
  64. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseIsNative.js +24 -0
  65. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePick.js +12 -0
  66. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePickBy.js +18 -0
  67. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSet.js +33 -0
  68. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseSetToString.js +16 -0
  69. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseToString.js +23 -0
  70. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_castPath.js +15 -0
  71. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_coreJsData.js +7 -0
  72. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_defineProperty.js +14 -0
  73. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_flatRest.js +11 -0
  74. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js +6 -0
  75. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getMapData.js +10 -0
  76. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getNative.js +11 -0
  77. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js +27 -0
  78. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getValue.js +7 -0
  79. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hasPath.js +27 -0
  80. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashClear.js +10 -0
  81. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashDelete.js +9 -0
  82. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashGet.js +17 -0
  83. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashHas.js +12 -0
  84. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_hashSet.js +13 -0
  85. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isFlattenable.js +12 -0
  86. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isIndex.js +11 -0
  87. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKey.js +18 -0
  88. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isKeyable.js +8 -0
  89. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_isMasked.js +13 -0
  90. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheClear.js +8 -0
  91. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheDelete.js +22 -0
  92. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheGet.js +10 -0
  93. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheHas.js +9 -0
  94. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_listCacheSet.js +16 -0
  95. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheClear.js +16 -0
  96. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheDelete.js +11 -0
  97. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheGet.js +9 -0
  98. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheHas.js +9 -0
  99. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_mapCacheSet.js +12 -0
  100. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_memoizeCapped.js +17 -0
  101. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_nativeCreate.js +7 -0
  102. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js +9 -0
  103. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_overRest.js +23 -0
  104. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js +8 -0
  105. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_setToString.js +8 -0
  106. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_shortOut.js +21 -0
  107. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_stringToPath.js +18 -0
  108. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toKey.js +13 -0
  109. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_toSource.js +19 -0
  110. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/constant.js +9 -0
  111. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/eq.js +7 -0
  112. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/flatten.js +10 -0
  113. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/hasIn.js +10 -0
  114. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/identity.js +7 -0
  115. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArguments.js +15 -0
  116. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isArray.js +5 -0
  117. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isFunction.js +15 -0
  118. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isLength.js +8 -0
  119. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js +8 -0
  120. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js +7 -0
  121. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js +11 -0
  122. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/memoize.js +24 -0
  123. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/pick.js +12 -0
  124. package/dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toString.js +9 -0
  125. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/ObserverComponent.js +5 -0
  126. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/index.js +18 -0
  127. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/observer.js +84 -0
  128. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/useObserver.js +72 -0
  129. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js +96 -0
  130. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/utils/assertEnvironment.js +8 -0
  131. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/utils/observerBatching.js +17 -0
  132. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/utils/observerFinalizationRegistry.js +9 -0
  133. package/dist/node_modules/.pnpm/mobx-react-lite@4.1.0_mobx@6.13.7_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/mobx-react-lite/es/utils/printDebugValue.js +7 -0
  134. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +890 -0
  135. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +33 -0
  136. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js +12 -0
  137. package/dist/node_modules/.pnpm/stringify-object@5.0.0/node_modules/stringify-object/index.js +94 -0
  138. package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +77 -0
  139. package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +62 -0
  140. package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js +12 -0
  141. package/dist/types/index.d.ts +2 -0
  142. package/package.json +58 -0
@@ -0,0 +1,5 @@
1
+ import "mobx";
2
+ import "react";
3
+ import "./utils/observerFinalizationRegistry.js";
4
+ import "../../../../use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js";
5
+ if ("production" !== process.env.NODE_ENV) ;
@@ -0,0 +1,18 @@
1
+ import "./utils/assertEnvironment.js";
2
+ import { unstable_batchedUpdates } from "react-dom";
3
+ import { observerBatching } from "./utils/observerBatching.js";
4
+ import "mobx";
5
+ import "react";
6
+ import { observerFinalizationRegistry } from "./utils/observerFinalizationRegistry.js";
7
+ import "../../../../use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js";
8
+ import { observer } from "./observer.js";
9
+ import "./ObserverComponent.js";
10
+ var _a;
11
+ observerBatching(unstable_batchedUpdates);
12
+ (_a = observerFinalizationRegistry["finalizeAllImmediately"]) !== null && _a !== void 0 ? _a : function() {
13
+ };
14
+ export {
15
+ observerFinalizationRegistry as _observerFinalizationRegistry,
16
+ observer,
17
+ observerBatching
18
+ };
@@ -0,0 +1,84 @@
1
+ import { forwardRef, memo } from "react";
2
+ import { useObserver } from "./useObserver.js";
3
+ var _a, _b;
4
+ var warnObserverOptionsDeprecated = true;
5
+ var warnLegacyContextTypes = true;
6
+ var hasSymbol = typeof Symbol === "function" && Symbol.for;
7
+ var isFunctionNameConfigurable = (_b = (_a = Object.getOwnPropertyDescriptor(function() {
8
+ }, "name")) === null || _a === void 0 ? void 0 : _a.configurable) !== null && _b !== void 0 ? _b : false;
9
+ var ReactForwardRefSymbol = hasSymbol ? Symbol.for("react.forward_ref") : typeof forwardRef === "function" && forwardRef(function(props) {
10
+ return null;
11
+ })["$$typeof"];
12
+ var ReactMemoSymbol = hasSymbol ? Symbol.for("react.memo") : typeof memo === "function" && memo(function(props) {
13
+ return null;
14
+ })["$$typeof"];
15
+ function observer(baseComponent, options) {
16
+ var _a2;
17
+ if (process.env.NODE_ENV !== "production" && warnObserverOptionsDeprecated && options) ;
18
+ if (ReactMemoSymbol && baseComponent["$$typeof"] === ReactMemoSymbol) {
19
+ throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");
20
+ }
21
+ var useForwardRef = (_a2 = void 0) !== null && _a2 !== void 0 ? _a2 : false;
22
+ var render = baseComponent;
23
+ var baseComponentName = baseComponent.displayName || baseComponent.name;
24
+ if (ReactForwardRefSymbol && baseComponent["$$typeof"] === ReactForwardRefSymbol) {
25
+ useForwardRef = true;
26
+ render = baseComponent["render"];
27
+ if (typeof render !== "function") {
28
+ throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");
29
+ }
30
+ }
31
+ var observerComponent = function(props, ref) {
32
+ return useObserver(function() {
33
+ return render(props, ref);
34
+ }, baseComponentName);
35
+ };
36
+ observerComponent.displayName = baseComponent.displayName;
37
+ if (isFunctionNameConfigurable) {
38
+ Object.defineProperty(observerComponent, "name", {
39
+ value: baseComponent.name,
40
+ writable: true,
41
+ configurable: true
42
+ });
43
+ }
44
+ if (baseComponent.contextTypes) {
45
+ observerComponent.contextTypes = baseComponent.contextTypes;
46
+ if (process.env.NODE_ENV !== "production" && warnLegacyContextTypes) {
47
+ warnLegacyContextTypes = false;
48
+ console.warn("[mobx-react-lite] Support for Legacy Context in function components will be removed in the next major release.");
49
+ }
50
+ }
51
+ if (useForwardRef) {
52
+ observerComponent = forwardRef(observerComponent);
53
+ }
54
+ observerComponent = memo(observerComponent);
55
+ copyStaticProperties(baseComponent, observerComponent);
56
+ if ("production" !== process.env.NODE_ENV) {
57
+ Object.defineProperty(observerComponent, "contextTypes", {
58
+ set: function() {
59
+ var _a3, _b2;
60
+ throw new Error("[mobx-react-lite] `".concat(this.displayName || ((_a3 = this.type) === null || _a3 === void 0 ? void 0 : _a3.displayName) || ((_b2 = this.type) === null || _b2 === void 0 ? void 0 : _b2.name) || "Component", ".contextTypes` must be set before applying `observer`."));
61
+ }
62
+ });
63
+ }
64
+ return observerComponent;
65
+ }
66
+ var hoistBlackList = {
67
+ $$typeof: true,
68
+ render: true,
69
+ compare: true,
70
+ type: true,
71
+ // Don't redefine `displayName`,
72
+ // it's defined as getter-setter pair on `memo` (see #3192).
73
+ displayName: true
74
+ };
75
+ function copyStaticProperties(base, target) {
76
+ Object.keys(base).forEach(function(key) {
77
+ if (!hoistBlackList[key]) {
78
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(base, key));
79
+ }
80
+ });
81
+ }
82
+ export {
83
+ observer
84
+ };
@@ -0,0 +1,72 @@
1
+ import { Reaction } from "mobx";
2
+ import require$$0 from "react";
3
+ import { printDebugValue } from "./utils/printDebugValue.js";
4
+ import { observerFinalizationRegistry } from "./utils/observerFinalizationRegistry.js";
5
+ import { s as shimExports } from "../../../../use-sync-external-store@1.5.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js";
6
+ function createReaction(adm) {
7
+ adm.reaction = new Reaction("observer".concat(adm.name), function() {
8
+ var _a;
9
+ adm.stateVersion = Symbol();
10
+ (_a = adm.onStoreChange) === null || _a === void 0 ? void 0 : _a.call(adm);
11
+ });
12
+ }
13
+ function useObserver(render, baseComponentName) {
14
+ if (baseComponentName === void 0) {
15
+ baseComponentName = "observed";
16
+ }
17
+ var admRef = require$$0.useRef(null);
18
+ if (!admRef.current) {
19
+ var adm_1 = {
20
+ reaction: null,
21
+ onStoreChange: null,
22
+ stateVersion: Symbol(),
23
+ name: baseComponentName,
24
+ subscribe: function(onStoreChange) {
25
+ observerFinalizationRegistry.unregister(adm_1);
26
+ adm_1.onStoreChange = onStoreChange;
27
+ if (!adm_1.reaction) {
28
+ createReaction(adm_1);
29
+ adm_1.stateVersion = Symbol();
30
+ }
31
+ return function() {
32
+ var _a;
33
+ adm_1.onStoreChange = null;
34
+ (_a = adm_1.reaction) === null || _a === void 0 ? void 0 : _a.dispose();
35
+ adm_1.reaction = null;
36
+ };
37
+ },
38
+ getSnapshot: function() {
39
+ return adm_1.stateVersion;
40
+ }
41
+ };
42
+ admRef.current = adm_1;
43
+ }
44
+ var adm = admRef.current;
45
+ if (!adm.reaction) {
46
+ createReaction(adm);
47
+ observerFinalizationRegistry.register(admRef, adm, adm);
48
+ }
49
+ require$$0.useDebugValue(adm.reaction, printDebugValue);
50
+ shimExports.useSyncExternalStore(
51
+ // Both of these must be stable, otherwise it would keep resubscribing every render.
52
+ adm.subscribe,
53
+ adm.getSnapshot,
54
+ adm.getSnapshot
55
+ );
56
+ var renderResult;
57
+ var exception;
58
+ adm.reaction.track(function() {
59
+ try {
60
+ renderResult = render();
61
+ } catch (e) {
62
+ exception = e;
63
+ }
64
+ });
65
+ if (exception) {
66
+ throw exception;
67
+ }
68
+ return renderResult;
69
+ }
70
+ export {
71
+ useObserver
72
+ };
@@ -0,0 +1,96 @@
1
+ var REGISTRY_FINALIZE_AFTER = 1e4;
2
+ var REGISTRY_SWEEP_INTERVAL = 1e4;
3
+ var TimerBasedFinalizationRegistry = (
4
+ /** @class */
5
+ function() {
6
+ function TimerBasedFinalizationRegistry2(finalize) {
7
+ var _this = this;
8
+ Object.defineProperty(this, "finalize", {
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true,
12
+ value: finalize
13
+ });
14
+ Object.defineProperty(this, "registrations", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: /* @__PURE__ */ new Map()
19
+ });
20
+ Object.defineProperty(this, "sweepTimeout", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: void 0
25
+ });
26
+ Object.defineProperty(this, "sweep", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: function(maxAge) {
31
+ if (maxAge === void 0) {
32
+ maxAge = REGISTRY_FINALIZE_AFTER;
33
+ }
34
+ clearTimeout(_this.sweepTimeout);
35
+ _this.sweepTimeout = void 0;
36
+ var now = Date.now();
37
+ _this.registrations.forEach(function(registration, token) {
38
+ if (now - registration.registeredAt >= maxAge) {
39
+ _this.finalize(registration.value);
40
+ _this.registrations.delete(token);
41
+ }
42
+ });
43
+ if (_this.registrations.size > 0) {
44
+ _this.scheduleSweep();
45
+ }
46
+ }
47
+ });
48
+ Object.defineProperty(this, "finalizeAllImmediately", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: function() {
53
+ _this.sweep(0);
54
+ }
55
+ });
56
+ }
57
+ Object.defineProperty(TimerBasedFinalizationRegistry2.prototype, "register", {
58
+ enumerable: false,
59
+ configurable: true,
60
+ writable: true,
61
+ value: function(target, value, token) {
62
+ this.registrations.set(token, {
63
+ value,
64
+ registeredAt: Date.now()
65
+ });
66
+ this.scheduleSweep();
67
+ }
68
+ });
69
+ Object.defineProperty(TimerBasedFinalizationRegistry2.prototype, "unregister", {
70
+ enumerable: false,
71
+ configurable: true,
72
+ writable: true,
73
+ value: function(token) {
74
+ this.registrations.delete(token);
75
+ }
76
+ });
77
+ Object.defineProperty(TimerBasedFinalizationRegistry2.prototype, "scheduleSweep", {
78
+ enumerable: false,
79
+ configurable: true,
80
+ writable: true,
81
+ value: function() {
82
+ if (this.sweepTimeout === void 0) {
83
+ this.sweepTimeout = setTimeout(this.sweep, REGISTRY_SWEEP_INTERVAL);
84
+ }
85
+ }
86
+ });
87
+ return TimerBasedFinalizationRegistry2;
88
+ }()
89
+ );
90
+ var UniversalFinalizationRegistry = typeof FinalizationRegistry !== "undefined" ? FinalizationRegistry : TimerBasedFinalizationRegistry;
91
+ export {
92
+ REGISTRY_FINALIZE_AFTER,
93
+ REGISTRY_SWEEP_INTERVAL,
94
+ TimerBasedFinalizationRegistry,
95
+ UniversalFinalizationRegistry
96
+ };
@@ -0,0 +1,8 @@
1
+ import { makeObservable } from "mobx";
2
+ import { useState } from "react";
3
+ if (!useState) {
4
+ throw new Error("mobx-react-lite requires React with Hooks support");
5
+ }
6
+ if (!makeObservable) {
7
+ throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");
8
+ }
@@ -0,0 +1,17 @@
1
+ import { configure } from "mobx";
2
+ function defaultNoopBatch(callback) {
3
+ callback();
4
+ }
5
+ function observerBatching(reactionScheduler) {
6
+ if (!reactionScheduler) {
7
+ reactionScheduler = defaultNoopBatch;
8
+ if ("production" !== process.env.NODE_ENV) {
9
+ console.warn("[MobX] Failed to get unstable_batched updates from react-dom / react-native");
10
+ }
11
+ }
12
+ configure({ reactionScheduler });
13
+ }
14
+ export {
15
+ defaultNoopBatch,
16
+ observerBatching
17
+ };
@@ -0,0 +1,9 @@
1
+ import { UniversalFinalizationRegistry } from "./UniversalFinalizationRegistry.js";
2
+ var observerFinalizationRegistry = new UniversalFinalizationRegistry(function(adm) {
3
+ var _a;
4
+ (_a = adm.reaction) === null || _a === void 0 ? void 0 : _a.dispose();
5
+ adm.reaction = null;
6
+ });
7
+ export {
8
+ observerFinalizationRegistry
9
+ };
@@ -0,0 +1,7 @@
1
+ import { getDependencyTree } from "mobx";
2
+ function printDebugValue(v) {
3
+ return getDependencyTree(v);
4
+ }
5
+ export {
6
+ printDebugValue
7
+ };