@superblocksteam/library 2.0.6-next.57 → 2.0.6-next.59

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 (35) hide show
  1. package/dist/{allPaths-KPe-OJkU.js → allPaths-Bqg2PyfV.js} +2 -2
  2. package/dist/{allPaths-KPe-OJkU.js.map → allPaths-Bqg2PyfV.js.map} +1 -1
  3. package/dist/{allPaths-CFjMeIdd.js → allPaths-rSpFWZlR.js} +2 -2
  4. package/dist/{allPaths-CFjMeIdd.js.map → allPaths-rSpFWZlR.js.map} +1 -1
  5. package/dist/{allPathsLoader-B9kcOhBr.js → allPathsLoader-D0DZVqPi.js} +3 -3
  6. package/dist/{allPathsLoader-B9kcOhBr.js.map → allPathsLoader-D0DZVqPi.js.map} +1 -1
  7. package/dist/{allPathsLoader-BhebPX_9.js → allPathsLoader-Dza5jMza.js} +3 -3
  8. package/dist/{allPathsLoader-BhebPX_9.js.map → allPathsLoader-Dza5jMza.js.map} +1 -1
  9. package/dist/{devtools-consolidated-DDIhwU5g.js → devtools-consolidated-Cc9P7odf.js} +2 -2
  10. package/dist/{devtools-consolidated-DDIhwU5g.js.map → devtools-consolidated-Cc9P7odf.js.map} +1 -1
  11. package/dist/{index-fmpMMpkS.js → index-1LMlc1Q6.js} +446 -267
  12. package/dist/{index-fmpMMpkS.js.map → index-1LMlc1Q6.js.map} +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/{splitPathsBySizeLoader-Z2MNgkRA.js → splitPathsBySizeLoader-BtCO3mSJ.js} +2 -2
  15. package/dist/{splitPathsBySizeLoader-Z2MNgkRA.js.map → splitPathsBySizeLoader-BtCO3mSJ.js.map} +1 -1
  16. package/dist/{splitPathsBySizeLoader-C-dfe3r6.js → splitPathsBySizeLoader-CyCuKl4N.js} +2 -2
  17. package/dist/{splitPathsBySizeLoader-C-dfe3r6.js.map → splitPathsBySizeLoader-CyCuKl4N.js.map} +1 -1
  18. package/dist-types/lib/internal-details/lib/evaluator/base-entity-manager.d.ts +8 -7
  19. package/dist-types/lib/internal-details/lib/evaluator/create-scope-proxy.d.ts +1 -1
  20. package/dist-types/lib/internal-details/lib/evaluator/entity-manager.d.ts +5 -6
  21. package/dist-types/lib/internal-details/lib/evaluator/pretty-print-function.d.ts +1 -1
  22. package/dist-types/lib/internal-details/lib/evaluator/sanitize-object.d.ts +6 -0
  23. package/dist-types/lib/internal-details/lib/evaluator/suspense-helpers.d.ts +8 -0
  24. package/dist-types/lib/internal-details/lib/evaluator/use-shallow-mobx-observer.d.ts +1 -1
  25. package/dist-types/lib/internal-details/lib/features/component-registry.d.ts +9 -0
  26. package/dist-types/lib/user-facing/component-base/sb-component.d.ts +5 -1
  27. package/dist-types/lib/user-facing/components/custom/register-custom-component.d.ts +5 -2
  28. package/dist-types/lib/user-facing/components/input/input-component.d.ts +1 -0
  29. package/dist-types/lib/user-facing/components/table/index.d.ts +0 -1
  30. package/dist-types/lib/user-facing/components/table/props.d.ts +0 -1
  31. package/dist-types/lib/user-facing/entities/api/props.d.ts +11 -2
  32. package/dist-types/lib/user-facing/entities/api/suspensible-api.d.ts +20 -0
  33. package/dist-types/lib/user-facing/properties-panel/create-managed-props-list.d.ts +4 -0
  34. package/dist-types/lib/user-facing/properties-panel/props-builder.d.ts +8 -0
  35. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a0 as clientExports } from "./index-fmpMMpkS.js";
