@trycourier/react-designer 0.0.0-canary-20251030110654 → 0.0.0-canary-20251104171315

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.
@@ -1640,10 +1640,6 @@ body {
1640
1640
  --tw-border-opacity: 1;
1641
1641
  border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
1642
1642
  }
1643
- .courier-border-\[\#BFDBFE\] {
1644
- --tw-border-opacity: 1;
1645
- border-color: rgb(191 219 254 / var(--tw-border-opacity, 1));
1646
- }
1647
1643
  .courier-border-accent-foreground {
1648
1644
  border-color: var(--accent-foreground);
1649
1645
  }
@@ -1743,10 +1739,6 @@ body {
1743
1739
  --tw-bg-opacity: 1;
1744
1740
  background-color: rgb(229 229 229 / var(--tw-bg-opacity, 1));
1745
1741
  }
1746
- .courier-bg-\[\#EFF6FF\] {
1747
- --tw-bg-opacity: 1;
1748
- background-color: rgb(239 246 255 / var(--tw-bg-opacity, 1));
1749
- }
1750
1742
  .courier-bg-\[\#F5F5F5\] {
1751
1743
  --tw-bg-opacity: 1;
1752
1744
  background-color: rgb(245 245 245 / var(--tw-bg-opacity, 1));
@@ -26,3 +26,6 @@ export declare const isTemplateTransitioningAtom: import("jotai").PrimitiveAtom<
26
26
  export declare const isSidebarExpandedAtom: import("jotai").PrimitiveAtom<boolean> & {
27
27
  init: boolean;
28
28
  };
29
+ export declare const variableValuesAtom: import("jotai").PrimitiveAtom<Record<string, string>> & {
30
+ init: Record<string, string>;
31
+ };
@@ -1,2 +1,6 @@
1
1
  import React from "react";
2
- export declare const VariableIcon: React.FC;
2
+ interface VariableIconProps {
3
+ color?: string;
4
+ }
5
+ export declare const VariableIcon: React.FC<VariableIconProps>;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Extension } from "@tiptap/core";
2
+ /**
3
+ * Extension that converts typed {{variableName}} patterns into variable nodes in real-time
4
+ */
5
+ export declare const VariableTypeHandler: Extension<any, any>;
@@ -1,3 +1,4 @@
1
1
  export * from "./Variable";
2
2
  export * from "./Variable.types";
3
3
  export * from "./VariablePaste";
4
+ export * from "./VariableTypeHandler";
@@ -24,4 +24,4 @@ export { Paragraph } from "./Paragraph";
24
24
  export { Selection } from "./Selection";
25
25
  export { SlashMenu } from "./SlashMenu";
26
26
  export { UniqueId } from "./UniqueId";
27
- export { Variable, VariableNode, VariablePaste } from "./Variable";
27
+ export { Variable, VariableNode, VariablePaste, VariableTypeHandler } from "./Variable";
@@ -1 +1,2 @@
1
1
  export * from "./useNodeAttributes";
2
+ export * from "./useVariables";
@@ -0,0 +1,36 @@
1
+ import type { ChannelType } from "@/store";
2
+ export interface UseVariablesResult {
3
+ /**
4
+ * All available variables from the editor configuration
5
+ */
6
+ availableVariables: string[];
7
+ /**
8
+ * Variables that are actually used in the channel's content
9
+ */
10
+ usedVariables: string[];
11
+ /**
12
+ * Current variable values (for preview/testing)
13
+ */
14
+ variableValues: Record<string, string>;
15
+ /**
16
+ * Update a variable's value
17
+ */
18
+ addVariableValue: (key: string, value: string) => void;
19
+ }
20
+ /**
21
+ * Hook to access and manage variables for a specific channel
22
+ *
23
+ * @param channelType - The channel to get variables for (e.g., 'email', 'sms', 'slack')
24
+ * @returns Object containing available variables, used variables, current values, and update function
25
+ *
26
+ * @example
27
+ * ```tsx
28
+ * const { availableVariables, usedVariables, variableValues, addVariableValue } = useVariables('email');
29
+ *
30
+ * // availableVariables = ['user.name', 'user.email', 'orderTotal']
31
+ * // usedVariables = ['user.name', 'orderTotal']
32
+ *
33
+ * addVariableValue('user.name', 'John Doe');
34
+ * ```
35
+ */
36
+ export declare const useVariables: (channelType?: ChannelType) => UseVariablesResult;
@@ -0,0 +1,6 @@
1
+ import type { ElementalNode } from "../../types/elemental.types";
2
+ /**
3
+ * Extracts all variable names used in the content in the format {{variableName}}
4
+ * Supports nested dot notation like {{user.profile.name}}
5
+ */
6
+ export declare const extractVariablesFromContent: (elements?: ElementalNode[]) => string[];