@contember/binding 1.2.0-alpha.2 → 1.2.0-alpha.3

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 (55) hide show
  1. package/dist/development/accessorPropagation/AccessorProvider.js +10 -2
  2. package/dist/development/accessorPropagation/AccessorProvider.js.map +1 -1
  3. package/dist/development/accessorPropagation/BindingOperationsProvider.js +6 -2
  4. package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +1 -1
  5. package/dist/development/accessorPropagation/EntityKeyProvider.js +6 -2
  6. package/dist/development/accessorPropagation/EntityKeyProvider.js.map +1 -1
  7. package/dist/development/accessorPropagation/EnvironmentContext.js +21 -5
  8. package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
  9. package/dist/development/accessorPropagation/TreeRootIdProvider.js +6 -2
  10. package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +1 -1
  11. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +57 -13
  12. package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
  13. package/dist/development/accessorTree/AccessorTree.js +22 -2
  14. package/dist/development/accessorTree/AccessorTree.js.map +1 -1
  15. package/dist/development/core/EventManager.js +27 -1
  16. package/dist/development/core/EventManager.js.map +1 -1
  17. package/dist/development/core/operations/FieldOperations.js +21 -1
  18. package/dist/development/core/operations/FieldOperations.js.map +1 -1
  19. package/dist/development/coreComponents/DataBindingProvider.js +6 -2
  20. package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
  21. package/dist/development/coreComponents/Entity.js +6 -2
  22. package/dist/development/coreComponents/Entity.js.map +1 -1
  23. package/dist/development/coreComponents/EntityList.js +17 -5
  24. package/dist/development/coreComponents/EntityList.js.map +1 -1
  25. package/dist/development/coreComponents/EntityListSubTree.js +17 -5
  26. package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
  27. package/dist/development/coreComponents/EntitySubTree.js +33 -9
  28. package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
  29. package/dist/development/coreComponents/Field.js +11 -3
  30. package/dist/development/coreComponents/Field.js.map +1 -1
  31. package/dist/development/coreComponents/HasMany.js +17 -5
  32. package/dist/development/coreComponents/HasMany.js.map +1 -1
  33. package/dist/development/coreComponents/HasOne.js +17 -5
  34. package/dist/development/coreComponents/HasOne.js.map +1 -1
  35. package/dist/development/coreComponents/ParentEntity.js +6 -2
  36. package/dist/development/coreComponents/ParentEntity.js.map +1 -1
  37. package/dist/development/helperComponents/DeferredSubTrees.js +22 -6
  38. package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
  39. package/dist/development/helperComponents/EntityView.js +6 -2
  40. package/dist/development/helperComponents/EntityView.js.map +1 -1
  41. package/dist/development/helperComponents/FieldView.js +17 -5
  42. package/dist/development/helperComponents/FieldView.js.map +1 -1
  43. package/dist/development/helperComponents/If.js +40 -8
  44. package/dist/development/helperComponents/If.js.map +1 -1
  45. package/dist/development/helperComponents/StaticRender.js +6 -2
  46. package/dist/development/helperComponents/StaticRender.js.map +1 -1
  47. package/dist/development/helperComponents/SugaredField.js +11 -3
  48. package/dist/development/helperComponents/SugaredField.js.map +1 -1
  49. package/dist/development/markers/HasManyRelationMarker.js +6 -0
  50. package/dist/development/markers/HasManyRelationMarker.js.map +1 -1
  51. package/dist/development/queryLanguage/Parser.js +3 -0
  52. package/dist/development/queryLanguage/Parser.js.map +1 -1
  53. package/dist/development/queryLanguage/QueryLanguage.js +3 -0
  54. package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
  55. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"FieldOperations.js","sources":["../../../../src/core/operations/FieldOperations.ts"],"sourcesContent":["import { validate as uuidValidate } from 'uuid'\nimport { ErrorAccessor, FieldAccessor } from '../../accessors'\nimport { ClientGeneratedUuid, ServerId } from '../../accessorTree'\nimport { BindingError } from '../../BindingError'\nimport { PRIMARY_KEY_NAME } from '../../bindingTypes'\nimport type { FieldValue } from '../../treeParameters'\nimport type { AccessorErrorManager } from '../AccessorErrorManager'\nimport { EventManager } from '../EventManager'\nimport { FieldState, getEntityMarker, StateIterator } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\nimport { OperationsHelpers } from './OperationsHelpers'\nimport { EventListenersStore } from '../../treeParameters'\n\nexport class FieldOperations {\n\tpublic constructor(\n\t\tprivate readonly accessorErrorManager: AccessorErrorManager,\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly stateInitializer: StateInitializer,\n\t\tprivate readonly treeStore: TreeStore,\n\t) {}\n\n\tpublic addError(fieldState: FieldState<any>, error: ErrorAccessor.Error): () => void {\n\t\treturn this.accessorErrorManager.addError(fieldState, error)\n\t}\n\n\tpublic clearErrors(fieldState: FieldState<any>): void {\n\t\treturn this.accessorErrorManager.clearErrorsByState(fieldState)\n\t}\n\n\tpublic addEventListener<\n\t\tType extends keyof FieldAccessor.FieldEventListenerMap,\n\t\tValue extends FieldValue = FieldValue,\n\t>(\n\t\tstate: FieldState<Value>,\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: FieldAccessor.FieldEventListenerMap<Value>[Type],\n\t): () => void {\n\t\tif (!state.eventListeners) {\n\t\t\tstate.eventListeners = new EventListenersStore()\n\t\t}\n\t\treturn state.eventListeners.add(event, listener)\n\t}\n\n\tpublic updateValue<Value extends FieldValue = FieldValue>(\n\t\tfieldState: FieldState<Value>,\n\t\tnewValue: Value | null,\n\t\t{ agent = FieldAccessor.userAgent }: FieldAccessor.UpdateOptions = {},\n\t) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tconst { placeholderName, parent } = fieldState\n\t\t\tif (placeholderName === PRIMARY_KEY_NAME) {\n\t\t\t\tconst entity = fieldState.parent.entity\n\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tif (newValue !== fieldState.value && (fieldState.touchLog !== undefined || entity.hasIdSetInStone)) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Trying to set the '${PRIMARY_KEY_NAME}' field for the second time. This is prohibited.\\n` +\n\t\t\t\t\t\t\t\t`Once set, it is immutable.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof newValue !== 'string' || !uuidValidate(newValue)) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Invalid value supplied for the '${PRIMARY_KEY_NAME}' field. ` +\n\t\t\t\t\t\t\t\t`Expecting a valid uuid but '${newValue}' was given.\\n` +\n\t\t\t\t\t\t\t\t`Hint: you may use 'FieldAccessor.asUuid.setToUuid()'.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (this.treeStore.entityStore.has(ServerId.formatUniqueValue(newValue, entity.entityName))) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Trying to set the '${PRIMARY_KEY_NAME}' field to '${newValue}' which is a valid uuid but is not unique. ` +\n\t\t\t\t\t\t\t\t`It is already in use by an existing entity.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof newValue !== 'string') {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tOperationsHelpers.changeEntityId(\n\t\t\t\t\tthis.treeStore,\n\t\t\t\t\tthis.eventManager,\n\t\t\t\t\tthis.stateInitializer,\n\t\t\t\t\tentity,\n\t\t\t\t\tnew ClientGeneratedUuid(newValue),\n\t\t\t\t)\n\t\t\t}\n\t\t\tfor (const field of StateIterator.eachSiblingRealmChild(this.treeStore, fieldState)) {\n\t\t\t\tif (newValue === field.value) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.touchLog === undefined) {\n\t\t\t\t\tfield.touchLog = new Set()\n\t\t\t\t}\n\t\t\t\tfield.touchLog.add(agent)\n\t\t\t\tfield.value = newValue\n\n\t\t\t\tconst resolvedValue =\n\t\t\t\t\tfield.fieldMarker.defaultValue === undefined\n\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t: newValue === null\n\t\t\t\t\t\t? field.fieldMarker.defaultValue\n\t\t\t\t\t\t: newValue\n\t\t\t\tconst normalizedPersistedValue = field.persistedValue === undefined ? null : field.persistedValue\n\t\t\t\tconst hadUnpersistedChangesBefore = field.hasUnpersistedChanges\n\t\t\t\tconst hasUnpersistedChangesNow = resolvedValue !== normalizedPersistedValue\n\t\t\t\tfield.hasUnpersistedChanges = hasUnpersistedChangesNow\n\n\t\t\t\tconst shouldInfluenceUpdateCount =\n\t\t\t\t\t!getEntityMarker(parent).fields.hasAtLeastOneBearingField ||\n\t\t\t\t\t!field.fieldMarker.isNonbearing ||\n\t\t\t\t\tfield.persistedValue !== undefined\n\n\t\t\t\tlet changesDelta = EventManager.NO_CHANGES_DIFFERENCE\n\n\t\t\t\tif (shouldInfluenceUpdateCount) {\n\t\t\t\t\tif (!hadUnpersistedChangesBefore && hasUnpersistedChangesNow) {\n\t\t\t\t\t\tchangesDelta++\n\t\t\t\t\t} else if (hadUnpersistedChangesBefore && !hasUnpersistedChangesNow) {\n\t\t\t\t\t\tchangesDelta--\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.eventManager.registerJustUpdated(field, changesDelta)\n\t\t\t}\n\t\t})\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;AAcO,MAAM,gBAAgB;AAAA,EACrB,YACW,sBACA,cACA,kBACA,WAChB;AAJgB,SAAA,uBAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,YAAA;AAAA,EACf;AAAA,EAEI,SAAS,YAA6B,OAAwC;AACpF,WAAO,KAAK,qBAAqB,SAAS,YAAY,KAAK;AAAA,EAC5D;AAAA,EAEO,YAAY,YAAmC;AAC9C,WAAA,KAAK,qBAAqB,mBAAmB,UAAU;AAAA,EAC/D;AAAA,EAEO,iBAIN,OACA,OACA,UACa;AACT,QAAA,CAAC,MAAM,gBAAgB;AACpB,YAAA,iBAAiB,IAAI;IAC5B;AACA,WAAO,MAAM,eAAe,IAAI,OAAO,QAAQ;AAAA,EAChD;AAAA,EAEO,YACN,YACA,UACA,EAAE,QAAQ,cAAc,UAA2C,IAAA,IAClE;AACI,SAAA,aAAa,cAAc,MAAM;AAC/B,YAAA,EAAE,iBAAiB,OAAW,IAAA;AACpC,UAAI,oBAAoB,kBAAkB;AACnC,cAAA,SAAS,WAAW,OAAO;AAuB7B,YAAA,OAAO,aAAa,UAAU;AACjC,gBAAM,IAAI,aAAa;AAAA,QACxB;AACkB,0BAAA;AAAA,UACjB,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,UACL;AAAA,UACA,IAAI,oBAAoB,QAAQ;AAAA,QAAA;AAAA,MAElC;AACA,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,UAAU,GAAG;AAChF,YAAA,aAAa,MAAM,OAAO;AAC7B;AAAA,QACD;AACI,YAAA,MAAM,aAAa,QAAW;AAC3B,gBAAA,+BAAe;QACtB;AACM,cAAA,SAAS,IAAI,KAAK;AACxB,cAAM,QAAQ;AAER,cAAA,gBACL,MAAM,YAAY,iBAAiB,SAChC,WACA,aAAa,OACb,MAAM,YAAY,eAClB;AACJ,cAAM,2BAA2B,MAAM,mBAAmB,SAAY,OAAO,MAAM;AACnF,cAAM,8BAA8B,MAAM;AAC1C,cAAM,2BAA2B,kBAAkB;AACnD,cAAM,wBAAwB;AAE9B,cAAM,6BACL,CAAC,gBAAgB,MAAM,EAAE,OAAO,6BAChC,CAAC,MAAM,YAAY,gBACnB,MAAM,mBAAmB;AAE1B,YAAI,eAAe,aAAa;AAEhC,YAAI,4BAA4B;AAC3B,cAAA,CAAC,+BAA+B,0BAA0B;AAC7D;AAAA,UAAA,WACU,+BAA+B,CAAC,0BAA0B;AACpE;AAAA,UACD;AAAA,QACD;AAEK,aAAA,aAAa,oBAAoB,OAAO,YAAY;AAAA,MAC1D;AAAA,IAAA,CACA;AAAA,EACF;AACD;"}
