Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 51b371e238 | |||
| 4839f822fa | |||
| 8a18494883 | |||
| 0a2a87acfa | |||
| 436197fbfe |
+207
-45
@@ -5,21 +5,29 @@ declare(strict_types=1);
|
|||||||
namespace KTXM\Mail;
|
namespace KTXM\Mail;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
use KTXC\Module\ModuleManager;
|
||||||
use KTXF\Mail\Object\Address;
|
use KTXF\Mail\Object\Address;
|
||||||
use KTXF\Mail\Object\AddressInterface;
|
use KTXF\Mail\Object\AddressInterface;
|
||||||
use KTXF\Mail\Object\MessagePart;
|
use KTXF\Mail\Object\MessagePart;
|
||||||
use KTXF\Mail\Object\MessagePropertiesMutableInterface;
|
use KTXF\Mail\Object\MessagePropertiesMutableInterface;
|
||||||
use KTXF\Mail\Service\ServiceEntitySubmitInterface;
|
use KTXF\Mail\Service\ServiceEntitySubmitInterface;
|
||||||
use KTXF\Mail\Submission\EntitySubmitResult;
|
use KTXF\Mail\Submission\EntitySubmitResult;
|
||||||
use KTXF\Resource\Identifier\EntityIdentifierInterface;
|
use KTXF\Resource\BinaryResource;
|
||||||
|
use KTXF\Resource\Identifier\EntityIdentifier;
|
||||||
use KTXF\Resource\Identifier\ResourceIdentifier;
|
use KTXF\Resource\Identifier\ResourceIdentifier;
|
||||||
use KTXF\Utile\UUID;
|
use KTXF\Utile\UUID;
|
||||||
use KTXM\Mail\Stores\CompositionStore;
|
use KTXM\Mail\Stores\CompositionStore;
|
||||||
use KTXM\MailManager\Manager as MailManager;
|
use KTXM\MailManager\Manager as MailManager;
|
||||||
|
use KTXM\DocumentsManager\Manager as DocumentsManager;
|
||||||
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
class CompositionManager {
|
class CompositionManager {
|
||||||
|
|
||||||
|
private const DOCUMENTS_MODULE_HANDLE = 'documents_manager';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
private readonly ContainerInterface $container,
|
||||||
|
private readonly ModuleManager $moduleManager,
|
||||||
private readonly CompositionStore $compositionStore,
|
private readonly CompositionStore $compositionStore,
|
||||||
private readonly MailManager $mailManager,
|
private readonly MailManager $mailManager,
|
||||||
) {}
|
) {}
|
||||||
@@ -75,7 +83,7 @@ class CompositionManager {
|
|||||||
data: $data,
|
data: $data,
|
||||||
);
|
);
|
||||||
// supplement the attachment metadata with source information
|
// supplement the attachment metadata with source information
|
||||||
$meta['origin'] = 'source';
|
$meta['origin'] = 'message';
|
||||||
$meta['source'] = $source;
|
$meta['source'] = $source;
|
||||||
$meta['partId'] = $attachment->getId();
|
$meta['partId'] = $attachment->getId();
|
||||||
$meta['blobId'] = $attachment->getBlobId();
|
$meta['blobId'] = $attachment->getBlobId();
|
||||||
@@ -292,40 +300,13 @@ class CompositionManager {
|
|||||||
|
|
||||||
return $properties;
|
return $properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array<int,array|string> $entries
|
|
||||||
* @return array<int,Address>
|
|
||||||
*/
|
|
||||||
private function mapAddresses(array $entries): array {
|
|
||||||
$addresses = [];
|
|
||||||
|
|
||||||
foreach ($entries as $entry) {
|
|
||||||
if (is_array($entry)) {
|
|
||||||
$address = Address::fromArray($entry);
|
|
||||||
if ($address->getAddress() !== '') {
|
|
||||||
$addresses[] = $address;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_string($entry) && $entry !== '') {
|
|
||||||
$address = Address::fromString($entry);
|
|
||||||
if ($address->getAddress() !== '') {
|
|
||||||
$addresses[] = $address;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $addresses;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function attachmentAdd(string $tenantId, string $userId, string $composition, array ...$attachments): array {
|
public function attachmentAdd(string $tenantId, string $userId, string $composition, array ...$attachments): array {
|
||||||
$result = [
|
$result = [
|
||||||
'composition' => $composition,
|
'composition' => $composition,
|
||||||
'attachments' => [],
|
'attachments' => [],
|
||||||
];
|
];
|
||||||
|
// fetch the composition to ensure it exists
|
||||||
$composed = $this->compositionStore->compositionFetch($tenantId, $userId, $composition);
|
$composed = $this->compositionStore->compositionFetch($tenantId, $userId, $composition);
|
||||||
if ($composed === null) {
|
if ($composed === null) {
|
||||||
$result['disposition'] = 'error';
|
$result['disposition'] = 'error';
|
||||||
@@ -335,32 +316,169 @@ class CompositionManager {
|
|||||||
];
|
];
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
// separate attachments by type
|
||||||
|
$uploads = [];
|
||||||
|
$documents = [];
|
||||||
foreach ($attachments as $attachment) {
|
foreach ($attachments as $attachment) {
|
||||||
if (!isset($attachment['identifier']) || !is_string($attachment['identifier']) || $attachment['identifier'] === '') {
|
if (isset($attachment['origin']) && $attachment['origin'] === 'documents') {
|
||||||
$identifier = UUID::v4();
|
$documents[] = $attachment;
|
||||||
} else {
|
} elseif (isset($attachment['origin']) && $attachment['origin'] === 'device') {
|
||||||
$identifier = $attachment['identifier'];
|
$uploads[] = $attachment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// process uploaded attachments
|
||||||
|
if ($uploads !== []) {
|
||||||
|
$this->attachmentAddFromDevice($tenantId, $userId, $composition, $uploads, $composed);
|
||||||
|
}
|
||||||
|
// process attachments from the documents module
|
||||||
|
if ($documents !== []) {
|
||||||
|
$failed = $documents !== []
|
||||||
|
? $this->attachmentAddFromDocuments($tenantId, $userId, $composition, $documents, $composed)
|
||||||
|
: [];
|
||||||
|
}
|
||||||
|
// save the updated composition with new attachments
|
||||||
|
$this->compositionStore->compositionSave($tenantId, $userId, $composition, $composed);
|
||||||
|
// construct the result
|
||||||
|
$result['attachments'] = $composed['attachments'];
|
||||||
|
$result['failed'] = $failed;
|
||||||
|
$result['disposition'] = match (true) {
|
||||||
|
$failed === [] => 'added',
|
||||||
|
$result['attachments'] !== [] => 'partial',
|
||||||
|
default => 'error',
|
||||||
|
};
|
||||||
|
if ($result['disposition'] === 'error') {
|
||||||
|
$result['error'] = [
|
||||||
|
'type' => 'attachment_add_failed',
|
||||||
|
'message' => 'None of the requested attachments could be added',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stage device-uploaded (base64 payload) attachment entries
|
||||||
|
*/
|
||||||
|
private function attachmentAddFromDevice(string $tenantId, string $userId, string $composition, array $uploads, array &$composed): void {
|
||||||
|
foreach ($uploads as $attachment) {
|
||||||
|
$identifier = (isset($attachment['identifier']) && is_string($attachment['identifier']) && $attachment['identifier'] !== '')
|
||||||
|
? $attachment['identifier']
|
||||||
|
: UUID::v4();
|
||||||
|
|
||||||
|
$decoded = base64_decode((string) ($attachment['data'] ?? ''), true);
|
||||||
|
if ($decoded === false) {
|
||||||
|
throw new InvalidArgumentException('Attachment payload is not valid base64');
|
||||||
}
|
}
|
||||||
|
|
||||||
$meta = $this->compositionStore->attachmentStageFromBase64(
|
$data = new BinaryResource(
|
||||||
|
$attachment['name'] ?? 'unknown.bin',
|
||||||
|
$attachment['type'] ?? 'application/octet-stream',
|
||||||
|
$this->stringToGenerator($decoded),
|
||||||
|
);
|
||||||
|
|
||||||
|
$meta = $this->compositionStore->attachmentStageFromStream(
|
||||||
tenantId: $tenantId,
|
tenantId: $tenantId,
|
||||||
userId: $userId,
|
userId: $userId,
|
||||||
compositionId: $composition,
|
compositionId: $composition,
|
||||||
attachmentId: $identifier,
|
attachmentId: $identifier,
|
||||||
name: $attachment['name'] ?? 'unknown.bin',
|
data: $data,
|
||||||
type: $attachment['type'] ?? 'application/octet-stream',
|
|
||||||
data: $attachment['data'] ?? '',
|
|
||||||
);
|
);
|
||||||
$meta['origin'] = 'upload';
|
$meta['origin'] = 'device';
|
||||||
|
$composed['attachments'][$meta['identifier']] = $meta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function resolveDocumentsManager(): ?DocumentsManager {
|
||||||
|
$module = $this->moduleManager->fetch(self::DOCUMENTS_MODULE_HANDLE);
|
||||||
|
if ($module === null || !$module->enabled()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!$this->container->has(DocumentsManager::class)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->container->get(DocumentsManager::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stage documents-sourced attachment entries
|
||||||
|
*/
|
||||||
|
private function attachmentAddFromDocuments(string $tenantId, string $userId, string $composition, array $sourced, array &$composed): array {
|
||||||
|
$failed = [];
|
||||||
|
|
||||||
|
// The documents module is an optional dependency, so we must resolve it
|
||||||
|
// lazily and handle the case where it is not installed or enabled.
|
||||||
|
$documentsManager = $this->resolveDocumentsManager();
|
||||||
|
if ($documentsManager === null) {
|
||||||
|
foreach ($sourced as $attachment) {
|
||||||
|
$failed[] = [
|
||||||
|
'identifier' => (string) ($attachment['source'] ?? ''),
|
||||||
|
'message' => 'Documents module is not installed or enabled',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return $failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
$requested = [];
|
||||||
|
foreach ($sourced as $attachment) {
|
||||||
|
$rawIdentifier = (string) $attachment['source'];
|
||||||
|
try {
|
||||||
|
$parsed = ResourceIdentifier::fromString($rawIdentifier);
|
||||||
|
} catch (InvalidArgumentException) {
|
||||||
|
$failed[] = ['identifier' => $rawIdentifier, 'message' => 'Invalid document identifier'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!$parsed instanceof EntityIdentifier) {
|
||||||
|
$failed[] = ['identifier' => $rawIdentifier, 'message' => 'Invalid document identifier'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$requested[] = ['attachment' => $attachment, 'identifier' => $parsed];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($requested === []) {
|
||||||
|
return $failed;
|
||||||
|
}
|
||||||
|
|
||||||
|
$entities = $documentsManager->entityFetchBulk($tenantId, $userId, ...array_column($requested, 'identifier'));
|
||||||
|
$entitiesByUrn = [];
|
||||||
|
foreach ($entities as $entity) {
|
||||||
|
$entitiesByUrn[$entity->urn()] = $entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($requested as ['attachment' => $attachment, 'identifier' => $entityIdentifier]) {
|
||||||
|
$urn = (string) $entityIdentifier;
|
||||||
|
$entity = $entitiesByUrn[$urn] ?? null;
|
||||||
|
if ($entity === null) {
|
||||||
|
$failed[] = ['identifier' => $urn, 'message' => 'Document not found or access denied'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$resource = $documentsManager->entityReadStream($tenantId, $userId, $entityIdentifier);
|
||||||
|
if ($resource === null) {
|
||||||
|
$failed[] = ['identifier' => $urn, 'message' => 'Document content could not be read'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$identifier = (isset($attachment['identifier']) && is_string($attachment['identifier']) && $attachment['identifier'] !== '')
|
||||||
|
? $attachment['identifier']
|
||||||
|
: UUID::v4();
|
||||||
|
|
||||||
|
$properties = $entity->getProperties();
|
||||||
|
$data = new BinaryResource($properties->getLabel(), $properties->getMime(), $this->streamToGenerator($resource));
|
||||||
|
|
||||||
|
$meta = $this->compositionStore->attachmentStageFromStream(
|
||||||
|
tenantId: $tenantId,
|
||||||
|
userId: $userId,
|
||||||
|
compositionId: $composition,
|
||||||
|
attachmentId: $identifier,
|
||||||
|
data: $data,
|
||||||
|
);
|
||||||
|
$meta['origin'] = 'documents';
|
||||||
|
$meta['source'] = $urn;
|
||||||
$composed['attachments'][$meta['identifier']] = $meta;
|
$composed['attachments'][$meta['identifier']] = $meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->compositionStore->compositionSave($tenantId, $userId, $composition, $composed);
|
return $failed;
|
||||||
|
|
||||||
$result['disposition'] = 'added';
|
|
||||||
$result['attachments'] = $composed['attachments'];
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function attachmentRemove(string $tenantId, string $userId, string $composition, string $identifier): array {
|
public function attachmentRemove(string $tenantId, string $userId, string $composition, string $identifier): array {
|
||||||
@@ -393,4 +511,48 @@ class CompositionManager {
|
|||||||
$result['disposition'] = 'removed';
|
$result['disposition'] = 'removed';
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array<int,array|string> $entries
|
||||||
|
* @return array<int,Address>
|
||||||
|
*/
|
||||||
|
private function mapAddresses(array $entries): array {
|
||||||
|
$addresses = [];
|
||||||
|
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
if (is_array($entry)) {
|
||||||
|
$address = Address::fromArray($entry);
|
||||||
|
if ($address->getAddress() !== '') {
|
||||||
|
$addresses[] = $address;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_string($entry) && $entry !== '') {
|
||||||
|
$address = Address::fromString($entry);
|
||||||
|
if ($address->getAddress() !== '') {
|
||||||
|
$addresses[] = $address;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $addresses;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrap an in-memory byte string in a single-chunk Generator.
|
||||||
|
*/
|
||||||
|
private function stringToGenerator(string $bytes): \Generator {
|
||||||
|
yield $bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrap a raw PHP stream resource in a Generator yielding chunks, closing it once exhausted.
|
||||||
|
*/
|
||||||
|
private function streamToGenerator($resource): \Generator {
|
||||||
|
while (!feof($resource)) {
|
||||||
|
yield fread($resource, 65536);
|
||||||
|
}
|
||||||
|
fclose($resource);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,8 +7,8 @@ namespace KTXM\Mail\Controllers;
|
|||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use KTXC\Http\Response\JsonResponse;
|
use KTXC\Http\Response\JsonResponse;
|
||||||
use KTXC\Http\Response\Response;
|
use KTXC\Http\Response\Response;
|
||||||
use KTXC\SessionIdentity;
|
use KTXC\Context\IdentityContextInterface;
|
||||||
use KTXC\SessionTenant;
|
use KTXC\Context\TenantContextInterface;
|
||||||
use KTXF\Controller\ControllerAbstract;
|
use KTXF\Controller\ControllerAbstract;
|
||||||
use KTXF\Routing\Attributes\AuthenticatedRoute;
|
use KTXF\Routing\Attributes\AuthenticatedRoute;
|
||||||
use KTXM\Mail\CompositionManager;
|
use KTXM\Mail\CompositionManager;
|
||||||
@@ -18,8 +18,8 @@ use Throwable;
|
|||||||
final class CompositionController extends ControllerAbstract {
|
final class CompositionController extends ControllerAbstract {
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly SessionTenant $tenantIdentity,
|
private readonly TenantContextInterface $tenantContext,
|
||||||
private readonly SessionIdentity $userIdentity,
|
private readonly IdentityContextInterface $identityContext,
|
||||||
private readonly CompositionManager $compositionManager,
|
private readonly CompositionManager $compositionManager,
|
||||||
private readonly LoggerInterface $logger,
|
private readonly LoggerInterface $logger,
|
||||||
) {}
|
) {}
|
||||||
@@ -31,8 +31,8 @@ final class CompositionController extends ControllerAbstract {
|
|||||||
string|null $operation = null,
|
string|null $operation = null,
|
||||||
array|null $data = null,
|
array|null $data = null,
|
||||||
): Response {
|
): Response {
|
||||||
$tenantId = $this->tenantIdentity->identifier();
|
$tenantId = $this->tenantContext->identifier();
|
||||||
$userId = $this->userIdentity->identifier();
|
$userId = $this->identityContext->identifier();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($operation === null) {
|
if ($operation === null) {
|
||||||
|
|||||||
@@ -54,13 +54,7 @@ final class CompositionStore {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function attachmentStageFromStream(
|
public function attachmentStageFromStream(string $tenantId, string $userId, string $compositionId, string $attachmentId, BinaryResource $data): array {
|
||||||
string $tenantId,
|
|
||||||
string $userId,
|
|
||||||
string $compositionId,
|
|
||||||
string $attachmentId,
|
|
||||||
BinaryResource $data,
|
|
||||||
): array {
|
|
||||||
$attachmentDir = $this->attachmentDir($tenantId, $userId, $compositionId);
|
$attachmentDir = $this->attachmentDir($tenantId, $userId, $compositionId);
|
||||||
if (!is_dir($attachmentDir)) {
|
if (!is_dir($attachmentDir)) {
|
||||||
mkdir($attachmentDir, 0755, true);
|
mkdir($attachmentDir, 0755, true);
|
||||||
@@ -91,40 +85,6 @@ final class CompositionStore {
|
|||||||
return $meta;
|
return $meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function attachmentStageFromBase64(
|
|
||||||
string $tenantId,
|
|
||||||
string $userId,
|
|
||||||
string $compositionId,
|
|
||||||
string $attachmentId,
|
|
||||||
string $name,
|
|
||||||
string $type,
|
|
||||||
string $data,
|
|
||||||
): array {
|
|
||||||
$decoded = base64_decode($data, true);
|
|
||||||
if ($decoded === false) {
|
|
||||||
throw new \InvalidArgumentException('Attachment payload is not valid base64');
|
|
||||||
}
|
|
||||||
|
|
||||||
$attachmentDir = $this->attachmentDir($tenantId, $userId, $compositionId);
|
|
||||||
if (!is_dir($attachmentDir)) {
|
|
||||||
mkdir($attachmentDir, 0755, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
file_put_contents($attachmentDir . '/' . $attachmentId . '.blob', $decoded);
|
|
||||||
|
|
||||||
$metadata = [
|
|
||||||
'identifier' => $attachmentId,
|
|
||||||
'composition' => $compositionId,
|
|
||||||
'name' => $name,
|
|
||||||
'type' => $type,
|
|
||||||
'size' => strlen($decoded),
|
|
||||||
];
|
|
||||||
|
|
||||||
file_put_contents($attachmentDir . '/' . $attachmentId . '.meta', json_encode($metadata, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
|
||||||
|
|
||||||
return $metadata;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function attachmentFetchData(string $tenantId, string $userId, string $compositionId, string $attachmentId): ?string {
|
public function attachmentFetchData(string $tenantId, string $userId, string $compositionId, string $attachmentId): ?string {
|
||||||
$path = $this->attachmentDir($tenantId, $userId, $compositionId) . '/' . $attachmentId . '.blob';
|
$path = $this->attachmentDir($tenantId, $userId, $compositionId) . '/' . $attachmentId . '.blob';
|
||||||
if (!file_exists($path)) {
|
if (!file_exists($path)) {
|
||||||
|
|||||||
Generated
+198
-198
@@ -795,49 +795,49 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/core": {
|
"node_modules/@tiptap/core": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.30.1.tgz",
|
||||||
"integrity": "sha512-A/lrhKpOYtl0V5pmPS00Zps8pgBe1qDOoD9fzsumDSZ3HP8W398C959Jgru75PNFokAya9COPD3iaKP3NWF25g==",
|
"integrity": "sha512-HWEO6Qi8fI8Zt8X4atVV6GxthJx7Vrjr6L5YFq4OkjYJ7HG2/bFw6IKsDA3jOYgY4DM9lv8IadaiWUQ2JJRIBA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-blockquote": {
|
"node_modules/@tiptap/extension-blockquote": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-3.30.1.tgz",
|
||||||
"integrity": "sha512-k8NKHLEYOqre7guObZBeFM04CaTwmEceCmdIrIjd7H9KoHSbRODaBNved6j5G33x/FWMwIF/RQbE2BjWaFSgzA==",
|
"integrity": "sha512-nUBIPmf9fKfBzeMpQsexsHw3/ICzDfBK8DN9uLf5wO3I/gWycAByynvfNIqfHyl6Q77QgTIHrdjihEXUSYzeJg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-bold": {
|
"node_modules/@tiptap/extension-bold": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-3.30.1.tgz",
|
||||||
"integrity": "sha512-BPUJvJ9sCsU3fxao5UJfDJrDuHhMn2hczZwZ9Qs4w1vkAeLGyOYbSejUTJdBYHLoexGiEwgnEeVeZN3C8GaI5g==",
|
"integrity": "sha512-xnEGv7evFQquT0r/byjBt5iqDYQi6bF/W7DPO2rAG0z33mShDEUHhE407jakMiOSYNUilFjuQj1naLvwpQC3Bw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-bubble-menu": {
|
"node_modules/@tiptap/extension-bubble-menu": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.30.1.tgz",
|
||||||
"integrity": "sha512-aBNI8ebX76ObderRmu/PJ9Q2AGVEuhpg0TBvv2SNbHtmU5kNUMHQI8HxrxKFblJwETAmG6EJ3Ed/5jRxpJmrsg==",
|
"integrity": "sha512-6asFH7ZW0gTh0aX7qrABYRVqiU/IOSjk4PKt6qdZM5YS455bjVLZDM0PcIccMDaYiomuCNjfuCSj5dxmPDoWiQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -848,67 +848,80 @@
|
|||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tiptap/extension-bullet-list": {
|
||||||
|
"version": "3.30.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-3.30.1.tgz",
|
||||||
|
"integrity": "sha512-9bf4VgIxaOe+c7W20WZGUU5d2SFNGSpVwDGU/7jGlnjobzR7ZhDK/THk9JQr8OpvZrVN8Nmf84ZD3axjt+h/hQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/extension-list": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-code": {
|
"node_modules/@tiptap/extension-code": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-3.30.1.tgz",
|
||||||
"integrity": "sha512-Um0BlyunRJ8Fal288Jn7I2n15FRwQcTy3NnKBBrPz3ikwx+yZZ0n9xTozpLMSxXrTq6cRlxLkASp/9FFx9sX9A==",
|
"integrity": "sha512-oqLEOLZel3lrLhACP4vMhH5RNbV9yxFsJYiOmQjjEFEoCEWWxVfJuhZ+8NFS3mUCdgy77G62XimjEvqC3+7V7Q==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-code-block": {
|
"node_modules/@tiptap/extension-code-block": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-3.30.1.tgz",
|
||||||
"integrity": "sha512-nKm1YSEiPVosjm4qeg6m+6SAKq82rKukAzE/g3M5eVs2OgEb4QIKQvQOmJ+zgGAnpb9Q/JIvcKsGGU1rn9Vnyw==",
|
"integrity": "sha512-j19Ml9BpvHgTMSN4SfkJ26B5xSuHaxPXvMoXyAX1iOoSc4J92sCqShLGgpmtce42sIroYFRs4sBv0ndBRDcxtA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-document": {
|
"node_modules/@tiptap/extension-document": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-3.30.1.tgz",
|
||||||
"integrity": "sha512-folTlrwmUL+WSnojvfjZ951Gb25Pw8BxjXwhvXFuZXJ92qMfOcezA480kwFuu5nG8pPc/76ezQlz9a86Y5uQJw==",
|
"integrity": "sha512-aeMhO7EDoJyl5AGkF9hDQ9e52s18L8oYdbYjzcmXeo0YuXeaxbZCuUueVH4DnTfV7/vSkDRpDkk4TFF5LfKQpg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-dropcursor": {
|
"node_modules/@tiptap/extension-dropcursor": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.30.1.tgz",
|
||||||
"integrity": "sha512-IAY21q7KSXyCXN3u13kfpq0E8D2i3r9nSbsNYlLzkEv0Bpn+pWShZi05A0ubuothDNjdaMa96xaRY0f1y9gDZw==",
|
"integrity": "sha512-N3R5rA01WX/brGm1Qcnf2KLu0xkyGbRPMsHzzl1YG2sOLQM9t+FQi1T8WvSJiOpfYBVaWQkILUoCymADSpgUAg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/extensions": "3.29.0"
|
"@tiptap/extensions": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-floating-menu": {
|
"node_modules/@tiptap/extension-floating-menu": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.30.1.tgz",
|
||||||
"integrity": "sha512-/rFlN6T70HuT34kFvftKm56UX0IPff7vlII7Sqgs7DprKVYkItiU3lM7+AoeDRzCsWMg4z1yNHj70BPx7+EJ6Q==",
|
"integrity": "sha512-/Rlqsn7OXThZNzD0Qq/Ru4rZCFj3YnxL8Vf01cez+pvcyxgbwf4b9Wir+1JWJmaEMYsmWprSgEBW0l9ctbq97w==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"funding": {
|
"funding": {
|
||||||
@@ -917,80 +930,80 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@floating-ui/dom": "^1.0.0",
|
"@floating-ui/dom": "^1.0.0",
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-gapcursor": {
|
"node_modules/@tiptap/extension-gapcursor": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-3.30.1.tgz",
|
||||||
"integrity": "sha512-Jz0zwriGxPMuRjKo6x7WhPa/7pZn0dovyJu/GLarN4T+mMseGNXWwEBsLEKkuumsJVPDEPPFjX+rzEeaFKInPQ==",
|
"integrity": "sha512-dp13WaPNj32SkDN9tun0OtwtfdO/y52BJWigwXPgpUFLEyr8hQ84TxXL3rDshGHE4Eyjdd+erdBHisjBEV9vwQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/extensions": "3.29.0"
|
"@tiptap/extensions": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-hard-break": {
|
"node_modules/@tiptap/extension-hard-break": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-3.30.1.tgz",
|
||||||
"integrity": "sha512-8qKj0oeuU7IYoG73Lj3W4EC/JS/dFjN5iHmc4yodqppP6qs0o2zsF/2ipceGN/REZq5megPtxRgXu/nxQZ1NYg==",
|
"integrity": "sha512-2emcEkSSj+Y3dXXEugKQZDNeWCum0LBuKFmun7SiJyLOdxNuRnxwm2l4/LLiEHGDJBchDti4Oo8jZGLTRt4uog==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-heading": {
|
"node_modules/@tiptap/extension-heading": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.30.1.tgz",
|
||||||
"integrity": "sha512-xWb3QEKo7cp9u6Vzi6oYKODra6jPwziHBv3fJAnxWpRldxtJqfyOVMikWJJFuDjmr+K0qyegzf206pMk+y0bDg==",
|
"integrity": "sha512-TGM1ZNeH/D8HQK59vFMZql2gesMoHy+6nLq3mFsYpiRT2TShMGoq+K7SC+ty6N5a/k4M82ZQrDq8t4zjiiS5xA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-horizontal-rule": {
|
"node_modules/@tiptap/extension-horizontal-rule": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.30.1.tgz",
|
||||||
"integrity": "sha512-u1OgncXkokIuUJQIh4jVQfYHL/6I8VnrokUcCud4eErWvgeLnCbNmVdih4kxIdfmvEyAxXjDwcqf4AB79TxuNg==",
|
"integrity": "sha512-fTaSDapNV3cRgsek94z/Z4+Fyr0UpkE8/9PdSvt9MHYo/2yx3mmuamEJwUhUCpe7gDfzGdrMMsRpDOcd0b1ZEQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-italic": {
|
"node_modules/@tiptap/extension-italic": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-3.30.1.tgz",
|
||||||
"integrity": "sha512-c8gF+zM7yXB9iGxtVCioYecjQ+A2fLlNa1XYBYbTobNhbUo8a11akbTkGNcCIgttwnzwEoI4mB6/PK4yjaQvVg==",
|
"integrity": "sha512-KldMtozKk8OBHexo6akCQpJCWMgJ5OwPYuEOJO+vFjgw6VS+9N16peIo5dY+vXAiVIZL+swEsBp4barwz7NiLw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-link": {
|
"node_modules/@tiptap/extension-link": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-3.30.1.tgz",
|
||||||
"integrity": "sha512-FuLDgE0k1dB4WCBTelw3re9BLmiurgXVSj3d3J4l3sunljyOs941RUU62b7pWP+ePNdGF7RgUMmMAB+58VZCIA==",
|
"integrity": "sha512-krq5yHDT4K+u2r7rS0CGk/yafyAKY1gbxexfbMmq+jyHtUUrr0UuCT1nOTa61bV3zX1nrObM1lKSpZ5FgbfdhQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"linkifyjs": "^4.3.3"
|
"linkifyjs": "^4.3.3"
|
||||||
@@ -1000,106 +1013,159 @@
|
|||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tiptap/extension-list": {
|
||||||
|
"version": "3.30.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.30.1.tgz",
|
||||||
|
"integrity": "sha512-LizBu3fWrjifsL7QxKt+NhnHJDVGW/WWL+5asfqyznMqCZTy6tvPJ2W39pUHH2dBaVtzRIkAlsgWjDcNX/ep/Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/core": "3.30.1",
|
||||||
|
"@tiptap/pm": "3.30.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tiptap/extension-list-item": {
|
||||||
|
"version": "3.30.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-3.30.1.tgz",
|
||||||
|
"integrity": "sha512-8QqIKvEqXKlT4Cv3ZySHAq1jzKimT/UnFxNBCnkBg+aZBgImvPlRFdN5nFs0elxiSQ7Jtt6k29aOyrkjxgyeew==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/extension-list": "3.30.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tiptap/extension-list-keymap": {
|
||||||
|
"version": "3.30.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-list-keymap/-/extension-list-keymap-3.30.1.tgz",
|
||||||
|
"integrity": "sha512-ju39AnbRyWr1vG4GnMM7BritV/9heGMeH103wccXgJU9hOEqzwmN9zpf5CZqeRnXOjzwQiojrEL+nwm5MnuboA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/extension-list": "3.30.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tiptap/extension-ordered-list": {
|
||||||
|
"version": "3.30.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-3.30.1.tgz",
|
||||||
|
"integrity": "sha512-kJ4+4I1n4b5jV8OpWH+dbKOlIWTWVPv/fxDQKZuAT/a0DRoowpRoAuGJ0Nk9/Azeqel6c8Ocb4n1J7xLR6Xl2Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tiptap/extension-list": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-paragraph": {
|
"node_modules/@tiptap/extension-paragraph": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-3.30.1.tgz",
|
||||||
"integrity": "sha512-OtGrkwzqlW+ehW+d2qrQ7VVcP9PbDeQmuT4Ec4yFjf3vR4QO8OVdVfeOcUq52PtkT3kYRxz9fzEiEvjqRm72yA==",
|
"integrity": "sha512-1kAYoyIF88l2qPgHi9ZeS5D5N7TzdJg3FvVCOJvUplQtBIwrsNAx6zaH/16NKN7kRiW7zETMKXMKkhL6MIvnDg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-placeholder": {
|
"node_modules/@tiptap/extension-placeholder": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-3.30.1.tgz",
|
||||||
"integrity": "sha512-V2jb0kL/k3rygAtKmSPYxoyBMCQJtJikPYnxiCYuY7FI1ohmCrmhyhkVqJv0b0EPMNW8BMIqf6DgpKJ/ODmXgA==",
|
"integrity": "sha512-z0WAMWLF6Hh3C1kuhcYVA3srK0J7d7UNdrY8hw4LlrhmJv1xIoZSUIwH+c8WkMJ5c79idL2zpeWVCtGEyH8UHw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/extensions": "3.29.0"
|
"@tiptap/extensions": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-strike": {
|
"node_modules/@tiptap/extension-strike": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-3.30.1.tgz",
|
||||||
"integrity": "sha512-VzasZkckrEXzmFQT9z3O95rUWy1b0RLFHAC6GUSQHxKk4TpP+Ujfn5+rqmPukMn0eScJyw1Y36jwfJc0VuNR+Q==",
|
"integrity": "sha512-vyF8TPTARaN5coGrFwqVREPXDONE4SXJMIxo9qMaBJWl7723m+Enpy7qmFscnwifW5XTpOA8jKl/QJ7qud/ljw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-text": {
|
"node_modules/@tiptap/extension-text": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-3.30.1.tgz",
|
||||||
"integrity": "sha512-AMsf2V7IiGvzbl+LqLLfyWzufazZxHuid1gOnEt3KwolQ9AO7p8WJgHld0PZLxNyEh4SaSqK7b3d3SM9sqrlTw==",
|
"integrity": "sha512-Zt3Ik95ZKJx5YNzC6TUXWTNBHUfRH/qVENmqfPjA7x7q4cqNdOEU+tX9DrlFjgxu/x0k48dlQS0Kaop24/vihA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-text-align": {
|
"node_modules/@tiptap/extension-text-align": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-text-align/-/extension-text-align-3.30.1.tgz",
|
||||||
"integrity": "sha512-/1htV3teqRJ7i7trAuORDg62LV0CQ1qskbMcP3SB7grsw6H1G54zwdaJVXeiIXmQKDF7FoZgY7u/v/TJckthEw==",
|
"integrity": "sha512-oYAYySpwcgcHSdZw8xgMqF+sCNUgM7v/2UQj0amsBOLbk5VMfiLdJp5Ku+z5aqCwBBUjb6sInh1Amzd3q57w4A==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extension-underline": {
|
"node_modules/@tiptap/extension-underline": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-3.30.1.tgz",
|
||||||
"integrity": "sha512-DSPTogdvxmoX/L0U5KgBC9jWffRvYkGiyh1tp28gn+QaARh4iJn79pAZpi1m1bEhal/0Mq5m4ukbiO7FWInwaA==",
|
"integrity": "sha512-Xro/EzEgWW+46ztrw5f4epDWQvcGpD+HUykzigj30bpIS8Vv4XDXFt+89dAcyDC7zRUMQULlWZV0UCyRLFEKBw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0"
|
"@tiptap/core": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/extensions": {
|
"node_modules/@tiptap/extensions": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.30.1.tgz",
|
||||||
"integrity": "sha512-ltlrm8dDHIgeNj3cOLEdLFMPPVy3TYvWA8ftrrJ44C/L01MBmgFB1f/vkPFYYnAasb2BYyVG6HxAGcTQHo5jHw==",
|
"integrity": "sha512-prNrvF1oMj+tngCLmZgXzQfuUuvYMbCe2sEPXXKJPqJNNffHd2wAuUZ0h6UQS5aRILaxB2kN1/yfwpxnhRpwYA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/pm": {
|
"node_modules/@tiptap/pm": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.30.1.tgz",
|
||||||
"integrity": "sha512-4rr3HiZ8kbSNINuWXqKQJLv9fFMypCBN5gOwxoU+D4lEYVblkoM60fA1SlrI2BZVlZQmw2U38XKl5XMtUr55XQ==",
|
"integrity": "sha512-2bHY+ihexKpfBURbAD+ahY0+lWle0TueTK80GAGYqZ/G7ErAPOmzN5RVAGMyZJI4wDkcFycRNLi3k0/3VT9a1A==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"prosemirror-changeset": "^2.4.1",
|
"prosemirror-changeset": "^2.4.1",
|
||||||
@@ -1122,124 +1188,58 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/starter-kit": {
|
"node_modules/@tiptap/starter-kit": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-3.30.1.tgz",
|
||||||
"integrity": "sha512-J3jTp3/WXnnL58TCtdMsfeQ2BeycFYrAib6Nbpjd9G0OLUBE7AILiH2HrobRQpvRbAUgD5SW+sBZYOonbWWqNg==",
|
"integrity": "sha512-6P2WEp2ZHsx8LV6hQ3K/MB3n39oiVhKESlzh0v+KhK8RR/iKSKGxvTFbi1D/1fo4j3fZf+43PGHjyKXskn9ZmQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tiptap/core": "^3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/extension-blockquote": "^3.29.0",
|
"@tiptap/extension-blockquote": "3.30.1",
|
||||||
"@tiptap/extension-bold": "^3.29.0",
|
"@tiptap/extension-bold": "3.30.1",
|
||||||
"@tiptap/extension-bullet-list": "^3.29.0",
|
"@tiptap/extension-bullet-list": "3.30.1",
|
||||||
"@tiptap/extension-code": "^3.29.0",
|
"@tiptap/extension-code": "3.30.1",
|
||||||
"@tiptap/extension-code-block": "^3.29.0",
|
"@tiptap/extension-code-block": "3.30.1",
|
||||||
"@tiptap/extension-document": "^3.29.0",
|
"@tiptap/extension-document": "3.30.1",
|
||||||
"@tiptap/extension-dropcursor": "^3.29.0",
|
"@tiptap/extension-dropcursor": "3.30.1",
|
||||||
"@tiptap/extension-gapcursor": "^3.29.0",
|
"@tiptap/extension-gapcursor": "3.30.1",
|
||||||
"@tiptap/extension-hard-break": "^3.29.0",
|
"@tiptap/extension-hard-break": "3.30.1",
|
||||||
"@tiptap/extension-heading": "^3.29.0",
|
"@tiptap/extension-heading": "3.30.1",
|
||||||
"@tiptap/extension-horizontal-rule": "^3.29.0",
|
"@tiptap/extension-horizontal-rule": "3.30.1",
|
||||||
"@tiptap/extension-italic": "^3.29.0",
|
"@tiptap/extension-italic": "3.30.1",
|
||||||
"@tiptap/extension-link": "^3.29.0",
|
"@tiptap/extension-link": "3.30.1",
|
||||||
"@tiptap/extension-list": "^3.29.0",
|
"@tiptap/extension-list": "3.30.1",
|
||||||
"@tiptap/extension-list-item": "^3.29.0",
|
"@tiptap/extension-list-item": "3.30.1",
|
||||||
"@tiptap/extension-list-keymap": "^3.29.0",
|
"@tiptap/extension-list-keymap": "3.30.1",
|
||||||
"@tiptap/extension-ordered-list": "^3.29.0",
|
"@tiptap/extension-ordered-list": "3.30.1",
|
||||||
"@tiptap/extension-paragraph": "^3.29.0",
|
"@tiptap/extension-paragraph": "3.30.1",
|
||||||
"@tiptap/extension-strike": "^3.29.0",
|
"@tiptap/extension-strike": "3.30.1",
|
||||||
"@tiptap/extension-text": "^3.29.0",
|
"@tiptap/extension-text": "3.30.1",
|
||||||
"@tiptap/extension-underline": "^3.29.0",
|
"@tiptap/extension-underline": "3.30.1",
|
||||||
"@tiptap/extensions": "^3.29.0",
|
"@tiptap/extensions": "3.30.1",
|
||||||
"@tiptap/pm": "^3.29.0"
|
"@tiptap/pm": "3.30.1"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-bullet-list": {
|
|
||||||
"version": "3.29.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-3.29.0.tgz",
|
|
||||||
"integrity": "sha512-1045sC5CRn7KD0wluxZeksBwpm2k3LKBUOM3kNwExHAPSV4in4gdarYJ2/WCmIKsmyj2FzUcF4rbpLLSB/dBSg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tiptap/extension-list": "3.29.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-list": {
|
|
||||||
"version": "3.29.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.29.0.tgz",
|
|
||||||
"integrity": "sha512-k0B/+nIkn4VvHSQ0kP+AzzAmgeOVxKMAdqG4a6qwxp/lR12aJGHlOP92KCjXV2RNPtuwDksJ1RIXrgxdf9WmJg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tiptap/core": "3.29.0",
|
|
||||||
"@tiptap/pm": "3.29.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-list-item": {
|
|
||||||
"version": "3.29.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-3.29.0.tgz",
|
|
||||||
"integrity": "sha512-JSz27OIDHWDL7uw28E4W3eaN3H1u+NzJQKZkNXo5Qsvvsx8m/YIQWO9XlhiL3V4TZMjfvlc94lUp5tKW5KwETw==",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tiptap/extension-list": "3.29.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-list-keymap": {
|
|
||||||
"version": "3.29.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-list-keymap/-/extension-list-keymap-3.29.0.tgz",
|
|
||||||
"integrity": "sha512-g14QLZR9fmfJIL+X2R/cVTvQS0Mp7CoenA9PO+8adTjK7hCeB8hA3UAakMB4ekkElOXNOtb16e0wqulDcoqANg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tiptap/extension-list": "3.29.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tiptap/starter-kit/node_modules/@tiptap/extension-ordered-list": {
|
|
||||||
"version": "3.29.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-3.29.0.tgz",
|
|
||||||
"integrity": "sha512-9TXUDFagkGeu6Bo8L0b2SAVAYrY2Xzd28MXwiDxYvDKMjEGWkkCUpMiEI5Qav3GnfFWLmS3jI8PgUjxIw9wLLQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tiptap/extension-list": "3.29.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tiptap/vue-3": {
|
"node_modules/@tiptap/vue-3": {
|
||||||
"version": "3.29.0",
|
"version": "3.30.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-3.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tiptap/vue-3/-/vue-3-3.30.1.tgz",
|
||||||
"integrity": "sha512-OFESbEFlmDYPns5LrkyeKggis6tYICBvz+jrlVwxICCWJqWZJJvYb7y/uMtMCxFF1nAeGb8AFr8UhFrLaX5aiA==",
|
"integrity": "sha512-Y7YUkC+LpHcnraN0GwJtySh7XZnveqde5SsHV5X7h1erflp+WT7rG52sE0WKyFOSc3t9ZKSJ/4IBUtB3+ZQHrA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/ueberdosis"
|
"url": "https://github.com/sponsors/ueberdosis"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@tiptap/extension-bubble-menu": "^3.29.0",
|
"@tiptap/extension-bubble-menu": "^3.30.1",
|
||||||
"@tiptap/extension-floating-menu": "^3.29.0"
|
"@tiptap/extension-floating-menu": "^3.30.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@floating-ui/dom": "^1.0.0",
|
"@floating-ui/dom": "^1.0.0",
|
||||||
"@tiptap/core": "3.29.0",
|
"@tiptap/core": "3.30.1",
|
||||||
"@tiptap/pm": "3.29.0",
|
"@tiptap/pm": "3.30.1",
|
||||||
"vue": "^3.0.0"
|
"vue": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import type { CollectionObject, MessageAddressObject } from '@MailManager/models
|
|||||||
import { useMailOperationsStore } from '@/stores/mailOperationsStore'
|
import { useMailOperationsStore } from '@/stores/mailOperationsStore'
|
||||||
import { useMailCompositionStore } from '@/stores/mailCompositionStore'
|
import { useMailCompositionStore } from '@/stores/mailCompositionStore'
|
||||||
import { ComposerMode } from '@/types/composer'
|
import { ComposerMode } from '@/types/composer'
|
||||||
|
import { documentsSelectorComponent } from '@/services/documentsSelector'
|
||||||
import ComposerToolbar from '@/components/composer/ComposerToolbar.vue'
|
import ComposerToolbar from '@/components/composer/ComposerToolbar.vue'
|
||||||
import ComposerSender from '@/components/composer/ComposerSender.vue'
|
import ComposerSender from '@/components/composer/ComposerSender.vue'
|
||||||
import ComposerRecipients from '@/components/composer/ComposerRecipients.vue'
|
import ComposerRecipients from '@/components/composer/ComposerRecipients.vue'
|
||||||
@@ -48,6 +49,8 @@ const {
|
|||||||
const showCc = ref(false)
|
const showCc = ref(false)
|
||||||
const showBcc = ref(false)
|
const showBcc = ref(false)
|
||||||
const applyingDraftToEditor = ref(false)
|
const applyingDraftToEditor = ref(false)
|
||||||
|
const showDocumentSelector = ref(false)
|
||||||
|
const documentSelector = computed(() => documentsSelectorComponent())
|
||||||
|
|
||||||
const sender = computed({
|
const sender = computed({
|
||||||
get: () => activeDraft.value?.sender ?? null,
|
get: () => activeDraft.value?.sender ?? null,
|
||||||
@@ -166,8 +169,23 @@ const handleSend = async () => {
|
|||||||
await compositionStore.sendDraft()
|
await compositionStore.sendDraft()
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleAttach = async (files: File[]) => {
|
const handleAttachFromDevice = async (files: File[]) => {
|
||||||
await compositionStore.addAttachments(files)
|
await compositionStore.addAttachmentsFromDevice(files)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleAttachFromDocuments = () => {
|
||||||
|
showDocumentSelector.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDocumentsSelected = async (items: { kind: 'entity' | 'collection'; identifier: string; name: string; mimeType?: string; size?: number }[]) => {
|
||||||
|
// The dialog defaults to entities-only (no `selectable` prop passed below), but
|
||||||
|
// filter defensively since mail can't attach a folder as a single file blob.
|
||||||
|
const files = items.filter(item => item.kind === 'entity')
|
||||||
|
if (files.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await compositionStore.addAttachmentsFromDocuments(files)
|
||||||
|
showDocumentSelector.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDetach = async (identifier: string) => {
|
const handleDetach = async (identifier: string) => {
|
||||||
@@ -264,9 +282,18 @@ const isActive = (name: string, attrs?: any) => {
|
|||||||
@bullet-list="toggleBulletList"
|
@bullet-list="toggleBulletList"
|
||||||
@ordered-list="toggleOrderedList"
|
@ordered-list="toggleOrderedList"
|
||||||
@link="toggleLink"
|
@link="toggleLink"
|
||||||
@attach="handleAttach"
|
@attach-from-device="handleAttachFromDevice"
|
||||||
|
@attach-from-documents="handleAttachFromDocuments"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<component
|
||||||
|
:is="documentSelector"
|
||||||
|
v-if="documentSelector"
|
||||||
|
v-model="showDocumentSelector"
|
||||||
|
:selectable="['entity']"
|
||||||
|
@select="handleDocumentsSelected"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
import { EditorContent, type Editor } from '@tiptap/vue-3'
|
import { EditorContent, type Editor } from '@tiptap/vue-3'
|
||||||
|
import { documentsSelectorAvailable } from '@/services/documentsSelector'
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
editor: {
|
editor: {
|
||||||
@@ -41,7 +42,8 @@ const emit = defineEmits<{
|
|||||||
bulletList: []
|
bulletList: []
|
||||||
orderedList: []
|
orderedList: []
|
||||||
link: []
|
link: []
|
||||||
attach: [files: File[]]
|
attachFromDevice: [files: File[]]
|
||||||
|
attachFromDocuments: []
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const fileInput = ref<HTMLInputElement | null>(null)
|
const fileInput = ref<HTMLInputElement | null>(null)
|
||||||
@@ -54,7 +56,7 @@ function handleFileChange(event: Event) {
|
|||||||
const input = event.target as HTMLInputElement | null
|
const input = event.target as HTMLInputElement | null
|
||||||
const files = input?.files ? Array.from(input.files) : []
|
const files = input?.files ? Array.from(input.files) : []
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
emit('attach', files)
|
emit('attachFromDevice', files)
|
||||||
}
|
}
|
||||||
if (input) {
|
if (input) {
|
||||||
input.value = ''
|
input.value = ''
|
||||||
@@ -142,6 +144,11 @@ function handleFileChange(event: Event) {
|
|||||||
<v-icon>mdi-paperclip</v-icon>
|
<v-icon>mdi-paperclip</v-icon>
|
||||||
<v-tooltip activator="parent" location="bottom">Attach Files</v-tooltip>
|
<v-tooltip activator="parent" location="bottom">Attach Files</v-tooltip>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
|
<v-btn v-if="documentsSelectorAvailable()" icon size="small" @click="$emit('attachFromDocuments')">
|
||||||
|
<v-icon>mdi-folder-search-outline</v-icon>
|
||||||
|
<v-tooltip activator="parent" location="bottom">Attach from Documents</v-tooltip>
|
||||||
|
</v-btn>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
|
|
||||||
<v-divider />
|
<v-divider />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ComposerSenderIdentity } from '@/types/composer';
|
import type { ComposerSenderIdentity } from '@/types/composer';
|
||||||
import { computed } from 'vue'
|
import { computed, watch } from 'vue'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
modelValue: ComposerSenderIdentity | null
|
modelValue: ComposerSenderIdentity | null
|
||||||
@@ -27,11 +27,6 @@ const items = computed<SenderListItem[]>(() => {
|
|||||||
|
|
||||||
const selectedValue = computed(() => props.modelValue?.address ?? null)
|
const selectedValue = computed(() => props.modelValue?.address ?? null)
|
||||||
|
|
||||||
const singleOptionLabel = computed(() => {
|
|
||||||
const onlyOption = props.options[0]
|
|
||||||
return onlyOption ? formatSenderLabel(onlyOption.label, onlyOption.address) : ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const errorMessages = computed(() => {
|
const errorMessages = computed(() => {
|
||||||
if (props.options.length === 0) {
|
if (props.options.length === 0) {
|
||||||
return ['No send-capable account is available.']
|
return ['No send-capable account is available.']
|
||||||
@@ -40,6 +35,18 @@ const errorMessages = computed(() => {
|
|||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Auto-select (and keep selected) the only send-capable account, since
|
||||||
|
// there's no "from" UI shown for the user to pick it themselves.
|
||||||
|
watch(
|
||||||
|
() => props.options,
|
||||||
|
options => {
|
||||||
|
if (options.length === 1 && props.modelValue?.address !== options[0].address) {
|
||||||
|
emit('update:modelValue', options[0])
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
function handleUpdate(value: string | null) {
|
function handleUpdate(value: string | null) {
|
||||||
const match = value ? props.options.find(o => o.address === value) ?? null : null
|
const match = value ? props.options.find(o => o.address === value) ?? null : null
|
||||||
emit('update:modelValue', match)
|
emit('update:modelValue', match)
|
||||||
@@ -51,19 +58,8 @@ function formatSenderLabel(label: string | null | undefined, address: string): s
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="composer-sender px-4 pt-4 pb-0">
|
<div v-if="options.length !== 1" class="composer-sender px-4 pt-4 pb-0">
|
||||||
<v-text-field
|
|
||||||
v-if="options.length === 1"
|
|
||||||
:model-value="singleOptionLabel"
|
|
||||||
label="From"
|
|
||||||
variant="outlined"
|
|
||||||
density="compact"
|
|
||||||
readonly
|
|
||||||
class="mb-2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<v-select
|
<v-select
|
||||||
v-else
|
|
||||||
:model-value="selectedValue"
|
:model-value="selectedValue"
|
||||||
:items="items"
|
:items="items"
|
||||||
item-title="title"
|
item-title="title"
|
||||||
|
|||||||
@@ -40,10 +40,11 @@ const handleAccountSaved = async () => {
|
|||||||
<v-list-item
|
<v-list-item
|
||||||
v-for="service in servicesStore.services"
|
v-for="service in servicesStore.services"
|
||||||
:key="`${service.provider}:${service.identifier}`"
|
:key="`${service.provider}:${service.identifier}`"
|
||||||
|
:class="{ 'opacity-60': !service.enabled }"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<v-avatar color="primary">
|
<v-avatar :color="service.enabled ? 'primary' : 'grey'">
|
||||||
<v-icon>mdi-email</v-icon>
|
<v-icon>{{ service.enabled ? 'mdi-email' : 'mdi-email-off' }}</v-icon>
|
||||||
</v-avatar>
|
</v-avatar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* documentsSelector — bridges the Mail composer to documents_manager's
|
||||||
|
* document/collection picker dialog, resolved at runtime via the integration
|
||||||
|
* store. documents_manager (not the end-user `documents` app) registers this,
|
||||||
|
* since it's the module designed to be depended on by other feature modules;
|
||||||
|
* this mirrors CompositionManager's own ModuleManager-based check on the
|
||||||
|
* backend, which also targets documents_manager.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
import { useIntegrationStore } from '@KTXC'
|
||||||
|
|
||||||
|
const DOCUMENTS_SELECTOR_POINT = 'documents_selector'
|
||||||
|
|
||||||
|
/** True if a document selector dialog has been registered (i.e. documents_manager is enabled). */
|
||||||
|
export function documentsSelectorAvailable(): boolean {
|
||||||
|
return useIntegrationStore().getItems(DOCUMENTS_SELECTOR_POINT).length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
export function documentsSelectorComponent() {
|
||||||
|
// The integration store prefixes ids with the module handle
|
||||||
|
// (e.g. 'documents_manager.dialog'), so match on the suffix.
|
||||||
|
const entry = useIntegrationStore().getItems(DOCUMENTS_SELECTOR_POINT).find(i => i.id.endsWith('.dialog'))
|
||||||
|
return entry?.component
|
||||||
|
? defineAsyncComponent(entry.component as () => Promise<unknown>)
|
||||||
|
: null
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import type {
|
|||||||
import { ComposerMode } from '@/types/composer'
|
import { ComposerMode } from '@/types/composer'
|
||||||
import type { ComposerDraft, ComposerDraftAttachment, ComposerDraftMessage, ComposerSenderIdentity } from '@/types/composer'
|
import type { ComposerDraft, ComposerDraftAttachment, ComposerDraftMessage, ComposerSenderIdentity } from '@/types/composer'
|
||||||
import { EntityObject, MessageAddressObject, ServiceObject } from '@MailManager/models'
|
import { EntityObject, MessageAddressObject, ServiceObject } from '@MailManager/models'
|
||||||
|
import type { EntityIdentifier } from '@MailManager/types/common'
|
||||||
import type { MessageAddressInterface } from '@MailManager/types/message'
|
import type { MessageAddressInterface } from '@MailManager/types/message'
|
||||||
|
|
||||||
export const useMailCompositionStore = defineStore('mailCompositionStore', () => {
|
export const useMailCompositionStore = defineStore('mailCompositionStore', () => {
|
||||||
@@ -274,7 +275,7 @@ export const useMailCompositionStore = defineStore('mailCompositionStore', () =>
|
|||||||
queueSave(false)
|
queueSave(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addAttachments(files: File[]) {
|
async function addAttachmentsFromDevice(files: File[]) {
|
||||||
if (!activeDraft.value || files.length === 0) {
|
if (!activeDraft.value || files.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -288,7 +289,7 @@ export const useMailCompositionStore = defineStore('mailCompositionStore', () =>
|
|||||||
return [identifier, {
|
return [identifier, {
|
||||||
identifier,
|
identifier,
|
||||||
composition,
|
composition,
|
||||||
origin: 'upload',
|
origin: 'device',
|
||||||
name: file.name,
|
name: file.name,
|
||||||
type: file.type || 'application/octet-stream',
|
type: file.type || 'application/octet-stream',
|
||||||
size: file.size,
|
size: file.size,
|
||||||
@@ -327,6 +328,66 @@ export const useMailCompositionStore = defineStore('mailCompositionStore', () =>
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function addAttachmentsFromDocuments(items: { identifier: string; name: string; mimeType?: string; size?: number }[]) {
|
||||||
|
if (!activeDraft.value || items.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const composition = activeDraft.value.identifier
|
||||||
|
const attachments = Object.fromEntries(
|
||||||
|
items.map(item => {
|
||||||
|
const identifier = createIdentifier()
|
||||||
|
return [identifier, {
|
||||||
|
identifier,
|
||||||
|
composition,
|
||||||
|
origin: 'documents',
|
||||||
|
name: item.name,
|
||||||
|
type: item.mimeType || 'application/octet-stream',
|
||||||
|
size: item.size ?? 0,
|
||||||
|
source: item.identifier as EntityIdentifier,
|
||||||
|
} satisfies CompositionAttachmentInterface]
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
const request: CompositionAttachmentAddRequest = {
|
||||||
|
composition,
|
||||||
|
attachments,
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await compositionService.attachmentAdd(request)
|
||||||
|
|
||||||
|
if (!activeDraft.value || response.composition !== activeDraft.value.identifier) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.disposition === 'error') {
|
||||||
|
console.error('[Mail][Composer] Failed to add attachments from documents:', response.error)
|
||||||
|
mailUiStore.notify(`Failed to attach documents: ${response.error?.message || 'Unknown error'}`, 'error')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.values(response.attachments).forEach(attachment => {
|
||||||
|
activeDraft.value!.attachments[attachment.identifier] = {
|
||||||
|
identifier: attachment.identifier,
|
||||||
|
composition: attachment.composition,
|
||||||
|
origin: attachment.origin,
|
||||||
|
name: attachment.name,
|
||||||
|
type: attachment.type,
|
||||||
|
size: attachment.size,
|
||||||
|
source: attachment.source,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response.failed?.length) {
|
||||||
|
mailUiStore.notify(
|
||||||
|
response.failed.length === 1
|
||||||
|
? '1 document could not be attached'
|
||||||
|
: `${response.failed.length} documents could not be attached`,
|
||||||
|
'warning',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function removeAttachment(identifier: string) {
|
async function removeAttachment(identifier: string) {
|
||||||
if (!activeDraft.value) {
|
if (!activeDraft.value) {
|
||||||
return
|
return
|
||||||
@@ -424,17 +485,14 @@ export const useMailCompositionStore = defineStore('mailCompositionStore', () =>
|
|||||||
updateRecipients,
|
updateRecipients,
|
||||||
updateSubject,
|
updateSubject,
|
||||||
updateBody,
|
updateBody,
|
||||||
addAttachments,
|
addAttachmentsFromDevice,
|
||||||
|
addAttachmentsFromDocuments,
|
||||||
removeAttachment,
|
removeAttachment,
|
||||||
flushSave,
|
flushSave,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function buildDraft(
|
function buildDraft(mode: ComposerMode, sender: ComposerSenderIdentity, source?: EntityObject | MessageAddressObject | null): ComposerDraft {
|
||||||
mode: ComposerMode,
|
|
||||||
sender: ComposerSenderIdentity,
|
|
||||||
source?: EntityObject | MessageAddressObject | null,
|
|
||||||
): ComposerDraft {
|
|
||||||
const composition = createIdentifier()
|
const composition = createIdentifier()
|
||||||
const freshMessage = buildMessage(mode, source)
|
const freshMessage = buildMessage(mode, source)
|
||||||
const freshAttachments = buildAttachments(composition, mode, source)
|
const freshAttachments = buildAttachments(composition, mode, source)
|
||||||
@@ -452,10 +510,7 @@ function buildDraft(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildMessage(
|
function buildMessage(mode: ComposerMode, source: EntityObject | MessageAddressObject | null | undefined): ComposerDraftMessage {
|
||||||
mode: ComposerMode,
|
|
||||||
source: EntityObject | MessageAddressObject | null | undefined,
|
|
||||||
): ComposerDraftMessage {
|
|
||||||
|
|
||||||
if (!source) {
|
if (!source) {
|
||||||
return emptyMessage()
|
return emptyMessage()
|
||||||
@@ -521,7 +576,7 @@ function buildAttachments(composition: string, mode: ComposerMode, source?: Enti
|
|||||||
attachments[id] = {
|
attachments[id] = {
|
||||||
identifier: id,
|
identifier: id,
|
||||||
composition: composition,
|
composition: composition,
|
||||||
origin: 'source',
|
origin: 'message',
|
||||||
name: attachment.name || '',
|
name: attachment.name || '',
|
||||||
type: attachment.type || 'application/octet-stream',
|
type: attachment.type || 'application/octet-stream',
|
||||||
size: attachment.size || 0,
|
size: attachment.size || 0,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export enum ComposerMode {
|
|||||||
export interface ComposerDraftAttachment {
|
export interface ComposerDraftAttachment {
|
||||||
identifier: string
|
identifier: string
|
||||||
composition: string
|
composition: string
|
||||||
origin: 'source' | 'upload'
|
origin: 'device' | 'message' | 'documents'
|
||||||
name: string
|
name: string
|
||||||
type: string
|
type: string
|
||||||
size: number
|
size: number
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export interface CompositionMessageInterface {
|
|||||||
export interface CompositionAttachmentInterface {
|
export interface CompositionAttachmentInterface {
|
||||||
identifier: string
|
identifier: string
|
||||||
composition: string
|
composition: string
|
||||||
origin: 'source' | 'upload'
|
origin: 'device' | 'message' | 'documents'
|
||||||
name: string
|
name: string
|
||||||
type: string
|
type: string
|
||||||
size: number
|
size: number
|
||||||
@@ -94,13 +94,17 @@ export interface CompositionAttachmentAddRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface CompositionAttachmentAddResponse {
|
export interface CompositionAttachmentAddResponse {
|
||||||
disposition: 'added' | 'error'
|
disposition: 'added' | 'partial' | 'error'
|
||||||
error?: {
|
error?: {
|
||||||
type: string
|
type: string
|
||||||
message: string
|
message: string
|
||||||
}
|
}
|
||||||
composition: string
|
composition: string
|
||||||
attachments: Record<string, CompositionAttachmentInterface>
|
attachments: Record<string, CompositionAttachmentInterface>
|
||||||
|
failed?: {
|
||||||
|
identifier: string
|
||||||
|
message: string
|
||||||
|
}[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CompositionAttachmentRemoveRequest {
|
export interface CompositionAttachmentRemoveRequest {
|
||||||
|
|||||||
@@ -0,0 +1,242 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace KTXT\Mail\Tests\Unit;
|
||||||
|
|
||||||
|
use KTXC\Module\ModuleManager;
|
||||||
|
use KTXC\Module\ModuleObject;
|
||||||
|
use KTXF\Documents\Entity\EntityBaseInterface;
|
||||||
|
use KTXF\Documents\Entity\EntityPropertiesBaseInterface;
|
||||||
|
use KTXM\Mail\CompositionManager;
|
||||||
|
use KTXM\Mail\Stores\CompositionStore;
|
||||||
|
use PHPUnit\Framework\MockObject\Stub;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
|
// KTXM\MailManager\Manager and KTXM\DocumentsManager\Manager live in sibling
|
||||||
|
// modules. This module's isolated test bootstrap only autoloads its own PSR-4
|
||||||
|
// map plus the server's KTXC/KTXF namespaces (see tests/php/bootstrap.php), so
|
||||||
|
// sibling-module classes are not otherwise resolvable here. Require them
|
||||||
|
// directly so PHPUnit can reflect on the real classes to build mocks; both
|
||||||
|
// files only depend on already-autoloadable KTXC/KTXF types. Skipped
|
||||||
|
// gracefully in setUp() if this module is ever checked out standalone.
|
||||||
|
$mailManagerFile = dirname(__DIR__, 4) . '/mail_manager/lib/Manager.php';
|
||||||
|
$documentsManagerFile = dirname(__DIR__, 4) . '/documents_manager/lib/Manager.php';
|
||||||
|
if (is_file($mailManagerFile)) {
|
||||||
|
require_once $mailManagerFile;
|
||||||
|
}
|
||||||
|
if (is_file($documentsManagerFile)) {
|
||||||
|
require_once $documentsManagerFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
final class CompositionManagerTest extends TestCase {
|
||||||
|
|
||||||
|
private const TENANT_ID = 'tenant-1';
|
||||||
|
private const USER_ID = 'user-1';
|
||||||
|
|
||||||
|
private string $rootDir;
|
||||||
|
private CompositionStore $compositionStore;
|
||||||
|
|
||||||
|
protected function setUp(): void {
|
||||||
|
if (!class_exists(\KTXM\MailManager\Manager::class) || !class_exists(\KTXM\DocumentsManager\Manager::class)) {
|
||||||
|
$this->markTestSkipped('mail_manager and documents_manager modules are not available alongside this checkout');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->rootDir = sys_get_temp_dir() . '/ktrix-mail-composition-test-' . uniqid();
|
||||||
|
mkdir($this->rootDir, 0755, true);
|
||||||
|
$this->compositionStore = new CompositionStore($this->rootDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown(): void {
|
||||||
|
$this->deleteDir($this->rootDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAttachmentAddFromDocumentsHappyPath(): void {
|
||||||
|
$compositionId = $this->stageEmptyComposition();
|
||||||
|
$documentsManager = $this->createStub(\KTXM\DocumentsManager\Manager::class);
|
||||||
|
$documentsManager->method('entityFetchBulk')->willReturn([
|
||||||
|
$this->makeEntity('default:personal:root:doc1', 'hello.txt', 'text/plain'),
|
||||||
|
]);
|
||||||
|
$documentsManager->method('entityReadStream')->willReturn($this->makeStream('hello world'));
|
||||||
|
|
||||||
|
$manager = $this->makeManager($documentsManager);
|
||||||
|
|
||||||
|
$result = $manager->attachmentAdd(self::TENANT_ID, self::USER_ID, $compositionId, [
|
||||||
|
'identifier' => 'attach-1',
|
||||||
|
'origin' => 'documents',
|
||||||
|
'source' => 'default:personal:root:doc1',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertSame('added', $result['disposition']);
|
||||||
|
$this->assertCount(1, $result['attachments']);
|
||||||
|
$this->assertSame([], $result['failed']);
|
||||||
|
|
||||||
|
$attachment = $result['attachments']['attach-1'];
|
||||||
|
$this->assertSame('documents', $attachment['origin']);
|
||||||
|
$this->assertSame('default:personal:root:doc1', $attachment['source']);
|
||||||
|
$this->assertSame('hello.txt', $attachment['name']);
|
||||||
|
$this->assertSame('text/plain', $attachment['type']);
|
||||||
|
$this->assertSame(strlen('hello world'), $attachment['size']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAttachmentAddFromDocumentsPartialFailure(): void {
|
||||||
|
$compositionId = $this->stageEmptyComposition();
|
||||||
|
$documentsManager = $this->createStub(\KTXM\DocumentsManager\Manager::class);
|
||||||
|
// only doc1 is returned even though doc1 and doc2 are both requested
|
||||||
|
$documentsManager->method('entityFetchBulk')->willReturn([
|
||||||
|
$this->makeEntity('default:personal:root:doc1', 'hello.txt', 'text/plain'),
|
||||||
|
]);
|
||||||
|
$documentsManager->method('entityReadStream')->willReturn($this->makeStream('hello world'));
|
||||||
|
|
||||||
|
$manager = $this->makeManager($documentsManager);
|
||||||
|
|
||||||
|
$result = $manager->attachmentAdd(
|
||||||
|
self::TENANT_ID,
|
||||||
|
self::USER_ID,
|
||||||
|
$compositionId,
|
||||||
|
['identifier' => 'attach-1', 'origin' => 'documents', 'source' => 'default:personal:root:doc1'],
|
||||||
|
['identifier' => 'attach-2', 'origin' => 'documents', 'source' => 'default:personal:root:doc2'],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertSame('partial', $result['disposition']);
|
||||||
|
$this->assertCount(1, $result['attachments']);
|
||||||
|
$this->assertCount(1, $result['failed']);
|
||||||
|
$this->assertSame('default:personal:root:doc2', $result['failed'][0]['identifier']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAttachmentAddMixedUploadAndDocuments(): void {
|
||||||
|
$compositionId = $this->stageEmptyComposition();
|
||||||
|
$documentsManager = $this->createStub(\KTXM\DocumentsManager\Manager::class);
|
||||||
|
$documentsManager->method('entityFetchBulk')->willReturn([
|
||||||
|
$this->makeEntity('default:personal:root:doc1', 'hello.txt', 'text/plain'),
|
||||||
|
]);
|
||||||
|
$documentsManager->method('entityReadStream')->willReturn($this->makeStream('hello world'));
|
||||||
|
|
||||||
|
$manager = $this->makeManager($documentsManager);
|
||||||
|
|
||||||
|
$result = $manager->attachmentAdd(
|
||||||
|
self::TENANT_ID,
|
||||||
|
self::USER_ID,
|
||||||
|
$compositionId,
|
||||||
|
['identifier' => 'attach-upload', 'origin' => 'device', 'name' => 'upload.txt', 'type' => 'text/plain', 'data' => base64_encode('uploaded bytes')],
|
||||||
|
['identifier' => 'attach-doc', 'origin' => 'documents', 'source' => 'default:personal:root:doc1'],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertSame('added', $result['disposition']);
|
||||||
|
$this->assertCount(2, $result['attachments']);
|
||||||
|
$this->assertSame('device', $result['attachments']['attach-upload']['origin']);
|
||||||
|
$this->assertSame('documents', $result['attachments']['attach-doc']['origin']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAttachmentAddCompositionNotFound(): void {
|
||||||
|
$documentsManager = $this->createStub(\KTXM\DocumentsManager\Manager::class);
|
||||||
|
$manager = $this->makeManager($documentsManager);
|
||||||
|
|
||||||
|
$result = $manager->attachmentAdd(self::TENANT_ID, self::USER_ID, 'unknown-composition', [
|
||||||
|
'identifier' => 'attach-1',
|
||||||
|
'origin' => 'documents',
|
||||||
|
'source' => 'default:personal:root:doc1',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertSame('error', $result['disposition']);
|
||||||
|
$this->assertSame('composition_not_found', $result['error']['type']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAttachmentAddDocumentsModuleUnavailable(): void {
|
||||||
|
$compositionId = $this->stageEmptyComposition();
|
||||||
|
$documentsManager = $this->createStub(\KTXM\DocumentsManager\Manager::class);
|
||||||
|
// documents_manager is not installed/enabled: attachmentAdd must still
|
||||||
|
// work for the composition itself, just report the sourced entry as failed
|
||||||
|
// rather than throwing (e.g. from a failed DI resolution).
|
||||||
|
$manager = $this->makeManager($documentsManager, documentsModuleEnabled: false);
|
||||||
|
|
||||||
|
$result = $manager->attachmentAdd(self::TENANT_ID, self::USER_ID, $compositionId, [
|
||||||
|
'identifier' => 'attach-1',
|
||||||
|
'origin' => 'documents',
|
||||||
|
'source' => 'default:personal:root:doc1',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertSame('error', $result['disposition']);
|
||||||
|
$this->assertCount(0, $result['attachments']);
|
||||||
|
$this->assertCount(1, $result['failed']);
|
||||||
|
$this->assertSame('default:personal:root:doc1', $result['failed'][0]['identifier']);
|
||||||
|
$this->assertStringContainsString('not installed or enabled', $result['failed'][0]['message']);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function makeManager(Stub $documentsManager, bool $documentsModuleEnabled = true): CompositionManager {
|
||||||
|
$mailManager = $this->createStub(\KTXM\MailManager\Manager::class);
|
||||||
|
|
||||||
|
$moduleManager = $this->createStub(ModuleManager::class);
|
||||||
|
if ($documentsModuleEnabled) {
|
||||||
|
$module = $this->createStub(ModuleObject::class);
|
||||||
|
$module->method('enabled')->willReturn(true);
|
||||||
|
$moduleManager->method('fetch')->willReturn($module);
|
||||||
|
} else {
|
||||||
|
$moduleManager->method('fetch')->willReturn(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
$container = $this->createStub(ContainerInterface::class);
|
||||||
|
$container->method('has')->willReturn($documentsModuleEnabled);
|
||||||
|
$container->method('get')->willReturn($documentsManager);
|
||||||
|
|
||||||
|
return new CompositionManager(
|
||||||
|
container: $container,
|
||||||
|
moduleManager: $moduleManager,
|
||||||
|
compositionStore: $this->compositionStore,
|
||||||
|
mailManager: $mailManager,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function stageEmptyComposition(): string {
|
||||||
|
$compositionId = 'draft-' . uniqid();
|
||||||
|
$this->compositionStore->compositionSave(self::TENANT_ID, self::USER_ID, $compositionId, [
|
||||||
|
'identifier' => $compositionId,
|
||||||
|
'attachments' => [],
|
||||||
|
]);
|
||||||
|
return $compositionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function makeEntity(string $urn, string $label, string $mime): EntityBaseInterface&Stub {
|
||||||
|
$properties = $this->createStub(EntityPropertiesBaseInterface::class);
|
||||||
|
$properties->method('getLabel')->willReturn($label);
|
||||||
|
$properties->method('getMime')->willReturn($mime);
|
||||||
|
$properties->method('size')->willReturn(0);
|
||||||
|
|
||||||
|
$entity = $this->createStub(EntityBaseInterface::class);
|
||||||
|
$entity->method('urn')->willReturn($urn);
|
||||||
|
$entity->method('getProperties')->willReturn($properties);
|
||||||
|
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return resource */
|
||||||
|
private function makeStream(string $contents) {
|
||||||
|
$resource = fopen('php://memory', 'r+');
|
||||||
|
fwrite($resource, $contents);
|
||||||
|
rewind($resource);
|
||||||
|
return $resource;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function deleteDir(string $path): void {
|
||||||
|
if (!is_dir($path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (scandir($path) ?: [] as $entry) {
|
||||||
|
if ($entry === '.' || $entry === '..') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$child = $path . '/' . $entry;
|
||||||
|
if (is_dir($child)) {
|
||||||
|
$this->deleteDir($child);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink($child);
|
||||||
|
}
|
||||||
|
|
||||||
|
rmdir($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user