@drawbridge/components 0.1.48 → 0.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/bridge/fields.js +0 -278
  2. package/dist/bridge/fields.mjs +1 -276
  3. package/dist/bridge/form-subdomain-shop-modal.js +274 -234
  4. package/dist/bridge/form-subdomain-shop-modal.mjs +275 -233
  5. package/dist/bridge/form-subdomain.js +0 -7
  6. package/dist/bridge/form-subdomain.mjs +2 -9
  7. package/dist/bridge/lib/age-gate.js +0 -12
  8. package/dist/bridge/lib/age-gate.mjs +0 -11
  9. package/dist/bridge/lib/checkout-kit.js +32 -2
  10. package/dist/bridge/lib/checkout-kit.mjs +32 -2
  11. package/dist/bridge/lib/entry.js +0 -3
  12. package/dist/bridge/lib/entry.mjs +0 -2
  13. package/dist/bridge/product-tile.js +6 -9
  14. package/dist/bridge/product-tile.mjs +6 -9
  15. package/dist/bridge/template-layout.js +122 -237
  16. package/dist/bridge/template-layout.mjs +122 -237
  17. package/dist/bridge/template-modal.js +73 -28
  18. package/dist/bridge/template-modal.mjs +74 -29
  19. package/dist/dashboard/buttons-subscription.js +1 -1
  20. package/dist/dashboard/buttons-subscription.mjs +1 -1
  21. package/dist/dashboard/campaign-form.js +2 -7
  22. package/dist/dashboard/campaign-form.mjs +2 -7
  23. package/dist/dashboard/card-order.js +4 -22
  24. package/dist/dashboard/card-order.mjs +4 -22
  25. package/dist/dashboard/document-blocks.js +17 -4
  26. package/dist/dashboard/document-blocks.mjs +17 -4
  27. package/dist/dashboard/form-admin-provider.js +17 -71
  28. package/dist/dashboard/form-admin-provider.mjs +17 -71
  29. package/dist/dashboard/form-file-upload.js +2 -3
  30. package/dist/dashboard/form-file-upload.mjs +3 -4
  31. package/dist/dashboard/form-organization-campaign-advertisements.js +6 -47
  32. package/dist/dashboard/form-organization-campaign-advertisements.mjs +6 -47
  33. package/dist/dashboard/form-organization-campaign-agreement.js +121 -83
  34. package/dist/dashboard/form-organization-campaign-agreement.mjs +121 -83
  35. package/dist/dashboard/form-organization-campaign.js +0 -82
  36. package/dist/dashboard/form-organization-campaign.mjs +0 -81
  37. package/dist/dashboard/form-organization-connection.js +6 -48
  38. package/dist/dashboard/form-organization-connection.mjs +7 -48
  39. package/dist/dashboard/form-organization-workflow.js +1 -72
  40. package/dist/dashboard/form-organization-workflow.mjs +1 -69
  41. package/dist/dashboard/form-otc.js +5 -4
  42. package/dist/dashboard/form-otc.mjs +5 -4
  43. package/dist/dashboard/form-stripe.js +5 -12
  44. package/dist/dashboard/form-stripe.mjs +5 -12
  45. package/dist/dashboard/input-fields.js +158 -11
  46. package/dist/dashboard/input-fields.mjs +158 -11
  47. package/dist/dashboard/input-file.js +4 -21
  48. package/dist/dashboard/input-file.mjs +4 -21
  49. package/dist/dashboard/lib/connection-controls.js +2 -5
  50. package/dist/dashboard/lib/connection-controls.mjs +1 -3
  51. package/dist/dashboard/lib/form-page.js +1 -1
  52. package/dist/dashboard/lib/form-page.mjs +1 -1
  53. package/dist/dashboard/lib/uppy.js +1 -10
  54. package/dist/dashboard/lib/uppy.mjs +2 -11
  55. package/dist/dashboard/order-sections.js +6 -456
  56. package/dist/dashboard/order-sections.mjs +7 -453
  57. package/dist/dashboard/provider-ui.js +7 -9
  58. package/dist/dashboard/provider-ui.mjs +7 -9
  59. package/dist/dashboard/template-ui.js +12 -4
  60. package/dist/dashboard/template-ui.mjs +12 -4
  61. package/dist/input-checkbox.js +10 -28
  62. package/dist/input-checkbox.mjs +10 -28
  63. package/dist/product.js +24 -96
  64. package/dist/product.mjs +25 -97
  65. package/dist/shared/lib/helpers.js +6 -54
  66. package/dist/shared/lib/helpers.mjs +8 -53
  67. package/package.json +4 -74
  68. package/types/bridge/fields.d.ts +2 -14
  69. package/types/bridge/form-subdomain-shop-modal.d.ts +3 -27
  70. package/types/bridge/lib/age-gate.d.ts +0 -5
  71. package/types/bridge/lib/checkout-kit.d.ts +10 -2
  72. package/types/bridge/lib/entry.d.ts +0 -3
  73. package/types/dashboard/card-order.d.ts +0 -6
  74. package/types/dashboard/document-blocks.d.ts +3 -2
  75. package/types/dashboard/form-admin-provider.d.ts +2 -9
  76. package/types/dashboard/form-file-upload.d.ts +1 -2
  77. package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -3
  78. package/types/dashboard/form-organization-campaign-agreement.d.ts +5 -2
  79. package/types/dashboard/form-organization-campaign.d.ts +0 -3
  80. package/types/dashboard/form-organization-connection.d.ts +0 -11
  81. package/types/dashboard/form-otc.d.ts +1 -5
  82. package/types/dashboard/form-stripe.d.ts +2 -3
  83. package/types/dashboard/input-file.d.ts +0 -2
  84. package/types/dashboard/order-sections.d.ts +1 -24
  85. package/types/input-checkbox.d.ts +0 -2
  86. package/types/shared/lib/helpers.d.ts +0 -4
  87. package/dist/bridge/cart-drawer.js +0 -152
  88. package/dist/bridge/cart-drawer.mjs +0 -123
  89. package/dist/bridge/form-subdomain-checkout.js +0 -687
  90. package/dist/bridge/form-subdomain-checkout.mjs +0 -665
  91. package/dist/bridge/lib/cart.js +0 -79
  92. package/dist/bridge/lib/cart.mjs +0 -48
  93. package/dist/dashboard/embed-stripe.js +0 -145
  94. package/dist/dashboard/embed-stripe.mjs +0 -116
  95. package/dist/dashboard/form-organization-campaign-field-birthday.js +0 -193
  96. package/dist/dashboard/form-organization-campaign-field-birthday.mjs +0 -164
  97. package/dist/dashboard/form-organization-campaign-field-rating.js +0 -246
  98. package/dist/dashboard/form-organization-campaign-field-rating.mjs +0 -217
  99. package/dist/dashboard/form-organization-product.js +0 -1461
  100. package/dist/dashboard/form-organization-product.mjs +0 -1425
  101. package/dist/dashboard/input-gallery.js +0 -201
  102. package/dist/dashboard/input-gallery.mjs +0 -172
  103. package/dist/dashboard/lib/products.js +0 -169
  104. package/dist/dashboard/lib/products.mjs +0 -135
  105. package/dist/dashboard/lib/settings-paths.js +0 -35
  106. package/dist/dashboard/lib/settings-paths.mjs +0 -11
  107. package/dist/dashboard/shipping-rates.js +0 -404
  108. package/dist/dashboard/shipping-rates.mjs +0 -371
  109. package/dist/dashboard/template-buyer.js +0 -301
  110. package/dist/dashboard/template-buyer.mjs +0 -267
  111. package/dist/shared/order-summary.js +0 -139
  112. package/dist/shared/order-summary.mjs +0 -110
  113. package/types/bridge/cart-drawer.d.ts +0 -31
  114. package/types/bridge/form-subdomain-checkout.d.ts +0 -20
  115. package/types/bridge/lib/cart.d.ts +0 -44
  116. package/types/dashboard/embed-stripe.d.ts +0 -25
  117. package/types/dashboard/form-organization-campaign-field-birthday.d.ts +0 -31
  118. package/types/dashboard/form-organization-campaign-field-rating.d.ts +0 -33
  119. package/types/dashboard/form-organization-product.d.ts +0 -24
  120. package/types/dashboard/input-gallery.d.ts +0 -14
  121. package/types/dashboard/lib/products.d.ts +0 -14
  122. package/types/dashboard/lib/settings-paths.d.ts +0 -5
  123. package/types/dashboard/shipping-rates.d.ts +0 -26
  124. package/types/dashboard/template-buyer.d.ts +0 -50
  125. package/types/shared/order-summary.d.ts +0 -19
