@vendure/admin-ui 2.2.7 → 2.3.1

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 (28) hide show
  1. package/core/common/generated-types.d.ts +6 -1
  2. package/core/common/version.d.ts +1 -1
  3. package/core/extension/components/route.component.d.ts +9 -2
  4. package/core/extension/register-route-component.d.ts +4 -0
  5. package/core/shared/components/order-state-label/order-state-label.component.d.ts +1 -1
  6. package/esm2022/core/common/generated-types.mjs +1 -1
  7. package/esm2022/core/common/introspection-result.mjs +1 -1
  8. package/esm2022/core/common/version.mjs +2 -2
  9. package/esm2022/core/data/utils/is-entity-create-or-update-mutation.mjs +1 -1
  10. package/esm2022/core/data/utils/remove-readonly-custom-fields.mjs +1 -1
  11. package/esm2022/core/extension/components/angular-route.component.mjs +10 -10
  12. package/esm2022/core/extension/components/route.component.mjs +32 -11
  13. package/esm2022/core/extension/register-data-table-component.mjs +1 -1
  14. package/esm2022/core/extension/register-route-component.mjs +4 -2
  15. package/esm2022/core/shared/components/timeline-entry/timeline-entry.component.mjs +1 -1
  16. package/esm2022/core/shared/providers/routing/can-deactivate-detail-guard.mjs +1 -1
  17. package/esm2022/core/shared/shared.module.mjs +1 -1
  18. package/esm2022/customer/customer.routes.mjs +1 -1
  19. package/esm2022/react/components/react-route.component.mjs +2 -2
  20. package/esm2022/react/react-components/RichTextEditor.mjs +1 -1
  21. package/esm2022/react/react-hooks/use-query.mjs +22 -8
  22. package/fesm2022/vendure-admin-ui-core.mjs +36 -16
  23. package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
  24. package/fesm2022/vendure-admin-ui-customer.mjs.map +1 -1
  25. package/fesm2022/vendure-admin-ui-react.mjs +22 -8
  26. package/fesm2022/vendure-admin-ui-react.mjs.map +1 -1
  27. package/package.json +9 -9
  28. package/react/react-hooks/use-query.d.ts +9 -5
@@ -132,7 +132,7 @@ class ReactRouteComponent {
132
132
  <vdr-route-component
133
133
  ><div [vdrReactComponentHost]="reactComponent" [props]="props"></div
134
134
  ></vdr-route-component>
135
- `, isInline: true, styles: [":host,.vdr-card{display:block;--card-padding: calc(var(--space-unit) * 3);container-type:inline-size}.card-container{border:1px solid var(--color-card-border);background-color:var(--color-card-bg);border-radius:var(--border-radius);padding:var(--card-padding) 0;box-shadow:0 2px 4px #0000000d}@container (max-width: 400px){.card-container{--card-padding: calc(var(--space-unit) * 2)}}.card-container.padding-x{padding-inline-start:var(--card-padding);padding-inline-end:var(--card-padding)}.title-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--card-padding)}.title{font-size:var(--font-size-base);padding:0 var(--card-padding)}.padding-x .title{padding:0}::ng-deep vdr-card+vdr-card{margin-top:calc(var(--space-unit) * 2)}.vdr-card+.vdr-card{margin-top:calc(var(--space-unit) * 2)}:host{display:block}.form-group label{font-size:var(--font-size-sm);color:var(--color-weight-800);margin-bottom:4px;display:inline-block}.tooltip-text{font-size:var(--font-size-xs);line-height:var(--font-size-sm);margin-bottom:4px}.input-row{display:flex}::ng-deep .input-row input:not([type=checkbox]),::ng-deep .input-row select,::ng-deep .input-row textarea,::ng-deep .input-row ng-select,::ng-deep .input-row vdr-zone-selector,::ng-deep .input-row vdr-facet-value-selector,::ng-deep .input-row vdr-option-value-input,::ng-deep .input-row vdr-affixed-input,::ng-deep .input-row vdr-currency-input,::ng-deep .input-row vdr-rich-text-editor{width:100%}::ng-deep .input-row.readonly input:not([type=checkbox])[readonly],::ng-deep .input-row.readonly select[readonly],::ng-deep .input-row.readonly textarea[readonly],::ng-deep .input-row.readonly ng-select[readonly],::ng-deep .input-row.readonly vdr-zone-selector[readonly],::ng-deep .input-row.readonly vdr-facet-value-selector[readonly],::ng-deep .input-row.readonly vdr-option-value-input[readonly],::ng-deep .input-row.readonly vdr-affixed-input[readonly],::ng-deep .input-row.readonly vdr-currency-input[readonly],::ng-deep .input-row.readonly vdr-rich-text-editor[readonly]{cursor:not-allowed}.input-row input:not([type=checkbox]),.input-row select,.input-row textarea{width:100%}::ng-deep .input-row.has-toggle input:not([type=checkbox]):not([type=radio]){border-start-end-radius:0!important;border-end-end-radius:0!important}.edit-button{border:1px solid var(--color-weight-200);border-radius:var(--border-radius-input);border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0}.edit-button.enabled{color:var(--color-primary-700);background-color:var(--color-primary-100)}:host,.vdr-action-bar{display:flex;justify-content:space-between;align-items:baseline;z-index:25;flex-direction:column-reverse}:host>.grow,.vdr-action-bar>.grow{flex:1}:host .right-content,.vdr-action-bar .right-content{width:100%;display:flex;justify-content:flex-end}:host ::ng-deep vdr-ab-right>*:last-child,.vdr-action-bar ::ng-deep vdr-ab-right>*:last-child{margin-inline-end:0px}@media screen and (min-width: 768px){:host,.vdr-action-bar{flex-direction:row}:host .right-content,.vdr-action-bar .right-content{width:initial}}:host,.vdr-page-detail-layout{display:grid;grid-template-columns:3fr 1fr}@media screen and (max-width: 992px){:host{grid-template-columns:1fr}}.sidebar{padding:var(--space-unit)}.form-group .input-row.invalid input:not([type=checkbox]):not([type=radio]),.form-group .input-row.invalid select,.form-group .input-row.invalid textarea{color:var(--color-error-700);border-color:var(--color-error-300)}\n"], dependencies: [{ kind: "directive", type: ReactComponentHostDirective, selector: "[vdrReactComponentHost]", inputs: ["vdrReactComponentHost", "props", "context"] }, { kind: "component", type: RouteComponent, selector: "vdr-route-component" }, { kind: "ngmodule", type: SharedModule }], encapsulation: i0.ViewEncapsulation.None }); }
135
+ `, isInline: true, styles: [":host,.vdr-card{display:block;--card-padding: calc(var(--space-unit) * 3);container-type:inline-size}.card-container{border:1px solid var(--color-card-border);background-color:var(--color-card-bg);border-radius:var(--border-radius);padding:var(--card-padding) 0;box-shadow:0 2px 4px #0000000d}@container (max-width: 400px){.card-container{--card-padding: calc(var(--space-unit) * 2)}}.card-container.padding-x{padding-inline-start:var(--card-padding);padding-inline-end:var(--card-padding)}.title-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--card-padding)}.title{font-size:var(--font-size-base);padding:0 var(--card-padding)}.padding-x .title{padding:0}::ng-deep vdr-card+vdr-card{margin-top:calc(var(--space-unit) * 2)}.vdr-card+.vdr-card{margin-top:calc(var(--space-unit) * 2)}:host{display:block}.form-group label{font-size:var(--font-size-sm);color:var(--color-weight-800);margin-bottom:4px;display:inline-block}.tooltip-text{font-size:var(--font-size-xs);line-height:var(--font-size-sm);margin-bottom:4px}.input-row{display:flex}::ng-deep .input-row input:not([type=checkbox]),::ng-deep .input-row select,::ng-deep .input-row textarea,::ng-deep .input-row ng-select,::ng-deep .input-row vdr-zone-selector,::ng-deep .input-row vdr-facet-value-selector,::ng-deep .input-row vdr-option-value-input,::ng-deep .input-row vdr-affixed-input,::ng-deep .input-row vdr-currency-input,::ng-deep .input-row vdr-rich-text-editor{width:100%}::ng-deep .input-row.readonly input:not([type=checkbox])[readonly],::ng-deep .input-row.readonly select[readonly],::ng-deep .input-row.readonly textarea[readonly],::ng-deep .input-row.readonly ng-select[readonly],::ng-deep .input-row.readonly vdr-zone-selector[readonly],::ng-deep .input-row.readonly vdr-facet-value-selector[readonly],::ng-deep .input-row.readonly vdr-option-value-input[readonly],::ng-deep .input-row.readonly vdr-affixed-input[readonly],::ng-deep .input-row.readonly vdr-currency-input[readonly],::ng-deep .input-row.readonly vdr-rich-text-editor[readonly]{cursor:not-allowed}.input-row input:not([type=checkbox]),.input-row select,.input-row textarea{width:100%}::ng-deep .input-row.has-toggle input:not([type=checkbox]):not([type=radio]){border-start-end-radius:0!important;border-end-end-radius:0!important}.edit-button{border:1px solid var(--color-weight-200);border-radius:var(--border-radius-input);border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0}.edit-button.enabled{color:var(--color-primary-700);background-color:var(--color-primary-100)}:host,.vdr-action-bar{display:flex;justify-content:space-between;align-items:baseline;z-index:25;flex-direction:column-reverse}:host>.grow,.vdr-action-bar>.grow{flex:1}:host .right-content,.vdr-action-bar .right-content{width:100%;display:flex;justify-content:flex-end}:host ::ng-deep vdr-ab-right>*:last-child,.vdr-action-bar ::ng-deep vdr-ab-right>*:last-child{margin-inline-end:0px}@media screen and (min-width: 768px){:host,.vdr-action-bar{flex-direction:row}:host .right-content,.vdr-action-bar .right-content{width:initial}}:host,.vdr-page-detail-layout{display:grid;grid-template-columns:3fr 1fr}@media screen and (max-width: 992px){:host{grid-template-columns:1fr}}.sidebar{padding:var(--space-unit)}.form-group .input-row.invalid input:not([type=checkbox]):not([type=radio]),.form-group .input-row.invalid select,.form-group .input-row.invalid textarea{color:var(--color-error-700);border-color:var(--color-error-300)}\n"], dependencies: [{ kind: "directive", type: ReactComponentHostDirective, selector: "[vdrReactComponentHost]", inputs: ["vdrReactComponentHost", "props", "context"] }, { kind: "component", type: RouteComponent, selector: "vdr-route-component", inputs: ["locationId", "description"] }, { kind: "ngmodule", type: SharedModule }], encapsulation: i0.ViewEncapsulation.None }); }
136
136
  }
