@vendure/admin-ui 1.7.4 → 1.8.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 (228) hide show
  1. package/bundles/vendure-admin-ui-catalog.umd.js +902 -74
  2. package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
  3. package/bundles/vendure-admin-ui-core.umd.js +2392 -820
  4. package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
  5. package/bundles/vendure-admin-ui-customer.umd.js +4 -3
  6. package/bundles/vendure-admin-ui-customer.umd.js.map +1 -1
  7. package/bundles/vendure-admin-ui-dashboard.umd.js +3 -1
  8. package/bundles/vendure-admin-ui-dashboard.umd.js.map +1 -1
  9. package/bundles/vendure-admin-ui-order.umd.js +781 -175
  10. package/bundles/vendure-admin-ui-order.umd.js.map +1 -1
  11. package/bundles/vendure-admin-ui-settings.umd.js +5 -4
  12. package/bundles/vendure-admin-ui-settings.umd.js.map +1 -1
  13. package/bundles/vendure-admin-ui-system.umd.js +1 -1
  14. package/catalog/catalog.module.d.ts +3 -0
  15. package/catalog/components/assign-to-channel-dialog/assign-to-channel-dialog.component.d.ts +17 -0
  16. package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.d.ts +38 -0
  17. package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql.d.ts +4 -0
  18. package/catalog/components/collection-list/collection-list-bulk-actions.d.ts +6 -0
  19. package/catalog/components/collection-list/collection-list.component.d.ts +7 -5
  20. package/catalog/components/collection-tree/collection-tree-node.component.d.ts +8 -4
  21. package/catalog/components/collection-tree/collection-tree.component.d.ts +2 -1
  22. package/catalog/components/facet-list/facet-list-bulk-actions.d.ts +5 -0
  23. package/catalog/components/facet-list/facet-list.component.d.ts +2 -1
  24. package/catalog/components/product-list/product-list-bulk-actions.d.ts +6 -0
  25. package/catalog/components/product-list/product-list.component.d.ts +2 -1
  26. package/catalog/public_api.d.ts +6 -0
  27. package/catalog/vendure-admin-ui-catalog.metadata.json +1 -1
  28. package/core/common/component-registry-types.d.ts +1 -1
  29. package/core/common/generated-types.d.ts +609 -3
  30. package/core/common/utilities/bulk-action-utils.d.ts +19 -0
  31. package/core/common/utilities/selection-manager.d.ts +7 -0
  32. package/core/common/version.d.ts +1 -1
  33. package/core/data/definitions/collection-definitions.d.ts +3 -0
  34. package/core/data/definitions/facet-definitions.d.ts +3 -0
  35. package/core/data/definitions/order-definitions.d.ts +12 -0
  36. package/core/data/definitions/product-definitions.d.ts +1 -0
  37. package/core/data/providers/collection-data.service.d.ts +4 -1
  38. package/core/data/providers/facet-data.service.d.ts +4 -1
  39. package/core/data/providers/order-data.service.d.ts +18 -1
  40. package/core/data/providers/product-data.service.d.ts +1 -0
  41. package/core/providers/bulk-action-registry/bulk-action-registry.service.d.ts +6 -0
  42. package/core/providers/bulk-action-registry/bulk-action-types.d.ts +149 -0
  43. package/core/providers/bulk-action-registry/register-bulk-action.d.ts +53 -0
  44. package/core/providers/modal/modal.service.d.ts +2 -0
  45. package/core/providers/nav-builder/nav-builder-types.d.ts +1 -0
  46. package/core/public_api.d.ts +18 -1
  47. package/core/shared/components/asset-gallery/asset-gallery.component.d.ts +3 -3
  48. package/core/shared/components/bulk-action-menu/bulk-action-menu.component.d.ts +29 -0
  49. package/core/shared/components/data-table/data-table.component.d.ts +26 -7
  50. package/core/shared/components/dropdown/dropdown-menu.component.d.ts +1 -0
  51. package/core/shared/components/radio-card/radio-card-fieldset.component.d.ts +21 -0
  52. package/core/shared/components/radio-card/radio-card.component.d.ts +19 -0
  53. package/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.component.d.ts +28 -0
  54. package/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.service.d.ts +31 -0
  55. package/core/shared/components/rich-text-editor/prosemirror/custom-nodes.d.ts +4 -0
  56. package/core/shared/components/rich-text-editor/prosemirror/inputrules.d.ts +5 -5
  57. package/core/shared/components/rich-text-editor/prosemirror/menu/links.d.ts +1 -1
  58. package/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.d.ts +12 -0
  59. package/core/shared/components/rich-text-editor/prosemirror/menu/menu-plugin.d.ts +9 -0
  60. package/core/shared/components/rich-text-editor/prosemirror/menu/sub-menu-with-icon.d.ts +14 -0
  61. package/core/shared/components/rich-text-editor/prosemirror/plugins/image-plugin.d.ts +7 -0
  62. package/core/shared/components/rich-text-editor/prosemirror/plugins/link-select-plugin.d.ts +1 -1
  63. package/core/shared/components/rich-text-editor/prosemirror/plugins/raw-editor-plugin.d.ts +7 -0
  64. package/core/shared/components/rich-text-editor/prosemirror/plugins/tables-plugin.d.ts +13 -0
  65. package/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.d.ts +7 -3
  66. package/core/shared/components/rich-text-editor/prosemirror/types.d.ts +0 -2
  67. package/core/shared/components/rich-text-editor/raw-html-dialog/raw-html-dialog.component.d.ts +18 -0
  68. package/core/shared/components/rich-text-editor/rich-text-editor.component.d.ts +6 -2
  69. package/core/shared/dynamic-form-inputs/code-editor-form-input/base-code-editor-form-input.component.d.ts +27 -0
  70. package/core/shared/dynamic-form-inputs/code-editor-form-input/html-editor-form-input.component.d.ts +19 -0
  71. package/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.d.ts +5 -17
  72. package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +2 -1
  73. package/core/vendure-admin-ui-core.metadata.json +1 -1
  74. package/customer/components/customer-group-member-list/customer-group-member-list.component.d.ts +11 -4
  75. package/customer/vendure-admin-ui-customer.metadata.json +1 -1
  76. package/esm2015/catalog/catalog.module.js +25 -2
  77. package/esm2015/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.js +4 -1
  78. package/esm2015/catalog/components/assign-to-channel-dialog/assign-to-channel-dialog.component.js +51 -0
  79. package/esm2015/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.js +89 -0
  80. package/esm2015/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql.js +69 -0
  81. package/esm2015/catalog/components/collection-detail/collection-detail.component.js +3 -3
  82. package/esm2015/catalog/components/collection-list/collection-list-bulk-actions.js +147 -0
  83. package/esm2015/catalog/components/collection-list/collection-list.component.js +17 -8
  84. package/esm2015/catalog/components/collection-tree/collection-tree-node.component.js +16 -7
  85. package/esm2015/catalog/components/collection-tree/collection-tree.component.js +3 -2
  86. package/esm2015/catalog/components/facet-list/facet-list-bulk-actions.js +208 -0
  87. package/esm2015/catalog/components/facet-list/facet-list.component.js +13 -4
  88. package/esm2015/catalog/components/product-detail/product-detail.component.js +35 -23
  89. package/esm2015/catalog/components/product-list/product-list-bulk-actions.js +173 -0
  90. package/esm2015/catalog/components/product-list/product-list.component.js +10 -5
  91. package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +2 -2
  92. package/esm2015/catalog/providers/routing/collection-resolver.js +2 -1
  93. package/esm2015/catalog/public_api.js +7 -1
  94. package/esm2015/core/common/component-registry-types.js +1 -1
  95. package/esm2015/core/common/generated-types.js +5 -1
  96. package/esm2015/core/common/introspection-result.js +296 -191
  97. package/esm2015/core/common/utilities/bulk-action-utils.js +44 -0
  98. package/esm2015/core/common/utilities/selection-manager.js +33 -1
  99. package/esm2015/core/common/version.js +2 -2
  100. package/esm2015/core/components/breadcrumb/breadcrumb.component.js +1 -1
  101. package/esm2015/core/data/definitions/collection-definitions.js +30 -1
  102. package/esm2015/core/data/definitions/facet-definitions.js +31 -1
  103. package/esm2015/core/data/definitions/order-definitions.js +114 -1
  104. package/esm2015/core/data/definitions/product-definitions.js +15 -1
  105. package/esm2015/core/data/providers/collection-data.service.js +17 -2
  106. package/esm2015/core/data/providers/customer-data.service.js +8 -4
  107. package/esm2015/core/data/providers/facet-data.service.js +18 -2
  108. package/esm2015/core/data/providers/order-data.service.js +38 -2
  109. package/esm2015/core/data/providers/product-data.service.js +7 -2
  110. package/esm2015/core/data/utils/remove-readonly-custom-fields.js +5 -1
  111. package/esm2015/core/providers/bulk-action-registry/bulk-action-registry.service.js +27 -0
  112. package/esm2015/core/providers/bulk-action-registry/bulk-action-types.js +2 -0
  113. package/esm2015/core/providers/bulk-action-registry/register-bulk-action.js +63 -0
  114. package/esm2015/core/providers/dashboard-widget/dashboard-widget.service.js +1 -4
  115. package/esm2015/core/providers/modal/modal.service.js +2 -1
  116. package/esm2015/core/providers/nav-builder/nav-builder-types.js +1 -1
  117. package/esm2015/core/public_api.js +19 -2
  118. package/esm2015/core/shared/components/action-bar/action-bar.component.js +4 -8
  119. package/esm2015/core/shared/components/asset-gallery/asset-gallery.component.js +2 -2
  120. package/esm2015/core/shared/components/bulk-action-menu/bulk-action-menu.component.js +99 -0
  121. package/esm2015/core/shared/components/data-table/data-table.component.js +64 -15
  122. package/esm2015/core/shared/components/dropdown/dropdown-menu.component.js +4 -3
  123. package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +2 -2
  124. package/esm2015/core/shared/components/language-selector/language-selector.component.js +2 -2
  125. package/esm2015/core/shared/components/order-state-label/order-state-label.component.js +2 -1
  126. package/esm2015/core/shared/components/product-search-input/product-search-input.component.js +1 -1
  127. package/esm2015/core/shared/components/product-selector/product-selector.component.js +1 -1
  128. package/esm2015/core/shared/components/radio-card/radio-card-fieldset.component.js +57 -0
  129. package/esm2015/core/shared/components/radio-card/radio-card.component.js +54 -0
  130. package/esm2015/core/shared/components/rich-text-editor/external-image-dialog/external-image-dialog.component.js +2 -2
  131. package/esm2015/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.component.js +140 -0
  132. package/esm2015/core/shared/components/rich-text-editor/prosemirror/context-menu/context-menu.service.js +45 -0
  133. package/esm2015/core/shared/components/rich-text-editor/prosemirror/custom-nodes.js +60 -0
  134. package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/links.js +4 -4
  135. package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu-common.js +23 -1
  136. package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu-plugin.js +12 -0
  137. package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/menu.js +73 -18
  138. package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/sub-menu-with-icon.js +16 -0
  139. package/esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/image-plugin.js +100 -0
  140. package/esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/raw-editor-plugin.js +97 -0
  141. package/esm2015/core/shared/components/rich-text-editor/prosemirror/plugins/tables-plugin.js +166 -0
  142. package/esm2015/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.js +47 -17
  143. package/esm2015/core/shared/components/rich-text-editor/prosemirror/types.js +1 -1
  144. package/esm2015/core/shared/components/rich-text-editor/raw-html-dialog/raw-html-dialog.component.js +57 -0
  145. package/esm2015/core/shared/components/rich-text-editor/rich-text-editor.component.js +20 -9
  146. package/esm2015/core/shared/components/simple-dialog/simple-dialog.component.js +2 -2
  147. package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/base-code-editor-form-input.component.js +59 -0
  148. package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/html-editor-form-input.component.js +66 -0
  149. package/esm2015/core/shared/dynamic-form-inputs/code-editor-form-input/json-editor-form-input.component.js +47 -84
  150. package/esm2015/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.js +3 -3
  151. package/esm2015/core/shared/dynamic-form-inputs/register-dynamic-input-components.js +3 -1
  152. package/esm2015/core/shared/pipes/state-i18n-token.pipe.js +2 -1
  153. package/esm2015/core/shared/shared.module.js +13 -1
  154. package/esm2015/customer/components/customer-group-list/customer-group-list.component.js +2 -2
  155. package/esm2015/customer/components/customer-group-member-list/customer-group-member-list.component.js +6 -6
  156. package/esm2015/customer/components/customer-list/customer-list.component.js +2 -2
  157. package/esm2015/dashboard/dashboard.module.js +6 -2
  158. package/esm2015/order/components/coupon-code-selector/coupon-code-selector.component.js +42 -0
  159. package/esm2015/order/components/draft-order-detail/draft-order-detail.component.js +195 -0
  160. package/esm2015/order/components/draft-order-variant-selector/draft-order-variant-selector.component.js +59 -0
  161. package/esm2015/order/components/order-detail/order-detail.component.js +2 -2
  162. package/esm2015/order/components/order-editor/order-editor.component.js +5 -11
  163. package/esm2015/order/components/order-list/order-list.component.js +20 -4
  164. package/esm2015/order/components/order-table/order-table.component.js +16 -5
  165. package/esm2015/order/components/select-address-dialog/select-address-dialog.component.js +91 -0
  166. package/esm2015/order/components/select-address-dialog/select-address-dialog.graphql.js +14 -0
  167. package/esm2015/order/components/select-customer-dialog/select-customer-dialog.component.js +59 -0
  168. package/esm2015/order/components/select-shipping-method-dialog/select-shipping-method-dialog.component.js +30 -0
  169. package/esm2015/order/order.module.js +13 -1
  170. package/esm2015/order/order.routes.js +26 -7
  171. package/esm2015/order/providers/routing/order-resolver.js +29 -12
  172. package/esm2015/order/providers/routing/order.guard.js +41 -0
  173. package/esm2015/order/public_api.js +9 -1
  174. package/esm2015/settings/components/country-list/country-list.component.js +2 -2
  175. package/esm2015/settings/components/profile/profile.component.js +2 -2
  176. package/esm2015/settings/components/zone-list/zone-list.component.js +2 -2
  177. package/esm2015/settings/components/zone-member-list/zone-member-list.component.js +2 -2
  178. package/esm2015/system/components/health-check/health-check.component.js +1 -1
  179. package/fesm2015/vendure-admin-ui-catalog.js +835 -61
  180. package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
  181. package/fesm2015/vendure-admin-ui-core.js +3122 -1514
  182. package/fesm2015/vendure-admin-ui-core.js.map +1 -1
  183. package/fesm2015/vendure-admin-ui-customer.js +7 -7
  184. package/fesm2015/vendure-admin-ui-customer.js.map +1 -1
  185. package/fesm2015/vendure-admin-ui-dashboard.js +5 -1
  186. package/fesm2015/vendure-admin-ui-dashboard.js.map +1 -1
  187. package/fesm2015/vendure-admin-ui-order.js +780 -232
  188. package/fesm2015/vendure-admin-ui-order.js.map +1 -1
  189. package/fesm2015/vendure-admin-ui-settings.js +4 -4
  190. package/fesm2015/vendure-admin-ui-settings.js.map +1 -1
  191. package/fesm2015/vendure-admin-ui-system.js +1 -1
  192. package/order/components/coupon-code-selector/coupon-code-selector.component.d.ts +18 -0
  193. package/order/components/draft-order-detail/draft-order-detail.component.d.ts +49 -0
  194. package/order/components/draft-order-variant-selector/draft-order-variant-selector.component.d.ts +21 -0
  195. package/order/components/order-editor/order-editor.component.d.ts +1 -6
  196. package/order/components/order-list/order-list.component.d.ts +1 -0
  197. package/order/components/order-table/order-table.component.d.ts +11 -2
  198. package/order/components/select-address-dialog/select-address-dialog.component.d.ts +24 -0
  199. package/order/components/select-address-dialog/select-address-dialog.graphql.d.ts +1 -0
  200. package/order/components/select-customer-dialog/select-customer-dialog.component.d.ts +22 -0
  201. package/order/components/select-shipping-method-dialog/select-shipping-method-dialog.component.d.ts +16 -0
  202. package/order/providers/routing/order-resolver.d.ts +8 -5
  203. package/order/providers/routing/order.guard.d.ts +9 -0
  204. package/order/public_api.d.ts +8 -0
  205. package/order/vendure-admin-ui-order.metadata.json +1 -1
  206. package/package.json +13 -12
  207. package/settings/components/zone-member-list/zone-member-list.component.d.ts +3 -1
  208. package/settings/vendure-admin-ui-settings.metadata.json +1 -1
  209. package/static/i18n-messages/cs.json +33 -0
  210. package/static/i18n-messages/de.json +33 -0
  211. package/static/i18n-messages/en.json +36 -4
  212. package/static/i18n-messages/es.json +33 -0
  213. package/static/i18n-messages/fr.json +33 -0
  214. package/static/i18n-messages/it.json +33 -0
  215. package/static/i18n-messages/pl.json +33 -0
  216. package/static/i18n-messages/pt_BR.json +33 -0
  217. package/static/i18n-messages/pt_PT.json +33 -0
  218. package/static/i18n-messages/ru.json +33 -0
  219. package/static/i18n-messages/uk.json +33 -0
  220. package/static/i18n-messages/zh_Hans.json +33 -0
  221. package/static/i18n-messages/zh_Hant.json +33 -0
  222. package/static/styles/global/_forms.scss +4 -2
  223. package/static/styles/global/_overrides.scss +1 -1
  224. package/static/styles/global/_utilities.scss +4 -0
  225. package/static/theme.min.css +1 -1
  226. package/system/vendure-admin-ui-system.metadata.json +1 -1
  227. package/core/shared/components/rich-text-editor/prosemirror/menu/images.d.ts +0 -4
  228. package/esm2015/core/shared/components/rich-text-editor/prosemirror/menu/images.js +0 -36
