@tekkare/romulus 0.1.305 → 0.1.306
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/module.json
CHANGED
|
@@ -157,14 +157,16 @@ const T = computed(() => ({
|
|
|
157
157
|
templateHint: en.value
|
|
158
158
|
? 'Offered as a starting point on this page, without being shared.'
|
|
159
159
|
: 'Offert comme point de depart sur cette page, sans etre partage.',
|
|
160
|
-
workspaceSearch: en.value ? 'Search for a workspace' : 'Chercher un espace',
|
|
161
160
|
noWorkspace: en.value ? 'No workspace to offer it to.' : 'Aucun espace a qui l\'offrir.',
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
templateSearch: en.value
|
|
162
|
+
? 'Search for a workspace or a person'
|
|
163
|
+
: 'Chercher un espace ou une personne',
|
|
164
|
+
templateHintTargets: en.value
|
|
165
|
+
? 'A person sees it whatever their workspace. It stays a template, not a shared view.'
|
|
166
|
+
: 'Une personne le voit quel que soit son espace. Il reste un template, pas une vue partagee.',
|
|
167
|
+
templatePicked: en.value ? 'Picked' : 'Retenus',
|
|
168
|
+
kindWorkspace: en.value ? 'Workspace' : 'Espace',
|
|
169
|
+
kindPerson: en.value ? 'Person' : 'Personne',
|
|
168
170
|
allWorkspaces: en.value
|
|
169
171
|
? 'No workspace or person picked: every workspace is offered the template.'
|
|
170
172
|
: 'Aucun espace ni personne retenus : le template est offert a tous les espaces.',
|
|
@@ -192,10 +194,10 @@ const scope = ref<RmShareScope>('private')
|
|
|
192
194
|
const picked = ref<string[]>([])
|
|
193
195
|
const search = ref('')
|
|
194
196
|
const pickedWorkspaces = ref<string[]>([])
|
|
195
|
-
const workspaceSearch = ref('')
|
|
196
197
|
/** Personnes visees par le modele, gardees avec leur nom pour les etiquettes. */
|
|
197
198
|
const pickedPeople = ref<RmShareMember[]>([])
|
|
198
|
-
|
|
199
|
+
/** Une seule recherche pour le modele : espaces et personnes, dans une liste. */
|
|
200
|
+
const templateSearch = ref('')
|
|
199
201
|
|
|
200
202
|
/**
|
|
201
203
|
* L'etat ouvert fait foi : le dialogue se recharge a chaque ouverture, jamais
|
|
@@ -216,15 +218,14 @@ watch(
|
|
|
216
218
|
? 'people'
|
|
217
219
|
: 'private'
|
|
218
220
|
search.value = ''
|
|
219
|
-
|
|
220
|
-
peopleSearch.value = ''
|
|
221
|
+
templateSearch.value = ''
|
|
221
222
|
},
|
|
222
223
|
{ immediate: true },
|
|
223
224
|
)
|
|
224
225
|
|
|
225
226
|
watch(search, value => emit('search', value.trim()))
|
|
226
227
|
// Meme recherche cote appelant : il complete `members` avec la plateforme.
|
|
227
|
-
watch(
|
|
228
|
+
watch(templateSearch, value => emit('search', value.trim()))
|
|
228
229
|
|
|
229
230
|
const matches = computed(() => {
|
|
230
231
|
const q = search.value.trim().toLowerCase()
|
|
@@ -243,11 +244,6 @@ function toggle(userId: string) {
|
|
|
243
244
|
picked.value = [...next]
|
|
244
245
|
}
|
|
245
246
|
|
|
246
|
-
const workspaceMatches = computed(() => {
|
|
247
|
-
const q = workspaceSearch.value.trim().toLowerCase()
|
|
248
|
-
if (!q) return props.workspaces
|
|
249
|
-
return props.workspaces.filter(ws => ws.name.toLowerCase().includes(q))
|
|
250
|
-
})
|
|
251
247
|
|
|
252
248
|
function toggleWorkspace(workspaceId: string) {
|
|
253
249
|
const next = new Set(pickedWorkspaces.value)
|
|
@@ -256,21 +252,66 @@ function toggleWorkspace(workspaceId: string) {
|
|
|
256
252
|
pickedWorkspaces.value = [...next]
|
|
257
253
|
}
|
|
258
254
|
|
|
255
|
+
type TemplateRow = {
|
|
256
|
+
key: string
|
|
257
|
+
label: string
|
|
258
|
+
description: string
|
|
259
|
+
checked: boolean
|
|
260
|
+
toggle: () => void
|
|
261
|
+
}
|
|
262
|
+
|
|
259
263
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
264
|
+
* La liste unique du modele : les espaces d'abord, puis les personnes.
|
|
265
|
+
*
|
|
266
|
+
* Sans recherche, seuls les espaces s'affichent : ils tiennent dans une
|
|
267
|
+
* liste, la plateforme entiere non, et les membres de l'espace de
|
|
268
|
+
* l'administrateur n'ont rien a faire la par defaut. Chaque ligne dit ce
|
|
269
|
+
* qu'elle est (« Espace » ou « Personne ») : une case ne le dit pas seule.
|
|
263
270
|
*/
|
|
264
|
-
const
|
|
265
|
-
const q =
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
const templateRows = computed<TemplateRow[]>(() => {
|
|
272
|
+
const q = templateSearch.value.trim().toLowerCase()
|
|
273
|
+
const workspaces = (q
|
|
274
|
+
? props.workspaces.filter(ws => ws.name.toLowerCase().includes(q))
|
|
275
|
+
: props.workspaces
|
|
276
|
+
).map(ws => ({
|
|
277
|
+
key: `ws:${ws.workspaceId}`,
|
|
278
|
+
label: ws.name,
|
|
279
|
+
description: [T.value.kindWorkspace, ws.tier].filter(Boolean).join(' · '),
|
|
280
|
+
checked: pickedWorkspaces.value.includes(ws.workspaceId),
|
|
281
|
+
toggle: () => toggleWorkspace(ws.workspaceId),
|
|
282
|
+
}))
|
|
283
|
+
const people = (q
|
|
284
|
+
? props.members.filter(
|
|
285
|
+
m => m.name.toLowerCase().includes(q) || (m.email ?? '').toLowerCase().includes(q),
|
|
286
|
+
)
|
|
287
|
+
: []
|
|
288
|
+
).map(m => ({
|
|
289
|
+
key: `user:${m.userId}`,
|
|
290
|
+
label: m.name,
|
|
291
|
+
description: [T.value.kindPerson, m.email, m.hint].filter(Boolean).join(' · '),
|
|
292
|
+
checked: pickedPeople.value.some(p => p.userId === m.userId),
|
|
293
|
+
toggle: () => togglePerson(m),
|
|
294
|
+
}))
|
|
295
|
+
return [...workspaces, ...people]
|
|
272
296
|
})
|
|
273
297
|
|
|
298
|
+
/** Ce qui est retenu, en etiquettes : les personnes trouvees par recherche
|
|
299
|
+
* sortent de la liste des que la recherche change. */
|
|
300
|
+
const templateTags = computed(() => [
|
|
301
|
+
...pickedWorkspaces.value.map(id => ({
|
|
302
|
+
key: `ws:${id}`,
|
|
303
|
+
icon: 'Buildings',
|
|
304
|
+
label: props.workspaces.find(ws => ws.workspaceId === id)?.name ?? id,
|
|
305
|
+
remove: () => toggleWorkspace(id),
|
|
306
|
+
})),
|
|
307
|
+
...pickedPeople.value.map(person => ({
|
|
308
|
+
key: `user:${person.userId}`,
|
|
309
|
+
icon: 'User',
|
|
310
|
+
label: person.name,
|
|
311
|
+
remove: () => togglePerson(person),
|
|
312
|
+
})),
|
|
313
|
+
])
|
|
314
|
+
|
|
274
315
|
function togglePerson(member: RmShareMember) {
|
|
275
316
|
pickedPeople.value = pickedPeople.value.some(p => p.userId === member.userId)
|
|
276
317
|
? pickedPeople.value.filter(p => p.userId !== member.userId)
|
|
@@ -404,46 +445,19 @@ const scopes = computed<Array<{ key: RmShareScope; icon: string; label: string;
|
|
|
404
445
|
|
|
405
446
|
<!--
|
|
406
447
|
Meme forme que la liste des personnes : une recherche, des cases, un
|
|
407
|
-
compte.
|
|
408
|
-
|
|
409
|
-
|
|
448
|
+
compte. Espaces et personnes partagent la recherche et la liste ; ce
|
|
449
|
+
qui est retenu reste visible en etiquettes au-dessus. Aucun choix ne
|
|
450
|
+
veut pas dire « personne » mais « tous », et c'est dit a l'ecran.
|
|
410
451
|
-->
|
|
411
452
|
<div v-show="scope === 'template'" class="rm-share__people">
|
|
412
453
|
<p v-if="templateNote" class="rm-share__note">{{ templateNote }}</p>
|
|
454
|
+
<p class="rm-share__scope-hint">{{ T.templateHintTargets }}</p>
|
|
413
455
|
|
|
414
|
-
<
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
v-model="workspaceSearch"
|
|
420
|
-
type="search"
|
|
421
|
-
:placeholder="T.workspaceSearch"
|
|
422
|
-
:aria-label="T.workspaceSearch"
|
|
423
|
-
>
|
|
424
|
-
</label>
|
|
425
|
-
|
|
426
|
-
<p v-if="!workspaces.length" class="rm-share__empty">{{ T.noWorkspace }}</p>
|
|
427
|
-
<p v-else-if="!workspaceMatches.length" class="rm-share__empty">{{ T.noMatch }}</p>
|
|
428
|
-
|
|
429
|
-
<ul v-else class="rm-share__list">
|
|
430
|
-
<li v-for="ws in workspaceMatches" :key="ws.workspaceId">
|
|
431
|
-
<RmCheckbox
|
|
432
|
-
:model-value="pickedWorkspaces.includes(ws.workspaceId)"
|
|
433
|
-
:label="ws.name"
|
|
434
|
-
:description="ws.tier"
|
|
435
|
-
@update:model-value="toggleWorkspace(ws.workspaceId)"
|
|
436
|
-
/>
|
|
437
|
-
</li>
|
|
438
|
-
</ul>
|
|
439
|
-
|
|
440
|
-
<h3 class="rm-share__section">{{ T.templatePeople }}</h3>
|
|
441
|
-
<p class="rm-share__scope-hint">{{ T.templatePeopleHint }}</p>
|
|
442
|
-
|
|
443
|
-
<ul v-if="pickedPeople.length" class="rm-share__tags" :aria-label="T.templatePeople">
|
|
444
|
-
<li v-for="person in pickedPeople" :key="person.userId">
|
|
445
|
-
<RmTag variant="gray" closable @close="togglePerson(person)">
|
|
446
|
-
{{ person.name }}
|
|
456
|
+
<ul v-if="templateTags.length" class="rm-share__tags" :aria-label="T.templatePicked">
|
|
457
|
+
<li v-for="tag in templateTags" :key="tag.key">
|
|
458
|
+
<RmTag variant="gray" closable @close="tag.remove()">
|
|
459
|
+
<RmIcon :name="tag.icon" :size="12" />
|
|
460
|
+
{{ tag.label }}
|
|
447
461
|
</RmTag>
|
|
448
462
|
</li>
|
|
449
463
|
</ul>
|
|
@@ -451,24 +465,25 @@ const scopes = computed<Array<{ key: RmShareScope; icon: string; label: string;
|
|
|
451
465
|
<label class="rm-share__search">
|
|
452
466
|
<RmIcon name="MagnifyingGlass" :size="16" />
|
|
453
467
|
<input
|
|
454
|
-
v-model="
|
|
468
|
+
v-model="templateSearch"
|
|
455
469
|
type="search"
|
|
456
|
-
:placeholder="T.
|
|
457
|
-
:aria-label="T.
|
|
470
|
+
:placeholder="T.templateSearch"
|
|
471
|
+
:aria-label="T.templateSearch"
|
|
458
472
|
>
|
|
459
473
|
</label>
|
|
460
474
|
|
|
461
|
-
<p v-if="
|
|
462
|
-
{{ T.
|
|
475
|
+
<p v-if="!templateSearch.trim() && !workspaces.length" class="rm-share__empty">
|
|
476
|
+
{{ T.noWorkspace }}
|
|
463
477
|
</p>
|
|
478
|
+
<p v-else-if="!templateRows.length" class="rm-share__empty">{{ T.noMatch }}</p>
|
|
464
479
|
|
|
465
|
-
<ul v-else
|
|
466
|
-
<li v-for="
|
|
480
|
+
<ul v-else class="rm-share__list">
|
|
481
|
+
<li v-for="row in templateRows" :key="row.key">
|
|
467
482
|
<RmCheckbox
|
|
468
|
-
:model-value="
|
|
469
|
-
:label="
|
|
470
|
-
:description="
|
|
471
|
-
@update:model-value="
|
|
483
|
+
:model-value="row.checked"
|
|
484
|
+
:label="row.label"
|
|
485
|
+
:description="row.description"
|
|
486
|
+
@update:model-value="row.toggle()"
|
|
472
487
|
/>
|
|
473
488
|
</li>
|
|
474
489
|
</ul>
|
|
@@ -497,5 +512,5 @@ const scopes = computed<Array<{ key: RmShareScope; icon: string; label: string;
|
|
|
497
512
|
</template>
|
|
498
513
|
|
|
499
514
|
<style scoped>
|
|
500
|
-
.rm-share,.rm-share :where(*){box-sizing:border-box}.rm-share{display:flex;flex-direction:column;gap:var(--space-16)}.rm-share__note{background:var(--bg-surface-2);border:1px solid var(--border-soft);border-radius:var(--radius-md);color:var(--text-secondary);font-size:var(--font-12);padding:var(--space-8) var(--space-10)}.rm-share__head{display:flex;flex-direction:column;gap:var(--space-4)}.rm-share__title{color:var(--text-primary);font-size:var(--font-16);font-weight:var(--weight-bold)}.rm-share__subject{color:var(--text-secondary);font-size:var(--font-13)}.rm-share__scopes{display:flex;flex-direction:column;gap:var(--space-8);list-style:none;margin:0;padding:0}.rm-share__scope{align-items:flex-start;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-lg);color:var(--text-primary);cursor:pointer;display:flex;gap:var(--space-10);padding:var(--space-10) var(--space-12);text-align:left;width:100%}.rm-share__scope:hover{background:var(--bg-hover)}.rm-share__radio{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap}.rm-share__scope:has(.rm-share__radio:focus-visible){outline:2px solid var(--color-secondary);outline-offset:2px}.rm-share__scope.is-on{background:var(--bg-hover);border-color:var(--color-secondary)}.rm-share__scope-text{display:flex;flex:1;flex-direction:column;gap:2px}.rm-share__scope-label{font-size:var(--font-13);font-weight:var(--weight-medium)}.rm-share__scope-hint{color:var(--text-secondary);font-size:var(--font-12)}.rm-share__scope-mark{color:var(--color-secondary)}.rm-share__people{display:flex;flex-direction:column;gap:var(--space-8)}.rm-share__search{align-items:center;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-pill);color:var(--text-muted);display:flex;gap:var(--space-8);padding:var(--space-6) var(--space-10)}.rm-share__search input{background:none;border:none;color:var(--text-primary);flex:1;font-size:var(--font-13);outline:none}.rm-share__list{
|
|
515
|
+
.rm-share,.rm-share :where(*){box-sizing:border-box}.rm-share{display:flex;flex-direction:column;gap:var(--space-16)}.rm-share__note{background:var(--bg-surface-2);border:1px solid var(--border-soft);border-radius:var(--radius-md);color:var(--text-secondary);font-size:var(--font-12);padding:var(--space-8) var(--space-10)}.rm-share__head{display:flex;flex-direction:column;gap:var(--space-4)}.rm-share__title{color:var(--text-primary);font-size:var(--font-16);font-weight:var(--weight-bold)}.rm-share__subject{color:var(--text-secondary);font-size:var(--font-13)}.rm-share__scopes{display:flex;flex-direction:column;gap:var(--space-8);list-style:none;margin:0;padding:0}.rm-share__scope{align-items:flex-start;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-lg);color:var(--text-primary);cursor:pointer;display:flex;gap:var(--space-10);padding:var(--space-10) var(--space-12);text-align:left;width:100%}.rm-share__scope:hover{background:var(--bg-hover)}.rm-share__radio{border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);white-space:nowrap}.rm-share__scope:has(.rm-share__radio:focus-visible){outline:2px solid var(--color-secondary);outline-offset:2px}.rm-share__scope.is-on{background:var(--bg-hover);border-color:var(--color-secondary)}.rm-share__scope-text{display:flex;flex:1;flex-direction:column;gap:2px}.rm-share__scope-label{font-size:var(--font-13);font-weight:var(--weight-medium)}.rm-share__scope-hint{color:var(--text-secondary);font-size:var(--font-12)}.rm-share__scope-mark{color:var(--color-secondary)}.rm-share__people{display:flex;flex-direction:column;gap:var(--space-8)}.rm-share__search{align-items:center;background:var(--bg-surface);border:1px solid var(--border-soft);border-radius:var(--radius-pill);color:var(--text-muted);display:flex;gap:var(--space-8);padding:var(--space-6) var(--space-10)}.rm-share__search input{background:none;border:none;color:var(--text-primary);flex:1;font-size:var(--font-13);outline:none}.rm-share__list{flex-direction:column;gap:2px}.rm-share__list,.rm-share__tags{display:flex;list-style:none;margin:0;padding:0}.rm-share__tags{flex-wrap:wrap;gap:var(--space-6)}.rm-share__count,.rm-share__empty{color:var(--text-secondary);font-size:var(--font-12)}.rm-share__foot{display:flex;gap:var(--space-8);justify-content:flex-end}
|
|
501
516
|
</style>
|