1
+ {"version":3,"file":"FieldOperations.js","sources":["../../../../src/core/operations/FieldOperations.ts"],"sourcesContent":["import { validate as uuidValidate } from 'uuid'\nimport { ErrorAccessor, FieldAccessor } from '../../accessors'\nimport { ClientGeneratedUuid, ServerId } from '../../accessorTree'\nimport { BindingError } from '../../BindingError'\nimport { PRIMARY_KEY_NAME } from '../../bindingTypes'\nimport type { FieldValue } from '../../treeParameters'\nimport type { AccessorErrorManager } from '../AccessorErrorManager'\nimport { EventManager } from '../EventManager'\nimport { FieldState, getEntityMarker, StateIterator } from '../state'\nimport type { StateInitializer } from '../StateInitializer'\nimport type { TreeStore } from '../TreeStore'\nimport { OperationsHelpers } from './OperationsHelpers'\nimport { EventListenersStore } from '../../treeParameters'\n\nexport class FieldOperations {\n\tpublic constructor(\n\t\tprivate readonly accessorErrorManager: AccessorErrorManager,\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly stateInitializer: StateInitializer,\n\t\tprivate readonly treeStore: TreeStore,\n\t) {}\n\n\tpublic addError(fieldState: FieldState<any>, error: ErrorAccessor.Error): () => void {\n\t\treturn this.accessorErrorManager.addError(fieldState, error)\n\t}\n\n\tpublic clearErrors(fieldState: FieldState<any>): void {\n\t\treturn this.accessorErrorManager.clearErrorsByState(fieldState)\n\t}\n\n\tpublic addEventListener<\n\t\tType extends keyof FieldAccessor.FieldEventListenerMap,\n\t\tValue extends FieldValue = FieldValue,\n\t>(\n\t\tstate: FieldState<Value>,\n\t\tevent: { type: Type; key?: string },\n\t\tlistener: FieldAccessor.FieldEventListenerMap<Value>[Type],\n\t): () => void {\n\t\tif (!state.eventListeners) {\n\t\t\tstate.eventListeners = new EventListenersStore()\n\t\t}\n\t\treturn state.eventListeners.add(event, listener)\n\t}\n\n\tpublic updateValue<Value extends FieldValue = FieldValue>(\n\t\tfieldState: FieldState<Value>,\n\t\tnewValue: Value | null,\n\t\t{ agent = FieldAccessor.userAgent }: FieldAccessor.UpdateOptions = {},\n\t) {\n\t\tthis.eventManager.syncOperation(() => {\n\t\t\tconst { placeholderName, parent } = fieldState\n\t\t\tif (placeholderName === PRIMARY_KEY_NAME) {\n\t\t\t\tconst entity = fieldState.parent.entity\n\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tif (newValue !== fieldState.value && (fieldState.touchLog !== undefined || entity.hasIdSetInStone)) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Trying to set the '${PRIMARY_KEY_NAME}' field for the second time. This is prohibited.\\n` +\n\t\t\t\t\t\t\t\t`Once set, it is immutable.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof newValue !== 'string' || !uuidValidate(newValue)) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Invalid value supplied for the '${PRIMARY_KEY_NAME}' field. ` +\n\t\t\t\t\t\t\t\t`Expecting a valid uuid but '${newValue}' was given.\\n` +\n\t\t\t\t\t\t\t\t`Hint: you may use 'FieldAccessor.asUuid.setToUuid()'.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (this.treeStore.entityStore.has(ServerId.formatUniqueValue(newValue, entity.entityName))) {\n\t\t\t\t\t\tthrow new BindingError(\n\t\t\t\t\t\t\t`Trying to set the '${PRIMARY_KEY_NAME}' field to '${newValue}' which is a valid uuid but is not unique. ` +\n\t\t\t\t\t\t\t\t`It is already in use by an existing entity.`,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof newValue !== 'string') {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tOperationsHelpers.changeEntityId(\n\t\t\t\t\tthis.treeStore,\n\t\t\t\t\tthis.eventManager,\n\t\t\t\t\tthis.stateInitializer,\n\t\t\t\t\tentity,\n\t\t\t\t\tnew ClientGeneratedUuid(newValue),\n\t\t\t\t)\n\t\t\t}\n\t\t\tfor (const field of StateIterator.eachSiblingRealmChild(this.treeStore, fieldState)) {\n\t\t\t\tif (newValue === field.value) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (field.touchLog === undefined) {\n\t\t\t\t\tfield.touchLog = new Set()\n\t\t\t\t}\n\t\t\t\tfield.touchLog.add(agent)\n\t\t\t\tfield.value = newValue\n\n\t\t\t\tconst resolvedValue =\n\t\t\t\t\tfield.fieldMarker.defaultValue === undefined\n\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t: newValue === null\n\t\t\t\t\t\t? field.fieldMarker.defaultValue\n\t\t\t\t\t\t: newValue\n\t\t\t\tconst normalizedPersistedValue = field.persistedValue === undefined ? null : field.persistedValue\n\t\t\t\tconst hadUnpersistedChangesBefore = field.hasUnpersistedChanges\n\t\t\t\tconst hasUnpersistedChangesNow = resolvedValue !== normalizedPersistedValue\n\t\t\t\tfield.hasUnpersistedChanges = hasUnpersistedChangesNow\n\n\t\t\t\tconst shouldInfluenceUpdateCount =\n\t\t\t\t\t!getEntityMarker(parent).fields.hasAtLeastOneBearingField ||\n\t\t\t\t\t!field.fieldMarker.isNonbearing ||\n\t\t\t\t\tfield.persistedValue !== undefined\n\n\t\t\t\tlet changesDelta = EventManager.NO_CHANGES_DIFFERENCE\n\n\t\t\t\tif (shouldInfluenceUpdateCount) {\n\t\t\t\t\tif (!hadUnpersistedChangesBefore && hasUnpersistedChangesNow) {\n\t\t\t\t\t\tchangesDelta++\n\t\t\t\t\t} else if (hadUnpersistedChangesBefore && !hasUnpersistedChangesNow) {\n\t\t\t\t\t\tchangesDelta--\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.eventManager.registerJustUpdated(field, changesDelta)\n\t\t\t}\n\t\t})\n\t}\n}\n"],"names":["uuidValidate"],"mappings":";;;;;;;;;;AAcO,MAAM,gBAAgB;AAAA,EACrB,YACW,sBACA,cACA,kBACA,WAChB;AAJgB,SAAA,uBAAA;AACA,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,YAAA;AAAA,EACf;AAAA,EAEI,SAAS,YAA6B,OAAwC;AACpF,WAAO,KAAK,qBAAqB,SAAS,YAAY,KAAK;AAAA,EAC5D;AAAA,EAEO,YAAY,YAAmC;AAC9C,WAAA,KAAK,qBAAqB,mBAAmB,UAAU;AAAA,EAC/D;AAAA,EAEO,iBAIN,OACA,OACA,UACa;AACT,QAAA,CAAC,MAAM,gBAAgB;AACpB,YAAA,iBAAiB,IAAI;IAC5B;AACA,WAAO,MAAM,eAAe,IAAI,OAAO,QAAQ;AAAA,EAChD;AAAA,EAEO,YACN,YACA,UACA,EAAE,QAAQ,cAAc,UAA2C,IAAA,IAClE;AACI,SAAA,aAAa,cAAc,MAAM;AAC/B,YAAA,EAAE,iBAAiB,OAAW,IAAA;AACpC,UAAI,oBAAoB,kBAAkB;AACnC,cAAA,SAAS,WAAW,OAAO;AAER;AACxB,cAAI,aAAa,WAAW,UAAU,WAAW,aAAa,UAAa,OAAO,kBAAkB;AACnG,kBAAM,IAAI;AAAA,cACT,sBAAsB;AAAA;AAAA,YAAA;AAAA,UAGxB;AACA,cAAI,OAAO,aAAa,YAAY,CAACA,SAAa,QAAQ,GAAG;AAC5D,kBAAM,IAAI;AAAA,cACT,mCAAmC,wDACH;AAAA;AAAA,YAAA;AAAA,UAGlC;AACI,cAAA,KAAK,UAAU,YAAY,IAAI,SAAS,kBAAkB,UAAU,OAAO,UAAU,CAAC,GAAG;AAC5F,kBAAM,IAAI;AAAA,cACT,sBAAsB,+BAA+B;AAAA,YAAA;AAAA,UAGvD;AAAA,QACD;AACI,YAAA,OAAO,aAAa,UAAU;AACjC,gBAAM,IAAI,aAAa;AAAA,QACxB;AACkB,0BAAA;AAAA,UACjB,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,UACL;AAAA,UACA,IAAI,oBAAoB,QAAQ;AAAA,QAAA;AAAA,MAElC;AACA,iBAAW,SAAS,cAAc,sBAAsB,KAAK,WAAW,UAAU,GAAG;AAChF,YAAA,aAAa,MAAM,OAAO;AAC7B;AAAA,QACD;AACI,YAAA,MAAM,aAAa,QAAW;AAC3B,gBAAA,+BAAe;QACtB;AACM,cAAA,SAAS,IAAI,KAAK;AACxB,cAAM,QAAQ;AAER,cAAA,gBACL,MAAM,YAAY,iBAAiB,SAChC,WACA,aAAa,OACb,MAAM,YAAY,eAClB;AACJ,cAAM,2BAA2B,MAAM,mBAAmB,SAAY,OAAO,MAAM;AACnF,cAAM,8BAA8B,MAAM;AAC1C,cAAM,2BAA2B,kBAAkB;AACnD,cAAM,wBAAwB;AAE9B,cAAM,6BACL,CAAC,gBAAgB,MAAM,EAAE,OAAO,6BAChC,CAAC,MAAM,YAAY,gBACnB,MAAM,mBAAmB;AAE1B,YAAI,eAAe,aAAa;AAEhC,YAAI,4BAA4B;AAC3B,cAAA,CAAC,+BAA+B,0BAA0B;AAC7D;AAAA,UAAA,WACU,+BAA+B,CAAC,0BAA0B;AACpE;AAAA,UACD;AAAA,QACD;AAEK,aAAA,aAAa,oBAAoB,OAAO,YAAY;AAAA,MAC1D;AAAA,IAAA,CACA;AAAA,EACF;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { memo, createElement } from "react";
3
3
  import { useDataBinding } from "../accessorTree/useDataBinding.js";
4
4
  import { AccessorTree } from "../accessorTree/AccessorTree.js";
@@ -12,7 +12,11 @@ const DataBindingProvider = memo(function DataBindingProvider2(props) {
12
12
  },
13
13
  props.children
14
14
  ) : props.children;
15
- return /* @__PURE__ */ jsx(AccessorTree, { state: accessorTreeState, children });
15
+ return /* @__PURE__ */ jsxDEV(AccessorTree, { state: accessorTreeState, children }, void 0, false, {
16
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/DataBindingProvider.tsx",
17
+ lineNumber: 47,
18
+ columnNumber: 9
19
+ }, this);
16
20
  });
