@lukso/web-components 1.161.1 → 1.161.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/components/index.cjs +7 -5
  2. package/dist/components/index.js +5 -5
  3. package/dist/components/lukso-button/index.cjs +3 -3
  4. package/dist/components/lukso-button/index.js +3 -3
  5. package/dist/components/lukso-card/index.cjs +6 -6
  6. package/dist/components/lukso-card/index.js +6 -6
  7. package/dist/components/lukso-checkbox/index.cjs +3 -3
  8. package/dist/components/lukso-checkbox/index.js +3 -3
  9. package/dist/components/lukso-collapse/index.cjs +3 -3
  10. package/dist/components/lukso-collapse/index.js +3 -3
  11. package/dist/components/lukso-color-picker/index.cjs +5 -5
  12. package/dist/components/lukso-color-picker/index.js +5 -5
  13. package/dist/components/lukso-dropdown/index.cjs +4 -4
  14. package/dist/components/lukso-dropdown/index.js +4 -4
  15. package/dist/components/lukso-dropdown-option/index.cjs +2 -2
  16. package/dist/components/lukso-dropdown-option/index.js +2 -2
  17. package/dist/components/lukso-footer/index.cjs +3 -2
  18. package/dist/components/lukso-footer/index.d.ts.map +1 -1
  19. package/dist/components/lukso-footer/index.js +3 -2
  20. package/dist/components/lukso-icon/index.cjs +4 -4
  21. package/dist/components/lukso-icon/index.js +4 -4
  22. package/dist/components/lukso-image/index.cjs +4 -4
  23. package/dist/components/lukso-image/index.js +4 -4
  24. package/dist/components/lukso-input/index.cjs +4 -4
  25. package/dist/components/lukso-input/index.js +4 -4
  26. package/dist/components/lukso-markdown/index.cjs +13 -5
  27. package/dist/components/lukso-markdown/index.d.ts +1 -0
  28. package/dist/components/lukso-markdown/index.d.ts.map +1 -1
  29. package/dist/components/lukso-markdown/index.js +13 -5
  30. package/dist/components/lukso-markdown/lukso-markdown.stories.d.ts +2 -0
  31. package/dist/components/lukso-markdown/lukso-markdown.stories.d.ts.map +1 -1
  32. package/dist/components/lukso-markdown-editor/index.cjs +294 -252
  33. package/dist/components/lukso-markdown-editor/index.d.ts +4 -1
  34. package/dist/components/lukso-markdown-editor/index.d.ts.map +1 -1
  35. package/dist/components/lukso-markdown-editor/index.js +294 -252
  36. package/dist/components/lukso-markdown-editor/lukso-markdown-editor.stories.d.ts +6 -0
  37. package/dist/components/lukso-markdown-editor/lukso-markdown-editor.stories.d.ts.map +1 -1
  38. package/dist/components/lukso-modal/index.cjs +2 -2
  39. package/dist/components/lukso-modal/index.js +2 -2
  40. package/dist/components/lukso-navbar/index.cjs +3 -3
  41. package/dist/components/lukso-navbar/index.js +3 -3
  42. package/dist/components/lukso-pagination/index.cjs +3 -3
  43. package/dist/components/lukso-pagination/index.js +3 -3
  44. package/dist/components/lukso-profile/index.cjs +3 -3
  45. package/dist/components/lukso-profile/index.js +3 -3
  46. package/dist/components/lukso-progress/index.cjs +3 -3
  47. package/dist/components/lukso-progress/index.js +3 -3
  48. package/dist/components/lukso-radio/index.cjs +3 -3
  49. package/dist/components/lukso-radio/index.js +3 -3
  50. package/dist/components/lukso-radio-group/index.cjs +3 -3
  51. package/dist/components/lukso-radio-group/index.js +3 -3
  52. package/dist/components/lukso-sanitize/index.cjs +9 -1390
  53. package/dist/components/lukso-sanitize/index.d.ts +17 -1
  54. package/dist/components/lukso-sanitize/index.d.ts.map +1 -1
  55. package/dist/components/lukso-sanitize/index.js +4 -1396
  56. package/dist/components/lukso-sanitize/lukso-sanitize.stories.d.ts +17 -1
  57. package/dist/components/lukso-sanitize/lukso-sanitize.stories.d.ts.map +1 -1
  58. package/dist/components/lukso-search/index.cjs +6 -6
  59. package/dist/components/lukso-search/index.js +6 -6
  60. package/dist/components/lukso-select/index.cjs +6 -6
  61. package/dist/components/lukso-select/index.js +6 -6
  62. package/dist/components/lukso-share/index.cjs +2 -2
  63. package/dist/components/lukso-share/index.js +2 -2
  64. package/dist/components/lukso-switch/index.cjs +4 -4
  65. package/dist/components/lukso-switch/index.js +4 -4
  66. package/dist/components/lukso-tag/index.cjs +3 -3
  67. package/dist/components/lukso-tag/index.js +3 -3
  68. package/dist/components/lukso-terms/index.cjs +4 -4
  69. package/dist/components/lukso-terms/index.js +4 -4
  70. package/dist/components/lukso-textarea/index.cjs +4 -4
  71. package/dist/components/lukso-textarea/index.js +4 -4
  72. package/dist/components/lukso-tooltip/index.cjs +4 -4
  73. package/dist/components/lukso-tooltip/index.js +4 -4
  74. package/dist/components/lukso-username/index.cjs +4 -4
  75. package/dist/components/lukso-username/index.js +4 -4
  76. package/dist/components/lukso-wizard/index.cjs +2 -2
  77. package/dist/components/lukso-wizard/index.js +2 -2
  78. package/dist/{index-DNhzT2hA.cjs → index-BDC9pVk6.cjs} +2 -2
  79. package/dist/index-BFqOU6o6.cjs +50 -0
  80. package/dist/{index-NKnet_Ow.js → index-BJwLob67.js} +2 -2
  81. package/dist/{index-CKlH1beR.js → index-BOWftFAY.js} +1 -1
  82. package/dist/{index-CKjNXRek.cjs → index-C2uvRzO4.cjs} +3 -3
  83. package/dist/{index-C1JF-hTl.cjs → index-CEnG_x_7.cjs} +5 -5
  84. package/dist/index-CQq_Eyeu.js +41 -0
  85. package/dist/index-Chl2HHJ6.cjs +1408 -0
  86. package/dist/index-JvkSiEeQ.js +1404 -0
  87. package/dist/{index-C9Ins46B.cjs → index-Zriuvita.cjs} +1 -1
  88. package/dist/{index-BSwFyDEC.js → index-f-xajtU2.js} +3 -3
  89. package/dist/{index-CDUQ0-Uh.js → index-oQecUOlb.js} +5 -5
  90. package/dist/index.cjs +7 -5
  91. package/dist/index.js +5 -5
  92. package/dist/{property-Da9lvmME.js → property-CPkYmAYi.js} +1 -1
  93. package/dist/{property-dUn0JQiG.cjs → property-Cs8qVdri.cjs} +1 -1
  94. package/dist/shared/tailwind-element/index.cjs +1 -1
  95. package/dist/shared/tailwind-element/index.js +1 -1
  96. package/dist/{state-CD8hXUlY.cjs → state-Bh6EXopE.cjs} +1 -1
  97. package/dist/{state-CtpsBPdH.js → state-CtrTo6cC.js} +1 -1
  98. package/dist/{style-map-CDCcO0mt.js → style-map-BBz25umN.js} +1 -1
  99. package/dist/{style-map-nBexjTCa.cjs → style-map-DhbNG03r.cjs} +1 -1
  100. package/dist/tailwind-config.cjs +65 -0
  101. package/dist/tailwind-config.d.ts +85 -0
  102. package/dist/tailwind-config.d.ts.map +1 -1
  103. package/dist/tailwind-config.js +64 -1
  104. package/dist/{unsafe-html-DHNeIs-4.cjs → unsafe-html-Cb1yjpJn.cjs} +1 -1
  105. package/dist/{unsafe-html-Ci4jmi7b.js → unsafe-html-DTE5r2A7.js} +1 -1
  106. package/package.json +1 -1
  107. package/tailwind.config.cjs +208 -178
  108. package/tools/cn.cjs +1 -1
  109. package/tools/cn.js +1 -1
  110. package/tools/copy-assets.cjs +16 -16
  111. package/tools/copy-assets.js +2 -2
  112. package/tools/index.cjs +1 -1
  113. package/tools/index.js +1 -1
  114. package/tools/{tailwind-config-Ch2-b3Be.js → tailwind-config-DVTyRd7x.js} +64 -1
  115. package/tools/{tailwind-config-BIErjaAT.cjs → tailwind-config-DoMZEvsr.cjs} +65 -0
  116. package/tools/tailwind-config.cjs +3 -1
  117. package/tools/tailwind-config.d.ts +85 -0
  118. package/tools/tailwind-config.d.ts.map +1 -1
  119. package/tools/tailwind-config.js +1 -1
  120. package/dist/index-B5CXCi6j.js +0 -41
  121. package/dist/index-D4DEFira.cjs +0 -50
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-D4DEFira.cjs');
6
- const property = require('../../property-dUn0JQiG.cjs');
7
- const state = require('../../state-CD8hXUlY.cjs');
5
+ const shared_tailwindElement_index = require('../../index-BFqOU6o6.cjs');
6
+ const property = require('../../property-Cs8qVdri.cjs');
7
+ const state = require('../../state-Bh6EXopE.cjs');
8
8
  const query = require('../../query-EFiHeHdi.cjs');
