@axinom/mosaic-managed-workflow-integration 0.31.0 → 0.32.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/cjs/common/default-extension-value.d.ts.map +1 -0
  2. package/dist/cjs/common/index.d.ts.map +1 -0
  3. package/dist/cjs/common/types/index.d.ts.map +1 -0
  4. package/dist/cjs/common/types/models.d.ts.map +1 -0
  5. package/dist/cjs/enums/index.d.ts.map +1 -0
  6. package/dist/cjs/enums/tile-names.d.ts.map +1 -0
  7. package/dist/cjs/hosting/get-object-storages.d.ts.map +1 -0
  8. package/dist/cjs/hosting/hosting-extensions.d.ts +4 -0
  9. package/dist/cjs/hosting/hosting-extensions.d.ts.map +1 -0
  10. package/dist/cjs/hosting/index.d.ts.map +1 -0
  11. package/dist/{hosting → cjs/hosting}/types/azure-hosting-storage-selector.d.ts +2 -2
  12. package/dist/cjs/hosting/types/azure-hosting-storage-selector.d.ts.map +1 -0
  13. package/dist/{hosting → cjs/hosting}/types/hosting-extensions.d.ts +1 -1
  14. package/dist/cjs/hosting/types/hosting-extensions.d.ts.map +1 -0
  15. package/dist/cjs/hosting/types/index.d.ts.map +1 -0
  16. package/dist/{image → cjs/image}/image-extensions.d.ts +2 -2
  17. package/dist/cjs/image/image-extensions.d.ts.map +1 -0
  18. package/dist/cjs/image/image-station-names.d.ts.map +1 -0
  19. package/dist/cjs/image/index.d.ts.map +1 -0
  20. package/dist/{image → cjs/image}/thumbnail-renderer.d.ts +2 -2
  21. package/dist/cjs/image/thumbnail-renderer.d.ts.map +1 -0
  22. package/dist/cjs/image/types/image-cover-extension.d.ts.map +1 -0
  23. package/dist/{image → cjs/image}/types/image-explorer-extension.d.ts +2 -2
  24. package/dist/cjs/image/types/image-explorer-extension.d.ts.map +1 -0
  25. package/dist/cjs/image/types/image-extensions.d.ts +13 -0
  26. package/dist/cjs/image/types/image-extensions.d.ts.map +1 -0
  27. package/dist/{image → cjs/image}/types/image-preview-extension.d.ts +1 -1
  28. package/dist/cjs/image/types/image-preview-extension.d.ts.map +1 -0
  29. package/dist/cjs/image/types/image-route-resolvers.d.ts.map +1 -0
  30. package/dist/{image → cjs/image}/types/image-select-field-extension.d.ts +2 -2
  31. package/dist/cjs/image/types/image-select-field-extension.d.ts.map +1 -0
  32. package/dist/cjs/image/types/index.d.ts.map +1 -0
  33. package/dist/{image → cjs/image}/types/single-image-select-field-extension.d.ts +2 -2
  34. package/dist/cjs/image/types/single-image-select-field-extension.d.ts.map +1 -0
  35. package/dist/cjs/image/types/thumbnail-renderer.d.ts.map +1 -0
  36. package/dist/cjs/index.d.ts.map +1 -0
  37. package/dist/cjs/index.js +264 -0
  38. package/dist/cjs/index.js.map +1 -0
  39. package/dist/{initialize.d.ts → cjs/initialize.d.ts} +1 -1
  40. package/dist/cjs/initialize.d.ts.map +1 -0
  41. package/dist/cjs/localization/helpers/index.d.ts.map +1 -0
  42. package/dist/{localization → cjs/localization}/helpers/localization-generator.d.ts +1 -1
  43. package/dist/cjs/localization/helpers/localization-generator.d.ts.map +1 -0
  44. package/dist/cjs/localization/index.d.ts.map +1 -0
  45. package/dist/cjs/localization/types/index.d.ts.map +1 -0
  46. package/dist/cjs/localization/types/localization-generator.d.ts.map +1 -0
  47. package/dist/cjs/package.json +1 -0
  48. package/dist/{piral-extensions.d.ts → cjs/piral-extensions.d.ts} +1 -1
  49. package/dist/cjs/piral-extensions.d.ts.map +1 -0
  50. package/dist/cjs/state.d.ts +13 -0
  51. package/dist/cjs/state.d.ts.map +1 -0
  52. package/dist/esm/common/default-extension-value.d.ts +7 -0
  53. package/dist/esm/common/default-extension-value.d.ts.map +1 -0
  54. package/dist/esm/common/index.d.ts +3 -0
  55. package/dist/esm/common/index.d.ts.map +1 -0
  56. package/dist/esm/common/types/index.d.ts +2 -0
  57. package/dist/esm/common/types/index.d.ts.map +1 -0
  58. package/dist/esm/common/types/models.d.ts +18 -0
  59. package/dist/esm/common/types/models.d.ts.map +1 -0
  60. package/dist/esm/enums/index.d.ts +2 -0
  61. package/dist/esm/enums/index.d.ts.map +1 -0
  62. package/dist/esm/enums/tile-names.d.ts +21 -0
  63. package/dist/esm/enums/tile-names.d.ts.map +1 -0
  64. package/dist/esm/hosting/get-object-storages.d.ts +13 -0
  65. package/dist/esm/hosting/get-object-storages.d.ts.map +1 -0
  66. package/dist/esm/hosting/hosting-extensions.d.ts +4 -0
  67. package/dist/esm/hosting/hosting-extensions.d.ts.map +1 -0
  68. package/dist/esm/hosting/index.d.ts +4 -0
  69. package/dist/esm/hosting/index.d.ts.map +1 -0
  70. package/dist/esm/hosting/types/azure-hosting-storage-selector.d.ts +17 -0
  71. package/dist/esm/hosting/types/azure-hosting-storage-selector.d.ts.map +1 -0
  72. package/dist/esm/hosting/types/hosting-extensions.d.ts +8 -0
  73. package/dist/esm/hosting/types/hosting-extensions.d.ts.map +1 -0
  74. package/dist/esm/hosting/types/index.d.ts +3 -0
  75. package/dist/esm/hosting/types/index.d.ts.map +1 -0
  76. package/dist/esm/image/image-extensions.d.ts +7 -0
  77. package/dist/esm/image/image-extensions.d.ts.map +1 -0
  78. package/dist/esm/image/image-station-names.d.ts +8 -0
  79. package/dist/esm/image/image-station-names.d.ts.map +1 -0
  80. package/dist/esm/image/index.d.ts +5 -0
  81. package/dist/esm/image/index.d.ts.map +1 -0
  82. package/dist/{image/thumbnail-renderer.js → esm/image/thumbnail-renderer.d.ts} +4 -21
  83. package/dist/esm/image/thumbnail-renderer.d.ts.map +1 -0
  84. package/dist/esm/image/types/image-cover-extension.d.ts +5 -0
  85. package/dist/esm/image/types/image-cover-extension.d.ts.map +1 -0
  86. package/dist/esm/image/types/image-explorer-extension.d.ts +46 -0
  87. package/dist/esm/image/types/image-explorer-extension.d.ts.map +1 -0
  88. package/dist/esm/image/types/image-extensions.d.ts +13 -0
  89. package/dist/esm/image/types/image-extensions.d.ts.map +1 -0
  90. package/dist/esm/image/types/image-preview-extension.d.ts +8 -0
  91. package/dist/esm/image/types/image-preview-extension.d.ts.map +1 -0
  92. package/dist/esm/image/types/image-route-resolvers.d.ts +4 -0
  93. package/dist/esm/image/types/image-route-resolvers.d.ts.map +1 -0
  94. package/dist/esm/image/types/image-select-field-extension.d.ts +25 -0
  95. package/dist/esm/image/types/image-select-field-extension.d.ts.map +1 -0
  96. package/dist/esm/image/types/index.d.ts +9 -0
  97. package/dist/esm/image/types/index.d.ts.map +1 -0
  98. package/dist/esm/image/types/single-image-select-field-extension.d.ts +7 -0
  99. package/dist/esm/image/types/single-image-select-field-extension.d.ts.map +1 -0
  100. package/dist/esm/image/types/thumbnail-renderer.d.ts +40 -0
  101. package/dist/esm/image/types/thumbnail-renderer.d.ts.map +1 -0
  102. package/dist/esm/index.d.ts +8 -0
  103. package/dist/esm/index.d.ts.map +1 -0
  104. package/dist/esm/index.js +246 -0
  105. package/dist/esm/index.js.map +1 -0
  106. package/dist/esm/initialize.d.ts +8 -0
  107. package/dist/esm/initialize.d.ts.map +1 -0
  108. package/dist/esm/localization/helpers/index.d.ts +2 -0
  109. package/dist/esm/localization/helpers/index.d.ts.map +1 -0
  110. package/dist/{localization/helpers/localization-generator.js → esm/localization/helpers/localization-generator.d.ts} +16 -31
  111. package/dist/esm/localization/helpers/localization-generator.d.ts.map +1 -0
  112. package/dist/esm/localization/index.d.ts +3 -0
  113. package/dist/esm/localization/index.d.ts.map +1 -0
  114. package/dist/esm/localization/types/index.d.ts +2 -0
  115. package/dist/esm/localization/types/index.d.ts.map +1 -0
  116. package/dist/esm/localization/types/localization-generator.d.ts +38 -0
  117. package/dist/esm/localization/types/localization-generator.d.ts.map +1 -0
  118. package/dist/esm/package.json +1 -0
  119. package/dist/esm/piral-extensions.d.ts +10 -0
  120. package/dist/esm/piral-extensions.d.ts.map +1 -0
  121. package/dist/esm/state.d.ts +13 -0
  122. package/dist/esm/state.d.ts.map +1 -0
  123. package/package.json +23 -8
  124. package/src/common/types/models.ts +1 -0
  125. package/src/hosting/get-object-storages.tsx +2 -2
  126. package/src/hosting/hosting-extensions.tsx +3 -3
  127. package/src/hosting/types/azure-hosting-storage-selector.ts +2 -2
  128. package/src/hosting/types/hosting-extensions.ts +1 -1
  129. package/src/image/image-extensions.tsx +2 -2
  130. package/src/image/thumbnail-renderer.tsx +11 -7
  131. package/src/image/types/image-explorer-extension.ts +2 -2
  132. package/src/image/types/image-extensions.ts +5 -5
  133. package/src/image/types/image-preview-extension.ts +1 -1
  134. package/src/image/types/image-select-field-extension.ts +2 -2
  135. package/src/image/types/single-image-select-field-extension.ts +2 -2
  136. package/src/initialize.ts +7 -3
  137. package/src/localization/helpers/localization-generator.ts +12 -6
  138. package/src/piral-extensions.ts +1 -1
  139. package/src/state.ts +55 -0
  140. package/dist/common/default-extension-value.d.ts.map +0 -1
  141. package/dist/common/default-extension-value.js +0 -22
  142. package/dist/common/default-extension-value.js.map +0 -1
  143. package/dist/common/index.d.ts.map +0 -1
  144. package/dist/common/index.js +0 -19
  145. package/dist/common/index.js.map +0 -1
  146. package/dist/common/types/index.d.ts.map +0 -1
  147. package/dist/common/types/index.js +0 -18
  148. package/dist/common/types/index.js.map +0 -1
  149. package/dist/common/types/models.d.ts.map +0 -1
  150. package/dist/common/types/models.js +0 -3
  151. package/dist/common/types/models.js.map +0 -1
  152. package/dist/enums/index.d.ts.map +0 -1
  153. package/dist/enums/index.js +0 -18
  154. package/dist/enums/index.js.map +0 -1
  155. package/dist/enums/tile-names.d.ts.map +0 -1
  156. package/dist/enums/tile-names.js +0 -25
  157. package/dist/enums/tile-names.js.map +0 -1
  158. package/dist/hosting/get-object-storages.d.ts.map +0 -1
  159. package/dist/hosting/get-object-storages.js +0 -25
  160. package/dist/hosting/get-object-storages.js.map +0 -1
  161. package/dist/hosting/hosting-extensions.d.ts +0 -4
  162. package/dist/hosting/hosting-extensions.d.ts.map +0 -1
  163. package/dist/hosting/hosting-extensions.js +0 -16
  164. package/dist/hosting/hosting-extensions.js.map +0 -1
  165. package/dist/hosting/index.d.ts.map +0 -1
  166. package/dist/hosting/index.js +0 -20
  167. package/dist/hosting/index.js.map +0 -1
  168. package/dist/hosting/types/azure-hosting-storage-selector.d.ts.map +0 -1
  169. package/dist/hosting/types/azure-hosting-storage-selector.js +0 -3
  170. package/dist/hosting/types/azure-hosting-storage-selector.js.map +0 -1
  171. package/dist/hosting/types/hosting-extensions.d.ts.map +0 -1
  172. package/dist/hosting/types/hosting-extensions.js +0 -3
  173. package/dist/hosting/types/hosting-extensions.js.map +0 -1
  174. package/dist/hosting/types/index.d.ts.map +0 -1
  175. package/dist/hosting/types/index.js +0 -19
  176. package/dist/hosting/types/index.js.map +0 -1
  177. package/dist/image/image-extensions.d.ts.map +0 -1
  178. package/dist/image/image-extensions.js +0 -27
  179. package/dist/image/image-extensions.js.map +0 -1
  180. package/dist/image/image-station-names.d.ts.map +0 -1
  181. package/dist/image/image-station-names.js +0 -12
  182. package/dist/image/image-station-names.js.map +0 -1
  183. package/dist/image/index.d.ts.map +0 -1
  184. package/dist/image/index.js +0 -21
  185. package/dist/image/index.js.map +0 -1
  186. package/dist/image/thumbnail-renderer.d.ts.map +0 -1
  187. package/dist/image/thumbnail-renderer.js.map +0 -1
  188. package/dist/image/types/image-cover-extension.d.ts.map +0 -1
  189. package/dist/image/types/image-cover-extension.js +0 -3
  190. package/dist/image/types/image-cover-extension.js.map +0 -1
  191. package/dist/image/types/image-explorer-extension.d.ts.map +0 -1
  192. package/dist/image/types/image-explorer-extension.js +0 -3
  193. package/dist/image/types/image-explorer-extension.js.map +0 -1
  194. package/dist/image/types/image-extensions.d.ts +0 -13
  195. package/dist/image/types/image-extensions.d.ts.map +0 -1
  196. package/dist/image/types/image-extensions.js +0 -3
  197. package/dist/image/types/image-extensions.js.map +0 -1
  198. package/dist/image/types/image-preview-extension.d.ts.map +0 -1
  199. package/dist/image/types/image-preview-extension.js +0 -3
  200. package/dist/image/types/image-preview-extension.js.map +0 -1
  201. package/dist/image/types/image-route-resolvers.d.ts.map +0 -1
  202. package/dist/image/types/image-route-resolvers.js +0 -3
  203. package/dist/image/types/image-route-resolvers.js.map +0 -1
  204. package/dist/image/types/image-select-field-extension.d.ts.map +0 -1
  205. package/dist/image/types/image-select-field-extension.js +0 -3
  206. package/dist/image/types/image-select-field-extension.js.map +0 -1
  207. package/dist/image/types/index.d.ts.map +0 -1
  208. package/dist/image/types/index.js +0 -25
  209. package/dist/image/types/index.js.map +0 -1
  210. package/dist/image/types/single-image-select-field-extension.d.ts.map +0 -1
  211. package/dist/image/types/single-image-select-field-extension.js +0 -3
  212. package/dist/image/types/single-image-select-field-extension.js.map +0 -1
  213. package/dist/image/types/thumbnail-renderer.d.ts.map +0 -1
  214. package/dist/image/types/thumbnail-renderer.js +0 -3
  215. package/dist/image/types/thumbnail-renderer.js.map +0 -1
  216. package/dist/index.d.ts.map +0 -1
  217. package/dist/index.js +0 -26
  218. package/dist/index.js.map +0 -1
  219. package/dist/initialize.d.ts.map +0 -1
  220. package/dist/initialize.js +0 -13
  221. package/dist/initialize.js.map +0 -1
  222. package/dist/localization/helpers/index.d.ts.map +0 -1
  223. package/dist/localization/helpers/index.js +0 -18
  224. package/dist/localization/helpers/index.js.map +0 -1
  225. package/dist/localization/helpers/localization-generator.d.ts.map +0 -1
  226. package/dist/localization/helpers/localization-generator.js.map +0 -1
  227. package/dist/localization/index.d.ts.map +0 -1
  228. package/dist/localization/index.js +0 -19
  229. package/dist/localization/index.js.map +0 -1
  230. package/dist/localization/types/index.d.ts.map +0 -1
  231. package/dist/localization/types/index.js +0 -18
  232. package/dist/localization/types/index.js.map +0 -1
  233. package/dist/localization/types/localization-generator.d.ts.map +0 -1
  234. package/dist/localization/types/localization-generator.js +0 -3
  235. package/dist/localization/types/localization-generator.js.map +0 -1
  236. package/dist/piral-extensions.d.ts.map +0 -1
  237. package/dist/piral-extensions.js +0 -3
  238. package/dist/piral-extensions.js.map +0 -1
  239. package/dist/tsconfig.tsbuildinfo +0 -1
  240. /package/dist/{common → cjs/common}/default-extension-value.d.ts +0 -0
  241. /package/dist/{common → cjs/common}/index.d.ts +0 -0
  242. /package/dist/{common → cjs/common}/types/index.d.ts +0 -0
  243. /package/dist/{common → cjs/common}/types/models.d.ts +0 -0
  244. /package/dist/{enums → cjs/enums}/index.d.ts +0 -0
  245. /package/dist/{enums → cjs/enums}/tile-names.d.ts +0 -0
  246. /package/dist/{hosting → cjs/hosting}/get-object-storages.d.ts +0 -0
  247. /package/dist/{hosting → cjs/hosting}/index.d.ts +0 -0
  248. /package/dist/{hosting → cjs/hosting}/types/index.d.ts +0 -0
  249. /package/dist/{image → cjs/image}/image-station-names.d.ts +0 -0
  250. /package/dist/{image → cjs/image}/index.d.ts +0 -0
  251. /package/dist/{image → cjs/image}/types/image-cover-extension.d.ts +0 -0
  252. /package/dist/{image → cjs/image}/types/image-route-resolvers.d.ts +0 -0
  253. /package/dist/{image → cjs/image}/types/index.d.ts +0 -0
  254. /package/dist/{image → cjs/image}/types/thumbnail-renderer.d.ts +0 -0
  255. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  256. /package/dist/{localization → cjs/localization}/helpers/index.d.ts +0 -0
  257. /package/dist/{localization → cjs/localization}/index.d.ts +0 -0
  258. /package/dist/{localization → cjs/localization}/types/index.d.ts +0 -0
  259. /package/dist/{localization → cjs/localization}/types/localization-generator.d.ts +0 -0
