@spiffcommerce/core 16.0.0 → 16.0.2-alpha.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.js CHANGED
@@ -1,15 +1,15 @@
1
- import { createHttpLink as ht, InMemoryCache as Ct, ApolloClient as Qt, from as ut, gql as y } from "@apollo/client/core";
2
- import { getAttributesFromArrayBuffer as Ie, AssetType as ce, StepType as D, StepAspectType as O, getFrameData as Ae, frameDataCache as mt, UpdateFramePattern as De, calculateOffsets as ee, LayoutElementType as P, generate as v, CreateElementCommand as b, generateSVGWithUnknownColors as fe, svgObjectURL as nA, fetchAsString as Z, DeleteElementCommand as $, GroupCommand as G, generateDefaultRectangleFrameSvg as ge, GetSVGDimensions as pt, patternImageDataCache as le, fetchAsArrayBuffer as Fe, findElement as MA, modifySVGWithElementProperties as It, IllustrationColorCommand as VA, IllustrationCacheCommand as Dt, getFontMetrics as ft, getPatternImageData as WA, FontColorCommand as Ft, FontImageFillCommand as TA, applyTextTransformations as XA, determineCorrectFontSizeAndLines as IA, FontSourceCommand as Be, loadFontFromExternalUrl as DA, TextChangeCommand as Mt, FontSizeCommand as yt, createElementNS as Yt, createElement as wA, loadFontFromDataUrl as UA, UpdateWorkflowStateCommand as de, CommandContext as St, createCanvas as yA, getSvgElement as Me, LayoutRenderingPurpose as ye, renderPapyrusComponentAsString as Ye, loadImage as Se, getDomParser as xe, fetch as Ne, toBase64 as we, getVariant as xt, generateFrameSVG as Nt, getDefaultVariant as GA, domParser as Re, sanitizeSvgTree as He, traverse as Rt, xmlSerializer as Pe, arrayBufferToDataUrl as Ht, loadFontFaceSet as Pt, CreateLayoutCommand as Ut, sortElementsByLayersWithIndex as Gt, AspectType as fA, rehydrateSerializedLayout as AA } from "@spiffcommerce/papyrus";
3
- import { AssetType as ks, BringForwardCommand as Js, BringToBackCommand as bs, BringToFrontCommand as Ts, CanvasCommand as Ls, CommandContext as Os, CreateElementCommand as zs, CreateLayoutCommand as Ks, DeleteElementCommand as js, FontAlignmentCommand as Vs, FontColorCommand as Ws, FontSizeCommand as Xs, FontSourceCommand as qs, GroupCommand as Zs, LayoutElementFactory as $s, LayoutElementType as _s, MoveCommand as Ai, ResizeCommand as ei, RotateCommand as ti, SendBackwardsCommand as ai, StepAspectType as ni, StepType as si, TextChangeCommand as ii, UnitOfMeasurement as oi, dataUrlFromExternalUrl as ri, determineCorrectFontSizeAndLines as ci, findElement as gi, frameDataCache as li, generate as Bi, generateSVGWithUnknownColors as di, getAttributesFromArrayBuffer as wi, getAxisAlignedBoundingBox as Ei, getFrameData as hi, getSvgElement as Ci, loadFontFromDataUrl as Qi, loadFontFromExternalUrl as ui, patternImageDataCache as mi, registerFetchImplementation as pi, registerWindowImplementation as Ii, rehydrateSerializedLayout as Di } from "@spiffcommerce/papyrus";
4
- import { setContext as vt } from "@apollo/client/link/context";
5
- import { onError as kt } from "@apollo/client/link/error";
6
- import { Pith as Ue } from "pith";
7
- import Ge from "lodash.debounce";
8
- import ve from "lodash.isequal";
9
- import gA from "lodash.clonedeep";
10
- import { toString as ke } from "qrcode";
11
- import { split as qA } from "unicode-default-word-boundary";
12
- import te from "svg-path-bbox";
1
+ import { createHttpLink as ht, InMemoryCache as Ct, ApolloClient as Qt, from as ut, gql as y } from "@apollo/client/core/index.js";
2
+ import { getAttributesFromArrayBuffer as Ie, AssetType as ce, StepType as D, StepAspectType as O, getFrameData as Ae, frameDataCache as mt, UpdateFramePattern as De, calculateOffsets as ee, LayoutElementType as P, generate as v, CreateElementCommand as b, generateSVGWithUnknownColors as fe, svgObjectURL as nA, fetchAsString as Z, DeleteElementCommand as $, GroupCommand as G, generateDefaultRectangleFrameSvg as ge, GetSVGDimensions as pt, patternImageDataCache as le, fetchAsArrayBuffer as Fe, findElement as MA, modifySVGWithElementProperties as It, IllustrationColorCommand as VA, IllustrationCacheCommand as Dt, getFontMetrics as ft, getPatternImageData as WA, FontColorCommand as Ft, FontImageFillCommand as TA, applyTextTransformations as XA, determineCorrectFontSizeAndLines as IA, FontSourceCommand as Be, loadFontFromExternalUrl as DA, TextChangeCommand as Mt, FontSizeCommand as yt, createElementNS as Yt, createElement as wA, loadFontFromDataUrl as UA, UpdateWorkflowStateCommand as de, CommandContext as St, createCanvas as yA, getSvgElement as Me, LayoutRenderingPurpose as ye, renderPapyrusComponentAsString as Ye, loadImage as Se, getDomParser as xe, fetch as Ne, toBase64 as we, getVariant as xt, generateFrameSVG as Nt, getDefaultVariant as GA, domParser as Re, sanitizeSvgTree as He, traverse as Rt, xmlSerializer as Pe, arrayBufferToDataUrl as Ht, loadFontFaceSet as Pt, CreateLayoutCommand as Ut, sortElementsByLayersWithIndex as Gt, AspectType as fA, rehydrateSerializedLayout as AA } from "@spiffcommerce/papyrus/dist/index.js";
3
+ import { AssetType as ks, BringForwardCommand as Js, BringToBackCommand as bs, BringToFrontCommand as Ts, CanvasCommand as Ls, CommandContext as Os, CreateElementCommand as zs, CreateLayoutCommand as Ks, DeleteElementCommand as js, FontAlignmentCommand as Vs, FontColorCommand as Ws, FontSizeCommand as Xs, FontSourceCommand as qs, GroupCommand as Zs, LayoutElementFactory as $s, LayoutElementType as _s, MoveCommand as Ai, ResizeCommand as ei, RotateCommand as ti, SendBackwardsCommand as ai, StepAspectType as ni, StepType as si, TextChangeCommand as ii, UnitOfMeasurement as oi, dataUrlFromExternalUrl as ri, determineCorrectFontSizeAndLines as ci, findElement as gi, frameDataCache as li, generate as Bi, generateSVGWithUnknownColors as di, getAttributesFromArrayBuffer as wi, getAxisAlignedBoundingBox as Ei, getFrameData as hi, getSvgElement as Ci, loadFontFromDataUrl as Qi, loadFontFromExternalUrl as ui, patternImageDataCache as mi, registerFetchImplementation as pi, registerWindowImplementation as Ii, rehydrateSerializedLayout as Di } from "@spiffcommerce/papyrus/dist/index.js";
4
+ import { setContext as vt } from "@apollo/client/link/context/index.js";
5
+ import { onError as kt } from "@apollo/client/link/error/index.js";
6
+ import { Pith as Ue } from "pith/dist/index.js";
7
+ import Ge from "lodash.debounce/index.js";
8
+ import ve from "lodash.isequal/index.js";
9
+ import gA from "lodash.clonedeep/index.js";
10
+ import { toString as ke } from "qrcode/lib/browser.js";
11
+ import { split as qA } from "unicode-default-word-boundary/lib/index.js";
12
+ import te from "svg-path-bbox/dist/wrapper.js";
13
13
  class Je extends Error {
14
14
  constructor(A) {
15
15
  super(A), this.name = this.constructor.name;
@@ -6369,7 +6369,7 @@ const rt = y`
6369
6369
  const s = {};
6370
6370
  if (n.type === "Frame") {
6371
6371
  const i = g[n.stepName], o = n.data;
6372
- if (!i || o.hideImageInCart && e)
6372
+ if (!i || !i.image || o.hideImageInCart && e)
6373
6373
  return s;
6374
6374
  s[`${n.stepTitle} image`] = i.image;
6375
6375
  }
@@ -6384,7 +6384,7 @@ const rt = y`
6384
6384
  }
6385
6385
  if (n.type === "Module") {
6386
6386
  const i = g[n.stepName], o = n.data;
6387
- if (!i || o.hideTextInCart && e)
6387
+ if (!i || i.text === void 0 || i.text === null || o.hideTextInCart && e)
6388
6388
  return s;
6389
6389
  s[`${n.stepTitle} text`] = i.text;
6390
6390
  }
@@ -6393,7 +6393,7 @@ const rt = y`
6393
6393
  if (!i)
6394
6394
  return s;
6395
6395
  const o = n.data;
6396
- (!o.hideTextInCart || !e) && (s[`${n.stepTitle} text`] = i.text), i.color && (!o.hideColorInCart || !e) && (s[`${n.stepTitle} color`] = i.color);
6396
+ (!o.hideTextInCart || !e && i.text !== void 0 && i.text !== null) && (s[`${n.stepTitle} text`] = i.text), i.color && (!o.hideColorInCart || !e) && (s[`${n.stepTitle} color`] = i.color);
6397
6397
  }
6398
6398
  return s;
6399
6399
  }, a = {};