@kgalexander/mcreate 0.0.13 → 0.0.15

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.js CHANGED
@@ -1687,8 +1687,8 @@ var empty_default;
1687
1687
  var init_empty = __esm({
1688
1688
  "templates/empty.json"() {
1689
1689
  empty_default = {
1690
- id: "-1",
1691
- name: "Empty Template",
1690
+ id: "1",
1691
+ name: "Playground Demo",
1692
1692
  version: "1.0.0",
1693
1693
  published: true,
1694
1694
  creator: "Kevin Guerrero",
@@ -1733,7 +1733,7 @@ var init_empty = __esm({
1733
1733
  tagName: "mj-text",
1734
1734
  data: {
1735
1735
  value: {
1736
- content: '<p class="paragraph" style=" padding: 4px 0; font-family: Arial, sans-serif;">&nbsp;</p>'
1736
+ content: '<p class="paragraph" style=" padding: 4px 0; font-family: Arial, sans-serif;">Welcome to our Open House! Please join us for a tour of this beautiful home.</p>'
1737
1737
  }
1738
1738
  },
1739
1739
  attributes: {
@@ -1746,180 +1746,6 @@ var init_empty = __esm({
1746
1746
  }
1747
1747
  ]
1748
1748
  },
1749
- {
1750
- type: "section-property-km",
1751
- tagName: "mj-section",
1752
- data: { value: { columnRows: 1, columnWidths: [] } },
1753
- attributes: { "background-color": "#FFFFFF", padding: "12px 12px 12px 12px" },
1754
- children: [
1755
- {
1756
- type: "column",
1757
- tagName: "mj-column",
1758
- data: { value: {} },
1759
- attributes: { "background-color": "#FFFFFF", width: "500px", padding: "0px", border: "1px solid #dddddd", "border-radius": "0px" },
1760
- children: [
1761
- {
1762
- type: "property-card",
1763
- tagName: "mj-colproperty",
1764
- data: { value: {} },
1765
- attributes: {
1766
- "image-src": "https://cornerstonepropertymgmt.com/wp-content/themes/cornerstone/assets/img/nofeaturedimage.jpg",
1767
- "image-alt": "Beautiful modern home with pool",
1768
- description: "Beautiful modern home with pool",
1769
- price: "1000000",
1770
- address: "123 Main Street",
1771
- city: "Austin, TX 78701",
1772
- beds: "",
1773
- baths: "2",
1774
- sqft: "1,850",
1775
- href: "https://www.zillow.com/homedetails/126-Cara-Mia-Ln-Galloway-NJ-08205/68297408_zpid/?rtoken=6acd62a8-1848-41ed-919b-0034083eafca~X1-ZUu7aphk9l2689_9ej1i&utm_campaign=emo-instantsearchdigest&utm_source=email&utm_term=urn%3Amsg%3A20251026011813e84b11d632bb8725&utm_medium=email&utm_content=forsaleimage&sse=X1-SSsyx4z97dhglz0000000000_1pt02&srp=H4sIAAAAAAAAAHWRwXKDIBCGn8ZjokKQeOh0YpOZ9Nihh94yRNfozAoOYFrz9FXR1h7KgVn%2B799lF8JKN2DDUpuLlQjhswVp8uqtA9MLJx08BTwLCGlkm%2BlOFXaIA3rw4idY588bvtuyNElSEpCXQQK5JpTtk4h6YnXnKo9ouiWcUco8UdqsSMIp2fOAHz00cKu1EoCQuyGYu2CZb8TT18LLSRwtt3nw3rfg0VSQzTXLGh2Yacr1VLU9IJ7HZ1mrd4ndbHNmiJbGQMkrgsgrrfG%2FhFKi%2Fc24wt9XbOp5HDZaFpeVdyjE9BknZTRiA8otEw77R7wRwvZfu0fKi%2BqGj%2BhnXeLWRWR08uM33zV%2BmeABAAA%3D",
1776
- status: "Empty",
1777
- "status-color": "#B8B8B8",
1778
- "is-new": "",
1779
- "is-open-house": "1",
1780
- "open-house-date": "2026-01-29",
1781
- "open-house-time": "01:00-13:07",
1782
- brokerage: "Keller Williams Atlantic Shore",
1783
- "mls-logo": "https://t4.ftcdn.net/jpg/06/71/92/37/360_F_671923740_x0zOL3OIuUAnSF6sr7PuznCI5bQFKhI0.jpg",
1784
- "border-radius": "0px",
1785
- border: "1px solid #dddddd",
1786
- "font-family": "Arial, sans-serif",
1787
- "text-color": "#000000",
1788
- "price-text-color": "",
1789
- "details-text-color": "",
1790
- "address-text-color": "",
1791
- "brokerage-text-color": "#535364",
1792
- "description-text-color": "",
1793
- "mls-logo-text-color": "",
1794
- "status-text-color": "",
1795
- "new-text-color": "",
1796
- "open-house-text-color": ""
1797
- }
1798
- }
1799
- ]
1800
- }
1801
- ]
1802
- },
1803
- {
1804
- type: "section-property-single-two",
1805
- tagName: "mj-section",
1806
- data: { value: { columnRows: 1, columnWidths: [] } },
1807
- attributes: { "background-color": "#FFFFFF", padding: "12px 12px 12px 12px" },
1808
- children: [
1809
- {
1810
- type: "column",
1811
- tagName: "mj-column",
1812
- data: { value: {} },
1813
- attributes: { "background-color": "#FFFFFF", width: "500px", padding: "0px", border: "1px solid #dddddd", "border-radius": "12px" },
1814
- children: [
1815
- {
1816
- type: "property-card-single-two",
1817
- tagName: "mj-propertysingletwo",
1818
- data: { value: {} },
1819
- attributes: {
1820
- "image-src": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRXddI94MwjUVz5M4CyDxZhSkIIwWbyDF59_w&s",
1821
- "image-alt": "Beautiful modern home with pool",
1822
- description: "Beautiful modern home with pool",
1823
- price: "324203492034",
1824
- address: "123 Main Street",
1825
- city: "Austin, TX 78701",
1826
- beds: "",
1827
- baths: "",
1828
- sqft: "",
1829
- href: "https://www.zillow.com/homedetails/126-Cara-Mia-Ln-Galloway-NJ-08205/68297408_zpid/?rtoken=6acd62a8-1848-41ed-919b-0034083eafca~X1-ZUu7aphk9l2689_9ej1i&utm_campaign=emo-instantsearchdigest&utm_source=email&utm_term=urn%3Amsg%3A20251026011813e84b11d632bb8725&utm_medium=email&utm_content=forsaleimage&sse=X1-SSsyx4z97dhglz0000000000_1pt02&srp=H4sIAAAAAAAAAHWRwXKDIBCGn8ZjokKQeOh0YpOZ9Nihh94yRNfozAoOYFrz9FXR1h7KgVn%2B799lF8JKN2DDUpuLlQjhswVp8uqtA9MLJx08BTwLCGlkm%2BlOFXaIA3rw4idY588bvtuyNElSEpCXQQK5JpTtk4h6YnXnKo9ouiWcUco8UdqsSMIp2fOAHz00cKu1EoCQuyGYu2CZb8TT18LLSRwtt3nw3rfg0VSQzTXLGh2Yacr1VLU9IJ7HZ1mrd4ndbHNmiJbGQMkrgsgrrfG%2FhFKi%2Fc24wt9XbOp5HDZaFpeVdyjE9BknZTRiA8otEw77R7wRwvZfu0fKi%2BqGj%2BhnXeLWRWR08uM33zV%2BmeABAAA%3D",
1830
- status: "Just Listed",
1831
- "status-color": "#008000",
1832
- "is-new": "1",
1833
- "is-open-house": "",
1834
- "open-house-date": "03/25",
1835
- "open-house-time": "12pm-1pm",
1836
- brokerage: "Keller Williams Atlantic Shore",
1837
- "mls-logo": "https://t4.ftcdn.net/jpg/06/71/92/37/360_F_671923740_x0zOL3OIuUAnSF6sr7PuznCI5bQFKhI0.jpg",
1838
- "border-radius": "12px",
1839
- border: "1x solid #dddddd",
1840
- "font-family": "Arial, sans-serif",
1841
- "text-color": "#000000"
1842
- }
1843
- }
1844
- ]
1845
- }
1846
- ]
1847
- },
1848
- {
1849
- type: "section-property-triple",
1850
- tagName: "mj-section",
1851
- data: { value: { columnRows: 1, columnWidths: [] } },
1852
- attributes: { "background-color": "#FFFFFF", padding: "12px" },
1853
- children: [
1854
- {
1855
- type: "column",
1856
- tagName: "mj-column",
1857
- data: { value: {} },
1858
- attributes: { "background-color": "transparent", padding: "0px", "css-class": "property-triple-section-column", width: "500px" },
1859
- children: [
1860
- {
1861
- type: "property-card-triple",
1862
- tagName: "mj-propertytriple",
1863
- data: { value: {} },
1864
- attributes: {
1865
- width: "100%",
1866
- gap: "24px",
1867
- "border-radius": "8px",
1868
- border: "1px solid #d1d1d5",
1869
- "image-height": "102px",
1870
- "font-family": "Arial, sans-serif",
1871
- "text-color": "#000000",
1872
- "background-color": "#FFFFFF"
1873
- },
1874
- children: [
1875
- {
1876
- type: "property-card-triple-item",
1877
- tagName: "mj-propertytripleitem",
1878
- data: { value: {} },
1879
- attributes: {
1880
- "image-src": "https://photos.zillowstatic.com/fp/a8e605d336d0b5a94d91828aee3c0afb-p_i.jpg",
1881
- href: "",
1882
- price: "$320,000",
1883
- beds: "3",
1884
- baths: "2",
1885
- sqft: "1,385",
1886
- city: "Egg Harbor City"
1887
- }
1888
- },
1889
- {
1890
- type: "property-card-triple-item",
1891
- tagName: "mj-propertytripleitem",
1892
- data: { value: {} },
1893
- attributes: {
1894
- "image-src": "https://photos.zillowstatic.com/fp/4d72133271685e778a0126b3defd9854-p_i.jpg",
1895
- href: "",
1896
- price: "$282,000",
1897
- beds: "2",
1898
- baths: "2",
1899
- sqft: "1,224",
1900
- city: "Egg Harbor"
1901
- }
1902
- },
1903
- {
1904
- type: "property-card-triple-item",
1905
- tagName: "mj-propertytripleitem",
1906
- data: { value: {} },
1907
- attributes: {
1908
- "image-src": "https://photos.zillowstatic.com/fp/26e69f22548989c0e4d1ec372ce178e0-p_i.jpg",
1909
- href: "",
1910
- price: "$484,900",
1911
- beds: "3",
1912
- baths: "1",
1913
- sqft: "1,417",
1914
- city: "Egg Harbor"
1915
- }
1916
- }
1917
- ]
1918
- }
1919
- ]
1920
- }
1921
- ]
1922
- },
1923
1749
  {
1924
1750
  type: "section",
1925
1751
  tagName: "mj-section",
@@ -2017,7 +1843,7 @@ function setValueAtPath(template, path, value) {
2017
1843
  (0, import_set.default)(template, lodashPath, value);
2018
1844
  }
2019
1845
  }
2020
- var import_zustand, import_immer, import_middleware, import_get2, import_set, import_cloneDeep, import_immer2, SECTION_INDEX_REGEX, MAX_TEMPLATE_SIZE, defaultTemplate, MAX_PAID_LEVEL, useEditorStore;
1846
+ var import_zustand, import_immer, import_middleware, import_get2, import_set, import_cloneDeep, import_immer2, SECTION_INDEX_REGEX, MAX_TEMPLATE_SIZE, defaultTemplate, useEditorStore;
2021
1847
  var init_editor = __esm({
2022
1848
  "src/core/editor/state/editor.ts"() {
2023
1849
  "use strict";
@@ -2041,7 +1867,6 @@ var init_editor = __esm({
2041
1867
  id: page.id || generateId()
2042
1868
  }))
2043
1869
  };
2044
- MAX_PAID_LEVEL = 3;
2045
1870
  useEditorStore = (0, import_zustand.create)()(
2046
1871
  (0, import_middleware.devtools)(
2047
1872
  (0, import_immer.immer)((set) => ({
@@ -2050,6 +1875,7 @@ var init_editor = __esm({
2050
1875
  templateId: null,
2051
1876
  onSave: null,
2052
1877
  onToast: null,
1878
+ onExit: null,
2053
1879
  previewMode: false,
2054
1880
  focusIdx: null,
2055
1881
  hoverIdx: null,
@@ -2073,14 +1899,22 @@ var init_editor = __esm({
2073
1899
  isSaving: false,
2074
1900
  // Subscription level (0 = free, 1-3 = paid tiers)
2075
1901
  isPaidLevel: 0,
1902
+ // User data
1903
+ images: [],
1904
+ userData: null,
1905
+ // Render sync
1906
+ renderSyncNeeded: 0,
2076
1907
  // Initialize store with external template (for npm package usage)
2077
- initializeWithTemplate: (templateId, template, onSave, onToast, isPaidLevel) => {
1908
+ initializeWithTemplate: (templateId, template, onSave, onToast, data, onExit) => {
2078
1909
  set((state) => {
2079
1910
  state.templateId = templateId;
2080
1911
  state.template = template;
2081
1912
  state.onSave = onSave ?? null;
2082
1913
  state.onToast = onToast ?? null;
2083
- state.isPaidLevel = isPaidLevel ?? 0;
1914
+ state.onExit = onExit ?? null;
1915
+ state.isPaidLevel = data?.isPaidLevel ?? 0;
1916
+ state.images = data?.images ?? [];
1917
+ state.userData = data?.userData ?? null;
2084
1918
  state.templateSize = calculateTemplateSize(template);
2085
1919
  state.isAtSizeLimit = false;
2086
1920
  state.history = [(0, import_cloneDeep.default)(template)];
@@ -2346,6 +2180,7 @@ var init_editor = __esm({
2346
2180
  return;
2347
2181
  }
2348
2182
  Object.assign(element, updates);
2183
+ state2.renderSyncNeeded += 1;
2349
2184
  });
2350
2185
  },
2351
2186
  // Update element content (for contenteditable)
@@ -3196,7 +3031,7 @@ var init_editor = __esm({
3196
3031
  });
3197
3032
 
3198
3033
  // src/core/editor/constant/configuration.ts
3199
- var import_lucide_react, BUTTON_ALIGNMENTS, ALIGNMENT_ICONS, FONTS, TEXT_ALIGNMENT_ICONS, TEXT_TYPE_OPTIONS, DEFAULT_FONT_SIZE, MIN_FONT_SIZE, MAX_FONT_SIZE, FONT_SIZE_STEP, LINK_TYPES, detectLinkType, stripPrefix, normalizeWebsiteUrl, DEFAULT_LETTER_SPACING, MIN_LETTER_SPACING, MAX_LETTER_SPACING, LETTER_SPACING_STEP, DEFAULT_LINE_HEIGHT, MIN_LINE_HEIGHT, MAX_LINE_HEIGHT, LINE_HEIGHT_STEP, HIDDEN_SELECTION_VISUAL_ELEMENTS, NOT_DRAGGABLE_ELEMENTS, IMAGE_SELECTION_VALID_TYPES;
3034
+ var import_lucide_react, BUTTON_ALIGNMENTS, ALIGNMENT_ICONS, FONTS, TEXT_ALIGNMENT_ICONS, TEXT_TYPE_OPTIONS, DEFAULT_FONT_SIZE, MIN_FONT_SIZE, MAX_FONT_SIZE, FONT_SIZE_STEP, LINK_TYPES, LINK_PRESETS, detectLinkType, stripPrefix, normalizeWebsiteUrl, DEFAULT_LETTER_SPACING, MIN_LETTER_SPACING, MAX_LETTER_SPACING, LETTER_SPACING_STEP, DEFAULT_LINE_HEIGHT, MIN_LINE_HEIGHT, MAX_LINE_HEIGHT, LINE_HEIGHT_STEP, HIDDEN_SELECTION_VISUAL_ELEMENTS, NOT_DRAGGABLE_ELEMENTS, EDITOR_COLORS;
3200
3035
  var init_configuration = __esm({
3201
3036
  "src/core/editor/constant/configuration.ts"() {
3202
3037
  "use strict";
@@ -3258,6 +3093,17 @@ var init_configuration = __esm({
3258
3093
  prefix: "tel:"
3259
3094
  }
3260
3095
  ];
3096
+ LINK_PRESETS = {
3097
+ Phone: [
3098
+ { label: "Personal Phone", key: "personal_phone_number" },
3099
+ { label: "Office Phone", key: "office_phone_number" },
3100
+ { label: "Business Phone", key: "business_phone_number" }
3101
+ ],
3102
+ Website: [
3103
+ { label: "Team Website", key: "team_website" },
3104
+ { label: "Brokerage Website", key: "brokerage_website" }
3105
+ ]
3106
+ };
3261
3107
  detectLinkType = (href) => {
3262
3108
  if (href.startsWith("mailto:")) return LINK_TYPES[0];
3263
3109
  if (href.startsWith("tel:")) return LINK_TYPES[2];
@@ -3284,7 +3130,18 @@ var init_configuration = __esm({
3284
3130
  LINE_HEIGHT_STEP = 0.1;
3285
3131
  HIDDEN_SELECTION_VISUAL_ELEMENTS = ["text", "divider", "column"];
3286
3132
  NOT_DRAGGABLE_ELEMENTS = ["page", "social-item", "text", "property-card", "property-card-single-two", "property-card-triple", "property-card-triple-item"];
3287
- IMAGE_SELECTION_VALID_TYPES = ["section", "section-column", "image", "section-property-km", "section-property-single-two", "section-property-triple", "property-card", "property-card-single-two", "property-card-triple", "property-card-triple-item"];
3133
+ EDITOR_COLORS = {
3134
+ /** Purple — drag/drop state */
3135
+ drag: {
3136
+ solid: "rgb(59, 130, 246)",
3137
+ half: "rgba(59, 130, 246, 0.5)"
3138
+ },
3139
+ /** Blue — hover/selection state */
3140
+ hover: {
3141
+ solid: "rgb(59, 130, 246)",
3142
+ half: "rgba(59, 130, 246, 0.5)"
3143
+ }
3144
+ };
3288
3145
  }
3289
3146
  });
3290
3147
 
@@ -3295,6 +3152,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3295
3152
  if (cached) return cached;
3296
3153
  const hiddenSelectors = !isDragButtonHovered && HIDDEN_SELECTION_VISUAL_ELEMENTS.length > 0 ? HIDDEN_SELECTION_VISUAL_ELEMENTS.map((type) => `.node-type-${type}`).join(", ") : null;
3297
3154
  const css = `
3155
+
3298
3156
  /* Base reset for email content */
3299
3157
  * {
3300
3158
  box-sizing: border-box;
@@ -3311,32 +3169,32 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3311
3169
 
3312
3170
  /* Hover state - uses CSS variable for dynamic color */
3313
3171
  .${EMAIL_BLOCK_CLASS_NAME}.is-hovered {
3314
- outline-color: var(--outline-color-hover, rgba(59, 130, 246, 0.5));
3172
+ outline-color: var(--outline-color-hover, ${EDITOR_COLORS.hover.half});
3315
3173
  }
3316
3174
 
3317
3175
  /* Selected state - uses CSS variable for dynamic color */
3318
3176
  .${EMAIL_BLOCK_CLASS_NAME}.is-selected {
3319
- outline-color: var(--outline-color, rgb(59, 130, 246));
3177
+ outline-color: var(--outline-color, ${EDITOR_COLORS.hover.solid});
3320
3178
  }
3321
3179
 
3322
3180
  /* Drop target state - highlight section being dropped into */
3323
3181
  .${EMAIL_BLOCK_CLASS_NAME}.is-drop-target {
3324
- outline-color: rgb(147, 51, 234) !important;
3182
+ outline-color: ${EDITOR_COLORS.drag.solid} !important;
3325
3183
  }
3326
3184
 
3327
3185
  /* Column selection in section-column - 50% opacity blue */
3328
3186
  .${EMAIL_BLOCK_CLASS_NAME}.is-column-selected {
3329
- outline-color: rgba(59, 130, 246, 0.5);
3187
+ outline-color: ${EDITOR_COLORS.hover.half};
3330
3188
  }
3331
3189
 
3332
3190
  /* Column hover when child element is hovered - 50% opacity blue */
3333
3191
  .${EMAIL_BLOCK_CLASS_NAME}.is-column-hover-parent {
3334
- outline-color: rgba(59, 130, 246, 0.5);
3192
+ outline-color: ${EDITOR_COLORS.hover.half};
3335
3193
  }
3336
3194
 
3337
3195
  /* Card selection in property-card-triple - 50% opacity blue */
3338
3196
  .${EMAIL_BLOCK_CLASS_NAME}.is-card-selected {
3339
- outline-color: rgba(59, 130, 246, 0.5);
3197
+ outline-color: ${EDITOR_COLORS.hover.half};
3340
3198
  }
3341
3199
 
3342
3200
  /* Hide selection visual for configured elements (unless drag button hovered) */
@@ -3356,12 +3214,12 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3356
3214
  outline-color: transparent !important;
3357
3215
  }
3358
3216
  .node-type-button.is-selected > table {
3359
- outline: 2px solid var(--outline-color, rgb(59, 130, 246));
3217
+ outline: 2px solid var(--outline-color, ${EDITOR_COLORS.hover.solid});
3360
3218
  outline-offset: -2px;
3361
3219
  border-radius: 2px;
3362
3220
  }
3363
3221
  .node-type-button.is-hovered:not(.is-selected) > table {
3364
- outline: 2px solid var(--outline-color-hover, rgba(59, 130, 246, 0.5));
3222
+ outline: 2px solid var(--outline-color-hover, ${EDITOR_COLORS.hover.half});
3365
3223
  outline-offset: -2px;
3366
3224
  border-radius: 2px;
3367
3225
  }
@@ -3374,12 +3232,12 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3374
3232
  outline-color: transparent !important;
3375
3233
  }
3376
3234
  .node-type-image.is-selected table td {
3377
- outline: 2px solid var(--outline-color, rgb(59, 130, 246));
3235
+ outline: 2px solid var(--outline-color, ${EDITOR_COLORS.hover.solid});
3378
3236
  outline-offset: -2px;
3379
3237
  border-radius: 2px;
3380
3238
  }
3381
3239
  .node-type-image.is-hovered:not(.is-selected) table td {
3382
- outline: 2px solid var(--outline-color-hover, rgba(59, 130, 246, 0.5));
3240
+ outline: 2px solid var(--outline-color-hover, ${EDITOR_COLORS.hover.half});
3383
3241
  outline-offset: -2px;
3384
3242
  border-radius: 2px;
3385
3243
  }
@@ -3397,7 +3255,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3397
3255
  /* Drop indicator - uses CSS variable for dynamic color */
3398
3256
  .drop-indicator {
3399
3257
  position: absolute;
3400
- background-color: var(--outline-color, rgb(59, 130, 246));
3258
+ background-color: var(--outline-color, ${EDITOR_COLORS.hover.solid});
3401
3259
  pointer-events: none;
3402
3260
  z-index: 1000;
3403
3261
  }
@@ -3777,8 +3635,8 @@ var init_ShadowDomRenderer = __esm({
3777
3635
  contentWrapper.className = "shadow-content";
3778
3636
  contentWrapper.innerHTML = html;
3779
3637
  contentWrapper.style.setProperty("--company-footer-opacity", showCompanyFooter ? "1" : "0.25");
3780
- contentWrapper.style.setProperty("--outline-color", isDragging ? "rgb(147, 51, 234)" : "rgb(59, 130, 246)");
3781
- contentWrapper.style.setProperty("--outline-color-hover", isDragging ? "rgba(147, 51, 234, 0.5)" : "rgba(59, 130, 246, 0.5)");
3638
+ contentWrapper.style.setProperty("--outline-color", isDragging ? EDITOR_COLORS.drag.solid : EDITOR_COLORS.hover.solid);
3639
+ contentWrapper.style.setProperty("--outline-color-hover", isDragging ? EDITOR_COLORS.drag.half : EDITOR_COLORS.hover.half);
3782
3640
  const template = useEditorStore.getState().template;
3783
3641
  const linkColor2 = template?.content?.[0]?.data?.value?.linkColor || "#0000ff";
3784
3642
  contentWrapper.style.setProperty("--link-color", linkColor2);
@@ -3798,8 +3656,8 @@ var init_ShadowDomRenderer = __esm({
3798
3656
  if (!shadowRootRef.current) return;
3799
3657
  const contentWrapper = shadowRootRef.current.querySelector(".shadow-content");
3800
3658
  if (contentWrapper) {
3801
- contentWrapper.style.setProperty("--outline-color", isDragging ? "rgb(147, 51, 234)" : "rgb(59, 130, 246)");
3802
- contentWrapper.style.setProperty("--outline-color-hover", isDragging ? "rgba(147, 51, 234, 0.5)" : "rgba(59, 130, 246, 0.5)");
3659
+ contentWrapper.style.setProperty("--outline-color", isDragging ? EDITOR_COLORS.drag.solid : EDITOR_COLORS.hover.solid);
3660
+ contentWrapper.style.setProperty("--outline-color-hover", isDragging ? EDITOR_COLORS.drag.half : EDITOR_COLORS.hover.half);
3803
3661
  contentWrapper.style.setProperty("--company-footer-opacity", showCompanyFooter ? "1" : "0.25");
3804
3662
  const template = useEditorStore.getState().template;
3805
3663
  const linkColor2 = template?.content?.[0]?.data?.value?.linkColor || "#0000ff";
@@ -4259,11 +4117,11 @@ var init_ShadowDomRenderer = __esm({
4259
4117
  width: 3,
4260
4118
  height: dropIndicator.height
4261
4119
  },
4262
- backgroundColor: isDragging ? "rgb(147, 51, 234)" : "#3b82f6",
4120
+ backgroundColor: isDragging ? EDITOR_COLORS.drag.solid : EDITOR_COLORS.hover.solid,
4263
4121
  borderRadius: 2,
4264
4122
  pointerEvents: "none",
4265
4123
  zIndex: 9999,
4266
- boxShadow: isDragging ? "0 0 4px rgba(147, 51, 234, 0.5)" : "0 0 4px rgba(59, 130, 246, 0.5)"
4124
+ boxShadow: isDragging ? `0 0 4px ${EDITOR_COLORS.drag.half}` : `0 0 4px ${EDITOR_COLORS.hover.half}`
4267
4125
  },
4268
4126
  children: (dropIndicator.isNewSection || dropIndicator.isSplitSection) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
4269
4127
  "div",
@@ -4273,7 +4131,7 @@ var init_ShadowDomRenderer = __esm({
4273
4131
  top: "50%",
4274
4132
  left: "50%",
4275
4133
  transform: "translate(-50%, -50%)",
4276
- backgroundColor: "rgb(147, 51, 234)",
4134
+ backgroundColor: EDITOR_COLORS.drag.solid,
4277
4135
  color: "white",
4278
4136
  fontSize: 12,
4279
4137
  fontWeight: 600,
@@ -12718,24 +12576,42 @@ var init_href_menu = __esm({
12718
12576
  init_label();
12719
12577
  init_separator();
12720
12578
  init_use_href();
12579
+ init_editor();
12721
12580
  init_helper();
12722
12581
  init_configuration();
12723
12582
  import_jsx_runtime25 = require("react/jsx-runtime");
12724
12583
  HrefMenu = () => {
12725
12584
  const { href, setHref, clearHref, copyHref, hasHref } = useHref();
12585
+ const userData = useEditorStore((s) => s.userData);
12726
12586
  const [isOpen, setIsOpen] = (0, import_react12.useState)(false);
12727
12587
  const [inputValue, setInputValue] = (0, import_react12.useState)("");
12728
12588
  const [showCopied, setShowCopied] = (0, import_react12.useState)(false);
12729
12589
  const [linkType, setLinkType] = (0, import_react12.useState)(LINK_TYPES[1]);
12730
12590
  const [isLinkTypeOpen, setIsLinkTypeOpen] = (0, import_react12.useState)(false);
12591
+ const [isPresetOpen, setIsPresetOpen] = (0, import_react12.useState)(false);
12592
+ console.log("userData", userData);
12593
+ const availablePresets = (0, import_react12.useMemo)(() => {
12594
+ const presetDefs = LINK_PRESETS[linkType.name] ?? [];
12595
+ if (!userData) return [];
12596
+ const all = presetDefs.filter((p) => userData[p.key]).map((p) => ({ ...p, value: String(userData[p.key]) }));
12597
+ if (!inputValue) return all;
12598
+ const query = inputValue.toLowerCase();
12599
+ return all.filter((p) => p.value.toLowerCase().includes(query));
12600
+ }, [linkType.name, userData, inputValue]);
12601
+ const handlePresetSelect = (0, import_react12.useCallback)((value) => {
12602
+ setInputValue(value);
12603
+ setIsPresetOpen(false);
12604
+ }, []);
12731
12605
  (0, import_react12.useEffect)(() => {
12732
12606
  if (isOpen) {
12733
12607
  setLinkType(detectLinkType(href));
12734
12608
  setInputValue(stripPrefix(href));
12609
+ setIsPresetOpen(true);
12735
12610
  }
12736
12611
  }, [isOpen, href]);
12737
12612
  const handleInputChange = (e) => {
12738
12613
  setInputValue(e.target.value);
12614
+ setIsPresetOpen(true);
12739
12615
  };
12740
12616
  const buildHref = (value) => {
12741
12617
  if (!value) return "";
@@ -12745,15 +12621,22 @@ var init_href_menu = __esm({
12745
12621
  if (value.startsWith(linkType.prefix)) return value;
12746
12622
  return linkType.prefix + value;
12747
12623
  };
12624
+ const handleInputClick = () => {
12625
+ if (availablePresets.length > 0) {
12626
+ setIsPresetOpen(true);
12627
+ }
12628
+ };
12748
12629
  const handleInputBlur = () => {
12749
12630
  setHref(buildHref(inputValue));
12750
12631
  };
12751
12632
  const handleKeyDown = (e) => {
12752
12633
  if (e.key === "Enter") {
12753
12634
  setHref(buildHref(inputValue));
12635
+ setIsPresetOpen(false);
12754
12636
  setIsOpen(false);
12755
12637
  }
12756
12638
  if (e.key === "Escape") {
12639
+ setIsPresetOpen(false);
12757
12640
  setIsOpen(false);
12758
12641
  }
12759
12642
  };
@@ -12796,55 +12679,85 @@ var init_href_menu = __esm({
12796
12679
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(DropdownMenuContent, { side: "bottom", className: "w-[250px] p-3 shadow-lg z-50001", children: [
12797
12680
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-2", children: [
12798
12681
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Label, { children: "Enter a link" }),
12799
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
12800
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12801
- Input,
12802
- {
12803
- type: linkType.inputType,
12804
- placeholder: linkType.placeholder,
12805
- className: "w-full rounded-[12px] shadow-none pl-12 h-[44px]",
12806
- value: inputValue,
12807
- onChange: handleInputChange,
12808
- onBlur: handleInputBlur,
12809
- onKeyDown: handleKeyDown,
12810
- autoFocus: true
12811
- }
12812
- ),
12813
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Popover, { open: isLinkTypeOpen, onOpenChange: setIsLinkTypeOpen, children: [
12814
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
12815
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "icon", variant: "ghost", className: "absolute shadow-none rounded-[12px] left-1.5 top-1/2 -translate-y-1/2 h-[34px] w-[34px] cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(linkType.icon, {}) }) }) }),
12816
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { side: "top", className: "z-50001", children: "Link Type" })
12817
- ] }),
12682
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Popover, { open: isPresetOpen && availablePresets.length > 0, onOpenChange: setIsPresetOpen, children: [
12683
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", children: [
12818
12684
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12819
- PopoverContent,
12685
+ Input,
12820
12686
  {
12821
- side: "bottom",
12822
- align: "start",
12823
- className: "w-[160px] p-1 z-50001",
12824
- onPointerDownOutside: (e) => e.preventDefault(),
12825
- children: LINK_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12826
- Button,
12827
- {
12828
- variant: "ghost",
12829
- className: "w-full justify-between shadow-none cursor-pointer",
12830
- onClick: (e) => {
12831
- e.stopPropagation();
12832
- setLinkType(type);
12833
- setIsLinkTypeOpen(false);
12687
+ type: linkType.inputType,
12688
+ placeholder: linkType.placeholder,
12689
+ className: "w-full rounded-[12px] shadow-none pl-12 h-[44px]",
12690
+ value: inputValue,
12691
+ onChange: handleInputChange,
12692
+ onClick: handleInputClick,
12693
+ onBlur: handleInputBlur,
12694
+ onKeyDown: handleKeyDown,
12695
+ autoFocus: true
12696
+ }
12697
+ ),
12698
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Popover, { open: isLinkTypeOpen, onOpenChange: setIsLinkTypeOpen, children: [
12699
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Tooltip, { children: [
12700
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { size: "icon", variant: "ghost", className: "absolute shadow-none rounded-[12px] left-1.5 top-1/2 -translate-y-1/2 h-[34px] w-[34px] cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(linkType.icon, {}) }) }) }),
12701
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TooltipContent, { side: "top", className: "z-50001", children: "Link Type" })
12702
+ ] }),
12703
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12704
+ PopoverContent,
12705
+ {
12706
+ side: "bottom",
12707
+ align: "start",
12708
+ className: "w-[160px] p-1 z-50001",
12709
+ onPointerDownOutside: (e) => e.preventDefault(),
12710
+ children: LINK_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12711
+ Button,
12712
+ {
12713
+ variant: "ghost",
12714
+ className: "w-full justify-between shadow-none cursor-pointer",
12715
+ onClick: (e) => {
12716
+ e.stopPropagation();
12717
+ setLinkType(type);
12718
+ setIsLinkTypeOpen(false);
12719
+ },
12720
+ children: [
12721
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex items-center gap-2", children: [
12722
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(type.icon, { className: "size-4" }),
12723
+ type.name
12724
+ ] }),
12725
+ linkType.name === type.name && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react18.CheckIcon, { className: "size-4" })
12726
+ ]
12834
12727
  },
12835
- children: [
12836
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex items-center gap-2", children: [
12837
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(type.icon, { className: "size-4" }),
12838
- type.name
12839
- ] }),
12840
- linkType.name === type.name && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react18.CheckIcon, { className: "size-4" })
12841
- ]
12728
+ type.name
12729
+ ))
12730
+ }
12731
+ )
12732
+ ] })
12733
+ ] }) }),
12734
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12735
+ PopoverContent,
12736
+ {
12737
+ side: "bottom",
12738
+ align: "start",
12739
+ className: "w-[var(--radix-popover-trigger-width)] p-0 overflow-hidden z-50001",
12740
+ onOpenAutoFocus: (e) => e.preventDefault(),
12741
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col max-h-[200px] overflow-y-auto", children: availablePresets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12742
+ "button",
12743
+ {
12744
+ className: `flex items-center justify-between px-3 py-2 text-sm hover:bg-accent cursor-pointer ${inputValue === preset.value ? "bg-accent font-medium" : ""}`,
12745
+ onMouseDown: (e) => {
12746
+ e.preventDefault();
12747
+ handlePresetSelect(preset.value);
12842
12748
  },
12843
- type.name
12844
- ))
12845
- }
12846
- )
12847
- ] })
12749
+ children: [
12750
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col items-start gap-0.5", children: [
12751
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-xs text-muted-foreground", children: preset.label }),
12752
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-sm", children: preset.value })
12753
+ ] }),
12754
+ inputValue === preset.value && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react18.CheckIcon, { className: "w-4 h-4 shrink-0" })
12755
+ ]
12756
+ },
12757
+ preset.key
12758
+ )) })
12759
+ }
12760
+ )
12848
12761
  ] })
12849
12762
  ] }),
12850
12763
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Separator, { className: "my-2" }),
@@ -15100,6 +15013,8 @@ function Editor({ setEditorLoading }) {
15100
15013
  const dataTransfer = useEditorStore((state) => state.dataTransfer);
15101
15014
  const textEditing = useEditorStore((state) => state.textEditing);
15102
15015
  const isScaling = useEditorStore((state) => state.isScaling);
15016
+ const canvasBackgroundColor = useEditorStore((s) => s.template?.content?.[0]?.attributes?.["background-color"]) || "#f5f5f5";
15017
+ const renderSyncNeeded = useEditorStore((state) => state.renderSyncNeeded);
15103
15018
  const setFocusIdx = useEditorStore((state) => state.setFocusIdx);
15104
15019
  const setHoverIdx = useEditorStore((state) => state.setHoverIdx);
15105
15020
  const updateElementContent = useEditorStore((state) => state.updateElementContent);
@@ -15138,12 +15053,17 @@ function Editor({ setEditorLoading }) {
15138
15053
  const companyFooterCacheRef = (0, import_react35.useRef)(void 0);
15139
15054
  const lastSyncedTemplateRef = (0, import_react35.useRef)(null);
15140
15055
  const prevTextEditingIdxRef = (0, import_react35.useRef)(null);
15056
+ const lastRenderSyncNeededRef = (0, import_react35.useRef)(0);
15141
15057
  (0, import_react35.useEffect)(() => {
15142
15058
  const currentIdx = textEditing?.idx ?? null;
15143
15059
  const prevIdx = prevTextEditingIdxRef.current;
15144
15060
  const switchedTarget = currentIdx !== null && prevIdx !== null && currentIdx !== prevIdx;
15145
15061
  prevTextEditingIdxRef.current = currentIdx;
15146
- if (!isEditing && (!textEditing || switchedTarget)) {
15062
+ const forceSync = renderSyncNeeded > lastRenderSyncNeededRef.current;
15063
+ if (forceSync) {
15064
+ lastRenderSyncNeededRef.current = renderSyncNeeded;
15065
+ }
15066
+ if (forceSync || !isEditing && (!textEditing || switchedTarget)) {
15147
15067
  if (template === lastSyncedTemplateRef.current) {
15148
15068
  return;
15149
15069
  }
@@ -15152,7 +15072,7 @@ function Editor({ setEditorLoading }) {
15152
15072
  }
15153
15073
  lastSyncedTemplateRef.current = template;
15154
15074
  }
15155
- }, [template, renderData, isEditing, textEditing]);
15075
+ }, [template, renderData, isEditing, textEditing, renderSyncNeeded]);
15156
15076
  (0, import_react35.useEffect)(() => {
15157
15077
  if (renderData && setEditorLoading) {
15158
15078
  setEditorLoading(false);
@@ -15952,43 +15872,45 @@ function Editor({ setEditorLoading }) {
15952
15872
  justifyContent: "center"
15953
15873
  },
15954
15874
  children: [
15955
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
15875
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
15956
15876
  "div",
15957
15877
  {
15958
- className: `editor-container rounded-b-[12px] border-t-1 border-t-accent max-w-[626px]`,
15878
+ className: `editor-container rounded-b-[12px] max-w-[626px] w-[626px] [@media(max-width:950px)]:max-w-[100%] [@media(max-width:950px)]:w-[100%] `,
15959
15879
  style: {
15960
- width: "626px",
15961
15880
  height: "100%",
15962
- backgroundColor: "#f5f5f5",
15881
+ backgroundColor: canvasBackgroundColor,
15963
15882
  overflow: "auto"
15964
15883
  },
15965
- children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
15966
- ShadowDomRenderer,
15967
- {
15968
- html,
15969
- focusIdx,
15970
- hoverIdx,
15971
- dropIndicator,
15972
- dropTargetIdx,
15973
- isDragging,
15974
- isDragButtonHovered,
15975
- textEditingIdx: textEditing?.idx || null,
15976
- showCompanyFooter,
15977
- onElementClick: handleElementClick,
15978
- onElementHover: handleElementHover,
15979
- onContentInput: handleContentInput,
15980
- onEditingStart: handleEditingStart,
15981
- onEditingEnd: handleEditingEnd,
15982
- onDragOver: handleDragOver,
15983
- onDrop: handleDrop,
15984
- onDragLeave: handleDragLeave,
15985
- onSelectionRectChange: handleSelectionRectChange,
15986
- onShadowRootRef: handleShadowRootRef,
15987
- onSlashCommand: handleSlashCommand,
15988
- onSlashCommandClose: handleSlashCommandClose,
15989
- onTextEditStart: handleTextEditStart
15990
- }
15991
- )
15884
+ children: [
15885
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "w-full h-[4px] bg-black opacity-10" }),
15886
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
15887
+ ShadowDomRenderer,
15888
+ {
15889
+ html,
15890
+ focusIdx,
15891
+ hoverIdx,
15892
+ dropIndicator,
15893
+ dropTargetIdx,
15894
+ isDragging,
15895
+ isDragButtonHovered,
15896
+ textEditingIdx: textEditing?.idx || null,
15897
+ showCompanyFooter,
15898
+ onElementClick: handleElementClick,
15899
+ onElementHover: handleElementHover,
15900
+ onContentInput: handleContentInput,
15901
+ onEditingStart: handleEditingStart,
15902
+ onEditingEnd: handleEditingEnd,
15903
+ onDragOver: handleDragOver,
15904
+ onDrop: handleDrop,
15905
+ onDragLeave: handleDragLeave,
15906
+ onSelectionRectChange: handleSelectionRectChange,
15907
+ onShadowRootRef: handleShadowRootRef,
15908
+ onSlashCommand: handleSlashCommand,
15909
+ onSlashCommandClose: handleSlashCommandClose,
15910
+ onTextEditStart: handleTextEditStart
15911
+ }
15912
+ )
15913
+ ]
15992
15914
  }
15993
15915
  ),
15994
15916
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ElementsSuggestions, {}),
@@ -16110,7 +16032,7 @@ function TemplateSizeIndicator() {
16110
16032
  "span",
16111
16033
  {
16112
16034
  className: cn(
16113
- "text-xs text-muted-foreground ml-2",
16035
+ "text-xs text-muted-foreground ml-2 hidden md:block",
16114
16036
  percentage > 90 && "text-yellow-600",
16115
16037
  isAtSizeLimit && "text-red-600"
16116
16038
  ),
@@ -16223,15 +16145,23 @@ function TemplateNameDialog() {
16223
16145
  init_editor();
16224
16146
  init_core();
16225
16147
  var import_jsx_runtime55 = require("react/jsx-runtime");
16226
- function TemplateHeader({ template }) {
16227
- const { templateId, onSave, markAsSaved, isSaving, setIsSaving } = useEditorStore();
16148
+ function TemplateHeader() {
16149
+ const templateId = useEditorStore((s) => s.templateId);
16150
+ const onSave = useEditorStore((s) => s.onSave);
16151
+ const markAsSaved = useEditorStore((s) => s.markAsSaved);
16152
+ const isSaving = useEditorStore((s) => s.isSaving);
16153
+ const setIsSaving = useEditorStore((s) => s.setIsSaving);
16154
+ const onExit = useEditorStore((s) => s.onExit);
16155
+ const templateName = useEditorStore((s) => s.template?.name);
16228
16156
  const handleExit = async () => {
16229
16157
  console.log("handleExit - templateId:", templateId);
16230
16158
  if (isSaving || !templateId || !onSave) return;
16231
16159
  setIsSaving(true);
16232
16160
  try {
16233
- await onSave(templateId, template);
16161
+ await onSave(templateId, useEditorStore.getState().template);
16234
16162
  markAsSaved();
16163
+ onExit?.();
16164
+ console.log("handleExit - onExit called");
16235
16165
  } catch (error) {
16236
16166
  console.error("Failed to save:", error);
16237
16167
  } finally {
@@ -16248,16 +16178,21 @@ function TemplateHeader({ template }) {
16248
16178
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TemplateSizeIndicator, {})
16249
16179
  ] }),
16250
16180
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-row gap-2 items-center", children: [
16251
- template?.name || "Loading...",
16181
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-sm text-muted-foreground w-[100px] truncate text-ellipsis overflow-hidden", children: templateName || "Loading..." }),
16252
16182
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TemplateNameDialog, {})
16253
16183
  ] }),
16254
16184
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-row gap-1 items-center", children: [
16255
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TemplateJsonView, {}),
16256
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(HistoryDebugView, {}),
16185
+ process.env.NODE_ENV !== "production" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TemplateJsonView, {}),
16186
+ process.env.NODE_ENV !== "production" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(HistoryDebugView, {}),
16257
16187
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Preview, {}),
16258
16188
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenu, { children: [
16259
16189
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { variant: "outline", size: "icon", className: "cursor-pointer shadow-none transition-none rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react32.MoreHorizontalIcon, { className: "w-4 h-4" }) }) }),
16260
- /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuContent, { align: "center", children: [
16190
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuContent, { align: "end", className: "z-51", children: [
16191
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuItem, { variant: "default", className: "cursor-pointer md:hidden", children: [
16192
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react32.SendIcon, { className: "w-4 h-4" }),
16193
+ "Send Test"
16194
+ ] }),
16195
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(DropdownMenuSeparator, { className: " md:hidden" }),
16261
16196
  /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(DropdownMenuItem, { className: "cursor-pointer", children: [
16262
16197
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react32.PencilIcon, { className: "w-4 h-4" }),
16263
16198
  "Change Template"
@@ -16277,7 +16212,10 @@ function TemplateHeader({ template }) {
16277
16212
  ] })
16278
16213
  ] })
16279
16214
  ] }),
16280
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { variant: "default", className: "cursor-pointer shadow-none transition-none rounded-[12px]", children: "Send Test" })
16215
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { variant: "default", className: "w-fit cursor-pointer shadow-none transition-none rounded-[12px] hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex flex-row gap-2 items-center", children: [
16216
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react32.SendIcon, {}),
16217
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { children: "Send Test" })
16218
+ ] }) })
16281
16219
  ] })
16282
16220
  ] });
16283
16221
  }
@@ -16876,6 +16814,7 @@ function useTemplateColors() {
16876
16814
  }
16877
16815
 
16878
16816
  // src/core/editor/components/email-template-v2/sidebar/view/color-selection.tsx
16817
+ init_editor();
16879
16818
  init_label();
16880
16819
  init_popover();
16881
16820
 
@@ -17407,7 +17346,7 @@ var rgbaArrayToHex = (rgba) => {
17407
17346
  const [r, g, b] = rgba.map((v) => Math.round(v));
17408
17347
  return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase()}`;
17409
17348
  };
17410
- var ColorButton = ({ color, onColorSelect, currentColor }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Tooltip, { children: [
17349
+ var ColorButton = ({ colorName, color, onColorSelect, currentColor }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Tooltip, { children: [
17411
17350
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
17412
17351
  "button",
17413
17352
  {
@@ -17416,11 +17355,13 @@ var ColorButton = ({ color, onColorSelect, currentColor }) => /* @__PURE__ */ (0
17416
17355
  className: `aspect-square rounded-full cursor-pointer border hover:border-gray-500 ${isColorSelected(color, currentColor) ? "border-2 border-blue-500" : "border-accent"}`
17417
17356
  }
17418
17357
  ) }),
17419
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TooltipContent, { children: color })
17358
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TooltipContent, { children: colorName || color })
17420
17359
  ] });
17421
17360
  function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "Color", colorTarget, focusIdx, currentColor }) {
17422
17361
  const templateColors = useTemplateColors();
17423
17362
  const lastPickedColorRef = (0, import_react44.useRef)(null);
17363
+ const userData = useEditorStore((s) => s.userData);
17364
+ const colorPalettes = userData?.brand_kits?.[0]?.color_palettes ?? [];
17424
17365
  const [colorWheelOpen, setColorWheelOpen] = (0, import_react44.useState)(false);
17425
17366
  const handleColorPickerChange = (0, import_react44.useCallback)((rgba) => {
17426
17367
  const hex = rgbaArrayToHex(rgba);
@@ -17474,7 +17415,7 @@ function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "C
17474
17415
  templateColors.map((color) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorButton, { color, onColorSelect, currentColor }, color))
17475
17416
  ] }) })
17476
17417
  ] }),
17477
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "w-full mb-4", children: [
17418
+ colorPalettes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "w-full mb-4", children: [
17478
17419
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-row items-center justify-between w-full mb-1", children: [
17479
17420
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-row items-center gap-2 h-[44px]", children: [
17480
17421
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react43.Hexagon, { className: "w-4 h-4 text-muted-foreground" }),
@@ -17482,16 +17423,10 @@ function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "C
17482
17423
  ] }),
17483
17424
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Button, { variant: "link", className: "text-sm pr-0 cursor-pointer", children: "Edit" })
17484
17425
  ] }),
17485
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "w-full flex flex-col gap-4", children: [
17486
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-col gap-2", children: [
17487
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Label, { className: "text-xs font-medium text-muted-foreground", children: "Color palette 1" }),
17488
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "w-full grid grid-cols-7 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorButton, { color: "#FFFFFF", onColorSelect, currentColor }) })
17489
- ] }),
17490
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-col gap-2", children: [
17491
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Label, { className: "text-xs font-medium text-muted-foreground", children: "Color palette 2" }),
17492
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "w-full grid grid-cols-7 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorButton, { color: "#E97575", onColorSelect, currentColor }) })
17493
- ] })
17494
- ] })
17426
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "w-full flex flex-col gap-4", children: colorPalettes.map((palette) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-col gap-2", children: [
17427
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Label, { className: "text-xs font-medium text-muted-foreground", children: palette.name }),
17428
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "w-full grid grid-cols-7 gap-2", children: palette.colors.map((c) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ColorButton, { colorName: c.name, color: c.hex, onColorSelect, currentColor }, c.color_id)) })
17429
+ ] }, palette.palette_id)) })
17495
17430
  ] }),