@@ -0,0 +1,246 @@
1
+ import React from 'react';
2
+
3
+ const extensionDefaultValue = () => (React.createElement("div", null, "Extension is not loaded."));
4
+ const generateExtensionDefaultValue = (
5
+ /**
6
+ * The service name for which the extension is not loaded. Without the `Service` suffix.
7
+ */
8
+ service) => {
9
+ const ExtensionNotFound = () => (React.createElement("p", null,
10
+ "Extension is not loaded. Please make sure that the ",
11
+ service,
12
+ " Service is enabled."));
13
+ return ExtensionNotFound;
14
+ };
15
+
16
+ /**
17
+ * These are the names the managed services use to register their tiles and navigation items.
18
+ */
19
+ var TileNames;
20
+ (function (TileNames) {
21
+ TileNames["VideosNavigation"] = "videosNavigation";
22
+ TileNames["VideoProcessingNavigation"] = "videoProcessingNavigation";
23
+ TileNames["VideoPublishingNavigation"] = "videoPublishingNavigation";
24
+ TileNames["VideoPlaygroundNavigation"] = "videoPlaygroundNavigation";
25
+ TileNames["HomeSettings"] = "homeSettings";
26
+ TileNames["UserNavigation"] = "userNavigation";
27
+ TileNames["UserRoleNavigation"] = "userRoleNavigation";
28
+ TileNames["ImageNavigation"] = "imageNavigation";
29
+ TileNames["ImageAcquisitionNavigation"] = "imageAcquisitionNavigation";
30
+ TileNames["ImagePlaygroundNavigation"] = "ImagePlaygroundNavigation";
31
+ TileNames["LocalizationNavigation"] = "localizationNavigation";
32
+ TileNames["UserNavigationSettings"] = "userNavigationSettings";
33
+ TileNames["EncodingDrmSettings"] = "encodingDrmSettings";
34
+ TileNames["EncodingAcquisitionNavigation"] = "encodingAcquisitionNavigation";
35
+ TileNames["EncodingWatermarkNavigation"] = "encodingWatermarkNavigation";
36
+ })(TileNames || (TileNames = {}));
37
+
38
+ const stateKey = Symbol.for('@axinom/mosaic-managed-workflow-integration/state');
39
+ const getStateContainer = () => globalThis;
40
+ const getManagedWorkflowIntegrationState = () => {
41
+ const stateContainer = getStateContainer();
42
+ const existingState = stateContainer[stateKey];
43
+ if (existingState !== undefined) {
44
+ return existingState;
45
+ }
46
+ const state = {
47
+ localizationEntryPoints: {},
48
+ piletApi: undefined,
49
+ piletApiListeners: new Set(),
50
+ };
51
+ stateContainer[stateKey] = state;
52
+ return state;
53
+ };
54
+ const getPiletApi = () => getManagedWorkflowIntegrationState().piletApi;
55
+ const setPiletApi = (piletApi) => {
56
+ const state = getManagedWorkflowIntegrationState();
57
+ state.piletApi = piletApi;
58
+ state.piletApiListeners.forEach((listener) => listener(piletApi));
59
+ };
60
+ const addPiletApiListener = (listener) => {
61
+ getManagedWorkflowIntegrationState().piletApiListeners.add(listener);
62
+ };
63
+
64
+ /**
65
+ * Get enabled Object Storages
66
+ * @returns
67
+ */
68
+ const getObjectStorages = async () => {
69
+ const piletApi = getPiletApi();
70
+ if (piletApi === undefined) {
71
+ throw new Error('The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function.');
72
+ }
73
+ return piletApi.getData('getObjectStorages')();
74
+ };
75
+
76
+ const bindHostingExtensions = (app) => {
77
+ const AzureStorageSelector = (props) => (React.createElement(app.Extension, { name: "hosting-azure-storage-selector", empty: extensionDefaultValue, params: props }));
78
+ return {
79
+ AzureStorageSelector: AzureStorageSelector,
80
+ };
81
+ };
82
+
83
+ /**
84
+ * Returns an object containing Extension components for the shared extensions provided by the image service.
85
+ */
86
+ const bindImageExtensions = (app) => {
87
+ const ImageCover = (props) => (React.createElement(app.Extension, { name: "image-cover", empty: generateExtensionDefaultValue('Image'), params: props }));
88
+ const ImageSelectExplorer = (props) => (React.createElement(app.Extension, { name: "image-select-explorer", empty: generateExtensionDefaultValue('Image'), params: props }));
89
+ const ImageSelectField = (props) => (React.createElement(app.Extension, { name: "image-select-field", empty: generateExtensionDefaultValue('Image'), params: props }));
90
+ const SingleImageSelectField = (props) => (React.createElement(app.Extension, { name: "single-image-select-field", empty: generateExtensionDefaultValue('Image'), params: props }));
91
+ const ImagePreview = (props) => (React.createElement(app.Extension, { name: "image-preview", empty: generateExtensionDefaultValue('Image'), params: props }));
92
+ return {
93
+ ImageCover,
94
+ ImagePreview,
95
+ ImageSelectExplorer,
96
+ ImageSelectField,
97
+ SingleImageSelectField,
98
+ };
99
+ };
100
+
101
+ /**
102
+ * Enum for image station names used to register image route resolvers
103
+ * use it to access image station route resolvers in a type-safe manner
104
+ */
105
+ var ImageStationNames;
106
+ (function (ImageStationNames) {
107
+ ImageStationNames["ImageDetails"] = "image-details";
108
+ })(ImageStationNames || (ImageStationNames = {}));
109
+
110
+ /**
111
+ * This function simplifies access to the shared functionality provided by the image workflow in the PiletApi object.
112
+ * In case the shared functionality is not available, a fallback renderer is returned.
113
+ *
114
+ * Make sure to initialize the integration library by calling the `initializeIntegrationLib` function,
115
+ * otherwise it will always return the fallback renderer.
116
+ *
117
+ * The renderer expects that the column is bound to the property containing the state. The thumbnail property is passed as an argument.
118
+ *
119
+ * @param thumbnailPropertyOrResolver
120
+ * Either the name of a property on the `data` object that has the following shape:
121
+ * ```ts
122
+ * {
123
+ * nodes: [{
124
+ * imageId: 'b437056b-c28e-46fa-ad9d-8bd16e7609fa'
125
+ * }]
126
+ * }
127
+ * ```
128
+ * This reflects the shape a typical postgraphile response would have.
129
+ * The renderer will pick the fist imageId from the nodes array.
130
+ *
131
+ * Alternatively a callback function can be passed that resolves to a url location.
132
+ * The row data is passed as an argument.
133
+ * The method can either return the full url of the image or the uuid of the image.
134
+ * If the uuid is returned, the `resolverType` argument needs to be set to 'uuid'.
135
+ * @param stateMap An object of key/value pairs mapping column values to CSS colors. If an empty object is passed, no state will be rendered.
136
+ * ```ts
137
+ * {
138
+ * 'PUBLISHED': '#95C842',
139
+ * 'CHANGED': '#FFC81A',
140
+ * 'NOT_PUBLISHED': '#DDDDDD',
141
+ * }
142
+ * ```
143
+ * @param resolverType either 'url' or 'uuid', depending on what your resolver is returning.
144
+ * @returns A thumbnail and state column renderer
145
+ */
146
+ const createThumbnailAndStateRenderer = (thumbnailPropertyOrResolver, stateMap, resolverType) => {
147
+ const Renderer = (value, data) => {
148
+ const thumbnailAndStateRenderer = getPiletApi()?.getData('thumbnailAndStateRenderer');
149
+ if (thumbnailAndStateRenderer) {
150
+ return thumbnailAndStateRenderer(thumbnailPropertyOrResolver, stateMap, resolverType)(value, data);
151
+ }
152
+ return React.createElement("span", { title: "No Renderer" }, "No Renderer");
153
+ };
154
+ return Renderer;
155
+ };
156
+
157
+ getPiletApi();
158
+ addPiletApiListener((updatedPiletApi) => {
159
+ });
160
+ /**
161
+ * Initializes the integration library with the provided Pilet API.
162
+ * @param app the PiletAPI object
163
+ */
164
+ const initializeIntegrationLib = (app) => {
165
+ setPiletApi(app);
166
+ };
167
+
168
+ const getLocalizationEntryPointsState = () => getManagedWorkflowIntegrationState().localizationEntryPoints;
169
+ /**
170
+ * @returns The list of all registered localization entry points
171
+ */
172
+ const getLocalizationEntryPoints = () => getLocalizationEntryPointsState();
173
+ /**
174
+ * @param entityType Name of the entity type set when registering the localization entry point
175
+ * @returns Path to the localization station for the given entity type
176
+ */
177
+ const getLocalizationEntryPoint = (entityType) => getLocalizationEntryPointsState()[entityType];
178
+ /**
179
+ * Instead of using this function directly, it is recommended to use `registerLocalizationEntryPoints` function instead.
180
+ * `registerLocalizationEntryPoints` is a wrapper around this function that provides a more convenient way to register localization entry points.
181
+ *
182
+ * This function is designed to be used as callback of the `app.getDataHelper('localization-registration', callback)` call.
183
+ *
184
+ * The function returns a function that can be called with a `LocalizationGenerator` function. When this function is called,
185
+ * it will register the localization entry points that were provided as `data`.
186
+ * @param data Data containing the information needed to register the localization station paths for the entity using the localization generator
187
+ * @returns A function that will register the localization entry points using provided `data`
188
+ * @example
189
+ * ```ts
190
+ * app.getDataHelper('localization-registration', generateLocalizationEntryPoints([
191
+ * { root: '/movie/:id', entityIdParam: 'id', entityType: 'movie' },
192
+ * { root: '/series/:seriesId', entityIdParam: 'seriesId', entityType: 'series' },
193
+ * // with resolveRoot
194
+ * {
195
+ * root: '/channel/:channelId/playlist/:playlistId',
196
+ * resolveRoot: async(playlistId: string) => Promise.resolve({ channelId:'123' }),
197
+ * entityIdParam: 'playlistId',
198
+ * entityType: 'playlist'
199
+ * }
200
+ * ]));
201
+ * ```
202
+ */
203
+ function generateLocalizationEntryPoints(data) {
204
+ return (generator) => {
205
+ const localizationEntryPoints = getLocalizationEntryPointsState();
206
+ if (generator) {
207
+ data.forEach((dataItem) => {
208
+ const path = generator(dataItem);
209
+ if (path) {
210
+ localizationEntryPoints[dataItem.entityType] = path;
211
+ }
212
+ });
213
+ }
214
+ return localizationEntryPoints;
215
+ };
216
+ }
217
+ /**
218
+ * This function can be used to register embedded localization workflows for entities.
219
+ * The localization service will register all required stations to provide an embedded localization workflow for the entity.
220
+ * To query then entry point for a specific entity, to e.g. create a details page action that links to the sub-workflow, use `getLocalizationEntryPoint` function.
221
+ * @param data Data containing the information needed to register the localization station paths for the entity using the localization generator
222
+ * @example
223
+ * ```ts
224
+ * registerLocalizationEntryPoints([
225
+ * { root: '/movie/:id', entityIdParam: 'id', entityType: 'movie' },
226
+ * { root: '/series/:seriesId', entityIdParam: 'seriesId', entityType: 'series' },
227
+ * // with resolveRoot
228
+ * {
229
+ * root: '/channel/:channelId/playlist/:playlistId',
230
+ * resolveRoot: async(playlistId: string) => Promise.resolve({ channelId:'123' }),
231
+ * entityIdParam: 'playlistId',
232
+ * entityType: 'playlist'
233
+ * }
234
+ * ]
235
+ * ```
236
+ */
237
+ function registerLocalizationEntryPoints(data) {
238
+ const piletApi = getPiletApi();
239
+ if (piletApi === undefined) {
240
+ throw new Error('The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function or pass the API object as 2nd parameter.');
241
+ }
242
+ piletApi.getDataHelper('localization-registration', generateLocalizationEntryPoints(data));
243
+ }
244
+
245
+ export { ImageStationNames, TileNames, bindHostingExtensions, bindImageExtensions, createThumbnailAndStateRenderer, extensionDefaultValue, generateExtensionDefaultValue, generateLocalizationEntryPoints, getLocalizationEntryPoint, getLocalizationEntryPoints, getObjectStorages, initializeIntegrationLib, registerLocalizationEntryPoints };
246
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/common/default-extension-value.tsx","../../src/enums/tile-names.ts","../../src/state.ts","../../src/hosting/get-object-storages.tsx","../../src/hosting/hosting-extensions.tsx","../../src/image/image-extensions.tsx","../../src/image/image-station-names.ts","../../src/image/thumbnail-renderer.tsx","../../src/initialize.ts","../../src/localization/helpers/localization-generator.ts"],"sourcesContent":["import React from 'react';\n\nexport const extensionDefaultValue = (): JSX.Element => (\n <div>Extension is not loaded.</div>\n);\n\nexport const generateExtensionDefaultValue = (\n /**\n * The service name for which the extension is not loaded. Without the `Service` suffix.\n */\n service: string,\n): (() => JSX.Element) => {\n const ExtensionNotFound = (): JSX.Element => (\n <p>\n Extension is not loaded. Please make sure that the {service} Service is\n enabled.\n </p>\n );\n return ExtensionNotFound;\n};\n","/**\n * These are the names the managed services use to register their tiles and navigation items.\n */\nexport enum TileNames {\n VideosNavigation = 'videosNavigation',\n VideoProcessingNavigation = 'videoProcessingNavigation',\n VideoPublishingNavigation = 'videoPublishingNavigation',\n VideoPlaygroundNavigation = 'videoPlaygroundNavigation',\n HomeSettings = 'homeSettings',\n UserNavigation = 'userNavigation',\n UserRoleNavigation = 'userRoleNavigation',\n ImageNavigation = 'imageNavigation',\n ImageAcquisitionNavigation = 'imageAcquisitionNavigation',\n ImagePlaygroundNavigation = 'ImagePlaygroundNavigation',\n LocalizationNavigation = 'localizationNavigation',\n UserNavigationSettings = 'userNavigationSettings',\n EncodingDrmSettings = 'encodingDrmSettings',\n EncodingAcquisitionNavigation = 'encodingAcquisitionNavigation',\n EncodingWatermarkNavigation = 'encodingWatermarkNavigation',\n}\n","import type { PiletApi } from '@axinom/mosaic-portal';\n\nexport type LocalizationEntryPointsState = Record<string, string>;\n\ninterface ManagedWorkflowIntegrationState {\n localizationEntryPoints: LocalizationEntryPointsState;\n piletApi: PiletApi | undefined;\n piletApiListeners: Set<(piletApi: PiletApi | undefined) => void>;\n}\n\nconst stateKey = Symbol.for(\n '@axinom/mosaic-managed-workflow-integration/state',\n);\n\nconst getStateContainer = (): Record<\n symbol,\n ManagedWorkflowIntegrationState | undefined\n> =>\n globalThis as unknown as Record<\n symbol,\n ManagedWorkflowIntegrationState | undefined\n >;\nexport const getManagedWorkflowIntegrationState =\n (): ManagedWorkflowIntegrationState => {\n const stateContainer = getStateContainer();\n const existingState = stateContainer[stateKey];\n\n if (existingState !== undefined) {\n return existingState;\n }\n\n const state: ManagedWorkflowIntegrationState = {\n localizationEntryPoints: {},\n piletApi: undefined,\n piletApiListeners: new Set(),\n };\n stateContainer[stateKey] = state;\n return state;\n };\n\nexport const getPiletApi = (): PiletApi | undefined =>\n getManagedWorkflowIntegrationState().piletApi;\n\nexport const setPiletApi = (piletApi: PiletApi): void => {\n const state = getManagedWorkflowIntegrationState();\n state.piletApi = piletApi;\n\n state.piletApiListeners.forEach((listener) => listener(piletApi));\n};\n\nexport const addPiletApiListener = (\n listener: (piletApi: PiletApi | undefined) => void,\n): void => {\n getManagedWorkflowIntegrationState().piletApiListeners.add(listener);\n};\n","import { getPiletApi } from '../state';\n/**\n * Represents an object storage.\n */\nexport interface ObjectStorage {\n provider: string;\n name: string;\n}\n\n/**\n * Get enabled Object Storages\n * @returns\n */\nexport const getObjectStorages = async (): Promise<\n ObjectStorage[] | undefined\n> => {\n const piletApi = getPiletApi();\n if (piletApi === undefined) {\n throw new Error(\n 'The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function.',\n );\n }\n return piletApi.getData('getObjectStorages')();\n};\n","import type { PiletApi } from '@axinom/mosaic-portal';\nimport React from 'react';\nimport { extensionDefaultValue } from '../common/default-extension-value';\nimport type { AzureStorageSelectorProps } from './types';\nimport type { HostingExtensions } from './types/hosting-extensions';\n\nexport const bindHostingExtensions = (app: PiletApi): HostingExtensions => {\n const AzureStorageSelector: React.FC<AzureStorageSelectorProps> = (props) => (\n <app.Extension\n name=\"hosting-azure-storage-selector\"\n empty={extensionDefaultValue}\n params={props}\n />\n );\n\n return {\n AzureStorageSelector: AzureStorageSelector,\n };\n};\n","import type { PiletApi } from '@axinom/mosaic-portal';\nimport React from 'react';\nimport { generateExtensionDefaultValue } from '../common/default-extension-value';\nimport type {\n ImageCoverProps,\n ImageExtensions,\n ImagePreviewProps,\n ImageSelectExplorerProps,\n ImageSelectFieldProps,\n SingleImageSelectFieldProps,\n} from './types';\n\n/**\n * Returns an object containing Extension components for the shared extensions provided by the image service.\n */\nexport const bindImageExtensions = (app: PiletApi): ImageExtensions => {\n const ImageCover: React.FC<ImageCoverProps> = (props) => (\n <app.Extension\n name=\"image-cover\"\n empty={generateExtensionDefaultValue('Image')}\n params={props}\n />\n );\n\n const ImageSelectExplorer: React.FC<ImageSelectExplorerProps> = (props) => (\n <app.Extension\n name=\"image-select-explorer\"\n empty={generateExtensionDefaultValue('Image')}\n params={props}\n />\n );\n\n const ImageSelectField: React.FC<ImageSelectFieldProps> = (props) => (\n <app.Extension\n name=\"image-select-field\"\n empty={generateExtensionDefaultValue('Image')}\n params={props}\n />\n );\n\n const SingleImageSelectField: React.FC<SingleImageSelectFieldProps> = (\n props,\n ) => (\n <app.Extension\n name=\"single-image-select-field\"\n empty={generateExtensionDefaultValue('Image')}\n params={props}\n />\n );\n\n const ImagePreview: React.FC<ImagePreviewProps> = (props) => (\n <app.Extension\n name=\"image-preview\"\n empty={generateExtensionDefaultValue('Image')}\n params={props}\n />\n );\n\n return {\n ImageCover,\n ImagePreview,\n ImageSelectExplorer,\n ImageSelectField,\n SingleImageSelectField,\n };\n};\n","/**\n * Enum for image station names used to register image route resolvers\n * use it to access image station route resolvers in a type-safe manner\n */\nexport enum ImageStationNames {\n ImageDetails = 'image-details',\n}\n","import type { ColumnMap, ColumnRenderer, Data } from '@axinom/mosaic-ui';\nimport React from 'react';\nimport { getPiletApi } from '../state';\nimport type {\n ThumbnailProperty,\n ThumbnailResolver,\n ThumbnailResolverType,\n} from './types';\n\n/**\n * This function simplifies access to the shared functionality provided by the image workflow in the PiletApi object.\n * In case the shared functionality is not available, a fallback renderer is returned.\n *\n * Make sure to initialize the integration library by calling the `initializeIntegrationLib` function,\n * otherwise it will always return the fallback renderer.\n *\n * The renderer expects that the column is bound to the property containing the state. The thumbnail property is passed as an argument.\n *\n * @param thumbnailPropertyOrResolver\n * Either the name of a property on the `data` object that has the following shape:\n * ```ts\n * {\n * nodes: [{\n * imageId: 'b437056b-c28e-46fa-ad9d-8bd16e7609fa'\n * }]\n * }\n * ```\n * This reflects the shape a typical postgraphile response would have.\n * The renderer will pick the fist imageId from the nodes array.\n *\n * Alternatively a callback function can be passed that resolves to a url location.\n * The row data is passed as an argument.\n * The method can either return the full url of the image or the uuid of the image.\n * If the uuid is returned, the `resolverType` argument needs to be set to 'uuid'.\n * @param stateMap An object of key/value pairs mapping column values to CSS colors. If an empty object is passed, no state will be rendered.\n * ```ts\n * {\n * 'PUBLISHED': '#95C842',\n * 'CHANGED': '#FFC81A',\n * 'NOT_PUBLISHED': '#DDDDDD',\n * }\n * ```\n * @param resolverType either 'url' or 'uuid', depending on what your resolver is returning.\n * @returns A thumbnail and state column renderer\n */\nexport const createThumbnailAndStateRenderer = <T extends Data>(\n thumbnailPropertyOrResolver: ThumbnailProperty<T> | ThumbnailResolver<T>,\n stateMap?: ColumnMap,\n resolverType?: ThumbnailResolverType,\n): ColumnRenderer<T> => {\n const Renderer: ColumnRenderer<T> = (value, data) => {\n const thumbnailAndStateRenderer = getPiletApi()?.getData(\n 'thumbnailAndStateRenderer',\n );\n\n if (thumbnailAndStateRenderer) {\n return thumbnailAndStateRenderer(\n thumbnailPropertyOrResolver,\n stateMap,\n resolverType,\n )(value, data);\n }\n\n return <span title=\"No Renderer\">No Renderer</span>;\n };\n return Renderer;\n};\n","import type { PiletApi } from '@axinom/mosaic-portal';\nimport { addPiletApiListener, getPiletApi, setPiletApi } from './state';\n\nexport let piletApi: PiletApi | undefined = getPiletApi();\n\naddPiletApiListener((updatedPiletApi) => {\n piletApi = updatedPiletApi;\n});\n/**\n * Initializes the integration library with the provided Pilet API.\n * @param app the PiletAPI object\n */\nexport const initializeIntegrationLib = (app: PiletApi): void => {\n setPiletApi(app);\n};\n","import { getManagedWorkflowIntegrationState, getPiletApi } from '../../state';\nimport type {\n LocalizationGenerator,\n LocalizationGeneratorParams,\n} from '../types';\n\n/**\n * An object that maps entity types to their localization entry point paths\n * @example\n * ```ts\n * {\n * movie: '/movie/:id/localization',\n * series: '/series/:seriesId/localization',\n * }\n */\nexport type LocalizationEntryPoints = Record<string, string>;\n\nconst getLocalizationEntryPointsState = (): LocalizationEntryPoints =>\n getManagedWorkflowIntegrationState().localizationEntryPoints;\n\n/**\n * @returns The list of all registered localization entry points\n */\nexport const getLocalizationEntryPoints = (): LocalizationEntryPoints =>\n getLocalizationEntryPointsState();\n\n/**\n * @param entityType Name of the entity type set when registering the localization entry point\n * @returns Path to the localization station for the given entity type\n */\nexport const getLocalizationEntryPoint = (\n entityType: string,\n): string | undefined => getLocalizationEntryPointsState()[entityType];\n/**\n * Instead of using this function directly, it is recommended to use `registerLocalizationEntryPoints` function instead.\n * `registerLocalizationEntryPoints` is a wrapper around this function that provides a more convenient way to register localization entry points.\n *\n * This function is designed to be used as callback of the `app.getDataHelper('localization-registration', callback)` call.\n *\n * The function returns a function that can be called with a `LocalizationGenerator` function. When this function is called,\n * it will register the localization entry points that were provided as `data`.\n * @param data Data containing the information needed to register the localization station paths for the entity using the localization generator\n * @returns A function that will register the localization entry points using provided `data`\n * @example\n * ```ts\n * app.getDataHelper('localization-registration', generateLocalizationEntryPoints([\n * { root: '/movie/:id', entityIdParam: 'id', entityType: 'movie' },\n * { root: '/series/:seriesId', entityIdParam: 'seriesId', entityType: 'series' },\n * // with resolveRoot\n * {\n * root: '/channel/:channelId/playlist/:playlistId',\n * resolveRoot: async(playlistId: string) => Promise.resolve({ channelId:'123' }),\n * entityIdParam: 'playlistId',\n * entityType: 'playlist'\n * }\n * ]));\n * ```\n */\nexport function generateLocalizationEntryPoints(\n data: LocalizationGeneratorParams[],\n) {\n return (\n generator: LocalizationGenerator | undefined,\n ): LocalizationEntryPoints => {\n const localizationEntryPoints = getLocalizationEntryPointsState();\n\n if (generator) {\n data.forEach((dataItem) => {\n const path = generator(dataItem);\n if (path) {\n localizationEntryPoints[dataItem.entityType] = path;\n }\n });\n }\n return localizationEntryPoints;\n };\n}\n\n/**\n * This function can be used to register embedded localization workflows for entities.\n * The localization service will register all required stations to provide an embedded localization workflow for the entity.\n * To query then entry point for a specific entity, to e.g. create a details page action that links to the sub-workflow, use `getLocalizationEntryPoint` function.\n * @param data Data containing the information needed to register the localization station paths for the entity using the localization generator\n * @example\n * ```ts\n * registerLocalizationEntryPoints([\n * { root: '/movie/:id', entityIdParam: 'id', entityType: 'movie' },\n * { root: '/series/:seriesId', entityIdParam: 'seriesId', entityType: 'series' },\n * // with resolveRoot\n * {\n * root: '/channel/:channelId/playlist/:playlistId',\n * resolveRoot: async(playlistId: string) => Promise.resolve({ channelId:'123' }),\n * entityIdParam: 'playlistId',\n * entityType: 'playlist'\n * }\n * ]\n * ```\n */\nexport function registerLocalizationEntryPoints(\n data: LocalizationGeneratorParams[],\n): void {\n const piletApi = getPiletApi();\n if (piletApi === undefined) {\n throw new Error(\n 'The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function or pass the API object as 2nd parameter.',\n );\n }\n piletApi.getDataHelper(\n 'localization-registration',\n generateLocalizationEntryPoints(data),\n );\n}\n"],"names":[],"mappings":";;AAEa,MAAA,qBAAqB,GAAG,OACnC,KAAmC,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,EAAA,0BAAA,CAAA,EACnC;AAEW,MAAA,6BAA6B,GAAG;AAC3C;;AAEG;AACH,OAAe,KACQ;AACvB,IAAA,MAAM,iBAAiB,GAAG,OACxB,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,IAAA;;QACsD,OAAO;AAEzD,QAAA,sBAAA,CAAA,CACL,CAAC;AACF,IAAA,OAAO,iBAAiB,CAAC;AAC3B;;ACnBA;;AAEG;IACS,UAgBX;AAhBD,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACrC,IAAA,SAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD,CAAA;AACvD,IAAA,SAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD,CAAA;AACvD,IAAA,SAAA,CAAA,2BAAA,CAAA,GAAA,2BAAuD,CAAA;AACvD,IAAA,SAAA,CAAA,cAAA,CAAA,GAAA,cAA6B,CAAA;AAC7B,IAAA,SAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC,CAAA;AACjC,IAAA,SAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC,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,UAAU,CAAC,GAAG,IAAI,CAAC;iBACrD;AACH,aAAC,CAAC,CAAC;SACJ;AACD,QAAA,OAAO,uBAAuB,CAAC;AACjC,KAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;AAmBG;AACG,SAAU,+BAA+B,CAC7C,IAAmC,EAAA;AAEnC,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AAC/B,IAAA,IAAI,QAAQ,KAAK,SAAS,EAAE;AAC1B,QAAA,MAAM,IAAI,KAAK,CACb,8IAA8I,CAC/I,CAAC;KACH;IACD,QAAQ,CAAC,aAAa,CACpB,2BAA2B,EAC3B,+BAA+B,CAAC,IAAI,CAAC,CACtC,CAAC;AACJ;;;;"}
@@ -0,0 +1,8 @@
1
+ import type { PiletApi } from '@axinom/mosaic-portal';
2
+ export declare let piletApi: PiletApi | undefined;
3
+ /**
4
+ * Initializes the integration library with the provided Pilet API.
5
+ * @param app the PiletAPI object
6
+ */
7
+ export declare const initializeIntegrationLib: (app: PiletApi) => void;
8
+ //# sourceMappingURL=initialize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../src/initialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,eAAO,IAAI,QAAQ,EAAE,QAAQ,GAAG,SAAyB,CAAC;AAK1D;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,KAAK,QAAQ,KAAG,IAExD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './localization-generator';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/localization/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,21 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLocalizationEntryPoint = exports.getLocalizationEntryPoints = void 0;
4
- exports.generateLocalizationEntryPoints = generateLocalizationEntryPoints;
5
- exports.registerLocalizationEntryPoints = registerLocalizationEntryPoints;
6
- const initialize_1 = require("../../initialize");
7
- const localizationEntryPoints = {};
1
+ import type { LocalizationGenerator, LocalizationGeneratorParams } from '../types';
2
+ /**
3
+ * An object that maps entity types to their localization entry point paths
4
+ * @example
5
+ * ```ts
6
+ * {
7
+ * movie: '/movie/:id/localization',
8
+ * series: '/series/:seriesId/localization',
9
+ * }
10
+ */
11
+ export type LocalizationEntryPoints = Record<string, string>;
8
12
  /**
9
13
  * @returns The list of all registered localization entry points
10
14
  */
