@rebuy/rebuy 2.21.0 → 2.22.0-rc.1

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 (63) hide show
  1. package/dist/transforms/contentBlockV1/convertContentBlockImageToV2.d.ts +5 -0
  2. package/dist/transforms/contentBlockV1/convertContentBlockImageToV2.d.ts.map +1 -0
  3. package/dist/transforms/contentBlockV1/convertContentBlockTextToV2.d.ts +4 -0
  4. package/dist/transforms/contentBlockV1/convertContentBlockTextToV2.d.ts.map +1 -0
  5. package/dist/transforms/contentBlockV1/convertContentBlockToV2.d.ts +5 -0
  6. package/dist/transforms/contentBlockV1/convertContentBlockToV2.d.ts.map +1 -0
  7. package/dist/transforms/contentBlockV1/convertTextToTiptapParagraph.d.ts +11 -0
  8. package/dist/transforms/contentBlockV1/convertTextToTiptapParagraph.d.ts.map +1 -0
  9. package/dist/transforms/contentBlockV1/stripContentBlockHtml.d.ts +2 -0
  10. package/dist/transforms/contentBlockV1/stripContentBlockHtml.d.ts.map +1 -0
  11. package/dist/transforms/contentBlockV1/types.d.ts +44 -0
  12. package/dist/transforms/contentBlockV1/types.d.ts.map +1 -0
  13. package/dist/transforms/convertNumericObjects.d.ts +7 -0
  14. package/dist/transforms/convertNumericObjects.d.ts.map +1 -0
  15. package/dist/transforms/deepCamelCase.d.ts +15 -0
  16. package/dist/transforms/deepCamelCase.d.ts.map +1 -0
  17. package/dist/transforms/htmlToTiptap/buildDefaultTextStyleMark.d.ts +7 -0
  18. package/dist/transforms/htmlToTiptap/buildDefaultTextStyleMark.d.ts.map +1 -0
  19. package/dist/transforms/htmlToTiptap/buildLinkMark.d.ts +3 -0
  20. package/dist/transforms/htmlToTiptap/buildLinkMark.d.ts.map +1 -0
  21. package/dist/transforms/htmlToTiptap/closeTag.d.ts +3 -0
  22. package/dist/transforms/htmlToTiptap/closeTag.d.ts.map +1 -0
  23. package/dist/transforms/htmlToTiptap/constants.d.ts +8 -0
  24. package/dist/transforms/htmlToTiptap/constants.d.ts.map +1 -0
  25. package/dist/transforms/htmlToTiptap/decodeEntities.d.ts +2 -0
  26. package/dist/transforms/htmlToTiptap/decodeEntities.d.ts.map +1 -0
  27. package/dist/transforms/htmlToTiptap/flushParagraph.d.ts +3 -0
  28. package/dist/transforms/htmlToTiptap/flushParagraph.d.ts.map +1 -0
  29. package/dist/transforms/htmlToTiptap/htmlToTiptap.d.ts +11 -0
  30. package/dist/transforms/htmlToTiptap/htmlToTiptap.d.ts.map +1 -0
  31. package/dist/transforms/htmlToTiptap/isSkipping.d.ts +3 -0
  32. package/dist/transforms/htmlToTiptap/isSkipping.d.ts.map +1 -0
  33. package/dist/transforms/htmlToTiptap/isValidHref.d.ts +13 -0
  34. package/dist/transforms/htmlToTiptap/isValidHref.d.ts.map +1 -0
  35. package/dist/transforms/htmlToTiptap/makeDoc.d.ts +4 -0
  36. package/dist/transforms/htmlToTiptap/makeDoc.d.ts.map +1 -0
  37. package/dist/transforms/htmlToTiptap/makeParagraph.d.ts +3 -0
  38. package/dist/transforms/htmlToTiptap/makeParagraph.d.ts.map +1 -0
  39. package/dist/transforms/htmlToTiptap/openTag.d.ts +3 -0
  40. package/dist/transforms/htmlToTiptap/openTag.d.ts.map +1 -0
  41. package/dist/transforms/htmlToTiptap/parseAttribs.d.ts +2 -0
  42. package/dist/transforms/htmlToTiptap/parseAttribs.d.ts.map +1 -0
  43. package/dist/transforms/htmlToTiptap/pushText.d.ts +3 -0
  44. package/dist/transforms/htmlToTiptap/pushText.d.ts.map +1 -0
  45. package/dist/transforms/htmlToTiptap/stripHtmlComments.d.ts +2 -0
  46. package/dist/transforms/htmlToTiptap/stripHtmlComments.d.ts.map +1 -0
  47. package/dist/transforms/htmlToTiptap/types.d.ts +19 -0
  48. package/dist/transforms/htmlToTiptap/types.d.ts.map +1 -0
  49. package/dist/transforms/index.d.ts +13 -0
  50. package/dist/transforms/index.d.ts.map +1 -0
  51. package/dist/transforms/index.js +1178 -0
  52. package/dist/transforms/index.js.map +7 -0
  53. package/dist/transforms/index.mjs +1155 -0
  54. package/dist/transforms/index.mjs.map +7 -0
  55. package/dist/transforms/isCABRootSection.d.ts +12 -0
  56. package/dist/transforms/isCABRootSection.d.ts.map +1 -0
  57. package/dist/transforms/normalizeTextContent.d.ts +12 -0
  58. package/dist/transforms/normalizeTextContent.d.ts.map +1 -0
  59. package/dist/transforms/normalizeTokens.d.ts +14 -0
  60. package/dist/transforms/normalizeTokens.d.ts.map +1 -0
  61. package/dist/transforms/parseShielded.d.ts +19 -0
  62. package/dist/transforms/parseShielded.d.ts.map +1 -0
  63. package/package.json +12 -4
