@crystaldesign/diva-utils 26.13.0-beta.2 → 26.13.0-beta.20

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.
@@ -1647,6 +1647,36 @@ function parseFieldValue(value) {
1647
1647
  return value;
1648
1648
  }
1649
1649
 
1650
+ /**
1651
+ * A text as lines of at most `width` characters: one line per line break, a longer line broken at the last space
1652
+ * within the width (the space itself is dropped), a word longer than the width cut at it. This is how a target
1653
+ * system with a fixed line width takes a text line by line (e.g. SAP long texts, one item per line) — the
1654
+ * spreadsheet's multiline cell editor counts these lines against its `maxLines`, diva-pfister-article sends them to
1655
+ * SAP, so both have to wrap with this one function.
1656
+ */
1657
+ function wrapTextLines(text, width) {
1658
+ return text.split(/\r\n|\n|\r/).flatMap(function (line) {
1659
+ var lines = [];
1660
+ var rest = line;
1661
+ while (rest.length > width) {
1662
+ var space = rest.lastIndexOf(' ', width);
1663
+ if (space > 0) {
1664
+ lines.push(rest.slice(0, space));
1665
+ rest = rest.slice(space + 1);
1666
+ continue;
1667
+ }
1668
+ // Never split a surrogate pair (e.g. an emoji) into two lines: half a pair is no character, and XML does not
1669
+ // allow an isolated surrogate
1670
+ var lastCode = rest.charCodeAt(width - 1);
1671
+ var cut = lastCode >= 0xd800 && lastCode <= 0xdbff ? width - 1 : width;
1672
+ lines.push(rest.slice(0, cut));
1673
+ rest = rest.slice(cut);
1674
+ }
1675
+ lines.push(rest);
1676
+ return lines;
1677
+ });
1678
+ }
1679
+
1650
1680
  exports.DivaError = DivaError;
1651
1681
  exports.UTMUtils = UTMUtils;
1652
1682
  exports.UtmCampaign = UtmCampaign;
@@ -1657,3 +1687,4 @@ exports["default"] = DivaUtils$1;
1657
1687
  exports.md5 = md5;
1658
1688
  exports.nanoid = nanoid;
1659
1689
  exports.parseFilterParam = parseFilterParam;
1690
+ exports.wrapTextLines = wrapTextLines;
@@ -1628,4 +1628,34 @@ function parseFieldValue(value) {
1628
1628
  return value;
1629
1629
  }
1630
1630
 
1631
- export { DivaError, UTMUtils, UtmCampaign, UtmContent, UtmMedium, UtmSource, DivaUtils$1 as default, md5, nanoid, parseFilterParam };
1631
+ /**
1632
+ * A text as lines of at most `width` characters: one line per line break, a longer line broken at the last space
1633
+ * within the width (the space itself is dropped), a word longer than the width cut at it. This is how a target
1634
+ * system with a fixed line width takes a text line by line (e.g. SAP long texts, one item per line) — the
1635
+ * spreadsheet's multiline cell editor counts these lines against its `maxLines`, diva-pfister-article sends them to
1636
+ * SAP, so both have to wrap with this one function.
1637
+ */
1638
+ function wrapTextLines(text, width) {
1639
+ return text.split(/\r\n|\n|\r/).flatMap(function (line) {
1640
+ var lines = [];
1641
+ var rest = line;
1642
+ while (rest.length > width) {
1643
+ var space = rest.lastIndexOf(' ', width);
1644
+ if (space > 0) {
1645
+ lines.push(rest.slice(0, space));
1646
+ rest = rest.slice(space + 1);
1647
+ continue;
1648
+ }
1649
+ // Never split a surrogate pair (e.g. an emoji) into two lines: half a pair is no character, and XML does not
1650
+ // allow an isolated surrogate
1651
+ var lastCode = rest.charCodeAt(width - 1);
1652
+ var cut = lastCode >= 0xd800 && lastCode <= 0xdbff ? width - 1 : width;
1653
+ lines.push(rest.slice(0, cut));
1654
+ rest = rest.slice(cut);
1655
+ }
1656
+ lines.push(rest);
1657
+ return lines;
1658
+ });
1659
+ }
1660
+
1661
+ export { DivaError, UTMUtils, UtmCampaign, UtmContent, UtmMedium, UtmSource, DivaUtils$1 as default, md5, nanoid, parseFilterParam, wrapTextLines };
@@ -10,6 +10,7 @@ export { DivaError };
10
10
  export * from './utils/UTMUtils';
11
11
  export * from './utils/UTMUtils/types';
12
12
  export * from './utils/parseFilterParam';
13
+ export * from './utils/wrapTextLines';
13
14
  export type { EventAction, EventModule, PriceFormat, ApplicationLoggerInterface, PfisterEventAction };