9
9
  const index = require('../../index-CaJky2qL.cjs');
10
10
  require('../../tailwind-config.cjs');
@@ -14,7 +14,7 @@ require('../lukso-markdown/index.cjs');
14
14
  require('../lukso-switch/index.cjs');
15
15
  require('../lukso-button/index.cjs');
16
16
  require('../lukso-icon/index.cjs');
17
- require('../lukso-sanitize/index.cjs');
17
+ require('../../index-Chl2HHJ6.cjs');
18
18
  require('../lukso-dropdown/index.cjs');
19
19
  require('../lukso-dropdown-option/index.cjs');
20
20
  require('../lukso-tooltip/index.cjs');
@@ -205,6 +205,7 @@ var __decorateClass = (decorators, target, key, kind) => {
205
205
  };
206
206
  const DEFAULT_PREVIEW_BACKGROUND_COLOR = "#f9f9f9";
207
207
  const DEFAULT_PREVIEW_TEXT_COLOR = "#374151";
208
+ const ACCESSIBILITY_CHECK_DELAY = 1e3;
208
209
  exports.LuksoMarkdownEditor = class LuksoMarkdownEditor extends shared_tailwindElement_index.TailwindStyledElement(style) {
209
210
  constructor() {
210
211
  super(...arguments);
@@ -224,6 +225,18 @@ exports.LuksoMarkdownEditor = class LuksoMarkdownEditor extends shared_tailwindE
224
225
  this.placeholder = "";
225
226
  this.previewBackgroundColor = DEFAULT_PREVIEW_BACKGROUND_COLOR;
226
227
  this.previewTextColor = DEFAULT_PREVIEW_TEXT_COLOR;
228
+ this.stripHtmlTags = false;
229
+ this.tools = void 0;
230
+ this.toolsState = [];
231
+ this.defaultTools = [
232
+ "heading",
233
+ "bold",
234
+ "italic",
235
+ "list",
236
+ "link",
237
+ "alignment",
238
+ "color"
239
+ ];
227
240
  this.savedSelectionForPreview = null;
228
241
  this.isHeadingDropdownOpen = false;
229
242
  this.isColorDropdownOpen = false;
@@ -260,7 +273,6 @@ exports.LuksoMarkdownEditor = class LuksoMarkdownEditor extends shared_tailwindE
260
273
  this.accessibilityViolations = [];
261
274
  this.hasAccessibilityViolations = false;
262
275
  this.accessibilityCheckTimeout = null;
263
- this.ACCESSIBILITY_CHECK_DELAY = 1e3;
264
276
  this.handleOutsideClick = (event) => {
265
277
  const target = event.target;
266
278
  const isInsideThisComponent = this.contains(target) || this.shadowRoot?.contains(target);
@@ -532,7 +544,7 @@ exports.LuksoMarkdownEditor = class LuksoMarkdownEditor extends shared_tailwindE
532
544
  this.accessibilityCheckTimeout = window.setTimeout(() => {
533
545
  this.performAccessibilityCheck();
534
546
  this.accessibilityCheckTimeout = null;
535
- }, this.ACCESSIBILITY_CHECK_DELAY);
547
+ }, ACCESSIBILITY_CHECK_DELAY);
536
548
  }