@@ -0,0 +1,5 @@
1
+ import { CABImageSection } from '~/schema/widgets/checkout-and-beyond/image';
2
+ import { CABLayoutSection } from '~/schema/widgets/checkout-and-beyond/layout';
3
+ import { type V1ImageBlock } from '~/transforms/contentBlockV1/types';
4
+ export declare const convertContentBlockImageToV2: (block: V1ImageBlock) => CABImageSection | CABLayoutSection;
5
+ //# sourceMappingURL=convertContentBlockImageToV2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertContentBlockImageToV2.d.ts","sourceRoot":"","sources":["../../../src/transforms/contentBlockV1/convertContentBlockImageToV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAI/E,OAAO,EAEH,KAAK,YAAY,EAEpB,MAAM,mCAAmC,CAAC;AAwB3C,eAAO,MAAM,4BAA4B,GAAI,OAAO,YAAY,KAAG,eAAe,GAAG,gBAyCpF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { TiptapDocument } from '~/schema/widgets/checkout-and-beyond/text';
2
+ import { type V1Language } from '~/transforms/contentBlockV1/types';
3
+ export declare const convertContentBlockTextToV2: (language: V1Language | undefined) => TiptapDocument;
4
+ //# sourceMappingURL=convertContentBlockTextToV2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertContentBlockTextToV2.d.ts","sourceRoot":"","sources":["../../../src/transforms/contentBlockV1/convertContentBlockTextToV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEpE,eAAO,MAAM,2BAA2B,GAAI,UAAU,UAAU,GAAG,SAAS,KAAG,cAqC9E,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { CABRootSection } from '~/schema/widgets/checkout-and-beyond/root';
2
+ import { type V1ConvertInput } from '~/transforms/contentBlockV1/types';
3
+ /** Translates a v1 content-block widget into a fully-formed `CABRootSection`. */
4
+ export declare const convertContentBlockToV2: ({ id, settings }: V1ConvertInput) => CABRootSection;
5
+ //# sourceMappingURL=convertContentBlockToV2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertContentBlockToV2.d.ts","sourceRoot":"","sources":["../../../src/transforms/contentBlockV1/convertContentBlockToV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAG3E,OAAO,EAEH,KAAK,cAAc,EAEtB,MAAM,mCAAmC,CAAC;AAW3C,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,GAAI,kBAAkB,cAAc,KAAG,cA6B1E,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { TiptapParagraph, type TiptapText } from '~/schema/widgets/checkout-and-beyond/text';
2
+ type ConvertTextToTiptapArgs = {
3
+ color: string;
4
+ fontSize: string;
5
+ marks?: NonNullable<TiptapText['marks']>;
6
+ text: string;
7
+ textAlign: 'start' | 'center' | 'end';
8
+ };
9
+ export declare const convertTextToTiptapParagraph: ({ color, fontSize, marks, text, textAlign, }: ConvertTextToTiptapArgs) => TiptapParagraph;
10
+ export {};
11
+ //# sourceMappingURL=convertTextToTiptapParagraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertTextToTiptapParagraph.d.ts","sourceRoot":"","sources":["../../../src/transforms/contentBlockV1/convertTextToTiptapParagraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAG7F,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,8CAM1C,uBAAuB,KAAG,eAgB5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const stripContentBlockHtml: (text: string) => string;
2
+ //# sourceMappingURL=stripContentBlockHtml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripContentBlockHtml.d.ts","sourceRoot":"","sources":["../../../src/transforms/contentBlockV1/stripContentBlockHtml.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,GAAI,MAAM,MAAM,KAAG,MAC0C,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Minimal v1 content-block input types. The legacy `/widgets/settings` endpoint
3
+ * returns the widget's settings object directly (no envelope), so the converter
4
+ * input is just `{ id, settings }` — `name` / `owner` aren't in the upstream
5
+ * response and would be set to schema defaults in the produced `CABRootSection`.
6
+ */
7
+ export declare const SHOPIFY_CHECKOUT_EXTENSION_CONTENT_BLOCK: "ui_extension_content_block";
8
+ /** Pixel threshold above which an aside-placed image is forced to top placement. */
9
+ export declare const CONTENT_BLOCK_MAX_IMAGE_WIDTH = 560;
10
+ export type V1ImagePlacement = 'top' | 'right' | 'bottom' | 'left';
11
+ export type V1ImageBlock = {
12
+ altText?: string | null;
13
+ category?: string;
14
+ description?: string | null;
15
+ filename?: string;
16
+ id: string;
17
+ imagePlacement: V1ImagePlacement;
18
+ imageSize: number;
19
+ imageUrl: string;
20
+ index?: number;
21
+ textAlignment?: 'left' | 'center' | 'right';
22
+ textSize?: string;
23
+ };
24
+ export type V1Language = {
25
+ description?: string;
26
+ superTitle?: string;
27
+ title?: string;
28
+ };
29
+ export type V1Settings = {
30
+ blockSpacing?: string;
31
+ imageBlocks?: V1ImageBlock[];
32
+ imageLayout?: 'row' | 'column';
33
+ language?: V1Language;
34
+ location?: 'checkout' | 'order-status' | 'thank-you';
35
+ previewMode?: boolean;
36
+ type: typeof SHOPIFY_CHECKOUT_EXTENSION_CONTENT_BLOCK;
37
+ version: 1;
38
+ };
39
+ export type V1ConvertInput = {
40
+ id: number;
41
+ settings: V1Settings;
42
+ };
43
+ export declare const isContentBlockV1: (data: unknown) => data is V1Settings;
44
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transforms/contentBlockV1/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,wCAAwC,EAAG,4BAAqC,CAAC;AAE9F,oFAAoF;AACpF,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,gBAAgB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC/B,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,QAAQ,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,OAAO,wCAAwC,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,UAMxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Recursively converts objects whose keys are a complete `0..n-1` sequence
3
+ * (PHP-serialized "sparse" arrays) into real arrays. Everything else passes
4
+ * through unchanged.
5
+ */
6
+ export declare const convertNumericObjects: (input: unknown) => unknown;
7
+ //# sourceMappingURL=convertNumericObjects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertNumericObjects.d.ts","sourceRoot":"","sources":["../../src/transforms/convertNumericObjects.ts"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,OActD,CAAC"}
@@ -0,0 +1,15 @@
1
+ export type ToCamelCase<S extends string> = S extends `${infer Head}_${infer Tail}` | `${infer Head}-${infer Tail}` ? `${Head}${Capitalize<ToCamelCase<Tail>>}` : S;
2
+ export type DeepCamelCase<T> = T extends (infer U)[] ? DeepCamelCase<U>[] : T extends object ? {
3
+ [K in keyof T as ToCamelCase<K & string>]: DeepCamelCase<T[K]>;
4
+ } : T;
5
+ /**
6
+ * Recursively converts object keys to camelCase. Snake_case and kebab-case
7
+ * are both handled; numeric array indices and primitives pass through
8
+ * unchanged.
9
+ *
10
+ * Language keys used by the CAB schema (`text.content[<lang>]`, etc.) are
11
+ * authored as plain lowercase tags (`en`, `de`, `fr`) by us — they have no
12
+ * `_` or `-` to convert and survive camelCase as-is.
13
+ */
14
+ export declare const deepCamelCase: <T>(input: T) => DeepCamelCase<T>;
15
+ //# sourceMappingURL=deepCamelCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepCamelCase.d.ts","sourceRoot":"","sources":["../../src/transforms/deepCamelCase.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GAAG,GAAG,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,GAC7G,GAAG,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,GACzC,CAAC,CAAC;AAER,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC9C,aAAa,CAAC,CAAC,CAAC,EAAE,GAClB,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAClE,CAAC,CAAC;AAEV;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,aAAa,CAAC,CAAC,CAc1D,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type TextColorName, type TextSizeName } from '~/schema/widgets/checkout-and-beyond/common';
2
+ import { type Mark } from '~/transforms/htmlToTiptap/types';
3
+ export declare const buildDefaultTextStyleMark: (style: {
4
+ color?: TextColorName;
5
+ fontSize?: TextSizeName;
6
+ } | undefined) => Mark | null;
7
+ //# sourceMappingURL=buildDefaultTextStyleMark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildDefaultTextStyleMark.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/buildDefaultTextStyleMark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,6CAA6C,CAAC;AACpG,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAE5D,eAAO,MAAM,yBAAyB,GAClC,OAAO;IAAE,KAAK,CAAC,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,SAAS,KACtE,IAAI,GAAG,IAUT,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type Mark } from '~/transforms/htmlToTiptap/types';
2
+ export declare const buildLinkMark: (attrs?: Record<string, string>) => Mark | null;
3
+ //# sourceMappingURL=buildLinkMark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildLinkMark.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/buildLinkMark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iCAAiC,CAAC;AAkC5D,eAAO,MAAM,aAAa,GAAI,QAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,KAAG,IAAI,GAAG,IAkBzE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type StackEntry } from '~/transforms/htmlToTiptap/types';
2
+ export declare const closeTag: (stack: StackEntry[], name: string) => void;
3
+ //# sourceMappingURL=closeTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"closeTag.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/closeTag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,eAAO,MAAM,QAAQ,GAAI,OAAO,UAAU,EAAE,EAAE,MAAM,MAAM,KAAG,IAO5D,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const TAG_RE: RegExp;
2
+ /**
3
+ * Tags that introduce a paragraph break on both open and close. Container tags
4
+ * like `ul`/`ol`/`dl` are intentionally NOT here — their child `li`/`dt`/`dd`
5
+ * elements already break, and including the containers would double-flush.
6
+ */
7
+ export declare const BLOCK_TAGS: Set<string>;
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,QAA2D,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAwBrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const decodeEntities: (input?: string) => string;
2
+ //# sourceMappingURL=decodeEntities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeEntities.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/decodeEntities.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,cAAc,GAAI,QAAO,MAAW,KAAG,MAQ9C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type State } from '~/transforms/htmlToTiptap/types';
2
+ export declare const flushParagraph: (state: State) => void;
3
+ //# sourceMappingURL=flushParagraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flushParagraph.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/flushParagraph.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAE7D,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,KAAG,IAG7C,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type Spacing, type TextColorName, type TextSizeName } from '~/schema/widgets/checkout-and-beyond/common';
2
+ import { type TiptapDocument } from '~/schema/widgets/checkout-and-beyond/text';
3
+ export type HtmlToTiptapOptions = {
4
+ blockSpacing?: Spacing;
5
+ defaultTextStyle?: {
6
+ color?: TextColorName;
7
+ fontSize?: TextSizeName;
8
+ };
9
+ };
10
+ export declare const htmlToTiptap: (html: string, options?: HtmlToTiptapOptions) => TiptapDocument;
11
+ //# sourceMappingURL=htmlToTiptap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"htmlToTiptap.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/htmlToTiptap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAClH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAahF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,aAAa,CAAC;QAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;CACzE,CAAC;AAMF,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,UAAS,mBAAwB,KAAG,cAiE9E,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type StackEntry } from '~/transforms/htmlToTiptap/types';
2
+ export declare const isSkipping: (stack?: StackEntry[]) => boolean;
3
+ //# sourceMappingURL=isSkipping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isSkipping.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/isSkipping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,eAAO,MAAM,UAAU,GAAI,QAAO,UAAU,EAAO,KAAG,OAAyC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Decides whether an `<a href>` value should survive HTML → Tiptap conversion
3
+ * as a link mark. Allows `#`, dynamic `{{token}}` placeholders, and a fixed
4
+ * allowlist of URL schemes; everything else (including `javascript:`, `data:`,
5
+ * relative paths, and malformed URLs) drops the link mark while keeping the
6
+ * surrounding text.
7
+ *
8
+ * @param href - Raw `href` attribute from the source HTML.
9
+ *
10
+ * @returns `true` if the URL should be preserved as a link mark.
11
+ */
12
+ export declare const isValidHref: (href: string) => boolean;
13
+ //# sourceMappingURL=isValidHref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isValidHref.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/isValidHref.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,OAc1C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type Spacing } from '~/schema/widgets/checkout-and-beyond/common';
2
+ import { TiptapDocument, type TiptapParagraph } from '~/schema/widgets/checkout-and-beyond/text';
3
+ export declare const makeDoc: (content: TiptapParagraph[], blockSpacing: Spacing) => TiptapDocument;
4
+ //# sourceMappingURL=makeDoc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeDoc.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/makeDoc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAEjG,eAAO,MAAM,OAAO,GAAI,SAAS,eAAe,EAAE,EAAE,cAAc,OAAO,KAAG,cACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { TiptapParagraph, type TiptapText } from '~/schema/widgets/checkout-and-beyond/text';
2
+ export declare const makeParagraph: (content: TiptapText[]) => TiptapParagraph;
3
+ //# sourceMappingURL=makeParagraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeParagraph.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/makeParagraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAE7F,eAAO,MAAM,aAAa,GAAI,SAAS,UAAU,EAAE,KAAG,eAAqD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type StackEntry } from '~/transforms/htmlToTiptap/types';
2
+ export declare const openTag: (stack: StackEntry[], name: string, attrs: string) => void;
3
+ //# sourceMappingURL=openTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openTag.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/openTag.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAuC7E,eAAO,MAAM,OAAO,GAAI,OAAO,UAAU,EAAE,EAAE,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,IAM1E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const parseAttribs: (attrString: string) => Record<string, string>;
2
+ //# sourceMappingURL=parseAttribs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseAttribs.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/parseAttribs.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAWtE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type State } from '~/transforms/htmlToTiptap/types';
2
+ export declare const pushText: (state: State, rawText: string) => void;
3
+ //# sourceMappingURL=pushText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pushText.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/pushText.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExE,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,EAAE,SAAS,MAAM,KAAG,IAkBxD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const stripHtmlComments: (html?: string) => string;
2
+ //# sourceMappingURL=stripHtmlComments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripHtmlComments.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/stripHtmlComments.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,GAAI,OAAM,MAAW,KAAG,MAA2C,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type TiptapParagraph, type TiptapText } from '~/schema/widgets/checkout-and-beyond/text';
2
+ export type Mark = NonNullable<TiptapText['marks']>[number];
3
+ export type StackEntry = {
4
+ marks: Mark[];
5
+ skip: boolean;
6
+ tag: string;
7
+ };
8
+ export type ListEntry = {
9
+ counter: number;
10
+ ordered: boolean;
11
+ };
12
+ export type State = {
13
+ currentRuns: TiptapText[];
14
+ defaultTextStyleMark: Mark | null;
15
+ listStack: ListEntry[];
16
+ paragraphs: TiptapParagraph[];
17
+ stack: StackEntry[];
18
+ };
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transforms/htmlToTiptap/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAElG,MAAM,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,oBAAoB,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,KAAK,EAAE,UAAU,EAAE,CAAC;CACvB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export { convertNumericObjects } from '~/transforms/convertNumericObjects';
2
+ export { type DeepCamelCase, deepCamelCase, type ToCamelCase } from '~/transforms/deepCamelCase';
3
+ export { type HtmlToTiptapOptions, htmlToTiptap } from '~/transforms/htmlToTiptap/htmlToTiptap';
4
+ export { isCABRootSection } from '~/transforms/isCABRootSection';
5
+ export { normalizeTextContent } from '~/transforms/normalizeTextContent';
6
+ export { normalizeTokens } from '~/transforms/normalizeTokens';
7
+ export { parseShielded } from '~/transforms/parseShielded';
8
+ export { CONTENT_BLOCK_MAX_IMAGE_WIDTH, isContentBlockV1, SHOPIFY_CHECKOUT_EXTENSION_CONTENT_BLOCK, type V1ConvertInput, type V1ImageBlock, type V1ImagePlacement, type V1Language, type V1Settings, } from '~/transforms/contentBlockV1/types';
9
+ export { convertContentBlockImageToV2 } from '~/transforms/contentBlockV1/convertContentBlockImageToV2';
10
+ export { convertContentBlockTextToV2 } from '~/transforms/contentBlockV1/convertContentBlockTextToV2';
11
+ export { convertContentBlockToV2 } from '~/transforms/contentBlockV1/convertContentBlockToV2';
12
+ export { convertTextToTiptapParagraph } from '~/transforms/contentBlockV1/convertTextToTiptapParagraph';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transforms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,KAAK,mBAAmB,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EACH,6BAA6B,EAC7B,gBAAgB,EAChB,wCAAwC,EACxC,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,GAClB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AACxG,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC"}