@streamoid/settings 0.10.0 → 0.10.1
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 +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +74 -0
- package/dist/index.mjs +74 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -411,6 +411,13 @@ interface OrganizationWorkspaceItem {
|
|
|
411
411
|
/** "inactive" workspaces are listed to org admins but can't be joined. */
|
|
412
412
|
status?: string;
|
|
413
413
|
}
|
|
414
|
+
/** A shared organization of the viewer's company that they aren't in yet. */
|
|
415
|
+
interface SettingsOrganizationJoinableItem {
|
|
416
|
+
_id: string;
|
|
417
|
+
name: string;
|
|
418
|
+
imageUrl?: string;
|
|
419
|
+
domain?: string | null;
|
|
420
|
+
}
|
|
414
421
|
/** A shared workspace in the organization that the viewer isn't in yet. */
|
|
415
422
|
interface OrganizationJoinableWorkspace {
|
|
416
423
|
_id: string;
|
|
@@ -466,6 +473,13 @@ interface SettingsOrganizationAdapter {
|
|
|
466
473
|
* company admins, public email users and the Streamoid team. Without it, or
|
|
467
474
|
* without `create`, the button never shows. */
|
|
468
475
|
getCreateOptions?: () => Promise<SettingsOrganizationCreateOptions>;
|
|
476
|
+
/** Optional: the viewer's company's shared organizations they are not in
|
|
477
|
+
* yet — the same ones a new user is offered at sign-up. Listed under
|
|
478
|
+
* "Other organizations" with a Join button (with `join`). */
|
|
479
|
+
listJoinable?: () => Promise<SettingsOrganizationJoinableItem[]>;
|
|
480
|
+
/** Optional: join one of `listJoinable` as a member. No workspace comes
|
|
481
|
+
* with it; they open the org and pick or create one. */
|
|
482
|
+
join?: (id: string) => Promise<void>;
|
|
469
483
|
update: (id: string, patch: {
|
|
470
484
|
name?: string;
|
|
471
485
|
imageFile?: File | null;
|
|
@@ -2168,4 +2182,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
|
2168
2182
|
*/
|
|
2169
2183
|
declare function useSettingsAdapters(): SettingsAdapters;
|
|
2170
2184
|
|
|
2171
|
-
export { ALLOCATION_ERROR_CODES, ALLOCATION_NOTE_MAX_LENGTH, APP_KEYS, type AllocationErrorCode, type AllocationValueValidation, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, CANCEL_REASON_MAX_LENGTH, CancelCreditAllocationModal, type CancelCreditAllocationModalProps, type CancelCreditAllocationResult, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreateCreditAllocationInput, type CreatedToken, type CreditAllocation, CreditAllocationModal, type CreditAllocationModalProps, type CreditAllocationMode, type CreditAllocationStatus, type CreditAllocationTarget, type CreditAllocationsResponse, CreditAllocationsView, type CreditCycleUnit, type CreditLimitValidation, type CreditTransfer, type CreditTransfersPage, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, 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, PerUserLimitsView, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, 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 SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, 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, USER_LANGUAGES, type UpdateCreditAllocationInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, 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, allocationErrorMessage, allocationWorkspaceName, belowUsageReason, canShowCreditAllocations, cancelOutcomeSummary, cancelOutcomeWarning, cleanAllocationValueInput, cleanCreditLimitInput, countLabel, creditCycleUnit, describeAllocation, describeDefaultLimit, describeMemberLimit, findAllocationError, findBillingError, formatAllocationRepeat, formatAllocationSplit, formatCreditLimit, formatCredits, groupWorkspaceList, initialTransferSummary, initialTransferWarning, isLimitBelowUsage, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, memberRoleUpdate, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateAllocationText, validateAllocationValue, validateCreditLimitInput, validateDefaultCreditLimitInput };
|
|
2185
|
+
export { ALLOCATION_ERROR_CODES, ALLOCATION_NOTE_MAX_LENGTH, APP_KEYS, type AllocationErrorCode, type AllocationValueValidation, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, CANCEL_REASON_MAX_LENGTH, CancelCreditAllocationModal, type CancelCreditAllocationModalProps, type CancelCreditAllocationResult, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreateCreditAllocationInput, type CreatedToken, type CreditAllocation, CreditAllocationModal, type CreditAllocationModalProps, type CreditAllocationMode, type CreditAllocationStatus, type CreditAllocationTarget, type CreditAllocationsResponse, CreditAllocationsView, type CreditCycleUnit, type CreditLimitValidation, type CreditTransfer, type CreditTransfersPage, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, 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, PerUserLimitsView, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, 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, 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, USER_LANGUAGES, type UpdateCreditAllocationInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, 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, allocationErrorMessage, allocationWorkspaceName, belowUsageReason, canShowCreditAllocations, cancelOutcomeSummary, cancelOutcomeWarning, cleanAllocationValueInput, cleanCreditLimitInput, countLabel, creditCycleUnit, describeAllocation, describeDefaultLimit, describeMemberLimit, findAllocationError, findBillingError, formatAllocationRepeat, formatAllocationSplit, formatCreditLimit, formatCredits, groupWorkspaceList, initialTransferSummary, initialTransferWarning, isLimitBelowUsage, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, memberRoleUpdate, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateAllocationText, validateAllocationValue, validateCreditLimitInput, validateDefaultCreditLimitInput };
|
package/dist/index.d.ts
CHANGED
|
@@ -411,6 +411,13 @@ interface OrganizationWorkspaceItem {
|
|
|
411
411
|
/** "inactive" workspaces are listed to org admins but can't be joined. */
|
|
412
412
|
status?: string;
|
|
413
413
|
}
|
|
414
|
+
/** A shared organization of the viewer's company that they aren't in yet. */
|
|
415
|
+
interface SettingsOrganizationJoinableItem {
|
|
416
|
+
_id: string;
|
|
417
|
+
name: string;
|
|
418
|
+
imageUrl?: string;
|
|
419
|
+
domain?: string | null;
|
|
420
|
+
}
|
|
414
421
|
/** A shared workspace in the organization that the viewer isn't in yet. */
|
|
415
422
|
interface OrganizationJoinableWorkspace {
|
|
416
423
|
_id: string;
|
|
@@ -466,6 +473,13 @@ interface SettingsOrganizationAdapter {
|
|
|
466
473
|
* company admins, public email users and the Streamoid team. Without it, or
|
|
467
474
|
* without `create`, the button never shows. */
|
|
468
475
|
getCreateOptions?: () => Promise<SettingsOrganizationCreateOptions>;
|
|
476
|
+
/** Optional: the viewer's company's shared organizations they are not in
|
|
477
|
+
* yet — the same ones a new user is offered at sign-up. Listed under
|
|
478
|
+
* "Other organizations" with a Join button (with `join`). */
|
|
479
|
+
listJoinable?: () => Promise<SettingsOrganizationJoinableItem[]>;
|
|
480
|
+
/** Optional: join one of `listJoinable` as a member. No workspace comes
|
|
481
|
+
* with it; they open the org and pick or create one. */
|
|
482
|
+
join?: (id: string) => Promise<void>;
|
|
469
483
|
update: (id: string, patch: {
|
|
470
484
|
name?: string;
|
|
471
485
|
imageFile?: File | null;
|
|
@@ -2168,4 +2182,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
|
|
|
2168
2182
|
*/
|
|
2169
2183
|
declare function useSettingsAdapters(): SettingsAdapters;
|
|
2170
2184
|
|
|
2171
|
-
export { ALLOCATION_ERROR_CODES, ALLOCATION_NOTE_MAX_LENGTH, APP_KEYS, type AllocationErrorCode, type AllocationValueValidation, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, CANCEL_REASON_MAX_LENGTH, CancelCreditAllocationModal, type CancelCreditAllocationModalProps, type CancelCreditAllocationResult, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreateCreditAllocationInput, type CreatedToken, type CreditAllocation, CreditAllocationModal, type CreditAllocationModalProps, type CreditAllocationMode, type CreditAllocationStatus, type CreditAllocationTarget, type CreditAllocationsResponse, CreditAllocationsView, type CreditCycleUnit, type CreditLimitValidation, type CreditTransfer, type CreditTransfersPage, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, 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, PerUserLimitsView, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, 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 SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, 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, USER_LANGUAGES, type UpdateCreditAllocationInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, 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, allocationErrorMessage, allocationWorkspaceName, belowUsageReason, canShowCreditAllocations, cancelOutcomeSummary, cancelOutcomeWarning, cleanAllocationValueInput, cleanCreditLimitInput, countLabel, creditCycleUnit, describeAllocation, describeDefaultLimit, describeMemberLimit, findAllocationError, findBillingError, formatAllocationRepeat, formatAllocationSplit, formatCreditLimit, formatCredits, groupWorkspaceList, initialTransferSummary, initialTransferWarning, isLimitBelowUsage, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, memberRoleUpdate, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateAllocationText, validateAllocationValue, validateCreditLimitInput, validateDefaultCreditLimitInput };
|
|
2185
|
+
export { ALLOCATION_ERROR_CODES, ALLOCATION_NOTE_MAX_LENGTH, APP_KEYS, type AllocationErrorCode, type AllocationValueValidation, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, CANCEL_REASON_MAX_LENGTH, CancelCreditAllocationModal, type CancelCreditAllocationModalProps, type CancelCreditAllocationResult, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreateCreditAllocationInput, type CreatedToken, type CreditAllocation, CreditAllocationModal, type CreditAllocationModalProps, type CreditAllocationMode, type CreditAllocationStatus, type CreditAllocationTarget, type CreditAllocationsResponse, CreditAllocationsView, type CreditCycleUnit, type CreditLimitValidation, type CreditTransfer, type CreditTransfersPage, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, ExportDateModal, 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, PerUserLimitsView, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, ReferralTab, 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, 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, USER_LANGUAGES, type UpdateCreditAllocationInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryResponse, 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, allocationErrorMessage, allocationWorkspaceName, belowUsageReason, canShowCreditAllocations, cancelOutcomeSummary, cancelOutcomeWarning, cleanAllocationValueInput, cleanCreditLimitInput, countLabel, creditCycleUnit, describeAllocation, describeDefaultLimit, describeMemberLimit, findAllocationError, findBillingError, formatAllocationRepeat, formatAllocationSplit, formatCreditLimit, formatCredits, groupWorkspaceList, initialTransferSummary, initialTransferWarning, isLimitBelowUsage, joinMembersWithLimits, lastUsedLabel, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, memberRoleUpdate, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateAllocationText, validateAllocationValue, validateCreditLimitInput, validateDefaultCreditLimitInput };
|
package/dist/index.js
CHANGED
|
@@ -7215,6 +7215,8 @@ function OrganizationListContent() {
|
|
|
7215
7215
|
const [createOpen, setCreateOpen] = (0, import_react13.useState)(false);
|
|
7216
7216
|
const [managing, setManaging] = (0, import_react13.useState)(null);
|
|
7217
7217
|
const [openingId, setOpeningId] = (0, import_react13.useState)(null);
|
|
7218
|
+
const [joinable, setJoinable] = (0, import_react13.useState)([]);
|
|
7219
|
+
const [joiningId, setJoiningId] = (0, import_react13.useState)(null);
|
|
7218
7220
|
const organizationRef = (0, import_react13.useRef)(organization);
|
|
7219
7221
|
organizationRef.current = organization;
|
|
7220
7222
|
const load = (0, import_react13.useCallback)(async () => {
|
|
@@ -7227,6 +7229,32 @@ function OrganizationListContent() {
|
|
|
7227
7229
|
setLoading(false);
|
|
7228
7230
|
}
|
|
7229
7231
|
}, []);
|
|
7232
|
+
const loadJoinable = (0, import_react13.useCallback)(async () => {
|
|
7233
|
+
const list = organizationRef.current.listJoinable;
|
|
7234
|
+
if (!list || !organizationRef.current.join) return;
|
|
7235
|
+
try {
|
|
7236
|
+
setJoinable(await list());
|
|
7237
|
+
} catch {
|
|
7238
|
+
setJoinable([]);
|
|
7239
|
+
}
|
|
7240
|
+
}, []);
|
|
7241
|
+
(0, import_react13.useEffect)(() => {
|
|
7242
|
+
void loadJoinable();
|
|
7243
|
+
}, [loadJoinable]);
|
|
7244
|
+
const joinOrganization = async (org) => {
|
|
7245
|
+
const join = organizationRef.current.join;
|
|
7246
|
+
if (!join) return;
|
|
7247
|
+
setJoiningId(org._id);
|
|
7248
|
+
try {
|
|
7249
|
+
await join(org._id);
|
|
7250
|
+
toast.success(`Joined "${org.name}". Open it to pick a workspace.`);
|
|
7251
|
+
await Promise.all([load(), loadJoinable()]);
|
|
7252
|
+
} catch (err) {
|
|
7253
|
+
toast.error(errorMessage(err, { method: "POST" }));
|
|
7254
|
+
} finally {
|
|
7255
|
+
setJoiningId(null);
|
|
7256
|
+
}
|
|
7257
|
+
};
|
|
7230
7258
|
(0, import_react13.useEffect)(() => {
|
|
7231
7259
|
void load();
|
|
7232
7260
|
}, [organization.current?.id]);
|
|
@@ -7358,6 +7386,52 @@ function OrganizationListContent() {
|
|
|
7358
7386
|
))
|
|
7359
7387
|
}
|
|
7360
7388
|
),
|
|
7389
|
+
joinable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col w-full", style: { gap: T12.spXl }, children: [
|
|
7390
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col min-w-0", style: { gap: T12.spXs }, children: [
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { style: { margin: 0, color: T12.primary, fontSize: T12.fsLg, fontWeight: 600, lineHeight: T12.lhLg }, children: "Other organizations" }),
|
|
7392
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { style: { margin: 0, color: T12.muted, fontSize: T12.fsSm, lineHeight: T12.lhSm }, children: "Shared organizations at your company that you can join as a member." })
|
|
7393
|
+
] }),
|
|
7394
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7395
|
+
"div",
|
|
7396
|
+
{
|
|
7397
|
+
className: "flex flex-col w-full",
|
|
7398
|
+
style: {
|
|
7399
|
+
background: T12.surface,
|
|
7400
|
+
border: `1px solid ${T12.borderSubtle}`,
|
|
7401
|
+
borderRadius: T12.r3xl
|
|
7402
|
+
},
|
|
7403
|
+
children: joinable.map((org, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
7404
|
+
"div",
|
|
7405
|
+
{
|
|
7406
|
+
className: "flex items-center w-full",
|
|
7407
|
+
style: {
|
|
7408
|
+
gap: T12.spXl,
|
|
7409
|
+
padding: `${T12.spXl} ${T12.sp3xl}`,
|
|
7410
|
+
borderTop: index ? `1px solid ${T12.borderSubtle}` : "none"
|
|
7411
|
+
},
|
|
7412
|
+
children: [
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ProfileAvatar, { name: org.name, profileImage: org.imageUrl, size: 36, borderRadius: T12.rLg }),
|
|
7414
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col flex-1 min-w-0", children: [
|
|
7415
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate", style: { color: T12.primary, fontSize: T12.fsSm, fontWeight: 500, lineHeight: T12.lhSm }, children: org.name }),
|
|
7416
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate", style: { color: T12.muted, fontSize: T12.fsXs, lineHeight: T12.lhXs }, children: ["Shared", org.domain].filter(Boolean).join(" \xB7 ") })
|
|
7417
|
+
] }),
|
|
7418
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7419
|
+
import_ui9.ScButton,
|
|
7420
|
+
{
|
|
7421
|
+
text: joiningId === org._id ? "Joining\u2026" : "Join",
|
|
7422
|
+
variant: "secondary",
|
|
7423
|
+
size: "sm",
|
|
7424
|
+
state: joiningId ? "disabled" : "default",
|
|
7425
|
+
onClick: joiningId ? void 0 : () => void joinOrganization(org)
|
|
7426
|
+
}
|
|
7427
|
+
)
|
|
7428
|
+
]
|
|
7429
|
+
},
|
|
7430
|
+
org._id
|
|
7431
|
+
))
|
|
7432
|
+
}
|
|
7433
|
+
)
|
|
7434
|
+
] }),
|
|
7361
7435
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
7362
7436
|
OrganizationModal,
|
|
7363
7437
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -7148,6 +7148,8 @@ function OrganizationListContent() {
|
|
|
7148
7148
|
const [createOpen, setCreateOpen] = useState11(false);
|
|
7149
7149
|
const [managing, setManaging] = useState11(null);
|
|
7150
7150
|
const [openingId, setOpeningId] = useState11(null);
|
|
7151
|
+
const [joinable, setJoinable] = useState11([]);
|
|
7152
|
+
const [joiningId, setJoiningId] = useState11(null);
|
|
7151
7153
|
const organizationRef = useRef6(organization);
|
|
7152
7154
|
organizationRef.current = organization;
|
|
7153
7155
|
const load = useCallback4(async () => {
|
|
@@ -7160,6 +7162,32 @@ function OrganizationListContent() {
|
|
|
7160
7162
|
setLoading(false);
|
|
7161
7163
|
}
|
|
7162
7164
|
}, []);
|
|
7165
|
+
const loadJoinable = useCallback4(async () => {
|
|
7166
|
+
const list = organizationRef.current.listJoinable;
|
|
7167
|
+
if (!list || !organizationRef.current.join) return;
|
|
7168
|
+
try {
|
|
7169
|
+
setJoinable(await list());
|
|
7170
|
+
} catch {
|
|
7171
|
+
setJoinable([]);
|
|
7172
|
+
}
|
|
7173
|
+
}, []);
|
|
7174
|
+
useEffect11(() => {
|
|
7175
|
+
void loadJoinable();
|
|
7176
|
+
}, [loadJoinable]);
|
|
7177
|
+
const joinOrganization = async (org) => {
|
|
7178
|
+
const join = organizationRef.current.join;
|
|
7179
|
+
if (!join) return;
|
|
7180
|
+
setJoiningId(org._id);
|
|
7181
|
+
try {
|
|
7182
|
+
await join(org._id);
|
|
7183
|
+
toast.success(`Joined "${org.name}". Open it to pick a workspace.`);
|
|
7184
|
+
await Promise.all([load(), loadJoinable()]);
|
|
7185
|
+
} catch (err) {
|
|
7186
|
+
toast.error(errorMessage(err, { method: "POST" }));
|
|
7187
|
+
} finally {
|
|
7188
|
+
setJoiningId(null);
|
|
7189
|
+
}
|
|
7190
|
+
};
|
|
7163
7191
|
useEffect11(() => {
|
|
7164
7192
|
void load();
|
|
7165
7193
|
}, [organization.current?.id]);
|
|
@@ -7291,6 +7319,52 @@ function OrganizationListContent() {
|
|
|
7291
7319
|
))
|
|
7292
7320
|
}
|
|
7293
7321
|
),
|
|
7322
|
+
joinable.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col w-full", style: { gap: T12.spXl }, children: [
|
|
7323
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col min-w-0", style: { gap: T12.spXs }, children: [
|
|
7324
|
+
/* @__PURE__ */ jsx19("p", { style: { margin: 0, color: T12.primary, fontSize: T12.fsLg, fontWeight: 600, lineHeight: T12.lhLg }, children: "Other organizations" }),
|
|
7325
|
+
/* @__PURE__ */ jsx19("p", { style: { margin: 0, color: T12.muted, fontSize: T12.fsSm, lineHeight: T12.lhSm }, children: "Shared organizations at your company that you can join as a member." })
|
|
7326
|
+
] }),
|
|
7327
|
+
/* @__PURE__ */ jsx19(
|
|
7328
|
+
"div",
|
|
7329
|
+
{
|
|
7330
|
+
className: "flex flex-col w-full",
|
|
7331
|
+
style: {
|
|
7332
|
+
background: T12.surface,
|
|
7333
|
+
border: `1px solid ${T12.borderSubtle}`,
|
|
7334
|
+
borderRadius: T12.r3xl
|
|
7335
|
+
},
|
|
7336
|
+
children: joinable.map((org, index) => /* @__PURE__ */ jsxs16(
|
|
7337
|
+
"div",
|
|
7338
|
+
{
|
|
7339
|
+
className: "flex items-center w-full",
|
|
7340
|
+
style: {
|
|
7341
|
+
gap: T12.spXl,
|
|
7342
|
+
padding: `${T12.spXl} ${T12.sp3xl}`,
|
|
7343
|
+
borderTop: index ? `1px solid ${T12.borderSubtle}` : "none"
|
|
7344
|
+
},
|
|
7345
|
+
children: [
|
|
7346
|
+
/* @__PURE__ */ jsx19(ProfileAvatar, { name: org.name, profileImage: org.imageUrl, size: 36, borderRadius: T12.rLg }),
|
|
7347
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col flex-1 min-w-0", children: [
|
|
7348
|
+
/* @__PURE__ */ jsx19("span", { className: "truncate", style: { color: T12.primary, fontSize: T12.fsSm, fontWeight: 500, lineHeight: T12.lhSm }, children: org.name }),
|
|
7349
|
+
/* @__PURE__ */ jsx19("span", { className: "truncate", style: { color: T12.muted, fontSize: T12.fsXs, lineHeight: T12.lhXs }, children: ["Shared", org.domain].filter(Boolean).join(" \xB7 ") })
|
|
7350
|
+
] }),
|
|
7351
|
+
/* @__PURE__ */ jsx19(
|
|
7352
|
+
ScButton6,
|
|
7353
|
+
{
|
|
7354
|
+
text: joiningId === org._id ? "Joining\u2026" : "Join",
|
|
7355
|
+
variant: "secondary",
|
|
7356
|
+
size: "sm",
|
|
7357
|
+
state: joiningId ? "disabled" : "default",
|
|
7358
|
+
onClick: joiningId ? void 0 : () => void joinOrganization(org)
|
|
7359
|
+
}
|
|
7360
|
+
)
|
|
7361
|
+
]
|
|
7362
|
+
},
|
|
7363
|
+
org._id
|
|
7364
|
+
))
|
|
7365
|
+
}
|
|
7366
|
+
)
|
|
7367
|
+
] }),
|
|
7294
7368
|
/* @__PURE__ */ jsx19(
|
|
7295
7369
|
OrganizationModal,
|
|
7296
7370
|
{
|