@rebuy/rebuy 3.60.4 → 3.60.5
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/server/index.cjs
CHANGED
|
@@ -3600,7 +3600,7 @@ var containsHtml = (text) => HTML_TAG_RE2.test(text);
|
|
|
3600
3600
|
var isObject = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
|
|
3601
3601
|
var normalizeTextValue = (value, options2 = {}) => {
|
|
3602
3602
|
const tokenized = normalizeTokens(value);
|
|
3603
|
-
return containsHtml(tokenized) || options2.defaultTextStyle ? htmlToTiptap(tokenized, options2) : decodeTextEntities(tokenized);
|
|
3603
|
+
return containsHtml(tokenized) || options2.defaultTextStyle || options2.blockSpacing ? htmlToTiptap(tokenized, options2) : decodeTextEntities(tokenized);
|
|
3604
3604
|
};
|
|
3605
3605
|
var normalizeLangValue = (value) => typeof value === "string" ? normalizeTextValue(value) : value;
|
|
3606
3606
|
var normalizeTextContent = (node) => {
|
|
@@ -5844,7 +5844,7 @@ var label = (text) => ({
|
|
|
5844
5844
|
content: { en: text },
|
|
5845
5845
|
sectionType: SectionType.text
|
|
5846
5846
|
});
|
|
5847
|
-
var AS_DOC = { defaultTextStyle: {} };
|
|
5847
|
+
var AS_DOC = { blockSpacing: Spacing.none, defaultTextStyle: {} };
|
|
5848
5848
|
var safeTextValue = (raw, options2) => {
|
|
5849
5849
|
const converted = normalizeTextValue(raw, options2);
|
|
5850
5850
|
return checkForHTML(converted) ? converted : normalizeTextValue(htmlToPlainText(raw), options2);
|
|
@@ -5872,7 +5872,7 @@ var dspLabel = (raw, fallback) => ({
|
|
|
5872
5872
|
sectionType: SectionType.text
|
|
5873
5873
|
});
|
|
5874
5874
|
var smallText = (raw) => ({
|
|
5875
|
-
content: { en: safeTextValue(raw, { defaultTextStyle: { fontSize: "small" } }) },
|
|
5875
|
+
content: { en: safeTextValue(raw, { blockSpacing: Spacing.none, defaultTextStyle: { fontSize: "small" } }) },
|
|
5876
5876
|
sectionType: SectionType.text
|
|
5877
5877
|
});
|
|
5878
5878
|
var styled = (value, { align, bold, color, fontSize, href }) => ({
|
package/dist/server/index.mjs
CHANGED
|
@@ -3527,7 +3527,7 @@ var containsHtml = (text) => HTML_TAG_RE2.test(text);
|
|
|
3527
3527
|
var isObject = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
|
|
3528
3528
|
var normalizeTextValue = (value, options2 = {}) => {
|
|
3529
3529
|
const tokenized = normalizeTokens(value);
|
|
3530
|
-
return containsHtml(tokenized) || options2.defaultTextStyle ? htmlToTiptap(tokenized, options2) : decodeTextEntities(tokenized);
|
|
3530
|
+
return containsHtml(tokenized) || options2.defaultTextStyle || options2.blockSpacing ? htmlToTiptap(tokenized, options2) : decodeTextEntities(tokenized);
|
|
3531
3531
|
};
|
|
3532
3532
|
var normalizeLangValue = (value) => typeof value === "string" ? normalizeTextValue(value) : value;
|
|
3533
3533
|
var normalizeTextContent = (node) => {
|
|
@@ -5771,7 +5771,7 @@ var label = (text) => ({
|
|
|
5771
5771
|
content: { en: text },
|
|
5772
5772
|
sectionType: SectionType.text
|
|
5773
5773
|
});
|
|
5774
|
-
var AS_DOC = { defaultTextStyle: {} };
|
|
5774
|
+
var AS_DOC = { blockSpacing: Spacing.none, defaultTextStyle: {} };
|
|
5775
5775
|
var safeTextValue = (raw, options2) => {
|
|
5776
5776
|
const converted = normalizeTextValue(raw, options2);
|
|
5777
5777
|
return checkForHTML(converted) ? converted : normalizeTextValue(htmlToPlainText(raw), options2);
|
|
@@ -5799,7 +5799,7 @@ var dspLabel = (raw, fallback) => ({
|
|
|
5799
5799
|
sectionType: SectionType.text
|
|
5800
5800
|
});
|
|
5801
5801
|
var smallText = (raw) => ({
|
|
5802
|
-
content: { en: safeTextValue(raw, { defaultTextStyle: { fontSize: "small" } }) },
|
|
5802
|
+
content: { en: safeTextValue(raw, { blockSpacing: Spacing.none, defaultTextStyle: { fontSize: "small" } }) },
|
|
5803
5803
|
sectionType: SectionType.text
|
|
5804
5804
|
});
|
|
5805
5805
|
var styled = (value, { align, bold, color, fontSize, href }) => ({
|
|
@@ -2358,7 +2358,7 @@ var containsHtml = (text) => HTML_TAG_RE2.test(text);
|
|
|
2358
2358
|
var isObject = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
|
|
2359
2359
|
var normalizeTextValue = (value, options = {}) => {
|
|
2360
2360
|
const tokenized = normalizeTokens(value);
|
|
2361
|
-
return containsHtml(tokenized) || options.defaultTextStyle ? htmlToTiptap(tokenized, options) : decodeTextEntities(tokenized);
|
|
2361
|
+
return containsHtml(tokenized) || options.defaultTextStyle || options.blockSpacing ? htmlToTiptap(tokenized, options) : decodeTextEntities(tokenized);
|
|
2362
2362
|
};
|
|
2363
2363
|
var normalizeLangValue = (value) => typeof value === "string" ? normalizeTextValue(value) : value;
|
|
2364
2364
|
var normalizeTextContent = (node) => {
|
|
@@ -2297,7 +2297,7 @@ var containsHtml = (text) => HTML_TAG_RE2.test(text);
|
|
|
2297
2297
|
var isObject = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
|
|
2298
2298
|
var normalizeTextValue = (value, options = {}) => {
|
|
2299
2299
|
const tokenized = normalizeTokens(value);
|
|
2300
|
-
return containsHtml(tokenized) || options.defaultTextStyle ? htmlToTiptap(tokenized, options) : decodeTextEntities(tokenized);
|
|
2300
|
+
return containsHtml(tokenized) || options.defaultTextStyle || options.blockSpacing ? htmlToTiptap(tokenized, options) : decodeTextEntities(tokenized);
|
|
2301
2301
|
};
|
|
2302
2302
|
var normalizeLangValue = (value) => typeof value === "string" ? normalizeTextValue(value) : value;
|
|
2303
2303
|
var normalizeTextContent = (node) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TiptapDocument } from '../schema/widgets/checkout-and-beyond/text';
|
|
2
2
|
import { type HtmlToTiptapOptions } from '../transforms/htmlToTiptap/htmlToTiptap';
|
|
3
|
-
export type NormalizeTextOptions = Pick<HtmlToTiptapOptions, 'defaultTextStyle'>;
|
|
3
|
+
export type NormalizeTextOptions = Pick<HtmlToTiptapOptions, 'blockSpacing' | 'defaultTextStyle'>;
|
|
4
4
|
/**
|
|
5
5
|
* THE text pipeline for one content value — the single path every text a CAB tree renders takes,
|
|
6
6
|
* whether it is merchant-authored, converted from a legacy widget, or third-party ad creative:
|
|
@@ -16,7 +16,8 @@ export type NormalizeTextOptions = Pick<HtmlToTiptapOptions, 'defaultTextStyle'>
|
|
|
16
16
|
*
|
|
17
17
|
* `defaultTextStyle` is the server-side analogue of React's `defaultTextStyle` prop: the doc's runs
|
|
18
18
|
* carry that `textStyle` unless the markup set their own. A default forces plain text through the
|
|
19
|
-
* converter too, since only a doc can carry a mark.
|
|
19
|
+
* converter too, since only a doc can carry a mark. `blockSpacing` does the same, since only a doc
|
|
20
|
+
* carries it (REB-25181).
|
|
20
21
|
*
|
|
21
22
|
* NOT idempotent for entity-bearing strings (`&amp;` → `&` → `&`), by nature of decoding.
|
|
22
23
|
* That is safe because this runs at SERVE time on the stored original and its output is returned,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebuy/rebuy",
|
|
3
|
-
"version": "3.60.
|
|
3
|
+
"version": "3.60.5",
|
|
4
4
|
"description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Rebuy, Inc.",
|