17496
17431
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "w-full", children: [
17497
17432
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex flex-row items-center justify-between w-full mb-1", children: [
@@ -17583,6 +17518,7 @@ var IMAGES_MOCK_DATA = [
17583
17518
  ];
17584
17519
  var ImageSelection = ({ setActiveView, lastView, onImageSelect, focusIdx }) => {
17585
17520
  const template = useEditorStore((state) => state.template);
17521
+ const images = useEditorStore((state) => state.images);
17586
17522
  const currentImageUrl = (0, import_react45.useMemo)(() => {
17587
17523
  if (!focusIdx || !template) return null;
17588
17524
  const path = focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
@@ -17597,16 +17533,28 @@ var ImageSelection = ({ setActiveView, lastView, onImageSelect, focusIdx }) => {
17597
17533
  ] }) }),
17598
17534
  /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "w-full", children: [
17599
17535
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "flex flex-row items-center justify-between w-full mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "text-sm font-medium", children: "Images" }) }),
17600
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "w-full grid grid-cols-3 gap-3", children: IMAGES_MOCK_DATA.map((image2, index) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
17601
- Button,
17602
- {
17603
- variant: "outline",
17604
- className: `aspect-square h-full w-full cursor-pointer shadow-none transition-none rounded-[12px] p-0 ${currentImageUrl === image2.src ? "ring-2 ring-blue-500 ring-offset-2" : ""}`,
17605
- onClick: () => onImageSelect?.(image2.src),
17606
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: image2.src, alt: image2.alt, className: "w-full h-full object-cover rounded-[12px]" })
17607
- },
17608
- index
17609
- )) })
17536
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "w-full grid grid-cols-3 gap-3", children: [
17537
+ IMAGES_MOCK_DATA.map((image2, index) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
17538
+ Button,
17539
+ {
17540
+ variant: "outline",
17541
+ className: `aspect-square h-full w-full cursor-pointer shadow-none transition-none rounded-[12px] p-0 ${currentImageUrl === image2.src ? "ring-2 ring-blue-500 ring-offset-2" : ""}`,
17542
+ onClick: () => onImageSelect?.(image2.src),
17543
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: image2.src, alt: image2.alt, className: "w-full h-full object-cover rounded-[12px]" })
17544
+ },
17545
+ index
17546
+ )),
17547
+ images.map((image2, index) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
17548
+ Button,
17549
+ {
17550
+ variant: "outline",
17551
+ className: `aspect-square h-full w-full cursor-pointer shadow-none transition-none rounded-[12px] p-0 ${currentImageUrl === image2.public_url ? "ring-2 ring-blue-500 ring-offset-2" : ""}`,
17552
+ onClick: () => onImageSelect?.(image2.public_url),
17553
+ children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: image2.public_url, alt: image2.original_name, className: "w-full h-full object-cover rounded-[12px]" })
17554
+ },
17555
+ index
17556
+ ))
17557
+ ] })
17610
17558
  ] })
