@trycourier/react-designer 0.0.0-canary-20251210164636 → 0.0.0-canary-20251219131027
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/README.md +244 -2
- package/dist/cjs/index.js +70 -56
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/styles.css +182 -37
- package/dist/components/BrandEditor/Editor/Editor.d.ts +16 -1
- package/dist/components/Providers/api/template.d.ts +28 -1
- package/dist/components/Providers/store.d.ts +6 -0
- package/dist/components/Providers/useBrandActions.d.ts +1 -1
- package/dist/components/Providers/useTemplateActions.d.ts +6 -4
- package/dist/components/TemplateEditor/Channels/Email/Email.d.ts +3 -2
- package/dist/components/TemplateEditor/Channels/Email/EmailEditor.d.ts +2 -1
- package/dist/components/TemplateEditor/Channels/Email/EmailLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Email/SideBar/SideBar.d.ts +6 -3
- package/dist/components/TemplateEditor/Channels/Inbox/Inbox.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Inbox/InboxLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/MSTeams/MSTeams.d.ts +3 -2
- package/dist/components/TemplateEditor/Channels/MSTeams/MSTeamsLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/MSTeams/SideBar/SideBar.d.ts +2 -3
- package/dist/components/TemplateEditor/Channels/Push/Push.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Push/PushLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/SMS/SMS.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/SMS/SMSLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/Slack/SideBar/SideBar.d.ts +2 -3
- package/dist/components/TemplateEditor/Channels/Slack/Slack.d.ts +3 -2
- package/dist/components/TemplateEditor/Channels/Slack/SlackLayout.d.ts +1 -1
- package/dist/components/TemplateEditor/Channels/useChannels.d.ts +8 -0
- package/dist/components/TemplateEditor/TemplateEditor.d.ts +16 -1
- package/dist/components/TemplateEditor/hooks/usePragmaticDnd.d.ts +3 -2
- package/dist/components/TemplateEditor/hooks/useSyncEditorItems.d.ts +2 -1
- package/dist/components/TemplateEditor/index.d.ts +2 -14
- package/dist/components/TemplateEditor/store.d.ts +131 -0
- package/dist/components/extensions/Blockquote/Blockquote.types.d.ts +2 -2
- package/dist/components/extensions/Button/Button.types.d.ts +12 -12
- package/dist/components/extensions/Column/Column.types.d.ts +6 -6
- package/dist/components/extensions/Divider/Divider.types.d.ts +1 -1
- package/dist/components/extensions/ImageBlock/ImageBlock.types.d.ts +4 -4
- package/dist/components/extensions/TextBlock/TextBlock.types.d.ts +4 -4
- package/dist/components/extensions/Variable/Variable.d.ts +14 -1
- package/dist/components/extensions/Variable/Variable.types.d.ts +37 -0
- package/dist/components/extensions/Variable/VariableSuggestions.d.ts +7 -0
- package/dist/components/extensions/Variable/index.d.ts +1 -0
- package/dist/components/extensions/Variable/suggestion.d.ts +2 -0
- package/dist/components/extensions/extension-kit.d.ts +7 -2
- package/dist/components/extensions/index.d.ts +1 -1
- package/dist/components/hooks/index.d.ts +1 -0
- package/dist/components/hooks/useBlockConfig.d.ts +110 -0
- package/dist/components/ui/Blocks/CustomCodeBlock/index.d.ts +1 -1
- package/dist/components/ui/VariableEditor/VariableAutocomplete.d.ts +16 -0
- package/dist/components/ui/VariableEditor/VariableChipBase.d.ts +1 -1
- package/dist/components/ui/VariableEditor/VariableEditorToolbar.d.ts +15 -0
- package/dist/components/ui/VariableEditor/VariableInput.d.ts +2 -0
- package/dist/components/ui/VariableEditor/VariableTextarea.d.ts +2 -0
- package/dist/components/ui/VariableEditor/index.d.ts +2 -0
- package/dist/esm/index.js +70 -56
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/styles.css +182 -37
- package/dist/index.d.ts +14 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/styles.css +182 -37
- package/dist/types/elemental.schema.d.ts +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/validation.types.d.ts +53 -0
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -985,6 +985,9 @@ body {
|
|
|
985
985
|
.courier-top-\[50\%\] {
|
|
986
986
|
top: 50%;
|
|
987
987
|
}
|
|
988
|
+
.courier-top-px {
|
|
989
|
+
top: 1px;
|
|
990
|
+
}
|
|
988
991
|
.-courier-z-10 {
|
|
989
992
|
z-index: -10;
|
|
990
993
|
}
|
|
@@ -997,6 +1000,9 @@ body {
|
|
|
997
1000
|
.courier-z-50 {
|
|
998
1001
|
z-index: 50;
|
|
999
1002
|
}
|
|
1003
|
+
.courier-z-\[9999\] {
|
|
1004
|
+
z-index: 9999;
|
|
1005
|
+
}
|
|
1000
1006
|
.courier-z-\[999\] {
|
|
1001
1007
|
z-index: 999;
|
|
1002
1008
|
}
|
|
@@ -1027,10 +1033,6 @@ body {
|
|
|
1027
1033
|
margin-left: -1rem;
|
|
1028
1034
|
margin-right: -1rem;
|
|
1029
1035
|
}
|
|
1030
|
-
.courier-mx-0\.5 {
|
|
1031
|
-
margin-left: 0.125rem;
|
|
1032
|
-
margin-right: 0.125rem;
|
|
1033
|
-
}
|
|
1034
1036
|
.courier-mx-1 {
|
|
1035
1037
|
margin-left: 0.25rem;
|
|
1036
1038
|
margin-right: 0.25rem;
|
|
@@ -1047,6 +1049,10 @@ body {
|
|
|
1047
1049
|
margin-left: auto;
|
|
1048
1050
|
margin-right: auto;
|
|
1049
1051
|
}
|
|
1052
|
+
.courier-my-0 {
|
|
1053
|
+
margin-top: 0px;
|
|
1054
|
+
margin-bottom: 0px;
|
|
1055
|
+
}
|
|
1050
1056
|
.courier-my-1 {
|
|
1051
1057
|
margin-top: 0.25rem;
|
|
1052
1058
|
margin-bottom: 0.25rem;
|
|
@@ -1135,9 +1141,6 @@ body {
|
|
|
1135
1141
|
.courier-mt-1 {
|
|
1136
1142
|
margin-top: 0.25rem;
|
|
1137
1143
|
}
|
|
1138
|
-
.courier-mt-12 {
|
|
1139
|
-
margin-top: 3rem;
|
|
1140
|
-
}
|
|
1141
1144
|
.courier-mt-2 {
|
|
1142
1145
|
margin-top: 0.5rem;
|
|
1143
1146
|
}
|
|
@@ -1246,8 +1249,8 @@ body {
|
|
|
1246
1249
|
.courier-h-\[25px\] {
|
|
1247
1250
|
height: 25px;
|
|
1248
1251
|
}
|
|
1249
|
-
.courier-h-\[
|
|
1250
|
-
height:
|
|
1252
|
+
.courier-h-\[28px\] {
|
|
1253
|
+
height: 28px;
|
|
1251
1254
|
}
|
|
1252
1255
|
.courier-h-\[48px\] {
|
|
1253
1256
|
height: 48px;
|
|
@@ -1276,6 +1279,9 @@ body {
|
|
|
1276
1279
|
.courier-h-px {
|
|
1277
1280
|
height: 1px;
|
|
1278
1281
|
}
|
|
1282
|
+
.courier-max-h-60 {
|
|
1283
|
+
max-height: 15rem;
|
|
1284
|
+
}
|
|
1279
1285
|
.courier-max-h-\[88px\] {
|
|
1280
1286
|
max-height: 88px;
|
|
1281
1287
|
}
|
|
@@ -1303,9 +1309,6 @@ body {
|
|
|
1303
1309
|
.courier-w-1 {
|
|
1304
1310
|
width: 0.25rem;
|
|
1305
1311
|
}
|
|
1306
|
-
.courier-w-1\/2 {
|
|
1307
|
-
width: 50%;
|
|
1308
|
-
}
|
|
1309
1312
|
.courier-w-12 {
|
|
1310
1313
|
width: 3rem;
|
|
1311
1314
|
}
|
|
@@ -2132,6 +2135,9 @@ body {
|
|
|
2132
2135
|
.courier-pt-0 {
|
|
2133
2136
|
padding-top: 0px;
|
|
2134
2137
|
}
|
|
2138
|
+
.courier-pt-0\.5 {
|
|
2139
|
+
padding-top: 0.125rem;
|
|
2140
|
+
}
|
|
2135
2141
|
.courier-pt-2 {
|
|
2136
2142
|
padding-top: 0.5rem;
|
|
2137
2143
|
}
|
|
@@ -2150,9 +2156,6 @@ body {
|
|
|
2150
2156
|
.courier-text-center {
|
|
2151
2157
|
text-align: center;
|
|
2152
2158
|
}
|
|
2153
|
-
.courier-align-middle {
|
|
2154
|
-
vertical-align: middle;
|
|
2155
|
-
}
|
|
2156
2159
|
.courier-font-mono {
|
|
2157
2160
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
2158
2161
|
}
|
|
@@ -2214,8 +2217,8 @@ body {
|
|
|
2214
2217
|
.courier-uppercase {
|
|
2215
2218
|
text-transform: uppercase;
|
|
2216
2219
|
}
|
|
2217
|
-
.courier-leading-\[
|
|
2218
|
-
line-height:
|
|
2220
|
+
.courier-leading-\[28px\] {
|
|
2221
|
+
line-height: 28px;
|
|
2219
2222
|
}
|
|
2220
2223
|
.courier-leading-none {
|
|
2221
2224
|
line-height: 1;
|
|
@@ -2518,8 +2521,9 @@ body {
|
|
|
2518
2521
|
opacity: 1;
|
|
2519
2522
|
}
|
|
2520
2523
|
}
|
|
2521
|
-
|
|
2522
|
-
|
|
2524
|
+
.theme-container {
|
|
2525
|
+
text-align: left;
|
|
2526
|
+
}
|
|
2523
2527
|
/* Dark mode override for number input spin buttons */
|
|
2524
2528
|
.dark input[type="number"]::-webkit-inner-spin-button,
|
|
2525
2529
|
.dark input[type="number"]::-webkit-outer-spin-button {
|
|
@@ -2614,6 +2618,30 @@ body {
|
|
|
2614
2618
|
justify-content: center;
|
|
2615
2619
|
background-color: var(--card);
|
|
2616
2620
|
}
|
|
2621
|
+
.courier-brand-editor .tippy-box {
|
|
2622
|
+
background-color: transparent !important;
|
|
2623
|
+
}
|
|
2624
|
+
.courier-brand-editor .tippy-arrow {
|
|
2625
|
+
display: none;
|
|
2626
|
+
}
|
|
2627
|
+
.courier-brand-editor .ProseMirror .react-renderer.node-paragraph .selected-element .node-element::before {
|
|
2628
|
+
display: none;
|
|
2629
|
+
}
|
|
2630
|
+
.courier-brand-editor .ProseMirror .react-renderer.node-paragraph .selected-element .courier-actions-panel {
|
|
2631
|
+
display: none;
|
|
2632
|
+
}
|
|
2633
|
+
.courier-brand-editor .ProseMirror .react-renderer.node-paragraph .draggable-item > div {
|
|
2634
|
+
padding: 0px;
|
|
2635
|
+
}
|
|
2636
|
+
.courier-brand-editor .ProseMirror .react-renderer [data-cypress="draggable-handle"] {
|
|
2637
|
+
display: none;
|
|
2638
|
+
}
|
|
2639
|
+
.courier-brand-editor .ProseMirror .react-renderer:hover [data-cypress="draggable-handle"], .courier-brand-editor .ProseMirror .react-renderer:active [data-cypress="draggable-handle"] {
|
|
2640
|
+
display: none;
|
|
2641
|
+
}
|
|
2642
|
+
.courier-brand-editor .ProseMirror .react-renderer:hover .node-element > div::before, .courier-brand-editor .ProseMirror .react-renderer:active .node-element > div::before {
|
|
2643
|
+
display: none;
|
|
2644
|
+
}
|
|
2617
2645
|
.courier-brand-editor-readonly {
|
|
2618
2646
|
pointer-events: none;
|
|
2619
2647
|
}
|
|
@@ -3040,10 +3068,15 @@ body {
|
|
|
3040
3068
|
.ProseMirror > .react-renderer.node-divider {
|
|
3041
3069
|
justify-content: center;
|
|
3042
3070
|
}
|
|
3043
|
-
.ProseMirror > .react-renderer.node-variable {
|
|
3044
|
-
margin: 0px;
|
|
3071
|
+
.ProseMirror > .react-renderer .node-variable {
|
|
3072
|
+
margin-top: 0px;
|
|
3073
|
+
margin-bottom: 0px;
|
|
3045
3074
|
}
|
|
3046
|
-
.ProseMirror > .react-renderer.node-variable {
|
|
3075
|
+
.ProseMirror > .react-renderer .node-variable {
|
|
3076
|
+
margin-left: 0.25rem !important;
|
|
3077
|
+
margin-right: 0.25rem !important;
|
|
3078
|
+
}
|
|
3079
|
+
.ProseMirror > .react-renderer .node-variable {
|
|
3047
3080
|
display: inline-block;
|
|
3048
3081
|
}
|
|
3049
3082
|
.ProseMirror > .react-renderer.node-dragPlaceholder {
|
|
@@ -4450,16 +4483,106 @@ body {
|
|
|
4450
4483
|
font-size: 0.8rem;
|
|
4451
4484
|
padding: 0;
|
|
4452
4485
|
}
|
|
4486
|
+
.courier-variable-chip {
|
|
4487
|
+
position: relative;
|
|
4488
|
+
display: inline-flex;
|
|
4489
|
+
max-width: 100%;
|
|
4490
|
+
align-items: center;
|
|
4491
|
+
padding-right: 0.375rem;
|
|
4492
|
+
padding-left: 1.5rem;
|
|
4493
|
+
|
|
4494
|
+
font-size: inherit;
|
|
4495
|
+
font-family: inherit;
|
|
4496
|
+
font-weight: inherit;
|
|
4497
|
+
}
|
|
4498
|
+
/* Default state - yellow/warning (no value) */
|
|
4499
|
+
.courier-variable-chip:before {
|
|
4500
|
+
content: "";
|
|
4501
|
+
}
|
|
4502
|
+
.courier-variable-chip:before {
|
|
4503
|
+
position: absolute;
|
|
4504
|
+
}
|
|
4505
|
+
.courier-variable-chip:before {
|
|
4506
|
+
left: 0px;
|
|
4507
|
+
}
|
|
4508
|
+
.courier-variable-chip:before {
|
|
4509
|
+
top: 1px;
|
|
4510
|
+
}
|
|
4511
|
+
.courier-variable-chip:before {
|
|
4512
|
+
height: 100%;
|
|
4513
|
+
}
|
|
4514
|
+
.courier-variable-chip:before {
|
|
4515
|
+
width: 100%;
|
|
4516
|
+
}
|
|
4517
|
+
.courier-variable-chip:before {
|
|
4518
|
+
border-radius: 0.25rem;
|
|
4519
|
+
}
|
|
4520
|
+
.courier-variable-chip:before {
|
|
4521
|
+
border-width: 1px;
|
|
4522
|
+
}
|
|
4523
|
+
.courier-variable-chip:before {
|
|
4524
|
+
background-color: #fffbeb;
|
|
4525
|
+
border-color: #fde68a;
|
|
4526
|
+
}
|
|
4527
|
+
/* Icon container - absolutely positioned */
|
|
4528
|
+
.courier-variable-chip > span:first-child {
|
|
4529
|
+
position: absolute;
|
|
4530
|
+
}
|
|
4531
|
+
.courier-variable-chip > span:first-child {
|
|
4532
|
+
left: 0.25rem;
|
|
4533
|
+
}
|
|
4534
|
+
.courier-variable-chip > span:first-child {
|
|
4535
|
+
top: 50%;
|
|
4536
|
+
}
|
|
4537
|
+
.courier-variable-chip > span:first-child {
|
|
4538
|
+
z-index: 10;
|
|
4539
|
+
}
|
|
4540
|
+
.courier-variable-chip > span:first-child {
|
|
4541
|
+
--tw-translate-y: -50%;
|
|
4542
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
4543
|
+
}
|
|
4544
|
+
/* Text span */
|
|
4545
|
+
.courier-variable-chip > span:last-child {
|
|
4546
|
+
position: relative;
|
|
4547
|
+
}
|
|
4548
|
+
.courier-variable-chip > span:last-child {
|
|
4549
|
+
z-index: 10;
|
|
4550
|
+
}
|
|
4551
|
+
.courier-variable-chip > span:last-child {
|
|
4552
|
+
color: #92400e;
|
|
4553
|
+
}
|
|
4554
|
+
/* Has value state - blue */
|
|
4555
|
+
.courier-variable-chip.courier-variable-chip-has-value:before {
|
|
4556
|
+
background-color: #eff6ff;
|
|
4557
|
+
border-color: #bfdbfe;
|
|
4558
|
+
}
|
|
4559
|
+
.courier-variable-chip.courier-variable-chip-has-value > span:last-child {
|
|
4560
|
+
color: #1e40af;
|
|
4561
|
+
}
|
|
4562
|
+
/* Invalid state - reddish */
|
|
4563
|
+
.courier-variable-chip.courier-variable-chip-invalid:before {
|
|
4564
|
+
background-color: #fef2f2;
|
|
4565
|
+
border-color: #fecaca;
|
|
4566
|
+
}
|
|
4567
|
+
.courier-variable-chip.courier-variable-chip-invalid > span:last-child {
|
|
4568
|
+
color: #991b1b;
|
|
4569
|
+
}
|
|
4453
4570
|
/* Variable Textarea placeholder styles */
|
|
4454
|
-
.variable-textarea-placeholder
|
|
4455
|
-
|
|
4456
|
-
content: attr(data-placeholder);
|
|
4457
|
-
float: left;
|
|
4458
|
-
color: var(--muted-foreground);
|
|
4459
|
-
pointer-events: none;
|
|
4460
|
-
height: 0;
|
|
4571
|
+
.variable-textarea-placeholder {
|
|
4572
|
+
cursor: text;
|
|
4461
4573
|
}
|
|
4574
|
+
.variable-textarea-placeholder .ProseMirror p.is-editor-empty:first-child::before,
|
|
4575
|
+
.variable-textarea-placeholder .ProseMirror p.is-empty:first-child::before {
|
|
4576
|
+
content: attr(data-placeholder);
|
|
4577
|
+
float: left;
|
|
4578
|
+
color: var(--muted-foreground);
|
|
4579
|
+
pointer-events: none;
|
|
4580
|
+
height: 0;
|
|
4581
|
+
}
|
|
4462
4582
|
/* Variable Input placeholder styles */
|
|
4583
|
+
.variable-input-placeholder {
|
|
4584
|
+
cursor: text;
|
|
4585
|
+
}
|
|
4463
4586
|
.variable-input-placeholder .ProseMirror {
|
|
4464
4587
|
width: 100%;
|
|
4465
4588
|
}
|
|
@@ -4470,7 +4593,7 @@ body {
|
|
|
4470
4593
|
margin: 0px;
|
|
4471
4594
|
}
|
|
4472
4595
|
.variable-input-placeholder .ProseMirror p {
|
|
4473
|
-
height:
|
|
4596
|
+
height: 28px;
|
|
4474
4597
|
}
|
|
4475
4598
|
.variable-input-placeholder .ProseMirror p {
|
|
4476
4599
|
width: 100%;
|
|
@@ -4485,7 +4608,7 @@ body {
|
|
|
4485
4608
|
padding: 0px;
|
|
4486
4609
|
}
|
|
4487
4610
|
.variable-input-placeholder .ProseMirror p {
|
|
4488
|
-
line-height:
|
|
4611
|
+
line-height: 28px;
|
|
4489
4612
|
}
|
|
4490
4613
|
.variable-input-placeholder .ProseMirror p {
|
|
4491
4614
|
outline: 2px solid transparent;
|
|
@@ -4552,6 +4675,10 @@ body {
|
|
|
4552
4675
|
.hover\:courier-bg-card:hover {
|
|
4553
4676
|
background-color: var(--card);
|
|
4554
4677
|
}
|
|
4678
|
+
.hover\:courier-bg-gray-100:hover {
|
|
4679
|
+
--tw-bg-opacity: 1;
|
|
4680
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
|
4681
|
+
}
|
|
4555
4682
|
.hover\:courier-bg-neutral-100:hover {
|
|
4556
4683
|
--tw-bg-opacity: 1;
|
|
4557
4684
|
background-color: rgb(245 245 245 / var(--tw-bg-opacity, 1));
|
|
@@ -4593,12 +4720,20 @@ body {
|
|
|
4593
4720
|
.focus\:courier-bg-accent:focus {
|
|
4594
4721
|
background-color: var(--accent);
|
|
4595
4722
|
}
|
|
4723
|
+
.focus\:courier-bg-gray-100:focus {
|
|
4724
|
+
--tw-bg-opacity: 1;
|
|
4725
|
+
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
|
|
4726
|
+
}
|
|
4596
4727
|
.focus\:courier-text-accent-foreground:focus {
|
|
4597
4728
|
color: var(--accent-foreground);
|
|
4598
4729
|
}
|
|
4599
4730
|
.focus\:courier-text-foreground:focus {
|
|
4600
4731
|
color: var(--foreground);
|
|
4601
4732
|
}
|
|
4733
|
+
.focus\:courier-outline-none:focus {
|
|
4734
|
+
outline: 2px solid transparent;
|
|
4735
|
+
outline-offset: 2px;
|
|
4736
|
+
}
|
|
4602
4737
|
.focus-visible\:courier-outline-none:focus-visible {
|
|
4603
4738
|
outline: 2px solid transparent;
|
|
4604
4739
|
outline-offset: 2px;
|
|
@@ -4820,6 +4955,14 @@ body {
|
|
|
4820
4955
|
.dark\:courier-bg-foreground:is(.courier-dark *) {
|
|
4821
4956
|
background-color: var(--foreground);
|
|
4822
4957
|
}
|
|
4958
|
+
.dark\:courier-bg-gray-700:is(.courier-dark *) {
|
|
4959
|
+
--tw-bg-opacity: 1;
|
|
4960
|
+
background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
|
|
4961
|
+
}
|
|
4962
|
+
.dark\:courier-bg-gray-800:is(.courier-dark *) {
|
|
4963
|
+
--tw-bg-opacity: 1;
|
|
4964
|
+
background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
|
|
4965
|
+
}
|
|
4823
4966
|
.dark\:courier-bg-neutral-700:is(.courier-dark *) {
|
|
4824
4967
|
--tw-bg-opacity: 1;
|
|
4825
4968
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
|
|
@@ -4888,6 +5031,10 @@ body {
|
|
|
4888
5031
|
.dark\:courier-outline-neutral-300:is(.courier-dark *) {
|
|
4889
5032
|
outline-color: #d4d4d4;
|
|
4890
5033
|
}
|
|
5034
|
+
.dark\:hover\:courier-bg-gray-700:hover:is(.courier-dark *) {
|
|
5035
|
+
--tw-bg-opacity: 1;
|
|
5036
|
+
background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
|
|
5037
|
+
}
|
|
4891
5038
|
.dark\:hover\:courier-bg-neutral-600:hover:is(.courier-dark *) {
|
|
4892
5039
|
--tw-bg-opacity: 1;
|
|
4893
5040
|
background-color: rgb(82 82 82 / var(--tw-bg-opacity, 1));
|
|
@@ -4929,6 +5076,10 @@ body {
|
|
|
4929
5076
|
--tw-text-opacity: 1;
|
|
4930
5077
|
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
|
|
4931
5078
|
}
|
|
5079
|
+
.dark\:focus\:courier-bg-gray-700:focus:is(.courier-dark *) {
|
|
5080
|
+
--tw-bg-opacity: 1;
|
|
5081
|
+
background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
|
|
5082
|
+
}
|
|
4932
5083
|
.dark\:active\:courier-bg-neutral-700:active:is(.courier-dark *) {
|
|
4933
5084
|
--tw-bg-opacity: 1;
|
|
4934
5085
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
|
|
@@ -5005,15 +5156,9 @@ body {
|
|
|
5005
5156
|
.\[\&\>svg\]\:courier-shrink-0>svg {
|
|
5006
5157
|
flex-shrink: 0;
|
|
5007
5158
|
}
|
|
5008
|
-
.\[\&_\.ProseMirror\]\:courier-h-\[25px\] .ProseMirror {
|
|
5009
|
-
height: 25px;
|
|
5010
|
-
}
|
|
5011
5159
|
.\[\&_\.ProseMirror\]\:courier-min-h-\[20px\] .ProseMirror {
|
|
5012
5160
|
min-height: 20px;
|
|
5013
5161
|
}
|
|
5014
|
-
.\[\&_\.ProseMirror\]\:courier-flex-1 .ProseMirror {
|
|
5015
|
-
flex: 1 1 0%;
|
|
5016
|
-
}
|
|
5017
5162
|
.\[\&_\.ProseMirror\]\:courier-border-none .ProseMirror {
|
|
5018
5163
|
border-style: none;
|
|
5019
5164
|
}
|
|
@@ -5,17 +5,17 @@ export declare const ElementalSchema: z.ZodObject<{
|
|
|
5
5
|
version: z.ZodLiteral<"2022-01-01">;
|
|
6
6
|
elements: z.ZodArray<z.ZodType<ElementalNode, z.ZodTypeDef, ElementalNode>, "many">;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
version: "2022-01-01";
|
|
9
8
|
elements: ElementalNode[];
|
|
10
|
-
}, {
|
|
11
9
|
version: "2022-01-01";
|
|
10
|
+
}, {
|
|
12
11
|
elements: ElementalNode[];
|
|
12
|
+
version: "2022-01-01";
|
|
13
13
|
}>;
|
|
14
14
|
export declare const validateElemental: (json: unknown) => {
|
|
15
15
|
success: boolean;
|
|
16
16
|
data: {
|
|
17
|
-
version: "2022-01-01";
|
|
18
17
|
elements: ElementalNode[];
|
|
18
|
+
version: "2022-01-01";
|
|
19
19
|
};
|
|
20
20
|
errors?: undefined;
|
|
21
21
|
} | {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for custom variable validation in the editor.
|
|
3
|
+
* Allows consumers to restrict which variable names are allowed and
|
|
4
|
+
* define the behavior when validation fails.
|
|
5
|
+
*/
|
|
6
|
+
export interface VariableValidationConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Custom validator function that runs AFTER built-in format validation passes
|
|
9
|
+
* (unless `overrideFormatValidation` is true).
|
|
10
|
+
*
|
|
11
|
+
* @param variableName - The variable name to validate (without curly braces)
|
|
12
|
+
* @returns true if the variable is allowed, false otherwise
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* // Only allow variables from a predefined list
|
|
17
|
+
* validate: (name) => ['user.name', 'user.email', 'order.total'].includes(name)
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
validate?: (variableName: string) => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Behavior when validation fails.
|
|
23
|
+
* - 'mark': Keep the chip with invalid styling (default, shows red styling)
|
|
24
|
+
* - 'remove': Delete the chip entirely
|
|
25
|
+
*
|
|
26
|
+
* @default 'mark'
|
|
27
|
+
*/
|
|
28
|
+
onInvalid?: "mark" | "remove";
|
|
29
|
+
/**
|
|
30
|
+
* Message to show as a toast notification when validation fails.
|
|
31
|
+
* Can be a static string or a function that receives the variable name
|
|
32
|
+
* for dynamic messages.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Static message
|
|
37
|
+
* invalidMessage: "This variable is not available"
|
|
38
|
+
*
|
|
39
|
+
* // Dynamic message
|
|
40
|
+
* invalidMessage: (name) => `Variable "${name}" is not in the allowed list`
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
invalidMessage?: string | ((variableName: string) => string);
|
|
44
|
+
/**
|
|
45
|
+
* If true, bypasses the built-in format validation entirely.
|
|
46
|
+
* Only the custom `validate` function will be used for validation.
|
|
47
|
+
*
|
|
48
|
+
* Use with caution - invalid formats may cause issues with downstream processing.
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
overrideFormatValidation?: boolean;
|
|
53
|
+
}
|
package/package.json
CHANGED