17
21
  export {
18
22
  DataBindingProvider
@@ -1 +1 @@
1
- {"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'\n\nexport type DataBindingProviderBaseProps =\n\t& AccessorTreeStateOptions\n\nexport interface DataBindingStateComponentProps {\n\taccessorTreeState: AccessorTreeState\n\tchildren?: ReactNode\n}\n\nexport type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tstateComponent: ComponentType<StateProps & DataBindingStateComponentProps>\n\t\t\t\tstateProps?: StateProps\n\t\t }\n\t)\n\n/**\n * The `DataBindingProvider` is a root component for all other data binding related components.\n *\n * @example\n * ```\n * <DataBindingProvider stateComponent={FeedbackRenderer} />\n * ```\n *\n * @group Data binding\n */\nexport const DataBindingProvider = memo(function DataBindingProvider<StateProps extends DataBindingStateComponentProps>(\n\tprops: DataBindingProviderProps<StateProps>,\n) {\n\tconst accessorTreeState = useDataBinding(props)\n\n\tconst children =\n\t\t'stateComponent' in props && props.stateComponent\n\t\t\t? createElement(\n\t\t\t\t\tprops.stateComponent,\n\t\t\t\t\t{\n\t\t\t\t\t\t...props.stateProps!,\n\t\t\t\t\t\taccessorTreeState: accessorTreeState,\n\t\t\t\t\t},\n\t\t\t\t\tprops.children,\n\t\t\t )\n\t\t\t: props.children\n\treturn <AccessorTree state={accessorTreeState}>{children}</AccessorTree>\n}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement\n"],"names":["DataBindingProvider"],"mappings":";;;;AA8BO,MAAM,sBAAsB,KAAK,SAASA,qBAChD,OACC;AACK,QAAA,oBAAoB,eAAe,KAAK;AAE9C,QAAM,WACL,oBAAoB,SAAS,MAAM,iBAChC;AAAA,IACA,MAAM;AAAA,IACN;AAAA,MACC,GAAG,MAAM;AAAA,MACT;AAAA,IACD;AAAA,IACA,MAAM;AAAA,EAAA,IAEN,MAAM;AACV,SAAQ,oBAAA,cAAA,EAAa,OAAO,mBAAoB,SAAS,CAAA;AAC1D,CAAC;"}
1
+ {"version":3,"file":"DataBindingProvider.js","sources":["../../../src/coreComponents/DataBindingProvider.tsx"],"sourcesContent":["import { ComponentType, createElement, memo, ReactElement, ReactNode } from 'react'\nimport { AccessorTree, AccessorTreeState, AccessorTreeStateOptions, useDataBinding } from '../accessorTree'\n\nexport type DataBindingProviderBaseProps =\n\t& AccessorTreeStateOptions\n\nexport interface DataBindingStateComponentProps {\n\taccessorTreeState: AccessorTreeState\n\tchildren?: ReactNode\n}\n\nexport type DataBindingProviderProps<StateProps> = DataBindingProviderBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tstateComponent: ComponentType<StateProps & DataBindingStateComponentProps>\n\t\t\t\tstateProps?: StateProps\n\t\t }\n\t)\n\n/**\n * The `DataBindingProvider` is a root component for all other data binding related components.\n *\n * @example\n * ```\n * <DataBindingProvider stateComponent={FeedbackRenderer} />\n * ```\n *\n * @group Data binding\n */\nexport const DataBindingProvider = memo(function DataBindingProvider<StateProps extends DataBindingStateComponentProps>(\n\tprops: DataBindingProviderProps<StateProps>,\n) {\n\tconst accessorTreeState = useDataBinding(props)\n\n\tconst children =\n\t\t'stateComponent' in props && props.stateComponent\n\t\t\t? createElement(\n\t\t\t\t\tprops.stateComponent,\n\t\t\t\t\t{\n\t\t\t\t\t\t...props.stateProps!,\n\t\t\t\t\t\taccessorTreeState: accessorTreeState,\n\t\t\t\t\t},\n\t\t\t\t\tprops.children,\n\t\t\t )\n\t\t\t: props.children\n\treturn <AccessorTree state={accessorTreeState}>{children}</AccessorTree>\n}) as <StateProps>(props: DataBindingProviderProps<StateProps>) => ReactElement\n"],"names":["DataBindingProvider"],"mappings":";;;;AA8BO,MAAM,sBAAsB,KAAK,SAASA,qBAChD,OACC;AACK,QAAA,oBAAoB,eAAe,KAAK;AAE9C,QAAM,WACL,oBAAoB,SAAS,MAAM,iBAChC;AAAA,IACA,MAAM;AAAA,IACN;AAAA,MACC,GAAG,MAAM;AAAA,MACT;AAAA,IACD;AAAA,IACA,MAAM;AAAA,EAAA,IAEN,MAAM;AACV,SAAQ,uBAAA,cAAA,EAAa,OAAO,mBAAoB,SAAzC,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAkD,GAAA,IAAA;AAC1D,CAAC;"}
@@ -1,11 +1,15 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { Component } from "./Component.js";
3
3
  import { AccessorProvider } from "../accessorPropagation/AccessorProvider.js";
4
4
  const Entity = Component(
5
5
  ({ children, accessor }) => {
6
6
  return (
7
7
  // HACK: the ?. is actually important, despite the typings.
8
- /* @__PURE__ */ jsx(AccessorProvider, { accessor, children }, accessor?.key)
8
+ /* @__PURE__ */ jsxDEV(AccessorProvider, { accessor, children }, accessor?.key, false, {
9
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/Entity.tsx",
10
+ lineNumber: 20,
11
+ columnNumber: 3
12
+ }, globalThis)
9
13
  );
10
14
  },
11
15
  "Entity"
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sources":["../../../src/coreComponents/Entity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { AccessorProvider } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { Component } from './Component'\n\nexport interface EntityBaseProps {\n\taccessor: EntityAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityProps = EntityBaseProps\n\n/**\n * @group Data binding\n */\nexport const Entity = Component(\n\t({ children, accessor }: EntityProps) => {\n\treturn (\n\t\t// HACK: the ?. is actually important, despite the typings.\n\t\t<AccessorProvider accessor={accessor} key={accessor?.key}>\n\t\t\t{children}\n\t\t</AccessorProvider>\n\t)\n\t},\n\t'Entity',\n)\n"],"names":[],"mappings":";;;AAeO,MAAM,SAAS;AAAA,EACrB,CAAC,EAAE,UAAU,eAA4B;AACzC;AAAA;AAAA,MAEE,oBAAA,kBAAA,EAAiB,UAChB,SAAA,GADyC,UAAU,GAErD;AAAA;AAAA,EAED;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"Entity.js","sources":["../../../src/coreComponents/Entity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { AccessorProvider } from '../accessorPropagation'\nimport type { EntityAccessor } from '../accessors'\nimport { Component } from './Component'\n\nexport interface EntityBaseProps {\n\taccessor: EntityAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityProps = EntityBaseProps\n\n/**\n * @group Data binding\n */\nexport const Entity = Component(\n\t({ children, accessor }: EntityProps) => {\n\treturn (\n\t\t// HACK: the ?. is actually important, despite the typings.\n\t\t<AccessorProvider accessor={accessor} key={accessor?.key}>\n\t\t\t{children}\n\t\t</AccessorProvider>\n\t)\n\t},\n\t'Entity',\n)\n"],"names":["this"],"mappings":";;;AAeO,MAAM,SAAS;AAAA,EACrB,CAAC,EAAE,UAAU,eAA4B;AACzC;AAAA;AAAA,MAEE,uBAAA,kBAAA,EAAiB,UAChB,SAAA,GADyC,UAAU,KAArD,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAEA,GAAAA,UAAA;AAAA;AAAA,EAED;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
2
  import { createElement } from "react";
3
3
  import { Component } from "./Component.js";
4
4
  import { Entity } from "./Entity.js";
@@ -11,9 +11,17 @@ const EntityList = Component(
11
11
  children: props.children
12
12
  });
13
13
  }
14
- return /* @__PURE__ */ jsx(Fragment, { children: Array.from(props.accessor, (entity) => {
15
- return /* @__PURE__ */ jsx(Entity, { accessor: entity, children: props.children }, entity.key);
16
- }) });
14
+ return /* @__PURE__ */ jsxDEV(Fragment, { children: Array.from(props.accessor, (entity) => {
15
+ return /* @__PURE__ */ jsxDEV(Entity, { accessor: entity, children: props.children }, entity.key, false, {
16
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntityList.tsx",
17
+ lineNumber: 36,
18
+ columnNumber: 7
19
+ }, globalThis);
20
+ }) }, void 0, false, {
21
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntityList.tsx",
22
+ lineNumber: 33,
23
+ columnNumber: 4
24
+ }, globalThis);
17
25
  },
18
26
  (props) => {
19
27
  if ("listComponent" in props && props.listComponent) {
@@ -23,7 +31,11 @@ const EntityList = Component(
23
31
  children: props.children
24
32
  });
25
33
  }
26
- return /* @__PURE__ */ jsx(Fragment, { children: props.children });
34
+ return /* @__PURE__ */ jsxDEV(Fragment, { children: props.children }, void 0, false, {
35
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntityList.tsx",
36
+ lineNumber: 52,
37
+ columnNumber: 10
38
+ }, globalThis);
27
39
  },
28
40
  "EntityList"
29
41
  );
