@contember/react-binding 1.3.0-alpha.7 → 1.3.0-alpha.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.
- package/dist/development/MarkerTreeGenerator.cjs +2 -2
- package/dist/development/MarkerTreeGenerator.cjs.map +1 -1
- package/dist/development/MarkerTreeGenerator.js +2 -2
- package/dist/development/MarkerTreeGenerator.js.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/development/accessorPropagation/EnvironmentContext.cjs +4 -4
- package/dist/development/accessorPropagation/EnvironmentContext.cjs.map +1 -1
- package/dist/development/accessorPropagation/EnvironmentContext.js +4 -4
- package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/development/accessorPropagation/useExtendTree.cjs.map +1 -1
- package/dist/development/accessorPropagation/useExtendTree.js.map +1 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.cjs +9 -9
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +9 -9
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/accessorSorting/errors.cjs.map +1 -1
- package/dist/development/accessorSorting/errors.js.map +1 -1
- package/dist/development/accessorTree/AccessorTree.cjs +5 -5
- package/dist/development/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/development/accessorTree/AccessorTree.js +5 -5
- package/dist/development/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/development/accessorTree/useDataBinding.js.map +1 -1
- package/dist/development/coreComponents/Component.cjs.map +1 -1
- package/dist/development/coreComponents/Component.js.map +1 -1
- package/dist/development/coreComponents/Entity.cjs +1 -1
- package/dist/development/coreComponents/Entity.cjs.map +1 -1
- package/dist/development/coreComponents/Entity.js +1 -1
- package/dist/development/coreComponents/Entity.js.map +1 -1
- package/dist/development/coreComponents/EntityList.cjs +3 -3
- package/dist/development/coreComponents/EntityList.cjs.map +1 -1
- package/dist/development/coreComponents/EntityList.js +3 -3
- package/dist/development/coreComponents/EntityList.js.map +1 -1
- package/dist/development/coreComponents/EntityListSubTree.cjs +3 -3
- package/dist/development/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/development/coreComponents/EntityListSubTree.js +3 -3
- package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/coreComponents/EntitySubTree.cjs +5 -5
- package/dist/development/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/development/coreComponents/EntitySubTree.js +5 -5
- package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/coreComponents/Field.cjs +2 -2
- package/dist/development/coreComponents/Field.cjs.map +1 -1
- package/dist/development/coreComponents/Field.js +2 -2
- package/dist/development/coreComponents/Field.js.map +1 -1
- package/dist/development/coreComponents/HasMany.cjs +3 -3
- package/dist/development/coreComponents/HasMany.cjs.map +1 -1
- package/dist/development/coreComponents/HasMany.js +3 -3
- package/dist/development/coreComponents/HasMany.js.map +1 -1
- package/dist/development/coreComponents/HasOne.cjs +3 -3
- package/dist/development/coreComponents/HasOne.cjs.map +1 -1
- package/dist/development/coreComponents/HasOne.js +3 -3
- package/dist/development/coreComponents/HasOne.js.map +1 -1
- package/dist/development/coreComponents/ParentEntity.cjs +1 -1
- package/dist/development/coreComponents/ParentEntity.cjs.map +1 -1
- package/dist/development/coreComponents/ParentEntity.js +1 -1
- package/dist/development/coreComponents/ParentEntity.js.map +1 -1
- package/dist/development/helperComponents/DeferredSubTrees.cjs +4 -4
- package/dist/development/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +4 -4
- package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/helperComponents/FieldView.cjs +3 -3
- package/dist/development/helperComponents/FieldView.cjs.map +1 -1
- package/dist/development/helperComponents/FieldView.js +3 -3
- package/dist/development/helperComponents/FieldView.js.map +1 -1
- package/dist/development/helperComponents/If.cjs +8 -8
- package/dist/development/helperComponents/If.cjs.map +1 -1
- package/dist/development/helperComponents/If.js +8 -8
- package/dist/development/helperComponents/If.js.map +1 -1
- package/dist/development/helperComponents/LabelMiddleware.cjs +1 -1
- package/dist/development/helperComponents/LabelMiddleware.cjs.map +1 -1
- package/dist/development/helperComponents/LabelMiddleware.js +1 -1
- package/dist/development/helperComponents/LabelMiddleware.js.map +1 -1
- package/dist/development/helperComponents/StaticRender.cjs +1 -1
- package/dist/development/helperComponents/StaticRender.cjs.map +1 -1
- package/dist/development/helperComponents/StaticRender.js +1 -1
- package/dist/development/helperComponents/StaticRender.js.map +1 -1
- package/dist/development/helperComponents/SugaredField.cjs +2 -2
- package/dist/development/helperComponents/SugaredField.cjs.map +1 -1
- package/dist/development/helperComponents/SugaredField.js +2 -2
- package/dist/development/helperComponents/SugaredField.js.map +1 -1
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
- package/dist/development/index.cjs +1 -1
- package/dist/production/MarkerTreeGenerator.cjs +2 -2
- package/dist/production/MarkerTreeGenerator.cjs.map +1 -1
- package/dist/production/MarkerTreeGenerator.js +2 -2
- package/dist/production/MarkerTreeGenerator.js.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/production/accessorPropagation/EnvironmentContext.cjs.map +1 -1
- package/dist/production/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/production/accessorPropagation/useExtendTree.cjs.map +1 -1
- package/dist/production/accessorPropagation/useExtendTree.js.map +1 -1
- package/dist/production/accessorSorting/errors.cjs.map +1 -1
- package/dist/production/accessorSorting/errors.js.map +1 -1
- package/dist/production/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/production/accessorTree/useDataBinding.js.map +1 -1
- package/dist/production/coreComponents/Component.cjs.map +1 -1
- package/dist/production/coreComponents/Component.js.map +1 -1
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
- package/dist/production/index.cjs +1 -1
- package/dist/types/accessorPropagation/AccessorProvider.d.ts +1 -1
- package/dist/types/accessorPropagation/AccessorProvider.d.ts.map +1 -1
- package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts +1 -1
- package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts.map +1 -1
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts +1 -1
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts.map +1 -1
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts +2 -2
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts +1 -1
- package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTree.d.ts +1 -1
- package/dist/types/coreComponents/Component.d.ts +3 -3
- package/dist/types/coreComponents/Component.d.ts.map +1 -1
- package/dist/types/coreComponents/MarkerProvider.d.ts +2 -2
- package/dist/types/coreComponents/MarkerProvider.d.ts.map +1 -1
- package/dist/types/helperComponents/EntityView.d.ts +1 -1
- package/dist/types/helperComponents/EntityView.d.ts.map +1 -1
- package/dist/types/helperComponents/LabelMiddleware.d.ts +1 -1
- package/dist/types/helperComponents/LabelMiddleware.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/accessorPropagation/EnvironmentContext.tsx +2 -2
- package/src/coreComponents/Component.tsx +4 -7
- package/src/coreComponents/MarkerProvider.ts +2 -2
|
@@ -11,7 +11,7 @@ const HasMany = Component(
|
|
|
11
11
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasMany.tsx",
|
|
12
12
|
lineNumber: 30,
|
|
13
13
|
columnNumber: 10
|
|
14
|
-
},
|
|
14
|
+
}, void 0);
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
generateEnvironment: (props, oldEnvironment) => {
|
|
@@ -23,13 +23,13 @@ const HasMany = Component(
|
|
|
23
23
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasMany.tsx",
|
|
24
24
|
lineNumber: 39,
|
|
25
25
|
columnNumber: 5
|
|
26
|
-
},
|
|
26
|
+
}, void 0),
|
|
27
27
|
props.children
|
|
28
28
|
] }, void 0, true, {
|
|
29
29
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasMany.tsx",
|
|
30
30
|
lineNumber: 38,
|
|
31
31
|
columnNumber: 4
|
|
32
|
-
},
|
|
32
|
+
}, void 0),
|
|
33
33
|
generateBranchMarker: (props, fields, environment) => MarkerFactory.createRelativeEntityListFields(props, environment, fields)
|
|
34
34
|
},
|
|
35
35
|
"HasMany"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasMany.js","sources":["../../../src/coreComponents/HasMany.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntityList } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '@contember/binding'\nimport { Environment } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '@contember/binding'\n\nexport type HasManyProps<ListProps = never, EntityProps = never> = SugaredRelativeEntityList & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n} & (\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * @group Data binding\n */\nexport const HasMany = Component(\n\t<ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => {\n\t\tconst entityList = useEntityList(props)\n\n\t\treturn <EntityList {...props} accessor={entityList} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityList(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeEntityListFields(props, environment, fields),\n\t},\n\t'HasMany',\n) as <ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;AAyBO,MAAM,UAAU;AAAA,EACtB,CAAyB,UAAgD;AAClE,UAAA,aAAa,cAAc,KAAK;AAEtC,WAAQ,uBAAA,YAAA,EAAY,GAAG,OAAO,UAAU,WAAjC,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAA6C,GAAAA,
|
|
1
|
+
{"version":3,"file":"HasMany.js","sources":["../../../src/coreComponents/HasMany.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntityList } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '@contember/binding'\nimport { Environment } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '@contember/binding'\n\nexport type HasManyProps<ListProps = never, EntityProps = never> = SugaredRelativeEntityList & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n} & (\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * @group Data binding\n */\nexport const HasMany = Component(\n\t<ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => {\n\t\tconst entityList = useEntityList(props)\n\n\t\treturn <EntityList {...props} accessor={entityList} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityList(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeEntityListFields(props, environment, fields),\n\t},\n\t'HasMany',\n) as <ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;AAyBO,MAAM,UAAU;AAAA,EACtB,CAAyB,UAAgD;AAClE,UAAA,aAAa,cAAc,KAAK;AAEtC,WAAQ,uBAAA,YAAA,EAAY,GAAG,OAAO,UAAU,WAAjC,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAA6C,GAAAA,MAAA;AAAA,EACrD;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,+BAA+B,aAAa,KAAK;AAAA,IACpF;AAAA,IACA,cAAc,CACb,UAAA,uBAAC,cAAY,GAAG,OAAO,UAAU,QAChC,UAAA;AAAA,MAAC,uBAAA,OAAA,EAAM,OAAO,iBAAd,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAgC,GAAAA,MAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,MAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,+BAA+B,OAAO,aAAa,MAAM;AAAA,EACzE;AAAA,EACA;AACD;"}
|
|
@@ -13,7 +13,7 @@ const HasOne = Component.Component(
|
|
|
13
13
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasOne.tsx",
|
|
14
14
|
lineNumber: 24,
|
|
15
15
|
columnNumber: 10
|
|
16
|
-
},
|
|
16
|
+
}, void 0);
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
generateEnvironment: (props, oldEnvironment) => {
|
|
@@ -25,13 +25,13 @@ const HasOne = Component.Component(
|
|
|
25
25
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasOne.tsx",
|
|
26
26
|
lineNumber: 33,
|
|
27
27
|
columnNumber: 5
|
|
28
|
-
},
|
|
28
|
+
}, void 0),
|
|
29
29
|
props.children
|
|
30
30
|
] }, void 0, true, {
|
|
31
31
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasOne.tsx",
|
|
32
32
|
lineNumber: 32,
|
|
33
33
|
columnNumber: 4
|
|
34
|
-
},
|
|
34
|
+
}, void 0),
|
|
35
35
|
generateBranchMarker: (props, fields, environment) => binding.MarkerFactory.createRelativeSingleEntityFields(props, environment, fields)
|
|
36
36
|
},
|
|
37
37
|
"HasOne"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasOne.cjs","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '@contember/binding'\nimport { Environment } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '@contember/binding'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\n/**\n * @group Data binding\n */\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":["Component","useEntity","jsxDEV","Entity","this","TreeNodeEnvironmentFactory","Field","PRIMARY_KEY_NAME","MarkerFactory"],"mappings":";;;;;;;;AAmBO,MAAM,SAASA,UAAA;AAAA,EACrB,CAAyB,UAAoC;AACtD,UAAA,SAASC,oBAAU,KAAK;AAE9B,WAAQC,8BAAA,OAAAC,eAAA,EAAQ,GAAG,OAAO,UAAU,OAA7B,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAqC,GAAAC,
|
|
1
|
+
{"version":3,"file":"HasOne.cjs","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '@contember/binding'\nimport { Environment } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '@contember/binding'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\n/**\n * @group Data binding\n */\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":["Component","useEntity","jsxDEV","Entity","this","TreeNodeEnvironmentFactory","Field","PRIMARY_KEY_NAME","MarkerFactory"],"mappings":";;;;;;;;AAmBO,MAAM,SAASA,UAAA;AAAA,EACrB,CAAyB,UAAoC;AACtD,UAAA,SAASC,oBAAU,KAAK;AAE9B,WAAQC,8BAAA,OAAAC,eAAA,EAAQ,GAAG,OAAO,UAAU,OAA7B,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAqC,GAAAC,MAAA;AAAA,EAC7C;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAAC,mCAA2B,2BAA2B,aAAa,KAAK;AAAA,IAChF;AAAA,IACA,cAAc,CACb,UAAAH,8BAAAA,OAACC,iBAAQ,GAAG,OAAO,UAAU,QAC5B,UAAA;AAAA,MAACD,8BAAA,OAAAI,MAAA,OAAA,EAAM,OAAOC,QAAd,iBAAA,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAgC,GAAAH,MAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,MAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrCI,QAAc,cAAA,iCAAiC,OAAO,aAAa,MAAM;AAAA,EAC3E;AAAA,EACA;AACD;;"}
|
|
@@ -11,7 +11,7 @@ const HasOne = Component(
|
|
|
11
11
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasOne.tsx",
|
|
12
12
|
lineNumber: 24,
|
|
13
13
|
columnNumber: 10
|
|
14
|
-
},
|
|
14
|
+
}, void 0);
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
generateEnvironment: (props, oldEnvironment) => {
|
|
@@ -23,13 +23,13 @@ const HasOne = Component(
|
|
|
23
23
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasOne.tsx",
|
|
24
24
|
lineNumber: 33,
|
|
25
25
|
columnNumber: 5
|
|
26
|
-
},
|
|
26
|
+
}, void 0),
|
|
27
27
|
props.children
|
|
28
28
|
] }, void 0, true, {
|
|
29
29
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/HasOne.tsx",
|
|
30
30
|
lineNumber: 32,
|
|
31
31
|
columnNumber: 4
|
|
32
|
-
},
|
|
32
|
+
}, void 0),
|
|
33
33
|
generateBranchMarker: (props, fields, environment) => MarkerFactory.createRelativeSingleEntityFields(props, environment, fields)
|
|
34
34
|
},
|
|
35
35
|
"HasOne"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HasOne.js","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '@contember/binding'\nimport { Environment } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '@contember/binding'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\n/**\n * @group Data binding\n */\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;AAmBO,MAAM,SAAS;AAAA,EACrB,CAAyB,UAAoC;AACtD,UAAA,SAAS,UAAU,KAAK;AAE9B,WAAQ,uBAAA,QAAA,EAAQ,GAAG,OAAO,UAAU,OAA7B,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAqC,GAAAA,
|
|
1
|
+
{"version":3,"file":"HasOne.js","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '@contember/binding'\nimport { Environment } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '@contember/binding'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\n/**\n * @group Data binding\n */\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;AAmBO,MAAM,SAAS;AAAA,EACrB,CAAyB,UAAoC;AACtD,UAAA,SAAS,UAAU,KAAK;AAE9B,WAAQ,uBAAA,QAAA,EAAQ,GAAG,OAAO,UAAU,OAA7B,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAqC,GAAAA,MAAA;AAAA,EAC7C;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,2BAA2B,aAAa,KAAK;AAAA,IAChF;AAAA,IACA,cAAc,CACb,UAAA,uBAAC,UAAQ,GAAG,OAAO,UAAU,QAC5B,UAAA;AAAA,MAAC,uBAAA,OAAA,EAAM,OAAO,iBAAd,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAgC,GAAAA,MAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,MAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,iCAAiC,OAAO,aAAa,MAAM;AAAA,EAC3E;AAAA,EACA;AACD;"}
|
|
@@ -8,7 +8,7 @@ const ParentEntity = Component.Component(
|
|
|
8
8
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/ParentEntity.tsx",
|
|
9
9
|
lineNumber: 14,
|
|
10
10
|
columnNumber: 11
|
|
11
|
-
},
|
|
11
|
+
}, void 0),
|
|
12
12
|
{
|
|
13
13
|
generateBranchMarker: (props, fields, environment) => binding.MarkerFactory.createParentEntityMarker(props, fields, environment)
|
|
14
14
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParentEntity.cjs","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredParentEntityParameters } from '@contember/binding'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":["Component","jsxDEV","Fragment","this","MarkerFactory"],"mappings":";;;;;AAYO,MAAM,eAAeA,UAAA;AAAA,EAC3B,CAAA,UAAYC,qCAAAC,cAAAA,UAAA,EAAA,UAAA,MAAM,SAAT,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAkB,GAAAC,
|
|
1
|
+
{"version":3,"file":"ParentEntity.cjs","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredParentEntityParameters } from '@contember/binding'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":["Component","jsxDEV","Fragment","this","MarkerFactory"],"mappings":";;;;;AAYO,MAAM,eAAeA,UAAA;AAAA,EAC3B,CAAA,UAAYC,qCAAAC,cAAAA,UAAA,EAAA,UAAA,MAAM,SAAT,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAkB,GAAAC,MAAA;AAAA,EAC3B;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBACrCC,QAAc,cAAA,yBAAyB,OAAO,QAAQ,WAAW;AAAA,EACnE;AAAA,EACA;AACD;;"}
|
|
@@ -6,7 +6,7 @@ const ParentEntity = Component(
|
|
|
6
6
|
fileName: "/__w/interface/interface/packages/react-binding/src/coreComponents/ParentEntity.tsx",
|
|
7
7
|
lineNumber: 14,
|
|
8
8
|
columnNumber: 11
|
|
9
|
-
},
|
|
9
|
+
}, void 0),
|
|
10
10
|
{
|
|
11
11
|
generateBranchMarker: (props, fields, environment) => MarkerFactory.createParentEntityMarker(props, fields, environment)
|
|
12
12
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParentEntity.js","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredParentEntityParameters } from '@contember/binding'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":["this"],"mappings":";;;AAYO,MAAM,eAAe;AAAA,EAC3B,CAAA,UAAY,uBAAA,UAAA,EAAA,UAAA,MAAM,SAAT,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAkB,GAAAA,
|
|
1
|
+
{"version":3,"file":"ParentEntity.js","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '@contember/binding'\nimport type { SugaredParentEntityParameters } from '@contember/binding'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":["this"],"mappings":";;;AAYO,MAAM,eAAe;AAAA,EAC3B,CAAA,UAAY,uBAAA,UAAA,EAAA,UAAA,MAAM,SAAT,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAkB,GAAAA,MAAA;AAAA,EAC3B;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,yBAAyB,OAAO,QAAQ,WAAW;AAAA,EACnE;AAAA,EACA;AACD;"}
|
|
@@ -45,7 +45,7 @@ const DeferredSubTrees = Component.Component(
|
|
|
45
45
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
46
46
|
lineNumber: 66,
|
|
47
47
|
columnNumber: 24
|
|
48
|
-
},
|
|
48
|
+
}, void 0);
|
|
49
49
|
extendTree(newFragment, { signal, environment }).then((treeRootId) => !signal.aborted && setLoadState({ name: "success", treeRootId })).catch((error) => {
|
|
50
50
|
if (signal.aborted) {
|
|
51
51
|
return;
|
|
@@ -60,13 +60,13 @@ const DeferredSubTrees = Component.Component(
|
|
|
60
60
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
61
61
|
lineNumber: 81,
|
|
62
62
|
columnNumber: 12
|
|
63
|
-
},
|
|
63
|
+
}, void 0);
|
|
64
64
|
case "success":
|
|
65
65
|
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(TreeRootIdProvider.TreeRootIdProvider, { treeRootId: loadState.treeRootId, children: props.children }, void 0, false, {
|
|
66
66
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
67
67
|
lineNumber: 87,
|
|
68
68
|
columnNumber: 12
|
|
69
|
-
},
|
|
69
|
+
}, void 0);
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
{
|
|
@@ -77,7 +77,7 @@ const DeferredSubTrees = Component.Component(
|
|
|
77
77
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
78
78
|
lineNumber: 92,
|
|
79
79
|
columnNumber: 4
|
|
80
|
-
},
|
|
80
|
+
}, void 0),
|
|
81
81
|
generateBranchMarker: (props, fields, environment) => {
|
|
82
82
|
const fieldsWithHoistablesMarker = binding.MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment);
|
|
83
83
|
fieldsWithHoistablesMarker.subTrees?.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeferredSubTrees.cjs","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { TreeRootId } from '@contember/binding'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { EntityAccessor } from '@contember/binding'\nimport { useMutationState } from '../accessorTree'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\n/**\n * @group Data binding\n */\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tconst hasEntity = useHasEntity()\n\t\tuseConstantValueInvariant(hasEntity)\n\t\tif (hasEntity) {\n\t\t\tuseEntityBeforePersist(\n\t\t\t\tuseCallback((getAccessor: EntityAccessor.GetEntityAccessor) => {\n\t\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t\t// components don't error.\n\t\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t\t}, []),\n\t\t\t)\n\t\t}\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tconst environment = useEnvironment()\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal, environment })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [environment, extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":["Component","useBindingOperations","useMutationState","useState","useHasEntity","useConstantValueInvariant","useEntityBeforePersist","useCallback","useEffect","useEnvironment","jsxDEV","this","Fragment","TreeRootIdProvider","MarkerFactory","EntityFieldMarkersContainer","EntityFieldsWithHoistablesMarker"],"mappings":";;;;;;;;;;;;;AA2BO,MAAM,mBAAmBA,UAAA;AAAA,EAC/B,CAAS,UAAA;AACF,UAAA,EAAE,eAAeC,qBAAAA;AACvB,UAAM,aAAaC,iBAAAA;AAEb,UAAA,CAAC,WAAW,YAAY,IAAIC,eAAoB,EAAE,MAAM,WAAW;AAEzE,UAAM,CAAC,eAAe,IAAIA,MAAAA,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,UAAM,SAAS,gBAAgB;AAE/B,UAAM,YAAYC,aAAAA;AAClBC,eAAA,0BAA0B,SAAS;AACnC,QAAI,WAAW;AACdC,6BAAA;AAAA,QACCC,MAAA,YAAY,CAAC,gBAAkD;AAG1D,cAAA,cAAc,gBAAgB;AACjC;AAAA,UACD;AACa,uBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,QACjC,GAAG,EAAE;AAAA,MAAA;AAAA,IAEP;AAEAC,UAAAA,UAAU,MAAM;AACf,aAAO,MAAM;AACZ,wBAAgB,MAAM;AAAA,MAAA;AAAA,IACvB,GACE,CAAC,eAAe,CAAC;AAEpB,UAAM,cAAcC,eAAAA;AACpBD,UAAAA,UAAU,MAAM;AACf,UAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,MACD;AACa,mBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,YAAM,cAAcE,qCAAC,kBAAkB,EAAA,UAAA,MAAM,SAAzB,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAkC,GAAAC,
|
|
1
|
+
{"version":3,"file":"DeferredSubTrees.cjs","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { TreeRootId } from '@contember/binding'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { EntityAccessor } from '@contember/binding'\nimport { useMutationState } from '../accessorTree'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\n/**\n * @group Data binding\n */\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tconst hasEntity = useHasEntity()\n\t\tuseConstantValueInvariant(hasEntity)\n\t\tif (hasEntity) {\n\t\t\tuseEntityBeforePersist(\n\t\t\t\tuseCallback((getAccessor: EntityAccessor.GetEntityAccessor) => {\n\t\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t\t// components don't error.\n\t\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t\t}, []),\n\t\t\t)\n\t\t}\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tconst environment = useEnvironment()\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal, environment })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [environment, extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":["Component","useBindingOperations","useMutationState","useState","useHasEntity","useConstantValueInvariant","useEntityBeforePersist","useCallback","useEffect","useEnvironment","jsxDEV","this","Fragment","TreeRootIdProvider","MarkerFactory","EntityFieldMarkersContainer","EntityFieldsWithHoistablesMarker"],"mappings":";;;;;;;;;;;;;AA2BO,MAAM,mBAAmBA,UAAA;AAAA,EAC/B,CAAS,UAAA;AACF,UAAA,EAAE,eAAeC,qBAAAA;AACvB,UAAM,aAAaC,iBAAAA;AAEb,UAAA,CAAC,WAAW,YAAY,IAAIC,eAAoB,EAAE,MAAM,WAAW;AAEzE,UAAM,CAAC,eAAe,IAAIA,MAAAA,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,UAAM,SAAS,gBAAgB;AAE/B,UAAM,YAAYC,aAAAA;AAClBC,eAAA,0BAA0B,SAAS;AACnC,QAAI,WAAW;AACdC,6BAAA;AAAA,QACCC,MAAA,YAAY,CAAC,gBAAkD;AAG1D,cAAA,cAAc,gBAAgB;AACjC;AAAA,UACD;AACa,uBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,QACjC,GAAG,EAAE;AAAA,MAAA;AAAA,IAEP;AAEAC,UAAAA,UAAU,MAAM;AACf,aAAO,MAAM;AACZ,wBAAgB,MAAM;AAAA,MAAA;AAAA,IACvB,GACE,CAAC,eAAe,CAAC;AAEpB,UAAM,cAAcC,eAAAA;AACpBD,UAAAA,UAAU,MAAM;AACf,UAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,MACD;AACa,mBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,YAAM,cAAcE,qCAAC,kBAAkB,EAAA,UAAA,MAAM,SAAzB,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAkC,GAAAC,MAAA;AAE3C,iBAAA,aAAa,EAAE,QAAQ,YAAa,CAAA,EAC7C,KAAK,gBAAc,CAAC,OAAO,WAAW,aAAa,EAAE,MAAM,WAAW,WAAA,CAAY,CAAC,EACnF,MAAM,CAAS,UAAA;AACf,YAAI,OAAO,SAAS;AACnB;AAAA,QACD;AACM,cAAA;AAAA,MAAA,CACN;AAAA,IAAA,GACA,CAAC,aAAa,YAAY,YAAY,UAAU,MAAM,MAAM,UAAU,MAAM,CAAC;AAEhF,YAAQ,UAAU,MAAM;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AACG,eAAAD,8BAAA,OAAAE,cAAA,UAAA,EAAG,gBAAM,SAAT,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAkB,GAAAD,MAAA;AAAA,MAC1B,KAAK;AAKJ,oDAAQE,mBAAAA,oBAAmB,EAAA,YAAY,UAAU,YAAa,gBAAM,SAA7D,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAsE,GAAAF,MAAA;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AAAA,IACC,cAAc,WAEXD,8BAAA,OAAAE,cAAA,UAAA,EAAA,UAAA;AAAA,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAD,MAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACrD,YAAM,6BAA6BG,QAAA,cAAc,uCAAuC,QAAQ,WAAW;AAM3G,iCAA2B,UAAU;AAE9B,aAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA;AACD;AAEA,MAAM,mBAAmBd,UAAA;AAAA,EACxB,MAAM;AAAA,EACN;AAAA,IACC,sBAAsB,CAAC,OAAO,WAAW;AAElC,YAAA,cAAcc,QAAc,cAAA,kCAAkC,MAAS;AAE7E,UAAI,kBAAkBC,QAAAA,6BAA6B;AAC3C,eAAA;AAAA,MACR;AACA,aAAO,IAAIC,QAAA,iCAAiC,aAAa,OAAO,UAAU,MAAS;AAAA,IACpF;AAAA,EACD;AAAA,EACA;AACD;;"}
|
|
@@ -43,7 +43,7 @@ const DeferredSubTrees = Component(
|
|
|
43
43
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
44
44
|
lineNumber: 66,
|
|
45
45
|
columnNumber: 24
|
|
46
|
-
},
|
|
46
|
+
}, void 0);
|
|
47
47
|
extendTree(newFragment, { signal, environment }).then((treeRootId) => !signal.aborted && setLoadState({ name: "success", treeRootId })).catch((error) => {
|
|
48
48
|
if (signal.aborted) {
|
|
49
49
|
return;
|
|
@@ -58,13 +58,13 @@ const DeferredSubTrees = Component(
|
|
|
58
58
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
59
59
|
lineNumber: 81,
|
|
60
60
|
columnNumber: 12
|
|
61
|
-
},
|
|
61
|
+
}, void 0);
|
|
62
62
|
case "success":
|
|
63
63
|
return /* @__PURE__ */ jsxDEV(TreeRootIdProvider, { treeRootId: loadState.treeRootId, children: props.children }, void 0, false, {
|
|
64
64
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
65
65
|
lineNumber: 87,
|
|
66
66
|
columnNumber: 12
|
|
67
|
-
},
|
|
67
|
+
}, void 0);
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
{
|
|
@@ -75,7 +75,7 @@ const DeferredSubTrees = Component(
|
|
|
75
75
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/DeferredSubTrees.tsx",
|
|
76
76
|
lineNumber: 92,
|
|
77
77
|
columnNumber: 4
|
|
78
|
-
},
|
|
78
|
+
}, void 0),
|
|
79
79
|
generateBranchMarker: (props, fields, environment) => {
|
|
80
80
|
const fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment);
|
|
81
81
|
fieldsWithHoistablesMarker.subTrees?.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeferredSubTrees.js","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { TreeRootId } from '@contember/binding'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { EntityAccessor } from '@contember/binding'\nimport { useMutationState } from '../accessorTree'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\n/**\n * @group Data binding\n */\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tconst hasEntity = useHasEntity()\n\t\tuseConstantValueInvariant(hasEntity)\n\t\tif (hasEntity) {\n\t\t\tuseEntityBeforePersist(\n\t\t\t\tuseCallback((getAccessor: EntityAccessor.GetEntityAccessor) => {\n\t\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t\t// components don't error.\n\t\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t\t}, []),\n\t\t\t)\n\t\t}\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tconst environment = useEnvironment()\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal, environment })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [environment, extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":["this"],"mappings":";;;;;;;;;;;AA2BO,MAAM,mBAAmB;AAAA,EAC/B,CAAS,UAAA;AACF,UAAA,EAAE,eAAe;AACvB,UAAM,aAAa;AAEb,UAAA,CAAC,WAAW,YAAY,IAAI,SAAoB,EAAE,MAAM,WAAW;AAEzE,UAAM,CAAC,eAAe,IAAI,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,UAAM,SAAS,gBAAgB;AAE/B,UAAM,YAAY;AAClB,8BAA0B,SAAS;AACnC,QAAI,WAAW;AACd;AAAA,QACC,YAAY,CAAC,gBAAkD;AAG1D,cAAA,cAAc,gBAAgB;AACjC;AAAA,UACD;AACa,uBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,QACjC,GAAG,EAAE;AAAA,MAAA;AAAA,IAEP;AAEA,cAAU,MAAM;AACf,aAAO,MAAM;AACZ,wBAAgB,MAAM;AAAA,MAAA;AAAA,IACvB,GACE,CAAC,eAAe,CAAC;AAEpB,UAAM,cAAc;AACpB,cAAU,MAAM;AACf,UAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,MACD;AACa,mBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,YAAM,cAAc,uBAAC,kBAAkB,EAAA,UAAA,MAAM,SAAzB,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAkC,GAAAA,
|
|
1
|
+
{"version":3,"file":"DeferredSubTrees.js","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '@contember/binding'\nimport { MarkerFactory } from '@contember/binding'\nimport type { TreeRootId } from '@contember/binding'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { EntityAccessor } from '@contember/binding'\nimport { useMutationState } from '../accessorTree'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\n/**\n * @group Data binding\n */\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tconst hasEntity = useHasEntity()\n\t\tuseConstantValueInvariant(hasEntity)\n\t\tif (hasEntity) {\n\t\t\tuseEntityBeforePersist(\n\t\t\t\tuseCallback((getAccessor: EntityAccessor.GetEntityAccessor) => {\n\t\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t\t// components don't error.\n\t\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t\t}, []),\n\t\t\t)\n\t\t}\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tconst environment = useEnvironment()\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal, environment })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [environment, extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":["this"],"mappings":";;;;;;;;;;;AA2BO,MAAM,mBAAmB;AAAA,EAC/B,CAAS,UAAA;AACF,UAAA,EAAE,eAAe;AACvB,UAAM,aAAa;AAEb,UAAA,CAAC,WAAW,YAAY,IAAI,SAAoB,EAAE,MAAM,WAAW;AAEzE,UAAM,CAAC,eAAe,IAAI,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,UAAM,SAAS,gBAAgB;AAE/B,UAAM,YAAY;AAClB,8BAA0B,SAAS;AACnC,QAAI,WAAW;AACd;AAAA,QACC,YAAY,CAAC,gBAAkD;AAG1D,cAAA,cAAc,gBAAgB;AACjC;AAAA,UACD;AACa,uBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,QACjC,GAAG,EAAE;AAAA,MAAA;AAAA,IAEP;AAEA,cAAU,MAAM;AACf,aAAO,MAAM;AACZ,wBAAgB,MAAM;AAAA,MAAA;AAAA,IACvB,GACE,CAAC,eAAe,CAAC;AAEpB,UAAM,cAAc;AACpB,cAAU,MAAM;AACf,UAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,MACD;AACa,mBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,YAAM,cAAc,uBAAC,kBAAkB,EAAA,UAAA,MAAM,SAAzB,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAkC,GAAAA,MAAA;AAE3C,iBAAA,aAAa,EAAE,QAAQ,YAAa,CAAA,EAC7C,KAAK,gBAAc,CAAC,OAAO,WAAW,aAAa,EAAE,MAAM,WAAW,WAAA,CAAY,CAAC,EACnF,MAAM,CAAS,UAAA;AACf,YAAI,OAAO,SAAS;AACnB;AAAA,QACD;AACM,cAAA;AAAA,MAAA,CACN;AAAA,IAAA,GACA,CAAC,aAAa,YAAY,YAAY,UAAU,MAAM,MAAM,UAAU,MAAM,CAAC;AAEhF,YAAQ,UAAU,MAAM;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AACG,eAAA,uBAAA,UAAA,EAAG,gBAAM,SAAT,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAkB,GAAAA,MAAA;AAAA,MAC1B,KAAK;AAKJ,sCAAQ,oBAAmB,EAAA,YAAY,UAAU,YAAa,gBAAM,SAA7D,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAsE,GAAAA,MAAA;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AAAA,IACC,cAAc,WAEX,uBAAA,UAAA,EAAA,UAAA;AAAA,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,MAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACrD,YAAM,6BAA6B,cAAc,uCAAuC,QAAQ,WAAW;AAM3G,iCAA2B,UAAU;AAE9B,aAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA;AACD;AAEA,MAAM,mBAAmB;AAAA,EACxB,MAAM;AAAA,EACN;AAAA,IACC,sBAAsB,CAAC,OAAO,WAAW;AAElC,YAAA,cAAc,cAAc,kCAAkC,MAAS;AAE7E,UAAI,kBAAkB,6BAA6B;AAC3C,eAAA;AAAA,MACR;AACA,aAAO,IAAI,iCAAiC,aAAa,OAAO,UAAU,MAAS;AAAA,IACpF;AAAA,EACD;AAAA,EACA;AACD;"}
|
|
@@ -37,7 +37,7 @@ const FieldView = Component.Component(
|
|
|
37
37
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/FieldView.tsx",
|
|
38
38
|
lineNumber: 79,
|
|
39
39
|
columnNumber: 10
|
|
40
|
-
},
|
|
40
|
+
}, void 0);
|
|
41
41
|
},
|
|
42
42
|
(props) => {
|
|
43
43
|
const fields = "fields" in props && Array.isArray(props.fields) ? props.fields : "field" in props && props.field ? [props.field] : binding.throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`);
|
|
@@ -47,12 +47,12 @@ const FieldView = Component.Component(
|
|
|
47
47
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/FieldView.tsx",
|
|
48
48
|
lineNumber: 92,
|
|
49
49
|
columnNumber: 6
|
|
50
|
-
},
|
|
50
|
+
}, void 0))
|
|
51
51
|
] }, void 0, true, {
|
|
52
52
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/FieldView.tsx",
|
|
53
53
|
lineNumber: 89,
|
|
54
54
|
columnNumber: 4
|
|
55
|
-
},
|
|
55
|
+
}, void 0);
|
|
56
56
|
},
|
|
57
57
|
"FieldView"
|
|
58
58
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldView.cjs","sources":["../../../src/helperComponents/FieldView.tsx"],"sourcesContent":["import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { FieldAccessor, FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { QueryLanguage, throwBindingError } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { SugaredField } from './SugaredField'\n\nexport interface FieldViewCommonProps {\n\tfallbackIfUnpersisted?: ReactNode\n}\n\nexport type FieldViewProps =\n\t& FieldViewCommonProps\n\t& (\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfield: string | SugaredRelativeSingleField\n\t\t }\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfields: Array<string | SugaredRelativeSingleField>\n\t\t }\n\t)\n\n/**\n * Base field view component with no default formatting.\n *\n * @example\n * ```\n * <FieldView\n * field=\"startsAt\"\n * render={(accessor) => <>{accessor.value}</>}\n * />\n * ```\n *\n * @group Field Views\n */\nexport const FieldView = Component<FieldViewProps>(\n\tprops => {\n\t\tconst { fallbackIfUnpersisted, render } = props\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\n\t\tuseConstantLengthInvariant(\n\t\t\tfields,\n\t\t\t`The number of fields in the 'fields' prop of the 'FieldView' must remain constant between renders!`,\n\t\t)\n\n\t\t// TODO over-subscribe less\n\t\tconst entityAccessor = useEntity()\n\t\tconst environment = entityAccessor.environment\n\n\t\tconst desugarField = useCallback(\n\t\t\t(rsf: string | SugaredRelativeSingleField) => QueryLanguage.desugarRelativeSingleField(rsf, environment),\n\t\t\t[environment],\n\t\t)\n\t\tconst desugaredFields = useArrayMapMemo(fields, desugarField)\n\n\t\tconst retrieveField = useCallback(\n\t\t\t(desugaredRsf: RelativeSingleField) => entityAccessor.getRelativeSingleField(desugaredRsf),\n\t\t\t[entityAccessor],\n\t\t)\n\t\tconst accessors = useArrayMapMemo(desugaredFields, retrieveField)\n\n\t\t// TODO we probably want something like useDeferredValue from here.\n\t\t// Will probably just wait for Concurrent React though.\n\t\tconst output = useMemo(() => {\n\t\t\tif (!entityAccessor.existsOnServer && fallbackIfUnpersisted !== undefined) {\n\t\t\t\treturn fallbackIfUnpersisted\n\t\t\t}\n\t\t\treturn render(...accessors)\n\t\t}, [accessors, entityAccessor.existsOnServer, fallbackIfUnpersisted, render])\n\n\t\treturn <>{output}</>\n\t},\n\tprops => {\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{props.fallbackIfUnpersisted}\n\t\t\t\t{fields.map((field, i) => (\n\t\t\t\t\t<SugaredField key={i} field={field} />\n\t\t\t\t))}\n\t\t\t</>\n\t\t)\n\t},\n\t'FieldView',\n) as FieldViewComponentSignature\n\nexport type FieldViewComponentSignature = {\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfield: string | SugaredRelativeSingleField;\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue, FV5 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>, field5: FieldAccessor<FV5>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t(props: FieldViewProps): ReactElement | null\n}\n"],"names":["Component","throwBindingError","useConstantLengthInvariant","useEntity","useCallback","QueryLanguage","useArrayMapMemo","useMemo","this","jsxDEV","Fragment","SugaredField"],"mappings":";;;;;;;;;AAsCO,MAAM,YAAYA,UAAA;AAAA,EACxB,CAAS,UAAA;AACF,UAAA,EAAE,uBAAuB,OAAW,IAAA;AAC1C,UAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZC,0BAAkB,sEAAsE;AAE5FC,eAAA;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAID,UAAM,iBAAiBC,UAAAA;AACvB,UAAM,cAAc,eAAe;AAEnC,UAAM,eAAeC,MAAA;AAAA,MACpB,CAAC,QAA6CC,QAAc,cAAA,2BAA2B,KAAK,WAAW;AAAA,MACvG,CAAC,WAAW;AAAA,IAAA;AAEP,UAAA,kBAAkBC,WAAAA,gBAAgB,QAAQ,YAAY;AAE5D,UAAM,gBAAgBF,MAAA;AAAA,MACrB,CAAC,iBAAsC,eAAe,uBAAuB,YAAY;AAAA,MACzF,CAAC,cAAc;AAAA,IAAA;AAEV,UAAA,YAAYE,WAAAA,gBAAgB,iBAAiB,aAAa;AAI1D,UAAA,SAASC,MAAAA,QAAQ,MAAM;AAC5B,UAAI,CAAC,eAAe,kBAAkB,0BAA0B,QAAW;AACnE,eAAA;AAAA,MACR;AACO,aAAA,OAAO,GAAG,SAAS;AAAA,IAAA,GACxB,CAAC,WAAW,eAAe,gBAAgB,uBAAuB,MAAM,CAAC;AAE5E,0EAAU,UAAH,UAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAU,GAAAC,
|
|
1
|
+
{"version":3,"file":"FieldView.cjs","sources":["../../../src/helperComponents/FieldView.tsx"],"sourcesContent":["import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { FieldAccessor, FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { QueryLanguage, throwBindingError } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { SugaredField } from './SugaredField'\n\nexport interface FieldViewCommonProps {\n\tfallbackIfUnpersisted?: ReactNode\n}\n\nexport type FieldViewProps =\n\t& FieldViewCommonProps\n\t& (\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfield: string | SugaredRelativeSingleField\n\t\t }\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfields: Array<string | SugaredRelativeSingleField>\n\t\t }\n\t)\n\n/**\n * Base field view component with no default formatting.\n *\n * @example\n * ```\n * <FieldView\n * field=\"startsAt\"\n * render={(accessor) => <>{accessor.value}</>}\n * />\n * ```\n *\n * @group Field Views\n */\nexport const FieldView = Component<FieldViewProps>(\n\tprops => {\n\t\tconst { fallbackIfUnpersisted, render } = props\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\n\t\tuseConstantLengthInvariant(\n\t\t\tfields,\n\t\t\t`The number of fields in the 'fields' prop of the 'FieldView' must remain constant between renders!`,\n\t\t)\n\n\t\t// TODO over-subscribe less\n\t\tconst entityAccessor = useEntity()\n\t\tconst environment = entityAccessor.environment\n\n\t\tconst desugarField = useCallback(\n\t\t\t(rsf: string | SugaredRelativeSingleField) => QueryLanguage.desugarRelativeSingleField(rsf, environment),\n\t\t\t[environment],\n\t\t)\n\t\tconst desugaredFields = useArrayMapMemo(fields, desugarField)\n\n\t\tconst retrieveField = useCallback(\n\t\t\t(desugaredRsf: RelativeSingleField) => entityAccessor.getRelativeSingleField(desugaredRsf),\n\t\t\t[entityAccessor],\n\t\t)\n\t\tconst accessors = useArrayMapMemo(desugaredFields, retrieveField)\n\n\t\t// TODO we probably want something like useDeferredValue from here.\n\t\t// Will probably just wait for Concurrent React though.\n\t\tconst output = useMemo(() => {\n\t\t\tif (!entityAccessor.existsOnServer && fallbackIfUnpersisted !== undefined) {\n\t\t\t\treturn fallbackIfUnpersisted\n\t\t\t}\n\t\t\treturn render(...accessors)\n\t\t}, [accessors, entityAccessor.existsOnServer, fallbackIfUnpersisted, render])\n\n\t\treturn <>{output}</>\n\t},\n\tprops => {\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{props.fallbackIfUnpersisted}\n\t\t\t\t{fields.map((field, i) => (\n\t\t\t\t\t<SugaredField key={i} field={field} />\n\t\t\t\t))}\n\t\t\t</>\n\t\t)\n\t},\n\t'FieldView',\n) as FieldViewComponentSignature\n\nexport type FieldViewComponentSignature = {\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfield: string | SugaredRelativeSingleField;\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue, FV5 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>, field5: FieldAccessor<FV5>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t(props: FieldViewProps): ReactElement | null\n}\n"],"names":["Component","throwBindingError","useConstantLengthInvariant","useEntity","useCallback","QueryLanguage","useArrayMapMemo","useMemo","this","jsxDEV","Fragment","SugaredField"],"mappings":";;;;;;;;;AAsCO,MAAM,YAAYA,UAAA;AAAA,EACxB,CAAS,UAAA;AACF,UAAA,EAAE,uBAAuB,OAAW,IAAA;AAC1C,UAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZC,0BAAkB,sEAAsE;AAE5FC,eAAA;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAID,UAAM,iBAAiBC,UAAAA;AACvB,UAAM,cAAc,eAAe;AAEnC,UAAM,eAAeC,MAAA;AAAA,MACpB,CAAC,QAA6CC,QAAc,cAAA,2BAA2B,KAAK,WAAW;AAAA,MACvG,CAAC,WAAW;AAAA,IAAA;AAEP,UAAA,kBAAkBC,WAAAA,gBAAgB,QAAQ,YAAY;AAE5D,UAAM,gBAAgBF,MAAA;AAAA,MACrB,CAAC,iBAAsC,eAAe,uBAAuB,YAAY;AAAA,MACzF,CAAC,cAAc;AAAA,IAAA;AAEV,UAAA,YAAYE,WAAAA,gBAAgB,iBAAiB,aAAa;AAI1D,UAAA,SAASC,MAAAA,QAAQ,MAAM;AAC5B,UAAI,CAAC,eAAe,kBAAkB,0BAA0B,QAAW;AACnE,eAAA;AAAA,MACR;AACO,aAAA,OAAO,GAAG,SAAS;AAAA,IAAA,GACxB,CAAC,WAAW,eAAe,gBAAgB,uBAAuB,MAAM,CAAC;AAE5E,0EAAU,UAAH,UAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAU,GAAAC,MAAA;AAAA,EAClB;AAAA,EACA,CAAS,UAAA;AACR,UAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZP,0BAAkB,sEAAsE;AAC5F,WAEGQ,8BAAA,OAAAC,wBAAA,EAAA,UAAA;AAAA,MAAM,MAAA;AAAA,MACN,OAAO,IAAI,CAAC,OAAO,MAClBD,8BAAAA,OAAAE,aAAA,cAAA,EAAqB,SAAH,GAAnB,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAH,MAAoC,CACpC;AAAA,IAAA,KAJF,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAKA,GAAAA,MAAA;AAAA,EAEF;AAAA,EACA;AACD;;"}
|
|
@@ -35,7 +35,7 @@ const FieldView = Component(
|
|
|
35
35
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/FieldView.tsx",
|
|
36
36
|
lineNumber: 79,
|
|
37
37
|
columnNumber: 10
|
|
38
|
-
},
|
|
38
|
+
}, void 0);
|
|
39
39
|
},
|
|
40
40
|
(props) => {
|
|
41
41
|
const fields = "fields" in props && Array.isArray(props.fields) ? props.fields : "field" in props && props.field ? [props.field] : throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`);
|
|
@@ -45,12 +45,12 @@ const FieldView = Component(
|
|
|
45
45
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/FieldView.tsx",
|
|
46
46
|
lineNumber: 92,
|
|
47
47
|
columnNumber: 6
|
|
48
|
-
},
|
|
48
|
+
}, void 0))
|
|
49
49
|
] }, void 0, true, {
|
|
50
50
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/FieldView.tsx",
|
|
51
51
|
lineNumber: 89,
|
|
52
52
|
columnNumber: 4
|
|
53
|
-
},
|
|
53
|
+
}, void 0);
|
|
54
54
|
},
|
|
55
55
|
"FieldView"
|
|
56
56
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldView.js","sources":["../../../src/helperComponents/FieldView.tsx"],"sourcesContent":["import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { FieldAccessor, FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { QueryLanguage, throwBindingError } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { SugaredField } from './SugaredField'\n\nexport interface FieldViewCommonProps {\n\tfallbackIfUnpersisted?: ReactNode\n}\n\nexport type FieldViewProps =\n\t& FieldViewCommonProps\n\t& (\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfield: string | SugaredRelativeSingleField\n\t\t }\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfields: Array<string | SugaredRelativeSingleField>\n\t\t }\n\t)\n\n/**\n * Base field view component with no default formatting.\n *\n * @example\n * ```\n * <FieldView\n * field=\"startsAt\"\n * render={(accessor) => <>{accessor.value}</>}\n * />\n * ```\n *\n * @group Field Views\n */\nexport const FieldView = Component<FieldViewProps>(\n\tprops => {\n\t\tconst { fallbackIfUnpersisted, render } = props\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\n\t\tuseConstantLengthInvariant(\n\t\t\tfields,\n\t\t\t`The number of fields in the 'fields' prop of the 'FieldView' must remain constant between renders!`,\n\t\t)\n\n\t\t// TODO over-subscribe less\n\t\tconst entityAccessor = useEntity()\n\t\tconst environment = entityAccessor.environment\n\n\t\tconst desugarField = useCallback(\n\t\t\t(rsf: string | SugaredRelativeSingleField) => QueryLanguage.desugarRelativeSingleField(rsf, environment),\n\t\t\t[environment],\n\t\t)\n\t\tconst desugaredFields = useArrayMapMemo(fields, desugarField)\n\n\t\tconst retrieveField = useCallback(\n\t\t\t(desugaredRsf: RelativeSingleField) => entityAccessor.getRelativeSingleField(desugaredRsf),\n\t\t\t[entityAccessor],\n\t\t)\n\t\tconst accessors = useArrayMapMemo(desugaredFields, retrieveField)\n\n\t\t// TODO we probably want something like useDeferredValue from here.\n\t\t// Will probably just wait for Concurrent React though.\n\t\tconst output = useMemo(() => {\n\t\t\tif (!entityAccessor.existsOnServer && fallbackIfUnpersisted !== undefined) {\n\t\t\t\treturn fallbackIfUnpersisted\n\t\t\t}\n\t\t\treturn render(...accessors)\n\t\t}, [accessors, entityAccessor.existsOnServer, fallbackIfUnpersisted, render])\n\n\t\treturn <>{output}</>\n\t},\n\tprops => {\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{props.fallbackIfUnpersisted}\n\t\t\t\t{fields.map((field, i) => (\n\t\t\t\t\t<SugaredField key={i} field={field} />\n\t\t\t\t))}\n\t\t\t</>\n\t\t)\n\t},\n\t'FieldView',\n) as FieldViewComponentSignature\n\nexport type FieldViewComponentSignature = {\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfield: string | SugaredRelativeSingleField;\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue, FV5 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>, field5: FieldAccessor<FV5>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t(props: FieldViewProps): ReactElement | null\n}\n"],"names":["this"],"mappings":";;;;;;;AAsCO,MAAM,YAAY;AAAA,EACxB,CAAS,UAAA;AACF,UAAA,EAAE,uBAAuB,OAAW,IAAA;AAC1C,UAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZ,kBAAkB,sEAAsE;AAE5F;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAID,UAAM,iBAAiB;AACvB,UAAM,cAAc,eAAe;AAEnC,UAAM,eAAe;AAAA,MACpB,CAAC,QAA6C,cAAc,2BAA2B,KAAK,WAAW;AAAA,MACvG,CAAC,WAAW;AAAA,IAAA;AAEP,UAAA,kBAAkB,gBAAgB,QAAQ,YAAY;AAE5D,UAAM,gBAAgB;AAAA,MACrB,CAAC,iBAAsC,eAAe,uBAAuB,YAAY;AAAA,MACzF,CAAC,cAAc;AAAA,IAAA;AAEV,UAAA,YAAY,gBAAgB,iBAAiB,aAAa;AAI1D,UAAA,SAAS,QAAQ,MAAM;AAC5B,UAAI,CAAC,eAAe,kBAAkB,0BAA0B,QAAW;AACnE,eAAA;AAAA,MACR;AACO,aAAA,OAAO,GAAG,SAAS;AAAA,IAAA,GACxB,CAAC,WAAW,eAAe,gBAAgB,uBAAuB,MAAM,CAAC;AAE5E,8CAAU,UAAH,UAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAU,GAAAA,
|
|
1
|
+
{"version":3,"file":"FieldView.js","sources":["../../../src/helperComponents/FieldView.tsx"],"sourcesContent":["import { useArrayMapMemo, useConstantLengthInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback, useMemo } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport type { FieldAccessor, FieldValue, RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { QueryLanguage, throwBindingError } from '@contember/binding'\nimport { Component } from '../coreComponents'\nimport { SugaredField } from './SugaredField'\n\nexport interface FieldViewCommonProps {\n\tfallbackIfUnpersisted?: ReactNode\n}\n\nexport type FieldViewProps =\n\t& FieldViewCommonProps\n\t& (\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfield: string | SugaredRelativeSingleField\n\t\t }\n\t\t| {\n\t\t\t\trender: (...accessors: FieldAccessor[]) => ReactNode\n\t\t\t\tfields: Array<string | SugaredRelativeSingleField>\n\t\t }\n\t)\n\n/**\n * Base field view component with no default formatting.\n *\n * @example\n * ```\n * <FieldView\n * field=\"startsAt\"\n * render={(accessor) => <>{accessor.value}</>}\n * />\n * ```\n *\n * @group Field Views\n */\nexport const FieldView = Component<FieldViewProps>(\n\tprops => {\n\t\tconst { fallbackIfUnpersisted, render } = props\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\n\t\tuseConstantLengthInvariant(\n\t\t\tfields,\n\t\t\t`The number of fields in the 'fields' prop of the 'FieldView' must remain constant between renders!`,\n\t\t)\n\n\t\t// TODO over-subscribe less\n\t\tconst entityAccessor = useEntity()\n\t\tconst environment = entityAccessor.environment\n\n\t\tconst desugarField = useCallback(\n\t\t\t(rsf: string | SugaredRelativeSingleField) => QueryLanguage.desugarRelativeSingleField(rsf, environment),\n\t\t\t[environment],\n\t\t)\n\t\tconst desugaredFields = useArrayMapMemo(fields, desugarField)\n\n\t\tconst retrieveField = useCallback(\n\t\t\t(desugaredRsf: RelativeSingleField) => entityAccessor.getRelativeSingleField(desugaredRsf),\n\t\t\t[entityAccessor],\n\t\t)\n\t\tconst accessors = useArrayMapMemo(desugaredFields, retrieveField)\n\n\t\t// TODO we probably want something like useDeferredValue from here.\n\t\t// Will probably just wait for Concurrent React though.\n\t\tconst output = useMemo(() => {\n\t\t\tif (!entityAccessor.existsOnServer && fallbackIfUnpersisted !== undefined) {\n\t\t\t\treturn fallbackIfUnpersisted\n\t\t\t}\n\t\t\treturn render(...accessors)\n\t\t}, [accessors, entityAccessor.existsOnServer, fallbackIfUnpersisted, render])\n\n\t\treturn <>{output}</>\n\t},\n\tprops => {\n\t\tconst fields =\n\t\t\t'fields' in props && Array.isArray(props.fields)\n\t\t\t\t? props.fields\n\t\t\t\t: 'field' in props && props.field\n\t\t\t\t? [props.field]\n\t\t\t\t: throwBindingError(`FieldView: failed to supply either the 'field' or the 'fields' prop.`)\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{props.fallbackIfUnpersisted}\n\t\t\t\t{fields.map((field, i) => (\n\t\t\t\t\t<SugaredField key={i} field={field} />\n\t\t\t\t))}\n\t\t\t</>\n\t\t)\n\t},\n\t'FieldView',\n) as FieldViewComponentSignature\n\nexport type FieldViewComponentSignature = {\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfield: string | SugaredRelativeSingleField;\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField];\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t<FV1 extends FieldValue, FV2 extends FieldValue, FV3 extends FieldValue, FV4 extends FieldValue, FV5 extends FieldValue>(\n\t\tprops:\n\t\t\t& FieldViewCommonProps\n\t\t\t& {\n\t\t\tfields: [string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField, string | SugaredRelativeSingleField]\n\t\t\trender: (field1: FieldAccessor<FV1>, field2: FieldAccessor<FV2>, field3: FieldAccessor<FV3>, field4: FieldAccessor<FV4>, field5: FieldAccessor<FV5>) => ReactNode\n\t\t},\n\t): ReactElement | null\n\n\t(props: FieldViewProps): ReactElement | null\n}\n"],"names":["this"],"mappings":";;;;;;;AAsCO,MAAM,YAAY;AAAA,EACxB,CAAS,UAAA;AACF,UAAA,EAAE,uBAAuB,OAAW,IAAA;AAC1C,UAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZ,kBAAkB,sEAAsE;AAE5F;AAAA,MACC;AAAA,MACA;AAAA,IAAA;AAID,UAAM,iBAAiB;AACvB,UAAM,cAAc,eAAe;AAEnC,UAAM,eAAe;AAAA,MACpB,CAAC,QAA6C,cAAc,2BAA2B,KAAK,WAAW;AAAA,MACvG,CAAC,WAAW;AAAA,IAAA;AAEP,UAAA,kBAAkB,gBAAgB,QAAQ,YAAY;AAE5D,UAAM,gBAAgB;AAAA,MACrB,CAAC,iBAAsC,eAAe,uBAAuB,YAAY;AAAA,MACzF,CAAC,cAAc;AAAA,IAAA;AAEV,UAAA,YAAY,gBAAgB,iBAAiB,aAAa;AAI1D,UAAA,SAAS,QAAQ,MAAM;AAC5B,UAAI,CAAC,eAAe,kBAAkB,0BAA0B,QAAW;AACnE,eAAA;AAAA,MACR;AACO,aAAA,OAAO,GAAG,SAAS;AAAA,IAAA,GACxB,CAAC,WAAW,eAAe,gBAAgB,uBAAuB,MAAM,CAAC;AAE5E,8CAAU,UAAH,UAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAU,GAAAA,MAAA;AAAA,EAClB;AAAA,EACA,CAAS,UAAA;AACR,UAAM,SACL,YAAY,SAAS,MAAM,QAAQ,MAAM,MAAM,IAC5C,MAAM,SACN,WAAW,SAAS,MAAM,QAC1B,CAAC,MAAM,KAAK,IACZ,kBAAkB,sEAAsE;AAC5F,WAEG,uBAAA,UAAA,EAAA,UAAA;AAAA,MAAM,MAAA;AAAA,MACN,OAAO,IAAI,CAAC,OAAO,MAClB,uBAAA,cAAA,EAAqB,SAAH,GAAnB,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAA,MAAoC,CACpC;AAAA,IAAA,KAJF,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAKA,GAAAA,MAAA;AAAA,EAEF;AAAA,EACA;AACD;"}
|
|
@@ -15,11 +15,11 @@ const If = Component.Component(
|
|
|
15
15
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
16
16
|
lineNumber: 30,
|
|
17
17
|
columnNumber: 6
|
|
18
|
-
},
|
|
18
|
+
}, void 0) : /* @__PURE__ */ jsxDevRuntime.jsxDEV(IfCallback, { condition: props.condition, children: props.children }, void 0, false, {
|
|
19
19
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
20
20
|
lineNumber: 31,
|
|
21
21
|
columnNumber: 6
|
|
22
|
-
},
|
|
22
|
+
}, void 0);
|
|
23
23
|
},
|
|
24
24
|
"If"
|
|
25
25
|
);
|
|
@@ -31,14 +31,14 @@ const IfCallback = Component.Component(
|
|
|
31
31
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
32
32
|
lineNumber: 41,
|
|
33
33
|
columnNumber: 22
|
|
34
|
-
},
|
|
34
|
+
}, void 0) : null;
|
|
35
35
|
},
|
|
36
36
|
({ children }) => {
|
|
37
37
|
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
|
|
38
38
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
39
39
|
lineNumber: 44,
|
|
40
40
|
columnNumber: 10
|
|
41
|
-
},
|
|
41
|
+
}, void 0);
|
|
42
42
|
},
|
|
43
43
|
"IfCallback"
|
|
44
44
|
);
|
|
@@ -55,7 +55,7 @@ const IfFilter = Component.Component(
|
|
|
55
55
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
56
56
|
lineNumber: 60,
|
|
57
57
|
columnNumber: 22
|
|
58
|
-
},
|
|
58
|
+
}, void 0) : null;
|
|
59
59
|
},
|
|
60
60
|
({ children, condition }, env) => {
|
|
61
61
|
const desugaredFilter = binding.QueryLanguage.desugarFilter(condition, env);
|
|
@@ -64,11 +64,11 @@ const IfFilter = Component.Component(
|
|
|
64
64
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
65
65
|
lineNumber: 65,
|
|
66
66
|
columnNumber: 69
|
|
67
|
-
},
|
|
67
|
+
}, void 0)) }, void 0, false, {
|
|
68
68
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
69
69
|
lineNumber: 65,
|
|
70
70
|
columnNumber: 28
|
|
71
|
-
},
|
|
71
|
+
}, void 0);
|
|
72
72
|
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children: [
|
|
73
73
|
additionalFields,
|
|
74
74
|
children
|
|
@@ -76,7 +76,7 @@ const IfFilter = Component.Component(
|
|
|
76
76
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
77
77
|
lineNumber: 67,
|
|
78
78
|
columnNumber: 10
|
|
79
|
-
},
|
|
79
|
+
}, void 0);
|
|
80
80
|
},
|
|
81
81
|
"IfFilter"
|
|
82
82
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"If.cjs","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(props => {\n\t\treturn typeof props.condition !== 'function'\n\t\t\t? <IfFilter condition={props.condition}>{props.children}</IfFilter>\n\t\t\t: <IfCallback condition={props.condition}>{props.children}</IfCallback>\n\t},\n\t'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children }) => {\n\t\treturn <>{children}</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children, condition }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n\n"],"names":["Component","jsxDEV","this","useEntity","useMemo","useEnvironment","FilterEvaluator","QueryLanguage","FilterFieldsCollector","Fragment","Field"],"mappings":";;;;;;;;;;;AA2BO,MAAM,KAAKA,UAAA;AAAA,EAAmB,CAAS,UAAA;AACrC,WAAA,OAAO,MAAM,cAAc,aAC/BC,8BAAA,OAAC,YAAS,WAAW,MAAM,WAAY,UAAA,MAAM,SAA7C,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAC,
|
|
1
|
+
{"version":3,"file":"If.cjs","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(props => {\n\t\treturn typeof props.condition !== 'function'\n\t\t\t? <IfFilter condition={props.condition}>{props.children}</IfFilter>\n\t\t\t: <IfCallback condition={props.condition}>{props.children}</IfCallback>\n\t},\n\t'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children }) => {\n\t\treturn <>{children}</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children, condition }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n\n"],"names":["Component","jsxDEV","this","useEntity","useMemo","useEnvironment","FilterEvaluator","QueryLanguage","FilterFieldsCollector","Fragment","Field"],"mappings":";;;;;;;;;;;AA2BO,MAAM,KAAKA,UAAA;AAAA,EAAmB,CAAS,UAAA;AACrC,WAAA,OAAO,MAAM,cAAc,aAC/BC,8BAAA,OAAC,YAAS,WAAW,MAAM,WAAY,UAAA,MAAM,SAA7C,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAC,MAAsD,IACrDD,8BAAAA,OAAA,YAAA,EAAW,WAAW,MAAM,WAAY,gBAAM,SAA/C,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAwD,GAAAC,MAAA;AAAA,EAC5D;AAAA,EACA;AACD;AAEA,MAAM,aAAaF,UAAA;AAAA,EAClB,CAAC,EAAE,UAAU,gBAAgB;AAC5B,UAAM,SAASG,UAAAA;AACT,UAAA,YAAYC,cAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAE/D,WAAA,2EAAe,YAAH,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAF,MAAY,IAAM;AAAA,EACtC;AAAA,EACA,CAAC,EAAE,SAAA,MAAe;AACjB,0EAAU,SAAH,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAAA,MAAA;AAAA,EACpB;AAAA,EACA;AACD;AAEA,MAAM,WAAWF,UAAA;AAAA,EAChB,CAAC,EAAE,UAAU,gBAAgB;AAC5B,UAAM,MAAMK,eAAAA;AACZ,UAAM,SAASF,UAAAA;AAET,UAAA,SAAS,IAAI;AACnB,UAAM,YAAYC,MAAA;AAAA,MACjB,MAAM,IAAIE,gBAAAA,gBAAgB,MAAM,EAAE,eAAe,QAAQC,QAAAA,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAAA;AAGzB,WAAA,2EAAe,YAAH,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAL,MAAY,IAAM;AAAA,EACtC;AAAA,EACA,CAAC,EAAE,UAAU,aAAa,QAAQ;AACjC,UAAM,kBAAkBK,QAAA,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAIC,4CAAsB,IAAI,UAAU,GAAG,eAAe,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM;AAC7H,UAAM,mBAAmBP,8BAAAA,OAAAQ,cAAA,UAAA,EAAG,UAAM,MAAA,KAAK,eAAe,EAAE,IAAI,CAAA,OAAOR,8BAAA,OAAAS,aAAA,EAAM,OAAO,GAAA,GAAS,IAAvB,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAR,MAA2B,CAAE,EAAtE,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAwE,GAAAA,MAAA;AAEjG,WACED,8BAAA,OAAAQ,wBAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,IAAA,KAFK,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGP,GAAAP,MAAA;AAAA,EACD;AAAA,EACA;AACD;;"}
|
|
@@ -13,11 +13,11 @@ const If = Component(
|
|
|
13
13
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
14
14
|
lineNumber: 30,
|
|
15
15
|
columnNumber: 6
|
|
16
|
-
},
|
|
16
|
+
}, void 0) : /* @__PURE__ */ jsxDEV(IfCallback, { condition: props.condition, children: props.children }, void 0, false, {
|
|
17
17
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
18
18
|
lineNumber: 31,
|
|
19
19
|
columnNumber: 6
|
|
20
|
-
},
|
|
20
|
+
}, void 0);
|
|
21
21
|
},
|
|
22
22
|
"If"
|
|
23
23
|
);
|
|
@@ -29,14 +29,14 @@ const IfCallback = Component(
|
|
|
29
29
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
30
30
|
lineNumber: 41,
|
|
31
31
|
columnNumber: 22
|
|
32
|
-
},
|
|
32
|
+
}, void 0) : null;
|
|
33
33
|
},
|
|
34
34
|
({ children }) => {
|
|
35
35
|
return /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
|
|
36
36
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
37
37
|
lineNumber: 44,
|
|
38
38
|
columnNumber: 10
|
|
39
|
-
},
|
|
39
|
+
}, void 0);
|
|
40
40
|
},
|
|
41
41
|
"IfCallback"
|
|
42
42
|
);
|
|
@@ -53,7 +53,7 @@ const IfFilter = Component(
|
|
|
53
53
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
54
54
|
lineNumber: 60,
|
|
55
55
|
columnNumber: 22
|
|
56
|
-
},
|
|
56
|
+
}, void 0) : null;
|
|
57
57
|
},
|
|
58
58
|
({ children, condition }, env) => {
|
|
59
59
|
const desugaredFilter = QueryLanguage.desugarFilter(condition, env);
|
|
@@ -62,11 +62,11 @@ const IfFilter = Component(
|
|
|
62
62
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
63
63
|
lineNumber: 65,
|
|
64
64
|
columnNumber: 69
|
|
65
|
-
},
|
|
65
|
+
}, void 0)) }, void 0, false, {
|
|
66
66
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
67
67
|
lineNumber: 65,
|
|
68
68
|
columnNumber: 28
|
|
69
|
-
},
|
|
69
|
+
}, void 0);
|
|
70
70
|
return /* @__PURE__ */ jsxDEV(Fragment, { children: [
|
|
71
71
|
additionalFields,
|
|
72
72
|
children
|
|
@@ -74,7 +74,7 @@ const IfFilter = Component(
|
|
|
74
74
|
fileName: "/__w/interface/interface/packages/react-binding/src/helperComponents/If.tsx",
|
|
75
75
|
lineNumber: 67,
|
|
76
76
|
columnNumber: 10
|
|
77
|
-
},
|
|
77
|
+
}, void 0);
|
|
78
78
|
},
|
|
79
79
|
"IfFilter"
|
|
80
80
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"If.js","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(props => {\n\t\treturn typeof props.condition !== 'function'\n\t\t\t? <IfFilter condition={props.condition}>{props.children}</IfFilter>\n\t\t\t: <IfCallback condition={props.condition}>{props.children}</IfCallback>\n\t},\n\t'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children }) => {\n\t\treturn <>{children}</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children, condition }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n\n"],"names":["this"],"mappings":";;;;;;;;;AA2BO,MAAM,KAAK;AAAA,EAAmB,CAAS,UAAA;AACrC,WAAA,OAAO,MAAM,cAAc,aAC/B,uBAAC,YAAS,WAAW,MAAM,WAAY,UAAA,MAAM,SAA7C,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAA,
|
|
1
|
+
{"version":3,"file":"If.js","sources":["../../../src/helperComponents/If.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { useMemo } from 'react'\nimport { Component, Field } from '../coreComponents'\nimport { EntityAccessor } from '@contember/binding'\nimport { QueryLanguage } from '@contember/binding'\nimport { useEntity, useEnvironment } from '../accessorPropagation'\nimport { Filter } from '@contember/binding'\nimport { FilterFieldsCollector } from './helpers/FilterFieldsCollector'\nimport { FilterEvaluator } from './helpers/FilterEvaluator'\n\nexport type IfProps =\n\t| IfFilterProps\n\t| IfCallbackProps\n\nexport interface IfFilterProps {\n\tcondition: string | Filter\n\tchildren?: ReactNode\n}\n\nexport interface IfCallbackProps {\n\tcondition: (accessor: EntityAccessor) => boolean\n\tchildren?: ReactNode\n}\n\n/**\n * @group Logic Components\n */\nexport const If = Component<IfProps>(props => {\n\t\treturn typeof props.condition !== 'function'\n\t\t\t? <IfFilter condition={props.condition}>{props.children}</IfFilter>\n\t\t\t: <IfCallback condition={props.condition}>{props.children}</IfCallback>\n\t},\n\t'If',\n)\n\nconst IfCallback = Component<IfCallbackProps>(\n\t({ children, condition }) => {\n\t\tconst entity = useEntity()\n\t\tconst evaluated = useMemo(() => condition(entity), [condition, entity])\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children }) => {\n\t\treturn <>{children}</>\n\t},\n\t'IfCallback',\n)\n\nconst IfFilter = Component<IfFilterProps>(\n\t({ children, condition }) => {\n\t\tconst env = useEnvironment()\n\t\tconst entity = useEntity()\n\n\t\tconst schema = env.getSchema()\n\t\tconst evaluated = useMemo(\n\t\t\t() => new FilterEvaluator(schema).evaluateFilter(entity, QueryLanguage.desugarFilter(condition, env)),\n\t\t\t[condition, entity, env, schema],\n\t\t)\n\n\t\treturn evaluated ? <>{children}</> : null\n\t},\n\t({ children, condition }, env) => {\n\t\tconst desugaredFilter = QueryLanguage.desugarFilter(condition, env)\n\t\tconst collectedFields = new FilterFieldsCollector(env.getSchema(), desugaredFilter).collectFields(env.getSubTreeNode().entity)\n\t\tconst additionalFields = <>{Array.from(collectedFields).map(it => <Field field={it} key={it} />)}</>\n\n\t\treturn <>\n\t\t\t{additionalFields}\n\t\t\t{children}\n\t\t</>\n\t},\n\t'IfFilter',\n)\n\n"],"names":["this"],"mappings":";;;;;;;;;AA2BO,MAAM,KAAK;AAAA,EAAmB,CAAS,UAAA;AACrC,WAAA,OAAO,MAAM,cAAc,aAC/B,uBAAC,YAAS,WAAW,MAAM,WAAY,UAAA,MAAM,SAA7C,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAA,MAAsD,IACrD,uBAAA,YAAA,EAAW,WAAW,MAAM,WAAY,gBAAM,SAA/C,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAwD,GAAAA,MAAA;AAAA,EAC5D;AAAA,EACA;AACD;AAEA,MAAM,aAAa;AAAA,EAClB,CAAC,EAAE,UAAU,gBAAgB;AAC5B,UAAM,SAAS;AACT,UAAA,YAAY,QAAQ,MAAM,UAAU,MAAM,GAAG,CAAC,WAAW,MAAM,CAAC;AAE/D,WAAA,+CAAe,YAAH,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAA,MAAY,IAAM;AAAA,EACtC;AAAA,EACA,CAAC,EAAE,SAAA,MAAe;AACjB,8CAAU,SAAH,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAY,GAAAA,MAAA;AAAA,EACpB;AAAA,EACA;AACD;AAEA,MAAM,WAAW;AAAA,EAChB,CAAC,EAAE,UAAU,gBAAgB;AAC5B,UAAM,MAAM;AACZ,UAAM,SAAS;AAET,UAAA,SAAS,IAAI;AACnB,UAAM,YAAY;AAAA,MACjB,MAAM,IAAI,gBAAgB,MAAM,EAAE,eAAe,QAAQ,cAAc,cAAc,WAAW,GAAG,CAAC;AAAA,MACpG,CAAC,WAAW,QAAQ,KAAK,MAAM;AAAA,IAAA;AAGzB,WAAA,+CAAe,YAAH,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAA,MAAY,IAAM;AAAA,EACtC;AAAA,EACA,CAAC,EAAE,UAAU,aAAa,QAAQ;AACjC,UAAM,kBAAkB,cAAc,cAAc,WAAW,GAAG;AAClE,UAAM,kBAAkB,IAAI,sBAAsB,IAAI,UAAU,GAAG,eAAe,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM;AAC7H,UAAM,mBAAmB,uBAAA,UAAA,EAAG,UAAM,MAAA,KAAK,eAAe,EAAE,IAAI,CAAA,OAAO,uBAAA,OAAA,EAAM,OAAO,GAAA,GAAS,IAAvB,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA,GAAAA,MAA2B,CAAE,EAAtE,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAwE,GAAAA,MAAA;AAEjG,WACE,uBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,IAAA,KAFK,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGP,GAAAA,MAAA;AAAA,EACD;AAAA,EACA;AACD;"}
|