11
- const getLocalizationEntryPoints = () => localizationEntryPoints;
12
- exports.getLocalizationEntryPoints = getLocalizationEntryPoints;
15
+ export declare const getLocalizationEntryPoints: () => LocalizationEntryPoints;
13
16
  /**
14
17
  * @param entityType Name of the entity type set when registering the localization entry point
15
18
  * @returns Path to the localization station for the given entity type
16
19
  */
17
- const getLocalizationEntryPoint = (entityType) => localizationEntryPoints[entityType];
18
- exports.getLocalizationEntryPoint = getLocalizationEntryPoint;
20
+ export declare const getLocalizationEntryPoint: (entityType: string) => string | undefined;
19
21
  /**
20
22
  * Instead of using this function directly, it is recommended to use `registerLocalizationEntryPoints` function instead.
21
23
  * `registerLocalizationEntryPoints` is a wrapper around this function that provides a more convenient way to register localization entry points.
@@ -41,19 +43,7 @@ exports.getLocalizationEntryPoint = getLocalizationEntryPoint;
41
43
  * ]));
42
44
  * ```
43
45
  */
44
- function generateLocalizationEntryPoints(data) {
45
- return (generator) => {
46
- if (generator) {
47
- data.forEach((dataItem) => {
48
- const path = generator(dataItem);
49
- if (path) {
50
- localizationEntryPoints[dataItem.entityType] = path;
51
- }
52
- });
53
- }
54
- return localizationEntryPoints;
55
- };
56
- }
46
+ export declare function generateLocalizationEntryPoints(data: LocalizationGeneratorParams[]): (generator: LocalizationGenerator | undefined) => LocalizationEntryPoints;
57
47
  /**
58
48
  * This function can be used to register embedded localization workflows for entities.
59
49
  * The localization service will register all required stations to provide an embedded localization workflow for the entity.
@@ -74,10 +64,5 @@ function generateLocalizationEntryPoints(data) {
74
64
  * ]
75
65
  * ```
76
66
  */
