@react-email/editor 0.0.0-experimental.4 → 0.0.0-experimental.41

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.
Files changed (74) hide show
  1. package/dist/core/index.cjs +9 -0
  2. package/dist/core/index.d.cts +2 -0
  3. package/dist/core/index.d.mts +3 -0
  4. package/dist/core/index.mjs +4 -0
  5. package/dist/create-paste-handler-B8BtjBk3.d.cts +14 -0
  6. package/dist/create-paste-handler-B8BtjBk3.d.cts.map +1 -0
  7. package/dist/create-paste-handler-CGR738bC.d.mts +14 -0
  8. package/dist/create-paste-handler-CGR738bC.d.mts.map +1 -0
  9. package/dist/event-bus-CHEzOS_O.mjs +329 -0
  10. package/dist/event-bus-CHEzOS_O.mjs.map +1 -0
  11. package/dist/event-bus-fb8U7hrl.cjs +450 -0
  12. package/dist/extension-DyY8_bh4.mjs +1110 -0
  13. package/dist/extension-DyY8_bh4.mjs.map +1 -0
  14. package/dist/extension-w5VaUeSw.cjs +1235 -0
  15. package/dist/extensions/index.cjs +51 -0
  16. package/dist/extensions/index.d.cts +399 -0
  17. package/dist/extensions/index.d.cts.map +1 -0
  18. package/dist/extensions/index.d.mts +400 -0
  19. package/dist/extensions/index.d.mts.map +1 -0
  20. package/dist/extensions/index.mjs +5 -0
  21. package/dist/extensions-BvfmaKCn.mjs +2088 -0
  22. package/dist/extensions-BvfmaKCn.mjs.map +1 -0
  23. package/dist/extensions-CkjPj2JO.cjs +2369 -0
  24. package/dist/global-content-D_WYaFgX.mjs +78 -0
  25. package/dist/global-content-D_WYaFgX.mjs.map +1 -0
  26. package/dist/global-content-bJgotqmA.cjs +89 -0
  27. package/dist/index-C4KcMQ0R.d.cts +161 -0
  28. package/dist/index-C4KcMQ0R.d.cts.map +1 -0
  29. package/dist/index-CxX7W63O.d.mts +161 -0
  30. package/dist/index-CxX7W63O.d.mts.map +1 -0
  31. package/dist/index.cjs +74 -0
  32. package/dist/index.css +832 -0
  33. package/dist/index.css.map +1 -0
  34. package/dist/index.d.cts +33 -0
  35. package/dist/index.d.cts.map +1 -0
  36. package/dist/index.d.mts +31 -277
  37. package/dist/index.d.mts.map +1 -1
  38. package/dist/index.mjs +64 -1377
  39. package/dist/index.mjs.map +1 -1
  40. package/dist/plugins/index.cjs +23 -0
  41. package/dist/plugins/index.d.cts +191 -0
  42. package/dist/plugins/index.d.cts.map +1 -0
  43. package/dist/plugins/index.d.mts +191 -0
  44. package/dist/plugins/index.d.mts.map +1 -0
  45. package/dist/plugins/index.mjs +3 -0
  46. package/dist/root-Jq1R3tkX.cjs +2832 -0
  47. package/dist/root-pS4l8bVZ.mjs +2316 -0
  48. package/dist/root-pS4l8bVZ.mjs.map +1 -0
  49. package/dist/set-text-alignment-Cv72txmv.cjs +24 -0
  50. package/dist/set-text-alignment-OA8IMWmO.mjs +19 -0
  51. package/dist/set-text-alignment-OA8IMWmO.mjs.map +1 -0
  52. package/dist/styles-C-cCyJCn.cjs +211 -0
  53. package/dist/styles-_TMw3YxC.mjs +194 -0
  54. package/dist/styles-_TMw3YxC.mjs.map +1 -0
  55. package/dist/ui/bubble-menu/bubble-menu.css +285 -0
  56. package/dist/ui/index.cjs +147 -0
  57. package/dist/ui/index.d.cts +939 -0
  58. package/dist/ui/index.d.cts.map +1 -0
  59. package/dist/ui/index.d.mts +939 -0
  60. package/dist/ui/index.d.mts.map +1 -0
  61. package/dist/ui/index.mjs +60 -0
  62. package/dist/ui/index.mjs.map +1 -0
  63. package/dist/ui/slash-command/slash-command.css +44 -0
  64. package/dist/ui/themes/default.css +830 -0
  65. package/dist/utils/index.cjs +3 -0
  66. package/dist/utils/index.d.cts +7 -0
  67. package/dist/utils/index.d.cts.map +1 -0
  68. package/dist/utils/index.d.mts +7 -0
  69. package/dist/utils/index.d.mts.map +1 -0
  70. package/dist/utils/index.mjs +3 -0
  71. package/package.json +109 -21
  72. package/dist/index.d.ts +0 -279
  73. package/dist/index.d.ts.map +0 -1
  74. package/dist/index.js +0 -1436