@@ -0,0 +1,19 @@
1
+ import { ChangeDetectorRef, OnDestroy, OnInit, TemplateRef } from '@angular/core';
2
+ import { RadioCardFieldsetComponent } from './radio-card-fieldset.component';
3
+ export declare class RadioCardComponent<T = any> implements OnInit, OnDestroy {
4
+ private fieldset;
5
+ private changeDetector;
6
+ item: T;
7
+ itemTemplate: TemplateRef<T>;
8
+ constructor(fieldset: RadioCardFieldsetComponent, changeDetector: ChangeDetectorRef);
9
+ private idChange$;
10
+ private subscription;
11
+ name: string;
12
+ ngOnInit(): void;
13
+ ngOnDestroy(): void;
14
+ isSelected(item: T): boolean;
15
+ isFocussed(item: T): boolean;
16
+ selectChanged(item: T): void;
17
+ setFocussedId(item: T | undefined): void;
18
+ getItemId(item: T): string;
19
+ }
@@ -0,0 +1,28 @@
1
+ import { Overlay } from '@angular/cdk/overlay';
2
+ import { AfterViewInit, OnDestroy, ViewContainerRef } from '@angular/core';
3
+ import { Observable } from 'rxjs';
4
+ import { ContextMenuConfig, ContextMenuItem, ContextMenuService } from './context-menu.service';
5
+ export declare class ContextMenuComponent implements AfterViewInit, OnDestroy {
6
+ private overlay;
7
+ private viewContainerRef;
8
+ contextMenuService: ContextMenuService;
9
+ editorMenuElement: HTMLElement | null | undefined;
10
+ private menuTemplate;
11
+ menuConfig: ContextMenuConfig | undefined;
12
+ hideTrigger$: Observable<boolean>;
13
+ private triggerIsHidden;
14
+ private menuPortal;
15
+ private overlayRef;
16
+ private contextMenuSub;
17
+ private contentArea;
18
+ private hideTriggerHandler;
19
+ constructor(overlay: Overlay, viewContainerRef: ViewContainerRef, contextMenuService: ContextMenuService);
20
+ onScroll: () => void;
21
+ ngAfterViewInit(): void;
22
+ triggerClick(): void;
23
+ ngOnDestroy(): void;
24
+ clickItem(item: ContextMenuItem): void;
25
+ private getPositionStrategy;
26
+ /** Inverts an overlay position. */
27
+ private invertPosition;
28
+ }
@@ -0,0 +1,31 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface ContextMenuConfig {
3
+ ref: any;
4
+ iconShape?: string;
5
+ title: string;
6
+ element: Element;
7
+ coords: {
8
+ left: number;
9
+ right: number;
10
+ top: number;
11
+ bottom: number;
12
+ };
13
+ items: ContextMenuItem[];
14
+ }
15
+ export interface ContextMenuItem {
16
+ separator?: boolean;
17
+ iconClass?: string;
18
+ iconShape?: string;
19
+ label: string;
20
+ enabled: boolean;
21
+ onClick: () => void;
22
+ }
23
+ export declare class ContextMenuService {
24
+ contextMenu$: Observable<ContextMenuConfig | undefined>;
25
+ private menuIsVisible$;
26
+ private setContextMenuConfig$;
27
+ constructor();
28
+ setVisibility(isVisible: boolean): void;
29
+ setContextMenu(config: ContextMenuConfig): void;
30
+ clearContextMenu(): void;
31
+ }
@@ -0,0 +1,4 @@
1
+ import { NodeSpec } from 'prosemirror-model';
2
+ import { NodeViewConstructor } from 'prosemirror-view';
3
+ export declare const iframeNode: NodeSpec;
4
+ export declare const iframeNodeView: NodeViewConstructor;
@@ -1,8 +1,8 @@
1
1
  import { Schema } from 'prosemirror-model';
