@tachybase/module-cloud-component 0.23.8

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 (109) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/CloudComponent.provider.d.ts +2 -0
  6. package/dist/client/cloud-library-manager/CloudLibrary.collection.d.ts +2 -0
  7. package/dist/client/cloud-library-manager/CloudLibraryManager.d.ts +2 -0
  8. package/dist/client/cloud-library-manager/CloudLibraryManager.fields.d.ts +82 -0
  9. package/dist/client/cloud-library-manager/CloudLibraryManager.schema.d.ts +1075 -0
  10. package/dist/client/components/CloudComponentLink.d.ts +2 -0
  11. package/dist/client/components/ComponentEditor.d.ts +6 -0
  12. package/dist/client/components/MarkdownEditor.d.ts +9 -0
  13. package/dist/client/components/Preview.d.ts +9 -0
  14. package/dist/client/index.d.ts +8 -0
  15. package/dist/client/index.js +1107 -0
  16. package/dist/client/locale.d.ts +9 -0
  17. package/dist/client/settings/CloudComponentBlock.d.ts +4 -0
  18. package/dist/client/settings/InitializerItem.d.ts +2 -0
  19. package/dist/client/settings/schema.d.ts +2 -0
  20. package/dist/client/settings/settings.d.ts +2 -0
  21. package/dist/externalVersion.js +15 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +39 -0
  24. package/dist/locale/en-US.json +12 -0
  25. package/dist/locale/zh-CN.json +12 -0
  26. package/dist/node_modules/@babel/core/LICENSE +22 -0
  27. package/dist/node_modules/@babel/core/cjs-proxy.cjs +68 -0
  28. package/dist/node_modules/@babel/core/lib/config/cache-contexts.js +3 -0
  29. package/dist/node_modules/@babel/core/lib/config/caching.js +261 -0
  30. package/dist/node_modules/@babel/core/lib/config/config-chain.js +469 -0
  31. package/dist/node_modules/@babel/core/lib/config/config-descriptors.js +190 -0
  32. package/dist/node_modules/@babel/core/lib/config/files/configuration.js +287 -0
  33. package/dist/node_modules/@babel/core/lib/config/files/import.cjs +6 -0
  34. package/dist/node_modules/@babel/core/lib/config/files/index-browser.js +58 -0
  35. package/dist/node_modules/@babel/core/lib/config/files/index.js +78 -0
  36. package/dist/node_modules/@babel/core/lib/config/files/module-types.js +195 -0
  37. package/dist/node_modules/@babel/core/lib/config/files/package.js +61 -0
  38. package/dist/node_modules/@babel/core/lib/config/files/plugins.js +229 -0
  39. package/dist/node_modules/@babel/core/lib/config/files/types.js +3 -0
  40. package/dist/node_modules/@babel/core/lib/config/files/utils.js +36 -0
  41. package/dist/node_modules/@babel/core/lib/config/full.js +312 -0
  42. package/dist/node_modules/@babel/core/lib/config/helpers/config-api.js +84 -0
  43. package/dist/node_modules/@babel/core/lib/config/helpers/deep-array.js +23 -0
  44. package/dist/node_modules/@babel/core/lib/config/helpers/environment.js +12 -0
  45. package/dist/node_modules/@babel/core/lib/config/index.js +93 -0
  46. package/dist/node_modules/@babel/core/lib/config/item.js +67 -0
  47. package/dist/node_modules/@babel/core/lib/config/partial.js +158 -0
  48. package/dist/node_modules/@babel/core/lib/config/pattern-to-regex.js +38 -0
  49. package/dist/node_modules/@babel/core/lib/config/plugin.js +33 -0
  50. package/dist/node_modules/@babel/core/lib/config/printer.js +113 -0
  51. package/dist/node_modules/@babel/core/lib/config/resolve-targets-browser.js +41 -0
  52. package/dist/node_modules/@babel/core/lib/config/resolve-targets.js +61 -0
  53. package/dist/node_modules/@babel/core/lib/config/util.js +31 -0
  54. package/dist/node_modules/@babel/core/lib/config/validation/option-assertions.js +277 -0
  55. package/dist/node_modules/@babel/core/lib/config/validation/options.js +189 -0
  56. package/dist/node_modules/@babel/core/lib/config/validation/plugins.js +67 -0
  57. package/dist/node_modules/@babel/core/lib/config/validation/removed.js +68 -0
  58. package/dist/node_modules/@babel/core/lib/errors/config-error.js +18 -0
  59. package/dist/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +98 -0
  60. package/dist/node_modules/@babel/core/lib/gensync-utils/async.js +90 -0
  61. package/dist/node_modules/@babel/core/lib/gensync-utils/fs.js +31 -0
  62. package/dist/node_modules/@babel/core/lib/gensync-utils/functional.js +58 -0
  63. package/dist/node_modules/@babel/core/lib/index.js +227 -0
  64. package/dist/node_modules/@babel/core/lib/parse.js +47 -0
  65. package/dist/node_modules/@babel/core/lib/parser/index.js +79 -0
  66. package/dist/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js +339 -0
  67. package/dist/node_modules/@babel/core/lib/tools/build-external-helpers.js +144 -0
  68. package/dist/node_modules/@babel/core/lib/transform-ast.js +50 -0
  69. package/dist/node_modules/@babel/core/lib/transform-file-browser.js +23 -0
  70. package/dist/node_modules/@babel/core/lib/transform-file.js +40 -0
  71. package/dist/node_modules/@babel/core/lib/transform.js +49 -0
  72. package/dist/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js +84 -0
  73. package/dist/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs +4 -0
  74. package/dist/node_modules/@babel/core/lib/transformation/file/file.js +214 -0
  75. package/dist/node_modules/@babel/core/lib/transformation/file/generate.js +84 -0
  76. package/dist/node_modules/@babel/core/lib/transformation/file/merge-map.js +37 -0
  77. package/dist/node_modules/@babel/core/lib/transformation/index.js +92 -0
  78. package/dist/node_modules/@babel/core/lib/transformation/normalize-file.js +129 -0
  79. package/dist/node_modules/@babel/core/lib/transformation/normalize-opts.js +59 -0
  80. package/dist/node_modules/@babel/core/lib/transformation/plugin-pass.js +50 -0
  81. package/dist/node_modules/@babel/core/lib/transformation/util/clone-deep.js +36 -0
  82. package/dist/node_modules/@babel/core/lib/vendor/import-meta-resolve.js +1043 -0
  83. package/dist/node_modules/@babel/core/node_modules/.bin/json5 +17 -0
  84. package/dist/node_modules/@babel/core/node_modules/.bin/parser +17 -0
  85. package/dist/node_modules/@babel/core/node_modules/.bin/semver +17 -0
  86. package/dist/node_modules/@babel/core/package.json +1 -0
  87. package/dist/node_modules/@babel/core/src/config/files/index-browser.ts +113 -0
  88. package/dist/node_modules/@babel/core/src/config/files/index.ts +29 -0
  89. package/dist/node_modules/@babel/core/src/config/resolve-targets-browser.ts +40 -0
  90. package/dist/node_modules/@babel/core/src/config/resolve-targets.ts +56 -0
  91. package/dist/node_modules/@babel/core/src/transform-file-browser.ts +31 -0
  92. package/dist/node_modules/@babel/core/src/transform-file.ts +55 -0
  93. package/dist/server/actions/cloud-libraries-controller.d.ts +7 -0
  94. package/dist/server/actions/cloud-libraries-controller.js +147 -0
  95. package/dist/server/collections/cloud-libraries.d.ts +2 -0
  96. package/dist/server/collections/cloud-libraries.js +98 -0
  97. package/dist/server/collections/effect-libraries.d.ts +2 -0
  98. package/dist/server/collections/effect-libraries.js +78 -0
  99. package/dist/server/index.d.ts +1 -0
  100. package/dist/server/index.js +33 -0
  101. package/dist/server/plugin.d.ts +4 -0
  102. package/dist/server/plugin.js +87 -0
  103. package/dist/server/services/cloud-compiler.d.ts +8 -0
  104. package/dist/server/services/cloud-compiler.js +116 -0
  105. package/dist/server/services/cloud-libraries-service.d.ts +11 -0
  106. package/dist/server/services/cloud-libraries-service.js +196 -0
  107. package/package.json +44 -0
  108. package/server.d.ts +2 -0
  109. package/server.js +1 -0