17611
17559
  ] });
17612
17560
  };
@@ -17853,7 +17801,6 @@ var SelectSocial = ({ value, onChange }) => {
17853
17801
  };
17854
17802
 
17855
17803
  // src/core/editor/components/email-template-v2/sidebar/sidebar.tsx
17856
- init_configuration();
17857
17804
  var import_jsx_runtime75 = require("react/jsx-runtime");
17858
17805
  var normalizeElementType = (type) => {
17859
17806
  if (type === "section" || type === "section-column") return "section";
@@ -17866,11 +17813,24 @@ var toTemplatePath = (focusIdx) => {
17866
17813
  return focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
17867
17814
  };
17868
17815
  function TemplateSidebar({ editorLoading }) {
17869
- const { activeView, setActiveView, lastView, colorType, colorTarget, imageTarget } = useSidebarContext();
17816
+ const { activeView, setActiveView, lastView, colorType, colorTarget, imageTarget, setImageTarget } = useSidebarContext();
17870
17817
  const focusIdx = useEditorStore((state) => state.focusIdx);
17871
- const template = useEditorStore((state) => state.template);
17872
17818
  const tiptapEditor = useEditorStore((state) => state.tiptapEditor);
17819
+ const focusedElementAttrs = useEditorStore(
17820
+ (s) => s.focusIdx ? (0, import_lodash8.get)(s.template, toTemplatePath(s.focusIdx))?.attributes : null
17821
+ );
17822
+ const focusedElementType = useEditorStore(
17823
+ (s) => s.focusIdx ? (0, import_lodash8.get)(s.template, toTemplatePath(s.focusIdx))?.type : null
17824
+ );
17825
+ const parentElementAttrs = useEditorStore((s) => {
17826
+ if (!s.focusIdx) return null;
17827
+ const parentIdx = getParentIdx(s.focusIdx);
17828
+ return parentIdx ? (0, import_lodash8.get)(s.template, toTemplatePath(parentIdx))?.attributes : null;
17829
+ });
17830
+ const pageBgColor = useEditorStore((s) => s.template?.content?.[0]?.attributes?.["background-color"]);
17831
+ const linkColor = useEditorStore((s) => s.template?.content?.[0]?.data?.value?.linkColor);
17873
17832
  const previousElementTypeRef = (0, import_react47.useRef)(void 0);
17833
+ const previousFocusIdxRef = (0, import_react47.useRef)(null);
17874
17834
  const [openSidebar, setOpenSidebar] = (0, import_react47.useState)(true);
17875
17835
  const [updateCounter, forceUpdate] = (0, import_react47.useState)(0);
17876
17836
  (0, import_react47.useEffect)(() => {
@@ -17891,97 +17851,71 @@ function TemplateSidebar({ editorLoading }) {
17891
17851
  if (colorTarget === "highlightColor" && tiptapEditor) {
17892
17852
  return tiptapEditor.getAttributes("textStyle").backgroundColor || null;
17893
17853
  }
17894
- if (!focusIdx || !template) return null;
17895
- const path = toTemplatePath(focusIdx);
17896
- const element = (0, import_lodash8.get)(template, path);
17897
- if (!element) return null;
17854
+ if (!focusIdx || !focusedElementAttrs) return null;
17898
17855
  switch (colorTarget) {
17899
17856
  case "sectionBgColor":
17900
17857
  case "buttonBgColor":
17901
- return element.attributes?.["background-color"] || null;
17858
+ return focusedElementAttrs["background-color"] || null;
17902
17859
  case "buttonTextColor":
17903
17860
  case "socialTextColor":
17904
17861
  case "socialItemTextColor":
17905
- return element.attributes?.["color"] || null;
17862
+ return focusedElementAttrs["color"] || null;
17906
17863
  case "strokeColor":
17907
17864
  case "buttonStrokeColor": {
17908
- const parsed = parseBorder(element.attributes?.border);
17865
+ const parsed = parseBorder(focusedElementAttrs.border);
17909
17866
  return parsed.color || null;
17910
17867
  }
17911
17868
  case "spacerBgColor":
17912
17869
  case "dividerBgColor":
17913
17870
  case "imageBgColor":
17914
17871
  case "socialBgColor":
17915
- return element.attributes?.["container-background-color"] || null;
17872
+ return focusedElementAttrs["container-background-color"] || null;
17916
17873
  case "dividerBorderColor":
17917
- return element.attributes?.["border-color"] || null;
17918
- case "columnBgColor": {
17919
- const columnIdx = getParentIdx(focusIdx);
17920
- if (!columnIdx) return null;
17921
- const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
17922
- return column?.attributes?.["background-color"] || null;
17923
- }
17924
- case "columnStrokeColor": {
17925
- const columnIdx = getParentIdx(focusIdx);
17926
- if (!columnIdx) return null;
17927
- const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
17928
- const parsed = parseBorder(column?.attributes?.border);
17929
- return parsed.color || null;
17930
- }
17931
- case "propertyBgColor": {
17932
- const columnIdx = getParentIdx(focusIdx);
17933
- if (!columnIdx) return null;
17934
- const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
17935
- return column?.attributes?.["background-color"] || null;
17936
- }
17874
+ return focusedElementAttrs["border-color"] || null;
17875
+ case "columnBgColor":
17876
+ case "propertyBgColor":
17877
+ return parentElementAttrs?.["background-color"] || null;
17878
+ case "columnStrokeColor":
17937
17879
  case "propertyStrokeColor": {
17938
- const columnIdx = getParentIdx(focusIdx);
17939
- if (!columnIdx) return null;
17940
- const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
17941
- const parsed = parseBorder(column?.attributes?.border);
17880
+ const parsed = parseBorder(parentElementAttrs?.border);
17942
17881
  return parsed.color || null;
17943
17882
  }
17944
17883
  case "propertyTextColor": {
17945
- const element2 = (0, import_lodash8.get)(template, toTemplatePath(focusIdx));
17946
- if (element2?.type === "property-card-triple-item") {
17947
- const parentIdx = getParentIdx(focusIdx);
17948
- if (!parentIdx) return "#111116";
17949
- const parent = (0, import_lodash8.get)(template, toTemplatePath(parentIdx));
17950
- return parent?.attributes?.["text-color"] || "#111116";
17884
+ if (focusedElementType === "property-card-triple-item") {
17885
+ return parentElementAttrs?.["text-color"] || "#111116";
17951
17886
  }
17952
- return element2?.attributes?.["text-color"] || "#111116";
17953
- }
17954
- case "statusColor": {
17955
- const property = (0, import_lodash8.get)(template, toTemplatePath(focusIdx));
17956
- return property?.attributes?.["status-color"] || "#B8B8B8";
17887
+ return focusedElementAttrs["text-color"] || "#111116";
17957
17888
  }
17889
+ case "statusColor":
17890
+ return focusedElementAttrs["status-color"] || "#B8B8B8";
17958
17891
  case "pageBgColor":
17959
- return template?.content?.[0]?.attributes?.["background-color"] || null;
17892
+ return pageBgColor || null;
17960
17893
  case "linkColor":
17961
- return template?.content?.[0]?.data?.value?.linkColor || "#0000ff";
17894
+ return linkColor || "#0000ff";
17962
17895
  default:
17963
17896
  return null;
17964
17897
  }
17965
- }, [colorTarget, focusIdx, template, tiptapEditor, updateCounter]);
17898
+ }, [colorTarget, focusIdx, focusedElementAttrs, parentElementAttrs, focusedElementType, pageBgColor, linkColor, tiptapEditor, updateCounter]);
17966
17899
  (0, import_react47.useEffect)(() => {
17967
- if (!focusIdx || !template) {
17900
+ if (!focusIdx || !focusedElementType) {
17968
17901
  previousElementTypeRef.current = void 0;
17969
17902
  return;
17970
17903
  }
17971
- const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx));
17972
- const currentType = normalizeElementType(element?.type);
17904
+ const currentType = normalizeElementType(focusedElementType);
17973
17905
  const previousType = previousElementTypeRef.current;
17974
17906
  if (previousType && currentType !== previousType && activeView === "color") {
17975
17907
  setActiveView(lastView);
17976
17908
  }
17977
- if (activeView === "images" && currentType && !IMAGE_SELECTION_VALID_TYPES.includes(currentType)) {
17909
+ if (activeView === "images" && previousFocusIdxRef.current !== null && previousFocusIdxRef.current !== focusIdx) {
17978
17910
  setActiveView(lastView);
17911
+ setImageTarget(null);
17979
17912
  }
17980
17913
  if (activeView === "add-social" && currentType && !ADD_SOCIAL_VALID_TYPES.includes(currentType)) {
17981
17914
  setActiveView(lastView);
17982
17915
  }
17983
17916
  previousElementTypeRef.current = currentType;
17984
- }, [focusIdx, template, activeView, lastView, setActiveView]);
17917
+ previousFocusIdxRef.current = focusIdx ?? null;
17918
+ }, [focusIdx, focusedElementType, activeView, lastView, setActiveView, setImageTarget]);
17985
17919
  const handleColorSelect = (0, import_react47.useCallback)((color) => {
17986
17920
  const tiptapEditor2 = useEditorStore.getState().tiptapEditor;
17987
17921
  if (colorTarget === "textColor" && tiptapEditor2) {
@@ -17995,9 +17929,9 @@ function TemplateSidebar({ editorLoading }) {
17995
17929
  }
17996
17930
  window.dispatchEvent(new CustomEvent("toolbar-refresh"));
17997
17931
  } else if (colorTarget === "sectionBgColor") {
17998
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
17999
- if (focusIdx2 && template2) {
18000
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
17932
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
17933
+ if (focusIdx2 && template) {
17934
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18001
17935
  if (element) {
18002
17936
  updateElement(focusIdx2, {
18003
17937
  attributes: { ...element.attributes, "background-color": color }
@@ -18005,9 +17939,9 @@ function TemplateSidebar({ editorLoading }) {
18005
17939
  }
18006
17940
  }
18007
17941
  } else if (colorTarget === "buttonBgColor") {
18008
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18009
- if (focusIdx2 && template2) {
18010
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
17942
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
17943
+ if (focusIdx2 && template) {
17944
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18011
17945
  if (element) {
18012
17946
  updateElement(focusIdx2, {
18013
17947
  attributes: { ...element.attributes, "background-color": color }
@@ -18015,9 +17949,9 @@ function TemplateSidebar({ editorLoading }) {
18015
17949
  }
18016
17950
  }
18017
17951
  } else if (colorTarget === "buttonStrokeColor") {
18018
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18019
- if (focusIdx2 && template2) {
18020
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
17952
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
17953
+ if (focusIdx2 && template) {
17954
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18021
17955
  if (element) {
18022
17956
  const parsed = parseBorder(element.attributes?.border);
18023
17957
  const newBorder = formatBorder({
@@ -18031,9 +17965,9 @@ function TemplateSidebar({ editorLoading }) {
18031
17965
  }
18032
17966
  }
18033
17967
  } else if (colorTarget === "buttonTextColor") {
18034
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18035
- if (focusIdx2 && template2) {
18036
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
17968
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
17969
+ if (focusIdx2 && template) {
17970
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18037
17971
  if (element) {
18038
17972
  updateElement(focusIdx2, {
18039
17973
  attributes: { ...element.attributes, "color": color }
@@ -18041,10 +17975,10 @@ function TemplateSidebar({ editorLoading }) {
18041
17975
  }
18042
17976
  }
18043
17977
  } else if (colorTarget === "strokeColor") {
18044
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
17978
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18045
17979
  if (focusIdx2 === "content") return;
18046
- if (focusIdx2 && template2) {
18047
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
17980
+ if (focusIdx2 && template) {
17981
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18048
17982
  if (element) {
18049
17983
  const parsed = parseBorder(element.attributes?.border);
18050
17984
  const newBorder = formatBorder({
@@ -18058,11 +17992,11 @@ function TemplateSidebar({ editorLoading }) {
18058
17992
  }
18059
17993
  }
18060
17994
  } else if (colorTarget === "columnBgColor") {
18061
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18062
- if (focusIdx2 && template2) {
17995
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
17996
+ if (focusIdx2 && template) {
18063
17997
  const columnIdx = getParentIdx(focusIdx2);
18064
17998
  if (columnIdx) {
18065
- const column = (0, import_lodash8.get)(template2, toTemplatePath(columnIdx));
17999
+ const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
18066
18000
  if (column) {
18067
18001
  updateElement(columnIdx, {
18068
18002
  attributes: { ...column.attributes, "background-color": color }
@@ -18071,11 +18005,11 @@ function TemplateSidebar({ editorLoading }) {
18071
18005
  }
18072
18006
  }
18073
18007
  } else if (colorTarget === "columnStrokeColor") {
18074
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18075
- if (focusIdx2 && template2) {
18008
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18009
+ if (focusIdx2 && template) {
18076
18010
  const columnIdx = getParentIdx(focusIdx2);
18077
18011
  if (columnIdx) {
18078
- const column = (0, import_lodash8.get)(template2, toTemplatePath(columnIdx));
18012
+ const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
18079
18013
  if (column) {
18080
18014
  const parsed = parseBorder(column.attributes?.border);
18081
18015
  const newBorder = formatBorder({
@@ -18090,9 +18024,9 @@ function TemplateSidebar({ editorLoading }) {
18090
18024
  }
18091
18025
  }
18092
18026
  } else if (colorTarget === "spacerBgColor") {
18093
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18094
- if (focusIdx2 && template2) {
18095
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18027
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18028
+ if (focusIdx2 && template) {
18029
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18096
18030
  if (element) {
18097
18031
  updateElement(focusIdx2, {
18098
18032
  attributes: { ...element.attributes, "container-background-color": color }
@@ -18100,9 +18034,9 @@ function TemplateSidebar({ editorLoading }) {
18100
18034
  }
18101
18035
  }
18102
18036
  } else if (colorTarget === "dividerBorderColor") {
18103
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18104
- if (focusIdx2 && template2) {
18105
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18037
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18038
+ if (focusIdx2 && template) {
18039
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18106
18040
  if (element) {
18107
18041
  updateElement(focusIdx2, {
18108
18042
  attributes: { ...element.attributes, "border-color": color }
@@ -18110,9 +18044,9 @@ function TemplateSidebar({ editorLoading }) {
18110
18044
  }
18111
18045
  }
18112
18046
  } else if (colorTarget === "dividerBgColor") {
18113
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18114
- if (focusIdx2 && template2) {
18115
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18047
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18048
+ if (focusIdx2 && template) {
18049
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18116
18050
  if (element) {
18117
18051
  updateElement(focusIdx2, {
18118
18052
  attributes: { ...element.attributes, "container-background-color": color }
@@ -18120,9 +18054,9 @@ function TemplateSidebar({ editorLoading }) {
18120
18054
  }
18121
18055
  }
18122
18056
  } else if (colorTarget === "imageBgColor") {
18123
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18124
- if (focusIdx2 && template2) {
18125
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18057
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18058
+ if (focusIdx2 && template) {
18059
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18126
18060
  if (element) {
18127
18061
  updateElement(focusIdx2, {
18128
18062
  attributes: { ...element.attributes, "container-background-color": color }
@@ -18130,9 +18064,9 @@ function TemplateSidebar({ editorLoading }) {
18130
18064
  }
18131
18065
  }
18132
18066
  } else if (colorTarget === "socialBgColor") {
18133
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18134
- if (focusIdx2 && template2) {
18135
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18067
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18068
+ if (focusIdx2 && template) {
18069
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18136
18070
  if (element) {
18137
18071
  updateElement(focusIdx2, {
18138
18072
  attributes: { ...element.attributes, "container-background-color": color }
@@ -18140,9 +18074,9 @@ function TemplateSidebar({ editorLoading }) {
18140
18074
  }
18141
18075
  }
18142
18076
  } else if (colorTarget === "socialTextColor") {
18143
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18144
- if (focusIdx2 && template2) {
18145
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18077
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18078
+ if (focusIdx2 && template) {
18079
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18146
18080
  if (element) {
18147
18081
  updateElement(focusIdx2, {
18148
18082
  attributes: { ...element.attributes, "color": color }
@@ -18150,9 +18084,9 @@ function TemplateSidebar({ editorLoading }) {
18150
18084
  }
18151
18085
  }
18152
18086
  } else if (colorTarget === "socialItemTextColor") {
18153
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18154
- if (focusIdx2 && template2) {
18155
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18087
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18088
+ if (focusIdx2 && template) {
18089
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18156
18090
  if (element) {
18157
18091
  updateElement(focusIdx2, {
18158
18092
  attributes: { ...element.attributes, "color": color }
@@ -18160,9 +18094,9 @@ function TemplateSidebar({ editorLoading }) {
18160
18094
  }
18161
18095
  }
18162
18096
  } else if (colorTarget === "pageBgColor") {
18163
- const { updateElement, template: template2 } = useEditorStore.getState();
18164
- if (template2) {
18165
- const pageElement = template2.content?.[0];
18097
+ const { updateElement, template } = useEditorStore.getState();
18098
+ if (template) {
18099
+ const pageElement = template.content?.[0];
18166
18100
  if (pageElement) {
18167
18101
  updateElement("content", {
18168
18102
  attributes: { ...pageElement.attributes, "background-color": color }
@@ -18170,9 +18104,9 @@ function TemplateSidebar({ editorLoading }) {
18170
18104
  }
18171
18105
  }
18172
18106
  } else if (colorTarget === "linkColor") {
18173
- const { updateElement, template: template2 } = useEditorStore.getState();
18174
- if (template2) {
18175
- const pageElement = template2.content?.[0];
18107
+ const { updateElement, template } = useEditorStore.getState();
18108
+ if (template) {
18109
+ const pageElement = template.content?.[0];
18176
18110
  if (pageElement) {
18177
18111
  updateElement("content", {
18178
18112
  data: { value: { ...pageElement.data?.value, linkColor: color } }
@@ -18180,11 +18114,11 @@ function TemplateSidebar({ editorLoading }) {
18180
18114
  }
18181
18115
  }
18182
18116
  } else if (colorTarget === "propertyBgColor") {
18183
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18184
- if (focusIdx2 && template2) {
18117
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18118
+ if (focusIdx2 && template) {
18185
18119
  const columnIdx = getParentIdx(focusIdx2);
18186
18120
  if (columnIdx) {
18187
- const column = (0, import_lodash8.get)(template2, toTemplatePath(columnIdx));
18121
+ const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
18188
18122
  if (column) {
18189
18123
  updateElement(columnIdx, {
18190
18124
  attributes: { ...column.attributes, "background-color": color }
@@ -18193,12 +18127,12 @@ function TemplateSidebar({ editorLoading }) {
18193
18127
  }
18194
18128
  }
18195
18129
  } else if (colorTarget === "propertyStrokeColor") {
18196
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18197
- if (focusIdx2 && template2) {
18130
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18131
+ if (focusIdx2 && template) {
18198
18132
  const columnIdx = getParentIdx(focusIdx2);
18199
18133
  if (columnIdx) {
18200
- const column = (0, import_lodash8.get)(template2, toTemplatePath(columnIdx));
18201
- const property = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18134
+ const column = (0, import_lodash8.get)(template, toTemplatePath(columnIdx));
18135
+ const property = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18202
18136
  if (column) {
18203
18137
  const parsed = parseBorder(column.attributes?.border);
18204
18138
  const newBorder = formatBorder({
@@ -18218,13 +18152,13 @@ function TemplateSidebar({ editorLoading }) {
18218
18152
  }
18219
18153
  }
18220
18154
  } else if (colorTarget === "propertyTextColor") {
18221
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18222
- if (focusIdx2 && template2) {
18223
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18155
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18156
+ if (focusIdx2 && template) {
18157
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18224
18158
  if (element?.type === "property-card-triple-item") {
18225
18159
  const parentIdx = getParentIdx(focusIdx2);
18226
18160
  if (parentIdx) {
18227
- const parent = (0, import_lodash8.get)(template2, toTemplatePath(parentIdx));
18161
+ const parent = (0, import_lodash8.get)(template, toTemplatePath(parentIdx));
18228
18162
  if (parent) {
18229
18163
  updateElement(parentIdx, {
18230
18164
  attributes: { ...parent.attributes, "text-color": color }
@@ -18238,9 +18172,9 @@ function TemplateSidebar({ editorLoading }) {
18238
18172
  }
18239
18173
  }
18240
18174
  } else if (colorTarget === "statusColor") {
18241
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18242
- if (focusIdx2 && template2) {
18243
- const property = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18175
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18176
+ if (focusIdx2 && template) {
18177
+ const property = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18244
18178
  if (property) {
18245
18179
  updateElement(focusIdx2, {
18246
18180
  attributes: { ...property.attributes, "status-color": color }
@@ -18250,10 +18184,17 @@ function TemplateSidebar({ editorLoading }) {
18250
18184
  }
18251
18185
  }, [colorTarget]);
18252
18186
  const handleImageSelect = (0, import_react47.useCallback)((imageSrc) => {
18253
- const { focusIdx: focusIdx2, updateElement, template: template2 } = useEditorStore.getState();
18254
- if (!focusIdx2 || !template2) return;
18255
- const element = (0, import_lodash8.get)(template2, toTemplatePath(focusIdx2));
18187
+ const { focusIdx: focusIdx2, updateElement, template } = useEditorStore.getState();
18188
+ if (!focusIdx2 || !template) return;
18189
+ const element = (0, import_lodash8.get)(template, toTemplatePath(focusIdx2));
18256
18190
  if (!element) return;
18191
+ const validTypesForTarget = {
18192
+ sectionBgImage: ["section", "section-column", "section-property-km", "section-property-single-two", "section-property-triple"],
18193
+ imageElement: ["image"],
18194
+ propertyImage: ["property-card", "property-card-single-two", "property-card-triple-item"]
18195
+ };
18196
+ const validTypes = validTypesForTarget[imageTarget ?? ""];
18197
+ if (validTypes && !validTypes.includes(element.type)) return;
18257
18198
  const attributeName = imageTarget === "imageElement" ? "src" : imageTarget === "propertyImage" ? "image-src" : "background-url";
18258
18199
  updateElement(focusIdx2, {
18259
18200
  attributes: { ...element.attributes, [attributeName]: imageSrc }
@@ -18297,19 +18238,6 @@ function TemplateSidebar({ editorLoading }) {
18297
18238
  }
18298
18239
  ),
18299
18240
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-xs text-muted-foreground", children: "Styles" })
18300
- ] }),
18301
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [
18302
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
18303
- Button,
18304
- {
18305
- onClick: () => handleViewClick("brand"),
18306
- variant: "ghost",
18307
- size: "icon",
18308
- className: `shadow-none transition-none w-[44px] h-[44px] p-0 flex flex-col items-center cursor-pointer ${activeView === "brand" ? "bg-sidebar-accent" : ""}`,
18309
- children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react46.Hexagon, {})
18310
- }
18311
- ),
18312
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-xs text-muted-foreground", children: "Brand" })
18313
18241
  ] })
18314
18242
  ] }),
18315
18243
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
@@ -18506,7 +18434,7 @@ var ToolbarContainer = ({ children }) => {
18506
18434
  {
18507
18435
  "data-toolbar-container": "true",
18508
18436
  "data-editor-toolbar": "true",
18509
- className: "absolute top-0 left-0 right-0 mx-auto flex flex-row items-center w-fit justify-center h-[44px] py-2 shrink-0 px-1 border m-2 bg-white dark:bg-black rounded-[12px] shadow-sm",
18437
+ className: "absolute top-0 left-0 right-0 mx-auto m-2 flex flex-row items-center w-fit justify-center h-[44px] py-2 shrink-0 px-1 border bg-white dark:bg-black rounded-[12px] [@media(max-width:950px)]:static [@media(max-width:950px)]:mx-0 [@media(max-width:950px)]:m-0 [@media(max-width:950px)]:max-w-full [@media(max-width:950px)]:w-full [@media(max-width:950px)]:items-center [@media(max-width:950px)]:rounded-none [@media(max-width:950px)]:justify-start [@media(max-width:950px)]:shadow-none [@media(max-width:950px)]:border-0 [@media(max-width:950px)]:border-b",
18510
18438
  style: { zIndex: 51 },
18511
18439
  children
18512
18440
  }
@@ -18520,20 +18448,29 @@ var ToolbarContent = ({ children }) => {
18520
18448
  };
18521
18449
 
18522
18450
  // src/core/editor/components/toolbar-ui/separator.tsx
18451
+ init_utils();
18523
18452
  var import_jsx_runtime81 = require("react/jsx-runtime");
18524
- var ToolbarSeparator = () => {
18525
- return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "border-r h-[14px] pr-2 mr-2" });
18453
+ var ToolbarSeparator = ({ className }) => {
18454
+ return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: cn("border-r h-[14px] pr-2 mr-2", className) });
18526
18455
  };
18527
18456
 
18528
- // src/core/editor/components/element-gear/plain-toolbar.tsx
18457
+ // src/core/editor/components/toolbar-ui/item.tsx
18458
+ init_utils();
18529
18459
  var import_jsx_runtime82 = require("react/jsx-runtime");
18460
+ var ToolbarItem = ({ children, className }) => {
18461
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: cn("", className), children });
18462
+ };
18463
+
18464
+ // src/core/editor/components/element-gear/plain-toolbar.tsx
18465
+ var import_jsx_runtime83 = require("react/jsx-runtime");
18530
18466
  var PlainToolbar = () => {
18531
- return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ToolbarContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(BasicOption, {}) }) });
18467
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ToolbarContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(BasicOption, {}) }) });
18532
18468
  };
18533
18469
 
18534
18470
  // src/core/editor/components/element-gear/text/toolbar.tsx
18535
18471
  var import_react57 = require("react");
18536
18472
  init_dropdown_menu();
18473
+ init_popover();
18537
18474
  init_button();
18538
18475
  var import_lucide_react54 = require("lucide-react");
18539
18476
  init_tooltip();
@@ -18551,7 +18488,7 @@ init_label();
18551
18488
  var React = __toESM(require("react"));
18552
18489
  var SliderPrimitive = __toESM(require("@radix-ui/react-slider"));
18553
18490
  init_utils();
18554
- var import_jsx_runtime83 = require("react/jsx-runtime");
18491
+ var import_jsx_runtime84 = require("react/jsx-runtime");
18555
18492
  function Slider2({
18556
18493
  className,
18557
18494
  defaultValue,
@@ -18564,7 +18501,7 @@ function Slider2({
18564
18501
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
18565
18502
  [value, defaultValue, min, max]
18566
18503
  );
18567
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
18504
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
18568
18505
  SliderPrimitive.Root,
18569
18506
  {
18570
18507
  "data-slot": "slider",
@@ -18578,14 +18515,14 @@ function Slider2({
18578
18515
  ),
18579
18516
  ...props,
18580
18517
  children: [
18581
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
18518
+ /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18582
18519
  SliderPrimitive.Track,
18583
18520
  {
18584
18521
  "data-slot": "slider-track",
18585
18522
  className: cn(
18586
18523
  "bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
18587
18524
  ),
18588
- children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
18525
+ children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18589
18526
  SliderPrimitive.Range,
18590
18527
  {
18591
18528
  "data-slot": "slider-range",
@@ -18596,7 +18533,7 @@ function Slider2({
18596
18533
  )
18597
18534
  }
18598
18535
  ),
18599
- Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
18536
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18600
18537
  SliderPrimitive.Thumb,
18601
18538
  {
18602
18539
  "data-slot": "slider-thumb",
@@ -18614,7 +18551,7 @@ init_input();
18614
18551
  var import_react50 = require("react");
18615
18552
  init_editor();
18616
18553
  init_configuration();
18617
- var import_jsx_runtime84 = require("react/jsx-runtime");
18554
+ var import_jsx_runtime85 = require("react/jsx-runtime");
18618
18555
  var ParagraphTextSettings = (0, import_react50.memo)(function ParagraphTextSettings2() {
18619
18556
  const [isOpen, setIsOpen] = (0, import_react50.useState)(false);
18620
18557
  const tiptapEditor = useEditorStore((s) => s.tiptapEditor);
@@ -18731,28 +18668,28 @@ var ParagraphTextSettings = (0, import_react50.memo)(function ParagraphTextSetti
18731
18668
  e.target.blur();
18732
18669
  }
18733
18670
  }, [applyLineHeight]);
18734
- return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Tooltip, { children: [
18735
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
18736
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18671
+ return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Tooltip, { children: [
18672
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
18673
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18737
18674
  Button,
18738
18675
  {
18739
18676
  variant: "ghost",
18740
18677
  className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
18741
18678
  size: "icon",
18742
18679
  disabled: !tiptapEditor,
18743
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react48.TypeIcon, { className: "w-4 h-4" })
18680
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react48.TypeIcon, { className: "w-4 h-4" })
18744
18681
  }
18745
18682
  ) }) }),
18746
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18683
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18747
18684
  PopoverContent,
18748
18685
  {
18749
18686
  className: "w-64 z-51 mt-1 rounded-[12px]",
18750
18687
  "data-editor-toolbar": "true",
18751
- children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col gap-4", children: [
18752
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col gap-3", children: [
18753
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Label, { children: "Letter spacing" }),
18754
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
18755
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18688
+ children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-4", children: [
18689
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-3", children: [
18690
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Label, { children: "Letter spacing" }),
18691
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
18692
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18756
18693
  Slider2,
18757
18694
  {
18758
18695
  value: [currentLetterSpacing],
@@ -18763,7 +18700,7 @@ var ParagraphTextSettings = (0, import_react50.memo)(function ParagraphTextSetti
18763
18700
  disabled: !tiptapEditor
18764
18701
  }
18765
18702
  ),
18766
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18703
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18767
18704
  Input,
18768
18705
  {
18769
18706
  type: "number",
@@ -18780,10 +18717,10 @@ var ParagraphTextSettings = (0, import_react50.memo)(function ParagraphTextSetti
18780
18717
  )
18781
18718
  ] })
18782
18719
  ] }),
18783
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-col gap-3", children: [
18784
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Label, { children: "Line spacing" }),
18785
- /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
18786
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18720
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-col gap-3", children: [
18721
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Label, { children: "Line spacing" }),
18722
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
18723
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18787
18724
  Slider2,
18788
18725
  {
18789
18726
  value: [currentLineHeight],
@@ -18794,7 +18731,7 @@ var ParagraphTextSettings = (0, import_react50.memo)(function ParagraphTextSetti
18794
18731
  disabled: !tiptapEditor
18795
18732
  }
18796
18733
  ),
18797
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
18734
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18798
18735
  Input,
18799
18736
  {
18800
18737
  type: "number",
@@ -18816,7 +18753,7 @@ var ParagraphTextSettings = (0, import_react50.memo)(function ParagraphTextSetti
18816
18753
  }
18817
18754
  )
18818
18755
  ] }),
18819
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Text Settings" })
18756
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Text Settings" })
18820
18757
  ] });
18821
18758
  });
18822
18759
 
@@ -18826,15 +18763,15 @@ init_dropdown_menu();
18826
18763
  init_tooltip();
18827
18764
  var import_lucide_react49 = require("lucide-react");
18828
18765
  init_configuration();
18829
- var import_jsx_runtime85 = require("react/jsx-runtime");
18766
+ var import_jsx_runtime86 = require("react/jsx-runtime");
18830
18767
  var FontFamilyDropdown = ({
18831
18768
  currentFont,
18832
18769
  onFontChange,
18833
18770
  disabled = false
18834
18771
  }) => {
18835
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(DropdownMenu, { modal: false, children: [
18836
- /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(Tooltip, { children: [
18837
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18772
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(DropdownMenu, { modal: false, children: [
18773
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(Tooltip, { children: [
18774
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
18838
18775
  Button,
18839
18776
  {
18840
18777
  variant: "outline",
@@ -18843,15 +18780,15 @@ var FontFamilyDropdown = ({
18843
18780
  children: currentFont
18844
18781
  }
18845
18782
  ) }) }),
18846
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TooltipContent, { side: "bottom", children: "Font" })
18783
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(TooltipContent, { side: "bottom", children: "Font" })
18847
18784
  ] }),
18848
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
18785
+ /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
18849
18786
  DropdownMenuContent,
18850
18787
  {
18851
18788
  align: "start",
18852
18789
  className: "z-51",
18853
18790
  "data-editor-toolbar": "true",
18854
- children: FONTS.map((font) => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
18791
+ children: FONTS.map((font) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
18855
18792
  DropdownMenuItem,
18856
18793
  {
18857
18794
  onClick: () => onFontChange(font),
@@ -18859,7 +18796,7 @@ var FontFamilyDropdown = ({
18859
18796
  style: { fontFamily: font },
18860
18797
  children: [
18861
18798
  font,
18862
- currentFont === font && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react49.CheckIcon, { className: "w-4 h-4 ml-auto" })
18799
+ currentFont === font && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react49.CheckIcon, { className: "w-4 h-4 ml-auto" })
18863
18800
  ]
18864
18801
  },
18865
18802
  font
@@ -18878,7 +18815,7 @@ var import_react_slot3 = require("@radix-ui/react-slot");
18878
18815
  var import_class_variance_authority2 = require("class-variance-authority");
18879
18816
  init_utils();
18880
18817
  init_separator();
18881
- var import_jsx_runtime86 = require("react/jsx-runtime");
18818
+ var import_jsx_runtime87 = require("react/jsx-runtime");
18882
18819
  var buttonGroupVariants = (0, import_class_variance_authority2.cva)(
18883
18820
  "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
18884
18821
  {
@@ -18898,7 +18835,7 @@ function ButtonGroup({
18898
18835
  orientation,
18899
18836
  ...props
18900
18837
  }) {
18901
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
18838
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
18902
18839
  "div",
18903
18840
  {
18904
18841
  role: "group",
@@ -18915,7 +18852,7 @@ function ButtonGroupText({
18915
18852
  ...props
18916
18853
  }) {
18917
18854
  const Comp = asChild ? import_react_slot3.Slot : "div";
18918
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
18855
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
18919
18856
  Comp,
18920
18857
  {
18921
18858
  className: cn(
@@ -18933,9 +18870,9 @@ init_utils();
18933
18870
  init_button();
18934
18871
  init_input();
18935
18872
  init_textarea();
18936
- var import_jsx_runtime87 = require("react/jsx-runtime");
18873
+ var import_jsx_runtime88 = require("react/jsx-runtime");
18937
18874
  function InputGroup({ className, ...props }) {
18938
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
18875
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
18939
18876
  "div",
18940
18877
  {
18941
18878
  "data-slot": "input-group",
@@ -18994,7 +18931,7 @@ function InputGroupInput({
18994
18931
  className,
18995
18932
  ...props
18996
18933
  }) {
18997
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
18934
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
18998
18935
  Input,
18999
18936
  {
19000
18937
  "data-slot": "input-group-control",
@@ -19012,7 +18949,7 @@ init_tooltip();
19012
18949
  init_popover();
19013
18950
  var import_lucide_react50 = require("lucide-react");
19014
18951
  init_configuration();
19015
- var import_jsx_runtime88 = require("react/jsx-runtime");
18952
+ var import_jsx_runtime89 = require("react/jsx-runtime");
19016
18953
  var PRESET_FONT_SIZES = [6, 8, 10, 12, 14, 16, 18, 21, 24, 28, 32, 36, 48, 64, 72];
19017
18954
  var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19018
18955
  value,
@@ -19077,9 +19014,9 @@ var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19077
19014
  setInputValue(String(size));
19078
19015
  setIsPopoverOpen(false);
19079
19016
  }, [onChange]);
19080
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "grid w-full max-w-sm gap-6", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(ButtonGroup, { children: [
19081
- /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Tooltip, { children: [
19082
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
19017
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "grid w-full max-w-sm gap-6", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(ButtonGroup, { children: [
19018
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tooltip, { children: [
19019
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19083
19020
  Button,
19084
19021
  {
19085
19022
  variant: "ghost",
@@ -19088,14 +19025,14 @@ var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19088
19025
  "aria-label": "Decrease Font Size",
19089
19026
  onClick: handleDecrease,
19090
19027
  disabled: disabled || value <= min,
19091
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react50.MinusIcon, {})
19028
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react50.MinusIcon, {})
19092
19029
  }
19093
19030
  ) }) }),
19094
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TooltipContent, { side: "bottom", children: "Decrease" })
19031
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipContent, { side: "bottom", children: "Decrease" })
19095
19032
  ] }),
19096
- /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [
19097
- /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Tooltip, { children: [
19098
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(InputGroup, { className: "shadow-none border-x-0", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
19033
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Popover, { open: isPopoverOpen, onOpenChange: setIsPopoverOpen, children: [
19034
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tooltip, { children: [
19035
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(InputGroup, { className: "shadow-none border-x-0", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19099
19036
  InputGroupInput,
19100
19037
  {
19101
19038
  type: "number",
@@ -19111,16 +19048,16 @@ var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19111
19048
  disabled
19112
19049
  }
19113
19050
  ) }) }) }),
19114
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TooltipContent, { side: "bottom", children: "Font size" })
19051
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipContent, { side: "bottom", children: "Font size" })
19115
19052
  ] }),
19116
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
19053
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19117
19054
  PopoverContent,
19118
19055
  {
19119
19056
  className: "w-auto p-0 overflow-hidden z-50001 ",
19120
19057
  align: "center",
19121
19058
  side: "bottom",
19122
19059
  onOpenAutoFocus: (e) => e.preventDefault(),
19123
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "flex flex-col min-w-[100px] text-start max-h-[400px] overflow-y-auto", children: PRESET_FONT_SIZES.map((size) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
19060
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "flex flex-col min-w-[100px] text-start max-h-[400px] overflow-y-auto", children: PRESET_FONT_SIZES.map((size) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
19124
19061
  "button",
19125
19062
  {
19126
19063
  className: `flex items-center justify-between px-3 py-1 text-sm h-[38px] hover:bg-accent cursor-pointer text-start ${value === size ? "bg-accent font-medium" : ""}`,
@@ -19129,8 +19066,8 @@ var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19129
19066
  handlePresetSelect(size);
19130
19067
  },
19131
19068
  children: [
19132
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "text-sm", children: size }),
19133
- value === size && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react50.CheckIcon, { className: "w-4 h-4" })
19069
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: size }),
19070
+ value === size && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react50.CheckIcon, { className: "w-4 h-4" })
19134
19071
  ]
19135
19072
  },
19136
19073
  size
@@ -19138,8 +19075,8 @@ var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19138
19075
  }
19139
19076
  )
19140
19077
  ] }),
19141
- /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Tooltip, { children: [
19142
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
19078
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tooltip, { children: [
19079
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ButtonGroupText, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19143
19080
  Button,
19144
19081
  {
19145
19082
  variant: "ghost",
@@ -19148,10 +19085,10 @@ var FontSizeControl = (0, import_react51.memo)(function FontSizeControl2({
19148
19085
  "aria-label": "Increase Font Size",
19149
19086
  onClick: handleIncrease,
19150
19087
  disabled: disabled || value >= max,
19151
- children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react50.PlusIcon, {})
19088
+ children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react50.PlusIcon, {})
19152
19089
  }
19153
19090
  ) }) }),
19154
- /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(TooltipContent, { side: "bottom", children: "Increase" })
19091
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipContent, { side: "bottom", children: "Increase" })
19155
19092
  ] })
19156
19093
  ] }) });
19157
19094
  });
@@ -19169,7 +19106,7 @@ init_input();
19169
19106
  init_label();
19170
19107
  init_tooltip();
19171
19108
  var import_lucide_react51 = require("lucide-react");
19172
- var import_jsx_runtime89 = require("react/jsx-runtime");
19109
+ var import_jsx_runtime90 = require("react/jsx-runtime");
19173
19110
  var BorderRadius = ({
19174
19111
  value,
19175
19112
  onChange,
@@ -19203,21 +19140,21 @@ var BorderRadius = ({
19203
19140
  e.currentTarget.blur();
19204
19141
  }
19205
19142
  };
19206
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Tooltip, { children: [
19207
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
19208
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19143
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Tooltip, { children: [
19144
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
19145
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19209
19146
  Button,
19210
19147
  {
19211
19148
  variant: "ghost",
19212
19149
  className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
19213
19150
  size: "icon",
19214
- children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react51.SquareRoundCorner, { className: "w-4 h-4" })
19151
+ children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react51.SquareRoundCorner, { className: "w-4 h-4" })
19215
19152
  }
19216
19153
  ) }) }),
19217
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex flex-col gap-3", children: [
19218
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Label, { children: "Corner rounding" }),
19219
- /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19220
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19154
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-3", children: [
19155
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Label, { children: "Corner rounding" }),
19156
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19157
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19221
19158
  Slider2,
19222
19159
  {
19223
19160
  value: [value],
@@ -19227,7 +19164,7 @@ var BorderRadius = ({
19227
19164
  step: 1
19228
19165
  }
19229
19166
  ),
19230
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
19167
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19231
19168
  Input,
19232
19169
  {
19233
19170
  type: "number",
@@ -19243,7 +19180,7 @@ var BorderRadius = ({
19243
19180
  ] })
19244
19181
  ] }) })
19245
19182
  ] }),
19246
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
19183
+ /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
19247
19184
  ] });
19248
19185
  };
19249
19186
 
@@ -19255,7 +19192,7 @@ var import_lucide_react52 = require("lucide-react");
19255
19192
  var import_react53 = require("react");
19256
19193
  init_label();
19257
19194
  init_input();
19258
- var import_jsx_runtime90 = require("react/jsx-runtime");
19195
+ var import_jsx_runtime91 = require("react/jsx-runtime");
19259
19196
  var StrokeWeight = ({
19260
19197
  width,
19261
19198
  isEnabled,
@@ -19291,42 +19228,42 @@ var StrokeWeight = ({
19291
19228
  e.currentTarget.blur();
19292
19229
  }
19293
19230
  };
19294
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Tooltip, { children: [
19295
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
19296
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19231
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Tooltip, { children: [
19232
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
19233
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19297
19234
  Button,
19298
19235
  {
19299
19236
  variant: "ghost",
19300
19237
  className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
19301
19238
  size: "icon",
19302
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react52.MinusIcon, { className: "w-4 h-4" })
19239
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react52.MinusIcon, { className: "w-4 h-4" })
19303
19240
  }
19304
19241
  ) }) }),
19305
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-3", children: [
19306
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19307
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19242
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-col gap-3", children: [
19243
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19244
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19308
19245
  Button,
19309
19246
  {
19310
19247
  variant: !isEnabled ? "default" : "outline",
19311
19248
  className: "flex-1 cursor-pointer shadow-none rounded-[12px]",
19312
19249
  onClick: () => onEnabledChange(false),
19313
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react52.BanIcon, { className: "w-4 h-4" })
19250
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react52.BanIcon, { className: "w-4 h-4" })
19314
19251
  }
19315
19252
  ),
19316
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19253
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19317
19254
  Button,
19318
19255
  {
19319
19256
  variant: isEnabled ? "default" : "outline",
19320
19257
  className: "flex-1 cursor-pointer shadow-none rounded-[12px]",
19321
19258
  onClick: () => onEnabledChange(true),
19322
- children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react52.MinusIcon, { className: "w-4 h-4" })
19259
+ children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react52.MinusIcon, { className: "w-4 h-4" })
19323
19260
  }
19324
19261
  )
19325
19262
  ] }),
19326
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { children: [
19327
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Label, { children: "Stroke weight" }),
19328
- /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19329
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19263
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { children: [
19264
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Label, { children: "Stroke weight" }),
19265
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19266
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19330
19267
  Slider2,
19331
19268
  {
19332
19269
  value: [width],
@@ -19336,7 +19273,7 @@ var StrokeWeight = ({
19336
19273
  step: 1
19337
19274
  }
19338
19275
  ),
19339
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
19276
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19340
19277
  Input,
19341
19278
  {
19342
19279
  type: "number",
@@ -19353,7 +19290,7 @@ var StrokeWeight = ({
19353
19290
  ] })
19354
19291
  ] }) })
19355
19292
  ] }),
19356
- /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
19293
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
19357
19294
  ] });
19358
19295
  };
19359
19296
 
@@ -19362,16 +19299,16 @@ init_button();
19362
19299
 
19363
19300
  // src/components/ui/collapsible.tsx
19364
19301
  var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
19365
- var import_jsx_runtime91 = require("react/jsx-runtime");
19302
+ var import_jsx_runtime92 = require("react/jsx-runtime");
19366
19303
  function Collapsible({
19367
19304
  ...props
19368
19305
  }) {
19369
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
19306
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
19370
19307
  }
19371
19308
  function CollapsibleTrigger2({
19372
19309
  ...props
19373
19310
  }) {
19374
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19311
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19375
19312
  CollapsiblePrimitive.CollapsibleTrigger,
19376
19313
  {
19377
19314
  "data-slot": "collapsible-trigger",
@@ -19382,7 +19319,7 @@ function CollapsibleTrigger2({
19382
19319
  function CollapsibleContent2({
19383
19320
  ...props
19384
19321
  }) {
19385
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
19322
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19386
19323
  CollapsiblePrimitive.CollapsibleContent,
19387
19324
  {
19388
19325
  "data-slot": "collapsible-content",
@@ -19514,7 +19451,7 @@ var usePadding = (options = {}) => {
19514
19451
  };
19515
19452
 
19516
19453
  // src/core/editor/components/better-padding.tsx
19517
- var import_jsx_runtime92 = require("react/jsx-runtime");
19454
+ var import_jsx_runtime93 = require("react/jsx-runtime");
19518
19455
  var PADDING_MAX = 34;
19519
19456
  var BetterPadding = ({
19520
19457
  showPadding = true,
@@ -19537,19 +19474,19 @@ var BetterPadding = ({
19537
19474
  const handleToggleInner = (0, import_react55.useCallback)(() => handleToggle("inner"), [handleToggle]);
19538
19475
  const handleToggleIcon = (0, import_react55.useCallback)(() => handleToggle("icon"), [handleToggle]);
19539
19476
  const handleToggleText = (0, import_react55.useCallback)(() => handleToggle("text"), [handleToggle]);
19540
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Tooltip, { children: [
19541
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
19542
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19477
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Tooltip, { children: [
19478
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
19479
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19543
19480
  Button,
19544
19481
  {
19545
19482
  variant: "ghost",
19546
19483
  className: `shadow-none transition-none cursor-pointer rounded-[12px] ${isOpen ? "bg-muted" : ""}`,
19547
19484
  size: "icon",
19548
- children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react53.SquareSquare, { className: "w-4 h-4" })
19485
+ children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.SquareSquare, { className: "w-4 h-4" })
19549
19486
  }
19550
19487
  ) }) }),
19551
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px] p-2 gap-2 flex flex-col z-50001", children: [
19552
- showPadding && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19488
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(PopoverContent, { className: "w-64 z-51 mt-1 rounded-[12px] p-2 gap-2 flex flex-col z-50001", children: [
19489
+ showPadding && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19553
19490
  PaddingSectionUI,
19554
19491
  {
19555
19492
  label: "Padding",
@@ -19558,7 +19495,7 @@ var BetterPadding = ({
19558
19495
  data: padding
19559
19496
  }
19560
19497
  ),
19561
- showInnerPadding && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19498
+ showInnerPadding && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19562
19499
  PaddingSectionUI,
19563
19500
  {
19564
19501
  label: "Inner Padding",
@@ -19567,7 +19504,7 @@ var BetterPadding = ({
19567
19504
  data: innerPadding
19568
19505
  }
19569
19506
  ),
19570
- showIconPadding && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19507
+ showIconPadding && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19571
19508
  PaddingSectionUI,
19572
19509
  {
19573
19510
  label: "Icon Padding",
@@ -19576,7 +19513,7 @@ var BetterPadding = ({
19576
19513
  data: iconPadding
19577
19514
  }
19578
19515
  ),
19579
- showTextPadding && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19516
+ showTextPadding && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19580
19517
  PaddingSectionUI,
19581
19518
  {
19582
19519
  label: "Text Padding",
@@ -19587,7 +19524,7 @@ var BetterPadding = ({
19587
19524
  )
19588
19525
  ] })
19589
19526
  ] }),
19590
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
19527
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: tooltipText })
19591
19528
  ] });
19592
19529
  };
19593
19530
  var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
@@ -19690,14 +19627,14 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
19690
19627
  setLeftInput(clamped.toString());
19691
19628
  }
19692
19629
  }, [leftInput, data]);
19693
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Collapsible, { open: isOpen, onOpenChange: onToggle, children: [
19694
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Button, { variant: "outline", className: "w-full shadow-none rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "w-full flex flex-row items-center justify-between gap-2", children: [
19695
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("p", { children: label }),
19696
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react53.ChevronDownIcon, { className: `w-4 h-4 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}` })
19630
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Collapsible, { open: isOpen, onOpenChange: onToggle, children: [
19631
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { variant: "outline", className: "w-full shadow-none rounded-[12px]", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "w-full flex flex-row items-center justify-between gap-2", children: [
19632
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { children: label }),
19633
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.ChevronDownIcon, { className: `w-4 h-4 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}` })
19697
19634
  ] }) }) }),
19698
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CollapsibleContent2, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-col", children: [
19699
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19700
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19635
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CollapsibleContent2, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col", children: [
19636
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19637
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19701
19638
  Slider2,
19702
19639
  {
19703
19640
  value: [sliderValue],
@@ -19707,7 +19644,7 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
19707
19644
  step: 1
19708
19645
  }
19709
19646
  ),
19710
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19647
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19711
19648
  Input,
19712
19649
  {
19713
19650
  type: "number",
@@ -19721,11 +19658,11 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
19721
19658
  }
19722
19659
  )
19723
19660
  ] }) }),
19724
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-col gap-4 p-2", children: [
19725
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19726
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19727
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react53.PanelTopDashedIcon, { size: 18, className: "text-muted-foreground" }),
19728
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19661
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-col gap-4 p-2", children: [
19662
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19663
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19664
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.PanelTopDashedIcon, { size: 18, className: "text-muted-foreground" }),
19665
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19729
19666
  Input,
19730
19667
  {
19731
19668
  type: "number",
@@ -19739,9 +19676,9 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
19739
19676
  }
19740
19677
  )
19741
19678
  ] }),
19742
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19743
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react53.PanelBottomDashedIcon, { size: 18, className: "text-muted-foreground" }),
19744
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19679
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19680
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.PanelBottomDashedIcon, { size: 18, className: "text-muted-foreground" }),
19681
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19745
19682
  Input,
19746
19683
  {
19747
19684
  type: "number",
@@ -19756,10 +19693,10 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
19756
19693
  )
19757
19694
  ] })