2
- import { a1, a2, Y, P, Q, a3, O, a4, a5, a6, a7, a8, a9, C, aa, ab, ac, ad, ae, $, af, W, ag, ah, ai, aj, Z, B, S, s, d, e, q, u, n, R, D, w, x, f, i, g, C as C2, c, k, v, l, h, z, y, A, ak, al, am, an, ao, T, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, E, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, N, aZ, a_, a$, b0, b1, b2, H, b3, b4, b5, b6, b7, K, b8, b9, F, ba, bb, bc, r, M, L, bd, be, bf, X, G, J, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, V, U, bN } from "./index-fmpMMpkS.js";
1
+ import { a0 as clientExports } from "./index-1LMlc1Q6.js";
2
+ import { a1, a2, Y, P, Q, a3, O, a4, a5, a6, a7, a8, a9, C, aa, ab, ac, ad, ae, $, af, W, ag, ah, ai, aj, Z, B, S, s, d, e, q, u, n, R, D, w, x, f, i, g, C as C2, c, k, v, l, h, z, y, A, ak, al, am, an, ao, T, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, E, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, N, aZ, a_, a$, b0, b1, b2, H, b3, b4, b5, b6, b7, K, b8, b9, F, ba, bb, bc, r, M, L, bd, be, bf, X, G, J, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, V, U, bN } from "./index-1LMlc1Q6.js";
3
3
  const createRoot = clientExports.createRoot;
