@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, E, x } from '../../index-
|
|
2
|
-
import { n, t } from '../../property-
|
|
3
|
-
import { r } from '../../state-
|
|
1
|
+
import { T as TailwindStyledElement, E, x } from '../../index-CQq_Eyeu.js';
|
|
2
|
+
import { n, t } from '../../property-CPkYmAYi.js';
|
|
3
|
+
import { r } from '../../state-CtrTo6cC.js';
|
|
4
4
|
import { e } from '../../query-CHb9Ft_d.js';
|
|
5
5
|
import { c as ce } from '../../index-B9iart53.js';
|
|
6
6
|
import '../../tailwind-config.js';
|
|
@@ -10,7 +10,7 @@ import '../lukso-markdown/index.js';
|
|
|
10
10
|
import '../lukso-switch/index.js';
|
|
11
11
|
import '../lukso-button/index.js';
|
|
12
12
|
import '../lukso-icon/index.js';
|
|
13
|
-
import '
|
|
13
|
+
import '../../index-JvkSiEeQ.js';
|
|
14
14
|
import '../lukso-dropdown/index.js';
|
|
15
15
|
import '../lukso-dropdown-option/index.js';
|
|
16
16
|
import '../lukso-tooltip/index.js';
|
|
@@ -201,6 +201,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
201
201
|
};
|
|
202
202
|
const DEFAULT_PREVIEW_BACKGROUND_COLOR = "#f9f9f9";
|
|
203
203
|
const DEFAULT_PREVIEW_TEXT_COLOR = "#374151";
|
|
204
|
+
const ACCESSIBILITY_CHECK_DELAY = 1e3;
|
|
204
205
|
let LuksoMarkdownEditor = class extends TailwindStyledElement(style) {
|
|
205
206
|
constructor() {
|
|
206
207
|
super(...arguments);
|
|
@@ -220,6 +221,18 @@ let LuksoMarkdownEditor = class extends TailwindStyledElement(style) {
|
|
|
220
221
|
this.placeholder = "";
|
|
221
222
|
this.previewBackgroundColor = DEFAULT_PREVIEW_BACKGROUND_COLOR;
|
|
222
223
|
this.previewTextColor = DEFAULT_PREVIEW_TEXT_COLOR;
|
|
224
|
+
this.stripHtmlTags = false;
|
|
225
|
+
this.tools = void 0;
|
|
226
|
+
this.toolsState = [];
|
|
227
|
+
this.defaultTools = [
|
|
228
|
+
"heading",
|
|
229
|
+
"bold",
|
|
230
|
+
"italic",
|
|
231
|
+
"list",
|
|
232
|
+
"link",
|
|
233
|
+
"alignment",
|
|
234
|
+
"color"
|
|
235
|
+
];
|
|
223
236
|
this.savedSelectionForPreview = null;
|
|
224
237
|
this.isHeadingDropdownOpen = false;
|
|
225
238
|
this.isColorDropdownOpen = false;
|
|
@@ -256,7 +269,6 @@ let LuksoMarkdownEditor = class extends TailwindStyledElement(style) {
|
|
|
256
269
|
this.accessibilityViolations = [];
|
|
257
270
|
this.hasAccessibilityViolations = false;
|
|
258
271
|
this.accessibilityCheckTimeout = null;
|
|
259
|
-
this.ACCESSIBILITY_CHECK_DELAY = 1e3;
|
|
260
272
|
this.handleOutsideClick = (event) => {
|
|
261
273
|
const target = event.target;
|
|
262
274
|
const isInsideThisComponent = this.contains(target) || this.shadowRoot?.contains(target);
|
|
@@ -528,7 +540,7 @@ let LuksoMarkdownEditor = class extends TailwindStyledElement(style) {
|
|
|
528
540
|
this.accessibilityCheckTimeout = window.setTimeout(() => {
|
|
529
541
|
this.performAccessibilityCheck();
|
|
530
542
|
this.accessibilityCheckTimeout = null;
|
|
531
|
-
},
|
|
543
|
+
}, ACCESSIBILITY_CHECK_DELAY);
|
|
532
544
|
}
|
|
533
545
|
/**
|
|
534
546
|
* Clean up empty color spans from the value.
|
|
@@ -2169,126 +2181,127 @@ ${indent}${nextNumber}. `;
|
|
|
2169
2181
|
toolbarTemplate() {
|
|
2170
2182
|
return x`
|
|
2171
2183
|
<div class="flex items-center gap-1">
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2184
|
+
<!-- Heading -->
|
|
2185
|
+
${this.toolsState.includes("heading") ? x`<div class=${cn(this.styles().headingMenu())}>
|
|
2186
|
+
<lukso-tooltip text="Heading options" placement="top">
|
|
2187
|
+
<lukso-button
|
|
2188
|
+
id=${this.headingTriggerId}
|
|
2189
|
+
@click=${(e) => {
|
|
2178
2190
|
e.stopPropagation();
|
|
2179
2191
|
this.isColorDropdownOpen = false;
|
|
2180
2192
|
this.isListDropdownOpen = false;
|
|
2181
2193
|
this.isAlignmentDropdownOpen = false;
|
|
2182
2194
|
this.isHeadingDropdownOpen = !this.isHeadingDropdownOpen;
|
|
2183
2195
|
}}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2196
|
+
aria-expanded=${this.isHeadingDropdownOpen ? "true" : "false"}
|
|
2197
|
+
aria-label="Heading options"
|
|
2198
|
+
variant="secondary"
|
|
2199
|
+
size="small"
|
|
2200
|
+
custom-class=${this.toolbarButton({
|
|
2189
2201
|
active: this.getActiveHeadingLevel() > 0
|
|
2190
2202
|
})}
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2203
|
+
is-icon
|
|
2204
|
+
>
|
|
2205
|
+
<lukso-icon
|
|
2206
|
+
name="smallcaps"
|
|
2207
|
+
size="small"
|
|
2208
|
+
pack="vuesax"
|
|
2209
|
+
variant="linear"
|
|
2210
|
+
></lukso-icon>
|
|
2211
|
+
</lukso-button>
|
|
2212
|
+
</lukso-tooltip>
|
|
2213
|
+
<lukso-dropdown
|
|
2214
|
+
id="headingDropdown"
|
|
2215
|
+
trigger-id=""
|
|
2216
|
+
size="medium"
|
|
2217
|
+
?is-open=${this.isHeadingDropdownOpen}
|
|
2218
|
+
>
|
|
2219
|
+
<lukso-dropdown-option
|
|
2220
|
+
?is-selected=${this.getActiveHeadingLevel() === 0}
|
|
2221
|
+
@click=${(e) => {
|
|
2210
2222
|
e.stopPropagation();
|
|
2211
2223
|
this.restoreFocusAndSelection();
|
|
2212
2224
|
this.applyHeading(0);
|
|
2213
2225
|
this.isHeadingDropdownOpen = false;
|
|
2214
2226
|
}}
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2227
|
+
size="medium"
|
|
2228
|
+
>
|
|
2229
|
+
Normal text
|
|
2230
|
+
</lukso-dropdown-option>
|
|
2231
|
+
<lukso-dropdown-option
|
|
2232
|
+
?is-selected=${this.getActiveHeadingLevel() === 1}
|
|
2233
|
+
@click=${(e) => {
|
|
2222
2234
|
e.stopPropagation();
|
|
2223
2235
|
this.restoreFocusAndSelection();
|
|
2224
2236
|
this.applyHeading(1);
|
|
2225
2237
|
this.isHeadingDropdownOpen = false;
|
|
2226
2238
|
}}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2239
|
+
size="medium"
|
|
2240
|
+
>
|
|
2241
|
+
Heading 1
|
|
2242
|
+
</lukso-dropdown-option>
|
|
2243
|
+
<lukso-dropdown-option
|
|
2244
|
+
?is-selected=${this.getActiveHeadingLevel() === 2}
|
|
2245
|
+
@click=${(e) => {
|
|
2234
2246
|
e.stopPropagation();
|
|
2235
2247
|
this.restoreFocusAndSelection();
|
|
2236
2248
|
this.applyHeading(2);
|
|
2237
2249
|
this.isHeadingDropdownOpen = false;
|
|
2238
2250
|
}}
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2251
|
+
size="medium"
|
|
2252
|
+
>
|
|
2253
|
+
Heading 2
|
|
2254
|
+
</lukso-dropdown-option>
|
|
2255
|
+
<lukso-dropdown-option
|
|
2256
|
+
?is-selected=${this.getActiveHeadingLevel() === 3}
|
|
2257
|
+
@click=${(e) => {
|
|
2246
2258
|
e.stopPropagation();
|
|
2247
2259
|
this.restoreFocusAndSelection();
|
|
2248
2260
|
this.applyHeading(3);
|
|
2249
2261
|
this.isHeadingDropdownOpen = false;
|
|
2250
2262
|
}}
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2263
|
+
size="medium"
|
|
2264
|
+
>
|
|
2265
|
+
Heading 3
|
|
2266
|
+
</lukso-dropdown-option>
|
|
2267
|
+
<lukso-dropdown-option
|
|
2268
|
+
?is-selected=${this.getActiveHeadingLevel() === 4}
|
|
2269
|
+
@click=${(e) => {
|
|
2258
2270
|
e.stopPropagation();
|
|
2259
2271
|
this.restoreFocusAndSelection();
|
|
2260
2272
|
this.applyHeading(4);
|
|
2261
2273
|
this.isHeadingDropdownOpen = false;
|
|
2262
2274
|
}}
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2275
|
+
size="medium"
|
|
2276
|
+
>
|
|
2277
|
+
Heading 4
|
|
2278
|
+
</lukso-dropdown-option>
|
|
2279
|
+
</lukso-dropdown>
|
|
2280
|
+
</div>` : E}
|
|
2269
2281
|
|
|
2270
2282
|
<!-- Bold -->
|
|
2271
|
-
${this.buttonTemplate(
|
|
2283
|
+
${this.toolsState.includes("bold") ? this.buttonTemplate(
|
|
2272
2284
|
"text-bold",
|
|
2273
2285
|
() => this.toggleWrap("**"),
|
|
2274
2286
|
"Bold",
|
|
2275
2287
|
this.activeFormats.bold
|
|
2276
|
-
)}
|
|
2288
|
+
) : E}
|
|
2277
2289
|
|
|
2278
2290
|
<!-- Italic -->
|
|
2279
|
-
${this.buttonTemplate(
|
|
2291
|
+
${this.toolsState.includes("italic") ? this.buttonTemplate(
|
|
2280
2292
|
"text-italic",
|
|
2281
2293
|
() => this.toggleWrap("*"),
|
|
2282
2294
|
"Italic",
|
|
2283
2295
|
this.activeFormats.italic
|
|
2284
|
-
)}
|
|
2296
|
+
) : E}
|
|
2285
2297
|
|
|
2286
2298
|
<!-- List -->
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2299
|
+
${this.toolsState.includes("list") ? x`
|
|
2300
|
+
<div class=${this.styles().listMenu()}>
|
|
2301
|
+
<lukso-tooltip text="List options" placement="top">
|
|
2302
|
+
<lukso-button
|
|
2303
|
+
id=${this.listTriggerId}
|
|
2304
|
+
@click=${(e) => {
|
|
2292
2305
|
e.stopPropagation();
|
|
2293
2306
|
this.restoreFocusAndSelection();
|
|
2294
2307
|
this.isHeadingDropdownOpen = false;
|
|
@@ -2296,82 +2309,84 @@ ${indent}${nextNumber}. `;
|
|
|
2296
2309
|
this.isAlignmentDropdownOpen = false;
|
|
2297
2310
|
this.isListDropdownOpen = !this.isListDropdownOpen;
|
|
2298
2311
|
}}
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2312
|
+
aria-expanded=${this.isListDropdownOpen ? "true" : "false"}
|
|
2313
|
+
aria-label="List options"
|
|
2314
|
+
variant="secondary"
|
|
2315
|
+
size="small"
|
|
2316
|
+
custom-class=${this.toolbarButton({
|
|
2304
2317
|
active: this.activeFormats.unorderedList || this.activeFormats.orderedList
|
|
2305
2318
|
})}
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2319
|
+
is-icon
|
|
2320
|
+
>
|
|
2321
|
+
<lukso-icon
|
|
2322
|
+
name="task"
|
|
2323
|
+
size="small"
|
|
2324
|
+
pack="vuesax"
|
|
2325
|
+
variant="linear"
|
|
2326
|
+
></lukso-icon>
|
|
2327
|
+
</lukso-button>
|
|
2328
|
+
</lukso-tooltip>
|
|
2329
|
+
<lukso-dropdown
|
|
2330
|
+
id="listDropdown"
|
|
2331
|
+
trigger-id=""
|
|
2332
|
+
size="medium"
|
|
2333
|
+
?is-open=${this.isListDropdownOpen}
|
|
2334
|
+
>
|
|
2335
|
+
<lukso-dropdown-option
|
|
2336
|
+
?is-selected=${this.getActiveListType() === "none"}
|
|
2337
|
+
@click=${(e) => {
|
|
2325
2338
|
e.stopPropagation();
|
|
2326
2339
|
this.restoreFocusAndSelection();
|
|
2327
2340
|
this.applyList("none");
|
|
2328
2341
|
this.isListDropdownOpen = false;
|
|
2329
2342
|
}}
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2343
|
+
size="medium"
|
|
2344
|
+
>
|
|
2345
|
+
No list
|
|
2346
|
+
</lukso-dropdown-option>
|
|
2347
|
+
<lukso-dropdown-option
|
|
2348
|
+
?is-selected=${this.getActiveListType() === "unordered"}
|
|
2349
|
+
@click=${(e) => {
|
|
2337
2350
|
e.stopPropagation();
|
|
2338
2351
|
this.restoreFocusAndSelection();
|
|
2339
2352
|
this.applyList("unordered");
|
|
2340
2353
|
this.isListDropdownOpen = false;
|
|
2341
2354
|
}}
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2355
|
+
size="medium"
|
|
2356
|
+
>
|
|
2357
|
+
Unordered
|
|
2358
|
+
</lukso-dropdown-option>
|
|
2359
|
+
<lukso-dropdown-option
|
|
2360
|
+
?is-selected=${this.getActiveListType() === "ordered"}
|
|
2361
|
+
@click=${(e) => {
|
|
2349
2362
|
e.stopPropagation();
|
|
2350
2363
|
this.restoreFocusAndSelection();
|
|
2351
2364
|
this.applyList("ordered");
|
|
2352
2365
|
this.isListDropdownOpen = false;
|
|
2353
2366
|
}}
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2367
|
+
size="medium"
|
|
2368
|
+
>
|
|
2369
|
+
Ordered
|
|
2370
|
+
</lukso-dropdown-option>
|
|
2371
|
+
</lukso-dropdown>
|
|
2372
|
+
</div>
|
|
2373
|
+
` : E}
|
|
2360
2374
|
|
|
2361
2375
|
<!-- Link -->
|
|
2362
|
-
${this.buttonTemplate(
|
|
2376
|
+
${this.toolsState.includes("link") ? this.buttonTemplate(
|
|
2363
2377
|
"link",
|
|
2364
2378
|
() => this.insertLink(),
|
|
2365
2379
|
"Link",
|
|
2366
2380
|
this.activeFormats.link
|
|
2367
|
-
)}
|
|
2381
|
+
) : E}
|
|
2368
2382
|
|
|
2369
2383
|
<!-- Text Alignment -->
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2384
|
+
${this.toolsState.includes("alignment") ? x`
|
|
2385
|
+
<div class=${this.styles().alignmentMenu()}>
|
|
2386
|
+
<lukso-tooltip text="Text alignment" placement="top">
|
|
2387
|
+
<lukso-button
|
|
2388
|
+
id=${this.alignmentTriggerId}
|
|
2389
|
+
@click=${(e) => {
|
|
2375
2390
|
e.stopPropagation();
|
|
2376
2391
|
this.restoreFocusAndSelection();
|
|
2377
2392
|
this.isHeadingDropdownOpen = false;
|
|
@@ -2379,101 +2394,103 @@ ${indent}${nextNumber}. `;
|
|
|
2379
2394
|
this.isListDropdownOpen = false;
|
|
2380
2395
|
this.isAlignmentDropdownOpen = !this.isAlignmentDropdownOpen;
|
|
2381
2396
|
}}
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2397
|
+
aria-expanded=${this.isAlignmentDropdownOpen ? "true" : "false"}
|
|
2398
|
+
aria-label="Text alignment"
|
|
2399
|
+
variant="secondary"
|
|
2400
|
+
size="small"
|
|
2401
|
+
custom-class=${this.toolbarButton({
|
|
2387
2402
|
active: this.activeFormats.alignment !== "left"
|
|
2388
2403
|
})}
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2404
|
+
is-icon
|
|
2405
|
+
>
|
|
2406
|
+
<lukso-icon
|
|
2407
|
+
name=${this.getAlignmentIcon()}
|
|
2408
|
+
size="small"
|
|
2409
|
+
pack="vuesax"
|
|
2410
|
+
variant="linear"
|
|
2411
|
+
></lukso-icon>
|
|
2412
|
+
</lukso-button>
|
|
2413
|
+
</lukso-tooltip>
|
|
2414
|
+
<lukso-dropdown
|
|
2415
|
+
id="alignmentDropdown"
|
|
2416
|
+
trigger-id=""
|
|
2417
|
+
size="medium"
|
|
2418
|
+
?is-open=${this.isAlignmentDropdownOpen}
|
|
2419
|
+
>
|
|
2420
|
+
<lukso-dropdown-option
|
|
2421
|
+
?is-selected=${this.activeFormats.alignment === "left"}
|
|
2422
|
+
@click=${(e) => {
|
|
2408
2423
|
e.stopPropagation();
|
|
2409
2424
|
this.restoreFocusAndSelection();
|
|
2410
2425
|
this.applyAlignment("left");
|
|
2411
2426
|
this.isAlignmentDropdownOpen = false;
|
|
2412
2427
|
}}
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2428
|
+
size="medium"
|
|
2429
|
+
aria-label="Align left"
|
|
2430
|
+
>
|
|
2431
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
2432
|
+
<lukso-icon
|
|
2433
|
+
name="textalign-left"
|
|
2434
|
+
size="small"
|
|
2435
|
+
pack="vuesax"
|
|
2436
|
+
variant="linear"
|
|
2437
|
+
></lukso-icon>
|
|
2438
|
+
Left
|
|
2439
|
+
</div>
|
|
2440
|
+
</lukso-dropdown-option>
|
|
2441
|
+
<lukso-dropdown-option
|
|
2442
|
+
?is-selected=${this.activeFormats.alignment === "center"}
|
|
2443
|
+
@click=${(e) => {
|
|
2429
2444
|
e.stopPropagation();
|
|
2430
2445
|
this.restoreFocusAndSelection();
|
|
2431
2446
|
this.applyAlignment("center");
|
|
2432
2447
|
this.isAlignmentDropdownOpen = false;
|
|
2433
2448
|
}}
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2449
|
+
size="medium"
|
|
2450
|
+
aria-label="Align center"
|
|
2451
|
+
>
|
|
2452
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
2453
|
+
<lukso-icon
|
|
2454
|
+
name="textalign-center"
|
|
2455
|
+
size="small"
|
|
2456
|
+
pack="vuesax"
|
|
2457
|
+
variant="linear"
|
|
2458
|
+
></lukso-icon>
|
|
2459
|
+
Center
|
|
2460
|
+
</div>
|
|
2461
|
+
</lukso-dropdown-option>
|
|
2462
|
+
<lukso-dropdown-option
|
|
2463
|
+
?is-selected=${this.activeFormats.alignment === "right"}
|
|
2464
|
+
@click=${(e) => {
|
|
2450
2465
|
e.stopPropagation();
|
|
2451
2466
|
this.restoreFocusAndSelection();
|
|
2452
2467
|
this.applyAlignment("right");
|
|
2453
2468
|
this.isAlignmentDropdownOpen = false;
|
|
2454
2469
|
}}
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2470
|
+
size="medium"
|
|
2471
|
+
aria-label="Align right"
|
|
2472
|
+
>
|
|
2473
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
2474
|
+
<lukso-icon
|
|
2475
|
+
name="textalign-right"
|
|
2476
|
+
size="small"
|
|
2477
|
+
pack="vuesax"
|
|
2478
|
+
variant="linear"
|
|
2479
|
+
></lukso-icon>
|
|
2480
|
+
Right
|
|
2481
|
+
</div>
|
|
2482
|
+
</lukso-dropdown-option>
|
|
2483
|
+
</lukso-dropdown>
|
|
2466
2484
|
</div>
|
|
2467
|
-
|
|
2468
|
-
</lukso-dropdown>
|
|
2469
|
-
</div>
|
|
2485
|
+
` : E}
|
|
2470
2486
|
|
|
2471
2487
|
<!-- Color -->
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2488
|
+
${this.toolsState.includes("color") ? x`
|
|
2489
|
+
<div class=${this.styles().colorMenu()}>
|
|
2490
|
+
<lukso-tooltip text="Text color" placement="top">
|
|
2491
|
+
<lukso-button
|
|
2492
|
+
id=${this.colorTriggerId}
|
|
2493
|
+
@click=${(e) => {
|
|
2477
2494
|
e.stopPropagation();
|
|
2478
2495
|
this.restoreFocusAndSelection();
|
|
2479
2496
|
this.isHeadingDropdownOpen = false;
|
|
@@ -2490,66 +2507,70 @@ ${indent}${nextNumber}. `;
|
|
|
2490
2507
|
}
|
|
2491
2508
|
this.isColorDropdownOpen = !this.isColorDropdownOpen;
|
|
2492
2509
|
}}
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2510
|
+
aria-expanded=${this.isColorDropdownOpen ? "true" : "false"}
|
|
2511
|
+
aria-pressed=${this.activeFormats.color ? "true" : "false"}
|
|
2512
|
+
aria-label="Text color"
|
|
2513
|
+
variant="secondary"
|
|
2514
|
+
size="small"
|
|
2515
|
+
custom-class=${this.toolbarButton({
|
|
2499
2516
|
active: this.activeFormats.color
|
|
2500
2517
|
})}
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
class="text-xs text-neutral-60
|
|
2521
|
-
|
|
2518
|
+
is-icon
|
|
2519
|
+
>
|
|
2520
|
+
<div
|
|
2521
|
+
class="size-4 rounded-full"
|
|
2522
|
+
style="background-color: ${this.activeFormats.activeColor};"
|
|
2523
|
+
></div>
|
|
2524
|
+
</lukso-button>
|
|
2525
|
+
</lukso-tooltip>
|
|
2526
|
+
<lukso-dropdown
|
|
2527
|
+
id="colorDropdown"
|
|
2528
|
+
trigger-id=""
|
|
2529
|
+
size="medium"
|
|
2530
|
+
max-height="300"
|
|
2531
|
+
?is-open=${this.isColorDropdownOpen}
|
|
2532
|
+
>
|
|
2533
|
+
<div class="grid grid-cols-8 gap-2 p-2 w-[260px]">
|
|
2534
|
+
<div
|
|
2535
|
+
class="col-span-8 mb-2 flex items-center justify-between"
|
|
2536
|
+
>
|
|
2537
|
+
<span class="text-xs text-neutral-60">Text Color</span>
|
|
2538
|
+
${this.activeFormats.color ? x`<button
|
|
2539
|
+
class="text-xs text-neutral-60 hover:text-neutral-20 underline"
|
|
2540
|
+
@click=${(e) => {
|
|
2522
2541
|
e.stopPropagation();
|
|
2523
2542
|
this.clearColor();
|
|
2524
2543
|
this.isColorDropdownOpen = false;
|
|
2525
2544
|
}}
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2545
|
+
type="button"
|
|
2546
|
+
aria-label="Clear color"
|
|
2547
|
+
>
|
|
2548
|
+
Clear
|
|
2549
|
+
</button>` : E}
|
|
2550
|
+
</div>
|
|
2551
|
+
${this.colorSamples.map(
|
|
2533
2552
|
(color) => x`
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2553
|
+
<button
|
|
2554
|
+
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"}"
|
|
2555
|
+
style="background-color: ${color}"
|
|
2556
|
+
title=${color}
|
|
2557
|
+
aria-pressed=${this.activeFormats.activeColor === color ? "true" : "false"}
|
|
2558
|
+
aria-label="Color ${color}"
|
|
2559
|
+
@click=${(e) => {
|
|
2541
2560
|
e.stopPropagation();
|
|
2542
2561
|
this.selectColor(color);
|
|
2543
2562
|
this.isColorDropdownOpen = false;
|
|
2544
2563
|
}}
|
|
2545
|
-
|
|
2546
|
-
|
|
2564
|
+
></button>
|
|
2565
|
+
`
|
|
2547
2566
|
)}
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2567
|
+
</div>
|
|
2568
|
+
</lukso-dropdown>
|
|
2569
|
+
</div>
|
|
2570
|
+
` : E}
|
|
2551
2571
|
|
|
2552
|
-
|
|
2572
|
+
<!-- Divider -->
|
|
2573
|
+
${this.toolsState.length > 0 ? x`<div class=${this.styles().divider()}></div>` : E}
|
|
2553
2574
|
</div>
|
|
2554
2575
|
`;
|
|
2555
2576
|
}
|
|
@@ -2594,6 +2615,17 @@ ${indent}${nextNumber}. `;
|
|
|
2594
2615
|
if (!this.previewTextColor) {
|
|
2595
2616
|
this.previewTextColor = DEFAULT_PREVIEW_TEXT_COLOR;
|
|
2596
2617
|
}
|
|
2618
|
+
this.toolsState = this.defaultTools;
|
|
2619
|
+
try {
|
|
2620
|
+
if (this.tools) {
|
|
2621
|
+
this.toolsState = JSON.parse(this.tools);
|
|
2622
|
+
}
|
|
2623
|
+
} catch (error) {
|
|
2624
|
+
console.warn(
|
|
2625
|
+
"Invalid JSON for tools property in lukso-markdown-editor. Using default tools.",
|
|
2626
|
+
error
|
|
2627
|
+
);
|
|
2628
|
+
}
|
|
2597
2629
|
return x`
|
|
2598
2630
|
<div class=${wrapper()}>
|
|
2599
2631
|
${this.labelTemplate()} ${this.descriptionTemplate()}
|
|
@@ -2633,6 +2665,7 @@ ${indent}${nextNumber}. `;
|
|
|
2633
2665
|
>
|
|
2634
2666
|
<lukso-markdown
|
|
2635
2667
|
value=${this.value}
|
|
2668
|
+
?strip-html-tags=${this.stripHtmlTags}
|
|
2636
2669
|
custom-style=${`color: ${this.previewTextColor};`}
|
|
2637
2670
|
></lukso-markdown>
|
|
2638
2671
|
${this.accessibilityIndicatorTemplate()}
|
|
@@ -2695,6 +2728,15 @@ __decorateClass([
|
|
|
2695
2728
|
__decorateClass([
|
|
2696
2729
|
n({ type: String, attribute: "preview-text-color", reflect: true })
|
|
2697
2730
|
], LuksoMarkdownEditor.prototype, "previewTextColor", 2);
|
|
2731
|
+
__decorateClass([
|
|
2732
|
+
n({ type: Boolean, attribute: "strip-html-tags" })
|
|
2733
|
+
], LuksoMarkdownEditor.prototype, "stripHtmlTags", 2);
|
|
2734
|
+
__decorateClass([
|
|
2735
|
+
n({ type: String })
|
|
2736
|
+
], LuksoMarkdownEditor.prototype, "tools", 2);
|
|
2737
|
+
__decorateClass([
|
|
2738
|
+
r()
|
|
2739
|
+
], LuksoMarkdownEditor.prototype, "toolsState", 2);
|
|
2698
2740
|
__decorateClass([
|
|
2699
2741
|
r()
|
|
2700
2742
|
], LuksoMarkdownEditor.prototype, "savedSelectionForPreview", 2);
|