19758
19695
  ] }),
19759
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19760
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19761
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react53.PanelLeftDashedIcon, { size: 18, className: "text-muted-foreground" }),
19762
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19696
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19697
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19698
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.PanelLeftDashedIcon, { size: 18, className: "text-muted-foreground" }),
19699
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19763
19700
  Input,
19764
19701
  {
19765
19702
  type: "number",
@@ -19773,9 +19710,9 @@ var PaddingSectionUI = ({ label, isOpen, onToggle, data }) => {
19773
19710
  }
19774
19711
  )
19775
19712
  ] }),
19776
- /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19777
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_lucide_react53.PanelRightDashedIcon, { size: 18, className: "text-muted-foreground" }),
19778
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
19713
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "flex flex-row items-center gap-2", children: [
19714
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_lucide_react53.PanelRightDashedIcon, { size: 18, className: "text-muted-foreground" }),
19715
+ /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19779
19716
  Input,
19780
19717
  {
19781
19718
  type: "number",
@@ -19815,22 +19752,22 @@ var formatBorderRadius = (value) => {
19815
19752
  // src/core/editor/components/background-color-btn.tsx
19816
19753
  init_tooltip();
19817
19754
  init_button();
19818
- var import_jsx_runtime93 = require("react/jsx-runtime");
19755
+ var import_jsx_runtime94 = require("react/jsx-runtime");
19819
19756
  var BackgroundColorBtn = ({ activeView, colorTarget, handleOpenBgColorPicker, currentBgColor }) => {
19820
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Tooltip, { children: [
19821
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19757
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Tooltip, { children: [
19758
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19822
19759
  Button,
19823
19760
  {
19824
19761
  variant: "ghost",
19825
19762
  className: `shadow-none transition-none cursor-pointer rounded-[12px] ${activeView === "color" && (colorTarget === "sectionBgColor" || colorTarget === "propertyBgColor") ? "bg-muted" : ""}`,
19826
19763
  size: "icon",
19827
19764
  onClick: handleOpenBgColorPicker,
19828
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19765
+ children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19829
19766
  "div",
19830
19767
  {
19831
19768
  className: "w-6 h-6 rounded-full border flex items-center justify-center overflow-hidden",
19832
19769
  style: { backgroundColor: currentBgColor || "transparent" },
19833
- children: currentBgColor === "transparent" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
19770
+ children: currentBgColor === "transparent" ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19834
19771
  "img",
19835
19772
  {
19836
19773
  src: "https://mzyngaqmbvhpgmmipndy.supabase.co/storage/v1/object/public/Maillow/icons/transparent-visual.svg",
@@ -19844,12 +19781,12 @@ var BackgroundColorBtn = ({ activeView, colorTarget, handleOpenBgColorPicker, cu
19844
19781
  )
19845
19782
  }
19846
19783
  ) }),
19847
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Background Color" })
19784
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Background Color" })
19848
19785
  ] });
19849
19786
  };
19850
19787
 
19851
19788
  // src/core/editor/components/element-gear/column-styles.tsx
19852
- var import_jsx_runtime94 = require("react/jsx-runtime");
19789
+ var import_jsx_runtime95 = require("react/jsx-runtime");
19853
19790
  var ColumnStyles = () => {
19854
19791
  const { focusIdx, template, updateElement } = useEditorStore();
19855
19792
  const { activeView, colorTarget, setActiveView, setColorType, setColorTarget } = useSidebarContext();
@@ -19929,8 +19866,8 @@ var ColumnStyles = () => {
19929
19866
  const handlePaddingUniformChange = (0, import_react56.useCallback)((value) => {
19930
19867
  updatePadding({ top: value, right: value, bottom: value, left: value });
19931
19868
  }, [updatePadding]);
19932
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
19933
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19869
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
19870
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19934
19871
  BackgroundColorBtn,
19935
19872
  {
19936
19873
  activeView,
@@ -19939,29 +19876,29 @@ var ColumnStyles = () => {
19939
19876
  currentBgColor: currentBgColor || "transparent"
19940
19877
  }
19941
19878
  ) }),
19942
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(ToolbarSeparator, {}),
19943
- /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(ToolbarContent, { children: [
19944
- border.width > 0 && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Tooltip, { children: [
19945
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19879
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ToolbarSeparator, {}),
19880
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(ToolbarContent, { children: [
19881
+ border.width > 0 && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Tooltip, { children: [
19882
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19946
19883
  Button,
19947
19884
  {
19948
19885
  variant: "ghost",
19949
19886
  className: `shadow-none transition-none cursor-pointer rounded-[12px] ${activeView === "color" && colorTarget === "columnStrokeColor" ? "bg-muted" : ""}`,
19950
19887
  size: "icon",
19951
19888
  onClick: handleOpenStrokeColorPicker,
19952
- children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19889
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19953
19890
  "div",
19954
19891
  {
19955
19892
  className: "w-5 h-5 rounded-full border justify-center items-center flex",
19956
19893
  style: { backgroundColor: border.color },
19957
- children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "w-[50%] h-[50%] bg-secondary rounded-full" })
19894
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "w-[50%] h-[50%] bg-secondary rounded-full" })
19958
19895
  }
19959
19896
  )
19960
19897
  }
19961
19898
  ) }),
19962
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Column Stroke Color" })
19899
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Column Stroke Color" })
19963
19900
  ] }),
19964
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19901
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19965
19902
  StrokeWeight,
19966
19903
  {
19967
19904
  width: border.width,
@@ -19971,7 +19908,7 @@ var ColumnStyles = () => {
19971
19908
  tooltipText: "Column Stroke Width"
19972
19909
  }
19973
19910
  ),
19974
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
19911
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19975
19912
  BorderRadius,
19976
19913
  {
19977
19914
  value: borderRadiusValue,
@@ -19979,7 +19916,7 @@ var ColumnStyles = () => {
19979
19916
  tooltipText: "Column Border Radius"
19980
19917
  }
19981
19918
  ),
19982
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(BetterPadding, { targetIdx: columnIdx, tooltipText: "Column Padding" })
19919
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(BetterPadding, { targetIdx: columnIdx, tooltipText: "Column Padding" })
19983
19920
  ] })
