@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.
Files changed (60) hide show
  1. package/dist/manifest.json +2 -2
  2. package/dist/smrt-knowledge.json +4 -4
  3. package/dist/svelte/components/ContentAgentChat.svelte +27 -35
  4. package/dist/svelte/components/ContentAgentChat.svelte.d.ts.map +1 -1
  5. package/dist/svelte/components/ContentBodyEditor.svelte +56 -41
  6. package/dist/svelte/components/ContentBodyEditor.svelte.d.ts.map +1 -1
  7. package/dist/svelte/components/ContentClaimAuditTool.svelte +11 -24
  8. package/dist/svelte/components/ContentClaimAuditTool.svelte.d.ts.map +1 -1
  9. package/dist/svelte/components/ContentContributionForm.svelte +74 -68
  10. package/dist/svelte/components/ContentContributionForm.svelte.d.ts.map +1 -1
  11. package/dist/svelte/components/ContentContributionInbox.svelte +20 -15
  12. package/dist/svelte/components/ContentContributionInbox.svelte.d.ts.map +1 -1
  13. package/dist/svelte/components/ContentContributionPortal.svelte +4 -2
  14. package/dist/svelte/components/ContentContributionPortal.svelte.d.ts.map +1 -1
  15. package/dist/svelte/components/ContentContributionTypeManager.svelte +121 -94
  16. package/dist/svelte/components/ContentContributionTypeManager.svelte.d.ts.map +1 -1
  17. package/dist/svelte/components/ContentContributorManager.svelte +38 -34
  18. package/dist/svelte/components/ContentContributorManager.svelte.d.ts.map +1 -1
  19. package/dist/svelte/components/ContentCorrectionsTool.svelte +15 -39
  20. package/dist/svelte/components/ContentCorrectionsTool.svelte.d.ts.map +1 -1
  21. package/dist/svelte/components/ContentEditor.svelte +106 -124
  22. package/dist/svelte/components/ContentEditor.svelte.d.ts.map +1 -1
  23. package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte +77 -74
  24. package/dist/svelte/components/ContentGovernanceAssignmentEditor.svelte.d.ts.map +1 -1
  25. package/dist/svelte/components/ContentGovernanceManager.svelte +21 -20
  26. package/dist/svelte/components/ContentGovernanceManager.svelte.d.ts.map +1 -1
  27. package/dist/svelte/components/ContentGovernancePanel.svelte +64 -89
  28. package/dist/svelte/components/ContentGovernancePanel.svelte.d.ts.map +1 -1
  29. package/dist/svelte/components/ContentGovernancePolicyEditor.svelte +43 -44
  30. package/dist/svelte/components/ContentGovernancePolicyEditor.svelte.d.ts.map +1 -1
  31. package/dist/svelte/components/ContentGovernanceProfileEditor.svelte +68 -68
  32. package/dist/svelte/components/ContentGovernanceProfileEditor.svelte.d.ts.map +1 -1
  33. package/dist/svelte/components/ContentImageBrowser.svelte +11 -10
  34. package/dist/svelte/components/ContentImageBrowser.svelte.d.ts.map +1 -1
  35. package/dist/svelte/components/ContentImageChooser.svelte +19 -12
  36. package/dist/svelte/components/ContentImageChooser.svelte.d.ts.map +1 -1
  37. package/dist/svelte/components/ContentList.svelte +60 -52
  38. package/dist/svelte/components/ContentList.svelte.d.ts.map +1 -1
  39. package/dist/svelte/components/ContentMetadataFields.svelte +8 -23
  40. package/dist/svelte/components/ContentMetadataFields.svelte.d.ts.map +1 -1
  41. package/dist/svelte/components/ContentReferencesPanel.svelte +24 -11
  42. package/dist/svelte/components/ContentReferencesPanel.svelte.d.ts.map +1 -1
  43. package/dist/svelte/components/ContentReviewStatusTray.svelte +17 -13
  44. package/dist/svelte/components/ContentReviewStatusTray.svelte.d.ts.map +1 -1
  45. package/dist/svelte/components/ContentStatusFields.svelte +8 -19
  46. package/dist/svelte/components/ContentStatusFields.svelte.d.ts.map +1 -1
  47. package/dist/svelte/components/ContentTitleField.svelte +16 -12
  48. package/dist/svelte/components/ContentTitleField.svelte.d.ts.map +1 -1
  49. package/dist/svelte/components/ContentVersionsTool.svelte +7 -21
  50. package/dist/svelte/components/ContentVersionsTool.svelte.d.ts.map +1 -1
  51. package/dist/svelte/i18n.editor.d.ts +1 -0
  52. package/dist/svelte/i18n.editor.d.ts.map +1 -1
  53. package/dist/svelte/i18n.editor.js +1 -0
  54. package/dist/svelte/routes/ContentContributionsRoute.svelte +27 -23
  55. package/dist/svelte/routes/ContentContributionsRoute.svelte.d.ts.map +1 -1
  56. package/dist/svelte/routes/ContentFactsRoute.svelte +13 -9
  57. package/dist/svelte/routes/ContentFactsRoute.svelte.d.ts.map +1 -1
  58. package/dist/svelte/routes/ContentWorkspaceRoute.svelte +6 -4
  59. package/dist/svelte/routes/ContentWorkspaceRoute.svelte.d.ts.map +1 -1
  60. 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
  ContentGovernanceProfileData,