14
15
  export type { Query, FilterQuery, FilterField, FilterGroup, Sort, Facets, QueryResult } from './types/FilterParamTypes';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC;AAEzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,CAAC;AACtG,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC;AAEzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,CAAC;AACtG,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wrapTextLines.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapTextLines.test.d.ts","sourceRoot":"","sources":["../../../../../src/tests/wrapTextLines.test.ts"],"names":[],"mappings":""}
@@ -8,7 +8,7 @@ interface Organization {
8
8
  name?: string;
9
9
  }
10
10
  export type PfisterEventAction = 'onFullScreen' | 'onClose' | 'onReset' | 'onHelpPlanner' | 'onSharePlanner' | 'onPrintPlanner' | 'onSavePlanner' | 'onRequestConsulation' | 'onClickToCall' | 'onSave' | 'onShow3DCOMB' | 'onShowRTV' | 'onShow3D' | 'onShow2D';
11
- export type EventAction = 'onPageOpen' | 'onOpenModule' | 'onRequestRendering' | 'onClose' | 'onSuccessLogin' | 'onCreatePriceSign' | 'onCreateQrCode' | 'onNewLeadGenerated' | 'onInitializeConfigurator' | 'onReinitializeConfigurator' | 'onInitGenericData' | 'onTabGroupStep' | 'onAddPlanner' | 'onSwitchPlanner' | 'onDeletePlanner' | 'onEnterPlanner' | 'onExitPlanner' | 'onEnterConfigurator' | 'onExitConfigurator' | 'onEnterAccessories' | 'onExitAccessories' | 'onEnterSummary' | 'onExitSummary' | 'onInitARViewer' | 'onConfiguratorStep' | 'onDimensoinVisualization' | 'onVisualizationChange' | 'onRoomVisualization' | 'onShareStep' | 'onConsultancyStep' | 'onLoadInfoBox' | 'onSelectCollection' | 'onSelectCatalog' | 'onUpdateAccessoireQuantity' | 'onRequestRendering' | 'onBasketStep' | 'onLoadProdukt' | 'onLoadCustomProdukt' | 'onLoadArticle' | 'onActualBasketValue' | 'onClickAccesorie' | 'onClickArticle' | 'onLoadProductPDP' | 'onOpenPDP' | 'onPlannerCheckoutAction' | 'onPlannerShareConfiguration' | 'onPlannerClickToCall' | 'onPlannerCreateAppointment' | 'onPlannerSaveEMail' | 'onPlannerOpenPDF' | 'onWidgetProductSelected' | 'onWidgetInitialProduct' | 'onInitOptions' | 'onInitPlanner' | 'onConfigurationChange' | 'onConfigurationInit' | 'onLeadKeyGenerated';
11
+ export type EventAction = 'onPageOpen' | 'onOpenModule' | 'onRequestRendering' | 'onClose' | 'onSuccessLogin' | 'onCreatePriceSign' | 'onCreateQrCode' | 'onNewLeadGenerated' | 'onInitializeConfigurator' | 'onReinitializeConfigurator' | 'onInitSellerBasket' | 'onInitGenericData' | 'onTabGroupStep' | 'onAddPlanner' | 'onSwitchPlanner' | 'onDeletePlanner' | 'onEnterPlanner' | 'onExitPlanner' | 'onEnterConfigurator' | 'onExitConfigurator' | 'onEnterAccessories' | 'onExitAccessories' | 'onEnterSummary' | 'onExitSummary' | 'onInitARViewer' | 'onConfiguratorStep' | 'onDimensoinVisualization' | 'onVisualizationChange' | 'onRoomVisualization' | 'onShareStep' | 'onConsultancyStep' | 'onLoadInfoBox' | 'onSelectCollection' | 'onSelectCatalog' | 'onUpdateAccessoireQuantity' | 'onRequestRendering' | 'onBasketStep' | 'onLoadProdukt' | 'onLoadCustomProdukt' | 'onLoadArticle' | 'onActualBasketValue' | 'onClickAccesorie' | 'onClickArticle' | 'onLoadProductPDP' | 'onOpenPDP' | 'onPlannerCheckoutAction' | 'onPlannerShareConfiguration' | 'onPlannerClickToCall' | 'onPlannerCreateAppointment' | 'onPlannerSaveEMail' | 'onPlannerOpenPDF' | 'onWidgetProductSelected' | 'onWidgetInitialProduct' | 'onInitOptions' | 'onInitPlanner' | 'onConfigurationChange' | 'onConfigurationInit' | 'onLeadKeyGenerated';
12
12
  export type EventModule = 'AIInspire' | 'Framework' | 'FrameworkNavigation' | 'LandingPage' | 'StartPage' | 'Seller' | 'SellerCollections' | 'SellerCatalogs' | 'SellerCatalogInfo' | 'SellerArticles' | 'SellerBasket' | 'SellerCheckout' | 'SellerArchiv' | 'ContentBox' | 'Products' | 'Productlist' | 'ProductDetailPage' | 'PDP' | 'Planner' | 'PlannerHandler2D' | 'PlannerConfig' | 'PlannerSummary' | 'Backoffice' | 'BackofficeNew' | 'DataEngine' | 'UserManager' | 'CategoryManager' | 'AssortmentManager' | 'Chat' | 'PDFViewer' | 'MediaViewer' | 'Report' | 'Story' | 'Auth' | 'OpenUrl' | 'OpenUrlNewTab' | 'Test' | 'Productgallery' | 'ARViewer' | 'DivaStartPage' | 'Undefined' | 'Classification' | 'RealTimeViewer' | 'Analytics' | 'AGGrid' | 'InfoBox' | 'OrderEntry' | 'Core' | 'DivaWidget' | 'ProductDetailPage' | 'AssetManager' | 'AiProductPhotos' | 'MultiPlanner' | 'MassConfigurator';