19984
19921
  ] });
19985
19922
  };
@@ -19996,12 +19933,6 @@ var parseFontSize = (value) => {
19996
19933
  return isNaN(parsed) ? DEFAULT_FONT_SIZE : parsed;
19997
19934
  };
19998
19935
 
19999
- // src/core/editor/components/toolbar-ui/overflow-container.tsx
20000
- var import_jsx_runtime95 = require("react/jsx-runtime");
20001
- var ToolbarOverflowContainer = ({ children }) => {
20002
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "absolute right-0 -bottom-13 bg-white p-1 rounded-[12px] shadow-lg border ", children });
20003
- };
20004
-
20005
19936
  // src/core/editor/components/element-gear/text/toolbar.tsx
20006
19937
  var import_jsx_runtime96 = require("react/jsx-runtime");
20007
19938
  var ALIGNMENTS = ["left", "center", "right", "justify"];
@@ -20024,8 +19955,8 @@ var TextToolbar = () => {
20024
19955
  const textEditingStyles = useEditorStore((s) => s.textEditing?.styles);
20025
19956
  const template = useEditorStore((s) => s.template);
20026
19957
  const { activeView, colorTarget, setActiveView, setColorType, setColorTarget } = useSidebarContext();
20027
- const [isOverflowOpen, setIsOverflowOpen] = (0, import_react57.useState)(false);
20028
19958
  const [updateCounter, forceUpdate] = (0, import_react57.useState)(0);
19959
+ const [overflowOpen, setOverflowOpen] = (0, import_react57.useState)(false);
20029
19960
  const isInSectionColumn = (0, import_react57.useMemo)(() => {
20030
19961
  if (!focusIdx || !template) return false;
20031
19962
  const columnIdx = getParentIdx(focusIdx);
@@ -20197,204 +20128,479 @@ var TextToolbar = () => {
20197
20128
  const CurrentIcon = currentTypeConfig.Icon;
20198
20129
  return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(ToolbarContainer, { children: [
20199
20130
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(BasicOption, {}) }),
20200
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, {}),
20201
- isInSectionColumn && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
20202
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ColumnStyles, {}),
20203
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, {})
20131
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, { className: "hidden [@media(min-width:650px)]:block" }),
20132
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(ToolbarContent, { children: [
20133
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20134
+ TextTypeItem,
20135
+ {
20136
+ isResponsive: true,
20137
+ isInSectionColumn,
20138
+ tiptapEditor,
20139
+ handleSetType,
20140
+ activeType,
20141
+ CurrentIcon
20142
+ }
20143
+ ),
20144
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20145
+ FontFamilyDropdownItem,
20146
+ {
20147
+ isResponsive: true,
20148
+ isInSectionColumn,
20149
+ tiptapEditor,
20150
+ handleSetFontFamily,
20151
+ currentFontFamily
20152
+ }
20153
+ ),
20154
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20155
+ FontSizeControlItem,
20156
+ {
20157
+ isResponsive: true,
20158
+ isInSectionColumn,
20159
+ tiptapEditor,
20160
+ handleFontSizeChange,
20161
+ currentFontSize
20162
+ }
20163
+ )
20204
20164
  ] }),
