@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.13 → 0.1.15

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.
@@ -231,7 +231,16 @@ declare const _default: {
231
231
  "037": "تعذّر قبول السؤال",
232
232
  "038": "تعذّرت الموافقة على المحتوى",
233
233
  "041": "فشلت إضافة السؤال إلى مجموعة الأسئلة. يرجى المحاولة مجدداً.",
234
- "042": "يرجى ملء تفاصيل السؤال الصحيحة."
234
+ "042": "يرجى ملء تفاصيل السؤال الصحيحة.",
235
+ "selectSection": "اختر قسمًا لإضافة السؤال إليه",
236
+ "sectionNotSaved": "احفظ هذا القسم قبل إضافة أسئلة إليه",
237
+ "alreadyInSet": "هذا السؤال موجود بالفعل في المجموعة",
238
+ "maxDepth": "لا يمكن الإضافة هنا — تم بلوغ الحد الأقصى للعمق",
239
+ "attachFailed": "تعذّرت إضافة هذا السؤال — يرجى المحاولة مرة أخرى",
240
+ "copyFailed": "تعذّر نسخ هذا السؤال — يرجى المحاولة مرة أخرى",
241
+ "copyPublishFailed": "تم النسخ، ولكن تعذّر النشر — سيبقى مسودة.",
242
+ "republishFailed": "تم حفظ السؤال، ولكن تعذّر نشره — سيبقى هذا التعديل مخفيًا حتى تتم إعادة نشره.",
243
+ "publishFailed": "تم إنشاء السؤال، ولكن تعذّر نشره — سيبقى مسودة ولن يظهر في المكتبة حتى يتم نشره."
235
244
  },
236
245
  "success": {
237
246
  "001": "تم حفظ المحتوى",
@@ -246,7 +255,9 @@ declare const _default: {
246
255
  "038": "تمت الموافقة على المحتوى بنجاح",
247
256
  "039": "تم رفض المحتوى بنجاح",
248
257
  "040": "تم إعادة المحتوى للتصحيح",
249
- "043": "تم حفظ التعليق بنجاح"
258
+ "043": "تم حفظ التعليق بنجاح",
259
+ "questionAdded": "تمت إضافة \"{NAME}\"",
260
+ "questionCopied": "تم نسخ \"{NAME}\""
250
261
  }
251
262
  },