5
7
  ContentReviewPolicyData,
@@ -81,72 +83,76 @@ function handleSubmit() {
81
83
  }
82
84
  </script>
83
85
 
84
- <form class="governance-editor" onsubmit={(event) => {
85
- event.preventDefault();
86
- handleSubmit();
87
- }}>
88
- <label>
89
- Key
90
- <input type="text" bind:value={draft.key} required />
91
- </label>
92
- <label>
93
- Label
94
- <input type="text" bind:value={draft.label} />
95
- </label>
96
- <label>
97
- Description
98
- <textarea rows="2" bind:value={draft.description}></textarea>
99
- </label>
100
- <label class="checkbox">
101
- <input type="checkbox" bind:checked={draft.enabled} />
102
- Enabled
103
- </label>
104
-
105
- <div class="requirements">
106
- <div class="requirements__header">
107
- <strong>Requirements</strong>
108
- <button type="button" class="secondary" onclick={addRequirement}>
109
- {t(M['content.governance_profile_editor.add_requirement'])}
110
- </button>
86
+ <div class="governance-editor-shell">
87
+ <Form class="governance-editor" onsubmit={(event) => {
88
+ event.preventDefault();
89
+ handleSubmit();
90
+ }}>
91
+ <label>
92
+ Key
93
+ <Input type="text" bind:value={draft.key} required />
94
+ </label>
95
+ <label>
96
+ Label
97
+ <Input type="text" bind:value={draft.label} />
98
+ </label>
99
+ <label>
100
+ Description
101
+ <Textarea rows={2} bind:value={draft.description}></Textarea>
102
+ </label>
103
+ <label class="checkbox">
104
+ <!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
105
+ <input type="checkbox" bind:checked={draft.enabled} />
106
+ Enabled
107
+ </label>
108
+
109
+ <div class="requirements">
110
+ <div class="requirements__header">
111
+ <strong>Requirements</strong>
112
+ <Button variant="secondary" type="button" onclick={addRequirement}>
113
+ {t(M['content.governance_profile_editor.add_requirement'])}
114
+ </Button>
115
+ </div>
116
+
117
+ {#each draft.requirements as requirement, index (`${requirement.policyKey}-${index}`)}
118
+ <div class="requirement-row">
119
+ <label>
120
+ Policy
121
+ <Select bind:value={requirement.policyKey}>
122
+ {#each policies as policy (policy.key)}
123
+ <option value={policy.key}>{policy.label}</option>
124
+ {/each}
125
+ </Select>
126
+ </label>
127
+ <label>
128
+ Label
129
+ <Input type="text" bind:value={requirement.label} />
130
+ </label>
131
+ <label class="checkbox">
132
+ <!-- raw-primitive-allow: native checkbox; no Provider-free checkbox primitive (Toggle is a switch with different semantics, CheckboxInput requires a Provider) -->
133
+ <input type="checkbox" bind:checked={requirement.blocking} />
134
+ Blocking
135
+ </label>
136
+ <Button variant="danger" type="button" onclick={() => removeRequirement(index)}>
137
+ Remove
138
+ </Button>
139
+ </div>
140
+ {/each}
111
141
  </div>
112
142
 
113
- {#each draft.requirements as requirement, index (`${requirement.policyKey}-${index}`)}
114
- <div class="requirement-row">
115
- <label>
116
- Policy
117
- <select bind:value={requirement.policyKey}>
118
- {#each policies as policy (policy.key)}
119
- <option value={policy.key}>{policy.label}</option>
120
- {/each}
121
- </select>
122
- </label>
123
- <label>
124
- Label
125
- <input type="text" bind:value={requirement.label} />
126
- </label>
127
- <label class="checkbox">
128
- <input type="checkbox" bind:checked={requirement.blocking} />
129
- Blocking
130
- </label>
131
- <button type="button" class="secondary" onclick={() => removeRequirement(index)}>
132
- Remove
133
- </button>
134
- </div>
135
- {/each}
136
- </div>
137
-
138
- <div class="actions">
139
- <button type="submit">{t(M['content.governance_profile_editor.save_profile'])}</button>
140
- {#if onCancel}
141
- <button type="button" class="secondary" onclick={() => onCancel?.()}>
142
- Cancel
143
- </button>
144
- {/if}
145
- </div>
146
- </form>
143
+ <div class="actions">
144
+ <Button variant="primary" type="submit">{t(M['content.governance_profile_editor.save_profile'])}</Button>
145
+ {#if onCancel}
146
+ <Button variant="secondary" type="button" onclick={() => onCancel?.()}>
147
+ Cancel
148
+ </Button>
149
+ {/if}
150
+ </div>
151
+ </Form>
152
+ </div>
147
153
 
148
154
  <style>
149
- .governance-editor {
155
+ .governance-editor-shell :global(.governance-editor) {
150
156
  display: grid;
151
157
  gap: 0.75rem;
152
158
  }
@@ -157,12 +163,6 @@ function handleSubmit() {
157
163
  font-size: var(--smrt-typography-label-large-size, 0.9rem);
158
164
  }
159
165
 
160
- input,
161
- select,
162
- textarea {
163
- width: 100%;
164
- }
165
-
166
166
  .checkbox {
167
167
  display: flex;
168
168
  align-items: center;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentGovernanceProfileEditor.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentGovernanceProfileEditor.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,KAAK;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACrC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AA+ID,QAAA,MAAM,8BAA8B,2CAAwC,CAAC;AAC7E,KAAK,8BAA8B,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACxF,eAAe,8BAA8B,CAAC"}
1
+ {"version":3,"file":"ContentGovernanceProfileEditor.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentGovernanceProfileEditor.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,WAAW,KAAK;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,uBAAuB,EAAE,CAAC;IACrC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,4BAA4B,CAAC,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAqJD,QAAA,MAAM,8BAA8B,2CAAwC,CAAC;AAC7E,KAAK,8BAA8B,GAAG,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACxF,eAAe,8BAA8B,CAAC"}
@@ -4,6 +4,7 @@ import {
4
4
  ImageUploader,
5
5
  } from '@happyvertical/smrt-images/svelte';
6
6
  import { useI18n } from '@happyvertical/smrt-ui/i18n';
7
+ import { Button } from '@happyvertical/smrt-ui/ui';
7
8
  import type { ContentEditorAsset } from '../content-editor-form';
8
9
  import { M } from '../i18n.editor.js';
9
10
 
@@ -87,13 +88,13 @@ function handleSelect(selected: ImageLike | File | string) {
87
88
  </div>
88
89
  <div class="asset-actions">
89
90
  {#if onUseAsset}
90
- <button type="button" onclick={() => onUseAsset?.(asset)}>{selectActionLabel}</button>
91
+ <Button variant="ghost" type="button" class="asset-action-btn" onclick={() => onUseAsset?.(asset)}>{selectActionLabel}</Button>
91
92
  {/if}
92
93
  {#if onUseAsThumbnail && assetId && thumbnailAssetId !== assetId}
93
- <button type="button" onclick={() => onUseAsThumbnail?.(assetId)}>Thumbnail</button>
94
+ <Button variant="ghost" type="button" class="asset-action-btn" onclick={() => onUseAsThumbnail?.(assetId)}>Thumbnail</Button>
94
95
  {/if}
95
96
  {#if onRemoveAsset && assetId}
96
- <button type="button" class="danger" onclick={() => onRemoveAsset?.(assetId)}>Remove</button>
97
+ <Button variant="ghost" type="button" class="asset-action-btn asset-action-btn--danger" onclick={() => onRemoveAsset?.(assetId)}>Remove</Button>
97
98
  {/if}
98
99
  </div>
99
100
  </article>
@@ -108,14 +109,14 @@ function handleSelect(selected: ImageLike | File | string) {
108
109
  <ImageUploader {apiBaseUrl} onSelect={handleSelect} onCancel={() => showUploader = false} />
109
110
  </div>
110
111
  {:else if onSelectImage}
111
- <button type="button" class="add-image-button" onclick={() => showUploader = true}>
112
+ <Button variant="ghost" type="button" class="asset-action-btn add-image-button" onclick={() => showUploader = true}>
112
113
  <svg viewBox="0 0 24 24" aria-hidden="true">
113
114
  <rect x="3" y="3" width="18" height="18" rx="2"></rect>
114
115
  <circle cx="8.5" cy="8.5" r="1.5"></circle>
115
116
  <path d="m21 15-5-5L5 21"></path>
116
117
  </svg>
117
118
  {addButtonLabel}
118
- </button>
119
+ </Button>
119
120
  {/if}
120
121
  </div>
121
122
 
@@ -197,7 +198,7 @@ function handleSelect(selected: ImageLike | File | string) {
197
198
  gap: 0.5rem;
198
199
  }
199
200
 
200
- button {
201
+ .content-image-browser :global(.asset-action-btn) {
201
202
  display: inline-flex;
202
203
  align-items: center;
203
204
  justify-content: center;
@@ -214,19 +215,19 @@ function handleSelect(selected: ImageLike | File | string) {
214
215
  padding: 0.5rem 0.875rem;
215
216
  }
216
217
 
217
- button:hover {
218
+ .content-image-browser :global(.asset-action-btn:hover) {
218
219
  background: var(--smrt-color-surface-container-high);
219
220
  }
220
221
 
221
- button.danger {
222
+ .content-image-browser :global(.asset-action-btn--danger) {
222
223
  color: var(--smrt-color-error);
223
224
  }
224
225
 
225
- .add-image-button {
226
+ .content-image-browser :global(.add-image-button) {
226
227
  justify-self: start;
227
228
  }
228
229
 
229
- .add-image-button svg {
230
+ .content-image-browser :global(.add-image-button svg) {
230
231
  width: 1rem;
231
232
  height: 1rem;
232
233
  fill: none;
@@ -1 +1 @@
1
- {"version":3,"file":"ContentImageBrowser.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentImageBrowser.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE,MAAM,WAAW,KAAK;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AA+GD,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ContentImageBrowser.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentImageBrowser.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,mCAAmC,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE,MAAM,WAAW,KAAK;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAgHD,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,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 {
4
5
  type ContentBodyFormat,
5
6
  extractBodyImages,
@@ -48,7 +49,9 @@ function cycle(delta: number) {
48
49
  {#if activeImage}
49
50
  <div class="content-image-chooser" aria-label={t(M['content.content_image_chooser.body_images'])}>
50
51
  {#if hasMultiple}
51
- <button
52
+ <Button
53
+ variant="ghost"
54
+ size="sm"
52
55
  type="button"
53
56
  class="chooser-arrow"
54
57
  aria-label={t(M['content.content_image_chooser.previous_body_image'])}
@@ -57,10 +60,12 @@ function cycle(delta: number) {
57
60
  <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
58
61
  <polyline points="15 18 9 12 15 6"></polyline>
59
62
  </svg>
60
- </button>
63
+ </Button>
61
64
  {/if}
62
65
 
63
- <button
66
+ <Button
67
+ variant="ghost"
68
+ size="sm"
64
69
  type="button"
65
70
  class="chooser-preview"
66
71
  aria-label={t(M['content.content_image_chooser.focus_selected_body_image'])}
@@ -68,10 +73,12 @@ function cycle(delta: number) {
68
73
  >
69
74
  <img src={activeImage.src} alt={activeImage.alt || 'Body image'} />
70
75
  <span>{normalizedIndex + 1} / {images.length}</span>
71
- </button>
76
+ </Button>
72
77
 
73
78
  {#if hasMultiple}
74
- <button
79
+ <Button
80
+ variant="ghost"
81
+ size="sm"
75
82
  type="button"
76
83
  class="chooser-arrow"
77
84
  aria-label={t(M['content.content_image_chooser.next_body_image'])}
@@ -80,7 +87,7 @@ function cycle(delta: number) {
80
87
  <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
81
88
  <polyline points="9 18 15 12 9 6"></polyline>
82
89
  </svg>
83
- </button>
90
+ </Button>
84
91
  {/if}
85
92
  </div>
86
93
  {/if}
@@ -93,8 +100,8 @@ function cycle(delta: number) {
93
100
  min-height: 2.75rem;
94
101
  }
95
102
 
96
- .chooser-arrow,
97
- .chooser-preview {
103
+ .content-image-chooser :global(.chooser-arrow),
104
+ .content-image-chooser :global(.chooser-preview) {
98
105
  border: 1px solid var(--smrt-color-outline-variant);
99
106
  background: var(--smrt-color-surface-container);
100
107
  color: var(--smrt-color-on-surface);
@@ -102,7 +109,7 @@ function cycle(delta: number) {
102
109
  cursor: pointer;
103
110
  }
104
111
 
105
- .chooser-arrow {
112
+ .content-image-chooser :global(.chooser-arrow) {
106
113
  width: 2.25rem;
107
114
  height: 2.25rem;
108
115
  display: grid;
@@ -110,12 +117,12 @@ function cycle(delta: number) {
110
117
  padding: 0;
111
118
  }
112
119
 
113
- .chooser-arrow:disabled {
120
+ .content-image-chooser :global(.chooser-arrow:disabled) {
114
121
  cursor: not-allowed;
115
122
  opacity: 0.38;
116
123
  }
117
124
 
118
- .chooser-preview {
125
+ .content-image-chooser :global(.chooser-preview) {
119
126
  display: inline-flex;
120
127
  align-items: center;
121
128
  gap: 0.45rem;
@@ -124,7 +131,7 @@ function cycle(delta: number) {
124
131
  font-weight: var(--smrt-typography-weight-bold, 650);
125
132
  }
126
133
 
127
- .chooser-preview img {
134
+ .content-image-chooser :global(.chooser-preview img) {
128
135
  width: 2rem;
129
136
  height: 2rem;
130
137
  border-radius: var(--smrt-radius-full, 9999px);
@@ -1 +1 @@
1
- {"version":3,"file":"ContentImageChooser.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentImageChooser.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAmED,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ContentImageChooser.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentImageChooser.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAoED,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -1,6 +1,8 @@
1
1
  <script lang="ts">
2
2
  import { ConfirmDialog } from '@happyvertical/smrt-ui/feedback';
3
+ import { Input, Select } from '@happyvertical/smrt-ui/forms';
3
4
  import { useI18n } from '@happyvertical/smrt-ui/i18n';
5
+ import { Button } from '@happyvertical/smrt-ui/ui';
4
6
  import type { Snippet } from 'svelte';
5
7
  import { untrack } from 'svelte';
6
8
  import { M } from '../i18n.contribution.js';
@@ -151,23 +153,23 @@ function cancelDelete() {
151
153
 
152
154
  <div class="content-controls">
153
155
  <div class="search-filters">
154
- <input type="text" placeholder={t(M['content.content_list.search_placeholder'])} bind:value={searchTerm} />
155
-
156
+ <Input type="text" placeholder={t(M['content.content_list.search_placeholder'])} bind:value={searchTerm} />
157
+
156
158
  {#if !type}
157
- <select bind:value={selectedType}>
159
+ <Select bind:value={selectedType}>
158
160
  <option value="All Types">{t(M['content.content_list.all_types'])}</option>
159
161
  <option value="Articles">Articles</option>
160
162
  <option value="Documents">Documents</option>
161
163
  <option value="Mirrors">Mirrors</option>
162
- </select>
164
+ </Select>
163
165
  {/if}
164
-
165
- <select bind:value={selectedStatus}>
166
+
167
+ <Select bind:value={selectedStatus}>
166
168
  <option value="All Statuses">{t(M['content.content_list.all_statuses'])}</option>
167
169
  <option value="Published">Published</option>
168
170
  <option value="Draft">Draft</option>
169
171
  <option value="Archived">Archived</option>
170
- </select>
172
+ </Select>
171
173
 
172
174
  {#if controls}
173
175
  {@render controls()}
@@ -176,10 +178,14 @@ function cancelDelete() {
176
178
 
177
179
  <div class="actions-group">
178
180
  <div class="view-toggles">
179
- <button
181
+ <Button
182
+ variant="ghost"
183
+ size="sm"
180
184
  type="button"
181
- class:active={viewMode === 'grid'}
185
+ class={`view-toggle-btn${viewMode === 'grid' ? ' view-toggle-btn--active' : ''}`}
186
+ aria-pressed={viewMode === 'grid'}
182
187
  onclick={() => viewMode = 'grid'}
188
+ aria-label={t(M['content.content_list.grid_view'])}
183
189
  title={t(M['content.content_list.grid_view'])}
184
190
  >
185
191
  <svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2" fill="none">
@@ -188,11 +194,15 @@ function cancelDelete() {
188
194
  <rect x="14" y="14" width="7" height="7"></rect>
189
195
  <rect x="3" y="14" width="7" height="7"></rect>
190
196
  </svg>
191
- </button>
192
- <button
197
+ </Button>
198
+ <Button
199
+ variant="ghost"
200
+ size="sm"
193
201
  type="button"
194
- class:active={viewMode === 'detailed'}
202
+ class={`view-toggle-btn${viewMode === 'detailed' ? ' view-toggle-btn--active' : ''}`}
203
+ aria-pressed={viewMode === 'detailed'}
195
204
  onclick={() => viewMode = 'detailed'}
205
+ aria-label={t(M['content.content_list.detailed_list'])}
196
206
  title={t(M['content.content_list.detailed_list'])}
197
207
  >
198
208
  <svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2" fill="none">
@@ -203,11 +213,15 @@ function cancelDelete() {
203
213
  <line x1="3" y1="12" x2="3.01" y2="12"></line>
204
214
  <line x1="3" y1="18" x2="3.01" y2="18"></line>
205
215
  </svg>
206
- </button>
207
- <button
216
+ </Button>
217
+ <Button
218
+ variant="ghost"
219
+ size="sm"
208
220
  type="button"
209
- class:active={viewMode === 'compact'}
221
+ class={`view-toggle-btn${viewMode === 'compact' ? ' view-toggle-btn--active' : ''}`}
222
+ aria-pressed={viewMode === 'compact'}
210
223
  onclick={() => viewMode = 'compact'}
224
+ aria-label={t(M['content.content_list.compact_list'])}
211
225
  title={t(M['content.content_list.compact_list'])}
212
226
  >
213
227
  <svg viewBox="0 0 24 24" width="18" height="18" stroke="currentColor" stroke-width="2" fill="none">
@@ -215,16 +229,16 @@ function cancelDelete() {
215
229
  <line x1="3" y1="12" x2="21" y2="12"></line>
216
230
  <line x1="3" y1="18" x2="21" y2="18"></line>
217
231
  </svg>
218
- </button>
232
+ </Button>
219
233
  </div>
220
-
221
- <button class="add-button" type="button" onclick={() => onAdd()}>
234
+
235
+ <Button variant="ghost" class="add-button" type="button" onclick={() => onAdd()}>
222
236
  <svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2" fill="none">
223
237
  <line x1="12" y1="5" x2="12" y2="19"></line>
224
238
  <line x1="5" y1="12" x2="19" y2="12"></line>
225
239
  </svg>
226
240
  {t(M['content.content_list.add_content'])}
227
- </button>
241
+ </Button>
228
242
  </div>
229
243
  </div>
230
244
 
@@ -261,8 +275,8 @@ function cancelDelete() {
261
275
  {#if getViewHref?.(content)}
262
276
  <a class="icon-btn" href={getViewHref(content) || '#'} title={t(M['content.content_list.view_published_article'])} aria-label={t(M['content.content_list.view_published_article'])}>🔎</a>
263
277
  {/if}
264
- <button class="icon-btn" type="button" onclick={() => onEdit(content)} title={t(M['content.content_list.edit'])} aria-label={t(M['content.content_list.edit'])}>✏️</button>
265
- <button class="icon-btn delete-icon" type="button" onclick={() => handleDeleteContent(content)} title={t(M['content.content_list.delete'])} aria-label={t(M['content.content_list.delete'])}>🗑️</button>
278
+ <Button variant="ghost" size="sm" class="icon-btn" type="button" onclick={() => onEdit(content)} title={t(M['content.content_list.edit'])} aria-label={t(M['content.content_list.edit'])}>✏️</Button>
279
+ <Button variant="ghost" size="sm" class="icon-btn delete-icon" type="button" onclick={() => handleDeleteContent(content)} title={t(M['content.content_list.delete'])} aria-label={t(M['content.content_list.delete'])}>🗑️</Button>
266
280
  </td>
267
281
  </tr>
268
282
  {/each}
@@ -314,14 +328,15 @@ function cancelDelete() {
314
328
  {#if getViewHref?.(content)}
315
329
  <a href={getViewHref(content) || '#'} class="quiet-action">{t(M['content.content_list.view_article'])}</a>
316
330
  {/if}
317
- <button type="button" class="quiet-action" onclick={() => onEdit(content)}>{t(M['content.content_list.edit'])}</button>
318
- <button
331
+ <Button variant="ghost" type="button" class="quiet-action" onclick={() => onEdit(content)}>{t(M['content.content_list.edit'])}</Button>
332
+ <Button
333
+ variant="ghost"
319
334
  type="button"
320
335
  class="quiet-action quiet-action--danger"
321
336
  onclick={() => handleDeleteContent(content)}
322
337
  >
323
338
  {t(M['content.content_list.delete'])}
324
- </button>
339
+ </Button>
325
340
  </div>
326
341
  </article>
327
342
  {/each}
@@ -374,8 +389,8 @@ function cancelDelete() {
374
389
  {#if getViewHref?.(content)}
375
390
  <a href={getViewHref(content) || '#'} class="view-btn">{t(M['content.content_list.view_article_button'])}</a>
376
391
  {/if}
377
- <button onclick={() => onEdit(content)}>{t(M['content.content_list.edit'])}</button>
378
- <button onclick={() => handleDeleteContent(content)} class="delete-btn">{t(M['content.content_list.delete'])}</button>
392
+ <Button variant="ghost" type="button" class="content-action-btn" onclick={() => onEdit(content)}>{t(M['content.content_list.edit'])}</Button>
393
+ <Button variant="ghost" type="button" class="content-action-btn delete-btn" onclick={() => handleDeleteContent(content)}>{t(M['content.content_list.delete'])}</Button>
379
394
  </div>
380
395
  </div>
381
396
  </div>
@@ -425,8 +440,8 @@ function cancelDelete() {
425
440
  align-items: center;
426
441
  }
427
442
 
428
- .search-filters input,
429
- .search-filters select {
443
+ .search-filters :global(.input),
444
+ .search-filters :global(.select) {
430
445
  padding: 0.5rem 0.9rem;
431
446
  border: 1px solid var(--smrt-color-outline);
432
447
  border-radius: 0.5rem;
@@ -436,13 +451,6 @@ function cancelDelete() {
436
451
  color: var(--smrt-color-on-surface);
437
452
  }
438
453
 
439
- .search-filters input:focus,
440
- .search-filters select:focus {
441
- outline: none;
442
- border-color: var(--smrt-color-primary);
443
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--smrt-color-primary) 20%, transparent);
444
- }
445
-
446
454
  .actions-group {
447
455
  display: flex;
448
456
  gap: 0.75rem;
@@ -457,7 +465,7 @@ function cancelDelete() {
457
465
  border: 1px solid var(--smrt-color-outline-variant);
458
466
  }
459
467
 
460
- .view-toggles button {
468
+ .view-toggles :global(.view-toggle-btn) {
461
469
  background: transparent;
462
470
  border: none;
463
471
  padding: 0.4rem;
@@ -470,18 +478,18 @@ function cancelDelete() {
470
478
  transition: all 0.2s;
471
479
  }
472
480
 
473
- .view-toggles button:hover {
481
+ .view-toggles :global(.view-toggle-btn:hover) {
474
482
  color: var(--smrt-color-on-surface);
475
483
  background: color-mix(in srgb, var(--smrt-color-shadow) 5%, transparent);
476
484
  }
477
485
 
478
- .view-toggles button.active {
486
+ .view-toggles :global(.view-toggle-btn.view-toggle-btn--active) {
479
487
  background: var(--smrt-color-surface);
480
488
  color: var(--smrt-color-on-surface);
481
489
  box-shadow: var(--smrt-elevation-1, 0 1px 2px rgba(0,0,0,0.1));
482
490
  }
483
491
 
484
- .add-button {
492
+ .actions-group :global(.add-button) {
485
493
  display: flex;
486
494
  align-items: center;
487
495
  gap: 0.5rem;
@@ -500,7 +508,7 @@ function cancelDelete() {
500
508
  transition: transform 0.2s, box-shadow 0.2s;
501
509
  }
502
510
 
503
- .add-button:hover {
511
+ .actions-group :global(.add-button:hover) {
504
512
  transform: translateY(-1px);
505
513
  box-shadow: 0 4px 6px -1px color-mix(in srgb, var(--smrt-color-primary) 50%, transparent);
506
514
  }
@@ -660,7 +668,7 @@ function cancelDelete() {
660
668
  padding-top: 1rem;
661
669
  }
662
670
 
663
- .content-actions button,
671
+ .content-actions :global(.content-action-btn),
664
672
  .content-actions a {
665
673
  flex: 1;
666
674
  padding: 0.5rem 1rem;
@@ -676,7 +684,7 @@ function cancelDelete() {
676
684
  text-decoration: none;
677
685
  }
678
686
 
679
- .content-actions button:hover,
687
+ .content-actions :global(.content-action-btn:hover),
680
688
  .content-actions a:hover {
681
689
  background: var(--smrt-color-surface-variant);
682
690
  border-color: var(--smrt-color-outline);
@@ -686,11 +694,11 @@ function cancelDelete() {
686
694
  color: var(--smrt-color-primary) !important;
687
695
  }
688
696
 
689
- .delete-btn {
697
+ .content-actions :global(.delete-btn) {
690
698
  color: var(--smrt-color-error) !important;
691
699
  }
692
700
 
693
- .delete-btn:hover {
701
+ .content-actions :global(.delete-btn:hover) {
694
702
  background: var(--smrt-color-error-container) !important;
695
703
  border-color: var(--smrt-color-error) !important;
696
704
  }
@@ -754,7 +762,7 @@ function cancelDelete() {
754
762
  min-width: 8.5rem;
755
763
  }
756
764
 
757
- .quiet-action {
765
+ .content-row__actions :global(.quiet-action) {
758
766
  display: inline-flex;
759
767
  align-items: center;
760
768
  justify-content: center;
@@ -769,11 +777,11 @@ function cancelDelete() {
769
777
  cursor: pointer;
770
778
  }
771
779
 
772
- .quiet-action:hover {
780
+ .content-row__actions :global(.quiet-action:hover) {
773
781
  background: var(--smrt-color-surface-container-low);
774
782
  }
775
783
 
776
- .quiet-action--danger {
784
+ .content-row__actions :global(.quiet-action--danger) {
777
785
  color: var(--smrt-color-error);
778
786
  }
779
787
 
@@ -855,7 +863,7 @@ function cancelDelete() {
855
863
  white-space: nowrap;
856
864
  }
857
865
 
858
- .icon-btn {
866
+ .actions-cell :global(.icon-btn) {
859
867
  background: transparent;
860
868
  border: none;
861
869
  cursor: pointer;
@@ -866,12 +874,12 @@ function cancelDelete() {
866
874
  opacity: 0.7;
867
875
  }
868
876
 
869
- .icon-btn:hover {
877
+ .actions-cell :global(.icon-btn:hover) {
870
878
  background: var(--smrt-color-surface-variant);
871
879
  opacity: 1;
872
880
  }
873
881
 
874
- .delete-icon:hover {
882
+ .actions-cell :global(.delete-icon:hover) {
875
883
  background: var(--smrt-color-error-container);
876
884
  }
877
885
 
@@ -912,8 +920,8 @@ function cancelDelete() {
912
920
  width: 100%;
913
921
  }
914
922
 
915
- .search-filters input,
916
- .search-filters select,
923
+ .search-filters :global(.input),
924
+ .search-filters :global(.select),
917
925
  .add-button {
918
926
  width: 100%;
919
927
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentList.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentList.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKrC,KAAK,gBAAgB,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAClD,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,GAAG,IAAI,CAAC;CAC/C,CAAC;AA4WF,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"ContentList.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/ContentList.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKrC,KAAK,gBAAgB,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAClD,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,MAAM,GAAG,IAAI,CAAC;CAC/C,CAAC;AA8WF,QAAA,MAAM,WAAW,sDAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}