20165
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, { className: "hidden [@media(min-width:880px)]:block" }),
20205
20166
  /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(ToolbarContent, { children: [
20206
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(DropdownMenu, { modal: false, children: [
20207
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20208
- Button,
20209
- {
20210
- variant: "outline",
20211
- size: "icon",
20212
- className: "shadow-none transition-none cursor-pointer rounded-[12px] gap-1",
20213
- disabled: !tiptapEditor,
20214
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(CurrentIcon, { className: "w-4 h-4" })
20215
- }
20216
- ) }),
20217
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20218
- DropdownMenuContent,
20219
- {
20220
- align: "start",
20221
- className: "z-51",
20222
- "data-editor-toolbar": "true",
20223
- children: TEXT_TYPE_OPTIONS.map(({ type, label, Icon: Icon2, disabled }) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20224
- DropdownMenuItem,
20225
- {
20226
- onClick: () => handleSetType(type),
20227
- className: "gap-2",
20228
- disabled,
20229
- children: [
20230
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Icon2, { className: "w-4 h-4" }),
20231
- label,
20232
- activeType === type && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckIcon, { className: "w-4 h-4 ml-auto" })
20233
- ]
20234
- },
20235
- type
20236
- ))
20237
- }
20238
- )
20239
- ] }),
20240
20167
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20241
- FontFamilyDropdown,
20168
+ TextColorItem,
20242
20169
  {
20243
- currentFont: currentFontFamily,
20244
- onFontChange: handleSetFontFamily,
20245
- disabled: !tiptapEditor
20170
+ isResponsive: true,
20171
+ isInSectionColumn,
20172
+ tiptapEditor,
20173
+ handleOpenTextColorPicker,
20174
+ currentTextColor,
20175
+ activeView,
20176
+ colorTarget: colorTarget || "textColor"
20246
20177
  }