77
- function registerLocalizationEntryPoints(data) {
78
- if (initialize_1.piletApi === undefined) {
79
- throw new Error('The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function or pass the API object as 2nd parameter.');
80
- }
81
- initialize_1.piletApi.getDataHelper('localization-registration', generateLocalizationEntryPoints(data));
82
- }
83
- //# sourceMappingURL=localization-generator.js.map
67
+ export declare function registerLocalizationEntryPoints(data: LocalizationGeneratorParams[]): void;
68
+ //# sourceMappingURL=localization-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localization-generator.d.ts","sourceRoot":"","sources":["../../../../src/localization/helpers/localization-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAK7D;;GAEG;AACH,eAAO,MAAM,0BAA0B,QAAO,uBACX,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GACpC,YAAY,MAAM,KACjB,MAAM,GAAG,SAA0D,CAAC;AACvE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,2BAA2B,EAAE,IAGjC,WAAW,qBAAqB,GAAG,SAAS,KAC3C,uBAAuB,CAa3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,2BAA2B,EAAE,GAClC,IAAI,CAWN"}
@@ -0,0 +1,3 @@
1
+ export * from './helpers';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/localization/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './localization-generator';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/localization/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,38 @@
1
+ export interface LocalizationGeneratorParams {
2
+ /**
3
+ * Path to the entity, will be used to add entities translation sub-stations
4
+ * (must contain ID of the entity)
5
+ */
6
+ root: string;
7
+ /**
8
+ * Root path resolver.
9
+ * Provide root path resolver in case there are more than one
10
+ * dynamic path segment representing `entityIdParam`,
11
+ * the resolver should return the remaining dynamic segments
12
+ * @param entityId ID or the entity provided in `entityIdParam` in the root path
13
+ * @returns Object where keys correspond to the dynamic segments
14
+ * and value correspond to the value to be replaced in the path
15
+ */
16
+ resolveRoot?: LocalizationRootPathResolver;
17
+ /** The name of the parameter in the path that contains the entity id */
18
+ entityIdParam: string;
19
+ /** The type of the entity. Used to lookup the values of the entity on the translation service */
20
+ entityType: string;
21
+ }
22
+ export type LocalizationRootPathResolver = (entityId: string) => Promise<Record<string, string>>;
23
+ /**
24
+ * Generates the routes for the localization station.
25
+ * @param params Route parameters for the generator.
26
+ * @returns The root path of the localization station.
27
+ * @example
28
+ * ```ts
29
+ * const generator = app.getData('localization-registration');
30
+ * const entryPoint = generator({
31
+ * root: '/movie/:id',
32
+ * entityIdParam: 'id',
33
+ * entityType: 'movie',
34
+ * });
35
+ * ```
36
+ */
37
+ export type LocalizationGenerator = (params: LocalizationGeneratorParams) => string;
38
+ //# sourceMappingURL=localization-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localization-generator.d.ts","sourceRoot":"","sources":["../../../../src/localization/types/localization-generator.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,4BAA4B,CAAC;IAC3C,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,4BAA4B,GAAG,CACzC,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAErC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,MAAM,EAAE,2BAA2B,KAChC,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,10 @@
1
+ import type { ImageCoverProps, ImagePreviewProps, ImageSelectExplorerProps, ImageSelectFieldProps } from './image';
2
+ declare module '@axinom/mosaic-portal' {
3
+ interface PiralCustomExtensionSlotMap {
4
+ 'image-cover': ImageCoverProps;
5
+ 'image-select-field': ImageSelectFieldProps;
6
+ 'image-preview': ImagePreviewProps;
7
+ 'image-select-explorer': ImageSelectExplorerProps;
8
+ }
9
+ }
10
+ //# sourceMappingURL=piral-extensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"piral-extensions.d.ts","sourceRoot":"","sources":["../../src/piral-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,OAAO,QAAQ,uBAAuB,CAAC;IACrC,UAAiB,2BAA2B;QAC1C,aAAa,EAAE,eAAe,CAAC;QAC/B,oBAAoB,EAAE,qBAAqB,CAAC;QAC5C,eAAe,EAAE,iBAAiB,CAAC;QACnC,uBAAuB,EAAE,wBAAwB,CAAC;KACnD;CACF"}
@@ -0,0 +1,13 @@
1
+ import type { PiletApi } from '@axinom/mosaic-portal';
2
+ export type LocalizationEntryPointsState = Record<string, string>;
3
+ interface ManagedWorkflowIntegrationState {
4
+ localizationEntryPoints: LocalizationEntryPointsState;
5
+ piletApi: PiletApi | undefined;
6
+ piletApiListeners: Set<(piletApi: PiletApi | undefined) => void>;
7
+ }
8
+ export declare const getManagedWorkflowIntegrationState: () => ManagedWorkflowIntegrationState;
9
+ export declare const getPiletApi: () => PiletApi | undefined;
10
+ export declare const setPiletApi: (piletApi: PiletApi) => void;
11
+ export declare const addPiletApiListener: (listener: (piletApi: PiletApi | undefined) => void) => void;
12
+ export {};
13
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElE,UAAU,+BAA+B;IACvC,uBAAuB,EAAE,4BAA4B,CAAC;IACtD,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,iBAAiB,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC;CAClE;AAcD,eAAO,MAAM,kCAAkC,QACzC,+BAeH,CAAC;AAEJ,eAAO,MAAM,WAAW,QAAO,QAAQ,GAAG,SACK,CAAC;AAEhD,eAAO,MAAM,WAAW,GAAI,UAAU,QAAQ,KAAG,IAKhD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,KACjD,IAEF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-managed-workflow-integration",
3
- "version": "0.31.0",
3
+ "version": "0.32.0-rc.3",
4
4
  "description": "Shared types and helpers for integrating functionality provided by managed service workflows",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -13,24 +13,39 @@
