@acorex-platform/module-document-management-client 0.0.63 → 0.0.66

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 (39) hide show
  1. package/fesm2022/{acorex-platform-module-document-management-client-acorex-platform-module-document-management-client-BiosmCuZ.mjs → acorex-platform-module-document-management-client-acorex-platform-module-document-management-client-BsjL51-C.mjs} +231 -154
  2. package/fesm2022/acorex-platform-module-document-management-client-acorex-platform-module-document-management-client-BsjL51-C.mjs.map +1 -0
  3. package/fesm2022/{acorex-platform-module-document-management-client-attachment-view-skeleton.component-D-38wiyG.mjs → acorex-platform-module-document-management-client-attachment-view-skeleton.component-C0r5kIzb.mjs} +2 -2
  4. package/fesm2022/{acorex-platform-module-document-management-client-attachment-view-skeleton.component-D-38wiyG.mjs.map → acorex-platform-module-document-management-client-attachment-view-skeleton.component-C0r5kIzb.mjs.map} +1 -1
  5. package/fesm2022/{acorex-platform-module-document-management-client-attachment-widget.component-Bd48EHwE.mjs → acorex-platform-module-document-management-client-attachment-widget.component-DU6dwM0k.mjs} +2 -2
  6. package/fesm2022/{acorex-platform-module-document-management-client-attachment-widget.component-Bd48EHwE.mjs.map → acorex-platform-module-document-management-client-attachment-widget.component-DU6dwM0k.mjs.map} +1 -1
  7. package/fesm2022/{acorex-platform-module-document-management-client-details-view.component-DRCj5sJZ.mjs → acorex-platform-module-document-management-client-details-view.component-CCtB3hn-.mjs} +2 -2
  8. package/fesm2022/{acorex-platform-module-document-management-client-details-view.component-DRCj5sJZ.mjs.map → acorex-platform-module-document-management-client-details-view.component-CCtB3hn-.mjs.map} +1 -1
  9. package/fesm2022/{acorex-platform-module-document-management-client-distribute-document.command-DgUgY_A1.mjs → acorex-platform-module-document-management-client-distribute-document.command-BGxozjsb.mjs} +2 -2
  10. package/fesm2022/{acorex-platform-module-document-management-client-distribute-document.command-DgUgY_A1.mjs.map → acorex-platform-module-document-management-client-distribute-document.command-BGxozjsb.mjs.map} +1 -1
  11. package/fesm2022/{acorex-platform-module-document-management-client-drive-choose.component-DxEWAigd.mjs → acorex-platform-module-document-management-client-drive-choose.component-Def-CJrm.mjs} +2 -2
  12. package/fesm2022/{acorex-platform-module-document-management-client-drive-choose.component-DxEWAigd.mjs.map → acorex-platform-module-document-management-client-drive-choose.component-Def-CJrm.mjs.map} +1 -1
  13. package/fesm2022/{acorex-platform-module-document-management-client-large-icons-view-skeleton.component-B8-WYaZN.mjs → acorex-platform-module-document-management-client-large-icons-view-skeleton.component-Bxytlns3.mjs} +2 -2
  14. package/fesm2022/{acorex-platform-module-document-management-client-large-icons-view-skeleton.component-B8-WYaZN.mjs.map → acorex-platform-module-document-management-client-large-icons-view-skeleton.component-Bxytlns3.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-document-management-client-large-icons-view.component-dfZyrfST.mjs → acorex-platform-module-document-management-client-large-icons-view.component-BmfWvkKr.mjs} +2 -2
  16. package/fesm2022/{acorex-platform-module-document-management-client-large-icons-view.component-dfZyrfST.mjs.map → acorex-platform-module-document-management-client-large-icons-view.component-BmfWvkKr.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-document-management-client-large-tiles-view.component-BxZdISS0.mjs → acorex-platform-module-document-management-client-large-tiles-view.component-VBXUQm_9.mjs} +2 -2
  18. package/fesm2022/{acorex-platform-module-document-management-client-large-tiles-view.component-BxZdISS0.mjs.map → acorex-platform-module-document-management-client-large-tiles-view.component-VBXUQm_9.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-document-management-client-list-view-skeleton.component-hOXMuPjS.mjs → acorex-platform-module-document-management-client-list-view-skeleton.component-DcWrB5ue.mjs} +2 -2
  20. package/fesm2022/{acorex-platform-module-document-management-client-list-view-skeleton.component-hOXMuPjS.mjs.map → acorex-platform-module-document-management-client-list-view-skeleton.component-DcWrB5ue.mjs.map} +1 -1
  21. package/fesm2022/{acorex-platform-module-document-management-client-list-view.component-iH0kvdWp.mjs → acorex-platform-module-document-management-client-list-view.component-WS_57nuX.mjs} +2 -2
  22. package/fesm2022/{acorex-platform-module-document-management-client-list-view.component-iH0kvdWp.mjs.map → acorex-platform-module-document-management-client-list-view.component-WS_57nuX.mjs.map} +1 -1
  23. package/fesm2022/{acorex-platform-module-document-management-client-open-document.command-IN2QSWDo.mjs → acorex-platform-module-document-management-client-open-document.command-BqvbHmro.mjs} +2 -2
  24. package/fesm2022/{acorex-platform-module-document-management-client-open-document.command-IN2QSWDo.mjs.map → acorex-platform-module-document-management-client-open-document.command-BqvbHmro.mjs.map} +1 -1
  25. package/fesm2022/{acorex-platform-module-document-management-client-request-document-review.command-CK5mJYR4.mjs → acorex-platform-module-document-management-client-request-document-review.command-DKZIRhjd.mjs} +2 -2
  26. package/fesm2022/{acorex-platform-module-document-management-client-request-document-review.command-CK5mJYR4.mjs.map → acorex-platform-module-document-management-client-request-document-review.command-DKZIRhjd.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-module-document-management-client-small-icons-view-skeleton.component-BABsshsn.mjs → acorex-platform-module-document-management-client-small-icons-view-skeleton.component-kT78a27B.mjs} +2 -2
  28. package/fesm2022/{acorex-platform-module-document-management-client-small-icons-view-skeleton.component-BABsshsn.mjs.map → acorex-platform-module-document-management-client-small-icons-view-skeleton.component-kT78a27B.mjs.map} +1 -1
  29. package/fesm2022/{acorex-platform-module-document-management-client-small-icons-view.component-BBo1iXfu.mjs → acorex-platform-module-document-management-client-small-icons-view.component-DHYt8kM1.mjs} +2 -2
  30. package/fesm2022/{acorex-platform-module-document-management-client-small-icons-view.component-BBo1iXfu.mjs.map → acorex-platform-module-document-management-client-small-icons-view.component-DHYt8kM1.mjs.map} +1 -1
  31. package/fesm2022/{acorex-platform-module-document-management-client-small-tiles-view-skeleton.component-BsP4uJdA.mjs → acorex-platform-module-document-management-client-small-tiles-view-skeleton.component-ByJHBDc6.mjs} +2 -2
  32. package/fesm2022/{acorex-platform-module-document-management-client-small-tiles-view-skeleton.component-BsP4uJdA.mjs.map → acorex-platform-module-document-management-client-small-tiles-view-skeleton.component-ByJHBDc6.mjs.map} +1 -1
  33. package/fesm2022/{acorex-platform-module-document-management-client-small-tiles-view.component-DrDYpNsF.mjs → acorex-platform-module-document-management-client-small-tiles-view.component-CWhWqo8z.mjs} +2 -2
  34. package/fesm2022/{acorex-platform-module-document-management-client-small-tiles-view.component-DrDYpNsF.mjs.map → acorex-platform-module-document-management-client-small-tiles-view.component-CWhWqo8z.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-module-document-management-client-upload-document.command-Dycu8sci.mjs → acorex-platform-module-document-management-client-upload-document.command-Bj67JZCc.mjs} +2 -2
  36. package/fesm2022/{acorex-platform-module-document-management-client-upload-document.command-Dycu8sci.mjs.map → acorex-platform-module-document-management-client-upload-document.command-Bj67JZCc.mjs.map} +1 -1
  37. package/fesm2022/acorex-platform-module-document-management-client.mjs +1 -1
  38. package/package.json +2 -2
  39. package/fesm2022/acorex-platform-module-document-management-client-acorex-platform-module-document-management-client-BiosmCuZ.mjs.map +0 -1
