@daisychainapp/maily-to-core 0.0.22 → 0.0.24
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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:
|
|
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) => {
|
|
@@ -3646,20 +3649,7 @@ function ImageBubbleMenu(props) {
|
|
|
3646
3649
|
}
|
|
3647
3650
|
)
|
|
3648
3651
|
] })
|
|
3649
|
-
] })
|
|
3650
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Divider, {}),
|
|
3651
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3652
|
-
ShowPopover,
|
|
3653
|
-
{
|
|
3654
|
-
showIfKey: state.currentShowIfKey,
|
|
3655
|
-
onShowIfKeyValueChange: (value) => {
|
|
3656
|
-
editor == null ? void 0 : editor.chain().updateAttributes(state.isLogoActive ? "logo" : "image", {
|
|
3657
|
-
showIfKey: value
|
|
3658
|
-
}).run();
|
|
3659
|
-
},
|
|
3660
|
-
editor
|
|
3661
|
-
}
|
|
3662
|
-
)
|
|
3652
|
+
] })
|
|
3663
3653
|
] })
|
|
3664
3654
|
})
|
|
3665
3655
|
);
|
|
@@ -4108,19 +4098,6 @@ function SectionBubbleMenu(props) {
|
|
|
4108
4098
|
}
|
|
4109
4099
|
}
|
|
4110
4100
|
),
|
|
4111
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
4112
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4113
|
-
ShowPopover,
|
|
4114
|
-
{
|
|
4115
|
-
showIfKey: state.currentShowIfKey,
|
|
4116
|
-
onShowIfKeyValueChange: (value) => {
|
|
4117
|
-
editor.commands.updateSection({
|
|
4118
|
-
showIfKey: value
|
|
4119
|
-
});
|
|
4120
|
-
},
|
|
4121
|
-
editor
|
|
4122
|
-
}
|
|
4123
|
-
),
|
|
4124
4101
|
state.isColumnsActive && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
4125
4102
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Divider, {}),
|
|
4126
4103
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Popover, { children: [
|
|
@@ -4284,28 +4261,15 @@ function SpacerBubbleMenu(props) {
|
|
|
4284
4261
|
import_react35.BubbleMenu,
|
|
4285
4262
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
4286
4263
|
className: "mly-flex mly-gap-0.5 mly-rounded-lg mly-border mly-border-slate-200 mly-bg-white mly-p-0.5 mly-shadow-md",
|
|
4287
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime36.
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
)),
|
|
4297
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Divider, {}),
|
|
4298
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4299
|
-
ShowPopover,
|
|
4300
|
-
{
|
|
4301
|
-
showIfKey: state.currentShowIfKey,
|
|
4302
|
-
onShowIfKeyValueChange: (value) => {
|
|
4303
|
-
editor.commands.setSpacerShowIfKey(value);
|
|
4304
|
-
},
|
|
4305
|
-
editor
|
|
4306
|
-
}
|
|
4307
|
-
)
|
|
4308
|
-
] })
|
|
4264
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4265
|
+
BubbleMenuButton,
|
|
4266
|
+
__spreadValues({
|
|
4267
|
+
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
4268
|
+
iconClassName: "mly-w-3 mly-h-3",
|
|
4269
|
+
nameClassName: "mly-text-xs"
|
|
4270
|
+
}, item),
|
|
4271
|
+
index
|
|
4272
|
+
)) })
|
|
4309
4273
|
})
|
|
4310
4274
|
);
|
|
4311
4275
|
}
|
|
@@ -4682,7 +4646,8 @@ function ButtonLabelInput(props) {
|
|
|
4682
4646
|
const {
|
|
4683
4647
|
variables = [],
|
|
4684
4648
|
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
4685
|
-
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
4649
|
+
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
|
|
4650
|
+
placeholderUrl = DEFAULT_PLACEHOLDER_URL
|
|
4686
4651
|
} = useMailyContext();
|
|
4687
4652
|
const autoCompleteOptions = (0, import_react39.useMemo)(() => {
|
|
4688
4653
|
const withoutTrigger = value.replace(
|
|
@@ -4726,7 +4691,7 @@ function ButtonLabelInput(props) {
|
|
|
4726
4691
|
},
|
|
4727
4692
|
autoCompleteOptions,
|
|
4728
4693
|
ref: linkInputRef,
|
|
4729
|
-
placeholder:
|
|
4694
|
+
placeholder: placeholderUrl,
|
|
4730
4695
|
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
4696
|
triggerChar: variableTriggerCharacter,
|
|
4732
4697
|
onSelectOption: (value2) => {
|
|
@@ -4923,20 +4888,7 @@ function ButtonView(props) {
|
|
|
4923
4888
|
}
|
|
4924
4889
|
}
|
|
4925
4890
|
)
|
|
4926
|
-
] })
|
|
4927
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Divider, {}),
|
|
4928
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4929
|
-
ShowPopover,
|
|
4930
|
-
{
|
|
4931
|
-
showIfKey,
|
|
4932
|
-
onShowIfKeyValueChange: (value) => {
|
|
4933
|
-
updateAttributes2({
|
|
4934
|
-
showIfKey: value
|
|
4935
|
-
});
|
|
4936
|
-
},
|
|
4937
|
-
editor
|
|
4938
|
-
}
|
|
4939
|
-
)
|
|
4891
|
+
] })
|
|
4940
4892
|
] }) })
|
|
4941
4893
|
}
|
|
4942
4894
|
)
|
|
@@ -6542,7 +6494,8 @@ function Editor9(props) {
|
|
|
6542
6494
|
variables = DEFAULT_VARIABLES,
|
|
6543
6495
|
blocks = DEFAULT_SLASH_COMMANDS,
|
|
6544
6496
|
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
6545
|
-
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
6497
|
+
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
|
|
6498
|
+
placeholderUrl = DEFAULT_PLACEHOLDER_URL
|
|
6546
6499
|
} = props;
|
|
6547
6500
|
let formattedContent = null;
|
|
6548
6501
|
if (contentJson) {
|
|
@@ -6609,6 +6562,7 @@ function Editor9(props) {
|
|
|
6609
6562
|
blocks,
|
|
6610
6563
|
variableTriggerCharacter,
|
|
6611
6564
|
renderVariable,
|
|
6565
|
+
placeholderUrl,
|
|
6612
6566
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6613
6567
|
"div",
|
|
6614
6568
|
{
|