2
2
  import { Plugin } from 'prosemirror-state';
3
- export declare function blockQuoteRule(nodeType: any): any;
4
- export declare function orderedListRule(nodeType: any): any;
5
- export declare function bulletListRule(nodeType: any): any;
6
- export declare function codeBlockRule(nodeType: any): any;
7
- export declare function headingRule(nodeType: any, maxLevel: any): any;
3
+ export declare function blockQuoteRule(nodeType: any): import("prosemirror-inputrules").InputRule;
4
+ export declare function orderedListRule(nodeType: any): import("prosemirror-inputrules").InputRule;
5
+ export declare function bulletListRule(nodeType: any): import("prosemirror-inputrules").InputRule;
6
+ export declare function codeBlockRule(nodeType: any): import("prosemirror-inputrules").InputRule;
7
+ export declare function headingRule(nodeType: any, maxLevel: any): import("prosemirror-inputrules").InputRule;
8
8
  export declare function buildInputRules(schema: Schema): Plugin;
@@ -1,4 +1,4 @@
1
1
  import { MenuItem } from 'prosemirror-menu';
2
2
  import { MarkType } from 'prosemirror-model';
3
3
  import { ModalService } from '../../../../../providers/modal/modal.service';
4
- export declare function linkItem(linkMark: MarkType, modalService: ModalService): MenuItem<any>;
4
+ export declare function linkItem(linkMark: MarkType, modalService: ModalService): MenuItem;
@@ -1,4 +1,16 @@
1
1
  import { NodeType } from 'prosemirror-model';
