@commercelayer/app-elements 1.2.0 → 1.3.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/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ao as u, aX as i, ap as b, aq as p, ar as l, as as c, at as d, au as g, aY as m, av as S, aw as I, ah as k, aZ as T, a_ as D, a$ as R, ax as C, ak as y, ay as h, az as A, bb as H, bc as P, be as F, bg as B, bi as L, bm as O, bo as f, bv as v, bx as N, bE as V, bG as w, bI as G, bL as x, bP as E, bQ as M, aA as J, aB as U, bd as W, bf as Y, bh as Z, bj as $, bl as j, bn as q, bp as z, bq as K, br as Q, bs as X, bt as _, bu as aa, bw as ea, by as sa, bF as ta, bH as ra, bJ as oa, bK as na, bM as ua, bN as ia, bO as ba, b0 as pa, b1 as la, b2 as ca, b3 as da, al as ga, b4 as ma, aC as Sa, b5 as Ia, b6 as ka, aD as Ta, aE as Da, aF as Ra, b7 as Ca, bT as ya, bU as ha, bV as Aa, bW as Ha, bX as Pa, bY as Fa, bZ as Ba, b_ as La, b$ as Oa, b8 as fa, aG as va, aH as Na, aI as Va, aJ as wa, aL as Ga, aM as xa, aN as Ea, aO as Ma, aT as Ja, aP as Ua, b9 as Wa, aU as Ya, aV as Za, aQ as $a, aW as ja, aR as qa, ba as za, am as Ka, aS as Qa, a2 as Xa, a1 as _a, bz as ae, bk as ee, W as se, a3 as te, a4 as re, a5 as oe, c1 as ne, c2 as ue, bA as ie, Y as be, Z as pe, c3 as le, c4 as ce, c5 as de, c6 as ge, c7 as me, c8 as Se, a6 as Ie, a7 as ke, c9 as Te, ca as De, cb as Re, a8 as Ce, a9 as ye, S as he, aa as Ae, ab as He, U as Pe, bB as Fe, bC as Be, bD as Le, T as Oe, V as fe, bR as ve, $ as Ne, a0 as Ve, ac as we, ai as Ge, aj as xe, ad as Ee, ae as Me, af as Je, ag as Ue, c0 as We, an as Ye, bS as Ze, aK as $e } from "./main-7df8201b.js";
1
+ import { ao as u, aX as i, ap as b, aq as p, ar as l, as as c, at as d, au as g, aY as m, av as S, aw as I, ah as k, aZ as T, a_ as D, a$ as R, ax as C, ak as y, ay as h, az as A, bb as H, bc as P, be as F, bg as B, bi as L, bm as O, bo as f, bv as v, bx as N, bE as V, bG as w, bI as G, bL as x, bP as E, bQ as M, aA as J, aB as U, bd as W, bf as Y, bh as Z, bj as $, bl as j, bn as q, bp as z, bq as K, br as Q, bs as X, bt as _, bu as aa, bw as ea, by as sa, bF as ta, bH as ra, bJ as oa, bK as na, bM as ua, bN as ia, bO as ba, b0 as pa, b1 as la, b2 as ca, b3 as da, al as ga, b4 as ma, aC as Sa, b5 as Ia, b6 as ka, aD as Ta, aE as Da, aF as Ra, b7 as Ca, bT as ya, bU as ha, bV as Aa, bW as Ha, bX as Pa, bY as Fa, bZ as Ba, b_ as La, b$ as Oa, b8 as fa, aG as va, aH as Na, aI as Va, aJ as wa, aL as Ga, aM as xa, aN as Ea, aO as Ma, aT as Ja, aP as Ua, b9 as Wa, aU as Ya, aV as Za, aQ as $a, aW as ja, aR as qa, ba as za, am as Ka, aS as Qa, a2 as Xa, a1 as _a, bz as ae, bk as ee, W as se, a3 as te, a4 as re, a5 as oe, c1 as ne, c2 as ue, bA as ie, Y as be, Z as pe, c3 as le, c4 as ce, c5 as de, c6 as ge, c7 as me, c8 as Se, a6 as Ie, a7 as ke, c9 as Te, ca as De, cb as Re, a8 as Ce, a9 as ye, S as he, aa as Ae, ab as He, U as Pe, bB as Fe, bC as Be, bD as Le, T as Oe, V as fe, bR as ve, $ as Ne, a0 as Ve, ac as we, ai as Ge, aj as xe, ad as Ee, ae as Me, af as Je, ag as Ue, c0 as We, an as Ye, bS as Ze, aK as $e } from "./main-dc5c490a.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  import "@commercelayer/sdk";
@@ -481,4 +481,76 @@ export declare const presetLineItems: {
481
481
  reference_origin: null;
482
482
  metadata: {};
483
483
  };
