@contember/react-binding 2.0.0-alpha.24 → 2.0.0-alpha.26

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 (86) hide show
  1. package/dist/development/index.cjs +5 -0
  2. package/dist/development/index.cjs.map +1 -1
  3. package/dist/development/index.js +5 -0
  4. package/dist/development/index.js.map +1 -1
  5. package/dist/development/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  6. package/dist/development/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  7. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs +12 -8
  8. package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  9. package/dist/development/src/accessorPropagation/EnvironmentContext.js +12 -8
  10. package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  11. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs +27 -12
  12. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  13. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js +27 -12
  14. package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  15. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs +33 -15
  16. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  17. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js +33 -15
  18. package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  19. package/dist/development/src/helperComponents/RecursionTerminator.cjs +55 -0
  20. package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -0
  21. package/dist/development/src/helperComponents/RecursionTerminator.js +55 -0
  22. package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -0
  23. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs +39 -0
  24. package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -0
  25. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js +39 -0
  26. package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -0
  27. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs +4 -1
  28. package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  29. package/dist/development/src/markers/MarkerStaticAnalyzer.js +4 -1
  30. package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  31. package/dist/production/index.cjs +5 -0
  32. package/dist/production/index.cjs.map +1 -1
  33. package/dist/production/index.js +5 -0
  34. package/dist/production/index.js.map +1 -1
  35. package/dist/production/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
  36. package/dist/production/src/accessorPropagation/EntityKeyContext.js.map +1 -1
  37. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs +8 -4
  38. package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
  39. package/dist/production/src/accessorPropagation/EnvironmentContext.js +8 -4
  40. package/dist/production/src/accessorPropagation/EnvironmentContext.js.map +1 -1
  41. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs +27 -12
  42. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
  43. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js +27 -12
  44. package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
  45. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs +33 -15
  46. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
  47. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js +33 -15
  48. package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
  49. package/dist/production/src/helperComponents/RecursionTerminator.cjs +55 -0
  50. package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -0
  51. package/dist/production/src/helperComponents/RecursionTerminator.js +55 -0
  52. package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -0
  53. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs +35 -0
  54. package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -0
  55. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js +35 -0
  56. package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -0
  57. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs +4 -1
  58. package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
  59. package/dist/production/src/markers/MarkerStaticAnalyzer.js +4 -1
  60. package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -1
  61. package/dist/types/accessorPropagation/EntityKeyContext.d.ts +1 -1
  62. package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +1 -1
  63. package/dist/types/accessorPropagation/EnvironmentContext.d.ts +4 -3
  64. package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
  65. package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts +9 -1
  66. package/dist/types/accessorPropagation/useEntityListSubTreeLoader.d.ts.map +1 -1
  67. package/dist/types/accessorPropagation/useEntitySubTreeLoader.d.ts +9 -1
  68. package/dist/types/accessorPropagation/useEntitySubTreeLoader.d.ts.map +1 -1
  69. package/dist/types/helperComponents/RecursionTerminator.d.ts +22 -0
  70. package/dist/types/helperComponents/RecursionTerminator.d.ts.map +1 -0
  71. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts +3 -0
  72. package/dist/types/helperComponents/RecursionTerminatorPortal.d.ts.map +1 -0
  73. package/dist/types/helperComponents/index.d.ts +2 -0
  74. package/dist/types/helperComponents/index.d.ts.map +1 -1
  75. package/dist/types/markers/MarkerStaticAnalyzer.d.ts.map +1 -1
  76. package/dist/types/tsconfig.tsbuildinfo +1 -1
  77. package/package.json +7 -8
  78. package/src/accessorPropagation/EntityKeyContext.ts +1 -1
  79. package/src/accessorPropagation/EnvironmentContext.tsx +14 -9
  80. package/src/accessorPropagation/useEntityListSubTreeLoader.ts +41 -12
  81. package/src/accessorPropagation/useEntitySubTreeLoader.ts +49 -16
  82. package/src/helperComponents/RecursionTerminator.tsx +73 -0
  83. package/src/helperComponents/RecursionTerminatorPortal.tsx +35 -0
  84. package/src/helperComponents/index.ts +2 -0
  85. package/src/markers/MarkerStaticAnalyzer.ts +5 -1
  86. package/src/tsconfig.json +0 -1
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const binding = require("@contember/binding");
5
+ const RecursionTerminator = require("./RecursionTerminator.cjs");
6
+ const Component = require("../coreComponents/Component.cjs");
7
+ const EnvironmentContext = require("../accessorPropagation/EnvironmentContext.cjs");
8
+ const RecursionTerminatorPortal = Component.Component(({ field, children }) => {
9
+ return /* @__PURE__ */ jsxRuntime.jsx(EnvironmentContext.EnvironmentMiddleware, { args: [field], create: createEnvWithExtension, children });
10
+ });
11
+ const createEnvWithExtension = (env, [{ field, kind }]) => {
12
+ const envForField = kind === "hasOne" ? binding.TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field }) : binding.TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field });
13
+ const parentNode = envForField.getSubTreeNode();
14
+ if (!(parentNode.type === "entity-list" || parentNode.type === "entity")) {
15
+ throw new binding.BindingError();
16
+ }
17
+ return env.withExtension(RecursionTerminator.recursionTerminatorEnvironmentExtension, {
18
+ shouldTerminate: (args) => {
19
+ if (args.environment.getParent().getSubTreeNode() !== env.getSubTreeNode()) {
20
+ return void 0;
21
+ }
22
+ const currentNode = args.node;
23
+ if (currentNode.type !== "subtree-entity" || currentNode.entity.name !== parentNode.field.targetEntity) {
24
+ return void 0;
25
+ }
26
+ const inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy;
27
+ if (!inverseField) {
28
+ return false;
29
+ }
30
+ return args.field === inverseField;
31
+ }
32
+ });
33
+ };
34
+ exports.RecursionTerminatorPortal = RecursionTerminatorPortal;
35
+ //# sourceMappingURL=RecursionTerminatorPortal.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecursionTerminatorPortal.cjs","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminatorPortal.tsx"],"sourcesContent":["import { BindingError, Environment, TreeNodeEnvironmentFactory } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } from './RecursionTerminator'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\n\nexport const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {\n\treturn <EnvironmentMiddleware args={[field]} create={createEnvWithExtension} >{children}</EnvironmentMiddleware>\n})\n\nconst createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {\n\tconst envForField = kind === 'hasOne'\n\t\t? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field })\n\t\t: TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field })\n\n\tconst parentNode = envForField.getSubTreeNode()\n\tif (!(parentNode.type === 'entity-list' || parentNode.type === 'entity')) {\n\t\tthrow new BindingError()\n\t}\n\treturn env.withExtension(recursionTerminatorEnvironmentExtension, {\n\t\tshouldTerminate: args => {\n\t\t\tif (args.environment.getParent().getSubTreeNode() !== env.getSubTreeNode()) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst currentNode = args.node\n\t\t\tif (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy\n\t\t\tif (!inverseField) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn args.field === inverseField\n\t\t},\n\t})\n}\n"],"names":["Component","jsx","EnvironmentMiddleware","TreeNodeEnvironmentFactory","BindingError","recursionTerminatorEnvironmentExtension"],"mappings":";;;;;;;AAKO,MAAM,4BAA4BA,UAAAA,UAAoC,CAAC,EAAE,OAAO,eAAe;AAC9F,SAAAC,2BAAA,IAACC,4CAAsB,MAAM,CAAC,KAAK,GAAG,QAAQ,wBAA0B,SAAS,CAAA;AACzF,CAAC;AAED,MAAM,yBAAyB,CAAC,KAAkB,CAAC,EAAE,OAAO,KAAM,CAAA,MAAkD;AACnH,QAAM,cAAc,SAAS,WAC1BC,QAAAA,2BAA2B,2BAA2B,KAAK,EAAE,MAAM,CAAC,IACpEA,QAA2B,2BAAA,+BAA+B,KAAK,EAAE,MAAO,CAAA;AAErE,QAAA,aAAa,YAAY;AAC/B,MAAI,EAAE,WAAW,SAAS,iBAAiB,WAAW,SAAS,WAAW;AACzE,UAAM,IAAIC,QAAa,aAAA;AAAA,EACxB;AACO,SAAA,IAAI,cAAcC,6DAAyC;AAAA,IACjE,iBAAiB,CAAQ,SAAA;AACpB,UAAA,KAAK,YAAY,UAAU,EAAE,qBAAqB,IAAI,kBAAkB;AACpE,eAAA;AAAA,MACR;AACA,YAAM,cAAc,KAAK;AACrB,UAAA,YAAY,SAAS,oBAAoB,YAAY,OAAO,SAAS,WAAW,MAAM,cAAc;AAChG,eAAA;AAAA,MACR;AACA,YAAM,eAAe,WAAW,MAAM,cAAc,WAAW,MAAM;AACrE,UAAI,CAAC,cAAc;AACX,eAAA;AAAA,MACR;AACA,aAAO,KAAK,UAAU;AAAA,IACvB;AAAA,EAAA,CACA;AACF;;"}
@@ -0,0 +1,35 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { TreeNodeEnvironmentFactory, BindingError } from "@contember/binding";
3
+ import { recursionTerminatorEnvironmentExtension } from "./RecursionTerminator.js";
4
+ import { Component } from "../coreComponents/Component.js";
5
+ import { EnvironmentMiddleware } from "../accessorPropagation/EnvironmentContext.js";
6
+ const RecursionTerminatorPortal = Component(({ field, children }) => {
7
+ return /* @__PURE__ */ jsx(EnvironmentMiddleware, { args: [field], create: createEnvWithExtension, children });
8
+ });
9
+ const createEnvWithExtension = (env, [{ field, kind }]) => {
10
+ const envForField = kind === "hasOne" ? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field }) : TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field });
11
+ const parentNode = envForField.getSubTreeNode();
12
+ if (!(parentNode.type === "entity-list" || parentNode.type === "entity")) {
13
+ throw new BindingError();
14
+ }
15
+ return env.withExtension(recursionTerminatorEnvironmentExtension, {
16
+ shouldTerminate: (args) => {
17
+ if (args.environment.getParent().getSubTreeNode() !== env.getSubTreeNode()) {
18
+ return void 0;
19
+ }
20
+ const currentNode = args.node;
21
+ if (currentNode.type !== "subtree-entity" || currentNode.entity.name !== parentNode.field.targetEntity) {
22
+ return void 0;
23
+ }
24
+ const inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy;
25
+ if (!inverseField) {
26
+ return false;
27
+ }
28
+ return args.field === inverseField;
29
+ }
30
+ });
31
+ };
32
+ export {
33
+ RecursionTerminatorPortal
34
+ };
35
+ //# sourceMappingURL=RecursionTerminatorPortal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecursionTerminatorPortal.js","sources":["../../../../../packages/react-binding/src/helperComponents/RecursionTerminatorPortal.tsx"],"sourcesContent":["import { BindingError, Environment, TreeNodeEnvironmentFactory } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { recursionTerminatorEnvironmentExtension, RecursionTerminatorProps } from './RecursionTerminator'\nimport { EnvironmentMiddleware } from '../accessorPropagation'\n\nexport const RecursionTerminatorPortal = Component<RecursionTerminatorProps>(({ field, children }) => {\n\treturn <EnvironmentMiddleware args={[field]} create={createEnvWithExtension} >{children}</EnvironmentMiddleware>\n})\n\nconst createEnvWithExtension = (env: Environment, [{ field, kind }]: [field: RecursionTerminatorProps['field']]) => {\n\tconst envForField = kind === 'hasOne'\n\t\t? TreeNodeEnvironmentFactory.createEnvironmentForEntity(env, { field })\n\t\t: TreeNodeEnvironmentFactory.createEnvironmentForEntityList(env, { field })\n\n\tconst parentNode = envForField.getSubTreeNode()\n\tif (!(parentNode.type === 'entity-list' || parentNode.type === 'entity')) {\n\t\tthrow new BindingError()\n\t}\n\treturn env.withExtension(recursionTerminatorEnvironmentExtension, {\n\t\tshouldTerminate: args => {\n\t\t\tif (args.environment.getParent().getSubTreeNode() !== env.getSubTreeNode()) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst currentNode = args.node\n\t\t\tif (currentNode.type !== 'subtree-entity' || currentNode.entity.name !== parentNode.field.targetEntity) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tconst inverseField = parentNode.field.inversedBy ?? parentNode.field.ownedBy\n\t\t\tif (!inverseField) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn args.field === inverseField\n\t\t},\n\t})\n}\n"],"names":[],"mappings":";;;;;AAKO,MAAM,4BAA4B,UAAoC,CAAC,EAAE,OAAO,eAAe;AAC9F,SAAA,oBAAC,yBAAsB,MAAM,CAAC,KAAK,GAAG,QAAQ,wBAA0B,SAAS,CAAA;AACzF,CAAC;AAED,MAAM,yBAAyB,CAAC,KAAkB,CAAC,EAAE,OAAO,KAAM,CAAA,MAAkD;AACnH,QAAM,cAAc,SAAS,WAC1B,2BAA2B,2BAA2B,KAAK,EAAE,MAAM,CAAC,IACpE,2BAA2B,+BAA+B,KAAK,EAAE,MAAO,CAAA;AAErE,QAAA,aAAa,YAAY;AAC/B,MAAI,EAAE,WAAW,SAAS,iBAAiB,WAAW,SAAS,WAAW;AACzE,UAAM,IAAI,aAAa;AAAA,EACxB;AACO,SAAA,IAAI,cAAc,yCAAyC;AAAA,IACjE,iBAAiB,CAAQ,SAAA;AACpB,UAAA,KAAK,YAAY,UAAU,EAAE,qBAAqB,IAAI,kBAAkB;AACpE,eAAA;AAAA,MACR;AACA,YAAM,cAAc,KAAK;AACrB,UAAA,YAAY,SAAS,oBAAoB,YAAY,OAAO,SAAS,WAAW,MAAM,cAAc;AAChG,eAAA;AAAA,MACR;AACA,YAAM,eAAe,WAAW,MAAM,cAAc,WAAW,MAAM;AACrE,UAAI,CAAC,cAAc;AACX,eAAA;AAAA,MACR;AACA,aAAO,KAAK,UAAU;AAAA,IACvB;AAAA,EAAA,CACA;AACF;"}
@@ -29,8 +29,11 @@ class MarkerStaticAnalyzer {
29
29
  if (typeof node.type === "symbol" || typeof node.type === "string") {
30
30
  return this.processNode(node.props.children, env, componentPath);
31
31
  }
32
- componentPath = [...componentPath, node];
33
32
  const nodeDisplayName = "displayName" in node.type ? node.type.displayName : "???";
33
+ componentPath = [...componentPath, node];
34
+ if (componentPath.length > 1e3) {
35
+ wrapError(new ChildrenAnalyzerError("Component path too long, likely a circular reference"), nodeDisplayName, "[NONE]", componentPath);
36
+ }
34
37
  try {
35
38
  if ("generateEnvironment" in node.type) {
36
39
  env = node.type.generateEnvironment(node.props, env);
@@ -1 +1 @@
1
- {"version":3,"file":"MarkerStaticAnalyzer.cjs","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(`Render props (functions as React component children) are not supported within the schema. ` +\n\t\t\t\t`You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` ` +\n\t\t\t\t`from the \\`@contember/admin\\` package. Please refer to the documentation.`)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (!('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(node.props.children, env, componentPath)\n\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(node.props, env)]\n\t\t}\n\t\tlet children: ReactNode = node.props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(node.props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["IncrementalMarkerBuilder","props","key","value"],"mappings":";;;;;;;AAcO,MAAM,qB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AAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAI,sBAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;;;"}
1
+ {"version":3,"file":"MarkerStaticAnalyzer.cjs","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(`Render props (functions as React component children) are not supported within the schema. ` +\n\t\t\t\t`You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` ` +\n\t\t\t\t`from the \\`@contember/admin\\` package. Please refer to the documentation.`)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (!('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(node.props.children, env, componentPath)\n\t\t}\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (componentPath.length > 1000) {\n\t\t\twrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)\n\t\t}\n\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(node.props, env)]\n\t\t}\n\t\tlet children: ReactNode = node.props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(node.props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["IncrementalMarkerBuilder","props","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AA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAI,sBAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;;;"}
@@ -27,8 +27,11 @@ class MarkerStaticAnalyzer {
27
27
  if (typeof node.type === "symbol" || typeof node.type === "string") {
28
28
  return this.processNode(node.props.children, env, componentPath);
29
29
  }
30
- componentPath = [...componentPath, node];
31
30
  const nodeDisplayName = "displayName" in node.type ? node.type.displayName : "???";
31
+ componentPath = [...componentPath, node];
32
+ if (componentPath.length > 1e3) {
33
+ wrapError(new ChildrenAnalyzerError("Component path too long, likely a circular reference"), nodeDisplayName, "[NONE]", componentPath);
34
+ }
32
35
  try {
33
36
  if ("generateEnvironment" in node.type) {
34
37
  env = node.type.generateEnvironment(node.props, env);
@@ -1 +1 @@
1
- {"version":3,"file":"MarkerStaticAnalyzer.js","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(`Render props (functions as React component children) are not supported within the schema. ` +\n\t\t\t\t`You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` ` +\n\t\t\t\t`from the \\`@contember/admin\\` package. Please refer to the documentation.`)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (!('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(node.props.children, env, componentPath)\n\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(node.props, env)]\n\t\t}\n\t\tlet children: ReactNode = node.props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(node.props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","React"],"mappings":";;;;;AAcO,MAAM,qBAAqB;AAAA,EAC1B,gBACN,UACA,KAC6E;AAC7E,UAAM,UAAU,KAAK,YAAY,UAAU,KAAK,CAAA,CAAE;AAC9C,QAAA,QAAQ,WAAW,GAAG;AAClB,aAAA;AAAA,IACR;AACO,WAAA,yBAAyB,MAAM,OAAO;AAAA,EAC9C;AAAA,EAEQ,YACP,MACA,KACA,eACY;AACZ,QAAI,SAAS,SAAS,SAAS,UAAa,SAAS,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW;AAC/I,aAAO;IACR;AACI,QAAA,OAAO,SAAS,YAAY;AACzB,YAAA,IAAI,sBAAsB,+PAE4C;AAAA,IAC7E;AAEI,QAAA,MAAM,QAAQ,IAAI,GAAG;AACjB,aAAA,KAAK,QAAQ,CAAW,YAAA,KAAK,YAAY,SAAS,KAAK,aAAa,CAAC;AAAA,IAC7E;AAEI,QAAA,EAAE,UAAU,OAAO;AACtB,aAAO;IACR;AAEA,QAAI,OAAO,KAAK,SAAS,YAAY,OAAO,KAAK,SAAS,UAAU;AAEnE,aAAO,KAAK,YAAY,KAAK,MAAM,UAAU,KAAK,aAAa;AAAA,IAChE;AAEgB,oBAAA,CAAC,GAAG,eAAe,IAAI;AAEvC,UAAM,kBAAkB,iBAAiB,KAAK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D,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACtD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAAC,eAAM,eAAeD,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;AAEU,oBAAA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAI,sBAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;"}
1
+ {"version":3,"file":"MarkerStaticAnalyzer.js","sources":["../../../../../packages/react-binding/src/markers/MarkerStaticAnalyzer.ts"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\nimport { BranchMarkerProvider, EnvironmentDeltaProvider, LeafMarkerProvider, StaticRenderProvider } from './MarkerProvider'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityFieldsWithHoistablesMarker,\n\tEnvironment,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '@contember/binding'\nimport { IncrementalMarkerBuilder } from './IncrementalMarkerBuilder'\n\ntype Markers = FieldMarker | HasOneRelationMarker | EntityFieldMarkersContainer | EntityFieldsWithHoistablesMarker | HasManyRelationMarker\n\nexport class MarkerStaticAnalyzer {\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tenv: Environment,\n\t): EntityFieldsWithHoistablesMarker | EntityFieldMarkersContainer | undefined {\n\t\tconst markers = this.processNode(children, env, [])\n\t\tif (markers.length === 0) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn IncrementalMarkerBuilder.build(markers)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tenv: Environment,\n\t\tcomponentPath: ReactElement[],\n\t): Markers[] {\n\t\tif (node === false || node === undefined || node === null || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\treturn []\n\t\t}\n\t\tif (typeof node === 'function') {\n\t\t\tthrow new ChildrenAnalyzerError(`Render props (functions as React component children) are not supported within the schema. ` +\n\t\t\t\t`You have likely used a bare custom component as opposed to wrapping in with \\`Component\\` ` +\n\t\t\t\t`from the \\`@contember/admin\\` package. Please refer to the documentation.`)\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\treturn node.flatMap(subNode => this.processNode(subNode, env, componentPath))\n\t\t}\n\n\t\tif (!('type' in node)) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (typeof node.type === 'symbol' || typeof node.type === 'string') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(node.props.children, env, componentPath)\n\t\t}\n\n\t\tconst nodeDisplayName = 'displayName' in node.type ? (node.type.displayName as string) : '???'\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (componentPath.length > 1000) {\n\t\t\twrapError(new ChildrenAnalyzerError('Component path too long, likely a circular reference'), nodeDisplayName, '[NONE]', componentPath)\n\t\t}\n\n\n\t\ttry {\n\t\t\tif ('generateEnvironment' in node.type) {\n\t\t\t\tenv = (node.type as EnvironmentDeltaProvider).generateEnvironment(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static context factory', componentPath)\n\t\t}\n\t\tif ('generateLeafMarker' in node.type) {\n\t\t\treturn [(node.type as LeafMarkerProvider).generateLeafMarker(node.props, env)]\n\t\t}\n\t\tlet children: ReactNode = node.props.children\n\t\ttry {\n\t\t\tif ('staticRender' in node.type) {\n\t\t\t\tchildren = (node.type as StaticRenderProvider).staticRender(node.props, env)\n\t\t\t}\n\t\t} catch (e) {\n\t\t\twrapError(e, nodeDisplayName, 'static render', componentPath)\n\t\t}\n\t\tconst processedChildren = this.processNode(children, env, componentPath)\n\t\tif ('generateBranchMarker' in node.type) {\n\t\t\tconst marker = IncrementalMarkerBuilder.build(processedChildren)\n\t\t\treturn [(node.type as BranchMarkerProvider).generateBranchMarker(node.props, marker, env)]\n\t\t}\n\t\treturn processedChildren\n\t}\n}\n\nexport class ChildrenAnalyzerError extends Error {\n\tpublic details?: string\n\n\tconstructor(message: string, options?: { cause: Error; details?: string }) {\n\t\tsuper(message, options)\n\t\tthis.details = options?.details\n\t}\n}\n\nconst wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn value\n\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","React"],"mappings":";;;;;AAcO,MAAM,qBAAqB;AAAA,EAC1B,gBACN,UACA,KAC6E;AAC7E,UAAM,UAAU,KAAK,YAAY,UAAU,KAAK,CAAA,CAAE;AAC9C,QAAA,QAAQ,WAAW,GAAG;AAClB,aAAA;AAAA,IACR;AACO,WAAA,yBAAyB,MAAM,OAAO;AAAA,EAC9C;AAAA,EAEQ,YACP,MACA,KACA,eACY;AACZ,QAAI,SAAS,SAAS,SAAS,UAAa,SAAS,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW;AAC/I,aAAO;IACR;AACI,QAAA,OAAO,SAAS,YAAY;AACzB,YAAA,IAAI,sBAAsB,+PAE4C;AAAA,IAC7E;AAEI,QAAA,MAAM,QAAQ,IAAI,GAAG;AACjB,aAAA,KAAK,QAAQ,CAAW,YAAA,KAAK,YAAY,SAAS,KAAK,aAAa,CAAC;AAAA,IAC7E;AAEI,QAAA,EAAE,UAAU,OAAO;AACtB,aAAO;IACR;AAEA,QAAI,OAAO,KAAK,SAAS,YAAY,OAAO,KAAK,SAAS,UAAU;AAEnE,aAAO,KAAK,YAAY,KAAK,MAAM,UAAU,KAAK,aAAa;AAAA,IAChE;AAEA,UAAM,kBAAkB,iBAAiB,KAAK,OAAQ,KAAK,KAAK,cAAyB;AAEzE,oBAAA,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aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACtD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAAC,eAAM,eAAeD,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;AAEU,oBAAA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAI,sBAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;"}
@@ -1,3 +1,3 @@
1
- import { EntityAccessor } from '@contember/binding-common';
1
+ import { EntityAccessor } from '@contember/binding';
2
2
  export declare const EntityKeyContext: React.Context<string | (() => EntityAccessor) | undefined>;
3
3
  //# sourceMappingURL=EntityKeyContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EntityKeyContext.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/EntityKeyContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAG1D,eAAO,MAAM,gBAAgB,gCAA6C,cAAc,cAAa,CAAA"}
1
+ {"version":3,"file":"EntityKeyContext.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/EntityKeyContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAGnD,eAAO,MAAM,gBAAgB,gCAA6C,cAAc,cAAa,CAAA"}
@@ -1,11 +1,12 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Environment } from '@contember/binding';
3
3
  export declare const EnvironmentContext: React.Context<Environment<Environment.AnyNode | undefined>>;
4
- export interface EnvironmentMiddlewareProps {
4
+ export interface EnvironmentMiddlewareProps<T extends unknown[]> {
5
5
  children: ReactNode;
6
- create: (env: Environment) => Environment;
6
+ create: (env: Environment, args: T) => Environment;
7
+ args?: T;
7
8
  }
8
- export declare const EnvironmentMiddleware: React.NamedExoticComponent<EnvironmentMiddlewareProps>;
9
+ export declare const EnvironmentMiddleware: <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode;
9
10
  export interface EnvironmentWithExtensionProps<S, R> {
10
11
  children: ReactNode;
11
12
  extension: Environment.Extension<S, R>;
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentContext.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/EnvironmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAwB,MAAM,OAAO,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,eAAO,MAAM,kBAAkB,6DAAmD,CAAA;AAGlF,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,WAAW,CAAA;CACzC;AAED,eAAO,MAAM,qBAAqB,wDAejC,CAAA;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC,EAAE,CAAC;IAClD,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,KAAK,EAAE,CAAC,CAAA;CACR;AAED,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAShG,CAAA"}
1
+ {"version":3,"file":"EnvironmentContext.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/EnvironmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,SAAS,EAAwB,MAAM,OAAO,CAAA;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIhD,eAAO,MAAM,kBAAkB,6DAAmD,CAAA;AAGlF,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,OAAO,EAAE;IAC9D,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,KAAK,WAAW,CAAA;IAClD,IAAI,CAAC,EAAE,CAAC,CAAA;CACR;AAED,eAAO,MAAM,qBAAqB,EAmB7B,CAAC,CAAmB,SAAT,OAAO,EAAE,EAAE,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,SAAS,CAAA;AAE7E,MAAM,WAAW,6BAA6B,CAAC,CAAC,EAAE,CAAC;IAClD,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtC,KAAK,EAAE,CAAC,CAAA;CACR;AAED,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAShG,CAAA"}
@@ -28,7 +28,15 @@ export type UseEntityListSubTreeLoaderStateLoaded<State> = {
28
28
  customState: State;
29
29
  isLoading: false;
30
30
  };
31
- export type UseEntityListSubTreeLoaderState<State> = UseEntityListSubTreeLoaderStateInitial | UseEntityListSubTreeLoaderStateLoading | UseEntityListSubTreeLoaderStateRefreshing<State> | UseEntityListSubTreeLoaderStateLoaded<State>;
31
+ export type UseEntityListSubTreeLoaderStateFailed = {
32
+ state: 'failed';
33
+ error: unknown;
34
+ entities: undefined;
35
+ treeRootId: undefined;
36
+ customState: undefined;
37
+ isLoading: false;
38
+ };
39
+ export type UseEntityListSubTreeLoaderState<State> = UseEntityListSubTreeLoaderStateInitial | UseEntityListSubTreeLoaderStateLoading | UseEntityListSubTreeLoaderStateRefreshing<State> | UseEntityListSubTreeLoaderStateLoaded<State> | UseEntityListSubTreeLoaderStateFailed;
32
40
  export type UseEntityListSubTreeLoaderStateMethods = {
33
41
  reload: () => void;
34
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useEntityListSubTreeLoader.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntityListSubTreeLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAA4C,MAAM,OAAO,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAK3E,MAAM,MAAM,sCAAsC,GAAG;IACpD,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,EAAE,SAAS,CAAA;IACtB,SAAS,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sCAAsC,GAAG;IACpD,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,EAAE,SAAS,CAAA;IACtB,SAAS,EAAE,IAAI,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yCAAyC,CAAC,KAAK,IAAI;IAC9D,KAAK,EAAE,YAAY,CAAA;IACnB,QAAQ,EAAE,0BAA0B,CAAA;IACpC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,WAAW,EAAE,KAAK,CAAA;IAClB,SAAS,EAAE,IAAI,CAAA;CACf,CAAA;AAGD,MAAM,MAAM,qCAAqC,CAAC,KAAK,IAAI;IAC1D,KAAK,EAAE,QAAQ,CAAA;IACf,QAAQ,EAAE,0BAA0B,CAAA;IACpC,UAAU,EAAE,UAAU,GAAG,SAAS,CAAA;IAClC,WAAW,EAAE,KAAK,CAAA;IAClB,SAAS,EAAE,KAAK,CAAA;CAChB,CAAA;AAGD,MAAM,MAAM,+BAA+B,CAAC,KAAK,IAC9C,sCAAsC,GACtC,sCAAsC,GACtC,yCAAyC,CAAC,KAAK,CAAC,GAChD,qCAAqC,CAAC,KAAK,CAAC,CAAA;AAE/C,MAAM,MAAM,sCAAsC,GAAG;IACpD,MAAM,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAI,KAAK,YAAY,0BAA0B,GAAG,SAAS,YAAY,SAAS,UAAU,KAAK,KAAG,CAAC,+BAA+B,CAAC,KAAK,CAAC,EAAE,sCAAsC,CAwEvN,CAAA"}
1
+ {"version":3,"file":"useEntityListSubTreeLoader.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntityListSubTreeLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAA4C,MAAM,OAAO,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAM3E,MAAM,MAAM,sCAAsC,GAAG;IACpD,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,EAAE,SAAS,CAAA;IACtB,SAAS,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sCAAsC,GAAG;IACpD,KAAK,EAAE,SAAS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TreeLoaderStateLoaded<State> = {
28
28
  customState: State;
29
29
  isLoading: false;
30
30
  };
31
- export type UseEntitySubTreeLoaderState<State> = UseEntitySubTreeLoaderStateInitial | UseEntitySubTreeLoaderStateLoading | UseEntitySubTreeLoaderStateRefreshing<State> | UseEntitySubTreeLoaderStateLoaded<State>;
31
+ export type UseEntitySubTreeLoaderStateFailed = {
32
+ state: 'failed';
33
+ error: unknown;
34
+ entity: undefined;
35
+ treeRootId: undefined;
36
+ customState: undefined;
37
+ isLoading: false;
38
+ };
39
+ export type UseEntitySubTreeLoaderState<State> = UseEntitySubTreeLoaderStateInitial | UseEntitySubTreeLoaderStateLoading | UseEntitySubTreeLoaderStateRefreshing<State> | UseEntitySubTreeLoaderStateLoaded<State> | UseEntitySubTreeLoaderStateFailed;
32
40
  export type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state'];
33
41
  export type UseEntitySubTreeLoaderStateMethods = {
34
42
  reload: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useEntitySubTreeLoader.d.ts","sourceRoot":"","sources":["../../../src/accessorPropagation/useEntitySubTreeLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAA4C,MAAM,OAAO,CAAA;AAC1F,OAAO,EAAE,4BAA4B,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI7E,MAAM,MAAM,kCAAkC,GAAG;IAChD,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,EAAE,SAAS,CAAA;IACjB,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,EAAE,SAAS,CAAA;IACtB,SAAS,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,kCAAkC,GAAG;IAChD,KAAK,EAAE,SAAS,CAAA;IAChB,MAAM,EAAE,SAAS,CAAA;IACjB,UAAU,EAAE,SAAS,CAAA;IACrB,WAAW,EAAE,SAAS,CAAA;IACtB,SAAS,EAAE,IAAI,CAAA;CACf,CAAA;AAED,MAAM,MAAM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AI,CAAA;CAClB,CAAA;AAID,eAAO,MAAM,sBAAsB,GAAI,KAAK,UAAU,4BAA4B,GAAG,SAAS,YAAY,SAAS,UAAU,KAAK,KAAG,CAAC,2BAA2B,CAAC,KAAK,CAAC,EAAE,kCAAkC,CAyF3M,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { Environment, SugaredRelativeEntityList, SugaredRelativeSingleEntity } from '@contember/binding';
2
+ import { ReactNode } from 'react';
3
+ export interface RecursionTerminatorOptions {
4
+ shouldTerminate?: (args: {
5
+ node: Environment.AnyNode;
6
+ field: string;
7
+ environment: Environment;
8
+ }) => boolean | undefined;
9
+ }
10
+ export declare const recursionTerminatorEnvironmentExtension: Environment.Extension<RecursionTerminatorOptions, RecursionTerminatorOptions | undefined>;
11
+ export interface RecursionTerminatorProps {
12
+ field: {
13
+ kind: 'hasOne';
14
+ field: SugaredRelativeSingleEntity['field'];
15
+ } | {
16
+ kind: 'hasMany';
17
+ field: SugaredRelativeEntityList['field'];
18
+ };
19
+ children: ReactNode;
20
+ }
21
+ export declare const RecursionTerminator: React.NamedExoticComponent<RecursionTerminatorProps>;
22
+ //# sourceMappingURL=RecursionTerminator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecursionTerminator.d.ts","sourceRoot":"","sources":["../../../src/helperComponents/RecursionTerminator.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EAEX,yBAAyB,EACzB,2BAA2B,EAE3B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAA;AAG1C,MAAM,WAAW,0BAA0B;IAC1C,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,GAAG,SAAS,CAAA;CACvH;AAED,eAAO,MAAM,uCAAuC,2FAElD,CAAA;AAEF,MAAM,WAAW,wBAAwB;IACxC,KAAK,EACF;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAA;KAAE,GAC/D;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAA;KAAE,CAAA;IACjE,QAAQ,EAAE,SAAS,CAAA;CACnB;AAED,eAAO,MAAM,mBAAmB,sDAS9B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { RecursionTerminatorProps } from './RecursionTerminator';
2
+ export declare const RecursionTerminatorPortal: React.NamedExoticComponent<RecursionTerminatorProps>;
3
+ //# sourceMappingURL=RecursionTerminatorPortal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecursionTerminatorPortal.d.ts","sourceRoot":"","sources":["../../../src/helperComponents/RecursionTerminatorPortal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2C,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAGzG,eAAO,MAAM,yBAAyB,sDAEpC,CAAA"}
@@ -4,6 +4,8 @@ export * from './EntityView';
4
4
  export * from './If';
5
5
  export * from './FieldView';
6
6
  export * from './LabelMiddleware';
7
+ export * from './RecursionTerminator';
8
+ export * from './RecursionTerminatorPortal';
7
9
  export * from './StaticRender';
8
10
  export * from './SugaredField';
9
11
  export * from './Variable';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helperComponents/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,MAAM,CAAA;AACpB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helperComponents/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,MAAM,CAAA;AACpB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MarkerStaticAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/markers/MarkerStaticAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EACN,2BAA2B,EAC3B,gCAAgC,EAChC,WAAW,EAIX,MAAM,oBAAoB,CAAA;AAK3B,qBAAa,oBAAoB;IACzB,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,GAAG,EAAE,WAAW,GACd,gCAAgC,GAAG,2BAA2B,GAAG,SAAS;IAQ7E,OAAO,CAAC,WAAW;CAwDnB;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;gBAEX,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;CAIzE"}
1
+ {"version":3,"file":"MarkerStaticAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/markers/MarkerStaticAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EACN,2BAA2B,EAC3B,gCAAgC,EAChC,WAAW,EAIX,MAAM,oBAAoB,CAAA;AAK3B,qBAAa,oBAAoB;IACzB,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,GAAG,EAAE,WAAW,GACd,gCAAgC,GAAG,2BAA2B,GAAG,SAAS;IAQ7E,OAAO,CAAC,WAAW;CA4DnB;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IACxC,OAAO,CAAC,EAAE,MAAM,CAAA;gBAEX,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;CAIzE"}