2
2
  import { EditorState } from 'prosemirror-state';
3
+ import { EditorView } from 'prosemirror-view';
3
4
  export declare function markActive(state: any, type: any): any;
4
5
  export declare function canInsert(state: EditorState, nodeType: NodeType): boolean;
6
+ export interface ClarityIconOptions {
7
+ shape: string;
8
+ size?: number;
9
+ label?: string;
10
+ }
11
+ export declare function renderClarityIcon(options: ClarityIconOptions): (view: EditorView) => HTMLElement;
12
+ export declare function wrapInMenuItemWithIcon(...elements: Array<HTMLElement | undefined | null>): HTMLSpanElement;
13
+ export declare const IconSize: {
14
+ Large: number;
15
+ Small: number;
16
+ };
@@ -0,0 +1,9 @@
1
+ import { Injector } from '@angular/core';
2
+ import { Schema } from 'prosemirror-model';
3
+ import { Plugin } from 'prosemirror-state';
4
+ export interface CustomMenuPluginOptions {
5
+ floatingMenu?: boolean;
6
+ schema: Schema;
7
+ injector: Injector;
8
+ }
9
+ export declare function customMenuPlugin(options: CustomMenuPluginOptions): Plugin<any>;
@@ -0,0 +1,14 @@
1
+ import { DropdownSubmenu, MenuElement } from 'prosemirror-menu';
2
+ import { EditorState } from 'prosemirror-state';
3
+ import { EditorView } from 'prosemirror-view';
4
+ export declare class SubMenuWithIcon extends DropdownSubmenu {
5
+ private icon;
6
+ constructor(content: readonly MenuElement[] | MenuElement, options: {
7
+ label?: string;
8
+ icon: () => HTMLElement;
9
+ });
10
+ render(view: EditorView): {
11
+ dom: HTMLElement;
12
+ update: (state: EditorState) => boolean;
13
+ };
14
+ }
@@ -0,0 +1,7 @@
1
+ import { MenuItem } from 'prosemirror-menu';
2
+ import { NodeType } from 'prosemirror-model';
3
+ import { Plugin } from 'prosemirror-state';
4
+ import { ModalService } from '../../../../../providers/modal/modal.service';
5
+ import { ContextMenuService } from '../context-menu/context-menu.service';
6
+ export declare function insertImageItem(nodeType: NodeType, modalService: ModalService): MenuItem;
7
+ export declare const imageContextMenuPlugin: (contextMenuService: ContextMenuService, modalService: ModalService) => Plugin<any>;
@@ -2,4 +2,4 @@ import { Plugin } from 'prosemirror-state';
2
2
  /**
3
3
  * Causes the entire link to be selected when clicked.
4
4
  */
