@jumoo/processing 17.4.2

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 (121) hide show
  1. package/dist/api/client/client.gen.d.ts +2 -0
  2. package/dist/api/client/client.gen.js +235 -0
  3. package/dist/api/client/index.d.ts +8 -0
  4. package/dist/api/client/index.js +6 -0
  5. package/dist/api/client/types.gen.d.ts +117 -0
  6. package/dist/api/client/types.gen.js +2 -0
  7. package/dist/api/client/utils.gen.d.ts +33 -0
  8. package/dist/api/client/utils.gen.js +230 -0
  9. package/dist/api/client.gen.d.ts +12 -0
  10. package/dist/api/client.gen.js +4 -0
  11. package/dist/api/core/auth.gen.d.ts +18 -0
  12. package/dist/api/core/auth.gen.js +14 -0
  13. package/dist/api/core/bodySerializer.gen.d.ts +25 -0
  14. package/dist/api/core/bodySerializer.gen.js +57 -0
  15. package/dist/api/core/params.gen.d.ts +43 -0
  16. package/dist/api/core/params.gen.js +100 -0
  17. package/dist/api/core/pathSerializer.gen.d.ts +33 -0
  18. package/dist/api/core/pathSerializer.gen.js +106 -0
  19. package/dist/api/core/queryKeySerializer.gen.d.ts +18 -0
  20. package/dist/api/core/queryKeySerializer.gen.js +92 -0
  21. package/dist/api/core/serverSentEvents.gen.d.ts +71 -0
  22. package/dist/api/core/serverSentEvents.gen.js +133 -0
  23. package/dist/api/core/types.gen.d.ts +78 -0
  24. package/dist/api/core/types.gen.js +2 -0
  25. package/dist/api/core/utils.gen.d.ts +19 -0
  26. package/dist/api/core/utils.gen.js +87 -0
  27. package/dist/api/index.d.ts +3 -0
  28. package/dist/api/index.js +4 -0
  29. package/dist/api/sdk.gen.d.ts +39 -0
  30. package/dist/api/sdk.gen.js +118 -0
  31. package/dist/api/types.gen.d.ts +547 -0
  32. package/dist/api/types.gen.js +18 -0
  33. package/dist/constants.d.ts +1 -0
  34. package/dist/constants.js +8 -0
  35. package/dist/exports.d.ts +6 -0
  36. package/dist/exports.js +6 -0
  37. package/dist/external/signalr/index.d.ts +4 -0
  38. package/dist/external/signalr/index.js +4 -0
  39. package/dist/hey-api.d.ts +11 -0
  40. package/dist/hey-api.js +14 -0
  41. package/dist/index.d.ts +8 -0
  42. package/dist/index.js +12 -0
  43. package/dist/lang/files/en.d.ts +22 -0
  44. package/dist/lang/files/en.js +21 -0
  45. package/dist/lang/manifest.d.ts +1 -0
  46. package/dist/lang/manifest.js +11 -0
  47. package/dist/pipeline/components/background.element.d.ts +23 -0
  48. package/dist/pipeline/components/background.element.js +88 -0
  49. package/dist/pipeline/components/index.d.ts +6 -0
  50. package/dist/pipeline/components/index.js +6 -0
  51. package/dist/pipeline/components/pipeline-list.element.d.ts +32 -0
  52. package/dist/pipeline/components/pipeline-list.element.js +178 -0
  53. package/dist/pipeline/components/pipeline-table.element.d.ts +19 -0
  54. package/dist/pipeline/components/pipeline-table.element.js +149 -0
  55. package/dist/pipeline/components/process-error.element.d.ts +16 -0
  56. package/dist/pipeline/components/process-error.element.js +93 -0
  57. package/dist/pipeline/components/progress.element.d.ts +14 -0
  58. package/dist/pipeline/components/progress.element.js +177 -0
  59. package/dist/pipeline/components/progress.step.element.d.ts +15 -0
  60. package/dist/pipeline/components/progress.step.element.js +48 -0
  61. package/dist/pipeline/index.d.ts +8 -0
  62. package/dist/pipeline/index.js +8 -0
  63. package/dist/pipeline/modal/errors/error-modal.element.d.ts +13 -0
  64. package/dist/pipeline/modal/errors/error-modal.element.js +129 -0
  65. package/dist/pipeline/modal/errors/error-modal.token.d.ts +10 -0
  66. package/dist/pipeline/modal/errors/error-modal.token.js +8 -0
  67. package/dist/pipeline/modal/errors/index.d.ts +1 -0
  68. package/dist/pipeline/modal/errors/index.js +2 -0
  69. package/dist/pipeline/modal/errors/manifest.d.ts +1 -0
  70. package/dist/pipeline/modal/errors/manifest.js +7 -0
  71. package/dist/pipeline/modal/index.d.ts +2 -0
  72. package/dist/pipeline/modal/index.js +3 -0
  73. package/dist/pipeline/modal/manifest.d.ts +1 -0
  74. package/dist/pipeline/modal/manifest.js +8 -0
  75. package/dist/pipeline/modal/pipeline-modal.element.d.ts +20 -0
  76. package/dist/pipeline/modal/pipeline-modal.element.js +151 -0
  77. package/dist/pipeline/modal/pipeline-modal.token.d.ts +39 -0
  78. package/dist/pipeline/modal/pipeline-modal.token.js +38 -0
  79. package/dist/pipeline/pipeline.context.d.ts +53 -0
  80. package/dist/pipeline/pipeline.context.js +260 -0
  81. package/dist/pipeline/pipeline.element.d.ts +74 -0
  82. package/dist/pipeline/pipeline.element.js +260 -0
  83. package/dist/pipeline/pipeline.repository.d.ts +20 -0
  84. package/dist/pipeline/pipeline.repository.js +41 -0
  85. package/dist/pipeline/pipeline.source.d.ts +76 -0
  86. package/dist/pipeline/pipeline.source.js +79 -0
  87. package/dist/pipeline/pipelines.context.d.ts +12 -0
  88. package/dist/pipeline/pipelines.context.js +33 -0
  89. package/dist/pipeline/steps/index.d.ts +2 -0
  90. package/dist/pipeline/steps/index.js +2 -0
  91. package/dist/pipeline/steps/interfaces.d.ts +10 -0
  92. package/dist/pipeline/steps/interfaces.js +1 -0
  93. package/dist/pipeline/steps/models.d.ts +14 -0
  94. package/dist/pipeline/steps/models.js +24 -0
  95. package/dist/pipeline/workspace/manifest.d.ts +1 -0
  96. package/dist/pipeline/workspace/manifest.js +33 -0
  97. package/dist/pipeline/workspace/pipeline-workspace.context.d.ts +17 -0
  98. package/dist/pipeline/workspace/pipeline-workspace.context.js +58 -0
  99. package/dist/pipeline/workspace/pipeline-workspace.element.d.ts +6 -0
  100. package/dist/pipeline/workspace/pipeline-workspace.element.js +21 -0
  101. package/dist/pipeline/workspace/types.d.ts +6 -0
  102. package/dist/pipeline/workspace/types.js +10 -0
  103. package/dist/pipeline/workspace/views/default-pipeline-view.d.ts +20 -0
  104. package/dist/pipeline/workspace/views/default-pipeline-view.js +140 -0
  105. package/dist/queue/components/queue-list.element.d.ts +21 -0
  106. package/dist/queue/components/queue-list.element.js +72 -0
  107. package/dist/queue/components/queue-table.element.d.ts +24 -0
  108. package/dist/queue/components/queue-table.element.js +156 -0
  109. package/dist/queue/index.d.ts +3 -0
  110. package/dist/queue/index.js +3 -0
  111. package/dist/queue/queue.context.d.ts +13 -0
  112. package/dist/queue/queue.context.js +37 -0
  113. package/dist/queue/queue.repository.d.ts +10 -0
  114. package/dist/queue/queue.repository.js +32 -0
  115. package/dist/signalr/index.d.ts +2 -0
  116. package/dist/signalr/index.js +2 -0
  117. package/dist/signalr/signalr.context.d.ts +24 -0
  118. package/dist/signalr/signalr.context.js +99 -0
  119. package/dist/signalr/types.d.ts +12 -0
  120. package/dist/signalr/types.js +1 -0
  121. package/package.json +51 -0
