@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,23 +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 { jsxDEV } from "react/jsx-dev-runtime";
|
|
4
|
-
var _jsxFileName = "/__w/interface/interface/packages/binding/src/accessorPropagation/AccessorProvider.tsx";
|
|
5
4
|
function AccessorProvider(props) {
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
value: props.accessor.key,
|
|
8
|
-
children: /* @__PURE__ */ jsxDEV(EnvironmentContext.Provider, {
|
|
9
|
-
value: props.accessor.environment,
|
|
10
|
-
children: props.children
|
|
11
|
-
}, void 0, false, {
|
|
12
|
-
fileName: _jsxFileName,
|
|
13
|
-
lineNumber: 14,
|
|
14
|
-
columnNumber: 4
|
|
15
|
-
}, this)
|
|
16
|
-
}, void 0, false, {
|
|
17
|
-
fileName: _jsxFileName,
|
|
18
|
-
lineNumber: 13,
|
|
19
|
-
columnNumber: 3
|
|
20
|
-
}, this);
|
|
5
|
+
return /* @__PURE__ */ jsx(EntityKeyContext.Provider, { value: props.accessor.key, children: /* @__PURE__ */ jsx(EnvironmentContext.Provider, { value: props.accessor.environment, children: props.children }) });
|
|
21
6
|
}
|
|
22
7
|
export {
|
|
23
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,15 +1,7 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import { BindingOperationsContext, defaultBindingOperations } from "./BindingOperationsContext.js";
|
|
2
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
3
|
-
var _jsxFileName = "/__w/interface/interface/packages/binding/src/accessorPropagation/BindingOperationsProvider.tsx";
|
|
4
3
|
function BindingOperationsProvider(props) {
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
value: props.bindingOperations || defaultBindingOperations,
|
|
7
|
-
children: props.children
|
|
8
|
-
}, void 0, false, {
|
|
9
|
-
fileName: _jsxFileName,
|
|
10
|
-
lineNumber: 12,
|
|
11
|
-
columnNumber: 3
|
|
12
|
-
}, this);
|
|
4
|
+
return /* @__PURE__ */ jsx(BindingOperationsContext.Provider, { value: props.bindingOperations || defaultBindingOperations, children: props.children });
|
|
13
5
|
}
|
|
14
6
|
export {
|
|
15
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,15 +1,7 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import { EntityKeyContext } from "./EntityKeyContext.js";
|
|
2
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
3
|
-
var _jsxFileName = "/__w/interface/interface/packages/binding/src/accessorPropagation/EntityKeyProvider.tsx";
|
|
4
3
|
function EntityKeyProvider(props) {
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
value: props.entityKey,
|
|
7
|
-
children: props.children
|
|
8
|
-
}, void 0, false, {
|
|
9
|
-
fileName: _jsxFileName,
|
|
10
|
-
lineNumber: 10,
|
|
11
|
-
columnNumber: 9
|
|
12
|
-
}, this);
|
|
4
|
+
return /* @__PURE__ */ jsx(EntityKeyContext.Provider, { value: props.entityKey, children: props.children });
|
|
13
5
|
}
|
|
14
6
|
export {
|
|
15
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,67 +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 { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
4
4
|
import { Environment } from "../dao/Environment.js";
|
|
5
5
|
import { Component } from "../coreComponents/Component.js";
|
|
6
|
-
var _jsxFileName = "/__w/interface/interface/packages/binding/src/accessorPropagation/EnvironmentContext.tsx";
|
|
7
6
|
const EnvironmentContext = createContext(Environment.create());
|
|
8
7
|
EnvironmentContext.displayName = "EnvironmentContext";
|
|
9
|
-
const EnvironmentMiddleware = Component(
|
|
10
|
-
children,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const env = useEnvironment();
|
|
14
|
-
return /* @__PURE__ */ jsxDEV(EnvironmentContext.Provider, {
|
|
15
|
-
value: create(env),
|
|
16
|
-
children
|
|
17
|
-
}, void 0, false, {
|
|
18
|
-
fileName: _jsxFileName,
|
|
19
|
-
lineNumber: 17,
|
|
20
|
-
columnNumber: 10
|
|
21
|
-
}, void 0);
|
|
22
|
-
}, {
|
|
23
|
-
staticRender: ({
|
|
24
|
-
children
|
|
25
|
-
}) => {
|
|
26
|
-
return /* @__PURE__ */ jsxDEV(Fragment, {
|
|
27
|
-
children
|
|
28
|
-
}, void 0, false);
|
|
8
|
+
const EnvironmentMiddleware = Component(
|
|
9
|
+
({ children, create }) => {
|
|
10
|
+
const env = useEnvironment();
|
|
11
|
+
return /* @__PURE__ */ jsx(EnvironmentContext.Provider, { value: create(env), children });
|
|
29
12
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
{
|
|
14
|
+
staticRender: ({ children }) => {
|
|
15
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
16
|
+
},
|
|
17
|
+
generateEnvironment: ({ create }, env) => {
|
|
18
|
+
return create(env);
|
|
19
|
+
}
|
|
34
20
|
}
|
|
35
|
-
|
|
36
|
-
const EnvironmentExtensionProvider = Component(
|
|
37
|
-
children,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
create,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
fileName: _jsxFileName,
|
|
47
|
-
lineNumber: 38,
|
|
48
|
-
columnNumber: 10
|
|
49
|
-
}, void 0);
|
|
50
|
-
}, ({
|
|
51
|
-
children,
|
|
52
|
-
extension,
|
|
53
|
-
state
|
|
54
|
-
}) => {
|
|
55
|
-
const create = (env) => env.withExtension(extension, state);
|
|
56
|
-
return /* @__PURE__ */ jsxDEV(EnvironmentMiddleware, {
|
|
57
|
-
create,
|
|
58
|
-
children
|
|
59
|
-
}, void 0, false, {
|
|
60
|
-
fileName: _jsxFileName,
|
|
61
|
-
lineNumber: 42,
|
|
62
|
-
columnNumber: 10
|
|
63
|
-
}, void 0);
|
|
64
|
-
});
|
|
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 });
|
|
26
|
+
},
|
|
27
|
+
({ children, extension, state }) => {
|
|
28
|
+
const create = (env) => env.withExtension(extension, state);
|
|
29
|
+
return /* @__PURE__ */ jsx(EnvironmentMiddleware, { create, children });
|
|
30
|
+
}
|
|
31
|
+
);
|
|
65
32
|
export {
|
|
66
33
|
EnvironmentContext,
|
|
67
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,15 +1,7 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
1
2
|
import { TreeRootIdContext } from "./TreeRootIdContext.js";
|
|
2
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
3
|
-
var _jsxFileName = "/__w/interface/interface/packages/binding/src/accessorPropagation/TreeRootIdProvider.tsx";
|
|
4
3
|
function TreeRootIdProvider(props) {
|
|
5
|
-
return /* @__PURE__ */
|
|
6
|
-
value: props.treeRootId,
|
|
7
|
-
children: props.children
|
|
8
|
-
}, void 0, false, {
|
|
9
|
-
fileName: _jsxFileName,
|
|
10
|
-
lineNumber: 11,
|
|
11
|
-
columnNumber: 9
|
|
12
|
-
}, this);
|
|
4
|
+
return /* @__PURE__ */ jsx(TreeRootIdContext.Provider, { value: props.treeRootId, children: props.children });
|
|
13
5
|
}
|
|
14
6
|
export {
|
|
15
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,102 +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 { jsxDEV, Fragment } from "react/jsx-dev-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
|
-
|
|
11
|
-
|
|
12
|
-
orderField,
|
|
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
|
-
|
|
71
|
-
}, void 0, false, {
|
|
72
|
-
fileName: _jsxFileName,
|
|
73
|
-
lineNumber: 71,
|
|
74
|
-
columnNumber: 5
|
|
75
|
-
}, void 0), /* @__PURE__ */ jsxDEV(EntityListSubTree, {
|
|
76
|
-
entities: entity,
|
|
77
|
-
expectedMutation: "anyMutation",
|
|
78
|
-
orderBy: getOrderBy("asc"),
|
|
79
|
-
onBeforePersist: (getAccessor, bindingOperations) => {
|
|
80
|
-
let newEntityKey = void 0;
|
|
81
|
-
addEntityAtIndex(getAccessor(), desugaredOrderField, newOrderFieldValue, (getNewEntity) => {
|
|
82
|
-
newEntityKey = getNewEntity().key;
|
|
83
|
-
});
|
|
84
|
-
newEntityKey && bindingOperations.getEntityByKey(newEntityKey).deleteEntity();
|
|
85
|
-
},
|
|
86
|
-
children: /* @__PURE__ */ jsxDEV(SugaredField, {
|
|
87
|
-
field: orderField
|
|
88
|
-
}, void 0, false, {
|
|
89
|
-
fileName: _jsxFileName,
|
|
90
|
-
lineNumber: 86,
|
|
91
|
-
columnNumber: 6
|
|
92
|
-
}, void 0)
|
|
93
|
-
}, void 0, false, {
|
|
94
|
-
fileName: _jsxFileName,
|
|
95
|
-
lineNumber: 72,
|
|
96
|
-
columnNumber: 5
|
|
97
|
-
}, void 0)]
|
|
98
|
-
}, void 0, true);
|
|
99
|
-
}, "SetOrderFieldOnCreate");
|
|
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
|
+
);
|
|
100
71
|
export {
|
|
101
72
|
SetOrderFieldOnCreate
|
|
102
73
|
};
|