@@ -3025,7 +3025,7 @@ class AXMDocumentManagerServiceImpl extends AXMDocumentManagerService {
3025
3025
  async openDriveFolderPicker(options) {
3026
3026
  let title = '';
3027
3027
  const popup = await this.dialogOpener.openPopup({
3028
- load: () => import('./acorex-platform-module-document-management-client-drive-choose.component-DxEWAigd.mjs').then((module) => module.AXMDocumentDriveChooseComponent),
3028
+ load: () => import('./acorex-platform-module-document-management-client-drive-choose.component-Def-CJrm.mjs').then((module) => module.AXMDocumentDriveChooseComponent),
3029
3029
  data: {
3030
3030
  titleKey: options.titleKey,
3031
3031
  scope: options.scope,
@@ -4204,97 +4204,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
4204
4204
  type: Injectable
4205
4205
  }] });
4206
4206
 
4207
- //#region ---- Drive file chooser provider ----
4208
- function mapDriveNodeToFileListItem(node) {
4209
- const raw = node.fileId;
4210
- const name = (typeof raw === 'object' && raw?.name ? raw.name : node.name ?? '').trim() || 'file';
4211
- const size = (typeof raw === 'object' && raw?.size != null ? raw.size : node.size) ?? 0;
4212
- if (typeof raw === 'object' && raw?.source) {
4213
- return {
4214
- id: raw.id ?? node.id,
4215
- name,
4216
- size,
4217
- status: 'attached',
4218
- source: raw.source,
4219
- };
4220
- }
4221
- if (typeof raw === 'string') {
4222
- const fileId = raw.startsWith('file:') ? raw.slice(5) : raw;
4223
- return {
4224
- id: node.id,
4225
- name,
4226
- size,
4227
- status: 'attached',
4228
- source: { kind: 'fileId', value: fileId },
4229
- };
4230
- }
4231
- return {
4232
- id: node.id,
4233
- name,
4234
- size,
4235
- status: 'attached',
4236
- source: {
4237
- kind: 'reference',
4238
- value: {
4239
- id: node.id,
4240
- type: 'document',
4241
- },
4242
- },
4243
- };
4244
- }
4245
- const AXM_DRIVE_FILE_CHOOSER_PROVIDER = {
4246
- key: 'drive',
4247
- title: '@layout:components.file-chooser.providers.drive',
4248
- icon: 'fa-light fa-hard-drive',
4249
- order: 2,
4250
- choose: async (context) => {
4251
- const popupService = inject(AXPopupService);
4252
- const dialogOpener = inject(AXPDialogOpener$1);
4253
- const translate = inject(AXTranslationService);
4254
- const scope = defaultTo(context.options['scope'], AXPPlatformScope.Tenant);
4255
- const multiple = Boolean(context.options['multiple']);
4256
- const browseMode = defaultTo(context.options['browseMode'], 'file');
4257
- const accept = context.options['accept'];
4258
- let title = '';
4259
- const popup = await dialogOpener.openPopup({
4260
- load: () => import('./acorex-platform-module-document-management-client-drive-choose.component-DxEWAigd.mjs').then((module) => module.AXMDocumentDriveChooseComponent),
4261
- data: { scope, multiple, browseMode, accept: accept ?? '' },
4262
- prepare: async () => {
4263
- title = await translate.translateAsync('@document-management:actions.choose-from-drive');
4264
- },
4265
- show: (component) => popupService.open(component, {
4266
- title,
4267
- size: 'lg',
4268
- data: {
4269
- scope,
4270
- selectionMode: multiple ? 'multiple' : 'single',
4271
- browseMode,
4272
- hideHeader: true,
4273
- accept,
4274
- },
4275
- }),
4276
- });
4277
- const picked = popup?.data;
4278
- if (!picked?.result) {
4279
- return undefined;
4280
- }
4281
- const selected = castArray(picked.items ?? []);
4282
- if (isEmpty$1(selected)) {
4283
- return undefined;
4284
- }
4285
- const nodes = browseMode === 'file' ? selected.filter((node) => node.type === 'file') : selected;
4286
- if (isEmpty$1(nodes)) {
4287
- return undefined;
4288
- }
4289
- const next = nodes.map(mapDriveNodeToFileListItem);
4290
- if (!multiple) {
4291
- return next.slice(0, 1);
4292
- }
4293
- return [...context.items, ...next];
4294
- },
4295
- };
4296
- //#endregion
4297
-
4298
4207
  //#endregion
4299
4208
  //#region ---- Clone blob resolution ----
4300
4209
  /**
@@ -4343,7 +4252,7 @@ async function resolveDriveCloneBlob(fileInfo, fileStorageService) {
4343
4252
  }
4344
4253
  if (fileInfo.source?.kind === 'url' && typeof fileInfo.source.value === 'string') {
4345
4254
  try {
4346
- const res = await fetch(fileInfo.source.value, { credentials: 'include' });
4255
+ const res = await fetch(resolveClientAssetUrl(fileInfo.source.value), { credentials: 'include' });
4347
4256
  if (!res.ok) {
4348
4257
  return null;
4349
4258
  }
@@ -4351,7 +4260,7 @@ async function resolveDriveCloneBlob(fileInfo, fileStorageService) {
4351
4260
  return {
4352
4261
  blob,
4353
4262
  name: fileInfo.name,
4354
- size: fileInfo.size ?? blob.size,
4263
+ size: blob.size || fileInfo.size,
4355
4264
  mimeType: blob.type || 'application/octet-stream',
4356
4265
  };
4357
4266
  }
@@ -4361,6 +4270,13 @@ async function resolveDriveCloneBlob(fileInfo, fileStorageService) {
4361
4270
  }
4362
4271
  return null;
4363
4272
  }
4273
+ /** Chooser validation keeps blob items only when `source.value` is the same `File` instance it checks. */
4274
+ function toCloneFile(blob, name, mimeType) {
4275
+ if (blob instanceof File && blob.name === name) {
4276
+ return blob;
4277
+ }
4278
+ return new File([blob], name, { type: mimeType || blob.type || 'application/octet-stream' });
4279
+ }
4364
4280
  //#endregion
4365
4281
  //#region ---- Upload options dialog ----
4366
4282
  /**
@@ -4373,6 +4289,20 @@ async function promptDriveUploadAttachmentType(translationService, dialogService
4373
4289
  // OK / primary -> clone copy; Cancel / secondary -> link by document reference
4374
4290
  return dialogResult.result ? 'clone' : 'by-reference';
4375
4291
  }
4292
+ /**
4293
+ * Resolves clone vs reference from caller options, otherwise asks the user.
4294
+ * `attachmentType` wins; `skipUploadOptions` attaches by reference without a dialog.
4295
+ */
4296
+ async function resolveDriveUploadAttachmentType(options, translationService, dialogService) {
4297
+ const attachmentTypeFromOptions = options?.['attachmentType'];
4298
+ if (attachmentTypeFromOptions === 'clone' || attachmentTypeFromOptions === 'by-reference') {
4299
+ return attachmentTypeFromOptions;
4300
+ }
4301
+ if (Boolean(options?.['skipUploadOptions'])) {
4302
+ return 'by-reference';
4303
+ }
4304
+ return promptDriveUploadAttachmentType(translationService, dialogService);
4305
+ }
4376
4306
  //#endregion
4377
4307
  //#region ---- Node to file list mapping ----
4378
4308
  function nodeFileIdToListItem(raw, node) {
@@ -4423,14 +4353,15 @@ async function mapDriveNodesToFileListItems(nodes, attachmentType, fileStorageSe
4423
4353
  if (!resolved) {
4424
4354
  continue;
4425
4355
  }
4356
+ const name = resolved.name ?? displayName;
4426
4357
  items.push({
4427
4358
  id: AXPDataGenerator.uuid(),
4428
- name: resolved.name ?? displayName,
4359
+ name,
4429
4360
  size: resolved.size ?? resolved.blob.size,
4430
4361
  status: 'attached',
4431
4362
  source: {
4432
4363
  kind: 'blob',
4433
- value: resolved.blob,
4364
+ value: toCloneFile(resolved.blob, name, resolved.mimeType),
4434
4365
  },
4435
4366
  });
4436
4367
  }
@@ -4466,14 +4397,15 @@ async function mapChosenDriveItemsToFileListItems(chosen, attachmentType, fileSt
4466
4397
  if (!resolved) {
4467
4398
  continue;
4468
4399
  }
4400
+ const name = resolved.name ?? item.name ?? 'file';
4469
4401
  items.push({
4470
4402
  id: AXPDataGenerator.uuid(),
4471
- name: resolved.name ?? item.name,
4403
+ name,
4472
4404
  size: resolved.size ?? resolved.blob.size,
4473
4405
  status: 'attached',
4474
4406
  source: {
4475
4407
  kind: 'blob',
4476
- value: resolved.blob,
4408
+ value: toCloneFile(resolved.blob, name, resolved.mimeType),
4477
4409
  },
4478
4410
  });
4479
4411
  }
@@ -4481,6 +4413,104 @@ async function mapChosenDriveItemsToFileListItems(chosen, attachmentType, fileSt
4481
4413
  }
4482
4414
  //#endregion
4483
4415
 
4416
+ //#region ---- Drive file chooser provider ----
4417
+ function mapDriveNodeToFileListItem(node) {
4418
+ const raw = node.fileId;
4419
+ const name = (typeof raw === 'object' && raw?.name ? raw.name : node.name ?? '').trim() || 'file';
4420
+ const size = (typeof raw === 'object' && raw?.size != null ? raw.size : node.size) ?? 0;
4421
+ if (typeof raw === 'object' && raw?.source) {
4422
+ return {
4423
+ id: raw.id ?? node.id,
4424
+ name,
4425
+ size,
4426
+ status: 'attached',
4427
+ source: raw.source,
4428
+ };
4429
+ }
4430
+ if (typeof raw === 'string') {
4431
+ const fileId = raw.startsWith('file:') ? raw.slice(5) : raw;
4432
+ return {
4433
+ id: node.id,
4434
+ name,
4435
+ size,
4436
+ status: 'attached',
4437
+ source: { kind: 'fileId', value: fileId },
4438
+ };
4439
+ }
4440
+ return {
4441
+ id: node.id,
4442
+ name,
4443
+ size,
4444
+ status: 'attached',
4445
+ source: {
4446
+ kind: 'reference',
4447
+ value: {
4448
+ id: node.id,
4449
+ type: 'document',
4450
+ },
4451
+ },
4452
+ };
4453
+ }
4454
+ const AXM_DRIVE_FILE_CHOOSER_PROVIDER = {
4455
+ key: 'drive',
4456
+ title: '@layout:components.file-chooser.providers.drive',
4457
+ icon: 'fa-light fa-hard-drive',
4458
+ order: 2,
4459
+ choose: async (context) => {
4460
+ const popupService = inject(AXPopupService);
4461
+ const dialogOpener = inject(AXPDialogOpener$1);
4462
+ const translate = inject(AXTranslationService);
4463
+ const dialogService = inject(AXDialogService);
4464
+ const fileStorageService = inject(AXPFileStorageService);
4465
+ const scope = defaultTo(context.options['scope'], AXPPlatformScope.Tenant);
4466
+ const multiple = Boolean(context.options['multiple']);
4467
+ const browseMode = defaultTo(context.options['browseMode'], 'file');
4468
+ const accept = context.options['accept'];
4469
+ let title = '';
4470
+ const popup = await dialogOpener.openPopup({
4471
+ load: () => import('./acorex-platform-module-document-management-client-drive-choose.component-Def-CJrm.mjs').then((module) => module.AXMDocumentDriveChooseComponent),
4472
+ data: { scope, multiple, browseMode, accept: accept ?? '' },
4473
+ prepare: async () => {
4474
+ title = await translate.translateAsync('@document-management:actions.choose-from-drive');
4475
+ },
4476
+ show: (component) => popupService.open(component, {
4477
+ title,
4478
+ size: 'lg',
4479
+ data: {
4480
+ scope,
4481
+ selectionMode: multiple ? 'multiple' : 'single',
4482
+ browseMode,
4483
+ hideHeader: true,
4484
+ accept,
4485
+ },
4486
+ }),
4487
+ });
4488
+ const picked = popup?.data;
4489
+ if (!picked?.result) {
4490
+ return undefined;
4491
+ }
4492
+ const selected = castArray(picked.items ?? []);
4493
+ if (isEmpty$1(selected)) {
4494
+ return undefined;
4495
+ }
4496
+ const nodes = browseMode === 'file' ? selected.filter((node) => node.type === 'file') : selected;
4497
+ if (isEmpty$1(nodes)) {
4498
+ return undefined;
4499
+ }
4500
+ const next = browseMode === 'file'
4501
+ ? await mapDriveNodesToFileListItems(nodes, await resolveDriveUploadAttachmentType(context.options, translate, dialogService), fileStorageService)
4502
+ : nodes.map(mapDriveNodeToFileListItem);
4503
+ if (isEmpty$1(next)) {
4504
+ return undefined;
4505
+ }
4506
+ if (!multiple) {
4507
+ return next.slice(0, 1);
4508
+ }
4509
+ return [...context.items, ...next];
4510
+ },
4511
+ };
4512
+ //#endregion
4513
+
4484
4514
  //#region ---- Drive file uploader provider ----
4485
4515
  const AXM_DRIVE_FILE_UPLOADER_PROVIDER = {
4486
4516
  key: 'drive',
@@ -4494,12 +4524,7 @@ const AXM_DRIVE_FILE_UPLOADER_PROVIDER = {
4494
4524
  if (isEmpty$1(context.chosen)) {
4495
4525
  return undefined;
4496
4526
  }
4497
- const skipUploadOptions = Boolean(context.options['skipUploadOptions']);
4498
- const attachmentTypeFromOptions = context.options['attachmentType'];
4499
- const attachmentType = attachmentTypeFromOptions ??
4500
- (skipUploadOptions
4501
- ? 'by-reference'
4502
- : await promptDriveUploadAttachmentType(translationService, dialogService));
4527
+ const attachmentType = await resolveDriveUploadAttachmentType(context.options, translationService, dialogService);
4503
4528
  const uploaded = await mapChosenDriveItemsToFileListItems(context.chosen, attachmentType, fileStorageService);
4504
4529
  if (isEmpty$1(uploaded)) {
4505
4530
  return undefined;
@@ -4518,9 +4543,6 @@ const UploadFromDriveActionProvider = {
4518
4543
  priority: 2,
4519
4544
  execute: (payload) => {
4520
4545
  const chooserService = inject(AXPFileChooserService);
4521
- const fileStorageService = inject(AXPFileStorageService);
4522
- const translationService = inject(AXTranslationService);
4523
- const dialogService = inject(AXDialogService);
4524
4546
  payload.actions = [
4525
4547
  ...payload.actions,
4526
4548
  {
@@ -4541,14 +4563,10 @@ const UploadFromDriveActionProvider = {
4541
4563
  if (!chosen?.length) {
4542
4564
  return;
4543
4565
  }
4544
- const attachmentType = await promptDriveUploadAttachmentType(translationService, dialogService);
4545
- const finalItems = await mapChosenDriveItemsToFileListItems(chosen, attachmentType, fileStorageService);
4546
- if (finalItems.length > 0) {
4547
- capabilities.addFiles(finalItems.map((item) => ({
4548
- ...item,
4549
- id: item.id ?? AXPDataGenerator.uuid(),
4550
- })));
4551
- }
4566
+ capabilities.addFiles(chosen.map((item) => ({
4567
+ ...item,
4568
+ id: item.id ?? AXPDataGenerator.uuid(),
4569
+ })));
4552
4570
  },
4553
4571
  },
4554
4572
  ];
@@ -4579,17 +4597,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
4579
4597
  }]
4580
4598
  }] });
4581
4599
 
4582
- function getFileIdFromFileInfo(fileInfo) {
4583
- if (fileInfo == null)
4584
- return undefined;
4585
- if (typeof fileInfo === 'string')
4586
- return fileInfo;
4587
- if (fileInfo.source?.kind === 'fileId' && typeof fileInfo.source.value === 'string')
4588
- return fileInfo.source.value;
4589
- if (typeof fileInfo.id === 'string')
4590
- return fileInfo.id;
4591
- return undefined;
4592
- }
4593
4600
  //#region ---- Plugin Guard Utilities ----
4594
4601
  /**
4595
4602
  * Check if the 'document' plugin is active (enabled and not excluded) in the payload.
@@ -4818,18 +4825,36 @@ const DocumentFileUploaderDownloadReferenceProvider = {
4818
4825
  console.error('Document not found for reference:', payload.reference);
4819
4826
  return payload;
4820
4827
  }
4821
- const fileId = getFileIdFromFileInfo(document.fileInfo);
4828
+ const displayName = document.name ?? document.title;
4829
+ const linkedFile = document.fileInfo;
4830
+ if (linkedFile && typeof linkedFile === 'object') {
4831
+ const source = linkedFile.source;
4832
+ if (source?.kind === 'url' && typeof source.value === 'string') {
4833
+ payload.fileInfo = {
4834
+ url: resolveClientAssetUrl(source.value),
4835
+ name: linkedFile.name ?? displayName,
4836
+ };
4837
+ return payload;
4838
+ }
4839
+ if (source?.kind === 'blob' && source.value instanceof Blob) {
4840
+ payload.fileInfo = {
4841
+ binary: source.value,
4842
+ name: linkedFile.name ?? displayName,
4843
+ };
4844
+ return payload;
4845
+ }
4846
+ }
4847
+ const fileId = resolveDocumentStorageFileId(linkedFile);
4822
4848
  if (!fileId) {
4823
- console.error('Document does not have a valid fileId:', document);
4849
+ console.error('Document does not have a downloadable file:', document);
4824
4850
  return payload;
4825
4851
  }
4826
- // Get file info from file storage service
4827
4852
  const fileInfo = await fileStorageService.getInfo(fileId);
4828
4853
  if (fileInfo) {
4829
4854
  payload.fileInfo = {
4830
- url: fileInfo.url,
4855
+ url: fileInfo.url ? resolveClientAssetUrl(fileInfo.url) : undefined,
4831
4856
  binary: fileInfo.binary,
4832
- name: fileInfo.name ?? document.name ?? document.title,
4857
+ name: fileInfo.name ?? displayName,
4833
4858
  };
4834
4859
  }
4835
4860
  else {
@@ -7054,26 +7079,26 @@ class AXMDocumentExplorerComponent {
7054
7079
  /** Drops stale async open results when the user right-clicks again before items resolve. */
7055
7080
  this.contextMenuOpenToken = 0;
7056
7081
  this.viewMap = {
7057
- list: async () => (await import('./acorex-platform-module-document-management-client-list-view.component-iH0kvdWp.mjs')).AXMDocumentExplorerListViewComponent,
7058
- 'small-tiles': async () => (await import('./acorex-platform-module-document-management-client-small-tiles-view.component-DrDYpNsF.mjs')).AXMDocumentExplorerSmallTilesViewComponent,
7059
- 'large-tiles': async () => (await import('./acorex-platform-module-document-management-client-large-tiles-view.component-BxZdISS0.mjs')).AXMDocumentExplorerLargeTilesViewComponent,
7060
- details: async () => (await import('./acorex-platform-module-document-management-client-details-view.component-DRCj5sJZ.mjs')).AXMDocumentExplorerDetailsViewComponent,
7061
- 'large-icons': async () => (await import('./acorex-platform-module-document-management-client-large-icons-view.component-dfZyrfST.mjs')).AXMDocumentExplorerLargeIconsViewComponent,
7062
- 'small-icons': async () => (await import('./acorex-platform-module-document-management-client-small-icons-view.component-BBo1iXfu.mjs')).AXMDocumentExplorerSmallIconsViewComponent,
7063
- 'attachment': async () => (await import('./acorex-platform-module-document-management-client-attachment-widget.component-Bd48EHwE.mjs')).AXMDocumentExplorerAttachmentComponent,
7082
+ list: async () => (await import('./acorex-platform-module-document-management-client-list-view.component-WS_57nuX.mjs')).AXMDocumentExplorerListViewComponent,
7083
+ 'small-tiles': async () => (await import('./acorex-platform-module-document-management-client-small-tiles-view.component-CWhWqo8z.mjs')).AXMDocumentExplorerSmallTilesViewComponent,
7084
+ 'large-tiles': async () => (await import('./acorex-platform-module-document-management-client-large-tiles-view.component-VBXUQm_9.mjs')).AXMDocumentExplorerLargeTilesViewComponent,
7085
+ details: async () => (await import('./acorex-platform-module-document-management-client-details-view.component-CCtB3hn-.mjs')).AXMDocumentExplorerDetailsViewComponent,
7086
+ 'large-icons': async () => (await import('./acorex-platform-module-document-management-client-large-icons-view.component-BmfWvkKr.mjs')).AXMDocumentExplorerLargeIconsViewComponent,
7087
+ 'small-icons': async () => (await import('./acorex-platform-module-document-management-client-small-icons-view.component-DHYt8kM1.mjs')).AXMDocumentExplorerSmallIconsViewComponent,
7088
+ 'attachment': async () => (await import('./acorex-platform-module-document-management-client-attachment-widget.component-DU6dwM0k.mjs')).AXMDocumentExplorerAttachmentComponent,
7064
7089
  };
7065
7090
  this.skeletonViewMap = {
7066
- list: async () => (await import('./acorex-platform-module-document-management-client-list-view-skeleton.component-hOXMuPjS.mjs')).AXMDocumentExplorerListViewSkeletonComponent,
7067
- 'small-tiles': async () => (await import('./acorex-platform-module-document-management-client-small-tiles-view-skeleton.component-BsP4uJdA.mjs'))
7091
+ list: async () => (await import('./acorex-platform-module-document-management-client-list-view-skeleton.component-DcWrB5ue.mjs')).AXMDocumentExplorerListViewSkeletonComponent,
7092
+ 'small-tiles': async () => (await import('./acorex-platform-module-document-management-client-small-tiles-view-skeleton.component-ByJHBDc6.mjs'))
7068
7093
  .AXMDocumentExplorerSmallTilesViewSkeletonComponent,
7069
7094
  'large-tiles': async () => (await Promise.resolve().then(function () { return largeTilesViewSkeleton_component; }))
7070
7095
  .AXMDocumentExplorerLargeTilesViewSkeletonComponent,
7071
7096
  details: async () => (await import('./acorex-platform-module-document-management-client-details-view-skeleton.component-BnRZrzCX.mjs')).AXMDocumentExplorerDetailsViewSkeletonComponent,
7072
- 'large-icons': async () => (await import('./acorex-platform-module-document-management-client-large-icons-view-skeleton.component-B8-WYaZN.mjs'))
7097
+ 'large-icons': async () => (await import('./acorex-platform-module-document-management-client-large-icons-view-skeleton.component-Bxytlns3.mjs'))
7073
7098
  .AXMDocumentExplorerLargeIconsViewSkeletonComponent,
7074
- 'small-icons': async () => (await import('./acorex-platform-module-document-management-client-small-icons-view-skeleton.component-BABsshsn.mjs'))
7099
+ 'small-icons': async () => (await import('./acorex-platform-module-document-management-client-small-icons-view-skeleton.component-kT78a27B.mjs'))
7075
7100
  .AXMDocumentExplorerSmallIconsViewSkeletonComponent,
7076
- attachment: async () => (await import('./acorex-platform-module-document-management-client-attachment-view-skeleton.component-D-38wiyG.mjs'))
7101
+ attachment: async () => (await import('./acorex-platform-module-document-management-client-attachment-view-skeleton.component-C0r5kIzb.mjs'))
7077
7102
  .AXMDocumentExplorerAttachmentViewSkeletonComponent,
7078
7103
  };
7079
7104
  this.#effect2 = effect(() => {
@@ -8022,6 +8047,33 @@ function isStorageRef(value) {
8022
8047
  return (typeof value === 'string' &&
8023
8048
  (value.startsWith(FILE_PREFIX) || value.startsWith(DOCUMENT_PREFIX) || value.startsWith(REFERENCE_PREFIX)));
8024
8049
  }
8050
+ /** Persisted token for an attachment that is already stored (file, document link, or other reference). */
8051
+ function persistedAttachmentToken(item) {
8052
+ if (isStorageRef(item)) {
8053
+ return item;
8054
+ }
8055
+ if (!item || typeof item !== 'object') {
8056
+ return undefined;
8057
+ }
8058
+ const source = item.source;
8059
+ if (source?.kind === 'fileId' && typeof source.value === 'string') {
8060
+ const id = source.value.replace(/^file:/, '').trim();
8061
+ return id ? `${FILE_PREFIX}${id}` : undefined;
8062
+ }
8063
+ if (source?.kind === 'reference' && source.value && typeof source.value === 'object') {
8064
+ const reference = source.value;
8065
+ const id = typeof reference.id === 'string' ? reference.id.trim() : '';
8066
+ const type = typeof reference.type === 'string' ? reference.type.trim() : '';
8067
+ if (!id || !type) {
8068
+ return undefined;
8069
+ }
8070
+ if (type === 'document') {
8071
+ return `${DOCUMENT_PREFIX}${id}`;
8072
+ }
8073
+ return `${REFERENCE_PREFIX}${type}:${id}`;
8074
+ }
8075
+ return undefined;
8076
+ }
8025
8077
  function getDocumentMetaDataForm(item) {
8026
8078
  if (item?.meta?.metaDataForm != null)
8027
8079
  return item.meta.metaDataForm;
@@ -8081,7 +8133,29 @@ const attachmentsUploadMiddleware = {
8081
8133
  const normalized = [];
8082
8134
  for (const item of list) {
8083
8135
  const metaDataForm = getDocumentMetaDataForm(item);
8084
- if (item?.source?.kind === 'blob' && item.source.value instanceof Blob) {
8136
+ if (item?.status === 'deleted' && item?.source?.kind === 'reference') {
8137
+ continue;
8138
+ }
8139
+ const referenceToken = persistedAttachmentToken(item);
8140
+ if (item?.source?.kind === 'reference' && referenceToken) {
8141
+ // Rename/title edits must reach file-cast so the drive document is updated.
8142
+ // A bare document token drops the new name and the next load shows the old one.
8143
+ if (item.status === 'editing') {
8144
+ normalized.push({
8145
+ id: item.id,
8146
+ name: item.name,
8147
+ title: item.title,
8148
+ description: item.description,
8149
+ size: item.size,
8150
+ status: item.status,
8151
+ source: { kind: 'reference', value: item.source.value },
8152
+ });
8153
+ }
8154
+ else {
8155
+ normalized.push(referenceToken);
8156
+ }
8157
+ }
8158
+ else if (item?.source?.kind === 'blob' && item.source.value instanceof Blob) {
8085
8159
  const blob = item.source.value;
8086
8160
  const name = item.name || `file-${Date.now()}`;
8087
8161
  pendingByField[field].push({ fileItem: { ...item, name, metaDataForm }, blob });
@@ -8134,7 +8208,10 @@ const attachmentsUploadMiddleware = {
8134
8208
  if (!storage)
8135
8209
  continue;
8136
8210
  const stored = Array.isArray(ctx.data[field]) ? ctx.data[field] : [];
8137
- const finalRefs = stored.filter(isStorageRef);
8211
+ const finalRefs = stored
8212
+ .filter((entry) => entry?.status !== 'deleted')
8213
+ .map((entry) => persistedAttachmentToken(entry))
8214
+ .filter((token) => Boolean(token));
8138
8215
  for (const { fileItem, blob } of pending) {
8139
8216
  const metaDataForm = fileItem.metaDataForm ?? getDocumentMetaDataForm(fileItem);
8140
8217
  try {
@@ -8380,15 +8457,15 @@ class AXMDocumentManagementModule {
8380
8457
  provideCommandSetups([
8381
8458
  {
8382
8459
  key: 'DocumentManagement.Document:Upload',
8383
- command: () => import('./acorex-platform-module-document-management-client-upload-document.command-Dycu8sci.mjs').then((c) => c.AXMUploadDocumentCommand),
8460
+ command: () => import('./acorex-platform-module-document-management-client-upload-document.command-Bj67JZCc.mjs').then((c) => c.AXMUploadDocumentCommand),
8384
8461
  },
8385
8462
  {
8386
8463
  key: 'DocumentManagement.Document:Open',
8387
- command: () => import('./acorex-platform-module-document-management-client-open-document.command-IN2QSWDo.mjs').then((c) => c.AXMOpenDocumentCommand),
8464
+ command: () => import('./acorex-platform-module-document-management-client-open-document.command-BqvbHmro.mjs').then((c) => c.AXMOpenDocumentCommand),
8388
8465
  },
8389
8466
  {
8390
8467
  key: 'DocumentManagement.Document:Distribute',
8391
- command: () => import('./acorex-platform-module-document-management-client-distribute-document.command-DgUgY_A1.mjs').then((c) => c.AXMDistributeDocumentCommand),
8468
+ command: () => import('./acorex-platform-module-document-management-client-distribute-document.command-BGxozjsb.mjs').then((c) => c.AXMDistributeDocumentCommand),
8392
8469
  },
8393
8470
  {
8394
8471
  key: 'DocumentManagement.DocumentDistribution:SignOff',
@@ -8396,7 +8473,7 @@ class AXMDocumentManagementModule {
8396
8473
  },
8397
8474
  {
8398
8475
  key: 'DocumentManagement.Document:RequestReview',
8399
- command: () => import('./acorex-platform-module-document-management-client-request-document-review.command-CK5mJYR4.mjs').then((c) => c.AXMRequestDocumentReviewCommand),
8476
+ command: () => import('./acorex-platform-module-document-management-client-request-document-review.command-DKZIRhjd.mjs').then((c) => c.AXMRequestDocumentReviewCommand),
8400
8477
  },
8401
8478
  {
8402
8479
  key: 'DocumentManagement.DocumentReview:SignOff',
@@ -8487,15 +8564,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
8487
8564
  provideCommandSetups([
8488
8565
  {
8489
8566
  key: 'DocumentManagement.Document:Upload',
8490
- command: () => import('./acorex-platform-module-document-management-client-upload-document.command-Dycu8sci.mjs').then((c) => c.AXMUploadDocumentCommand),
8567
+ command: () => import('./acorex-platform-module-document-management-client-upload-document.command-Bj67JZCc.mjs').then((c) => c.AXMUploadDocumentCommand),
8491
8568
  },
8492
8569
  {
8493
8570
  key: 'DocumentManagement.Document:Open',
8494
- command: () => import('./acorex-platform-module-document-management-client-open-document.command-IN2QSWDo.mjs').then((c) => c.AXMOpenDocumentCommand),
8571
+ command: () => import('./acorex-platform-module-document-management-client-open-document.command-BqvbHmro.mjs').then((c) => c.AXMOpenDocumentCommand),
8495
8572
  },
8496
8573
  {
8497
8574
  key: 'DocumentManagement.Document:Distribute',
8498
- command: () => import('./acorex-platform-module-document-management-client-distribute-document.command-DgUgY_A1.mjs').then((c) => c.AXMDistributeDocumentCommand),
8575
+ command: () => import('./acorex-platform-module-document-management-client-distribute-document.command-BGxozjsb.mjs').then((c) => c.AXMDistributeDocumentCommand),
8499
8576
  },
8500
8577
  {
8501
8578
  key: 'DocumentManagement.DocumentDistribution:SignOff',
@@ -8503,7 +8580,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
8503
8580
  },
8504
8581
  {
8505
8582
  key: 'DocumentManagement.Document:RequestReview',
8506
- command: () => import('./acorex-platform-module-document-management-client-request-document-review.command-CK5mJYR4.mjs').then((c) => c.AXMRequestDocumentReviewCommand),
8583
+ command: () => import('./acorex-platform-module-document-management-client-request-document-review.command-DKZIRhjd.mjs').then((c) => c.AXMRequestDocumentReviewCommand),
8507
8584
  },
8508
8585
  {
8509
8586
  key: 'DocumentManagement.DocumentReview:SignOff',
@@ -9306,4 +9383,4 @@ var drive_component = /*#__PURE__*/Object.freeze({
9306
9383
  */
9307
9384
 
9308
9385
  export { resolveFolderExpirationCountBadges as $, AXPDocumentExplorerViewModel as A, AXMDocumentManagerServiceImpl as B, AXMFileTypeExtensionWidgetColumnComponent as C, AXMFileTypeExtensionWidgetDesignerComponent as D, AXMFileTypeExtensionWidgetEditComponent as E, AXMFileTypeExtensionWidgetViewComponent as F, AXMFileTypeModule as G, AXMMenuProvider as H, AXMSearchCommandProvider as I, AXM_DOCUMENT_ATTACHMENT_DIALOG_ON_ACTION_HOOK_KEY as J, AXM_DOCUMENT_DIALOG_SURFACE_ATTACHMENT as K, AXM_DOCUMENT_DIALOG_SURFACE_ATTACHMENT_NO_SAVE as L, AXM_DOCUMENT_EXPIRATION_STATUS as M, AXM_DOCUMENT_EXPIRATION_STATUS_DEFINITION_KEY as N, AXPDocumentManagementSettingProvider as O, AXmFileTypeExtensionWidget as P, DM_AUDIO_EXTENSION_ICONS as Q, DM_DOCUMENT_EXTENSION_ICONS as R, DM_FILE_EXTENSION_ICONS as S, DM_FILE_TYPE_ICONS as T, DM_VIDEO_EXTENSION_ICONS as U, DOCUMENT_DRIVE_PAGE_COMPONENT_KEY as V, ScopedDriveService as W, buildDocumentManagementFileTypeCatalog as X, documentPlugin as Y, resolveDocumentExpirationBadge as Z, resolveDocumentVersionNumber as _, AXMDocumentExpirationBadgeComponent as a, AXMDocumentVersionBadgeComponent as b, AXMFolderExpirationBadgesComponent as c, collectFolderScopedMetaDataList as d, collectDocumentScopedMetaDataList as e, flattenMetaDataColumns as f, collectLookupKeys as g, collectDocumentTypeIds as h, collectDocumentTypeNames as i, AXMDocumentManagerService as j, AXMDocumentDialogService as k, buildFileChooserOptionsFromDocumentType as l, AXPDocumentManagementService as m, collectDocumentTypeKeys as n, sourcesAllowDocumentReview as o, AXMDocumentExplorerComponent as p, AXMFolderPathBreadcrumbsComponent as q, readNodeMetaDataValue as r, sourcesAllowDocumentDistribution as s, AXMDocumentDriveComponent as t, AXMDocumentDrivePageComponent as u, AXMDocumentDrivePageComponentProvider as v, AXMDocumentExpirationStatusProvider as w, AXMDocumentManagementApiService as x, AXMDocumentManagementFileTypeProvider as y, AXMDocumentManagementModule as z };
9309
- //# sourceMappingURL=acorex-platform-module-document-management-client-acorex-platform-module-document-management-client-BiosmCuZ.mjs.map
9386
+ //# sourceMappingURL=acorex-platform-module-document-management-client-acorex-platform-module-document-management-client-BsjL51-C.mjs.map