537
549
  /**
538
550
  * Clean up empty color spans from the value.
@@ -2173,126 +2185,127 @@ ${indent}${nextNumber}. `;
2173
2185
  toolbarTemplate() {
2174
2186
  return shared_tailwindElement_index.x`
2175
2187
  <div class="flex items-center gap-1">
2176
- <div class=${axe.cn(this.styles().headingMenu())}>
2177
- <!-- Heading -->
2178
- <lukso-tooltip text="Heading options" placement="top">
2179
- <lukso-button
2180
- id=${this.headingTriggerId}
2181
- @click=${(e) => {
2188
+ <!-- Heading -->
2189
+ ${this.toolsState.includes("heading") ? shared_tailwindElement_index.x`<div class=${axe.cn(this.styles().headingMenu())}>
2190
+ <lukso-tooltip text="Heading options" placement="top">
2191
+ <lukso-button
2192
+ id=${this.headingTriggerId}
2193
+ @click=${(e) => {
2182
2194
  e.stopPropagation();
2183
2195
  this.isColorDropdownOpen = false;
2184
2196
  this.isListDropdownOpen = false;
2185
2197
  this.isAlignmentDropdownOpen = false;
2186
2198
  this.isHeadingDropdownOpen = !this.isHeadingDropdownOpen;
2187
2199
  }}
2188
- aria-expanded=${this.isHeadingDropdownOpen ? "true" : "false"}
2189
- aria-label="Heading options"
2190
- variant="secondary"
2191
- size="small"
2192
- custom-class=${this.toolbarButton({
2200
+ aria-expanded=${this.isHeadingDropdownOpen ? "true" : "false"}
2201
+ aria-label="Heading options"
2202
+ variant="secondary"
2203
+ size="small"
2204
+ custom-class=${this.toolbarButton({
2193
2205
  active: this.getActiveHeadingLevel() > 0
2194
2206
  })}
2195
- is-icon
2196
- >
2197
- <lukso-icon
2198
- name="smallcaps"
2199
- size="small"
2200
- pack="vuesax"
2201
- variant="linear"
2202
- ></lukso-icon>
2203
- </lukso-button>
2204
- </lukso-tooltip>
2205
- <lukso-dropdown
2206
- id="headingDropdown"
2207
- trigger-id=""
2208
- size="medium"
2209
- ?is-open=${this.isHeadingDropdownOpen}
2210
- >
2211
- <lukso-dropdown-option
2212
- ?is-selected=${this.getActiveHeadingLevel() === 0}
2213
- @click=${(e) => {
2207
+ is-icon
2208
+ >
2209
+ <lukso-icon
2210
+ name="smallcaps"
2211
+ size="small"
2212
+ pack="vuesax"
2213
+ variant="linear"
2214
+ ></lukso-icon>
2215
+ </lukso-button>
2216
+ </lukso-tooltip>
2217
+ <lukso-dropdown
2218
+ id="headingDropdown"
2219
+ trigger-id=""
2220
+ size="medium"
2221
+ ?is-open=${this.isHeadingDropdownOpen}
2222
+ >
2223
+ <lukso-dropdown-option
2224
+ ?is-selected=${this.getActiveHeadingLevel() === 0}
2225
+ @click=${(e) => {
2214
2226
  e.stopPropagation();
2215
2227
  this.restoreFocusAndSelection();
2216
2228
  this.applyHeading(0);
2217
2229
  this.isHeadingDropdownOpen = false;
2218
2230
  }}
2219
- size="medium"
2220
- >
2221
- Normal text
2222
- </lukso-dropdown-option>
2223
- <lukso-dropdown-option
2224
- ?is-selected=${this.getActiveHeadingLevel() === 1}
2225
- @click=${(e) => {
2231
+ size="medium"
2232
+ >
2233
+ Normal text
2234
+ </lukso-dropdown-option>
2235
+ <lukso-dropdown-option
2236
+ ?is-selected=${this.getActiveHeadingLevel() === 1}
2237
+ @click=${(e) => {
2226
2238
  e.stopPropagation();
2227
2239
  this.restoreFocusAndSelection();
2228
2240
  this.applyHeading(1);
2229
2241
  this.isHeadingDropdownOpen = false;
2230
2242
  }}
2231
- size="medium"
2232
- >
2233
- Heading 1
2234
- </lukso-dropdown-option>
2235
- <lukso-dropdown-option
2236
- ?is-selected=${this.getActiveHeadingLevel() === 2}
2237
- @click=${(e) => {
2243
+ size="medium"
2244
+ >
2245
+ Heading 1
2246
+ </lukso-dropdown-option>
2247
+ <lukso-dropdown-option
2248
+ ?is-selected=${this.getActiveHeadingLevel() === 2}
2249
+ @click=${(e) => {
2238
2250
  e.stopPropagation();
2239
2251
  this.restoreFocusAndSelection();
2240
2252
  this.applyHeading(2);
2241
2253
  this.isHeadingDropdownOpen = false;
2242
2254
  }}
2243
- size="medium"
2244
- >
2245
- Heading 2
2246
- </lukso-dropdown-option>
2247
- <lukso-dropdown-option
2248
- ?is-selected=${this.getActiveHeadingLevel() === 3}
2249
- @click=${(e) => {
2255
+ size="medium"
2256
+ >
2257
+ Heading 2
2258
+ </lukso-dropdown-option>
2259
+ <lukso-dropdown-option
2260
+ ?is-selected=${this.getActiveHeadingLevel() === 3}
2261
+ @click=${(e) => {
2250
2262
  e.stopPropagation();
2251
2263
  this.restoreFocusAndSelection();
2252
2264
  this.applyHeading(3);
2253
2265
  this.isHeadingDropdownOpen = false;
2254
2266
  }}
2255
- size="medium"
2256
- >
2257
- Heading 3
2258
- </lukso-dropdown-option>
2259
- <lukso-dropdown-option
2260
- ?is-selected=${this.getActiveHeadingLevel() === 4}
2261
- @click=${(e) => {
2267
+ size="medium"
2268
+ >
2269
+ Heading 3
2270
+ </lukso-dropdown-option>
2271
+ <lukso-dropdown-option
2272
+ ?is-selected=${this.getActiveHeadingLevel() === 4}
2273
+ @click=${(e) => {
2262
2274
  e.stopPropagation();
2263
2275
  this.restoreFocusAndSelection();
2264
2276
  this.applyHeading(4);
2265
2277
  this.isHeadingDropdownOpen = false;
2266
2278
  }}
2267
- size="medium"
2268
- >
2269
- Heading 4
2270
- </lukso-dropdown-option>
2271
- </lukso-dropdown>
2272
- </div>
2279
+ size="medium"
2280
+ >
2281
+ Heading 4
2282
+ </lukso-dropdown-option>
2283
+ </lukso-dropdown>
2284
+ </div>` : shared_tailwindElement_index.E}
2273
2285
 
2274
2286
  <!-- Bold -->
2275
- ${this.buttonTemplate(
2287
+ ${this.toolsState.includes("bold") ? this.buttonTemplate(
2276
2288
  "text-bold",
2277
2289
  () => this.toggleWrap("**"),
2278
2290
  "Bold",
2279
2291
  this.activeFormats.bold
2280
- )}
2292
+ ) : shared_tailwindElement_index.E}
2281
2293
 
2282
2294
  <!-- Italic -->
2283
- ${this.buttonTemplate(
2295
+ ${this.toolsState.includes("italic") ? this.buttonTemplate(
2284
2296
  "text-italic",
2285
2297
  () => this.toggleWrap("*"),
2286
2298
  "Italic",
2287
2299
  this.activeFormats.italic
2288
- )}
2300
+ ) : shared_tailwindElement_index.E}
2289
2301
 
2290
2302
  <!-- List -->
2291
- <div class=${this.styles().listMenu()}>
2292
- <lukso-tooltip text="List options" placement="top">
2293
- <lukso-button
2294
- id=${this.listTriggerId}
2295
- @click=${(e) => {
2303
+ ${this.toolsState.includes("list") ? shared_tailwindElement_index.x`
2304
+ <div class=${this.styles().listMenu()}>
2305
+ <lukso-tooltip text="List options" placement="top">
2306
+ <lukso-button
2307
+ id=${this.listTriggerId}
2308
+ @click=${(e) => {
2296
2309
  e.stopPropagation();
2297
2310
  this.restoreFocusAndSelection();
2298
2311
  this.isHeadingDropdownOpen = false;
@@ -2300,82 +2313,84 @@ ${indent}${nextNumber}. `;
2300
2313
  this.isAlignmentDropdownOpen = false;
2301
2314
  this.isListDropdownOpen = !this.isListDropdownOpen;
2302
2315
  }}
2303
- aria-expanded=${this.isListDropdownOpen ? "true" : "false"}
2304
- aria-label="List options"
2305
- variant="secondary"
2306
- size="small"
2307
- custom-class=${this.toolbarButton({
2316
+ aria-expanded=${this.isListDropdownOpen ? "true" : "false"}
2317
+ aria-label="List options"
2318
+ variant="secondary"
2319
+ size="small"
2320
+ custom-class=${this.toolbarButton({
2308
2321
  active: this.activeFormats.unorderedList || this.activeFormats.orderedList
2309
2322
  })}
2310
- is-icon
2311
- >
2312
- <lukso-icon
2313
- name="task"
2314
- size="small"
2315
- pack="vuesax"
2316
- variant="linear"
2317
- ></lukso-icon>
2318
- </lukso-button>
2319
- </lukso-tooltip>
2320
- <lukso-dropdown
2321
- id="listDropdown"
2322
- trigger-id=""
2323
- size="medium"
2324
- ?is-open=${this.isListDropdownOpen}
2325
- >
2326
- <lukso-dropdown-option
2327
- ?is-selected=${this.getActiveListType() === "none"}
2328
- @click=${(e) => {
2323
+ is-icon
2324
+ >
2325
+ <lukso-icon
2326
+ name="task"
2327
+ size="small"
2328
+ pack="vuesax"
2329
+ variant="linear"
2330
+ ></lukso-icon>
2331
+ </lukso-button>
2332
+ </lukso-tooltip>
2333
+ <lukso-dropdown
2334
+ id="listDropdown"
2335
+ trigger-id=""
2336
+ size="medium"
2337
+ ?is-open=${this.isListDropdownOpen}
2338
+ >
2339
+ <lukso-dropdown-option
2340
+ ?is-selected=${this.getActiveListType() === "none"}
2341
+ @click=${(e) => {
2329
2342
  e.stopPropagation();
2330
2343
  this.restoreFocusAndSelection();
2331
2344
  this.applyList("none");
2332
2345
  this.isListDropdownOpen = false;
2333
2346
  }}
2334
- size="medium"
2335
- >
2336
- No list
2337
- </lukso-dropdown-option>
2338
- <lukso-dropdown-option
2339
- ?is-selected=${this.getActiveListType() === "unordered"}
2340
- @click=${(e) => {
2347
+ size="medium"
2348
+ >
2349
+ No list
2350
+ </lukso-dropdown-option>
2351
+ <lukso-dropdown-option
2352
+ ?is-selected=${this.getActiveListType() === "unordered"}
2353
+ @click=${(e) => {
2341
2354
  e.stopPropagation();
2342
2355
  this.restoreFocusAndSelection();
2343
2356
  this.applyList("unordered");
2344
2357
  this.isListDropdownOpen = false;
2345
2358
  }}
2346
- size="medium"
2347
- >
2348
- Unordered
2349
- </lukso-dropdown-option>
2350
- <lukso-dropdown-option
2351
- ?is-selected=${this.getActiveListType() === "ordered"}
2352
- @click=${(e) => {
2359
+ size="medium"
2360
+ >
2361
+ Unordered
2362
+ </lukso-dropdown-option>
2363
+ <lukso-dropdown-option
2364
+ ?is-selected=${this.getActiveListType() === "ordered"}
2365
+ @click=${(e) => {
2353
2366
  e.stopPropagation();
2354
2367
  this.restoreFocusAndSelection();
2355
2368
  this.applyList("ordered");
2356
2369
  this.isListDropdownOpen = false;
2357
2370
  }}
2358
- size="medium"
2359
- >
2360
- Ordered
2361
- </lukso-dropdown-option>
2362
- </lukso-dropdown>
2363
- </div>
2371
+ size="medium"
2372
+ >
2373
+ Ordered
2374
+ </lukso-dropdown-option>
2375
+ </lukso-dropdown>
2376
+ </div>
2377
+ ` : shared_tailwindElement_index.E}
2364
2378
 
2365
2379
  <!-- Link -->
2366
- ${this.buttonTemplate(
2380
+ ${this.toolsState.includes("link") ? this.buttonTemplate(
2367
2381
  "link",
2368
2382
  () => this.insertLink(),
2369
2383
  "Link",
2370
2384
  this.activeFormats.link
2371
- )}
2385
+ ) : shared_tailwindElement_index.E}
2372
2386
 
2373
2387
  <!-- Text Alignment -->
2374
- <div class=${this.styles().alignmentMenu()}>
2375
- <lukso-tooltip text="Text alignment" placement="top">
2376
- <lukso-button
2377
- id=${this.alignmentTriggerId}
2378
- @click=${(e) => {
2388
+ ${this.toolsState.includes("alignment") ? shared_tailwindElement_index.x`
2389
+ <div class=${this.styles().alignmentMenu()}>
2390
+ <lukso-tooltip text="Text alignment" placement="top">
2391
+ <lukso-button
2392
+ id=${this.alignmentTriggerId}
2393
+ @click=${(e) => {
2379
2394
  e.stopPropagation();
2380
2395
  this.restoreFocusAndSelection();
2381
2396
  this.isHeadingDropdownOpen = false;
@@ -2383,101 +2398,103 @@ ${indent}${nextNumber}. `;
2383
2398
  this.isListDropdownOpen = false;
2384
2399
  this.isAlignmentDropdownOpen = !this.isAlignmentDropdownOpen;
2385
2400
  }}
2386
- aria-expanded=${this.isAlignmentDropdownOpen ? "true" : "false"}
2387
- aria-label="Text alignment"
2388
- variant="secondary"
2389
- size="small"
2390
- custom-class=${this.toolbarButton({
2401
+ aria-expanded=${this.isAlignmentDropdownOpen ? "true" : "false"}
2402
+ aria-label="Text alignment"
2403
+ variant="secondary"
2404
+ size="small"
2405
+ custom-class=${this.toolbarButton({
2391
2406
  active: this.activeFormats.alignment !== "left"
2392
2407
  })}
2393
- is-icon
2394
- >
2395
- <lukso-icon
2396
- name=${this.getAlignmentIcon()}
2397
- size="small"
2398
- pack="vuesax"
2399
- variant="linear"
2400
- ></lukso-icon>
2401
- </lukso-button>
2402
- </lukso-tooltip>
2403
- <lukso-dropdown
2404
- id="alignmentDropdown"
2405
- trigger-id=""
2406
- size="medium"
2407
- ?is-open=${this.isAlignmentDropdownOpen}
2408
- >
2409
- <lukso-dropdown-option
2410
- ?is-selected=${this.activeFormats.alignment === "left"}
2411
- @click=${(e) => {
2408
+ is-icon
2409
+ >
2410
+ <lukso-icon
2411
+ name=${this.getAlignmentIcon()}
2412
+ size="small"
2413
+ pack="vuesax"
2414
+ variant="linear"
2415
+ ></lukso-icon>
2416
+ </lukso-button>
2417
+ </lukso-tooltip>
2418
+ <lukso-dropdown
2419
+ id="alignmentDropdown"
2420
+ trigger-id=""
2421
+ size="medium"
2422
+ ?is-open=${this.isAlignmentDropdownOpen}
2423
+ >
2424
+ <lukso-dropdown-option
2425
+ ?is-selected=${this.activeFormats.alignment === "left"}
2426
+ @click=${(e) => {
2412
2427
  e.stopPropagation();
2413
2428
  this.restoreFocusAndSelection();
2414
2429
  this.applyAlignment("left");
2415
2430
  this.isAlignmentDropdownOpen = false;
2416
2431
  }}
2417
- size="medium"
2418
- aria-label="Align left"
2419
- >
2420
- <div style="display: flex; align-items: center; gap: 8px;">
2421
- <lukso-icon
2422
- name="textalign-left"
2423
- size="small"
2424
- pack="vuesax"
2425
- variant="linear"
2426
- ></lukso-icon>
2427
- Left
2428
- </div>
2429
- </lukso-dropdown-option>
2430
- <lukso-dropdown-option
2431
- ?is-selected=${this.activeFormats.alignment === "center"}
2432
- @click=${(e) => {
2432
+ size="medium"
2433
+ aria-label="Align left"
2434
+ >
2435
+ <div style="display: flex; align-items: center; gap: 8px;">
2436
+ <lukso-icon
2437
+ name="textalign-left"
2438
+ size="small"
2439
+ pack="vuesax"
2440
+ variant="linear"
2441
+ ></lukso-icon>
2442
+ Left
2443
+ </div>
2444
+ </lukso-dropdown-option>
2445
+ <lukso-dropdown-option
2446
+ ?is-selected=${this.activeFormats.alignment === "center"}
2447
+ @click=${(e) => {
2433
2448
  e.stopPropagation();
2434
2449
  this.restoreFocusAndSelection();
2435
2450
  this.applyAlignment("center");
2436
2451
  this.isAlignmentDropdownOpen = false;
2437
2452
  }}
2438
- size="medium"
2439
- aria-label="Align center"
2440
- >
2441
- <div style="display: flex; align-items: center; gap: 8px;">
2442
- <lukso-icon
2443
- name="textalign-center"
2444
- size="small"
2445
- pack="vuesax"
2446
- variant="linear"
2447
- ></lukso-icon>
2448
- Center
2449
- </div>
2450
- </lukso-dropdown-option>
2451
- <lukso-dropdown-option
2452
- ?is-selected=${this.activeFormats.alignment === "right"}
2453
- @click=${(e) => {
2453
+ size="medium"
2454
+ aria-label="Align center"
2455
+ >
2456
+ <div style="display: flex; align-items: center; gap: 8px;">
2457
+ <lukso-icon
2458
+ name="textalign-center"
2459
+ size="small"
2460
+ pack="vuesax"
2461
+ variant="linear"
2462
+ ></lukso-icon>
2463
+ Center
2464
+ </div>
2465
+ </lukso-dropdown-option>
2466
+ <lukso-dropdown-option
2467
+ ?is-selected=${this.activeFormats.alignment === "right"}
2468
+ @click=${(e) => {
2454
2469
  e.stopPropagation();
2455
2470
  this.restoreFocusAndSelection();
2456
2471
  this.applyAlignment("right");
2457
2472
  this.isAlignmentDropdownOpen = false;
2458
2473
  }}
2459
- size="medium"
2460
- aria-label="Align right"
2461
- >
2462
- <div style="display: flex; align-items: center; gap: 8px;">
2463
- <lukso-icon
2464
- name="textalign-right"
2465
- size="small"
2466
- pack="vuesax"
2467
- variant="linear"
2468
- ></lukso-icon>
2469
- Right
2474
+ size="medium"
2475
+ aria-label="Align right"
2476
+ >
2477
+ <div style="display: flex; align-items: center; gap: 8px;">
2478
+ <lukso-icon
2479
+ name="textalign-right"
2480
+ size="small"
2481
+ pack="vuesax"
2482
+ variant="linear"
2483
+ ></lukso-icon>
2484
+ Right
2485
+ </div>
2486
+ </lukso-dropdown-option>
2487
+ </lukso-dropdown>
2470
2488
  </div>
2471
- </lukso-dropdown-option>
2472
- </lukso-dropdown>
2473
- </div>
2489
+ ` : shared_tailwindElement_index.E}
2474
2490
 
2475
2491
  <!-- Color -->
2476
- <div class=${this.styles().colorMenu()}>
2477
- <lukso-tooltip text="Text color" placement="top">
2478
- <lukso-button
2479
- id=${this.colorTriggerId}
2480
- @click=${(e) => {
2492
+ ${this.toolsState.includes("color") ? shared_tailwindElement_index.x`
2493
+ <div class=${this.styles().colorMenu()}>
2494
+ <lukso-tooltip text="Text color" placement="top">
2495
+ <lukso-button
2496
+ id=${this.colorTriggerId}
2497
+ @click=${(e) => {
2481
2498
  e.stopPropagation();
2482
2499
  this.restoreFocusAndSelection();
2483
2500
  this.isHeadingDropdownOpen = false;
@@ -2494,66 +2511,70 @@ ${indent}${nextNumber}. `;
2494
2511
  }
2495
2512
  this.isColorDropdownOpen = !this.isColorDropdownOpen;
2496
2513
  }}
2497
- aria-expanded=${this.isColorDropdownOpen ? "true" : "false"}
2498
- aria-pressed=${this.activeFormats.color ? "true" : "false"}
2499
- aria-label="Text color"
2500
- variant="secondary"
2501
- size="small"
2502
- custom-class=${this.toolbarButton({
2514
+ aria-expanded=${this.isColorDropdownOpen ? "true" : "false"}
2515
+ aria-pressed=${this.activeFormats.color ? "true" : "false"}
2516
+ aria-label="Text color"
2517
+ variant="secondary"
2518
+ size="small"
2519
+ custom-class=${this.toolbarButton({
2503
2520
  active: this.activeFormats.color
2504
2521
  })}
2505
- is-icon
2506
- >
2507
- <div
2508
- class="size-4 rounded-full"
2509
- style="background-color: ${this.activeFormats.activeColor};"
2510
- ></div>
2511
- </lukso-button>
2512
- </lukso-tooltip>
2513
- <lukso-dropdown
2514
- id="colorDropdown"
2515
- trigger-id=""
2516
- size="medium"
2517
- max-height="300"
2518
- ?is-open=${this.isColorDropdownOpen}
2519
- >
2520
- <div class="grid grid-cols-8 gap-2 p-2 w-[260px]">
2521
- <div class="col-span-8 mb-2 flex items-center justify-between">
2522
- <span class="text-xs text-neutral-60">Text Color</span>
2523
- ${this.activeFormats.color ? shared_tailwindElement_index.x`<button
2524
- class="text-xs text-neutral-60 hover:text-neutral-20 underline"
2525
- @click=${(e) => {
2522
+ is-icon
2523
+ >
2524
+ <div
2525
+ class="size-4 rounded-full"
2526
+ style="background-color: ${this.activeFormats.activeColor};"
2527
+ ></div>
2528
+ </lukso-button>
2529
+ </lukso-tooltip>
2530
+ <lukso-dropdown
2531
+ id="colorDropdown"
2532
+ trigger-id=""
2533
+ size="medium"
2534
+ max-height="300"
2535
+ ?is-open=${this.isColorDropdownOpen}
2536
+ >
2537
+ <div class="grid grid-cols-8 gap-2 p-2 w-[260px]">
2538
+ <div
2539
+ class="col-span-8 mb-2 flex items-center justify-between"
2540
+ >
2541
+ <span class="text-xs text-neutral-60">Text Color</span>
2542
+ ${this.activeFormats.color ? shared_tailwindElement_index.x`<button
2543
+ class="text-xs text-neutral-60 hover:text-neutral-20 underline"
2544
+ @click=${(e) => {
2526
2545
  e.stopPropagation();
2527
2546
  this.clearColor();
2528
2547
  this.isColorDropdownOpen = false;
2529
2548
  }}
2530
- type="button"
2531
- aria-label="Clear color"
2532
- >
2533
- Clear
2534
- </button>` : shared_tailwindElement_index.E}
2535
- </div>
2536
- ${this.colorSamples.map(
2549
+ type="button"
2550
+ aria-label="Clear color"
2551
+ >
2552
+ Clear
2553
+ </button>` : shared_tailwindElement_index.E}
2554
+ </div>
2555
+ ${this.colorSamples.map(
2537
2556
  (color) => shared_tailwindElement_index.x`
2538
- <button
2539
- class="w-6 h-6 rounded-4 border transition-all ${this.activeFormats.activeColor === color ? "border-neutral-20 ring-2 ring-purple-51" : "border-neutral-90 hover:border-neutral-60"}"
2540
- style="background-color: ${color}"
2541
- title=${color}
2542
- aria-pressed=${this.activeFormats.activeColor === color ? "true" : "false"}
2543
- aria-label="Color ${color}"
2544
- @click=${(e) => {
2557
+ <button
2558
+ class="w-6 h-6 rounded-4 border transition-all ${this.activeFormats.activeColor === color ? "border-neutral-20 ring-2 ring-purple-51" : "border-neutral-90 hover:border-neutral-60"}"
2559
+ style="background-color: ${color}"
2560
+ title=${color}
2561
+ aria-pressed=${this.activeFormats.activeColor === color ? "true" : "false"}
2562
+ aria-label="Color ${color}"
2563
+ @click=${(e) => {
2545
2564
  e.stopPropagation();
2546
2565
  this.selectColor(color);
2547
2566
  this.isColorDropdownOpen = false;
2548
2567
  }}
2549
- ></button>
2550
- `
2568
+ ></button>
2569
+ `
2551
2570
  )}
2552
- </div>
2553
- </lukso-dropdown>
2554
- </div>
2571
+ </div>
2572
+ </lukso-dropdown>
2573
+ </div>
2574
+ ` : shared_tailwindElement_index.E}
2555
2575
 
2556
- <div class=${this.styles().divider()}></div>
2576
+ <!-- Divider -->
2577
+ ${this.toolsState.length > 0 ? shared_tailwindElement_index.x`<div class=${this.styles().divider()}></div>` : shared_tailwindElement_index.E}
2557
2578
  </div>
2558
2579
  `;
2559
2580
  }
@@ -2598,6 +2619,17 @@ ${indent}${nextNumber}. `;
2598
2619
  if (!this.previewTextColor) {
2599
2620
  this.previewTextColor = DEFAULT_PREVIEW_TEXT_COLOR;
2600
2621
  }
2622
+ this.toolsState = this.defaultTools;
2623
+ try {
2624
+ if (this.tools) {
2625
+ this.toolsState = JSON.parse(this.tools);
2626
+ }
2627
+ } catch (error) {
2628
+ console.warn(
2629
+ "Invalid JSON for tools property in lukso-markdown-editor. Using default tools.",
2630
+ error
2631
+ );
2632
+ }
2601
2633
  return shared_tailwindElement_index.x`
2602
2634
  <div class=${wrapper()}>
2603
2635
  ${this.labelTemplate()} ${this.descriptionTemplate()}
@@ -2637,6 +2669,7 @@ ${indent}${nextNumber}. `;
2637
2669
  >
2638
2670
  <lukso-markdown
2639
2671
  value=${this.value}
2672
+ ?strip-html-tags=${this.stripHtmlTags}
2640
2673
  custom-style=${`color: ${this.previewTextColor};`}
2641
2674
  ></lukso-markdown>
2642
2675
  ${this.accessibilityIndicatorTemplate()}
@@ -2699,6 +2732,15 @@ __decorateClass([
2699
2732
  __decorateClass([
2700
2733
  property.n({ type: String, attribute: "preview-text-color", reflect: true })
2701
2734
  ], exports.LuksoMarkdownEditor.prototype, "previewTextColor", 2);
2735
+ __decorateClass([
2736
+ property.n({ type: Boolean, attribute: "strip-html-tags" })
2737
+ ], exports.LuksoMarkdownEditor.prototype, "stripHtmlTags", 2);
2738
+ __decorateClass([
2739
+ property.n({ type: String })
2740
+ ], exports.LuksoMarkdownEditor.prototype, "tools", 2);
2741
+ __decorateClass([
2742
+ state.r()
2743
+ ], exports.LuksoMarkdownEditor.prototype, "toolsState", 2);
2702
2744
  __decorateClass([
2703
2745
  state.r()
2704
2746
  ], exports.LuksoMarkdownEditor.prototype, "savedSelectionForPreview", 2);