13
13
  "dist",
14
14
  "src"
15
15
  ],
16
- "main": "dist/index.js",
17
- "types": "dist/index.d.ts",
16
+ "main": "dist/cjs/index.js",
17
+ "module": "dist/esm/index.js",
18
+ "types": "dist/cjs/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/cjs/index.d.ts",
22
+ "import": "./dist/esm/index.js",
23
+ "require": "./dist/cjs/index.js"
24
+ }
25
+ },
18
26
  "scripts": {
19
27
  "clean": "rimraf dist",
20
- "build": "yarn clean && yarn tsc",
28
+ "build": "yarn clean && rollup -c && node ../../scripts/write-esm-markers.js",
21
29
  "build:ci": "yarn workspaces focus && yarn build",
22
- "dev": "tsc -w",
30
+ "dev": "rollup -c -w",
31
+ "check:esm-interop": "node scripts/check-esm-interop.mjs",
32
+ "ts:validate": "tsc && yarn build && yarn check:esm-interop",
23
33
  "lint": "eslint . --ext .ts,.tsx,.js --color --cache"
24
34
  },
25
35
  "devDependencies": {
26
- "@axinom/mosaic-portal": "^0.47.0",
27
- "@axinom/mosaic-ui": "^0.71.0",
36
+ "@axinom/mosaic-portal": "^0.48.0-rc.3",
37
+ "@axinom/mosaic-ui": "^0.72.0-rc.3",
38
+ "@rollup/plugin-commonjs": "^15.1.0",
39
+ "@rollup/plugin-node-resolve": "^9.0.0",
28
40
  "@types/react": "^17",
29
41
  "@types/react-dom": "^17",
30
42
  "eslint": "^8.35.0",
31
43
  "react": "^17.0.2",
32
44
  "react-dom": "^17.0.2",
33
45
  "rimraf": "^3.0.2",
46
+ "rollup": "^2.28.1",
47
+ "rollup-plugin-peer-deps-external": "^2.2.3",
48
+ "rollup-plugin-typescript2": "^0.29.0",
34
49
  "typescript": "^5.9.3"
35
50
  },