@@ -0,0 +1,177 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, customElement, html, nothing, property, when, } from '@umbraco-cms/backoffice/external/lit';
8
+ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
9
+ import { StepStatus } from '@jumoo/processing';
10
+ let JumooPipelineProgressElement = class JumooPipelineProgressElement extends UmbLitElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.showPercentage = false;
14
+ this._lastKnownProgress = 0;
15
+ }
16
+ render() {
17
+ if (!this.progress)
18
+ return nothing;
19
+ const steps = this.progress.steps.map((step) => {
20
+ const className = step.status === StepStatus.COMPLETE
21
+ ? 'complete'
22
+ : step.status === StepStatus.RUNNING
23
+ ? 'running'
24
+ : 'pending';
25
+ const icon = step.icon ?? 'icon-checkmark';
26
+ return html `
27
+ <div class="step ${className}">
28
+ <uui-icon .name=${icon}></uui-icon>
29
+ <div class="step-name">${step.name}</div>
30
+ </div>
31
+ `;
32
+ });
33
+ return html `<div class="step-progress">
34
+ <div class="steps">${steps}</div>
35
+ ${this.renderMessages()}
36
+ </div>`;
37
+ }
38
+ getLastKnownProgress() {
39
+ if (this.message?.progress === undefined)
40
+ return this._lastKnownProgress;
41
+ return this.message.progress < 100 ? this.message.progress : this._lastKnownProgress;
42
+ }
43
+ renderMessages() {
44
+ this._lastKnownProgress = this.getLastKnownProgress();
45
+ console.debug('Current progress:', this._lastKnownProgress, this.message?.progress);
46
+ return html `<div class="message">
47
+ <div class="content">
48
+ <div>
49
+ <h3>${this.message?.title}</h3>
50
+ </div>
51
+ <div>
52
+ <small>${this.message?.message}</small>
53
+ </div>
54
+ </div>
55
+ <div class="progress">
56
+ <uui-progress-bar .progress=${this._lastKnownProgress}></uui-progress-bar>
57
+ ${when(this.showPercentage, () => html `<div>${this._lastKnownProgress.toFixed(2)}%</div>`)}
58
+ </div>
59
+ </div>`;
60
+ }
61
+ };
62
+ JumooPipelineProgressElement.styles = css `
63
+ :host {
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ flex-direction: column;
68
+ height: 100%;
69
+ }
70
+
71
+ .message {
72
+ display: grid;
73
+ grid-template-rows: 1fr 1fr;
74
+ align-items: center;
75
+ height: 8rem;
76
+ width: 100%;
77
+ margin: var(--uui-size-space-3) 0;
78
+ }
79
+
80
+ .content {
81
+ display: flex;
82
+ flex-direction: column;
83
+ align-items: center;
84
+ }
85
+
86
+ .content h3 {
87
+ margin: 0;
88
+ padding-bottom: var(--uui-size-space-2);
89
+ }
90
+
91
+ .progress {
92
+ width: 100%;
93
+ display: flex;
94
+ flex-direction: column;
95
+ align-items: center;
96
+ }
97
+
98
+ .percentage {
99
+ font-size: small;
100
+ }
101
+
102
+ uui-progress-bar {
103
+ height: var(--uui-size-space-4);
104
+ margin: 0;
105
+ padding: 0;
106
+ border-radius: var(--uui-border-radius);
107
+ background-color: var(--uui-color-border);
108
+ }
109
+
110
+ .step-progress {
111
+ width: 100%;
112
+ display: flex;
113
+ flex-direction: column;
114
+ align-items: center;
115
+ }
116
+
117
+ .steps {
118
+ display: flex;
119
+ flex-direction: row;
120
+ flex-flow: row wrap;
121
+ justify-content: center;
122
+ width: 100%;
123
+ margin-bottom: var(--uui-size-space-3);
124
+ gap: var(--uui-size-space-2);
125
+ }
126
+
127
+ .step {
128
+ display: flex;
129
+ flex-grow: 1;
130
+ margin: 0 var(--uui-size-space-5);
131
+ padding: var(--uui-size-space-2);
132
+ max-width: var(--uui-size-layout-5);
133
+ flex-direction: column;
134
+ align-items: center;
135
+ align-content: center;
136
+ transition: background-color 0.3s ease;
137
+ }
138
+
139
+ .step uui-icon {
140
+ font-size: 30pt;
141
+ margin: var(--uui-size-space-2) 0;
142
+ }
143
+
144
+ .step-name {
145
+ text-align: center;
146
+ font-weight: 900;
147
+ }
148
+
149
+ .step.complete uui-icon {
150
+ color: green;
151
+ }
152
+ .step.running uui-icon {
153
+ color: blue;
154
+ }
155
+ .step.pending uui-icon {
156
+ color: gray;
157
+ }
158
+
159
+ .step.running {
160
+ border-radius: var(--uui-size-4);
161
+ background-color: var(--uui-color-disabled-standalone);
162
+ }
163
+ `;
164
+ __decorate([
165
+ property({ type: Object })
166
+ ], JumooPipelineProgressElement.prototype, "progress", void 0);
167
+ __decorate([
168
+ property({ type: Object })
169
+ ], JumooPipelineProgressElement.prototype, "message", void 0);
170
+ __decorate([
171
+ property({ type: Boolean })
172
+ ], JumooPipelineProgressElement.prototype, "showPercentage", void 0);
173
+ JumooPipelineProgressElement = __decorate([
174
+ customElement('jumoo-pipeline-progress')
175
+ ], JumooPipelineProgressElement);
176
+ export { JumooPipelineProgressElement };
177
+ export default JumooPipelineProgressElement;
@@ -0,0 +1,15 @@
1
+ import { LitElement, nothing } from '@umbraco-cms/backoffice/external/lit';
2
+ import { PipelineState, ProcessingOptions, ProcessingResults } from '@jumoo/processing';
3
+ declare const JumooProcessStepElement_base: import("@umbraco-cms/backoffice/extension-api").HTMLElementConstructor<import("@umbraco-cms/backoffice/element-api").UmbElement> & typeof LitElement;
4
+ /**
5
+ * renders the step in the pipeline, from the custom elements.
6
+ */
7
+ export declare class JumooProcessStepElement extends JumooProcessStepElement_base {
8
+ pipelineId: string | null | undefined;
9
+ state?: PipelineState | null | undefined;
10
+ options?: ProcessingOptions | null | undefined;
11
+ resutls?: ProcessingResults | null | undefined;
12
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
13
+ private renderStepElement;
14
+ }
15
+ export default JumooProcessStepElement;
@@ -0,0 +1,48 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
8
+ import { customElement, html, LitElement, nothing, property, } from '@umbraco-cms/backoffice/external/lit';
9
+ /**
10
+ * renders the step in the pipeline, from the custom elements.
11
+ */
12
+ let JumooProcessStepElement = class JumooProcessStepElement extends UmbElementMixin(LitElement) {
13
+ render() {
14
+ return this.state?.currentRequest?.action?.element === null
15
+ ? nothing
16
+ : this.renderStepElement();
17
+ }
18
+ renderStepElement() {
19
+ return html `
20
+ <umb-extension-slot
21
+ type="jumoo-process-step"
22
+ .filter=${(ext) => ext.elementName === this.state?.elementName}
23
+ .props=${{
24
+ pipelineId: this.pipelineId,
25
+ state: this.state,
26
+ options: this.options,
27
+ resutls: this.resutls,
28
+ }}></umb-extension-slot>
29
+ `;
30
+ }
31
+ };
32
+ __decorate([
33
+ property({ type: String })
34
+ ], JumooProcessStepElement.prototype, "pipelineId", void 0);
35
+ __decorate([
36
+ property({ type: Object })
37
+ ], JumooProcessStepElement.prototype, "state", void 0);
38
+ __decorate([
39
+ property({ type: Object })
40
+ ], JumooProcessStepElement.prototype, "options", void 0);
41
+ __decorate([
42
+ property({ type: Object })
43
+ ], JumooProcessStepElement.prototype, "resutls", void 0);
44
+ JumooProcessStepElement = __decorate([
45
+ customElement('jumoo-process-step')
46
+ ], JumooProcessStepElement);
47
+ export { JumooProcessStepElement };
48
+ export default JumooProcessStepElement;
@@ -0,0 +1,8 @@
1
+ export * from './steps/index.js';
2
+ export * from './components/index.js';
3
+ export * from './modal/index.js';
4
+ export * from './pipeline.element.js';
5
+ export * from './pipeline.context.js';
6
+ export * from './pipeline.repository.js';
7
+ export * from './pipeline.source.js';
8
+ export * from './pipelines.context.js';
@@ -0,0 +1,8 @@
1
+ export * from './steps/index.js';
2
+ export * from './components/index.js';
3
+ export * from './modal/index.js';
4
+ export * from './pipeline.element.js';
5
+ export * from './pipeline.context.js';
6
+ export * from './pipeline.repository.js';
7
+ export * from './pipeline.source.js';
8
+ export * from './pipelines.context.js';
@@ -0,0 +1,13 @@
1
+ import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
2
+ import { JumooProcessingErrorModalData, JumooProcessingErrorModalResult } from '@jumoo/processing';
3
+ export declare class JumooProcessingErrorModal extends UmbModalBaseElement<JumooProcessingErrorModalData, JumooProcessingErrorModalResult> {
4
+ #private;
5
+ render(): import("lit-html").TemplateResult<1>;
6
+ static styles: import("lit").CSSResult;
7
+ }
8
+ export default JumooProcessingErrorModal;
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'jumoo-processing-error-modal': JumooProcessingErrorModal;
12
+ }
13
+ }
@@ -0,0 +1,129 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _JumooProcessingErrorModal_instances, _JumooProcessingErrorModal_onClose, _JumooProcessingErrorModal_truncate;
13
+ import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
14
+ import { JUMOO_PROCESSING_ERROR_MODAL_ALIAS, } from '@jumoo/processing';
15
+ import { css, customElement, html, when } from '@umbraco-cms/backoffice/external/lit';
16
+ let JumooProcessingErrorModal = class JumooProcessingErrorModal extends UmbModalBaseElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ _JumooProcessingErrorModal_instances.add(this);
20
+ }
21
+ render() {
22
+ const headline = __classPrivateFieldGet(this, _JumooProcessingErrorModal_instances, "m", _JumooProcessingErrorModal_truncate).call(this, 'Error: ' + this.data?.error.message, 75);
23
+ return html `<umb-body-layout .headline=${headline}>
24
+ <uui-box .headline=${this.localize.term('jumooProcError_headline')}>
25
+ <h2>${this.data?.error.message}</h2>
26
+ <div class="more-box">
27
+ <div class="more">
28
+ <div class="label">
29
+ <umb-localize key="jumooProcError_source"></umb-localize>
30
+ </div>
31
+ <div class="detail">
32
+ ${this.data?.error.strategy} / ${this.data?.error.source}
33
+ </div>
34
+ </div>
35
+ <div class="more">
36
+ <div class="label">
37
+ <umb-localize key="jumooProcError_action"></umb-localize>
38
+ </div>
39
+ <div class="detail">${this.data?.error.action}</div>
40
+ </div>
41
+ <div class="more">
42
+ <div class="label"></div>
43
+ <div class="detail">
44
+ ${this.data?.error.step}
45
+ ${when(this.data?.error.subStep, () => html `(${this.data?.error.subStep})`)}
46
+ </div>
47
+ </div>
48
+ <div class="more">
49
+ <div class="label">
50
+ <umb-localize key="jumooProcError_page"></umb-localize>
51
+ </div>
52
+ <div class="detail">${this.data?.error.page}</div>
53
+ </div>
54
+ <div class="more">
55
+ <div class="label">
56
+ <umb-localize key="jumooProcError_class"></umb-localize>
57
+ </div>
58
+ <div class="detail">${this.data?.error.className}</div>
59
+ </div>
60
+ <div class="more">
61
+ <div class="label">
62
+ <umb-localize key="jumooProcError_method"></umb-localize>
63
+ </div>
64
+ <div class="detail">${this.data?.error.methodName}</div>
65
+ </div>
66
+ <div class="more">
67
+ <div class="label">
68
+ <umb-localize key="jumooProcError_stack"></umb-localize>
69
+ </div>
70
+ <div class="detail fixed">${this.data?.error.stackTrace}</div>
71
+ </div>
72
+ </div>
73
+ </uui-box>
74
+
75
+ <div slot="actions">
76
+ <uui-button
77
+ @click=${__classPrivateFieldGet(this, _JumooProcessingErrorModal_instances, "m", _JumooProcessingErrorModal_onClose)}
78
+ color="default"
79
+ look="default"
80
+ .label=${this.localize.term('general_close')}></uui-button>
81
+ </div>
82
+ </umb-body-layout>`;
83
+ }
84
+ };
85
+ _JumooProcessingErrorModal_instances = new WeakSet();
86
+ _JumooProcessingErrorModal_onClose = function _JumooProcessingErrorModal_onClose() {
87
+ this.modalContext?.reject();
88
+ };
89
+ _JumooProcessingErrorModal_truncate = function _JumooProcessingErrorModal_truncate(input, length, separator = '...') {
90
+ if (input.length <= length)
91
+ return input;
92
+ const separatorLength = separator.length;
93
+ const charsToShow = length - separatorLength;
94
+ return input.substring(0, charsToShow) + separator;
95
+ };
96
+ JumooProcessingErrorModal.styles = css `
97
+ .more {
98
+ display: flex;
99
+ gap: var(--uui-size-space-4);
100
+ margin-bottom: var(--uui-size-space-4);
101
+ }
102
+
103
+ h2 {
104
+ overflow: auto;
105
+ padding: var(--uui-size-space-2);
106
+ background-color: var(--uui-color-danger);
107
+ color: var(--uui-color-default-contrast);
108
+ }
109
+
110
+ .label {
111
+ font-weight: bold;
112
+ min-width: var(--uui-size-layout-5);
113
+ text-align: right;
114
+ }
115
+
116
+ .label::after {
117
+ content: ' :';
118
+ }
119
+
120
+ .more .fixed {
121
+ overflow: overlay;
122
+ font-family: monospace;
123
+ }
124
+ `;
125
+ JumooProcessingErrorModal = __decorate([
126
+ customElement(JUMOO_PROCESSING_ERROR_MODAL_ALIAS)
127
+ ], JumooProcessingErrorModal);
128
+ export { JumooProcessingErrorModal };
129
+ export default JumooProcessingErrorModal;
@@ -0,0 +1,10 @@
1
+ import { ProcessingErrorDetails } from '@jumoo/processing';
2
+ import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
3
+ export type JumooProcessingErrorModalData = {
4
+ error: ProcessingErrorDetails;
5
+ };
6
+ export type JumooProcessingErrorModalResult = {
7
+ success: boolean;
8
+ };
9
+ export declare const JUMOO_PROCESSING_ERROR_MODAL_ALIAS = "jumoo-processing-error-modal";
10
+ export declare const JUMOO_PROCESSING_ERROR_MODAL: UmbModalToken<JumooProcessingErrorModalData, JumooProcessingErrorModalResult>;
@@ -0,0 +1,8 @@
1
+ import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
2
+ export const JUMOO_PROCESSING_ERROR_MODAL_ALIAS = 'jumoo-processing-error-modal';
3
+ export const JUMOO_PROCESSING_ERROR_MODAL = new UmbModalToken(JUMOO_PROCESSING_ERROR_MODAL_ALIAS, {
4
+ modal: {
5
+ size: 'large',
6
+ type: 'sidebar',
7
+ },
8
+ });
@@ -0,0 +1 @@
1
+ export * from './error-modal.token.js';
@@ -0,0 +1,2 @@
1
+ export * from './error-modal.token.js';
2
+ // export * from './error-modal.element.js';
@@ -0,0 +1 @@
1
+ export declare const manifests: import("@umbraco-cms/backoffice/modal").ManifestModal[];
@@ -0,0 +1,7 @@
1
+ const errorModal = {
2
+ type: 'modal',
3
+ alias: 'jumoo-processing-error-modal',
4
+ name: 'processing-error-modal',
5
+ js: () => import('./error-modal.element.js'),
6
+ };
7
+ export const manifests = [errorModal];
@@ -0,0 +1,2 @@
1
+ export * from './pipeline-modal.token.js';
2
+ export * from './errors/index.js';
@@ -0,0 +1,3 @@
1
+ export * from './pipeline-modal.token.js';
2
+ // export * from './pipeline-modal.element.js';
3
+ export * from './errors/index.js';
@@ -0,0 +1 @@
1
+ export declare const manifests: import("@umbraco-cms/backoffice/modal").ManifestModal[];
@@ -0,0 +1,8 @@
1
+ import { manifests as errorModals } from './errors/manifest.js';
2
+ const processingModal = {
3
+ type: 'modal',
4
+ alias: 'jumoo-processing-modal',
5
+ name: 'processing-modal',
6
+ js: () => import('./pipeline-modal.element.js'),
7
+ };
8
+ export const manifests = [processingModal, ...errorModals];
@@ -0,0 +1,20 @@
1
+ import { JumooProcessingModalData, JumooProcessingModalResult } from '@jumoo/processing';
2
+ import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
3
+ export declare class uSyncProcessingModal extends UmbModalBaseElement<JumooProcessingModalData, JumooProcessingModalResult> {
4
+ #private;
5
+ private readonly _pipelineContext;
6
+ private _status;
7
+ private _isValid;
8
+ private _isLastAction;
9
+ private headline;
10
+ private progressLabel;
11
+ private closeLabel;
12
+ private modalType;
13
+ constructor();
14
+ connectedCallback(): void;
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ private renderProcess;
17
+ private renderActions;
18
+ static styles: import("lit").CSSResult;
19
+ }
20
+ export default uSyncProcessingModal;
@@ -0,0 +1,151 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _uSyncProcessingModal_instances, _uSyncProcessingModal_onStatusChange, _uSyncProcessingModal_onSetValid, _uSyncProcessingModal_onClose, _uSyncProcessingModal_onComplete, _uSyncProcessingModal_onUpdateModal, _uSyncProcessingModal_onProcess, _uSyncProcessingModal_getDialogStyles;
13
+ import { JUMOO_PROCESSING_MODAL_ALIAS, PipelineContext, PipelineStatus, } from '@jumoo/processing';
14
+ import { css, customElement, html, nothing, state, } from '@umbraco-cms/backoffice/external/lit';
15
+ import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
16
+ let uSyncProcessingModal = class uSyncProcessingModal extends UmbModalBaseElement {
17
+ constructor() {
18
+ super();
19
+ _uSyncProcessingModal_instances.add(this);
20
+ this._isValid = true;
21
+ this._isLastAction = false;
22
+ this.headline = '';
23
+ this.progressLabel = '';
24
+ this.closeLabel = '';
25
+ this.modalType = 'sidebar';
26
+ this._pipelineContext = new PipelineContext(this);
27
+ this.observe(this._pipelineContext.finalized, (finalized) => {
28
+ if (finalized) {
29
+ this.modalContext?.reject();
30
+ }
31
+ });
32
+ }
33
+ connectedCallback() {
34
+ super.connectedCallback();
35
+ this.modalType = this.modalContext?.type ?? 'sidebar';
36
+ this.headline = this.data?.headline ?? '';
37
+ this.progressLabel = this.data?.progressLabel ?? 'Process';
38
+ this.closeLabel = this.data?.closeLabel ?? 'Close';
39
+ }
40
+ render() {
41
+ return html ` ${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_getDialogStyles).call(this)}
42
+ <umb-body-layout id="jumoo-processing-modal">
43
+ <div slot="header" id="header">
44
+ <h3>${this.headline}</h3>
45
+ ${this.data?.description}
46
+ </div>
47
+ ${this.renderProcess()}
48
+ <div slot="actions">${this.renderActions()}</div>
49
+ </umb-body-layout>`;
50
+ }
51
+ renderProcess() {
52
+ if (!this.data)
53
+ return;
54
+ return html `<jumoo-pipeline
55
+ .processor=${this.data.processor}
56
+ .strategy=${this.data.strategy}
57
+ .setup=${this.data.options}
58
+ .debug=${this.data.debug ?? false}
59
+ @pipeline-status=${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_onStatusChange)}
60
+ @pipeline-valid=${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_onSetValid)}
61
+ @pipeline-complete=${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_onComplete)}
62
+ @pipeline-modal-update=${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_onUpdateModal)}></jumoo-pipeline>`;
63
+ }
64
+ renderActions() {
65
+ const actionButton = this._status === PipelineStatus.WAITING && this._isValid && !this._isLastAction
66
+ ? html `<uui-button
67
+ @click=${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_onProcess)}
68
+ color="positive"
69
+ look="primary"
70
+ .label=${this.progressLabel}></uui-button>`
71
+ : nothing;
72
+ const closeButton = html `<uui-button
73
+ @click=${__classPrivateFieldGet(this, _uSyncProcessingModal_instances, "m", _uSyncProcessingModal_onClose)}
74
+ color="default"
75
+ look="default"
76
+ label=${this.closeLabel}></uui-button>`;
77
+ return html `${closeButton} ${actionButton}`;
78
+ }
79
+ };
80
+ _uSyncProcessingModal_instances = new WeakSet();
81
+ _uSyncProcessingModal_onStatusChange = function _uSyncProcessingModal_onStatusChange(e) {
82
+ this._status = e.detail.status;
83
+ this._isLastAction = e.detail.isLastAction;
84
+ };
85
+ _uSyncProcessingModal_onSetValid = function _uSyncProcessingModal_onSetValid(e) {
86
+ this._isValid = e.detail.valid;
87
+ };
88
+ _uSyncProcessingModal_onClose = async function _uSyncProcessingModal_onClose() {
89
+ await this._pipelineContext.triggerClose();
90
+ };
91
+ _uSyncProcessingModal_onComplete = function _uSyncProcessingModal_onComplete() {
92
+ // complete.
93
+ };
94
+ _uSyncProcessingModal_onUpdateModal = function _uSyncProcessingModal_onUpdateModal(modalUpdate) {
95
+ console.debug('pipeline-modal-update', modalUpdate);
96
+ if (!modalUpdate.detail)
97
+ return;
98
+ if (modalUpdate.detail.headline) {
99
+ this.headline = modalUpdate.detail.headline;
100
+ }
101
+ if (modalUpdate.detail.progressLabel) {
102
+ this.progressLabel = modalUpdate.detail.progressLabel;
103
+ }
104
+ if (modalUpdate.detail.closeLabel) {
105
+ this.closeLabel = modalUpdate.detail.closeLabel;
106
+ }
107
+ };
108
+ _uSyncProcessingModal_onProcess = function _uSyncProcessingModal_onProcess() {
109
+ this._pipelineContext.triggerNext();
110
+ };
111
+ _uSyncProcessingModal_getDialogStyles = function _uSyncProcessingModal_getDialogStyles() {
112
+ const width = (this.data?.width ?? this.modalType === 'dialog') ? 600 : 0;
113
+ return html `<style>
114
+ #jumoo-processing-modal {
115
+ min-width: ${width > 0 ? width + 'px' : 'auto'};
116
+ min-height: ${this.data?.height ? this.data.height + 'px' : 'auto'};
117
+ }
118
+ </style>`;
119
+ };
120
+ uSyncProcessingModal.styles = css `
121
+ #header h3 {
122
+ display: block;
123
+ margin: 0;
124
+ }
125
+ `;
126
+ __decorate([
127
+ state()
128
+ ], uSyncProcessingModal.prototype, "_status", void 0);
129
+ __decorate([
130
+ state()
131
+ ], uSyncProcessingModal.prototype, "_isValid", void 0);
132
+ __decorate([
133
+ state()
134
+ ], uSyncProcessingModal.prototype, "_isLastAction", void 0);
135
+ __decorate([
136
+ state()
137
+ ], uSyncProcessingModal.prototype, "headline", void 0);
138
+ __decorate([
139
+ state()
140
+ ], uSyncProcessingModal.prototype, "progressLabel", void 0);
141
+ __decorate([
142
+ state()
143
+ ], uSyncProcessingModal.prototype, "closeLabel", void 0);
144
+ __decorate([
145
+ state()
146
+ ], uSyncProcessingModal.prototype, "modalType", void 0);
147
+ uSyncProcessingModal = __decorate([
148
+ customElement(JUMOO_PROCESSING_MODAL_ALIAS)
149
+ ], uSyncProcessingModal);
150
+ export { uSyncProcessingModal };
151
+ export default uSyncProcessingModal;