@daisychainapp/maily-to-core 0.0.22 → 0.0.23

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/dist/index.d.mts CHANGED
@@ -35,6 +35,7 @@ type RenderVariableOptions = {
35
35
  };
36
36
  type RenderVariableFunction = (opts: RenderVariableOptions) => JSX.Element | null;
37
37
  type MailyContextType = {
38
+ placeholderUrl?: string;
38
39
  variableTriggerCharacter?: string;
39
40
  variables?: Variables;
40
41
  blocks?: BlockItem[];
package/dist/index.d.ts CHANGED
@@ -35,6 +35,7 @@ type RenderVariableOptions = {
35
35
  };
36
36
  type RenderVariableFunction = (opts: RenderVariableOptions) => JSX.Element | null;
37
37
  type MailyContextType = {
38
+ placeholderUrl?: string;
38
39
  variableTriggerCharacter?: string;
39
40
  variables?: Variables;
40
41
  blocks?: BlockItem[];
package/dist/index.js CHANGED
@@ -1206,10 +1206,12 @@ var DefaultRenderVariable = (props) => {
1206
1206
 
1207
1207
  // src/editor/provider.tsx
1208
1208
  var import_jsx_runtime15 = require("react/jsx-runtime");
1209
+ var DEFAULT_PLACEHOLDER_URL = "maily.to/";
1209
1210
  var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
1210
1211
  var DEFAULT_VARIABLES = [];
1211
1212
  var DEFAULT_RENDER_VARIABLE_FUNCTION = DefaultRenderVariable;
1212
1213
  var MailyContext = (0, import_react7.createContext)({
1214
+ placeholderUrl: DEFAULT_PLACEHOLDER_URL,
1213
1215
  variableTriggerCharacter: DEFAULT_VARIABLE_TRIGGER_CHAR,
1214
1216
  variables: DEFAULT_VARIABLES,
1215
1217
  blocks: DEFAULT_SLASH_COMMANDS,
@@ -2618,7 +2620,8 @@ function LinkInputPopover(props) {
2618
2620
  const {
2619
2621
  variables = [],
2620
2622
  variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
2621
- renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
2623
+ renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
2624
+ placeholderUrl = DEFAULT_PLACEHOLDER_URL
2622
2625
  } = useMailyContext();
2623
2626
  const autoCompleteOptions = (0, import_react21.useMemo)(() => {
2624
2627
  const withoutTrigger = defaultUrlWithoutProtocol.replace(
@@ -2738,7 +2741,7 @@ function LinkInputPopover(props) {
2738
2741
  },
2739
2742
  autoCompleteOptions,
2740
2743
  ref: linkInputRef,
2741
- placeholder: "maily.to/",
2744
+ placeholder: placeholderUrl,
2742
2745
  className: "-mly-ms-px mly-block mly-h-8 mly-w-52 mly-rounded-lg mly-rounded-s-none mly-border mly-border-gray-300 mly-px-2 mly-py-1.5 mly-pr-6 mly-text-sm mly-shadow-sm mly-outline-none placeholder:mly-text-gray-400",
2743
2746
  triggerChar: variableTriggerCharacter,
2744
2747
  onSelectOption: (value) => {
@@ -4682,7 +4685,8 @@ function ButtonLabelInput(props) {
4682
4685
  const {
4683
4686
  variables = [],
4684
4687
  variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
4685
- renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
4688
+ renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
4689
+ placeholderUrl = DEFAULT_PLACEHOLDER_URL
4686
4690
  } = useMailyContext();
4687
4691
  const autoCompleteOptions = (0, import_react39.useMemo)(() => {
4688
4692
  const withoutTrigger = value.replace(
@@ -4726,7 +4730,7 @@ function ButtonLabelInput(props) {
4726
4730
  },
4727
4731
  autoCompleteOptions,
4728
4732
  ref: linkInputRef,
4729
- placeholder: "maily.to/",
4733
+ placeholder: placeholderUrl,
4730
4734
  className: "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
4731
4735
  triggerChar: variableTriggerCharacter,
4732
4736
  onSelectOption: (value2) => {
@@ -6542,7 +6546,8 @@ function Editor9(props) {
6542
6546
  variables = DEFAULT_VARIABLES,
6543
6547
  blocks = DEFAULT_SLASH_COMMANDS,
6544
6548
  variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
6545
- renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
6549
+ renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
6550
+ placeholderUrl = DEFAULT_PLACEHOLDER_URL
6546
6551
  } = props;
6547
6552
  let formattedContent = null;
6548
6553
  if (contentJson) {
@@ -6609,6 +6614,7 @@ function Editor9(props) {
6609
6614
  blocks,
6610
6615
  variableTriggerCharacter,
6611
6616
  renderVariable,
6617
+ placeholderUrl,
6612
6618
  children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
6613
6619
  "div",
6614
6620
  {