@@ -0,0 +1,9 @@
1
+ import { Application } from '@tachybase/client';
2
+ export declare class Locale {
3
+ private app;
4
+ constructor(app: Application);
5
+ lang(key: string): string;
6
+ }
7
+ export declare const useTranslation: () => any;
8
+ export declare const tval: (key: string) => string;
9
+ export declare function lang(key: string): string;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const CloudComponentBlock: ({ element }: {
3
+ element: any;
4
+ }) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SchemaInitializerItemType } from '@tachybase/client';
2
+ export declare const cloudComponentBlockInitializerItem: SchemaInitializerItemType;
@@ -0,0 +1,2 @@
1
+ import { ISchema } from '@tachybase/schema';
2
+ export declare const schema: ISchema;
@@ -0,0 +1,2 @@
1
+ import { SchemaSettings } from '@tachybase/client';
2
+ export declare const cloudComponentBlockSettings: SchemaSettings<{}>;
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ "react": "18.3.1",
3
+ "@tachybase/client": "0.23.8",
4
+ "@tachybase/schema": "0.23.8",
5
+ "@tachybase/utils": "0.23.8",
6
+ "@tachybase/server": "0.23.8",
7
+ "lodash": "4.17.21",
8
+ "dayjs": "1.11.13",
9
+ "antd": "5.22.5",
10
+ "react-router-dom": "6.28.1",
11
+ "@tachybase/components": "0.23.8",
12
+ "ahooks": "3.8.4",
13
+ "@tachybase/actions": "0.23.8",
14
+ "@tachybase/database": "0.23.8"
15
+ };
@@ -0,0 +1,2 @@
1
+ export * from './server';
2
+ export { default } from './server';
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var src_exports = {};
30
+ __export(src_exports, {
31
+ default: () => import_server.default
32
+ });
33
+ module.exports = __toCommonJS(src_exports);
34
+ __reExport(src_exports, require("./server"), module.exports);
35
+ var import_server = __toESM(require("./server"));
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ ...require("./server")
39
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "Basic": "Basic",
3
+ "Cloud Component": "Cloud Component",
4
+ "Cloud Library": "Cloud Library",
5
+ "Data": "Data",
6
+ "Develop": "Develop",
7
+ "Document": "Document",
8
+ "History": "History",
9
+ "Not selected": "Not selected",
10
+ "Please choose component to show here": "Please choose component to show here",
11
+ "Publish": "Publish"
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "Basic": "基础",
3
+ "Cloud Component": "云组件",
4
+ "Cloud Library": "云类库",
5
+ "Data": "数据",
6
+ "Develop": "开发",
7
+ "Document": "文档",
8
+ "History": "历史",
9
+ "Not selected": "未选择",
10
+ "Please choose component to show here": "可以配置组件",
11
+ "Publish": "发布"
12
+ }
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2014-present Sebastian McKenzie and other contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ const babelP = import("./lib/index.js");
4
+ let babel = null;
5
+ Object.defineProperty(exports, "__ initialize @babel/core cjs proxy __", {
6
+ set(val) {
7
+ babel = val;
8
+ },
9
+ });
10
+
11
+ exports.version = require("./package.json").version;
12
+
13
+ const functionNames = [
14
+ "createConfigItem",
15
+ "loadPartialConfig",
16
+ "loadOptions",
17
+ "transform",
18
+ "transformFile",
19
+ "transformFromAst",
20
+ "parse",
21
+ ];
22
+ const propertyNames = [
23
+ "buildExternalHelpers",
24
+ "types",
25
+ "tokTypes",
26
+ "traverse",
27
+ "template",
28
+ ];
29
+
30
+ for (const name of functionNames) {
31
+ exports[name] = function (...args) {
32
+ if (
33
+ process.env.BABEL_8_BREAKING &&
34
+ typeof args[args.length - 1] !== "function"
35
+ ) {
36
+ throw new Error(
37
+ `Starting from Babel 8.0.0, the '${name}' function expects a callback. If you need to call it synchronously, please use '${name}Sync'.`
38
+ );
39
+ }
40
+
41
+ babelP.then(babel => {
42
+ babel[name](...args);
43
+ });
44
+ };
45
+ exports[`${name}Async`] = function (...args) {
46
+ return babelP.then(babel => babel[`${name}Async`](...args));
47
+ };
48
+ exports[`${name}Sync`] = function (...args) {
49
+ if (!babel) throw notLoadedError(`${name}Sync`, "callable");
50
+ return babel[`${name}Sync`](...args);
51
+ };
52
+ }
53
+
54
+ for (const name of propertyNames) {
55
+ Object.defineProperty(exports, name, {
56
+ get() {
57
+ if (!babel) throw notLoadedError(name, "accessible");
58
+ return babel[name];
59
+ },
60
+ });
61
+ }
62
+
63
+ function notLoadedError(name, keyword) {
64
+ return new Error(
65
+ `The \`${name}\` export of @babel/core is only ${keyword}` +
66
+ ` from the CommonJS version after that the ESM version is loaded.`
67
+ );
68
+ }
@@ -0,0 +1,3 @@
1
+ 0 && 0;
2
+
3
+ //# sourceMappingURL=cache-contexts.js.map
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.assertSimpleType = assertSimpleType;
7
+ exports.makeStrongCache = makeStrongCache;
8
+ exports.makeStrongCacheSync = makeStrongCacheSync;
9
+ exports.makeWeakCache = makeWeakCache;
10
+ exports.makeWeakCacheSync = makeWeakCacheSync;
11
+ function _gensync() {
12
+ const data = require("gensync");
13
+ _gensync = function () {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
18
+ var _async = require("../gensync-utils/async.js");
19
+ var _util = require("./util.js");
20
+ const synchronize = gen => {
21
+ return _gensync()(gen).sync;
22
+ };
23
+ function* genTrue() {
24
+ return true;
25
+ }
26
+ function makeWeakCache(handler) {
27
+ return makeCachedFunction(WeakMap, handler);
28
+ }
29
+ function makeWeakCacheSync(handler) {
30
+ return synchronize(makeWeakCache(handler));
31
+ }
32
+ function makeStrongCache(handler) {
33
+ return makeCachedFunction(Map, handler);
34
+ }
35
+ function makeStrongCacheSync(handler) {
36
+ return synchronize(makeStrongCache(handler));
37
+ }
38
+ function makeCachedFunction(CallCache, handler) {
39
+ const callCacheSync = new CallCache();
40
+ const callCacheAsync = new CallCache();
41
+ const futureCache = new CallCache();
42
+ return function* cachedFunction(arg, data) {
43
+ const asyncContext = yield* (0, _async.isAsync)();
44
+ const callCache = asyncContext ? callCacheAsync : callCacheSync;
45
+ const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data);
46
+ if (cached.valid) return cached.value;
47
+ const cache = new CacheConfigurator(data);
48
+ const handlerResult = handler(arg, cache);
49
+ let finishLock;
50
+ let value;
51
+ if ((0, _util.isIterableIterator)(handlerResult)) {
52
+ value = yield* (0, _async.onFirstPause)(handlerResult, () => {
53
+ finishLock = setupAsyncLocks(cache, futureCache, arg);
54
+ });
55
+ } else {
56
+ value = handlerResult;
57
+ }
58
+ updateFunctionCache(callCache, cache, arg, value);
59
+ if (finishLock) {
60
+ futureCache.delete(arg);
61
+ finishLock.release(value);
62
+ }
63
+ return value;
64
+ };
65
+ }
66
+ function* getCachedValue(cache, arg, data) {
67
+ const cachedValue = cache.get(arg);
68
+ if (cachedValue) {
69
+ for (const {
70
+ value,
71
+ valid
72
+ } of cachedValue) {
73
+ if (yield* valid(data)) return {
74
+ valid: true,
75
+ value
76
+ };
77
+ }
78
+ }
79
+ return {
80
+ valid: false,
81
+ value: null
82
+ };
83
+ }
84
+ function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
85
+ const cached = yield* getCachedValue(callCache, arg, data);
86
+ if (cached.valid) {
87
+ return cached;
88
+ }
89
+ if (asyncContext) {
90
+ const cached = yield* getCachedValue(futureCache, arg, data);
91
+ if (cached.valid) {
92
+ const value = yield* (0, _async.waitFor)(cached.value.promise);
93
+ return {
94
+ valid: true,
95
+ value
96
+ };
97
+ }
98
+ }
99
+ return {
100
+ valid: false,
101
+ value: null
102
+ };
103
+ }
104
+ function setupAsyncLocks(config, futureCache, arg) {
105
+ const finishLock = new Lock();
106
+ updateFunctionCache(futureCache, config, arg, finishLock);
107
+ return finishLock;
108
+ }
109
+ function updateFunctionCache(cache, config, arg, value) {
110
+ if (!config.configured()) config.forever();
111
+ let cachedValue = cache.get(arg);
112
+ config.deactivate();
113
+ switch (config.mode()) {
114
+ case "forever":
115
+ cachedValue = [{
116
+ value,
117
+ valid: genTrue
118
+ }];
119
+ cache.set(arg, cachedValue);
120
+ break;
121
+ case "invalidate":
122
+ cachedValue = [{
123
+ value,
124
+ valid: config.validator()
125
+ }];
126
+ cache.set(arg, cachedValue);
127
+ break;
128
+ case "valid":
129
+ if (cachedValue) {
130
+ cachedValue.push({
131
+ value,
132
+ valid: config.validator()
133
+ });
134
+ } else {
135
+ cachedValue = [{
136
+ value,
137
+ valid: config.validator()
138
+ }];
139
+ cache.set(arg, cachedValue);
140
+ }
141
+ }
142
+ }
143
+ class CacheConfigurator {
144
+ constructor(data) {
145
+ this._active = true;
146
+ this._never = false;
147
+ this._forever = false;
148
+ this._invalidate = false;
149
+ this._configured = false;
150
+ this._pairs = [];
151
+ this._data = void 0;
152
+ this._data = data;
153
+ }
154
+ simple() {
155
+ return makeSimpleConfigurator(this);
156
+ }
157
+ mode() {
158
+ if (this._never) return "never";
159
+ if (this._forever) return "forever";
160
+ if (this._invalidate) return "invalidate";
161
+ return "valid";
162
+ }
163
+ forever() {
164
+ if (!this._active) {
165
+ throw new Error("Cannot change caching after evaluation has completed.");
166
+ }
167
+ if (this._never) {
168
+ throw new Error("Caching has already been configured with .never()");
169
+ }
170
+ this._forever = true;
171
+ this._configured = true;
172
+ }
173
+ never() {
174
+ if (!this._active) {
175
+ throw new Error("Cannot change caching after evaluation has completed.");
176
+ }
177
+ if (this._forever) {
178
+ throw new Error("Caching has already been configured with .forever()");
179
+ }
180
+ this._never = true;
181
+ this._configured = true;
182
+ }
183
+ using(handler) {
184
+ if (!this._active) {
185
+ throw new Error("Cannot change caching after evaluation has completed.");
186
+ }
187
+ if (this._never || this._forever) {
188
+ throw new Error("Caching has already been configured with .never or .forever()");
189
+ }
190
+ this._configured = true;
191
+ const key = handler(this._data);
192
+ const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`);
193
+ if ((0, _async.isThenable)(key)) {
194
+ return key.then(key => {
195
+ this._pairs.push([key, fn]);
196
+ return key;
197
+ });
198
+ }
199
+ this._pairs.push([key, fn]);
200
+ return key;
201
+ }
202
+ invalidate(handler) {
203
+ this._invalidate = true;
204
+ return this.using(handler);
205
+ }
206
+ validator() {
207
+ const pairs = this._pairs;
208
+ return function* (data) {
209
+ for (const [key, fn] of pairs) {
210
+ if (key !== (yield* fn(data))) return false;
211
+ }
212
+ return true;
213
+ };
214
+ }
215
+ deactivate() {
216
+ this._active = false;
217
+ }
218
+ configured() {
219
+ return this._configured;
220
+ }
221
+ }
222
+ function makeSimpleConfigurator(cache) {
223
+ function cacheFn(val) {
224
+ if (typeof val === "boolean") {
225
+ if (val) cache.forever();else cache.never();
226
+ return;
227
+ }
228
+ return cache.using(() => assertSimpleType(val()));
229
+ }
230
+ cacheFn.forever = () => cache.forever();
231
+ cacheFn.never = () => cache.never();
232
+ cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));
233
+ cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));
234
+ return cacheFn;
235
+ }
236
+ function assertSimpleType(value) {
237
+ if ((0, _async.isThenable)(value)) {
238
+ throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`);
239
+ }
240
+ if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
241
+ throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
242
+ }
243
+ return value;
244
+ }
245
+ class Lock {
246
+ constructor() {
247
+ this.released = false;
248
+ this.promise = void 0;
249
+ this._resolve = void 0;
250
+ this.promise = new Promise(resolve => {
251
+ this._resolve = resolve;
252
+ });
253
+ }
254
+ release(value) {
255
+ this.released = true;
256
+ this._resolve(value);
257
+ }
258
+ }
259
+ 0 && 0;
260
+
261
+ //# sourceMappingURL=caching.js.map