484
+ adjustmentAdditionalService: {
485
+ type: "line_items";
486
+ id: string;
487
+ sku_code: null;
488
+ bundle_code: null;
489
+ quantity: number;
490
+ currency_code: string;
491
+ unit_amount_cents: number;
492
+ unit_amount_float: number;
493
+ formatted_unit_amount: string;
494
+ options_amount_cents: number;
495
+ options_amount_float: number;
496
+ formatted_options_amount: string;
497
+ discount_cents: number;
498
+ discount_float: number;
499
+ formatted_discount: string;
500
+ total_amount_cents: number;
501
+ total_amount_float: number;
502
+ formatted_total_amount: string;
503
+ tax_amount_cents: number;
504
+ tax_amount_float: number;
505
+ formatted_tax_amount: string;
506
+ name: string;
507
+ image_url: null;
508
+ discount_breakdown: {};
509
+ tax_rate: number;
510
+ tax_breakdown: {};
511
+ item_type: "adjustments";
512
+ frequency: null;
513
+ coupon_code: null;
514
+ created_at: string;
515
+ updated_at: string;
516
+ reference: null;
517
+ reference_origin: null;
518
+ metadata: {};
519
+ };
520
+ manualAdjustment: {
521
+ type: "line_items";
522
+ id: string;
523
+ sku_code: null;
524
+ bundle_code: null;
525
+ quantity: number;
526
+ currency_code: string;
527
+ unit_amount_cents: number;
528
+ unit_amount_float: number;
529
+ formatted_unit_amount: string;
530
+ options_amount_cents: number;
531
+ options_amount_float: number;
532
+ formatted_options_amount: string;
533
+ discount_cents: number;
534
+ discount_float: number;
535
+ formatted_discount: string;
536
+ total_amount_cents: number;
537
+ total_amount_float: number;
538
+ formatted_total_amount: string;
539
+ tax_amount_cents: number;
540
+ tax_amount_float: number;
541
+ formatted_tax_amount: string;
542
+ name: string;
543
+ image_url: null;
544
+ discount_breakdown: {};
545
+ tax_rate: number;
546
+ tax_breakdown: {};
547
+ item_type: "adjustments";
548
+ frequency: null;
549
+ coupon_code: null;
550
+ created_at: string;
551
+ updated_at: string;
552
+ reference: null;
553
+ reference_origin: string;
554
+ metadata: {};
555
+ };
484
556
  };
@@ -2,9 +2,13 @@ import { type ActionButtonsProps } from '../../composite/ActionButtons';
2
2
  import type { Order } from '@commercelayer/sdk';
3
3
  import { type ComponentProps } from 'react';
4
4
  export interface Props {
5
+ /** When `true` the order summary renders with editable components. You will be able to update line items quantity, delete a line item, add/remove coupon, and more. */
5
6
  editable?: boolean;
7
+ /** The event gets triggered every time a change occurs. (e.g. add/remove coupon, update/remove line items, etc.) */
6
8
  onChange?: () => void;
9
+ /** A list of `ActionButtons` components. */
7
10
  footerActions?: ActionButtonsProps['actions'];
11
+ /** The `Order` resource. */
8
12
  order: Order;
9
13
  }
10
14
  export type ResourceOrderSummaryProps = ComponentProps<typeof ResourceOrderSummary>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { Order } from '@commercelayer/sdk';
2
+ import type { LineItem, Order } from '@commercelayer/sdk';
3
3
  interface TotalRowProps {
4
4
  /** Displayed label */
5
5
  label: string;
@@ -20,4 +20,7 @@ export declare function renderTotalRow({ label, value, bold }: {
20
20
  }): JSX.Element;
21
21
  export declare function renderTotalRowAmount({ label, formattedAmount, force, bold }: TotalRowProps): JSX.Element | null;
22
22
  export declare function renderDiscounts(order: Order): JSX.Element | null;
23
+ export declare const manualAdjustmentReferenceOrigin = "app-orders--manual-adjustment";
24
+ export declare function getManualAdjustment(order: Order): LineItem | undefined;
25
+ export declare function renderAdjustments(order: Order): JSX.Element | null;
23
26
  export {};
@@ -4,4 +4,4 @@ export declare function enforceAllowedTags<AllowedTags extends ReadonlyArray<key
4
4
  allowedTags: AllowedTags;
5
5
  defaultTag: DefaultTag;
6
6
  }): Tag | DefaultTag;
7
- export declare function removeTagProp<T extends object>(props: T): Omit<T, 'tag'>;
7
+ export declare function removeUnwantedProps<P extends object, U extends keyof P>(props: P, unwantedProps: U[]): Omit<P, (typeof unwantedProps)[number]>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/app-elements",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [