@contember/react-binding 2.0.0-alpha.32 → 2.0.0-alpha.35
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/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/development/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/development/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntity.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntity.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityKey.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityList.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
- package/dist/development/src/accessorPropagation/useExtendTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useExtendTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useField.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useField.js.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
- package/dist/development/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/development/src/accessorPropagation/useHasEntity.cjs.map +1 -1
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/development/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
- package/dist/development/src/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/development/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
- package/dist/development/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/development/src/accessorSorting/sortEntities.cjs.map +1 -1
- package/dist/development/src/accessorSorting/sortEntities.js.map +1 -1
- package/dist/development/src/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/development/src/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
- package/dist/development/src/accessorTree/useAccessorTreeState.js.map +1 -1
- package/dist/development/src/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/development/src/accessorTree/useDataBinding.js.map +1 -1
- package/dist/development/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -1
- package/dist/development/src/accessorTree/useEnvironmentWithSchema.js.map +1 -1
- package/dist/development/src/coreComponents/Component.cjs.map +1 -1
- package/dist/development/src/coreComponents/Component.js.map +1 -1
- package/dist/development/src/coreComponents/DataBindingProvider.cjs.map +1 -1
- package/dist/development/src/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/development/src/coreComponents/Entity.cjs.map +1 -1
- package/dist/development/src/coreComponents/Entity.js.map +1 -1
- package/dist/development/src/coreComponents/EntityList.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntityList.js.map +1 -1
- package/dist/development/src/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/src/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/development/src/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/src/coreComponents/Field.cjs.map +1 -1
- package/dist/development/src/coreComponents/Field.js.map +1 -1
- package/dist/development/src/coreComponents/HasMany.cjs.map +1 -1
- package/dist/development/src/coreComponents/HasOne.cjs.map +1 -1
- package/dist/development/src/coreComponents/ParentEntity.cjs.map +1 -1
- package/dist/development/src/entityEvents/useDerivedField.cjs.map +1 -1
- package/dist/development/src/entityEvents/useDerivedField.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityEvent.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/development/src/entityEvents/useEntityPersistError.cjs.map +1 -1
- package/dist/development/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
- package/dist/development/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
- package/dist/development/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/development/src/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/src/helperComponents/DimensionRenderer.cjs.map +1 -1
- package/dist/development/src/helperComponents/DimensionRenderer.js.map +1 -1
- package/dist/development/src/helperComponents/EntityView.cjs.map +1 -1
- package/dist/development/src/helperComponents/EntityView.js.map +1 -1
- package/dist/development/src/helperComponents/FieldView.cjs.map +1 -1
- package/dist/development/src/helperComponents/FieldView.js.map +1 -1
- package/dist/development/src/helperComponents/If.cjs.map +1 -1
- package/dist/development/src/helperComponents/If.js.map +1 -1
- package/dist/development/src/helperComponents/LabelMiddleware.cjs.map +1 -1
- package/dist/development/src/helperComponents/LabelMiddleware.js.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminator.cjs.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminator.js.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
- package/dist/development/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
- package/dist/development/src/helperComponents/SugaredField.cjs.map +1 -1
- package/dist/development/src/helperComponents/SugaredField.js.map +1 -1
- package/dist/development/src/helperComponents/Variable.cjs.map +1 -1
- package/dist/development/src/helperComponents/Variable.js.map +1 -1
- package/dist/development/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
- package/dist/development/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
- package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
- package/dist/development/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
- package/dist/development/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
- package/dist/development/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
- package/dist/development/src/markers/IncrementalMarkerBuilder.cjs.map +1 -1
- package/dist/development/src/markers/IncrementalMarkerBuilder.js.map +1 -1
- package/dist/development/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
- package/dist/development/src/markers/MarkerStaticAnalyzer.js.map +1 -1
- package/dist/development/src/markers/MarkerTreeGenerator.cjs.map +1 -1
- package/dist/development/src/markers/MarkerTreeGenerator.js.map +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/production/src/accessorPropagation/BindingOperationsProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/EnvironmentContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/production/src/accessorPropagation/TreeRootIdContext.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/TreeRootIdProvider.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntity.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntity.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityKey.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityList.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTreeLoader.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTreeLoader.js.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
- package/dist/production/src/accessorPropagation/useExtendTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useExtendTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useField.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useField.js.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntityListSubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntitySubTree.cjs.map +1 -1
- package/dist/production/src/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/production/src/accessorPropagation/useHasEntity.cjs.map +1 -1
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.cjs.map +1 -1
- package/dist/production/src/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.cjs.map +1 -1
- package/dist/production/src/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/production/src/accessorSorting/repairEntitiesOrder.cjs.map +1 -1
- package/dist/production/src/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/production/src/accessorSorting/sortEntities.cjs.map +1 -1
- package/dist/production/src/accessorSorting/sortEntities.js.map +1 -1
- package/dist/production/src/accessorTree/AccessorTree.cjs.map +1 -1
- package/dist/production/src/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/src/accessorTree/useAccessorTreeState.cjs.map +1 -1
- package/dist/production/src/accessorTree/useAccessorTreeState.js.map +1 -1
- package/dist/production/src/accessorTree/useDataBinding.cjs.map +1 -1
- package/dist/production/src/accessorTree/useDataBinding.js.map +1 -1
- package/dist/production/src/accessorTree/useEnvironmentWithSchema.cjs.map +1 -1
- package/dist/production/src/accessorTree/useEnvironmentWithSchema.js.map +1 -1
- package/dist/production/src/coreComponents/Component.cjs.map +1 -1
- package/dist/production/src/coreComponents/Component.js.map +1 -1
- package/dist/production/src/coreComponents/DataBindingProvider.cjs.map +1 -1
- package/dist/production/src/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/production/src/coreComponents/EntityList.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntityList.js.map +1 -1
- package/dist/production/src/coreComponents/EntityListSubTree.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/production/src/coreComponents/EntitySubTree.cjs.map +1 -1
- package/dist/production/src/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/production/src/coreComponents/Field.cjs.map +1 -1
- package/dist/production/src/coreComponents/Field.js.map +1 -1
- package/dist/production/src/coreComponents/HasMany.cjs.map +1 -1
- package/dist/production/src/coreComponents/HasMany.js.map +1 -1
- package/dist/production/src/coreComponents/HasOne.cjs.map +1 -1
- package/dist/production/src/coreComponents/HasOne.js.map +1 -1
- package/dist/production/src/coreComponents/ParentEntity.cjs.map +1 -1
- package/dist/production/src/entityEvents/useDerivedField.cjs.map +1 -1
- package/dist/production/src/entityEvents/useDerivedField.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityBeforePersist.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityBeforeUpdate.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityEvent.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/production/src/entityEvents/useEntityPersistError.cjs.map +1 -1
- package/dist/production/src/entityEvents/useEntityPersistSuccess.cjs.map +1 -1
- package/dist/production/src/entityEvents/useOnConnectionUpdate.cjs.map +1 -1
- package/dist/production/src/helperComponents/DeferredSubTrees.cjs.map +1 -1
- package/dist/production/src/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/src/helperComponents/DimensionRenderer.cjs.map +1 -1
- package/dist/production/src/helperComponents/DimensionRenderer.js.map +1 -1
- package/dist/production/src/helperComponents/EntityView.cjs.map +1 -1
- package/dist/production/src/helperComponents/EntityView.js.map +1 -1
- package/dist/production/src/helperComponents/FieldView.cjs.map +1 -1
- package/dist/production/src/helperComponents/FieldView.js.map +1 -1
- package/dist/production/src/helperComponents/If.cjs.map +1 -1
- package/dist/production/src/helperComponents/If.js.map +1 -1
- package/dist/production/src/helperComponents/LabelMiddleware.cjs.map +1 -1
- package/dist/production/src/helperComponents/LabelMiddleware.js.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminator.cjs.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminator.js.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminatorPortal.cjs.map +1 -1
- package/dist/production/src/helperComponents/RecursionTerminatorPortal.js.map +1 -1
- package/dist/production/src/helperComponents/SugaredField.cjs.map +1 -1
- package/dist/production/src/helperComponents/SugaredField.js.map +1 -1
- package/dist/production/src/helperComponents/Variable.cjs.map +1 -1
- package/dist/production/src/helperComponents/Variable.js.map +1 -1
- package/dist/production/src/helperComponents/helpers/FilterEvaluator.cjs.map +1 -1
- package/dist/production/src/helperComponents/helpers/FilterEvaluator.js.map +1 -1
- package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.cjs.map +1 -1
- package/dist/production/src/helperComponents/helpers/FilterFieldsCollector.js.map +1 -1
- package/dist/production/src/helperComponents/helpers/evaluateCondition.cjs.map +1 -1
- package/dist/production/src/helperComponents/helpers/evaluateCondition.js.map +1 -1
- package/dist/production/src/markers/IncrementalMarkerBuilder.cjs.map +1 -1
- package/dist/production/src/markers/IncrementalMarkerBuilder.js.map +1 -1
- package/dist/production/src/markers/MarkerStaticAnalyzer.cjs.map +1 -1
- package/dist/production/src/markers/MarkerStaticAnalyzer.js.map +1 -1
- package/dist/production/src/markers/MarkerTreeGenerator.cjs.map +1 -1
- package/dist/production/src/markers/MarkerTreeGenerator.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
- package/tests/cases/unit/core/entityOperations.test.tsx +4 -4
- package/tests/cases/unit/core/eventManager.test.tsx +11 -8
- package/tests/cases/unit/helperComponents/FilterEvaluator.spec.ts +1 -1
- package/tests/cases/unit/helperComponents/FilterFieldsCollector.spec.ts +1 -1
- package/tests/cases/unit/helperComponents/evaluateCondition.spec.ts +1 -1
- package/tests/cases/unit/model/markerTreeGenerator.spec.tsx +24 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts"],"sourcesContent":["import { createContext, ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nconst getRejecter = (operation: string) => () => {\n\tthrow new BindingError(\n\t\t`Trying to ${operation} but data binding is unavailable. You likely used a bound component outside ` +\n\t\t\t`<DataBindingProvider /> or it tried to reach its accessor whilst the tree was in an non-interactive state ` +\n\t\t\t`(e.g. still loading).`,\n\t)\n}\n\nexport const defaultBindingOperations = Object.freeze<BindingOperations<ReactNode>>({\n\tget contentClient() {\n\t\treturn getRejecter('retrieve the content api client')()\n\t},\n\tget systemClient() {\n\t\treturn getRejecter('retrieve the system api client')()\n\t},\n\tget tenantClient() {\n\t\treturn getRejecter('retrieve the tenant api client')()\n\t},\n\tgetEntityListSubTree: getRejecter('retrieve an entity list sub tree'),\n\tgetEntitySubTree: getRejecter('retrieve a single entity sub tree'),\n\tgetEntityByKey: getRejecter('retrieve an entity by key'),\n\tbatchDeferredUpdates: getRejecter('batch deferred updates'),\n\textendTree: getRejecter('extendTree'),\n\tpersist: getRejecter('persist'),\n\tfetchData: getRejecter('fetchData'),\n})\n\nexport const BindingOperationsContext = createContext<BindingOperations<ReactNode>>(defaultBindingOperations)\n"],"names":["BindingError","createContext"],"mappings":";;;;AAIA,MAAM,cAAc,CAAC,cAAsB,MAAM;AAChD,QAAM,IAAIA,QAAA;AAAA,IACT,aAAa,SAAS;AAAA,
|
|
1
|
+
{"version":3,"file":"BindingOperationsContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts"],"sourcesContent":["import { createContext, ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nconst getRejecter = (operation: string) => () => {\n\tthrow new BindingError(\n\t\t`Trying to ${operation} but data binding is unavailable. You likely used a bound component outside ` +\n\t\t\t`<DataBindingProvider /> or it tried to reach its accessor whilst the tree was in an non-interactive state ` +\n\t\t\t`(e.g. still loading).`,\n\t)\n}\n\nexport const defaultBindingOperations = Object.freeze<BindingOperations<ReactNode>>({\n\tget contentClient() {\n\t\treturn getRejecter('retrieve the content api client')()\n\t},\n\tget systemClient() {\n\t\treturn getRejecter('retrieve the system api client')()\n\t},\n\tget tenantClient() {\n\t\treturn getRejecter('retrieve the tenant api client')()\n\t},\n\tgetEntityListSubTree: getRejecter('retrieve an entity list sub tree'),\n\tgetEntitySubTree: getRejecter('retrieve a single entity sub tree'),\n\tgetEntityByKey: getRejecter('retrieve an entity by key'),\n\tbatchDeferredUpdates: getRejecter('batch deferred updates'),\n\textendTree: getRejecter('extendTree'),\n\tpersist: getRejecter('persist'),\n\tfetchData: getRejecter('fetchData'),\n})\n\nexport const BindingOperationsContext = createContext<BindingOperations<ReactNode>>(defaultBindingOperations)\n"],"names":["BindingError","createContext"],"mappings":";;;;AAIA,MAAM,cAAc,CAAC,cAAsB,MAAM;AAChD,QAAM,IAAIA,QAAA;AAAA,IACT,aAAa,SAAS;AAAA,EAGvB;AACD;AAEa,MAAA,2BAA2B,OAAO,OAAqC;AAAA,EACnF,IAAI,gBAAgB;AACZ,WAAA,YAAY,iCAAiC,EAAE;AAAA,EACvD;AAAA,EACA,IAAI,eAAe;AACX,WAAA,YAAY,gCAAgC,EAAE;AAAA,EACtD;AAAA,EACA,IAAI,eAAe;AACX,WAAA,YAAY,gCAAgC,EAAE;AAAA,EACtD;AAAA,EACA,sBAAsB,YAAY,kCAAkC;AAAA,EACpE,kBAAkB,YAAY,mCAAmC;AAAA,EACjE,gBAAgB,YAAY,2BAA2B;AAAA,EACvD,sBAAsB,YAAY,wBAAwB;AAAA,EAC1D,YAAY,YAAY,YAAY;AAAA,EACpC,SAAS,YAAY,SAAS;AAAA,EAC9B,WAAW,YAAY,WAAW;AACnC,CAAC;AAEY,MAAA,2BAA2BC,oBAA4C,wBAAwB;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsContext.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts"],"sourcesContent":["import { createContext, ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nconst getRejecter = (operation: string) => () => {\n\tthrow new BindingError(\n\t\t`Trying to ${operation} but data binding is unavailable. You likely used a bound component outside ` +\n\t\t\t`<DataBindingProvider /> or it tried to reach its accessor whilst the tree was in an non-interactive state ` +\n\t\t\t`(e.g. still loading).`,\n\t)\n}\n\nexport const defaultBindingOperations = Object.freeze<BindingOperations<ReactNode>>({\n\tget contentClient() {\n\t\treturn getRejecter('retrieve the content api client')()\n\t},\n\tget systemClient() {\n\t\treturn getRejecter('retrieve the system api client')()\n\t},\n\tget tenantClient() {\n\t\treturn getRejecter('retrieve the tenant api client')()\n\t},\n\tgetEntityListSubTree: getRejecter('retrieve an entity list sub tree'),\n\tgetEntitySubTree: getRejecter('retrieve a single entity sub tree'),\n\tgetEntityByKey: getRejecter('retrieve an entity by key'),\n\tbatchDeferredUpdates: getRejecter('batch deferred updates'),\n\textendTree: getRejecter('extendTree'),\n\tpersist: getRejecter('persist'),\n\tfetchData: getRejecter('fetchData'),\n})\n\nexport const BindingOperationsContext = createContext<BindingOperations<ReactNode>>(defaultBindingOperations)\n"],"names":[],"mappings":";;AAIA,MAAM,cAAc,CAAC,cAAsB,MAAM;AAChD,QAAM,IAAI;AAAA,IACT,aAAa,SAAS;AAAA,
|
|
1
|
+
{"version":3,"file":"BindingOperationsContext.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/BindingOperationsContext.ts"],"sourcesContent":["import { createContext, ReactNode } from 'react'\nimport type { BindingOperations } from '@contember/binding'\nimport { BindingError } from '@contember/binding'\n\nconst getRejecter = (operation: string) => () => {\n\tthrow new BindingError(\n\t\t`Trying to ${operation} but data binding is unavailable. You likely used a bound component outside ` +\n\t\t\t`<DataBindingProvider /> or it tried to reach its accessor whilst the tree was in an non-interactive state ` +\n\t\t\t`(e.g. still loading).`,\n\t)\n}\n\nexport const defaultBindingOperations = Object.freeze<BindingOperations<ReactNode>>({\n\tget contentClient() {\n\t\treturn getRejecter('retrieve the content api client')()\n\t},\n\tget systemClient() {\n\t\treturn getRejecter('retrieve the system api client')()\n\t},\n\tget tenantClient() {\n\t\treturn getRejecter('retrieve the tenant api client')()\n\t},\n\tgetEntityListSubTree: getRejecter('retrieve an entity list sub tree'),\n\tgetEntitySubTree: getRejecter('retrieve a single entity sub tree'),\n\tgetEntityByKey: getRejecter('retrieve an entity by key'),\n\tbatchDeferredUpdates: getRejecter('batch deferred updates'),\n\textendTree: getRejecter('extendTree'),\n\tpersist: getRejecter('persist'),\n\tfetchData: getRejecter('fetchData'),\n})\n\nexport const BindingOperationsContext = createContext<BindingOperations<ReactNode>>(defaultBindingOperations)\n"],"names":[],"mappings":";;AAIA,MAAM,cAAc,CAAC,cAAsB,MAAM;AAChD,QAAM,IAAI;AAAA,IACT,aAAa,SAAS;AAAA,EAGvB;AACD;AAEa,MAAA,2BAA2B,OAAO,OAAqC;AAAA,EACnF,IAAI,gBAAgB;AACZ,WAAA,YAAY,iCAAiC,EAAE;AAAA,EACvD;AAAA,EACA,IAAI,eAAe;AACX,WAAA,YAAY,gCAAgC,EAAE;AAAA,EACtD;AAAA,EACA,IAAI,eAAe;AACX,WAAA,YAAY,gCAAgC,EAAE;AAAA,EACtD;AAAA,EACA,sBAAsB,YAAY,kCAAkC;AAAA,EACpE,kBAAkB,YAAY,mCAAmC;AAAA,EACjE,gBAAgB,YAAY,2BAA2B;AAAA,EACvD,sBAAsB,YAAY,wBAAwB;AAAA,EAC1D,YAAY,YAAY,YAAY;AAAA,EACpC,SAAS,YAAY,SAAS;AAAA,EAC9B,WAAW,YAAY,WAAW;AACnC,CAAC;AAEY,MAAA,2BAA2B,cAA4C,wBAAwB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKeyContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EntityKeyContext.ts"],"sourcesContent":["import { EntityAccessor } from '@contember/binding'\nimport { createContext } from 'react'\n\nexport const EntityKeyContext = createContext<undefined | string | (() => EntityAccessor)>(undefined)\nEntityKeyContext.displayName = 'EntityKeyContext'\n"],"names":["createContext"],"mappings":";;;AAGa,MAAA,mBAAmBA,
|
|
1
|
+
{"version":3,"file":"EntityKeyContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EntityKeyContext.ts"],"sourcesContent":["import { EntityAccessor } from '@contember/binding'\nimport { createContext } from 'react'\n\nexport const EntityKeyContext = createContext<undefined | string | (() => EntityAccessor)>(undefined)\nEntityKeyContext.displayName = 'EntityKeyContext'\n"],"names":["createContext"],"mappings":";;;AAGa,MAAA,mBAAmBA,oBAA2D,MAAS;AACpG,iBAAiB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":["createContext","Environment","Component","useEnvironment","useMemo","this","useCallback","jsxDEV"],"mappings":";;;;;;;AAKO,MAAM,qBAAqBA,
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":["createContext","Environment","Component","useEnvironment","useMemo","this","useCallback","jsxDEV"],"mappings":";;;;;;;AAKO,MAAM,qBAAqBA,MAAAA,cAA2BC,QAAY,YAAA,OAAQ,CAAA;AACjF,mBAAmB,cAAc;AAQ1B,MAAM,wBAAwBC,UAAA;AAAA,EACpC,CAAC,EAAE,UAAU,QAAQ,WAAW;AAC/B,UAAM,MAAMC,eAAAA,eAAe;AAC3B,UAAM,mBAAmBC,MAAA;AAAA,MACxB,MAAM,OAAO,KAAK,QAAQ,EAAE;AAAA;AAAA,MAE5B,CAAC,KAAK,QAAQ,GAAI,QAAQ,CAAG,CAAA;AAAA,IAC9B;AAEA,gDAAQ,mBAAmB,UAAnB,EAA4B,OAAO,kBAAmB,SAAvD,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAgE,GAAAC,MAAA;AAAA,EACxE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,4EAAU,SAAH,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAY,GAAAA,MAAA;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,QAAQ,KAAA,GAAQ,QAAQ;AAC/C,aAAO,OAAO,KAAK,QAAQ,EAAE;AAAA,IAAA;AAAA,EAC9B;AAEF;AAQO,MAAM,+BAAgGH,UAAA;AAAA,EAC5G,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAASI,MAAAA,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACjG,WAAAC,8BAAAA,OAAC,uBAAsB,EAAA,QAAiB,YAAxC,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAiD,GAAAF,MAAA;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AAChE,WAAAE,8BAAAA,OAAC,uBAAsB,EAAA,QAAiB,YAAxC,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAiD,GAAAF,MAAA;AAAA,EAAA;AAE1D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":["this"],"mappings":";;;;;AAKO,MAAM,qBAAqB,cAA2B,YAAY,
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useCallback, useMemo } from 'react'\nimport { Environment } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps<T extends unknown[]> {\n\tchildren: ReactNode\n\tcreate: (env: Environment, args: T) => Environment\n\targs?: T\n}\n\nexport const EnvironmentMiddleware = Component<EnvironmentMiddlewareProps<unknown[]>>(\n\t({ children, create, args }) => {\n\t\tconst env = useEnvironment()\n\t\tconst envWithExtension = useMemo(\n\t\t\t() => create(env, args ?? []),\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t\t[env, create, ...(args ?? [])],\n\t\t)\n\n\t\treturn <EnvironmentContext.Provider value={envWithExtension}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create, args }, env) => {\n\t\t\treturn create(env, args ?? [])\n\t\t},\n\t},\n) as <T extends unknown[]>(props: EnvironmentMiddlewareProps<T>) => ReactNode\n\nexport interface EnvironmentWithExtensionProps<S, R> {\n\tchildren: ReactNode\n\textension: Environment.Extension<S, R>\n\tstate: S\n}\n\nexport const EnvironmentExtensionProvider: <S, R>(props: EnvironmentWithExtensionProps<S, R>) => ReactNode = Component(\n\t({ children, extension, state }) => {\n\t\tconst create = useCallback((env: Environment) => env.withExtension(extension, state), [extension, state])\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n\t({ children, extension, state }) => {\n\t\tconst create = (env: Environment) => env.withExtension(extension, state)\n\t\treturn <EnvironmentMiddleware create={create}>{children}</EnvironmentMiddleware>\n\t},\n)\n"],"names":["this"],"mappings":";;;;;AAKO,MAAM,qBAAqB,cAA2B,YAAY,OAAQ,CAAA;AACjF,mBAAmB,cAAc;AAQ1B,MAAM,wBAAwB;AAAA,EACpC,CAAC,EAAE,UAAU,QAAQ,WAAW;AAC/B,UAAM,MAAM,eAAe;AAC3B,UAAM,mBAAmB;AAAA,MACxB,MAAM,OAAO,KAAK,QAAQ,EAAE;AAAA;AAAA,MAE5B,CAAC,KAAK,QAAQ,GAAI,QAAQ,CAAG,CAAA;AAAA,IAC9B;AAEA,kCAAQ,mBAAmB,UAAnB,EAA4B,OAAO,kBAAmB,SAAvD,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAgE,GAAAA,MAAA;AAAA,EACxE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,gDAAU,SAAH,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAY,GAAAA,MAAA;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,QAAQ,KAAA,GAAQ,QAAQ;AAC/C,aAAO,OAAO,KAAK,QAAQ,EAAE;AAAA,IAAA;AAAA,EAC9B;AAEF;AAQO,MAAM,+BAAgG;AAAA,EAC5G,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACjG,WAAA,uBAAC,uBAAsB,EAAA,QAAiB,YAAxC,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAiD,GAAAA,MAAA;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AAChE,WAAA,uBAAC,uBAAsB,EAAA,QAAiB,YAAxC,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAiD,GAAAA,MAAA;AAAA,EAAA;AAE1D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRootIdContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/TreeRootIdContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\n\nexport const TreeRootIdContext = createContext<undefined | TreeRootId>(undefined)\nTreeRootIdContext.displayName = 'TreeRootIdContext'\n"],"names":["createContext"],"mappings":";;;AAGa,MAAA,oBAAoBA,
|
|
1
|
+
{"version":3,"file":"TreeRootIdContext.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/TreeRootIdContext.ts"],"sourcesContent":["import { createContext } from 'react'\nimport type { TreeRootId } from '@contember/binding'\n\nexport const TreeRootIdContext = createContext<undefined | TreeRootId>(undefined)\nTreeRootIdContext.displayName = 'TreeRootIdContext'\n"],"names":["createContext"],"mappings":";;;AAGa,MAAA,oBAAoBA,oBAAsC,MAAS;AAChF,kBAAkB,cAAc;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccessorUpdateSubscription.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * It is VERY IMPORTANT for the parameter to be referentially stable!\n */\nexport const useAccessorUpdateSubscription = <Accessor extends {\n\taddEventListener: (event: { type: 'update' }, cb: (accessor: Accessor) => void) => () => void\n}>(getAccessor: () => Accessor): [Accessor, {update: () => void}] => {\n\tconst [state, setState] = useState<Accessor>(() => getAccessor())\n\tconst getterRef = useRef(getAccessor)\n\n\tlet accessor = state\n\tif (getterRef.current !== getAccessor) {\n\t\taccessor = getAccessor()\n\t\tsetState(accessor)\n\t\tgetterRef.current = getAccessor\n\t}\n\n\tuseEffect(() => {\n\t\tlet isStillSubscribed = true\n\t\tconst unsubscribe = getAccessor().addEventListener({ type: 'update' }, newAccessor => {\n\t\t\tif (!isStillSubscribed || getterRef.current !== getAccessor) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetState(newAccessor)\n\t\t})\n\n\t\treturn () => {\n\t\t\tisStillSubscribed = false\n\t\t\tunsubscribe()\n\t\t}\n\t}, [getAccessor])\n\n\tconst update = useCallback(() => {\n\t\tsetState(getAccessor())\n\t}, [getAccessor])\n\n\treturn [accessor, { update }]\n}\n"],"names":["useState","useRef","useEffect","useCallback"],"mappings":";;;AAKa,MAAA,gCAAgC,CAE1C,gBAAkE;AACpE,QAAM,CAAC,OAAO,QAAQ,IAAIA,MAAAA,SAAmB,MAAM,aAAa;AAC1D,QAAA,YAAYC,aAAO,WAAW;AAEpC,MAAI,WAAW;AACX,MAAA,UAAU,YAAY,aAAa;AACtC,eAAW,YAAY;AACvB,aAAS,QAAQ;AACjB,cAAU,UAAU;AAAA,
|
|
1
|
+
{"version":3,"file":"useAccessorUpdateSubscription.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * It is VERY IMPORTANT for the parameter to be referentially stable!\n */\nexport const useAccessorUpdateSubscription = <Accessor extends {\n\taddEventListener: (event: { type: 'update' }, cb: (accessor: Accessor) => void) => () => void\n}>(getAccessor: () => Accessor): [Accessor, {update: () => void}] => {\n\tconst [state, setState] = useState<Accessor>(() => getAccessor())\n\tconst getterRef = useRef(getAccessor)\n\n\tlet accessor = state\n\tif (getterRef.current !== getAccessor) {\n\t\taccessor = getAccessor()\n\t\tsetState(accessor)\n\t\tgetterRef.current = getAccessor\n\t}\n\n\tuseEffect(() => {\n\t\tlet isStillSubscribed = true\n\t\tconst unsubscribe = getAccessor().addEventListener({ type: 'update' }, newAccessor => {\n\t\t\tif (!isStillSubscribed || getterRef.current !== getAccessor) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetState(newAccessor)\n\t\t})\n\n\t\treturn () => {\n\t\t\tisStillSubscribed = false\n\t\t\tunsubscribe()\n\t\t}\n\t}, [getAccessor])\n\n\tconst update = useCallback(() => {\n\t\tsetState(getAccessor())\n\t}, [getAccessor])\n\n\treturn [accessor, { update }]\n}\n"],"names":["useState","useRef","useEffect","useCallback"],"mappings":";;;AAKa,MAAA,gCAAgC,CAE1C,gBAAkE;AACpE,QAAM,CAAC,OAAO,QAAQ,IAAIA,MAAAA,SAAmB,MAAM,aAAa;AAC1D,QAAA,YAAYC,aAAO,WAAW;AAEpC,MAAI,WAAW;AACX,MAAA,UAAU,YAAY,aAAa;AACtC,eAAW,YAAY;AACvB,aAAS,QAAQ;AACjB,cAAU,UAAU;AAAA,EAAA;AAGrBC,QAAAA,UAAU,MAAM;AACf,QAAI,oBAAoB;AAClB,UAAA,cAAc,cAAc,iBAAiB,EAAE,MAAM,SAAA,GAAY,CAAe,gBAAA;AACrF,UAAI,CAAC,qBAAqB,UAAU,YAAY,aAAa;AAC5D;AAAA,MAAA;AAED,eAAS,WAAW;AAAA,IAAA,CACpB;AAED,WAAO,MAAM;AACQ,0BAAA;AACR,kBAAA;AAAA,IACb;AAAA,EAAA,GACE,CAAC,WAAW,CAAC;AAEV,QAAA,SAASC,MAAAA,YAAY,MAAM;AAChC,aAAS,aAAa;AAAA,EAAA,GACpB,CAAC,WAAW,CAAC;AAEhB,SAAO,CAAC,UAAU,EAAE,QAAQ;AAC7B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccessorUpdateSubscription.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * It is VERY IMPORTANT for the parameter to be referentially stable!\n */\nexport const useAccessorUpdateSubscription = <Accessor extends {\n\taddEventListener: (event: { type: 'update' }, cb: (accessor: Accessor) => void) => () => void\n}>(getAccessor: () => Accessor): [Accessor, {update: () => void}] => {\n\tconst [state, setState] = useState<Accessor>(() => getAccessor())\n\tconst getterRef = useRef(getAccessor)\n\n\tlet accessor = state\n\tif (getterRef.current !== getAccessor) {\n\t\taccessor = getAccessor()\n\t\tsetState(accessor)\n\t\tgetterRef.current = getAccessor\n\t}\n\n\tuseEffect(() => {\n\t\tlet isStillSubscribed = true\n\t\tconst unsubscribe = getAccessor().addEventListener({ type: 'update' }, newAccessor => {\n\t\t\tif (!isStillSubscribed || getterRef.current !== getAccessor) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetState(newAccessor)\n\t\t})\n\n\t\treturn () => {\n\t\t\tisStillSubscribed = false\n\t\t\tunsubscribe()\n\t\t}\n\t}, [getAccessor])\n\n\tconst update = useCallback(() => {\n\t\tsetState(getAccessor())\n\t}, [getAccessor])\n\n\treturn [accessor, { update }]\n}\n"],"names":[],"mappings":";AAKa,MAAA,gCAAgC,CAE1C,gBAAkE;AACpE,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAmB,MAAM,aAAa;AAC1D,QAAA,YAAY,OAAO,WAAW;AAEpC,MAAI,WAAW;AACX,MAAA,UAAU,YAAY,aAAa;AACtC,eAAW,YAAY;AACvB,aAAS,QAAQ;AACjB,cAAU,UAAU;AAAA,
|
|
1
|
+
{"version":3,"file":"useAccessorUpdateSubscription.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useAccessorUpdateSubscription.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react'\n\n/**\n * It is VERY IMPORTANT for the parameter to be referentially stable!\n */\nexport const useAccessorUpdateSubscription = <Accessor extends {\n\taddEventListener: (event: { type: 'update' }, cb: (accessor: Accessor) => void) => () => void\n}>(getAccessor: () => Accessor): [Accessor, {update: () => void}] => {\n\tconst [state, setState] = useState<Accessor>(() => getAccessor())\n\tconst getterRef = useRef(getAccessor)\n\n\tlet accessor = state\n\tif (getterRef.current !== getAccessor) {\n\t\taccessor = getAccessor()\n\t\tsetState(accessor)\n\t\tgetterRef.current = getAccessor\n\t}\n\n\tuseEffect(() => {\n\t\tlet isStillSubscribed = true\n\t\tconst unsubscribe = getAccessor().addEventListener({ type: 'update' }, newAccessor => {\n\t\t\tif (!isStillSubscribed || getterRef.current !== getAccessor) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetState(newAccessor)\n\t\t})\n\n\t\treturn () => {\n\t\t\tisStillSubscribed = false\n\t\t\tunsubscribe()\n\t\t}\n\t}, [getAccessor])\n\n\tconst update = useCallback(() => {\n\t\tsetState(getAccessor())\n\t}, [getAccessor])\n\n\treturn [accessor, { update }]\n}\n"],"names":[],"mappings":";AAKa,MAAA,gCAAgC,CAE1C,gBAAkE;AACpE,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAmB,MAAM,aAAa;AAC1D,QAAA,YAAY,OAAO,WAAW;AAEpC,MAAI,WAAW;AACX,MAAA,UAAU,YAAY,aAAa;AACtC,eAAW,YAAY;AACvB,aAAS,QAAQ;AACjB,cAAU,UAAU;AAAA,EAAA;AAGrB,YAAU,MAAM;AACf,QAAI,oBAAoB;AAClB,UAAA,cAAc,cAAc,iBAAiB,EAAE,MAAM,SAAA,GAAY,CAAe,gBAAA;AACrF,UAAI,CAAC,qBAAqB,UAAU,YAAY,aAAa;AAC5D;AAAA,MAAA;AAED,eAAS,WAAW;AAAA,IAAA,CACpB;AAED,WAAO,MAAM;AACQ,0BAAA;AACR,kBAAA;AAAA,IACb;AAAA,EAAA,GACE,CAAC,WAAW,CAAC;AAEV,QAAA,SAAS,YAAY,MAAM;AAChC,aAAS,aAAa;AAAA,EAAA,GACpB,CAAC,WAAW,CAAC;AAEhB,SAAO,CAAC,UAAU,EAAE,QAAQ;AAC7B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined = undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAcA,eAAAA;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined = undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAcA,eAAAA,eAAe;AAEnC,MAAI,oBAA2D;AAC3D,MAAA;AAEJ,MAAI,8BAA8B,QAAW;AAClC,cAAA;AAAA,EAAA,WACA,OAAO,8BAA8B,UAAU;AAC/C,cAAA;AACU,wBAAA;AAAA,MACnB,OAAO;AAAA,IACR;AAAA,EAAA,OACM;AACI,cAAA;AACU,wBAAA;AAAA,EAAA;AAGd,SAAAC,MAAA;AAAA,IACN,MACC,UACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,aAAa,mBAAmB;AAAA,QAChC,cAAc,mBAAmB;AAAA,QACjC,QAAQ,mBAAmB;AAAA,QAC3B,OAAO,mBAAmB;AAAA,QAC1B,SAAS,mBAAmB;AAAA,MAC7B;AAAA,MACA;AAAA,IAEC,IAAA;AAAA;AAAA,IAEJ;AAAA,MACC,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA;AAAA,EAEF;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined = undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":[],"mappings":";;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList,\n): RelativeEntityList\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined\n/**\n * @deprecated Use useEntityList instead.\n */\nfunction useDesugaredRelativeEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): RelativeEntityList | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeEntityList | undefined = undefined\n\tlet hasList: boolean\n\n\tif (sugaredRelativeEntityList === undefined) {\n\t\thasList = false\n\t} else if (typeof sugaredRelativeEntityList === 'string') {\n\t\thasList = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeEntityList,\n\t\t}\n\t} else {\n\t\thasList = true\n\t\tnormalizedSugared = sugaredRelativeEntityList\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasList\n\t\t\t\t? QueryLanguage.desugarRelativeEntityList(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[\n\t\t\tnormalizedSugared?.field,\n\t\t\tnormalizedSugared?.setOnCreate,\n\t\t\tnormalizedSugared?.isNonbearing,\n\t\t\tnormalizedSugared?.offset,\n\t\t\tnormalizedSugared?.limit,\n\t\t\tnormalizedSugared?.orderBy,\n\t\t\thasList,\n\t\t\tenvironment,\n\t\t],\n\t)\n}\n\nexport { useDesugaredRelativeEntityList }\n"],"names":[],"mappings":";;;AAoBA,SAAS,+BACR,2BACiC;AACjC,QAAM,cAAc,eAAe;AAEnC,MAAI,oBAA2D;AAC3D,MAAA;AAEJ,MAAI,8BAA8B,QAAW;AAClC,cAAA;AAAA,EAAA,WACA,OAAO,8BAA8B,UAAU;AAC/C,cAAA;AACU,wBAAA;AAAA,MACnB,OAAO;AAAA,IACR;AAAA,EAAA,OACM;AACI,cAAA;AACU,wBAAA;AAAA,EAAA;AAGd,SAAA;AAAA,IACN,MACC,UACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,aAAa,mBAAmB;AAAA,QAChC,cAAc,mBAAmB;AAAA,QACjC,QAAQ,mBAAmB;AAAA,QAC3B,OAAO,mBAAmB;AAAA,QAC1B,SAAS,mBAAmB;AAAA,MAC7B;AAAA,MACA;AAAA,IAEC,IAAA;AAAA;AAAA,IAEJ;AAAA,MACC,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,IAAA;AAAA,EAEF;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined = undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAcA,eAAAA;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined = undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAcA,eAAAA,eAAe;AAEnC,MAAI,oBAA6D;AAC7D,MAAA;AAEJ,MAAI,gCAAgC,QAAW;AAClC,gBAAA;AAAA,EAAA,WACF,OAAO,gCAAgC,UAAU;AAC/C,gBAAA;AACQ,wBAAA;AAAA,MACnB,OAAO;AAAA,IACR;AAAA,EAAA,OACM;AACM,gBAAA;AACQ,wBAAA;AAAA,EAAA;AAGd,SAAAC,MAAA;AAAA,IACN,MACC,YACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MACjC;AAAA,MACA;AAAA,IAEC,IAAA;AAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EACnH;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined = undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":[],"mappings":";;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity,\n): RelativeSingleEntity\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined\n/**\n * @deprecated Use useEntity instead.\n */\nfunction useDesugaredRelativeSingleEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): RelativeSingleEntity | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleEntity | undefined = undefined\n\tlet hasEntity: boolean\n\n\tif (sugaredRelativeSingleEntity === undefined) {\n\t\thasEntity = false\n\t} else if (typeof sugaredRelativeSingleEntity === 'string') {\n\t\thasEntity = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleEntity,\n\t\t}\n\t} else {\n\t\thasEntity = true\n\t\tnormalizedSugared = sugaredRelativeSingleEntity\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasEntity\n\t\t\t\t? QueryLanguage.desugarRelativeSingleEntity(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity],\n\t)\n}\n\nexport { useDesugaredRelativeSingleEntity }\n"],"names":[],"mappings":";;;AAoBA,SAAS,iCACR,6BACmC;AACnC,QAAM,cAAc,eAAe;AAEnC,MAAI,oBAA6D;AAC7D,MAAA;AAEJ,MAAI,gCAAgC,QAAW;AAClC,gBAAA;AAAA,EAAA,WACF,OAAO,gCAAgC,UAAU;AAC/C,gBAAA;AACQ,wBAAA;AAAA,MACnB,OAAO;AAAA,IACR;AAAA,EAAA,OACM;AACM,gBAAA;AACQ,wBAAA;AAAA,EAAA;AAGd,SAAA;AAAA,IACN,MACC,YACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MACjC;AAAA,MACA;AAAA,IAEC,IAAA;AAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EACnH;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined = undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAcA,eAAAA;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleField.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined = undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":["useEnvironment","useMemo","QueryLanguage"],"mappings":";;;;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAcA,eAAAA,eAAe;AAEnC,MAAI,oBAA4D;AAC5D,MAAA;AAEJ,MAAI,+BAA+B,QAAW;AAClC,eAAA;AAAA,EAAA,WACD,OAAO,+BAA+B,UAAU;AAC/C,eAAA;AACS,wBAAA;AAAA,MACnB,OAAO;AAAA,IACR;AAAA,EAAA,OACM;AACK,eAAA;AACS,wBAAA;AAAA,EAAA;AAGd,SAAAC,MAAA;AAAA,IACN,MACC,WACGC,QAAAA,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAClC;AAAA,MACA;AAAA,IAEC,IAAA;AAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EACnH;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined = undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":[],"mappings":";;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '@contember/binding'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '@contember/binding'\nimport { useEnvironment } from './useEnvironment'\n\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): RelativeSingleField\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined\n/**\n * @deprecated Use useField instead.\n */\nfunction useDesugaredRelativeSingleField(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): RelativeSingleField | undefined {\n\tconst environment = useEnvironment()\n\n\tlet normalizedSugared: SugaredRelativeSingleField | undefined = undefined\n\tlet hasField: boolean\n\n\tif (sugaredRelativeSingleField === undefined) {\n\t\thasField = false\n\t} else if (typeof sugaredRelativeSingleField === 'string') {\n\t\thasField = true\n\t\tnormalizedSugared = {\n\t\t\tfield: sugaredRelativeSingleField,\n\t\t}\n\t} else {\n\t\thasField = true\n\t\tnormalizedSugared = sugaredRelativeSingleField\n\t}\n\n\treturn useMemo(\n\t\t() =>\n\t\t\thasField\n\t\t\t\t? QueryLanguage.desugarRelativeSingleField(\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t},\n\t\t\t\t\tenvironment,\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField],\n\t)\n}\n\nexport { useDesugaredRelativeSingleField }\n"],"names":[],"mappings":";;;AAoBA,SAAS,gCACR,4BACkC;AAClC,QAAM,cAAc,eAAe;AAEnC,MAAI,oBAA4D;AAC5D,MAAA;AAEJ,MAAI,+BAA+B,QAAW;AAClC,eAAA;AAAA,EAAA,WACD,OAAO,+BAA+B,UAAU;AAC/C,eAAA;AACS,wBAAA;AAAA,MACnB,OAAO;AAAA,IACR;AAAA,EAAA,OACM;AACK,eAAA;AACS,wBAAA;AAAA,EAAA;AAGd,SAAA;AAAA,IACN,MACC,WACG,cAAc;AAAA,MACf;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAClC;AAAA,MACA;AAAA,IAEC,IAAA;AAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EACnH;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useAccessorUpdateSubscription","useDesugaredRelativeSingleEntity","useConstantLengthInvariant","entity","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAcA,SAAS,aAAa,QAA6F;AACxFA,
|
|
1
|
+
{"version":3,"file":"useEntity.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useAccessorUpdateSubscription","useDesugaredRelativeSingleEntity","useConstantLengthInvariant","entity","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAcA,SAAS,aAAa,QAA6F;AACxFA,uCAAA,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAYC,aAAAA,aAAa;AAC/B,QAAM,iBAAiBC,kBAAAA,kBAAkB;AAErC,MAAA,OAAO,WAAW,GAAG;AAElB,UAAA,oBAAoBC,kBAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAE3F,WAAAC,8BAAA,8BAA8B,iBAAiB,EAAE,CAAC;AAAA,EAAA;AAEpD,QAAA,8BAA8B,OAAO,CAAC;AAGtC,QAAA,uBAAuBC,kEAAiC,2BAA2B;AAEnF,QAAA,YAAYF,MAAAA,YAAY,MAAM;AAC7B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,UAAU,oBAAqB;AAAA,EAC3C,GAAA,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AAEzBG,eAAA;AAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IACD;AAEA,UAAM,CAACC,SAAQ,EAAE,OAAQ,CAAA,IAAIH,8BAAAA,8BAA8B,SAAS;AAEhE,QAAA,qBAAqB,mBAAmB,QAAQ;AAEnDI,4BAAA,sBAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAAA;AAGxED,WAAAA;AAAAA,EAAA;AAED,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["entity"],"mappings":";;;;;;;AAcA,SAAS,aAAa,QAA6F;AACxF,4BAAA,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAY;
|
|
1
|
+
{"version":3,"file":"useEntity.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleEntity } from './useDesugaredRelativeSingleEntity'\n\nfunction useEntity(): EntityAccessor\nfunction useEntity(sugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity): EntityAccessor\nfunction useEntity(\n\tsugaredRelativeSingleEntity: string | SugaredRelativeSingleEntity | undefined,\n): EntityAccessor | undefined\nfunction useEntity(...entity: [] | [string | SugaredRelativeSingleEntity | undefined]): EntityAccessor | undefined {\n\tuseConstantValueInvariant(entity.length, 'useEntity: cannot alternate between providing and omitting the argument.')\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\n\tif (entity.length === 0) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst getEntityAccessor = useCallback(() => getEntityByKey(entityKey), [entityKey, getEntityByKey])\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useAccessorUpdateSubscription(getEntityAccessor)[0]\n\t}\n\tconst sugaredRelativeSingleEntity = entity[0]\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst relativeSingleEntity = useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity)\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst getEntity = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntity(relativeSingleEntity!)\n\t}, [entityKey, getEntityByKey, relativeSingleEntity])\n\n\tif (relativeSingleEntity) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleEntity.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entity, { update }] = useAccessorUpdateSubscription(getEntity)\n\n\t\tif (relativeSingleEntity.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleEntity.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entity\n\t}\n\treturn undefined\n}\n\nexport { useEntity }\n"],"names":["entity"],"mappings":";;;;;;;AAcA,SAAS,aAAa,QAA6F;AACxF,4BAAA,OAAO,QAAQ,0EAA0E;AAEnH,QAAM,YAAY,aAAa;AAC/B,QAAM,iBAAiB,kBAAkB;AAErC,MAAA,OAAO,WAAW,GAAG;AAElB,UAAA,oBAAoB,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAE3F,WAAA,8BAA8B,iBAAiB,EAAE,CAAC;AAAA,EAAA;AAEpD,QAAA,8BAA8B,OAAO,CAAC;AAGtC,QAAA,uBAAuB,iCAAiC,2BAA2B;AAEnF,QAAA,YAAY,YAAY,MAAM;AAC7B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,UAAU,oBAAqB;AAAA,EAC3C,GAAA,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AAEzB;AAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IACD;AAEA,UAAM,CAACA,SAAQ,EAAE,OAAQ,CAAA,IAAI,8BAA8B,SAAS;AAEhE,QAAA,qBAAqB,mBAAmB,QAAQ;AAEnD,4BAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAAA;AAGxEA,WAAAA;AAAAA,EAAA;AAED,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> ` +\n\t\t\t\t`or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":["useContext","EntityKeyContext","BindingError"],"mappings":";;;;;AAIO,MAAM,eAAe,MAAuC;AAC5D,QAAA,YAAYA,iBAAWC,
|
|
1
|
+
{"version":3,"file":"useEntityKey.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> ` +\n\t\t\t\t`or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":["useContext","EntityKeyContext","BindingError"],"mappings":";;;;;AAIO,MAAM,eAAe,MAAuC;AAC5D,QAAA,YAAYA,iBAAWC,iCAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAIC,QAAA;AAAA,MACT;AAAA,IAED;AAAA,EAAA;AAEM,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> ` +\n\t\t\t\t`or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,MAAuC;AAC5D,QAAA,YAAY,WAAW,gBAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAI;AAAA,MACT;AAAA,
|
|
1
|
+
{"version":3,"file":"useEntityKey.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityKey.ts"],"sourcesContent":["import { useContext } from 'react'\nimport { BindingError, EntityAccessor } from '@contember/binding'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport const useEntityKey = (): string | (() => EntityAccessor) => {\n\tconst entityKey = useContext(EntityKeyContext)\n\n\tif (entityKey === undefined) {\n\t\tthrow new BindingError(\n\t\t\t`Trying to use a data bound component outside a correct parent. You likely forgot to use <DataBindingProvider /> ` +\n\t\t\t\t`or a SubTree.`,\n\t\t)\n\t}\n\treturn entityKey\n}\n"],"names":[],"mappings":";;;AAIO,MAAM,eAAe,MAAuC;AAC5D,QAAA,YAAY,WAAW,gBAAgB;AAE7C,MAAI,cAAc,QAAW;AAC5B,UAAM,IAAI;AAAA,MACT;AAAA,IAED;AAAA,EAAA;AAEM,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":["useDesugaredRelativeEntityList","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqBA,8DAA+B,yBAAyB;AACnFC,aAAA;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,
|
|
1
|
+
{"version":3,"file":"useEntityList.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":["useDesugaredRelativeEntityList","useConstantValueInvariant","useEntityKey","useGetEntityByKey","useCallback","useConstantLengthInvariant","useAccessorUpdateSubscription","useOnConnectionUpdate"],"mappings":";;;;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqBA,8DAA+B,yBAAyB;AACnFC,aAAA;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EACD;AAEA,QAAM,YAAYC,aAAAA,aAAa;AAC/B,QAAM,iBAAiBC,kBAAAA,kBAAkB;AACnC,QAAA,gBAAgBC,MAAAA,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,cAAc,kBAAmB;AAAA,EAC7C,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvBC,eAAA;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IACD;AAEA,UAAM,CAAC,YAAY,EAAE,OAAQ,CAAA,IAAIC,8BAAAA,8BAA8B,aAAa;AAExE,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjDC,4BAAA,sBAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAAA;AAGtE,WAAA;AAAA,EAAA;AAED,SAAA;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,
|
|
1
|
+
{"version":3,"file":"useEntityList.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from './index'\nimport type { EntityListAccessor } from '@contember/binding'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeEntityList } from './useDesugaredRelativeEntityList'\n\nfunction useEntityList(sugaredRelativeEntityList: string | SugaredRelativeEntityList): EntityListAccessor\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined\nfunction useEntityList(\n\tsugaredRelativeEntityList: string | SugaredRelativeEntityList | undefined,\n): EntityListAccessor | undefined {\n\tconst relativeEntityList = useDesugaredRelativeEntityList(sugaredRelativeEntityList)\n\tuseConstantValueInvariant(\n\t\t!!relativeEntityList,\n\t\t'useEntityList: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getEntityList = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getEntityList(relativeEntityList!)\n\t}, [entityKey, getEntityByKey, relativeEntityList])\n\n\tif (relativeEntityList) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeEntityList.hasOneRelationPath,\n\t\t\t'Cannot change the length of the hasOneRelation path!',\n\t\t)\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tconst [entityList, { update }] = useAccessorUpdateSubscription(getEntityList)\n\n\t\tif (relativeEntityList.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeEntityList.hasOneRelationPath[0].field, update)\n\t\t}\n\n\t\treturn entityList\n\t}\n\treturn undefined\n}\n\nexport { useEntityList }\n"],"names":[],"mappings":";;;;;;;AAaA,SAAS,cACR,2BACiC;AAC3B,QAAA,qBAAqB,+BAA+B,yBAAyB;AACnF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EACD;AAEA,QAAM,YAAY,aAAa;AAC/B,QAAM,iBAAiB,kBAAkB;AACnC,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,cAAc,kBAAmB;AAAA,EAC7C,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IACD;AAEA,UAAM,CAAC,YAAY,EAAE,OAAQ,CAAA,IAAI,8BAA8B,aAAa;AAExE,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,MAAM;AAAA,IAAA;AAGtE,WAAA;AAAA,EAAA;AAED,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA;
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntityListSubTree","useEntityListSubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAaA,wBAAAA,wBAAwB;AACrC,QAAA,aAAaC,8DAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAC9C;AAMO,SAAAC,8BAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '@contember/binding'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '@contember/binding'\n\nexport const useEntityListSubTree = (\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityListAccessor => {\n\tconst getSubTree = useGetEntityListSubTree()\n\tconst parameters = useEntityListSubTreeParameters(qualifiedEntityList)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.value.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntityListSubTree: cannot use hasOneRelationPath!`)\n\t// }\n\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa,wBAAwB;AACrC,QAAA,aAAa,+BAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAC9C;AAMO,SAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntityListSubTree","useCallback"],"mappings":";;;;;;AA6DA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntityListSubTree","useCallback"],"mappings":";;;;;;AA6DA,MAAM,cAAc,CAAC;AAEd,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAAoG;AAC5N,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAAiD;AAAA,IAC5F,OAAO;AAAA,IACP,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAGtB;AAEH,QAAM,aAAaC,cAAAA,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AAChE,QAAA,mBAAmBG,WAAAA,cAAc,YAAY,WAAW;AACxD,QAAA,mBAAmB,WAAW,mBAAmB;AAEvDC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,kBAAkB;AACtB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;AAAA,MACD;AAEA,wBAAkB,CAAM,OAAA;AACnB,YAAA,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AACvE,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA,OACM;AACC,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA;AAAA,MACD,CACA;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,kBAAAA,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAK,MAAA;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAET,8BAAA;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAEA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAE1D,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA6DA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedEntityList, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntityListSubTree } from '../coreComponents'\nimport { useEnvironment } from './useEnvironment'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntityListSubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntityListSubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntityListSubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentities: SugaredQualifiedEntityList\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntityListSubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentities: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntityListSubTreeLoaderState<State> =\n\t| UseEntityListSubTreeLoaderStateInitial\n\t| UseEntityListSubTreeLoaderStateLoading\n\t| UseEntityListSubTreeLoaderStateRefreshing<State>\n\t| UseEntityListSubTreeLoaderStateLoaded<State>\n\t| UseEntityListSubTreeLoaderStateFailed\n\nexport type UseEntityListSubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedEntityList\n\nexport const useEntityListSubTreeLoader = <State>(entities: SugaredQualifiedEntityList | undefined, children: ReactNode, state?: State): [UseEntityListSubTreeLoaderState<State>, UseEntityListSubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntityListSubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentities: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentities: SugaredQualifiedEntityList\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntities = useObjectMemo(entities ?? emptyObject)\n\tconst resolvedEntities = entities ? memoizedEntities : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntities) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentities: resolvedEntities,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntityListSubTree, {\n\t\t\t\t\t...resolvedEntities,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentities: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentities: resolvedEntities,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntities, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA6DA,MAAM,cAAc,CAAC;AAEd,MAAM,6BAA6B,CAAQ,UAAkD,UAAqB,UAAoG;AAC5N,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAiD;AAAA,IAC5F,OAAO;AAAA,IACP,WAAW;AAAA,IACX,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmB,OAGtB;AAEH,QAAM,aAAa,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AAChE,QAAA,mBAAmB,cAAc,YAAY,WAAW;AACxD,QAAA,mBAAmB,WAAW,mBAAmB;AAEvD,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,kBAAkB;AACtB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,UAAU;AAAA,QACV;AAAA,MACD;AAEA,wBAAkB,CAAM,OAAA;AACnB,YAAA,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AACvE,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA,OACM;AACC,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA;AAAA,MACD,CACA;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,mBAAmB;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAK,MAAA;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAET,8BAAA;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,UAAU;AAAA,cACV,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAEA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,kBAAkB,UAAU,OAAO,aAAa,CAAC;AAE1D,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTreeParameters.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\n\nexport function useEntityListSubTreeParameters(alias: Alias): Alias\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList {\n\tuseConstantValueInvariant(typeof qualifiedEntityList)\n\n\tif (typeof qualifiedEntityList === 'string') {\n\t\treturn qualifiedEntityList\n\t}\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\tqualifiedEntityList.isCreating,\n\t\t`EntityListSubTree: cannot alternate the 'isCreating' value.`,\n\t)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\ttypeof qualifiedEntityList.entities,\n\t\t`EntityListSubTree: cannot alternate the 'entities' value.`,\n\t)\n\n\tif (qualifiedEntityList.isCreating) {\n\t\tconst entities = qualifiedEntityList.entities\n\n\t\tif (typeof entities === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentities,\n\t\t\t\t}),\n\t\t\t\t[entities],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentities: { entityName: entities.entityName },\n\t\t\t}),\n\t\t\t[entities.entityName],\n\t\t)\n\t}\n\tconst entities = qualifiedEntityList.entities\n\n\tif (typeof entities === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tentities: entities,\n\t\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\t\toffset: qualifiedEntityList.offset,\n\t\t\t\tlimit: qualifiedEntityList.limit,\n\t\t\t}),\n\t\t\t[entities, qualifiedEntityList.limit, qualifiedEntityList.offset, qualifiedEntityList.orderBy],\n\t\t)\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentities: {\n\t\t\t\tentityName: entities.entityName,\n\t\t\t\tfilter: entities.filter,\n\t\t\t},\n\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\toffset: qualifiedEntityList.offset,\n\t\t\tlimit: qualifiedEntityList.limit,\n\t\t}),\n\t\t[\n\t\t\tentities.entityName,\n\t\t\tentities.filter,\n\t\t\tqualifiedEntityList.limit,\n\t\t\tqualifiedEntityList.offset,\n\t\t\tqualifiedEntityList.orderBy,\n\t\t],\n\t)\n}\n"],"names":["useConstantValueInvariant","entities","useMemo"],"mappings":";;;;AAWO,SAAS,+BACf,qBAC+E;AAC/EA,aAAA,0BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeParameters.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\n\nexport function useEntityListSubTreeParameters(alias: Alias): Alias\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList {\n\tuseConstantValueInvariant(typeof qualifiedEntityList)\n\n\tif (typeof qualifiedEntityList === 'string') {\n\t\treturn qualifiedEntityList\n\t}\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\tqualifiedEntityList.isCreating,\n\t\t`EntityListSubTree: cannot alternate the 'isCreating' value.`,\n\t)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\ttypeof qualifiedEntityList.entities,\n\t\t`EntityListSubTree: cannot alternate the 'entities' value.`,\n\t)\n\n\tif (qualifiedEntityList.isCreating) {\n\t\tconst entities = qualifiedEntityList.entities\n\n\t\tif (typeof entities === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentities,\n\t\t\t\t}),\n\t\t\t\t[entities],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentities: { entityName: entities.entityName },\n\t\t\t}),\n\t\t\t[entities.entityName],\n\t\t)\n\t}\n\tconst entities = qualifiedEntityList.entities\n\n\tif (typeof entities === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tentities: entities,\n\t\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\t\toffset: qualifiedEntityList.offset,\n\t\t\t\tlimit: qualifiedEntityList.limit,\n\t\t\t}),\n\t\t\t[entities, qualifiedEntityList.limit, qualifiedEntityList.offset, qualifiedEntityList.orderBy],\n\t\t)\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentities: {\n\t\t\t\tentityName: entities.entityName,\n\t\t\t\tfilter: entities.filter,\n\t\t\t},\n\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\toffset: qualifiedEntityList.offset,\n\t\t\tlimit: qualifiedEntityList.limit,\n\t\t}),\n\t\t[\n\t\t\tentities.entityName,\n\t\t\tentities.filter,\n\t\t\tqualifiedEntityList.limit,\n\t\t\tqualifiedEntityList.offset,\n\t\t\tqualifiedEntityList.orderBy,\n\t\t],\n\t)\n}\n"],"names":["useConstantValueInvariant","entities","useMemo"],"mappings":";;;;AAWO,SAAS,+BACf,qBAC+E;AAC/EA,aAAA,0BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,EAAA;AAIRA,aAAA;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EACD;AAGAA,aAAA;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EACD;AAEA,MAAI,oBAAoB,YAAY;AACnC,UAAMC,YAAW,oBAAoB;AAEjC,QAAA,OAAOA,cAAa,UAAU;AAE1B,aAAAC,MAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,UAAAD;AAAAA,QAAA;AAAA,QAED,CAACA,SAAQ;AAAA,MACV;AAAA,IAAA;AAGM,WAAAC,MAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYD,UAAS,WAAW;AAAA,MAAA;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IACrB;AAAA,EAAA;AAED,QAAM,WAAW,oBAAoB;AAEjC,MAAA,OAAO,aAAa,UAAU;AAE1B,WAAAC,MAAA;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA,SAAS,oBAAoB;AAAA,QAC7B,QAAQ,oBAAoB;AAAA,QAC5B,OAAO,oBAAoB;AAAA,MAAA;AAAA,MAE5B,CAAC,UAAU,oBAAoB,OAAO,oBAAoB,QAAQ,oBAAoB,OAAO;AAAA,IAC9F;AAAA,EAAA;AAGM,SAAAA,MAAA;AAAA,IACN,OAAO;AAAA,MACN,UAAU;AAAA,QACT,YAAY,SAAS;AAAA,QACrB,QAAQ,SAAS;AAAA,MAClB;AAAA,MACA,SAAS,oBAAoB;AAAA,MAC7B,QAAQ,oBAAoB;AAAA,MAC5B,OAAO,oBAAoB;AAAA,IAAA;AAAA,IAE5B;AAAA,MACC,SAAS;AAAA,MACT,SAAS;AAAA,MACT,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,IAAA;AAAA,EAEtB;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTreeParameters.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\n\nexport function useEntityListSubTreeParameters(alias: Alias): Alias\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList {\n\tuseConstantValueInvariant(typeof qualifiedEntityList)\n\n\tif (typeof qualifiedEntityList === 'string') {\n\t\treturn qualifiedEntityList\n\t}\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\tqualifiedEntityList.isCreating,\n\t\t`EntityListSubTree: cannot alternate the 'isCreating' value.`,\n\t)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\ttypeof qualifiedEntityList.entities,\n\t\t`EntityListSubTree: cannot alternate the 'entities' value.`,\n\t)\n\n\tif (qualifiedEntityList.isCreating) {\n\t\tconst entities = qualifiedEntityList.entities\n\n\t\tif (typeof entities === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentities,\n\t\t\t\t}),\n\t\t\t\t[entities],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentities: { entityName: entities.entityName },\n\t\t\t}),\n\t\t\t[entities.entityName],\n\t\t)\n\t}\n\tconst entities = qualifiedEntityList.entities\n\n\tif (typeof entities === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tentities: entities,\n\t\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\t\toffset: qualifiedEntityList.offset,\n\t\t\t\tlimit: qualifiedEntityList.limit,\n\t\t\t}),\n\t\t\t[entities, qualifiedEntityList.limit, qualifiedEntityList.offset, qualifiedEntityList.orderBy],\n\t\t)\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentities: {\n\t\t\t\tentityName: entities.entityName,\n\t\t\t\tfilter: entities.filter,\n\t\t\t},\n\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\toffset: qualifiedEntityList.offset,\n\t\t\tlimit: qualifiedEntityList.limit,\n\t\t}),\n\t\t[\n\t\t\tentities.entityName,\n\t\t\tentities.filter,\n\t\t\tqualifiedEntityList.limit,\n\t\t\tqualifiedEntityList.offset,\n\t\t\tqualifiedEntityList.orderBy,\n\t\t],\n\t)\n}\n"],"names":["entities"],"mappings":";;AAWO,SAAS,+BACf,qBAC+E;AAC/E,4BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"useEntityListSubTreeParameters.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntityListSubTreeParameters.ts"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { useMemo } from 'react'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '@contember/binding'\n\nexport function useEntityListSubTreeParameters(alias: Alias): Alias\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityListOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList\nexport function useEntityListSubTreeParameters(\n\tqualifiedEntityList: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n): Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList {\n\tuseConstantValueInvariant(typeof qualifiedEntityList)\n\n\tif (typeof qualifiedEntityList === 'string') {\n\t\treturn qualifiedEntityList\n\t}\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\tqualifiedEntityList.isCreating,\n\t\t`EntityListSubTree: cannot alternate the 'isCreating' value.`,\n\t)\n\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tuseConstantValueInvariant(\n\t\ttypeof qualifiedEntityList.entities,\n\t\t`EntityListSubTree: cannot alternate the 'entities' value.`,\n\t)\n\n\tif (qualifiedEntityList.isCreating) {\n\t\tconst entities = qualifiedEntityList.entities\n\n\t\tif (typeof entities === 'string') {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\treturn useMemo(\n\t\t\t\t() => ({\n\t\t\t\t\tisCreating: true,\n\t\t\t\t\tentities,\n\t\t\t\t}),\n\t\t\t\t[entities],\n\t\t\t)\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tisCreating: true,\n\t\t\t\tentities: { entityName: entities.entityName },\n\t\t\t}),\n\t\t\t[entities.entityName],\n\t\t)\n\t}\n\tconst entities = qualifiedEntityList.entities\n\n\tif (typeof entities === 'string') {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\treturn useMemo(\n\t\t\t() => ({\n\t\t\t\tentities: entities,\n\t\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\t\toffset: qualifiedEntityList.offset,\n\t\t\t\tlimit: qualifiedEntityList.limit,\n\t\t\t}),\n\t\t\t[entities, qualifiedEntityList.limit, qualifiedEntityList.offset, qualifiedEntityList.orderBy],\n\t\t)\n\t}\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\treturn useMemo(\n\t\t() => ({\n\t\t\tentities: {\n\t\t\t\tentityName: entities.entityName,\n\t\t\t\tfilter: entities.filter,\n\t\t\t},\n\t\t\torderBy: qualifiedEntityList.orderBy,\n\t\t\toffset: qualifiedEntityList.offset,\n\t\t\tlimit: qualifiedEntityList.limit,\n\t\t}),\n\t\t[\n\t\t\tentities.entityName,\n\t\t\tentities.filter,\n\t\t\tqualifiedEntityList.limit,\n\t\t\tqualifiedEntityList.offset,\n\t\t\tqualifiedEntityList.orderBy,\n\t\t],\n\t)\n}\n"],"names":["entities"],"mappings":";;AAWO,SAAS,+BACf,qBAC+E;AAC/E,4BAA0B,OAAO,mBAAmB;AAEhD,MAAA,OAAO,wBAAwB,UAAU;AACrC,WAAA;AAAA,EAAA;AAIR;AAAA,IACC,oBAAoB;AAAA,IACpB;AAAA,EACD;AAGA;AAAA,IACC,OAAO,oBAAoB;AAAA,IAC3B;AAAA,EACD;AAEA,MAAI,oBAAoB,YAAY;AACnC,UAAMA,YAAW,oBAAoB;AAEjC,QAAA,OAAOA,cAAa,UAAU;AAE1B,aAAA;AAAA,QACN,OAAO;AAAA,UACN,YAAY;AAAA,UACZ,UAAAA;AAAAA,QAAA;AAAA,QAED,CAACA,SAAQ;AAAA,MACV;AAAA,IAAA;AAGM,WAAA;AAAA,MACN,OAAO;AAAA,QACN,YAAY;AAAA,QACZ,UAAU,EAAE,YAAYA,UAAS,WAAW;AAAA,MAAA;AAAA,MAE7C,CAACA,UAAS,UAAU;AAAA,IACrB;AAAA,EAAA;AAED,QAAM,WAAW,oBAAoB;AAEjC,MAAA,OAAO,aAAa,UAAU;AAE1B,WAAA;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA,SAAS,oBAAoB;AAAA,QAC7B,QAAQ,oBAAoB;AAAA,QAC5B,OAAO,oBAAoB;AAAA,MAAA;AAAA,MAE5B,CAAC,UAAU,oBAAoB,OAAO,oBAAoB,QAAQ,oBAAoB,OAAO;AAAA,IAC9F;AAAA,EAAA;AAGM,SAAA;AAAA,IACN,OAAO;AAAA,MACN,UAAU;AAAA,QACT,YAAY,SAAS;AAAA,QACrB,QAAQ,SAAS;AAAA,MAClB;AAAA,MACA,SAAS,oBAAoB;AAAA,MAC7B,QAAQ,oBAAoB;AAAA,MAC5B,OAAO,oBAAoB;AAAA,IAAA;AAAA,IAE5B;AAAA,MACC,SAAS;AAAA,MACT,SAAS;AAAA,MACT,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,IAAA;AAAA,EAEtB;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntitySubTree","useEntitySubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAOa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA;
|
|
1
|
+
{"version":3,"file":"useEntitySubTree.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":["useGetEntitySubTree","useEntitySubTreeParameters","useCallback","useAccessorUpdateSubscription"],"mappings":";;;;;;AAOa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAaA,oBAAAA,oBAAoB;AACjC,QAAA,aAAaC,sDAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAcC,MAAA;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAC9C;AAKO,SAAAC,8BAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAOa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"useEntitySubTree.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { Alias, EntityAccessor, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '@contember/binding'\nimport { TreeRootId } from '@contember/binding'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\n\nexport const useEntitySubTree = (\n\tqualifiedSingleEntity: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n): EntityAccessor => {\n\tconst getSubTree = useGetEntitySubTree()\n\tconst parameters = useEntitySubTreeParameters(qualifiedSingleEntity)\n\tconst hasTreeId = treeId.length > 0\n\tconst treeIdVal = treeId[0]\n\tconst getAccessor = useCallback(\n\t\t() => getSubTree(parameters, ...(hasTreeId ? [treeIdVal] : [])),\n\t\t[getSubTree, hasTreeId, parameters, treeIdVal],\n\t)\n\n\t// if (typeof parameters !== 'string' && parameters.hasOneRelationPath.length) {\n\t// \tthrow new BindingError(`useEntitySubTree: cannot use hasOneRelationPath!`)\n\t// }\n\treturn useAccessorUpdateSubscription(getAccessor)[0]\n}\n"],"names":[],"mappings":";;;;AAOa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa,oBAAoB;AACjC,QAAA,aAAa,2BAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;AAC5B,QAAA,YAAY,OAAO,CAAC;AAC1B,QAAM,cAAc;AAAA,IACnB,MAAM,WAAW,YAAY,GAAI,YAAY,CAAC,SAAS,IAAI,EAAG;AAAA,IAC9D,CAAC,YAAY,WAAW,YAAY,SAAS;AAAA,EAC9C;AAKO,SAAA,8BAA8B,WAAW,EAAE,CAAC;AACpD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntitySubTree","useCallback"],"mappings":";;;;;;AA8DA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"useEntitySubTreeLoader.cjs","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":["useState","useRef","useExtendTree","useObjectMemo","useEffect","createElement","EntitySubTree","useCallback"],"mappings":";;;;;;AA8DA,MAAM,cAAc,CAAC;AAEd,MAAM,yBAAyB,CAAQ,QAAkD,UAAqB,UAA4F;AAChN,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,eAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmBC,MAAAA,OAGtB;AAEH,QAAM,aAAaC,cAAAA,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAIF,MAAAA,SAAwB,IAAI;AAChE,QAAA,iBAAiBG,WAAAA,cAAc,UAAU,WAAW;AACpD,QAAA,iBAAiB,SAAS,iBAAiB;AAEjDC,QAAAA,UAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,gBAAgB;AACpB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MACD;AAEA,wBAAkB,CAAM,OAAA;AACnB,YAAA,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AACvE,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA,OACM;AACC,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA;AAAA,MACD,CACA;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3BC,MAAAA,cAAcC,cAAAA,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAK,MAAA;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAET,8BAAA;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAGA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAExD,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQC,MAAAA,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA8DA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"useEntitySubTreeLoader.js","sources":["../../../../../packages/react-binding/src/accessorPropagation/useEntitySubTreeLoader.ts"],"sourcesContent":["import { createElement, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport { SugaredQualifiedSingleEntity, TreeRootId } from '@contember/binding'\nimport { useExtendTree } from './useExtendTree'\nimport { EntitySubTree } from '../coreComponents'\nimport { useObjectMemo } from '@contember/react-utils'\n\nexport type UseEntitySubTreeLoaderStateInitial = {\n\tstate: 'initial'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateLoading = {\n\tstate: 'loading'\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: true\n}\n\nexport type UseEntitySubTreeLoaderStateRefreshing<State> = {\n\tstate: 'refreshing'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: true\n}\n\n\nexport type UseEntitySubTreeLoaderStateLoaded<State> = {\n\tstate: 'loaded'\n\tentity: SugaredQualifiedSingleEntity\n\ttreeRootId: TreeRootId | undefined\n\tcustomState: State\n\tisLoading: false\n}\n\nexport type UseEntitySubTreeLoaderStateFailed = {\n\tstate: 'failed'\n\terror: unknown\n\tentity: undefined\n\ttreeRootId: undefined\n\tcustomState: undefined\n\tisLoading: false\n}\n\n\nexport type UseEntitySubTreeLoaderState<State> =\n\t| UseEntitySubTreeLoaderStateInitial\n\t| UseEntitySubTreeLoaderStateLoading\n\t| UseEntitySubTreeLoaderStateRefreshing<State>\n\t| UseEntitySubTreeLoaderStateLoaded<State>\n\t| UseEntitySubTreeLoaderStateFailed\n\nexport type EntityListSubTreeLoaderState = UseEntitySubTreeLoaderState<any>['state']\n\nexport type UseEntitySubTreeLoaderStateMethods = {\n\treload: () => void\n}\n\nconst emptyObject = {} as SugaredQualifiedSingleEntity\n\nexport const useEntitySubTreeLoader = <State>(entity: SugaredQualifiedSingleEntity | undefined, children: ReactNode, state?: State): [UseEntitySubTreeLoaderState<State>, UseEntitySubTreeLoaderStateMethods] => {\n\tconst [displayedState, setDisplayedState] = useState<UseEntitySubTreeLoaderState<State>>({\n\t\tstate: 'initial',\n\t\tisLoading: false,\n\t\tentity: undefined,\n\t\ttreeRootId: undefined,\n\t\tcustomState: undefined,\n\t})\n\tconst currentlyLoading = useRef<{\n\t\tentity: SugaredQualifiedSingleEntity\n\t\tstate?: State\n\t}>()\n\n\tconst extendTree = useExtendTree()\n\tconst [reloadTrigger, setReloadTrigger] = useState<object | null>(null)\n\tconst memoizedEntity = useObjectMemo(entity ?? emptyObject)\n\tconst resolvedEntity = entity ? memoizedEntity : undefined\n\n\tuseEffect(() => {\n\t\t(async () => {\n\t\t\tif (!resolvedEntity) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tcurrentlyLoading.current = {\n\t\t\t\tentity: resolvedEntity,\n\t\t\t\tstate,\n\t\t\t}\n\n\t\t\tsetDisplayedState(it => {\n\t\t\t\tif (it.state === 'initial' || it.state === 'loading' || it.state === 'failed') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'loading',\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...it,\n\t\t\t\t\t\tisLoading: true,\n\t\t\t\t\t\tstate: 'refreshing',\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tconst newTreeRootId = await extendTree(\n\t\t\t\tcreateElement(EntitySubTree, {\n\t\t\t\t\t...resolvedEntity,\n\t\t\t\t\tchildren,\n\t\t\t\t}),\n\t\t\t\t{\n\t\t\t\t\tforce: reloadTrigger !== null,\n\t\t\t\t\tonError: e => {\n\t\t\t\t\t\tconsole.error(e)\n\n\t\t\t\t\t\tcurrentlyLoading.current = undefined\n\n\t\t\t\t\t\tsetDisplayedState({\n\t\t\t\t\t\t\tstate: 'failed',\n\t\t\t\t\t\t\terror: e,\n\t\t\t\t\t\t\tentity: undefined,\n\t\t\t\t\t\t\ttreeRootId: undefined,\n\t\t\t\t\t\t\tcustomState: undefined,\n\t\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t\t})\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\n\n\t\t\tif (newTreeRootId) {\n\t\t\t\tcurrentlyLoading.current = undefined\n\t\t\t\tsetDisplayedState({\n\t\t\t\t\tstate: 'loaded',\n\t\t\t\t\tentity: resolvedEntity,\n\t\t\t\t\ttreeRootId: newTreeRootId,\n\t\t\t\t\tcustomState: state as State,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t})\n\t\t\t}\n\t\t})()\n\t}, [extendTree, resolvedEntity, children, state, reloadTrigger])\n\n\treturn [\n\t\tdisplayedState,\n\t\t{\n\t\t\treload: useCallback(() => setReloadTrigger({}), []),\n\t\t},\n\t]\n}\n"],"names":[],"mappings":";;;;AA8DA,MAAM,cAAc,CAAC;AAEd,MAAM,yBAAyB,CAAQ,QAAkD,UAAqB,UAA4F;AAChN,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAA6C;AAAA,IACxF,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,EAAA,CACb;AACD,QAAM,mBAAmB,OAGtB;AAEH,QAAM,aAAa,cAAc;AACjC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAwB,IAAI;AAChE,QAAA,iBAAiB,cAAc,UAAU,WAAW;AACpD,QAAA,iBAAiB,SAAS,iBAAiB;AAEjD,YAAU,MAAM;AACf,KAAC,YAAY;AACZ,UAAI,CAAC,gBAAgB;AACpB;AAAA,MAAA;AAGD,uBAAiB,UAAU;AAAA,QAC1B,QAAQ;AAAA,QACR;AAAA,MACD;AAEA,wBAAkB,CAAM,OAAA;AACnB,YAAA,GAAG,UAAU,aAAa,GAAG,UAAU,aAAa,GAAG,UAAU,UAAU;AACvE,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA,OACM;AACC,iBAAA;AAAA,YACN,GAAG;AAAA,YACH,WAAW;AAAA,YACX,OAAO;AAAA,UACR;AAAA,QAAA;AAAA,MACD,CACA;AAED,YAAM,gBAAgB,MAAM;AAAA,QAC3B,cAAc,eAAe;AAAA,UAC5B,GAAG;AAAA,UACH;AAAA,QAAA,CACA;AAAA,QACD;AAAA,UACC,OAAO,kBAAkB;AAAA,UACzB,SAAS,CAAK,MAAA;AACb,oBAAQ,MAAM,CAAC;AAEf,6BAAiB,UAAU;AAET,8BAAA;AAAA,cACjB,OAAO;AAAA,cACP,OAAO;AAAA,cACP,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,aAAa;AAAA,cACb,WAAW;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QACF;AAAA,MAEF;AAGA,UAAI,eAAe;AAClB,yBAAiB,UAAU;AACT,0BAAA;AAAA,UACjB,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,WAAW;AAAA,QAAA,CACX;AAAA,MAAA;AAAA,IACF,GACE;AAAA,EAAA,GACD,CAAC,YAAY,gBAAgB,UAAU,OAAO,aAAa,CAAC;AAExD,SAAA;AAAA,IACN;AAAA,IACA;AAAA,MACC,QAAQ,YAAY,MAAM,iBAAiB,CAAA,CAAE,GAAG,CAAE,CAAA;AAAA,IAAA;AAAA,EAEpD;AACD;"}
|