@streamoid/settings 0.7.10 → 0.7.11

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
@@ -1582,6 +1582,13 @@ declare function minimumCreditLimit(used: number): number;
1582
1582
  declare function formatCredits(value: number): string;
1583
1583
  /** The default limit has no usage floor: lowering it under usage is allowed. */
1584
1584
  declare function validateDefaultCreditLimitInput(raw: string): CreditLimitValidation;
1585
+ /**
1586
+ * What the credits field keeps of what was typed or pasted: digits and a
1587
+ * decimal point. Grouping commas and other characters go, as before, but the
1588
+ * point stays, so "400.5" is refused as not a whole number rather than read as
1589
+ * 4005.
1590
+ */
1591
+ declare function cleanCreditLimitInput(value: string): string;
1585
1592
  /** Digits-only input, an integer, and not below what was already used. */
1586
1593
  declare function validateCreditLimitInput(raw: string, used: number): CreditLimitValidation;
1587
1594
  /** Why a limit was refused for being under `used`, naming the least it can be. */
@@ -1666,4 +1673,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
1666
1673
  */
1667
1674
  declare function useSettingsAdapters(): SettingsAdapters;
1668
1675
 
1669
- export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, 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 OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, OrganizationModal, 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 SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, 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 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 WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, countLabel, creditCycleUnit, describeDefaultLimit, describeMemberLimit, formatCreditLimit, formatCredits, groupWorkspaceList, isLimitBelowUsage, joinMembersWithLimits, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput };
1676
+ export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, 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 OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, OrganizationModal, 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 SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, 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 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 WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, cleanCreditLimitInput, countLabel, creditCycleUnit, describeDefaultLimit, describeMemberLimit, formatCreditLimit, formatCredits, groupWorkspaceList, isLimitBelowUsage, joinMembersWithLimits, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput };
package/dist/index.d.ts CHANGED
@@ -1582,6 +1582,13 @@ declare function minimumCreditLimit(used: number): number;
1582
1582
  declare function formatCredits(value: number): string;
1583
1583
  /** The default limit has no usage floor: lowering it under usage is allowed. */
1584
1584
  declare function validateDefaultCreditLimitInput(raw: string): CreditLimitValidation;
1585
+ /**
1586
+ * What the credits field keeps of what was typed or pasted: digits and a
1587
+ * decimal point. Grouping commas and other characters go, as before, but the
1588
+ * point stays, so "400.5" is refused as not a whole number rather than read as
1589
+ * 4005.
1590
+ */
1591
+ declare function cleanCreditLimitInput(value: string): string;
1585
1592
  /** Digits-only input, an integer, and not below what was already used. */
1586
1593
  declare function validateCreditLimitInput(raw: string, used: number): CreditLimitValidation;
1587
1594
  /** Why a limit was refused for being under `used`, naming the least it can be. */