137
137
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: ReactRouteComponent, decorators: [{
138
138
  type: Component,
@@ -641,7 +641,7 @@ function usePageMetadata() {
641
641
  * }`;
642
642
  *
643
643
  * export const MyComponent = () => {
644
- * const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' });
644
+ * const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' }, { refetchOnChannelChange: true });
645
645
  *
646
646
  * if (loading) return <div>Loading...</div>;
647
647
  * if (error) return <div>Error! { error }</div>;
@@ -656,8 +656,15 @@ function usePageMetadata() {
656
656
  *
657
657
  * @docsCategory react-hooks
658
658
  */
659
- function useQuery(query, variables) {
660
- const { data, loading, error, runQuery } = useDataService((dataService, vars) => dataService.query(query, vars).stream$);
659
+ function useQuery(query, variables, options = { refetchOnChannelChange: false }) {
660
+ const { refetchOnChannelChange } = options;
661
+ const { data, loading, error, runQuery } = useDataService((dataService, vars) => {
662
+ let queryFn = dataService.query(query, vars);
663
+ if (refetchOnChannelChange) {
664
+ queryFn = queryFn.refetchOnChannelChange();
665
+ }
666
+ return queryFn.stream$;
667
+ });
661
668
  useEffect(() => {
662
669
  const subscription = runQuery(variables).subscribe();
663
670
  return () => subscription.unsubscribe();
@@ -667,7 +674,7 @@ function useQuery(query, variables) {
667
674
  }
668
675
  /**
669
676
  * @description
670
- * A React hook which allows you to execute a GraphQL query.
677
+ * A React hook which allows you to execute a GraphQL query lazily.
671
678
  *
672
679
  * @example
673
680
  * ```ts
@@ -690,7 +697,7 @@ function useQuery(query, variables) {
690
697
  * }
691
698
  *
692
699
  * export const MyComponent = () => {
693
- * const [getProduct, { data, loading, error }] = useLazyQuery<ProductResponse>(GET_PRODUCT);
700
+ * const [getProduct, { data, loading, error }] = useLazyQuery<ProductResponse>(GET_PRODUCT, { refetchOnChannelChange: true });
694
701
  *
695
702
  * const handleClick = () => {
696
703
  * getProduct({
@@ -719,8 +726,15 @@ function useQuery(query, variables) {
719
726
  * @since 2.2.0
720
727
  * @docsCategory react-hooks
721
728
  */
722
- function useLazyQuery(query) {
723
- const { data, loading, error, runQuery } = useDataService((dataService, vars) => dataService.query(query, vars).stream$);
729
+ function useLazyQuery(query, options = { refetchOnChannelChange: false }) {
730
+ const { refetchOnChannelChange } = options;
731
+ const { data, loading, error, runQuery } = useDataService((dataService, vars) => {
732
+ let queryFn = dataService.query(query, vars);
733
+ if (refetchOnChannelChange) {
734
+ queryFn = queryFn.refetchOnChannelChange();
735
+ }
736
+ return queryFn.stream$;
737
+ });
724
738
  const rest = { data, loading, error };
725
739
  const execute = (variables) => firstValueFrom(runQuery(variables));
726
740
  return [execute, rest];
@@ -1 +1 @@
1
- {"version":3,"file":"vendure-admin-ui-react.mjs","sources":["../../src/lib/react/src/directives/react-component-host.directive.ts","../../src/lib/react/src/components/react-custom-column.component.ts","../../src/lib/react/src/components/react-custom-detail.component.ts","../../src/lib/react/src/components/react-form-input.component.ts","../../src/lib/react/src/components/react-route.component.ts","../../src/lib/react/src/react-components/ActionBar.tsx","../../src/lib/react/src/react-components/Card.tsx","../../src/lib/react/src/react-components/CdsIcon.tsx","../../src/lib/react/src/react-components/FormField.tsx","../../src/lib/react/src/react-hooks/use-injector.ts","../../src/lib/react/src/react-components/Link.tsx","../../src/lib/react/src/react-components/PageBlock.tsx","../../src/lib/react/src/react-components/PageDetailLayout.tsx","../../src/lib/react/src/react-hooks/use-rich-text-editor.ts","../../src/lib/react/src/react-components/RichTextEditor.tsx","../../src/lib/react/src/react-hooks/use-detail-component-data.ts","../../src/lib/react/src/react-hooks/use-form-control.ts","../../src/lib/react/src/react-hooks/use-page-metadata.ts","../../src/lib/react/src/react-hooks/use-query.ts","../../src/lib/react/src/react-hooks/use-route-params.ts","../../src/lib/react/src/register-react-custom-detail-component.ts","../../src/lib/react/src/register-react-data-table-component.ts","../../src/lib/react/src/register-react-form-input-component.ts","../../src/lib/react/src/register-react-route-component.ts","../../src/lib/react/src/public_api.ts","../../src/lib/react/src/vendure-admin-ui-react.ts"],"sourcesContent":["import { Directive, ElementRef, Injector, Input, Optional } from '@angular/core';\r\nimport { PageMetadataService } from '@vendure/admin-ui/core';\r\nimport { ComponentProps, createContext, createElement, ElementType } from 'react';\r\nimport { createRoot, Root } from 'react-dom/client';\r\nimport { HostedReactComponentContext } from '../types';\r\n\r\nexport const HostedComponentContext = createContext<HostedReactComponentContext | null>(null);\r\n\r\n/**\r\n * Based on https://netbasal.com/using-react-in-angular-applications-1bb907ecac91\r\n */\r\n@Directive({\r\n selector: '[vdrReactComponentHost]',\r\n standalone: true,\r\n})\r\nexport class ReactComponentHostDirective<Comp extends ElementType> {\r\n @Input('vdrReactComponentHost') reactComponent: Comp;\r\n @Input() props: ComponentProps<Comp>;\r\n @Input() context: Record<string, any> = {};\r\n\r\n private root: Root | null = null;\r\n\r\n constructor(\r\n private host: ElementRef,\r\n private injector: Injector,\r\n @Optional() private pageMetadataService?: PageMetadataService,\r\n ) {}\r\n\r\n async ngOnChanges() {\r\n const Comp = this.reactComponent;\r\n\r\n if (!this.root) {\r\n this.root = createRoot(this.host.nativeElement);\r\n }\r\n\r\n this.root.render(\r\n createElement(\r\n HostedComponentContext.Provider,\r\n {\r\n value: {\r\n ...this.props,\r\n ...this.context,\r\n injector: this.injector,\r\n pageMetadataService: this.pageMetadataService,\r\n },\r\n },\r\n createElement(Comp, this.props),\r\n ),\r\n );\r\n }\r\n\r\n ngOnDestroy() {\r\n this.root?.unmount();\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, Input, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { CustomColumnComponent } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\n\r\nexport const REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS = new InjectionToken<{\r\n component: ElementType;\r\n props?: Record<string, any>;\r\n}>('REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS');\r\n\r\n@Component({\r\n selector: 'vdr-react-custom-column-component',\r\n template: ` <div [vdrReactComponentHost]=\"reactComponent\" [props]=\"props\"></div> `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective],\r\n})\r\nexport class ReactCustomColumnComponent implements CustomColumnComponent, OnInit {\r\n @Input() rowItem: any;\r\n\r\n protected reactComponent = inject(REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS).component;\r\n private options = inject(REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS);\r\n protected props: Record<string, any>;\r\n\r\n ngOnInit() {\r\n this.props = {\r\n rowItem: this.rowItem,\r\n ...(this.options.props ?? {}),\r\n };\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\r\nimport { CustomDetailComponent } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport { Observable } from 'rxjs';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\n\r\nexport const REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS = new InjectionToken<{\r\n component: ElementType;\r\n props?: Record<string, any>;\r\n}>('REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS');\r\n\r\nexport interface ReactCustomDetailComponentContext {\r\n detailForm: FormGroup;\r\n entity$: Observable<any>;\r\n}\r\n\r\n@Component({\r\n selector: 'vdr-react-custom-detail-component',\r\n template: ` <div [vdrReactComponentHost]=\"reactComponent\" [context]=\"context\" [props]=\"props\"></div> `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective],\r\n})\r\nexport class ReactCustomDetailComponent implements CustomDetailComponent, OnInit {\r\n detailForm: UntypedFormGroup;\r\n entity$: Observable<any>;\r\n protected props = inject(REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS).props ?? {};\r\n protected reactComponent = inject(REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS).component;\r\n protected context: ReactCustomDetailComponentContext;\r\n\r\n ngOnInit() {\r\n this.context = {\r\n detailForm: this.detailForm,\r\n entity$: this.entity$,\r\n };\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { FormControl } from '@angular/forms';\r\nimport { CustomField, FormInputComponent } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\nimport { ReactFormInputOptions } from '../types';\r\n\r\nexport const REACT_INPUT_COMPONENT_OPTIONS = new InjectionToken<{\r\n component: ElementType;\r\n}>('REACT_INPUT_COMPONENT_OPTIONS');\r\n\r\n@Component({\r\n selector: 'vdr-react-form-input-component',\r\n template: ` <div [vdrReactComponentHost]=\"reactComponent\" [context]=\"context\" [props]=\"context\"></div> `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective],\r\n})\r\nexport class ReactFormInputComponent implements FormInputComponent, OnInit {\r\n static readonly id: string = 'react-form-input-component';\r\n readonly: boolean;\r\n formControl: FormControl;\r\n config: CustomField & Record<string, any>;\r\n\r\n protected context: ReactFormInputOptions;\r\n\r\n protected reactComponent = inject(REACT_INPUT_COMPONENT_OPTIONS).component;\r\n\r\n ngOnInit() {\r\n this.context = {\r\n formControl: this.formControl,\r\n readonly: this.readonly,\r\n config: this.config,\r\n };\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, ViewEncapsulation } from '@angular/core';\r\nimport { ROUTE_COMPONENT_OPTIONS, RouteComponent, SharedModule } from '@vendure/admin-ui/core';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\nimport { ReactRouteComponentOptions } from '../types';\r\n\r\nexport const REACT_ROUTE_COMPONENT_OPTIONS = new InjectionToken<ReactRouteComponentOptions>(\r\n 'REACT_ROUTE_COMPONENT_OPTIONS',\r\n);\r\n\r\n@Component({\r\n selector: 'vdr-react-route-component',\r\n template: `\r\n <vdr-route-component\r\n ><div [vdrReactComponentHost]=\"reactComponent\" [props]=\"props\"></div\r\n ></vdr-route-component>\r\n `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective, RouteComponent, SharedModule],\r\n})\r\nexport class ReactRouteComponent {\r\n protected props = inject(REACT_ROUTE_COMPONENT_OPTIONS).props;\r\n protected reactComponent = inject(ROUTE_COMPONENT_OPTIONS).component;\r\n}\r\n","import React, { PropsWithChildren, ReactNode } from 'react';\r\n\r\n/**\r\n * @description\r\n * A container for the primary actions on a list or detail page\r\n *\r\n * @example\r\n * ```ts\r\n * import { ActionBar } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <ActionBar leftContent={<div>Optional left content</div>}>\r\n * <button className='button primary'>Primary action</button>\r\n * </ActionBar>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function ActionBar(props: PropsWithChildren<{ leftContent?: ReactNode }>) {\r\n return (\r\n <div className={'vdr-action-bar'}>\r\n <div className=\"left-content\">{props.leftContent}</div>\r\n <div className=\"right-content\">{props.children}</div>\r\n </div>\r\n );\r\n}\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\n/**\r\n * @description\r\n * A card component which can be used to group related content.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Card } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <Card title='My Title'>\r\n * <p>Some content</p>\r\n * </Card>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function Card(props: PropsWithChildren<{ title?: string; paddingX?: boolean }>) {\r\n return (\r\n <div className={'vdr-card'}>\r\n <div className={`card-container ${props.paddingX !== false ? 'padding-x' : ''}`}>\r\n {props.title && (\r\n <div className={'title-row'}>\r\n <div className=\"title\">{props.title}</div>\r\n </div>\r\n )}\r\n <div className=\"contents\">{props.children}</div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { ClarityIcons } from '@cds/core/icon';\r\nimport { IconShapeTuple } from '@cds/core/icon/interfaces/icon.interfaces';\r\nimport React, { DOMAttributes, useEffect } from 'react';\r\n\r\ntype CustomElement<T> = Partial<T & DOMAttributes<T> & { children: any }>;\r\n\r\nexport interface CdsIconProps {\r\n shape: string;\r\n size: string | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';\r\n direction: 'up' | 'down' | 'left' | 'right';\r\n flip: 'horizontal' | 'vertical';\r\n solid: boolean;\r\n status: 'info' | 'success' | 'warning' | 'danger';\r\n inverse: boolean;\r\n badge: 'info' | 'success' | 'warning' | 'danger';\r\n}\r\n\r\ndeclare global {\r\n namespace JSX {\r\n interface IntrinsicElements {\r\n ['cds-icon']: CustomElement<CdsIconProps>;\r\n }\r\n }\r\n}\r\n\r\nexport function registerCdsIcon(icon: IconShapeTuple) {\r\n ClarityIcons.addIcons(icon);\r\n}\r\n\r\n/**\r\n * @description\r\n * A React wrapper for the Clarity UI icon component.\r\n *\r\n * @example\r\n * ```ts\r\n * import { userIcon } from '@cds/core/icon';\r\n * import { CdsIcon } from '@vendure/admin-ui/react';\r\n *\r\n * registerCdsIcon(userIcon);\r\n * export function MyComponent() {\r\n * return <CdsIcon icon={userIcon} badge=\"warning\" solid size=\"lg\"></CdsIcon>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function CdsIcon(props: { icon: IconShapeTuple; className?: string } & Partial<CdsIconProps>) {\r\n const { icon, ...rest } = props;\r\n useEffect(() => {\r\n ClarityIcons.addIcons(icon);\r\n }, [icon]);\r\n return <cds-icon {...rest} shape={icon[0]}></cds-icon>;\r\n}\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\n/**\r\n * @description\r\n * A wrapper around form fields which provides a label, tooltip and error message.\r\n *\r\n * @example\r\n * ```ts\r\n * import { FormField } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyReactComponent() {\r\n * return (\r\n * <FormField label=\"My field\" tooltip=\"This is a tooltip\" invalid errorMessage=\"This field is invalid\">\r\n * <input type=\"text\" />\r\n * </FormField>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function FormField(\r\n props: PropsWithChildren<{\r\n for?: string;\r\n label?: string;\r\n tooltip?: string;\r\n invalid?: boolean;\r\n errorMessage?: string;\r\n }>,\r\n) {\r\n return (\r\n <div\r\n className={`form-group ` + (!props.label ? 'no-label' : '') + (props.invalid ? 'clr-error' : '')}\r\n >\r\n {props.label && <label htmlFor={props.for ?? ''}>{props.label}</label>}\r\n {props.tooltip && <div className=\"tooltip-text\">{props.tooltip}</div>}\r\n <div className={`input-row ` + (props.invalid ? 'invalid' : '')}>{props.children}</div>\r\n {props.errorMessage && <div className=\"error-message\">{props.errorMessage}</div>}\r\n </div>\r\n );\r\n}\r\n","import { ProviderToken } from '@angular/core';\r\nimport { useContext } from 'react';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\n\r\n/**\r\n * @description\r\n * Exposes the Angular injector which allows the injection of services into React components.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useInjector } from '\\@vendure/admin-ui/react';\r\n * import { NotificationService } from '\\@vendure/admin-ui/core';\r\n *\r\n * export const MyComponent = () => {\r\n * const notificationService = useInjector(NotificationService);\r\n *\r\n * const handleClick = () => {\r\n * notificationService.success('Hello world!');\r\n * };\r\n * // ...\r\n * return <div>...</div>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useInjector<T = any>(token: ProviderToken<T>): T {\r\n const context = useContext(HostedComponentContext);\r\n const instance = context?.injector.get(token);\r\n if (!instance) {\r\n throw new Error(`Could not inject ${(token as any).name ?? token.toString()}`);\r\n }\r\n return instance;\r\n}\r\n","import { Router } from '@angular/router';\r\nimport React, { PropsWithChildren } from 'react';\r\nimport { useInjector } from '../react-hooks/use-injector';\r\n\r\n/**\r\n * @description\r\n * A React component which renders an anchor tag and navigates to the specified route when clicked.\r\n * This is useful when you want to use a React component in a Vendure UI plugin which navigates to\r\n * a route in the admin-ui.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Link } from '@vendure/admin-ui/react';\r\n *\r\n * export const MyReactComponent = () => {\r\n * return <Link href=\"/extensions/my-extension\">Go to my extension</Link>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function Link(props: PropsWithChildren<{ href: string; [props: string]: any }>) {\r\n const router = useInjector(Router);\r\n const { href, ...rest } = props;\r\n\r\n function onClick(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) {\r\n e.preventDefault();\r\n void router.navigateByUrl(href);\r\n }\r\n\r\n return (\r\n <a href={href} onClick={onClick} {...rest}>\r\n {props.children}\r\n </a>\r\n );\r\n}\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\n/**\r\n * @description\r\n * A container for page content which provides a consistent width and spacing.\r\n *\r\n * @example\r\n * ```ts\r\n * import { PageBlock } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <PageBlock>\r\n * ...\r\n * </PageBlock>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function PageBlock(props: PropsWithChildren) {\r\n return <div className=\"page-block\">{props.children}</div>;\r\n}\r\n","import React, { PropsWithChildren, ReactNode } from 'react';\r\n\r\n/**\r\n * @description\r\n * A responsive container for detail views with a main content area and an optional sidebar.\r\n *\r\n * @example\r\n * ```ts\r\n * import { PageDetailLayout } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <PageDetailLayout sidebar={<div>Sidebar content</div>}>\r\n * <div>Main content</div>\r\n * </PageDetailLayout>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function PageDetailLayout(props: PropsWithChildren<{ sidebar?: ReactNode }>) {\r\n return (\r\n <div className={'vdr-page-detail-layout'}>\r\n <div className=\"main\">{props.children}</div>\r\n <div className=\"sidebar\">{props.sidebar}</div>\r\n </div>\r\n );\r\n}\r\n","import { useEffect, useRef } from 'react';\r\nimport { Injector } from '@angular/core';\r\n\r\nimport { CreateEditorViewOptions, ProsemirrorService, ContextMenuService } from '@vendure/admin-ui/core';\r\nimport { useInjector } from './use-injector';\r\n\r\nexport interface useRichTextEditorOptions extends Omit<CreateEditorViewOptions, 'element'> {\r\n /**\r\n * @description\r\n * Control the DOM attributes of the editable element. May be either an object or a function going from an editor state to an object.\r\n * By default, the element will get a class \"ProseMirror\", and will have its contentEditable attribute determined by the editable prop.\r\n * Additional classes provided here will be added to the class. For other attributes, the value provided first (as in someProp) will be used.\r\n * Copied from real property description.\r\n */\r\n attributes?: Record<string, string>;\r\n}\r\n\r\n/**\r\n * @description\r\n * Provides access to the ProseMirror (rich text editor) instance.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useRichTextEditor } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function Component() {\r\n * const { ref, editor } = useRichTextEditor({\r\n * attributes: { class: '' },\r\n * onTextInput: (text) => console.log(text),\r\n * isReadOnly: () => false,\r\n * });\r\n *\r\n * return <div className=\"w-full\" ref={ref} />\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport const useRichTextEditor = ({ attributes, onTextInput, isReadOnly }: useRichTextEditorOptions) => {\r\n const injector = useInjector(Injector);\r\n const ref = useRef<HTMLDivElement>(null);\r\n const prosemirror = new ProsemirrorService(injector, useInjector(ContextMenuService));\r\n\r\n useEffect(() => {\r\n if (!ref.current) return;\r\n prosemirror.createEditorView({\r\n element: ref.current,\r\n isReadOnly,\r\n onTextInput,\r\n });\r\n const readOnly = isReadOnly();\r\n prosemirror.editorView.setProps({\r\n attributes,\r\n editable: readOnly ? () => false : () => true,\r\n });\r\n return () => {\r\n prosemirror.destroy();\r\n };\r\n }, [ref.current]);\r\n\r\n return { ref, editor: prosemirror };\r\n};\r\n","import React, {\n ChangeEvent,\n ForwardedRef,\n InputHTMLAttributes,\n forwardRef,\n useEffect,\n useState,\n} from 'react';\nimport { ProsemirrorService } from '@vendure/admin-ui/core';\nimport { useRichTextEditor } from '../react-hooks/use-rich-text-editor';\n\nexport type RichTextEditorType = InputHTMLAttributes<HTMLInputElement> & {\n /**\n * @description\n * Control the DOM attributes of the editable element. May be either an object or a function going from an editor state to an object.\n * By default, the element will get a class \"ProseMirror\", and will have its contentEditable attribute determined by the editable prop.\n * Additional classes provided here will be added to the class. For other attributes, the value provided first (as in someProp) will be used.\n * Copied from real property description.\n */\n attributes?: Record<string, string>;\n label?: string;\n readOnly?: boolean;\n onMount?: (editor: ProsemirrorService) => void;\n};\n\n/**\n * @description\n * A rich text editor component which uses ProseMirror (rich text editor) under the hood.\n *\n * @example\n * ```ts\n * import { RichTextEditor } from '@vendure/admin-ui/react';\n * import React from 'react';\n *\n * export function MyComponent() {\n * const onSubmit = async (e: React.FormEvent) => {\n * e.preventDefault();\n * const form = new FormData(e.target as HTMLFormElement);\n * const content = form.get(\"content\");\n * console.log(content);\n * };\n *\n * return (\n * <form className=\"w-full\" onSubmit={onSubmit}>\n * <RichTextEditor\n * name=\"content\"\n * readOnly={false}\n * onMount={(e) => console.log(\"Mounted\", e)}\n * />\n * <button type=\"submit\" className=\"btn btn-primary\">\n * Submit\n * </button>\n * </form>\n * );\n * }\n * ```\n *\n * @docsCategory react-components\n */\nexport const RichTextEditor = forwardRef((props: RichTextEditorType, ref: ForwardedRef<HTMLInputElement>) => {\n const [data, setData] = useState<string>('');\n const { readOnly, label, ...rest } = props;\n const { ref: _ref, editor } = useRichTextEditor({\n attributes: props.attributes,\n isReadOnly: () => readOnly || false,\n onTextInput: text => {\n setData(text);\n if (props.onChange) {\n props.onChange({\n target: { value: text },\n } as ChangeEvent<HTMLInputElement>);\n }\n if (ref && 'current' in ref && ref.current) {\n ref.current.value = text;\n const event = new Event('input', {\n bubbles: true,\n cancelable: true,\n });\n ref.current.dispatchEvent(event);\n }\n },\n });\n\n useEffect(() => {\n if (props.onMount && editor) {\n props.onMount(editor);\n }\n if (typeof props.defaultValue === 'string') {\n editor.update(props.defaultValue);\n }\n }, []);\n return (\n <>\n <div ref={_ref} {...rest}>\n {label && <label className=\"rich-text-label\">{label}</label>}\n </div>\n <input type=\"hidden\" value={data} ref={ref} />\n </>\n );\n});\n\nRichTextEditor.displayName = 'RichTextEditor';\n","import { useContext, useEffect, useState } from 'react';\r\nimport { ReactCustomDetailComponentContext } from '../components/react-custom-detail.component';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\nimport { HostedReactComponentContext } from '../types';\r\n\r\n/**\r\n * @description\r\n * Provides the data available to React-based CustomDetailComponents.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Card, useDetailComponentData } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function CustomDetailComponent(props: any) {\r\n * const { entity, detailForm } = useDetailComponentData();\r\n * const updateName = () => {\r\n * detailForm.get('name')?.setValue('New name');\r\n * detailForm.markAsDirty();\r\n * };\r\n * return (\r\n * <Card title={'Custom Detail Component'}>\r\n * <button className=\"button\" onClick={updateName}>\r\n * Update name\r\n * </button>\r\n * <pre>{JSON.stringify(entity, null, 2)}</pre>\r\n * </Card>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useDetailComponentData<T = any>() {\r\n const context = useContext(\r\n HostedComponentContext,\r\n ) as HostedReactComponentContext<ReactCustomDetailComponentContext>;\r\n\r\n if (!context.detailForm || !context.entity$) {\r\n throw new Error(`The useDetailComponentData hook can only be used within a CustomDetailComponent`);\r\n }\r\n\r\n const [entity, setEntity] = useState<T | null>(null);\r\n\r\n useEffect(() => {\r\n const subscription = context.entity$.subscribe(value => {\r\n setEntity(value);\r\n });\r\n return () => subscription.unsubscribe();\r\n }, []);\r\n\r\n return {\r\n entity,\r\n detailForm: context.detailForm,\r\n };\r\n}\r\n","import { CustomFieldType } from '@vendure/common/lib/shared-types';\r\nimport { useContext, useEffect, useState } from 'react';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\nimport { HostedReactComponentContext, ReactFormInputOptions } from '../types';\r\n\r\n/**\r\n * @description\r\n * Provides access to the current FormControl value and a method to update the value.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useFormControl, ReactFormInputProps } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function ReactNumberInput({ readonly }: ReactFormInputProps) {\r\n * const { value, setFormValue } = useFormControl();\r\n *\r\n * const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n * setFormValue(val);\r\n * };\r\n * return (\r\n * <div>\r\n * <input readOnly={readonly} type=\"number\" onChange={handleChange} value={value} />\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useFormControl() {\r\n const context = useContext(HostedComponentContext);\r\n if (!context) {\r\n throw new Error('No HostedComponentContext found');\r\n }\r\n if (!isFormInputContext(context)) {\r\n throw new Error('useFormControl() can only be used in a form input component');\r\n }\r\n const { formControl, config } = context;\r\n const [value, setValue] = useState(formControl.value ?? 0);\r\n\r\n useEffect(() => {\r\n const subscription = formControl.valueChanges.subscribe(v => {\r\n setValue(v);\r\n });\r\n return () => {\r\n subscription.unsubscribe();\r\n };\r\n }, []);\r\n\r\n function setFormValue(newValue: any) {\r\n formControl.setValue(coerceFormValue(newValue, config.type as CustomFieldType));\r\n formControl.markAsDirty();\r\n }\r\n\r\n return { value, setFormValue };\r\n}\r\n\r\nfunction isFormInputContext(\r\n context: HostedReactComponentContext,\r\n): context is HostedReactComponentContext<ReactFormInputOptions> {\r\n return context.config && context.formControl;\r\n}\r\n\r\nfunction coerceFormValue(value: any, type: CustomFieldType) {\r\n switch (type) {\r\n case 'int':\r\n case 'float':\r\n return Number(value);\r\n case 'boolean':\r\n return Boolean(value);\r\n default:\r\n return value;\r\n }\r\n}\r\n","import { BreadcrumbValue } from '@vendure/admin-ui/core';\r\nimport { useContext } from 'react';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\nimport { HostedReactComponentContext, ReactRouteComponentOptions } from '../types';\r\n\r\n/**\r\n * @description\r\n * Provides functions for setting the current page title and breadcrumb.\r\n *\r\n * @example\r\n * ```ts\r\n * import { usePageMetadata } from '\\@vendure/admin-ui/react';\r\n * import { useEffect } from 'react';\r\n *\r\n * export const MyComponent = () => {\r\n * const { setTitle, setBreadcrumb } = usePageMetadata();\r\n * useEffect(() => {\r\n * setTitle('My Page');\r\n * setBreadcrumb([\r\n * { link: ['./parent'], label: 'Parent Page' },\r\n * { link: ['./'], label: 'This Page' },\r\n * ]);\r\n * }, []);\r\n * // ...\r\n * return <div>...</div>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function usePageMetadata() {\r\n const context = useContext(\r\n HostedComponentContext,\r\n ) as HostedReactComponentContext<ReactRouteComponentOptions>;\r\n const setBreadcrumb = (newValue: BreadcrumbValue) => {\r\n context.pageMetadataService?.setBreadcrumbs(newValue);\r\n };\r\n const setTitle = (newTitle: string) => {\r\n context.pageMetadataService?.setTitle(newTitle);\r\n };\r\n\r\n return {\r\n setBreadcrumb,\r\n setTitle,\r\n };\r\n}\r\n","import { TypedDocumentNode } from '@graphql-typed-document-node/core';\r\nimport { DataService } from '@vendure/admin-ui/core';\r\nimport { DocumentNode } from 'graphql/index';\r\nimport { useCallback, useContext, useEffect, useState } from 'react';\r\nimport { firstValueFrom, Observable } from 'rxjs';\r\nimport { tap } from 'rxjs/operators';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\n\r\n/**\r\n * @description\r\n * A React hook which provides access to the results of a GraphQL query.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useQuery } from '\\@vendure/admin-ui/react';\r\n * import { gql } from 'graphql-tag';\r\n *\r\n * const GET_PRODUCT = gql`\r\n * query GetProduct($id: ID!) {\r\n * product(id: $id) {\r\n * id\r\n * name\r\n * description\r\n * }\r\n * }`;\r\n *\r\n * export const MyComponent = () => {\r\n * const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' });\r\n *\r\n * if (loading) return <div>Loading...</div>;\r\n * if (error) return <div>Error! { error }</div>;\r\n * return (\r\n * <div>\r\n * <h1>{data.product.name}</h1>\r\n * <p>{data.product.description}</p>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useQuery<T, V extends Record<string, any> = Record<string, any>>(\r\n query: DocumentNode | TypedDocumentNode<T, V>,\r\n variables?: V,\r\n) {\r\n const { data, loading, error, runQuery } = useDataService<T, V>(\r\n (dataService, vars) => dataService.query(query, vars).stream$,\r\n );\r\n useEffect(() => {\r\n const subscription = runQuery(variables).subscribe();\r\n return () => subscription.unsubscribe();\r\n }, [runQuery]);\r\n\r\n const refetch = (variables?: V) => firstValueFrom(runQuery(variables));\r\n return { data, loading, error, refetch } as const;\r\n}\r\n\r\n/**\r\n * @description\r\n * A React hook which allows you to execute a GraphQL query.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useLazyQuery } from '\\@vendure/admin-ui/react';\r\n * import { gql } from 'graphql-tag';\r\n *\r\n * const GET_PRODUCT = gql`\r\n * query GetProduct($id: ID!) {\r\n * product(id: $id) {\r\n * id\r\n * name\r\n * description\r\n * }\r\n * }`;\r\n * type ProductResponse = {\r\n * product: {\r\n * name: string\r\n * description: string\r\n * }\r\n * }\r\n *\r\n * export const MyComponent = () => {\r\n * const [getProduct, { data, loading, error }] = useLazyQuery<ProductResponse>(GET_PRODUCT);\r\n *\r\n * const handleClick = () => {\r\n * getProduct({\r\n * id: '1',\r\n * }).then(result => {\r\n * // do something with the result\r\n * });\r\n * };\r\n *\r\n * if (loading) return <div>Loading...</div>;\r\n * if (error) return <div>Error! { error }</div>;\r\n *\r\n * return (\r\n * <div>\r\n * <button onClick={handleClick}>Get product</button>\r\n * {data && (\r\n * <div>\r\n * <h1>{data.product.name}</h1>\r\n * <p>{data.product.description}</p>\r\n * </div>)}\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n *\r\n * @since 2.2.0\r\n * @docsCategory react-hooks\r\n */\r\nexport function useLazyQuery<T, V extends Record<string, any> = Record<string, any>>(\r\n query: DocumentNode | TypedDocumentNode<T, V>,\r\n) {\r\n const { data, loading, error, runQuery } = useDataService<T, V>(\r\n (dataService, vars) => dataService.query(query, vars).stream$,\r\n );\r\n const rest = { data, loading, error };\r\n const execute = (variables?: V) => firstValueFrom(runQuery(variables));\r\n return [execute, rest] as [typeof execute, typeof rest];\r\n}\r\n\r\n/**\r\n * @description\r\n * A React hook which allows you to execute a GraphQL mutation.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useMutation } from '\\@vendure/admin-ui/react';\r\n * import { gql } from 'graphql-tag';\r\n *\r\n * const UPDATE_PRODUCT = gql`\r\n * mutation UpdateProduct($input: UpdateProductInput!) {\r\n * updateProduct(input: $input) {\r\n * id\r\n * name\r\n * }\r\n * }`;\r\n *\r\n * export const MyComponent = () => {\r\n * const [updateProduct, { data, loading, error }] = useMutation(UPDATE_PRODUCT);\r\n *\r\n * const handleClick = () => {\r\n * updateProduct({\r\n * input: {\r\n * id: '1',\r\n * name: 'New name',\r\n * },\r\n * }).then(result => {\r\n * // do something with the result\r\n * });\r\n * };\r\n *\r\n * if (loading) return <div>Loading...</div>;\r\n * if (error) return <div>Error! { error }</div>;\r\n *\r\n * return (\r\n * <div>\r\n * <button onClick={handleClick}>Update product</button>\r\n * {data && <div>Product updated!</div>}\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useMutation<T, V extends Record<string, any> = Record<string, any>>(\r\n mutation: DocumentNode | TypedDocumentNode<T, V>,\r\n) {\r\n const { data, loading, error, runQuery } = useDataService<T, V>((dataService, variables) =>\r\n dataService.mutate(mutation, variables),\r\n );\r\n const rest = { data, loading, error };\r\n const execute = (variables?: V) => firstValueFrom(runQuery(variables));\r\n return [execute, rest] as [typeof execute, typeof rest];\r\n}\r\n\r\nexport function useDataService<T, V extends Record<string, any> = Record<string, any>>(\r\n operation: (dataService: DataService, variables?: V) => Observable<T>,\r\n) {\r\n const context = useContext(HostedComponentContext);\r\n const dataService = context?.injector.get(DataService);\r\n if (!dataService) {\r\n throw new Error('No DataService found in HostedComponentContext');\r\n }\r\n\r\n const [data, setData] = useState<T>();\r\n const [error, setError] = useState<string>();\r\n const [loading, setLoading] = useState(false);\r\n\r\n const runQuery = useCallback((variables?: V) => {\r\n setLoading(true);\r\n return operation(dataService, variables).pipe(\r\n tap({\r\n next: res => {\r\n setData(res);\r\n setLoading(false);\r\n },\r\n error: err => {\r\n setError(err.message);\r\n setLoading(false);\r\n },\r\n }),\r\n );\r\n }, []);\r\n\r\n return { data, loading, error, runQuery };\r\n}\r\n","import { ActivatedRoute } from '@angular/router';\r\nimport { useEffect, useState } from 'react';\r\nimport { useInjector } from './use-injector';\r\n\r\n/**\r\n * @description\r\n * Provides access to the current route params and query params.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useRouteParams } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function MyComponent() {\r\n * const { params, queryParams } = useRouteParams();\r\n * // ...\r\n * return <div>{ params.id }</div>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useRouteParams() {\r\n const activatedRoute = useInjector(ActivatedRoute);\r\n const [params, setParams] = useState(activatedRoute.snapshot.params);\r\n const [queryParams, setQueryParams] = useState(activatedRoute.snapshot.queryParams);\r\n\r\n useEffect(() => {\r\n const subscription = activatedRoute.params.subscribe(value => {\r\n setParams(value);\r\n });\r\n subscription.add(activatedRoute.queryParams.subscribe(value => setQueryParams(value)));\r\n return () => subscription.unsubscribe();\r\n }, []);\r\n\r\n activatedRoute;\r\n\r\n return {\r\n params,\r\n queryParams,\r\n };\r\n}\r\n","import { APP_INITIALIZER } from '@angular/core';\r\nimport { CustomDetailComponentLocationId, CustomDetailComponentService } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport {\r\n REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS,\r\n ReactCustomDetailComponent,\r\n} from './components/react-custom-detail.component';\r\n\r\n/**\r\n * @description\r\n * Configures a React-based component to be placed in a detail page in the given location.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport interface ReactCustomDetailComponentConfig {\r\n /**\r\n * @description\r\n * The id of the detail page location in which to place the component.\r\n */\r\n locationId: CustomDetailComponentLocationId;\r\n /**\r\n * @description\r\n * The React component to render.\r\n */\r\n component: ElementType;\r\n /**\r\n * @description\r\n * Optional props to pass to the React component.\r\n */\r\n props?: Record<string, any>;\r\n}\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be rendered in a detail page in the given location.\r\n * Components used as custom detail components can make use of the {@link useDetailComponentData} hook.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactCustomDetailComponent(config: ReactCustomDetailComponentConfig) {\r\n return {\r\n provide: APP_INITIALIZER,\r\n multi: true,\r\n useFactory: (customDetailComponentService: CustomDetailComponentService) => () => {\r\n customDetailComponentService.registerCustomDetailComponent({\r\n component: ReactCustomDetailComponent,\r\n locationId: config.locationId,\r\n providers: [\r\n {\r\n provide: REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS,\r\n useValue: {\r\n component: config.component,\r\n props: config.props,\r\n },\r\n },\r\n ],\r\n });\r\n },\r\n deps: [CustomDetailComponentService],\r\n };\r\n}\r\n","import { APP_INITIALIZER } from '@angular/core';\r\nimport {\r\n DataTableColumnId,\r\n DataTableCustomComponentService,\r\n DataTableLocationId,\r\n} from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport {\r\n REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS,\r\n ReactCustomColumnComponent,\r\n} from './components/react-custom-column.component';\r\n\r\n/**\r\n * @description\r\n * Configures a {@link CustomDetailComponent} to be placed in the given location.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport interface ReactDataTableComponentConfig {\r\n /**\r\n * @description\r\n * The location in the UI where the custom component should be placed.\r\n */\r\n tableId: DataTableLocationId;\r\n /**\r\n * @description\r\n * The column in the table where the custom component should be placed.\r\n */\r\n columnId: DataTableColumnId;\r\n /**\r\n * @description\r\n * The component to render in the table cell. This component will receive the `rowItem` prop\r\n * which is the data object for the row, e.g. the `Product` object if used in the `product-list` table.\r\n */\r\n component: ElementType;\r\n /**\r\n * @description\r\n * Optional props to pass to the React component.\r\n */\r\n props?: Record<string, any>;\r\n}\r\n\r\n/**\r\n * @description\r\n * The props that will be passed to the React component registered via {@link registerReactDataTableComponent}.\r\n */\r\nexport interface ReactDataTableComponentProps<T = any> {\r\n rowItem: T;\r\n [prop: string]: any;\r\n}\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be rendered in a data table in the given location.\r\n * The component will receive the `rowItem` prop which is the data object for the row,\r\n * e.g. the `Product` object if used in the `product-list` table.\r\n *\r\n * @example\r\n * ```ts title=\"components/SlugWithLink.tsx\"\r\n * import { ReactDataTableComponentProps } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function SlugWithLink({ rowItem }: ReactDataTableComponentProps<{ slug: string }>) {\r\n * return (\r\n * <a href={`https://example.com/products/${rowItem.slug}`} target=\"_blank\">\r\n * {rowItem.slug}\r\n * </a>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * ```ts title=\"providers.ts\"\r\n * import { registerReactDataTableComponent } from '\\@vendure/admin-ui/react';\r\n * import { SlugWithLink } from './components/SlugWithLink';\r\n *\r\n * export default [\r\n * registerReactDataTableComponent({\r\n * component: SlugWithLink,\r\n * tableId: 'product-list',\r\n * columnId: 'slug',\r\n * props: {\r\n * foo: 'bar',\r\n * },\r\n * }),\r\n * ];\r\n * ```\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactDataTableComponent(config: ReactDataTableComponentConfig) {\r\n return {\r\n provide: APP_INITIALIZER,\r\n multi: true,\r\n useFactory: (dataTableCustomComponentService: DataTableCustomComponentService) => () => {\r\n dataTableCustomComponentService.registerCustomComponent({\r\n ...config,\r\n component: ReactCustomColumnComponent,\r\n providers: [\r\n {\r\n provide: REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS,\r\n useValue: {\r\n component: config.component,\r\n props: config.props,\r\n },\r\n },\r\n ],\r\n });\r\n },\r\n deps: [DataTableCustomComponentService],\r\n };\r\n}\r\n","import { APP_INITIALIZER, FactoryProvider } from '@angular/core';\r\nimport { ComponentRegistryService } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport {\r\n REACT_INPUT_COMPONENT_OPTIONS,\r\n ReactFormInputComponent,\r\n} from './components/react-form-input.component';\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be used as a {@link FormInputComponent}.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactFormInputComponent(id: string, component: ElementType): FactoryProvider {\r\n return {\r\n provide: APP_INITIALIZER,\r\n multi: true,\r\n useFactory: (registry: ComponentRegistryService) => () => {\r\n registry.registerInputComponent(id, ReactFormInputComponent, [\r\n {\r\n provide: REACT_INPUT_COMPONENT_OPTIONS,\r\n useValue: {\r\n component,\r\n },\r\n },\r\n ]);\r\n },\r\n deps: [ComponentRegistryService],\r\n };\r\n}\r\n","import { Route } from '@angular/router';\r\nimport { ResultOf, TypedDocumentNode } from '@graphql-typed-document-node/core';\r\nimport { registerRouteComponent, RegisterRouteComponentOptions } from '@vendure/admin-ui/core';\r\nimport { DocumentNode } from 'graphql/index';\r\nimport { ElementType } from 'react';\r\nimport { REACT_ROUTE_COMPONENT_OPTIONS, ReactRouteComponent } from './components/react-route.component';\r\nimport { ReactRouteComponentOptions } from './types';\r\n\r\n/**\r\n * @description\r\n * Configuration for a React-based route component.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\ntype RegisterReactRouteComponentOptions<\r\n Entity extends { id: string; updatedAt?: string },\r\n T extends DocumentNode | TypedDocumentNode<any, { id: string }>,\r\n Field extends keyof ResultOf<T>,\r\n R extends Field,\r\n> = RegisterRouteComponentOptions<ElementType, Entity, T, Field, R> & {\r\n props?: Record<string, any>;\r\n};\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be used as a route component.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactRouteComponent<\r\n Entity extends { id: string; updatedAt?: string },\r\n T extends DocumentNode | TypedDocumentNode<any, { id: string }>,\r\n Field extends keyof ResultOf<T>,\r\n R extends Field,\r\n>(options: RegisterReactRouteComponentOptions<Entity, T, Field, R>): Route {\r\n const routeDef = registerRouteComponent(options);\r\n return {\r\n ...routeDef,\r\n providers: [\r\n {\r\n provide: REACT_ROUTE_COMPONENT_OPTIONS,\r\n useValue: {\r\n props: options.props,\r\n } satisfies ReactRouteComponentOptions,\r\n },\r\n ...(routeDef.providers ?? []),\r\n ],\r\n component: ReactRouteComponent,\r\n };\r\n}\r\n","// This file was generated by the build-public-api.ts script\nexport * from './components/react-custom-column.component';\nexport * from './components/react-custom-detail.component';\nexport * from './components/react-form-input.component';\nexport * from './components/react-route.component';\nexport * from './directives/react-component-host.directive';\nexport * from './react-components/ActionBar';\nexport * from './react-components/Card';\nexport * from './react-components/CdsIcon';\nexport * from './react-components/FormField';\nexport * from './react-components/Link';\nexport * from './react-components/PageBlock';\nexport * from './react-components/PageDetailLayout';\nexport * from './react-components/RichTextEditor';\nexport * from './react-hooks/use-detail-component-data';\nexport * from './react-hooks/use-form-control';\nexport * from './react-hooks/use-injector';\nexport * from './react-hooks/use-page-metadata';\nexport * from './react-hooks/use-query';\nexport * from './react-hooks/use-rich-text-editor';\nexport * from './react-hooks/use-route-params';\nexport * from './register-react-custom-detail-component';\nexport * from './register-react-data-table-component';\nexport * from './register-react-form-input-component';\nexport * from './register-react-route-component';\nexport * from './types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;MAMa,sBAAsB,GAAG,aAAa,CAAqC,IAAI,EAAE;AAE9F;;AAEG;MAKU,2BAA2B,CAAA;AAOpC,IAAA,WAAA,CACY,IAAgB,EAChB,QAAkB,EACN,mBAAyC,EAAA;QAFrD,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QAChB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QACN,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAsB;QAPxD,IAAO,CAAA,OAAA,GAAwB,EAAE,CAAC;QAEnC,IAAI,CAAA,IAAA,GAAgB,IAAI,CAAC;KAM7B;AAEJ,IAAA,MAAM,WAAW,GAAA;AACb,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC;AAEjC,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACZ,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;SACnD;QA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;;AAKG;AACG,SAAU,2BAA2B,CAKzC,OAAgE,EAAA;AAC9D,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO;AACH,QAAA,GAAG,QAAQ;AACX,QAAA,SAAS,EAAE;AACP,YAAA;AACI,gBAAA,OAAO,EAAE,6BAA6B;AACtC,gBAAA,QAAQ,EAAE;oBACN,KAAK,EAAE,OAAO,CAAC,KAAK;AACc,iBAAA;AACzC,aAAA;AACD,YAAA,IAAI,QAAQ,CAAC,SAAS,IAAI,EAAE;AAC/B,SAAA;AACD,QAAA,SAAS,EAAE,mBAAmB;KACjC,CAAC;AACN;;ACjDA;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"vendure-admin-ui-react.mjs","sources":["../../src/lib/react/src/directives/react-component-host.directive.ts","../../src/lib/react/src/components/react-custom-column.component.ts","../../src/lib/react/src/components/react-custom-detail.component.ts","../../src/lib/react/src/components/react-form-input.component.ts","../../src/lib/react/src/components/react-route.component.ts","../../src/lib/react/src/react-components/ActionBar.tsx","../../src/lib/react/src/react-components/Card.tsx","../../src/lib/react/src/react-components/CdsIcon.tsx","../../src/lib/react/src/react-components/FormField.tsx","../../src/lib/react/src/react-hooks/use-injector.ts","../../src/lib/react/src/react-components/Link.tsx","../../src/lib/react/src/react-components/PageBlock.tsx","../../src/lib/react/src/react-components/PageDetailLayout.tsx","../../src/lib/react/src/react-hooks/use-rich-text-editor.ts","../../src/lib/react/src/react-components/RichTextEditor.tsx","../../src/lib/react/src/react-hooks/use-detail-component-data.ts","../../src/lib/react/src/react-hooks/use-form-control.ts","../../src/lib/react/src/react-hooks/use-page-metadata.ts","../../src/lib/react/src/react-hooks/use-query.ts","../../src/lib/react/src/react-hooks/use-route-params.ts","../../src/lib/react/src/register-react-custom-detail-component.ts","../../src/lib/react/src/register-react-data-table-component.ts","../../src/lib/react/src/register-react-form-input-component.ts","../../src/lib/react/src/register-react-route-component.ts","../../src/lib/react/src/public_api.ts","../../src/lib/react/src/vendure-admin-ui-react.ts"],"sourcesContent":["import { Directive, ElementRef, Injector, Input, Optional } from '@angular/core';\r\nimport { PageMetadataService } from '@vendure/admin-ui/core';\r\nimport { ComponentProps, createContext, createElement, ElementType } from 'react';\r\nimport { createRoot, Root } from 'react-dom/client';\r\nimport { HostedReactComponentContext } from '../types';\r\n\r\nexport const HostedComponentContext = createContext<HostedReactComponentContext | null>(null);\r\n\r\n/**\r\n * Based on https://netbasal.com/using-react-in-angular-applications-1bb907ecac91\r\n */\r\n@Directive({\r\n selector: '[vdrReactComponentHost]',\r\n standalone: true,\r\n})\r\nexport class ReactComponentHostDirective<Comp extends ElementType> {\r\n @Input('vdrReactComponentHost') reactComponent: Comp;\r\n @Input() props: ComponentProps<Comp>;\r\n @Input() context: Record<string, any> = {};\r\n\r\n private root: Root | null = null;\r\n\r\n constructor(\r\n private host: ElementRef,\r\n private injector: Injector,\r\n @Optional() private pageMetadataService?: PageMetadataService,\r\n ) {}\r\n\r\n async ngOnChanges() {\r\n const Comp = this.reactComponent;\r\n\r\n if (!this.root) {\r\n this.root = createRoot(this.host.nativeElement);\r\n }\r\n\r\n this.root.render(\r\n createElement(\r\n HostedComponentContext.Provider,\r\n {\r\n value: {\r\n ...this.props,\r\n ...this.context,\r\n injector: this.injector,\r\n pageMetadataService: this.pageMetadataService,\r\n },\r\n },\r\n createElement(Comp, this.props),\r\n ),\r\n );\r\n }\r\n\r\n ngOnDestroy() {\r\n this.root?.unmount();\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, Input, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { CustomColumnComponent } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\n\r\nexport const REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS = new InjectionToken<{\r\n component: ElementType;\r\n props?: Record<string, any>;\r\n}>('REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS');\r\n\r\n@Component({\r\n selector: 'vdr-react-custom-column-component',\r\n template: ` <div [vdrReactComponentHost]=\"reactComponent\" [props]=\"props\"></div> `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective],\r\n})\r\nexport class ReactCustomColumnComponent implements CustomColumnComponent, OnInit {\r\n @Input() rowItem: any;\r\n\r\n protected reactComponent = inject(REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS).component;\r\n private options = inject(REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS);\r\n protected props: Record<string, any>;\r\n\r\n ngOnInit() {\r\n this.props = {\r\n rowItem: this.rowItem,\r\n ...(this.options.props ?? {}),\r\n };\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { FormGroup, UntypedFormGroup } from '@angular/forms';\r\nimport { CustomDetailComponent } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport { Observable } from 'rxjs';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\n\r\nexport const REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS = new InjectionToken<{\r\n component: ElementType;\r\n props?: Record<string, any>;\r\n}>('REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS');\r\n\r\nexport interface ReactCustomDetailComponentContext {\r\n detailForm: FormGroup;\r\n entity$: Observable<any>;\r\n}\r\n\r\n@Component({\r\n selector: 'vdr-react-custom-detail-component',\r\n template: ` <div [vdrReactComponentHost]=\"reactComponent\" [context]=\"context\" [props]=\"props\"></div> `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective],\r\n})\r\nexport class ReactCustomDetailComponent implements CustomDetailComponent, OnInit {\r\n detailForm: UntypedFormGroup;\r\n entity$: Observable<any>;\r\n protected props = inject(REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS).props ?? {};\r\n protected reactComponent = inject(REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS).component;\r\n protected context: ReactCustomDetailComponentContext;\r\n\r\n ngOnInit() {\r\n this.context = {\r\n detailForm: this.detailForm,\r\n entity$: this.entity$,\r\n };\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, OnInit, ViewEncapsulation } from '@angular/core';\r\nimport { FormControl } from '@angular/forms';\r\nimport { CustomField, FormInputComponent } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\nimport { ReactFormInputOptions } from '../types';\r\n\r\nexport const REACT_INPUT_COMPONENT_OPTIONS = new InjectionToken<{\r\n component: ElementType;\r\n}>('REACT_INPUT_COMPONENT_OPTIONS');\r\n\r\n@Component({\r\n selector: 'vdr-react-form-input-component',\r\n template: ` <div [vdrReactComponentHost]=\"reactComponent\" [context]=\"context\" [props]=\"context\"></div> `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective],\r\n})\r\nexport class ReactFormInputComponent implements FormInputComponent, OnInit {\r\n static readonly id: string = 'react-form-input-component';\r\n readonly: boolean;\r\n formControl: FormControl;\r\n config: CustomField & Record<string, any>;\r\n\r\n protected context: ReactFormInputOptions;\r\n\r\n protected reactComponent = inject(REACT_INPUT_COMPONENT_OPTIONS).component;\r\n\r\n ngOnInit() {\r\n this.context = {\r\n formControl: this.formControl,\r\n readonly: this.readonly,\r\n config: this.config,\r\n };\r\n }\r\n}\r\n","import { Component, inject, InjectionToken, ViewEncapsulation } from '@angular/core';\r\nimport { ROUTE_COMPONENT_OPTIONS, RouteComponent, SharedModule } from '@vendure/admin-ui/core';\r\nimport { ReactComponentHostDirective } from '../directives/react-component-host.directive';\r\nimport { ReactRouteComponentOptions } from '../types';\r\n\r\nexport const REACT_ROUTE_COMPONENT_OPTIONS = new InjectionToken<ReactRouteComponentOptions>(\r\n 'REACT_ROUTE_COMPONENT_OPTIONS',\r\n);\r\n\r\n@Component({\r\n selector: 'vdr-react-route-component',\r\n template: `\r\n <vdr-route-component\r\n ><div [vdrReactComponentHost]=\"reactComponent\" [props]=\"props\"></div\r\n ></vdr-route-component>\r\n `,\r\n styleUrls: ['./react-global-styles.scss'],\r\n encapsulation: ViewEncapsulation.None,\r\n standalone: true,\r\n imports: [ReactComponentHostDirective, RouteComponent, SharedModule],\r\n})\r\nexport class ReactRouteComponent {\r\n protected props = inject(REACT_ROUTE_COMPONENT_OPTIONS).props;\r\n protected reactComponent = inject(ROUTE_COMPONENT_OPTIONS).component;\r\n}\r\n","import React, { PropsWithChildren, ReactNode } from 'react';\r\n\r\n/**\r\n * @description\r\n * A container for the primary actions on a list or detail page\r\n *\r\n * @example\r\n * ```ts\r\n * import { ActionBar } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <ActionBar leftContent={<div>Optional left content</div>}>\r\n * <button className='button primary'>Primary action</button>\r\n * </ActionBar>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function ActionBar(props: PropsWithChildren<{ leftContent?: ReactNode }>) {\r\n return (\r\n <div className={'vdr-action-bar'}>\r\n <div className=\"left-content\">{props.leftContent}</div>\r\n <div className=\"right-content\">{props.children}</div>\r\n </div>\r\n );\r\n}\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\n/**\r\n * @description\r\n * A card component which can be used to group related content.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Card } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <Card title='My Title'>\r\n * <p>Some content</p>\r\n * </Card>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function Card(props: PropsWithChildren<{ title?: string; paddingX?: boolean }>) {\r\n return (\r\n <div className={'vdr-card'}>\r\n <div className={`card-container ${props.paddingX !== false ? 'padding-x' : ''}`}>\r\n {props.title && (\r\n <div className={'title-row'}>\r\n <div className=\"title\">{props.title}</div>\r\n </div>\r\n )}\r\n <div className=\"contents\">{props.children}</div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { ClarityIcons } from '@cds/core/icon';\r\nimport { IconShapeTuple } from '@cds/core/icon/interfaces/icon.interfaces';\r\nimport React, { DOMAttributes, useEffect } from 'react';\r\n\r\ntype CustomElement<T> = Partial<T & DOMAttributes<T> & { children: any }>;\r\n\r\nexport interface CdsIconProps {\r\n shape: string;\r\n size: string | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';\r\n direction: 'up' | 'down' | 'left' | 'right';\r\n flip: 'horizontal' | 'vertical';\r\n solid: boolean;\r\n status: 'info' | 'success' | 'warning' | 'danger';\r\n inverse: boolean;\r\n badge: 'info' | 'success' | 'warning' | 'danger';\r\n}\r\n\r\ndeclare global {\r\n namespace JSX {\r\n interface IntrinsicElements {\r\n ['cds-icon']: CustomElement<CdsIconProps>;\r\n }\r\n }\r\n}\r\n\r\nexport function registerCdsIcon(icon: IconShapeTuple) {\r\n ClarityIcons.addIcons(icon);\r\n}\r\n\r\n/**\r\n * @description\r\n * A React wrapper for the Clarity UI icon component.\r\n *\r\n * @example\r\n * ```ts\r\n * import { userIcon } from '@cds/core/icon';\r\n * import { CdsIcon } from '@vendure/admin-ui/react';\r\n *\r\n * registerCdsIcon(userIcon);\r\n * export function MyComponent() {\r\n * return <CdsIcon icon={userIcon} badge=\"warning\" solid size=\"lg\"></CdsIcon>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function CdsIcon(props: { icon: IconShapeTuple; className?: string } & Partial<CdsIconProps>) {\r\n const { icon, ...rest } = props;\r\n useEffect(() => {\r\n ClarityIcons.addIcons(icon);\r\n }, [icon]);\r\n return <cds-icon {...rest} shape={icon[0]}></cds-icon>;\r\n}\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\n/**\r\n * @description\r\n * A wrapper around form fields which provides a label, tooltip and error message.\r\n *\r\n * @example\r\n * ```ts\r\n * import { FormField } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyReactComponent() {\r\n * return (\r\n * <FormField label=\"My field\" tooltip=\"This is a tooltip\" invalid errorMessage=\"This field is invalid\">\r\n * <input type=\"text\" />\r\n * </FormField>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function FormField(\r\n props: PropsWithChildren<{\r\n for?: string;\r\n label?: string;\r\n tooltip?: string;\r\n invalid?: boolean;\r\n errorMessage?: string;\r\n }>,\r\n) {\r\n return (\r\n <div\r\n className={`form-group ` + (!props.label ? 'no-label' : '') + (props.invalid ? 'clr-error' : '')}\r\n >\r\n {props.label && <label htmlFor={props.for ?? ''}>{props.label}</label>}\r\n {props.tooltip && <div className=\"tooltip-text\">{props.tooltip}</div>}\r\n <div className={`input-row ` + (props.invalid ? 'invalid' : '')}>{props.children}</div>\r\n {props.errorMessage && <div className=\"error-message\">{props.errorMessage}</div>}\r\n </div>\r\n );\r\n}\r\n","import { ProviderToken } from '@angular/core';\r\nimport { useContext } from 'react';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\n\r\n/**\r\n * @description\r\n * Exposes the Angular injector which allows the injection of services into React components.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useInjector } from '\\@vendure/admin-ui/react';\r\n * import { NotificationService } from '\\@vendure/admin-ui/core';\r\n *\r\n * export const MyComponent = () => {\r\n * const notificationService = useInjector(NotificationService);\r\n *\r\n * const handleClick = () => {\r\n * notificationService.success('Hello world!');\r\n * };\r\n * // ...\r\n * return <div>...</div>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useInjector<T = any>(token: ProviderToken<T>): T {\r\n const context = useContext(HostedComponentContext);\r\n const instance = context?.injector.get(token);\r\n if (!instance) {\r\n throw new Error(`Could not inject ${(token as any).name ?? token.toString()}`);\r\n }\r\n return instance;\r\n}\r\n","import { Router } from '@angular/router';\r\nimport React, { PropsWithChildren } from 'react';\r\nimport { useInjector } from '../react-hooks/use-injector';\r\n\r\n/**\r\n * @description\r\n * A React component which renders an anchor tag and navigates to the specified route when clicked.\r\n * This is useful when you want to use a React component in a Vendure UI plugin which navigates to\r\n * a route in the admin-ui.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Link } from '@vendure/admin-ui/react';\r\n *\r\n * export const MyReactComponent = () => {\r\n * return <Link href=\"/extensions/my-extension\">Go to my extension</Link>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function Link(props: PropsWithChildren<{ href: string; [props: string]: any }>) {\r\n const router = useInjector(Router);\r\n const { href, ...rest } = props;\r\n\r\n function onClick(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) {\r\n e.preventDefault();\r\n void router.navigateByUrl(href);\r\n }\r\n\r\n return (\r\n <a href={href} onClick={onClick} {...rest}>\r\n {props.children}\r\n </a>\r\n );\r\n}\r\n","import React, { PropsWithChildren } from 'react';\r\n\r\n/**\r\n * @description\r\n * A container for page content which provides a consistent width and spacing.\r\n *\r\n * @example\r\n * ```ts\r\n * import { PageBlock } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <PageBlock>\r\n * ...\r\n * </PageBlock>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function PageBlock(props: PropsWithChildren) {\r\n return <div className=\"page-block\">{props.children}</div>;\r\n}\r\n","import React, { PropsWithChildren, ReactNode } from 'react';\r\n\r\n/**\r\n * @description\r\n * A responsive container for detail views with a main content area and an optional sidebar.\r\n *\r\n * @example\r\n * ```ts\r\n * import { PageDetailLayout } from '@vendure/admin-ui/react';\r\n *\r\n * export function MyComponent() {\r\n * return (\r\n * <PageDetailLayout sidebar={<div>Sidebar content</div>}>\r\n * <div>Main content</div>\r\n * </PageDetailLayout>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport function PageDetailLayout(props: PropsWithChildren<{ sidebar?: ReactNode }>) {\r\n return (\r\n <div className={'vdr-page-detail-layout'}>\r\n <div className=\"main\">{props.children}</div>\r\n <div className=\"sidebar\">{props.sidebar}</div>\r\n </div>\r\n );\r\n}\r\n","import { useEffect, useRef } from 'react';\r\nimport { Injector } from '@angular/core';\r\n\r\nimport { CreateEditorViewOptions, ProsemirrorService, ContextMenuService } from '@vendure/admin-ui/core';\r\nimport { useInjector } from './use-injector';\r\n\r\nexport interface useRichTextEditorOptions extends Omit<CreateEditorViewOptions, 'element'> {\r\n /**\r\n * @description\r\n * Control the DOM attributes of the editable element. May be either an object or a function going from an editor state to an object.\r\n * By default, the element will get a class \"ProseMirror\", and will have its contentEditable attribute determined by the editable prop.\r\n * Additional classes provided here will be added to the class. For other attributes, the value provided first (as in someProp) will be used.\r\n * Copied from real property description.\r\n */\r\n attributes?: Record<string, string>;\r\n}\r\n\r\n/**\r\n * @description\r\n * Provides access to the ProseMirror (rich text editor) instance.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useRichTextEditor } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function Component() {\r\n * const { ref, editor } = useRichTextEditor({\r\n * attributes: { class: '' },\r\n * onTextInput: (text) => console.log(text),\r\n * isReadOnly: () => false,\r\n * });\r\n *\r\n * return <div className=\"w-full\" ref={ref} />\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport const useRichTextEditor = ({ attributes, onTextInput, isReadOnly }: useRichTextEditorOptions) => {\r\n const injector = useInjector(Injector);\r\n const ref = useRef<HTMLDivElement>(null);\r\n const prosemirror = new ProsemirrorService(injector, useInjector(ContextMenuService));\r\n\r\n useEffect(() => {\r\n if (!ref.current) return;\r\n prosemirror.createEditorView({\r\n element: ref.current,\r\n isReadOnly,\r\n onTextInput,\r\n });\r\n const readOnly = isReadOnly();\r\n prosemirror.editorView.setProps({\r\n attributes,\r\n editable: readOnly ? () => false : () => true,\r\n });\r\n return () => {\r\n prosemirror.destroy();\r\n };\r\n }, [ref.current]);\r\n\r\n return { ref, editor: prosemirror };\r\n};\r\n","import React, {\r\n ChangeEvent,\r\n ForwardedRef,\r\n InputHTMLAttributes,\r\n forwardRef,\r\n useEffect,\r\n useState,\r\n} from 'react';\r\nimport { ProsemirrorService } from '@vendure/admin-ui/core';\r\nimport { useRichTextEditor } from '../react-hooks/use-rich-text-editor';\r\n\r\nexport type RichTextEditorType = InputHTMLAttributes<HTMLInputElement> & {\r\n /**\r\n * @description\r\n * Control the DOM attributes of the editable element. May be either an object or a function going from an editor state to an object.\r\n * By default, the element will get a class \"ProseMirror\", and will have its contentEditable attribute determined by the editable prop.\r\n * Additional classes provided here will be added to the class. For other attributes, the value provided first (as in someProp) will be used.\r\n * Copied from real property description.\r\n */\r\n attributes?: Record<string, string>;\r\n label?: string;\r\n readOnly?: boolean;\r\n onMount?: (editor: ProsemirrorService) => void;\r\n};\r\n\r\n/**\r\n * @description\r\n * A rich text editor component which uses ProseMirror (rich text editor) under the hood.\r\n *\r\n * @example\r\n * ```ts\r\n * import { RichTextEditor } from '@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function MyComponent() {\r\n * const onSubmit = async (e: React.FormEvent) => {\r\n * e.preventDefault();\r\n * const form = new FormData(e.target as HTMLFormElement);\r\n * const content = form.get(\"content\");\r\n * console.log(content);\r\n * };\r\n *\r\n * return (\r\n * <form className=\"w-full\" onSubmit={onSubmit}>\r\n * <RichTextEditor\r\n * name=\"content\"\r\n * readOnly={false}\r\n * onMount={(e) => console.log(\"Mounted\", e)}\r\n * />\r\n * <button type=\"submit\" className=\"btn btn-primary\">\r\n * Submit\r\n * </button>\r\n * </form>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-components\r\n */\r\nexport const RichTextEditor = forwardRef((props: RichTextEditorType, ref: ForwardedRef<HTMLInputElement>) => {\r\n const [data, setData] = useState<string>('');\r\n const { readOnly, label, ...rest } = props;\r\n const { ref: _ref, editor } = useRichTextEditor({\r\n attributes: props.attributes,\r\n isReadOnly: () => readOnly || false,\r\n onTextInput: text => {\r\n setData(text);\r\n if (props.onChange) {\r\n props.onChange({\r\n target: { value: text },\r\n } as ChangeEvent<HTMLInputElement>);\r\n }\r\n if (ref && 'current' in ref && ref.current) {\r\n ref.current.value = text;\r\n const event = new Event('input', {\r\n bubbles: true,\r\n cancelable: true,\r\n });\r\n ref.current.dispatchEvent(event);\r\n }\r\n },\r\n });\r\n\r\n useEffect(() => {\r\n if (props.onMount && editor) {\r\n props.onMount(editor);\r\n }\r\n if (typeof props.defaultValue === 'string') {\r\n editor.update(props.defaultValue);\r\n }\r\n }, []);\r\n return (\r\n <>\r\n <div ref={_ref} {...rest}>\r\n {label && <label className=\"rich-text-label\">{label}</label>}\r\n </div>\r\n <input type=\"hidden\" value={data} ref={ref} />\r\n </>\r\n );\r\n});\r\n\r\nRichTextEditor.displayName = 'RichTextEditor';\r\n","import { useContext, useEffect, useState } from 'react';\r\nimport { ReactCustomDetailComponentContext } from '../components/react-custom-detail.component';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\nimport { HostedReactComponentContext } from '../types';\r\n\r\n/**\r\n * @description\r\n * Provides the data available to React-based CustomDetailComponents.\r\n *\r\n * @example\r\n * ```ts\r\n * import { Card, useDetailComponentData } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function CustomDetailComponent(props: any) {\r\n * const { entity, detailForm } = useDetailComponentData();\r\n * const updateName = () => {\r\n * detailForm.get('name')?.setValue('New name');\r\n * detailForm.markAsDirty();\r\n * };\r\n * return (\r\n * <Card title={'Custom Detail Component'}>\r\n * <button className=\"button\" onClick={updateName}>\r\n * Update name\r\n * </button>\r\n * <pre>{JSON.stringify(entity, null, 2)}</pre>\r\n * </Card>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useDetailComponentData<T = any>() {\r\n const context = useContext(\r\n HostedComponentContext,\r\n ) as HostedReactComponentContext<ReactCustomDetailComponentContext>;\r\n\r\n if (!context.detailForm || !context.entity$) {\r\n throw new Error(`The useDetailComponentData hook can only be used within a CustomDetailComponent`);\r\n }\r\n\r\n const [entity, setEntity] = useState<T | null>(null);\r\n\r\n useEffect(() => {\r\n const subscription = context.entity$.subscribe(value => {\r\n setEntity(value);\r\n });\r\n return () => subscription.unsubscribe();\r\n }, []);\r\n\r\n return {\r\n entity,\r\n detailForm: context.detailForm,\r\n };\r\n}\r\n","import { CustomFieldType } from '@vendure/common/lib/shared-types';\r\nimport { useContext, useEffect, useState } from 'react';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\nimport { HostedReactComponentContext, ReactFormInputOptions } from '../types';\r\n\r\n/**\r\n * @description\r\n * Provides access to the current FormControl value and a method to update the value.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useFormControl, ReactFormInputProps } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function ReactNumberInput({ readonly }: ReactFormInputProps) {\r\n * const { value, setFormValue } = useFormControl();\r\n *\r\n * const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n * setFormValue(val);\r\n * };\r\n * return (\r\n * <div>\r\n * <input readOnly={readonly} type=\"number\" onChange={handleChange} value={value} />\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useFormControl() {\r\n const context = useContext(HostedComponentContext);\r\n if (!context) {\r\n throw new Error('No HostedComponentContext found');\r\n }\r\n if (!isFormInputContext(context)) {\r\n throw new Error('useFormControl() can only be used in a form input component');\r\n }\r\n const { formControl, config } = context;\r\n const [value, setValue] = useState(formControl.value ?? 0);\r\n\r\n useEffect(() => {\r\n const subscription = formControl.valueChanges.subscribe(v => {\r\n setValue(v);\r\n });\r\n return () => {\r\n subscription.unsubscribe();\r\n };\r\n }, []);\r\n\r\n function setFormValue(newValue: any) {\r\n formControl.setValue(coerceFormValue(newValue, config.type as CustomFieldType));\r\n formControl.markAsDirty();\r\n }\r\n\r\n return { value, setFormValue };\r\n}\r\n\r\nfunction isFormInputContext(\r\n context: HostedReactComponentContext,\r\n): context is HostedReactComponentContext<ReactFormInputOptions> {\r\n return context.config && context.formControl;\r\n}\r\n\r\nfunction coerceFormValue(value: any, type: CustomFieldType) {\r\n switch (type) {\r\n case 'int':\r\n case 'float':\r\n return Number(value);\r\n case 'boolean':\r\n return Boolean(value);\r\n default:\r\n return value;\r\n }\r\n}\r\n","import { BreadcrumbValue } from '@vendure/admin-ui/core';\r\nimport { useContext } from 'react';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\nimport { HostedReactComponentContext, ReactRouteComponentOptions } from '../types';\r\n\r\n/**\r\n * @description\r\n * Provides functions for setting the current page title and breadcrumb.\r\n *\r\n * @example\r\n * ```ts\r\n * import { usePageMetadata } from '\\@vendure/admin-ui/react';\r\n * import { useEffect } from 'react';\r\n *\r\n * export const MyComponent = () => {\r\n * const { setTitle, setBreadcrumb } = usePageMetadata();\r\n * useEffect(() => {\r\n * setTitle('My Page');\r\n * setBreadcrumb([\r\n * { link: ['./parent'], label: 'Parent Page' },\r\n * { link: ['./'], label: 'This Page' },\r\n * ]);\r\n * }, []);\r\n * // ...\r\n * return <div>...</div>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function usePageMetadata() {\r\n const context = useContext(\r\n HostedComponentContext,\r\n ) as HostedReactComponentContext<ReactRouteComponentOptions>;\r\n const setBreadcrumb = (newValue: BreadcrumbValue) => {\r\n context.pageMetadataService?.setBreadcrumbs(newValue);\r\n };\r\n const setTitle = (newTitle: string) => {\r\n context.pageMetadataService?.setTitle(newTitle);\r\n };\r\n\r\n return {\r\n setBreadcrumb,\r\n setTitle,\r\n };\r\n}\r\n","import { TypedDocumentNode } from '@graphql-typed-document-node/core';\r\nimport { DataService } from '@vendure/admin-ui/core';\r\nimport { DocumentNode } from 'graphql/index';\r\nimport { useCallback, useContext, useEffect, useState } from 'react';\r\nimport { firstValueFrom, Observable } from 'rxjs';\r\nimport { tap } from 'rxjs/operators';\r\nimport { HostedComponentContext } from '../directives/react-component-host.directive';\r\n\r\n/**\r\n * @description\r\n * A React hook which provides access to the results of a GraphQL query.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useQuery } from '\\@vendure/admin-ui/react';\r\n * import { gql } from 'graphql-tag';\r\n *\r\n * const GET_PRODUCT = gql`\r\n * query GetProduct($id: ID!) {\r\n * product(id: $id) {\r\n * id\r\n * name\r\n * description\r\n * }\r\n * }`;\r\n *\r\n * export const MyComponent = () => {\r\n * const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' }, { refetchOnChannelChange: true });\r\n *\r\n * if (loading) return <div>Loading...</div>;\r\n * if (error) return <div>Error! { error }</div>;\r\n * return (\r\n * <div>\r\n * <h1>{data.product.name}</h1>\r\n * <p>{data.product.description}</p>\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useQuery<T, V extends Record<string, any> = Record<string, any>>(\r\n query: DocumentNode | TypedDocumentNode<T, V>,\r\n variables?: V,\r\n options: { refetchOnChannelChange: boolean } = { refetchOnChannelChange: false },\r\n) {\r\n const { refetchOnChannelChange } = options;\r\n const { data, loading, error, runQuery } = useDataService<T, V>((dataService, vars) => {\r\n let queryFn = dataService.query(query, vars);\r\n if (refetchOnChannelChange) {\r\n queryFn = queryFn.refetchOnChannelChange();\r\n }\r\n return queryFn.stream$;\r\n });\r\n useEffect(() => {\r\n const subscription = runQuery(variables).subscribe();\r\n return () => subscription.unsubscribe();\r\n }, [runQuery]);\r\n\r\n const refetch = (variables?: V) => firstValueFrom(runQuery(variables));\r\n return { data, loading, error, refetch } as const;\r\n}\r\n\r\n/**\r\n * @description\r\n * A React hook which allows you to execute a GraphQL query lazily.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useLazyQuery } from '\\@vendure/admin-ui/react';\r\n * import { gql } from 'graphql-tag';\r\n *\r\n * const GET_PRODUCT = gql`\r\n * query GetProduct($id: ID!) {\r\n * product(id: $id) {\r\n * id\r\n * name\r\n * description\r\n * }\r\n * }`;\r\n * type ProductResponse = {\r\n * product: {\r\n * name: string\r\n * description: string\r\n * }\r\n * }\r\n *\r\n * export const MyComponent = () => {\r\n * const [getProduct, { data, loading, error }] = useLazyQuery<ProductResponse>(GET_PRODUCT, { refetchOnChannelChange: true });\r\n *\r\n * const handleClick = () => {\r\n * getProduct({\r\n * id: '1',\r\n * }).then(result => {\r\n * // do something with the result\r\n * });\r\n * };\r\n *\r\n * if (loading) return <div>Loading...</div>;\r\n * if (error) return <div>Error! { error }</div>;\r\n *\r\n * return (\r\n * <div>\r\n * <button onClick={handleClick}>Get product</button>\r\n * {data && (\r\n * <div>\r\n * <h1>{data.product.name}</h1>\r\n * <p>{data.product.description}</p>\r\n * </div>)}\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n *\r\n * @since 2.2.0\r\n * @docsCategory react-hooks\r\n */\r\nexport function useLazyQuery<T, V extends Record<string, any> = Record<string, any>>(\r\n query: DocumentNode | TypedDocumentNode<T, V>,\r\n options: { refetchOnChannelChange: boolean } = { refetchOnChannelChange: false },\r\n) {\r\n const { refetchOnChannelChange } = options;\r\n const { data, loading, error, runQuery } = useDataService<T, V>((dataService, vars) => {\r\n let queryFn = dataService.query(query, vars);\r\n if (refetchOnChannelChange) {\r\n queryFn = queryFn.refetchOnChannelChange();\r\n }\r\n return queryFn.stream$;\r\n });\r\n const rest = { data, loading, error };\r\n const execute = (variables?: V) => firstValueFrom(runQuery(variables));\r\n return [execute, rest] as [typeof execute, typeof rest];\r\n}\r\n\r\n/**\r\n * @description\r\n * A React hook which allows you to execute a GraphQL mutation.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useMutation } from '\\@vendure/admin-ui/react';\r\n * import { gql } from 'graphql-tag';\r\n *\r\n * const UPDATE_PRODUCT = gql`\r\n * mutation UpdateProduct($input: UpdateProductInput!) {\r\n * updateProduct(input: $input) {\r\n * id\r\n * name\r\n * }\r\n * }`;\r\n *\r\n * export const MyComponent = () => {\r\n * const [updateProduct, { data, loading, error }] = useMutation(UPDATE_PRODUCT);\r\n *\r\n * const handleClick = () => {\r\n * updateProduct({\r\n * input: {\r\n * id: '1',\r\n * name: 'New name',\r\n * },\r\n * }).then(result => {\r\n * // do something with the result\r\n * });\r\n * };\r\n *\r\n * if (loading) return <div>Loading...</div>;\r\n * if (error) return <div>Error! { error }</div>;\r\n *\r\n * return (\r\n * <div>\r\n * <button onClick={handleClick}>Update product</button>\r\n * {data && <div>Product updated!</div>}\r\n * </div>\r\n * );\r\n * };\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useMutation<T, V extends Record<string, any> = Record<string, any>>(\r\n mutation: DocumentNode | TypedDocumentNode<T, V>,\r\n) {\r\n const { data, loading, error, runQuery } = useDataService<T, V>((dataService, variables) =>\r\n dataService.mutate(mutation, variables),\r\n );\r\n const rest = { data, loading, error };\r\n const execute = (variables?: V) => firstValueFrom(runQuery(variables));\r\n return [execute, rest] as [typeof execute, typeof rest];\r\n}\r\n\r\nexport function useDataService<T, V extends Record<string, any> = Record<string, any>>(\r\n operation: (dataService: DataService, variables?: V) => Observable<T>,\r\n) {\r\n const context = useContext(HostedComponentContext);\r\n const dataService = context?.injector.get(DataService);\r\n if (!dataService) {\r\n throw new Error('No DataService found in HostedComponentContext');\r\n }\r\n\r\n const [data, setData] = useState<T>();\r\n const [error, setError] = useState<string>();\r\n const [loading, setLoading] = useState(false);\r\n\r\n const runQuery = useCallback((variables?: V) => {\r\n setLoading(true);\r\n return operation(dataService, variables).pipe(\r\n tap({\r\n next: res => {\r\n setData(res);\r\n setLoading(false);\r\n },\r\n error: err => {\r\n setError(err.message);\r\n setLoading(false);\r\n },\r\n }),\r\n );\r\n }, []);\r\n\r\n return { data, loading, error, runQuery };\r\n}\r\n","import { ActivatedRoute } from '@angular/router';\r\nimport { useEffect, useState } from 'react';\r\nimport { useInjector } from './use-injector';\r\n\r\n/**\r\n * @description\r\n * Provides access to the current route params and query params.\r\n *\r\n * @example\r\n * ```ts\r\n * import { useRouteParams } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function MyComponent() {\r\n * const { params, queryParams } = useRouteParams();\r\n * // ...\r\n * return <div>{ params.id }</div>;\r\n * }\r\n * ```\r\n *\r\n * @docsCategory react-hooks\r\n */\r\nexport function useRouteParams() {\r\n const activatedRoute = useInjector(ActivatedRoute);\r\n const [params, setParams] = useState(activatedRoute.snapshot.params);\r\n const [queryParams, setQueryParams] = useState(activatedRoute.snapshot.queryParams);\r\n\r\n useEffect(() => {\r\n const subscription = activatedRoute.params.subscribe(value => {\r\n setParams(value);\r\n });\r\n subscription.add(activatedRoute.queryParams.subscribe(value => setQueryParams(value)));\r\n return () => subscription.unsubscribe();\r\n }, []);\r\n\r\n activatedRoute;\r\n\r\n return {\r\n params,\r\n queryParams,\r\n };\r\n}\r\n","import { APP_INITIALIZER } from '@angular/core';\r\nimport { CustomDetailComponentLocationId, CustomDetailComponentService } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport {\r\n REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS,\r\n ReactCustomDetailComponent,\r\n} from './components/react-custom-detail.component';\r\n\r\n/**\r\n * @description\r\n * Configures a React-based component to be placed in a detail page in the given location.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport interface ReactCustomDetailComponentConfig {\r\n /**\r\n * @description\r\n * The id of the detail page location in which to place the component.\r\n */\r\n locationId: CustomDetailComponentLocationId;\r\n /**\r\n * @description\r\n * The React component to render.\r\n */\r\n component: ElementType;\r\n /**\r\n * @description\r\n * Optional props to pass to the React component.\r\n */\r\n props?: Record<string, any>;\r\n}\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be rendered in a detail page in the given location.\r\n * Components used as custom detail components can make use of the {@link useDetailComponentData} hook.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactCustomDetailComponent(config: ReactCustomDetailComponentConfig) {\r\n return {\r\n provide: APP_INITIALIZER,\r\n multi: true,\r\n useFactory: (customDetailComponentService: CustomDetailComponentService) => () => {\r\n customDetailComponentService.registerCustomDetailComponent({\r\n component: ReactCustomDetailComponent,\r\n locationId: config.locationId,\r\n providers: [\r\n {\r\n provide: REACT_CUSTOM_DETAIL_COMPONENT_OPTIONS,\r\n useValue: {\r\n component: config.component,\r\n props: config.props,\r\n },\r\n },\r\n ],\r\n });\r\n },\r\n deps: [CustomDetailComponentService],\r\n };\r\n}\r\n","import { APP_INITIALIZER } from '@angular/core';\r\nimport {\r\n DataTableColumnId,\r\n DataTableCustomComponentService,\r\n DataTableLocationId,\r\n} from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport {\r\n REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS,\r\n ReactCustomColumnComponent,\r\n} from './components/react-custom-column.component';\r\n\r\n/**\r\n * @description\r\n * Configures a {@link CustomDetailComponent} to be placed in the given location.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport interface ReactDataTableComponentConfig {\r\n /**\r\n * @description\r\n * The location in the UI where the custom component should be placed.\r\n */\r\n tableId: DataTableLocationId;\r\n /**\r\n * @description\r\n * The column in the table where the custom component should be placed.\r\n */\r\n columnId: DataTableColumnId;\r\n /**\r\n * @description\r\n * The component to render in the table cell. This component will receive the `rowItem` prop\r\n * which is the data object for the row, e.g. the `Product` object if used in the `product-list` table.\r\n */\r\n component: ElementType;\r\n /**\r\n * @description\r\n * Optional props to pass to the React component.\r\n */\r\n props?: Record<string, any>;\r\n}\r\n\r\n/**\r\n * @description\r\n * The props that will be passed to the React component registered via {@link registerReactDataTableComponent}.\r\n */\r\nexport interface ReactDataTableComponentProps<T = any> {\r\n rowItem: T;\r\n [prop: string]: any;\r\n}\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be rendered in a data table in the given location.\r\n * The component will receive the `rowItem` prop which is the data object for the row,\r\n * e.g. the `Product` object if used in the `product-list` table.\r\n *\r\n * @example\r\n * ```ts title=\"components/SlugWithLink.tsx\"\r\n * import { ReactDataTableComponentProps } from '\\@vendure/admin-ui/react';\r\n * import React from 'react';\r\n *\r\n * export function SlugWithLink({ rowItem }: ReactDataTableComponentProps<{ slug: string }>) {\r\n * return (\r\n * <a href={`https://example.com/products/${rowItem.slug}`} target=\"_blank\">\r\n * {rowItem.slug}\r\n * </a>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * ```ts title=\"providers.ts\"\r\n * import { registerReactDataTableComponent } from '\\@vendure/admin-ui/react';\r\n * import { SlugWithLink } from './components/SlugWithLink';\r\n *\r\n * export default [\r\n * registerReactDataTableComponent({\r\n * component: SlugWithLink,\r\n * tableId: 'product-list',\r\n * columnId: 'slug',\r\n * props: {\r\n * foo: 'bar',\r\n * },\r\n * }),\r\n * ];\r\n * ```\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactDataTableComponent(config: ReactDataTableComponentConfig) {\r\n return {\r\n provide: APP_INITIALIZER,\r\n multi: true,\r\n useFactory: (dataTableCustomComponentService: DataTableCustomComponentService) => () => {\r\n dataTableCustomComponentService.registerCustomComponent({\r\n ...config,\r\n component: ReactCustomColumnComponent,\r\n providers: [\r\n {\r\n provide: REACT_CUSTOM_COLUMN_COMPONENT_OPTIONS,\r\n useValue: {\r\n component: config.component,\r\n props: config.props,\r\n },\r\n },\r\n ],\r\n });\r\n },\r\n deps: [DataTableCustomComponentService],\r\n };\r\n}\r\n","import { APP_INITIALIZER, FactoryProvider } from '@angular/core';\r\nimport { ComponentRegistryService } from '@vendure/admin-ui/core';\r\nimport { ElementType } from 'react';\r\nimport {\r\n REACT_INPUT_COMPONENT_OPTIONS,\r\n ReactFormInputComponent,\r\n} from './components/react-form-input.component';\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be used as a {@link FormInputComponent}.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactFormInputComponent(id: string, component: ElementType): FactoryProvider {\r\n return {\r\n provide: APP_INITIALIZER,\r\n multi: true,\r\n useFactory: (registry: ComponentRegistryService) => () => {\r\n registry.registerInputComponent(id, ReactFormInputComponent, [\r\n {\r\n provide: REACT_INPUT_COMPONENT_OPTIONS,\r\n useValue: {\r\n component,\r\n },\r\n },\r\n ]);\r\n },\r\n deps: [ComponentRegistryService],\r\n };\r\n}\r\n","import { Route } from '@angular/router';\r\nimport { ResultOf, TypedDocumentNode } from '@graphql-typed-document-node/core';\r\nimport { registerRouteComponent, RegisterRouteComponentOptions } from '@vendure/admin-ui/core';\r\nimport { DocumentNode } from 'graphql/index';\r\nimport { ElementType } from 'react';\r\nimport { REACT_ROUTE_COMPONENT_OPTIONS, ReactRouteComponent } from './components/react-route.component';\r\nimport { ReactRouteComponentOptions } from './types';\r\n\r\n/**\r\n * @description\r\n * Configuration for a React-based route component.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\ntype RegisterReactRouteComponentOptions<\r\n Entity extends { id: string; updatedAt?: string },\r\n T extends DocumentNode | TypedDocumentNode<any, { id: string }>,\r\n Field extends keyof ResultOf<T>,\r\n R extends Field,\r\n> = RegisterRouteComponentOptions<ElementType, Entity, T, Field, R> & {\r\n props?: Record<string, any>;\r\n};\r\n\r\n/**\r\n * @description\r\n * Registers a React component to be used as a route component.\r\n *\r\n * @docsCategory react-extensions\r\n */\r\nexport function registerReactRouteComponent<\r\n Entity extends { id: string; updatedAt?: string },\r\n T extends DocumentNode | TypedDocumentNode<any, { id: string }>,\r\n Field extends keyof ResultOf<T>,\r\n R extends Field,\r\n>(options: RegisterReactRouteComponentOptions<Entity, T, Field, R>): Route {\r\n const routeDef = registerRouteComponent(options);\r\n return {\r\n ...routeDef,\r\n providers: [\r\n {\r\n provide: REACT_ROUTE_COMPONENT_OPTIONS,\r\n useValue: {\r\n props: options.props,\r\n } satisfies ReactRouteComponentOptions,\r\n },\r\n ...(routeDef.providers ?? []),\r\n ],\r\n component: ReactRouteComponent,\r\n };\r\n}\r\n","// This file was generated by the build-public-api.ts script\nexport * from './components/react-custom-column.component';\nexport * from './components/react-custom-detail.component';\nexport * from './components/react-form-input.component';\nexport * from './components/react-route.component';\nexport * from './directives/react-component-host.directive';\nexport * from './react-components/ActionBar';\nexport * from './react-components/Card';\nexport * from './react-components/CdsIcon';\nexport * from './react-components/FormField';\nexport * from './react-components/Link';\nexport * from './react-components/PageBlock';\nexport * from './react-components/PageDetailLayout';\nexport * from './react-components/RichTextEditor';\nexport * from './react-hooks/use-detail-component-data';\nexport * from './react-hooks/use-form-control';\nexport * from './react-hooks/use-injector';\nexport * from './react-hooks/use-page-metadata';\nexport * from './react-hooks/use-query';\nexport * from './react-hooks/use-rich-text-editor';\nexport * from './react-hooks/use-route-params';\nexport * from './register-react-custom-detail-component';\nexport * from './register-react-data-table-component';\nexport * from './register-react-form-input-component';\nexport * from './register-react-route-component';\nexport * from './types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;MAMa,sBAAsB,GAAG,aAAa,CAAqC,IAAI,EAAE;AAE9F;;AAEG;MAKU,2BAA2B,CAAA;AAOpC,IAAA,WAAA,CACY,IAAgB,EAChB,QAAkB,EACN,mBAAyC,EAAA;QAFrD,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QAChB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;QACN,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAsB;QAPxD,IAAO,CAAA,OAAA,GAAwB,EAAE,CAAC;QAEnC,IAAI,CAAA,IAAA,GAAgB,IAAI,CAAC;KAM7B;AAEJ,IAAA,MAAM,WAAW,GAAA;AACb,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC;AAEjC,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YACZ,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,IA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KAAK,EAAE,MAAM,CAAC,KAAK;AACtB,yBAAA;AACJ,qBAAA;AACJ,iBAAA;AACJ,aAAA,CAAC,CAAC;SACN;QACD,IAAI,EAAE,CAAC,+BAA+B,CAAC;KAC1C,CAAC;AACN;;ACtGA;;;;;AAKG;AACa,SAAA,+BAA+B,CAAC,EAAU,EAAE,SAAsB,EAAA;IAC9E,OAAO;AACH,QAAA,OAAO,EAAE,eAAe;AACxB,QAAA,KAAK,EAAE,IAAI;AACX,QAAA,UAAU,EAAE,CAAC,QAAkC,KAAK,MAAK;AACrD,YAAA,QAAQ,CAAC,sBAAsB,CAAC,EAAE,EAAE,uBAAuB,EAAE;AACzD,gBAAA;AACI,oBAAA,OAAO,EAAE,6BAA6B;AACtC,oBAAA,QAAQ,EAAE;wBACN,SAAS;AACZ,qBAAA;AACJ,iBAAA;AACJ,aAAA,CAAC,CAAC;SACN;QACD,IAAI,EAAE,CAAC,wBAAwB,CAAC;KACnC,CAAC;AACN;;ACPA;;;;;AAKG;AACG,SAAU,2BAA2B,CAKzC,OAAgE,EAAA;AAC9D,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO;AACH,QAAA,GAAG,QAAQ;AACX,QAAA,SAAS,EAAE;AACP,YAAA;AACI,gBAAA,OAAO,EAAE,6BAA6B;AACtC,gBAAA,QAAQ,EAAE;oBACN,KAAK,EAAE,OAAO,CAAC,KAAK;AACc,iBAAA;AACzC,aAAA;AACD,YAAA,IAAI,QAAQ,CAAC,SAAS,IAAI,EAAE;AAC/B,SAAA;AACD,QAAA,SAAS,EAAE,mBAAmB;KACjC,CAAC;AACN;;ACjDA;;ACAA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendure/admin-ui",
3
- "version": "2.2.7",
3
+ "version": "2.3.1",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "@angular/animations": "^17.2.4",
@@ -23,14 +23,14 @@
23
23
  "@ng-select/ng-select": "^12.0.7",
24
24
  "@ngx-translate/core": "^15.0.0",
25
25
  "@ngx-translate/http-loader": "^8.0.0",
26
- "@vendure/common": "^2.2.7",
26
+ "@vendure/common": "^2.3.1",
27
27
  "@webcomponents/custom-elements": "^1.6.0",
28
28
  "apollo-angular": "^6.0.0",
29
29
  "apollo-upload-client": "^18.0.1",
30
30
  "chartist": "^1.3.0",
31
31
  "codejar": "^4.2.0",
32
32
  "dayjs": "^1.11.10",
33
- "graphql": "16.8.1",
33
+ "graphql": "~16.9.0",
34
34
  "just-extend": "^6.2.0",
35
35
  "messageformat": "2.3.0",
36
36
  "ngx-pagination": "^6.0.3",
@@ -70,12 +70,6 @@
70
70
  "esm": "./esm2022/catalog/vendure-admin-ui-catalog.mjs",
71
71
  "default": "./fesm2022/vendure-admin-ui-catalog.mjs"
72
72
  },
73
- "./core": {
74
- "types": "./core/index.d.ts",
75
- "esm2022": "./esm2022/core/vendure-admin-ui-core.mjs",
76
- "esm": "./esm2022/core/vendure-admin-ui-core.mjs",
77
- "default": "./fesm2022/vendure-admin-ui-core.mjs"
78
- },
79
73
  "./customer": {
80
74
  "types": "./customer/index.d.ts",
81
75
  "esm2022": "./esm2022/customer/vendure-admin-ui-customer.mjs",
@@ -88,6 +82,12 @@
88
82
  "esm": "./esm2022/dashboard/vendure-admin-ui-dashboard.mjs",
89
83
  "default": "./fesm2022/vendure-admin-ui-dashboard.mjs"
90
84
  },
85
+ "./core": {
86
+ "types": "./core/index.d.ts",
87
+ "esm2022": "./esm2022/core/vendure-admin-ui-core.mjs",
88
+ "esm": "./esm2022/core/vendure-admin-ui-core.mjs",
89
+ "default": "./fesm2022/vendure-admin-ui-core.mjs"
90
+ },
91
91
  "./login": {
92
92
  "types": "./login/index.d.ts",
93
93
  "esm2022": "./esm2022/login/vendure-admin-ui-login.mjs",
@@ -21,7 +21,7 @@ import { Observable } from 'rxjs';
21
21
  * }`;
22
22
  *
23
23
  * export const MyComponent = () => {
24
- * const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' });
24
+ * const { data, loading, error } = useQuery(GET_PRODUCT, { id: '1' }, { refetchOnChannelChange: true });
25
25
  *
26
26
  * if (loading) return <div>Loading...</div>;
27
27
  * if (error) return <div>Error! { error }</div>;
@@ -36,7 +36,9 @@ import { Observable } from 'rxjs';
36
36
  *
37
37
  * @docsCategory react-hooks
38
38
  */
39
- export declare function useQuery<T, V extends Record<string, any> = Record<string, any>>(query: DocumentNode | TypedDocumentNode<T, V>, variables?: V): {
39
+ export declare function useQuery<T, V extends Record<string, any> = Record<string, any>>(query: DocumentNode | TypedDocumentNode<T, V>, variables?: V, options?: {
40
+ refetchOnChannelChange: boolean;
41
+ }): {
40
42
  readonly data: T | undefined;
41
43
  readonly loading: boolean;
42
44
  readonly error: string | undefined;
@@ -44,7 +46,7 @@ export declare function useQuery<T, V extends Record<string, any> = Record<strin
44
46
  };
45
47
  /**
46
48
  * @description
47
- * A React hook which allows you to execute a GraphQL query.
49
+ * A React hook which allows you to execute a GraphQL query lazily.
48
50
  *
49
51
  * @example
50
52
  * ```ts
@@ -67,7 +69,7 @@ export declare function useQuery<T, V extends Record<string, any> = Record<strin
67
69
  * }
68
70
  *
69
71
  * export const MyComponent = () => {
70
- * const [getProduct, { data, loading, error }] = useLazyQuery<ProductResponse>(GET_PRODUCT);
72
+ * const [getProduct, { data, loading, error }] = useLazyQuery<ProductResponse>(GET_PRODUCT, { refetchOnChannelChange: true });
71
73
  *
72
74
  * const handleClick = () => {
73
75
  * getProduct({
@@ -96,7 +98,9 @@ export declare function useQuery<T, V extends Record<string, any> = Record<strin
96
98
  * @since 2.2.0
97
99
  * @docsCategory react-hooks
98
100
  */
99
- export declare function useLazyQuery<T, V extends Record<string, any> = Record<string, any>>(query: DocumentNode | TypedDocumentNode<T, V>): [(variables?: V) => Promise<T>, {
101
+ export declare function useLazyQuery<T, V extends Record<string, any> = Record<string, any>>(query: DocumentNode | TypedDocumentNode<T, V>, options?: {
102
+ refetchOnChannelChange: boolean;
103
+ }): [(variables?: V) => Promise<T>, {
100
104
  data: T | undefined;
101
105
  loading: boolean;
102
106
  error: string | undefined;