@streamoid/settings 0.15.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1273,7 +1273,7 @@ interface SettingsAdapters {
1273
1273
  * Ordered as the dialog renders them. Exported because a host has to be able to
1274
1274
  * name them in `hiddenApps` — see InviteUpdateModal.
1275
1275
  */
1276
- declare const APP_KEYS: readonly ["artifax", "photogenix", "returns", "catalogix"];
1276
+ declare const APP_KEYS: readonly ["artifax", "tactix", "photogenix", "returns", "catalogix"];
1277
1277
  type AppKey = (typeof APP_KEYS)[number];
1278
1278
  interface UserPermissions {
1279
1279
  artifax: boolean;
@@ -1288,6 +1288,13 @@ interface UserPermissions {
1288
1288
  * group, which is what `permissionServiceIds` does.
1289
1289
  */
1290
1290
  returns: boolean;
1291
+ /**
1292
+ * Tactix. Its services are named "tactix" in a "Tactix" group.
1293
+ *
1294
+ * Optional only so hosts that build a UserPermissions by hand keep compiling;
1295
+ * absent reads as "not granted".
1296
+ */
1297
+ tactix?: boolean;
1291
1298
  canUseCredits: boolean;
1292
1299
  canInviteUser: boolean;
1293
1300
  role: "admin" | "member";
@@ -1309,6 +1316,18 @@ interface TeamMember {
1309
1316
  permissions: UserPermissions;
1310
1317
  }
1311
1318
  declare const DEFAULT_PERMISSIONS: UserPermissions;
1319
+ /**
1320
+ * Split the invite dialog's email field into addresses.
1321
+ *
1322
+ * The field takes several addresses separated by commas, semicolons, spaces or
1323
+ * new lines (a column pasted from a spreadsheet). Addresses are
1324
+ * lower-cased and de-duplicated. Anything that is not a plausible address
1325
+ * comes back in `invalid`, in the order typed, so the dialog can name it.
1326
+ */
1327
+ declare function parseInviteEmails(input: string): {
1328
+ emails: string[];
1329
+ invalid: string[];
1330
+ };
1312
1331
 
1313
1332
  type WorkspaceInfo = SettingsWorkspaceListItem & {
1314
1333
  initials?: string;
@@ -2175,10 +2194,24 @@ interface InviteUpdateModalProps {
2175
2194
  * members only. Defaults to true.
2176
2195
  */
2177
2196
  allowAdminRole?: boolean;
2178
- /** Called only in invite mode; receives (permissions, email, standing) */
2197
+ /**
2198
+ * Invite mode, preferred over `onInvite`: receives every address typed in
2199
+ * the field (comma, semicolon, space or newline separated), lower-cased and
2200
+ * de-duplicated. Resolve to `{ failed }` with the addresses that were not
2201
+ * invited; the dialog keeps just those in its field so they can be fixed.
2202
+ * While the promise is pending the submit button is disabled.
2203
+ */
2204
+ onInviteMany?: (permissions: UserPermissions, emails: string[], organizationStanding?: OrganizationStanding) => Promise<{
2205
+ failed: string[];
2206
+ } | void> | void;
2207
+ /**
2208
+ * Called only in invite mode; receives (permissions, email, standing).
2209
+ * Kept for hosts that predate `onInviteMany`: without it, a list of
2210
+ * addresses is delivered as one call per address.
2211
+ */
2179
2212
  onInvite?: (permissions: UserPermissions, email: string, organizationStanding?: OrganizationStanding) => void;
2180
2213
  }
2181
- declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
2214
+ declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, onInviteMany, }: InviteUpdateModalProps): react.JSX.Element | null;
2182
2215
 
2183
2216
  interface ExportDateModalProps {
2184
2217
  title: string;
@@ -2674,4 +2707,4 @@ interface AppSettingsRowProps {
2674
2707
  }
2675
2708
  declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
2676
2709
 
2677
- export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
2710
+ export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
package/dist/index.d.ts CHANGED
@@ -1273,7 +1273,7 @@ interface SettingsAdapters {
1273
1273
  * Ordered as the dialog renders them. Exported because a host has to be able to
1274
1274
  * name them in `hiddenApps` — see InviteUpdateModal.
1275
1275
  */
1276
- declare const APP_KEYS: readonly ["artifax", "photogenix", "returns", "catalogix"];
1276
+ declare const APP_KEYS: readonly ["artifax", "tactix", "photogenix", "returns", "catalogix"];
1277
1277
  type AppKey = (typeof APP_KEYS)[number];
1278
1278
  interface UserPermissions {
1279
1279
  artifax: boolean;
@@ -1288,6 +1288,13 @@ interface UserPermissions {
1288
1288
  * group, which is what `permissionServiceIds` does.
1289
1289
  */
1290
1290
  returns: boolean;
1291
+ /**
1292
+ * Tactix. Its services are named "tactix" in a "Tactix" group.
1293
+ *
1294
+ * Optional only so hosts that build a UserPermissions by hand keep compiling;
1295
+ * absent reads as "not granted".
1296
+ */
1297
+ tactix?: boolean;
1291
1298
  canUseCredits: boolean;
1292
1299
  canInviteUser: boolean;
1293
1300
  role: "admin" | "member";
@@ -1309,6 +1316,18 @@ interface TeamMember {
1309
1316
  permissions: UserPermissions;
1310
1317
  }
1311
1318
  declare const DEFAULT_PERMISSIONS: UserPermissions;
1319
+ /**
1320
+ * Split the invite dialog's email field into addresses.
1321
+ *
1322
+ * The field takes several addresses separated by commas, semicolons, spaces or
1323
+ * new lines (a column pasted from a spreadsheet). Addresses are
1324
+ * lower-cased and de-duplicated. Anything that is not a plausible address
1325
+ * comes back in `invalid`, in the order typed, so the dialog can name it.
1326
+ */
1327
+ declare function parseInviteEmails(input: string): {
1328
+ emails: string[];
1329
+ invalid: string[];
1330
+ };
1312
1331
 
1313
1332
  type WorkspaceInfo = SettingsWorkspaceListItem & {
1314
1333
  initials?: string;
@@ -2175,10 +2194,24 @@ interface InviteUpdateModalProps {
2175
2194
  * members only. Defaults to true.
2176
2195
  */
2177
2196
  allowAdminRole?: boolean;
2178
- /** Called only in invite mode; receives (permissions, email, standing) */
2197
+ /**
2198
+ * Invite mode, preferred over `onInvite`: receives every address typed in
2199
+ * the field (comma, semicolon, space or newline separated), lower-cased and
2200
+ * de-duplicated. Resolve to `{ failed }` with the addresses that were not
2201
+ * invited; the dialog keeps just those in its field so they can be fixed.
2202
+ * While the promise is pending the submit button is disabled.
2203
+ */
2204
+ onInviteMany?: (permissions: UserPermissions, emails: string[], organizationStanding?: OrganizationStanding) => Promise<{
2205
+ failed: string[];
2206
+ } | void> | void;
2207
+ /**
2208
+ * Called only in invite mode; receives (permissions, email, standing).
2209
+ * Kept for hosts that predate `onInviteMany`: without it, a list of
2210
+ * addresses is delivered as one call per address.
2211
+ */
2179
2212
  onInvite?: (permissions: UserPermissions, email: string, organizationStanding?: OrganizationStanding) => void;
2180
2213
  }
2181
- declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, }: InviteUpdateModalProps): react.JSX.Element | null;
2214
+ declare function InviteUpdateModal({ open, mode, userEmail, stores, hiddenApps, allowSubmitWithoutChanges, initialPermissions, onClose, onSave, onRemove, canRemove, showOrganizationStanding, organizationName, allowGuestStanding, initialOrganizationStanding, organizationDomain: _organizationDomain, allowAdminRole, onInvite, onInviteMany, }: InviteUpdateModalProps): react.JSX.Element | null;
2182
2215
 
2183
2216
  interface ExportDateModalProps {
2184
2217
  title: string;
@@ -2674,4 +2707,4 @@ interface AppSettingsRowProps {
2674
2707
  }
2675
2708
  declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
2676
2709
 
2677
- export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
2710
+ export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, InviteUpdateModal, type InvoicePdfResponse, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralTab, RemovePoolMemberModal, type RemovePoolMemberModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, canShowSharedCredits, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolWorkspaceName, productsForCountry, readSettingsCaller, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sponsoredCreditsText, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
package/dist/index.js CHANGED
@@ -122,6 +122,7 @@ __export(index_exports, {
122
122
  minimumCreditLimit: () => minimumCreditLimit,
123
123
  ownCreditsFirstText: () => ownCreditsFirstText,
124
124
  parseBillingEntitlement: () => parseBillingEntitlement,
125
+ parseInviteEmails: () => parseInviteEmails,
125
126
  pausedOwnCreditsText: () => pausedOwnCreditsText,
126
127
  poolEndsAtFrom: () => poolEndsAtFrom,
127
128
  poolErrorMessage: () => poolErrorMessage,
@@ -3118,7 +3119,8 @@ var APP_ACCESS_MARKS = {
3118
3119
  "artifax": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M6%2029L15%207H21L30%2029H25.7L23.5%2023H12.5L10.3%2029ZM14%2019H22L18%209Z%22%2F%3E%3C%2Fsvg%3E%0A",
3119
3120
  "photogenix": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%2029V7H20C25%207%2028%2010%2028%2014.5S25%2022%2020%2022H14V29ZM14%2011V18H20C22.7%2018%2024%2017%2024%2014.5S22.7%2011%2020%2011Z%22%2F%3E%3C%2Fsvg%3E%0A",
3120
3121
  "catalogix": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M30%2012L26.5%2014C24.8%2011.5%2022.3%2010%2018.5%2010C12.7%2010%209%2013%209%2018S12.7%2026%2018.5%2026C22.3%2026%2024.8%2024.5%2026.5%2022L30%2024C27.7%2028%2023.7%2030%2018.5%2030C10.5%2030%205%2025.3%205%2018S10.5%206%2018.5%206C23.7%206%2027.7%208%2030%2012Z%22%2F%3E%3C%2Fsvg%3E%0A",
3121
- "returns": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20transform%3D%22translate%288.034%207%29%20scale%280.782%29%22%20d%3D%22M4.536%2028.14H0V0H14.616C21%200%2024.948%203.024%2024.948%208.274C24.948%2012.936%2021.882%2015.792%2016.59%2016.086V16.38C18.774%2016.968%2019.782%2018.228%2020.79%2019.992L25.494%2028.14H20.286L15.792%2020.37C14.532%2018.144%2013.23%2017.22%209.702%2017.22H4.536V28.14ZM4.536%204.074V13.734H14.574C18.354%2013.734%2020.244%2012.432%2020.244%208.904C20.244%205.46%2018.354%204.074%2014.574%204.074H4.536Z%22%2F%3E%3C%2Fsvg%3E%0A"
3122
+ "returns": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20transform%3D%22translate%288.034%207%29%20scale%280.782%29%22%20d%3D%22M4.536%2028.14H0V0H14.616C21%200%2024.948%203.024%2024.948%208.274C24.948%2012.936%2021.882%2015.792%2016.59%2016.086V16.38C18.774%2016.968%2019.782%2018.228%2020.79%2019.992L25.494%2028.14H20.286L15.792%2020.37C14.532%2018.144%2013.23%2017.22%209.702%2017.22H4.536V28.14ZM4.536%204.074V13.734H14.574C18.354%2013.734%2020.244%2012.432%2020.244%208.904C20.244%205.46%2018.354%204.074%2014.574%204.074H4.536Z%22%2F%3E%3C%2Fsvg%3E%0A",
3123
+ "tactix": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M5%207H31V11H20V29H16V11H5Z%22%2F%3E%3C%2Fsvg%3E%0A"
3122
3124
  };
3123
3125
 
3124
3126
  // src/teams-content.tsx
@@ -3149,6 +3151,7 @@ var svg_rodctpja6f_default = {
3149
3151
  // src/team-types.ts
3150
3152
  var APP_KEYS = [
3151
3153
  "artifax",
3154
+ "tactix",
3152
3155
  "photogenix",
3153
3156
  "returns",
3154
3157
  "catalogix"
@@ -3158,11 +3161,27 @@ var DEFAULT_PERMISSIONS = {
3158
3161
  photogenix: true,
3159
3162
  catalogix: true,
3160
3163
  returns: true,
3164
+ tactix: true,
3161
3165
  canUseCredits: true,
3162
3166
  canInviteUser: true,
3163
3167
  role: "admin",
3164
3168
  catalogixStores: []
3165
3169
  };
3170
+ function parseInviteEmails(input) {
3171
+ const emails = [];
3172
+ const invalid = [];
3173
+ for (const raw of input.split(/[\s,;]+/)) {
3174
+ const token = raw.trim();
3175
+ if (!token) continue;
3176
+ if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(token)) {
3177
+ const email = token.toLowerCase();
3178
+ if (!emails.includes(email)) emails.push(email);
3179
+ } else if (!invalid.includes(token)) {
3180
+ invalid.push(token);
3181
+ }
3182
+ }
3183
+ return { emails, invalid };
3184
+ }
3166
3185
 
3167
3186
  // src/invite-update-modal.tsx
3168
3187
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -3283,7 +3302,8 @@ function InviteUpdateModal({
3283
3302
  initialOrganizationStanding = "guest",
3284
3303
  organizationDomain: _organizationDomain,
3285
3304
  allowAdminRole = true,
3286
- onInvite
3305
+ onInvite,
3306
+ onInviteMany
3287
3307
  }) {
3288
3308
  useOverlayOpen(open, onClose);
3289
3309
  const [emailValue, setEmailValue] = (0, import_react9.useState)("");
@@ -3302,6 +3322,8 @@ function InviteUpdateModal({
3302
3322
  !hiddenApps.includes("catalogix")
3303
3323
  );
3304
3324
  const [returnsOn, setReturnsOn] = (0, import_react9.useState)(!hiddenApps.includes("returns"));
3325
+ const [tactixOn, setTactixOn] = (0, import_react9.useState)(!hiddenApps.includes("tactix"));
3326
+ const [submitting, setSubmitting] = (0, import_react9.useState)(false);
3305
3327
  const [storeSearch, setStoreSearch] = (0, import_react9.useState)("");
3306
3328
  const [selectedStores, setSelectedStores] = (0, import_react9.useState)(/* @__PURE__ */ new Set());
3307
3329
  const filteredStores = stores.filter(
@@ -3320,6 +3342,7 @@ function InviteUpdateModal({
3320
3342
  );
3321
3343
  setCatalogixOn(!hidden.has("catalogix") && initialPermissions.catalogix);
3322
3344
  setReturnsOn(!hidden.has("returns") && initialPermissions.returns);
3345
+ setTactixOn(!hidden.has("tactix") && Boolean(initialPermissions.tactix));
3323
3346
  setSelectedStores(
3324
3347
  new Set(hidden.has("catalogix") ? [] : initialPermissions.catalogixStores)
3325
3348
  );
@@ -3335,6 +3358,8 @@ function InviteUpdateModal({
3335
3358
  setPhotogenixOn(!hidden.has("photogenix"));
3336
3359
  setCatalogixOn(!hidden.has("catalogix"));
3337
3360
  setReturnsOn(!hidden.has("returns"));
3361
+ setTactixOn(!hidden.has("tactix"));
3362
+ setSubmitting(false);
3338
3363
  setStoreSearch("");
3339
3364
  setSelectedStores(/* @__PURE__ */ new Set());
3340
3365
  }
@@ -3342,7 +3367,8 @@ function InviteUpdateModal({
3342
3367
  const adminLocked = mode === "invite" && !allowAdminRole;
3343
3368
  if (!open) return null;
3344
3369
  const isInvite = mode === "invite";
3345
- const hasEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailValue.trim());
3370
+ const parsedEmails = parseInviteEmails(emailValue);
3371
+ const hasEmail = parsedEmails.emails.length > 0 && parsedEmails.invalid.length === 0;
3346
3372
  function markChanged() {
3347
3373
  setHasChanges(true);
3348
3374
  }
@@ -3352,12 +3378,13 @@ function InviteUpdateModal({
3352
3378
  artifax: artifaxOn,
3353
3379
  photogenix: photogenixOn,
3354
3380
  returns: returnsOn,
3355
- catalogix: catalogixOn
3381
+ catalogix: catalogixOn,
3382
+ tactix: tactixOn
3356
3383
  };
3357
3384
  const notLastShown = (key) => shownApps[shownApps.length - 1] !== key;
3358
3385
  const appValue = (key) => role === "admin" || showsApp(key) ? appToggles[key] : false;
3359
3386
  const grantsNoApp = role === "member" && shownApps.length > 0 && !shownApps.some((key) => appToggles[key]);
3360
- const isSubmitDisabled = isInvite ? !hasEmail || grantsNoApp : !(allowSubmitWithoutChanges || hasChanges);
3387
+ const isSubmitDisabled = isInvite ? !hasEmail || grantsNoApp || submitting : !(allowSubmitWithoutChanges || hasChanges);
3361
3388
  function toggleStore(storeId) {
3362
3389
  setSelectedStores((prev) => {
3363
3390
  const next = new Set(prev);
@@ -3463,6 +3490,7 @@ function InviteUpdateModal({
3463
3490
  color: T6.primary
3464
3491
  },
3465
3492
  placeholder: "email@domain.in, email@domain.in, email@domain.in...",
3493
+ "aria-invalid": parsedEmails.invalid.length > 0,
3466
3494
  value: emailValue,
3467
3495
  onChange: (e) => setEmailValue(e.target.value)
3468
3496
  }
@@ -3484,6 +3512,20 @@ function InviteUpdateModal({
3484
3512
  }
3485
3513
  ) })
3486
3514
  }
3515
+ ),
3516
+ isInvite && parsedEmails.invalid.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3517
+ "span",
3518
+ {
3519
+ role: "alert",
3520
+ style: {
3521
+ fontFamily: T6.font,
3522
+ fontSize: T6.fsXs,
3523
+ fontWeight: 400,
3524
+ lineHeight: T6.lhXs,
3525
+ color: "var(--alias-text---icons-error)"
3526
+ },
3527
+ children: parsedEmails.invalid.length === 1 ? `Not a valid email: ${parsedEmails.invalid[0]}` : `Not valid emails: ${parsedEmails.invalid.join(", ")}`
3528
+ }
3487
3529
  )
3488
3530
  ]
3489
3531
  }
@@ -3918,6 +3960,101 @@ function InviteUpdateModal({
3918
3960
  }
3919
3961
  ) })
3920
3962
  ] }) }),
3963
+ showsApp("tactix") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "shrink-0 w-full relative", children: [
3964
+ notLastShown("tactix") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3965
+ "div",
3966
+ {
3967
+ "aria-hidden": true,
3968
+ className: "absolute inset-0 pointer-events-none",
3969
+ style: {
3970
+ borderBottom: `1px solid ${T6.borderSubtle}`
3971
+ }
3972
+ }
3973
+ ),
3974
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3975
+ "div",
3976
+ {
3977
+ className: "flex items-center w-full",
3978
+ style: { padding: T6.sp3xl, gap: T6.spMd },
3979
+ children: [
3980
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
3981
+ "div",
3982
+ {
3983
+ className: "flex flex-1 min-w-0 items-center",
3984
+ style: { gap: T6.spXl },
3985
+ children: [
3986
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3987
+ "div",
3988
+ {
3989
+ className: "shrink-0 flex items-center",
3990
+ style: {
3991
+ background: T6.fillHover,
3992
+ borderRadius: T6.rXl,
3993
+ padding: T6.spMd
3994
+ },
3995
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3996
+ import_icons5.SiconChartBar,
3997
+ {
3998
+ className: "w-6 h-6",
3999
+ color: T6.primary
4000
+ }
4001
+ )
4002
+ }
4003
+ ),
4004
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4005
+ "div",
4006
+ {
4007
+ className: "flex flex-1 min-w-0 flex-col items-start overflow-hidden text-ellipsis whitespace-nowrap",
4008
+ style: { opacity: tactixOn ? 1 : 0.5 },
4009
+ children: [
4010
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4011
+ "p",
4012
+ {
4013
+ className: "w-full overflow-hidden shrink-0",
4014
+ style: {
4015
+ fontFamily: T6.font,
4016
+ fontSize: T6.fsSm,
4017
+ fontWeight: 500,
4018
+ lineHeight: T6.lhSm,
4019
+ color: T6.primary
4020
+ },
4021
+ children: "Tactix"
4022
+ }
4023
+ ),
4024
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4025
+ "p",
4026
+ {
4027
+ className: "w-full overflow-hidden shrink-0",
4028
+ style: {
4029
+ fontFamily: T6.font,
4030
+ fontSize: T6.fsXs,
4031
+ fontWeight: 400,
4032
+ lineHeight: T6.lhXs,
4033
+ color: T6.tertiary
4034
+ },
4035
+ children: "Buying and planning"
4036
+ }
4037
+ )
4038
+ ]
4039
+ }
4040
+ )
4041
+ ]
4042
+ }
4043
+ ),
4044
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4045
+ ToggleSwitch,
4046
+ {
4047
+ active: tactixOn,
4048
+ onClick: () => {
4049
+ setTactixOn(!tactixOn);
4050
+ markChanged();
4051
+ }
4052
+ }
4053
+ )
4054
+ ]
4055
+ }
4056
+ ) })
4057
+ ] }) }),
3921
4058
  showsApp("photogenix") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "shrink-0 w-full relative", children: [
3922
4059
  notLastShown("photogenix") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3923
4060
  "div",
@@ -4432,18 +4569,27 @@ function InviteUpdateModal({
4432
4569
  photogenix: appValue("photogenix"),
4433
4570
  catalogix: appValue("catalogix"),
4434
4571
  returns: appValue("returns"),
4572
+ tactix: appValue("tactix"),
4435
4573
  // Stores ride on Catalogix, so they follow it: a
4436
4574
  // hidden Catalogix grants no app and therefore no
4437
4575
  // storefronts. Keeping them would leave a member
4438
4576
  // scoped to stores in a product they cannot open.
4439
4577
  catalogixStores: role === "admin" || showsApp("catalogix") ? Array.from(selectedStores) : []
4440
4578
  };
4441
- if (isInvite && onInvite) {
4442
- onInvite(
4443
- perms,
4444
- emailValue.trim(),
4445
- showOrganizationStanding ? orgStanding : void 0
4446
- );
4579
+ const standing = showOrganizationStanding ? orgStanding : void 0;
4580
+ if (isInvite && onInviteMany) {
4581
+ setSubmitting(true);
4582
+ Promise.resolve(
4583
+ onInviteMany(perms, parsedEmails.emails, standing)
4584
+ ).then((result) => {
4585
+ if (result && result.failed.length > 0) {
4586
+ setEmailValue(result.failed.join(", "));
4587
+ }
4588
+ }).finally(() => setSubmitting(false));
4589
+ } else if (isInvite && onInvite) {
4590
+ for (const email of parsedEmails.emails) {
4591
+ onInvite(perms, email, standing);
4592
+ }
4447
4593
  } else if (onSave) {
4448
4594
  onSave(perms);
4449
4595
  }
@@ -4678,6 +4824,7 @@ function appNameTokens(app) {
4678
4824
  return ["artifax", "artifact", "artifacts", "artifex", "chat"];
4679
4825
  if (app === "photogenix") return ["photogenix"];
4680
4826
  if (app === "returns") return ["returns", "return"];
4827
+ if (app === "tactix") return ["tactix"];
4681
4828
  return ["catalogix"];
4682
4829
  }
4683
4830
  function normalizeServiceName(value) {
@@ -4706,6 +4853,7 @@ function permissionServiceIds(services, permissions) {
4706
4853
  if (serviceMatchesApp(s, "catalogix") && permissions.catalogix)
4707
4854
  return true;
4708
4855
  if (serviceMatchesApp(s, "returns") && permissions.returns) return true;
4856
+ if (serviceMatchesApp(s, "tactix") && permissions.tactix) return true;
4709
4857
  return false;
4710
4858
  }).map((s) => s._id);
4711
4859
  }
@@ -4818,7 +4966,8 @@ function readInviteAppFlag(invRecord, app) {
4818
4966
  ],
4819
4967
  photogenix: ["photogenix", "photogenixAccess"],
4820
4968
  catalogix: ["catalogix", "catalogixAccess"],
4821
- returns: ["returns", "return", "returnsAccess"]
4969
+ returns: ["returns", "return", "returnsAccess"],
4970
+ tactix: ["tactix", "tactixAccess"]
4822
4971
  };
4823
4972
  const containers = [invRecord];
4824
4973
  for (const nestedKey of ["permissions", "permission", "access", "apps"]) {
@@ -4893,6 +5042,7 @@ function memberToTeamMember(m, services) {
4893
5042
  const hasPhotogenix = isAdmin || userHasApp("photogenix");
4894
5043
  const hasCatalogix = isAdmin || userHasApp("catalogix");
4895
5044
  const hasReturns = isAdmin || userHasApp("returns");
5045
+ const hasTactix = isAdmin || userHasApp("tactix");
4896
5046
  return {
4897
5047
  id: m._id,
4898
5048
  kind: "member",
@@ -4919,6 +5069,7 @@ function memberToTeamMember(m, services) {
4919
5069
  photogenix: hasPhotogenix,
4920
5070
  catalogix: hasCatalogix,
4921
5071
  returns: hasReturns,
5072
+ tactix: hasTactix,
4922
5073
  canUseCredits: m.creditAccess,
4923
5074
  canInviteUser: m.inviteAccess,
4924
5075
  role: m.role,
@@ -4937,14 +5088,17 @@ function inviteToTeamMember(inv, services) {
4937
5088
  );
4938
5089
  const derivedCatalogix = serviceNames.some((n) => matchesApp(n, "catalogix"));
4939
5090
  const derivedReturns = serviceNames.some((n) => matchesApp(n, "returns"));
5091
+ const derivedTactix = serviceNames.some((n) => matchesApp(n, "tactix"));
4940
5092
  const explicitArtifax = readInviteAppFlag(invRecord, "artifax");
4941
5093
  const explicitPhotogenix = readInviteAppFlag(invRecord, "photogenix");
4942
5094
  const explicitCatalogix = readInviteAppFlag(invRecord, "catalogix");
4943
5095
  const explicitReturns = readInviteAppFlag(invRecord, "returns");
5096
+ const explicitTactix = readInviteAppFlag(invRecord, "tactix");
4944
5097
  const artifaxFlag = Boolean(explicitArtifax) || derivedArtifax;
4945
5098
  const photogenixFlag = Boolean(explicitPhotogenix) || derivedPhotogenix;
4946
5099
  const catalogixFlag = Boolean(explicitCatalogix) || derivedCatalogix;
4947
5100
  const returnsFlag = Boolean(explicitReturns) || derivedReturns;
5101
+ const tactixFlag = Boolean(explicitTactix) || derivedTactix;
4948
5102
  const catalogixStores = uniqueNonEmpty([
4949
5103
  ...extractIdsFromMixedArray(invRecord.stores),
4950
5104
  ...extractIdsFromMixedArray(invRecord.storeIds)
@@ -4961,6 +5115,7 @@ function inviteToTeamMember(inv, services) {
4961
5115
  photogenix: photogenixFlag,
4962
5116
  catalogix: catalogixFlag,
4963
5117
  returns: returnsFlag,
5118
+ tactix: tactixFlag,
4964
5119
  canUseCredits: inv.creditAccess ?? false,
4965
5120
  canInviteUser: inv.inviteAccess ?? false,
4966
5121
  role: inv.role ?? "member",
@@ -4969,7 +5124,7 @@ function inviteToTeamMember(inv, services) {
4969
5124
  };
4970
5125
  }
4971
5126
  function AccessIcons({ permissions }) {
4972
- const apps = ["artifax", "photogenix", "catalogix", "returns"];
5127
+ const apps = ["artifax", "tactix", "photogenix", "catalogix", "returns"];
4973
5128
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center shrink-0", style: { gap: 6 }, children: apps.filter((app) => permissions[app]).map((app) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
4974
5129
  "img",
4975
5130
  {
@@ -5492,34 +5647,50 @@ function TeamsContent({
5492
5647
  toast.error(msg);
5493
5648
  }
5494
5649
  };
5495
- const handleInvite = async (permissions, email, organizationStanding) => {
5650
+ const handleInviteMany = async (permissions, emails, organizationStanding) => {
5496
5651
  if (!viewerCanInvite || permissions.role === "admin" && highestRole !== "admin") {
5497
5652
  toast.error("You do not have permission to invite users");
5498
5653
  closeModal();
5499
- return;
5654
+ return { failed: [] };
5500
5655
  }
5501
5656
  const serviceIds = permissions.role === "admin" ? [] : permissionServiceIds(allServices, permissions);
5502
- try {
5503
- await api.inviteMember({
5504
- email,
5505
- creditAccess: permissions.canUseCredits,
5506
- inviteAccess: permissions.canInviteUser,
5507
- role: permissions.role,
5508
- serviceIds,
5509
- storeIds: permissions.catalogixStores || [],
5510
- // Omitted when the control was never shown, which leaves the backend
5511
- // deriving the standing from the invitee's email domain as before.
5512
- ...organizationStanding ? {
5513
- organizationRole: organizationStanding === "colleague" ? "member" : "guest"
5514
- } : {}
5515
- });
5516
- toast.success(`Invitation sent to ${email}`);
5517
- await fetchData();
5518
- closeModal();
5519
- } catch (err) {
5520
- const msg = errorMessage(err, { method: "POST" });
5521
- toast.error(msg);
5657
+ const sent = [];
5658
+ const failed = [];
5659
+ for (const email of emails) {
5660
+ try {
5661
+ await api.inviteMember({
5662
+ email,
5663
+ creditAccess: permissions.canUseCredits,
5664
+ inviteAccess: permissions.canInviteUser,
5665
+ role: permissions.role,
5666
+ serviceIds,
5667
+ storeIds: permissions.catalogixStores || [],
5668
+ // Omitted when the control was never shown, which leaves the backend
5669
+ // deriving the standing from the invitee's email domain as before.
5670
+ ...organizationStanding ? {
5671
+ organizationRole: organizationStanding === "colleague" ? "member" : "guest"
5672
+ } : {}
5673
+ });
5674
+ sent.push(email);
5675
+ } catch (err) {
5676
+ failed.push({ email, message: errorMessage(err, { method: "POST" }) });
5677
+ }
5678
+ }
5679
+ if (sent.length === 1) toast.success(`Invitation sent to ${sent[0]}`);
5680
+ else if (sent.length > 1)
5681
+ toast.success(`Invitations sent to ${sent.length} people`);
5682
+ if (failed.length === 1) {
5683
+ toast.error(
5684
+ emails.length === 1 ? failed[0].message : `${failed[0].email}: ${failed[0].message}`
5685
+ );
5686
+ } else if (failed.length > 1) {
5687
+ toast.error(
5688
+ `${failed.length} invitations were not sent. ${failed[0].email}: ${failed[0].message}`
5689
+ );
5522
5690
  }
5691
+ if (sent.length > 0) await fetchData();
5692
+ if (failed.length === 0) closeModal();
5693
+ return { failed: failed.map((f) => f.email) };
5523
5694
  };
5524
5695
  const filteredActive = activeMembers.filter((m) => {
5525
5696
  const q = searchQuery.toLowerCase();
@@ -5637,7 +5808,7 @@ function TeamsContent({
5637
5808
  showOrganizationStanding: mayGrantOrgMembership,
5638
5809
  organizationName: organizationName ?? orgCurrent?.name,
5639
5810
  organizationDomain: workspaceOrgId && orgCurrent?.id === workspaceOrgId ? orgCurrent?.domain : void 0,
5640
- onInvite: handleInvite
5811
+ onInviteMany: handleInviteMany
5641
5812
  }
5642
5813
  )
5643
5814
  ] });
package/dist/index.mjs CHANGED
@@ -2995,7 +2995,8 @@ var APP_ACCESS_MARKS = {
2995
2995
  "artifax": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M6%2029L15%207H21L30%2029H25.7L23.5%2023H12.5L10.3%2029ZM14%2019H22L18%209Z%22%2F%3E%3C%2Fsvg%3E%0A",
2996
2996
  "photogenix": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%2029V7H20C25%207%2028%2010%2028%2014.5S25%2022%2020%2022H14V29ZM14%2011V18H20C22.7%2018%2024%2017%2024%2014.5S22.7%2011%2020%2011Z%22%2F%3E%3C%2Fsvg%3E%0A",
2997
2997
  "catalogix": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M30%2012L26.5%2014C24.8%2011.5%2022.3%2010%2018.5%2010C12.7%2010%209%2013%209%2018S12.7%2026%2018.5%2026C22.3%2026%2024.8%2024.5%2026.5%2022L30%2024C27.7%2028%2023.7%2030%2018.5%2030C10.5%2030%205%2025.3%205%2018S10.5%206%2018.5%206C23.7%206%2027.7%208%2030%2012Z%22%2F%3E%3C%2Fsvg%3E%0A",
2998
- "returns": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20transform%3D%22translate%288.034%207%29%20scale%280.782%29%22%20d%3D%22M4.536%2028.14H0V0H14.616C21%200%2024.948%203.024%2024.948%208.274C24.948%2012.936%2021.882%2015.792%2016.59%2016.086V16.38C18.774%2016.968%2019.782%2018.228%2020.79%2019.992L25.494%2028.14H20.286L15.792%2020.37C14.532%2018.144%2013.23%2017.22%209.702%2017.22H4.536V28.14ZM4.536%204.074V13.734H14.574C18.354%2013.734%2020.244%2012.432%2020.244%208.904C20.244%205.46%2018.354%204.074%2014.574%204.074H4.536Z%22%2F%3E%3C%2Fsvg%3E%0A"
2998
+ "returns": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20transform%3D%22translate%288.034%207%29%20scale%280.782%29%22%20d%3D%22M4.536%2028.14H0V0H14.616C21%200%2024.948%203.024%2024.948%208.274C24.948%2012.936%2021.882%2015.792%2016.59%2016.086V16.38C18.774%2016.968%2019.782%2018.228%2020.79%2019.992L25.494%2028.14H20.286L15.792%2020.37C14.532%2018.144%2013.23%2017.22%209.702%2017.22H4.536V28.14ZM4.536%204.074V13.734H14.574C18.354%2013.734%2020.244%2012.432%2020.244%208.904C20.244%205.46%2018.354%204.074%2014.574%204.074H4.536Z%22%2F%3E%3C%2Fsvg%3E%0A",
2999
+ "tactix": "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2036%2036%22%3E%3Crect%20width%3D%2236%22%20height%3D%2236%22%20rx%3D%227%22%20fill%3D%22%23101010%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M5%207H31V11H20V29H16V11H5Z%22%2F%3E%3C%2Fsvg%3E%0A"
2999
3000
  };
3000
3001
 
3001
3002
  // src/teams-content.tsx
@@ -3013,6 +3014,7 @@ import {
3013
3014
  SiconClose as SiconClose2,
3014
3015
  SiconArrowLeftRight,
3015
3016
  SiconArtifacts,
3017
+ SiconChartBar,
3016
3018
  SiconPhotogenix,
3017
3019
  SiconSearch
3018
3020
  } from "@streamoid/icons";
@@ -3034,6 +3036,7 @@ var svg_rodctpja6f_default = {
3034
3036
  // src/team-types.ts
3035
3037
  var APP_KEYS = [
3036
3038
  "artifax",
3039
+ "tactix",
3037
3040
  "photogenix",
3038
3041
  "returns",
3039
3042
  "catalogix"
@@ -3043,11 +3046,27 @@ var DEFAULT_PERMISSIONS = {
3043
3046
  photogenix: true,
3044
3047
  catalogix: true,
3045
3048
  returns: true,
3049
+ tactix: true,
3046
3050
  canUseCredits: true,
3047
3051
  canInviteUser: true,
3048
3052
  role: "admin",
3049
3053
  catalogixStores: []
3050
3054
  };
3055
+ function parseInviteEmails(input) {
3056
+ const emails = [];
3057
+ const invalid = [];
3058
+ for (const raw of input.split(/[\s,;]+/)) {
3059
+ const token = raw.trim();
3060
+ if (!token) continue;
3061
+ if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(token)) {
3062
+ const email = token.toLowerCase();
3063
+ if (!emails.includes(email)) emails.push(email);
3064
+ } else if (!invalid.includes(token)) {
3065
+ invalid.push(token);
3066
+ }
3067
+ }
3068
+ return { emails, invalid };
3069
+ }
3051
3070
 
3052
3071
  // src/invite-update-modal.tsx
3053
3072
  import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
@@ -3168,7 +3187,8 @@ function InviteUpdateModal({
3168
3187
  initialOrganizationStanding = "guest",
3169
3188
  organizationDomain: _organizationDomain,
3170
3189
  allowAdminRole = true,
3171
- onInvite
3190
+ onInvite,
3191
+ onInviteMany
3172
3192
  }) {
3173
3193
  useOverlayOpen(open, onClose);
3174
3194
  const [emailValue, setEmailValue] = useState7("");
@@ -3187,6 +3207,8 @@ function InviteUpdateModal({
3187
3207
  !hiddenApps.includes("catalogix")
3188
3208
  );
3189
3209
  const [returnsOn, setReturnsOn] = useState7(!hiddenApps.includes("returns"));
3210
+ const [tactixOn, setTactixOn] = useState7(!hiddenApps.includes("tactix"));
3211
+ const [submitting, setSubmitting] = useState7(false);
3190
3212
  const [storeSearch, setStoreSearch] = useState7("");
3191
3213
  const [selectedStores, setSelectedStores] = useState7(/* @__PURE__ */ new Set());
3192
3214
  const filteredStores = stores.filter(
@@ -3205,6 +3227,7 @@ function InviteUpdateModal({
3205
3227
  );
3206
3228
  setCatalogixOn(!hidden.has("catalogix") && initialPermissions.catalogix);
3207
3229
  setReturnsOn(!hidden.has("returns") && initialPermissions.returns);
3230
+ setTactixOn(!hidden.has("tactix") && Boolean(initialPermissions.tactix));
3208
3231
  setSelectedStores(
3209
3232
  new Set(hidden.has("catalogix") ? [] : initialPermissions.catalogixStores)
3210
3233
  );
@@ -3220,6 +3243,8 @@ function InviteUpdateModal({
3220
3243
  setPhotogenixOn(!hidden.has("photogenix"));
3221
3244
  setCatalogixOn(!hidden.has("catalogix"));
3222
3245
  setReturnsOn(!hidden.has("returns"));
3246
+ setTactixOn(!hidden.has("tactix"));
3247
+ setSubmitting(false);
3223
3248
  setStoreSearch("");
3224
3249
  setSelectedStores(/* @__PURE__ */ new Set());
3225
3250
  }
@@ -3227,7 +3252,8 @@ function InviteUpdateModal({
3227
3252
  const adminLocked = mode === "invite" && !allowAdminRole;
3228
3253
  if (!open) return null;
3229
3254
  const isInvite = mode === "invite";
3230
- const hasEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailValue.trim());
3255
+ const parsedEmails = parseInviteEmails(emailValue);
3256
+ const hasEmail = parsedEmails.emails.length > 0 && parsedEmails.invalid.length === 0;
3231
3257
  function markChanged() {
3232
3258
  setHasChanges(true);
3233
3259
  }
@@ -3237,12 +3263,13 @@ function InviteUpdateModal({
3237
3263
  artifax: artifaxOn,
3238
3264
  photogenix: photogenixOn,
3239
3265
  returns: returnsOn,
3240
- catalogix: catalogixOn
3266
+ catalogix: catalogixOn,
3267
+ tactix: tactixOn
3241
3268
  };
3242
3269
  const notLastShown = (key) => shownApps[shownApps.length - 1] !== key;
3243
3270
  const appValue = (key) => role === "admin" || showsApp(key) ? appToggles[key] : false;
3244
3271
  const grantsNoApp = role === "member" && shownApps.length > 0 && !shownApps.some((key) => appToggles[key]);
3245
- const isSubmitDisabled = isInvite ? !hasEmail || grantsNoApp : !(allowSubmitWithoutChanges || hasChanges);
3272
+ const isSubmitDisabled = isInvite ? !hasEmail || grantsNoApp || submitting : !(allowSubmitWithoutChanges || hasChanges);
3246
3273
  function toggleStore(storeId) {
3247
3274
  setSelectedStores((prev) => {
3248
3275
  const next = new Set(prev);
@@ -3348,6 +3375,7 @@ function InviteUpdateModal({
3348
3375
  color: T6.primary
3349
3376
  },
3350
3377
  placeholder: "email@domain.in, email@domain.in, email@domain.in...",
3378
+ "aria-invalid": parsedEmails.invalid.length > 0,
3351
3379
  value: emailValue,
3352
3380
  onChange: (e) => setEmailValue(e.target.value)
3353
3381
  }
@@ -3369,6 +3397,20 @@ function InviteUpdateModal({
3369
3397
  }
3370
3398
  ) })
3371
3399
  }
3400
+ ),
3401
+ isInvite && parsedEmails.invalid.length > 0 && /* @__PURE__ */ jsx14(
3402
+ "span",
3403
+ {
3404
+ role: "alert",
3405
+ style: {
3406
+ fontFamily: T6.font,
3407
+ fontSize: T6.fsXs,
3408
+ fontWeight: 400,
3409
+ lineHeight: T6.lhXs,
3410
+ color: "var(--alias-text---icons-error)"
3411
+ },
3412
+ children: parsedEmails.invalid.length === 1 ? `Not a valid email: ${parsedEmails.invalid[0]}` : `Not valid emails: ${parsedEmails.invalid.join(", ")}`
3413
+ }
3372
3414
  )
3373
3415
  ]
3374
3416
  }
@@ -3803,6 +3845,101 @@ function InviteUpdateModal({
3803
3845
  }
3804
3846
  ) })
3805
3847
  ] }) }),
3848
+ showsApp("tactix") && /* @__PURE__ */ jsx14(Fragment5, { children: /* @__PURE__ */ jsxs11("div", { className: "shrink-0 w-full relative", children: [
3849
+ notLastShown("tactix") && /* @__PURE__ */ jsx14(
3850
+ "div",
3851
+ {
3852
+ "aria-hidden": true,
3853
+ className: "absolute inset-0 pointer-events-none",
3854
+ style: {
3855
+ borderBottom: `1px solid ${T6.borderSubtle}`
3856
+ }
3857
+ }
3858
+ ),
3859
+ /* @__PURE__ */ jsx14("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ jsxs11(
3860
+ "div",
3861
+ {
3862
+ className: "flex items-center w-full",
3863
+ style: { padding: T6.sp3xl, gap: T6.spMd },
3864
+ children: [
3865
+ /* @__PURE__ */ jsxs11(
3866
+ "div",
3867
+ {
3868
+ className: "flex flex-1 min-w-0 items-center",
3869
+ style: { gap: T6.spXl },
3870
+ children: [
3871
+ /* @__PURE__ */ jsx14(
3872
+ "div",
3873
+ {
3874
+ className: "shrink-0 flex items-center",
3875
+ style: {
3876
+ background: T6.fillHover,
3877
+ borderRadius: T6.rXl,
3878
+ padding: T6.spMd
3879
+ },
3880
+ children: /* @__PURE__ */ jsx14(
3881
+ SiconChartBar,
3882
+ {
3883
+ className: "w-6 h-6",
3884
+ color: T6.primary
3885
+ }
3886
+ )
3887
+ }
3888
+ ),
3889
+ /* @__PURE__ */ jsxs11(
3890
+ "div",
3891
+ {
3892
+ className: "flex flex-1 min-w-0 flex-col items-start overflow-hidden text-ellipsis whitespace-nowrap",
3893
+ style: { opacity: tactixOn ? 1 : 0.5 },
3894
+ children: [
3895
+ /* @__PURE__ */ jsx14(
3896
+ "p",
3897
+ {
3898
+ className: "w-full overflow-hidden shrink-0",
3899
+ style: {
3900
+ fontFamily: T6.font,
3901
+ fontSize: T6.fsSm,
3902
+ fontWeight: 500,
3903
+ lineHeight: T6.lhSm,
3904
+ color: T6.primary
3905
+ },
3906
+ children: "Tactix"
3907
+ }
3908
+ ),
3909
+ /* @__PURE__ */ jsx14(
3910
+ "p",
3911
+ {
3912
+ className: "w-full overflow-hidden shrink-0",
3913
+ style: {
3914
+ fontFamily: T6.font,
3915
+ fontSize: T6.fsXs,
3916
+ fontWeight: 400,
3917
+ lineHeight: T6.lhXs,
3918
+ color: T6.tertiary
3919
+ },
3920
+ children: "Buying and planning"
3921
+ }
3922
+ )
3923
+ ]
3924
+ }
3925
+ )
3926
+ ]
3927
+ }
3928
+ ),
3929
+ /* @__PURE__ */ jsx14(
3930
+ ToggleSwitch,
3931
+ {
3932
+ active: tactixOn,
3933
+ onClick: () => {
3934
+ setTactixOn(!tactixOn);
3935
+ markChanged();
3936
+ }
3937
+ }
3938
+ )
3939
+ ]
3940
+ }
3941
+ ) })
3942
+ ] }) }),
3806
3943
  showsApp("photogenix") && /* @__PURE__ */ jsx14(Fragment5, { children: /* @__PURE__ */ jsxs11("div", { className: "shrink-0 w-full relative", children: [
3807
3944
  notLastShown("photogenix") && /* @__PURE__ */ jsx14(
3808
3945
  "div",
@@ -4317,18 +4454,27 @@ function InviteUpdateModal({
4317
4454
  photogenix: appValue("photogenix"),
4318
4455
  catalogix: appValue("catalogix"),
4319
4456
  returns: appValue("returns"),
4457
+ tactix: appValue("tactix"),
4320
4458
  // Stores ride on Catalogix, so they follow it: a
4321
4459
  // hidden Catalogix grants no app and therefore no
4322
4460
  // storefronts. Keeping them would leave a member
4323
4461
  // scoped to stores in a product they cannot open.
4324
4462
  catalogixStores: role === "admin" || showsApp("catalogix") ? Array.from(selectedStores) : []
4325
4463
  };
4326
- if (isInvite && onInvite) {
4327
- onInvite(
4328
- perms,
4329
- emailValue.trim(),
4330
- showOrganizationStanding ? orgStanding : void 0
4331
- );
4464
+ const standing = showOrganizationStanding ? orgStanding : void 0;
4465
+ if (isInvite && onInviteMany) {
4466
+ setSubmitting(true);
4467
+ Promise.resolve(
4468
+ onInviteMany(perms, parsedEmails.emails, standing)
4469
+ ).then((result) => {
4470
+ if (result && result.failed.length > 0) {
4471
+ setEmailValue(result.failed.join(", "));
4472
+ }
4473
+ }).finally(() => setSubmitting(false));
4474
+ } else if (isInvite && onInvite) {
4475
+ for (const email of parsedEmails.emails) {
4476
+ onInvite(perms, email, standing);
4477
+ }
4332
4478
  } else if (onSave) {
4333
4479
  onSave(perms);
4334
4480
  }
@@ -4563,6 +4709,7 @@ function appNameTokens(app) {
4563
4709
  return ["artifax", "artifact", "artifacts", "artifex", "chat"];
4564
4710
  if (app === "photogenix") return ["photogenix"];
4565
4711
  if (app === "returns") return ["returns", "return"];
4712
+ if (app === "tactix") return ["tactix"];
4566
4713
  return ["catalogix"];
4567
4714
  }
4568
4715
  function normalizeServiceName(value) {
@@ -4591,6 +4738,7 @@ function permissionServiceIds(services, permissions) {
4591
4738
  if (serviceMatchesApp(s, "catalogix") && permissions.catalogix)
4592
4739
  return true;
4593
4740
  if (serviceMatchesApp(s, "returns") && permissions.returns) return true;
4741
+ if (serviceMatchesApp(s, "tactix") && permissions.tactix) return true;
4594
4742
  return false;
4595
4743
  }).map((s) => s._id);
4596
4744
  }
@@ -4703,7 +4851,8 @@ function readInviteAppFlag(invRecord, app) {
4703
4851
  ],
4704
4852
  photogenix: ["photogenix", "photogenixAccess"],
4705
4853
  catalogix: ["catalogix", "catalogixAccess"],
4706
- returns: ["returns", "return", "returnsAccess"]
4854
+ returns: ["returns", "return", "returnsAccess"],
4855
+ tactix: ["tactix", "tactixAccess"]
4707
4856
  };
4708
4857
  const containers = [invRecord];
4709
4858
  for (const nestedKey of ["permissions", "permission", "access", "apps"]) {
@@ -4778,6 +4927,7 @@ function memberToTeamMember(m, services) {
4778
4927
  const hasPhotogenix = isAdmin || userHasApp("photogenix");
4779
4928
  const hasCatalogix = isAdmin || userHasApp("catalogix");
4780
4929
  const hasReturns = isAdmin || userHasApp("returns");
4930
+ const hasTactix = isAdmin || userHasApp("tactix");
4781
4931
  return {
4782
4932
  id: m._id,
4783
4933
  kind: "member",
@@ -4804,6 +4954,7 @@ function memberToTeamMember(m, services) {
4804
4954
  photogenix: hasPhotogenix,
4805
4955
  catalogix: hasCatalogix,
4806
4956
  returns: hasReturns,
4957
+ tactix: hasTactix,
4807
4958
  canUseCredits: m.creditAccess,
4808
4959
  canInviteUser: m.inviteAccess,
4809
4960
  role: m.role,
@@ -4822,14 +4973,17 @@ function inviteToTeamMember(inv, services) {
4822
4973
  );
4823
4974
  const derivedCatalogix = serviceNames.some((n) => matchesApp(n, "catalogix"));
4824
4975
  const derivedReturns = serviceNames.some((n) => matchesApp(n, "returns"));
4976
+ const derivedTactix = serviceNames.some((n) => matchesApp(n, "tactix"));
4825
4977
  const explicitArtifax = readInviteAppFlag(invRecord, "artifax");
4826
4978
  const explicitPhotogenix = readInviteAppFlag(invRecord, "photogenix");
4827
4979
  const explicitCatalogix = readInviteAppFlag(invRecord, "catalogix");
4828
4980
  const explicitReturns = readInviteAppFlag(invRecord, "returns");
4981
+ const explicitTactix = readInviteAppFlag(invRecord, "tactix");
4829
4982
  const artifaxFlag = Boolean(explicitArtifax) || derivedArtifax;
4830
4983
  const photogenixFlag = Boolean(explicitPhotogenix) || derivedPhotogenix;
4831
4984
  const catalogixFlag = Boolean(explicitCatalogix) || derivedCatalogix;
4832
4985
  const returnsFlag = Boolean(explicitReturns) || derivedReturns;
4986
+ const tactixFlag = Boolean(explicitTactix) || derivedTactix;
4833
4987
  const catalogixStores = uniqueNonEmpty([
4834
4988
  ...extractIdsFromMixedArray(invRecord.stores),
4835
4989
  ...extractIdsFromMixedArray(invRecord.storeIds)
@@ -4846,6 +5000,7 @@ function inviteToTeamMember(inv, services) {
4846
5000
  photogenix: photogenixFlag,
4847
5001
  catalogix: catalogixFlag,
4848
5002
  returns: returnsFlag,
5003
+ tactix: tactixFlag,
4849
5004
  canUseCredits: inv.creditAccess ?? false,
4850
5005
  canInviteUser: inv.inviteAccess ?? false,
4851
5006
  role: inv.role ?? "member",
@@ -4854,7 +5009,7 @@ function inviteToTeamMember(inv, services) {
4854
5009
  };
4855
5010
  }
4856
5011
  function AccessIcons({ permissions }) {
4857
- const apps = ["artifax", "photogenix", "catalogix", "returns"];
5012
+ const apps = ["artifax", "tactix", "photogenix", "catalogix", "returns"];
4858
5013
  return /* @__PURE__ */ jsx16("div", { className: "flex items-center shrink-0", style: { gap: 6 }, children: apps.filter((app) => permissions[app]).map((app) => /* @__PURE__ */ jsx16(
4859
5014
  "img",
4860
5015
  {
@@ -5377,34 +5532,50 @@ function TeamsContent({
5377
5532
  toast.error(msg);
5378
5533
  }
5379
5534
  };
5380
- const handleInvite = async (permissions, email, organizationStanding) => {
5535
+ const handleInviteMany = async (permissions, emails, organizationStanding) => {
5381
5536
  if (!viewerCanInvite || permissions.role === "admin" && highestRole !== "admin") {
5382
5537
  toast.error("You do not have permission to invite users");
5383
5538
  closeModal();
5384
- return;
5539
+ return { failed: [] };
5385
5540
  }
5386
5541
  const serviceIds = permissions.role === "admin" ? [] : permissionServiceIds(allServices, permissions);
5387
- try {
5388
- await api.inviteMember({
5389
- email,
5390
- creditAccess: permissions.canUseCredits,
5391
- inviteAccess: permissions.canInviteUser,
5392
- role: permissions.role,
5393
- serviceIds,
5394
- storeIds: permissions.catalogixStores || [],
5395
- // Omitted when the control was never shown, which leaves the backend
5396
- // deriving the standing from the invitee's email domain as before.
5397
- ...organizationStanding ? {
5398
- organizationRole: organizationStanding === "colleague" ? "member" : "guest"
5399
- } : {}
5400
- });
5401
- toast.success(`Invitation sent to ${email}`);
5402
- await fetchData();
5403
- closeModal();
5404
- } catch (err) {
5405
- const msg = errorMessage(err, { method: "POST" });
5406
- toast.error(msg);
5542
+ const sent = [];
5543
+ const failed = [];
5544
+ for (const email of emails) {
5545
+ try {
5546
+ await api.inviteMember({
5547
+ email,
5548
+ creditAccess: permissions.canUseCredits,
5549
+ inviteAccess: permissions.canInviteUser,
5550
+ role: permissions.role,
5551
+ serviceIds,
5552
+ storeIds: permissions.catalogixStores || [],
5553
+ // Omitted when the control was never shown, which leaves the backend
5554
+ // deriving the standing from the invitee's email domain as before.
5555
+ ...organizationStanding ? {
5556
+ organizationRole: organizationStanding === "colleague" ? "member" : "guest"
5557
+ } : {}
5558
+ });
5559
+ sent.push(email);
5560
+ } catch (err) {
5561
+ failed.push({ email, message: errorMessage(err, { method: "POST" }) });
5562
+ }
5563
+ }
5564
+ if (sent.length === 1) toast.success(`Invitation sent to ${sent[0]}`);
5565
+ else if (sent.length > 1)
5566
+ toast.success(`Invitations sent to ${sent.length} people`);
5567
+ if (failed.length === 1) {
5568
+ toast.error(
5569
+ emails.length === 1 ? failed[0].message : `${failed[0].email}: ${failed[0].message}`
5570
+ );
5571
+ } else if (failed.length > 1) {
5572
+ toast.error(
5573
+ `${failed.length} invitations were not sent. ${failed[0].email}: ${failed[0].message}`
5574
+ );
5407
5575
  }
5576
+ if (sent.length > 0) await fetchData();
5577
+ if (failed.length === 0) closeModal();
5578
+ return { failed: failed.map((f) => f.email) };
5408
5579
  };
5409
5580
  const filteredActive = activeMembers.filter((m) => {
5410
5581
  const q = searchQuery.toLowerCase();
@@ -5522,7 +5693,7 @@ function TeamsContent({
5522
5693
  showOrganizationStanding: mayGrantOrgMembership,
5523
5694
  organizationName: organizationName ?? orgCurrent?.name,
5524
5695
  organizationDomain: workspaceOrgId && orgCurrent?.id === workspaceOrgId ? orgCurrent?.domain : void 0,
5525
- onInvite: handleInvite
5696
+ onInviteMany: handleInviteMany
5526
5697
  }
5527
5698
  )
5528
5699
  ] });
@@ -17519,6 +17690,7 @@ export {
17519
17690
  minimumCreditLimit,
17520
17691
  ownCreditsFirstText,
17521
17692
  parseBillingEntitlement,
17693
+ parseInviteEmails,
17522
17694
  pausedOwnCreditsText,
17523
17695
  poolEndsAtFrom,
17524
17696
  poolErrorMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/settings",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",