5
- export declare const linkSelectPlugin: Plugin<any, any>;
5
+ export declare const linkSelectPlugin: Plugin<any>;
@@ -0,0 +1,7 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { ModalService } from '../../../../../providers/modal/modal.service';
3
+ import { ContextMenuService } from '../context-menu/context-menu.service';
4
+ /**
5
+ * Implements editing of raw HTML for the selected node in the editor.
6
+ */
7
+ export declare const rawEditorPlugin: (contextMenuService: ContextMenuService, modalService: ModalService) => Plugin<any>;
@@ -0,0 +1,13 @@
1
+ import { MenuElement } from 'prosemirror-menu';
2
+ import { Schema } from 'prosemirror-model';
3
+ import { Plugin } from 'prosemirror-state';
4
+ import { ContextMenuService } from '../context-menu/context-menu.service';
5
+ export declare const tableContextMenuPlugin: (contextMenuService: ContextMenuService) => Plugin<any>;
6
+ export declare function getTableNodes(): import("prosemirror-tables").TableNodes;
7
+ export declare function getTableMenu(schema: Schema): MenuElement[];
8
+ export declare function addTable(state: any, dispatch: any, { rowsCount, colsCount, withHeaderRow, cellContent }: {
9
+ rowsCount: any;
10
+ colsCount: any;
11
+ withHeaderRow: any;
12
+ cellContent: any;
13
+ }): void;
@@ -1,16 +1,20 @@
1
+ import { Injector } from '@angular/core';
1
2
  import { EditorView } from 'prosemirror-view';
