@happyvertical/smrt-content 0.34.5 → 0.34.7
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.
- package/dist/manifest.json +2 -2
- package/dist/smrt-knowledge.json +4 -4
- package/dist/svelte/components/ContentAgentChat.svelte +27 -35
- package/dist/svelte/components/ContentAgentChat.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentBodyEditor.svelte +56 -41
- package/dist/svelte/components/ContentBodyEditor.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentClaimAuditTool.svelte +11 -24
- package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentContributionForm.svelte +74 -68
- package/dist/svelte/components/ContentContributionForm.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentContributionInbox.svelte +20 -15
- package/dist/svelte/components/ContentContributionInbox.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentContributionPortal.svelte +4 -2
- package/dist/svelte/components/ContentContributionPortal.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentContributionTypeManager.svelte +121 -94
- package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentContributorManager.svelte +38 -34
- package/dist/svelte/components/ContentContributorManager.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentCorrectionsTool.svelte +15 -39
- package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentEditor.svelte +106 -124
- package/dist/svelte/components/ContentEditor.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte +77 -74
- package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentGovernanceManager.svelte +21 -20
- package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentGovernancePanel.svelte +64 -89
- package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte +43 -44
- package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte +68 -68
- package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentImageBrowser.svelte +11 -10
- package/dist/svelte/components/ContentImageBrowser.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentImageChooser.svelte +19 -12
- package/dist/svelte/components/ContentImageChooser.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentList.svelte +60 -52
- package/dist/svelte/components/ContentList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentMetadataFields.svelte +8 -23
- package/dist/svelte/components/ContentMetadataFields.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentReferencesPanel.svelte +24 -11
- package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentReviewStatusTray.svelte +17 -13
- package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentStatusFields.svelte +8 -19
- package/dist/svelte/components/ContentStatusFields.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentTitleField.svelte +16 -12
- package/dist/svelte/components/ContentTitleField.svelte.d.ts.map +1 -1
- package/dist/svelte/components/ContentVersionsTool.svelte +7 -21
- package/dist/svelte/components/ContentVersionsTool.svelte.d.ts.map +1 -1
- package/dist/svelte/i18n.editor.d.ts +1 -0
- package/dist/svelte/i18n.editor.d.ts.map +1 -1
- package/dist/svelte/i18n.editor.js +1 -0
- package/dist/svelte/routes/ContentContributionsRoute.svelte +27 -23
- package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts.map +1 -1
- package/dist/svelte/routes/ContentFactsRoute.svelte +13 -9
- package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts.map +1 -1
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte +6 -4
- package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts.map +1 -1
- package/package.json +15 -14
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { Form, Input, Select, Textarea } from '@happyvertical/smrt-ui/forms';
|
|
2
3
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
4
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
3
5
|
import type {
|
|
4
6
|
ContentContributionData,
|
|
5
7
|
ContentContributionTypeData,
|
|
@@ -118,83 +120,87 @@ function handleSubmit(event: SubmitEvent) {
|
|
|
118
120
|
}
|
|
119
121
|
</script>
|
|
120
122
|
|
|
121
|
-
<form
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
{t(M['content.contribution_form.contribution_type'])}
|
|
132
|
-
<select name="typeKey" bind:value={draft.typeKey} required>
|
|
133
|
-
{#each types.filter((type) => type.enabled !== false) as type (type.key)}
|
|
134
|
-
<option value={type.key}>{type.label}</option>
|
|
135
|
-
{/each}
|
|
136
|
-
</select>
|
|
137
|
-
</label>
|
|
138
|
-
|
|
139
|
-
{#if showContributorFields}
|
|
140
|
-
<div class="grid">
|
|
141
|
-
<label>
|
|
142
|
-
Email
|
|
143
|
-
<input name="contributorEmail" type="email" bind:value={draft.contributorEmail} required />
|
|
144
|
-
</label>
|
|
145
|
-
<label>
|
|
146
|
-
Name
|
|
147
|
-
<input name="contributorName" type="text" bind:value={draft.contributorName} />
|
|
148
|
-
</label>
|
|
149
|
-
</div>
|
|
150
|
-
{/if}
|
|
123
|
+
<div class="contribution-form-shell">
|
|
124
|
+
<Form
|
|
125
|
+
class="contribution-form"
|
|
126
|
+
method="post"
|
|
127
|
+
enctype="multipart/form-data"
|
|
128
|
+
{action}
|
|
129
|
+
preventDefault={false}
|
|
130
|
+
onsubmit={handleSubmit}
|
|
131
|
+
>
|
|
132
|
+
<h3>{t(M['content.contribution_form.heading'])}</h3>
|
|
151
133
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
134
|
+
<label>
|
|
135
|
+
{t(M['content.contribution_form.contribution_type'])}
|
|
136
|
+
<Select name="typeKey" bind:value={draft.typeKey} required>
|
|
137
|
+
{#each types.filter((type) => type.enabled !== false) as type (type.key)}
|
|
138
|
+
<option value={type.key}>{type.label}</option>
|
|
139
|
+
{/each}
|
|
140
|
+
</Select>
|
|
141
|
+
</label>
|
|
156
142
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
143
|
+
{#if showContributorFields}
|
|
144
|
+
<div class="grid">
|
|
145
|
+
<label>
|
|
146
|
+
Email
|
|
147
|
+
<Input name="contributorEmail" type="email" bind:value={draft.contributorEmail} required />
|
|
148
|
+
</label>
|
|
149
|
+
<label>
|
|
150
|
+
Name
|
|
151
|
+
<Input name="contributorName" type="text" bind:value={draft.contributorName} />
|
|
152
|
+
</label>
|
|
153
|
+
</div>
|
|
154
|
+
{/if}
|
|
161
155
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
156
|
+
<label>
|
|
157
|
+
Title
|
|
158
|
+
<Input name="title" type="text" bind:value={draft.title} />
|
|
159
|
+
</label>
|
|
166
160
|
|
|
167
|
-
{#if activeType?.allowFiles !== false}
|
|
168
161
|
<label>
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
name="files"
|
|
172
|
-
type="file"
|
|
173
|
-
multiple
|
|
174
|
-
onchange={handleFileChange}
|
|
175
|
-
/>
|
|
162
|
+
Description
|
|
163
|
+
<Textarea name="description" bind:value={draft.description} rows={2}></Textarea>
|
|
176
164
|
</label>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
165
|
+
|
|
166
|
+
<label>
|
|
167
|
+
Body
|
|
168
|
+
<Textarea name="body" bind:value={draft.body} rows={8}></Textarea>
|
|
169
|
+
</label>
|
|
170
|
+
|
|
171
|
+
{#if activeType?.allowFiles !== false}
|
|
172
|
+
<label>
|
|
173
|
+
{t(M['content.contribution_form.attach_files'])}
|
|
174
|
+
<!-- raw-primitive-allow: native file input — the Input primitive binds value, which is invalid for type=file (throws InvalidStateError on the bind write-back) and renders a visible control; a file picker stays native -->
|
|
175
|
+
<input
|
|
176
|
+
name="files"
|
|
177
|
+
type="file"
|
|
178
|
+
multiple
|
|
179
|
+
onchange={handleFileChange}
|
|
180
|
+
/>
|
|
181
|
+
</label>
|
|
182
|
+
{#if draft.files.length > 0}
|
|
183
|
+
<div class="file-list">
|
|
184
|
+
{#each draft.files as file (file.name + file.size)}
|
|
185
|
+
<span>{file.name} ({Math.max(1, Math.round(file.size / 1024))} KB)</span>
|
|
186
|
+
{/each}
|
|
187
|
+
</div>
|
|
188
|
+
{/if}
|
|
192
189
|
{/if}
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
|
|
191
|
+
<div class="actions">
|
|
192
|
+
<Button variant="primary" type="submit">{submitLabel}</Button>
|
|
193
|
+
{#if onCancel}
|
|
194
|
+
<Button variant="secondary" type="button" onclick={() => onCancel?.()}>
|
|
195
|
+
Cancel
|
|
196
|
+
</Button>
|
|
197
|
+
{/if}
|
|
198
|
+
</div>
|
|
199
|
+
</Form>
|
|
200
|
+
</div>
|
|
195
201
|
|
|
196
202
|
<style>
|
|
197
|
-
.contribution-form {
|
|
203
|
+
.contribution-form-shell :global(.contribution-form) {
|
|
198
204
|
display: grid;
|
|
199
205
|
gap: 0.85rem;
|
|
200
206
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentContributionForm.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionForm.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentContributionForm.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionForm.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,iCAAiC;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,2BAA2B,EAAE,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC3C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AA6KD,QAAA,MAAM,uBAAuB,2CAAwC,CAAC;AACtE,KAAK,uBAAuB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC1E,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { Form, Input, Select, Textarea } from '@happyvertical/smrt-ui/forms';
|
|
2
3
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
4
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
3
5
|
import type { ContentContributionData } from '../../mock-smrt-client';
|
|
4
6
|
import { M } from '../i18n.contribution.js';
|
|
5
7
|
|
|
@@ -132,6 +134,7 @@ $effect(() => {
|
|
|
132
134
|
<div class="inbox__layout">
|
|
133
135
|
<div class="inbox__list">
|
|
134
136
|
{#each contributions as contribution (contribution.id)}
|
|
137
|
+
<!-- raw-primitive-allow: large pressable selection card wrapping a title and metadata with a selected state -->
|
|
135
138
|
<button
|
|
136
139
|
type="button"
|
|
137
140
|
class:selected={selectedContribution?.id === contribution.id}
|
|
@@ -181,64 +184,66 @@ $effect(() => {
|
|
|
181
184
|
{/if}
|
|
182
185
|
</dl>
|
|
183
186
|
|
|
184
|
-
<
|
|
187
|
+
<Form
|
|
185
188
|
method="post"
|
|
186
189
|
action={workflowFormAction}
|
|
190
|
+
preventDefault={false}
|
|
187
191
|
onsubmit={handleWorkflowSubmit}
|
|
188
192
|
>
|
|
189
193
|
{#if selectedContribution.id}
|
|
190
|
-
<
|
|
194
|
+
<Input type="hidden" name="contributionId" value={selectedContribution.id} />
|
|
191
195
|
{/if}
|
|
192
196
|
|
|
193
197
|
<label>
|
|
194
198
|
{t(M['content.contribution_inbox.editorial_note'])}
|
|
195
|
-
<
|
|
199
|
+
<Textarea name="editorNote" bind:value={note} rows={4}></Textarea>
|
|
196
200
|
</label>
|
|
197
201
|
|
|
198
202
|
<div class="actions">
|
|
199
203
|
{#if onApprove || workflowFormAction}
|
|
200
204
|
<label class="inline">
|
|
201
205
|
{t(M['content.contribution_inbox.promote_to'])}
|
|
202
|
-
<
|
|
206
|
+
<Select name="targetStatus" bind:value={targetStatus}>
|
|
203
207
|
<option value="draft">draft</option>
|
|
204
208
|
<option value="review">review</option>
|
|
205
|
-
</
|
|
209
|
+
</Select>
|
|
206
210
|
</label>
|
|
207
|
-
<
|
|
211
|
+
<Button
|
|
212
|
+
variant="primary"
|
|
208
213
|
type="submit"
|
|
209
214
|
name="intent"
|
|
210
215
|
value="approve"
|
|
211
216
|
disabled={!canSubmitWorkflow}
|
|
212
217
|
>
|
|
213
218
|
{approveActionLabel(selectedContribution)}
|
|
214
|
-
</
|
|
219
|
+
</Button>
|
|
215
220
|
{/if}
|
|
216
221
|
|
|
217
222
|
{#if onRequestChanges || workflowFormAction}
|
|
218
|
-
<
|
|
223
|
+
<Button
|
|
224
|
+
variant="secondary"
|
|
219
225
|
type="submit"
|
|
220
226
|
name="intent"
|
|
221
227
|
value="request-changes"
|
|
222
|
-
class="secondary"
|
|
223
228
|
disabled={!canSubmitWorkflow}
|
|
224
229
|
>
|
|
225
230
|
{t(M['content.contribution_inbox.request_changes'])}
|
|
226
|
-
</
|
|
231
|
+
</Button>
|
|
227
232
|
{/if}
|
|
228
233
|
|
|
229
234
|
{#if onReject || workflowFormAction}
|
|
230
|
-
<
|
|
235
|
+
<Button
|
|
236
|
+
variant="danger"
|
|
231
237
|
type="submit"
|
|
232
238
|
name="intent"
|
|
233
239
|
value="reject"
|
|
234
|
-
class="danger"
|
|
235
240
|
disabled={!canSubmitWorkflow}
|
|
236
241
|
>
|
|
237
242
|
Reject
|
|
238
|
-
</
|
|
243
|
+
</Button>
|
|
239
244
|
{/if}
|
|
240
245
|
</div>
|
|
241
|
-
</
|
|
246
|
+
</Form>
|
|
242
247
|
</article>
|
|
243
248
|
{/if}
|
|
244
249
|
</div>
|
|
@@ -250,7 +255,7 @@ $effect(() => {
|
|
|
250
255
|
.inbox__header,
|
|
251
256
|
.inbox__layout,
|
|
252
257
|
.inbox__detail,
|
|
253
|
-
.inbox__detail form {
|
|
258
|
+
.inbox__detail :global(.form) {
|
|
254
259
|
display: grid;
|
|
255
260
|
gap: 1rem;
|
|
256
261
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentContributionInbox.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionInbox.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentContributionInbox.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionInbox.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,WAAW,KAAK;IACpB,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC3D,SAAS,CAAC,EAAE,CACV,YAAY,EAAE,uBAAuB,EACrC,OAAO,EAAE;QAAE,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KACxD,IAAI,CAAC;IACV,gBAAgB,CAAC,EAAE,CACjB,YAAY,EAAE,uBAAuB,EACrC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KACtB,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,CACT,YAAY,EAAE,uBAAuB,EACrC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KACtB,IAAI,CAAC;CACX;AAmND,QAAA,MAAM,wBAAwB,2CAAwC,CAAC;AACvE,KAAK,wBAAwB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC5E,eAAe,wBAAwB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
3
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
3
4
|
import type { ContentContributionData } from '../../mock-smrt-client';
|
|
4
5
|
import { M } from '../i18n.contribution.js';
|
|
5
6
|
|
|
@@ -49,6 +50,7 @@ function canWithdraw(contribution: ContentContributionData) {
|
|
|
49
50
|
<div class="portal__layout">
|
|
50
51
|
<div class="portal__list">
|
|
51
52
|
{#each contributions as contribution (contribution.id)}
|
|
53
|
+
<!-- raw-primitive-allow: large pressable selection card wrapping rich content (title, status) with selected state; no Button primitive owns this list-row selection pattern -->
|
|
52
54
|
<button
|
|
53
55
|
type="button"
|
|
54
56
|
class:selected={selectedContribution?.id === contribution.id}
|
|
@@ -91,9 +93,9 @@ function canWithdraw(contribution: ContentContributionData) {
|
|
|
91
93
|
</dl>
|
|
92
94
|
|
|
93
95
|
{#if onWithdraw && canWithdraw(selectedContribution)}
|
|
94
|
-
<
|
|
96
|
+
<Button variant="secondary" type="button" onclick={() => onWithdraw?.(selectedContribution)}>
|
|
95
97
|
{t(M['content.contribution_portal.withdraw_submission'])}
|
|
96
|
-
</
|
|
98
|
+
</Button>
|
|
97
99
|
{/if}
|
|
98
100
|
</article>
|
|
99
101
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentContributionPortal.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionPortal.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentContributionPortal.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionPortal.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,WAAW,KAAK;IACpB,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,YAAY,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC9D;AAmGD,QAAA,MAAM,yBAAyB,2CAAwC,CAAC;AACxE,KAAK,yBAAyB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC9E,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { Form, Input, Select, Textarea } from '@happyvertical/smrt-ui/forms';
|
|
2
3
|
import { useI18n } from '@happyvertical/smrt-ui/i18n';
|
|
4
|
+
import { Button } from '@happyvertical/smrt-ui/ui';
|
|
3
5
|
import type { ContentContributionTypeData } from '../../mock-smrt-client';
|
|
4
6
|
import { M } from '../i18n.contribution.js';
|
|
5
7
|
|
|
@@ -116,7 +118,7 @@ function handleSubmit() {
|
|
|
116
118
|
<h3>{t(M['content.contribution_type_manager.heading'])}</h3>
|
|
117
119
|
<p>{t(M['content.contribution_type_manager.intro'])}</p>
|
|
118
120
|
</div>
|
|
119
|
-
<
|
|
121
|
+
<Button variant="ghost" type="button" onclick={() => (editing = {})}>{t(M['content.contribution_type_manager.add_type'])}</Button>
|
|
120
122
|
</header>
|
|
121
123
|
|
|
122
124
|
<div class="layout">
|
|
@@ -128,112 +130,137 @@ function handleSubmit() {
|
|
|
128
130
|
<div>{type.key}</div>
|
|
129
131
|
</div>
|
|
130
132
|
<div class="actions">
|
|
131
|
-
<
|
|
133
|
+
<Button variant="secondary" type="button" onclick={() => (editing = type)}>Edit</Button>
|
|
132
134
|
{#if onDelete && type.id}
|
|
133
|
-
<
|
|
135
|
+
<Button variant="danger" type="button" onclick={() => onDelete?.(type)}>Delete</Button>
|
|
134
136
|
{/if}
|
|
135
137
|
</div>
|
|
136
138
|
</article>
|
|
137
139
|
{/each}
|
|
138
140
|
</div>
|
|
139
141
|
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
event
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
142
|
+
<div class="editor-shell">
|
|
143
|
+
<Form
|
|
144
|
+
class="editor"
|
|
145
|
+
onsubmit={(event) => {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
handleSubmit();
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
<label>
|
|
151
|
+
Key
|
|
152
|
+
<Input type="text" bind:value={draft.key} required />
|
|
153
|
+
</label>
|
|
154
|
+
<label>
|
|
155
|
+
Label
|
|
156
|
+
<Input type="text" bind:value={draft.label} required />
|
|
157
|
+
</label>
|
|
158
|
+
|
|
159
|
+
<div class="checkbox-grid">
|
|
160
|
+
<label>
|
|
161
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
162
|
+
<input type="checkbox" bind:checked={draft.enabled} /> Enabled
|
|
163
|
+
</label>
|
|
164
|
+
<label>
|
|
165
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
166
|
+
<input type="checkbox" bind:checked={draft.allowText} /> {t(M['content.contribution_type_manager.allow_text'])}
|
|
167
|
+
</label>
|
|
168
|
+
<label>
|
|
169
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
170
|
+
<input type="checkbox" bind:checked={draft.allowFiles} /> {t(M['content.contribution_type_manager.allow_files'])}
|
|
171
|
+
</label>
|
|
172
|
+
<label>
|
|
173
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
174
|
+
<input type="checkbox" bind:checked={draft.allowEmptyText} /> {t(M['content.contribution_type_manager.allow_empty_text'])}
|
|
175
|
+
</label>
|
|
176
|
+
</div>
|
|
155
177
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
178
|
+
<div class="checkbox-grid">
|
|
179
|
+
<label>
|
|
180
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
181
|
+
<input
|
|
182
|
+
type="checkbox"
|
|
183
|
+
checked={draft.allowedChannels.includes('web')}
|
|
184
|
+
onchange={() => toggleChannel('web')}
|
|
185
|
+
/>
|
|
186
|
+
Web
|
|
187
|
+
</label>
|
|
188
|
+
<label>
|
|
189
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
190
|
+
<input
|
|
191
|
+
type="checkbox"
|
|
192
|
+
checked={draft.allowedChannels.includes('email')}
|
|
193
|
+
onchange={() => toggleChannel('email')}
|
|
194
|
+
/>
|
|
195
|
+
Email
|
|
196
|
+
</label>
|
|
197
|
+
</div>
|
|
162
198
|
|
|
163
|
-
<div class="checkbox-grid">
|
|
164
199
|
<label>
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
checked={draft.allowedChannels.includes('web')}
|
|
168
|
-
onchange={() => toggleChannel('web')}
|
|
169
|
-
/>
|
|
170
|
-
Web
|
|
200
|
+
{t(M['content.contribution_type_manager.promotion_content_type'])}
|
|
201
|
+
<Input type="text" bind:value={draft.promotion.targetContentType} required />
|
|
171
202
|
</label>
|
|
172
203
|
<label>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
204
|
+
{t(M['content.contribution_type_manager.promotion_variant'])}
|
|
205
|
+
<Input type="text" bind:value={draft.promotion.targetContentVariant} />
|
|
206
|
+
</label>
|
|
207
|
+
<label>
|
|
208
|
+
{t(M['content.contribution_type_manager.promotion_status'])}
|
|
209
|
+
<Select bind:value={draft.promotion.targetContentStatus}>
|
|
210
|
+
<option value="draft">draft</option>
|
|
211
|
+
<option value="review">review</option>
|
|
212
|
+
</Select>
|
|
179
213
|
</label>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<label>
|
|
183
|
-
{t(M['content.contribution_type_manager.promotion_content_type'])}
|
|
184
|
-
<input type="text" bind:value={draft.promotion.targetContentType} required />
|
|
185
|
-
</label>
|
|
186
|
-
<label>
|
|
187
|
-
{t(M['content.contribution_type_manager.promotion_variant'])}
|
|
188
|
-
<input type="text" bind:value={draft.promotion.targetContentVariant} />
|
|
189
|
-
</label>
|
|
190
|
-
<label>
|
|
191
|
-
{t(M['content.contribution_type_manager.promotion_status'])}
|
|
192
|
-
<select bind:value={draft.promotion.targetContentStatus}>
|
|
193
|
-
<option value="draft">draft</option>
|
|
194
|
-
<option value="review">review</option>
|
|
195
|
-
</select>
|
|
196
|
-
</label>
|
|
197
214
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
215
|
+
<div class="checkbox-grid">
|
|
216
|
+
<label>
|
|
217
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
218
|
+
<input type="checkbox" bind:checked={draft.promotion.autoPromoteTrusted} /> {t(M['content.contribution_type_manager.auto_promote_trusted'])}
|
|
219
|
+
</label>
|
|
220
|
+
<label>
|
|
221
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
222
|
+
<input type="checkbox" bind:checked={draft.promotion.createAssets} /> {t(M['content.contribution_type_manager.create_assets_on_promotion'])}
|
|
223
|
+
</label>
|
|
224
|
+
<label>
|
|
225
|
+
<!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
|
|
226
|
+
<input type="checkbox" bind:checked={draft.intakeRules.trustedOnly} /> {t(M['content.contribution_type_manager.trusted_contributors_only'])}
|
|
227
|
+
</label>
|
|
228
|
+
</div>
|
|
203
229
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
<label>
|
|
231
|
+
{t(M['content.contribution_type_manager.max_files'])}
|
|
232
|
+
<Input type="number" min="0" bind:value={draft.intakeRules.maxFiles} />
|
|
233
|
+
</label>
|
|
234
|
+
<label>
|
|
235
|
+
{t(M['content.contribution_type_manager.max_total_bytes'])}
|
|
236
|
+
<Input type="number" min="0" bind:value={draft.intakeRules.maxTotalBytes} />
|
|
237
|
+
</label>
|
|
238
|
+
<label>
|
|
239
|
+
{t(M['content.contribution_type_manager.allowed_mime_patterns'])}
|
|
240
|
+
<Input type="text" bind:value={draft.intakeRules.allowedMimePatterns} placeholder={t(M['content.contribution_type_manager.allowed_mime_patterns_placeholder'])} />
|
|
241
|
+
</label>
|
|
242
|
+
<label>
|
|
243
|
+
{t(M['content.contribution_type_manager.blocked_mime_patterns'])}
|
|
244
|
+
<Input type="text" bind:value={draft.intakeRules.blockedMimePatterns} />
|
|
245
|
+
</label>
|
|
246
|
+
<label>
|
|
247
|
+
{t(M['content.contribution_type_manager.quarantine_mime_patterns'])}
|
|
248
|
+
<Input type="text" bind:value={draft.intakeRules.quarantineMimePatterns} />
|
|
249
|
+
</label>
|
|
250
|
+
<label>
|
|
251
|
+
{t(M['content.contribution_type_manager.blocked_text_patterns'])}
|
|
252
|
+
<Textarea bind:value={draft.intakeRules.blockedTextPatterns} rows={2}></Textarea>
|
|
253
|
+
</label>
|
|
254
|
+
<label>
|
|
255
|
+
{t(M['content.contribution_type_manager.quarantine_text_patterns'])}
|
|
256
|
+
<Textarea bind:value={draft.intakeRules.quarantineTextPatterns} rows={2}></Textarea>
|
|
257
|
+
</label>
|
|
232
258
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
259
|
+
<div class="actions">
|
|
260
|
+
<Button variant="primary" type="submit">{t(M['content.contribution_type_manager.save_type'])}</Button>
|
|
261
|
+
</div>
|
|
262
|
+
</Form>
|
|
263
|
+
</div>
|
|
237
264
|
</div>
|
|
238
265
|
</section>
|
|
239
266
|
|
|
@@ -241,7 +268,7 @@ function handleSubmit() {
|
|
|
241
268
|
.manager,
|
|
242
269
|
.layout,
|
|
243
270
|
.list,
|
|
244
|
-
.editor {
|
|
271
|
+
.editor-shell :global(.editor) {
|
|
245
272
|
display: grid;
|
|
246
273
|
gap: 1rem;
|
|
247
274
|
}
|
|
@@ -251,7 +278,7 @@ function handleSubmit() {
|
|
|
251
278
|
}
|
|
252
279
|
|
|
253
280
|
.card,
|
|
254
|
-
.editor {
|
|
281
|
+
.editor-shell :global(.editor) {
|
|
255
282
|
border: 1px solid var(--smrt-color-outline-variant);
|
|
256
283
|
border-radius: 0.75rem;
|
|
257
284
|
padding: 0.9rem;
|
|
@@ -268,7 +295,7 @@ function handleSubmit() {
|
|
|
268
295
|
flex-wrap: wrap;
|
|
269
296
|
}
|
|
270
297
|
|
|
271
|
-
.editor label {
|
|
298
|
+
.editor-shell label {
|
|
272
299
|
display: grid;
|
|
273
300
|
gap: 0.35rem;
|
|
274
301
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentContributionTypeManager.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionTypeManager.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentContributionTypeManager.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentContributionTypeManager.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAI1E,MAAM,WAAW,KAAK;IACpB,KAAK,CAAC,EAAE,2BAA2B,EAAE,CAAC;IACtC,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;CACxD;AA+PD,QAAA,MAAM,8BAA8B,2CAAwC,CAAC;AAC7E,KAAK,8BAA8B,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACxF,eAAe,8BAA8B,CAAC"}
|