@@ -1 +1 @@
1
- {"version":3,"file":"EntityList.js","sources":["../../../src/coreComponents/EntityList.tsx"],"sourcesContent":["import { ComponentType, createElement, ReactElement, ReactNode } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\n\nexport interface EntityListBaseProps {\n\taccessor: EntityListAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityListProps<ListProps> = EntityListBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * @group Data binding\n */\nexport const EntityList = Component(\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: props.accessor,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Array.from(props.accessor, entity => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</>\n\t\t)\n\t},\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: undefined as any,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn <>{props.children}</>\n\t},\n\t'EntityList',\n) as <ListProps>(props: EntityListProps<ListProps>) => ReactElement\n"],"names":[],"mappings":";;;;AAsBO,MAAM,aAAa;AAAA,EACzB,CAAuB,UAAsC;AACxD,QAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,aAAA,cAAc,MAAM,eAAe;AAAA,QACzC,GAAG,MAAM;AAAA,QACT,UAAU,MAAM;AAAA,QAChB,UAAU,MAAM;AAAA,MAAA,CAChB;AAAA,IACF;AACA,WAEG,oBAAA,UAAA,EAAA,UAAA,MAAM,KAAK,MAAM,UAAU,CAAU,WAAA;AACrC,iCACE,QAAwB,EAAA,UAAU,QACjC,UAAM,MAAA,SAAA,GADK,OAAO,GAEpB;AAAA,IAED,CAAA,EACF,CAAA;AAAA,EAEF;AAAA,EACA,CAAuB,UAAsC;AACxD,QAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,aAAA,cAAc,MAAM,eAAe;AAAA,QACzC,GAAG,MAAM;AAAA,QACT,UAAU;AAAA,QACV,UAAU,MAAM;AAAA,MAAA,CAChB;AAAA,IACF;AACO,WAAA,oBAAA,UAAA,EAAG,gBAAM,SAAS,CAAA;AAAA,EAC1B;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"EntityList.js","sources":["../../../src/coreComponents/EntityList.tsx"],"sourcesContent":["import { ComponentType, createElement, ReactElement, ReactNode } from 'react'\nimport type { EntityListAccessor } from '../accessors'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\n\nexport interface EntityListBaseProps {\n\taccessor: EntityListAccessor\n\tchildren?: ReactNode\n}\n\nexport type EntityListProps<ListProps> = EntityListBaseProps &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * @group Data binding\n */\nexport const EntityList = Component(\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: props.accessor,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Array.from(props.accessor, entity => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Entity key={entity.key} accessor={entity}>\n\t\t\t\t\t\t\t{props.children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t)\n\t\t\t\t})}\n\t\t\t</>\n\t\t)\n\t},\n\t<ListProps extends {}>(props: EntityListProps<ListProps>) => {\n\t\tif ('listComponent' in props && props.listComponent) {\n\t\t\treturn createElement(props.listComponent, {\n\t\t\t\t...props.listProps!,\n\t\t\t\taccessor: undefined as any,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\t\t}\n\t\treturn <>{props.children}</>\n\t},\n\t'EntityList',\n) as <ListProps>(props: EntityListProps<ListProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;AAsBO,MAAM,aAAa;AAAA,EACzB,CAAuB,UAAsC;AACxD,QAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,aAAA,cAAc,MAAM,eAAe;AAAA,QACzC,GAAG,MAAM;AAAA,QACT,UAAU,MAAM;AAAA,QAChB,UAAU,MAAM;AAAA,MAAA,CAChB;AAAA,IACF;AACA,WAEG,uBAAA,UAAA,EAAA,UAAA,MAAM,KAAK,MAAM,UAAU,CAAU,WAAA;AACrC,oCACE,QAAwB,EAAA,UAAU,QACjC,UAAM,MAAA,SAAA,GADK,OAAO,KAApB,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAEA,GAAAA,UAAA;AAAA,IAAA,CAED,EAPF,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAQA,GAAAA,UAAA;AAAA,EAEF;AAAA,EACA,CAAuB,UAAsC;AACxD,QAAA,mBAAmB,SAAS,MAAM,eAAe;AAC7C,aAAA,cAAc,MAAM,eAAe;AAAA,QACzC,GAAG,MAAM;AAAA,QACT,UAAU;AAAA,QACV,UAAU,MAAM;AAAA,MAAA,CAChB;AAAA,IACF;AACO,WAAA,uBAAA,UAAA,EAAG,gBAAM,SAAT,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAkB,GAAAA,UAAA;AAAA,EAC1B;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { useConstantValueInvariant } from "@contember/react-utils";
3
3
  import { useCallback } from "react";
4
4
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
@@ -20,7 +20,11 @@ const EntityListSubTree = Component(
20
20
  [getSubTree, parameters, props.treeRootId]
21
21
  );
22
22
  const accessor = useAccessorUpdateSubscription(getAccessor);
23
- return /* @__PURE__ */ jsx(EntityList, { ...props, accessor });
23
+ return /* @__PURE__ */ jsxDEV(EntityList, { ...props, accessor }, void 0, false, {
24
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntityListSubTree.tsx",
25
+ lineNumber: 62,
26
+ columnNumber: 10
27
+ }, globalThis);
24
28
  },
25
29
  {
26
30
  generateBranchMarker: (props, fields, environment) => {
@@ -29,10 +33,18 @@ const EntityListSubTree = Component(
29
33
  }
30
34
  return MarkerFactory.createEntityListSubTreeMarker(props, fields, environment);
31
35
  },
32
- staticRender: (props) => /* @__PURE__ */ jsxs(EntityList, { ...props, accessor: 0, children: [
33
- /* @__PURE__ */ jsx(Field, { field: PRIMARY_KEY_NAME }),
36
+ staticRender: (props) => /* @__PURE__ */ jsxDEV(EntityList, { ...props, accessor: 0, children: [
37
+ /* @__PURE__ */ jsxDEV(Field, { field: PRIMARY_KEY_NAME }, void 0, false, {
38
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntityListSubTree.tsx",
39
+ lineNumber: 73,
40
+ columnNumber: 5
41
+ }, globalThis),
34
42
  props.children
35
- ] }),
43
+ ] }, void 0, true, {
44
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntityListSubTree.tsx",
45
+ lineNumber: 72,
46
+ columnNumber: 4
47
+ }, globalThis),
36
48
  generateEnvironment: (props, oldEnvironment) => {
37
49
  const environment = oldEnvironment.withVariables(props.variables);
38
50
  return TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props);
@@ -1 +1 @@
1
- {"version":3,"file":"EntityListSubTree.js","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ComponentType, ReactElement, ReactNode, useCallback } from 'react'\nimport {\n\tuseAccessorUpdateSubscription,\n\tuseEntityListSubTreeParameters,\n\tuseGetEntityListSubTree,\n} from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntityListSubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntityListSubTreeProps<ListProps, EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntityListSubTreeAdditionalProps &\n\t(SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * Creates a subtree with list of entities in current data binding context.\n *\n * @example\n * ```\n * <EntityListSubTree entities=\"Post\" />\n * ```\n *\n * @group Data binding\n */\nexport const EntityListSubTree = Component(\n\t<ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntityListSubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntityListSubTree()\n\t\tconst parameters = useEntityListSubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ?\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne\n\t\t// ) :\n\t\t// \tprops.children\n\t\t// )\n\t\treturn <EntityList {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntityListSubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={0 as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props)\n\t\t},\n\t},\n\t'EntityListSubTree',\n) as <ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CO,MAAM,oBAAoB;AAAA,EAChC,CAAyB,UAA0D;AACxD,8BAAA,MAAM,YAAY,6CAA6C;AAEzF,UAAM,aAAa;AACb,UAAA,aAAa,+BAA+B,KAAK;AACvD,UAAM,cAAc;AAAA,MACnB,MAAM,WAAW,YAAY,MAAM,UAAU;AAAA,MAC7C,CAAC,YAAY,YAAY,MAAM,UAAU;AAAA,IAAA;AAEpC,UAAA,WAAW,8BAA8B,WAAW;AAQ1D,WAAQ,oBAAA,YAAA,EAAY,GAAG,OAAO,SAAoB,CAAA;AAAA,EACnD;AAAA,EACA;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,UAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,eAAO,cAAc,2CAA2C,OAAO,QAAQ,WAAW;AAAA,MAC3F;AACA,aAAO,cAAc,8BAA8B,OAAO,QAAQ,WAAW;AAAA,IAC9E;AAAA,IACA,cAAc,CACb,UAAA,qBAAC,cAAY,GAAG,OAAO,UAAU,GAChC,UAAA;AAAA,MAAC,oBAAA,OAAA,EAAM,OAAO,iBAAkB,CAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,GACR;AAAA,IAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,sCAAsC,aAAa,KAAK;AAAA,IAC3F;AAAA,EACD;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"EntityListSubTree.js","sources":["../../../src/coreComponents/EntityListSubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ComponentType, ReactElement, ReactNode, useCallback } from 'react'\nimport {\n\tuseAccessorUpdateSubscription,\n\tuseEntityListSubTreeParameters,\n\tuseGetEntityListSubTree,\n} from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredQualifiedEntityList, SugaredUnconstrainedQualifiedEntityList, TreeRootId } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntityListSubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntityListSubTreeProps<ListProps, EntityProps> = {\n\ttreeRootId?: TreeRootId\n\tchildren?: ReactNode\n} & EntityListSubTreeAdditionalProps &\n\t(SugaredQualifiedEntityList | SugaredUnconstrainedQualifiedEntityList) &\n\t(\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * Creates a subtree with list of entities in current data binding context.\n *\n * @example\n * ```\n * <EntityListSubTree entities=\"Post\" />\n * ```\n *\n * @group Data binding\n */\nexport const EntityListSubTree = Component(\n\t<ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntityListSubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntityListSubTree()\n\t\tconst parameters = useEntityListSubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ?\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne\n\t\t// ) :\n\t\t// \tprops.children\n\t\t// )\n\t\treturn <EntityList {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntityListSubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntityListSubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={0 as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityListSubtree(environment, props)\n\t\t},\n\t},\n\t'EntityListSubTree',\n) as <ListProps, EntityProps>(props: EntityListSubTreeProps<ListProps, EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;;;;;;;AA2CO,MAAM,oBAAoB;AAAA,EAChC,CAAyB,UAA0D;AACxD,8BAAA,MAAM,YAAY,6CAA6C;AAEzF,UAAM,aAAa;AACb,UAAA,aAAa,+BAA+B,KAAK;AACvD,UAAM,cAAc;AAAA,MACnB,MAAM,WAAW,YAAY,MAAM,UAAU;AAAA,MAC7C,CAAC,YAAY,YAAY,MAAM,UAAU;AAAA,IAAA;AAEpC,UAAA,WAAW,8BAA8B,WAAW;AAQ1D,WAAQ,uBAAA,YAAA,EAAY,GAAG,OAAO,YAAvB,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAA2C,GAAAA,UAAA;AAAA,EACnD;AAAA,EACA;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,UAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,eAAO,cAAc,2CAA2C,OAAO,QAAQ,WAAW;AAAA,MAC3F;AACA,aAAO,cAAc,8BAA8B,OAAO,QAAQ,WAAW;AAAA,IAC9E;AAAA,IACA,cAAc,CACb,UAAA,uBAAC,cAAY,GAAG,OAAO,UAAU,GAChC,UAAA;AAAA,MAAC,uBAAA,OAAA,EAAM,OAAO,iBAAd,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAgC,GAAAA,UAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,UAAA;AAAA,IAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,sCAAsC,aAAa,KAAK;AAAA,IAC3F;AAAA,EACD;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
2
  import { useConstantValueInvariant } from "@contember/react-utils";
3
3
  import { useCallback } from "react";
4
4
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
@@ -21,7 +21,11 @@ const EntitySubTree = Component(
21
21
  [getSubTree, parameters, props.treeRootId]
22
22
  );
23
23
  const accessor = useAccessorUpdateSubscription(getAccessor);
24
- return /* @__PURE__ */ jsx(Entity, { ...props, accessor });
24
+ return /* @__PURE__ */ jsxDEV(Entity, { ...props, accessor }, void 0, false, {
25
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntitySubTree.tsx",
26
+ lineNumber: 63,
27
+ columnNumber: 10
28
+ }, globalThis);
25
29
  },
26
30
  {
27
31
  generateBranchMarker: (props, fields, environment) => {
@@ -30,20 +34,40 @@ const EntitySubTree = Component(
30
34
  }
31
35
  return MarkerFactory.createEntitySubTreeMarker(props, fields, environment);
32
36
  },
33
- staticRender: (props) => /* @__PURE__ */ jsxs(Fragment, { children: [
34
- /* @__PURE__ */ jsxs(Entity, { ...props, accessor: 0, children: [
35
- /* @__PURE__ */ jsx(Field, { field: PRIMARY_KEY_NAME }),
37
+ staticRender: (props) => /* @__PURE__ */ jsxDEV(Fragment, { children: [
38
+ /* @__PURE__ */ jsxDEV(Entity, { ...props, accessor: 0, children: [
39
+ /* @__PURE__ */ jsxDEV(Field, { field: PRIMARY_KEY_NAME }, void 0, false, {
40
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntitySubTree.tsx",
41
+ lineNumber: 75,
42
+ columnNumber: 6
43
+ }, globalThis),
36
44
  props.children
37
- ] }),
38
- props.isCreating && "orderField" in props && /* @__PURE__ */ jsx(
45
+ ] }, void 0, true, {
46
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntitySubTree.tsx",
47
+ lineNumber: 74,
48
+ columnNumber: 5
49
+ }, globalThis),
50
+ props.isCreating && "orderField" in props && /* @__PURE__ */ jsxDEV(
39
51
  SetOrderFieldOnCreate,
40
52
  {
41
53
  orderField: props.orderField,
42
54
  newOrderFieldValue: props.newOrderFieldValue,
43
55
  entity: props.entity
44
- }
56
+ },
57
+ void 0,
58
+ false,
59
+ {
60
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntitySubTree.tsx",
61
+ lineNumber: 79,
62
+ columnNumber: 6
63
+ },
64
+ globalThis
45
65
  )
46
- ] }),
66
+ ] }, void 0, true, {
67
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/EntitySubTree.tsx",
68
+ lineNumber: 73,
69
+ columnNumber: 4
70
+ }, globalThis),
47
71
  generateEnvironment: (props, oldEnvironment) => {
48
72
  const environment = oldEnvironment.withVariables(props.variables);
49
73
  return TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props);
@@ -1 +1 @@
1
- {"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> =\n\t& {\n\t\ttreeRootId?: TreeRootId\n\t\tchildren?: ReactNode\n\t}\n\t& EntitySubTreeAdditionalProps\n\t& (\n\t\t| SugaredQualifiedSingleEntity\n\t\t| (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)\n\t)\n\n/**\n * Creates a single entity subtree in current data binding context.\n *\n * @example\n * ```\n * <EntitySubTree entity=\"Post(id = $id)\" />\n * ```\n *\n * @group Data binding\n */\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props)\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;;;;;;AA4CO,MAAM,gBAAgB;AAAA,EAC5B,CAAyB,UAA2C;AACzC,8BAAA,MAAM,YAAY,yCAAyC;AAErF,UAAM,aAAa;AACb,UAAA,aAAa,2BAA2B,KAAK;AACnD,UAAM,cAAc;AAAA,MACnB,MAAM,WAAW,YAAY,MAAM,UAAU;AAAA,MAC7C,CAAC,YAAY,YAAY,MAAM,UAAU;AAAA,IAAA;AAEpC,UAAA,WAAW,8BAA8B,WAAW;AAQ1D,WAAQ,oBAAA,QAAA,EAAQ,GAAG,OAAO,SAAoB,CAAA;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,UAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,eAAO,cAAc,uCAAuC,OAAO,QAAQ,WAAW;AAAA,MACvF;AACA,aAAO,cAAc,0BAA0B,OAAO,QAAQ,WAAW;AAAA,IAC1E;AAAA,IACA,cAAc,WAEZ,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,qBAAC,QAAQ,EAAA,GAAG,OAAO,UAAU,GAC5B,UAAA;AAAA,QAAC,oBAAA,OAAA,EAAM,OAAO,iBAAkB,CAAA;AAAA,QAC/B,MAAM;AAAA,MAAA,GACR;AAAA,MACC,MAAM,cAAc,gBAAgB,SACpC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,YAAY,MAAM;AAAA,UAClB,oBAAoB,MAAM;AAAA,UAC1B,QAAQ,MAAM;AAAA,QAAA;AAAA,MACf;AAAA,IAAA,GAEF;AAAA,IAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,kCAAkC,aAAa,KAAK;AAAA,IACvF;AAAA,EACD;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"EntitySubTree.js","sources":["../../../src/coreComponents/EntitySubTree.tsx"],"sourcesContent":["import { useConstantValueInvariant } from '@contember/react-utils'\nimport { ReactElement, ReactNode, useCallback } from 'react'\nimport { useAccessorUpdateSubscription, useEntitySubTreeParameters, useGetEntitySubTree } from '../accessorPropagation'\nimport { SetOrderFieldOnCreate, SetOrderFieldOnCreateOwnProps } from '../accessorSorting'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type {\n\tSugaredQualifiedSingleEntity,\n\tSugaredUnconstrainedQualifiedSingleEntity,\n\tTreeRootId,\n} from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface EntitySubTreeAdditionalProps {\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\nexport type EntitySubTreeAdditionalCreationProps = {} | SetOrderFieldOnCreateOwnProps\n\nexport type EntitySubTreeProps<EntityProps> =\n\t& {\n\t\ttreeRootId?: TreeRootId\n\t\tchildren?: ReactNode\n\t}\n\t& EntitySubTreeAdditionalProps\n\t& (\n\t\t| SugaredQualifiedSingleEntity\n\t\t| (SugaredUnconstrainedQualifiedSingleEntity & EntitySubTreeAdditionalCreationProps)\n\t)\n\n/**\n * Creates a single entity subtree in current data binding context.\n *\n * @example\n * ```\n * <EntitySubTree entity=\"Post(id = $id)\" />\n * ```\n *\n * @group Data binding\n */\nexport const EntitySubTree = Component(\n\t<EntityProps extends {}>(props: EntitySubTreeProps<EntityProps>) => {\n\t\tuseConstantValueInvariant(props.isCreating, 'EntitySubTree: cannot update isCreating')\n\n\t\tconst getSubTree = useGetEntitySubTree()\n\t\tconst parameters = useEntitySubTreeParameters(props)\n\t\tconst getAccessor = useCallback(\n\t\t\t() => getSubTree(parameters, props.treeRootId),\n\t\t\t[getSubTree, parameters, props.treeRootId],\n\t\t)\n\t\tconst accessor = useAccessorUpdateSubscription(getAccessor)\n\n\t\t// TODO revive top-level hasOneRelationPath\n\t\t// {parameters.value.hasOneRelationPath.length ? (\n\t\t// \t<HasOne field={parameters.value.hasOneRelationPath}>{props.children}</HasOne>\n\t\t// ) : (\n\t\t// \tprops.children\n\t\t// )}\n\t\treturn <Entity {...props} accessor={accessor} />\n\t},\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tif ('isCreating' in props && props.isCreating) {\n\t\t\t\treturn MarkerFactory.createUnconstrainedEntitySubTreeMarker(props, fields, environment)\n\t\t\t}\n\t\t\treturn MarkerFactory.createEntitySubTreeMarker(props, fields, environment)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t<Entity {...props} accessor={0 as any}>\n\t\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t\t{props.children}\n\t\t\t\t</Entity>\n\t\t\t\t{props.isCreating && 'orderField' in props && (\n\t\t\t\t\t<SetOrderFieldOnCreate\n\t\t\t\t\t\torderField={props.orderField}\n\t\t\t\t\t\tnewOrderFieldValue={props.newOrderFieldValue}\n\t\t\t\t\t\tentity={props.entity}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</>\n\t\t),\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntitySubtree(environment, props)\n\t\t},\n\t},\n\t'EntitySubTree',\n) as <EntityProps>(pros: EntitySubTreeProps<EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;;;;;;;;AA4CO,MAAM,gBAAgB;AAAA,EAC5B,CAAyB,UAA2C;AACzC,8BAAA,MAAM,YAAY,yCAAyC;AAErF,UAAM,aAAa;AACb,UAAA,aAAa,2BAA2B,KAAK;AACnD,UAAM,cAAc;AAAA,MACnB,MAAM,WAAW,YAAY,MAAM,UAAU;AAAA,MAC7C,CAAC,YAAY,YAAY,MAAM,UAAU;AAAA,IAAA;AAEpC,UAAA,WAAW,8BAA8B,WAAW;AAQ1D,WAAQ,uBAAA,QAAA,EAAQ,GAAG,OAAO,YAAnB,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAuC,GAAAA,UAAA;AAAA,EAC/C;AAAA,EACA;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACjD,UAAA,gBAAgB,SAAS,MAAM,YAAY;AAC9C,eAAO,cAAc,uCAAuC,OAAO,QAAQ,WAAW;AAAA,MACvF;AACA,aAAO,cAAc,0BAA0B,OAAO,QAAQ,WAAW;AAAA,IAC1E;AAAA,IACA,cAAc,WAEZ,uBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,uBAAC,QAAQ,EAAA,GAAG,OAAO,UAAU,GAC5B,UAAA;AAAA,QAAC,uBAAA,OAAA,EAAM,OAAO,iBAAd,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAgC,GAAAA,UAAA;AAAA,QAC/B,MAAM;AAAA,MAAA,KAFR,QAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAGA,GAAAA,UAAA;AAAA,MACC,MAAM,cAAc,gBAAgB,SACpC;AAAA,QAAC;AAAA,QAAA;AAAA,UACA,YAAY,MAAM;AAAA,UAClB,oBAAoB,MAAM;AAAA,UAC1B,QAAQ,MAAM;AAAA,QAAA;AAAA,QAHf;AAAA,QAAA;AAAA,QAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAA;AAAA,QAAAA;AAAAA,MAIA;AAAA,IAAA,KAVF,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAYA,GAAAA,UAAA;AAAA,IAED,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,kCAAkC,aAAa,KAAK;AAAA,IACvF;AAAA,EACD;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
2
  import { GraphQlBuilder } from "@contember/client";
3
3
  import { Component } from "./Component.js";
4
4
  import { TreeNodeEnvironmentFactory } from "../dao/TreeNodeEnvironmentFactory.js";
@@ -8,12 +8,20 @@ const Field = Component(
8
8
  (props) => {
9
9
  const field = useField(props);
10
10
  if (props.format !== void 0) {
11
- return /* @__PURE__ */ jsx(Fragment, { children: props.format(field.value) });
11
+ return /* @__PURE__ */ jsxDEV(Fragment, { children: props.format(field.value) }, void 0, false, {
12
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/Field.tsx",
13
+ lineNumber: 27,
14
+ columnNumber: 11
15
+ }, globalThis);
12
16
  }
13
17
  if (field.value instanceof GraphQlBuilder.GraphQlLiteral || field.value === null || typeof field.value === "boolean") {
14
18
  return null;
15
19
  }
16
- return /* @__PURE__ */ jsx(Fragment, { children: field.value });
20
+ return /* @__PURE__ */ jsxDEV(Fragment, { children: field.value }, void 0, false, {
21
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/Field.tsx",
22
+ lineNumber: 37,
23
+ columnNumber: 10
24
+ }, globalThis);
17
25
  },
18
26
  {
19
27
  generateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","sources":["../../../src/coreComponents/Field.tsx"],"sourcesContent":["import { GraphQlBuilder } from '@contember/client'\nimport type { ReactElement, ReactNode } from 'react'\nimport { useField } from '../accessorPropagation'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { Component } from './Component'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface FieldBasicProps extends SugaredRelativeSingleField {}\n\nexport interface FieldRuntimeProps<Persisted extends FieldValue = FieldValue> {\n\tformat?: (value: Persisted | null) => ReactNode\n}\n\nexport interface FieldProps<Persisted extends FieldValue = FieldValue>\n\textends FieldBasicProps,\n\t\tFieldRuntimeProps<Persisted> {}\n\n/**\n * @group Data binding\n */\nexport const Field = Component(\n\t<Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => {\n\t\tconst field = useField<Persisted>(props)\n\n\t\tif (props.format !== undefined) {\n\t\t\treturn <>{props.format(field.value)}</>\n\t\t}\n\n\t\tif (\n\t\t\tfield.value instanceof GraphQlBuilder.GraphQlLiteral ||\n\t\t\tfield.value === null ||\n\t\t\ttypeof field.value === 'boolean'\n\t\t) {\n\t\t\treturn null\n\t\t}\n\t\treturn <>{field.value}</>\n\t},\n\t{\n\t\tgenerateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),\n\t\tgenerateEnvironment: (props, environment) => {\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props)\n\t\t},\n\t},\n\t'Field',\n) as <Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => ReactElement\n"],"names":[],"mappings":";;;;;;AAqBO,MAAM,QAAQ;AAAA,EACpB,CAA4C,UAAiC;AACtE,UAAA,QAAQ,SAAoB,KAAK;AAEnC,QAAA,MAAM,WAAW,QAAW;AAC/B,aAAU,oBAAA,UAAA,EAAA,UAAA,MAAM,OAAO,MAAM,KAAK,EAAE,CAAA;AAAA,IACrC;AAGC,QAAA,MAAM,iBAAiB,eAAe,kBACtC,MAAM,UAAU,QAChB,OAAO,MAAM,UAAU,WACtB;AACM,aAAA;AAAA,IACR;AACO,WAAA,oBAAA,UAAA,EAAG,gBAAM,MAAM,CAAA;AAAA,EACvB;AAAA,EACA;AAAA,IACC,oBAAoB,CAAC,OAAO,gBAAgB,cAAc,kBAAkB,OAAO,WAAW;AAAA,IAC9F,qBAAqB,CAAC,OAAO,gBAAgB;AACrC,aAAA,2BAA2B,0BAA0B,aAAa,KAAK;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"Field.js","sources":["../../../src/coreComponents/Field.tsx"],"sourcesContent":["import { GraphQlBuilder } from '@contember/client'\nimport type { ReactElement, ReactNode } from 'react'\nimport { useField } from '../accessorPropagation'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { FieldValue, SugaredRelativeSingleField } from '../treeParameters'\nimport { Component } from './Component'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport interface FieldBasicProps extends SugaredRelativeSingleField {}\n\nexport interface FieldRuntimeProps<Persisted extends FieldValue = FieldValue> {\n\tformat?: (value: Persisted | null) => ReactNode\n}\n\nexport interface FieldProps<Persisted extends FieldValue = FieldValue>\n\textends FieldBasicProps,\n\t\tFieldRuntimeProps<Persisted> {}\n\n/**\n * @group Data binding\n */\nexport const Field = Component(\n\t<Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => {\n\t\tconst field = useField<Persisted>(props)\n\n\t\tif (props.format !== undefined) {\n\t\t\treturn <>{props.format(field.value)}</>\n\t\t}\n\n\t\tif (\n\t\t\tfield.value instanceof GraphQlBuilder.GraphQlLiteral ||\n\t\t\tfield.value === null ||\n\t\t\ttypeof field.value === 'boolean'\n\t\t) {\n\t\t\treturn null\n\t\t}\n\t\treturn <>{field.value}</>\n\t},\n\t{\n\t\tgenerateLeafMarker: (props, environment) => MarkerFactory.createFieldMarker(props, environment),\n\t\tgenerateEnvironment: (props, environment) => {\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForField(environment, props)\n\t\t},\n\t},\n\t'Field',\n) as <Persisted extends FieldValue = FieldValue>(props: FieldProps<Persisted>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;AAqBO,MAAM,QAAQ;AAAA,EACpB,CAA4C,UAAiC;AACtE,UAAA,QAAQ,SAAoB,KAAK;AAEnC,QAAA,MAAM,WAAW,QAAW;AAC/B,aAAU,uBAAA,UAAA,EAAA,UAAA,MAAM,OAAO,MAAM,KAAK,EAA3B,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAA6B,GAAAA,UAAA;AAAA,IACrC;AAGC,QAAA,MAAM,iBAAiB,eAAe,kBACtC,MAAM,UAAU,QAChB,OAAO,MAAM,UAAU,WACtB;AACM,aAAA;AAAA,IACR;AACO,WAAA,uBAAA,UAAA,EAAG,gBAAM,MAAT,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAe,GAAAA,UAAA;AAAA,EACvB;AAAA,EACA;AAAA,IACC,oBAAoB,CAAC,OAAO,gBAAgB,cAAc,kBAAkB,OAAO,WAAW;AAAA,IAC9F,qBAAqB,CAAC,OAAO,gBAAgB;AACrC,aAAA,2BAA2B,0BAA0B,aAAa,KAAK;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
3
3
  import { Component } from "./Component.js";
4
4
  import { EntityList } from "./EntityList.js";
@@ -9,17 +9,29 @@ import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
9
9
  const HasMany = Component(
10
10
  (props) => {
11
11
  const entityList = useEntityList(props);
12
- return /* @__PURE__ */ jsx(EntityList, { ...props, accessor: entityList });
12
+ return /* @__PURE__ */ jsxDEV(EntityList, { ...props, accessor: entityList }, void 0, false, {
13
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/HasMany.tsx",
14
+ lineNumber: 30,
15
+ columnNumber: 10
16
+ }, globalThis);
13
17
  },
14
18
  {
15
19
  generateEnvironment: (props, oldEnvironment) => {
16
20
  const environment = oldEnvironment.withVariables(props.variables);
17
21
  return TreeNodeEnvironmentFactory.createEnvironmentForEntityList(environment, props);
18
22
  },
19
- staticRender: (props) => /* @__PURE__ */ jsxs(EntityList, { ...props, accessor: void 0, children: [
20
- /* @__PURE__ */ jsx(Field, { field: PRIMARY_KEY_NAME }),
23
+ staticRender: (props) => /* @__PURE__ */ jsxDEV(EntityList, { ...props, accessor: void 0, children: [
24
+ /* @__PURE__ */ jsxDEV(Field, { field: PRIMARY_KEY_NAME }, void 0, false, {
25
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/HasMany.tsx",
26
+ lineNumber: 39,
27
+ columnNumber: 5
28
+ }, globalThis),
21
29
  props.children
22
- ] }),
30
+ ] }, void 0, true, {
31
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/HasMany.tsx",
32
+ lineNumber: 38,
33
+ columnNumber: 4
34
+ }, globalThis),
23
35
  generateBranchMarker: (props, fields, environment) => MarkerFactory.createRelativeEntityListFields(props, environment, fields)
24
36
  },
25
37
  "HasMany"
@@ -1 +1 @@
1
- {"version":3,"file":"HasMany.js","sources":["../../../src/coreComponents/HasMany.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntityList } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport type HasManyProps<ListProps = never, EntityProps = never> = SugaredRelativeEntityList & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n} & (\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * @group Data binding\n */\nexport const HasMany = Component(\n\t<ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => {\n\t\tconst entityList = useEntityList(props)\n\n\t\treturn <EntityList {...props} accessor={entityList} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityList(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeEntityListFields(props, environment, fields),\n\t},\n\t'HasMany',\n) as <ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;AAyBO,MAAM,UAAU;AAAA,EACtB,CAAyB,UAAgD;AAClE,UAAA,aAAa,cAAc,KAAK;AAEtC,WAAQ,oBAAA,YAAA,EAAY,GAAG,OAAO,UAAU,WAAY,CAAA;AAAA,EACrD;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,+BAA+B,aAAa,KAAK;AAAA,IACpF;AAAA,IACA,cAAc,CACb,UAAA,qBAAC,cAAY,GAAG,OAAO,UAAU,QAChC,UAAA;AAAA,MAAC,oBAAA,OAAA,EAAM,OAAO,iBAAkB,CAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,GACR;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,+BAA+B,OAAO,aAAa,MAAM;AAAA,EACzE;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"HasMany.js","sources":["../../../src/coreComponents/HasMany.tsx"],"sourcesContent":["import type { ComponentType, ReactElement, ReactNode } from 'react'\nimport { useEntityList } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeEntityList } from '../treeParameters'\nimport { Component } from './Component'\nimport { EntityList, EntityListBaseProps } from './EntityList'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport type HasManyProps<ListProps = never, EntityProps = never> = SugaredRelativeEntityList & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n} & (\n\t\t| {}\n\t\t| {\n\t\t\t\tlistComponent: ComponentType<ListProps & EntityListBaseProps>\n\t\t\t\tlistProps?: ListProps\n\t\t }\n\t)\n\n/**\n * @group Data binding\n */\nexport const HasMany = Component(\n\t<ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => {\n\t\tconst entityList = useEntityList(props)\n\n\t\treturn <EntityList {...props} accessor={entityList} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntityList(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<EntityList {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</EntityList>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeEntityListFields(props, environment, fields),\n\t},\n\t'HasMany',\n) as <ListProps, EntityProps>(props: HasManyProps<ListProps, EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;;;AAyBO,MAAM,UAAU;AAAA,EACtB,CAAyB,UAAgD;AAClE,UAAA,aAAa,cAAc,KAAK;AAEtC,WAAQ,uBAAA,YAAA,EAAY,GAAG,OAAO,UAAU,WAAjC,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAA6C,GAAAA,UAAA;AAAA,EACrD;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,+BAA+B,aAAa,KAAK;AAAA,IACpF;AAAA,IACA,cAAc,CACb,UAAA,uBAAC,cAAY,GAAG,OAAO,UAAU,QAChC,UAAA;AAAA,MAAC,uBAAA,OAAA,EAAM,OAAO,iBAAd,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAgC,GAAAA,UAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,UAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,+BAA+B,OAAO,aAAa,MAAM;AAAA,EACzE;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
3
3
  import { Component } from "./Component.js";
4
4
  import { Entity } from "./Entity.js";
@@ -9,17 +9,29 @@ import { useEntity } from "../accessorPropagation/useEntity.js";
9
9
  const HasOne = Component(
10
10
  (props) => {
11
11
  const entity = useEntity(props);
12
- return /* @__PURE__ */ jsx(Entity, { ...props, accessor: entity });
12
+ return /* @__PURE__ */ jsxDEV(Entity, { ...props, accessor: entity }, void 0, false, {
13
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/HasOne.tsx",
14
+ lineNumber: 24,
15
+ columnNumber: 10
16
+ }, globalThis);
13
17
  },
14
18
  {
15
19
  generateEnvironment: (props, oldEnvironment) => {
16
20
  const environment = oldEnvironment.withVariables(props.variables);
17
21
  return TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props);
18
22
  },
19
- staticRender: (props) => /* @__PURE__ */ jsxs(Entity, { ...props, accessor: void 0, children: [
20
- /* @__PURE__ */ jsx(Field, { field: PRIMARY_KEY_NAME }),
23
+ staticRender: (props) => /* @__PURE__ */ jsxDEV(Entity, { ...props, accessor: void 0, children: [
24
+ /* @__PURE__ */ jsxDEV(Field, { field: PRIMARY_KEY_NAME }, void 0, false, {
25
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/HasOne.tsx",
26
+ lineNumber: 33,
27
+ columnNumber: 5
28
+ }, globalThis),
21
29
  props.children
22
- ] }),
30
+ ] }, void 0, true, {
31
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/HasOne.tsx",
32
+ lineNumber: 32,
33
+ columnNumber: 4
34
+ }, globalThis),
23
35
  generateBranchMarker: (props, fields, environment) => MarkerFactory.createRelativeSingleEntityFields(props, environment, fields)
24
36
  },
25
37
  "HasOne"
@@ -1 +1 @@
1
- {"version":3,"file":"HasOne.js","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\n/**\n * @group Data binding\n */\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":[],"mappings":";;;;;;;;AAmBO,MAAM,SAAS;AAAA,EACrB,CAAyB,UAAoC;AACtD,UAAA,SAAS,UAAU,KAAK;AAE9B,WAAQ,oBAAA,QAAA,EAAQ,GAAG,OAAO,UAAU,OAAQ,CAAA;AAAA,EAC7C;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,2BAA2B,aAAa,KAAK;AAAA,IAChF;AAAA,IACA,cAAc,CACb,UAAA,qBAAC,UAAQ,GAAG,OAAO,UAAU,QAC5B,UAAA;AAAA,MAAC,oBAAA,OAAA,EAAM,OAAO,iBAAkB,CAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,GACR;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,iCAAiC,OAAO,aAAa,MAAM;AAAA,EAC3E;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"HasOne.js","sources":["../../../src/coreComponents/HasOne.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react'\nimport { useEntity } from '../accessorPropagation'\nimport { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport { Environment } from '../dao'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredRelativeSingleEntity } from '../treeParameters'\nimport { Component } from './Component'\nimport { Entity } from './Entity'\nimport { Field } from './Field'\nimport { TreeNodeEnvironmentFactory } from '../dao/TreeNodeEnvironmentFactory'\n\nexport type HasOneProps<EntityProps = never> = SugaredRelativeSingleEntity & {\n\tchildren?: ReactNode\n\tvariables?: Environment.ValuesMapWithFactory\n}\n\n/**\n * @group Data binding\n */\nexport const HasOne = Component(\n\t<EntityProps extends {}>(props: HasOneProps<EntityProps>) => {\n\t\tconst entity = useEntity(props)\n\n\t\treturn <Entity {...props} accessor={entity} />\n\t},\n\t{\n\t\tgenerateEnvironment: (props, oldEnvironment) => {\n\t\t\tconst environment = oldEnvironment.withVariables(props.variables)\n\t\t\treturn TreeNodeEnvironmentFactory.createEnvironmentForEntity(environment, props)\n\t\t},\n\t\tstaticRender: props => (\n\t\t\t<Entity {...props} accessor={undefined as any}>\n\t\t\t\t<Field field={PRIMARY_KEY_NAME} />\n\t\t\t\t{props.children}\n\t\t\t</Entity>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createRelativeSingleEntityFields(props, environment, fields),\n\t},\n\t'HasOne',\n) as <EntityProps extends {}>(props: HasOneProps<EntityProps>) => ReactElement\n"],"names":["this"],"mappings":";;;;;;;;AAmBO,MAAM,SAAS;AAAA,EACrB,CAAyB,UAAoC;AACtD,UAAA,SAAS,UAAU,KAAK;AAE9B,WAAQ,uBAAA,QAAA,EAAQ,GAAG,OAAO,UAAU,OAA7B,GAAA,QAAA,OAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAqC,GAAAA,UAAA;AAAA,EAC7C;AAAA,EACA;AAAA,IACC,qBAAqB,CAAC,OAAO,mBAAmB;AAC/C,YAAM,cAAc,eAAe,cAAc,MAAM,SAAS;AACzD,aAAA,2BAA2B,2BAA2B,aAAa,KAAK;AAAA,IAChF;AAAA,IACA,cAAc,CACb,UAAA,uBAAC,UAAQ,GAAG,OAAO,UAAU,QAC5B,UAAA;AAAA,MAAC,uBAAA,OAAA,EAAM,OAAO,iBAAd,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAgC,GAAAA,UAAA;AAAA,MAC/B,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,UAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,iCAAiC,OAAO,aAAa,MAAM;AAAA,EAC3E;AAAA,EACA;AACD;"}
@@ -1,8 +1,12 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
2
  import { Component } from "./Component.js";
3
3
  import { MarkerFactory } from "../queryLanguage/MarkerFactory.js";
4
4
  const ParentEntity = Component(
5
- (props) => /* @__PURE__ */ jsx(Fragment, { children: props.children }),
5
+ (props) => /* @__PURE__ */ jsxDEV(Fragment, { children: props.children }, void 0, false, {
6
+ fileName: "/__w/interface/interface/packages/binding/src/coreComponents/ParentEntity.tsx",
7
+ lineNumber: 14,
8
+ columnNumber: 11
9
+ }, globalThis),
6
10
  {
7
11
  generateBranchMarker: (props, fields, environment) => MarkerFactory.createParentEntityMarker(props, fields, environment)
8
12
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ParentEntity.js","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredParentEntityParameters } from '../treeParameters'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":[],"mappings":";;;AAYO,MAAM,eAAe;AAAA,EAC3B,CAAA,UAAY,oBAAA,UAAA,EAAA,UAAA,MAAM,UAAS;AAAA,EAC3B;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,yBAAyB,OAAO,QAAQ,WAAW;AAAA,EACnE;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"ParentEntity.js","sources":["../../../src/coreComponents/ParentEntity.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { SugaredParentEntityParameters } from '../treeParameters'\nimport { Component } from './Component'\n\nexport interface ParentEntityProps extends SugaredParentEntityParameters {\n\tchildren?: ReactNode\n}\n\n/**\n * @group Data binding\n */\nexport const ParentEntity = Component<ParentEntityProps>(\n\tprops => <>{props.children}</>,\n\t{\n\t\tgenerateBranchMarker: (props, fields, environment) =>\n\t\t\tMarkerFactory.createParentEntityMarker(props, fields, environment),\n\t},\n\t'ParentEntity',\n)\n"],"names":["this"],"mappings":";;;AAYO,MAAM,eAAe;AAAA,EAC3B,CAAA,UAAY,uBAAA,UAAA,EAAA,UAAA,MAAM,SAAT,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAkB,GAAAA,UAAA;AAAA,EAC3B;AAAA,IACC,sBAAsB,CAAC,OAAO,QAAQ,gBACrC,cAAc,yBAAyB,OAAO,QAAQ,WAAW;AAAA,EACnE;AAAA,EACA;AACD;"}
@@ -1,4 +1,4 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
2
  import { useState, useCallback, useEffect } from "react";
3
3
  import { useConstantValueInvariant } from "@contember/react-utils";
4
4
  import { Component } from "../coreComponents/Component.js";
@@ -41,7 +41,11 @@ const DeferredSubTrees = Component(
41
41
  return;
42
42
  }
43
43
  setLoadState({ name: "loading" });
44
- const newFragment = /* @__PURE__ */ jsx(OnlyKeepSubTrees, { children: props.children });
44
+ const newFragment = /* @__PURE__ */ jsxDEV(OnlyKeepSubTrees, { children: props.children }, void 0, false, {
45
+ fileName: "/__w/interface/interface/packages/binding/src/helperComponents/DeferredSubTrees.tsx",
46
+ lineNumber: 66,
47
+ columnNumber: 24
48
+ }, globalThis);
45
49
  extendTree(newFragment, { signal, environment }).then((treeRootId) => !signal.aborted && setLoadState({ name: "success", treeRootId })).catch((error) => {
46
50
  if (signal.aborted) {
47
51
  return;
@@ -52,16 +56,28 @@ const DeferredSubTrees = Component(
52
56
  switch (loadState.name) {
53
57
  case "initial":
54
58
  case "loading":
55
- return /* @__PURE__ */ jsx(Fragment, { children: props.fallback });
59
+ return /* @__PURE__ */ jsxDEV(Fragment, { children: props.fallback }, void 0, false, {
60
+ fileName: "/__w/interface/interface/packages/binding/src/helperComponents/DeferredSubTrees.tsx",
61
+ lineNumber: 81,
62
+ columnNumber: 12
63
+ }, globalThis);
56
64
  case "success":
57
- return /* @__PURE__ */ jsx(TreeRootIdProvider, { treeRootId: loadState.treeRootId, children: props.children });
65
+ return /* @__PURE__ */ jsxDEV(TreeRootIdProvider, { treeRootId: loadState.treeRootId, children: props.children }, void 0, false, {
66
+ fileName: "/__w/interface/interface/packages/binding/src/helperComponents/DeferredSubTrees.tsx",
67
+ lineNumber: 87,
68
+ columnNumber: 12
69
+ }, globalThis);
58
70
  }
59
71
  },
60
72
  {
61
- staticRender: (props) => /* @__PURE__ */ jsxs(Fragment, { children: [
73
+ staticRender: (props) => /* @__PURE__ */ jsxDEV(Fragment, { children: [
62
74
  props.children,
63
75
  props.fallback
64
- ] }),
76
+ ] }, void 0, true, {
77
+ fileName: "/__w/interface/interface/packages/binding/src/helperComponents/DeferredSubTrees.tsx",
78
+ lineNumber: 92,
79
+ columnNumber: 4
80
+ }, globalThis),
65
81
  generateBranchMarker: (props, fields, environment) => {
66
82
  const fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment);
67
83
  fieldsWithHoistablesMarker.subTrees?.clear();
@@ -1 +1 @@
1
- {"version":3,"file":"DeferredSubTrees.js","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation'\nimport { useMutationState } from '../accessorTree'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '../markers'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { TreeRootId } from '../treeParameters'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { EntityAccessor } from '../accessors'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\n/**\n * @group Data binding\n */\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tconst hasEntity = useHasEntity()\n\t\tuseConstantValueInvariant(hasEntity)\n\t\tif (hasEntity) {\n\t\t\tuseEntityBeforePersist(\n\t\t\t\tuseCallback((getAccessor: EntityAccessor.GetEntityAccessor) => {\n\t\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t\t// components don't error.\n\t\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t\t}, []),\n\t\t\t)\n\t\t}\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tconst environment = useEnvironment()\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal, environment })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [environment, extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":[],"mappings":";;;;;;;;;;;;;AA2BO,MAAM,mBAAmB;AAAA,EAC/B,CAAS,UAAA;AACF,UAAA,EAAE,eAAe;AACvB,UAAM,aAAa;AAEb,UAAA,CAAC,WAAW,YAAY,IAAI,SAAoB,EAAE,MAAM,WAAW;AAEzE,UAAM,CAAC,eAAe,IAAI,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,UAAM,SAAS,gBAAgB;AAE/B,UAAM,YAAY;AAClB,8BAA0B,SAAS;AACnC,QAAI,WAAW;AACd;AAAA,QACC,YAAY,CAAC,gBAAkD;AAG1D,cAAA,cAAc,gBAAgB;AACjC;AAAA,UACD;AACa,uBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,QACjC,GAAG,EAAE;AAAA,MAAA;AAAA,IAEP;AAEA,cAAU,MAAM;AACf,aAAO,MAAM;AACZ,wBAAgB,MAAM;AAAA,MAAA;AAAA,IACvB,GACE,CAAC,eAAe,CAAC;AAEpB,UAAM,cAAc;AACpB,cAAU,MAAM;AACf,UAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,MACD;AACa,mBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,YAAM,cAAc,oBAAC,kBAAkB,EAAA,UAAA,MAAM,SAAS,CAAA;AAE3C,iBAAA,aAAa,EAAE,QAAQ,YAAa,CAAA,EAC7C,KAAK,gBAAc,CAAC,OAAO,WAAW,aAAa,EAAE,MAAM,WAAW,WAAA,CAAY,CAAC,EACnF,MAAM,CAAS,UAAA;AACf,YAAI,OAAO,SAAS;AACnB;AAAA,QACD;AACM,cAAA;AAAA,MAAA,CACN;AAAA,IAAA,GACA,CAAC,aAAa,YAAY,YAAY,UAAU,MAAM,MAAM,UAAU,MAAM,CAAC;AAEhF,YAAQ,UAAU,MAAM;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AACG,eAAA,oBAAA,UAAA,EAAG,gBAAM,SAAS,CAAA;AAAA,MAC1B,KAAK;AAKJ,mCAAQ,oBAAmB,EAAA,YAAY,UAAU,YAAa,gBAAM,SAAS,CAAA;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AAAA,IACC,cAAc,WAEX,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,IAAA,GACR;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACrD,YAAM,6BAA6B,cAAc,uCAAuC,QAAQ,WAAW;AAM3G,iCAA2B,UAAU;AAE9B,aAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA;AACD;AAEA,MAAM,mBAAmB;AAAA,EACxB,MAAM;AAAA,EACN;AAAA,IACC,sBAAsB,CAAC,OAAO,WAAW;AAElC,YAAA,cAAc,cAAc,kCAAkC,MAAS;AAE7E,UAAI,kBAAkB,6BAA6B;AAC3C,eAAA;AAAA,MACR;AACA,aAAO,IAAI,iCAAiC,aAAa,OAAO,UAAU,MAAS;AAAA,IACpF;AAAA,EACD;AAAA,EACA;AACD;"}
1
+ {"version":3,"file":"DeferredSubTrees.js","sources":["../../../src/helperComponents/DeferredSubTrees.tsx"],"sourcesContent":["import { ReactNode, useCallback, useEffect, useState } from 'react'\nimport { TreeRootIdProvider, useBindingOperations, useHasEntity, useEnvironment } from '../accessorPropagation'\nimport { useMutationState } from '../accessorTree'\nimport { Component } from '../coreComponents'\nimport { useEntityBeforePersist } from '../entityEvents'\nimport { EntityFieldMarkersContainer, EntityFieldsWithHoistablesMarker } from '../markers'\nimport { MarkerFactory } from '../queryLanguage'\nimport type { TreeRootId } from '../treeParameters'\nimport { useConstantValueInvariant } from '@contember/react-utils'\nimport { EntityAccessor } from '../accessors'\n\nexport interface DeferredSubTreesProps {\n\tfallback: ReactNode\n\tchildren: ReactNode\n}\n\ntype LoadState =\n\t| { name: 'initial' }\n\t| { name: 'loading' }\n\t| {\n\t\t\tname: 'success'\n\t\t\ttreeRootId: TreeRootId | undefined\n\t }\n\n/**\n * @group Data binding\n */\nexport const DeferredSubTrees = Component<DeferredSubTreesProps>(\n\tprops => {\n\t\tconst { extendTree } = useBindingOperations()\n\t\tconst isMutating = useMutationState()\n\n\t\tconst [loadState, setLoadState] = useState<LoadState>({ name: 'initial' })\n\n\t\tconst [abortController] = useState(() => new AbortController())\n\t\tconst signal = abortController.signal\n\n\t\tconst hasEntity = useHasEntity()\n\t\tuseConstantValueInvariant(hasEntity)\n\t\tif (hasEntity) {\n\t\t\tuseEntityBeforePersist(\n\t\t\t\tuseCallback((getAccessor: EntityAccessor.GetEntityAccessor) => {\n\t\t\t\t\t// This is a hack. We're really just circumventing the change of ids after a creation so that nested\n\t\t\t\t\t// components don't error.\n\t\t\t\t\tif (getAccessor().existsOnServer) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tsetLoadState({ name: 'initial' })\n\t\t\t\t}, []),\n\t\t\t)\n\t\t}\n\n\t\tuseEffect(() => {\n\t\t\treturn () => {\n\t\t\t\tabortController.abort()\n\t\t\t}\n\t\t}, [abortController])\n\n\t\tconst environment = useEnvironment()\n\t\tuseEffect(() => {\n\t\t\tif (isMutating || loadState.name !== 'initial' || signal.aborted) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsetLoadState({ name: 'loading' })\n\n\t\t\tconst newFragment = <OnlyKeepSubTrees>{props.children}</OnlyKeepSubTrees>\n\n\t\t\textendTree(newFragment, { signal, environment })\n\t\t\t\t.then(treeRootId => !signal.aborted && setLoadState({ name: 'success', treeRootId }))\n\t\t\t\t.catch(error => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tthrow error\n\t\t\t\t})\n\t\t}, [environment, extendTree, isMutating, loadState.name, props.children, signal])\n\n\t\tswitch (loadState.name) {\n\t\t\tcase 'initial':\n\t\t\tcase 'loading':\n\t\t\t\treturn <>{props.fallback}</>\n\t\t\tcase 'success':\n\t\t\t\t// This is tricky. The relations & fields within children will just render normally as if this\n\t\t\t\t// component didn't exist. The sub trees, however, will read the new treeRootId and draw their data\n\t\t\t\t// from the newly loaded batch provided by this component. That way the sub trees (and only the sub trees!)\n\t\t\t\t// effectively get lazy loaded.\n\t\t\t\treturn <TreeRootIdProvider treeRootId={loadState.treeRootId}>{props.children}</TreeRootIdProvider>\n\t\t}\n\t},\n\t{\n\t\tstaticRender: props => (\n\t\t\t<>\n\t\t\t\t{props.children}\n\t\t\t\t{props.fallback}\n\t\t\t</>\n\t\t),\n\t\tgenerateBranchMarker: (props, fields, environment) => {\n\t\t\tconst fieldsWithHoistablesMarker = MarkerFactory.createEntityFieldsWithHoistablesMarker(fields, environment)\n\n\t\t\t// We want to get rid of the subTrees but leave whatever relations and fields are present.\n\t\t\t//\n\t\t\t// Mutating from here is fine since we've literally just created it and no other code could possibly possess\n\t\t\t// a reference to this.\n\t\t\tfieldsWithHoistablesMarker.subTrees?.clear()\n\n\t\t\treturn fieldsWithHoistablesMarker\n\t\t},\n\t},\n\t'DeferredSubTree',\n)\n\nconst OnlyKeepSubTrees = Component<{ children: ReactNode }>(\n\t() => null,\n\t{\n\t\tgenerateBranchMarker: (props, fields) => {\n\t\t\t// This is the complement of the equivalent method above: this time we're only keeping the sub trees.\n\t\t\tconst emptyFields = MarkerFactory.createEntityFieldMarkersContainer(undefined)\n\n\t\t\tif (fields instanceof EntityFieldMarkersContainer) {\n\t\t\t\treturn emptyFields\n\t\t\t}\n\t\t\treturn new EntityFieldsWithHoistablesMarker(emptyFields, fields.subTrees, undefined)\n\t\t},\n\t},\n\t'OnlyKeepSubTrees',\n)\n"],"names":["this"],"mappings":";;;;;;;;;;;;;AA2BO,MAAM,mBAAmB;AAAA,EAC/B,CAAS,UAAA;AACF,UAAA,EAAE,eAAe;AACvB,UAAM,aAAa;AAEb,UAAA,CAAC,WAAW,YAAY,IAAI,SAAoB,EAAE,MAAM,WAAW;AAEzE,UAAM,CAAC,eAAe,IAAI,SAAS,MAAM,IAAI,gBAAiB,CAAA;AAC9D,UAAM,SAAS,gBAAgB;AAE/B,UAAM,YAAY;AAClB,8BAA0B,SAAS;AACnC,QAAI,WAAW;AACd;AAAA,QACC,YAAY,CAAC,gBAAkD;AAG1D,cAAA,cAAc,gBAAgB;AACjC;AAAA,UACD;AACa,uBAAA,EAAE,MAAM,UAAA,CAAW;AAAA,QACjC,GAAG,EAAE;AAAA,MAAA;AAAA,IAEP;AAEA,cAAU,MAAM;AACf,aAAO,MAAM;AACZ,wBAAgB,MAAM;AAAA,MAAA;AAAA,IACvB,GACE,CAAC,eAAe,CAAC;AAEpB,UAAM,cAAc;AACpB,cAAU,MAAM;AACf,UAAI,cAAc,UAAU,SAAS,aAAa,OAAO,SAAS;AACjE;AAAA,MACD;AACa,mBAAA,EAAE,MAAM,UAAA,CAAW;AAEhC,YAAM,cAAc,uBAAC,kBAAkB,EAAA,UAAA,MAAM,SAAzB,GAAA,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAkC,GAAAA,UAAA;AAE3C,iBAAA,aAAa,EAAE,QAAQ,YAAa,CAAA,EAC7C,KAAK,gBAAc,CAAC,OAAO,WAAW,aAAa,EAAE,MAAM,WAAW,WAAA,CAAY,CAAC,EACnF,MAAM,CAAS,UAAA;AACf,YAAI,OAAO,SAAS;AACnB;AAAA,QACD;AACM,cAAA;AAAA,MAAA,CACN;AAAA,IAAA,GACA,CAAC,aAAa,YAAY,YAAY,UAAU,MAAM,MAAM,UAAU,MAAM,CAAC;AAEhF,YAAQ,UAAU,MAAM;AAAA,MACvB,KAAK;AAAA,MACL,KAAK;AACG,eAAA,uBAAA,UAAA,EAAG,gBAAM,SAAT,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAkB,GAAAA,UAAA;AAAA,MAC1B,KAAK;AAKJ,sCAAQ,oBAAmB,EAAA,YAAY,UAAU,YAAa,gBAAM,SAA7D,GAAA,QAAA,OAAA;AAAA,UAAA,UAAA;AAAA,UAAA,YAAA;AAAA,UAAA,cAAA;AAAA,QAAsE,GAAAA,UAAA;AAAA,IAC/E;AAAA,EACD;AAAA,EACA;AAAA,IACC,cAAc,WAEX,uBAAA,UAAA,EAAA,UAAA;AAAA,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,IAAA,KAFR,QAAA,MAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAGA,GAAAA,UAAA;AAAA,IAED,sBAAsB,CAAC,OAAO,QAAQ,gBAAgB;AACrD,YAAM,6BAA6B,cAAc,uCAAuC,QAAQ,WAAW;AAM3G,iCAA2B,UAAU;AAE9B,aAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA;AACD;AAEA,MAAM,mBAAmB;AAAA,EACxB,MAAM;AAAA,EACN;AAAA,IACC,sBAAsB,CAAC,OAAO,WAAW;AAElC,YAAA,cAAc,cAAc,kCAAkC,MAAS;AAE7E,UAAI,kBAAkB,6BAA6B;AAC3C,eAAA;AAAA,MACR;AACA,aAAO,IAAI,iCAAiC,aAAa,OAAO,UAAU,MAAS;AAAA,IACpF;AAAA,EACD;AAAA,EACA;AACD;"}
@@ -1,8 +1,12 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
2
2
  import { useEntity } from "../accessorPropagation/useEntity.js";
3
3
  function EntityView(props) {
4
4
  const entity = "field" in props ? useEntity(props.field) : useEntity();
5
- return /* @__PURE__ */ jsx(Fragment, { children: props.render(entity) });
5
+ return /* @__PURE__ */ jsxDEV(Fragment, { children: props.render(entity) }, void 0, false, {
6
+ fileName: "/__w/interface/interface/packages/binding/src/helperComponents/EntityView.tsx",
7
+ lineNumber: 18,
8
+ columnNumber: 9
9
+ }, this);
6
10
  }
7
11
  export {
8
12
  EntityView