@contember/binding 1.2.0-beta.2 → 1.2.0-rc.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.
Files changed (27) hide show
  1. package/dist/development/accessorSorting/errors.js.map +1 -1
  2. package/dist/development/core/DataBinding.js.map +1 -1
  3. package/dist/development/core/state/StateIterator.js.map +1 -1
  4. package/dist/development/coreComponents/DataBindingProvider.js +1 -1
  5. package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
  6. package/dist/development/queryLanguage/MarkerFactory.js.map +1 -1
  7. package/dist/development/utils/Hashing.js.map +1 -1
  8. package/dist/production/accessorSorting/errors.js.map +1 -1
  9. package/dist/production/core/DataBinding.js.map +1 -1
  10. package/dist/production/core/state/StateIterator.js.map +1 -1
  11. package/dist/production/coreComponents/DataBindingProvider.js.map +1 -1
  12. package/dist/production/queryLanguage/MarkerFactory.js.map +1 -1
  13. package/dist/production/utils/Hashing.js.map +1 -1
  14. package/dist/types/accessorSorting/errors.d.ts.map +1 -1
  15. package/dist/types/core/state/StateIterator.d.ts.map +1 -1
  16. package/dist/types/coreComponents/DataBindingProvider.d.ts +8 -4
  17. package/dist/types/coreComponents/DataBindingProvider.d.ts.map +1 -1
  18. package/dist/types/queryLanguage/MarkerFactory.d.ts.map +1 -1
  19. package/dist/types/tsconfig.tsbuildinfo +1 -1
  20. package/dist/types/utils/Hashing.d.ts.map +1 -1
  21. package/package.json +5 -5
  22. package/src/accessorSorting/errors.ts +0 -2
  23. package/src/core/DataBinding.ts +1 -1
  24. package/src/core/state/StateIterator.ts +1 -2
  25. package/src/coreComponents/DataBindingProvider.tsx +15 -9
  26. package/src/queryLanguage/MarkerFactory.ts +0 -2
  27. package/src/utils/Hashing.ts +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"Hashing.d.ts","sourceRoot":"","sources":["../../../src/utils/Hashing.ts"],"names":[],"mappings":"AAWA,qBAAa,OAAO;WACL,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;WAM7B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAWvC"}
1
+ {"version":3,"file":"Hashing.d.ts","sourceRoot":"","sources":["../../../src/utils/Hashing.ts"],"names":[],"mappings":"AACA,qBAAa,OAAO;WACL,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM;WAM7B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAWvC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contember/binding",
3
3
  "license": "Apache-2.0",
4
- "version": "1.2.0-beta.2",
4
+ "version": "1.2.0-rc.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/production/index.js",
@@ -28,10 +28,10 @@
28
28
  "test": "vitest"
29
29
  },
30
30
  "dependencies": {
31
- "@contember/client": "1.2.0-beta.2",
32
- "@contember/react-client": "1.2.0-beta.2",
33
- "@contember/react-multipass-rendering": "1.2.0-beta.2",
34
- "@contember/react-utils": "1.2.0-beta.2",
31
+ "@contember/client": "1.2.0-rc.0",
32
+ "@contember/react-client": "1.2.0-rc.0",
33
+ "@contember/react-multipass-rendering": "1.2.0-rc.0",
34
+ "@contember/react-utils": "1.2.0-rc.0",
35
35
  "chevrotain": "6.5.0",
36
36
  "fast-deep-equal": "^3.1.3",
37
37
  "js-levenshtein": "1.1.6",
@@ -1,6 +1,4 @@
1
- import { EntityListAccessor } from '../accessors'
2
1
  import { BindingError } from '../BindingError'
3
- import type { FieldName } from '../treeParameters'
4
2
  import type { SortedEntities } from './SortedEntities'
5
3
 
6
4
  export const throwNoopError = (callbackName: keyof SortedEntities) => {
@@ -5,7 +5,7 @@ import {
5
5
  BatchUpdatesOptions,
6
6
  BindingOperations,
7
7
  ExtendTreeOptions,
8
- PersistErrorOptions, PersistOptions,
8
+ PersistOptions,
9
9
  PersistSuccessOptions,
10
10
  TreeRootAccessor,
11
11
  } from '../accessors'
@@ -1,9 +1,8 @@
1
- import { FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../../markers'
2
1
  import type { FieldValue, PlaceholderName } from '../../treeParameters'
3
2
  import { assertNever } from '../../utils'
4
3
  import type { TreeStore } from '../TreeStore'
5
4
  import type { EntityListState } from './EntityListState'
6
- import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'
5
+ import type { EntityRealmState } from './EntityRealmState'
7
6
  import type { FieldState } from './FieldState'
8
7
  import { getEntityMarker } from './getEntityMarker'
9
8
  import type { RootStateNode, StateINode, StateNode } from './StateNode'
@@ -1,7 +1,18 @@
1
1
  import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'
2
2
  import { AccessorTree, AccessorTreeState, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'
3
3
 
4
- export type DataBindingProviderBaseProps =
4
+ export type DataBindingProviderStateComponent<StateProps> = (
5
+ | {
6
+ stateComponent?: never;
7
+ stateProps?: never;
8
+ }
9
+ | {
10
+ stateComponent: ComponentType<StateProps & DataBindingStateComponentProps>
11
+ stateProps?: StateProps
12
+ }
13
+ )
14
+
15
+ export type DataBindingProviderBaseProps =
5
16
  & AccessorTreeStateOptions
6
17
 
7
18
  export interface DataBindingStateComponentProps {
@@ -9,14 +20,9 @@ export interface DataBindingStateComponentProps {
9
20
  children?: ReactNode
10
21
  }
11
22
 
12
- export type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &
13
- (
14
- | {}
15
- | {
16
- stateComponent: ComponentType<StateProps & DataBindingStateComponentProps>
17
- stateProps?: StateProps
18
- }
19
- )
23
+ export type DataBindingProviderProps<StateProps> =
24
+ & DataBindingProviderBaseProps
25
+ & DataBindingProviderStateComponent<StateProps>
20
26
 
21
27
  /**
22
28
  * The `DataBindingProvider` is a root component for all other data binding related components.
@@ -27,8 +27,6 @@ import type {
27
27
  } from '../treeParameters'
28
28
  import { assertNever } from '../utils'
29
29
  import { QueryLanguage } from './QueryLanguage'
30
- import { GraphQlLiteral } from '@contember/client'
31
- import { BindingError } from '../BindingError'
32
30
 
33
31
  export class MarkerFactory {
34
32
  private static createSubTreeMarker<
@@ -1,13 +1,3 @@
1
- import type {
2
- HasManyRelation,
3
- HasOneRelation,
4
- QualifiedEntityList,
5
- QualifiedSingleEntity,
6
- UnconstrainedQualifiedEntityList,
7
- UnconstrainedQualifiedSingleEntity,
8
- } from '../treeParameters'
9
- import { Environment } from '../dao'
10
-
11
1
  // TODO update hashing so that for offset, 0 == undefined
12
2
  export class Hashing {
13
3
  public static hashAny(array: any[]): number {