13
13
  export declare class BusinessMetricsUtils {
14
14
  private _sessionId;
@@ -1 +1 @@
1
- {"version":3,"file":"BusinessMetricsUtils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/BusinessMetricsUtils.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,EAAE,GAAG,EAAE,CAAC;KAClB;CACF;AA8DD,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,SAAS,GACT,SAAS,GACT,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,sBAAsB,GACtB,eAAe,GACf,QAAQ,GACR,cAAc,GACd,WAAW,GACX,UAAU,GACV,UAAU,CAAC;AAIf,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,cAAc,GACd,oBAAoB,GACpB,SAAS,GACT,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GAGpB,0BAA0B,GAC1B,4BAA4B,GAC5B,mBAAmB,GACnB,gBAAgB,GAChB,cAAc,GACd,iBAAiB,GACjB,iBAAiB,GACjB,gBAA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,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE;IAWpE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAQvD,OAAO,CAAC,SAAS;IAgBV,MAAM;IAIN,OAAO;IAID,QAAQ,CACnB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,GAAG,CAAA;KAAE;IAKlD,wBAAwB,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,iBAAiB,GAAE,OAAe;IASxE,uBAAuB,CAAC,SAAS,EAAE,MAAM;IAI/C,wBAAwB;YAIjB,KAAK;YA0DL,cAAc;YAYd,GAAG;CA2BlB"}
1
+ {"version":3,"file":"BusinessMetricsUtils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/BusinessMetricsUtils.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,EAAE,GAAG,EAAE,CAAC;KAClB;CACF;AA8DD,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,SAAS,GACT,SAAS,GACT,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,sBAAsB,GACtB,eAAe,GACf,QAAQ,GACR,cAAc,GACd,WAAW,GACX,UAAU,GACV,UAAU,CAAC;AAIf,MAAM,MAAM,WAAW,GACnB,YAAY,GACZ,cAAc,GACd,oBAAoB,GACpB,SAAS,GACT,gBAAgB,GAChB,mBAAmB,GACnB,gBAAgB,GAChB,oBAAoB,GAGpB,0BAA0B,GAC1B,4BAA4B,GAC5B,oBAAoB,GACpB,mBAAmB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C,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA6ClC,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE;IAWpE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;IAQvD,OAAO,CAAC,SAAS;IAgBV,MAAM;IAIN,OAAO;IAID,QAAQ,CACnB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,GAAG,CAAA;KAAE;IAKlD,wBAAwB,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,iBAAiB,GAAE,OAAe;IASxE,uBAAuB,CAAC,SAAS,EAAE,MAAM;IAI/C,wBAAwB;YAIjB,KAAK;YA0DL,cAAc;YAYd,GAAG;CA2BlB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A text as lines of at most `width` characters: one line per line break, a longer line broken at the last space
3
+ * within the width (the space itself is dropped), a word longer than the width cut at it. This is how a target
4
+ * system with a fixed line width takes a text line by line (e.g. SAP long texts, one item per line) — the
5
+ * spreadsheet's multiline cell editor counts these lines against its `maxLines`, diva-pfister-article sends them to
6
+ * SAP, so both have to wrap with this one function.
7
+ */
8
+ export declare function wrapTextLines(text: string, width: number): string[];
9
+ //# sourceMappingURL=wrapTextLines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapTextLines.d.ts","sourceRoot":"","sources":["../../../../../src/utils/wrapTextLines.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqBnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-utils",
3
- "version": "26.13.0-beta.2",
3
+ "version": "26.13.0-beta.20",
4
4
  "description": "Shared frontend utilities: hashing, nanoid, UTM handling, filter parsing and DivaError.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -24,5 +24,9 @@
24
24
  "module": "build/esm/index.js",
25
25
  "types": "./build/types/utils/src/index.d.ts",
26
26
  "main": "build/cjs/index.js",
27
- "gitHead": "80503e32af3f8fc88ae4f632f1153cc6d0abec08"
27
+ "jest-junit": {
28
+ "suiteName": "diva-utils",
29
+ "outputDirectory": "./test-reports"
30
+ },
31
+ "gitHead": "c2ccbc73d9da6d31fffaa527bfc490f3d2d57d01"
28
32
  }