@trycourier/react-designer 0.0.0-canary-20250910201021 → 0.0.0-canary-20250911105839
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 +33 -1
- package/dist/cjs/index.js +43 -43
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/Providers/Providers.types.d.ts +8 -1
- package/dist/components/Providers/TemplateProvider.d.ts +3 -1
- package/dist/components/Providers/index.d.ts +2 -0
- package/dist/components/Providers/store.d.ts +0 -3
- package/dist/components/Providers/useImageUpload.d.ts +10 -0
- package/dist/esm/index.js +43 -43
- package/dist/esm/index.js.map +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -555,11 +555,43 @@ The Editor component is the core element that provides the template editing inte
|
|
|
555
555
|
| brandProps | BrandEditorProps | | Configuration options for the brand editor when enabled. Passed directly to the BrandEditor component. |
|
|
556
556
|
| hidePublish | boolean | false | When true, hides the "Publish Changes" button in the editor interface. |
|
|
557
557
|
| onChange | (value: ElementalContent) => void | | Callback function that fires whenever the editor content changes, providing the updated ElementalContent structure. |
|
|
558
|
-
| routing | { method: string; channels: string[] } | | Configures multi-channel routing behavior. The `method` property determines
|
|
558
|
+
| routing | { method: string; channels: string[] } | | Configures multi-channel routing and delivery behavior. The `method` property determines delivery strategy: "single" (deliver via first available channel) or "all" (deliver via all configured channels). The `channels` array defines which delivery channels are available in the editor. |
|
|
559
559
|
| theme | ThemeObj | cssClass | | Controls the visual appearance of the editor. Can be a Theme object with styling properties or a CSS class name. |
|
|
560
560
|
| value | ElementalContent | | Initial content for the editor in ElementalContent format. Used as the starting template when the editor loads. |
|
|
561
561
|
| variables | Record<string, any | | Custom variables available for template personalization. These can be referenced within the template content. |
|
|
562
562
|
|
|
563
|
+
### Multi-Channel Routing
|
|
564
|
+
|
|
565
|
+
The `routing` property allows you to configure which communication channels are available in the template editor and how messages are delivered to recipients. This gives you full control over the delivery strategy for your templates.
|
|
566
|
+
|
|
567
|
+
```tsx
|
|
568
|
+
import "@trycourier/react-designer/styles.css";
|
|
569
|
+
import { TemplateEditor, TemplateProvider } from "@trycourier/react-designer";
|
|
570
|
+
|
|
571
|
+
function App() {
|
|
572
|
+
return (
|
|
573
|
+
<TemplateProvider templateId="template-123" tenantId="tenant-123" token="jwt">
|
|
574
|
+
<TemplateEditor
|
|
575
|
+
routing={{
|
|
576
|
+
method: "single", // "single" for fallback delivery, "all" for simultaneous delivery
|
|
577
|
+
channels: ["email", "sms", "push"] // Available channels in the editor
|
|
578
|
+
}}
|
|
579
|
+
/>
|
|
580
|
+
</TemplateProvider>
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
**Channel Options:**
|
|
586
|
+
- `"email"` - Email delivery
|
|
587
|
+
- `"sms"` - SMS text messaging
|
|
588
|
+
- `"push"` - Push notifications
|
|
589
|
+
- `"inbox"` - In-app messaging
|
|
590
|
+
|
|
591
|
+
**Delivery Methods:**
|
|
592
|
+
- `"single"` - Delivers via the first available channel (fallback strategy)
|
|
593
|
+
- `"all"` - Delivers via all configured channels simultaneously
|
|
594
|
+
|
|
563
595
|
### Template Provider Properties
|
|
564
596
|
|
|
565
597
|
The TemplateProvider component wraps the Editor component and manages the template state, authentication, and data flow. It provides essential context and functionality needed for the editor to operate. Below are the key properties that can be configured when using the
|