@@ -1,33 +0,0 @@
1
- import { ComponentType } from 'react';
2
-
3
- // @story fields/rating
4
- // What the Form page passes: the api's catalog entry (inputs, slug, type) plus
5
- // the route ids, and the saved field when editing. An input left out of
6
- // `inputs` renders disabled. A custom section's question only, never a prize's.
7
- export interface FormOrganizationCampaignFieldRatingValues {
8
- campaign: string;
9
- id?: string;
10
- inputs?: Array<'attributes' | 'label' | 'settings'>;
11
- organization: string;
12
- slug?: string;
13
- type?: 'additional';
14
- // Scale is attributes.max, 3 to 10, 5 to start; the Required switch, on to start.
15
- attributes?: { max?: number; required?: boolean };
16
- label?: string;
17
- // The words under 1 and under the highest number, up to 50 each.
18
- settings?: { high?: string | null; low?: string | null };
19
- // The custom section the question sits in.
20
- section?: string;
21
- [ key: string ]: unknown;
22
- }
23
-
24
- export interface FormOrganizationCampaignFieldRatingProps {
25
- disabled?: boolean;
26
- onError: ( error: Error ) => void;
27
- onSuccess: ( response: unknown ) => void;
28
- values: FormOrganizationCampaignFieldRatingValues;
29
- }
30
-
31
- declare const FormOrganizationCampaignFieldRating: ComponentType<FormOrganizationCampaignFieldRatingProps>;
32
-
33
- export default FormOrganizationCampaignFieldRating;
@@ -1,24 +0,0 @@
1
- import { ComponentType } from 'react';
2
-
3
- type Callback = ( response: unknown ) => void;
4
-
5
- interface Option { name: string; values: string[] }
6
-
7
- export declare const FormOrganizationProductCreate: ComponentType<{ campaign: string; onError: Callback; onSuccess: Callback; organization: string }>;
8
-
9
- export declare const FormProductOption: ComponentType<{ disabled?: boolean; onDone: ( option: Option ) => void; others?: Option[]; values?: Option }>;
10
-
11
- export declare const FormProductVariant: ComponentType<{ disabled?: boolean; onDone: ( values: Record<string, unknown> ) => void; values: Record<string, unknown> }>;
12
-
13
- // The product page's body. A product whose `editable` is false opens read only.
14
- export declare const FormOrganizationProduct: ComponentType<{
15
- campaign?: string;
16
- disabled?: boolean;
17
- onDelete?: () => void;
18
- onError: Callback;
19
- onSuccess: Callback;
20
- organization: { id: string; [ key: string ]: unknown };
21
- product: Record<string, unknown>;
22
- }>;
23
-
24
- export default FormOrganizationProduct;
@@ -1,14 +0,0 @@
1
- import { ComponentType } from 'react';
2
-
3
- // The gallery editor the page form and the product page share. It reads the
4
- // surrounding form through useFormContext.
5
- declare const InputGallery: ComponentType<{
6
- endpoint: string;
7
- label?: string | null;
8
- name?: string;
9
- onUpdate?: ( values: Record<string, unknown> ) => void;
10
- organization?: { id: string; [ key: string ]: unknown };
11
- reposition?: boolean;
12
- }>;
13
-
14
- export default InputGallery;
@@ -1,14 +0,0 @@
1
- // Where a campaign's shop sells, as the Checkout section names it.
2
- export declare const CHECKOUT_LABELS: Readonly<{ shopify: string; stripe: string }>;
3
- // The product editor's rules ( drawbridge-utils products underneath ).
4
- export declare const VARIANT_DEFAULTS: Readonly<Record<string, unknown>>;
5
- export declare const variantsFor: ( options: unknown[], variants: unknown[] ) => Record<string, unknown>[];
6
- export declare const moneyOf: ( value: number, currency?: string ) => string;
7
- export declare const priceText: ( variants?: unknown[] ) => string;
8
- export declare const variantRows: ( args: { expanded?: string[]; group?: string; options?: unknown[]; variants?: unknown[] } ) => Record<string, unknown>[];
9
- export declare const totalQuantity: ( variants?: unknown[] ) => number;
10
- export declare const variantCount: ( options?: unknown[] ) => number;
11
- export declare const productBody: ( values: Record<string, unknown> ) => Record<string, unknown>;
12
-
13
- // How many times a digital line was downloaded: '2 downloads', 'Not downloaded yet'.
14
- export declare const downloadsText: ( count: number ) => string;
@@ -1,5 +0,0 @@
1
- // The value at a dotted path ('plans.default.product'), or undefined.
2
- export declare const readPath: ( object: unknown, key: string ) => unknown;
3
-
4
- // [ [ 'a.b', 1 ], [ 'c', 2 ] ] becomes { a : { b : 1 }, c : 2 }.
5
- export declare const nestPaths: ( pairs: Array<[ string, unknown ]> ) => Record<string, unknown>;
@@ -1,26 +0,0 @@
1
- import { ComponentType } from 'react';
2
-
3
- export interface ShippingRate {
4
- country: 'CA' | 'US' | string;
5
- delivery?: { maximum: number; minimum: number } | null;
6
- free?: number | null;
7
- id?: string;
8
- name: string;
9
- price: number;
10
- }
11
-
12
- // New rate and Edit rate. POSTs ( no `values.id` ) or PUTs `endpoint`.
13
- export declare const FormRate: ComponentType<{ currency?: string; endpoint: string; onError?: ( error: unknown ) => void; onSuccess?: ( response: unknown ) => void; values?: ShippingRate }>;
14
-
15
- // The Stripe page's Shipping section: /organization/:organization/rates.
16
- export interface ShippingRatesProps {
17
- // The Stripe account's currency.
18
- currency?: string;
19
- // Manage access to Connections.
20
- manage?: boolean;
21
- organization: string;
22
- }
23
-
24
- declare const ShippingRates: ComponentType<ShippingRatesProps>;
25
-
26
- export default ShippingRates;
@@ -1,50 +0,0 @@
1
- import { ComponentType, ReactNode } from 'react';
2
-
3
- // @story orders/buyer-order
4
- export interface BuyerOrderLine {
5
- digital: boolean;
6
- index: number;
7
- price?: number | null;
8
- quantity?: number;
9
- title?: string | null;
10
- variantTitle?: string | null;
11
- }
12
-
13
- export interface BuyerOrderView {
14
- amounts?: { total?: number } | null;
15
- currency?: string;
16
- id: string;
17
- lines: BuyerOrderLine[];
18
- number?: string | null;
19
- organization?: string | null;
20
- payment?: string | null;
21
- purchasedAt?: string | Date | null;
22
- }
23
-
24
- export interface TemplateBuyerProps {
25
- children?: ReactNode;
26
- // Where the Drawbridge mark links.
27
- home?: string;
28
- isLoading?: boolean;
29
- }
30
-
31
- export interface BuyerOrderProps {
32
- // The line being downloaded, or null.
33
- downloading?: number | null;
34
- onDownload: ( index: number ) => void;
35
- order: BuyerOrderView;
36
- }
37
-
38
- export interface BuyerDownloadProps {
39
- // The buyer's order page, for View my order.
40
- href?: string;
41
- onRetry?: () => void;
42
- status?: 'starting' | 'expired' | 'failed' | 'refunded' | 'unavailable';
43
- }
44
-
45
- export declare const BuyerOrder: ComponentType<BuyerOrderProps>;
46
- export declare const BuyerDownload: ComponentType<BuyerDownloadProps>;
47
-
48
- declare const TemplateBuyer: ComponentType<TemplateBuyerProps>;
49
-
50
- export default TemplateBuyer;
@@ -1,19 +0,0 @@
1
- import type { FC } from 'react';
2
-
3
- export interface OrderSummaryLine {
4
- id: string;
5
- image?: string | null;
6
- name: string;
7
- note?: string | null;
8
- summary?: string | null;
9
- }
10
-
11
- export interface OrderSummaryProps {
12
- lines?: OrderSummaryLine[];
13
- // [ label, value ]; a null value shows a dash.
14
- rows?: [ string, string | null ][];
15
- }
16
-
17
- declare const OrderSummary: FC<OrderSummaryProps>;
18
-
19
- export default OrderSummary;