@trycourier/react-designer 0.0.0-canary-20251202152218 → 0.0.0-canary-20251205100831

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.
@@ -259,15 +259,15 @@
259
259
  pointer-events: none;
260
260
  width: 100%;
261
261
  } */
262
- .ProseMirror>*:first-child:first-child,
263
- .ProseMirror [data-type="column"]>*:first-child {
262
+ .ProseMirror > *:first-child:first-child,
263
+ .ProseMirror [data-type="column"] > *:first-child {
264
264
  margin-top: 0px;
265
265
  }
266
- .ProseMirror>*:first-child:last-child,
267
- .ProseMirror [data-type="column"]>*:last-child {
266
+ .ProseMirror > *:first-child:last-child,
267
+ .ProseMirror [data-type="column"] > *:last-child {
268
268
  margin-bottom: 0px;
269
269
  }
270
- .ProseMirror>*+* {
270
+ .ProseMirror > * + * {
271
271
  margin-top: 0.75em;
272
272
  }
273
273
  .ProseMirror .node-imageUpload {
@@ -375,9 +375,6 @@
375
375
  .ProseMirror .node-imageBlock img {
376
376
  overflow: hidden;
377
377
  }
378
- .ProseMirror .node-imageBlock img {
379
- border-radius: 0.75rem;
380
- }
381
378
  .ProseMirror .node-imageBlock img {
382
379
  border-width: 2px;
383
380
  }
@@ -409,45 +406,45 @@
409
406
  --tw-border-opacity: 1;
410
407
  border-color: rgb(229 229 229 / var(--tw-border-opacity, 1));
411
408
  }
412
- .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper]>* {
409
+ .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper] > * {
413
410
  border-radius: var(--radius);
414
411
  }
415
- .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper]>* {
412
+ .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper] > * {
416
413
  --tw-shadow: 0 0 0 2px;
417
414
  --tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);
418
415
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
419
416
  }
420
- .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper]>* {
417
+ .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper] > * {
421
418
  --tw-shadow-color: rgb(0 0 0 / 0.3);
422
419
  --tw-shadow: var(--tw-shadow-colored);
423
420
  }
424
- .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper]>*, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper]>* {
421
+ .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper] > *, .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper] > * {
425
422
  transition-property: all;
426
423
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
427
424
  transition-duration: 150ms;
428
425
  }
