inline-style-editor 1.1.3 → 1.2.1
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/inline-style-editor.css +1 -1
- package/dist/inline-style-editor.js +2 -2
- package/dist/inline-style-editor.js.map +1 -1
- package/dist/inline-style-editor.mjs +255 -194
- package/dist/inline-style-editor.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/style.scss +6 -0
- package/src/components/ColorPicker.svelte +1 -1
- package/src/components/InlineStyleEditor.svelte +57 -40
- package/src/util/fonts.js +21 -1
- package/src/util/path.js +0 -1
- package/src/util/util.js +0 -2
- package/stats.html +1 -1
- package/test.html +14 -19
- package/.vscode/launch.json +0 -14
|
@@ -1914,7 +1914,7 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
|
|
1916
1916
|
function _onChange(color) {
|
|
1917
|
-
setValue(color.
|
|
1917
|
+
setValue(color.hex);
|
|
1918
1918
|
}
|
|
1919
1919
|
|
|
1920
1920
|
onMount(() => {
|
|
@@ -2000,57 +2000,77 @@ function getFonts() {
|
|
|
2000
2000
|
}
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
2003
|
-
return [...availableFonts.values()]
|
|
2003
|
+
return [...listFonts(), ...availableFonts.values()]
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
function listFonts() {
|
|
2007
|
+
let { fonts } = document;
|
|
2008
|
+
const it = fonts.entries();
|
|
2009
|
+
|
|
2010
|
+
let arr = [];
|
|
2011
|
+
let done = false;
|
|
2012
|
+
|
|
2013
|
+
while (!done) {
|
|
2014
|
+
const font = it.next();
|
|
2015
|
+
if (!font.done) {
|
|
2016
|
+
arr.push(font.value[0].family);
|
|
2017
|
+
} else {
|
|
2018
|
+
done = font.done;
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
// converted to set then arr to filter repetitive values
|
|
2023
|
+
return [...new Set(arr)];
|
|
2004
2024
|
}
|
|
2005
2025
|
|
|
2006
2026
|
/* src/components/InlineStyleEditor.svelte generated by Svelte v3.49.0 */
|
|
2007
2027
|
|
|
2008
2028
|
function get_each_context(ctx, list, i) {
|
|
2009
2029
|
const child_ctx = ctx.slice();
|
|
2010
|
-
child_ctx[
|
|
2011
|
-
child_ctx[
|
|
2012
|
-
child_ctx[
|
|
2013
|
-
child_ctx[
|
|
2014
|
-
const constants_0 = /*choices*/ child_ctx[
|
|
2015
|
-
child_ctx[
|
|
2030
|
+
child_ctx[61] = list[i][0];
|
|
2031
|
+
child_ctx[62] = list[i][1];
|
|
2032
|
+
child_ctx[64] = list;
|
|
2033
|
+
child_ctx[65] = i;
|
|
2034
|
+
const constants_0 = /*choices*/ child_ctx[62].props[/*choices*/ child_ctx[62].selected];
|
|
2035
|
+
child_ctx[63] = constants_0;
|
|
2016
2036
|
return child_ctx;
|
|
2017
2037
|
}
|
|
2018
2038
|
|
|
2019
2039
|
function get_each_context_1(ctx, list, i) {
|
|
2020
2040
|
const child_ctx = ctx.slice();
|
|
2021
|
-
child_ctx[
|
|
2041
|
+
child_ctx[66] = list[i];
|
|
2022
2042
|
return child_ctx;
|
|
2023
2043
|
}
|
|
2024
2044
|
|
|
2025
2045
|
function get_each_context_2(ctx, list, i) {
|
|
2026
2046
|
const child_ctx = ctx.slice();
|
|
2027
|
-
child_ctx[
|
|
2028
|
-
child_ctx[
|
|
2047
|
+
child_ctx[69] = list[i];
|
|
2048
|
+
child_ctx[71] = i;
|
|
2029
2049
|
return child_ctx;
|
|
2030
2050
|
}
|
|
2031
2051
|
|
|
2032
2052
|
function get_each_context_3(ctx, list, i) {
|
|
2033
2053
|
const child_ctx = ctx.slice();
|
|
2034
|
-
child_ctx[
|
|
2035
|
-
child_ctx[
|
|
2054
|
+
child_ctx[72] = list[i];
|
|
2055
|
+
child_ctx[74] = i;
|
|
2036
2056
|
return child_ctx;
|
|
2037
2057
|
}
|
|
2038
2058
|
|
|
2039
2059
|
function get_each_context_4(ctx, list, i) {
|
|
2040
2060
|
const child_ctx = ctx.slice();
|
|
2041
|
-
child_ctx[
|
|
2042
|
-
child_ctx[
|
|
2061
|
+
child_ctx[75] = list[i];
|
|
2062
|
+
child_ctx[77] = i;
|
|
2043
2063
|
return child_ctx;
|
|
2044
2064
|
}
|
|
2045
2065
|
|
|
2046
2066
|
function get_each_context_5(ctx, list, i) {
|
|
2047
2067
|
const child_ctx = ctx.slice();
|
|
2048
|
-
child_ctx[
|
|
2049
|
-
child_ctx[
|
|
2068
|
+
child_ctx[78] = list[i];
|
|
2069
|
+
child_ctx[80] = i;
|
|
2050
2070
|
return child_ctx;
|
|
2051
2071
|
}
|
|
2052
2072
|
|
|
2053
|
-
// (
|
|
2073
|
+
// (387:4) {#if targetsToSearch.length > 1}
|
|
2054
2074
|
function create_if_block_7(ctx) {
|
|
2055
2075
|
let div;
|
|
2056
2076
|
let b;
|
|
@@ -2115,7 +2135,7 @@ function create_if_block_7(ctx) {
|
|
|
2115
2135
|
};
|
|
2116
2136
|
}
|
|
2117
2137
|
|
|
2118
|
-
// (
|
|
2138
|
+
// (390:8) {#each targetsToSearch as target, elemIndex}
|
|
2119
2139
|
function create_each_block_5(ctx) {
|
|
2120
2140
|
let span;
|
|
2121
2141
|
let t0;
|
|
@@ -2125,16 +2145,16 @@ function create_each_block_5(ctx) {
|
|
|
2125
2145
|
let dispose;
|
|
2126
2146
|
|
|
2127
2147
|
function click_handler() {
|
|
2128
|
-
return /*click_handler*/ ctx[32](/*elemIndex*/ ctx[
|
|
2148
|
+
return /*click_handler*/ ctx[32](/*elemIndex*/ ctx[80]);
|
|
2129
2149
|
}
|
|
2130
2150
|
|
|
2131
2151
|
return {
|
|
2132
2152
|
c() {
|
|
2133
2153
|
span = element("span");
|
|
2134
2154
|
t0 = text("Elem ");
|
|
2135
|
-
t1 = text(/*elemIndex*/ ctx[
|
|
2155
|
+
t1 = text(/*elemIndex*/ ctx[80]);
|
|
2136
2156
|
t2 = space();
|
|
2137
|
-
toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[
|
|
2157
|
+
toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[80]);
|
|
2138
2158
|
},
|
|
2139
2159
|
m(target, anchor) {
|
|
2140
2160
|
insert(target, span, anchor);
|
|
@@ -2151,7 +2171,7 @@ function create_each_block_5(ctx) {
|
|
|
2151
2171
|
ctx = new_ctx;
|
|
2152
2172
|
|
|
2153
2173
|
if (dirty[0] & /*selectedElemIndex*/ 16) {
|
|
2154
|
-
toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[
|
|
2174
|
+
toggle_class(span, "selected", /*selectedElemIndex*/ ctx[4] === /*elemIndex*/ ctx[80]);
|
|
2155
2175
|
}
|
|
2156
2176
|
},
|
|
2157
2177
|
d(detaching) {
|
|
@@ -2162,25 +2182,25 @@ function create_each_block_5(ctx) {
|
|
|
2162
2182
|
};
|
|
2163
2183
|
}
|
|
2164
2184
|
|
|
2165
|
-
// (
|
|
2185
|
+
// (399:8) {#each getRuleNames(allRules[selectedElemIndex]) as ruleName, ruleIndex}
|
|
2166
2186
|
function create_each_block_4(ctx) {
|
|
2167
2187
|
let span;
|
|
2168
|
-
let t_value = /*ruleName*/ ctx[
|
|
2188
|
+
let t_value = /*ruleName*/ ctx[75] + "";
|
|
2169
2189
|
let t;
|
|
2170
2190
|
let span_title_value;
|
|
2171
2191
|
let mounted;
|
|
2172
2192
|
let dispose;
|
|
2173
2193
|
|
|
2174
2194
|
function click_handler_1() {
|
|
2175
|
-
return /*click_handler_1*/ ctx[33](/*ruleIndex*/ ctx[
|
|
2195
|
+
return /*click_handler_1*/ ctx[33](/*ruleIndex*/ ctx[77]);
|
|
2176
2196
|
}
|
|
2177
2197
|
|
|
2178
2198
|
return {
|
|
2179
2199
|
c() {
|
|
2180
2200
|
span = element("span");
|
|
2181
2201
|
t = text(t_value);
|
|
2182
|
-
attr(span, "title", span_title_value = /*ruleName*/ ctx[
|
|
2183
|
-
toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[
|
|
2202
|
+
attr(span, "title", span_title_value = /*ruleName*/ ctx[75]);
|
|
2203
|
+
toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[77]);
|
|
2184
2204
|
},
|
|
2185
2205
|
m(target, anchor) {
|
|
2186
2206
|
insert(target, span, anchor);
|
|
@@ -2193,14 +2213,14 @@ function create_each_block_4(ctx) {
|
|
|
2193
2213
|
},
|
|
2194
2214
|
p(new_ctx, dirty) {
|
|
2195
2215
|
ctx = new_ctx;
|
|
2196
|
-
if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && t_value !== (t_value = /*ruleName*/ ctx[
|
|
2216
|
+
if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && t_value !== (t_value = /*ruleName*/ ctx[75] + "")) set_data(t, t_value);
|
|
2197
2217
|
|
|
2198
|
-
if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && span_title_value !== (span_title_value = /*ruleName*/ ctx[
|
|
2218
|
+
if (dirty[0] & /*allRules, selectedElemIndex*/ 20 && span_title_value !== (span_title_value = /*ruleName*/ ctx[75])) {
|
|
2199
2219
|
attr(span, "title", span_title_value);
|
|
2200
2220
|
}
|
|
2201
2221
|
|
|
2202
2222
|
if (dirty[0] & /*selectedRuleIndex*/ 32) {
|
|
2203
|
-
toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[
|
|
2223
|
+
toggle_class(span, "selected", /*selectedRuleIndex*/ ctx[5] === /*ruleIndex*/ ctx[77]);
|
|
2204
2224
|
}
|
|
2205
2225
|
},
|
|
2206
2226
|
d(detaching) {
|
|
@@ -2211,17 +2231,17 @@ function create_each_block_4(ctx) {
|
|
|
2211
2231
|
};
|
|
2212
2232
|
}
|
|
2213
2233
|
|
|
2214
|
-
// (
|
|
2234
|
+
// (410:12) {#if type !== 'custom' || (currentRule === 'inline' && type === 'custom' && hasDisplayedCustom )}
|
|
2215
2235
|
function create_if_block_6(ctx) {
|
|
2216
2236
|
let span;
|
|
2217
|
-
let t0_value = /*type*/ ctx[
|
|
2237
|
+
let t0_value = /*type*/ ctx[72] + "";
|
|
2218
2238
|
let t0;
|
|
2219
2239
|
let t1;
|
|
2220
2240
|
let mounted;
|
|
2221
2241
|
let dispose;
|
|
2222
2242
|
|
|
2223
2243
|
function click_handler_2() {
|
|
2224
|
-
return /*click_handler_2*/ ctx[34](/*typeIndex*/ ctx[
|
|
2244
|
+
return /*click_handler_2*/ ctx[34](/*typeIndex*/ ctx[74]);
|
|
2225
2245
|
}
|
|
2226
2246
|
|
|
2227
2247
|
return {
|
|
@@ -2229,7 +2249,7 @@ function create_if_block_6(ctx) {
|
|
|
2229
2249
|
span = element("span");
|
|
2230
2250
|
t0 = text(t0_value);
|
|
2231
2251
|
t1 = space();
|
|
2232
|
-
toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[
|
|
2252
|
+
toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[74]);
|
|
2233
2253
|
},
|
|
2234
2254
|
m(target, anchor) {
|
|
2235
2255
|
insert(target, span, anchor);
|
|
@@ -2243,10 +2263,10 @@ function create_if_block_6(ctx) {
|
|
|
2243
2263
|
},
|
|
2244
2264
|
p(new_ctx, dirty) {
|
|
2245
2265
|
ctx = new_ctx;
|
|
2246
|
-
if (dirty[0] & /*allTypes, selectedElemIndex*/ 24 && t0_value !== (t0_value = /*type*/ ctx[
|
|
2266
|
+
if (dirty[0] & /*allTypes, selectedElemIndex*/ 24 && t0_value !== (t0_value = /*type*/ ctx[72] + "")) set_data(t0, t0_value);
|
|
2247
2267
|
|
|
2248
2268
|
if (dirty[0] & /*selectedTypeIndex*/ 64) {
|
|
2249
|
-
toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[
|
|
2269
|
+
toggle_class(span, "selected", /*selectedTypeIndex*/ ctx[6] === /*typeIndex*/ ctx[74]);
|
|
2250
2270
|
}
|
|
2251
2271
|
},
|
|
2252
2272
|
d(detaching) {
|
|
@@ -2257,10 +2277,10 @@ function create_if_block_6(ctx) {
|
|
|
2257
2277
|
};
|
|
2258
2278
|
}
|
|
2259
2279
|
|
|
2260
|
-
// (
|
|
2280
|
+
// (408:8) {#each allTypes[selectedElemIndex] || [] as type, typeIndex}
|
|
2261
2281
|
function create_each_block_3(ctx) {
|
|
2262
2282
|
let if_block_anchor;
|
|
2263
|
-
let if_block = (/*type*/ ctx[
|
|
2283
|
+
let if_block = (/*type*/ ctx[72] !== 'custom' || /*currentRule*/ ctx[16] === 'inline' && /*type*/ ctx[72] === 'custom' && /*hasDisplayedCustom*/ ctx[15]) && create_if_block_6(ctx);
|
|
2264
2284
|
|
|
2265
2285
|
return {
|
|
2266
2286
|
c() {
|
|
@@ -2272,7 +2292,7 @@ function create_each_block_3(ctx) {
|
|
|
2272
2292
|
insert(target, if_block_anchor, anchor);
|
|
2273
2293
|
},
|
|
2274
2294
|
p(ctx, dirty) {
|
|
2275
|
-
if (/*type*/ ctx[
|
|
2295
|
+
if (/*type*/ ctx[72] !== 'custom' || /*currentRule*/ ctx[16] === 'inline' && /*type*/ ctx[72] === 'custom' && /*hasDisplayedCustom*/ ctx[15]) {
|
|
2276
2296
|
if (if_block) {
|
|
2277
2297
|
if_block.p(ctx, dirty);
|
|
2278
2298
|
} else {
|
|
@@ -2292,12 +2312,12 @@ function create_each_block_3(ctx) {
|
|
|
2292
2312
|
};
|
|
2293
2313
|
}
|
|
2294
2314
|
|
|
2295
|
-
// (
|
|
2315
|
+
// (415:4) {#if allTypes[selectedElemIndex]}
|
|
2296
2316
|
function create_if_block(ctx) {
|
|
2297
2317
|
let div;
|
|
2298
2318
|
let t;
|
|
2299
2319
|
let current;
|
|
2300
|
-
let each_value = Object.entries(/*propsByType*/ ctx[
|
|
2320
|
+
let each_value = Object.entries(/*propsByType*/ ctx[12]);
|
|
2301
2321
|
let each_blocks = [];
|
|
2302
2322
|
|
|
2303
2323
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -2308,7 +2328,7 @@ function create_if_block(ctx) {
|
|
|
2308
2328
|
each_blocks[i] = null;
|
|
2309
2329
|
});
|
|
2310
2330
|
|
|
2311
|
-
let if_block = /*currentRule*/ ctx[
|
|
2331
|
+
let if_block = /*currentRule*/ ctx[16] === 'inline' && /*bringableToFront*/ ctx[14][/*selectedElemIndex*/ ctx[4]] !== null && create_if_block_1(ctx);
|
|
2312
2332
|
|
|
2313
2333
|
return {
|
|
2314
2334
|
c() {
|
|
@@ -2334,8 +2354,8 @@ function create_if_block(ctx) {
|
|
|
2334
2354
|
current = true;
|
|
2335
2355
|
},
|
|
2336
2356
|
p(ctx, dirty) {
|
|
2337
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType, updateProp*/
|
|
2338
|
-
each_value = Object.entries(/*propsByType*/ ctx[
|
|
2357
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType, updateProp, deleteProp*/ 1323008) {
|
|
2358
|
+
each_value = Object.entries(/*propsByType*/ ctx[12]);
|
|
2339
2359
|
let i;
|
|
2340
2360
|
|
|
2341
2361
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -2361,7 +2381,7 @@ function create_if_block(ctx) {
|
|
|
2361
2381
|
check_outros();
|
|
2362
2382
|
}
|
|
2363
2383
|
|
|
2364
|
-
if (/*currentRule*/ ctx[
|
|
2384
|
+
if (/*currentRule*/ ctx[16] === 'inline' && /*bringableToFront*/ ctx[14][/*selectedElemIndex*/ ctx[4]] !== null) {
|
|
2365
2385
|
if (if_block) {
|
|
2366
2386
|
if_block.p(ctx, dirty);
|
|
2367
2387
|
} else {
|
|
@@ -2400,10 +2420,10 @@ function create_if_block(ctx) {
|
|
|
2400
2420
|
};
|
|
2401
2421
|
}
|
|
2402
2422
|
|
|
2403
|
-
// (
|
|
2423
|
+
// (426:16) {:else}
|
|
2404
2424
|
function create_else_block(ctx) {
|
|
2405
2425
|
let span;
|
|
2406
|
-
let t_value = /*selectedName*/ ctx[
|
|
2426
|
+
let t_value = /*selectedName*/ ctx[63] + "";
|
|
2407
2427
|
let t;
|
|
2408
2428
|
|
|
2409
2429
|
return {
|
|
@@ -2416,7 +2436,7 @@ function create_else_block(ctx) {
|
|
|
2416
2436
|
append(span, t);
|
|
2417
2437
|
},
|
|
2418
2438
|
p(ctx, dirty) {
|
|
2419
|
-
if (dirty[0] & /*propsByType*/
|
|
2439
|
+
if (dirty[0] & /*propsByType*/ 4096 && t_value !== (t_value = /*selectedName*/ ctx[63] + "")) set_data(t, t_value);
|
|
2420
2440
|
},
|
|
2421
2441
|
d(detaching) {
|
|
2422
2442
|
if (detaching) detach(span);
|
|
@@ -2424,13 +2444,13 @@ function create_else_block(ctx) {
|
|
|
2424
2444
|
};
|
|
2425
2445
|
}
|
|
2426
2446
|
|
|
2427
|
-
// (
|
|
2447
|
+
// (420:16) {#if choices.props.length > 1}
|
|
2428
2448
|
function create_if_block_5(ctx) {
|
|
2429
2449
|
let div;
|
|
2430
2450
|
let select;
|
|
2431
2451
|
let mounted;
|
|
2432
2452
|
let dispose;
|
|
2433
|
-
let each_value_2 = /*choices*/ ctx[
|
|
2453
|
+
let each_value_2 = /*choices*/ ctx[62].props;
|
|
2434
2454
|
let each_blocks = [];
|
|
2435
2455
|
|
|
2436
2456
|
for (let i = 0; i < each_value_2.length; i += 1) {
|
|
@@ -2438,7 +2458,7 @@ function create_if_block_5(ctx) {
|
|
|
2438
2458
|
}
|
|
2439
2459
|
|
|
2440
2460
|
function change_handler(...args) {
|
|
2441
|
-
return /*change_handler*/ ctx[35](/*choices*/ ctx[
|
|
2461
|
+
return /*change_handler*/ ctx[35](/*choices*/ ctx[62], /*each_value*/ ctx[64], /*each_index*/ ctx[65], ...args);
|
|
2442
2462
|
}
|
|
2443
2463
|
|
|
2444
2464
|
return {
|
|
@@ -2466,8 +2486,8 @@ function create_if_block_5(ctx) {
|
|
|
2466
2486
|
p(new_ctx, dirty) {
|
|
2467
2487
|
ctx = new_ctx;
|
|
2468
2488
|
|
|
2469
|
-
if (dirty[0] & /*propsByType*/
|
|
2470
|
-
each_value_2 = /*choices*/ ctx[
|
|
2489
|
+
if (dirty[0] & /*propsByType*/ 4096) {
|
|
2490
|
+
each_value_2 = /*choices*/ ctx[62].props;
|
|
2471
2491
|
let i;
|
|
2472
2492
|
|
|
2473
2493
|
for (i = 0; i < each_value_2.length; i += 1) {
|
|
@@ -2498,10 +2518,10 @@ function create_if_block_5(ctx) {
|
|
|
2498
2518
|
};
|
|
2499
2519
|
}
|
|
2500
2520
|
|
|
2501
|
-
// (
|
|
2521
|
+
// (422:24) {#each choices.props as propName, i}
|
|
2502
2522
|
function create_each_block_2(ctx) {
|
|
2503
2523
|
let option;
|
|
2504
|
-
let t0_value = /*propName*/ ctx[
|
|
2524
|
+
let t0_value = /*propName*/ ctx[69] + "";
|
|
2505
2525
|
let t0;
|
|
2506
2526
|
let t1;
|
|
2507
2527
|
let option_selected_value;
|
|
@@ -2511,8 +2531,8 @@ function create_each_block_2(ctx) {
|
|
|
2511
2531
|
option = element("option");
|
|
2512
2532
|
t0 = text(t0_value);
|
|
2513
2533
|
t1 = space();
|
|
2514
|
-
option.selected = option_selected_value = /*i*/ ctx[
|
|
2515
|
-
option.__value = /*i*/ ctx[
|
|
2534
|
+
option.selected = option_selected_value = /*i*/ ctx[71] === /*choices*/ ctx[62].selected;
|
|
2535
|
+
option.__value = /*i*/ ctx[71];
|
|
2516
2536
|
option.value = option.__value;
|
|
2517
2537
|
},
|
|
2518
2538
|
m(target, anchor) {
|
|
@@ -2521,9 +2541,9 @@ function create_each_block_2(ctx) {
|
|
|
2521
2541
|
append(option, t1);
|
|
2522
2542
|
},
|
|
2523
2543
|
p(ctx, dirty) {
|
|
2524
|
-
if (dirty[0] & /*propsByType*/
|
|
2544
|
+
if (dirty[0] & /*propsByType*/ 4096 && t0_value !== (t0_value = /*propName*/ ctx[69] + "")) set_data(t0, t0_value);
|
|
2525
2545
|
|
|
2526
|
-
if (dirty[0] & /*propsByType*/
|
|
2546
|
+
if (dirty[0] & /*propsByType*/ 4096 && option_selected_value !== (option_selected_value = /*i*/ ctx[71] === /*choices*/ ctx[62].selected)) {
|
|
2527
2547
|
option.selected = option_selected_value;
|
|
2528
2548
|
}
|
|
2529
2549
|
},
|
|
@@ -2533,18 +2553,18 @@ function create_each_block_2(ctx) {
|
|
|
2533
2553
|
};
|
|
2534
2554
|
}
|
|
2535
2555
|
|
|
2536
|
-
// (
|
|
2556
|
+
// (445:46)
|
|
2537
2557
|
function create_if_block_4(ctx) {
|
|
2538
2558
|
let colorpicker;
|
|
2539
2559
|
let current;
|
|
2540
2560
|
|
|
2541
2561
|
function func(...args) {
|
|
2542
|
-
return /*func*/ ctx[
|
|
2562
|
+
return /*func*/ ctx[39](/*selectedName*/ ctx[63], ...args);
|
|
2543
2563
|
}
|
|
2544
2564
|
|
|
2545
2565
|
colorpicker = new ColorPicker$1({
|
|
2546
2566
|
props: {
|
|
2547
|
-
value: /*allCurrentPropDefs*/ ctx[
|
|
2567
|
+
value: /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value,
|
|
2548
2568
|
onChange: func
|
|
2549
2569
|
}
|
|
2550
2570
|
});
|
|
@@ -2560,8 +2580,8 @@ function create_if_block_4(ctx) {
|
|
|
2560
2580
|
p(new_ctx, dirty) {
|
|
2561
2581
|
ctx = new_ctx;
|
|
2562
2582
|
const colorpicker_changes = {};
|
|
2563
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2564
|
-
if (dirty[0] & /*propsByType*/
|
|
2583
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288) colorpicker_changes.value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value;
|
|
2584
|
+
if (dirty[0] & /*propsByType*/ 4096) colorpicker_changes.onChange = func;
|
|
2565
2585
|
colorpicker.$set(colorpicker_changes);
|
|
2566
2586
|
},
|
|
2567
2587
|
i(local) {
|
|
@@ -2579,12 +2599,12 @@ function create_if_block_4(ctx) {
|
|
|
2579
2599
|
};
|
|
2580
2600
|
}
|
|
2581
2601
|
|
|
2582
|
-
// (
|
|
2602
|
+
// (439:47)
|
|
2583
2603
|
function create_if_block_3(ctx) {
|
|
2584
2604
|
let select;
|
|
2585
2605
|
let mounted;
|
|
2586
2606
|
let dispose;
|
|
2587
|
-
let each_value_1 = /*allCurrentPropDefs*/ ctx[
|
|
2607
|
+
let each_value_1 = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].choices();
|
|
2588
2608
|
let each_blocks = [];
|
|
2589
2609
|
|
|
2590
2610
|
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
@@ -2592,7 +2612,7 @@ function create_if_block_3(ctx) {
|
|
|
2592
2612
|
}
|
|
2593
2613
|
|
|
2594
2614
|
function change_handler_2(...args) {
|
|
2595
|
-
return /*change_handler_2*/ ctx[
|
|
2615
|
+
return /*change_handler_2*/ ctx[38](/*selectedName*/ ctx[63], ...args);
|
|
2596
2616
|
}
|
|
2597
2617
|
|
|
2598
2618
|
return {
|
|
@@ -2618,8 +2638,8 @@ function create_if_block_3(ctx) {
|
|
|
2618
2638
|
p(new_ctx, dirty) {
|
|
2619
2639
|
ctx = new_ctx;
|
|
2620
2640
|
|
|
2621
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2622
|
-
each_value_1 = /*allCurrentPropDefs*/ ctx[
|
|
2641
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288) {
|
|
2642
|
+
each_value_1 = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].choices();
|
|
2623
2643
|
let i;
|
|
2624
2644
|
|
|
2625
2645
|
for (i = 0; i < each_value_1.length; i += 1) {
|
|
@@ -2652,7 +2672,7 @@ function create_if_block_3(ctx) {
|
|
|
2652
2672
|
};
|
|
2653
2673
|
}
|
|
2654
2674
|
|
|
2655
|
-
// (
|
|
2675
|
+
// (430:16) {#if propType === 'slider'}
|
|
2656
2676
|
function create_if_block_2(ctx) {
|
|
2657
2677
|
let input;
|
|
2658
2678
|
let input_min_value;
|
|
@@ -2661,13 +2681,13 @@ function create_if_block_2(ctx) {
|
|
|
2661
2681
|
let input_value_value;
|
|
2662
2682
|
let t0;
|
|
2663
2683
|
let span;
|
|
2664
|
-
let t1_value = /*allCurrentPropDefs*/ ctx[
|
|
2684
|
+
let t1_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].displayed + "";
|
|
2665
2685
|
let t1;
|
|
2666
2686
|
let mounted;
|
|
2667
2687
|
let dispose;
|
|
2668
2688
|
|
|
2669
2689
|
function change_handler_1(...args) {
|
|
2670
|
-
return /*change_handler_1*/ ctx[
|
|
2690
|
+
return /*change_handler_1*/ ctx[37](/*selectedName*/ ctx[63], ...args);
|
|
2671
2691
|
}
|
|
2672
2692
|
|
|
2673
2693
|
return {
|
|
@@ -2677,10 +2697,10 @@ function create_if_block_2(ctx) {
|
|
|
2677
2697
|
span = element("span");
|
|
2678
2698
|
t1 = text(t1_value);
|
|
2679
2699
|
attr(input, "type", "range");
|
|
2680
|
-
attr(input, "min", input_min_value = /*allCurrentPropDefs*/ ctx[
|
|
2681
|
-
attr(input, "max", input_max_value = /*allCurrentPropDefs*/ ctx[
|
|
2682
|
-
attr(input, "step", input_step_value = /*allCurrentPropDefs*/ ctx[
|
|
2683
|
-
input.value = input_value_value = /*allCurrentPropDefs*/ ctx[
|
|
2700
|
+
attr(input, "min", input_min_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].min);
|
|
2701
|
+
attr(input, "max", input_max_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].max);
|
|
2702
|
+
attr(input, "step", input_step_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].step || 1);
|
|
2703
|
+
input.value = input_value_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value;
|
|
2684
2704
|
attr(span, "class", "current-value");
|
|
2685
2705
|
},
|
|
2686
2706
|
m(target, anchor) {
|
|
@@ -2697,23 +2717,23 @@ function create_if_block_2(ctx) {
|
|
|
2697
2717
|
p(new_ctx, dirty) {
|
|
2698
2718
|
ctx = new_ctx;
|
|
2699
2719
|
|
|
2700
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2720
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && input_min_value !== (input_min_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].min)) {
|
|
2701
2721
|
attr(input, "min", input_min_value);
|
|
2702
2722
|
}
|
|
2703
2723
|
|
|
2704
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2724
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && input_max_value !== (input_max_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].max)) {
|
|
2705
2725
|
attr(input, "max", input_max_value);
|
|
2706
2726
|
}
|
|
2707
2727
|
|
|
2708
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2728
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && input_step_value !== (input_step_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].step || 1)) {
|
|
2709
2729
|
attr(input, "step", input_step_value);
|
|
2710
2730
|
}
|
|
2711
2731
|
|
|
2712
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2732
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && input_value_value !== (input_value_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value)) {
|
|
2713
2733
|
input.value = input_value_value;
|
|
2714
2734
|
}
|
|
2715
2735
|
|
|
2716
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2736
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && t1_value !== (t1_value = /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].displayed + "")) set_data(t1, t1_value);
|
|
2717
2737
|
},
|
|
2718
2738
|
i: noop$1,
|
|
2719
2739
|
o: noop$1,
|
|
@@ -2727,10 +2747,10 @@ function create_if_block_2(ctx) {
|
|
|
2727
2747
|
};
|
|
2728
2748
|
}
|
|
2729
2749
|
|
|
2730
|
-
// (
|
|
2750
|
+
// (441:24) {#each allCurrentPropDefs[selectedName].choices() as choice}
|
|
2731
2751
|
function create_each_block_1(ctx) {
|
|
2732
2752
|
let option;
|
|
2733
|
-
let t_value = /*choice*/ ctx[
|
|
2753
|
+
let t_value = /*choice*/ ctx[66] + "";
|
|
2734
2754
|
let t;
|
|
2735
2755
|
let option_selected_value;
|
|
2736
2756
|
let option_value_value;
|
|
@@ -2739,8 +2759,8 @@ function create_each_block_1(ctx) {
|
|
|
2739
2759
|
c() {
|
|
2740
2760
|
option = element("option");
|
|
2741
2761
|
t = text(t_value);
|
|
2742
|
-
option.selected = option_selected_value = /*choice*/ ctx[
|
|
2743
|
-
option.__value = option_value_value = " " + /*choice*/ ctx[
|
|
2762
|
+
option.selected = option_selected_value = /*choice*/ ctx[66] == /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value || null;
|
|
2763
|
+
option.__value = option_value_value = " " + /*choice*/ ctx[66] + " ";
|
|
2744
2764
|
option.value = option.__value;
|
|
2745
2765
|
},
|
|
2746
2766
|
m(target, anchor) {
|
|
@@ -2748,13 +2768,13 @@ function create_each_block_1(ctx) {
|
|
|
2748
2768
|
append(option, t);
|
|
2749
2769
|
},
|
|
2750
2770
|
p(ctx, dirty) {
|
|
2751
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2771
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && t_value !== (t_value = /*choice*/ ctx[66] + "")) set_data(t, t_value);
|
|
2752
2772
|
|
|
2753
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2773
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && option_selected_value !== (option_selected_value = /*choice*/ ctx[66] == /*allCurrentPropDefs*/ ctx[13][/*selectedName*/ ctx[63]].value || null)) {
|
|
2754
2774
|
option.selected = option_selected_value;
|
|
2755
2775
|
}
|
|
2756
2776
|
|
|
2757
|
-
if (dirty[0] & /*allCurrentPropDefs, propsByType*/
|
|
2777
|
+
if (dirty[0] & /*allCurrentPropDefs, propsByType*/ 12288 && option_value_value !== (option_value_value = " " + /*choice*/ ctx[66] + " ")) {
|
|
2758
2778
|
option.__value = option_value_value;
|
|
2759
2779
|
option.value = option.__value;
|
|
2760
2780
|
}
|
|
@@ -2765,28 +2785,37 @@ function create_each_block_1(ctx) {
|
|
|
2765
2785
|
};
|
|
2766
2786
|
}
|
|
2767
2787
|
|
|
2768
|
-
// (
|
|
2788
|
+
// (417:8) {#each Object.entries(propsByType) as [propType, choices]}
|
|
2769
2789
|
function create_each_block(ctx) {
|
|
2770
2790
|
let div;
|
|
2771
|
-
let
|
|
2791
|
+
let t0;
|
|
2792
|
+
let span;
|
|
2793
|
+
let t2;
|
|
2772
2794
|
let current_block_type_index;
|
|
2773
2795
|
let if_block1;
|
|
2774
2796
|
let current;
|
|
2797
|
+
let mounted;
|
|
2798
|
+
let dispose;
|
|
2775
2799
|
|
|
2776
2800
|
function select_block_type(ctx, dirty) {
|
|
2777
|
-
if (/*choices*/ ctx[
|
|
2801
|
+
if (/*choices*/ ctx[62].props.length > 1) return create_if_block_5;
|
|
2778
2802
|
return create_else_block;
|
|
2779
2803
|
}
|
|
2780
2804
|
|
|
2781
2805
|
let current_block_type = select_block_type(ctx);
|
|
2782
2806
|
let if_block0 = current_block_type(ctx);
|
|
2807
|
+
|
|
2808
|
+
function click_handler_3() {
|
|
2809
|
+
return /*click_handler_3*/ ctx[36](/*selectedName*/ ctx[63]);
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2783
2812
|
const if_block_creators = [create_if_block_2, create_if_block_3, create_if_block_4];
|
|
2784
2813
|
const if_blocks = [];
|
|
2785
2814
|
|
|
2786
2815
|
function select_block_type_1(ctx, dirty) {
|
|
2787
|
-
if (/*propType*/ ctx[
|
|
2788
|
-
if (/*propType*/ ctx[
|
|
2789
|
-
if (/*propType*/ ctx[
|
|
2816
|
+
if (/*propType*/ ctx[61] === 'slider') return 0;
|
|
2817
|
+
if (/*propType*/ ctx[61] == 'select') return 1;
|
|
2818
|
+
if (/*propType*/ ctx[61] == 'color') return 2;
|
|
2790
2819
|
return -1;
|
|
2791
2820
|
}
|
|
2792
2821
|
|
|
@@ -2798,22 +2827,35 @@ function create_each_block(ctx) {
|
|
|
2798
2827
|
c() {
|
|
2799
2828
|
div = element("div");
|
|
2800
2829
|
if_block0.c();
|
|
2801
|
-
|
|
2830
|
+
t0 = space();
|
|
2831
|
+
span = element("span");
|
|
2832
|
+
span.textContent = "✕";
|
|
2833
|
+
t2 = space();
|
|
2802
2834
|
if (if_block1) if_block1.c();
|
|
2835
|
+
attr(span, "class", "delete");
|
|
2803
2836
|
attr(div, "class", "prop-section");
|
|
2804
2837
|
},
|
|
2805
2838
|
m(target, anchor) {
|
|
2806
2839
|
insert(target, div, anchor);
|
|
2807
2840
|
if_block0.m(div, null);
|
|
2808
|
-
append(div,
|
|
2841
|
+
append(div, t0);
|
|
2842
|
+
append(div, span);
|
|
2843
|
+
append(div, t2);
|
|
2809
2844
|
|
|
2810
2845
|
if (~current_block_type_index) {
|
|
2811
2846
|
if_blocks[current_block_type_index].m(div, null);
|
|
2812
2847
|
}
|
|
2813
2848
|
|
|
2814
2849
|
current = true;
|
|
2850
|
+
|
|
2851
|
+
if (!mounted) {
|
|
2852
|
+
dispose = listen(span, "click", click_handler_3);
|
|
2853
|
+
mounted = true;
|
|
2854
|
+
}
|
|
2815
2855
|
},
|
|
2816
|
-
p(
|
|
2856
|
+
p(new_ctx, dirty) {
|
|
2857
|
+
ctx = new_ctx;
|
|
2858
|
+
|
|
2817
2859
|
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block0) {
|
|
2818
2860
|
if_block0.p(ctx, dirty);
|
|
2819
2861
|
} else {
|
|
@@ -2822,7 +2864,7 @@ function create_each_block(ctx) {
|
|
|
2822
2864
|
|
|
2823
2865
|
if (if_block0) {
|
|
2824
2866
|
if_block0.c();
|
|
2825
|
-
if_block0.m(div,
|
|
2867
|
+
if_block0.m(div, t0);
|
|
2826
2868
|
}
|
|
2827
2869
|
}
|
|
2828
2870
|
|
|
@@ -2877,11 +2919,14 @@ function create_each_block(ctx) {
|
|
|
2877
2919
|
if (~current_block_type_index) {
|
|
2878
2920
|
if_blocks[current_block_type_index].d();
|
|
2879
2921
|
}
|
|
2922
|
+
|
|
2923
|
+
mounted = false;
|
|
2924
|
+
dispose();
|
|
2880
2925
|
}
|
|
2881
2926
|
};
|
|
2882
2927
|
}
|
|
2883
2928
|
|
|
2884
|
-
// (
|
|
2929
|
+
// (453:8) {#if currentRule === 'inline' && bringableToFront[selectedElemIndex] !== null}
|
|
2885
2930
|
function create_if_block_1(ctx) {
|
|
2886
2931
|
let div;
|
|
2887
2932
|
let mounted;
|
|
@@ -2892,7 +2937,7 @@ function create_if_block_1(ctx) {
|
|
|
2892
2937
|
div = element("div");
|
|
2893
2938
|
div.textContent = "Bring to front";
|
|
2894
2939
|
attr(div, "class", "btn");
|
|
2895
|
-
toggle_class(div, "active", /*bringableToFront*/ ctx[
|
|
2940
|
+
toggle_class(div, "active", /*bringableToFront*/ ctx[14][/*selectedElemIndex*/ ctx[4]] === true);
|
|
2896
2941
|
},
|
|
2897
2942
|
m(target, anchor) {
|
|
2898
2943
|
insert(target, div, anchor);
|
|
@@ -2903,8 +2948,8 @@ function create_if_block_1(ctx) {
|
|
|
2903
2948
|
}
|
|
2904
2949
|
},
|
|
2905
2950
|
p(ctx, dirty) {
|
|
2906
|
-
if (dirty[0] & /*bringableToFront, selectedElemIndex*/
|
|
2907
|
-
toggle_class(div, "active", /*bringableToFront*/ ctx[
|
|
2951
|
+
if (dirty[0] & /*bringableToFront, selectedElemIndex*/ 16400) {
|
|
2952
|
+
toggle_class(div, "active", /*bringableToFront*/ ctx[14][/*selectedElemIndex*/ ctx[4]] === true);
|
|
2908
2953
|
}
|
|
2909
2954
|
},
|
|
2910
2955
|
d(detaching) {
|
|
@@ -2994,7 +3039,7 @@ function create_fragment(ctx) {
|
|
|
2994
3039
|
t10 = space();
|
|
2995
3040
|
if (if_block1) if_block1.c();
|
|
2996
3041
|
set_style(div0, "position", "absolute");
|
|
2997
|
-
attr(path, "d", /*pathWithHoles*/ ctx[
|
|
3042
|
+
attr(path, "d", /*pathWithHoles*/ ctx[10]);
|
|
2998
3043
|
attr(clipPath, "id", "overlay-clip");
|
|
2999
3044
|
attr(clipPath, "clip-rule", "evenodd");
|
|
3000
3045
|
attr(rect, "y", "0");
|
|
@@ -3006,8 +3051,8 @@ function create_fragment(ctx) {
|
|
|
3006
3051
|
attr(svg, "version", "1.1");
|
|
3007
3052
|
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
3008
3053
|
attr(svg, "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
|
3009
|
-
attr(svg, "width", svg_width_value = /*pageDimensions*/ ctx[
|
|
3010
|
-
attr(svg, "height", svg_height_value = /*pageDimensions*/ ctx[
|
|
3054
|
+
attr(svg, "width", svg_width_value = /*pageDimensions*/ ctx[11].width);
|
|
3055
|
+
attr(svg, "height", svg_height_value = /*pageDimensions*/ ctx[11].height);
|
|
3011
3056
|
attr(div1, "class", "close-button");
|
|
3012
3057
|
attr(div2, "class", "select-tab");
|
|
3013
3058
|
attr(div3, "class", "select-tab");
|
|
@@ -3047,7 +3092,7 @@ function create_fragment(ctx) {
|
|
|
3047
3092
|
|
|
3048
3093
|
append(div4, t10);
|
|
3049
3094
|
if (if_block1) if_block1.m(div4, null);
|
|
3050
|
-
/*div4_binding*/ ctx[
|
|
3095
|
+
/*div4_binding*/ ctx[40](div4);
|
|
3051
3096
|
current = true;
|
|
3052
3097
|
|
|
3053
3098
|
if (!mounted) {
|
|
@@ -3060,15 +3105,15 @@ function create_fragment(ctx) {
|
|
|
3060
3105
|
}
|
|
3061
3106
|
},
|
|
3062
3107
|
p(ctx, dirty) {
|
|
3063
|
-
if (!current || dirty[0] & /*pathWithHoles*/
|
|
3064
|
-
attr(path, "d", /*pathWithHoles*/ ctx[
|
|
3108
|
+
if (!current || dirty[0] & /*pathWithHoles*/ 1024) {
|
|
3109
|
+
attr(path, "d", /*pathWithHoles*/ ctx[10]);
|
|
3065
3110
|
}
|
|
3066
3111
|
|
|
3067
|
-
if (!current || dirty[0] & /*pageDimensions*/
|
|
3112
|
+
if (!current || dirty[0] & /*pageDimensions*/ 2048 && svg_width_value !== (svg_width_value = /*pageDimensions*/ ctx[11].width)) {
|
|
3068
3113
|
attr(svg, "width", svg_width_value);
|
|
3069
3114
|
}
|
|
3070
3115
|
|
|
3071
|
-
if (!current || dirty[0] & /*pageDimensions*/
|
|
3116
|
+
if (!current || dirty[0] & /*pageDimensions*/ 2048 && svg_height_value !== (svg_height_value = /*pageDimensions*/ ctx[11].height)) {
|
|
3072
3117
|
attr(svg, "height", svg_height_value);
|
|
3073
3118
|
}
|
|
3074
3119
|
|
|
@@ -3085,7 +3130,7 @@ function create_fragment(ctx) {
|
|
|
3085
3130
|
if_block0 = null;
|
|
3086
3131
|
}
|
|
3087
3132
|
|
|
3088
|
-
if (dirty[0] & /*allRules, selectedElemIndex, selectedRuleIndex, selectRule*/
|
|
3133
|
+
if (dirty[0] & /*allRules, selectedElemIndex, selectedRuleIndex, selectRule*/ 2097204) {
|
|
3089
3134
|
each_value_4 = getRuleNames(/*allRules*/ ctx[2][/*selectedElemIndex*/ ctx[4]]);
|
|
3090
3135
|
let i;
|
|
3091
3136
|
|
|
@@ -3108,7 +3153,7 @@ function create_fragment(ctx) {
|
|
|
3108
3153
|
each_blocks_1.length = each_value_4.length;
|
|
3109
3154
|
}
|
|
3110
3155
|
|
|
3111
|
-
if (dirty[0] & /*selectedTypeIndex, allTypes, selectedElemIndex, currentRule, hasDisplayedCustom*/
|
|
3156
|
+
if (dirty[0] & /*selectedTypeIndex, allTypes, selectedElemIndex, currentRule, hasDisplayedCustom*/ 98392) {
|
|
3112
3157
|
each_value_3 = /*allTypes*/ ctx[3][/*selectedElemIndex*/ ctx[4]] || [];
|
|
3113
3158
|
let i;
|
|
3114
3159
|
|
|
@@ -3175,7 +3220,7 @@ function create_fragment(ctx) {
|
|
|
3175
3220
|
destroy_each(each_blocks_1, detaching);
|
|
3176
3221
|
destroy_each(each_blocks, detaching);
|
|
3177
3222
|
if (if_block1) if_block1.d();
|
|
3178
|
-
/*div4_binding*/ ctx[
|
|
3223
|
+
/*div4_binding*/ ctx[40](null);
|
|
3179
3224
|
mounted = false;
|
|
3180
3225
|
run_all(dispose);
|
|
3181
3226
|
}
|
|
@@ -3289,10 +3334,10 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3289
3334
|
"font-size": {
|
|
3290
3335
|
type: "slider",
|
|
3291
3336
|
min: 0,
|
|
3292
|
-
max:
|
|
3337
|
+
max: 40,
|
|
3293
3338
|
suffix: 'px'
|
|
3294
3339
|
},
|
|
3295
|
-
"font-weight": { type: "slider", min: 0, max:
|
|
3340
|
+
"font-weight": { type: "slider", min: 0, max: 800 },
|
|
3296
3341
|
"color": { type: "color" },
|
|
3297
3342
|
"stroke-width": {
|
|
3298
3343
|
type: "slider",
|
|
@@ -3348,13 +3393,11 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3348
3393
|
let allCurrentPropDefs = {}; // propName => selectorDef
|
|
3349
3394
|
let bringableToFront = []; // null = not bringable, true = bringable, false = was bringed
|
|
3350
3395
|
let hasDisplayedCustom = false;
|
|
3351
|
-
|
|
3352
|
-
// $: curType = allTypes[selectedElemIndex]?.[selectedTypeIndex];
|
|
3353
3396
|
let curType;
|
|
3354
3397
|
|
|
3355
3398
|
onMount(() => {
|
|
3356
3399
|
close();
|
|
3357
|
-
$$invalidate(
|
|
3400
|
+
$$invalidate(28, elementToListen = self.parentNode);
|
|
3358
3401
|
document.body.appendChild(self);
|
|
3359
3402
|
document.body.appendChild(helperElemWrapper);
|
|
3360
3403
|
document.body.appendChild(positionAnchor);
|
|
@@ -3380,6 +3423,44 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3380
3423
|
return getFonts();
|
|
3381
3424
|
}
|
|
3382
3425
|
|
|
3426
|
+
function initAndGroup() {
|
|
3427
|
+
const allProps = { ...cssPropByType, ...customProps };
|
|
3428
|
+
const _allCurrentPropDefs = pick(allProps, propByType[curType]);
|
|
3429
|
+
|
|
3430
|
+
Object.keys(_allCurrentPropDefs).forEach(key => {
|
|
3431
|
+
const propSelectType = _allCurrentPropDefs[key].type;
|
|
3432
|
+
let retrieveType = 'number';
|
|
3433
|
+
if (propSelectType === 'color') retrieveType = 'rgb'; else if (propSelectType === 'select') retrieveType = 'raw';
|
|
3434
|
+
|
|
3435
|
+
if (_allCurrentPropDefs[key].getter) {
|
|
3436
|
+
const val = _allCurrentPropDefs[key].getter(currentElement);
|
|
3437
|
+
|
|
3438
|
+
if (val === null) {
|
|
3439
|
+
delete _allCurrentPropDefs[key];
|
|
3440
|
+
return;
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
_allCurrentPropDefs[key].value = val;
|
|
3444
|
+
_allCurrentPropDefs[key].displayed = val;
|
|
3445
|
+
} else {
|
|
3446
|
+
_allCurrentPropDefs[key].displayed = getComputedPropValue(currentElement, key, 'raw');
|
|
3447
|
+
_allCurrentPropDefs[key].value = getComputedPropValue(currentElement, key, retrieveType);
|
|
3448
|
+
}
|
|
3449
|
+
});
|
|
3450
|
+
|
|
3451
|
+
$$invalidate(12, propsByType = Object.entries(_allCurrentPropDefs).reduce(
|
|
3452
|
+
(byType, [propName, selectorDef]) => {
|
|
3453
|
+
const selectorType = selectorDef.type;
|
|
3454
|
+
if (!(selectorType in byType)) byType[selectorType] = { selected: 0, props: [propName] }; else byType[selectorType].props.push(propName);
|
|
3455
|
+
return byType;
|
|
3456
|
+
},
|
|
3457
|
+
{}
|
|
3458
|
+
));
|
|
3459
|
+
|
|
3460
|
+
$$invalidate(13, allCurrentPropDefs = _allCurrentPropDefs);
|
|
3461
|
+
updateHelpers();
|
|
3462
|
+
}
|
|
3463
|
+
|
|
3383
3464
|
let warningDisplayed = new Set();
|
|
3384
3465
|
|
|
3385
3466
|
function getMatchedCSSRules(elems) {
|
|
@@ -3464,17 +3545,17 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3464
3545
|
$$invalidate(4, selectedElemIndex = 0);
|
|
3465
3546
|
$$invalidate(5, selectedRuleIndex = 0);
|
|
3466
3547
|
$$invalidate(6, selectedTypeIndex = 0);
|
|
3467
|
-
$$invalidate(
|
|
3548
|
+
$$invalidate(14, bringableToFront = []);
|
|
3468
3549
|
$$invalidate(3, allTypes = []);
|
|
3469
3550
|
$$invalidate(2, allRules = []);
|
|
3470
3551
|
$$invalidate(1, targetsToSearch = [el, ...getAdditionalElems(el)]);
|
|
3471
3552
|
$$invalidate(3, allTypes = getEditableTypes(targetsToSearch));
|
|
3472
|
-
$$invalidate(
|
|
3553
|
+
$$invalidate(15, hasDisplayedCustom = false);
|
|
3473
3554
|
$$invalidate(2, allRules = getMatchedCSSRules(targetsToSearch));
|
|
3474
3555
|
|
|
3475
3556
|
for (let def of Object.values(customProps)) {
|
|
3476
3557
|
if (def.getter(el) !== null) {
|
|
3477
|
-
$$invalidate(
|
|
3558
|
+
$$invalidate(15, hasDisplayedCustom = true);
|
|
3478
3559
|
break;
|
|
3479
3560
|
}
|
|
3480
3561
|
}
|
|
@@ -3490,9 +3571,9 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3490
3571
|
}
|
|
3491
3572
|
|
|
3492
3573
|
function close() {
|
|
3493
|
-
$$invalidate(
|
|
3494
|
-
$$invalidate(
|
|
3495
|
-
$$invalidate(
|
|
3574
|
+
$$invalidate(8, self.style.display = "none", self);
|
|
3575
|
+
$$invalidate(9, helperElemWrapper.style.display = "none", helperElemWrapper);
|
|
3576
|
+
$$invalidate(10, pathWithHoles = '');
|
|
3496
3577
|
}
|
|
3497
3578
|
|
|
3498
3579
|
function isOpened() {
|
|
@@ -3512,13 +3593,14 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3512
3593
|
? pageDimensions.height - 450
|
|
3513
3594
|
: y + 10;
|
|
3514
3595
|
|
|
3515
|
-
$$invalidate(
|
|
3516
|
-
$$invalidate(
|
|
3517
|
-
$$invalidate(
|
|
3518
|
-
$$invalidate(
|
|
3596
|
+
$$invalidate(8, self.style.left = x + "px", self);
|
|
3597
|
+
$$invalidate(8, self.style.top = y + "px", self);
|
|
3598
|
+
$$invalidate(9, helperElemWrapper.style.display = "block", helperElemWrapper);
|
|
3599
|
+
$$invalidate(8, self.style.display = "block", self);
|
|
3519
3600
|
}
|
|
3520
3601
|
|
|
3521
|
-
function updateHelpers() {
|
|
3602
|
+
async function updateHelpers() {
|
|
3603
|
+
await tick();
|
|
3522
3604
|
if (!currentRule) return;
|
|
3523
3605
|
let matching;
|
|
3524
3606
|
|
|
@@ -3528,7 +3610,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3528
3610
|
}
|
|
3529
3611
|
|
|
3530
3612
|
const boundingBoxes = matching.map(el => getBoundingBoxInfos(el, 10));
|
|
3531
|
-
$$invalidate(
|
|
3613
|
+
$$invalidate(10, pathWithHoles = computeContours(boundingBoxes, pageDimensions));
|
|
3532
3614
|
}
|
|
3533
3615
|
|
|
3534
3616
|
function _updateProp(propName, val, suffix) {
|
|
@@ -3543,8 +3625,8 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3543
3625
|
}
|
|
3544
3626
|
} else currentRule.style.setProperty(propName, finalValue);
|
|
3545
3627
|
|
|
3546
|
-
$$invalidate(
|
|
3547
|
-
$$invalidate(
|
|
3628
|
+
$$invalidate(13, allCurrentPropDefs[propName].value = val, allCurrentPropDefs);
|
|
3629
|
+
$$invalidate(13, allCurrentPropDefs[propName].displayed = finalValue, allCurrentPropDefs);
|
|
3548
3630
|
onStyleChanged(currentElement, currentRule, propName, finalValue);
|
|
3549
3631
|
updateHelpers();
|
|
3550
3632
|
}
|
|
@@ -3558,7 +3640,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3558
3640
|
const marginTop = parseInt(bodyStyle.marginTop);
|
|
3559
3641
|
const marginBottom = parseInt(bodyStyle.marginBottom);
|
|
3560
3642
|
|
|
3561
|
-
$$invalidate(
|
|
3643
|
+
$$invalidate(11, pageDimensions = {
|
|
3562
3644
|
width: document.body.offsetWidth + marginLeft + marginRight,
|
|
3563
3645
|
height: document.body.offsetHeight + marginTop + marginBottom
|
|
3564
3646
|
});
|
|
@@ -3576,10 +3658,20 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3576
3658
|
}
|
|
3577
3659
|
|
|
3578
3660
|
function bringToFront() {
|
|
3579
|
-
$$invalidate(
|
|
3661
|
+
$$invalidate(14, bringableToFront[selectedElemIndex] = false, bringableToFront);
|
|
3580
3662
|
currentElement.parentNode.appendChild(currentElement);
|
|
3581
3663
|
}
|
|
3582
3664
|
|
|
3665
|
+
function deleteProp(propName) {
|
|
3666
|
+
if (currentRule === 'inline') {
|
|
3667
|
+
currentElement.style.removeProperty(propName);
|
|
3668
|
+
} else {
|
|
3669
|
+
currentRule.style.removeProperty(propName);
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
initAndGroup();
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3583
3675
|
function selectRule(ruleIndex) {
|
|
3584
3676
|
const newRule = allRules[selectedElemIndex]?.[ruleIndex];
|
|
3585
3677
|
|
|
@@ -3593,14 +3685,14 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3593
3685
|
function div0_binding($$value) {
|
|
3594
3686
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
3595
3687
|
positionAnchor = $$value;
|
|
3596
|
-
$$invalidate(
|
|
3688
|
+
$$invalidate(7, positionAnchor);
|
|
3597
3689
|
});
|
|
3598
3690
|
}
|
|
3599
3691
|
|
|
3600
3692
|
function svg_binding($$value) {
|
|
3601
3693
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
3602
3694
|
helperElemWrapper = $$value;
|
|
3603
|
-
$$invalidate(
|
|
3695
|
+
$$invalidate(9, helperElemWrapper);
|
|
3604
3696
|
});
|
|
3605
3697
|
}
|
|
3606
3698
|
|
|
@@ -3618,10 +3710,11 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3618
3710
|
};
|
|
3619
3711
|
|
|
3620
3712
|
const change_handler = async (choices, each_value, each_index, e) => {
|
|
3621
|
-
$$invalidate(
|
|
3713
|
+
$$invalidate(12, each_value[each_index][1].selected = e.target.value, propsByType);
|
|
3622
3714
|
await tick();
|
|
3623
3715
|
};
|
|
3624
3716
|
|
|
3717
|
+
const click_handler_3 = selectedName => deleteProp(selectedName);
|
|
3625
3718
|
const change_handler_1 = (selectedName, e) => updateProp(selectedName, e.target.value, allCurrentPropDefs[selectedName].suffix, e.target);
|
|
3626
3719
|
const change_handler_2 = (selectedName, e) => updateProp(selectedName, e.target.value);
|
|
3627
3720
|
const func = (selectedName, color) => updateProp(selectedName, color);
|
|
@@ -3629,19 +3722,19 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3629
3722
|
function div4_binding($$value) {
|
|
3630
3723
|
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
3631
3724
|
self = $$value;
|
|
3632
|
-
$$invalidate(
|
|
3725
|
+
$$invalidate(8, self);
|
|
3633
3726
|
});
|
|
3634
3727
|
}
|
|
3635
3728
|
|
|
3636
3729
|
$$self.$$set = $$props => {
|
|
3637
|
-
if ('getAdditionalElems' in $$props) $$invalidate(
|
|
3638
|
-
if ('listenOnClick' in $$props) $$invalidate(
|
|
3639
|
-
if ('onStyleChanged' in $$props) $$invalidate(
|
|
3640
|
-
if ('customProps' in $$props) $$invalidate(
|
|
3730
|
+
if ('getAdditionalElems' in $$props) $$invalidate(22, getAdditionalElems = $$props.getAdditionalElems);
|
|
3731
|
+
if ('listenOnClick' in $$props) $$invalidate(23, listenOnClick = $$props.listenOnClick);
|
|
3732
|
+
if ('onStyleChanged' in $$props) $$invalidate(24, onStyleChanged = $$props.onStyleChanged);
|
|
3733
|
+
if ('customProps' in $$props) $$invalidate(25, customProps = $$props.customProps);
|
|
3641
3734
|
};
|
|
3642
3735
|
|
|
3643
3736
|
$$self.$$.update = () => {
|
|
3644
|
-
if ($$self.$$.dirty[0] & /*elementToListen*/
|
|
3737
|
+
if ($$self.$$.dirty[0] & /*elementToListen*/ 268435456) {
|
|
3645
3738
|
{
|
|
3646
3739
|
if (elementToListen !== null) {
|
|
3647
3740
|
init();
|
|
@@ -3650,58 +3743,25 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3650
3743
|
}
|
|
3651
3744
|
|
|
3652
3745
|
if ($$self.$$.dirty[0] & /*targetsToSearch, selectedElemIndex*/ 18) {
|
|
3653
|
-
|
|
3746
|
+
currentElement = targetsToSearch[selectedElemIndex];
|
|
3654
3747
|
}
|
|
3655
3748
|
|
|
3656
3749
|
if ($$self.$$.dirty[0] & /*allRules, selectedElemIndex, selectedRuleIndex*/ 52) {
|
|
3657
|
-
$$invalidate(
|
|
3750
|
+
$$invalidate(16, currentRule = allRules[selectedElemIndex]?.[selectedRuleIndex]);
|
|
3658
3751
|
}
|
|
3659
3752
|
|
|
3660
|
-
if ($$self.$$.dirty[0] & /*allTypes, selectedElemIndex, selectedTypeIndex, curType*/
|
|
3753
|
+
if ($$self.$$.dirty[0] & /*allTypes, selectedElemIndex, selectedTypeIndex, curType*/ 536871000) {
|
|
3661
3754
|
{
|
|
3662
3755
|
if (allTypes[selectedElemIndex]?.[selectedTypeIndex] !== curType) {
|
|
3663
|
-
$$invalidate(
|
|
3756
|
+
$$invalidate(29, curType = allTypes[selectedElemIndex]?.[selectedTypeIndex]);
|
|
3664
3757
|
}
|
|
3665
3758
|
}
|
|
3666
3759
|
}
|
|
3667
3760
|
|
|
3668
|
-
if ($$self.$$.dirty[0] & /*curType,
|
|
3761
|
+
if ($$self.$$.dirty[0] & /*curType, selectedRuleIndex, selectedElemIndex*/ 536870960) {
|
|
3669
3762
|
{
|
|
3670
|
-
if (curType
|
|
3671
|
-
|
|
3672
|
-
const _allCurrentPropDefs = pick(allProps, propByType[curType]);
|
|
3673
|
-
|
|
3674
|
-
Object.keys(_allCurrentPropDefs).forEach(key => {
|
|
3675
|
-
const propSelectType = _allCurrentPropDefs[key].type;
|
|
3676
|
-
let retrieveType = 'number';
|
|
3677
|
-
if (propSelectType === 'color') retrieveType = 'rgb'; else if (propSelectType === 'select') retrieveType = 'raw';
|
|
3678
|
-
|
|
3679
|
-
if (_allCurrentPropDefs[key].getter) {
|
|
3680
|
-
const val = _allCurrentPropDefs[key].getter(currentElement);
|
|
3681
|
-
|
|
3682
|
-
if (val === null) {
|
|
3683
|
-
delete _allCurrentPropDefs[key];
|
|
3684
|
-
return;
|
|
3685
|
-
}
|
|
3686
|
-
|
|
3687
|
-
_allCurrentPropDefs[key].value = val;
|
|
3688
|
-
_allCurrentPropDefs[key].displayed = val;
|
|
3689
|
-
} else {
|
|
3690
|
-
_allCurrentPropDefs[key].displayed = getComputedPropValue(currentElement, key, 'raw');
|
|
3691
|
-
_allCurrentPropDefs[key].value = getComputedPropValue(currentElement, key, retrieveType);
|
|
3692
|
-
}
|
|
3693
|
-
});
|
|
3694
|
-
|
|
3695
|
-
$$invalidate(13, propsByType = Object.entries(_allCurrentPropDefs).reduce(
|
|
3696
|
-
(byType, [propName, selectorDef]) => {
|
|
3697
|
-
const selectorType = selectorDef.type;
|
|
3698
|
-
if (!(selectorType in byType)) byType[selectorType] = { selected: 0, props: [propName] }; else byType[selectorType].props.push(propName);
|
|
3699
|
-
return byType;
|
|
3700
|
-
},
|
|
3701
|
-
{}
|
|
3702
|
-
));
|
|
3703
|
-
|
|
3704
|
-
$$invalidate(14, allCurrentPropDefs = _allCurrentPropDefs);
|
|
3763
|
+
if (curType || selectedRuleIndex || selectedElemIndex) {
|
|
3764
|
+
initAndGroup();
|
|
3705
3765
|
}
|
|
3706
3766
|
}
|
|
3707
3767
|
}
|
|
@@ -3715,7 +3775,6 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3715
3775
|
selectedElemIndex,
|
|
3716
3776
|
selectedRuleIndex,
|
|
3717
3777
|
selectedTypeIndex,
|
|
3718
|
-
currentRule,
|
|
3719
3778
|
positionAnchor,
|
|
3720
3779
|
self,
|
|
3721
3780
|
helperElemWrapper,
|
|
@@ -3725,9 +3784,11 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3725
3784
|
allCurrentPropDefs,
|
|
3726
3785
|
bringableToFront,
|
|
3727
3786
|
hasDisplayedCustom,
|
|
3787
|
+
currentRule,
|
|
3728
3788
|
overlayClicked,
|
|
3729
3789
|
updateProp,
|
|
3730
3790
|
bringToFront,
|
|
3791
|
+
deleteProp,
|
|
3731
3792
|
selectRule,
|
|
3732
3793
|
getAdditionalElems,
|
|
3733
3794
|
listenOnClick,
|
|
@@ -3737,13 +3798,13 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
3737
3798
|
isOpened,
|
|
3738
3799
|
elementToListen,
|
|
3739
3800
|
curType,
|
|
3740
|
-
currentElement,
|
|
3741
3801
|
div0_binding,
|
|
3742
3802
|
svg_binding,
|
|
3743
3803
|
click_handler,
|
|
3744
3804
|
click_handler_1,
|
|
3745
3805
|
click_handler_2,
|
|
3746
3806
|
change_handler,
|
|
3807
|
+
click_handler_3,
|
|
3747
3808
|
change_handler_1,
|
|
3748
3809
|
change_handler_2,
|
|
3749
3810
|
func,
|
|
@@ -3762,13 +3823,13 @@ class InlineStyleEditor$1 extends SvelteComponent {
|
|
|
3762
3823
|
create_fragment,
|
|
3763
3824
|
safe_not_equal,
|
|
3764
3825
|
{
|
|
3765
|
-
getAdditionalElems:
|
|
3766
|
-
listenOnClick:
|
|
3767
|
-
onStyleChanged:
|
|
3768
|
-
customProps:
|
|
3769
|
-
open:
|
|
3826
|
+
getAdditionalElems: 22,
|
|
3827
|
+
listenOnClick: 23,
|
|
3828
|
+
onStyleChanged: 24,
|
|
3829
|
+
customProps: 25,
|
|
3830
|
+
open: 26,
|
|
3770
3831
|
close: 0,
|
|
3771
|
-
isOpened:
|
|
3832
|
+
isOpened: 27
|
|
3772
3833
|
},
|
|
3773
3834
|
null,
|
|
3774
3835
|
[-1, -1, -1]
|
|
@@ -3776,7 +3837,7 @@ class InlineStyleEditor$1 extends SvelteComponent {
|
|
|
3776
3837
|
}
|
|
3777
3838
|
|
|
3778
3839
|
get open() {
|
|
3779
|
-
return this.$$.ctx[
|
|
3840
|
+
return this.$$.ctx[26];
|
|
3780
3841
|
}
|
|
3781
3842
|
|
|
3782
3843
|
get close() {
|
|
@@ -3784,7 +3845,7 @@ class InlineStyleEditor$1 extends SvelteComponent {
|
|
|
3784
3845
|
}
|
|
3785
3846
|
|
|
3786
3847
|
get isOpened() {
|
|
3787
|
-
return this.$$.ctx[
|
|
3848
|
+
return this.$$.ctx[27];
|
|
3788
3849
|
}
|
|
3789
3850
|
}
|
|
3790
3851
|
|