20247
20178
  ),
20248
20179
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20249
- FontSizeControl,
20180
+ HighlightColorItem,
20250
20181
  {
20251
- value: currentFontSize,
20252
- onChange: handleFontSizeChange,
20253
- disabled: !tiptapEditor
20182
+ isResponsive: true,
20183
+ isInSectionColumn,
20184
+ tiptapEditor,
20185
+ handleOpenHighlightColorPicker,
20186
+ currentHighlightColor,
20187
+ activeView,
20188
+ colorTarget: colorTarget || "highlightColor"
20254
20189
  }
20255
20190
  ),
20256
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, {}),
20257
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20258
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20259
- Button,
20260
- {
20261
- variant: "ghost",
20262
- className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "textColor" ? "bg-muted" : ""}`,
20263
- size: "icon",
20264
- disabled: !tiptapEditor,
20265
- onClick: handleOpenTextColorPicker,
20266
- children: [
20267
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CaseUpperIcon, {}),
20191
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20192
+ BoldItem,
20193
+ {
20194
+ isResponsive: true,
20195
+ isInSectionColumn,
20196
+ tiptapEditor,
20197
+ handleToggleBold,
20198
+ isBoldActive
20199
+ }
20200
+ ),
20201
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20202
+ ItalicItem,
20203
+ {
20204
+ isResponsive: true,
20205
+ isInSectionColumn,
20206
+ tiptapEditor,
20207
+ handleToggleItalic,
20208
+ isItalicActive
20209
+ }
20210
+ ),
20211
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20212
+ UnderlineItem,
20213
+ {
20214
+ isResponsive: true,
20215
+ isInSectionColumn,
20216
+ tiptapEditor,
20217
+ handleToggleUnderline,
20218
+ isUnderlineActive
20219
+ }
20220
+ ),
20221
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20222
+ StrikethroughItem,
20223
+ {
20224
+ isResponsive: true,
20225
+ isInSectionColumn,
20226
+ tiptapEditor,
20227
+ handleToggleStrike,
20228
+ isStrikeActive
20229
+ }
20230
+ ),
20231
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20232
+ TextAlignmentItem,
20233
+ {
20234
+ isResponsive: true,
20235
+ isInSectionColumn,
20236
+ handleCycleAlignment,
20237
+ currentAlignment,
20238
+ tiptapEditor
20239
+ }
20240
+ ),
20241
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20242
+ ParagraphTextSettingsItem,
20243
+ {
20244
+ isResponsive: true,
20245
+ isInSectionColumn
20246
+ }
20247
+ )
20248
+ ] }),
20249
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, { className: isInSectionColumn ? "" : "[@media(min-width:1400px)]:hidden" }),
20250
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className: isInSectionColumn ? "" : "[@media(min-width:1400px)]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Popover, { open: overflowOpen, onOpenChange: (open) => {
20251
+ if (open) setOverflowOpen(true);
20252
+ }, children: [
20253
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20254
+ Button,
20255
+ {
20256
+ variant: "ghost",
20257
+ className: `shadow-none transition-none cursor-pointer ${overflowOpen ? "bg-accent" : ""}`,
20258
+ size: "icon",
20259
+ onClick: () => setOverflowOpen((prev) => !prev),
20260
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.EllipsisIcon, {})
20261
+ }
20262
+ ) }),
20263
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20264
+ PopoverContent,
20265
+ {
20266
+ align: "center",
20267
+ side: "bottom",
20268
+ className: "z-51 p-1 shadow-sm mt-1 rounded-[12px] w-auto min-w-0 flex flex-row items-center justify-center gap-1",
20269
+ "data-editor-toolbar": "true",
20270
+ onPointerDownOutside: (e) => e.preventDefault(),
20271
+ onFocusOutside: (e) => e.preventDefault(),
20272
+ onInteractOutside: (e) => e.preventDefault(),
20273
+ children: [
20274
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(ToolbarContent, { children: [
20268
20275
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20269
- "span",
20276
+ TextTypeItem,
20270
20277
  {
20271
- className: "w-[14px] h-[3px] rounded-full",
20272
- style: { backgroundColor: currentTextColor }
20278
+ isResponsive: false,
20279
+ isInSectionColumn,
20280
+ tiptapEditor,
20281
+ handleSetType,
20282
+ activeType,
20283
+ CurrentIcon
20284
+ }
20285
+ ),
20286
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20287
+ FontFamilyDropdownItem,
20288
+ {
20289
+ isResponsive: false,
20290
+ isInSectionColumn,
20291
+ tiptapEditor,
20292
+ handleSetFontFamily,
20293
+ currentFontFamily
20294
+ }
20295
+ ),
20296
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20297
+ FontSizeControlItem,
20298
+ {
20299
+ isResponsive: false,
20300
+ isInSectionColumn,
20301
+ tiptapEditor,
20302
+ handleFontSizeChange,
20303
+ currentFontSize
20273
20304
  }
20274
20305
  )
20275
- ]
20276
- }
20277
- ) }),
20278
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Text Color" })
20279
- ] }),
20280
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20281
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20282
- Button,
20283
- {
20284
- variant: "ghost",
20285
- className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "highlightColor" ? "bg-muted" : ""}`,
20286
- size: "icon",
20287
- disabled: !tiptapEditor,
20288
- onClick: handleOpenHighlightColorPicker,
20289
- children: [
20290
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.HighlighterIcon, {}),
20306
+ ] }),
20307
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, { className: " [@media(min-width:830px)]:hidden" }),
20308
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(ToolbarContent, { children: [
20309
+ isInSectionColumn && /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_jsx_runtime96.Fragment, { children: [
20310
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ColumnStyles, {}),
20311
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, { className: "[@media(min-width:1400px)]:hidden" })
20312
+ ] }),
20291
20313
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20292
- "span",
20314
+ TextColorItem,
20293
20315
  {
20294
- className: "w-[14px] h-[3px] rounded-full",
20295
- style: { backgroundColor: currentHighlightColor === "transparent" ? "#FFFFFF" : currentHighlightColor }
20316
+ isResponsive: false,
20317
+ isInSectionColumn,
20318
+ tiptapEditor,
20319
+ handleOpenTextColorPicker,
20320
+ currentTextColor,
20321
+ activeView,
20322
+ colorTarget: colorTarget || "textColor"
20323
+ }
20324
+ ),
20325
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20326
+ HighlightColorItem,
20327
+ {
20328
+ isResponsive: false,
20329
+ isInSectionColumn,
20330
+ tiptapEditor,
20331
+ handleOpenHighlightColorPicker,
20332
+ currentHighlightColor,
20333
+ activeView,
20334
+ colorTarget: colorTarget || "highlightColor"
20335
+ }
20336
+ ),
20337
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20338
+ BoldItem,
20339
+ {
20340
+ isResponsive: false,
20341
+ isInSectionColumn,
20342
+ tiptapEditor,
20343
+ handleToggleBold,
20344
+ isBoldActive
20345
+ }
20346
+ ),
20347
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20348
+ ItalicItem,
20349
+ {
20350
+ isResponsive: false,
20351
+ isInSectionColumn,
20352
+ tiptapEditor,
20353
+ handleToggleItalic,
20354
+ isItalicActive
20355
+ }
20356
+ ),
20357
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20358
+ UnderlineItem,
20359
+ {
20360
+ isResponsive: false,
20361
+ isInSectionColumn,
20362
+ tiptapEditor,
20363
+ handleToggleUnderline,
20364
+ isUnderlineActive
20365
+ }
20366
+ ),
20367
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20368
+ StrikethroughItem,
20369
+ {
20370
+ isResponsive: false,
20371
+ isInSectionColumn,
20372
+ tiptapEditor,
20373
+ handleToggleStrike,
20374
+ isStrikeActive
20375
+ }
20376
+ ),
20377
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20378
+ TextAlignmentItem,
20379
+ {
20380
+ isResponsive: false,
20381
+ isInSectionColumn,
20382
+ handleCycleAlignment,
20383
+ currentAlignment,
20384
+ tiptapEditor
20385
+ }
20386
+ ),
20387
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20388
+ ParagraphTextSettingsItem,
20389
+ {
20390
+ isResponsive: false,
20391
+ isInSectionColumn
20296
20392
  }
