@contember/binding 1.1.0-rc.5 → 1.2.0-alpha.0
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/accessorPropagation/AccessorProvider.js +2 -17
- package/dist/development/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsProvider.js +2 -10
- package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/development/accessorPropagation/EntityKeyProvider.js +2 -10
- package/dist/development/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/development/accessorPropagation/EnvironmentContext.js +23 -56
- package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/development/accessorPropagation/TreeRootIdProvider.js +2 -10
- package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +1 -0
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +1 -0
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +1 -0
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/development/accessorPropagation/useEntity.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useField.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +62 -91
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/accessorSorting/moveEntity.js.map +1 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/development/accessorTree/AccessorTree.js +3 -42
- package/dist/development/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js.map +1 -1
- package/dist/development/accessors/EntityAccessor.js +15 -2
- package/dist/development/accessors/EntityAccessor.js.map +1 -1
- package/dist/development/accessors/EntityListAccessor.js +9 -0
- package/dist/development/accessors/EntityListAccessor.js.map +1 -1
- package/dist/development/accessors/FieldAccessor.js +1 -0
- package/dist/development/accessors/FieldAccessor.js.map +1 -1
- package/dist/development/accessors/TreeRootAccessor.js +3 -0
- package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/development/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/core/Config.js.map +1 -1
- package/dist/development/core/DataBinding.js +9 -0
- package/dist/development/core/DataBinding.js.map +1 -1
- package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/core/EventManager.js +3 -27
- package/dist/development/core/EventManager.js.map +1 -1
- package/dist/development/core/MarkerComparator.js +1 -0
- package/dist/development/core/MarkerComparator.js.map +1 -1
- package/dist/development/core/MarkerMerger.js +1 -0
- package/dist/development/core/MarkerMerger.js.map +1 -1
- package/dist/development/core/MutationGenerator.js.map +1 -1
- package/dist/development/core/QueryGenerator.js +1 -0
- package/dist/development/core/QueryGenerator.js.map +1 -1
- package/dist/development/core/RealmKeyGenerator.js +2 -0
- package/dist/development/core/RealmKeyGenerator.js.map +1 -1
- package/dist/development/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/development/core/StateInitializer.js +3 -0
- package/dist/development/core/StateInitializer.js.map +1 -1
- package/dist/development/core/TreeAugmenter.js +6 -1
- package/dist/development/core/TreeAugmenter.js.map +1 -1
- package/dist/development/core/TreeParameterMerger.js +26 -0
- package/dist/development/core/TreeParameterMerger.js.map +1 -1
- package/dist/development/core/TreeStore.js +2 -0
- package/dist/development/core/TreeStore.js.map +1 -1
- package/dist/development/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.js +2 -2
- package/dist/development/core/operations/EntityOperations.js +3 -1
- package/dist/development/core/operations/EntityOperations.js.map +1 -1
- package/dist/development/core/operations/FieldOperations.js +1 -21
- package/dist/development/core/operations/FieldOperations.js.map +1 -1
- package/dist/development/core/state/StateIterator.js +1 -0
- package/dist/development/core/state/StateIterator.js.map +1 -1
- package/dist/development/coreComponents/Component.js.map +1 -1
- package/dist/development/coreComponents/DataBindingProvider.js +10 -14
- package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/development/coreComponents/Entity.js +10 -15
- package/dist/development/coreComponents/Entity.js.map +1 -1
- package/dist/development/coreComponents/EntityList.js +25 -33
- package/dist/development/coreComponents/EntityList.js.map +1 -1
- package/dist/development/coreComponents/EntityListSubTree.js +29 -41
- package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/coreComponents/EntitySubTree.js +39 -51
- package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/coreComponents/Field.js +20 -20
- package/dist/development/coreComponents/Field.js.map +1 -1
- package/dist/development/coreComponents/HasMany.js +18 -33
- package/dist/development/coreComponents/HasMany.js.map +1 -1
- package/dist/development/coreComponents/HasOne.js +18 -33
- package/dist/development/coreComponents/HasOne.js.map +1 -1
- package/dist/development/coreComponents/ParentEntity.js +8 -6
- package/dist/development/coreComponents/ParentEntity.js.map +1 -1
- package/dist/development/dao/Environment.js +3 -0
- package/dist/development/dao/Environment.js.map +1 -1
- package/dist/development/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js +4 -1
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +67 -86
- package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/helperComponents/EntityView.js +2 -4
- package/dist/development/helperComponents/EntityView.js.map +1 -1
- package/dist/development/helperComponents/FieldView.js +38 -36
- package/dist/development/helperComponents/FieldView.js.map +1 -1
- package/dist/development/helperComponents/If.js +40 -65
- package/dist/development/helperComponents/If.js.map +1 -1
- package/dist/development/helperComponents/StaticRender.js +6 -6
- package/dist/development/helperComponents/StaticRender.js.map +1 -1
- package/dist/development/helperComponents/SugaredField.js +3 -18
- package/dist/development/helperComponents/SugaredField.js.map +1 -1
- package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +1 -1
- package/dist/development/helperComponents/helpers/evaluateCondition.js +1 -0
- package/dist/development/helperComponents/helpers/evaluateCondition.js.map +1 -1
- package/dist/development/markers/EntityFieldMarkersContainer.js +1 -0
- package/dist/development/markers/EntityFieldMarkersContainer.js.map +1 -1
- package/dist/development/markers/HasManyRelationMarker.js +0 -6
- package/dist/development/markers/HasManyRelationMarker.js.map +1 -1
- package/dist/development/queryLanguage/CacheStore.js.map +1 -1
- package/dist/development/queryLanguage/MarkerFactory.js.map +1 -1
- package/dist/development/queryLanguage/Parser.js +2 -3
- package/dist/development/queryLanguage/Parser.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguage.js +13 -5
- package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/development/structures/BijectiveIndexedMap.js +2 -0
- package/dist/development/structures/BijectiveIndexedMap.js.map +1 -1
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
- package/dist/development/treeParameters/EntityCreationParameters.js +1 -0
- package/dist/development/treeParameters/EntityCreationParameters.js.map +1 -1
- package/dist/development/utils/Hashing.js +1 -0
- package/dist/development/utils/Hashing.js.map +1 -1
- package/dist/production/accessorPropagation/AccessorProvider.js +2 -8
- package/dist/production/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsProvider.js +2 -5
- package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/production/accessorPropagation/EntityKeyProvider.js +2 -5
- package/dist/production/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/production/accessorPropagation/EnvironmentContext.js +23 -43
- package/dist/production/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/production/accessorPropagation/TreeRootIdProvider.js +2 -5
- package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js +1 -0
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js +1 -0
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js +1 -0
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/production/accessorPropagation/useEntity.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useField.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js +62 -62
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/production/accessorSorting/moveEntity.js.map +1 -1
- package/dist/production/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/production/accessorTree/AccessorTree.js +3 -21
- package/dist/production/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/accessorTree/accessorTreeStateReducer.js.map +1 -1
- package/dist/production/accessors/EntityAccessor.js +15 -2
- package/dist/production/accessors/EntityAccessor.js.map +1 -1
- package/dist/production/accessors/EntityListAccessor.js +9 -0
- package/dist/production/accessors/EntityListAccessor.js.map +1 -1
- package/dist/production/accessors/FieldAccessor.js +1 -0
- package/dist/production/accessors/FieldAccessor.js.map +1 -1
- package/dist/production/accessors/TreeRootAccessor.js +3 -0
- package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/production/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/core/Config.js.map +1 -1
- package/dist/production/core/DataBinding.js +9 -0
- package/dist/production/core/DataBinding.js.map +1 -1
- package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/core/EventManager.js +2 -0
- package/dist/production/core/EventManager.js.map +1 -1
- package/dist/production/core/MarkerComparator.js +1 -0
- package/dist/production/core/MarkerComparator.js.map +1 -1
- package/dist/production/core/MarkerMerger.js +1 -0
- package/dist/production/core/MarkerMerger.js.map +1 -1
- package/dist/production/core/MutationGenerator.js.map +1 -1
- package/dist/production/core/QueryGenerator.js +1 -0
- package/dist/production/core/QueryGenerator.js.map +1 -1
- package/dist/production/core/RealmKeyGenerator.js +2 -0
- package/dist/production/core/RealmKeyGenerator.js.map +1 -1
- package/dist/production/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/production/core/StateInitializer.js +3 -0
- package/dist/production/core/StateInitializer.js.map +1 -1
- package/dist/production/core/TreeAugmenter.js +6 -1
- package/dist/production/core/TreeAugmenter.js.map +1 -1
- package/dist/production/core/TreeParameterMerger.js +26 -0
- package/dist/production/core/TreeParameterMerger.js.map +1 -1
- package/dist/production/core/TreeStore.js +2 -0
- package/dist/production/core/TreeStore.js.map +1 -1
- package/dist/production/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/production/core/exceptions/TreeParameterSugarer.js +2 -2
- package/dist/production/core/operations/EntityOperations.js +3 -1
- package/dist/production/core/operations/EntityOperations.js.map +1 -1
- package/dist/production/core/state/StateIterator.js +1 -0
- package/dist/production/core/state/StateIterator.js.map +1 -1
- package/dist/production/coreComponents/Component.js.map +1 -1
- package/dist/production/coreComponents/DataBindingProvider.js +10 -9
- package/dist/production/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/production/coreComponents/Entity.js +10 -10
- package/dist/production/coreComponents/Entity.js.map +1 -1
- package/dist/production/coreComponents/EntityList.js +25 -28
- package/dist/production/coreComponents/EntityList.js.map +1 -1
- package/dist/production/coreComponents/EntityListSubTree.js +29 -28
- package/dist/production/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/production/coreComponents/EntitySubTree.js +39 -34
- package/dist/production/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/production/coreComponents/Field.js +20 -20
- package/dist/production/coreComponents/Field.js.map +1 -1
- package/dist/production/coreComponents/HasMany.js +18 -20
- package/dist/production/coreComponents/HasMany.js.map +1 -1
- package/dist/production/coreComponents/HasOne.js +18 -20
- package/dist/production/coreComponents/HasOne.js.map +1 -1
- package/dist/production/coreComponents/ParentEntity.js +8 -6
- package/dist/production/coreComponents/ParentEntity.js.map +1 -1
- package/dist/production/dao/Environment.js +3 -0
- package/dist/production/dao/Environment.js.map +1 -1
- package/dist/production/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js +4 -1
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/production/helperComponents/DeferredSubTrees.js +67 -77
- package/dist/production/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/helperComponents/EntityView.js +1 -3
- package/dist/production/helperComponents/EntityView.js.map +1 -1
- package/dist/production/helperComponents/FieldView.js +38 -31
- package/dist/production/helperComponents/FieldView.js.map +1 -1
- package/dist/production/helperComponents/If.js +40 -52
- package/dist/production/helperComponents/If.js.map +1 -1
- package/dist/production/helperComponents/StaticRender.js +5 -5
- package/dist/production/helperComponents/StaticRender.js.map +1 -1
- package/dist/production/helperComponents/SugaredField.js +2 -8
- package/dist/production/helperComponents/SugaredField.js.map +1 -1
- package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +1 -1
- package/dist/production/helperComponents/helpers/evaluateCondition.js +1 -0
- package/dist/production/helperComponents/helpers/evaluateCondition.js.map +1 -1
- package/dist/production/markers/EntityFieldMarkersContainer.js +1 -0
- package/dist/production/markers/EntityFieldMarkersContainer.js.map +1 -1
- package/dist/production/queryLanguage/CacheStore.js.map +1 -1
- package/dist/production/queryLanguage/MarkerFactory.js.map +1 -1
- package/dist/production/queryLanguage/Parser.js +2 -0
- package/dist/production/queryLanguage/Parser.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguage.js +13 -2
- package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/production/structures/BijectiveIndexedMap.js +2 -0
- package/dist/production/structures/BijectiveIndexedMap.js.map +1 -1
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
- package/dist/production/treeParameters/EntityCreationParameters.js +1 -0
- package/dist/production/treeParameters/EntityCreationParameters.js.map +1 -1
- package/dist/production/utils/Hashing.js +1 -0
- package/dist/production/utils/Hashing.js.map +1 -1
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +0 -1
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts +0 -1
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +1 -1
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +0 -1
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +1 -1
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +0 -1
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +1 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +0 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +1 -1
- package/dist/types/accessorTree/DirtinessContext.d.ts +0 -1
- package/dist/types/accessorTree/DirtinessContext.d.ts.map +1 -1
- package/dist/types/accessorTree/MutationStateContext.d.ts +0 -1
- package/dist/types/accessorTree/MutationStateContext.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -13
- package/LICENSE +0 -186
- package/src/ambient.d.ts +0 -1
|
@@ -1,14 +1,8 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import { EntityKeyContext } from "./EntityKeyContext.js";
|
|
2
3
|
import { EnvironmentContext } from "./EnvironmentContext.js";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function AccessorProvider(props) {
|
|
5
|
-
return /* @__PURE__ */ jsx(EntityKeyContext.Provider, {
|
|
6
|
-
value: props.accessor.key,
|
|
7
|
-
children: /* @__PURE__ */ jsx(EnvironmentContext.Provider, {
|
|
8
|
-
value: props.accessor.environment,
|
|
9
|
-
children: props.children
|
|
10
|
-
})
|
|
11
|
-
});
|
|
5
|
+
return /* @__PURE__ */ jsx(EntityKeyContext.Provider, { value: props.accessor.key, children: /* @__PURE__ */ jsx(EnvironmentContext.Provider, { value: props.accessor.environment, children: props.children }) });
|
|
12
6
|
}
|
|
13
7
|
export {
|
|
14
8
|
AccessorProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessorProvider.js","sources":["../../../src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"AccessorProvider.js","sources":["../../../src/accessorPropagation/AccessorProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport { EntityKeyContext } from './EntityKeyContext'\nimport { EnvironmentContext } from './EnvironmentContext'\n\nexport interface EntityProviderProps {\n\taccessor: EntityAccessor\n\tchildren: ReactNode\n}\n\nexport function AccessorProvider(props: EntityProviderProps) {\n\treturn (\n\t\t<EntityKeyContext.Provider value={props.accessor.key}>\n\t\t\t<EnvironmentContext.Provider value={props.accessor.environment}>{props.children}</EnvironmentContext.Provider>\n\t\t</EntityKeyContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,iBAAiB,OAA4B;AAC5D,6BACE,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,SAAS,KAChD,UAAA,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,MAAM,SAAS,aAAc,UAAA,MAAM,UAAS,EACjF,CAAA;AAEF;"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { BindingOperationsContext, defaultBindingOperations } from "./BindingOperationsContext.js";
|
|
2
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BindingOperationsContext, defaultBindingOperations } from "./BindingOperationsContext.js";
|
|
3
3
|
function BindingOperationsProvider(props) {
|
|
4
|
-
return /* @__PURE__ */ jsx(BindingOperationsContext.Provider, {
|
|
5
|
-
value: props.bindingOperations || defaultBindingOperations,
|
|
6
|
-
children: props.children
|
|
7
|
-
});
|
|
4
|
+
return /* @__PURE__ */ jsx(BindingOperationsContext.Provider, { value: props.bindingOperations || defaultBindingOperations, children: props.children });
|
|
8
5
|
}
|
|
9
6
|
export {
|
|
10
7
|
BindingOperationsProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BindingOperationsProvider.js","sources":["../../../src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"BindingOperationsProvider.js","sources":["../../../src/accessorPropagation/BindingOperationsProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { BindingOperations } from '../accessors'\nimport { BindingOperationsContext, defaultBindingOperations } from './BindingOperationsContext'\n\nexport interface BindingOperationsProviderProps {\n\tbindingOperations: BindingOperations | undefined\n\tchildren: ReactNode\n}\n\nexport function BindingOperationsProvider(props: BindingOperationsProviderProps) {\n\treturn (\n\t\t<BindingOperationsContext.Provider value={props.bindingOperations || defaultBindingOperations}>\n\t\t\t{props.children}\n\t\t</BindingOperationsContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;AASO,SAAS,0BAA0B,OAAuC;AAE/E,SAAA,oBAAC,yBAAyB,UAAzB,EAAkC,OAAO,MAAM,qBAAqB,0BACnE,UAAA,MAAM,SACR,CAAA;AAEF;"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { EntityKeyContext } from "./EntityKeyContext.js";
|
|
2
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EntityKeyContext } from "./EntityKeyContext.js";
|
|
3
3
|
function EntityKeyProvider(props) {
|
|
4
|
-
return /* @__PURE__ */ jsx(EntityKeyContext.Provider, {
|
|
5
|
-
value: props.entityKey,
|
|
6
|
-
children: props.children
|
|
7
|
-
});
|
|
4
|
+
return /* @__PURE__ */ jsx(EntityKeyContext.Provider, { value: props.entityKey, children: props.children });
|
|
8
5
|
}
|
|
9
6
|
export {
|
|
10
7
|
EntityKeyProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKeyProvider.js","sources":["../../../src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"EntityKeyProvider.js","sources":["../../../src/accessorPropagation/EntityKeyProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { EntityKeyContext } from './EntityKeyContext'\n\nexport interface EntityKeyProviderProps {\n\tentityKey: string\n\tchildren: ReactNode\n}\n\nexport function EntityKeyProvider(props: EntityKeyProviderProps) {\n\treturn <EntityKeyContext.Provider value={props.entityKey}>{props.children}</EntityKeyContext.Provider>\n}\n"],"names":[],"mappings":";;AAQO,SAAS,kBAAkB,OAA+B;AACzD,SAAA,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,MAAM,WAAY,gBAAM,SAAS,CAAA;AAC3E;"}
|
|
@@ -1,54 +1,34 @@
|
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
1
2
|
import { createContext, useCallback } from "react";
|
|
2
3
|
import { useEnvironment } from "./useEnvironment.js";
|
|
3
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import { Environment } from "../dao/Environment.js";
|
|
5
5
|
import { Component } from "../coreComponents/Component.js";
|
|
6
6
|
const EnvironmentContext = createContext(Environment.create());
|
|
7
7
|
EnvironmentContext.displayName = "EnvironmentContext";
|
|
8
|
-
const EnvironmentMiddleware = Component(
|
|
9
|
-
children,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
8
|
+
const EnvironmentMiddleware = Component(
|
|
9
|
+
({ children, create }) => {
|
|
10
|
+
const env = useEnvironment();
|
|
11
|
+
return /* @__PURE__ */ jsx(EnvironmentContext.Provider, { value: create(env), children });
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
staticRender: ({ children }) => {
|
|
15
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
16
|
+
},
|
|
17
|
+
generateEnvironment: ({ create }, env) => {
|
|
18
|
+
return create(env);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
const EnvironmentExtensionProvider = Component(
|
|
23
|
+
({ children, extension, state }) => {
|
|
24
|
+
const create = useCallback((env) => env.withExtension(extension, state), [extension, state]);
|
|
25
|
+
return /* @__PURE__ */ jsx(EnvironmentMiddleware, { create, children });
|
|
24
26
|
},
|
|
25
|
-
|
|
26
|
-
create
|
|
27
|
-
|
|
28
|
-
return create(env);
|
|
27
|
+
({ children, extension, state }) => {
|
|
28
|
+
const create = (env) => env.withExtension(extension, state);
|
|
29
|
+
return /* @__PURE__ */ jsx(EnvironmentMiddleware, { create, children });
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
const EnvironmentExtensionProvider = Component(({
|
|
32
|
-
children,
|
|
33
|
-
extension,
|
|
34
|
-
state
|
|
35
|
-
}) => {
|
|
36
|
-
const create = useCallback((env) => env.withExtension(extension, state), [extension, state]);
|
|
37
|
-
return /* @__PURE__ */ jsx(EnvironmentMiddleware, {
|
|
38
|
-
create,
|
|
39
|
-
children
|
|
40
|
-
});
|
|
41
|
-
}, ({
|
|
42
|
-
children,
|
|
43
|
-
extension,
|
|
44
|
-
state
|
|
45
|
-
}) => {
|
|
46
|
-
const create = (env) => env.withExtension(extension, state);
|
|
47
|
-
return /* @__PURE__ */ jsx(EnvironmentMiddleware, {
|
|
48
|
-
create,
|
|
49
|
-
children
|
|
50
|
-
});
|
|
51
|
-
});
|
|
31
|
+
);
|
|
52
32
|
export {
|
|
53
33
|
EnvironmentContext,
|
|
54
34
|
EnvironmentExtensionProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentContext.js","sources":["../../../src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { createContext, ReactElement, ReactNode, useCallback } from 'react'\nimport { Environment } from '../dao'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps {\n\tchildren: ReactNode\n\tcreate: (env: Environment) => Environment\n}\n\nexport const EnvironmentMiddleware = Component(\n\t({ children, create }: EnvironmentMiddlewareProps) => {\n\t\tconst env = useEnvironment()\n\t\treturn <EnvironmentContext.Provider value={create(env)}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create }, env) => {\n\t\t\treturn create(env)\n\t\t},\n\t},\n)\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>) => ReactElement | null = 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":[
|
|
1
|
+
{"version":3,"file":"EnvironmentContext.js","sources":["../../../src/accessorPropagation/EnvironmentContext.tsx"],"sourcesContent":["import { createContext, ReactElement, ReactNode, useCallback } from 'react'\nimport { Environment } from '../dao'\nimport { useEnvironment } from './useEnvironment'\nimport { Component } from '../coreComponents'\n\nexport const EnvironmentContext = createContext<Environment>(Environment.create())\nEnvironmentContext.displayName = 'EnvironmentContext'\n\nexport interface EnvironmentMiddlewareProps {\n\tchildren: ReactNode\n\tcreate: (env: Environment) => Environment\n}\n\nexport const EnvironmentMiddleware = Component(\n\t({ children, create }: EnvironmentMiddlewareProps) => {\n\t\tconst env = useEnvironment()\n\t\treturn <EnvironmentContext.Provider value={create(env)}>{children}</EnvironmentContext.Provider>\n\t},\n\t{\n\t\tstaticRender: ({ children }) => {\n\t\t\treturn <>{children}</>\n\t\t},\n\t\tgenerateEnvironment: ({ create }, env) => {\n\t\t\treturn create(env)\n\t\t},\n\t},\n)\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>) => ReactElement | null = 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":[],"mappings":";;;;;AAKO,MAAM,qBAAqB,cAA2B,YAAY,QAAQ;AACjF,mBAAmB,cAAc;AAO1B,MAAM,wBAAwB;AAAA,EACpC,CAAC,EAAE,UAAU,aAAyC;AACrD,UAAM,MAAM;AACL,WAAA,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,OAAO,GAAG,GAAI,SAAS,CAAA;AAAA,EACnE;AAAA,EACA;AAAA,IACC,cAAc,CAAC,EAAE,eAAe;AAC/B,6CAAU,SAAS,CAAA;AAAA,IACpB;AAAA,IACA,qBAAqB,CAAC,EAAE,UAAU,QAAQ;AACzC,aAAO,OAAO,GAAG;AAAA,IAClB;AAAA,EACD;AACD;AAQO,MAAM,+BAA0G;AAAA,EACtH,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,YAAY,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK,GAAG,CAAC,WAAW,KAAK,CAAC;AACjG,WAAA,oBAAC,uBAAsB,EAAA,QAAiB,SAAS,CAAA;AAAA,EACzD;AAAA,EACA,CAAC,EAAE,UAAU,WAAW,YAAY;AACnC,UAAM,SAAS,CAAC,QAAqB,IAAI,cAAc,WAAW,KAAK;AAChE,WAAA,oBAAC,uBAAsB,EAAA,QAAiB,SAAS,CAAA;AAAA,EACzD;AACD;"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { TreeRootIdContext } from "./TreeRootIdContext.js";
|
|
2
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { TreeRootIdContext } from "./TreeRootIdContext.js";
|
|
3
3
|
function TreeRootIdProvider(props) {
|
|
4
|
-
return /* @__PURE__ */ jsx(TreeRootIdContext.Provider, {
|
|
5
|
-
value: props.treeRootId,
|
|
6
|
-
children: props.children
|
|
7
|
-
});
|
|
4
|
+
return /* @__PURE__ */ jsx(TreeRootIdContext.Provider, { value: props.treeRootId, children: props.children });
|
|
8
5
|
}
|
|
9
6
|
export {
|
|
10
7
|
TreeRootIdProvider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRootIdProvider.js","sources":["../../../src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '../treeParameters'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"TreeRootIdProvider.js","sources":["../../../src/accessorPropagation/TreeRootIdProvider.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { TreeRootId } from '../treeParameters'\nimport { TreeRootIdContext } from './TreeRootIdContext'\n\nexport interface TreeRootIdProviderProps {\n\ttreeRootId: TreeRootId | undefined\n\tchildren: ReactNode\n}\n\nexport function TreeRootIdProvider(props: TreeRootIdProviderProps) {\n\treturn <TreeRootIdContext.Provider value={props.treeRootId}>{props.children}</TreeRootIdContext.Provider>\n}\n"],"names":[],"mappings":";;AASO,SAAS,mBAAmB,OAAgC;AAC3D,SAAA,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,MAAM,YAAa,gBAAM,SAAS,CAAA;AAC7E;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '../treeParameters'\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\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t\t},\n\t\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;AAEpB,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,IAAA;AAAA,EACR,OACM;AACI,cAAA;AACU,wBAAA;AAAA,EACrB;AAEO,SAAA;AAAA,IACN,MACC,UACG,cAAc;AAAA,MACd;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,IAEA,IAAA;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,IACD;AAAA,EAAA;AAEF;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeEntityList.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeEntityList.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeEntityList, SugaredRelativeEntityList } from '../treeParameters'\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\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\toffset: normalizedSugared?.offset,\n\t\t\t\t\t\t\tlimit: normalizedSugared?.limit,\n\t\t\t\t\t\t\torderBy: normalizedSugared?.orderBy,\n\t\t\t\t\t\t},\n\t\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;AAEpB,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,IAAA;AAAA,EACR,OACM;AACI,cAAA;AACU,wBAAA;AAAA,EACrB;AAEO,SAAA;AAAA,IACN,MACC,UACG,cAAc;AAAA,MACd;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,IAEA,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,IACD;AAAA,EAAA;AAEF;"}
|
|
@@ -25,6 +25,7 @@ function useDesugaredRelativeSingleEntity(sugaredRelativeSingleEntity) {
|
|
|
25
25
|
},
|
|
26
26
|
environment
|
|
27
27
|
) : void 0,
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
29
|
[normalizedSugared?.field, normalizedSugared?.isNonbearing, normalizedSugared?.setOnCreate, environment, hasEntity]
|
|
29
30
|
);
|
|
30
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '../treeParameters'\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\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t},\n\t\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;AAEpB,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,IAAA;AAAA,EACR,OACM;AACM,gBAAA;AACQ,wBAAA;AAAA,EACrB;AAEO,SAAA;AAAA,IACN,MACC,YACG,cAAc;AAAA,MACd;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MACjC;AAAA,MACA;AAAA,IAEA,IAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EAAA;AAEpH;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleEntity.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleEntity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleEntity, SugaredRelativeSingleEntity } from '../treeParameters'\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\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t\tsetOnCreate: normalizedSugared?.setOnCreate,\n\t\t\t\t\t\t},\n\t\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;AAEpB,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,IAAA;AAAA,EACR,OACM;AACM,gBAAA;AACQ,wBAAA;AAAA,EACrB;AAEO,SAAA;AAAA,IACN,MACC,YACG,cAAc;AAAA,MACd;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,aAAa,mBAAmB;AAAA,MACjC;AAAA,MACA;AAAA,IAEA,IAAA;AAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,aAAa,aAAa,SAAS;AAAA,EAAA;AAEpH;"}
|
|
@@ -25,6 +25,7 @@ function useDesugaredRelativeSingleField(sugaredRelativeSingleField) {
|
|
|
25
25
|
},
|
|
26
26
|
environment
|
|
27
27
|
) : void 0,
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
29
|
[normalizedSugared?.field, normalizedSugared?.defaultValue, normalizedSugared?.isNonbearing, environment, hasField]
|
|
29
30
|
);
|
|
30
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters'\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\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t},\n\t\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;AAEpB,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,IAAA;AAAA,EACR,OACM;AACK,eAAA;AACS,wBAAA;AAAA,EACrB;AAEO,SAAA;AAAA,IACN,MACC,WACG,cAAc;AAAA,MACd;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAClC;AAAA,MACA;AAAA,IAEA,IAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EAAA;AAEpH;"}
|
|
1
|
+
{"version":3,"file":"useDesugaredRelativeSingleField.js","sources":["../../../src/accessorPropagation/useDesugaredRelativeSingleField.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport { QueryLanguage } from '../queryLanguage'\nimport type { RelativeSingleField, SugaredRelativeSingleField } from '../treeParameters'\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\t{\n\t\t\t\t\t\t\tfield: normalizedSugared!.field,\n\t\t\t\t\t\t\tdefaultValue: normalizedSugared?.defaultValue,\n\t\t\t\t\t\t\tisNonbearing: normalizedSugared?.isNonbearing,\n\t\t\t\t\t\t},\n\t\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;AAEpB,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,IAAA;AAAA,EACR,OACM;AACK,eAAA;AACS,wBAAA;AAAA,EACrB;AAEO,SAAA;AAAA,IACN,MACC,WACG,cAAc;AAAA,MACd;AAAA,QACC,OAAO,kBAAmB;AAAA,QAC1B,cAAc,mBAAmB;AAAA,QACjC,cAAc,mBAAmB;AAAA,MAClC;AAAA,MACA;AAAA,IAEA,IAAA;AAAA;AAAA,IAEJ,CAAC,mBAAmB,OAAO,mBAAmB,cAAc,mBAAmB,cAAc,aAAa,QAAQ;AAAA,EAAA;AAEpH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntity.js","sources":["../../../src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\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)\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.getRelativeSingleEntity(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, forceUpdate] = useAccessorUpdateSubscription(getEntity, true)\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, forceUpdate)\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;AAClB,QAAM,iBAAiB;AAEnB,MAAA,OAAO,WAAW,GAAG;AAElB,UAAA,oBAAoB,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAElG,WAAO,8BAA8B,iBAAiB;AAAA,EACvD;
|
|
1
|
+
{"version":3,"file":"useEntity.js","sources":["../../../src/accessorPropagation/useEntity.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\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)\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.getRelativeSingleEntity(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, forceUpdate] = useAccessorUpdateSubscription(getEntity, true)\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, forceUpdate)\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;AAClB,QAAM,iBAAiB;AAEnB,MAAA,OAAO,WAAW,GAAG;AAElB,UAAA,oBAAoB,YAAY,MAAM,eAAe,SAAS,GAAG,CAAC,WAAW,cAAc,CAAC;AAElG,WAAO,8BAA8B,iBAAiB;AAAA,EACvD;AACM,QAAA,8BAA8B,OAAO,CAAC;AAGtC,QAAA,uBAAuB,iCAAiC,2BAA2B;AAEnF,QAAA,YAAY,YAAY,MAAM;AAC7B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,wBAAwB,oBAAqB;AAAA,EACzD,GAAA,CAAC,WAAW,gBAAgB,oBAAoB,CAAC;AAEpD,MAAI,sBAAsB;AAEzB;AAAA,MACC,qBAAqB;AAAA,MACrB;AAAA,IAAA;AAGD,UAAM,CAACA,SAAQ,WAAW,IAAI,8BAA8B,WAAW,IAAI;AAEvE,QAAA,qBAAqB,mBAAmB,QAAQ;AAEnD,4BAAsB,qBAAqB,mBAAmB,CAAC,EAAE,OAAO,WAAW;AAAA,IACpF;AAEOA,WAAAA;AAAAA,EACR;AACO,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityList.js","sources":["../../../src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityListAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\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.getRelativeEntityList(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, forceUpdate] = useAccessorUpdateSubscription(getEntityList, true)\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, forceUpdate)\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,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,sBAAsB,kBAAmB;AAAA,EACrD,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAGD,UAAM,CAAC,YAAY,WAAW,IAAI,8BAA8B,eAAe,IAAI;AAE/E,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useEntityList.js","sources":["../../../src/accessorPropagation/useEntityList.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { EntityListAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\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.getRelativeEntityList(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, forceUpdate] = useAccessorUpdateSubscription(getEntityList, true)\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, forceUpdate)\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,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,gBAAgB,YAAY,MAAM;AACjC,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,sBAAsB,kBAAmB;AAAA,EACrD,GAAA,CAAC,WAAW,gBAAgB,kBAAkB,CAAC;AAElD,MAAI,oBAAoB;AAEvB;AAAA,MACC,mBAAmB;AAAA,MACnB;AAAA,IAAA;AAGD,UAAM,CAAC,YAAY,WAAW,IAAI,8BAA8B,eAAe,IAAI;AAE/E,QAAA,mBAAmB,mBAAmB,QAAQ;AAEjD,4BAAsB,mBAAmB,mBAAmB,CAAC,EAAE,OAAO,WAAW;AAAA,IAClF;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '../treeParameters'\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)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa;AACb,QAAA,aAAa,+BAA+B,mBAAmB;AAC/D,QAAA,YAAY,OAAO,SAAS;
|
|
1
|
+
{"version":3,"file":"useEntityListSubTree.js","sources":["../../../src/accessorPropagation/useEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport type { Alias, SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntityListSubTreeParameters } from './useEntityListSubTreeParameters'\nimport { useGetEntityListSubTree } from './useGetEntityListSubTree'\nimport { TreeRootId } from '../treeParameters'\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)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,uBAAuB,CACnC,wBACG,WACqB;AACxB,QAAM,aAAa;AACb,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,EAAA;AAO9C,SAAO,8BAA8B,WAAW;AACjD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEntitySubTree.js","sources":["../../../src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\nimport { TreeRootId } from '../treeParameters'\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)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa;AACb,QAAA,aAAa,2BAA2B,qBAAqB;AAC7D,QAAA,YAAY,OAAO,SAAS;
|
|
1
|
+
{"version":3,"file":"useEntitySubTree.js","sources":["../../../src/accessorPropagation/useEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport type { Alias, SugaredQualifiedSingleEntity, SugaredUnconstrainedQualifiedSingleEntity } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useEntitySubTreeParameters } from './useEntitySubTreeParameters'\nimport { useGetEntitySubTree } from './useGetEntitySubTree'\nimport { TreeRootId } from '../treeParameters'\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)\n}\n"],"names":[],"mappings":";;;;AAQa,MAAA,mBAAmB,CAC/B,0BACG,WACiB;AACpB,QAAM,aAAa;AACb,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,EAAA;AAM9C,SAAO,8BAA8B,WAAW;AACjD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useField.js","sources":["../../../src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { FieldAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeSingleField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.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 [field, forceUpdate] = useAccessorUpdateSubscription<Value>(getField, true)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":[],"mappings":";;;;;;;AAeA,SAAS,SACR,4BACmC;AAC7B,QAAA,sBAAsB,gCAAgC,0BAA0B;AACtF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,WAAW,YAAY,MAAM;AAC5B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,uBAA8B,mBAAoB;AAAA,EAC9D,GAAA,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AAExB;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAGD,UAAM,CAAC,OAAO,WAAW,IAAI,8BAAqC,UAAU,IAAI;AAE5E,QAAA,oBAAoB,mBAAmB,QAAQ;AAElD,4BAAsB,oBAAoB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useField.js","sources":["../../../src/accessorPropagation/useField.ts"],"sourcesContent":["import { useConstantLengthInvariant, useConstantValueInvariant } from '@contember/react-utils'\nimport { useCallback } from 'react'\nimport { useEntityKey, useGetEntityByKey } from '../accessorPropagation'\nimport type { FieldAccessor } from '../accessors'\nimport { useOnConnectionUpdate } from '../entityEvents'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { useAccessorUpdateSubscription } from './useAccessorUpdateSubscription'\nimport { useDesugaredRelativeSingleField } from './useDesugaredRelativeSingleField'\n\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField,\n): FieldAccessor<Value>\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined\nfunction useField<Value extends FieldValue = FieldValue>(\n\tsugaredRelativeSingleField: string | SugaredRelativeSingleField | undefined,\n): FieldAccessor<Value> | undefined {\n\tconst relativeSingleField = useDesugaredRelativeSingleField(sugaredRelativeSingleField)\n\tuseConstantValueInvariant(\n\t\t!!relativeSingleField,\n\t\t'useField: cannot alternate between providing and omitting the argument.',\n\t)\n\n\tconst entityKey = useEntityKey()\n\tconst getEntityByKey = useGetEntityByKey()\n\tconst getField = useCallback(() => {\n\t\tconst parent = getEntityByKey(entityKey)\n\t\treturn parent.getRelativeSingleField<Value>(relativeSingleField!)\n\t}, [entityKey, getEntityByKey, relativeSingleField])\n\n\tif (relativeSingleField) {\n\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseConstantLengthInvariant(\n\t\t\trelativeSingleField.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 [field, forceUpdate] = useAccessorUpdateSubscription<Value>(getField, true)\n\n\t\tif (relativeSingleField.hasOneRelationPath.length) {\n\t\t\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\t\t\tuseOnConnectionUpdate(relativeSingleField.hasOneRelationPath[0].field, forceUpdate)\n\t\t}\n\n\t\treturn field\n\t}\n\treturn undefined\n}\n\nexport { useField }\n"],"names":[],"mappings":";;;;;;;AAeA,SAAS,SACR,4BACmC;AAC7B,QAAA,sBAAsB,gCAAgC,0BAA0B;AACtF;AAAA,IACC,CAAC,CAAC;AAAA,IACF;AAAA,EAAA;AAGD,QAAM,YAAY;AAClB,QAAM,iBAAiB;AACjB,QAAA,WAAW,YAAY,MAAM;AAC5B,UAAA,SAAS,eAAe,SAAS;AAChC,WAAA,OAAO,uBAA8B,mBAAoB;AAAA,EAC9D,GAAA,CAAC,WAAW,gBAAgB,mBAAmB,CAAC;AAEnD,MAAI,qBAAqB;AAExB;AAAA,MACC,oBAAoB;AAAA,MACpB;AAAA,IAAA;AAGD,UAAM,CAAC,OAAO,WAAW,IAAI,8BAAqC,UAAU,IAAI;AAE5E,QAAA,oBAAoB,mBAAmB,QAAQ;AAElD,4BAAsB,oBAAoB,mBAAmB,CAAC,EAAE,OAAO,WAAW;AAAA,IACnF;AAEO,WAAA;AAAA,EACR;AACO,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntityListSubTree.js","sources":["../../../src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport type {\n\tAlias,\n\tSugaredQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tTreeRootId,\n} from '../treeParameters'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,0BAA0B,MAGX;AAC3B,QAAM,cAAc;AACd,QAAA,uBAAuB,qBAAuB,EAAA;AACpD,QAAM,aAAa;AAEZ,SAAA;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,
|
|
1
|
+
{"version":3,"file":"useGetEntityListSubTree.js","sources":["../../../src/accessorPropagation/useGetEntityListSubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport type {\n\tAlias,\n\tSugaredQualifiedEntityList,\n\tSugaredUnconstrainedQualifiedEntityList,\n\tTreeRootId,\n} from '../treeParameters'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntityListSubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityListAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntityListSubTree = useBindingOperations().getEntityListSubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntityListSubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntityListSubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,0BAA0B,MAGX;AAC3B,QAAM,cAAc;AACd,QAAA,uBAAuB,qBAAuB,EAAA;AACpD,QAAM,aAAa;AAEZ,SAAA;AAAA,IACN,CACC,sBACG,WACC,qBAAqB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IACtG,CAAC,aAAa,sBAAsB,UAAU;AAAA,EAAA;AAEhD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetEntitySubTree.js","sources":["../../../src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport type {\n\tAlias,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,sBAAsB,MAGX;AACvB,QAAM,cAAc;AACd,QAAA,mBAAmB,qBAAuB,EAAA;AAChD,QAAM,aAAa;AAEZ,SAAA;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,
|
|
1
|
+
{"version":3,"file":"useGetEntitySubTree.js","sources":["../../../src/accessorPropagation/useGetEntitySubTree.ts"],"sourcesContent":["import { useCallback } from 'react'\nimport type { EntityAccessor } from '../accessors'\nimport type {\n\tAlias,\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { useBindingOperations } from './useBindingOperations'\nimport { useEnvironment } from './useEnvironment'\nimport { useTreeRootId } from './useTreeRootId'\n\nexport const useGetEntitySubTree = (): ((\n\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t...treeId: [TreeRootId | undefined] | []\n) => EntityAccessor) => {\n\tconst environment = useEnvironment()\n\tconst getEntitySubTree = useBindingOperations().getEntitySubTree\n\tconst treeRootId = useTreeRootId()\n\n\treturn useCallback(\n\t\t(\n\t\t\tparametersOrAlias: Alias | SugaredQualifiedSingleEntity | SugaredUnconstrainedQualifiedSingleEntity,\n\t\t\t...treeId: [TreeRootId | undefined] | []\n\t\t) => getEntitySubTree(parametersOrAlias, treeId.length === 0 ? treeRootId : treeId[0], environment),\n\t\t[environment, getEntitySubTree, treeRootId],\n\t)\n}\n"],"names":[],"mappings":";;;;AAYO,MAAM,sBAAsB,MAGX;AACvB,QAAM,cAAc;AACd,QAAA,mBAAmB,qBAAuB,EAAA;AAChD,QAAM,aAAa;AAEZ,SAAA;AAAA,IACN,CACC,sBACG,WACC,iBAAiB,mBAAmB,OAAO,WAAW,IAAI,aAAa,OAAO,CAAC,GAAG,WAAW;AAAA,IAClG,CAAC,aAAa,kBAAkB,UAAU;AAAA,EAAA;AAE5C;"}
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
1
2
|
import { GraphQlLiteral } from "@contember/client";
|
|
2
3
|
import { addEntityAtIndex } from "./addEntityAtIndex.js";
|
|
3
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
4
4
|
import { EntitySubTree } from "../coreComponents/EntitySubTree.js";
|
|
5
5
|
import { SugaredField } from "../helperComponents/SugaredField.js";
|
|
6
6
|
import { EntityListSubTree } from "../coreComponents/EntityListSubTree.js";
|
|
7
7
|
import { Component } from "../coreComponents/Component.js";
|
|
8
8
|
import { QueryLanguage } from "../queryLanguage/QueryLanguage.js";
|
|
9
9
|
import { Field } from "../coreComponents/Field.js";
|
|
10
|
-
const SetOrderFieldOnCreate = Component(
|
|
11
|
-
|
|
12
|
-
newOrderFieldValue,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
10
|
+
const SetOrderFieldOnCreate = Component(
|
|
11
|
+
() => null,
|
|
12
|
+
({ orderField, newOrderFieldValue, entity }, environment) => {
|
|
13
|
+
const desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment);
|
|
14
|
+
const getOrderBy = (order) => [
|
|
15
|
+
desugaredOrderField.hasOneRelationPath.map((relation) => relation.field).reduceRight(
|
|
16
|
+
(accumulator, currentValue) => ({
|
|
17
|
+
[currentValue]: accumulator
|
|
18
|
+
}),
|
|
19
|
+
{
|
|
20
|
+
[desugaredOrderField.field]: new GraphQlLiteral(order)
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
];
|
|
24
|
+
if (newOrderFieldValue === void 0) {
|
|
25
|
+
const qel = {
|
|
26
|
+
entities: entity,
|
|
27
|
+
expectedMutation: "none",
|
|
28
|
+
limit: 1,
|
|
29
|
+
orderBy: getOrderBy("desc")
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
EntitySubTree,
|
|
34
|
+
{
|
|
35
|
+
entity,
|
|
36
|
+
isCreating: true,
|
|
37
|
+
onBeforePersist: (getAccessor, bindingOperations) => {
|
|
38
|
+
const listSubTree = bindingOperations.getEntityListSubTree(qel);
|
|
39
|
+
const entities = Array.from(listSubTree);
|
|
40
|
+
const newOrderFieldValue2 = !entities.length ? 0 : (entities[0].getRelativeSingleField(desugaredOrderField).value ?? 0) + 1;
|
|
41
|
+
getAccessor().getRelativeSingleField(desugaredOrderField).updateValue(newOrderFieldValue2);
|
|
42
|
+
},
|
|
43
|
+
children: /* @__PURE__ */ jsx(SugaredField, { field: orderField })
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ jsx(EntityListSubTree, { ...qel, children: /* @__PURE__ */ jsx(SugaredField, { field: orderField }) })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Field, { field: desugaredOrderField, defaultValue: newOrderFieldValue, isNonbearing: true }),
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
EntityListSubTree,
|
|
53
|
+
{
|
|
54
|
+
entities: entity,
|
|
55
|
+
expectedMutation: "anyMutation",
|
|
56
|
+
orderBy: getOrderBy("asc"),
|
|
57
|
+
onBeforePersist: (getAccessor, bindingOperations) => {
|
|
58
|
+
let newEntityKey = void 0;
|
|
59
|
+
addEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, (getNewEntity) => {
|
|
60
|
+
newEntityKey = getNewEntity().key;
|
|
61
|
+
});
|
|
62
|
+
newEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity();
|
|
63
|
+
},
|
|
64
|
+
children: /* @__PURE__ */ jsx(SugaredField, { field: orderField })
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
] });
|
|
68
|
+
},
|
|
69
|
+
"SetOrderFieldOnCreate"
|
|
70
|
+
);
|
|
71
71
|
export {
|
|
72
72
|
SetOrderFieldOnCreate
|
|
73
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetOrderFieldOnCreate.js","sources":["../../../src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { CrudQueryBuilder, Input } from '@contember/client'\nimport { GraphQlLiteral } from '@contember/client'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { QueryLanguage } from '../queryLanguage'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '../treeParameters'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps\n\textends SetOrderFieldOnCreateOwnProps,\n\t\tPick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: new GraphQlLiteral(order),\n\t\t\t\t\t} as Input.OrderBy<CrudQueryBuilder.OrderDirection>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getRelativeSingleField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getRelativeSingleField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined = undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["
|
|
1
|
+
{"version":3,"file":"SetOrderFieldOnCreate.js","sources":["../../../src/accessorSorting/SetOrderFieldOnCreate.tsx"],"sourcesContent":["import type { CrudQueryBuilder, Input } from '@contember/client'\nimport { GraphQlLiteral } from '@contember/client'\nimport { Component, EntityListSubTree, EntitySubTree, Field } from '../coreComponents'\nimport { SugaredField } from '../helperComponents'\nimport { QueryLanguage } from '../queryLanguage'\nimport type {\n\tSugaredOrderBy,\n\tSugaredQualifiedEntityList,\n\tSugaredRelativeSingleField,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n} from '../treeParameters'\nimport { addEntityAtIndex } from './addEntityAtIndex'\n\nexport interface SetOrderFieldOnCreateOwnProps {\n\torderField: SugaredRelativeSingleField | string\n\tnewOrderFieldValue?: number\n}\n\nexport interface SetOrderFieldOnCreateProps\n\textends SetOrderFieldOnCreateOwnProps,\n\t\tPick<SugaredUnconstrainedQualifiedSingleEntity, 'entity'> {}\n\nexport const SetOrderFieldOnCreate = Component<SetOrderFieldOnCreateProps>(\n\t() => null,\n\t({ orderField, newOrderFieldValue, entity }, environment) => {\n\t\tconst desugaredOrderField = QueryLanguage.desugarRelativeSingleField(orderField, environment)\n\t\tconst getOrderBy = (order: 'asc' | 'desc'): SugaredOrderBy => [\n\t\t\tdesugaredOrderField.hasOneRelationPath\n\t\t\t\t.map(relation => relation.field)\n\t\t\t\t.reduceRight(\n\t\t\t\t\t(accumulator, currentValue) => ({\n\t\t\t\t\t\t[currentValue]: accumulator,\n\t\t\t\t\t}),\n\t\t\t\t\t{\n\t\t\t\t\t\t[desugaredOrderField.field]: new GraphQlLiteral(order),\n\t\t\t\t\t} as Input.OrderBy<CrudQueryBuilder.OrderDirection>,\n\t\t\t\t),\n\t\t]\n\n\t\tif (newOrderFieldValue === undefined) {\n\t\t\tconst qel: SugaredQualifiedEntityList = {\n\t\t\t\tentities: entity,\n\t\t\t\texpectedMutation: 'none',\n\t\t\t\tlimit: 1,\n\t\t\t\torderBy: getOrderBy('desc'),\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<EntitySubTree\n\t\t\t\t\t\tentity={entity}\n\t\t\t\t\t\tisCreating\n\t\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t\tconst listSubTree = bindingOperations.getEntityListSubTree(qel)\n\t\t\t\t\t\t\tconst entities = Array.from(listSubTree)\n\t\t\t\t\t\t\tconst newOrderFieldValue = !entities.length\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: (entities[0].getRelativeSingleField<number>(desugaredOrderField).value ?? 0) + 1\n\t\t\t\t\t\t\tgetAccessor().getRelativeSingleField<number>(desugaredOrderField).updateValue(newOrderFieldValue)\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntitySubTree>\n\t\t\t\t\t<EntityListSubTree {...qel}>\n\t\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t\t</EntityListSubTree>\n\t\t\t\t</>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Field field={desugaredOrderField} defaultValue={newOrderFieldValue} isNonbearing />\n\t\t\t\t<EntityListSubTree\n\t\t\t\t\tentities={entity}\n\t\t\t\t\texpectedMutation=\"anyMutation\"\n\t\t\t\t\torderBy={getOrderBy('asc')}\n\t\t\t\t\tonBeforePersist={(getAccessor, bindingOperations) => {\n\t\t\t\t\t\t// We're creating a new entity which adjusts the numbering of the other ones if applicable\n\t\t\t\t\t\t// and then deleting it again which leaves a hole for newOrderFieldValue that is set above.\n\t\t\t\t\t\tlet newEntityKey: string | undefined = undefined\n\t\t\t\t\t\taddEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, getNewEntity => {\n\t\t\t\t\t\t\tnewEntityKey = getNewEntity().key\n\t\t\t\t\t\t})\n\t\t\t\t\t\tnewEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity()\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<SugaredField field={orderField} />\n\t\t\t\t</EntityListSubTree>\n\t\t\t</>\n\t\t)\n\t},\n\t'SetOrderFieldOnCreate',\n)\n"],"names":["newOrderFieldValue"],"mappings":";;;;;;;;;AAsBO,MAAM,wBAAwB;AAAA,EACpC,MAAM;AAAA,EACN,CAAC,EAAE,YAAY,oBAAoB,OAAA,GAAU,gBAAgB;AAC5D,UAAM,sBAAsB,cAAc,2BAA2B,YAAY,WAAW;AACtF,UAAA,aAAa,CAAC,UAA0C;AAAA,MAC7D,oBAAoB,mBAClB,IAAI,CAAY,aAAA,SAAS,KAAK,EAC9B;AAAA,QACA,CAAC,aAAa,kBAAkB;AAAA,UAC/B,CAAC,YAAY,GAAG;AAAA,QAAA;AAAA,QAEjB;AAAA,UACC,CAAC,oBAAoB,KAAK,GAAG,IAAI,eAAe,KAAK;AAAA,QACtD;AAAA,MACD;AAAA,IAAA;AAGF,QAAI,uBAAuB,QAAW;AACrC,YAAM,MAAkC;AAAA,QACvC,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,OAAO;AAAA,QACP,SAAS,WAAW,MAAM;AAAA,MAAA;AAE3B,aAEE,qBAAA,UAAA,EAAA,UAAA;AAAA,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,iBAAiB,CAAC,aAAa,sBAAsB;AAC9C,oBAAA,cAAc,kBAAkB,qBAAqB,GAAG;AACxD,oBAAA,WAAW,MAAM,KAAK,WAAW;AACvC,oBAAMA,sBAAqB,CAAC,SAAS,SAClC,KACC,SAAS,CAAC,EAAE,uBAA+B,mBAAmB,EAAE,SAAS,KAAK;AAClF,0BAAA,EAAc,uBAA+B,mBAAmB,EAAE,YAAYA,mBAAkB;AAAA,YACjG;AAAA,YAEA,UAAA,oBAAC,cAAa,EAAA,OAAO,WAAY,CAAA;AAAA,UAAA;AAAA,QAClC;AAAA,QACA,oBAAC,qBAAmB,GAAG,KACtB,8BAAC,cAAa,EAAA,OAAO,YAAY,EAClC,CAAA;AAAA,MACD,EAAA,CAAA;AAAA,IAEF;AACA,WAEE,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,oBAAC,SAAM,OAAO,qBAAqB,cAAc,oBAAoB,cAAY,MAAC;AAAA,MAClF;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,UAAU;AAAA,UACV,kBAAiB;AAAA,UACjB,SAAS,WAAW,KAAK;AAAA,UACzB,iBAAiB,CAAC,aAAa,sBAAsB;AAGpD,gBAAI,eAAmC;AACvC,6BAAiB,YAAY,GAAG,qBAAqB,oBAAoB,CAAgB,iBAAA;AACxF,6BAAe,aAAe,EAAA;AAAA,YAAA,CAC9B;AACD,4BAAgB,kBAAkB,eAAe,YAAY,EAAE,aAAa;AAAA,UAC7E;AAAA,UAEA,UAAA,oBAAC,cAAa,EAAA,OAAO,WAAY,CAAA;AAAA,QAAA;AAAA,MAClC;AAAA,IACD,EAAA,CAAA;AAAA,EAEF;AAAA,EACA;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveEntity.js","sources":["../../../src/accessorSorting/moveEntity.ts"],"sourcesContent":["import type { EntityAccessor, EntityListAccessor } from '../accessors'\nimport type { RelativeSingleField } from '../treeParameters'\nimport { sortEntities } from './sortEntities'\n\nexport const moveEntity = (\n\tentityList: EntityListAccessor,\n\tsortByField: RelativeSingleField,\n\toldIndex: number,\n\tnewIndex: number,\n) => {\n\tmoveEntityInArray(Array.from(entityList), entityList.getAccessor, sortByField, oldIndex, newIndex)\n}\n\nexport const moveEntityInArray = (\n\tentities: EntityAccessor[],\n\tgetAccessor: EntityListAccessor.GetEntityListAccessor,\n\tsortByField: RelativeSingleField,\n\toldIndex: number,\n\tnewIndex: number,\n): EntityAccessor[] => {\n\tconst sorted = sortEntities(entities, sortByField)\n\tconst order = computeEntityOrder(sorted, sortByField, oldIndex, newIndex)\n\n\tgetAccessor().batchUpdates((getAccessor, { getEntityByKey }) => {\n\t\tfor (const [entityKey, newOrderValue] of order) {\n\t\t\tconst targetEntity = getEntityByKey(entityKey)\n\t\t\tconst orderField = targetEntity.getRelativeSingleField<number>(sortByField)\n\n\t\t\torderField.updateValue(newOrderValue)\n\t\t}\n\t})\n\treturn sorted\n}\n\ntype EntityOrder = Map<string, number>\n\nconst computeEntityOrder = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField,\n\toldIndex: number,\n\tnewIndex: number,\n): EntityOrder => {\n\tconst order: EntityOrder = new Map()\n\n\tfor (let i = 0, len = entities.length; i < len; i++) {\n\t\tconst entity = entities[i]\n\t\tconst orderField = entity.getRelativeSingleField<number>(sortByField)\n\n\t\tlet targetValue\n\n\t\tif (i === oldIndex) {\n\t\t\ttargetValue = newIndex\n\t\t} else if (newIndex > oldIndex && oldIndex < i && i <= newIndex) {\n\t\t\ttargetValue = i - 1\n\t\t} else if (newIndex < oldIndex && newIndex <= i && i < oldIndex) {\n\t\t\ttargetValue = i + 1\n\t\t} else {\n\t\t\ttargetValue = i\n\t\t}\n\n\t\tif (typeof orderField.value !== 'number' || orderField.value !== targetValue) {\n\t\t\torder.set(entity.key, targetValue)\n\t\t}\n\t}\n\treturn order\n}\n"],"names":["getAccessor"],"mappings":";AAIO,MAAM,aAAa,CACzB,YACA,aACA,UACA,aACI;AACc,oBAAA,MAAM,KAAK,UAAU,GAAG,WAAW,aAAa,aAAa,UAAU,QAAQ;AAClG;AAEO,MAAM,oBAAoB,CAChC,UACA,aACA,aACA,UACA,aACsB;AAChB,QAAA,SAAS,aAAa,UAAU,WAAW;AACjD,QAAM,QAAQ,mBAAmB,QAAQ,aAAa,UAAU,QAAQ;AAExE,gBAAc,aAAa,CAACA,cAAa,EAAE,qBAAqB;AAC/D,eAAW,CAAC,WAAW,aAAa,KAAK,OAAO;AACzC,YAAA,eAAe,eAAe,SAAS;AACvC,YAAA,aAAa,aAAa,uBAA+B,WAAW;AAE1E,iBAAW,YAAY,aAAa;AAAA,IACrC;AAAA,EAAA,CACA;AACM,SAAA;AACR;AAIA,MAAM,qBAAqB,CAC1B,UACA,aACA,UACA,aACiB;AACX,QAAA,4BAAyB;AAE/B,WAAS,IAAI,GAAG,MAAM,SAAS,QAAQ,IAAI,KAAK,KAAK;
|
|
1
|
+
{"version":3,"file":"moveEntity.js","sources":["../../../src/accessorSorting/moveEntity.ts"],"sourcesContent":["import type { EntityAccessor, EntityListAccessor } from '../accessors'\nimport type { RelativeSingleField } from '../treeParameters'\nimport { sortEntities } from './sortEntities'\n\nexport const moveEntity = (\n\tentityList: EntityListAccessor,\n\tsortByField: RelativeSingleField,\n\toldIndex: number,\n\tnewIndex: number,\n) => {\n\tmoveEntityInArray(Array.from(entityList), entityList.getAccessor, sortByField, oldIndex, newIndex)\n}\n\nexport const moveEntityInArray = (\n\tentities: EntityAccessor[],\n\tgetAccessor: EntityListAccessor.GetEntityListAccessor,\n\tsortByField: RelativeSingleField,\n\toldIndex: number,\n\tnewIndex: number,\n): EntityAccessor[] => {\n\tconst sorted = sortEntities(entities, sortByField)\n\tconst order = computeEntityOrder(sorted, sortByField, oldIndex, newIndex)\n\n\tgetAccessor().batchUpdates((getAccessor, { getEntityByKey }) => {\n\t\tfor (const [entityKey, newOrderValue] of order) {\n\t\t\tconst targetEntity = getEntityByKey(entityKey)\n\t\t\tconst orderField = targetEntity.getRelativeSingleField<number>(sortByField)\n\n\t\t\torderField.updateValue(newOrderValue)\n\t\t}\n\t})\n\treturn sorted\n}\n\ntype EntityOrder = Map<string, number>\n\nconst computeEntityOrder = (\n\tentities: EntityAccessor[],\n\tsortByField: RelativeSingleField,\n\toldIndex: number,\n\tnewIndex: number,\n): EntityOrder => {\n\tconst order: EntityOrder = new Map()\n\n\tfor (let i = 0, len = entities.length; i < len; i++) {\n\t\tconst entity = entities[i]\n\t\tconst orderField = entity.getRelativeSingleField<number>(sortByField)\n\n\t\tlet targetValue\n\n\t\tif (i === oldIndex) {\n\t\t\ttargetValue = newIndex\n\t\t} else if (newIndex > oldIndex && oldIndex < i && i <= newIndex) {\n\t\t\ttargetValue = i - 1\n\t\t} else if (newIndex < oldIndex && newIndex <= i && i < oldIndex) {\n\t\t\ttargetValue = i + 1\n\t\t} else {\n\t\t\ttargetValue = i\n\t\t}\n\n\t\tif (typeof orderField.value !== 'number' || orderField.value !== targetValue) {\n\t\t\torder.set(entity.key, targetValue)\n\t\t}\n\t}\n\treturn order\n}\n"],"names":["getAccessor"],"mappings":";AAIO,MAAM,aAAa,CACzB,YACA,aACA,UACA,aACI;AACc,oBAAA,MAAM,KAAK,UAAU,GAAG,WAAW,aAAa,aAAa,UAAU,QAAQ;AAClG;AAEO,MAAM,oBAAoB,CAChC,UACA,aACA,aACA,UACA,aACsB;AAChB,QAAA,SAAS,aAAa,UAAU,WAAW;AACjD,QAAM,QAAQ,mBAAmB,QAAQ,aAAa,UAAU,QAAQ;AAExE,gBAAc,aAAa,CAACA,cAAa,EAAE,qBAAqB;AAC/D,eAAW,CAAC,WAAW,aAAa,KAAK,OAAO;AACzC,YAAA,eAAe,eAAe,SAAS;AACvC,YAAA,aAAa,aAAa,uBAA+B,WAAW;AAE1E,iBAAW,YAAY,aAAa;AAAA,IACrC;AAAA,EAAA,CACA;AACM,SAAA;AACR;AAIA,MAAM,qBAAqB,CAC1B,UACA,aACA,UACA,aACiB;AACX,QAAA,4BAAyB;AAE/B,WAAS,IAAI,GAAG,MAAM,SAAS,QAAQ,IAAI,KAAK,KAAK;AAC9C,UAAA,SAAS,SAAS,CAAC;AACnB,UAAA,aAAa,OAAO,uBAA+B,WAAW;AAEhE,QAAA;AAEJ,QAAI,MAAM,UAAU;AACL,oBAAA;AAAA,IAAA,WACJ,WAAW,YAAY,WAAW,KAAK,KAAK,UAAU;AAChE,oBAAc,IAAI;AAAA,IAAA,WACR,WAAW,YAAY,YAAY,KAAK,IAAI,UAAU;AAChE,oBAAc,IAAI;AAAA,IAAA,OACZ;AACQ,oBAAA;AAAA,IACf;AAEA,QAAI,OAAO,WAAW,UAAU,YAAY,WAAW,UAAU,aAAa;AACvE,YAAA,IAAI,OAAO,KAAK,WAAW;AAAA,IAClC;AAAA,EACD;AACO,SAAA;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repairEntitiesOrder.js","sources":["../../../src/accessorSorting/repairEntitiesOrder.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport type { RelativeSingleField } from '../treeParameters'\n\nexport const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => {\n\tfor (let i = 0, len = sortedEntities.length; i < len; i++) {\n\t\tconst entity = sortedEntities[i]\n\t\tconst orderField = entity.getRelativeSingleField(sortableByField)\n\n\t\tif (orderField.value !== i) {\n\t\t\t// TODO ideally, this condition should just be `orderField.value === null`\n\t\t\t// We should generally try to touch the indexes less\n\t\t\torderField.updateValue(i)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAGa,MAAA,sBAAsB,CAAC,iBAAsC,mBAAqC;AAC9G,WAAS,IAAI,GAAG,MAAM,eAAe,QAAQ,IAAI,KAAK,KAAK;
|
|
1
|
+
{"version":3,"file":"repairEntitiesOrder.js","sources":["../../../src/accessorSorting/repairEntitiesOrder.ts"],"sourcesContent":["import type { EntityAccessor } from '../accessors'\nimport type { RelativeSingleField } from '../treeParameters'\n\nexport const repairEntitiesOrder = (sortableByField: RelativeSingleField, sortedEntities: EntityAccessor[]) => {\n\tfor (let i = 0, len = sortedEntities.length; i < len; i++) {\n\t\tconst entity = sortedEntities[i]\n\t\tconst orderField = entity.getRelativeSingleField(sortableByField)\n\n\t\tif (orderField.value !== i) {\n\t\t\t// TODO ideally, this condition should just be `orderField.value === null`\n\t\t\t// We should generally try to touch the indexes less\n\t\t\torderField.updateValue(i)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAGa,MAAA,sBAAsB,CAAC,iBAAsC,mBAAqC;AAC9G,WAAS,IAAI,GAAG,MAAM,eAAe,QAAQ,IAAI,KAAK,KAAK;AACpD,UAAA,SAAS,eAAe,CAAC;AACzB,UAAA,aAAa,OAAO,uBAAuB,eAAe;AAE5D,QAAA,WAAW,UAAU,GAAG;AAG3B,iBAAW,YAAY,CAAC;AAAA,IACzB;AAAA,EACD;AACD;"}
|