2
- import { ModalService } from '../../../../providers/modal/modal.service';
3
+ import { Observable } from 'rxjs';
4
+ import { ContextMenuService } from './context-menu/context-menu.service';
3
5
  export interface CreateEditorViewOptions {
4
6
  onTextInput: (content: string) => void;
5
7
  element: HTMLElement;
6
8
  isReadOnly: () => boolean;
7
9
  }
8
10
  export declare class ProsemirrorService {
9
- private modalService;
11
+ private injector;
12
+ private contextMenuService;
10
13
  editorView: EditorView;
11
14
  private mySchema;
12
15
  private enabled;
13
- constructor(modalService: ModalService);
16
+ constructor(injector: Injector, contextMenuService: ContextMenuService);
17
+ contextMenuItems$: Observable<string>;
14
18
  createEditorView(options: CreateEditorViewOptions): void;
15
19
  update(text: string): void;
16
20
  destroy(): void;
@@ -1,4 +1,3 @@
1
- import { MenuItem } from 'prosemirror-menu';
2
1
  import { Schema } from 'prosemirror-model';
3
2
  export interface SetupOptions {
4
3
  schema: Schema;
@@ -6,6 +5,5 @@ export interface SetupOptions {
6
5
  menuBar?: boolean;
7
6
  history?: boolean;
8
7
  floatingMenu?: boolean;
9
- menuContent?: MenuItem[][];
10
8
  }
11
9
  export declare type Keymap = Record<string, string | false>;
@@ -0,0 +1,18 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
3
+ import { ConfigArgDefinition } from '../../../../common/generated-types';
4
+ import { Dialog } from '../../../../providers/modal/modal.service';
5
+ export declare class RawHtmlDialogComponent implements OnInit, Dialog<string> {
6
+ html: string;
7
+ formControl: FormControl;
8
+ config: ConfigArgDefinition;
9
+ resolveWith: (html: string | undefined) => void;
10
+ ngOnInit(): void;
11
+ process(str: string): string;
12
+ /**
13
+ * Taken from https://stackoverflow.com/a/26361620/772859
14
+ */
15
+ format(node: Element, level?: number): Element;
16
+ cancel(): void;
17
+ select(): void;
18
+ }
@@ -1,5 +1,6 @@
1
- import { AfterViewInit, ChangeDetectorRef, OnDestroy } from '@angular/core';
1
+ import { AfterViewInit, ChangeDetectorRef, OnDestroy, ViewContainerRef } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
+ import { ContextMenuService } from './prosemirror/context-menu/context-menu.service';
3
4
  import { ProsemirrorService } from './prosemirror/prosemirror.service';
4
5
  /**
5
6
  * @description
@@ -18,6 +19,8 @@ import { ProsemirrorService } from './prosemirror/prosemirror.service';
18
19
  export declare class RichTextEditorComponent implements ControlValueAccessor, AfterViewInit, OnDestroy {
19
20
  private changeDetector;
20
21
  private prosemirrorService;
22
+ private viewContainerRef;
23
+ contextMenuService: ContextMenuService;
21
24
  label: string;
22
25
  set readonly(value: any);
23
26
  _readonly: boolean;
@@ -25,7 +28,8 @@ export declare class RichTextEditorComponent implements ControlValueAccessor, Af
25
28
  onTouch: () => void;
26
29
  private value;
27
30
  private editorEl;
28
- constructor(changeDetector: ChangeDetectorRef, prosemirrorService: ProsemirrorService);
31
+ constructor(changeDetector: ChangeDetectorRef, prosemirrorService: ProsemirrorService, viewContainerRef: ViewContainerRef, contextMenuService: ContextMenuService);
32
+ get menuElement(): HTMLDivElement | null;
29
33
  ngAfterViewInit(): void;
30
34
  ngOnDestroy(): void;
31
35
  registerOnChange(fn: any): void;
@@ -0,0 +1,27 @@
1
+ import { AfterViewInit, ChangeDetectorRef } from '@angular/core';
2
+ import { FormControl, ValidatorFn } from '@angular/forms';
3
+ import { DefaultFormComponentConfig } from '@vendure/common/lib/shared-types';
4
+ import { CodeJar } from 'codejar';
5
+ import { FormInputComponent } from '../../../common/component-registry-types';
6
+ export interface CodeEditorConfig {
7
+ validator: ValidatorFn;
8
+ getErrorMessage: (content: string) => string | undefined;
9
+ highlight: (content: string, errorPos: number | undefined) => string;
10
+ }
11
+ export declare abstract class BaseCodeEditorFormInputComponent implements FormInputComponent, AfterViewInit {
12
+ protected changeDetector: ChangeDetectorRef;
13
+ readonly: boolean;
14
+ formControl: FormControl;
15
+ config: DefaultFormComponentConfig<'json-editor-form-input'>;
16
+ isValid: boolean;
17
+ errorMessage: string | undefined;
18
+ private editorElementRef;
19
+ jar: CodeJar;
20
+ private highlight;
21
+ private getErrorMessage;
22
+ protected constructor(changeDetector: ChangeDetectorRef);
23
+ get height(): string | undefined;
24
+ configure(config: CodeEditorConfig): void;
25
+ ngAfterViewInit(): void;
26
+ protected getErrorPos(errorMessage: string | undefined): number | undefined;
27
+ }
@@ -0,0 +1,19 @@
1
+ import { AfterViewInit, ChangeDetectorRef, OnInit } from '@angular/core';
2
+ import { DefaultFormComponentId } from '@vendure/common/lib/shared-types';
3
+ import { FormInputComponent } from '../../../common/component-registry-types';
4
+ import { BaseCodeEditorFormInputComponent } from './base-code-editor-form-input.component';
5
+ /**
6
+ * @description
7
+ * A JSON editor input with syntax highlighting and error detection. Works well
8
+ * with `text` type fields.
9
+ *
10
+ * @docsCategory custom-input-components
11
+ * @docsPage default-inputs
12
+ */
13
+ export declare class HtmlEditorFormInputComponent extends BaseCodeEditorFormInputComponent implements FormInputComponent, AfterViewInit, OnInit {
14
+ protected changeDetector: ChangeDetectorRef;
15
+ static readonly id: DefaultFormComponentId;
16
+ constructor(changeDetector: ChangeDetectorRef);
17
+ ngOnInit(): void;
18
+ private encodeHtmlChars;
19
+ }
@@ -1,8 +1,8 @@
1
1
  import { AfterViewInit, ChangeDetectorRef, OnInit } from '@angular/core';
2
- import { FormControl, ValidatorFn } from '@angular/forms';
3
- import { DefaultFormComponentConfig, DefaultFormComponentId } from '@vendure/common/lib/shared-types';
4
- import { CodeJar } from 'codejar';
2
+ import { ValidatorFn } from '@angular/forms';
3
+ import { DefaultFormComponentId } from '@vendure/common/lib/shared-types';
5
4
  import { FormInputComponent } from '../../../common/component-registry-types';
5
+ import { BaseCodeEditorFormInputComponent } from './base-code-editor-form-input.component';
6
6
  export declare function jsonValidator(): ValidatorFn;
7
7
  /**
8
8
  * @description
@@ -12,21 +12,9 @@ export declare function jsonValidator(): ValidatorFn;
12
12
  * @docsCategory custom-input-components
13
13
  * @docsPage default-inputs
14
14
  */
15
- export declare class JsonEditorFormInputComponent implements FormInputComponent, AfterViewInit, OnInit {
16
- private changeDetector;
15
+ export declare class JsonEditorFormInputComponent extends BaseCodeEditorFormInputComponent implements FormInputComponent, AfterViewInit, OnInit {
16
+ protected changeDetector: ChangeDetectorRef;
17
17
  static readonly id: DefaultFormComponentId;
18
- readonly: boolean;
19
- formControl: FormControl;
20
- config: DefaultFormComponentConfig<'json-editor-form-input'>;
21
- isValid: boolean;
22
- errorMessage: string | undefined;
23
- private editorElementRef;
24
- jar: CodeJar;
25
18
  constructor(changeDetector: ChangeDetectorRef);
26
- get height(): string | undefined;
27
19
  ngOnInit(): void;
28
- ngAfterViewInit(): void;
29
- private getJsonError;
30
- private getErrorPos;
31
- private syntaxHighlight;
32
20
  }
@@ -1,6 +1,7 @@
1
1
  import { FactoryProvider, Type } from '@angular/core';
2
2
  import { FormInputComponent } from '../../common/component-registry-types';
3
3
  import { CustomFieldControl, CustomFieldEntityName } from '../../providers/custom-field-component/custom-field-component.service';
4
+ import { HtmlEditorFormInputComponent } from './code-editor-form-input/html-editor-form-input.component';
4
5
  import { JsonEditorFormInputComponent } from './code-editor-form-input/json-editor-form-input.component';
5
6
  import { CombinationModeFormInputComponent } from './combination-mode-form-input/combination-mode-form-input.component';
6
7
  import { CurrencyFormInputComponent } from './currency-form-input/currency-form-input.component';
@@ -10,7 +11,7 @@ import { PasswordFormInputComponent } from './password-form-input/password-form-
10
11
  import { ProductMultiSelectorFormInputComponent } from './product-multi-selector-form-input/product-multi-selector-form-input.component';
11
12
  import { ProductSelectorFormInputComponent } from './product-selector-form-input/product-selector-form-input.component';
12
13
  import { SelectFormInputComponent } from './select-form-input/select-form-input.component';
13
- export declare const defaultFormInputs: (typeof ProductSelectorFormInputComponent | typeof CustomerGroupFormInputComponent | typeof PasswordFormInputComponent | typeof CurrencyFormInputComponent | typeof SelectFormInputComponent | typeof FacetValueFormInputComponent | typeof JsonEditorFormInputComponent | typeof ProductMultiSelectorFormInputComponent | typeof CombinationModeFormInputComponent)[];
14
+ export declare const defaultFormInputs: (typeof HtmlEditorFormInputComponent | typeof ProductSelectorFormInputComponent | typeof CustomerGroupFormInputComponent | typeof PasswordFormInputComponent | typeof CurrencyFormInputComponent | typeof SelectFormInputComponent | typeof FacetValueFormInputComponent | typeof JsonEditorFormInputComponent | typeof ProductMultiSelectorFormInputComponent | typeof CombinationModeFormInputComponent)[];
14
15
  /**
15
16
  * @description
16
17
  * Registers a custom FormInputComponent which can be used to control the argument inputs