@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.
- package/dist/components/index.cjs +7 -5
- package/dist/components/index.js +5 -5
- package/dist/components/lukso-button/index.cjs +3 -3
- package/dist/components/lukso-button/index.js +3 -3
- package/dist/components/lukso-card/index.cjs +6 -6
- package/dist/components/lukso-card/index.js +6 -6
- package/dist/components/lukso-checkbox/index.cjs +3 -3
- package/dist/components/lukso-checkbox/index.js +3 -3
- package/dist/components/lukso-collapse/index.cjs +3 -3
- package/dist/components/lukso-collapse/index.js +3 -3
- package/dist/components/lukso-color-picker/index.cjs +5 -5
- package/dist/components/lukso-color-picker/index.js +5 -5
- package/dist/components/lukso-dropdown/index.cjs +4 -4
- package/dist/components/lukso-dropdown/index.js +4 -4
- package/dist/components/lukso-dropdown-option/index.cjs +2 -2
- package/dist/components/lukso-dropdown-option/index.js +2 -2
- package/dist/components/lukso-footer/index.cjs +3 -2
- package/dist/components/lukso-footer/index.d.ts.map +1 -1
- package/dist/components/lukso-footer/index.js +3 -2
- package/dist/components/lukso-icon/index.cjs +4 -4
- package/dist/components/lukso-icon/index.js +4 -4
- package/dist/components/lukso-image/index.cjs +4 -4
- package/dist/components/lukso-image/index.js +4 -4
- package/dist/components/lukso-input/index.cjs +4 -4
- package/dist/components/lukso-input/index.js +4 -4
- package/dist/components/lukso-markdown/index.cjs +13 -5
- package/dist/components/lukso-markdown/index.d.ts +1 -0
- package/dist/components/lukso-markdown/index.d.ts.map +1 -1
- package/dist/components/lukso-markdown/index.js +13 -5
- package/dist/components/lukso-markdown/lukso-markdown.stories.d.ts +2 -0
- package/dist/components/lukso-markdown/lukso-markdown.stories.d.ts.map +1 -1
- package/dist/components/lukso-markdown-editor/index.cjs +294 -252
- package/dist/components/lukso-markdown-editor/index.d.ts +4 -1
- package/dist/components/lukso-markdown-editor/index.d.ts.map +1 -1
- package/dist/components/lukso-markdown-editor/index.js +294 -252
- package/dist/components/lukso-markdown-editor/lukso-markdown-editor.stories.d.ts +6 -0
- package/dist/components/lukso-markdown-editor/lukso-markdown-editor.stories.d.ts.map +1 -1
- package/dist/components/lukso-modal/index.cjs +2 -2
- package/dist/components/lukso-modal/index.js +2 -2
- package/dist/components/lukso-navbar/index.cjs +3 -3
- package/dist/components/lukso-navbar/index.js +3 -3
- package/dist/components/lukso-pagination/index.cjs +3 -3
- package/dist/components/lukso-pagination/index.js +3 -3
- package/dist/components/lukso-profile/index.cjs +3 -3
- package/dist/components/lukso-profile/index.js +3 -3
- package/dist/components/lukso-progress/index.cjs +3 -3
- package/dist/components/lukso-progress/index.js +3 -3
- package/dist/components/lukso-radio/index.cjs +3 -3
- package/dist/components/lukso-radio/index.js +3 -3
- package/dist/components/lukso-radio-group/index.cjs +3 -3
- package/dist/components/lukso-radio-group/index.js +3 -3
- package/dist/components/lukso-sanitize/index.cjs +9 -1390
- package/dist/components/lukso-sanitize/index.d.ts +17 -1
- package/dist/components/lukso-sanitize/index.d.ts.map +1 -1
- package/dist/components/lukso-sanitize/index.js +4 -1396
- package/dist/components/lukso-sanitize/lukso-sanitize.stories.d.ts +17 -1
- package/dist/components/lukso-sanitize/lukso-sanitize.stories.d.ts.map +1 -1
- package/dist/components/lukso-search/index.cjs +6 -6
- package/dist/components/lukso-search/index.js +6 -6
- package/dist/components/lukso-select/index.cjs +6 -6
- package/dist/components/lukso-select/index.js +6 -6
- package/dist/components/lukso-share/index.cjs +2 -2
- package/dist/components/lukso-share/index.js +2 -2
- package/dist/components/lukso-switch/index.cjs +4 -4
- package/dist/components/lukso-switch/index.js +4 -4
- package/dist/components/lukso-tag/index.cjs +3 -3
- package/dist/components/lukso-tag/index.js +3 -3
- package/dist/components/lukso-terms/index.cjs +4 -4
- package/dist/components/lukso-terms/index.js +4 -4
- package/dist/components/lukso-textarea/index.cjs +4 -4
- package/dist/components/lukso-textarea/index.js +4 -4
- package/dist/components/lukso-tooltip/index.cjs +4 -4
- package/dist/components/lukso-tooltip/index.js +4 -4
- package/dist/components/lukso-username/index.cjs +4 -4
- package/dist/components/lukso-username/index.js +4 -4
- package/dist/components/lukso-wizard/index.cjs +2 -2
- package/dist/components/lukso-wizard/index.js +2 -2
- package/dist/{index-DNhzT2hA.cjs → index-BDC9pVk6.cjs} +2 -2
- package/dist/index-BFqOU6o6.cjs +50 -0
- package/dist/{index-NKnet_Ow.js → index-BJwLob67.js} +2 -2
- package/dist/{index-CKlH1beR.js → index-BOWftFAY.js} +1 -1
- package/dist/{index-CKjNXRek.cjs → index-C2uvRzO4.cjs} +3 -3
- package/dist/{index-C1JF-hTl.cjs → index-CEnG_x_7.cjs} +5 -5
- package/dist/index-CQq_Eyeu.js +41 -0
- package/dist/index-Chl2HHJ6.cjs +1408 -0
- package/dist/index-JvkSiEeQ.js +1404 -0
- package/dist/{index-C9Ins46B.cjs → index-Zriuvita.cjs} +1 -1
- package/dist/{index-BSwFyDEC.js → index-f-xajtU2.js} +3 -3
- package/dist/{index-CDUQ0-Uh.js → index-oQecUOlb.js} +5 -5
- package/dist/index.cjs +7 -5
- package/dist/index.js +5 -5
- package/dist/{property-Da9lvmME.js → property-CPkYmAYi.js} +1 -1
- package/dist/{property-dUn0JQiG.cjs → property-Cs8qVdri.cjs} +1 -1
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{state-CD8hXUlY.cjs → state-Bh6EXopE.cjs} +1 -1
- package/dist/{state-CtpsBPdH.js → state-CtrTo6cC.js} +1 -1
- package/dist/{style-map-CDCcO0mt.js → style-map-BBz25umN.js} +1 -1
- package/dist/{style-map-nBexjTCa.cjs → style-map-DhbNG03r.cjs} +1 -1
- package/dist/tailwind-config.cjs +65 -0
- package/dist/tailwind-config.d.ts +85 -0
- package/dist/tailwind-config.d.ts.map +1 -1
- package/dist/tailwind-config.js +64 -1
- package/dist/{unsafe-html-DHNeIs-4.cjs → unsafe-html-Cb1yjpJn.cjs} +1 -1
- package/dist/{unsafe-html-Ci4jmi7b.js → unsafe-html-DTE5r2A7.js} +1 -1
- package/package.json +1 -1
- package/tailwind.config.cjs +208 -178
- package/tools/cn.cjs +1 -1
- package/tools/cn.js +1 -1
- package/tools/copy-assets.cjs +16 -16
- package/tools/copy-assets.js +2 -2
- package/tools/index.cjs +1 -1
- package/tools/index.js +1 -1
- package/tools/{tailwind-config-Ch2-b3Be.js → tailwind-config-DVTyRd7x.js} +64 -1
- package/tools/{tailwind-config-BIErjaAT.cjs → tailwind-config-DoMZEvsr.cjs} +65 -0
- package/tools/tailwind-config.cjs +3 -1
- package/tools/tailwind-config.d.ts +85 -0
- package/tools/tailwind-config.d.ts.map +1 -1
- package/tools/tailwind-config.js +1 -1
- package/dist/index-B5CXCi6j.js +0 -41
- 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-
|
|
6
|
-
const property = require('../../property-
|
|
7
|
-
const state = require('../../state-
|
|
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('
|
|
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
|
-
},
|
|
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
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
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
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
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
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
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
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
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
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
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
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
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
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
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
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
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
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
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
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
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
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
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
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
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
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
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
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
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
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
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
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
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
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
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
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
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
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
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
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
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
|
-
|
|
2472
|
-
</lukso-dropdown>
|
|
2473
|
-
</div>
|
|
2489
|
+
` : shared_tailwindElement_index.E}
|
|
2474
2490
|
|
|
2475
2491
|
<!-- Color -->
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
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
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
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
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
class="text-xs text-neutral-60
|
|
2525
|
-
|
|
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
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
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
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
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
|
-
|
|
2550
|
-
|
|
2568
|
+
></button>
|
|
2569
|
+
`
|
|
2551
2570
|
)}
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2571
|
+
</div>
|
|
2572
|
+
</lukso-dropdown>
|
|
2573
|
+
</div>
|
|
2574
|
+
` : shared_tailwindElement_index.E}
|
|
2555
2575
|
|
|
2556
|
-
|
|
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);
|