@@ -0,0 +1,194 @@
1
+ //#region src/utils/styles.ts
2
+ const WHITE_SPACE_REGEX = /\s+/;
3
+ const BORDER_WIDTH_TO_STYLE = {
4
+ borderWidth: "borderStyle",
5
+ borderTopWidth: "borderTopStyle",
6
+ borderRightWidth: "borderRightStyle",
7
+ borderBottomWidth: "borderBottomStyle",
8
+ borderLeftWidth: "borderLeftStyle"
9
+ };
10
+ const inlineCssToJs = (inlineStyle, options = {}) => {
11
+ const styleObject = {};
12
+ if (!inlineStyle || inlineStyle === "" || typeof inlineStyle === "object") return styleObject;
13
+ inlineStyle.split(";").forEach((style) => {
14
+ if (style.trim()) {
15
+ const [key, value] = style.split(":");
16
+ const valueTrimmed = value?.trim();
17
+ if (!valueTrimmed) return;
18
+ const formattedKey = key.trim().replace(/-\w/g, (match) => match[1].toUpperCase());
19
+ styleObject[formattedKey] = options?.removeUnit ? valueTrimmed.replace(/px|%/g, "") : valueTrimmed;
20
+ }
21
+ });
22
+ return styleObject;
23
+ };
24
+ /**
25
+ * Expands CSS shorthand properties (margin, padding) into their longhand equivalents.
26
+ * This prevents shorthand properties from overriding specific longhand properties in email clients.
27
+ *
28
+ * @param styles - Style object that may contain shorthand properties
29
+ * @returns New style object with shorthand properties expanded to longhand
30
+ *
31
+ * @example
32
+ * expandShorthandProperties({ margin: '0', paddingTop: '10px' })
33
+ * // Returns: { marginTop: '0', marginRight: '0', marginBottom: '0', marginLeft: '0', paddingTop: '10px' }
34
+ */
35
+ function expandShorthandProperties(styles) {
36
+ if (!styles || typeof styles !== "object") return {};
37
+ const expanded = {};
38
+ for (const key in styles) {
39
+ const value = styles[key];
40
+ if (value === void 0 || value === null || value === "") continue;
41
+ switch (key) {
42
+ case "margin": {
43
+ const values = parseShorthandValue(value);
44
+ expanded.marginTop = values.top;
45
+ expanded.marginRight = values.right;
46
+ expanded.marginBottom = values.bottom;
47
+ expanded.marginLeft = values.left;
48
+ break;
49
+ }
50
+ case "padding": {
51
+ const values = parseShorthandValue(value);
52
+ expanded.paddingTop = values.top;
53
+ expanded.paddingRight = values.right;
54
+ expanded.paddingBottom = values.bottom;
55
+ expanded.paddingLeft = values.left;
56
+ break;
57
+ }
58
+ case "border": {
59
+ const values = convertBorderValue(value);
60
+ expanded.borderStyle = values.style;
61
+ expanded.borderWidth = values.width;
62
+ expanded.borderColor = values.color;
63
+ break;
64
+ }
65
+ case "borderTopLeftRadius":
66
+ case "borderTopRightRadius":
67
+ case "borderBottomLeftRadius":
68
+ case "borderBottomRightRadius":
69
+ expanded[key] = value;
70
+ if (styles.borderTopLeftRadius && styles.borderTopRightRadius && styles.borderBottomLeftRadius && styles.borderBottomRightRadius) {
71
+ const values = [
72
+ styles.borderTopLeftRadius,
73
+ styles.borderTopRightRadius,
74
+ styles.borderBottomLeftRadius,
75
+ styles.borderBottomRightRadius
76
+ ];
77
+ if (new Set(values).size === 1) expanded.borderRadius = values[0];
78
+ }
79
+ break;
80
+ default: expanded[key] = value;
81
+ }
82
+ }
83
+ return expanded;
84
+ }
85
+ /**
86
+ * Parses CSS shorthand value (1-4 values) into individual side values.
87
+ * Follows CSS specification for shorthand property value parsing.
88
+ *
89
+ * @param value - Shorthand value string (e.g., '0', '10px 20px', '5px 10px 15px 20px')
90
+ * @returns Object with top, right, bottom, left values
91
+ */
92
+ function parseShorthandValue(value) {
93
+ const stringValue = String(value).trim();
94
+ const parts = stringValue.split(WHITE_SPACE_REGEX);
95
+ const len = parts.length;
96
+ if (len === 1) return {
97
+ top: parts[0],
98
+ right: parts[0],
99
+ bottom: parts[0],
100
+ left: parts[0]
101
+ };
102
+ if (len === 2) return {
103
+ top: parts[0],
104
+ right: parts[1],
105
+ bottom: parts[0],
106
+ left: parts[1]
107
+ };
108
+ if (len === 3) return {
109
+ top: parts[0],
110
+ right: parts[1],
111
+ bottom: parts[2],
112
+ left: parts[1]
113
+ };
114
+ if (len === 4) return {
115
+ top: parts[0],
116
+ right: parts[1],
117
+ bottom: parts[2],
118
+ left: parts[3]
119
+ };
120
+ return {
121
+ top: stringValue,
122
+ right: stringValue,
123
+ bottom: stringValue,
124
+ left: stringValue
125
+ };
126
+ }
127
+ function convertBorderValue(value) {
128
+ const stringValue = String(value).trim();
129
+ const parts = stringValue.split(WHITE_SPACE_REGEX);
130
+ switch (parts.length) {
131
+ case 1: return {
132
+ style: "solid",
133
+ width: parts[0],
134
+ color: "black"
135
+ };
136
+ case 2: return {
137
+ style: parts[1],
138
+ width: parts[0],
139
+ color: "black"
140
+ };
141
+ case 3: return {
142
+ style: parts[1],
143
+ width: parts[0],
144
+ color: parts[2]
145
+ };
146
+ case 4: return {
147
+ style: parts[1],
148
+ width: parts[0],
149
+ color: parts[2]
150
+ };
151
+ default: return {
152
+ style: "solid",
153
+ width: stringValue,
154
+ color: "black"
155
+ };
156
+ }
157
+ }
158
+ /**
159
+ * When a border-width is present but border-style is missing, browsers default
160
+ * to `none` and the border is invisible. This adds `solid` as a sensible
161
+ * fallback so borders show up immediately after setting a width.
162
+ */
163
+ function ensureBorderStyleFallback(styles) {
164
+ for (const [widthKey, styleKey] of Object.entries(BORDER_WIDTH_TO_STYLE)) {
165
+ const widthValue = styles[widthKey];
166
+ if (!widthValue || widthValue === "0" || widthValue === "0px") continue;
167
+ if (!styles[styleKey]) {
168
+ if (styleKey !== "borderStyle" && styles.borderStyle) continue;
169
+ styles[styleKey] = "solid";
170
+ }
171
+ }
172
+ return styles;
173
+ }
174
+ /**
175
+ * Resolves conflicts between reset styles and inline styles by expanding
176
+ * shorthand properties (margin, padding) to longhand before merging.
177
+ * This prevents shorthand properties from overriding specific longhand properties.
178
+ *
179
+ * @param resetStyles - Base reset styles that may contain shorthand properties
180
+ * @param inlineStyles - Inline styles that should override reset styles
181
+ * @returns Merged styles with inline styles taking precedence
182
+ */
183
+ function resolveConflictingStyles(resetStyles, inlineStyles) {
184
+ const expandedResetStyles = expandShorthandProperties(resetStyles);
185
+ const expandedInlineStyles = expandShorthandProperties(inlineStyles);
186
+ return {
187
+ ...expandedResetStyles,
188
+ ...expandedInlineStyles
189
+ };
190
+ }
191
+
192
+ //#endregion
193
+ export { inlineCssToJs as n, resolveConflictingStyles as r, ensureBorderStyleFallback as t };
194
+ //# sourceMappingURL=styles-_TMw3YxC.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles-_TMw3YxC.mjs","names":[],"sources":["../src/utils/styles.ts"],"sourcesContent":["import type { CssJs } from './types';\n\nconst WHITE_SPACE_REGEX = /\\s+/;\n\nconst BORDER_WIDTH_TO_STYLE: Record<string, string> = {\n borderWidth: 'borderStyle',\n borderTopWidth: 'borderTopStyle',\n borderRightWidth: 'borderRightStyle',\n borderBottomWidth: 'borderBottomStyle',\n borderLeftWidth: 'borderLeftStyle',\n};\n\nexport const jsToInlineCss = (styleObject: { [key: string]: any }) => {\n const parts: string[] = [];\n\n for (const key in styleObject) {\n const value = styleObject[key];\n if (value !== 0 && value !== undefined && value !== null && value !== '') {\n const KEBAB_CASE_REGEX = /[A-Z]/g;\n const formattedKey = key.replace(\n KEBAB_CASE_REGEX,\n (match) => `-${match.toLowerCase()}`,\n );\n parts.push(`${formattedKey}:${value}`);\n }\n }\n\n return parts.join(';') + (parts.length ? ';' : '');\n};\n\nexport const inlineCssToJs = (\n inlineStyle: string,\n options: { removeUnit?: boolean } = {},\n) => {\n const styleObject: { [key: string]: string } = {};\n\n if (!inlineStyle || inlineStyle === '' || typeof inlineStyle === 'object') {\n return styleObject;\n }\n\n inlineStyle.split(';').forEach((style: string) => {\n if (style.trim()) {\n const [key, value] = style.split(':');\n const valueTrimmed = value?.trim();\n\n if (!valueTrimmed) {\n return;\n }\n\n const formattedKey = key\n .trim()\n .replace(/-\\w/g, (match) => match[1].toUpperCase());\n\n const UNIT_REGEX = /px|%/g;\n const sanitizedValue = options?.removeUnit\n ? valueTrimmed.replace(UNIT_REGEX, '')\n : valueTrimmed;\n\n styleObject[formattedKey] = sanitizedValue;\n }\n });\n\n return styleObject;\n};\n\n/**\n * Expands CSS shorthand properties (margin, padding) into their longhand equivalents.\n * This prevents shorthand properties from overriding specific longhand properties in email clients.\n *\n * @param styles - Style object that may contain shorthand properties\n * @returns New style object with shorthand properties expanded to longhand\n *\n * @example\n * expandShorthandProperties({ margin: '0', paddingTop: '10px' })\n * // Returns: { marginTop: '0', marginRight: '0', marginBottom: '0', marginLeft: '0', paddingTop: '10px' }\n */\nexport function expandShorthandProperties(\n styles: Record<string, string>,\n): Record<string, string> {\n if (!styles || typeof styles !== 'object') {\n return {};\n }\n\n const expanded: Record<string, any> = {};\n\n for (const key in styles) {\n const value = styles[key];\n if (value === undefined || value === null || value === '') {\n continue;\n }\n\n switch (key) {\n case 'margin': {\n const values = parseShorthandValue(value);\n expanded.marginTop = values.top;\n expanded.marginRight = values.right;\n expanded.marginBottom = values.bottom;\n expanded.marginLeft = values.left;\n break;\n }\n case 'padding': {\n const values = parseShorthandValue(value);\n expanded.paddingTop = values.top;\n expanded.paddingRight = values.right;\n expanded.paddingBottom = values.bottom;\n expanded.paddingLeft = values.left;\n break;\n }\n case 'border': {\n const values = convertBorderValue(value);\n expanded.borderStyle = values.style;\n expanded.borderWidth = values.width;\n expanded.borderColor = values.color;\n break;\n }\n case 'borderTopLeftRadius':\n case 'borderTopRightRadius':\n case 'borderBottomLeftRadius':\n case 'borderBottomRightRadius': {\n // Always preserve the longhand property\n expanded[key] = value;\n\n // When all four corners are present and identical, also add the shorthand\n if (\n styles.borderTopLeftRadius &&\n styles.borderTopRightRadius &&\n styles.borderBottomLeftRadius &&\n styles.borderBottomRightRadius\n ) {\n const values = [\n styles.borderTopLeftRadius,\n styles.borderTopRightRadius,\n styles.borderBottomLeftRadius,\n styles.borderBottomRightRadius,\n ];\n\n if (new Set(values).size === 1) {\n expanded.borderRadius = values[0];\n }\n }\n\n break;\n }\n\n default: {\n // Keep all other properties as-is\n expanded[key] = value;\n }\n }\n }\n\n return expanded;\n}\n\n/**\n * Parses CSS shorthand value (1-4 values) into individual side values.\n * Follows CSS specification for shorthand property value parsing.\n *\n * @param value - Shorthand value string (e.g., '0', '10px 20px', '5px 10px 15px 20px')\n * @returns Object with top, right, bottom, left values\n */\nfunction parseShorthandValue(value: string | number): {\n top: string;\n right: string;\n bottom: string;\n left: string;\n} {\n const stringValue = String(value).trim();\n const parts = stringValue.split(WHITE_SPACE_REGEX);\n const len = parts.length;\n\n if (len === 1) {\n return { top: parts[0], right: parts[0], bottom: parts[0], left: parts[0] };\n }\n if (len === 2) {\n return { top: parts[0], right: parts[1], bottom: parts[0], left: parts[1] };\n }\n if (len === 3) {\n return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[1] };\n }\n if (len === 4) {\n return { top: parts[0], right: parts[1], bottom: parts[2], left: parts[3] };\n }\n\n return {\n top: stringValue,\n right: stringValue,\n bottom: stringValue,\n left: stringValue,\n };\n}\n\nfunction convertBorderValue(value: string | number): {\n style: string;\n width: string;\n color: string;\n} {\n const stringValue = String(value).trim();\n const parts = stringValue.split(WHITE_SPACE_REGEX);\n\n switch (parts.length) {\n case 1:\n // border: 1px → all sides\n return {\n style: 'solid',\n width: parts[0],\n color: 'black',\n };\n case 2:\n // border: 1px solid → top/bottom, left/right\n return {\n style: parts[1],\n width: parts[0],\n color: 'black',\n };\n case 3:\n // border: 1px solid #000 → top, left/right, bottom\n return {\n style: parts[1],\n width: parts[0],\n color: parts[2],\n };\n case 4:\n // border: 1px solid #000 #fff → top, right, bottom, left\n return {\n style: parts[1],\n width: parts[0],\n color: parts[2],\n };\n default:\n // Invalid format, return the original value for all sides\n return {\n style: 'solid',\n width: stringValue,\n color: 'black',\n };\n }\n}\n\n/**\n * When a border-width is present but border-style is missing, browsers default\n * to `none` and the border is invisible. This adds `solid` as a sensible\n * fallback so borders show up immediately after setting a width.\n */\nexport function ensureBorderStyleFallback(\n styles: Record<string, string | number>,\n): Record<string, string | number> {\n for (const [widthKey, styleKey] of Object.entries(BORDER_WIDTH_TO_STYLE)) {\n const widthValue = styles[widthKey];\n if (!widthValue || widthValue === '0' || widthValue === '0px') {\n continue;\n }\n if (!styles[styleKey]) {\n // Keep shorthand borderStyle authoritative for each side when present.\n if (styleKey !== 'borderStyle' && styles.borderStyle) {\n continue;\n }\n styles[styleKey] = 'solid';\n }\n }\n return styles;\n}\n\n/**\n * Resolves conflicts between reset styles and inline styles by expanding\n * shorthand properties (margin, padding) to longhand before merging.\n * This prevents shorthand properties from overriding specific longhand properties.\n *\n * @param resetStyles - Base reset styles that may contain shorthand properties\n * @param inlineStyles - Inline styles that should override reset styles\n * @returns Merged styles with inline styles taking precedence\n */\nexport function resolveConflictingStyles(\n resetStyles: CssJs['reset'],\n inlineStyles: Record<string, string>,\n) {\n const expandedResetStyles = expandShorthandProperties(\n resetStyles as Record<string, string>,\n );\n const expandedInlineStyles = expandShorthandProperties(inlineStyles);\n\n return {\n ...expandedResetStyles,\n ...expandedInlineStyles,\n };\n}\n"],"mappings":";AAEA,MAAM,oBAAoB;AAE1B,MAAM,wBAAgD;CACpD,aAAa;CACb,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CAClB;AAoBD,MAAa,iBACX,aACA,UAAoC,EAAE,KACnC;CACH,MAAM,cAAyC,EAAE;AAEjD,KAAI,CAAC,eAAe,gBAAgB,MAAM,OAAO,gBAAgB,SAC/D,QAAO;AAGT,aAAY,MAAM,IAAI,CAAC,SAAS,UAAkB;AAChD,MAAI,MAAM,MAAM,EAAE;GAChB,MAAM,CAAC,KAAK,SAAS,MAAM,MAAM,IAAI;GACrC,MAAM,eAAe,OAAO,MAAM;AAElC,OAAI,CAAC,aACH;GAGF,MAAM,eAAe,IAClB,MAAM,CACN,QAAQ,SAAS,UAAU,MAAM,GAAG,aAAa,CAAC;AAOrD,eAAY,gBAJW,SAAS,aAC5B,aAAa,QAFE,SAEkB,GAAG,GACpC;;GAIN;AAEF,QAAO;;;;;;;;;;;;;AAcT,SAAgB,0BACd,QACwB;AACxB,KAAI,CAAC,UAAU,OAAO,WAAW,SAC/B,QAAO,EAAE;CAGX,MAAM,WAAgC,E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styles for BubbleMenu compound components.
2
+ * This file handles layout and positioning only - no visual design.
3
+ * Import this optionally: import '@react-email/editor/styles/bubble-menu.css';
4
+ */
5
+
6
+ [data-re-bubble-menu] {
7
+ display: flex;
8
+ align-items: center;
9
+ gap: 0.125rem;
10
+ }
11
+
12
+ [data-re-bubble-menu-group] {
13
+ display: flex;
14
+ align-items: center;
15
+ gap: 0.125rem;
16
+ padding: 0 0.125rem;
17
+ border: none;
18
+ margin: 0;
19
+ min-width: 0;
20
+ }
21
+
22
+ [data-re-bubble-menu-separator] {
23
+ align-self: stretch;
24
+ width: 1px;
25
+ margin: 0.25rem 0;
26
+ }
27
+
28
+ [data-re-bubble-menu-item] {
29
+ display: inline-flex;
30
+ align-items: center;
31
+ justify-content: center;
32
+ cursor: pointer;
33
+ border: none;
34
+ background: none;
35
+ padding: 0.375rem;
36
+ }
37
+
38
+ [data-re-bubble-menu-item] svg {
39
+ width: 0.875rem;
40
+ height: 0.875rem;
41
+ }
42
+
43
+ [data-re-node-selector] {
44
+ position: relative;
45
+ }
46
+
47
+ [data-re-node-selector-trigger] {
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 0.25rem;
51
+ cursor: pointer;
52
+ border: none;
53
+ background: none;
54
+ white-space: nowrap;
55
+ font-size: 0.8125rem;
56
+ padding: 0.375rem 0.5rem;
57
+ }
58
+
59
+ [data-re-node-selector-trigger] svg {
60
+ width: 0.75rem;
61
+ height: 0.75rem;
62
+ opacity: 0.5;
63
+ }
64
+
65
+ [data-re-node-selector-content] {
66
+ display: flex;
67
+ flex-direction: column;
68
+ min-width: 10rem;
69
+ }
70
+
71
+ [data-re-node-selector-item] {
72
+ display: flex;
73
+ align-items: center;
74
+ gap: 0.5rem;
75
+ cursor: pointer;
76
+ border: none;
77
+ background: none;
78
+ padding: 0.375rem 0.5rem;
79
+ font-size: 0.8125rem;
80
+ width: 100%;
81
+ text-align: left;
82
+ }
83
+
84
+ [data-re-node-selector-item] svg {
85
+ width: 0.875rem;
86
+ height: 0.875rem;
87
+ }
88
+
89
+ [data-re-link-selector] {
90
+ display: flex;
91
+ position: relative;
92
+ }
93
+
94
+ [data-re-link-selector-trigger] {
95
+ display: inline-flex;
96
+ align-items: center;
97
+ justify-content: center;
98
+ cursor: pointer;
99
+ border: none;
100
+ background: none;
101
+ padding: 0.375rem;
102
+ }
103
+
104
+ [data-re-link-selector-trigger] svg {
105
+ width: 0.875rem;
106
+ height: 0.875rem;
107
+ }
108
+
109
+ [data-re-link-selector-form] {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: 0.25rem;
113
+ position: absolute;
114
+ top: 100%;
115
+ left: 0;
116
+ margin-top: 0.25rem;
117
+ width: max-content;
118
+ min-width: 16rem;
119
+ padding: 0.25rem;
120
+ }
121
+
122
+ [data-re-link-selector-input] {
123
+ flex: 1;
124
+ border: none;
125
+ outline: none;
126
+ font-size: 0.8125rem;
127
+ padding: 0.25rem;
128
+ background: transparent;
129
+ }
130
+
131
+ [data-re-link-selector-apply],
132
+ [data-re-link-selector-unlink] {
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ cursor: pointer;
137
+ border: none;
138
+ background: none;
139
+ padding: 0.25rem;
140
+ }
141
+
142
+ [data-re-link-selector-apply] svg,
143
+ [data-re-link-selector-unlink] svg {
144
+ width: 0.875rem;
145
+ height: 0.875rem;
146
+ }
147
+
148
+ /* Button bubble menu */
149
+
150
+ [data-re-btn-bm-toolbar] {
151
+ display: flex;
152
+ align-items: center;
153
+ }
154
+
155
+ [data-re-btn-bm-item] {
156
+ display: inline-flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ cursor: pointer;
160
+ border: none;
161
+ background: none;
162
+ padding: 0.375rem;
163
+ }
164
+
165
+ [data-re-btn-bm-item] svg {
166
+ width: 0.875rem;
167
+ height: 0.875rem;
168
+ }
169
+
170
+ [data-re-btn-bm-form] {
171
+ display: flex;
172
+ align-items: center;
173
+ gap: 0.25rem;
174
+ min-width: 16rem;
175
+ padding: 0.25rem;
176
+ }
177
+
178
+ [data-re-btn-bm-input] {
179
+ flex: 1;
180
+ border: none;
181
+ outline: none;
182
+ font-size: 0.8125rem;
183
+ padding: 0.25rem;
184
+ background: transparent;
185
+ }
186
+
187
+ [data-re-btn-bm-apply],
188
+ [data-re-btn-bm-unlink] {
189
+ display: inline-flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ cursor: pointer;
193
+ border: none;
194
+ background: none;
195
+ padding: 0.25rem;
196
+ }
197
+
198
+ [data-re-btn-bm-apply] svg,
199
+ [data-re-btn-bm-unlink] svg {
200
+ width: 0.875rem;
201
+ height: 0.875rem;
202
+ }
203
+
204
+ /* Link bubble menu */
205
+
206
+ [data-re-link-bm-toolbar] {
207
+ display: flex;
208
+ align-items: center;
209
+ }
210
+
211
+ [data-re-link-bm-item] {
212
+ display: inline-flex;
213
+ align-items: center;
214
+ justify-content: center;
215
+ cursor: pointer;
216
+ border: none;
217
+ background: none;
218
+ padding: 0.375rem;
219
+ }
220
+
221
+ [data-re-link-bm-item] svg {
222
+ width: 0.875rem;
223
+ height: 0.875rem;
224
+ }
225
+
226
+ a[data-re-link-bm-item] {
227
+ text-decoration: none;
228
+ color: inherit;
229
+ }
230
+
231
+ [data-re-link-bm-form] {
232
+ display: flex;
233
+ align-items: center;
234
+ gap: 0.25rem;
235
+ min-width: 16rem;
236
+ padding: 0.25rem;
237
+ }
238
+
239
+ [data-re-link-bm-input] {
240
+ flex: 1;
241
+ border: none;
242
+ outline: none;
243
+ font-size: 0.8125rem;
244
+ padding: 0.25rem;
245
+ background: transparent;
246
+ }
247
+
248
+ [data-re-link-bm-apply],
249
+ [data-re-link-bm-unlink] {
250
+ display: inline-flex;
251
+ align-items: center;
252
+ justify-content: center;
253
+ cursor: pointer;
254
+ border: none;
255
+ background: none;
256
+ padding: 0.25rem;
257
+ }
258
+
259
+ [data-re-link-bm-apply] svg,
260
+ [data-re-link-bm-unlink] svg {
261
+ width: 0.875rem;
262
+ height: 0.875rem;
263
+ }
264
+
265
+ /* Image bubble menu */
266
+
267
+ [data-re-img-bm-toolbar] {
268
+ display: flex;
269
+ align-items: center;
270
+ }
271
+
272
+ [data-re-img-bm-item] {
273
+ display: inline-flex;
274
+ align-items: center;
275
+ justify-content: center;
276
+ cursor: pointer;
277
+ border: none;
278
+ background: none;
279
+ padding: 0.5rem;
280
+ }
281
+
282
+ [data-re-img-bm-item] svg {
283
+ width: 1rem;
284
+ height: 1rem;
285
+ }
@@ -0,0 +1,147 @@
1
+ const require_event_bus = require('../event-bus-fb8U7hrl.cjs');
2
+ const require_root = require('../root-Jq1R3tkX.cjs');
3
+ let react_jsx_runtime = require("react/jsx-runtime");
4
+
5
+ //#region src/ui/bubble-menu/separator.tsx
6
+ function BubbleMenuSeparator({ className }) {
7
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", {
8
+ className,
9
+ "data-re-bubble-menu-separator": ""
10
+ });
11
+ }
12
+
13
+ //#endregion
14
+ //#region src/ui/bubble-menu/index.ts
15
+ const BubbleMenu = {
16
+ Root: require_root.BubbleMenuRoot,
17
+ ItemGroup: require_root.BubbleMenuItemGroup,
18
+ Separator: BubbleMenuSeparator,
19
+ Item: require_root.BubbleMenuItem,
20
+ Bold: require_root.BubbleMenuBold,
21
+ Italic: require_root.BubbleMenuItalic,
22
+ Underline: require_root.BubbleMenuUnderline,
23
+ Strike: require_root.BubbleMenuStrike,
24
+ Code: require_root.BubbleMenuCode,
25
+ Uppercase: require_root.BubbleMenuUppercase,
26
+ AlignLeft: require_root.BubbleMenuAlignLeft,
27
+ AlignCenter: require_root.BubbleMenuAlignCenter,
28
+ AlignRight: require_root.BubbleMenuAlignRight,
29
+ NodeSelector: Object.assign(require_root.BubbleMenuNodeSelector, {
30
+ Root: require_root.NodeSelectorRoot,
31
+ Trigger: require_root.NodeSelectorTrigger,
32
+ Content: require_root.NodeSelectorContent
33
+ }),
34
+ LinkSelector: require_root.BubbleMenuLinkSelector,
35
+ Default: require_root.BubbleMenuDefault,
36
+ ButtonToolbar: require_root.BubbleMenuButtonToolbar,
37
+ ButtonEditLink: require_root.BubbleMenuButtonEditLink,
38
+ ButtonUnlink: require_root.BubbleMenuButtonUnlink,
39
+ ButtonForm: require_root.BubbleMenuButtonForm,
40
+ ButtonDefault: require_root.BubbleMenuButtonDefault,
41
+ LinkToolbar: require_root.BubbleMenuLinkToolbar,
42
+ LinkEditLink: require_root.BubbleMenuLinkEditLink,
43
+ LinkUnlink: require_root.BubbleMenuLinkUnlink,
44
+ LinkOpenLink: require_root.BubbleMenuLinkOpenLink,
45
+ LinkForm: require_root.BubbleMenuLinkForm,
46
+ LinkDefault: require_root.BubbleMenuLinkDefault,
47
+ ImageToolbar: require_root.BubbleMenuImageToolbar,
48
+ ImageEditLink: require_root.BubbleMenuImageEditLink,
49
+ ImageDefault: require_root.BubbleMenuImageDefault
50
+ };
51
+
52
+ //#endregion
53
+ //#region src/ui/slash-command/index.ts
54
+ const SlashCommand = {
55
+ Root: require_root.SlashCommandRoot,
56
+ CommandList: require_root.CommandList
57
+ };
58
+
59
+ //#endregion
60
+ exports.AlignCenterIcon = require_root.AlignCenterIcon;
61
+ exports.AlignLeftIcon = require_root.AlignLeftIcon;
62
+ exports.AlignRightIcon = require_root.AlignRightIcon;
63
+ exports.BULLET_LIST = require_root.BULLET_LIST;
64
+ exports.BUTTON = require_root.BUTTON;
65
+ exports.BoldIcon = require_root.BoldIcon;
66
+ exports.BubbleMenu = BubbleMenu;
67
+ exports.BubbleMenuAlignCenter = require_root.BubbleMenuAlignCenter;
68
+ exports.BubbleMenuAlignLeft = require_root.BubbleMenuAlignLeft;
69
+ exports.BubbleMenuAlignRight = require_root.BubbleMenuAlignRight;
70
+ exports.BubbleMenuBold = require_root.BubbleMenuBold;
71
+ exports.BubbleMenuButtonDefault = require_root.BubbleMenuButtonDefault;
72
+ exports.BubbleMenuButtonEditLink = require_root.BubbleMenuButtonEditLink;
73
+ exports.BubbleMenuButtonForm = require_root.BubbleMenuButtonForm;
74
+ exports.BubbleMenuButtonToolbar = require_root.BubbleMenuButtonToolbar;
75
+ exports.BubbleMenuButtonUnlink = require_root.BubbleMenuButtonUnlink;
76
+ exports.BubbleMenuCode = require_root.BubbleMenuCode;
77
+ exports.BubbleMenuDefault = require_root.BubbleMenuDefault;
78
+ exports.BubbleMenuImageDefault = require_root.BubbleMenuImageDefault;
79
+ exports.BubbleMenuImageEditLink = require_root.BubbleMenuImageEditLink;
80
+ exports.BubbleMenuImageToolbar = require_root.BubbleMenuImageToolbar;
81
+ exports.BubbleMenuItalic = require_root.BubbleMenuItalic;
82
+ exports.BubbleMenuItem = require_root.BubbleMenuItem;
83
+ exports.BubbleMenuItemGroup = require_root.BubbleMenuItemGroup;
84
+ exports.BubbleMenuLinkDefault = require_root.BubbleMenuLinkDefault;
85
+ exports.BubbleMenuLinkEditLink = require_root.BubbleMenuLinkEditLink;
86
+ exports.BubbleMenuLinkForm = require_root.BubbleMenuLinkForm;
87
+ exports.BubbleMenuLinkOpenLink = require_root.BubbleMenuLinkOpenLink;
88
+ exports.BubbleMenuLinkSelector = require_root.BubbleMenuLinkSelector;
89
+ exports.BubbleMenuLinkToolbar = require_root.BubbleMenuLinkToolbar;
90
+ exports.BubbleMenuLinkUnlink = require_root.BubbleMenuLinkUnlink;
91
+ exports.BubbleMenuNodeSelector = require_root.BubbleMenuNodeSelector;
92
+ exports.BubbleMenuRoot = require_root.BubbleMenuRoot;
93
+ exports.BubbleMenuSeparator = BubbleMenuSeparator;
94
+ exports.BubbleMenuStrike = require_root.BubbleMenuStrike;
95
+ exports.BubbleMenuUnderline = require_root.BubbleMenuUnderline;
96
+ exports.BubbleMenuUppercase = require_root.BubbleMenuUppercase;
97
+ exports.CODE = require_root.CODE;
98
+ exports.CaseUpperIcon = require_root.CaseUpperIcon;
99
+ exports.Check = require_root.Check;
100
+ exports.ChevronDown = require_root.ChevronDown;
101
+ exports.Code = require_root.Code;
102
+ exports.CodeIcon = require_root.CodeIcon;
103
+ exports.Columns2 = require_root.Columns2;
104
+ exports.Columns3 = require_root.Columns3;
105
+ exports.Columns4 = require_root.Columns4;
106
+ exports.CommandList = require_root.CommandList;
107
+ exports.DIVIDER = require_root.DIVIDER;
108
+ exports.ExternalLinkIcon = require_root.ExternalLinkIcon;
109
+ exports.FOUR_COLUMNS = require_root.FOUR_COLUMNS;
110
+ exports.H1 = require_root.H1;
111
+ exports.H2 = require_root.H2;
112
+ exports.H3 = require_root.H3;
113
+ exports.Heading1 = require_root.Heading1;
114
+ exports.Heading2 = require_root.Heading2;
115
+ exports.Heading3 = require_root.Heading3;
116
+ exports.ItalicIcon = require_root.ItalicIcon;
117
+ exports.LinkIcon = require_root.LinkIcon;
118
+ exports.List = require_root.List;
119
+ exports.ListOrdered = require_root.ListOrdered;
120
+ exports.MousePointer = require_root.MousePointer;
121
+ exports.NUMBERED_LIST = require_root.NUMBERED_LIST;
122
+ exports.NodeSelectorContent = require_root.NodeSelectorContent;
123
+ exports.NodeSelectorRoot = require_root.NodeSelectorRoot;
124
+ exports.NodeSelectorTrigger = require_root.NodeSelectorTrigger;
125
+ exports.PencilIcon = require_root.PencilIcon;
126
+ exports.QUOTE = require_root.QUOTE;
127
+ exports.Rows2 = require_root.Rows2;
128
+ exports.SECTION = require_root.SECTION;
129
+ exports.SlashCommand = SlashCommand;
130
+ exports.SplitSquareVertical = require_root.SplitSquareVertical;
131
+ exports.SquareCode = require_root.SquareCode;
132
+ exports.StrikethroughIcon = require_root.StrikethroughIcon;
133
+ exports.TEXT = require_root.TEXT;
134
+ exports.THREE_COLUMNS = require_root.THREE_COLUMNS;
135
+ exports.TWO_COLUMNS = require_root.TWO_COLUMNS;
136
+ exports.Text = require_root.Text;
137
+ exports.TextIcon = require_root.TextIcon;
138
+ exports.TextQuote = require_root.TextQuote;
139
+ exports.UnderlineIcon = require_root.UnderlineIcon;
140
+ exports.UnlinkIcon = require_root.UnlinkIcon;
141
+ exports.bubbleMenuTriggers = require_root.bubbleMenuTriggers;
142
+ exports.defaultSlashCommands = require_root.defaultSlashCommands;
143
+ exports.filterAndRankItems = require_root.filterAndRankItems;
144
+ exports.isAtMaxColumnsDepth = require_root.isAtMaxColumnsDepth;
145
+ exports.isInsideNode = require_root.isInsideNode;
146
+ exports.scoreItem = require_root.scoreItem;
147
+ exports.useBubbleMenuContext = require_root.useBubbleMenuContext;