4
4
  export {
5
5
  a1 as Await,
@@ -1,4 +1,4 @@
1
- import { _ as __awaiter, a as __generator, p as pascalCase, I as IconSize } from "./index-fmpMMpkS.js";
1
+ import { _ as __awaiter, a as __generator, p as pascalCase, I as IconSize } from "./index-1LMlc1Q6.js";
2
2
  var splitPathsBySizeLoader = function(name, size) {
3
3
  return __awaiter(void 0, void 0, void 0, function() {
4
4
  var key, pathsRecord;
@@ -31,4 +31,4 @@ var splitPathsBySizeLoader = function(name, size) {
31
31
  export {
32
32
  splitPathsBySizeLoader
33
33
  };
34
- //# sourceMappingURL=splitPathsBySizeLoader-Z2MNgkRA.js.map
34
+ //# sourceMappingURL=splitPathsBySizeLoader-BtCO3mSJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"splitPathsBySizeLoader-Z2MNgkRA.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.18.1_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/paths-loaders/splitPathsBySizeLoader.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __awaiter, __generator } from \"tslib\";\nimport { pascalCase } from \"change-case\";\nimport { IconSize } from \"../iconTypes\";\n/**\n * A dynamic loader for icon paths that generates separate chunks for the two size variants.\n */\nexport var splitPathsBySizeLoader = function (name, size) { return __awaiter(void 0, void 0, void 0, function () {\n var key, pathsRecord;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = pascalCase(name);\n if (!(size === IconSize.STANDARD)) return [3 /*break*/, 2];\n return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-16px-paths\" */\n \"../generated/16px/paths\")];\n case 1:\n pathsRecord = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-20px-paths\" */\n \"../generated/20px/paths\")];\n case 3:\n pathsRecord = _a.sent();\n _a.label = 4;\n case 4: return [2 /*return*/, pathsRecord[key]];\n }\n });\n}); };\n//# sourceMappingURL=splitPathsBySizeLoader.js.map"],"names":[],"mappings":";AAqBU,IAAC,yBAAyB,SAAU,MAAM,MAAM;AAAE,SAAO,UAAU,QAAQ,QAAQ,QAAQ,WAAY;AAC7G,QAAI,KAAK;AACT,WAAO,YAAY,MAAM,SAAU,IAAI;AACnC,cAAQ,GAAG,OAAK;AAAA,QACZ,KAAK;AACD,gBAAM,WAAW,IAAI;AACrB,cAAI,EAAE,SAAS,SAAS,UAAW,QAAO,CAAC,GAAa,CAAC;AACzD,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEjB;AAAA,UAAyB,kBAAC;AAAA,QAClC,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,iBAAO,CAAC,GAAa,CAAC;AAAA,QAC1B,KAAK;AAAG,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEzB;AAAA,UAAyB,kBAAC;AAAA,QAC9B,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,aAAG,QAAQ;AAAA,QACf,KAAK;AAAG,iBAAO,CAAC,GAAc,YAAY,GAAG,CAAC;AAAA,MAC1D;AAAA,IACA,CAAK;AAAA,EACL,CAAC;AAAE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"splitPathsBySizeLoader-BtCO3mSJ.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.18.1_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/paths-loaders/splitPathsBySizeLoader.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __awaiter, __generator } from \"tslib\";\nimport { pascalCase } from \"change-case\";\nimport { IconSize } from \"../iconTypes\";\n/**\n * A dynamic loader for icon paths that generates separate chunks for the two size variants.\n */\nexport var splitPathsBySizeLoader = function (name, size) { return __awaiter(void 0, void 0, void 0, function () {\n var key, pathsRecord;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = pascalCase(name);\n if (!(size === IconSize.STANDARD)) return [3 /*break*/, 2];\n return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-16px-paths\" */\n \"../generated/16px/paths\")];\n case 1:\n pathsRecord = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-20px-paths\" */\n \"../generated/20px/paths\")];\n case 3:\n pathsRecord = _a.sent();\n _a.label = 4;\n case 4: return [2 /*return*/, pathsRecord[key]];\n }\n });\n}); };\n//# sourceMappingURL=splitPathsBySizeLoader.js.map"],"names":[],"mappings":";AAqBU,IAAC,yBAAyB,SAAU,MAAM,MAAM;AAAE,SAAO,UAAU,QAAQ,QAAQ,QAAQ,WAAY;AAC7G,QAAI,KAAK;AACT,WAAO,YAAY,MAAM,SAAU,IAAI;AACnC,cAAQ,GAAG,OAAK;AAAA,QACZ,KAAK;AACD,gBAAM,WAAW,IAAI;AACrB,cAAI,EAAE,SAAS,SAAS,UAAW,QAAO,CAAC,GAAa,CAAC;AACzD,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEjB;AAAA,UAAyB,kBAAC;AAAA,QAClC,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,iBAAO,CAAC,GAAa,CAAC;AAAA,QAC1B,KAAK;AAAG,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEzB;AAAA,UAAyB,kBAAC;AAAA,QAC9B,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,aAAG,QAAQ;AAAA,QACf,KAAK;AAAG,iBAAO,CAAC,GAAc,YAAY,GAAG,CAAC;AAAA,MAC1D;AAAA,IACA,CAAK;AAAA,EACL,CAAC;AAAE;","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import { _ as __awaiter, a as __generator, p as pascalCase, b as IconSize } from "./index-fmpMMpkS.js";
1
+ import { _ as __awaiter, a as __generator, p as pascalCase, b as IconSize } from "./index-1LMlc1Q6.js";
2
2
  var splitPathsBySizeLoader = function(name, size) {
3
3
  return __awaiter(void 0, void 0, void 0, function() {
4
4
  var key, pathsRecord;
@@ -31,4 +31,4 @@ var splitPathsBySizeLoader = function(name, size) {
31
31
  export {
32
32
  splitPathsBySizeLoader
33
33
  };
34
- //# sourceMappingURL=splitPathsBySizeLoader-C-dfe3r6.js.map
34
+ //# sourceMappingURL=splitPathsBySizeLoader-CyCuKl4N.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"splitPathsBySizeLoader-C-dfe3r6.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.20.0_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/paths-loaders/splitPathsBySizeLoader.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __awaiter, __generator } from \"tslib\";\nimport { pascalCase } from \"change-case\";\nimport { IconSize } from \"../iconTypes\";\n/**\n * A dynamic loader for icon paths that generates separate chunks for the two size variants.\n */\nexport var splitPathsBySizeLoader = function (name, size) { return __awaiter(void 0, void 0, void 0, function () {\n var key, pathsRecord;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = pascalCase(name);\n if (!(size === IconSize.STANDARD)) return [3 /*break*/, 2];\n return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-16px-paths\" */\n \"../generated/16px/paths\")];\n case 1:\n pathsRecord = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-20px-paths\" */\n \"../generated/20px/paths\")];\n case 3:\n pathsRecord = _a.sent();\n _a.label = 4;\n case 4: return [2 /*return*/, pathsRecord[key]];\n }\n });\n}); };\n//# sourceMappingURL=splitPathsBySizeLoader.js.map"],"names":[],"mappings":";AAqBU,IAAC,yBAAyB,SAAU,MAAM,MAAM;AAAE,SAAO,UAAU,QAAQ,QAAQ,QAAQ,WAAY;AAC7G,QAAI,KAAK;AACT,WAAO,YAAY,MAAM,SAAU,IAAI;AACnC,cAAQ,GAAG,OAAK;AAAA,QACZ,KAAK;AACD,gBAAM,WAAW,IAAI;AACrB,cAAI,EAAE,SAAS,SAAS,UAAW,QAAO,CAAC,GAAa,CAAC;AACzD,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEjB;AAAA,UAAyB,kBAAC;AAAA,QAClC,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,iBAAO,CAAC,GAAa,CAAC;AAAA,QAC1B,KAAK;AAAG,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEzB;AAAA,UAAyB,kBAAC;AAAA,QAC9B,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,aAAG,QAAQ;AAAA,QACf,KAAK;AAAG,iBAAO,CAAC,GAAc,YAAY,GAAG,CAAC;AAAA,MAC1D;AAAA,IACA,CAAK;AAAA,EACL,CAAC;AAAE;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"splitPathsBySizeLoader-CyCuKl4N.js","sources":["../../../node_modules/.pnpm/@blueprintjs+icons@5.20.0_@types+react@18.3.18_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@blueprintjs/icons/lib/esm/paths-loaders/splitPathsBySizeLoader.js"],"sourcesContent":["/*\n * Copyright 2023 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { __awaiter, __generator } from \"tslib\";\nimport { pascalCase } from \"change-case\";\nimport { IconSize } from \"../iconTypes\";\n/**\n * A dynamic loader for icon paths that generates separate chunks for the two size variants.\n */\nexport var splitPathsBySizeLoader = function (name, size) { return __awaiter(void 0, void 0, void 0, function () {\n var key, pathsRecord;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = pascalCase(name);\n if (!(size === IconSize.STANDARD)) return [3 /*break*/, 2];\n return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-16px-paths\" */\n \"../generated/16px/paths\")];\n case 1:\n pathsRecord = _a.sent();\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, import(\n /* webpackChunkName: \"blueprint-icons-20px-paths\" */\n \"../generated/20px/paths\")];\n case 3:\n pathsRecord = _a.sent();\n _a.label = 4;\n case 4: return [2 /*return*/, pathsRecord[key]];\n }\n });\n}); };\n//# sourceMappingURL=splitPathsBySizeLoader.js.map"],"names":[],"mappings":";AAqBU,IAAC,yBAAyB,SAAU,MAAM,MAAM;AAAE,SAAO,UAAU,QAAQ,QAAQ,QAAQ,WAAY;AAC7G,QAAI,KAAK;AACT,WAAO,YAAY,MAAM,SAAU,IAAI;AACnC,cAAQ,GAAG,OAAK;AAAA,QACZ,KAAK;AACD,gBAAM,WAAW,IAAI;AACrB,cAAI,EAAE,SAAS,SAAS,UAAW,QAAO,CAAC,GAAa,CAAC;AACzD,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEjB;AAAA,UAAyB,kBAAC;AAAA,QAClC,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,iBAAO,CAAC,GAAa,CAAC;AAAA,QAC1B,KAAK;AAAG,iBAAO,CAAC,GAAa;AAAA;AAAA,YAEzB;AAAA,UAAyB,kBAAC;AAAA,QAC9B,KAAK;AACD,wBAAc,GAAG,KAAM;AACvB,aAAG,QAAQ;AAAA,QACf,KAAK;AAAG,iBAAO,CAAC,GAAc,YAAY,GAAG,CAAC;AAAA,MAC1D;AAAA,IACA,CAAK;AAAA,EACL,CAAC;AAAE;","x_google_ignoreList":[0]}
@@ -1,9 +1,11 @@
1
- import type { ObserveListener } from "./deep-observe.js";
2
1
  import type { Name } from "./names.js";
3
2
  import type { ValidateFn } from "../../../user-facing/properties-panel/validators.js";
4
3
  import type { SbEventFlow } from "../../../user-facing/sb-event-flow.js";
5
4
  import type { BindingString, ComputedProperty } from "@superblocksteam/library-shared";
6
5
  import type { SbElement, SbInstance, ValidationState } from "@superblocksteam/library-shared/types";
6
+ export type GetterOptions = {
7
+ useSuspense?: boolean;
8
+ };
7
9
  export type EntityOutputProp = Exclude<null | undefined | string | number | boolean | object | bigint | any[], BindingString | EntityDerivedProp<any[]>>;
8
10
  export type EntityDerivedProp<ARGS extends any[] = any[]> = (this: Readonly<Entity>, state?: Readonly<ScopedState>, ...args: ARGS) => EntityOutputProp;
9
11
  export type Executable<ARGS extends any[] = any[]> = (this: Entity, state?: ScopedState, ...args: ARGS) => void;
@@ -30,8 +32,8 @@ export type InternalScope = {
30
32
  entityMeta: Record<string, Entity>;
31
33
  childScopes: Record<ScopeId, InternalScope>;
32
34
  idToName: Record<string, Name>;
33
- getEntity(name: Name): Entity;
34
- getEntityMeta(name: Name): Entity;
35
+ getEntity(name: Name, options?: GetterOptions): Entity;
36
+ getEntityMeta(name: Name, options?: GetterOptions): Entity;
35
37
  getEntityName(id: string): Name;
36
38
  setEntityName(id: string, name: Name, currentName?: Name): void;
37
39
  };
@@ -39,9 +41,9 @@ export interface IEntityManager {
39
41
  getFullState: Record<string, Entity>;
40
42
  getValidationState: Record<string, ValidationState>;
41
43
  getScopeName(scopeId: string): string;
42
- getState(scopeId: string): ScopedState;
43
- getEntity(scopeId: string, name: Name): Entity;
44
- getEntityById(scopeId: string, id: SbInstance): Entity;
44
+ getState(scopeId: string, options?: GetterOptions): ScopedState;
45
+ getEntity(scopeId: string, name: Name, options?: GetterOptions): Entity;
46
+ getEntityById(scopeId: string, id: SbInstance, options?: GetterOptions): Entity;
45
47
  createScope(params: {
46
48
  name?: string;
47
49
  parentScopeId?: ScopeId;
@@ -96,5 +98,4 @@ export interface IEntityManager {
96
98
  value: SingleInputProp<T>;
97
99
  validator?: ValidateFn<T>;
98
100
  }): T;
99
- observeScope(scopeId: string, listener: ObserveListener<InternalScope>): () => void;
100
101
  }
@@ -1,2 +1,2 @@
1
1
  import type { ScopedState, InternalScope } from "./base-entity-manager.js";
2
- export declare function createScopeProxy(scopes: InternalScope[]): ScopedState;
2
+ export declare function createScopeProxy(scopes: InternalScope[], useSuspense?: boolean): ScopedState;
@@ -1,7 +1,6 @@
1
1
  import { type ValidationState, type SbElement, type SbInstance } from "@superblocksteam/library-shared/types";
2
2
  import { type Name } from "./names.js";
3
- import type { IEntityManager, Executable, SingleInputProp, InternalScope, ScopedState, ScopeId, Entity, InputProp } from "./base-entity-manager.js";
4
- import type { ObserveListener } from "./deep-observe.js";
3
+ import type { IEntityManager, Executable, SingleInputProp, InternalScope, ScopedState, ScopeId, Entity, InputProp, GetterOptions } from "./base-entity-manager.js";
5
4
  import type { ValidateFn } from "../../../user-facing/properties-panel/validators.js";
6
5
  import type { ComponentRegistry } from "../features/component-registry.js";
7
6
  export declare const GLOBAL_SCOPE_ID = "Global";
@@ -15,9 +14,9 @@ export declare class EntityManager implements IEntityManager {
15
14
  constructor(componentRegistry: ComponentRegistry, options?: {
16
15
  devtools?: boolean;
17
16
  });
18
- getEntity(ScopeId: string, name: Name): Entity;
19
- getEntityById(scopeId: string, id: SbInstance): Entity;
20
- getState(scopeId: string): ScopedState;
17
+ getEntity(scopeId: string, name: Name, options?: GetterOptions): Entity;
18
+ getEntityById(scopeId: string, id: SbInstance, options?: GetterOptions): Entity;
19
+ getState(scopeId: string, options?: GetterOptions): ScopedState;
21
20
  getScopeName(scopeId: string): string;
22
21
  setValidationState(entityId: string, property: string, state: ValidationState): void;
23
22
  get getValidationState(): Record<string, ValidationState>;
@@ -42,6 +41,7 @@ export declare class EntityManager implements IEntityManager {
42
41
  sourceId?: SbElement;
43
42
  }): Name;
44
43
  private createEntityStructure;
44
+ private addInternalProperty;
45
45
  private addProperty;
46
46
  deleteEntity(params: {
47
47
  name: Name;
@@ -90,5 +90,4 @@ export declare class EntityManager implements IEntityManager {
90
90
  validator?: ValidateFn<T>;
91
91
  }): T;
92
92
  private getOrCreateAtom;
93
- observeScope(scopeId: string, listener: ObserveListener<InternalScope>): () => void;
94
93
  }
@@ -1,2 +1,2 @@
1
1
  import type { EntityDerivedProp } from "./base-entity-manager.js";
2
- export declare const prettyPrintFunction: (func: EntityDerivedProp, args: any[]) => string;
2
+ export declare const prettyPrintFunction: (func: EntityDerivedProp, args: any[], fnName: string) => string;
@@ -0,0 +1,6 @@
1
+ import type { Entity, ScopedState } from "./base-entity-manager";
2
+ declare function sanitizeObject<T extends object>(obj: T): T;
3
+ declare function sanitizeEntity<T extends Entity>(entity: T): T;
4
+ declare function sanitizeScopedState(state: ScopedState): ScopedState;
5
+ declare function sanitizedToJS<T>(value: T): T;
6
+ export { sanitizeObject, sanitizeEntity, sanitizeScopedState, sanitizedToJS };
@@ -0,0 +1,8 @@
1
+ declare const SuspenseSymbol: unique symbol;
2
+ type SuspenseResult = {
3
+ __isSuspenseResult: typeof SuspenseSymbol;
4
+ };
5
+ declare function toJsOrSuspense<T extends Record<string, unknown>>(obj: T, key?: string): T | SuspenseResult;
6
+ declare function removeSuspense<T extends Record<string, unknown>>(keys: string[], result: T | SuspenseResult, prevSafeResult: T | undefined): T;
7
+ export { SuspenseSymbol, toJsOrSuspense, removeSuspense };
8
+ export type { SuspenseResult };
@@ -1 +1 @@
1
- export declare const useShallowMobxObserver: <T extends Record<string, unknown>>(obj: T) => T;
1
+ export declare const useShallowMobxObserver: <T extends Record<string, unknown>>(obj: T, useSuspense?: boolean) => T;
@@ -14,6 +14,7 @@ export declare class ComponentRegistry implements ComponentRegistryShareState {
14
14
  private _typeRegistry;
15
15
  private _customComponentRegistry;
16
16
  private _managedPropsRegistry;
17
+ private _internalPropsRegistry;
17
18
  constructor(rootStore: RootStore);
18
19
  addType(type: string, component: Type): void;
19
20
  addCustomComponent(type: string, component: Type): void;
@@ -21,6 +22,14 @@ export declare class ComponentRegistry implements ComponentRegistryShareState {
21
22
  renameCustomComponent(oldName: string, newName: string): void;
22
23
  addManagedProps(type: string, props: ManagedPropsList): void;
23
24
  deleteManagedProps(type: string): void;
25
+ addInternalProps(type: string, props: Array<{
26
+ path: string;
27
+ factory: () => any;
28
+ }>): void;
29
+ getInternalProps(type: string): Array<{
30
+ path: string;
31
+ factory: () => any;
32
+ }>;
24
33
  get libraryComponentList(): string[];
25
34
  get customComponentList(): string[];
26
35
  get managedPropsRegistry(): Map<string, ManagedPropsList>;
@@ -10,8 +10,12 @@ export type SbComponentProps<El = HTMLElement> = {
10
10
  maxWidth?: Dim;
11
11
  maxHeight?: Dim;
12
12
  sourceId?: SbElement;
13
- reportInstanceId?: (instanceId: SbInstance) => void;
14
13
  marginLeft?: Dim<"columns">;
15
14
  marginTop?: Dim<"rows">;
16
15
  constraintTop?: string | string[];
16
+ /**
17
+ * undefined means auto, true means always loading, false means never loading
18
+ */
19
+ loading?: boolean;
20
+ reportInstanceId?: (instanceId: SbInstance) => void;
17
21
  } & Omit<React.HTMLAttributes<El>, "height" | "width" | "marginLeft" | "marginTop">;
@@ -2,7 +2,10 @@ import { Section } from "../../properties-panel/props-builder.js";
2
2
  import type { Prop, InternalProps } from "../../properties-panel/props-builder.js";
3
3
  import type { SbEventFlow } from "../../sb-event-flow.js";
4
4
  import type { ReactNode } from "react";
5
- declare const layoutPropDef: {
5
+ declare const defaultSections: {
6
+ appearance: Section<Record<string, Prop<any, any, undefined>> & {
7
+ loading: Prop<boolean, true, undefined>;
8
+ }>;
6
9
  layout: Section<Record<string, Prop<any, any, undefined>> & {
7
10
  maxHeight?: Prop<import("@superblocksteam/library-shared").Dim<import("@superblocksteam/library-shared").DimModes>, false, undefined> | undefined;
8
11
  minHeight?: Prop<import("@superblocksteam/library-shared").Dim<import("@superblocksteam/library-shared").DimModes>, false, undefined> | undefined;
@@ -24,7 +27,7 @@ declare const layoutPropDef: {
24
27
  type WrappedEventProps<IP extends InternalProps<any>> = {
25
28
  [K in keyof IP]: IP[K] extends SbEventFlow | undefined ? () => Promise<void> : IP[K];
26
29
  };
27
- type SectionProps<PD extends Record<string, Prop<any>>> = Record<string, Section<PD>> & typeof layoutPropDef;
30
+ type SectionProps<PD extends Record<string, Prop<any>>> = Record<string, Section<PD>> & typeof defaultSections;
28
31
  export type CustomComponentProps<PD extends Record<string, Prop<any>>, SP extends SectionProps<PD> = SectionProps<PD>, IP extends InternalProps<SP> = InternalProps<SP>> = WrappedEventProps<IP>;
29
32
  export declare function registerComponent<PD extends Record<string, Prop<any>>>(name: string, propertiesDefinition: PD, component: React.FC<CustomComponentProps<PD>>): import("react").FC<any>;
30
33
  export declare function isCustomComponent(child: ReactNode): boolean;
@@ -11,6 +11,7 @@ declare class InputComponent extends React.Component<InputComponentProps, InputC
11
11
  componentDidUpdate(prevProps: Readonly<InputComponentProps>): void;
12
12
  componentWillUnmount(): void;
13
13
  shouldComponentUpdate(prevProps: Readonly<InputComponentProps>, prevState: Readonly<InputComponentState>): boolean;
14
+ private processAndSetValue;
14
15
  onDebouncedValueChange: import("lodash").DebouncedFunc<(value: any) => void>;
15
16
  getInputDomElement: () => HTMLInputElement | null | undefined;
16
17
  ensureFocus: () => void;
@@ -324,7 +324,6 @@ export declare const SbTable: import("react").FC<import("../../properties-panel/
324
324
  maxLinesPerRow: import("../../properties-panel/props-builder.js").Prop<number, true, undefined>;
325
325
  loading: import("../../properties-panel/props-builder.js").Prop<boolean, true, undefined>;
326
326
  isVisible: import("../../properties-panel/props-builder.js").Prop<boolean, false, undefined>;
327
- collapseWhenHidden: import("../../properties-panel/props-builder.js").Prop<boolean, false, undefined>;
328
327
  "searchProps.textStyle": import("../../properties-panel/props-builder.js").Prop<import("@superblocksteam/library-shared/types").TextStyleWithVariant, true, undefined>;
329
328
  "searchProps.backgroundColor": import("../../properties-panel/props-builder.js").Prop<string, true, undefined>;
330
329
  "searchProps.border": import("../../properties-panel/props-builder.js").Prop<import("@superblocksteam/library-shared/types").PerSideBorder, false, undefined>;
@@ -327,7 +327,6 @@ export declare const propertiesDefinition: {
327
327
  maxLinesPerRow: Prop<number, true, undefined>;
328
328
  loading: Prop<boolean, true, undefined>;
329
329
  isVisible: Prop<boolean, false, undefined>;
330
- collapseWhenHidden: Prop<boolean, false, undefined>;
331
330
  "searchProps.textStyle": Prop<import("@superblocksteam/library-shared/types").TextStyleWithVariant, true, undefined>;
332
331
  "searchProps.backgroundColor": Prop<string, true, undefined>;
333
332
  "searchProps.border": Prop<import("@superblocksteam/library-shared/types").PerSideBorder, false, undefined>;
@@ -1,7 +1,9 @@
1
1
  import { Section, Prop, type InternalProps } from "../../properties-panel/props-builder.js";
2
- export type ApiEntity = InternalProps<typeof propertiesDefinition> & {
2
+ import { SuspensibleAPI } from "./suspensible-api.js";
3
+ export type ApiEntity = Omit<InternalProps<typeof propertiesDefinition>, "_suspensibleApi"> & {
3
4
  run: () => Promise<any>;
4
5
  cancel: () => Promise<any>;
6
+ _suspensibleApi: SuspensibleAPI<any, any[]>;
5
7
  };
6
8
  export declare const propertiesDefinition: {
7
9
  events: Section<Record<string, Prop<any, any, undefined>> & {
@@ -11,10 +13,17 @@ export declare const propertiesDefinition: {
11
13
  metadata: Section<Record<string, Prop<any, any, undefined>> & {
12
14
  response: Prop<any, true, undefined>;
13
15
  error: Prop<any, true, undefined>;
14
- isRunning: Prop<boolean, true, undefined>;
16
+ isLoading: Prop<boolean, true, undefined>;
15
17
  }>;
16
18
  functions: Section<Record<string, Prop<any, any, undefined>> & {
17
19
  run: Prop<import("../../../internal-details/lib/evaluator/base-entity-manager.js").EntityFunction<[], Promise<any>>, true, undefined>;
18
20
  cancel: Prop<import("../../../internal-details/lib/evaluator/base-entity-manager.js").EntityFunction<[], Promise<void>>, true, undefined>;
19
21
  }>;
22
+ internal: Section<Record<string, Prop<any, any, undefined>> & {
23
+ /**
24
+ * Internal SuspensibleAPI instance that manages loading states and React Suspense integration.
25
+ * This property is hidden from the public interface but accessible to other properties.
26
+ */
27
+ _suspensibleApi: Prop<SuspensibleAPI<any, []>, true, undefined>;
28
+ }>;
20
29
  };
@@ -0,0 +1,20 @@
1
+ export declare class SuspensibleAPI<TData = any, TArgs extends any[] = any[]> {
2
+ private _response;
3
+ private _error;
4
+ private _promise;
5
+ private _isLoading;
6
+ private _runFn;
7
+ private _cancelFn;
8
+ constructor({ runFn, cancelFn, }: {
9
+ runFn: (...args: TArgs) => Promise<TData>;
10
+ cancelFn: (...args: TArgs) => Promise<void>;
11
+ });
12
+ /**
13
+ * Context-aware response getter that either returns data or throws promises to trigger React Suspense.
14
+ */
15
+ get response(): TData | undefined;
16
+ get isLoading(): boolean;
17
+ get error(): Error | undefined;
18
+ run(...args: TArgs): Promise<TData>;
19
+ cancel(...args: TArgs): Promise<void>;
20
+ }
@@ -1,5 +1,9 @@
1
1
  import { Section } from "./props-builder.js";
2
2
  import type { ManagedPropsList } from "./props-builder.js";
3
3
  export declare const RECORD_PATH_IDENTIFIER = "*";
4
+ export declare function createInternalPropsList(sections: Record<string, Section>, parentPath?: string): Array<{
5
+ path: string;
6
+ factory: () => any;
7
+ }>;
4
8
  declare function createManagedPropsList(sections: Record<string, Section>, parentPath?: string): ManagedPropsList;
5
9
  export { createManagedPropsList };
@@ -162,6 +162,13 @@ declare class Prop<Type extends DataType, _HasDefault extends boolean = false, _
162
162
  static literal<T extends Readonly<string | number | boolean>>(value: T): Prop<T, true>;
163
163
  static event(): Prop<SbEventFlow>;
164
164
  static function<ARGS extends any[] = any[], RETURN = any>(implementation: EntityFunction<ARGS, RETURN>): Prop<EntityFunction<ARGS, RETURN>, true>;
165
+ /**
166
+ * Creates an internal property that is not exposed in the entity's public interface,
167
+ * not tracked for reactivity/syncing, and not serialized. This is useful for
168
+ * storing implementation details like SuspensibleAPI instances that other
169
+ * properties can reference via `this._propertyName`.
170
+ */
171
+ static internal<T = any>(factory: () => T): Prop<T, true>;
165
172
  /**
166
173
  * Creates a composite property, which is a property that contains nested properties. For example,
167
174
  * the following composite property:
@@ -212,6 +219,7 @@ declare class Prop<Type extends DataType, _HasDefault extends boolean = false, _
212
219
  writable(): this;
213
220
  readAndWrite(): this;
214
221
  default(de: SingleInputProp<DataType>): Prop<Type, true>;
222
+ computed(computeFn: SingleInputProp<DataType>): Prop<Type, true>;
215
223
  allowNestedBindings(): Prop<Type, true>;
216
224
  contextual<TContext extends any[] | undefined = any[]>(computedArgs?: EvaluateOrValueComputedArgs): Prop<Type, _HasDefault, TContext>;
217
225
  validate(validateFn: ((value: any) => ValidationResult<Type>) | ValidateFn<any>): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superblocksteam/library",
3
- "version": "2.0.6-next.57",
3
+ "version": "2.0.6-next.59",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -33,7 +33,7 @@
33
33
  "@react-hook/resize-observer": "1.2.6",
34
34
  "@superblocksteam/fast-deep-equal": "3.1.4",
35
35
  "@superblocksteam/iso-currency": "2.0.0",
36
- "@superblocksteam/library-shared": "2.0.6-next.57",
36
+ "@superblocksteam/library-shared": "2.0.6-next.59",
37
37
  "@superblocksteam/shared": "0.9160.0",
38
38
  "antd": "4.24.15",
39
39
  "apca-w3": "^0.1.9",