@anzusystems/common-admin 2.0.0-rc.22 → 2.0.0-rc.23
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/AnzuSystemsCommonAdmin.d.ts +2 -0
- package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
- package/dist/common-admin.css +1 -1
- package/dist/common-admin.js +33 -29
- package/dist/domains/dam/api/damAssetApi.d.ts +12 -5
- package/dist/domains/dam/api/damAssetApi.js +66 -55
- package/dist/domains/dam/api/damAssetApi.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js +100 -108
- package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/store/assetDetailStore.d.ts +2 -0
- package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +2 -0
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +1 -0
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/store/assetSelectStore.d.ts +112 -0
- package/dist/domains/dam/author/components/AuthorCreateButton.vue.d.ts +6 -0
- package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js +13 -5
- package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js +4 -2
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js +45 -39
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue.d.ts +15 -2
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js +118 -96
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue.d.ts +3 -0
- package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/DamSourcesAuthorsFields.js +8 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsFields.js.map +1 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsFields.vue.d.ts +67 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsFields.vue_vue_type_script_setup_true_lang.js +144 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsFields.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsRow.js +8 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsRow.js.map +1 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsRow.vue.d.ts +27 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsRow.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/domains/dam/author/components/DamSourcesAuthorsRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/domains/dam/author/composables/authorActions.js +2 -1
- package/dist/domains/dam/author/composables/authorActions.js.map +1 -1
- package/dist/domains/dam/author/composables/authorFieldRouting.d.ts +15 -0
- package/dist/domains/dam/author/composables/authorFieldRouting.js +18 -0
- package/dist/domains/dam/author/composables/authorFieldRouting.js.map +1 -0
- package/dist/domains/dam/author/composables/authorValidation.js +1 -1
- package/dist/domains/dam/author/composables/authorValidation.js.map +1 -1
- package/dist/domains/dam/author/composables/cachedAuthors.js +4 -2
- package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
- package/dist/domains/dam/author/composables/damAuthorConfig.d.ts +5 -0
- package/dist/domains/dam/author/composables/damAuthorConfig.js +5 -2
- package/dist/domains/dam/author/composables/damAuthorConfig.js.map +1 -1
- package/dist/domains/dam/author/composables/damCredit.d.ts +35 -0
- package/dist/domains/dam/author/composables/damCredit.js +44 -0
- package/dist/domains/dam/author/composables/damCredit.js.map +1 -0
- package/dist/domains/dam/author/composables/damSourceConfig.d.ts +15 -0
- package/dist/domains/dam/author/composables/damSourceConfig.js +19 -0
- package/dist/domains/dam/author/composables/damSourceConfig.js.map +1 -0
- package/dist/domains/dam/author/factory/AuthorFactory.js +3 -1
- package/dist/domains/dam/author/factory/AuthorFactory.js.map +1 -1
- package/dist/domains/dam/author/filter/AuthorFilter.d.ts +38 -4
- package/dist/domains/dam/author/filter/AuthorFilter.js +20 -6
- package/dist/domains/dam/author/filter/AuthorFilter.js.map +1 -1
- package/dist/domains/dam/author/types/DamAuthor.d.ts +4 -0
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +1 -0
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js +1 -0
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +9 -1
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js +206 -204
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js +165 -131
- package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js +344 -335
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +1 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js +251 -242
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +1 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js +308 -303
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue.d.ts +1 -0
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js +84 -87
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +6 -3
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js +82 -77
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/useImageMassOperations.d.ts +2 -0
- package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js +59 -37
- package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js.map +1 -1
- package/dist/domains/dam/imageWidget/store/imageStore.d.ts +2 -0
- package/dist/domains/dam/imageWidget/utils/metadataToImageMap.d.ts +3 -1
- package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js +13 -22
- package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js.map +1 -1
- package/dist/domains/dam/types/Asset.d.ts +1 -0
- package/dist/domains/dam/types/Asset.js.map +1 -1
- package/dist/domains/dam/types/DamConfig.d.ts +6 -0
- package/dist/domains/dam/types/DamConfig.js.map +1 -1
- package/dist/domains/dam/types/ImageAware.d.ts +1 -0
- package/dist/domains/dam/types/UploadQueue.d.ts +1 -0
- package/dist/domains/dam/types/UploadQueue.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js +204 -175
- package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js +67 -65
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js +71 -70
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js +83 -91
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue.d.ts +10 -2
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js +178 -177
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.d.ts +2 -0
- package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js +4 -3
- package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/uploadQueueMassOperations.d.ts +1 -0
- package/dist/domains/dam/uploadQueue/composables/uploadQueueMassOperations.js +11 -8
- package/dist/domains/dam/uploadQueue/composables/uploadQueueMassOperations.js.map +1 -1
- package/dist/domains/dam/uploadQueue/core/uploadQueueFill.d.ts +2 -0
- package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js +4 -1
- package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js.map +1 -1
- package/dist/domains/dam/uploadQueue/factory/UploadQueueItemFactory.js +1 -0
- package/dist/domains/dam/uploadQueue/factory/UploadQueueItemFactory.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js +4 -4
- package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
- package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.d.ts +1 -0
- package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js +7 -4
- package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatableSidePanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/datatable/components/ALiveListingPill.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue.d.ts +3 -0
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/lib.d.ts +5 -1
- package/dist/locales/cs/common/assetSelect.js +1 -1
- package/dist/locales/cs/common/damImage.js +84 -10
- package/dist/locales/cs/common/damImage.js.map +1 -1
- package/dist/locales/cs.d.ts +6 -0
- package/dist/locales/en/common/assetSelect.js +1 -1
- package/dist/locales/en/common/damImage.js +84 -10
- package/dist/locales/en/common/damImage.js.map +1 -1
- package/dist/locales/en.d.ts +6 -0
- package/dist/locales/sk/common/assetSelect.js +1 -1
- package/dist/locales/sk/common/damImage.js +84 -10
- package/dist/locales/sk/common/damImage.js.map +1 -1
- package/dist/locales/sk.d.ts +6 -0
- package/dist/plugins/i18n.d.ts +6 -0
- package/package.json +26 -26
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import e from "../../../form/components/ASystemEntityScope.js";
|
|
2
|
+
import t from "./AuthorRemoteAutocompleteWithCached.js";
|
|
3
|
+
import n from "./DamSourcesAuthorsRow.js";
|
|
4
|
+
import { useDamCachedAuthors as r } from "../composables/cachedAuthors.js";
|
|
5
|
+
import { useDamCreditPreview as i } from "../composables/damCredit.js";
|
|
6
|
+
import { useDamConfigName as a } from "../../composables/damConfigName.js";
|
|
7
|
+
import { createBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, openBlock as d, renderSlot as f, unref as p, useModel as m, withCtx as h } from "vue";
|
|
8
|
+
import { useI18n as g } from "vue-i18n";
|
|
9
|
+
// src/domains/dam/author/components/DamSourcesAuthorsFields.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var _ = { class: "d-flex" }, v = { class: "a-dam-sources-authors-fields__field" }, y = { class: "d-flex" }, b = { class: "a-dam-sources-authors-fields__field" }, x = /*@__PURE__*/ l({
|
|
11
|
+
__name: "DamSourcesAuthorsFields",
|
|
12
|
+
props: /*@__PURE__*/ u({
|
|
13
|
+
extSystem: {},
|
|
14
|
+
sourceEnabled: { type: Boolean },
|
|
15
|
+
authorEnabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
},
|
|
19
|
+
sourceRequired: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !1
|
|
22
|
+
},
|
|
23
|
+
authorRequired: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
disabledAs: { default: "chips" },
|
|
32
|
+
validationScope: {
|
|
33
|
+
type: [
|
|
34
|
+
String,
|
|
35
|
+
Number,
|
|
36
|
+
Boolean,
|
|
37
|
+
Symbol
|
|
38
|
+
],
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
authorConflicts: { default: void 0 },
|
|
42
|
+
queueId: { default: void 0 },
|
|
43
|
+
showCredit: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
creditLabel: { default: void 0 },
|
|
48
|
+
configName: { default: void 0 }
|
|
49
|
+
}, {
|
|
50
|
+
sources: { required: !0 },
|
|
51
|
+
sourcesModifiers: {},
|
|
52
|
+
authors: { required: !0 },
|
|
53
|
+
authorsModifiers: {}
|
|
54
|
+
}),
|
|
55
|
+
emits: /*@__PURE__*/ u(["change"], ["update:sources", "update:authors"]),
|
|
56
|
+
setup(l, { emit: u }) {
|
|
57
|
+
let x = l, S = u, C = m(l, "sources"), w = m(l, "authors"), T = a(x.configName), { t: E } = g(), { getCachedAuthor: D } = r(T), O = i(D, () => x.extSystem, C, w, T);
|
|
58
|
+
return (r, i) => (d(), o(n, {
|
|
59
|
+
"source-enabled": l.sourceEnabled,
|
|
60
|
+
"author-enabled": l.authorEnabled,
|
|
61
|
+
credit: l.showCredit && l.sourceEnabled ? p(O) : "",
|
|
62
|
+
"credit-label": l.creditLabel
|
|
63
|
+
}, {
|
|
64
|
+
sources: h(() => [c(e, {
|
|
65
|
+
subject: "author",
|
|
66
|
+
system: "dam"
|
|
67
|
+
}, {
|
|
68
|
+
default: h(() => [s("div", _, [s("div", v, [c(t, {
|
|
69
|
+
modelValue: C.value,
|
|
70
|
+
"onUpdate:modelValue": [i[0] ||= (e) => C.value = e, i[2] ||= (e) => S("change")],
|
|
71
|
+
counterpart: w.value,
|
|
72
|
+
"onUpdate:counterpart": [i[1] ||= (e) => w.value = e, i[3] ||= (e) => S("change")],
|
|
73
|
+
"ext-system": l.extSystem,
|
|
74
|
+
"queue-id": l.queueId,
|
|
75
|
+
label: p(E)("common.damImage.asset.model.sources"),
|
|
76
|
+
"data-cy": "custom-field-sources",
|
|
77
|
+
source: "",
|
|
78
|
+
clearable: "",
|
|
79
|
+
multiple: "",
|
|
80
|
+
disabled: l.disabled,
|
|
81
|
+
"disabled-as": l.disabledAs,
|
|
82
|
+
required: l.sourceRequired,
|
|
83
|
+
"validation-scope": l.validationScope
|
|
84
|
+
}, null, 8, [
|
|
85
|
+
"modelValue",
|
|
86
|
+
"counterpart",
|
|
87
|
+
"ext-system",
|
|
88
|
+
"queue-id",
|
|
89
|
+
"label",
|
|
90
|
+
"disabled",
|
|
91
|
+
"disabled-as",
|
|
92
|
+
"required",
|
|
93
|
+
"validation-scope"
|
|
94
|
+
])]), f(r.$slots, "sources-append", {}, void 0, !0)])]),
|
|
95
|
+
_: 3
|
|
96
|
+
})]),
|
|
97
|
+
authors: h(() => [c(e, {
|
|
98
|
+
subject: "author",
|
|
99
|
+
system: "dam"
|
|
100
|
+
}, {
|
|
101
|
+
default: h(() => [s("div", y, [s("div", b, [c(t, {
|
|
102
|
+
modelValue: w.value,
|
|
103
|
+
"onUpdate:modelValue": [i[4] ||= (e) => w.value = e, i[6] ||= (e) => S("change")],
|
|
104
|
+
counterpart: C.value,
|
|
105
|
+
"onUpdate:counterpart": [i[5] ||= (e) => C.value = e, i[7] ||= (e) => S("change")],
|
|
106
|
+
"ext-system": l.extSystem,
|
|
107
|
+
"queue-id": l.queueId,
|
|
108
|
+
label: p(E)("common.damImage.asset.model.authors"),
|
|
109
|
+
"author-conflicts": l.authorConflicts,
|
|
110
|
+
"data-cy": "custom-field-authors",
|
|
111
|
+
source: !l.sourceEnabled && void 0,
|
|
112
|
+
clearable: "",
|
|
113
|
+
multiple: "",
|
|
114
|
+
disabled: l.disabled,
|
|
115
|
+
"disabled-as": l.disabledAs,
|
|
116
|
+
required: l.authorRequired,
|
|
117
|
+
"validation-scope": l.validationScope
|
|
118
|
+
}, null, 8, [
|
|
119
|
+
"modelValue",
|
|
120
|
+
"counterpart",
|
|
121
|
+
"ext-system",
|
|
122
|
+
"queue-id",
|
|
123
|
+
"label",
|
|
124
|
+
"author-conflicts",
|
|
125
|
+
"source",
|
|
126
|
+
"disabled",
|
|
127
|
+
"disabled-as",
|
|
128
|
+
"required",
|
|
129
|
+
"validation-scope"
|
|
130
|
+
])]), f(r.$slots, "authors-append", {}, void 0, !0)])]),
|
|
131
|
+
_: 3
|
|
132
|
+
})]),
|
|
133
|
+
_: 3
|
|
134
|
+
}, 8, [
|
|
135
|
+
"source-enabled",
|
|
136
|
+
"author-enabled",
|
|
137
|
+
"credit",
|
|
138
|
+
"credit-label"
|
|
139
|
+
]));
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
export { x as default };
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=DamSourcesAuthorsFields.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DamSourcesAuthorsFields.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createBlock","DamSourcesAuthorsRow","_unref","_withCtx","_createVNode","ASystemEntityScope","_createElementVNode","AuthorRemoteAutocompleteWithCached","_renderSlot","ASystemEntityScope_default","AuthorRemoteAutocompleteWithCached_default","DamSourcesAuthorsRow_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","DamSourcesAuthorsFields_vue_vue_type_script_setup_true_lang_default","\"sources\"","\"sourcesModifiers\"","\"authors\"","\"authorsModifiers\"","__emit","props","__props","emit","sources","useModel","authors","damConfigName","useDamConfigName","useI18n","useDamCachedAuthors","credit","useDamCreditPreview","getCachedAuthor","openBlock","createBlock","unref","withCtx","createVNode","createElementVNode","_cache","$event","t","renderSlot","_ctx"],"sources":["../../../../../src/domains/dam/author/components/DamSourcesAuthorsFields.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useI18n } from 'vue-i18n'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport type { ValidationScope } from '@/shared/types/Validation'\nimport ASystemEntityScope from '@/domains/form/components/ASystemEntityScope.vue'\nimport AuthorRemoteAutocompleteWithCached from '@/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue'\nimport DamSourcesAuthorsRow from '@/domains/dam/author/components/DamSourcesAuthorsRow.vue'\nimport { useDamCachedAuthors } from '@/domains/dam/author/composables/cachedAuthors'\nimport { useDamCreditPreview } from '@/domains/dam/author/composables/damCredit'\nimport type { DamFieldsDisabledAs } from '@/domains/dam/uploadQueue/components/uploadQueueBindings'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\n/**\n * Sources and authors of an asset side by side, each with its own field, and the credit they make.\n * An author created in one field that is of the other kind goes to the other field.\n */\nconst props = withDefaults(\n defineProps<{\n extSystem: IntegerId\n sourceEnabled: boolean\n authorEnabled?: boolean\n sourceRequired?: boolean\n authorRequired?: boolean\n disabled?: boolean\n /** How the disabled fields look, see `AuthorRemoteAutocompleteWithCached`. */\n disabledAs?: DamFieldsDisabledAs\n validationScope?: ValidationScope\n authorConflicts?: DocId[]\n queueId?: string\n showCredit?: boolean\n creditLabel?: string\n /** DAM configuration to use. Defaults to the parent component's, else `default`. */\n configName?: string\n }>(),\n {\n authorEnabled: true,\n sourceRequired: false,\n authorRequired: false,\n disabled: false,\n disabledAs: 'chips',\n validationScope: undefined,\n authorConflicts: undefined,\n queueId: undefined,\n showCredit: false,\n creditLabel: undefined,\n configName: undefined,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n\nconst sources = defineModel<DocId[]>('sources', { required: true })\nconst authors = defineModel<DocId[]>('authors', { required: true })\n\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst { t } = useI18n()\n\nconst { getCachedAuthor } = useDamCachedAuthors(damConfigName)\nconst credit = useDamCreditPreview(getCachedAuthor, () => props.extSystem, sources, authors, damConfigName)\n</script>\n\n<template>\n <DamSourcesAuthorsRow\n :source-enabled=\"sourceEnabled\"\n :author-enabled=\"authorEnabled\"\n :credit=\"showCredit && sourceEnabled ? credit : ''\"\n :credit-label=\"creditLabel\"\n >\n <template #sources>\n <ASystemEntityScope\n subject=\"author\"\n system=\"dam\"\n >\n <div class=\"d-flex\">\n <div class=\"a-dam-sources-authors-fields__field\">\n <AuthorRemoteAutocompleteWithCached\n v-model=\"sources\"\n v-model:counterpart=\"authors\"\n :ext-system=\"extSystem\"\n :queue-id=\"queueId\"\n :label=\"t('common.damImage.asset.model.sources')\"\n data-cy=\"custom-field-sources\"\n source\n clearable\n multiple\n :disabled=\"disabled\"\n :disabled-as=\"disabledAs\"\n :required=\"sourceRequired\"\n :validation-scope=\"validationScope\"\n @update:model-value=\"emit('change')\"\n @update:counterpart=\"emit('change')\"\n />\n </div>\n <slot name=\"sources-append\" />\n </div>\n </ASystemEntityScope>\n </template>\n <template #authors>\n <ASystemEntityScope\n subject=\"author\"\n system=\"dam\"\n >\n <div class=\"d-flex\">\n <div class=\"a-dam-sources-authors-fields__field\">\n <AuthorRemoteAutocompleteWithCached\n v-model=\"authors\"\n v-model:counterpart=\"sources\"\n :ext-system=\"extSystem\"\n :queue-id=\"queueId\"\n :label=\"t('common.damImage.asset.model.authors')\"\n :author-conflicts=\"authorConflicts\"\n data-cy=\"custom-field-authors\"\n :source=\"sourceEnabled ? false : undefined\"\n clearable\n multiple\n :disabled=\"disabled\"\n :disabled-as=\"disabledAs\"\n :required=\"authorRequired\"\n :validation-scope=\"validationScope\"\n @update:model-value=\"emit('change')\"\n @update:counterpart=\"emit('change')\"\n />\n </div>\n <slot name=\"authors-append\" />\n </div>\n </ASystemEntityScope>\n </template>\n </DamSourcesAuthorsRow>\n</template>\n\n<style lang=\"scss\" scoped>\n.a-dam-sources-authors-fields__field {\n flex-grow: 1;\n min-width: 0;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,IAAMwB,IAAQC,GAiCRC,IAAOH,GAIPI,IAAU3B,EAAoByB,GAAC,SAA6B,GAC5DI,IAAU7B,EAAoByB,GAAC,SAA6B,GAG5DK,IAAgBC,EAAiBP,EAAM,UAAU,GAEjD,EAAE,SAAMQ,EAAQ,GAEhB,EAAE,uBAAoBC,EAAoBH,CAAa,GACvDI,IAASC,EAAoBC,SAAuBZ,EAAM,WAAWG,GAASE,GAASC,CAAa;E,kBAIxG7B,EAAA,GAAAC,EAiEuBC,GAAA;GAhEpB,kBAAgBsB,EAAA;GAChB,kBAAgBA,EAAA;GAChB,QAAQA,EAAA,cAAcA,EAAA,gBAAgBrB,EAAA8B,CAAA,IAAM;GAC5C,gBAAcT,EAAA;;GAEJ,SAAOpB,QA2BK,CA1BrBC,EA0BqBC,GAAA;IAzBnB,SAAQ;IACR,QAAO;;IAEP,SAAAF,QAqBM,CArBNG,EAqBM,OArBNM,GAqBM,CApBJN,EAkBM,OAlBNO,GAkBM,CAjBJT,EAgBEG,GAAA;KAfS,YAAAkB,EAAA;K,wBAAA,AAAAgB,EAAA,QAAA,MAAA,EAAO,QAAAC,GAaK,AAAAD,EAAA,QAAA,MAAAjB,EAAI,QAAA,C;KAZjB,aAAaG,EAAA;K,yBAAA,AAAAc,EAAA,QAAA,MAAA,EAAO,QAAAC,GAaP,AAAAD,EAAA,QAAA,MAAAjB,EAAI,QAAA,C;KAZxB,cAAYD,EAAA;KACZ,YAAUA,EAAA;KACV,OAAOrB,EAAAyC,CAAA,CAAC,CAAA,qCAAA;KACT,WAAQ;KACR,QAAA;KACA,WAAA;KACA,UAAA;KACC,UAAUpB,EAAA;KACV,eAAaA,EAAA;KACb,UAAUA,EAAA;KACV,oBAAkBA,EAAA;;;;;;;;;;;I,MAKvBf,EAA8BqC,EAAA,QAAA,kBAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C;;;GAIzB,SAAO1C,QA4BK,CA3BrBC,EA2BqBC,GAAA;IA1BnB,SAAQ;IACR,QAAO;;IAEP,SAAAF,QAsBM,CAtBNG,EAsBM,OAtBNQ,GAsBM,CArBJR,EAmBM,OAnBNS,GAmBM,CAlBJX,EAiBEG,GAAA;KAhBS,YAAAoB,EAAA;K,wBAAA,AAAAc,EAAA,QAAA,MAAA,EAAO,QAAAC,GAcK,AAAAD,EAAA,QAAA,MAAAjB,EAAI,QAAA,C;KAbjB,aAAaC,EAAA;K,yBAAA,AAAAgB,EAAA,QAAA,MAAA,EAAO,QAAAC,GAcP,AAAAD,EAAA,QAAA,MAAAjB,EAAI,QAAA,C;KAbxB,cAAYD,EAAA;KACZ,YAAUA,EAAA;KACV,OAAOrB,EAAAyC,CAAA,CAAC,CAAA,qCAAA;KACR,oBAAkBpB,EAAA;KACnB,WAAQ;KACP,QAAQ,GAAA,iBAAwB,KAAA;KACjC,WAAA;KACA,UAAA;KACC,UAAUA,EAAA;KACV,eAAaA,EAAA;KACb,UAAUA,EAAA;KACV,oBAAkBA,EAAA;;;;;;;;;;;;;I,MAKvBf,EAA8BqC,EAAA,QAAA,kBAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "./DamSourcesAuthorsRow.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
// src/domains/dam/author/components/DamSourcesAuthorsRow.vue
|
|
5
|
+
var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-f1ab7809"]]);
|
|
6
|
+
export { n as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=DamSourcesAuthorsRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DamSourcesAuthorsRow.js","names":["DamSourcesAuthorsRow_vue_vue_type_script_setup_true_lang_default","_plugin_vue_export_helper_default","DamSourcesAuthorsRow_default"],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
sourceEnabled: boolean;
|
|
3
|
+
authorEnabled?: boolean;
|
|
4
|
+
credit?: string;
|
|
5
|
+
creditLabel?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_template: () => {
|
|
8
|
+
__VLS_Slots: {
|
|
9
|
+
sources?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
authors?: (props: {}) => any;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
15
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
authorEnabled: boolean;
|
|
17
|
+
credit: string;
|
|
18
|
+
creditLabel: string;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import e from "../../../ui/components/ARow.js";
|
|
2
|
+
import { createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, openBlock as o, renderSlot as s, unref as c } from "vue";
|
|
3
|
+
import { useI18n as l } from "vue-i18n";
|
|
4
|
+
import { VIcon as u } from "vuetify/components/VIcon";
|
|
5
|
+
// src/domains/dam/author/components/DamSourcesAuthorsRow.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var d = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "a-dam-sources-authors"
|
|
9
|
+
}, f = { class: "a-dam-sources-authors__fields" }, p = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "a-dam-sources-authors__sources"
|
|
12
|
+
}, m = {
|
|
13
|
+
key: 2,
|
|
14
|
+
class: "a-dam-sources-authors__authors"
|
|
15
|
+
}, h = /*@__PURE__*/ a({
|
|
16
|
+
__name: "DamSourcesAuthorsRow",
|
|
17
|
+
props: {
|
|
18
|
+
sourceEnabled: { type: Boolean },
|
|
19
|
+
authorEnabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !0
|
|
22
|
+
},
|
|
23
|
+
credit: { default: "" },
|
|
24
|
+
creditLabel: { default: void 0 }
|
|
25
|
+
},
|
|
26
|
+
setup(a) {
|
|
27
|
+
let { t: h } = l();
|
|
28
|
+
return (l, g) => a.sourceEnabled || a.authorEnabled ? (o(), r("div", d, [i("div", f, [
|
|
29
|
+
a.sourceEnabled ? (o(), r("div", p, [s(l.$slots, "sources", {}, void 0, !0)])) : n("", !0),
|
|
30
|
+
a.sourceEnabled && a.authorEnabled ? (o(), t(u, {
|
|
31
|
+
key: 1,
|
|
32
|
+
icon: "mdi-slash-forward",
|
|
33
|
+
class: "a-dam-sources-authors__slash"
|
|
34
|
+
})) : n("", !0),
|
|
35
|
+
a.authorEnabled ? (o(), r("div", m, [s(l.$slots, "authors", {}, void 0, !0)])) : n("", !0)
|
|
36
|
+
]), a.sourceEnabled && a.credit.length > 0 ? (o(), t(e, {
|
|
37
|
+
key: 0,
|
|
38
|
+
title: a.creditLabel ?? c(h)("common.damImage.image.model.texts.source"),
|
|
39
|
+
value: a.credit,
|
|
40
|
+
class: "pb-5",
|
|
41
|
+
"data-cy": "credit-preview"
|
|
42
|
+
}, null, 8, ["title", "value"])) : n("", !0)])) : n("", !0);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export { h as default };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=DamSourcesAuthorsRow.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DamSourcesAuthorsRow.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_createBlock","_component_VIcon","ARow","_unref","ARow_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","DamSourcesAuthorsRow_vue_vue_type_script_setup_true_lang_default","useI18n","__props","openBlock","createElementBlock","createElementVNode","renderSlot","_ctx","createCommentVNode","createBlock","VIcon","unref","t"],"sources":["../../../../../src/domains/dam/author/components/DamSourcesAuthorsRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useI18n } from 'vue-i18n'\nimport ARow from '@/domains/ui/components/ARow.vue'\n\nwithDefaults(\n defineProps<{\n sourceEnabled: boolean\n authorEnabled?: boolean\n credit?: string\n creditLabel?: string\n }>(),\n {\n authorEnabled: true,\n credit: '',\n creditLabel: undefined,\n }\n)\n\nconst { t } = useI18n()\n</script>\n\n<template>\n <div\n v-if=\"sourceEnabled || authorEnabled\"\n class=\"a-dam-sources-authors\"\n >\n <div class=\"a-dam-sources-authors__fields\">\n <div\n v-if=\"sourceEnabled\"\n class=\"a-dam-sources-authors__sources\"\n >\n <slot name=\"sources\" />\n </div>\n <VIcon\n v-if=\"sourceEnabled && authorEnabled\"\n icon=\"mdi-slash-forward\"\n class=\"a-dam-sources-authors__slash\"\n />\n <div\n v-if=\"authorEnabled\"\n class=\"a-dam-sources-authors__authors\"\n >\n <slot name=\"authors\" />\n </div>\n </div>\n <ARow\n v-if=\"sourceEnabled && credit.length > 0\"\n :title=\"creditLabel ?? t('common.damImage.image.model.texts.source')\"\n :value=\"credit\"\n class=\"pb-5\"\n data-cy=\"credit-preview\"\n />\n </div>\n</template>\n\n<style lang=\"scss\" scoped>\n// Side by side with the slash mirrors the credit \"{sources}/{authors}\". Below 560 px a field gets too\n// narrow for a typical author chip (~220 px at the 90th percentile), so the fields stack without the\n// slash; the rendered credit below shows the same shape. Sources are short agency names, hence 2:3.\n.a-dam-sources-authors {\n container-type: inline-size;\n}\n\n.a-dam-sources-authors__fields {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.a-dam-sources-authors__sources,\n.a-dam-sources-authors__authors {\n min-width: 0;\n}\n\n.a-dam-sources-authors__slash {\n display: none;\n}\n\n@container (min-width: 560px) {\n .a-dam-sources-authors__fields {\n flex-direction: row;\n align-items: flex-start;\n }\n\n .a-dam-sources-authors__sources {\n flex: 2 1 0;\n }\n\n .a-dam-sources-authors__authors {\n flex: 3 1 0;\n }\n\n .a-dam-sources-authors__slash {\n display: inline-flex;\n margin-top: 5px;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,IAAM,EAAE,SAAMc,EAAQ;E,iBAKZC,EAAA,iBAAiBA,EAAA,iBADzBf,EAAA,GAAAC,EA8BM,OA9BNQ,GA8BM,CA1BJP,EAkBM,OAlBNQ,GAkBM;GAhBIK,EAAA,iBADRf,EAAA,GAAAC,EAKM,OALNU,GAKM,CADJR,EAAuBiB,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C;GAGjBL,EAAA,iBAAiBA,EAAA,iBADzBf,EAAA,GAAAI,EAIEC,GAAA;;IAFA,MAAK;IACL,OAAM;;GAGAU,EAAA,iBADRf,EAAA,GAAAC,EAKM,OALNW,GAKM,CADJT,EAAuBiB,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,EAAA,C;E,IAInBL,EAAA,iBAAiBA,EAAA,OAAO,SAAM,KADtCf,EAAA,GAAAI,EAMEE,GAAA;;GAJC,OAAOS,EAAA,eAAeR,EAAAkB,CAAA,CAAC,CAAA,0CAAA;GACvB,OAAOV,EAAA;GACR,OAAM;GACN,WAAQ"}
|
|
@@ -10,7 +10,8 @@ var a = (a, o) => {
|
|
|
10
10
|
id: e.id,
|
|
11
11
|
name: e.name,
|
|
12
12
|
identifier: e.identifier,
|
|
13
|
-
reviewed: e.flags.reviewed
|
|
13
|
+
reviewed: e.flags.reviewed,
|
|
14
|
+
hiddenInCredit: e.flags.hiddenInCredit
|
|
14
15
|
}), f = (e) => ({
|
|
15
16
|
title: e.name + (e.identifier ? ` (${e.identifier})` : ""),
|
|
16
17
|
value: e.id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorActions.js","names":["useAuthorSelectActions","useCommonAdminCoreDamOptions","configName","useDamConfigState","configExtSystem","getDamConfigExtSystem","extSystem","isUndefined","mapToMinimal","author","mapToValueObject","mapToValueObjects","authors","mapToMinimals","useFetchAuthorList","damClient","endPointAuthor","execute","pagination","filterData","filterConfig","fetchAuthorListByIds","ids"],"sources":["../../../../../src/domains/dam/author/composables/authorActions.ts"],"sourcesContent":["import { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { isUndefined } from '@/shared/utils/common'\nimport type { DamAuthor, DamAuthorMinimal } from '@/domains/dam/author/types/DamAuthor'\nimport type { Pagination } from '@/domains/api/composables/pagination'\nimport { fetchAuthorListByIds, useFetchAuthorList } from '@/domains/dam/author/api/authorApi'\nimport type { ValueObjectOption } from '@/shared/types/ValueObject'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { Ref } from 'vue'\nimport type { FilterConfig, FilterData } from '@/domains/filters/composables/filterFactory'\n\nexport const useAuthorSelectActions = (extSystem: IntegerId, configName: string) => {\n const { damClient, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n const { getDamConfigExtSystem } = useDamConfigState(undefined, configName)\n\n const configExtSystem = getDamConfigExtSystem(extSystem)\n if (isUndefined(configExtSystem)) {\n throw new Error('useAuthorSelectActions: Ext system must be initialised.')\n }\n\n const mapToMinimal = (author: DamAuthor): DamAuthorMinimal => ({\n id: author.id,\n name: author.name,\n identifier: author.identifier,\n reviewed: author.flags.reviewed,\n })\n\n const mapToValueObject = (author: DamAuthor): ValueObjectOption<string> => ({\n title: author.name + (author.identifier ? ` (${author.identifier})` : ''),\n value: author.id,\n })\n\n const mapToValueObjects = (authors: DamAuthor[]): ValueObjectOption<string>[] => {\n return authors.map((author: DamAuthor) => mapToValueObject(author))\n }\n\n const mapToMinimals = (authors: DamAuthor[]): DamAuthorMinimal[] => {\n return authors.map((author: DamAuthor) => mapToMinimal(author))\n }\n\n const { execute } = useFetchAuthorList(damClient, endPointAuthor, extSystem)\n\n const fetchItems = async (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => {\n return mapToValueObjects(await execute(pagination, filterData, filterConfig))\n }\n\n const fetchItemsMinimal = async (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => {\n return mapToMinimals(await execute(pagination, filterData, filterConfig))\n }\n\n const fetchItemsByIds = async (ids: string[]) => {\n return mapToValueObjects(await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, ids))\n }\n\n const fetchItemsMinimalByIds = async (ids: string[]) => {\n return mapToMinimals(await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, ids))\n }\n\n return {\n mapToValueObject,\n fetchItems,\n fetchItemsByIds,\n fetchItemsMinimal,\n fetchItemsMinimalByIds,\n }\n}\n"],"mappings":";;;;;AAWA,IAAaA,KAA0B,GAAsB,MAAuB;CAClF,IAAM,EAAE,cAAW,sBAAmBC,EAA6BC,CAAU,GACvE,EAAE,6BAA0BC,EAAkB,KAAA,GAAWD,CAAU,GAEnEE,IAAkBC,EAAsBC,CAAS;CACvD,IAAIC,EAAYH,CAAe,GAC7B,MAAU,MAAM,yDAAyD;CAG3E,IAAMI,KAAgB,OAAyC;EAC7D,IAAIC,EAAO;EACX,MAAMA,EAAO;EACb,YAAYA,EAAO;EACnB,UAAUA,EAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"authorActions.js","names":["useAuthorSelectActions","useCommonAdminCoreDamOptions","configName","useDamConfigState","configExtSystem","getDamConfigExtSystem","extSystem","isUndefined","mapToMinimal","author","mapToValueObject","mapToValueObjects","authors","mapToMinimals","useFetchAuthorList","damClient","endPointAuthor","execute","pagination","filterData","filterConfig","fetchAuthorListByIds","ids"],"sources":["../../../../../src/domains/dam/author/composables/authorActions.ts"],"sourcesContent":["import { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { isUndefined } from '@/shared/utils/common'\nimport type { DamAuthor, DamAuthorMinimal } from '@/domains/dam/author/types/DamAuthor'\nimport type { Pagination } from '@/domains/api/composables/pagination'\nimport { fetchAuthorListByIds, useFetchAuthorList } from '@/domains/dam/author/api/authorApi'\nimport type { ValueObjectOption } from '@/shared/types/ValueObject'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { Ref } from 'vue'\nimport type { FilterConfig, FilterData } from '@/domains/filters/composables/filterFactory'\n\nexport const useAuthorSelectActions = (extSystem: IntegerId, configName: string) => {\n const { damClient, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n const { getDamConfigExtSystem } = useDamConfigState(undefined, configName)\n\n const configExtSystem = getDamConfigExtSystem(extSystem)\n if (isUndefined(configExtSystem)) {\n throw new Error('useAuthorSelectActions: Ext system must be initialised.')\n }\n\n const mapToMinimal = (author: DamAuthor): DamAuthorMinimal => ({\n id: author.id,\n name: author.name,\n identifier: author.identifier,\n reviewed: author.flags.reviewed,\n hiddenInCredit: author.flags.hiddenInCredit,\n })\n\n const mapToValueObject = (author: DamAuthor): ValueObjectOption<string> => ({\n title: author.name + (author.identifier ? ` (${author.identifier})` : ''),\n value: author.id,\n })\n\n const mapToValueObjects = (authors: DamAuthor[]): ValueObjectOption<string>[] => {\n return authors.map((author: DamAuthor) => mapToValueObject(author))\n }\n\n const mapToMinimals = (authors: DamAuthor[]): DamAuthorMinimal[] => {\n return authors.map((author: DamAuthor) => mapToMinimal(author))\n }\n\n const { execute } = useFetchAuthorList(damClient, endPointAuthor, extSystem)\n\n const fetchItems = async (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => {\n return mapToValueObjects(await execute(pagination, filterData, filterConfig))\n }\n\n const fetchItemsMinimal = async (pagination: Ref<Pagination>, filterData: FilterData, filterConfig: FilterConfig) => {\n return mapToMinimals(await execute(pagination, filterData, filterConfig))\n }\n\n const fetchItemsByIds = async (ids: string[]) => {\n return mapToValueObjects(await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, ids))\n }\n\n const fetchItemsMinimalByIds = async (ids: string[]) => {\n return mapToMinimals(await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, ids))\n }\n\n return {\n mapToValueObject,\n fetchItems,\n fetchItemsByIds,\n fetchItemsMinimal,\n fetchItemsMinimalByIds,\n }\n}\n"],"mappings":";;;;;AAWA,IAAaA,KAA0B,GAAsB,MAAuB;CAClF,IAAM,EAAE,cAAW,sBAAmBC,EAA6BC,CAAU,GACvE,EAAE,6BAA0BC,EAAkB,KAAA,GAAWD,CAAU,GAEnEE,IAAkBC,EAAsBC,CAAS;CACvD,IAAIC,EAAYH,CAAe,GAC7B,MAAU,MAAM,yDAAyD;CAG3E,IAAMI,KAAgB,OAAyC;EAC7D,IAAIC,EAAO;EACX,MAAMA,EAAO;EACb,YAAYA,EAAO;EACnB,UAAUA,EAAO,MAAM;EACvB,gBAAgBA,EAAO,MAAM;CAC/B,IAEMC,KAAoB,OAAkD;EAC1E,OAAOD,EAAO,QAAQA,EAAO,aAAa,KAAKA,EAAO,WAAW,KAAK;EACtE,OAAOA,EAAO;CAChB,IAEME,KAAqB,MAClBC,EAAQ,KAAK,MAAsBF,EAAiBD,CAAM,CAAC,GAG9DI,KAAiB,MACdD,EAAQ,KAAK,MAAsBJ,EAAaC,CAAM,CAAC,GAG1D,EAAE,eAAYK,EAAmBC,GAAWC,GAAgBV,CAAS;CAkB3E,OAAO;EACL;EACA,mBAlBwB,GAA6B,GAAwB,MACtEK,EAAkB,MAAMM,EAAQC,GAAYC,GAAYC,CAAY,CAAC;EAkB5E,wBAX6B,MACtBT,EAAkB,MAAMU,EAAqBN,GAAWC,GAAgBV,GAAWgB,CAAG,CAAC;EAW9F,0BAhB+B,GAA6B,GAAwB,MAC7ET,EAAc,MAAMI,EAAQC,GAAYC,GAAYC,CAAY,CAAC;EAgBxE,+BAToC,MAC7BP,EAAc,MAAMQ,EAAqBN,GAAWC,GAAgBV,GAAWgB,CAAG,CAAC;CAS5F;AACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DamAuthor } from '../types/DamAuthor';
|
|
2
|
+
import { DocId } from '../../../../shared/types/common';
|
|
3
|
+
interface DamAuthorFieldTargets {
|
|
4
|
+
own: (author: DamAuthor) => void;
|
|
5
|
+
other: (author: DamAuthor) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* After "+" in an author or source field: the API returns an existing author for a matching name. A merged
|
|
9
|
+
* author is replaced by its current authors, as on asset save, and each one goes to the field of its kind.
|
|
10
|
+
* Without a field kind (`source` undefined, sources off) all stay in the field.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useDamAuthorFieldRouting(): {
|
|
13
|
+
routeToFields: (author: DamAuthor, source: boolean | undefined, fetchByIds: (ids: DocId[]) => Promise<DamAuthor[]>, targets: DamAuthorFieldTargets) => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAlerts as e } from "../../../system/composables/alerts.js";
|
|
2
|
+
import { isUndefined as t } from "../../../../shared/utils/common.js";
|
|
3
|
+
import { useI18n as n } from "vue-i18n";
|
|
4
|
+
// src/domains/dam/author/composables/authorFieldRouting.ts
|
|
5
|
+
function r() {
|
|
6
|
+
let { t: r } = n(), { showInfo: i, showRecordWas: a, showErrorsDefault: o } = e();
|
|
7
|
+
return { routeToFields: async (e, n, s, c) => {
|
|
8
|
+
try {
|
|
9
|
+
let o = e.currentAuthors.length > 0 ? await s(e.currentAuthors) : [e];
|
|
10
|
+
for (let s of o) t(n) || s.flags.source === n ? (c.own(s), s.id === e.id && a("created")) : (c.other(s), i(r(s.flags.source ? "common.damImage.author.sourceFound" : "common.damImage.author.authorFound", { name: s.name })));
|
|
11
|
+
} catch (e) {
|
|
12
|
+
o(e);
|
|
13
|
+
}
|
|
14
|
+
} };
|
|
15
|
+
}
|
|
16
|
+
export { r as useDamAuthorFieldRouting };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=authorFieldRouting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorFieldRouting.js","names":["useDamAuthorFieldRouting","useI18n","useAlerts","resolved","author","fetchByIds","item","isUndefined","source","targets","showRecordWas","showInfo","t","error"],"sources":["../../../../../src/domains/dam/author/composables/authorFieldRouting.ts"],"sourcesContent":["import { useI18n } from 'vue-i18n'\nimport type { DamAuthor } from '@/domains/dam/author/types/DamAuthor'\nimport type { DocId } from '@/shared/types/common'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport { isUndefined } from '@/shared/utils/common'\n\ninterface DamAuthorFieldTargets {\n own: (author: DamAuthor) => void\n other: (author: DamAuthor) => void\n}\n\n/**\n * After \"+\" in an author or source field: the API returns an existing author for a matching name. A merged\n * author is replaced by its current authors, as on asset save, and each one goes to the field of its kind.\n * Without a field kind (`source` undefined, sources off) all stay in the field.\n */\nexport function useDamAuthorFieldRouting() {\n const { t } = useI18n()\n const { showInfo, showRecordWas, showErrorsDefault } = useAlerts()\n\n const routeToFields = async (\n author: DamAuthor,\n source: boolean | undefined,\n fetchByIds: (ids: DocId[]) => Promise<DamAuthor[]>,\n targets: DamAuthorFieldTargets\n ) => {\n try {\n const resolved = author.currentAuthors.length > 0 ? await fetchByIds(author.currentAuthors) : [author]\n for (const item of resolved) {\n if (isUndefined(source) || item.flags.source === source) {\n targets.own(item)\n if (item.id === author.id) showRecordWas('created')\n continue\n }\n targets.other(item)\n showInfo(\n t(item.flags.source ? 'common.damImage.author.sourceFound' : 'common.damImage.author.authorFound', {\n name: item.name,\n })\n )\n }\n } catch (error) {\n showErrorsDefault(error)\n }\n }\n\n return { routeToFields }\n}\n"],"mappings":";;;;AAgBA,SAAgBA,IAA2B;CACzC,IAAM,EAAE,SAAMC,EAAQ,GAChB,EAAE,aAAU,kBAAe,yBAAsBC,EAAU;CA4BjE,OAAO,EAAE,sBAzBP,GACA,GACA,GACA,MACG;EACH,IAAI;GACF,IAAMC,IAAWC,EAAO,eAAe,SAAS,IAAI,MAAMC,EAAWD,EAAO,cAAc,IAAI,CAACA,CAAM;GACrG,KAAK,IAAME,KAAQH,GACjB,AAAII,EAAYC,CAAM,KAAKF,EAAK,MAAM,WAAWE,KAC/CC,EAAQ,IAAIH,CAAI,GACZA,EAAK,OAAOF,EAAO,MAAIM,EAAc,SAAS,MAGpDD,EAAQ,MAAMH,CAAI,GAClBK,EACEC,EAAEN,EAAK,MAAM,SAAS,uCAAuC,sCAAsC,EACjG,MAAMA,EAAK,KACb,CAAC,CACH;EAEJ,SAASO,GAAO;GACd,EAAkBA,CAAK;EACzB;CACF,EAEuB;AACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorValidation.js","names":["useVuelidate","useValidate","useAuthorValidation","rules","computed","minLength","validationScope"],"sources":["../../../../../src/domains/dam/author/composables/authorValidation.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport { computed } from 'vue'\nimport useVuelidate from '@vuelidate/core'\nimport type { DamAuthor } from '@/domains/dam/author/types/DamAuthor'\nimport type { ValidationScope } from '@/shared/types/Validation'\nimport { useValidate } from '@/shared/validators/vuelidate/useValidate'\n\nconst { required, minLength } = useValidate()\n\nexport function useAuthorValidation(author: Ref<DamAuthor>, validationScope: ValidationScope = undefined) {\n const rules = computed(() => ({\n author: {\n name: {\n required,\n minLength: minLength(2),\n },\n identifier: {\n minLength: minLength(
|
|
1
|
+
{"version":3,"file":"authorValidation.js","names":["useVuelidate","useValidate","useAuthorValidation","rules","computed","minLength","validationScope"],"sources":["../../../../../src/domains/dam/author/composables/authorValidation.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport { computed } from 'vue'\nimport useVuelidate from '@vuelidate/core'\nimport type { DamAuthor } from '@/domains/dam/author/types/DamAuthor'\nimport type { ValidationScope } from '@/shared/types/Validation'\nimport { useValidate } from '@/shared/validators/vuelidate/useValidate'\n\nconst { required, minLength } = useValidate()\n\nexport function useAuthorValidation(author: Ref<DamAuthor>, validationScope: ValidationScope = undefined) {\n const rules = computed(() => ({\n author: {\n name: {\n required,\n minLength: minLength(2),\n },\n identifier: {\n minLength: minLength(2),\n },\n },\n }))\n const v$ = useVuelidate(rules, { author }, { $scope: validationScope })\n\n return {\n v$,\n }\n}\n"],"mappings":";;;;AAOA,IAAM,EAAE,aAAU,iBAAcC,EAAY;AAE5C,SAAgBC,EAAoB,GAAwB,IAAmC,KAAA,GAAW;CACxG,IAAMC,IAAQC,SAAgB,EAC5B,QAAQ;EACN,MAAM;GACJ;GACA,WAAWC,EAAU,CAAC;EACxB;EACA,YAAY,EACV,WAAWA,EAAU,CAAC,EACxB;CACF,EACF,EAAE;CAGF,OAAO,EACL,IAHSL,EAAaG,GAAO,EAAE,UAAO,GAAG,EAAE,QAAQG,EAAgB,CAGnE,EACF;AACF"}
|
|
@@ -8,12 +8,14 @@ var o = (e) => ({
|
|
|
8
8
|
id: e.id,
|
|
9
9
|
name: e.name,
|
|
10
10
|
identifier: e.identifier,
|
|
11
|
-
reviewed: e.flags.reviewed
|
|
11
|
+
reviewed: e.flags.reviewed,
|
|
12
|
+
hiddenInCredit: e.flags.hiddenInCredit
|
|
12
13
|
}), s = (e) => ({
|
|
13
14
|
id: e,
|
|
14
15
|
name: "",
|
|
15
16
|
identifier: "",
|
|
16
|
-
reviewed: !1
|
|
17
|
+
reviewed: !1,
|
|
18
|
+
hiddenInCredit: !1
|
|
17
19
|
}), c = (i) => e(o, s, (e) => {
|
|
18
20
|
let { cachedExtSystemId: a } = r(i), { damClient: o, endPointAuthor: s } = n(i);
|
|
19
21
|
return t(o, s, a.value, e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cachedAuthors.js","names":["mapFullToMinimal","author","mapIdToMinimal","defineCachedAuthors","defineCached","useExtSystemIdForCached","configName","useCommonAdminCoreDamOptions","fetchAuthorListByIds","damClient","endPointAuthor","cachedExtSystemId","ids","caches","cacheOf","name","inheritedDamConfigName","cache","useDamCachedAuthors","addManual","addManualMinimal","add","fetch","pin","unpin","toFetch","has","get","isLoaded","useDamCachedAuthorsForRemoteAutocomplete"],"sources":["../../../../../src/domains/dam/author/composables/cachedAuthors.ts"],"sourcesContent":["import type { DocId } from '@/shared/types/common'\nimport { defineCached } from '@/domains/cached/composables/defineCached'\nimport type { DamAuthor, DamAuthorMinimal } from '@/domains/dam/author/types/DamAuthor'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { checkDamConfigName, inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst mapFullToMinimal = (author: DamAuthor): DamAuthorMinimal => ({\n id: author.id,\n name: author.name,\n identifier: author.identifier,\n reviewed: author.flags.reviewed,\n})\n\nconst mapIdToMinimal = (id: DocId): DamAuthorMinimal => {\n return { id: id, name: '', identifier: '', reviewed: false }\n}\n\n// Author name cache per DAM configuration. It uses that configuration's\n// client, address and ext system as they are at request time.\nconst defineCachedAuthors = (configName: string) =>\n defineCached<DocId, DamAuthor, DamAuthorMinimal>(mapFullToMinimal, mapIdToMinimal, (ids) => {\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n const { damClient, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n return fetchAuthorListByIds(damClient, endPointAuthor, cachedExtSystemId.value, ids)\n })\n\n// One cache per configuration name, created on first use. The `default` one is created with the module.\nconst caches = new Map([['default', defineCachedAuthors('default')]])\nconst cacheOf = (configName?: string) => {\n const name = inheritedDamConfigName(configName)\n // Checked on every call: options set again (a test, a hot update) may have removed the name.\n checkDamConfigName(name)\n let cache = caches.get(name)\n if (!cache) {\n cache = defineCachedAuthors(name)\n caches.set(name, cache)\n }\n return cache\n}\n\n/**\n * Author name cache of the DAM configuration `configName`.\n * Without a name, uses the inherited one during component setup,\n * render or a lifecycle hook (not after an `await`), else `default`.\n * After the plugin sets options, an unknown configuration throws\n * on every call. Before that, the first request checks it.\n */\nexport const useDamCachedAuthors = (configName?: string) => {\n const { cache, toFetch, fetch, add, addManual, addManualMinimal, pin, unpin, has, get, isLoaded } =\n cacheOf(configName)\n return {\n addManualToCachedAuthors: addManual,\n addManualMinimalToCachedAuthors: addManualMinimal,\n addToCachedAuthors: add,\n fetchCachedAuthors: fetch,\n pinCachedAuthor: pin,\n unpinCachedAuthor: unpin,\n toFetchCachedAuthors: toFetch,\n cachedAuthors: cache,\n hasCachedAuthor: has,\n getCachedAuthor: get,\n isLoadedCachedAuthor: isLoaded,\n }\n}\n\nexport const useDamCachedAuthorsForRemoteAutocomplete = (configName: string) => {\n const { fetch, add, addManualMinimal } = cacheOf(configName)\n return {\n fetch,\n add,\n addManualMinimal,\n }\n}\n"],"mappings":";;;;;;AAQA,IAAMA,KAAoB,OAAyC;CACjE,IAAIC,EAAO;CACX,MAAMA,EAAO;CACb,YAAYA,EAAO;CACnB,UAAUA,EAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"cachedAuthors.js","names":["mapFullToMinimal","author","mapIdToMinimal","defineCachedAuthors","defineCached","useExtSystemIdForCached","configName","useCommonAdminCoreDamOptions","fetchAuthorListByIds","damClient","endPointAuthor","cachedExtSystemId","ids","caches","cacheOf","name","inheritedDamConfigName","cache","useDamCachedAuthors","addManual","addManualMinimal","add","fetch","pin","unpin","toFetch","has","get","isLoaded","useDamCachedAuthorsForRemoteAutocomplete"],"sources":["../../../../../src/domains/dam/author/composables/cachedAuthors.ts"],"sourcesContent":["import type { DocId } from '@/shared/types/common'\nimport { defineCached } from '@/domains/cached/composables/defineCached'\nimport type { DamAuthor, DamAuthorMinimal } from '@/domains/dam/author/types/DamAuthor'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { checkDamConfigName, inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst mapFullToMinimal = (author: DamAuthor): DamAuthorMinimal => ({\n id: author.id,\n name: author.name,\n identifier: author.identifier,\n reviewed: author.flags.reviewed,\n hiddenInCredit: author.flags.hiddenInCredit,\n})\n\nconst mapIdToMinimal = (id: DocId): DamAuthorMinimal => {\n return { id: id, name: '', identifier: '', reviewed: false, hiddenInCredit: false }\n}\n\n// Author name cache per DAM configuration. It uses that configuration's\n// client, address and ext system as they are at request time.\nconst defineCachedAuthors = (configName: string) =>\n defineCached<DocId, DamAuthor, DamAuthorMinimal>(mapFullToMinimal, mapIdToMinimal, (ids) => {\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n const { damClient, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n return fetchAuthorListByIds(damClient, endPointAuthor, cachedExtSystemId.value, ids)\n })\n\n// One cache per configuration name, created on first use. The `default` one is created with the module.\nconst caches = new Map([['default', defineCachedAuthors('default')]])\nconst cacheOf = (configName?: string) => {\n const name = inheritedDamConfigName(configName)\n // Checked on every call: options set again (a test, a hot update) may have removed the name.\n checkDamConfigName(name)\n let cache = caches.get(name)\n if (!cache) {\n cache = defineCachedAuthors(name)\n caches.set(name, cache)\n }\n return cache\n}\n\n/**\n * Author name cache of the DAM configuration `configName`.\n * Without a name, uses the inherited one during component setup,\n * render or a lifecycle hook (not after an `await`), else `default`.\n * After the plugin sets options, an unknown configuration throws\n * on every call. Before that, the first request checks it.\n */\nexport const useDamCachedAuthors = (configName?: string) => {\n const { cache, toFetch, fetch, add, addManual, addManualMinimal, pin, unpin, has, get, isLoaded } =\n cacheOf(configName)\n return {\n addManualToCachedAuthors: addManual,\n addManualMinimalToCachedAuthors: addManualMinimal,\n addToCachedAuthors: add,\n fetchCachedAuthors: fetch,\n pinCachedAuthor: pin,\n unpinCachedAuthor: unpin,\n toFetchCachedAuthors: toFetch,\n cachedAuthors: cache,\n hasCachedAuthor: has,\n getCachedAuthor: get,\n isLoadedCachedAuthor: isLoaded,\n }\n}\n\nexport const useDamCachedAuthorsForRemoteAutocomplete = (configName: string) => {\n const { fetch, add, addManualMinimal } = cacheOf(configName)\n return {\n fetch,\n add,\n addManualMinimal,\n }\n}\n"],"mappings":";;;;;;AAQA,IAAMA,KAAoB,OAAyC;CACjE,IAAIC,EAAO;CACX,MAAMA,EAAO;CACb,YAAYA,EAAO;CACnB,UAAUA,EAAO,MAAM;CACvB,gBAAgBA,EAAO,MAAM;AAC/B,IAEMC,KAAkB,OACf;CAAM;CAAI,MAAM;CAAI,YAAY;CAAI,UAAU;CAAO,gBAAgB;AAAM,IAK9EC,KAAuB,MAC3BC,EAAiDJ,GAAkBE,IAAiB,MAAQ;CAC1F,IAAM,EAAE,yBAAsBG,EAAwBC,CAAU,GAC1D,EAAE,cAAW,sBAAmBC,EAA6BD,CAAU;CAC7E,OAAOE,EAAqBC,GAAWC,GAAgBC,EAAkB,OAAOC,CAAG;AACrF,CAAC,GAGGC,oBAAS,IAAI,IAAI,CAAC,CAAC,WAAWV,EAAoB,SAAS,CAAC,CAAC,CAAC,GAC9DW,KAAW,MAAwB;CACvC,IAAMC,IAAOC,EAAuBV,CAAU;CAE9C,EAAmBS,CAAI;CACvB,IAAIE,IAAQJ,EAAO,IAAIE,CAAI;CAK3B,OAJKE,MACH,IAAQd,EAAoBY,CAAI,GAChCF,EAAO,IAAIE,GAAME,CAAK,IAEjBA;AACT,GASaC,KAAuB,MAAwB;CAC1D,IAAM,EAAE,UAAO,YAAS,UAAO,QAAK,cAAW,qBAAkB,QAAK,UAAO,QAAK,QAAK,gBACrFJ,EAAQR,CAAU;CACpB,OAAO;EACL,0BAA0Ba;EAC1B,iCAAiCC;EACjC,oBAAoBC;EACpB,oBAAoBC;EACpB,iBAAiBC;EACjB,mBAAmBC;EACnB,sBAAsBC;EACtB,eAAeR;EACf,iBAAiBS;EACjB,iBAAiBC;EACjB,sBAAsBC;CACxB;AACF,GAEaC,KAA4C,MAAuB;CAC9E,IAAM,EAAE,UAAO,QAAK,wBAAqBf,EAAQR,CAAU;CAC3D,OAAO;EACL;EACA;EACA;CACF;AACF"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { DamAssetTypeType } from '../../types/Asset';
|
|
2
2
|
import { IntegerId } from '../../../../shared/types/common';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the asset type of the ext system has authors, from the DAM configuration store of `configName`.
|
|
5
|
+
* Without a name, uses the inherited one in component setup, else `default`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isDamAuthorEnabled: (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => boolean;
|
|
3
8
|
/**
|
|
4
9
|
* Asset type rules of the ext system from the DAM configuration store of `configName`.
|
|
5
10
|
* Without a name, uses the inherited one in component setup, else `default`.
|
|
@@ -3,7 +3,10 @@ import { inheritedDamConfigName as t } from "../../composables/damConfigName.js"
|
|
|
3
3
|
import { isUndefined as n } from "../../../../shared/utils/common.js";
|
|
4
4
|
import { computed as r } from "vue";
|
|
5
5
|
// src/domains/dam/author/composables/damAuthorConfig.ts
|
|
6
|
-
var i = (
|
|
6
|
+
var i = (n, r, i) => {
|
|
7
|
+
let { getDamConfigExtSystem: a } = e(void 0, t(i));
|
|
8
|
+
return !!a(r)?.[n]?.authors?.enabled;
|
|
9
|
+
}, a = (i, a, o) => {
|
|
7
10
|
let { getDamConfigExtSystem: s } = e(void 0, t(o)), c = s(a);
|
|
8
11
|
if (n(c)) throw Error("useDamAuthorAssetTypeConfig: Ext system must be initialised.");
|
|
9
12
|
return {
|
|
@@ -11,6 +14,6 @@ var i = (i, a, o) => {
|
|
|
11
14
|
authorRequired: r(() => !!c[i]?.authors?.required)
|
|
12
15
|
};
|
|
13
16
|
};
|
|
14
|
-
export { i as useDamAuthorAssetTypeConfig };
|
|
17
|
+
export { i as isDamAuthorEnabled, a as useDamAuthorAssetTypeConfig };
|
|
15
18
|
|
|
16
19
|
//# sourceMappingURL=damAuthorConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"damAuthorConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"damAuthorConfig.js","names":["isDamAuthorEnabled","useDamConfigState","inheritedDamConfigName","configName","getDamConfigExtSystem","extSystem","assetType","useDamAuthorAssetTypeConfig","configExtSystem","isUndefined","computed"],"sources":["../../../../../src/domains/dam/author/composables/damAuthorConfig.ts"],"sourcesContent":["import { computed } from 'vue'\nimport type { DamAssetTypeType } from '@/domains/dam/types/Asset'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport type { IntegerId } from '@/shared/types/common'\nimport { isUndefined } from '@/shared/utils/common'\n\n/**\n * Whether the asset type of the ext system has authors, from the DAM configuration store of `configName`.\n * Without a name, uses the inherited one in component setup, else `default`.\n */\nexport const isDamAuthorEnabled = (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => {\n const { getDamConfigExtSystem } = useDamConfigState(undefined, inheritedDamConfigName(configName))\n return !!getDamConfigExtSystem(extSystem)?.[assetType]?.authors?.enabled\n}\n\n/**\n * Asset type rules of the ext system from the DAM configuration store of `configName`.\n * Without a name, uses the inherited one in component setup, else `default`.\n */\nexport const useDamAuthorAssetTypeConfig = (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => {\n const { getDamConfigExtSystem } = useDamConfigState(undefined, inheritedDamConfigName(configName))\n const configExtSystem = getDamConfigExtSystem(extSystem)\n\n if (isUndefined(configExtSystem)) {\n throw new Error('useDamAuthorAssetTypeConfig: Ext system must be initialised.')\n }\n\n const authorEnabled = computed(() => {\n return !!configExtSystem[assetType]?.authors?.enabled\n })\n\n const authorRequired = computed(() => {\n return !!configExtSystem[assetType]?.authors?.required\n })\n\n return {\n authorEnabled,\n authorRequired,\n }\n}\n"],"mappings":";;;;;AAWA,IAAaA,KAAsB,GAA6B,GAAsB,MAAwB;CAC5G,IAAM,EAAE,6BAA0BC,EAAkB,KAAA,GAAWC,EAAuBC,CAAU,CAAC;CACjG,OAAO,CAAC,CAACC,EAAsBC,CAAS,CAAC,GAAGC,EAAU,EAAE,SAAS;AACnE,GAMaC,KAA+B,GAA6B,GAAsB,MAAwB;CACrH,IAAM,EAAE,6BAA0BN,EAAkB,KAAA,GAAWC,EAAuBC,CAAU,CAAC,GAC3FK,IAAkBJ,EAAsBC,CAAS;CAEvD,IAAII,EAAYD,CAAe,GAC7B,MAAU,MAAM,8DAA8D;CAWhF,OAAO;EACL,eAToBE,QACb,CAAC,CAACF,EAAgBF,EAAU,EAAE,SAAS,OAQ9C;EACA,gBANqBI,QACd,CAAC,CAACF,EAAgBF,EAAU,EAAE,SAAS,QAK9C;CACF;AACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import { DocId, IntegerId } from '../../../../shared/types/common';
|
|
4
|
+
import { DamAuthor, DamAuthorMinimal } from '../types/DamAuthor';
|
|
5
|
+
import { DamExtSystemAssetTypeSources, DamExtSystemConfig } from '../../types/DamConfig';
|
|
6
|
+
export type DamCreditConfig = Pick<DamExtSystemAssetTypeSources, 'creditFormat' | 'creditSourcesSeparator' | 'creditAuthorsSeparator'>;
|
|
7
|
+
/**
|
|
8
|
+
* Used where the ext system gives no credit format: not loaded, or a DAM without sources.
|
|
9
|
+
* Authors alone then read as before sources: their names joined by a comma.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DAM_CREDIT_CONFIG_DEFAULT: Readonly<DamCreditConfig>;
|
|
12
|
+
/** Credit format of the images of an ext system configuration, else the default. */
|
|
13
|
+
export declare const damCreditConfigOf: (extSystemConfig: DamExtSystemConfig | undefined) => DamCreditConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Credit format of an ext system's images in the DAM configuration store of `configName`.
|
|
16
|
+
* Call in setup: the store is taken now, and the returned function may run after awaits.
|
|
17
|
+
* Without a name, uses the inherited one, else `default`.
|
|
18
|
+
* An ext system not loaded takes the format of `fallbackExtSystem` when that one is loaded, else the default.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDamCreditConfig(configName?: string): (extSystem: IntegerId, fallbackExtSystem?: IntegerId) => DamCreditConfig;
|
|
21
|
+
/** Whether neither sources nor authors are given. A list a DAM did not send counts as empty. */
|
|
22
|
+
export declare const hasNoDamCredit: (authorIds: DocId[] | undefined, sourceIds: DocId[] | undefined) => boolean;
|
|
23
|
+
type DamCreditName = Pick<DamAuthorMinimal, 'name' | 'hiddenInCredit'>;
|
|
24
|
+
/** Credit text: sources and authors joined by their separators, both sides by the format, or one side alone. */
|
|
25
|
+
export declare function damCredit(sources: DamCreditName[], authors: DamCreditName[], config: DamCreditConfig): string;
|
|
26
|
+
export declare function damCreditFromMap(authorsMap: Map<DocId, DamAuthor>, sourceIds: DocId[] | undefined, authorIds: DocId[] | undefined, config: DamCreditConfig): string;
|
|
27
|
+
/**
|
|
28
|
+
* Credit of the picked sources and authors from cached names, for a preview under the fields.
|
|
29
|
+
* Call in setup. Without a configuration name, uses the inherited one, else `default`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useDamCreditPreview(getCached: (id: DocId) => DamCreditName | undefined, extSystem: MaybeRefOrGetter<IntegerId>, sourceIds: MaybeRefOrGetter<DocId[]>, authorIds: MaybeRefOrGetter<DocId[]>, configName?: string): import('vue').ComputedRef<string>;
|
|
32
|
+
export declare function fetchDamAuthorsMap(client: () => AxiosInstance, endPointAuthor: string, extSystem: IntegerId, ids: DocId[]): Promise<Map<DocId, DamAuthor>>;
|
|
33
|
+
/** Credit of the sources and authors, with names read from the DAM under `extSystem` and the format `config`. */
|
|
34
|
+
export declare function fetchDamCredit(client: () => AxiosInstance, endPointAuthor: string, extSystem: IntegerId, sourceIds: DocId[] | undefined, authorIds: DocId[] | undefined, config: DamCreditConfig): Promise<string>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { fetchAuthorListByIds as e } from "../api/authorApi.js";
|
|
2
|
+
import { isUndefined as t } from "../../../../shared/utils/common.js";
|
|
3
|
+
import { DamAssetType as n } from "../../types/Asset.js";
|
|
4
|
+
import { useDamConfigState as r } from "../../config/composables/damConfigState.js";
|
|
5
|
+
import { inheritedDamConfigName as i } from "../../composables/damConfigName.js";
|
|
6
|
+
import { computed as a, toValue as o } from "vue";
|
|
7
|
+
// src/domains/dam/author/composables/damCredit.ts
|
|
8
|
+
var s = {
|
|
9
|
+
creditFormat: "{sources}/{authors}",
|
|
10
|
+
creditSourcesSeparator: "/",
|
|
11
|
+
creditAuthorsSeparator: ", "
|
|
12
|
+
}, c = (e) => e?.[n.Image]?.sources ?? s;
|
|
13
|
+
function l(e) {
|
|
14
|
+
let { getDamConfigExtSystem: n } = r(void 0, i(e));
|
|
15
|
+
return (e, r) => c(n(e) ?? (t(r) ? void 0 : n(r)));
|
|
16
|
+
}
|
|
17
|
+
var u = (e, t) => (e?.length ?? 0) === 0 && (t?.length ?? 0) === 0, d = (e, t) => e.filter((e) => !e.hiddenInCredit).map((e) => e.name.trim()).filter((e) => e.length > 0).join(t);
|
|
18
|
+
function f(e, t, n) {
|
|
19
|
+
let r = d(e, n.creditSourcesSeparator), i = d(t, n.creditAuthorsSeparator);
|
|
20
|
+
return r.length > 0 && i.length > 0 ? n.creditFormat.replace("{sources}", () => r).replace("{authors}", () => i) : r.length > 0 ? r : i;
|
|
21
|
+
}
|
|
22
|
+
function p(e, n, r, i) {
|
|
23
|
+
let a = (n) => (n ?? []).map((t) => e.get(t)).filter((e) => !t(e)).map((e) => ({
|
|
24
|
+
name: e.name,
|
|
25
|
+
hiddenInCredit: !!e.flags?.hiddenInCredit
|
|
26
|
+
}));
|
|
27
|
+
return f(a(n), a(r), i);
|
|
28
|
+
}
|
|
29
|
+
function m(e, n, r, i, s) {
|
|
30
|
+
let c = l(s), u = (n) => n.map((t) => e(t)).filter((e) => !t(e));
|
|
31
|
+
return a(() => f(u(o(r)), u(o(i)), c(o(n))));
|
|
32
|
+
}
|
|
33
|
+
async function h(t, n, r, i) {
|
|
34
|
+
let a = [...new Set(i)];
|
|
35
|
+
if (a.length === 0) return /* @__PURE__ */ new Map();
|
|
36
|
+
let o = await e(t, n, r, a);
|
|
37
|
+
return new Map(o.map((e) => [e.id, e]));
|
|
38
|
+
}
|
|
39
|
+
async function g(e, t, n, r, i, a) {
|
|
40
|
+
return u(i, r) ? "" : p(await h(e, t, n, [...r ?? [], ...i ?? []]), r, i, a);
|
|
41
|
+
}
|
|
42
|
+
export { s as DAM_CREDIT_CONFIG_DEFAULT, f as damCredit, c as damCreditConfigOf, p as damCreditFromMap, h as fetchDamAuthorsMap, g as fetchDamCredit, u as hasNoDamCredit, l as useDamCreditConfig, m as useDamCreditPreview };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=damCredit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"damCredit.js","names":["DAM_CREDIT_CONFIG_DEFAULT","damCreditConfigOf","extSystemConfig","DamAssetType","useDamCreditConfig","useDamConfigState","inheritedDamConfigName","configName","getDamConfigExtSystem","extSystem","isUndefined","fallbackExtSystem","hasNoDamCredit","authorIds","sourceIds","joinNames","items","item","name","separator","damCredit","sourcesText","sources","config","authorsText","authors","damCreditFromMap","pick","ids","authorsMap","id","useDamCreditPreview","creditConfigOf","getCached","computed","toValue","fetchDamAuthorsMap","unique","fetchAuthorListByIds","client","endPointAuthor","author","fetchDamCredit"],"sources":["../../../../../src/domains/dam/author/composables/damCredit.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios'\nimport { computed, type MaybeRefOrGetter, toValue } from 'vue'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport type { DamAuthor, DamAuthorMinimal } from '@/domains/dam/author/types/DamAuthor'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { isUndefined } from '@/shared/utils/common'\nimport { DamAssetType } from '@/domains/dam/types/Asset'\nimport type { DamExtSystemAssetTypeSources, DamExtSystemConfig } from '@/domains/dam/types/DamConfig'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nexport type DamCreditConfig = Pick<\n DamExtSystemAssetTypeSources,\n 'creditFormat' | 'creditSourcesSeparator' | 'creditAuthorsSeparator'\n>\n\n/**\n * Used where the ext system gives no credit format: not loaded, or a DAM without sources.\n * Authors alone then read as before sources: their names joined by a comma.\n */\nexport const DAM_CREDIT_CONFIG_DEFAULT: Readonly<DamCreditConfig> = {\n creditFormat: '{sources}/{authors}',\n creditSourcesSeparator: '/',\n creditAuthorsSeparator: ', ',\n}\n\n/** Credit format of the images of an ext system configuration, else the default. */\nexport const damCreditConfigOf = (extSystemConfig: DamExtSystemConfig | undefined): DamCreditConfig =>\n extSystemConfig?.[DamAssetType.Image]?.sources ?? DAM_CREDIT_CONFIG_DEFAULT\n\n/**\n * Credit format of an ext system's images in the DAM configuration store of `configName`.\n * Call in setup: the store is taken now, and the returned function may run after awaits.\n * Without a name, uses the inherited one, else `default`.\n * An ext system not loaded takes the format of `fallbackExtSystem` when that one is loaded, else the default.\n */\nexport function useDamCreditConfig(configName?: string) {\n const { getDamConfigExtSystem } = useDamConfigState(undefined, inheritedDamConfigName(configName))\n return (extSystem: IntegerId, fallbackExtSystem?: IntegerId): DamCreditConfig =>\n damCreditConfigOf(\n getDamConfigExtSystem(extSystem) ??\n (isUndefined(fallbackExtSystem) ? undefined : getDamConfigExtSystem(fallbackExtSystem))\n )\n}\n\n/** Whether neither sources nor authors are given. A list a DAM did not send counts as empty. */\nexport const hasNoDamCredit = (authorIds: DocId[] | undefined, sourceIds: DocId[] | undefined) =>\n (authorIds?.length ?? 0) === 0 && (sourceIds?.length ?? 0) === 0\n\ntype DamCreditName = Pick<DamAuthorMinimal, 'name' | 'hiddenInCredit'>\n\nconst joinNames = (items: DamCreditName[], separator: string) =>\n items\n .filter((item) => !item.hiddenInCredit)\n .map((item) => item.name.trim())\n .filter((name) => name.length > 0)\n .join(separator)\n\n/** Credit text: sources and authors joined by their separators, both sides by the format, or one side alone. */\nexport function damCredit(sources: DamCreditName[], authors: DamCreditName[], config: DamCreditConfig): string {\n const sourcesText = joinNames(sources, config.creditSourcesSeparator)\n const authorsText = joinNames(authors, config.creditAuthorsSeparator)\n if (sourcesText.length > 0 && authorsText.length > 0) {\n return config.creditFormat.replace('{sources}', () => sourcesText).replace('{authors}', () => authorsText)\n }\n return sourcesText.length > 0 ? sourcesText : authorsText\n}\n\nexport function damCreditFromMap(\n authorsMap: Map<DocId, DamAuthor>,\n sourceIds: DocId[] | undefined,\n authorIds: DocId[] | undefined,\n config: DamCreditConfig\n): string {\n const pick = (ids: DocId[] | undefined) =>\n (ids ?? [])\n .map((id) => authorsMap.get(id))\n .filter((item): item is DamAuthor => !isUndefined(item))\n .map((item) => ({ name: item.name, hiddenInCredit: !!item.flags?.hiddenInCredit }))\n return damCredit(pick(sourceIds), pick(authorIds), config)\n}\n\n/**\n * Credit of the picked sources and authors from cached names, for a preview under the fields.\n * Call in setup. Without a configuration name, uses the inherited one, else `default`.\n */\nexport function useDamCreditPreview(\n getCached: (id: DocId) => DamCreditName | undefined,\n extSystem: MaybeRefOrGetter<IntegerId>,\n sourceIds: MaybeRefOrGetter<DocId[]>,\n authorIds: MaybeRefOrGetter<DocId[]>,\n configName?: string\n) {\n const creditConfigOf = useDamCreditConfig(configName)\n const pick = (ids: DocId[]) =>\n ids.map((id) => getCached(id)).filter((item): item is DamCreditName => !isUndefined(item))\n return computed(() =>\n damCredit(pick(toValue(sourceIds)), pick(toValue(authorIds)), creditConfigOf(toValue(extSystem)))\n )\n}\n\nexport async function fetchDamAuthorsMap(\n client: () => AxiosInstance,\n endPointAuthor: string,\n extSystem: IntegerId,\n ids: DocId[]\n): Promise<Map<DocId, DamAuthor>> {\n const unique = [...new Set(ids)]\n if (unique.length === 0) return new Map()\n const authors = await fetchAuthorListByIds(client, endPointAuthor, extSystem, unique)\n return new Map(authors.map((author) => [author.id, author]))\n}\n\n/** Credit of the sources and authors, with names read from the DAM under `extSystem` and the format `config`. */\nexport async function fetchDamCredit(\n client: () => AxiosInstance,\n endPointAuthor: string,\n extSystem: IntegerId,\n sourceIds: DocId[] | undefined,\n authorIds: DocId[] | undefined,\n config: DamCreditConfig\n): Promise<string> {\n if (hasNoDamCredit(authorIds, sourceIds)) return ''\n const authorsMap = await fetchDamAuthorsMap(client, endPointAuthor, extSystem, [\n ...(sourceIds ?? []),\n ...(authorIds ?? []),\n ])\n return damCreditFromMap(authorsMap, sourceIds, authorIds, config)\n}\n"],"mappings":";;;;;;;AAoBA,IAAaA,IAAuD;CAClE,cAAc;CACd,wBAAwB;CACxB,wBAAwB;AAC1B,GAGaC,KAAqB,MAChCC,IAAkBC,EAAa,MAAM,EAAE,WAAWH;AAQpD,SAAgBI,EAAmB,GAAqB;CACtD,IAAM,EAAE,6BAA0BC,EAAkB,KAAA,GAAWC,EAAuBC,CAAU,CAAC;CACjG,QAAQ,GAAsB,MAC5BN,EACEO,EAAsBC,CAAS,MAC5BC,EAAYC,CAAiB,IAAI,KAAA,IAAYH,EAAsBG,CAAiB,EACzF;AACJ;AAGA,IAAaC,KAAkB,GAAgC,OAC5DC,GAAW,UAAU,OAAO,MAAMC,GAAW,UAAU,OAAO,GAI3DC,KAAa,GAAwB,MACzCC,EACG,QAAQ,MAAS,CAACC,EAAK,cAAc,CAAC,CACtC,KAAK,MAASA,EAAK,KAAK,KAAK,CAAC,CAAC,CAC/B,QAAQ,MAASC,EAAK,SAAS,CAAC,CAAC,CACjC,KAAKC,CAAS;AAGnB,SAAgBC,EAAU,GAA0B,GAA0B,GAAiC;CAC7G,IAAMC,IAAcN,EAAUO,GAASC,EAAO,sBAAsB,GAC9DC,IAAcT,EAAUU,GAASF,EAAO,sBAAsB;CAIpE,OAHIF,EAAY,SAAS,KAAKG,EAAY,SAAS,IAC1CD,EAAO,aAAa,QAAQ,mBAAmBF,CAAW,CAAC,CAAC,QAAQ,mBAAmBG,CAAW,IAEpGH,EAAY,SAAS,IAAIA,IAAcG;AAChD;AAEA,SAAgBE,EACd,GACA,GACA,GACA,GACQ;CACR,IAAMC,KAAQ,OACXC,KAAO,CAAC,EAAA,CACN,KAAK,MAAOC,EAAW,IAAIC,CAAE,CAAC,CAAC,CAC/B,QAAQ,MAA4B,CAACpB,EAAYO,CAAI,CAAC,CAAC,CACvD,KAAK,OAAU;EAAE,MAAMA,EAAK;EAAM,gBAAgB,CAAC,CAACA,EAAK,OAAO;CAAe,EAAE;CACtF,OAAOG,EAAUO,EAAKb,CAAS,GAAGa,EAAKd,CAAS,GAAGU,CAAM;AAC3D;AAMA,SAAgBQ,EACd,GACA,GACA,GACA,GACA,GACA;CACA,IAAMC,IAAiB5B,EAAmBG,CAAU,GAC9CoB,KAAQ,MACZC,EAAI,KAAK,MAAOK,EAAUH,CAAE,CAAC,CAAC,CAAC,QAAQ,MAAgC,CAACpB,EAAYO,CAAI,CAAC;CAC3F,OAAOiB,QACLd,EAAUO,EAAKQ,EAAQrB,CAAS,CAAC,GAAGa,EAAKQ,EAAQtB,CAAS,CAAC,GAAGmB,EAAeG,EAAQ1B,CAAS,CAAC,CAAC,CAClG;AACF;AAEA,eAAsB2B,EACpB,GACA,GACA,GACA,GACgC;CAChC,IAAMC,IAAS,CAAC,GAAG,IAAI,IAAIT,CAAG,CAAC;CAC/B,IAAIS,EAAO,WAAW,GAAG,uBAAO,IAAI,IAAI;CACxC,IAAMZ,IAAU,MAAMa,EAAqBC,GAAQC,GAAgB/B,GAAW4B,CAAM;CACpF,OAAO,IAAI,IAAIZ,EAAQ,KAAK,MAAW,CAACgB,EAAO,IAAIA,CAAM,CAAC,CAAC;AAC7D;AAGA,eAAsBC,EACpB,GACA,GACA,GACA,GACA,GACA,GACiB;CAMjB,OALI9B,EAAeC,GAAWC,CAAS,IAAU,KAK1CY,EAAiB,MAJCU,EAAmBG,GAAQC,GAAgB/B,GAAW,CAC7E,GAAIK,KAAa,CAAC,GAClB,GAAID,KAAa,CAAC,CACpB,CAAC,GACmCC,GAAWD,GAAWU,CAAM;AAClE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DamAssetTypeType } from '../../types/Asset';
|
|
2
|
+
import { IntegerId } from '../../../../shared/types/common';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the asset type of the ext system has sources, from the DAM configuration store of `configName`.
|
|
5
|
+
* Without a name, uses the inherited one in component setup, else `default`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isDamSourceEnabled: (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Source rules of the asset type of the ext system from the DAM configuration store of `configName`.
|
|
10
|
+
* Without a name, uses the inherited one in component setup, else `default`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useDamSourceAssetTypeConfig: (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => {
|
|
13
|
+
sourceEnabled: import('vue').ComputedRef<boolean>;
|
|
14
|
+
sourceRequired: import('vue').ComputedRef<boolean>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useDamConfigState as e } from "../../config/composables/damConfigState.js";
|
|
2
|
+
import { inheritedDamConfigName as t } from "../../composables/damConfigName.js";
|
|
3
|
+
import { isUndefined as n } from "../../../../shared/utils/common.js";
|
|
4
|
+
import { computed as r } from "vue";
|
|
5
|
+
// src/domains/dam/author/composables/damSourceConfig.ts
|
|
6
|
+
var i = (n, r, i) => {
|
|
7
|
+
let { getDamConfigExtSystem: a } = e(void 0, t(i));
|
|
8
|
+
return !!a(r)?.[n]?.sources?.enabled;
|
|
9
|
+
}, a = (i, a, o) => {
|
|
10
|
+
let { getDamConfigExtSystem: s } = e(void 0, t(o)), c = s(a);
|
|
11
|
+
if (n(c)) throw Error("useDamSourceAssetTypeConfig: Ext system must be initialised.");
|
|
12
|
+
return {
|
|
13
|
+
sourceEnabled: r(() => !!c[i]?.sources?.enabled),
|
|
14
|
+
sourceRequired: r(() => !!c[i]?.sources?.required)
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export { i as isDamSourceEnabled, a as useDamSourceAssetTypeConfig };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=damSourceConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"damSourceConfig.js","names":["isDamSourceEnabled","useDamConfigState","inheritedDamConfigName","configName","getDamConfigExtSystem","extSystem","assetType","useDamSourceAssetTypeConfig","configExtSystem","isUndefined","computed"],"sources":["../../../../../src/domains/dam/author/composables/damSourceConfig.ts"],"sourcesContent":["import { computed } from 'vue'\nimport type { DamAssetTypeType } from '@/domains/dam/types/Asset'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport type { IntegerId } from '@/shared/types/common'\nimport { isUndefined } from '@/shared/utils/common'\n\n/**\n * Whether the asset type of the ext system has sources, from the DAM configuration store of `configName`.\n * Without a name, uses the inherited one in component setup, else `default`.\n */\nexport const isDamSourceEnabled = (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => {\n const { getDamConfigExtSystem } = useDamConfigState(undefined, inheritedDamConfigName(configName))\n return !!getDamConfigExtSystem(extSystem)?.[assetType]?.sources?.enabled\n}\n\n/**\n * Source rules of the asset type of the ext system from the DAM configuration store of `configName`.\n * Without a name, uses the inherited one in component setup, else `default`.\n */\nexport const useDamSourceAssetTypeConfig = (assetType: DamAssetTypeType, extSystem: IntegerId, configName?: string) => {\n const { getDamConfigExtSystem } = useDamConfigState(undefined, inheritedDamConfigName(configName))\n const configExtSystem = getDamConfigExtSystem(extSystem)\n\n if (isUndefined(configExtSystem)) {\n throw new Error('useDamSourceAssetTypeConfig: Ext system must be initialised.')\n }\n\n const sourceEnabled = computed(() => {\n return !!configExtSystem[assetType]?.sources?.enabled\n })\n\n const sourceRequired = computed(() => {\n return !!configExtSystem[assetType]?.sources?.required\n })\n\n return {\n sourceEnabled,\n sourceRequired,\n }\n}\n"],"mappings":";;;;;AAWA,IAAaA,KAAsB,GAA6B,GAAsB,MAAwB;CAC5G,IAAM,EAAE,6BAA0BC,EAAkB,KAAA,GAAWC,EAAuBC,CAAU,CAAC;CACjG,OAAO,CAAC,CAACC,EAAsBC,CAAS,CAAC,GAAGC,EAAU,EAAE,SAAS;AACnE,GAMaC,KAA+B,GAA6B,GAAsB,MAAwB;CACrH,IAAM,EAAE,6BAA0BN,EAAkB,KAAA,GAAWC,EAAuBC,CAAU,CAAC,GAC3FK,IAAkBJ,EAAsBC,CAAS;CAEvD,IAAII,EAAYD,CAAe,GAC7B,MAAU,MAAM,8DAA8D;CAWhF,OAAO;EACL,eAToBE,QACb,CAAC,CAACF,EAAgBF,EAAU,EAAE,SAAS,OAQ9C;EACA,gBANqBI,QACd,CAAC,CAACF,EAAgBF,EAAU,EAAE,SAAS,QAK9C;CACF;AACF"}
|