20297
20393
  )
20298
- ]
20299
- }
20300
- ) }),
20301
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Highlight Color" })
20302
- ] }),
20303
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20304
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20305
- Button,
20306
- {
20307
- variant: "ghost",
20308
- className: `shadow-none transition-none cursor-pointer ${isBoldActive ? "bg-accent" : ""}`,
20309
- size: "icon",
20310
- onClick: handleToggleBold,
20311
- disabled: !tiptapEditor,
20312
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.BoldIcon, {})
20313
- }
20314
- ) }),
20315
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Bold" })
20316
- ] }),
20317
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20318
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20319
- Button,
20320
- {
20321
- variant: "ghost",
20322
- className: `shadow-none transition-none cursor-pointer ${isItalicActive ? "bg-accent" : ""}`,
20323
- size: "icon",
20324
- onClick: handleToggleItalic,
20325
- disabled: !tiptapEditor,
20326
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.ItalicIcon, {})
20327
- }
20328
- ) }),
20329
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Italic" })
20330
- ] }),
20331
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20332
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20333
- Button,
20334
- {
20335
- variant: "ghost",
20336
- className: `shadow-none transition-none cursor-pointer ${isUnderlineActive ? "bg-accent" : ""}`,
20337
- size: "icon",
20338
- onClick: handleToggleUnderline,
20339
- disabled: !tiptapEditor,
20340
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Underline, {})
20341
- }
20342
- ) }),
20343
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Underline" })
20344
- ] }),
20345
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20346
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20347
- Button,
20348
- {
20349
- variant: "ghost",
20350
- className: `shadow-none transition-none cursor-pointer ${isStrikeActive ? "bg-accent" : ""}`,
20351
- size: "icon",
20352
- onClick: handleToggleStrike,
20353
- disabled: !tiptapEditor,
20354
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Strikethrough, {})
20355
- }
20356
- ) }),
20357
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Strikethrough" })
20358
- ] }),
20359
- /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20360
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20361
- Button,
20362
- {
20363
- variant: "ghost",
20364
- className: "shadow-none transition-none cursor-pointer",
20365
- size: "icon",
20366
- onClick: handleCycleAlignment,
20367
- disabled: !tiptapEditor,
20368
- children: (() => {
20369
- const AlignIcon = TEXT_ALIGNMENT_ICONS[currentAlignment];
20370
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(AlignIcon, {});
20371
- })()
20372
- }
20373
- ) }),
20374
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Alignment" })
20375
- ] }),
20376
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ParagraphTextSettings, {})
20377
- ] }),
20378
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarSeparator, {}),
20379
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20380
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20381
- Button,
20382
- {
20383
- variant: "ghost",
20384
- className: "shadow-none transition-none cursor-pointer",
20385
- size: "icon",
20386
- onClick: () => setIsOverflowOpen(!isOverflowOpen),
20387
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.EllipsisIcon, {})
20394
+ ] })
20395
+ ]
20388
20396
  }
20389
- ) }),
20390
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "See more" })
20391
- ] }) }),
20392
- isOverflowOpen && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarOverflowContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(ToolbarContent, { children: [
20393
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { variant: "ghost", size: "icon", className: "shadow-none transition-none cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.BoldIcon, {}) }),
20394
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { variant: "ghost", size: "icon", className: "shadow-none transition-none cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.BoldIcon, {}) })
20395
- ] }) })
20397
+ )
20398
+ ] }) }) })
20396
20399
  ] });
20397
20400
  };
20401
+ var ParagraphTextSettingsItem = ({ isResponsive, isInSectionColumn }) => {
20402
+ const className = isResponsive ? isInSectionColumn ? "hidden [@media(min-width:1400px)]:block" : "hidden [@media(min-width:1400px)]:block" : isInSectionColumn ? "[@media(min-width:1400px)]:hidden" : "[@media(min-width:1400px)]:hidden";
20403
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ParagraphTextSettings, {}) });
20404
+ };
20405
+ var TextAlignmentItem = ({ isResponsive, isInSectionColumn, handleCycleAlignment, currentAlignment, tiptapEditor }) => {
20406
+ const className = isResponsive ? "hidden [@media(min-width:1350px)]:block" : "[@media(min-width:1350px)]:hidden";
20407
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20408
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20409
+ Button,
20410
+ {
20411
+ variant: "ghost",
20412
+ className: "shadow-none transition-none cursor-pointer",
20413
+ size: "icon",
20414
+ onClick: handleCycleAlignment,
20415
+ disabled: !tiptapEditor,
20416
+ children: (() => {
20417
+ const AlignIcon = TEXT_ALIGNMENT_ICONS[currentAlignment];
20418
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(AlignIcon, {});
20419
+ })()
20420
+ }
20421
+ ) }),
20422
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Alignment" })
20423
+ ] }) });
20424
+ };
20425
+ var StrikethroughItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleStrike, isStrikeActive }) => {
20426
+ const className = isResponsive ? "hidden [@media(min-width:1250px)]:block" : "[@media(min-width:1250px)]:hidden";
20427
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20428
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20429
+ Button,
20430
+ {
20431
+ variant: "ghost",
20432
+ className: `shadow-none transition-none cursor-pointer ${isStrikeActive ? "bg-accent" : ""}`,
20433
+ size: "icon",
20434
+ onClick: handleToggleStrike,
20435
+ disabled: !tiptapEditor,
20436
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Strikethrough, {})
20437
+ }
20438
+ ) }),
20439
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Strikethrough" })
20440
+ ] }) });
20441
+ };
20442
+ var UnderlineItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleUnderline, isUnderlineActive }) => {
20443
+ const className = isResponsive ? "hidden [@media(min-width:1150px)]:block" : "[@media(min-width:1150px)]:hidden";
20444
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20445
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20446
+ Button,
20447
+ {
20448
+ variant: "ghost",
20449
+ className: `shadow-none transition-none cursor-pointer ${isUnderlineActive ? "bg-accent" : ""}`,
20450
+ size: "icon",
20451
+ onClick: handleToggleUnderline,
20452
+ disabled: !tiptapEditor,
20453
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.Underline, {})
20454
+ }
20455
+ ) }),
20456
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Underline" })
20457
+ ] }) });
20458
+ };
20459
+ var ItalicItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleItalic, isItalicActive }) => {
20460
+ const className = isResponsive ? "hidden [@media(min-width:1050px)]:block" : "[@media(min-width:1050px)]:hidden";
20461
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20462
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20463
+ Button,
20464
+ {
20465
+ variant: "ghost",
20466
+ className: `shadow-none transition-none cursor-pointer ${isItalicActive ? "bg-accent" : ""}`,
20467
+ size: "icon",
20468
+ onClick: handleToggleItalic,
20469
+ disabled: !tiptapEditor,
20470
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.ItalicIcon, {})
20471
+ }
20472
+ ) }),
20473
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Italic" })
20474
+ ] }) });
20475
+ };
20476
+ var BoldItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleToggleBold, isBoldActive }) => {
20477
+ const className = isResponsive ? "hidden [@media(min-width:975px)]:block" : "[@media(min-width:975px)]:hidden";
20478
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20479
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20480
+ Button,
20481
+ {
20482
+ variant: "ghost",
20483
+ className: `shadow-none transition-none cursor-pointer ${isBoldActive ? "bg-accent" : ""}`,
20484
+ size: "icon",
20485
+ onClick: handleToggleBold,
20486
+ disabled: !tiptapEditor,
20487
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.BoldIcon, {})
20488
+ }
20489
+ ) }),
20490
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Bold" })
20491
+ ] }) });
20492
+ };
20493
+ var HighlightColorItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleOpenHighlightColorPicker, currentHighlightColor, activeView, colorTarget }) => {
20494
+ const className = isResponsive ? "hidden [@media(min-width:930px)]:block" : "[@media(min-width:930px)]:hidden";
20495
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20496
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20497
+ Button,
20498
+ {
20499
+ variant: "ghost",
20500
+ className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "highlightColor" ? "bg-muted" : ""}`,
20501
+ size: "icon",
20502
+ disabled: !tiptapEditor,
20503
+ onClick: handleOpenHighlightColorPicker,
20504
+ children: [
20505
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.HighlighterIcon, {}),
20506
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20507
+ "span",
20508
+ {
20509
+ className: "w-[14px] h-[3px] rounded-full",
20510
+ style: { backgroundColor: currentHighlightColor === "transparent" ? "#FFFFFF" : currentHighlightColor }
20511
+ }
20512
+ )
20513
+ ]
20514
+ }
20515
+ ) }),
20516
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Highlight Color" })
20517
+ ] }) });
20518
+ };
20519
+ var TextColorItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleOpenTextColorPicker, currentTextColor, activeView, colorTarget }) => {
20520
+ const className = isResponsive ? "hidden [@media(min-width:880px)]:block" : "[@media(min-width:880px)]:hidden";
20521
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(Tooltip, { children: [
20522
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20523
+ Button,
20524
+ {
20525
+ variant: "ghost",
20526
+ className: `shadow-none transition-none cursor-pointer flex flex-col justify-center items-center gap-0 ${activeView === "color" && colorTarget === "textColor" ? "bg-muted" : ""}`,
20527
+ size: "icon",
20528
+ disabled: !tiptapEditor,
20529
+ onClick: handleOpenTextColorPicker,
20530
+ children: [
20531
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CaseUpperIcon, {}),
20532
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20533
+ "span",
20534
+ {
20535
+ className: "w-[14px] h-[3px] rounded-full",
20536
+ style: { backgroundColor: currentTextColor }
20537
+ }
20538
+ )
20539
+ ]
20540
+ }
20541
+ ) }),
20542
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Text Color" })
20543
+ ] }) });
20544
+ };
20545
+ var FontSizeControlItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleFontSizeChange, currentFontSize }) => {
20546
+ const className = isResponsive ? "hidden [@media(min-width:830px)]:block" : "[@media(min-width:830px)]:hidden";
20547
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20548
+ FontSizeControl,
20549
+ {
20550
+ value: currentFontSize,
20551
+ onChange: handleFontSizeChange,
20552
+ disabled: !tiptapEditor
20553
+ }
20554
+ ) });
20555
+ };
20556
+ var FontFamilyDropdownItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleSetFontFamily, currentFontFamily }) => {
20557
+ const className = isResponsive ? "hidden [@media(min-width:710px)]:block" : "[@media(min-width:710px)]:hidden";
20558
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20559
+ FontFamilyDropdown,
20560
+ {
20561
+ currentFont: currentFontFamily,
20562
+ onFontChange: handleSetFontFamily,
20563
+ disabled: !tiptapEditor
20564
+ }
20565
+ ) });
20566
+ };
20567
+ var TextTypeItem = ({ isResponsive, isInSectionColumn, tiptapEditor, handleSetType, activeType, CurrentIcon }) => {
20568
+ const className = isResponsive ? "hidden [@media(min-width:650px)]:block" : "[@media(min-width:650px)]:hidden";
20569
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ToolbarItem, { className, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(DropdownMenu, { modal: false, children: [
20570
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20571
+ Button,
20572
+ {
20573
+ variant: "outline",
20574
+ size: "icon",
20575
+ className: "shadow-none transition-none cursor-pointer rounded-[12px] gap-1",
20576
+ disabled: !tiptapEditor,
20577
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(CurrentIcon, { className: "w-4 h-4" })
20578
+ }
20579
+ ) }),
20580
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
20581
+ DropdownMenuContent,
20582
+ {
20583
+ align: "start",
20584
+ className: "z-51",
20585
+ "data-editor-toolbar": "true",
20586
+ children: TEXT_TYPE_OPTIONS.map(({ type, label, Icon: Icon2, disabled }) => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
20587
+ DropdownMenuItem,
20588
+ {
20589
+ onClick: () => handleSetType(type),
20590
+ className: "gap-2",
20591
+ disabled,
20592
+ children: [
20593
+ /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Icon2, { className: "w-4 h-4" }),
20594
+ label,
20595
+ activeType === type && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_lucide_react54.CheckIcon, { className: "w-4 h-4 ml-auto" })
20596
+ ]
20597
+ },
20598
+ type
20599
+ ))
20600
+ }
20601
+ )
20602
+ ] }) });
20603
+ };
20398
20604
 
20399
20605
  // src/core/editor/components/element-gear/button/toolbar.tsx
20400
20606
  var import_react62 = require("react");
@@ -24437,10 +24643,10 @@ init_editor();
24437
24643
  init_idx();
24438
24644
  var import_jsx_runtime118 = require("react/jsx-runtime");
24439
24645
  function Toolbar() {
24440
- const { focusIdx, template } = useEditorStore();
24441
- const selectedElement = focusIdx ? getValueByIdx(template, focusIdx) : null;
24442
- const elementType = selectedElement?.type;
24443
- if (selectedElement === null) {
24646
+ const elementType = useEditorStore(
24647
+ (s) => s.focusIdx ? getValueByIdx(s.template, s.focusIdx)?.type : null
24648
+ );
24649
+ if (!elementType) {
24444
24650
  return;
24445
24651
  }
24446
24652
  if (elementType === "text") {
@@ -24556,25 +24762,19 @@ function TemplatePage({
24556
24762
  initialTemplate,
24557
24763
  onSave,
24558
24764
  onToast,
24559
- isPaidLevel = 0
24765
+ onExit,
24766
+ data
24560
24767
  }) {
24561
- console.log("Template page rendered!");
24562
- if (isPaidLevel > MAX_PAID_LEVEL) {
24563
- console.warn("This paid level is invalid:", isPaidLevel);
24564
- } else {
24565
- console.log("This paid level is valid:", isPaidLevel);
24566
- }
24567
24768
  (0, import_react83.useState)(() => {
24568
- useEditorStore.getState().initializeWithTemplate(templateId, initialTemplate, onSave, onToast, isPaidLevel);
24769
+ useEditorStore.getState().initializeWithTemplate(templateId, initialTemplate, onSave, onToast, data, onExit);
24569
24770
  });
24570
24771
  useAutoSave();
24571
24772
  const [editorLoading, setEditorLoading] = (0, import_react83.useState)(false);
24572
24773
  const [isPageHovered, setIsPageHovered] = (0, import_react83.useState)(false);
24573
- const template = useEditorStore((state) => state.template);
24574
24774
  const previewMode = useEditorStore((state) => state.previewMode);
24575
24775
  const focusIdx = useEditorStore((state) => state.focusIdx);
24576
24776
  const setFocusIdx = useEditorStore((state) => state.setFocusIdx);
24577
- const canvasBackgroundColor = template?.content?.[0]?.attributes?.["background-color"] || "#ffffff";
24777
+ const canvasBackgroundColor = useEditorStore((s) => s.template?.content?.[0]?.attributes?.["background-color"]) || "#ffffff";
24578
24778
  const handlePageClick = (e) => {
24579
24779
  if (!previewMode && e.target === e.currentTarget) {
24580
24780
  setFocusIdx("content");
@@ -24595,7 +24795,7 @@ function TemplatePage({
24595
24795
  {
24596
24796
  className: "flex flex-col bg-background overflow-hidden",
24597
24797
  children: [
24598
- /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(TemplateHeader, { template }),
24798
+ /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(TemplateHeader, {}),
24599
24799
  /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-row h-full bg-background", children: [
24600
24800
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(TemplateSidebar, { editorLoading }),
24601
24801
  /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "flex flex-col w-full overflow-hidden h-[calc(100vh-60px)] bg-background relative", children: [
@@ -24606,7 +24806,7 @@ function TemplatePage({
24606
24806
  "div",
24607
24807
  {
24608
24808
  className: cn(
24609
- "min-h-[calc(70vh)] h-fit rounded-[12px] max-w-[626px] w-[626px] pb-0 pt-5 mt-24 mb-4 email-page-preview cursor-pointer",
24809
+ "min-h-[calc(70vh)] h-fit rounded-[12px] max-w-[626px] w-[626px] pb-0 pt-5 mt-24 mb-4 email-page-preview cursor-pointer [@media(max-width:950px)]:w-full [@media(max-width:950px)]:max-w-full [@media(max-width:950px)]:min-h-screen [@media(max-width:950px)]:rounded-none [@media(max-width:950px)]:mt-0 [@media(max-width:950px)]:mb-0",
24610
24810
  focusIdx === "content" && "outline outline-2 outline-blue-500",
24611
24811
  isPageHovered && focusIdx !== "content" && "outline outline-2 outline-blue-300"
24612
24812
  ),