inline-style-editor 1.2.10 → 1.2.12
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/README.md +1 -0
- package/dist/inline-style-editor.js +2 -2
- package/dist/inline-style-editor.js.map +1 -1
- package/dist/inline-style-editor.mjs +45 -31
- package/dist/inline-style-editor.mjs.map +1 -1
- package/docs/index.html +1 -1
- package/package.json +2 -1
- package/src/components/InlineStyleEditor.svelte +15 -8
- package/stats.html +19 -1
- package/test.html +1 -1
|
@@ -2027,8 +2027,7 @@ function listFonts() {
|
|
|
2027
2027
|
|
|
2028
2028
|
function get_each_context(ctx, list, i) {
|
|
2029
2029
|
const child_ctx = ctx.slice();
|
|
2030
|
-
child_ctx[
|
|
2031
|
-
child_ctx[62] = list[i][1];
|
|
2030
|
+
child_ctx[62] = list[i];
|
|
2032
2031
|
child_ctx[64] = list;
|
|
2033
2032
|
child_ctx[65] = i;
|
|
2034
2033
|
const constants_0 = /*choices*/ child_ctx[62].props[/*choices*/ child_ctx[62].selected];
|
|
@@ -2077,7 +2076,7 @@ function get_each_context_5(ctx, list, i) {
|
|
|
2077
2076
|
return child_ctx;
|
|
2078
2077
|
}
|
|
2079
2078
|
|
|
2080
|
-
// (
|
|
2079
|
+
// (403:4) {#if targetsToSearch.length > 1}
|
|
2081
2080
|
function create_if_block_8(ctx) {
|
|
2082
2081
|
let div;
|
|
2083
2082
|
let b;
|
|
@@ -2142,7 +2141,7 @@ function create_if_block_8(ctx) {
|
|
|
2142
2141
|
};
|
|
2143
2142
|
}
|
|
2144
2143
|
|
|
2145
|
-
// (
|
|
2144
|
+
// (406:8) {#each targetsToSearch as target, elemIndex}
|
|
2146
2145
|
function create_each_block_5(ctx) {
|
|
2147
2146
|
let span;
|
|
2148
2147
|
let t0;
|
|
@@ -2189,7 +2188,7 @@ function create_each_block_5(ctx) {
|
|
|
2189
2188
|
};
|
|
2190
2189
|
}
|
|
2191
2190
|
|
|
2192
|
-
// (
|
|
2191
|
+
// (415:8) {#each getRuleNames(allRules[selectedElemIndex]) as ruleName, ruleIndex}
|
|
2193
2192
|
function create_each_block_4(ctx) {
|
|
2194
2193
|
let span;
|
|
2195
2194
|
let t_value = /*ruleName*/ ctx[75] + "";
|
|
@@ -2238,7 +2237,7 @@ function create_each_block_4(ctx) {
|
|
|
2238
2237
|
};
|
|
2239
2238
|
}
|
|
2240
2239
|
|
|
2241
|
-
// (
|
|
2240
|
+
// (426:12) {#if type !== 'custom' || (currentRule === 'inline' && type === 'custom' && hasDisplayedCustom )}
|
|
2242
2241
|
function create_if_block_7(ctx) {
|
|
2243
2242
|
let span;
|
|
2244
2243
|
let t0_value = /*type*/ ctx[72] + "";
|
|
@@ -2284,7 +2283,7 @@ function create_if_block_7(ctx) {
|
|
|
2284
2283
|
};
|
|
2285
2284
|
}
|
|
2286
2285
|
|
|
2287
|
-
// (
|
|
2286
|
+
// (424:8) {#each allTypes[selectedElemIndex] || [] as type, typeIndex}
|
|
2288
2287
|
function create_each_block_3(ctx) {
|
|
2289
2288
|
let if_block_anchor;
|
|
2290
2289
|
let if_block = (/*type*/ ctx[72] !== 'custom' || /*currentRule*/ ctx[16] === 'inline' && /*type*/ ctx[72] === 'custom' && /*hasDisplayedCustom*/ ctx[15]) && create_if_block_7(ctx);
|
|
@@ -2319,12 +2318,12 @@ function create_each_block_3(ctx) {
|
|
|
2319
2318
|
};
|
|
2320
2319
|
}
|
|
2321
2320
|
|
|
2322
|
-
// (
|
|
2321
|
+
// (431:4) {#if allTypes[selectedElemIndex]}
|
|
2323
2322
|
function create_if_block(ctx) {
|
|
2324
2323
|
let div;
|
|
2325
2324
|
let t;
|
|
2326
2325
|
let current;
|
|
2327
|
-
let each_value =
|
|
2326
|
+
let each_value = /*propsByType*/ ctx[12];
|
|
2328
2327
|
let each_blocks = [];
|
|
2329
2328
|
|
|
2330
2329
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -2362,7 +2361,7 @@ function create_if_block(ctx) {
|
|
|
2362
2361
|
},
|
|
2363
2362
|
p(ctx, dirty) {
|
|
2364
2363
|
if (dirty[0] & /*allCurrentPropDefs, propsByType, updateProp, deleteProp*/ 1323008) {
|
|
2365
|
-
each_value =
|
|
2364
|
+
each_value = /*propsByType*/ ctx[12];
|
|
2366
2365
|
let i;
|
|
2367
2366
|
|
|
2368
2367
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -2427,7 +2426,7 @@ function create_if_block(ctx) {
|
|
|
2427
2426
|
};
|
|
2428
2427
|
}
|
|
2429
2428
|
|
|
2430
|
-
// (
|
|
2429
|
+
// (442:16) {:else}
|
|
2431
2430
|
function create_else_block(ctx) {
|
|
2432
2431
|
let span;
|
|
2433
2432
|
let t_value = /*selectedName*/ ctx[63] + "";
|
|
@@ -2451,7 +2450,7 @@ function create_else_block(ctx) {
|
|
|
2451
2450
|
};
|
|
2452
2451
|
}
|
|
2453
2452
|
|
|
2454
|
-
// (
|
|
2453
|
+
// (436:16) {#if choices.props.length > 1}
|
|
2455
2454
|
function create_if_block_6(ctx) {
|
|
2456
2455
|
let div;
|
|
2457
2456
|
let select;
|
|
@@ -2465,7 +2464,7 @@ function create_if_block_6(ctx) {
|
|
|
2465
2464
|
}
|
|
2466
2465
|
|
|
2467
2466
|
function change_handler(...args) {
|
|
2468
|
-
return /*change_handler*/ ctx[35](/*choices*/ ctx[62], /*each_value*/ ctx[64], /*
|
|
2467
|
+
return /*change_handler*/ ctx[35](/*choices*/ ctx[62], /*each_value*/ ctx[64], /*choices_index*/ ctx[65], ...args);
|
|
2469
2468
|
}
|
|
2470
2469
|
|
|
2471
2470
|
return {
|
|
@@ -2525,7 +2524,7 @@ function create_if_block_6(ctx) {
|
|
|
2525
2524
|
};
|
|
2526
2525
|
}
|
|
2527
2526
|
|
|
2528
|
-
// (
|
|
2527
|
+
// (438:24) {#each choices.props as propName, i}
|
|
2529
2528
|
function create_each_block_2(ctx) {
|
|
2530
2529
|
let option;
|
|
2531
2530
|
let t0_value = /*propName*/ ctx[69] + "";
|
|
@@ -2560,7 +2559,7 @@ function create_each_block_2(ctx) {
|
|
|
2560
2559
|
};
|
|
2561
2560
|
}
|
|
2562
2561
|
|
|
2563
|
-
// (
|
|
2562
|
+
// (465:50)
|
|
2564
2563
|
function create_if_block_5(ctx) {
|
|
2565
2564
|
let colorpicker;
|
|
2566
2565
|
let current;
|
|
@@ -2606,7 +2605,7 @@ function create_if_block_5(ctx) {
|
|
|
2606
2605
|
};
|
|
2607
2606
|
}
|
|
2608
2607
|
|
|
2609
|
-
// (
|
|
2608
|
+
// (455:51)
|
|
2610
2609
|
function create_if_block_3(ctx) {
|
|
2611
2610
|
let select;
|
|
2612
2611
|
let show_if = !/*choices*/ ctx[62].includes(/*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value);
|
|
@@ -2699,7 +2698,7 @@ function create_if_block_3(ctx) {
|
|
|
2699
2698
|
};
|
|
2700
2699
|
}
|
|
2701
2700
|
|
|
2702
|
-
// (
|
|
2701
|
+
// (446:16) {#if choices.type === 'slider'}
|
|
2703
2702
|
function create_if_block_2(ctx) {
|
|
2704
2703
|
let input;
|
|
2705
2704
|
let input_min_value;
|
|
@@ -2774,7 +2773,7 @@ function create_if_block_2(ctx) {
|
|
|
2774
2773
|
};
|
|
2775
2774
|
}
|
|
2776
2775
|
|
|
2777
|
-
// (
|
|
2776
|
+
// (458:24) {#if !choices.includes(allCurrentPropDefs[selectedName].value)}
|
|
2778
2777
|
function create_if_block_4(ctx) {
|
|
2779
2778
|
let option;
|
|
2780
2779
|
|
|
@@ -2795,7 +2794,7 @@ function create_if_block_4(ctx) {
|
|
|
2795
2794
|
};
|
|
2796
2795
|
}
|
|
2797
2796
|
|
|
2798
|
-
// (
|
|
2797
|
+
// (461:24) {#each choices as choice}
|
|
2799
2798
|
function create_each_block_1(ctx) {
|
|
2800
2799
|
let option;
|
|
2801
2800
|
let t_value = /*choice*/ ctx[66] + "";
|
|
@@ -2833,7 +2832,7 @@ function create_each_block_1(ctx) {
|
|
|
2833
2832
|
};
|
|
2834
2833
|
}
|
|
2835
2834
|
|
|
2836
|
-
// (
|
|
2835
|
+
// (433:8) {#each propsByType as choices}
|
|
2837
2836
|
function create_each_block(ctx) {
|
|
2838
2837
|
let div;
|
|
2839
2838
|
let t0;
|
|
@@ -2861,9 +2860,9 @@ function create_each_block(ctx) {
|
|
|
2861
2860
|
const if_blocks = [];
|
|
2862
2861
|
|
|
2863
2862
|
function select_block_type_1(ctx, dirty) {
|
|
2864
|
-
if (/*
|
|
2865
|
-
if (/*
|
|
2866
|
-
if (/*
|
|
2863
|
+
if (/*choices*/ ctx[62].type === 'slider') return 0;
|
|
2864
|
+
if (/*choices*/ ctx[62].type == 'select') return 1;
|
|
2865
|
+
if (/*choices*/ ctx[62].type == 'color') return 2;
|
|
2867
2866
|
return -1;
|
|
2868
2867
|
}
|
|
2869
2868
|
|
|
@@ -2979,7 +2978,7 @@ function create_each_block(ctx) {
|
|
|
2979
2978
|
};
|
|
2980
2979
|
}
|
|
2981
2980
|
|
|
2982
|
-
// (
|
|
2981
|
+
// (473:8) {#if currentRule === 'inline' && bringableToFront[selectedElemIndex] !== null}
|
|
2983
2982
|
function create_if_block_1(ctx) {
|
|
2984
2983
|
let div;
|
|
2985
2984
|
let mounted;
|
|
@@ -3358,7 +3357,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3358
3357
|
const borderProps = ["border-radius", "border-width", "border-color", "border-style"];
|
|
3359
3358
|
const backgroundProps = ["background-color"];
|
|
3360
3359
|
const fontProps = ["font-family", "font-size", "font-weight", "color"];
|
|
3361
|
-
const pathProps = ["stroke-width", "stroke", "stroke-dasharray", "fill"];
|
|
3360
|
+
const pathProps = ["stroke-width", "stroke", "stroke-dasharray", "stroke-linejoin", "fill"];
|
|
3362
3361
|
|
|
3363
3362
|
const cssPropByType = {
|
|
3364
3363
|
"border-radius": {
|
|
@@ -3405,6 +3404,10 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3405
3404
|
suffix: 'px'
|
|
3406
3405
|
},
|
|
3407
3406
|
'stroke': { type: "color" },
|
|
3407
|
+
"stroke-linejoin": {
|
|
3408
|
+
type: 'select',
|
|
3409
|
+
choices: () => ["bevel", "miter", "round"]
|
|
3410
|
+
},
|
|
3408
3411
|
'fill': { type: "color" },
|
|
3409
3412
|
"stroke-dasharray": {
|
|
3410
3413
|
type: "slider",
|
|
@@ -3435,6 +3438,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3435
3438
|
[customType]: Object.keys(customProps)
|
|
3436
3439
|
};
|
|
3437
3440
|
|
|
3441
|
+
const inputTypeOrder = { slider: 0, select: 1, color: 2 };
|
|
3438
3442
|
let elementToListen = null;
|
|
3439
3443
|
let positionAnchor;
|
|
3440
3444
|
let self;
|
|
@@ -3509,14 +3513,24 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3509
3513
|
$$invalidate(12, propsByType = Object.entries(_allCurrentPropDefs).reduce(
|
|
3510
3514
|
(byType, [propName, selectorDef]) => {
|
|
3511
3515
|
const selectorType = selectorDef.type;
|
|
3512
|
-
|
|
3516
|
+
const existing = byType.find(x => x.type === selectorType);
|
|
3517
|
+
|
|
3518
|
+
if (!existing) byType.push({
|
|
3519
|
+
selected: 0,
|
|
3520
|
+
props: [propName],
|
|
3521
|
+
type: selectorType
|
|
3522
|
+
}); else existing.props.push(propName);
|
|
3523
|
+
|
|
3513
3524
|
return byType;
|
|
3514
3525
|
},
|
|
3515
|
-
|
|
3516
|
-
))
|
|
3526
|
+
[]
|
|
3527
|
+
).sort((a, b) => {
|
|
3528
|
+
if (inputTypeOrder[a.type] < inputTypeOrder[b.type]) return -1;
|
|
3529
|
+
if (inputTypeOrder[a.type] > inputTypeOrder[b.type]) return 1;
|
|
3530
|
+
return 0;
|
|
3531
|
+
}));
|
|
3517
3532
|
|
|
3518
3533
|
$$invalidate(13, allCurrentPropDefs = _allCurrentPropDefs);
|
|
3519
|
-
console.log(JSON.parse(JSON.stringify(allCurrentPropDefs)));
|
|
3520
3534
|
updateHelpers();
|
|
3521
3535
|
}
|
|
3522
3536
|
|
|
@@ -3775,8 +3789,8 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3775
3789
|
$$invalidate(6, selectedTypeIndex = typeIndex);
|
|
3776
3790
|
};
|
|
3777
3791
|
|
|
3778
|
-
const change_handler = async (choices, each_value,
|
|
3779
|
-
$$invalidate(12, each_value[
|
|
3792
|
+
const change_handler = async (choices, each_value, choices_index, e) => {
|
|
3793
|
+
$$invalidate(12, each_value[choices_index].selected = e.target.value, propsByType);
|
|
3780
3794
|
await tick();
|
|
3781
3795
|
};
|
|
3782
3796
|
|