@trycourier/react-designer 0.0.0-canary-20251211163746 → 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 +74 -18
- 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/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 +74 -18
- package/dist/index.d.ts +14 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/styles.css +74 -18
- 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/esm/styles.css
CHANGED
|
@@ -1000,6 +1000,9 @@ body {
|
|
|
1000
1000
|
.courier-z-50 {
|
|
1001
1001
|
z-index: 50;
|
|
1002
1002
|
}
|
|
1003
|
+
.courier-z-\[9999\] {
|
|
1004
|
+
z-index: 9999;
|
|
1005
|
+
}
|
|
1003
1006
|
.courier-z-\[999\] {
|
|
1004
1007
|
z-index: 999;
|
|
1005
1008
|
}
|
|
@@ -1138,9 +1141,6 @@ body {
|
|
|
1138
1141
|
.courier-mt-1 {
|
|
1139
1142
|
margin-top: 0.25rem;
|
|
1140
1143
|
}
|
|
1141
|
-
.courier-mt-12 {
|
|
1142
|
-
margin-top: 3rem;
|
|
1143
|
-
}
|
|
1144
1144
|
.courier-mt-2 {
|
|
1145
1145
|
margin-top: 0.5rem;
|
|
1146
1146
|
}
|
|
@@ -1252,9 +1252,6 @@ body {
|
|
|
1252
1252
|
.courier-h-\[28px\] {
|
|
1253
1253
|
height: 28px;
|
|
1254
1254
|
}
|
|
1255
|
-
.courier-h-\[300px\] {
|
|
1256
|
-
height: 300px;
|
|
1257
|
-
}
|
|
1258
1255
|
.courier-h-\[48px\] {
|
|
1259
1256
|
height: 48px;
|
|
1260
1257
|
}
|
|
@@ -1282,6 +1279,9 @@ body {
|
|
|
1282
1279
|
.courier-h-px {
|
|
1283
1280
|
height: 1px;
|
|
1284
1281
|
}
|
|
1282
|
+
.courier-max-h-60 {
|
|
1283
|
+
max-height: 15rem;
|
|
1284
|
+
}
|
|
1285
1285
|
.courier-max-h-\[88px\] {
|
|
1286
1286
|
max-height: 88px;
|
|
1287
1287
|
}
|
|
@@ -1309,9 +1309,6 @@ body {
|
|
|
1309
1309
|
.courier-w-1 {
|
|
1310
1310
|
width: 0.25rem;
|
|
1311
1311
|
}
|
|
1312
|
-
.courier-w-1\/2 {
|
|
1313
|
-
width: 50%;
|
|
1314
|
-
}
|
|
1315
1312
|
.courier-w-12 {
|
|
1316
1313
|
width: 3rem;
|
|
1317
1314
|
}
|
|
@@ -2524,8 +2521,9 @@ body {
|
|
|
2524
2521
|
opacity: 1;
|
|
2525
2522
|
}
|
|
2526
2523
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2524
|
+
.theme-container {
|
|
2525
|
+
text-align: left;
|
|
2526
|
+
}
|
|
2529
2527
|
/* Dark mode override for number input spin buttons */
|
|
2530
2528
|
.dark input[type="number"]::-webkit-inner-spin-button,
|
|
2531
2529
|
.dark input[type="number"]::-webkit-outer-spin-button {
|
|
@@ -2620,6 +2618,30 @@ body {
|
|
|
2620
2618
|
justify-content: center;
|
|
2621
2619
|
background-color: var(--card);
|
|
2622
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
|
+
}
|
|
2623
2645
|
.courier-brand-editor-readonly {
|
|
2624
2646
|
pointer-events: none;
|
|
2625
2647
|
}
|
|
@@ -4546,15 +4568,21 @@ body {
|
|
|
4546
4568
|
color: #991b1b;
|
|
4547
4569
|
}
|
|
4548
4570
|
/* Variable Textarea placeholder styles */
|
|
4549
|
-
.variable-textarea-placeholder
|
|
4550
|
-
|
|
4551
|
-
content: attr(data-placeholder);
|
|
4552
|
-
float: left;
|
|
4553
|
-
color: var(--muted-foreground);
|
|
4554
|
-
pointer-events: none;
|
|
4555
|
-
height: 0;
|
|
4571
|
+
.variable-textarea-placeholder {
|
|
4572
|
+
cursor: text;
|
|
4556
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
|
+
}
|
|
4557
4582
|
/* Variable Input placeholder styles */
|
|
4583
|
+
.variable-input-placeholder {
|
|
4584
|
+
cursor: text;
|
|
4585
|
+
}
|
|
4558
4586
|
.variable-input-placeholder .ProseMirror {
|
|
4559
4587
|
width: 100%;
|
|
4560
4588
|
}
|
|
@@ -4647,6 +4675,10 @@ body {
|
|
|
4647
4675
|
.hover\:courier-bg-card:hover {
|
|
4648
4676
|
background-color: var(--card);
|
|
4649
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
|
+
}
|
|
4650
4682
|
.hover\:courier-bg-neutral-100:hover {
|
|
4651
4683
|
--tw-bg-opacity: 1;
|
|
4652
4684
|
background-color: rgb(245 245 245 / var(--tw-bg-opacity, 1));
|
|
@@ -4688,12 +4720,20 @@ body {
|
|
|
4688
4720
|
.focus\:courier-bg-accent:focus {
|
|
4689
4721
|
background-color: var(--accent);
|
|
4690
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
|
+
}
|
|
4691
4727
|
.focus\:courier-text-accent-foreground:focus {
|
|
4692
4728
|
color: var(--accent-foreground);
|
|
4693
4729
|
}
|
|
4694
4730
|
.focus\:courier-text-foreground:focus {
|
|
4695
4731
|
color: var(--foreground);
|
|
4696
4732
|
}
|
|
4733
|
+
.focus\:courier-outline-none:focus {
|
|
4734
|
+
outline: 2px solid transparent;
|
|
4735
|
+
outline-offset: 2px;
|
|
4736
|
+
}
|
|
4697
4737
|
.focus-visible\:courier-outline-none:focus-visible {
|
|
4698
4738
|
outline: 2px solid transparent;
|
|
4699
4739
|
outline-offset: 2px;
|
|
@@ -4915,6 +4955,14 @@ body {
|
|
|
4915
4955
|
.dark\:courier-bg-foreground:is(.courier-dark *) {
|
|
4916
4956
|
background-color: var(--foreground);
|
|
4917
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
|
+
}
|
|
4918
4966
|
.dark\:courier-bg-neutral-700:is(.courier-dark *) {
|
|
4919
4967
|
--tw-bg-opacity: 1;
|
|
4920
4968
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
|
|
@@ -4983,6 +5031,10 @@ body {
|
|
|
4983
5031
|
.dark\:courier-outline-neutral-300:is(.courier-dark *) {
|
|
4984
5032
|
outline-color: #d4d4d4;
|
|
4985
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
|
+
}
|
|
4986
5038
|
.dark\:hover\:courier-bg-neutral-600:hover:is(.courier-dark *) {
|
|
4987
5039
|
--tw-bg-opacity: 1;
|
|
4988
5040
|
background-color: rgb(82 82 82 / var(--tw-bg-opacity, 1));
|
|
@@ -5024,6 +5076,10 @@ body {
|
|
|
5024
5076
|
--tw-text-opacity: 1;
|
|
5025
5077
|
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
|
|
5026
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
|
+
}
|
|
5027
5083
|
.dark\:active\:courier-bg-neutral-700:active:is(.courier-dark *) {
|
|
5028
5084
|
--tw-bg-opacity: 1;
|
|
5029
5085
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
|
package/dist/index.d.ts
CHANGED
|
@@ -2,5 +2,19 @@ export * from "./components/TemplateEditor";
|
|
|
2
2
|
export * from "./components/BrandEditor";
|
|
3
3
|
export * from "./components/Providers";
|
|
4
4
|
export * from "./components/hooks";
|
|
5
|
+
export type { VariableValidationConfig } from "./types/validation.types";
|
|
5
6
|
export * from "./lib/utils/errors";
|
|
6
7
|
export * from "./components/ui-kit/ErrorBoundary";
|
|
8
|
+
export { CHANNELS } from "@/channels";
|
|
9
|
+
export type { ChannelType } from "@/store";
|
|
10
|
+
export type { ElementalContent } from "@/types";
|
|
11
|
+
export { PreviewPanel } from "@/components/ui/PreviewPanel";
|
|
12
|
+
export { TextMenu } from "@/components/ui/TextMenu";
|
|
13
|
+
export { VariableInput, VariableTextarea } from "@/components/ui/VariableEditor";
|
|
14
|
+
export { getFlattenedVariables } from "@/components/utils/getFlattenedVariables";
|
|
15
|
+
export { Status as TemplateStatus } from "@/components/ui/Status";
|
|
16
|
+
export { ToggleGroup, ToggleGroupItem, Toggle, Divider, Input, InputColor, } from "@/components/ui-kit";
|
|
17
|
+
export { FacebookIcon, InstagramIcon, LinkedinIcon, MediumIcon, XIcon, } from "@/components/ui-kit/Icon";
|
|
18
|
+
export { cn, convertElementalToTiptap, convertTiptapToElemental } from "@/lib/utils";
|
|
19
|
+
export { useAutoSave } from "@/hooks/useAutoSave";
|
|
20
|
+
export { MonacoCodeEditor } from "@/components/extensions/CustomCode/MonacoCodeEditor";
|
package/dist/styles.css
CHANGED
|
@@ -1000,6 +1000,9 @@ body {
|
|
|
1000
1000
|
.courier-z-50 {
|
|
1001
1001
|
z-index: 50;
|
|
1002
1002
|
}
|
|
1003
|
+
.courier-z-\[9999\] {
|
|
1004
|
+
z-index: 9999;
|
|
1005
|
+
}
|
|
1003
1006
|
.courier-z-\[999\] {
|
|
1004
1007
|
z-index: 999;
|
|
1005
1008
|
}
|
|
@@ -1138,9 +1141,6 @@ body {
|
|
|
1138
1141
|
.courier-mt-1 {
|
|
1139
1142
|
margin-top: 0.25rem;
|
|
1140
1143
|
}
|
|
1141
|
-
.courier-mt-12 {
|
|
1142
|
-
margin-top: 3rem;
|
|
1143
|
-
}
|
|
1144
1144
|
.courier-mt-2 {
|
|
1145
1145
|
margin-top: 0.5rem;
|
|
1146
1146
|
}
|
|
@@ -1252,9 +1252,6 @@ body {
|
|
|
1252
1252
|
.courier-h-\[28px\] {
|
|
1253
1253
|
height: 28px;
|
|
1254
1254
|
}
|
|
1255
|
-
.courier-h-\[300px\] {
|
|
1256
|
-
height: 300px;
|
|
1257
|
-
}
|
|
1258
1255
|
.courier-h-\[48px\] {
|
|
1259
1256
|
height: 48px;
|
|
1260
1257
|
}
|
|
@@ -1282,6 +1279,9 @@ body {
|
|
|
1282
1279
|
.courier-h-px {
|
|
1283
1280
|
height: 1px;
|
|
1284
1281
|
}
|
|
1282
|
+
.courier-max-h-60 {
|
|
1283
|
+
max-height: 15rem;
|
|
1284
|
+
}
|
|
1285
1285
|
.courier-max-h-\[88px\] {
|
|
1286
1286
|
max-height: 88px;
|
|
1287
1287
|
}
|
|
@@ -1309,9 +1309,6 @@ body {
|
|
|
1309
1309
|
.courier-w-1 {
|
|
1310
1310
|
width: 0.25rem;
|
|
1311
1311
|
}
|
|
1312
|
-
.courier-w-1\/2 {
|
|
1313
|
-
width: 50%;
|
|
1314
|
-
}
|
|
1315
1312
|
.courier-w-12 {
|
|
1316
1313
|
width: 3rem;
|
|
1317
1314
|
}
|
|
@@ -2524,8 +2521,9 @@ body {
|
|
|
2524
2521
|
opacity: 1;
|
|
2525
2522
|
}
|
|
2526
2523
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2524
|
+
.theme-container {
|
|
2525
|
+
text-align: left;
|
|
2526
|
+
}
|
|
2529
2527
|
/* Dark mode override for number input spin buttons */
|
|
2530
2528
|
.dark input[type="number"]::-webkit-inner-spin-button,
|
|
2531
2529
|
.dark input[type="number"]::-webkit-outer-spin-button {
|
|
@@ -2620,6 +2618,30 @@ body {
|
|
|
2620
2618
|
justify-content: center;
|
|
2621
2619
|
background-color: var(--card);
|
|
2622
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
|
+
}
|
|
2623
2645
|
.courier-brand-editor-readonly {
|
|
2624
2646
|
pointer-events: none;
|
|
2625
2647
|
}
|
|
@@ -4546,15 +4568,21 @@ body {
|
|
|
4546
4568
|
color: #991b1b;
|
|
4547
4569
|
}
|
|
4548
4570
|
/* Variable Textarea placeholder styles */
|
|
4549
|
-
.variable-textarea-placeholder
|
|
4550
|
-
|
|
4551
|
-
content: attr(data-placeholder);
|
|
4552
|
-
float: left;
|
|
4553
|
-
color: var(--muted-foreground);
|
|
4554
|
-
pointer-events: none;
|
|
4555
|
-
height: 0;
|
|
4571
|
+
.variable-textarea-placeholder {
|
|
4572
|
+
cursor: text;
|
|
4556
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
|
+
}
|
|
4557
4582
|
/* Variable Input placeholder styles */
|
|
4583
|
+
.variable-input-placeholder {
|
|
4584
|
+
cursor: text;
|
|
4585
|
+
}
|
|
4558
4586
|
.variable-input-placeholder .ProseMirror {
|
|
4559
4587
|
width: 100%;
|
|
4560
4588
|
}
|
|
@@ -4647,6 +4675,10 @@ body {
|
|
|
4647
4675
|
.hover\:courier-bg-card:hover {
|
|
4648
4676
|
background-color: var(--card);
|
|
4649
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
|
+
}
|
|
4650
4682
|
.hover\:courier-bg-neutral-100:hover {
|
|
4651
4683
|
--tw-bg-opacity: 1;
|
|
4652
4684
|
background-color: rgb(245 245 245 / var(--tw-bg-opacity, 1));
|
|
@@ -4688,12 +4720,20 @@ body {
|
|
|
4688
4720
|
.focus\:courier-bg-accent:focus {
|
|
4689
4721
|
background-color: var(--accent);
|
|
4690
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
|
+
}
|
|
4691
4727
|
.focus\:courier-text-accent-foreground:focus {
|
|
4692
4728
|
color: var(--accent-foreground);
|
|
4693
4729
|
}
|
|
4694
4730
|
.focus\:courier-text-foreground:focus {
|
|
4695
4731
|
color: var(--foreground);
|
|
4696
4732
|
}
|
|
4733
|
+
.focus\:courier-outline-none:focus {
|
|
4734
|
+
outline: 2px solid transparent;
|
|
4735
|
+
outline-offset: 2px;
|
|
4736
|
+
}
|
|
4697
4737
|
.focus-visible\:courier-outline-none:focus-visible {
|
|
4698
4738
|
outline: 2px solid transparent;
|
|
4699
4739
|
outline-offset: 2px;
|
|
@@ -4915,6 +4955,14 @@ body {
|
|
|
4915
4955
|
.dark\:courier-bg-foreground:is(.courier-dark *) {
|
|
4916
4956
|
background-color: var(--foreground);
|
|
4917
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
|
+
}
|
|
4918
4966
|
.dark\:courier-bg-neutral-700:is(.courier-dark *) {
|
|
4919
4967
|
--tw-bg-opacity: 1;
|
|
4920
4968
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
|
|
@@ -4983,6 +5031,10 @@ body {
|
|
|
4983
5031
|
.dark\:courier-outline-neutral-300:is(.courier-dark *) {
|
|
4984
5032
|
outline-color: #d4d4d4;
|
|
4985
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
|
+
}
|
|
4986
5038
|
.dark\:hover\:courier-bg-neutral-600:hover:is(.courier-dark *) {
|
|
4987
5039
|
--tw-bg-opacity: 1;
|
|
4988
5040
|
background-color: rgb(82 82 82 / var(--tw-bg-opacity, 1));
|
|
@@ -5024,6 +5076,10 @@ body {
|
|
|
5024
5076
|
--tw-text-opacity: 1;
|
|
5025
5077
|
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
|
|
5026
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
|
+
}
|
|
5027
5083
|
.dark\:active\:courier-bg-neutral-700:active:is(.courier-dark *) {
|
|
5028
5084
|
--tw-bg-opacity: 1;
|
|
5029
5085
|
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
|
|
@@ -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