@@ -1666,4 +1673,4 @@ declare function SettingsAdaptersProvider({ adapters, children, }: {
1666
1673
  */
1667
1674
  declare function useSettingsAdapters(): SettingsAdapters;
1668
1675
 
1669
- export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, 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 OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, OrganizationModal, 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 SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, 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 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 WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, countLabel, creditCycleUnit, describeDefaultLimit, describeMemberLimit, formatCreditLimit, formatCredits, groupWorkspaceList, isLimitBelowUsage, joinMembersWithLimits, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput };
1676
+ export { APP_KEYS, type ApiToken, type AppKey, type AvailableCreditsResponse, BillingContent, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type CreatedToken, type CreditCycleUnit, type CreditLimitValidation, 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 OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, OrganizationModal, 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 SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCurrent, type SettingsOrganizationListItem, 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 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 WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, belowUsageReason, cleanCreditLimitInput, countLabel, creditCycleUnit, describeDefaultLimit, describeMemberLimit, formatCreditLimit, formatCredits, groupWorkspaceList, isLimitBelowUsage, joinMembersWithLimits, limitBelowUsageUsed, limitSourceLabel, loadWorkspaceOrganization, minimumCreditLimit, resolveSettingsTabFromPath, roundCredits, useSettingsAdapters, useWorkspaceOrganization, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput };
package/dist/index.js CHANGED
@@ -60,6 +60,7 @@ __export(index_exports, {
60
60
  WorkspacePicker: () => WorkspacePicker,
61
61
  WorkspaceTab: () => WorkspaceTab,
62
62
  belowUsageReason: () => belowUsageReason,
63
+ cleanCreditLimitInput: () => cleanCreditLimitInput,
63
64
  countLabel: () => countLabel,
64
65
  creditCycleUnit: () => creditCycleUnit,
65
66
  describeDefaultLimit: () => describeDefaultLimit,
@@ -7838,6 +7839,9 @@ function formatCredits(value) {
7838
7839
  function validateDefaultCreditLimitInput(raw) {
7839
7840
  return validateCreditLimitInput(raw, 0);
7840
7841
  }
7842
+ function cleanCreditLimitInput(value) {
7843
+ return value.replace(/[^\d.]/g, "");
7844
+ }
7841
7845
  function validateCreditLimitInput(raw, used) {
7842
7846
  const trimmed = raw.trim();
7843
7847
  if (!trimmed) return { ok: false, reason: "Enter a credit limit" };
@@ -8104,7 +8108,9 @@ function MemberCreditLimitModal({
8104
8108
  type: "radio",
8105
8109
  content: "",
8106
8110
  checked: !unlimited,
8107
- onChange: () => setUnlimited(false)
8111
+ onChange: () => {
8112
+ if (!saving) setUnlimited(false);
8113
+ }
8108
8114
  }
8109
8115
  ),
8110
8116
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
@@ -8132,7 +8138,7 @@ function MemberCreditLimitModal({
8132
8138
  disabled: saving,
8133
8139
  onFocus: () => setUnlimited(false),
8134
8140
  onChange: (e) => {
8135
- setRaw(e.target.value.replace(/[^\d]/g, ""));
8141
+ setRaw(cleanCreditLimitInput(e.target.value));
8136
8142
  setTouched(true);
8137
8143
  setServerHint(null);
8138
8144
  },
@@ -8164,6 +8170,7 @@ function MemberCreditLimitModal({
8164
8170
  content: "Unlimited usage",
8165
8171
  checked: unlimited,
8166
8172
  onChange: () => {
8173
+ if (saving) return;
8167
8174
  setUnlimited(true);
8168
8175
  setServerHint(null);
8169
8176
  }
package/dist/index.mjs CHANGED
@@ -7821,6 +7821,9 @@ function formatCredits(value) {
7821
7821
  function validateDefaultCreditLimitInput(raw) {
7822
7822
  return validateCreditLimitInput(raw, 0);
7823
7823
  }
7824
+ function cleanCreditLimitInput(value) {
7825
+ return value.replace(/[^\d.]/g, "");
7826
+ }
7824
7827
  function validateCreditLimitInput(raw, used) {
7825
7828
  const trimmed = raw.trim();
7826
7829
  if (!trimmed) return { ok: false, reason: "Enter a credit limit" };
@@ -8087,7 +8090,9 @@ function MemberCreditLimitModal({
8087
8090
  type: "radio",
8088
8091
  content: "",
8089
8092
  checked: !unlimited,
8090
- onChange: () => setUnlimited(false)
8093
+ onChange: () => {
8094
+ if (!saving) setUnlimited(false);
8095
+ }
8091
8096
  }
8092
8097
  ),
8093
8098
  /* @__PURE__ */ jsxs17(
@@ -8115,7 +8120,7 @@ function MemberCreditLimitModal({
8115
8120
  disabled: saving,
8116
8121
  onFocus: () => setUnlimited(false),
8117
8122
  onChange: (e) => {
8118
- setRaw(e.target.value.replace(/[^\d]/g, ""));
8123
+ setRaw(cleanCreditLimitInput(e.target.value));
8119
8124
  setTouched(true);
8120
8125
  setServerHint(null);
8121
8126
  },
@@ -8147,6 +8152,7 @@ function MemberCreditLimitModal({
8147
8152
  content: "Unlimited usage",
8148
8153
  checked: unlimited,
8149
8154
  onChange: () => {
8155
+ if (saving) return;
8150
8156
  setUnlimited(true);
8151
8157
  setServerHint(null);
8152
8158
  }
@@ -13556,6 +13562,7 @@ export {
13556
13562
  WorkspacePicker,
13557
13563
  WorkspaceTab,
13558
13564
  belowUsageReason,
13565
+ cleanCreditLimitInput,
13559
13566
  countLabel,
13560
13567
  creditCycleUnit,
13561
13568
  describeDefaultLimit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/settings",
3
- "version": "0.7.10",
3
+ "version": "0.7.11",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",