252
263
  "categoryLabels": {
@@ -289,7 +300,7 @@ declare const _default: {
289
300
  "reviewerFeedback": "ملاحظات المراجع",
290
301
  "unsavedQuestion": "سؤال غير محفوظ",
291
302
  "hierarchy": "الهيكل",
292
- "addQuestion": "إضافة سؤال",
303
+ "createQuestion": "إنشاء سؤال",
293
304
  "addSection": "إضافة قسم",
294
305
  "typeMcq": "اختيار من متعدد",
295
306
  "typeMcqDesc": "اختر إجابة صحيحة واحدة من القائمة",
@@ -356,6 +367,8 @@ declare const _default: {
356
367
  "sectionDetails": "تفاصيل القسم",
357
368
  "sectionDetailsSub": "عنوان هذا القسم وتعليماته.",
358
369
  "targetAudience": "الفئة المستهدفة",
370
+ "framework": "الإطار",
371
+ "selectFramework": "اختر الإطار",
359
372
  "targetAudienceSub": "مواءمة المنهج للمتعلمين المستهدفين.",
360
373
  "behaviourScoring": "السلوك والتقييم",
361
374
  "behaviourScoringSub": "كيفية توقيت المجموعة ومحاولاتها وتلخيصها.",
@@ -415,7 +428,27 @@ declare const _default: {
415
428
  "subscript": "منخفض",
416
429
  "superscript": "مرتفع",
417
430
  "questionSet": "مجموعة الأسئلة",
418
- "agreeTerms": "أوافق على الشروط والأحكام وسياسة المحتوى"
431
+ "agreeTerms": "أوافق على الشروط والأحكام وسياسة المحتوى",
432
+ "questionLibrary": "مكتبة الأسئلة",
433
+ "collapseLibraryPanel": "طيّ لوحة المكتبة",
434
+ "searchLibrary": "البحث في المكتبة…",
435
+ "clearSearch": "مسح البحث",
436
+ "filterByQuestionType": "التصفية حسب نوع السؤال",
437
+ "questionList": "قائمة الأسئلة",
438
+ "loadingQuestions": "جارٍ تحميل الأسئلة…",
439
+ "noQuestionsFound": "لم يتم العثور على أسئلة. جرّب بحثًا مختلفًا.",
440
+ "untitledQuestion": "سؤال بدون عنوان",
441
+ "addToQuestionSet": "إضافة إلى مجموعة الأسئلة",
442
+ "copyQuestion": "نسخ إلى هذا القسم",
443
+ "loadMoreQuestions": "تحميل المزيد من الأسئلة",
444
+ "loading": "جارٍ التحميل…",
445
+ "loadMore": "تحميل المزيد",
446
+ "filterAll": "الكل",
447
+ "filterMatch": "مطابقة",
448
+ "sortAZ": "الترتيب أبجديًا (أ–ي)",
449
+ "sortByRecent": "التبديل إلى الأحدث أولاً",
450
+ "sortAZLabel": "أ–ي",
451
+ "hasRequiredFields": "يحتوي على حقول مطلوبة"
419
452
  }
420
453
  };
421
454
 
@@ -231,7 +231,16 @@ declare const _default: {
231
231
  "037": "Impossible d'accepter la question",
232
232
  "038": "Impossible d'approuver le contenu",
233
233
  "041": "L'ajout de la question à l'ensemble a échoué. Veuillez réessayer.",
234
- "042": "Veuillez remplir les détails valides de la question."
234
+ "042": "Veuillez remplir les détails valides de la question.",
235
+ "selectSection": "Sélectionnez une section pour y ajouter la question",
236
+ "sectionNotSaved": "Enregistrez cette section avant d'y ajouter des questions",
237
+ "alreadyInSet": "Cette question figure déjà dans l'ensemble",
238
+ "maxDepth": "Impossible d'ajouter ici — profondeur maximale atteinte",
239
+ "attachFailed": "Impossible d'ajouter cette question — veuillez réessayer",
240
+ "copyFailed": "Impossible de copier cette question — veuillez réessayer",
241
+ "copyPublishFailed": "Copiée, mais impossible de la publier — elle reste en brouillon.",
242
+ "republishFailed": "Question enregistrée, mais impossible de la publier — cette modification reste masquée tant qu'elle n'est pas republiée.",
243
+ "publishFailed": "Question créée, mais impossible de la publier — elle reste en brouillon et n'apparaîtra pas dans la bibliothèque tant qu'elle n'est pas publiée."
235
244
  },
236
245
  "success": {
237
246
  "001": "Contenu sauvegardé",
@@ -246,7 +255,9 @@ declare const _default: {
246
255
  "038": "Contenu approuvé avec succès",
247
256
  "039": "Contenu rejeté avec succès",
248
257
  "040": "Contenu renvoyé pour corrections",
249
- "043": "Commentaire enregistré avec succès"
258
+ "043": "Commentaire enregistré avec succès",
259
+ "questionAdded": "« {NAME} » ajoutée",
260
+ "questionCopied": "« {NAME} » copiée"
250
261
  }
251
262
  },
252
263
  "ui": {
@@ -280,7 +291,7 @@ declare const _default: {
280
291
  "reviewerFeedback": "Commentaires du réviseur",
281
292
  "unsavedQuestion": "Question non enregistrée",
282
293
  "hierarchy": "Hiérarchie",
283
- "addQuestion": "Ajouter une question",
294
+ "createQuestion": "Créer une question",
284
295
  "addSection": "Ajouter une section",
285
296
  "typeMcq": "Choix multiple",
286
297
  "typeMcqDesc": "Choisissez une option correcte dans une liste",
@@ -347,6 +358,8 @@ declare const _default: {
347
358
  "sectionDetails": "Détails de la section",
348
359
  "sectionDetailsSub": "Titre et instructions pour cette section.",
349
360
  "targetAudience": "Public cible",
361
+ "framework": "Référentiel",
362
+ "selectFramework": "Sélectionner un référentiel",
350
363
  "targetAudienceSub": "Alignement du programme pour les apprenants visés.",
351
364
  "behaviourScoring": "Comportement et notation",
352
365
  "behaviourScoringSub": "Comment l'ensemble est chronométré, tenté et résumé.",
@@ -406,7 +419,27 @@ declare const _default: {
406
419
  "subscript": "Indice",
407
420
  "superscript": "Exposant",
408
421
  "questionSet": "Ensemble de questions",
409
- "agreeTerms": "J'accepte les Conditions d'utilisation et la Politique de contenu"
422
+ "agreeTerms": "J'accepte les Conditions d'utilisation et la Politique de contenu",
423
+ "questionLibrary": "Bibliothèque de questions",
424
+ "collapseLibraryPanel": "Réduire le panneau de la bibliothèque",
425
+ "searchLibrary": "Rechercher dans la bibliothèque…",
426
+ "clearSearch": "Effacer la recherche",
427
+ "filterByQuestionType": "Filtrer par type de question",
428
+ "questionList": "Liste des questions",
429
+ "loadingQuestions": "Chargement des questions…",
430
+ "noQuestionsFound": "Aucune question trouvée. Essayez une autre recherche.",
431
+ "untitledQuestion": "Question sans titre",
432
+ "addToQuestionSet": "Ajouter à l'ensemble de questions",
433
+ "copyQuestion": "Copier dans cette section",
434
+ "loadMoreQuestions": "Charger plus de questions",
435
+ "loading": "Chargement…",
436
+ "loadMore": "Charger plus",
437
+ "filterAll": "Tous",
438
+ "filterMatch": "Correspondance",
439
+ "sortAZ": "Trier de A à Z",
440
+ "sortByRecent": "Passer aux plus récentes",
441
+ "sortAZLabel": "A–Z",
442
+ "hasRequiredFields": "Contient des champs obligatoires"
410
443
  },
411
444
  "categoryLabels": {
412
445
  "Multiselect Multiple Choice Question": "Question à choix multiple",
@@ -246,7 +246,16 @@ declare const _default: {
246
246
  "037": "Unable to accepted question",
247
247
  "038": "Unable to approve content",
248
248
  "041": "Adding question to questionset failed. Please try again.",
249
- "042": "Please fill valid question details."
249
+ "042": "Please fill valid question details.",
250
+ "selectSection": "Select a section to add the question to",
251
+ "sectionNotSaved": "Save this section before adding questions to it",
252
+ "alreadyInSet": "This question is already in the set",
253
+ "maxDepth": "Cannot add here — maximum depth reached",
254
+ "attachFailed": "Could not add this question — please try again",
255
+ "copyFailed": "Could not copy this question — please try again",
256
+ "copyPublishFailed": "Copied, but could not be published — it stays a Draft.",
257
+ "republishFailed": "Question saved, but could not be published — this edit stays hidden until it's republished.",
258
+ "publishFailed": "Question created, but could not be published — it stays a Draft and won't show up in the Library until published."
250
259
  },
251
260
  "success": {
252
261
  "001": "Content is saved",
@@ -261,7 +270,9 @@ declare const _default: {
261
270
  "038": "Content is successfully approved",
262
271
  "039": "Content is successfully rejected",
263
272
  "040": "Content sent back for corrections",
264
- "043": "Comment saved successfully"
273
+ "043": "Comment saved successfully",
274
+ "questionAdded": "\"{NAME}\" added",
275
+ "questionCopied": "\"{NAME}\" copied"
265
276
  }
266
277
  },
267
278
  "categoryLabels": {
@@ -298,7 +309,7 @@ declare const _default: {
298
309
  "reviewerFeedback": "Reviewer feedback",
299
310
  "unsavedQuestion": "Unsaved question",
300
311
  "hierarchy": "Hierarchy",
301
- "addQuestion": "Add Question",
312
+ "createQuestion": "Create Question",
302
313
  "addSection": "Add Section",
303
314
  "typeMcq": "Multiple Choice",
304
315
  "typeMcqDesc": "Pick one correct option from a list",
@@ -365,6 +376,8 @@ declare const _default: {
365
376
  "sectionDetails": "Section Details",
366
377
  "sectionDetailsSub": "Title and instructions for this section.",
367
378
  "targetAudience": "Target Audience",
379
+ "framework": "Framework",
380
+ "selectFramework": "Select framework",
368
381
  "targetAudienceSub": "Curriculum alignment for the intended learners.",
369
382
  "behaviourScoring": "Behaviour & Scoring",
370
383
  "behaviourScoringSub": "How the set is timed, attempted and summarised.",
@@ -424,7 +437,27 @@ declare const _default: {
424
437
  "subscript": "Subscript",
425
438
  "superscript": "Superscript",
426
439
  "questionSet": "Question Set",
427
- "agreeTerms": "I agree to the Terms & Conditions and Content Policy"
440
+ "agreeTerms": "I agree to the Terms & Conditions and Content Policy",
441
+ "questionLibrary": "Question Library",
442
+ "collapseLibraryPanel": "Collapse library panel",
443
+ "searchLibrary": "Search library…",
444
+ "clearSearch": "Clear search",
445
+ "filterByQuestionType": "Filter by question type",
446
+ "questionList": "Question list",
447
+ "loadingQuestions": "Loading questions…",
448
+ "noQuestionsFound": "No questions found. Try a different search.",
449
+ "untitledQuestion": "Untitled Question",
450
+ "addToQuestionSet": "Add to question set",
451
+ "copyQuestion": "Copy to this section",
452
+ "loadMoreQuestions": "Load more questions",
453
+ "loading": "Loading…",
454
+ "loadMore": "Load more",
455
+ "filterAll": "All",
456
+ "filterMatch": "Match",
457
+ "sortAZ": "Sort A–Z",
458
+ "sortByRecent": "Switch to most recent first",
459
+ "sortAZLabel": "A–Z",
460
+ "hasRequiredFields": "Has required fields"
428
461
  }
429
462
  };
430
463
 
@@ -231,7 +231,16 @@ declare const _default: {
231
231
  "037": "Não foi possível aceitar a pergunta",
232
232
  "038": "Não foi possível aprovar o conteúdo",
233
233
  "041": "Falha ao adicionar a pergunta ao conjunto. Tente novamente.",
234
- "042": "Preencha os detalhes válidos da pergunta."
234
+ "042": "Preencha os detalhes válidos da pergunta.",
235
+ "selectSection": "Selecione uma seção para adicionar a pergunta",
236
+ "sectionNotSaved": "Salve esta seção antes de adicionar perguntas a ela",
237
+ "alreadyInSet": "Esta pergunta já está no conjunto",
238
+ "maxDepth": "Não é possível adicionar aqui — profundidade máxima atingida",
239
+ "attachFailed": "Não foi possível adicionar esta pergunta — tente novamente",
240
+ "copyFailed": "Não foi possível copiar esta pergunta — tente novamente",
241
+ "copyPublishFailed": "Copiada, mas não foi possível publicá-la — permanece como rascunho.",
242
+ "republishFailed": "Pergunta salva, mas não foi possível publicá-la — esta edição ficará oculta até ser republicada.",
243
+ "publishFailed": "Pergunta criada, mas não foi possível publicá-la — ela permanece como rascunho e não aparecerá na Biblioteca até ser publicada."
235
244
  },
236
245
  "success": {
237
246
  "001": "Conteúdo salvo",
@@ -246,7 +255,9 @@ declare const _default: {
246
255
  "038": "Conteúdo aprovado com sucesso",
247
256
  "039": "Conteúdo rejeitado com sucesso",
248
257
  "040": "Conteúdo devolvido para correções",
249
- "043": "Comentário salvo com sucesso"
258
+ "043": "Comentário salvo com sucesso",
259
+ "questionAdded": "\"{NAME}\" adicionada",
260
+ "questionCopied": "\"{NAME}\" copiada"
250
261
  }
251
262
  },
252
263
  "ui": {
@@ -280,7 +291,7 @@ declare const _default: {
280
291
  "reviewerFeedback": "Feedback do revisor",
281
292
  "unsavedQuestion": "Questão não salva",
282
293
  "hierarchy": "Hierarquia",
283
- "addQuestion": "Adicionar questão",
294
+ "createQuestion": "Criar questão",
284
295
  "addSection": "Adicionar seção",
285
296
  "typeMcq": "Múltipla escolha",
286
297
  "typeMcqDesc": "Escolha uma opção correta em uma lista",
@@ -347,6 +358,8 @@ declare const _default: {
347
358
  "sectionDetails": "Detalhes da seção",
348
359
  "sectionDetailsSub": "Título e instruções para esta seção.",
349
360
  "targetAudience": "Público-alvo",
361
+ "framework": "Estrutura curricular",
362
+ "selectFramework": "Selecionar estrutura curricular",
350
363
  "targetAudienceSub": "Alinhamento curricular para os alunos pretendidos.",
351
364
  "behaviourScoring": "Comportamento e pontuação",
352
365
  "behaviourScoringSub": "Como o conjunto é cronometrado, tentado e resumido.",
@@ -406,7 +419,27 @@ declare const _default: {
406
419
  "subscript": "Subscrito",
407
420
  "superscript": "Sobrescrito",
408
421
  "questionSet": "Conjunto de questões",
409
- "agreeTerms": "Concordo com os Termos e Condições e a Política de Conteúdo"
422
+ "agreeTerms": "Concordo com os Termos e Condições e a Política de Conteúdo",
423
+ "questionLibrary": "Biblioteca de Perguntas",
424
+ "collapseLibraryPanel": "Recolher o painel da biblioteca",
425
+ "searchLibrary": "Pesquisar na biblioteca…",
426
+ "clearSearch": "Limpar pesquisa",
427
+ "filterByQuestionType": "Filtrar por tipo de pergunta",
428
+ "questionList": "Lista de perguntas",
429
+ "loadingQuestions": "Carregando perguntas…",
430
+ "noQuestionsFound": "Nenhuma pergunta encontrada. Tente outra pesquisa.",
431
+ "untitledQuestion": "Pergunta sem título",
432
+ "addToQuestionSet": "Adicionar ao conjunto de perguntas",
433
+ "copyQuestion": "Copiar para esta seção",
434
+ "loadMoreQuestions": "Carregar mais perguntas",
435
+ "loading": "Carregando…",
436
+ "loadMore": "Carregar mais",
437
+ "filterAll": "Todos",
438
+ "filterMatch": "Associação",
439
+ "sortAZ": "Ordenar de A a Z",
440
+ "sortByRecent": "Mudar para mais recentes primeiro",
441
+ "sortAZLabel": "A–Z",
442
+ "hasRequiredFields": "Contém campos obrigatórios"
410
443
  },
411
444
  "categoryLabels": {
412
445
  "Multiselect Multiple Choice Question": "Pergunta de Múltipla Escolha",
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Tracks question identifiers created via the Library sidebar's "Copy"
3
+ * action. A copy is a fully independent, visibility:"Default" question
4
+ * (so its own future edits stay isolated — see question-edit-isolation-
5
+ * options.md), but it's meant to be private to whichever questionset it
6
+ * was copied into, not independently discoverable/reusable like a normal
7
+ * Library question. There's no backend field to key this off (visibility
8
+ * can't distinguish a copy from an original, since both are "Default"),
9
+ * so this is a lightweight, localStorage-persisted client-side registry:
10
+ * - useLibrary.ts filters copies out of search results.
11
+ * - QuestionDetail.tsx only offers "Open in editor" for a copy.
12
+ */
13
+ interface CopyRegistryState {
14
+ copiedIds: Record<string, true>;
15
+ markAsCopy: (identifier: string) => void;
16
+ isCopy: (identifier: string) => boolean;
17
+ }
18
+ export declare const useCopyRegistryStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CopyRegistryState>, "persist"> & {
19
+ persist: {
20
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CopyRegistryState, CopyRegistryState>>) => void;
21
+ clearStorage: () => void;
22
+ rehydrate: () => Promise<void> | void;
23
+ hasHydrated: () => boolean;
24
+ onHydrate: (fn: (state: CopyRegistryState) => void) => () => void;
25
+ onFinishHydration: (fn: (state: CopyRegistryState) => void) => () => void;
26
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CopyRegistryState, CopyRegistryState>>;
27
+ };
28
+ }>;
29
+ export {};
@@ -35,6 +35,15 @@ interface EditorState {
35
35
  /** Channel read data (defaultLicense, frameworks, primaryCategories). */
36
36
  channelData: Record<string, unknown> | null;
37
37
  setChannelData: (data: Record<string, unknown> | null) => void;
38
+ /** Live override for which framework's terms populate the category
39
+ * dropdowns (board/medium/gradeLevel/subject, or Industry/Domain/Skill/
40
+ * Audience) — set the moment the user picks a different value in the
41
+ * "framework" field itself (SparkMetaForm), not just on save/reload.
42
+ * null = no override yet; useFramework() falls back to the content's own
43
+ * saved framework. Reset on every new content load (see setEditorConfig)
44
+ * so switching frameworks on one questionset can't leak into the next. */
45
+ contentFramework: string | null;
46
+ setContentFramework: (frameworkId: string | null) => void;
38
47
  /** Host event callbacks (IEditorEvents) registered by QuestionsetEditor. */
39
48
  eventHandlers: {
40
49
  onQuestionSaved?: (question: unknown) => void;
@@ -19,6 +19,16 @@ interface TreeState {
19
19
  name?: string;
20
20
  questionType?: string;
21
21
  } & Record<string, unknown>) => string;
22
+ /** Non-mutating pre-check for addExistingQuestion — lets a caller (e.g.
23
+ * the Library sidebar) validate BEFORE an async attach API call, so
24
+ * nothing is inserted into the tree until the backend actually confirms
25
+ * it, instead of inserting optimistically and rolling back on failure
26
+ * (which flashes the question into the outline for a moment). */
27
+ canAddExistingQuestion: (parentId: string, identifier: string) => 'ok' | 'exists' | 'maxDepth';
28
+ /** Depth-only pre-check for content that will get a brand-new identifier
29
+ * (e.g. the Library sidebar's "Copy") — canAddExistingQuestion's "exists"
30
+ * check doesn't apply since a copy is never already in the tree. */
31
+ isMaxDepth: (parentId: string) => boolean;
22
32
  deleteNode: (id: string) => void;
23
33
  reorderChildren: (parentId: string, fromIndex: number, toIndex: number) => void;
24
34
  markDirty: () => void;