429
- .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper]>*:is(.courier-dark *), .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper]>*:is(.courier-dark *), .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper]>*:is(.courier-dark *) {
426
+ .ProseMirror .node-aiWriter.has-focus [data-node-view-wrapper] > *:is(.courier-dark *), .ProseMirror .node-aiImage.has-focus [data-node-view-wrapper] > *:is(.courier-dark *), .ProseMirror .node-tableOfContentsNode.has-focus [data-node-view-wrapper] > *:is(.courier-dark *) {
430
427
  --tw-shadow-color: rgb(255 255 255 / 0.3);
431
428
  --tw-shadow: var(--tw-shadow-colored);
432
429
  }
433
- .ProseMirror .ProseMirror-gapcursor+.node-imageBlock,
434
- .ProseMirror .ProseMirror-gapcursor+.node-imageUpload,
435
- .ProseMirror .ProseMirror-gapcursor+.node-blockquote {
430
+ .ProseMirror .ProseMirror-gapcursor + .node-imageBlock,
431
+ .ProseMirror .ProseMirror-gapcursor + .node-imageUpload,
432
+ .ProseMirror .ProseMirror-gapcursor + .node-blockquote {
436
433
  outline-color: #404040;
437
434
  }
438
- .ProseMirror .ProseMirror-gapcursor+.node-imageBlock:hover,
439
- .ProseMirror .ProseMirror-gapcursor+.node-imageUpload:hover,
440
- .ProseMirror .ProseMirror-gapcursor+.node-blockquote:hover {
435
+ .ProseMirror .ProseMirror-gapcursor + .node-imageBlock:hover,
436
+ .ProseMirror .ProseMirror-gapcursor + .node-imageUpload:hover,
437
+ .ProseMirror .ProseMirror-gapcursor + .node-blockquote:hover {
441
438
  outline-color: #525252;
442
439
  }
443
- .ProseMirror .ProseMirror-gapcursor+.node-imageBlock:is(.courier-dark *),
444
- .ProseMirror .ProseMirror-gapcursor+.node-imageUpload:is(.courier-dark *),
445
- .ProseMirror .ProseMirror-gapcursor+.node-blockquote:is(.courier-dark *) {
440
+ .ProseMirror .ProseMirror-gapcursor + .node-imageBlock:is(.courier-dark *),
441
+ .ProseMirror .ProseMirror-gapcursor + .node-imageUpload:is(.courier-dark *),
442
+ .ProseMirror .ProseMirror-gapcursor + .node-blockquote:is(.courier-dark *) {
446
443
  outline-color: #d4d4d4;
447
444
  }
448
- .ProseMirror .ProseMirror-gapcursor+.node-imageBlock:hover:is(.courier-dark *),
449
- .ProseMirror .ProseMirror-gapcursor+.node-imageUpload:hover:is(.courier-dark *),
450
- .ProseMirror .ProseMirror-gapcursor+.node-blockquote:hover:is(.courier-dark *) {
445
+ .ProseMirror .ProseMirror-gapcursor + .node-imageBlock:hover:is(.courier-dark *),
446
+ .ProseMirror .ProseMirror-gapcursor + .node-imageUpload:hover:is(.courier-dark *),
447
+ .ProseMirror .ProseMirror-gapcursor + .node-blockquote:hover:is(.courier-dark *) {
451
448
  outline-color: #a3a3a3;
452
449
  }
453
450
  *, ::before, ::after {
@@ -1626,9 +1623,6 @@ body {
1626
1623
  .courier-rounded-sm {
1627
1624
  border-radius: calc(var(--radius) - 4px);
1628
1625
  }
1629
- .courier-rounded-xl {
1630
- border-radius: 0.75rem;
1631
- }
1632
1626
  .courier-rounded-b-none {
1633
1627
  border-bottom-right-radius: 0px;
1634
1628
  border-bottom-left-radius: 0px;
@@ -2193,6 +2187,9 @@ body {
2193
2187
  .courier-leading-relaxed {
2194
2188
  line-height: 1.625;
2195
2189
  }
2190
+ .courier-leading-tight {
2191
+ line-height: 1.25;
2192
+ }
2196
2193
  .courier-tracking-\[0\.64px\] {
2197
2194
  letter-spacing: 0.64px;
2198
2195
  }
@@ -2711,6 +2708,10 @@ body {
2711
2708
  .courier-sms-editor .ProseMirror > .react-renderer .draggable-item > div {
2712
2709
  padding-left: 0px;
2713
2710
  }
2711
+ .courier-sms-editor .ProseMirror > .react-renderer.node-paragraph p {
2712
+ overflow-wrap: break-word;
2713
+ word-break: break-word;
2714
+ }
2714
2715
  .courier-sms-editor .ProseMirror > .react-renderer.node-paragraph .selected-element .node-element::before {
2715
2716
  display: none;
2716
2717
  }
@@ -3,61 +3,55 @@ export declare const buttonSchema: z.ZodObject<{
3
3
  label: z.ZodString;
4
4
  link: z.ZodOptional<z.ZodString>;
5
5
  alignment: z.ZodEnum<["left", "center", "right"]>;
6
- size: z.ZodEnum<["default", "full"]>;
7
6
  backgroundColor: z.ZodString;
8
- textColor: z.ZodString;
9
- borderWidth: z.ZodNumber;
10
7
  borderRadius: z.ZodNumber;
11
- borderColor: z.ZodString;
12
8
  padding: z.ZodNumber;
13
9
  fontWeight: z.ZodEnum<["normal", "bold"]>;
14
10
  fontStyle: z.ZodEnum<["normal", "italic"]>;
15
11
  isUnderline: z.ZodBoolean;
16
12
  isStrike: z.ZodBoolean;
13
+ textColor: z.ZodOptional<z.ZodString>;
14
+ borderColor: z.ZodOptional<z.ZodString>;
17
15
  }, "strip", z.ZodTypeAny, {
18
16
  padding: number;
19
17
  label: string;
20
18
  backgroundColor: string;
21
- textColor: string;
22
- borderColor: string;
23
- size: "full" | "default";
24
- borderWidth: number;
25
- borderRadius: number;
26
19
  alignment: "left" | "center" | "right";
20
+ borderRadius: number;
27
21
  fontStyle: "italic" | "normal";
28
22
  fontWeight: "bold" | "normal";
29
23
  isUnderline: boolean;
30
24
  isStrike: boolean;
31
25
  link?: string | undefined;
26
+ textColor?: string | undefined;
27
+ borderColor?: string | undefined;
32
28
  }, {
33
29
  padding: number;
34
30
  label: string;
35
31
  backgroundColor: string;
36
- textColor: string;
37
- borderColor: string;
38
- size: "full" | "default";
39
- borderWidth: number;
40
- borderRadius: number;
41
32
  alignment: "left" | "center" | "right";
33
+ borderRadius: number;
42
34
  fontStyle: "italic" | "normal";
43
35
  fontWeight: "bold" | "normal";
44
36
  isUnderline: boolean;
45
37
  isStrike: boolean;
46
38
  link?: string | undefined;
39
+ textColor?: string | undefined;
40
+ borderColor?: string | undefined;
47
41
  }>;
48
42
  export interface ButtonProps {
49
43
  label: string;
50
44
  link?: string;
51
45
  alignment: "left" | "center" | "right";
52
- size: "default" | "full";
53
46
  backgroundColor: string;
54
- textColor: string;
55
- borderWidth: number;
56
47
  borderRadius: number;
57
- borderColor: string;
58
48
  padding: number;
59
49
  fontWeight: "normal" | "bold";
60
50
  fontStyle: "normal" | "italic";
61
51
  isUnderline: boolean;
62
52
  isStrike: boolean;
53
+ /** @deprecated Legacy property - not supported by Elemental */
54
+ textColor?: string;
55
+ /** @deprecated Legacy property - not supported by Elemental */
56
+ borderColor?: string;
63
57
  }
@@ -22,8 +22,8 @@ export declare const columnSchema: z.ZodObject<{
22
22
  backgroundColor: string;
23
23
  paddingVertical: number;
24
24
  paddingHorizontal: number;
25
- borderColor: string;
26
25
  borderWidth: number;
26
+ borderColor: string;
27
27
  borderRadius: number;
28
28
  columnsCount: number;
29
29
  cells?: {
@@ -33,8 +33,8 @@ export declare const columnSchema: z.ZodObject<{
33
33
  backgroundColor?: string | undefined;
34
34
  paddingVertical?: number | undefined;
35
35
  paddingHorizontal?: number | undefined;
36
- borderColor?: string | undefined;
37
36
  borderWidth?: number | undefined;
37
+ borderColor?: string | undefined;
38
38
  borderRadius?: number | undefined;
39
39
  columnsCount?: number | undefined;
40
40
  cells?: {
@@ -9,8 +9,8 @@ export declare const dividerSchema: z.ZodObject<{
9
9
  padding: number;
10
10
  color: string;
11
11
  size: number;
12
- radius: number;
13
12
  variant: "divider" | "spacer";
13
+ radius: number;
14
14
  }, {
15
15
  padding: number;
16
16
  color: string;
@@ -6,15 +6,13 @@ export declare const imageBlockSchema: z.ZodObject<{
6
6
  alignment: z.ZodEnum<["left", "center", "right"]>;
7
7
  width: z.ZodNumber;
8
8
  borderWidth: z.ZodNumber;
9
- borderRadius: z.ZodNumber;
10
9
  borderColor: z.ZodString;
11
10
  isUploading: z.ZodOptional<z.ZodBoolean>;
12
11
  imageNaturalWidth: z.ZodNumber;
13
12
  }, "strip", z.ZodTypeAny, {
14
13
  width: number;
15
- borderColor: string;
16
14
  borderWidth: number;
17
- borderRadius: number;
15
+ borderColor: string;
18
16
  alignment: "left" | "center" | "right";
19
17
  sourcePath: string;
20
18
  imageNaturalWidth: number;
@@ -23,9 +21,8 @@ export declare const imageBlockSchema: z.ZodObject<{
23
21
  isUploading?: boolean | undefined;
24
22
  }, {
25
23
  width: number;
26
- borderColor: string;
27
24
  borderWidth: number;
28
- borderRadius: number;
25
+ borderColor: string;
29
26
  alignment: "left" | "center" | "right";
30
27
  sourcePath: string;
31
28
  imageNaturalWidth: number;
@@ -40,7 +37,6 @@ export interface ImageBlockProps {
40
37
  alignment: "left" | "center" | "right";
41
38
  width: number;
42
39
  borderWidth: number;
43
- borderRadius: number;
44
40
  borderColor: string;
45
41
  isUploading?: boolean;
46
42
  imageNaturalWidth: number;
@@ -4,31 +4,25 @@ export declare const textBlockSchema: z.ZodObject<{
4
4
  paddingHorizontal: z.ZodNumber;
5
5
  backgroundColor: z.ZodString;
6
6
  borderWidth: z.ZodNumber;
7
- borderRadius: z.ZodNumber;
8
7
  borderColor: z.ZodString;
9
- textColor: z.ZodString;
10
8
  textAlign: z.ZodDefault<z.ZodEnum<["left", "center", "right", "justify"]>>;
11
9
  selected: z.ZodDefault<z.ZodBoolean>;
12
10
  id: z.ZodOptional<z.ZodString>;
13
11
  }, "strip", z.ZodTypeAny, {
14
12
  backgroundColor: string;
15
- textColor: string;
16
13
  paddingVertical: number;
17
14
  paddingHorizontal: number;
18
- borderColor: string;
19
15
  borderWidth: number;
20
- borderRadius: number;
16
+ borderColor: string;
21
17
  textAlign: "left" | "center" | "right" | "justify";
22
18
  selected: boolean;
23
19
  id?: string | undefined;
24
20
  }, {
25
21
  backgroundColor: string;
26
- textColor: string;
27
22
  paddingVertical: number;
28
23
  paddingHorizontal: number;
29
- borderColor: string;
30
24
  borderWidth: number;
31
- borderRadius: number;
25
+ borderColor: string;
32
26
  id?: string | undefined;
33
27
  textAlign?: "left" | "center" | "right" | "justify" | undefined;
34
28
  selected?: boolean | undefined;
@@ -38,9 +32,7 @@ export interface TextBlockProps {
38
32
  paddingHorizontal: number;
39
33
  backgroundColor: string;
40
34
  borderWidth: number;
41
- borderRadius: number;
42
35
  borderColor: string;
43
- textColor: string;
44
36
  textAlign: "left" | "center" | "right" | "justify";
45
37
  selected: boolean;
46
38
  id?: string;
@@ -2,6 +2,21 @@ export type TextMenuItemState = "enabled" | "disabled" | "hidden";
2
2
  export interface TextMenuItem {
3
3
  state: TextMenuItemState;
4
4
  }
5
+ export interface ConditionalRule {
6
+ id: string;
7
+ trigger: {
8
+ type: "node";
9
+ name: string;
10
+ active: boolean;
11
+ };
12
+ conditions: {
13
+ activeItems: Array<keyof TextMenuConfig>;
14
+ };
15
+ action: {
16
+ type: "toggle_off";
17
+ targets: Array<keyof TextMenuConfig>;
18
+ };
19
+ }
5
20
  export interface TextMenuConfig {
6
21
  contentType?: TextMenuItem;
7
22
  bold?: TextMenuItem;
@@ -15,6 +30,7 @@ export interface TextMenuConfig {
15
30
  quote?: TextMenuItem;
16
31
  link?: TextMenuItem;
17
32
  variable?: TextMenuItem;
33
+ conditionalRules?: ConditionalRule[];
18
34
  }
19
35
  export declare const defaultTextMenuConfig: TextMenuConfig;
20
36
  export declare const getTextMenuConfigForNode: (nodeName: string, hasTextSelection?: boolean) => TextMenuConfig;
@@ -0,0 +1,18 @@
1
+ import type { Editor } from "@tiptap/react";
2
+ import type { TextMenuConfig } from "../config";
3
+ interface TextMenuStates {
4
+ isBold: boolean;
5
+ isItalic: boolean;
6
+ isUnderline: boolean;
7
+ isStrike: boolean;
8
+ isQuote: boolean;
9
+ isAlignLeft: boolean;
10
+ isAlignCenter: boolean;
11
+ isAlignRight: boolean;
12
+ isAlignJustify: boolean;
13
+ isLink: boolean;
14
+ }
15
+ export declare const useConditionalRules: (config: TextMenuConfig | undefined, editor: Editor | null, states: TextMenuStates | undefined) => {
16
+ getRuleForItem: (itemKey: keyof TextMenuConfig) => import("../config").ConditionalRule | undefined;
17
+ } | null;
18
+ export {};
@@ -1,5 +1,18 @@
1
1
  import type { Editor } from "@tiptap/react";
2
- export declare const useTextmenuCommands: (editor: Editor) => {
2
+ import type { TextMenuConfig } from "../config";
3
+ interface TextMenuStates {
4
+ isBold: boolean;
5
+ isItalic: boolean;
6
+ isUnderline: boolean;
7
+ isStrike: boolean;
8
+ isQuote: boolean;
9
+ isAlignLeft: boolean;
10
+ isAlignCenter: boolean;
11
+ isAlignRight: boolean;
12
+ isAlignJustify: boolean;
13
+ isLink: boolean;
14
+ }
15
+ export declare const useTextmenuCommands: (editor: Editor, config?: TextMenuConfig, states?: TextMenuStates) => {
3
16
  onBold: () => boolean;
4
17
  onItalic: () => boolean;
5
18
  onStrike: () => boolean;
@@ -12,3 +25,4 @@ export declare const useTextmenuCommands: (editor: Editor) => {
12
25
  onQuote: () => void;
13
26
  resetButtonFormatting: () => boolean;
14
27
  };
28
+ export {};
@@ -2,11 +2,11 @@ import * as React from "react";
2
2
  import * as TogglePrimitive from "@radix-ui/react-toggle";
3
3
  import { type VariantProps } from "class-variance-authority";
4
4
  declare const toggleVariants: (props?: ({
5
- variant?: "default" | "outline" | null | undefined;
5
+ variant?: "outline" | "default" | null | undefined;
6
6
  size?: "default" | "sm" | "lg" | null | undefined;
7
7
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
8
8
  declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
9
- variant?: "default" | "outline" | null | undefined;
9
+ variant?: "outline" | "default" | null | undefined;
10
10
  size?: "default" | "sm" | "lg" | null | undefined;
11
11
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
12
12
  export { Toggle, toggleVariants };
@@ -2,11 +2,11 @@ import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
2
2
  import { type VariantProps } from "class-variance-authority";
3
3
  import * as React from "react";
4
4
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
5
- variant?: "default" | "outline" | null | undefined;
5
+ variant?: "outline" | "default" | null | undefined;
6
6
  size?: "default" | "sm" | "lg" | null | undefined;
7
7
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
9
- variant?: "default" | "outline" | null | undefined;
9
+ variant?: "outline" | "default" | null | undefined;
10
10
  size?: "default" | "sm" | "lg" | null | undefined;
11
11
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
12
12
  export { ToggleGroup, ToggleGroupItem };