36
51
  "peerDependencies": {
@@ -42,5 +57,5 @@
42
57
  "publishConfig": {
43
58
  "access": "public"
44
59
  },
45
- "gitHead": "75dcfd9bf92de1ef72a28f073e43a7dfaa7b430b"
60
+ "gitHead": "9c7831acd6fcced9a09f97ffd4c9d67ee1b3b640"
46
61
  }
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any -- These public scalar aliases intentionally preserve generated GraphQL scalar compatibility. */
1
2
  /** All built-in and custom scalars, mapped to their actual values */
2
3
  interface Scalars {
3
4
  /** A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). */
@@ -1,5 +1,4 @@
1
- import { piletApi } from '../initialize';
2
-
1
+ import { getPiletApi } from '../state';
3
2
  /**
4
3
  * Represents an object storage.
5
4
  */
@@ -15,6 +14,7 @@ export interface ObjectStorage {
15
14
  export const getObjectStorages = async (): Promise<
16
15
  ObjectStorage[] | undefined
17
16
  > => {
17
+ const piletApi = getPiletApi();
18
18
  if (piletApi === undefined) {
19
19
  throw new Error(
20
20
  'The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function.',
@@ -1,8 +1,8 @@
1
- import { PiletApi } from '@axinom/mosaic-portal';
1
+ import type { PiletApi } from '@axinom/mosaic-portal';
2
2
  import React from 'react';
3
3
  import { extensionDefaultValue } from '../common/default-extension-value';
4
- import { AzureStorageSelectorProps } from './types';
5
- import { HostingExtensions } from './types/hosting-extensions';
4
+ import type { AzureStorageSelectorProps } from './types';
5
+ import type { HostingExtensions } from './types/hosting-extensions';
6
6
 
7
7
  export const bindHostingExtensions = (app: PiletApi): HostingExtensions => {
8
8
  const AzureStorageSelector: React.FC<AzureStorageSelectorProps> = (props) => (
@@ -1,5 +1,5 @@
1
- import { BaseFormControl, BaseInputEvents } from '@axinom/mosaic-ui';
2
- import { ObjectStorage } from '../get-object-storages';
1
+ import type { BaseFormControl, BaseInputEvents } from '@axinom/mosaic-ui';
2
+ import type { ObjectStorage } from '../get-object-storages';
3
3
 
4
4
  export interface AzureStorageSelectorProps
5
5
  extends BaseFormControl,
@@ -1,4 +1,4 @@
1
- import { AzureStorageSelectorProps } from './azure-hosting-storage-selector';
1
+ import type { AzureStorageSelectorProps } from './azure-hosting-storage-selector';
2
2
 
3
3
  /**
4
4
  * Hosting Service related extensions
@@ -1,7 +1,7 @@
1
- import { PiletApi } from '@axinom/mosaic-portal';
1
+ import type { PiletApi } from '@axinom/mosaic-portal';
2
2
  import React from 'react';
3
3
  import { generateExtensionDefaultValue } from '../common/default-extension-value';
4
- import {
4
+ import type {
5
5
  ImageCoverProps,
6
6
  ImageExtensions,
7
7
  ImagePreviewProps,