@box/metadata-template-editor 2.3.44 → 2.3.46
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/chunks/metadata-field-list.js +1 -1
- package/dist/chunks/metadata-template-editor-form.js +1 -1
- package/dist/chunks/metadata-template-editor.js +1 -1
- package/dist/chunks/taxonomy-field-configuration.js +1 -1
- package/dist/chunks/taxonomy-field-configurator-initial-state.js +1 -1
- package/dist/chunks/taxonomy-selector.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/context/field-configurator-context.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/context/taxonomy-options-context.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/hooks/useTaxonomyFetch.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/index.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/messages/taxonomy-messages.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/metadata-field-configurator.js +1 -1
- package/dist/esm/lib/components/metadata-field-configurator/utils.js +1 -1
- package/dist/esm/lib/utils/taxonomy-identity.js +1 -0
- package/dist/esm/lib/utils/template-type-conversion/convertLocalConfiguratorToTemplateField.js +1 -1
- package/dist/i18n/bn-IN.js +2 -0
- package/dist/i18n/da-DK.js +2 -0
- package/dist/i18n/de-DE.js +2 -0
- package/dist/i18n/en-US.js +4 -112
- package/dist/i18n/es-419.js +2 -0
- package/dist/i18n/es-ES.js +2 -0
- package/dist/i18n/fi-FI.js +2 -0
- package/dist/i18n/fr-CA.js +2 -0
- package/dist/i18n/fr-FR.js +2 -0
- package/dist/i18n/hi-IN.js +2 -0
- package/dist/i18n/it-IT.js +2 -0
- package/dist/i18n/ko-KR.js +2 -0
- package/dist/i18n/nb-NO.js +2 -0
- package/dist/i18n/nl-NL.js +2 -0
- package/dist/i18n/pl-PL.js +2 -0
- package/dist/i18n/pt-BR.js +2 -0
- package/dist/i18n/ru-RU.js +2 -0
- package/dist/i18n/sv-SE.js +2 -0
- package/dist/i18n/tr-TR.js +2 -0
- package/dist/i18n/zh-CN.js +2 -0
- package/dist/i18n/zh-TW.js +2 -0
- package/dist/styles/taxonomy-field-configuration.css +1 -1
- package/dist/styles/taxonomy-selector.css +1 -1
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/useTaxonomySelect.d.ts +1 -1
- package/dist/types/lib/components/metadata-field-configurator/components/type-specific-configuration/taxonomy/utils.d.ts +1 -0
- package/dist/types/lib/components/metadata-field-configurator/context/field-configurator-context.d.ts +5 -0
- package/dist/types/lib/components/metadata-field-configurator/context/taxonomy-options-context.d.ts +19 -2
- package/dist/types/lib/components/metadata-field-configurator/hooks/useFieldConfiguratorBehavior.d.ts +2 -7
- package/dist/types/lib/components/metadata-field-configurator/hooks/useTaxonomyFetch.d.ts +13 -8
- package/dist/types/lib/components/metadata-field-configurator/messages/taxonomy-messages.d.ts +15 -0
- package/dist/types/lib/components/metadata-field-configurator/metadata-field-configurator.d.ts +24 -56
- package/dist/types/lib/components/metadata-field-list/metadata-field-list.d.ts +8 -1
- package/dist/types/lib/components/metadata-template-editor-form/metadata-template-editor-form.d.ts +2 -1
- package/dist/types/lib/metadata-template-editor.d.ts +25 -1
- package/dist/types/lib/types.d.ts +29 -0
- package/dist/types/lib/utils/taxonomy-identity.d.ts +12 -0
- package/package.json +7 -7
package/dist/i18n/fr-FR.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Les utilisateurs peuvent sélectionner à partir de n’importe quel niveau de la liste",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Choisir le niveau de taxonomie",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Les utilisateurs doivent sélectionner à partir du niveau suivant :",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Ce type de champ ({fieldType}) n’est plus pris en charge et est en lecture seule. La seule action disponible est de supprimer le champ.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Ce modèle inclut des types de champs qui ne sont plus pris en charge. Ces champs sont en lecture seule ; la seule action disponible est de les supprimer.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Annuler",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Fermer",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Confirmer",
|
package/dist/i18n/hi-IN.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "उपयोगकर्ता सूची में किसी भी स्तर से चुन सकते हैं",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "वर्गीकरण का स्तर चुनें",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "उपयोगकर्ताओं को निम्नलिखित स्तर में से चुनना अनिवार्य होगा:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "यह फ़ील्ड प्रकार ({fieldType}) अब समर्थित नहीं है और यह केवल पढ़ने के लिए है। एकमात्र उपलब्ध कार्रवाई फ़ील्ड को हटाना है।",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "इस टेम्पलेट में फ़ील्ड प्रकार शामिल हैं जो अब समर्थित नहीं हैं। वे फ़ील्ड्स केवल पढ़ने के लिए हैं; उपलब्ध एकमात्र कार्रवाई उन्हें हटाना है।",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "रद्द करें",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "बंद करें",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "पुष्टि करें",
|
package/dist/i18n/it-IT.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Gli utenti possono scegliere da qualsiasi livello dell’elenco",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Scegli il livello della tassonomia",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Gli utenti devono scegliere dal seguente livello:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Questo tipo di campo ({fieldType}) non è più supportato ed è di sola lettura. L’unica azione disponibile è rimuovere il campo.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Questo modello include tipi di campi che non sono più supportati. Quei campi sono di sola lettura; l’unica azione disponibile è rimuoverli.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Annulla",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Chiudi",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Conferma",
|
package/dist/i18n/ko-KR.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "사용자는 목록에서 모든 레벨에서 선택할 수 있습니다",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "분류 체계 레벨을 선택하세요",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "사용자는 다음 레벨에서 선택해야 합니다:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "이 필드 유형({fieldType})은 더 이상 지원되지 않으며 읽기 전용입니다. 사용할 수 있는 유일한 작업은 필드 삭제입니다.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "이 템플릿에는 더 이상 지원되지 않는 필드 유형이 포함됩니다. 이러한 필드는 읽기 전용이며 사용할 수 있는 유일한 작업은 필드 삭제입니다.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "취소",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "닫기",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "확인",
|
package/dist/i18n/nb-NO.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Brukere kan velge fra et hvilket som helst nivå i listen",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Velg taksonominivået",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Brukere må velge fra følgende nivå:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Denne felttypen ({fieldType}) støttes ikke lenger og er skrivebeskyttet. Den eneste tilgjengelige handlingen er å fjerne feltet.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Denne malen inneholder felttyper som ikke støttes lenger. Disse feltene er skrivebeskyttet; den eneste tilgjengelige handlingen er å fjerne dem.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Avbryt",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Lukk",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Bekreft",
|
package/dist/i18n/nl-NL.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Gebruikers kunnen kiezen uit elk niveau in de lijst",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Kies het taxonomieniveau",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Gebruikers moeten kiezen uit het volgende niveau:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Dit veldtype ({fieldType}) wordt niet langer ondersteund en is alleen-lezen. De enige beschikbare actie is om het veld te verwijderen.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Dit sjabloon bevat veldtypen die niet langer worden ondersteund. Deze velden zijn alleen-lezen; de enige beschikbare actie is om ze te verwijderen.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Annuleren",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Sluiten",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Bevestigen",
|
package/dist/i18n/pl-PL.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Użytkownicy mogą wybierać z dowolnego poziomu na liście",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Wybierz poziom taksonomii",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Użytkownicy muszą wybierać z następującego poziomu:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Ten typ pola ({fieldType}) nie jest już obsługiwany i jest tylko do odczytu. Jedynym dostępnym działaniem jest usunięcie pola.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Ten szablon zawiera typy pól, które nie są już obsługiwane. Te pola są tylko do odczytu. jedynym dostępnym działaniem jest ich usunięcie.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Anuluj",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Zamknij",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Potwierdź",
|
package/dist/i18n/pt-BR.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Os usuários podem escolher a partir de qualquer nível da lista",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Escolher o nível da taxonomia",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Os usuários devem escolher a partir do seguinte nível:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Esse tipo de campo ({fieldType}) não é mais compatível e é somente leitura. A única ação disponível é remover o campo.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Esse modelo inclui tipos de campos que não são mais compatíveis. Esses campos são somente leitura; a única ação disponível é removê-los.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Cancelar",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Fechar",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Confirmar",
|
package/dist/i18n/ru-RU.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Пользователи могут выбирать с любого уровня в списке",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Выберите уровень таксономии",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Пользователи должны выбирать из следующего уровня:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Этот тип поля ({fieldType}) больше не поддерживается и предназначен только для чтения. Единственное доступное действие — удаление поля.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Этот шаблон включает типы полей, которые больше не поддерживаются. Эти поля предназначены только для чтения. Единственное доступное действие — их удаление.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Отменить",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Закрыть",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Подтвердить",
|
package/dist/i18n/sv-SE.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Användare kan välja från vilken nivå som helst i listan",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Välj taxonominivå",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Användare måste välja från följande nivå:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Den här fälttypen ({fieldType}) stöds inte längre och är skrivskyddad. Den enda tillgängliga åtgärden är att ta bort fältet.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Den här mallen innehåller fälttyper som inte längre stöds. Dessa fält är skrivskyddade; den enda tillgängliga åtgärden är att ta bort dem.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "Avbryt",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Stäng",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Godkänn",
|
package/dist/i18n/tr-TR.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "Kullanıcılar listedeki herhangi bir seviyeden seçim yapabilir",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "Taksonomi düzeyini seçin",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "Kullanıcılar aşağıdaki seviyeden seçim yapmalıdır:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "Bu alan türü ({fieldType}) artık desteklenmiyor ve salt okunur. Bu alan için sadece kaldırma işlemi yapılabilir.",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "Bu şablon artık desteklenmeyen alan türleri içeriyor. Bu alanlar salt okunur olduğundan yapılabilecek tek işlem bunları kaldırmaktır.",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "İptal et",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "Kapat",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "Onayla",
|
package/dist/i18n/zh-CN.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "用户可以从列表中的任何级别选取值",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "选择分类法级别",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "用户必须从以下级别中选取:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "此字段类型({fieldType})不再受支持,且为只读状态。唯一可执行的操作是移除该字段。",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "此模板包含已不再受支持的字段类型。这些字段为只读;唯一可执行的操作是将其移除。",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "取消",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "关闭",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "确认",
|
package/dist/i18n/zh-TW.js
CHANGED
|
@@ -46,6 +46,8 @@ export default {
|
|
|
46
46
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.anyLevelSelection": "使用者可以從清單中的任何等級挑選",
|
|
47
47
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.chooseTaxonomyLevel": "選擇分類等級",
|
|
48
48
|
"groupSharedFeatures.metadataTemplateEditor.configurator.taxonomy.selection.requiredSelection": "使用者必須從以下等級挑選:",
|
|
49
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldNotice": "此欄位類型 ({fieldType}) 已不再受支援,屬於唯讀。唯一可用的動作是移除欄位。",
|
|
50
|
+
"groupSharedFeatures.metadataTemplateEditor.configurator.unsupportedFieldsBanner": "此範本包含已不再支援的欄位類型。這些欄位為唯讀;唯一可用的動作是移除欄位。",
|
|
49
51
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.cancelButtonText": "取消",
|
|
50
52
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.closeButtonAriaLabel": "關閉",
|
|
51
53
|
"groupSharedFeatures.metadataTemplateEditor.confirmationModal.confirmButtonText": "確認",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._taxonomyFieldConfiguration_l14xl_1{gap:var(--space-4);grid-template-rows:auto;grid-template-columns:1fr;display:grid}._statusContainer_l14xl_8{align-items:flex-start;gap:var(--bp-space-020);flex-direction:column;display:flex}._loadingIndicator_l14xl_15._loadingIndicator_l14xl_15{margin:0;position:relative;left:auto;right:auto}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._taxonomySelectorLabel_m3x8t_1{padding:var(--space-2) var(--space-3);display:block}._listWrapper_m3x8t_6{max-height:200px;overflow-y:auto}._listWrapperWithPadding_m3x8t_11{padding:var(--space-2);min-width:150px}._taxonomyItem_m3x8t_16{text-align:left;justify-content:flex-start;width:100%}._statusContainer_m3x8t_22{justify-content:center;align-items:center;gap:var(--bp-space-020);flex-direction:column;min-width:190px;min-height:80px;display:flex}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FieldConfiguratorContextValue } from '../../../context/field-configurator-context';
|
|
2
1
|
import { TaxonomyOption } from '../../../../../types';
|
|
2
|
+
import { FieldConfiguratorContextValue } from '../../../context/field-configurator-context';
|
|
3
3
|
export declare const useTaxonomySelect: (ctx: Pick<FieldConfiguratorContextValue, "values" | "setFieldValue">) => {
|
|
4
4
|
onTaxonomySelect: (option: TaxonomyOption) => void;
|
|
5
5
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { TaxonomyOption } from '../../../../../types';
|
|
2
2
|
export declare const filterTaxonomiesByValue: (taxonomies: TaxonomyOption[], value: string) => TaxonomyOption[];
|
|
3
|
+
export declare const mapTaxonomiesWithSelection: (taxonomies: TaxonomyOption[], selected: Pick<TaxonomyOption, "namespace" | "taxonomyKey">) => TaxonomyOption[];
|
|
@@ -33,6 +33,11 @@ export interface FieldConfiguratorContextValue {
|
|
|
33
33
|
handleBlur(e: React.FocusEvent<unknown>): void;
|
|
34
34
|
/** Trigger validation. The parent decides the validation strategy. */
|
|
35
35
|
validateForm(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Whether this field's accordion item is currently expanded.
|
|
38
|
+
* Stories and standalone `FieldConfiguratorProvider` usage default to `true`.
|
|
39
|
+
*/
|
|
40
|
+
isExpanded: boolean;
|
|
36
41
|
}
|
|
37
42
|
export declare const FieldConfiguratorContext: React.Context<FieldConfiguratorContextValue | null>;
|
|
38
43
|
/**
|
package/dist/types/lib/components/metadata-field-configurator/context/taxonomy-options-context.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TaxonomyOption } from '../../../types';
|
|
2
2
|
export type TaxonomyFetchStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
3
3
|
export type TaxonomyContextValue = {
|
|
4
|
-
/** Currently available taxonomy options. Empty while loading. */
|
|
4
|
+
/** Currently available taxonomy options. Empty while the catalogue is loading. */
|
|
5
5
|
options: TaxonomyOption[];
|
|
6
|
-
/**
|
|
6
|
+
/** Catalogue fetch lifecycle state. `'idle'` before first open, `'success'` once loaded. */
|
|
7
7
|
status: TaxonomyFetchStatus;
|
|
8
8
|
/**
|
|
9
9
|
* Called when the taxonomy selector popover opens.
|
|
@@ -11,9 +11,26 @@ export type TaxonomyContextValue = {
|
|
|
11
11
|
* On error, calling this again retries the fetch.
|
|
12
12
|
*/
|
|
13
13
|
onSelectorOpen: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Resolves a single taxonomy by namespace + key. Cached for the lifetime of the provider.
|
|
16
|
+
* No-op when the taxonomy is already in `options`.
|
|
17
|
+
* On error, calling this again retries the lookup.
|
|
18
|
+
*/
|
|
19
|
+
resolveTaxonomy?: (namespace: string, taxonomyKey: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Per-key status for `resolveTaxonomy`.
|
|
22
|
+
* Returns `'success'` if the taxonomy is already in `options` (including the static catalogue).
|
|
23
|
+
*/
|
|
24
|
+
getResolveStatus: (namespace: string, taxonomyKey: string) => TaxonomyFetchStatus;
|
|
14
25
|
};
|
|
15
26
|
export declare const TaxonomyOptionsContext: import('react').Context<TaxonomyContextValue>;
|
|
16
27
|
export declare function useTaxonomyOptions(): TaxonomyContextValue;
|
|
28
|
+
/**
|
|
29
|
+
* True when a parent already owns `TaxonomyOptionsContext` (e.g. `MetadataFieldList`).
|
|
30
|
+
* Providers always pass a new value object, so identity inequality with `DEFAULT_CONTEXT`
|
|
31
|
+
* means this tree is already wrapped and must not create a second cache.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useHasTaxonomyOptionsProvider(): boolean;
|
|
17
34
|
/**
|
|
18
35
|
* Creates a static (pre-fetched) taxonomy context value.
|
|
19
36
|
* Use in stories, tests, or when you already have the options available.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FieldConfiguratorExtension } from '../context/field-extensions-context';
|
|
2
2
|
import { FieldConfiguratorContextValue } from '../context/field-configurator-context';
|
|
3
|
-
import {
|
|
4
|
-
import { FieldData, TaxonomyOption } from '../../../types';
|
|
3
|
+
import { FieldData } from '../../../types';
|
|
5
4
|
export declare const EDIT_TAB_ID = "edit";
|
|
6
5
|
export type UseFieldConfiguratorBehaviorParams = {
|
|
7
6
|
values: FieldData;
|
|
@@ -10,16 +9,12 @@ export type UseFieldConfiguratorBehaviorParams = {
|
|
|
10
9
|
isExpanded?: boolean;
|
|
11
10
|
onExpandedChange?: (expanded: boolean) => void;
|
|
12
11
|
submitAttemptCount?: number;
|
|
13
|
-
taxonomyOptions?: TaxonomyOption[];
|
|
14
|
-
fetchTaxonomies?: () => Promise<TaxonomyOption[]>;
|
|
15
12
|
fieldExtensionsProp?: FieldConfiguratorExtension[];
|
|
16
13
|
onValidationChange?: (isValid: boolean) => void;
|
|
17
14
|
};
|
|
18
15
|
export type FieldConfiguratorBehavior = {
|
|
19
16
|
/** Value for `FieldConfiguratorContext.Provider`. */
|
|
20
17
|
contextValue: FieldConfiguratorContextValue;
|
|
21
|
-
/** Value for `TaxonomyOptionsContext.Provider` (only used in standalone mode). */
|
|
22
|
-
taxonomyContextValue: TaxonomyContextValue;
|
|
23
18
|
/** Resolved extension list (prop wins over context). */
|
|
24
19
|
extensions: FieldConfiguratorExtension[];
|
|
25
20
|
/** Whether the accordion item is currently open. */
|
|
@@ -55,4 +50,4 @@ export type FieldConfiguratorBehavior = {
|
|
|
55
50
|
* Separated from the rendering layer so the component file stays focused on
|
|
56
51
|
* structure and the hook can be read, tested, and reasoned about in isolation.
|
|
57
52
|
*/
|
|
58
|
-
export declare function useFieldConfiguratorBehavior({ values, onValuesChange, onDelete, isExpanded, onExpandedChange, submitAttemptCount,
|
|
53
|
+
export declare function useFieldConfiguratorBehavior({ values, onValuesChange, onDelete, isExpanded, onExpandedChange, submitAttemptCount, fieldExtensionsProp, onValidationChange, }: UseFieldConfiguratorBehaviorParams): FieldConfiguratorBehavior;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { TaxonomyOption } from '../../../types';
|
|
1
|
+
import { FetchTaxonomyByKey, TaxonomyOption } from '../../../types';
|
|
2
2
|
import { TaxonomyContextValue } from '../context/taxonomy-options-context';
|
|
3
|
+
export type UseTaxonomyFetchParams = {
|
|
4
|
+
fetchTaxonomies?: () => Promise<TaxonomyOption[]>;
|
|
5
|
+
staticOptions?: TaxonomyOption[];
|
|
6
|
+
fetchTaxonomyByKey?: FetchTaxonomyByKey;
|
|
7
|
+
};
|
|
3
8
|
/**
|
|
4
9
|
* Manages lazy, on-demand fetching of taxonomy options for use with `TaxonomyOptionsContext`.
|
|
5
10
|
*
|
|
6
|
-
* When `
|
|
7
|
-
*
|
|
8
|
-
* options were pre-supplied via the `taxonomyOptions` prop.
|
|
11
|
+
* When `fetchTaxonomyByKey` is provided, existing taxonomy fields can hydrate their display
|
|
12
|
+
* name and levels from the namespace and key stored by the template API.
|
|
9
13
|
*
|
|
10
14
|
* When `fetchTaxonomies` is provided:
|
|
11
15
|
* - Fetch is deferred until `onSelectorOpen` is called (i.e. the popover opens).
|
|
12
16
|
* - Results are cached: a successful fetch is never repeated on subsequent opens.
|
|
13
17
|
* - On error, calling `onSelectorOpen` again (via the retry button) restarts the fetch.
|
|
14
18
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
19
|
+
* `resolveTaxonomy(namespace, taxonomyKey)` looks up one taxonomy and caches it by key.
|
|
20
|
+
* Lookups are skipped when the taxonomy is already resolved by key, or already in `options`
|
|
21
|
+
* with levels. Thin catalogue rows still trigger a by-key fetch.
|
|
22
|
+
* On error, calling `resolveTaxonomy` again retries that key.
|
|
18
23
|
*/
|
|
19
|
-
export declare function useTaxonomyFetch(fetchTaxonomies
|
|
24
|
+
export declare function useTaxonomyFetch({ fetchTaxonomies, staticOptions, fetchTaxonomyByKey, }: UseTaxonomyFetchParams): TaxonomyContextValue;
|
package/dist/types/lib/components/metadata-field-configurator/messages/taxonomy-messages.d.ts
CHANGED
|
@@ -39,5 +39,20 @@ declare const _default: {
|
|
|
39
39
|
description: string;
|
|
40
40
|
id: string;
|
|
41
41
|
};
|
|
42
|
+
loadingTaxonomy: {
|
|
43
|
+
defaultMessage: string;
|
|
44
|
+
description: string;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
loadTaxonomyError: {
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
description: string;
|
|
50
|
+
id: string;
|
|
51
|
+
};
|
|
52
|
+
retryLoadTaxonomy: {
|
|
53
|
+
defaultMessage: string;
|
|
54
|
+
description: string;
|
|
55
|
+
id: string;
|
|
56
|
+
};
|
|
42
57
|
};
|
|
43
58
|
export default _default;
|
package/dist/types/lib/components/metadata-field-configurator/metadata-field-configurator.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DraggableAttributes } from '@dnd-kit/core';
|
|
2
2
|
import { useSortable } from '@dnd-kit/sortable';
|
|
3
3
|
import { default as React } from 'react';
|
|
4
|
-
import { FieldData, TaxonomyOption } from '../../types';
|
|
4
|
+
import { FieldData, FetchTaxonomyByKey, TaxonomyOption } from '../../types';
|
|
5
5
|
import { FieldConfiguratorExtension } from './context/field-extensions-context';
|
|
6
6
|
type ValidatableFieldNames = 'name' | 'description' | 'key' | 'type' | 'hidden' | 'taxonomy' | 'dropdown';
|
|
7
7
|
/** Externally supplied validation state that overrides internal errors when present. */
|
|
@@ -98,6 +98,28 @@ export type MetadataFieldConfiguratorProps = GeneralComponentProps & (NativeDrag
|
|
|
98
98
|
* Mutually exclusive with `taxonomyOptions`.
|
|
99
99
|
*/
|
|
100
100
|
fetchTaxonomies?: () => Promise<TaxonomyOption[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Optional async function that resolves a single taxonomy by namespace and key.
|
|
103
|
+
*
|
|
104
|
+
* Called automatically when an existing taxonomy field is expanded and its display name
|
|
105
|
+
* and levels are not already known (the template API does not return them). Results are
|
|
106
|
+
* cached by key for the lifetime of the component. Loading and error states (including a
|
|
107
|
+
* retry button) are handled internally.
|
|
108
|
+
*
|
|
109
|
+
* Independent of `fetchTaxonomies` / `taxonomyOptions`, which feed the taxonomy picker.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```tsx
|
|
113
|
+
* fetchTaxonomyByKey={async ({ namespace, taxonomyKey }) => {
|
|
114
|
+
* const taxonomy = await api.getTaxonomyByKey(namespace, taxonomyKey);
|
|
115
|
+
* return {
|
|
116
|
+
* label: taxonomy.displayName,
|
|
117
|
+
* levels: taxonomy.levels.map(level => ({ name: level.displayName, level: level.level })),
|
|
118
|
+
* };
|
|
119
|
+
* }}
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
fetchTaxonomyByKey?: FetchTaxonomyByKey;
|
|
101
123
|
/**
|
|
102
124
|
* Domain-specific extensions to inject into this field's configurator panel.
|
|
103
125
|
*
|
|
@@ -143,59 +165,5 @@ export type MetadataFieldConfiguratorProps = GeneralComponentProps & (NativeDrag
|
|
|
143
165
|
*/
|
|
144
166
|
onValidationChange?: (isValid: boolean) => void;
|
|
145
167
|
};
|
|
146
|
-
|
|
147
|
-
* A form-backed accordion item for configuring a single metadata field.
|
|
148
|
-
*
|
|
149
|
-
* Supports two operating modes:
|
|
150
|
-
* - **Standalone**: manages its own Accordion root and open/closed state internally.
|
|
151
|
-
* - **List mode**: when `isExpanded` is provided, the parent `MetadataFieldList` owns
|
|
152
|
-
* the shared Accordion root and controls open/closed state.
|
|
153
|
-
*
|
|
154
|
-
* Drag-and-drop can be handled via native HTML5 events or dnd-kit (mutually exclusive).
|
|
155
|
-
*
|
|
156
|
-
* All state, effects, and callbacks live in {@link useFieldConfiguratorBehavior}.
|
|
157
|
-
* The edit form is rendered by {@link FieldEditContent}.
|
|
158
|
-
* The accordion header toolbar is rendered by {@link FieldActionSlot}.
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
* ```tsx
|
|
162
|
-
* // Standalone usage — host owns values state
|
|
163
|
-
* const [values, setValues] = useState<FieldData>(
|
|
164
|
-
* createDefaultFieldValues(FieldType.Text),
|
|
165
|
-
* );
|
|
166
|
-
* const [isValid, setIsValid] = useState(false);
|
|
167
|
-
*
|
|
168
|
-
* <MetadataFieldConfigurator
|
|
169
|
-
* index={0}
|
|
170
|
-
* maxIndex={0}
|
|
171
|
-
* values={values}
|
|
172
|
-
* onValuesChange={setValues}
|
|
173
|
-
* onValidationChange={setIsValid}
|
|
174
|
-
* onDelete={key => console.log('deleted', key)}
|
|
175
|
-
* onReorderFields={(from, to) => console.log('reorder', from, to)}
|
|
176
|
-
* // Native HTML5 drag — swap for dndDragHandleProps when using dnd-kit
|
|
177
|
-
* onDragStart={(e, i) => {}}
|
|
178
|
-
* onDragEnd={(e, i) => {}}
|
|
179
|
-
* onTouchStart={(e, i) => {}}
|
|
180
|
-
* fetchTaxonomies={() => api.getTaxonomies()}
|
|
181
|
-
* />
|
|
182
|
-
* <button disabled={!isValid}>Save</button>
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```tsx
|
|
187
|
-
* // With dnd-kit drag handle (e.g. inside a custom sortable list)
|
|
188
|
-
* const { attributes, listeners } = useSortable({ id: values.id });
|
|
189
|
-
*
|
|
190
|
-
* <MetadataFieldConfigurator
|
|
191
|
-
* index={index}
|
|
192
|
-
* maxIndex={maxIndex}
|
|
193
|
-
* values={values}
|
|
194
|
-
* onValuesChange={setValues}
|
|
195
|
-
* onReorderFields={handleReorder}
|
|
196
|
-
* dndDragHandleProps={{ listeners, attributes }}
|
|
197
|
-
* />
|
|
198
|
-
* ```
|
|
199
|
-
*/
|
|
200
|
-
export declare const MetadataFieldConfigurator: ({ index, maxIndex, values, onValuesChange, onDelete, onDuplicate, onReorderFields, onTouchStart, onDragStart, onDragEnd, externalErrors, externalTouched, dndDragHandleProps, fieldCollapsedText, isExpanded, onExpandedChange, taxonomyOptions, fetchTaxonomies, submitAttemptCount, fieldExtensions: fieldExtensionsProp, onValidationChange, readOnly, }: MetadataFieldConfiguratorProps) => import("react/jsx-runtime").JSX.Element;
|
|
168
|
+
export declare const MetadataFieldConfigurator: ({ index, maxIndex, values, onValuesChange, onDelete, onDuplicate, onReorderFields, onTouchStart, onDragStart, onDragEnd, externalErrors, externalTouched, dndDragHandleProps, fieldCollapsedText, isExpanded, onExpandedChange, taxonomyOptions, fetchTaxonomies, fetchTaxonomyByKey, submitAttemptCount, fieldExtensions: fieldExtensionsProp, onValidationChange, readOnly, }: MetadataFieldConfiguratorProps) => import("react/jsx-runtime").JSX.Element;
|
|
201
169
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MetadataFieldConfiguratorProps } from '../metadata-field-configurator';
|
|
2
2
|
import { TaxonomyInitialStateLabels } from '../metadata-field-configurator/context/editor-config-context';
|
|
3
3
|
import { FieldConfiguratorExtension } from '../metadata-field-configurator/context/field-extensions-context';
|
|
4
|
-
import { FieldData, FieldType } from '../../types';
|
|
4
|
+
import { FetchTaxonomyByKey, FieldData, FieldType } from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* Imperative handle exposed by `MetadataFieldList` via `forwardRef`.
|
|
7
7
|
* Use it to programmatically scroll to and expand a specific field.
|
|
@@ -35,6 +35,11 @@ export type MetadataFieldListProps = {
|
|
|
35
35
|
* of the list. Mutually exclusive with `taxonomyOptions`.
|
|
36
36
|
*/
|
|
37
37
|
readonly fetchTaxonomies?: MetadataFieldConfiguratorProps['fetchTaxonomies'];
|
|
38
|
+
/**
|
|
39
|
+
* Async function called to resolve a single taxonomy by namespace and key.
|
|
40
|
+
* Lookups are cached across fields for the lifetime of the list. Independent of `fetchTaxonomies`.
|
|
41
|
+
*/
|
|
42
|
+
readonly fetchTaxonomyByKey: FetchTaxonomyByKey;
|
|
38
43
|
/**
|
|
39
44
|
* Field types that are disabled/hidden from the field type picker (defaults to none).
|
|
40
45
|
*/
|
|
@@ -106,6 +111,7 @@ export type MetadataFieldListProps = {
|
|
|
106
111
|
* <MetadataFieldList
|
|
107
112
|
* fields={fields}
|
|
108
113
|
* onChangeFields={setFields}
|
|
114
|
+
* fetchTaxonomyByKey={({ namespace, taxonomyKey }) => api.getTaxonomyByKey(namespace, taxonomyKey)}
|
|
109
115
|
* />
|
|
110
116
|
*
|
|
111
117
|
* // With validation gating, lazy taxonomy loading, and an API delete side-effect
|
|
@@ -117,6 +123,7 @@ export type MetadataFieldListProps = {
|
|
|
117
123
|
* onDeleteFieldAtIndex={(index, field) => api.deleteField(field.key)}
|
|
118
124
|
* onValidationChange={setAllValid}
|
|
119
125
|
* fetchTaxonomies={() => api.getTaxonomies()}
|
|
126
|
+
* fetchTaxonomyByKey={({ namespace, taxonomyKey }) => api.getTaxonomyByKey(namespace, taxonomyKey)}
|
|
120
127
|
* />
|
|
121
128
|
* <button disabled={!allValid}>Save</button>
|
|
122
129
|
* ```
|
package/dist/types/lib/components/metadata-template-editor-form/metadata-template-editor-form.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ type MetadataTemplateEditorFormProps = {
|
|
|
5
5
|
onCancel?: () => void;
|
|
6
6
|
taxonomyOptions?: MetadataFieldListProps['taxonomyOptions'];
|
|
7
7
|
fetchTaxonomies?: MetadataFieldListProps['fetchTaxonomies'];
|
|
8
|
+
fetchTaxonomyByKey: MetadataFieldListProps['fetchTaxonomyByKey'];
|
|
8
9
|
hideActions?: boolean;
|
|
9
10
|
isEditMode?: boolean;
|
|
10
11
|
/**
|
|
@@ -25,5 +26,5 @@ type MetadataTemplateEditorFormProps = {
|
|
|
25
26
|
*/
|
|
26
27
|
fieldExtensions?: FieldConfiguratorExtension[];
|
|
27
28
|
};
|
|
28
|
-
declare const MetadataTemplateEditorForm: ({ formId, onCancel, taxonomyOptions, fetchTaxonomies, hideActions, isEditMode, readOnly, onDirtyStateChange, onValidationChange, fieldExtensions, }: MetadataTemplateEditorFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const MetadataTemplateEditorForm: ({ formId, onCancel, taxonomyOptions, fetchTaxonomies, fetchTaxonomyByKey, hideActions, isEditMode, readOnly, onDirtyStateChange, onValidationChange, fieldExtensions, }: MetadataTemplateEditorFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export default MetadataTemplateEditorForm;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TaxonomyInitialStateLabels } from './components/metadata-field-configurator/context/editor-config-context';
|
|
2
2
|
import { FieldConfiguratorExtension } from './components/metadata-field-configurator/context/field-extensions-context';
|
|
3
3
|
import { MetadataFieldListProps } from './components/metadata-field-list';
|
|
4
|
-
import { FieldType, MetadataTemplateApiResponse, MetadataTemplateCreateBody, MetadataTemplateEditorMode, MetadataTemplatePatchItem } from './types';
|
|
4
|
+
import { FetchTaxonomyByKey, FieldType, MetadataTemplateApiResponse, MetadataTemplateCreateBody, MetadataTemplateEditorMode, MetadataTemplatePatchItem } from './types';
|
|
5
5
|
type MetadataTemplateEditorCommonProps = {
|
|
6
6
|
/** Called when the user dismisses the form without saving. */
|
|
7
7
|
onCancel?: () => void;
|
|
@@ -110,6 +110,30 @@ type MetadataTemplateEditorCommonProps = {
|
|
|
110
110
|
* ```
|
|
111
111
|
*/
|
|
112
112
|
fetchTaxonomies?: MetadataFieldListProps['fetchTaxonomies'];
|
|
113
|
+
/**
|
|
114
|
+
* Resolves a single taxonomy by namespace and key.
|
|
115
|
+
*
|
|
116
|
+
* The template API returns only `taxonomyKey` and `namespace` for a taxonomy field, so this
|
|
117
|
+
* is the only way the editor can render that field's display name and levels. The editor
|
|
118
|
+
* calls it when such a field is expanded, caches the result by key, and handles loading,
|
|
119
|
+
* error, and retry internally.
|
|
120
|
+
*
|
|
121
|
+
* Independent of `fetchTaxonomies`, which feeds the taxonomy picker for new fields.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* <MetadataTemplateEditor
|
|
126
|
+
* fetchTaxonomyByKey={async ({ namespace, taxonomyKey }) => {
|
|
127
|
+
* const taxonomy = await api.getTaxonomyByKey(namespace, taxonomyKey);
|
|
128
|
+
* return {
|
|
129
|
+
* label: taxonomy.displayName,
|
|
130
|
+
* levels: taxonomy.levels.map(level => ({ name: level.displayName, level: level.level })),
|
|
131
|
+
* };
|
|
132
|
+
* }}
|
|
133
|
+
* />
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
fetchTaxonomyByKey: FetchTaxonomyByKey;
|
|
113
137
|
/**
|
|
114
138
|
* Field types that are disabled/hidden from the field type picker (defaults to none).
|
|
115
139
|
*/
|
|
@@ -112,6 +112,35 @@ export interface TaxonomyOption {
|
|
|
112
112
|
taxonomyKey: string;
|
|
113
113
|
namespace: string;
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Looks up a single taxonomy by namespace and key.
|
|
117
|
+
*
|
|
118
|
+
* Used to hydrate an existing field's display name and levels from
|
|
119
|
+
* `GET /metadata_taxonomies/:namespace/:taxonomyKey` without loading the full catalogue.
|
|
120
|
+
*
|
|
121
|
+
* The shared feature stamps `id`, `namespace`, `taxonomyKey`, and `selected` from the
|
|
122
|
+
* request. Hosts only need to return display metadata (`label` and `levels`).
|
|
123
|
+
*
|
|
124
|
+
* The Box API field is `key`, not `taxonomyKey`.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* <MetadataTemplateEditor
|
|
129
|
+
* fetchTaxonomyByKey={async ({ namespace, taxonomyKey }) => {
|
|
130
|
+
* const taxonomy = await api.getTaxonomyByKey(namespace, taxonomyKey);
|
|
131
|
+
* return {
|
|
132
|
+
* label: taxonomy.displayName,
|
|
133
|
+
* levels: taxonomy.levels.map(level => ({ name: level.displayName, level: level.level })),
|
|
134
|
+
* };
|
|
135
|
+
* }}
|
|
136
|
+
* />
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export type FetchedTaxonomyDetails = Pick<TaxonomyOption, 'label' | 'levels'> & Partial<TaxonomyOption>;
|
|
140
|
+
export type FetchTaxonomyByKey = (params: {
|
|
141
|
+
namespace: string;
|
|
142
|
+
taxonomyKey: string;
|
|
143
|
+
}) => Promise<FetchedTaxonomyDetails>;
|
|
115
144
|
/**
|
|
116
145
|
* Represents a taxonomy level.
|
|
117
146
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TaxonomyOption } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Stable identity for a taxonomy is `namespace` + `taxonomyKey`, never `id`.
|
|
4
|
+
* Two catalogues can reuse the same key (or even the same id) across namespaces.
|
|
5
|
+
*
|
|
6
|
+
* Also used as a React list key and as the stamped `id` on by-key lookup results.
|
|
7
|
+
*/
|
|
8
|
+
export declare const taxonomyCacheKey: (namespace: string, taxonomyKey: string) => string;
|
|
9
|
+
export declare const isSameTaxonomyIdentity: (taxonomy: Pick<TaxonomyOption, "namespace" | "taxonomyKey">, identity: Pick<TaxonomyOption, "namespace" | "taxonomyKey">) => boolean;
|
|
10
|
+
export declare const findTaxonomyOption: (options: TaxonomyOption[], identity: Pick<TaxonomyOption, "namespace" | "taxonomyKey">) => TaxonomyOption | undefined;
|
|
11
|
+
/** Catalogue list rows often omit levels; those still need a by-key lookup. */
|
|
12
|
+
export declare const hasHydratedLevels: (taxonomy: Pick<TaxonomyOption, "levels"> | undefined) => boolean;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-template-editor",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.46",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^17.5.
|
|
7
|
-
"@box/blueprint-web-assets": "^5.9.
|
|
6
|
+
"@box/blueprint-web": "^17.5.3",
|
|
7
|
+
"@box/blueprint-web-assets": "^5.9.9",
|
|
8
8
|
"@dnd-kit/core": "^6.1.0",
|
|
9
9
|
"@dnd-kit/sortable": "^8.0.0",
|
|
10
10
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"yup": "^1.6.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@box/blueprint-web": "^17.5.
|
|
21
|
-
"@box/blueprint-web-assets": "^5.9.
|
|
22
|
-
"@box/eslint-plugin-blueprint": "2.2.
|
|
23
|
-
"@box/storybook-utils": "1.2.
|
|
20
|
+
"@box/blueprint-web": "^17.5.3",
|
|
21
|
+
"@box/blueprint-web-assets": "^5.9.9",
|
|
22
|
+
"@box/eslint-plugin-blueprint": "2.2.13",
|
|
23
|
+
"@box/storybook-utils": "1.2.40",
|
|
24
24
|
"@dnd-kit/core": "^6.1.0",
|
|
25
25
|
"@dnd-kit/sortable": "^8.0.0",
|
|
26
26
|
"@dnd-kit/utilities": "^3.2.2",
|